From ce658d070925effea8c626b2ada2f819d01ab4fb Mon Sep 17 00:00:00 2001 From: darealshinji Date: Sun, 17 Jun 2018 20:14:35 +0200 Subject: [PATCH 001/271] Update config.sub, config.guess, install-sh (#77) --- config.guess | 690 ++++++++++---------- config.sub | 1698 +++++++++++++++++++++++++------------------------- install-sh | 376 ++++++----- 3 files changed, 1408 insertions(+), 1356 deletions(-) diff --git a/config.guess b/config.guess index 1f5c50c0d..883a6713b 100755 --- a/config.guess +++ b/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2014-03-23' +timestamp='2018-05-19' # 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 @@ -15,7 +15,7 @@ timestamp='2014-03-23' # 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 . +# 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 @@ -24,12 +24,12 @@ timestamp='2014-03-23' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # 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 +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -39,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2018 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." @@ -106,10 +106,10 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; { 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 ; +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 + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; @@ -132,14 +132,14 @@ 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 -case "${UNAME_SYSTEM}" in +case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu - eval $set_cc_for_build - cat <<-EOF > $dummy.c + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc @@ -149,13 +149,20 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +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*, @@ -168,21 +175,31 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # 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 + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/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 ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-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 + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -197,44 +214,67 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in os=netbsd ;; esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + 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 + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; 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}" + echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -251,63 +291,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 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" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + 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'` + 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 + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -319,7 +350,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -346,38 +377,38 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + 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/[^.]*//'` + 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/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" + 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 [ "$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) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + 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/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -386,25 +417,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + 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 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + 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 @@ -415,44 +446,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # 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} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -461,23 +492,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + 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); + 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); + 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` && + $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} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -503,17 +534,17 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -530,7 +561,7 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + 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 @@ -542,14 +573,14 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + 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 + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -560,7 +591,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -574,26 +605,27 @@ EOF 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 + 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` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) 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 + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -608,28 +640,28 @@ EOF 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 ;; + 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 + 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 + 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 + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -662,13 +694,13 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (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" ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + 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 @@ -679,23 +711,23 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + 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} + 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 + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -720,11 +752,11 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $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:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -733,7 +765,7 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -741,9 +773,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -768,127 +800,109 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + 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/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + 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/ /_/'` + 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/ /_/'` + 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} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + 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/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + 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 + 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/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`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/[-(].*//'`-${LIBC} + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -901,58 +915,64 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + 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-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el @@ -966,64 +986,70 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} + echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-"$LIBC" 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-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} + echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1037,34 +1063,34 @@ EOF # 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} + 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 + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-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} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*: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} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1074,12 +1100,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + 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 @@ -1089,9 +1115,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1099,7 +1125,7 @@ EOF # 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 + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1111,9 +1137,9 @@ EOF 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 + 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 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1133,9 +1159,9 @@ EOF 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; } + && { 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; } ;; + && { 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; } ;; @@ -1144,28 +1170,28 @@ EOF 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; } + && { 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; } + && { 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; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + 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} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1176,7 +1202,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1196,23 +1222,23 @@ EOF exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + 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} + 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} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1231,46 +1257,56 @@ EOF echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build + eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + 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 + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub @@ -1281,27 +1317,33 @@ EOF # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + 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} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1310,18 +1352,18 @@ EOF echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + 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 + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1342,14 +1384,14 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1358,34 +1400,48 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs exit ;; esac +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp @@ -1404,16 +1460,16 @@ hostinfo = `(hostinfo) 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} +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) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/config.sub b/config.sub index d654d03cd..d1f5b5490 100755 --- a/config.sub +++ b/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2014-05-01' +timestamp='2018-05-24' # 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 @@ -15,7 +15,7 @@ timestamp='2014-05-01' # 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 . +# 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 @@ -25,7 +25,7 @@ timestamp='2014-05-01' # of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -33,7 +33,7 @@ timestamp='2014-05-01' # 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 +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,12 +53,11 @@ timestamp='2014-05-01' me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -68,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2018 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." @@ -95,7 +94,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -111,134 +110,455 @@ case $# in 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-musl* | 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 +# Split fields of configuration type +IFS="-" read -r field1 field2 field3 field4 <&2 + exit 1 ;; - -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 + *-*-*-*) + basic_machine=$field1-$field2 + os=$field3-$field4 ;; - -bluegene*) - os=-cnk + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ + | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + os=linux-android + ;; + *) + basic_machine=$field1-$field2 + os=$field3 + ;; + esac ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + os=$field2 + ;; + # Manufacturers + 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* \ + | sim | cisco | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + os= + ;; + *) + basic_machine=$field1 + os=$field2 + ;; + esac ;; - -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 + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + os=bsd + ;; + a29khif) + basic_machine=a29k-amd + os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=scout + ;; + am29k) + basic_machine=a29k-none + os=bsd + ;; + amdahl) + basic_machine=580-amdahl + os=sysv + ;; + 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 + ;; + cegcc) + basic_machine=arm-unknown + os=cegcc + ;; + cray) + basic_machine=j90-cray + os=unicos + ;; + craynv) + basic_machine=craynv-cray + os=unicosmp + ;; + delta88) + basic_machine=m88k-motorola + os=sysv3 + ;; + dicos) + basic_machine=i686-pc + os=dicos + ;; + djgpp) + basic_machine=i586-pc + os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=ose + ;; + gmicro) + basic_machine=tron-gmicro + os=sysv + ;; + go32) + basic_machine=i386-pc + os=go32 + ;; + 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 + ;; + hp300bsd) + basic_machine=m68k-hp + os=bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=hpux + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=proelf + ;; + i386mach) + basic_machine=i386-mach + os=mach + ;; + vsta) + basic_machine=i386-unknown + os=vsta + ;; + isi68 | isi) + basic_machine=m68k-isi + os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=sysv + ;; + merlin) + basic_machine=ns32k-utek + os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + os=coff + ;; + morphos) + basic_machine=powerpc-unknown + os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=moxiebox + ;; + msdos) + basic_machine=i386-pc + os=msdos + ;; + msys) + basic_machine=i686-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 + ;; + necv70) + basic_machine=v70-nec + os=sysv + ;; + 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 + ;; + os400) + basic_machine=powerpc-ibm + os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=ose + ;; + os68k) + basic_machine=m68k-none + os=os68k + ;; + paragon) + basic_machine=i860-intel + os=osf + ;; + parisc) + basic_machine=hppa-unknown + os=linux + ;; + pw32) + basic_machine=i586-unknown + os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=rdos + ;; + rdos32) + basic_machine=i386-pc + os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=coff + ;; + sa29200) + basic_machine=a29k-amd + os=udi + ;; + sei) + basic_machine=mips-sei + os=seiux + ;; + sps7) + basic_machine=m68k-bull + os=sysv2 + ;; + stratus) + basic_machine=i860-stratus + os=sysv4 + ;; + 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 + ;; + 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 + ;; + toad1) + basic_machine=pdp10-xkl + os=tops20 + ;; + 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 + ;; + vxworks960) + basic_machine=i960-wrs + os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=vxworks + ;; + xbox) + basic_machine=i686-pc + os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + os=unicos + ;; + *) + basic_machine=$1 + os= + ;; + esac ;; esac @@ -253,17 +573,18 @@ case $basic_machine in | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ - | c4x | c8051 | clipper \ + | c4x | c8051 | clipper | csky \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ - | i370 | i860 | i960 | ia64 \ + | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ @@ -296,15 +617,18 @@ case $basic_machine in | mt \ | msp430 \ | nds32 | nds32le | nds32be \ + | nfp \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ + | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ + | riscv32 | riscv64 \ | 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 \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -312,7 +636,8 @@ case $basic_machine in | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ + | visium \ + | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown @@ -326,22 +651,28 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown - os=-none + os=${os:-none} ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) + ;; + m9s12z | m68hcs12z | hcs12z | s12z) + basic_machine=s12z-unknown + os=${os:-none} ;; ms1) basic_machine=mt-unknown ;; - strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown - os=-none + os=${os:-none} ;; xscaleeb) basic_machine=armeb-unknown @@ -357,11 +688,6 @@ case $basic_machine in 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-* \ @@ -371,17 +697,18 @@ case $basic_machine in | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | 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-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ @@ -415,6 +742,7 @@ case $basic_machine in | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ + | nfp-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ @@ -422,13 +750,15 @@ case $basic_machine in | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | 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?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -436,6 +766,8 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ + | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -448,138 +780,77 @@ case $basic_machine in ;; # 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 + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; 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 + asmjs) + basic_machine=asmjs-unknown ;; blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=linux ;; bluegene*) basic_machine=powerpc-ibm - os=-cnk + os=cnk ;; c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc + os=${os:-unicos} ;; convex-c1) basic_machine=c1-convex - os=-bsd + os=bsd ;; convex-c2) basic_machine=c2-convex - os=-bsd + os=bsd ;; convex-c32) basic_machine=c32-convex - os=-bsd + os=bsd ;; convex-c34) basic_machine=c34-convex - os=-bsd + 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 + os=bsd ;; cr16 | cr16-*) basic_machine=cr16-unknown - os=-elf + os=${os:-elf} ;; crds | unos) basic_machine=m68k-crds @@ -592,7 +863,7 @@ case $basic_machine in ;; crx) basic_machine=crx-unknown - os=-elf + os=${os:-elf} ;; da30 | da30-*) basic_machine=m68k-da30 @@ -602,50 +873,38 @@ case $basic_machine in ;; decsystem10* | dec10*) basic_machine=pdp10-dec - os=-tops10 + os=tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec - os=-tops20 + 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 + os=${os:-bosx} ;; - dpx2* | dpx2*-bull) + dpx2*) basic_machine=m68k-bull - os=-sysv3 + os=sysv3 ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" ;; encore | umax | mmax) basic_machine=ns32k-encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + basic_machine=elxsi-elxsi + os=${os:-bsd} ;; fx2800) basic_machine=i860-alliant @@ -653,45 +912,13 @@ case $basic_machine in 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 + os=hiuxwe2 ;; 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 ;; @@ -721,193 +948,82 @@ case $basic_machine in 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 + 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 + 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 + 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 + 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 + j90 | j90-cray) + basic_machine=j90-cray + os=${os:-unicos} ;; iris | iris4d) basic_machine=mips-sgi case $os in - -irix*) + irix*) ;; *) - os=-irix4 + os=irix4 ;; esac ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; 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 + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=linux ;; microblaze*) basic_machine=microblaze-xilinx ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) basic_machine=m68000-convergent ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari - os=-mint + os=mint ;; mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + 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 + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-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 + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; news-3600 | risc-news) basic_machine=mips-sony - os=-newsos + os=newsos ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) + next | m*-next) basic_machine=m68k-next case $os in - -nextstep* ) + nextstep* ) ;; - -ns2*) - os=-nextstep2 + ns2*) + os=nextstep2 ;; *) - os=-nextstep3 + 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 ;; @@ -920,40 +1036,26 @@ case $basic_machine in nsr-tandem) basic_machine=nsr-tandem ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki - os=-proelf + 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 + os=hiuxwe2 ;; parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=linux ;; pbd) basic_machine=sparc-tti @@ -968,7 +1070,7 @@ case $basic_machine in basic_machine=i386-pc ;; pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc @@ -983,16 +1085,16 @@ case $basic_machine in basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould @@ -1002,43 +1104,27 @@ case $basic_machine in ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; rm[46]00) basic_machine=mips-siemens ;; @@ -1051,10 +1137,6 @@ case $basic_machine in s390x | s390x-*) basic_machine=s390x-ibm ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; sb1) basic_machine=mipsisa64sb1-unknown ;; @@ -1063,32 +1145,17 @@ case $basic_machine in ;; sde) basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux + os=${os:-elf} ;; 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) + simso-wrs) basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 + os=vxworks ;; spur) basic_machine=spur-unknown @@ -1096,44 +1163,12 @@ case $basic_machine in st2000) basic_machine=m68k-tandem ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + 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 ;; @@ -1143,25 +1178,9 @@ case $basic_machine in 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 + os=linux-gnu ;; tx39) basic_machine=mipstx39-unknown @@ -1169,85 +1188,32 @@ case $basic_machine in 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 + os=none ;; w89k-*) basic_machine=hppa1.1-winbond - os=-proelf + os=proelf ;; - xbox) - basic_machine=i686-pc - os=-mingw32 + x64) + basic_machine=x86_64-pc ;; 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 + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; none) basic_machine=none-none - os=-none + os=${os:-none} ;; # Here we handle the default manufacturer of certain CPU types. It is in @@ -1273,10 +1239,6 @@ case $basic_machine in 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 ;; @@ -1286,9 +1248,6 @@ case $basic_machine in 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 ;; @@ -1308,7 +1267,7 @@ case $basic_machine in # Make sure to match an already-canonicalized machine name. ;; *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac @@ -1316,10 +1275,10 @@ esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; @@ -1327,197 +1286,246 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +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 + # 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.*) + bluegene*) + os=cnk + ;; + solaris1 | solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; - -solaris) - os=-solaris2 + solaris) + os=solaris2 ;; - -svr4*) - os=-sysv4 + unixware*) + os=sysv4.2uw ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) + gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # First accept the basic system types. + # es1800 is here to avoid being matched by es* (a different OS) + es1800*) + os=ose + ;; + # Some version numbers need modification + chorusos*) + os=chorusos + ;; + isc) + os=isc2.2 + ;; + sco6) + os=sco5v6 + ;; + sco5) + os=sco3.2v5 + ;; + sco4) + os=sco3.2v4 + ;; + sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + ;; + sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + scout) + # Don't match below + ;; + sco*) + os=sco3.2v2 + ;; + psos*) + os=psos + ;; + # Now 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* | -plan9* \ - | -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* \ - | -bitrig* | -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* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -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* | -tirtos*) + # 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* | esix* | aix* | cnk* | sunos | sunos[34]*\ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | kopensolaris* | plan9* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \ + | knetbsd* | mirbsd* | netbsd* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* \ + | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ + | linux-newlib* | linux-musl* | linux-uclibc* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* \ + | morphos* | superux* | rtmk* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; - -qnx*) + qnx*) case $basic_machine in x86-* | i*86-*) ;; *) - os=-nto$os + os=nto-$os ;; esac ;; - -nto-qnx*) + hiux*) + os=hiuxwe2 ;; - -nto*) + 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*) + sim | xray | os68k* | v88r* \ + | windows* | osx | abug | netware* | os9* \ + | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + linux-dietlibc) + os=linux-dietlibc ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) + linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + lynx*178) + os=lynxos178 ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + lynx*5) + os=lynxos5 ;; - -opened*) - os=-openedition + lynx*) + os=lynxos ;; - -os400*) - os=-os400 + mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` ;; - -wince*) - os=-wince + opened*) + os=openedition ;; - -osfrose*) - os=-osfrose + os400*) + os=os400 ;; - -osf*) - os=-osf + sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; - -utek*) - os=-bsd + sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; - -dynix*) - os=-bsd + wince*) + os=wince ;; - -acis*) - os=-aos + utek*) + os=bsd ;; - -atheos*) - os=-atheos + dynix*) + os=bsd ;; - -syllable*) - os=-syllable + acis*) + os=aos ;; - -386bsd) - os=-bsd + atheos*) + os=atheos ;; - -ctix* | -uts*) - os=-sysv + syllable*) + os=syllable ;; - -nova*) - os=-rtmk-nova + 386bsd) + os=bsd ;; - -ns2 ) - os=-nextstep2 + ctix* | uts*) + os=sysv ;; - -nsk*) - os=-nsk + nova*) + os=rtmk-nova + ;; + ns2) + os=nextstep2 + ;; + nsk*) + os=nsk ;; # Preserve the version number of sinix5. - -sinix5.*) + sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; - -sinix*) - os=-sysv4 + sinix*) + os=sysv4 ;; - -tpf*) - os=-tpf + tpf*) + os=tpf ;; - -triton*) - os=-sysv3 + triton*) + os=sysv3 ;; - -oss*) - os=-sysv3 + oss*) + os=sysv3 ;; - -svr4) - os=-sysv4 + svr4*) + os=sysv4 ;; - -svr3) - os=-sysv3 + svr3) + os=sysv3 ;; - -sysvr4) - os=-sysv4 + sysvr4) + os=sysv4 ;; - # This must come after -sysvr4. - -sysv*) + # This must come after sysvr4. + sysv*) ;; - -ose*) - os=-ose + ose*) + os=ose ;; - -es1800*) - os=-ose + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + os=mint ;; - -xenix) - os=-xenix + zvmoe) + os=zvmoe ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint + dicos*) + os=dicos ;; - -aros*) - os=-aros + pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=eabi + ;; + *) + os=elf + ;; + esac ;; - -zvmoe) - os=-zvmoe + nacl*) ;; - -dicos*) - os=-dicos + ios) ;; - -nacl*) + none) ;; - -none) + *-eabi) ;; *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1535,176 +1543,179 @@ else case $basic_machine in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + os=linux ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 + ;; + pru-*) + os=elf ;; *-be) - os=-beos - ;; - *-haiku) - os=-haiku + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs + os=luna ;; *-next) - os=-nextstep3 + os=nextstep + ;; + *-sequent) + os=ptx + ;; + *-crds) + os=unos + ;; + *-ns) + os=genix + ;; + i370-*) + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac fi @@ -1715,79 +1726,82 @@ vendor=unknown case $basic_machine in *-unknown) case $os in - -riscix*) + riscix*) vendor=acorn ;; - -sunos*) + sunos*) vendor=sun ;; - -cnk*|-aix*) + cnk*|-aix*) vendor=ibm ;; - -beos*) + beos*) vendor=be ;; - -hpux*) + hpux*) vendor=hp ;; - -mpeix*) + mpeix*) vendor=hp ;; - -hiux*) + hiux*) vendor=hitachi ;; - -unos*) + unos*) vendor=crds ;; - -dgux*) + dgux*) vendor=dg ;; - -luna*) + luna*) vendor=omron ;; - -genix*) + genix*) vendor=ns ;; - -mvs* | -opened*) + clix*) + vendor=intergraph + ;; + mvs* | opened*) vendor=ibm ;; - -os400*) + os400*) vendor=ibm ;; - -ptx*) + ptx*) vendor=sequent ;; - -tpf*) + tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + vxsim* | vxworks* | windiss*) vendor=wrs ;; - -aux*) + aux*) vendor=apple ;; - -hms*) + hms*) vendor=hitachi ;; - -mpw* | -macos*) + mpw* | macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) vendor=atari ;; - -vos*) + vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$basic_machine-$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/install-sh b/install-sh index a5897de6e..0360b79e7 100755 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2006-12-25.00 +scriptversion=2016-01-11.22; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,25 +35,21 @@ scriptversion=2006-12-25.00 # 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 +# '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. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# 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 +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ 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. @@ -97,7 +82,7 @@ dir_arg= dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,42 +122,57 @@ while test $# -ne 0; do -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - shift;; + -t) + is_target_a_directory=always + 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;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + 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. @@ -186,6 +186,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then 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 @@ -194,13 +198,26 @@ if test $# -eq 0; then echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # 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 - trap '(exit $?); exit' 1 2 13 15 + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +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. @@ -211,16 +228,16 @@ if test -z "$dir_arg"; then *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -228,9 +245,9 @@ fi for src do - # Protect names starting with `-'. + # Protect names problematic for 'test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -252,51 +269,20 @@ do echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac # 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 + if test "$is_target_a_directory" = never; 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' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi @@ -307,74 +293,74 @@ do 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;; + # 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 + *[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 + # 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 + 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;; + 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-writable 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" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -384,53 +370,51 @@ do # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test -z "$d" && continue + 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/ + 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 + # 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 @@ -465,15 +449,12 @@ do # 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 && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -486,24 +467,24 @@ do # 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 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" + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 @@ -515,5 +496,6 @@ done # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" # End: From d8336d2fed73c72d1227b343d6acfb991bc1651b Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 9 Jul 2018 20:15:29 +0000 Subject: [PATCH 002/271] Keep using std::distance after Boost 1.68 src/search_replace_engine.cpp:256:14: error: call to 'distance' is ambiguous count += distance( ^~~~~~~~ /usr/include/c++/v1/iterator:511:1: note: candidate function [with _InputIter = boost::u32regex_iterator >] distance(_InputIter __first, _InputIter __last) ^ /usr/local/include/boost/iterator/distance.hpp:49:9: note: candidate function [with SinglePassIterator = boost::u32regex_iterator >] distance(SinglePassIterator first, SinglePassIterator last) ^ --- src/search_replace_engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search_replace_engine.cpp b/src/search_replace_engine.cpp index 594c21e5e..14c71680d 100644 --- a/src/search_replace_engine.cpp +++ b/src/search_replace_engine.cpp @@ -253,7 +253,7 @@ bool SearchReplaceEngine::ReplaceAll() { if (MatchState ms = matches(&diag, 0)) { auto& diag_field = diag.*get_dialogue_field(settings.field); std::string const& text = diag_field.get(); - count += distance( + count += std::distance( boost::u32regex_iterator(begin(text), end(text), *ms.re), boost::u32regex_iterator()); diag_field = u32regex_replace(text, *ms.re, settings.replace_with); From 83736b4866ecae9b7c42a2c6cb576e376a8d04e2 Mon Sep 17 00:00:00 2001 From: bkbkb <41873894+bkbkb@users.noreply.github.com> Date: Mon, 30 Jul 2018 00:27:07 -0400 Subject: [PATCH 003/271] Fix fribidi download link --- build/fribidi/fribidi.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/fribidi/fribidi.vcxproj b/build/fribidi/fribidi.vcxproj index aa1533f1b..860a6767d 100644 --- a/build/fribidi/fribidi.vcxproj +++ b/build/fribidi/fribidi.vcxproj @@ -35,7 +35,7 @@ Outputs="$(FribidiSrcDir)nonexistent-file" > From 6afb8513657cdc94bdf8bb8a01177a054bd39905 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 26 May 2018 17:41:13 +0200 Subject: [PATCH 004/271] Update freetype2 --- build/freetype2/freetype.vcxproj | 2 +- build/freetype2/freetype.vcxproj.filters | 2 +- vendor/freetype2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/freetype2/freetype.vcxproj b/build/freetype2/freetype.vcxproj index 69ec78e4c..fdb8fbdf4 100644 --- a/build/freetype2/freetype.vcxproj +++ b/build/freetype2/freetype.vcxproj @@ -55,7 +55,7 @@ - + diff --git a/build/freetype2/freetype.vcxproj.filters b/build/freetype2/freetype.vcxproj.filters index 0d9678157..9787c9d06 100644 --- a/build/freetype2/freetype.vcxproj.filters +++ b/build/freetype2/freetype.vcxproj.filters @@ -71,7 +71,7 @@ Source Files - + Source Files diff --git a/vendor/freetype2 b/vendor/freetype2 index aaffbf85d..51fee6558 160000 --- a/vendor/freetype2 +++ b/vendor/freetype2 @@ -1 +1 @@ -Subproject commit aaffbf85df8b02b469eb76e22354c2bab6759ae6 +Subproject commit 51fee655837ef99084767873266aaddfa3a31da5 From ebc76c8a1168d16054a1f7c6d3920c0fa9c9d717 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 21 Nov 2018 16:41:05 -0800 Subject: [PATCH 005/271] Update ffmpeg and ffms2 --- build/Aegisub/standard-libraries.props | 3 +- build/ffmpeg/config-x64.asm | 1498 +++++++++++++++-------- build/ffmpeg/config-x64.h | 1503 ++++++++++++++++-------- build/ffmpeg/config-x86.asm | 1498 +++++++++++++++-------- build/ffmpeg/config-x86.h | 1503 ++++++++++++++++-------- build/ffmpeg/configure.sh | 6 +- build/ffmpeg/ffmpeg.vcxproj | 248 +++- build/ffms2/ffms2.vcxproj | 5 - build/ffms2/ffms2.vcxproj.filters | 15 - src/video_provider_ffmpegsource.cpp | 43 +- vendor/ffmpeg | 2 +- vendor/ffms2 | 2 +- 12 files changed, 4276 insertions(+), 2050 deletions(-) mode change 100644 => 100755 build/ffmpeg/config-x64.asm mode change 100644 => 100755 build/ffmpeg/config-x64.h mode change 100644 => 100755 build/ffmpeg/config-x86.asm mode change 100644 => 100755 build/ffmpeg/config-x86.h diff --git a/build/Aegisub/standard-libraries.props b/build/Aegisub/standard-libraries.props index 719686902..b4f5074e1 100644 --- a/build/Aegisub/standard-libraries.props +++ b/build/Aegisub/standard-libraries.props @@ -8,11 +8,12 @@ + Usp10.lib; Vfw32.lib; advapi32.lib; + bcrypt.lib; comctl32.lib; comdlg32.lib; - Usp10.lib; gdi32.lib; kernel32.lib; ole32.lib; diff --git a/build/ffmpeg/config-x64.asm b/build/ffmpeg/config-x64.asm old mode 100644 new mode 100755 index 13b3f69d0..ad2385c4d --- a/build/ffmpeg/config-x64.asm +++ b/build/ffmpeg/config-x64.asm @@ -1,3 +1,4 @@ +; Automatically generated by configure - do not modify! %define ARCH_AARCH64 0 %define ARCH_ALPHA 0 %define ARCH_ARM 0 @@ -36,10 +37,12 @@ %define HAVE_POWER8 0 %define HAVE_PPC4XX 0 %define HAVE_VSX 0 +%define HAVE_AESNI 1 %define HAVE_AMD3DNOW 1 %define HAVE_AMD3DNOWEXT 1 %define HAVE_AVX 1 %define HAVE_AVX2 1 +%define HAVE_AVX512 1 %define HAVE_FMA3 1 %define HAVE_FMA4 1 %define HAVE_MMX 1 @@ -56,12 +59,14 @@ %define HAVE_MIPSFPU 0 %define HAVE_MIPS32R2 0 %define HAVE_MIPS32R5 0 +%define HAVE_MIPS64R2 0 +%define HAVE_MIPS32R6 0 %define HAVE_MIPS64R6 0 -%define HAVE_MIPSDSPR1 0 +%define HAVE_MIPSDSP 0 %define HAVE_MIPSDSPR2 0 %define HAVE_MSA 0 -%define HAVE_LOONGSON2 1 -%define HAVE_LOONGSON3 1 +%define HAVE_LOONGSON2 0 +%define HAVE_LOONGSON3 0 %define HAVE_MMI 0 %define HAVE_ARMV5TE_EXTERNAL 0 %define HAVE_ARMV6_EXTERNAL 0 @@ -77,10 +82,12 @@ %define HAVE_POWER8_EXTERNAL 0 %define HAVE_PPC4XX_EXTERNAL 0 %define HAVE_VSX_EXTERNAL 0 +%define HAVE_AESNI_EXTERNAL 1 %define HAVE_AMD3DNOW_EXTERNAL 1 %define HAVE_AMD3DNOWEXT_EXTERNAL 1 %define HAVE_AVX_EXTERNAL 1 %define HAVE_AVX2_EXTERNAL 0 +%define HAVE_AVX512_EXTERNAL 0 %define HAVE_FMA3_EXTERNAL 1 %define HAVE_FMA4_EXTERNAL 1 %define HAVE_MMX_EXTERNAL 1 @@ -97,8 +104,10 @@ %define HAVE_MIPSFPU_EXTERNAL 0 %define HAVE_MIPS32R2_EXTERNAL 0 %define HAVE_MIPS32R5_EXTERNAL 0 +%define HAVE_MIPS64R2_EXTERNAL 0 +%define HAVE_MIPS32R6_EXTERNAL 0 %define HAVE_MIPS64R6_EXTERNAL 0 -%define HAVE_MIPSDSPR1_EXTERNAL 0 +%define HAVE_MIPSDSP_EXTERNAL 0 %define HAVE_MIPSDSPR2_EXTERNAL 0 %define HAVE_MSA_EXTERNAL 0 %define HAVE_LOONGSON2_EXTERNAL 0 @@ -118,10 +127,12 @@ %define HAVE_POWER8_INLINE 0 %define HAVE_PPC4XX_INLINE 0 %define HAVE_VSX_INLINE 0 +%define HAVE_AESNI_INLINE 0 %define HAVE_AMD3DNOW_INLINE 0 %define HAVE_AMD3DNOWEXT_INLINE 0 %define HAVE_AVX_INLINE 0 %define HAVE_AVX2_INLINE 0 +%define HAVE_AVX512_INLINE 0 %define HAVE_FMA3_INLINE 0 %define HAVE_FMA4_INLINE 0 %define HAVE_MMX_INLINE 0 @@ -138,8 +149,10 @@ %define HAVE_MIPSFPU_INLINE 0 %define HAVE_MIPS32R2_INLINE 0 %define HAVE_MIPS32R5_INLINE 0 +%define HAVE_MIPS64R2_INLINE 0 +%define HAVE_MIPS32R6_INLINE 0 %define HAVE_MIPS64R6_INLINE 0 -%define HAVE_MIPSDSPR1_INLINE 0 +%define HAVE_MIPSDSP_INLINE 0 %define HAVE_MIPSDSPR2_INLINE 0 %define HAVE_MSA_INLINE 0 %define HAVE_LOONGSON2_INLINE 0 @@ -149,55 +162,49 @@ %define HAVE_FAST_64BIT 1 %define HAVE_FAST_CLZ 1 %define HAVE_FAST_CMOV 1 -%define HAVE_LOCAL_ALIGNED_8 1 -%define HAVE_LOCAL_ALIGNED_16 1 -%define HAVE_LOCAL_ALIGNED_32 1 +%define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 -%define HAVE_ATOMICS_GCC 0 -%define HAVE_ATOMICS_SUNCC 0 -%define HAVE_ATOMICS_WIN32 1 +%define HAVE_SIMD_ALIGN_32 1 +%define HAVE_SIMD_ALIGN_64 1 %define HAVE_ATOMIC_CAS_PTR 0 -%define HAVE_ATOMIC_COMPARE_EXCHANGE 0 %define HAVE_MACHINE_RW_BARRIER 0 %define HAVE_MEMORYBARRIER 1 %define HAVE_MM_EMPTY 0 %define HAVE_RDTSC 1 -%define HAVE_SARESTART 0 +%define HAVE_SEM_TIMEDWAIT 0 %define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0 +%define HAVE_CABS 0 +%define HAVE_CEXP 0 %define HAVE_INLINE_ASM 0 %define HAVE_SYMVER 0 -%define HAVE_YASM 1 +%define HAVE_X86ASM 1 %define HAVE_BIGENDIAN 0 %define HAVE_FAST_UNALIGNED 1 -%define HAVE_INCOMPATIBLE_LIBAV_ABI 0 -%define HAVE_ALSA_ASOUNDLIB_H 0 -%define HAVE_ALTIVEC_H 0 %define HAVE_ARPA_INET_H 0 %define HAVE_ASM_TYPES_H 0 %define HAVE_CDIO_PARANOIA_H 0 %define HAVE_CDIO_PARANOIA_PARANOIA_H 0 +%define HAVE_CUDA_H 0 +%define HAVE_DISPATCH_DISPATCH_H 0 %define HAVE_DEV_BKTR_IOCTL_BT848_H 0 %define HAVE_DEV_BKTR_IOCTL_METEOR_H 0 %define HAVE_DEV_IC_BT8XX_H 0 %define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0 %define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0 %define HAVE_DIRECT_H 1 -%define HAVE_DLFCN_H 0 -%define HAVE_D3D11_H 1 +%define HAVE_DIRENT_H 0 +%define HAVE_DXGIDEBUG_H 1 %define HAVE_DXVA_H 1 %define HAVE_ES2_GL_H 0 %define HAVE_GSM_H 0 %define HAVE_IO_H 1 -%define HAVE_MACH_MACH_TIME_H 0 +%define HAVE_LINUX_PERF_EVENT_H 0 %define HAVE_MACHINE_IOCTL_BT848_H 0 %define HAVE_MACHINE_IOCTL_METEOR_H 0 %define HAVE_MALLOC_H 1 -%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0 +%define HAVE_OPENCV2_CORE_CORE_C_H 0 %define HAVE_OPENGL_GL3_H 0 %define HAVE_POLL_H 0 -%define HAVE_SNDIO_H 0 -%define HAVE_SOUNDCARD_H 0 -%define HAVE_SYS_MMAN_H 0 %define HAVE_SYS_PARAM_H 0 %define HAVE_SYS_RESOURCE_H 0 %define HAVE_SYS_SELECT_H 0 @@ -222,6 +229,8 @@ %define HAVE_EXP2 1 %define HAVE_EXP2F 1 %define HAVE_EXPF 1 +%define HAVE_HYPOT 1 +%define HAVE_ISFINITE 1 %define HAVE_ISINF 1 %define HAVE_ISNAN 1 %define HAVE_LDEXPF 1 @@ -239,17 +248,20 @@ %define HAVE_SINF 1 %define HAVE_TRUNC 1 %define HAVE_TRUNCF 1 +%define HAVE_DOS_PATHS 1 +%define HAVE_LIBC_MSVCRT 1 +%define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0 +%define HAVE_SECTION_DATA_REL_RO 0 +%define HAVE_THREADS 1 +%define HAVE_UWP 0 +%define HAVE_WINRT 0 %define HAVE_ACCESS 1 %define HAVE_ALIGNED_MALLOC 1 +%define HAVE_ARC4RANDOM 0 %define HAVE_CLOCK_GETTIME 0 %define HAVE_CLOSESOCKET 0 %define HAVE_COMMANDLINETOARGVW 1 -%define HAVE_COTASKMEMFREE 1 -%define HAVE_CRYPTGENRANDOM 1 -%define HAVE_DLOPEN 0 %define HAVE_FCNTL 0 -%define HAVE_FLT_LIM 1 -%define HAVE_FORK 0 %define HAVE_GETADDRINFO 0 %define HAVE_GETHRTIME 0 %define HAVE_GETOPT 0 @@ -257,7 +269,6 @@ %define HAVE_GETPROCESSMEMORYINFO 1 %define HAVE_GETPROCESSTIMES 1 %define HAVE_GETRUSAGE 0 -%define HAVE_GETSERVBYPORT 0 %define HAVE_GETSYSTEMTIMEASFILETIME 1 %define HAVE_GETTIMEOFDAY 0 %define HAVE_GLOB 0 @@ -265,9 +276,9 @@ %define HAVE_GMTIME_R 0 %define HAVE_INET_ATON 0 %define HAVE_ISATTY 1 -%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0 %define HAVE_KBHIT 1 %define HAVE_LOCALTIME_R 0 +%define HAVE_LSTAT 0 %define HAVE_LZO1X_999_COMPRESS 0 %define HAVE_MACH_ABSOLUTE_TIME 0 %define HAVE_MAPVIEWOFFILE 1 @@ -280,6 +291,7 @@ %define HAVE_POSIX_MEMALIGN 0 %define HAVE_PTHREAD_CANCEL 0 %define HAVE_SCHED_GETAFFINITY 0 +%define HAVE_SECITEMIMPORT 0 %define HAVE_SETCONSOLETEXTATTRIBUTE 1 %define HAVE_SETCONSOLECTRLHANDLER 1 %define HAVE_SETMODE 1 @@ -289,25 +301,31 @@ %define HAVE_SYSCONF 0 %define HAVE_SYSCTL 0 %define HAVE_USLEEP 0 +%define HAVE_UTGETOSTYPEFROMSTRING 0 %define HAVE_VIRTUALALLOC 1 %define HAVE_WGLGETPROCADDRESS 0 +%define HAVE_BCRYPT 1 +%define HAVE_VAAPI_DRM 0 +%define HAVE_VAAPI_X11 0 +%define HAVE_VDPAU_X11 0 %define HAVE_PTHREADS 0 %define HAVE_OS2THREADS 0 %define HAVE_W32THREADS 1 +%define HAVE_AS_ARCH_DIRECTIVE 0 %define HAVE_AS_DN_DIRECTIVE 0 +%define HAVE_AS_FPU_DIRECTIVE 0 %define HAVE_AS_FUNC 0 %define HAVE_AS_OBJECT_ARCH 0 %define HAVE_ASM_MOD_Q 0 -%define HAVE_ATTRIBUTE_MAY_ALIAS 0 -%define HAVE_ATTRIBUTE_PACKED 0 +%define HAVE_BLOCKS_EXTENSION 0 %define HAVE_EBP_AVAILABLE 0 %define HAVE_EBX_AVAILABLE 0 %define HAVE_GNU_AS 0 %define HAVE_GNU_WINDRES 0 %define HAVE_IBM_ASM 0 +%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0 %define HAVE_INLINE_ASM_LABELS 0 %define HAVE_INLINE_ASM_NONLOCAL_LABELS 0 -%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0 %define HAVE_PRAGMA_DEPRECATED 1 %define HAVE_RSYNC_CONTIMEOUT 0 %define HAVE_SYMVER_ASM_LABEL 0 @@ -315,13 +333,13 @@ %define HAVE_VFP_ARGS 0 %define HAVE_XFORM_ASM 0 %define HAVE_XMM_CLOBBERS 0 -%define HAVE_CONDITION_VARIABLE_PTR 1 +%define HAVE_KCMVIDEOCODECTYPE_HEVC 0 %define HAVE_SOCKLEN_T 0 %define HAVE_STRUCT_ADDRINFO 0 -%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0 %define HAVE_STRUCT_GROUP_SOURCE_REQ 0 %define HAVE_STRUCT_IP_MREQ_SOURCE 0 %define HAVE_STRUCT_IPV6_MREQ 0 +%define HAVE_STRUCT_MSGHDR_MSG_FLAGS 0 %define HAVE_STRUCT_POLLFD 0 %define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0 %define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0 @@ -330,48 +348,35 @@ %define HAVE_STRUCT_SOCKADDR_STORAGE 0 %define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0 %define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0 -%define HAVE_ATOMICS_NATIVE 1 -%define HAVE_DOS_PATHS 1 -%define HAVE_DXVA2API_COBJ 1 -%define HAVE_DXVA2_LIB 0 -%define HAVE_LIBC_MSVCRT 1 -%define HAVE_LIBDC1394_1 0 -%define HAVE_LIBDC1394_2 0 %define HAVE_MAKEINFO 1 %define HAVE_MAKEINFO_HTML 0 +%define HAVE_OPENCL_D3D11 0 +%define HAVE_OPENCL_DRM_ARM 0 +%define HAVE_OPENCL_DRM_BEIGNET 0 +%define HAVE_OPENCL_DXVA2 0 +%define HAVE_OPENCL_VAAPI_BEIGNET 0 +%define HAVE_OPENCL_VAAPI_INTEL_MEDIA 0 %define HAVE_PERL 1 %define HAVE_POD2MAN 0 -%define HAVE_SDL 0 -%define HAVE_SECTION_DATA_REL_RO 0 %define HAVE_TEXI2HTML 0 -%define HAVE_THREADS 1 -%define HAVE_VAAPI_X11 0 -%define HAVE_VDPAU_X11 0 -%define HAVE_XLIB 0 -%define CONFIG_BSFS 1 -%define CONFIG_DECODERS 1 -%define CONFIG_DEMUXERS 1 -%define CONFIG_ENCODERS 0 -%define CONFIG_FILTERS 0 -%define CONFIG_HWACCELS 0 -%define CONFIG_INDEVS 0 -%define CONFIG_MUXERS 0 -%define CONFIG_OUTDEVS 0 -%define CONFIG_PARSERS 1 -%define CONFIG_PROTOCOLS 1 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 %define CONFIG_PODPAGES 1 %define CONFIG_TXTPAGES 1 +%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1 %define CONFIG_AVIO_READING_EXAMPLE 1 -%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1 -%define CONFIG_DECODING_ENCODING_EXAMPLE 1 +%define CONFIG_DECODE_AUDIO_EXAMPLE 1 +%define CONFIG_DECODE_VIDEO_EXAMPLE 1 %define CONFIG_DEMUXING_DECODING_EXAMPLE 1 +%define CONFIG_ENCODE_AUDIO_EXAMPLE 1 +%define CONFIG_ENCODE_VIDEO_EXAMPLE 1 %define CONFIG_EXTRACT_MVS_EXAMPLE 1 %define CONFIG_FILTER_AUDIO_EXAMPLE 0 %define CONFIG_FILTERING_AUDIO_EXAMPLE 0 %define CONFIG_FILTERING_VIDEO_EXAMPLE 0 +%define CONFIG_HTTP_MULTICLIENT_EXAMPLE 0 +%define CONFIG_HW_DECODE_EXAMPLE 1 %define CONFIG_METADATA_EXAMPLE 1 %define CONFIG_MUXING_EXAMPLE 1 %define CONFIG_QSVDEC_EXAMPLE 0 @@ -380,25 +385,48 @@ %define CONFIG_SCALING_VIDEO_EXAMPLE 1 %define CONFIG_TRANSCODE_AAC_EXAMPLE 1 %define CONFIG_TRANSCODING_EXAMPLE 0 +%define CONFIG_VAAPI_ENCODE_EXAMPLE 0 +%define CONFIG_VAAPI_TRANSCODE_EXAMPLE 0 %define CONFIG_AVISYNTH 0 -%define CONFIG_BZLIB 0 -%define CONFIG_CRYSTALHD 0 -%define CONFIG_DECKLINK 0 %define CONFIG_FREI0R 0 +%define CONFIG_LIBCDIO 0 +%define CONFIG_LIBDAVS2 0 +%define CONFIG_LIBRUBBERBAND 0 +%define CONFIG_LIBVIDSTAB 0 +%define CONFIG_LIBX264 0 +%define CONFIG_LIBX265 0 +%define CONFIG_LIBXAVS 0 +%define CONFIG_LIBXAVS2 0 +%define CONFIG_LIBXVID 0 +%define CONFIG_DECKLINK 0 +%define CONFIG_LIBNDI_NEWTEK 0 +%define CONFIG_LIBFDK_AAC 0 +%define CONFIG_OPENSSL 0 +%define CONFIG_LIBTLS 0 +%define CONFIG_GMP 0 +%define CONFIG_LIBLENSFUN 0 +%define CONFIG_LIBOPENCORE_AMRNB 0 +%define CONFIG_LIBOPENCORE_AMRWB 0 +%define CONFIG_LIBVMAF 0 +%define CONFIG_LIBVO_AMRWBENC 0 +%define CONFIG_MBEDTLS 0 +%define CONFIG_RKMPP 0 +%define CONFIG_LIBSMBCLIENT 0 +%define CONFIG_CHROMAPRINT 0 +%define CONFIG_GCRYPT 0 %define CONFIG_GNUTLS 0 -%define CONFIG_ICONV 0 +%define CONFIG_JNI 0 %define CONFIG_LADSPA 0 -%define CONFIG_LIBAACPLUS 0 +%define CONFIG_LIBAOM 0 %define CONFIG_LIBASS 0 %define CONFIG_LIBBLURAY 0 %define CONFIG_LIBBS2B 0 %define CONFIG_LIBCACA 0 -%define CONFIG_LIBCDIO 0 %define CONFIG_LIBCELT 0 +%define CONFIG_LIBCODEC2 0 +%define CONFIG_LIBDAV1D 0 %define CONFIG_LIBDC1394 0 -%define CONFIG_LIBDCADEC 0 -%define CONFIG_LIBFAAC 0 -%define CONFIG_LIBFDK_AAC 0 +%define CONFIG_LIBDRM 0 %define CONFIG_LIBFLITE 0 %define CONFIG_LIBFONTCONFIG 0 %define CONFIG_LIBFREETYPE 0 @@ -407,91 +435,107 @@ %define CONFIG_LIBGSM 0 %define CONFIG_LIBIEC61883 0 %define CONFIG_LIBILBC 0 +%define CONFIG_LIBJACK 0 +%define CONFIG_LIBKLVANC 0 %define CONFIG_LIBKVAZAAR 0 -%define CONFIG_LIBMFX 0 %define CONFIG_LIBMODPLUG 0 %define CONFIG_LIBMP3LAME 0 -%define CONFIG_LIBNUT 0 -%define CONFIG_LIBOPENCORE_AMRNB 0 -%define CONFIG_LIBOPENCORE_AMRWB 0 +%define CONFIG_LIBMYSOFA 0 %define CONFIG_LIBOPENCV 0 %define CONFIG_LIBOPENH264 0 %define CONFIG_LIBOPENJPEG 0 +%define CONFIG_LIBOPENMPT 0 %define CONFIG_LIBOPUS 0 %define CONFIG_LIBPULSE 0 -%define CONFIG_LIBQUVI 0 +%define CONFIG_LIBRSVG 0 %define CONFIG_LIBRTMP 0 -%define CONFIG_LIBSCHROEDINGER 0 %define CONFIG_LIBSHINE 0 %define CONFIG_LIBSMBCLIENT 0 %define CONFIG_LIBSNAPPY 0 %define CONFIG_LIBSOXR 0 %define CONFIG_LIBSPEEX 0 +%define CONFIG_LIBSRT 0 %define CONFIG_LIBSSH 0 -%define CONFIG_LIBSTAGEFRIGHT_H264 0 +%define CONFIG_LIBTENSORFLOW 0 +%define CONFIG_LIBTESSERACT 0 %define CONFIG_LIBTHEORA 0 %define CONFIG_LIBTWOLAME 0 -%define CONFIG_LIBUTVIDEO 0 %define CONFIG_LIBV4L2 0 -%define CONFIG_LIBVIDSTAB 0 -%define CONFIG_LIBVO_AACENC 0 -%define CONFIG_LIBVO_AMRWBENC 0 %define CONFIG_LIBVORBIS 0 %define CONFIG_LIBVPX 0 %define CONFIG_LIBWAVPACK 0 %define CONFIG_LIBWEBP 0 -%define CONFIG_LIBX264 0 -%define CONFIG_LIBX265 0 -%define CONFIG_LIBXAVS 0 +%define CONFIG_LIBXML2 0 +%define CONFIG_LIBZIMG 0 +%define CONFIG_LIBZMQ 0 +%define CONFIG_LIBZVBI 0 +%define CONFIG_LV2 0 +%define CONFIG_MEDIACODEC 0 +%define CONFIG_OPENAL 0 +%define CONFIG_OPENGL 0 +%define CONFIG_VAPOURSYNTH 0 +%define CONFIG_ALSA 0 +%define CONFIG_APPKIT 0 +%define CONFIG_AVFOUNDATION 0 +%define CONFIG_BZLIB 0 +%define CONFIG_COREIMAGE 0 +%define CONFIG_ICONV 0 %define CONFIG_LIBXCB 0 %define CONFIG_LIBXCB_SHM 0 %define CONFIG_LIBXCB_SHAPE 0 %define CONFIG_LIBXCB_XFIXES 0 -%define CONFIG_LIBXVID 0 -%define CONFIG_LIBZMQ 0 -%define CONFIG_LIBZVBI 0 %define CONFIG_LZMA 0 -%define CONFIG_MMAL 0 -%define CONFIG_NVENC 0 -%define CONFIG_OPENAL 0 -%define CONFIG_OPENCL 0 -%define CONFIG_OPENGL 0 -%define CONFIG_OPENSSL 0 -%define CONFIG_SDL 0 +%define CONFIG_SCHANNEL 1 +%define CONFIG_SDL2 0 %define CONFIG_SECURETRANSPORT 0 -%define CONFIG_X11GRAB 0 +%define CONFIG_SNDIO 0 %define CONFIG_XLIB 0 %define CONFIG_ZLIB 1 +%define CONFIG_CUDA_SDK 0 +%define CONFIG_LIBNPP 0 +%define CONFIG_LIBMFX 0 +%define CONFIG_MMAL 0 +%define CONFIG_OMX 0 +%define CONFIG_OPENCL 0 +%define CONFIG_AMF 0 +%define CONFIG_AUDIOTOOLBOX 0 +%define CONFIG_CRYSTALHD 0 +%define CONFIG_CUDA 0 +%define CONFIG_CUVID 0 +%define CONFIG_D3D11VA 0 +%define CONFIG_DXVA2 0 +%define CONFIG_FFNVCODEC 0 +%define CONFIG_NVDEC 0 +%define CONFIG_NVENC 0 +%define CONFIG_VAAPI 0 +%define CONFIG_VDPAU 0 +%define CONFIG_VIDEOTOOLBOX 0 +%define CONFIG_V4L2_M2M 0 +%define CONFIG_XVMC 0 %define CONFIG_FTRAPV 0 %define CONFIG_GRAY 0 %define CONFIG_HARDCODED_TABLES 0 +%define CONFIG_OMX_RPI 0 %define CONFIG_RUNTIME_CPUDETECT 1 %define CONFIG_SAFE_BITSTREAM_READER 1 %define CONFIG_SHARED 0 -%define CONFIG_SMALL 0 +%define CONFIG_SMALL 1 %define CONFIG_STATIC 1 %define CONFIG_SWSCALE_ALPHA 1 -%define CONFIG_D3D11VA 0 -%define CONFIG_DXVA2 0 -%define CONFIG_VAAPI 0 -%define CONFIG_VDA 0 -%define CONFIG_VDPAU 0 -%define CONFIG_XVMC 0 %define CONFIG_GPL 1 %define CONFIG_NONFREE 0 %define CONFIG_VERSION3 0 -%define CONFIG_AVCODEC 1 %define CONFIG_AVDEVICE 1 %define CONFIG_AVFILTER 0 +%define CONFIG_SWSCALE 1 +%define CONFIG_POSTPROC 0 %define CONFIG_AVFORMAT 1 +%define CONFIG_AVCODEC 1 +%define CONFIG_SWRESAMPLE 1 %define CONFIG_AVRESAMPLE 0 %define CONFIG_AVUTIL 1 -%define CONFIG_POSTPROC 0 -%define CONFIG_SWRESAMPLE 1 -%define CONFIG_SWSCALE 1 %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 -%define CONFIG_FFSERVER 0 %define CONFIG_FFMPEG 0 %define CONFIG_DCT 1 %define CONFIG_DWT 1 @@ -505,24 +549,44 @@ %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 %define CONFIG_RDFT 1 +%define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 -%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0 -%define CONFIG_MEMALIGN_HACK 0 +%define CONFIG_LINUX_PERF 0 %define CONFIG_MEMORY_POISONING 0 %define CONFIG_NEON_CLOBBER_TEST 0 +%define CONFIG_OSSFUZZ 0 %define CONFIG_PIC 0 -%define CONFIG_POD2MAN 0 -%define CONFIG_RAISE_MAJOR 0 %define CONFIG_THUMB 0 %define CONFIG_VALGRIND_BACKTRACE 0 %define CONFIG_XMM_CLOBBER_TEST 0 +%define CONFIG_BSFS 1 +%define CONFIG_DECODERS 1 +%define CONFIG_ENCODERS 0 +%define CONFIG_HWACCELS 0 +%define CONFIG_PARSERS 1 +%define CONFIG_INDEVS 0 +%define CONFIG_OUTDEVS 0 +%define CONFIG_FILTERS 0 +%define CONFIG_DEMUXERS 1 +%define CONFIG_MUXERS 0 +%define CONFIG_PROTOCOLS 1 %define CONFIG_AANDCTTABLES 1 %define CONFIG_AC3DSP 1 -%define CONFIG_AUDIO_FRAME_QUEUE 0 +%define CONFIG_ADTS_HEADER 1 +%define CONFIG_AUDIO_FRAME_QUEUE 1 %define CONFIG_AUDIODSP 1 %define CONFIG_BLOCKDSP 1 %define CONFIG_BSWAPDSP 1 %define CONFIG_CABAC 1 +%define CONFIG_CBS 1 +%define CONFIG_CBS_AV1 1 +%define CONFIG_CBS_H264 1 +%define CONFIG_CBS_H265 1 +%define CONFIG_CBS_JPEG 0 +%define CONFIG_CBS_MPEG2 1 +%define CONFIG_CBS_VP9 1 +%define CONFIG_DIRAC_PARSE 1 +%define CONFIG_DNN 0 %define CONFIG_DVPROFILE 1 %define CONFIG_EXIF 1 %define CONFIG_FAANDCT 1 @@ -532,34 +596,38 @@ %define CONFIG_FMTCONVERT 1 %define CONFIG_FRAME_THREAD_ENCODER 0 %define CONFIG_G722DSP 1 -%define CONFIG_GCRYPT 0 -%define CONFIG_GMP 0 %define CONFIG_GOLOMB 1 %define CONFIG_GPLV3 0 %define CONFIG_H263DSP 1 %define CONFIG_H264CHROMA 1 %define CONFIG_H264DSP 1 +%define CONFIG_H264PARSE 1 %define CONFIG_H264PRED 1 %define CONFIG_H264QPEL 1 +%define CONFIG_HEVCPARSE 1 %define CONFIG_HPELDSP 1 %define CONFIG_HUFFMAN 1 %define CONFIG_HUFFYUVDSP 1 %define CONFIG_HUFFYUVENCDSP 0 %define CONFIG_IDCTDSP 1 %define CONFIG_IIRFILTER 0 -%define CONFIG_IMDCT15 1 +%define CONFIG_MDCT15 1 %define CONFIG_INTRAX8 1 +%define CONFIG_ISO_MEDIA 1 %define CONFIG_IVIDSP 0 %define CONFIG_JPEGTABLES 1 -%define CONFIG_LIBX262 0 %define CONFIG_LGPLV3 0 +%define CONFIG_LIBX262 0 %define CONFIG_LLAUDDSP 1 %define CONFIG_LLVIDDSP 1 +%define CONFIG_LLVIDENCDSP 0 %define CONFIG_LPC 0 +%define CONFIG_LZF 1 %define CONFIG_ME_CMP 1 %define CONFIG_MPEG_ER 1 %define CONFIG_MPEGAUDIO 1 %define CONFIG_MPEGAUDIODSP 1 +%define CONFIG_MPEGAUDIOHEADER 1 %define CONFIG_MPEGVIDEO 1 %define CONFIG_MPEGVIDEOENC 1 %define CONFIG_MSS34DSP 1 @@ -568,18 +636,24 @@ %define CONFIG_QSV 0 %define CONFIG_QSVDEC 0 %define CONFIG_QSVENC 0 +%define CONFIG_QSVVPP 0 %define CONFIG_RANGECODER 1 %define CONFIG_RIFFDEC 1 %define CONFIG_RIFFENC 0 %define CONFIG_RTPDEC 0 %define CONFIG_RTPENC_CHAIN 0 %define CONFIG_RV34DSP 1 +%define CONFIG_SCENE_SAD 0 %define CONFIG_SINEWIN 1 %define CONFIG_SNAPPY 1 +%define CONFIG_SRTP 0 %define CONFIG_STARTCODE 1 %define CONFIG_TEXTUREDSP 1 %define CONFIG_TEXTUREDSPENC 0 %define CONFIG_TPELDSP 1 +%define CONFIG_VAAPI_1 0 +%define CONFIG_VAAPI_ENCODE 0 +%define CONFIG_VC1DSP 1 %define CONFIG_VIDEODSP 1 %define CONFIG_VP3DSP 1 %define CONFIG_VP56DSP 1 @@ -587,19 +661,36 @@ %define CONFIG_WMA_FREQS 1 %define CONFIG_WMV2DSP 1 %define CONFIG_AAC_ADTSTOASC_BSF 1 +%define CONFIG_AV1_METADATA_BSF 1 %define CONFIG_CHOMP_BSF 1 %define CONFIG_DUMP_EXTRADATA_BSF 1 +%define CONFIG_DCA_CORE_BSF 1 +%define CONFIG_EAC3_CORE_BSF 1 +%define CONFIG_EXTRACT_EXTRADATA_BSF 1 +%define CONFIG_FILTER_UNITS_BSF 1 +%define CONFIG_H264_METADATA_BSF 1 %define CONFIG_H264_MP4TOANNEXB_BSF 1 +%define CONFIG_H264_REDUNDANT_PPS_BSF 1 +%define CONFIG_HAPQA_EXTRACT_BSF 1 +%define CONFIG_HEVC_METADATA_BSF 1 %define CONFIG_HEVC_MP4TOANNEXB_BSF 1 %define CONFIG_IMX_DUMP_HEADER_BSF 1 %define CONFIG_MJPEG2JPEG_BSF 1 %define CONFIG_MJPEGA_DUMP_HEADER_BSF 1 %define CONFIG_MP3_HEADER_DECOMPRESS_BSF 1 +%define CONFIG_MPEG2_METADATA_BSF 1 %define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 1 %define CONFIG_MOV2TEXTSUB_BSF 1 %define CONFIG_NOISE_BSF 1 +%define CONFIG_NULL_BSF 1 +%define CONFIG_PRORES_METADATA_BSF 1 %define CONFIG_REMOVE_EXTRADATA_BSF 1 %define CONFIG_TEXT2MOVSUB_BSF 1 +%define CONFIG_TRACE_HEADERS_BSF 1 +%define CONFIG_VP9_METADATA_BSF 1 +%define CONFIG_VP9_RAW_REORDER_BSF 1 +%define CONFIG_VP9_SUPERFRAME_BSF 1 +%define CONFIG_VP9_SUPERFRAME_SPLIT_BSF 1 %define CONFIG_AASC_DECODER 1 %define CONFIG_AIC_DECODER 1 %define CONFIG_ALIAS_PIX_DECODER 1 @@ -619,6 +710,7 @@ %define CONFIG_BETHSOFTVID_DECODER 1 %define CONFIG_BFI_DECODER 1 %define CONFIG_BINK_DECODER 1 +%define CONFIG_BITPACKED_DECODER 1 %define CONFIG_BMP_DECODER 1 %define CONFIG_BMV_VIDEO_DECODER 1 %define CONFIG_BRENDER_PIX_DECODER 1 @@ -626,7 +718,9 @@ %define CONFIG_CAVS_DECODER 1 %define CONFIG_CDGRAPHICS_DECODER 1 %define CONFIG_CDXL_DECODER 1 +%define CONFIG_CFHD_DECODER 1 %define CONFIG_CINEPAK_DECODER 1 +%define CONFIG_CLEARVIDEO_DECODER 1 %define CONFIG_CLJR_DECODER 1 %define CONFIG_CLLC_DECODER 1 %define CONFIG_COMFORTNOISE_DECODER 1 @@ -639,9 +733,11 @@ %define CONFIG_DNXHD_DECODER 1 %define CONFIG_DPX_DECODER 1 %define CONFIG_DSICINVIDEO_DECODER 1 +%define CONFIG_DVAUDIO_DECODER 1 %define CONFIG_DVVIDEO_DECODER 1 %define CONFIG_DXA_DECODER 1 %define CONFIG_DXTORY_DECODER 1 +%define CONFIG_DXV_DECODER 1 %define CONFIG_EACMV_DECODER 1 %define CONFIG_EAMAD_DECODER 1 %define CONFIG_EATGQ_DECODER 1 @@ -656,35 +752,42 @@ %define CONFIG_FFV1_DECODER 1 %define CONFIG_FFVHUFF_DECODER 1 %define CONFIG_FIC_DECODER 1 +%define CONFIG_FITS_DECODER 1 %define CONFIG_FLASHSV_DECODER 1 %define CONFIG_FLASHSV2_DECODER 1 %define CONFIG_FLIC_DECODER 1 %define CONFIG_FLV_DECODER 1 +%define CONFIG_FMVC_DECODER 1 %define CONFIG_FOURXM_DECODER 1 %define CONFIG_FRAPS_DECODER 1 %define CONFIG_FRWU_DECODER 1 %define CONFIG_G2M_DECODER 1 +%define CONFIG_GDV_DECODER 1 %define CONFIG_GIF_DECODER 1 %define CONFIG_H261_DECODER 1 %define CONFIG_H263_DECODER 1 %define CONFIG_H263I_DECODER 1 %define CONFIG_H263P_DECODER 1 +%define CONFIG_H263_V4L2M2M_DECODER 0 %define CONFIG_H264_DECODER 1 %define CONFIG_H264_CRYSTALHD_DECODER 0 +%define CONFIG_H264_V4L2M2M_DECODER 0 +%define CONFIG_H264_MEDIACODEC_DECODER 0 %define CONFIG_H264_MMAL_DECODER 0 %define CONFIG_H264_QSV_DECODER 0 -%define CONFIG_H264_VDA_DECODER 0 -%define CONFIG_H264_VDPAU_DECODER 0 +%define CONFIG_H264_RKMPP_DECODER 0 %define CONFIG_HAP_DECODER 1 %define CONFIG_HEVC_DECODER 1 %define CONFIG_HEVC_QSV_DECODER 0 +%define CONFIG_HEVC_RKMPP_DECODER 0 +%define CONFIG_HEVC_V4L2M2M_DECODER 0 %define CONFIG_HNM4_VIDEO_DECODER 1 %define CONFIG_HQ_HQA_DECODER 1 %define CONFIG_HQX_DECODER 1 %define CONFIG_HUFFYUV_DECODER 1 %define CONFIG_IDCIN_DECODER 1 -%define CONFIG_IFF_BYTERUN1_DECODER 1 %define CONFIG_IFF_ILBM_DECODER 1 +%define CONFIG_IMM4_DECODER 1 %define CONFIG_INDEO2_DECODER 0 %define CONFIG_INDEO3_DECODER 0 %define CONFIG_INDEO4_DECODER 0 @@ -697,28 +800,33 @@ %define CONFIG_KMVC_DECODER 1 %define CONFIG_LAGARITH_DECODER 1 %define CONFIG_LOCO_DECODER 1 +%define CONFIG_M101_DECODER 1 +%define CONFIG_MAGICYUV_DECODER 1 %define CONFIG_MDEC_DECODER 1 %define CONFIG_MIMIC_DECODER 1 %define CONFIG_MJPEG_DECODER 1 %define CONFIG_MJPEGB_DECODER 1 %define CONFIG_MMVIDEO_DECODER 1 %define CONFIG_MOTIONPIXELS_DECODER 1 -%define CONFIG_MPEG_XVMC_DECODER 0 %define CONFIG_MPEG1VIDEO_DECODER 1 %define CONFIG_MPEG2VIDEO_DECODER 1 %define CONFIG_MPEG4_DECODER 1 %define CONFIG_MPEG4_CRYSTALHD_DECODER 0 -%define CONFIG_MPEG4_VDPAU_DECODER 0 +%define CONFIG_MPEG4_V4L2M2M_DECODER 0 +%define CONFIG_MPEG4_MMAL_DECODER 0 %define CONFIG_MPEGVIDEO_DECODER 1 -%define CONFIG_MPEG_VDPAU_DECODER 0 -%define CONFIG_MPEG1_VDPAU_DECODER 0 +%define CONFIG_MPEG1_V4L2M2M_DECODER 0 +%define CONFIG_MPEG2_MMAL_DECODER 0 %define CONFIG_MPEG2_CRYSTALHD_DECODER 0 +%define CONFIG_MPEG2_V4L2M2M_DECODER 0 %define CONFIG_MPEG2_QSV_DECODER 0 +%define CONFIG_MPEG2_MEDIACODEC_DECODER 0 %define CONFIG_MSA1_DECODER 1 -%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0 +%define CONFIG_MSCC_DECODER 1 %define CONFIG_MSMPEG4V1_DECODER 1 %define CONFIG_MSMPEG4V2_DECODER 1 %define CONFIG_MSMPEG4V3_DECODER 1 +%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0 %define CONFIG_MSRLE_DECODER 1 %define CONFIG_MSS1_DECODER 1 %define CONFIG_MSS2_DECODER 1 @@ -727,6 +835,7 @@ %define CONFIG_MTS2_DECODER 1 %define CONFIG_MVC1_DECODER 1 %define CONFIG_MVC2_DECODER 1 +%define CONFIG_MWSC_DECODER 1 %define CONFIG_MXPEG_DECODER 1 %define CONFIG_NUV_DECODER 1 %define CONFIG_PAF_VIDEO_DECODER 1 @@ -736,33 +845,43 @@ %define CONFIG_PGM_DECODER 1 %define CONFIG_PGMYUV_DECODER 1 %define CONFIG_PICTOR_DECODER 1 +%define CONFIG_PIXLET_DECODER 1 %define CONFIG_PNG_DECODER 1 %define CONFIG_PPM_DECODER 1 %define CONFIG_PRORES_DECODER 1 -%define CONFIG_PRORES_LGPL_DECODER 1 +%define CONFIG_PROSUMER_DECODER 1 +%define CONFIG_PSD_DECODER 1 %define CONFIG_PTX_DECODER 1 %define CONFIG_QDRAW_DECODER 1 %define CONFIG_QPEG_DECODER 1 %define CONFIG_QTRLE_DECODER 1 %define CONFIG_R10K_DECODER 1 %define CONFIG_R210_DECODER 1 +%define CONFIG_RASC_DECODER 1 %define CONFIG_RAWVIDEO_DECODER 1 %define CONFIG_RL2_DECODER 1 %define CONFIG_ROQ_DECODER 1 %define CONFIG_RPZA_DECODER 1 +%define CONFIG_RSCC_DECODER 1 %define CONFIG_RV10_DECODER 1 %define CONFIG_RV20_DECODER 1 %define CONFIG_RV30_DECODER 1 %define CONFIG_RV40_DECODER 1 %define CONFIG_S302M_DECODER 1 %define CONFIG_SANM_DECODER 1 +%define CONFIG_SCPR_DECODER 1 +%define CONFIG_SCREENPRESSO_DECODER 1 +%define CONFIG_SDX2_DPCM_DECODER 1 %define CONFIG_SGI_DECODER 1 %define CONFIG_SGIRLE_DECODER 1 +%define CONFIG_SHEERVIDEO_DECODER 1 %define CONFIG_SMACKER_DECODER 1 %define CONFIG_SMC_DECODER 1 %define CONFIG_SMVJPEG_DECODER 1 %define CONFIG_SNOW_DECODER 1 %define CONFIG_SP5X_DECODER 1 +%define CONFIG_SPEEDHQ_DECODER 1 +%define CONFIG_SRGC_DECODER 1 %define CONFIG_SUNRAST_DECODER 1 %define CONFIG_SVQ1_DECODER 1 %define CONFIG_SVQ3_DECODER 1 @@ -776,6 +895,7 @@ %define CONFIG_TMV_DECODER 1 %define CONFIG_TRUEMOTION1_DECODER 1 %define CONFIG_TRUEMOTION2_DECODER 1 +%define CONFIG_TRUEMOTION2RT_DECODER 1 %define CONFIG_TSCC_DECODER 1 %define CONFIG_TSCC2_DECODER 1 %define CONFIG_TXD_DECODER 1 @@ -790,9 +910,10 @@ %define CONFIG_VBLE_DECODER 1 %define CONFIG_VC1_DECODER 1 %define CONFIG_VC1_CRYSTALHD_DECODER 0 -%define CONFIG_VC1_VDPAU_DECODER 0 %define CONFIG_VC1IMAGE_DECODER 1 +%define CONFIG_VC1_MMAL_DECODER 0 %define CONFIG_VC1_QSV_DECODER 0 +%define CONFIG_VC1_V4L2M2M_DECODER 0 %define CONFIG_VCR1_DECODER 1 %define CONFIG_VMDVIDEO_DECODER 1 %define CONFIG_VMNC_DECODER 1 @@ -803,14 +924,19 @@ %define CONFIG_VP6F_DECODER 1 %define CONFIG_VP7_DECODER 1 %define CONFIG_VP8_DECODER 1 +%define CONFIG_VP8_RKMPP_DECODER 0 +%define CONFIG_VP8_V4L2M2M_DECODER 0 %define CONFIG_VP9_DECODER 1 +%define CONFIG_VP9_RKMPP_DECODER 0 +%define CONFIG_VP9_V4L2M2M_DECODER 0 %define CONFIG_VQA_DECODER 1 %define CONFIG_WEBP_DECODER 1 +%define CONFIG_WCMV_DECODER 1 +%define CONFIG_WRAPPED_AVFRAME_DECODER 1 %define CONFIG_WMV1_DECODER 1 %define CONFIG_WMV2_DECODER 1 %define CONFIG_WMV3_DECODER 1 %define CONFIG_WMV3_CRYSTALHD_DECODER 0 -%define CONFIG_WMV3_VDPAU_DECODER 0 %define CONFIG_WMV3IMAGE_DECODER 1 %define CONFIG_WNV1_DECODER 1 %define CONFIG_XAN_WC3_DECODER 1 @@ -818,8 +944,10 @@ %define CONFIG_XBM_DECODER 1 %define CONFIG_XFACE_DECODER 1 %define CONFIG_XL_DECODER 1 +%define CONFIG_XPM_DECODER 1 %define CONFIG_XWD_DECODER 1 %define CONFIG_Y41P_DECODER 1 +%define CONFIG_YLC_DECODER 1 %define CONFIG_YOP_DECODER 1 %define CONFIG_YUV4_DECODER 1 %define CONFIG_ZERO12V_DECODER 1 @@ -836,20 +964,27 @@ %define CONFIG_AMRNB_DECODER 1 %define CONFIG_AMRWB_DECODER 1 %define CONFIG_APE_DECODER 1 +%define CONFIG_APTX_DECODER 1 +%define CONFIG_APTX_HD_DECODER 1 %define CONFIG_ATRAC1_DECODER 1 %define CONFIG_ATRAC3_DECODER 1 +%define CONFIG_ATRAC3AL_DECODER 1 %define CONFIG_ATRAC3P_DECODER 0 +%define CONFIG_ATRAC3PAL_DECODER 1 +%define CONFIG_ATRAC9_DECODER 1 %define CONFIG_BINKAUDIO_DCT_DECODER 1 %define CONFIG_BINKAUDIO_RDFT_DECODER 1 %define CONFIG_BMV_AUDIO_DECODER 1 %define CONFIG_COOK_DECODER 1 %define CONFIG_DCA_DECODER 1 +%define CONFIG_DOLBY_E_DECODER 1 %define CONFIG_DSD_LSBF_DECODER 1 %define CONFIG_DSD_MSBF_DECODER 1 %define CONFIG_DSD_LSBF_PLANAR_DECODER 1 %define CONFIG_DSD_MSBF_PLANAR_DECODER 1 %define CONFIG_DSICINAUDIO_DECODER 1 %define CONFIG_DSS_SP_DECODER 1 +%define CONFIG_DST_DECODER 1 %define CONFIG_EAC3_DECODER 1 %define CONFIG_EVRC_DECODER 1 %define CONFIG_FFWAVESYNTH_DECODER 1 @@ -859,7 +994,9 @@ %define CONFIG_GSM_DECODER 1 %define CONFIG_GSM_MS_DECODER 1 %define CONFIG_IAC_DECODER 1 +%define CONFIG_ILBC_DECODER 1 %define CONFIG_IMC_DECODER 1 +%define CONFIG_INTERPLAY_ACM_DECODER 1 %define CONFIG_MACE3_DECODER 1 %define CONFIG_MACE6_DECODER 1 %define CONFIG_METASOUND_DECODER 1 @@ -868,12 +1005,12 @@ %define CONFIG_MP1FLOAT_DECODER 1 %define CONFIG_MP2_DECODER 1 %define CONFIG_MP2FLOAT_DECODER 1 -%define CONFIG_MP3_DECODER 1 %define CONFIG_MP3FLOAT_DECODER 1 -%define CONFIG_MP3ADU_DECODER 1 +%define CONFIG_MP3_DECODER 1 %define CONFIG_MP3ADUFLOAT_DECODER 1 -%define CONFIG_MP3ON4_DECODER 1 +%define CONFIG_MP3ADU_DECODER 1 %define CONFIG_MP3ON4FLOAT_DECODER 1 +%define CONFIG_MP3ON4_DECODER 1 %define CONFIG_MPC7_DECODER 1 %define CONFIG_MPC8_DECODER 1 %define CONFIG_NELLYMOSER_DECODER 1 @@ -882,9 +1019,11 @@ %define CONFIG_PAF_AUDIO_DECODER 1 %define CONFIG_QCELP_DECODER 1 %define CONFIG_QDM2_DECODER 1 +%define CONFIG_QDMC_DECODER 1 %define CONFIG_RA_144_DECODER 1 %define CONFIG_RA_288_DECODER 1 %define CONFIG_RALF_DECODER 1 +%define CONFIG_SBC_DECODER 1 %define CONFIG_SHORTEN_DECODER 1 %define CONFIG_SIPR_DECODER 1 %define CONFIG_SMACKAUD_DECODER 1 @@ -903,9 +1042,13 @@ %define CONFIG_WMAV2_DECODER 1 %define CONFIG_WMAVOICE_DECODER 1 %define CONFIG_WS_SND1_DECODER 1 +%define CONFIG_XMA1_DECODER 1 +%define CONFIG_XMA2_DECODER 1 %define CONFIG_PCM_ALAW_DECODER 1 %define CONFIG_PCM_BLURAY_DECODER 1 %define CONFIG_PCM_DVD_DECODER 1 +%define CONFIG_PCM_F16LE_DECODER 1 +%define CONFIG_PCM_F24LE_DECODER 1 %define CONFIG_PCM_F32BE_DECODER 1 %define CONFIG_PCM_F32LE_DECODER 1 %define CONFIG_PCM_F64BE_DECODER 1 @@ -925,6 +1068,8 @@ %define CONFIG_PCM_S32BE_DECODER 1 %define CONFIG_PCM_S32LE_DECODER 1 %define CONFIG_PCM_S32LE_PLANAR_DECODER 1 +%define CONFIG_PCM_S64BE_DECODER 1 +%define CONFIG_PCM_S64LE_DECODER 1 %define CONFIG_PCM_U8_DECODER 1 %define CONFIG_PCM_U16BE_DECODER 1 %define CONFIG_PCM_U16LE_DECODER 1 @@ -932,7 +1077,9 @@ %define CONFIG_PCM_U24LE_DECODER 1 %define CONFIG_PCM_U32BE_DECODER 1 %define CONFIG_PCM_U32LE_DECODER 1 +%define CONFIG_PCM_VIDC_DECODER 1 %define CONFIG_PCM_ZORK_DECODER 1 +%define CONFIG_GREMLIN_DPCM_DECODER 1 %define CONFIG_INTERPLAY_DPCM_DECODER 1 %define CONFIG_ROQ_DPCM_DECODER 1 %define CONFIG_SOL_DPCM_DECODER 1 @@ -940,6 +1087,7 @@ %define CONFIG_ADPCM_4XM_DECODER 1 %define CONFIG_ADPCM_ADX_DECODER 1 %define CONFIG_ADPCM_AFC_DECODER 1 +%define CONFIG_ADPCM_AICA_DECODER 1 %define CONFIG_ADPCM_CT_DECODER 1 %define CONFIG_ADPCM_DTK_DECODER 1 %define CONFIG_ADPCM_EA_DECODER 1 @@ -953,6 +1101,7 @@ %define CONFIG_ADPCM_G726LE_DECODER 1 %define CONFIG_ADPCM_IMA_AMV_DECODER 1 %define CONFIG_ADPCM_IMA_APC_DECODER 1 +%define CONFIG_ADPCM_IMA_DAT4_DECODER 1 %define CONFIG_ADPCM_IMA_DK3_DECODER 1 %define CONFIG_ADPCM_IMA_DK4_DECODER 1 %define CONFIG_ADPCM_IMA_EA_EACS_DECODER 1 @@ -965,6 +1114,8 @@ %define CONFIG_ADPCM_IMA_WAV_DECODER 1 %define CONFIG_ADPCM_IMA_WS_DECODER 1 %define CONFIG_ADPCM_MS_DECODER 1 +%define CONFIG_ADPCM_MTAF_DECODER 1 +%define CONFIG_ADPCM_PSX_DECODER 1 %define CONFIG_ADPCM_SBPRO_2_DECODER 1 %define CONFIG_ADPCM_SBPRO_3_DECODER 1 %define CONFIG_ADPCM_SBPRO_4_DECODER 1 @@ -974,7 +1125,6 @@ %define CONFIG_ADPCM_VIMA_DECODER 1 %define CONFIG_ADPCM_XA_DECODER 1 %define CONFIG_ADPCM_YAMAHA_DECODER 1 -%define CONFIG_VIMA_DECODER 1 %define CONFIG_SSA_DECODER 1 %define CONFIG_ASS_DECODER 1 %define CONFIG_CCAPTION_DECODER 1 @@ -997,8 +1147,26 @@ %define CONFIG_VPLAYER_DECODER 1 %define CONFIG_WEBVTT_DECODER 1 %define CONFIG_XSUB_DECODER 1 +%define CONFIG_AAC_AT_DECODER 0 +%define CONFIG_AC3_AT_DECODER 0 +%define CONFIG_ADPCM_IMA_QT_AT_DECODER 0 +%define CONFIG_ALAC_AT_DECODER 0 +%define CONFIG_AMR_NB_AT_DECODER 0 +%define CONFIG_EAC3_AT_DECODER 0 +%define CONFIG_GSM_MS_AT_DECODER 0 +%define CONFIG_ILBC_AT_DECODER 0 +%define CONFIG_MP1_AT_DECODER 0 +%define CONFIG_MP2_AT_DECODER 0 +%define CONFIG_MP3_AT_DECODER 0 +%define CONFIG_PCM_ALAW_AT_DECODER 0 +%define CONFIG_PCM_MULAW_AT_DECODER 0 +%define CONFIG_QDMC_AT_DECODER 0 +%define CONFIG_QDM2_AT_DECODER 0 +%define CONFIG_LIBAOM_AV1_DECODER 0 %define CONFIG_LIBCELT_DECODER 0 -%define CONFIG_LIBDCADEC_DECODER 0 +%define CONFIG_LIBCODEC2_DECODER 0 +%define CONFIG_LIBDAV1D_DECODER 0 +%define CONFIG_LIBDAVS2_DECODER 0 %define CONFIG_LIBFDK_AAC_DECODER 0 %define CONFIG_LIBGSM_DECODER 0 %define CONFIG_LIBGSM_MS_DECODER 0 @@ -1007,10 +1175,8 @@ %define CONFIG_LIBOPENCORE_AMRWB_DECODER 0 %define CONFIG_LIBOPENJPEG_DECODER 0 %define CONFIG_LIBOPUS_DECODER 0 -%define CONFIG_LIBSCHROEDINGER_DECODER 0 +%define CONFIG_LIBRSVG_DECODER 0 %define CONFIG_LIBSPEEX_DECODER 0 -%define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0 -%define CONFIG_LIBUTVIDEO_DECODER 0 %define CONFIG_LIBVORBIS_DECODER 0 %define CONFIG_LIBVPX_VP8_DECODER 0 %define CONFIG_LIBVPX_VP9_DECODER 0 @@ -1018,250 +1184,21 @@ %define CONFIG_BINTEXT_DECODER 1 %define CONFIG_XBIN_DECODER 1 %define CONFIG_IDF_DECODER 1 -%define CONFIG_AAC_DEMUXER 1 -%define CONFIG_AC3_DEMUXER 1 -%define CONFIG_ACT_DEMUXER 1 -%define CONFIG_ADF_DEMUXER 1 -%define CONFIG_ADP_DEMUXER 1 -%define CONFIG_ADX_DEMUXER 1 -%define CONFIG_AEA_DEMUXER 1 -%define CONFIG_AFC_DEMUXER 1 -%define CONFIG_AIFF_DEMUXER 1 -%define CONFIG_AMR_DEMUXER 1 -%define CONFIG_ANM_DEMUXER 1 -%define CONFIG_APC_DEMUXER 1 -%define CONFIG_APE_DEMUXER 1 -%define CONFIG_APNG_DEMUXER 1 -%define CONFIG_AQTITLE_DEMUXER 1 -%define CONFIG_ASF_DEMUXER 1 -%define CONFIG_ASF_O_DEMUXER 1 -%define CONFIG_ASS_DEMUXER 1 -%define CONFIG_AST_DEMUXER 1 -%define CONFIG_AU_DEMUXER 1 -%define CONFIG_AVI_DEMUXER 1 -%define CONFIG_AVISYNTH_DEMUXER 0 -%define CONFIG_AVR_DEMUXER 1 -%define CONFIG_AVS_DEMUXER 1 -%define CONFIG_BETHSOFTVID_DEMUXER 1 -%define CONFIG_BFI_DEMUXER 1 -%define CONFIG_BINTEXT_DEMUXER 1 -%define CONFIG_BINK_DEMUXER 1 -%define CONFIG_BIT_DEMUXER 1 -%define CONFIG_BMV_DEMUXER 1 -%define CONFIG_BFSTM_DEMUXER 1 -%define CONFIG_BRSTM_DEMUXER 1 -%define CONFIG_BOA_DEMUXER 1 -%define CONFIG_C93_DEMUXER 1 -%define CONFIG_CAF_DEMUXER 1 -%define CONFIG_CAVSVIDEO_DEMUXER 1 -%define CONFIG_CDG_DEMUXER 1 -%define CONFIG_CDXL_DEMUXER 1 -%define CONFIG_CINE_DEMUXER 1 -%define CONFIG_CONCAT_DEMUXER 1 -%define CONFIG_DATA_DEMUXER 1 -%define CONFIG_DAUD_DEMUXER 1 -%define CONFIG_DFA_DEMUXER 1 -%define CONFIG_DIRAC_DEMUXER 1 -%define CONFIG_DNXHD_DEMUXER 1 -%define CONFIG_DSF_DEMUXER 1 -%define CONFIG_DSICIN_DEMUXER 1 -%define CONFIG_DSS_DEMUXER 1 -%define CONFIG_DTS_DEMUXER 1 -%define CONFIG_DTSHD_DEMUXER 1 -%define CONFIG_DV_DEMUXER 1 -%define CONFIG_DVBSUB_DEMUXER 1 -%define CONFIG_DXA_DEMUXER 1 -%define CONFIG_EA_DEMUXER 1 -%define CONFIG_EA_CDATA_DEMUXER 1 -%define CONFIG_EAC3_DEMUXER 1 -%define CONFIG_EPAF_DEMUXER 1 -%define CONFIG_FFM_DEMUXER 1 -%define CONFIG_FFMETADATA_DEMUXER 1 -%define CONFIG_FILMSTRIP_DEMUXER 1 -%define CONFIG_FLAC_DEMUXER 1 -%define CONFIG_FLIC_DEMUXER 1 -%define CONFIG_FLV_DEMUXER 1 -%define CONFIG_LIVE_FLV_DEMUXER 1 -%define CONFIG_FOURXM_DEMUXER 1 -%define CONFIG_FRM_DEMUXER 1 -%define CONFIG_G722_DEMUXER 1 -%define CONFIG_G723_1_DEMUXER 1 -%define CONFIG_G729_DEMUXER 1 -%define CONFIG_GIF_DEMUXER 1 -%define CONFIG_GSM_DEMUXER 1 -%define CONFIG_GXF_DEMUXER 1 -%define CONFIG_H261_DEMUXER 1 -%define CONFIG_H263_DEMUXER 1 -%define CONFIG_H264_DEMUXER 1 -%define CONFIG_HEVC_DEMUXER 1 -%define CONFIG_HLS_DEMUXER 1 -%define CONFIG_HNM_DEMUXER 1 -%define CONFIG_ICO_DEMUXER 1 -%define CONFIG_IDCIN_DEMUXER 1 -%define CONFIG_IDF_DEMUXER 1 -%define CONFIG_IFF_DEMUXER 1 -%define CONFIG_ILBC_DEMUXER 1 -%define CONFIG_IMAGE2_DEMUXER 1 -%define CONFIG_IMAGE2PIPE_DEMUXER 1 -%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 1 -%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 1 -%define CONFIG_INGENIENT_DEMUXER 1 -%define CONFIG_IPMOVIE_DEMUXER 1 -%define CONFIG_IRCAM_DEMUXER 1 -%define CONFIG_ISS_DEMUXER 1 -%define CONFIG_IV8_DEMUXER 1 -%define CONFIG_IVF_DEMUXER 1 -%define CONFIG_JACOSUB_DEMUXER 1 -%define CONFIG_JV_DEMUXER 1 -%define CONFIG_LATM_DEMUXER 1 -%define CONFIG_LMLM4_DEMUXER 1 -%define CONFIG_LOAS_DEMUXER 1 -%define CONFIG_LRC_DEMUXER 1 -%define CONFIG_LVF_DEMUXER 1 -%define CONFIG_LXF_DEMUXER 1 -%define CONFIG_M4V_DEMUXER 1 -%define CONFIG_MATROSKA_DEMUXER 1 -%define CONFIG_MGSTS_DEMUXER 1 -%define CONFIG_MICRODVD_DEMUXER 1 -%define CONFIG_MJPEG_DEMUXER 1 -%define CONFIG_MLP_DEMUXER 1 -%define CONFIG_MLV_DEMUXER 1 -%define CONFIG_MM_DEMUXER 1 -%define CONFIG_MMF_DEMUXER 1 -%define CONFIG_MOV_DEMUXER 1 -%define CONFIG_MP3_DEMUXER 1 -%define CONFIG_MPC_DEMUXER 1 -%define CONFIG_MPC8_DEMUXER 1 -%define CONFIG_MPEGPS_DEMUXER 1 -%define CONFIG_MPEGTS_DEMUXER 1 -%define CONFIG_MPEGTSRAW_DEMUXER 1 -%define CONFIG_MPEGVIDEO_DEMUXER 1 -%define CONFIG_MPJPEG_DEMUXER 1 -%define CONFIG_MPL2_DEMUXER 1 -%define CONFIG_MPSUB_DEMUXER 1 -%define CONFIG_MSNWC_TCP_DEMUXER 1 -%define CONFIG_MTV_DEMUXER 1 -%define CONFIG_MV_DEMUXER 1 -%define CONFIG_MVI_DEMUXER 1 -%define CONFIG_MXF_DEMUXER 1 -%define CONFIG_MXG_DEMUXER 1 -%define CONFIG_NC_DEMUXER 1 -%define CONFIG_NISTSPHERE_DEMUXER 1 -%define CONFIG_NSV_DEMUXER 1 -%define CONFIG_NUT_DEMUXER 1 -%define CONFIG_NUV_DEMUXER 1 -%define CONFIG_OGG_DEMUXER 1 -%define CONFIG_OMA_DEMUXER 1 -%define CONFIG_PAF_DEMUXER 1 -%define CONFIG_PCM_ALAW_DEMUXER 1 -%define CONFIG_PCM_MULAW_DEMUXER 1 -%define CONFIG_PCM_F64BE_DEMUXER 1 -%define CONFIG_PCM_F64LE_DEMUXER 1 -%define CONFIG_PCM_F32BE_DEMUXER 1 -%define CONFIG_PCM_F32LE_DEMUXER 1 -%define CONFIG_PCM_S32BE_DEMUXER 1 -%define CONFIG_PCM_S32LE_DEMUXER 1 -%define CONFIG_PCM_S24BE_DEMUXER 1 -%define CONFIG_PCM_S24LE_DEMUXER 1 -%define CONFIG_PCM_S16BE_DEMUXER 1 -%define CONFIG_PCM_S16LE_DEMUXER 1 -%define CONFIG_PCM_S8_DEMUXER 1 -%define CONFIG_PCM_U32BE_DEMUXER 1 -%define CONFIG_PCM_U32LE_DEMUXER 1 -%define CONFIG_PCM_U24BE_DEMUXER 1 -%define CONFIG_PCM_U24LE_DEMUXER 1 -%define CONFIG_PCM_U16BE_DEMUXER 1 -%define CONFIG_PCM_U16LE_DEMUXER 1 -%define CONFIG_PCM_U8_DEMUXER 1 -%define CONFIG_PJS_DEMUXER 1 -%define CONFIG_PMP_DEMUXER 1 -%define CONFIG_PVA_DEMUXER 1 -%define CONFIG_PVF_DEMUXER 1 -%define CONFIG_QCP_DEMUXER 1 -%define CONFIG_R3D_DEMUXER 1 -%define CONFIG_RAWVIDEO_DEMUXER 1 -%define CONFIG_REALTEXT_DEMUXER 1 -%define CONFIG_REDSPARK_DEMUXER 1 -%define CONFIG_RL2_DEMUXER 1 -%define CONFIG_RM_DEMUXER 1 -%define CONFIG_ROQ_DEMUXER 1 -%define CONFIG_RPL_DEMUXER 1 -%define CONFIG_RSD_DEMUXER 1 -%define CONFIG_RSO_DEMUXER 1 -%define CONFIG_RTP_DEMUXER 0 -%define CONFIG_RTSP_DEMUXER 0 -%define CONFIG_SAMI_DEMUXER 1 -%define CONFIG_SAP_DEMUXER 0 -%define CONFIG_SBG_DEMUXER 1 -%define CONFIG_SDP_DEMUXER 0 -%define CONFIG_SDR2_DEMUXER 1 -%define CONFIG_SEGAFILM_DEMUXER 1 -%define CONFIG_SHORTEN_DEMUXER 1 -%define CONFIG_SIFF_DEMUXER 1 -%define CONFIG_SLN_DEMUXER 1 -%define CONFIG_SMACKER_DEMUXER 1 -%define CONFIG_SMJPEG_DEMUXER 1 -%define CONFIG_SMUSH_DEMUXER 1 -%define CONFIG_SOL_DEMUXER 1 -%define CONFIG_SOX_DEMUXER 1 -%define CONFIG_SPDIF_DEMUXER 1 -%define CONFIG_SRT_DEMUXER 1 -%define CONFIG_STR_DEMUXER 1 -%define CONFIG_STL_DEMUXER 1 -%define CONFIG_SUBVIEWER1_DEMUXER 1 -%define CONFIG_SUBVIEWER_DEMUXER 1 -%define CONFIG_SUP_DEMUXER 1 -%define CONFIG_SWF_DEMUXER 1 -%define CONFIG_TAK_DEMUXER 1 -%define CONFIG_TEDCAPTIONS_DEMUXER 1 -%define CONFIG_THP_DEMUXER 1 -%define CONFIG_TIERTEXSEQ_DEMUXER 1 -%define CONFIG_TMV_DEMUXER 1 -%define CONFIG_TRUEHD_DEMUXER 1 -%define CONFIG_TTA_DEMUXER 1 -%define CONFIG_TXD_DEMUXER 1 -%define CONFIG_TTY_DEMUXER 1 -%define CONFIG_VC1_DEMUXER 1 -%define CONFIG_VC1T_DEMUXER 1 -%define CONFIG_VIVO_DEMUXER 1 -%define CONFIG_VMD_DEMUXER 1 -%define CONFIG_VOBSUB_DEMUXER 1 -%define CONFIG_VOC_DEMUXER 1 -%define CONFIG_VPLAYER_DEMUXER 1 -%define CONFIG_VQF_DEMUXER 1 -%define CONFIG_W64_DEMUXER 1 -%define CONFIG_WAV_DEMUXER 1 -%define CONFIG_WC3_DEMUXER 1 -%define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 1 -%define CONFIG_WEBVTT_DEMUXER 1 -%define CONFIG_WSAUD_DEMUXER 1 -%define CONFIG_WSVQA_DEMUXER 1 -%define CONFIG_WTV_DEMUXER 1 -%define CONFIG_WV_DEMUXER 1 -%define CONFIG_XA_DEMUXER 1 -%define CONFIG_XBIN_DEMUXER 1 -%define CONFIG_XMV_DEMUXER 1 -%define CONFIG_XWMA_DEMUXER 1 -%define CONFIG_YOP_DEMUXER 1 -%define CONFIG_YUV4MPEGPIPE_DEMUXER 1 -%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PNG_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_SGI_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 1 -%define CONFIG_LIBGME_DEMUXER 0 -%define CONFIG_LIBMODPLUG_DEMUXER 0 -%define CONFIG_LIBNUT_DEMUXER 0 -%define CONFIG_LIBQUVI_DEMUXER 0 +%define CONFIG_LIBOPENH264_DECODER 0 +%define CONFIG_H264_CUVID_DECODER 0 +%define CONFIG_HEVC_CUVID_DECODER 0 +%define CONFIG_HEVC_MEDIACODEC_DECODER 0 +%define CONFIG_MJPEG_CUVID_DECODER 0 +%define CONFIG_MPEG1_CUVID_DECODER 0 +%define CONFIG_MPEG2_CUVID_DECODER 0 +%define CONFIG_MPEG4_CUVID_DECODER 0 +%define CONFIG_MPEG4_MEDIACODEC_DECODER 0 +%define CONFIG_VC1_CUVID_DECODER 0 +%define CONFIG_VP8_CUVID_DECODER 0 +%define CONFIG_VP8_MEDIACODEC_DECODER 0 +%define CONFIG_VP8_QSV_DECODER 0 +%define CONFIG_VP9_CUVID_DECODER 0 +%define CONFIG_VP9_MEDIACODEC_DECODER 0 %define CONFIG_A64MULTI_ENCODER 0 %define CONFIG_A64MULTI5_ENCODER 0 %define CONFIG_ALIAS_PIX_ENCODER 0 @@ -1281,6 +1218,7 @@ %define CONFIG_DVVIDEO_ENCODER 0 %define CONFIG_FFV1_ENCODER 0 %define CONFIG_FFVHUFF_ENCODER 0 +%define CONFIG_FITS_ENCODER 0 %define CONFIG_FLASHSV_ENCODER 0 %define CONFIG_FLASHSV2_ENCODER 0 %define CONFIG_FLV_ENCODER 0 @@ -1293,6 +1231,7 @@ %define CONFIG_JPEG2000_ENCODER 0 %define CONFIG_JPEGLS_ENCODER 0 %define CONFIG_LJPEG_ENCODER 0 +%define CONFIG_MAGICYUV_ENCODER 0 %define CONFIG_MJPEG_ENCODER 0 %define CONFIG_MPEG1VIDEO_ENCODER 0 %define CONFIG_MPEG2VIDEO_ENCODER 0 @@ -1329,6 +1268,8 @@ %define CONFIG_V308_ENCODER 0 %define CONFIG_V408_ENCODER 0 %define CONFIG_V410_ENCODER 0 +%define CONFIG_VC2_ENCODER 0 +%define CONFIG_WRAPPED_AVFRAME_ENCODER 0 %define CONFIG_WMV1_ENCODER 0 %define CONFIG_WMV2_ENCODER 0 %define CONFIG_XBM_ENCODER 0 @@ -1342,16 +1283,22 @@ %define CONFIG_AC3_ENCODER 0 %define CONFIG_AC3_FIXED_ENCODER 0 %define CONFIG_ALAC_ENCODER 0 +%define CONFIG_APTX_ENCODER 0 +%define CONFIG_APTX_HD_ENCODER 0 %define CONFIG_DCA_ENCODER 0 %define CONFIG_EAC3_ENCODER 0 %define CONFIG_FLAC_ENCODER 0 %define CONFIG_G723_1_ENCODER 0 +%define CONFIG_MLP_ENCODER 0 %define CONFIG_MP2_ENCODER 0 %define CONFIG_MP2FIXED_ENCODER 0 %define CONFIG_NELLYMOSER_ENCODER 0 +%define CONFIG_OPUS_ENCODER 0 %define CONFIG_RA_144_ENCODER 0 +%define CONFIG_SBC_ENCODER 0 %define CONFIG_SONIC_ENCODER 0 %define CONFIG_SONIC_LS_ENCODER 0 +%define CONFIG_TRUEHD_ENCODER 0 %define CONFIG_TTA_ENCODER 0 %define CONFIG_VORBIS_ENCODER 0 %define CONFIG_WAVPACK_ENCODER 0 @@ -1376,6 +1323,8 @@ %define CONFIG_PCM_S32BE_ENCODER 0 %define CONFIG_PCM_S32LE_ENCODER 0 %define CONFIG_PCM_S32LE_PLANAR_ENCODER 0 +%define CONFIG_PCM_S64BE_ENCODER 0 +%define CONFIG_PCM_S64LE_ENCODER 0 %define CONFIG_PCM_U8_ENCODER 0 %define CONFIG_PCM_U16BE_ENCODER 0 %define CONFIG_PCM_U16LE_ENCODER 0 @@ -1383,10 +1332,12 @@ %define CONFIG_PCM_U24LE_ENCODER 0 %define CONFIG_PCM_U32BE_ENCODER 0 %define CONFIG_PCM_U32LE_ENCODER 0 +%define CONFIG_PCM_VIDC_ENCODER 0 %define CONFIG_ROQ_DPCM_ENCODER 0 %define CONFIG_ADPCM_ADX_ENCODER 0 %define CONFIG_ADPCM_G722_ENCODER 0 %define CONFIG_ADPCM_G726_ENCODER 0 +%define CONFIG_ADPCM_G726LE_ENCODER 0 %define CONFIG_ADPCM_IMA_QT_ENCODER 0 %define CONFIG_ADPCM_IMA_WAV_ENCODER 0 %define CONFIG_ADPCM_MS_ENCODER 0 @@ -1399,9 +1350,16 @@ %define CONFIG_MOVTEXT_ENCODER 0 %define CONFIG_SRT_ENCODER 0 %define CONFIG_SUBRIP_ENCODER 0 +%define CONFIG_TEXT_ENCODER 0 %define CONFIG_WEBVTT_ENCODER 0 %define CONFIG_XSUB_ENCODER 0 -%define CONFIG_LIBFAAC_ENCODER 0 +%define CONFIG_AAC_AT_ENCODER 0 +%define CONFIG_ALAC_AT_ENCODER 0 +%define CONFIG_ILBC_AT_ENCODER 0 +%define CONFIG_PCM_ALAW_AT_ENCODER 0 +%define CONFIG_PCM_MULAW_AT_ENCODER 0 +%define CONFIG_LIBAOM_AV1_ENCODER 0 +%define CONFIG_LIBCODEC2_ENCODER 0 %define CONFIG_LIBFDK_AAC_ENCODER 0 %define CONFIG_LIBGSM_ENCODER 0 %define CONFIG_LIBGSM_MS_ENCODER 0 @@ -1410,13 +1368,10 @@ %define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0 %define CONFIG_LIBOPENJPEG_ENCODER 0 %define CONFIG_LIBOPUS_ENCODER 0 -%define CONFIG_LIBSCHROEDINGER_ENCODER 0 %define CONFIG_LIBSHINE_ENCODER 0 %define CONFIG_LIBSPEEX_ENCODER 0 %define CONFIG_LIBTHEORA_ENCODER 0 %define CONFIG_LIBTWOLAME_ENCODER 0 -%define CONFIG_LIBUTVIDEO_ENCODER 0 -%define CONFIG_LIBVO_AACENC_ENCODER 0 %define CONFIG_LIBVO_AMRWBENC_ENCODER 0 %define CONFIG_LIBVORBIS_ENCODER 0 %define CONFIG_LIBVPX_VP8_ENCODER 0 @@ -1429,30 +1384,203 @@ %define CONFIG_LIBX264RGB_ENCODER 0 %define CONFIG_LIBX265_ENCODER 0 %define CONFIG_LIBXAVS_ENCODER 0 +%define CONFIG_LIBXAVS2_ENCODER 0 %define CONFIG_LIBXVID_ENCODER 0 -%define CONFIG_LIBAACPLUS_ENCODER 0 +%define CONFIG_H263_V4L2M2M_ENCODER 0 %define CONFIG_LIBOPENH264_ENCODER 0 +%define CONFIG_H264_AMF_ENCODER 0 +%define CONFIG_H264_NVENC_ENCODER 0 +%define CONFIG_H264_OMX_ENCODER 0 %define CONFIG_H264_QSV_ENCODER 0 +%define CONFIG_H264_V4L2M2M_ENCODER 0 +%define CONFIG_H264_VAAPI_ENCODER 0 +%define CONFIG_H264_VIDEOTOOLBOX_ENCODER 0 %define CONFIG_NVENC_ENCODER 0 %define CONFIG_NVENC_H264_ENCODER 0 %define CONFIG_NVENC_HEVC_ENCODER 0 +%define CONFIG_HEVC_AMF_ENCODER 0 +%define CONFIG_HEVC_NVENC_ENCODER 0 %define CONFIG_HEVC_QSV_ENCODER 0 +%define CONFIG_HEVC_V4L2M2M_ENCODER 0 +%define CONFIG_HEVC_VAAPI_ENCODER 0 +%define CONFIG_HEVC_VIDEOTOOLBOX_ENCODER 0 %define CONFIG_LIBKVAZAAR_ENCODER 0 +%define CONFIG_MJPEG_QSV_ENCODER 0 +%define CONFIG_MJPEG_VAAPI_ENCODER 0 %define CONFIG_MPEG2_QSV_ENCODER 0 +%define CONFIG_MPEG2_VAAPI_ENCODER 0 +%define CONFIG_MPEG4_V4L2M2M_ENCODER 0 +%define CONFIG_VP8_V4L2M2M_ENCODER 0 +%define CONFIG_VP8_VAAPI_ENCODER 0 +%define CONFIG_VP9_VAAPI_ENCODER 0 +%define CONFIG_H263_VAAPI_HWACCEL 0 +%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0 +%define CONFIG_H264_D3D11VA_HWACCEL 0 +%define CONFIG_H264_D3D11VA2_HWACCEL 0 +%define CONFIG_H264_DXVA2_HWACCEL 0 +%define CONFIG_H264_NVDEC_HWACCEL 0 +%define CONFIG_H264_VAAPI_HWACCEL 0 +%define CONFIG_H264_VDPAU_HWACCEL 0 +%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0 +%define CONFIG_HEVC_D3D11VA_HWACCEL 0 +%define CONFIG_HEVC_D3D11VA2_HWACCEL 0 +%define CONFIG_HEVC_DXVA2_HWACCEL 0 +%define CONFIG_HEVC_NVDEC_HWACCEL 0 +%define CONFIG_HEVC_VAAPI_HWACCEL 0 +%define CONFIG_HEVC_VDPAU_HWACCEL 0 +%define CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL 0 +%define CONFIG_MJPEG_NVDEC_HWACCEL 0 +%define CONFIG_MJPEG_VAAPI_HWACCEL 0 +%define CONFIG_MPEG1_NVDEC_HWACCEL 0 +%define CONFIG_MPEG1_VDPAU_HWACCEL 0 +%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 +%define CONFIG_MPEG1_XVMC_HWACCEL 0 +%define CONFIG_MPEG2_D3D11VA_HWACCEL 0 +%define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 +%define CONFIG_MPEG2_NVDEC_HWACCEL 0 +%define CONFIG_MPEG2_DXVA2_HWACCEL 0 +%define CONFIG_MPEG2_VAAPI_HWACCEL 0 +%define CONFIG_MPEG2_VDPAU_HWACCEL 0 +%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 +%define CONFIG_MPEG2_XVMC_HWACCEL 0 +%define CONFIG_MPEG4_NVDEC_HWACCEL 0 +%define CONFIG_MPEG4_VAAPI_HWACCEL 0 +%define CONFIG_MPEG4_VDPAU_HWACCEL 0 +%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0 +%define CONFIG_VC1_D3D11VA_HWACCEL 0 +%define CONFIG_VC1_D3D11VA2_HWACCEL 0 +%define CONFIG_VC1_DXVA2_HWACCEL 0 +%define CONFIG_VC1_NVDEC_HWACCEL 0 +%define CONFIG_VC1_VAAPI_HWACCEL 0 +%define CONFIG_VC1_VDPAU_HWACCEL 0 +%define CONFIG_VP8_NVDEC_HWACCEL 0 +%define CONFIG_VP8_VAAPI_HWACCEL 0 +%define CONFIG_VP9_D3D11VA_HWACCEL 0 +%define CONFIG_VP9_D3D11VA2_HWACCEL 0 +%define CONFIG_VP9_DXVA2_HWACCEL 0 +%define CONFIG_VP9_NVDEC_HWACCEL 0 +%define CONFIG_VP9_VAAPI_HWACCEL 0 +%define CONFIG_WMV3_D3D11VA_HWACCEL 0 +%define CONFIG_WMV3_D3D11VA2_HWACCEL 0 +%define CONFIG_WMV3_DXVA2_HWACCEL 0 +%define CONFIG_WMV3_NVDEC_HWACCEL 0 +%define CONFIG_WMV3_VAAPI_HWACCEL 0 +%define CONFIG_WMV3_VDPAU_HWACCEL 0 +%define CONFIG_AAC_PARSER 1 +%define CONFIG_AAC_LATM_PARSER 1 +%define CONFIG_AC3_PARSER 1 +%define CONFIG_ADX_PARSER 1 +%define CONFIG_AV1_PARSER 1 +%define CONFIG_AVS2_PARSER 1 +%define CONFIG_BMP_PARSER 1 +%define CONFIG_CAVSVIDEO_PARSER 1 +%define CONFIG_COOK_PARSER 1 +%define CONFIG_DCA_PARSER 1 +%define CONFIG_DIRAC_PARSER 1 +%define CONFIG_DNXHD_PARSER 1 +%define CONFIG_DPX_PARSER 1 +%define CONFIG_DVAUDIO_PARSER 1 +%define CONFIG_DVBSUB_PARSER 1 +%define CONFIG_DVDSUB_PARSER 1 +%define CONFIG_DVD_NAV_PARSER 1 +%define CONFIG_FLAC_PARSER 1 +%define CONFIG_G729_PARSER 1 +%define CONFIG_GSM_PARSER 1 +%define CONFIG_H261_PARSER 1 +%define CONFIG_H263_PARSER 1 +%define CONFIG_H264_PARSER 1 +%define CONFIG_HEVC_PARSER 1 +%define CONFIG_MJPEG_PARSER 1 +%define CONFIG_MLP_PARSER 1 +%define CONFIG_MPEG4VIDEO_PARSER 1 +%define CONFIG_MPEGAUDIO_PARSER 1 +%define CONFIG_MPEGVIDEO_PARSER 1 +%define CONFIG_OPUS_PARSER 1 +%define CONFIG_PNG_PARSER 1 +%define CONFIG_PNM_PARSER 1 +%define CONFIG_RV30_PARSER 1 +%define CONFIG_RV40_PARSER 1 +%define CONFIG_SBC_PARSER 1 +%define CONFIG_SIPR_PARSER 1 +%define CONFIG_TAK_PARSER 1 +%define CONFIG_VC1_PARSER 1 +%define CONFIG_VORBIS_PARSER 1 +%define CONFIG_VP3_PARSER 1 +%define CONFIG_VP8_PARSER 1 +%define CONFIG_VP9_PARSER 1 +%define CONFIG_XMA_PARSER 1 +%define CONFIG_ALSA_INDEV 0 +%define CONFIG_ANDROID_CAMERA_INDEV 0 +%define CONFIG_AVFOUNDATION_INDEV 0 +%define CONFIG_BKTR_INDEV 0 +%define CONFIG_DECKLINK_INDEV 0 +%define CONFIG_LIBNDI_NEWTEK_INDEV 0 +%define CONFIG_DSHOW_INDEV 0 +%define CONFIG_FBDEV_INDEV 0 +%define CONFIG_GDIGRAB_INDEV 0 +%define CONFIG_IEC61883_INDEV 0 +%define CONFIG_JACK_INDEV 0 +%define CONFIG_KMSGRAB_INDEV 0 +%define CONFIG_LAVFI_INDEV 0 +%define CONFIG_OPENAL_INDEV 0 +%define CONFIG_OSS_INDEV 0 +%define CONFIG_PULSE_INDEV 0 +%define CONFIG_SNDIO_INDEV 0 +%define CONFIG_V4L2_INDEV 0 +%define CONFIG_VFWCAP_INDEV 0 +%define CONFIG_XCBGRAB_INDEV 0 +%define CONFIG_LIBCDIO_INDEV 0 +%define CONFIG_LIBDC1394_INDEV 0 +%define CONFIG_ALSA_OUTDEV 0 +%define CONFIG_CACA_OUTDEV 0 +%define CONFIG_DECKLINK_OUTDEV 0 +%define CONFIG_LIBNDI_NEWTEK_OUTDEV 0 +%define CONFIG_FBDEV_OUTDEV 0 +%define CONFIG_OPENGL_OUTDEV 0 +%define CONFIG_OSS_OUTDEV 0 +%define CONFIG_PULSE_OUTDEV 0 +%define CONFIG_SDL2_OUTDEV 0 +%define CONFIG_SNDIO_OUTDEV 0 +%define CONFIG_V4L2_OUTDEV 0 +%define CONFIG_XV_OUTDEV 0 +%define CONFIG_ABENCH_FILTER 0 +%define CONFIG_ACOMPRESSOR_FILTER 0 +%define CONFIG_ACONTRAST_FILTER 0 +%define CONFIG_ACOPY_FILTER 0 +%define CONFIG_ACUE_FILTER 0 %define CONFIG_ACROSSFADE_FILTER 0 +%define CONFIG_ACROSSOVER_FILTER 0 +%define CONFIG_ACRUSHER_FILTER 0 +%define CONFIG_ADECLICK_FILTER 0 +%define CONFIG_ADECLIP_FILTER 0 %define CONFIG_ADELAY_FILTER 0 +%define CONFIG_ADERIVATIVE_FILTER 0 %define CONFIG_AECHO_FILTER 0 +%define CONFIG_AEMPHASIS_FILTER 0 %define CONFIG_AEVAL_FILTER 0 %define CONFIG_AFADE_FILTER 0 +%define CONFIG_AFFTDN_FILTER 0 +%define CONFIG_AFFTFILT_FILTER 0 +%define CONFIG_AFIR_FILTER 0 %define CONFIG_AFORMAT_FILTER 0 +%define CONFIG_AGATE_FILTER 0 +%define CONFIG_AIIR_FILTER 0 +%define CONFIG_AINTEGRAL_FILTER 0 %define CONFIG_AINTERLEAVE_FILTER 0 +%define CONFIG_ALIMITER_FILTER 0 %define CONFIG_ALLPASS_FILTER 0 +%define CONFIG_ALOOP_FILTER 0 %define CONFIG_AMERGE_FILTER 0 +%define CONFIG_AMETADATA_FILTER 0 %define CONFIG_AMIX_FILTER 0 +%define CONFIG_AMULTIPLY_FILTER 0 +%define CONFIG_ANEQUALIZER_FILTER 0 %define CONFIG_ANULL_FILTER 0 %define CONFIG_APAD_FILTER 0 %define CONFIG_APERMS_FILTER 0 %define CONFIG_APHASER_FILTER 0 +%define CONFIG_APULSATOR_FILTER 0 +%define CONFIG_AREALTIME_FILTER 0 %define CONFIG_ARESAMPLE_FILTER 0 %define CONFIG_AREVERSE_FILTER 0 %define CONFIG_ASELECT_FILTER 0 @@ -1462,10 +1590,10 @@ %define CONFIG_ASETRATE_FILTER 0 %define CONFIG_ASETTB_FILTER 0 %define CONFIG_ASHOWINFO_FILTER 0 +%define CONFIG_ASIDEDATA_FILTER 0 %define CONFIG_ASPLIT_FILTER 0 %define CONFIG_ASTATS_FILTER 0 -%define CONFIG_ASTREAMSYNC_FILTER 0 -%define CONFIG_ASYNCTS_FILTER 0 +%define CONFIG_ASTREAMSELECT_FILTER 0 %define CONFIG_ATEMPO_FILTER 0 %define CONFIG_ATRIM_FILTER 0 %define CONFIG_AZMQ_FILTER 0 @@ -1478,88 +1606,162 @@ %define CONFIG_CHANNELSPLIT_FILTER 0 %define CONFIG_CHORUS_FILTER 0 %define CONFIG_COMPAND_FILTER 0 +%define CONFIG_COMPENSATIONDELAY_FILTER 0 +%define CONFIG_CROSSFEED_FILTER 0 +%define CONFIG_CRYSTALIZER_FILTER 0 %define CONFIG_DCSHIFT_FILTER 0 +%define CONFIG_DRMETER_FILTER 0 %define CONFIG_DYNAUDNORM_FILTER 0 %define CONFIG_EARWAX_FILTER 0 %define CONFIG_EBUR128_FILTER 0 %define CONFIG_EQUALIZER_FILTER 0 +%define CONFIG_EXTRASTEREO_FILTER 0 +%define CONFIG_FIREQUALIZER_FILTER 0 %define CONFIG_FLANGER_FILTER 0 +%define CONFIG_HAAS_FILTER 0 +%define CONFIG_HDCD_FILTER 0 +%define CONFIG_HEADPHONE_FILTER 0 %define CONFIG_HIGHPASS_FILTER 0 +%define CONFIG_HIGHSHELF_FILTER 0 %define CONFIG_JOIN_FILTER 0 %define CONFIG_LADSPA_FILTER 0 +%define CONFIG_LOUDNORM_FILTER 0 %define CONFIG_LOWPASS_FILTER 0 +%define CONFIG_LOWSHELF_FILTER 0 +%define CONFIG_LV2_FILTER 0 +%define CONFIG_MCOMPAND_FILTER 0 %define CONFIG_PAN_FILTER 0 %define CONFIG_REPLAYGAIN_FILTER 0 %define CONFIG_RESAMPLE_FILTER 0 +%define CONFIG_RUBBERBAND_FILTER 0 %define CONFIG_SIDECHAINCOMPRESS_FILTER 0 +%define CONFIG_SIDECHAINGATE_FILTER 0 %define CONFIG_SILENCEDETECT_FILTER 0 %define CONFIG_SILENCEREMOVE_FILTER 0 +%define CONFIG_SOFALIZER_FILTER 0 +%define CONFIG_STEREOTOOLS_FILTER 0 +%define CONFIG_STEREOWIDEN_FILTER 0 +%define CONFIG_SUPEREQUALIZER_FILTER 0 +%define CONFIG_SURROUND_FILTER 0 %define CONFIG_TREBLE_FILTER 0 +%define CONFIG_TREMOLO_FILTER 0 +%define CONFIG_VIBRATO_FILTER 0 %define CONFIG_VOLUME_FILTER 0 %define CONFIG_VOLUMEDETECT_FILTER 0 %define CONFIG_AEVALSRC_FILTER 0 +%define CONFIG_ANOISESRC_FILTER 0 %define CONFIG_ANULLSRC_FILTER 0 %define CONFIG_FLITE_FILTER 0 +%define CONFIG_HILBERT_FILTER 0 +%define CONFIG_SINC_FILTER 0 %define CONFIG_SINE_FILTER 0 %define CONFIG_ANULLSINK_FILTER 0 %define CONFIG_ALPHAEXTRACT_FILTER 0 %define CONFIG_ALPHAMERGE_FILTER 0 +%define CONFIG_AMPLIFY_FILTER 0 %define CONFIG_ASS_FILTER 0 +%define CONFIG_ATADENOISE_FILTER 0 +%define CONFIG_AVGBLUR_FILTER 0 +%define CONFIG_AVGBLUR_OPENCL_FILTER 0 %define CONFIG_BBOX_FILTER 0 +%define CONFIG_BENCH_FILTER 0 +%define CONFIG_BITPLANENOISE_FILTER 0 %define CONFIG_BLACKDETECT_FILTER 0 %define CONFIG_BLACKFRAME_FILTER 0 %define CONFIG_BLEND_FILTER 0 +%define CONFIG_BM3D_FILTER 0 %define CONFIG_BOXBLUR_FILTER 0 +%define CONFIG_BOXBLUR_OPENCL_FILTER 0 +%define CONFIG_BWDIF_FILTER 0 +%define CONFIG_CHROMAHOLD_FILTER 0 +%define CONFIG_CHROMAKEY_FILTER 0 +%define CONFIG_CHROMASHIFT_FILTER 0 +%define CONFIG_CIESCOPE_FILTER 0 %define CONFIG_CODECVIEW_FILTER 0 %define CONFIG_COLORBALANCE_FILTER 0 %define CONFIG_COLORCHANNELMIXER_FILTER 0 %define CONFIG_COLORKEY_FILTER 0 %define CONFIG_COLORLEVELS_FILTER 0 %define CONFIG_COLORMATRIX_FILTER 0 +%define CONFIG_COLORSPACE_FILTER 0 +%define CONFIG_CONVOLUTION_FILTER 0 +%define CONFIG_CONVOLUTION_OPENCL_FILTER 0 +%define CONFIG_CONVOLVE_FILTER 0 %define CONFIG_COPY_FILTER 0 +%define CONFIG_COREIMAGE_FILTER 0 %define CONFIG_COVER_RECT_FILTER 0 %define CONFIG_CROP_FILTER 0 %define CONFIG_CROPDETECT_FILTER 0 +%define CONFIG_CUE_FILTER 0 %define CONFIG_CURVES_FILTER 0 +%define CONFIG_DATASCOPE_FILTER 0 %define CONFIG_DCTDNOIZ_FILTER 0 %define CONFIG_DEBAND_FILTER 0 +%define CONFIG_DEBLOCK_FILTER 0 %define CONFIG_DECIMATE_FILTER 0 +%define CONFIG_DECONVOLVE_FILTER 0 +%define CONFIG_DEDOT_FILTER 0 %define CONFIG_DEFLATE_FILTER 0 +%define CONFIG_DEFLICKER_FILTER 0 +%define CONFIG_DEINTERLACE_QSV_FILTER 0 +%define CONFIG_DEINTERLACE_VAAPI_FILTER 0 %define CONFIG_DEJUDDER_FILTER 0 %define CONFIG_DELOGO_FILTER 0 +%define CONFIG_DENOISE_VAAPI_FILTER 0 %define CONFIG_DESHAKE_FILTER 0 +%define CONFIG_DESPILL_FILTER 0 %define CONFIG_DETELECINE_FILTER 0 %define CONFIG_DILATION_FILTER 0 +%define CONFIG_DILATION_OPENCL_FILTER 0 +%define CONFIG_DISPLACE_FILTER 0 +%define CONFIG_DOUBLEWEAVE_FILTER 0 %define CONFIG_DRAWBOX_FILTER 0 %define CONFIG_DRAWGRAPH_FILTER 0 %define CONFIG_DRAWGRID_FILTER 0 %define CONFIG_DRAWTEXT_FILTER 0 %define CONFIG_EDGEDETECT_FILTER 0 %define CONFIG_ELBG_FILTER 0 +%define CONFIG_ENTROPY_FILTER 0 %define CONFIG_EQ_FILTER 0 %define CONFIG_EROSION_FILTER 0 +%define CONFIG_EROSION_OPENCL_FILTER 0 %define CONFIG_EXTRACTPLANES_FILTER 0 %define CONFIG_FADE_FILTER 0 +%define CONFIG_FFTDNOIZ_FILTER 0 %define CONFIG_FFTFILT_FILTER 0 %define CONFIG_FIELD_FILTER 0 +%define CONFIG_FIELDHINT_FILTER 0 %define CONFIG_FIELDMATCH_FILTER 0 %define CONFIG_FIELDORDER_FILTER 0 +%define CONFIG_FILLBORDERS_FILTER 0 %define CONFIG_FIND_RECT_FILTER 0 +%define CONFIG_FLOODFILL_FILTER 0 %define CONFIG_FORMAT_FILTER 0 %define CONFIG_FPS_FILTER 0 %define CONFIG_FRAMEPACK_FILTER 0 +%define CONFIG_FRAMERATE_FILTER 0 %define CONFIG_FRAMESTEP_FILTER 0 +%define CONFIG_FREEZEDETECT_FILTER 0 %define CONFIG_FREI0R_FILTER 0 %define CONFIG_FSPP_FILTER 0 +%define CONFIG_GBLUR_FILTER 0 %define CONFIG_GEQ_FILTER 0 %define CONFIG_GRADFUN_FILTER 0 +%define CONFIG_GRAPHMONITOR_FILTER 0 +%define CONFIG_GREYEDGE_FILTER 0 %define CONFIG_HALDCLUT_FILTER 0 %define CONFIG_HFLIP_FILTER 0 %define CONFIG_HISTEQ_FILTER 0 %define CONFIG_HISTOGRAM_FILTER 0 %define CONFIG_HQDN3D_FILTER 0 %define CONFIG_HQX_FILTER 0 +%define CONFIG_HSTACK_FILTER 0 %define CONFIG_HUE_FILTER 0 +%define CONFIG_HWDOWNLOAD_FILTER 0 +%define CONFIG_HWMAP_FILTER 0 +%define CONFIG_HWUPLOAD_FILTER 0 +%define CONFIG_HWUPLOAD_CUDA_FILTER 0 +%define CONFIG_HYSTERESIS_FILTER 0 %define CONFIG_IDET_FILTER 0 %define CONFIG_IL_FILTER 0 %define CONFIG_INFLATE_FILTER 0 @@ -1567,19 +1769,40 @@ %define CONFIG_INTERLEAVE_FILTER 0 %define CONFIG_KERNDEINT_FILTER 0 %define CONFIG_LENSCORRECTION_FILTER 0 -%define CONFIG_LUT3D_FILTER 0 +%define CONFIG_LENSFUN_FILTER 0 +%define CONFIG_LIBVMAF_FILTER 0 +%define CONFIG_LIMITER_FILTER 0 +%define CONFIG_LOOP_FILTER 0 +%define CONFIG_LUMAKEY_FILTER 0 %define CONFIG_LUT_FILTER 0 +%define CONFIG_LUT1D_FILTER 0 +%define CONFIG_LUT2_FILTER 0 +%define CONFIG_LUT3D_FILTER 0 %define CONFIG_LUTRGB_FILTER 0 %define CONFIG_LUTYUV_FILTER 0 +%define CONFIG_MASKEDCLAMP_FILTER 0 +%define CONFIG_MASKEDMERGE_FILTER 0 %define CONFIG_MCDEINT_FILTER 0 %define CONFIG_MERGEPLANES_FILTER 0 +%define CONFIG_MESTIMATE_FILTER 0 +%define CONFIG_METADATA_FILTER 0 +%define CONFIG_MIDEQUALIZER_FILTER 0 +%define CONFIG_MINTERPOLATE_FILTER 0 +%define CONFIG_MIX_FILTER 0 %define CONFIG_MPDECIMATE_FILTER 0 %define CONFIG_NEGATE_FILTER 0 +%define CONFIG_NLMEANS_FILTER 0 +%define CONFIG_NNEDI_FILTER 0 %define CONFIG_NOFORMAT_FILTER 0 %define CONFIG_NOISE_FILTER 0 +%define CONFIG_NORMALIZE_FILTER 0 %define CONFIG_NULL_FILTER 0 +%define CONFIG_OCR_FILTER 0 %define CONFIG_OCV_FILTER 0 +%define CONFIG_OSCILLOSCOPE_FILTER 0 %define CONFIG_OVERLAY_FILTER 0 +%define CONFIG_OVERLAY_OPENCL_FILTER 0 +%define CONFIG_OVERLAY_QSV_FILTER 0 %define CONFIG_OWDENOISE_FILTER 0 %define CONFIG_PAD_FILTER 0 %define CONFIG_PALETTEGEN_FILTER 0 @@ -1588,135 +1811,445 @@ %define CONFIG_PERSPECTIVE_FILTER 0 %define CONFIG_PHASE_FILTER 0 %define CONFIG_PIXDESCTEST_FILTER 0 +%define CONFIG_PIXSCOPE_FILTER 0 %define CONFIG_PP_FILTER 0 %define CONFIG_PP7_FILTER 0 +%define CONFIG_PREMULTIPLY_FILTER 0 +%define CONFIG_PREWITT_FILTER 0 +%define CONFIG_PREWITT_OPENCL_FILTER 0 +%define CONFIG_PROCAMP_VAAPI_FILTER 0 +%define CONFIG_PROGRAM_OPENCL_FILTER 0 +%define CONFIG_PSEUDOCOLOR_FILTER 0 %define CONFIG_PSNR_FILTER 0 %define CONFIG_PULLUP_FILTER 0 %define CONFIG_QP_FILTER 0 %define CONFIG_RANDOM_FILTER 0 +%define CONFIG_READEIA608_FILTER 0 +%define CONFIG_READVITC_FILTER 0 +%define CONFIG_REALTIME_FILTER 0 +%define CONFIG_REMAP_FILTER 0 %define CONFIG_REMOVEGRAIN_FILTER 0 %define CONFIG_REMOVELOGO_FILTER 0 %define CONFIG_REPEATFIELDS_FILTER 0 %define CONFIG_REVERSE_FILTER 0 +%define CONFIG_RGBASHIFT_FILTER 0 +%define CONFIG_ROBERTS_FILTER 0 +%define CONFIG_ROBERTS_OPENCL_FILTER 0 %define CONFIG_ROTATE_FILTER 0 %define CONFIG_SAB_FILTER 0 %define CONFIG_SCALE_FILTER 0 +%define CONFIG_SCALE_CUDA_FILTER 0 +%define CONFIG_SCALE_NPP_FILTER 0 +%define CONFIG_SCALE_QSV_FILTER 0 +%define CONFIG_SCALE_VAAPI_FILTER 0 +%define CONFIG_SCALE2REF_FILTER 0 %define CONFIG_SELECT_FILTER 0 +%define CONFIG_SELECTIVECOLOR_FILTER 0 %define CONFIG_SENDCMD_FILTER 0 %define CONFIG_SEPARATEFIELDS_FILTER 0 %define CONFIG_SETDAR_FILTER 0 %define CONFIG_SETFIELD_FILTER 0 +%define CONFIG_SETPARAMS_FILTER 0 %define CONFIG_SETPTS_FILTER 0 +%define CONFIG_SETRANGE_FILTER 0 %define CONFIG_SETSAR_FILTER 0 %define CONFIG_SETTB_FILTER 0 +%define CONFIG_SHARPNESS_VAAPI_FILTER 0 %define CONFIG_SHOWINFO_FILTER 0 %define CONFIG_SHOWPALETTE_FILTER 0 +%define CONFIG_SHUFFLEFRAMES_FILTER 0 %define CONFIG_SHUFFLEPLANES_FILTER 0 +%define CONFIG_SIDEDATA_FILTER 0 %define CONFIG_SIGNALSTATS_FILTER 0 +%define CONFIG_SIGNATURE_FILTER 0 %define CONFIG_SMARTBLUR_FILTER 0 +%define CONFIG_SOBEL_FILTER 0 +%define CONFIG_SOBEL_OPENCL_FILTER 0 %define CONFIG_SPLIT_FILTER 0 %define CONFIG_SPP_FILTER 0 +%define CONFIG_SR_FILTER 0 %define CONFIG_SSIM_FILTER 0 %define CONFIG_STEREO3D_FILTER 0 +%define CONFIG_STREAMSELECT_FILTER 0 %define CONFIG_SUBTITLES_FILTER 0 %define CONFIG_SUPER2XSAI_FILTER 0 +%define CONFIG_SWAPRECT_FILTER 0 %define CONFIG_SWAPUV_FILTER 0 %define CONFIG_TBLEND_FILTER 0 %define CONFIG_TELECINE_FILTER 0 +%define CONFIG_THRESHOLD_FILTER 0 %define CONFIG_THUMBNAIL_FILTER 0 +%define CONFIG_THUMBNAIL_CUDA_FILTER 0 %define CONFIG_TILE_FILTER 0 %define CONFIG_TINTERLACE_FILTER 0 +%define CONFIG_TLUT2_FILTER 0 +%define CONFIG_TMIX_FILTER 0 +%define CONFIG_TONEMAP_FILTER 0 +%define CONFIG_TONEMAP_OPENCL_FILTER 0 +%define CONFIG_TPAD_FILTER 0 %define CONFIG_TRANSPOSE_FILTER 0 +%define CONFIG_TRANSPOSE_NPP_FILTER 0 %define CONFIG_TRIM_FILTER 0 +%define CONFIG_UNPREMULTIPLY_FILTER 0 %define CONFIG_UNSHARP_FILTER 0 +%define CONFIG_UNSHARP_OPENCL_FILTER 0 %define CONFIG_USPP_FILTER 0 +%define CONFIG_VAGUEDENOISER_FILTER 0 +%define CONFIG_VECTORSCOPE_FILTER 0 %define CONFIG_VFLIP_FILTER 0 +%define CONFIG_VFRDET_FILTER 0 +%define CONFIG_VIBRANCE_FILTER 0 %define CONFIG_VIDSTABDETECT_FILTER 0 %define CONFIG_VIDSTABTRANSFORM_FILTER 0 %define CONFIG_VIGNETTE_FILTER 0 +%define CONFIG_VMAFMOTION_FILTER 0 +%define CONFIG_VPP_QSV_FILTER 0 +%define CONFIG_VSTACK_FILTER 0 %define CONFIG_W3FDIF_FILTER 0 +%define CONFIG_WAVEFORM_FILTER 0 +%define CONFIG_WEAVE_FILTER 0 %define CONFIG_XBR_FILTER 0 +%define CONFIG_XSTACK_FILTER 0 %define CONFIG_YADIF_FILTER 0 +%define CONFIG_YADIF_CUDA_FILTER 0 %define CONFIG_ZMQ_FILTER 0 %define CONFIG_ZOOMPAN_FILTER 0 +%define CONFIG_ZSCALE_FILTER 0 +%define CONFIG_ALLRGB_FILTER 0 +%define CONFIG_ALLYUV_FILTER 0 %define CONFIG_CELLAUTO_FILTER 0 %define CONFIG_COLOR_FILTER 0 +%define CONFIG_COREIMAGESRC_FILTER 0 %define CONFIG_FREI0R_SRC_FILTER 0 %define CONFIG_HALDCLUTSRC_FILTER 0 %define CONFIG_LIFE_FILTER 0 %define CONFIG_MANDELBROT_FILTER 0 %define CONFIG_MPTESTSRC_FILTER 0 %define CONFIG_NULLSRC_FILTER 0 +%define CONFIG_OPENCLSRC_FILTER 0 +%define CONFIG_PAL75BARS_FILTER 0 +%define CONFIG_PAL100BARS_FILTER 0 %define CONFIG_RGBTESTSRC_FILTER 0 %define CONFIG_SMPTEBARS_FILTER 0 %define CONFIG_SMPTEHDBARS_FILTER 0 %define CONFIG_TESTSRC_FILTER 0 +%define CONFIG_TESTSRC2_FILTER 0 +%define CONFIG_YUVTESTSRC_FILTER 0 %define CONFIG_NULLSINK_FILTER 0 +%define CONFIG_ABITSCOPE_FILTER 0 %define CONFIG_ADRAWGRAPH_FILTER 0 +%define CONFIG_AGRAPHMONITOR_FILTER 0 +%define CONFIG_AHISTOGRAM_FILTER 0 +%define CONFIG_APHASEMETER_FILTER 0 %define CONFIG_AVECTORSCOPE_FILTER 0 %define CONFIG_CONCAT_FILTER 0 %define CONFIG_SHOWCQT_FILTER 0 +%define CONFIG_SHOWFREQS_FILTER 0 %define CONFIG_SHOWSPECTRUM_FILTER 0 +%define CONFIG_SHOWSPECTRUMPIC_FILTER 0 %define CONFIG_SHOWVOLUME_FILTER 0 %define CONFIG_SHOWWAVES_FILTER 0 %define CONFIG_SHOWWAVESPIC_FILTER 0 +%define CONFIG_SPECTRUMSYNTH_FILTER 0 %define CONFIG_AMOVIE_FILTER 0 %define CONFIG_MOVIE_FILTER 0 -%define CONFIG_H263_VAAPI_HWACCEL 0 -%define CONFIG_H263_VDPAU_HWACCEL 0 -%define CONFIG_H264_D3D11VA_HWACCEL 0 -%define CONFIG_H264_DXVA2_HWACCEL 0 -%define CONFIG_H264_MMAL_HWACCEL 0 -%define CONFIG_H264_QSV_HWACCEL 0 -%define CONFIG_H264_VAAPI_HWACCEL 0 -%define CONFIG_H264_VDA_HWACCEL 0 -%define CONFIG_H264_VDA_OLD_HWACCEL 0 -%define CONFIG_H264_VDPAU_HWACCEL 0 -%define CONFIG_HEVC_D3D11VA_HWACCEL 0 -%define CONFIG_HEVC_DXVA2_HWACCEL 0 -%define CONFIG_HEVC_QSV_HWACCEL 0 -%define CONFIG_HEVC_VDPAU_HWACCEL 0 -%define CONFIG_MPEG1_XVMC_HWACCEL 0 -%define CONFIG_MPEG1_VDPAU_HWACCEL 0 -%define CONFIG_MPEG2_XVMC_HWACCEL 0 -%define CONFIG_MPEG2_D3D11VA_HWACCEL 0 -%define CONFIG_MPEG2_DXVA2_HWACCEL 0 -%define CONFIG_MPEG2_QSV_HWACCEL 0 -%define CONFIG_MPEG2_VAAPI_HWACCEL 0 -%define CONFIG_MPEG2_VDPAU_HWACCEL 0 -%define CONFIG_MPEG4_VAAPI_HWACCEL 0 -%define CONFIG_MPEG4_VDPAU_HWACCEL 0 -%define CONFIG_VC1_D3D11VA_HWACCEL 0 -%define CONFIG_VC1_DXVA2_HWACCEL 0 -%define CONFIG_VC1_VAAPI_HWACCEL 0 -%define CONFIG_VC1_VDPAU_HWACCEL 0 -%define CONFIG_VC1_QSV_HWACCEL 0 -%define CONFIG_WMV3_D3D11VA_HWACCEL 0 -%define CONFIG_WMV3_DXVA2_HWACCEL 0 -%define CONFIG_WMV3_VAAPI_HWACCEL 0 -%define CONFIG_WMV3_VDPAU_HWACCEL 0 -%define CONFIG_ALSA_INDEV 0 -%define CONFIG_AVFOUNDATION_INDEV 0 -%define CONFIG_BKTR_INDEV 0 -%define CONFIG_DECKLINK_INDEV 0 -%define CONFIG_DSHOW_INDEV 0 -%define CONFIG_DV1394_INDEV 0 -%define CONFIG_FBDEV_INDEV 0 -%define CONFIG_GDIGRAB_INDEV 0 -%define CONFIG_IEC61883_INDEV 0 -%define CONFIG_JACK_INDEV 0 -%define CONFIG_LAVFI_INDEV 0 -%define CONFIG_OPENAL_INDEV 0 -%define CONFIG_OSS_INDEV 0 -%define CONFIG_PULSE_INDEV 0 -%define CONFIG_QTKIT_INDEV 0 -%define CONFIG_SNDIO_INDEV 0 -%define CONFIG_V4L2_INDEV 0 -%define CONFIG_VFWCAP_INDEV 0 -%define CONFIG_X11GRAB_INDEV 0 -%define CONFIG_X11GRAB_XCB_INDEV 0 -%define CONFIG_LIBCDIO_INDEV 0 -%define CONFIG_LIBDC1394_INDEV 0 +%define CONFIG_AFIFO_FILTER 0 +%define CONFIG_FIFO_FILTER 0 +%define CONFIG_AA_DEMUXER 1 +%define CONFIG_AAC_DEMUXER 1 +%define CONFIG_AC3_DEMUXER 1 +%define CONFIG_ACM_DEMUXER 1 +%define CONFIG_ACT_DEMUXER 1 +%define CONFIG_ADF_DEMUXER 1 +%define CONFIG_ADP_DEMUXER 1 +%define CONFIG_ADS_DEMUXER 1 +%define CONFIG_ADX_DEMUXER 1 +%define CONFIG_AEA_DEMUXER 1 +%define CONFIG_AFC_DEMUXER 1 +%define CONFIG_AIFF_DEMUXER 1 +%define CONFIG_AIX_DEMUXER 1 +%define CONFIG_AMR_DEMUXER 1 +%define CONFIG_AMRNB_DEMUXER 1 +%define CONFIG_AMRWB_DEMUXER 1 +%define CONFIG_ANM_DEMUXER 1 +%define CONFIG_APC_DEMUXER 1 +%define CONFIG_APE_DEMUXER 1 +%define CONFIG_APNG_DEMUXER 1 +%define CONFIG_APTX_DEMUXER 1 +%define CONFIG_APTX_HD_DEMUXER 1 +%define CONFIG_AQTITLE_DEMUXER 1 +%define CONFIG_ASF_DEMUXER 1 +%define CONFIG_ASF_O_DEMUXER 1 +%define CONFIG_ASS_DEMUXER 1 +%define CONFIG_AST_DEMUXER 1 +%define CONFIG_AU_DEMUXER 1 +%define CONFIG_AVI_DEMUXER 1 +%define CONFIG_AVISYNTH_DEMUXER 0 +%define CONFIG_AVR_DEMUXER 1 +%define CONFIG_AVS_DEMUXER 1 +%define CONFIG_AVS2_DEMUXER 1 +%define CONFIG_BETHSOFTVID_DEMUXER 1 +%define CONFIG_BFI_DEMUXER 1 +%define CONFIG_BINTEXT_DEMUXER 1 +%define CONFIG_BINK_DEMUXER 1 +%define CONFIG_BIT_DEMUXER 1 +%define CONFIG_BMV_DEMUXER 1 +%define CONFIG_BFSTM_DEMUXER 1 +%define CONFIG_BRSTM_DEMUXER 1 +%define CONFIG_BOA_DEMUXER 1 +%define CONFIG_C93_DEMUXER 1 +%define CONFIG_CAF_DEMUXER 1 +%define CONFIG_CAVSVIDEO_DEMUXER 1 +%define CONFIG_CDG_DEMUXER 1 +%define CONFIG_CDXL_DEMUXER 1 +%define CONFIG_CINE_DEMUXER 1 +%define CONFIG_CODEC2_DEMUXER 1 +%define CONFIG_CODEC2RAW_DEMUXER 1 +%define CONFIG_CONCAT_DEMUXER 1 +%define CONFIG_DASH_DEMUXER 0 +%define CONFIG_DATA_DEMUXER 1 +%define CONFIG_DAUD_DEMUXER 1 +%define CONFIG_DCSTR_DEMUXER 1 +%define CONFIG_DFA_DEMUXER 1 +%define CONFIG_DIRAC_DEMUXER 1 +%define CONFIG_DNXHD_DEMUXER 1 +%define CONFIG_DSF_DEMUXER 1 +%define CONFIG_DSICIN_DEMUXER 1 +%define CONFIG_DSS_DEMUXER 1 +%define CONFIG_DTS_DEMUXER 1 +%define CONFIG_DTSHD_DEMUXER 1 +%define CONFIG_DV_DEMUXER 1 +%define CONFIG_DVBSUB_DEMUXER 1 +%define CONFIG_DVBTXT_DEMUXER 1 +%define CONFIG_DXA_DEMUXER 1 +%define CONFIG_EA_DEMUXER 1 +%define CONFIG_EA_CDATA_DEMUXER 1 +%define CONFIG_EAC3_DEMUXER 1 +%define CONFIG_EPAF_DEMUXER 1 +%define CONFIG_FFMETADATA_DEMUXER 1 +%define CONFIG_FILMSTRIP_DEMUXER 1 +%define CONFIG_FITS_DEMUXER 1 +%define CONFIG_FLAC_DEMUXER 1 +%define CONFIG_FLIC_DEMUXER 1 +%define CONFIG_FLV_DEMUXER 1 +%define CONFIG_LIVE_FLV_DEMUXER 1 +%define CONFIG_FOURXM_DEMUXER 1 +%define CONFIG_FRM_DEMUXER 1 +%define CONFIG_FSB_DEMUXER 1 +%define CONFIG_G722_DEMUXER 1 +%define CONFIG_G723_1_DEMUXER 1 +%define CONFIG_G726_DEMUXER 1 +%define CONFIG_G726LE_DEMUXER 1 +%define CONFIG_G729_DEMUXER 1 +%define CONFIG_GDV_DEMUXER 1 +%define CONFIG_GENH_DEMUXER 1 +%define CONFIG_GIF_DEMUXER 1 +%define CONFIG_GSM_DEMUXER 1 +%define CONFIG_GXF_DEMUXER 1 +%define CONFIG_H261_DEMUXER 1 +%define CONFIG_H263_DEMUXER 1 +%define CONFIG_H264_DEMUXER 1 +%define CONFIG_HEVC_DEMUXER 1 +%define CONFIG_HLS_DEMUXER 1 +%define CONFIG_HNM_DEMUXER 1 +%define CONFIG_ICO_DEMUXER 1 +%define CONFIG_IDCIN_DEMUXER 1 +%define CONFIG_IDF_DEMUXER 1 +%define CONFIG_IFF_DEMUXER 1 +%define CONFIG_ILBC_DEMUXER 1 +%define CONFIG_IMAGE2_DEMUXER 1 +%define CONFIG_IMAGE2PIPE_DEMUXER 1 +%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 1 +%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 1 +%define CONFIG_INGENIENT_DEMUXER 1 +%define CONFIG_IPMOVIE_DEMUXER 1 +%define CONFIG_IRCAM_DEMUXER 1 +%define CONFIG_ISS_DEMUXER 1 +%define CONFIG_IV8_DEMUXER 1 +%define CONFIG_IVF_DEMUXER 1 +%define CONFIG_IVR_DEMUXER 1 +%define CONFIG_JACOSUB_DEMUXER 1 +%define CONFIG_JV_DEMUXER 1 +%define CONFIG_LMLM4_DEMUXER 1 +%define CONFIG_LOAS_DEMUXER 1 +%define CONFIG_LRC_DEMUXER 1 +%define CONFIG_LVF_DEMUXER 1 +%define CONFIG_LXF_DEMUXER 1 +%define CONFIG_M4V_DEMUXER 1 +%define CONFIG_MATROSKA_DEMUXER 1 +%define CONFIG_MGSTS_DEMUXER 1 +%define CONFIG_MICRODVD_DEMUXER 1 +%define CONFIG_MJPEG_DEMUXER 1 +%define CONFIG_MJPEG_2000_DEMUXER 1 +%define CONFIG_MLP_DEMUXER 1 +%define CONFIG_MLV_DEMUXER 1 +%define CONFIG_MM_DEMUXER 1 +%define CONFIG_MMF_DEMUXER 1 +%define CONFIG_MOV_DEMUXER 1 +%define CONFIG_MP3_DEMUXER 1 +%define CONFIG_MPC_DEMUXER 1 +%define CONFIG_MPC8_DEMUXER 1 +%define CONFIG_MPEGPS_DEMUXER 1 +%define CONFIG_MPEGTS_DEMUXER 1 +%define CONFIG_MPEGTSRAW_DEMUXER 1 +%define CONFIG_MPEGVIDEO_DEMUXER 1 +%define CONFIG_MPJPEG_DEMUXER 1 +%define CONFIG_MPL2_DEMUXER 1 +%define CONFIG_MPSUB_DEMUXER 1 +%define CONFIG_MSF_DEMUXER 1 +%define CONFIG_MSNWC_TCP_DEMUXER 1 +%define CONFIG_MTAF_DEMUXER 1 +%define CONFIG_MTV_DEMUXER 1 +%define CONFIG_MUSX_DEMUXER 1 +%define CONFIG_MV_DEMUXER 1 +%define CONFIG_MVI_DEMUXER 1 +%define CONFIG_MXF_DEMUXER 1 +%define CONFIG_MXG_DEMUXER 1 +%define CONFIG_NC_DEMUXER 1 +%define CONFIG_NISTSPHERE_DEMUXER 1 +%define CONFIG_NSP_DEMUXER 1 +%define CONFIG_NSV_DEMUXER 1 +%define CONFIG_NUT_DEMUXER 1 +%define CONFIG_NUV_DEMUXER 1 +%define CONFIG_OGG_DEMUXER 1 +%define CONFIG_OMA_DEMUXER 1 +%define CONFIG_PAF_DEMUXER 1 +%define CONFIG_PCM_ALAW_DEMUXER 1 +%define CONFIG_PCM_MULAW_DEMUXER 1 +%define CONFIG_PCM_VIDC_DEMUXER 1 +%define CONFIG_PCM_F64BE_DEMUXER 1 +%define CONFIG_PCM_F64LE_DEMUXER 1 +%define CONFIG_PCM_F32BE_DEMUXER 1 +%define CONFIG_PCM_F32LE_DEMUXER 1 +%define CONFIG_PCM_S32BE_DEMUXER 1 +%define CONFIG_PCM_S32LE_DEMUXER 1 +%define CONFIG_PCM_S24BE_DEMUXER 1 +%define CONFIG_PCM_S24LE_DEMUXER 1 +%define CONFIG_PCM_S16BE_DEMUXER 1 +%define CONFIG_PCM_S16LE_DEMUXER 1 +%define CONFIG_PCM_S8_DEMUXER 1 +%define CONFIG_PCM_U32BE_DEMUXER 1 +%define CONFIG_PCM_U32LE_DEMUXER 1 +%define CONFIG_PCM_U24BE_DEMUXER 1 +%define CONFIG_PCM_U24LE_DEMUXER 1 +%define CONFIG_PCM_U16BE_DEMUXER 1 +%define CONFIG_PCM_U16LE_DEMUXER 1 +%define CONFIG_PCM_U8_DEMUXER 1 +%define CONFIG_PJS_DEMUXER 1 +%define CONFIG_PMP_DEMUXER 1 +%define CONFIG_PVA_DEMUXER 1 +%define CONFIG_PVF_DEMUXER 1 +%define CONFIG_QCP_DEMUXER 1 +%define CONFIG_R3D_DEMUXER 1 +%define CONFIG_RAWVIDEO_DEMUXER 1 +%define CONFIG_REALTEXT_DEMUXER 1 +%define CONFIG_REDSPARK_DEMUXER 1 +%define CONFIG_RL2_DEMUXER 1 +%define CONFIG_RM_DEMUXER 1 +%define CONFIG_ROQ_DEMUXER 1 +%define CONFIG_RPL_DEMUXER 1 +%define CONFIG_RSD_DEMUXER 1 +%define CONFIG_RSO_DEMUXER 1 +%define CONFIG_RTP_DEMUXER 0 +%define CONFIG_RTSP_DEMUXER 0 +%define CONFIG_S337M_DEMUXER 1 +%define CONFIG_SAMI_DEMUXER 1 +%define CONFIG_SAP_DEMUXER 0 +%define CONFIG_SBC_DEMUXER 1 +%define CONFIG_SBG_DEMUXER 1 +%define CONFIG_SCC_DEMUXER 1 +%define CONFIG_SDP_DEMUXER 0 +%define CONFIG_SDR2_DEMUXER 1 +%define CONFIG_SDS_DEMUXER 1 +%define CONFIG_SDX_DEMUXER 1 +%define CONFIG_SEGAFILM_DEMUXER 1 +%define CONFIG_SER_DEMUXER 1 +%define CONFIG_SHORTEN_DEMUXER 1 +%define CONFIG_SIFF_DEMUXER 1 +%define CONFIG_SLN_DEMUXER 1 +%define CONFIG_SMACKER_DEMUXER 1 +%define CONFIG_SMJPEG_DEMUXER 1 +%define CONFIG_SMUSH_DEMUXER 1 +%define CONFIG_SOL_DEMUXER 1 +%define CONFIG_SOX_DEMUXER 1 +%define CONFIG_SPDIF_DEMUXER 1 +%define CONFIG_SRT_DEMUXER 1 +%define CONFIG_STR_DEMUXER 1 +%define CONFIG_STL_DEMUXER 1 +%define CONFIG_SUBVIEWER1_DEMUXER 1 +%define CONFIG_SUBVIEWER_DEMUXER 1 +%define CONFIG_SUP_DEMUXER 1 +%define CONFIG_SVAG_DEMUXER 1 +%define CONFIG_SWF_DEMUXER 1 +%define CONFIG_TAK_DEMUXER 1 +%define CONFIG_TEDCAPTIONS_DEMUXER 1 +%define CONFIG_THP_DEMUXER 1 +%define CONFIG_THREEDOSTR_DEMUXER 1 +%define CONFIG_TIERTEXSEQ_DEMUXER 1 +%define CONFIG_TMV_DEMUXER 1 +%define CONFIG_TRUEHD_DEMUXER 1 +%define CONFIG_TTA_DEMUXER 1 +%define CONFIG_TXD_DEMUXER 1 +%define CONFIG_TTY_DEMUXER 1 +%define CONFIG_TY_DEMUXER 1 +%define CONFIG_V210_DEMUXER 1 +%define CONFIG_V210X_DEMUXER 1 +%define CONFIG_VAG_DEMUXER 1 +%define CONFIG_VC1_DEMUXER 1 +%define CONFIG_VC1T_DEMUXER 1 +%define CONFIG_VIVO_DEMUXER 1 +%define CONFIG_VMD_DEMUXER 1 +%define CONFIG_VOBSUB_DEMUXER 1 +%define CONFIG_VOC_DEMUXER 1 +%define CONFIG_VPK_DEMUXER 1 +%define CONFIG_VPLAYER_DEMUXER 1 +%define CONFIG_VQF_DEMUXER 1 +%define CONFIG_W64_DEMUXER 1 +%define CONFIG_WAV_DEMUXER 1 +%define CONFIG_WC3_DEMUXER 1 +%define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 1 +%define CONFIG_WEBVTT_DEMUXER 1 +%define CONFIG_WSAUD_DEMUXER 1 +%define CONFIG_WSD_DEMUXER 1 +%define CONFIG_WSVQA_DEMUXER 1 +%define CONFIG_WTV_DEMUXER 1 +%define CONFIG_WVE_DEMUXER 1 +%define CONFIG_WV_DEMUXER 1 +%define CONFIG_XA_DEMUXER 1 +%define CONFIG_XBIN_DEMUXER 1 +%define CONFIG_XMV_DEMUXER 1 +%define CONFIG_XVAG_DEMUXER 1 +%define CONFIG_XWMA_DEMUXER 1 +%define CONFIG_YOP_DEMUXER 1 +%define CONFIG_YUV4MPEGPIPE_DEMUXER 1 +%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PAM_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PBM_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PCX_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PGM_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PNG_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PPM_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PSD_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_SGI_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_SVG_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_XPM_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_XWD_PIPE_DEMUXER 1 +%define CONFIG_LIBGME_DEMUXER 0 +%define CONFIG_LIBMODPLUG_DEMUXER 0 +%define CONFIG_LIBOPENMPT_DEMUXER 0 +%define CONFIG_VAPOURSYNTH_DEMUXER 0 %define CONFIG_A64_MUXER 0 %define CONFIG_AC3_MUXER 0 %define CONFIG_ADTS_MUXER 0 @@ -1724,6 +2257,8 @@ %define CONFIG_AIFF_MUXER 0 %define CONFIG_AMR_MUXER 0 %define CONFIG_APNG_MUXER 0 +%define CONFIG_APTX_MUXER 0 +%define CONFIG_APTX_HD_MUXER 0 %define CONFIG_ASF_MUXER 0 %define CONFIG_ASS_MUXER 0 %define CONFIG_AST_MUXER 0 @@ -1731,9 +2266,12 @@ %define CONFIG_AU_MUXER 0 %define CONFIG_AVI_MUXER 0 %define CONFIG_AVM2_MUXER 0 +%define CONFIG_AVS2_MUXER 0 %define CONFIG_BIT_MUXER 0 %define CONFIG_CAF_MUXER 0 %define CONFIG_CAVSVIDEO_MUXER 0 +%define CONFIG_CODEC2_MUXER 0 +%define CONFIG_CODEC2RAW_MUXER 0 %define CONFIG_CRC_MUXER 0 %define CONFIG_DASH_MUXER 0 %define CONFIG_DATA_MUXER 0 @@ -1744,20 +2282,27 @@ %define CONFIG_DV_MUXER 0 %define CONFIG_EAC3_MUXER 0 %define CONFIG_F4V_MUXER 0 -%define CONFIG_FFM_MUXER 0 %define CONFIG_FFMETADATA_MUXER 0 +%define CONFIG_FIFO_MUXER 0 +%define CONFIG_FIFO_TEST_MUXER 0 %define CONFIG_FILMSTRIP_MUXER 0 +%define CONFIG_FITS_MUXER 0 %define CONFIG_FLAC_MUXER 0 %define CONFIG_FLV_MUXER 0 %define CONFIG_FRAMECRC_MUXER 0 +%define CONFIG_FRAMEHASH_MUXER 0 %define CONFIG_FRAMEMD5_MUXER 0 %define CONFIG_G722_MUXER 0 %define CONFIG_G723_1_MUXER 0 +%define CONFIG_G726_MUXER 0 +%define CONFIG_G726LE_MUXER 0 %define CONFIG_GIF_MUXER 0 +%define CONFIG_GSM_MUXER 0 %define CONFIG_GXF_MUXER 0 %define CONFIG_H261_MUXER 0 %define CONFIG_H263_MUXER 0 %define CONFIG_H264_MUXER 0 +%define CONFIG_HASH_MUXER 0 %define CONFIG_HDS_MUXER 0 %define CONFIG_HEVC_MUXER 0 %define CONFIG_HLS_MUXER 0 @@ -1800,10 +2345,12 @@ %define CONFIG_NUT_MUXER 0 %define CONFIG_OGA_MUXER 0 %define CONFIG_OGG_MUXER 0 +%define CONFIG_OGV_MUXER 0 %define CONFIG_OMA_MUXER 0 %define CONFIG_OPUS_MUXER 0 %define CONFIG_PCM_ALAW_MUXER 0 %define CONFIG_PCM_MULAW_MUXER 0 +%define CONFIG_PCM_VIDC_MUXER 0 %define CONFIG_PCM_F64BE_MUXER 0 %define CONFIG_PCM_F64LE_MUXER 0 %define CONFIG_PCM_F32BE_MUXER 0 @@ -1831,6 +2378,9 @@ %define CONFIG_RTP_MPEGTS_MUXER 0 %define CONFIG_RTSP_MUXER 0 %define CONFIG_SAP_MUXER 0 +%define CONFIG_SBC_MUXER 0 +%define CONFIG_SCC_MUXER 0 +%define CONFIG_SEGAFILM_MUXER 0 %define CONFIG_SEGMENT_MUXER 0 %define CONFIG_STREAM_SEGMENT_MUXER 0 %define CONFIG_SINGLEJPEG_MUXER 0 @@ -1840,12 +2390,14 @@ %define CONFIG_SPX_MUXER 0 %define CONFIG_SPDIF_MUXER 0 %define CONFIG_SRT_MUXER 0 +%define CONFIG_SUP_MUXER 0 %define CONFIG_SWF_MUXER 0 %define CONFIG_TEE_MUXER 0 %define CONFIG_TG2_MUXER 0 %define CONFIG_TGP_MUXER 0 %define CONFIG_MKVTIMESTAMP_V2_MUXER 0 %define CONFIG_TRUEHD_MUXER 0 +%define CONFIG_TTA_MUXER 0 %define CONFIG_UNCODEDFRAMECRC_MUXER 0 %define CONFIG_VC1_MUXER 0 %define CONFIG_VC1T_MUXER 0 @@ -1860,55 +2412,8 @@ %define CONFIG_WTV_MUXER 0 %define CONFIG_WV_MUXER 0 %define CONFIG_YUV4MPEGPIPE_MUXER 0 -%define CONFIG_LIBNUT_MUXER 0 -%define CONFIG_ALSA_OUTDEV 0 -%define CONFIG_CACA_OUTDEV 0 -%define CONFIG_DECKLINK_OUTDEV 0 -%define CONFIG_FBDEV_OUTDEV 0 -%define CONFIG_OPENGL_OUTDEV 0 -%define CONFIG_OSS_OUTDEV 0 -%define CONFIG_PULSE_OUTDEV 0 -%define CONFIG_SDL_OUTDEV 0 -%define CONFIG_SNDIO_OUTDEV 0 -%define CONFIG_V4L2_OUTDEV 0 -%define CONFIG_XV_OUTDEV 0 -%define CONFIG_AAC_PARSER 1 -%define CONFIG_AAC_LATM_PARSER 1 -%define CONFIG_AC3_PARSER 1 -%define CONFIG_ADX_PARSER 1 -%define CONFIG_BMP_PARSER 1 -%define CONFIG_CAVSVIDEO_PARSER 1 -%define CONFIG_COOK_PARSER 1 -%define CONFIG_DCA_PARSER 1 -%define CONFIG_DIRAC_PARSER 1 -%define CONFIG_DNXHD_PARSER 1 -%define CONFIG_DPX_PARSER 1 -%define CONFIG_DVBSUB_PARSER 1 -%define CONFIG_DVDSUB_PARSER 1 -%define CONFIG_DVD_NAV_PARSER 1 -%define CONFIG_FLAC_PARSER 1 -%define CONFIG_GSM_PARSER 1 -%define CONFIG_H261_PARSER 1 -%define CONFIG_H263_PARSER 1 -%define CONFIG_H264_PARSER 1 -%define CONFIG_HEVC_PARSER 1 -%define CONFIG_MJPEG_PARSER 1 -%define CONFIG_MLP_PARSER 1 -%define CONFIG_MPEG4VIDEO_PARSER 1 -%define CONFIG_MPEGAUDIO_PARSER 1 -%define CONFIG_MPEGVIDEO_PARSER 1 -%define CONFIG_OPUS_PARSER 1 -%define CONFIG_PNG_PARSER 1 -%define CONFIG_PNM_PARSER 1 -%define CONFIG_RV30_PARSER 1 -%define CONFIG_RV40_PARSER 1 -%define CONFIG_TAK_PARSER 1 -%define CONFIG_VC1_PARSER 1 -%define CONFIG_VORBIS_PARSER 1 -%define CONFIG_VP3_PARSER 1 -%define CONFIG_VP8_PARSER 1 -%define CONFIG_VP9_PARSER 1 -%define CONFIG_ASYNC_PROTOCOL 0 +%define CONFIG_CHROMAPRINT_MUXER 0 +%define CONFIG_ASYNC_PROTOCOL 1 %define CONFIG_BLURAY_PROTOCOL 0 %define CONFIG_CACHE_PROTOCOL 1 %define CONFIG_CONCAT_PROTOCOL 1 @@ -1928,6 +2433,7 @@ %define CONFIG_MMST_PROTOCOL 0 %define CONFIG_MD5_PROTOCOL 1 %define CONFIG_PIPE_PROTOCOL 1 +%define CONFIG_PROMPEG_PROTOCOL 1 %define CONFIG_RTMP_PROTOCOL 0 %define CONFIG_RTMPE_PROTOCOL 0 %define CONFIG_RTMPS_PROTOCOL 0 @@ -1938,10 +2444,9 @@ %define CONFIG_SCTP_PROTOCOL 0 %define CONFIG_SRTP_PROTOCOL 0 %define CONFIG_SUBFILE_PROTOCOL 1 +%define CONFIG_TEE_PROTOCOL 1 %define CONFIG_TCP_PROTOCOL 0 -%define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0 -%define CONFIG_TLS_GNUTLS_PROTOCOL 0 -%define CONFIG_TLS_OPENSSL_PROTOCOL 0 +%define CONFIG_TLS_PROTOCOL 0 %define CONFIG_UDP_PROTOCOL 0 %define CONFIG_UDPLITE_PROTOCOL 0 %define CONFIG_UNIX_PROTOCOL 0 @@ -1950,5 +2455,6 @@ %define CONFIG_LIBRTMPS_PROTOCOL 0 %define CONFIG_LIBRTMPT_PROTOCOL 0 %define CONFIG_LIBRTMPTE_PROTOCOL 0 +%define CONFIG_LIBSRT_PROTOCOL 0 %define CONFIG_LIBSSH_PROTOCOL 0 %define CONFIG_LIBSMBCLIENT_PROTOCOL 0 diff --git a/build/ffmpeg/config-x64.h b/build/ffmpeg/config-x64.h old mode 100644 new mode 100755 index 921478eb0..2cd55a896 --- a/build/ffmpeg/config-x64.h +++ b/build/ffmpeg/config-x64.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -#define FFMPEG_CONFIGURATION "--disable-avfilter --disable-avresample --disable-bzlib --disable-d3d11va --disable-dxva2 --disable-decoder='atrac3p,indeo2,indeo3,indeo4,indeo5,twinvq' --disable-devices --disable-doc --disable-encoders --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-filters --disable-hwaccels --disable-muxers --disable-network --disable-postproc --disable-pthreads --disable-shared --enable-gpl --enable-runtime-cpudetect --enable-static --enable-zlib --extra-cflags=-D_SYSCRT --extra-cflags=-I../../include --extra-cflags=-MD --extra-cflags=-wd4005 --extra-cflags=-wd4189 --extra-ldflags='-LIBPATH:../../lib/x64/Release' --toolchain=msvc" +#define FFMPEG_CONFIGURATION "--disable-avfilter --disable-avresample --disable-bzlib --disable-d3d11va --disable-dxva2 --disable-decoder='atrac3p,indeo2,indeo3,indeo4,indeo5,twinvq' --disable-devices --disable-doc --disable-encoders --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-filters --disable-hwaccels --disable-muxers --disable-network --disable-postproc --disable-pthreads --disable-shared --enable-gpl --enable-runtime-cpudetect --enable-static --enable-small --enable-x86asm --x86asmexe=yasm --enable-zlib --extra-cflags=-D_SYSCRT --extra-cflags=-I../../include --extra-cflags=-MD --extra-cflags=-wd4005 --extra-cflags=-wd4189 --extra-ldflags='-LIBPATH:../../lib/x64/Release' --toolchain=msvc" #define FFMPEG_LICENSE "GPL version 2 or later" -#define CONFIG_THIS_YEAR 2015 +#define CONFIG_THIS_YEAR 2018 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x64" +#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26132 for x64" #define av_restrict __restrict #define EXTERN_PREFIX "" #define EXTERN_ASM @@ -52,10 +52,12 @@ #define HAVE_POWER8 0 #define HAVE_PPC4XX 0 #define HAVE_VSX 0 +#define HAVE_AESNI 1 #define HAVE_AMD3DNOW 1 #define HAVE_AMD3DNOWEXT 1 #define HAVE_AVX 1 #define HAVE_AVX2 1 +#define HAVE_AVX512 1 #define HAVE_FMA3 1 #define HAVE_FMA4 1 #define HAVE_MMX 1 @@ -72,12 +74,14 @@ #define HAVE_MIPSFPU 0 #define HAVE_MIPS32R2 0 #define HAVE_MIPS32R5 0 +#define HAVE_MIPS64R2 0 +#define HAVE_MIPS32R6 0 #define HAVE_MIPS64R6 0 -#define HAVE_MIPSDSPR1 0 +#define HAVE_MIPSDSP 0 #define HAVE_MIPSDSPR2 0 #define HAVE_MSA 0 -#define HAVE_LOONGSON2 1 -#define HAVE_LOONGSON3 1 +#define HAVE_LOONGSON2 0 +#define HAVE_LOONGSON3 0 #define HAVE_MMI 0 #define HAVE_ARMV5TE_EXTERNAL 0 #define HAVE_ARMV6_EXTERNAL 0 @@ -93,10 +97,12 @@ #define HAVE_POWER8_EXTERNAL 0 #define HAVE_PPC4XX_EXTERNAL 0 #define HAVE_VSX_EXTERNAL 0 +#define HAVE_AESNI_EXTERNAL 1 #define HAVE_AMD3DNOW_EXTERNAL 1 #define HAVE_AMD3DNOWEXT_EXTERNAL 1 #define HAVE_AVX_EXTERNAL 1 #define HAVE_AVX2_EXTERNAL 0 +#define HAVE_AVX512_EXTERNAL 0 #define HAVE_FMA3_EXTERNAL 1 #define HAVE_FMA4_EXTERNAL 1 #define HAVE_MMX_EXTERNAL 1 @@ -113,8 +119,10 @@ #define HAVE_MIPSFPU_EXTERNAL 0 #define HAVE_MIPS32R2_EXTERNAL 0 #define HAVE_MIPS32R5_EXTERNAL 0 +#define HAVE_MIPS64R2_EXTERNAL 0 +#define HAVE_MIPS32R6_EXTERNAL 0 #define HAVE_MIPS64R6_EXTERNAL 0 -#define HAVE_MIPSDSPR1_EXTERNAL 0 +#define HAVE_MIPSDSP_EXTERNAL 0 #define HAVE_MIPSDSPR2_EXTERNAL 0 #define HAVE_MSA_EXTERNAL 0 #define HAVE_LOONGSON2_EXTERNAL 0 @@ -134,10 +142,12 @@ #define HAVE_POWER8_INLINE 0 #define HAVE_PPC4XX_INLINE 0 #define HAVE_VSX_INLINE 0 +#define HAVE_AESNI_INLINE 0 #define HAVE_AMD3DNOW_INLINE 0 #define HAVE_AMD3DNOWEXT_INLINE 0 #define HAVE_AVX_INLINE 0 #define HAVE_AVX2_INLINE 0 +#define HAVE_AVX512_INLINE 0 #define HAVE_FMA3_INLINE 0 #define HAVE_FMA4_INLINE 0 #define HAVE_MMX_INLINE 0 @@ -154,8 +164,10 @@ #define HAVE_MIPSFPU_INLINE 0 #define HAVE_MIPS32R2_INLINE 0 #define HAVE_MIPS32R5_INLINE 0 +#define HAVE_MIPS64R2_INLINE 0 +#define HAVE_MIPS32R6_INLINE 0 #define HAVE_MIPS64R6_INLINE 0 -#define HAVE_MIPSDSPR1_INLINE 0 +#define HAVE_MIPSDSP_INLINE 0 #define HAVE_MIPSDSPR2_INLINE 0 #define HAVE_MSA_INLINE 0 #define HAVE_LOONGSON2_INLINE 0 @@ -165,55 +177,49 @@ #define HAVE_FAST_64BIT 1 #define HAVE_FAST_CLZ 1 #define HAVE_FAST_CMOV 1 -#define HAVE_LOCAL_ALIGNED_8 1 -#define HAVE_LOCAL_ALIGNED_16 1 -#define HAVE_LOCAL_ALIGNED_32 1 +#define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 -#define HAVE_ATOMICS_GCC 0 -#define HAVE_ATOMICS_SUNCC 0 -#define HAVE_ATOMICS_WIN32 1 +#define HAVE_SIMD_ALIGN_32 1 +#define HAVE_SIMD_ALIGN_64 1 #define HAVE_ATOMIC_CAS_PTR 0 -#define HAVE_ATOMIC_COMPARE_EXCHANGE 0 #define HAVE_MACHINE_RW_BARRIER 0 #define HAVE_MEMORYBARRIER 1 #define HAVE_MM_EMPTY 0 #define HAVE_RDTSC 1 -#define HAVE_SARESTART 0 +#define HAVE_SEM_TIMEDWAIT 0 #define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0 +#define HAVE_CABS 0 +#define HAVE_CEXP 0 #define HAVE_INLINE_ASM 0 #define HAVE_SYMVER 0 -#define HAVE_YASM 1 +#define HAVE_X86ASM 1 #define HAVE_BIGENDIAN 0 #define HAVE_FAST_UNALIGNED 1 -#define HAVE_INCOMPATIBLE_LIBAV_ABI 0 -#define HAVE_ALSA_ASOUNDLIB_H 0 -#define HAVE_ALTIVEC_H 0 #define HAVE_ARPA_INET_H 0 #define HAVE_ASM_TYPES_H 0 #define HAVE_CDIO_PARANOIA_H 0 #define HAVE_CDIO_PARANOIA_PARANOIA_H 0 +#define HAVE_CUDA_H 0 +#define HAVE_DISPATCH_DISPATCH_H 0 #define HAVE_DEV_BKTR_IOCTL_BT848_H 0 #define HAVE_DEV_BKTR_IOCTL_METEOR_H 0 #define HAVE_DEV_IC_BT8XX_H 0 #define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0 #define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0 #define HAVE_DIRECT_H 1 -#define HAVE_DLFCN_H 0 -#define HAVE_D3D11_H 1 +#define HAVE_DIRENT_H 0 +#define HAVE_DXGIDEBUG_H 1 #define HAVE_DXVA_H 1 #define HAVE_ES2_GL_H 0 #define HAVE_GSM_H 0 #define HAVE_IO_H 1 -#define HAVE_MACH_MACH_TIME_H 0 +#define HAVE_LINUX_PERF_EVENT_H 0 #define HAVE_MACHINE_IOCTL_BT848_H 0 #define HAVE_MACHINE_IOCTL_METEOR_H 0 #define HAVE_MALLOC_H 1 -#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0 +#define HAVE_OPENCV2_CORE_CORE_C_H 0 #define HAVE_OPENGL_GL3_H 0 #define HAVE_POLL_H 0 -#define HAVE_SNDIO_H 0 -#define HAVE_SOUNDCARD_H 0 -#define HAVE_SYS_MMAN_H 0 #define HAVE_SYS_PARAM_H 0 #define HAVE_SYS_RESOURCE_H 0 #define HAVE_SYS_SELECT_H 0 @@ -238,6 +244,8 @@ #define HAVE_EXP2 1 #define HAVE_EXP2F 1 #define HAVE_EXPF 1 +#define HAVE_HYPOT 1 +#define HAVE_ISFINITE 1 #define HAVE_ISINF 1 #define HAVE_ISNAN 1 #define HAVE_LDEXPF 1 @@ -255,17 +263,20 @@ #define HAVE_SINF 1 #define HAVE_TRUNC 1 #define HAVE_TRUNCF 1 +#define HAVE_DOS_PATHS 1 +#define HAVE_LIBC_MSVCRT 1 +#define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0 +#define HAVE_SECTION_DATA_REL_RO 0 +#define HAVE_THREADS 1 +#define HAVE_UWP 0 +#define HAVE_WINRT 0 #define HAVE_ACCESS 1 #define HAVE_ALIGNED_MALLOC 1 +#define HAVE_ARC4RANDOM 0 #define HAVE_CLOCK_GETTIME 0 #define HAVE_CLOSESOCKET 0 #define HAVE_COMMANDLINETOARGVW 1 -#define HAVE_COTASKMEMFREE 1 -#define HAVE_CRYPTGENRANDOM 1 -#define HAVE_DLOPEN 0 #define HAVE_FCNTL 0 -#define HAVE_FLT_LIM 1 -#define HAVE_FORK 0 #define HAVE_GETADDRINFO 0 #define HAVE_GETHRTIME 0 #define HAVE_GETOPT 0 @@ -273,7 +284,6 @@ #define HAVE_GETPROCESSMEMORYINFO 1 #define HAVE_GETPROCESSTIMES 1 #define HAVE_GETRUSAGE 0 -#define HAVE_GETSERVBYPORT 0 #define HAVE_GETSYSTEMTIMEASFILETIME 1 #define HAVE_GETTIMEOFDAY 0 #define HAVE_GLOB 0 @@ -281,9 +291,9 @@ #define HAVE_GMTIME_R 0 #define HAVE_INET_ATON 0 #define HAVE_ISATTY 1 -#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0 #define HAVE_KBHIT 1 #define HAVE_LOCALTIME_R 0 +#define HAVE_LSTAT 0 #define HAVE_LZO1X_999_COMPRESS 0 #define HAVE_MACH_ABSOLUTE_TIME 0 #define HAVE_MAPVIEWOFFILE 1 @@ -296,6 +306,7 @@ #define HAVE_POSIX_MEMALIGN 0 #define HAVE_PTHREAD_CANCEL 0 #define HAVE_SCHED_GETAFFINITY 0 +#define HAVE_SECITEMIMPORT 0 #define HAVE_SETCONSOLETEXTATTRIBUTE 1 #define HAVE_SETCONSOLECTRLHANDLER 1 #define HAVE_SETMODE 1 @@ -305,25 +316,31 @@ #define HAVE_SYSCONF 0 #define HAVE_SYSCTL 0 #define HAVE_USLEEP 0 +#define HAVE_UTGETOSTYPEFROMSTRING 0 #define HAVE_VIRTUALALLOC 1 #define HAVE_WGLGETPROCADDRESS 0 +#define HAVE_BCRYPT 1 +#define HAVE_VAAPI_DRM 0 +#define HAVE_VAAPI_X11 0 +#define HAVE_VDPAU_X11 0 #define HAVE_PTHREADS 0 #define HAVE_OS2THREADS 0 #define HAVE_W32THREADS 1 +#define HAVE_AS_ARCH_DIRECTIVE 0 #define HAVE_AS_DN_DIRECTIVE 0 +#define HAVE_AS_FPU_DIRECTIVE 0 #define HAVE_AS_FUNC 0 #define HAVE_AS_OBJECT_ARCH 0 #define HAVE_ASM_MOD_Q 0 -#define HAVE_ATTRIBUTE_MAY_ALIAS 0 -#define HAVE_ATTRIBUTE_PACKED 0 +#define HAVE_BLOCKS_EXTENSION 0 #define HAVE_EBP_AVAILABLE 0 #define HAVE_EBX_AVAILABLE 0 #define HAVE_GNU_AS 0 #define HAVE_GNU_WINDRES 0 #define HAVE_IBM_ASM 0 +#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0 #define HAVE_INLINE_ASM_LABELS 0 #define HAVE_INLINE_ASM_NONLOCAL_LABELS 0 -#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0 #define HAVE_PRAGMA_DEPRECATED 1 #define HAVE_RSYNC_CONTIMEOUT 0 #define HAVE_SYMVER_ASM_LABEL 0 @@ -331,13 +348,13 @@ #define HAVE_VFP_ARGS 0 #define HAVE_XFORM_ASM 0 #define HAVE_XMM_CLOBBERS 0 -#define HAVE_CONDITION_VARIABLE_PTR 1 +#define HAVE_KCMVIDEOCODECTYPE_HEVC 0 #define HAVE_SOCKLEN_T 0 #define HAVE_STRUCT_ADDRINFO 0 -#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0 #define HAVE_STRUCT_GROUP_SOURCE_REQ 0 #define HAVE_STRUCT_IP_MREQ_SOURCE 0 #define HAVE_STRUCT_IPV6_MREQ 0 +#define HAVE_STRUCT_MSGHDR_MSG_FLAGS 0 #define HAVE_STRUCT_POLLFD 0 #define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0 #define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0 @@ -346,48 +363,35 @@ #define HAVE_STRUCT_SOCKADDR_STORAGE 0 #define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0 #define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0 -#define HAVE_ATOMICS_NATIVE 1 -#define HAVE_DOS_PATHS 1 -#define HAVE_DXVA2API_COBJ 1 -#define HAVE_DXVA2_LIB 0 -#define HAVE_LIBC_MSVCRT 1 -#define HAVE_LIBDC1394_1 0 -#define HAVE_LIBDC1394_2 0 #define HAVE_MAKEINFO 1 #define HAVE_MAKEINFO_HTML 0 +#define HAVE_OPENCL_D3D11 0 +#define HAVE_OPENCL_DRM_ARM 0 +#define HAVE_OPENCL_DRM_BEIGNET 0 +#define HAVE_OPENCL_DXVA2 0 +#define HAVE_OPENCL_VAAPI_BEIGNET 0 +#define HAVE_OPENCL_VAAPI_INTEL_MEDIA 0 #define HAVE_PERL 1 #define HAVE_POD2MAN 0 -#define HAVE_SDL 0 -#define HAVE_SECTION_DATA_REL_RO 0 #define HAVE_TEXI2HTML 0 -#define HAVE_THREADS 1 -#define HAVE_VAAPI_X11 0 -#define HAVE_VDPAU_X11 0 -#define HAVE_XLIB 0 -#define CONFIG_BSFS 1 -#define CONFIG_DECODERS 1 -#define CONFIG_DEMUXERS 1 -#define CONFIG_ENCODERS 0 -#define CONFIG_FILTERS 0 -#define CONFIG_HWACCELS 0 -#define CONFIG_INDEVS 0 -#define CONFIG_MUXERS 0 -#define CONFIG_OUTDEVS 0 -#define CONFIG_PARSERS 1 -#define CONFIG_PROTOCOLS 1 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 #define CONFIG_PODPAGES 1 #define CONFIG_TXTPAGES 1 +#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1 #define CONFIG_AVIO_READING_EXAMPLE 1 -#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1 -#define CONFIG_DECODING_ENCODING_EXAMPLE 1 +#define CONFIG_DECODE_AUDIO_EXAMPLE 1 +#define CONFIG_DECODE_VIDEO_EXAMPLE 1 #define CONFIG_DEMUXING_DECODING_EXAMPLE 1 +#define CONFIG_ENCODE_AUDIO_EXAMPLE 1 +#define CONFIG_ENCODE_VIDEO_EXAMPLE 1 #define CONFIG_EXTRACT_MVS_EXAMPLE 1 #define CONFIG_FILTER_AUDIO_EXAMPLE 0 #define CONFIG_FILTERING_AUDIO_EXAMPLE 0 #define CONFIG_FILTERING_VIDEO_EXAMPLE 0 +#define CONFIG_HTTP_MULTICLIENT_EXAMPLE 0 +#define CONFIG_HW_DECODE_EXAMPLE 1 #define CONFIG_METADATA_EXAMPLE 1 #define CONFIG_MUXING_EXAMPLE 1 #define CONFIG_QSVDEC_EXAMPLE 0 @@ -396,25 +400,48 @@ #define CONFIG_SCALING_VIDEO_EXAMPLE 1 #define CONFIG_TRANSCODE_AAC_EXAMPLE 1 #define CONFIG_TRANSCODING_EXAMPLE 0 +#define CONFIG_VAAPI_ENCODE_EXAMPLE 0 +#define CONFIG_VAAPI_TRANSCODE_EXAMPLE 0 #define CONFIG_AVISYNTH 0 -#define CONFIG_BZLIB 0 -#define CONFIG_CRYSTALHD 0 -#define CONFIG_DECKLINK 0 #define CONFIG_FREI0R 0 +#define CONFIG_LIBCDIO 0 +#define CONFIG_LIBDAVS2 0 +#define CONFIG_LIBRUBBERBAND 0 +#define CONFIG_LIBVIDSTAB 0 +#define CONFIG_LIBX264 0 +#define CONFIG_LIBX265 0 +#define CONFIG_LIBXAVS 0 +#define CONFIG_LIBXAVS2 0 +#define CONFIG_LIBXVID 0 +#define CONFIG_DECKLINK 0 +#define CONFIG_LIBNDI_NEWTEK 0 +#define CONFIG_LIBFDK_AAC 0 +#define CONFIG_OPENSSL 0 +#define CONFIG_LIBTLS 0 +#define CONFIG_GMP 0 +#define CONFIG_LIBLENSFUN 0 +#define CONFIG_LIBOPENCORE_AMRNB 0 +#define CONFIG_LIBOPENCORE_AMRWB 0 +#define CONFIG_LIBVMAF 0 +#define CONFIG_LIBVO_AMRWBENC 0 +#define CONFIG_MBEDTLS 0 +#define CONFIG_RKMPP 0 +#define CONFIG_LIBSMBCLIENT 0 +#define CONFIG_CHROMAPRINT 0 +#define CONFIG_GCRYPT 0 #define CONFIG_GNUTLS 0 -#define CONFIG_ICONV 0 +#define CONFIG_JNI 0 #define CONFIG_LADSPA 0 -#define CONFIG_LIBAACPLUS 0 +#define CONFIG_LIBAOM 0 #define CONFIG_LIBASS 0 #define CONFIG_LIBBLURAY 0 #define CONFIG_LIBBS2B 0 #define CONFIG_LIBCACA 0 -#define CONFIG_LIBCDIO 0 #define CONFIG_LIBCELT 0 +#define CONFIG_LIBCODEC2 0 +#define CONFIG_LIBDAV1D 0 #define CONFIG_LIBDC1394 0 -#define CONFIG_LIBDCADEC 0 -#define CONFIG_LIBFAAC 0 -#define CONFIG_LIBFDK_AAC 0 +#define CONFIG_LIBDRM 0 #define CONFIG_LIBFLITE 0 #define CONFIG_LIBFONTCONFIG 0 #define CONFIG_LIBFREETYPE 0 @@ -423,91 +450,107 @@ #define CONFIG_LIBGSM 0 #define CONFIG_LIBIEC61883 0 #define CONFIG_LIBILBC 0 +#define CONFIG_LIBJACK 0 +#define CONFIG_LIBKLVANC 0 #define CONFIG_LIBKVAZAAR 0 -#define CONFIG_LIBMFX 0 #define CONFIG_LIBMODPLUG 0 #define CONFIG_LIBMP3LAME 0 -#define CONFIG_LIBNUT 0 -#define CONFIG_LIBOPENCORE_AMRNB 0 -#define CONFIG_LIBOPENCORE_AMRWB 0 +#define CONFIG_LIBMYSOFA 0 #define CONFIG_LIBOPENCV 0 #define CONFIG_LIBOPENH264 0 #define CONFIG_LIBOPENJPEG 0 +#define CONFIG_LIBOPENMPT 0 #define CONFIG_LIBOPUS 0 #define CONFIG_LIBPULSE 0 -#define CONFIG_LIBQUVI 0 +#define CONFIG_LIBRSVG 0 #define CONFIG_LIBRTMP 0 -#define CONFIG_LIBSCHROEDINGER 0 #define CONFIG_LIBSHINE 0 #define CONFIG_LIBSMBCLIENT 0 #define CONFIG_LIBSNAPPY 0 #define CONFIG_LIBSOXR 0 #define CONFIG_LIBSPEEX 0 +#define CONFIG_LIBSRT 0 #define CONFIG_LIBSSH 0 -#define CONFIG_LIBSTAGEFRIGHT_H264 0 +#define CONFIG_LIBTENSORFLOW 0 +#define CONFIG_LIBTESSERACT 0 #define CONFIG_LIBTHEORA 0 #define CONFIG_LIBTWOLAME 0 -#define CONFIG_LIBUTVIDEO 0 #define CONFIG_LIBV4L2 0 -#define CONFIG_LIBVIDSTAB 0 -#define CONFIG_LIBVO_AACENC 0 -#define CONFIG_LIBVO_AMRWBENC 0 #define CONFIG_LIBVORBIS 0 #define CONFIG_LIBVPX 0 #define CONFIG_LIBWAVPACK 0 #define CONFIG_LIBWEBP 0 -#define CONFIG_LIBX264 0 -#define CONFIG_LIBX265 0 -#define CONFIG_LIBXAVS 0 +#define CONFIG_LIBXML2 0 +#define CONFIG_LIBZIMG 0 +#define CONFIG_LIBZMQ 0 +#define CONFIG_LIBZVBI 0 +#define CONFIG_LV2 0 +#define CONFIG_MEDIACODEC 0 +#define CONFIG_OPENAL 0 +#define CONFIG_OPENGL 0 +#define CONFIG_VAPOURSYNTH 0 +#define CONFIG_ALSA 0 +#define CONFIG_APPKIT 0 +#define CONFIG_AVFOUNDATION 0 +#define CONFIG_BZLIB 0 +#define CONFIG_COREIMAGE 0 +#define CONFIG_ICONV 0 #define CONFIG_LIBXCB 0 #define CONFIG_LIBXCB_SHM 0 #define CONFIG_LIBXCB_SHAPE 0 #define CONFIG_LIBXCB_XFIXES 0 -#define CONFIG_LIBXVID 0 -#define CONFIG_LIBZMQ 0 -#define CONFIG_LIBZVBI 0 #define CONFIG_LZMA 0 -#define CONFIG_MMAL 0 -#define CONFIG_NVENC 0 -#define CONFIG_OPENAL 0 -#define CONFIG_OPENCL 0 -#define CONFIG_OPENGL 0 -#define CONFIG_OPENSSL 0 -#define CONFIG_SDL 0 +#define CONFIG_SCHANNEL 1 +#define CONFIG_SDL2 0 #define CONFIG_SECURETRANSPORT 0 -#define CONFIG_X11GRAB 0 +#define CONFIG_SNDIO 0 #define CONFIG_XLIB 0 #define CONFIG_ZLIB 1 +#define CONFIG_CUDA_SDK 0 +#define CONFIG_LIBNPP 0 +#define CONFIG_LIBMFX 0 +#define CONFIG_MMAL 0 +#define CONFIG_OMX 0 +#define CONFIG_OPENCL 0 +#define CONFIG_AMF 0 +#define CONFIG_AUDIOTOOLBOX 0 +#define CONFIG_CRYSTALHD 0 +#define CONFIG_CUDA 0 +#define CONFIG_CUVID 0 +#define CONFIG_D3D11VA 0 +#define CONFIG_DXVA2 0 +#define CONFIG_FFNVCODEC 0 +#define CONFIG_NVDEC 0 +#define CONFIG_NVENC 0 +#define CONFIG_VAAPI 0 +#define CONFIG_VDPAU 0 +#define CONFIG_VIDEOTOOLBOX 0 +#define CONFIG_V4L2_M2M 0 +#define CONFIG_XVMC 0 #define CONFIG_FTRAPV 0 #define CONFIG_GRAY 0 #define CONFIG_HARDCODED_TABLES 0 +#define CONFIG_OMX_RPI 0 #define CONFIG_RUNTIME_CPUDETECT 1 #define CONFIG_SAFE_BITSTREAM_READER 1 #define CONFIG_SHARED 0 -#define CONFIG_SMALL 0 +#define CONFIG_SMALL 1 #define CONFIG_STATIC 1 #define CONFIG_SWSCALE_ALPHA 1 -#define CONFIG_D3D11VA 0 -#define CONFIG_DXVA2 0 -#define CONFIG_VAAPI 0 -#define CONFIG_VDA 0 -#define CONFIG_VDPAU 0 -#define CONFIG_XVMC 0 #define CONFIG_GPL 1 #define CONFIG_NONFREE 0 #define CONFIG_VERSION3 0 -#define CONFIG_AVCODEC 1 #define CONFIG_AVDEVICE 1 #define CONFIG_AVFILTER 0 +#define CONFIG_SWSCALE 1 +#define CONFIG_POSTPROC 0 #define CONFIG_AVFORMAT 1 +#define CONFIG_AVCODEC 1 +#define CONFIG_SWRESAMPLE 1 #define CONFIG_AVRESAMPLE 0 #define CONFIG_AVUTIL 1 -#define CONFIG_POSTPROC 0 -#define CONFIG_SWRESAMPLE 1 -#define CONFIG_SWSCALE 1 #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 -#define CONFIG_FFSERVER 0 #define CONFIG_FFMPEG 0 #define CONFIG_DCT 1 #define CONFIG_DWT 1 @@ -521,24 +564,44 @@ #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 #define CONFIG_RDFT 1 +#define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 -#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0 -#define CONFIG_MEMALIGN_HACK 0 +#define CONFIG_LINUX_PERF 0 #define CONFIG_MEMORY_POISONING 0 #define CONFIG_NEON_CLOBBER_TEST 0 +#define CONFIG_OSSFUZZ 0 #define CONFIG_PIC 0 -#define CONFIG_POD2MAN 0 -#define CONFIG_RAISE_MAJOR 0 #define CONFIG_THUMB 0 #define CONFIG_VALGRIND_BACKTRACE 0 #define CONFIG_XMM_CLOBBER_TEST 0 +#define CONFIG_BSFS 1 +#define CONFIG_DECODERS 1 +#define CONFIG_ENCODERS 0 +#define CONFIG_HWACCELS 0 +#define CONFIG_PARSERS 1 +#define CONFIG_INDEVS 0 +#define CONFIG_OUTDEVS 0 +#define CONFIG_FILTERS 0 +#define CONFIG_DEMUXERS 1 +#define CONFIG_MUXERS 0 +#define CONFIG_PROTOCOLS 1 #define CONFIG_AANDCTTABLES 1 #define CONFIG_AC3DSP 1 -#define CONFIG_AUDIO_FRAME_QUEUE 0 +#define CONFIG_ADTS_HEADER 1 +#define CONFIG_AUDIO_FRAME_QUEUE 1 #define CONFIG_AUDIODSP 1 #define CONFIG_BLOCKDSP 1 #define CONFIG_BSWAPDSP 1 #define CONFIG_CABAC 1 +#define CONFIG_CBS 1 +#define CONFIG_CBS_AV1 1 +#define CONFIG_CBS_H264 1 +#define CONFIG_CBS_H265 1 +#define CONFIG_CBS_JPEG 0 +#define CONFIG_CBS_MPEG2 1 +#define CONFIG_CBS_VP9 1 +#define CONFIG_DIRAC_PARSE 1 +#define CONFIG_DNN 0 #define CONFIG_DVPROFILE 1 #define CONFIG_EXIF 1 #define CONFIG_FAANDCT 1 @@ -548,34 +611,38 @@ #define CONFIG_FMTCONVERT 1 #define CONFIG_FRAME_THREAD_ENCODER 0 #define CONFIG_G722DSP 1 -#define CONFIG_GCRYPT 0 -#define CONFIG_GMP 0 #define CONFIG_GOLOMB 1 #define CONFIG_GPLV3 0 #define CONFIG_H263DSP 1 #define CONFIG_H264CHROMA 1 #define CONFIG_H264DSP 1 +#define CONFIG_H264PARSE 1 #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 +#define CONFIG_HEVCPARSE 1 #define CONFIG_HPELDSP 1 #define CONFIG_HUFFMAN 1 #define CONFIG_HUFFYUVDSP 1 #define CONFIG_HUFFYUVENCDSP 0 #define CONFIG_IDCTDSP 1 #define CONFIG_IIRFILTER 0 -#define CONFIG_IMDCT15 1 +#define CONFIG_MDCT15 1 #define CONFIG_INTRAX8 1 +#define CONFIG_ISO_MEDIA 1 #define CONFIG_IVIDSP 0 #define CONFIG_JPEGTABLES 1 -#define CONFIG_LIBX262 0 #define CONFIG_LGPLV3 0 +#define CONFIG_LIBX262 0 #define CONFIG_LLAUDDSP 1 #define CONFIG_LLVIDDSP 1 +#define CONFIG_LLVIDENCDSP 0 #define CONFIG_LPC 0 +#define CONFIG_LZF 1 #define CONFIG_ME_CMP 1 #define CONFIG_MPEG_ER 1 #define CONFIG_MPEGAUDIO 1 #define CONFIG_MPEGAUDIODSP 1 +#define CONFIG_MPEGAUDIOHEADER 1 #define CONFIG_MPEGVIDEO 1 #define CONFIG_MPEGVIDEOENC 1 #define CONFIG_MSS34DSP 1 @@ -584,18 +651,24 @@ #define CONFIG_QSV 0 #define CONFIG_QSVDEC 0 #define CONFIG_QSVENC 0 +#define CONFIG_QSVVPP 0 #define CONFIG_RANGECODER 1 #define CONFIG_RIFFDEC 1 #define CONFIG_RIFFENC 0 #define CONFIG_RTPDEC 0 #define CONFIG_RTPENC_CHAIN 0 #define CONFIG_RV34DSP 1 +#define CONFIG_SCENE_SAD 0 #define CONFIG_SINEWIN 1 #define CONFIG_SNAPPY 1 +#define CONFIG_SRTP 0 #define CONFIG_STARTCODE 1 #define CONFIG_TEXTUREDSP 1 #define CONFIG_TEXTUREDSPENC 0 #define CONFIG_TPELDSP 1 +#define CONFIG_VAAPI_1 0 +#define CONFIG_VAAPI_ENCODE 0 +#define CONFIG_VC1DSP 1 #define CONFIG_VIDEODSP 1 #define CONFIG_VP3DSP 1 #define CONFIG_VP56DSP 1 @@ -603,19 +676,36 @@ #define CONFIG_WMA_FREQS 1 #define CONFIG_WMV2DSP 1 #define CONFIG_AAC_ADTSTOASC_BSF 1 +#define CONFIG_AV1_METADATA_BSF 1 #define CONFIG_CHOMP_BSF 1 #define CONFIG_DUMP_EXTRADATA_BSF 1 +#define CONFIG_DCA_CORE_BSF 1 +#define CONFIG_EAC3_CORE_BSF 1 +#define CONFIG_EXTRACT_EXTRADATA_BSF 1 +#define CONFIG_FILTER_UNITS_BSF 1 +#define CONFIG_H264_METADATA_BSF 1 #define CONFIG_H264_MP4TOANNEXB_BSF 1 +#define CONFIG_H264_REDUNDANT_PPS_BSF 1 +#define CONFIG_HAPQA_EXTRACT_BSF 1 +#define CONFIG_HEVC_METADATA_BSF 1 #define CONFIG_HEVC_MP4TOANNEXB_BSF 1 #define CONFIG_IMX_DUMP_HEADER_BSF 1 #define CONFIG_MJPEG2JPEG_BSF 1 #define CONFIG_MJPEGA_DUMP_HEADER_BSF 1 #define CONFIG_MP3_HEADER_DECOMPRESS_BSF 1 +#define CONFIG_MPEG2_METADATA_BSF 1 #define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 1 #define CONFIG_MOV2TEXTSUB_BSF 1 #define CONFIG_NOISE_BSF 1 +#define CONFIG_NULL_BSF 1 +#define CONFIG_PRORES_METADATA_BSF 1 #define CONFIG_REMOVE_EXTRADATA_BSF 1 #define CONFIG_TEXT2MOVSUB_BSF 1 +#define CONFIG_TRACE_HEADERS_BSF 1 +#define CONFIG_VP9_METADATA_BSF 1 +#define CONFIG_VP9_RAW_REORDER_BSF 1 +#define CONFIG_VP9_SUPERFRAME_BSF 1 +#define CONFIG_VP9_SUPERFRAME_SPLIT_BSF 1 #define CONFIG_AASC_DECODER 1 #define CONFIG_AIC_DECODER 1 #define CONFIG_ALIAS_PIX_DECODER 1 @@ -635,6 +725,7 @@ #define CONFIG_BETHSOFTVID_DECODER 1 #define CONFIG_BFI_DECODER 1 #define CONFIG_BINK_DECODER 1 +#define CONFIG_BITPACKED_DECODER 1 #define CONFIG_BMP_DECODER 1 #define CONFIG_BMV_VIDEO_DECODER 1 #define CONFIG_BRENDER_PIX_DECODER 1 @@ -642,7 +733,9 @@ #define CONFIG_CAVS_DECODER 1 #define CONFIG_CDGRAPHICS_DECODER 1 #define CONFIG_CDXL_DECODER 1 +#define CONFIG_CFHD_DECODER 1 #define CONFIG_CINEPAK_DECODER 1 +#define CONFIG_CLEARVIDEO_DECODER 1 #define CONFIG_CLJR_DECODER 1 #define CONFIG_CLLC_DECODER 1 #define CONFIG_COMFORTNOISE_DECODER 1 @@ -655,9 +748,11 @@ #define CONFIG_DNXHD_DECODER 1 #define CONFIG_DPX_DECODER 1 #define CONFIG_DSICINVIDEO_DECODER 1 +#define CONFIG_DVAUDIO_DECODER 1 #define CONFIG_DVVIDEO_DECODER 1 #define CONFIG_DXA_DECODER 1 #define CONFIG_DXTORY_DECODER 1 +#define CONFIG_DXV_DECODER 1 #define CONFIG_EACMV_DECODER 1 #define CONFIG_EAMAD_DECODER 1 #define CONFIG_EATGQ_DECODER 1 @@ -672,35 +767,42 @@ #define CONFIG_FFV1_DECODER 1 #define CONFIG_FFVHUFF_DECODER 1 #define CONFIG_FIC_DECODER 1 +#define CONFIG_FITS_DECODER 1 #define CONFIG_FLASHSV_DECODER 1 #define CONFIG_FLASHSV2_DECODER 1 #define CONFIG_FLIC_DECODER 1 #define CONFIG_FLV_DECODER 1 +#define CONFIG_FMVC_DECODER 1 #define CONFIG_FOURXM_DECODER 1 #define CONFIG_FRAPS_DECODER 1 #define CONFIG_FRWU_DECODER 1 #define CONFIG_G2M_DECODER 1 +#define CONFIG_GDV_DECODER 1 #define CONFIG_GIF_DECODER 1 #define CONFIG_H261_DECODER 1 #define CONFIG_H263_DECODER 1 #define CONFIG_H263I_DECODER 1 #define CONFIG_H263P_DECODER 1 +#define CONFIG_H263_V4L2M2M_DECODER 0 #define CONFIG_H264_DECODER 1 #define CONFIG_H264_CRYSTALHD_DECODER 0 +#define CONFIG_H264_V4L2M2M_DECODER 0 +#define CONFIG_H264_MEDIACODEC_DECODER 0 #define CONFIG_H264_MMAL_DECODER 0 #define CONFIG_H264_QSV_DECODER 0 -#define CONFIG_H264_VDA_DECODER 0 -#define CONFIG_H264_VDPAU_DECODER 0 +#define CONFIG_H264_RKMPP_DECODER 0 #define CONFIG_HAP_DECODER 1 #define CONFIG_HEVC_DECODER 1 #define CONFIG_HEVC_QSV_DECODER 0 +#define CONFIG_HEVC_RKMPP_DECODER 0 +#define CONFIG_HEVC_V4L2M2M_DECODER 0 #define CONFIG_HNM4_VIDEO_DECODER 1 #define CONFIG_HQ_HQA_DECODER 1 #define CONFIG_HQX_DECODER 1 #define CONFIG_HUFFYUV_DECODER 1 #define CONFIG_IDCIN_DECODER 1 -#define CONFIG_IFF_BYTERUN1_DECODER 1 #define CONFIG_IFF_ILBM_DECODER 1 +#define CONFIG_IMM4_DECODER 1 #define CONFIG_INDEO2_DECODER 0 #define CONFIG_INDEO3_DECODER 0 #define CONFIG_INDEO4_DECODER 0 @@ -713,28 +815,33 @@ #define CONFIG_KMVC_DECODER 1 #define CONFIG_LAGARITH_DECODER 1 #define CONFIG_LOCO_DECODER 1 +#define CONFIG_M101_DECODER 1 +#define CONFIG_MAGICYUV_DECODER 1 #define CONFIG_MDEC_DECODER 1 #define CONFIG_MIMIC_DECODER 1 #define CONFIG_MJPEG_DECODER 1 #define CONFIG_MJPEGB_DECODER 1 #define CONFIG_MMVIDEO_DECODER 1 #define CONFIG_MOTIONPIXELS_DECODER 1 -#define CONFIG_MPEG_XVMC_DECODER 0 #define CONFIG_MPEG1VIDEO_DECODER 1 #define CONFIG_MPEG2VIDEO_DECODER 1 #define CONFIG_MPEG4_DECODER 1 #define CONFIG_MPEG4_CRYSTALHD_DECODER 0 -#define CONFIG_MPEG4_VDPAU_DECODER 0 +#define CONFIG_MPEG4_V4L2M2M_DECODER 0 +#define CONFIG_MPEG4_MMAL_DECODER 0 #define CONFIG_MPEGVIDEO_DECODER 1 -#define CONFIG_MPEG_VDPAU_DECODER 0 -#define CONFIG_MPEG1_VDPAU_DECODER 0 +#define CONFIG_MPEG1_V4L2M2M_DECODER 0 +#define CONFIG_MPEG2_MMAL_DECODER 0 #define CONFIG_MPEG2_CRYSTALHD_DECODER 0 +#define CONFIG_MPEG2_V4L2M2M_DECODER 0 #define CONFIG_MPEG2_QSV_DECODER 0 +#define CONFIG_MPEG2_MEDIACODEC_DECODER 0 #define CONFIG_MSA1_DECODER 1 -#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0 +#define CONFIG_MSCC_DECODER 1 #define CONFIG_MSMPEG4V1_DECODER 1 #define CONFIG_MSMPEG4V2_DECODER 1 #define CONFIG_MSMPEG4V3_DECODER 1 +#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0 #define CONFIG_MSRLE_DECODER 1 #define CONFIG_MSS1_DECODER 1 #define CONFIG_MSS2_DECODER 1 @@ -743,6 +850,7 @@ #define CONFIG_MTS2_DECODER 1 #define CONFIG_MVC1_DECODER 1 #define CONFIG_MVC2_DECODER 1 +#define CONFIG_MWSC_DECODER 1 #define CONFIG_MXPEG_DECODER 1 #define CONFIG_NUV_DECODER 1 #define CONFIG_PAF_VIDEO_DECODER 1 @@ -752,33 +860,43 @@ #define CONFIG_PGM_DECODER 1 #define CONFIG_PGMYUV_DECODER 1 #define CONFIG_PICTOR_DECODER 1 +#define CONFIG_PIXLET_DECODER 1 #define CONFIG_PNG_DECODER 1 #define CONFIG_PPM_DECODER 1 #define CONFIG_PRORES_DECODER 1 -#define CONFIG_PRORES_LGPL_DECODER 1 +#define CONFIG_PROSUMER_DECODER 1 +#define CONFIG_PSD_DECODER 1 #define CONFIG_PTX_DECODER 1 #define CONFIG_QDRAW_DECODER 1 #define CONFIG_QPEG_DECODER 1 #define CONFIG_QTRLE_DECODER 1 #define CONFIG_R10K_DECODER 1 #define CONFIG_R210_DECODER 1 +#define CONFIG_RASC_DECODER 1 #define CONFIG_RAWVIDEO_DECODER 1 #define CONFIG_RL2_DECODER 1 #define CONFIG_ROQ_DECODER 1 #define CONFIG_RPZA_DECODER 1 +#define CONFIG_RSCC_DECODER 1 #define CONFIG_RV10_DECODER 1 #define CONFIG_RV20_DECODER 1 #define CONFIG_RV30_DECODER 1 #define CONFIG_RV40_DECODER 1 #define CONFIG_S302M_DECODER 1 #define CONFIG_SANM_DECODER 1 +#define CONFIG_SCPR_DECODER 1 +#define CONFIG_SCREENPRESSO_DECODER 1 +#define CONFIG_SDX2_DPCM_DECODER 1 #define CONFIG_SGI_DECODER 1 #define CONFIG_SGIRLE_DECODER 1 +#define CONFIG_SHEERVIDEO_DECODER 1 #define CONFIG_SMACKER_DECODER 1 #define CONFIG_SMC_DECODER 1 #define CONFIG_SMVJPEG_DECODER 1 #define CONFIG_SNOW_DECODER 1 #define CONFIG_SP5X_DECODER 1 +#define CONFIG_SPEEDHQ_DECODER 1 +#define CONFIG_SRGC_DECODER 1 #define CONFIG_SUNRAST_DECODER 1 #define CONFIG_SVQ1_DECODER 1 #define CONFIG_SVQ3_DECODER 1 @@ -792,6 +910,7 @@ #define CONFIG_TMV_DECODER 1 #define CONFIG_TRUEMOTION1_DECODER 1 #define CONFIG_TRUEMOTION2_DECODER 1 +#define CONFIG_TRUEMOTION2RT_DECODER 1 #define CONFIG_TSCC_DECODER 1 #define CONFIG_TSCC2_DECODER 1 #define CONFIG_TXD_DECODER 1 @@ -806,9 +925,10 @@ #define CONFIG_VBLE_DECODER 1 #define CONFIG_VC1_DECODER 1 #define CONFIG_VC1_CRYSTALHD_DECODER 0 -#define CONFIG_VC1_VDPAU_DECODER 0 #define CONFIG_VC1IMAGE_DECODER 1 +#define CONFIG_VC1_MMAL_DECODER 0 #define CONFIG_VC1_QSV_DECODER 0 +#define CONFIG_VC1_V4L2M2M_DECODER 0 #define CONFIG_VCR1_DECODER 1 #define CONFIG_VMDVIDEO_DECODER 1 #define CONFIG_VMNC_DECODER 1 @@ -819,14 +939,19 @@ #define CONFIG_VP6F_DECODER 1 #define CONFIG_VP7_DECODER 1 #define CONFIG_VP8_DECODER 1 +#define CONFIG_VP8_RKMPP_DECODER 0 +#define CONFIG_VP8_V4L2M2M_DECODER 0 #define CONFIG_VP9_DECODER 1 +#define CONFIG_VP9_RKMPP_DECODER 0 +#define CONFIG_VP9_V4L2M2M_DECODER 0 #define CONFIG_VQA_DECODER 1 #define CONFIG_WEBP_DECODER 1 +#define CONFIG_WCMV_DECODER 1 +#define CONFIG_WRAPPED_AVFRAME_DECODER 1 #define CONFIG_WMV1_DECODER 1 #define CONFIG_WMV2_DECODER 1 #define CONFIG_WMV3_DECODER 1 #define CONFIG_WMV3_CRYSTALHD_DECODER 0 -#define CONFIG_WMV3_VDPAU_DECODER 0 #define CONFIG_WMV3IMAGE_DECODER 1 #define CONFIG_WNV1_DECODER 1 #define CONFIG_XAN_WC3_DECODER 1 @@ -834,8 +959,10 @@ #define CONFIG_XBM_DECODER 1 #define CONFIG_XFACE_DECODER 1 #define CONFIG_XL_DECODER 1 +#define CONFIG_XPM_DECODER 1 #define CONFIG_XWD_DECODER 1 #define CONFIG_Y41P_DECODER 1 +#define CONFIG_YLC_DECODER 1 #define CONFIG_YOP_DECODER 1 #define CONFIG_YUV4_DECODER 1 #define CONFIG_ZERO12V_DECODER 1 @@ -852,20 +979,27 @@ #define CONFIG_AMRNB_DECODER 1 #define CONFIG_AMRWB_DECODER 1 #define CONFIG_APE_DECODER 1 +#define CONFIG_APTX_DECODER 1 +#define CONFIG_APTX_HD_DECODER 1 #define CONFIG_ATRAC1_DECODER 1 #define CONFIG_ATRAC3_DECODER 1 +#define CONFIG_ATRAC3AL_DECODER 1 #define CONFIG_ATRAC3P_DECODER 0 +#define CONFIG_ATRAC3PAL_DECODER 1 +#define CONFIG_ATRAC9_DECODER 1 #define CONFIG_BINKAUDIO_DCT_DECODER 1 #define CONFIG_BINKAUDIO_RDFT_DECODER 1 #define CONFIG_BMV_AUDIO_DECODER 1 #define CONFIG_COOK_DECODER 1 #define CONFIG_DCA_DECODER 1 +#define CONFIG_DOLBY_E_DECODER 1 #define CONFIG_DSD_LSBF_DECODER 1 #define CONFIG_DSD_MSBF_DECODER 1 #define CONFIG_DSD_LSBF_PLANAR_DECODER 1 #define CONFIG_DSD_MSBF_PLANAR_DECODER 1 #define CONFIG_DSICINAUDIO_DECODER 1 #define CONFIG_DSS_SP_DECODER 1 +#define CONFIG_DST_DECODER 1 #define CONFIG_EAC3_DECODER 1 #define CONFIG_EVRC_DECODER 1 #define CONFIG_FFWAVESYNTH_DECODER 1 @@ -875,7 +1009,9 @@ #define CONFIG_GSM_DECODER 1 #define CONFIG_GSM_MS_DECODER 1 #define CONFIG_IAC_DECODER 1 +#define CONFIG_ILBC_DECODER 1 #define CONFIG_IMC_DECODER 1 +#define CONFIG_INTERPLAY_ACM_DECODER 1 #define CONFIG_MACE3_DECODER 1 #define CONFIG_MACE6_DECODER 1 #define CONFIG_METASOUND_DECODER 1 @@ -884,12 +1020,12 @@ #define CONFIG_MP1FLOAT_DECODER 1 #define CONFIG_MP2_DECODER 1 #define CONFIG_MP2FLOAT_DECODER 1 -#define CONFIG_MP3_DECODER 1 #define CONFIG_MP3FLOAT_DECODER 1 -#define CONFIG_MP3ADU_DECODER 1 +#define CONFIG_MP3_DECODER 1 #define CONFIG_MP3ADUFLOAT_DECODER 1 -#define CONFIG_MP3ON4_DECODER 1 +#define CONFIG_MP3ADU_DECODER 1 #define CONFIG_MP3ON4FLOAT_DECODER 1 +#define CONFIG_MP3ON4_DECODER 1 #define CONFIG_MPC7_DECODER 1 #define CONFIG_MPC8_DECODER 1 #define CONFIG_NELLYMOSER_DECODER 1 @@ -898,9 +1034,11 @@ #define CONFIG_PAF_AUDIO_DECODER 1 #define CONFIG_QCELP_DECODER 1 #define CONFIG_QDM2_DECODER 1 +#define CONFIG_QDMC_DECODER 1 #define CONFIG_RA_144_DECODER 1 #define CONFIG_RA_288_DECODER 1 #define CONFIG_RALF_DECODER 1 +#define CONFIG_SBC_DECODER 1 #define CONFIG_SHORTEN_DECODER 1 #define CONFIG_SIPR_DECODER 1 #define CONFIG_SMACKAUD_DECODER 1 @@ -919,9 +1057,13 @@ #define CONFIG_WMAV2_DECODER 1 #define CONFIG_WMAVOICE_DECODER 1 #define CONFIG_WS_SND1_DECODER 1 +#define CONFIG_XMA1_DECODER 1 +#define CONFIG_XMA2_DECODER 1 #define CONFIG_PCM_ALAW_DECODER 1 #define CONFIG_PCM_BLURAY_DECODER 1 #define CONFIG_PCM_DVD_DECODER 1 +#define CONFIG_PCM_F16LE_DECODER 1 +#define CONFIG_PCM_F24LE_DECODER 1 #define CONFIG_PCM_F32BE_DECODER 1 #define CONFIG_PCM_F32LE_DECODER 1 #define CONFIG_PCM_F64BE_DECODER 1 @@ -941,6 +1083,8 @@ #define CONFIG_PCM_S32BE_DECODER 1 #define CONFIG_PCM_S32LE_DECODER 1 #define CONFIG_PCM_S32LE_PLANAR_DECODER 1 +#define CONFIG_PCM_S64BE_DECODER 1 +#define CONFIG_PCM_S64LE_DECODER 1 #define CONFIG_PCM_U8_DECODER 1 #define CONFIG_PCM_U16BE_DECODER 1 #define CONFIG_PCM_U16LE_DECODER 1 @@ -948,7 +1092,9 @@ #define CONFIG_PCM_U24LE_DECODER 1 #define CONFIG_PCM_U32BE_DECODER 1 #define CONFIG_PCM_U32LE_DECODER 1 +#define CONFIG_PCM_VIDC_DECODER 1 #define CONFIG_PCM_ZORK_DECODER 1 +#define CONFIG_GREMLIN_DPCM_DECODER 1 #define CONFIG_INTERPLAY_DPCM_DECODER 1 #define CONFIG_ROQ_DPCM_DECODER 1 #define CONFIG_SOL_DPCM_DECODER 1 @@ -956,6 +1102,7 @@ #define CONFIG_ADPCM_4XM_DECODER 1 #define CONFIG_ADPCM_ADX_DECODER 1 #define CONFIG_ADPCM_AFC_DECODER 1 +#define CONFIG_ADPCM_AICA_DECODER 1 #define CONFIG_ADPCM_CT_DECODER 1 #define CONFIG_ADPCM_DTK_DECODER 1 #define CONFIG_ADPCM_EA_DECODER 1 @@ -969,6 +1116,7 @@ #define CONFIG_ADPCM_G726LE_DECODER 1 #define CONFIG_ADPCM_IMA_AMV_DECODER 1 #define CONFIG_ADPCM_IMA_APC_DECODER 1 +#define CONFIG_ADPCM_IMA_DAT4_DECODER 1 #define CONFIG_ADPCM_IMA_DK3_DECODER 1 #define CONFIG_ADPCM_IMA_DK4_DECODER 1 #define CONFIG_ADPCM_IMA_EA_EACS_DECODER 1 @@ -981,6 +1129,8 @@ #define CONFIG_ADPCM_IMA_WAV_DECODER 1 #define CONFIG_ADPCM_IMA_WS_DECODER 1 #define CONFIG_ADPCM_MS_DECODER 1 +#define CONFIG_ADPCM_MTAF_DECODER 1 +#define CONFIG_ADPCM_PSX_DECODER 1 #define CONFIG_ADPCM_SBPRO_2_DECODER 1 #define CONFIG_ADPCM_SBPRO_3_DECODER 1 #define CONFIG_ADPCM_SBPRO_4_DECODER 1 @@ -990,7 +1140,6 @@ #define CONFIG_ADPCM_VIMA_DECODER 1 #define CONFIG_ADPCM_XA_DECODER 1 #define CONFIG_ADPCM_YAMAHA_DECODER 1 -#define CONFIG_VIMA_DECODER 1 #define CONFIG_SSA_DECODER 1 #define CONFIG_ASS_DECODER 1 #define CONFIG_CCAPTION_DECODER 1 @@ -1013,8 +1162,26 @@ #define CONFIG_VPLAYER_DECODER 1 #define CONFIG_WEBVTT_DECODER 1 #define CONFIG_XSUB_DECODER 1 +#define CONFIG_AAC_AT_DECODER 0 +#define CONFIG_AC3_AT_DECODER 0 +#define CONFIG_ADPCM_IMA_QT_AT_DECODER 0 +#define CONFIG_ALAC_AT_DECODER 0 +#define CONFIG_AMR_NB_AT_DECODER 0 +#define CONFIG_EAC3_AT_DECODER 0 +#define CONFIG_GSM_MS_AT_DECODER 0 +#define CONFIG_ILBC_AT_DECODER 0 +#define CONFIG_MP1_AT_DECODER 0 +#define CONFIG_MP2_AT_DECODER 0 +#define CONFIG_MP3_AT_DECODER 0 +#define CONFIG_PCM_ALAW_AT_DECODER 0 +#define CONFIG_PCM_MULAW_AT_DECODER 0 +#define CONFIG_QDMC_AT_DECODER 0 +#define CONFIG_QDM2_AT_DECODER 0 +#define CONFIG_LIBAOM_AV1_DECODER 0 #define CONFIG_LIBCELT_DECODER 0 -#define CONFIG_LIBDCADEC_DECODER 0 +#define CONFIG_LIBCODEC2_DECODER 0 +#define CONFIG_LIBDAV1D_DECODER 0 +#define CONFIG_LIBDAVS2_DECODER 0 #define CONFIG_LIBFDK_AAC_DECODER 0 #define CONFIG_LIBGSM_DECODER 0 #define CONFIG_LIBGSM_MS_DECODER 0 @@ -1023,10 +1190,8 @@ #define CONFIG_LIBOPENCORE_AMRWB_DECODER 0 #define CONFIG_LIBOPENJPEG_DECODER 0 #define CONFIG_LIBOPUS_DECODER 0 -#define CONFIG_LIBSCHROEDINGER_DECODER 0 +#define CONFIG_LIBRSVG_DECODER 0 #define CONFIG_LIBSPEEX_DECODER 0 -#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0 -#define CONFIG_LIBUTVIDEO_DECODER 0 #define CONFIG_LIBVORBIS_DECODER 0 #define CONFIG_LIBVPX_VP8_DECODER 0 #define CONFIG_LIBVPX_VP9_DECODER 0 @@ -1034,250 +1199,21 @@ #define CONFIG_BINTEXT_DECODER 1 #define CONFIG_XBIN_DECODER 1 #define CONFIG_IDF_DECODER 1 -#define CONFIG_AAC_DEMUXER 1 -#define CONFIG_AC3_DEMUXER 1 -#define CONFIG_ACT_DEMUXER 1 -#define CONFIG_ADF_DEMUXER 1 -#define CONFIG_ADP_DEMUXER 1 -#define CONFIG_ADX_DEMUXER 1 -#define CONFIG_AEA_DEMUXER 1 -#define CONFIG_AFC_DEMUXER 1 -#define CONFIG_AIFF_DEMUXER 1 -#define CONFIG_AMR_DEMUXER 1 -#define CONFIG_ANM_DEMUXER 1 -#define CONFIG_APC_DEMUXER 1 -#define CONFIG_APE_DEMUXER 1 -#define CONFIG_APNG_DEMUXER 1 -#define CONFIG_AQTITLE_DEMUXER 1 -#define CONFIG_ASF_DEMUXER 1 -#define CONFIG_ASF_O_DEMUXER 1 -#define CONFIG_ASS_DEMUXER 1 -#define CONFIG_AST_DEMUXER 1 -#define CONFIG_AU_DEMUXER 1 -#define CONFIG_AVI_DEMUXER 1 -#define CONFIG_AVISYNTH_DEMUXER 0 -#define CONFIG_AVR_DEMUXER 1 -#define CONFIG_AVS_DEMUXER 1 -#define CONFIG_BETHSOFTVID_DEMUXER 1 -#define CONFIG_BFI_DEMUXER 1 -#define CONFIG_BINTEXT_DEMUXER 1 -#define CONFIG_BINK_DEMUXER 1 -#define CONFIG_BIT_DEMUXER 1 -#define CONFIG_BMV_DEMUXER 1 -#define CONFIG_BFSTM_DEMUXER 1 -#define CONFIG_BRSTM_DEMUXER 1 -#define CONFIG_BOA_DEMUXER 1 -#define CONFIG_C93_DEMUXER 1 -#define CONFIG_CAF_DEMUXER 1 -#define CONFIG_CAVSVIDEO_DEMUXER 1 -#define CONFIG_CDG_DEMUXER 1 -#define CONFIG_CDXL_DEMUXER 1 -#define CONFIG_CINE_DEMUXER 1 -#define CONFIG_CONCAT_DEMUXER 1 -#define CONFIG_DATA_DEMUXER 1 -#define CONFIG_DAUD_DEMUXER 1 -#define CONFIG_DFA_DEMUXER 1 -#define CONFIG_DIRAC_DEMUXER 1 -#define CONFIG_DNXHD_DEMUXER 1 -#define CONFIG_DSF_DEMUXER 1 -#define CONFIG_DSICIN_DEMUXER 1 -#define CONFIG_DSS_DEMUXER 1 -#define CONFIG_DTS_DEMUXER 1 -#define CONFIG_DTSHD_DEMUXER 1 -#define CONFIG_DV_DEMUXER 1 -#define CONFIG_DVBSUB_DEMUXER 1 -#define CONFIG_DXA_DEMUXER 1 -#define CONFIG_EA_DEMUXER 1 -#define CONFIG_EA_CDATA_DEMUXER 1 -#define CONFIG_EAC3_DEMUXER 1 -#define CONFIG_EPAF_DEMUXER 1 -#define CONFIG_FFM_DEMUXER 1 -#define CONFIG_FFMETADATA_DEMUXER 1 -#define CONFIG_FILMSTRIP_DEMUXER 1 -#define CONFIG_FLAC_DEMUXER 1 -#define CONFIG_FLIC_DEMUXER 1 -#define CONFIG_FLV_DEMUXER 1 -#define CONFIG_LIVE_FLV_DEMUXER 1 -#define CONFIG_FOURXM_DEMUXER 1 -#define CONFIG_FRM_DEMUXER 1 -#define CONFIG_G722_DEMUXER 1 -#define CONFIG_G723_1_DEMUXER 1 -#define CONFIG_G729_DEMUXER 1 -#define CONFIG_GIF_DEMUXER 1 -#define CONFIG_GSM_DEMUXER 1 -#define CONFIG_GXF_DEMUXER 1 -#define CONFIG_H261_DEMUXER 1 -#define CONFIG_H263_DEMUXER 1 -#define CONFIG_H264_DEMUXER 1 -#define CONFIG_HEVC_DEMUXER 1 -#define CONFIG_HLS_DEMUXER 1 -#define CONFIG_HNM_DEMUXER 1 -#define CONFIG_ICO_DEMUXER 1 -#define CONFIG_IDCIN_DEMUXER 1 -#define CONFIG_IDF_DEMUXER 1 -#define CONFIG_IFF_DEMUXER 1 -#define CONFIG_ILBC_DEMUXER 1 -#define CONFIG_IMAGE2_DEMUXER 1 -#define CONFIG_IMAGE2PIPE_DEMUXER 1 -#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 1 -#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 1 -#define CONFIG_INGENIENT_DEMUXER 1 -#define CONFIG_IPMOVIE_DEMUXER 1 -#define CONFIG_IRCAM_DEMUXER 1 -#define CONFIG_ISS_DEMUXER 1 -#define CONFIG_IV8_DEMUXER 1 -#define CONFIG_IVF_DEMUXER 1 -#define CONFIG_JACOSUB_DEMUXER 1 -#define CONFIG_JV_DEMUXER 1 -#define CONFIG_LATM_DEMUXER 1 -#define CONFIG_LMLM4_DEMUXER 1 -#define CONFIG_LOAS_DEMUXER 1 -#define CONFIG_LRC_DEMUXER 1 -#define CONFIG_LVF_DEMUXER 1 -#define CONFIG_LXF_DEMUXER 1 -#define CONFIG_M4V_DEMUXER 1 -#define CONFIG_MATROSKA_DEMUXER 1 -#define CONFIG_MGSTS_DEMUXER 1 -#define CONFIG_MICRODVD_DEMUXER 1 -#define CONFIG_MJPEG_DEMUXER 1 -#define CONFIG_MLP_DEMUXER 1 -#define CONFIG_MLV_DEMUXER 1 -#define CONFIG_MM_DEMUXER 1 -#define CONFIG_MMF_DEMUXER 1 -#define CONFIG_MOV_DEMUXER 1 -#define CONFIG_MP3_DEMUXER 1 -#define CONFIG_MPC_DEMUXER 1 -#define CONFIG_MPC8_DEMUXER 1 -#define CONFIG_MPEGPS_DEMUXER 1 -#define CONFIG_MPEGTS_DEMUXER 1 -#define CONFIG_MPEGTSRAW_DEMUXER 1 -#define CONFIG_MPEGVIDEO_DEMUXER 1 -#define CONFIG_MPJPEG_DEMUXER 1 -#define CONFIG_MPL2_DEMUXER 1 -#define CONFIG_MPSUB_DEMUXER 1 -#define CONFIG_MSNWC_TCP_DEMUXER 1 -#define CONFIG_MTV_DEMUXER 1 -#define CONFIG_MV_DEMUXER 1 -#define CONFIG_MVI_DEMUXER 1 -#define CONFIG_MXF_DEMUXER 1 -#define CONFIG_MXG_DEMUXER 1 -#define CONFIG_NC_DEMUXER 1 -#define CONFIG_NISTSPHERE_DEMUXER 1 -#define CONFIG_NSV_DEMUXER 1 -#define CONFIG_NUT_DEMUXER 1 -#define CONFIG_NUV_DEMUXER 1 -#define CONFIG_OGG_DEMUXER 1 -#define CONFIG_OMA_DEMUXER 1 -#define CONFIG_PAF_DEMUXER 1 -#define CONFIG_PCM_ALAW_DEMUXER 1 -#define CONFIG_PCM_MULAW_DEMUXER 1 -#define CONFIG_PCM_F64BE_DEMUXER 1 -#define CONFIG_PCM_F64LE_DEMUXER 1 -#define CONFIG_PCM_F32BE_DEMUXER 1 -#define CONFIG_PCM_F32LE_DEMUXER 1 -#define CONFIG_PCM_S32BE_DEMUXER 1 -#define CONFIG_PCM_S32LE_DEMUXER 1 -#define CONFIG_PCM_S24BE_DEMUXER 1 -#define CONFIG_PCM_S24LE_DEMUXER 1 -#define CONFIG_PCM_S16BE_DEMUXER 1 -#define CONFIG_PCM_S16LE_DEMUXER 1 -#define CONFIG_PCM_S8_DEMUXER 1 -#define CONFIG_PCM_U32BE_DEMUXER 1 -#define CONFIG_PCM_U32LE_DEMUXER 1 -#define CONFIG_PCM_U24BE_DEMUXER 1 -#define CONFIG_PCM_U24LE_DEMUXER 1 -#define CONFIG_PCM_U16BE_DEMUXER 1 -#define CONFIG_PCM_U16LE_DEMUXER 1 -#define CONFIG_PCM_U8_DEMUXER 1 -#define CONFIG_PJS_DEMUXER 1 -#define CONFIG_PMP_DEMUXER 1 -#define CONFIG_PVA_DEMUXER 1 -#define CONFIG_PVF_DEMUXER 1 -#define CONFIG_QCP_DEMUXER 1 -#define CONFIG_R3D_DEMUXER 1 -#define CONFIG_RAWVIDEO_DEMUXER 1 -#define CONFIG_REALTEXT_DEMUXER 1 -#define CONFIG_REDSPARK_DEMUXER 1 -#define CONFIG_RL2_DEMUXER 1 -#define CONFIG_RM_DEMUXER 1 -#define CONFIG_ROQ_DEMUXER 1 -#define CONFIG_RPL_DEMUXER 1 -#define CONFIG_RSD_DEMUXER 1 -#define CONFIG_RSO_DEMUXER 1 -#define CONFIG_RTP_DEMUXER 0 -#define CONFIG_RTSP_DEMUXER 0 -#define CONFIG_SAMI_DEMUXER 1 -#define CONFIG_SAP_DEMUXER 0 -#define CONFIG_SBG_DEMUXER 1 -#define CONFIG_SDP_DEMUXER 0 -#define CONFIG_SDR2_DEMUXER 1 -#define CONFIG_SEGAFILM_DEMUXER 1 -#define CONFIG_SHORTEN_DEMUXER 1 -#define CONFIG_SIFF_DEMUXER 1 -#define CONFIG_SLN_DEMUXER 1 -#define CONFIG_SMACKER_DEMUXER 1 -#define CONFIG_SMJPEG_DEMUXER 1 -#define CONFIG_SMUSH_DEMUXER 1 -#define CONFIG_SOL_DEMUXER 1 -#define CONFIG_SOX_DEMUXER 1 -#define CONFIG_SPDIF_DEMUXER 1 -#define CONFIG_SRT_DEMUXER 1 -#define CONFIG_STR_DEMUXER 1 -#define CONFIG_STL_DEMUXER 1 -#define CONFIG_SUBVIEWER1_DEMUXER 1 -#define CONFIG_SUBVIEWER_DEMUXER 1 -#define CONFIG_SUP_DEMUXER 1 -#define CONFIG_SWF_DEMUXER 1 -#define CONFIG_TAK_DEMUXER 1 -#define CONFIG_TEDCAPTIONS_DEMUXER 1 -#define CONFIG_THP_DEMUXER 1 -#define CONFIG_TIERTEXSEQ_DEMUXER 1 -#define CONFIG_TMV_DEMUXER 1 -#define CONFIG_TRUEHD_DEMUXER 1 -#define CONFIG_TTA_DEMUXER 1 -#define CONFIG_TXD_DEMUXER 1 -#define CONFIG_TTY_DEMUXER 1 -#define CONFIG_VC1_DEMUXER 1 -#define CONFIG_VC1T_DEMUXER 1 -#define CONFIG_VIVO_DEMUXER 1 -#define CONFIG_VMD_DEMUXER 1 -#define CONFIG_VOBSUB_DEMUXER 1 -#define CONFIG_VOC_DEMUXER 1 -#define CONFIG_VPLAYER_DEMUXER 1 -#define CONFIG_VQF_DEMUXER 1 -#define CONFIG_W64_DEMUXER 1 -#define CONFIG_WAV_DEMUXER 1 -#define CONFIG_WC3_DEMUXER 1 -#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 1 -#define CONFIG_WEBVTT_DEMUXER 1 -#define CONFIG_WSAUD_DEMUXER 1 -#define CONFIG_WSVQA_DEMUXER 1 -#define CONFIG_WTV_DEMUXER 1 -#define CONFIG_WV_DEMUXER 1 -#define CONFIG_XA_DEMUXER 1 -#define CONFIG_XBIN_DEMUXER 1 -#define CONFIG_XMV_DEMUXER 1 -#define CONFIG_XWMA_DEMUXER 1 -#define CONFIG_YOP_DEMUXER 1 -#define CONFIG_YUV4MPEGPIPE_DEMUXER 1 -#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 1 -#define CONFIG_LIBGME_DEMUXER 0 -#define CONFIG_LIBMODPLUG_DEMUXER 0 -#define CONFIG_LIBNUT_DEMUXER 0 -#define CONFIG_LIBQUVI_DEMUXER 0 +#define CONFIG_LIBOPENH264_DECODER 0 +#define CONFIG_H264_CUVID_DECODER 0 +#define CONFIG_HEVC_CUVID_DECODER 0 +#define CONFIG_HEVC_MEDIACODEC_DECODER 0 +#define CONFIG_MJPEG_CUVID_DECODER 0 +#define CONFIG_MPEG1_CUVID_DECODER 0 +#define CONFIG_MPEG2_CUVID_DECODER 0 +#define CONFIG_MPEG4_CUVID_DECODER 0 +#define CONFIG_MPEG4_MEDIACODEC_DECODER 0 +#define CONFIG_VC1_CUVID_DECODER 0 +#define CONFIG_VP8_CUVID_DECODER 0 +#define CONFIG_VP8_MEDIACODEC_DECODER 0 +#define CONFIG_VP8_QSV_DECODER 0 +#define CONFIG_VP9_CUVID_DECODER 0 +#define CONFIG_VP9_MEDIACODEC_DECODER 0 #define CONFIG_A64MULTI_ENCODER 0 #define CONFIG_A64MULTI5_ENCODER 0 #define CONFIG_ALIAS_PIX_ENCODER 0 @@ -1297,6 +1233,7 @@ #define CONFIG_DVVIDEO_ENCODER 0 #define CONFIG_FFV1_ENCODER 0 #define CONFIG_FFVHUFF_ENCODER 0 +#define CONFIG_FITS_ENCODER 0 #define CONFIG_FLASHSV_ENCODER 0 #define CONFIG_FLASHSV2_ENCODER 0 #define CONFIG_FLV_ENCODER 0 @@ -1309,6 +1246,7 @@ #define CONFIG_JPEG2000_ENCODER 0 #define CONFIG_JPEGLS_ENCODER 0 #define CONFIG_LJPEG_ENCODER 0 +#define CONFIG_MAGICYUV_ENCODER 0 #define CONFIG_MJPEG_ENCODER 0 #define CONFIG_MPEG1VIDEO_ENCODER 0 #define CONFIG_MPEG2VIDEO_ENCODER 0 @@ -1345,6 +1283,8 @@ #define CONFIG_V308_ENCODER 0 #define CONFIG_V408_ENCODER 0 #define CONFIG_V410_ENCODER 0 +#define CONFIG_VC2_ENCODER 0 +#define CONFIG_WRAPPED_AVFRAME_ENCODER 0 #define CONFIG_WMV1_ENCODER 0 #define CONFIG_WMV2_ENCODER 0 #define CONFIG_XBM_ENCODER 0 @@ -1358,16 +1298,22 @@ #define CONFIG_AC3_ENCODER 0 #define CONFIG_AC3_FIXED_ENCODER 0 #define CONFIG_ALAC_ENCODER 0 +#define CONFIG_APTX_ENCODER 0 +#define CONFIG_APTX_HD_ENCODER 0 #define CONFIG_DCA_ENCODER 0 #define CONFIG_EAC3_ENCODER 0 #define CONFIG_FLAC_ENCODER 0 #define CONFIG_G723_1_ENCODER 0 +#define CONFIG_MLP_ENCODER 0 #define CONFIG_MP2_ENCODER 0 #define CONFIG_MP2FIXED_ENCODER 0 #define CONFIG_NELLYMOSER_ENCODER 0 +#define CONFIG_OPUS_ENCODER 0 #define CONFIG_RA_144_ENCODER 0 +#define CONFIG_SBC_ENCODER 0 #define CONFIG_SONIC_ENCODER 0 #define CONFIG_SONIC_LS_ENCODER 0 +#define CONFIG_TRUEHD_ENCODER 0 #define CONFIG_TTA_ENCODER 0 #define CONFIG_VORBIS_ENCODER 0 #define CONFIG_WAVPACK_ENCODER 0 @@ -1392,6 +1338,8 @@ #define CONFIG_PCM_S32BE_ENCODER 0 #define CONFIG_PCM_S32LE_ENCODER 0 #define CONFIG_PCM_S32LE_PLANAR_ENCODER 0 +#define CONFIG_PCM_S64BE_ENCODER 0 +#define CONFIG_PCM_S64LE_ENCODER 0 #define CONFIG_PCM_U8_ENCODER 0 #define CONFIG_PCM_U16BE_ENCODER 0 #define CONFIG_PCM_U16LE_ENCODER 0 @@ -1399,10 +1347,12 @@ #define CONFIG_PCM_U24LE_ENCODER 0 #define CONFIG_PCM_U32BE_ENCODER 0 #define CONFIG_PCM_U32LE_ENCODER 0 +#define CONFIG_PCM_VIDC_ENCODER 0 #define CONFIG_ROQ_DPCM_ENCODER 0 #define CONFIG_ADPCM_ADX_ENCODER 0 #define CONFIG_ADPCM_G722_ENCODER 0 #define CONFIG_ADPCM_G726_ENCODER 0 +#define CONFIG_ADPCM_G726LE_ENCODER 0 #define CONFIG_ADPCM_IMA_QT_ENCODER 0 #define CONFIG_ADPCM_IMA_WAV_ENCODER 0 #define CONFIG_ADPCM_MS_ENCODER 0 @@ -1415,9 +1365,16 @@ #define CONFIG_MOVTEXT_ENCODER 0 #define CONFIG_SRT_ENCODER 0 #define CONFIG_SUBRIP_ENCODER 0 +#define CONFIG_TEXT_ENCODER 0 #define CONFIG_WEBVTT_ENCODER 0 #define CONFIG_XSUB_ENCODER 0 -#define CONFIG_LIBFAAC_ENCODER 0 +#define CONFIG_AAC_AT_ENCODER 0 +#define CONFIG_ALAC_AT_ENCODER 0 +#define CONFIG_ILBC_AT_ENCODER 0 +#define CONFIG_PCM_ALAW_AT_ENCODER 0 +#define CONFIG_PCM_MULAW_AT_ENCODER 0 +#define CONFIG_LIBAOM_AV1_ENCODER 0 +#define CONFIG_LIBCODEC2_ENCODER 0 #define CONFIG_LIBFDK_AAC_ENCODER 0 #define CONFIG_LIBGSM_ENCODER 0 #define CONFIG_LIBGSM_MS_ENCODER 0 @@ -1426,13 +1383,10 @@ #define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0 #define CONFIG_LIBOPENJPEG_ENCODER 0 #define CONFIG_LIBOPUS_ENCODER 0 -#define CONFIG_LIBSCHROEDINGER_ENCODER 0 #define CONFIG_LIBSHINE_ENCODER 0 #define CONFIG_LIBSPEEX_ENCODER 0 #define CONFIG_LIBTHEORA_ENCODER 0 #define CONFIG_LIBTWOLAME_ENCODER 0 -#define CONFIG_LIBUTVIDEO_ENCODER 0 -#define CONFIG_LIBVO_AACENC_ENCODER 0 #define CONFIG_LIBVO_AMRWBENC_ENCODER 0 #define CONFIG_LIBVORBIS_ENCODER 0 #define CONFIG_LIBVPX_VP8_ENCODER 0 @@ -1445,30 +1399,203 @@ #define CONFIG_LIBX264RGB_ENCODER 0 #define CONFIG_LIBX265_ENCODER 0 #define CONFIG_LIBXAVS_ENCODER 0 +#define CONFIG_LIBXAVS2_ENCODER 0 #define CONFIG_LIBXVID_ENCODER 0 -#define CONFIG_LIBAACPLUS_ENCODER 0 +#define CONFIG_H263_V4L2M2M_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 +#define CONFIG_H264_AMF_ENCODER 0 +#define CONFIG_H264_NVENC_ENCODER 0 +#define CONFIG_H264_OMX_ENCODER 0 #define CONFIG_H264_QSV_ENCODER 0 +#define CONFIG_H264_V4L2M2M_ENCODER 0 +#define CONFIG_H264_VAAPI_ENCODER 0 +#define CONFIG_H264_VIDEOTOOLBOX_ENCODER 0 #define CONFIG_NVENC_ENCODER 0 #define CONFIG_NVENC_H264_ENCODER 0 #define CONFIG_NVENC_HEVC_ENCODER 0 +#define CONFIG_HEVC_AMF_ENCODER 0 +#define CONFIG_HEVC_NVENC_ENCODER 0 #define CONFIG_HEVC_QSV_ENCODER 0 +#define CONFIG_HEVC_V4L2M2M_ENCODER 0 +#define CONFIG_HEVC_VAAPI_ENCODER 0 +#define CONFIG_HEVC_VIDEOTOOLBOX_ENCODER 0 #define CONFIG_LIBKVAZAAR_ENCODER 0 +#define CONFIG_MJPEG_QSV_ENCODER 0 +#define CONFIG_MJPEG_VAAPI_ENCODER 0 #define CONFIG_MPEG2_QSV_ENCODER 0 +#define CONFIG_MPEG2_VAAPI_ENCODER 0 +#define CONFIG_MPEG4_V4L2M2M_ENCODER 0 +#define CONFIG_VP8_V4L2M2M_ENCODER 0 +#define CONFIG_VP8_VAAPI_ENCODER 0 +#define CONFIG_VP9_VAAPI_ENCODER 0 +#define CONFIG_H263_VAAPI_HWACCEL 0 +#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0 +#define CONFIG_H264_D3D11VA_HWACCEL 0 +#define CONFIG_H264_D3D11VA2_HWACCEL 0 +#define CONFIG_H264_DXVA2_HWACCEL 0 +#define CONFIG_H264_NVDEC_HWACCEL 0 +#define CONFIG_H264_VAAPI_HWACCEL 0 +#define CONFIG_H264_VDPAU_HWACCEL 0 +#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0 +#define CONFIG_HEVC_D3D11VA_HWACCEL 0 +#define CONFIG_HEVC_D3D11VA2_HWACCEL 0 +#define CONFIG_HEVC_DXVA2_HWACCEL 0 +#define CONFIG_HEVC_NVDEC_HWACCEL 0 +#define CONFIG_HEVC_VAAPI_HWACCEL 0 +#define CONFIG_HEVC_VDPAU_HWACCEL 0 +#define CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL 0 +#define CONFIG_MJPEG_NVDEC_HWACCEL 0 +#define CONFIG_MJPEG_VAAPI_HWACCEL 0 +#define CONFIG_MPEG1_NVDEC_HWACCEL 0 +#define CONFIG_MPEG1_VDPAU_HWACCEL 0 +#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 +#define CONFIG_MPEG1_XVMC_HWACCEL 0 +#define CONFIG_MPEG2_D3D11VA_HWACCEL 0 +#define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 +#define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_VAAPI_HWACCEL 0 +#define CONFIG_MPEG2_VDPAU_HWACCEL 0 +#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 +#define CONFIG_MPEG2_XVMC_HWACCEL 0 +#define CONFIG_MPEG4_NVDEC_HWACCEL 0 +#define CONFIG_MPEG4_VAAPI_HWACCEL 0 +#define CONFIG_MPEG4_VDPAU_HWACCEL 0 +#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0 +#define CONFIG_VC1_D3D11VA_HWACCEL 0 +#define CONFIG_VC1_D3D11VA2_HWACCEL 0 +#define CONFIG_VC1_DXVA2_HWACCEL 0 +#define CONFIG_VC1_NVDEC_HWACCEL 0 +#define CONFIG_VC1_VAAPI_HWACCEL 0 +#define CONFIG_VC1_VDPAU_HWACCEL 0 +#define CONFIG_VP8_NVDEC_HWACCEL 0 +#define CONFIG_VP8_VAAPI_HWACCEL 0 +#define CONFIG_VP9_D3D11VA_HWACCEL 0 +#define CONFIG_VP9_D3D11VA2_HWACCEL 0 +#define CONFIG_VP9_DXVA2_HWACCEL 0 +#define CONFIG_VP9_NVDEC_HWACCEL 0 +#define CONFIG_VP9_VAAPI_HWACCEL 0 +#define CONFIG_WMV3_D3D11VA_HWACCEL 0 +#define CONFIG_WMV3_D3D11VA2_HWACCEL 0 +#define CONFIG_WMV3_DXVA2_HWACCEL 0 +#define CONFIG_WMV3_NVDEC_HWACCEL 0 +#define CONFIG_WMV3_VAAPI_HWACCEL 0 +#define CONFIG_WMV3_VDPAU_HWACCEL 0 +#define CONFIG_AAC_PARSER 1 +#define CONFIG_AAC_LATM_PARSER 1 +#define CONFIG_AC3_PARSER 1 +#define CONFIG_ADX_PARSER 1 +#define CONFIG_AV1_PARSER 1 +#define CONFIG_AVS2_PARSER 1 +#define CONFIG_BMP_PARSER 1 +#define CONFIG_CAVSVIDEO_PARSER 1 +#define CONFIG_COOK_PARSER 1 +#define CONFIG_DCA_PARSER 1 +#define CONFIG_DIRAC_PARSER 1 +#define CONFIG_DNXHD_PARSER 1 +#define CONFIG_DPX_PARSER 1 +#define CONFIG_DVAUDIO_PARSER 1 +#define CONFIG_DVBSUB_PARSER 1 +#define CONFIG_DVDSUB_PARSER 1 +#define CONFIG_DVD_NAV_PARSER 1 +#define CONFIG_FLAC_PARSER 1 +#define CONFIG_G729_PARSER 1 +#define CONFIG_GSM_PARSER 1 +#define CONFIG_H261_PARSER 1 +#define CONFIG_H263_PARSER 1 +#define CONFIG_H264_PARSER 1 +#define CONFIG_HEVC_PARSER 1 +#define CONFIG_MJPEG_PARSER 1 +#define CONFIG_MLP_PARSER 1 +#define CONFIG_MPEG4VIDEO_PARSER 1 +#define CONFIG_MPEGAUDIO_PARSER 1 +#define CONFIG_MPEGVIDEO_PARSER 1 +#define CONFIG_OPUS_PARSER 1 +#define CONFIG_PNG_PARSER 1 +#define CONFIG_PNM_PARSER 1 +#define CONFIG_RV30_PARSER 1 +#define CONFIG_RV40_PARSER 1 +#define CONFIG_SBC_PARSER 1 +#define CONFIG_SIPR_PARSER 1 +#define CONFIG_TAK_PARSER 1 +#define CONFIG_VC1_PARSER 1 +#define CONFIG_VORBIS_PARSER 1 +#define CONFIG_VP3_PARSER 1 +#define CONFIG_VP8_PARSER 1 +#define CONFIG_VP9_PARSER 1 +#define CONFIG_XMA_PARSER 1 +#define CONFIG_ALSA_INDEV 0 +#define CONFIG_ANDROID_CAMERA_INDEV 0 +#define CONFIG_AVFOUNDATION_INDEV 0 +#define CONFIG_BKTR_INDEV 0 +#define CONFIG_DECKLINK_INDEV 0 +#define CONFIG_LIBNDI_NEWTEK_INDEV 0 +#define CONFIG_DSHOW_INDEV 0 +#define CONFIG_FBDEV_INDEV 0 +#define CONFIG_GDIGRAB_INDEV 0 +#define CONFIG_IEC61883_INDEV 0 +#define CONFIG_JACK_INDEV 0 +#define CONFIG_KMSGRAB_INDEV 0 +#define CONFIG_LAVFI_INDEV 0 +#define CONFIG_OPENAL_INDEV 0 +#define CONFIG_OSS_INDEV 0 +#define CONFIG_PULSE_INDEV 0 +#define CONFIG_SNDIO_INDEV 0 +#define CONFIG_V4L2_INDEV 0 +#define CONFIG_VFWCAP_INDEV 0 +#define CONFIG_XCBGRAB_INDEV 0 +#define CONFIG_LIBCDIO_INDEV 0 +#define CONFIG_LIBDC1394_INDEV 0 +#define CONFIG_ALSA_OUTDEV 0 +#define CONFIG_CACA_OUTDEV 0 +#define CONFIG_DECKLINK_OUTDEV 0 +#define CONFIG_LIBNDI_NEWTEK_OUTDEV 0 +#define CONFIG_FBDEV_OUTDEV 0 +#define CONFIG_OPENGL_OUTDEV 0 +#define CONFIG_OSS_OUTDEV 0 +#define CONFIG_PULSE_OUTDEV 0 +#define CONFIG_SDL2_OUTDEV 0 +#define CONFIG_SNDIO_OUTDEV 0 +#define CONFIG_V4L2_OUTDEV 0 +#define CONFIG_XV_OUTDEV 0 +#define CONFIG_ABENCH_FILTER 0 +#define CONFIG_ACOMPRESSOR_FILTER 0 +#define CONFIG_ACONTRAST_FILTER 0 +#define CONFIG_ACOPY_FILTER 0 +#define CONFIG_ACUE_FILTER 0 #define CONFIG_ACROSSFADE_FILTER 0 +#define CONFIG_ACROSSOVER_FILTER 0 +#define CONFIG_ACRUSHER_FILTER 0 +#define CONFIG_ADECLICK_FILTER 0 +#define CONFIG_ADECLIP_FILTER 0 #define CONFIG_ADELAY_FILTER 0 +#define CONFIG_ADERIVATIVE_FILTER 0 #define CONFIG_AECHO_FILTER 0 +#define CONFIG_AEMPHASIS_FILTER 0 #define CONFIG_AEVAL_FILTER 0 #define CONFIG_AFADE_FILTER 0 +#define CONFIG_AFFTDN_FILTER 0 +#define CONFIG_AFFTFILT_FILTER 0 +#define CONFIG_AFIR_FILTER 0 #define CONFIG_AFORMAT_FILTER 0 +#define CONFIG_AGATE_FILTER 0 +#define CONFIG_AIIR_FILTER 0 +#define CONFIG_AINTEGRAL_FILTER 0 #define CONFIG_AINTERLEAVE_FILTER 0 +#define CONFIG_ALIMITER_FILTER 0 #define CONFIG_ALLPASS_FILTER 0 +#define CONFIG_ALOOP_FILTER 0 #define CONFIG_AMERGE_FILTER 0 +#define CONFIG_AMETADATA_FILTER 0 #define CONFIG_AMIX_FILTER 0 +#define CONFIG_AMULTIPLY_FILTER 0 +#define CONFIG_ANEQUALIZER_FILTER 0 #define CONFIG_ANULL_FILTER 0 #define CONFIG_APAD_FILTER 0 #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 +#define CONFIG_APULSATOR_FILTER 0 +#define CONFIG_AREALTIME_FILTER 0 #define CONFIG_ARESAMPLE_FILTER 0 #define CONFIG_AREVERSE_FILTER 0 #define CONFIG_ASELECT_FILTER 0 @@ -1478,10 +1605,10 @@ #define CONFIG_ASETRATE_FILTER 0 #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 +#define CONFIG_ASIDEDATA_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 #define CONFIG_ASTATS_FILTER 0 -#define CONFIG_ASTREAMSYNC_FILTER 0 -#define CONFIG_ASYNCTS_FILTER 0 +#define CONFIG_ASTREAMSELECT_FILTER 0 #define CONFIG_ATEMPO_FILTER 0 #define CONFIG_ATRIM_FILTER 0 #define CONFIG_AZMQ_FILTER 0 @@ -1494,88 +1621,162 @@ #define CONFIG_CHANNELSPLIT_FILTER 0 #define CONFIG_CHORUS_FILTER 0 #define CONFIG_COMPAND_FILTER 0 +#define CONFIG_COMPENSATIONDELAY_FILTER 0 +#define CONFIG_CROSSFEED_FILTER 0 +#define CONFIG_CRYSTALIZER_FILTER 0 #define CONFIG_DCSHIFT_FILTER 0 +#define CONFIG_DRMETER_FILTER 0 #define CONFIG_DYNAUDNORM_FILTER 0 #define CONFIG_EARWAX_FILTER 0 #define CONFIG_EBUR128_FILTER 0 #define CONFIG_EQUALIZER_FILTER 0 +#define CONFIG_EXTRASTEREO_FILTER 0 +#define CONFIG_FIREQUALIZER_FILTER 0 #define CONFIG_FLANGER_FILTER 0 +#define CONFIG_HAAS_FILTER 0 +#define CONFIG_HDCD_FILTER 0 +#define CONFIG_HEADPHONE_FILTER 0 #define CONFIG_HIGHPASS_FILTER 0 +#define CONFIG_HIGHSHELF_FILTER 0 #define CONFIG_JOIN_FILTER 0 #define CONFIG_LADSPA_FILTER 0 +#define CONFIG_LOUDNORM_FILTER 0 #define CONFIG_LOWPASS_FILTER 0 +#define CONFIG_LOWSHELF_FILTER 0 +#define CONFIG_LV2_FILTER 0 +#define CONFIG_MCOMPAND_FILTER 0 #define CONFIG_PAN_FILTER 0 #define CONFIG_REPLAYGAIN_FILTER 0 #define CONFIG_RESAMPLE_FILTER 0 +#define CONFIG_RUBBERBAND_FILTER 0 #define CONFIG_SIDECHAINCOMPRESS_FILTER 0 +#define CONFIG_SIDECHAINGATE_FILTER 0 #define CONFIG_SILENCEDETECT_FILTER 0 #define CONFIG_SILENCEREMOVE_FILTER 0 +#define CONFIG_SOFALIZER_FILTER 0 +#define CONFIG_STEREOTOOLS_FILTER 0 +#define CONFIG_STEREOWIDEN_FILTER 0 +#define CONFIG_SUPEREQUALIZER_FILTER 0 +#define CONFIG_SURROUND_FILTER 0 #define CONFIG_TREBLE_FILTER 0 +#define CONFIG_TREMOLO_FILTER 0 +#define CONFIG_VIBRATO_FILTER 0 #define CONFIG_VOLUME_FILTER 0 #define CONFIG_VOLUMEDETECT_FILTER 0 #define CONFIG_AEVALSRC_FILTER 0 +#define CONFIG_ANOISESRC_FILTER 0 #define CONFIG_ANULLSRC_FILTER 0 #define CONFIG_FLITE_FILTER 0 +#define CONFIG_HILBERT_FILTER 0 +#define CONFIG_SINC_FILTER 0 #define CONFIG_SINE_FILTER 0 #define CONFIG_ANULLSINK_FILTER 0 #define CONFIG_ALPHAEXTRACT_FILTER 0 #define CONFIG_ALPHAMERGE_FILTER 0 +#define CONFIG_AMPLIFY_FILTER 0 #define CONFIG_ASS_FILTER 0 +#define CONFIG_ATADENOISE_FILTER 0 +#define CONFIG_AVGBLUR_FILTER 0 +#define CONFIG_AVGBLUR_OPENCL_FILTER 0 #define CONFIG_BBOX_FILTER 0 +#define CONFIG_BENCH_FILTER 0 +#define CONFIG_BITPLANENOISE_FILTER 0 #define CONFIG_BLACKDETECT_FILTER 0 #define CONFIG_BLACKFRAME_FILTER 0 #define CONFIG_BLEND_FILTER 0 +#define CONFIG_BM3D_FILTER 0 #define CONFIG_BOXBLUR_FILTER 0 +#define CONFIG_BOXBLUR_OPENCL_FILTER 0 +#define CONFIG_BWDIF_FILTER 0 +#define CONFIG_CHROMAHOLD_FILTER 0 +#define CONFIG_CHROMAKEY_FILTER 0 +#define CONFIG_CHROMASHIFT_FILTER 0 +#define CONFIG_CIESCOPE_FILTER 0 #define CONFIG_CODECVIEW_FILTER 0 #define CONFIG_COLORBALANCE_FILTER 0 #define CONFIG_COLORCHANNELMIXER_FILTER 0 #define CONFIG_COLORKEY_FILTER 0 #define CONFIG_COLORLEVELS_FILTER 0 #define CONFIG_COLORMATRIX_FILTER 0 +#define CONFIG_COLORSPACE_FILTER 0 +#define CONFIG_CONVOLUTION_FILTER 0 +#define CONFIG_CONVOLUTION_OPENCL_FILTER 0 +#define CONFIG_CONVOLVE_FILTER 0 #define CONFIG_COPY_FILTER 0 +#define CONFIG_COREIMAGE_FILTER 0 #define CONFIG_COVER_RECT_FILTER 0 #define CONFIG_CROP_FILTER 0 #define CONFIG_CROPDETECT_FILTER 0 +#define CONFIG_CUE_FILTER 0 #define CONFIG_CURVES_FILTER 0 +#define CONFIG_DATASCOPE_FILTER 0 #define CONFIG_DCTDNOIZ_FILTER 0 #define CONFIG_DEBAND_FILTER 0 +#define CONFIG_DEBLOCK_FILTER 0 #define CONFIG_DECIMATE_FILTER 0 +#define CONFIG_DECONVOLVE_FILTER 0 +#define CONFIG_DEDOT_FILTER 0 #define CONFIG_DEFLATE_FILTER 0 +#define CONFIG_DEFLICKER_FILTER 0 +#define CONFIG_DEINTERLACE_QSV_FILTER 0 +#define CONFIG_DEINTERLACE_VAAPI_FILTER 0 #define CONFIG_DEJUDDER_FILTER 0 #define CONFIG_DELOGO_FILTER 0 +#define CONFIG_DENOISE_VAAPI_FILTER 0 #define CONFIG_DESHAKE_FILTER 0 +#define CONFIG_DESPILL_FILTER 0 #define CONFIG_DETELECINE_FILTER 0 #define CONFIG_DILATION_FILTER 0 +#define CONFIG_DILATION_OPENCL_FILTER 0 +#define CONFIG_DISPLACE_FILTER 0 +#define CONFIG_DOUBLEWEAVE_FILTER 0 #define CONFIG_DRAWBOX_FILTER 0 #define CONFIG_DRAWGRAPH_FILTER 0 #define CONFIG_DRAWGRID_FILTER 0 #define CONFIG_DRAWTEXT_FILTER 0 #define CONFIG_EDGEDETECT_FILTER 0 #define CONFIG_ELBG_FILTER 0 +#define CONFIG_ENTROPY_FILTER 0 #define CONFIG_EQ_FILTER 0 #define CONFIG_EROSION_FILTER 0 +#define CONFIG_EROSION_OPENCL_FILTER 0 #define CONFIG_EXTRACTPLANES_FILTER 0 #define CONFIG_FADE_FILTER 0 +#define CONFIG_FFTDNOIZ_FILTER 0 #define CONFIG_FFTFILT_FILTER 0 #define CONFIG_FIELD_FILTER 0 +#define CONFIG_FIELDHINT_FILTER 0 #define CONFIG_FIELDMATCH_FILTER 0 #define CONFIG_FIELDORDER_FILTER 0 +#define CONFIG_FILLBORDERS_FILTER 0 #define CONFIG_FIND_RECT_FILTER 0 +#define CONFIG_FLOODFILL_FILTER 0 #define CONFIG_FORMAT_FILTER 0 #define CONFIG_FPS_FILTER 0 #define CONFIG_FRAMEPACK_FILTER 0 +#define CONFIG_FRAMERATE_FILTER 0 #define CONFIG_FRAMESTEP_FILTER 0 +#define CONFIG_FREEZEDETECT_FILTER 0 #define CONFIG_FREI0R_FILTER 0 #define CONFIG_FSPP_FILTER 0 +#define CONFIG_GBLUR_FILTER 0 #define CONFIG_GEQ_FILTER 0 #define CONFIG_GRADFUN_FILTER 0 +#define CONFIG_GRAPHMONITOR_FILTER 0 +#define CONFIG_GREYEDGE_FILTER 0 #define CONFIG_HALDCLUT_FILTER 0 #define CONFIG_HFLIP_FILTER 0 #define CONFIG_HISTEQ_FILTER 0 #define CONFIG_HISTOGRAM_FILTER 0 #define CONFIG_HQDN3D_FILTER 0 #define CONFIG_HQX_FILTER 0 +#define CONFIG_HSTACK_FILTER 0 #define CONFIG_HUE_FILTER 0 +#define CONFIG_HWDOWNLOAD_FILTER 0 +#define CONFIG_HWMAP_FILTER 0 +#define CONFIG_HWUPLOAD_FILTER 0 +#define CONFIG_HWUPLOAD_CUDA_FILTER 0 +#define CONFIG_HYSTERESIS_FILTER 0 #define CONFIG_IDET_FILTER 0 #define CONFIG_IL_FILTER 0 #define CONFIG_INFLATE_FILTER 0 @@ -1583,19 +1784,40 @@ #define CONFIG_INTERLEAVE_FILTER 0 #define CONFIG_KERNDEINT_FILTER 0 #define CONFIG_LENSCORRECTION_FILTER 0 -#define CONFIG_LUT3D_FILTER 0 +#define CONFIG_LENSFUN_FILTER 0 +#define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIMITER_FILTER 0 +#define CONFIG_LOOP_FILTER 0 +#define CONFIG_LUMAKEY_FILTER 0 #define CONFIG_LUT_FILTER 0 +#define CONFIG_LUT1D_FILTER 0 +#define CONFIG_LUT2_FILTER 0 +#define CONFIG_LUT3D_FILTER 0 #define CONFIG_LUTRGB_FILTER 0 #define CONFIG_LUTYUV_FILTER 0 +#define CONFIG_MASKEDCLAMP_FILTER 0 +#define CONFIG_MASKEDMERGE_FILTER 0 #define CONFIG_MCDEINT_FILTER 0 #define CONFIG_MERGEPLANES_FILTER 0 +#define CONFIG_MESTIMATE_FILTER 0 +#define CONFIG_METADATA_FILTER 0 +#define CONFIG_MIDEQUALIZER_FILTER 0 +#define CONFIG_MINTERPOLATE_FILTER 0 +#define CONFIG_MIX_FILTER 0 #define CONFIG_MPDECIMATE_FILTER 0 #define CONFIG_NEGATE_FILTER 0 +#define CONFIG_NLMEANS_FILTER 0 +#define CONFIG_NNEDI_FILTER 0 #define CONFIG_NOFORMAT_FILTER 0 #define CONFIG_NOISE_FILTER 0 +#define CONFIG_NORMALIZE_FILTER 0 #define CONFIG_NULL_FILTER 0 +#define CONFIG_OCR_FILTER 0 #define CONFIG_OCV_FILTER 0 +#define CONFIG_OSCILLOSCOPE_FILTER 0 #define CONFIG_OVERLAY_FILTER 0 +#define CONFIG_OVERLAY_OPENCL_FILTER 0 +#define CONFIG_OVERLAY_QSV_FILTER 0 #define CONFIG_OWDENOISE_FILTER 0 #define CONFIG_PAD_FILTER 0 #define CONFIG_PALETTEGEN_FILTER 0 @@ -1604,135 +1826,445 @@ #define CONFIG_PERSPECTIVE_FILTER 0 #define CONFIG_PHASE_FILTER 0 #define CONFIG_PIXDESCTEST_FILTER 0 +#define CONFIG_PIXSCOPE_FILTER 0 #define CONFIG_PP_FILTER 0 #define CONFIG_PP7_FILTER 0 +#define CONFIG_PREMULTIPLY_FILTER 0 +#define CONFIG_PREWITT_FILTER 0 +#define CONFIG_PREWITT_OPENCL_FILTER 0 +#define CONFIG_PROCAMP_VAAPI_FILTER 0 +#define CONFIG_PROGRAM_OPENCL_FILTER 0 +#define CONFIG_PSEUDOCOLOR_FILTER 0 #define CONFIG_PSNR_FILTER 0 #define CONFIG_PULLUP_FILTER 0 #define CONFIG_QP_FILTER 0 #define CONFIG_RANDOM_FILTER 0 +#define CONFIG_READEIA608_FILTER 0 +#define CONFIG_READVITC_FILTER 0 +#define CONFIG_REALTIME_FILTER 0 +#define CONFIG_REMAP_FILTER 0 #define CONFIG_REMOVEGRAIN_FILTER 0 #define CONFIG_REMOVELOGO_FILTER 0 #define CONFIG_REPEATFIELDS_FILTER 0 #define CONFIG_REVERSE_FILTER 0 +#define CONFIG_RGBASHIFT_FILTER 0 +#define CONFIG_ROBERTS_FILTER 0 +#define CONFIG_ROBERTS_OPENCL_FILTER 0 #define CONFIG_ROTATE_FILTER 0 #define CONFIG_SAB_FILTER 0 #define CONFIG_SCALE_FILTER 0 +#define CONFIG_SCALE_CUDA_FILTER 0 +#define CONFIG_SCALE_NPP_FILTER 0 +#define CONFIG_SCALE_QSV_FILTER 0 +#define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SELECT_FILTER 0 +#define CONFIG_SELECTIVECOLOR_FILTER 0 #define CONFIG_SENDCMD_FILTER 0 #define CONFIG_SEPARATEFIELDS_FILTER 0 #define CONFIG_SETDAR_FILTER 0 #define CONFIG_SETFIELD_FILTER 0 +#define CONFIG_SETPARAMS_FILTER 0 #define CONFIG_SETPTS_FILTER 0 +#define CONFIG_SETRANGE_FILTER 0 #define CONFIG_SETSAR_FILTER 0 #define CONFIG_SETTB_FILTER 0 +#define CONFIG_SHARPNESS_VAAPI_FILTER 0 #define CONFIG_SHOWINFO_FILTER 0 #define CONFIG_SHOWPALETTE_FILTER 0 +#define CONFIG_SHUFFLEFRAMES_FILTER 0 #define CONFIG_SHUFFLEPLANES_FILTER 0 +#define CONFIG_SIDEDATA_FILTER 0 #define CONFIG_SIGNALSTATS_FILTER 0 +#define CONFIG_SIGNATURE_FILTER 0 #define CONFIG_SMARTBLUR_FILTER 0 +#define CONFIG_SOBEL_FILTER 0 +#define CONFIG_SOBEL_OPENCL_FILTER 0 #define CONFIG_SPLIT_FILTER 0 #define CONFIG_SPP_FILTER 0 +#define CONFIG_SR_FILTER 0 #define CONFIG_SSIM_FILTER 0 #define CONFIG_STEREO3D_FILTER 0 +#define CONFIG_STREAMSELECT_FILTER 0 #define CONFIG_SUBTITLES_FILTER 0 #define CONFIG_SUPER2XSAI_FILTER 0 +#define CONFIG_SWAPRECT_FILTER 0 #define CONFIG_SWAPUV_FILTER 0 #define CONFIG_TBLEND_FILTER 0 #define CONFIG_TELECINE_FILTER 0 +#define CONFIG_THRESHOLD_FILTER 0 #define CONFIG_THUMBNAIL_FILTER 0 +#define CONFIG_THUMBNAIL_CUDA_FILTER 0 #define CONFIG_TILE_FILTER 0 #define CONFIG_TINTERLACE_FILTER 0 +#define CONFIG_TLUT2_FILTER 0 +#define CONFIG_TMIX_FILTER 0 +#define CONFIG_TONEMAP_FILTER 0 +#define CONFIG_TONEMAP_OPENCL_FILTER 0 +#define CONFIG_TPAD_FILTER 0 #define CONFIG_TRANSPOSE_FILTER 0 +#define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRIM_FILTER 0 +#define CONFIG_UNPREMULTIPLY_FILTER 0 #define CONFIG_UNSHARP_FILTER 0 +#define CONFIG_UNSHARP_OPENCL_FILTER 0 #define CONFIG_USPP_FILTER 0 +#define CONFIG_VAGUEDENOISER_FILTER 0 +#define CONFIG_VECTORSCOPE_FILTER 0 #define CONFIG_VFLIP_FILTER 0 +#define CONFIG_VFRDET_FILTER 0 +#define CONFIG_VIBRANCE_FILTER 0 #define CONFIG_VIDSTABDETECT_FILTER 0 #define CONFIG_VIDSTABTRANSFORM_FILTER 0 #define CONFIG_VIGNETTE_FILTER 0 +#define CONFIG_VMAFMOTION_FILTER 0 +#define CONFIG_VPP_QSV_FILTER 0 +#define CONFIG_VSTACK_FILTER 0 #define CONFIG_W3FDIF_FILTER 0 +#define CONFIG_WAVEFORM_FILTER 0 +#define CONFIG_WEAVE_FILTER 0 #define CONFIG_XBR_FILTER 0 +#define CONFIG_XSTACK_FILTER 0 #define CONFIG_YADIF_FILTER 0 +#define CONFIG_YADIF_CUDA_FILTER 0 #define CONFIG_ZMQ_FILTER 0 #define CONFIG_ZOOMPAN_FILTER 0 +#define CONFIG_ZSCALE_FILTER 0 +#define CONFIG_ALLRGB_FILTER 0 +#define CONFIG_ALLYUV_FILTER 0 #define CONFIG_CELLAUTO_FILTER 0 #define CONFIG_COLOR_FILTER 0 +#define CONFIG_COREIMAGESRC_FILTER 0 #define CONFIG_FREI0R_SRC_FILTER 0 #define CONFIG_HALDCLUTSRC_FILTER 0 #define CONFIG_LIFE_FILTER 0 #define CONFIG_MANDELBROT_FILTER 0 #define CONFIG_MPTESTSRC_FILTER 0 #define CONFIG_NULLSRC_FILTER 0 +#define CONFIG_OPENCLSRC_FILTER 0 +#define CONFIG_PAL75BARS_FILTER 0 +#define CONFIG_PAL100BARS_FILTER 0 #define CONFIG_RGBTESTSRC_FILTER 0 #define CONFIG_SMPTEBARS_FILTER 0 #define CONFIG_SMPTEHDBARS_FILTER 0 #define CONFIG_TESTSRC_FILTER 0 +#define CONFIG_TESTSRC2_FILTER 0 +#define CONFIG_YUVTESTSRC_FILTER 0 #define CONFIG_NULLSINK_FILTER 0 +#define CONFIG_ABITSCOPE_FILTER 0 #define CONFIG_ADRAWGRAPH_FILTER 0 +#define CONFIG_AGRAPHMONITOR_FILTER 0 +#define CONFIG_AHISTOGRAM_FILTER 0 +#define CONFIG_APHASEMETER_FILTER 0 #define CONFIG_AVECTORSCOPE_FILTER 0 #define CONFIG_CONCAT_FILTER 0 #define CONFIG_SHOWCQT_FILTER 0 +#define CONFIG_SHOWFREQS_FILTER 0 #define CONFIG_SHOWSPECTRUM_FILTER 0 +#define CONFIG_SHOWSPECTRUMPIC_FILTER 0 #define CONFIG_SHOWVOLUME_FILTER 0 #define CONFIG_SHOWWAVES_FILTER 0 #define CONFIG_SHOWWAVESPIC_FILTER 0 +#define CONFIG_SPECTRUMSYNTH_FILTER 0 #define CONFIG_AMOVIE_FILTER 0 #define CONFIG_MOVIE_FILTER 0 -#define CONFIG_H263_VAAPI_HWACCEL 0 -#define CONFIG_H263_VDPAU_HWACCEL 0 -#define CONFIG_H264_D3D11VA_HWACCEL 0 -#define CONFIG_H264_DXVA2_HWACCEL 0 -#define CONFIG_H264_MMAL_HWACCEL 0 -#define CONFIG_H264_QSV_HWACCEL 0 -#define CONFIG_H264_VAAPI_HWACCEL 0 -#define CONFIG_H264_VDA_HWACCEL 0 -#define CONFIG_H264_VDA_OLD_HWACCEL 0 -#define CONFIG_H264_VDPAU_HWACCEL 0 -#define CONFIG_HEVC_D3D11VA_HWACCEL 0 -#define CONFIG_HEVC_DXVA2_HWACCEL 0 -#define CONFIG_HEVC_QSV_HWACCEL 0 -#define CONFIG_HEVC_VDPAU_HWACCEL 0 -#define CONFIG_MPEG1_XVMC_HWACCEL 0 -#define CONFIG_MPEG1_VDPAU_HWACCEL 0 -#define CONFIG_MPEG2_XVMC_HWACCEL 0 -#define CONFIG_MPEG2_D3D11VA_HWACCEL 0 -#define CONFIG_MPEG2_DXVA2_HWACCEL 0 -#define CONFIG_MPEG2_QSV_HWACCEL 0 -#define CONFIG_MPEG2_VAAPI_HWACCEL 0 -#define CONFIG_MPEG2_VDPAU_HWACCEL 0 -#define CONFIG_MPEG4_VAAPI_HWACCEL 0 -#define CONFIG_MPEG4_VDPAU_HWACCEL 0 -#define CONFIG_VC1_D3D11VA_HWACCEL 0 -#define CONFIG_VC1_DXVA2_HWACCEL 0 -#define CONFIG_VC1_VAAPI_HWACCEL 0 -#define CONFIG_VC1_VDPAU_HWACCEL 0 -#define CONFIG_VC1_QSV_HWACCEL 0 -#define CONFIG_WMV3_D3D11VA_HWACCEL 0 -#define CONFIG_WMV3_DXVA2_HWACCEL 0 -#define CONFIG_WMV3_VAAPI_HWACCEL 0 -#define CONFIG_WMV3_VDPAU_HWACCEL 0 -#define CONFIG_ALSA_INDEV 0 -#define CONFIG_AVFOUNDATION_INDEV 0 -#define CONFIG_BKTR_INDEV 0 -#define CONFIG_DECKLINK_INDEV 0 -#define CONFIG_DSHOW_INDEV 0 -#define CONFIG_DV1394_INDEV 0 -#define CONFIG_FBDEV_INDEV 0 -#define CONFIG_GDIGRAB_INDEV 0 -#define CONFIG_IEC61883_INDEV 0 -#define CONFIG_JACK_INDEV 0 -#define CONFIG_LAVFI_INDEV 0 -#define CONFIG_OPENAL_INDEV 0 -#define CONFIG_OSS_INDEV 0 -#define CONFIG_PULSE_INDEV 0 -#define CONFIG_QTKIT_INDEV 0 -#define CONFIG_SNDIO_INDEV 0 -#define CONFIG_V4L2_INDEV 0 -#define CONFIG_VFWCAP_INDEV 0 -#define CONFIG_X11GRAB_INDEV 0 -#define CONFIG_X11GRAB_XCB_INDEV 0 -#define CONFIG_LIBCDIO_INDEV 0 -#define CONFIG_LIBDC1394_INDEV 0 +#define CONFIG_AFIFO_FILTER 0 +#define CONFIG_FIFO_FILTER 0 +#define CONFIG_AA_DEMUXER 1 +#define CONFIG_AAC_DEMUXER 1 +#define CONFIG_AC3_DEMUXER 1 +#define CONFIG_ACM_DEMUXER 1 +#define CONFIG_ACT_DEMUXER 1 +#define CONFIG_ADF_DEMUXER 1 +#define CONFIG_ADP_DEMUXER 1 +#define CONFIG_ADS_DEMUXER 1 +#define CONFIG_ADX_DEMUXER 1 +#define CONFIG_AEA_DEMUXER 1 +#define CONFIG_AFC_DEMUXER 1 +#define CONFIG_AIFF_DEMUXER 1 +#define CONFIG_AIX_DEMUXER 1 +#define CONFIG_AMR_DEMUXER 1 +#define CONFIG_AMRNB_DEMUXER 1 +#define CONFIG_AMRWB_DEMUXER 1 +#define CONFIG_ANM_DEMUXER 1 +#define CONFIG_APC_DEMUXER 1 +#define CONFIG_APE_DEMUXER 1 +#define CONFIG_APNG_DEMUXER 1 +#define CONFIG_APTX_DEMUXER 1 +#define CONFIG_APTX_HD_DEMUXER 1 +#define CONFIG_AQTITLE_DEMUXER 1 +#define CONFIG_ASF_DEMUXER 1 +#define CONFIG_ASF_O_DEMUXER 1 +#define CONFIG_ASS_DEMUXER 1 +#define CONFIG_AST_DEMUXER 1 +#define CONFIG_AU_DEMUXER 1 +#define CONFIG_AVI_DEMUXER 1 +#define CONFIG_AVISYNTH_DEMUXER 0 +#define CONFIG_AVR_DEMUXER 1 +#define CONFIG_AVS_DEMUXER 1 +#define CONFIG_AVS2_DEMUXER 1 +#define CONFIG_BETHSOFTVID_DEMUXER 1 +#define CONFIG_BFI_DEMUXER 1 +#define CONFIG_BINTEXT_DEMUXER 1 +#define CONFIG_BINK_DEMUXER 1 +#define CONFIG_BIT_DEMUXER 1 +#define CONFIG_BMV_DEMUXER 1 +#define CONFIG_BFSTM_DEMUXER 1 +#define CONFIG_BRSTM_DEMUXER 1 +#define CONFIG_BOA_DEMUXER 1 +#define CONFIG_C93_DEMUXER 1 +#define CONFIG_CAF_DEMUXER 1 +#define CONFIG_CAVSVIDEO_DEMUXER 1 +#define CONFIG_CDG_DEMUXER 1 +#define CONFIG_CDXL_DEMUXER 1 +#define CONFIG_CINE_DEMUXER 1 +#define CONFIG_CODEC2_DEMUXER 1 +#define CONFIG_CODEC2RAW_DEMUXER 1 +#define CONFIG_CONCAT_DEMUXER 1 +#define CONFIG_DASH_DEMUXER 0 +#define CONFIG_DATA_DEMUXER 1 +#define CONFIG_DAUD_DEMUXER 1 +#define CONFIG_DCSTR_DEMUXER 1 +#define CONFIG_DFA_DEMUXER 1 +#define CONFIG_DIRAC_DEMUXER 1 +#define CONFIG_DNXHD_DEMUXER 1 +#define CONFIG_DSF_DEMUXER 1 +#define CONFIG_DSICIN_DEMUXER 1 +#define CONFIG_DSS_DEMUXER 1 +#define CONFIG_DTS_DEMUXER 1 +#define CONFIG_DTSHD_DEMUXER 1 +#define CONFIG_DV_DEMUXER 1 +#define CONFIG_DVBSUB_DEMUXER 1 +#define CONFIG_DVBTXT_DEMUXER 1 +#define CONFIG_DXA_DEMUXER 1 +#define CONFIG_EA_DEMUXER 1 +#define CONFIG_EA_CDATA_DEMUXER 1 +#define CONFIG_EAC3_DEMUXER 1 +#define CONFIG_EPAF_DEMUXER 1 +#define CONFIG_FFMETADATA_DEMUXER 1 +#define CONFIG_FILMSTRIP_DEMUXER 1 +#define CONFIG_FITS_DEMUXER 1 +#define CONFIG_FLAC_DEMUXER 1 +#define CONFIG_FLIC_DEMUXER 1 +#define CONFIG_FLV_DEMUXER 1 +#define CONFIG_LIVE_FLV_DEMUXER 1 +#define CONFIG_FOURXM_DEMUXER 1 +#define CONFIG_FRM_DEMUXER 1 +#define CONFIG_FSB_DEMUXER 1 +#define CONFIG_G722_DEMUXER 1 +#define CONFIG_G723_1_DEMUXER 1 +#define CONFIG_G726_DEMUXER 1 +#define CONFIG_G726LE_DEMUXER 1 +#define CONFIG_G729_DEMUXER 1 +#define CONFIG_GDV_DEMUXER 1 +#define CONFIG_GENH_DEMUXER 1 +#define CONFIG_GIF_DEMUXER 1 +#define CONFIG_GSM_DEMUXER 1 +#define CONFIG_GXF_DEMUXER 1 +#define CONFIG_H261_DEMUXER 1 +#define CONFIG_H263_DEMUXER 1 +#define CONFIG_H264_DEMUXER 1 +#define CONFIG_HEVC_DEMUXER 1 +#define CONFIG_HLS_DEMUXER 1 +#define CONFIG_HNM_DEMUXER 1 +#define CONFIG_ICO_DEMUXER 1 +#define CONFIG_IDCIN_DEMUXER 1 +#define CONFIG_IDF_DEMUXER 1 +#define CONFIG_IFF_DEMUXER 1 +#define CONFIG_ILBC_DEMUXER 1 +#define CONFIG_IMAGE2_DEMUXER 1 +#define CONFIG_IMAGE2PIPE_DEMUXER 1 +#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 1 +#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 1 +#define CONFIG_INGENIENT_DEMUXER 1 +#define CONFIG_IPMOVIE_DEMUXER 1 +#define CONFIG_IRCAM_DEMUXER 1 +#define CONFIG_ISS_DEMUXER 1 +#define CONFIG_IV8_DEMUXER 1 +#define CONFIG_IVF_DEMUXER 1 +#define CONFIG_IVR_DEMUXER 1 +#define CONFIG_JACOSUB_DEMUXER 1 +#define CONFIG_JV_DEMUXER 1 +#define CONFIG_LMLM4_DEMUXER 1 +#define CONFIG_LOAS_DEMUXER 1 +#define CONFIG_LRC_DEMUXER 1 +#define CONFIG_LVF_DEMUXER 1 +#define CONFIG_LXF_DEMUXER 1 +#define CONFIG_M4V_DEMUXER 1 +#define CONFIG_MATROSKA_DEMUXER 1 +#define CONFIG_MGSTS_DEMUXER 1 +#define CONFIG_MICRODVD_DEMUXER 1 +#define CONFIG_MJPEG_DEMUXER 1 +#define CONFIG_MJPEG_2000_DEMUXER 1 +#define CONFIG_MLP_DEMUXER 1 +#define CONFIG_MLV_DEMUXER 1 +#define CONFIG_MM_DEMUXER 1 +#define CONFIG_MMF_DEMUXER 1 +#define CONFIG_MOV_DEMUXER 1 +#define CONFIG_MP3_DEMUXER 1 +#define CONFIG_MPC_DEMUXER 1 +#define CONFIG_MPC8_DEMUXER 1 +#define CONFIG_MPEGPS_DEMUXER 1 +#define CONFIG_MPEGTS_DEMUXER 1 +#define CONFIG_MPEGTSRAW_DEMUXER 1 +#define CONFIG_MPEGVIDEO_DEMUXER 1 +#define CONFIG_MPJPEG_DEMUXER 1 +#define CONFIG_MPL2_DEMUXER 1 +#define CONFIG_MPSUB_DEMUXER 1 +#define CONFIG_MSF_DEMUXER 1 +#define CONFIG_MSNWC_TCP_DEMUXER 1 +#define CONFIG_MTAF_DEMUXER 1 +#define CONFIG_MTV_DEMUXER 1 +#define CONFIG_MUSX_DEMUXER 1 +#define CONFIG_MV_DEMUXER 1 +#define CONFIG_MVI_DEMUXER 1 +#define CONFIG_MXF_DEMUXER 1 +#define CONFIG_MXG_DEMUXER 1 +#define CONFIG_NC_DEMUXER 1 +#define CONFIG_NISTSPHERE_DEMUXER 1 +#define CONFIG_NSP_DEMUXER 1 +#define CONFIG_NSV_DEMUXER 1 +#define CONFIG_NUT_DEMUXER 1 +#define CONFIG_NUV_DEMUXER 1 +#define CONFIG_OGG_DEMUXER 1 +#define CONFIG_OMA_DEMUXER 1 +#define CONFIG_PAF_DEMUXER 1 +#define CONFIG_PCM_ALAW_DEMUXER 1 +#define CONFIG_PCM_MULAW_DEMUXER 1 +#define CONFIG_PCM_VIDC_DEMUXER 1 +#define CONFIG_PCM_F64BE_DEMUXER 1 +#define CONFIG_PCM_F64LE_DEMUXER 1 +#define CONFIG_PCM_F32BE_DEMUXER 1 +#define CONFIG_PCM_F32LE_DEMUXER 1 +#define CONFIG_PCM_S32BE_DEMUXER 1 +#define CONFIG_PCM_S32LE_DEMUXER 1 +#define CONFIG_PCM_S24BE_DEMUXER 1 +#define CONFIG_PCM_S24LE_DEMUXER 1 +#define CONFIG_PCM_S16BE_DEMUXER 1 +#define CONFIG_PCM_S16LE_DEMUXER 1 +#define CONFIG_PCM_S8_DEMUXER 1 +#define CONFIG_PCM_U32BE_DEMUXER 1 +#define CONFIG_PCM_U32LE_DEMUXER 1 +#define CONFIG_PCM_U24BE_DEMUXER 1 +#define CONFIG_PCM_U24LE_DEMUXER 1 +#define CONFIG_PCM_U16BE_DEMUXER 1 +#define CONFIG_PCM_U16LE_DEMUXER 1 +#define CONFIG_PCM_U8_DEMUXER 1 +#define CONFIG_PJS_DEMUXER 1 +#define CONFIG_PMP_DEMUXER 1 +#define CONFIG_PVA_DEMUXER 1 +#define CONFIG_PVF_DEMUXER 1 +#define CONFIG_QCP_DEMUXER 1 +#define CONFIG_R3D_DEMUXER 1 +#define CONFIG_RAWVIDEO_DEMUXER 1 +#define CONFIG_REALTEXT_DEMUXER 1 +#define CONFIG_REDSPARK_DEMUXER 1 +#define CONFIG_RL2_DEMUXER 1 +#define CONFIG_RM_DEMUXER 1 +#define CONFIG_ROQ_DEMUXER 1 +#define CONFIG_RPL_DEMUXER 1 +#define CONFIG_RSD_DEMUXER 1 +#define CONFIG_RSO_DEMUXER 1 +#define CONFIG_RTP_DEMUXER 0 +#define CONFIG_RTSP_DEMUXER 0 +#define CONFIG_S337M_DEMUXER 1 +#define CONFIG_SAMI_DEMUXER 1 +#define CONFIG_SAP_DEMUXER 0 +#define CONFIG_SBC_DEMUXER 1 +#define CONFIG_SBG_DEMUXER 1 +#define CONFIG_SCC_DEMUXER 1 +#define CONFIG_SDP_DEMUXER 0 +#define CONFIG_SDR2_DEMUXER 1 +#define CONFIG_SDS_DEMUXER 1 +#define CONFIG_SDX_DEMUXER 1 +#define CONFIG_SEGAFILM_DEMUXER 1 +#define CONFIG_SER_DEMUXER 1 +#define CONFIG_SHORTEN_DEMUXER 1 +#define CONFIG_SIFF_DEMUXER 1 +#define CONFIG_SLN_DEMUXER 1 +#define CONFIG_SMACKER_DEMUXER 1 +#define CONFIG_SMJPEG_DEMUXER 1 +#define CONFIG_SMUSH_DEMUXER 1 +#define CONFIG_SOL_DEMUXER 1 +#define CONFIG_SOX_DEMUXER 1 +#define CONFIG_SPDIF_DEMUXER 1 +#define CONFIG_SRT_DEMUXER 1 +#define CONFIG_STR_DEMUXER 1 +#define CONFIG_STL_DEMUXER 1 +#define CONFIG_SUBVIEWER1_DEMUXER 1 +#define CONFIG_SUBVIEWER_DEMUXER 1 +#define CONFIG_SUP_DEMUXER 1 +#define CONFIG_SVAG_DEMUXER 1 +#define CONFIG_SWF_DEMUXER 1 +#define CONFIG_TAK_DEMUXER 1 +#define CONFIG_TEDCAPTIONS_DEMUXER 1 +#define CONFIG_THP_DEMUXER 1 +#define CONFIG_THREEDOSTR_DEMUXER 1 +#define CONFIG_TIERTEXSEQ_DEMUXER 1 +#define CONFIG_TMV_DEMUXER 1 +#define CONFIG_TRUEHD_DEMUXER 1 +#define CONFIG_TTA_DEMUXER 1 +#define CONFIG_TXD_DEMUXER 1 +#define CONFIG_TTY_DEMUXER 1 +#define CONFIG_TY_DEMUXER 1 +#define CONFIG_V210_DEMUXER 1 +#define CONFIG_V210X_DEMUXER 1 +#define CONFIG_VAG_DEMUXER 1 +#define CONFIG_VC1_DEMUXER 1 +#define CONFIG_VC1T_DEMUXER 1 +#define CONFIG_VIVO_DEMUXER 1 +#define CONFIG_VMD_DEMUXER 1 +#define CONFIG_VOBSUB_DEMUXER 1 +#define CONFIG_VOC_DEMUXER 1 +#define CONFIG_VPK_DEMUXER 1 +#define CONFIG_VPLAYER_DEMUXER 1 +#define CONFIG_VQF_DEMUXER 1 +#define CONFIG_W64_DEMUXER 1 +#define CONFIG_WAV_DEMUXER 1 +#define CONFIG_WC3_DEMUXER 1 +#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 1 +#define CONFIG_WEBVTT_DEMUXER 1 +#define CONFIG_WSAUD_DEMUXER 1 +#define CONFIG_WSD_DEMUXER 1 +#define CONFIG_WSVQA_DEMUXER 1 +#define CONFIG_WTV_DEMUXER 1 +#define CONFIG_WVE_DEMUXER 1 +#define CONFIG_WV_DEMUXER 1 +#define CONFIG_XA_DEMUXER 1 +#define CONFIG_XBIN_DEMUXER 1 +#define CONFIG_XMV_DEMUXER 1 +#define CONFIG_XVAG_DEMUXER 1 +#define CONFIG_XWMA_DEMUXER 1 +#define CONFIG_YOP_DEMUXER 1 +#define CONFIG_YUV4MPEGPIPE_DEMUXER 1 +#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PAM_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PBM_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PCX_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PGM_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PPM_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PSD_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_SVG_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_XPM_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_XWD_PIPE_DEMUXER 1 +#define CONFIG_LIBGME_DEMUXER 0 +#define CONFIG_LIBMODPLUG_DEMUXER 0 +#define CONFIG_LIBOPENMPT_DEMUXER 0 +#define CONFIG_VAPOURSYNTH_DEMUXER 0 #define CONFIG_A64_MUXER 0 #define CONFIG_AC3_MUXER 0 #define CONFIG_ADTS_MUXER 0 @@ -1740,6 +2272,8 @@ #define CONFIG_AIFF_MUXER 0 #define CONFIG_AMR_MUXER 0 #define CONFIG_APNG_MUXER 0 +#define CONFIG_APTX_MUXER 0 +#define CONFIG_APTX_HD_MUXER 0 #define CONFIG_ASF_MUXER 0 #define CONFIG_ASS_MUXER 0 #define CONFIG_AST_MUXER 0 @@ -1747,9 +2281,12 @@ #define CONFIG_AU_MUXER 0 #define CONFIG_AVI_MUXER 0 #define CONFIG_AVM2_MUXER 0 +#define CONFIG_AVS2_MUXER 0 #define CONFIG_BIT_MUXER 0 #define CONFIG_CAF_MUXER 0 #define CONFIG_CAVSVIDEO_MUXER 0 +#define CONFIG_CODEC2_MUXER 0 +#define CONFIG_CODEC2RAW_MUXER 0 #define CONFIG_CRC_MUXER 0 #define CONFIG_DASH_MUXER 0 #define CONFIG_DATA_MUXER 0 @@ -1760,20 +2297,27 @@ #define CONFIG_DV_MUXER 0 #define CONFIG_EAC3_MUXER 0 #define CONFIG_F4V_MUXER 0 -#define CONFIG_FFM_MUXER 0 #define CONFIG_FFMETADATA_MUXER 0 +#define CONFIG_FIFO_MUXER 0 +#define CONFIG_FIFO_TEST_MUXER 0 #define CONFIG_FILMSTRIP_MUXER 0 +#define CONFIG_FITS_MUXER 0 #define CONFIG_FLAC_MUXER 0 #define CONFIG_FLV_MUXER 0 #define CONFIG_FRAMECRC_MUXER 0 +#define CONFIG_FRAMEHASH_MUXER 0 #define CONFIG_FRAMEMD5_MUXER 0 #define CONFIG_G722_MUXER 0 #define CONFIG_G723_1_MUXER 0 +#define CONFIG_G726_MUXER 0 +#define CONFIG_G726LE_MUXER 0 #define CONFIG_GIF_MUXER 0 +#define CONFIG_GSM_MUXER 0 #define CONFIG_GXF_MUXER 0 #define CONFIG_H261_MUXER 0 #define CONFIG_H263_MUXER 0 #define CONFIG_H264_MUXER 0 +#define CONFIG_HASH_MUXER 0 #define CONFIG_HDS_MUXER 0 #define CONFIG_HEVC_MUXER 0 #define CONFIG_HLS_MUXER 0 @@ -1816,10 +2360,12 @@ #define CONFIG_NUT_MUXER 0 #define CONFIG_OGA_MUXER 0 #define CONFIG_OGG_MUXER 0 +#define CONFIG_OGV_MUXER 0 #define CONFIG_OMA_MUXER 0 #define CONFIG_OPUS_MUXER 0 #define CONFIG_PCM_ALAW_MUXER 0 #define CONFIG_PCM_MULAW_MUXER 0 +#define CONFIG_PCM_VIDC_MUXER 0 #define CONFIG_PCM_F64BE_MUXER 0 #define CONFIG_PCM_F64LE_MUXER 0 #define CONFIG_PCM_F32BE_MUXER 0 @@ -1847,6 +2393,9 @@ #define CONFIG_RTP_MPEGTS_MUXER 0 #define CONFIG_RTSP_MUXER 0 #define CONFIG_SAP_MUXER 0 +#define CONFIG_SBC_MUXER 0 +#define CONFIG_SCC_MUXER 0 +#define CONFIG_SEGAFILM_MUXER 0 #define CONFIG_SEGMENT_MUXER 0 #define CONFIG_STREAM_SEGMENT_MUXER 0 #define CONFIG_SINGLEJPEG_MUXER 0 @@ -1856,12 +2405,14 @@ #define CONFIG_SPX_MUXER 0 #define CONFIG_SPDIF_MUXER 0 #define CONFIG_SRT_MUXER 0 +#define CONFIG_SUP_MUXER 0 #define CONFIG_SWF_MUXER 0 #define CONFIG_TEE_MUXER 0 #define CONFIG_TG2_MUXER 0 #define CONFIG_TGP_MUXER 0 #define CONFIG_MKVTIMESTAMP_V2_MUXER 0 #define CONFIG_TRUEHD_MUXER 0 +#define CONFIG_TTA_MUXER 0 #define CONFIG_UNCODEDFRAMECRC_MUXER 0 #define CONFIG_VC1_MUXER 0 #define CONFIG_VC1T_MUXER 0 @@ -1876,55 +2427,8 @@ #define CONFIG_WTV_MUXER 0 #define CONFIG_WV_MUXER 0 #define CONFIG_YUV4MPEGPIPE_MUXER 0 -#define CONFIG_LIBNUT_MUXER 0 -#define CONFIG_ALSA_OUTDEV 0 -#define CONFIG_CACA_OUTDEV 0 -#define CONFIG_DECKLINK_OUTDEV 0 -#define CONFIG_FBDEV_OUTDEV 0 -#define CONFIG_OPENGL_OUTDEV 0 -#define CONFIG_OSS_OUTDEV 0 -#define CONFIG_PULSE_OUTDEV 0 -#define CONFIG_SDL_OUTDEV 0 -#define CONFIG_SNDIO_OUTDEV 0 -#define CONFIG_V4L2_OUTDEV 0 -#define CONFIG_XV_OUTDEV 0 -#define CONFIG_AAC_PARSER 1 -#define CONFIG_AAC_LATM_PARSER 1 -#define CONFIG_AC3_PARSER 1 -#define CONFIG_ADX_PARSER 1 -#define CONFIG_BMP_PARSER 1 -#define CONFIG_CAVSVIDEO_PARSER 1 -#define CONFIG_COOK_PARSER 1 -#define CONFIG_DCA_PARSER 1 -#define CONFIG_DIRAC_PARSER 1 -#define CONFIG_DNXHD_PARSER 1 -#define CONFIG_DPX_PARSER 1 -#define CONFIG_DVBSUB_PARSER 1 -#define CONFIG_DVDSUB_PARSER 1 -#define CONFIG_DVD_NAV_PARSER 1 -#define CONFIG_FLAC_PARSER 1 -#define CONFIG_GSM_PARSER 1 -#define CONFIG_H261_PARSER 1 -#define CONFIG_H263_PARSER 1 -#define CONFIG_H264_PARSER 1 -#define CONFIG_HEVC_PARSER 1 -#define CONFIG_MJPEG_PARSER 1 -#define CONFIG_MLP_PARSER 1 -#define CONFIG_MPEG4VIDEO_PARSER 1 -#define CONFIG_MPEGAUDIO_PARSER 1 -#define CONFIG_MPEGVIDEO_PARSER 1 -#define CONFIG_OPUS_PARSER 1 -#define CONFIG_PNG_PARSER 1 -#define CONFIG_PNM_PARSER 1 -#define CONFIG_RV30_PARSER 1 -#define CONFIG_RV40_PARSER 1 -#define CONFIG_TAK_PARSER 1 -#define CONFIG_VC1_PARSER 1 -#define CONFIG_VORBIS_PARSER 1 -#define CONFIG_VP3_PARSER 1 -#define CONFIG_VP8_PARSER 1 -#define CONFIG_VP9_PARSER 1 -#define CONFIG_ASYNC_PROTOCOL 0 +#define CONFIG_CHROMAPRINT_MUXER 0 +#define CONFIG_ASYNC_PROTOCOL 1 #define CONFIG_BLURAY_PROTOCOL 0 #define CONFIG_CACHE_PROTOCOL 1 #define CONFIG_CONCAT_PROTOCOL 1 @@ -1944,6 +2448,7 @@ #define CONFIG_MMST_PROTOCOL 0 #define CONFIG_MD5_PROTOCOL 1 #define CONFIG_PIPE_PROTOCOL 1 +#define CONFIG_PROMPEG_PROTOCOL 1 #define CONFIG_RTMP_PROTOCOL 0 #define CONFIG_RTMPE_PROTOCOL 0 #define CONFIG_RTMPS_PROTOCOL 0 @@ -1954,10 +2459,9 @@ #define CONFIG_SCTP_PROTOCOL 0 #define CONFIG_SRTP_PROTOCOL 0 #define CONFIG_SUBFILE_PROTOCOL 1 +#define CONFIG_TEE_PROTOCOL 1 #define CONFIG_TCP_PROTOCOL 0 -#define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0 -#define CONFIG_TLS_GNUTLS_PROTOCOL 0 -#define CONFIG_TLS_OPENSSL_PROTOCOL 0 +#define CONFIG_TLS_PROTOCOL 0 #define CONFIG_UDP_PROTOCOL 0 #define CONFIG_UDPLITE_PROTOCOL 0 #define CONFIG_UNIX_PROTOCOL 0 @@ -1966,6 +2470,7 @@ #define CONFIG_LIBRTMPS_PROTOCOL 0 #define CONFIG_LIBRTMPT_PROTOCOL 0 #define CONFIG_LIBRTMPTE_PROTOCOL 0 +#define CONFIG_LIBSRT_PROTOCOL 0 #define CONFIG_LIBSSH_PROTOCOL 0 #define CONFIG_LIBSMBCLIENT_PROTOCOL 0 #endif /* FFMPEG_CONFIG_H */ diff --git a/build/ffmpeg/config-x86.asm b/build/ffmpeg/config-x86.asm old mode 100644 new mode 100755 index 37e33ec59..5475555d4 --- a/build/ffmpeg/config-x86.asm +++ b/build/ffmpeg/config-x86.asm @@ -1,3 +1,4 @@ +; Automatically generated by configure - do not modify! %define ARCH_AARCH64 0 %define ARCH_ALPHA 0 %define ARCH_ARM 0 @@ -36,10 +37,12 @@ %define HAVE_POWER8 0 %define HAVE_PPC4XX 0 %define HAVE_VSX 0 +%define HAVE_AESNI 1 %define HAVE_AMD3DNOW 1 %define HAVE_AMD3DNOWEXT 1 %define HAVE_AVX 1 %define HAVE_AVX2 1 +%define HAVE_AVX512 1 %define HAVE_FMA3 1 %define HAVE_FMA4 1 %define HAVE_MMX 1 @@ -56,12 +59,14 @@ %define HAVE_MIPSFPU 0 %define HAVE_MIPS32R2 0 %define HAVE_MIPS32R5 0 +%define HAVE_MIPS64R2 0 +%define HAVE_MIPS32R6 0 %define HAVE_MIPS64R6 0 -%define HAVE_MIPSDSPR1 0 +%define HAVE_MIPSDSP 0 %define HAVE_MIPSDSPR2 0 %define HAVE_MSA 0 -%define HAVE_LOONGSON2 1 -%define HAVE_LOONGSON3 1 +%define HAVE_LOONGSON2 0 +%define HAVE_LOONGSON3 0 %define HAVE_MMI 0 %define HAVE_ARMV5TE_EXTERNAL 0 %define HAVE_ARMV6_EXTERNAL 0 @@ -77,10 +82,12 @@ %define HAVE_POWER8_EXTERNAL 0 %define HAVE_PPC4XX_EXTERNAL 0 %define HAVE_VSX_EXTERNAL 0 +%define HAVE_AESNI_EXTERNAL 1 %define HAVE_AMD3DNOW_EXTERNAL 1 %define HAVE_AMD3DNOWEXT_EXTERNAL 1 %define HAVE_AVX_EXTERNAL 1 %define HAVE_AVX2_EXTERNAL 0 +%define HAVE_AVX512_EXTERNAL 0 %define HAVE_FMA3_EXTERNAL 1 %define HAVE_FMA4_EXTERNAL 1 %define HAVE_MMX_EXTERNAL 1 @@ -97,8 +104,10 @@ %define HAVE_MIPSFPU_EXTERNAL 0 %define HAVE_MIPS32R2_EXTERNAL 0 %define HAVE_MIPS32R5_EXTERNAL 0 +%define HAVE_MIPS64R2_EXTERNAL 0 +%define HAVE_MIPS32R6_EXTERNAL 0 %define HAVE_MIPS64R6_EXTERNAL 0 -%define HAVE_MIPSDSPR1_EXTERNAL 0 +%define HAVE_MIPSDSP_EXTERNAL 0 %define HAVE_MIPSDSPR2_EXTERNAL 0 %define HAVE_MSA_EXTERNAL 0 %define HAVE_LOONGSON2_EXTERNAL 0 @@ -118,10 +127,12 @@ %define HAVE_POWER8_INLINE 0 %define HAVE_PPC4XX_INLINE 0 %define HAVE_VSX_INLINE 0 +%define HAVE_AESNI_INLINE 0 %define HAVE_AMD3DNOW_INLINE 0 %define HAVE_AMD3DNOWEXT_INLINE 0 %define HAVE_AVX_INLINE 0 %define HAVE_AVX2_INLINE 0 +%define HAVE_AVX512_INLINE 0 %define HAVE_FMA3_INLINE 0 %define HAVE_FMA4_INLINE 0 %define HAVE_MMX_INLINE 0 @@ -138,8 +149,10 @@ %define HAVE_MIPSFPU_INLINE 0 %define HAVE_MIPS32R2_INLINE 0 %define HAVE_MIPS32R5_INLINE 0 +%define HAVE_MIPS64R2_INLINE 0 +%define HAVE_MIPS32R6_INLINE 0 %define HAVE_MIPS64R6_INLINE 0 -%define HAVE_MIPSDSPR1_INLINE 0 +%define HAVE_MIPSDSP_INLINE 0 %define HAVE_MIPSDSPR2_INLINE 0 %define HAVE_MSA_INLINE 0 %define HAVE_LOONGSON2_INLINE 0 @@ -149,55 +162,49 @@ %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 %define HAVE_FAST_CMOV 0 -%define HAVE_LOCAL_ALIGNED_8 1 -%define HAVE_LOCAL_ALIGNED_16 1 -%define HAVE_LOCAL_ALIGNED_32 1 +%define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 -%define HAVE_ATOMICS_GCC 0 -%define HAVE_ATOMICS_SUNCC 0 -%define HAVE_ATOMICS_WIN32 1 +%define HAVE_SIMD_ALIGN_32 1 +%define HAVE_SIMD_ALIGN_64 1 %define HAVE_ATOMIC_CAS_PTR 0 -%define HAVE_ATOMIC_COMPARE_EXCHANGE 0 %define HAVE_MACHINE_RW_BARRIER 0 %define HAVE_MEMORYBARRIER 1 %define HAVE_MM_EMPTY 1 %define HAVE_RDTSC 1 -%define HAVE_SARESTART 0 +%define HAVE_SEM_TIMEDWAIT 0 %define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0 +%define HAVE_CABS 0 +%define HAVE_CEXP 0 %define HAVE_INLINE_ASM 0 %define HAVE_SYMVER 0 -%define HAVE_YASM 1 +%define HAVE_X86ASM 1 %define HAVE_BIGENDIAN 0 %define HAVE_FAST_UNALIGNED 1 -%define HAVE_INCOMPATIBLE_LIBAV_ABI 0 -%define HAVE_ALSA_ASOUNDLIB_H 0 -%define HAVE_ALTIVEC_H 0 %define HAVE_ARPA_INET_H 0 %define HAVE_ASM_TYPES_H 0 %define HAVE_CDIO_PARANOIA_H 0 %define HAVE_CDIO_PARANOIA_PARANOIA_H 0 +%define HAVE_CUDA_H 0 +%define HAVE_DISPATCH_DISPATCH_H 0 %define HAVE_DEV_BKTR_IOCTL_BT848_H 0 %define HAVE_DEV_BKTR_IOCTL_METEOR_H 0 %define HAVE_DEV_IC_BT8XX_H 0 %define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0 %define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0 %define HAVE_DIRECT_H 1 -%define HAVE_DLFCN_H 0 -%define HAVE_D3D11_H 1 +%define HAVE_DIRENT_H 0 +%define HAVE_DXGIDEBUG_H 1 %define HAVE_DXVA_H 1 %define HAVE_ES2_GL_H 0 %define HAVE_GSM_H 0 %define HAVE_IO_H 1 -%define HAVE_MACH_MACH_TIME_H 0 +%define HAVE_LINUX_PERF_EVENT_H 0 %define HAVE_MACHINE_IOCTL_BT848_H 0 %define HAVE_MACHINE_IOCTL_METEOR_H 0 %define HAVE_MALLOC_H 1 -%define HAVE_OPENJPEG_1_5_OPENJPEG_H 0 +%define HAVE_OPENCV2_CORE_CORE_C_H 0 %define HAVE_OPENGL_GL3_H 0 %define HAVE_POLL_H 0 -%define HAVE_SNDIO_H 0 -%define HAVE_SOUNDCARD_H 0 -%define HAVE_SYS_MMAN_H 0 %define HAVE_SYS_PARAM_H 0 %define HAVE_SYS_RESOURCE_H 0 %define HAVE_SYS_SELECT_H 0 @@ -222,6 +229,8 @@ %define HAVE_EXP2 1 %define HAVE_EXP2F 1 %define HAVE_EXPF 1 +%define HAVE_HYPOT 1 +%define HAVE_ISFINITE 1 %define HAVE_ISINF 1 %define HAVE_ISNAN 1 %define HAVE_LDEXPF 1 @@ -239,17 +248,20 @@ %define HAVE_SINF 1 %define HAVE_TRUNC 1 %define HAVE_TRUNCF 1 +%define HAVE_DOS_PATHS 1 +%define HAVE_LIBC_MSVCRT 1 +%define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0 +%define HAVE_SECTION_DATA_REL_RO 0 +%define HAVE_THREADS 1 +%define HAVE_UWP 0 +%define HAVE_WINRT 0 %define HAVE_ACCESS 1 %define HAVE_ALIGNED_MALLOC 1 +%define HAVE_ARC4RANDOM 0 %define HAVE_CLOCK_GETTIME 0 %define HAVE_CLOSESOCKET 0 %define HAVE_COMMANDLINETOARGVW 1 -%define HAVE_COTASKMEMFREE 1 -%define HAVE_CRYPTGENRANDOM 1 -%define HAVE_DLOPEN 0 %define HAVE_FCNTL 0 -%define HAVE_FLT_LIM 1 -%define HAVE_FORK 0 %define HAVE_GETADDRINFO 0 %define HAVE_GETHRTIME 0 %define HAVE_GETOPT 0 @@ -257,7 +269,6 @@ %define HAVE_GETPROCESSMEMORYINFO 1 %define HAVE_GETPROCESSTIMES 1 %define HAVE_GETRUSAGE 0 -%define HAVE_GETSERVBYPORT 0 %define HAVE_GETSYSTEMTIMEASFILETIME 1 %define HAVE_GETTIMEOFDAY 0 %define HAVE_GLOB 0 @@ -265,9 +276,9 @@ %define HAVE_GMTIME_R 0 %define HAVE_INET_ATON 0 %define HAVE_ISATTY 1 -%define HAVE_JACK_PORT_GET_LATENCY_RANGE 0 %define HAVE_KBHIT 1 %define HAVE_LOCALTIME_R 0 +%define HAVE_LSTAT 0 %define HAVE_LZO1X_999_COMPRESS 0 %define HAVE_MACH_ABSOLUTE_TIME 0 %define HAVE_MAPVIEWOFFILE 1 @@ -280,6 +291,7 @@ %define HAVE_POSIX_MEMALIGN 0 %define HAVE_PTHREAD_CANCEL 0 %define HAVE_SCHED_GETAFFINITY 0 +%define HAVE_SECITEMIMPORT 0 %define HAVE_SETCONSOLETEXTATTRIBUTE 1 %define HAVE_SETCONSOLECTRLHANDLER 1 %define HAVE_SETMODE 1 @@ -289,25 +301,31 @@ %define HAVE_SYSCONF 0 %define HAVE_SYSCTL 0 %define HAVE_USLEEP 0 +%define HAVE_UTGETOSTYPEFROMSTRING 0 %define HAVE_VIRTUALALLOC 1 %define HAVE_WGLGETPROCADDRESS 0 +%define HAVE_BCRYPT 1 +%define HAVE_VAAPI_DRM 0 +%define HAVE_VAAPI_X11 0 +%define HAVE_VDPAU_X11 0 %define HAVE_PTHREADS 0 %define HAVE_OS2THREADS 0 %define HAVE_W32THREADS 1 +%define HAVE_AS_ARCH_DIRECTIVE 0 %define HAVE_AS_DN_DIRECTIVE 0 +%define HAVE_AS_FPU_DIRECTIVE 0 %define HAVE_AS_FUNC 0 %define HAVE_AS_OBJECT_ARCH 0 %define HAVE_ASM_MOD_Q 0 -%define HAVE_ATTRIBUTE_MAY_ALIAS 0 -%define HAVE_ATTRIBUTE_PACKED 0 +%define HAVE_BLOCKS_EXTENSION 0 %define HAVE_EBP_AVAILABLE 0 %define HAVE_EBX_AVAILABLE 0 %define HAVE_GNU_AS 0 %define HAVE_GNU_WINDRES 0 %define HAVE_IBM_ASM 0 +%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0 %define HAVE_INLINE_ASM_LABELS 0 %define HAVE_INLINE_ASM_NONLOCAL_LABELS 0 -%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0 %define HAVE_PRAGMA_DEPRECATED 1 %define HAVE_RSYNC_CONTIMEOUT 0 %define HAVE_SYMVER_ASM_LABEL 0 @@ -315,13 +333,13 @@ %define HAVE_VFP_ARGS 0 %define HAVE_XFORM_ASM 0 %define HAVE_XMM_CLOBBERS 0 -%define HAVE_CONDITION_VARIABLE_PTR 1 +%define HAVE_KCMVIDEOCODECTYPE_HEVC 0 %define HAVE_SOCKLEN_T 0 %define HAVE_STRUCT_ADDRINFO 0 -%define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0 %define HAVE_STRUCT_GROUP_SOURCE_REQ 0 %define HAVE_STRUCT_IP_MREQ_SOURCE 0 %define HAVE_STRUCT_IPV6_MREQ 0 +%define HAVE_STRUCT_MSGHDR_MSG_FLAGS 0 %define HAVE_STRUCT_POLLFD 0 %define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0 %define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0 @@ -330,48 +348,35 @@ %define HAVE_STRUCT_SOCKADDR_STORAGE 0 %define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0 %define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0 -%define HAVE_ATOMICS_NATIVE 1 -%define HAVE_DOS_PATHS 1 -%define HAVE_DXVA2API_COBJ 1 -%define HAVE_DXVA2_LIB 0 -%define HAVE_LIBC_MSVCRT 1 -%define HAVE_LIBDC1394_1 0 -%define HAVE_LIBDC1394_2 0 %define HAVE_MAKEINFO 1 %define HAVE_MAKEINFO_HTML 0 +%define HAVE_OPENCL_D3D11 0 +%define HAVE_OPENCL_DRM_ARM 0 +%define HAVE_OPENCL_DRM_BEIGNET 0 +%define HAVE_OPENCL_DXVA2 0 +%define HAVE_OPENCL_VAAPI_BEIGNET 0 +%define HAVE_OPENCL_VAAPI_INTEL_MEDIA 0 %define HAVE_PERL 1 %define HAVE_POD2MAN 0 -%define HAVE_SDL 0 -%define HAVE_SECTION_DATA_REL_RO 0 %define HAVE_TEXI2HTML 0 -%define HAVE_THREADS 1 -%define HAVE_VAAPI_X11 0 -%define HAVE_VDPAU_X11 0 -%define HAVE_XLIB 0 -%define CONFIG_BSFS 1 -%define CONFIG_DECODERS 1 -%define CONFIG_DEMUXERS 1 -%define CONFIG_ENCODERS 0 -%define CONFIG_FILTERS 0 -%define CONFIG_HWACCELS 0 -%define CONFIG_INDEVS 0 -%define CONFIG_MUXERS 0 -%define CONFIG_OUTDEVS 0 -%define CONFIG_PARSERS 1 -%define CONFIG_PROTOCOLS 1 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 %define CONFIG_PODPAGES 1 %define CONFIG_TXTPAGES 1 +%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1 %define CONFIG_AVIO_READING_EXAMPLE 1 -%define CONFIG_AVIO_LIST_DIR_EXAMPLE 1 -%define CONFIG_DECODING_ENCODING_EXAMPLE 1 +%define CONFIG_DECODE_AUDIO_EXAMPLE 1 +%define CONFIG_DECODE_VIDEO_EXAMPLE 1 %define CONFIG_DEMUXING_DECODING_EXAMPLE 1 +%define CONFIG_ENCODE_AUDIO_EXAMPLE 1 +%define CONFIG_ENCODE_VIDEO_EXAMPLE 1 %define CONFIG_EXTRACT_MVS_EXAMPLE 1 %define CONFIG_FILTER_AUDIO_EXAMPLE 0 %define CONFIG_FILTERING_AUDIO_EXAMPLE 0 %define CONFIG_FILTERING_VIDEO_EXAMPLE 0 +%define CONFIG_HTTP_MULTICLIENT_EXAMPLE 0 +%define CONFIG_HW_DECODE_EXAMPLE 1 %define CONFIG_METADATA_EXAMPLE 1 %define CONFIG_MUXING_EXAMPLE 1 %define CONFIG_QSVDEC_EXAMPLE 0 @@ -380,25 +385,48 @@ %define CONFIG_SCALING_VIDEO_EXAMPLE 1 %define CONFIG_TRANSCODE_AAC_EXAMPLE 1 %define CONFIG_TRANSCODING_EXAMPLE 0 +%define CONFIG_VAAPI_ENCODE_EXAMPLE 0 +%define CONFIG_VAAPI_TRANSCODE_EXAMPLE 0 %define CONFIG_AVISYNTH 0 -%define CONFIG_BZLIB 0 -%define CONFIG_CRYSTALHD 0 -%define CONFIG_DECKLINK 0 %define CONFIG_FREI0R 0 +%define CONFIG_LIBCDIO 0 +%define CONFIG_LIBDAVS2 0 +%define CONFIG_LIBRUBBERBAND 0 +%define CONFIG_LIBVIDSTAB 0 +%define CONFIG_LIBX264 0 +%define CONFIG_LIBX265 0 +%define CONFIG_LIBXAVS 0 +%define CONFIG_LIBXAVS2 0 +%define CONFIG_LIBXVID 0 +%define CONFIG_DECKLINK 0 +%define CONFIG_LIBNDI_NEWTEK 0 +%define CONFIG_LIBFDK_AAC 0 +%define CONFIG_OPENSSL 0 +%define CONFIG_LIBTLS 0 +%define CONFIG_GMP 0 +%define CONFIG_LIBLENSFUN 0 +%define CONFIG_LIBOPENCORE_AMRNB 0 +%define CONFIG_LIBOPENCORE_AMRWB 0 +%define CONFIG_LIBVMAF 0 +%define CONFIG_LIBVO_AMRWBENC 0 +%define CONFIG_MBEDTLS 0 +%define CONFIG_RKMPP 0 +%define CONFIG_LIBSMBCLIENT 0 +%define CONFIG_CHROMAPRINT 0 +%define CONFIG_GCRYPT 0 %define CONFIG_GNUTLS 0 -%define CONFIG_ICONV 0 +%define CONFIG_JNI 0 %define CONFIG_LADSPA 0 -%define CONFIG_LIBAACPLUS 0 +%define CONFIG_LIBAOM 0 %define CONFIG_LIBASS 0 %define CONFIG_LIBBLURAY 0 %define CONFIG_LIBBS2B 0 %define CONFIG_LIBCACA 0 -%define CONFIG_LIBCDIO 0 %define CONFIG_LIBCELT 0 +%define CONFIG_LIBCODEC2 0 +%define CONFIG_LIBDAV1D 0 %define CONFIG_LIBDC1394 0 -%define CONFIG_LIBDCADEC 0 -%define CONFIG_LIBFAAC 0 -%define CONFIG_LIBFDK_AAC 0 +%define CONFIG_LIBDRM 0 %define CONFIG_LIBFLITE 0 %define CONFIG_LIBFONTCONFIG 0 %define CONFIG_LIBFREETYPE 0 @@ -407,91 +435,107 @@ %define CONFIG_LIBGSM 0 %define CONFIG_LIBIEC61883 0 %define CONFIG_LIBILBC 0 +%define CONFIG_LIBJACK 0 +%define CONFIG_LIBKLVANC 0 %define CONFIG_LIBKVAZAAR 0 -%define CONFIG_LIBMFX 0 %define CONFIG_LIBMODPLUG 0 %define CONFIG_LIBMP3LAME 0 -%define CONFIG_LIBNUT 0 -%define CONFIG_LIBOPENCORE_AMRNB 0 -%define CONFIG_LIBOPENCORE_AMRWB 0 +%define CONFIG_LIBMYSOFA 0 %define CONFIG_LIBOPENCV 0 %define CONFIG_LIBOPENH264 0 %define CONFIG_LIBOPENJPEG 0 +%define CONFIG_LIBOPENMPT 0 %define CONFIG_LIBOPUS 0 %define CONFIG_LIBPULSE 0 -%define CONFIG_LIBQUVI 0 +%define CONFIG_LIBRSVG 0 %define CONFIG_LIBRTMP 0 -%define CONFIG_LIBSCHROEDINGER 0 %define CONFIG_LIBSHINE 0 %define CONFIG_LIBSMBCLIENT 0 %define CONFIG_LIBSNAPPY 0 %define CONFIG_LIBSOXR 0 %define CONFIG_LIBSPEEX 0 +%define CONFIG_LIBSRT 0 %define CONFIG_LIBSSH 0 -%define CONFIG_LIBSTAGEFRIGHT_H264 0 +%define CONFIG_LIBTENSORFLOW 0 +%define CONFIG_LIBTESSERACT 0 %define CONFIG_LIBTHEORA 0 %define CONFIG_LIBTWOLAME 0 -%define CONFIG_LIBUTVIDEO 0 %define CONFIG_LIBV4L2 0 -%define CONFIG_LIBVIDSTAB 0 -%define CONFIG_LIBVO_AACENC 0 -%define CONFIG_LIBVO_AMRWBENC 0 %define CONFIG_LIBVORBIS 0 %define CONFIG_LIBVPX 0 %define CONFIG_LIBWAVPACK 0 %define CONFIG_LIBWEBP 0 -%define CONFIG_LIBX264 0 -%define CONFIG_LIBX265 0 -%define CONFIG_LIBXAVS 0 +%define CONFIG_LIBXML2 0 +%define CONFIG_LIBZIMG 0 +%define CONFIG_LIBZMQ 0 +%define CONFIG_LIBZVBI 0 +%define CONFIG_LV2 0 +%define CONFIG_MEDIACODEC 0 +%define CONFIG_OPENAL 0 +%define CONFIG_OPENGL 0 +%define CONFIG_VAPOURSYNTH 0 +%define CONFIG_ALSA 0 +%define CONFIG_APPKIT 0 +%define CONFIG_AVFOUNDATION 0 +%define CONFIG_BZLIB 0 +%define CONFIG_COREIMAGE 0 +%define CONFIG_ICONV 0 %define CONFIG_LIBXCB 0 %define CONFIG_LIBXCB_SHM 0 %define CONFIG_LIBXCB_SHAPE 0 %define CONFIG_LIBXCB_XFIXES 0 -%define CONFIG_LIBXVID 0 -%define CONFIG_LIBZMQ 0 -%define CONFIG_LIBZVBI 0 %define CONFIG_LZMA 0 -%define CONFIG_MMAL 0 -%define CONFIG_NVENC 0 -%define CONFIG_OPENAL 0 -%define CONFIG_OPENCL 0 -%define CONFIG_OPENGL 0 -%define CONFIG_OPENSSL 0 -%define CONFIG_SDL 0 +%define CONFIG_SCHANNEL 1 +%define CONFIG_SDL2 0 %define CONFIG_SECURETRANSPORT 0 -%define CONFIG_X11GRAB 0 +%define CONFIG_SNDIO 0 %define CONFIG_XLIB 0 %define CONFIG_ZLIB 1 +%define CONFIG_CUDA_SDK 0 +%define CONFIG_LIBNPP 0 +%define CONFIG_LIBMFX 0 +%define CONFIG_MMAL 0 +%define CONFIG_OMX 0 +%define CONFIG_OPENCL 0 +%define CONFIG_AMF 0 +%define CONFIG_AUDIOTOOLBOX 0 +%define CONFIG_CRYSTALHD 0 +%define CONFIG_CUDA 0 +%define CONFIG_CUVID 0 +%define CONFIG_D3D11VA 0 +%define CONFIG_DXVA2 0 +%define CONFIG_FFNVCODEC 0 +%define CONFIG_NVDEC 0 +%define CONFIG_NVENC 0 +%define CONFIG_VAAPI 0 +%define CONFIG_VDPAU 0 +%define CONFIG_VIDEOTOOLBOX 0 +%define CONFIG_V4L2_M2M 0 +%define CONFIG_XVMC 0 %define CONFIG_FTRAPV 0 %define CONFIG_GRAY 0 %define CONFIG_HARDCODED_TABLES 0 +%define CONFIG_OMX_RPI 0 %define CONFIG_RUNTIME_CPUDETECT 1 %define CONFIG_SAFE_BITSTREAM_READER 1 %define CONFIG_SHARED 0 -%define CONFIG_SMALL 0 +%define CONFIG_SMALL 1 %define CONFIG_STATIC 1 %define CONFIG_SWSCALE_ALPHA 1 -%define CONFIG_D3D11VA 0 -%define CONFIG_DXVA2 0 -%define CONFIG_VAAPI 0 -%define CONFIG_VDA 0 -%define CONFIG_VDPAU 0 -%define CONFIG_XVMC 0 %define CONFIG_GPL 1 %define CONFIG_NONFREE 0 %define CONFIG_VERSION3 0 -%define CONFIG_AVCODEC 1 %define CONFIG_AVDEVICE 1 %define CONFIG_AVFILTER 0 +%define CONFIG_SWSCALE 1 +%define CONFIG_POSTPROC 0 %define CONFIG_AVFORMAT 1 +%define CONFIG_AVCODEC 1 +%define CONFIG_SWRESAMPLE 1 %define CONFIG_AVRESAMPLE 0 %define CONFIG_AVUTIL 1 -%define CONFIG_POSTPROC 0 -%define CONFIG_SWRESAMPLE 1 -%define CONFIG_SWSCALE 1 %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 -%define CONFIG_FFSERVER 0 %define CONFIG_FFMPEG 0 %define CONFIG_DCT 1 %define CONFIG_DWT 1 @@ -505,24 +549,44 @@ %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 %define CONFIG_RDFT 1 +%define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 -%define CONFIG_INCOMPATIBLE_LIBAV_ABI 0 -%define CONFIG_MEMALIGN_HACK 0 +%define CONFIG_LINUX_PERF 0 %define CONFIG_MEMORY_POISONING 0 %define CONFIG_NEON_CLOBBER_TEST 0 +%define CONFIG_OSSFUZZ 0 %define CONFIG_PIC 0 -%define CONFIG_POD2MAN 0 -%define CONFIG_RAISE_MAJOR 0 %define CONFIG_THUMB 0 %define CONFIG_VALGRIND_BACKTRACE 0 %define CONFIG_XMM_CLOBBER_TEST 0 +%define CONFIG_BSFS 1 +%define CONFIG_DECODERS 1 +%define CONFIG_ENCODERS 0 +%define CONFIG_HWACCELS 0 +%define CONFIG_PARSERS 1 +%define CONFIG_INDEVS 0 +%define CONFIG_OUTDEVS 0 +%define CONFIG_FILTERS 0 +%define CONFIG_DEMUXERS 1 +%define CONFIG_MUXERS 0 +%define CONFIG_PROTOCOLS 1 %define CONFIG_AANDCTTABLES 1 %define CONFIG_AC3DSP 1 -%define CONFIG_AUDIO_FRAME_QUEUE 0 +%define CONFIG_ADTS_HEADER 1 +%define CONFIG_AUDIO_FRAME_QUEUE 1 %define CONFIG_AUDIODSP 1 %define CONFIG_BLOCKDSP 1 %define CONFIG_BSWAPDSP 1 %define CONFIG_CABAC 1 +%define CONFIG_CBS 1 +%define CONFIG_CBS_AV1 1 +%define CONFIG_CBS_H264 1 +%define CONFIG_CBS_H265 1 +%define CONFIG_CBS_JPEG 0 +%define CONFIG_CBS_MPEG2 1 +%define CONFIG_CBS_VP9 1 +%define CONFIG_DIRAC_PARSE 1 +%define CONFIG_DNN 0 %define CONFIG_DVPROFILE 1 %define CONFIG_EXIF 1 %define CONFIG_FAANDCT 1 @@ -532,34 +596,38 @@ %define CONFIG_FMTCONVERT 1 %define CONFIG_FRAME_THREAD_ENCODER 0 %define CONFIG_G722DSP 1 -%define CONFIG_GCRYPT 0 -%define CONFIG_GMP 0 %define CONFIG_GOLOMB 1 %define CONFIG_GPLV3 0 %define CONFIG_H263DSP 1 %define CONFIG_H264CHROMA 1 %define CONFIG_H264DSP 1 +%define CONFIG_H264PARSE 1 %define CONFIG_H264PRED 1 %define CONFIG_H264QPEL 1 +%define CONFIG_HEVCPARSE 1 %define CONFIG_HPELDSP 1 %define CONFIG_HUFFMAN 1 %define CONFIG_HUFFYUVDSP 1 %define CONFIG_HUFFYUVENCDSP 0 %define CONFIG_IDCTDSP 1 %define CONFIG_IIRFILTER 0 -%define CONFIG_IMDCT15 1 +%define CONFIG_MDCT15 1 %define CONFIG_INTRAX8 1 +%define CONFIG_ISO_MEDIA 1 %define CONFIG_IVIDSP 0 %define CONFIG_JPEGTABLES 1 -%define CONFIG_LIBX262 0 %define CONFIG_LGPLV3 0 +%define CONFIG_LIBX262 0 %define CONFIG_LLAUDDSP 1 %define CONFIG_LLVIDDSP 1 +%define CONFIG_LLVIDENCDSP 0 %define CONFIG_LPC 0 +%define CONFIG_LZF 1 %define CONFIG_ME_CMP 1 %define CONFIG_MPEG_ER 1 %define CONFIG_MPEGAUDIO 1 %define CONFIG_MPEGAUDIODSP 1 +%define CONFIG_MPEGAUDIOHEADER 1 %define CONFIG_MPEGVIDEO 1 %define CONFIG_MPEGVIDEOENC 1 %define CONFIG_MSS34DSP 1 @@ -568,18 +636,24 @@ %define CONFIG_QSV 0 %define CONFIG_QSVDEC 0 %define CONFIG_QSVENC 0 +%define CONFIG_QSVVPP 0 %define CONFIG_RANGECODER 1 %define CONFIG_RIFFDEC 1 %define CONFIG_RIFFENC 0 %define CONFIG_RTPDEC 0 %define CONFIG_RTPENC_CHAIN 0 %define CONFIG_RV34DSP 1 +%define CONFIG_SCENE_SAD 0 %define CONFIG_SINEWIN 1 %define CONFIG_SNAPPY 1 +%define CONFIG_SRTP 0 %define CONFIG_STARTCODE 1 %define CONFIG_TEXTUREDSP 1 %define CONFIG_TEXTUREDSPENC 0 %define CONFIG_TPELDSP 1 +%define CONFIG_VAAPI_1 0 +%define CONFIG_VAAPI_ENCODE 0 +%define CONFIG_VC1DSP 1 %define CONFIG_VIDEODSP 1 %define CONFIG_VP3DSP 1 %define CONFIG_VP56DSP 1 @@ -587,19 +661,36 @@ %define CONFIG_WMA_FREQS 1 %define CONFIG_WMV2DSP 1 %define CONFIG_AAC_ADTSTOASC_BSF 1 +%define CONFIG_AV1_METADATA_BSF 1 %define CONFIG_CHOMP_BSF 1 %define CONFIG_DUMP_EXTRADATA_BSF 1 +%define CONFIG_DCA_CORE_BSF 1 +%define CONFIG_EAC3_CORE_BSF 1 +%define CONFIG_EXTRACT_EXTRADATA_BSF 1 +%define CONFIG_FILTER_UNITS_BSF 1 +%define CONFIG_H264_METADATA_BSF 1 %define CONFIG_H264_MP4TOANNEXB_BSF 1 +%define CONFIG_H264_REDUNDANT_PPS_BSF 1 +%define CONFIG_HAPQA_EXTRACT_BSF 1 +%define CONFIG_HEVC_METADATA_BSF 1 %define CONFIG_HEVC_MP4TOANNEXB_BSF 1 %define CONFIG_IMX_DUMP_HEADER_BSF 1 %define CONFIG_MJPEG2JPEG_BSF 1 %define CONFIG_MJPEGA_DUMP_HEADER_BSF 1 %define CONFIG_MP3_HEADER_DECOMPRESS_BSF 1 +%define CONFIG_MPEG2_METADATA_BSF 1 %define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 1 %define CONFIG_MOV2TEXTSUB_BSF 1 %define CONFIG_NOISE_BSF 1 +%define CONFIG_NULL_BSF 1 +%define CONFIG_PRORES_METADATA_BSF 1 %define CONFIG_REMOVE_EXTRADATA_BSF 1 %define CONFIG_TEXT2MOVSUB_BSF 1 +%define CONFIG_TRACE_HEADERS_BSF 1 +%define CONFIG_VP9_METADATA_BSF 1 +%define CONFIG_VP9_RAW_REORDER_BSF 1 +%define CONFIG_VP9_SUPERFRAME_BSF 1 +%define CONFIG_VP9_SUPERFRAME_SPLIT_BSF 1 %define CONFIG_AASC_DECODER 1 %define CONFIG_AIC_DECODER 1 %define CONFIG_ALIAS_PIX_DECODER 1 @@ -619,6 +710,7 @@ %define CONFIG_BETHSOFTVID_DECODER 1 %define CONFIG_BFI_DECODER 1 %define CONFIG_BINK_DECODER 1 +%define CONFIG_BITPACKED_DECODER 1 %define CONFIG_BMP_DECODER 1 %define CONFIG_BMV_VIDEO_DECODER 1 %define CONFIG_BRENDER_PIX_DECODER 1 @@ -626,7 +718,9 @@ %define CONFIG_CAVS_DECODER 1 %define CONFIG_CDGRAPHICS_DECODER 1 %define CONFIG_CDXL_DECODER 1 +%define CONFIG_CFHD_DECODER 1 %define CONFIG_CINEPAK_DECODER 1 +%define CONFIG_CLEARVIDEO_DECODER 1 %define CONFIG_CLJR_DECODER 1 %define CONFIG_CLLC_DECODER 1 %define CONFIG_COMFORTNOISE_DECODER 1 @@ -639,9 +733,11 @@ %define CONFIG_DNXHD_DECODER 1 %define CONFIG_DPX_DECODER 1 %define CONFIG_DSICINVIDEO_DECODER 1 +%define CONFIG_DVAUDIO_DECODER 1 %define CONFIG_DVVIDEO_DECODER 1 %define CONFIG_DXA_DECODER 1 %define CONFIG_DXTORY_DECODER 1 +%define CONFIG_DXV_DECODER 1 %define CONFIG_EACMV_DECODER 1 %define CONFIG_EAMAD_DECODER 1 %define CONFIG_EATGQ_DECODER 1 @@ -656,35 +752,42 @@ %define CONFIG_FFV1_DECODER 1 %define CONFIG_FFVHUFF_DECODER 1 %define CONFIG_FIC_DECODER 1 +%define CONFIG_FITS_DECODER 1 %define CONFIG_FLASHSV_DECODER 1 %define CONFIG_FLASHSV2_DECODER 1 %define CONFIG_FLIC_DECODER 1 %define CONFIG_FLV_DECODER 1 +%define CONFIG_FMVC_DECODER 1 %define CONFIG_FOURXM_DECODER 1 %define CONFIG_FRAPS_DECODER 1 %define CONFIG_FRWU_DECODER 1 %define CONFIG_G2M_DECODER 1 +%define CONFIG_GDV_DECODER 1 %define CONFIG_GIF_DECODER 1 %define CONFIG_H261_DECODER 1 %define CONFIG_H263_DECODER 1 %define CONFIG_H263I_DECODER 1 %define CONFIG_H263P_DECODER 1 +%define CONFIG_H263_V4L2M2M_DECODER 0 %define CONFIG_H264_DECODER 1 %define CONFIG_H264_CRYSTALHD_DECODER 0 +%define CONFIG_H264_V4L2M2M_DECODER 0 +%define CONFIG_H264_MEDIACODEC_DECODER 0 %define CONFIG_H264_MMAL_DECODER 0 %define CONFIG_H264_QSV_DECODER 0 -%define CONFIG_H264_VDA_DECODER 0 -%define CONFIG_H264_VDPAU_DECODER 0 +%define CONFIG_H264_RKMPP_DECODER 0 %define CONFIG_HAP_DECODER 1 %define CONFIG_HEVC_DECODER 1 %define CONFIG_HEVC_QSV_DECODER 0 +%define CONFIG_HEVC_RKMPP_DECODER 0 +%define CONFIG_HEVC_V4L2M2M_DECODER 0 %define CONFIG_HNM4_VIDEO_DECODER 1 %define CONFIG_HQ_HQA_DECODER 1 %define CONFIG_HQX_DECODER 1 %define CONFIG_HUFFYUV_DECODER 1 %define CONFIG_IDCIN_DECODER 1 -%define CONFIG_IFF_BYTERUN1_DECODER 1 %define CONFIG_IFF_ILBM_DECODER 1 +%define CONFIG_IMM4_DECODER 1 %define CONFIG_INDEO2_DECODER 0 %define CONFIG_INDEO3_DECODER 0 %define CONFIG_INDEO4_DECODER 0 @@ -697,28 +800,33 @@ %define CONFIG_KMVC_DECODER 1 %define CONFIG_LAGARITH_DECODER 1 %define CONFIG_LOCO_DECODER 1 +%define CONFIG_M101_DECODER 1 +%define CONFIG_MAGICYUV_DECODER 1 %define CONFIG_MDEC_DECODER 1 %define CONFIG_MIMIC_DECODER 1 %define CONFIG_MJPEG_DECODER 1 %define CONFIG_MJPEGB_DECODER 1 %define CONFIG_MMVIDEO_DECODER 1 %define CONFIG_MOTIONPIXELS_DECODER 1 -%define CONFIG_MPEG_XVMC_DECODER 0 %define CONFIG_MPEG1VIDEO_DECODER 1 %define CONFIG_MPEG2VIDEO_DECODER 1 %define CONFIG_MPEG4_DECODER 1 %define CONFIG_MPEG4_CRYSTALHD_DECODER 0 -%define CONFIG_MPEG4_VDPAU_DECODER 0 +%define CONFIG_MPEG4_V4L2M2M_DECODER 0 +%define CONFIG_MPEG4_MMAL_DECODER 0 %define CONFIG_MPEGVIDEO_DECODER 1 -%define CONFIG_MPEG_VDPAU_DECODER 0 -%define CONFIG_MPEG1_VDPAU_DECODER 0 +%define CONFIG_MPEG1_V4L2M2M_DECODER 0 +%define CONFIG_MPEG2_MMAL_DECODER 0 %define CONFIG_MPEG2_CRYSTALHD_DECODER 0 +%define CONFIG_MPEG2_V4L2M2M_DECODER 0 %define CONFIG_MPEG2_QSV_DECODER 0 +%define CONFIG_MPEG2_MEDIACODEC_DECODER 0 %define CONFIG_MSA1_DECODER 1 -%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0 +%define CONFIG_MSCC_DECODER 1 %define CONFIG_MSMPEG4V1_DECODER 1 %define CONFIG_MSMPEG4V2_DECODER 1 %define CONFIG_MSMPEG4V3_DECODER 1 +%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0 %define CONFIG_MSRLE_DECODER 1 %define CONFIG_MSS1_DECODER 1 %define CONFIG_MSS2_DECODER 1 @@ -727,6 +835,7 @@ %define CONFIG_MTS2_DECODER 1 %define CONFIG_MVC1_DECODER 1 %define CONFIG_MVC2_DECODER 1 +%define CONFIG_MWSC_DECODER 1 %define CONFIG_MXPEG_DECODER 1 %define CONFIG_NUV_DECODER 1 %define CONFIG_PAF_VIDEO_DECODER 1 @@ -736,33 +845,43 @@ %define CONFIG_PGM_DECODER 1 %define CONFIG_PGMYUV_DECODER 1 %define CONFIG_PICTOR_DECODER 1 +%define CONFIG_PIXLET_DECODER 1 %define CONFIG_PNG_DECODER 1 %define CONFIG_PPM_DECODER 1 %define CONFIG_PRORES_DECODER 1 -%define CONFIG_PRORES_LGPL_DECODER 1 +%define CONFIG_PROSUMER_DECODER 1 +%define CONFIG_PSD_DECODER 1 %define CONFIG_PTX_DECODER 1 %define CONFIG_QDRAW_DECODER 1 %define CONFIG_QPEG_DECODER 1 %define CONFIG_QTRLE_DECODER 1 %define CONFIG_R10K_DECODER 1 %define CONFIG_R210_DECODER 1 +%define CONFIG_RASC_DECODER 1 %define CONFIG_RAWVIDEO_DECODER 1 %define CONFIG_RL2_DECODER 1 %define CONFIG_ROQ_DECODER 1 %define CONFIG_RPZA_DECODER 1 +%define CONFIG_RSCC_DECODER 1 %define CONFIG_RV10_DECODER 1 %define CONFIG_RV20_DECODER 1 %define CONFIG_RV30_DECODER 1 %define CONFIG_RV40_DECODER 1 %define CONFIG_S302M_DECODER 1 %define CONFIG_SANM_DECODER 1 +%define CONFIG_SCPR_DECODER 1 +%define CONFIG_SCREENPRESSO_DECODER 1 +%define CONFIG_SDX2_DPCM_DECODER 1 %define CONFIG_SGI_DECODER 1 %define CONFIG_SGIRLE_DECODER 1 +%define CONFIG_SHEERVIDEO_DECODER 1 %define CONFIG_SMACKER_DECODER 1 %define CONFIG_SMC_DECODER 1 %define CONFIG_SMVJPEG_DECODER 1 %define CONFIG_SNOW_DECODER 1 %define CONFIG_SP5X_DECODER 1 +%define CONFIG_SPEEDHQ_DECODER 1 +%define CONFIG_SRGC_DECODER 1 %define CONFIG_SUNRAST_DECODER 1 %define CONFIG_SVQ1_DECODER 1 %define CONFIG_SVQ3_DECODER 1 @@ -776,6 +895,7 @@ %define CONFIG_TMV_DECODER 1 %define CONFIG_TRUEMOTION1_DECODER 1 %define CONFIG_TRUEMOTION2_DECODER 1 +%define CONFIG_TRUEMOTION2RT_DECODER 1 %define CONFIG_TSCC_DECODER 1 %define CONFIG_TSCC2_DECODER 1 %define CONFIG_TXD_DECODER 1 @@ -790,9 +910,10 @@ %define CONFIG_VBLE_DECODER 1 %define CONFIG_VC1_DECODER 1 %define CONFIG_VC1_CRYSTALHD_DECODER 0 -%define CONFIG_VC1_VDPAU_DECODER 0 %define CONFIG_VC1IMAGE_DECODER 1 +%define CONFIG_VC1_MMAL_DECODER 0 %define CONFIG_VC1_QSV_DECODER 0 +%define CONFIG_VC1_V4L2M2M_DECODER 0 %define CONFIG_VCR1_DECODER 1 %define CONFIG_VMDVIDEO_DECODER 1 %define CONFIG_VMNC_DECODER 1 @@ -803,14 +924,19 @@ %define CONFIG_VP6F_DECODER 1 %define CONFIG_VP7_DECODER 1 %define CONFIG_VP8_DECODER 1 +%define CONFIG_VP8_RKMPP_DECODER 0 +%define CONFIG_VP8_V4L2M2M_DECODER 0 %define CONFIG_VP9_DECODER 1 +%define CONFIG_VP9_RKMPP_DECODER 0 +%define CONFIG_VP9_V4L2M2M_DECODER 0 %define CONFIG_VQA_DECODER 1 %define CONFIG_WEBP_DECODER 1 +%define CONFIG_WCMV_DECODER 1 +%define CONFIG_WRAPPED_AVFRAME_DECODER 1 %define CONFIG_WMV1_DECODER 1 %define CONFIG_WMV2_DECODER 1 %define CONFIG_WMV3_DECODER 1 %define CONFIG_WMV3_CRYSTALHD_DECODER 0 -%define CONFIG_WMV3_VDPAU_DECODER 0 %define CONFIG_WMV3IMAGE_DECODER 1 %define CONFIG_WNV1_DECODER 1 %define CONFIG_XAN_WC3_DECODER 1 @@ -818,8 +944,10 @@ %define CONFIG_XBM_DECODER 1 %define CONFIG_XFACE_DECODER 1 %define CONFIG_XL_DECODER 1 +%define CONFIG_XPM_DECODER 1 %define CONFIG_XWD_DECODER 1 %define CONFIG_Y41P_DECODER 1 +%define CONFIG_YLC_DECODER 1 %define CONFIG_YOP_DECODER 1 %define CONFIG_YUV4_DECODER 1 %define CONFIG_ZERO12V_DECODER 1 @@ -836,20 +964,27 @@ %define CONFIG_AMRNB_DECODER 1 %define CONFIG_AMRWB_DECODER 1 %define CONFIG_APE_DECODER 1 +%define CONFIG_APTX_DECODER 1 +%define CONFIG_APTX_HD_DECODER 1 %define CONFIG_ATRAC1_DECODER 1 %define CONFIG_ATRAC3_DECODER 1 +%define CONFIG_ATRAC3AL_DECODER 1 %define CONFIG_ATRAC3P_DECODER 0 +%define CONFIG_ATRAC3PAL_DECODER 1 +%define CONFIG_ATRAC9_DECODER 1 %define CONFIG_BINKAUDIO_DCT_DECODER 1 %define CONFIG_BINKAUDIO_RDFT_DECODER 1 %define CONFIG_BMV_AUDIO_DECODER 1 %define CONFIG_COOK_DECODER 1 %define CONFIG_DCA_DECODER 1 +%define CONFIG_DOLBY_E_DECODER 1 %define CONFIG_DSD_LSBF_DECODER 1 %define CONFIG_DSD_MSBF_DECODER 1 %define CONFIG_DSD_LSBF_PLANAR_DECODER 1 %define CONFIG_DSD_MSBF_PLANAR_DECODER 1 %define CONFIG_DSICINAUDIO_DECODER 1 %define CONFIG_DSS_SP_DECODER 1 +%define CONFIG_DST_DECODER 1 %define CONFIG_EAC3_DECODER 1 %define CONFIG_EVRC_DECODER 1 %define CONFIG_FFWAVESYNTH_DECODER 1 @@ -859,7 +994,9 @@ %define CONFIG_GSM_DECODER 1 %define CONFIG_GSM_MS_DECODER 1 %define CONFIG_IAC_DECODER 1 +%define CONFIG_ILBC_DECODER 1 %define CONFIG_IMC_DECODER 1 +%define CONFIG_INTERPLAY_ACM_DECODER 1 %define CONFIG_MACE3_DECODER 1 %define CONFIG_MACE6_DECODER 1 %define CONFIG_METASOUND_DECODER 1 @@ -868,12 +1005,12 @@ %define CONFIG_MP1FLOAT_DECODER 1 %define CONFIG_MP2_DECODER 1 %define CONFIG_MP2FLOAT_DECODER 1 -%define CONFIG_MP3_DECODER 1 %define CONFIG_MP3FLOAT_DECODER 1 -%define CONFIG_MP3ADU_DECODER 1 +%define CONFIG_MP3_DECODER 1 %define CONFIG_MP3ADUFLOAT_DECODER 1 -%define CONFIG_MP3ON4_DECODER 1 +%define CONFIG_MP3ADU_DECODER 1 %define CONFIG_MP3ON4FLOAT_DECODER 1 +%define CONFIG_MP3ON4_DECODER 1 %define CONFIG_MPC7_DECODER 1 %define CONFIG_MPC8_DECODER 1 %define CONFIG_NELLYMOSER_DECODER 1 @@ -882,9 +1019,11 @@ %define CONFIG_PAF_AUDIO_DECODER 1 %define CONFIG_QCELP_DECODER 1 %define CONFIG_QDM2_DECODER 1 +%define CONFIG_QDMC_DECODER 1 %define CONFIG_RA_144_DECODER 1 %define CONFIG_RA_288_DECODER 1 %define CONFIG_RALF_DECODER 1 +%define CONFIG_SBC_DECODER 1 %define CONFIG_SHORTEN_DECODER 1 %define CONFIG_SIPR_DECODER 1 %define CONFIG_SMACKAUD_DECODER 1 @@ -903,9 +1042,13 @@ %define CONFIG_WMAV2_DECODER 1 %define CONFIG_WMAVOICE_DECODER 1 %define CONFIG_WS_SND1_DECODER 1 +%define CONFIG_XMA1_DECODER 1 +%define CONFIG_XMA2_DECODER 1 %define CONFIG_PCM_ALAW_DECODER 1 %define CONFIG_PCM_BLURAY_DECODER 1 %define CONFIG_PCM_DVD_DECODER 1 +%define CONFIG_PCM_F16LE_DECODER 1 +%define CONFIG_PCM_F24LE_DECODER 1 %define CONFIG_PCM_F32BE_DECODER 1 %define CONFIG_PCM_F32LE_DECODER 1 %define CONFIG_PCM_F64BE_DECODER 1 @@ -925,6 +1068,8 @@ %define CONFIG_PCM_S32BE_DECODER 1 %define CONFIG_PCM_S32LE_DECODER 1 %define CONFIG_PCM_S32LE_PLANAR_DECODER 1 +%define CONFIG_PCM_S64BE_DECODER 1 +%define CONFIG_PCM_S64LE_DECODER 1 %define CONFIG_PCM_U8_DECODER 1 %define CONFIG_PCM_U16BE_DECODER 1 %define CONFIG_PCM_U16LE_DECODER 1 @@ -932,7 +1077,9 @@ %define CONFIG_PCM_U24LE_DECODER 1 %define CONFIG_PCM_U32BE_DECODER 1 %define CONFIG_PCM_U32LE_DECODER 1 +%define CONFIG_PCM_VIDC_DECODER 1 %define CONFIG_PCM_ZORK_DECODER 1 +%define CONFIG_GREMLIN_DPCM_DECODER 1 %define CONFIG_INTERPLAY_DPCM_DECODER 1 %define CONFIG_ROQ_DPCM_DECODER 1 %define CONFIG_SOL_DPCM_DECODER 1 @@ -940,6 +1087,7 @@ %define CONFIG_ADPCM_4XM_DECODER 1 %define CONFIG_ADPCM_ADX_DECODER 1 %define CONFIG_ADPCM_AFC_DECODER 1 +%define CONFIG_ADPCM_AICA_DECODER 1 %define CONFIG_ADPCM_CT_DECODER 1 %define CONFIG_ADPCM_DTK_DECODER 1 %define CONFIG_ADPCM_EA_DECODER 1 @@ -953,6 +1101,7 @@ %define CONFIG_ADPCM_G726LE_DECODER 1 %define CONFIG_ADPCM_IMA_AMV_DECODER 1 %define CONFIG_ADPCM_IMA_APC_DECODER 1 +%define CONFIG_ADPCM_IMA_DAT4_DECODER 1 %define CONFIG_ADPCM_IMA_DK3_DECODER 1 %define CONFIG_ADPCM_IMA_DK4_DECODER 1 %define CONFIG_ADPCM_IMA_EA_EACS_DECODER 1 @@ -965,6 +1114,8 @@ %define CONFIG_ADPCM_IMA_WAV_DECODER 1 %define CONFIG_ADPCM_IMA_WS_DECODER 1 %define CONFIG_ADPCM_MS_DECODER 1 +%define CONFIG_ADPCM_MTAF_DECODER 1 +%define CONFIG_ADPCM_PSX_DECODER 1 %define CONFIG_ADPCM_SBPRO_2_DECODER 1 %define CONFIG_ADPCM_SBPRO_3_DECODER 1 %define CONFIG_ADPCM_SBPRO_4_DECODER 1 @@ -974,7 +1125,6 @@ %define CONFIG_ADPCM_VIMA_DECODER 1 %define CONFIG_ADPCM_XA_DECODER 1 %define CONFIG_ADPCM_YAMAHA_DECODER 1 -%define CONFIG_VIMA_DECODER 1 %define CONFIG_SSA_DECODER 1 %define CONFIG_ASS_DECODER 1 %define CONFIG_CCAPTION_DECODER 1 @@ -997,8 +1147,26 @@ %define CONFIG_VPLAYER_DECODER 1 %define CONFIG_WEBVTT_DECODER 1 %define CONFIG_XSUB_DECODER 1 +%define CONFIG_AAC_AT_DECODER 0 +%define CONFIG_AC3_AT_DECODER 0 +%define CONFIG_ADPCM_IMA_QT_AT_DECODER 0 +%define CONFIG_ALAC_AT_DECODER 0 +%define CONFIG_AMR_NB_AT_DECODER 0 +%define CONFIG_EAC3_AT_DECODER 0 +%define CONFIG_GSM_MS_AT_DECODER 0 +%define CONFIG_ILBC_AT_DECODER 0 +%define CONFIG_MP1_AT_DECODER 0 +%define CONFIG_MP2_AT_DECODER 0 +%define CONFIG_MP3_AT_DECODER 0 +%define CONFIG_PCM_ALAW_AT_DECODER 0 +%define CONFIG_PCM_MULAW_AT_DECODER 0 +%define CONFIG_QDMC_AT_DECODER 0 +%define CONFIG_QDM2_AT_DECODER 0 +%define CONFIG_LIBAOM_AV1_DECODER 0 %define CONFIG_LIBCELT_DECODER 0 -%define CONFIG_LIBDCADEC_DECODER 0 +%define CONFIG_LIBCODEC2_DECODER 0 +%define CONFIG_LIBDAV1D_DECODER 0 +%define CONFIG_LIBDAVS2_DECODER 0 %define CONFIG_LIBFDK_AAC_DECODER 0 %define CONFIG_LIBGSM_DECODER 0 %define CONFIG_LIBGSM_MS_DECODER 0 @@ -1007,10 +1175,8 @@ %define CONFIG_LIBOPENCORE_AMRWB_DECODER 0 %define CONFIG_LIBOPENJPEG_DECODER 0 %define CONFIG_LIBOPUS_DECODER 0 -%define CONFIG_LIBSCHROEDINGER_DECODER 0 +%define CONFIG_LIBRSVG_DECODER 0 %define CONFIG_LIBSPEEX_DECODER 0 -%define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0 -%define CONFIG_LIBUTVIDEO_DECODER 0 %define CONFIG_LIBVORBIS_DECODER 0 %define CONFIG_LIBVPX_VP8_DECODER 0 %define CONFIG_LIBVPX_VP9_DECODER 0 @@ -1018,250 +1184,21 @@ %define CONFIG_BINTEXT_DECODER 1 %define CONFIG_XBIN_DECODER 1 %define CONFIG_IDF_DECODER 1 -%define CONFIG_AAC_DEMUXER 1 -%define CONFIG_AC3_DEMUXER 1 -%define CONFIG_ACT_DEMUXER 1 -%define CONFIG_ADF_DEMUXER 1 -%define CONFIG_ADP_DEMUXER 1 -%define CONFIG_ADX_DEMUXER 1 -%define CONFIG_AEA_DEMUXER 1 -%define CONFIG_AFC_DEMUXER 1 -%define CONFIG_AIFF_DEMUXER 1 -%define CONFIG_AMR_DEMUXER 1 -%define CONFIG_ANM_DEMUXER 1 -%define CONFIG_APC_DEMUXER 1 -%define CONFIG_APE_DEMUXER 1 -%define CONFIG_APNG_DEMUXER 1 -%define CONFIG_AQTITLE_DEMUXER 1 -%define CONFIG_ASF_DEMUXER 1 -%define CONFIG_ASF_O_DEMUXER 1 -%define CONFIG_ASS_DEMUXER 1 -%define CONFIG_AST_DEMUXER 1 -%define CONFIG_AU_DEMUXER 1 -%define CONFIG_AVI_DEMUXER 1 -%define CONFIG_AVISYNTH_DEMUXER 0 -%define CONFIG_AVR_DEMUXER 1 -%define CONFIG_AVS_DEMUXER 1 -%define CONFIG_BETHSOFTVID_DEMUXER 1 -%define CONFIG_BFI_DEMUXER 1 -%define CONFIG_BINTEXT_DEMUXER 1 -%define CONFIG_BINK_DEMUXER 1 -%define CONFIG_BIT_DEMUXER 1 -%define CONFIG_BMV_DEMUXER 1 -%define CONFIG_BFSTM_DEMUXER 1 -%define CONFIG_BRSTM_DEMUXER 1 -%define CONFIG_BOA_DEMUXER 1 -%define CONFIG_C93_DEMUXER 1 -%define CONFIG_CAF_DEMUXER 1 -%define CONFIG_CAVSVIDEO_DEMUXER 1 -%define CONFIG_CDG_DEMUXER 1 -%define CONFIG_CDXL_DEMUXER 1 -%define CONFIG_CINE_DEMUXER 1 -%define CONFIG_CONCAT_DEMUXER 1 -%define CONFIG_DATA_DEMUXER 1 -%define CONFIG_DAUD_DEMUXER 1 -%define CONFIG_DFA_DEMUXER 1 -%define CONFIG_DIRAC_DEMUXER 1 -%define CONFIG_DNXHD_DEMUXER 1 -%define CONFIG_DSF_DEMUXER 1 -%define CONFIG_DSICIN_DEMUXER 1 -%define CONFIG_DSS_DEMUXER 1 -%define CONFIG_DTS_DEMUXER 1 -%define CONFIG_DTSHD_DEMUXER 1 -%define CONFIG_DV_DEMUXER 1 -%define CONFIG_DVBSUB_DEMUXER 1 -%define CONFIG_DXA_DEMUXER 1 -%define CONFIG_EA_DEMUXER 1 -%define CONFIG_EA_CDATA_DEMUXER 1 -%define CONFIG_EAC3_DEMUXER 1 -%define CONFIG_EPAF_DEMUXER 1 -%define CONFIG_FFM_DEMUXER 1 -%define CONFIG_FFMETADATA_DEMUXER 1 -%define CONFIG_FILMSTRIP_DEMUXER 1 -%define CONFIG_FLAC_DEMUXER 1 -%define CONFIG_FLIC_DEMUXER 1 -%define CONFIG_FLV_DEMUXER 1 -%define CONFIG_LIVE_FLV_DEMUXER 1 -%define CONFIG_FOURXM_DEMUXER 1 -%define CONFIG_FRM_DEMUXER 1 -%define CONFIG_G722_DEMUXER 1 -%define CONFIG_G723_1_DEMUXER 1 -%define CONFIG_G729_DEMUXER 1 -%define CONFIG_GIF_DEMUXER 1 -%define CONFIG_GSM_DEMUXER 1 -%define CONFIG_GXF_DEMUXER 1 -%define CONFIG_H261_DEMUXER 1 -%define CONFIG_H263_DEMUXER 1 -%define CONFIG_H264_DEMUXER 1 -%define CONFIG_HEVC_DEMUXER 1 -%define CONFIG_HLS_DEMUXER 1 -%define CONFIG_HNM_DEMUXER 1 -%define CONFIG_ICO_DEMUXER 1 -%define CONFIG_IDCIN_DEMUXER 1 -%define CONFIG_IDF_DEMUXER 1 -%define CONFIG_IFF_DEMUXER 1 -%define CONFIG_ILBC_DEMUXER 1 -%define CONFIG_IMAGE2_DEMUXER 1 -%define CONFIG_IMAGE2PIPE_DEMUXER 1 -%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 1 -%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 1 -%define CONFIG_INGENIENT_DEMUXER 1 -%define CONFIG_IPMOVIE_DEMUXER 1 -%define CONFIG_IRCAM_DEMUXER 1 -%define CONFIG_ISS_DEMUXER 1 -%define CONFIG_IV8_DEMUXER 1 -%define CONFIG_IVF_DEMUXER 1 -%define CONFIG_JACOSUB_DEMUXER 1 -%define CONFIG_JV_DEMUXER 1 -%define CONFIG_LATM_DEMUXER 1 -%define CONFIG_LMLM4_DEMUXER 1 -%define CONFIG_LOAS_DEMUXER 1 -%define CONFIG_LRC_DEMUXER 1 -%define CONFIG_LVF_DEMUXER 1 -%define CONFIG_LXF_DEMUXER 1 -%define CONFIG_M4V_DEMUXER 1 -%define CONFIG_MATROSKA_DEMUXER 1 -%define CONFIG_MGSTS_DEMUXER 1 -%define CONFIG_MICRODVD_DEMUXER 1 -%define CONFIG_MJPEG_DEMUXER 1 -%define CONFIG_MLP_DEMUXER 1 -%define CONFIG_MLV_DEMUXER 1 -%define CONFIG_MM_DEMUXER 1 -%define CONFIG_MMF_DEMUXER 1 -%define CONFIG_MOV_DEMUXER 1 -%define CONFIG_MP3_DEMUXER 1 -%define CONFIG_MPC_DEMUXER 1 -%define CONFIG_MPC8_DEMUXER 1 -%define CONFIG_MPEGPS_DEMUXER 1 -%define CONFIG_MPEGTS_DEMUXER 1 -%define CONFIG_MPEGTSRAW_DEMUXER 1 -%define CONFIG_MPEGVIDEO_DEMUXER 1 -%define CONFIG_MPJPEG_DEMUXER 1 -%define CONFIG_MPL2_DEMUXER 1 -%define CONFIG_MPSUB_DEMUXER 1 -%define CONFIG_MSNWC_TCP_DEMUXER 1 -%define CONFIG_MTV_DEMUXER 1 -%define CONFIG_MV_DEMUXER 1 -%define CONFIG_MVI_DEMUXER 1 -%define CONFIG_MXF_DEMUXER 1 -%define CONFIG_MXG_DEMUXER 1 -%define CONFIG_NC_DEMUXER 1 -%define CONFIG_NISTSPHERE_DEMUXER 1 -%define CONFIG_NSV_DEMUXER 1 -%define CONFIG_NUT_DEMUXER 1 -%define CONFIG_NUV_DEMUXER 1 -%define CONFIG_OGG_DEMUXER 1 -%define CONFIG_OMA_DEMUXER 1 -%define CONFIG_PAF_DEMUXER 1 -%define CONFIG_PCM_ALAW_DEMUXER 1 -%define CONFIG_PCM_MULAW_DEMUXER 1 -%define CONFIG_PCM_F64BE_DEMUXER 1 -%define CONFIG_PCM_F64LE_DEMUXER 1 -%define CONFIG_PCM_F32BE_DEMUXER 1 -%define CONFIG_PCM_F32LE_DEMUXER 1 -%define CONFIG_PCM_S32BE_DEMUXER 1 -%define CONFIG_PCM_S32LE_DEMUXER 1 -%define CONFIG_PCM_S24BE_DEMUXER 1 -%define CONFIG_PCM_S24LE_DEMUXER 1 -%define CONFIG_PCM_S16BE_DEMUXER 1 -%define CONFIG_PCM_S16LE_DEMUXER 1 -%define CONFIG_PCM_S8_DEMUXER 1 -%define CONFIG_PCM_U32BE_DEMUXER 1 -%define CONFIG_PCM_U32LE_DEMUXER 1 -%define CONFIG_PCM_U24BE_DEMUXER 1 -%define CONFIG_PCM_U24LE_DEMUXER 1 -%define CONFIG_PCM_U16BE_DEMUXER 1 -%define CONFIG_PCM_U16LE_DEMUXER 1 -%define CONFIG_PCM_U8_DEMUXER 1 -%define CONFIG_PJS_DEMUXER 1 -%define CONFIG_PMP_DEMUXER 1 -%define CONFIG_PVA_DEMUXER 1 -%define CONFIG_PVF_DEMUXER 1 -%define CONFIG_QCP_DEMUXER 1 -%define CONFIG_R3D_DEMUXER 1 -%define CONFIG_RAWVIDEO_DEMUXER 1 -%define CONFIG_REALTEXT_DEMUXER 1 -%define CONFIG_REDSPARK_DEMUXER 1 -%define CONFIG_RL2_DEMUXER 1 -%define CONFIG_RM_DEMUXER 1 -%define CONFIG_ROQ_DEMUXER 1 -%define CONFIG_RPL_DEMUXER 1 -%define CONFIG_RSD_DEMUXER 1 -%define CONFIG_RSO_DEMUXER 1 -%define CONFIG_RTP_DEMUXER 0 -%define CONFIG_RTSP_DEMUXER 0 -%define CONFIG_SAMI_DEMUXER 1 -%define CONFIG_SAP_DEMUXER 0 -%define CONFIG_SBG_DEMUXER 1 -%define CONFIG_SDP_DEMUXER 0 -%define CONFIG_SDR2_DEMUXER 1 -%define CONFIG_SEGAFILM_DEMUXER 1 -%define CONFIG_SHORTEN_DEMUXER 1 -%define CONFIG_SIFF_DEMUXER 1 -%define CONFIG_SLN_DEMUXER 1 -%define CONFIG_SMACKER_DEMUXER 1 -%define CONFIG_SMJPEG_DEMUXER 1 -%define CONFIG_SMUSH_DEMUXER 1 -%define CONFIG_SOL_DEMUXER 1 -%define CONFIG_SOX_DEMUXER 1 -%define CONFIG_SPDIF_DEMUXER 1 -%define CONFIG_SRT_DEMUXER 1 -%define CONFIG_STR_DEMUXER 1 -%define CONFIG_STL_DEMUXER 1 -%define CONFIG_SUBVIEWER1_DEMUXER 1 -%define CONFIG_SUBVIEWER_DEMUXER 1 -%define CONFIG_SUP_DEMUXER 1 -%define CONFIG_SWF_DEMUXER 1 -%define CONFIG_TAK_DEMUXER 1 -%define CONFIG_TEDCAPTIONS_DEMUXER 1 -%define CONFIG_THP_DEMUXER 1 -%define CONFIG_TIERTEXSEQ_DEMUXER 1 -%define CONFIG_TMV_DEMUXER 1 -%define CONFIG_TRUEHD_DEMUXER 1 -%define CONFIG_TTA_DEMUXER 1 -%define CONFIG_TXD_DEMUXER 1 -%define CONFIG_TTY_DEMUXER 1 -%define CONFIG_VC1_DEMUXER 1 -%define CONFIG_VC1T_DEMUXER 1 -%define CONFIG_VIVO_DEMUXER 1 -%define CONFIG_VMD_DEMUXER 1 -%define CONFIG_VOBSUB_DEMUXER 1 -%define CONFIG_VOC_DEMUXER 1 -%define CONFIG_VPLAYER_DEMUXER 1 -%define CONFIG_VQF_DEMUXER 1 -%define CONFIG_W64_DEMUXER 1 -%define CONFIG_WAV_DEMUXER 1 -%define CONFIG_WC3_DEMUXER 1 -%define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 1 -%define CONFIG_WEBVTT_DEMUXER 1 -%define CONFIG_WSAUD_DEMUXER 1 -%define CONFIG_WSVQA_DEMUXER 1 -%define CONFIG_WTV_DEMUXER 1 -%define CONFIG_WV_DEMUXER 1 -%define CONFIG_XA_DEMUXER 1 -%define CONFIG_XBIN_DEMUXER 1 -%define CONFIG_XMV_DEMUXER 1 -%define CONFIG_XWMA_DEMUXER 1 -%define CONFIG_YOP_DEMUXER 1 -%define CONFIG_YUV4MPEGPIPE_DEMUXER 1 -%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PNG_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_SGI_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 1 -%define CONFIG_LIBGME_DEMUXER 0 -%define CONFIG_LIBMODPLUG_DEMUXER 0 -%define CONFIG_LIBNUT_DEMUXER 0 -%define CONFIG_LIBQUVI_DEMUXER 0 +%define CONFIG_LIBOPENH264_DECODER 0 +%define CONFIG_H264_CUVID_DECODER 0 +%define CONFIG_HEVC_CUVID_DECODER 0 +%define CONFIG_HEVC_MEDIACODEC_DECODER 0 +%define CONFIG_MJPEG_CUVID_DECODER 0 +%define CONFIG_MPEG1_CUVID_DECODER 0 +%define CONFIG_MPEG2_CUVID_DECODER 0 +%define CONFIG_MPEG4_CUVID_DECODER 0 +%define CONFIG_MPEG4_MEDIACODEC_DECODER 0 +%define CONFIG_VC1_CUVID_DECODER 0 +%define CONFIG_VP8_CUVID_DECODER 0 +%define CONFIG_VP8_MEDIACODEC_DECODER 0 +%define CONFIG_VP8_QSV_DECODER 0 +%define CONFIG_VP9_CUVID_DECODER 0 +%define CONFIG_VP9_MEDIACODEC_DECODER 0 %define CONFIG_A64MULTI_ENCODER 0 %define CONFIG_A64MULTI5_ENCODER 0 %define CONFIG_ALIAS_PIX_ENCODER 0 @@ -1281,6 +1218,7 @@ %define CONFIG_DVVIDEO_ENCODER 0 %define CONFIG_FFV1_ENCODER 0 %define CONFIG_FFVHUFF_ENCODER 0 +%define CONFIG_FITS_ENCODER 0 %define CONFIG_FLASHSV_ENCODER 0 %define CONFIG_FLASHSV2_ENCODER 0 %define CONFIG_FLV_ENCODER 0 @@ -1293,6 +1231,7 @@ %define CONFIG_JPEG2000_ENCODER 0 %define CONFIG_JPEGLS_ENCODER 0 %define CONFIG_LJPEG_ENCODER 0 +%define CONFIG_MAGICYUV_ENCODER 0 %define CONFIG_MJPEG_ENCODER 0 %define CONFIG_MPEG1VIDEO_ENCODER 0 %define CONFIG_MPEG2VIDEO_ENCODER 0 @@ -1329,6 +1268,8 @@ %define CONFIG_V308_ENCODER 0 %define CONFIG_V408_ENCODER 0 %define CONFIG_V410_ENCODER 0 +%define CONFIG_VC2_ENCODER 0 +%define CONFIG_WRAPPED_AVFRAME_ENCODER 0 %define CONFIG_WMV1_ENCODER 0 %define CONFIG_WMV2_ENCODER 0 %define CONFIG_XBM_ENCODER 0 @@ -1342,16 +1283,22 @@ %define CONFIG_AC3_ENCODER 0 %define CONFIG_AC3_FIXED_ENCODER 0 %define CONFIG_ALAC_ENCODER 0 +%define CONFIG_APTX_ENCODER 0 +%define CONFIG_APTX_HD_ENCODER 0 %define CONFIG_DCA_ENCODER 0 %define CONFIG_EAC3_ENCODER 0 %define CONFIG_FLAC_ENCODER 0 %define CONFIG_G723_1_ENCODER 0 +%define CONFIG_MLP_ENCODER 0 %define CONFIG_MP2_ENCODER 0 %define CONFIG_MP2FIXED_ENCODER 0 %define CONFIG_NELLYMOSER_ENCODER 0 +%define CONFIG_OPUS_ENCODER 0 %define CONFIG_RA_144_ENCODER 0 +%define CONFIG_SBC_ENCODER 0 %define CONFIG_SONIC_ENCODER 0 %define CONFIG_SONIC_LS_ENCODER 0 +%define CONFIG_TRUEHD_ENCODER 0 %define CONFIG_TTA_ENCODER 0 %define CONFIG_VORBIS_ENCODER 0 %define CONFIG_WAVPACK_ENCODER 0 @@ -1376,6 +1323,8 @@ %define CONFIG_PCM_S32BE_ENCODER 0 %define CONFIG_PCM_S32LE_ENCODER 0 %define CONFIG_PCM_S32LE_PLANAR_ENCODER 0 +%define CONFIG_PCM_S64BE_ENCODER 0 +%define CONFIG_PCM_S64LE_ENCODER 0 %define CONFIG_PCM_U8_ENCODER 0 %define CONFIG_PCM_U16BE_ENCODER 0 %define CONFIG_PCM_U16LE_ENCODER 0 @@ -1383,10 +1332,12 @@ %define CONFIG_PCM_U24LE_ENCODER 0 %define CONFIG_PCM_U32BE_ENCODER 0 %define CONFIG_PCM_U32LE_ENCODER 0 +%define CONFIG_PCM_VIDC_ENCODER 0 %define CONFIG_ROQ_DPCM_ENCODER 0 %define CONFIG_ADPCM_ADX_ENCODER 0 %define CONFIG_ADPCM_G722_ENCODER 0 %define CONFIG_ADPCM_G726_ENCODER 0 +%define CONFIG_ADPCM_G726LE_ENCODER 0 %define CONFIG_ADPCM_IMA_QT_ENCODER 0 %define CONFIG_ADPCM_IMA_WAV_ENCODER 0 %define CONFIG_ADPCM_MS_ENCODER 0 @@ -1399,9 +1350,16 @@ %define CONFIG_MOVTEXT_ENCODER 0 %define CONFIG_SRT_ENCODER 0 %define CONFIG_SUBRIP_ENCODER 0 +%define CONFIG_TEXT_ENCODER 0 %define CONFIG_WEBVTT_ENCODER 0 %define CONFIG_XSUB_ENCODER 0 -%define CONFIG_LIBFAAC_ENCODER 0 +%define CONFIG_AAC_AT_ENCODER 0 +%define CONFIG_ALAC_AT_ENCODER 0 +%define CONFIG_ILBC_AT_ENCODER 0 +%define CONFIG_PCM_ALAW_AT_ENCODER 0 +%define CONFIG_PCM_MULAW_AT_ENCODER 0 +%define CONFIG_LIBAOM_AV1_ENCODER 0 +%define CONFIG_LIBCODEC2_ENCODER 0 %define CONFIG_LIBFDK_AAC_ENCODER 0 %define CONFIG_LIBGSM_ENCODER 0 %define CONFIG_LIBGSM_MS_ENCODER 0 @@ -1410,13 +1368,10 @@ %define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0 %define CONFIG_LIBOPENJPEG_ENCODER 0 %define CONFIG_LIBOPUS_ENCODER 0 -%define CONFIG_LIBSCHROEDINGER_ENCODER 0 %define CONFIG_LIBSHINE_ENCODER 0 %define CONFIG_LIBSPEEX_ENCODER 0 %define CONFIG_LIBTHEORA_ENCODER 0 %define CONFIG_LIBTWOLAME_ENCODER 0 -%define CONFIG_LIBUTVIDEO_ENCODER 0 -%define CONFIG_LIBVO_AACENC_ENCODER 0 %define CONFIG_LIBVO_AMRWBENC_ENCODER 0 %define CONFIG_LIBVORBIS_ENCODER 0 %define CONFIG_LIBVPX_VP8_ENCODER 0 @@ -1429,30 +1384,203 @@ %define CONFIG_LIBX264RGB_ENCODER 0 %define CONFIG_LIBX265_ENCODER 0 %define CONFIG_LIBXAVS_ENCODER 0 +%define CONFIG_LIBXAVS2_ENCODER 0 %define CONFIG_LIBXVID_ENCODER 0 -%define CONFIG_LIBAACPLUS_ENCODER 0 +%define CONFIG_H263_V4L2M2M_ENCODER 0 %define CONFIG_LIBOPENH264_ENCODER 0 +%define CONFIG_H264_AMF_ENCODER 0 +%define CONFIG_H264_NVENC_ENCODER 0 +%define CONFIG_H264_OMX_ENCODER 0 %define CONFIG_H264_QSV_ENCODER 0 +%define CONFIG_H264_V4L2M2M_ENCODER 0 +%define CONFIG_H264_VAAPI_ENCODER 0 +%define CONFIG_H264_VIDEOTOOLBOX_ENCODER 0 %define CONFIG_NVENC_ENCODER 0 %define CONFIG_NVENC_H264_ENCODER 0 %define CONFIG_NVENC_HEVC_ENCODER 0 +%define CONFIG_HEVC_AMF_ENCODER 0 +%define CONFIG_HEVC_NVENC_ENCODER 0 %define CONFIG_HEVC_QSV_ENCODER 0 +%define CONFIG_HEVC_V4L2M2M_ENCODER 0 +%define CONFIG_HEVC_VAAPI_ENCODER 0 +%define CONFIG_HEVC_VIDEOTOOLBOX_ENCODER 0 %define CONFIG_LIBKVAZAAR_ENCODER 0 +%define CONFIG_MJPEG_QSV_ENCODER 0 +%define CONFIG_MJPEG_VAAPI_ENCODER 0 %define CONFIG_MPEG2_QSV_ENCODER 0 +%define CONFIG_MPEG2_VAAPI_ENCODER 0 +%define CONFIG_MPEG4_V4L2M2M_ENCODER 0 +%define CONFIG_VP8_V4L2M2M_ENCODER 0 +%define CONFIG_VP8_VAAPI_ENCODER 0 +%define CONFIG_VP9_VAAPI_ENCODER 0 +%define CONFIG_H263_VAAPI_HWACCEL 0 +%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0 +%define CONFIG_H264_D3D11VA_HWACCEL 0 +%define CONFIG_H264_D3D11VA2_HWACCEL 0 +%define CONFIG_H264_DXVA2_HWACCEL 0 +%define CONFIG_H264_NVDEC_HWACCEL 0 +%define CONFIG_H264_VAAPI_HWACCEL 0 +%define CONFIG_H264_VDPAU_HWACCEL 0 +%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0 +%define CONFIG_HEVC_D3D11VA_HWACCEL 0 +%define CONFIG_HEVC_D3D11VA2_HWACCEL 0 +%define CONFIG_HEVC_DXVA2_HWACCEL 0 +%define CONFIG_HEVC_NVDEC_HWACCEL 0 +%define CONFIG_HEVC_VAAPI_HWACCEL 0 +%define CONFIG_HEVC_VDPAU_HWACCEL 0 +%define CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL 0 +%define CONFIG_MJPEG_NVDEC_HWACCEL 0 +%define CONFIG_MJPEG_VAAPI_HWACCEL 0 +%define CONFIG_MPEG1_NVDEC_HWACCEL 0 +%define CONFIG_MPEG1_VDPAU_HWACCEL 0 +%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 +%define CONFIG_MPEG1_XVMC_HWACCEL 0 +%define CONFIG_MPEG2_D3D11VA_HWACCEL 0 +%define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 +%define CONFIG_MPEG2_NVDEC_HWACCEL 0 +%define CONFIG_MPEG2_DXVA2_HWACCEL 0 +%define CONFIG_MPEG2_VAAPI_HWACCEL 0 +%define CONFIG_MPEG2_VDPAU_HWACCEL 0 +%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 +%define CONFIG_MPEG2_XVMC_HWACCEL 0 +%define CONFIG_MPEG4_NVDEC_HWACCEL 0 +%define CONFIG_MPEG4_VAAPI_HWACCEL 0 +%define CONFIG_MPEG4_VDPAU_HWACCEL 0 +%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0 +%define CONFIG_VC1_D3D11VA_HWACCEL 0 +%define CONFIG_VC1_D3D11VA2_HWACCEL 0 +%define CONFIG_VC1_DXVA2_HWACCEL 0 +%define CONFIG_VC1_NVDEC_HWACCEL 0 +%define CONFIG_VC1_VAAPI_HWACCEL 0 +%define CONFIG_VC1_VDPAU_HWACCEL 0 +%define CONFIG_VP8_NVDEC_HWACCEL 0 +%define CONFIG_VP8_VAAPI_HWACCEL 0 +%define CONFIG_VP9_D3D11VA_HWACCEL 0 +%define CONFIG_VP9_D3D11VA2_HWACCEL 0 +%define CONFIG_VP9_DXVA2_HWACCEL 0 +%define CONFIG_VP9_NVDEC_HWACCEL 0 +%define CONFIG_VP9_VAAPI_HWACCEL 0 +%define CONFIG_WMV3_D3D11VA_HWACCEL 0 +%define CONFIG_WMV3_D3D11VA2_HWACCEL 0 +%define CONFIG_WMV3_DXVA2_HWACCEL 0 +%define CONFIG_WMV3_NVDEC_HWACCEL 0 +%define CONFIG_WMV3_VAAPI_HWACCEL 0 +%define CONFIG_WMV3_VDPAU_HWACCEL 0 +%define CONFIG_AAC_PARSER 1 +%define CONFIG_AAC_LATM_PARSER 1 +%define CONFIG_AC3_PARSER 1 +%define CONFIG_ADX_PARSER 1 +%define CONFIG_AV1_PARSER 1 +%define CONFIG_AVS2_PARSER 1 +%define CONFIG_BMP_PARSER 1 +%define CONFIG_CAVSVIDEO_PARSER 1 +%define CONFIG_COOK_PARSER 1 +%define CONFIG_DCA_PARSER 1 +%define CONFIG_DIRAC_PARSER 1 +%define CONFIG_DNXHD_PARSER 1 +%define CONFIG_DPX_PARSER 1 +%define CONFIG_DVAUDIO_PARSER 1 +%define CONFIG_DVBSUB_PARSER 1 +%define CONFIG_DVDSUB_PARSER 1 +%define CONFIG_DVD_NAV_PARSER 1 +%define CONFIG_FLAC_PARSER 1 +%define CONFIG_G729_PARSER 1 +%define CONFIG_GSM_PARSER 1 +%define CONFIG_H261_PARSER 1 +%define CONFIG_H263_PARSER 1 +%define CONFIG_H264_PARSER 1 +%define CONFIG_HEVC_PARSER 1 +%define CONFIG_MJPEG_PARSER 1 +%define CONFIG_MLP_PARSER 1 +%define CONFIG_MPEG4VIDEO_PARSER 1 +%define CONFIG_MPEGAUDIO_PARSER 1 +%define CONFIG_MPEGVIDEO_PARSER 1 +%define CONFIG_OPUS_PARSER 1 +%define CONFIG_PNG_PARSER 1 +%define CONFIG_PNM_PARSER 1 +%define CONFIG_RV30_PARSER 1 +%define CONFIG_RV40_PARSER 1 +%define CONFIG_SBC_PARSER 1 +%define CONFIG_SIPR_PARSER 1 +%define CONFIG_TAK_PARSER 1 +%define CONFIG_VC1_PARSER 1 +%define CONFIG_VORBIS_PARSER 1 +%define CONFIG_VP3_PARSER 1 +%define CONFIG_VP8_PARSER 1 +%define CONFIG_VP9_PARSER 1 +%define CONFIG_XMA_PARSER 1 +%define CONFIG_ALSA_INDEV 0 +%define CONFIG_ANDROID_CAMERA_INDEV 0 +%define CONFIG_AVFOUNDATION_INDEV 0 +%define CONFIG_BKTR_INDEV 0 +%define CONFIG_DECKLINK_INDEV 0 +%define CONFIG_LIBNDI_NEWTEK_INDEV 0 +%define CONFIG_DSHOW_INDEV 0 +%define CONFIG_FBDEV_INDEV 0 +%define CONFIG_GDIGRAB_INDEV 0 +%define CONFIG_IEC61883_INDEV 0 +%define CONFIG_JACK_INDEV 0 +%define CONFIG_KMSGRAB_INDEV 0 +%define CONFIG_LAVFI_INDEV 0 +%define CONFIG_OPENAL_INDEV 0 +%define CONFIG_OSS_INDEV 0 +%define CONFIG_PULSE_INDEV 0 +%define CONFIG_SNDIO_INDEV 0 +%define CONFIG_V4L2_INDEV 0 +%define CONFIG_VFWCAP_INDEV 0 +%define CONFIG_XCBGRAB_INDEV 0 +%define CONFIG_LIBCDIO_INDEV 0 +%define CONFIG_LIBDC1394_INDEV 0 +%define CONFIG_ALSA_OUTDEV 0 +%define CONFIG_CACA_OUTDEV 0 +%define CONFIG_DECKLINK_OUTDEV 0 +%define CONFIG_LIBNDI_NEWTEK_OUTDEV 0 +%define CONFIG_FBDEV_OUTDEV 0 +%define CONFIG_OPENGL_OUTDEV 0 +%define CONFIG_OSS_OUTDEV 0 +%define CONFIG_PULSE_OUTDEV 0 +%define CONFIG_SDL2_OUTDEV 0 +%define CONFIG_SNDIO_OUTDEV 0 +%define CONFIG_V4L2_OUTDEV 0 +%define CONFIG_XV_OUTDEV 0 +%define CONFIG_ABENCH_FILTER 0 +%define CONFIG_ACOMPRESSOR_FILTER 0 +%define CONFIG_ACONTRAST_FILTER 0 +%define CONFIG_ACOPY_FILTER 0 +%define CONFIG_ACUE_FILTER 0 %define CONFIG_ACROSSFADE_FILTER 0 +%define CONFIG_ACROSSOVER_FILTER 0 +%define CONFIG_ACRUSHER_FILTER 0 +%define CONFIG_ADECLICK_FILTER 0 +%define CONFIG_ADECLIP_FILTER 0 %define CONFIG_ADELAY_FILTER 0 +%define CONFIG_ADERIVATIVE_FILTER 0 %define CONFIG_AECHO_FILTER 0 +%define CONFIG_AEMPHASIS_FILTER 0 %define CONFIG_AEVAL_FILTER 0 %define CONFIG_AFADE_FILTER 0 +%define CONFIG_AFFTDN_FILTER 0 +%define CONFIG_AFFTFILT_FILTER 0 +%define CONFIG_AFIR_FILTER 0 %define CONFIG_AFORMAT_FILTER 0 +%define CONFIG_AGATE_FILTER 0 +%define CONFIG_AIIR_FILTER 0 +%define CONFIG_AINTEGRAL_FILTER 0 %define CONFIG_AINTERLEAVE_FILTER 0 +%define CONFIG_ALIMITER_FILTER 0 %define CONFIG_ALLPASS_FILTER 0 +%define CONFIG_ALOOP_FILTER 0 %define CONFIG_AMERGE_FILTER 0 +%define CONFIG_AMETADATA_FILTER 0 %define CONFIG_AMIX_FILTER 0 +%define CONFIG_AMULTIPLY_FILTER 0 +%define CONFIG_ANEQUALIZER_FILTER 0 %define CONFIG_ANULL_FILTER 0 %define CONFIG_APAD_FILTER 0 %define CONFIG_APERMS_FILTER 0 %define CONFIG_APHASER_FILTER 0 +%define CONFIG_APULSATOR_FILTER 0 +%define CONFIG_AREALTIME_FILTER 0 %define CONFIG_ARESAMPLE_FILTER 0 %define CONFIG_AREVERSE_FILTER 0 %define CONFIG_ASELECT_FILTER 0 @@ -1462,10 +1590,10 @@ %define CONFIG_ASETRATE_FILTER 0 %define CONFIG_ASETTB_FILTER 0 %define CONFIG_ASHOWINFO_FILTER 0 +%define CONFIG_ASIDEDATA_FILTER 0 %define CONFIG_ASPLIT_FILTER 0 %define CONFIG_ASTATS_FILTER 0 -%define CONFIG_ASTREAMSYNC_FILTER 0 -%define CONFIG_ASYNCTS_FILTER 0 +%define CONFIG_ASTREAMSELECT_FILTER 0 %define CONFIG_ATEMPO_FILTER 0 %define CONFIG_ATRIM_FILTER 0 %define CONFIG_AZMQ_FILTER 0 @@ -1478,88 +1606,162 @@ %define CONFIG_CHANNELSPLIT_FILTER 0 %define CONFIG_CHORUS_FILTER 0 %define CONFIG_COMPAND_FILTER 0 +%define CONFIG_COMPENSATIONDELAY_FILTER 0 +%define CONFIG_CROSSFEED_FILTER 0 +%define CONFIG_CRYSTALIZER_FILTER 0 %define CONFIG_DCSHIFT_FILTER 0 +%define CONFIG_DRMETER_FILTER 0 %define CONFIG_DYNAUDNORM_FILTER 0 %define CONFIG_EARWAX_FILTER 0 %define CONFIG_EBUR128_FILTER 0 %define CONFIG_EQUALIZER_FILTER 0 +%define CONFIG_EXTRASTEREO_FILTER 0 +%define CONFIG_FIREQUALIZER_FILTER 0 %define CONFIG_FLANGER_FILTER 0 +%define CONFIG_HAAS_FILTER 0 +%define CONFIG_HDCD_FILTER 0 +%define CONFIG_HEADPHONE_FILTER 0 %define CONFIG_HIGHPASS_FILTER 0 +%define CONFIG_HIGHSHELF_FILTER 0 %define CONFIG_JOIN_FILTER 0 %define CONFIG_LADSPA_FILTER 0 +%define CONFIG_LOUDNORM_FILTER 0 %define CONFIG_LOWPASS_FILTER 0 +%define CONFIG_LOWSHELF_FILTER 0 +%define CONFIG_LV2_FILTER 0 +%define CONFIG_MCOMPAND_FILTER 0 %define CONFIG_PAN_FILTER 0 %define CONFIG_REPLAYGAIN_FILTER 0 %define CONFIG_RESAMPLE_FILTER 0 +%define CONFIG_RUBBERBAND_FILTER 0 %define CONFIG_SIDECHAINCOMPRESS_FILTER 0 +%define CONFIG_SIDECHAINGATE_FILTER 0 %define CONFIG_SILENCEDETECT_FILTER 0 %define CONFIG_SILENCEREMOVE_FILTER 0 +%define CONFIG_SOFALIZER_FILTER 0 +%define CONFIG_STEREOTOOLS_FILTER 0 +%define CONFIG_STEREOWIDEN_FILTER 0 +%define CONFIG_SUPEREQUALIZER_FILTER 0 +%define CONFIG_SURROUND_FILTER 0 %define CONFIG_TREBLE_FILTER 0 +%define CONFIG_TREMOLO_FILTER 0 +%define CONFIG_VIBRATO_FILTER 0 %define CONFIG_VOLUME_FILTER 0 %define CONFIG_VOLUMEDETECT_FILTER 0 %define CONFIG_AEVALSRC_FILTER 0 +%define CONFIG_ANOISESRC_FILTER 0 %define CONFIG_ANULLSRC_FILTER 0 %define CONFIG_FLITE_FILTER 0 +%define CONFIG_HILBERT_FILTER 0 +%define CONFIG_SINC_FILTER 0 %define CONFIG_SINE_FILTER 0 %define CONFIG_ANULLSINK_FILTER 0 %define CONFIG_ALPHAEXTRACT_FILTER 0 %define CONFIG_ALPHAMERGE_FILTER 0 +%define CONFIG_AMPLIFY_FILTER 0 %define CONFIG_ASS_FILTER 0 +%define CONFIG_ATADENOISE_FILTER 0 +%define CONFIG_AVGBLUR_FILTER 0 +%define CONFIG_AVGBLUR_OPENCL_FILTER 0 %define CONFIG_BBOX_FILTER 0 +%define CONFIG_BENCH_FILTER 0 +%define CONFIG_BITPLANENOISE_FILTER 0 %define CONFIG_BLACKDETECT_FILTER 0 %define CONFIG_BLACKFRAME_FILTER 0 %define CONFIG_BLEND_FILTER 0 +%define CONFIG_BM3D_FILTER 0 %define CONFIG_BOXBLUR_FILTER 0 +%define CONFIG_BOXBLUR_OPENCL_FILTER 0 +%define CONFIG_BWDIF_FILTER 0 +%define CONFIG_CHROMAHOLD_FILTER 0 +%define CONFIG_CHROMAKEY_FILTER 0 +%define CONFIG_CHROMASHIFT_FILTER 0 +%define CONFIG_CIESCOPE_FILTER 0 %define CONFIG_CODECVIEW_FILTER 0 %define CONFIG_COLORBALANCE_FILTER 0 %define CONFIG_COLORCHANNELMIXER_FILTER 0 %define CONFIG_COLORKEY_FILTER 0 %define CONFIG_COLORLEVELS_FILTER 0 %define CONFIG_COLORMATRIX_FILTER 0 +%define CONFIG_COLORSPACE_FILTER 0 +%define CONFIG_CONVOLUTION_FILTER 0 +%define CONFIG_CONVOLUTION_OPENCL_FILTER 0 +%define CONFIG_CONVOLVE_FILTER 0 %define CONFIG_COPY_FILTER 0 +%define CONFIG_COREIMAGE_FILTER 0 %define CONFIG_COVER_RECT_FILTER 0 %define CONFIG_CROP_FILTER 0 %define CONFIG_CROPDETECT_FILTER 0 +%define CONFIG_CUE_FILTER 0 %define CONFIG_CURVES_FILTER 0 +%define CONFIG_DATASCOPE_FILTER 0 %define CONFIG_DCTDNOIZ_FILTER 0 %define CONFIG_DEBAND_FILTER 0 +%define CONFIG_DEBLOCK_FILTER 0 %define CONFIG_DECIMATE_FILTER 0 +%define CONFIG_DECONVOLVE_FILTER 0 +%define CONFIG_DEDOT_FILTER 0 %define CONFIG_DEFLATE_FILTER 0 +%define CONFIG_DEFLICKER_FILTER 0 +%define CONFIG_DEINTERLACE_QSV_FILTER 0 +%define CONFIG_DEINTERLACE_VAAPI_FILTER 0 %define CONFIG_DEJUDDER_FILTER 0 %define CONFIG_DELOGO_FILTER 0 +%define CONFIG_DENOISE_VAAPI_FILTER 0 %define CONFIG_DESHAKE_FILTER 0 +%define CONFIG_DESPILL_FILTER 0 %define CONFIG_DETELECINE_FILTER 0 %define CONFIG_DILATION_FILTER 0 +%define CONFIG_DILATION_OPENCL_FILTER 0 +%define CONFIG_DISPLACE_FILTER 0 +%define CONFIG_DOUBLEWEAVE_FILTER 0 %define CONFIG_DRAWBOX_FILTER 0 %define CONFIG_DRAWGRAPH_FILTER 0 %define CONFIG_DRAWGRID_FILTER 0 %define CONFIG_DRAWTEXT_FILTER 0 %define CONFIG_EDGEDETECT_FILTER 0 %define CONFIG_ELBG_FILTER 0 +%define CONFIG_ENTROPY_FILTER 0 %define CONFIG_EQ_FILTER 0 %define CONFIG_EROSION_FILTER 0 +%define CONFIG_EROSION_OPENCL_FILTER 0 %define CONFIG_EXTRACTPLANES_FILTER 0 %define CONFIG_FADE_FILTER 0 +%define CONFIG_FFTDNOIZ_FILTER 0 %define CONFIG_FFTFILT_FILTER 0 %define CONFIG_FIELD_FILTER 0 +%define CONFIG_FIELDHINT_FILTER 0 %define CONFIG_FIELDMATCH_FILTER 0 %define CONFIG_FIELDORDER_FILTER 0 +%define CONFIG_FILLBORDERS_FILTER 0 %define CONFIG_FIND_RECT_FILTER 0 +%define CONFIG_FLOODFILL_FILTER 0 %define CONFIG_FORMAT_FILTER 0 %define CONFIG_FPS_FILTER 0 %define CONFIG_FRAMEPACK_FILTER 0 +%define CONFIG_FRAMERATE_FILTER 0 %define CONFIG_FRAMESTEP_FILTER 0 +%define CONFIG_FREEZEDETECT_FILTER 0 %define CONFIG_FREI0R_FILTER 0 %define CONFIG_FSPP_FILTER 0 +%define CONFIG_GBLUR_FILTER 0 %define CONFIG_GEQ_FILTER 0 %define CONFIG_GRADFUN_FILTER 0 +%define CONFIG_GRAPHMONITOR_FILTER 0 +%define CONFIG_GREYEDGE_FILTER 0 %define CONFIG_HALDCLUT_FILTER 0 %define CONFIG_HFLIP_FILTER 0 %define CONFIG_HISTEQ_FILTER 0 %define CONFIG_HISTOGRAM_FILTER 0 %define CONFIG_HQDN3D_FILTER 0 %define CONFIG_HQX_FILTER 0 +%define CONFIG_HSTACK_FILTER 0 %define CONFIG_HUE_FILTER 0 +%define CONFIG_HWDOWNLOAD_FILTER 0 +%define CONFIG_HWMAP_FILTER 0 +%define CONFIG_HWUPLOAD_FILTER 0 +%define CONFIG_HWUPLOAD_CUDA_FILTER 0 +%define CONFIG_HYSTERESIS_FILTER 0 %define CONFIG_IDET_FILTER 0 %define CONFIG_IL_FILTER 0 %define CONFIG_INFLATE_FILTER 0 @@ -1567,19 +1769,40 @@ %define CONFIG_INTERLEAVE_FILTER 0 %define CONFIG_KERNDEINT_FILTER 0 %define CONFIG_LENSCORRECTION_FILTER 0 -%define CONFIG_LUT3D_FILTER 0 +%define CONFIG_LENSFUN_FILTER 0 +%define CONFIG_LIBVMAF_FILTER 0 +%define CONFIG_LIMITER_FILTER 0 +%define CONFIG_LOOP_FILTER 0 +%define CONFIG_LUMAKEY_FILTER 0 %define CONFIG_LUT_FILTER 0 +%define CONFIG_LUT1D_FILTER 0 +%define CONFIG_LUT2_FILTER 0 +%define CONFIG_LUT3D_FILTER 0 %define CONFIG_LUTRGB_FILTER 0 %define CONFIG_LUTYUV_FILTER 0 +%define CONFIG_MASKEDCLAMP_FILTER 0 +%define CONFIG_MASKEDMERGE_FILTER 0 %define CONFIG_MCDEINT_FILTER 0 %define CONFIG_MERGEPLANES_FILTER 0 +%define CONFIG_MESTIMATE_FILTER 0 +%define CONFIG_METADATA_FILTER 0 +%define CONFIG_MIDEQUALIZER_FILTER 0 +%define CONFIG_MINTERPOLATE_FILTER 0 +%define CONFIG_MIX_FILTER 0 %define CONFIG_MPDECIMATE_FILTER 0 %define CONFIG_NEGATE_FILTER 0 +%define CONFIG_NLMEANS_FILTER 0 +%define CONFIG_NNEDI_FILTER 0 %define CONFIG_NOFORMAT_FILTER 0 %define CONFIG_NOISE_FILTER 0 +%define CONFIG_NORMALIZE_FILTER 0 %define CONFIG_NULL_FILTER 0 +%define CONFIG_OCR_FILTER 0 %define CONFIG_OCV_FILTER 0 +%define CONFIG_OSCILLOSCOPE_FILTER 0 %define CONFIG_OVERLAY_FILTER 0 +%define CONFIG_OVERLAY_OPENCL_FILTER 0 +%define CONFIG_OVERLAY_QSV_FILTER 0 %define CONFIG_OWDENOISE_FILTER 0 %define CONFIG_PAD_FILTER 0 %define CONFIG_PALETTEGEN_FILTER 0 @@ -1588,135 +1811,445 @@ %define CONFIG_PERSPECTIVE_FILTER 0 %define CONFIG_PHASE_FILTER 0 %define CONFIG_PIXDESCTEST_FILTER 0 +%define CONFIG_PIXSCOPE_FILTER 0 %define CONFIG_PP_FILTER 0 %define CONFIG_PP7_FILTER 0 +%define CONFIG_PREMULTIPLY_FILTER 0 +%define CONFIG_PREWITT_FILTER 0 +%define CONFIG_PREWITT_OPENCL_FILTER 0 +%define CONFIG_PROCAMP_VAAPI_FILTER 0 +%define CONFIG_PROGRAM_OPENCL_FILTER 0 +%define CONFIG_PSEUDOCOLOR_FILTER 0 %define CONFIG_PSNR_FILTER 0 %define CONFIG_PULLUP_FILTER 0 %define CONFIG_QP_FILTER 0 %define CONFIG_RANDOM_FILTER 0 +%define CONFIG_READEIA608_FILTER 0 +%define CONFIG_READVITC_FILTER 0 +%define CONFIG_REALTIME_FILTER 0 +%define CONFIG_REMAP_FILTER 0 %define CONFIG_REMOVEGRAIN_FILTER 0 %define CONFIG_REMOVELOGO_FILTER 0 %define CONFIG_REPEATFIELDS_FILTER 0 %define CONFIG_REVERSE_FILTER 0 +%define CONFIG_RGBASHIFT_FILTER 0 +%define CONFIG_ROBERTS_FILTER 0 +%define CONFIG_ROBERTS_OPENCL_FILTER 0 %define CONFIG_ROTATE_FILTER 0 %define CONFIG_SAB_FILTER 0 %define CONFIG_SCALE_FILTER 0 +%define CONFIG_SCALE_CUDA_FILTER 0 +%define CONFIG_SCALE_NPP_FILTER 0 +%define CONFIG_SCALE_QSV_FILTER 0 +%define CONFIG_SCALE_VAAPI_FILTER 0 +%define CONFIG_SCALE2REF_FILTER 0 %define CONFIG_SELECT_FILTER 0 +%define CONFIG_SELECTIVECOLOR_FILTER 0 %define CONFIG_SENDCMD_FILTER 0 %define CONFIG_SEPARATEFIELDS_FILTER 0 %define CONFIG_SETDAR_FILTER 0 %define CONFIG_SETFIELD_FILTER 0 +%define CONFIG_SETPARAMS_FILTER 0 %define CONFIG_SETPTS_FILTER 0 +%define CONFIG_SETRANGE_FILTER 0 %define CONFIG_SETSAR_FILTER 0 %define CONFIG_SETTB_FILTER 0 +%define CONFIG_SHARPNESS_VAAPI_FILTER 0 %define CONFIG_SHOWINFO_FILTER 0 %define CONFIG_SHOWPALETTE_FILTER 0 +%define CONFIG_SHUFFLEFRAMES_FILTER 0 %define CONFIG_SHUFFLEPLANES_FILTER 0 +%define CONFIG_SIDEDATA_FILTER 0 %define CONFIG_SIGNALSTATS_FILTER 0 +%define CONFIG_SIGNATURE_FILTER 0 %define CONFIG_SMARTBLUR_FILTER 0 +%define CONFIG_SOBEL_FILTER 0 +%define CONFIG_SOBEL_OPENCL_FILTER 0 %define CONFIG_SPLIT_FILTER 0 %define CONFIG_SPP_FILTER 0 +%define CONFIG_SR_FILTER 0 %define CONFIG_SSIM_FILTER 0 %define CONFIG_STEREO3D_FILTER 0 +%define CONFIG_STREAMSELECT_FILTER 0 %define CONFIG_SUBTITLES_FILTER 0 %define CONFIG_SUPER2XSAI_FILTER 0 +%define CONFIG_SWAPRECT_FILTER 0 %define CONFIG_SWAPUV_FILTER 0 %define CONFIG_TBLEND_FILTER 0 %define CONFIG_TELECINE_FILTER 0 +%define CONFIG_THRESHOLD_FILTER 0 %define CONFIG_THUMBNAIL_FILTER 0 +%define CONFIG_THUMBNAIL_CUDA_FILTER 0 %define CONFIG_TILE_FILTER 0 %define CONFIG_TINTERLACE_FILTER 0 +%define CONFIG_TLUT2_FILTER 0 +%define CONFIG_TMIX_FILTER 0 +%define CONFIG_TONEMAP_FILTER 0 +%define CONFIG_TONEMAP_OPENCL_FILTER 0 +%define CONFIG_TPAD_FILTER 0 %define CONFIG_TRANSPOSE_FILTER 0 +%define CONFIG_TRANSPOSE_NPP_FILTER 0 %define CONFIG_TRIM_FILTER 0 +%define CONFIG_UNPREMULTIPLY_FILTER 0 %define CONFIG_UNSHARP_FILTER 0 +%define CONFIG_UNSHARP_OPENCL_FILTER 0 %define CONFIG_USPP_FILTER 0 +%define CONFIG_VAGUEDENOISER_FILTER 0 +%define CONFIG_VECTORSCOPE_FILTER 0 %define CONFIG_VFLIP_FILTER 0 +%define CONFIG_VFRDET_FILTER 0 +%define CONFIG_VIBRANCE_FILTER 0 %define CONFIG_VIDSTABDETECT_FILTER 0 %define CONFIG_VIDSTABTRANSFORM_FILTER 0 %define CONFIG_VIGNETTE_FILTER 0 +%define CONFIG_VMAFMOTION_FILTER 0 +%define CONFIG_VPP_QSV_FILTER 0 +%define CONFIG_VSTACK_FILTER 0 %define CONFIG_W3FDIF_FILTER 0 +%define CONFIG_WAVEFORM_FILTER 0 +%define CONFIG_WEAVE_FILTER 0 %define CONFIG_XBR_FILTER 0 +%define CONFIG_XSTACK_FILTER 0 %define CONFIG_YADIF_FILTER 0 +%define CONFIG_YADIF_CUDA_FILTER 0 %define CONFIG_ZMQ_FILTER 0 %define CONFIG_ZOOMPAN_FILTER 0 +%define CONFIG_ZSCALE_FILTER 0 +%define CONFIG_ALLRGB_FILTER 0 +%define CONFIG_ALLYUV_FILTER 0 %define CONFIG_CELLAUTO_FILTER 0 %define CONFIG_COLOR_FILTER 0 +%define CONFIG_COREIMAGESRC_FILTER 0 %define CONFIG_FREI0R_SRC_FILTER 0 %define CONFIG_HALDCLUTSRC_FILTER 0 %define CONFIG_LIFE_FILTER 0 %define CONFIG_MANDELBROT_FILTER 0 %define CONFIG_MPTESTSRC_FILTER 0 %define CONFIG_NULLSRC_FILTER 0 +%define CONFIG_OPENCLSRC_FILTER 0 +%define CONFIG_PAL75BARS_FILTER 0 +%define CONFIG_PAL100BARS_FILTER 0 %define CONFIG_RGBTESTSRC_FILTER 0 %define CONFIG_SMPTEBARS_FILTER 0 %define CONFIG_SMPTEHDBARS_FILTER 0 %define CONFIG_TESTSRC_FILTER 0 +%define CONFIG_TESTSRC2_FILTER 0 +%define CONFIG_YUVTESTSRC_FILTER 0 %define CONFIG_NULLSINK_FILTER 0 +%define CONFIG_ABITSCOPE_FILTER 0 %define CONFIG_ADRAWGRAPH_FILTER 0 +%define CONFIG_AGRAPHMONITOR_FILTER 0 +%define CONFIG_AHISTOGRAM_FILTER 0 +%define CONFIG_APHASEMETER_FILTER 0 %define CONFIG_AVECTORSCOPE_FILTER 0 %define CONFIG_CONCAT_FILTER 0 %define CONFIG_SHOWCQT_FILTER 0 +%define CONFIG_SHOWFREQS_FILTER 0 %define CONFIG_SHOWSPECTRUM_FILTER 0 +%define CONFIG_SHOWSPECTRUMPIC_FILTER 0 %define CONFIG_SHOWVOLUME_FILTER 0 %define CONFIG_SHOWWAVES_FILTER 0 %define CONFIG_SHOWWAVESPIC_FILTER 0 +%define CONFIG_SPECTRUMSYNTH_FILTER 0 %define CONFIG_AMOVIE_FILTER 0 %define CONFIG_MOVIE_FILTER 0 -%define CONFIG_H263_VAAPI_HWACCEL 0 -%define CONFIG_H263_VDPAU_HWACCEL 0 -%define CONFIG_H264_D3D11VA_HWACCEL 0 -%define CONFIG_H264_DXVA2_HWACCEL 0 -%define CONFIG_H264_MMAL_HWACCEL 0 -%define CONFIG_H264_QSV_HWACCEL 0 -%define CONFIG_H264_VAAPI_HWACCEL 0 -%define CONFIG_H264_VDA_HWACCEL 0 -%define CONFIG_H264_VDA_OLD_HWACCEL 0 -%define CONFIG_H264_VDPAU_HWACCEL 0 -%define CONFIG_HEVC_D3D11VA_HWACCEL 0 -%define CONFIG_HEVC_DXVA2_HWACCEL 0 -%define CONFIG_HEVC_QSV_HWACCEL 0 -%define CONFIG_HEVC_VDPAU_HWACCEL 0 -%define CONFIG_MPEG1_XVMC_HWACCEL 0 -%define CONFIG_MPEG1_VDPAU_HWACCEL 0 -%define CONFIG_MPEG2_XVMC_HWACCEL 0 -%define CONFIG_MPEG2_D3D11VA_HWACCEL 0 -%define CONFIG_MPEG2_DXVA2_HWACCEL 0 -%define CONFIG_MPEG2_QSV_HWACCEL 0 -%define CONFIG_MPEG2_VAAPI_HWACCEL 0 -%define CONFIG_MPEG2_VDPAU_HWACCEL 0 -%define CONFIG_MPEG4_VAAPI_HWACCEL 0 -%define CONFIG_MPEG4_VDPAU_HWACCEL 0 -%define CONFIG_VC1_D3D11VA_HWACCEL 0 -%define CONFIG_VC1_DXVA2_HWACCEL 0 -%define CONFIG_VC1_VAAPI_HWACCEL 0 -%define CONFIG_VC1_VDPAU_HWACCEL 0 -%define CONFIG_VC1_QSV_HWACCEL 0 -%define CONFIG_WMV3_D3D11VA_HWACCEL 0 -%define CONFIG_WMV3_DXVA2_HWACCEL 0 -%define CONFIG_WMV3_VAAPI_HWACCEL 0 -%define CONFIG_WMV3_VDPAU_HWACCEL 0 -%define CONFIG_ALSA_INDEV 0 -%define CONFIG_AVFOUNDATION_INDEV 0 -%define CONFIG_BKTR_INDEV 0 -%define CONFIG_DECKLINK_INDEV 0 -%define CONFIG_DSHOW_INDEV 0 -%define CONFIG_DV1394_INDEV 0 -%define CONFIG_FBDEV_INDEV 0 -%define CONFIG_GDIGRAB_INDEV 0 -%define CONFIG_IEC61883_INDEV 0 -%define CONFIG_JACK_INDEV 0 -%define CONFIG_LAVFI_INDEV 0 -%define CONFIG_OPENAL_INDEV 0 -%define CONFIG_OSS_INDEV 0 -%define CONFIG_PULSE_INDEV 0 -%define CONFIG_QTKIT_INDEV 0 -%define CONFIG_SNDIO_INDEV 0 -%define CONFIG_V4L2_INDEV 0 -%define CONFIG_VFWCAP_INDEV 0 -%define CONFIG_X11GRAB_INDEV 0 -%define CONFIG_X11GRAB_XCB_INDEV 0 -%define CONFIG_LIBCDIO_INDEV 0 -%define CONFIG_LIBDC1394_INDEV 0 +%define CONFIG_AFIFO_FILTER 0 +%define CONFIG_FIFO_FILTER 0 +%define CONFIG_AA_DEMUXER 1 +%define CONFIG_AAC_DEMUXER 1 +%define CONFIG_AC3_DEMUXER 1 +%define CONFIG_ACM_DEMUXER 1 +%define CONFIG_ACT_DEMUXER 1 +%define CONFIG_ADF_DEMUXER 1 +%define CONFIG_ADP_DEMUXER 1 +%define CONFIG_ADS_DEMUXER 1 +%define CONFIG_ADX_DEMUXER 1 +%define CONFIG_AEA_DEMUXER 1 +%define CONFIG_AFC_DEMUXER 1 +%define CONFIG_AIFF_DEMUXER 1 +%define CONFIG_AIX_DEMUXER 1 +%define CONFIG_AMR_DEMUXER 1 +%define CONFIG_AMRNB_DEMUXER 1 +%define CONFIG_AMRWB_DEMUXER 1 +%define CONFIG_ANM_DEMUXER 1 +%define CONFIG_APC_DEMUXER 1 +%define CONFIG_APE_DEMUXER 1 +%define CONFIG_APNG_DEMUXER 1 +%define CONFIG_APTX_DEMUXER 1 +%define CONFIG_APTX_HD_DEMUXER 1 +%define CONFIG_AQTITLE_DEMUXER 1 +%define CONFIG_ASF_DEMUXER 1 +%define CONFIG_ASF_O_DEMUXER 1 +%define CONFIG_ASS_DEMUXER 1 +%define CONFIG_AST_DEMUXER 1 +%define CONFIG_AU_DEMUXER 1 +%define CONFIG_AVI_DEMUXER 1 +%define CONFIG_AVISYNTH_DEMUXER 0 +%define CONFIG_AVR_DEMUXER 1 +%define CONFIG_AVS_DEMUXER 1 +%define CONFIG_AVS2_DEMUXER 1 +%define CONFIG_BETHSOFTVID_DEMUXER 1 +%define CONFIG_BFI_DEMUXER 1 +%define CONFIG_BINTEXT_DEMUXER 1 +%define CONFIG_BINK_DEMUXER 1 +%define CONFIG_BIT_DEMUXER 1 +%define CONFIG_BMV_DEMUXER 1 +%define CONFIG_BFSTM_DEMUXER 1 +%define CONFIG_BRSTM_DEMUXER 1 +%define CONFIG_BOA_DEMUXER 1 +%define CONFIG_C93_DEMUXER 1 +%define CONFIG_CAF_DEMUXER 1 +%define CONFIG_CAVSVIDEO_DEMUXER 1 +%define CONFIG_CDG_DEMUXER 1 +%define CONFIG_CDXL_DEMUXER 1 +%define CONFIG_CINE_DEMUXER 1 +%define CONFIG_CODEC2_DEMUXER 1 +%define CONFIG_CODEC2RAW_DEMUXER 1 +%define CONFIG_CONCAT_DEMUXER 1 +%define CONFIG_DASH_DEMUXER 0 +%define CONFIG_DATA_DEMUXER 1 +%define CONFIG_DAUD_DEMUXER 1 +%define CONFIG_DCSTR_DEMUXER 1 +%define CONFIG_DFA_DEMUXER 1 +%define CONFIG_DIRAC_DEMUXER 1 +%define CONFIG_DNXHD_DEMUXER 1 +%define CONFIG_DSF_DEMUXER 1 +%define CONFIG_DSICIN_DEMUXER 1 +%define CONFIG_DSS_DEMUXER 1 +%define CONFIG_DTS_DEMUXER 1 +%define CONFIG_DTSHD_DEMUXER 1 +%define CONFIG_DV_DEMUXER 1 +%define CONFIG_DVBSUB_DEMUXER 1 +%define CONFIG_DVBTXT_DEMUXER 1 +%define CONFIG_DXA_DEMUXER 1 +%define CONFIG_EA_DEMUXER 1 +%define CONFIG_EA_CDATA_DEMUXER 1 +%define CONFIG_EAC3_DEMUXER 1 +%define CONFIG_EPAF_DEMUXER 1 +%define CONFIG_FFMETADATA_DEMUXER 1 +%define CONFIG_FILMSTRIP_DEMUXER 1 +%define CONFIG_FITS_DEMUXER 1 +%define CONFIG_FLAC_DEMUXER 1 +%define CONFIG_FLIC_DEMUXER 1 +%define CONFIG_FLV_DEMUXER 1 +%define CONFIG_LIVE_FLV_DEMUXER 1 +%define CONFIG_FOURXM_DEMUXER 1 +%define CONFIG_FRM_DEMUXER 1 +%define CONFIG_FSB_DEMUXER 1 +%define CONFIG_G722_DEMUXER 1 +%define CONFIG_G723_1_DEMUXER 1 +%define CONFIG_G726_DEMUXER 1 +%define CONFIG_G726LE_DEMUXER 1 +%define CONFIG_G729_DEMUXER 1 +%define CONFIG_GDV_DEMUXER 1 +%define CONFIG_GENH_DEMUXER 1 +%define CONFIG_GIF_DEMUXER 1 +%define CONFIG_GSM_DEMUXER 1 +%define CONFIG_GXF_DEMUXER 1 +%define CONFIG_H261_DEMUXER 1 +%define CONFIG_H263_DEMUXER 1 +%define CONFIG_H264_DEMUXER 1 +%define CONFIG_HEVC_DEMUXER 1 +%define CONFIG_HLS_DEMUXER 1 +%define CONFIG_HNM_DEMUXER 1 +%define CONFIG_ICO_DEMUXER 1 +%define CONFIG_IDCIN_DEMUXER 1 +%define CONFIG_IDF_DEMUXER 1 +%define CONFIG_IFF_DEMUXER 1 +%define CONFIG_ILBC_DEMUXER 1 +%define CONFIG_IMAGE2_DEMUXER 1 +%define CONFIG_IMAGE2PIPE_DEMUXER 1 +%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 1 +%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 1 +%define CONFIG_INGENIENT_DEMUXER 1 +%define CONFIG_IPMOVIE_DEMUXER 1 +%define CONFIG_IRCAM_DEMUXER 1 +%define CONFIG_ISS_DEMUXER 1 +%define CONFIG_IV8_DEMUXER 1 +%define CONFIG_IVF_DEMUXER 1 +%define CONFIG_IVR_DEMUXER 1 +%define CONFIG_JACOSUB_DEMUXER 1 +%define CONFIG_JV_DEMUXER 1 +%define CONFIG_LMLM4_DEMUXER 1 +%define CONFIG_LOAS_DEMUXER 1 +%define CONFIG_LRC_DEMUXER 1 +%define CONFIG_LVF_DEMUXER 1 +%define CONFIG_LXF_DEMUXER 1 +%define CONFIG_M4V_DEMUXER 1 +%define CONFIG_MATROSKA_DEMUXER 1 +%define CONFIG_MGSTS_DEMUXER 1 +%define CONFIG_MICRODVD_DEMUXER 1 +%define CONFIG_MJPEG_DEMUXER 1 +%define CONFIG_MJPEG_2000_DEMUXER 1 +%define CONFIG_MLP_DEMUXER 1 +%define CONFIG_MLV_DEMUXER 1 +%define CONFIG_MM_DEMUXER 1 +%define CONFIG_MMF_DEMUXER 1 +%define CONFIG_MOV_DEMUXER 1 +%define CONFIG_MP3_DEMUXER 1 +%define CONFIG_MPC_DEMUXER 1 +%define CONFIG_MPC8_DEMUXER 1 +%define CONFIG_MPEGPS_DEMUXER 1 +%define CONFIG_MPEGTS_DEMUXER 1 +%define CONFIG_MPEGTSRAW_DEMUXER 1 +%define CONFIG_MPEGVIDEO_DEMUXER 1 +%define CONFIG_MPJPEG_DEMUXER 1 +%define CONFIG_MPL2_DEMUXER 1 +%define CONFIG_MPSUB_DEMUXER 1 +%define CONFIG_MSF_DEMUXER 1 +%define CONFIG_MSNWC_TCP_DEMUXER 1 +%define CONFIG_MTAF_DEMUXER 1 +%define CONFIG_MTV_DEMUXER 1 +%define CONFIG_MUSX_DEMUXER 1 +%define CONFIG_MV_DEMUXER 1 +%define CONFIG_MVI_DEMUXER 1 +%define CONFIG_MXF_DEMUXER 1 +%define CONFIG_MXG_DEMUXER 1 +%define CONFIG_NC_DEMUXER 1 +%define CONFIG_NISTSPHERE_DEMUXER 1 +%define CONFIG_NSP_DEMUXER 1 +%define CONFIG_NSV_DEMUXER 1 +%define CONFIG_NUT_DEMUXER 1 +%define CONFIG_NUV_DEMUXER 1 +%define CONFIG_OGG_DEMUXER 1 +%define CONFIG_OMA_DEMUXER 1 +%define CONFIG_PAF_DEMUXER 1 +%define CONFIG_PCM_ALAW_DEMUXER 1 +%define CONFIG_PCM_MULAW_DEMUXER 1 +%define CONFIG_PCM_VIDC_DEMUXER 1 +%define CONFIG_PCM_F64BE_DEMUXER 1 +%define CONFIG_PCM_F64LE_DEMUXER 1 +%define CONFIG_PCM_F32BE_DEMUXER 1 +%define CONFIG_PCM_F32LE_DEMUXER 1 +%define CONFIG_PCM_S32BE_DEMUXER 1 +%define CONFIG_PCM_S32LE_DEMUXER 1 +%define CONFIG_PCM_S24BE_DEMUXER 1 +%define CONFIG_PCM_S24LE_DEMUXER 1 +%define CONFIG_PCM_S16BE_DEMUXER 1 +%define CONFIG_PCM_S16LE_DEMUXER 1 +%define CONFIG_PCM_S8_DEMUXER 1 +%define CONFIG_PCM_U32BE_DEMUXER 1 +%define CONFIG_PCM_U32LE_DEMUXER 1 +%define CONFIG_PCM_U24BE_DEMUXER 1 +%define CONFIG_PCM_U24LE_DEMUXER 1 +%define CONFIG_PCM_U16BE_DEMUXER 1 +%define CONFIG_PCM_U16LE_DEMUXER 1 +%define CONFIG_PCM_U8_DEMUXER 1 +%define CONFIG_PJS_DEMUXER 1 +%define CONFIG_PMP_DEMUXER 1 +%define CONFIG_PVA_DEMUXER 1 +%define CONFIG_PVF_DEMUXER 1 +%define CONFIG_QCP_DEMUXER 1 +%define CONFIG_R3D_DEMUXER 1 +%define CONFIG_RAWVIDEO_DEMUXER 1 +%define CONFIG_REALTEXT_DEMUXER 1 +%define CONFIG_REDSPARK_DEMUXER 1 +%define CONFIG_RL2_DEMUXER 1 +%define CONFIG_RM_DEMUXER 1 +%define CONFIG_ROQ_DEMUXER 1 +%define CONFIG_RPL_DEMUXER 1 +%define CONFIG_RSD_DEMUXER 1 +%define CONFIG_RSO_DEMUXER 1 +%define CONFIG_RTP_DEMUXER 0 +%define CONFIG_RTSP_DEMUXER 0 +%define CONFIG_S337M_DEMUXER 1 +%define CONFIG_SAMI_DEMUXER 1 +%define CONFIG_SAP_DEMUXER 0 +%define CONFIG_SBC_DEMUXER 1 +%define CONFIG_SBG_DEMUXER 1 +%define CONFIG_SCC_DEMUXER 1 +%define CONFIG_SDP_DEMUXER 0 +%define CONFIG_SDR2_DEMUXER 1 +%define CONFIG_SDS_DEMUXER 1 +%define CONFIG_SDX_DEMUXER 1 +%define CONFIG_SEGAFILM_DEMUXER 1 +%define CONFIG_SER_DEMUXER 1 +%define CONFIG_SHORTEN_DEMUXER 1 +%define CONFIG_SIFF_DEMUXER 1 +%define CONFIG_SLN_DEMUXER 1 +%define CONFIG_SMACKER_DEMUXER 1 +%define CONFIG_SMJPEG_DEMUXER 1 +%define CONFIG_SMUSH_DEMUXER 1 +%define CONFIG_SOL_DEMUXER 1 +%define CONFIG_SOX_DEMUXER 1 +%define CONFIG_SPDIF_DEMUXER 1 +%define CONFIG_SRT_DEMUXER 1 +%define CONFIG_STR_DEMUXER 1 +%define CONFIG_STL_DEMUXER 1 +%define CONFIG_SUBVIEWER1_DEMUXER 1 +%define CONFIG_SUBVIEWER_DEMUXER 1 +%define CONFIG_SUP_DEMUXER 1 +%define CONFIG_SVAG_DEMUXER 1 +%define CONFIG_SWF_DEMUXER 1 +%define CONFIG_TAK_DEMUXER 1 +%define CONFIG_TEDCAPTIONS_DEMUXER 1 +%define CONFIG_THP_DEMUXER 1 +%define CONFIG_THREEDOSTR_DEMUXER 1 +%define CONFIG_TIERTEXSEQ_DEMUXER 1 +%define CONFIG_TMV_DEMUXER 1 +%define CONFIG_TRUEHD_DEMUXER 1 +%define CONFIG_TTA_DEMUXER 1 +%define CONFIG_TXD_DEMUXER 1 +%define CONFIG_TTY_DEMUXER 1 +%define CONFIG_TY_DEMUXER 1 +%define CONFIG_V210_DEMUXER 1 +%define CONFIG_V210X_DEMUXER 1 +%define CONFIG_VAG_DEMUXER 1 +%define CONFIG_VC1_DEMUXER 1 +%define CONFIG_VC1T_DEMUXER 1 +%define CONFIG_VIVO_DEMUXER 1 +%define CONFIG_VMD_DEMUXER 1 +%define CONFIG_VOBSUB_DEMUXER 1 +%define CONFIG_VOC_DEMUXER 1 +%define CONFIG_VPK_DEMUXER 1 +%define CONFIG_VPLAYER_DEMUXER 1 +%define CONFIG_VQF_DEMUXER 1 +%define CONFIG_W64_DEMUXER 1 +%define CONFIG_WAV_DEMUXER 1 +%define CONFIG_WC3_DEMUXER 1 +%define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 1 +%define CONFIG_WEBVTT_DEMUXER 1 +%define CONFIG_WSAUD_DEMUXER 1 +%define CONFIG_WSD_DEMUXER 1 +%define CONFIG_WSVQA_DEMUXER 1 +%define CONFIG_WTV_DEMUXER 1 +%define CONFIG_WVE_DEMUXER 1 +%define CONFIG_WV_DEMUXER 1 +%define CONFIG_XA_DEMUXER 1 +%define CONFIG_XBIN_DEMUXER 1 +%define CONFIG_XMV_DEMUXER 1 +%define CONFIG_XVAG_DEMUXER 1 +%define CONFIG_XWMA_DEMUXER 1 +%define CONFIG_YOP_DEMUXER 1 +%define CONFIG_YUV4MPEGPIPE_DEMUXER 1 +%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PAM_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PBM_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PCX_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PGM_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PNG_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PPM_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_PSD_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_SGI_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_SVG_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_XPM_PIPE_DEMUXER 1 +%define CONFIG_IMAGE_XWD_PIPE_DEMUXER 1 +%define CONFIG_LIBGME_DEMUXER 0 +%define CONFIG_LIBMODPLUG_DEMUXER 0 +%define CONFIG_LIBOPENMPT_DEMUXER 0 +%define CONFIG_VAPOURSYNTH_DEMUXER 0 %define CONFIG_A64_MUXER 0 %define CONFIG_AC3_MUXER 0 %define CONFIG_ADTS_MUXER 0 @@ -1724,6 +2257,8 @@ %define CONFIG_AIFF_MUXER 0 %define CONFIG_AMR_MUXER 0 %define CONFIG_APNG_MUXER 0 +%define CONFIG_APTX_MUXER 0 +%define CONFIG_APTX_HD_MUXER 0 %define CONFIG_ASF_MUXER 0 %define CONFIG_ASS_MUXER 0 %define CONFIG_AST_MUXER 0 @@ -1731,9 +2266,12 @@ %define CONFIG_AU_MUXER 0 %define CONFIG_AVI_MUXER 0 %define CONFIG_AVM2_MUXER 0 +%define CONFIG_AVS2_MUXER 0 %define CONFIG_BIT_MUXER 0 %define CONFIG_CAF_MUXER 0 %define CONFIG_CAVSVIDEO_MUXER 0 +%define CONFIG_CODEC2_MUXER 0 +%define CONFIG_CODEC2RAW_MUXER 0 %define CONFIG_CRC_MUXER 0 %define CONFIG_DASH_MUXER 0 %define CONFIG_DATA_MUXER 0 @@ -1744,20 +2282,27 @@ %define CONFIG_DV_MUXER 0 %define CONFIG_EAC3_MUXER 0 %define CONFIG_F4V_MUXER 0 -%define CONFIG_FFM_MUXER 0 %define CONFIG_FFMETADATA_MUXER 0 +%define CONFIG_FIFO_MUXER 0 +%define CONFIG_FIFO_TEST_MUXER 0 %define CONFIG_FILMSTRIP_MUXER 0 +%define CONFIG_FITS_MUXER 0 %define CONFIG_FLAC_MUXER 0 %define CONFIG_FLV_MUXER 0 %define CONFIG_FRAMECRC_MUXER 0 +%define CONFIG_FRAMEHASH_MUXER 0 %define CONFIG_FRAMEMD5_MUXER 0 %define CONFIG_G722_MUXER 0 %define CONFIG_G723_1_MUXER 0 +%define CONFIG_G726_MUXER 0 +%define CONFIG_G726LE_MUXER 0 %define CONFIG_GIF_MUXER 0 +%define CONFIG_GSM_MUXER 0 %define CONFIG_GXF_MUXER 0 %define CONFIG_H261_MUXER 0 %define CONFIG_H263_MUXER 0 %define CONFIG_H264_MUXER 0 +%define CONFIG_HASH_MUXER 0 %define CONFIG_HDS_MUXER 0 %define CONFIG_HEVC_MUXER 0 %define CONFIG_HLS_MUXER 0 @@ -1800,10 +2345,12 @@ %define CONFIG_NUT_MUXER 0 %define CONFIG_OGA_MUXER 0 %define CONFIG_OGG_MUXER 0 +%define CONFIG_OGV_MUXER 0 %define CONFIG_OMA_MUXER 0 %define CONFIG_OPUS_MUXER 0 %define CONFIG_PCM_ALAW_MUXER 0 %define CONFIG_PCM_MULAW_MUXER 0 +%define CONFIG_PCM_VIDC_MUXER 0 %define CONFIG_PCM_F64BE_MUXER 0 %define CONFIG_PCM_F64LE_MUXER 0 %define CONFIG_PCM_F32BE_MUXER 0 @@ -1831,6 +2378,9 @@ %define CONFIG_RTP_MPEGTS_MUXER 0 %define CONFIG_RTSP_MUXER 0 %define CONFIG_SAP_MUXER 0 +%define CONFIG_SBC_MUXER 0 +%define CONFIG_SCC_MUXER 0 +%define CONFIG_SEGAFILM_MUXER 0 %define CONFIG_SEGMENT_MUXER 0 %define CONFIG_STREAM_SEGMENT_MUXER 0 %define CONFIG_SINGLEJPEG_MUXER 0 @@ -1840,12 +2390,14 @@ %define CONFIG_SPX_MUXER 0 %define CONFIG_SPDIF_MUXER 0 %define CONFIG_SRT_MUXER 0 +%define CONFIG_SUP_MUXER 0 %define CONFIG_SWF_MUXER 0 %define CONFIG_TEE_MUXER 0 %define CONFIG_TG2_MUXER 0 %define CONFIG_TGP_MUXER 0 %define CONFIG_MKVTIMESTAMP_V2_MUXER 0 %define CONFIG_TRUEHD_MUXER 0 +%define CONFIG_TTA_MUXER 0 %define CONFIG_UNCODEDFRAMECRC_MUXER 0 %define CONFIG_VC1_MUXER 0 %define CONFIG_VC1T_MUXER 0 @@ -1860,55 +2412,8 @@ %define CONFIG_WTV_MUXER 0 %define CONFIG_WV_MUXER 0 %define CONFIG_YUV4MPEGPIPE_MUXER 0 -%define CONFIG_LIBNUT_MUXER 0 -%define CONFIG_ALSA_OUTDEV 0 -%define CONFIG_CACA_OUTDEV 0 -%define CONFIG_DECKLINK_OUTDEV 0 -%define CONFIG_FBDEV_OUTDEV 0 -%define CONFIG_OPENGL_OUTDEV 0 -%define CONFIG_OSS_OUTDEV 0 -%define CONFIG_PULSE_OUTDEV 0 -%define CONFIG_SDL_OUTDEV 0 -%define CONFIG_SNDIO_OUTDEV 0 -%define CONFIG_V4L2_OUTDEV 0 -%define CONFIG_XV_OUTDEV 0 -%define CONFIG_AAC_PARSER 1 -%define CONFIG_AAC_LATM_PARSER 1 -%define CONFIG_AC3_PARSER 1 -%define CONFIG_ADX_PARSER 1 -%define CONFIG_BMP_PARSER 1 -%define CONFIG_CAVSVIDEO_PARSER 1 -%define CONFIG_COOK_PARSER 1 -%define CONFIG_DCA_PARSER 1 -%define CONFIG_DIRAC_PARSER 1 -%define CONFIG_DNXHD_PARSER 1 -%define CONFIG_DPX_PARSER 1 -%define CONFIG_DVBSUB_PARSER 1 -%define CONFIG_DVDSUB_PARSER 1 -%define CONFIG_DVD_NAV_PARSER 1 -%define CONFIG_FLAC_PARSER 1 -%define CONFIG_GSM_PARSER 1 -%define CONFIG_H261_PARSER 1 -%define CONFIG_H263_PARSER 1 -%define CONFIG_H264_PARSER 1 -%define CONFIG_HEVC_PARSER 1 -%define CONFIG_MJPEG_PARSER 1 -%define CONFIG_MLP_PARSER 1 -%define CONFIG_MPEG4VIDEO_PARSER 1 -%define CONFIG_MPEGAUDIO_PARSER 1 -%define CONFIG_MPEGVIDEO_PARSER 1 -%define CONFIG_OPUS_PARSER 1 -%define CONFIG_PNG_PARSER 1 -%define CONFIG_PNM_PARSER 1 -%define CONFIG_RV30_PARSER 1 -%define CONFIG_RV40_PARSER 1 -%define CONFIG_TAK_PARSER 1 -%define CONFIG_VC1_PARSER 1 -%define CONFIG_VORBIS_PARSER 1 -%define CONFIG_VP3_PARSER 1 -%define CONFIG_VP8_PARSER 1 -%define CONFIG_VP9_PARSER 1 -%define CONFIG_ASYNC_PROTOCOL 0 +%define CONFIG_CHROMAPRINT_MUXER 0 +%define CONFIG_ASYNC_PROTOCOL 1 %define CONFIG_BLURAY_PROTOCOL 0 %define CONFIG_CACHE_PROTOCOL 1 %define CONFIG_CONCAT_PROTOCOL 1 @@ -1928,6 +2433,7 @@ %define CONFIG_MMST_PROTOCOL 0 %define CONFIG_MD5_PROTOCOL 1 %define CONFIG_PIPE_PROTOCOL 1 +%define CONFIG_PROMPEG_PROTOCOL 1 %define CONFIG_RTMP_PROTOCOL 0 %define CONFIG_RTMPE_PROTOCOL 0 %define CONFIG_RTMPS_PROTOCOL 0 @@ -1938,10 +2444,9 @@ %define CONFIG_SCTP_PROTOCOL 0 %define CONFIG_SRTP_PROTOCOL 0 %define CONFIG_SUBFILE_PROTOCOL 1 +%define CONFIG_TEE_PROTOCOL 1 %define CONFIG_TCP_PROTOCOL 0 -%define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0 -%define CONFIG_TLS_GNUTLS_PROTOCOL 0 -%define CONFIG_TLS_OPENSSL_PROTOCOL 0 +%define CONFIG_TLS_PROTOCOL 0 %define CONFIG_UDP_PROTOCOL 0 %define CONFIG_UDPLITE_PROTOCOL 0 %define CONFIG_UNIX_PROTOCOL 0 @@ -1950,5 +2455,6 @@ %define CONFIG_LIBRTMPS_PROTOCOL 0 %define CONFIG_LIBRTMPT_PROTOCOL 0 %define CONFIG_LIBRTMPTE_PROTOCOL 0 +%define CONFIG_LIBSRT_PROTOCOL 0 %define CONFIG_LIBSSH_PROTOCOL 0 %define CONFIG_LIBSMBCLIENT_PROTOCOL 0 diff --git a/build/ffmpeg/config-x86.h b/build/ffmpeg/config-x86.h old mode 100644 new mode 100755 index f8f71992a..0a1483e3b --- a/build/ffmpeg/config-x86.h +++ b/build/ffmpeg/config-x86.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -#define FFMPEG_CONFIGURATION "--disable-avfilter --disable-avresample --disable-bzlib --disable-d3d11va --disable-dxva2 --disable-decoder='atrac3p,indeo2,indeo3,indeo4,indeo5,twinvq' --disable-devices --disable-doc --disable-encoders --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-filters --disable-hwaccels --disable-muxers --disable-network --disable-postproc --disable-pthreads --disable-shared --enable-gpl --enable-runtime-cpudetect --enable-static --enable-zlib --extra-cflags=-D_SYSCRT --extra-cflags=-I../../include --extra-cflags=-MD --extra-cflags=-wd4005 --extra-cflags=-wd4189 --extra-ldflags='-LIBPATH:../../lib/Win32/Release' --toolchain=msvc" +#define FFMPEG_CONFIGURATION "--disable-avfilter --disable-avresample --disable-bzlib --disable-d3d11va --disable-dxva2 --disable-decoder='atrac3p,indeo2,indeo3,indeo4,indeo5,twinvq' --disable-devices --disable-doc --disable-encoders --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-filters --disable-hwaccels --disable-muxers --disable-network --disable-postproc --disable-pthreads --disable-shared --enable-gpl --enable-runtime-cpudetect --enable-static --enable-small --enable-x86asm --x86asmexe=yasm --enable-zlib --extra-cflags=-D_SYSCRT --extra-cflags=-I../../include --extra-cflags=-MD --extra-cflags=-wd4005 --extra-cflags=-wd4189 --extra-ldflags='-LIBPATH:../../lib/Win32/Release' --toolchain=msvc" #define FFMPEG_LICENSE "GPL version 2 or later" -#define CONFIG_THIS_YEAR 2015 +#define CONFIG_THIS_YEAR 2018 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x86" +#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26132 for x86" #define av_restrict __restrict #define EXTERN_PREFIX "_" #define EXTERN_ASM _ @@ -52,10 +52,12 @@ #define HAVE_POWER8 0 #define HAVE_PPC4XX 0 #define HAVE_VSX 0 +#define HAVE_AESNI 1 #define HAVE_AMD3DNOW 1 #define HAVE_AMD3DNOWEXT 1 #define HAVE_AVX 1 #define HAVE_AVX2 1 +#define HAVE_AVX512 1 #define HAVE_FMA3 1 #define HAVE_FMA4 1 #define HAVE_MMX 1 @@ -72,12 +74,14 @@ #define HAVE_MIPSFPU 0 #define HAVE_MIPS32R2 0 #define HAVE_MIPS32R5 0 +#define HAVE_MIPS64R2 0 +#define HAVE_MIPS32R6 0 #define HAVE_MIPS64R6 0 -#define HAVE_MIPSDSPR1 0 +#define HAVE_MIPSDSP 0 #define HAVE_MIPSDSPR2 0 #define HAVE_MSA 0 -#define HAVE_LOONGSON2 1 -#define HAVE_LOONGSON3 1 +#define HAVE_LOONGSON2 0 +#define HAVE_LOONGSON3 0 #define HAVE_MMI 0 #define HAVE_ARMV5TE_EXTERNAL 0 #define HAVE_ARMV6_EXTERNAL 0 @@ -93,10 +97,12 @@ #define HAVE_POWER8_EXTERNAL 0 #define HAVE_PPC4XX_EXTERNAL 0 #define HAVE_VSX_EXTERNAL 0 +#define HAVE_AESNI_EXTERNAL 1 #define HAVE_AMD3DNOW_EXTERNAL 1 #define HAVE_AMD3DNOWEXT_EXTERNAL 1 #define HAVE_AVX_EXTERNAL 1 #define HAVE_AVX2_EXTERNAL 0 +#define HAVE_AVX512_EXTERNAL 0 #define HAVE_FMA3_EXTERNAL 1 #define HAVE_FMA4_EXTERNAL 1 #define HAVE_MMX_EXTERNAL 1 @@ -113,8 +119,10 @@ #define HAVE_MIPSFPU_EXTERNAL 0 #define HAVE_MIPS32R2_EXTERNAL 0 #define HAVE_MIPS32R5_EXTERNAL 0 +#define HAVE_MIPS64R2_EXTERNAL 0 +#define HAVE_MIPS32R6_EXTERNAL 0 #define HAVE_MIPS64R6_EXTERNAL 0 -#define HAVE_MIPSDSPR1_EXTERNAL 0 +#define HAVE_MIPSDSP_EXTERNAL 0 #define HAVE_MIPSDSPR2_EXTERNAL 0 #define HAVE_MSA_EXTERNAL 0 #define HAVE_LOONGSON2_EXTERNAL 0 @@ -134,10 +142,12 @@ #define HAVE_POWER8_INLINE 0 #define HAVE_PPC4XX_INLINE 0 #define HAVE_VSX_INLINE 0 +#define HAVE_AESNI_INLINE 0 #define HAVE_AMD3DNOW_INLINE 0 #define HAVE_AMD3DNOWEXT_INLINE 0 #define HAVE_AVX_INLINE 0 #define HAVE_AVX2_INLINE 0 +#define HAVE_AVX512_INLINE 0 #define HAVE_FMA3_INLINE 0 #define HAVE_FMA4_INLINE 0 #define HAVE_MMX_INLINE 0 @@ -154,8 +164,10 @@ #define HAVE_MIPSFPU_INLINE 0 #define HAVE_MIPS32R2_INLINE 0 #define HAVE_MIPS32R5_INLINE 0 +#define HAVE_MIPS64R2_INLINE 0 +#define HAVE_MIPS32R6_INLINE 0 #define HAVE_MIPS64R6_INLINE 0 -#define HAVE_MIPSDSPR1_INLINE 0 +#define HAVE_MIPSDSP_INLINE 0 #define HAVE_MIPSDSPR2_INLINE 0 #define HAVE_MSA_INLINE 0 #define HAVE_LOONGSON2_INLINE 0 @@ -165,55 +177,49 @@ #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 #define HAVE_FAST_CMOV 0 -#define HAVE_LOCAL_ALIGNED_8 1 -#define HAVE_LOCAL_ALIGNED_16 1 -#define HAVE_LOCAL_ALIGNED_32 1 +#define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 -#define HAVE_ATOMICS_GCC 0 -#define HAVE_ATOMICS_SUNCC 0 -#define HAVE_ATOMICS_WIN32 1 +#define HAVE_SIMD_ALIGN_32 1 +#define HAVE_SIMD_ALIGN_64 1 #define HAVE_ATOMIC_CAS_PTR 0 -#define HAVE_ATOMIC_COMPARE_EXCHANGE 0 #define HAVE_MACHINE_RW_BARRIER 0 #define HAVE_MEMORYBARRIER 1 #define HAVE_MM_EMPTY 1 #define HAVE_RDTSC 1 -#define HAVE_SARESTART 0 +#define HAVE_SEM_TIMEDWAIT 0 #define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0 +#define HAVE_CABS 0 +#define HAVE_CEXP 0 #define HAVE_INLINE_ASM 0 #define HAVE_SYMVER 0 -#define HAVE_YASM 1 +#define HAVE_X86ASM 1 #define HAVE_BIGENDIAN 0 #define HAVE_FAST_UNALIGNED 1 -#define HAVE_INCOMPATIBLE_LIBAV_ABI 0 -#define HAVE_ALSA_ASOUNDLIB_H 0 -#define HAVE_ALTIVEC_H 0 #define HAVE_ARPA_INET_H 0 #define HAVE_ASM_TYPES_H 0 #define HAVE_CDIO_PARANOIA_H 0 #define HAVE_CDIO_PARANOIA_PARANOIA_H 0 +#define HAVE_CUDA_H 0 +#define HAVE_DISPATCH_DISPATCH_H 0 #define HAVE_DEV_BKTR_IOCTL_BT848_H 0 #define HAVE_DEV_BKTR_IOCTL_METEOR_H 0 #define HAVE_DEV_IC_BT8XX_H 0 #define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0 #define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0 #define HAVE_DIRECT_H 1 -#define HAVE_DLFCN_H 0 -#define HAVE_D3D11_H 1 +#define HAVE_DIRENT_H 0 +#define HAVE_DXGIDEBUG_H 1 #define HAVE_DXVA_H 1 #define HAVE_ES2_GL_H 0 #define HAVE_GSM_H 0 #define HAVE_IO_H 1 -#define HAVE_MACH_MACH_TIME_H 0 +#define HAVE_LINUX_PERF_EVENT_H 0 #define HAVE_MACHINE_IOCTL_BT848_H 0 #define HAVE_MACHINE_IOCTL_METEOR_H 0 #define HAVE_MALLOC_H 1 -#define HAVE_OPENJPEG_1_5_OPENJPEG_H 0 +#define HAVE_OPENCV2_CORE_CORE_C_H 0 #define HAVE_OPENGL_GL3_H 0 #define HAVE_POLL_H 0 -#define HAVE_SNDIO_H 0 -#define HAVE_SOUNDCARD_H 0 -#define HAVE_SYS_MMAN_H 0 #define HAVE_SYS_PARAM_H 0 #define HAVE_SYS_RESOURCE_H 0 #define HAVE_SYS_SELECT_H 0 @@ -238,6 +244,8 @@ #define HAVE_EXP2 1 #define HAVE_EXP2F 1 #define HAVE_EXPF 1 +#define HAVE_HYPOT 1 +#define HAVE_ISFINITE 1 #define HAVE_ISINF 1 #define HAVE_ISNAN 1 #define HAVE_LDEXPF 1 @@ -255,17 +263,20 @@ #define HAVE_SINF 1 #define HAVE_TRUNC 1 #define HAVE_TRUNCF 1 +#define HAVE_DOS_PATHS 1 +#define HAVE_LIBC_MSVCRT 1 +#define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0 +#define HAVE_SECTION_DATA_REL_RO 0 +#define HAVE_THREADS 1 +#define HAVE_UWP 0 +#define HAVE_WINRT 0 #define HAVE_ACCESS 1 #define HAVE_ALIGNED_MALLOC 1 +#define HAVE_ARC4RANDOM 0 #define HAVE_CLOCK_GETTIME 0 #define HAVE_CLOSESOCKET 0 #define HAVE_COMMANDLINETOARGVW 1 -#define HAVE_COTASKMEMFREE 1 -#define HAVE_CRYPTGENRANDOM 1 -#define HAVE_DLOPEN 0 #define HAVE_FCNTL 0 -#define HAVE_FLT_LIM 1 -#define HAVE_FORK 0 #define HAVE_GETADDRINFO 0 #define HAVE_GETHRTIME 0 #define HAVE_GETOPT 0 @@ -273,7 +284,6 @@ #define HAVE_GETPROCESSMEMORYINFO 1 #define HAVE_GETPROCESSTIMES 1 #define HAVE_GETRUSAGE 0 -#define HAVE_GETSERVBYPORT 0 #define HAVE_GETSYSTEMTIMEASFILETIME 1 #define HAVE_GETTIMEOFDAY 0 #define HAVE_GLOB 0 @@ -281,9 +291,9 @@ #define HAVE_GMTIME_R 0 #define HAVE_INET_ATON 0 #define HAVE_ISATTY 1 -#define HAVE_JACK_PORT_GET_LATENCY_RANGE 0 #define HAVE_KBHIT 1 #define HAVE_LOCALTIME_R 0 +#define HAVE_LSTAT 0 #define HAVE_LZO1X_999_COMPRESS 0 #define HAVE_MACH_ABSOLUTE_TIME 0 #define HAVE_MAPVIEWOFFILE 1 @@ -296,6 +306,7 @@ #define HAVE_POSIX_MEMALIGN 0 #define HAVE_PTHREAD_CANCEL 0 #define HAVE_SCHED_GETAFFINITY 0 +#define HAVE_SECITEMIMPORT 0 #define HAVE_SETCONSOLETEXTATTRIBUTE 1 #define HAVE_SETCONSOLECTRLHANDLER 1 #define HAVE_SETMODE 1 @@ -305,25 +316,31 @@ #define HAVE_SYSCONF 0 #define HAVE_SYSCTL 0 #define HAVE_USLEEP 0 +#define HAVE_UTGETOSTYPEFROMSTRING 0 #define HAVE_VIRTUALALLOC 1 #define HAVE_WGLGETPROCADDRESS 0 +#define HAVE_BCRYPT 1 +#define HAVE_VAAPI_DRM 0 +#define HAVE_VAAPI_X11 0 +#define HAVE_VDPAU_X11 0 #define HAVE_PTHREADS 0 #define HAVE_OS2THREADS 0 #define HAVE_W32THREADS 1 +#define HAVE_AS_ARCH_DIRECTIVE 0 #define HAVE_AS_DN_DIRECTIVE 0 +#define HAVE_AS_FPU_DIRECTIVE 0 #define HAVE_AS_FUNC 0 #define HAVE_AS_OBJECT_ARCH 0 #define HAVE_ASM_MOD_Q 0 -#define HAVE_ATTRIBUTE_MAY_ALIAS 0 -#define HAVE_ATTRIBUTE_PACKED 0 +#define HAVE_BLOCKS_EXTENSION 0 #define HAVE_EBP_AVAILABLE 0 #define HAVE_EBX_AVAILABLE 0 #define HAVE_GNU_AS 0 #define HAVE_GNU_WINDRES 0 #define HAVE_IBM_ASM 0 +#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0 #define HAVE_INLINE_ASM_LABELS 0 #define HAVE_INLINE_ASM_NONLOCAL_LABELS 0 -#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0 #define HAVE_PRAGMA_DEPRECATED 1 #define HAVE_RSYNC_CONTIMEOUT 0 #define HAVE_SYMVER_ASM_LABEL 0 @@ -331,13 +348,13 @@ #define HAVE_VFP_ARGS 0 #define HAVE_XFORM_ASM 0 #define HAVE_XMM_CLOBBERS 0 -#define HAVE_CONDITION_VARIABLE_PTR 1 +#define HAVE_KCMVIDEOCODECTYPE_HEVC 0 #define HAVE_SOCKLEN_T 0 #define HAVE_STRUCT_ADDRINFO 0 -#define HAVE_STRUCT_DCADEC_EXSS_INFO_MATRIX_ENCODING 0 #define HAVE_STRUCT_GROUP_SOURCE_REQ 0 #define HAVE_STRUCT_IP_MREQ_SOURCE 0 #define HAVE_STRUCT_IPV6_MREQ 0 +#define HAVE_STRUCT_MSGHDR_MSG_FLAGS 0 #define HAVE_STRUCT_POLLFD 0 #define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0 #define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0 @@ -346,48 +363,35 @@ #define HAVE_STRUCT_SOCKADDR_STORAGE 0 #define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0 #define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0 -#define HAVE_ATOMICS_NATIVE 1 -#define HAVE_DOS_PATHS 1 -#define HAVE_DXVA2API_COBJ 1 -#define HAVE_DXVA2_LIB 0 -#define HAVE_LIBC_MSVCRT 1 -#define HAVE_LIBDC1394_1 0 -#define HAVE_LIBDC1394_2 0 #define HAVE_MAKEINFO 1 #define HAVE_MAKEINFO_HTML 0 +#define HAVE_OPENCL_D3D11 0 +#define HAVE_OPENCL_DRM_ARM 0 +#define HAVE_OPENCL_DRM_BEIGNET 0 +#define HAVE_OPENCL_DXVA2 0 +#define HAVE_OPENCL_VAAPI_BEIGNET 0 +#define HAVE_OPENCL_VAAPI_INTEL_MEDIA 0 #define HAVE_PERL 1 #define HAVE_POD2MAN 0 -#define HAVE_SDL 0 -#define HAVE_SECTION_DATA_REL_RO 0 #define HAVE_TEXI2HTML 0 -#define HAVE_THREADS 1 -#define HAVE_VAAPI_X11 0 -#define HAVE_VDPAU_X11 0 -#define HAVE_XLIB 0 -#define CONFIG_BSFS 1 -#define CONFIG_DECODERS 1 -#define CONFIG_DEMUXERS 1 -#define CONFIG_ENCODERS 0 -#define CONFIG_FILTERS 0 -#define CONFIG_HWACCELS 0 -#define CONFIG_INDEVS 0 -#define CONFIG_MUXERS 0 -#define CONFIG_OUTDEVS 0 -#define CONFIG_PARSERS 1 -#define CONFIG_PROTOCOLS 1 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 #define CONFIG_PODPAGES 1 #define CONFIG_TXTPAGES 1 +#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1 #define CONFIG_AVIO_READING_EXAMPLE 1 -#define CONFIG_AVIO_LIST_DIR_EXAMPLE 1 -#define CONFIG_DECODING_ENCODING_EXAMPLE 1 +#define CONFIG_DECODE_AUDIO_EXAMPLE 1 +#define CONFIG_DECODE_VIDEO_EXAMPLE 1 #define CONFIG_DEMUXING_DECODING_EXAMPLE 1 +#define CONFIG_ENCODE_AUDIO_EXAMPLE 1 +#define CONFIG_ENCODE_VIDEO_EXAMPLE 1 #define CONFIG_EXTRACT_MVS_EXAMPLE 1 #define CONFIG_FILTER_AUDIO_EXAMPLE 0 #define CONFIG_FILTERING_AUDIO_EXAMPLE 0 #define CONFIG_FILTERING_VIDEO_EXAMPLE 0 +#define CONFIG_HTTP_MULTICLIENT_EXAMPLE 0 +#define CONFIG_HW_DECODE_EXAMPLE 1 #define CONFIG_METADATA_EXAMPLE 1 #define CONFIG_MUXING_EXAMPLE 1 #define CONFIG_QSVDEC_EXAMPLE 0 @@ -396,25 +400,48 @@ #define CONFIG_SCALING_VIDEO_EXAMPLE 1 #define CONFIG_TRANSCODE_AAC_EXAMPLE 1 #define CONFIG_TRANSCODING_EXAMPLE 0 +#define CONFIG_VAAPI_ENCODE_EXAMPLE 0 +#define CONFIG_VAAPI_TRANSCODE_EXAMPLE 0 #define CONFIG_AVISYNTH 0 -#define CONFIG_BZLIB 0 -#define CONFIG_CRYSTALHD 0 -#define CONFIG_DECKLINK 0 #define CONFIG_FREI0R 0 +#define CONFIG_LIBCDIO 0 +#define CONFIG_LIBDAVS2 0 +#define CONFIG_LIBRUBBERBAND 0 +#define CONFIG_LIBVIDSTAB 0 +#define CONFIG_LIBX264 0 +#define CONFIG_LIBX265 0 +#define CONFIG_LIBXAVS 0 +#define CONFIG_LIBXAVS2 0 +#define CONFIG_LIBXVID 0 +#define CONFIG_DECKLINK 0 +#define CONFIG_LIBNDI_NEWTEK 0 +#define CONFIG_LIBFDK_AAC 0 +#define CONFIG_OPENSSL 0 +#define CONFIG_LIBTLS 0 +#define CONFIG_GMP 0 +#define CONFIG_LIBLENSFUN 0 +#define CONFIG_LIBOPENCORE_AMRNB 0 +#define CONFIG_LIBOPENCORE_AMRWB 0 +#define CONFIG_LIBVMAF 0 +#define CONFIG_LIBVO_AMRWBENC 0 +#define CONFIG_MBEDTLS 0 +#define CONFIG_RKMPP 0 +#define CONFIG_LIBSMBCLIENT 0 +#define CONFIG_CHROMAPRINT 0 +#define CONFIG_GCRYPT 0 #define CONFIG_GNUTLS 0 -#define CONFIG_ICONV 0 +#define CONFIG_JNI 0 #define CONFIG_LADSPA 0 -#define CONFIG_LIBAACPLUS 0 +#define CONFIG_LIBAOM 0 #define CONFIG_LIBASS 0 #define CONFIG_LIBBLURAY 0 #define CONFIG_LIBBS2B 0 #define CONFIG_LIBCACA 0 -#define CONFIG_LIBCDIO 0 #define CONFIG_LIBCELT 0 +#define CONFIG_LIBCODEC2 0 +#define CONFIG_LIBDAV1D 0 #define CONFIG_LIBDC1394 0 -#define CONFIG_LIBDCADEC 0 -#define CONFIG_LIBFAAC 0 -#define CONFIG_LIBFDK_AAC 0 +#define CONFIG_LIBDRM 0 #define CONFIG_LIBFLITE 0 #define CONFIG_LIBFONTCONFIG 0 #define CONFIG_LIBFREETYPE 0 @@ -423,91 +450,107 @@ #define CONFIG_LIBGSM 0 #define CONFIG_LIBIEC61883 0 #define CONFIG_LIBILBC 0 +#define CONFIG_LIBJACK 0 +#define CONFIG_LIBKLVANC 0 #define CONFIG_LIBKVAZAAR 0 -#define CONFIG_LIBMFX 0 #define CONFIG_LIBMODPLUG 0 #define CONFIG_LIBMP3LAME 0 -#define CONFIG_LIBNUT 0 -#define CONFIG_LIBOPENCORE_AMRNB 0 -#define CONFIG_LIBOPENCORE_AMRWB 0 +#define CONFIG_LIBMYSOFA 0 #define CONFIG_LIBOPENCV 0 #define CONFIG_LIBOPENH264 0 #define CONFIG_LIBOPENJPEG 0 +#define CONFIG_LIBOPENMPT 0 #define CONFIG_LIBOPUS 0 #define CONFIG_LIBPULSE 0 -#define CONFIG_LIBQUVI 0 +#define CONFIG_LIBRSVG 0 #define CONFIG_LIBRTMP 0 -#define CONFIG_LIBSCHROEDINGER 0 #define CONFIG_LIBSHINE 0 #define CONFIG_LIBSMBCLIENT 0 #define CONFIG_LIBSNAPPY 0 #define CONFIG_LIBSOXR 0 #define CONFIG_LIBSPEEX 0 +#define CONFIG_LIBSRT 0 #define CONFIG_LIBSSH 0 -#define CONFIG_LIBSTAGEFRIGHT_H264 0 +#define CONFIG_LIBTENSORFLOW 0 +#define CONFIG_LIBTESSERACT 0 #define CONFIG_LIBTHEORA 0 #define CONFIG_LIBTWOLAME 0 -#define CONFIG_LIBUTVIDEO 0 #define CONFIG_LIBV4L2 0 -#define CONFIG_LIBVIDSTAB 0 -#define CONFIG_LIBVO_AACENC 0 -#define CONFIG_LIBVO_AMRWBENC 0 #define CONFIG_LIBVORBIS 0 #define CONFIG_LIBVPX 0 #define CONFIG_LIBWAVPACK 0 #define CONFIG_LIBWEBP 0 -#define CONFIG_LIBX264 0 -#define CONFIG_LIBX265 0 -#define CONFIG_LIBXAVS 0 +#define CONFIG_LIBXML2 0 +#define CONFIG_LIBZIMG 0 +#define CONFIG_LIBZMQ 0 +#define CONFIG_LIBZVBI 0 +#define CONFIG_LV2 0 +#define CONFIG_MEDIACODEC 0 +#define CONFIG_OPENAL 0 +#define CONFIG_OPENGL 0 +#define CONFIG_VAPOURSYNTH 0 +#define CONFIG_ALSA 0 +#define CONFIG_APPKIT 0 +#define CONFIG_AVFOUNDATION 0 +#define CONFIG_BZLIB 0 +#define CONFIG_COREIMAGE 0 +#define CONFIG_ICONV 0 #define CONFIG_LIBXCB 0 #define CONFIG_LIBXCB_SHM 0 #define CONFIG_LIBXCB_SHAPE 0 #define CONFIG_LIBXCB_XFIXES 0 -#define CONFIG_LIBXVID 0 -#define CONFIG_LIBZMQ 0 -#define CONFIG_LIBZVBI 0 #define CONFIG_LZMA 0 -#define CONFIG_MMAL 0 -#define CONFIG_NVENC 0 -#define CONFIG_OPENAL 0 -#define CONFIG_OPENCL 0 -#define CONFIG_OPENGL 0 -#define CONFIG_OPENSSL 0 -#define CONFIG_SDL 0 +#define CONFIG_SCHANNEL 1 +#define CONFIG_SDL2 0 #define CONFIG_SECURETRANSPORT 0 -#define CONFIG_X11GRAB 0 +#define CONFIG_SNDIO 0 #define CONFIG_XLIB 0 #define CONFIG_ZLIB 1 +#define CONFIG_CUDA_SDK 0 +#define CONFIG_LIBNPP 0 +#define CONFIG_LIBMFX 0 +#define CONFIG_MMAL 0 +#define CONFIG_OMX 0 +#define CONFIG_OPENCL 0 +#define CONFIG_AMF 0 +#define CONFIG_AUDIOTOOLBOX 0 +#define CONFIG_CRYSTALHD 0 +#define CONFIG_CUDA 0 +#define CONFIG_CUVID 0 +#define CONFIG_D3D11VA 0 +#define CONFIG_DXVA2 0 +#define CONFIG_FFNVCODEC 0 +#define CONFIG_NVDEC 0 +#define CONFIG_NVENC 0 +#define CONFIG_VAAPI 0 +#define CONFIG_VDPAU 0 +#define CONFIG_VIDEOTOOLBOX 0 +#define CONFIG_V4L2_M2M 0 +#define CONFIG_XVMC 0 #define CONFIG_FTRAPV 0 #define CONFIG_GRAY 0 #define CONFIG_HARDCODED_TABLES 0 +#define CONFIG_OMX_RPI 0 #define CONFIG_RUNTIME_CPUDETECT 1 #define CONFIG_SAFE_BITSTREAM_READER 1 #define CONFIG_SHARED 0 -#define CONFIG_SMALL 0 +#define CONFIG_SMALL 1 #define CONFIG_STATIC 1 #define CONFIG_SWSCALE_ALPHA 1 -#define CONFIG_D3D11VA 0 -#define CONFIG_DXVA2 0 -#define CONFIG_VAAPI 0 -#define CONFIG_VDA 0 -#define CONFIG_VDPAU 0 -#define CONFIG_XVMC 0 #define CONFIG_GPL 1 #define CONFIG_NONFREE 0 #define CONFIG_VERSION3 0 -#define CONFIG_AVCODEC 1 #define CONFIG_AVDEVICE 1 #define CONFIG_AVFILTER 0 +#define CONFIG_SWSCALE 1 +#define CONFIG_POSTPROC 0 #define CONFIG_AVFORMAT 1 +#define CONFIG_AVCODEC 1 +#define CONFIG_SWRESAMPLE 1 #define CONFIG_AVRESAMPLE 0 #define CONFIG_AVUTIL 1 -#define CONFIG_POSTPROC 0 -#define CONFIG_SWRESAMPLE 1 -#define CONFIG_SWSCALE 1 #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 -#define CONFIG_FFSERVER 0 #define CONFIG_FFMPEG 0 #define CONFIG_DCT 1 #define CONFIG_DWT 1 @@ -521,24 +564,44 @@ #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 #define CONFIG_RDFT 1 +#define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 -#define CONFIG_INCOMPATIBLE_LIBAV_ABI 0 -#define CONFIG_MEMALIGN_HACK 0 +#define CONFIG_LINUX_PERF 0 #define CONFIG_MEMORY_POISONING 0 #define CONFIG_NEON_CLOBBER_TEST 0 +#define CONFIG_OSSFUZZ 0 #define CONFIG_PIC 0 -#define CONFIG_POD2MAN 0 -#define CONFIG_RAISE_MAJOR 0 #define CONFIG_THUMB 0 #define CONFIG_VALGRIND_BACKTRACE 0 #define CONFIG_XMM_CLOBBER_TEST 0 +#define CONFIG_BSFS 1 +#define CONFIG_DECODERS 1 +#define CONFIG_ENCODERS 0 +#define CONFIG_HWACCELS 0 +#define CONFIG_PARSERS 1 +#define CONFIG_INDEVS 0 +#define CONFIG_OUTDEVS 0 +#define CONFIG_FILTERS 0 +#define CONFIG_DEMUXERS 1 +#define CONFIG_MUXERS 0 +#define CONFIG_PROTOCOLS 1 #define CONFIG_AANDCTTABLES 1 #define CONFIG_AC3DSP 1 -#define CONFIG_AUDIO_FRAME_QUEUE 0 +#define CONFIG_ADTS_HEADER 1 +#define CONFIG_AUDIO_FRAME_QUEUE 1 #define CONFIG_AUDIODSP 1 #define CONFIG_BLOCKDSP 1 #define CONFIG_BSWAPDSP 1 #define CONFIG_CABAC 1 +#define CONFIG_CBS 1 +#define CONFIG_CBS_AV1 1 +#define CONFIG_CBS_H264 1 +#define CONFIG_CBS_H265 1 +#define CONFIG_CBS_JPEG 0 +#define CONFIG_CBS_MPEG2 1 +#define CONFIG_CBS_VP9 1 +#define CONFIG_DIRAC_PARSE 1 +#define CONFIG_DNN 0 #define CONFIG_DVPROFILE 1 #define CONFIG_EXIF 1 #define CONFIG_FAANDCT 1 @@ -548,34 +611,38 @@ #define CONFIG_FMTCONVERT 1 #define CONFIG_FRAME_THREAD_ENCODER 0 #define CONFIG_G722DSP 1 -#define CONFIG_GCRYPT 0 -#define CONFIG_GMP 0 #define CONFIG_GOLOMB 1 #define CONFIG_GPLV3 0 #define CONFIG_H263DSP 1 #define CONFIG_H264CHROMA 1 #define CONFIG_H264DSP 1 +#define CONFIG_H264PARSE 1 #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 +#define CONFIG_HEVCPARSE 1 #define CONFIG_HPELDSP 1 #define CONFIG_HUFFMAN 1 #define CONFIG_HUFFYUVDSP 1 #define CONFIG_HUFFYUVENCDSP 0 #define CONFIG_IDCTDSP 1 #define CONFIG_IIRFILTER 0 -#define CONFIG_IMDCT15 1 +#define CONFIG_MDCT15 1 #define CONFIG_INTRAX8 1 +#define CONFIG_ISO_MEDIA 1 #define CONFIG_IVIDSP 0 #define CONFIG_JPEGTABLES 1 -#define CONFIG_LIBX262 0 #define CONFIG_LGPLV3 0 +#define CONFIG_LIBX262 0 #define CONFIG_LLAUDDSP 1 #define CONFIG_LLVIDDSP 1 +#define CONFIG_LLVIDENCDSP 0 #define CONFIG_LPC 0 +#define CONFIG_LZF 1 #define CONFIG_ME_CMP 1 #define CONFIG_MPEG_ER 1 #define CONFIG_MPEGAUDIO 1 #define CONFIG_MPEGAUDIODSP 1 +#define CONFIG_MPEGAUDIOHEADER 1 #define CONFIG_MPEGVIDEO 1 #define CONFIG_MPEGVIDEOENC 1 #define CONFIG_MSS34DSP 1 @@ -584,18 +651,24 @@ #define CONFIG_QSV 0 #define CONFIG_QSVDEC 0 #define CONFIG_QSVENC 0 +#define CONFIG_QSVVPP 0 #define CONFIG_RANGECODER 1 #define CONFIG_RIFFDEC 1 #define CONFIG_RIFFENC 0 #define CONFIG_RTPDEC 0 #define CONFIG_RTPENC_CHAIN 0 #define CONFIG_RV34DSP 1 +#define CONFIG_SCENE_SAD 0 #define CONFIG_SINEWIN 1 #define CONFIG_SNAPPY 1 +#define CONFIG_SRTP 0 #define CONFIG_STARTCODE 1 #define CONFIG_TEXTUREDSP 1 #define CONFIG_TEXTUREDSPENC 0 #define CONFIG_TPELDSP 1 +#define CONFIG_VAAPI_1 0 +#define CONFIG_VAAPI_ENCODE 0 +#define CONFIG_VC1DSP 1 #define CONFIG_VIDEODSP 1 #define CONFIG_VP3DSP 1 #define CONFIG_VP56DSP 1 @@ -603,19 +676,36 @@ #define CONFIG_WMA_FREQS 1 #define CONFIG_WMV2DSP 1 #define CONFIG_AAC_ADTSTOASC_BSF 1 +#define CONFIG_AV1_METADATA_BSF 1 #define CONFIG_CHOMP_BSF 1 #define CONFIG_DUMP_EXTRADATA_BSF 1 +#define CONFIG_DCA_CORE_BSF 1 +#define CONFIG_EAC3_CORE_BSF 1 +#define CONFIG_EXTRACT_EXTRADATA_BSF 1 +#define CONFIG_FILTER_UNITS_BSF 1 +#define CONFIG_H264_METADATA_BSF 1 #define CONFIG_H264_MP4TOANNEXB_BSF 1 +#define CONFIG_H264_REDUNDANT_PPS_BSF 1 +#define CONFIG_HAPQA_EXTRACT_BSF 1 +#define CONFIG_HEVC_METADATA_BSF 1 #define CONFIG_HEVC_MP4TOANNEXB_BSF 1 #define CONFIG_IMX_DUMP_HEADER_BSF 1 #define CONFIG_MJPEG2JPEG_BSF 1 #define CONFIG_MJPEGA_DUMP_HEADER_BSF 1 #define CONFIG_MP3_HEADER_DECOMPRESS_BSF 1 +#define CONFIG_MPEG2_METADATA_BSF 1 #define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 1 #define CONFIG_MOV2TEXTSUB_BSF 1 #define CONFIG_NOISE_BSF 1 +#define CONFIG_NULL_BSF 1 +#define CONFIG_PRORES_METADATA_BSF 1 #define CONFIG_REMOVE_EXTRADATA_BSF 1 #define CONFIG_TEXT2MOVSUB_BSF 1 +#define CONFIG_TRACE_HEADERS_BSF 1 +#define CONFIG_VP9_METADATA_BSF 1 +#define CONFIG_VP9_RAW_REORDER_BSF 1 +#define CONFIG_VP9_SUPERFRAME_BSF 1 +#define CONFIG_VP9_SUPERFRAME_SPLIT_BSF 1 #define CONFIG_AASC_DECODER 1 #define CONFIG_AIC_DECODER 1 #define CONFIG_ALIAS_PIX_DECODER 1 @@ -635,6 +725,7 @@ #define CONFIG_BETHSOFTVID_DECODER 1 #define CONFIG_BFI_DECODER 1 #define CONFIG_BINK_DECODER 1 +#define CONFIG_BITPACKED_DECODER 1 #define CONFIG_BMP_DECODER 1 #define CONFIG_BMV_VIDEO_DECODER 1 #define CONFIG_BRENDER_PIX_DECODER 1 @@ -642,7 +733,9 @@ #define CONFIG_CAVS_DECODER 1 #define CONFIG_CDGRAPHICS_DECODER 1 #define CONFIG_CDXL_DECODER 1 +#define CONFIG_CFHD_DECODER 1 #define CONFIG_CINEPAK_DECODER 1 +#define CONFIG_CLEARVIDEO_DECODER 1 #define CONFIG_CLJR_DECODER 1 #define CONFIG_CLLC_DECODER 1 #define CONFIG_COMFORTNOISE_DECODER 1 @@ -655,9 +748,11 @@ #define CONFIG_DNXHD_DECODER 1 #define CONFIG_DPX_DECODER 1 #define CONFIG_DSICINVIDEO_DECODER 1 +#define CONFIG_DVAUDIO_DECODER 1 #define CONFIG_DVVIDEO_DECODER 1 #define CONFIG_DXA_DECODER 1 #define CONFIG_DXTORY_DECODER 1 +#define CONFIG_DXV_DECODER 1 #define CONFIG_EACMV_DECODER 1 #define CONFIG_EAMAD_DECODER 1 #define CONFIG_EATGQ_DECODER 1 @@ -672,35 +767,42 @@ #define CONFIG_FFV1_DECODER 1 #define CONFIG_FFVHUFF_DECODER 1 #define CONFIG_FIC_DECODER 1 +#define CONFIG_FITS_DECODER 1 #define CONFIG_FLASHSV_DECODER 1 #define CONFIG_FLASHSV2_DECODER 1 #define CONFIG_FLIC_DECODER 1 #define CONFIG_FLV_DECODER 1 +#define CONFIG_FMVC_DECODER 1 #define CONFIG_FOURXM_DECODER 1 #define CONFIG_FRAPS_DECODER 1 #define CONFIG_FRWU_DECODER 1 #define CONFIG_G2M_DECODER 1 +#define CONFIG_GDV_DECODER 1 #define CONFIG_GIF_DECODER 1 #define CONFIG_H261_DECODER 1 #define CONFIG_H263_DECODER 1 #define CONFIG_H263I_DECODER 1 #define CONFIG_H263P_DECODER 1 +#define CONFIG_H263_V4L2M2M_DECODER 0 #define CONFIG_H264_DECODER 1 #define CONFIG_H264_CRYSTALHD_DECODER 0 +#define CONFIG_H264_V4L2M2M_DECODER 0 +#define CONFIG_H264_MEDIACODEC_DECODER 0 #define CONFIG_H264_MMAL_DECODER 0 #define CONFIG_H264_QSV_DECODER 0 -#define CONFIG_H264_VDA_DECODER 0 -#define CONFIG_H264_VDPAU_DECODER 0 +#define CONFIG_H264_RKMPP_DECODER 0 #define CONFIG_HAP_DECODER 1 #define CONFIG_HEVC_DECODER 1 #define CONFIG_HEVC_QSV_DECODER 0 +#define CONFIG_HEVC_RKMPP_DECODER 0 +#define CONFIG_HEVC_V4L2M2M_DECODER 0 #define CONFIG_HNM4_VIDEO_DECODER 1 #define CONFIG_HQ_HQA_DECODER 1 #define CONFIG_HQX_DECODER 1 #define CONFIG_HUFFYUV_DECODER 1 #define CONFIG_IDCIN_DECODER 1 -#define CONFIG_IFF_BYTERUN1_DECODER 1 #define CONFIG_IFF_ILBM_DECODER 1 +#define CONFIG_IMM4_DECODER 1 #define CONFIG_INDEO2_DECODER 0 #define CONFIG_INDEO3_DECODER 0 #define CONFIG_INDEO4_DECODER 0 @@ -713,28 +815,33 @@ #define CONFIG_KMVC_DECODER 1 #define CONFIG_LAGARITH_DECODER 1 #define CONFIG_LOCO_DECODER 1 +#define CONFIG_M101_DECODER 1 +#define CONFIG_MAGICYUV_DECODER 1 #define CONFIG_MDEC_DECODER 1 #define CONFIG_MIMIC_DECODER 1 #define CONFIG_MJPEG_DECODER 1 #define CONFIG_MJPEGB_DECODER 1 #define CONFIG_MMVIDEO_DECODER 1 #define CONFIG_MOTIONPIXELS_DECODER 1 -#define CONFIG_MPEG_XVMC_DECODER 0 #define CONFIG_MPEG1VIDEO_DECODER 1 #define CONFIG_MPEG2VIDEO_DECODER 1 #define CONFIG_MPEG4_DECODER 1 #define CONFIG_MPEG4_CRYSTALHD_DECODER 0 -#define CONFIG_MPEG4_VDPAU_DECODER 0 +#define CONFIG_MPEG4_V4L2M2M_DECODER 0 +#define CONFIG_MPEG4_MMAL_DECODER 0 #define CONFIG_MPEGVIDEO_DECODER 1 -#define CONFIG_MPEG_VDPAU_DECODER 0 -#define CONFIG_MPEG1_VDPAU_DECODER 0 +#define CONFIG_MPEG1_V4L2M2M_DECODER 0 +#define CONFIG_MPEG2_MMAL_DECODER 0 #define CONFIG_MPEG2_CRYSTALHD_DECODER 0 +#define CONFIG_MPEG2_V4L2M2M_DECODER 0 #define CONFIG_MPEG2_QSV_DECODER 0 +#define CONFIG_MPEG2_MEDIACODEC_DECODER 0 #define CONFIG_MSA1_DECODER 1 -#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0 +#define CONFIG_MSCC_DECODER 1 #define CONFIG_MSMPEG4V1_DECODER 1 #define CONFIG_MSMPEG4V2_DECODER 1 #define CONFIG_MSMPEG4V3_DECODER 1 +#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0 #define CONFIG_MSRLE_DECODER 1 #define CONFIG_MSS1_DECODER 1 #define CONFIG_MSS2_DECODER 1 @@ -743,6 +850,7 @@ #define CONFIG_MTS2_DECODER 1 #define CONFIG_MVC1_DECODER 1 #define CONFIG_MVC2_DECODER 1 +#define CONFIG_MWSC_DECODER 1 #define CONFIG_MXPEG_DECODER 1 #define CONFIG_NUV_DECODER 1 #define CONFIG_PAF_VIDEO_DECODER 1 @@ -752,33 +860,43 @@ #define CONFIG_PGM_DECODER 1 #define CONFIG_PGMYUV_DECODER 1 #define CONFIG_PICTOR_DECODER 1 +#define CONFIG_PIXLET_DECODER 1 #define CONFIG_PNG_DECODER 1 #define CONFIG_PPM_DECODER 1 #define CONFIG_PRORES_DECODER 1 -#define CONFIG_PRORES_LGPL_DECODER 1 +#define CONFIG_PROSUMER_DECODER 1 +#define CONFIG_PSD_DECODER 1 #define CONFIG_PTX_DECODER 1 #define CONFIG_QDRAW_DECODER 1 #define CONFIG_QPEG_DECODER 1 #define CONFIG_QTRLE_DECODER 1 #define CONFIG_R10K_DECODER 1 #define CONFIG_R210_DECODER 1 +#define CONFIG_RASC_DECODER 1 #define CONFIG_RAWVIDEO_DECODER 1 #define CONFIG_RL2_DECODER 1 #define CONFIG_ROQ_DECODER 1 #define CONFIG_RPZA_DECODER 1 +#define CONFIG_RSCC_DECODER 1 #define CONFIG_RV10_DECODER 1 #define CONFIG_RV20_DECODER 1 #define CONFIG_RV30_DECODER 1 #define CONFIG_RV40_DECODER 1 #define CONFIG_S302M_DECODER 1 #define CONFIG_SANM_DECODER 1 +#define CONFIG_SCPR_DECODER 1 +#define CONFIG_SCREENPRESSO_DECODER 1 +#define CONFIG_SDX2_DPCM_DECODER 1 #define CONFIG_SGI_DECODER 1 #define CONFIG_SGIRLE_DECODER 1 +#define CONFIG_SHEERVIDEO_DECODER 1 #define CONFIG_SMACKER_DECODER 1 #define CONFIG_SMC_DECODER 1 #define CONFIG_SMVJPEG_DECODER 1 #define CONFIG_SNOW_DECODER 1 #define CONFIG_SP5X_DECODER 1 +#define CONFIG_SPEEDHQ_DECODER 1 +#define CONFIG_SRGC_DECODER 1 #define CONFIG_SUNRAST_DECODER 1 #define CONFIG_SVQ1_DECODER 1 #define CONFIG_SVQ3_DECODER 1 @@ -792,6 +910,7 @@ #define CONFIG_TMV_DECODER 1 #define CONFIG_TRUEMOTION1_DECODER 1 #define CONFIG_TRUEMOTION2_DECODER 1 +#define CONFIG_TRUEMOTION2RT_DECODER 1 #define CONFIG_TSCC_DECODER 1 #define CONFIG_TSCC2_DECODER 1 #define CONFIG_TXD_DECODER 1 @@ -806,9 +925,10 @@ #define CONFIG_VBLE_DECODER 1 #define CONFIG_VC1_DECODER 1 #define CONFIG_VC1_CRYSTALHD_DECODER 0 -#define CONFIG_VC1_VDPAU_DECODER 0 #define CONFIG_VC1IMAGE_DECODER 1 +#define CONFIG_VC1_MMAL_DECODER 0 #define CONFIG_VC1_QSV_DECODER 0 +#define CONFIG_VC1_V4L2M2M_DECODER 0 #define CONFIG_VCR1_DECODER 1 #define CONFIG_VMDVIDEO_DECODER 1 #define CONFIG_VMNC_DECODER 1 @@ -819,14 +939,19 @@ #define CONFIG_VP6F_DECODER 1 #define CONFIG_VP7_DECODER 1 #define CONFIG_VP8_DECODER 1 +#define CONFIG_VP8_RKMPP_DECODER 0 +#define CONFIG_VP8_V4L2M2M_DECODER 0 #define CONFIG_VP9_DECODER 1 +#define CONFIG_VP9_RKMPP_DECODER 0 +#define CONFIG_VP9_V4L2M2M_DECODER 0 #define CONFIG_VQA_DECODER 1 #define CONFIG_WEBP_DECODER 1 +#define CONFIG_WCMV_DECODER 1 +#define CONFIG_WRAPPED_AVFRAME_DECODER 1 #define CONFIG_WMV1_DECODER 1 #define CONFIG_WMV2_DECODER 1 #define CONFIG_WMV3_DECODER 1 #define CONFIG_WMV3_CRYSTALHD_DECODER 0 -#define CONFIG_WMV3_VDPAU_DECODER 0 #define CONFIG_WMV3IMAGE_DECODER 1 #define CONFIG_WNV1_DECODER 1 #define CONFIG_XAN_WC3_DECODER 1 @@ -834,8 +959,10 @@ #define CONFIG_XBM_DECODER 1 #define CONFIG_XFACE_DECODER 1 #define CONFIG_XL_DECODER 1 +#define CONFIG_XPM_DECODER 1 #define CONFIG_XWD_DECODER 1 #define CONFIG_Y41P_DECODER 1 +#define CONFIG_YLC_DECODER 1 #define CONFIG_YOP_DECODER 1 #define CONFIG_YUV4_DECODER 1 #define CONFIG_ZERO12V_DECODER 1 @@ -852,20 +979,27 @@ #define CONFIG_AMRNB_DECODER 1 #define CONFIG_AMRWB_DECODER 1 #define CONFIG_APE_DECODER 1 +#define CONFIG_APTX_DECODER 1 +#define CONFIG_APTX_HD_DECODER 1 #define CONFIG_ATRAC1_DECODER 1 #define CONFIG_ATRAC3_DECODER 1 +#define CONFIG_ATRAC3AL_DECODER 1 #define CONFIG_ATRAC3P_DECODER 0 +#define CONFIG_ATRAC3PAL_DECODER 1 +#define CONFIG_ATRAC9_DECODER 1 #define CONFIG_BINKAUDIO_DCT_DECODER 1 #define CONFIG_BINKAUDIO_RDFT_DECODER 1 #define CONFIG_BMV_AUDIO_DECODER 1 #define CONFIG_COOK_DECODER 1 #define CONFIG_DCA_DECODER 1 +#define CONFIG_DOLBY_E_DECODER 1 #define CONFIG_DSD_LSBF_DECODER 1 #define CONFIG_DSD_MSBF_DECODER 1 #define CONFIG_DSD_LSBF_PLANAR_DECODER 1 #define CONFIG_DSD_MSBF_PLANAR_DECODER 1 #define CONFIG_DSICINAUDIO_DECODER 1 #define CONFIG_DSS_SP_DECODER 1 +#define CONFIG_DST_DECODER 1 #define CONFIG_EAC3_DECODER 1 #define CONFIG_EVRC_DECODER 1 #define CONFIG_FFWAVESYNTH_DECODER 1 @@ -875,7 +1009,9 @@ #define CONFIG_GSM_DECODER 1 #define CONFIG_GSM_MS_DECODER 1 #define CONFIG_IAC_DECODER 1 +#define CONFIG_ILBC_DECODER 1 #define CONFIG_IMC_DECODER 1 +#define CONFIG_INTERPLAY_ACM_DECODER 1 #define CONFIG_MACE3_DECODER 1 #define CONFIG_MACE6_DECODER 1 #define CONFIG_METASOUND_DECODER 1 @@ -884,12 +1020,12 @@ #define CONFIG_MP1FLOAT_DECODER 1 #define CONFIG_MP2_DECODER 1 #define CONFIG_MP2FLOAT_DECODER 1 -#define CONFIG_MP3_DECODER 1 #define CONFIG_MP3FLOAT_DECODER 1 -#define CONFIG_MP3ADU_DECODER 1 +#define CONFIG_MP3_DECODER 1 #define CONFIG_MP3ADUFLOAT_DECODER 1 -#define CONFIG_MP3ON4_DECODER 1 +#define CONFIG_MP3ADU_DECODER 1 #define CONFIG_MP3ON4FLOAT_DECODER 1 +#define CONFIG_MP3ON4_DECODER 1 #define CONFIG_MPC7_DECODER 1 #define CONFIG_MPC8_DECODER 1 #define CONFIG_NELLYMOSER_DECODER 1 @@ -898,9 +1034,11 @@ #define CONFIG_PAF_AUDIO_DECODER 1 #define CONFIG_QCELP_DECODER 1 #define CONFIG_QDM2_DECODER 1 +#define CONFIG_QDMC_DECODER 1 #define CONFIG_RA_144_DECODER 1 #define CONFIG_RA_288_DECODER 1 #define CONFIG_RALF_DECODER 1 +#define CONFIG_SBC_DECODER 1 #define CONFIG_SHORTEN_DECODER 1 #define CONFIG_SIPR_DECODER 1 #define CONFIG_SMACKAUD_DECODER 1 @@ -919,9 +1057,13 @@ #define CONFIG_WMAV2_DECODER 1 #define CONFIG_WMAVOICE_DECODER 1 #define CONFIG_WS_SND1_DECODER 1 +#define CONFIG_XMA1_DECODER 1 +#define CONFIG_XMA2_DECODER 1 #define CONFIG_PCM_ALAW_DECODER 1 #define CONFIG_PCM_BLURAY_DECODER 1 #define CONFIG_PCM_DVD_DECODER 1 +#define CONFIG_PCM_F16LE_DECODER 1 +#define CONFIG_PCM_F24LE_DECODER 1 #define CONFIG_PCM_F32BE_DECODER 1 #define CONFIG_PCM_F32LE_DECODER 1 #define CONFIG_PCM_F64BE_DECODER 1 @@ -941,6 +1083,8 @@ #define CONFIG_PCM_S32BE_DECODER 1 #define CONFIG_PCM_S32LE_DECODER 1 #define CONFIG_PCM_S32LE_PLANAR_DECODER 1 +#define CONFIG_PCM_S64BE_DECODER 1 +#define CONFIG_PCM_S64LE_DECODER 1 #define CONFIG_PCM_U8_DECODER 1 #define CONFIG_PCM_U16BE_DECODER 1 #define CONFIG_PCM_U16LE_DECODER 1 @@ -948,7 +1092,9 @@ #define CONFIG_PCM_U24LE_DECODER 1 #define CONFIG_PCM_U32BE_DECODER 1 #define CONFIG_PCM_U32LE_DECODER 1 +#define CONFIG_PCM_VIDC_DECODER 1 #define CONFIG_PCM_ZORK_DECODER 1 +#define CONFIG_GREMLIN_DPCM_DECODER 1 #define CONFIG_INTERPLAY_DPCM_DECODER 1 #define CONFIG_ROQ_DPCM_DECODER 1 #define CONFIG_SOL_DPCM_DECODER 1 @@ -956,6 +1102,7 @@ #define CONFIG_ADPCM_4XM_DECODER 1 #define CONFIG_ADPCM_ADX_DECODER 1 #define CONFIG_ADPCM_AFC_DECODER 1 +#define CONFIG_ADPCM_AICA_DECODER 1 #define CONFIG_ADPCM_CT_DECODER 1 #define CONFIG_ADPCM_DTK_DECODER 1 #define CONFIG_ADPCM_EA_DECODER 1 @@ -969,6 +1116,7 @@ #define CONFIG_ADPCM_G726LE_DECODER 1 #define CONFIG_ADPCM_IMA_AMV_DECODER 1 #define CONFIG_ADPCM_IMA_APC_DECODER 1 +#define CONFIG_ADPCM_IMA_DAT4_DECODER 1 #define CONFIG_ADPCM_IMA_DK3_DECODER 1 #define CONFIG_ADPCM_IMA_DK4_DECODER 1 #define CONFIG_ADPCM_IMA_EA_EACS_DECODER 1 @@ -981,6 +1129,8 @@ #define CONFIG_ADPCM_IMA_WAV_DECODER 1 #define CONFIG_ADPCM_IMA_WS_DECODER 1 #define CONFIG_ADPCM_MS_DECODER 1 +#define CONFIG_ADPCM_MTAF_DECODER 1 +#define CONFIG_ADPCM_PSX_DECODER 1 #define CONFIG_ADPCM_SBPRO_2_DECODER 1 #define CONFIG_ADPCM_SBPRO_3_DECODER 1 #define CONFIG_ADPCM_SBPRO_4_DECODER 1 @@ -990,7 +1140,6 @@ #define CONFIG_ADPCM_VIMA_DECODER 1 #define CONFIG_ADPCM_XA_DECODER 1 #define CONFIG_ADPCM_YAMAHA_DECODER 1 -#define CONFIG_VIMA_DECODER 1 #define CONFIG_SSA_DECODER 1 #define CONFIG_ASS_DECODER 1 #define CONFIG_CCAPTION_DECODER 1 @@ -1013,8 +1162,26 @@ #define CONFIG_VPLAYER_DECODER 1 #define CONFIG_WEBVTT_DECODER 1 #define CONFIG_XSUB_DECODER 1 +#define CONFIG_AAC_AT_DECODER 0 +#define CONFIG_AC3_AT_DECODER 0 +#define CONFIG_ADPCM_IMA_QT_AT_DECODER 0 +#define CONFIG_ALAC_AT_DECODER 0 +#define CONFIG_AMR_NB_AT_DECODER 0 +#define CONFIG_EAC3_AT_DECODER 0 +#define CONFIG_GSM_MS_AT_DECODER 0 +#define CONFIG_ILBC_AT_DECODER 0 +#define CONFIG_MP1_AT_DECODER 0 +#define CONFIG_MP2_AT_DECODER 0 +#define CONFIG_MP3_AT_DECODER 0 +#define CONFIG_PCM_ALAW_AT_DECODER 0 +#define CONFIG_PCM_MULAW_AT_DECODER 0 +#define CONFIG_QDMC_AT_DECODER 0 +#define CONFIG_QDM2_AT_DECODER 0 +#define CONFIG_LIBAOM_AV1_DECODER 0 #define CONFIG_LIBCELT_DECODER 0 -#define CONFIG_LIBDCADEC_DECODER 0 +#define CONFIG_LIBCODEC2_DECODER 0 +#define CONFIG_LIBDAV1D_DECODER 0 +#define CONFIG_LIBDAVS2_DECODER 0 #define CONFIG_LIBFDK_AAC_DECODER 0 #define CONFIG_LIBGSM_DECODER 0 #define CONFIG_LIBGSM_MS_DECODER 0 @@ -1023,10 +1190,8 @@ #define CONFIG_LIBOPENCORE_AMRWB_DECODER 0 #define CONFIG_LIBOPENJPEG_DECODER 0 #define CONFIG_LIBOPUS_DECODER 0 -#define CONFIG_LIBSCHROEDINGER_DECODER 0 +#define CONFIG_LIBRSVG_DECODER 0 #define CONFIG_LIBSPEEX_DECODER 0 -#define CONFIG_LIBSTAGEFRIGHT_H264_DECODER 0 -#define CONFIG_LIBUTVIDEO_DECODER 0 #define CONFIG_LIBVORBIS_DECODER 0 #define CONFIG_LIBVPX_VP8_DECODER 0 #define CONFIG_LIBVPX_VP9_DECODER 0 @@ -1034,250 +1199,21 @@ #define CONFIG_BINTEXT_DECODER 1 #define CONFIG_XBIN_DECODER 1 #define CONFIG_IDF_DECODER 1 -#define CONFIG_AAC_DEMUXER 1 -#define CONFIG_AC3_DEMUXER 1 -#define CONFIG_ACT_DEMUXER 1 -#define CONFIG_ADF_DEMUXER 1 -#define CONFIG_ADP_DEMUXER 1 -#define CONFIG_ADX_DEMUXER 1 -#define CONFIG_AEA_DEMUXER 1 -#define CONFIG_AFC_DEMUXER 1 -#define CONFIG_AIFF_DEMUXER 1 -#define CONFIG_AMR_DEMUXER 1 -#define CONFIG_ANM_DEMUXER 1 -#define CONFIG_APC_DEMUXER 1 -#define CONFIG_APE_DEMUXER 1 -#define CONFIG_APNG_DEMUXER 1 -#define CONFIG_AQTITLE_DEMUXER 1 -#define CONFIG_ASF_DEMUXER 1 -#define CONFIG_ASF_O_DEMUXER 1 -#define CONFIG_ASS_DEMUXER 1 -#define CONFIG_AST_DEMUXER 1 -#define CONFIG_AU_DEMUXER 1 -#define CONFIG_AVI_DEMUXER 1 -#define CONFIG_AVISYNTH_DEMUXER 0 -#define CONFIG_AVR_DEMUXER 1 -#define CONFIG_AVS_DEMUXER 1 -#define CONFIG_BETHSOFTVID_DEMUXER 1 -#define CONFIG_BFI_DEMUXER 1 -#define CONFIG_BINTEXT_DEMUXER 1 -#define CONFIG_BINK_DEMUXER 1 -#define CONFIG_BIT_DEMUXER 1 -#define CONFIG_BMV_DEMUXER 1 -#define CONFIG_BFSTM_DEMUXER 1 -#define CONFIG_BRSTM_DEMUXER 1 -#define CONFIG_BOA_DEMUXER 1 -#define CONFIG_C93_DEMUXER 1 -#define CONFIG_CAF_DEMUXER 1 -#define CONFIG_CAVSVIDEO_DEMUXER 1 -#define CONFIG_CDG_DEMUXER 1 -#define CONFIG_CDXL_DEMUXER 1 -#define CONFIG_CINE_DEMUXER 1 -#define CONFIG_CONCAT_DEMUXER 1 -#define CONFIG_DATA_DEMUXER 1 -#define CONFIG_DAUD_DEMUXER 1 -#define CONFIG_DFA_DEMUXER 1 -#define CONFIG_DIRAC_DEMUXER 1 -#define CONFIG_DNXHD_DEMUXER 1 -#define CONFIG_DSF_DEMUXER 1 -#define CONFIG_DSICIN_DEMUXER 1 -#define CONFIG_DSS_DEMUXER 1 -#define CONFIG_DTS_DEMUXER 1 -#define CONFIG_DTSHD_DEMUXER 1 -#define CONFIG_DV_DEMUXER 1 -#define CONFIG_DVBSUB_DEMUXER 1 -#define CONFIG_DXA_DEMUXER 1 -#define CONFIG_EA_DEMUXER 1 -#define CONFIG_EA_CDATA_DEMUXER 1 -#define CONFIG_EAC3_DEMUXER 1 -#define CONFIG_EPAF_DEMUXER 1 -#define CONFIG_FFM_DEMUXER 1 -#define CONFIG_FFMETADATA_DEMUXER 1 -#define CONFIG_FILMSTRIP_DEMUXER 1 -#define CONFIG_FLAC_DEMUXER 1 -#define CONFIG_FLIC_DEMUXER 1 -#define CONFIG_FLV_DEMUXER 1 -#define CONFIG_LIVE_FLV_DEMUXER 1 -#define CONFIG_FOURXM_DEMUXER 1 -#define CONFIG_FRM_DEMUXER 1 -#define CONFIG_G722_DEMUXER 1 -#define CONFIG_G723_1_DEMUXER 1 -#define CONFIG_G729_DEMUXER 1 -#define CONFIG_GIF_DEMUXER 1 -#define CONFIG_GSM_DEMUXER 1 -#define CONFIG_GXF_DEMUXER 1 -#define CONFIG_H261_DEMUXER 1 -#define CONFIG_H263_DEMUXER 1 -#define CONFIG_H264_DEMUXER 1 -#define CONFIG_HEVC_DEMUXER 1 -#define CONFIG_HLS_DEMUXER 1 -#define CONFIG_HNM_DEMUXER 1 -#define CONFIG_ICO_DEMUXER 1 -#define CONFIG_IDCIN_DEMUXER 1 -#define CONFIG_IDF_DEMUXER 1 -#define CONFIG_IFF_DEMUXER 1 -#define CONFIG_ILBC_DEMUXER 1 -#define CONFIG_IMAGE2_DEMUXER 1 -#define CONFIG_IMAGE2PIPE_DEMUXER 1 -#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 1 -#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 1 -#define CONFIG_INGENIENT_DEMUXER 1 -#define CONFIG_IPMOVIE_DEMUXER 1 -#define CONFIG_IRCAM_DEMUXER 1 -#define CONFIG_ISS_DEMUXER 1 -#define CONFIG_IV8_DEMUXER 1 -#define CONFIG_IVF_DEMUXER 1 -#define CONFIG_JACOSUB_DEMUXER 1 -#define CONFIG_JV_DEMUXER 1 -#define CONFIG_LATM_DEMUXER 1 -#define CONFIG_LMLM4_DEMUXER 1 -#define CONFIG_LOAS_DEMUXER 1 -#define CONFIG_LRC_DEMUXER 1 -#define CONFIG_LVF_DEMUXER 1 -#define CONFIG_LXF_DEMUXER 1 -#define CONFIG_M4V_DEMUXER 1 -#define CONFIG_MATROSKA_DEMUXER 1 -#define CONFIG_MGSTS_DEMUXER 1 -#define CONFIG_MICRODVD_DEMUXER 1 -#define CONFIG_MJPEG_DEMUXER 1 -#define CONFIG_MLP_DEMUXER 1 -#define CONFIG_MLV_DEMUXER 1 -#define CONFIG_MM_DEMUXER 1 -#define CONFIG_MMF_DEMUXER 1 -#define CONFIG_MOV_DEMUXER 1 -#define CONFIG_MP3_DEMUXER 1 -#define CONFIG_MPC_DEMUXER 1 -#define CONFIG_MPC8_DEMUXER 1 -#define CONFIG_MPEGPS_DEMUXER 1 -#define CONFIG_MPEGTS_DEMUXER 1 -#define CONFIG_MPEGTSRAW_DEMUXER 1 -#define CONFIG_MPEGVIDEO_DEMUXER 1 -#define CONFIG_MPJPEG_DEMUXER 1 -#define CONFIG_MPL2_DEMUXER 1 -#define CONFIG_MPSUB_DEMUXER 1 -#define CONFIG_MSNWC_TCP_DEMUXER 1 -#define CONFIG_MTV_DEMUXER 1 -#define CONFIG_MV_DEMUXER 1 -#define CONFIG_MVI_DEMUXER 1 -#define CONFIG_MXF_DEMUXER 1 -#define CONFIG_MXG_DEMUXER 1 -#define CONFIG_NC_DEMUXER 1 -#define CONFIG_NISTSPHERE_DEMUXER 1 -#define CONFIG_NSV_DEMUXER 1 -#define CONFIG_NUT_DEMUXER 1 -#define CONFIG_NUV_DEMUXER 1 -#define CONFIG_OGG_DEMUXER 1 -#define CONFIG_OMA_DEMUXER 1 -#define CONFIG_PAF_DEMUXER 1 -#define CONFIG_PCM_ALAW_DEMUXER 1 -#define CONFIG_PCM_MULAW_DEMUXER 1 -#define CONFIG_PCM_F64BE_DEMUXER 1 -#define CONFIG_PCM_F64LE_DEMUXER 1 -#define CONFIG_PCM_F32BE_DEMUXER 1 -#define CONFIG_PCM_F32LE_DEMUXER 1 -#define CONFIG_PCM_S32BE_DEMUXER 1 -#define CONFIG_PCM_S32LE_DEMUXER 1 -#define CONFIG_PCM_S24BE_DEMUXER 1 -#define CONFIG_PCM_S24LE_DEMUXER 1 -#define CONFIG_PCM_S16BE_DEMUXER 1 -#define CONFIG_PCM_S16LE_DEMUXER 1 -#define CONFIG_PCM_S8_DEMUXER 1 -#define CONFIG_PCM_U32BE_DEMUXER 1 -#define CONFIG_PCM_U32LE_DEMUXER 1 -#define CONFIG_PCM_U24BE_DEMUXER 1 -#define CONFIG_PCM_U24LE_DEMUXER 1 -#define CONFIG_PCM_U16BE_DEMUXER 1 -#define CONFIG_PCM_U16LE_DEMUXER 1 -#define CONFIG_PCM_U8_DEMUXER 1 -#define CONFIG_PJS_DEMUXER 1 -#define CONFIG_PMP_DEMUXER 1 -#define CONFIG_PVA_DEMUXER 1 -#define CONFIG_PVF_DEMUXER 1 -#define CONFIG_QCP_DEMUXER 1 -#define CONFIG_R3D_DEMUXER 1 -#define CONFIG_RAWVIDEO_DEMUXER 1 -#define CONFIG_REALTEXT_DEMUXER 1 -#define CONFIG_REDSPARK_DEMUXER 1 -#define CONFIG_RL2_DEMUXER 1 -#define CONFIG_RM_DEMUXER 1 -#define CONFIG_ROQ_DEMUXER 1 -#define CONFIG_RPL_DEMUXER 1 -#define CONFIG_RSD_DEMUXER 1 -#define CONFIG_RSO_DEMUXER 1 -#define CONFIG_RTP_DEMUXER 0 -#define CONFIG_RTSP_DEMUXER 0 -#define CONFIG_SAMI_DEMUXER 1 -#define CONFIG_SAP_DEMUXER 0 -#define CONFIG_SBG_DEMUXER 1 -#define CONFIG_SDP_DEMUXER 0 -#define CONFIG_SDR2_DEMUXER 1 -#define CONFIG_SEGAFILM_DEMUXER 1 -#define CONFIG_SHORTEN_DEMUXER 1 -#define CONFIG_SIFF_DEMUXER 1 -#define CONFIG_SLN_DEMUXER 1 -#define CONFIG_SMACKER_DEMUXER 1 -#define CONFIG_SMJPEG_DEMUXER 1 -#define CONFIG_SMUSH_DEMUXER 1 -#define CONFIG_SOL_DEMUXER 1 -#define CONFIG_SOX_DEMUXER 1 -#define CONFIG_SPDIF_DEMUXER 1 -#define CONFIG_SRT_DEMUXER 1 -#define CONFIG_STR_DEMUXER 1 -#define CONFIG_STL_DEMUXER 1 -#define CONFIG_SUBVIEWER1_DEMUXER 1 -#define CONFIG_SUBVIEWER_DEMUXER 1 -#define CONFIG_SUP_DEMUXER 1 -#define CONFIG_SWF_DEMUXER 1 -#define CONFIG_TAK_DEMUXER 1 -#define CONFIG_TEDCAPTIONS_DEMUXER 1 -#define CONFIG_THP_DEMUXER 1 -#define CONFIG_TIERTEXSEQ_DEMUXER 1 -#define CONFIG_TMV_DEMUXER 1 -#define CONFIG_TRUEHD_DEMUXER 1 -#define CONFIG_TTA_DEMUXER 1 -#define CONFIG_TXD_DEMUXER 1 -#define CONFIG_TTY_DEMUXER 1 -#define CONFIG_VC1_DEMUXER 1 -#define CONFIG_VC1T_DEMUXER 1 -#define CONFIG_VIVO_DEMUXER 1 -#define CONFIG_VMD_DEMUXER 1 -#define CONFIG_VOBSUB_DEMUXER 1 -#define CONFIG_VOC_DEMUXER 1 -#define CONFIG_VPLAYER_DEMUXER 1 -#define CONFIG_VQF_DEMUXER 1 -#define CONFIG_W64_DEMUXER 1 -#define CONFIG_WAV_DEMUXER 1 -#define CONFIG_WC3_DEMUXER 1 -#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 1 -#define CONFIG_WEBVTT_DEMUXER 1 -#define CONFIG_WSAUD_DEMUXER 1 -#define CONFIG_WSVQA_DEMUXER 1 -#define CONFIG_WTV_DEMUXER 1 -#define CONFIG_WV_DEMUXER 1 -#define CONFIG_XA_DEMUXER 1 -#define CONFIG_XBIN_DEMUXER 1 -#define CONFIG_XMV_DEMUXER 1 -#define CONFIG_XWMA_DEMUXER 1 -#define CONFIG_YOP_DEMUXER 1 -#define CONFIG_YUV4MPEGPIPE_DEMUXER 1 -#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 1 -#define CONFIG_LIBGME_DEMUXER 0 -#define CONFIG_LIBMODPLUG_DEMUXER 0 -#define CONFIG_LIBNUT_DEMUXER 0 -#define CONFIG_LIBQUVI_DEMUXER 0 +#define CONFIG_LIBOPENH264_DECODER 0 +#define CONFIG_H264_CUVID_DECODER 0 +#define CONFIG_HEVC_CUVID_DECODER 0 +#define CONFIG_HEVC_MEDIACODEC_DECODER 0 +#define CONFIG_MJPEG_CUVID_DECODER 0 +#define CONFIG_MPEG1_CUVID_DECODER 0 +#define CONFIG_MPEG2_CUVID_DECODER 0 +#define CONFIG_MPEG4_CUVID_DECODER 0 +#define CONFIG_MPEG4_MEDIACODEC_DECODER 0 +#define CONFIG_VC1_CUVID_DECODER 0 +#define CONFIG_VP8_CUVID_DECODER 0 +#define CONFIG_VP8_MEDIACODEC_DECODER 0 +#define CONFIG_VP8_QSV_DECODER 0 +#define CONFIG_VP9_CUVID_DECODER 0 +#define CONFIG_VP9_MEDIACODEC_DECODER 0 #define CONFIG_A64MULTI_ENCODER 0 #define CONFIG_A64MULTI5_ENCODER 0 #define CONFIG_ALIAS_PIX_ENCODER 0 @@ -1297,6 +1233,7 @@ #define CONFIG_DVVIDEO_ENCODER 0 #define CONFIG_FFV1_ENCODER 0 #define CONFIG_FFVHUFF_ENCODER 0 +#define CONFIG_FITS_ENCODER 0 #define CONFIG_FLASHSV_ENCODER 0 #define CONFIG_FLASHSV2_ENCODER 0 #define CONFIG_FLV_ENCODER 0 @@ -1309,6 +1246,7 @@ #define CONFIG_JPEG2000_ENCODER 0 #define CONFIG_JPEGLS_ENCODER 0 #define CONFIG_LJPEG_ENCODER 0 +#define CONFIG_MAGICYUV_ENCODER 0 #define CONFIG_MJPEG_ENCODER 0 #define CONFIG_MPEG1VIDEO_ENCODER 0 #define CONFIG_MPEG2VIDEO_ENCODER 0 @@ -1345,6 +1283,8 @@ #define CONFIG_V308_ENCODER 0 #define CONFIG_V408_ENCODER 0 #define CONFIG_V410_ENCODER 0 +#define CONFIG_VC2_ENCODER 0 +#define CONFIG_WRAPPED_AVFRAME_ENCODER 0 #define CONFIG_WMV1_ENCODER 0 #define CONFIG_WMV2_ENCODER 0 #define CONFIG_XBM_ENCODER 0 @@ -1358,16 +1298,22 @@ #define CONFIG_AC3_ENCODER 0 #define CONFIG_AC3_FIXED_ENCODER 0 #define CONFIG_ALAC_ENCODER 0 +#define CONFIG_APTX_ENCODER 0 +#define CONFIG_APTX_HD_ENCODER 0 #define CONFIG_DCA_ENCODER 0 #define CONFIG_EAC3_ENCODER 0 #define CONFIG_FLAC_ENCODER 0 #define CONFIG_G723_1_ENCODER 0 +#define CONFIG_MLP_ENCODER 0 #define CONFIG_MP2_ENCODER 0 #define CONFIG_MP2FIXED_ENCODER 0 #define CONFIG_NELLYMOSER_ENCODER 0 +#define CONFIG_OPUS_ENCODER 0 #define CONFIG_RA_144_ENCODER 0 +#define CONFIG_SBC_ENCODER 0 #define CONFIG_SONIC_ENCODER 0 #define CONFIG_SONIC_LS_ENCODER 0 +#define CONFIG_TRUEHD_ENCODER 0 #define CONFIG_TTA_ENCODER 0 #define CONFIG_VORBIS_ENCODER 0 #define CONFIG_WAVPACK_ENCODER 0 @@ -1392,6 +1338,8 @@ #define CONFIG_PCM_S32BE_ENCODER 0 #define CONFIG_PCM_S32LE_ENCODER 0 #define CONFIG_PCM_S32LE_PLANAR_ENCODER 0 +#define CONFIG_PCM_S64BE_ENCODER 0 +#define CONFIG_PCM_S64LE_ENCODER 0 #define CONFIG_PCM_U8_ENCODER 0 #define CONFIG_PCM_U16BE_ENCODER 0 #define CONFIG_PCM_U16LE_ENCODER 0 @@ -1399,10 +1347,12 @@ #define CONFIG_PCM_U24LE_ENCODER 0 #define CONFIG_PCM_U32BE_ENCODER 0 #define CONFIG_PCM_U32LE_ENCODER 0 +#define CONFIG_PCM_VIDC_ENCODER 0 #define CONFIG_ROQ_DPCM_ENCODER 0 #define CONFIG_ADPCM_ADX_ENCODER 0 #define CONFIG_ADPCM_G722_ENCODER 0 #define CONFIG_ADPCM_G726_ENCODER 0 +#define CONFIG_ADPCM_G726LE_ENCODER 0 #define CONFIG_ADPCM_IMA_QT_ENCODER 0 #define CONFIG_ADPCM_IMA_WAV_ENCODER 0 #define CONFIG_ADPCM_MS_ENCODER 0 @@ -1415,9 +1365,16 @@ #define CONFIG_MOVTEXT_ENCODER 0 #define CONFIG_SRT_ENCODER 0 #define CONFIG_SUBRIP_ENCODER 0 +#define CONFIG_TEXT_ENCODER 0 #define CONFIG_WEBVTT_ENCODER 0 #define CONFIG_XSUB_ENCODER 0 -#define CONFIG_LIBFAAC_ENCODER 0 +#define CONFIG_AAC_AT_ENCODER 0 +#define CONFIG_ALAC_AT_ENCODER 0 +#define CONFIG_ILBC_AT_ENCODER 0 +#define CONFIG_PCM_ALAW_AT_ENCODER 0 +#define CONFIG_PCM_MULAW_AT_ENCODER 0 +#define CONFIG_LIBAOM_AV1_ENCODER 0 +#define CONFIG_LIBCODEC2_ENCODER 0 #define CONFIG_LIBFDK_AAC_ENCODER 0 #define CONFIG_LIBGSM_ENCODER 0 #define CONFIG_LIBGSM_MS_ENCODER 0 @@ -1426,13 +1383,10 @@ #define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0 #define CONFIG_LIBOPENJPEG_ENCODER 0 #define CONFIG_LIBOPUS_ENCODER 0 -#define CONFIG_LIBSCHROEDINGER_ENCODER 0 #define CONFIG_LIBSHINE_ENCODER 0 #define CONFIG_LIBSPEEX_ENCODER 0 #define CONFIG_LIBTHEORA_ENCODER 0 #define CONFIG_LIBTWOLAME_ENCODER 0 -#define CONFIG_LIBUTVIDEO_ENCODER 0 -#define CONFIG_LIBVO_AACENC_ENCODER 0 #define CONFIG_LIBVO_AMRWBENC_ENCODER 0 #define CONFIG_LIBVORBIS_ENCODER 0 #define CONFIG_LIBVPX_VP8_ENCODER 0 @@ -1445,30 +1399,203 @@ #define CONFIG_LIBX264RGB_ENCODER 0 #define CONFIG_LIBX265_ENCODER 0 #define CONFIG_LIBXAVS_ENCODER 0 +#define CONFIG_LIBXAVS2_ENCODER 0 #define CONFIG_LIBXVID_ENCODER 0 -#define CONFIG_LIBAACPLUS_ENCODER 0 +#define CONFIG_H263_V4L2M2M_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 +#define CONFIG_H264_AMF_ENCODER 0 +#define CONFIG_H264_NVENC_ENCODER 0 +#define CONFIG_H264_OMX_ENCODER 0 #define CONFIG_H264_QSV_ENCODER 0 +#define CONFIG_H264_V4L2M2M_ENCODER 0 +#define CONFIG_H264_VAAPI_ENCODER 0 +#define CONFIG_H264_VIDEOTOOLBOX_ENCODER 0 #define CONFIG_NVENC_ENCODER 0 #define CONFIG_NVENC_H264_ENCODER 0 #define CONFIG_NVENC_HEVC_ENCODER 0 +#define CONFIG_HEVC_AMF_ENCODER 0 +#define CONFIG_HEVC_NVENC_ENCODER 0 #define CONFIG_HEVC_QSV_ENCODER 0 +#define CONFIG_HEVC_V4L2M2M_ENCODER 0 +#define CONFIG_HEVC_VAAPI_ENCODER 0 +#define CONFIG_HEVC_VIDEOTOOLBOX_ENCODER 0 #define CONFIG_LIBKVAZAAR_ENCODER 0 +#define CONFIG_MJPEG_QSV_ENCODER 0 +#define CONFIG_MJPEG_VAAPI_ENCODER 0 #define CONFIG_MPEG2_QSV_ENCODER 0 +#define CONFIG_MPEG2_VAAPI_ENCODER 0 +#define CONFIG_MPEG4_V4L2M2M_ENCODER 0 +#define CONFIG_VP8_V4L2M2M_ENCODER 0 +#define CONFIG_VP8_VAAPI_ENCODER 0 +#define CONFIG_VP9_VAAPI_ENCODER 0 +#define CONFIG_H263_VAAPI_HWACCEL 0 +#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0 +#define CONFIG_H264_D3D11VA_HWACCEL 0 +#define CONFIG_H264_D3D11VA2_HWACCEL 0 +#define CONFIG_H264_DXVA2_HWACCEL 0 +#define CONFIG_H264_NVDEC_HWACCEL 0 +#define CONFIG_H264_VAAPI_HWACCEL 0 +#define CONFIG_H264_VDPAU_HWACCEL 0 +#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0 +#define CONFIG_HEVC_D3D11VA_HWACCEL 0 +#define CONFIG_HEVC_D3D11VA2_HWACCEL 0 +#define CONFIG_HEVC_DXVA2_HWACCEL 0 +#define CONFIG_HEVC_NVDEC_HWACCEL 0 +#define CONFIG_HEVC_VAAPI_HWACCEL 0 +#define CONFIG_HEVC_VDPAU_HWACCEL 0 +#define CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL 0 +#define CONFIG_MJPEG_NVDEC_HWACCEL 0 +#define CONFIG_MJPEG_VAAPI_HWACCEL 0 +#define CONFIG_MPEG1_NVDEC_HWACCEL 0 +#define CONFIG_MPEG1_VDPAU_HWACCEL 0 +#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 +#define CONFIG_MPEG1_XVMC_HWACCEL 0 +#define CONFIG_MPEG2_D3D11VA_HWACCEL 0 +#define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 +#define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_VAAPI_HWACCEL 0 +#define CONFIG_MPEG2_VDPAU_HWACCEL 0 +#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 +#define CONFIG_MPEG2_XVMC_HWACCEL 0 +#define CONFIG_MPEG4_NVDEC_HWACCEL 0 +#define CONFIG_MPEG4_VAAPI_HWACCEL 0 +#define CONFIG_MPEG4_VDPAU_HWACCEL 0 +#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0 +#define CONFIG_VC1_D3D11VA_HWACCEL 0 +#define CONFIG_VC1_D3D11VA2_HWACCEL 0 +#define CONFIG_VC1_DXVA2_HWACCEL 0 +#define CONFIG_VC1_NVDEC_HWACCEL 0 +#define CONFIG_VC1_VAAPI_HWACCEL 0 +#define CONFIG_VC1_VDPAU_HWACCEL 0 +#define CONFIG_VP8_NVDEC_HWACCEL 0 +#define CONFIG_VP8_VAAPI_HWACCEL 0 +#define CONFIG_VP9_D3D11VA_HWACCEL 0 +#define CONFIG_VP9_D3D11VA2_HWACCEL 0 +#define CONFIG_VP9_DXVA2_HWACCEL 0 +#define CONFIG_VP9_NVDEC_HWACCEL 0 +#define CONFIG_VP9_VAAPI_HWACCEL 0 +#define CONFIG_WMV3_D3D11VA_HWACCEL 0 +#define CONFIG_WMV3_D3D11VA2_HWACCEL 0 +#define CONFIG_WMV3_DXVA2_HWACCEL 0 +#define CONFIG_WMV3_NVDEC_HWACCEL 0 +#define CONFIG_WMV3_VAAPI_HWACCEL 0 +#define CONFIG_WMV3_VDPAU_HWACCEL 0 +#define CONFIG_AAC_PARSER 1 +#define CONFIG_AAC_LATM_PARSER 1 +#define CONFIG_AC3_PARSER 1 +#define CONFIG_ADX_PARSER 1 +#define CONFIG_AV1_PARSER 1 +#define CONFIG_AVS2_PARSER 1 +#define CONFIG_BMP_PARSER 1 +#define CONFIG_CAVSVIDEO_PARSER 1 +#define CONFIG_COOK_PARSER 1 +#define CONFIG_DCA_PARSER 1 +#define CONFIG_DIRAC_PARSER 1 +#define CONFIG_DNXHD_PARSER 1 +#define CONFIG_DPX_PARSER 1 +#define CONFIG_DVAUDIO_PARSER 1 +#define CONFIG_DVBSUB_PARSER 1 +#define CONFIG_DVDSUB_PARSER 1 +#define CONFIG_DVD_NAV_PARSER 1 +#define CONFIG_FLAC_PARSER 1 +#define CONFIG_G729_PARSER 1 +#define CONFIG_GSM_PARSER 1 +#define CONFIG_H261_PARSER 1 +#define CONFIG_H263_PARSER 1 +#define CONFIG_H264_PARSER 1 +#define CONFIG_HEVC_PARSER 1 +#define CONFIG_MJPEG_PARSER 1 +#define CONFIG_MLP_PARSER 1 +#define CONFIG_MPEG4VIDEO_PARSER 1 +#define CONFIG_MPEGAUDIO_PARSER 1 +#define CONFIG_MPEGVIDEO_PARSER 1 +#define CONFIG_OPUS_PARSER 1 +#define CONFIG_PNG_PARSER 1 +#define CONFIG_PNM_PARSER 1 +#define CONFIG_RV30_PARSER 1 +#define CONFIG_RV40_PARSER 1 +#define CONFIG_SBC_PARSER 1 +#define CONFIG_SIPR_PARSER 1 +#define CONFIG_TAK_PARSER 1 +#define CONFIG_VC1_PARSER 1 +#define CONFIG_VORBIS_PARSER 1 +#define CONFIG_VP3_PARSER 1 +#define CONFIG_VP8_PARSER 1 +#define CONFIG_VP9_PARSER 1 +#define CONFIG_XMA_PARSER 1 +#define CONFIG_ALSA_INDEV 0 +#define CONFIG_ANDROID_CAMERA_INDEV 0 +#define CONFIG_AVFOUNDATION_INDEV 0 +#define CONFIG_BKTR_INDEV 0 +#define CONFIG_DECKLINK_INDEV 0 +#define CONFIG_LIBNDI_NEWTEK_INDEV 0 +#define CONFIG_DSHOW_INDEV 0 +#define CONFIG_FBDEV_INDEV 0 +#define CONFIG_GDIGRAB_INDEV 0 +#define CONFIG_IEC61883_INDEV 0 +#define CONFIG_JACK_INDEV 0 +#define CONFIG_KMSGRAB_INDEV 0 +#define CONFIG_LAVFI_INDEV 0 +#define CONFIG_OPENAL_INDEV 0 +#define CONFIG_OSS_INDEV 0 +#define CONFIG_PULSE_INDEV 0 +#define CONFIG_SNDIO_INDEV 0 +#define CONFIG_V4L2_INDEV 0 +#define CONFIG_VFWCAP_INDEV 0 +#define CONFIG_XCBGRAB_INDEV 0 +#define CONFIG_LIBCDIO_INDEV 0 +#define CONFIG_LIBDC1394_INDEV 0 +#define CONFIG_ALSA_OUTDEV 0 +#define CONFIG_CACA_OUTDEV 0 +#define CONFIG_DECKLINK_OUTDEV 0 +#define CONFIG_LIBNDI_NEWTEK_OUTDEV 0 +#define CONFIG_FBDEV_OUTDEV 0 +#define CONFIG_OPENGL_OUTDEV 0 +#define CONFIG_OSS_OUTDEV 0 +#define CONFIG_PULSE_OUTDEV 0 +#define CONFIG_SDL2_OUTDEV 0 +#define CONFIG_SNDIO_OUTDEV 0 +#define CONFIG_V4L2_OUTDEV 0 +#define CONFIG_XV_OUTDEV 0 +#define CONFIG_ABENCH_FILTER 0 +#define CONFIG_ACOMPRESSOR_FILTER 0 +#define CONFIG_ACONTRAST_FILTER 0 +#define CONFIG_ACOPY_FILTER 0 +#define CONFIG_ACUE_FILTER 0 #define CONFIG_ACROSSFADE_FILTER 0 +#define CONFIG_ACROSSOVER_FILTER 0 +#define CONFIG_ACRUSHER_FILTER 0 +#define CONFIG_ADECLICK_FILTER 0 +#define CONFIG_ADECLIP_FILTER 0 #define CONFIG_ADELAY_FILTER 0 +#define CONFIG_ADERIVATIVE_FILTER 0 #define CONFIG_AECHO_FILTER 0 +#define CONFIG_AEMPHASIS_FILTER 0 #define CONFIG_AEVAL_FILTER 0 #define CONFIG_AFADE_FILTER 0 +#define CONFIG_AFFTDN_FILTER 0 +#define CONFIG_AFFTFILT_FILTER 0 +#define CONFIG_AFIR_FILTER 0 #define CONFIG_AFORMAT_FILTER 0 +#define CONFIG_AGATE_FILTER 0 +#define CONFIG_AIIR_FILTER 0 +#define CONFIG_AINTEGRAL_FILTER 0 #define CONFIG_AINTERLEAVE_FILTER 0 +#define CONFIG_ALIMITER_FILTER 0 #define CONFIG_ALLPASS_FILTER 0 +#define CONFIG_ALOOP_FILTER 0 #define CONFIG_AMERGE_FILTER 0 +#define CONFIG_AMETADATA_FILTER 0 #define CONFIG_AMIX_FILTER 0 +#define CONFIG_AMULTIPLY_FILTER 0 +#define CONFIG_ANEQUALIZER_FILTER 0 #define CONFIG_ANULL_FILTER 0 #define CONFIG_APAD_FILTER 0 #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 +#define CONFIG_APULSATOR_FILTER 0 +#define CONFIG_AREALTIME_FILTER 0 #define CONFIG_ARESAMPLE_FILTER 0 #define CONFIG_AREVERSE_FILTER 0 #define CONFIG_ASELECT_FILTER 0 @@ -1478,10 +1605,10 @@ #define CONFIG_ASETRATE_FILTER 0 #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 +#define CONFIG_ASIDEDATA_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 #define CONFIG_ASTATS_FILTER 0 -#define CONFIG_ASTREAMSYNC_FILTER 0 -#define CONFIG_ASYNCTS_FILTER 0 +#define CONFIG_ASTREAMSELECT_FILTER 0 #define CONFIG_ATEMPO_FILTER 0 #define CONFIG_ATRIM_FILTER 0 #define CONFIG_AZMQ_FILTER 0 @@ -1494,88 +1621,162 @@ #define CONFIG_CHANNELSPLIT_FILTER 0 #define CONFIG_CHORUS_FILTER 0 #define CONFIG_COMPAND_FILTER 0 +#define CONFIG_COMPENSATIONDELAY_FILTER 0 +#define CONFIG_CROSSFEED_FILTER 0 +#define CONFIG_CRYSTALIZER_FILTER 0 #define CONFIG_DCSHIFT_FILTER 0 +#define CONFIG_DRMETER_FILTER 0 #define CONFIG_DYNAUDNORM_FILTER 0 #define CONFIG_EARWAX_FILTER 0 #define CONFIG_EBUR128_FILTER 0 #define CONFIG_EQUALIZER_FILTER 0 +#define CONFIG_EXTRASTEREO_FILTER 0 +#define CONFIG_FIREQUALIZER_FILTER 0 #define CONFIG_FLANGER_FILTER 0 +#define CONFIG_HAAS_FILTER 0 +#define CONFIG_HDCD_FILTER 0 +#define CONFIG_HEADPHONE_FILTER 0 #define CONFIG_HIGHPASS_FILTER 0 +#define CONFIG_HIGHSHELF_FILTER 0 #define CONFIG_JOIN_FILTER 0 #define CONFIG_LADSPA_FILTER 0 +#define CONFIG_LOUDNORM_FILTER 0 #define CONFIG_LOWPASS_FILTER 0 +#define CONFIG_LOWSHELF_FILTER 0 +#define CONFIG_LV2_FILTER 0 +#define CONFIG_MCOMPAND_FILTER 0 #define CONFIG_PAN_FILTER 0 #define CONFIG_REPLAYGAIN_FILTER 0 #define CONFIG_RESAMPLE_FILTER 0 +#define CONFIG_RUBBERBAND_FILTER 0 #define CONFIG_SIDECHAINCOMPRESS_FILTER 0 +#define CONFIG_SIDECHAINGATE_FILTER 0 #define CONFIG_SILENCEDETECT_FILTER 0 #define CONFIG_SILENCEREMOVE_FILTER 0 +#define CONFIG_SOFALIZER_FILTER 0 +#define CONFIG_STEREOTOOLS_FILTER 0 +#define CONFIG_STEREOWIDEN_FILTER 0 +#define CONFIG_SUPEREQUALIZER_FILTER 0 +#define CONFIG_SURROUND_FILTER 0 #define CONFIG_TREBLE_FILTER 0 +#define CONFIG_TREMOLO_FILTER 0 +#define CONFIG_VIBRATO_FILTER 0 #define CONFIG_VOLUME_FILTER 0 #define CONFIG_VOLUMEDETECT_FILTER 0 #define CONFIG_AEVALSRC_FILTER 0 +#define CONFIG_ANOISESRC_FILTER 0 #define CONFIG_ANULLSRC_FILTER 0 #define CONFIG_FLITE_FILTER 0 +#define CONFIG_HILBERT_FILTER 0 +#define CONFIG_SINC_FILTER 0 #define CONFIG_SINE_FILTER 0 #define CONFIG_ANULLSINK_FILTER 0 #define CONFIG_ALPHAEXTRACT_FILTER 0 #define CONFIG_ALPHAMERGE_FILTER 0 +#define CONFIG_AMPLIFY_FILTER 0 #define CONFIG_ASS_FILTER 0 +#define CONFIG_ATADENOISE_FILTER 0 +#define CONFIG_AVGBLUR_FILTER 0 +#define CONFIG_AVGBLUR_OPENCL_FILTER 0 #define CONFIG_BBOX_FILTER 0 +#define CONFIG_BENCH_FILTER 0 +#define CONFIG_BITPLANENOISE_FILTER 0 #define CONFIG_BLACKDETECT_FILTER 0 #define CONFIG_BLACKFRAME_FILTER 0 #define CONFIG_BLEND_FILTER 0 +#define CONFIG_BM3D_FILTER 0 #define CONFIG_BOXBLUR_FILTER 0 +#define CONFIG_BOXBLUR_OPENCL_FILTER 0 +#define CONFIG_BWDIF_FILTER 0 +#define CONFIG_CHROMAHOLD_FILTER 0 +#define CONFIG_CHROMAKEY_FILTER 0 +#define CONFIG_CHROMASHIFT_FILTER 0 +#define CONFIG_CIESCOPE_FILTER 0 #define CONFIG_CODECVIEW_FILTER 0 #define CONFIG_COLORBALANCE_FILTER 0 #define CONFIG_COLORCHANNELMIXER_FILTER 0 #define CONFIG_COLORKEY_FILTER 0 #define CONFIG_COLORLEVELS_FILTER 0 #define CONFIG_COLORMATRIX_FILTER 0 +#define CONFIG_COLORSPACE_FILTER 0 +#define CONFIG_CONVOLUTION_FILTER 0 +#define CONFIG_CONVOLUTION_OPENCL_FILTER 0 +#define CONFIG_CONVOLVE_FILTER 0 #define CONFIG_COPY_FILTER 0 +#define CONFIG_COREIMAGE_FILTER 0 #define CONFIG_COVER_RECT_FILTER 0 #define CONFIG_CROP_FILTER 0 #define CONFIG_CROPDETECT_FILTER 0 +#define CONFIG_CUE_FILTER 0 #define CONFIG_CURVES_FILTER 0 +#define CONFIG_DATASCOPE_FILTER 0 #define CONFIG_DCTDNOIZ_FILTER 0 #define CONFIG_DEBAND_FILTER 0 +#define CONFIG_DEBLOCK_FILTER 0 #define CONFIG_DECIMATE_FILTER 0 +#define CONFIG_DECONVOLVE_FILTER 0 +#define CONFIG_DEDOT_FILTER 0 #define CONFIG_DEFLATE_FILTER 0 +#define CONFIG_DEFLICKER_FILTER 0 +#define CONFIG_DEINTERLACE_QSV_FILTER 0 +#define CONFIG_DEINTERLACE_VAAPI_FILTER 0 #define CONFIG_DEJUDDER_FILTER 0 #define CONFIG_DELOGO_FILTER 0 +#define CONFIG_DENOISE_VAAPI_FILTER 0 #define CONFIG_DESHAKE_FILTER 0 +#define CONFIG_DESPILL_FILTER 0 #define CONFIG_DETELECINE_FILTER 0 #define CONFIG_DILATION_FILTER 0 +#define CONFIG_DILATION_OPENCL_FILTER 0 +#define CONFIG_DISPLACE_FILTER 0 +#define CONFIG_DOUBLEWEAVE_FILTER 0 #define CONFIG_DRAWBOX_FILTER 0 #define CONFIG_DRAWGRAPH_FILTER 0 #define CONFIG_DRAWGRID_FILTER 0 #define CONFIG_DRAWTEXT_FILTER 0 #define CONFIG_EDGEDETECT_FILTER 0 #define CONFIG_ELBG_FILTER 0 +#define CONFIG_ENTROPY_FILTER 0 #define CONFIG_EQ_FILTER 0 #define CONFIG_EROSION_FILTER 0 +#define CONFIG_EROSION_OPENCL_FILTER 0 #define CONFIG_EXTRACTPLANES_FILTER 0 #define CONFIG_FADE_FILTER 0 +#define CONFIG_FFTDNOIZ_FILTER 0 #define CONFIG_FFTFILT_FILTER 0 #define CONFIG_FIELD_FILTER 0 +#define CONFIG_FIELDHINT_FILTER 0 #define CONFIG_FIELDMATCH_FILTER 0 #define CONFIG_FIELDORDER_FILTER 0 +#define CONFIG_FILLBORDERS_FILTER 0 #define CONFIG_FIND_RECT_FILTER 0 +#define CONFIG_FLOODFILL_FILTER 0 #define CONFIG_FORMAT_FILTER 0 #define CONFIG_FPS_FILTER 0 #define CONFIG_FRAMEPACK_FILTER 0 +#define CONFIG_FRAMERATE_FILTER 0 #define CONFIG_FRAMESTEP_FILTER 0 +#define CONFIG_FREEZEDETECT_FILTER 0 #define CONFIG_FREI0R_FILTER 0 #define CONFIG_FSPP_FILTER 0 +#define CONFIG_GBLUR_FILTER 0 #define CONFIG_GEQ_FILTER 0 #define CONFIG_GRADFUN_FILTER 0 +#define CONFIG_GRAPHMONITOR_FILTER 0 +#define CONFIG_GREYEDGE_FILTER 0 #define CONFIG_HALDCLUT_FILTER 0 #define CONFIG_HFLIP_FILTER 0 #define CONFIG_HISTEQ_FILTER 0 #define CONFIG_HISTOGRAM_FILTER 0 #define CONFIG_HQDN3D_FILTER 0 #define CONFIG_HQX_FILTER 0 +#define CONFIG_HSTACK_FILTER 0 #define CONFIG_HUE_FILTER 0 +#define CONFIG_HWDOWNLOAD_FILTER 0 +#define CONFIG_HWMAP_FILTER 0 +#define CONFIG_HWUPLOAD_FILTER 0 +#define CONFIG_HWUPLOAD_CUDA_FILTER 0 +#define CONFIG_HYSTERESIS_FILTER 0 #define CONFIG_IDET_FILTER 0 #define CONFIG_IL_FILTER 0 #define CONFIG_INFLATE_FILTER 0 @@ -1583,19 +1784,40 @@ #define CONFIG_INTERLEAVE_FILTER 0 #define CONFIG_KERNDEINT_FILTER 0 #define CONFIG_LENSCORRECTION_FILTER 0 -#define CONFIG_LUT3D_FILTER 0 +#define CONFIG_LENSFUN_FILTER 0 +#define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIMITER_FILTER 0 +#define CONFIG_LOOP_FILTER 0 +#define CONFIG_LUMAKEY_FILTER 0 #define CONFIG_LUT_FILTER 0 +#define CONFIG_LUT1D_FILTER 0 +#define CONFIG_LUT2_FILTER 0 +#define CONFIG_LUT3D_FILTER 0 #define CONFIG_LUTRGB_FILTER 0 #define CONFIG_LUTYUV_FILTER 0 +#define CONFIG_MASKEDCLAMP_FILTER 0 +#define CONFIG_MASKEDMERGE_FILTER 0 #define CONFIG_MCDEINT_FILTER 0 #define CONFIG_MERGEPLANES_FILTER 0 +#define CONFIG_MESTIMATE_FILTER 0 +#define CONFIG_METADATA_FILTER 0 +#define CONFIG_MIDEQUALIZER_FILTER 0 +#define CONFIG_MINTERPOLATE_FILTER 0 +#define CONFIG_MIX_FILTER 0 #define CONFIG_MPDECIMATE_FILTER 0 #define CONFIG_NEGATE_FILTER 0 +#define CONFIG_NLMEANS_FILTER 0 +#define CONFIG_NNEDI_FILTER 0 #define CONFIG_NOFORMAT_FILTER 0 #define CONFIG_NOISE_FILTER 0 +#define CONFIG_NORMALIZE_FILTER 0 #define CONFIG_NULL_FILTER 0 +#define CONFIG_OCR_FILTER 0 #define CONFIG_OCV_FILTER 0 +#define CONFIG_OSCILLOSCOPE_FILTER 0 #define CONFIG_OVERLAY_FILTER 0 +#define CONFIG_OVERLAY_OPENCL_FILTER 0 +#define CONFIG_OVERLAY_QSV_FILTER 0 #define CONFIG_OWDENOISE_FILTER 0 #define CONFIG_PAD_FILTER 0 #define CONFIG_PALETTEGEN_FILTER 0 @@ -1604,135 +1826,445 @@ #define CONFIG_PERSPECTIVE_FILTER 0 #define CONFIG_PHASE_FILTER 0 #define CONFIG_PIXDESCTEST_FILTER 0 +#define CONFIG_PIXSCOPE_FILTER 0 #define CONFIG_PP_FILTER 0 #define CONFIG_PP7_FILTER 0 +#define CONFIG_PREMULTIPLY_FILTER 0 +#define CONFIG_PREWITT_FILTER 0 +#define CONFIG_PREWITT_OPENCL_FILTER 0 +#define CONFIG_PROCAMP_VAAPI_FILTER 0 +#define CONFIG_PROGRAM_OPENCL_FILTER 0 +#define CONFIG_PSEUDOCOLOR_FILTER 0 #define CONFIG_PSNR_FILTER 0 #define CONFIG_PULLUP_FILTER 0 #define CONFIG_QP_FILTER 0 #define CONFIG_RANDOM_FILTER 0 +#define CONFIG_READEIA608_FILTER 0 +#define CONFIG_READVITC_FILTER 0 +#define CONFIG_REALTIME_FILTER 0 +#define CONFIG_REMAP_FILTER 0 #define CONFIG_REMOVEGRAIN_FILTER 0 #define CONFIG_REMOVELOGO_FILTER 0 #define CONFIG_REPEATFIELDS_FILTER 0 #define CONFIG_REVERSE_FILTER 0 +#define CONFIG_RGBASHIFT_FILTER 0 +#define CONFIG_ROBERTS_FILTER 0 +#define CONFIG_ROBERTS_OPENCL_FILTER 0 #define CONFIG_ROTATE_FILTER 0 #define CONFIG_SAB_FILTER 0 #define CONFIG_SCALE_FILTER 0 +#define CONFIG_SCALE_CUDA_FILTER 0 +#define CONFIG_SCALE_NPP_FILTER 0 +#define CONFIG_SCALE_QSV_FILTER 0 +#define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SELECT_FILTER 0 +#define CONFIG_SELECTIVECOLOR_FILTER 0 #define CONFIG_SENDCMD_FILTER 0 #define CONFIG_SEPARATEFIELDS_FILTER 0 #define CONFIG_SETDAR_FILTER 0 #define CONFIG_SETFIELD_FILTER 0 +#define CONFIG_SETPARAMS_FILTER 0 #define CONFIG_SETPTS_FILTER 0 +#define CONFIG_SETRANGE_FILTER 0 #define CONFIG_SETSAR_FILTER 0 #define CONFIG_SETTB_FILTER 0 +#define CONFIG_SHARPNESS_VAAPI_FILTER 0 #define CONFIG_SHOWINFO_FILTER 0 #define CONFIG_SHOWPALETTE_FILTER 0 +#define CONFIG_SHUFFLEFRAMES_FILTER 0 #define CONFIG_SHUFFLEPLANES_FILTER 0 +#define CONFIG_SIDEDATA_FILTER 0 #define CONFIG_SIGNALSTATS_FILTER 0 +#define CONFIG_SIGNATURE_FILTER 0 #define CONFIG_SMARTBLUR_FILTER 0 +#define CONFIG_SOBEL_FILTER 0 +#define CONFIG_SOBEL_OPENCL_FILTER 0 #define CONFIG_SPLIT_FILTER 0 #define CONFIG_SPP_FILTER 0 +#define CONFIG_SR_FILTER 0 #define CONFIG_SSIM_FILTER 0 #define CONFIG_STEREO3D_FILTER 0 +#define CONFIG_STREAMSELECT_FILTER 0 #define CONFIG_SUBTITLES_FILTER 0 #define CONFIG_SUPER2XSAI_FILTER 0 +#define CONFIG_SWAPRECT_FILTER 0 #define CONFIG_SWAPUV_FILTER 0 #define CONFIG_TBLEND_FILTER 0 #define CONFIG_TELECINE_FILTER 0 +#define CONFIG_THRESHOLD_FILTER 0 #define CONFIG_THUMBNAIL_FILTER 0 +#define CONFIG_THUMBNAIL_CUDA_FILTER 0 #define CONFIG_TILE_FILTER 0 #define CONFIG_TINTERLACE_FILTER 0 +#define CONFIG_TLUT2_FILTER 0 +#define CONFIG_TMIX_FILTER 0 +#define CONFIG_TONEMAP_FILTER 0 +#define CONFIG_TONEMAP_OPENCL_FILTER 0 +#define CONFIG_TPAD_FILTER 0 #define CONFIG_TRANSPOSE_FILTER 0 +#define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRIM_FILTER 0 +#define CONFIG_UNPREMULTIPLY_FILTER 0 #define CONFIG_UNSHARP_FILTER 0 +#define CONFIG_UNSHARP_OPENCL_FILTER 0 #define CONFIG_USPP_FILTER 0 +#define CONFIG_VAGUEDENOISER_FILTER 0 +#define CONFIG_VECTORSCOPE_FILTER 0 #define CONFIG_VFLIP_FILTER 0 +#define CONFIG_VFRDET_FILTER 0 +#define CONFIG_VIBRANCE_FILTER 0 #define CONFIG_VIDSTABDETECT_FILTER 0 #define CONFIG_VIDSTABTRANSFORM_FILTER 0 #define CONFIG_VIGNETTE_FILTER 0 +#define CONFIG_VMAFMOTION_FILTER 0 +#define CONFIG_VPP_QSV_FILTER 0 +#define CONFIG_VSTACK_FILTER 0 #define CONFIG_W3FDIF_FILTER 0 +#define CONFIG_WAVEFORM_FILTER 0 +#define CONFIG_WEAVE_FILTER 0 #define CONFIG_XBR_FILTER 0 +#define CONFIG_XSTACK_FILTER 0 #define CONFIG_YADIF_FILTER 0 +#define CONFIG_YADIF_CUDA_FILTER 0 #define CONFIG_ZMQ_FILTER 0 #define CONFIG_ZOOMPAN_FILTER 0 +#define CONFIG_ZSCALE_FILTER 0 +#define CONFIG_ALLRGB_FILTER 0 +#define CONFIG_ALLYUV_FILTER 0 #define CONFIG_CELLAUTO_FILTER 0 #define CONFIG_COLOR_FILTER 0 +#define CONFIG_COREIMAGESRC_FILTER 0 #define CONFIG_FREI0R_SRC_FILTER 0 #define CONFIG_HALDCLUTSRC_FILTER 0 #define CONFIG_LIFE_FILTER 0 #define CONFIG_MANDELBROT_FILTER 0 #define CONFIG_MPTESTSRC_FILTER 0 #define CONFIG_NULLSRC_FILTER 0 +#define CONFIG_OPENCLSRC_FILTER 0 +#define CONFIG_PAL75BARS_FILTER 0 +#define CONFIG_PAL100BARS_FILTER 0 #define CONFIG_RGBTESTSRC_FILTER 0 #define CONFIG_SMPTEBARS_FILTER 0 #define CONFIG_SMPTEHDBARS_FILTER 0 #define CONFIG_TESTSRC_FILTER 0 +#define CONFIG_TESTSRC2_FILTER 0 +#define CONFIG_YUVTESTSRC_FILTER 0 #define CONFIG_NULLSINK_FILTER 0 +#define CONFIG_ABITSCOPE_FILTER 0 #define CONFIG_ADRAWGRAPH_FILTER 0 +#define CONFIG_AGRAPHMONITOR_FILTER 0 +#define CONFIG_AHISTOGRAM_FILTER 0 +#define CONFIG_APHASEMETER_FILTER 0 #define CONFIG_AVECTORSCOPE_FILTER 0 #define CONFIG_CONCAT_FILTER 0 #define CONFIG_SHOWCQT_FILTER 0 +#define CONFIG_SHOWFREQS_FILTER 0 #define CONFIG_SHOWSPECTRUM_FILTER 0 +#define CONFIG_SHOWSPECTRUMPIC_FILTER 0 #define CONFIG_SHOWVOLUME_FILTER 0 #define CONFIG_SHOWWAVES_FILTER 0 #define CONFIG_SHOWWAVESPIC_FILTER 0 +#define CONFIG_SPECTRUMSYNTH_FILTER 0 #define CONFIG_AMOVIE_FILTER 0 #define CONFIG_MOVIE_FILTER 0 -#define CONFIG_H263_VAAPI_HWACCEL 0 -#define CONFIG_H263_VDPAU_HWACCEL 0 -#define CONFIG_H264_D3D11VA_HWACCEL 0 -#define CONFIG_H264_DXVA2_HWACCEL 0 -#define CONFIG_H264_MMAL_HWACCEL 0 -#define CONFIG_H264_QSV_HWACCEL 0 -#define CONFIG_H264_VAAPI_HWACCEL 0 -#define CONFIG_H264_VDA_HWACCEL 0 -#define CONFIG_H264_VDA_OLD_HWACCEL 0 -#define CONFIG_H264_VDPAU_HWACCEL 0 -#define CONFIG_HEVC_D3D11VA_HWACCEL 0 -#define CONFIG_HEVC_DXVA2_HWACCEL 0 -#define CONFIG_HEVC_QSV_HWACCEL 0 -#define CONFIG_HEVC_VDPAU_HWACCEL 0 -#define CONFIG_MPEG1_XVMC_HWACCEL 0 -#define CONFIG_MPEG1_VDPAU_HWACCEL 0 -#define CONFIG_MPEG2_XVMC_HWACCEL 0 -#define CONFIG_MPEG2_D3D11VA_HWACCEL 0 -#define CONFIG_MPEG2_DXVA2_HWACCEL 0 -#define CONFIG_MPEG2_QSV_HWACCEL 0 -#define CONFIG_MPEG2_VAAPI_HWACCEL 0 -#define CONFIG_MPEG2_VDPAU_HWACCEL 0 -#define CONFIG_MPEG4_VAAPI_HWACCEL 0 -#define CONFIG_MPEG4_VDPAU_HWACCEL 0 -#define CONFIG_VC1_D3D11VA_HWACCEL 0 -#define CONFIG_VC1_DXVA2_HWACCEL 0 -#define CONFIG_VC1_VAAPI_HWACCEL 0 -#define CONFIG_VC1_VDPAU_HWACCEL 0 -#define CONFIG_VC1_QSV_HWACCEL 0 -#define CONFIG_WMV3_D3D11VA_HWACCEL 0 -#define CONFIG_WMV3_DXVA2_HWACCEL 0 -#define CONFIG_WMV3_VAAPI_HWACCEL 0 -#define CONFIG_WMV3_VDPAU_HWACCEL 0 -#define CONFIG_ALSA_INDEV 0 -#define CONFIG_AVFOUNDATION_INDEV 0 -#define CONFIG_BKTR_INDEV 0 -#define CONFIG_DECKLINK_INDEV 0 -#define CONFIG_DSHOW_INDEV 0 -#define CONFIG_DV1394_INDEV 0 -#define CONFIG_FBDEV_INDEV 0 -#define CONFIG_GDIGRAB_INDEV 0 -#define CONFIG_IEC61883_INDEV 0 -#define CONFIG_JACK_INDEV 0 -#define CONFIG_LAVFI_INDEV 0 -#define CONFIG_OPENAL_INDEV 0 -#define CONFIG_OSS_INDEV 0 -#define CONFIG_PULSE_INDEV 0 -#define CONFIG_QTKIT_INDEV 0 -#define CONFIG_SNDIO_INDEV 0 -#define CONFIG_V4L2_INDEV 0 -#define CONFIG_VFWCAP_INDEV 0 -#define CONFIG_X11GRAB_INDEV 0 -#define CONFIG_X11GRAB_XCB_INDEV 0 -#define CONFIG_LIBCDIO_INDEV 0 -#define CONFIG_LIBDC1394_INDEV 0 +#define CONFIG_AFIFO_FILTER 0 +#define CONFIG_FIFO_FILTER 0 +#define CONFIG_AA_DEMUXER 1 +#define CONFIG_AAC_DEMUXER 1 +#define CONFIG_AC3_DEMUXER 1 +#define CONFIG_ACM_DEMUXER 1 +#define CONFIG_ACT_DEMUXER 1 +#define CONFIG_ADF_DEMUXER 1 +#define CONFIG_ADP_DEMUXER 1 +#define CONFIG_ADS_DEMUXER 1 +#define CONFIG_ADX_DEMUXER 1 +#define CONFIG_AEA_DEMUXER 1 +#define CONFIG_AFC_DEMUXER 1 +#define CONFIG_AIFF_DEMUXER 1 +#define CONFIG_AIX_DEMUXER 1 +#define CONFIG_AMR_DEMUXER 1 +#define CONFIG_AMRNB_DEMUXER 1 +#define CONFIG_AMRWB_DEMUXER 1 +#define CONFIG_ANM_DEMUXER 1 +#define CONFIG_APC_DEMUXER 1 +#define CONFIG_APE_DEMUXER 1 +#define CONFIG_APNG_DEMUXER 1 +#define CONFIG_APTX_DEMUXER 1 +#define CONFIG_APTX_HD_DEMUXER 1 +#define CONFIG_AQTITLE_DEMUXER 1 +#define CONFIG_ASF_DEMUXER 1 +#define CONFIG_ASF_O_DEMUXER 1 +#define CONFIG_ASS_DEMUXER 1 +#define CONFIG_AST_DEMUXER 1 +#define CONFIG_AU_DEMUXER 1 +#define CONFIG_AVI_DEMUXER 1 +#define CONFIG_AVISYNTH_DEMUXER 0 +#define CONFIG_AVR_DEMUXER 1 +#define CONFIG_AVS_DEMUXER 1 +#define CONFIG_AVS2_DEMUXER 1 +#define CONFIG_BETHSOFTVID_DEMUXER 1 +#define CONFIG_BFI_DEMUXER 1 +#define CONFIG_BINTEXT_DEMUXER 1 +#define CONFIG_BINK_DEMUXER 1 +#define CONFIG_BIT_DEMUXER 1 +#define CONFIG_BMV_DEMUXER 1 +#define CONFIG_BFSTM_DEMUXER 1 +#define CONFIG_BRSTM_DEMUXER 1 +#define CONFIG_BOA_DEMUXER 1 +#define CONFIG_C93_DEMUXER 1 +#define CONFIG_CAF_DEMUXER 1 +#define CONFIG_CAVSVIDEO_DEMUXER 1 +#define CONFIG_CDG_DEMUXER 1 +#define CONFIG_CDXL_DEMUXER 1 +#define CONFIG_CINE_DEMUXER 1 +#define CONFIG_CODEC2_DEMUXER 1 +#define CONFIG_CODEC2RAW_DEMUXER 1 +#define CONFIG_CONCAT_DEMUXER 1 +#define CONFIG_DASH_DEMUXER 0 +#define CONFIG_DATA_DEMUXER 1 +#define CONFIG_DAUD_DEMUXER 1 +#define CONFIG_DCSTR_DEMUXER 1 +#define CONFIG_DFA_DEMUXER 1 +#define CONFIG_DIRAC_DEMUXER 1 +#define CONFIG_DNXHD_DEMUXER 1 +#define CONFIG_DSF_DEMUXER 1 +#define CONFIG_DSICIN_DEMUXER 1 +#define CONFIG_DSS_DEMUXER 1 +#define CONFIG_DTS_DEMUXER 1 +#define CONFIG_DTSHD_DEMUXER 1 +#define CONFIG_DV_DEMUXER 1 +#define CONFIG_DVBSUB_DEMUXER 1 +#define CONFIG_DVBTXT_DEMUXER 1 +#define CONFIG_DXA_DEMUXER 1 +#define CONFIG_EA_DEMUXER 1 +#define CONFIG_EA_CDATA_DEMUXER 1 +#define CONFIG_EAC3_DEMUXER 1 +#define CONFIG_EPAF_DEMUXER 1 +#define CONFIG_FFMETADATA_DEMUXER 1 +#define CONFIG_FILMSTRIP_DEMUXER 1 +#define CONFIG_FITS_DEMUXER 1 +#define CONFIG_FLAC_DEMUXER 1 +#define CONFIG_FLIC_DEMUXER 1 +#define CONFIG_FLV_DEMUXER 1 +#define CONFIG_LIVE_FLV_DEMUXER 1 +#define CONFIG_FOURXM_DEMUXER 1 +#define CONFIG_FRM_DEMUXER 1 +#define CONFIG_FSB_DEMUXER 1 +#define CONFIG_G722_DEMUXER 1 +#define CONFIG_G723_1_DEMUXER 1 +#define CONFIG_G726_DEMUXER 1 +#define CONFIG_G726LE_DEMUXER 1 +#define CONFIG_G729_DEMUXER 1 +#define CONFIG_GDV_DEMUXER 1 +#define CONFIG_GENH_DEMUXER 1 +#define CONFIG_GIF_DEMUXER 1 +#define CONFIG_GSM_DEMUXER 1 +#define CONFIG_GXF_DEMUXER 1 +#define CONFIG_H261_DEMUXER 1 +#define CONFIG_H263_DEMUXER 1 +#define CONFIG_H264_DEMUXER 1 +#define CONFIG_HEVC_DEMUXER 1 +#define CONFIG_HLS_DEMUXER 1 +#define CONFIG_HNM_DEMUXER 1 +#define CONFIG_ICO_DEMUXER 1 +#define CONFIG_IDCIN_DEMUXER 1 +#define CONFIG_IDF_DEMUXER 1 +#define CONFIG_IFF_DEMUXER 1 +#define CONFIG_ILBC_DEMUXER 1 +#define CONFIG_IMAGE2_DEMUXER 1 +#define CONFIG_IMAGE2PIPE_DEMUXER 1 +#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 1 +#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 1 +#define CONFIG_INGENIENT_DEMUXER 1 +#define CONFIG_IPMOVIE_DEMUXER 1 +#define CONFIG_IRCAM_DEMUXER 1 +#define CONFIG_ISS_DEMUXER 1 +#define CONFIG_IV8_DEMUXER 1 +#define CONFIG_IVF_DEMUXER 1 +#define CONFIG_IVR_DEMUXER 1 +#define CONFIG_JACOSUB_DEMUXER 1 +#define CONFIG_JV_DEMUXER 1 +#define CONFIG_LMLM4_DEMUXER 1 +#define CONFIG_LOAS_DEMUXER 1 +#define CONFIG_LRC_DEMUXER 1 +#define CONFIG_LVF_DEMUXER 1 +#define CONFIG_LXF_DEMUXER 1 +#define CONFIG_M4V_DEMUXER 1 +#define CONFIG_MATROSKA_DEMUXER 1 +#define CONFIG_MGSTS_DEMUXER 1 +#define CONFIG_MICRODVD_DEMUXER 1 +#define CONFIG_MJPEG_DEMUXER 1 +#define CONFIG_MJPEG_2000_DEMUXER 1 +#define CONFIG_MLP_DEMUXER 1 +#define CONFIG_MLV_DEMUXER 1 +#define CONFIG_MM_DEMUXER 1 +#define CONFIG_MMF_DEMUXER 1 +#define CONFIG_MOV_DEMUXER 1 +#define CONFIG_MP3_DEMUXER 1 +#define CONFIG_MPC_DEMUXER 1 +#define CONFIG_MPC8_DEMUXER 1 +#define CONFIG_MPEGPS_DEMUXER 1 +#define CONFIG_MPEGTS_DEMUXER 1 +#define CONFIG_MPEGTSRAW_DEMUXER 1 +#define CONFIG_MPEGVIDEO_DEMUXER 1 +#define CONFIG_MPJPEG_DEMUXER 1 +#define CONFIG_MPL2_DEMUXER 1 +#define CONFIG_MPSUB_DEMUXER 1 +#define CONFIG_MSF_DEMUXER 1 +#define CONFIG_MSNWC_TCP_DEMUXER 1 +#define CONFIG_MTAF_DEMUXER 1 +#define CONFIG_MTV_DEMUXER 1 +#define CONFIG_MUSX_DEMUXER 1 +#define CONFIG_MV_DEMUXER 1 +#define CONFIG_MVI_DEMUXER 1 +#define CONFIG_MXF_DEMUXER 1 +#define CONFIG_MXG_DEMUXER 1 +#define CONFIG_NC_DEMUXER 1 +#define CONFIG_NISTSPHERE_DEMUXER 1 +#define CONFIG_NSP_DEMUXER 1 +#define CONFIG_NSV_DEMUXER 1 +#define CONFIG_NUT_DEMUXER 1 +#define CONFIG_NUV_DEMUXER 1 +#define CONFIG_OGG_DEMUXER 1 +#define CONFIG_OMA_DEMUXER 1 +#define CONFIG_PAF_DEMUXER 1 +#define CONFIG_PCM_ALAW_DEMUXER 1 +#define CONFIG_PCM_MULAW_DEMUXER 1 +#define CONFIG_PCM_VIDC_DEMUXER 1 +#define CONFIG_PCM_F64BE_DEMUXER 1 +#define CONFIG_PCM_F64LE_DEMUXER 1 +#define CONFIG_PCM_F32BE_DEMUXER 1 +#define CONFIG_PCM_F32LE_DEMUXER 1 +#define CONFIG_PCM_S32BE_DEMUXER 1 +#define CONFIG_PCM_S32LE_DEMUXER 1 +#define CONFIG_PCM_S24BE_DEMUXER 1 +#define CONFIG_PCM_S24LE_DEMUXER 1 +#define CONFIG_PCM_S16BE_DEMUXER 1 +#define CONFIG_PCM_S16LE_DEMUXER 1 +#define CONFIG_PCM_S8_DEMUXER 1 +#define CONFIG_PCM_U32BE_DEMUXER 1 +#define CONFIG_PCM_U32LE_DEMUXER 1 +#define CONFIG_PCM_U24BE_DEMUXER 1 +#define CONFIG_PCM_U24LE_DEMUXER 1 +#define CONFIG_PCM_U16BE_DEMUXER 1 +#define CONFIG_PCM_U16LE_DEMUXER 1 +#define CONFIG_PCM_U8_DEMUXER 1 +#define CONFIG_PJS_DEMUXER 1 +#define CONFIG_PMP_DEMUXER 1 +#define CONFIG_PVA_DEMUXER 1 +#define CONFIG_PVF_DEMUXER 1 +#define CONFIG_QCP_DEMUXER 1 +#define CONFIG_R3D_DEMUXER 1 +#define CONFIG_RAWVIDEO_DEMUXER 1 +#define CONFIG_REALTEXT_DEMUXER 1 +#define CONFIG_REDSPARK_DEMUXER 1 +#define CONFIG_RL2_DEMUXER 1 +#define CONFIG_RM_DEMUXER 1 +#define CONFIG_ROQ_DEMUXER 1 +#define CONFIG_RPL_DEMUXER 1 +#define CONFIG_RSD_DEMUXER 1 +#define CONFIG_RSO_DEMUXER 1 +#define CONFIG_RTP_DEMUXER 0 +#define CONFIG_RTSP_DEMUXER 0 +#define CONFIG_S337M_DEMUXER 1 +#define CONFIG_SAMI_DEMUXER 1 +#define CONFIG_SAP_DEMUXER 0 +#define CONFIG_SBC_DEMUXER 1 +#define CONFIG_SBG_DEMUXER 1 +#define CONFIG_SCC_DEMUXER 1 +#define CONFIG_SDP_DEMUXER 0 +#define CONFIG_SDR2_DEMUXER 1 +#define CONFIG_SDS_DEMUXER 1 +#define CONFIG_SDX_DEMUXER 1 +#define CONFIG_SEGAFILM_DEMUXER 1 +#define CONFIG_SER_DEMUXER 1 +#define CONFIG_SHORTEN_DEMUXER 1 +#define CONFIG_SIFF_DEMUXER 1 +#define CONFIG_SLN_DEMUXER 1 +#define CONFIG_SMACKER_DEMUXER 1 +#define CONFIG_SMJPEG_DEMUXER 1 +#define CONFIG_SMUSH_DEMUXER 1 +#define CONFIG_SOL_DEMUXER 1 +#define CONFIG_SOX_DEMUXER 1 +#define CONFIG_SPDIF_DEMUXER 1 +#define CONFIG_SRT_DEMUXER 1 +#define CONFIG_STR_DEMUXER 1 +#define CONFIG_STL_DEMUXER 1 +#define CONFIG_SUBVIEWER1_DEMUXER 1 +#define CONFIG_SUBVIEWER_DEMUXER 1 +#define CONFIG_SUP_DEMUXER 1 +#define CONFIG_SVAG_DEMUXER 1 +#define CONFIG_SWF_DEMUXER 1 +#define CONFIG_TAK_DEMUXER 1 +#define CONFIG_TEDCAPTIONS_DEMUXER 1 +#define CONFIG_THP_DEMUXER 1 +#define CONFIG_THREEDOSTR_DEMUXER 1 +#define CONFIG_TIERTEXSEQ_DEMUXER 1 +#define CONFIG_TMV_DEMUXER 1 +#define CONFIG_TRUEHD_DEMUXER 1 +#define CONFIG_TTA_DEMUXER 1 +#define CONFIG_TXD_DEMUXER 1 +#define CONFIG_TTY_DEMUXER 1 +#define CONFIG_TY_DEMUXER 1 +#define CONFIG_V210_DEMUXER 1 +#define CONFIG_V210X_DEMUXER 1 +#define CONFIG_VAG_DEMUXER 1 +#define CONFIG_VC1_DEMUXER 1 +#define CONFIG_VC1T_DEMUXER 1 +#define CONFIG_VIVO_DEMUXER 1 +#define CONFIG_VMD_DEMUXER 1 +#define CONFIG_VOBSUB_DEMUXER 1 +#define CONFIG_VOC_DEMUXER 1 +#define CONFIG_VPK_DEMUXER 1 +#define CONFIG_VPLAYER_DEMUXER 1 +#define CONFIG_VQF_DEMUXER 1 +#define CONFIG_W64_DEMUXER 1 +#define CONFIG_WAV_DEMUXER 1 +#define CONFIG_WC3_DEMUXER 1 +#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 1 +#define CONFIG_WEBVTT_DEMUXER 1 +#define CONFIG_WSAUD_DEMUXER 1 +#define CONFIG_WSD_DEMUXER 1 +#define CONFIG_WSVQA_DEMUXER 1 +#define CONFIG_WTV_DEMUXER 1 +#define CONFIG_WVE_DEMUXER 1 +#define CONFIG_WV_DEMUXER 1 +#define CONFIG_XA_DEMUXER 1 +#define CONFIG_XBIN_DEMUXER 1 +#define CONFIG_XMV_DEMUXER 1 +#define CONFIG_XVAG_DEMUXER 1 +#define CONFIG_XWMA_DEMUXER 1 +#define CONFIG_YOP_DEMUXER 1 +#define CONFIG_YUV4MPEGPIPE_DEMUXER 1 +#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PAM_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PBM_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PCX_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PGM_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PPM_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_PSD_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_SVG_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_XPM_PIPE_DEMUXER 1 +#define CONFIG_IMAGE_XWD_PIPE_DEMUXER 1 +#define CONFIG_LIBGME_DEMUXER 0 +#define CONFIG_LIBMODPLUG_DEMUXER 0 +#define CONFIG_LIBOPENMPT_DEMUXER 0 +#define CONFIG_VAPOURSYNTH_DEMUXER 0 #define CONFIG_A64_MUXER 0 #define CONFIG_AC3_MUXER 0 #define CONFIG_ADTS_MUXER 0 @@ -1740,6 +2272,8 @@ #define CONFIG_AIFF_MUXER 0 #define CONFIG_AMR_MUXER 0 #define CONFIG_APNG_MUXER 0 +#define CONFIG_APTX_MUXER 0 +#define CONFIG_APTX_HD_MUXER 0 #define CONFIG_ASF_MUXER 0 #define CONFIG_ASS_MUXER 0 #define CONFIG_AST_MUXER 0 @@ -1747,9 +2281,12 @@ #define CONFIG_AU_MUXER 0 #define CONFIG_AVI_MUXER 0 #define CONFIG_AVM2_MUXER 0 +#define CONFIG_AVS2_MUXER 0 #define CONFIG_BIT_MUXER 0 #define CONFIG_CAF_MUXER 0 #define CONFIG_CAVSVIDEO_MUXER 0 +#define CONFIG_CODEC2_MUXER 0 +#define CONFIG_CODEC2RAW_MUXER 0 #define CONFIG_CRC_MUXER 0 #define CONFIG_DASH_MUXER 0 #define CONFIG_DATA_MUXER 0 @@ -1760,20 +2297,27 @@ #define CONFIG_DV_MUXER 0 #define CONFIG_EAC3_MUXER 0 #define CONFIG_F4V_MUXER 0 -#define CONFIG_FFM_MUXER 0 #define CONFIG_FFMETADATA_MUXER 0 +#define CONFIG_FIFO_MUXER 0 +#define CONFIG_FIFO_TEST_MUXER 0 #define CONFIG_FILMSTRIP_MUXER 0 +#define CONFIG_FITS_MUXER 0 #define CONFIG_FLAC_MUXER 0 #define CONFIG_FLV_MUXER 0 #define CONFIG_FRAMECRC_MUXER 0 +#define CONFIG_FRAMEHASH_MUXER 0 #define CONFIG_FRAMEMD5_MUXER 0 #define CONFIG_G722_MUXER 0 #define CONFIG_G723_1_MUXER 0 +#define CONFIG_G726_MUXER 0 +#define CONFIG_G726LE_MUXER 0 #define CONFIG_GIF_MUXER 0 +#define CONFIG_GSM_MUXER 0 #define CONFIG_GXF_MUXER 0 #define CONFIG_H261_MUXER 0 #define CONFIG_H263_MUXER 0 #define CONFIG_H264_MUXER 0 +#define CONFIG_HASH_MUXER 0 #define CONFIG_HDS_MUXER 0 #define CONFIG_HEVC_MUXER 0 #define CONFIG_HLS_MUXER 0 @@ -1816,10 +2360,12 @@ #define CONFIG_NUT_MUXER 0 #define CONFIG_OGA_MUXER 0 #define CONFIG_OGG_MUXER 0 +#define CONFIG_OGV_MUXER 0 #define CONFIG_OMA_MUXER 0 #define CONFIG_OPUS_MUXER 0 #define CONFIG_PCM_ALAW_MUXER 0 #define CONFIG_PCM_MULAW_MUXER 0 +#define CONFIG_PCM_VIDC_MUXER 0 #define CONFIG_PCM_F64BE_MUXER 0 #define CONFIG_PCM_F64LE_MUXER 0 #define CONFIG_PCM_F32BE_MUXER 0 @@ -1847,6 +2393,9 @@ #define CONFIG_RTP_MPEGTS_MUXER 0 #define CONFIG_RTSP_MUXER 0 #define CONFIG_SAP_MUXER 0 +#define CONFIG_SBC_MUXER 0 +#define CONFIG_SCC_MUXER 0 +#define CONFIG_SEGAFILM_MUXER 0 #define CONFIG_SEGMENT_MUXER 0 #define CONFIG_STREAM_SEGMENT_MUXER 0 #define CONFIG_SINGLEJPEG_MUXER 0 @@ -1856,12 +2405,14 @@ #define CONFIG_SPX_MUXER 0 #define CONFIG_SPDIF_MUXER 0 #define CONFIG_SRT_MUXER 0 +#define CONFIG_SUP_MUXER 0 #define CONFIG_SWF_MUXER 0 #define CONFIG_TEE_MUXER 0 #define CONFIG_TG2_MUXER 0 #define CONFIG_TGP_MUXER 0 #define CONFIG_MKVTIMESTAMP_V2_MUXER 0 #define CONFIG_TRUEHD_MUXER 0 +#define CONFIG_TTA_MUXER 0 #define CONFIG_UNCODEDFRAMECRC_MUXER 0 #define CONFIG_VC1_MUXER 0 #define CONFIG_VC1T_MUXER 0 @@ -1876,55 +2427,8 @@ #define CONFIG_WTV_MUXER 0 #define CONFIG_WV_MUXER 0 #define CONFIG_YUV4MPEGPIPE_MUXER 0 -#define CONFIG_LIBNUT_MUXER 0 -#define CONFIG_ALSA_OUTDEV 0 -#define CONFIG_CACA_OUTDEV 0 -#define CONFIG_DECKLINK_OUTDEV 0 -#define CONFIG_FBDEV_OUTDEV 0 -#define CONFIG_OPENGL_OUTDEV 0 -#define CONFIG_OSS_OUTDEV 0 -#define CONFIG_PULSE_OUTDEV 0 -#define CONFIG_SDL_OUTDEV 0 -#define CONFIG_SNDIO_OUTDEV 0 -#define CONFIG_V4L2_OUTDEV 0 -#define CONFIG_XV_OUTDEV 0 -#define CONFIG_AAC_PARSER 1 -#define CONFIG_AAC_LATM_PARSER 1 -#define CONFIG_AC3_PARSER 1 -#define CONFIG_ADX_PARSER 1 -#define CONFIG_BMP_PARSER 1 -#define CONFIG_CAVSVIDEO_PARSER 1 -#define CONFIG_COOK_PARSER 1 -#define CONFIG_DCA_PARSER 1 -#define CONFIG_DIRAC_PARSER 1 -#define CONFIG_DNXHD_PARSER 1 -#define CONFIG_DPX_PARSER 1 -#define CONFIG_DVBSUB_PARSER 1 -#define CONFIG_DVDSUB_PARSER 1 -#define CONFIG_DVD_NAV_PARSER 1 -#define CONFIG_FLAC_PARSER 1 -#define CONFIG_GSM_PARSER 1 -#define CONFIG_H261_PARSER 1 -#define CONFIG_H263_PARSER 1 -#define CONFIG_H264_PARSER 1 -#define CONFIG_HEVC_PARSER 1 -#define CONFIG_MJPEG_PARSER 1 -#define CONFIG_MLP_PARSER 1 -#define CONFIG_MPEG4VIDEO_PARSER 1 -#define CONFIG_MPEGAUDIO_PARSER 1 -#define CONFIG_MPEGVIDEO_PARSER 1 -#define CONFIG_OPUS_PARSER 1 -#define CONFIG_PNG_PARSER 1 -#define CONFIG_PNM_PARSER 1 -#define CONFIG_RV30_PARSER 1 -#define CONFIG_RV40_PARSER 1 -#define CONFIG_TAK_PARSER 1 -#define CONFIG_VC1_PARSER 1 -#define CONFIG_VORBIS_PARSER 1 -#define CONFIG_VP3_PARSER 1 -#define CONFIG_VP8_PARSER 1 -#define CONFIG_VP9_PARSER 1 -#define CONFIG_ASYNC_PROTOCOL 0 +#define CONFIG_CHROMAPRINT_MUXER 0 +#define CONFIG_ASYNC_PROTOCOL 1 #define CONFIG_BLURAY_PROTOCOL 0 #define CONFIG_CACHE_PROTOCOL 1 #define CONFIG_CONCAT_PROTOCOL 1 @@ -1944,6 +2448,7 @@ #define CONFIG_MMST_PROTOCOL 0 #define CONFIG_MD5_PROTOCOL 1 #define CONFIG_PIPE_PROTOCOL 1 +#define CONFIG_PROMPEG_PROTOCOL 1 #define CONFIG_RTMP_PROTOCOL 0 #define CONFIG_RTMPE_PROTOCOL 0 #define CONFIG_RTMPS_PROTOCOL 0 @@ -1954,10 +2459,9 @@ #define CONFIG_SCTP_PROTOCOL 0 #define CONFIG_SRTP_PROTOCOL 0 #define CONFIG_SUBFILE_PROTOCOL 1 +#define CONFIG_TEE_PROTOCOL 1 #define CONFIG_TCP_PROTOCOL 0 -#define CONFIG_TLS_SECURETRANSPORT_PROTOCOL 0 -#define CONFIG_TLS_GNUTLS_PROTOCOL 0 -#define CONFIG_TLS_OPENSSL_PROTOCOL 0 +#define CONFIG_TLS_PROTOCOL 0 #define CONFIG_UDP_PROTOCOL 0 #define CONFIG_UDPLITE_PROTOCOL 0 #define CONFIG_UNIX_PROTOCOL 0 @@ -1966,6 +2470,7 @@ #define CONFIG_LIBRTMPS_PROTOCOL 0 #define CONFIG_LIBRTMPT_PROTOCOL 0 #define CONFIG_LIBRTMPTE_PROTOCOL 0 +#define CONFIG_LIBSRT_PROTOCOL 0 #define CONFIG_LIBSSH_PROTOCOL 0 #define CONFIG_LIBSMBCLIENT_PROTOCOL 0 #endif /* FFMPEG_CONFIG_H */ diff --git a/build/ffmpeg/configure.sh b/build/ffmpeg/configure.sh index 7eed30152..b73d79a81 100755 --- a/build/ffmpeg/configure.sh +++ b/build/ffmpeg/configure.sh @@ -1,6 +1,6 @@ platform='Win32' suffix='x86' -if [[ $LIB =~ amd64 ]]; then +if [[ $LIB =~ x64 ]]; then platform='x64' suffix='x64' fi @@ -18,7 +18,6 @@ fi --disable-ffmpeg \ --disable-ffplay \ --disable-ffprobe \ - --disable-ffserver \ --disable-filters \ --disable-hwaccels \ --disable-muxers \ @@ -29,6 +28,9 @@ fi --enable-gpl \ --enable-runtime-cpudetect \ --enable-static \ + --enable-small \ + --enable-x86asm \ + --x86asmexe=yasm \ --enable-zlib \ --extra-cflags=-D_SYSCRT \ --extra-cflags=-I../../include \ diff --git a/build/ffmpeg/ffmpeg.vcxproj b/build/ffmpeg/ffmpeg.vcxproj index 8f9959679..f889b4e86 100644 --- a/build/ffmpeg/ffmpeg.vcxproj +++ b/build/ffmpeg/ffmpeg.vcxproj @@ -22,6 +22,7 @@ $(MSBuildThisFileDirectory); $(FfmpegSrcDir); + $(FfmpegSrcDir)\compat\atomics\win32; $(AegisubSourceBase)\include; @@ -76,7 +77,6 @@ - @@ -100,12 +100,15 @@ + + + @@ -114,23 +117,31 @@ + - - + + + + + + + + + @@ -139,14 +150,17 @@ + + + @@ -156,54 +170,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -213,6 +252,8 @@ + + @@ -221,12 +262,15 @@ + + + @@ -240,6 +284,9 @@ + + + @@ -249,6 +296,7 @@ + @@ -256,9 +304,12 @@ + + + @@ -273,27 +324,34 @@ - + + + + + + + + - + @@ -304,6 +362,7 @@ + @@ -314,6 +373,7 @@ + @@ -321,11 +381,13 @@ + - + + @@ -333,6 +395,7 @@ + @@ -353,14 +416,19 @@ + + + + + @@ -370,10 +438,12 @@ + + @@ -386,6 +456,8 @@ + + @@ -414,6 +486,7 @@ + @@ -429,10 +502,12 @@ + + @@ -440,11 +515,15 @@ + + + + @@ -452,6 +531,7 @@ + @@ -459,16 +539,20 @@ + + - + + + @@ -480,19 +564,19 @@ + - - + @@ -505,16 +589,24 @@ + + + + + + + + @@ -524,6 +616,7 @@ + @@ -536,6 +629,7 @@ + @@ -547,8 +641,10 @@ + + @@ -561,6 +657,7 @@ + @@ -602,13 +699,24 @@ + + + + + + + + + + + @@ -619,11 +727,15 @@ + + + + @@ -631,8 +743,9 @@ - - + + + @@ -646,11 +759,13 @@ + + @@ -658,6 +773,7 @@ + @@ -665,9 +781,11 @@ - + + + @@ -677,6 +795,9 @@ + + + @@ -684,11 +805,14 @@ + + + @@ -697,15 +821,20 @@ + + + + + @@ -713,6 +842,7 @@ + @@ -721,6 +851,7 @@ + @@ -744,12 +875,15 @@ + + + @@ -761,24 +895,29 @@ + - + + + + + @@ -823,11 +962,14 @@ + + + @@ -837,8 +979,11 @@ + + + @@ -847,12 +992,14 @@ + + @@ -871,10 +1018,13 @@ + + + @@ -891,12 +1041,19 @@ + + + + + + + @@ -914,23 +1071,32 @@ + + + + + + + + + @@ -939,18 +1105,23 @@ + + + + + @@ -966,6 +1137,7 @@ + @@ -976,13 +1148,16 @@ + + + @@ -994,10 +1169,13 @@ + + + @@ -1007,7 +1185,9 @@ + + @@ -1022,21 +1202,25 @@ + + + + + - $(MSBuildThisFileDirectory) @@ -1050,10 +1234,8 @@ - - @@ -1069,7 +1251,6 @@ - @@ -1094,6 +1275,7 @@ + @@ -1101,12 +1283,12 @@ + - @@ -1135,15 +1317,19 @@ + + + + - - - + + + @@ -1162,18 +1348,21 @@ + - + + + @@ -1185,9 +1374,15 @@ + + + + + - + + @@ -1195,19 +1390,26 @@ + + + + + + + diff --git a/build/ffms2/ffms2.vcxproj b/build/ffms2/ffms2.vcxproj index cb0d0bff7..a8dd49750 100644 --- a/build/ffms2/ffms2.vcxproj +++ b/build/ffms2/ffms2.vcxproj @@ -60,14 +60,10 @@ - - - - @@ -84,7 +80,6 @@ - diff --git a/build/ffms2/ffms2.vcxproj.filters b/build/ffms2/ffms2.vcxproj.filters index 643120b19..6e948bff6 100644 --- a/build/ffms2/ffms2.vcxproj.filters +++ b/build/ffms2/ffms2.vcxproj.filters @@ -27,18 +27,9 @@ Audio - - Audio - Indexing - - Indexing - - - Video - Video @@ -48,9 +39,6 @@ Utils - - Utils - Avisynth @@ -104,9 +92,6 @@ Utils - - Utils - Avisynth diff --git a/src/video_provider_ffmpegsource.cpp b/src/video_provider_ffmpegsource.cpp index 2f057e93d..f4ed6a2f2 100644 --- a/src/video_provider_ffmpegsource.cpp +++ b/src/video_provider_ffmpegsource.cpp @@ -44,6 +44,23 @@ #include namespace { +typedef enum AGI_ColorSpaces { + AGI_CS_RGB = 0, + AGI_CS_BT709 = 1, + AGI_CS_UNSPECIFIED = 2, + AGI_CS_FCC = 4, + AGI_CS_BT470BG = 5, + AGI_CS_SMPTE170M = 6, + AGI_CS_SMPTE240M = 7, + AGI_CS_YCOCG = 8, + AGI_CS_BT2020_NCL = 9, + AGI_CS_BT2020_CL = 10, + AGI_CS_SMPTE2085 = 11, + AGI_CS_CHROMATICITY_DERIVED_NCL = 12, + AGI_CS_CHROMATICITY_DERIVED_CL = 13, + AGI_CS_ICTCP = 14 +} AGI_ColorSpaces; + /// @class FFmpegSourceVideoProvider /// @brief Implements video loading through the FFMS library. class FFmpegSourceVideoProvider final : public VideoProvider, FFmpegSourceProvider { @@ -78,7 +95,7 @@ public: if (matrix == RealColorSpace) FFMS_SetInputFormatV(VideoSource, CS, CR, FFMS_GetPixFmt(""), nullptr); else if (matrix == "TV.601") - FFMS_SetInputFormatV(VideoSource, FFMS_CS_BT470BG, CR, FFMS_GetPixFmt(""), nullptr); + FFMS_SetInputFormatV(VideoSource, AGI_CS_BT470BG, CR, FFMS_GetPixFmt(""), nullptr); else return; ColorSpace = matrix; @@ -103,16 +120,16 @@ std::string colormatrix_description(int cs, int cr) { std::string str = cr == FFMS_CR_JPEG ? "PC" : "TV"; switch (cs) { - case FFMS_CS_RGB: + case AGI_CS_RGB: return "None"; - case FFMS_CS_BT709: + case AGI_CS_BT709: return str + ".709"; - case FFMS_CS_FCC: + case AGI_CS_FCC: return str + ".FCC"; - case FFMS_CS_BT470BG: - case FFMS_CS_SMPTE170M: + case AGI_CS_BT470BG: + case AGI_CS_SMPTE170M: return str + ".601"; - case FFMS_CS_SMPTE240M: + case AGI_CS_SMPTE240M: return str + ".240M"; default: throw VideoOpenError("Unknown video color space"); @@ -206,8 +223,10 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st // set thread count int Threads = OPT_GET("Provider/Video/FFmpegSource/Decoding Threads")->GetInt(); +#if FFMS_VERSION < ((2 << 24) | (30 << 16) | (0 << 8) | 0) if (FFMS_GetVersion() < ((2 << 24) | (17 << 16) | (2 << 8) | 1) && FFMS_GetSourceType(Index) == FFMS_SOURCE_LAVF) Threads = 1; +#endif // set seekmode // TODO: give this its own option? @@ -238,14 +257,14 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st int VideoCS = CS = TempFrame->ColorSpace; CR = TempFrame->ColorRange; - if (CS == FFMS_CS_UNSPECIFIED) - CS = Width > 1024 || Height >= 600 ? FFMS_CS_BT709 : FFMS_CS_BT470BG; + if (CS == AGI_CS_UNSPECIFIED) + CS = Width > 1024 || Height >= 600 ? AGI_CS_BT709 : AGI_CS_BT470BG; RealColorSpace = ColorSpace = colormatrix_description(CS, CR); #if FFMS_VERSION >= ((2 << 24) | (17 << 16) | (1 << 8) | 0) - if (CS != FFMS_CS_RGB && CS != FFMS_CS_BT470BG && ColorSpace != colormatrix && (colormatrix == "TV.601" || OPT_GET("Video/Force BT.601")->GetBool())) { - CS = FFMS_CS_BT470BG; - ColorSpace = colormatrix_description(FFMS_CS_BT470BG, CR); + if (CS != AGI_CS_RGB && CS != AGI_CS_BT470BG && ColorSpace != colormatrix && (colormatrix == "TV.601" || OPT_GET("Video/Force BT.601")->GetBool())) { + CS = AGI_CS_BT470BG; + ColorSpace = colormatrix_description(AGI_CS_BT470BG, CR); } if (CS != VideoCS) { diff --git a/vendor/ffmpeg b/vendor/ffmpeg index 802e51299..d290bb0c5 160000 --- a/vendor/ffmpeg +++ b/vendor/ffmpeg @@ -1 +1 @@ -Subproject commit 802e51299e6d018f2f54c8d14f2b765c7c750496 +Subproject commit d290bb0c540425e937d11ed88e22c68ab97c57eb diff --git a/vendor/ffms2 b/vendor/ffms2 index 06bcf231c..f3c6b008b 160000 --- a/vendor/ffms2 +++ b/vendor/ffms2 @@ -1 +1 @@ -Subproject commit 06bcf231cab00bfbf28f910c6ec3ca6680957cb6 +Subproject commit f3c6b008b53719dcac032293e3a42a3164c8d7ec From 2cb92a5f74634764ff5aac7e3ad0d647f98142af Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 22 Nov 2018 12:23:58 -0800 Subject: [PATCH 006/271] Bump _WIN32_WINNT to Vista --- build/Aegisub/Aegisub.targets | 1 + build/ffmpeg/ffmpeg.vcxproj | 2 +- build/libaegisub/libaegisub.vcxproj | 2 +- libaegisub/windows/path_win.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/Aegisub/Aegisub.targets b/build/Aegisub/Aegisub.targets index 46cc90c9f..78d939088 100644 --- a/build/Aegisub/Aegisub.targets +++ b/build/Aegisub/Aegisub.targets @@ -126,6 +126,7 @@ NOMINMAX; + _WIN32_WINNT=0x0602; %(PreprocessorDefinitions) diff --git a/build/ffmpeg/ffmpeg.vcxproj b/build/ffmpeg/ffmpeg.vcxproj index f889b4e86..d1663004b 100644 --- a/build/ffmpeg/ffmpeg.vcxproj +++ b/build/ffmpeg/ffmpeg.vcxproj @@ -33,7 +33,7 @@ _LARGEFILE_SOURCE; _SYSCRT; _USE_MATH_DEFINES; - _WIN32_WINNT=0x0502; + _WIN32_WINNT=0x0602; inline=__inline; %(PreprocessorDefinitions) diff --git a/build/libaegisub/libaegisub.vcxproj b/build/libaegisub/libaegisub.vcxproj index 06f9c02ba..a431eb5eb 100644 --- a/build/libaegisub/libaegisub.vcxproj +++ b/build/libaegisub/libaegisub.vcxproj @@ -23,7 +23,7 @@ NOMINMAX; - _WIN32_WINNT=0x0501; + _WIN32_WINNT=0x0602; _CRT_NONSTDC_NO_DEPRECATE; WITH_UCHARDET; %(PreprocessorDefinitions) diff --git a/libaegisub/windows/path_win.cpp b/libaegisub/windows/path_win.cpp index 4f164074a..387cf1cdd 100644 --- a/libaegisub/windows/path_win.cpp +++ b/libaegisub/windows/path_win.cpp @@ -25,10 +25,10 @@ #include -namespace { #include #include +namespace { agi::fs::path WinGetFolderPath(int folder) { wchar_t path[MAX_PATH+1] = {0}; if (FAILED(SHGetFolderPathW(0, folder, 0, 0, path))) From 3782b906d7d01357ceca3898d68a5dc20cf17e1f Mon Sep 17 00:00:00 2001 From: wangqr Date: Thu, 8 Nov 2018 10:35:31 -0500 Subject: [PATCH 007/271] Fix travis-ci build script --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 421119d72..a6826bf9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ install: # Can't install these via the apt addon due to the whitelist - sudo apt-get install -y -qq libffms2-dev libwxgtk3.0-dev libuchardet-dev - - sudo pip install cpp-coveralls + - sudo pip install -U cpp-coveralls - sudo luarocks install busted > /dev/null - sudo luarocks install moonscript > /dev/null - sudo luarocks install uuid > /dev/null @@ -49,6 +49,7 @@ install: - cd boost - ./bootstrap.sh - ./b2 -j3 -layout=system threading=multi cxxflags=-std=c++11 link=shared variant=release --without-python --without-iostreams --without-serialization --without-graph --without-log --without-math --without-signals --without-test --without-wave --without-mpi --without-program_options --without-graph_parallel --without-context --without-coroutine --without-random --without-timer --without-date_time + - sudo ./b2 -layout=system threading=multi cxxflags=-std=c++11 link=shared variant=release --without-python --without-iostreams --without-serialization --without-graph --without-log --without-math --without-signals --without-test --without-wave --without-mpi --without-program_options --without-graph_parallel --without-context --without-coroutine --without-random --without-timer --without-date_time install - cd ../.. script: From 42552e5efb98a417bc94ab7573c8f9dcbcb77deb Mon Sep 17 00:00:00 2001 From: wangqr Date: Sun, 9 Dec 2018 03:06:21 -0500 Subject: [PATCH 008/271] Correctly handle memory free using Lua GC Instead of manually free. Otherwise return value of `search' may refer to invalid memory. Fix Aegisub/Aegisub#99 --- automation/include/aegisub/re.moon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/include/aegisub/re.moon b/automation/include/aegisub/re.moon index 681786eb1..28b825da8 100644 --- a/automation/include/aegisub/re.moon +++ b/automation/include/aegisub/re.moon @@ -39,7 +39,7 @@ search = (re, str, start) -> res = regex.search re, str, str\len(), start return unless res != nil first, last = res[0], res[1] - ffi.C.free res + ffi.gc(res, ffi.C.free) first, last replace = (re, replacement, str, max_count) -> From 0a1b93860b5a5ba6613a08e579d8845dcfd5a044 Mon Sep 17 00:00:00 2001 From: scx Date: Sun, 8 Sep 2019 05:57:37 +0200 Subject: [PATCH 009/271] Add AppData file template --- .../desktop/aegisub.appdata.xml.template.in | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 packages/desktop/aegisub.appdata.xml.template.in diff --git a/packages/desktop/aegisub.appdata.xml.template.in b/packages/desktop/aegisub.appdata.xml.template.in new file mode 100644 index 000000000..df5720059 --- /dev/null +++ b/packages/desktop/aegisub.appdata.xml.template.in @@ -0,0 +1,58 @@ + + + aegisub.desktop + CC0-1.0 + BSD-3-Clause AND MIT AND MPL-1.1 + <_name>Aegisub + <_summary>A free, cross-platform open source tool for creating and modifying subtitles + + <_p>Aegisub is a free, cross-platform open source tool for creating and modifying subtitles. Aegisub makes it quick and easy to time subtitles to audio, and features many powerful tools for styling them, including a built-in real-time video preview. + <_p>Aegisub was originally created as a tool to make typesetting, particularly in anime fansubs, a less painful experience. At the time of the start of the project, many other programs that supported the Advanced Substation Alpha format lacked (and in many cases, still lack; development on several competing programs have since been dropped for various reasons completely unrelated to Aegisub) many vital functions, or were too buggy and/or unreliable to be really useful. + <_p>Since then, Aegisub has grown into a fully fledged, highly customizable subtitle editor. It features a lot of convenient tools to help you with timing, typesetting, editing and translating subtitles, as well as a powerful scripting environment called Automation (originally mostly intended for creating karaoke effects, Automation can now be used much else, including creating macros and various other convenient tools). + <_p>Some highlights of Aegisub: +
    + <_li>Simple and intuitive yet powerful interface for editing subtitles + <_li>Support for many formats and character sets + <_li>Powerful video mode + <_li>Visual typesetting tools + <_li>Intuitive and customizable audio timing mode + <_li>Fully scriptable through the Automation module +
+
+ aegisub.desktop + + HiDpiIcon + HighContrast + UserDocs + + + + <_caption>Typesetting + http://static.aegisub.org/img/screenshots/unix/typesetting-efc51b7a.png + + + <_caption>Audio video + http://static.aegisub.org/img/screenshots/unix/audio-video-f1f81fc2.png + + + <_caption>Audio timing + http://static.aegisub.org/img/screenshots/unix/audio-timing-1d8fce7e.png + + + Aegisub Group + https://github.com/Aegisub/Aegisub/issues + http://docs.aegisub.org/manual/FAQ + http://docs.aegisub.org + http://www.aegisub.org + https://sites.google.com/site/rockytdrontransifex/aegisub + + mild + + aegisub + + aegisub + + + + +
From c3a4a9122c1daa3e81da465c8827d687c269ead8 Mon Sep 17 00:00:00 2001 From: scx Date: Sun, 8 Sep 2019 06:02:02 +0200 Subject: [PATCH 010/271] Integrate AppData file with build system --- Makefile.inc.in | 1 + configure.ac | 8 ++++++++ packages/desktop/Makefile | 11 +++++++++++ po/make_pot.sh | 4 ++++ 4 files changed, 24 insertions(+) diff --git a/Makefile.inc.in b/Makefile.inc.in index a8c0e0c48..7a994bb8b 100644 --- a/Makefile.inc.in +++ b/Makefile.inc.in @@ -54,6 +54,7 @@ P_BINDIR = @bindir@ P_DATAROOT = @datarootdir@ P_LOCALE = @localedir@ +P_APPDATA = @P_APPDATA@ P_DESKTOP = @P_DESKTOP@ P_ICON = @P_ICON@ P_DATA = $(P_DATAROOT)/aegisub/ diff --git a/configure.ac b/configure.ac index 58dc23f8d..930ee1489 100644 --- a/configure.ac +++ b/configure.ac @@ -54,6 +54,13 @@ AEGISUB_CATALOG="aegisub" AC_SUBST(AEGISUB_CATALOG) AC_DEFINE_UNQUOTED([AEGISUB_CATALOG], ["${AEGISUB_CATALOG}"], [Name of the Aegisub gettext catalog]) +# Handle location of appdata files: https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#spec-component-location +AC_ARG_WITH(appdata-dir, + AS_HELP_STRING([--with-appdata-dir=PATH],[appdata file locations [PREFIX/share/metainfo]])) + +P_APPDATA=${with_appdata_dir:-$datarootdir/metainfo} +AC_SUBST(P_APPDATA) + # Handle location of desktop files: http://freedesktop.org/wiki/Specifications/desktop-entry-spec AC_ARG_WITH(desktop-dir, AS_HELP_STRING([--with-desktop-dir=PATH],[desktop file locations [PREFIX/share/applications]])) @@ -564,6 +571,7 @@ DEFAULT_PLAYER_AUDIO=${DEFAULT_PLAYER_AUDIO:-NONE} # Files that need substitution. AC_CONFIG_FILES([ packages/desktop/aegisub.desktop.template +packages/desktop/aegisub.appdata.xml.template src/libresrc/default_config_platform.json tools/osx-bundle.sed Makefile.inc diff --git a/packages/desktop/Makefile b/packages/desktop/Makefile index 47a21a63a..b41a91569 100644 --- a/packages/desktop/Makefile +++ b/packages/desktop/Makefile @@ -10,15 +10,26 @@ DESKTOP_FILE_INSTALLED = $(DESTDIR)$(P_DESKTOP)/$(notdir $(DESKTOP_FILE)) DISTCLEANFILES += $(DESKTOP_FILE) +APPDATA_FILE := $(d)aegisub.appdata.xml +APPDATA_FILE_PO := $(d)../../po +APPDATA_FILE_INSTALLED = $(DESTDIR)$(P_APPDATA)/$(notdir $(APPDATA_FILE)) + +DISTCLEANFILES += $(APPDATA_FILE) + %.desktop: %.desktop.template $(DESKTOP_FILE_PO) intltool-merge --quiet --desktop-style $(DESKTOP_FILE_PO) $< $@ +%.appdata.xml: %.appdata.xml.template $(APPDATA_FILE_PO) + intltool-merge --quiet --xml-style $(APPDATA_FILE_PO) $< $@ + $(ICONS_INSTALLED)png: $(d)%.png ; $(MKDIR_INSTALL) $(ICONS_INSTALLED)svg: $(d)%.svg ; $(MKDIR_INSTALL) $(DESKTOP_FILE_INSTALLED): $(DESKTOP_FILE) ; $(MKDIR_INSTALL) +$(APPDATA_FILE_INSTALLED): $(APPDATA_FILE) ; $(MKDIR_INSTALL) ifneq (yes, $(BUILD_DARWIN)) install: \ + $(APPDATA_FILE_INSTALLED) \ $(DESKTOP_FILE_INSTALLED) \ $(patsubst %.png, $(ICONS_INSTALLED)png, $(patsubst %.svg, $(ICONS_INSTALLED)svg, $(notdir $(ICONS)))) endif diff --git a/po/make_pot.sh b/po/make_pot.sh index e05252f28..cea125f78 100755 --- a/po/make_pot.sh +++ b/po/make_pot.sh @@ -46,6 +46,10 @@ do | maybe_append done +for i in 'name' 'summary' 'p' 'li' 'caption'; do + xmlstarlet sel -t -v "//_$i" ../packages/desktop/aegisub.appdata.xml.template.in | jq -R . +done | nl -v0 -w1 -s'|' | sed -re 's/^/aegisub.appdata.xml|/' | maybe_append + grep '^_[A-Za-z0-9]*=.*' ../packages/win_installer/fragment_strings.iss.in | while read line do echo "$line" \ From 7ea2c09afa9ef44f98b399d3d9140359db808e7c Mon Sep 17 00:00:00 2001 From: scx Date: Sun, 8 Sep 2019 06:39:02 +0200 Subject: [PATCH 011/271] make_pot.sh: Check presence of xmlstarlet and jq --- po/make_pot.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/po/make_pot.sh b/po/make_pot.sh index cea125f78..d504152ec 100755 --- a/po/make_pot.sh +++ b/po/make_pot.sh @@ -46,9 +46,11 @@ do | maybe_append done -for i in 'name' 'summary' 'p' 'li' 'caption'; do - xmlstarlet sel -t -v "//_$i" ../packages/desktop/aegisub.appdata.xml.template.in | jq -R . -done | nl -v0 -w1 -s'|' | sed -re 's/^/aegisub.appdata.xml|/' | maybe_append +if which xmlstarlet >/dev/null 2>&1 && which jq >/dev/null 2>&1; then + for i in 'name' 'summary' 'p' 'li' 'caption'; do + xmlstarlet sel -t -v "//_$i" ../packages/desktop/aegisub.appdata.xml.template.in | jq -R . + done | nl -v0 -w1 -s'|' | sed -re 's/^/aegisub.appdata.xml|/' | maybe_append +fi grep '^_[A-Za-z0-9]*=.*' ../packages/win_installer/fragment_strings.iss.in | while read line do From eeb3e17b73b623fd791611275221d4f4cf4a790b Mon Sep 17 00:00:00 2001 From: scx Date: Sun, 8 Sep 2019 00:41:09 +0200 Subject: [PATCH 012/271] Update desktop file - Add Keywords - Add StartupWMClass - Update Categories --- packages/desktop/aegisub.desktop.template.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/desktop/aegisub.desktop.template.in b/packages/desktop/aegisub.desktop.template.in index b11a3e359..517ced410 100644 --- a/packages/desktop/aegisub.desktop.template.in +++ b/packages/desktop/aegisub.desktop.template.in @@ -8,6 +8,8 @@ Exec=@AEGISUB_COMMAND@ %f TryExec=@AEGISUB_COMMAND@ Icon=aegisub Terminal=false -Categories=AudioVideo;AudioVideoEditing; +Categories=AudioVideo;AudioVideoEditing;GTK; +_Keywords=subtitles;subtitle;captions;captioning;video;audio; MimeType=application/x-srt;text/plain;text/x-ass;text/x-microdvd;text/x-ssa; StartupNotify=true +StartupWMClass=aegisub From 0418d0b5be87491806aaa7899223465ca2c5d36e Mon Sep 17 00:00:00 2001 From: scx Date: Sun, 8 Sep 2019 05:15:16 +0200 Subject: [PATCH 013/271] Desktop file: make Keywords translatable --- po/make_pot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/make_pot.sh b/po/make_pot.sh index d504152ec..eccf9a9b1 100755 --- a/po/make_pot.sh +++ b/po/make_pot.sh @@ -39,7 +39,7 @@ find ../automation -name *.lua \ | sed 's/\\/\\\\\\\\/g' \ | maybe_append -for i in 'Name' 'GenericName' 'Comment' +for i in 'Name' 'GenericName' 'Comment' 'Keywords' do grep ^_$i -n ../packages/desktop/aegisub.desktop.template.in \ | sed 's/\([0-9]\+\):[^=]\+=\(.*\)$/aegisub.desktop|\1|"\2"/' \ From cb0af6ca35832e453f4d966a8348ca8caef6a943 Mon Sep 17 00:00:00 2001 From: scx Date: Sat, 7 Sep 2019 23:38:06 +0200 Subject: [PATCH 014/271] Fix crash on right click due to no spell checker See: #131 --- src/spellchecker.cpp | 2 ++ src/subs_edit_ctrl.cpp | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/spellchecker.cpp b/src/spellchecker.cpp index 4e328ab22..3d99d4de1 100644 --- a/src/spellchecker.cpp +++ b/src/spellchecker.cpp @@ -22,10 +22,12 @@ #include #include +#ifdef __APPLE__ namespace agi { class OptionValue; std::unique_ptr CreateCocoaSpellChecker(OptionValue *opt); } +#endif std::unique_ptr SpellCheckerFactory::GetSpellChecker() { #ifdef __APPLE__ diff --git a/src/subs_edit_ctrl.cpp b/src/subs_edit_ctrl.cpp index 4618ea409..46193289b 100644 --- a/src/subs_edit_ctrl.cpp +++ b/src/subs_edit_ctrl.cpp @@ -366,15 +366,16 @@ void SubsTextEditCtrl::OnContextMenu(wxContextMenuEvent &event) { currentWord = line_text.substr(currentWordPos.first, currentWordPos.second); wxMenu menu; - if (spellchecker) + if (spellchecker) { AddSpellCheckerEntries(menu); - // Append language list - menu.Append(-1,_("Spell checker language"), GetLanguagesMenu( - EDIT_MENU_DIC_LANGS, - to_wx(OPT_GET("Tool/Spell Checker/Language")->GetString()), - to_wx(spellchecker->GetLanguageList()))); - menu.AppendSeparator(); + // Append language list + menu.Append(-1, _("Spell checker language"), GetLanguagesMenu( + EDIT_MENU_DIC_LANGS, + to_wx(OPT_GET("Tool/Spell Checker/Language")->GetString()), + to_wx(spellchecker->GetLanguageList()))); + menu.AppendSeparator(); + } AddThesaurusEntries(menu); From 67d9fd9aa4176b367596f8e0885ad974cf8bffeb Mon Sep 17 00:00:00 2001 From: scx Date: Mon, 23 Sep 2019 01:19:56 +0200 Subject: [PATCH 015/271] DataBlockCache: Fix crash in cache invalidation (#142) The original version uses a reverse iterator, whose .base() is invalid after KillMacroBlock() erases it. --- src/block_cache.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/block_cache.h b/src/block_cache.h index 9fcaf42e7..8cc393a06 100644 --- a/src/block_cache.h +++ b/src/block_cache.h @@ -150,8 +150,11 @@ public: } // Remove old entries until we're under the max size - for (auto it = age.rbegin(); size > max_size && it != age.rend(); ) - KillMacroBlock(**it++); + while (size > max_size) { + // When size > 0, age should never be empty + assert(!age.empty()); + KillMacroBlock(**age.rbegin()); + } } /// @brief Obtain a data block from the cache From 0847acc53f2355247e64a65c30a329a4fe679c48 Mon Sep 17 00:00:00 2001 From: scx Date: Sat, 7 Sep 2019 18:51:06 +0200 Subject: [PATCH 016/271] Add missing AM_GNU_GETTEXT_VERSION macro Bug: http://devel.aegisub.org/ticket/1914 --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 930ee1489..98542ea11 100644 --- a/configure.ac +++ b/configure.ac @@ -512,6 +512,7 @@ AC_PCH_FLAG([-fpch-preprocess]) # Internationalisation support ############################## AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION([0.18.1]) ################ # Update checker From 565b7cb86e00017d18ea655a2254fd91882fc237 Mon Sep 17 00:00:00 2001 From: Yakauleu Uladzislau Date: Sun, 30 Jun 2019 15:09:56 +0300 Subject: [PATCH 017/271] Added Belarusian Localization --- po/be.po | 6468 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 6468 insertions(+) create mode 100644 po/be.po diff --git a/po/be.po b/po/be.po new file mode 100644 index 000000000..dfb04414a --- /dev/null +++ b/po/be.po @@ -0,0 +1,6468 @@ +# Aegisub 3.2 +# Copyright (C) 2005-2014 Rodrigo Braz Monteiro, Niels Martin Hansen, Thomas Goyne et. al. +# This file is distributed under the same license as the Aegisub package. +# Niels Martin Hansen , 2005-2014. +# +# Translators: +# Translators: +# Yakauleu Uladzislau , 2019 +# Viktar Lieškievič , 2019 +# +msgid "" +msgstr "" +"Project-Id-Version: Aegisub (unofficial)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-07-01 10:53-0700\n" +"PO-Revision-Date: 2018-09-26 07:39+0000\n" +"Last-Translator: Viktar Lieškievič , 2019\n" +"Language-Team: Belarusian (https://www.transifex.com/byplay/teams/91944/be/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: be\n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" + +#: ../src/dialog_shift_times.cpp:92 +msgid "unsaved" +msgstr "незахаваны" + +#: ../src/dialog_shift_times.cpp:96 +#, c-format +msgid "%s frames" +msgstr "%s кадраў" + +#: ../src/dialog_shift_times.cpp:98 +msgid "backward" +msgstr "назад" + +#: ../src/dialog_shift_times.cpp:98 +msgid "forward" +msgstr "наперад" + +#: ../src/dialog_shift_times.cpp:102 +msgid "s+e" +msgstr "н+к" + +#: ../src/dialog_shift_times.cpp:103 +msgid "s" +msgstr "н" + +#: ../src/dialog_shift_times.cpp:104 +msgid "e" +msgstr "к" + +#: ../src/dialog_shift_times.cpp:111 +msgid "all" +msgstr "усе" + +#: ../src/dialog_shift_times.cpp:113 +#, c-format +msgid "from %d onward" +msgstr "ад %d і далей" + +#: ../src/dialog_shift_times.cpp:115 +msgid "sel " +msgstr "выб. " + +#: ../src/dialog_shift_times.cpp:133 ../src/command/time.cpp:153 +msgid "Shift Times" +msgstr "Часавы зрух" + +#: ../src/dialog_shift_times.cpp:142 +msgid "&Time: " +msgstr "&Час:" + +#: ../src/dialog_shift_times.cpp:143 +msgid "Shift by time" +msgstr "Зрух па часу" + +#: ../src/dialog_shift_times.cpp:146 +msgid "&Frames: " +msgstr "&Кадры:" + +#: ../src/dialog_shift_times.cpp:147 +msgid "Shift by frames" +msgstr "Зрух па кадрах" + +#: ../src/dialog_shift_times.cpp:151 +msgid "Enter time in h:mm:ss.cs notation" +msgstr "Увядзіце час у фармаце г:хх:сс.сс" + +#: ../src/dialog_shift_times.cpp:154 +msgid "Enter number of frames to shift by" +msgstr "Увядзіце колькасць кадраў на зрух" + +#: ../src/dialog_shift_times.cpp:156 +msgid "For&ward" +msgstr "На&перад" + +#: ../src/dialog_shift_times.cpp:157 +msgid "" +"Shifts subs forward, making them appear later. Use if they are appearing too" +" soon." +msgstr "" +"Зрух субтытраў наперад. Выкарыстоўвайце, калі яны паяўляюцца надта рана. " + +#: ../src/dialog_shift_times.cpp:159 +msgid "&Backward" +msgstr "&Назад" + +#: ../src/dialog_shift_times.cpp:160 +msgid "" +"Shifts subs backward, making them appear earlier. Use if they are appearing " +"too late." +msgstr "" +"Зрух субтытраў назад. Выкарыстоўвайце, калі яны паяўляюцца надта позна. " + +#: ../src/dialog_shift_times.cpp:162 +msgid "&All rows" +msgstr "&Усё радкі" + +#: ../src/dialog_shift_times.cpp:162 ../src/dialog_search_replace.cpp:88 +msgid "Selected &rows" +msgstr "Вылучаныя &радкі" + +#: ../src/dialog_shift_times.cpp:162 +msgid "Selection &onward" +msgstr "Вылучанае і &далей" + +#: ../src/dialog_shift_times.cpp:163 +msgid "Affect" +msgstr "Задзейнічаць" + +#: ../src/dialog_shift_times.cpp:165 +msgid "Start a&nd End times" +msgstr "Пачатковы &і канчатковы час" + +#: ../src/dialog_shift_times.cpp:165 +msgid "&Start times only" +msgstr "Толькі &пачатковы час" + +#: ../src/dialog_shift_times.cpp:165 +msgid "&End times only" +msgstr "Толькі &канчатковы час" + +#: ../src/dialog_shift_times.cpp:166 +msgid "Times" +msgstr "Час" + +#: ../src/dialog_shift_times.cpp:170 +msgid "&Clear" +msgstr "&Ачысціць" + +#: ../src/dialog_shift_times.cpp:201 +msgid "Shift by" +msgstr "Зрух на" + +#: ../src/dialog_shift_times.cpp:210 +msgid "Load from history" +msgstr "Загрузка з гісторыі" + +#: ../src/dialog_shift_times.cpp:405 +msgid "shifting" +msgstr "зрух" + +#: ../src/export_fixstyle.cpp:46 +msgid "Fix Styles" +msgstr "Карэкцыя стыляў" + +#: ../src/export_fixstyle.cpp:46 +msgid "" +"Fixes styles by replacing any style that isn't available on file with " +"Default." +msgstr "Карэктуе стылі, замяняя недаступныя стылі ў файле на Default. " + +#: ../src/audio_karaoke.cpp:72 +msgid "Discard all uncommitted splits" +msgstr "Выдаліць усе незахаваныя прамежкі" + +#: ../src/audio_karaoke.cpp:76 +msgid "Commit splits" +msgstr "Захаваць прамежкі" + +#: ../src/audio_karaoke.cpp:239 +msgid "Karaoke tag" +msgstr "Караоке тэг" + +#: ../src/audio_karaoke.cpp:242 +msgid "Change karaoke tag to \\k" +msgstr "Змяніць тэг караоке на \\k" + +#: ../src/audio_karaoke.cpp:243 +msgid "Change karaoke tag to \\kf" +msgstr "Змяніць тэг караоке на \\kf" + +#: ../src/audio_karaoke.cpp:244 +msgid "Change karaoke tag to \\ko" +msgstr "Змяніць тэг караоке на \\ko" + +#: ../src/audio_karaoke.cpp:418 +msgid "karaoke split" +msgstr "караоке прамежкі" + +#: ../src/timeedit_ctrl.cpp:208 ../src/dialog_style_manager.cpp:204 +#: ../src/subs_edit_ctrl.cpp:366 +msgid "&Copy" +msgstr "&Капіяваць" + +#: ../src/timeedit_ctrl.cpp:209 ../src/subs_edit_ctrl.cpp:367 +msgid "&Paste" +msgstr "У&ставіць" + +#: ../src/auto4_base.cpp:460 +#, c-format +msgid "" +"Failed to load Automation script '%s':\n" +"%s" +msgstr "" +"Не атрымалася загрузіць скрыпт аўтаматызацыі '%s':\n" +"%s" + +#: ../src/auto4_base.cpp:467 +#, c-format +msgid "The file was not recognised as an Automation script: %s" +msgstr "Файл не вызначаны як скрыпт аўтаматызацыі: %s" + +#: ../src/auto4_base.cpp:496 ../src/command/timecode.cpp:74 +#: ../src/command/timecode.cpp:94 ../src/command/video.cpp:568 +#: ../src/command/audio.cpp:84 ../src/command/keyframe.cpp:74 +msgid "All Files" +msgstr "Усе файлы" + +#: ../src/auto4_base.cpp:502 ../src/command/timecode.cpp:74 +#: ../src/command/timecode.cpp:94 ../src/command/keyframe.cpp:74 +#: ../src/subtitle_format.cpp:312 +msgid "All Supported Formats" +msgstr "Усе фарматы, якія падтрымліваюцца" + +#: ../src/auto4_base.cpp:508 +msgid "File was not recognized as a script" +msgstr "Файл не распазнаны як скрыпт" + +#: ../src/search_replace_engine.cpp:247 ../src/search_replace_engine.cpp:331 +msgid "replace" +msgstr "замяніць" + +#: ../src/search_replace_engine.cpp:332 +#, c-format +msgid "One match was replaced." +msgid_plural "%d matches were replaced." +msgstr[0] "Адно супадзенне заменена." +msgstr[1] "%dсупадзенні заменена." +msgstr[2] "%dсупадзенняў заменена." +msgstr[3] "%d супадзенняў заменена." + +#: ../src/search_replace_engine.cpp:335 +msgid "No matches found." +msgstr "Супадзенні не знойдзены." + +#: ../src/visual_tool_drag.cpp:56 +msgid "Toggle between \\move and \\pos" +msgstr "Пераключэнне між \\move і \\pos" + +#: ../src/visual_tool_drag.cpp:326 ../src/visual_tool_cross.cpp:62 +msgid "positioning" +msgstr "размяшчэнне" + +#: ../src/font_file_lister_fontconfig.cpp:80 +msgid "Updating font cache\n" +msgstr "Абнаўленне кэшу шрыфтоў\n" + +#: ../src/subtitle_format_ebu3264.cpp:408 +#, c-format +msgid "Line over maximum length: %s" +msgstr "Радок перавышае максімальную даўжыню: %s" + +#: ../src/dialog_video_details.cpp:44 +msgid "Video Details" +msgstr "Звесткі пра відэа" + +#: ../src/dialog_video_details.cpp:58 +msgid "File name:" +msgstr "Імя файла:" + +#: ../src/dialog_video_details.cpp:59 +msgid "FPS:" +msgstr "Кадр/сек:" + +#: ../src/dialog_video_details.cpp:60 +msgid "Resolution:" +msgstr "Разрозненне:" + +#: ../src/dialog_video_details.cpp:61 +msgid "Length:" +msgstr "Працягласць:" + +#: ../src/dialog_video_details.cpp:61 +#, c-format +msgid "1 frame" +msgid_plural "%d frames (%s)" +msgstr[0] "1 кадр" +msgstr[1] "%d кадры (%s)" +msgstr[2] "%d кадраў (%s)" +msgstr[3] "%d кадраў (%s)" + +#: ../src/dialog_video_details.cpp:63 +msgid "Decoder:" +msgstr "Дэкодар:" + +#: ../src/dialog_video_details.cpp:65 ../src/preferences.cpp:165 +#: ../src/preferences.cpp:417 +msgid "Video" +msgstr "Відэа" + +#: ../src/dialog_timing_processor.cpp:139 ../src/command/tool.cpp:189 +msgid "Timing Post-Processor" +msgstr "Пост-апрацоўка таймінгу" + +#: ../src/dialog_timing_processor.cpp:157 +msgid "Apply to styles" +msgstr "Дастасаваць да стыляў" + +#: ../src/dialog_timing_processor.cpp:159 +msgid "Select styles to process. Unchecked ones will be ignored." +msgstr "Выбраць стылі для апрацоўкі. Непазначаныя ігнаруюцца. " + +#: ../src/dialog_timing_processor.cpp:161 ../src/dialog_paste_over.cpp:88 +msgid "&All" +msgstr "&Усе" + +#: ../src/dialog_timing_processor.cpp:162 +msgid "Select all styles" +msgstr "Выбраць усе стылі" + +#: ../src/dialog_timing_processor.cpp:164 ../src/dialog_paste_over.cpp:90 +msgid "&None" +msgstr "&Ніводны" + +#: ../src/dialog_timing_processor.cpp:165 +msgid "Deselect all styles" +msgstr "Скасаваць выбраныя стылі" + +#: ../src/dialog_timing_processor.cpp:168 ../src/command/app.cpp:207 +#: ../src/dialog_properties.cpp:138 ../src/preferences.cpp:127 +#: ../src/preferences.cpp:167 +msgid "Options" +msgstr "Параметры" + +#: ../src/dialog_timing_processor.cpp:169 +msgid "Affect &selection only" +msgstr "Дастасаваць &толькі да вылучаных радкоў" + +#: ../src/dialog_timing_processor.cpp:174 +msgid "Lead-in/Lead-out" +msgstr "Уступ/Канчатак" + +#: ../src/dialog_timing_processor.cpp:176 +msgid "Add lead &in:" +msgstr "Дадаць &уступ:" + +#: ../src/dialog_timing_processor.cpp:178 +msgid "Enable adding of lead-ins to lines" +msgstr "Уключыць дадаванне ўступа да радкоў" + +#: ../src/dialog_timing_processor.cpp:179 +msgid "Lead in to be added, in milliseconds" +msgstr "Уступ у мілісекундах" + +#: ../src/dialog_timing_processor.cpp:181 +msgid "Add lead &out:" +msgstr "Дадаць &канчатак:" + +#: ../src/dialog_timing_processor.cpp:183 +msgid "Enable adding of lead-outs to lines" +msgstr "Уключыць дадаванне канчатка да радкоў" + +#: ../src/dialog_timing_processor.cpp:184 +msgid "Lead out to be added, in milliseconds" +msgstr "Канчатак у мілісекундах" + +#: ../src/dialog_timing_processor.cpp:189 +msgid "Make adjacent subtitles continuous" +msgstr "Зрабіць прылеглыя субтытры бесперапынымі" + +#: ../src/dialog_timing_processor.cpp:190 +msgid "&Enable" +msgstr "&Уключыць" + +#: ../src/dialog_timing_processor.cpp:192 +msgid "" +"Enable snapping of subtitles together if they are within a certain distance " +"of each other" +msgstr "" +"Уключыць прывязванне субтытраў адзін да аднаго, калі яны ў межах пэўнай " +"адлегласці." + +#: ../src/dialog_timing_processor.cpp:195 +msgid "Max gap:" +msgstr "Максімальны прамежак:" + +#: ../src/dialog_timing_processor.cpp:196 +msgid "" +"Maximum difference between start and end time for two subtitles to be made " +"continuous, in milliseconds" +msgstr "" +"Максімальная розніца паміж пачаткам і канцом двух субтытраў, якія будуць " +"ісці бесперапынна, у мілісекундах" + +#: ../src/dialog_timing_processor.cpp:197 +msgid "Max overlap:" +msgstr "Максімальнае накладанне:" + +#: ../src/dialog_timing_processor.cpp:198 +msgid "" +"Maximum overlap between the end and start time for two subtitles to be made " +"continuous, in milliseconds" +msgstr "" +"Максімальнае накладанне паміж канцом і пачаткам двух субтытраў, якія будуць " +"ісці бесперапынна, у мілісекундах" + +#: ../src/dialog_timing_processor.cpp:201 +msgid "" +"Sets how to set the adjoining of lines. If set totally to left, it will " +"extend or shrink start time of the second line; if totally to right, it will" +" extend or shrink the end time of the first line." +msgstr "" +"Задае пазіцыю паміж двух радкоў, да якіх будуць зададзены канец папярэдняга " +"і пачатак наступнага. Крайняя левая пазіцыя азначае, што будзе зададзены " +"толькі пачатак толькі пачатак другога радка, крайняя правая — толькі канец " +"першага." + +#: ../src/dialog_timing_processor.cpp:204 +msgid "Bias: Start <- " +msgstr "Зрушэнне: Пач <- " + +#: ../src/dialog_timing_processor.cpp:206 +msgid " -> End" +msgstr " -> Кан" + +#: ../src/dialog_timing_processor.cpp:214 +msgid "Keyframe snapping" +msgstr "Прывязванне да ключкадраў" + +#: ../src/dialog_timing_processor.cpp:217 +msgid "E&nable" +msgstr "У&ключыць" + +#: ../src/dialog_timing_processor.cpp:218 +msgid "" +"Enable snapping of subtitles to nearest keyframe, if distance is within " +"threshold" +msgstr "" +"Уключыць прывязванне субтытраў да бліжэйшага ключкадра, калі адлегасць менш " +"за парогаваю" + +#: ../src/dialog_timing_processor.cpp:229 +msgid "Starts before thres.:" +msgstr "Парог да пачатку:" + +#: ../src/dialog_timing_processor.cpp:230 +msgid "" +"Threshold for 'before start' distance, that is, how many milliseconds a " +"subtitle must start before a keyframe to snap to it" +msgstr "" +"Парогавая колькасць кадраў паміж пачаткам субтытра і найбліжэйшым ключкадрам" +" злева, пры якім час пачатку субтытра будзе ссунуты да гэтага ключкадра." + +#: ../src/dialog_timing_processor.cpp:232 +msgid "Starts after thres.:" +msgstr "Парог пасля пачатку:" + +#: ../src/dialog_timing_processor.cpp:233 +msgid "" +"Threshold for 'after start' distance, that is, how many milliseconds a " +"subtitle must start after a keyframe to snap to it" +msgstr "" +"Парогавая колькасць кадраў паміж пачаткам субтытра і найбліжэйшым ключкадрам" +" справа, пры якім час пачатку субтытра будзе ссунуты да гэтага ключкадра." + +#: ../src/dialog_timing_processor.cpp:237 +msgid "Ends before thres.:" +msgstr "Парог да канца:" + +#: ../src/dialog_timing_processor.cpp:238 +msgid "" +"Threshold for 'before end' distance, that is, how many milliseconds a " +"subtitle must end before a keyframe to snap to it" +msgstr "" +"Парогавая колькасць кадраў паміж канцом субтытра і найбліжэйшым ключкадрам " +"справа, пры якім час канца субтытра будзе ссунуты да гэтага ключкадра" + +#: ../src/dialog_timing_processor.cpp:240 +msgid "Ends after thres.:" +msgstr "Парог пасля канца:" + +#: ../src/dialog_timing_processor.cpp:241 +msgid "" +"Threshold for 'after end' distance, that is, how many milliseconds a " +"subtitle must end after a keyframe to snap to it" +msgstr "" +"Парогавая колькасць кадраў паміж канцом субтытра і найбліжэйшым ключкадрам " +"злева, пры якім час канца субтытра будзе ссунуты да гэтага ключкадра" + +#: ../src/dialog_timing_processor.cpp:349 +#, c-format +msgid "One of the lines in the file (%i) has negative duration. Aborting." +msgstr "Адзін з радкоў у файле (%i) мае адмоўную працягласць. Перапыненне." + +#: ../src/dialog_timing_processor.cpp:350 +msgid "Invalid script" +msgstr "Недапушчальны скрыпт" + +#: ../src/dialog_timing_processor.cpp:445 +msgid "timing processor" +msgstr "пост-апрацоўку таймінгу" + +#: ../src/mkv_wrap.cpp:213 +msgid "Choose which track to read:" +msgstr "Абярыце які трэк чытаць:" + +#: ../src/mkv_wrap.cpp:213 +msgid "Multiple subtitle tracks found" +msgstr "Выяўлена некалькі трэкаў" + +#: ../src/mkv_wrap.cpp:251 +msgid "Parsing Matroska" +msgstr "Аналіз Matroska" + +#: ../src/mkv_wrap.cpp:251 +msgid "Reading subtitles from Matroska file." +msgstr "Счытванне субтытраў з файла Matroska. " + +#: ../src/dialog_styling_assistant.cpp:55 ../src/command/tool.cpp:123 +msgid "Styling Assistant" +msgstr "Памочнік стыляў" + +#: ../src/dialog_styling_assistant.cpp:65 +#: ../src/dialog_styling_assistant.cpp:66 +msgid "Current line" +msgstr "Бягучы радок" + +#: ../src/dialog_styling_assistant.cpp:72 +msgid "Styles available" +msgstr "Даступныя стылі" + +#: ../src/dialog_styling_assistant.cpp:80 +msgid "Set style" +msgstr "Задаць" + +#: ../src/dialog_styling_assistant.cpp:87 ../src/dialog_translation.cpp:108 +msgid "Keys" +msgstr "Клавішы" + +#: ../src/dialog_styling_assistant.cpp:90 ../src/command/tool.cpp:142 +#: ../src/command/tool.cpp:226 ../src/dialog_translation.cpp:111 +msgid "Accept changes" +msgstr "Ужыць змены" + +#: ../src/dialog_styling_assistant.cpp:91 ../src/command/tool.cpp:153 +#: ../src/command/tool.cpp:237 ../src/dialog_translation.cpp:112 +msgid "Preview changes" +msgstr "Перадпрагляд змен" + +#: ../src/dialog_styling_assistant.cpp:92 ../src/dialog_translation.cpp:113 +msgid "Previous line" +msgstr "Папярэдні радок" + +#: ../src/dialog_styling_assistant.cpp:93 ../src/dialog_translation.cpp:114 +msgid "Next line" +msgstr "Наступны радок" + +#: ../src/dialog_styling_assistant.cpp:94 ../src/dialog_translation.cpp:116 +msgid "Play video" +msgstr "Прайграць відэа" + +#: ../src/dialog_styling_assistant.cpp:95 ../src/dialog_translation.cpp:117 +msgid "Play audio" +msgstr "Прайграць аўдыя" + +#: ../src/dialog_styling_assistant.cpp:96 +msgid "Click on list" +msgstr "Клік на спіс" + +#: ../src/dialog_styling_assistant.cpp:97 +msgid "Select style" +msgstr "Выбраць стыль" + +#: ../src/dialog_styling_assistant.cpp:101 +msgid "&Seek video to line start time" +msgstr "&Перамотваць відэа да пачатку радка" + +#: ../src/dialog_styling_assistant.cpp:110 ../src/dialog_translation.cpp:129 +msgid "Actions" +msgstr "Дзеянні" + +#: ../src/dialog_styling_assistant.cpp:113 ../src/dialog_translation.cpp:131 +msgid "Play &Audio" +msgstr "Прайграць &аўдыя" + +#: ../src/dialog_styling_assistant.cpp:117 ../src/dialog_translation.cpp:136 +msgid "Play &Video" +msgstr "Прайграць &відэа" + +#: ../src/dialog_styling_assistant.cpp:175 +msgid "styling assistant" +msgstr "памочнік стыляў" + +#: ../src/audio_timing_karaoke.cpp:241 +msgid "karaoke timing" +msgstr "таймінг караоке" + +#: ../src/dialog_jumpto.cpp:66 ../src/command/video.cpp:523 +msgid "Jump to" +msgstr "Перайсці да" + +#: ../src/dialog_jumpto.cpp:72 +msgid "Frame: " +msgstr "Кадр:" + +#: ../src/dialog_jumpto.cpp:73 +msgid "Time: " +msgstr "Час:" + +#: ../src/dialog_style_manager.cpp:188 +msgid "Move style up" +msgstr "Перамясціць стыль вышэй" + +#: ../src/dialog_style_manager.cpp:189 +msgid "Move style down" +msgstr "Перамясціць стыль ніжэй" + +#: ../src/dialog_style_manager.cpp:190 +msgid "Move style to top" +msgstr "Перамясціць стыль да верху" + +#: ../src/dialog_style_manager.cpp:191 +msgid "Move style to bottom" +msgstr "Перамясціць стыль да нізу" + +#: ../src/dialog_style_manager.cpp:192 +msgid "Sort styles alphabetically" +msgstr "Сартаваць стылі па алфавіту" + +#: ../src/dialog_style_manager.cpp:202 ../src/preferences.cpp:578 +msgid "&New" +msgstr "&Новы" + +#: ../src/dialog_style_manager.cpp:203 ../src/preferences.cpp:579 +msgid "&Edit" +msgstr "&Праўка" + +#: ../src/dialog_style_manager.cpp:205 ../src/preferences.cpp:580 +#: ../src/dialog_attachments.cpp:79 +msgid "&Delete" +msgstr "&Выдаліць" + +#: ../src/dialog_style_manager.cpp:218 +#, c-format +msgid "%s - Copy" +msgstr "%s - Капіяваць" + +#: ../src/dialog_style_manager.cpp:220 +#, c-format +msgid "%s - Copy (%d)" +msgstr "%s - Капіяваць (%d)" + +#: ../src/dialog_style_manager.cpp:243 +msgid "Could not parse style" +msgstr "Немагчыма прачытаць стыль" + +#: ../src/dialog_style_manager.cpp:248 +#, c-format +msgid "Are you sure you want to delete this style?" +msgid_plural "Are you sure you want to delete these %d styles?" +msgstr[0] "Вы ўпэўнены, што хочаце выдаліць гэты стыль?" +msgstr[1] "Вы ўпэўнены, што хочаце выдаліць гэтыя %d стылі?" +msgstr[2] "Вы ўпэўнены, што хочаце выдаліць гэтыя %d стыляў?" +msgstr[3] "Вы ўпэўнены, што хочаце выдаліць гэтыя %d стыляў?" + +#: ../src/dialog_style_manager.cpp:259 ../src/command/tool.cpp:165 +msgid "Styles Manager" +msgstr "Менеджар стыляў" + +#: ../src/dialog_style_manager.cpp:273 +msgid "Catalog of available storages" +msgstr "Каталог даступных сховішчаў" + +#: ../src/dialog_style_manager.cpp:275 +msgid "New" +msgstr "Стварыць" + +#: ../src/dialog_style_manager.cpp:276 +msgid "Delete" +msgstr "Выдаліць" + +#: ../src/dialog_style_manager.cpp:282 +msgid "Copy to ¤t script ->" +msgstr "Капіяваць у &бягучы скрыпт субтытраў ->" + +#: ../src/dialog_style_manager.cpp:289 +msgid "Storage" +msgstr "Сховішча" + +#: ../src/dialog_style_manager.cpp:295 +msgid "&Import from script..." +msgstr "&Імпарт са скрыпта..." + +#: ../src/dialog_style_manager.cpp:296 +msgid "<- Copy to &storage" +msgstr "<- Капіяваць у &сховішча" + +#: ../src/dialog_style_manager.cpp:307 +msgid "Current script" +msgstr "Бягучы скрыпт" + +#: ../src/dialog_style_manager.cpp:314 ../src/dialog_progress.cpp:179 +msgid "Close" +msgstr "Закрыць" + +#: ../src/dialog_style_manager.cpp:454 +msgid "New storage name:" +msgstr "Назва новага сховішча:" + +#: ../src/dialog_style_manager.cpp:454 +msgid "New catalog entry" +msgstr "Новы запіс у каталогу" + +#: ../src/dialog_style_manager.cpp:469 +msgid "A catalog with that name already exists." +msgstr "Сховішча з такой назвай ужо існуе." + +#: ../src/dialog_style_manager.cpp:469 +msgid "Catalog name conflict" +msgstr "Канфлікт назваў каталогу" + +#: ../src/dialog_style_manager.cpp:476 +#, c-format +msgid "" +"The specified catalog name contains one or more illegal characters. They have been replaced with underscores instead.\n" +"The catalog has been renamed to \"%s\"." +msgstr "" +"Дадзеная назва каталогу ўтрымлівае адзін або некалькі недапушчальных сімвалаў. Яны былі заменены на падкрэсліванні.\n" +"Каталог быў перайменаваны ў «%s»." + +#: ../src/dialog_style_manager.cpp:477 +msgid "Invalid characters" +msgstr "Забароненыя сімвалы" + +#: ../src/dialog_style_manager.cpp:490 +#, c-format +msgid "Are you sure you want to delete the storage \"%s\" from the catalog?" +msgstr "Вы ўпэўнены, што хочаце выдаліць сховішча «%s» з каталогу?" + +#: ../src/dialog_style_manager.cpp:491 +msgid "Confirm delete" +msgstr "Пацвярджэнне выдалення" + +#: ../src/dialog_style_manager.cpp:509 +#, c-format +msgid "" +"There is already a style with the name \"%s\" in the current storage. " +"Overwrite?" +msgstr "У гэтым сховішчы ўжо існуе стыль пад назвай «%s». Абнавіць яго?" + +#: ../src/dialog_style_manager.cpp:509 ../src/dialog_style_manager.cpp:536 +#: ../src/dialog_style_manager.cpp:714 +msgid "Style name collision" +msgstr "Канфлікт назваў стыляў" + +#: ../src/dialog_style_manager.cpp:536 ../src/dialog_style_manager.cpp:713 +#, c-format +msgid "" +"There is already a style with the name \"%s\" in the current script. " +"Overwrite?" +msgstr "" +"У гэтым скрыпце субтытраў ужо існуе стыль пад назвай «%s». Абнавіць яго?" + +#: ../src/dialog_style_manager.cpp:547 +msgid "style copy" +msgstr "Капіяванне стылю" + +#: ../src/dialog_style_manager.cpp:576 +msgid "style paste" +msgstr "устаўку стылю" + +#: ../src/dialog_style_manager.cpp:620 +msgid "Confirm delete from storage" +msgstr "Пацвярджэнне выдалення са сховішча" + +#: ../src/dialog_style_manager.cpp:659 +msgid "Confirm delete from current" +msgstr "Пацвярджэнне выдалення з бягучага файла субтытраў" + +#: ../src/dialog_style_manager.cpp:663 +msgid "style delete" +msgstr "выдаленне стылю" + +#: ../src/dialog_style_manager.cpp:668 ../src/command/subtitle.cpp:240 +#: ../src/command/subtitle.cpp:270 +msgid "Open subtitles file" +msgstr "Адкрыць файл субтытраў" + +#: ../src/dialog_style_manager.cpp:698 +msgid "The selected file has no available styles." +msgstr "У выбраным файле няма даступных стыляў." + +#: ../src/dialog_style_manager.cpp:698 +msgid "Error Importing Styles" +msgstr "Памылка імпарту стыляў" + +#: ../src/dialog_style_manager.cpp:704 +msgid "Choose styles to import:" +msgstr "Выбраць стылі для імпарту:" + +#: ../src/dialog_style_manager.cpp:704 +msgid "Import Styles" +msgstr "Імпарт стыляў" + +#: ../src/dialog_style_manager.cpp:730 +msgid "style import" +msgstr "імпорт стыляў" + +#: ../src/dialog_style_manager.cpp:839 +msgid "Are you sure? This cannot be undone!" +msgstr "Вы ўпэўнены? Гэта нельга будзе адмяніць!" + +#: ../src/dialog_style_manager.cpp:839 +msgid "Sort styles" +msgstr "Сартаванне стыляў" + +#: ../src/dialog_style_manager.cpp:880 +msgid "style move" +msgstr "перамяшчэнне стылю" + +#: ../src/command/timecode.cpp:52 ../src/command/timecode.cpp:53 +msgid "Close Timecodes File" +msgstr "Закрыць файл таймкодаў" + +#: ../src/command/timecode.cpp:54 +msgid "Close the currently open timecodes file" +msgstr "Закрыць бягучы адкрыты файл таймкодаў" + +#: ../src/command/timecode.cpp:69 +msgid "Open Timecodes File..." +msgstr "Адкрыць файл таймкодаў..." + +#: ../src/command/timecode.cpp:70 ../src/command/timecode.cpp:75 +msgid "Open Timecodes File" +msgstr "Адкрыць файл таймкодаў" + +#: ../src/command/timecode.cpp:71 +msgid "Open a VFR timecodes v1 or v2 file" +msgstr "Адкрыць файл таймкодаў у фармаце v1 або v2" + +#: ../src/command/timecode.cpp:84 +msgid "Save Timecodes File..." +msgstr "Захаваць файл таймкодаў..." + +#: ../src/command/timecode.cpp:85 ../src/command/timecode.cpp:95 +msgid "Save Timecodes File" +msgstr "Захаваць файл таймкодаў" + +#: ../src/command/timecode.cpp:86 +msgid "Save a VFR timecodes v2 file" +msgstr "Захаваць файл таймкодаў у фармаце v2" + +#: ../src/command/command.cpp:31 +#, c-format +msgid "'%s' is not a valid command name" +msgstr "'%s' — недапушчальнае імя каманды" + +#: ../src/command/video.cpp:84 +msgid "&Cinematic (2.35)" +msgstr "&Кінематаграфічны (2.35)" + +#: ../src/command/video.cpp:85 +msgid "Cinematic (2.35)" +msgstr "Кінематаграфічны (2.35)" + +#: ../src/command/video.cpp:86 +msgid "Force video to 2.35 aspect ratio" +msgstr "Прымусова задаць суадносіны 2.35" + +#: ../src/command/video.cpp:102 +msgid "C&ustom..." +msgstr "А&сабістае..." + +#: ../src/command/video.cpp:103 +msgid "Custom" +msgstr "Асабістае" + +#: ../src/command/video.cpp:104 +msgid "Force video to a custom aspect ratio" +msgstr "Прымусова задаць свае суадносіны бакоў" + +#: ../src/command/video.cpp:115 +msgid "" +"Enter aspect ratio in either:\n" +" decimal (e.g. 2.35)\n" +" fractional (e.g. 16:9)\n" +" specific resolution (e.g. 853x480)" +msgstr "" +"Увядзіце суадносіны бакоў:\n" +" дзесятковы фармат (напрыклад 2.35)\n" +" дробавы фармат (напрыклад 16:9)\n" +" дакладнае разрозненне (напрыклад 853х480)" + +#: ../src/command/video.cpp:116 +msgid "Enter aspect ratio" +msgstr "Задаць суадносіны бакоў" + +#: ../src/command/video.cpp:135 +msgid "Invalid value! Aspect ratio must be between 0.5 and 5.0." +msgstr "Памылковае значэнне! Суадносіны бакоў павінны быць паміж 0.5 і 5.0." + +#: ../src/command/video.cpp:135 +msgid "Invalid Aspect Ratio" +msgstr "Памылковыя суадносіны бакоў" + +#: ../src/command/video.cpp:145 +msgid "&Default" +msgstr "Па &змаўчанні" + +#: ../src/command/video.cpp:146 ../src/ass_style.cpp:194 +msgid "Default" +msgstr "Па змаўчанні" + +#: ../src/command/video.cpp:147 +msgid "Use video's original aspect ratio" +msgstr "Выкарыстоўваць суадносіны бакоў па змаўчанні" + +#: ../src/command/video.cpp:163 +msgid "&Fullscreen (4:3)" +msgstr "&Паўнаэкранны (4:3)" + +#: ../src/command/video.cpp:164 +msgid "Fullscreen (4:3)" +msgstr "Паўнаэкранны (4:3)" + +#: ../src/command/video.cpp:165 +msgid "Force video to 4:3 aspect ratio" +msgstr "Прымусова задаць суадносіны 4:3" + +#: ../src/command/video.cpp:181 +msgid "&Widescreen (16:9)" +msgstr "&Шырокаэкарны (16:9)" + +#: ../src/command/video.cpp:182 +msgid "Widescreen (16:9)" +msgstr "Шырокаэкранны (16:9)" + +#: ../src/command/video.cpp:183 +msgid "Force video to 16:9 aspect ratio" +msgstr "Прымусова задаць суадносіны 16:9" + +#: ../src/command/video.cpp:200 +msgid "&Close Video" +msgstr "&Закрыць відэа" + +#: ../src/command/video.cpp:201 +msgid "Close Video" +msgstr "Закрыць відэа" + +#: ../src/command/video.cpp:202 +msgid "Close the currently open video file" +msgstr "Закрыць бягучы адкрыты відэафайл" + +#: ../src/command/video.cpp:211 ../src/command/video.cpp:212 +msgid "Copy coordinates to Clipboard" +msgstr "Капіяваць каардынаты ў буфер абмену" + +#: ../src/command/video.cpp:213 +msgid "" +"Copy the current coordinates of the mouse over the video to the clipboard" +msgstr "Капіяваць у буфер абмену бягучыя кардынаты мышу адносна відэа" + +#: ../src/command/video.cpp:222 ../src/command/video.cpp:223 +msgid "Cycle active subtitles provider" +msgstr "Пераключыць правайдара аўдыя" + +#: ../src/command/video.cpp:224 +msgid "Cycle through the available subtitles providers" +msgstr "Цыклічна пераключацца паміж даступнымі правайдарамі аўдыя" + +#: ../src/command/video.cpp:235 +#, c-format +msgid "Subtitles provider set to %s" +msgstr "Зададзены правайдар субтытраў %s" + +#: ../src/command/video.cpp:242 +msgid "&Detach Video" +msgstr "&Адлучыць відэа" + +#: ../src/command/video.cpp:243 +msgid "Detach Video" +msgstr "Адлучыць відэа" + +#: ../src/command/video.cpp:244 +msgid "" +"Detach the video display from the main window, displaying it in a separate " +"Window" +msgstr "Адлучыць відэа ад галоўнага акна і паказвваць яго ў асобным акне" + +#: ../src/command/video.cpp:262 +msgid "Show &Video Details" +msgstr "Звесткі пра &відэа" + +#: ../src/command/video.cpp:263 +msgid "Show Video Details" +msgstr "Звесткі пра відэа" + +#: ../src/command/video.cpp:264 +msgid "Show video details" +msgstr "Звесткі пра відэа" + +#: ../src/command/video.cpp:274 ../src/command/video.cpp:275 +msgid "Toggle video slider focus" +msgstr "Пераключыць фокус на паўзунок відэа" + +#: ../src/command/video.cpp:276 +msgid "" +"Toggle focus between the video slider and the previous thing to have focus" +msgstr "Пераключыць фокус на паўзунок відэа з папярэдняга актыўнага элемента" + +#: ../src/command/video.cpp:297 ../src/command/video.cpp:298 +msgid "Copy image to Clipboard" +msgstr "Капіяваць кадр у буферу абмену" + +#: ../src/command/video.cpp:299 +msgid "Copy the currently displayed frame to the clipboard" +msgstr "Скапіяваць бягучы кадр у буфер абмену" + +#: ../src/command/video.cpp:308 ../src/command/video.cpp:309 +msgid "Copy image to Clipboard (no subtitles)" +msgstr "Капіяваць кадр у буфер абмену (без субтытраў)" + +#: ../src/command/video.cpp:310 +msgid "" +"Copy the currently displayed frame to the clipboard, without the subtitles" +msgstr "Капіяваць бягучы кадр, які паказваецца без субтытраў у буфер абмену" + +#: ../src/command/video.cpp:319 ../src/command/video.cpp:320 +msgid "Next Frame" +msgstr "Наступны кадр" + +#: ../src/command/video.cpp:321 +msgid "Seek to the next frame" +msgstr "Перайсці на наступны кадр" + +#: ../src/command/video.cpp:330 ../src/command/video.cpp:331 +msgid "Next Boundary" +msgstr "Наступная мяжа" + +#: ../src/command/video.cpp:332 +msgid "Seek to the next beginning or end of a subtitle" +msgstr "Перайсці да наступнага пачатку або канца субтытраў" + +#: ../src/command/video.cpp:359 ../src/command/video.cpp:360 +msgid "Next Keyframe" +msgstr "Наступны ключкадр" + +#: ../src/command/video.cpp:361 +msgid "Seek to the next keyframe" +msgstr "Перайсці на наступны ключкадр" + +#: ../src/command/video.cpp:373 ../src/command/video.cpp:374 +#: ../src/command/video.cpp:375 +msgid "Fast jump forward" +msgstr "Хуткі пераход наперад" + +#: ../src/command/video.cpp:386 ../src/command/video.cpp:387 +msgid "Previous Frame" +msgstr "Папярэдні кадр" + +#: ../src/command/video.cpp:388 +msgid "Seek to the previous frame" +msgstr "Перайсці на папярэдні кадр" + +#: ../src/command/video.cpp:397 ../src/command/video.cpp:398 +msgid "Previous Boundary" +msgstr "Папярэдняя мяжа" + +#: ../src/command/video.cpp:399 +msgid "Seek to the previous beginning or end of a subtitle" +msgstr "Перайсці да папярэдняга пачатку або канца субтытраў" + +#: ../src/command/video.cpp:426 ../src/command/video.cpp:427 +msgid "Previous Keyframe" +msgstr "Папярэдні ключкадр" + +#: ../src/command/video.cpp:428 +msgid "Seek to the previous keyframe" +msgstr "Перайсці да папярэдняга ключкадра" + +#: ../src/command/video.cpp:448 ../src/command/video.cpp:449 +#: ../src/command/video.cpp:450 +msgid "Fast jump backwards" +msgstr "Хуткі пераход назад" + +#: ../src/command/video.cpp:499 ../src/command/video.cpp:500 +msgid "Save PNG snapshot" +msgstr "Захаваць кадр як PNG" + +#: ../src/command/video.cpp:501 +msgid "" +"Save the currently displayed frame to a PNG file in the video's directory" +msgstr "Захаваць бягучы кадр ў PNG-файл у папку з відэа" + +#: ../src/command/video.cpp:510 ../src/command/video.cpp:511 +msgid "Save PNG snapshot (no subtitles)" +msgstr "Захаваць PNG-здымак (без субтытраў)" + +#: ../src/command/video.cpp:512 +msgid "" +"Save the currently displayed frame without the subtitles to a PNG file in " +"the video's directory" +msgstr "Захаваць бягучы кадр без субтытраў ў PNG-файл у папцы з відэа" + +#: ../src/command/video.cpp:522 +msgid "&Jump to..." +msgstr "&Перайсці да..." + +#: ../src/command/video.cpp:524 +msgid "Jump to frame or time" +msgstr "Перайсці да кадра або часу" + +#: ../src/command/video.cpp:536 +msgid "Jump Video to &End" +msgstr "Перамотка відэа да &канца" + +#: ../src/command/video.cpp:537 +msgid "Jump Video to End" +msgstr "Перамотка відэа да канца" + +#: ../src/command/video.cpp:538 +msgid "Jump the video to the end frame of current subtitle" +msgstr "Перамотка відэа да канчатковага кадра бягучага радка" + +#: ../src/command/video.cpp:549 +msgid "Jump Video to &Start" +msgstr "Перамотка відэа да &пачатка" + +#: ../src/command/video.cpp:550 +msgid "Jump Video to Start" +msgstr "Перамотка відэа да пачатка" + +#: ../src/command/video.cpp:551 +msgid "Jump the video to the start frame of current subtitle" +msgstr "Перамотка відэа да пачатковага кадра бягучага радка" + +#: ../src/command/video.cpp:562 +msgid "&Open Video..." +msgstr "&Адкрыць відэа..." + +#: ../src/command/video.cpp:563 +msgid "Open Video" +msgstr "Адкрыць відэа" + +#: ../src/command/video.cpp:564 +msgid "Open a video file" +msgstr "Адкрыць відэафайл" + +#: ../src/command/video.cpp:567 ../src/command/audio.cpp:83 +msgid "Video Formats" +msgstr "Фарматы відэа" + +#: ../src/command/video.cpp:569 +msgid "Open video file" +msgstr "Адкрыць відэафайл" + +#: ../src/command/video.cpp:578 +msgid "&Use Dummy Video..." +msgstr "Выкарыстоўваць &пустое відэа" + +#: ../src/command/video.cpp:579 +msgid "Use Dummy Video" +msgstr "Выкарыстоўваць пустое відэа" + +#: ../src/command/video.cpp:580 +msgid "Open a placeholder video clip with solid color" +msgstr "Адкрыць запаўняльнае відэа з суцэльным колерам" + +#: ../src/command/video.cpp:592 ../src/command/video.cpp:593 +msgid "Toggle autoscroll of video" +msgstr "Уключыць аўтапрагортку відэа" + +#: ../src/command/video.cpp:594 +msgid "Toggle automatically seeking video to the start time of selected lines" +msgstr "" +"Уключыць аўтаматычную перамотку відэа да часу пачатку вылучаных радкоў" + +#: ../src/command/video.cpp:609 ../src/command/video.cpp:610 +msgid "Play" +msgstr "Прайграць" + +#: ../src/command/video.cpp:611 +msgid "Play video starting on this position" +msgstr "Прайграць відэа з бягучай пазіцыі" + +#: ../src/command/video.cpp:621 ../src/command/video.cpp:622 +msgid "Play line" +msgstr "Прайграць радок" + +#: ../src/command/video.cpp:623 ../src/command/audio.cpp:260 +#: ../src/command/audio.cpp:261 +msgid "Play current line" +msgstr "Прайграць бягучы радок" + +#: ../src/command/video.cpp:632 +msgid "Show &Overscan Mask" +msgstr "Паказваць межы &адсячэння" + +#: ../src/command/video.cpp:633 +msgid "Show Overscan Mask" +msgstr "Паказваць межы адсячэння" + +#: ../src/command/video.cpp:634 +msgid "" +"Show a mask over the video, indicating areas that might get cropped off by " +"overscan on televisions" +msgstr "" +"Паказваць маску паверх відэа для паказу вобласцяў, якія могуць быць абрэзаны" +" рамкай экрана тэлевізара" + +#: ../src/command/video.cpp:650 +msgid "&100%" +msgstr "&100%" + +#: ../src/command/video.cpp:651 +msgid "100%" +msgstr "100%" + +#: ../src/command/video.cpp:652 +msgid "Set zoom to 100%" +msgstr "Задаць маштаб у 100%" + +#: ../src/command/video.cpp:669 ../src/command/video.cpp:670 +msgid "Stop video" +msgstr "Спыніць відэа" + +#: ../src/command/video.cpp:671 +msgid "Stop video playback" +msgstr "Паставіць відэа на паўзу" + +#: ../src/command/video.cpp:681 +msgid "&200%" +msgstr "&200%" + +#: ../src/command/video.cpp:682 +msgid "200%" +msgstr "200%" + +#: ../src/command/video.cpp:683 +msgid "Set zoom to 200%" +msgstr "Задаць маштаб у 200%" + +#: ../src/command/video.cpp:699 +msgid "&50%" +msgstr "&50%" + +#: ../src/command/video.cpp:700 +msgid "50%" +msgstr "50%" + +#: ../src/command/video.cpp:701 +msgid "Set zoom to 50%" +msgstr "Задаць маштаб у 50%" + +#: ../src/command/video.cpp:717 ../src/command/video.cpp:718 +msgid "Zoom In" +msgstr "Павялічыць" + +#: ../src/command/video.cpp:719 +msgid "Zoom video in" +msgstr "Павялічыць маштаб відэа" + +#: ../src/command/video.cpp:729 ../src/command/video.cpp:730 +msgid "Zoom Out" +msgstr "Паменшыць" + +#: ../src/command/video.cpp:731 +msgid "Zoom video out" +msgstr "Паменшыць маштаб відэа" + +#: ../src/command/edit.cpp:131 ../src/command/edit.cpp:831 +msgid "paste" +msgstr "уставіць" + +#: ../src/command/edit.cpp:369 +msgid "set color" +msgstr "задаць колер" + +#: ../src/command/edit.cpp:383 +msgid "Primary Color..." +msgstr "Першасны колер..." + +#: ../src/command/edit.cpp:384 +msgid "Primary Color" +msgstr "Першасны колер" + +#: ../src/command/edit.cpp:385 +msgid "Set the primary fill color (\\c) at the cursor position" +msgstr "" +"Задаць першасны колер заліўкі (\\c) для тэксту пасля бягучай пазіцыі курсора" + +#: ../src/command/edit.cpp:395 +msgid "Secondary Color..." +msgstr "Другасны колер..." + +#: ../src/command/edit.cpp:396 +msgid "Secondary Color" +msgstr "Другасны колер" + +#: ../src/command/edit.cpp:397 +msgid "Set the secondary (karaoke) fill color (\\2c) at the cursor position" +msgstr "" +"Задаць другасны (караоке) колер заліўкі (\\2c) для тэксту пасля бягучай " +"пазіцыі курсора" + +#: ../src/command/edit.cpp:407 +msgid "Outline Color..." +msgstr "Колер контуру..." + +#: ../src/command/edit.cpp:408 +msgid "Outline Color" +msgstr "Колер контуру" + +#: ../src/command/edit.cpp:409 +msgid "Set the outline color (\\3c) at the cursor position" +msgstr "Задаць колер контуру (\\3c) для тэксту пасля бягучай пазіцыі курсора" + +#: ../src/command/edit.cpp:419 +msgid "Shadow Color..." +msgstr "Колер ценю..." + +#: ../src/command/edit.cpp:420 +msgid "Shadow Color" +msgstr "Колер ценю" + +#: ../src/command/edit.cpp:421 +msgid "Set the shadow color (\\4c) at the cursor position" +msgstr "Задаць колер ценю (\\4c) для тэксту пасля бягучай пазіцыі курсора" + +#: ../src/command/edit.cpp:431 ../src/command/edit.cpp:432 +msgid "Toggle Bold" +msgstr "Зрабіць тоўстым" + +#: ../src/command/edit.cpp:433 +msgid "" +"Toggle bold (\\b) for the current selection or at the current cursor " +"position" +msgstr "" +"Зрабіць тоўстым (\\b) бягучае вылучэнне або тэкст пасля бягучай пазіцыі " +"курсора" + +#: ../src/command/edit.cpp:436 +msgid "toggle bold" +msgstr "змена таўшчыні" + +#: ../src/command/edit.cpp:443 ../src/command/edit.cpp:444 +msgid "Toggle Italics" +msgstr "Зрабіць курсівам" + +#: ../src/command/edit.cpp:445 +msgid "" +"Toggle italics (\\i) for the current selection or at the current cursor " +"position" +msgstr "" +"Зрабіць курсівам (\\i) бягучае вылучэнне або тэкст пасля бягучай пазіцыі " +"курсора" + +#: ../src/command/edit.cpp:448 +msgid "toggle italic" +msgstr "змена курсіва" + +#: ../src/command/edit.cpp:455 ../src/command/edit.cpp:456 +msgid "Toggle Underline" +msgstr "Зрабіць падкрэсленым" + +#: ../src/command/edit.cpp:457 +msgid "" +"Toggle underline (\\u) for the current selection or at the current cursor " +"position" +msgstr "" +"Зрабіць падкрэсленым (\\u) бягучае вылучэнне або тэкст пасля бягучай пазіцыі" +" курсора" + +#: ../src/command/edit.cpp:460 +msgid "toggle underline" +msgstr "змена падкрэслівання" + +#: ../src/command/edit.cpp:467 ../src/command/edit.cpp:468 +msgid "Toggle Strikeout" +msgstr "Зрабіць перакрэсленым" + +#: ../src/command/edit.cpp:469 +msgid "" +"Toggle strikeout (\\s) for the current selection or at the current cursor " +"position" +msgstr "" +"Зрабіць перакрэсленым (\\s) бягучае вылучэнне або тэкст пасля бягучай " +"пазіцыі курсора" + +#: ../src/command/edit.cpp:472 +msgid "toggle strikeout" +msgstr "змена закрэслівання" + +#: ../src/command/edit.cpp:479 +msgid "Font Face..." +msgstr "Шрыфт..." + +#: ../src/command/edit.cpp:480 ../src/preferences_base.cpp:251 +msgid "Font Face" +msgstr "Назва шрыфта" + +#: ../src/command/edit.cpp:481 +msgid "Select a font face and size" +msgstr "Выбраць шрыфт і памер" + +#: ../src/command/edit.cpp:508 +msgid "set font" +msgstr "задаць шрыфт" + +#: ../src/command/edit.cpp:535 +msgid "Find and R&eplace..." +msgstr "Знайсці і з&амяніць" + +#: ../src/command/edit.cpp:536 +msgid "Find and Replace" +msgstr "Знайсці і замяніць" + +#: ../src/command/edit.cpp:537 +msgid "Find and replace words in subtitles" +msgstr "Знайсці і замяніць словы ў субтытрах" + +#: ../src/command/edit.cpp:598 +msgid "&Copy Lines" +msgstr "&Капіяваць радкі" + +#: ../src/command/edit.cpp:599 +msgid "Copy Lines" +msgstr "Капіяваць радкі" + +#: ../src/command/edit.cpp:600 +msgid "Copy subtitles to the clipboard" +msgstr "Капіяваць субтытры ў буфер абмену" + +#: ../src/command/edit.cpp:621 +msgid "Cu&t Lines" +msgstr "&Выразаць радкі" + +#: ../src/command/edit.cpp:622 +msgid "Cut Lines" +msgstr "Выразаць радкі" + +#: ../src/command/edit.cpp:623 +msgid "Cut subtitles" +msgstr "Выразаць субтытры" + +#: ../src/command/edit.cpp:630 +msgid "cut lines" +msgstr "выразаць радкі" + +#: ../src/command/edit.cpp:638 +msgid "De&lete Lines" +msgstr "&Выдаліць радкі" + +#: ../src/command/edit.cpp:639 +msgid "Delete Lines" +msgstr "Выдаліць радкі" + +#: ../src/command/edit.cpp:640 +msgid "Delete currently selected lines" +msgstr "Выдаляе вылучаныя радкі" + +#: ../src/command/edit.cpp:643 +msgid "delete lines" +msgstr "выдаліць радкі" + +#: ../src/command/edit.cpp:708 ../src/command/edit.cpp:1093 +msgid "split" +msgstr "прамежак" + +#: ../src/command/edit.cpp:708 +msgid "duplicate lines" +msgstr "дубліраванне радкоў" + +#: ../src/command/edit.cpp:715 +msgid "&Duplicate Lines" +msgstr "&Дубліраваць радкі" + +#: ../src/command/edit.cpp:716 +msgid "Duplicate Lines" +msgstr "Дубліраваць радкі" + +#: ../src/command/edit.cpp:717 +msgid "Duplicate the selected lines" +msgstr "Дубліруе вылучаныя радкі" + +#: ../src/command/edit.cpp:726 ../src/command/edit.cpp:727 +msgid "Split lines after current frame" +msgstr "Разбіць радкі пасля бягучага кадра" + +#: ../src/command/edit.cpp:728 +msgid "" +"Split the current line into a line which ends on the current frame and a " +"line which starts on the next frame" +msgstr "" +"Разбіць бягучы радок два, дзе першы заканчваецца на бягучым кадры, другі " +"пачынаецца на наступным кадры." + +#: ../src/command/edit.cpp:738 ../src/command/edit.cpp:739 +msgid "Split lines before current frame" +msgstr "Разбіць радкі перад бягучым кадрам" + +#: ../src/command/edit.cpp:740 +msgid "" +"Split the current line into a line which ends on the previous frame and a " +"line which starts on the current frame" +msgstr "" +"Разбіць бягучы радок два, дзе першы заканчваецца на папярэднім кадры, другі " +"пачынаецца на бягучым кадры." + +#: ../src/command/edit.cpp:775 +msgid "As &Karaoke" +msgstr "Як караоке" + +#: ../src/command/edit.cpp:776 +msgid "As Karaoke" +msgstr "Як караоке" + +#: ../src/command/edit.cpp:777 +msgid "Join selected lines in a single one, as karaoke" +msgstr "Аб'яднаць вылучаныя радкі ў адзін, як караоке" + +#: ../src/command/edit.cpp:780 +msgid "join as karaoke" +msgstr "аб'ядноўвае як караоке" + +#: ../src/command/edit.cpp:786 +msgid "&Concatenate" +msgstr "&Аб'яднаць" + +#: ../src/command/edit.cpp:787 +msgid "Concatenate" +msgstr "Аб'яднаць" + +#: ../src/command/edit.cpp:788 +msgid "Join selected lines in a single one, concatenating text together" +msgstr "Аб'яднаць вылучаныя радкі ў адзін, счапіўшы тэкст ўсіх радкоў" + +#: ../src/command/edit.cpp:791 ../src/command/edit.cpp:802 +msgid "join lines" +msgstr "аб'яднаць радкі" + +#: ../src/command/edit.cpp:797 +msgid "Keep &First" +msgstr "Захаваць &першае" + +#: ../src/command/edit.cpp:798 +msgid "Keep First" +msgstr "Захаваць першае" + +#: ../src/command/edit.cpp:799 +msgid "" +"Join selected lines in a single one, keeping text of first and discarding " +"remaining" +msgstr "" +"Аб'яднаць вылучаныя радкі ў адзін, пакінуўшы тэкст першага радка і выдаліўшы" +" тэкст астатніх" + +#: ../src/command/edit.cpp:840 +msgid "&Paste Lines" +msgstr "&Уставіць радкі" + +#: ../src/command/edit.cpp:841 +msgid "Paste Lines" +msgstr "Уставіць радкі" + +#: ../src/command/edit.cpp:842 +msgid "Paste subtitles" +msgstr "Устаўляе субтытры" + +#: ../src/command/edit.cpp:871 +msgid "Paste Lines &Over..." +msgstr "Уставіць &паверх радкоў..." + +#: ../src/command/edit.cpp:872 +msgid "Paste Lines Over" +msgstr "Уставіць паверх радкоў" + +#: ../src/command/edit.cpp:873 +msgid "Paste subtitles over others" +msgstr "Устаўляе субтытры паверх іншых" + +#: ../src/command/edit.cpp:956 +msgid "Recom&bine Lines" +msgstr "&Рэкамбінаваць радкі" + +#: ../src/command/edit.cpp:957 +msgid "Recombine Lines" +msgstr "Рэкамбінаваць радкі" + +#: ../src/command/edit.cpp:958 +msgid "Recombine subtitles which have been split and merged" +msgstr "Рэкамбінаваць субтытры, якія былі разбіты і аб'яднаны" + +#: ../src/command/edit.cpp:1028 +msgid "combining" +msgstr "камбінаванне" + +#: ../src/command/edit.cpp:1034 ../src/command/edit.cpp:1035 +msgid "Split Lines (by karaoke)" +msgstr "Разбіць радкі (па тэгах караоке)" + +#: ../src/command/edit.cpp:1036 +msgid "Use karaoke timing to split line into multiple smaller lines" +msgstr "" +"Выкарыстоўваць таймінг караоке каб разбіць радок на некалькі меншых радкоў" + +#: ../src/command/edit.cpp:1070 +msgid "splitting" +msgstr "прамежак" + +#: ../src/command/edit.cpp:1098 ../src/command/edit.cpp:1099 +#: ../src/subs_edit_ctrl.cpp:375 +msgid "Split at cursor (estimate times)" +msgstr "Разбіць па курсору (пералічыць час)" + +#: ../src/command/edit.cpp:1100 +msgid "" +"Split the current line at the cursor, dividing the original line's duration " +"between the new ones" +msgstr "" +"Разбіць бягучы радок па курсору, раздзяліўшы зыходную працягласць паміж " +"новымі радкамі" + +#: ../src/command/edit.cpp:1114 ../src/command/edit.cpp:1115 +#: ../src/subs_edit_ctrl.cpp:374 +msgid "Split at cursor (preserve times)" +msgstr "Разбіць па курсору (пакінуць час)" + +#: ../src/command/edit.cpp:1116 +msgid "" +"Split the current line at the cursor, setting both lines to the original " +"line's times" +msgstr "" +"Разбіць бягучы радок па курсору, задаўшы новым радкам зыходны час радка" + +#: ../src/command/edit.cpp:1125 ../src/command/edit.cpp:1126 +msgid "Split at cursor (at video frame)" +msgstr "Разбіць па курсору (па відэакадру)" + +#: ../src/command/edit.cpp:1127 +msgid "" +"Split the current line at the cursor, dividing the line's duration at the " +"current video frame" +msgstr "" +"Разбіць бягучы радок па курсору, раздзяліўшы працягласць радка па бягучаму " +"відэакадру" + +#: ../src/command/edit.cpp:1143 +msgid "Redo last undone action" +msgstr "Паўтарыць апошняе адмененае дзеянне" + +#: ../src/command/edit.cpp:1148 +msgid "Nothing to &redo" +msgstr "Няма чаго &паўтарыць" + +#: ../src/command/edit.cpp:1149 +#, c-format +msgid "&Redo %s" +msgstr "&Паўтарыць %s" + +#: ../src/command/edit.cpp:1153 +msgid "Nothing to redo" +msgstr "Няма чаго паўтарыць" + +#: ../src/command/edit.cpp:1154 +#, c-format +msgid "Redo %s" +msgstr "Паўтарыць %s" + +#: ../src/command/edit.cpp:1169 +msgid "Undo last action" +msgstr "Адмяніць апошняе дзеянне" + +#: ../src/command/edit.cpp:1174 +msgid "Nothing to &undo" +msgstr "Няма чаго &адмяніць" + +#: ../src/command/edit.cpp:1175 +#, c-format +msgid "&Undo %s" +msgstr "&Адмяніць %s" + +#: ../src/command/edit.cpp:1179 +msgid "Nothing to undo" +msgstr "Няма чаго адмяніць" + +#: ../src/command/edit.cpp:1180 +#, c-format +msgid "Undo %s" +msgstr "Скасаваць %s" + +#: ../src/command/edit.cpp:1194 ../src/command/edit.cpp:1195 +msgid "Revert" +msgstr "Вярнуць" + +#: ../src/command/edit.cpp:1196 +msgid "" +"Revert the active line to its initial state (shown in the upper editor)" +msgstr "Вяртае актыўны радок у пачатковы стан (паказаны ў верхнім рэдактары)" + +#: ../src/command/edit.cpp:1201 +msgid "revert line" +msgstr "вярнуць радок" + +#: ../src/command/edit.cpp:1207 ../src/command/edit.cpp:1208 +#: ../src/preferences.cpp:389 +msgid "Clear" +msgstr "Ачысціць" + +#: ../src/command/edit.cpp:1209 +msgid "Clear the current line's text" +msgstr "Ачысціць тэкст бягучага радка" + +#: ../src/command/edit.cpp:1214 ../src/command/edit.cpp:1233 +msgid "clear line" +msgstr "ачысціць радок" + +#: ../src/command/edit.cpp:1221 ../src/command/edit.cpp:1222 +msgid "Clear Text" +msgstr "Ачысціць тэкст" + +#: ../src/command/edit.cpp:1223 +msgid "Clear the current line's text, leaving override tags" +msgstr "Ачысціць тэкст бягучага радка, пакінуўшы тэгі" + +#: ../src/command/edit.cpp:1239 ../src/command/edit.cpp:1240 +#: ../src/command/tool.cpp:271 +msgid "Insert Original" +msgstr "Уставіць арыгінал" + +#: ../src/command/edit.cpp:1241 +msgid "Insert the original line text at the cursor" +msgstr "Уставіць зыходны тэкст радка пасля бягучай пазіцыі курсора" + +#: ../src/command/edit.cpp:1249 +msgid "insert original" +msgstr "Уставіць арыгінал" + +#: ../src/command/recent.cpp:43 ../src/command/recent.cpp:44 +#: ../src/command/recent.cpp:45 ../src/command/recent.cpp:46 +#: ../src/command/recent.cpp:47 ../src/command/recent.cpp:51 +#: ../src/command/recent.cpp:52 ../src/command/recent.cpp:62 +#: ../src/command/recent.cpp:63 ../src/command/recent.cpp:73 +#: ../src/command/recent.cpp:74 ../src/command/recent.cpp:85 +#: ../src/command/recent.cpp:86 ../src/command/recent.cpp:96 +#: ../src/command/recent.cpp:97 +msgid "Recent" +msgstr "Нядаўнія" + +#: ../src/command/recent.cpp:43 ../src/command/recent.cpp:53 +msgid "Open recent audio" +msgstr "Адкрыць нядаўняе аўдыя" + +#: ../src/command/recent.cpp:44 ../src/command/recent.cpp:64 +msgid "Open recent keyframes" +msgstr "Адкрыць нядаўнія ключкадры" + +#: ../src/command/recent.cpp:45 ../src/command/recent.cpp:75 +msgid "Open recent subtitles" +msgstr "Адкрыць нядаўнія субтытры" + +#: ../src/command/recent.cpp:46 ../src/command/recent.cpp:87 +msgid "Open recent timecodes" +msgstr "Адкрыць нядаўні файл таймкодаў" + +#: ../src/command/recent.cpp:47 +msgid "Open recent video" +msgstr "Адкрыць нядаўняе відэа" + +#: ../src/command/recent.cpp:98 +msgid "Open recent videos" +msgstr "Адкрыць нядаўнія відэа" + +#: ../src/command/subtitle.cpp:78 +msgid "A&ttachments..." +msgstr "&Далучэнні..." + +#: ../src/command/subtitle.cpp:79 +msgid "Attachments" +msgstr "Далучэнні..." + +#: ../src/command/subtitle.cpp:80 +msgid "Open the attachment manager dialog" +msgstr "Адкрыць спіс далучэнняў" + +#: ../src/command/subtitle.cpp:91 +msgid "&Find..." +msgstr "&Знайсці..." + +#: ../src/command/subtitle.cpp:92 ../src/dialog_search_replace.cpp:46 +msgid "Find" +msgstr "Знайсці" + +#: ../src/command/subtitle.cpp:93 +msgid "Search for text in the subtitles" +msgstr "Пошук тэксту ў субтытрах" + +#: ../src/command/subtitle.cpp:104 +msgid "Find &Next" +msgstr "Знайсці далей" + +#: ../src/command/subtitle.cpp:105 +msgid "Find Next" +msgstr "Знайсці далей" + +#: ../src/command/subtitle.cpp:106 +msgid "Find next match of last search" +msgstr "Знайсці наступнае супадзенне з апошнім пошукавым запытам" + +#: ../src/command/subtitle.cpp:126 ../src/command/subtitle.cpp:160 +#: ../src/command/subtitle.cpp:202 ../src/command/grid.cpp:82 +msgid "line insertion" +msgstr "устаўку радкоў" + +#: ../src/command/subtitle.cpp:133 +msgid "&After Current" +msgstr "&Пасля бягучага" + +#: ../src/command/subtitle.cpp:134 +msgid "After Current" +msgstr "Пасля бягучага" + +#: ../src/command/subtitle.cpp:135 +msgid "Insert a new line after the current one" +msgstr "Уставіць радок пасля бягучага" + +#: ../src/command/subtitle.cpp:167 ../src/command/subtitle.cpp:168 +msgid "After Current, at Video Time" +msgstr "Пасля бягучага, па часу відэа" + +#: ../src/command/subtitle.cpp:169 +msgid "Insert a new line after the current one, starting at video time" +msgstr "Уставіць радок пасля бягучага па часу відэа" + +#: ../src/command/subtitle.cpp:178 +msgid "&Before Current" +msgstr "&Перад бягучым" + +#: ../src/command/subtitle.cpp:179 +msgid "Before Current" +msgstr "Перад бягучым" + +#: ../src/command/subtitle.cpp:180 +msgid "Insert a new line before the current one" +msgstr "Уставіць новы радок перад бягучым" + +#: ../src/command/subtitle.cpp:209 ../src/command/subtitle.cpp:210 +msgid "Before Current, at Video Time" +msgstr "Перад бягучым, па часу відэа" + +#: ../src/command/subtitle.cpp:211 +msgid "Insert a new line before the current one, starting at video time" +msgstr "Уставіць радок перад бягучым па часу відэа" + +#: ../src/command/subtitle.cpp:221 +msgid "&New Subtitles" +msgstr "&Новыя субтытры" + +#: ../src/command/subtitle.cpp:222 +msgid "New Subtitles" +msgstr "Новыя субтытры" + +#: ../src/command/subtitle.cpp:223 +msgid "New subtitles" +msgstr "Новыя субтытры" + +#: ../src/command/subtitle.cpp:234 +msgid "&Open Subtitles..." +msgstr "&Адкрыць субтытры..." + +#: ../src/command/subtitle.cpp:235 +msgid "Open Subtitles" +msgstr "Адкрыць субтытры" + +#: ../src/command/subtitle.cpp:236 +msgid "Open a subtitles file" +msgstr "Адкрыць файл субтытраў" + +#: ../src/command/subtitle.cpp:248 +msgid "Open A&utosaved Subtitles..." +msgstr "Адкрыць аўтазахаваныя субтытры..." + +#: ../src/command/subtitle.cpp:249 +msgid "Open Autosaved Subtitles" +msgstr "Адкрыць аўтазахаваныя субтытры" + +#: ../src/command/subtitle.cpp:250 +msgid "Open a previous version of a file which was autosaved by Aegisub" +msgstr "Адкрыць аўтазахаваную папярэднюю версію файла" + +#: ../src/command/subtitle.cpp:263 +msgid "Open Subtitles with &Charset..." +msgstr "Адкрыць файл субтытраў у &кадзіроўцы..." + +#: ../src/command/subtitle.cpp:264 +msgid "Open Subtitles with Charset" +msgstr "Адкрыць файл субтытраў у кадзіроўцы" + +#: ../src/command/subtitle.cpp:265 +msgid "Open a subtitles file with a specific file encoding" +msgstr "Адкрыць файл субтытраў у зададзенай кадзіроўцы" + +#: ../src/command/subtitle.cpp:273 +msgid "Choose charset code:" +msgstr "Выбраць кадзіроўку відэа:" + +#: ../src/command/subtitle.cpp:273 +msgid "Charset" +msgstr "Кадзіроўка" + +#: ../src/command/subtitle.cpp:282 +msgid "Open Subtitles from &Video" +msgstr "Адкрыць субтытры з &відэа" + +#: ../src/command/subtitle.cpp:283 +msgid "Open Subtitles from Video" +msgstr "Адкрыць субтытры з відэа" + +#: ../src/command/subtitle.cpp:284 +msgid "Open the subtitles from the current video file" +msgstr "Адкрыць субтытры з бягучага відэафайла" + +#: ../src/command/subtitle.cpp:300 +msgid "&Properties..." +msgstr "&Уласцівасці..." + +#: ../src/command/subtitle.cpp:301 +msgid "Properties" +msgstr "Уласцівасці" + +#: ../src/command/subtitle.cpp:302 +msgid "Open script properties window" +msgstr "Адкрыць акно ўласцівасцяў скрыпта" + +#: ../src/command/subtitle.cpp:313 +msgid "Save subtitles file" +msgstr "Захаваць файл субтытраў" + +#: ../src/command/subtitle.cpp:333 +msgid "&Save Subtitles" +msgstr "&Захаваць субтытры" + +#: ../src/command/subtitle.cpp:334 +msgid "Save Subtitles" +msgstr "Захаваць субтытры" + +#: ../src/command/subtitle.cpp:335 +msgid "Save the current subtitles" +msgstr "Захаваць бягучыя субтытры" + +#: ../src/command/subtitle.cpp:350 +msgid "Save Subtitles &as..." +msgstr "Захаваць субтытры &як..." + +#: ../src/command/subtitle.cpp:351 +msgid "Save Subtitles as" +msgstr "Захаваць субтытры як" + +#: ../src/command/subtitle.cpp:352 +msgid "Save subtitles with another name" +msgstr "Захаваць субтытры пад іншай назвай" + +#: ../src/command/subtitle.cpp:361 ../src/dialog_selected_choices.cpp:26 +#: ../src/subs_edit_ctrl.cpp:369 ../src/dialog_export.cpp:125 +msgid "Select &All" +msgstr "Вылучыць &усе" + +#: ../src/command/subtitle.cpp:362 +msgid "Select All" +msgstr "Вылучыць усе" + +#: ../src/command/subtitle.cpp:363 +msgid "Select all dialogue lines" +msgstr "Вылучыць усе дыялогавыя радкі" + +#: ../src/command/subtitle.cpp:375 ../src/command/subtitle.cpp:376 +msgid "Select Visible" +msgstr "Вылучыць бачныя" + +#: ../src/command/subtitle.cpp:377 +msgid "Select all dialogue lines that are visible on the current video frame" +msgstr "Вылучыць усе дыялогавыя радкі, якія бачныя на бягучым кадры відэа" + +#: ../src/command/subtitle.cpp:407 +msgid "Spell &Checker..." +msgstr "Праверка &арфаграфіі..." + +#: ../src/command/subtitle.cpp:408 ../src/dialog_spellchecker.cpp:103 +msgid "Spell Checker" +msgstr "Праверка арфаграфіі" + +#: ../src/command/subtitle.cpp:409 +msgid "Open spell checker" +msgstr "Адкрыць праверку арфаграфіі" + +#: ../src/command/tool.cpp:58 +msgid "ASSDraw3..." +msgstr "ASSDraw3..." + +#: ../src/command/tool.cpp:59 +msgid "ASSDraw3" +msgstr "ASSDraw3" + +#: ../src/command/tool.cpp:60 +msgid "Launch the ASSDraw3 tool for vector drawing" +msgstr "Адкрыць ASSDraw3 - праграму для вектарнага рысавання " + +#: ../src/command/tool.cpp:70 +msgid "&Export Subtitles..." +msgstr "&Экспартаваць субтытры..." + +#: ../src/command/tool.cpp:71 +msgid "Export Subtitles" +msgstr "Экспартаваць субтытры" + +#: ../src/command/tool.cpp:72 +msgid "" +"Save a copy of subtitles in a different format or with processing applied to" +" it" +msgstr "" +"Захаваць копію субтытраў, перад гэтым апрацаваўшы або канвертаваўшы іх у " +"іншы фармат" + +#: ../src/command/tool.cpp:83 +msgid "&Fonts Collector..." +msgstr "&Зборшчык шрыфтоў..." + +#: ../src/command/tool.cpp:84 ../src/dialog_fonts_collector.cpp:218 +msgid "Fonts Collector" +msgstr "Зборшчык шрыфтоў" + +#: ../src/command/tool.cpp:85 +msgid "Open fonts collector" +msgstr "Адкрыць зборшчык шрыфтоў" + +#: ../src/command/tool.cpp:95 +msgid "S&elect Lines..." +msgstr "&Выбраць радкі..." + +#: ../src/command/tool.cpp:96 +msgid "Select Lines" +msgstr "Вылучыць радкі" + +#: ../src/command/tool.cpp:97 +msgid "Select lines based on defined criteria" +msgstr "Вылучыць радкі на аснове вызначаных крытэрыяў" + +#: ../src/command/tool.cpp:107 +msgid "&Resample Resolution..." +msgstr "&Пералічыць разрозненне..." + +#: ../src/command/tool.cpp:108 ../src/dialog_resample.cpp:90 +msgid "Resample Resolution" +msgstr "Пералічыць разрозненне" + +#: ../src/command/tool.cpp:109 +msgid "" +"Resample subtitles to maintain their current appearance at a different " +"script resolution" +msgstr "" +"Пералічыць скрыпт субтытраў для падтрымкі бягучага знешняга выгляду ў іншым " +"разрозненні" + +#: ../src/command/tool.cpp:122 +msgid "St&yling Assistant..." +msgstr "&Памочнік стыляў..." + +#: ../src/command/tool.cpp:124 +msgid "Open styling assistant" +msgstr "Адкрыць памочнік стыляў" + +#: ../src/command/tool.cpp:141 ../src/command/tool.cpp:225 +msgid "&Accept changes" +msgstr "&Прыняць змены" + +#: ../src/command/tool.cpp:143 ../src/command/tool.cpp:227 +msgid "Commit changes and move to the next line" +msgstr "Захаваць змены і перайсці да наступнага радка" + +#: ../src/command/tool.cpp:152 ../src/command/tool.cpp:236 +msgid "&Preview changes" +msgstr "&Прагляд змен" + +#: ../src/command/tool.cpp:154 ../src/command/tool.cpp:238 +msgid "Commit changes and stay on the current line" +msgstr "Захаваць змены і застацца на бягучым радку" + +#: ../src/command/tool.cpp:164 +msgid "&Styles Manager..." +msgstr "Менеджар &стыляў..." + +#: ../src/command/tool.cpp:166 +msgid "Open the styles manager" +msgstr "Адкрыць менеджар стыляў" + +#: ../src/command/tool.cpp:176 +msgid "&Kanji Timer..." +msgstr "&Таймер кандзі" + +#: ../src/command/tool.cpp:177 +msgid "Kanji Timer" +msgstr "Таймер кандзі" + +#: ../src/command/tool.cpp:178 +msgid "Open the Kanji timer copier" +msgstr "Адкрыць таймер кандзі" + +#: ../src/command/tool.cpp:188 +msgid "&Timing Post-Processor..." +msgstr "Пост-&апрацоўка таймінгу..." + +#: ../src/command/tool.cpp:190 +msgid "" +"Post-process the subtitle timing to add lead-ins and lead-outs, snap timing " +"to scene changes, etc." +msgstr "" +"Пост-апрацоўка таймінгу субтытраў: даданне ўступаў і канчаткаў, прывязванне " +"таймінгу да змен сцэны і г.д." + +#: ../src/command/tool.cpp:200 +msgid "&Translation Assistant..." +msgstr "Памочнік &перакладу..." + +#: ../src/command/tool.cpp:201 ../src/dialog_translation.cpp:64 +msgid "Translation Assistant" +msgstr "Памочнік перакладу" + +#: ../src/command/tool.cpp:202 +msgid "Open translation assistant" +msgstr "Адкрыць памочнік перакладу" + +#: ../src/command/tool.cpp:210 +msgid "There is nothing to translate in the file." +msgstr "У гэтым файле няма чаго перакладаць" + +#: ../src/command/tool.cpp:247 +msgid "&Next Line" +msgstr "&Наступны радок" + +#: ../src/command/tool.cpp:248 ../src/command/grid.cpp:51 +#: ../src/command/grid.cpp:52 ../src/command/grid.cpp:63 +#: ../src/command/grid.cpp:64 ../src/command/time.cpp:354 +#: ../src/command/time.cpp:355 +msgid "Next Line" +msgstr "Наступны радок" + +#: ../src/command/tool.cpp:249 +msgid "Move to the next line without committing changes" +msgstr "Перайсці да наступнага радка без захавання" + +#: ../src/command/tool.cpp:258 +msgid "&Previous Line" +msgstr "&Папярэдні радок" + +#: ../src/command/tool.cpp:259 ../src/command/grid.cpp:90 +#: ../src/command/grid.cpp:91 ../src/command/time.cpp:366 +#: ../src/command/time.cpp:367 +msgid "Previous Line" +msgstr "Папярэдні радок" + +#: ../src/command/tool.cpp:260 +msgid "Move to the previous line without committing changes" +msgstr "Перайсці да папярэдняга радка без захавання" + +#: ../src/command/tool.cpp:270 +msgid "&Insert Original" +msgstr "&Уставіць арыгінал" + +#: ../src/command/tool.cpp:272 +msgid "Insert the untranslated text" +msgstr "Уставіць неперакладзены тэкст" + +#: ../src/command/app.cpp:58 +msgid "&About" +msgstr "&Аб праграме" + +#: ../src/command/app.cpp:59 +msgid "About" +msgstr "Аб праграме" + +#: ../src/command/app.cpp:60 ../src/dialog_about.cpp:44 +msgid "About Aegisub" +msgstr "Аб Aegisub" + +#: ../src/command/app.cpp:69 +msgid "&Audio+Subs View" +msgstr "&Паказваць аўдыя і субцітры" + +#: ../src/command/app.cpp:70 +msgid "Audio+Subs View" +msgstr "Паказваць аўдыя і субцітры" + +#: ../src/command/app.cpp:71 +msgid "Display audio and the subtitles grid only" +msgstr "Паказваць толькі аўдыя і сетку субтытраў" + +#: ../src/command/app.cpp:89 +msgid "&Full view" +msgstr "&Паказваць усё" + +#: ../src/command/app.cpp:90 +msgid "Full view" +msgstr "Паказваць усё" + +#: ../src/command/app.cpp:91 +msgid "Display audio, video and then subtitles grid" +msgstr "Паказваць аўдыя, відэа і сетку субтытраў" + +#: ../src/command/app.cpp:109 +msgid "S&ubs Only View" +msgstr "П&аказваць толькі субцітры" + +#: ../src/command/app.cpp:110 +msgid "Subs Only View" +msgstr "Паказваць толькі субцітры" + +#: ../src/command/app.cpp:111 +msgid "Display the subtitles grid only" +msgstr "Паказваць толькі сетку субтытраў" + +#: ../src/command/app.cpp:125 +msgid "&Video+Subs View" +msgstr "&Паказваць відэа і субцітры" + +#: ../src/command/app.cpp:126 +msgid "Video+Subs View" +msgstr "Паказваць відэа і субцітры" + +#: ../src/command/app.cpp:127 +msgid "Display video and the subtitles grid only" +msgstr "Паказваць толькі відэа і сетку субтытраў" + +#: ../src/command/app.cpp:145 +msgid "E&xit" +msgstr "&Выхад" + +#: ../src/command/app.cpp:146 +msgid "Exit" +msgstr "Выйсці" + +#: ../src/command/app.cpp:147 +msgid "Exit the application" +msgstr "Выйсці з праграмы" + +#: ../src/command/app.cpp:157 +msgid "&Language..." +msgstr "&Мова" + +#: ../src/command/app.cpp:158 +msgid "Language" +msgstr "Мова" + +#: ../src/command/app.cpp:159 +msgid "Select Aegisub interface language" +msgstr "Выбраць мову інтэрфейса Aegisub" + +#: ../src/command/app.cpp:182 +msgid "&Log window" +msgstr "&Журнал" + +#: ../src/command/app.cpp:183 ../src/dialog_log.cpp:99 +msgid "Log window" +msgstr "Журнал" + +#: ../src/command/app.cpp:184 +msgid "View the event log" +msgstr "Прагляд журнала падзей" + +#: ../src/command/app.cpp:194 +msgid "New &Window" +msgstr "Новае &акно" + +#: ../src/command/app.cpp:195 +msgid "New Window" +msgstr "Новае акно" + +#: ../src/command/app.cpp:196 +msgid "Open a new application window" +msgstr "Адкрыць новае акно праграмы" + +#: ../src/command/app.cpp:206 +msgid "&Options..." +msgstr "&Налады..." + +#: ../src/command/app.cpp:208 +msgid "Configure Aegisub" +msgstr "Налады" + +#: ../src/command/app.cpp:222 ../src/command/app.cpp:223 +msgid "Toggle global hotkey overrides" +msgstr "Уключыць глабальныя перавызначэнні гарачых клавіш" + +#: ../src/command/app.cpp:224 +msgid "Toggle global hotkey overrides (Medusa Mode)" +msgstr "Уключыць глабальныя перавызначэнні гарачых клавіш (Medusa Mode)" + +#: ../src/command/app.cpp:239 +msgid "Toggle the main toolbar" +msgstr "Пераключыць бачнасць галоўнай панэлі інструментаў" + +#: ../src/command/app.cpp:244 +msgid "Hide Toolbar" +msgstr "Хаваць панэль інструментаў" + +#: ../src/command/app.cpp:245 +msgid "Show Toolbar" +msgstr "Паказваць панэль інструментаў" + +#: ../src/command/app.cpp:260 +msgid "&Check for Updates..." +msgstr "&Праверыць абнаўленні" + +#: ../src/command/app.cpp:261 +msgid "Check for Updates" +msgstr "Праверыць абнаўленні" + +#: ../src/command/app.cpp:262 +msgid "Check to see if there is a new version of Aegisub available" +msgstr "Праверыць, ці даступна новая версія Aegisub" + +#: ../src/command/grid.cpp:53 +msgid "Move to the next subtitle line" +msgstr "Перайсці да наступнага радка субтытраў" + +#: ../src/command/grid.cpp:65 +msgid "Move to the next subtitle line, creating a new one if needed" +msgstr "Перайсці да наступнага радка субтытраў, калі яго няма — стварыць новы" + +#: ../src/command/grid.cpp:92 +msgid "Move to the previous line" +msgstr "Перайсці да наступнага радка" + +#: ../src/command/grid.cpp:101 ../src/command/grid.cpp:121 +msgid "&Actor Name" +msgstr "&Акцёр" + +#: ../src/command/grid.cpp:102 ../src/command/grid.cpp:122 +msgid "Actor Name" +msgstr "Акцёр" + +#: ../src/command/grid.cpp:103 +msgid "Sort all subtitles by their actor names" +msgstr "Сартаваць усе субтытры па імёнах акцёраў" + +#: ../src/command/grid.cpp:107 ../src/command/grid.cpp:127 +#: ../src/command/grid.cpp:139 ../src/command/grid.cpp:151 +#: ../src/command/grid.cpp:163 ../src/command/grid.cpp:175 +#: ../src/command/grid.cpp:187 ../src/command/grid.cpp:199 +#: ../src/command/grid.cpp:211 ../src/command/grid.cpp:223 +#: ../src/command/grid.cpp:235 ../src/command/grid.cpp:247 +msgid "sort" +msgstr "сартаваць" + +#: ../src/command/grid.cpp:123 +msgid "Sort selected subtitles by their actor names" +msgstr "Сартаваць вылучаныя субтытры па імёнах акцёраў" + +#: ../src/command/grid.cpp:133 ../src/command/grid.cpp:145 +#: ../src/dialog_search_replace.cpp:87 +msgid "&Effect" +msgstr "&Эфект" + +#: ../src/command/grid.cpp:134 ../src/command/grid.cpp:146 +#: ../src/dialog_paste_over.cpp:72 ../src/subs_edit_box.cpp:145 +#: ../src/grid_column.cpp:191 ../src/grid_column.cpp:192 +msgid "Effect" +msgstr "Эфект" + +#: ../src/command/grid.cpp:135 +msgid "Sort all subtitles by their effects" +msgstr "Сартаваць усе субтытры па эфектах" + +#: ../src/command/grid.cpp:147 +msgid "Sort selected subtitles by their effects" +msgstr "Сартаваць вылучаныя субтытры па эфектах" + +#: ../src/command/grid.cpp:157 ../src/command/grid.cpp:169 +msgid "&End Time" +msgstr "Час &канчатка" + +#: ../src/command/grid.cpp:158 ../src/command/grid.cpp:170 +#: ../src/dialog_paste_over.cpp:66 ../src/grid_column.cpp:147 +msgid "End Time" +msgstr "Час канчатка" + +#: ../src/command/grid.cpp:159 +msgid "Sort all subtitles by their end times" +msgstr "Сартаваць усе субтытры па часу заканчэння" + +#: ../src/command/grid.cpp:171 +msgid "Sort selected subtitles by their end times" +msgstr "Сартаваць вылучаныя субтытры па канчатковаму часу" + +#: ../src/command/grid.cpp:181 ../src/command/grid.cpp:193 +msgid "&Layer" +msgstr "&Слой" + +#: ../src/command/grid.cpp:182 ../src/command/grid.cpp:194 +#: ../src/dialog_paste_over.cpp:64 ../src/grid_column.cpp:107 +msgid "Layer" +msgstr "Слой" + +#: ../src/command/grid.cpp:183 +msgid "Sort all subtitles by their layer number" +msgstr "Сартаваць усе субтытры па нумару слоя" + +#: ../src/command/grid.cpp:195 +msgid "Sort selected subtitles by their layer number" +msgstr "Сартаваць вылучаныя субтытры па нумару слоя" + +#: ../src/command/grid.cpp:205 ../src/command/grid.cpp:217 +msgid "&Start Time" +msgstr "Час &пачатка" + +#: ../src/command/grid.cpp:206 ../src/command/grid.cpp:218 +#: ../src/dialog_paste_over.cpp:65 ../src/grid_column.cpp:129 +msgid "Start Time" +msgstr "Час пачатка" + +#: ../src/command/grid.cpp:207 +msgid "Sort all subtitles by their start times" +msgstr "Сартаваць усе субтытры па часу пачатку" + +#: ../src/command/grid.cpp:219 +msgid "Sort selected subtitles by their start times" +msgstr "Сартаваць вылучаныя субтытры па пачатковаму часу" + +#: ../src/command/grid.cpp:229 ../src/command/grid.cpp:241 +msgid "St&yle Name" +msgstr "&Стыль" + +#: ../src/command/grid.cpp:230 ../src/command/grid.cpp:242 +#: ../src/dialog_style_editor.cpp:177 +msgid "Style Name" +msgstr "Стыль" + +#: ../src/command/grid.cpp:231 +msgid "Sort all subtitles by their style names" +msgstr "Сартаваць усе субтытры па назвах стыляў" + +#: ../src/command/grid.cpp:243 +msgid "Sort selected subtitles by their style names" +msgstr "Сартаваць вылучаныя субтытры па назвам стыляў" + +#: ../src/command/grid.cpp:254 ../src/command/grid.cpp:255 +msgid "Cycle Tag Hiding Mode" +msgstr "Рэжым паказу тэгаў" + +#: ../src/command/grid.cpp:256 +msgid "Cycle through tag hiding modes" +msgstr "Пераключыць рэжым паказу тэгаў" + +#: ../src/command/grid.cpp:266 +msgid "ASS Override Tag mode set to show full tags." +msgstr "Рэжым ASS-тэгаў зададзены на паказ поўных тэгаў." + +#: ../src/command/grid.cpp:267 +msgid "ASS Override Tag mode set to simplify tags." +msgstr "Рэжым ASS-тэгаў зададзены на спрашчэнне тэгаў." + +#: ../src/command/grid.cpp:268 +msgid "ASS Override Tag mode set to hide tags." +msgstr "Рэжым ASS-тэгаў зададзены на хаванне тэгаў." + +#: ../src/command/grid.cpp:278 +msgid "&Hide Tags" +msgstr "&Хаваць тэгі" + +#: ../src/command/grid.cpp:279 +msgid "Hide Tags" +msgstr "Хаваць тэгі" + +#: ../src/command/grid.cpp:280 +msgid "Hide override tags in the subtitle grid" +msgstr "Не паказваць тэгі ў сетцы субтытраў" + +#: ../src/command/grid.cpp:294 +msgid "Sh&ow Tags" +msgstr "Па&казваць тэгі" + +#: ../src/command/grid.cpp:295 +msgid "Show Tags" +msgstr "Паказваць тэгі" + +#: ../src/command/grid.cpp:296 +msgid "Show full override tags in the subtitle grid" +msgstr "Паказваць поўныя тэгі ў сетцы субтытраў" + +#: ../src/command/grid.cpp:310 +msgid "S&implify Tags" +msgstr "С&прашчаць тэгі" + +#: ../src/command/grid.cpp:311 +msgid "Simplify Tags" +msgstr "Спрашчаць тэгі" + +#: ../src/command/grid.cpp:312 +msgid "" +"Replace override tags in the subtitle grid with a simplified placeholder" +msgstr "Замяняць поўныя тэгі ў сетцы субтытраў на спецыяльныя сімвалы" + +#: ../src/command/grid.cpp:348 ../src/command/grid.cpp:349 +msgid "Move line up" +msgstr "Перамясціць радок вышэй" + +#: ../src/command/grid.cpp:350 +msgid "Move the selected lines up one row" +msgstr "Перамясціць вылучаныя радкі на адзін рад вышэй" + +#: ../src/command/grid.cpp:359 ../src/command/grid.cpp:376 +msgid "move lines" +msgstr "перамяшчэнне радкоў" + +#: ../src/command/grid.cpp:365 ../src/command/grid.cpp:366 +msgid "Move line down" +msgstr "Перамясціць радок ніжэй" + +#: ../src/command/grid.cpp:367 +msgid "Move the selected lines down one row" +msgstr "Перамясціць вылучаныя радкі на адзін рад ніжэй" + +#: ../src/command/grid.cpp:383 ../src/command/grid.cpp:384 +msgid "Swap Lines" +msgstr "Памяняць месцамі радкі" + +#: ../src/command/grid.cpp:385 +msgid "Swap the two selected lines" +msgstr "Памяняць месцамі два вылучаных радка" + +#: ../src/command/grid.cpp:396 +msgid "swap lines" +msgstr "памяняць месцамі радкі" + +#: ../src/command/automation.cpp:48 +msgid "&Reload Automation scripts" +msgstr "&Перазагрузіць усе скрыпты аўтаматызацыі" + +#: ../src/command/automation.cpp:49 +msgid "Reload Automation scripts" +msgstr "Перазагрузіць усе скрыпты аўтаматызацыі" + +#: ../src/command/automation.cpp:50 +msgid "Reload all Automation scripts and rescan the autoload folder" +msgstr "" +"Перазагрузіць усе скрыпты аўтаматызацыі і перасканаваць папку аўтазагрузкі" + +#: ../src/command/automation.cpp:55 +msgid "Reloaded all Automation scripts" +msgstr "Перазагружаны ўсе скрыпты аўтаматызацыі" + +#: ../src/command/automation.cpp:61 +msgid "R&eload autoload Automation scripts" +msgstr "Перазагрузіць аўтаматычна загружаныя скрыпты аўтаматызацыі" + +#: ../src/command/automation.cpp:62 +msgid "Reload autoload Automation scripts" +msgstr "Перазагрузіць аўтаматычна загружаныя скрыпты аўтаматызацыі" + +#: ../src/command/automation.cpp:63 +msgid "Rescan the Automation autoload folder" +msgstr "Перасканаваць папку аўтазагрузкі аўтаматызацыі" + +#: ../src/command/automation.cpp:67 +msgid "Reloaded autoload Automation scripts" +msgstr "Скрыпты аўтаматызацыі для аўтазагрузкі перазагружаны" + +#: ../src/command/automation.cpp:74 ../src/command/automation.cpp:86 +msgid "&Automation..." +msgstr "&Аўтаматызацыя..." + +#: ../src/command/automation.cpp:75 ../src/command/automation.cpp:87 +#: ../src/preferences.cpp:314 +msgid "Automation" +msgstr "Аўтаматызацыя" + +#: ../src/command/automation.cpp:76 +msgid "Open automation manager" +msgstr "Адкрыць менеджар аўтаматызацыі" + +#: ../src/command/automation.cpp:88 +msgid "" +"Open automation manager. Ctrl: Rescan autoload folder. Ctrl+Shift: Rescan " +"autoload folder and reload all automation scripts" +msgstr "" +"Адкрыць менеджар аўтаматызацыі. Ctrl: Перасканаваць папку аўтазагрузкі " +"аўтаматызацыі. Ctrl+Shift: Перасканаваць папку аўтазагрузкі аўтаматызацыі і " +"перазагрузіць усе скрыпты аўтаматызацыі" + +#: ../src/command/time.cpp:99 +msgid "adjoin" +msgstr "аб'яднанне" + +#: ../src/command/time.cpp:104 +msgid "Change &End" +msgstr "Змяніць &канец" + +#: ../src/command/time.cpp:105 +msgid "Change End" +msgstr "Змяніць канец" + +#: ../src/command/time.cpp:106 +msgid "Change end times of lines to the next line's start time" +msgstr "Змяніць час канца радка на час пачатку наступнага радка" + +#: ../src/command/time.cpp:115 +msgid "Change &Start" +msgstr "Змяніць &пачатак" + +#: ../src/command/time.cpp:116 +msgid "Change Start" +msgstr "Змяніць пачатак" + +#: ../src/command/time.cpp:117 +msgid "Change start times of lines to the previous line's end time" +msgstr "Змяніць час пачатку радка на час канца папярэдняга радка" + +#: ../src/command/time.cpp:127 +msgid "Shift to &Current Frame" +msgstr "Зрушэнне да &бягучага кадра" + +#: ../src/command/time.cpp:128 +msgid "Shift to Current Frame" +msgstr "Зрушэнне да бягучага кадра" + +#: ../src/command/time.cpp:129 +msgid "Shift selection so that the active line starts at current frame" +msgstr "" +"Ссунуць вылучэнне так, каб першы вылучаны радок пачынаўся з бягучага кадра" + +#: ../src/command/time.cpp:145 +msgid "shift to frame" +msgstr "зрух да кадра" + +#: ../src/command/time.cpp:152 +msgid "S&hift Times..." +msgstr "З&рух па часу..." + +#: ../src/command/time.cpp:154 +msgid "Shift subtitles by time or frames" +msgstr "Зрух субтытраў па часу або кадрах" + +#: ../src/command/time.cpp:175 ../src/audio_timing_dialogue.cpp:512 +#: ../src/audio_timing_dialogue.cpp:518 +msgid "timing" +msgstr "таймінг" + +#: ../src/command/time.cpp:181 +msgid "Snap &End to Video" +msgstr "Прывязванне &канца па відэа" + +#: ../src/command/time.cpp:182 +msgid "Snap End to Video" +msgstr "Прывязванне канца па відэа" + +#: ../src/command/time.cpp:183 +msgid "Set end of selected subtitles to current video frame" +msgstr "Задаць канец вылучаных субтытраў на бягучы кадр відэа" + +#: ../src/command/time.cpp:193 +msgid "Snap to S&cene" +msgstr "Прывязванне да с&цэны" + +#: ../src/command/time.cpp:194 +msgid "Snap to Scene" +msgstr "Прывязванне да сцэны" + +#: ../src/command/time.cpp:195 +msgid "" +"Set start and end of subtitles to the keyframes around current video frame" +msgstr "" +"Задаць пачатак і канец субтытраў на ключкадры па абодва бакі ад бягучага " +"кадра відэа" + +#: ../src/command/time.cpp:232 +msgid "snap to scene" +msgstr "прывязванне да сцэны" + +#: ../src/command/time.cpp:238 ../src/command/time.cpp:239 +msgid "Add lead in and out" +msgstr "Дадаць уступ і канчатак" + +#: ../src/command/time.cpp:240 +msgid "Add both lead in and out to the selected lines" +msgstr "Дадаць уступ і канчатак да вылучаных радкоў" + +#: ../src/command/time.cpp:252 ../src/command/time.cpp:253 +msgid "Add lead in" +msgstr "Дадаць уступ" + +#: ../src/command/time.cpp:254 +msgid "Add the lead in time to the selected lines" +msgstr "Дадаць час на ўступ да вылучаных радкоў" + +#: ../src/command/time.cpp:264 ../src/command/time.cpp:265 +msgid "Add lead out" +msgstr "Дадаць канчатак" + +#: ../src/command/time.cpp:266 +msgid "Add the lead out time to the selected lines" +msgstr "Дадаць час на канчатак да вылучаных радкоў" + +#: ../src/command/time.cpp:275 ../src/command/time.cpp:276 +msgid "Increase length" +msgstr "Павялічыць даўжыню" + +#: ../src/command/time.cpp:277 +msgid "Increase the length of the current timing unit" +msgstr "Павялічыць даўжыню бягучай частцы таймінгу" + +#: ../src/command/time.cpp:286 ../src/command/time.cpp:287 +msgid "Increase length and shift" +msgstr "Павялічыць даўжыню і ссунуць" + +#: ../src/command/time.cpp:288 +msgid "" +"Increase the length of the current timing unit and shift the following items" +msgstr "" +"Павялічыць даўжыню бягучай частцы таймінга і ссунуць наступныя элементы" + +#: ../src/command/time.cpp:297 ../src/command/time.cpp:298 +msgid "Decrease length" +msgstr "Паменшыць даўжыню" + +#: ../src/command/time.cpp:299 +msgid "Decrease the length of the current timing unit" +msgstr "Паменшыць даўжыню бягучай частцы таймінгу" + +#: ../src/command/time.cpp:308 ../src/command/time.cpp:309 +msgid "Decrease length and shift" +msgstr "Паменшыць даўжыню і ссунуць" + +#: ../src/command/time.cpp:310 +msgid "" +"Decrease the length of the current timing unit and shift the following items" +msgstr "" +"Паменшыць даўжыню бягучай частцы таймінга і ссунуць наступныя элементы" + +#: ../src/command/time.cpp:319 ../src/command/time.cpp:320 +msgid "Shift start time forward" +msgstr "Ссунуць наперад час пачатку" + +#: ../src/command/time.cpp:321 +msgid "Shift the start time of the current timing unit forward" +msgstr "Ссунуць наперад час пачатку бягучай частцы таймінга" + +#: ../src/command/time.cpp:330 ../src/command/time.cpp:331 +msgid "Shift start time backward" +msgstr "Ссунуць назад час пачатку" + +#: ../src/command/time.cpp:332 +msgid "Shift the start time of the current timing unit backward" +msgstr "Ссунуць назад час пачатку бягучай частцы таймінга" + +#: ../src/command/time.cpp:342 +msgid "Snap &Start to Video" +msgstr "Прывязванне &пачатку па відэа" + +#: ../src/command/time.cpp:343 +msgid "Snap Start to Video" +msgstr "Прывязванне пачатку па відэа" + +#: ../src/command/time.cpp:344 +msgid "Set start of selected subtitles to current video frame" +msgstr "Задаць пачатак вылучаных субтытраў на бягучы кадр відэа" + +#: ../src/command/time.cpp:356 +msgid "Next line or syllable" +msgstr "Наступны радок або склад" + +#: ../src/command/time.cpp:368 +msgid "Previous line or syllable" +msgstr "Папярэдні радок або склад" + +#: ../src/command/vis_tool.cpp:56 ../src/command/vis_tool.cpp:57 +msgid "Standard" +msgstr "Стандартны" + +#: ../src/command/vis_tool.cpp:58 +msgid "Standard mode, double click sets position" +msgstr "Рэжым вымярэння каардынат" + +#: ../src/command/vis_tool.cpp:64 ../src/command/vis_tool.cpp:65 +#: ../src/visual_tool_vector_clip.cpp:57 +msgid "Drag" +msgstr "Перамясціць" + +#: ../src/command/vis_tool.cpp:66 +msgid "Drag subtitles" +msgstr "Перамясціць субтытры" + +#: ../src/command/vis_tool.cpp:72 ../src/command/vis_tool.cpp:73 +msgid "Rotate Z" +msgstr "Паварот па вось Z" + +#: ../src/command/vis_tool.cpp:74 +msgid "Rotate subtitles on their Z axis" +msgstr "Павярнуць субтытры па восі Z" + +#: ../src/command/vis_tool.cpp:80 ../src/command/vis_tool.cpp:81 +msgid "Rotate XY" +msgstr "Паварот па восях X і Y" + +#: ../src/command/vis_tool.cpp:82 +msgid "Rotate subtitles on their X and Y axes" +msgstr "Павярнуць субтытры па восях X і Y" + +#: ../src/command/vis_tool.cpp:88 ../src/command/vis_tool.cpp:89 +msgid "Scale" +msgstr "Маштаб" + +#: ../src/command/vis_tool.cpp:90 +msgid "Scale subtitles on X and Y axes" +msgstr "Маштаб субтытраў па восях X і Y" + +#: ../src/command/vis_tool.cpp:96 ../src/command/vis_tool.cpp:97 +msgid "Clip" +msgstr "Абрэзка" + +#: ../src/command/vis_tool.cpp:98 +msgid "Clip subtitles to a rectangle" +msgstr "Абрэзаць субтытры прамавугольнай вобласцю" + +#: ../src/command/vis_tool.cpp:104 ../src/command/vis_tool.cpp:105 +msgid "Vector Clip" +msgstr "Вектарная абрэзка" + +#: ../src/command/vis_tool.cpp:106 +msgid "Clip subtitles to a vectorial area" +msgstr "Абрэзаць субтытры вектарнай вобласцю" + +#: ../src/command/audio.cpp:65 +msgid "&Close Audio" +msgstr "&Закрыць аўдыя" + +#: ../src/command/audio.cpp:66 +msgid "Close Audio" +msgstr "Закрыць аўдыя" + +#: ../src/command/audio.cpp:67 +msgid "Close the currently open audio file" +msgstr "Закрыць бягучы адкрыты аўдыяфайл" + +#: ../src/command/audio.cpp:77 +msgid "&Open Audio File..." +msgstr "&Адкрыць аўдыяфайл..." + +#: ../src/command/audio.cpp:78 ../src/command/audio.cpp:85 +msgid "Open Audio File" +msgstr "Адкрыць аўдыяфайл" + +#: ../src/command/audio.cpp:79 +msgid "Open an audio file" +msgstr "Адкрыць аўдыяфайл" + +#: ../src/command/audio.cpp:82 +msgid "Audio Formats" +msgstr "Фарматы аўдыя" + +#: ../src/command/audio.cpp:93 ../src/command/audio.cpp:94 +msgid "Open 2h30 Blank Audio" +msgstr "Адкрыць пусты аўдыятрэк на 2 гадз 30 хв" + +#: ../src/command/audio.cpp:95 +msgid "Open a 150 minutes blank audio clip, for debugging" +msgstr "Адкрыць пусты аўдыятрэк на 150 хв; для адладкі" + +#: ../src/command/audio.cpp:104 ../src/command/audio.cpp:105 +msgid "Open 2h30 Noise Audio" +msgstr "Адкрыць аўдыятрэк шуму на 2 гадз 30 хв" + +#: ../src/command/audio.cpp:106 +msgid "Open a 150 minutes noise-filled audio clip, for debugging" +msgstr "Адкрыць запоўнены шумам аўдыятрэк на 150 хв; для адладкі" + +#: ../src/command/audio.cpp:116 +msgid "Open Audio from &Video" +msgstr "Адкрыць аўдыя з &відэа" + +#: ../src/command/audio.cpp:117 +msgid "Open Audio from Video" +msgstr "Адкрыць аўдыя з відэа" + +#: ../src/command/audio.cpp:118 +msgid "Open the audio from the current video file" +msgstr "Адкрыць аўдыя з бягучага відэафайла" + +#: ../src/command/audio.cpp:132 +msgid "&Spectrum Display" +msgstr "&Спектраграма" + +#: ../src/command/audio.cpp:133 +msgid "Spectrum Display" +msgstr "Спектраграма" + +#: ../src/command/audio.cpp:134 +msgid "Display audio as a frequency-power spectrograph" +msgstr "Паказваць аўдыя як спектаграму па частаце-амплітудзе" + +#: ../src/command/audio.cpp:148 +msgid "&Waveform Display" +msgstr "&Асцылаграма" + +#: ../src/command/audio.cpp:149 +msgid "Waveform Display" +msgstr "Асцылаграма" + +#: ../src/command/audio.cpp:150 +msgid "Display audio as a linear amplitude graph" +msgstr "Паказваць аўдыя як лінейны графік амплітуды" + +#: ../src/command/audio.cpp:187 ../src/command/audio.cpp:188 +msgid "Create audio clip" +msgstr "Стварыць адрэзак аўдыя" + +#: ../src/command/audio.cpp:189 +msgid "Save an audio clip of the selected line" +msgstr "Стварыць адрэзак аўдыя на аснове вылучаных радкоў" + +#: ../src/command/audio.cpp:200 +msgid "Save audio clip" +msgstr "Захаваць адрэзак аўдыя" + +#: ../src/command/audio.cpp:247 ../src/command/audio.cpp:248 +msgid "Play current audio selection" +msgstr "Прайграць бягучае вылучанае аўдыя" + +#: ../src/command/audio.cpp:249 +msgid "Play the current audio selection, ignoring changes made while playing" +msgstr "" +"Прайграць аўдыя ў бягучым вылучэнні без ўліку праведзеных у працэсе " +"змяненняў" + +#: ../src/command/audio.cpp:262 +msgid "Play the audio for the current line" +msgstr "Прайграць аўдыя, пачынаючы з бягучага радка" + +#: ../src/command/audio.cpp:275 ../src/command/audio.cpp:276 +msgid "Play audio selection" +msgstr "Прайграць вылучанае аўдыя" + +#: ../src/command/audio.cpp:277 +msgid "Play audio until the end of the selection is reached" +msgstr "Прайграць аўдыя да канца вылучэння" + +#: ../src/command/audio.cpp:287 ../src/command/audio.cpp:288 +msgid "Play audio selection or stop" +msgstr "Прайграць аўдыя ў вылучэнні або спыніць" + +#: ../src/command/audio.cpp:289 +msgid "Play selection, or stop playback if it's already playing" +msgstr "Прайграць вылучэнне або спыніць, калі прайграваецца" + +#: ../src/command/audio.cpp:304 ../src/command/audio.cpp:305 +msgid "Stop playing" +msgstr "Спыніць прайграванне" + +#: ../src/command/audio.cpp:306 +msgid "Stop audio and video playback" +msgstr "Спыніць прайграванне адўыя і відэа" + +#: ../src/command/audio.cpp:322 ../src/command/audio.cpp:323 +#: ../src/command/audio.cpp:324 +msgid "Play 500 ms before selection" +msgstr "Прайграць 500 мс перад вылучэннем" + +#: ../src/command/audio.cpp:336 ../src/command/audio.cpp:337 +#: ../src/command/audio.cpp:338 +msgid "Play 500 ms after selection" +msgstr "Прайграць 500 мс пасля вылучэння" + +#: ../src/command/audio.cpp:350 ../src/command/audio.cpp:351 +#: ../src/command/audio.cpp:352 +msgid "Play last 500 ms of selection" +msgstr "Прайграць апошнія 500 мс вылучэння" + +#: ../src/command/audio.cpp:364 ../src/command/audio.cpp:365 +#: ../src/command/audio.cpp:366 +msgid "Play first 500 ms of selection" +msgstr "Прайграць першыя 500 мс вылучэння" + +#: ../src/command/audio.cpp:380 ../src/command/audio.cpp:381 +#: ../src/command/audio.cpp:382 +msgid "Play from selection start to end of file" +msgstr "Прайграць ад пачатку вылучэння да канца файла" + +#: ../src/command/audio.cpp:393 ../src/command/audio.cpp:394 +msgid "Commit" +msgstr "Захаваць" + +#: ../src/command/audio.cpp:395 +msgid "Commit any pending audio timing changes" +msgstr "Захаваць усе адкладзеныя змены таймінга аўдыя" + +#: ../src/command/audio.cpp:409 ../src/command/audio.cpp:410 +msgid "Commit and use default timing for next line" +msgstr "" +"Захаваць, але выкарыстоўваць таймінг па змаўчанні для наступнага радка" + +#: ../src/command/audio.cpp:411 +msgid "" +"Commit any pending audio timing changes and reset the next line's times to " +"the default" +msgstr "" +"Захаваць усе адкладзеныя змены таймінга аўдыя і скінуць таймінг наступнага " +"радка да значэнняў па змаўчанні" + +#: ../src/command/audio.cpp:424 ../src/command/audio.cpp:425 +msgid "Commit and move to next line" +msgstr "Захаваць і перайсці да наступнага радка" + +#: ../src/command/audio.cpp:426 +msgid "Commit any pending audio timing changes and move to the next line" +msgstr "" +"Захаваць усе адкладзеныя змены таймінга аўдыя і перайсці да наступнага радка" + +#: ../src/command/audio.cpp:439 ../src/command/audio.cpp:440 +msgid "Commit and stay on current line" +msgstr "Захаваць і застацца на бягучым радку" + +#: ../src/command/audio.cpp:441 +msgid "Commit any pending audio timing changes and stay on the current line" +msgstr "" +"Захаваць усе адкладзеныя змены таймінга аўдыя і застацца на бягучым радку" + +#: ../src/command/audio.cpp:452 ../src/command/audio.cpp:453 +msgid "Go to selection" +msgstr "Перайсці да вылучэння" + +#: ../src/command/audio.cpp:454 +msgid "Scroll the audio display to center on the current audio selection" +msgstr "" +"Праматаць акно аўдыя, каб выраўнаваць па цэнтры бягучае вылучэнне аўдыя" + +#: ../src/command/audio.cpp:463 ../src/command/audio.cpp:464 +msgid "Scroll left" +msgstr "Прагартаць налева" + +#: ../src/command/audio.cpp:465 +msgid "Scroll the audio display left" +msgstr "Праматаць акно аўдыя ўлева" + +#: ../src/command/audio.cpp:474 ../src/command/audio.cpp:475 +msgid "Scroll right" +msgstr "Прагартаць направа" + +#: ../src/command/audio.cpp:476 +msgid "Scroll the audio display right" +msgstr "Праматаць акно аўдыя ўправа" + +#: ../src/command/audio.cpp:490 ../src/command/audio.cpp:491 +#: ../src/command/audio.cpp:492 +msgid "Auto scroll audio display to selected line" +msgstr "Аўтаматычна праматваць акно аўдыя да вылучанага радка" + +#: ../src/command/audio.cpp:507 ../src/command/audio.cpp:508 +#: ../src/command/audio.cpp:509 +msgid "Automatically commit all changes" +msgstr "Аўтаматычна захоўваць усе змены" + +#: ../src/command/audio.cpp:524 ../src/command/audio.cpp:525 +msgid "Auto go to next line on commit" +msgstr "Аўтапераход на наступны радок пры захаванні" + +#: ../src/command/audio.cpp:526 +msgid "Automatically go to next line on commit" +msgstr "Аўтаматычна пераходзіць на наступны радок пры захаванні" + +#: ../src/command/audio.cpp:541 ../src/command/audio.cpp:542 +#: ../src/command/audio.cpp:543 +msgid "Spectrum analyzer mode" +msgstr "Рэжым паказу аўдыятрэка" + +#: ../src/command/audio.cpp:558 ../src/command/audio.cpp:559 +#: ../src/command/audio.cpp:560 +msgid "Link vertical zoom and volume sliders" +msgstr "Звязаць паўзункі вертыкальнага маштабу і гучнасці" + +#: ../src/command/audio.cpp:575 ../src/command/audio.cpp:576 +#: ../src/command/audio.cpp:577 +msgid "Toggle karaoke mode" +msgstr "Выбар паміж звычайным рэжымам і караоке" + +#: ../src/command/help.cpp:48 +msgid "&Bug Tracker..." +msgstr "&Адсочванне памылак..." + +#: ../src/command/help.cpp:49 +msgid "Bug Tracker" +msgstr "Адсочванне памылак" + +#: ../src/command/help.cpp:50 +msgid "Visit Aegisub's bug tracker to report bugs and request new features" +msgstr "Паведаміць пра памылкі і прапанаваць новыя функцыі для Aegisub" + +#: ../src/command/help.cpp:69 +msgid "&Contents" +msgstr "&Выклік даведкі" + +#: ../src/command/help.cpp:70 +msgid "Contents" +msgstr "Выклік даведкі" + +#: ../src/command/help.cpp:71 +msgid "Help topics" +msgstr "Раздзелы дапамогі" + +#: ../src/command/help.cpp:81 +msgid "&Forums" +msgstr "&Форум" + +#: ../src/command/help.cpp:82 +msgid "Forums" +msgstr "Форум" + +#: ../src/command/help.cpp:83 +msgid "Visit Aegisub's forums" +msgstr "Перайсці на форум Aegisub" + +#: ../src/command/help.cpp:93 +msgid "&IRC Channel" +msgstr "&IRC-канал" + +#: ../src/command/help.cpp:94 +msgid "IRC Channel" +msgstr "IRC-канал" + +#: ../src/command/help.cpp:95 +msgid "Visit Aegisub's official IRC channel" +msgstr "Перайсці на афіцыйны IRC-канал Aegisub" + +#: ../src/command/help.cpp:105 +msgid "&Visual Typesetting" +msgstr "&Візуальнае афармленне" + +#: ../src/command/help.cpp:106 +msgid "Visual Typesetting" +msgstr "Візуальнае афармленне" + +#: ../src/command/help.cpp:107 +msgid "Open the manual page for Visual Typesetting" +msgstr "Адкрыць дакументацыю па сродках візуальнага афармлення" + +#: ../src/command/help.cpp:117 +msgid "&Website" +msgstr "&Сайт" + +#: ../src/command/help.cpp:118 +msgid "Website" +msgstr "Сайт" + +#: ../src/command/help.cpp:119 +msgid "Visit Aegisub's official website" +msgstr "Наведаць афіцыйны сайт Aegisub" + +#: ../src/command/keyframe.cpp:49 ../src/command/keyframe.cpp:50 +msgid "Close Keyframes" +msgstr "Закрыць ключкадры" + +#: ../src/command/keyframe.cpp:51 +msgid "" +"Discard the currently loaded keyframes and use those from the video, if any" +msgstr "" +"Выдаліць бягучыя загружаныя ключкадры і выкарыстоўваць ключкадры з відэа, " +"пры наяўнасці" + +#: ../src/command/keyframe.cpp:66 +msgid "Open Keyframes..." +msgstr "Адкрыць файл з ключкадрамі" + +#: ../src/command/keyframe.cpp:67 +msgid "Open Keyframes" +msgstr "Адкрыць ключкадры" + +#: ../src/command/keyframe.cpp:68 +msgid "Open a keyframe list file" +msgstr "Адкрыць файл са спісам ключкадраў" + +#: ../src/command/keyframe.cpp:72 +msgid "Open keyframes file" +msgstr "Адкрыць файл з ключкадрамі" + +#: ../src/command/keyframe.cpp:85 +msgid "Save Keyframes..." +msgstr "Захаваць ключкадры" + +#: ../src/command/keyframe.cpp:86 +msgid "Save Keyframes" +msgstr "Захаваць ключкадры" + +#: ../src/command/keyframe.cpp:87 +msgid "Save the current list of keyframes to a file" +msgstr "Захаваць бягучы спіс ключкадраў у файл" + +#: ../src/command/keyframe.cpp:95 +msgid "Save keyframes file" +msgstr "Захаваць файл з ключкадрамі" + +#: ../src/dialog_selected_choices.cpp:33 ../src/dialog_export.cpp:126 +msgid "Select &None" +msgstr "&Нічога" + +#: ../src/subtitles_provider_libass.cpp:112 +msgid "Updating font index" +msgstr "Абнаўленне спісу шрыфтоў" + +#: ../src/subtitles_provider_libass.cpp:113 +msgid "This may take several minutes" +msgstr "Гэта можа заняць некалькі хвілін" + +#: ../src/dialog_spellchecker.cpp:125 +msgid "Misspelled word:" +msgstr "Слова з памылкай:" + +#: ../src/dialog_spellchecker.cpp:127 ../src/dialog_search_replace.cpp:73 +msgid "Replace with:" +msgstr "Замяніць на:" + +#: ../src/dialog_spellchecker.cpp:182 ../src/dialog_search_replace.cpp:80 +msgid "&Skip Comments" +msgstr "&Прапусціць каментарый" + +#: ../src/dialog_spellchecker.cpp:183 +msgid "Ignore &UPPERCASE words" +msgstr "Ігнараваць словы Ў ВЕРХНІМ РЭГІСТРЫ" + +#: ../src/dialog_spellchecker.cpp:187 +msgid "&Replace" +msgstr "&Замяніць" + +#: ../src/dialog_spellchecker.cpp:190 ../src/dialog_search_replace.cpp:95 +msgid "Replace &all" +msgstr "Замяніць &усё" + +#: ../src/dialog_spellchecker.cpp:197 +msgid "&Ignore" +msgstr "&Ігнараваць" + +#: ../src/dialog_spellchecker.cpp:200 +msgid "Ignore a&ll" +msgstr "Ігнараваць у&сё" + +#: ../src/dialog_spellchecker.cpp:206 +msgid "Add to &dictionary" +msgstr "&Дадаць у слоўнік" + +#: ../src/dialog_spellchecker.cpp:212 +msgid "Remove fro&m dictionary" +msgstr "Выдаліць са слоўніку" + +#: ../src/dialog_spellchecker.cpp:279 +msgid "Aegisub has finished checking spelling of this script." +msgstr "Aegisub скончыла правяраць арфаграфію ў дадзеным скрыпце." + +#: ../src/dialog_spellchecker.cpp:279 ../src/dialog_spellchecker.cpp:283 +msgid "Spell checking complete." +msgstr "Праверка арфаграфіі завершана." + +#: ../src/dialog_spellchecker.cpp:283 +msgid "Aegisub has found no spelling mistakes in this script." +msgstr "Aegisub не знайшла памылак у гэтым скрыпце." + +#: ../src/dialog_spellchecker.cpp:329 ../src/dialog_spellchecker.cpp:343 +msgid "spell check replace" +msgstr "выпраўленне арфаграфіі" + +#: ../src/preferences_base.cpp:63 +msgid "Please choose the folder:" +msgstr "Выбраць папку:" + +#: ../src/preferences_base.cpp:209 +msgid "Browse..." +msgstr "Агляд..." + +#: ../src/preferences_base.cpp:244 +msgid "Choose..." +msgstr "Выбраць..." + +#: ../src/preferences_base.cpp:252 +msgid "Font Size" +msgstr "Памер шрыфта" + +#: ../src/dialog_properties.cpp:89 +msgid "Script Properties" +msgstr "Уласцівасці скрыпта" + +#: ../src/dialog_properties.cpp:95 +msgid "Script" +msgstr "Скрыпт" + +#: ../src/dialog_properties.cpp:98 +msgid "Title:" +msgstr "Назва:" + +#: ../src/dialog_properties.cpp:99 +msgid "Original script:" +msgstr "Арыгінальны скрыпт:" + +#: ../src/dialog_properties.cpp:100 +msgid "Translation:" +msgstr "Пераклад:" + +#: ../src/dialog_properties.cpp:101 +msgid "Editing:" +msgstr "Рэдакцыя:" + +#: ../src/dialog_properties.cpp:102 +msgid "Timing:" +msgstr "Таймінг:" + +#: ../src/dialog_properties.cpp:103 +msgid "Synch point:" +msgstr "Пункты сінхранізацыі:" + +#: ../src/dialog_properties.cpp:104 +msgid "Updated by:" +msgstr "Абноўлены:" + +#: ../src/dialog_properties.cpp:105 +msgid "Update details:" +msgstr "Звесткі пра абнаўленне:" + +#: ../src/dialog_properties.cpp:114 ../src/export_framerate.cpp:70 +#: ../src/dialog_resample.cpp:141 +msgid "From &video" +msgstr "З &відэа" + +#: ../src/dialog_properties.cpp:133 +msgid "Resolution" +msgstr "Разрозненне" + +#: ../src/dialog_properties.cpp:141 +msgid "0: Smart wrapping, top line is wider" +msgstr "0: Акуратны перанос, верхі радок даўжэй" + +#: ../src/dialog_properties.cpp:142 +msgid "1: End-of-line word wrapping, only \\N breaks" +msgstr "1: Перанос па канцу слоў, толькі \\N улічваецца" + +#: ../src/dialog_properties.cpp:143 +msgid "2: No word wrapping, both \\n and \\N break" +msgstr "2: Без пераносу слоў, \\n і \\N улічваюцца" + +#: ../src/dialog_properties.cpp:144 +msgid "3: Smart wrapping, bottom line is wider" +msgstr "3: Акуратны перанос, ніжні радок даўжэй" + +#: ../src/dialog_properties.cpp:148 +msgid "Wrap Style: " +msgstr "Стыль пераносаў" + +#: ../src/dialog_properties.cpp:151 +msgid "Scale Border and Shadow" +msgstr "Маштабаваць контур і цень" + +#: ../src/dialog_properties.cpp:152 +msgid "" +"Scale border and shadow together with script/render resolution. If this is " +"unchecked, relative border and shadow size will depend on renderer." +msgstr "" +"Маштабаваць контур і цень да разрознення скрыпта. Калі не адзначана, іх " +"памер будзе залежыць ад рэндарара." + +#: ../src/dialog_properties.cpp:193 +msgid "property changes" +msgstr "змяненне ўласцівасцяў" + +#: ../src/dialog_fonts_collector.cpp:107 +msgid "Symlinking fonts to folder...\n" +msgstr "Стварэнне спасылак на шрыфты ў папцы...\n" + +#: ../src/dialog_fonts_collector.cpp:111 +msgid "Copying fonts to folder...\n" +msgstr "Капіяванне шрыфтоў у папку...\n" + +#: ../src/dialog_fonts_collector.cpp:114 +msgid "Copying fonts to archive...\n" +msgstr "Архіваванне шрыфтоў...\n" + +#: ../src/dialog_fonts_collector.cpp:126 +#, c-format +msgid "* Failed to create directory '%s': %s.\n" +msgstr "* Не атрымалася стварыць папку '%s': %s.\n" + +#: ../src/dialog_fonts_collector.cpp:137 +#, c-format +msgid "* Failed to open %s.\n" +msgstr "* Не атрымалася адкрыць %s.\n" + +#: ../src/dialog_fonts_collector.cpp:192 +#, c-format +msgid "* Copied %s.\n" +msgstr "* %s скапіяваны.\n" + +#: ../src/dialog_fonts_collector.cpp:194 +#, c-format +msgid "* %s already exists on destination.\n" +msgstr "* %s ужо існуе ў прызначэнні.\n" + +#: ../src/dialog_fonts_collector.cpp:196 +#, c-format +msgid "* Symlinked %s.\n" +msgstr "* Створана спасылка для %s.\n" + +#: ../src/dialog_fonts_collector.cpp:198 +#, c-format +msgid "* Failed to copy %s.\n" +msgstr "* Памылка капіявання %s.\n" + +#: ../src/dialog_fonts_collector.cpp:204 +msgid "Done. All fonts copied." +msgstr "Гатова. Усе шрыфты скапіяваны." + +#: ../src/dialog_fonts_collector.cpp:206 +msgid "Done. Some fonts could not be copied." +msgstr "Гатова. Некаторыя шрыфты немагчыма скапіяваць." + +#: ../src/dialog_fonts_collector.cpp:209 +msgid "" +"\n" +"Over 32 MB of fonts were copied. Some of the fonts may not be loaded by the player if they are all attached to a Matroska file." +msgstr "" +"\n" +"Скапіявана больш за 32 МБ шрыфтоў. Прайгравальнік можа не загрузіць некаторыя шрыфты, калі іх усе далучыць да Matroska-файлу." + +#: ../src/dialog_fonts_collector.cpp:224 +msgid "Check fonts for availability" +msgstr "Праверыць шрыфты на даступнасць" + +#: ../src/dialog_fonts_collector.cpp:225 +msgid "Copy fonts to folder" +msgstr "Капіяваць шрыфты ў папку" + +#: ../src/dialog_fonts_collector.cpp:226 +msgid "Copy fonts to subtitle file's folder" +msgstr "Капіяваць шрыфты ў папку з субтытрам" + +#: ../src/dialog_fonts_collector.cpp:227 +msgid "Copy fonts to zipped archive" +msgstr "Стварыць ZIP-архіў са шрыфтамі" + +#: ../src/dialog_fonts_collector.cpp:229 +msgid "Symlink fonts to folder" +msgstr "Стварыць спасылкі на шрыфты ў папцы" + +#: ../src/dialog_fonts_collector.cpp:232 ../src/dialog_selection.cpp:150 +msgid "Action" +msgstr "Дзеянне" + +#: ../src/dialog_fonts_collector.cpp:238 +msgid "Destination" +msgstr "Прызначэнне" + +#: ../src/dialog_fonts_collector.cpp:242 +msgid "&Browse..." +msgstr "&Агляд..." + +#: ../src/dialog_fonts_collector.cpp:251 +msgid "Log" +msgstr "Журнал" + +#: ../src/dialog_fonts_collector.cpp:264 +msgid "&Start!" +msgstr "&Выканаць!" + +#: ../src/dialog_fonts_collector.cpp:301 +msgid "Invalid destination." +msgstr "Памылковы шлях." + +#: ../src/dialog_fonts_collector.cpp:301 ../src/dialog_fonts_collector.cpp:306 +#: ../src/dialog_fonts_collector.cpp:311 ../src/preferences.cpp:257 +#: ../src/dialog_kara_timing_copy.cpp:574 +#: ../src/dialog_kara_timing_copy.cpp:576 +#: ../src/dialog_kara_timing_copy.cpp:626 +msgid "Error" +msgstr "Памылка" + +#: ../src/dialog_fonts_collector.cpp:306 +msgid "Could not create destination folder." +msgstr "Немагчыма стварыць мэтавую папку." + +#: ../src/dialog_fonts_collector.cpp:311 +msgid "Invalid path for .zip file." +msgstr "Памылковы шлях да ZIP-архіва." + +#: ../src/dialog_fonts_collector.cpp:335 +msgid "Select archive file name" +msgstr "Выбраць імя архіва" + +#: ../src/dialog_fonts_collector.cpp:342 +msgid "Select folder to save fonts on" +msgstr "Выбраць папку для захавання шрыфтоў" + +#: ../src/dialog_fonts_collector.cpp:356 +msgid "N/A" +msgstr "N/A" + +#: ../src/dialog_fonts_collector.cpp:364 +msgid "" +"Choose the folder where the fonts will be collected to. It will be created " +"if it doesn't exist." +msgstr "Выбраць папку для збору шрыфтоў. Яна будзе створана, калі не існуе." + +#: ../src/dialog_fonts_collector.cpp:371 +msgid "" +"Enter the name of the destination zip file to collect the fonts to. If a " +"folder is entered, a default name will be used." +msgstr "" +"Увядзіце імя ZIP-архіва для збору шрыфтоў. Калі ўведзена папка, будзе " +"выкарыстоўвацца імя па змаўчанню." + +#: ../src/audio_renderer_waveform.cpp:154 +msgid "Maximum" +msgstr "Максімум" + +#: ../src/audio_renderer_waveform.cpp:155 +msgid "Maximum + Average" +msgstr "Максімум + Усярэдненае" + +#: ../src/dialog_dummy_video.cpp:103 +msgid "Dummy video options" +msgstr "Параметры пустога відэа" + +#: ../src/dialog_dummy_video.cpp:115 +msgid "Checkerboard &pattern" +msgstr "Фон у &клетку" + +#: ../src/dialog_dummy_video.cpp:118 +msgid "Video resolution:" +msgstr "Разрозненне відэа:" + +#: ../src/dialog_dummy_video.cpp:120 +msgid "Color:" +msgstr "Колер:" + +#: ../src/dialog_dummy_video.cpp:121 +msgid "Frame rate (fps):" +msgstr "Частата кадраў (кадр/сек):" + +#: ../src/dialog_dummy_video.cpp:122 +msgid "Duration (frames):" +msgstr "Працягласць (у кадрах):" + +#: ../src/dialog_dummy_video.cpp:164 +#, c-format +msgid "Resulting duration: %s" +msgstr "Выніковая працягласць: %s" + +#: ../src/preferences.cpp:61 ../src/preferences.cpp:63 +#: ../src/preferences.cpp:316 ../src/preferences.cpp:341 +msgid "General" +msgstr "Асноўныя" + +#: ../src/preferences.cpp:64 +msgid "Check for updates on startup" +msgstr "Правяраць абнаўленні падчас запуску" + +#: ../src/preferences.cpp:65 +msgid "Show main toolbar" +msgstr "Паказаць галоўную панэль інструментаў" + +#: ../src/preferences.cpp:66 +msgid "Save UI state in subtitles files" +msgstr "Захоўваць стан інтэрфейсу ў файлах субтытраў" + +#: ../src/preferences.cpp:69 +msgid "Toolbar Icon Size" +msgstr "Памер значкоў панэлі інструментаў" + +#: ../src/preferences.cpp:70 ../src/preferences.cpp:195 +msgid "Never" +msgstr "Ніколі" + +#: ../src/preferences.cpp:70 +msgid "Always" +msgstr "Заўсёды" + +#: ../src/preferences.cpp:70 ../src/preferences.cpp:195 +msgid "Ask" +msgstr "Спытаць" + +#: ../src/preferences.cpp:72 +msgid "Automatically load linked files" +msgstr "Аўтаматычна загружаць звязаныя файлы" + +#: ../src/preferences.cpp:73 +msgid "Undo Levels" +msgstr "Колькасць магчымых адмен" + +#: ../src/preferences.cpp:75 +msgid "Recently Used Lists" +msgstr "Нядаўна выкарыстаныя спісы" + +#: ../src/preferences.cpp:76 ../src/dialog_autosave.cpp:70 +msgid "Files" +msgstr "Файлы" + +#: ../src/preferences.cpp:77 +msgid "Find/Replace" +msgstr "Знайсці/Замяніць" + +#: ../src/preferences.cpp:83 +msgid "Default styles" +msgstr "Стылі па змаўчанні" + +#: ../src/preferences.cpp:85 +msgid "Default style catalogs" +msgstr "Каталог стыляў па змаўчанні" + +#: ../src/preferences.cpp:89 +msgid "" +"The chosen style catalogs will be loaded when you start a new file or import files in the various formats.\n" +"\n" +"You can set up style catalogs in the Style Manager." +msgstr "" +"Выбраныя каталогі стыляў будуць загружаны, калі вы створыце новый файл або імпартуеце файл у адпаведных фарматах.\n" +"\n" +"Вы можаце наладзіць каталогі стыляў у Менеджары стыляў." + +#: ../src/preferences.cpp:114 +msgid "New files" +msgstr "Новыя файлы" + +#: ../src/preferences.cpp:115 +msgid "MicroDVD import" +msgstr "Імпарт MicroDVD" + +#: ../src/preferences.cpp:116 +msgid "SRT import" +msgstr "Імпарт SRT" + +#: ../src/preferences.cpp:117 +msgid "TTXT import" +msgstr "Імпарт TTXT" + +#: ../src/preferences.cpp:118 +msgid "Plain text import" +msgstr "Імпарт звычайнага тэксту" + +#: ../src/preferences.cpp:125 ../src/preferences.cpp:354 +msgid "Audio" +msgstr "Аўдыя" + +#: ../src/preferences.cpp:128 +msgid "Default mouse wheel to zoom" +msgstr "Колца мышы мяняе маштаб" + +#: ../src/preferences.cpp:129 +msgid "Lock scroll on cursor" +msgstr "Прагортка за курсорам" + +#: ../src/preferences.cpp:130 +msgid "Snap markers by default" +msgstr "Прывязваць маркеры да сетцы па змаўчанні" + +#: ../src/preferences.cpp:131 +msgid "Auto-focus on mouse over" +msgstr "Аўтафокус пры навядзенні мышшу" + +#: ../src/preferences.cpp:132 +msgid "Play audio when stepping in video" +msgstr "Прайграваць аўдыя пры пераходзе па відэа" + +#: ../src/preferences.cpp:133 +msgid "Left-click-drag moves end marker" +msgstr "Перацягванне левай кнопкай мышы ссоўвае маркер канчатка" + +#: ../src/preferences.cpp:134 +msgid "Default timing length (ms)" +msgstr "Працягласць таймінга па змаўчанні (мс)" + +#: ../src/preferences.cpp:135 +msgid "Default lead-in length (ms)" +msgstr "Працягласць уступу па змаўчанні (мс)" + +#: ../src/preferences.cpp:136 +msgid "Default lead-out length (ms)" +msgstr "Працягласць канчатку па змаўчанні (мс)" + +#: ../src/preferences.cpp:138 +msgid "Marker drag-start sensitivity (px)" +msgstr "Кропак да пачатку перамяшчэння маркера (px)" + +#: ../src/preferences.cpp:139 +msgid "Line boundary thickness (px)" +msgstr "Таўшчыня ліній межаў радка (px)" + +#: ../src/preferences.cpp:140 +msgid "Maximum snap distance (px)" +msgstr "Максімальная дыстанцыя прывязвання (px)" + +#: ../src/preferences.cpp:142 +msgid "Don't show" +msgstr "Не паказваць" + +#: ../src/preferences.cpp:142 +msgid "Show previous" +msgstr "Паказваць папярэдні" + +#: ../src/preferences.cpp:142 +msgid "Show previous and next" +msgstr "Паказваць папярэдні і наступны" + +#: ../src/preferences.cpp:142 +msgid "Show all" +msgstr "Паказваць усе" + +#: ../src/preferences.cpp:144 +msgid "Show inactive lines" +msgstr "Паказваць неактыўныя радкі" + +#: ../src/preferences.cpp:146 +msgid "Include commented inactive lines" +msgstr "Паказваць неактыўныя закаменціраваныя радкі" + +#: ../src/preferences.cpp:148 +msgid "Display Visual Options" +msgstr "Візуальныя налады" + +#: ../src/preferences.cpp:149 +msgid "Keyframes in dialogue mode" +msgstr "Ключкадры ў дыялогавым рэжыме" + +#: ../src/preferences.cpp:150 +msgid "Keyframes in karaoke mode" +msgstr "Ключкадры ў рэжыме караоке" + +#: ../src/preferences.cpp:151 +msgid "Cursor time" +msgstr "Час курсору" + +#: ../src/preferences.cpp:152 +msgid "Video position" +msgstr "Пазіцыя відэа" + +#: ../src/preferences.cpp:153 ../src/preferences.cpp:246 +msgid "Seconds boundaries" +msgstr "Межы секунд" + +#: ../src/preferences.cpp:155 +msgid "Waveform Style" +msgstr "Стыль асцылаграмы" + +#: ../src/preferences.cpp:157 +msgid "Audio labels" +msgstr "Аўдыяпазнакі" + +#: ../src/preferences.cpp:168 +msgid "Show keyframes in slider" +msgstr "Паказваць ключкадры на паласе прагорткі" + +#: ../src/preferences.cpp:170 +msgid "Only show visual tools when mouse is over video" +msgstr "Паказваць толькі візуальныя інструменты пры навядзенні" + +#: ../src/preferences.cpp:172 +msgid "Seek video to line start on selection change" +msgstr "Пры змяненні вылучэння перамотваць відэа да пачатку радка." + +#: ../src/preferences.cpp:174 +msgid "Automatically open audio when opening video" +msgstr "Аўтазагрузка аўдыя пры адкрыцці відэа" + +#: ../src/preferences.cpp:179 +msgid "Default Zoom" +msgstr "Маштаб па змаўчанні" + +#: ../src/preferences.cpp:181 +msgid "Fast jump step in frames" +msgstr "Крок хуткага пераходу, у кадрах" + +#: ../src/preferences.cpp:185 +msgid "Screenshot save path" +msgstr "Шлях захавання здымкаў экрана" + +#: ../src/preferences.cpp:187 +msgid "Script Resolution" +msgstr "Разрозненне скрыпта" + +#: ../src/preferences.cpp:188 +msgid "Use resolution of first video opened" +msgstr "Выкарыстоўваць разрозненне першага адкрытага відэа" + +#: ../src/preferences.cpp:191 +msgid "Default width" +msgstr "Шырыня па змаўчанні" + +#: ../src/preferences.cpp:193 +msgid "Default height" +msgstr "Вышыня па змаўчанні" + +#: ../src/preferences.cpp:195 +msgid "Always set" +msgstr "Заўжды задаваць" + +#: ../src/preferences.cpp:195 +msgid "Always resample" +msgstr "Заўжды пералічваць" + +#: ../src/preferences.cpp:197 +msgid "Match video resolution on open" +msgstr "Падагнаць разрозненне відэа падчас адкрыцця" + +#: ../src/preferences.cpp:204 +msgid "Interface" +msgstr "Інтэрфейс" + +#: ../src/preferences.cpp:206 +msgid "Edit Box" +msgstr "Акно рэдагавання" + +#: ../src/preferences.cpp:207 +msgid "Enable call tips" +msgstr "Уключыць падказкі" + +#: ../src/preferences.cpp:208 +msgid "Overwrite in time boxes" +msgstr "Пераразлік часу пры ўводзе" + +#: ../src/preferences.cpp:210 +msgid "Enable syntax highlighting" +msgstr "Уключыць падсвятленне сінтаксісу" + +#: ../src/preferences.cpp:211 +msgid "Dictionaries path" +msgstr "Шлях да слоўнікаў" + +#: ../src/preferences.cpp:214 +msgid "Character Counter" +msgstr "Лічыльнік сімвалаў" + +#: ../src/preferences.cpp:215 +msgid "Maximum characters per line" +msgstr "Максімальная колькасць сімвалаў у радку" + +#: ../src/preferences.cpp:216 +msgid "Characters Per Second Warning Threshold" +msgstr "Значэнне сімвалаў у секунду, перавышэнне якога выдае папярэджанне" + +#: ../src/preferences.cpp:217 +msgid "Characters Per Second Error Threshold" +msgstr "" +"Значэнне сімвалаў у секунду, перавышэнне якога выдае паведамленне аб памылцы" + +#: ../src/preferences.cpp:218 +msgid "Ignore whitespace" +msgstr "Ігнараваць прабелы" + +#: ../src/preferences.cpp:219 +msgid "Ignore punctuation" +msgstr "Ігнараваць пунктуацыю" + +#: ../src/preferences.cpp:221 +msgid "Grid" +msgstr "Сетка" + +#: ../src/preferences.cpp:222 +msgid "Focus grid on click" +msgstr "Пераключыць фокус на сетку пры націсканні" + +#: ../src/preferences.cpp:223 +msgid "Highlight visible subtitles" +msgstr "Падсвечваць бачныя субтытры" + +#: ../src/preferences.cpp:224 +msgid "Hide overrides symbol" +msgstr "Сімвал спрошчаных тэгаў" + +#: ../src/preferences.cpp:232 ../src/dialog_style_editor.cpp:179 +msgid "Colors" +msgstr "Колеры" + +#: ../src/preferences.cpp:240 +msgid "Audio Display" +msgstr "Акно аўдыя" + +#: ../src/preferences.cpp:241 +msgid "Play cursor" +msgstr "Курсор прайгравання" + +#: ../src/preferences.cpp:242 +msgid "Line boundary start" +msgstr "Межа радка - пачатак" + +#: ../src/preferences.cpp:243 +msgid "Line boundary end" +msgstr "Межа радка - канец" + +#: ../src/preferences.cpp:244 +msgid "Line boundary inactive line" +msgstr "Межа радка - неактыўны" + +#: ../src/preferences.cpp:245 +msgid "Syllable boundaries" +msgstr "Межа складаў" + +#: ../src/preferences.cpp:248 +msgid "Syntax Highlighting" +msgstr "Падсвятленне сінтаксісу" + +#: ../src/preferences.cpp:249 +msgid "Background" +msgstr "Фон" + +#: ../src/preferences.cpp:250 ../src/preferences.cpp:326 +msgid "Normal" +msgstr "Стандарт" + +#: ../src/preferences.cpp:251 +msgid "Comments" +msgstr "Каментарыі" + +#: ../src/preferences.cpp:252 +msgid "Drawings" +msgstr "Рысункі" + +#: ../src/preferences.cpp:253 +msgid "Brackets" +msgstr "Дужкі" + +#: ../src/preferences.cpp:254 +msgid "Slashes and Parentheses" +msgstr "Косыя рысы і круглыя дужкі" + +#: ../src/preferences.cpp:255 +msgid "Tags" +msgstr "Тэгі" + +#: ../src/preferences.cpp:256 +msgid "Parameters" +msgstr "Параметры" + +#: ../src/preferences.cpp:258 +msgid "Error Background" +msgstr "Фон памылкі" + +#: ../src/preferences.cpp:259 +msgid "Line Break" +msgstr "Перанос радка" + +#: ../src/preferences.cpp:260 +msgid "Karaoke templates" +msgstr "Шаблоны караоке" + +#: ../src/preferences.cpp:261 +msgid "Karaoke variables" +msgstr "Пераменныя караоке" + +#: ../src/preferences.cpp:267 +msgid "Audio Color Schemes" +msgstr "Колеравыя схемы аўдыя" + +#: ../src/preferences.cpp:269 ../src/preferences.cpp:370 +msgid "Spectrum" +msgstr "Спектр" + +#: ../src/preferences.cpp:270 +msgid "Waveform" +msgstr "Асцылаграма" + +#: ../src/preferences.cpp:272 +msgid "Subtitle Grid" +msgstr "Табліца субтытраў" + +#: ../src/preferences.cpp:273 +msgid "Standard foreground" +msgstr "Колер шрыфта" + +#: ../src/preferences.cpp:274 +msgid "Standard background" +msgstr "Стандартны фон" + +#: ../src/preferences.cpp:275 +msgid "Selection foreground" +msgstr "Колер шрыфта вылучэння" + +#: ../src/preferences.cpp:276 +msgid "Selection background" +msgstr "Фон вылучэння" + +#: ../src/preferences.cpp:277 +msgid "Collision foreground" +msgstr "Фон калізій" + +#: ../src/preferences.cpp:278 +msgid "In frame background" +msgstr "Фон радка ў кадры" + +#: ../src/preferences.cpp:279 +msgid "Comment background" +msgstr "Фон каментарыяў" + +#: ../src/preferences.cpp:280 +msgid "Selected comment background" +msgstr "Фон вылучаных каментарыяў" + +#: ../src/preferences.cpp:281 +msgid "Header background" +msgstr "Фон загалоўка" + +#: ../src/preferences.cpp:282 +msgid "Left Column" +msgstr "Левая калонка" + +#: ../src/preferences.cpp:283 +msgid "Active Line Border" +msgstr "Межа актыўнага радак" + +#: ../src/preferences.cpp:284 +msgid "Lines" +msgstr "Радкі" + +#: ../src/preferences.cpp:285 +msgid "CPS Error" +msgstr "Памылка сімв./сек" + +#: ../src/preferences.cpp:294 +msgid "Backup" +msgstr "Рэзервовыя копіі" + +#: ../src/preferences.cpp:296 +msgid "Automatic Save" +msgstr "Аўтазахаванне" + +#: ../src/preferences.cpp:297 ../src/preferences.cpp:305 +msgid "Enable" +msgstr "Уключыць" + +#: ../src/preferences.cpp:300 +msgid "Interval in seconds" +msgstr "Інтэрвал, сек" + +#: ../src/preferences.cpp:301 ../src/preferences.cpp:307 +#: ../src/preferences.cpp:368 +msgid "Path" +msgstr "Шлях" + +#: ../src/preferences.cpp:302 +msgid "Autosave after every change" +msgstr "Аўтазахаванне пасля кожнай змены" + +#: ../src/preferences.cpp:304 +msgid "Automatic Backup" +msgstr "Аўтаматычныя рэзервовыя копіі" + +#: ../src/preferences.cpp:318 +msgid "Base path" +msgstr "Базавы шлях" + +#: ../src/preferences.cpp:319 +msgid "Include path" +msgstr "Шлях да загаловачных файлаў" + +#: ../src/preferences.cpp:320 +msgid "Auto-load path" +msgstr "Шлях да аўтаматычна загружаемых сцэнарыяў" + +#: ../src/preferences.cpp:322 +msgid "0: Fatal" +msgstr "0: Крытычны" + +#: ../src/preferences.cpp:322 +msgid "1: Error" +msgstr "1: Памылка" + +#: ../src/preferences.cpp:322 +msgid "2: Warning" +msgstr "2: Папярэджанне" + +#: ../src/preferences.cpp:322 +msgid "3: Hint" +msgstr "3: Падказка" + +#: ../src/preferences.cpp:322 +msgid "4: Debug" +msgstr "4: Адладка" + +#: ../src/preferences.cpp:322 +msgid "5: Trace" +msgstr "5: Інфармацыя" + +#: ../src/preferences.cpp:324 +msgid "Trace level" +msgstr "Узровень адсочвання" + +#: ../src/preferences.cpp:326 +msgid "Below Normal (recommended)" +msgstr "Ніжэй за звычайны (рэкамендуецца)" + +#: ../src/preferences.cpp:326 +msgid "Lowest" +msgstr "Найніжэйшы" + +#: ../src/preferences.cpp:328 +msgid "Thread priority" +msgstr "Прыярытэт патоку" + +#: ../src/preferences.cpp:330 +msgid "No scripts" +msgstr "Ніякія" + +#: ../src/preferences.cpp:330 +msgid "Subtitle-local scripts" +msgstr "Лакальныя скрыпты" + +#: ../src/preferences.cpp:330 +msgid "Global autoload scripts" +msgstr "Глабальныя аўтаматычна загружаемыя скрыпты" + +#: ../src/preferences.cpp:330 +msgid "All scripts" +msgstr "Усе скрыпты" + +#: ../src/preferences.cpp:332 +msgid "Autoreload on Export" +msgstr "Аўтаматычна перазагружаць пры экспарце" + +#: ../src/preferences.cpp:339 +msgid "Advanced" +msgstr "Дадатковыя налады" + +#: ../src/preferences.cpp:343 +msgid "" +"Changing these settings might result in bugs and/or crashes. Do not touch " +"these unless you know what you're doing." +msgstr "" +"Змена гэтых налад можа выклікаць некарэктную працу праграмы. Не змяняйце іх," +" калі сапраўды не ўпэўнены ў тым, што робіце." + +#: ../src/preferences.cpp:356 ../src/preferences.cpp:419 +msgid "Expert" +msgstr "Экспертныя" + +#: ../src/preferences.cpp:359 +msgid "Audio provider" +msgstr "Правайдар аўдыя" + +#: ../src/preferences.cpp:362 +msgid "Audio player" +msgstr "Прайграванне аўдыя праз" + +#: ../src/preferences.cpp:364 +msgid "Cache" +msgstr "Кэш" + +#: ../src/preferences.cpp:365 +msgid "None (NOT RECOMMENDED)" +msgstr "Не (НЕ РЭКАМЕНДУЕЦЦА)" + +#: ../src/preferences.cpp:365 +msgid "RAM" +msgstr "Аператыўная памяць" + +#: ../src/preferences.cpp:365 +msgid "Hard Disk" +msgstr "Цвёрды дыск" + +#: ../src/preferences.cpp:367 +msgid "Cache type" +msgstr "Тып кэша" + +#: ../src/preferences.cpp:372 +msgid "Regular quality" +msgstr "Звычайная" + +#: ../src/preferences.cpp:372 +msgid "Better quality" +msgstr "Добрая" + +#: ../src/preferences.cpp:372 +msgid "High quality" +msgstr "Высокая" + +#: ../src/preferences.cpp:372 +msgid "Insane quality" +msgstr "Лепшая" + +#: ../src/preferences.cpp:374 +msgid "Quality" +msgstr "Якасць" + +#: ../src/preferences.cpp:376 +msgid "Cache memory max (MB)" +msgstr "Максімальны памер кэша (МБ)" + +#: ../src/preferences.cpp:382 +msgid "Avisynth down-mixer" +msgstr "Метад мікшыравання Avisynth’ам" + +#: ../src/preferences.cpp:383 +msgid "Force sample rate" +msgstr "Прымусова задаць сэмплінг" + +#: ../src/preferences.cpp:389 +msgid "Ignore" +msgstr "Ігнараваць" + +#: ../src/preferences.cpp:389 +msgid "Stop" +msgstr "Спыніць" + +#: ../src/preferences.cpp:389 +msgid "Abort" +msgstr "Перапыніць" + +#: ../src/preferences.cpp:391 +msgid "Audio indexing error handling mode" +msgstr "Рэжым апрацоўкі памылак індэксавання аўдыя" + +#: ../src/preferences.cpp:393 +msgid "Always index all audio tracks" +msgstr "Заўсёды індэксаваць усе аўдыятрэкі" + +#: ../src/preferences.cpp:398 +msgid "Portaudio device" +msgstr "Прылада Portaudio" + +#: ../src/preferences.cpp:403 +msgid "OSS Device" +msgstr "Прылада OSS" + +#: ../src/preferences.cpp:408 +msgid "Buffer latency" +msgstr "Латэнтнасць буферу" + +#: ../src/preferences.cpp:409 +msgid "Buffer length" +msgstr "Даўжыня буферу" + +#: ../src/preferences.cpp:422 +msgid "Video provider" +msgstr "Правайдар відэа" + +#: ../src/preferences.cpp:425 +msgid "Subtitles provider" +msgstr "Правайдар субтытраў" + +#: ../src/preferences.cpp:428 +msgid "Force BT.601" +msgstr "BT.601 прымусова" + +#: ../src/preferences.cpp:432 +msgid "Allow pre-2.56a Avisynth" +msgstr "Дазволіць Avisynth версіі ніжэй за 2.56a" + +#: ../src/preferences.cpp:434 +msgid "Avisynth memory limit" +msgstr "Ліміт памяці для Avisynth (МБ)" + +#: ../src/preferences.cpp:442 +msgid "Debug log verbosity" +msgstr "Падрабязнасць журнала адладкі" + +#: ../src/preferences.cpp:444 +msgid "Decoding threads" +msgstr "Колькасць патокаў дэкадавання" + +#: ../src/preferences.cpp:445 +msgid "Enable unsafe seeking" +msgstr "Дазволіць небяспечную перамотку" + +#: ../src/preferences.cpp:574 +msgid "Hotkeys" +msgstr "Гарачыя клавішы" + +#: ../src/preferences.cpp:672 +msgid "" +"Are you sure that you want to restore the defaults? All your settings will " +"be overridden." +msgstr "" +"Вы ўпэўнены, што жадаеце аднавіць налады па змаўчанні? Усе вашыя налады " +"будуць скінуты. " + +#: ../src/preferences.cpp:672 +msgid "Restore defaults?" +msgstr "Аднавіць налады па змаўчанні? " + +#: ../src/preferences.cpp:690 +msgid "Preferences" +msgstr "Параметры" + +#: ../src/preferences.cpp:718 +msgid "&Restore Defaults" +msgstr "&Аднавіць параметры па змаўчанню" + +#: ../src/subs_edit_ctrl.cpp:356 +msgid "Spell checker language" +msgstr "Мова праверкі арфаграфіі" + +#: ../src/subs_edit_ctrl.cpp:365 +msgid "Cu&t" +msgstr "Выразаць" + +#: ../src/subs_edit_ctrl.cpp:402 +#, c-format +msgid "Remove \"%s\" from dictionary" +msgstr "Выдаліць \"%s\" са слоўніку" + +#: ../src/subs_edit_ctrl.cpp:407 +msgid "No spell checker suggestions" +msgstr "Няма варыянтаў" + +#: ../src/subs_edit_ctrl.cpp:413 +#, c-format +msgid "Spell checker suggestions for \"%s\"" +msgstr "Варыянты для «%s»" + +#: ../src/subs_edit_ctrl.cpp:418 +msgid "No correction suggestions" +msgstr "Няма варыянтаў" + +#: ../src/subs_edit_ctrl.cpp:424 +#, c-format +msgid "Add \"%s\" to dictionary" +msgstr "Дадаць «%s» у слоўнік" + +#: ../src/subs_edit_ctrl.cpp:459 +#, c-format +msgid "Thesaurus suggestions for \"%s\"" +msgstr "Варыянты тэзаўруса для «%s»" + +#: ../src/subs_edit_ctrl.cpp:462 +msgid "No thesaurus suggestions" +msgstr "Няма варыянтаў тэзаўруса" + +#: ../src/subs_edit_ctrl.cpp:465 +msgid "Thesaurus language" +msgstr "Мова тэзаўруса" + +#: ../src/subs_edit_ctrl.cpp:474 +msgid "Disable" +msgstr "Адключыць" + +#: ../src/menu.cpp:94 +msgid "Empty" +msgstr "Пуста" + +#: ../src/menu.cpp:227 +msgid "&Recent" +msgstr "&Нядаўнія" + +#: ../src/menu.cpp:410 +msgid "No Automation macros loaded" +msgstr "Няма загружаных макрасаў аўтаматызацыі" + +#: ../src/dialog_about.cpp:46 +msgid "Translated into LANGUAGE by PERSON\n" +msgstr "Пераклад на беларускую мову: prydespar@outlook.com\n" + +#: ../src/dialog_about.cpp:122 +msgid "" +"\n" +"See the help file for full credits.\n" +msgstr "" +"\n" +"Поўны спіс глядзіце ў файле даведкі.\n" + +#: ../src/dialog_about.cpp:123 +#, c-format +msgid "Built by %s on %s." +msgstr "Зборка ад %s ад %s." + +#: ../src/dialog_kara_timing_copy.cpp:57 +msgid "Source: " +msgstr "Зыходны:" + +#: ../src/dialog_kara_timing_copy.cpp:58 +msgid "Dest: " +msgstr "Вынік:" + +#: ../src/dialog_kara_timing_copy.cpp:470 +msgid "Kanji timing" +msgstr "Кандзі-таймер" + +#: ../src/dialog_kara_timing_copy.cpp:475 ../src/dialog_paste_over.cpp:73 +#: ../src/grid_column.cpp:334 ../src/grid_column.cpp:335 +msgid "Text" +msgstr "Тэкст" + +#: ../src/dialog_kara_timing_copy.cpp:476 +msgid "Styles" +msgstr "Стылі" + +#: ../src/dialog_kara_timing_copy.cpp:478 +msgid "Shortcut Keys" +msgstr "Гарачыя клавішы" + +#: ../src/dialog_kara_timing_copy.cpp:479 +msgid "Commands" +msgstr "Каманды" + +#: ../src/dialog_kara_timing_copy.cpp:487 +msgid "Attempt to &interpolate kanji." +msgstr "&Спрабаваць прадугадаць кандзі" + +#: ../src/dialog_kara_timing_copy.cpp:494 +msgid "" +"When the destination textbox has focus, use the following keys:\n" +"\n" +"Right Arrow: Increase dest. selection length\n" +"Left Arrow: Decrease dest. selection length\n" +"Up Arrow: Increase source selection length\n" +"Down Arrow: Decrease source selection length\n" +"Enter: Link, accept line when done\n" +"Backspace: Unlink last" +msgstr "" +"Калі фокус уводу зададзены на мэтавым радку, можна выкарыстоўваць наступныя клавішы:\n" +"\n" +"Стрэлка ўправа: Павялічыць даўжыню мэтавага вылучэння\n" +"Стрэлка ўлева: Паменшыць даўжыню мэтавага вылучэння\n" +"Стрэлка ўверх: Павялічыць даўжыню зыходнага вылучэння\n" +"Стрэлка ўніз: Паменшыць даўжыню зыходнага вылучэння\n" +"Enter: Аб'яднаць, прыняць гатовы радок\n" +"Backspace: Раз'яднаць" + +#: ../src/dialog_kara_timing_copy.cpp:497 +msgid "S&tart!" +msgstr "П&ачаць!" + +#: ../src/dialog_kara_timing_copy.cpp:498 +msgid "&Link" +msgstr "&Аб'яднаць" + +#: ../src/dialog_kara_timing_copy.cpp:499 +msgid "&Unlink" +msgstr "&Раз'яднаць" + +#: ../src/dialog_kara_timing_copy.cpp:500 +msgid "Skip &Source Line" +msgstr "Прапусціць &зыходны радок" + +#: ../src/dialog_kara_timing_copy.cpp:501 +msgid "Skip &Dest Line" +msgstr "Прапусціць &мэтавы радок" + +#: ../src/dialog_kara_timing_copy.cpp:502 +msgid "&Go Back a Line" +msgstr "&Вярнуцца назад на &радок" + +#: ../src/dialog_kara_timing_copy.cpp:503 +msgid "&Accept Line" +msgstr "&Прыняць радок" + +#: ../src/dialog_kara_timing_copy.cpp:504 ../src/dialog_automation.cpp:122 +#: ../src/dialog_attachments.cpp:89 ../src/dialog_version_check.cpp:126 +msgid "&Close" +msgstr "&Закрыць" + +#: ../src/dialog_kara_timing_copy.cpp:566 +msgid "kanji timing" +msgstr "таймінг кандзі" + +#: ../src/dialog_kara_timing_copy.cpp:574 +msgid "Select source and destination styles first." +msgstr "Спачатку зыходны стыль і мэтавы стыль." + +#: ../src/dialog_kara_timing_copy.cpp:576 +msgid "The source and destination styles must be different." +msgstr "Зыходны і мэтавы стыль павінны быць рознымі." + +#: ../src/dialog_kara_timing_copy.cpp:626 +msgid "Group all of the source text." +msgstr "Згрупуйце ўвесь зыходны тэкст." + +#: ../src/hotkey.cpp:175 +msgid "Invalid command name for hotkey" +msgstr "Памылковая назва каманды для гарачай клавішы" + +#: ../src/dialog_paste_over.cpp:55 +msgid "Select Fields to Paste Over" +msgstr "Выбраць палі для ўстаўкі паверх" + +#: ../src/dialog_paste_over.cpp:58 +msgid "Fields" +msgstr "Палі" + +#: ../src/dialog_paste_over.cpp:59 +msgid "Please select the fields that you want to paste over:" +msgstr "Выбраць палі паверх якіх вы хочаце ўставіць:" + +#: ../src/dialog_paste_over.cpp:63 +msgid "Comment" +msgstr "Каментарый" + +#: ../src/dialog_paste_over.cpp:67 ../src/grid_column.cpp:177 +#: ../src/grid_column.cpp:178 +msgid "Style" +msgstr "Стыль" + +#: ../src/dialog_paste_over.cpp:68 ../src/subs_edit_box.cpp:140 +#: ../src/grid_column.cpp:205 ../src/grid_column.cpp:206 +msgid "Actor" +msgstr "Акцёр" + +#: ../src/dialog_paste_over.cpp:69 +msgid "Margin Left" +msgstr "Водступ злева" + +#: ../src/dialog_paste_over.cpp:70 +msgid "Margin Right" +msgstr "Водступ справа" + +#: ../src/dialog_paste_over.cpp:71 +msgid "Margin Vertical" +msgstr "Вертыкальны водступ" + +#: ../src/dialog_paste_over.cpp:92 +msgid "&Times" +msgstr "&Таймкоды" + +#: ../src/dialog_paste_over.cpp:94 +msgid "T&ext" +msgstr "Т&экст" + +#: ../src/main.cpp:274 +#, c-format +msgid "" +"Oops, Aegisub has crashed!\n" +"\n" +"An attempt has been made to save a copy of your file to:\n" +"\n" +"%s\n" +"\n" +"Aegisub will now close." +msgstr "" +"Упс, Aegisub упала!\n" +"\n" +"Зрабілі спробу запісаць копію вашага файла ў:\n" +"\n" +"%s\n" +"\n" +"Зараз Aegisub будзе закрыты." + +#: ../src/main.cpp:302 +msgid "" +"Do you want Aegisub to check for updates whenever it starts? You can still " +"do it manually via the Help menu." +msgstr "" +"Правяраць абнаўленні праграмы Aegisub падчас запуску? Вы гэта можаце рабіць " +"гэта і ўручную праз меню \"Дапамога\"." + +#: ../src/main.cpp:302 +msgid "Check for updates?" +msgstr "Праверыць абнаўленні?" + +#: ../src/main.cpp:387 ../src/main.cpp:392 +msgid "Program error" +msgstr "Памылка праграмы" + +#: ../src/main.cpp:406 +#, c-format +msgid "" +"An unexpected error has occurred. Please save your work and restart Aegisub.\n" +"\n" +"Error Message: %s" +msgstr "" +"Адбылася нечаканая памылка. Захавайце вынікі вашай працы і перазапусціце Aegisub.\n" +"\n" +"Паведамленне аб памылцы: %s" + +#: ../src/subs_edit_box.cpp:119 +msgid "&Comment" +msgstr "&Каментарый" + +#: ../src/subs_edit_box.cpp:120 +msgid "Comment this line out. Commented lines don't show up on screen." +msgstr "Закаменціраваць радок. Каментарыі не паказваюцца на экране." + +#: ../src/subs_edit_box.cpp:127 +msgid "Style for this line" +msgstr "Стыль радка" + +#: ../src/subs_edit_box.cpp:129 ../src/subs_edit_box.cpp:130 +msgid "Edit" +msgstr "Рэдагаваць" + +#: ../src/subs_edit_box.cpp:140 +msgid "" +"Actor name for this speech. This is only for reference, and is mainly " +"useless." +msgstr "Імя акцёра, які гаварыць прамову. Інфармацыя толькі для даведкі." + +#: ../src/subs_edit_box.cpp:145 +msgid "" +"Effect for this line. This can be used to store extra information for " +"karaoke scripts, or for the effects supported by the renderer." +msgstr "" +"Эфекты ў гэтым радку. Можна выкарыстоўваць для захавання дадатковых звестак " +"для скрыптаў караоке або для эфектаў рэндарара." + +#: ../src/subs_edit_box.cpp:151 +msgid "Number of characters in the longest line of this subtitle." +msgstr "Колькасць сімвалаў у найдаўжэйшым радку гэтых субтытраў." + +#: ../src/subs_edit_box.cpp:158 +msgid "Layer number" +msgstr "Нумар слоя" + +#: ../src/subs_edit_box.cpp:162 +msgid "Start time" +msgstr "Час пачатку" + +#: ../src/subs_edit_box.cpp:163 +msgid "End time" +msgstr "Час заканчэння" + +#: ../src/subs_edit_box.cpp:165 +msgid "Line duration" +msgstr "Даўжыня радка" + +#: ../src/subs_edit_box.cpp:168 +msgid "Left Margin (0 = default from style)" +msgstr "Левы водступ (0 = па змаўчанні)" + +#: ../src/subs_edit_box.cpp:168 +msgid "left margin change" +msgstr "змяніць водступ злева" + +#: ../src/subs_edit_box.cpp:169 +msgid "Right Margin (0 = default from style)" +msgstr "Правы водступ (0 = па змаўчанні)" + +#: ../src/subs_edit_box.cpp:169 +msgid "right margin change" +msgstr "змяніць водступ справа" + +#: ../src/subs_edit_box.cpp:170 +msgid "Vertical Margin (0 = default from style)" +msgstr "Вертыкальны водступ (0 = па змаўчанні)" + +#: ../src/subs_edit_box.cpp:170 +msgid "vertical margin change" +msgstr "змяніць вертыкальны водступ" + +#: ../src/subs_edit_box.cpp:189 +msgid "T&ime" +msgstr "Ч&ас" + +#: ../src/subs_edit_box.cpp:189 +msgid "Time by h:mm:ss.cs" +msgstr "Час у h:mm:ss.cs" + +#: ../src/subs_edit_box.cpp:190 +msgid "F&rame" +msgstr "К&адр" + +#: ../src/subs_edit_box.cpp:190 +msgid "Time by frame number" +msgstr "Час па нумару кадра" + +#: ../src/subs_edit_box.cpp:193 +msgid "Show Original" +msgstr "Паказаць арыгінал" + +#: ../src/subs_edit_box.cpp:194 +msgid "" +"Show the contents of the subtitle line when it was first selected above the " +"edit box. This is sometimes useful when editing subtitles or translating " +"subtitles into another language." +msgstr "" +"Паказаць першапачатковае змесціва радка. Часам гэта карысна пры рэдагаванні " +"субтытраў або перакладзе на іншую мову." + +#: ../src/subs_edit_box.cpp:441 +msgid "modify text" +msgstr "змяніць тэкст" + +#: ../src/subs_edit_box.cpp:516 +msgid "modify times" +msgstr "змяніць час" + +#: ../src/subs_edit_box.cpp:590 ../src/dialog_style_editor.cpp:453 +msgid "style change" +msgstr "змена стылю" + +#: ../src/subs_edit_box.cpp:596 +msgid "actor change" +msgstr "змена акцёра" + +#: ../src/subs_edit_box.cpp:601 +msgid "layer change" +msgstr "змена слою" + +#: ../src/subs_edit_box.cpp:606 +msgid "effect change" +msgstr "змена эфекта" + +#: ../src/subs_edit_box.cpp:611 +msgid "comment change" +msgstr "каменціраванне" + +#: ../src/dialog_selection.cpp:106 +msgid "Select" +msgstr "Выбраць" + +#: ../src/dialog_selection.cpp:117 +msgid "Match" +msgstr "Супадзенне" + +#: ../src/dialog_selection.cpp:121 +msgid "&Matches" +msgstr "&Супадае" + +#: ../src/dialog_selection.cpp:122 +msgid "&Doesn't Match" +msgstr "&Не супадае" + +#: ../src/dialog_selection.cpp:123 +msgid "Match c&ase" +msgstr "Улічваць &рэгістр" + +#: ../src/dialog_selection.cpp:132 +msgid "&Exact match" +msgstr "&Дакладнае супадзенне" + +#: ../src/dialog_selection.cpp:132 +msgid "&Contains" +msgstr "Ут&рымлівае" + +#: ../src/dialog_selection.cpp:132 +msgid "&Regular Expression match" +msgstr "Супадае па рэгулярнаму &выразу" + +#: ../src/dialog_selection.cpp:133 +msgid "Mode" +msgstr "Рэжым" + +#: ../src/dialog_selection.cpp:137 ../src/dialog_search_replace.cpp:87 +msgid "&Text" +msgstr "&Тэкст" + +#: ../src/dialog_selection.cpp:137 +msgid "&Style" +msgstr "&Стыль" + +#: ../src/dialog_selection.cpp:137 +msgid "Act&or" +msgstr "&Акцёр" + +#: ../src/dialog_selection.cpp:137 +msgid "E&ffect" +msgstr "Э&фект" + +#: ../src/dialog_selection.cpp:138 ../src/dialog_search_replace.cpp:90 +msgid "In Field" +msgstr "У полі" + +#: ../src/dialog_selection.cpp:142 +msgid "Match dialogues/comments" +msgstr "Дыялогі/каментарыі" + +#: ../src/dialog_selection.cpp:143 +msgid "D&ialogues" +msgstr "Д&ыялогі" + +#: ../src/dialog_selection.cpp:144 +msgid "Comme&nts" +msgstr "&Каментарыі" + +#: ../src/dialog_selection.cpp:149 +msgid "Set se&lection" +msgstr "Задаць &вылучэнне" + +#: ../src/dialog_selection.cpp:149 +msgid "&Add to selection" +msgstr "&Дадаць да вылучэння" + +#: ../src/dialog_selection.cpp:149 +msgid "S&ubtract from selection" +msgstr "&Прыбраць з вылучэння" + +#: ../src/dialog_selection.cpp:149 +msgid "Intersect &with selection" +msgstr "&Накладанне з вылучэннем" + +#: ../src/dialog_selection.cpp:211 +#, c-format +msgid "Selection was set to one line" +msgid_plural "Selection was set to %u lines" +msgstr[0] "Вылучаны 1 радок" +msgstr[1] "Вылучана %u радкі" +msgstr[2] "Вылучана %u радкоў" +msgstr[3] "Вылучана %u радкі" + +#: ../src/dialog_selection.cpp:212 +msgid "Selection was set to no lines" +msgstr "Не вылучана радкоў" + +#: ../src/dialog_selection.cpp:218 +#, c-format +msgid "One line was added to selection" +msgid_plural "%u lines were added to selection" +msgstr[0] "Адзін радок дададзены да вылучэння" +msgstr[1] "%u радкі дададзены да вылучэння" +msgstr[2] "%u радкоў дададзены да вылучэння " +msgstr[3] "%u радкоў дададзены да вылучэння " + +#: ../src/dialog_selection.cpp:219 +msgid "No lines were added to selection" +msgstr "Да вылучэння не дададзена радкоў" + +#: ../src/dialog_selection.cpp:230 +#, c-format +msgid "One line was removed from selection" +msgid_plural "%u lines were removed from selection" +msgstr[0] "Адзін радок выдалены з вылучэння" +msgstr[1] "%u радкі выдалены з вылучэння" +msgstr[2] "%u радкоў выдалена з вылучэння" +msgstr[3] "%u радкоў выдалена з вылучэння" + +#: ../src/dialog_selection.cpp:231 +msgid "No lines were removed from selection" +msgstr "З вылучэння не выладена радкоў" + +#: ../src/dialog_selection.cpp:236 +msgid "Selection" +msgstr "Вылучэнне" + +#: ../src/font_file_lister.cpp:72 +#, c-format +msgid "Style '%s' does not exist\n" +msgstr "Стыль '%s' не існуе\n" + +#: ../src/font_file_lister.cpp:138 +#, c-format +msgid "Could not find font '%s'\n" +msgstr "Не атрымалася знайсці шрыфт '%s'\n" + +#: ../src/font_file_lister.cpp:145 +#, c-format +msgid "Found '%s' at '%s'\n" +msgstr "Знойдзена '%s' в '%s'\n" + +#: ../src/font_file_lister.cpp:149 +#, c-format +msgid "'%s' does not have a bold variant.\n" +msgstr "'%s' не мае тоўстага варыянта.\n" + +#: ../src/font_file_lister.cpp:151 +#, c-format +msgid "'%s' does not have an italic variant.\n" +msgstr "'%s' не мае курсіўнага варыянта.\n" + +#: ../src/font_file_lister.cpp:155 +#, c-format +msgid "'%s' is missing %d glyphs used.\n" +msgstr "У '%s' не хапае %dгліфаў.\n" + +#: ../src/font_file_lister.cpp:157 +#, c-format +msgid "'%s' is missing the following glyphs used: %s\n" +msgstr "У '%s' не хапае наступных гліфаў: %s\n" + +#: ../src/font_file_lister.cpp:168 +msgid "Used in styles:\n" +msgstr "Ужыта ў стылях:\n" + +#: ../src/font_file_lister.cpp:174 +msgid "Used on lines:" +msgstr "Ужыта ў радках:" + +#: ../src/font_file_lister.cpp:186 +msgid "Parsing file\n" +msgstr "Чытанне файла\n" + +#: ../src/font_file_lister.cpp:200 +msgid "Searching for font files\n" +msgstr "Пошук файлаў шрыфтоў\n" + +#: ../src/font_file_lister.cpp:202 +msgid "" +"Done\n" +"\n" +msgstr "" +"Гатова\n" +"\n" + +#: ../src/font_file_lister.cpp:209 +msgid "All fonts found.\n" +msgstr "Усе шрыфты дададзены.\n" + +#: ../src/font_file_lister.cpp:211 +#, c-format +msgid "One font could not be found\n" +msgid_plural "%d fonts could not be found.\n" +msgstr[0] "Не атрымоўваецца знайсці 1 шрыфт\n" +msgstr[1] "Не атрымоўваецца знайсці %d шрыфты\n" +msgstr[2] "Не атрымоўваецца знайсці %d шрыфтоў\n" +msgstr[3] "Не атрымоўваецца знайсці %d шрыфтоў\n" + +#: ../src/font_file_lister.cpp:214 +#, c-format +msgid "One font was found, but was missing glyphs used in the script.\n" +msgid_plural "" +"%d fonts were found, but were missing glyphs used in the script.\n" +msgstr[0] "" +"Знойдзены 1 шрыфт, але не хапае гліфаў, якія выкарытоўваюцца ў сэнарыі.\n" +msgstr[1] "" +"Знойдзены %d шрыфты, але не хапае гліфаў, якія выкарытоўваюцца ў сэнарыі.\n" +msgstr[2] "" +"Знойдзена %d шрыфтоў, але не хапае гліфаў, якія выкарытоўваюцца ў сэнарыі.\n" +msgstr[3] "" +"Знойдзена %d шрыфтоў, але не хапае гліфаў, якія выкарытоўваюцца ў скрыпце.\n" + +#: ../src/export_framerate.cpp:52 +msgid "Transform Framerate" +msgstr "Змяніць частату кадраў" + +#: ../src/export_framerate.cpp:53 +msgid "" +"Transform subtitle times, including those in override tags, from an input framerate to an output framerate.\n" +"\n" +"This is useful for converting regular time subtitles to VFRaC time subtitles for hardsubbing.\n" +"It can also be used to convert subtitles to a different speed video, such as NTSC to PAL speedup." +msgstr "" +"Канвертаваць таймінг субтытраў і гэтаў з уваходнай частаты кадраў у выхадную частату.\n" +"\n" +"Гэта карысна для канвертавання звычайнага таймінга ў таймінг VFRaC для хардсаба.\n" +"Можна выкарыстоўваць для канвертавання субтытраў пад іншую хуткасць відэа, напрыклад, паскарэнні відэа пры канвертаванні з NTSC у PAL." + +#: ../src/export_framerate.cpp:92 +msgid "V&ariable" +msgstr "П&ераменная" + +#: ../src/export_framerate.cpp:96 +msgid "&Constant: " +msgstr "&Пастаянная:" + +#: ../src/export_framerate.cpp:108 +msgid "&Reverse transformation" +msgstr "&Адваротнае канвертаванне" + +#: ../src/export_framerate.cpp:116 +msgid "Input framerate: " +msgstr "Уваходная частата кадраў:" + +#: ../src/export_framerate.cpp:118 +msgid "Output: " +msgstr "Вывад:" + +#: ../src/audio_display.cpp:677 +#, c-format +msgid "%d%%, %d pixel/second" +msgstr "%d%%,%d пікселяў/сек" + +#: ../src/dialog_progress.cpp:197 +msgid "Cancel" +msgstr "Скасаваць" + +#: ../src/dialog_progress.cpp:245 +msgid "Cancelling..." +msgstr "Скасаванне..." + +#: ../src/visual_tool_vector_clip.cpp:57 +msgid "Drag control points" +msgstr "Перамясціць кантрольныя пункты" + +#: ../src/visual_tool_vector_clip.cpp:58 +msgid "Line" +msgstr "Радок" + +#: ../src/visual_tool_vector_clip.cpp:58 +msgid "Appends a line" +msgstr "Дадаць прамую" + +#: ../src/visual_tool_vector_clip.cpp:59 +msgid "Bicubic" +msgstr "Крывая" + +#: ../src/visual_tool_vector_clip.cpp:59 +msgid "Appends a bezier bicubic curve" +msgstr "Канвертаваць крывую Без'е" + +#: ../src/visual_tool_vector_clip.cpp:61 +msgid "Convert" +msgstr "Канвертаваць" + +#: ../src/visual_tool_vector_clip.cpp:61 +msgid "Converts a segment between line and bicubic" +msgstr "Канвертаваць сегмент з прамой у крывую Без'е і назад" + +#: ../src/visual_tool_vector_clip.cpp:62 +msgid "Insert" +msgstr "Уставіць" + +#: ../src/visual_tool_vector_clip.cpp:62 +msgid "Inserts a control point" +msgstr "Уставіць кантрольны пункт" + +#: ../src/visual_tool_vector_clip.cpp:63 +msgid "Remove" +msgstr "Выдаліць" + +#: ../src/visual_tool_vector_clip.cpp:63 +msgid "Removes a control point" +msgstr "Выдаліць кантрольны пункт" + +#: ../src/visual_tool_vector_clip.cpp:65 +msgid "Freehand" +msgstr "Ад рукі" + +#: ../src/visual_tool_vector_clip.cpp:65 +msgid "Draws a freehand shape" +msgstr "Рысаваць контур ад рукі" + +#: ../src/visual_tool_vector_clip.cpp:66 +msgid "Freehand smooth" +msgstr "Ад рукі згладжана" + +#: ../src/visual_tool_vector_clip.cpp:66 +msgid "Draws a smoothed freehand shape" +msgstr "Рысаваць згладжаны контур ад рукі" + +#: ../src/visual_tool_vector_clip.cpp:265 +msgid "delete control point" +msgstr "выдаленне кантрольнага пункту" + +#: ../src/dialog_automation.cpp:106 +msgid "Automation Manager" +msgstr "Менеджар аўтаматызацыі" + +#: ../src/dialog_automation.cpp:117 +msgid "&Add" +msgstr "&Дадаць" + +#: ../src/dialog_automation.cpp:118 +msgid "&Remove" +msgstr "&Выдаліць" + +#: ../src/dialog_automation.cpp:119 +msgid "Re&load" +msgstr "&Перазагрузіць" + +#: ../src/dialog_automation.cpp:120 +msgid "Show &Info" +msgstr "Паказаць &звесткі" + +#: ../src/dialog_automation.cpp:121 +msgid "Re&scan Autoload Dir" +msgstr "&Абнавіць папку аўтазагрузкі" + +#: ../src/dialog_automation.cpp:134 +msgid "Name" +msgstr "Назва" + +#: ../src/dialog_automation.cpp:135 +msgid "Filename" +msgstr "Назва файла" + +#: ../src/dialog_automation.cpp:136 +msgid "Description" +msgstr "Апісанне" + +#: ../src/dialog_automation.cpp:222 +msgid "Add Automation script" +msgstr "Дадаць скрыпт аўтаматызацыі" + +#: ../src/dialog_automation.cpp:277 +#, c-format +msgid "" +"Total scripts loaded: %d\n" +"Global scripts loaded: %d\n" +"Local scripts loaded: %d\n" +msgstr "" +"Усяго загружана скрыптаў: %d\n" +"Загружана глабальных скрыптаў: %d\n" +"Загружана лакальных скрыптаў: %d\n" + +#: ../src/dialog_automation.cpp:282 +msgid "Scripting engines installed:" +msgstr "Усталяваныя апрацоўшчыкі скрыптаў:" + +#: ../src/dialog_automation.cpp:295 +msgid "Correctly loaded" +msgstr "Карэктна загружаны" + +#: ../src/dialog_automation.cpp:295 +msgid "Failed to load" +msgstr "Не атрымалася загрузіць" + +#: ../src/dialog_automation.cpp:289 +#, c-format +msgid "" +"\n" +"Script info:\n" +"Name: %s\n" +"Description: %s\n" +"Author: %s\n" +"Version: %s\n" +"Full path: %s\n" +"State: %s\n" +"\n" +"Features provided by script:" +msgstr "" +"\n" +"Звесткі пра скрыпт:\n" +"Назва: %s\n" +"Апісанне: %s\n" +"Аўтар: %s\n" +"Версія: %s\n" +"Шлях: %s\n" +"Стан: %s\n" +"\n" +"Прадстаўлена:" + +#: ../src/dialog_automation.cpp:298 +#, c-format +msgid " Macro: %s (%s)" +msgstr "Макрас: %s (%s)" + +#: ../src/dialog_automation.cpp:301 +#, c-format +msgid " Export filter: %s" +msgstr "Фільтр экспарту: %s" + +#: ../src/dialog_automation.cpp:305 +msgid "Automation Script Info" +msgstr "Звесткі аб скрыпце аўтаматызацыі" + +#: ../src/dialog_export.cpp:102 +msgid "Export" +msgstr "Экспарт" + +#: ../src/dialog_export.cpp:123 +msgid "Move &Up" +msgstr "Перамясціць &вышэй" + +#: ../src/dialog_export.cpp:124 +msgid "Move &Down" +msgstr "Перамясціць &ніжэй" + +#: ../src/dialog_export.cpp:142 +msgid "Text encoding:" +msgstr "Кадзіроўка тэксту:" + +#: ../src/dialog_export.cpp:150 +msgid "Filters" +msgstr "Фільтры" + +#: ../src/dialog_export.cpp:157 +msgid "Export..." +msgstr "Экспарт..." + +#: ../src/dialog_export.cpp:189 +msgid "Export subtitles file" +msgstr "Экспарт файла субтытраў" + +#: ../src/dialog_search_replace.cpp:46 +msgid "Replace" +msgstr "Замяніць" + +#: ../src/dialog_search_replace.cpp:67 +msgid "Find what:" +msgstr "Знайсці:" + +#: ../src/dialog_search_replace.cpp:78 +msgid "&Match case" +msgstr "Улічваць &рэгістр" + +#: ../src/dialog_search_replace.cpp:79 +msgid "&Use regular expressions" +msgstr "Выкарыстоўваць рэгулярныя выразы" + +#: ../src/dialog_search_replace.cpp:81 +msgid "S&kip Override Tags" +msgstr "Прапусціць тэгі" + +#: ../src/dialog_search_replace.cpp:87 +msgid "St&yle" +msgstr "Стыль" + +#: ../src/dialog_search_replace.cpp:87 +msgid "A&ctor" +msgstr "Акцёр" + +#: ../src/dialog_search_replace.cpp:88 +msgid "A&ll rows" +msgstr "Усе радкі" + +#: ../src/dialog_search_replace.cpp:91 +msgid "Limit to" +msgstr "Абмежаваць" + +#: ../src/dialog_search_replace.cpp:93 +msgid "&Find next" +msgstr "&Знайсці тэкст" + +#: ../src/dialog_search_replace.cpp:94 +msgid "Replace &next" +msgstr "Замяніць &наступныя" + +#: ../src/dialog_autosave.cpp:66 +msgid "Open autosave file" +msgstr "Адкрыць аўтаматычна захаваны файл" + +#: ../src/dialog_autosave.cpp:75 +msgid "Versions" +msgstr "Версіі" + +#: ../src/dialog_autosave.cpp:85 +msgid "Open" +msgstr "Адкрыць" + +#: ../src/dialog_autosave.cpp:94 +#, c-format +msgid "%s [ORIGINAL BACKUP]" +msgstr "%s [АРЫГІНАЛЬНАЯ РЭЗЕРВОВАЯ КОПІЯ]" + +#: ../src/dialog_autosave.cpp:95 +#, c-format +msgid "%s [RECOVERED]" +msgstr "%s[АДНОЎЛЕНА] " + +#: ../src/audio_box.cpp:73 +msgid "Horizontal zoom" +msgstr "Гарызантальнае маштабаванне" + +#: ../src/audio_box.cpp:74 +msgid "Vertical zoom" +msgstr "Вертыкальнае маштабаванне" + +#: ../src/audio_box.cpp:75 +msgid "Audio Volume" +msgstr "Гучнасць аўдыя" + +#: ../src/grid_column.cpp:82 +msgid "#" +msgstr "№" + +#: ../src/grid_column.cpp:83 +msgid "Line Number" +msgstr "Нумар радка" + +#: ../src/grid_column.cpp:106 +msgid "L" +msgstr "С" + +#: ../src/grid_column.cpp:128 +msgid "Start" +msgstr "Пачатак" + +#: ../src/grid_column.cpp:146 +msgid "End" +msgstr "Канец" + +#: ../src/grid_column.cpp:237 ../src/dialog_style_editor.cpp:288 +msgid "Left" +msgstr "Лев" + +#: ../src/grid_column.cpp:238 +msgid "Left Margin" +msgstr "Водступ злева" + +#: ../src/grid_column.cpp:242 ../src/dialog_style_editor.cpp:288 +msgid "Right" +msgstr "Прав" + +#: ../src/grid_column.cpp:243 +msgid "Right Margin" +msgstr "Водступ справа" + +#: ../src/grid_column.cpp:247 ../src/dialog_style_editor.cpp:288 +msgid "Vert" +msgstr "Верт" + +#: ../src/grid_column.cpp:248 +msgid "Vertical Margin" +msgstr "Вертыкальны водступ" + +#: ../src/grid_column.cpp:266 +msgid "CPS" +msgstr "сімв./сек" + +#: ../src/grid_column.cpp:267 +msgid "Characters Per Second" +msgstr "Сімвалаў у секунду" + +#: ../src/dialog_text_import.cpp:47 +msgid "Text import options" +msgstr "Налады імпарту тэксту" + +#: ../src/dialog_text_import.cpp:54 +msgid "Actor separator:" +msgstr "Раздзяляльнік акцёраў:" + +#: ../src/dialog_text_import.cpp:56 +msgid "Comment starter:" +msgstr "Пачатак каментарыяў:" + +#: ../src/dialog_text_import.cpp:61 +msgid "Include blank lines" +msgstr "Уключаючы пустыя радкі" + +#: ../src/video_box.cpp:57 +msgid "Seek video" +msgstr "Пазіцыя відэа" + +#: ../src/video_box.cpp:62 +msgid "Current frame time and number" +msgstr "Час і нумар бягучага кадра" + +#: ../src/video_box.cpp:65 +msgid "Time of this frame relative to start and end of current subs" +msgstr "Час ад бягучага кадра да пачатку і канца радкоў" + +#: ../src/ass_style.cpp:193 +msgid "ANSI" +msgstr "ANSI" + +#: ../src/ass_style.cpp:195 +msgid "Symbol" +msgstr "Сімвал" + +#: ../src/ass_style.cpp:196 +msgid "Mac" +msgstr "Mac" + +#: ../src/ass_style.cpp:197 +msgid "Shift_JIS" +msgstr "Японская (Shift_JIS)" + +#: ../src/ass_style.cpp:198 +msgid "Hangeul" +msgstr "Хангыль" + +#: ../src/ass_style.cpp:199 +msgid "Johab" +msgstr "Карэйская (Johab)" + +#: ../src/ass_style.cpp:200 +msgid "GB2312" +msgstr "Спрошчаная кітайская (GB2312)" + +#: ../src/ass_style.cpp:201 +msgid "Chinese BIG5" +msgstr "Традыцыйная кітайская (BIG5)" + +#: ../src/ass_style.cpp:202 +msgid "Greek" +msgstr "Грэчаская" + +#: ../src/ass_style.cpp:203 +msgid "Turkish" +msgstr "Турэцкая" + +#: ../src/ass_style.cpp:204 +msgid "Vietnamese" +msgstr "В'етнамская" + +#: ../src/ass_style.cpp:205 +msgid "Hebrew" +msgstr "Іўрыт" + +#: ../src/ass_style.cpp:206 +msgid "Arabic" +msgstr "Арабская" + +#: ../src/ass_style.cpp:207 +msgid "Baltic" +msgstr "Балтыйская" + +#: ../src/ass_style.cpp:208 +msgid "Russian" +msgstr "Руская" + +#: ../src/ass_style.cpp:209 +msgid "Thai" +msgstr "Тайская" + +#: ../src/ass_style.cpp:210 +msgid "East European" +msgstr "Усходне-Еўрапейская" + +#: ../src/ass_style.cpp:211 +msgid "OEM" +msgstr "OEM" + +#: ../src/dialog_colorpicker.cpp:542 +msgid "Select Color" +msgstr "Выбраць колер" + +#: ../src/dialog_colorpicker.cpp:556 +msgid "Color spectrum" +msgstr "Спектр колеру" + +#: ../src/dialog_colorpicker.cpp:560 +msgid "RGB/R" +msgstr "RGB/R" + +#: ../src/dialog_colorpicker.cpp:560 +msgid "RGB/G" +msgstr "RGB/G" + +#: ../src/dialog_colorpicker.cpp:560 +msgid "RGB/B" +msgstr "RGB/B" + +#: ../src/dialog_colorpicker.cpp:560 +msgid "HSL/L" +msgstr "HSL/L" + +#: ../src/dialog_colorpicker.cpp:560 +msgid "HSV/H" +msgstr "HSV/H" + +#: ../src/dialog_colorpicker.cpp:567 +msgid "RGB color" +msgstr "Колер RGB" + +#: ../src/dialog_colorpicker.cpp:568 +msgid "HSL color" +msgstr "HSL колер" + +#: ../src/dialog_colorpicker.cpp:569 +msgid "HSV color" +msgstr "HSV колер" + +#: ../src/dialog_colorpicker.cpp:594 +msgid "Spectrum mode:" +msgstr "Рэжым спектра:" + +#: ../src/dialog_colorpicker.cpp:611 +msgid "Red:" +msgstr "Чырвоны:" + +#: ../src/dialog_colorpicker.cpp:611 +msgid "Green:" +msgstr "Зялёны:" + +#: ../src/dialog_colorpicker.cpp:611 +msgid "Blue:" +msgstr "Сіні:" + +#: ../src/dialog_colorpicker.cpp:614 +msgid "Alpha:" +msgstr "Празрыстасць:" + +#: ../src/dialog_colorpicker.cpp:621 ../src/dialog_colorpicker.cpp:624 +msgid "Hue:" +msgstr "Адц.:" + +#: ../src/dialog_colorpicker.cpp:621 ../src/dialog_colorpicker.cpp:624 +msgid "Sat.:" +msgstr "Нас.:" + +#: ../src/dialog_colorpicker.cpp:621 +msgid "Lum.:" +msgstr "Ярк.:" + +#: ../src/dialog_colorpicker.cpp:624 +msgid "Value:" +msgstr "Значэнне:" + +#: ../src/charset_detect.cpp:80 +msgid "" +"Aegisub could not narrow down the character set to a single one.\n" +"Please pick one below:" +msgstr "" +"Aegisub не можа дакладна вызначыць кадзіроўку файла.\n" +"Выберыце адну са спісу:" + +#: ../src/charset_detect.cpp:81 +msgid "Choose character set" +msgstr "Выбраць кадзіроўку" + +#: ../src/dialog_detached_video.cpp:66 ../src/dialog_detached_video.cpp:134 +#, c-format +msgid "Video: %s" +msgstr "Відэа: %s" + +#: ../src/subtitle_format.cpp:100 +#, c-format +msgid "From video (%g)" +msgstr "З відэа (%g)" + +#: ../src/subtitle_format.cpp:102 +msgid "From video (VFR)" +msgstr "З відэа (VFR)" + +#: ../src/subtitle_format.cpp:108 +msgid "15.000 FPS" +msgstr "15.000 кадр/сек" + +#: ../src/subtitle_format.cpp:109 +msgid "23.976 FPS (Decimated NTSC)" +msgstr "23.976 кадр/сек (Прарэджаны NTSC)" + +#: ../src/subtitle_format.cpp:110 +msgid "24.000 FPS (FILM)" +msgstr "24.000 кадр/сек (FILM)" + +#: ../src/subtitle_format.cpp:111 +msgid "25.000 FPS (PAL)" +msgstr "25.000 кадр/сек (PAL)" + +#: ../src/subtitle_format.cpp:112 +msgid "29.970 FPS (NTSC)" +msgstr "29.970 кадр/сек (NTSC)" + +#: ../src/subtitle_format.cpp:114 +msgid "29.970 FPS (NTSC with SMPTE dropframe)" +msgstr "29.970 кадр/сек (NTSC з SMPTE пропускам кадраў)" + +#: ../src/subtitle_format.cpp:115 +msgid "30.000 FPS" +msgstr "30.000 кадр/сек" + +#: ../src/subtitle_format.cpp:116 +msgid "50.000 FPS (PAL x2)" +msgstr "50.000 кадр/сек (PAL x2)" + +#: ../src/subtitle_format.cpp:117 +msgid "59.940 FPS (NTSC x2)" +msgstr "59.940 кадр/сек(NTSC x2)" + +#: ../src/subtitle_format.cpp:118 +msgid "60.000 FPS" +msgstr "60.000 кадр/сек" + +#: ../src/subtitle_format.cpp:119 +msgid "119.880 FPS (NTSC x4)" +msgstr "119.880 кадр/сек(NTSC x4)" + +#: ../src/subtitle_format.cpp:120 +msgid "120.000 FPS" +msgstr "120.000 кадр/сек" + +#: ../src/subtitle_format.cpp:124 +msgid "Please choose the appropriate FPS for the subtitles:" +msgstr "Выбраць частату кадраў для субтытраў:" + +#: ../src/subtitle_format.cpp:124 +msgid "FPS" +msgstr "кадр/сек" + +#: ../src/ffmpegsource_common.cpp:94 +msgid "Indexing" +msgstr "Індэксаванне" + +#: ../src/ffmpegsource_common.cpp:95 +msgid "Reading timecodes and frame/sample data" +msgstr "Чытанне таймкодаў і кадраў" + +#: ../src/ffmpegsource_common.cpp:141 +#, c-format +msgid "Track %02d: %s" +msgstr "Трэк %02d: %s" + +#: ../src/ffmpegsource_common.cpp:146 +msgid "" +"Multiple video tracks detected, please choose the one you wish to load:" +msgstr "Выяўлена некалькі відэатрэкаў, выберыце, які вы хочаце загрузіць:" + +#: ../src/ffmpegsource_common.cpp:146 +msgid "" +"Multiple audio tracks detected, please choose the one you wish to load:" +msgstr "Выяўлена некалькі аўдыятрэкаў, выберыце, якую вы хочаце загрузіць:" + +#: ../src/ffmpegsource_common.cpp:147 +msgid "Choose video track" +msgstr "Выбраць відэатрэк" + +#: ../src/ffmpegsource_common.cpp:147 +msgid "Choose audio track" +msgstr "Выбраць аўдыятрэк" + +#: ../src/resolution_resampler.cpp:287 +msgid "resolution resampling" +msgstr "пералік разрознення" + +#: ../src/project.cpp:187 +msgid "Do you want to load/unload the associated files?" +msgstr "Ці вы хочаце загрузіць/выгрузіць звязаныя файлы?" + +#: ../src/project.cpp:198 +msgid "Unload audio" +msgstr "Выгрузіць аўдыя" + +#: ../src/project.cpp:198 +#, c-format +msgid "Load audio file: %s" +msgstr "Загрузіць аўдыяфайл: %s" + +#: ../src/project.cpp:200 +msgid "Unload video" +msgstr "Выгрузіць відэа" + +#: ../src/project.cpp:200 +#, c-format +msgid "Load video file: %s" +msgstr "Загрузіць відэафайл: %s" + +#: ../src/project.cpp:202 +msgid "Unload timecodes" +msgstr "Выгрузіць таймкоды" + +#: ../src/project.cpp:202 +#, c-format +msgid "Load timecodes file: %s" +msgstr "Загрузіць файл таймкодаў: %s" + +#: ../src/project.cpp:204 +msgid "Unload keyframes" +msgstr "Выгрузіць ключкадры" + +#: ../src/project.cpp:204 +#, c-format +msgid "Load keyframes file: %s" +msgstr "Загрузіць файл ключкадраў: %s" + +#: ../src/project.cpp:206 +msgid "(Un)Load files?" +msgstr "Загрузіць/Выгрузіць файлы?" + +#: ../src/project.cpp:255 +msgid "The audio file was not found: " +msgstr "Аўдыяфайл не знойдзены:" + +#: ../src/project.cpp:263 +msgid "" +"None of the available audio providers recognised the selected file as containing audio data.\n" +"\n" +"The following providers were tried:\n" +msgstr "" +"Ніводны з даступных правайдараў аўдыя не распазнаў выбраны файл як файл з аўдыяданымі.\n" +"\n" +"Былі скарыстаны наступныя правайдары:\n" + +#: ../src/project.cpp:266 +msgid "" +"None of the available audio providers have a codec available to handle the selected file.\n" +"\n" +"The following providers were tried:\n" +msgstr "" +"Ніводны з даступных правайдараў аўдыя не мае кодэкаў для апрацоўкі выбранага файла.\n" +"\n" +"Былі скарыстаны наступныя правайдары:\n" + +#: ../src/dialog_style_editor.cpp:127 +msgid "Style Editor" +msgstr "Рэдактар стыля" + +#: ../src/dialog_style_editor.cpp:178 +msgid "Font" +msgstr "Шрыфт" + +#: ../src/dialog_style_editor.cpp:180 +msgid "Margins" +msgstr "Водступы" + +#: ../src/dialog_style_editor.cpp:181 ../src/dialog_style_editor.cpp:277 +msgid "Outline" +msgstr "Контур" + +#: ../src/dialog_style_editor.cpp:182 +msgid "Miscellaneous" +msgstr "Рознае" + +#: ../src/dialog_style_editor.cpp:183 +msgid "Preview" +msgstr "Перадпрагляд" + +#: ../src/dialog_style_editor.cpp:189 +msgid "&Bold" +msgstr "&Тоўсты" + +#: ../src/dialog_style_editor.cpp:190 +msgid "&Italic" +msgstr "&Курсіў" + +#: ../src/dialog_style_editor.cpp:191 +msgid "&Underline" +msgstr "&Падкрэслены" + +#: ../src/dialog_style_editor.cpp:192 +msgid "&Strikeout" +msgstr "&Закрэслены" + +#: ../src/dialog_style_editor.cpp:204 +msgid "Alignment" +msgstr "Выраўноўванне" + +#: ../src/dialog_style_editor.cpp:207 +msgid "&Opaque box" +msgstr "&Непразрысты фон" + +#: ../src/dialog_style_editor.cpp:215 +msgid "Style name" +msgstr "Назва стыля" + +#: ../src/dialog_style_editor.cpp:216 +msgid "Font face" +msgstr "Шрыфт" + +#: ../src/dialog_style_editor.cpp:217 +msgid "Font size" +msgstr "Памер шрыфта" + +#: ../src/dialog_style_editor.cpp:218 +msgid "Choose primary color" +msgstr "Выбраць першасны колер" + +#: ../src/dialog_style_editor.cpp:219 +msgid "Choose secondary color" +msgstr "Выбраць другасны колер" + +#: ../src/dialog_style_editor.cpp:220 +msgid "Choose outline color" +msgstr "Выбраць колер контуру" + +#: ../src/dialog_style_editor.cpp:221 +msgid "Choose shadow color" +msgstr "Выбраць колер ценю" + +#: ../src/dialog_style_editor.cpp:222 +msgid "Distance from left edge, in pixels" +msgstr "Адлегласць ад левага краю, у пікселях" + +#: ../src/dialog_style_editor.cpp:223 +msgid "Distance from right edge, in pixels" +msgstr "Адлегласць ад правага краю, у пікселях" + +#: ../src/dialog_style_editor.cpp:224 +msgid "Distance from top/bottom edge, in pixels" +msgstr "Водступ ад верхняга/ніжняга краю, у пікселях" + +#: ../src/dialog_style_editor.cpp:225 +msgid "" +"When selected, display an opaque box behind the subtitles instead of an " +"outline around the text" +msgstr "Калі ўключана, будзе паказвацца непразрыстая рамка замест контуру" + +#: ../src/dialog_style_editor.cpp:226 +msgid "Outline width, in pixels" +msgstr "Шырыня контуру, у пікселях" + +#: ../src/dialog_style_editor.cpp:227 +msgid "Shadow distance, in pixels" +msgstr "Адлегласць ценю, у пікселях" + +#: ../src/dialog_style_editor.cpp:228 +msgid "Scale X, in percentage" +msgstr "Маштаб па восі Х, у працэнтах" + +#: ../src/dialog_style_editor.cpp:229 +msgid "Scale Y, in percentage" +msgstr "Маштаб па восі Y, у працэнтах" + +#: ../src/dialog_style_editor.cpp:230 +msgid "Angle to rotate in Z axis, in degrees" +msgstr "Паварочванне па восі Z, у градусах" + +#: ../src/dialog_style_editor.cpp:231 +msgid "" +"Encoding, only useful in unicode if the font doesn't have the proper unicode" +" mapping" +msgstr "" +"Пры Юнікодзе, пабочныя кадзіроўкі выкарыстоўваюцца толькі калі шрыфт не мае " +"набору сімвалаў Юнікода" + +#: ../src/dialog_style_editor.cpp:232 +msgid "Character spacing, in pixels" +msgstr "Інтэрвал паміж сімваламі, у пікселях" + +#: ../src/dialog_style_editor.cpp:233 +msgid "Alignment in screen, in numpad style" +msgstr "Выраўноўванне як на лічбавай клавіятуры" + +#: ../src/dialog_style_editor.cpp:277 +msgid "Primary" +msgstr "Першасны" + +#: ../src/dialog_style_editor.cpp:277 +msgid "Secondary" +msgstr "Другасны" + +#: ../src/dialog_style_editor.cpp:277 +msgid "Shadow" +msgstr "Цень" + +#: ../src/dialog_style_editor.cpp:306 +msgid "Outline:" +msgstr "Контур:" + +#: ../src/dialog_style_editor.cpp:307 +msgid "Shadow:" +msgstr "Цень:" + +#: ../src/dialog_style_editor.cpp:312 +msgid "Scale X%:" +msgstr "Маштаб X%:" + +#: ../src/dialog_style_editor.cpp:313 +msgid "Scale Y%:" +msgstr "Маштаб Y%:" + +#: ../src/dialog_style_editor.cpp:314 +msgid "Rotation:" +msgstr "Паварот:" + +#: ../src/dialog_style_editor.cpp:315 +msgid "Spacing:" +msgstr "Інтэрвал:" + +#: ../src/dialog_style_editor.cpp:318 +msgid "Encoding:" +msgstr "Кадзіроўка:" + +#: ../src/dialog_style_editor.cpp:328 +msgid "Preview of current style" +msgstr "Перадпрагляд бягучага стыля" + +#: ../src/dialog_style_editor.cpp:331 +msgid "Text to be used for the preview" +msgstr "Тэкст для перадпрагляду" + +#: ../src/dialog_style_editor.cpp:332 +msgid "Color of preview background" +msgstr "Колер перадпрагляду фону" + +#: ../src/dialog_style_editor.cpp:413 +msgid "There is already a style with this name. Please choose another name." +msgstr "Ужо існуе стыль пад дадзенай назвай. Выберыце іншае імя." + +#: ../src/dialog_style_editor.cpp:413 +msgid "Style name conflict" +msgstr "Канфлікт назваў стыляў" + +#: ../src/dialog_style_editor.cpp:425 +msgid "" +"Do you want to change all instances of this style in the script to this new " +"name?" +msgstr "Змяніць назву стыля ва ўсіх радках, дзе ён выкарыстоўваецца?" + +#: ../src/dialog_style_editor.cpp:426 +msgid "Update script?" +msgstr "Абнавіць скрыпт?" + +#: ../src/dialog_export_ebu3264.cpp:84 +msgid "" +"Time code offset in incorrect format. Ensure it is entered as four groups of" +" two digits separated by colons." +msgstr "" +"Зрушэнне таймкода зададзена ў няправільным фармаце. Праверце, павінна быць 4" +" групы па 2 лічбы праз двукроп'і." + +#: ../src/dialog_export_ebu3264.cpp:84 +msgid "EBU STL export" +msgstr "Экспарт EBU STL" + +#: ../src/dialog_export_ebu3264.cpp:100 +msgid "Export to EBU STL format" +msgstr "Экспарт у фармат EBU STL" + +#: ../src/dialog_export_ebu3264.cpp:103 +msgid "23.976 fps (non-standard, STL24.01)" +msgstr "23.976 кадр/сек (нестандартна, STL24.01)" + +#: ../src/dialog_export_ebu3264.cpp:104 +msgid "24 fps (non-standard, STL24.01)" +msgstr "24 кадр/сек (нестандартна, STL24.01)" + +#: ../src/dialog_export_ebu3264.cpp:105 +msgid "25 fps (STL25.01)" +msgstr "25 кадр/с (STL25.01)" + +#: ../src/dialog_export_ebu3264.cpp:106 +msgid "29.97 fps (non-dropframe, STL30.01)" +msgstr "29.97 кадр/сек (без пропуску кадраў, STL30.01)" + +#: ../src/dialog_export_ebu3264.cpp:107 +msgid "29.97 fps (dropframe, STL30.01)" +msgstr "29.97 кадр/сек (з пропускам кадраў, STL30.01)" + +#: ../src/dialog_export_ebu3264.cpp:108 +msgid "30 fps (STL30.01)" +msgstr "30 кадр/с (STL30.01)" + +#: ../src/dialog_export_ebu3264.cpp:110 +msgid "TV standard" +msgstr "ТБ-стандарт" + +#: ../src/dialog_export_ebu3264.cpp:113 +msgid "Out-times are inclusive" +msgstr "Залішні час уключаны" + +#: ../src/dialog_export_ebu3264.cpp:116 +msgid "ISO 6937-2 (Latin/Western Europe)" +msgstr "ISO 6937-2 (Лацінка/Заходняя Еўропа)" + +#: ../src/dialog_export_ebu3264.cpp:117 +msgid "ISO 8859-5 (Cyrillic)" +msgstr "ISO 8859-5 (Кірыліца)" + +#: ../src/dialog_export_ebu3264.cpp:118 +msgid "ISO 8859-6 (Arabic)" +msgstr "ISO 8859-6 (Арабскі)" + +#: ../src/dialog_export_ebu3264.cpp:119 +msgid "ISO 8859-7 (Greek)" +msgstr "ISO 8859-7 (Грэчаскі)" + +#: ../src/dialog_export_ebu3264.cpp:120 +msgid "ISO 8859-8 (Hebrew)" +msgstr "ISO 8859-8 (Еўрапескі)" + +#: ../src/dialog_export_ebu3264.cpp:121 +msgid "UTF-8 Unicode (non-standard)" +msgstr "UTF-8 Unicode (нестандартна)" + +#: ../src/dialog_export_ebu3264.cpp:123 +msgid "Text encoding" +msgstr "Кадзіроўка" + +#: ../src/dialog_export_ebu3264.cpp:126 +msgid "Automatically wrap long lines (ASS)" +msgstr "Аўтаматычна пераносіць доўгія радкі (ASS)" + +#: ../src/dialog_export_ebu3264.cpp:127 +msgid "Automatically wrap long lines (Balanced)" +msgstr "Аўтаматычна пераносіць доўгія радкі (сбалансавана)" + +#: ../src/dialog_export_ebu3264.cpp:128 +msgid "Abort if any lines are too long" +msgstr "Перапыняць, калі радок занадта доўгі" + +#: ../src/dialog_export_ebu3264.cpp:129 +msgid "Skip lines that are too long" +msgstr "Прапускаць занадта доўгія радкі" + +#: ../src/dialog_export_ebu3264.cpp:134 +msgid "Translate alignments" +msgstr "Выраўноўванне перакладу" + +#: ../src/dialog_export_ebu3264.cpp:139 +msgid "Open subtitles" +msgstr "Адкрыць субтытры" + +#: ../src/dialog_export_ebu3264.cpp:140 +msgid "Level-1 teletext" +msgstr "Level-1 тэлетэкст" + +#: ../src/dialog_export_ebu3264.cpp:141 +msgid "Level-2 teletext" +msgstr "Level-2 тэлетэкст" + +#: ../src/dialog_export_ebu3264.cpp:147 +msgid "Max. line length:" +msgstr "Макс. даўжыня радка:" + +#: ../src/dialog_export_ebu3264.cpp:151 +msgid "Time code offset:" +msgstr "Зрушэнне таймкода:" + +#: ../src/dialog_export_ebu3264.cpp:154 +msgid "Text formatting" +msgstr "Фарматаванне тэксту" + +#: ../src/dialog_export_ebu3264.cpp:159 +msgid "Time codes" +msgstr "Таймкоды" + +#: ../src/dialog_export_ebu3264.cpp:163 +msgid "Display standard" +msgstr "Стандарт паказу" + +#: ../src/subs_controller.cpp:158 +#, c-format +msgid "File backup saved as \"%s\"." +msgstr "Рэзервовы файл захаваны як \"%s\"." + +#: ../src/subs_controller.cpp:260 +#, c-format +msgid "Do you want to save changes to %s?" +msgstr "Ці вы хочаце захаваць змены ў %s?" + +#: ../src/subs_controller.cpp:260 +msgid "Unsaved changes" +msgstr "Незахаваныя змены" + +#: ../src/subs_controller.cpp:395 +msgid "Untitled" +msgstr "Без імені" + +#: ../src/subs_controller.cpp:397 +msgid "untitled" +msgstr "без імені" + +#: ../src/dialog_video_properties.cpp:44 +msgid "Resolution mismatch" +msgstr "Несупадзенне разрознення" + +#: ../src/dialog_video_properties.cpp:46 +#, c-format +msgid "" +"The resolution of the loaded video and the resolution specified for the subtitles don't match.\n" +"\n" +"Video resolution:\t%d x %d\n" +"Script resolution:\t%d x %d\n" +"\n" +"Change subtitles resolution to match video?" +msgstr "" +"Разрозненне загружанага відэа і разрозненне субтытраў не супадаюць.\n" +"\n" +"Разрозненне відэа:\t%d x %d\n" +"Разрозненне субтытраў :\t%d x %d\n" +"\n" +"Змяніць разрозненне субтытраў на разрозненне відэа?" + +#: ../src/dialog_video_properties.cpp:54 ../src/dialog_video_properties.cpp:63 +msgid "Set to video resolution" +msgstr "Задаць як у разрознення відэа" + +#: ../src/dialog_video_properties.cpp:55 +msgid "Resample script (stretch to new aspect ratio)" +msgstr "Пералічыць скрыпт (расцягнуць да новых суадносін бакоў)" + +#: ../src/dialog_video_properties.cpp:56 +msgid "Resample script (add borders)" +msgstr "Пералічыць скрыпт (дадаць контуры)" + +#: ../src/dialog_video_properties.cpp:57 +msgid "Resample script (remove borders)" +msgstr "Пералічыць скрыпт (выдаліць контуры)" + +#: ../src/dialog_video_properties.cpp:64 +msgid "Resample script" +msgstr "Пералічыць скрыпт" + +#: ../src/dialog_video_properties.cpp:163 +msgid "change script resolution" +msgstr "змяніць разрозненне сцэнарыя" + +#: ../src/dialog_attachments.cpp:68 +msgid "Attachment List" +msgstr "Спіс далучэнняў" + +#: ../src/dialog_attachments.cpp:76 +msgid "Attach &Font" +msgstr "Далучыць &шрыфт" + +#: ../src/dialog_attachments.cpp:77 +msgid "Attach &Graphics" +msgstr "Далучыць &графіку" + +#: ../src/dialog_attachments.cpp:78 +msgid "E&xtract" +msgstr "В&ыняць" + +#: ../src/dialog_attachments.cpp:110 +msgid "Attachment name" +msgstr "Імя ўкладання" + +#: ../src/dialog_attachments.cpp:111 +msgid "Size" +msgstr "Памер" + +#: ../src/dialog_attachments.cpp:112 +msgid "Group" +msgstr "Група" + +#: ../src/dialog_attachments.cpp:138 ../src/dialog_attachments.cpp:147 +msgid "Choose file to be attached" +msgstr "Выбраць файл для далучэння" + +#: ../src/dialog_attachments.cpp:142 +msgid "attach font file" +msgstr "далучэнне шрыфта" + +#: ../src/dialog_attachments.cpp:152 +msgid "attach graphics file" +msgstr "далучэнне графікі" + +#: ../src/dialog_attachments.cpp:164 +msgid "Select the path to save the files to:" +msgstr "Выбраць шлях для захавання файлаў:" + +#: ../src/dialog_attachments.cpp:167 +msgid "Select the path to save the file to:" +msgstr "Выбраць шлях для захавання файла:" + +#: ../src/dialog_attachments.cpp:189 +msgid "remove attachment" +msgstr "выдаленне далучэння" + +#: ../src/dialog_translation.cpp:77 +msgid "Original" +msgstr "Арыгінал" + +#: ../src/dialog_translation.cpp:100 +msgid "Translation" +msgstr "Пераклад" + +#: ../src/dialog_translation.cpp:115 +msgid "Insert original" +msgstr "Уставіць арыгінал" + +#: ../src/dialog_translation.cpp:118 +msgid "Delete line" +msgstr "Выдаліць радок" + +#: ../src/dialog_translation.cpp:121 +msgid "Enable &preview" +msgstr "Уключыць &перадпрагляд" + +#: ../src/dialog_translation.cpp:178 ../src/dialog_translation.cpp:278 +msgid "No more lines to translate." +msgstr "Больш няма радкоў для перакладу." + +#: ../src/dialog_translation.cpp:186 ../src/dialog_translation.cpp:236 +#, c-format +msgid "Current line: %d/%d" +msgstr "Бягучы радок: %d/%d" + +#: ../src/dialog_translation.cpp:273 +msgid "translation assistant" +msgstr "памочнік перакладу" + +#: ../src/visual_tool.cpp:122 +msgid "visual typesetting" +msgstr "візуальнае афармленне" + +#: ../src/dialog_resample.cpp:119 +msgid "&Symmetrical" +msgstr "&Сіметрычна" + +#: ../src/dialog_resample.cpp:143 +msgid "From s&cript" +msgstr "З скрыпту" + +#: ../src/dialog_resample.cpp:146 +msgid "Stretch" +msgstr "Расцягнуць" + +#: ../src/dialog_resample.cpp:146 +msgid "Add borders" +msgstr "Дадаць межы" + +#: ../src/dialog_resample.cpp:146 +msgid "Remove borders" +msgstr "Выдаліць межы" + +#: ../src/dialog_resample.cpp:146 +msgid "Manual" +msgstr "Уручную" + +#: ../src/dialog_resample.cpp:147 +msgid "Aspect Ratio Handling" +msgstr "Апрацоўка суадносін бакоў" + +#: ../src/dialog_resample.cpp:162 +msgid "Margin offset" +msgstr "Змяшчэнне межаў" + +#: ../src/dialog_resample.cpp:167 ../src/dialog_resample.cpp:181 +msgid "x" +msgstr "x" + +#: ../src/dialog_resample.cpp:172 ../src/dialog_resample.cpp:186 +msgid "YCbCr Matrix:" +msgstr "Матрыца YCbCr:" + +#: ../src/dialog_resample.cpp:175 +msgid "Source Resolution" +msgstr "Зыходнае разрозненне" + +#: ../src/dialog_resample.cpp:189 +msgid "Destination Resolution" +msgstr "Мэтавае разрозненне" + +#: ../src/dialog_version_check.cpp:94 +msgid "Version Checker" +msgstr "Праверка версій" + +#: ../src/dialog_version_check.cpp:119 +msgid "&Auto Check for Updates" +msgstr "&Аўтаматычна правяраць абнаўленні" + +#: ../src/dialog_version_check.cpp:124 +msgid "Remind me again in a &week" +msgstr "Нагадаць праз &тыдзень" + +#: ../src/dialog_version_check.cpp:288 +msgid "Could not connect to updates server." +msgstr "Немагчыма падлучыцца да сервера абнаўленняў." + +#: ../src/dialog_version_check.cpp:310 +msgid "Could not download from updates server." +msgstr "Немагчыма спампаваць абнаўленне з сервера." + +#: ../src/dialog_version_check.cpp:312 +#, c-format +msgid "HTTP request failed, got HTTP response %d." +msgstr "Памылка HTTP-запыту, атрыманы адказ HTTP %d." + +#: ../src/dialog_version_check.cpp:343 +msgid "An update to Aegisub was found." +msgstr "Знойдзена абнаўленне Aegisub." + +#: ../src/dialog_version_check.cpp:345 +msgid "Several possible updates to Aegisub were found." +msgstr "Знойдзена некалькі абнаўленняў Aegisub." + +#: ../src/dialog_version_check.cpp:347 +msgid "There are no updates to Aegisub." +msgstr "Абнаўленняў Aegisub няма." + +#: ../src/dialog_version_check.cpp:375 +#, c-format +msgid "" +"There was an error checking for updates to Aegisub:\n" +"%s\n" +"\n" +"If other applications can access the Internet fine, this is probably a temporary server problem on our end." +msgstr "" +"Адбылася памылка праверкі абнаўленняў Aegisub:\n" +"%s\n" +"\n" +"Калі ў іншых праграм няма праблем з доступам да інтэрнэта, верагодна, гэта часовая памылка сервера на нашым канцы." + +#: ../src/dialog_version_check.cpp:379 +msgid "An unknown error occurred while checking for updates to Aegisub." +msgstr "Адбылася невядомая памылка падчас праверкі абнаўленняў Aegisub." + +#: default_menu.json:0 +msgid "&Insert (before)" +msgstr "&Уставіць (перад)" + +#: default_menu.json:0 +msgid "Insert (after)" +msgstr "Уставіць (пасля)" + +#: default_menu.json:0 +msgid "Insert at video time (before)" +msgstr "Уставіць па часу відэа (перад)" + +#: default_menu.json:0 +msgid "Insert at video time (after)" +msgstr "Уставіць па часу відэа (пасля)" + +#: default_menu.json:0 +msgid "&Join (concatenate)" +msgstr "&Аб'яднаць" + +#: default_menu.json:0 +msgid "Join (keep first)" +msgstr "Аб'яднаць (пакінуць першы)" + +#: default_menu.json:0 +msgid "Join (as Karaoke)" +msgstr "Аб'яднаць (як караоке)" + +#: default_menu.json:0 +msgid "&Make times continuous (change start)" +msgstr "Зрабіць &бесперапынным (змяніць пачатак)" + +#: default_menu.json:0 +msgid "&Make times continuous (change end)" +msgstr "Зрабіць &бесперапынным (змяніць канец)" + +#: default_menu.json:0 +msgid "&File" +msgstr "&Файл" + +#: default_menu.json:0 +msgid "&Subtitle" +msgstr "&Субтытры" + +#: default_menu.json:0 +msgid "&Timing" +msgstr "&Таймінг" + +#: default_menu.json:0 +msgid "&Video" +msgstr "&Відэа" + +#: default_menu.json:0 +msgid "&Audio" +msgstr "&Аўдыя" + +#: default_menu.json:0 +msgid "A&utomation" +msgstr "&Аўтаматызацыя" + +#: default_menu.json:0 +msgid "Vie&w" +msgstr "Выгля&д" + +#: default_menu.json:0 +msgid "&Help" +msgstr "&Дапамога" + +#: default_menu.json:0 +msgid "&Insert Lines" +msgstr "&Уставіць радкі" + +#: default_menu.json:0 +msgid "Join Lines" +msgstr "Аб'яднаць радкі" + +#: default_menu.json:0 +msgid "Sort All Lines" +msgstr "Сартаваць усе радкі" + +#: default_menu.json:0 +msgid "Sort Selected Lines" +msgstr "Сартаваць выбраныя радкі" + +#: default_menu.json:0 +msgid "Make Times Continuous" +msgstr "Зрабіць таймінг бесперапынным" + +#: default_menu.json:0 +msgid "Set &Zoom" +msgstr "Задаць &маштаб" + +#: default_menu.json:0 +msgid "Override &AR" +msgstr "Змяніць &суадносіны бакоў" + +#: default_menu.json:0 +msgid "&Export As..." +msgstr "&Экспартаваць як..." + +#: default_hotkey.json:602: +msgid "Subtitle Edit Box" +msgstr "Поле рэдагавання субтытраў" + +#: ../automation/autoload/macro-1-edgeblur.lua:6 +msgid "Add edgeblur" +msgstr "Дадаць размыццё краёў" + +#: ../automation/autoload/macro-1-edgeblur.lua:7 +msgid "" +"A demo macro showing how to do simple line modification in Automation 4" +msgstr "" +"Прыклад макрас аўтаматызацыі 4 версіі для звычайнай мадыфікацыі радкоў" + +#: ../automation/autoload/macro-1-edgeblur.lua:21 +msgid "Adds \\be1 tags to all selected lines" +msgstr "Дадае \\be1 да ўсіх вылучаных радкоў" + +#: ../automation/autoload/karaoke-auto-leadin.lua:32 +msgid "Automatic karaoke lead-in" +msgstr "Аўтаматычны ўступ для караоке" + +#: ../automation/autoload/karaoke-auto-leadin.lua:33 +msgid "Join up the ends of selected lines and add \\k tags to shift karaoke" +msgstr "Аб'яднаць вылучаныя радкі і дадаць тэгі \\k для зрушэння караоке" + +#: ../automation/autoload/cleantags-autoload.lua:31 +msgid "Clean Tags" +msgstr "Ачысціць тэгі" + +#: ../automation/autoload/cleantags-autoload.lua:32 +msgid "" +"Clean subtitle lines by re-arranging ASS tags and override blocks within the" +" lines" +msgstr "" +"Ачысціць радкі субтытраў перастаноўкай ASS-тэгаў і блокаў перавызначэння " +"ўнутры радкоў" + +#: ../automation/autoload/kara-templater.lua:36 +msgid "Karaoke Templater" +msgstr "Шабланізатар караоке" + +#: ../automation/autoload/kara-templater.lua:37 +msgid "" +"Macro and export filter to apply karaoke effects using the template language" +msgstr "" +"Макрас і фільтр экспарту для стварэння эфектаў караоке з дапамогай мовы " +"шаблонаў" + +#: ../automation/autoload/kara-templater.lua:858 +msgid "Apply karaoke template" +msgstr "Дастасаваць шаблон караоке" + +#: ../automation/autoload/kara-templater.lua:858 +msgid "Applies karaoke effects from templates" +msgstr "Дастасоўвае эфекты караоке з шаблонаў" + +#: ../automation/autoload/kara-templater.lua:859 +msgid "Karaoke template" +msgstr "Шаблон караоке" + +#: ../automation/autoload/kara-templater.lua:859 +msgid "" +"Apply karaoke effect templates to the subtitles.\n" +"\n" +"See the help file for information on how to use this." +msgstr "" +"Дастасоўвае шаблоны эфектаў караоке да субтытраў.\n" +"\n" +"Гл. файл дапамогі для звестак пра выкарыстанне." + +#: ../automation/autoload/strip-tags.lua:17 +msgid "Strip tags" +msgstr "Выдаленне тэгаў" + +#: ../automation/autoload/strip-tags.lua:18 +msgid "Remove all override tags from selected lines" +msgstr "Выдаліць усе тэгі з вылучаных радкоў" + +#: ../automation/autoload/strip-tags.lua:28 +msgid "strip tags" +msgstr "выдаленне тэгаў" + +#: ../automation/autoload/macro-2-mkfullwitdh.lua:77 +msgid "Make fullwidth" +msgstr "Зрабіць на ўсю шырыню" + +#: ../automation/autoload/macro-2-mkfullwitdh.lua:80 +msgid "Convert Latin letters to SJIS fullwidth letters" +msgstr "Канвертаваць лацінскія літары ў літары на ўсю шырыню SJIS " + +#: aegisub.desktop:4 +msgid "Aegisub" +msgstr "Aegisub" + +#: aegisub.desktop:5 +msgid "Subtitle Editor" +msgstr "Рэдактар субтытраў" + +#: aegisub.desktop:6 +msgid "Create and edit subtitles for film and videos." +msgstr "Стварыць і рэдагаваць субтытры для фільмаў і відэа." + +#: packages/win_installer/fragment_strings.iss:1 +msgid "Installing runtime libraries..." +msgstr "Усталяванне бібліятэк асяроддзя выканання..." + +#: packages/win_installer/fragment_strings.iss:1 +msgid "Create a start menu icon" +msgstr "Стварыць значок у меню \"Пуск\"" + +#: packages/win_installer/fragment_strings.iss:1 +msgid "Automatically check for new versions of Aegisub" +msgstr "Аўтаматычна правяраць абнаўленні Aegisub" + +#: packages/win_installer/fragment_strings.iss:1 +msgid "Update Checker:" +msgstr "Праверка абнаўленняў:" + +#: packages/win_installer/fragment_strings.iss:1 +msgid "" +"This will install Aegisub {#BUILD_GIT_VERSION_STRING} on your " +"computer.%n%nAegisub is covered by the GNU General Public License version 2." +" This means you may use the application for any purpose without charge, but " +"that no warranties of any kind are given either.%n%nSee the Aegisub website " +"for information on obtaining the source code." +msgstr "" +"Гэта ўсталюе Aegisub {#BUILD_GIT_VERSION_STRING} на ваш " +"камп'ютар.%n%nAegisub распаўсюджваецца па ліцэнзіі GNU General Public " +"License version 2. Гэта азначае, што вы можаце выкарыстоўваць гэту праграму " +"для любых мэт, але без якіх-небудзь гарантый.%n%nКаб даведацца пра атрыманне" +" зыходнага кода, перайдзіце на сайт Aegisub." From 7094bd1e201cf5ec5790594767374ee9dd6147ec Mon Sep 17 00:00:00 2001 From: darealshinji Date: Mon, 18 Feb 2019 17:18:18 +0100 Subject: [PATCH 018/271] Add configure option to enable portable builds on Linux --- Makefile.inc.in | 2 +- configure.ac | 46 ++++++++++++++++++++++++++++++++-------- libaegisub/unix/path.cpp | 40 +++++++++++++++++++++++++++++++++- src/Makefile | 1 + src/aegisublocale.cpp | 3 +++ 5 files changed, 81 insertions(+), 11 deletions(-) diff --git a/Makefile.inc.in b/Makefile.inc.in index 7a994bb8b..3404a13a2 100644 --- a/Makefile.inc.in +++ b/Makefile.inc.in @@ -57,7 +57,7 @@ P_LOCALE = @localedir@ P_APPDATA = @P_APPDATA@ P_DESKTOP = @P_DESKTOP@ P_ICON = @P_ICON@ -P_DATA = $(P_DATAROOT)/aegisub/ +P_DATA = @P_DATA@ ############### # LIBRARY FLAGS diff --git a/configure.ac b/configure.ac index 98542ea11..44a3860d4 100644 --- a/configure.ac +++ b/configure.ac @@ -50,9 +50,10 @@ AC_SUBST(AEGISUB_COMMAND) AC_DEFINE_UNQUOTED([AEGISUB_COMMAND], ["${AEGISUB_COMMAND}"], [Name of the Aegisub executable]) # Name of gettext catalog. -AEGISUB_CATALOG="aegisub" -AC_SUBST(AEGISUB_CATALOG) -AC_DEFINE_UNQUOTED([AEGISUB_CATALOG], ["${AEGISUB_CATALOG}"], [Name of the Aegisub gettext catalog]) +# See '--enable-appimage' +#AEGISUB_CATALOG="aegisub" +#AC_SUBST(AEGISUB_CATALOG) +#AC_DEFINE_UNQUOTED([AEGISUB_CATALOG], ["${AEGISUB_CATALOG}"], [Name of the Aegisub gettext catalog]) # Handle location of appdata files: https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#spec-component-location AC_ARG_WITH(appdata-dir, @@ -566,6 +567,32 @@ AC_SUBST(DEFAULT_PLAYER_AUDIO) # Set some friendly strings if some of the above aren't detected. DEFAULT_PLAYER_AUDIO=${DEFAULT_PLAYER_AUDIO:-NONE} +################ +# AppImage build +################ +# If enabled, localization and automation data is obtained from the binary's +# path and never from the system's root. It will also install files that +# Aegisub will lookup next to the binary, so be careful with "make install". +AC_ARG_ENABLE(appimage, + AS_HELP_STRING([--enable-appimage], + [Enable certain relocation settings useful for building AppImages or generic portable builds [no]])) + +P_DATA="$datarootdir/aegisub" +AEGISUB_CATALOG="aegisub" + +AS_IF([test x$enable_appimage = xyes], [ + AC_DEFINE([APPIMAGE_BUILD], [], [Define to enable AppImage compatible relocations]) + P_DATA="$bindir" + localedir="$bindir/locale" + # use a different catalog name + AEGISUB_CATALOG="aegisub-appimage" +]) + +enable_appimage=${enable_appimage:-no} +AC_SUBST(P_DATA) +AC_SUBST(AEGISUB_CATALOG) +AC_DEFINE_UNQUOTED([AEGISUB_CATALOG], ["${AEGISUB_CATALOG}"], [Name of the Aegisub gettext catalog]) + ############### # Misc settings ############### @@ -614,12 +641,13 @@ AC_MSG_RESULT([ Configure settings Install prefix: $prefix Revision: $BUILD_GIT_VERSION_STRING - Debug $enable_debug - CFLAGS $CFLAGS - CXXFLAGS $CXXFLAGS - CPPFLAGS $CPPFLAGS - LDFLAGS $LDFLAGS - LIBS $LIBS + Debug: $enable_debug + AppImage: $enable_appimage + CFLAGS: $CFLAGS + CXXFLAGS: $CXXFLAGS + CPPFLAGS: $CPPFLAGS + LDFLAGS: $LDFLAGS + LIBS: $LIBS Default Settings Audio Player: $DEFAULT_PLAYER_AUDIO diff --git a/libaegisub/unix/path.cpp b/libaegisub/unix/path.cpp index 0541e0dbe..8fa14cd19 100644 --- a/libaegisub/unix/path.cpp +++ b/libaegisub/unix/path.cpp @@ -22,6 +22,12 @@ #include #include +#ifndef __APPLE__ +#include +#include +#include +#endif + namespace { #ifndef __APPLE__ std::string home_dir() { @@ -35,7 +41,30 @@ std::string home_dir() { throw agi::EnvironmentError("Could not get home directory. Make sure HOME is set."); } + +#ifdef APPIMAGE_BUILD +std::string exe_dir() { + char *exe, *dir; + std::string data = ""; + +#ifdef __FreeBSD__ + exe = realpath("/proc/self/file", NULL); +#else + exe = realpath("/proc/self/exe", NULL); #endif + + if (!exe) return ""; + + if ((dir = dirname(exe)) && strlen(dir) > 0) { + data = dir; + } + + free(exe); + + return data; +} +#endif /* APPIMAGE_BUILD */ +#endif /* !__APPLE__ */ } namespace agi { @@ -44,14 +73,23 @@ void Path::FillPlatformSpecificPaths() { agi::fs::path home = home_dir(); SetToken("?user", home/".aegisub"); SetToken("?local", home/".aegisub"); + +#ifdef APPIMAGE_BUILD + agi::fs::path data = exe_dir(); + if (data == "") data = home/".aegisub"; + SetToken("?data", data); + SetToken("?dictionary", Decode("?data/dictionaries")); +#else SetToken("?data", P_DATA); SetToken("?dictionary", "/usr/share/hunspell"); +#endif + #else agi::fs::path app_support = agi::util::GetApplicationSupportDirectory(); SetToken("?user", app_support/"Aegisub"); SetToken("?local", app_support/"Aegisub"); SetToken("?data", agi::util::GetBundleSharedSupportDirectory()); - SetToken("?dictionary", agi::util::GetBundleSharedSupportDirectory() + "/dictionaries"); + SetToken("?dictionary", Decode("?data/dictionaries")); #endif SetToken("?temp", boost::filesystem::temp_directory_path()); } diff --git a/src/Makefile b/src/Makefile index 38a809c06..6dbe99f52 100644 --- a/src/Makefile +++ b/src/Makefile @@ -202,6 +202,7 @@ $(d)auto4_lua.o_FLAGS := $(CFLAGS_LUA) $(d)auto4_lua_assfile.o_FLAGS := $(CFLAGS_LUA) $(d)auto4_lua_dialog.o_FLAGS := $(CFLAGS_LUA) $(d)auto4_lua_progresssink.o_FLAGS := $(CFLAGS_LUA) +$(d)aegisublocale.o_FLAGS := -DP_LOCALE=\"$(P_LOCALE)\" $(src_OBJ): $(d)libresrc/bitmap.h $(d)libresrc/default_config.h diff --git a/src/aegisublocale.cpp b/src/aegisublocale.cpp index de8df7296..cc5f4e10d 100644 --- a/src/aegisublocale.cpp +++ b/src/aegisublocale.cpp @@ -55,6 +55,9 @@ wxTranslations *AegisubLocale::GetTranslations() { if (!translations) { wxTranslations::Set(translations = new wxTranslations); wxFileTranslationsLoader::AddCatalogLookupPathPrefix(config::path->Decode("?data/locale/").wstring()); +#if !defined(_WIN32) && !defined(__APPLE__) && !defined(APPIMAGE_BUILD) + wxFileTranslationsLoader::AddCatalogLookupPathPrefix(P_LOCALE); +#endif } return translations; } From c3c446a8d6abc5127c9432387f50c5ad50012561 Mon Sep 17 00:00:00 2001 From: scx Date: Sat, 7 Sep 2019 20:55:07 +0200 Subject: [PATCH 019/271] Fixes for Boost 1.69.0 --- src/colour_button.cpp | 4 ++++ src/subtitles_provider_libass.cpp | 4 ++++ src/video_frame.cpp | 4 ++++ src/video_provider_dummy.cpp | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/src/colour_button.cpp b/src/colour_button.cpp index c0b1c5d58..83671ebf3 100644 --- a/src/colour_button.cpp +++ b/src/colour_button.cpp @@ -18,7 +18,11 @@ #include "dialogs.h" +#if BOOST_VERSION >= 106900 +#include +#else #include +#endif AGI_DEFINE_EVENT(EVT_COLOR, agi::Color); diff --git a/src/subtitles_provider_libass.cpp b/src/subtitles_provider_libass.cpp index efb5cb481..815c820da 100644 --- a/src/subtitles_provider_libass.cpp +++ b/src/subtitles_provider_libass.cpp @@ -46,7 +46,11 @@ #include #include +#if BOOST_VERSION >= 106900 +#include +#else #include +#endif #include #include diff --git a/src/video_frame.cpp b/src/video_frame.cpp index 610005879..c7957d964 100644 --- a/src/video_frame.cpp +++ b/src/video_frame.cpp @@ -16,7 +16,11 @@ #include "video_frame.h" +#if BOOST_VERSION >= 106900 +#include +#else #include +#endif #include namespace { diff --git a/src/video_provider_dummy.cpp b/src/video_provider_dummy.cpp index b68b206b7..17a1508b5 100644 --- a/src/video_provider_dummy.cpp +++ b/src/video_provider_dummy.cpp @@ -45,7 +45,11 @@ #include #include #include +#if BOOST_VERSION >= 106900 +#include +#else #include +#endif DummyVideoProvider::DummyVideoProvider(double fps, int frames, int width, int height, agi::Color colour, bool pattern) : framecount(frames) From 547b17fc22ecd2652053d04a31640843ef3922a4 Mon Sep 17 00:00:00 2001 From: scx Date: Sun, 1 Sep 2019 23:40:47 +0200 Subject: [PATCH 020/271] Fix crashing when picking language Aegisub crashes immediately after selecting any language from the end of the list (above the 100th position). This is because it can support no more than 100 languages. This patch extends this limit up to 1000 languages (locales). Fixes #131 --- src/subs_edit_ctrl.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/subs_edit_ctrl.cpp b/src/subs_edit_ctrl.cpp index 46193289b..16152a113 100644 --- a/src/subs_edit_ctrl.cpp +++ b/src/subs_edit_ctrl.cpp @@ -56,6 +56,10 @@ #include #include +// Maximum number of languages (locales) +// It should be above 100 (at least 242) and probably not more than 1000 +#define LANGS_MAX 1000 + /// Event ids enum { EDIT_MENU_SPLIT_PRESERVE = 1400, @@ -73,7 +77,7 @@ enum { EDIT_MENU_THESAURUS_SUGS, EDIT_MENU_DIC_LANGUAGE = 1600, EDIT_MENU_DIC_LANGS, - EDIT_MENU_THES_LANGUAGE = 1700, + EDIT_MENU_THES_LANGUAGE = EDIT_MENU_DIC_LANGUAGE + LANGS_MAX, EDIT_MENU_THES_LANGS }; @@ -178,7 +182,7 @@ BEGIN_EVENT_TABLE(SubsTextEditCtrl,wxStyledTextCtrl) EVT_MENU_RANGE(EDIT_MENU_SUGGESTIONS,EDIT_MENU_THESAURUS-1,SubsTextEditCtrl::OnUseSuggestion) EVT_MENU_RANGE(EDIT_MENU_THESAURUS_SUGS,EDIT_MENU_DIC_LANGUAGE-1,SubsTextEditCtrl::OnUseSuggestion) EVT_MENU_RANGE(EDIT_MENU_DIC_LANGS,EDIT_MENU_THES_LANGUAGE-1,SubsTextEditCtrl::OnSetDicLanguage) - EVT_MENU_RANGE(EDIT_MENU_THES_LANGS,EDIT_MENU_THES_LANGS+100,SubsTextEditCtrl::OnSetThesLanguage) + EVT_MENU_RANGE(EDIT_MENU_THES_LANGS,EDIT_MENU_THES_LANGS+LANGS_MAX,SubsTextEditCtrl::OnSetThesLanguage) END_EVENT_TABLE() void SubsTextEditCtrl::OnLoseFocus(wxFocusEvent &event) { From 7c43c757ce9fa1857ac5e96249eb947bf5de2d31 Mon Sep 17 00:00:00 2001 From: darealshinji Date: Wed, 13 Jun 2018 01:31:51 +0200 Subject: [PATCH 021/271] don't be too pedantic on the OpenAL checks --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 44a3860d4..1d8c93067 100644 --- a/configure.ac +++ b/configure.ac @@ -342,9 +342,9 @@ AS_IF([test x$with_openal != xno], [ #endif int main(void) { ALCdevice *device = alcOpenDevice(0); - if (!device) return 1; ALCcontext *context = alcCreateContext(device, 0); - if (!context) return 1; + alcDestroyContext(context); + alcCloseDevice(device); return 0; } ]) ]) From 4897905287c2eaceac81510ae23eabf6116ca061 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 22 Sep 2019 16:44:03 -0700 Subject: [PATCH 022/271] Install autopoint on travis --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a6826bf9a..455d5f1ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,15 +10,16 @@ addons: sources: - ubuntu-toolchain-r-test packages: + - autopoint + - g++-5 - libasound2-dev - - libfftw3-dev - - libhunspell-dev - - yasm - - libfribidi-dev - libass-dev + - libfftw3-dev + - libfribidi-dev + - libhunspell-dev - libicu-dev - luarocks - - g++-5 + - yasm matrix: include: From d89c1ce900e995c44ac01be9e5a95ebb8fe52a53 Mon Sep 17 00:00:00 2001 From: wangqr Date: Sat, 10 Nov 2018 08:24:42 -0500 Subject: [PATCH 023/271] Change some text box size to make it looks better on HiDPI --- src/dialog_properties.cpp | 6 +++--- src/video_box.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dialog_properties.cpp b/src/dialog_properties.cpp index 501a96f19..d19c70ae5 100644 --- a/src/dialog_properties.cpp +++ b/src/dialog_properties.cpp @@ -108,8 +108,8 @@ DialogProperties::DialogProperties(agi::Context *c) TopSizer->Add(TopSizerGrid,1,wxALL | wxEXPAND,0); // Resolution box - ResX = new wxTextCtrl(&d,-1,"",wxDefaultPosition,wxSize(50,20),0,IntValidator(c->ass->GetScriptInfoAsInt("PlayResX"))); - ResY = new wxTextCtrl(&d,-1,"",wxDefaultPosition,wxSize(50,20),0,IntValidator(c->ass->GetScriptInfoAsInt("PlayResY"))); + ResX = new wxTextCtrl(&d,-1,"",wxDefaultPosition,wxSize(50, -1),0,IntValidator(c->ass->GetScriptInfoAsInt("PlayResX"))); + ResY = new wxTextCtrl(&d,-1,"",wxDefaultPosition,wxSize(50, -1),0,IntValidator(c->ass->GetScriptInfoAsInt("PlayResY"))); wxButton *FromVideo = new wxButton(&d,-1,_("From &video")); if (!c->project->VideoProvider()) @@ -173,7 +173,7 @@ DialogProperties::DialogProperties(agi::Context *c) } void DialogProperties::AddProperty(wxSizer *sizer, wxString const& label, std::string const& property) { - wxTextCtrl *ctrl = new wxTextCtrl(&d, -1, to_wx(c->ass->GetScriptInfo(property)), wxDefaultPosition, wxSize(200, 20)); + wxTextCtrl *ctrl = new wxTextCtrl(&d, -1, to_wx(c->ass->GetScriptInfo(property)), wxDefaultPosition, wxSize(200, -1)); sizer->Add(new wxStaticText(&d, -1, label), wxSizerFlags().Center().Left()); sizer->Add(ctrl, wxSizerFlags(1).Expand()); properties.push_back({property, ctrl}); diff --git a/src/video_box.cpp b/src/video_box.cpp index 49fff80aa..0b1da4096 100644 --- a/src/video_box.cpp +++ b/src/video_box.cpp @@ -58,10 +58,10 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context) auto mainToolbar = toolbar::GetToolbar(this, "video", context, "Video", false); - VideoPosition = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxSize(110, 20), wxTE_READONLY); + VideoPosition = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxSize(110, -1), wxTE_READONLY); VideoPosition->SetToolTip(_("Current frame time and number")); - VideoSubsPos = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxSize(110, 20), wxTE_READONLY); + VideoSubsPos = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxSize(110, -1), wxTE_READONLY); VideoSubsPos->SetToolTip(_("Time of this frame relative to start and end of current subs")); wxArrayString choices; From 5d4973a5f64c54a6a3a84278f385d2d474cfa5ab Mon Sep 17 00:00:00 2001 From: wangqr Date: Sat, 10 Nov 2018 15:51:48 -0500 Subject: [PATCH 024/271] Fix millisecond to centisecond convertion Fix Aegisub/Aegisub#94 --- libaegisub/ass/time.cpp | 36 +++++++++++++++--------- libaegisub/include/libaegisub/ass/time.h | 12 ++++---- src/subtitle_format_srt.cpp | 2 +- tests/tests/time.cpp | 10 +------ 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/libaegisub/ass/time.cpp b/libaegisub/ass/time.cpp index a0ecbdaa5..22f6c05e5 100644 --- a/libaegisub/ass/time.cpp +++ b/libaegisub/ass/time.cpp @@ -60,25 +60,35 @@ Time::Time(std::string const& text) { } std::string Time::GetAssFormatted(bool msPrecision) const { + int ass_time = msPrecision ? time : int(*this); std::string ret(10 + msPrecision, ':'); - ret[0] = '0' + GetTimeHours(); - ret[2] = '0' + (time % (60 * 60 * 1000)) / (60 * 1000 * 10); - ret[3] = '0' + (time % (10 * 60 * 1000)) / (60 * 1000); - ret[5] = '0' + (time % (60 * 1000)) / (1000 * 10); - ret[6] = '0' + (time % (10 * 1000)) / 1000; + ret[0] = '0' + ass_time / 3600000; + ret[2] = '0' + (ass_time % (60 * 60 * 1000)) / (60 * 1000 * 10); + ret[3] = '0' + (ass_time % (10 * 60 * 1000)) / (60 * 1000); + ret[5] = '0' + (ass_time % (60 * 1000)) / (1000 * 10); + ret[6] = '0' + (ass_time % (10 * 1000)) / 1000; ret[7] = '.'; - ret[8] = '0' + (time % 1000) / 100; - ret[9] = '0' + (time % 100) / 10; + ret[8] = '0' + (ass_time % 1000) / 100; + ret[9] = '0' + (ass_time % 100) / 10; if (msPrecision) - ret[10] = '0' + time % 10; + ret[10] = '0' + ass_time % 10; return ret; } -int Time::GetTimeHours() const { return time / 3600000; } -int Time::GetTimeMinutes() const { return (time % 3600000) / 60000; } -int Time::GetTimeSeconds() const { return (time % 60000) / 1000; } -int Time::GetTimeMiliseconds() const { return (time % 1000); } -int Time::GetTimeCentiseconds() const { return (time % 1000) / 10; } +std::string Time::GetSrtFormatted() const { + std::string ret(12, ':'); + ret[0] = '0'; + ret[1] = '0' + time / 3600000; + ret[3] = '0' + (time % (60 * 60 * 1000)) / (60 * 1000 * 10); + ret[4] = '0' + (time % (10 * 60 * 1000)) / (60 * 1000); + ret[6] = '0' + (time % (60 * 1000)) / (1000 * 10); + ret[7] = '0' + (time % (10 * 1000)) / 1000; + ret[8] = ','; + ret[9] = '0' + (time % 1000) / 100; + ret[10] = '0' + (time % 100) / 10; + ret[11] = '0' + time % 10; + return ret; +} SmpteFormatter::SmpteFormatter(vfr::Framerate fps, char sep) : fps(std::move(fps)) diff --git a/libaegisub/include/libaegisub/ass/time.h b/libaegisub/include/libaegisub/ass/time.h index 018b5b94a..622052cea 100644 --- a/libaegisub/include/libaegisub/ass/time.h +++ b/libaegisub/include/libaegisub/ass/time.h @@ -28,16 +28,14 @@ public: Time(std::string const& text); /// Get millisecond, rounded to centisecond precision - operator int() const { return time / 10 * 10; } - - int GetTimeHours() const; ///< Get the hours portion of this time - int GetTimeMinutes() const; ///< Get the minutes portion of this time - int GetTimeSeconds() const; ///< Get the seconds portion of this time - int GetTimeMiliseconds() const; ///< Get the miliseconds portion of this time - int GetTimeCentiseconds() const; ///< Get the centiseconds portion of this time + // Always round up for 5ms because the range is [start, stop) + operator int() const { return (time + 5) - (time + 5) % 10; } /// Return the time as a string /// @param ms Use milliseconds precision, for non-ASS formats std::string GetAssFormatted(bool ms=false) const; + + /// Return the time as a string + std::string GetSrtFormatted() const; }; } diff --git a/src/subtitle_format_srt.cpp b/src/subtitle_format_srt.cpp index 981137a6d..764557271 100644 --- a/src/subtitle_format_srt.cpp +++ b/src/subtitle_format_srt.cpp @@ -279,7 +279,7 @@ public: std::string WriteSRTTime(agi::Time const& ts) { - return agi::format("%02d:%02d:%02d,%03d", ts.GetTimeHours(), ts.GetTimeMinutes(), ts.GetTimeSeconds(), ts.GetTimeMiliseconds()); + return ts.GetSrtFormatted(); } } diff --git a/tests/tests/time.cpp b/tests/tests/time.cpp index a9fcc8753..147a2d4d6 100644 --- a/tests/tests/time.cpp +++ b/tests/tests/time.cpp @@ -62,17 +62,9 @@ TEST(lagi_time, extra_garbage_is_ignored) { EXPECT_STREQ("1:23:45.67", Time("1a:b2c3d:e4f5g.!6&7").GetAssFormatted().c_str()); } -TEST(lagi_time, component_getters) { - Time t("1:23:45.67"); - EXPECT_EQ(1, t.GetTimeHours()); - EXPECT_EQ(23, t.GetTimeMinutes()); - EXPECT_EQ(45, t.GetTimeSeconds()); - EXPECT_EQ(67, t.GetTimeCentiseconds()); - EXPECT_EQ(670, t.GetTimeMiliseconds()); -} - TEST(lagi_time, srt_time) { EXPECT_STREQ("1:23:45.678", Time("1:23:45,678").GetAssFormatted(true).c_str()); + EXPECT_STREQ("01:23:45,678", Time("1:23:45,678").GetSrtFormatted().c_str()); } TEST(lagi_time, smpte_parse_valid) { From faad82e1ec96a861aea3cac9272f90bb8ac36430 Mon Sep 17 00:00:00 2001 From: wangqr Date: Sat, 10 Nov 2018 16:18:28 -0500 Subject: [PATCH 025/271] Fix overflow bound --- libaegisub/ass/time.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libaegisub/ass/time.cpp b/libaegisub/ass/time.cpp index 22f6c05e5..b85f48a1f 100644 --- a/libaegisub/ass/time.cpp +++ b/libaegisub/ass/time.cpp @@ -24,7 +24,7 @@ #include namespace agi { -Time::Time(int time) : time(util::mid(0, time, 10 * 60 * 60 * 1000 - 1)) { } +Time::Time(int time) : time(util::mid(0, time, 10 * 60 * 60 * 1000 - 6)) { } Time::Time(std::string const& text) { int after_decimal = -1; @@ -56,7 +56,7 @@ Time::Time(std::string const& text) { time = (time * 60 + current) * 1000; // Limit to the valid range - time = util::mid(0, time, 10 * 60 * 60 * 1000 - 1); + time = util::mid(0, time, 10 * 60 * 60 * 1000 - 6); } std::string Time::GetAssFormatted(bool msPrecision) const { From 17215edc3135da88145f265e0a0b42ccabe4bd97 Mon Sep 17 00:00:00 2001 From: wangqr Date: Fri, 12 Apr 2019 13:50:50 -0400 Subject: [PATCH 026/271] Fix build warnings --- src/audio_colorscheme.cpp | 2 +- src/audio_renderer_spectrum.cpp | 4 ++-- vendor/csri/subhelp/logging.c | 11 +++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/audio_colorscheme.cpp b/src/audio_colorscheme.cpp index a7a1142c9..c918ffb97 100644 --- a/src/audio_colorscheme.cpp +++ b/src/audio_colorscheme.cpp @@ -37,7 +37,7 @@ AudioColorScheme::AudioColorScheme(int prec, std::string const& scheme_name, int audio_rendering_style) : palette((3<(audio_rendering_style)) diff --git a/src/audio_renderer_spectrum.cpp b/src/audio_renderer_spectrum.cpp index 7884f1006..d52fb981c 100644 --- a/src/audio_renderer_spectrum.cpp +++ b/src/audio_renderer_spectrum.cpp @@ -114,7 +114,7 @@ void AudioSpectrumRenderer::RecreateCache() if (provider) { - size_t block_count = (size_t)((provider->GetNumSamples() + (size_t)(1<> derivation_dist); + size_t block_count = (size_t)((provider->GetNumSamples() + ((size_t)1<> derivation_dist); cache = agi::make_unique(block_count, this); #ifdef WITH_FFTW3 @@ -181,7 +181,7 @@ void AudioSpectrumRenderer::FillBlock(size_t block_index, float *block) double scale_factor = 9 / sqrt(2 << (derivation_size + 1)); fftw_complex *o = dft_output; - for (size_t si = 1< 0; --si) + for (size_t si = (size_t)1< 0; --si) { *block++ = log10( sqrt(o[0][0] * o[0][0] + o[0][1] * o[0][1]) * scale_factor + 1 ); o++; diff --git a/vendor/csri/subhelp/logging.c b/vendor/csri/subhelp/logging.c index e34978d05..08b9960e1 100644 --- a/vendor/csri/subhelp/logging.c +++ b/vendor/csri/subhelp/logging.c @@ -81,8 +81,11 @@ void subhelp_vlog(enum csri_logging_severity severity, n = vsnprintf(buffer, size, msg, args); if (n >= 0 && (unsigned)n < size) break; - size = n > 0 ? (unsigned)n + 1 : size * 2; - buffer = (char *)realloc(buffer, size); + size = n > 0 ? (size_t)n + 1 : size * 2; + char* old_buffer = buffer; + buffer = (char *)realloc(old_buffer, size); + if (!buffer) + free(old_buffer); } final = buffer ? buffer : ""; subhelp_slog(severity, final); @@ -95,8 +98,8 @@ void subhelp_slog(enum csri_logging_severity severity, const char *msg) if (logfunc) logfunc(appdata, severity, msg); else { - fprintf(stderr, msg); - fprintf(stderr, "\n"); + fputs(msg, stderr); + fputc('\n', stderr); } } From d0c05fbcde0ec2ccf956a0a0f83ac238e686a271 Mon Sep 17 00:00:00 2001 From: wangqr Date: Thu, 9 May 2019 16:30:38 -0400 Subject: [PATCH 027/271] Update about dialog --- src/dialog_about.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dialog_about.cpp b/src/dialog_about.cpp index efbc0080f..ebc3f8bdc 100644 --- a/src/dialog_about.cpp +++ b/src/dialog_about.cpp @@ -49,10 +49,11 @@ void ShowAboutDialog(wxWindow *parent) { // Generate about string wxString aboutString = wxString("Aegisub ") + GetAegisubShortVersionString() + ".\n" - "Copyright (c) 2005-2014 Rodrigo Braz Monteiro, Niels Martin Hansen, Thomas Goyne et al.\n\n" + "Copyright (c) 2005-2019 Rodrigo Braz Monteiro, Niels Martin Hansen, Thomas Goyne et al.\n\n" "Programmers:\n" " Alysson Souza e Silva\n" " Amar Takhar\n" + " Charlie Jiang\n" " Dan Donovan\n" " Daniel Moscoviter\n" " David Conrad\n" @@ -67,6 +68,7 @@ void ShowAboutDialog(wxWindow *parent) { " Muhammad Lukman Nasaruddin\n" " Niels Martin Hansen\n" " Patryk Pomykalski\n" + " Qirui Wang\n" " Ravi Pinjala\n" " Rodrigo Braz Monteiro\n" " Simone Cociancich\n" From d660f7f2b023a71e90df27f1c51ba009a2d30301 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 25 Mar 2018 07:50:05 -0400 Subject: [PATCH 028/271] Add support for setting status bar text from Lua --- automation/v4-docs/misc.txt | 8 ++++++++ src/auto4_lua.cpp | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/automation/v4-docs/misc.txt b/automation/v4-docs/misc.txt index 9c656f0e4..5b96d3519 100644 --- a/automation/v4-docs/misc.txt +++ b/automation/v4-docs/misc.txt @@ -40,3 +40,11 @@ Returns: 2 values, all numbers. 2. End of the selection, in milliseconds. --- + +Setting the main frame's status bar text + +function aegisub.set_status_bar_text(text) + +Returns: 0 values + +--- diff --git a/src/auto4_lua.cpp b/src/auto4_lua.cpp index b952b2e7c..6c131902e 100644 --- a/src/auto4_lua.cpp +++ b/src/auto4_lua.cpp @@ -44,6 +44,7 @@ #include "audio_timing.h" #include "command/command.h" #include "compat.h" +#include "frame_main.h" #include "include/aegisub/context.h" #include "options.h" #include "project.h" @@ -52,6 +53,7 @@ #include "video_controller.h" #include "utils.h" +#include #include #include #include @@ -270,6 +272,19 @@ namespace { return 2; } + int lua_set_status_text(lua_State *L) + { + const agi::Context *c = get_context(L); + if (!c || !c->frame) { + lua_pushnil(L); + return 1; + } + std::string text = check_string(L, 1); + lua_pop(L, 1); + agi::dispatch::Main().Async([=] { c->frame->StatusTimeout(to_wx(text)); }); + return 0; + } + int project_properties(lua_State *L) { const agi::Context *c = get_context(L); @@ -473,6 +488,7 @@ namespace { set_field(L, "gettext"); set_field(L, "project_properties"); set_field(L, "get_audio_selection"); + set_field(L, "set_status_text"); // store aegisub table to globals lua_settable(L, LUA_GLOBALSINDEX); From 30286e70359dbe61e50ec5a2fdc5645b26ecd335 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 25 Mar 2018 09:30:29 -0400 Subject: [PATCH 029/271] Remove Force BT.601 option and update color matrix guessing --- src/libresrc/default_config.json | 1 - src/libresrc/osx/default_config.json | 1 - src/preferences.cpp | 3 --- src/project.cpp | 1 - src/resolution_resampler.cpp | 2 +- src/video_provider_avs.cpp | 13 ++++++------- src/video_provider_ffmpegsource.cpp | 2 +- 7 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/libresrc/default_config.json b/src/libresrc/default_config.json index c541ca16e..5f9c077e3 100644 --- a/src/libresrc/default_config.json +++ b/src/libresrc/default_config.json @@ -590,7 +590,6 @@ }, "Pattern" : false }, - "Force BT.601" : true, "Last Script Resolution Mismatch Choice" : 2, "Open Audio" : true, "Overscan Mask" : false, diff --git a/src/libresrc/osx/default_config.json b/src/libresrc/osx/default_config.json index 3e0617216..7eacbe6d7 100644 --- a/src/libresrc/osx/default_config.json +++ b/src/libresrc/osx/default_config.json @@ -590,7 +590,6 @@ }, "Pattern" : false }, - "Force BT.601" : true, "Last Script Resolution Mismatch Choice" : 2, "Open Audio" : true, "Overscan Mask" : false, diff --git a/src/preferences.cpp b/src/preferences.cpp index 93cac807c..c835bad13 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -421,9 +421,6 @@ void Advanced_Video(wxTreebook *book, Preferences *parent) { wxArrayString sp_choice = to_wx(SubtitlesProviderFactory::GetClasses()); p->OptionChoice(expert, _("Subtitles provider"), sp_choice, "Subtitle/Provider"); - p->CellSkip(expert); - p->OptionAdd(expert, _("Force BT.601"), "Video/Force BT.601"); - #ifdef WITH_AVISYNTH auto avisynth = p->PageSizer("Avisynth"); p->OptionAdd(avisynth, _("Allow pre-2.56a Avisynth"), "Provider/Avisynth/Allow Ancient"); diff --git a/src/project.cpp b/src/project.cpp index 5ed6578d4..312f86fe8 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -58,7 +58,6 @@ Project::Project(agi::Context *c) : context(c) { OPT_SUB("Provider/Video/FFmpegSource/Decoding Threads", &Project::ReloadVideo, this); OPT_SUB("Provider/Video/FFmpegSource/Unsafe Seeking", &Project::ReloadVideo, this); OPT_SUB("Subtitle/Provider", &Project::ReloadVideo, this); - OPT_SUB("Video/Force BT.601", &Project::ReloadVideo, this); OPT_SUB("Video/Provider", &Project::ReloadVideo, this); } diff --git a/src/resolution_resampler.cpp b/src/resolution_resampler.cpp index ee4e19f87..e5c0b56f9 100644 --- a/src/resolution_resampler.cpp +++ b/src/resolution_resampler.cpp @@ -48,7 +48,7 @@ static const std::string names[] = { }; YCbCrMatrix MatrixFromString(std::string const& str) { - if (str.empty()) return YCbCrMatrix::tv_601; + if (str.empty()) return YCbCrMatrix::tv_709; auto pos = std::find(std::begin(names), std::end(names), str); if (pos == std::end(names)) return YCbCrMatrix::rgb; diff --git a/src/video_provider_avs.cpp b/src/video_provider_avs.cpp index 5273a128d..dabcdaa68 100644 --- a/src/video_provider_avs.cpp +++ b/src/video_provider_avs.cpp @@ -191,17 +191,16 @@ void AvisynthVideoProvider::Init(std::string const& colormatrix) { real_colorspace = colorspace = "None"; else { /// @todo maybe read ColorMatrix hints for d2v files? - AVSValue args[2] = { script, "Rec601" }; - bool force_bt601 = OPT_GET("Video/Force BT.601")->GetBool() || colormatrix == "TV.601"; + AVSValue args[2] = { script, "Rec709" }; bool bt709 = vi.width > 1024 || vi.height >= 600; - if (bt709 && (!force_bt601 || colormatrix == "TV.709")) { - args[1] = "Rec709"; - real_colorspace = colorspace = "TV.709"; + if (colormatrix == "TV.601") { + args[1] = "Rec601"; + colorspace = "TV.601"; } else { - colorspace = "TV.601"; - real_colorspace = bt709 ? "TV.709" : "TV.601"; + colorspace = "TV.709"; } + real_colorspace = bt709 ? "TV.709" : "TV.601"; const char *argnames[2] = { 0, "matrix" }; script = avs.GetEnv()->Invoke("ConvertToRGB32", AVSValue(args, 2), argnames); } diff --git a/src/video_provider_ffmpegsource.cpp b/src/video_provider_ffmpegsource.cpp index f4ed6a2f2..fbef16d79 100644 --- a/src/video_provider_ffmpegsource.cpp +++ b/src/video_provider_ffmpegsource.cpp @@ -262,7 +262,7 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st RealColorSpace = ColorSpace = colormatrix_description(CS, CR); #if FFMS_VERSION >= ((2 << 24) | (17 << 16) | (1 << 8) | 0) - if (CS != AGI_CS_RGB && CS != AGI_CS_BT470BG && ColorSpace != colormatrix && (colormatrix == "TV.601" || OPT_GET("Video/Force BT.601")->GetBool())) { + if (CS != AGI_CS_RGB && CS != AGI_CS_BT470BG && ColorSpace != colormatrix && colormatrix == "TV.601") { CS = AGI_CS_BT470BG; ColorSpace = colormatrix_description(AGI_CS_BT470BG, CR); } From bc649b60639ece7cc9e8d00f7ceee8a72e8f5a2c Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Tue, 27 Mar 2018 15:07:37 -0400 Subject: [PATCH 030/271] Make translation assistant skipping whitespace an explicit setting --- src/dialog_translation.cpp | 4 +++- src/libresrc/default_config.json | 3 ++- src/libresrc/osx/default_config.json | 3 ++- src/preferences.cpp | 3 +++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/dialog_translation.cpp b/src/dialog_translation.cpp index c5fb4ffb8..c953b6874 100644 --- a/src/dialog_translation.cpp +++ b/src/dialog_translation.cpp @@ -31,6 +31,7 @@ #include "format.h" #include "help_button.h" #include "libresrc/libresrc.h" +#include "options.h" #include "persist_location.h" #include "project.h" #include "subs_edit_ctrl.h" @@ -57,7 +58,8 @@ static void add_hotkey(wxSizer *sizer, wxWindow *parent, const char *command, wx // Skip over override blocks, comments, and whitespace between blocks static bool bad_block(std::unique_ptr &block) { - return block->GetType() != AssBlockType::PLAIN || boost::all(block->GetText(), boost::is_space()); + bool is_whitespace = boost::all(block->GetText(), boost::is_space()); + return block->GetType() != AssBlockType::PLAIN || (is_whitespace && OPT_GET("Tool/Translation Assistant/Skip Whitespace")->GetBool()); } DialogTranslation::DialogTranslation(agi::Context *c) diff --git a/src/libresrc/default_config.json b/src/libresrc/default_config.json index 5f9c077e3..e0a99d15e 100644 --- a/src/libresrc/default_config.json +++ b/src/libresrc/default_config.json @@ -559,7 +559,8 @@ "X" : -1, "Y" : -1 }, - "Maximized" : false + "Maximized" : false, + "Skip Whitespace" : true }, "Visual" : { "Autohide": false diff --git a/src/libresrc/osx/default_config.json b/src/libresrc/osx/default_config.json index 7eacbe6d7..ec3fb5d8c 100644 --- a/src/libresrc/osx/default_config.json +++ b/src/libresrc/osx/default_config.json @@ -559,7 +559,8 @@ "X" : -1, "Y" : -1 }, - "Maximized" : false + "Maximized" : false, + "Skip Whitespace" : true }, "Visual" : { "Autohide": false diff --git a/src/preferences.cpp b/src/preferences.cpp index c835bad13..1986a6132 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -225,6 +225,9 @@ void Interface(wxTreebook *book, Preferences *parent) { p->OptionAdd(grid, _("Hide overrides symbol"), "Subtitle/Grid/Hide Overrides Char"); p->OptionFont(grid, "Subtitle/Grid/"); + auto tl_assistant = p->PageSizer(_("Translation Assistant")); + p->OptionAdd(tl_assistant, _("Skip over whitespace"), "Tool/Translation Assistant/Skip Whitespace"); + p->SetSizerAndFit(p->sizer); } From 66a3748f97264f68c9fd7e3d148147eea6e39fca Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Thu, 29 Mar 2018 02:51:01 -0400 Subject: [PATCH 031/271] Remove dead forums link --- src/command/help.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/command/help.cpp b/src/command/help.cpp index 144a1f81a..ece65000c 100644 --- a/src/command/help.cpp +++ b/src/command/help.cpp @@ -75,18 +75,6 @@ struct help_contents final : public Command { } }; -struct help_forums final : public Command { - CMD_NAME("help/forums") - CMD_ICON(forums_button) - STR_MENU("&Forums") - STR_DISP("Forums") - STR_HELP("Visit Aegisub's forums") - - void operator()(agi::Context *) override { - wxLaunchDefaultBrowser("http://forum.aegisub.org/", wxBROWSER_NEW_WINDOW); - } -}; - struct help_irc final : public Command { CMD_NAME("help/irc") CMD_ICON(irc_button) @@ -128,7 +116,6 @@ namespace cmd { void init_help() { reg(agi::make_unique()); reg(agi::make_unique()); - reg(agi::make_unique()); reg(agi::make_unique()); reg(agi::make_unique()); reg(agi::make_unique()); From b2dd50e91084c00e4c8af645c0ec5ab3f53a1ca3 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Apr 2018 17:58:12 -0400 Subject: [PATCH 032/271] Use proper event for DoubleUpdater Previously changes weren't recognized because the event bound was for integers --- src/preferences_base.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/preferences_base.cpp b/src/preferences_base.cpp index 32fa1fd7d..cb2c832d7 100644 --- a/src/preferences_base.cpp +++ b/src/preferences_base.cpp @@ -55,7 +55,7 @@ OPTION_UPDATER(StringUpdater, wxCommandEvent, OptionValueString, from_wx(evt.GetString())); OPTION_UPDATER(IntUpdater, wxSpinEvent, OptionValueInt, evt.GetInt()); OPTION_UPDATER(IntCBUpdater, wxCommandEvent, OptionValueInt, evt.GetInt()); -OPTION_UPDATER(DoubleUpdater, wxSpinEvent, OptionValueDouble, evt.GetInt()); +OPTION_UPDATER(DoubleUpdater, wxSpinDoubleEvent, OptionValueDouble, evt.GetValue()); OPTION_UPDATER(BoolUpdater, wxCommandEvent, OptionValueBool, !!evt.GetInt()); OPTION_UPDATER(ColourUpdater, ValueEvent, OptionValueColor, evt.Get()); @@ -132,7 +132,7 @@ wxControl *OptionPage::OptionAdd(wxFlexGridSizer *flex, const wxString &name, co case agi::OptionType::Double: { auto scd = new wxSpinCtrlDouble(this, -1, std::to_wstring(opt->GetDouble()), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, min, max, opt->GetDouble(), inc); - scd->Bind(wxEVT_SPINCTRL, DoubleUpdater(opt_name, parent)); + scd->Bind(wxEVT_SPINCTRLDOUBLE, DoubleUpdater(opt_name, parent)); Add(flex, name, scd); return scd; } From 63d267d3590011dd0363aceb65617bd052eb43e2 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Fri, 27 Apr 2018 11:19:37 -0400 Subject: [PATCH 033/271] Fix line order when splitting after current frame --- src/command/edit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/command/edit.cpp b/src/command/edit.cpp index 3559d2606..333cdc6d5 100644 --- a/src/command/edit.cpp +++ b/src/command/edit.cpp @@ -672,7 +672,7 @@ static void duplicate_lines(agi::Context *c, int shift) { // after the selected block do { auto old_diag = &*start; - auto new_diag = new AssDialogue(*old_diag); + auto new_diag = new AssDialogue(*old_diag); c->ass->Events.insert(insert_pos, *new_diag); new_sel.insert(new_diag); @@ -697,8 +697,8 @@ static void duplicate_lines(agi::Context *c, int shift) { new_diag->Start = c->videoController->TimeAtFrame(cur_frame, agi::vfr::START); } else { - old_diag->Start = c->videoController->TimeAtFrame(cur_frame + 1, agi::vfr::START); - new_diag->End = c->videoController->TimeAtFrame(cur_frame, agi::vfr::END); + old_diag->End = c->videoController->TimeAtFrame(cur_frame, agi::vfr::END); + new_diag->Start = c->videoController->TimeAtFrame(cur_frame + 1, agi::vfr::START); } /// @todo also split \t and \move? From 04a193de4d61dc37c2608234b51db816f5ec66b0 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 29 Apr 2018 16:51:53 -0400 Subject: [PATCH 034/271] Point users at a functional bug tracker --- src/command/help.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command/help.cpp b/src/command/help.cpp index ece65000c..ff47624cd 100644 --- a/src/command/help.cpp +++ b/src/command/help.cpp @@ -59,7 +59,7 @@ struct help_bugs final : public Command { throw c->parent; } } - wxLaunchDefaultBrowser("http://devel.aegisub.org/", wxBROWSER_NEW_WINDOW); + wxLaunchDefaultBrowser("https://github.com/Aegisub/Aegisub/issues", wxBROWSER_NEW_WINDOW); } }; From f2ca259a8b6acc03b0575d92d7a08e3eb58cb74d Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 7 May 2018 19:24:47 -0400 Subject: [PATCH 035/271] Pass 0 to FFMS_Init The argument is no longer used, and the docs specify to pass a value of 0 to avoid confusion --- src/ffmpegsource_common.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ffmpegsource_common.cpp b/src/ffmpegsource_common.cpp index c9e2e16cc..0de47e1ee 100644 --- a/src/ffmpegsource_common.cpp +++ b/src/ffmpegsource_common.cpp @@ -67,7 +67,7 @@ enum { FFmpegSourceProvider::FFmpegSourceProvider(agi::BackgroundRunner *br) : br(br) { - FFMS_Init(0, 1); + FFMS_Init(0, 0); } /// @brief Does indexing of a source file From 4f870f9c268141fd3dd168a72a80ccebbc3bab10 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Fri, 5 Oct 2018 17:51:55 -0400 Subject: [PATCH 036/271] Ignore VS build files Most files were moved to .vs directory with VS15 --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index cfe7a1ee5..6db047864 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.bz2 *.cache *.dep +*.db *.dll *.dmg *.exe @@ -86,3 +87,4 @@ vendor/luajit/src/lj_vm.s vendor/luajit/src/luajit .nuget +.vs From ebea3905cc3e1e8ee210d2a70edcd7e94a2917d8 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 6 Jan 2019 19:34:14 -0500 Subject: [PATCH 037/271] Use FFMS2 constant in place of magic number --- src/audio_provider_ffmpegsource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio_provider_ffmpegsource.cpp b/src/audio_provider_ffmpegsource.cpp index 606d5b415..640536f97 100644 --- a/src/audio_provider_ffmpegsource.cpp +++ b/src/audio_provider_ffmpegsource.cpp @@ -144,7 +144,7 @@ void FFmpegSourceAudioProvider::LoadAudio(agi::fs::path const& filename) { // update access time of index file so it won't get cleaned away agi::fs::Touch(CacheName); - AudioSource = FFMS_CreateAudioSource(filename.string().c_str(), TrackNumber, Index, -1, &ErrInfo); + AudioSource = FFMS_CreateAudioSource(filename.string().c_str(), TrackNumber, Index, FFMS_DELAY_FIRST_VIDEO_TRACK, &ErrInfo); if (!AudioSource) throw agi::AudioProviderError(std::string("Failed to open audio track: ") + ErrInfo.Buffer); From 1ce72a6d6e2c5e325619b9fa8b11391d6bdb0bb0 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Wed, 14 Mar 2018 05:45:19 -0400 Subject: [PATCH 038/271] Update default config to modern standards --- src/libresrc/default_config.json | 24 ++++++++++++------------ src/libresrc/osx/default_config.json | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/libresrc/default_config.json b/src/libresrc/default_config.json index e0a99d15e..0134efb94 100644 --- a/src/libresrc/default_config.json +++ b/src/libresrc/default_config.json @@ -40,24 +40,24 @@ "Display" : { "Draw" : { "Cursor Time" : true, - "Inactive Comments" : true, + "Inactive Comments" : false, "Keyframes in Dialogue Mode" : true, "Keyframes in Karaoke Mode" : true, - "Seconds" : false, - "Video Position" : false + "Seconds" : true, + "Video Position" : true }, "Waveform Style" : 0 }, "Downmixer" : "ConvertToMono", "Drag Timing" : true, - "Inactive Lines Display Mode" : 1, + "Inactive Lines Display Mode" : 3, "Karaoke" : { "Font Face" : "Verdana", "Font Size" : 9 }, "Lead" : { - "IN" : 200, - "OUT" : 300 + "IN" : 100, + "OUT" : 350 }, "Line Boundaries Thickness" : 2, "Link" : true, @@ -75,11 +75,11 @@ } }, "Snap" : { - "Distance" : 10, - "Enable" : false + "Distance" : 8, + "Enable" : true }, "Spectrum" : true, - "Start Drag Sensitivity" : 3, + "Start Drag Sensitivity" : 8, "Track Cursor" : { "Font Face" : "" }, @@ -421,7 +421,7 @@ }, "Timing" : { - "Default Duration" : 2000 + "Default Duration" : 3000 }, "Tool" : { @@ -585,9 +585,9 @@ "Dummy" : { "FPS" : 23.975999999999999091, "Last" : { - "Height" : 480, + "Height" : 720, "Length" : 40000, - "Width" : 640 + "Width" : 1280 }, "Pattern" : false }, diff --git a/src/libresrc/osx/default_config.json b/src/libresrc/osx/default_config.json index ec3fb5d8c..c230c7460 100644 --- a/src/libresrc/osx/default_config.json +++ b/src/libresrc/osx/default_config.json @@ -40,24 +40,24 @@ "Display" : { "Draw" : { "Cursor Time" : true, - "Inactive Comments" : true, + "Inactive Comments" : false, "Keyframes in Dialogue Mode" : true, "Keyframes in Karaoke Mode" : true, - "Seconds" : false, - "Video Position" : false + "Seconds" : true, + "Video Position" : true }, "Waveform Style" : 0 }, "Downmixer" : "ConvertToMono", "Drag Timing" : true, - "Inactive Lines Display Mode" : 1, + "Inactive Lines Display Mode" : 3, "Karaoke" : { "Font Face" : "", "Font Size" : 9 }, "Lead" : { - "IN" : 200, - "OUT" : 300 + "IN" : 100, + "OUT" : 350 }, "Line Boundaries Thickness" : 2, "Link" : true, @@ -75,11 +75,11 @@ } }, "Snap" : { - "Distance" : 10, - "Enable" : false + "Distance" : 8, + "Enable" : true }, "Spectrum" : true, - "Start Drag Sensitivity" : 3, + "Start Drag Sensitivity" : 8, "Track Cursor" : { "Font Face" : "" }, @@ -421,7 +421,7 @@ }, "Timing" : { - "Default Duration" : 2000 + "Default Duration" : 3000 }, "Tool" : { @@ -585,9 +585,9 @@ "Dummy" : { "FPS" : 23.975999999999999091, "Last" : { - "Height" : 480, + "Height" : 720, "Length" : 40000, - "Width" : 640 + "Width" : 1280 }, "Pattern" : false }, From af5d34cc1d96ab43764ff976c41c61d796f09795 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Apr 2018 17:59:32 -0400 Subject: [PATCH 039/271] Add configuration options for colors in visual typesetting tools --- src/libresrc/default_config.json | 7 +++++++ src/libresrc/osx/default_config.json | 7 +++++++ src/options.h | 2 ++ src/preferences.cpp | 10 ++++++++++ src/visual_tool.cpp | 28 ++++++++++++++++------------ src/visual_tool.h | 9 +++++++-- src/visual_tool_clip.cpp | 14 ++++++++++---- src/visual_tool_drag.cpp | 8 ++++++-- src/visual_tool_rotatexy.cpp | 16 +++++++++++----- src/visual_tool_rotatez.cpp | 19 +++++++++++++------ src/visual_tool_scale.cpp | 18 +++++++++++++----- src/visual_tool_vector_clip.cpp | 27 +++++++++++++++++---------- 12 files changed, 119 insertions(+), 46 deletions(-) diff --git a/src/libresrc/default_config.json b/src/libresrc/default_config.json index 0134efb94..35f870950 100644 --- a/src/libresrc/default_config.json +++ b/src/libresrc/default_config.json @@ -266,6 +266,13 @@ }, "Video Dummy" : { "Last Colour" : "rgb(47, 163, 254)" + }, + "Visual Tools" : { + "Highlight Primary" : "rgb(255, 169, 40)", + "Highlight Secondary" : "rgb(255, 253, 185)", + "Lines Primary" : "rgb(187, 0, 0)", + "Lines Secondary" : "rgb(106, 32, 19)", + "Shaded Area Alpha" : 0.5 } }, diff --git a/src/libresrc/osx/default_config.json b/src/libresrc/osx/default_config.json index c230c7460..5ad7be7d0 100644 --- a/src/libresrc/osx/default_config.json +++ b/src/libresrc/osx/default_config.json @@ -266,6 +266,13 @@ }, "Video Dummy" : { "Last Colour" : "rgb(47, 163, 254)" + }, + "Visual Tools" : { + "Highlight Primary" : "rgb(255, 169, 40)", + "Highlight Secondary" : "rgb(255, 253, 185)", + "Lines Primary" : "rgb(187, 0, 0)", + "Lines Secondary" : "rgb(106, 32, 19)", + "Shaded Area Alpha" : 0.5 } }, diff --git a/src/options.h b/src/options.h index 8f0240334..77e6676a2 100644 --- a/src/options.h +++ b/src/options.h @@ -14,6 +14,8 @@ // // Aegisub Project http://www.aegisub.org/ +#pragma once + #include #include #include diff --git a/src/preferences.cpp b/src/preferences.cpp index 1986a6132..7850af5f9 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -288,6 +288,16 @@ void Interface_Colours(wxTreebook *book, Preferences *parent) { p->OptionAdd(grid, _("Lines"), "Colour/Subtitle Grid/Lines"); p->OptionAdd(grid, _("CPS Error"), "Colour/Subtitle Grid/CPS Error"); + auto visual_tools = p->PageSizer(_("Visual Typesetting Tools")); + p->OptionAdd(visual_tools, _("Primary Lines"), "Colour/Visual Tools/Lines Primary"); + p->OptionAdd(visual_tools, _("Secondary Lines"), "Colour/Visual Tools/Lines Secondary"); + p->OptionAdd(visual_tools, _("Primary Highlight"), "Colour/Visual Tools/Highlight Primary"); + p->OptionAdd(visual_tools, _("Secondary Highlight"), "Colour/Visual Tools/Highlight Secondary"); + + // Separate sizer to prevent the colors in the visual tools section from getting resized + auto visual_tools_alpha = p->PageSizer(_("Visual Typesetting Tools Alpha")); + p->OptionAdd(visual_tools_alpha, _("Shaded Area"), "Colour/Visual Tools/Shaded Area Alpha", 0, 1, 0.1); + p->sizer = main_sizer; p->SetSizerAndFit(p->sizer); diff --git a/src/visual_tool.cpp b/src/visual_tool.cpp index bdbc4e813..13009127c 100644 --- a/src/visual_tool.cpp +++ b/src/visual_tool.cpp @@ -23,7 +23,9 @@ #include "ass_dialogue.h" #include "ass_file.h" #include "ass_style.h" +#include "compat.h" #include "include/aegisub/context.h" +#include "options.h" #include "selection_controller.h" #include "video_controller.h" #include "video_display.h" @@ -37,17 +39,15 @@ #include -const wxColour VisualToolBase::colour[] = { - wxColour(106,32,19), - wxColour(255,169,40), - wxColour(255,253,185), - wxColour(187,0,0) -}; - VisualToolBase::VisualToolBase(VideoDisplay *parent, agi::Context *context) : c(context) , parent(parent) , frame_number(c->videoController->GetFrameN()) +, highlight_color_primary_opt(OPT_GET("Colour/Visual Tools/Highlight Primary")) +, highlight_color_secondary_opt(OPT_GET("Colour/Visual Tools/Highlight Secondary")) +, line_color_primary_opt(OPT_GET("Colour/Visual Tools/Lines Primary")) +, line_color_secondary_opt(OPT_GET("Colour/Visual Tools/Lines Secondary")) +, shaded_area_alpha_opt(OPT_GET("Colour/Visual Tools/Shaded Area Alpha")) , file_changed_connection(c->ass->AddCommitListener(&VisualToolBase::OnCommit, this)) { int script_w, script_h; @@ -273,14 +273,18 @@ void VisualTool::OnMouseEvent(wxMouseEvent &event) { template void VisualTool::DrawAllFeatures() { - gl.SetLineColour(colour[0], 1.0f, 1); + wxColour grid_color = to_wx(line_color_secondary_opt->GetColor()); + gl.SetLineColour(grid_color, 1.0f, 1); + wxColour base_fill = to_wx(line_color_primary_opt->GetColor()); + wxColour active_fill = to_wx(highlight_color_secondary_opt->GetColor()); + wxColour alt_fill = to_wx(line_color_primary_opt->GetColor()); for (auto& feature : features) { - int fill = 1; + wxColour fill = base_fill; if (&feature == active_feature) - fill = 2; + fill = active_fill; else if (sel_features.count(&feature)) - fill = 3; - gl.SetFillColour(colour[fill], 0.3f); + fill = alt_fill; + gl.SetFillColour(fill, 0.3f); feature.Draw(gl); } } diff --git a/src/visual_tool.h b/src/visual_tool.h index d1af51f02..72eec4224 100644 --- a/src/visual_tool.h +++ b/src/visual_tool.h @@ -22,6 +22,7 @@ #include "gl_wrap.h" #include "vector2d.h" +#include "options.h" #include #include @@ -85,8 +86,6 @@ protected: /// Called when the user double-clicks virtual void OnDoubleClick() { } - static const wxColour colour[4]; - agi::Context *c; VideoDisplay *parent; @@ -106,6 +105,12 @@ protected: Vector2D video_pos; ///< Top-left corner of the video in the display area Vector2D video_res; ///< Video resolution + const agi::OptionValue *highlight_color_primary_opt; + const agi::OptionValue *highlight_color_secondary_opt; + const agi::OptionValue *line_color_primary_opt; + const agi::OptionValue *line_color_secondary_opt; + const agi::OptionValue *shaded_area_alpha_opt; + agi::signal::Connection file_changed_connection; int commit_id = -1; ///< Last used commit id for coalescing diff --git a/src/visual_tool_clip.cpp b/src/visual_tool_clip.cpp index b9e41f3c1..52a1024b2 100644 --- a/src/visual_tool_clip.cpp +++ b/src/visual_tool_clip.cpp @@ -21,7 +21,9 @@ #include "visual_tool_clip.h" #include "ass_dialogue.h" +#include "compat.h" #include "include/aegisub/context.h" +#include "options.h" #include "selection_controller.h" #include @@ -66,14 +68,18 @@ void VisualToolClip::Draw() { DrawAllFeatures(); + // Load colors from options + wxColour line_color = to_wx(line_color_primary_opt->GetColor()); + float shaded_alpha = static_cast(shaded_area_alpha_opt->GetDouble()); + // Draw rectangle - gl.SetLineColour(colour[3], 1.0f, 2); - gl.SetFillColour(colour[3], 0.0f); + gl.SetLineColour(line_color, 1.0f, 2); + gl.SetFillColour(line_color, 0.0f); gl.DrawRectangle(cur_1, cur_2); // Draw outside area - gl.SetLineColour(colour[3], 0.0f); - gl.SetFillColour(*wxBLACK, 0.5f); + gl.SetLineColour(line_color, 0.0f); + gl.SetFillColour(*wxBLACK, shaded_alpha); if (inverse) { gl.DrawRectangle(cur_1, cur_2); } diff --git a/src/visual_tool_drag.cpp b/src/visual_tool_drag.cpp index 63236dc7f..9d8aa6594 100644 --- a/src/visual_tool_drag.cpp +++ b/src/visual_tool_drag.cpp @@ -22,6 +22,7 @@ #include "ass_dialogue.h" #include "ass_file.h" +#include "compat.h" #include "include/aegisub/context.h" #include "libresrc/libresrc.h" #include "options.h" @@ -182,6 +183,9 @@ void VisualToolDrag::OnSelectedSetChanged() { void VisualToolDrag::Draw() { DrawAllFeatures(); + // Load colors from options + wxColour line_color = to_wx(line_color_primary_opt->GetColor()); + // Draw connecting lines for (auto& feature : features) { if (feature.type == DRAG_START) continue; @@ -203,7 +207,7 @@ void VisualToolDrag::Draw() { Vector2D end = p2->pos - direction * (10 + arrow_len); if (has_arrow) { - gl.SetLineColour(colour[3], 0.8f, 2); + gl.SetLineColour(line_color, 0.8f, 2); // Arrow line gl.DrawLine(start, end); @@ -214,7 +218,7 @@ void VisualToolDrag::Draw() { } // Draw dashed line else { - gl.SetLineColour(colour[3], 0.5f, 2); + gl.SetLineColour(line_color, 0.5f, 2); gl.DrawDashedLine(start, end, 6); } } diff --git a/src/visual_tool_rotatexy.cpp b/src/visual_tool_rotatexy.cpp index 0a6949c22..acb389acd 100644 --- a/src/visual_tool_rotatexy.cpp +++ b/src/visual_tool_rotatexy.cpp @@ -20,7 +20,9 @@ #include "visual_tool_rotatexy.h" +#include "compat.h" #include "include/aegisub/context.h" +#include "options.h" #include "selection_controller.h" #include @@ -41,17 +43,21 @@ void VisualToolRotateXY::Draw() { DrawAllFeatures(); + // Load colors from options + wxColour line_color_primary = to_wx(line_color_primary_opt->GetColor()); + wxColour line_color_secondary = to_wx(line_color_secondary_opt->GetColor()); + // Transform grid gl.SetOrigin(org->pos); gl.SetRotation(angle_x, angle_y, angle_z); gl.SetShear(fax, fay); // Draw grid - gl.SetLineColour(colour[0], 0.5f, 2); + gl.SetLineColour(line_color_secondary, 0.5f, 2); gl.SetModeLine(); - float r = colour[0].Red() / 255.f; - float g = colour[0].Green() / 255.f; - float b = colour[0].Blue() / 255.f; + float r = line_color_secondary.Red() / 255.f; + float g = line_color_secondary.Green() / 255.f; + float b = line_color_secondary.Blue() / 255.f; // Number of lines on each side of each axis static const int radius = 15; @@ -103,7 +109,7 @@ void VisualToolRotateXY::Draw() { gl.DrawLines(2, points, 4, colors); // Draw vectors - gl.SetLineColour(colour[3], 1.f, 2); + gl.SetLineColour(line_color_primary, 1.f, 2); float vectors[] = { 0.f, 0.f, 0.f, 50.f, 0.f, 0.f, diff --git a/src/visual_tool_rotatez.cpp b/src/visual_tool_rotatez.cpp index 9e7e1f8e6..0d8bf2a9c 100644 --- a/src/visual_tool_rotatez.cpp +++ b/src/visual_tool_rotatez.cpp @@ -20,7 +20,9 @@ #include "visual_tool_rotatez.h" +#include "compat.h" #include "include/aegisub/context.h" +#include "options.h" #include "selection_controller.h" #include @@ -44,6 +46,11 @@ void VisualToolRotateZ::Draw() { DrawAllFeatures(); + // Load colors from options + wxColour line_color_primary = to_wx(line_color_primary_opt->GetColor()); + wxColour line_color_secondary = to_wx(line_color_secondary_opt->GetColor()); + wxColour highlight_color = to_wx(highlight_color_primary_opt->GetColor()); + float radius = (pos - org->pos).Len(); float oRadius = radius; if (radius < 50) @@ -55,8 +62,8 @@ void VisualToolRotateZ::Draw() { gl.SetScale(scale); // Draw the circle - gl.SetLineColour(colour[0]); - gl.SetFillColour(colour[1], 0.3f); + gl.SetLineColour(line_color_secondary); + gl.SetFillColour(highlight_color, 0.3f); gl.DrawRing(Vector2D(0, 0), radius + 4, radius - 4); // Draw markers around circle @@ -70,7 +77,7 @@ void VisualToolRotateZ::Draw() { // Draw the baseline through the origin showing current rotation Vector2D angle_vec(Vector2D::FromAngle(angle * deg2rad)); - gl.SetLineColour(colour[3], 1, 2); + gl.SetLineColour(line_color_primary, 1, 2); gl.DrawLine(angle_vec * -radius, angle_vec * radius); if (org->pos != pos) { @@ -84,8 +91,8 @@ void VisualToolRotateZ::Draw() { } // Draw the fake features on the ring - gl.SetLineColour(colour[0], 1.f, 1); - gl.SetFillColour(colour[1], 0.3f); + gl.SetLineColour(line_color_secondary, 1.f, 1); + gl.SetFillColour(highlight_color, 0.3f); gl.DrawCircle(angle_vec * radius, 4); gl.DrawCircle(angle_vec * -radius, 4); @@ -94,7 +101,7 @@ void VisualToolRotateZ::Draw() { // Draw line to mouse if it isn't over the origin feature if (mouse_pos && (mouse_pos - org->pos).SquareLen() > 100) { - gl.SetLineColour(colour[0]); + gl.SetLineColour(line_color_secondary); gl.DrawLine(org->pos, mouse_pos); } } diff --git a/src/visual_tool_scale.cpp b/src/visual_tool_scale.cpp index 045352048..10468d3a9 100644 --- a/src/visual_tool_scale.cpp +++ b/src/visual_tool_scale.cpp @@ -20,6 +20,9 @@ #include "visual_tool_scale.h" +#include "compat.h" +#include "options.h" + #include VisualToolScale::VisualToolScale(VideoDisplay *parent, agi::Context *context) @@ -35,6 +38,11 @@ void VisualToolScale::Draw() { // The width of the y scale guide/height of the x scale guide static const int guide_size = 10; + // Load colors from options + wxColour line_color_primary = to_wx(line_color_primary_opt->GetColor()); + wxColour line_color_secondary = to_wx(line_color_secondary_opt->GetColor()); + wxColour highlight_color = to_wx(highlight_color_primary_opt->GetColor()); + // Ensure that the scaling UI is comfortably visible on screen Vector2D base_point = pos .Max(Vector2D(base_len / 2 + guide_size, base_len / 2 + guide_size)) @@ -54,13 +62,13 @@ void VisualToolScale::Draw() { Vector2D y_p2(scale_half_length.X(), minor_dim_offset); // Current scale amount lines - gl.SetLineColour(colour[3], 1.f, 2); + gl.SetLineColour(line_color_primary, 1.f, 2); gl.DrawLine(x_p1, x_p2); gl.DrawLine(y_p1, y_p2); // Fake features at the end of the lines - gl.SetLineColour(colour[0], 1.f, 1); - gl.SetFillColour(colour[1], 0.3f); + gl.SetLineColour(line_color_secondary, 1.f, 1); + gl.SetFillColour(highlight_color, 0.3f); gl.DrawCircle(x_p1, 4); gl.DrawCircle(x_p2, 4); gl.DrawCircle(y_p1, 4); @@ -68,12 +76,12 @@ void VisualToolScale::Draw() { // Draw the guides int half_len = base_len / 2; - gl.SetLineColour(colour[0], 1.f, 1); + gl.SetLineColour(line_color_secondary, 1.f, 1); gl.DrawRectangle(Vector2D(half_len, -half_len), Vector2D(half_len + guide_size, half_len)); gl.DrawRectangle(Vector2D(-half_len, half_len), Vector2D(half_len, half_len + guide_size)); // Draw the feet - gl.SetLineColour(colour[0], 1.f, 2); + gl.SetLineColour(line_color_secondary, 1.f, 2); gl.DrawLine(Vector2D(half_len + guide_size, -half_len), Vector2D(half_len + guide_size + guide_size / 2, -half_len)); gl.DrawLine(Vector2D(half_len + guide_size, half_len), Vector2D(half_len + guide_size + guide_size / 2, half_len)); gl.DrawLine(Vector2D(-half_len, half_len + guide_size), Vector2D(-half_len, half_len + guide_size + guide_size / 2)); diff --git a/src/visual_tool_vector_clip.cpp b/src/visual_tool_vector_clip.cpp index cc04eddca..bbe00d8e9 100644 --- a/src/visual_tool_vector_clip.cpp +++ b/src/visual_tool_vector_clip.cpp @@ -17,6 +17,7 @@ #include "visual_tool_vector_clip.h" #include "ass_dialogue.h" +#include "compat.h" #include "include/aegisub/context.h" #include "libresrc/libresrc.h" #include "options.h" @@ -92,8 +93,14 @@ void VisualToolVectorClip::Draw() { assert(!start.empty()); assert(!count.empty()); - gl.SetLineColour(colour[3], .5f, 2); - gl.SetFillColour(wxColour(0, 0, 0), 0.5f); + // Load colors from options + wxColour line_color = to_wx(line_color_primary_opt->GetColor()); + wxColour highlight_color_primary = to_wx(highlight_color_primary_opt->GetColor()); + wxColour highlight_color_secondary = to_wx(highlight_color_secondary_opt->GetColor()); + float shaded_alpha = static_cast(shaded_area_alpha_opt->GetDouble()); + + gl.SetLineColour(line_color, .5f, 2); + gl.SetFillColour(*wxBLACK, shaded_alpha); // draw the shade over clipped out areas and line showing the clip gl.DrawMultiPolygon(points, start, count, video_pos, video_res, !inverse); @@ -117,13 +124,13 @@ void VisualToolVectorClip::Draw() { if ((mode == 3 || mode == 4) && !active_feature && points.size() > 2) { auto highlighted_points = spline.GetPointList(highlighted_curve); if (!highlighted_points.empty()) { - gl.SetLineColour(colour[2], 1.f, 2); + gl.SetLineColour(highlight_color_secondary, 1.f, 2); gl.DrawLineStrip(2, highlighted_points); } } // Draw lines connecting the bicubic features - gl.SetLineColour(colour[3], 0.9f, 1); + gl.SetLineColour(line_color, 0.9f, 1); for (auto const& curve : spline) { if (curve.type == SplineCurve::BICUBIC) { gl.DrawDashedLine(curve.p1, curve.p2, 6); @@ -133,19 +140,19 @@ void VisualToolVectorClip::Draw() { // Draw features for (auto& feature : features) { - int color = 3; + wxColour feature_color = line_color; if (&feature == active_feature) - color = 1; + feature_color = highlight_color_primary; else if (sel_features.count(&feature)) - color = 2; - gl.SetFillColour(colour[color], .6f); + feature_color = highlight_color_secondary; + gl.SetFillColour(feature_color, .6f); if (feature.type == DRAG_SMALL_SQUARE) { - gl.SetLineColour(colour[3], .5f, 1); + gl.SetLineColour(line_color, .5f, 1); gl.DrawRectangle(feature.pos - 3, feature.pos + 3); } else { - gl.SetLineColour(colour[color], .5f, 1); + gl.SetLineColour(feature_color, .5f, 1); gl.DrawCircle(feature.pos, 2.f); } } From 24116171583bfcfd3575f9b5106648c018f97a2c Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 29 Apr 2018 17:19:02 -0400 Subject: [PATCH 040/271] Properly ignore ASS whitespace characters in character counter --- libaegisub/common/character_count.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/libaegisub/common/character_count.cpp b/libaegisub/common/character_count.cpp index 1276f74fb..4563157a1 100644 --- a/libaegisub/common/character_count.cpp +++ b/libaegisub/common/character_count.cpp @@ -31,6 +31,8 @@ struct utext_deleter { }; using utext_ptr = std::unique_ptr; +UChar32 ass_special_chars[] = {'n', 'N', 'h'}; + icu::BreakIterator& get_break_iterator(const char *ptr, size_t len) { static std::unique_ptr bi; static std::once_flag token; @@ -65,10 +67,25 @@ size_t count_in_range(Iterator begin, Iterator end, int mask) { UChar32 c; int i = 0; U8_NEXT_UNSAFE(begin + pos, i, c); - if ((U_GET_GC_MASK(c) & mask) == 0) - ++count; + if ((U_GET_GC_MASK(c) & mask) == 0) { + if (mask & U_GC_Z_MASK && pos != 0) { + UChar32 *result = std::find(std::begin(ass_special_chars), std::end(ass_special_chars), c); + if (result != std::end(ass_special_chars)) { + UChar32 c2; + i = 0; + U8_PREV_UNSAFE(begin + pos, i, c2); + if (c2 != (UChar32) '\\') + ++count; + else if (!(mask & U_GC_P_MASK)) + --count; + } + else + ++count; + } + else + ++count; + } } - } return count; } From 293673fef15d4182564966655002f53bc9bcc9a3 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 17 Nov 2018 19:27:25 -0500 Subject: [PATCH 041/271] Divorce stored TPP lead-in/out values from config There's no real reason to link these as far as I can tell, and plenty of valid reasons not to --- src/dialog_timing_processor.cpp | 8 ++++---- src/libresrc/default_config.json | 4 ++++ src/libresrc/osx/default_config.json | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/dialog_timing_processor.cpp b/src/dialog_timing_processor.cpp index 00719c51c..e0b7dc00b 100644 --- a/src/dialog_timing_processor.cpp +++ b/src/dialog_timing_processor.cpp @@ -144,8 +144,8 @@ DialogTimingProcessor::DialogTimingProcessor(agi::Context *c) d.SetIcon(GETICON(timing_processor_toolbutton_16)); // Read options - leadIn = OPT_GET("Audio/Lead/IN")->GetInt(); - leadOut = OPT_GET("Audio/Lead/OUT")->GetInt(); + leadIn = OPT_GET("Tool/Timing Post Processor/Lead/IN")->GetInt(); + leadOut = OPT_GET("Tool/Timing Post Processor/Lead/OUT")->GetInt(); beforeStart = OPT_GET("Tool/Timing Post Processor/Threshold/Key Start Before")->GetInt(); beforeEnd = OPT_GET("Tool/Timing Post Processor/Threshold/Key End Before")->GetInt(); afterStart = OPT_GET("Tool/Timing Post Processor/Threshold/Key Start After")->GetInt(); @@ -305,8 +305,8 @@ void DialogTimingProcessor::UpdateControls() { void DialogTimingProcessor::OnApply(wxCommandEvent &) { d.TransferDataFromWindow(); // Save settings - OPT_SET("Audio/Lead/IN")->SetInt(leadIn); - OPT_SET("Audio/Lead/OUT")->SetInt(leadOut); + OPT_SET("Tool/Timing Post Processor/Lead/IN")->SetInt(leadIn); + OPT_SET("Tool/Timing Post Processor/Lead/OUT")->SetInt(leadOut); OPT_SET("Tool/Timing Post Processor/Threshold/Key Start Before")->SetInt(beforeStart); OPT_SET("Tool/Timing Post Processor/Threshold/Key Start After")->SetInt(afterStart); OPT_SET("Tool/Timing Post Processor/Threshold/Key End Before")->SetInt(beforeEnd); diff --git a/src/libresrc/default_config.json b/src/libresrc/default_config.json index 35f870950..a48690351 100644 --- a/src/libresrc/default_config.json +++ b/src/libresrc/default_config.json @@ -552,6 +552,10 @@ } }, "Only Selection" : false, + "Lead" : { + "IN" : 100, + "OUT" : 350 + }, "Threshold" : { "Adjacent Gap" : 300, "Adjacent Overlap" : 50, diff --git a/src/libresrc/osx/default_config.json b/src/libresrc/osx/default_config.json index 5ad7be7d0..e5bdce0f5 100644 --- a/src/libresrc/osx/default_config.json +++ b/src/libresrc/osx/default_config.json @@ -552,6 +552,10 @@ } }, "Only Selection" : false, + "Lead" : { + "IN" : 100, + "OUT" : 350 + }, "Threshold" : { "Adjacent Gap" : 300, "Adjacent Overlap" : 50, From 698c41afef56776cd0c6c3c4e8e7b8ef2c6a50da Mon Sep 17 00:00:00 2001 From: wangqr Date: Thu, 16 May 2019 11:04:53 -0400 Subject: [PATCH 042/271] Fix iconv ConversionFailure on long path --- libaegisub/common/charset_conv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libaegisub/common/charset_conv.cpp b/libaegisub/common/charset_conv.cpp index a8efba7eb..498d360b4 100644 --- a/libaegisub/common/charset_conv.cpp +++ b/libaegisub/common/charset_conv.cpp @@ -366,7 +366,7 @@ size_t IconvWrapper::RequiredBufferSize(std::string const& str) { } size_t IconvWrapper::RequiredBufferSize(const char* src, size_t srcLen) { - char buff[512]; + char buff[65536]; size_t charsWritten = 0; size_t res; From 38046516b3e04bb082c36bf77ef4a8662680b9f5 Mon Sep 17 00:00:00 2001 From: wangqr Date: Wed, 22 May 2019 20:10:09 -0400 Subject: [PATCH 043/271] Fix FFT first sample location Fix wangqr/Aegisub#1 --- src/audio_renderer_spectrum.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio_renderer_spectrum.cpp b/src/audio_renderer_spectrum.cpp index d52fb981c..d0a299a86 100644 --- a/src/audio_renderer_spectrum.cpp +++ b/src/audio_renderer_spectrum.cpp @@ -170,7 +170,7 @@ void AudioSpectrumRenderer::FillBlock(size_t block_index, float *block) assert(cache); assert(block); - int64_t first_sample = ((int64_t)block_index) << derivation_dist; + int64_t first_sample = (((int64_t)block_index) << derivation_dist) - ((int64_t)1 << derivation_size); provider->GetAudio(&audio_scratch[0], first_sample, 2 << derivation_size); #ifdef WITH_FFTW3 From 73ca9ace1cd9bd7697cbcda9d1e842e65f69ba0f Mon Sep 17 00:00:00 2001 From: wangqr Date: Mon, 3 Jun 2019 22:08:11 -0400 Subject: [PATCH 044/271] Change the default fontsize and the list of resolutions The default fontsize is changed to 48. While it still looks small on the default 720p video, it is actually bigger than 20 / 480 * 720 = 30 Here 720p is the default video resolution after 837d5a41d7. Some common resolutions are also added to the preset list. Fix wangqr/Aegisub#3 --- src/ass_style.h | 2 +- src/dialog_dummy_video.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ass_style.h b/src/ass_style.h index bbbf94787..d366880d4 100644 --- a/src/ass_style.h +++ b/src/ass_style.h @@ -41,7 +41,7 @@ class AssStyle final : public AssEntry, public AssEntryListHook { public: std::string name = "Default"; ///< Name of the style; must be case-insensitively unique within a file despite being case-sensitive std::string font = "Arial"; ///< Font face name - double fontsize = 20.; ///< Font size + double fontsize = 48.; ///< Font size agi::Color primary{ 255, 255, 255 }; ///< Default text color agi::Color secondary{ 255, 0, 0 }; ///< Text color for not-yet-reached karaoke syllables diff --git a/src/dialog_dummy_video.cpp b/src/dialog_dummy_video.cpp index 23b32ce17..d6e61b6d6 100644 --- a/src/dialog_dummy_video.cpp +++ b/src/dialog_dummy_video.cpp @@ -72,9 +72,11 @@ static ResolutionShortcut resolutions[] = { {"704x396 (SD widescreen)", 704, 396}, {"640x352 (SD widescreen MOD16)", 640, 352}, {"704x400 (SD widescreen MOD16)", 704, 400}, + {"1024x576 (SuperPAL widescreen)", 1024, 576}, {"1280x720 (HD 720p)", 1280, 720}, - {"1920x1080 (HD 1080p)", 1920, 1080}, - {"1024x576 (SuperPAL widescreen)", 1024, 576} + {"1920x1080 (FHD 1080p)", 1920, 1080}, + {"2560x1440 (QHD 1440p)", 2560, 1440}, + {"3840x2160 (4K UHD 2160p)", 3840, 2160}, }; wxSpinCtrl *spin_ctrl(wxWindow *parent, int min, int max, int *value) { From d7139c40c0842dc7d59cfc6a7f250e2c994e1c2e Mon Sep 17 00:00:00 2001 From: wangqr Date: Thu, 6 Jun 2019 15:24:40 -0400 Subject: [PATCH 045/271] Remove call to wxSizer::CalcMin and wxSizer::RecalcSizes As they are used internally by Layout and should not be called directly. --- src/frame_main.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/frame_main.cpp b/src/frame_main.cpp index b35c32960..df115b27c 100644 --- a/src/frame_main.cpp +++ b/src/frame_main.cpp @@ -240,8 +240,6 @@ void FrameMain::SetDisplayMode(int video, int audio) { TopSizer->Show(videoBox, showVideo, true); ToolsSizer->Show(audioBox, showAudio, true); - MainSizer->CalcMin(); - MainSizer->RecalcSizes(); MainSizer->Layout(); Layout(); From bb5090ac3a9e32b051ee4a703a6bc849930f1983 Mon Sep 17 00:00:00 2001 From: wangqr Date: Sun, 16 Jun 2019 19:14:10 -0400 Subject: [PATCH 046/271] Detect EBML magic number to skip encoding detection for MKV MKV loads slow after f733297499f72ea11c166f6be23751a7b002c51c --- libaegisub/common/charset.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libaegisub/common/charset.cpp b/libaegisub/common/charset.cpp index 1addb90ee..406cbfbd2 100644 --- a/libaegisub/common/charset.cpp +++ b/libaegisub/common/charset.cpp @@ -34,6 +34,15 @@ std::string Detect(agi::fs::path const& file) { if (fp.size() > 100 * 1024 * 1024) return "binary"; + + // FIXME: Dirty hack for Matroska. These 4 bytes are the magic + // number of EBML which is used by mkv and webm + if (fp.size() >= 4) { + const char* buf = fp.read(0, 4); + if (!strncmp(buf, "\x1a\x45\xdf\xa3", 4)) + return "binary"; + } + uint64_t binaryish = 0; #ifdef WITH_UCHARDET From 716c2eae0d0e0a6532346122bbf5ae08e3eb6903 Mon Sep 17 00:00:00 2001 From: wangqr Date: Wed, 24 Jul 2019 09:11:17 -0400 Subject: [PATCH 047/271] Remove the usage of dummy wxTimerEvent --- src/audio_karaoke.cpp | 9 ++++++--- src/audio_karaoke.h | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/audio_karaoke.cpp b/src/audio_karaoke.cpp index 6d3d16fa9..2abeb79d8 100644 --- a/src/audio_karaoke.cpp +++ b/src/audio_karaoke.cpp @@ -280,8 +280,7 @@ void AudioKaraoke::OnMouse(wxMouseEvent &event) { split_area->Refresh(false); scroll_timer.Start(50); split_area->CaptureMouse(); - wxTimerEvent evt; - OnScrollTimer(evt); + OnScrollTimer(); } return; } @@ -317,7 +316,7 @@ void AudioKaraoke::OnMouse(wxMouseEvent &event) { split_area->Refresh(false); } -void AudioKaraoke::OnScrollTimer(wxTimerEvent &) { +void AudioKaraoke::OnScrollTimer() { scroll_x += scroll_dir * char_width * 3; int max_scroll = rendered_line.GetWidth() + 20 - split_area->GetClientSize().GetWidth(); @@ -329,6 +328,10 @@ void AudioKaraoke::OnScrollTimer(wxTimerEvent &) { split_area->Refresh(false); } +void AudioKaraoke::OnScrollTimer(wxTimerEvent&) { + OnScrollTimer(); +} + void AudioKaraoke::LoadFromLine() { scroll_x = 0; scroll_timer.Stop(); diff --git a/src/audio_karaoke.h b/src/audio_karaoke.h index 2d14207d0..520f48682 100644 --- a/src/audio_karaoke.h +++ b/src/audio_karaoke.h @@ -142,7 +142,8 @@ class AudioKaraoke final : public wxWindow { void OnPaint(wxPaintEvent &event); void OnSize(wxSizeEvent &event); void OnAudioOpened(agi::AudioProvider *provider); - void OnScrollTimer(wxTimerEvent &event); + void OnScrollTimer(); + void OnScrollTimer(wxTimerEvent& event); public: /// Constructor From 0a2a07ba7e702d9afb0b7588fee83e0b7ebde7c6 Mon Sep 17 00:00:00 2001 From: wangqr Date: Sat, 24 Aug 2019 01:16:18 -0400 Subject: [PATCH 048/271] Use absolute distance when scrolling audio box with mouse wheel Instead of 1/3 screen per tick. So the distance of scroll no longer depends on the width of the audio box. Besides, 1/3 is feels to far for me when the audio box is wide. See wangqr/Aegisub#5 --- src/audio_box.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/audio_box.cpp b/src/audio_box.cpp index 4d1f1518f..dea20cd31 100644 --- a/src/audio_box.cpp +++ b/src/audio_box.cpp @@ -129,10 +129,9 @@ END_EVENT_TABLE() void AudioBox::OnMouseWheel(wxMouseEvent &evt) { if (!ForwardMouseWheelEvent(audioDisplay, evt)) return; - bool zoom = evt.CmdDown() != OPT_GET("Audio/Wheel Default to Zoom")->GetBool(); if (!zoom) { - int amount = -evt.GetWheelRotation() * GetClientSize().GetWidth() / (evt.GetWheelDelta() * 3); + int amount = -evt.GetWheelRotation(); // If the user did a horizontal scroll the amount should be inverted // for it to be natural. if (evt.GetWheelAxis() == 1) amount = -amount; From b429645006c8c912d14c1c47ddb7b1f175e2aeb8 Mon Sep 17 00:00:00 2001 From: wangqr Date: Sun, 1 Sep 2019 22:55:13 -0400 Subject: [PATCH 049/271] visualSubToolBar now use same style as other toolbars Previously visualSubToolBar has boarder while visualToolBar does not. So the width of the toolbar will change when toggling visualSubToolBar. Now we remove the boarder so they have the same width. A separator is added at the top of visualToolBar instead to provide visual cue. Fix wangqr/Aegisub#11 --- src/video_box.cpp | 2 +- src/video_display.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video_box.cpp b/src/video_box.cpp index 0b1da4096..086aa1ce0 100644 --- a/src/video_box.cpp +++ b/src/video_box.cpp @@ -70,7 +70,7 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context) auto zoomBox = new wxComboBox(this, -1, "75%", wxDefaultPosition, wxDefaultSize, choices, wxCB_DROPDOWN | wxTE_PROCESS_ENTER); auto visualToolBar = toolbar::GetToolbar(this, "visual_tools", context, "Video", true); - auto visualSubToolBar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_VERTICAL | wxTB_BOTTOM | wxTB_FLAT); + auto visualSubToolBar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_VERTICAL | wxTB_BOTTOM | wxTB_NODIVIDER | wxTB_FLAT); auto videoDisplay = new VideoDisplay(visualSubToolBar, isDetached, zoomBox, this, context); videoDisplay->MoveBeforeInTabOrder(videoSlider); diff --git a/src/video_display.cpp b/src/video_display.cpp index 2df9ec3c0..3a5c2d40d 100644 --- a/src/video_display.cpp +++ b/src/video_display.cpp @@ -410,6 +410,7 @@ void VideoDisplay::SetZoomFromBoxText(wxCommandEvent &) { void VideoDisplay::SetTool(std::unique_ptr new_tool) { toolBar->ClearTools(); + toolBar->AddSeparator(); toolBar->Realize(); toolBar->Show(false); From 9ed381f498f6cdd22f78292d5f6112279850a5fd Mon Sep 17 00:00:00 2001 From: wangqr Date: Mon, 2 Sep 2019 22:23:19 -0400 Subject: [PATCH 050/271] Remove extra semicolon --- libaegisub/include/libaegisub/fs.h | 2 +- src/initial_line_state.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libaegisub/include/libaegisub/fs.h b/libaegisub/include/libaegisub/fs.h index e09711e93..6b3e212ce 100644 --- a/libaegisub/include/libaegisub/fs.h +++ b/libaegisub/include/libaegisub/fs.h @@ -53,7 +53,7 @@ namespace agi { DEFINE_FS_EXCEPTION(FileNotFound, FileNotAccessible, "File not found: "); /// An error of some unknown type has occured - DEFINE_EXCEPTION(FileSystemUnknownError, FileSystemError);; + DEFINE_EXCEPTION(FileSystemUnknownError, FileSystemError); /// The path exists, but isn't a file DEFINE_FS_EXCEPTION(NotAFile, FileNotAccessible, "Path is not a file (and should be): "); diff --git a/src/initial_line_state.h b/src/initial_line_state.h index a92724b34..c3918c8c6 100644 --- a/src/initial_line_state.h +++ b/src/initial_line_state.h @@ -31,5 +31,5 @@ public: InitialLineState(agi::Context *c); std::string const& GetInitialText() const { return initial_text; } - DEFINE_SIGNAL_ADDERS(InitialStateChanged, AddChangeListener); + DEFINE_SIGNAL_ADDERS(InitialStateChanged, AddChangeListener) }; From b3f0cb8953331fb3e78240f83f6bc53c20009f71 Mon Sep 17 00:00:00 2001 From: wangqr Date: Tue, 3 Sep 2019 11:58:20 -0400 Subject: [PATCH 051/271] Don't internally reset the selection after collected fonts This creates an inconsistency between UI and internal mode. Fix wangqr/Aegisub#10 --- src/dialog_fonts_collector.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dialog_fonts_collector.cpp b/src/dialog_fonts_collector.cpp index 78ac20ef5..e98fc1e53 100644 --- a/src/dialog_fonts_collector.cpp +++ b/src/dialog_fonts_collector.cpp @@ -415,8 +415,7 @@ void DialogFontsCollector::OnCollectionComplete(wxThreadEvent &) { if (path.Decode("?script") == "?script") collection_mode->Enable(2, false); - wxCommandEvent evt; - OnRadio(evt); + UpdateControls(); } } From 06798f2caf4f4e3eb79875a1ac96c2e0399c81ca Mon Sep 17 00:00:00 2001 From: davste0816 Date: Mon, 11 Mar 2019 19:54:31 -0400 Subject: [PATCH 052/271] Recognize .opus as an audio format, .h264 .hevc as video formats --- packages/win_installer/fragment_associations.iss | 7 ++++++- src/command/audio.cpp | 2 +- src/command/video.cpp | 2 +- src/project.cpp | 3 +++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/win_installer/fragment_associations.iss b/packages/win_installer/fragment_associations.iss index 2fe401baf..7e19a3340 100644 --- a/packages/win_installer/fragment_associations.iss +++ b/packages/win_installer/fragment_associations.iss @@ -64,6 +64,9 @@ Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedT Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".wav"; ValueData: ""; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".ogg"; ValueData: ""; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".avs"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".opus"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".h264"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".hevc"; ValueData: ""; Flags: uninsdeletekey ; Class for general subtitle formats Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Subtitle.1"; ValueType: string; ValueName: ""; ValueData: "Aegisub subtitle file"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Subtitle.1"; ValueType: dword; ValueName: "EditFlags"; ValueData: $af0; Flags: uninsdeletekey @@ -195,4 +198,6 @@ Root: HKLM; Subkey: "SOFTWARE\Classes\.m4a\OpenWithProgids"; ValueType: string; Root: HKLM; Subkey: "SOFTWARE\Classes\.wav\OpenWithProgids"; ValueType: string; ValueName: "Aegisub.Audio.1"; Flags: uninsdeletevalue Root: HKLM; Subkey: "SOFTWARE\Classes\.ogg\OpenWithProgids"; ValueType: string; ValueName: "Aegisub.Media.1"; Flags: uninsdeletevalue Root: HKLM; Subkey: "SOFTWARE\Classes\.avs\OpenWithProgids"; ValueType: string; ValueName: "Aegisub.Video.1"; Flags: uninsdeletevalue - +Root: HKLM; Subkey: "SOFTWARE\Classes\.opus\OpenWithProgids"; ValueType: string; ValueName: "Aegisub.Audio.1"; Flags: uninsdeletevalue +Root: HKLM; Subkey: "SOFTWARE\Classes\.h264\OpenWithProgids"; ValueType: string; ValueName: "Aegisub.Video.1"; Flags: uninsdeletevalue +Root: HKLM; Subkey: "SOFTWARE\Classes\.hevc\OpenWithProgids"; ValueType: string; ValueName: "Aegisub.Video.1"; Flags: uninsdeletevalue diff --git a/src/command/audio.cpp b/src/command/audio.cpp index d10491b07..de25d6454 100644 --- a/src/command/audio.cpp +++ b/src/command/audio.cpp @@ -80,7 +80,7 @@ struct audio_open final : public Command { STR_HELP("Open an audio file") void operator()(agi::Context *c) override { - auto str = from_wx(_("Audio Formats") + " (*.aac,*.ac3,*.ape,*.dts,*.flac,*.m4a,*.mka,*.mp3,*.mp4,*.ogg,*.w64,*.wav,*.wma)|*.aac;*.ac3;*.ape;*.dts;*.flac;*.m4a;*.mka;*.mp3;*.mp4;*.ogg;*.w64;*.wav;*.wma|" + auto str = from_wx(_("Audio Formats") + " (*.aac,*.ac3,*.ape,*.dts,*.flac,*.m4a,*.mka,*.mp3,*.mp4,*.ogg,*.opus,*.w64,*.wav,*.wma)|*.aac;*.ac3;*.ape;*.dts;*.flac;*.m4a;*.mka;*.mp3;*.mp4;*.ogg;*.opus;*.w64;*.wav;*.wma|" + _("Video Formats") + " (*.asf,*.avi,*.avs,*.d2v,*.m2ts,*.m4v,*.mkv,*.mov,*.mp4,*.mpeg,*.mpg,*.ogm,*.webm,*.wmv,*.ts)|*.asf;*.avi;*.avs;*.d2v;*.m2ts;*.m4v;*.mkv;*.mov;*.mp4;*.mpeg;*.mpg;*.ogm;*.webm;*.wmv;*.ts|" + _("All Files") + " (*.*)|*.*"); auto filename = OpenFileSelector(_("Open Audio File"), "Path/Last/Audio", "", "", str, c->parent); diff --git a/src/command/video.cpp b/src/command/video.cpp index fb2bcb0ba..d3ffaf7fe 100644 --- a/src/command/video.cpp +++ b/src/command/video.cpp @@ -564,7 +564,7 @@ struct video_open final : public Command { STR_HELP("Open a video file") void operator()(agi::Context *c) override { - auto str = from_wx(_("Video Formats") + " (*.asf,*.avi,*.avs,*.d2v,*.m2ts,*.m4v,*.mkv,*.mov,*.mp4,*.mpeg,*.mpg,*.ogm,*.webm,*.wmv,*.ts,*.y4m,*.yuv)|*.asf;*.avi;*.avs;*.d2v;*.m2ts;*.m4v;*.mkv;*.mov;*.mp4;*.mpeg;*.mpg;*.ogm;*.webm;*.wmv;*.ts;*.y4m;*.yuv|" + auto str = from_wx(_("Video Formats") + " (*.asf,*.avi,*.avs,*.d2v,*.h264,*.hevc,*.m2ts,*.m4v,*.mkv,*.mov,*.mp4,*.mpeg,*.mpg,*.ogm,*.webm,*.wmv,*.ts,*.y4m,*.yuv)|*.asf;*.avi;*.avs;*.d2v;*.h264;*.hevc;*.m2ts;*.m4v;*.mkv;*.mov;*.mp4;*.mpeg;*.mpg;*.ogm;*.webm;*.wmv;*.ts;*.y4m;*.yuv|" + _("All Files") + " (*.*)|*.*"); auto filename = OpenFileSelector(_("Open video file"), "Path/Last/Video", "", "", str, c->parent); if (!filename.empty()) diff --git a/src/project.cpp b/src/project.cpp index 312f86fe8..e2b78c319 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -412,6 +412,8 @@ void Project::LoadList(std::vector const& files) { ".avi", ".avs", ".d2v", + ".h264", + ".hevc", ".m2ts", ".m4v", ".mkv", @@ -449,6 +451,7 @@ void Project::LoadList(std::vector const& files) { ".mka", ".mp3", ".ogg", + ".opus", ".w64", ".wav", ".wma" From 073c06d8120cd55b9ddea55b84bf2588129aff09 Mon Sep 17 00:00:00 2001 From: davste0816 Date: Tue, 12 Mar 2019 02:25:46 -0400 Subject: [PATCH 053/271] Add .webm to extension list, add .eac3 as an audio format Co-Authored-By: FichteFoll --- packages/win_installer/fragment_associations.iss | 4 ++++ src/command/audio.cpp | 2 +- src/project.cpp | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/win_installer/fragment_associations.iss b/packages/win_installer/fragment_associations.iss index 7e19a3340..04529dadf 100644 --- a/packages/win_installer/fragment_associations.iss +++ b/packages/win_installer/fragment_associations.iss @@ -67,6 +67,8 @@ Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedT Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".opus"; ValueData: ""; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".h264"; ValueData: ""; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".hevc"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".eac3"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".webm"; ValueData: ""; Flags: uninsdeletekey ; Class for general subtitle formats Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Subtitle.1"; ValueType: string; ValueName: ""; ValueData: "Aegisub subtitle file"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Subtitle.1"; ValueType: dword; ValueName: "EditFlags"; ValueData: $af0; Flags: uninsdeletekey @@ -201,3 +203,5 @@ Root: HKLM; Subkey: "SOFTWARE\Classes\.avs\OpenWithProgids"; ValueType: string; Root: HKLM; Subkey: "SOFTWARE\Classes\.opus\OpenWithProgids"; ValueType: string; ValueName: "Aegisub.Audio.1"; Flags: uninsdeletevalue Root: HKLM; Subkey: "SOFTWARE\Classes\.h264\OpenWithProgids"; ValueType: string; ValueName: "Aegisub.Video.1"; Flags: uninsdeletevalue Root: HKLM; Subkey: "SOFTWARE\Classes\.hevc\OpenWithProgids"; ValueType: string; ValueName: "Aegisub.Video.1"; Flags: uninsdeletevalue +Root: HKLM; Subkey: "SOFTWARE\Classes\.eac3\OpenWithProgids"; ValueType: string; ValueName: "Aegisub.Audio.1"; Flags: uninsdeletevalue +Root: HKLM; Subkey: "SOFTWARE\Classes\.webm\OpenWithProgids"; ValueType: string; ValueName: "Aegisub.Media.1"; Flags: uninsdeletevalue diff --git a/src/command/audio.cpp b/src/command/audio.cpp index de25d6454..386866775 100644 --- a/src/command/audio.cpp +++ b/src/command/audio.cpp @@ -80,7 +80,7 @@ struct audio_open final : public Command { STR_HELP("Open an audio file") void operator()(agi::Context *c) override { - auto str = from_wx(_("Audio Formats") + " (*.aac,*.ac3,*.ape,*.dts,*.flac,*.m4a,*.mka,*.mp3,*.mp4,*.ogg,*.opus,*.w64,*.wav,*.wma)|*.aac;*.ac3;*.ape;*.dts;*.flac;*.m4a;*.mka;*.mp3;*.mp4;*.ogg;*.opus;*.w64;*.wav;*.wma|" + auto str = from_wx(_("Audio Formats") + " (*.aac,*.ac3,*.ape,*.dts,*.eac3,*.flac,*.m4a,*.mka,*.mp3,*.mp4,*.ogg,*.opus,*.w64,*.wav,*.wma)|*.aac;*.ac3;*.ape;*.dts;*.eac3;*.flac;*.m4a;*.mka;*.mp3;*.mp4;*.ogg;*.opus;*.w64;*.wav;*.wma|" + _("Video Formats") + " (*.asf,*.avi,*.avs,*.d2v,*.m2ts,*.m4v,*.mkv,*.mov,*.mp4,*.mpeg,*.mpg,*.ogm,*.webm,*.wmv,*.ts)|*.asf;*.avi;*.avs;*.d2v;*.m2ts;*.m4v;*.mkv;*.mov;*.mp4;*.mpeg;*.mpg;*.ogm;*.webm;*.wmv;*.ts|" + _("All Files") + " (*.*)|*.*"); auto filename = OpenFileSelector(_("Open Audio File"), "Path/Last/Audio", "", "", str, c->parent); diff --git a/src/project.cpp b/src/project.cpp index e2b78c319..7a752eae4 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -446,6 +446,7 @@ void Project::LoadList(std::vector const& files) { ".ac3", ".ape", ".dts", + ".eac3", ".flac", ".m4a", ".mka", From 72d0457bc8bc9deac278e4b56c30a6afd147f65e Mon Sep 17 00:00:00 2001 From: davste0816 Date: Sat, 16 Mar 2019 15:12:57 -0400 Subject: [PATCH 054/271] Fix Move Down button in Export dialog --- src/dialog_export.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dialog_export.cpp b/src/dialog_export.cpp index d2584c528..d0bf99389 100644 --- a/src/dialog_export.cpp +++ b/src/dialog_export.cpp @@ -125,7 +125,7 @@ DialogExport::DialogExport(agi::Context *c) wxButton *btn_none = new wxButton(&d, -1, _("Select &None"), wxDefaultPosition, wxSize(80, -1)); btn_up->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection() - 1, 0); }); - btn_down->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection() - 1, 0); }); + btn_down->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection(), 1); }); btn_all->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { SetAll(true); }); btn_none->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { SetAll(false); }); From 6732179a8a92d685404835ea8218f61d34f84f6c Mon Sep 17 00:00:00 2001 From: wangqr Date: Tue, 10 Sep 2019 02:15:48 -0400 Subject: [PATCH 055/271] Fix wrong memset usage --- tests/tests/audio.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/tests/audio.cpp b/tests/tests/audio.cpp index 4e0853315..1e1ffb308 100644 --- a/tests/tests/audio.cpp +++ b/tests/tests/audio.cpp @@ -30,7 +30,7 @@ TEST(lagi_audio, dummy_blank) { auto provider = agi::CreateDummyAudioProvider("dummy-audio:", nullptr); char buff[1024]; - memset(buff, sizeof(buff), 1); + memset(buff, 1, sizeof(buff)); provider->GetAudio(buff, 12356, 512); for (size_t i = 0; i < sizeof(buff); ++i) ASSERT_EQ(0, buff[i]); } @@ -39,7 +39,7 @@ TEST(lagi_audio, dummy_noise) { auto provider = agi::CreateDummyAudioProvider("dummy-audio:noise?", nullptr); char buff[1024]; - memset(buff, sizeof(buff), 0); + memset(buff, 0, sizeof(buff)); provider->GetAudio(buff, 12356, 512); for (size_t i = 0; i < sizeof(buff); ++i) { if (buff[i] != 0) @@ -78,7 +78,7 @@ TEST(lagi_audio, before_sample_zero) { TestAudioProvider<> provider; uint16_t buff[16]; - memset(buff, sizeof(buff), 1); + memset(buff, 1, sizeof(buff)); provider.GetAudio(buff, -8, 16); for (int i = 0; i < 8; ++i) @@ -92,7 +92,7 @@ TEST(lagi_audio, before_sample_zero_8bit) { provider.bias = 128; uint8_t buff[16]; - memset(buff, sizeof(buff), 1); + memset(buff, 1, sizeof(buff)); provider.GetAudio(buff, -8, 16); for (int i = 0; i < 8; ++i) @@ -105,7 +105,7 @@ TEST(lagi_audio, after_end) { TestAudioProvider<> provider(1); uint16_t buff[16]; - memset(buff, sizeof(buff), 1); + memset(buff, 1, sizeof(buff)); provider.GetAudio(buff, provider.GetNumSamples() - 8, 16); for (int i = 0; i < 8; ++i) From 7a1756a26f4a67656034e70c5ab81f8526617a32 Mon Sep 17 00:00:00 2001 From: wangqr Date: Wed, 11 Sep 2019 11:16:51 -0400 Subject: [PATCH 056/271] In tagless_find_helper only tag before start should be ignored The search result is irrelevant to which tag we should ignore Fix wangqr/Aegisub#17 --- libaegisub/common/util.cpp | 2 +- tests/tests/ifind.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libaegisub/common/util.cpp b/libaegisub/common/util.cpp index e92d14776..45c01ca44 100644 --- a/libaegisub/common/util.cpp +++ b/libaegisub/common/util.cpp @@ -173,7 +173,7 @@ void tagless_find_helper::map_range(size_t &s, size_t &e) { // match for (auto const& block : blocks) { // Any blocks before start are irrelevant as they're included in `start` - if (block.second < s) continue; + if (block.second <= start) continue; // Skip over blocks at the very beginning of the match // < should only happen if the cursor was within an override block // when the user started a search diff --git a/tests/tests/ifind.cpp b/tests/tests/ifind.cpp index e165b9bbe..fea7a4fa9 100644 --- a/tests/tests/ifind.cpp +++ b/tests/tests/ifind.cpp @@ -84,6 +84,8 @@ TEST(lagi_skip_tags, tag_stripping) { EXPECT_EQ("abc", helper.strip_tags("a{}bc", 0)); EXPECT_EQ("abc", helper.strip_tags("abc{}", 0)); EXPECT_EQ("abc", helper.strip_tags("{}a{}bc{}", 0)); + EXPECT_EQ("rmofmat", helper.strip_tags("{\\i1}rmofmat{\\i}", 0)); + EXPECT_EQ("rm of mat", helper.strip_tags("{\\i1}rm of mat{\\i}", 0)); EXPECT_EQ("abc", helper.strip_tags("{}abc", 1)); EXPECT_EQ("abc", helper.strip_tags("{}abc", 2)); @@ -112,6 +114,8 @@ TEST(lagi_skip_tags, range_mapping) { EXPECT_RANGE("{cc}ab", 0, 1, 2, 5, 6); EXPECT_RANGE("{cc}ab{cc}b", 0, 1, 2, 5, 6); EXPECT_RANGE("{cc}ab{cc}b", 0, 1, 3, 5, 11); + EXPECT_RANGE("{\\i1}rmofmat{\\i}", 0, 4, 7, 9, 12); + EXPECT_RANGE("{\\i1}rm of mat{\\i}", 0, 6, 9, 11, 14); EXPECT_RANGE("{cc}ab{cc}b", 3, 1, 3, 5, 11); EXPECT_RANGE("{cc}ab{cc}b", 4, 1, 3, 5, 11); From 896011f5355710c12f912f830ae32698d294cce9 Mon Sep 17 00:00:00 2001 From: wangqr Date: Fri, 13 Sep 2019 15:49:15 -0400 Subject: [PATCH 057/271] Search user fonts in GDI font lister Windows now allow user install fonts without admin. List HKCU for those fonts. https://blogs.windows.com/windowsexperience/2018/06/27/announcing-windows-10-insider-preview-build-17704/ --- src/font_file_lister_gdi.cpp | 42 +++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/font_file_lister_gdi.cpp b/src/font_file_lister_gdi.cpp index 1e55b7870..690655f10 100644 --- a/src/font_file_lister_gdi.cpp +++ b/src/font_file_lister_gdi.cpp @@ -66,28 +66,30 @@ std::vector get_installed_fonts() { std::vector files; - HKEY key; - auto ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, fonts_key_name, 0, KEY_QUERY_VALUE, &key); - if (ret != ERROR_SUCCESS) return files; - BOOST_SCOPE_EXIT_ALL(=) { RegCloseKey(key); }; - - wchar_t fdir[MAX_PATH]; - SHGetFolderPathW(NULL, CSIDL_FONTS, NULL, 0, fdir); - agi::fs::path font_dir(fdir); - - for (DWORD i = 0;; ++i) { - wchar_t font_name[SHRT_MAX], font_filename[MAX_PATH]; - DWORD name_len = sizeof(font_name); - DWORD data_len = sizeof(font_filename); - - ret = RegEnumValueW(key, i, font_name, &name_len, NULL, NULL, reinterpret_cast(font_filename), &data_len); - if (ret == ERROR_NO_MORE_ITEMS) break; + for (HKEY hKey : { HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE }) { + HKEY key; + auto ret = RegOpenKeyExW(hKey, fonts_key_name, 0, KEY_QUERY_VALUE, &key); if (ret != ERROR_SUCCESS) continue; + BOOST_SCOPE_EXIT_ALL(= ) { RegCloseKey(key); }; - agi::fs::path font_path(font_filename); - if (!agi::fs::FileExists(font_path)) - font_path = font_dir / font_path; - files.push_back(font_path); + wchar_t fdir[MAX_PATH]; + SHGetFolderPathW(NULL, CSIDL_FONTS, NULL, 0, fdir); + agi::fs::path font_dir(fdir); + + for (DWORD i = 0;; ++i) { + wchar_t font_name[SHRT_MAX], font_filename[MAX_PATH]; + DWORD name_len = sizeof(font_name); + DWORD data_len = sizeof(font_filename); + + ret = RegEnumValueW(key, i, font_name, &name_len, NULL, NULL, reinterpret_cast(font_filename), &data_len); + if (ret == ERROR_NO_MORE_ITEMS) break; + if (ret != ERROR_SUCCESS) continue; + + agi::fs::path font_path(font_filename); + if (!agi::fs::FileExists(font_path) && agi::fs::FileExists(font_dir / font_path)) + font_path = font_dir / font_path; + files.push_back(font_path); + } } return files; From dd59fc988a3dfbc248c89ae6f49868b3399bb03d Mon Sep 17 00:00:00 2001 From: wangqr Date: Sat, 14 Sep 2019 21:11:03 -0400 Subject: [PATCH 058/271] Fix gtest setup.bat on Windows --- tests/setup.bat | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/setup.bat b/tests/setup.bat index d2a6ec564..e66aa27a4 100644 --- a/tests/setup.bat +++ b/tests/setup.bat @@ -4,13 +4,13 @@ icacls data /grant:r %USERNAME%:F /T rd /s /q data mkdir data -echo '' > data/file +copy nul data\file mkdir data\dir -echo > data/file_access_denied +copy nul data\file_access_denied icacls data\file_access_denied /deny %USERNAME%:F -echo > data/file_read_only +copy nul data\file_read_only icacls data\file_read_only /deny %USERNAME%:W @@ -24,17 +24,14 @@ echo {"Video" : ["Entry One", "Entry Two"]} > data/mru_ok.json echo {"Video" : [1, 3]} > data/mru_invalid.json -echo '1234567890' > data\ten_bytes -echo '' > data\touch_mod_time - -mkdir data/options -cp options/* data/options +< nul set /p ="1234567890" > data\ten_bytes +copy nul data\touch_mod_time mkdir data\dir_iterator -echo '' > data\dir_iterator\1.a -echo '' > data\dir_iterator\2.a -echo '' > data\dir_iterator\1.b -echo '' > data\dir_iterator\2.b +copy nul data\dir_iterator\1.a +copy nul data\dir_iterator\2.a +copy nul data\dir_iterator\1.b +copy nul data\dir_iterator\2.b mkdir data\options xcopy "%~dp0\options" data\options @@ -47,3 +44,5 @@ xcopy "%~dp0\vfr" data\vfr\in mkdir data\keyframe xcopy "%~dp0\keyframe" data\keyframe + +ping -n 2 127.0.0.1 > nul From 1122c0880a756ba13cb87df79ce3c47ba7f74f71 Mon Sep 17 00:00:00 2001 From: wangqr Date: Sun, 15 Sep 2019 00:45:25 -0400 Subject: [PATCH 059/271] Fix failing unit tests on Windows --- tests/tests/audio.cpp | 126 +++++++++++++++++++++++------------------- tests/tests/path.cpp | 9 +++ 2 files changed, 78 insertions(+), 57 deletions(-) diff --git a/tests/tests/audio.cpp b/tests/tests/audio.cpp index 1e1ffb308..917676f52 100644 --- a/tests/tests/audio.cpp +++ b/tests/tests/audio.cpp @@ -122,7 +122,7 @@ TEST(lagi_audio, save_audio_clip) { agi::SaveAudioClip(*provider, path, 60 * 60 * 1000, (60 * 60 + 10) * 1000); { - bfs::ifstream s(path); + bfs::ifstream s(path, std::ios_base::binary); ASSERT_TRUE(s.good()); s.seekg(0, std::ios::end); // 10 seconds of 44.1 kHz samples per second of 16-bit mono, plus 44 bytes of header @@ -141,7 +141,7 @@ TEST(lagi_audio, save_audio_clip_out_of_audio_range) { // Start time after end of clip: empty file agi::SaveAudioClip(*provider, path, end_time, end_time + 1); { - bfs::ifstream s(path); + bfs::ifstream s(path, std::ios_base::binary); ASSERT_TRUE(s.good()); s.seekg(0, std::ios::end); EXPECT_EQ(44, s.tellg()); @@ -151,7 +151,7 @@ TEST(lagi_audio, save_audio_clip_out_of_audio_range) { // Start time >= end time: empty file agi::SaveAudioClip(*provider, path, end_time - 1, end_time - 1); { - bfs::ifstream s(path); + bfs::ifstream s(path, std::ios_base::binary); ASSERT_TRUE(s.good()); s.seekg(0, std::ios::end); EXPECT_EQ(44, s.tellg()); @@ -161,7 +161,7 @@ TEST(lagi_audio, save_audio_clip_out_of_audio_range) { // Start time during clip, end time after end of clip: save only the part that exists agi::SaveAudioClip(*provider, path, end_time - 1000, end_time + 1000); { - bfs::ifstream s(path); + bfs::ifstream s(path, std::ios_base::binary); ASSERT_TRUE(s.good()); s.seekg(0, std::ios::end); // 1 second of 44.1 kHz samples per second of 16-bit mono, plus 44 bytes of header @@ -365,18 +365,20 @@ TEST(lagi_audio, pcm_simple) { agi::SaveAudioClip(provider, path, 0, 1000); } - auto provider = agi::CreatePCMAudioProvider(path, nullptr); - EXPECT_EQ(1, provider->GetChannels()); - EXPECT_EQ(48000, provider->GetNumSamples()); - EXPECT_EQ(48000, provider->GetSampleRate()); - EXPECT_EQ(2, provider->GetBytesPerSample()); - EXPECT_EQ(false, provider->AreSamplesFloat()); - EXPECT_EQ(false, provider->NeedsCache()); + { + auto provider = agi::CreatePCMAudioProvider(path, nullptr); + EXPECT_EQ(1, provider->GetChannels()); + EXPECT_EQ(48000, provider->GetNumSamples()); + EXPECT_EQ(48000, provider->GetSampleRate()); + EXPECT_EQ(2, provider->GetBytesPerSample()); + EXPECT_EQ(false, provider->AreSamplesFloat()); + EXPECT_EQ(false, provider->NeedsCache()); - for (int i = 0; i < 100; ++i) { - uint16_t sample; - provider->GetAudio(&sample, i, 1); - ASSERT_EQ(i, sample); + for (int i = 0; i < 100; ++i) { + uint16_t sample; + provider->GetAudio(&sample, i, 1); + ASSERT_EQ(i, sample); + } } agi::fs::Remove(path); @@ -391,23 +393,25 @@ TEST(lagi_audio, pcm_truncated) { char file[1000]; - { bfs::ifstream s(path); s.read(file, sizeof file); } - { bfs::ofstream s(path); s.write(file, sizeof file); } + { bfs::ifstream s(path, std::ios_base::binary); s.read(file, sizeof file); } + { bfs::ofstream s(path, std::ios_base::binary); s.write(file, sizeof file); } - auto provider = agi::CreatePCMAudioProvider(path, nullptr); + { + auto provider = agi::CreatePCMAudioProvider(path, nullptr); - // Should still report full duration - EXPECT_EQ(48000, provider->GetNumSamples()); + // Should still report full duration + EXPECT_EQ(48000, provider->GetNumSamples()); - // And should zero-pad past the end - auto sample_count = (1000 - 44) / 2; - uint16_t sample; + // And should zero-pad past the end + int64_t sample_count = (1000 - 44) / 2; + uint16_t sample; - provider->GetAudio(&sample, sample_count - 1, 1); - EXPECT_EQ(sample_count - 1, sample); + provider->GetAudio(&sample, sample_count - 1, 1); + EXPECT_EQ(sample_count - 1, sample); - provider->GetAudio(&sample, sample_count, 1); - EXPECT_EQ(0, sample); + provider->GetAudio(&sample, sample_count, 1); + EXPECT_EQ(0, sample); + } agi::fs::Remove(path); } @@ -415,7 +419,7 @@ TEST(lagi_audio, pcm_truncated) { #define RIFF "RIFF\0\0\0\x60WAVE" #define FMT_VALID "fmt \20\0\0\0\1\0\1\0\20\0\0\0\0\0\0\0\0\0\20\0" #define DATA_VALID "data\1\0\0\0\0\0" -#define WRITE(str) do { bfs::ofstream s(path); s.write(str, sizeof(str) - 1); } while (false) +#define WRITE(str) do { bfs::ofstream s(path, std::ios_base::binary); s.write(str, sizeof(str) - 1); } while (false) TEST(lagi_audio, pcm_incomplete) { auto path = agi::Path().Decode("?temp/pcm_incomplete"); @@ -423,7 +427,7 @@ TEST(lagi_audio, pcm_incomplete) { agi::fs::Remove(path); ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::fs::FileNotFound); - bfs::ofstream{path}; + {bfs::ofstream(path, std::ios_base::binary); } ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::AudioDataNotFound); // Invalid tags @@ -438,8 +442,10 @@ TEST(lagi_audio, pcm_incomplete) { // -1 for nul term, -3 so that longest file is still invalid for (size_t i = 0; i < sizeof(valid_file) - 4; ++i) { - bfs::ofstream s(path); - s.write(valid_file, i); + { + bfs::ofstream s(path, std::ios_base::binary); + s.write(valid_file, i); + } ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::AudioDataNotFound); } @@ -463,28 +469,30 @@ TEST(lagi_audio, multiple_data_chunks) { WRITE(RIFF FMT_VALID "data\2\0\0\0\1\0" "data\2\0\0\0\2\0" "data\2\0\0\0\3\0"); - auto provider = agi::CreatePCMAudioProvider(path, nullptr); - ASSERT_EQ(3, provider->GetNumSamples()); + { + auto provider = agi::CreatePCMAudioProvider(path, nullptr); + ASSERT_EQ(3, provider->GetNumSamples()); - uint16_t samples[3]; + uint16_t samples[3]; - provider->GetAudio(samples, 0, 3); - EXPECT_EQ(1, samples[0]); - EXPECT_EQ(2, samples[1]); - EXPECT_EQ(3, samples[2]); + provider->GetAudio(samples, 0, 3); + EXPECT_EQ(1, samples[0]); + EXPECT_EQ(2, samples[1]); + EXPECT_EQ(3, samples[2]); - samples[1] = 5; - provider->GetAudio(samples, 2, 1); - EXPECT_EQ(3, samples[0]); - EXPECT_EQ(5, samples[1]); + samples[1] = 5; + provider->GetAudio(samples, 2, 1); + EXPECT_EQ(3, samples[0]); + EXPECT_EQ(5, samples[1]); - provider->GetAudio(samples, 1, 1); - EXPECT_EQ(2, samples[0]); - EXPECT_EQ(5, samples[1]); + provider->GetAudio(samples, 1, 1); + EXPECT_EQ(2, samples[0]); + EXPECT_EQ(5, samples[1]); - provider->GetAudio(samples, 0, 1); - EXPECT_EQ(1, samples[0]); - EXPECT_EQ(5, samples[1]); + provider->GetAudio(samples, 0, 1); + EXPECT_EQ(1, samples[0]); + EXPECT_EQ(5, samples[1]); + } agi::fs::Remove(path); } @@ -504,13 +512,15 @@ TEST(lagi_audio, wave64_simple) { auto path = agi::Path().Decode("?temp/w64_valid"); WRITE(WAVE64_FILE); - auto provider = agi::CreatePCMAudioProvider(path, nullptr); - ASSERT_EQ(2, provider->GetNumSamples()); + { + auto provider = agi::CreatePCMAudioProvider(path, nullptr); + ASSERT_EQ(2, provider->GetNumSamples()); - uint16_t samples[2]; - provider->GetAudio(samples, 0, 2); - EXPECT_EQ(1, samples[0]); - EXPECT_EQ(2, samples[1]); + uint16_t samples[2]; + provider->GetAudio(samples, 0, 2); + EXPECT_EQ(1, samples[0]); + EXPECT_EQ(2, samples[1]); + } agi::fs::Remove(path); } @@ -520,13 +530,15 @@ TEST(lagi_audio, wave64_truncated) { // Should be invalid until there's an entire sample for (size_t i = 0; i < sizeof(WAVE64_FILE) - 4; ++i) { - bfs::ofstream s(path); - s.write(WAVE64_FILE, i); + { + bfs::ofstream s(path, std::ios_base::binary); + s.write(WAVE64_FILE, i); + } ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::AudioDataNotFound); } { - bfs::ofstream s(path); + bfs::ofstream s(path, std::ios_base::binary); s.write(WAVE64_FILE, sizeof(WAVE64_FILE) - 3); } ASSERT_NO_THROW(agi::CreatePCMAudioProvider(path, nullptr)); diff --git a/tests/tests/path.cpp b/tests/tests/path.cpp index 1f942bebb..c7a6e04f0 100644 --- a/tests/tests/path.cpp +++ b/tests/tests/path.cpp @@ -172,9 +172,18 @@ TEST(lagi_path, make_relative_on_dummy_url) { EXPECT_UNCHANGED("?dummy:23.976000:40000:1280:720:47:163:254:", MakeRelative); } +#ifdef _WIN32 +TEST(lagi_path, encode) { + Path p; + p.SetToken("?user", "C:\\a\\b\\c"); + p.SetToken("?local", "C:\\a\\b\\c\\d"); + EXPECT_EQ("?local\\e", p.Encode("C:\\a\\b\\c\\d\\e")); +} +#else TEST(lagi_path, encode) { Path p; p.SetToken("?user", "/a/b/c"); p.SetToken("?local", "/a/b/c/d"); EXPECT_EQ("?local/e", p.Encode("/a/b/c/d/e")); } +#endif From 10f7458b5ff2c050e99b7fc16293e2972a6ad2e0 Mon Sep 17 00:00:00 2001 From: wangqr Date: Sun, 15 Sep 2019 13:27:54 -0400 Subject: [PATCH 060/271] Fix PCM provider bugs --- libaegisub/audio/provider_pcm.cpp | 22 ++++++++++++++-------- tests/tests/audio.cpp | 4 ++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/libaegisub/audio/provider_pcm.cpp b/libaegisub/audio/provider_pcm.cpp index 13d4538b0..4131ecd2d 100644 --- a/libaegisub/audio/provider_pcm.cpp +++ b/libaegisub/audio/provider_pcm.cpp @@ -56,6 +56,7 @@ class PCMAudioProvider : public AudioProvider { start += read_count; pos += ip.num_samples; } + ZeroFill(write_buf, count); } protected: @@ -67,7 +68,7 @@ protected: template T Read(UInt *data_left) { if (*data_left < sizeof(T)) throw file_ended(); - if (file.size() - file_pos < sizeof(T)) throw file_ended(); + if (file_pos > file.size() || file.size() - file_pos < sizeof(T)) throw file_ended(); auto data = file.read(file_pos, sizeof(T)); file_pos += sizeof(T); @@ -89,7 +90,7 @@ struct FourCC { bool operator==(const char *cmp) const { return !(*this != cmp); } }; -// Overview of RIFF WAV: +// Overview of RIFF WAV: https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn653308(v=vs.85) struct RiffWav { using DataSize = uint32_t; using ChunkId = FourCC; @@ -97,7 +98,7 @@ struct RiffWav { static const char *riff_id() { return "RIFF"; } static const char *wave_id() { return "WAVE"; } static const char *fmt_id() { return "fmt "; } - static const char *data_id() { return "data "; } + static const char *data_id() { return "data"; } static const int alignment = 1; @@ -127,7 +128,7 @@ static const GUID w64Guiddata = {{ 0x64, 0x61, 0x74, 0x61, 0xF3, 0xAC, 0xD3, 0x11, 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A }}; -// http://www.vcs.de/fileadmin/user_upload/MBS/PDF/Whitepaper/Informations_about_Sony_Wave64.pdf +// http://www.ambisonia.com/Members/mleese/sony_wave64.pdf/sony_wave64.pdf struct Wave64 { using DataSize = uint64_t; using ChunkId = GUID; @@ -140,7 +141,7 @@ struct Wave64 { static const uint64_t alignment = 7ULL; // Wave 64 includes the size of the header in the chunk sizes - static uint64_t data_size(uint64_t size) { return size - 16; } + static uint64_t data_size(uint64_t size) { return size - 24; } static uint64_t chunk_size(uint64_t size) { return size - 24; } }; @@ -164,9 +165,11 @@ public: throw AudioDataNotFound("File is not a RIFF WAV file"); while (data_left) { + auto chunk_fcc = Read(&data_left); auto chunk_size = Impl::chunk_size(Read(&data_left)); + uint64_t chunk_end = file_pos + chunk_size; data_left -= std::min(chunk_size, data_left); if (chunk_fcc == Impl::fmt_id()) { @@ -186,14 +189,16 @@ public: else if (chunk_fcc == Impl::data_id()) { if (!channels || !sample_rate || !bytes_per_sample) throw AudioProviderError("Found 'data' chunk without format being set."); - index_points.emplace_back(IndexPoint{file_pos, chunk_size / bytes_per_sample / channels}); num_samples += chunk_size / bytes_per_sample / channels; + uint64_t chunk_decoded_samples = std::min(chunk_size, file.size() - file_pos) / bytes_per_sample / channels; + decoded_samples += chunk_decoded_samples; + index_points.emplace_back(IndexPoint{file_pos, chunk_decoded_samples }); } // There's a bunch of other chunk types. They're all dumb. // blocks are aligned and the padding bytes are not included in // the size of the chunk - file_pos += (chunk_size + Impl::alignment) & ~Impl::alignment; + file_pos = (chunk_end + Impl::alignment) & ~Impl::alignment; } } @@ -202,7 +207,8 @@ public: throw AudioDataNotFound("File ended before reaching format chunk"); // Truncated files are fine otherwise } - decoded_samples = num_samples; + if (decoded_samples == 0) + throw AudioDataNotFound("No audio sample can be decoded"); } }; } diff --git a/tests/tests/audio.cpp b/tests/tests/audio.cpp index 917676f52..23255c042 100644 --- a/tests/tests/audio.cpp +++ b/tests/tests/audio.cpp @@ -417,7 +417,7 @@ TEST(lagi_audio, pcm_truncated) { } #define RIFF "RIFF\0\0\0\x60WAVE" -#define FMT_VALID "fmt \20\0\0\0\1\0\1\0\20\0\0\0\0\0\0\0\0\0\20\0" +#define FMT_VALID "fmt \x10\0\0\0\1\0\1\0\x10\0\0\0\x20\0\0\0\2\0\x10\0" #define DATA_VALID "data\1\0\0\0\0\0" #define WRITE(str) do { bfs::ofstream s(path, std::ios_base::binary); s.write(str, sizeof(str) - 1); } while (false) @@ -438,7 +438,7 @@ TEST(lagi_audio, pcm_incomplete) { ASSERT_THROW(agi::CreatePCMAudioProvider(path, nullptr), agi::AudioDataNotFound); // Incomplete files - auto valid_file = RIFF FMT_VALID DATA_VALID; + const char valid_file[] = RIFF FMT_VALID DATA_VALID; // -1 for nul term, -3 so that longest file is still invalid for (size_t i = 0; i < sizeof(valid_file) - 4; ++i) { From 336745cdb29f9f3bead1507670651580b896d7df Mon Sep 17 00:00:00 2001 From: wangqr Date: Sun, 15 Sep 2019 19:32:49 -0400 Subject: [PATCH 061/271] In Properties dialog, create the button first So the foucus goes to the OK button on init. This will let wxWidgets correctly handle the initial position of text in wxTextCtrl Fix wangqr/Aegisub#6 --- src/dialog_properties.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/dialog_properties.cpp b/src/dialog_properties.cpp index d19c70ae5..76d7477cd 100644 --- a/src/dialog_properties.cpp +++ b/src/dialog_properties.cpp @@ -91,6 +91,14 @@ DialogProperties::DialogProperties(agi::Context *c) { d.SetIcon(GETICON(properties_toolbutton_16)); + // Button sizer + // Create buttons first. See: + // https://github.com/wangqr/Aegisub/issues/6 + // https://trac.wxwidgets.org/ticket/18472#comment:9 + auto ButtonSizer = d.CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP); + d.Bind(wxEVT_BUTTON, &DialogProperties::OnOK, this, wxID_OK); + d.Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Properties"), wxID_HELP); + // Script details crap wxSizer *TopSizer = new wxStaticBoxSizer(wxHORIZONTAL,&d,_("Script")); auto TopSizerGrid = new wxFlexGridSizer(0,2,5,5); @@ -156,11 +164,6 @@ DialogProperties::DialogProperties(agi::Context *c) optionsGrid->AddGrowableCol(1,1); optionsBox->Add(optionsGrid,1,wxEXPAND,0); - // Button sizer - auto ButtonSizer = d.CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP); - d.Bind(wxEVT_BUTTON, &DialogProperties::OnOK, this, wxID_OK); - d.Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Properties"), wxID_HELP); - // MainSizer wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL); MainSizer->Add(TopSizer,0,wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND,5); From 57ee580c0f18515f7d1be19ac477758817456eba Mon Sep 17 00:00:00 2001 From: wangqr Date: Wed, 18 Sep 2019 18:11:18 -0400 Subject: [PATCH 062/271] Fix lagi_thes unit tests on Windows The thes file was using \r\n line ends, and \r was not stripped, causing the encoding string has a \r at its end. Use binary mode and always use \n as line ends. --- tests/tests/thesaurus.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/tests/thesaurus.cpp b/tests/tests/thesaurus.cpp index 0a003a002..5fa1d878b 100644 --- a/tests/tests/thesaurus.cpp +++ b/tests/tests/thesaurus.cpp @@ -26,13 +26,14 @@ protected: std::string dat_path; void SetUp() override { - using std::endl; + // Use '\n' on all platforms, as we are mapping the file to memory as binary data, and readline can only handle '\n' + const char endl = '\n'; idx_path = "data/thes.idx"; dat_path = "data/thes.dat"; - std::ofstream idx(idx_path.c_str()); - std::ofstream dat(dat_path.c_str()); + std::ofstream idx(idx_path.c_str(), std::ios_base::binary); + std::ofstream dat(dat_path.c_str(), std::ios_base::binary); idx << "UTF-8" << endl; dat << "UTF-8" << endl; From 6d4dd60ce8c52251435bd1a8c0f0cef989833c38 Mon Sep 17 00:00:00 2001 From: wangqr Date: Sun, 22 Sep 2019 15:12:18 -0400 Subject: [PATCH 063/271] Handle video flip and rotate metadata in ffms2 Fix Aegisub/Aegisub#149 --- src/video_provider_ffmpegsource.cpp | 56 +++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/video_provider_ffmpegsource.cpp b/src/video_provider_ffmpegsource.cpp index fbef16d79..fca6d15ec 100644 --- a/src/video_provider_ffmpegsource.cpp +++ b/src/video_provider_ffmpegsource.cpp @@ -103,9 +103,17 @@ public: } int GetFrameCount() const override { return VideoInfo->NumFrames; } + +#if FFMS_VERSION >= ((2 << 24) | (24 << 16) | (0 << 8) | 0) + int GetWidth() const override { return (VideoInfo->Rotation % 180 == 90 || VideoInfo->Rotation % 180 == -90) ? Height : Width; } + int GetHeight() const override { return (VideoInfo->Rotation % 180 == 90 || VideoInfo->Rotation % 180 == -90) ? Width : Height; } + double GetDAR() const override { return (VideoInfo->Rotation % 180 == 90 || VideoInfo->Rotation % 180 == -90) ? 1 / DAR : DAR; } +#else int GetWidth() const override { return Width; } int GetHeight() const override { return Height; } double GetDAR() const override { return DAR; } +#endif + agi::vfr::Framerate GetFPS() const override { return Timecodes; } std::string GetColorSpace() const override { return ColorSpace; } std::string GetRealColorSpace() const override { return RealColorSpace; } @@ -318,6 +326,54 @@ void FFmpegSourceVideoProvider::GetFrame(int n, VideoFrame &out) { out.width = Width; out.height = Height; out.pitch = frame->Linesize[0]; +#if FFMS_VERSION >= ((2 << 24) | (31 << 16) | (0 << 8) | 0) + // Handle flip + if (VideoInfo->Flip > 0) + for (int x = 0; x < Height; ++x) + for (int y = 0; y < Width / 2; ++y) + for (int ch = 0; ch < 4; ++ch) + std::swap(out.data[frame->Linesize[0] * x + 4 * y + ch], out.data[frame->Linesize[0] * x + 4 * (Width - 1 - y) + ch]); + + else if (VideoInfo->Flip < 0) + for (int x = 0; x < Height / 2; ++x) + for (int y = 0; y < Width; ++y) + for (int ch = 0; ch < 4; ++ch) + std::swap(out.data[frame->Linesize[0] * x + 4 * y + ch], out.data[frame->Linesize[0] * (Height - 1 - x) + 4 * y + ch]); +#endif +#if FFMS_VERSION >= ((2 << 24) | (24 << 16) | (0 << 8) | 0) + // Handle rotation + if (VideoInfo->Rotation % 360 == 180 || VideoInfo->Rotation % 360 == -180) { + std::vector data(std::move(out.data)); + out.data.resize(Width * Height * 4); + for (int x = 0; x < Height; ++x) + for (int y = 0; y < Width; ++y) + for (int ch = 0; ch < 4; ++ch) + out.data[4 * (Width * x + y) + ch] = data[frame->Linesize[0] * (Height - 1 - x) + 4 * (Width - 1 - y) + ch]; + out.pitch = 4 * Width; + } + else if (VideoInfo->Rotation % 180 == 90 || VideoInfo->Rotation % 360 == -270) { + std::vector data(std::move(out.data)); + out.data.resize(Width * Height * 4); + for (int x = 0; x < Width; ++x) + for (int y = 0; y < Height; ++y) + for (int ch = 0; ch < 4; ++ch) + out.data[4 * (Height * x + y) + ch] = data[frame->Linesize[0] * y + 4 * (Width - 1 - x) + ch]; + out.width = Height; + out.height = Width; + out.pitch = 4 * Height; + } + else if (VideoInfo->Rotation % 180 == 270 || VideoInfo->Rotation % 360 == -90) { + std::vector data(std::move(out.data)); + out.data.resize(Width * Height * 4); + for (int x = 0; x < Width; ++x) + for (int y = 0; y < Height; ++y) + for (int ch = 0; ch < 4; ++ch) + out.data[4 * (Height * x + y) + ch] = data[frame->Linesize[0] * (Height - 1 - y) + 4 * x + ch]; + out.width = Height; + out.height = Width; + out.pitch = 4 * Height; + } +#endif } } From e1a8ab1c10ac106ba57fb5c468e71418bb86e5dc Mon Sep 17 00:00:00 2001 From: wangqr Date: Mon, 23 Sep 2019 11:54:06 -0400 Subject: [PATCH 064/271] fix: infinite recursion when loading video In 888be0607fdfc2ed7801fd67f46ab4f98257d419 some changes have been made to video_display.cpp which causes infinite recursion: the video display enables video/tool/cross tool when running VideoDisplay::Render() for the first time. But when setting up the tool, the video box size is changed, which calls VideoDisplay::Render() again. So we need to set the tool BEFORE it modifies the box by "AddSeparator". Fix wangqr/Aegisub#21 Co-authored-by: Charlie Jiang --- src/video_display.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/video_display.cpp b/src/video_display.cpp index 3a5c2d40d..7764a2bd9 100644 --- a/src/video_display.cpp +++ b/src/video_display.cpp @@ -409,12 +409,14 @@ void VideoDisplay::SetZoomFromBoxText(wxCommandEvent &) { } void VideoDisplay::SetTool(std::unique_ptr new_tool) { + // Set the tool first to prevent repeated initialization from VideoDisplay::Render + tool = std::move(new_tool); + + // Hide the tool bar first to eliminate unecessary size changes + toolBar->Show(false); toolBar->ClearTools(); toolBar->AddSeparator(); toolBar->Realize(); - toolBar->Show(false); - - tool = std::move(new_tool); tool->SetToolbar(toolBar); // Update size as the new typesetting tool may have changed the subtoolbar size From 8d17a0e88a2cf2d6b91db0b13a6a78b1416c6bb0 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 28 Sep 2019 13:53:26 -0700 Subject: [PATCH 065/271] Assume that files which start with a unicode BOM are valid files of that type --- libaegisub/common/charset.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/libaegisub/common/charset.cpp b/libaegisub/common/charset.cpp index 406cbfbd2..774e27da1 100644 --- a/libaegisub/common/charset.cpp +++ b/libaegisub/common/charset.cpp @@ -29,20 +29,28 @@ namespace agi { namespace charset { std::string Detect(agi::fs::path const& file) { agi::read_file_mapping fp(file); + // First check for known magic bytes which identify the file type + if (fp.size() >= 4) { + const char* header = fp.read(0, 4); + if (!strncmp(header, "\xef\xbb\xbf", 3)) + return "utf-8"; + if (!strncmp(header, "\x00\x00\xfe\xff", 4)) + return "utf-32be"; + if (!strncmp(header, "\xff\xfe\x00\x00", 4)) + return "utf-32le"; + if (!strncmp(header, "\xfe\xff", 2)) + return "utf-16be"; + if (!strncmp(header, "\xff\xfe", 2)) + return "utf-16le"; + if (!strncmp(header, "\x1a\x45\xdf\xa3", 4)) + return "binary"; // Actually EBML/Matroska + } + // If it's over 100 MB it's either binary or big enough that we won't // be able to do anything useful with it anyway if (fp.size() > 100 * 1024 * 1024) return "binary"; - - // FIXME: Dirty hack for Matroska. These 4 bytes are the magic - // number of EBML which is used by mkv and webm - if (fp.size() >= 4) { - const char* buf = fp.read(0, 4); - if (!strncmp(buf, "\x1a\x45\xdf\xa3", 4)) - return "binary"; - } - uint64_t binaryish = 0; #ifdef WITH_UCHARDET From 6ca879938de45ad1455f047fd6b52500e7610e7d Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 28 Sep 2019 13:56:56 -0700 Subject: [PATCH 066/271] Always feed the entire file into uchardet when detection is needed uchardet will report that a file is "ascii" if the first page has no bytes >127, so we need to actually look at the entire file in case the first higher byte is later in the file. --- libaegisub/common/charset.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libaegisub/common/charset.cpp b/libaegisub/common/charset.cpp index 774e27da1..81008538b 100644 --- a/libaegisub/common/charset.cpp +++ b/libaegisub/common/charset.cpp @@ -59,9 +59,6 @@ std::string Detect(agi::fs::path const& file) { auto read = std::min(4096, fp.size() - offset); auto buf = fp.read(offset, read); uchardet_handle_data(ud, buf, read); - uchardet_data_end(ud); - if (*uchardet_get_charset(ud)) - return uchardet_get_charset(ud); offset += read; @@ -74,6 +71,7 @@ std::string Detect(agi::fs::path const& file) { if (binaryish > offset / 8) return "binary"; } + uchardet_data_end(ud); return uchardet_get_charset(ud); #else auto read = std::min(4096, fp.size()); From 5da48d0f3098050973c663542fdf6bb5e99a9f40 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 28 Sep 2019 14:23:17 -0700 Subject: [PATCH 067/271] Don't call Realize() before setting the toolbar --- src/video_display.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/video_display.cpp b/src/video_display.cpp index 7764a2bd9..3579c194e 100644 --- a/src/video_display.cpp +++ b/src/video_display.cpp @@ -416,7 +416,6 @@ void VideoDisplay::SetTool(std::unique_ptr new_tool) { toolBar->Show(false); toolBar->ClearTools(); toolBar->AddSeparator(); - toolBar->Realize(); tool->SetToolbar(toolBar); // Update size as the new typesetting tool may have changed the subtoolbar size From 85f711fccc75f01fd44f25537b8777df10c4b3d1 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 28 Sep 2019 14:24:07 -0700 Subject: [PATCH 068/271] Adjust the index of the drag subtool button for the addition of the separator --- src/visual_tool_drag.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/visual_tool_drag.cpp b/src/visual_tool_drag.cpp index 9d8aa6594..63daa498d 100644 --- a/src/visual_tool_drag.cpp +++ b/src/visual_tool_drag.cpp @@ -71,7 +71,7 @@ void VisualToolDrag::UpdateToggleButtons() { if (to_move == button_is_move) return; - toolbar->SetToolNormalBitmap(toolbar->GetToolByPos(0)->GetId(), + toolbar->SetToolNormalBitmap(toolbar->GetToolByPos(1)->GetId(), to_move ? ICON(visual_move_conv_move) : ICON(visual_move_conv_pos)); button_is_move = to_move; } From 6f546951b4f004da16ce19ba638bf3eedefb9f31 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 6 Oct 2019 12:45:03 -0700 Subject: [PATCH 069/271] Use appropriate DPI images in more places on macOS --- src/command/command.h | 14 +++++++------- src/libresrc/libresrc.cpp | 6 +++--- src/libresrc/libresrc.h | 4 ++-- src/subs_edit_box.cpp | 7 +++++-- src/subs_edit_box.h | 3 +++ src/toolbar.cpp | 11 ++++++++--- 6 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/command/command.h b/src/command/command.h index 38ea38f8a..08752adbe 100644 --- a/src/command/command.h +++ b/src/command/command.h @@ -34,12 +34,12 @@ namespace agi { struct Context; } #define STR_HELP(a) wxString StrHelp() const override { return _(a); } #define CMD_TYPE(a) int Type() const override { using namespace cmd; return a; } -#define CMD_ICON(icon) wxBitmap Icon(int size, wxLayoutDirection dir = wxLayout_LeftToRight) const override { \ - if (size == 64) return GETIMAGEDIR(icon##_64, dir); \ - if (size == 48) return GETIMAGEDIR(icon##_48, dir); \ - if (size == 32) return GETIMAGEDIR(icon##_32, dir); \ - if (size == 24) return GETIMAGEDIR(icon##_24, dir); \ - return GETIMAGEDIR(icon##_16, dir); \ +#define CMD_ICON(icon) wxBitmap Icon(int size, double scale = 1.0, wxLayoutDirection dir = wxLayout_LeftToRight) const override { \ + if (size * scale >= 64) return GETIMAGEDIR(icon##_64, scale, dir); \ + if (size * scale >= 48) return GETIMAGEDIR(icon##_48, scale, dir); \ + if (size * scale >= 32) return GETIMAGEDIR(icon##_32, scale, dir); \ + if (size * scale >= 24) return GETIMAGEDIR(icon##_24, scale, dir); \ + return GETIMAGEDIR(icon##_16, scale, dir); \ } #define COMMAND_GROUP(cname, cmdname, menu, disp, help) \ @@ -107,7 +107,7 @@ DEFINE_EXCEPTION(CommandNotFound, CommandError); /// Request icon. /// @param size Icon size. - virtual wxBitmap Icon(int size, wxLayoutDirection = wxLayout_LeftToRight) const { return wxBitmap{}; } + virtual wxBitmap Icon(int size, double scale = 1.0, wxLayoutDirection = wxLayout_LeftToRight) const { return wxBitmap{}; } /// Command function virtual void operator()(agi::Context *c)=0; diff --git a/src/libresrc/libresrc.cpp b/src/libresrc/libresrc.cpp index cb204ecb2..79dc0f16c 100644 --- a/src/libresrc/libresrc.cpp +++ b/src/libresrc/libresrc.cpp @@ -20,11 +20,11 @@ #include #include -wxBitmap libresrc_getimage(const unsigned char *buff, size_t size, int dir) { +wxBitmap libresrc_getimage(const unsigned char *buff, size_t size, double scale, int dir) { wxMemoryInputStream mem(buff, size); if (dir != wxLayout_RightToLeft) - return wxBitmap(wxImage(mem)); - return wxBitmap(wxImage(mem).Mirror()); + return wxBitmap(wxImage(mem), -1, scale); + return wxBitmap(wxImage(mem).Mirror(), -1, scale); } wxIcon libresrc_geticon(const unsigned char *buff, size_t size) { diff --git a/src/libresrc/libresrc.h b/src/libresrc/libresrc.h index 020b8ccd8..ce3977c4a 100644 --- a/src/libresrc/libresrc.h +++ b/src/libresrc/libresrc.h @@ -21,10 +21,10 @@ class wxBitmap; class wxIcon; -wxBitmap libresrc_getimage(const unsigned char *image, size_t size, int dir=0); +wxBitmap libresrc_getimage(const unsigned char *image, size_t size, double scale=1.0, int dir=0); wxIcon libresrc_geticon(const unsigned char *image, size_t size); #define GETIMAGE(a) libresrc_getimage(a, sizeof(a)) -#define GETIMAGEDIR(a, d) libresrc_getimage(a, sizeof(a), d) +#define GETIMAGEDIR(a, s, d) libresrc_getimage(a, sizeof(a), s, d) #define GETICON(a) libresrc_geticon(a, sizeof(a)) #define GET_DEFAULT_CONFIG(a) std::make_pair(reinterpret_cast(a), sizeof(a)) diff --git a/src/subs_edit_box.cpp b/src/subs_edit_box.cpp index ca08b4177..fffb62384 100644 --- a/src/subs_edit_box.cpp +++ b/src/subs_edit_box.cpp @@ -45,8 +45,9 @@ #include "include/aegisub/hotkey.h" #include "initial_line_state.h" #include "options.h" -#include "project.h" #include "placeholder_ctrl.h" +#include "project.h" +#include "retina_helper.h" #include "selection_controller.h" #include "subs_edit_ctrl.h" #include "text_selection_controller.h" @@ -56,6 +57,7 @@ #include "validators.h" #include +#include #include #include @@ -105,6 +107,7 @@ const auto AssDialogue_Effect = &AssDialogue::Effect; SubsEditBox::SubsEditBox(wxWindow *parent, agi::Context *context) : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxRAISED_BORDER, "SubsEditBox") , c(context) +, retina_helper(agi::make_unique(parent)) , undo_timer(GetEventHandler()) { using std::bind; @@ -273,7 +276,7 @@ TimeEdit *SubsEditBox::MakeTimeCtrl(wxString const& tooltip, TimeField field) { void SubsEditBox::MakeButton(const char *cmd_name) { cmd::Command *command = cmd::get(cmd_name); - wxBitmapButton *btn = new wxBitmapButton(this, -1, command->Icon(16)); + wxBitmapButton *btn = new wxBitmapButton(this, -1, command->Icon(16, retina_helper->GetScaleFactor())); ToolTipManager::Bind(btn, command->StrHelp(), "Subtitle Edit Box", cmd_name); middle_right_sizer->Add(btn, wxSizerFlags().Expand()); diff --git a/src/subs_edit_box.h b/src/subs_edit_box.h index 3cf9497e1..0443adbdc 100644 --- a/src/subs_edit_box.h +++ b/src/subs_edit_box.h @@ -43,6 +43,7 @@ namespace agi { struct Context; } namespace agi { class Time; } class AssDialogue; class AssStyle; +class RetinaHelper; class SubsTextEditCtrl; class TimeEdit; class wxButton; @@ -103,6 +104,8 @@ class SubsEditBox final : public wxPanel { wxSizer *middle_left_sizer; wxSizer *bottom_sizer; + std::unique_ptr retina_helper; + void SetControlsState(bool state); /// @brief Update times of selected lines /// @param field Field which changed diff --git a/src/toolbar.cpp b/src/toolbar.cpp index 5718b19d5..40c0a7769 100644 --- a/src/toolbar.cpp +++ b/src/toolbar.cpp @@ -68,6 +68,9 @@ namespace { /// Listener for icon size change signal agi::signal::Connection icon_size_slot; + /// Listener for scale factor change signal + agi::signal::Connection scale_factor_slot; + /// Listener for hotkey change signal agi::signal::Connection hotkeys_changed_slot; @@ -139,7 +142,7 @@ namespace { flags & cmd::COMMAND_TOGGLE ? wxITEM_CHECK : wxITEM_NORMAL; - wxBitmap const& bitmap = command->Icon(icon_size, GetLayoutDirection()); + wxBitmap const& bitmap = command->Icon(icon_size, retina_helper.GetScaleFactor(), GetLayoutDirection()); AddTool(TOOL_ID_BASE + commands.size(), command->StrDisplay(context), bitmap, GetTooltip(command), kind); commands.push_back(command); @@ -173,6 +176,9 @@ namespace { , retina_helper(parent) , icon_size(OPT_GET("App/Toolbar Icon Size")->GetInt()) , icon_size_slot(OPT_SUB("App/Toolbar Icon Size", &Toolbar::OnIconSizeChange, this)) + , scale_factor_slot(retina_helper.AddScaleFactorListener([=](double scale) { + RegenerateToolbar(); + })) , hotkeys_changed_slot(hotkey::inst->AddHotkeyChangeListener(&Toolbar::RegenerateToolbar, this)) { Populate(); @@ -189,9 +195,8 @@ namespace { , icon_size(OPT_GET("App/Toolbar Icon Size")->GetInt()) , icon_size_slot(OPT_SUB("App/Toolbar Icon Size", &Toolbar::OnIconSizeChange, this)) #else - , icon_size(32 * retina_helper.GetScaleFactor()) + , icon_size(32) , icon_size_slot(retina_helper.AddScaleFactorListener([=](double scale) { - icon_size = 32 * retina_helper.GetScaleFactor(); RegenerateToolbar(); })) #endif From 8905921a2de0042a36de9493b83bbe315b0fb932 Mon Sep 17 00:00:00 2001 From: Martin Herkt Date: Wed, 15 Nov 2017 17:25:11 +0100 Subject: [PATCH 070/271] Initial port of the build system to Meson Still some TODOs left. Probably only works on Linux for now. --- build/meson.build | 5 + libaegisub/include/lagi_pre.h | 1 + libaegisub/meson.build | 88 +++++++++++++ meson.build | 147 +++++++++++++++++++++ meson_options.txt | 21 +++ src/include/agi_pre.h | 1 + src/libresrc/meson.build | 28 ++++ src/meson.build | 202 +++++++++++++++++++++++++++++ subprojects/luajit | 1 + vendor/luabins/src/meson.build | 11 ++ vendor/luajit/meson.build | 42 ++++++ vendor/luajit/src/host/meson.build | 50 +++++++ vendor/luajit/src/meson.build | 95 ++++++++++++++ 13 files changed, 692 insertions(+) create mode 100644 build/meson.build create mode 120000 libaegisub/include/lagi_pre.h create mode 100644 libaegisub/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt create mode 120000 src/include/agi_pre.h create mode 100644 src/libresrc/meson.build create mode 100644 src/meson.build create mode 120000 subprojects/luajit create mode 100644 vendor/luabins/src/meson.build create mode 100644 vendor/luajit/meson.build create mode 100644 vendor/luajit/src/host/meson.build create mode 100644 vendor/luajit/src/meson.build diff --git a/build/meson.build b/build/meson.build new file mode 100644 index 000000000..c0cdd8122 --- /dev/null +++ b/build/meson.build @@ -0,0 +1,5 @@ +version_sh = find_program('./version.sh') +version_inc = include_directories('.') +version_h = custom_target('git_version.h', + command : [version_sh, meson.source_root()], + output : ['git_version.h', 'git_version.xml']) diff --git a/libaegisub/include/lagi_pre.h b/libaegisub/include/lagi_pre.h new file mode 120000 index 000000000..13ed6ac57 --- /dev/null +++ b/libaegisub/include/lagi_pre.h @@ -0,0 +1 @@ +../lagi_pre.h \ No newline at end of file diff --git a/libaegisub/meson.build b/libaegisub/meson.build new file mode 100644 index 000000000..1752ff688 --- /dev/null +++ b/libaegisub/meson.build @@ -0,0 +1,88 @@ +libaegisub_src = [ + 'ass/dialogue_parser.cpp', + 'ass/time.cpp', + 'ass/uuencode.cpp', + + 'audio/provider_convert.cpp', + 'audio/provider.cpp', + 'audio/provider_dummy.cpp', + 'audio/provider_hd.cpp', + 'audio/provider_lock.cpp', + 'audio/provider_pcm.cpp', + 'audio/provider_ram.cpp', + + 'common/calltip_provider.cpp', + 'common/character_count.cpp', + 'common/charset_6937.cpp', + 'common/charset_conv.cpp', + 'common/charset.cpp', + 'common/color.cpp', + 'common/file_mapping.cpp', + 'common/format.cpp', + 'common/fs.cpp', + 'common/hotkey.cpp', + 'common/io.cpp', + 'common/json.cpp', + 'common/kana_table.cpp', + 'common/karaoke_matcher.cpp', + 'common/keyframe.cpp', + 'common/line_iterator.cpp', + 'common/log.cpp', + 'common/mru.cpp', + 'common/option.cpp', + 'common/option_value.cpp', + 'common/parser.cpp', + 'common/path.cpp', + 'common/thesaurus.cpp', + 'common/util.cpp', + 'common/vfr.cpp', + 'common/ycbcr_conv.cpp', + 'common/cajun/elements.cpp', + 'common/cajun/reader.cpp', + 'common/cajun/writer.cpp', + + 'lua/modules.cpp', + 'lua/script_reader.cpp', + 'lua/utils.cpp', + 'lua/modules/lfs.cpp', + 'lua/modules/re.cpp', + 'lua/modules/unicode.cpp', + 'lua/modules/lpeg.c', +] + +if host_machine.system() == 'darwin' + libaegisub_src += [ + 'osx/dispatch.mm', + 'osx/spellchecker.mm', + 'osx/util.mm', + ] +else + libaegisub_src += 'common/dispatch.cpp' + if host_machine.system() == 'windows' + libaegisub_src += [ + 'windows/access.cpp', + 'windows/charset_conv_win.cpp', + 'windows/fs.cpp', + 'windows/lagi_pre.cpp', + 'windows/log_win.cpp', + 'windows/path_win.cpp', + 'windows/util_win.cpp', + ] + else + libaegisub_src += [ + 'unix/access.cpp', + 'unix/fs.cpp', + 'unix/log.cpp', + 'unix/path.cpp', + 'unix/util.cpp', + ] + endif +endif + +libaegisub_cpp_pch = ['lagi_pre.h'] +libaegisub_inc = include_directories('include') + +libaegisub = static_library('aegisub', libaegisub_src, acconf, + include_directories : libaegisub_inc, + cpp_pch : 'include/lagi_pre.h', + dependencies : deps) diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..78b4b28f2 --- /dev/null +++ b/meson.build @@ -0,0 +1,147 @@ +project('Aegisub', ['c', 'cpp'], license : 'BSD-3-Clause', + meson_version : '>=0.41.0', + default_options : ['cpp_std=c++11', 'b_lto=true']) + +subdir('build') + +dataroot = join_paths(get_option('prefix'), get_option('datadir'), 'aegisub') +add_project_arguments('-DP_DATA="@0@"'.format(dataroot), language : 'cpp') +b_static = get_option('static') + +conf = configuration_data() +conf.set_quoted('P_DATA', dataroot) +conf.set_quoted('AEGISUB_CATALOG', 'aegisub') +conf.set_quoted('AEGISUB_COMMAND', 'aegisub') +if get_option('build_credit') != '' + conf.set_quoted('BUILD_CREDIT', get_option('build_credit')) +endif +conf.set('WITH_UPDATE_CHECKER', get_option('enable_update_checker')) + +deps = [] + +if host_machine.system() == 'darwin' + add_languages('objc') +else + deps += dependency('fontconfig', static: b_static) +endif + +cxx = meson.get_compiler('cpp') +cc = meson.get_compiler('c') +deps += cc.find_library('m', required : false) +deps += cc.find_library('dl', required : false) +deps += cc.find_library('iconv', required : false) + +deps += dependency('libass', version : '>=0.9.7', static: b_static) +deps += dependency('boost', version : '>=1.50.0', static: b_static, + modules : ['chrono', 'filesystem', 'locale', 'regex', + 'system', 'thread']) +deps += dependency('icu-uc', version : '>=4.8.1.1', static: b_static) +deps += dependency('icu-i18n', version : '>=4.8.1.1', static: b_static) +deps += dependency('zlib', static: b_static) + +dep_avail = [] +foreach dep : [ + # audio, in order of precedence + ['libpulse', '', 'PulseAudio'], + ['alsa', '', 'ALSA'], + ['portaudio-2.0', '', 'PortAudio'], + ['openal', '>=0.0.8', 'OpenAL'], + # video + ['ffms2', '', 'FFMS2'], + # other + ['fftw3', '', 'FFTW3'], + ['hunspell', '', 'Hunspell'], + ['uchardet', '', 'uchardet'], +] + d = dependency(dep[0], version : dep[1] != '' ? dep[1] : '>=0', + required : false, static: b_static) + + optname = 'enable_@0@'.format(dep[0].split('-')[0]) + if d.found() and get_option(optname) != 'false' + deps += d + conf.set('WITH_@0@'.format(dep[0].split('-')[0].to_upper()), '1') + dep_avail += dep[2] + elif get_option(optname) == 'true' + error('@0@ enabled but not found'.format(dep[2])) + endif +endforeach + +# TODO: OSS + +def_audio = get_option('default_audio_output') +if def_audio != 'auto' + if not dep_avail.contains(def_audio) + error('Default audio output "@0@" selected but not available'.format(def_audio)) + endif +elif dep_avail.length() != 0 + def_audio = dep_avail[0] +else + def_audio = '' +endif + +conf_platform = configuration_data() +conf_platform.set('DEFAULT_PLAYER_AUDIO', def_audio) + +luajit = dependency('luajit', version : '>=2.0.0', required : get_option('system_luajit')) +if luajit.found() + luajit_test = cc.run('''#include +int main(void) +{ + lua_State *L = luaL_newstate(); + if (!L) return 1; + // This is valid in lua 5.2, but a syntax error in 5.1 + const char testprogram[] = "function foo() while true do break return end end"; + return luaL_loadstring(L, testprogram) == LUA_ERRSYNTAX; +}''', dependencies : luajit) + + if luajit_test.returncode() == 1 + if get_option('system_luajit') + error('System luajit found but not compiled in 5.2 mode') + else + message('System luajit found but not compiled in 5.2 mode; using built-in luajit') + endif + else + deps += luajit + endif +else + message('System luajit not found; using built-in luajit') +endif + +lua_names = ['lua', 'luajit', 'lua5.3', 'lua5.2', 'lua-5.2', 'lua5.1', 'lua-5.1'] +if not deps.contains(luajit) + luajit_sp = subproject('luajit') + luajit_inc = luajit_sp.get_variable('incdir') + deps += luajit_sp.get_variable('luajit_dep') + lua_names += luajit_sp.get_variable('minilua').full_path() +else + luajit_inc = include_directories(luajit.get_pkgconfig_variable('includedir')) +endif +lua = find_program(lua_names, native : true) +subdir('vendor/luabins/src') + +deps += dependency('wxWidgets', version : '>=3.0.0', + modules : ['std', 'stc', 'gl']) + +dep_gl = dependency('gl', required : false) +if not dep_gl.found() + if host_machine.system() == 'windows' + dep_gl = cc.find_library('opengl32', required : false) + else + dep_gl = cc.find_library('GL', required : false) + endif + + if not cc.has_header('GL/gl.h') + dep_gl = dependency('', required : false) + endif +endif + +if not dep_gl.found() + error('OpenGL implementation not found') +endif + +deps += dep_gl + +acconf = configure_file(output : 'acconf.h', configuration : conf) + +subdir('libaegisub') +subdir('src') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 000000000..690d080c1 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,21 @@ +option('static', type : 'boolean', value : false, description : 'Build statically linked executable') + +option('enable_alsa', type : 'combo', choices : ['auto', 'true', 'false'], description : 'ALSA audio output') +option('enable_openal', type : 'combo', choices : ['auto', 'true', 'false'], description : 'OpenAL audio output') +option('enable_libpulse', type : 'combo', choices : ['auto', 'true', 'false'], description : 'PulseAudio audio output') +option('enable_portaudio', type : 'combo', choices : ['auto', 'true', 'false'], description : 'PortAudio audio output') +option('default_audio_output', type : 'combo', choices : ['auto', 'ALSA', 'OpenAL', 'PulseAudio', 'PortAudio'], description : 'Default audio output') + +option('enable_ffms2', type : 'combo', choices : ['auto', 'true', 'false'], description : 'FFMS2 video source') + +option('enable_fftw3', type : 'combo', choices : ['auto', 'true', 'false'], description : 'FFTW3 support') +option('enable_hunspell', type : 'combo', choices : ['auto', 'true', 'false'], description : 'Hunspell spell checker') +option('enable_uchardet', type : 'combo', choices : ['auto', 'true', 'false'], description : 'uchardet character encoding detection') + +option('system_luajit', type : 'boolean', value : false, description : 'Force using system luajit') + +option('build_credit', type : 'string', value : '', description : 'Build credit shown in program title') + +option('enable_update_checker', type : 'boolean', value : false, description : 'Enable the update checker') +option('update_server', type : 'string', value : 'updates.aegisub.org', description : 'Server to use for the update checker') +option('update_url', type : 'string', value : '/trunk', description : 'Base path to use for the update checker') diff --git a/src/include/agi_pre.h b/src/include/agi_pre.h new file mode 120000 index 000000000..7b2f4b2e2 --- /dev/null +++ b/src/include/agi_pre.h @@ -0,0 +1 @@ +../agi_pre.h \ No newline at end of file diff --git a/src/libresrc/meson.build b/src/libresrc/meson.build new file mode 100644 index 000000000..b9c5fc906 --- /dev/null +++ b/src/libresrc/meson.build @@ -0,0 +1,28 @@ +respack = [lua, files('../../tools/respack.lua')] + +resrc = [ + custom_target('bitmap.{cpp,h}', + command : respack + ['@INPUT@', '@OUTPUT@'], + input : files('../bitmaps/manifest.respack'), + output : ['bitmap.cpp', 'bitmap.h']) +] + +conf_platform_json = configure_file(input: 'default_config_platform.json.in', + output : '@BASENAME@', + configuration : conf_platform) + +if host_machine.system() == 'darwin' + resrc += custom_target('default_config.{cpp,h}', + command : respack + ['@INPUT0@', '@OUTPUT@'], + input : [files('manifest_osx.respack'), conf_platform_json], + output : ['default_config.cpp', 'default_config.h']) +else + resrc += custom_target('default_config.{cpp,h}', + command : respack + ['@INPUT0@', '@OUTPUT@'], + input : [files('manifest.respack'), conf_platform_json], + output : ['default_config.cpp', 'default_config.h']) +endif + + +libresrc_inc = include_directories('.') +libresrc = static_library('resrc', 'libresrc.cpp', resrc, dependencies : deps) diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 000000000..6a6091f18 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,202 @@ +subdir('libresrc') + +aegisub_src = files( + 'MatroskaParser.c', + 'aegisublocale.cpp', + 'ass_attachment.cpp', + 'ass_dialogue.cpp', + 'ass_entry.cpp', + 'ass_export_filter.cpp', + 'ass_exporter.cpp', + 'ass_file.cpp', + 'ass_karaoke.cpp', + 'ass_override.cpp', + 'ass_parser.cpp', + 'ass_style.cpp', + 'ass_style_storage.cpp', + 'async_video_provider.cpp', + 'audio_box.cpp', + 'audio_colorscheme.cpp', + 'audio_controller.cpp', + 'audio_display.cpp', + 'audio_karaoke.cpp', + 'audio_marker.cpp', + 'audio_player.cpp', + 'audio_provider_factory.cpp', + 'audio_renderer.cpp', + 'audio_renderer_spectrum.cpp', + 'audio_renderer_waveform.cpp', + 'audio_timing_dialogue.cpp', + 'audio_timing_karaoke.cpp', + 'auto4_base.cpp', + 'auto4_lua.cpp', + 'auto4_lua_assfile.cpp', + 'auto4_lua_dialog.cpp', + 'auto4_lua_progresssink.cpp', + 'avisynth_wrap.cpp', + 'base_grid.cpp', + 'charset_detect.cpp', + 'colorspace.cpp', + 'colour_button.cpp', + 'command/app.cpp', + 'command/audio.cpp', + 'command/automation.cpp', + 'command/command.cpp', + 'command/edit.cpp', + 'command/grid.cpp', + 'command/help.cpp', + 'command/keyframe.cpp', + 'command/recent.cpp', + 'command/subtitle.cpp', + 'command/time.cpp', + 'command/timecode.cpp', + 'command/tool.cpp', + 'command/video.cpp', + 'command/vis_tool.cpp', + 'compat.cpp', + 'context.cpp', + 'crash_writer.cpp', + 'dialog_about.cpp', + 'dialog_attachments.cpp', + 'dialog_automation.cpp', + 'dialog_autosave.cpp', + 'dialog_colorpicker.cpp', + 'dialog_detached_video.cpp', + 'dialog_dummy_video.cpp', + 'dialog_export.cpp', + 'dialog_export_ebu3264.cpp', + 'dialog_fonts_collector.cpp', + 'dialog_jumpto.cpp', + 'dialog_kara_timing_copy.cpp', + 'dialog_log.cpp', + 'dialog_paste_over.cpp', + 'dialog_progress.cpp', + 'dialog_properties.cpp', + 'dialog_resample.cpp', + 'dialog_search_replace.cpp', + 'dialog_selected_choices.cpp', + 'dialog_selection.cpp', + 'dialog_shift_times.cpp', + 'dialog_spellchecker.cpp', + 'dialog_style_editor.cpp', + 'dialog_style_manager.cpp', + 'dialog_styling_assistant.cpp', + 'dialog_text_import.cpp', + 'dialog_timing_processor.cpp', + 'dialog_translation.cpp', + 'dialog_version_check.cpp', + 'dialog_video_details.cpp', + 'dialog_video_properties.cpp', + 'export_fixstyle.cpp', + 'export_framerate.cpp', + 'fft.cpp', + 'font_file_lister.cpp', + 'frame_main.cpp', + 'gl_text.cpp', + 'gl_wrap.cpp', + 'grid_column.cpp', + 'help_button.cpp', + 'hotkey.cpp', + 'hotkey_data_view_model.cpp', + 'initial_line_state.cpp', + 'main.cpp', + 'menu.cpp', + 'mkv_wrap.cpp', + 'pen.cpp', + 'persist_location.cpp', + 'preferences.cpp', + 'preferences_base.cpp', + 'project.cpp', + 'resolution_resampler.cpp', + 'search_replace_engine.cpp', + 'selection_controller.cpp', + 'spellchecker.cpp', + 'spline.cpp', + 'spline_curve.cpp', + 'string_codec.cpp', + 'subs_controller.cpp', + 'subs_edit_box.cpp', + 'subs_edit_ctrl.cpp', + 'subs_preview.cpp', + 'subtitle_format.cpp', + 'subtitle_format_ass.cpp', + 'subtitle_format_ebu3264.cpp', + 'subtitle_format_encore.cpp', + 'subtitle_format_microdvd.cpp', + 'subtitle_format_mkv.cpp', + 'subtitle_format_srt.cpp', + 'subtitle_format_ssa.cpp', + 'subtitle_format_transtation.cpp', + 'subtitle_format_ttxt.cpp', + 'subtitle_format_txt.cpp', + 'subtitles_provider.cpp', + 'subtitles_provider_libass.cpp', + 'text_file_reader.cpp', + 'text_file_writer.cpp', + 'text_selection_controller.cpp', + 'thesaurus.cpp', + 'timeedit_ctrl.cpp', + 'toggle_bitmap.cpp', + 'toolbar.cpp', + 'tooltip_manager.cpp', + 'utils.cpp', + 'validators.cpp', + 'vector2d.cpp', + 'version.cpp', + 'video_box.cpp', + 'video_controller.cpp', + 'video_display.cpp', + 'video_frame.cpp', + 'video_out_gl.cpp', + 'video_provider_cache.cpp', + 'video_provider_dummy.cpp', + 'video_provider_manager.cpp', + 'video_provider_yuv4mpeg.cpp', + 'video_slider.cpp', + 'visual_feature.cpp', + 'visual_tool.cpp', + 'visual_tool_clip.cpp', + 'visual_tool_cross.cpp', + 'visual_tool_drag.cpp', + 'visual_tool_rotatexy.cpp', + 'visual_tool_rotatez.cpp', + 'visual_tool_scale.cpp', + 'visual_tool_vector_clip.cpp', +) + +if host_machine.system() == 'darwin' + aegisub_src += [ + 'font_file_lister_coretext.mm', + 'osx/osx_utils.mm', + 'osx/retina_helper.mm', + 'osx/scintilla_ime.mm', + ] +else + aegisub_src += 'font_file_lister_fontconfig.cpp' +endif + +opt_src = [ + ['ALSA', 'audio_player_alsa.cpp'], + ['PortAudio', 'audio_player_portaudio.cpp'], + ['PulseAudio', 'audio_player_pulse.cpp'], + ['OpenAL', 'audio_player_openal.cpp'], + ['OSS', 'audio_player_oss.cpp'], + + ['FFMS2', ['audio_provider_ffmpegsource.cpp', + 'video_provider_ffmpegsource.cpp', + 'ffmpegsource_common.cpp']], + + ['Hunspell', 'spellchecker_hunspell.cpp'], +] + +foreach opt : opt_src + if dep_avail.contains(opt[0]) + aegisub_src += opt[1] + endif +endforeach + +aegisub = executable('aegisub', aegisub_src, version_h, acconf, + link_with : [libresrc, libluabins, libaegisub], + include_directories : [libaegisub_inc, libresrc_inc, version_inc], + cpp_pch : 'include/agi_pre.h', + dependencies : deps) diff --git a/subprojects/luajit b/subprojects/luajit new file mode 120000 index 000000000..cf99205fa --- /dev/null +++ b/subprojects/luajit @@ -0,0 +1 @@ +../vendor/luajit \ No newline at end of file diff --git a/vendor/luabins/src/meson.build b/vendor/luabins/src/meson.build new file mode 100644 index 000000000..d785e3ba5 --- /dev/null +++ b/vendor/luabins/src/meson.build @@ -0,0 +1,11 @@ +luabins_src = files( + 'fwrite.c', + 'load.c', + 'luabins.c', + 'luainternals.c', + 'savebuffer.c', + 'save.c', + 'write.c', +) + +libluabins = static_library('luabins', luabins_src, include_directories : luajit_inc) diff --git a/vendor/luajit/meson.build b/vendor/luajit/meson.build new file mode 100644 index 000000000..9338096ce --- /dev/null +++ b/vendor/luajit/meson.build @@ -0,0 +1,42 @@ +project('luajit', 'c', version : '2.0.4', license : 'MIT') + +cc = meson.get_compiler('c') + +system_deps = [ + cc.find_library('dl', required : false), + cc.find_library('m', required : false) +] + +system_deps_native = [ + cc.find_library('dl', required : false, native : true), + cc.find_library('m', required : false, native : true) +] + +add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', language : 'c') +if host_machine.system() == 'linux' + add_project_arguments('-DLUAJIT_USE_LINUX', language : 'c') + readline_dep = cc.find_library('readline') + ljvm_mode = 'elfasm' + ljvm_bout = 'lj_vm.s' +elif host_machine.system() == 'darwin' + add_project_arguments(['-DLUAJIT_USE_MACOSX'], language : 'c') + readline_dep = cc.find_library('readline') + ljvm_mode = 'machasm' + ljvm_bout = 'lj_vm.s' +elif host_machine.system() == 'windows' + add_project_arguments('-DLUAJIT_USE_WINDOWS', '-DWIN', + '-malign-double', language : 'c') + readline_dep = [] + ljvm_mode = 'peobj' + ljvm_bout = 'lj_vm.o' +else + readline_dep = [] + error('Unsupported platform') +endif + +incdir = include_directories('include') + +subdir('src') + +luajit_dep = declare_dependency(link_with : luajit_lib, + include_directories : incdir) diff --git a/vendor/luajit/src/host/meson.build b/vendor/luajit/src/host/meson.build new file mode 100644 index 000000000..2e43a8e5c --- /dev/null +++ b/vendor/luajit/src/host/meson.build @@ -0,0 +1,50 @@ +minilua = executable('minilua', 'minilua.c', + dependencies : system_deps_native, + native : true) + +if host_machine.cpu_family() == 'x86_64' + dynasm_arch = 'x86' +else + dynasm_arch = host_machine.cpu_family() +endif + +dynasm_dasc = files('../vm_@0@.dasc'.format(dynasm_arch)) +dasm = [minilua, files('../../dynasm/dynasm.lua')] + +# BUG: meson does not resolve paths correctly for subprojects +hpre = '#include "@0@/../lj_arch.h"'.format(meson.current_source_dir()) + +checkdefs = [ + ['LJ_ARCH_BITS', '64', ['-D', 'P64']], + ['LJ_HASJIT', '1', ['-D', 'JIT']], + ['LJ_HASFFI', '1', ['-D', 'FFI']], + ['LJ_DUALNUM', '1', ['-D', 'DUALNUM']], +] + +if host_machine.cpu_family() == 'x86' + checkdefs += ['__SSE2__', '1', ['-D', 'SSE']] +endif + +foreach def : checkdefs + if cc.get_define(def[0], prefix : hpre) == def[1] + dasm += def[2] + endif +endforeach + +buildvm_src = files( + 'buildvm.c', + 'buildvm_asm.c', + 'buildvm_peobj.c', + 'buildvm_lib.c', + 'buildvm_fold.c', +) + +buildvm_arch = custom_target('buildvm_arch.h', + command : dasm + ['-o', '@OUTPUT@', '@INPUT@'], + input : dynasm_dasc, + output : 'buildvm_arch.h') + +buildvm = executable('buildvm', buildvm_src, buildvm_arch, + dependencies : system_deps_native, + include_directories : src_inc, + native : true) diff --git a/vendor/luajit/src/meson.build b/vendor/luajit/src/meson.build new file mode 100644 index 000000000..7027ec24f --- /dev/null +++ b/vendor/luajit/src/meson.build @@ -0,0 +1,95 @@ +ljlib_src = files( + 'lib_base.c', + 'lib_bit.c', + 'lib_debug.c', + 'lib_ffi.c', + 'lib_io.c', + 'lib_jit.c', + 'lib_math.c', + 'lib_os.c', + 'lib_package.c', + 'lib_string.c', + 'lib_table.c', +) + +ljcore_src = files( + 'lib_aux.c', + 'lib_init.c', + 'lj_alloc.c', + 'lj_api.c', + 'lj_asm.c', + 'lj_bc.c', + 'lj_bcread.c', + 'lj_bcwrite.c', + 'lj_carith.c', + 'lj_ccall.c', + 'lj_ccallback.c', + 'lj_cconv.c', + 'lj_cdata.c', + 'lj_char.c', + 'lj_clib.c', + 'lj_cparse.c', + 'lj_crecord.c', + 'lj_ctype.c', + 'lj_debug.c', + 'lj_dispatch.c', + 'lj_err.c', + 'lj_ffrecord.c', + 'lj_func.c', + 'lj_gc.c', + 'lj_gdbjit.c', + 'lj_ir.c', + 'lj_lex.c', + 'lj_lib.c', + 'lj_load.c', + 'lj_mcode.c', + 'lj_meta.c', + 'lj_obj.c', + 'lj_opt_dce.c', + 'lj_opt_fold.c', + 'lj_opt_loop.c', + 'lj_opt_mem.c', + 'lj_opt_narrow.c', + 'lj_opt_sink.c', + 'lj_opt_split.c', + 'lj_parse.c', + 'lj_record.c', + 'lj_snap.c', + 'lj_state.c', + 'lj_str.c', + 'lj_strscan.c', + 'lj_tab.c', + 'lj_trace.c', + 'lj_udata.c', + 'lj_vmevent.c', + 'lj_vmmath.c', +) + +src_inc = include_directories('.') + +subdir('host') + +hdrgen = [ + 'bcdef', + 'ffdef', + 'libdef', + 'recdef', +] + +genheaders = [] +foreach h : hdrgen + genheaders += custom_target(h, + command : [buildvm, '-m', h, '-o', '@OUTPUT@', ljlib_src], + output : 'lj_@0@.h'.format(h)) +endforeach + +genheaders += custom_target('folddef', + command : [buildvm, '-m', 'folddef', '-o', '@OUTPUT@', files('lj_opt_fold.c')], + output : 'lj_folddef.h') + +ljvm = custom_target(ljvm_bout, + command : [buildvm, '-m', ljvm_mode, '-o', '@OUTPUT@'], + output : ljvm_bout) + +luajit_lib = static_library('luajit', ljlib_src, ljcore_src, genheaders, ljvm, + dependencies : system_deps) From 97b4dfb7f462169a627aa28643a97616b906348f Mon Sep 17 00:00:00 2001 From: Martin Herkt Date: Wed, 15 Nov 2017 19:20:08 +0100 Subject: [PATCH 071/271] Meson: add install rules --- automation/meson.build | 40 +++ meson.build | 4 +- packages/desktop/16x16/aegisub.png | Bin 0 -> 895 bytes packages/desktop/22x22/aegisub.png | Bin 0 -> 1315 bytes packages/desktop/24x24/aegisub.png | Bin 0 -> 1502 bytes packages/desktop/32x32/aegisub.png | Bin 0 -> 2144 bytes packages/desktop/48x48/aegisub.png | Bin 0 -> 3563 bytes packages/desktop/64x64/aegisub.png | Bin 0 -> 5030 bytes packages/desktop/scalable/aegisub.svg | 375 ++++++++++++++++++++++++++ packages/meson.build | 19 ++ src/meson.build | 1 + 11 files changed, 437 insertions(+), 2 deletions(-) create mode 100644 automation/meson.build create mode 100644 packages/desktop/16x16/aegisub.png create mode 100644 packages/desktop/22x22/aegisub.png create mode 100644 packages/desktop/24x24/aegisub.png create mode 100644 packages/desktop/32x32/aegisub.png create mode 100644 packages/desktop/48x48/aegisub.png create mode 100644 packages/desktop/64x64/aegisub.png create mode 100644 packages/desktop/scalable/aegisub.svg create mode 100644 packages/meson.build diff --git a/automation/meson.build b/automation/meson.build new file mode 100644 index 000000000..baf3b2615 --- /dev/null +++ b/automation/meson.build @@ -0,0 +1,40 @@ +automation_dir = join_paths(get_option('datadir'), 'aegisub', 'automation') + +install_data( + 'autoload/cleantags-autoload.lua', + 'autoload/karaoke-auto-leadin.lua', + 'autoload/kara-templater.lua', + 'autoload/macro-1-edgeblur.lua', + 'autoload/macro-2-mkfullwitdh.lua', + 'autoload/select-overlaps.moon', + 'autoload/strip-tags.lua', + install_dir : join_paths(automation_dir, 'autoload')) + +install_data( + 'demos/future-windy-blur.lua', + 'demos/raytracer.lua', + 'demos/raytracer-test1.ass', + install_dir : join_paths(automation_dir, 'demos')) + +install_data( + 'include/cleantags.lua', + 'include/clipboard.lua', + 'include/karaskel-auto4.lua', + 'include/karaskel.lua', + 'include/lfs.lua', + 'include/moonscript.lua', + 'include/re.lua', + 'include/unicode.lua', + 'include/utils-auto4.lua', + 'include/utils.lua', + install_dir : join_paths(automation_dir, 'include')) + +install_data( + 'include/aegisub/argcheck.moon', + 'include/aegisub/clipboard.lua', + 'include/aegisub/ffi.moon', + 'include/aegisub/lfs.moon', + 'include/aegisub/re.moon', + 'include/aegisub/unicode.moon', + 'include/aegisub/util.moon', + install_dir : join_paths(automation_dir, 'include', 'aegisub')) diff --git a/meson.build b/meson.build index 78b4b28f2..8b06c36ec 100644 --- a/meson.build +++ b/meson.build @@ -10,8 +10,6 @@ b_static = get_option('static') conf = configuration_data() conf.set_quoted('P_DATA', dataroot) -conf.set_quoted('AEGISUB_CATALOG', 'aegisub') -conf.set_quoted('AEGISUB_COMMAND', 'aegisub') if get_option('build_credit') != '' conf.set_quoted('BUILD_CREDIT', get_option('build_credit')) endif @@ -143,5 +141,7 @@ deps += dep_gl acconf = configure_file(output : 'acconf.h', configuration : conf) +subdir('automation') subdir('libaegisub') +subdir('packages') subdir('src') diff --git a/packages/desktop/16x16/aegisub.png b/packages/desktop/16x16/aegisub.png new file mode 100644 index 0000000000000000000000000000000000000000..7d5d58846b0a611580e9092c9084be8ffce42969 GIT binary patch literal 895 zcmV-_1AzRAP)w~Lw+Vk}J95@FKoD;zR5djd~ga-f)puUj^YnjPxuIv*nBZmXuH-ppou zcNj*bHyn=ig~O4FT5Yb**zJD9I9YO>Z`MU*{dl^){lilO149SW=~sVRSh(=#+L~mZ z2hJFl9S2uU^M_~R@k8&X)BE>CA|E_t5CxJirql1GDAkU3bUfOo>)F$@vy+@LFweuc z^YhbNH7%2m#U4rezV>7&^nM&j{2L+P+4mQu#ZwhaE=@yZ6(IGm4&!OcO{e0kK}TntVtOQcSlC`xHpmzTE@-}jrnj&pr(X6F9**jO_av7ksCr1b@Ww18%g z!q7R0Tt=~2#I30*Pq?ld6ru(x-N4Rh^x#K5J?9>4X^GyW6qD&RnjJfEvA74T%@n#L zGuW3cH50Y_A)``3wp4=NXy6ad?J?kZ004#)iSbXjZ$F}>gb)HhdtU9gY__nI^OrKF zNzW`TefbJwuMa4dltMr#g|C6}>%cJz02U$FbRiDs2uU!`@ttX2j8rO_mseJDQQHnI zx^D265I1%SF$mws72wVl;0OmA1OTdzvvAe6&zjAqylh$JzdY~eFd_TdgB~1E>WLMl z$^~HF0^}5Mx&bUcROJQE3w6$iON{-}PwDV(-|yy}LvW6u?*~?a*lpm)yMR9lybZwr z?-u-3;GV5i?`|Mp<(yTNVoLy90$31e{S}z50H3?S?51mcfDC{woA3bO0H|yv{s#21 Vfu(7+5B~rF002ovPDHLkV1k#2um=DD literal 0 HcmV?d00001 diff --git a/packages/desktop/22x22/aegisub.png b/packages/desktop/22x22/aegisub.png new file mode 100644 index 0000000000000000000000000000000000000000..74dd3f2c323ca003ad4f562745feaa9d55e1f250 GIT binary patch literal 1315 zcmV+;1>E|HP)H^eDp7a7W^&dom?(+S={ z@v=)hTiaS=+q6w=+FYBH)12@7&bJ>nuIdE;Y%hH9zArBi@AdhB|44+#_{ECC!t=}B z?hNM~CIFZwIOi}q2cNNjPbM8UJO8P+h$|tn0^jcXjm>LO^HUY<+()7>pRk_iMf0 z=blp4&mSpyw&Aneo7?>URa+MFxR-tS+MGR;5s_4VDPvofWG;K0z(?Ia=BUh{Yw zIb&Gobb138%l_G|mGVk`QPHkFjg9NvvMe!5QBzQ0J0Fc!59|8j8bx{DCCf5r3?WV9 zMXO zB{jS|Dq01kAxknGib#pYTDGOcwU7`3b7q)zlBCqzY@3EMnXds%N&v9L>FoHVq2XD{ zG;uwVz`j%p{ee3C5??RsnF-mLJSQ0XIC2I7@okZ6Ys(i-6i&!zxz&2FpJzBe96Z1G}zbnqbVXbrg1UjQ<&{hukASuoLsgt$UD z^V2SrFKxovWD*xN4fbpnrG^1&n%*JcH%StN?Sr|T{+*^(ZQ8aCt!vi6X0zeapGjQr z1L)Y{2N&Pb2)VEZ8(%JkC<>^mugAPai*Q{K$Vp1+5HLKMNEAthlC)F-rfjkt?hOWg zip^$mI-R0oF>&&u0MG<@w(lOO#SNu$GnyBPXsQZagRqfn%1nx+$$Wn*LZxseDgx_*B%rWwOt;LL5{1pxqTK;YHV(u?numiifE z_XB%$-T208JydMBx3-C5ts|4cmv`^>ju7(W`&R3Rb2*pu@tkuU1BNdED|H|w0>Csd zd^MFi9@I3JKU+!&j>KX;(UFmBE5l)5MI-`8GKn@xssn(IT<&Im=Q-zy0PH4kOb0>_ zob*60x8uP0cz6D6uVgaXD5am4OVZXxQB?E(GRCBNoVSf~e&_~cSpeVwI)ED?VCTPa z1qtPHJ5HxkaY6`wn40=a;M}>^Vp*6cpgg<1!g-wysQMYW!2w(X5~IL20OS#_0DuhV z0}0byk!7sx8l~?A1YvutB>C7($!w;VDj?heJcGba0eI;$a3Kuro{c3v%%hWxox4TI zi*o>dqb#?njEQ-onJodp)d@^?0oHNgO#s@Hd`%Vy&{Zc0DRBPSf9)3FngSZ`&HsOr ZzX3d`rpmAYjO+ja002ovPDHLkV1j9=Y`g#f literal 0 HcmV?d00001 diff --git a/packages/desktop/24x24/aegisub.png b/packages/desktop/24x24/aegisub.png new file mode 100644 index 0000000000000000000000000000000000000000..f57623260d4f58fca6586388804b3d9a01fe4c15 GIT binary patch literal 1502 zcmV<41tI#0P)`4K#Pd; zGDJ6+n|K99WK**YrxS&DZ#!Z0GN*rek|!rk&iQ@MdEWQ^z7q1HE}EvZ)I5L0D3{j< zIOO8ul))iE7?YP&+9syyg6D#}NF*QP&6uszUHG-200w5wf~$FXa3wn%dNMQNVnzm> zpEeD;Q&J#bqq&67nq?HV_*wbxv7VlNCRf)QbYFfTEp50jCkHOioC%j^%zz8&>2NkR z70x6l!~WPJ|k>hHg3ip&sCoQvBe(BH8htufR?CM&t=lNyZVq=F! zU7t=&gsy}HsJB{20(gEy2+ud!!^7by>J61@K+dug{#nI&AxtiBb!8>x89v6Lw+!L1-V_d7%;sS|$E`E*{PBYbK4daM3&IZs2Etlz z?>kzCDSDLeo$Kp+(V6x1>CUY8pvydy8C06^5l;IuFvM-UD~gvxvegQ&;TKdPxIwFhdbJv=Jv=~9(>5nu%kwiz!@_PJo-zdr zA|qiAwqr*}2MiAW0rK&?fzhvc2=0(b@e;7+I@s0tJ@oYSKwVuO6kx15Sm<(%26no+ z!91z-x{{C-;>xn02P+i2bUGcBmX<<$dpmS@cSC=FKX^=R048AdV+&BqWL#i7Y}kVQ8i$1X@lnGX0X|8P+3_C?<`z+Z)#G~t@xOjo={KE zIvF9K5Vb^7xJakFwKpmXc4I^((b15D{l22O7&cbhz$FG3iRl2wPy)2y2f&8!1=g|$ z78lh(b#*l?D=LClG1l2QA0O-WP$reaTAGGjk!aAJka>R>Ste^agvI&}bu=OZS~1Jd za2uG7MPK;l0*K362Qup}kVS2Uki;@5n7e2wFFX6*+c?#$LPKE_W?qZnFT`S~MtB8& zsXrn1u`ZGlV#xLIxO@b`hp~fN@uilaAZWtAe&1-kot~0n&rD4nd@nT(R$`YW`1tht z3BpH9Iqvoro`)|b64=Zzut_9>DugEz(u+*}LxW(DNXo19`uhh%Lg2uIzHY?Ao5bSd zo-{pci9+$a4cl)Ax?Lj(_q7zYDu|*wHnXhLwFB(XNWqSr{COhLZ=>*ys9-`m9jqsAMqV_X zxmc;Z+34c~J8@tF8K%XXq81bj!tHHxIeaAu&a7+D^`{gytRZAA=Fqy~!2)v#x#31g z##49HK(TmVtx5&2@ccENkf?DC(^V&v!IQGK5^|O!BtDCff%W)XN66l1IdHVmVsRgi z`qyfTT3*6&L!+*%DQYZhhgK6Zf?u)Tj}V)M5XXU|ex@T02c#TtArY9fqxJsn`cdKL z@7UPJxnNw+cjyz65yb%PsV0YU77kIF-|U|M6Wh_y(mMq5+0YHMrLN}@?)ps_^bAEh<5YEq20O)XXG zBUoC6SOr8xRF+*9X5HuPJa*@C=gz(7oc_Tsom~-;{?Y!Dn{#u{xxdHv{C>atJ@7vk z?F{x*19fMqKLun?x54}z1v*dr4=sR%2Or+}7G!A$*_dw#}0I`j((+F3x)1 zlg}SJR-6p^I0AdpY1Qw#Z-xw`{qjiUoO;7R_&)3E>ME-YnGf&$~$Z zu5Oqirr1?n918NU;iJPnPX5wq!QjrVt*z4xr9M@vNzdc^{rz1DA=&_MLJ~$pp-uPB zoVlXCw$?1K?LDa!kM;GjvAYMqdQrGkdF6Cb%4)tlf<2;;Bv;Khx*u8fzPUtd})qqUA@G0W}YGgOcIZ95=pnb)9 zUVq~aZh7!Q4qtd78*H0xrb&7%ACwT>84gFMYT7dZX4o*kBa~`CJUYs62M75;2-e(q zBR^lemPjOm5Q5`<4(K+@?fcBOt-J)96{EXn1hFVedwV-=ZEbXSck{~j?QGt^pJ<^# zOCmwo_q8G{v0$CyDb-vM;+;LdKa>gt7OY#po|UUsVHgHVDU?#Ybs){bZXKL1RCeDf z9Wd%wgHgdXODmZc4Uo_0$>;NEn#Q>;EzF%akGy5ccS|KL9*bpN$N5dpaSj_m6_9fr z=RhzRd@ml4FY4^<)LU9wOv5nnJP%z{{B3sut#Upx`65VXVh&U;z-agu0aDz1Qv)Tp zKrWXfm&=jQ=Sd_I96EGJb#`{Tnx?s)=j|LE9^US_Zd|i;eS;1U-79rGAzsHyBjkcOU0lxh~NDXDtiEQ6TS8djOHJKpXF;8Wx0KI9mQgi zTrNjfR~H{0JgAcCG*&9*nZ3PkAf47UDUEGX1~u5A0eZ}`4nB4M`Ewcrfs-ZEuN2$D zVfunW7A{^)ZNpqPJzK$uR|iHlnx>;r;Ag>0G9x;~J=ZJxdyms|LJU}?j-LM~U)lFe$({rxlz4`aISghn(T+(t-rz?H!J#C*HYFwAx;UV!(Hv3|tr$?P{ zn%_8A*9|EpVv=!`Vh?yj@DlL;UFf3^u4qQ3JTZ1JIj<*+6bGA8<8DWqf~mdnjb9Nk_3Q zn|0nT7B}m<9$9YNYcB}|?DF+0useh>O1l0|NXo^{N}1zPkIQqA>4G2nukZb z?;IWN>UNw7EGO^#{AqM_ctpxaE0o%_#rx07Yg!F3@#r{5M>VRIO5>4yCG! z@COCUWOf#s ztEQQ1Qg%xrPJUYt;g2CU3Y$mas+kbl0)1(?7VyuM6&Es6-t%xeo!{@e$6eSJg6}Oi z4103a<;DT#fnEb&5pduGIQ}@~@^BYW{K8i=0|o_L9f7s$EbGooG%awds3*%|kWav$ zQ}7D|UJx+-Z10AZKm{jY&j7RA}Dqnt701#eK&=-S54b_hx4= zX%A_2FA_*X21#H7GN7O+Ap&Bd0+b@Q0pW52#f_kdi7^E@2nyo_nW6~T!iY0a5ui8* z$`L}80$BvQkdV-^iWcoPyP7>_c4pqyoj+!Fy}O##1ym|k?y9bt-r1h_{r!I3zyAKd zJ@Ci&f7`@K%rSw9-w>WdfcH%sAO)l}#J&LoB7lFQ-aL`^m%uw3t|&3hw{~7}MWoa; z(MqATMr(~$>d0~7RSh0%jZz9P3|X*oV>aP=Hvj=}5wQNay?FxQCjoB*OA1D8{pZg< zQz{Hm{h$l)i;a)yVTe|W*PEM31wjIM3HWQ^J)rh$Hy~!3{{r9`#^ZpI34+_7+Pyn$ z&twJw4F{o(vr;G!K%mQWsvi~+6#J~D+^ z|HzIV!HIgkfBed!Lpm3RUjna7xM8$qjsEvJb5Qvx|LNCdK+G|WXC9g}#~NeX+&_D^ zV;jaJfRhQs<*yt#AP%HbMZp&HdjDsAzRyz!4|-Xp?grwfln>oGX_8ZCn*3c|ooP$C z3b4Mi0j8Aqol;g-@%{RGp_JnC@#C2gi;Y;hq=4Kr# zwGUWp!r!0jIFb3~`O zZf$II1FcU5nocSLG1L6@_v-7#w+f!=?-x{6F}Jc(T2kHz927!4^YE@+xnp^~|FajH zo0Zo3bKvcWl#iTWUan7foFVhhbQ~@!D-%&6o<7+nbhRbrS@+JGW$Gfp?wdK&)>_{L zO!Sp{@V^fqW>YeG%rx5Vd8}$~4zfxu2Tl*QzWSEBy6BJ%UYK`tO-)1y@n^uLCu%^M zE#;FB&z>DEHH@O0@buDB{$k7+WgEr{AfdGW`HJ1UvqiJepbh<-=4K^?_!L-g3$b#^ z=+V?!7OH=l4VqUj1UFPwSy3UL1)SqHAS&e}vnnfNi^q>YYBpJZ$|=!6sinZT6g;-O zuP<2F(ZNU?x-*yKrM9*(8-{lQ3$zdy{II6R91`7O4!EqeRMc5kg$ef+!)g@y+iU?( zzc_DRq|&m6Pywy=ALxKml$j_`p(txufXA>Wg!_e&CS=WWD*4^ zvli?r=*R?AY8yK9IcPN~#xac2GcgPc8MGpUcBD|0nkEZvn~Q9liBb+VV0g5(CLIJU zOC;Prt*--KEoMMJULEQPsq(NgjLm?!gZNrdbvX41;r|Bnm~BkyeWL zvRR%?rINnZQ-Izfd%!k~r_ZgbI%D~?Y35+B@9*p5{>Db0X=x!SD`WBHmvj3acko5x z6!vsZ!;hVV-?J6J?X@A`fdLRoDT4GK^q5;vW*t5i-29_OT()RFrKP1br_*dqr+H5Z zdbMVZ*4Ra8`9#Cu6VDU9N>!>nGaiV*cPuH_ubV&L8gJWZt?6)GR<*XWwyO)raro}y z#VlRAlqplDP+eWk*z?!W<5obVhTyZS(Aj;*Bvr=vn~iZvPWHIyz`= zZKa{1fsa4_n9sIvM=QmdN^z0vG9d_tMB+=|=gw3r2;tknRueEC(|qp6`g$WSC5Ll4 z)+Up@(Ah~K1dA@YgzK)mj!BayVcRygZPV40p(m{%Vu6UD-R9$>wA$+cVSzAdYDp0U z0gmG^ZrnI7x#SY&&6~&m{rlOlVFO#YY~gdyV^R?CophS%*(@kUoe*3aiHLVSZHP>82eSJN)ZR2?!LKFff%tG)4LP#(iP}$?) zzL9}>hJ;)$hwHinT}sKsi4(c<$}3s0U;&#pZDRB0&Aje7_`XkDTN_fzY4=pNGXw0z7mVYRyQ>@?FP~U zxC8h_%rFvz5kwuwsvS43tRx;cr%s*9;>C-ptEkMaUYkc8kcKfS(`In(p&ItT)C zxg3WM9ip+Zk=B+LJm1I6M_ovaNal=^s&e>-Vu+PC0 zx`DT(WNS1^iQ_PH)+}bsm_a03#)=m;``atPECZtiAtU)fsvJlM9cCd+L(qc`y18n8 zz;`dSab1_z)>fLDnrLfj!S#Kl){N`uU|M@Sb;%_36UjkXdbQ?mt=(K+!FWpyI>_F? zboA(XKdG;`is?E^DcYpuUE5}_;}DHRm^gVd7-L_F|X)GrcaY9N6bp#Cve5B4I zRf?$W;qrOC)W$nVBocHblLTRi)S9u$B$L|On9$jY83e_7QDOWm@IQeKF8uj$DlyFv zV&`)+XIe8Ir|41M|HYlANkd5qJIl)nr6eAU5h=w*$X@hUI^2H14ocK6CRpq+sj{`F~bpX z1S1^I5_3YZzodkZN=isoR%&S&qW`QI{AvdQJ;|hM&t|ukm6zYMVcohl_mq^x&n!k5 zi+G(v^8E>9+hK)*hel$fwk_qpo9gQ7t{gQ=3}=MJ9_EE1-#>IHmy+_9MT-_~-Mw?? znz@cM{yZs#oy$?0&0=RV90~$%@97B?oGM{St&~4|+;JQ+g4g>KNq>76^c(P{3#USX zpBE`;f8$TWkIMCt6y(5rwHj zPx(GCba#8M*0%v7D#YV|6OTutTK}Om90Y8sWko``3YhG|oiBS{E;qbx)<+(OFM%uI zx4?fMS553{edC5yN^MT3M;30C;?isOfQ@l zM^o{JXP7eJVi0!zyIM3n_9A56e1(+@@-+YO*L6!Nqe5(}mGbn~FiiU}9;h^6@57E` zO@tA39rVaWP9Jb5cph8~Y&M~3G?aD0Ru9fPYK3%yS4_&)dRbE#iVz+IdL!`gw+%y2 zC?d*^mORl~-t0 z>(-P6Ss58gDFyhE(4E&`r~er+fPQ@KHM-ruKi%rrk8bwu zOE-G=7IOX7SLs^Mo^-WG54zI5J6-P9jV?t+(Z#M^=>o<)55;CdQFdBw0p^*jQv5E6 z{*O?=JjukD^4@5#)!uI5;gNq2;O_zaU4Uoc0z82K2;jE?{1$-U?9;~ryjL%}2Jlw_ z{tCcf26zT8zytUN06!0FItOd&U84po;D0e!bvfsEat+ff8+=o(R{JYYjs^W&wV)CF zw>X$}MX`Pk;Liel2HZiiKTFQ#ZKu&Z6>HFFSShtD3%nLg?{+g7^0KgCd&{Ec%g=O( z0~h?9o%3!1bVaa!7V+Z@;zv}qYKpR}%DI;6wc7l+rcKFcXP2+lXx3Gh0*15J=OI|J zufN-%0bz2s24DI40RH?t1TI_F8F*P(XW%TU2!L9Psedl#2*iECa4#=9f`IvfkB<@< zUwzTw-N5)yp;fEq-v@XOa;E{#(cV5EpCzj-&T4!H_WpFVqJ^zXZZ;y$Oc*4xCAh7)=!o$x$Z{A$-!zlR- zTSLM7V5Y3Bp9Js|$RzQBfy$VZ<(O~s{TKD?3)UI90FSx%HETv28#gACon0Q3u)U%c z@K>HV28D&owj} z^TEJfStn0HHKH8Es2C{R&JvX8{9f?w*^eh;f}&WzW)tC;BQi_o#>+8k zVewD(E2AmkXMul^47o z3qS7zzrF&di>>B3$f+WHYvgUP_cO+Dm1E7~GBzD4%gQy&DKZE*y#v)YIg^*83)MBdQ-pg>8s}4oVgP0@l#>hj1^^`cZ_9NgI>3cC z0BlLDGw^N55G-4vfGJh0Dr1c*EBM;H>+0_1RZv>il^}Npex86}=>b=lZ}K7s=Z0i-u0u{{7jlBq%y?div)f}wN5|VPdVT&DfG#cTSpdETz&B%m zu*ut-7FVxM_7-bgQd<1Hp`d9nHS3mD&AJWn6qtMWTD8atof=0)oW01gS{rio9!kb~ zlgLo5GwB^n&$0iUC75fI(fchj)#^uP&v0^a_n|6Ps*oEhI~G3=4;l_I2>@FX>ze_7 z6Tol8nliCj%0%!T0L98uy>&_8O$c7s{mkaP%K%&?>j0jJfYlCzD~!1#NCh;DAhXW^ zGW&f%<_1&9sqqXlR*w=O*$wRM>A!H}%8poEY(Wx~Dk|Ah4IR<=BPX3>e zi|<(aaQZ)J#*7)%4_U|$tn+*3Wy_Y)gb5R*$4_ zbFgkJ>kJ&S4&c*~3DV#~X;^cJUS9w!;HFBg!UErRGxpfIFmE;R6Nv1S5D&aDAe$j; zf7q~Lw0ZMpx_tREJ$m$ro<4m_nc3H{=p-zD6X{#-Cw+^oa<#kdJi3uSXe;TPrjX7* zhQj*9(c{OD>A`~sbmPViI(+yrZQQt#X3w5YZ(vi#F2a_<(g6g03Pq$dc&t?cp9=76 z5la@r3iOuZDA^YOAfEhlq#8B&dC1EFFs&Ler<&00t8j~T>(-yl~+HUAuOTZr{F5_wV1QUw-+8=EWU_0#;-3 z+o6CXW%hro0^m0K;2bC*4Pz{&>Ma)t@HcPX6c%^(>{&W-;soX9=F;B1dnqR;M_6NG zVxn-5_9(XlQ7y7GhXeydD`ch!1lv}S5CmS;d}6;c2IhYi@(2yhqmD-7c^@C2e8tD6 zOqoL2+1a#v_ij3P@Ssq_>C>l$60TmoYPEzF=_jQEwh0ArEGU-?xOIX8c3KtCG-?T5 zzkc1y{PE+*p98;b+cx16>FMdTdi82bNJyY*)20b)4Msu65)>4aU%y_x`zC|o6k@A47>dpn$b-fmj+aHd)NWmdDCx687xbBi6HZ>sHFl%(Q}MD~OAW zqnMZ&nm>O&O`kqpSZ_FL6~=*|zlMc{&1=)9O|=rMp#}{aH1_xRKg>SW44V-4GuAX~ zowa}H&>^uPRs@^n#fulIVN@D|;6~Di?1KW%lCJ)jWix++51!p)Q6iM7^IuG}7HqKs zS6FA?XS3h1VFRV6rix6oV#Nwtx^yWmUc8vT{q|cLH*OqtLo9m*JI>bFbVVYy;h~pE+};Sir7byTpRnA~-U$X^xq;1Au-94B}+tZW>aKk@FFv}{6H?jhy%?x3oFn=0S;kDklK0_4_@a6bN?4y=b%i1 zYefba^p`~1v15mrXVa!lf^i0(l9D2Tv%fPTqehLQo~T_qBV{v5?NGA>1qK#)dwS+O zp#pS7S4u6axvi&3e6~ihF!iDu6}j-Exd7iD>4trZwL50a7@>&u>(>irn4$MRUMEtR z2!<^WSd_r-fV61m8bKO6gUaN+$lhxNIWX|hLzeW1;K}UQiin|TpB-qJiUe{4V!saRH$80zr2pMPD9*UhIF?Qq$MKdtw5Q*9Hn>yGC({szyy@y za{j-m-N1k<@UjoOzPSLcG%BoJ8UW`52;Q&nL^pOa?%UvV1QVh4=;&x#v}h3}B_)Z) zb{n2-aRpWaTSC||p#-ah9)x?G5WnlgPFNHrz;6)6luPp%`fh%bV4BBdrsvF=Bhnlf zKRr;TvM~6*F!%9Dck@yFB$-S_0*}YuBL?6-U;#1{{N_ZN3j_Kq3J7(3>agt6CQZ#0rIe_St7bx$JVB)>zood!tB;=H?03x)K{P2A+gmUljN_0AB`d zy)4Z0uCQHE!G9GuFf#y7&AROYgt{rY2KVp78oHv}%cjW83>`X@CQqJBLq>l~K9P&5 zdaHQy2u~*0&~$PR%^-8jO=J$qB)+*^+F?M$eV9c-+|E--tAMW-+C6+iJVLIB4?A|D_>L7w$mxR z%XsS9_igIiuRrxg_em{1;n!2Jjs@88Bm;Dcvoj@waVzjru&ziGFb~sz42+&7l>oe5 zq;F6N9W3Sm!U|q#PjQz9nIa2y`1kn!WCYT_V2#zy0!Rz%d&QcWBDjN5dceSMO(qk_S9#i% zHJYx%r{^7;%%{e|T@ z7pMwXc-S0=6uU~vy3&;F4}aBKDy}B#w@Rh}U}24lHDG?V+^;9%SvQOF_NlG$b$~4` z>nuwlC~>(Z{y=%LqCD3q(IJL^mc+W!l#E9o0o!UexmatFrP18<)#>uni(uUv(&U*1r205%-zFc1-X`Pou(nbht!#Ymje7hAtp=U+a;g>T~`nX5k71z?f`;2 zvh%^PJQDj#KI_aT*c{DBE9m13wEPyV^BF4l-_`xL$Q^4S7?Du;yuZZI8z=YtG2++#06NCR70NNaB*Wu&vP5@R` z)@>tv^lziNcpW#|2K;P@!4mi~U*vm&{tT=m04UX5Dgs{(WC@k8^0f>HaQWW@bXi$1 zET7l5Ca&4|A(0qF9wUYN+L?v`?x z!TSY7xjfGKGFx1#%zvH`?+_R*QJV99xcqwr-wy;(Th_OXt4r*|IblQxmK=W?H}pw>n^1;lps$f69f?2nfrk2*$1685Z;Lq^iV*~$yf18`C w`4e3O<$HxJQz}6|QoTj`@_Ko_yvl$5KZpyiE!VpCn*aa+07*qoM6N<$f;*$5>Hq)$ literal 0 HcmV?d00001 diff --git a/packages/desktop/scalable/aegisub.svg b/packages/desktop/scalable/aegisub.svg new file mode 100644 index 000000000..e0dfeadb6 --- /dev/null +++ b/packages/desktop/scalable/aegisub.svg @@ -0,0 +1,375 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/meson.build b/packages/meson.build new file mode 100644 index 000000000..4b11c51fd --- /dev/null +++ b/packages/meson.build @@ -0,0 +1,19 @@ +c_pkg = configuration_data() +c_pkg.set('AEGISUB_COMMAND', 'aegisub') + +if host_machine.system() == 'windows' +elif host_machine.system() == 'darwin' +else + configure_file(input : 'desktop/aegisub.desktop.template.in', + output : 'aegisub.desktop', + configuration : c_pkg, + install_dir : join_paths(get_option('datadir'), 'applications')) +endif + +foreach s : ['16x16.png', '22x22.png', '24x24.png', '32x32.png', + '48x48.png', '64x64.png', 'scalable.svg'] + dir = s.split('.')[0] + ext = s.split('.')[1] + install_data(join_paths('desktop', dir, 'aegisub.' + ext), + install_dir : join_paths(get_option('datadir'), 'icons', 'hicolor', dir)) +endforeach diff --git a/src/meson.build b/src/meson.build index 6a6091f18..939978f4b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -199,4 +199,5 @@ aegisub = executable('aegisub', aegisub_src, version_h, acconf, link_with : [libresrc, libluabins, libaegisub], include_directories : [libaegisub_inc, libresrc_inc, version_inc], cpp_pch : 'include/agi_pre.h', + install : true, dependencies : deps) From 48af346e949838695bc095a160e69ca1f0e7e4cd Mon Sep 17 00:00:00 2001 From: Martin Herkt Date: Wed, 15 Nov 2017 19:41:04 +0100 Subject: [PATCH 072/271] Meson: add gettext i18n --- meson.build | 1 + po/POTFILES | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++ po/meson.build | 34 +++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 po/POTFILES create mode 100644 po/meson.build diff --git a/meson.build b/meson.build index 8b06c36ec..86963c88f 100644 --- a/meson.build +++ b/meson.build @@ -144,4 +144,5 @@ acconf = configure_file(output : 'acconf.h', configuration : conf) subdir('automation') subdir('libaegisub') subdir('packages') +subdir('po') subdir('src') diff --git a/po/POTFILES b/po/POTFILES new file mode 100644 index 000000000..233f76faf --- /dev/null +++ b/po/POTFILES @@ -0,0 +1,81 @@ +src/ass_style.cpp +src/audio_box.cpp +src/audio_karaoke.cpp +src/audio_renderer_waveform.cpp +src/audio_timing_dialogue.cpp +src/audio_timing_karaoke.cpp +src/auto4_base.cpp +src/auto4_lua.cpp +src/charset_detect.cpp +src/command/app.cpp +src/command/audio.cpp +src/command/automation.cpp +src/command/command.cpp +src/command/command.h +src/command/edit.cpp +src/command/grid.cpp +src/command/keyframe.cpp +src/command/recent.cpp +src/command/subtitle.cpp +src/command/timecode.cpp +src/command/time.cpp +src/command/tool.cpp +src/command/video.cpp +src/dialog_about.cpp +src/dialog_attachments.cpp +src/dialog_automation.cpp +src/dialog_autosave.cpp +src/dialog_colorpicker.cpp +src/dialog_dummy_video.cpp +src/dialog_export.cpp +src/dialog_export_ebu3264.cpp +src/dialog_fonts_collector.cpp +src/dialog_jumpto.cpp +src/dialog_kara_timing_copy.cpp +src/dialog_log.cpp +src/dialog_paste_over.cpp +src/dialog_progress.cpp +src/dialog_properties.cpp +src/dialog_resample.cpp +src/dialog_search_replace.cpp +src/dialog_selected_choices.cpp +src/dialog_selection.cpp +src/dialog_shift_times.cpp +src/dialog_spellchecker.cpp +src/dialog_style_editor.cpp +src/dialog_style_manager.cpp +src/dialog_styling_assistant.cpp +src/dialog_text_import.cpp +src/dialog_timing_processor.cpp +src/dialog_translation.cpp +src/dialog_version_check.cpp +src/dialog_video_details.cpp +src/dialog_video_properties.cpp +src/export_fixstyle.cpp +src/export_framerate.cpp +src/ffmpegsource_common.cpp +src/font_file_lister.cpp +src/font_file_lister_fontconfig.cpp +src/font_file_lister_gdi.cpp +src/grid_column.cpp +src/hotkey.cpp +src/main.cpp +src/menu.cpp +src/mkv_wrap.cpp +src/preferences_base.cpp +src/preferences.cpp +src/project.cpp +src/resolution_resampler.cpp +src/search_replace_engine.cpp +src/subs_controller.cpp +src/subs_edit_box.cpp +src/subs_edit_ctrl.cpp +src/subtitle_format.cpp +src/subtitle_format_ebu3264.cpp +src/subtitles_provider_libass.cpp +src/timeedit_ctrl.cpp +src/video_box.cpp +src/visual_tool.cpp +src/visual_tool_cross.cpp +src/visual_tool_drag.cpp +src/visual_tool_vector_clip.cpp diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 000000000..8b2f65bf6 --- /dev/null +++ b/po/meson.build @@ -0,0 +1,34 @@ +i18n = import('i18n') +langs = [ + 'ar', + 'bg', + 'ca', + 'cs', + 'da', + 'de', + 'el', + 'es', + 'eu', + 'fa', + 'fi', + 'fr_FR', + 'gl', + 'hu', + 'id', + 'it', + 'ja', + 'ko', + 'nl', + 'pl', + 'pt_BR', + 'pt_PT', + 'ru', + 'sr_RS@latin', + 'sr_RS', + 'uk_UA', + 'vi', + 'zh_CN', + 'zh_TW', +] + +i18n.gettext('aegisub', languages : langs) From ca3802e82abb5beea95c279d221afd7087132d25 Mon Sep 17 00:00:00 2001 From: Martin Herkt Date: Wed, 15 Nov 2017 20:40:10 +0100 Subject: [PATCH 073/271] =?UTF-8?q?Meson:=20respack.lua=20=E2=86=92=20resp?= =?UTF-8?q?ack.py;=20works=20out-of-tree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 3 --- src/libresrc/meson.build | 8 ++++---- tools/respack.py | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 7 deletions(-) create mode 100755 tools/respack.py diff --git a/meson.build b/meson.build index 86963c88f..8df4b7e7a 100644 --- a/meson.build +++ b/meson.build @@ -105,16 +105,13 @@ else message('System luajit not found; using built-in luajit') endif -lua_names = ['lua', 'luajit', 'lua5.3', 'lua5.2', 'lua-5.2', 'lua5.1', 'lua-5.1'] if not deps.contains(luajit) luajit_sp = subproject('luajit') luajit_inc = luajit_sp.get_variable('incdir') deps += luajit_sp.get_variable('luajit_dep') - lua_names += luajit_sp.get_variable('minilua').full_path() else luajit_inc = include_directories(luajit.get_pkgconfig_variable('includedir')) endif -lua = find_program(lua_names, native : true) subdir('vendor/luabins/src') deps += dependency('wxWidgets', version : '>=3.0.0', diff --git a/src/libresrc/meson.build b/src/libresrc/meson.build index b9c5fc906..b0392dc54 100644 --- a/src/libresrc/meson.build +++ b/src/libresrc/meson.build @@ -1,8 +1,8 @@ -respack = [lua, files('../../tools/respack.lua')] +respack = find_program('../../tools/respack.py') resrc = [ custom_target('bitmap.{cpp,h}', - command : respack + ['@INPUT@', '@OUTPUT@'], + command : [respack, '@INPUT@', '@OUTPUT@'], input : files('../bitmaps/manifest.respack'), output : ['bitmap.cpp', 'bitmap.h']) ] @@ -13,12 +13,12 @@ conf_platform_json = configure_file(input: 'default_config_platform.json.in', if host_machine.system() == 'darwin' resrc += custom_target('default_config.{cpp,h}', - command : respack + ['@INPUT0@', '@OUTPUT@'], + command : [respack, '@INPUT0@', '@OUTPUT@'], input : [files('manifest_osx.respack'), conf_platform_json], output : ['default_config.cpp', 'default_config.h']) else resrc += custom_target('default_config.{cpp,h}', - command : respack + ['@INPUT0@', '@OUTPUT@'], + command : [respack, '@INPUT0@', '@OUTPUT@'], input : [files('manifest.respack'), conf_platform_json], output : ['default_config.cpp', 'default_config.h']) endif diff --git a/tools/respack.py b/tools/respack.py new file mode 100755 index 000000000..c1c78fb73 --- /dev/null +++ b/tools/respack.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +import sys +import os + +manifestfile, cppfile, hfile = sys.argv[1:] + +with open(manifestfile, 'r') as manifest: + files = dict((x.strip(), None) for x in manifest.readlines() if x.strip() != '') + +sourcepath = os.path.split(manifestfile)[0] +buildpath = os.path.split(cppfile)[0] + +for k in files: + sf = os.path.join(sourcepath, k) + bf = os.path.join(buildpath, k) + + if os.path.isfile(sf): + files[k] = sf + elif os.path.isfile(bf): + files[k] = bf + else: + print("{}: Failed to open '{}'".format(manifestfile, k)) + sys.exit(1) + +with open(cppfile, 'w') as cpp: + cpp.write('#include "libresrc.h"\n') + with open(hfile, 'w') as h: + + for k in files: + with open(files[k], 'rb') as f: + data = [str(int(x)) for x in f.read()] + + datastr = ','.join(data) + name = os.path.splitext(os.path.basename(k))[0] + cpp.write('const unsigned char {}[] = {{{}}};\n'.format(name, datastr)) + h.write('extern const unsigned char {}[{}];\n'.format(name, len(data))) From 2e3a78383f3af2d589112c2de27497958112a194 Mon Sep 17 00:00:00 2001 From: Martin Herkt Date: Mon, 22 Jan 2018 10:03:45 +0100 Subject: [PATCH 074/271] Fix fdo icon install path --- packages/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/meson.build b/packages/meson.build index 4b11c51fd..30ba88c6e 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -15,5 +15,5 @@ foreach s : ['16x16.png', '22x22.png', '24x24.png', '32x32.png', dir = s.split('.')[0] ext = s.split('.')[1] install_data(join_paths('desktop', dir, 'aegisub.' + ext), - install_dir : join_paths(get_option('datadir'), 'icons', 'hicolor', dir)) + install_dir : join_paths(get_option('datadir'), 'icons', 'hicolor', dir, 'apps')) endforeach From a6076ed580b6864a3ee357dec88e928e7c4d255e Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Thu, 22 Feb 2018 18:02:04 +0100 Subject: [PATCH 075/271] Always build git_version.sh --- build/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/build/meson.build b/build/meson.build index c0cdd8122..85cc9f92c 100644 --- a/build/meson.build +++ b/build/meson.build @@ -2,4 +2,5 @@ version_sh = find_program('./version.sh') version_inc = include_directories('.') version_h = custom_target('git_version.h', command : [version_sh, meson.source_root()], + build_always : true, # has internal check whether target file will be refreshed output : ['git_version.h', 'git_version.xml']) From 2f13615342bd67e3462d7cb28f23af9d5ae199e7 Mon Sep 17 00:00:00 2001 From: line0 Date: Sun, 27 Jan 2019 20:48:16 +0100 Subject: [PATCH 076/271] add powershell version of build/version.sh --- build/version.ps1 | 89 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 build/version.ps1 diff --git a/build/version.ps1 b/build/version.ps1 new file mode 100644 index 000000000..8a1769356 --- /dev/null +++ b/build/version.ps1 @@ -0,0 +1,89 @@ +$lastSvnRevision = 6962 +$lastSvnHash = '16cd907fe7482cb54a7374cd28b8501f138116be' +$defineNumberMatch = [regex] '^#define\s+(\w+)\s+(\d+)$' +$defineStringMatch = [regex] "^#define\s+(\w+)\s+[`"']?(.+?)[`"']?$" +$semVerMatch = [regex] 'v?(\d+)\.(\d+).(\d+)(?:-(\w+))?' + +if (!(git rev-parse --is-inside-work-tree 2>$null)) { + throw 'git repo not found' +} + +$repositoryRootPath = git rev-parse --git-path . | Join-Path -ChildPath .. | Resolve-Path +$buildPath = Join-Path $repositoryRootPath 'build' +$gitVersionHeaderPath = Join-Path $buildPath 'git_version.h' +$gitVersionXmlPath = Join-Path $buildPath 'git_version.xml' + +if (!(Test-Path $gitVersionHeaderPath)) { + throw "missing git_version.h in ${buildPath}" +} + +$version = @{} +Get-Content $gitVersionHeaderPath | %{$_.Trim()} | ?{$_} | %{ + switch -regex ($_) { + $defineNumberMatch { + $version[$Matches[1]] = [int]$Matches[2]; + } + $defineStringMatch { + $version[$Matches[1]] = $Matches[2]; + } + } +} + +if(!($version.ContainsKey('BUILD_GIT_VERSION_NUMBER') -and $version.ContainsKey('BUILD_GIT_VERSION_STRING'))) { + throw 'invalid git_version.h' +} + +$gitRevision = $lastSvnRevision + ((git log --pretty=oneline "$($lastSvnHash)..HEAD" 2>$null | Measure-Object).Count) +$gitBranch = git symbolic-ref --short HEAD 2>$null +$gitHash = git rev-parse --short HEAD 2>$null +$gitVersionString = $gitRevision, $gitBranch, $gitHash -join '-' +$exactGitTag = git describe --exact-match --tags 2>$null + +if ($exactGitTag -match $semVerMatch) { + $version['TAGGED_RELEASE'] = $true + $version['RESOURCE_BASE_VERSION'] = $Matches[1..3] + $version['INSTALLER_VERSION'] = $gitVersionString = ($Matches[1..3] -join '.') + @("-$($Matches[4])",'')[!$Matches[4]] +} else { + foreach ($rev in (git rev-list --tags 2>$null)) { + $tag = git describe --exact-match --tags $rev 2>$null + if ($tag -match $semVerMatch) {# + $version['TAGGED_RELEASE'] = $false + $version['RESOURCE_BASE_VERSION'] = $Matches[1..3] + $gitRevision + $version['INSTALLER_VERSION'] = ($Matches[1..3] -join '.') + "-" + $gitBranch + break; + } + } +} + +$version['BUILD_GIT_VERSION_NUMBER'] = $gitRevision +$version['BUILD_GIT_VERSION_STRING'] = $gitVersionString + +$version.GetEnumerator() | %{ + $type = $_.Value.GetType() + $value = $_.Value + $fmtValue = switch ($type) { + ([string]) {"`"$value`""} + ([int]) {$value.ToString()} + ([bool]) {([int]$value).ToString()} + ([object[]]) {$value -join ', '} + default { + Write-Host "no format known for type '$type' - trying default string conversion" -ForegroundColor Red + {"`"$($value.ToString())`""} + } + } + "#define $($_.Key) $($fmtValue)" +} | Out-File -FilePath $gitVersionHeaderPath -Encoding utf8 + +$gitVersionXml = [xml]@' + + + + + + + +'@ + +$gitVersionXml.Project.PropertyGroup.GitVersionNumber = $gitRevision.ToString() +$gitVersionXml.Project.PropertyGroup.GitVersionString = $gitVersionString +$gitVersionXml.Save($gitVersionXmlPath) \ No newline at end of file From c564df55aa90675d4634360469b03d49f963c0ca Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 28 Jan 2019 16:42:31 -0500 Subject: [PATCH 077/271] Bump Meson version Build file was using a now-deprecated property --- build/meson.build | 5 +++-- meson.build | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/meson.build b/build/meson.build index 85cc9f92c..df569be2c 100644 --- a/build/meson.build +++ b/build/meson.build @@ -2,5 +2,6 @@ version_sh = find_program('./version.sh') version_inc = include_directories('.') version_h = custom_target('git_version.h', command : [version_sh, meson.source_root()], - build_always : true, # has internal check whether target file will be refreshed - output : ['git_version.h', 'git_version.xml']) + build_by_default: true, + build_always_stale: true, # has internal check whether target file will be refreshed + output: ['git_version.h', 'git_version.xml']) diff --git a/meson.build b/meson.build index 8df4b7e7a..1681bb1fa 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('Aegisub', ['c', 'cpp'], license : 'BSD-3-Clause', - meson_version : '>=0.41.0', + meson_version : '>=0.47.0', default_options : ['cpp_std=c++11', 'b_lto=true']) subdir('build') From 02a2c12ceece8c8071aeb8cc64ee1eee1afd3e9f Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 28 Jan 2019 16:43:36 -0500 Subject: [PATCH 078/271] Enable version.ps1 on windows version.ps1 itself still has to be modified to support out-of-tree builds --- build/meson.build | 6 +++++- build/version.ps1 | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build/meson.build b/build/meson.build index df569be2c..0240f4671 100644 --- a/build/meson.build +++ b/build/meson.build @@ -1,4 +1,8 @@ -version_sh = find_program('./version.sh') +if host_machine.system() == 'windows' + version_sh = find_program('.\\version.ps1') +else + version_sh = find_program('./version.sh') +endif version_inc = include_directories('.') version_h = custom_target('git_version.h', command : [version_sh, meson.source_root()], diff --git a/build/version.ps1 b/build/version.ps1 index 8a1769356..caea09f02 100644 --- a/build/version.ps1 +++ b/build/version.ps1 @@ -1,3 +1,4 @@ +#!/usr/bin/env powershell $lastSvnRevision = 6962 $lastSvnHash = '16cd907fe7482cb54a7374cd28b8501f138116be' $defineNumberMatch = [regex] '^#define\s+(\w+)\s+(\d+)$' @@ -86,4 +87,4 @@ $gitVersionXml = [xml]@' $gitVersionXml.Project.PropertyGroup.GitVersionNumber = $gitRevision.ToString() $gitVersionXml.Project.PropertyGroup.GitVersionString = $gitVersionString -$gitVersionXml.Save($gitVersionXmlPath) \ No newline at end of file +$gitVersionXml.Save($gitVersionXmlPath) From 68f58431179bc037fbf52393d94f1b9862ac103e Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 28 Jan 2019 16:44:07 -0500 Subject: [PATCH 079/271] Don't require fontconfig on windows --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1681bb1fa..9f5536e3a 100644 --- a/meson.build +++ b/meson.build @@ -19,7 +19,7 @@ deps = [] if host_machine.system() == 'darwin' add_languages('objc') -else +elif host_machine.system() != 'windows' deps += dependency('fontconfig', static: b_static) endif From cde5778283f8923f59c32752a8b2279595b03e45 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Wed, 30 Jan 2019 16:58:31 -0500 Subject: [PATCH 080/271] Make spacing around colons consistent --- automation/meson.build | 8 +++---- build/meson.build | 2 +- libaegisub/meson.build | 6 ++--- meson.build | 50 ++++++++++++++++++++-------------------- packages/meson.build | 12 +++++----- po/meson.build | 2 +- src/libresrc/meson.build | 24 +++++++++---------- src/meson.build | 12 +++++----- 8 files changed, 58 insertions(+), 58 deletions(-) diff --git a/automation/meson.build b/automation/meson.build index baf3b2615..ac3a2c85f 100644 --- a/automation/meson.build +++ b/automation/meson.build @@ -8,13 +8,13 @@ install_data( 'autoload/macro-2-mkfullwitdh.lua', 'autoload/select-overlaps.moon', 'autoload/strip-tags.lua', - install_dir : join_paths(automation_dir, 'autoload')) + install_dir: join_paths(automation_dir, 'autoload')) install_data( 'demos/future-windy-blur.lua', 'demos/raytracer.lua', 'demos/raytracer-test1.ass', - install_dir : join_paths(automation_dir, 'demos')) + install_dir: join_paths(automation_dir, 'demos')) install_data( 'include/cleantags.lua', @@ -27,7 +27,7 @@ install_data( 'include/unicode.lua', 'include/utils-auto4.lua', 'include/utils.lua', - install_dir : join_paths(automation_dir, 'include')) + install_dir: join_paths(automation_dir, 'include')) install_data( 'include/aegisub/argcheck.moon', @@ -37,4 +37,4 @@ install_data( 'include/aegisub/re.moon', 'include/aegisub/unicode.moon', 'include/aegisub/util.moon', - install_dir : join_paths(automation_dir, 'include', 'aegisub')) + install_dir: join_paths(automation_dir, 'include', 'aegisub')) diff --git a/build/meson.build b/build/meson.build index 0240f4671..d1699bc4c 100644 --- a/build/meson.build +++ b/build/meson.build @@ -5,7 +5,7 @@ else endif version_inc = include_directories('.') version_h = custom_target('git_version.h', - command : [version_sh, meson.source_root()], + command: [version_sh, meson.source_root()], build_by_default: true, build_always_stale: true, # has internal check whether target file will be refreshed output: ['git_version.h', 'git_version.xml']) diff --git a/libaegisub/meson.build b/libaegisub/meson.build index 1752ff688..a02cc8750 100644 --- a/libaegisub/meson.build +++ b/libaegisub/meson.build @@ -83,6 +83,6 @@ libaegisub_cpp_pch = ['lagi_pre.h'] libaegisub_inc = include_directories('include') libaegisub = static_library('aegisub', libaegisub_src, acconf, - include_directories : libaegisub_inc, - cpp_pch : 'include/lagi_pre.h', - dependencies : deps) + include_directories: libaegisub_inc, + cpp_pch: 'include/lagi_pre.h', + dependencies: deps) diff --git a/meson.build b/meson.build index 9f5536e3a..139132c13 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,11 @@ -project('Aegisub', ['c', 'cpp'], license : 'BSD-3-Clause', - meson_version : '>=0.47.0', - default_options : ['cpp_std=c++11', 'b_lto=true']) +project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', + meson_version: '>=0.47.0', + default_options: ['cpp_std=c++11', 'b_lto=true']) subdir('build') dataroot = join_paths(get_option('prefix'), get_option('datadir'), 'aegisub') -add_project_arguments('-DP_DATA="@0@"'.format(dataroot), language : 'cpp') +add_project_arguments('-DP_DATA="@0@"'.format(dataroot), language: 'cpp') b_static = get_option('static') conf = configuration_data() @@ -25,20 +25,20 @@ endif cxx = meson.get_compiler('cpp') cc = meson.get_compiler('c') -deps += cc.find_library('m', required : false) -deps += cc.find_library('dl', required : false) -deps += cc.find_library('iconv', required : false) +deps += cc.find_library('m', required: false) +deps += cc.find_library('dl', required: false) +deps += cc.find_library('iconv', required: false) -deps += dependency('libass', version : '>=0.9.7', static: b_static) -deps += dependency('boost', version : '>=1.50.0', static: b_static, - modules : ['chrono', 'filesystem', 'locale', 'regex', - 'system', 'thread']) -deps += dependency('icu-uc', version : '>=4.8.1.1', static: b_static) -deps += dependency('icu-i18n', version : '>=4.8.1.1', static: b_static) +deps += dependency('libass', version: '>=0.9.7', static: b_static) +deps += dependency('boost', version: '>=1.50.0', static: b_static, + modules: ['chrono', 'filesystem', 'locale', 'regex', + 'system', 'thread']) +deps += dependency('icu-uc', version: '>=4.8.1.1', static: b_static) +deps += dependency('icu-i18n', version: '>=4.8.1.1', static: b_static) deps += dependency('zlib', static: b_static) dep_avail = [] -foreach dep : [ +foreach dep: [ # audio, in order of precedence ['libpulse', '', 'PulseAudio'], ['alsa', '', 'ALSA'], @@ -51,8 +51,8 @@ foreach dep : [ ['hunspell', '', 'Hunspell'], ['uchardet', '', 'uchardet'], ] - d = dependency(dep[0], version : dep[1] != '' ? dep[1] : '>=0', - required : false, static: b_static) + d = dependency(dep[0], version: dep[1] != '' ? dep[1]: '>=0', + required: false, static: b_static) optname = 'enable_@0@'.format(dep[0].split('-')[0]) if d.found() and get_option(optname) != 'false' @@ -80,7 +80,7 @@ endif conf_platform = configuration_data() conf_platform.set('DEFAULT_PLAYER_AUDIO', def_audio) -luajit = dependency('luajit', version : '>=2.0.0', required : get_option('system_luajit')) +luajit = dependency('luajit', version: '>=2.0.0', required: get_option('system_luajit')) if luajit.found() luajit_test = cc.run('''#include int main(void) @@ -90,7 +90,7 @@ int main(void) // This is valid in lua 5.2, but a syntax error in 5.1 const char testprogram[] = "function foo() while true do break return end end"; return luaL_loadstring(L, testprogram) == LUA_ERRSYNTAX; -}''', dependencies : luajit) +}''', dependencies: luajit) if luajit_test.returncode() == 1 if get_option('system_luajit') @@ -114,19 +114,19 @@ else endif subdir('vendor/luabins/src') -deps += dependency('wxWidgets', version : '>=3.0.0', - modules : ['std', 'stc', 'gl']) +deps += dependency('wxWidgets', version: '>=3.0.0', + modules: ['std', 'stc', 'gl']) -dep_gl = dependency('gl', required : false) +dep_gl = dependency('gl', required: false) if not dep_gl.found() if host_machine.system() == 'windows' - dep_gl = cc.find_library('opengl32', required : false) + dep_gl = cc.find_library('opengl32', required: false) else - dep_gl = cc.find_library('GL', required : false) + dep_gl = cc.find_library('GL', required: false) endif if not cc.has_header('GL/gl.h') - dep_gl = dependency('', required : false) + dep_gl = dependency('', required: false) endif endif @@ -136,7 +136,7 @@ endif deps += dep_gl -acconf = configure_file(output : 'acconf.h', configuration : conf) +acconf = configure_file(output: 'acconf.h', configuration: conf) subdir('automation') subdir('libaegisub') diff --git a/packages/meson.build b/packages/meson.build index 30ba88c6e..3be1d6301 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -4,16 +4,16 @@ c_pkg.set('AEGISUB_COMMAND', 'aegisub') if host_machine.system() == 'windows' elif host_machine.system() == 'darwin' else - configure_file(input : 'desktop/aegisub.desktop.template.in', - output : 'aegisub.desktop', - configuration : c_pkg, - install_dir : join_paths(get_option('datadir'), 'applications')) + configure_file(input: 'desktop/aegisub.desktop.template.in', + output: 'aegisub.desktop', + configuration: c_pkg, + install_dir: join_paths(get_option('datadir'), 'applications')) endif -foreach s : ['16x16.png', '22x22.png', '24x24.png', '32x32.png', +foreach s: ['16x16.png', '22x22.png', '24x24.png', '32x32.png', '48x48.png', '64x64.png', 'scalable.svg'] dir = s.split('.')[0] ext = s.split('.')[1] install_data(join_paths('desktop', dir, 'aegisub.' + ext), - install_dir : join_paths(get_option('datadir'), 'icons', 'hicolor', dir, 'apps')) + install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', dir, 'apps')) endforeach diff --git a/po/meson.build b/po/meson.build index 8b2f65bf6..48bded975 100644 --- a/po/meson.build +++ b/po/meson.build @@ -31,4 +31,4 @@ langs = [ 'zh_TW', ] -i18n.gettext('aegisub', languages : langs) +i18n.gettext('aegisub', languages: langs) diff --git a/src/libresrc/meson.build b/src/libresrc/meson.build index b0392dc54..9c4ab499e 100644 --- a/src/libresrc/meson.build +++ b/src/libresrc/meson.build @@ -2,27 +2,27 @@ respack = find_program('../../tools/respack.py') resrc = [ custom_target('bitmap.{cpp,h}', - command : [respack, '@INPUT@', '@OUTPUT@'], - input : files('../bitmaps/manifest.respack'), - output : ['bitmap.cpp', 'bitmap.h']) + command: [respack, '@INPUT@', '@OUTPUT@'], + input: files('../bitmaps/manifest.respack'), + output: ['bitmap.cpp', 'bitmap.h']) ] conf_platform_json = configure_file(input: 'default_config_platform.json.in', - output : '@BASENAME@', - configuration : conf_platform) + output: '@BASENAME@', + configuration: conf_platform) if host_machine.system() == 'darwin' resrc += custom_target('default_config.{cpp,h}', - command : [respack, '@INPUT0@', '@OUTPUT@'], - input : [files('manifest_osx.respack'), conf_platform_json], - output : ['default_config.cpp', 'default_config.h']) + command: [respack, '@INPUT0@', '@OUTPUT@'], + input: [files('manifest_osx.respack'), conf_platform_json], + output: ['default_config.cpp', 'default_config.h']) else resrc += custom_target('default_config.{cpp,h}', - command : [respack, '@INPUT0@', '@OUTPUT@'], - input : [files('manifest.respack'), conf_platform_json], - output : ['default_config.cpp', 'default_config.h']) + command: [respack, '@INPUT0@', '@OUTPUT@'], + input: [files('manifest.respack'), conf_platform_json], + output: ['default_config.cpp', 'default_config.h']) endif libresrc_inc = include_directories('.') -libresrc = static_library('resrc', 'libresrc.cpp', resrc, dependencies : deps) +libresrc = static_library('resrc', 'libresrc.cpp', resrc, dependencies: deps) diff --git a/src/meson.build b/src/meson.build index 939978f4b..df94b4b6f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -189,15 +189,15 @@ opt_src = [ ['Hunspell', 'spellchecker_hunspell.cpp'], ] -foreach opt : opt_src +foreach opt: opt_src if dep_avail.contains(opt[0]) aegisub_src += opt[1] endif endforeach aegisub = executable('aegisub', aegisub_src, version_h, acconf, - link_with : [libresrc, libluabins, libaegisub], - include_directories : [libaegisub_inc, libresrc_inc, version_inc], - cpp_pch : 'include/agi_pre.h', - install : true, - dependencies : deps) + link_with: [libresrc, libluabins, libaegisub], + include_directories: [libaegisub_inc, libresrc_inc, version_inc], + cpp_pch: 'include/agi_pre.h', + install: true, + dependencies: deps) From 83fcab07755699f7af16046ffc0b60737e7659b3 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Wed, 30 Jan 2019 17:07:39 -0500 Subject: [PATCH 081/271] Switch to newer path concatenation syntax --- automation/meson.build | 10 +++++----- meson.build | 4 ++-- packages/meson.build | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/automation/meson.build b/automation/meson.build index ac3a2c85f..fff6b45c1 100644 --- a/automation/meson.build +++ b/automation/meson.build @@ -1,4 +1,4 @@ -automation_dir = join_paths(get_option('datadir'), 'aegisub', 'automation') +automation_dir = get_option('datadir') / 'aegisub' / 'automation' install_data( 'autoload/cleantags-autoload.lua', @@ -8,13 +8,13 @@ install_data( 'autoload/macro-2-mkfullwitdh.lua', 'autoload/select-overlaps.moon', 'autoload/strip-tags.lua', - install_dir: join_paths(automation_dir, 'autoload')) + install_dir: automation_dir / 'autoload') install_data( 'demos/future-windy-blur.lua', 'demos/raytracer.lua', 'demos/raytracer-test1.ass', - install_dir: join_paths(automation_dir, 'demos')) + install_dir: automation_dir / 'demos') install_data( 'include/cleantags.lua', @@ -27,7 +27,7 @@ install_data( 'include/unicode.lua', 'include/utils-auto4.lua', 'include/utils.lua', - install_dir: join_paths(automation_dir, 'include')) + install_dir: automation_dir / 'include') install_data( 'include/aegisub/argcheck.moon', @@ -37,4 +37,4 @@ install_data( 'include/aegisub/re.moon', 'include/aegisub/unicode.moon', 'include/aegisub/util.moon', - install_dir: join_paths(automation_dir, 'include', 'aegisub')) + install_dir: automation_dir / 'include' / 'aegisub') diff --git a/meson.build b/meson.build index 139132c13..f87aa28a0 100644 --- a/meson.build +++ b/meson.build @@ -1,10 +1,10 @@ project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', - meson_version: '>=0.47.0', + meson_version: '>=0.49.0', default_options: ['cpp_std=c++11', 'b_lto=true']) subdir('build') -dataroot = join_paths(get_option('prefix'), get_option('datadir'), 'aegisub') +dataroot = get_option('prefix') / get_option('datadir') / 'aegisub' add_project_arguments('-DP_DATA="@0@"'.format(dataroot), language: 'cpp') b_static = get_option('static') diff --git a/packages/meson.build b/packages/meson.build index 3be1d6301..799f4ff68 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -7,13 +7,13 @@ else configure_file(input: 'desktop/aegisub.desktop.template.in', output: 'aegisub.desktop', configuration: c_pkg, - install_dir: join_paths(get_option('datadir'), 'applications')) + install_dir: get_option('datadir') / 'applications') endif foreach s: ['16x16.png', '22x22.png', '24x24.png', '32x32.png', '48x48.png', '64x64.png', 'scalable.svg'] dir = s.split('.')[0] ext = s.split('.')[1] - install_data(join_paths('desktop', dir, 'aegisub.' + ext), - install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', dir, 'apps')) + install_data('desktop' / dir / 'aegisub.' + ext), + install_dir: get_option('datadir') / 'icons' / 'hicolor' / dir / 'apps') endforeach From ddd6a4f289831a684e837fcdf0a040ead9e307bc Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Wed, 30 Jan 2019 17:47:33 -0500 Subject: [PATCH 082/271] Move version generation scripts up a level --- build/meson.build | 11 ----------- meson.build | 12 +++++++++++- build/version.ps1 => version.ps1 | 0 build/version.sh => version.sh | 0 4 files changed, 11 insertions(+), 12 deletions(-) delete mode 100644 build/meson.build rename build/version.ps1 => version.ps1 (100%) rename build/version.sh => version.sh (100%) mode change 100755 => 100644 diff --git a/build/meson.build b/build/meson.build deleted file mode 100644 index d1699bc4c..000000000 --- a/build/meson.build +++ /dev/null @@ -1,11 +0,0 @@ -if host_machine.system() == 'windows' - version_sh = find_program('.\\version.ps1') -else - version_sh = find_program('./version.sh') -endif -version_inc = include_directories('.') -version_h = custom_target('git_version.h', - command: [version_sh, meson.source_root()], - build_by_default: true, - build_always_stale: true, # has internal check whether target file will be refreshed - output: ['git_version.h', 'git_version.xml']) diff --git a/meson.build b/meson.build index f87aa28a0..11204c887 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,17 @@ project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', meson_version: '>=0.49.0', default_options: ['cpp_std=c++11', 'b_lto=true']) -subdir('build') +if host_machine.system() == 'windows' + version_sh = find_program('version.ps1') +else + version_sh = find_program('version.sh') +endif +version_inc = include_directories('.') +version_h = custom_target('git_version.h', + command: [version_sh, meson.source_root()], + build_by_default: true, + build_always_stale: true, # has internal check whether target file will be refreshed + output: ['git_version.h', 'git_version.xml']) dataroot = get_option('prefix') / get_option('datadir') / 'aegisub' add_project_arguments('-DP_DATA="@0@"'.format(dataroot), language: 'cpp') diff --git a/build/version.ps1 b/version.ps1 similarity index 100% rename from build/version.ps1 rename to version.ps1 diff --git a/build/version.sh b/version.sh old mode 100755 new mode 100644 similarity index 100% rename from build/version.sh rename to version.sh From 3b7724aab49f33328cc33c21c7ebca47b1809b3c Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Wed, 30 Jan 2019 18:33:39 -0500 Subject: [PATCH 083/271] Fix spacing around colons in luajit subproject files --- vendor/luabins/src/meson.build | 2 +- vendor/luajit/meson.build | 22 +++++++++++----------- vendor/luajit/src/host/meson.build | 20 ++++++++++---------- vendor/luajit/src/meson.build | 16 ++++++++-------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/vendor/luabins/src/meson.build b/vendor/luabins/src/meson.build index d785e3ba5..3861eb6d2 100644 --- a/vendor/luabins/src/meson.build +++ b/vendor/luabins/src/meson.build @@ -8,4 +8,4 @@ luabins_src = files( 'write.c', ) -libluabins = static_library('luabins', luabins_src, include_directories : luajit_inc) +libluabins = static_library('luabins', luabins_src, include_directories: luajit_inc) diff --git a/vendor/luajit/meson.build b/vendor/luajit/meson.build index 9338096ce..38b2f9743 100644 --- a/vendor/luajit/meson.build +++ b/vendor/luajit/meson.build @@ -1,31 +1,31 @@ -project('luajit', 'c', version : '2.0.4', license : 'MIT') +project('luajit', 'c', version: '2.0.4', license: 'MIT') cc = meson.get_compiler('c') system_deps = [ - cc.find_library('dl', required : false), - cc.find_library('m', required : false) + cc.find_library('dl', required: false), + cc.find_library('m', required: false) ] system_deps_native = [ - cc.find_library('dl', required : false, native : true), - cc.find_library('m', required : false, native : true) + cc.find_library('dl', required: false, native: true), + cc.find_library('m', required: false, native: true) ] -add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', language : 'c') +add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', language: 'c') if host_machine.system() == 'linux' - add_project_arguments('-DLUAJIT_USE_LINUX', language : 'c') + add_project_arguments('-DLUAJIT_USE_LINUX', language: 'c') readline_dep = cc.find_library('readline') ljvm_mode = 'elfasm' ljvm_bout = 'lj_vm.s' elif host_machine.system() == 'darwin' - add_project_arguments(['-DLUAJIT_USE_MACOSX'], language : 'c') + add_project_arguments(['-DLUAJIT_USE_MACOSX'], language: 'c') readline_dep = cc.find_library('readline') ljvm_mode = 'machasm' ljvm_bout = 'lj_vm.s' elif host_machine.system() == 'windows' add_project_arguments('-DLUAJIT_USE_WINDOWS', '-DWIN', - '-malign-double', language : 'c') + '-malign-double', language: 'c') readline_dep = [] ljvm_mode = 'peobj' ljvm_bout = 'lj_vm.o' @@ -38,5 +38,5 @@ incdir = include_directories('include') subdir('src') -luajit_dep = declare_dependency(link_with : luajit_lib, - include_directories : incdir) +luajit_dep = declare_dependency(link_with: luajit_lib, + include_directories: incdir) diff --git a/vendor/luajit/src/host/meson.build b/vendor/luajit/src/host/meson.build index 2e43a8e5c..eca091c46 100644 --- a/vendor/luajit/src/host/meson.build +++ b/vendor/luajit/src/host/meson.build @@ -1,6 +1,6 @@ minilua = executable('minilua', 'minilua.c', - dependencies : system_deps_native, - native : true) + dependencies: system_deps_native, + native: true) if host_machine.cpu_family() == 'x86_64' dynasm_arch = 'x86' @@ -25,8 +25,8 @@ if host_machine.cpu_family() == 'x86' checkdefs += ['__SSE2__', '1', ['-D', 'SSE']] endif -foreach def : checkdefs - if cc.get_define(def[0], prefix : hpre) == def[1] +foreach def: checkdefs + if cc.get_define(def[0], prefix: hpre) == def[1] dasm += def[2] endif endforeach @@ -40,11 +40,11 @@ buildvm_src = files( ) buildvm_arch = custom_target('buildvm_arch.h', - command : dasm + ['-o', '@OUTPUT@', '@INPUT@'], - input : dynasm_dasc, - output : 'buildvm_arch.h') + command: dasm + ['-o', '@OUTPUT@', '@INPUT@'], + input: dynasm_dasc, + output: 'buildvm_arch.h') buildvm = executable('buildvm', buildvm_src, buildvm_arch, - dependencies : system_deps_native, - include_directories : src_inc, - native : true) + dependencies: system_deps_native, + include_directories: src_inc, + native: true) diff --git a/vendor/luajit/src/meson.build b/vendor/luajit/src/meson.build index 7027ec24f..a2224c393 100644 --- a/vendor/luajit/src/meson.build +++ b/vendor/luajit/src/meson.build @@ -77,19 +77,19 @@ hdrgen = [ ] genheaders = [] -foreach h : hdrgen +foreach h: hdrgen genheaders += custom_target(h, - command : [buildvm, '-m', h, '-o', '@OUTPUT@', ljlib_src], - output : 'lj_@0@.h'.format(h)) + command: [buildvm, '-m', h, '-o', '@OUTPUT@', ljlib_src], + output: 'lj_@0@.h'.format(h)) endforeach genheaders += custom_target('folddef', - command : [buildvm, '-m', 'folddef', '-o', '@OUTPUT@', files('lj_opt_fold.c')], - output : 'lj_folddef.h') + command: [buildvm, '-m', 'folddef', '-o', '@OUTPUT@', files('lj_opt_fold.c')], + output: 'lj_folddef.h') ljvm = custom_target(ljvm_bout, - command : [buildvm, '-m', ljvm_mode, '-o', '@OUTPUT@'], - output : ljvm_bout) + command: [buildvm, '-m', ljvm_mode, '-o', '@OUTPUT@'], + output: ljvm_bout) luajit_lib = static_library('luajit', ljlib_src, ljcore_src, genheaders, ljvm, - dependencies : system_deps) + dependencies: system_deps) From f361138a4daab0bfed7f3b3d0610bafa85f1b7e5 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Fri, 1 Feb 2019 13:03:57 -0500 Subject: [PATCH 084/271] Switch from combo option to feature where appropriate Also remove the extra space before colons :) --- meson.build | 4 ++-- meson_options.txt | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/meson.build b/meson.build index 11204c887..1a48dfc51 100644 --- a/meson.build +++ b/meson.build @@ -65,11 +65,11 @@ foreach dep: [ required: false, static: b_static) optname = 'enable_@0@'.format(dep[0].split('-')[0]) - if d.found() and get_option(optname) != 'false' + if d.found() and get_option(optname) != 'disabled' deps += d conf.set('WITH_@0@'.format(dep[0].split('-')[0].to_upper()), '1') dep_avail += dep[2] - elif get_option(optname) == 'true' + elif get_option(optname) == 'enabled' error('@0@ enabled but not found'.format(dep[2])) endif endforeach diff --git a/meson_options.txt b/meson_options.txt index 690d080c1..f80de7e63 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,21 +1,21 @@ -option('static', type : 'boolean', value : false, description : 'Build statically linked executable') +option('static', type: 'boolean', value: false, description: 'Build statically linked executable') -option('enable_alsa', type : 'combo', choices : ['auto', 'true', 'false'], description : 'ALSA audio output') -option('enable_openal', type : 'combo', choices : ['auto', 'true', 'false'], description : 'OpenAL audio output') -option('enable_libpulse', type : 'combo', choices : ['auto', 'true', 'false'], description : 'PulseAudio audio output') -option('enable_portaudio', type : 'combo', choices : ['auto', 'true', 'false'], description : 'PortAudio audio output') -option('default_audio_output', type : 'combo', choices : ['auto', 'ALSA', 'OpenAL', 'PulseAudio', 'PortAudio'], description : 'Default audio output') +option('enable_alsa', type: 'feature', description: 'ALSA audio output') +option('enable_openal', type: 'feature', description: 'OpenAL audio output') +option('enable_libpulse', type: 'feature', description: 'PulseAudio audio output') +option('enable_portaudio', type: 'feature', description: 'PortAudio audio output') +option('default_audio_output', type: 'combo', choices: ['auto', 'ALSA', 'OpenAL', 'PulseAudio', 'PortAudio'], description: 'Default audio output') -option('enable_ffms2', type : 'combo', choices : ['auto', 'true', 'false'], description : 'FFMS2 video source') +option('enable_ffms2', type: 'feature', description: 'FFMS2 video source') -option('enable_fftw3', type : 'combo', choices : ['auto', 'true', 'false'], description : 'FFTW3 support') -option('enable_hunspell', type : 'combo', choices : ['auto', 'true', 'false'], description : 'Hunspell spell checker') -option('enable_uchardet', type : 'combo', choices : ['auto', 'true', 'false'], description : 'uchardet character encoding detection') +option('enable_fftw3', type: 'feature', description: 'FFTW3 support') +option('enable_hunspell', type: 'feature', description: 'Hunspell spell checker') +option('enable_uchardet', type: 'feature', description: 'uchardet character encoding detection') -option('system_luajit', type : 'boolean', value : false, description : 'Force using system luajit') +option('system_luajit', type: 'boolean', value: false, description: 'Force using system luajit') -option('build_credit', type : 'string', value : '', description : 'Build credit shown in program title') +option('build_credit', type: 'string', value: '', description: 'Build credit shown in program title') -option('enable_update_checker', type : 'boolean', value : false, description : 'Enable the update checker') -option('update_server', type : 'string', value : 'updates.aegisub.org', description : 'Server to use for the update checker') -option('update_url', type : 'string', value : '/trunk', description : 'Base path to use for the update checker') +option('enable_update_checker', type: 'boolean', value: false, description: 'Enable the update checker') +option('update_server', type: 'string', value: 'updates.aegisub.org', description: 'Server to use for the update checker') +option('update_url', type: 'string', value: '/trunk', description: 'Base path to use for the update checker') From 7596a7c5e45d04c1b3a25a8d929ff4c13ea58a81 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 9 Feb 2019 18:26:50 -0500 Subject: [PATCH 085/271] meson: remove 'static' option --- meson.build | 18 ++++++++++-------- meson_options.txt | 2 -- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 1a48dfc51..7e99ac304 100644 --- a/meson.build +++ b/meson.build @@ -16,7 +16,6 @@ version_h = custom_target('git_version.h', dataroot = get_option('prefix') / get_option('datadir') / 'aegisub' add_project_arguments('-DP_DATA="@0@"'.format(dataroot), language: 'cpp') -b_static = get_option('static') conf = configuration_data() conf.set_quoted('P_DATA', dataroot) @@ -30,7 +29,7 @@ deps = [] if host_machine.system() == 'darwin' add_languages('objc') elif host_machine.system() != 'windows' - deps += dependency('fontconfig', static: b_static) + deps += dependency('fontconfig') endif cxx = meson.get_compiler('cpp') @@ -39,13 +38,16 @@ deps += cc.find_library('m', required: false) deps += cc.find_library('dl', required: false) deps += cc.find_library('iconv', required: false) -deps += dependency('libass', version: '>=0.9.7', static: b_static) -deps += dependency('boost', version: '>=1.50.0', static: b_static, +deps += dependency('libass', version: '>=0.9.7') +deps += dependency('boost', version: '>=1.50.0', modules: ['chrono', 'filesystem', 'locale', 'regex', 'system', 'thread']) -deps += dependency('icu-uc', version: '>=4.8.1.1', static: b_static) -deps += dependency('icu-i18n', version: '>=4.8.1.1', static: b_static) -deps += dependency('zlib', static: b_static) +deps += dependency('zlib') + +icu_uc_dep = dependency('icu-uc', version: '>=4.8.1.1') +deps += icu_uc_dep +icu_i18n_dep = dependency('icu-i18n', version: '>=4.8.1.1') +deps += icu_i18n_dep dep_avail = [] foreach dep: [ @@ -62,7 +64,7 @@ foreach dep: [ ['uchardet', '', 'uchardet'], ] d = dependency(dep[0], version: dep[1] != '' ? dep[1]: '>=0', - required: false, static: b_static) + required: false) optname = 'enable_@0@'.format(dep[0].split('-')[0]) if d.found() and get_option(optname) != 'disabled' diff --git a/meson_options.txt b/meson_options.txt index f80de7e63..a28feb701 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,3 @@ -option('static', type: 'boolean', value: false, description: 'Build statically linked executable') - option('enable_alsa', type: 'feature', description: 'ALSA audio output') option('enable_openal', type: 'feature', description: 'OpenAL audio output') option('enable_libpulse', type: 'feature', description: 'PulseAudio audio output') From 613cef19a0fd7fd3e5bc2c789911e65cea6ed294 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 9 Feb 2019 18:28:32 -0500 Subject: [PATCH 086/271] meson: rename option for optional dependencies --- meson.build | 4 ++-- meson_options.txt | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 7e99ac304..77e64573f 100644 --- a/meson.build +++ b/meson.build @@ -67,11 +67,11 @@ foreach dep: [ required: false) optname = 'enable_@0@'.format(dep[0].split('-')[0]) - if d.found() and get_option(optname) != 'disabled' + if d.found() and not get_option(optname).disabled() deps += d conf.set('WITH_@0@'.format(dep[0].split('-')[0].to_upper()), '1') dep_avail += dep[2] - elif get_option(optname) == 'enabled' + elif get_option(optname).enabled() error('@0@ enabled but not found'.format(dep[2])) endif endforeach diff --git a/meson_options.txt b/meson_options.txt index a28feb701..80e0ddf73 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,14 +1,14 @@ -option('enable_alsa', type: 'feature', description: 'ALSA audio output') -option('enable_openal', type: 'feature', description: 'OpenAL audio output') -option('enable_libpulse', type: 'feature', description: 'PulseAudio audio output') -option('enable_portaudio', type: 'feature', description: 'PortAudio audio output') +option('alsa', type: 'feature', description: 'ALSA audio output') +option('openal', type: 'feature', description: 'OpenAL audio output') +option('libpulse', type: 'feature', description: 'PulseAudio audio output') +option('portaudio', type: 'feature', description: 'PortAudio audio output') option('default_audio_output', type: 'combo', choices: ['auto', 'ALSA', 'OpenAL', 'PulseAudio', 'PortAudio'], description: 'Default audio output') -option('enable_ffms2', type: 'feature', description: 'FFMS2 video source') +option('ffms2', type: 'feature', description: 'FFMS2 video source') -option('enable_fftw3', type: 'feature', description: 'FFTW3 support') -option('enable_hunspell', type: 'feature', description: 'Hunspell spell checker') -option('enable_uchardet', type: 'feature', description: 'uchardet character encoding detection') +option('fftw3', type: 'feature', description: 'FFTW3 support') +option('hunspell', type: 'feature', description: 'Hunspell spell checker') +option('uchardet', type: 'feature', description: 'uchardet character encoding detection') option('system_luajit', type: 'boolean', value: false, description: 'Force using system luajit') From 936b39303d09d5681ebe6c7b4bf0408b472282d3 Mon Sep 17 00:00:00 2001 From: line0 Date: Tue, 12 Feb 2019 00:57:00 +0100 Subject: [PATCH 087/271] PowerShell version script: work correctly from any cwd; do not error out when version.h doesn't already exist; adjust git_version.h and git_version.xml paths for meson build system --- version.ps1 | 50 +++++++++++++++++++++++--------------------------- version.sh | 0 2 files changed, 23 insertions(+), 27 deletions(-) mode change 100644 => 100755 version.sh diff --git a/version.ps1 b/version.ps1 index caea09f02..03d02dbef 100644 --- a/version.ps1 +++ b/version.ps1 @@ -5,48 +5,44 @@ $defineNumberMatch = [regex] '^#define\s+(\w+)\s+(\d+)$' $defineStringMatch = [regex] "^#define\s+(\w+)\s+[`"']?(.+?)[`"']?$" $semVerMatch = [regex] 'v?(\d+)\.(\d+).(\d+)(?:-(\w+))?' -if (!(git rev-parse --is-inside-work-tree 2>$null)) { - throw 'git repo not found' + +$repositoryRootPath = Join-Path $PSScriptRoot .. | Resolve-Path +if (!(git -C $repositoryRootPath rev-parse --is-inside-work-tree 2>$null)) { + throw "$repositoryRootPath is not a git repository" } -$repositoryRootPath = git rev-parse --git-path . | Join-Path -ChildPath .. | Resolve-Path -$buildPath = Join-Path $repositoryRootPath 'build' -$gitVersionHeaderPath = Join-Path $buildPath 'git_version.h' -$gitVersionXmlPath = Join-Path $buildPath 'git_version.xml' - -if (!(Test-Path $gitVersionHeaderPath)) { - throw "missing git_version.h in ${buildPath}" -} +$gitVersionHeaderPath = Join-Path $repositoryRootPath 'src' | Join-Path -ChildPath 'include' | Join-Path -ChildPath 'aegisub' ` + | Join-Path -ChildPath 'git_version.h' +$gitVersionXmlPath = Join-Path $repositoryRootPath 'packages' | Join-Path -ChildPath 'win_installer' ` + | Join-Path -ChildPath 'git_version.xml' $version = @{} -Get-Content $gitVersionHeaderPath | %{$_.Trim()} | ?{$_} | %{ - switch -regex ($_) { - $defineNumberMatch { - $version[$Matches[1]] = [int]$Matches[2]; - } - $defineStringMatch { - $version[$Matches[1]] = $Matches[2]; +if (Test-Path $gitVersionHeaderPath) { + Get-Content $gitVersionHeaderPath | %{$_.Trim()} | ?{$_} | %{ + switch -regex ($_) { + $defineNumberMatch { + $version[$Matches[1]] = [int]$Matches[2]; + } + $defineStringMatch { + $version[$Matches[1]] = $Matches[2]; + } } } } -if(!($version.ContainsKey('BUILD_GIT_VERSION_NUMBER') -and $version.ContainsKey('BUILD_GIT_VERSION_STRING'))) { - throw 'invalid git_version.h' -} - -$gitRevision = $lastSvnRevision + ((git log --pretty=oneline "$($lastSvnHash)..HEAD" 2>$null | Measure-Object).Count) -$gitBranch = git symbolic-ref --short HEAD 2>$null -$gitHash = git rev-parse --short HEAD 2>$null +$gitRevision = $lastSvnRevision + ((git -C $repositoryRootPath log --pretty=oneline "$($lastSvnHash)..HEAD" 2>$null | Measure-Object).Count) +$gitBranch = git -C $repositoryRootPath symbolic-ref --short HEAD 2>$null +$gitHash = git -C $repositoryRootPath rev-parse --short HEAD 2>$null $gitVersionString = $gitRevision, $gitBranch, $gitHash -join '-' -$exactGitTag = git describe --exact-match --tags 2>$null +$exactGitTag = git -C $repositoryRootPath describe --exact-match --tags 2>$null if ($exactGitTag -match $semVerMatch) { $version['TAGGED_RELEASE'] = $true $version['RESOURCE_BASE_VERSION'] = $Matches[1..3] $version['INSTALLER_VERSION'] = $gitVersionString = ($Matches[1..3] -join '.') + @("-$($Matches[4])",'')[!$Matches[4]] } else { - foreach ($rev in (git rev-list --tags 2>$null)) { - $tag = git describe --exact-match --tags $rev 2>$null + foreach ($rev in (git -C $repositoryRootPath rev-list --tags 2>$null)) { + $tag = git -C $repositoryRootPath describe --exact-match --tags $rev 2>$null if ($tag -match $semVerMatch) {# $version['TAGGED_RELEASE'] = $false $version['RESOURCE_BASE_VERSION'] = $Matches[1..3] + $gitRevision diff --git a/version.sh b/version.sh old mode 100644 new mode 100755 From c965171663bf73529d3061db330f02c77fd6bb02 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 11 Feb 2019 19:16:48 -0500 Subject: [PATCH 088/271] Remove autotools build system --- Makefile | 12 - Makefile.inc.in | 139 --- Makefile.target | 121 --- acinclude.m4 | 15 - autogen.sh | 7 - automation/Makefile | 28 - config.guess | 1476 ------------------------- config.sub | 1808 ------------------------------- configure.ac | 630 ----------- header.mk | 43 - install-sh | 501 --------- libaegisub/Makefile | 56 - m4macros/ac_agi.m4 | 51 - m4macros/ac_flag.m4 | 56 - m4macros/agi_find_libheader.m4 | 58 - m4macros/ax_boost_base.m4 | 301 ----- m4macros/ax_boost_chrono.m4 | 118 -- m4macros/ax_boost_filesystem.m4 | 118 -- m4macros/ax_boost_locale.m4 | 119 -- m4macros/ax_boost_regex.m4 | 111 -- m4macros/ax_boost_system.m4 | 121 --- m4macros/ax_boost_thread.m4 | 163 --- m4macros/ax_check_gl.m4 | 559 ---------- m4macros/ax_lang_compiler_ms.m4 | 36 - m4macros/ax_pthread.m4 | 332 ------ m4macros/check_gnu_make.m4 | 78 -- m4macros/wxwin.m4 | 1060 ------------------ tests/Makefile | 36 - 28 files changed, 8153 deletions(-) delete mode 100644 Makefile delete mode 100644 Makefile.inc.in delete mode 100644 Makefile.target delete mode 100644 acinclude.m4 delete mode 100755 autogen.sh delete mode 100644 automation/Makefile delete mode 100755 config.guess delete mode 100755 config.sub delete mode 100644 configure.ac delete mode 100644 header.mk delete mode 100755 install-sh delete mode 100644 libaegisub/Makefile delete mode 100644 m4macros/ac_agi.m4 delete mode 100644 m4macros/ac_flag.m4 delete mode 100644 m4macros/agi_find_libheader.m4 delete mode 100644 m4macros/ax_boost_base.m4 delete mode 100644 m4macros/ax_boost_chrono.m4 delete mode 100644 m4macros/ax_boost_filesystem.m4 delete mode 100644 m4macros/ax_boost_locale.m4 delete mode 100644 m4macros/ax_boost_regex.m4 delete mode 100644 m4macros/ax_boost_system.m4 delete mode 100644 m4macros/ax_boost_thread.m4 delete mode 100644 m4macros/ax_check_gl.m4 delete mode 100644 m4macros/ax_lang_compiler_ms.m4 delete mode 100644 m4macros/ax_pthread.m4 delete mode 100644 m4macros/check_gnu_make.m4 delete mode 100644 m4macros/wxwin.m4 delete mode 100644 tests/Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index d3429e3be..000000000 --- a/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -include header.mk - -ifeq (yes, $(BUILD_DARWIN)) -osx-bundle: - $(BIN_SHELL) tools/osx-bundle.sh "$(AEGISUB_COMMAND)" "$(BIN_WX_CONFIG)" "$(FONTCONFIG_CONF_DIR)" DICT_DIR=$(DICT_DIR) - -osx-dmg: osx-bundle - codesign -s 'Mac Developer' --deep Aegisub.app || true - $(BIN_SHELL) tools/osx-dmg.sh "$(BUILD_VERSION_STRING)" -endif - -include Makefile.target diff --git a/Makefile.inc.in b/Makefile.inc.in deleted file mode 100644 index 5f1a4054f..000000000 --- a/Makefile.inc.in +++ /dev/null @@ -1,139 +0,0 @@ -######################### -# AEGISUB FEATURE SUPPORT -######################### -HAVE_ALSA = @with_alsa@ -HAVE_FFMS2 = @with_ffms2@ -HAVE_HUNSPELL = @with_hunspell@ -HAVE_LIBPULSE = @with_libpulse@ -HAVE_OPENAL = @with_openal@ -HAVE_OSS = @with_oss@ -HAVE_PORTAUDIO = @with_portaudio@ -HAVE_UCHARDET = @with_uchardet@ - -############## -# BUILD OUTPUT -############## -PROGRAM := $(PROGRAM) -LIB := $(LIB) - -################### -# PLATFORM SETTINGS -################### -BUILD_DARWIN = @build_darwin@ - -####### -# FLAGS -####### -CFLAGS = @CFLAGS@ -CXXFLAGS = @CXXFLAGS@ -CPPFLAGS = @CPPFLAGS@ -CFLAGS_DEP = -MMD -MP -LIBS = @LIBS@ -LDFLAGS = @LDFLAGS@ -INSTALL_FLAGS = -m 644 -LIB_SHARED_LINK = -shared -Wl,-soname -Wl,$(LIB_SHARED_FULL) -LIB_SHARED_LINK_OSX = -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -compatibility_version $(LIB_VERSION) -current_version $(LIB_VERSION) -Wl,-single_module -mmacosx-version-min=10.8 -install_name ${CURDIR}/$(LIB_SHARED_FULL) - -######### -# STRINGS -######### -AEGISUB_COMMAND = @AEGISUB_COMMAND@ -AEGISUB_CATALOG = @AEGISUB_CATALOG@ -BUILD_DATE = @BUILD_DATE@ -BUILD_VERSION_STRING = @BUILD_GIT_VERSION_STRING@ - -####### -# PATHS -####### -prefix = ${P_PREFIX} -exec_prefix = ${P_PREFIX_EXEC} -datarootdir = ${P_DATAROOT} -P_PREFIX = @prefix@ -P_PREFIX_EXEC = @exec_prefix@ -P_BINDIR = @bindir@ -P_DATAROOT = @datarootdir@ -P_LOCALE = @localedir@ - -P_DESKTOP = @P_DESKTOP@ -P_ICON = @P_ICON@ -P_DATA = $(P_DATAROOT)/aegisub/ - -############### -# LIBRARY FLAGS -############### -CFLAGS_WX = @WX_CFLAGS@ -CXXFLAGS_WX = @WX_CXXFLAGS@ -CPPFLAGS_WX = @WX_CPPFLAGS@ -LIBS_WX = @WX_LIBS@ -lz - -CPPFLAGS_BOOST = @BOOST_CPPFLAGS@ -LIBS_BOOST = @BOOST_LDFLAGS@ @BOOST_FILESYSTEM_LIB@ @BOOST_LOCALE_LIB@ @BOOST_REGEX_LIB@ @BOOST_SYSTEM_LIB@ @BOOST_THREAD_LIB@ @BOOST_CHRONO_LIB@ - -CFLAGS_FFMS2 = @FFMS2_CFLAGS@ -CFLAGS_FFTW3 = @FFTW3_CFLAGS@ -CFLAGS_FONTCONFIG = @FONTCONFIG_CFLAGS@ -CFLAGS_FREETYPE = @FREETYPE_CFLAGS@ -CFLAGS_GL = @GL_CFLAGS@ -CFLAGS_HUNSPELL = @HUNSPELL_CFLAGS@ -CFLAGS_ICONV = @ICONV_CFLAGS@ -CFLAGS_ICU = @ICU_I18N_CFLAGS@ -CFLAGS_LIBASS = @LIBASS_CFLAGS@ -CFLAGS_LIBPULSE = @LIBPULSE_CFLAGS@ -CFLAGS_LUA = @LUAJIT_CFLAGS@ -CFLAGS_OPENAL = @OPENAL_CFLAGS@ -CFLAGS_OSS = @OSS_CFLAGS@ -CFLAGS_PORTAUDIO = @PORTAUDIO_CFLAGS@ -CFLAGS_PTHREAD = @PTHREAD_CFLAGS@ -CFLAGS_UCHARDET = @UCHARDET_CFLAGS@ - -LIBS_ALSA = @ALSA_LIBS@ -LIBS_FFMS2 = @FFMS2_LIBS@ -LIBS_FFTW3 = @FFTW3_LIBS@ -LIBS_FONTCONFIG = @FONTCONFIG_LIBS@ -LIBS_FREETYPE = @FREETYPE_LIBS@ -LIBS_GL = @GL_LIBS@ -LIBS_HUNSPELL = @HUNSPELL_LIBS@ -LIBS_ICONV = @ICONV_LIBS@ -LIBS_ICU = @ICU_UC_LIBS@ @ICU_I18N_LIBS@ -LIBS_LIBASS = @LIBASS_LIBS@ -LIBS_LIBPULSE = @LIBPULSE_LIBS@ -LIBS_LUA = @LUAJIT_LIBS@ -LIBS_OPENAL = @OPENAL_LIBS@ -LIBS_PORTAUDIO = @PORTAUDIO_LIBS@ -LIBS_PTHREAD = @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ -LIBS_UCHARDET = @UCHARDET_LIBS@ - -ifeq (yes, $(BUILD_DARWIN)) -LIBS_LUA = $(TOP)vendor/luajit/src/libluajit.a -endif - -FONTCONFIG_CONF_DIR = @FONTCONFIG_CONF_DIR@ - -##################### -# DEBUG / DEVELOPMENT -##################### -PRECOMPILED_HEADER = @enable_gcc_prec@ - -########## -# BINARIES -########## -BIN_AR = ar -BIN_RANLIB = ranlib -BIN_LN = ln -BIN_RM = rm -BIN_SHELL = @SHELL@ -BIN_MV = mv -BIN_SED = sed -BIN_INSTALL = @INSTALL@ -BIN_MSGMERGE = @MSGMERGE@ -BIN_XGETTEXT = @XGETTEXT@ -BIN_MSGFMT = @MSGFMT@ -BIN_CC = @CC@ -BIN_CXX = @CXX@ -BIN_CP = cp -BIN_MKDIR = mkdir -BIN_MKDIR_P = mkdir -p -BIN_ECHO = echo -BIN_TOUCH = touch -BIN_LUA = @LUA@ -BIN_WX_CONFIG = @WX_CONFIG_PATH@ diff --git a/Makefile.target b/Makefile.target deleted file mode 100644 index 516ef3c24..000000000 --- a/Makefile.target +++ /dev/null @@ -1,121 +0,0 @@ -ifneq (yes, $(INCLUDING_CHILD_MAKEFILES)) -COMMANDS := all install clean distclean test depclean osx-bundle osx-dmg test-automation test-libaegisub -.PHONY: $(COMMANDS) -.DEFAULT_GOAL := all - -# Would be nice to move this somewhere else (Makefile.inc?) -ifeq (yes, $(BUILD_DARWIN)) -CFLAGS += -mmacosx-version-min=10.8 -gfull -CXXFLAGS += -mmacosx-version-min=10.8 -gfull -LDFLAGS += -mmacosx-version-min=10.8 -Wl,-dead_strip -pagezero_size 10000 -image_base 100000000 -LIB_SHARED_LINK = $(LIB_SHARED_LINK_OSX) -endif - -LIB_TARGETS := $(addprefix $(TOP)lib/,$(LIB:%=lib%.a)) - -# Handle per-target flags in the form foo_CFLAGS := -w by mapping them to all -# of the objects a target depends on. This has potentially dumb results if -# multiple targets use a single object file, so don't do that. -define set_target_flags - OBJ += $($1_OBJ) - - $($1_OBJ): CPPFLAGS := $(CPPFLAGS) $($1_CPPFLAGS) - $($1_OBJ): CXXFLAGS := $(CXXFLAGS) $($1_CXXFLAGS) - $($1_OBJ): OBJCXXFLAGS := $(CXXFLAGS) $($1_CXXFLAGS) - - ifeq (yes, $(PRECOMPILED_HEADER)) - ifdef $1_PCH - CLEANFILES += $($1_PCH).gch - $($1_OBJ): CXXFLAGS += -include $($1_PCH) $(PCHFLAGS) - $($1_OBJ): $($1_PCH).gch - $($1_PCH).gch: $($1_PCH) - $($1_PCH).gch: CPPFLAGS := $(CPPFLAGS) $($1_CPPFLAGS) - $($1_PCH).gch: CXXFLAGS := $(CXXFLAGS) $($1_CXXFLAGS) - else - $($1_OBJ): CXXFLAGS += -include acconf.h - endif - else - $($1_OBJ): CXXFLAGS += -include acconf.h - endif -endef -$(foreach target,$(LIB),$(eval $(call set_target_flags,$(target),$(TOP)lib/lib$(target).a))) -$(foreach target,$(PROGRAM),$(eval $(call set_target_flags,$(notdir $(target)),$(target)))) - -# Create the build and install targets for programs -# Not done with a pattern rule since the pattern would be just %: and doing that -# leads to make trying to use gcc to make any nonexistent targets rather than -# erroring -define create_program_targets - ifdef $1_INSTALLNAME -install: $(DESTDIR)$(P_BINDIR)/$($1_INSTALLNAME) -$(DESTDIR)$(P_BINDIR)/$($1_INSTALLNAME): $(dir $2)$($1_INSTALLNAME) - @$(BIN_MKDIR) -p $(DESTDIR)$(P_BINDIR) - @$(BIN_INSTALL) $(dir $2)$($1_INSTALLNAME) $(DESTDIR)$(P_BINDIR)/$($1_INSTALLNAME) -$(dir $2)$($1_INSTALLNAME): $($1_OBJ) - $(BIN_CXX) -o $(dir $2)$($1_INSTALLNAME) $(LDFLAGS) $($1_OBJ) $(LIBS) $($1_LIBS) -all: $(dir $2)$($1_INSTALLNAME) - else -$2: $($1_OBJ) - $(BIN_CXX) -o $2 $(LDFLAGS) $($1_OBJ) $(LIBS) $($1_LIBS) -all: $2 - endif - $(eval CLEANFILES += $(filter-out %/,$2 $(dir $2)$($1_INSTALLNAME))) -endef -$(foreach target,$(PROGRAM),$(eval $(call create_program_targets,$(notdir $(target)),$(target)))) - -# The dependency files which will be automatically generated by gcc. -# The filter is due to that libraries also appear in OBJ -DEP := $(filter %.d,$(OBJ:%.o=%.d)) - -# If the goal is a relative path to a file, convert it to an absolute path -ifneq ($(filter-out $(COMMANDS),$(MAKECMDGOALS)),) -ABSGOAL := $(abspath $(MAKECMDGOALS)) -ifneq ($(MAKECMDGOALS),$(ABSGOAL)) -$(MAKECMDGOALS): $(ABSGOAL) ; -endif -endif - -# Primary build targets -all: $(LIB_TARGETS) - -clean: - $(BIN_RM) -f $(OBJ) $(CLEANFILES) $(LIB_TARGETS) - -distclean: clean - $(BIN_RM) -rf $(DISTCLEANFILES) $(DEP) - -depclean: clean - $(BIN_RM) -rf $(DEP) - -install: - -# The actual build rules -.SUFFIXES: - -CXX_CMD = $(CXX_ENV) $(BIN_CXX) $(CFLAGS_DEP) $(CPPFLAGS) -CC_CMD = $(CXX_ENV) $(BIN_CC) $(CFLAGS_DEP) $(CPPFLAGS) -POST_FLAGS = $($@_FLAGS) -c -o $@ $< - -%.o: %.c ; $(CC_CMD) $(CFLAGS) $(POST_FLAGS) -%.o: %.cpp ; $(CXX_CMD) $(CXXFLAGS) $(POST_FLAGS) -%.o: %.cxx ; $(CXX_CMD) $(CXXFLAGS) $(POST_FLAGS) -%.o: %.cc ; $(CXX_CMD) $(CXXFLAGS) $(POST_FLAGS) -%.o: %.mm ; $(CXX_CMD) $(OBJCXXFLAGS) $(POST_FLAGS) -%.o: %.m ; $(CC_CMD) $(CFLAGS) -fmodules $(POST_FLAGS) - -%.gch: % - @$(BIN_RM) -f $@ - $(CXX_ENV) $(BIN_CXX) $(CPPFLAGS) $(CXXFLAGS) -x c++-header $< - -.SECONDEXPANSION: - -# Libraries contain all object files they depend on (but they may depend on other files) -# Not using libtool on OS X because it has an unsilenceable warning about a -# compatibility issue with BSD 4.3 (wtf) -lib%.a: $$($$*_OBJ) - @$(BIN_MKDIR_P) $(dir $@) - $(BIN_AR) cru $@ $(filter %.o,$^) - $(BIN_RANLIB) $@ - --include $(DEP) -endif diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index aee5b047d..000000000 --- a/acinclude.m4 +++ /dev/null @@ -1,15 +0,0 @@ -m4_include([m4macros/ac_agi.m4]) -m4_include([m4macros/ac_flag.m4]) -m4_include([m4macros/agi_find_libheader.m4]) -m4_include([m4macros/ax_boost_base.m4]) -m4_include([m4macros/ax_boost_chrono.m4]) -m4_include([m4macros/ax_boost_filesystem.m4]) -m4_include([m4macros/ax_boost_locale.m4]) -m4_include([m4macros/ax_boost_regex.m4]) -m4_include([m4macros/ax_boost_system.m4]) -m4_include([m4macros/ax_boost_thread.m4]) -m4_include([m4macros/ax_check_gl.m4]) -m4_include([m4macros/ax_lang_compiler_ms.m4]) -m4_include([m4macros/ax_pthread.m4]) -m4_include([m4macros/check_gnu_make.m4]) -m4_include([m4macros/wxwin.m4]) diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 46b4be7e7..000000000 --- a/autogen.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -set -e - -echo Running autoreconf... -autoreconf -ivf "$@" - -echo Now run ./configure and then make to build Aegisub diff --git a/automation/Makefile b/automation/Makefile deleted file mode 100644 index 76c7dd992..000000000 --- a/automation/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk - -DATA_AUTOMATION := \ - $(sort $(wildcard $(d)autoload/*)) \ - $(sort $(wildcard $(d)demos/*)) \ - $(sort $(wildcard $(d)include/*.lua)) \ - $(sort $(wildcard $(d)include/aegisub/*)) - -DATA_AUTOMATION_REL := $(subst $(d),,$(DATA_AUTOMATION)) -DATA_AUTOMATION_INSTALLED = $(addprefix $(DESTDIR)$(P_DATA)/automation/, $(DATA_AUTOMATION_REL)) - -$(DESTDIR)$(P_DATA)/automation/%: $(d)% - $(MKDIR_INSTALL) - -aegisub-lua_OBJ := $(d)tests/aegisub.o $(TOP)lib/libaegisub.a $(TOP)lib/libluabins.a $(LIBS_LUA) -aegisub-lua_CPPFLAGS := $(CPPFLAGS_BOOST) $(CFLAGS_LUA) -I$(TOP)libaegisub/include -I$(TOP)src $(CXXFLAGS_WX) -aegisub-lua_LIBS := $(LIBS_WX) $(LIBS_BOOST) $(LIBS_ICU) $(LIBS_PTHREAD) - -PROGRAM += $(d)aegisub-lua - -test-automation: $(PROGRAM) - eval `luarocks path`; cd $(TOP)automation; ./aegisub-lua tests/busted.lua -p 'moon' tests/modules - -test: test-automation - -install: $(DATA_AUTOMATION_INSTALLED) - -include $(TOP)Makefile.target diff --git a/config.guess b/config.guess deleted file mode 100755 index 883a6713b..000000000 --- a/config.guess +++ /dev/null @@ -1,1476 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2018 Free Software Foundation, Inc. - -timestamp='2018-05-19' - -# 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 3 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. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. -# -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess -# -# Please send patches to . - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Options: - -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 1992-2018 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 - -case "$UNAME_SYSTEM" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - eval "$set_cc_for_build" - cat <<-EOF > "$dummy.c" - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" - - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl - fi - ;; -esac - -# 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=`(uname -p 2>/dev/null || \ - "/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 ;; - earmv*) - arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` - machine="${arch}${endian}"-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) and ABI. - case "$UNAME_MACHINE_ARCH" in - earm*) - os=netbsdelf - ;; - 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 - # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in - earm*) - expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` - ;; - 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/[-_].*//' | cut -d. -f1,2` - ;; - 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}${abi-}" - exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; - *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; - *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$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 ;; - *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; - *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; - mips:OSF1:*.*) - echo mips-dec-osf1 - 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 ;; - 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/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` - 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:4.4BSD:*) - 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) - UNAME_PROCESSOR=x86_64 ;; - i386) - UNAME_PROCESSOR=i586 ;; - esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; - i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; - *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; - *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; - *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - 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 ;; - i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-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-$LIBC`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 "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" - exit ;; - i*86:Minix:*:*) - echo "$UNAME_MACHINE"-pc-minix - exit ;; - aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - 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=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$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-"$LIBC" - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi - else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; - crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; - e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; - ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - 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-$LIBC"; exit; } - ;; - mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; - or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - 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-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; - sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; - x86_64:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; - xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - 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.*:*) - 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 configure 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 ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-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 ;; - SX-ACE:SUPER-UX:*:*) - echo sxace-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 - eval "$set_cc_for_build" - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then - 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 - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc - if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_PPC >/dev/null - then - UNAME_PROCESSOR=powerpc - fi - fi - elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 - fi - 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 ;; - NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-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 ;; - amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; -esac - -echo "$0: unable to guess system type" >&2 - -case "$UNAME_MACHINE:$UNAME_SYSTEM" in - mips:Linux | mips64:Linux) - # If we got here on MIPS GNU/Linux, output extra information. - cat >&2 <&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 'before-save-hook 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/config.sub b/config.sub deleted file mode 100755 index d1f5b5490..000000000 --- a/config.sub +++ /dev/null @@ -1,1808 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2018 Free Software Foundation, Inc. - -timestamp='2018-05-24' - -# 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 3 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. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches to . -# -# 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: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub - -# 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 or ALIAS - -Canonicalize a configuration name. - -Options: - -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 1992-2018 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 - -# Split fields of configuration type -IFS="-" read -r field1 field2 field3 field4 <&2 - exit 1 - ;; - *-*-*-*) - basic_machine=$field1-$field2 - os=$field3-$field4 - ;; - *-*-*) - # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two - # parts - maybe_os=$field2-$field3 - case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ - | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) - basic_machine=$field1 - os=$maybe_os - ;; - android-linux) - basic_machine=$field1-unknown - os=linux-android - ;; - *) - basic_machine=$field1-$field2 - os=$field3 - ;; - esac - ;; - *-*) - # Second component is usually, but not always the OS - case $field2 in - # Prevent following clause from handling this valid os - sun*os*) - basic_machine=$field1 - os=$field2 - ;; - # Manufacturers - 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* \ - | sim | cisco | oki | wec | wrs | winbond) - basic_machine=$field1-$field2 - os= - ;; - *) - basic_machine=$field1 - os=$field2 - ;; - esac - ;; - *) - # Convert single-component short-hands not valid as part of - # multi-component configurations. - case $field1 in - 386bsd) - basic_machine=i386-pc - os=bsd - ;; - a29khif) - basic_machine=a29k-amd - os=udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=scout - ;; - am29k) - basic_machine=a29k-none - os=bsd - ;; - amdahl) - basic_machine=580-amdahl - os=sysv - ;; - 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 - ;; - cegcc) - basic_machine=arm-unknown - os=cegcc - ;; - cray) - basic_machine=j90-cray - os=unicos - ;; - craynv) - basic_machine=craynv-cray - os=unicosmp - ;; - delta88) - basic_machine=m88k-motorola - os=sysv3 - ;; - dicos) - basic_machine=i686-pc - os=dicos - ;; - djgpp) - basic_machine=i586-pc - os=msdosdjgpp - ;; - ebmon29k) - basic_machine=a29k-amd - os=ebmon - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=ose - ;; - gmicro) - basic_machine=tron-gmicro - os=sysv - ;; - go32) - basic_machine=i386-pc - os=go32 - ;; - 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 - ;; - hp300bsd) - basic_machine=m68k-hp - os=bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=hpux - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=proelf - ;; - i386mach) - basic_machine=i386-mach - os=mach - ;; - vsta) - basic_machine=i386-unknown - os=vsta - ;; - isi68 | isi) - basic_machine=m68k-isi - os=sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=linux - ;; - magnum | m3230) - basic_machine=mips-mips - os=sysv - ;; - merlin) - basic_machine=ns32k-utek - os=sysv - ;; - mingw64) - basic_machine=x86_64-pc - os=mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=mingw32ce - ;; - monitor) - basic_machine=m68k-rom68k - os=coff - ;; - morphos) - basic_machine=powerpc-unknown - os=morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=moxiebox - ;; - msdos) - basic_machine=i386-pc - os=msdos - ;; - msys) - basic_machine=i686-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 - ;; - necv70) - basic_machine=v70-nec - os=sysv - ;; - 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 - ;; - os400) - basic_machine=powerpc-ibm - os=os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=ose - ;; - os68k) - basic_machine=m68k-none - os=os68k - ;; - paragon) - basic_machine=i860-intel - os=osf - ;; - parisc) - basic_machine=hppa-unknown - os=linux - ;; - pw32) - basic_machine=i586-unknown - os=pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=rdos - ;; - rdos32) - basic_machine=i386-pc - os=rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=coff - ;; - sa29200) - basic_machine=a29k-amd - os=udi - ;; - sei) - basic_machine=mips-sei - os=seiux - ;; - sps7) - basic_machine=m68k-bull - os=sysv2 - ;; - stratus) - basic_machine=i860-stratus - os=sysv4 - ;; - 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 - ;; - 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 - ;; - toad1) - basic_machine=pdp10-xkl - os=tops20 - ;; - 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 - ;; - vxworks960) - basic_machine=i960-wrs - os=vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=vxworks - ;; - xbox) - basic_machine=i686-pc - os=mingw32 - ;; - ymp) - basic_machine=ymp-cray - os=unicos - ;; - *) - basic_machine=$1 - os= - ;; - esac - ;; -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 | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper | csky \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia16 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | 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 \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nfp \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]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 \ - | visium \ - | wasm32 \ - | 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 - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=${os:-none} - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) - ;; - m9s12z | m68hcs12z | hcs12z | s12z) - basic_machine=s12z-unknown - os=${os:-none} - ;; - ms1) - basic_machine=mt-unknown - ;; - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=${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 - ;; - # 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-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | 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-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nfp-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | 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-* \ - | visium-* \ - | wasm32-* \ - | 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. - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - abacus) - basic_machine=abacus-unknown - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - 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=${os:-unicos} - ;; - 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 - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=${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=${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 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=${os:-bosx} - ;; - dpx2*) - basic_machine=m68k-bull - os=sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - elxsi) - basic_machine=elxsi-elxsi - os=${os:-bsd} - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=hiuxwe2 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - 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 - ;; - 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 - ;; - j90 | j90-cray) - basic_machine=j90-cray - os=${os:-unicos} - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - irix*) - ;; - *) - os=irix4 - ;; - esac - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` - ;; - m68knommu-*) - basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=linux - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - 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 - ;; - ms1-*) - basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=newsos - ;; - next | m*-next) - basic_machine=m68k-next - case $os in - nextstep* ) - ;; - ns2*) - os=nextstep2 - ;; - *) - os=nextstep3 - ;; - esac - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - nsv-tandem) - basic_machine=nsv-tandem - ;; - nsx-tandem) - basic_machine=nsx-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=hiuxwe2 - ;; - 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) - 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) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - 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 - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=${os:-elf} - ;; - sequent) - basic_machine=i386-sequent - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - simso-wrs) - basic_machine=sparclite-wrs - os=vxworks - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - tile*) - basic_machine=$basic_machine-unknown - os=linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - w65*) - basic_machine=w65-wdc - os=none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=proelf - ;; - x64) - basic_machine=x86_64-pc - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` - ;; - none) - basic_machine=none-none - os=${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 - ;; - 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 - ;; - 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 - ;; - bluegene*) - os=cnk - ;; - solaris1 | solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - solaris) - os=solaris2 - ;; - unixware*) - os=sysv4.2uw - ;; - gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # es1800 is here to avoid being matched by es* (a different OS) - es1800*) - os=ose - ;; - # Some version numbers need modification - chorusos*) - os=chorusos - ;; - isc) - os=isc2.2 - ;; - sco6) - os=sco5v6 - ;; - sco5) - os=sco3.2v5 - ;; - sco4) - os=sco3.2v4 - ;; - sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - ;; - sco3.2v[4-9]* | sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - ;; - scout) - # Don't match below - ;; - sco*) - os=sco3.2v2 - ;; - psos*) - os=psos - ;; - # Now 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* | esix* | aix* | cnk* | sunos | sunos[34]*\ - | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ - | sym* | kopensolaris* | plan9* \ - | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ - | aos* | aros* | cloudabi* | sortix* \ - | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ - | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \ - | knetbsd* | mirbsd* | netbsd* \ - | bitrig* | openbsd* | solidbsd* | libertybsd* \ - | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ - | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ - | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ - | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ - | chorusrdb* | cegcc* | glidix* \ - | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ - | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ - | linux-newlib* | linux-musl* | linux-uclibc* \ - | uxpv* | beos* | mpeix* | udk* | moxiebox* \ - | interix* | uwin* | mks* | rhapsody* | darwin* \ - | openstep* | oskit* | conix* | pw32* | nonstopux* \ - | storm-chaos* | tops10* | tenex* | tops20* | its* \ - | os2* | vos* | palmos* | uclinux* | nucleus* \ - | morphos* | superux* | rtmk* | windiss* \ - | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ - | skyos* | haiku* | rdos* | toppers* | drops* | es* \ - | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ - | midnightbsd*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=nto-$os - ;; - esac - ;; - hiux*) - os=hiuxwe2 - ;; - nto-qnx*) - ;; - nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - sim | xray | os68k* | v88r* \ - | windows* | osx | abug | netware* | os9* \ - | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) - ;; - linux-dietlibc) - os=linux-dietlibc - ;; - linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - lynx*178) - os=lynxos178 - ;; - lynx*5) - os=lynxos5 - ;; - lynx*) - os=lynxos - ;; - mac*) - os=`echo "$os" | sed -e 's|mac|macos|'` - ;; - opened*) - os=openedition - ;; - os400*) - os=os400 - ;; - sunos5*) - os=`echo "$os" | sed -e 's|sunos5|solaris2|'` - ;; - sunos6*) - os=`echo "$os" | sed -e 's|sunos6|solaris3|'` - ;; - wince*) - os=wince - ;; - 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 - ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) - os=mint - ;; - zvmoe) - os=zvmoe - ;; - dicos*) - os=dicos - ;; - pikeos*) - # Until real need of OS specific support for - # particular features comes up, bare metal - # configurations are quite functional. - case $basic_machine in - arm*) - os=eabi - ;; - *) - os=elf - ;; - esac - ;; - nacl*) - ;; - ios) - ;; - none) - ;; - *-eabi) - ;; - *) - 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 - ;; - c8051-*) - os=elf - ;; - clipper-intergraph) - os=clix - ;; - 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 - ;; - pru-*) - os=elf - ;; - *-be) - os=beos - ;; - *-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 - ;; - *-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 - ;; - *-wrs) - os=vxworks - ;; - *) - 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 - ;; - clix*) - vendor=intergraph - ;; - 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 'before-save-hook 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 9cc9eaf53..000000000 --- a/configure.ac +++ /dev/null @@ -1,630 +0,0 @@ -AC_PREREQ(2.57) - -################### -# Required packages -################### -m4_define([boost_required_version], [1.50.0]) -m4_define([curl_required_version], [7.18.2]) -m4_define([ffms2_required_version], [2.16]) -m4_define([fftw3_required_version], [3.3]) -m4_define([fontconfig_required_version], [2.4]) -m4_define([freetype_required_version], [9.7.0]) -m4_define([hunspell_required_version], [1.2.0]) -m4_define([icu_required_version], [4.8.1.1]) -m4_define([libass_required_version], [0.9.7]) -m4_define([libpulse_required_version], [0.5]) -m4_define([pkgconfig_required_version], [0.20]) -m4_define([portaudio_required_version], [19]) -m4_define([wx_required_version], [3.0.0]) - -####### -# Setup -####### -AC_INIT([Aegisub], [aegisub_version],, [aegisub]) -: ${CFLAGS=""} -: ${CXXFLAGS=""} -AC_CONFIG_SRCDIR([src/main.cpp]) -AC_CONFIG_HEADER([acconf.h]) -AC_GNU_SOURCE -AC_CANONICAL_HOST - -########################### -# Check host architecture -########################### -build_darwin="no" -build_linux="no" - -AS_CASE([$host], - [*-*-darwin*], [build_darwin="yes"], - [*-*-linux*], [build_linux="yes"]) - -AC_SUBST(build_darwin) - -######################## -# Configurable variables -######################## -# Name of aegisub binary. -# This is tagged with the version on release branches. -AEGISUB_COMMAND="aegisub" -AC_SUBST(AEGISUB_COMMAND) -AC_DEFINE_UNQUOTED([AEGISUB_COMMAND], ["${AEGISUB_COMMAND}"], [Name of the Aegisub executable]) - -# Name of gettext catalog. -AEGISUB_CATALOG="aegisub" -AC_SUBST(AEGISUB_CATALOG) -AC_DEFINE_UNQUOTED([AEGISUB_CATALOG], ["${AEGISUB_CATALOG}"], [Name of the Aegisub gettext catalog]) - -# Handle location of desktop files: http://freedesktop.org/wiki/Specifications/desktop-entry-spec -AC_ARG_WITH(desktop-dir, - AS_HELP_STRING([--with-desktop-dir=PATH],[desktop file locations [PREFIX/share/applications]])) - -P_DESKTOP=${with_desktop_dir:-$datarootdir/applications} -AC_SUBST(P_DESKTOP) - -# Handle location of icons: http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html -AC_ARG_WITH(icon-dir, - AS_HELP_STRING([--with-icon-dir=PATH],[icon locations [PREFIX/share/icons]])) - -P_ICON=${with_icon_dir:-$datarootdir/icons} -AC_SUBST(P_ICON) - -# Install prefix -# If a user doesn't supply --prefix then it is set to NONE so we -# set it to $ac_default_prefix if it hasn't been supplied. -AS_CASE([x$prefix], [xNONE | x], [prefix="$ac_default_prefix"], []) - -# Install prefix used by wxStandardPaths::SetInstallPrefix. -AC_DEFINE_UNQUOTED([INSTALL_PREFIX], ["$prefix"], [Default install prefix, or --prefix.]) - -# Build credit -AC_ARG_WITH(build-credit, - AS_HELP_STRING([--with-build-credit=NAME],[Build credit shown in the program title.]), - [use_build_credit="yes"]) - -AC_MSG_CHECKING([whether BUILD_CREDIT has been set]) -AS_IF([test x$use_build_credit = xyes], - AS_IF([test x$with_build_credit = xyes || test -z "$with_build_credit"], [ - AC_MSG_FAILURE([You must set a value eg --with-build-credit=]) - ], [ - AC_MSG_RESULT([yes ($with_build_credit)]) - AC_DEFINE_UNQUOTED([BUILD_CREDIT], ["$with_build_credit"], [Build credit supplied in application title using --with-build-credit=]) - ]), - [AC_MSG_RESULT([no])]) - -#################### -# Check for programs -#################### -CHECK_GNU_MAKE -AC_PROG_CC -AC_PROG_CXX -AC_LANG(C++) -AM_PROG_CC_C_O -# This is reported to be required on Ubuntu, I haven't had time to check. -define([AC_LIBTOOL_LANG_F77_CONFIG], [:]) -AC_PROG_INSTALL -AC_PROG_RANLIB -PKG_PROG_PKG_CONFIG([pkgconfig_required_version]) - -################# -# Developers only -################# -AC_MSG_CHECKING([for version]) -. $srcdir/build/version.sh "$srcdir" -AC_MSG_RESULT([$BUILD_GIT_VERSION_STRING $VERSION_SOURCE]) - -AC_MSG_CHECKING([for build date]) -BUILD_DATE=`date "+%Y-%m-%d %H:%M %Z"` -AC_MSG_RESULT($BUILD_DATE) - -AC_SUBST([BUILD_GIT_VERSION_STRING]) -AC_SUBST([BUILD_DATE]) - -################################################### -# Check for pthreads and setup variables / compiler -################################################### -AS_IF([test x$build_darwin != xyes], [ - ACX_PTHREAD([], [AC_MSG_FAILURE([You must have working pthreads.])]) - CC="$PTHREAD_CC" -]) - -###################### -# Check compiler flags -###################### -AC_ARG_ENABLE(compiler-flags, AS_HELP_STRING([--disable-compiler-flags],[Disable *all* additional compiler flags. [no]])) - -AS_IF([test x$enable_compiler_flags != xno], [ - CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter -std=gnu99 -pipe -g" - CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -pipe -g" - AC_CXX_FLAG([-std=c++11]) - AC_CXX_FLAG([-Wno-c++11-narrowing]) - AC_C_FLAG([-Wno-unused-local-typedefs]) - AC_CXX_FLAG([-Wno-unused-local-typedefs]) - - # -O* messes with debugging. - AS_IF([test x$enable_debug = xyes], [ - CFLAGS="$CFLAGS -O0" - CXXFLAGS="$CXXFLAGS -O0" - ], [ - CFLAGS="$CFLAGS -O3" - CXXFLAGS="$CXXFLAGS -O3" - ]) -]) - -AC_ARG_WITH([libc++], AS_HELP_STRING([--with-libc++],[Use libc++ rather than libstdc++. [auto]])) -AS_IF([test x$with_libc__ != xno], [ - AC_LANG_PUSH(C++) - ac_ld_flag_save="$LDFLAGS" - LDFLAGS="$LDFLAGS -stdlib=libc++" - AC_MSG_CHECKING([[whether $CXX supports -stdlib=libc++]]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]])], [ - AC_MSG_RESULT([yes]) - CXXFLAGS="$CXXFLAGS -stdlib=libc++" - ], [ - AS_IF([test x$with_libc__ = xyes], [ - AC_MSG_FAILURE([no]) - ], [ - LDFLAGS="$ac_ld_flag_save" - AC_MSG_RESULT([no]) - ]) - ]) - AC_LANG_POP(C++) -]) - -###################################### -# Check Headers / Features / Libraries -###################################### -AC_CHECK_LIB([m], [main]) -AC_CHECK_LIB([dl], [dlclose]) -AC_CHECK_HEADERS([sys/time.h]) - -AC_ARG_ENABLE(sanity-checks, - AS_HELP_STRING([--disable-sanity-checks],[Skip verifying that found libraries work.])) - -############################## -# Program Support and Features -############################## -######################### -### Required Dependencies -######################### - -AS_IF([test x$build_darwin != xyes], [ - AC_PATH_XTRA - AS_IF([test x$no_x = xyes], - [AC_MSG_FAILURE([You must have a working copy of X installed.])]) - - AX_CHECK_GL - AS_IF([test x$no_gl = xyes], [AC_MSG_FAILURE([Aegisub requires GL support.])]) -], [ - AC_CHECK_HEADERS([OpenGL/gl.h]) -]) -AC_SUBST(GL_CFLAGS) -AC_SUBST(GL_LIBS) - -PKG_CHECK_MODULES(FREETYPE, freetype2 >= freetype_required_version) - -AS_IF([test x$build_darwin != xyes], [ - PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= fontconfig_required_version) - FONTCONFIG_CONF_DIR=$($PKG_CONFIG --variable=confdir fontconfig) - AC_SUBST(FONTCONFIG_CONF_DIR) -]) - -PKG_CHECK_MODULES(LIBASS, libass >= libass_required_version) - -AX_BOOST_BASE([boost_required_version]) -AX_BOOST_CHRONO -AX_BOOST_FILESYSTEM -AX_BOOST_LOCALE -AX_BOOST_REGEX -AX_BOOST_SYSTEM -AX_BOOST_THREAD - -cppflags_bak="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" -AC_CHECK_HEADERS([boost/spirit/home/phoenix/version.hpp]) -CPPFLAGS=$cppflags_bak - -AC_DEFINE(BOOST_SYSTEM_NO_DEPRECATED, 1, - [Disable deprecated parts of boost.system]) -AC_DEFINE(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION, 1, - [Disable boost.serialization support for boost.multi_index]) - -PKG_CHECK_MODULES(ICU_UC, icu-uc >= icu_required_version) -PKG_CHECK_MODULES(ICU_I18N, icu-i18n >= icu_required_version) - -######## -## boost -######## -AS_IF([test x$enable_sanity_checks != xno], [ - AC_AGI_COMPILE([boost ICU support], [boost_icu], [$BOOST_CPPFLAGS], - [$BOOST_LDFLAGS $BOOST_REGEX_LIB $ICU_UC_LIBS $ICU_I18N_LIBS],[ - #include - int main() { - auto regex = boost::make_u32regex(".", boost::u32regex::perl); - boost::smatch result; - u32regex_search("a", result, regex, boost::match_default); - } ]) - - AS_IF([test x$agi_cv_with_boost_icu = xno], - [AC_MSG_FAILURE([Aegisub requires that boost be built with ICU support.])]) -]) - -######## -## iconv -######## -AC_ARG_VAR([ICONV_CFLAGS], [CFLAGS to use for iconv []]) -AC_ARG_VAR([ICONV_LIBS], [LIBS to use for iconv [-liconv]]) - -AS_IF([test -z "$ICONV_LIBS"], AC_SEARCH_LIBS([iconv_open], [iconv])) - -AC_AGI_COMPILE([iconv], [iconv], [$ICONV_CFLAGS], [$ICONV_LIBS],[ -#include -int main() { - return !iconv_open("UTF-8", "UTF-8"); -} ]) - -AC_SUBST(ICONV_LIBS) -AC_SUBST(ICONV_CFLAGS) - -AS_IF([test x$agi_cv_with_iconv = xno], [AC_MSG_FAILURE([Please install a working iconv library.])]) - -AC_AGI_COMPILE([iconv (const)], [iconv_const], [$ICONV_CFLAGS], [$ICONV_LIBS],[ -#include -int main(void) { - iconv_t cd = iconv_open("UTF-16", "UTF-8"); - const char *in = "in"; - char *out = new char(); - size_t res, inbytesleft, outbytesleft; - res = iconv(cd, &in, &inbytesleft, &out, &outbytesleft); - return 0; -} ]) - -AS_IF([test x$agi_cv_with_iconv_const = xyes], - [AC_DEFINE(AGI_ICONV_CONST, 1, [Enable if iconv expects the in argument to be const])]) - -############### -# Audio Players -############### -####### -## ALSA -####### -AC_ARG_WITH(alsa, - AS_HELP_STRING([--without-alsa], - [build without ALSA audio player [auto]])) - -AC_ARG_VAR([ALSA_CFLAGS], [CFLAGS to use for ALSA []]) -AC_ARG_VAR([ALSA_LIBS], [LIBS to use for ALSA [-lasound -lrt]]) - -ALSA_LIBS=${ALSA_LIBS:--lasound -lrt} - -AS_IF([test x$with_alsa = xno], - [alsa_disabled="(disabled)"], - [AC_CHECK_LIB([asound], [snd_pcm_open], [with_alsa="yes"], [with_alsa="no"], $ALSA_LIBS)]) - -AS_IF([test x$with_alsa = xyes], AC_DEFINE(WITH_ALSA, 1, [Enable ALSA Support])) - -AC_SUBST(ALSA_CFLAGS) -AC_SUBST(ALSA_LIBS) -AC_SUBST(with_alsa) - -######### -## OpenAL -######### -AC_ARG_WITH(openal, - AS_HELP_STRING([--without-openal], - [build without OpenAL audio player [auto]])) - -AS_IF([test x$build_darwin = xyes], [ - OPENAL_LIBS="-framework OpenAL" - OPENAL_CFLAGS="" - AC_SUBST(OPENAL_LIBS) - AC_SUBST(OPENAL_CFLAGS) - with_openal="yes" -], - [test x$with_openal = xno], [openal_disabled="(disabled)"], - [PKG_CHECK_MODULES(OPENAL, openal >= 0.0.8, [with_openal=yes], [with_openal=no])]) - -AS_IF([test x$with_openal != xno], [ - AC_AGI_COMPILE([OpenAL], [openal], [$OPENAL_CFLAGS], [$OPENAL_LIBS],[ -#if defined(__APPLE__) -#include -#include -#else -#include -#include -#endif -int main(void) { - ALCdevice *device = alcOpenDevice(0); - if (!device) return 1; - ALCcontext *context = alcCreateContext(device, 0); - if (!context) return 1; - return 0; -} ]) -]) - -AS_IF([test x$agi_cv_with_openal = xno && test x$with_openal = xyes], [ - AC_MSG_WARN([OpenAL detected, but it doesn''t work...]) - with_openal="no" -]) - -AS_IF([test x$agi_cv_with_openal = xyes && test x$with_openal = xyes], - AC_DEFINE(WITH_OPENAL, 1, [Enable OpenAL support])) - -AC_SUBST(with_openal) - -###### -## OSS -###### -AC_ARG_VAR([OSS_CFLAGS], [CFLAGS to use for OSS [auto]]) -AC_ARG_WITH(oss, - AS_HELP_STRING([--without-oss], - [build without OSS audio player [auto]])) - -AS_IF([test x$with_oss = xno], [oss_disabled="(disabled)"], [ - AS_IF([test -z "$OSS_CFLAGS" && test -f "/etc/oss.conf"], [ - . /etc/oss.conf - OSS_CFLAGS="-I${OSSLIBDIR}/include/sys" - ]) - AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [with_oss="yes"], [with_oss="no"]) -]) - -AS_IF([test x$with_oss = xyes], AC_DEFINE(WITH_OSS, 1, [Enable OSS support])) - -AC_SUBST(with_oss) - -################### -# Simple pkg-config stuff -################### -AGI_OPT_PKG(libpulse, [build without PulseAudio audio player [auto]], [Enable PulseAudio support]) -AGI_OPT_PKG(portaudio-2.0, [build without PortAudio v19 audio player [auto]], [Enable PortAudio v19 support]) - -AGI_OPT_PKG(ffms2, [build without ffms2 A/V provider [auto]], [Enable FFMS2 support]) - -AGI_OPT_PKG(fftw3, [build without fftw support [auto]], [Enable fftw support]) -AGI_OPT_PKG(hunspell, [build without hunspell spell-checking [auto]], [Enable Hunspell support]) -AGI_OPT_PKG(uchardet, [build without automatic character set detection [auto]], [Enable uchardet support]) - -######## -# LuaJIT -######## -system_luajit="bundled" -AC_ARG_WITH(system-luajit, AS_HELP_STRING([--without-system-luajit], [Use built-in LuaJIT [auto]])) -# Check if it's available at all -AS_IF([test x$with_system_luajit = xno], [], - [PKG_CHECK_MODULES(LUAJIT, luajit >= 2.0.0, [], [ - AS_IF([test x$with_system_luajit = xyes], - [AC_MSG_FAILURE([--with-sytem-luajit was specified, but luajit could not be found])]) - with_system_luajit="no"])]) - -# Check if it's compiled in Lua 5.2 mode -# This check can be skipped by manually setting agi_cv_luajit_is_52 -AS_IF([test x$with_system_luajit != xno], [ - aegisub_save_LIBS="$LIBS" - aegisub_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LUAJIT_CFLAGS" - LIBS="$LIBS $LUAJIT_LIBS" - AC_CACHE_CHECK( - [whether LuaJIT is compiled in 5.2 mode], [agi_cv_luajit_is_52], - [AC_RUN_IFELSE([AC_LANG_PROGRAM( - [[#include ]], - [[lua_State *L = luaL_newstate(); - if (!L) return 1; - // This is valid in lua 5.2, but a syntax error in 5.1 - const char testprogram[] = "function foo() while true do break return end end"; - return luaL_loadstring(L, testprogram) == LUA_ERRSYNTAX; - ]])], [agi_cv_luajit_is_52="yes"], [agi_cv_luajit_is_52="no"])]) - CPPFLAGS="$aegisub_save_CPPFLAGS" - LIBS="$aegisub_save_LIBS" - - if test $agi_cv_luajit_is_52 != yes; then - AS_IF([test x$with_system_luajit = xyes], - [AC_MSG_FAILURE([LuaJIT must be compiled in Lua 5.2 mode])]) - with_system_luajit="no" - else - with_system_luajit="yes" - system_luajit="system" - fi -]) - -AS_IF([test $with_system_luajit = no], - [AC_SUBST([LUAJIT_CFLAGS], ['-I$(TOP)vendor/luajit/include']) - AC_SUBST([LUAJIT_LIBS], ['$(TOP)vendor/luajit/src/libluajit.a'])]) - -# We also need a Lua binary to run part of the build system -# Which version doesn't matter as the scripts are portable between them -AC_CHECK_PROGS([LUA], [lua luajit lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1]) - -# If the user doesn't have an installed copy of Lua, just use the one built -# as part of building LuaJIT -AS_IF([test -z $LUA], [LUA='$(TOP)vendor/luajit/src/host/minilua']) - -###################################################### -# Debugging support -###################################################### -AC_MSG_CHECKING([whether to turn on debugging]) -AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[enable debugging [no]])) -AC_MSG_RESULT([${enable_debug:=no}]) - -AC_MSG_CHECKING([whether to use exception handling in debug mode]) -AC_ARG_ENABLE(debug-exceptions, AS_HELP_STRING([--enable-debug-exceptions],[enable exception handling in debug mode [no]])) -AC_MSG_RESULT([${enabled_debug_exceptions:=no}]) - -AS_IF([test x$enable_debug_exceptions = xyes], - [AC_DEFINE(WITH_EXCEPTIONS, 1, - [Enable exception handling in debug mode. (--enable-debug) This is always enabled when debug mode is off.])]) - -################ -# Widget support -################ -WX_CONFIG_OPTIONS -WX_STANDARD_OPTIONS([debug]) -WX_DEBUG=$DEBUG -WX_UNICODE=$UNICODE -WX_CONFIG_CHECK([wx_required_version],,,[std,gl,stc],[$WXCONFIG_FLAGS]) -AC_SUBST(WX_CONFIG_PATH) - -AS_IF([test x$WX_VERSION = x], - [AC_MSG_FAILURE([wxWidgets detection failed, please set --with-wx* or add the libraries to your LIBS, CXX/CFLAGS.])]) - -AS_IF([test x$enable_sanity_checks != xno], [ - AC_AGI_LINK([wxWidgets OpenGL support], [wxopengl], [wx/glcanvas.h], [$GL_CFLAGS $WX_CFLAGS], [$GL_LIBS $WX_LIBS],[ -#include -int main(void) { - wxGLCanvas *canvas; - wxGLContext *context; - return 0; -} ]) - AC_AGI_LINK([wxWidgets StyledTextCtrl support], [wxstc], [wx/stc/stc.h], [$WX_CFLAGS], [$WX_LIBS],[ -#include -int main(void) { - wxStyledTextCtrl *canvas; - return 0; -} ]) -]) - -AS_IF([test x$with_agi_cv_wxopengl = xno], AC_MSG_FAILURE([wxWidgets OpenGL support missing])) -AS_IF([test x$with_agi_cv_wxstc = xno], AC_MSG_FAILURE([wxWidgets StyledTextCtrl support missing])) - -# This turns on some internal (to aegisub) debugging features. -# A debug version of wxWidgets is required. -AS_IF([test x$enable_debug = xyes], - [AS_IF([$WX_CONFIG_PATH --debug],[AC_CXX_FLAG([-D_DEBUG])])]) - -############################ -# Precompiled Header Support -# Only works with gcc! (and clang) -############################ -AC_MSG_CHECKING([whether to use precompiled headers]) -AC_ARG_ENABLE(gcc-prec, AS_HELP_STRING([--disable-gcc-prec],[disable GCC precompiled headers])) -AC_MSG_RESULT([${enable_gcc_prec:=yes}]) -AC_SUBST(enable_gcc_prec) -AC_PCH_FLAG([-Winvalid-pch]) -AC_PCH_FLAG([-fpch-deps]) -AC_PCH_FLAG([-fpch-preprocess]) - -############################## -# Internationalisation support -############################## -AM_GNU_GETTEXT([external]) - -################ -# Update checker -################ -AC_MSG_CHECKING([whether to enable the update checker]) -AC_ARG_ENABLE(update-checker, - AS_HELP_STRING([--disable-update-checker], [disable the update checker [no]])) -AC_MSG_RESULT(${enable_update_checker:=yes}) -AS_IF([test "x$enable_update_checker" != "xno"], - [AC_DEFINE([WITH_UPDATE_CHECKER], [], - [Whether to enable the update checker])]) - -AC_MSG_CHECKING([for update checker server]) -AC_ARG_WITH(update-server, - AS_HELP_STRING([--with-update-server=HOSTNAME], - [Server to use for the update checker - [updates.aegisub.org]])) -AC_MSG_RESULT(${with_update_server:=updates.aegisub.org}) -AC_DEFINE_UNQUOTED([UPDATE_CHECKER_SERVER], ["$with_update_server"], - [Server for the update checker]) - -AC_MSG_CHECKING([for update checker base URL]) -AC_ARG_WITH(update-url, - AS_HELP_STRING([--with-update-url=HOSTNAME], - [Base path to use for the update checker [/trunk]])) -AC_MSG_RESULT(${with_update_url:=/trunk}) -AC_DEFINE_UNQUOTED([UPDATE_CHECKER_BASE_URL], ["$with_update_url"], - [Base path for the update checker]) - -#################################################################### -# Default settings for Providers/Players -# * This is done at the end to preserve sanity rather than littering -# it above. -#################################################################### -AC_ARG_WITH(player-audio, - AS_HELP_STRING([--with-player-audio=(ALSA|OpenAL|PortAudio|PulseAudio|OSS)], - [Default Audio Player [Linux/ALSA, Darwin/OpenAL, 1:*/OSS, 2:*/PortAudio]])) - -# Default audio player. -AS_IF([test -z "$with_player_audio"], [ - AS_IF([test x$build_linux = xyes && test x$with_alsa = xyes], [DEFAULT_PLAYER_AUDIO="ALSA"], - [test x$build_darwin = xyes && test x$with_openal = xyes], [DEFAULT_PLAYER_AUDIO="OpenAL"], - [test x$with_portaudio = xyes], [DEFAULT_PLAYER_AUDIO="PortAudio"], - [test x$with_oss = xyes], [DEFAULT_PLAYER_AUDIO="OSS"], - [test x$with_alsa = xyes], [DEFAULT_PLAYER_AUDIO="ALSA"], - [test x$with_openal = xyes], [DEFAULT_PLAYER_AUDIO="OpenAL"], - [test x$with_libpulse = xyes], [DEFAULT_PLAYER_AUDIO="PulseAudio"])], - [DEFAULT_PLAYER_AUDIO="$with_player_audio"]) -AC_SUBST(DEFAULT_PLAYER_AUDIO) - -# Set some friendly strings if some of the above aren't detected. -DEFAULT_PLAYER_AUDIO=${DEFAULT_PLAYER_AUDIO:-NONE} - -############### -# Misc settings -############### -# Files that need substitution. -AC_CONFIG_FILES([ -packages/desktop/aegisub.desktop.template -src/libresrc/default_config_platform.json -tools/osx-bundle.sed -Makefile.inc -]) - -AC_OUTPUT - -AS_IF([test x"$DEFAULT_PLAYER_AUDIO" = xNONE], AC_MSG_NOTICE([ - -*********************************************************************** -* No supported audio player interface was found on your system. -* If you want audio support in Aegisub you need to install one of -* these libraries: -* - PulseAudio -* * http://pulseaudio.org/ -* - ALSA (Linux only) -* * http://www.alsa-project.org/ -* - PortAudio (version 19 only) -* * http://www.portaudio.com/ -*********************************************************************** -])) - -AS_IF([test x$with_ffms2 != xyes], [AC_MSG_NOTICE([ - -*********************************************************************** -* No supported video/audio reader interface was found on your system. -* You will not be able to open any video or audio files in Aegisub -* unless you install a supported video/audio provider. -* You will however still be able to open "dummy" video, ie. a blank, -* virtual video clip with subtitles overlaid. -* Currently we only support one video/audio provider on non-Windows -* systems: -* - FFMS2 -* * http://github.com/FFMS/ffms2 -*********************************************************************** -])]) - -AC_MSG_RESULT([ -Configure settings - Install prefix: $prefix - Revision: $BUILD_GIT_VERSION_STRING - Debug $enable_debug - CFLAGS $CFLAGS - CXXFLAGS $CXXFLAGS - CPPFLAGS $CPPFLAGS - LDFLAGS $LDFLAGS - LIBS $LIBS - -Default Settings - Audio Player: $DEFAULT_PLAYER_AUDIO - -Audio Players - ALSA: $with_alsa $alsa_disabled - OpenAL: $with_openal $openal_disabled - OSS: $with_oss $oss_disabled - PortAudio: $with_portaudio $portaudio_disabled - PulseAudio: $with_libpulse $libpulse_disabled - -Misc Packages - uchardet: $with_uchardet $uchardet_disabled - Hunspell: $with_hunspell $hunspell_disabled - FFTW3: $with_fftw3 $fftw3_disabled - LuaJIT: $system_luajit -]) diff --git a/header.mk b/header.mk deleted file mode 100644 index 613b38ff1..000000000 --- a/header.mk +++ /dev/null @@ -1,43 +0,0 @@ -d := $(abspath $(dir $(lastword $(filter-out $(lastword $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))))/ - -ifndef TOP -TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))/ -include $(TOP)Makefile.inc - -subdirs := \ - automation \ - libaegisub \ - packages/desktop \ - po \ - src \ - tests \ - tools \ - vendor/luabins \ - vendor/luajit - -subdirs := $(addprefix $(TOP),$(addsuffix /Makefile,$(subdirs))) - -INCLUDING_CHILD_MAKEFILES=yes -d_save := $d -$(foreach dir,$(filter-out $(abspath $(MAKEFILE_LIST)),$(subdirs)), $(eval include $(dir))) -d := $(d_save) -INCLUDING_CHILD_MAKEFILES=no - -DISTCLEANFILES += \ - $(TOP)acconf.h \ - $(TOP)configure \ - $(TOP)acconf.h.in~ \ - $(TOP)build/git_version.h \ - $(TOP)Makefile.inc \ - $(TOP)config.log \ - $(TOP)acconf.h.in \ - $(TOP)config.status \ - $(TOP)autom4te.cache \ - $(TOP)aclocal.m4 \ - -define MKDIR_INSTALL -@$(BIN_MKDIR_P) $(dir $@) -$(BIN_INSTALL) -m644 $< $@ -endef - -endif diff --git a/install-sh b/install-sh deleted file mode 100755 index 0360b79e7..000000000 --- a/install-sh +++ /dev/null @@ -1,501 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2016-01-11.22; # 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. - -tab=' ' -nl=' -' -IFS=" $tab$nl" - -# Set DOITPROG to "echo" to test this script. - -doit=${DOITPROG-} -doit_exec=${doit:-exec} - -# 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_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 -is_target_a_directory=possibly - -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 - *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) - is_target_a_directory=always - dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) is_target_a_directory=never;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -# We allow the use of options -d and -T together, by making -d -# take the precedence; this is for compatibility with GNU install. - -if test -n "$dir_arg"; then - if test -n "$dst_arg"; then - echo "$0: target directory not allowed when installing a directory." >&2 - exit 1 - fi -fi - -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 - if test $# -gt 1 || test "$is_target_a_directory" = always; then - if test ! -d "$dst_arg"; then - echo "$0: $dst_arg: Is not a directory." >&2 - exit 1 - fi - fi -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 "$is_target_a_directory" = never; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - dstdir=`dirname "$dst"` - 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-writable 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 - - oIFS=$IFS - IFS=/ - set -f - set fnord $dstdir - shift - 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` && - set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - 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: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/libaegisub/Makefile b/libaegisub/Makefile deleted file mode 100644 index 76fc8d6e4..000000000 --- a/libaegisub/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk - -aegisub_OBJ := \ - $(d)common/parser.o \ - $(d)ass/dialogue_parser.o \ - $(d)ass/time.o \ - $(d)ass/uuencode.o \ - $(patsubst %.cpp,%.o,$(sort $(wildcard $(d)audio/*.cpp))) \ - $(patsubst %.cpp,%.o,$(sort $(wildcard $(d)common/cajun/*.cpp))) \ - $(patsubst %.cpp,%.o,$(sort $(wildcard $(d)lua/modules/*.cpp))) \ - $(patsubst %.c,%.o,$(sort $(wildcard $(d)lua/modules/*.c))) \ - $(patsubst %.cpp,%.o,$(sort $(wildcard $(d)lua/*.cpp))) \ - $(patsubst %.cpp,%.o,$(sort $(wildcard $(d)unix/*.cpp))) \ - $(d)common/calltip_provider.o \ - $(d)common/character_count.o \ - $(d)common/charset.o \ - $(d)common/charset_6937.o \ - $(d)common/charset_conv.o \ - $(d)common/color.o \ - $(d)common/file_mapping.o \ - $(d)common/format.o \ - $(d)common/fs.o \ - $(d)common/hotkey.o \ - $(d)common/io.o \ - $(d)common/json.o \ - $(d)common/kana_table.o \ - $(d)common/karaoke_matcher.o \ - $(d)common/keyframe.o \ - $(d)common/line_iterator.o \ - $(d)common/log.o \ - $(d)common/mru.o \ - $(d)common/option.o \ - $(d)common/option_value.o \ - $(d)common/path.o \ - $(d)common/thesaurus.o \ - $(d)common/util.o \ - $(d)common/vfr.o \ - $(d)common/ycbcr_conv.o - -ifeq (yes, $(BUILD_DARWIN)) -aegisub_OBJ += $(patsubst %.mm,%.o,$(sort $(wildcard $(d)osx/*.mm))) -else -aegisub_OBJ += $(d)common/dispatch.o -endif - -aegisub_PCH := $(d)lagi_pre.h -aegisub_CPPFLAGS := -I$(d)include -I$(TOP) $(CPPFLAGS_BOOST) $(CFLAGS_LUA) $(CFLAGS_PTHREAD) - -$(d)common/charset.o_FLAGS := $(CFLAGS_UCHARDET) -$(d)common/charset_conv.o_FLAGS := $(CFLAGS_ICONV) -$(d)common/parser.o_FLAGS := -ftemplate-depth=256 -$(d)unix/path.o_FLAGS := -DP_DATA=\"$(P_DATA)\" - -LIB += aegisub - -include $(TOP)Makefile.target diff --git a/m4macros/ac_agi.m4 b/m4macros/ac_agi.m4 deleted file mode 100644 index e45a54767..000000000 --- a/m4macros/ac_agi.m4 +++ /dev/null @@ -1,51 +0,0 @@ -AC_DEFUN([AC_AGI_COMPILE],[ - aegisub_save_LIBS="$LIBS" - aegisub_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $3" - LIBS="$LIBS $4" - AC_LANG_PUSH(C++) - AC_CACHE_CHECK( - [whether $1 works], [agi_cv_with_$2], - [AC_RUN_IFELSE([AC_LANG_SOURCE([$5])], - [eval agi_cv_with_$2="yes"], - [eval agi_cv_with_$2="no"], - [AS_IF([test $? -ne 0], [eval agi_cv_with_$2="no"], [eval agi_cv_with_$2="yes"])])]) - AC_LANG_POP(C++) - CPPFLAGS="$aegisub_save_CPPFLAGS" - LIBS="$aegisub_save_LIBS" -]) - -AC_DEFUN([AC_AGI_LINK],[ - aegisub_save_LIBS="$LIBS" - aegisub_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $4" - LIBS="$LIBS $5" - AC_CHECK_HEADER([$3], [agi_cv_header="yes"], [agi_cv_header="no"]) - AS_IF([test "x$agi_cv_header" = xyes], - [AC_CACHE_CHECK( - [whether $1 works], [agi_cv_with_$2], - [AC_LINK_IFELSE([AC_LANG_SOURCE([$6])], [eval agi_cv_with_$2="yes"], [eval agi_cv_with_$2="no"])])] - [eval agi_cv_with_$2="no"]) - CPPFLAGS="$aegisub_save_CPPFLAGS" - LIBS="$aegisub_save_LIBS" -]) - -# An optional dependency which requires pkg-config -# Args: Name, AC_ARG_WITH help string, AC_DEFINE help string -AC_DEFUN([AGI_OPT_PKG], [ - m4_define([varname], m4_bpatsubst([$1], [-.*], []))dnl - m4_define([upper], m4_translit(varname, [a-z], [A-Z]))dnl - - AC_ARG_WITH(varname, AS_HELP_STRING([--without-][varname], [$2])) - AS_IF([test x$with_]varname[ = xno], - varname[_disabled="(disabled)"], - [PKG_CHECK_MODULES(upper, $1 >= varname[]_required_version, [ - AC_DEFINE([WITH_]upper, 1, $3) - with_[]varname="yes" - ], [ - AS_IF([test x$with_]varname[ = xyes], - [AC_MSG_FAILURE([--with-]varname[ was specified, but ]varname[ could not be found])]) - with_[]varname="no" - ])]) - AC_SUBST([with_]varname) -]) diff --git a/m4macros/ac_flag.m4 b/m4macros/ac_flag.m4 deleted file mode 100644 index 7b22ccad0..000000000 --- a/m4macros/ac_flag.m4 +++ /dev/null @@ -1,56 +0,0 @@ -AC_DEFUN([AC_C_FLAG], [{ - AC_LANG_PUSH(C) - ac_c_flag_save="$CFLAGS" - CFLAGS="$CFLAGS -Werror $1" - AC_MSG_CHECKING([[whether $CC supports $1]]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]])], - [ - CFLAGS="$ac_c_flag_save $1" - AC_MSG_RESULT([yes]) - ], [ - CFLAGS="$ac_c_flag_save" - AC_MSG_RESULT([no]) - $2 - ]) - AC_LANG_POP(C) - }]) -AC_DEFUN([AC_CXX_FLAG], [{ - AC_LANG_PUSH(C++) - ac_cxx_flag_save="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -Werror $1" - AC_MSG_CHECKING([[whether $CXX supports $1]]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]])], - [ - CXXFLAGS="$ac_cxx_flag_save $1" - AC_MSG_RESULT([yes]) - ], - [ - CXXFLAGS="$ac_cxx_flag_save" - AC_MSG_RESULT([no]) - $2 - ]) - AC_LANG_POP(C++) - }]) -AC_DEFUN([AC_PCH_FLAG], [{ - AC_LANG_PUSH(C++) - ac_cxx_flag_save="$CXXFLAGS" - ac_cxx_werror_flag_save="$ac_cxx_werror_flag" - ac_cxx_werror_flag=yes - CXXFLAGS="$CXXFLAGS -Werror $1" - AC_MSG_CHECKING([[whether $CXX supports $1]]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]])], - [ - PCHFLAGS="$PCHFLAGS $1" - AC_MSG_RESULT([yes]) - ], - [ - AC_MSG_RESULT([no]) - $2 - ]) - CXXFLAGS="$ac_cxx_flag_save" - ac_cxx_werror_flag="$ac_cxx_werror_flag_save" - AC_LANG_POP(C++) - }]) diff --git a/m4macros/agi_find_libheader.m4 b/m4macros/agi_find_libheader.m4 deleted file mode 100644 index 7d1dea637..000000000 --- a/m4macros/agi_find_libheader.m4 +++ /dev/null @@ -1,58 +0,0 @@ -AC_DEFUN([AGI_FIND_HEADER],[ - file=`echo $2 | $as_tr_sh` - - aegisub_save_CPPFLAGS="$CPPFLAGS" - - for dir in $3; do - vdir=`echo $dir | $as_tr_sh` - CPPFLAGS="-I$dir" - AC_CACHE_CHECK( - [for $2 in $dir], - [agi_cv_header_${vdir}_${file}], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([#include <$2>])], - [eval agi_cv_header_${vdir}_${file}="yes"; found="${dir}"], - [eval agi_cv_header_${vdir}_${file}="no"; found=""]) - ]) - - if test -n "$found"; then - break; - fi - done - - if test -n "$found"; then - $1_CFLAGS="-I$found" - fi - CPPFLAGS="$aegisub_save_CPPFLAGS" -]) - - -AC_DEFUN([AGI_FIND_LIB],[ - aegisub_save_LIBS="$LIBS" - - if test -n "$3"; then - LDDIR="-L$3" - fi - - for lib in $2; do - vlib=`echo $lib | $as_tr_sh` - LIBS="$LDDIR -l$lib" - AC_CACHE_CHECK( - [for -l${lib}], - [agi_cv_lib_${vlib}], - [AC_LINK_IFELSE( - [AC_LANG_PROGRAM()], - [eval agi_cv_lib_${vlib}="yes"; found="${lib}"], - [eval agi_cv_lib_${vlib}="no"; found=""]) - ]) - - if test -n "$found"; then - break; - fi - done - - if test -n "$found"; then - $1_LIBS="$LDDIR -l$found" - fi - LIBS="$aegisub_save_LIBS" -]) diff --git a/m4macros/ax_boost_base.m4 b/m4macros/ax_boost_base.m4 deleted file mode 100644 index 478050ff0..000000000 --- a/m4macros/ax_boost_base.m4 +++ /dev/null @@ -1,301 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_boost_base.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# DESCRIPTION -# -# Test for the Boost C++ libraries of a particular version (or newer) -# -# If no path to the installed boost library is given the macro searchs -# under /usr, /usr/local, /opt and /opt/local and evaluates the -# $BOOST_ROOT environment variable. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS) -# -# And sets: -# -# HAVE_BOOST -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg -# Copyright (c) 2009 Peter Adolphs -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 42 - -# example boost program (need to pass version) -m4_define([_AX_BOOST_BASE_PROGRAM], - [AC_LANG_PROGRAM([[ -#include -]],[[ -(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < ($1))])); -]])]) - -AC_DEFUN([AX_BOOST_BASE], -[ -AC_ARG_WITH([boost], - [AS_HELP_STRING([--with-boost@<:@=ARG@:>@], - [use Boost library from a standard location (ARG=yes), - from the specified location (ARG=), - or disable it (ARG=no) - @<:@ARG=yes@:>@ ])], - [ - AS_CASE([$withval], - [no],[want_boost="no";_AX_BOOST_BASE_boost_path=""], - [yes],[want_boost="yes";_AX_BOOST_BASE_boost_path=""], - [want_boost="yes";_AX_BOOST_BASE_boost_path="$withval"]) - ], - [want_boost="yes"]) - - -AC_ARG_WITH([boost-libdir], - [AS_HELP_STRING([--with-boost-libdir=LIB_DIR], - [Force given directory for boost libraries. - Note that this will override library path detection, - so use this parameter only if default library detection fails - and you know exactly where your boost libraries are located.])], - [ - AS_IF([test -d "$withval"], - [_AX_BOOST_BASE_boost_lib_path="$withval"], - [AC_MSG_ERROR([--with-boost-libdir expected directory name])]) - ], - [_AX_BOOST_BASE_boost_lib_path=""]) - -BOOST_LDFLAGS="" -BOOST_CPPFLAGS="" -AS_IF([test "x$want_boost" = "xyes"], - [_AX_BOOST_BASE_RUNDETECT([$1],[$2],[$3])]) -AC_SUBST(BOOST_CPPFLAGS) -AC_SUBST(BOOST_LDFLAGS) -]) - - -# convert a version string in $2 to numeric and affect to polymorphic var $1 -AC_DEFUN([_AX_BOOST_BASE_TONUMERICVERSION],[ - AS_IF([test "x$2" = "x"],[_AX_BOOST_BASE_TONUMERICVERSION_req="1.20.0"],[_AX_BOOST_BASE_TONUMERICVERSION_req="$2"]) - _AX_BOOST_BASE_TONUMERICVERSION_req_shorten=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\.[[0-9]]*\)'` - _AX_BOOST_BASE_TONUMERICVERSION_req_major=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\)'` - AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_major" = "x"], - [AC_MSG_ERROR([You should at least specify libboost major version])]) - _AX_BOOST_BASE_TONUMERICVERSION_req_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.\([[0-9]]*\)'` - AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_minor" = "x"], - [_AX_BOOST_BASE_TONUMERICVERSION_req_minor="0"]) - _AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - AS_IF([test "X$_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor" = "X"], - [_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor="0"]) - _AX_BOOST_BASE_TONUMERICVERSION_RET=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req_major \* 100000 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_minor \* 100 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor` - AS_VAR_SET($1,$_AX_BOOST_BASE_TONUMERICVERSION_RET) -]) - -dnl Run the detection of boost should be run only if $want_boost -AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[ - _AX_BOOST_BASE_TONUMERICVERSION(WANT_BOOST_VERSION,[$1]) - succeeded=no - - - AC_REQUIRE([AC_CANONICAL_HOST]) - dnl On 64-bit systems check for system libraries in both lib64 and lib. - dnl The former is specified by FHS, but e.g. Debian does not adhere to - dnl this (as it rises problems for generic multi-arch support). - dnl The last entry in the list is chosen by default when no libraries - dnl are found, e.g. when only header-only libraries are installed! - AS_CASE([${host_cpu}], - [x86_64],[libsubdirs="lib64 libx32 lib lib64"], - [ppc64|s390x|sparc64|aarch64|ppc64le],[libsubdirs="lib64 lib lib64"], - [libsubdirs="lib"], - ) - - dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give - dnl them priority over the other paths since, if libs are found there, they - dnl are almost assuredly the ones desired. - AS_CASE([${host_cpu}], - [i?86],[multiarch_libsubdir="lib/i386-${host_os}"], - [multiarch_libsubdir="lib/${host_cpu}-${host_os}"] - ) - - dnl first we check the system location for boost libraries - dnl this location ist chosen if boost libraries are installed with the --layout=system option - dnl or if you install boost with RPM - AS_IF([test "x$_AX_BOOST_BASE_boost_path" != "x"],[ - AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) includes in "$_AX_BOOST_BASE_boost_path/include"]) - AS_IF([test -d "$_AX_BOOST_BASE_boost_path/include" && test -r "$_AX_BOOST_BASE_boost_path/include"],[ - AC_MSG_RESULT([yes]) - BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include" - for _AX_BOOST_BASE_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do - AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) lib path in "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp"]) - AS_IF([test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" ],[ - AC_MSG_RESULT([yes]) - BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp"; - break; - ], - [AC_MSG_RESULT([no])]) - done],[ - AC_MSG_RESULT([no])]) - ],[ - if test X"$cross_compiling" = Xyes; then - search_libsubdirs=$multiarch_libsubdir - else - search_libsubdirs="$multiarch_libsubdir $libsubdirs" - fi - for _AX_BOOST_BASE_boost_path_tmp in /usr /usr/local /opt /opt/local ; do - if test -d "$_AX_BOOST_BASE_boost_path_tmp/include/boost" && test -r "$_AX_BOOST_BASE_boost_path_tmp/include/boost" ; then - for libsubdir in $search_libsubdirs ; do - if ls "$_AX_BOOST_BASE_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path_tmp/$libsubdir" - BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path_tmp/include" - break; - fi - done - ]) - - dnl overwrite ld flags if we have required special directory with - dnl --with-boost-libdir parameter - AS_IF([test "x$_AX_BOOST_BASE_boost_lib_path" != "x"], - [BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_lib_path"]) - - AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION)]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_REQUIRE([AC_PROG_CXX]) - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - - - - dnl if we found no boost with system layout we search for boost libraries - dnl built and installed without the --layout=system option or for a staged(not installed) version - if test "x$succeeded" != "xyes" ; then - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - BOOST_CPPFLAGS= - if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then - BOOST_LDFLAGS= - fi - _version=0 - if test -n "$_AX_BOOST_BASE_boost_path" ; then - if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path"; then - for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "x$V_CHECK" = "x1" ; then - _version=$_version_tmp - fi - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include/boost-$VERSION_UNDERSCORE" - done - dnl if nothing found search for layout used in Windows distributions - if test -z "$BOOST_CPPFLAGS"; then - if test -d "$_AX_BOOST_BASE_boost_path/boost" && test -r "$_AX_BOOST_BASE_boost_path/boost"; then - BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path" - fi - fi - dnl if we found something and BOOST_LDFLAGS was unset before - dnl (because "$_AX_BOOST_BASE_boost_lib_path" = ""), set it here. - if test -n "$BOOST_CPPFLAGS" && test -z "$BOOST_LDFLAGS"; then - for libsubdir in $libsubdirs ; do - if ls "$_AX_BOOST_BASE_boost_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$libsubdir" - fi - fi - else - if test "x$cross_compiling" != "xyes" ; then - for _AX_BOOST_BASE_boost_path in /usr /usr/local /opt /opt/local ; do - if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path" ; then - for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "x$V_CHECK" = "x1" ; then - _version=$_version_tmp - best_path=$_AX_BOOST_BASE_boost_path - fi - done - fi - done - - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" - if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then - for libsubdir in $libsubdirs ; do - if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - BOOST_LDFLAGS="-L$best_path/$libsubdir" - fi - fi - - if test -n "$BOOST_ROOT" ; then - for libsubdir in $libsubdirs ; do - if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` - stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` - V_CHECK=`expr $stage_version_shorten \>\= $_version` - if test "x$V_CHECK" = "x1" && test -z "$_AX_BOOST_BASE_boost_lib_path" ; then - AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) - BOOST_CPPFLAGS="-I$BOOST_ROOT" - BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir" - fi - fi - fi - fi - - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - fi - - if test "x$succeeded" != "xyes" ; then - if test "x$_version" = "x0" ; then - AC_MSG_NOTICE([[We could not detect the boost libraries (version $1 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation.]]) - else - AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).]) - fi - # execute ACTION-IF-NOT-FOUND (if present): - ifelse([$3], , :, [$3]) - else - AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) - # execute ACTION-IF-FOUND (if present): - ifelse([$2], , :, [$2]) - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - -]) \ No newline at end of file diff --git a/m4macros/ax_boost_chrono.m4 b/m4macros/ax_boost_chrono.m4 deleted file mode 100644 index 6ea77b9b3..000000000 --- a/m4macros/ax_boost_chrono.m4 +++ /dev/null @@ -1,118 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_boost_chrono.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_CHRONO -# -# DESCRIPTION -# -# Test for Chrono library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_CHRONO_LIB) -# -# And sets: -# -# HAVE_BOOST_CHRONO -# -# LICENSE -# -# Copyright (c) 2012 Xiyue Deng -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 4 - -AC_DEFUN([AX_BOOST_CHRONO], -[ - AC_ARG_WITH([boost-chrono], - AS_HELP_STRING([--with-boost-chrono@<:@=special-lib@:>@], - [use the Chrono library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-chrono=boost_chrono-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_chrono_lib="" - else - want_boost="yes" - ax_boost_user_chrono_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_BUILD]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Chrono library is available, - ax_cv_boost_chrono, - [AC_LANG_PUSH([C++]) - CXXFLAGS_SAVE=$CXXFLAGS - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], - [[boost::chrono::system_clock::time_point* time = new boost::chrono::system_clock::time_point; delete time;]])], - ax_cv_boost_chrono=yes, ax_cv_boost_chrono=no) - CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_chrono" = "xyes"; then - AC_SUBST(BOOST_CPPFLAGS) - - AC_DEFINE(HAVE_BOOST_CHRONO,,[define if the Boost::Chrono library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - - LDFLAGS_SAVE=$LDFLAGS - if test "x$ax_boost_user_chrono_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_chrono*.so* $BOOSTLIBDIR/libboost_chrono*.dylib* $BOOSTLIBDIR/libboost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_chrono.*\)\.so.*$;\1;' -e 's;^lib\(boost_chrono.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_chrono.*\)\.a.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break], - [link_chrono="no"]) - done - if test "x$link_chrono" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_chrono*.dll* $BOOSTLIBDIR/boost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_chrono.*\)\.dll.*$;\1;' -e 's;^\(boost_chrono.*\)\.a.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break], - [link_chrono="no"]) - done - fi - - else - for ax_lib in $ax_boost_user_chrono_lib boost_chrono-$ax_boost_user_chrono_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break], - [link_chrono="no"]) - done - - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the library!) - fi - if test "x$link_chrono" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/m4macros/ax_boost_filesystem.m4 b/m4macros/ax_boost_filesystem.m4 deleted file mode 100644 index c392f9d65..000000000 --- a/m4macros/ax_boost_filesystem.m4 +++ /dev/null @@ -1,118 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_FILESYSTEM -# -# DESCRIPTION -# -# Test for Filesystem library from the Boost C++ libraries. The macro -# requires a preceding call to AX_BOOST_BASE. Further documentation is -# available at . -# -# This macro calls: -# -# AC_SUBST(BOOST_FILESYSTEM_LIB) -# -# And sets: -# -# HAVE_BOOST_FILESYSTEM -# -# LICENSE -# -# Copyright (c) 2009 Thomas Porschberg -# Copyright (c) 2009 Michael Tindal -# Copyright (c) 2009 Roman Rybalko -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 27 - -AC_DEFUN([AX_BOOST_FILESYSTEM], -[ - AC_ARG_WITH([boost-filesystem], - AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@], - [use the Filesystem library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_filesystem_lib="" - else - want_boost="yes" - ax_boost_user_filesystem_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - LIBS_SAVED=$LIBS - LIBS="$LIBS $BOOST_SYSTEM_LIB" - export LIBS - - AC_CACHE_CHECK(whether the Boost::Filesystem library is available, - ax_cv_boost_filesystem, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], - [[using namespace boost::filesystem; - path my_path( "foo/bar/data.txt" ); - return 0;]])], - ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_filesystem" = "xyes"; then - AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - if test "x$ax_boost_user_filesystem_lib" = "x"; then - for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], - [link_filesystem="no"]) - done - if test "x$link_filesystem" != "xyes"; then - for libextension in `ls -r $BOOSTLIBDIR/boost_filesystem* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], - [link_filesystem="no"]) - done - fi - else - for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], - [link_filesystem="no"]) - done - - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the library!) - fi - if test "x$link_filesystem" != "xyes"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - LIBS="$LIBS_SAVED" - fi -]) diff --git a/m4macros/ax_boost_locale.m4 b/m4macros/ax_boost_locale.m4 deleted file mode 100644 index adaedf09e..000000000 --- a/m4macros/ax_boost_locale.m4 +++ /dev/null @@ -1,119 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_boost_locale.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_LOCALE -# -# DESCRIPTION -# -# Test for System library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_LOCALE_LIB) -# -# And sets: -# -# HAVE_BOOST_LOCALE -# -# LICENSE -# -# Copyright (c) 2012 Xiyue Deng -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 2 - -AC_DEFUN([AX_BOOST_LOCALE], -[ - AC_ARG_WITH([boost-locale], - AS_HELP_STRING([--with-boost-locale@<:@=special-lib@:>@], - [use the Locale library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-locale=boost_locale-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_locale_lib="" - else - want_boost="yes" - ax_boost_user_locale_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_BUILD]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Locale library is available, - ax_cv_boost_locale, - [AC_LANG_PUSH([C++]) - CXXFLAGS_SAVE=$CXXFLAGS - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], - [[boost::locale::generator gen; - std::locale::global(gen(""));]])], - ax_cv_boost_locale=yes, ax_cv_boost_locale=no) - CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_locale" = "xyes"; then - AC_SUBST(BOOST_CPPFLAGS) - - AC_DEFINE(HAVE_BOOST_LOCALE,,[define if the Boost::Locale library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - - LDFLAGS_SAVE=$LDFLAGS - if test "x$ax_boost_user_locale_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_locale*.so* $BOOSTLIBDIR/libboost_locale*.dylib* $BOOSTLIBDIR/libboost_locale*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_locale.*\)\.so.*$;\1;' -e 's;^lib\(boost_locale.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_locale.*\)\.a.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_LOCALE_LIB="-l$ax_lib"; AC_SUBST(BOOST_LOCALE_LIB) link_locale="yes"; break], - [link_locale="no"]) - done - if test "x$link_locale" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_locale*.dll* $BOOSTLIBDIR/boost_locale*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_locale.*\)\.dll.*$;\1;' -e 's;^\(boost_locale.*\)\.a.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_LOCALE_LIB="-l$ax_lib"; AC_SUBST(BOOST_LOCALE_LIB) link_locale="yes"; break], - [link_locale="no"]) - done - fi - - else - for ax_lib in $ax_boost_user_locale_lib boost_locale-$ax_boost_user_locale_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_LOCALE_LIB="-l$ax_lib"; AC_SUBST(BOOST_LOCALE_LIB) link_locale="yes"; break], - [link_locale="no"]) - done - - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the library!) - fi - if test "x$link_locale" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/m4macros/ax_boost_regex.m4 b/m4macros/ax_boost_regex.m4 deleted file mode 100644 index e2413c24f..000000000 --- a/m4macros/ax_boost_regex.m4 +++ /dev/null @@ -1,111 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_boost_regex.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_REGEX -# -# DESCRIPTION -# -# Test for Regex library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_REGEX_LIB) -# -# And sets: -# -# HAVE_BOOST_REGEX -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg -# Copyright (c) 2008 Michael Tindal -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 23 - -AC_DEFUN([AX_BOOST_REGEX], -[ - AC_ARG_WITH([boost-regex], - AS_HELP_STRING([--with-boost-regex@<:@=special-lib@:>@], - [use the Regex library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_regex_lib="" - else - want_boost="yes" - ax_boost_user_regex_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Regex library is available, - ax_cv_boost_regex, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include - ]], - [[boost::regex r(); return 0;]])], - ax_cv_boost_regex=yes, ax_cv_boost_regex=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_regex" = "xyes"; then - AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - if test "x$ax_boost_user_regex_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_regex*.so* $BOOSTLIBDIR/libboost_regex*.dylib* $BOOSTLIBDIR/libboost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.dylib.*;\1;' -e 's;^lib\(boost_regex.*\)\.a.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], - [link_regex="no"]) - done - if test "x$link_regex" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_regex*.dll* $BOOSTLIBDIR/boost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], - [link_regex="no"]) - done - fi - - else - for ax_lib in $ax_boost_user_regex_lib boost_regex-$ax_boost_user_regex_lib; do - AC_CHECK_LIB($ax_lib, main, - [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], - [link_regex="no"]) - done - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the Boost::Regex library!) - fi - if test "x$link_regex" != "xyes"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/m4macros/ax_boost_system.m4 b/m4macros/ax_boost_system.m4 deleted file mode 100644 index 207d7be8d..000000000 --- a/m4macros/ax_boost_system.m4 +++ /dev/null @@ -1,121 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_boost_system.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_SYSTEM -# -# DESCRIPTION -# -# Test for System library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_SYSTEM_LIB) -# -# And sets: -# -# HAVE_BOOST_SYSTEM -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg -# Copyright (c) 2008 Michael Tindal -# Copyright (c) 2008 Daniel Casimiro -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 19 - -AC_DEFUN([AX_BOOST_SYSTEM], -[ - AC_ARG_WITH([boost-system], - AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@], - [use the System library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-system=boost_system-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_system_lib="" - else - want_boost="yes" - ax_boost_user_system_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_BUILD]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::System library is available, - ax_cv_boost_system, - [AC_LANG_PUSH([C++]) - CXXFLAGS_SAVE=$CXXFLAGS - CXXFLAGS= - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], - [[boost::system::error_category *a = 0;]])], - ax_cv_boost_system=yes, ax_cv_boost_system=no) - CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_system" = "xyes"; then - AC_SUBST(BOOST_CPPFLAGS) - - AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - - LDFLAGS_SAVE=$LDFLAGS - if test "x$ax_boost_user_system_lib" = "x"; then - for libextension in `ls -r $BOOSTLIBDIR/libboost_system* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], - [link_system="no"]) - done - if test "x$link_system" != "xyes"; then - for libextension in `ls -r $BOOSTLIBDIR/boost_system* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], - [link_system="no"]) - done - fi - - else - for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], - [link_system="no"]) - done - - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the library!) - fi - if test "x$link_system" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/m4macros/ax_boost_thread.m4 b/m4macros/ax_boost_thread.m4 deleted file mode 100644 index eee9ab61e..000000000 --- a/m4macros/ax_boost_thread.m4 +++ /dev/null @@ -1,163 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_boost_thread.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_THREAD -# -# DESCRIPTION -# -# Test for Thread library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_THREAD_LIB) -# -# And sets: -# -# HAVE_BOOST_THREAD -# -# LICENSE -# -# Copyright (c) 2009 Thomas Porschberg -# Copyright (c) 2009 Michael Tindal -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 31 - -AC_DEFUN([AX_BOOST_THREAD], -[ - AC_ARG_WITH([boost-thread], - AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@], - [use the Thread library from boost - - it is possible to specify a certain library for the linker - e.g. --with-boost-thread=boost_thread-gcc-mt ]), - [ - if test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_thread_lib="" - else - want_boost="yes" - ax_boost_user_thread_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_BUILD]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Thread library is available, - ax_cv_boost_thread, - [AC_LANG_PUSH([C++]) - CXXFLAGS_SAVE=$CXXFLAGS - - if test "x$host_os" = "xsolaris" ; then - CXXFLAGS="-pthreads $CXXFLAGS" - elif test "x$host_os" = "xmingw32" ; then - CXXFLAGS="-mthreads $CXXFLAGS" - else - CXXFLAGS="-pthread $CXXFLAGS" - fi - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM( - [[@%:@include ]], - [[boost::thread_group thrds; - return 0;]])], - ax_cv_boost_thread=yes, ax_cv_boost_thread=no) - CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_thread" = "xyes"; then - if test "x$host_os" = "xsolaris" ; then - BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS" - elif test "x$host_os" = "xmingw32" ; then - BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS" - else - BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS" - fi - - AC_SUBST(BOOST_CPPFLAGS) - - AC_DEFINE(HAVE_BOOST_THREAD,, - [define if the Boost::Thread library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - - LDFLAGS_SAVE=$LDFLAGS - case "x$host_os" in - *bsd* ) - LDFLAGS="-pthread $LDFLAGS" - break; - ;; - esac - if test "x$ax_boost_user_thread_lib" = "x"; then - for libextension in `ls -r $BOOSTLIBDIR/libboost_thread* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'`; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [link_thread="yes"; break], - [link_thread="no"]) - done - if test "x$link_thread" != "xyes"; then - for libextension in `ls -r $BOOSTLIBDIR/boost_thread* 2>/dev/null | sed 's,.*/,,' | sed 's,\..*,,'`; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [link_thread="yes"; break], - [link_thread="no"]) - done - fi - - else - for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do - AC_CHECK_LIB($ax_lib, exit, - [link_thread="yes"; break], - [link_thread="no"]) - done - - fi - if test "x$ax_lib" = "x"; then - AC_MSG_ERROR(Could not find a version of the library!) - fi - if test "x$link_thread" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - else - BOOST_THREAD_LIB="-l$ax_lib" - case "x$host_os" in - *bsd* ) - BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS" - break; - ;; - xsolaris ) - BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread" - break; - ;; - xmingw32 ) - break; - ;; - * ) - BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread" - break; - ;; - esac - AC_SUBST(BOOST_THREAD_LIB) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/m4macros/ax_check_gl.m4 b/m4macros/ax_check_gl.m4 deleted file mode 100644 index 39423bf7f..000000000 --- a/m4macros/ax_check_gl.m4 +++ /dev/null @@ -1,559 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_check_gl.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_GL -# -# DESCRIPTION -# -# Check for an OpenGL implementation. If GL is found, the required -# compiler and linker flags are included in the output variables -# "GL_CFLAGS", "GL_LIBS", "GL_LDFLAGS", respectively. If no usable GL -# implementation is found, "no_gl" is set to "yes". -# -# You could disable OpenGL using --with-gl=no -# -# You could choose a specific OpenGL libs using --with-gl=lib_name -# -# Under darwin, cygwin and mingw target you could prefer the OpenGL -# implementation that link with X setting --with-gl=x or without X support -# with --with-gl=nox. Notes that this script try to guess the right -# implementation. -# -# If the header "GL/gl.h" is found, "HAVE_GL_GL_H" is defined. If the -# header "OpenGL/gl.h" is found, HAVE_OPENGL_GL_H is defined. These -# preprocessor definitions may not be mutually exclusive. -# -# You should use something like this in your headers: -# -# #if defined(HAVE_WINDOWS_H) && defined(_WIN32) -# # include -# #endif -# #ifdef HAVE_GL_GL_H -# # include -# #elif defined(HAVE_OPENGL_GL_H) -# # include -# #else -# # error no gl.h -# #endif -# -# LICENSE -# -# Copyright (c) 2009 Braden McDaniel -# Copyright (c) 2012 Bastien Roucaries -# -# 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, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 17 - -m4_define([_AX_CHECK_GL_PROGRAM], - [AC_LANG_PROGRAM([[ -# if defined(HAVE_WINDOWS_H) && defined(_WIN32) -# include -# endif -# ifdef HAVE_GL_GL_H -# include -# elif defined(HAVE_OPENGL_GL_H) -# include -# else -# error no gl.h -# endif -]],[[glBegin(0)]])]) - -dnl Default include : add windows.h -dnl see http://www.opengl.org/wiki/Platform_specifics:_Windows -dnl (acceded 20120801) -AC_DEFUN([_AX_CHECK_GL_INCLUDES_DEFAULT],dnl -[ - AC_INCLUDES_DEFAULT - [ - # if defined(HAVE_WINDOWS_H) && defined(_WIN32) - # include - # endif - ] -]) - -dnl local save flags -AC_DEFUN([_AX_CHECK_GL_SAVE_FLAGS], -[dnl -ax_check_gl_saved_libs="${LIBS}" -ax_check_gl_saved_cflags="${CFLAGS}" -ax_check_gl_saved_cppflags="${CPPFLAGS}" -ax_check_gl_saved_ldflags="${LDFLAGS}" -]) - -dnl local restore flags -AC_DEFUN([_AX_CHECK_GL_RESTORE_FLAGS], -[dnl -LIBS="${ax_check_gl_saved_libs}" -CFLAGS="${ax_check_gl_saved_cflags}" -CPPFLAGS="${ax_check_gl_saved_cppflags}" -LDFLAGS="${ax_check_gl_saved_ldflags}" -]) - -dnl default switch case failure -AC_DEFUN([_AX_CHECK_MSG_FAILURE_ORDER], -[dnl - AC_MSG_FAILURE([Order logic in ax_check_gl is buggy]) -]) - -# set the varible ax_check_gl_need_x -# this variable determine if we need opengl that link with X -# value are default aka try the first library wether if it link or not with x -# yes that means we need a opengl with x -# no that means we do not need an opengl with x -AC_DEFUN([_AX_CHECK_GL_NEED_X], -[dnl - # do not check if empty : allow a subroutine to modify the choice - AS_IF([test "X$ax_check_gl_need_x" = "X"], - [ax_check_gl_need_x="default" - AS_IF([test "X$no_x" = "Xyes"],[ax_check_gl_need_x="no"]) - AS_IF([test "X$ax_check_gl_want_gl" = "Xnox"],[ax_check_gl_need_x="no"]) - AS_IF([test "X$ax_check_gl_want_gl" = "Xx"],[ax_check_gl_need_x="yes"])]) -]) - -# compile the example program -AC_DEFUN([_AX_CHECK_GL_COMPILE], -[dnl - AC_LANG_PUSH([C]) - _AX_CHECK_GL_SAVE_FLAGS() - CFLAGS="${GL_CFLAGS} ${CFLAGS}" - AC_COMPILE_IFELSE([_AX_CHECK_GL_PROGRAM], - [ax_check_gl_compile_opengl="yes"], - [ax_check_gl_compile_opengl="no"]) - _AX_CHECK_GL_RESTORE_FLAGS() - AC_LANG_POP([C]) -]) - -# compile the example program (cache) -AC_DEFUN([_AX_CHECK_GL_COMPILE_CV], -[dnl - AC_CACHE_CHECK([for compiling a minimal OpenGL program],[ax_cv_check_gl_compile_opengl], - [_AX_CHECK_GL_COMPILE() - ax_cv_check_gl_compile_opengl="${ax_check_gl_compile_opengl}"]) - ax_check_gl_compile_opengl="${ax_cv_check_gl_compile_opengl}" -]) - -# link the example program -AC_DEFUN([_AX_CHECK_GL_LINK], -[dnl - AC_LANG_PUSH([C]) - _AX_CHECK_GL_SAVE_FLAGS() - CFLAGS="${GL_CFLAGS} ${CFLAGS}" - LIBS="${GL_LIBS} ${LIBS}" - LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}" - AC_LINK_IFELSE([_AX_CHECK_GL_PROGRAM], - [ax_check_gl_link_opengl="yes"], - [ax_check_gl_link_opengl="no"]) - _AX_CHECK_GL_RESTORE_FLAGS() - AC_LANG_POP([C]) -]) - -# link the example program (cache) -AC_DEFUN([_AX_CHECK_GL_LINK_CV], -[dnl - AC_CACHE_CHECK([for linking a minimal OpenGL program],[ax_cv_check_gl_link_opengl], - [_AX_CHECK_GL_LINK() - ax_cv_check_gl_link_opengl="${ax_check_gl_link_opengl}"]) - ax_check_gl_link_opengl="${ax_cv_check_gl_link_opengl}" -]) - -dnl Check headers manually (default case) -AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS_DEFAULT], -[AC_REQUIRE([AC_PATH_XTRA]) - AC_LANG_PUSH([C]) - _AX_CHECK_GL_SAVE_FLAGS() - CFLAGS="${GL_CFLAGS} ${CFLAGS}" - # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT - AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT]) - # FIXME: use extra cflags - AC_CHECK_HEADERS([GL/gl.h],[ax_check_gl_have_headers="yes"], - [ax_check_gl_have_headers_headers="no"], - [_AX_CHECK_GL_INCLUDES_DEFAULT()]) - # do not try darwin specific OpenGl/gl.h - _AX_CHECK_GL_RESTORE_FLAGS() - AC_LANG_POP([C]) -]) - -# darwin headers without X -AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX],[ - AC_LANG_PUSH([C]) - _AX_CHECK_GL_SAVE_FLAGS() - # FIXME: use -framework opengl as an extra cflags - CFLAGS="-framework opengl ${GL_CFLAGS} ${CFLAGS}" - AC_CHECK_HEADERS([OpenGL/gl.h],[ax_check_gl_have_headers="yes"], - [ax_check_gl_have_headers_headers="no"], - [_AX_CHECK_GL_INCLUDES_DEFAULT()]) - AS_IF([test "X$ax_check_gl_have_headers" = "yes"], - [GL_CFLAGS="-framework opengl ${GL_CFLAGS}"]) - _AX_CHECK_GL_SAVE_FLAGS() - AC_LANG_POP([C]) -]) - -# check header for darwin -AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS_DARWIN], -[AC_REQUIRE([_AX_CHECK_GL_NEED_X])dnl - AS_CASE(["$ax_check_gl_order"], - # try to use framework - ["gl"],[_AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX()], - # try to use framework then mesa (X) - ["gl mesagl"],[ - _AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX() - AS_IF([test "X$ax_check_gl_have_headers" = "yes"], - [ax_check_gl_order="gl" - ax_check_gl_need_x="yes"], - [ax_check_gl_order="mesagl gl" - ax_check_gl_need_x="no"] - # retry with general test - _AX_CHECK_GL_MANUAL_HEADERS_DEFAULT()])], - ["mesagl gl"],[ - _AX_CHECK_GL_MANUAL_HEADERS_DEFAULT() - AS_IF([test "X$ax_check_gl_have_headers" = "yes"], - [ax_check_gl_order="mesagl gl" - ax_check_gl_need_x="no"], - [ax_check_gl_order="gl" - ax_check_gl_need_x="yes" - # retry with framework - _AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX()])], - [_AX_CHECK_MSG_FAILURE_ORDER()]) -]) - -dnl Check headers manually: subroutine must set ax_check_gl_have_headers={yes,no} -AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS], -[AC_REQUIRE([AC_CANONICAL_HOST]) - AS_CASE([${host}], - [*-darwin*],[_AX_CHECK_GL_MANUAL_HEADERS_DARWIN], - [_AX_CHECK_GL_MANUAL_HEADERS_DEFAULT()]) - AC_CACHE_CHECK([for OpenGL headers],[ax_cv_check_gl_have_headers], - [ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"]) -]) - -# dnl try to found library (generic case) -# dnl $1 is set to the library to found -AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS_GENERIC], -[dnl - ax_check_gl_manual_libs_generic_extra_libs="$1" - AS_IF([test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"], - [AC_MSG_ERROR([AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty])]) - - AC_LANG_PUSH([C]) - _AX_CHECK_GL_SAVE_FLAGS() - CFLAGS="${GL_CFLAGS} ${CFLAGS}" - LIBS="${GL_LIBS} ${LIBS}" - AC_SEARCH_LIBS([glBegin],[$ax_check_gl_manual_libs_generic_extra_libs], - [ax_check_gl_lib_opengl="yes"], - [ax_check_gl_lib_opengl="no"]) - AS_CASE([$ac_cv_search_glBegin], - ["none required"],[], - [no],[], - [GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}"]) - _AX_CHECK_GL_RESTORE_FLAGS() - AC_LANG_PUSH([C]) -]) - -# dnl try to found lib under darwin -# darwin opengl hack -# see http://web.archive.org/web/20090410052741/http://developer.apple.com/qa/qa2007/qa1567.html -# and http://web.eecs.umich.edu/~sugih/courses/eecs487/glut-howto/ -AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS_DARWIN], -[# ldhack list - ldhack1 = "-Wl,-framework,OpenGL" - ldhack2 = "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" - ldhack3 = "$ldhack1,$ldhack2" - - # select hack - AS_IF([test "X$ax_check_gl_need_x" = "Xyes"], - [# libs already set by -framework cflag - darwinlibs="" - ldhacks="$ldhack1 $ldhack2 $ldhack3"], - [# do not use framework ldflags in case of x version - darwinlibs="GL gl MesaGL" - ldhack="$ldhack2"]) - - ax_check_gl_link_opengl="no" - for extralibs in " " $darwinlibs; do - for extraldflags in " " ldhacks; do - AC_LANG_PUSH([C]) - _AX_CHECK_GL_SAVE_FLAGS() - CFLAGS="${GL_CFLAGS} ${CFLAGS}" - LIBS="$extralibs ${GL_LIBS} ${LIBS}" - LDFLAGS="$extraldflags ${GL_LDFLAGS} ${LDFLAGS}" - AC_LINK_IFELSE([_AX_CHECK_GL_PROGRAM], - [ax_check_gl_link_opengl="yes"], - [ax_check_gl_link_opengl="no"]) - _AX_CHECK_GL_RESTORE_FLAGS() - AC_LANG_POP([C]) - AS_IF([test "X$ax_check_gl_link_opengl" = "Xyes"],[break]) - done; - AS_IF([test "X$ax_check_gl_link_opengl" = "Xyes"],[break]) - done; - GL_LIBS="$extralibs ${GL_LIBS}" - GL_LDFLAGS="$extraldflags ${GL_LDFLAGS}" -]) - -dnl Check library manually: subroutine must set -dnl $ax_check_gl_lib_opengl={yes,no} -AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS], -[AC_REQUIRE([AC_CANONICAL_HOST]) - AS_CASE([${host}], - [*-darwin*],[_AX_CHECK_GL_MANUAL_LIBS_DARWIN()], - # try first cygwin version - [*-cygwin*|*-mingw*],[ - AS_CASE(["$ax_check_gl_order"], - ["gl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([opengl32])], - ["gl mesagl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([opengl32 GL gl MesaGL])], - ["mesagl gl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([GL gl MesaGL opengl32])], - [_AX_CHECK_MSG_FAILURE_ORDER()])], - [AS_CASE(["$ax_check_gl_order"], - ["gl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([GL gl])], - ["gl mesagl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([GL gl MesaGL])], - ["mesagl gl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([MesaGL GL gl])], - [_AX_CHECK_MSG_FAILURE_ORDER()])] - ) - - AC_CACHE_CHECK([for OpenGL libraries],[ax_cv_check_gl_lib_opengl], - [ax_cv_check_gl_lib_opengl="${ax_check_gl_lib_opengl}"]) - ax_check_gl_lib_opengl="${ax_cv_check_gl_lib_opengl}" -]) - -# manually check aka old way -AC_DEFUN([_AX_CHECK_GL_MANUAL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl - AC_REQUIRE([AC_PATH_XTRA])dnl - - no_gl="yes" - - _AX_CHECK_GL_MANUAL_HEADERS() - AS_IF([test "X$ax_check_gl_have_headers" = "Xyes"], - [_AX_CHECK_GL_COMPILE_CV()], - [ax_check_gl_compile_opengl=no]) - - AS_IF([test "X$ax_check_gl_compile_opengl" = "Xyes"], - [_AX_CHECK_GL_MANUAL_LIBS], - [ax_check_gl_lib_opengl=no]) - - AS_IF([test "X$ax_check_gl_lib_opengl" = "Xyes"], - [_AX_CHECK_GL_LINK_CV()], - [ax_check_gl_link_opengl=no]) - - AS_IF([test "X$ax_check_gl_link_opengl" = "Xyes"], - [no_gl="no"], - [no_gl="yes"]) -])dnl - - -# try to test using pkgconfig: set ax_check_gl_pkg_config=no if not found -AC_DEFUN([_AX_CHECK_GL_PKG_CONFIG],dnl -[dnl - AC_REQUIRE([PKG_PROG_PKG_CONFIG]) - - dnl First try mesagl - AS_CASE(["$ax_check_gl_order"], - ["gl"],[PKG_CHECK_MODULES([GL],[mesagl], - [ax_check_gl_pkg_config=yes], - [ax_check_gl_pkg_config=no])], - ["gl mesagl"],[PKG_CHECK_MODULES([GL],[gl], - [ax_check_gl_pkg_config=yes], - [PKG_CHECK_MODULES([GL],[mesagl], - [ax_check_gl_pkg_config=yes], - [ax_check_gl_pkg_config=no])])], - ["mesagl gl"],[PKG_CHECK_MODULES([GL],[mesagl], - [ax_check_gl_pkg_config=yes], - [PKG_CHECK_MODULES([GL],[gl], - [ax_check_gl_pkg_config=yes], - [ax_check_gl_pkg_config=no])])], - [_AX_CHECK_MSG_FAILURE_ORDER]) - - AS_IF([test "X$ax_check_gl_pkg_config" = "Xyes"],[ - # check headers - AC_LANG_PUSH([C]) - _AX_CHECK_GL_SAVE_FLAGS() - CFLAGS="${GL_CFLAGS} ${CFLAGS}" - AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT]) - AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h], - [ax_check_gl_have_headers="yes";break], - [ax_check_gl_have_headers_headers="no"], - [_AX_CHECK_GL_INCLUDES_DEFAULT()]) - _AX_CHECK_GL_RESTORE_FLAGS() - AC_LANG_POP([C]) - AC_CACHE_CHECK([for OpenGL headers],[ax_cv_check_gl_have_headers], - [ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"]) - - # pkgconfig library are suposed to work ... - AS_IF([test "X$ax_cv_check_gl_have_headers" = "Xno"], - [AC_MSG_ERROR("Pkgconfig detected OpenGL library has no headers!")]) - - _AX_CHECK_GL_COMPILE_CV() - AS_IF([test "X$ax_cv_check_gl_compile_opengl" = "Xno"], - [AC_MSG_ERROR("Pkgconfig detected opengl library could not be used for compiling minimal program!")]) - - _AX_CHECK_GL_LINK_CV() - AS_IF([test "X$ax_cv_check_gl_link_opengl" = "Xno"], - [AC_MSG_ERROR("Pkgconfig detected opengl library could not be used for linking minimal program!")]) - ],[ax_check_gl_pkg_config=no]) -]) - -# test if gl link with X -AC_DEFUN([_AX_CHECK_GL_WITH_X], -[ - # try if opengl need X - AC_LANG_PUSH([C]) - _AX_CHECK_GL_SAVE_FLAGS() - CFLAGS="${GL_CFLAGS} ${CFLAGS}" - LIBS="${GL_LIBS} ${LIBS}" - LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}" - AC_LINK_IFELSE([AC_LANG_CALL([], [glXQueryVersion])], - [ax_check_gl_link_implicitly_with_x="yes"], - [ax_check_gl_link_implicitly_with_x="no"]) - _AX_CHECK_GL_RESTORE_FLAGS() - AC_LANG_POP([C]) -]) - -# internal routine: entry point if gl not disable -AC_DEFUN([_AX_CHECK_GL],[dnl - AC_REQUIRE([PKG_PROG_PKG_CONFIG]) - AC_REQUIRE([AC_PATH_X])dnl - - # does we need X or not - _AX_CHECK_GL_NEED_X() - - # try first pkgconfig - AC_MSG_CHECKING([for a working OpenGL implementation by pkg-config]) - AS_IF([test "X${PKG_CONFIG}" = "X"], - [ AC_MSG_RESULT([no]) - ax_check_gl_pkg_config=no], - [ AC_MSG_RESULT([yes]) - _AX_CHECK_GL_PKG_CONFIG()]) - - # if no pkgconfig or pkgconfig fail try manual way - AS_IF([test "X$ax_check_gl_pkg_config" = "Xno"], - [_AX_CHECK_GL_MANUAL()], - [no_gl=no]) - - # test if need to test X compatibility - AS_IF([test $no_gl = no], - [# test X compatibility - AS_IF([test X$ax_check_gl_need_x != "Xdefault"], - [AC_CACHE_CHECK([wether OpenGL link implictly with X],[ax_cv_check_gl_link_with_x], - [_AX_CHECK_GL_WITH_X() - ax_cv_check_gl_link_with_x="${ax_check_gl_link_implicitly_with_x}"]) - AS_IF([test "X${ax_cv_check_gl_link_with_x}" = "X${ax_check_gl_need_x}"], - [no_gl="no"], - [no_gl=yes])]) - ]) -]) - -# ax_check_gl entry point -AC_DEFUN([AX_CHECK_GL], -[AC_REQUIRE([AC_PATH_X])dnl - AC_REQUIRE([AC_CANONICAL_HOST]) - - AC_ARG_WITH([gl], - [AS_HELP_STRING([--with-gl@<:@=ARG@:>@], - [use opengl (ARG=yes), - using the specific lib (ARG=), - using the OpenGL lib that link with X (ARG=x), - using the OpenGL lib that link without X (ARG=nox), - or disable it (ARG=no) - @<:@ARG=yes@:>@ ])], - [ - AS_CASE(["$withval"], - ["no"|"NO"],[ax_check_gl_want_gl="no"], - ["yes"|"YES"],[ax_check_gl_want_gl="yes"], - [ax_check_gl_want_gl="$withval"]) - ], - [ax_check_gl_want_gl="yes"]) - - dnl compatibility with AX_HAVE_OPENGL - AC_ARG_WITH([Mesa], - [AS_HELP_STRING([--with-Mesa@<:@=ARG@:>@], - [Prefer the Mesa library over a vendors native OpenGL (ARG=yes except on mingw ARG=no), - @<:@ARG=yes@:>@ ])], - [ - AS_CASE(["$withval"], - ["no"|"NO"],[ax_check_gl_want_mesa="no"], - ["yes"|"YES"],[ax_check_gl_want_mesa="yes"], - [AC_MSG_ERROR([--with-mesa flag is only yes no])]) - ], - [ax_check_gl_want_mesa="default"]) - - # check consistency of parameters - AS_IF([test "X$have_x" = "Xdisabled"], - [AS_IF([test X$ax_check_gl_want_gl = "Xx"], - [AC_MSG_ERROR([You prefer OpenGL with X and asked for no X support])])]) - - AS_IF([test "X$have_x" = "Xdisabled"], - [AS_IF([test X$x_check_gl_want_mesa = "Xyes"], - [AC_MSG_WARN([You prefer mesa but you disable X. Disable mesa because mesa need X]) - ax_check_gl_want_mesa="no"])]) - - # mesa default means yes except on mingw - AC_MSG_CHECKING([wether we should prefer mesa for opengl implementation]) - AS_IF([test X$ax_check_gl_want_mesa = "Xdefault"], - [AS_CASE([${host}], - [*-mingw*],[ax_check_gl_want_mesa=no], - [ax_check_gl_want_mesa=yes])]) - AC_MSG_RESULT($ax_check_gl_want_mesa) - - # set default guess order - AC_MSG_CHECKING([for a working OpenGL order detection]) - AS_IF([test "X$no_x" = "Xyes"], - [ax_check_gl_order="gl"], - [AS_IF([test X$ax_check_gl_want_mesa = "Xyes"], - [ax_check_gl_order="mesagl gl"], - [ax_check_gl_order="gl mesagl"])]) - AC_MSG_RESULT($ax_check_gl_order) - - # set flags - no_gl="yes" - have_GL="no" - - # now do the real testing - AS_IF([test X$ax_check_gl_want_gl != "Xno"], - [_AX_CHECK_GL()]) - - AC_MSG_CHECKING([for a working OpenGL implementation]) - AS_IF([test "X$no_gl" = "Xno"], - [have_GL="yes" - AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([for CFLAGS needed for OpenGL]) - AC_MSG_RESULT(["${GL_CFLAGS}"]) - AC_MSG_CHECKING([for LIBS needed for OpenGL]) - AC_MSG_RESULT(["${GL_LIBS}"]) - AC_MSG_CHECKING([for LDFLAGS needed for OpenGL]) - AC_MSG_RESULT(["${GL_LDFLAGS}"])], - [AC_MSG_RESULT([no]) - GL_CFLAGS="" - GL_LIBS="" - GL_LDFLAGS=""]) - - AC_SUBST([GL_CFLAGS]) - AC_SUBST([GL_LIBS]) - AC_SUBST([GL_LDFLAGS]) -]) diff --git a/m4macros/ax_lang_compiler_ms.m4 b/m4macros/ax_lang_compiler_ms.m4 deleted file mode 100644 index 71b3d20ec..000000000 --- a/m4macros/ax_lang_compiler_ms.m4 +++ /dev/null @@ -1,36 +0,0 @@ -##### http://autoconf-archive.cryp.to/ax_lang_compiler_ms.html -# -# SYNOPSIS -# -# AX_LANG_COMPILER_MS -# -# DESCRIPTION -# -# Check whether the compiler for the current language is Microsoft. -# -# This macro is modeled after _AC_LANG_COMPILER_GNU in the GNU -# Autoconf implementation. -# -# LAST MODIFICATION -# -# 2004-11-15 -# -# COPYLEFT -# -# Copyright (c) 2004 Braden McDaniel -# -# Copying and distribution of this file, with or without -# modification, are permitted in any medium without royalty provided -# the copyright notice and this notice are preserved. - -AC_DEFUN([AX_LANG_COMPILER_MS], -[AC_CACHE_CHECK([whether we are using the Microsoft _AC_LANG compiler], - [ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms], -[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef _MSC_VER - choke me -#endif -]])], - [ax_compiler_ms=yes], - [ax_compiler_ms=no]) -ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms=$ax_compiler_ms -])]) diff --git a/m4macros/ax_pthread.m4 b/m4macros/ax_pthread.m4 deleted file mode 100644 index d383ad5c6..000000000 --- a/m4macros/ax_pthread.m4 +++ /dev/null @@ -1,332 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_pthread.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro figures out how to build C programs using POSIX threads. It -# sets the PTHREAD_LIBS output variable to the threads library and linker -# flags, and the PTHREAD_CFLAGS output variable to any special C compiler -# flags that are needed. (The user can also force certain compiler -# flags/libs to be tested by setting these environment variables.) -# -# Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). (This -# is necessary on AIX to use the special cc_r compiler alias.) -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also link it with them as well. e.g. you should link with -# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# -# If you are only building threads programs, you may wish to use these -# variables in your default LIBS, CFLAGS, and CC: -# -# LIBS="$PTHREAD_LIBS $LIBS" -# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -# CC="$PTHREAD_CC" -# -# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name -# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -# -# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the -# PTHREAD_PRIO_INHERIT symbol is defined when compiling with -# PTHREAD_CFLAGS. -# -# ACTION-IF-FOUND is a list of shell commands to run if a threads library -# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it -# is not found. If ACTION-IF-FOUND is not specified, the default action -# will define HAVE_PTHREAD. -# -# Please let the authors know if this macro fails on any platform, or if -# you have any other suggestions or comments. This macro was based on work -# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help -# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by -# Alejandro Forero Cuervo to the autoconf macro repository. We are also -# grateful for the helpful feedback of numerous users. -# -# Updated for Autoconf 2.68 by Daniel Richard G. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson -# Copyright (c) 2011 Daniel Richard G. -# -# 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 3 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, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 21 - -AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) -AC_DEFUN([AX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_LANG_PUSH([C]) -ax_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes]) - AC_MSG_RESULT([$ax_pthread_ok]) - if test x"$ax_pthread_ok" = xno; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. - -ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# ... -mt is also the pthreads flag for HP/aCC -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case ${host_os} in - solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: - - ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" - ;; - - darwin*) - ax_pthread_flags="-pthread $ax_pthread_flags" - ;; -esac - -# Clang doesn't consider unrecognized options an error unless we specify -# -Werror. We throw in some extra Clang-specific options to ensure that -# this doesn't happen for GCC, which also accepts -Werror. - -AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags]) -save_CFLAGS="$CFLAGS" -ax_pthread_extra_flags="-Werror" -CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])], - [AC_MSG_RESULT([yes])], - [ax_pthread_extra_flags= - AC_MSG_RESULT([no])]) -CFLAGS="$save_CFLAGS" - -if test x"$ax_pthread_ok" = xno; then -for flag in $ax_pthread_flags; do - - case $flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $flag]) - PTHREAD_CFLAGS="$flag" - ;; - - pthread-config) - AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) - if test x"$ax_pthread_config" = xno; then continue; fi - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$flag]) - PTHREAD_LIBS="-l$flag" - ;; - esac - - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include - static void routine(void *a) { a = 0; } - static void *start_routine(void *a) { return a; }], - [pthread_t th; pthread_attr_t attr; - pthread_create(&th, 0, start_routine, 0); - pthread_join(th, 0); - pthread_attr_init(&attr); - pthread_cleanup_push(routine, 0); - pthread_cleanup_pop(0) /* ; */])], - [ax_pthread_ok=yes], - []) - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - AC_MSG_RESULT([$ax_pthread_ok]) - if test "x$ax_pthread_ok" = xyes; then - break; - fi - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - -# Various other checks: -if test "x$ax_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_MSG_CHECKING([for joinable pthread attribute]) - attr_name=unknown - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], - [int attr = $attr; return attr /* ; */])], - [attr_name=$attr; break], - []) - done - AC_MSG_RESULT([$attr_name]) - if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then - AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name], - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - fi - - AC_MSG_CHECKING([if more special flags are required for pthreads]) - flag=no - case ${host_os} in - aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; - osf* | hpux*) flag="-D_REENTRANT";; - solaris*) - if test "$GCC" = "yes"; then - flag="-D_REENTRANT" - else - # TODO: What about Clang on Solaris? - flag="-mt -D_REENTRANT" - fi - ;; - esac - AC_MSG_RESULT([$flag]) - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi - - AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], - [ax_cv_PTHREAD_PRIO_INHERIT], [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int i = PTHREAD_PRIO_INHERIT;]])], - [ax_cv_PTHREAD_PRIO_INHERIT=yes], - [ax_cv_PTHREAD_PRIO_INHERIT=no]) - ]) - AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], - [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])]) - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - # More AIX lossage: compile with *_r variant - if test "x$GCC" != xyes; then - case $host_os in - aix*) - AS_CASE(["x/$CC"], - [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], - [#handle absolute path differently from PATH based program lookup - AS_CASE(["x$CC"], - [x/*], - [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], - [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) - ;; - esac - fi -fi - -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" - -AC_SUBST([PTHREAD_LIBS]) -AC_SUBST([PTHREAD_CFLAGS]) -AC_SUBST([PTHREAD_CC]) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$ax_pthread_ok" = xyes; then - ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) - : -else - ax_pthread_ok=no - $2 -fi -AC_LANG_POP -])dnl AX_PTHREAD diff --git a/m4macros/check_gnu_make.m4 b/m4macros/check_gnu_make.m4 deleted file mode 100644 index 44e1d9aa2..000000000 --- a/m4macros/check_gnu_make.m4 +++ /dev/null @@ -1,78 +0,0 @@ -##### http://autoconf-archive.cryp.to/check_gnu_make.html -# -# SYNOPSIS -# -# CHECK_GNU_MAKE() -# -# DESCRIPTION -# -# This macro searches for a GNU version of make. If a match is found, -# the makefile variable `ifGNUmake' is set to the empty string, -# otherwise it is set to "#". This is useful for including a special -# features in a Makefile, which cannot be handled by other versions -# of make. The variable _cv_gnu_make_command is set to the command to -# invoke GNU make if it exists, the empty string otherwise. -# -# Here is an example of its use: -# -# Makefile.in might contain: -# -# # A failsafe way of putting a dependency rule into a makefile -# $(DEPEND): -# $(CC) -MM $(srcdir)/*.c > $(DEPEND) -# -# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND))) -# @ifGNUmake@ include $(DEPEND) -# @ifGNUmake@ endif -# -# Then configure.in would normally contain: -# -# CHECK_GNU_MAKE() -# AC_OUTPUT(Makefile) -# -# Then perhaps to cause gnu make to override any other make, we could -# do something like this (note that GNU make always looks for -# GNUmakefile first): -# -# if ! test x$_cv_gnu_make_command = x ; then -# mv Makefile GNUmakefile -# echo .DEFAULT: > Makefile ; -# echo \ $_cv_gnu_make_command \$@ >> Makefile; -# fi -# -# Then, if any (well almost any) other make is called, and GNU make -# also exists, then the other make wraps the GNU make. -# -# LAST MODIFICATION -# -# 2002-01-04 -# -# COPYLEFT -# -# Copyright (c) 2002 John Darrington -# -# Copying and distribution of this file, with or without -# modification, are permitted in any medium without royalty provided -# the copyright notice and this notice are preserved. - -AC_DEFUN( - [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command, - _cv_gnu_make_command='' ; -dnl Search all the common names for GNU make - for a in "$MAKE" make gmake gnumake ; do - if test -z "$a" ; then continue ; fi ; - if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then - _cv_gnu_make_command=$a ; - break; - fi - done ; - ) ; -dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise - if test "x$_cv_gnu_make_command" != "x" ; then - ifGNUmake='' ; - else - ifGNUmake='#' ; - AC_MSG_RESULT("Not found"); - fi - AC_SUBST(ifGNUmake) -] ) diff --git a/m4macros/wxwin.m4 b/m4macros/wxwin.m4 deleted file mode 100644 index 1c50dcc27..000000000 --- a/m4macros/wxwin.m4 +++ /dev/null @@ -1,1060 +0,0 @@ -dnl --------------------------------------------------------------------------- -dnl Author: wxWidgets development team, -dnl Francesco Montorsi, -dnl Bob McCown (Mac-testing) -dnl Creation date: 24/11/2001 -dnl RCS-ID: $Id$ -dnl --------------------------------------------------------------------------- - -dnl =========================================================================== -dnl Table of Contents of this macro file: -dnl ------------------------------------- -dnl -dnl SECTION A: wxWidgets main macros -dnl - WX_CONFIG_OPTIONS -dnl - WX_CONFIG_CHECK -dnl - WXRC_CHECK -dnl - WX_STANDARD_OPTIONS -dnl - WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS -dnl - WX_DETECT_STANDARD_OPTION_VALUES -dnl -dnl SECTION B: wxWidgets-related utilities -dnl - WX_LIKE_LIBNAME -dnl - WX_ARG_ENABLE_YESNOAUTO -dnl - WX_ARG_WITH_YESNOAUTO -dnl -dnl SECTION C: messages to the user -dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG -dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN -dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_END -dnl - WX_BOOLOPT_SUMMARY -dnl -dnl The special "WX_DEBUG_CONFIGURE" variable can be set to 1 to enable extra -dnl debug output on stdout from these macros. -dnl =========================================================================== - - -dnl --------------------------------------------------------------------------- -dnl Macros for wxWidgets detection. Typically used in configure.in as: -dnl -dnl AC_ARG_ENABLE(...) -dnl AC_ARG_WITH(...) -dnl ... -dnl WX_CONFIG_OPTIONS -dnl ... -dnl ... -dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1]) -dnl if test "$wxWin" != 1; then -dnl AC_MSG_ERROR([ -dnl wxWidgets must be installed on your system -dnl but wx-config script couldn't be found. -dnl -dnl Please check that wx-config is in path, the directory -dnl where wxWidgets libraries are installed (returned by -dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or -dnl equivalent variable and wxWidgets version is 2.3.4 or above. -dnl ]) -dnl fi -dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" -dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" -dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" -dnl -dnl LIBS="$LIBS $WX_LIBS" -dnl -dnl If you want to support standard --enable-debug/unicode/shared options, you -dnl may do the following: -dnl -dnl ... -dnl AC_CANONICAL_SYSTEM -dnl -dnl # define configure options -dnl WX_CONFIG_OPTIONS -dnl WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared]) -dnl -dnl # basic configure checks -dnl ... -dnl -dnl # we want to always have DEBUG==WX_DEBUG and UNICODE==WX_UNICODE -dnl WX_DEBUG=$DEBUG -dnl WX_UNICODE=$UNICODE -dnl -dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS -dnl WX_CONFIG_CHECK([2.8.0], [wxWin=1],,[html,core,net,base],[$WXCONFIG_FLAGS]) -dnl WX_DETECT_STANDARD_OPTION_VALUES -dnl -dnl # write the output files -dnl AC_CONFIG_FILES([Makefile ...]) -dnl AC_OUTPUT -dnl -dnl # optional: just to show a message to the user -dnl WX_STANDARD_OPTIONS_SUMMARY_MSG -dnl -dnl --------------------------------------------------------------------------- - - -dnl --------------------------------------------------------------------------- -dnl WX_CONFIG_OPTIONS -dnl -dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and -dnl --wx-config command line options -dnl --------------------------------------------------------------------------- - -AC_DEFUN([WX_CONFIG_OPTIONS], -[ - AC_ARG_WITH(wxdir, - [ --with-wxdir=PATH Use uninstalled version of wxWidgets in PATH], - [ wx_config_name="$withval/wx-config" - wx_config_args="--inplace"]) - AC_ARG_WITH(wx-config, - [ --with-wx-config=CONFIG wx-config script to use (optional)], - wx_config_name="$withval" ) - AC_ARG_WITH(wx-prefix, - [ --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)], - wx_config_prefix="$withval", wx_config_prefix="") - AC_ARG_WITH(wx-exec-prefix, - [ --with-wx-exec-prefix=PREFIX - Exec prefix where wxWidgets is installed (optional)], - wx_config_exec_prefix="$withval", wx_config_exec_prefix="") -]) - -dnl Helper macro for checking if wx version is at least $1.$2.$3, set's -dnl wx_ver_ok=yes if it is: -AC_DEFUN([_WX_PRIVATE_CHECK_VERSION], -[ - wx_ver_ok="" - if test "x$WX_VERSION" != x ; then - if test $wx_config_major_version -gt $1; then - wx_ver_ok=yes - else - if test $wx_config_major_version -eq $1; then - if test $wx_config_minor_version -gt $2; then - wx_ver_ok=yes - else - if test $wx_config_minor_version -eq $2; then - if test $wx_config_micro_version -ge $3; then - wx_ver_ok=yes - fi - fi - fi - fi - fi - fi -]) - -dnl --------------------------------------------------------------------------- -dnl WX_CONFIG_CHECK(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND -dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]]) -dnl -dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC -dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME -dnl environment variable to override the default name of the wx-config script -dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this -dnl case the macro won't even waste time on tests for its existence. -dnl -dnl Optional WX-LIBS argument contains comma- or space-separated list of -dnl wxWidgets libraries to link against. If it is not specified then WX_LIBS -dnl and WX_LIBS_STATIC will contain flags to link with all of the core -dnl wxWidgets libraries. -dnl -dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config -dnl invocation command in present. It can be used to fine-tune lookup of -dnl best wxWidgets build available. -dnl -dnl Example use: -dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1], [wxWin=0], [html,core,net] -dnl [--unicode --debug]) -dnl --------------------------------------------------------------------------- - -dnl -dnl Get the cflags and libraries from the wx-config script -dnl -AC_DEFUN([WX_CONFIG_CHECK], -[ - dnl do we have wx-config name: it can be wx-config or wxd-config or ... - if test x${WX_CONFIG_NAME+set} != xset ; then - WX_CONFIG_NAME=wx-config - fi - - if test "x$wx_config_name" != x ; then - WX_CONFIG_NAME="$wx_config_name" - fi - - dnl deal with optional prefixes - if test x$wx_config_exec_prefix != x ; then - wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix" - WX_LOOKUP_PATH="$wx_config_exec_prefix/bin" - fi - if test x$wx_config_prefix != x ; then - wx_config_args="$wx_config_args --prefix=$wx_config_prefix" - WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin" - fi - if test "$cross_compiling" = "yes"; then - wx_config_args="$wx_config_args --host=$host_alias" - fi - - dnl don't search the PATH if WX_CONFIG_NAME is absolute filename - if test -x "$WX_CONFIG_NAME" ; then - AC_MSG_CHECKING(for wx-config) - WX_CONFIG_PATH="$WX_CONFIG_NAME" - AC_MSG_RESULT($WX_CONFIG_PATH) - else - AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH") - fi - - if test "$WX_CONFIG_PATH" != "no" ; then - WX_VERSION="" - - min_wx_version=ifelse([$1], ,2.2.1,$1) - if test -z "$5" ; then - AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version]) - else - AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)]) - fi - - dnl don't add the libraries ($4) to this variable as this would result in - dnl an error when it's used with --version below - WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5" - - WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null` - wx_config_major_version=`echo $WX_VERSION | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - wx_config_minor_version=`echo $WX_VERSION | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - wx_config_micro_version=`echo $WX_VERSION | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - - wx_requested_major_version=`echo $min_wx_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - wx_requested_minor_version=`echo $min_wx_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - wx_requested_micro_version=`echo $min_wx_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - - _WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version], - [$wx_requested_minor_version], - [$wx_requested_micro_version]) - - if test -n "$wx_ver_ok"; then - AC_MSG_RESULT(yes (version $WX_VERSION)) - WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs $4` - - dnl is this even still appropriate? --static is a real option now - dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is - dnl what the user actually wants, making this redundant at best. - dnl For now keep it in case anyone actually used it in the past. - AC_MSG_CHECKING([for wxWidgets static library]) - WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs $4 2>/dev/null` - if test "x$WX_LIBS_STATIC" = "x"; then - AC_MSG_RESULT(no) - else - AC_MSG_RESULT(yes) - fi - - dnl starting with version 2.2.6 wx-config has --cppflags argument - wx_has_cppflags="" - if test $wx_config_major_version -gt 2; then - wx_has_cppflags=yes - else - if test $wx_config_major_version -eq 2; then - if test $wx_config_minor_version -gt 2; then - wx_has_cppflags=yes - else - if test $wx_config_minor_version -eq 2; then - if test $wx_config_micro_version -ge 6; then - wx_has_cppflags=yes - fi - fi - fi - fi - fi - - dnl starting with version 2.7.0 wx-config has --rescomp option - wx_has_rescomp="" - if test $wx_config_major_version -gt 2; then - wx_has_rescomp=yes - else - if test $wx_config_major_version -eq 2; then - if test $wx_config_minor_version -ge 7; then - wx_has_rescomp=yes - fi - fi - fi - if test "x$wx_has_rescomp" = x ; then - dnl cannot give any useful info for resource compiler - WX_RESCOMP= - else - WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp` - fi - - if test "x$wx_has_cppflags" = x ; then - dnl no choice but to define all flags like CFLAGS - WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4` - WX_CPPFLAGS=$WX_CFLAGS - WX_CXXFLAGS=$WX_CFLAGS - - WX_CFLAGS_ONLY=$WX_CFLAGS - WX_CXXFLAGS_ONLY=$WX_CFLAGS - else - dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS - WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags $4` - WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags $4` - WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4` - - WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"` - WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"` - fi - - ifelse([$2], , :, [$2]) - - else - - if test "x$WX_VERSION" = x; then - dnl no wx-config at all - AC_MSG_RESULT(no) - else - AC_MSG_RESULT(no (version $WX_VERSION is not new enough)) - fi - - WX_CFLAGS="" - WX_CPPFLAGS="" - WX_CXXFLAGS="" - WX_LIBS="" - WX_LIBS_STATIC="" - WX_RESCOMP="" - - if test ! -z "$5"; then - - wx_error_message=" - The configuration you asked for $PACKAGE_NAME requires a wxWidgets - build with the following settings: - $5 - but such build is not available. - - To see the wxWidgets builds available on this system, please use - 'wx-config --list' command. To use the default build, returned by - 'wx-config --selected-config', use the options with their 'auto' - default values." - - fi - - wx_error_message=" - The requested wxWidgets build couldn't be found. - $wx_error_message - - If you still get this error, then check that 'wx-config' is - in path, the directory where wxWidgets libraries are installed - (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH - or equivalent variable and wxWidgets version is $1 or above." - - ifelse([$3], , AC_MSG_ERROR([$wx_error_message]), [$3]) - - fi - else - - WX_CFLAGS="" - WX_CPPFLAGS="" - WX_CXXFLAGS="" - WX_LIBS="" - WX_LIBS_STATIC="" - WX_RESCOMP="" - - ifelse([$3], , :, [$3]) - - fi - - AC_SUBST(WX_CPPFLAGS) - AC_SUBST(WX_CFLAGS) - AC_SUBST(WX_CXXFLAGS) - AC_SUBST(WX_CFLAGS_ONLY) - AC_SUBST(WX_CXXFLAGS_ONLY) - AC_SUBST(WX_LIBS) - AC_SUBST(WX_LIBS_STATIC) - AC_SUBST(WX_VERSION) - AC_SUBST(WX_RESCOMP) - - dnl need to export also WX_VERSION_MINOR and WX_VERSION_MAJOR symbols - dnl to support wxpresets bakefiles (we export also WX_VERSION_MICRO for completeness): - WX_VERSION_MAJOR="$wx_config_major_version" - WX_VERSION_MINOR="$wx_config_minor_version" - WX_VERSION_MICRO="$wx_config_micro_version" - AC_SUBST(WX_VERSION_MAJOR) - AC_SUBST(WX_VERSION_MINOR) - AC_SUBST(WX_VERSION_MICRO) -]) - -dnl --------------------------------------------------------------------------- -dnl Get information on the wxrc program for making C++, Python and xrs -dnl resource files. -dnl -dnl AC_ARG_ENABLE(...) -dnl AC_ARG_WITH(...) -dnl ... -dnl WX_CONFIG_OPTIONS -dnl ... -dnl WX_CONFIG_CHECK(2.6.0, wxWin=1) -dnl if test "$wxWin" != 1; then -dnl AC_MSG_ERROR([ -dnl wxWidgets must be installed on your system -dnl but wx-config script couldn't be found. -dnl -dnl Please check that wx-config is in path, the directory -dnl where wxWidgets libraries are installed (returned by -dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or -dnl equivalent variable and wxWidgets version is 2.6.0 or above. -dnl ]) -dnl fi -dnl -dnl WXRC_CHECK([HAVE_WXRC=1], [HAVE_WXRC=0]) -dnl if test "x$HAVE_WXRC" != x1; then -dnl AC_MSG_ERROR([ -dnl The wxrc program was not installed or not found. -dnl -dnl Please check the wxWidgets installation. -dnl ]) -dnl fi -dnl -dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" -dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" -dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" -dnl -dnl LDFLAGS="$LDFLAGS $WX_LIBS" -dnl --------------------------------------------------------------------------- - -dnl --------------------------------------------------------------------------- -dnl WXRC_CHECK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -dnl -dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS -dnl resources. The variable WXRC will be set and substituted in the configure -dnl script and Makefiles. -dnl -dnl Example use: -dnl WXRC_CHECK([wxrc=1], [wxrc=0]) -dnl --------------------------------------------------------------------------- - -dnl -dnl wxrc program from the wx-config script -dnl -AC_DEFUN([WXRC_CHECK], -[ - AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler]) - - if test "x$WX_CONFIG_NAME" = x; then - AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.]) - else - - AC_MSG_CHECKING([for wxrc]) - - if test "x$WXRC" = x ; then - dnl wx-config --utility is a new addition to wxWidgets: - _WX_PRIVATE_CHECK_VERSION(2,5,3) - if test -n "$wx_ver_ok"; then - WXRC=`$WX_CONFIG_WITH_ARGS --utility=wxrc` - fi - fi - - if test "x$WXRC" = x ; then - AC_MSG_RESULT([not found]) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT([$WXRC]) - ifelse([$1], , :, [$1]) - fi - - AC_SUBST(WXRC) - fi -]) - -dnl --------------------------------------------------------------------------- -dnl WX_LIKE_LIBNAME([output-var] [prefix], [name]) -dnl -dnl Sets the "output-var" variable to the name of a library named with same -dnl wxWidgets rule. -dnl E.g. for output-var=='lib', name=='test', prefix='mine', sets -dnl the $lib variable to: -dnl 'mine_gtk2ud_test-2.8' -dnl if WX_PORT=gtk2, WX_UNICODE=1, WX_DEBUG=1 and WX_RELEASE=28 -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_LIKE_LIBNAME], - [ - wx_temp="$2""_""$WX_PORT" - - dnl add the [u][d] string - if test "$WX_UNICODE" = "1"; then - wx_temp="$wx_temp""u" - fi - if test "$WX_DEBUG" = "1"; then - wx_temp="$wx_temp""d" - fi - - dnl complete the name of the lib - wx_temp="$wx_temp""_""$3""-$WX_VERSION_MAJOR.$WX_VERSION_MINOR" - - dnl save it in the user's variable - $1=$wx_temp - ]) - -dnl --------------------------------------------------------------------------- -dnl WX_ARG_ENABLE_YESNOAUTO/WX_ARG_WITH_YESNOAUTO -dnl -dnl Two little custom macros which define the ENABLE/WITH configure arguments. -dnl Macro arguments: -dnl $1 = the name of the --enable / --with feature -dnl $2 = the name of the variable associated -dnl $3 = the description of that feature -dnl $4 = the default value for that feature -dnl $5 = additional action to do in case option is given with "yes" value -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_ARG_ENABLE_YESNOAUTO], - [AC_ARG_ENABLE($1, - AC_HELP_STRING([--enable-$1], [$3 (default is $4)]), - [], [enableval="$4"]) - - dnl Show a message to the user about this option - AC_MSG_CHECKING([for the --enable-$1 option]) - if test "$enableval" = "yes" ; then - AC_MSG_RESULT([yes]) - $2=1 - $5 - elif test "$enableval" = "no" ; then - AC_MSG_RESULT([no]) - $2=0 - elif test "$enableval" = "auto" ; then - AC_MSG_RESULT([will be automatically detected]) - $2="auto" - else - AC_MSG_ERROR([ - Unrecognized option value (allowed values: yes, no, auto) - ]) - fi - ]) - -AC_DEFUN([WX_ARG_WITH_YESNOAUTO], - [AC_ARG_WITH($1, - AC_HELP_STRING([--with-$1], [$3 (default is $4)]), - [], [withval="$4"]) - - dnl Show a message to the user about this option - AC_MSG_CHECKING([for the --with-$1 option]) - if test "$withval" = "yes" ; then - AC_MSG_RESULT([yes]) - $2=1 - $5 - dnl NB: by default we don't allow --with-$1=no option - dnl since it does not make much sense ! - elif test "$6" = "1" -a "$withval" = "no" ; then - AC_MSG_RESULT([no]) - $2=0 - elif test "$withval" = "auto" ; then - AC_MSG_RESULT([will be automatically detected]) - $2="auto" - else - AC_MSG_ERROR([ - Unrecognized option value (allowed values: yes, auto) - ]) - fi - ]) - - -dnl --------------------------------------------------------------------------- -dnl WX_STANDARD_OPTIONS([options-to-add]) -dnl -dnl Adds to the configure script one or more of the following options: -dnl --enable-[debug|unicode|shared|wxshared|wxdebug] -dnl --with-[gtk|msw|motif|x11|mac|dfb] -dnl --with-wxversion -dnl Then checks for their presence and eventually set the DEBUG, UNICODE, SHARED, -dnl PORT, WX_SHARED, WX_DEBUG, variables to one of the "yes", "no", "auto" values. -dnl -dnl Note that e.g. UNICODE != WX_UNICODE; the first is the value of the -dnl --enable-unicode option (in boolean format) while the second indicates -dnl if wxWidgets was built in Unicode mode (and still is in boolean format). -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_STANDARD_OPTIONS], - [ - - dnl the following lines will expand to WX_ARG_ENABLE_YESNOAUTO calls if and only if - dnl the $1 argument contains respectively the debug,unicode or shared options. - - dnl be careful here not to set debug flag if only "wxdebug" was specified - ifelse(regexp([$1], [\bdebug]), [-1],, - [WX_ARG_ENABLE_YESNOAUTO([debug], [DEBUG], [Build in debug mode], [auto])]) - - ifelse(index([$1], [unicode]), [-1],, - [WX_ARG_ENABLE_YESNOAUTO([unicode], [UNICODE], [Build in Unicode mode], [auto])]) - - ifelse(regexp([$1], [\bshared]), [-1],, - [WX_ARG_ENABLE_YESNOAUTO([shared], [SHARED], [Build as shared library], [auto])]) - - dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-toolkit since it's an option - dnl which must be able to accept the auto|gtk1|gtk2|msw|... values - ifelse(index([$1], [toolkit]), [-1],, - [ - AC_ARG_WITH([toolkit], - AC_HELP_STRING([--with-toolkit], - [Build against a specific wxWidgets toolkit (default is auto)]), - [], [withval="auto"]) - - dnl Show a message to the user about this option - AC_MSG_CHECKING([for the --with-toolkit option]) - if test "$withval" = "auto" ; then - AC_MSG_RESULT([will be automatically detected]) - TOOLKIT="auto" - else - TOOLKIT="$withval" - - dnl PORT must be one of the allowed values - if test "$TOOLKIT" != "gtk1" -a "$TOOLKIT" != "gtk2" -a \ - "$TOOLKIT" != "msw" -a "$TOOLKIT" != "motif" -a \ - "$TOOLKIT" != "osx_carbon" -a "$TOOLKIT" != "osx_cocoa" -a \ - "$TOOLKIT" != "dfb" -a "$TOOLKIT" != "x11"; then - AC_MSG_ERROR([ - Unrecognized option value (allowed values: auto, gtk1, gtk2, msw, motif, osx_carbon, osx_cocoa, dfb, x11) - ]) - fi - - AC_MSG_RESULT([$TOOLKIT]) - fi - ]) - - dnl ****** IMPORTANT ******* - dnl Unlike for the UNICODE setting, you can build your program in - dnl shared mode against a static build of wxWidgets. Thus we have the - dnl following option which allows these mixtures. E.g. - dnl - dnl ./configure --disable-shared --with-wxshared - dnl - dnl will build your library in static mode against the first available - dnl shared build of wxWidgets. - dnl - dnl Note that's not possible to do the viceversa: - dnl - dnl ./configure --enable-shared --without-wxshared - dnl - dnl Doing so you would try to build your library in shared mode against a static - dnl build of wxWidgets. This is not possible (you would mix PIC and non PIC code) ! - dnl A check for this combination of options is in WX_DETECT_STANDARD_OPTION_VALUES - dnl (where we know what 'auto' should be expanded to). - dnl - dnl If you try to build something in ANSI mode against a UNICODE build - dnl of wxWidgets or in RELEASE mode against a DEBUG build of wxWidgets, - dnl then at best you'll get ton of linking errors ! - dnl ************************ - - ifelse(index([$1], [wxshared]), [-1],, - [ - WX_ARG_WITH_YESNOAUTO( - [wxshared], [WX_SHARED], - [Force building against a shared build of wxWidgets, even if --disable-shared is given], - [auto], [], [1]) - ]) - - dnl Just like for SHARED and WX_SHARED it may happen that some adventurous - dnl peoples will want to mix a wxWidgets release build with a debug build of - dnl his app/lib. So, we have both DEBUG and WX_DEBUG variables. - ifelse(index([$1], [wxdebug]), [-1],, - [ - WX_ARG_WITH_YESNOAUTO( - [wxdebug], [WX_DEBUG], - [Force building against a debug build of wxWidgets, even if --disable-debug is given], - [auto], [], [1]) - ]) - - dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-wxversion since it's an option - dnl which accepts the "auto|2.6|2.7|2.8|2.9|3.0" etc etc values - ifelse(index([$1], [wxversion]), [-1],, - [ - AC_ARG_WITH([wxversion], - AC_HELP_STRING([--with-wxversion], - [Build against a specific version of wxWidgets (default is auto)]), - [], [withval="auto"]) - - dnl Show a message to the user about this option - AC_MSG_CHECKING([for the --with-wxversion option]) - if test "$withval" = "auto" ; then - AC_MSG_RESULT([will be automatically detected]) - WX_RELEASE="auto" - else - - wx_requested_major_version=`echo $withval | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\1/'` - wx_requested_minor_version=`echo $withval | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\2/'` - - dnl both vars above must be exactly 1 digit - if test "${#wx_requested_major_version}" != "1" -o \ - "${#wx_requested_minor_version}" != "1" ; then - AC_MSG_ERROR([ - Unrecognized option value (allowed values: auto, 2.6, 2.7, 2.8, 2.9, 3.0) - ]) - fi - - WX_RELEASE="$wx_requested_major_version"".""$wx_requested_minor_version" - AC_MSG_RESULT([$WX_RELEASE]) - fi - ]) - - if test "$WX_DEBUG_CONFIGURE" = "1"; then - echo "[[dbg]] DEBUG: $DEBUG, WX_DEBUG: $WX_DEBUG" - echo "[[dbg]] UNICODE: $UNICODE, WX_UNICODE: $WX_UNICODE" - echo "[[dbg]] SHARED: $SHARED, WX_SHARED: $WX_SHARED" - echo "[[dbg]] TOOLKIT: $TOOLKIT, WX_TOOLKIT: $WX_TOOLKIT" - echo "[[dbg]] VERSION: $VERSION, WX_RELEASE: $WX_RELEASE" - fi - ]) - - -dnl --------------------------------------------------------------------------- -dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS -dnl -dnl Sets the WXCONFIG_FLAGS string using the SHARED,DEBUG,UNICODE variable values -dnl which are different from "auto". -dnl Thus this macro needs to be called only once all options have been set. -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS], - [ - if test "$WX_SHARED" = "1" ; then - WXCONFIG_FLAGS="--static=no " - elif test "$WX_SHARED" = "0" ; then - WXCONFIG_FLAGS="--static=yes " - fi - - if test "$WX_DEBUG" = "1" ; then - WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=yes " - elif test "$WX_DEBUG" = "0" ; then - WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=no " - fi - - dnl The user should have set WX_UNICODE=UNICODE - if test "$WX_UNICODE" = "1" ; then - WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=yes " - elif test "$WX_UNICODE" = "0" ; then - WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=no " - fi - - if test "$TOOLKIT" != "auto" ; then - WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--toolkit=$TOOLKIT " - fi - - if test "$WX_RELEASE" != "auto" ; then - WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--version=$WX_RELEASE " - fi - - dnl strip out the last space of the string - WXCONFIG_FLAGS=${WXCONFIG_FLAGS% } - - if test "$WX_DEBUG_CONFIGURE" = "1"; then - echo "[[dbg]] WXCONFIG_FLAGS: $WXCONFIG_FLAGS" - fi - ]) - - -dnl --------------------------------------------------------------------------- -dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG] -dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -dnl -dnl Outputs the given MSG. Then searches the given STRING in the wxWidgets -dnl additional CPP flags and put the result of the search in WX_$RESULTVAR -dnl also adding the "yes" or "no" message result to MSG. -dnl --------------------------------------------------------------------------- -AC_DEFUN([_WX_SELECTEDCONFIG_CHECKFOR], - [ - if test "$$1" = "auto" ; then - - dnl The user does not have particular preferences for this option; - dnl so we will detect the wxWidgets relative build setting and use it - AC_MSG_CHECKING([$3]) - - dnl set WX_$1 variable to 1 if the $WX_SELECTEDCONFIG contains the $2 - dnl string or to 0 otherwise. - dnl NOTE: 'expr match STRING REGEXP' cannot be used since on Mac it - dnl doesn't work; we use 'expr STRING : REGEXP' instead - WX_$1=$(expr "$WX_SELECTEDCONFIG" : ".*$2.*") - - if test "$WX_$1" != "0"; then - WX_$1=1 - AC_MSG_RESULT([yes]) - ifelse([$4], , :, [$4]) - else - WX_$1=0 - AC_MSG_RESULT([no]) - ifelse([$5], , :, [$5]) - fi - else - - dnl Use the setting given by the user - WX_$1=$$1 - fi - ]) - -dnl --------------------------------------------------------------------------- -dnl WX_DETECT_STANDARD_OPTION_VALUES -dnl -dnl Detects the values of the following variables: -dnl 1) WX_RELEASE -dnl 2) WX_UNICODE -dnl 3) WX_DEBUG -dnl 4) WX_SHARED (and also WX_STATIC) -dnl 5) WX_PORT -dnl from the previously selected wxWidgets build; this macro in fact must be -dnl called *after* calling the WX_CONFIG_CHECK macro. -dnl -dnl Note that the WX_VERSION_MAJOR, WX_VERSION_MINOR symbols are already set -dnl by WX_CONFIG_CHECK macro -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES], - [ - dnl IMPORTANT: WX_VERSION contains all three major.minor.micro digits, - dnl while WX_RELEASE only the major.minor ones. - WX_RELEASE="$WX_VERSION_MAJOR""$WX_VERSION_MINOR" - if test $WX_RELEASE -lt 26 ; then - - AC_MSG_ERROR([ - Cannot detect the wxWidgets configuration for the selected wxWidgets build - since its version is $WX_VERSION < 2.6.0; please install a newer - version of wxWidgets. - ]) - fi - - dnl The wx-config we are using understands the "--selected_config" - dnl option which returns an easy-parseable string ! - WX_SELECTEDCONFIG=$($WX_CONFIG_WITH_ARGS --selected_config) - - if test "$WX_DEBUG_CONFIGURE" = "1"; then - echo "[[dbg]] Using wx-config --selected-config" - echo "[[dbg]] WX_SELECTEDCONFIG: $WX_SELECTEDCONFIG" - fi - - - dnl we could test directly for WX_SHARED with a line like: - dnl _WX_SELECTEDCONFIG_CHECKFOR([SHARED], [shared], - dnl [if wxWidgets was built in SHARED mode]) - dnl but wx-config --selected-config DOES NOT outputs the 'shared' - dnl word when wx was built in shared mode; it rather outputs the - dnl 'static' word when built in static mode. - if test $WX_SHARED = "1"; then - STATIC=0 - elif test $WX_SHARED = "0"; then - STATIC=1 - elif test $WX_SHARED = "auto"; then - STATIC="auto" - fi - - dnl Now set the WX_UNICODE, WX_DEBUG, WX_STATIC variables - _WX_SELECTEDCONFIG_CHECKFOR([UNICODE], [unicode], - [if wxWidgets was built with UNICODE enabled]) - _WX_SELECTEDCONFIG_CHECKFOR([DEBUG], [debug], - [if wxWidgets was built in DEBUG mode]) - _WX_SELECTEDCONFIG_CHECKFOR([STATIC], [static], - [if wxWidgets was built in STATIC mode]) - - dnl init WX_SHARED from WX_STATIC - if test "$WX_STATIC" != "0"; then - WX_SHARED=0 - else - WX_SHARED=1 - fi - - AC_SUBST(WX_UNICODE) - AC_SUBST(WX_DEBUG) - AC_SUBST(WX_SHARED) - - dnl detect the WX_PORT to use - if test "$TOOLKIT" = "auto" ; then - - dnl The user does not have particular preferences for this option; - dnl so we will detect the wxWidgets relative build setting and use it - AC_MSG_CHECKING([which wxWidgets toolkit was selected]) - - WX_GTKPORT1=$(expr "$WX_SELECTEDCONFIG" : ".*gtk1.*") - WX_GTKPORT2=$(expr "$WX_SELECTEDCONFIG" : ".*gtk2.*") - WX_MSWPORT=$(expr "$WX_SELECTEDCONFIG" : ".*msw.*") - WX_MOTIFPORT=$(expr "$WX_SELECTEDCONFIG" : ".*motif.*") - WX_OSXCOCOAPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_cocoa.*") - WX_OSXCARBONPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_carbon.*") - WX_X11PORT=$(expr "$WX_SELECTEDCONFIG" : ".*x11.*") - WX_DFBPORT=$(expr "$WX_SELECTEDCONFIG" : ".*dfb.*") - - WX_PORT="unknown" - if test "$WX_GTKPORT1" != "0"; then WX_PORT="gtk1"; fi - if test "$WX_GTKPORT2" != "0"; then WX_PORT="gtk2"; fi - if test "$WX_MSWPORT" != "0"; then WX_PORT="msw"; fi - if test "$WX_MOTIFPORT" != "0"; then WX_PORT="motif"; fi - if test "$WX_OSXCOCOAPORT" != "0"; then WX_PORT="osx_cocoa"; fi - if test "$WX_OSXCARBONPORT" != "0"; then WX_PORT="osx_carbon"; fi - if test "$WX_X11PORT" != "0"; then WX_PORT="x11"; fi - if test "$WX_DFBPORT" != "0"; then WX_PORT="dfb"; fi - - dnl NOTE: backward-compatible check for wx2.8; in wx2.9 the mac - dnl ports are called 'osx_cocoa' and 'osx_carbon' (see above) - WX_MACPORT=$(expr "$WX_SELECTEDCONFIG" : ".*mac.*") - if test "$WX_MACPORT" != "0"; then WX_PORT="mac"; fi - - dnl check at least one of the WX_*PORT has been set ! - - if test "$WX_PORT" = "unknown" ; then - AC_MSG_ERROR([ - Cannot detect the currently installed wxWidgets port ! - Please check your 'wx-config --cxxflags'... - ]) - fi - - AC_MSG_RESULT([$WX_PORT]) - else - - dnl Use the setting given by the user - if test -z "$TOOLKIT" ; then - WX_PORT=$TOOLKIT - else - dnl try with PORT - WX_PORT=$PORT - fi - fi - - AC_SUBST(WX_PORT) - - if test "$WX_DEBUG_CONFIGURE" = "1"; then - echo "[[dbg]] Values of all WX_* options after final detection:" - echo "[[dbg]] WX_DEBUG: $WX_DEBUG" - echo "[[dbg]] WX_UNICODE: $WX_UNICODE" - echo "[[dbg]] WX_SHARED: $WX_SHARED" - echo "[[dbg]] WX_RELEASE: $WX_RELEASE" - echo "[[dbg]] WX_PORT: $WX_PORT" - fi - - dnl Avoid problem described in the WX_STANDARD_OPTIONS which happens when - dnl the user gives the options: - dnl ./configure --enable-shared --without-wxshared - dnl or just do - dnl ./configure --enable-shared - dnl but there is only a static build of wxWidgets available. - if test "$WX_SHARED" = "0" -a "$SHARED" = "1"; then - AC_MSG_ERROR([ - Cannot build shared library against a static build of wxWidgets ! - This error happens because the wxWidgets build which was selected - has been detected as static while you asked to build $PACKAGE_NAME - as shared library and this is not possible. - Use the '--disable-shared' option to build $PACKAGE_NAME - as static library or '--with-wxshared' to use wxWidgets as shared library. - ]) - fi - - dnl now we can finally update the DEBUG,UNICODE,SHARED options - dnl to their final values if they were set to 'auto' - if test "$DEBUG" = "auto"; then - DEBUG=$WX_DEBUG - fi - if test "$UNICODE" = "auto"; then - UNICODE=$WX_UNICODE - fi - if test "$SHARED" = "auto"; then - SHARED=$WX_SHARED - fi - if test "$TOOLKIT" = "auto"; then - TOOLKIT=$WX_PORT - fi - - dnl in case the user needs a BUILD=debug/release var... - if test "$DEBUG" = "1"; then - BUILD="debug" - elif test "$DEBUG" = "0" -o "$DEBUG" = ""; then - BUILD="release" - fi - - dnl respect the DEBUG variable adding the optimize/debug flags - dnl NOTE: the CXXFLAGS are merged together with the CPPFLAGS so we - dnl don't need to set them, too - if test "$DEBUG" = "1"; then - CXXFLAGS="$CXXFLAGS -g -O0" - CFLAGS="$CFLAGS -g -O0" - else - CXXFLAGS="$CXXFLAGS -O2" - CFLAGS="$CFLAGS -O2" - fi - ]) - -dnl --------------------------------------------------------------------------- -dnl WX_BOOLOPT_SUMMARY([name of the boolean variable to show summary for], -dnl [what to print when var is 1], -dnl [what to print when var is 0]) -dnl -dnl Prints $2 when variable $1 == 1 and prints $3 when variable $1 == 0. -dnl This macro mainly exists just to make configure.ac scripts more readable. -dnl -dnl NOTE: you need to use the [" my message"] syntax for 2nd and 3rd arguments -dnl if you want that m4 avoid to throw away the spaces prefixed to the -dnl argument value. -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_BOOLOPT_SUMMARY], - [ - if test "x$$1" = "x1" ; then - echo $2 - elif test "x$$1" = "x0" ; then - echo $3 - else - echo "$1 is $$1" - fi - ]) - -dnl --------------------------------------------------------------------------- -dnl WX_STANDARD_OPTIONS_SUMMARY_MSG -dnl -dnl Shows a summary message to the user about the WX_* variable contents. -dnl This macro is used typically at the end of the configure script. -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG], - [ - echo - echo " The wxWidgets build which will be used by $PACKAGE_NAME $PACKAGE_VERSION" - echo " has the following settings:" - WX_BOOLOPT_SUMMARY([WX_DEBUG], [" - DEBUG build"], [" - RELEASE build"]) - WX_BOOLOPT_SUMMARY([WX_UNICODE], [" - UNICODE mode"], [" - ANSI mode"]) - WX_BOOLOPT_SUMMARY([WX_SHARED], [" - SHARED mode"], [" - STATIC mode"]) - echo " - VERSION: $WX_VERSION" - echo " - PORT: $WX_PORT" - ]) - - -dnl --------------------------------------------------------------------------- -dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN, WX_STANDARD_OPTIONS_SUMMARY_MSG_END -dnl -dnl Like WX_STANDARD_OPTIONS_SUMMARY_MSG macro but these two macros also gives info -dnl about the configuration of the package which used the wxpresets. -dnl -dnl Typical usage: -dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN -dnl echo " - Package setting 1: $SETTING1" -dnl echo " - Package setting 2: $SETTING1" -dnl ... -dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_END -dnl -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN], - [ - echo - echo " ----------------------------------------------------------------" - echo " Configuration for $PACKAGE_NAME $PACKAGE_VERSION successfully completed." - echo " Summary of main configuration settings for $PACKAGE_NAME:" - WX_BOOLOPT_SUMMARY([DEBUG], [" - DEBUG build"], [" - RELEASE build"]) - WX_BOOLOPT_SUMMARY([UNICODE], [" - UNICODE mode"], [" - ANSI mode"]) - WX_BOOLOPT_SUMMARY([SHARED], [" - SHARED mode"], [" - STATIC mode"]) - ]) - -AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_END], - [ - WX_STANDARD_OPTIONS_SUMMARY_MSG - echo - echo " Now, just run make." - echo " ----------------------------------------------------------------" - echo - ]) - - -dnl --------------------------------------------------------------------------- -dnl Deprecated macro wrappers -dnl --------------------------------------------------------------------------- - -AC_DEFUN([AM_OPTIONS_WXCONFIG], [WX_CONFIG_OPTIONS]) -AC_DEFUN([AM_PATH_WXCONFIG], [ - WX_CONFIG_CHECK([$1],[$2],[$3],[$4],[$5]) -]) -AC_DEFUN([AM_PATH_WXRC], [WXRC_CHECK([$1],[$2])]) diff --git a/tests/Makefile b/tests/Makefile deleted file mode 100644 index 137430854..000000000 --- a/tests/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk - -GTEST_ROOT ?= $(TOP)vendor/googletest -GTEST_FILE := ${GTEST_ROOT}/src/gtest-all - -run_PCH := $(d)support/tests_pre.h -run_CPPFLAGS := -I$(TOP)libaegisub/include -I$(TOP) -I$(d)support \ - -I$(GTEST_ROOT) -I$(GTEST_ROOT)/include $(CPPFLAGS_BOOST) $(CFLAGS_LUA) -run_CXXFLAGS := -Wno-unused-value -Wno-sign-compare -run_LIBS := $(LIBS_BOOST) $(LIBS_ICU) $(LIBS_UCHARDET) $(LIBS_PTHREAD) -run_OBJ := \ - $(patsubst %.cpp,%.o,$(wildcard $(d)tests/*.cpp)) \ - $(d)support/main.o \ - $(d)support/util.o \ - $(TOP)lib/libaegisub.a \ - $(GTEST_FILE).o - -# This bit of goofiness is to make it only try to build the tests if google -# test can be found and silently skip it if not, by using $(wildcard) to check -# for file existence -PROGRAM += $(subst $(GTEST_FILE).cc,$(d)run,$(wildcard $(GTEST_FILE).cc)) - -ifeq (yes, $(BUILD_DARWIN)) -run_LIBS += -framework ApplicationServices -framework Foundation -endif - -$(d)data: $(d)setup.sh - cd $(TOP)tests; ./setup.sh - -gtest_filter ?= * -test-libaegisub: $(d)run $(d)data - cd $(TOP)tests; ./run --gtest_filter="$(gtest_filter)" - -test: $(subst $(GTEST_FILE).cc,test-libaegisub,$(wildcard $(GTEST_FILE).cc)) - -include $(TOP)Makefile.target From 1a133cd567a3c3fd97233a3a678ed12ebe46bf5d Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 11 Feb 2019 19:27:48 -0500 Subject: [PATCH 089/271] meson: move version scripts to tools directory --- meson.build | 4 ++-- version.ps1 => tools/version.ps1 | 0 version.sh => tools/version.sh | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename version.ps1 => tools/version.ps1 (100%) rename version.sh => tools/version.sh (100%) mode change 100755 => 100644 diff --git a/meson.build b/meson.build index 77e64573f..c919ae867 100644 --- a/meson.build +++ b/meson.build @@ -3,9 +3,9 @@ project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', default_options: ['cpp_std=c++11', 'b_lto=true']) if host_machine.system() == 'windows' - version_sh = find_program('version.ps1') + version_sh = find_program('tools/version.ps1') else - version_sh = find_program('version.sh') + version_sh = find_program('tools/version.sh') endif version_inc = include_directories('.') version_h = custom_target('git_version.h', diff --git a/version.ps1 b/tools/version.ps1 similarity index 100% rename from version.ps1 rename to tools/version.ps1 diff --git a/version.sh b/tools/version.sh old mode 100755 new mode 100644 similarity index 100% rename from version.sh rename to tools/version.sh From a9dfafd37a197fa9f995a9c78164295897657d4b Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 11 Feb 2019 19:28:58 -0500 Subject: [PATCH 090/271] meson: fix syntax errors in packages/meson.build --- packages/meson.build | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/meson.build b/packages/meson.build index 799f4ff68..c114848f6 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -10,10 +10,11 @@ else install_dir: get_option('datadir') / 'applications') endif -foreach s: ['16x16.png', '22x22.png', '24x24.png', '32x32.png', - '48x48.png', '64x64.png', 'scalable.svg'] +aegisub_logos = ['16x16.png', '22x22.png', '24x24.png', '32x32.png', '48x48.png', '64x64.png', 'scalable.svg'] + +foreach s: aegisub_logos dir = s.split('.')[0] ext = s.split('.')[1] - install_data('desktop' / dir / 'aegisub.' + ext), + install_data('desktop' / dir / 'aegisub.' + ext, install_dir: get_option('datadir') / 'icons' / 'hicolor' / dir / 'apps') endforeach From 506bac365d30b616092292fa7ef9ffb29bc91ace Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 11 Feb 2019 19:56:21 -0500 Subject: [PATCH 091/271] meson: move luajit to subprojects directory --- subprojects/luajit | 1 - {vendor => subprojects}/luajit/COPYRIGHT | 0 {vendor => subprojects}/luajit/Makefile | 0 {vendor => subprojects}/luajit/README | 0 .../luajit/dynasm/dasm_arm.h | 0 .../luajit/dynasm/dasm_arm.lua | 0 .../luajit/dynasm/dasm_mips.h | 0 .../luajit/dynasm/dasm_mips.lua | 0 .../luajit/dynasm/dasm_ppc.h | 0 .../luajit/dynasm/dasm_ppc.lua | 0 .../luajit/dynasm/dasm_proto.h | 0 .../luajit/dynasm/dasm_x64.lua | 0 .../luajit/dynasm/dasm_x86.h | 0 .../luajit/dynasm/dasm_x86.lua | 0 .../luajit/dynasm/dynasm.lua | 0 .../luajit/include/lauxlib.h | 0 {vendor => subprojects}/luajit/include/lua.h | 0 .../luajit/include/lua.hpp | 0 .../luajit/include/luaconf.h | 0 .../luajit/include/luajit.h | 0 .../luajit/include/lualib.h | 0 {vendor => subprojects}/luajit/meson.build | 0 {vendor => subprojects}/luajit/src/Makefile | 0 .../luajit/src/host/README | 0 .../luajit/src/host/buildvm.c | 0 .../luajit/src/host/buildvm.h | 0 .../luajit/src/host/buildvm_asm.c | 0 .../luajit/src/host/buildvm_fold.c | 0 .../luajit/src/host/buildvm_lib.c | 0 .../luajit/src/host/buildvm_peobj.c | 0 .../luajit/src/host/genminilua.lua | 0 .../luajit/src/host/meson.build | 0 .../luajit/src/host/minilua.c | 0 {vendor => subprojects}/luajit/src/jit/bc.lua | 0 .../luajit/src/jit/bcsave.lua | 0 .../luajit/src/jit/dis_arm.lua | 0 .../luajit/src/jit/dis_mips.lua | 0 .../luajit/src/jit/dis_mipsel.lua | 0 .../luajit/src/jit/dis_ppc.lua | 0 .../luajit/src/jit/dis_x64.lua | 0 .../luajit/src/jit/dis_x86.lua | 0 .../luajit/src/jit/dump.lua | 0 {vendor => subprojects}/luajit/src/jit/v.lua | 0 {vendor => subprojects}/luajit/src/lauxlib.h | 0 {vendor => subprojects}/luajit/src/lib_aux.c | 0 {vendor => subprojects}/luajit/src/lib_base.c | 0 {vendor => subprojects}/luajit/src/lib_bit.c | 0 .../luajit/src/lib_debug.c | 0 {vendor => subprojects}/luajit/src/lib_ffi.c | 0 {vendor => subprojects}/luajit/src/lib_init.c | 0 {vendor => subprojects}/luajit/src/lib_io.c | 0 {vendor => subprojects}/luajit/src/lib_jit.c | 0 {vendor => subprojects}/luajit/src/lib_math.c | 0 {vendor => subprojects}/luajit/src/lib_os.c | 0 .../luajit/src/lib_package.c | 0 .../luajit/src/lib_string.c | 0 .../luajit/src/lib_table.c | 0 {vendor => subprojects}/luajit/src/lj.supp | 0 {vendor => subprojects}/luajit/src/lj_alloc.c | 0 {vendor => subprojects}/luajit/src/lj_alloc.h | 0 {vendor => subprojects}/luajit/src/lj_api.c | 0 {vendor => subprojects}/luajit/src/lj_arch.h | 0 {vendor => subprojects}/luajit/src/lj_asm.c | 0 {vendor => subprojects}/luajit/src/lj_asm.h | 0 .../luajit/src/lj_asm_arm.h | 0 .../luajit/src/lj_asm_mips.h | 0 .../luajit/src/lj_asm_ppc.h | 0 .../luajit/src/lj_asm_x86.h | 0 {vendor => subprojects}/luajit/src/lj_bc.c | 0 {vendor => subprojects}/luajit/src/lj_bc.h | 0 .../luajit/src/lj_bcdump.h | 0 .../luajit/src/lj_bcread.c | 0 .../luajit/src/lj_bcwrite.c | 0 .../luajit/src/lj_carith.c | 0 .../luajit/src/lj_carith.h | 0 {vendor => subprojects}/luajit/src/lj_ccall.c | 0 {vendor => subprojects}/luajit/src/lj_ccall.h | 0 .../luajit/src/lj_ccallback.c | 0 .../luajit/src/lj_ccallback.h | 0 {vendor => subprojects}/luajit/src/lj_cconv.c | 0 {vendor => subprojects}/luajit/src/lj_cconv.h | 0 {vendor => subprojects}/luajit/src/lj_cdata.c | 0 {vendor => subprojects}/luajit/src/lj_cdata.h | 0 {vendor => subprojects}/luajit/src/lj_char.c | 0 {vendor => subprojects}/luajit/src/lj_char.h | 0 {vendor => subprojects}/luajit/src/lj_clib.c | 0 {vendor => subprojects}/luajit/src/lj_clib.h | 0 .../luajit/src/lj_cparse.c | 0 .../luajit/src/lj_cparse.h | 0 .../luajit/src/lj_crecord.c | 0 .../luajit/src/lj_crecord.h | 0 {vendor => subprojects}/luajit/src/lj_ctype.c | 0 {vendor => subprojects}/luajit/src/lj_ctype.h | 0 {vendor => subprojects}/luajit/src/lj_debug.c | 0 {vendor => subprojects}/luajit/src/lj_debug.h | 0 {vendor => subprojects}/luajit/src/lj_def.h | 0 .../luajit/src/lj_dispatch.c | 0 .../luajit/src/lj_dispatch.h | 0 .../luajit/src/lj_emit_arm.h | 0 .../luajit/src/lj_emit_mips.h | 0 .../luajit/src/lj_emit_ppc.h | 0 .../luajit/src/lj_emit_x86.h | 0 {vendor => subprojects}/luajit/src/lj_err.c | 0 {vendor => subprojects}/luajit/src/lj_err.h | 0 .../luajit/src/lj_errmsg.h | 0 {vendor => subprojects}/luajit/src/lj_ff.h | 0 .../luajit/src/lj_ffrecord.c | 0 .../luajit/src/lj_ffrecord.h | 0 {vendor => subprojects}/luajit/src/lj_frame.h | 0 {vendor => subprojects}/luajit/src/lj_func.c | 0 {vendor => subprojects}/luajit/src/lj_func.h | 0 {vendor => subprojects}/luajit/src/lj_gc.c | 0 {vendor => subprojects}/luajit/src/lj_gc.h | 0 .../luajit/src/lj_gdbjit.c | 0 .../luajit/src/lj_gdbjit.h | 0 {vendor => subprojects}/luajit/src/lj_ir.c | 0 {vendor => subprojects}/luajit/src/lj_ir.h | 0 .../luajit/src/lj_ircall.h | 0 {vendor => subprojects}/luajit/src/lj_iropt.h | 0 {vendor => subprojects}/luajit/src/lj_jit.h | 0 {vendor => subprojects}/luajit/src/lj_lex.c | 0 {vendor => subprojects}/luajit/src/lj_lex.h | 0 {vendor => subprojects}/luajit/src/lj_lib.c | 0 {vendor => subprojects}/luajit/src/lj_lib.h | 0 {vendor => subprojects}/luajit/src/lj_load.c | 0 {vendor => subprojects}/luajit/src/lj_mcode.c | 0 {vendor => subprojects}/luajit/src/lj_mcode.h | 0 {vendor => subprojects}/luajit/src/lj_meta.c | 0 {vendor => subprojects}/luajit/src/lj_meta.h | 0 {vendor => subprojects}/luajit/src/lj_obj.c | 0 {vendor => subprojects}/luajit/src/lj_obj.h | 0 .../luajit/src/lj_opt_dce.c | 0 .../luajit/src/lj_opt_fold.c | 0 .../luajit/src/lj_opt_loop.c | 0 .../luajit/src/lj_opt_mem.c | 0 .../luajit/src/lj_opt_narrow.c | 0 .../luajit/src/lj_opt_sink.c | 0 .../luajit/src/lj_opt_split.c | 0 {vendor => subprojects}/luajit/src/lj_parse.c | 0 {vendor => subprojects}/luajit/src/lj_parse.h | 0 .../luajit/src/lj_record.c | 0 .../luajit/src/lj_record.h | 0 {vendor => subprojects}/luajit/src/lj_snap.c | 0 {vendor => subprojects}/luajit/src/lj_snap.h | 0 {vendor => subprojects}/luajit/src/lj_state.c | 0 {vendor => subprojects}/luajit/src/lj_state.h | 0 {vendor => subprojects}/luajit/src/lj_str.c | 0 {vendor => subprojects}/luajit/src/lj_str.h | 0 .../luajit/src/lj_strscan.c | 0 .../luajit/src/lj_strscan.h | 0 {vendor => subprojects}/luajit/src/lj_tab.c | 0 {vendor => subprojects}/luajit/src/lj_tab.h | 0 .../luajit/src/lj_target.h | 0 .../luajit/src/lj_target_arm.h | 0 .../luajit/src/lj_target_mips.h | 0 .../luajit/src/lj_target_ppc.h | 0 .../luajit/src/lj_target_x86.h | 0 {vendor => subprojects}/luajit/src/lj_trace.c | 0 {vendor => subprojects}/luajit/src/lj_trace.h | 0 .../luajit/src/lj_traceerr.h | 0 {vendor => subprojects}/luajit/src/lj_udata.c | 0 {vendor => subprojects}/luajit/src/lj_udata.h | 0 {vendor => subprojects}/luajit/src/lj_vm.h | 0 .../luajit/src/lj_vmevent.c | 0 .../luajit/src/lj_vmevent.h | 0 .../luajit/src/lj_vmmath.c | 0 {vendor => subprojects}/luajit/src/ljamalg.c | 0 {vendor => subprojects}/luajit/src/lua.h | 0 {vendor => subprojects}/luajit/src/lua.hpp | 0 {vendor => subprojects}/luajit/src/luaconf.h | 0 {vendor => subprojects}/luajit/src/luajit.c | 0 {vendor => subprojects}/luajit/src/luajit.h | 0 {vendor => subprojects}/luajit/src/lualib.h | 0 .../luajit/src/meson.build | 0 .../luajit/src/vm_arm.dasc | 0 .../luajit/src/vm_mips.dasc | 0 .../luajit/src/vm_ppc.dasc | 0 .../luajit/src/vm_ppcspe.dasc | 0 .../luajit/src/vm_x86.dasc | 0 .../luajit/unicode-io.patch | 0 .../luajit/unicode-os.patch | 0 vendor/luajit/src/Makefile.dep | 226 ------------------ 182 files changed, 227 deletions(-) delete mode 120000 subprojects/luajit rename {vendor => subprojects}/luajit/COPYRIGHT (100%) rename {vendor => subprojects}/luajit/Makefile (100%) rename {vendor => subprojects}/luajit/README (100%) rename {vendor => subprojects}/luajit/dynasm/dasm_arm.h (100%) rename {vendor => subprojects}/luajit/dynasm/dasm_arm.lua (100%) rename {vendor => subprojects}/luajit/dynasm/dasm_mips.h (100%) rename {vendor => subprojects}/luajit/dynasm/dasm_mips.lua (100%) rename {vendor => subprojects}/luajit/dynasm/dasm_ppc.h (100%) rename {vendor => subprojects}/luajit/dynasm/dasm_ppc.lua (100%) rename {vendor => subprojects}/luajit/dynasm/dasm_proto.h (100%) rename {vendor => subprojects}/luajit/dynasm/dasm_x64.lua (100%) rename {vendor => subprojects}/luajit/dynasm/dasm_x86.h (100%) rename {vendor => subprojects}/luajit/dynasm/dasm_x86.lua (100%) rename {vendor => subprojects}/luajit/dynasm/dynasm.lua (100%) rename {vendor => subprojects}/luajit/include/lauxlib.h (100%) rename {vendor => subprojects}/luajit/include/lua.h (100%) rename {vendor => subprojects}/luajit/include/lua.hpp (100%) rename {vendor => subprojects}/luajit/include/luaconf.h (100%) rename {vendor => subprojects}/luajit/include/luajit.h (100%) rename {vendor => subprojects}/luajit/include/lualib.h (100%) rename {vendor => subprojects}/luajit/meson.build (100%) rename {vendor => subprojects}/luajit/src/Makefile (100%) rename {vendor => subprojects}/luajit/src/host/README (100%) rename {vendor => subprojects}/luajit/src/host/buildvm.c (100%) rename {vendor => subprojects}/luajit/src/host/buildvm.h (100%) rename {vendor => subprojects}/luajit/src/host/buildvm_asm.c (100%) rename {vendor => subprojects}/luajit/src/host/buildvm_fold.c (100%) rename {vendor => subprojects}/luajit/src/host/buildvm_lib.c (100%) rename {vendor => subprojects}/luajit/src/host/buildvm_peobj.c (100%) rename {vendor => subprojects}/luajit/src/host/genminilua.lua (100%) rename {vendor => subprojects}/luajit/src/host/meson.build (100%) rename {vendor => subprojects}/luajit/src/host/minilua.c (100%) rename {vendor => subprojects}/luajit/src/jit/bc.lua (100%) rename {vendor => subprojects}/luajit/src/jit/bcsave.lua (100%) rename {vendor => subprojects}/luajit/src/jit/dis_arm.lua (100%) rename {vendor => subprojects}/luajit/src/jit/dis_mips.lua (100%) rename {vendor => subprojects}/luajit/src/jit/dis_mipsel.lua (100%) rename {vendor => subprojects}/luajit/src/jit/dis_ppc.lua (100%) rename {vendor => subprojects}/luajit/src/jit/dis_x64.lua (100%) rename {vendor => subprojects}/luajit/src/jit/dis_x86.lua (100%) rename {vendor => subprojects}/luajit/src/jit/dump.lua (100%) rename {vendor => subprojects}/luajit/src/jit/v.lua (100%) rename {vendor => subprojects}/luajit/src/lauxlib.h (100%) rename {vendor => subprojects}/luajit/src/lib_aux.c (100%) rename {vendor => subprojects}/luajit/src/lib_base.c (100%) rename {vendor => subprojects}/luajit/src/lib_bit.c (100%) rename {vendor => subprojects}/luajit/src/lib_debug.c (100%) rename {vendor => subprojects}/luajit/src/lib_ffi.c (100%) rename {vendor => subprojects}/luajit/src/lib_init.c (100%) rename {vendor => subprojects}/luajit/src/lib_io.c (100%) rename {vendor => subprojects}/luajit/src/lib_jit.c (100%) rename {vendor => subprojects}/luajit/src/lib_math.c (100%) rename {vendor => subprojects}/luajit/src/lib_os.c (100%) rename {vendor => subprojects}/luajit/src/lib_package.c (100%) rename {vendor => subprojects}/luajit/src/lib_string.c (100%) rename {vendor => subprojects}/luajit/src/lib_table.c (100%) rename {vendor => subprojects}/luajit/src/lj.supp (100%) rename {vendor => subprojects}/luajit/src/lj_alloc.c (100%) rename {vendor => subprojects}/luajit/src/lj_alloc.h (100%) rename {vendor => subprojects}/luajit/src/lj_api.c (100%) rename {vendor => subprojects}/luajit/src/lj_arch.h (100%) rename {vendor => subprojects}/luajit/src/lj_asm.c (100%) rename {vendor => subprojects}/luajit/src/lj_asm.h (100%) rename {vendor => subprojects}/luajit/src/lj_asm_arm.h (100%) rename {vendor => subprojects}/luajit/src/lj_asm_mips.h (100%) rename {vendor => subprojects}/luajit/src/lj_asm_ppc.h (100%) rename {vendor => subprojects}/luajit/src/lj_asm_x86.h (100%) rename {vendor => subprojects}/luajit/src/lj_bc.c (100%) rename {vendor => subprojects}/luajit/src/lj_bc.h (100%) rename {vendor => subprojects}/luajit/src/lj_bcdump.h (100%) rename {vendor => subprojects}/luajit/src/lj_bcread.c (100%) rename {vendor => subprojects}/luajit/src/lj_bcwrite.c (100%) rename {vendor => subprojects}/luajit/src/lj_carith.c (100%) rename {vendor => subprojects}/luajit/src/lj_carith.h (100%) rename {vendor => subprojects}/luajit/src/lj_ccall.c (100%) rename {vendor => subprojects}/luajit/src/lj_ccall.h (100%) rename {vendor => subprojects}/luajit/src/lj_ccallback.c (100%) rename {vendor => subprojects}/luajit/src/lj_ccallback.h (100%) rename {vendor => subprojects}/luajit/src/lj_cconv.c (100%) rename {vendor => subprojects}/luajit/src/lj_cconv.h (100%) rename {vendor => subprojects}/luajit/src/lj_cdata.c (100%) rename {vendor => subprojects}/luajit/src/lj_cdata.h (100%) rename {vendor => subprojects}/luajit/src/lj_char.c (100%) rename {vendor => subprojects}/luajit/src/lj_char.h (100%) rename {vendor => subprojects}/luajit/src/lj_clib.c (100%) rename {vendor => subprojects}/luajit/src/lj_clib.h (100%) rename {vendor => subprojects}/luajit/src/lj_cparse.c (100%) rename {vendor => subprojects}/luajit/src/lj_cparse.h (100%) rename {vendor => subprojects}/luajit/src/lj_crecord.c (100%) rename {vendor => subprojects}/luajit/src/lj_crecord.h (100%) rename {vendor => subprojects}/luajit/src/lj_ctype.c (100%) rename {vendor => subprojects}/luajit/src/lj_ctype.h (100%) rename {vendor => subprojects}/luajit/src/lj_debug.c (100%) rename {vendor => subprojects}/luajit/src/lj_debug.h (100%) rename {vendor => subprojects}/luajit/src/lj_def.h (100%) rename {vendor => subprojects}/luajit/src/lj_dispatch.c (100%) rename {vendor => subprojects}/luajit/src/lj_dispatch.h (100%) rename {vendor => subprojects}/luajit/src/lj_emit_arm.h (100%) rename {vendor => subprojects}/luajit/src/lj_emit_mips.h (100%) rename {vendor => subprojects}/luajit/src/lj_emit_ppc.h (100%) rename {vendor => subprojects}/luajit/src/lj_emit_x86.h (100%) rename {vendor => subprojects}/luajit/src/lj_err.c (100%) rename {vendor => subprojects}/luajit/src/lj_err.h (100%) rename {vendor => subprojects}/luajit/src/lj_errmsg.h (100%) rename {vendor => subprojects}/luajit/src/lj_ff.h (100%) rename {vendor => subprojects}/luajit/src/lj_ffrecord.c (100%) rename {vendor => subprojects}/luajit/src/lj_ffrecord.h (100%) rename {vendor => subprojects}/luajit/src/lj_frame.h (100%) rename {vendor => subprojects}/luajit/src/lj_func.c (100%) rename {vendor => subprojects}/luajit/src/lj_func.h (100%) rename {vendor => subprojects}/luajit/src/lj_gc.c (100%) rename {vendor => subprojects}/luajit/src/lj_gc.h (100%) rename {vendor => subprojects}/luajit/src/lj_gdbjit.c (100%) rename {vendor => subprojects}/luajit/src/lj_gdbjit.h (100%) rename {vendor => subprojects}/luajit/src/lj_ir.c (100%) rename {vendor => subprojects}/luajit/src/lj_ir.h (100%) rename {vendor => subprojects}/luajit/src/lj_ircall.h (100%) rename {vendor => subprojects}/luajit/src/lj_iropt.h (100%) rename {vendor => subprojects}/luajit/src/lj_jit.h (100%) rename {vendor => subprojects}/luajit/src/lj_lex.c (100%) rename {vendor => subprojects}/luajit/src/lj_lex.h (100%) rename {vendor => subprojects}/luajit/src/lj_lib.c (100%) rename {vendor => subprojects}/luajit/src/lj_lib.h (100%) rename {vendor => subprojects}/luajit/src/lj_load.c (100%) rename {vendor => subprojects}/luajit/src/lj_mcode.c (100%) rename {vendor => subprojects}/luajit/src/lj_mcode.h (100%) rename {vendor => subprojects}/luajit/src/lj_meta.c (100%) rename {vendor => subprojects}/luajit/src/lj_meta.h (100%) rename {vendor => subprojects}/luajit/src/lj_obj.c (100%) rename {vendor => subprojects}/luajit/src/lj_obj.h (100%) rename {vendor => subprojects}/luajit/src/lj_opt_dce.c (100%) rename {vendor => subprojects}/luajit/src/lj_opt_fold.c (100%) rename {vendor => subprojects}/luajit/src/lj_opt_loop.c (100%) rename {vendor => subprojects}/luajit/src/lj_opt_mem.c (100%) rename {vendor => subprojects}/luajit/src/lj_opt_narrow.c (100%) rename {vendor => subprojects}/luajit/src/lj_opt_sink.c (100%) rename {vendor => subprojects}/luajit/src/lj_opt_split.c (100%) rename {vendor => subprojects}/luajit/src/lj_parse.c (100%) rename {vendor => subprojects}/luajit/src/lj_parse.h (100%) rename {vendor => subprojects}/luajit/src/lj_record.c (100%) rename {vendor => subprojects}/luajit/src/lj_record.h (100%) rename {vendor => subprojects}/luajit/src/lj_snap.c (100%) rename {vendor => subprojects}/luajit/src/lj_snap.h (100%) rename {vendor => subprojects}/luajit/src/lj_state.c (100%) rename {vendor => subprojects}/luajit/src/lj_state.h (100%) rename {vendor => subprojects}/luajit/src/lj_str.c (100%) rename {vendor => subprojects}/luajit/src/lj_str.h (100%) rename {vendor => subprojects}/luajit/src/lj_strscan.c (100%) rename {vendor => subprojects}/luajit/src/lj_strscan.h (100%) rename {vendor => subprojects}/luajit/src/lj_tab.c (100%) rename {vendor => subprojects}/luajit/src/lj_tab.h (100%) rename {vendor => subprojects}/luajit/src/lj_target.h (100%) rename {vendor => subprojects}/luajit/src/lj_target_arm.h (100%) rename {vendor => subprojects}/luajit/src/lj_target_mips.h (100%) rename {vendor => subprojects}/luajit/src/lj_target_ppc.h (100%) rename {vendor => subprojects}/luajit/src/lj_target_x86.h (100%) rename {vendor => subprojects}/luajit/src/lj_trace.c (100%) rename {vendor => subprojects}/luajit/src/lj_trace.h (100%) rename {vendor => subprojects}/luajit/src/lj_traceerr.h (100%) rename {vendor => subprojects}/luajit/src/lj_udata.c (100%) rename {vendor => subprojects}/luajit/src/lj_udata.h (100%) rename {vendor => subprojects}/luajit/src/lj_vm.h (100%) rename {vendor => subprojects}/luajit/src/lj_vmevent.c (100%) rename {vendor => subprojects}/luajit/src/lj_vmevent.h (100%) rename {vendor => subprojects}/luajit/src/lj_vmmath.c (100%) rename {vendor => subprojects}/luajit/src/ljamalg.c (100%) rename {vendor => subprojects}/luajit/src/lua.h (100%) rename {vendor => subprojects}/luajit/src/lua.hpp (100%) rename {vendor => subprojects}/luajit/src/luaconf.h (100%) rename {vendor => subprojects}/luajit/src/luajit.c (100%) rename {vendor => subprojects}/luajit/src/luajit.h (100%) rename {vendor => subprojects}/luajit/src/lualib.h (100%) rename {vendor => subprojects}/luajit/src/meson.build (100%) rename {vendor => subprojects}/luajit/src/vm_arm.dasc (100%) rename {vendor => subprojects}/luajit/src/vm_mips.dasc (100%) rename {vendor => subprojects}/luajit/src/vm_ppc.dasc (100%) rename {vendor => subprojects}/luajit/src/vm_ppcspe.dasc (100%) rename {vendor => subprojects}/luajit/src/vm_x86.dasc (100%) rename {vendor => subprojects}/luajit/unicode-io.patch (100%) rename {vendor => subprojects}/luajit/unicode-os.patch (100%) delete mode 100644 vendor/luajit/src/Makefile.dep diff --git a/subprojects/luajit b/subprojects/luajit deleted file mode 120000 index cf99205fa..000000000 --- a/subprojects/luajit +++ /dev/null @@ -1 +0,0 @@ -../vendor/luajit \ No newline at end of file diff --git a/vendor/luajit/COPYRIGHT b/subprojects/luajit/COPYRIGHT similarity index 100% rename from vendor/luajit/COPYRIGHT rename to subprojects/luajit/COPYRIGHT diff --git a/vendor/luajit/Makefile b/subprojects/luajit/Makefile similarity index 100% rename from vendor/luajit/Makefile rename to subprojects/luajit/Makefile diff --git a/vendor/luajit/README b/subprojects/luajit/README similarity index 100% rename from vendor/luajit/README rename to subprojects/luajit/README diff --git a/vendor/luajit/dynasm/dasm_arm.h b/subprojects/luajit/dynasm/dasm_arm.h similarity index 100% rename from vendor/luajit/dynasm/dasm_arm.h rename to subprojects/luajit/dynasm/dasm_arm.h diff --git a/vendor/luajit/dynasm/dasm_arm.lua b/subprojects/luajit/dynasm/dasm_arm.lua similarity index 100% rename from vendor/luajit/dynasm/dasm_arm.lua rename to subprojects/luajit/dynasm/dasm_arm.lua diff --git a/vendor/luajit/dynasm/dasm_mips.h b/subprojects/luajit/dynasm/dasm_mips.h similarity index 100% rename from vendor/luajit/dynasm/dasm_mips.h rename to subprojects/luajit/dynasm/dasm_mips.h diff --git a/vendor/luajit/dynasm/dasm_mips.lua b/subprojects/luajit/dynasm/dasm_mips.lua similarity index 100% rename from vendor/luajit/dynasm/dasm_mips.lua rename to subprojects/luajit/dynasm/dasm_mips.lua diff --git a/vendor/luajit/dynasm/dasm_ppc.h b/subprojects/luajit/dynasm/dasm_ppc.h similarity index 100% rename from vendor/luajit/dynasm/dasm_ppc.h rename to subprojects/luajit/dynasm/dasm_ppc.h diff --git a/vendor/luajit/dynasm/dasm_ppc.lua b/subprojects/luajit/dynasm/dasm_ppc.lua similarity index 100% rename from vendor/luajit/dynasm/dasm_ppc.lua rename to subprojects/luajit/dynasm/dasm_ppc.lua diff --git a/vendor/luajit/dynasm/dasm_proto.h b/subprojects/luajit/dynasm/dasm_proto.h similarity index 100% rename from vendor/luajit/dynasm/dasm_proto.h rename to subprojects/luajit/dynasm/dasm_proto.h diff --git a/vendor/luajit/dynasm/dasm_x64.lua b/subprojects/luajit/dynasm/dasm_x64.lua similarity index 100% rename from vendor/luajit/dynasm/dasm_x64.lua rename to subprojects/luajit/dynasm/dasm_x64.lua diff --git a/vendor/luajit/dynasm/dasm_x86.h b/subprojects/luajit/dynasm/dasm_x86.h similarity index 100% rename from vendor/luajit/dynasm/dasm_x86.h rename to subprojects/luajit/dynasm/dasm_x86.h diff --git a/vendor/luajit/dynasm/dasm_x86.lua b/subprojects/luajit/dynasm/dasm_x86.lua similarity index 100% rename from vendor/luajit/dynasm/dasm_x86.lua rename to subprojects/luajit/dynasm/dasm_x86.lua diff --git a/vendor/luajit/dynasm/dynasm.lua b/subprojects/luajit/dynasm/dynasm.lua similarity index 100% rename from vendor/luajit/dynasm/dynasm.lua rename to subprojects/luajit/dynasm/dynasm.lua diff --git a/vendor/luajit/include/lauxlib.h b/subprojects/luajit/include/lauxlib.h similarity index 100% rename from vendor/luajit/include/lauxlib.h rename to subprojects/luajit/include/lauxlib.h diff --git a/vendor/luajit/include/lua.h b/subprojects/luajit/include/lua.h similarity index 100% rename from vendor/luajit/include/lua.h rename to subprojects/luajit/include/lua.h diff --git a/vendor/luajit/include/lua.hpp b/subprojects/luajit/include/lua.hpp similarity index 100% rename from vendor/luajit/include/lua.hpp rename to subprojects/luajit/include/lua.hpp diff --git a/vendor/luajit/include/luaconf.h b/subprojects/luajit/include/luaconf.h similarity index 100% rename from vendor/luajit/include/luaconf.h rename to subprojects/luajit/include/luaconf.h diff --git a/vendor/luajit/include/luajit.h b/subprojects/luajit/include/luajit.h similarity index 100% rename from vendor/luajit/include/luajit.h rename to subprojects/luajit/include/luajit.h diff --git a/vendor/luajit/include/lualib.h b/subprojects/luajit/include/lualib.h similarity index 100% rename from vendor/luajit/include/lualib.h rename to subprojects/luajit/include/lualib.h diff --git a/vendor/luajit/meson.build b/subprojects/luajit/meson.build similarity index 100% rename from vendor/luajit/meson.build rename to subprojects/luajit/meson.build diff --git a/vendor/luajit/src/Makefile b/subprojects/luajit/src/Makefile similarity index 100% rename from vendor/luajit/src/Makefile rename to subprojects/luajit/src/Makefile diff --git a/vendor/luajit/src/host/README b/subprojects/luajit/src/host/README similarity index 100% rename from vendor/luajit/src/host/README rename to subprojects/luajit/src/host/README diff --git a/vendor/luajit/src/host/buildvm.c b/subprojects/luajit/src/host/buildvm.c similarity index 100% rename from vendor/luajit/src/host/buildvm.c rename to subprojects/luajit/src/host/buildvm.c diff --git a/vendor/luajit/src/host/buildvm.h b/subprojects/luajit/src/host/buildvm.h similarity index 100% rename from vendor/luajit/src/host/buildvm.h rename to subprojects/luajit/src/host/buildvm.h diff --git a/vendor/luajit/src/host/buildvm_asm.c b/subprojects/luajit/src/host/buildvm_asm.c similarity index 100% rename from vendor/luajit/src/host/buildvm_asm.c rename to subprojects/luajit/src/host/buildvm_asm.c diff --git a/vendor/luajit/src/host/buildvm_fold.c b/subprojects/luajit/src/host/buildvm_fold.c similarity index 100% rename from vendor/luajit/src/host/buildvm_fold.c rename to subprojects/luajit/src/host/buildvm_fold.c diff --git a/vendor/luajit/src/host/buildvm_lib.c b/subprojects/luajit/src/host/buildvm_lib.c similarity index 100% rename from vendor/luajit/src/host/buildvm_lib.c rename to subprojects/luajit/src/host/buildvm_lib.c diff --git a/vendor/luajit/src/host/buildvm_peobj.c b/subprojects/luajit/src/host/buildvm_peobj.c similarity index 100% rename from vendor/luajit/src/host/buildvm_peobj.c rename to subprojects/luajit/src/host/buildvm_peobj.c diff --git a/vendor/luajit/src/host/genminilua.lua b/subprojects/luajit/src/host/genminilua.lua similarity index 100% rename from vendor/luajit/src/host/genminilua.lua rename to subprojects/luajit/src/host/genminilua.lua diff --git a/vendor/luajit/src/host/meson.build b/subprojects/luajit/src/host/meson.build similarity index 100% rename from vendor/luajit/src/host/meson.build rename to subprojects/luajit/src/host/meson.build diff --git a/vendor/luajit/src/host/minilua.c b/subprojects/luajit/src/host/minilua.c similarity index 100% rename from vendor/luajit/src/host/minilua.c rename to subprojects/luajit/src/host/minilua.c diff --git a/vendor/luajit/src/jit/bc.lua b/subprojects/luajit/src/jit/bc.lua similarity index 100% rename from vendor/luajit/src/jit/bc.lua rename to subprojects/luajit/src/jit/bc.lua diff --git a/vendor/luajit/src/jit/bcsave.lua b/subprojects/luajit/src/jit/bcsave.lua similarity index 100% rename from vendor/luajit/src/jit/bcsave.lua rename to subprojects/luajit/src/jit/bcsave.lua diff --git a/vendor/luajit/src/jit/dis_arm.lua b/subprojects/luajit/src/jit/dis_arm.lua similarity index 100% rename from vendor/luajit/src/jit/dis_arm.lua rename to subprojects/luajit/src/jit/dis_arm.lua diff --git a/vendor/luajit/src/jit/dis_mips.lua b/subprojects/luajit/src/jit/dis_mips.lua similarity index 100% rename from vendor/luajit/src/jit/dis_mips.lua rename to subprojects/luajit/src/jit/dis_mips.lua diff --git a/vendor/luajit/src/jit/dis_mipsel.lua b/subprojects/luajit/src/jit/dis_mipsel.lua similarity index 100% rename from vendor/luajit/src/jit/dis_mipsel.lua rename to subprojects/luajit/src/jit/dis_mipsel.lua diff --git a/vendor/luajit/src/jit/dis_ppc.lua b/subprojects/luajit/src/jit/dis_ppc.lua similarity index 100% rename from vendor/luajit/src/jit/dis_ppc.lua rename to subprojects/luajit/src/jit/dis_ppc.lua diff --git a/vendor/luajit/src/jit/dis_x64.lua b/subprojects/luajit/src/jit/dis_x64.lua similarity index 100% rename from vendor/luajit/src/jit/dis_x64.lua rename to subprojects/luajit/src/jit/dis_x64.lua diff --git a/vendor/luajit/src/jit/dis_x86.lua b/subprojects/luajit/src/jit/dis_x86.lua similarity index 100% rename from vendor/luajit/src/jit/dis_x86.lua rename to subprojects/luajit/src/jit/dis_x86.lua diff --git a/vendor/luajit/src/jit/dump.lua b/subprojects/luajit/src/jit/dump.lua similarity index 100% rename from vendor/luajit/src/jit/dump.lua rename to subprojects/luajit/src/jit/dump.lua diff --git a/vendor/luajit/src/jit/v.lua b/subprojects/luajit/src/jit/v.lua similarity index 100% rename from vendor/luajit/src/jit/v.lua rename to subprojects/luajit/src/jit/v.lua diff --git a/vendor/luajit/src/lauxlib.h b/subprojects/luajit/src/lauxlib.h similarity index 100% rename from vendor/luajit/src/lauxlib.h rename to subprojects/luajit/src/lauxlib.h diff --git a/vendor/luajit/src/lib_aux.c b/subprojects/luajit/src/lib_aux.c similarity index 100% rename from vendor/luajit/src/lib_aux.c rename to subprojects/luajit/src/lib_aux.c diff --git a/vendor/luajit/src/lib_base.c b/subprojects/luajit/src/lib_base.c similarity index 100% rename from vendor/luajit/src/lib_base.c rename to subprojects/luajit/src/lib_base.c diff --git a/vendor/luajit/src/lib_bit.c b/subprojects/luajit/src/lib_bit.c similarity index 100% rename from vendor/luajit/src/lib_bit.c rename to subprojects/luajit/src/lib_bit.c diff --git a/vendor/luajit/src/lib_debug.c b/subprojects/luajit/src/lib_debug.c similarity index 100% rename from vendor/luajit/src/lib_debug.c rename to subprojects/luajit/src/lib_debug.c diff --git a/vendor/luajit/src/lib_ffi.c b/subprojects/luajit/src/lib_ffi.c similarity index 100% rename from vendor/luajit/src/lib_ffi.c rename to subprojects/luajit/src/lib_ffi.c diff --git a/vendor/luajit/src/lib_init.c b/subprojects/luajit/src/lib_init.c similarity index 100% rename from vendor/luajit/src/lib_init.c rename to subprojects/luajit/src/lib_init.c diff --git a/vendor/luajit/src/lib_io.c b/subprojects/luajit/src/lib_io.c similarity index 100% rename from vendor/luajit/src/lib_io.c rename to subprojects/luajit/src/lib_io.c diff --git a/vendor/luajit/src/lib_jit.c b/subprojects/luajit/src/lib_jit.c similarity index 100% rename from vendor/luajit/src/lib_jit.c rename to subprojects/luajit/src/lib_jit.c diff --git a/vendor/luajit/src/lib_math.c b/subprojects/luajit/src/lib_math.c similarity index 100% rename from vendor/luajit/src/lib_math.c rename to subprojects/luajit/src/lib_math.c diff --git a/vendor/luajit/src/lib_os.c b/subprojects/luajit/src/lib_os.c similarity index 100% rename from vendor/luajit/src/lib_os.c rename to subprojects/luajit/src/lib_os.c diff --git a/vendor/luajit/src/lib_package.c b/subprojects/luajit/src/lib_package.c similarity index 100% rename from vendor/luajit/src/lib_package.c rename to subprojects/luajit/src/lib_package.c diff --git a/vendor/luajit/src/lib_string.c b/subprojects/luajit/src/lib_string.c similarity index 100% rename from vendor/luajit/src/lib_string.c rename to subprojects/luajit/src/lib_string.c diff --git a/vendor/luajit/src/lib_table.c b/subprojects/luajit/src/lib_table.c similarity index 100% rename from vendor/luajit/src/lib_table.c rename to subprojects/luajit/src/lib_table.c diff --git a/vendor/luajit/src/lj.supp b/subprojects/luajit/src/lj.supp similarity index 100% rename from vendor/luajit/src/lj.supp rename to subprojects/luajit/src/lj.supp diff --git a/vendor/luajit/src/lj_alloc.c b/subprojects/luajit/src/lj_alloc.c similarity index 100% rename from vendor/luajit/src/lj_alloc.c rename to subprojects/luajit/src/lj_alloc.c diff --git a/vendor/luajit/src/lj_alloc.h b/subprojects/luajit/src/lj_alloc.h similarity index 100% rename from vendor/luajit/src/lj_alloc.h rename to subprojects/luajit/src/lj_alloc.h diff --git a/vendor/luajit/src/lj_api.c b/subprojects/luajit/src/lj_api.c similarity index 100% rename from vendor/luajit/src/lj_api.c rename to subprojects/luajit/src/lj_api.c diff --git a/vendor/luajit/src/lj_arch.h b/subprojects/luajit/src/lj_arch.h similarity index 100% rename from vendor/luajit/src/lj_arch.h rename to subprojects/luajit/src/lj_arch.h diff --git a/vendor/luajit/src/lj_asm.c b/subprojects/luajit/src/lj_asm.c similarity index 100% rename from vendor/luajit/src/lj_asm.c rename to subprojects/luajit/src/lj_asm.c diff --git a/vendor/luajit/src/lj_asm.h b/subprojects/luajit/src/lj_asm.h similarity index 100% rename from vendor/luajit/src/lj_asm.h rename to subprojects/luajit/src/lj_asm.h diff --git a/vendor/luajit/src/lj_asm_arm.h b/subprojects/luajit/src/lj_asm_arm.h similarity index 100% rename from vendor/luajit/src/lj_asm_arm.h rename to subprojects/luajit/src/lj_asm_arm.h diff --git a/vendor/luajit/src/lj_asm_mips.h b/subprojects/luajit/src/lj_asm_mips.h similarity index 100% rename from vendor/luajit/src/lj_asm_mips.h rename to subprojects/luajit/src/lj_asm_mips.h diff --git a/vendor/luajit/src/lj_asm_ppc.h b/subprojects/luajit/src/lj_asm_ppc.h similarity index 100% rename from vendor/luajit/src/lj_asm_ppc.h rename to subprojects/luajit/src/lj_asm_ppc.h diff --git a/vendor/luajit/src/lj_asm_x86.h b/subprojects/luajit/src/lj_asm_x86.h similarity index 100% rename from vendor/luajit/src/lj_asm_x86.h rename to subprojects/luajit/src/lj_asm_x86.h diff --git a/vendor/luajit/src/lj_bc.c b/subprojects/luajit/src/lj_bc.c similarity index 100% rename from vendor/luajit/src/lj_bc.c rename to subprojects/luajit/src/lj_bc.c diff --git a/vendor/luajit/src/lj_bc.h b/subprojects/luajit/src/lj_bc.h similarity index 100% rename from vendor/luajit/src/lj_bc.h rename to subprojects/luajit/src/lj_bc.h diff --git a/vendor/luajit/src/lj_bcdump.h b/subprojects/luajit/src/lj_bcdump.h similarity index 100% rename from vendor/luajit/src/lj_bcdump.h rename to subprojects/luajit/src/lj_bcdump.h diff --git a/vendor/luajit/src/lj_bcread.c b/subprojects/luajit/src/lj_bcread.c similarity index 100% rename from vendor/luajit/src/lj_bcread.c rename to subprojects/luajit/src/lj_bcread.c diff --git a/vendor/luajit/src/lj_bcwrite.c b/subprojects/luajit/src/lj_bcwrite.c similarity index 100% rename from vendor/luajit/src/lj_bcwrite.c rename to subprojects/luajit/src/lj_bcwrite.c diff --git a/vendor/luajit/src/lj_carith.c b/subprojects/luajit/src/lj_carith.c similarity index 100% rename from vendor/luajit/src/lj_carith.c rename to subprojects/luajit/src/lj_carith.c diff --git a/vendor/luajit/src/lj_carith.h b/subprojects/luajit/src/lj_carith.h similarity index 100% rename from vendor/luajit/src/lj_carith.h rename to subprojects/luajit/src/lj_carith.h diff --git a/vendor/luajit/src/lj_ccall.c b/subprojects/luajit/src/lj_ccall.c similarity index 100% rename from vendor/luajit/src/lj_ccall.c rename to subprojects/luajit/src/lj_ccall.c diff --git a/vendor/luajit/src/lj_ccall.h b/subprojects/luajit/src/lj_ccall.h similarity index 100% rename from vendor/luajit/src/lj_ccall.h rename to subprojects/luajit/src/lj_ccall.h diff --git a/vendor/luajit/src/lj_ccallback.c b/subprojects/luajit/src/lj_ccallback.c similarity index 100% rename from vendor/luajit/src/lj_ccallback.c rename to subprojects/luajit/src/lj_ccallback.c diff --git a/vendor/luajit/src/lj_ccallback.h b/subprojects/luajit/src/lj_ccallback.h similarity index 100% rename from vendor/luajit/src/lj_ccallback.h rename to subprojects/luajit/src/lj_ccallback.h diff --git a/vendor/luajit/src/lj_cconv.c b/subprojects/luajit/src/lj_cconv.c similarity index 100% rename from vendor/luajit/src/lj_cconv.c rename to subprojects/luajit/src/lj_cconv.c diff --git a/vendor/luajit/src/lj_cconv.h b/subprojects/luajit/src/lj_cconv.h similarity index 100% rename from vendor/luajit/src/lj_cconv.h rename to subprojects/luajit/src/lj_cconv.h diff --git a/vendor/luajit/src/lj_cdata.c b/subprojects/luajit/src/lj_cdata.c similarity index 100% rename from vendor/luajit/src/lj_cdata.c rename to subprojects/luajit/src/lj_cdata.c diff --git a/vendor/luajit/src/lj_cdata.h b/subprojects/luajit/src/lj_cdata.h similarity index 100% rename from vendor/luajit/src/lj_cdata.h rename to subprojects/luajit/src/lj_cdata.h diff --git a/vendor/luajit/src/lj_char.c b/subprojects/luajit/src/lj_char.c similarity index 100% rename from vendor/luajit/src/lj_char.c rename to subprojects/luajit/src/lj_char.c diff --git a/vendor/luajit/src/lj_char.h b/subprojects/luajit/src/lj_char.h similarity index 100% rename from vendor/luajit/src/lj_char.h rename to subprojects/luajit/src/lj_char.h diff --git a/vendor/luajit/src/lj_clib.c b/subprojects/luajit/src/lj_clib.c similarity index 100% rename from vendor/luajit/src/lj_clib.c rename to subprojects/luajit/src/lj_clib.c diff --git a/vendor/luajit/src/lj_clib.h b/subprojects/luajit/src/lj_clib.h similarity index 100% rename from vendor/luajit/src/lj_clib.h rename to subprojects/luajit/src/lj_clib.h diff --git a/vendor/luajit/src/lj_cparse.c b/subprojects/luajit/src/lj_cparse.c similarity index 100% rename from vendor/luajit/src/lj_cparse.c rename to subprojects/luajit/src/lj_cparse.c diff --git a/vendor/luajit/src/lj_cparse.h b/subprojects/luajit/src/lj_cparse.h similarity index 100% rename from vendor/luajit/src/lj_cparse.h rename to subprojects/luajit/src/lj_cparse.h diff --git a/vendor/luajit/src/lj_crecord.c b/subprojects/luajit/src/lj_crecord.c similarity index 100% rename from vendor/luajit/src/lj_crecord.c rename to subprojects/luajit/src/lj_crecord.c diff --git a/vendor/luajit/src/lj_crecord.h b/subprojects/luajit/src/lj_crecord.h similarity index 100% rename from vendor/luajit/src/lj_crecord.h rename to subprojects/luajit/src/lj_crecord.h diff --git a/vendor/luajit/src/lj_ctype.c b/subprojects/luajit/src/lj_ctype.c similarity index 100% rename from vendor/luajit/src/lj_ctype.c rename to subprojects/luajit/src/lj_ctype.c diff --git a/vendor/luajit/src/lj_ctype.h b/subprojects/luajit/src/lj_ctype.h similarity index 100% rename from vendor/luajit/src/lj_ctype.h rename to subprojects/luajit/src/lj_ctype.h diff --git a/vendor/luajit/src/lj_debug.c b/subprojects/luajit/src/lj_debug.c similarity index 100% rename from vendor/luajit/src/lj_debug.c rename to subprojects/luajit/src/lj_debug.c diff --git a/vendor/luajit/src/lj_debug.h b/subprojects/luajit/src/lj_debug.h similarity index 100% rename from vendor/luajit/src/lj_debug.h rename to subprojects/luajit/src/lj_debug.h diff --git a/vendor/luajit/src/lj_def.h b/subprojects/luajit/src/lj_def.h similarity index 100% rename from vendor/luajit/src/lj_def.h rename to subprojects/luajit/src/lj_def.h diff --git a/vendor/luajit/src/lj_dispatch.c b/subprojects/luajit/src/lj_dispatch.c similarity index 100% rename from vendor/luajit/src/lj_dispatch.c rename to subprojects/luajit/src/lj_dispatch.c diff --git a/vendor/luajit/src/lj_dispatch.h b/subprojects/luajit/src/lj_dispatch.h similarity index 100% rename from vendor/luajit/src/lj_dispatch.h rename to subprojects/luajit/src/lj_dispatch.h diff --git a/vendor/luajit/src/lj_emit_arm.h b/subprojects/luajit/src/lj_emit_arm.h similarity index 100% rename from vendor/luajit/src/lj_emit_arm.h rename to subprojects/luajit/src/lj_emit_arm.h diff --git a/vendor/luajit/src/lj_emit_mips.h b/subprojects/luajit/src/lj_emit_mips.h similarity index 100% rename from vendor/luajit/src/lj_emit_mips.h rename to subprojects/luajit/src/lj_emit_mips.h diff --git a/vendor/luajit/src/lj_emit_ppc.h b/subprojects/luajit/src/lj_emit_ppc.h similarity index 100% rename from vendor/luajit/src/lj_emit_ppc.h rename to subprojects/luajit/src/lj_emit_ppc.h diff --git a/vendor/luajit/src/lj_emit_x86.h b/subprojects/luajit/src/lj_emit_x86.h similarity index 100% rename from vendor/luajit/src/lj_emit_x86.h rename to subprojects/luajit/src/lj_emit_x86.h diff --git a/vendor/luajit/src/lj_err.c b/subprojects/luajit/src/lj_err.c similarity index 100% rename from vendor/luajit/src/lj_err.c rename to subprojects/luajit/src/lj_err.c diff --git a/vendor/luajit/src/lj_err.h b/subprojects/luajit/src/lj_err.h similarity index 100% rename from vendor/luajit/src/lj_err.h rename to subprojects/luajit/src/lj_err.h diff --git a/vendor/luajit/src/lj_errmsg.h b/subprojects/luajit/src/lj_errmsg.h similarity index 100% rename from vendor/luajit/src/lj_errmsg.h rename to subprojects/luajit/src/lj_errmsg.h diff --git a/vendor/luajit/src/lj_ff.h b/subprojects/luajit/src/lj_ff.h similarity index 100% rename from vendor/luajit/src/lj_ff.h rename to subprojects/luajit/src/lj_ff.h diff --git a/vendor/luajit/src/lj_ffrecord.c b/subprojects/luajit/src/lj_ffrecord.c similarity index 100% rename from vendor/luajit/src/lj_ffrecord.c rename to subprojects/luajit/src/lj_ffrecord.c diff --git a/vendor/luajit/src/lj_ffrecord.h b/subprojects/luajit/src/lj_ffrecord.h similarity index 100% rename from vendor/luajit/src/lj_ffrecord.h rename to subprojects/luajit/src/lj_ffrecord.h diff --git a/vendor/luajit/src/lj_frame.h b/subprojects/luajit/src/lj_frame.h similarity index 100% rename from vendor/luajit/src/lj_frame.h rename to subprojects/luajit/src/lj_frame.h diff --git a/vendor/luajit/src/lj_func.c b/subprojects/luajit/src/lj_func.c similarity index 100% rename from vendor/luajit/src/lj_func.c rename to subprojects/luajit/src/lj_func.c diff --git a/vendor/luajit/src/lj_func.h b/subprojects/luajit/src/lj_func.h similarity index 100% rename from vendor/luajit/src/lj_func.h rename to subprojects/luajit/src/lj_func.h diff --git a/vendor/luajit/src/lj_gc.c b/subprojects/luajit/src/lj_gc.c similarity index 100% rename from vendor/luajit/src/lj_gc.c rename to subprojects/luajit/src/lj_gc.c diff --git a/vendor/luajit/src/lj_gc.h b/subprojects/luajit/src/lj_gc.h similarity index 100% rename from vendor/luajit/src/lj_gc.h rename to subprojects/luajit/src/lj_gc.h diff --git a/vendor/luajit/src/lj_gdbjit.c b/subprojects/luajit/src/lj_gdbjit.c similarity index 100% rename from vendor/luajit/src/lj_gdbjit.c rename to subprojects/luajit/src/lj_gdbjit.c diff --git a/vendor/luajit/src/lj_gdbjit.h b/subprojects/luajit/src/lj_gdbjit.h similarity index 100% rename from vendor/luajit/src/lj_gdbjit.h rename to subprojects/luajit/src/lj_gdbjit.h diff --git a/vendor/luajit/src/lj_ir.c b/subprojects/luajit/src/lj_ir.c similarity index 100% rename from vendor/luajit/src/lj_ir.c rename to subprojects/luajit/src/lj_ir.c diff --git a/vendor/luajit/src/lj_ir.h b/subprojects/luajit/src/lj_ir.h similarity index 100% rename from vendor/luajit/src/lj_ir.h rename to subprojects/luajit/src/lj_ir.h diff --git a/vendor/luajit/src/lj_ircall.h b/subprojects/luajit/src/lj_ircall.h similarity index 100% rename from vendor/luajit/src/lj_ircall.h rename to subprojects/luajit/src/lj_ircall.h diff --git a/vendor/luajit/src/lj_iropt.h b/subprojects/luajit/src/lj_iropt.h similarity index 100% rename from vendor/luajit/src/lj_iropt.h rename to subprojects/luajit/src/lj_iropt.h diff --git a/vendor/luajit/src/lj_jit.h b/subprojects/luajit/src/lj_jit.h similarity index 100% rename from vendor/luajit/src/lj_jit.h rename to subprojects/luajit/src/lj_jit.h diff --git a/vendor/luajit/src/lj_lex.c b/subprojects/luajit/src/lj_lex.c similarity index 100% rename from vendor/luajit/src/lj_lex.c rename to subprojects/luajit/src/lj_lex.c diff --git a/vendor/luajit/src/lj_lex.h b/subprojects/luajit/src/lj_lex.h similarity index 100% rename from vendor/luajit/src/lj_lex.h rename to subprojects/luajit/src/lj_lex.h diff --git a/vendor/luajit/src/lj_lib.c b/subprojects/luajit/src/lj_lib.c similarity index 100% rename from vendor/luajit/src/lj_lib.c rename to subprojects/luajit/src/lj_lib.c diff --git a/vendor/luajit/src/lj_lib.h b/subprojects/luajit/src/lj_lib.h similarity index 100% rename from vendor/luajit/src/lj_lib.h rename to subprojects/luajit/src/lj_lib.h diff --git a/vendor/luajit/src/lj_load.c b/subprojects/luajit/src/lj_load.c similarity index 100% rename from vendor/luajit/src/lj_load.c rename to subprojects/luajit/src/lj_load.c diff --git a/vendor/luajit/src/lj_mcode.c b/subprojects/luajit/src/lj_mcode.c similarity index 100% rename from vendor/luajit/src/lj_mcode.c rename to subprojects/luajit/src/lj_mcode.c diff --git a/vendor/luajit/src/lj_mcode.h b/subprojects/luajit/src/lj_mcode.h similarity index 100% rename from vendor/luajit/src/lj_mcode.h rename to subprojects/luajit/src/lj_mcode.h diff --git a/vendor/luajit/src/lj_meta.c b/subprojects/luajit/src/lj_meta.c similarity index 100% rename from vendor/luajit/src/lj_meta.c rename to subprojects/luajit/src/lj_meta.c diff --git a/vendor/luajit/src/lj_meta.h b/subprojects/luajit/src/lj_meta.h similarity index 100% rename from vendor/luajit/src/lj_meta.h rename to subprojects/luajit/src/lj_meta.h diff --git a/vendor/luajit/src/lj_obj.c b/subprojects/luajit/src/lj_obj.c similarity index 100% rename from vendor/luajit/src/lj_obj.c rename to subprojects/luajit/src/lj_obj.c diff --git a/vendor/luajit/src/lj_obj.h b/subprojects/luajit/src/lj_obj.h similarity index 100% rename from vendor/luajit/src/lj_obj.h rename to subprojects/luajit/src/lj_obj.h diff --git a/vendor/luajit/src/lj_opt_dce.c b/subprojects/luajit/src/lj_opt_dce.c similarity index 100% rename from vendor/luajit/src/lj_opt_dce.c rename to subprojects/luajit/src/lj_opt_dce.c diff --git a/vendor/luajit/src/lj_opt_fold.c b/subprojects/luajit/src/lj_opt_fold.c similarity index 100% rename from vendor/luajit/src/lj_opt_fold.c rename to subprojects/luajit/src/lj_opt_fold.c diff --git a/vendor/luajit/src/lj_opt_loop.c b/subprojects/luajit/src/lj_opt_loop.c similarity index 100% rename from vendor/luajit/src/lj_opt_loop.c rename to subprojects/luajit/src/lj_opt_loop.c diff --git a/vendor/luajit/src/lj_opt_mem.c b/subprojects/luajit/src/lj_opt_mem.c similarity index 100% rename from vendor/luajit/src/lj_opt_mem.c rename to subprojects/luajit/src/lj_opt_mem.c diff --git a/vendor/luajit/src/lj_opt_narrow.c b/subprojects/luajit/src/lj_opt_narrow.c similarity index 100% rename from vendor/luajit/src/lj_opt_narrow.c rename to subprojects/luajit/src/lj_opt_narrow.c diff --git a/vendor/luajit/src/lj_opt_sink.c b/subprojects/luajit/src/lj_opt_sink.c similarity index 100% rename from vendor/luajit/src/lj_opt_sink.c rename to subprojects/luajit/src/lj_opt_sink.c diff --git a/vendor/luajit/src/lj_opt_split.c b/subprojects/luajit/src/lj_opt_split.c similarity index 100% rename from vendor/luajit/src/lj_opt_split.c rename to subprojects/luajit/src/lj_opt_split.c diff --git a/vendor/luajit/src/lj_parse.c b/subprojects/luajit/src/lj_parse.c similarity index 100% rename from vendor/luajit/src/lj_parse.c rename to subprojects/luajit/src/lj_parse.c diff --git a/vendor/luajit/src/lj_parse.h b/subprojects/luajit/src/lj_parse.h similarity index 100% rename from vendor/luajit/src/lj_parse.h rename to subprojects/luajit/src/lj_parse.h diff --git a/vendor/luajit/src/lj_record.c b/subprojects/luajit/src/lj_record.c similarity index 100% rename from vendor/luajit/src/lj_record.c rename to subprojects/luajit/src/lj_record.c diff --git a/vendor/luajit/src/lj_record.h b/subprojects/luajit/src/lj_record.h similarity index 100% rename from vendor/luajit/src/lj_record.h rename to subprojects/luajit/src/lj_record.h diff --git a/vendor/luajit/src/lj_snap.c b/subprojects/luajit/src/lj_snap.c similarity index 100% rename from vendor/luajit/src/lj_snap.c rename to subprojects/luajit/src/lj_snap.c diff --git a/vendor/luajit/src/lj_snap.h b/subprojects/luajit/src/lj_snap.h similarity index 100% rename from vendor/luajit/src/lj_snap.h rename to subprojects/luajit/src/lj_snap.h diff --git a/vendor/luajit/src/lj_state.c b/subprojects/luajit/src/lj_state.c similarity index 100% rename from vendor/luajit/src/lj_state.c rename to subprojects/luajit/src/lj_state.c diff --git a/vendor/luajit/src/lj_state.h b/subprojects/luajit/src/lj_state.h similarity index 100% rename from vendor/luajit/src/lj_state.h rename to subprojects/luajit/src/lj_state.h diff --git a/vendor/luajit/src/lj_str.c b/subprojects/luajit/src/lj_str.c similarity index 100% rename from vendor/luajit/src/lj_str.c rename to subprojects/luajit/src/lj_str.c diff --git a/vendor/luajit/src/lj_str.h b/subprojects/luajit/src/lj_str.h similarity index 100% rename from vendor/luajit/src/lj_str.h rename to subprojects/luajit/src/lj_str.h diff --git a/vendor/luajit/src/lj_strscan.c b/subprojects/luajit/src/lj_strscan.c similarity index 100% rename from vendor/luajit/src/lj_strscan.c rename to subprojects/luajit/src/lj_strscan.c diff --git a/vendor/luajit/src/lj_strscan.h b/subprojects/luajit/src/lj_strscan.h similarity index 100% rename from vendor/luajit/src/lj_strscan.h rename to subprojects/luajit/src/lj_strscan.h diff --git a/vendor/luajit/src/lj_tab.c b/subprojects/luajit/src/lj_tab.c similarity index 100% rename from vendor/luajit/src/lj_tab.c rename to subprojects/luajit/src/lj_tab.c diff --git a/vendor/luajit/src/lj_tab.h b/subprojects/luajit/src/lj_tab.h similarity index 100% rename from vendor/luajit/src/lj_tab.h rename to subprojects/luajit/src/lj_tab.h diff --git a/vendor/luajit/src/lj_target.h b/subprojects/luajit/src/lj_target.h similarity index 100% rename from vendor/luajit/src/lj_target.h rename to subprojects/luajit/src/lj_target.h diff --git a/vendor/luajit/src/lj_target_arm.h b/subprojects/luajit/src/lj_target_arm.h similarity index 100% rename from vendor/luajit/src/lj_target_arm.h rename to subprojects/luajit/src/lj_target_arm.h diff --git a/vendor/luajit/src/lj_target_mips.h b/subprojects/luajit/src/lj_target_mips.h similarity index 100% rename from vendor/luajit/src/lj_target_mips.h rename to subprojects/luajit/src/lj_target_mips.h diff --git a/vendor/luajit/src/lj_target_ppc.h b/subprojects/luajit/src/lj_target_ppc.h similarity index 100% rename from vendor/luajit/src/lj_target_ppc.h rename to subprojects/luajit/src/lj_target_ppc.h diff --git a/vendor/luajit/src/lj_target_x86.h b/subprojects/luajit/src/lj_target_x86.h similarity index 100% rename from vendor/luajit/src/lj_target_x86.h rename to subprojects/luajit/src/lj_target_x86.h diff --git a/vendor/luajit/src/lj_trace.c b/subprojects/luajit/src/lj_trace.c similarity index 100% rename from vendor/luajit/src/lj_trace.c rename to subprojects/luajit/src/lj_trace.c diff --git a/vendor/luajit/src/lj_trace.h b/subprojects/luajit/src/lj_trace.h similarity index 100% rename from vendor/luajit/src/lj_trace.h rename to subprojects/luajit/src/lj_trace.h diff --git a/vendor/luajit/src/lj_traceerr.h b/subprojects/luajit/src/lj_traceerr.h similarity index 100% rename from vendor/luajit/src/lj_traceerr.h rename to subprojects/luajit/src/lj_traceerr.h diff --git a/vendor/luajit/src/lj_udata.c b/subprojects/luajit/src/lj_udata.c similarity index 100% rename from vendor/luajit/src/lj_udata.c rename to subprojects/luajit/src/lj_udata.c diff --git a/vendor/luajit/src/lj_udata.h b/subprojects/luajit/src/lj_udata.h similarity index 100% rename from vendor/luajit/src/lj_udata.h rename to subprojects/luajit/src/lj_udata.h diff --git a/vendor/luajit/src/lj_vm.h b/subprojects/luajit/src/lj_vm.h similarity index 100% rename from vendor/luajit/src/lj_vm.h rename to subprojects/luajit/src/lj_vm.h diff --git a/vendor/luajit/src/lj_vmevent.c b/subprojects/luajit/src/lj_vmevent.c similarity index 100% rename from vendor/luajit/src/lj_vmevent.c rename to subprojects/luajit/src/lj_vmevent.c diff --git a/vendor/luajit/src/lj_vmevent.h b/subprojects/luajit/src/lj_vmevent.h similarity index 100% rename from vendor/luajit/src/lj_vmevent.h rename to subprojects/luajit/src/lj_vmevent.h diff --git a/vendor/luajit/src/lj_vmmath.c b/subprojects/luajit/src/lj_vmmath.c similarity index 100% rename from vendor/luajit/src/lj_vmmath.c rename to subprojects/luajit/src/lj_vmmath.c diff --git a/vendor/luajit/src/ljamalg.c b/subprojects/luajit/src/ljamalg.c similarity index 100% rename from vendor/luajit/src/ljamalg.c rename to subprojects/luajit/src/ljamalg.c diff --git a/vendor/luajit/src/lua.h b/subprojects/luajit/src/lua.h similarity index 100% rename from vendor/luajit/src/lua.h rename to subprojects/luajit/src/lua.h diff --git a/vendor/luajit/src/lua.hpp b/subprojects/luajit/src/lua.hpp similarity index 100% rename from vendor/luajit/src/lua.hpp rename to subprojects/luajit/src/lua.hpp diff --git a/vendor/luajit/src/luaconf.h b/subprojects/luajit/src/luaconf.h similarity index 100% rename from vendor/luajit/src/luaconf.h rename to subprojects/luajit/src/luaconf.h diff --git a/vendor/luajit/src/luajit.c b/subprojects/luajit/src/luajit.c similarity index 100% rename from vendor/luajit/src/luajit.c rename to subprojects/luajit/src/luajit.c diff --git a/vendor/luajit/src/luajit.h b/subprojects/luajit/src/luajit.h similarity index 100% rename from vendor/luajit/src/luajit.h rename to subprojects/luajit/src/luajit.h diff --git a/vendor/luajit/src/lualib.h b/subprojects/luajit/src/lualib.h similarity index 100% rename from vendor/luajit/src/lualib.h rename to subprojects/luajit/src/lualib.h diff --git a/vendor/luajit/src/meson.build b/subprojects/luajit/src/meson.build similarity index 100% rename from vendor/luajit/src/meson.build rename to subprojects/luajit/src/meson.build diff --git a/vendor/luajit/src/vm_arm.dasc b/subprojects/luajit/src/vm_arm.dasc similarity index 100% rename from vendor/luajit/src/vm_arm.dasc rename to subprojects/luajit/src/vm_arm.dasc diff --git a/vendor/luajit/src/vm_mips.dasc b/subprojects/luajit/src/vm_mips.dasc similarity index 100% rename from vendor/luajit/src/vm_mips.dasc rename to subprojects/luajit/src/vm_mips.dasc diff --git a/vendor/luajit/src/vm_ppc.dasc b/subprojects/luajit/src/vm_ppc.dasc similarity index 100% rename from vendor/luajit/src/vm_ppc.dasc rename to subprojects/luajit/src/vm_ppc.dasc diff --git a/vendor/luajit/src/vm_ppcspe.dasc b/subprojects/luajit/src/vm_ppcspe.dasc similarity index 100% rename from vendor/luajit/src/vm_ppcspe.dasc rename to subprojects/luajit/src/vm_ppcspe.dasc diff --git a/vendor/luajit/src/vm_x86.dasc b/subprojects/luajit/src/vm_x86.dasc similarity index 100% rename from vendor/luajit/src/vm_x86.dasc rename to subprojects/luajit/src/vm_x86.dasc diff --git a/vendor/luajit/unicode-io.patch b/subprojects/luajit/unicode-io.patch similarity index 100% rename from vendor/luajit/unicode-io.patch rename to subprojects/luajit/unicode-io.patch diff --git a/vendor/luajit/unicode-os.patch b/subprojects/luajit/unicode-os.patch similarity index 100% rename from vendor/luajit/unicode-os.patch rename to subprojects/luajit/unicode-os.patch diff --git a/vendor/luajit/src/Makefile.dep b/vendor/luajit/src/Makefile.dep deleted file mode 100644 index 9e14d6173..000000000 --- a/vendor/luajit/src/Makefile.dep +++ /dev/null @@ -1,226 +0,0 @@ -lib_aux.o: lib_aux.c lua.h luaconf.h lauxlib.h lj_obj.h lj_def.h \ - lj_arch.h lj_err.h lj_errmsg.h lj_state.h lj_trace.h lj_jit.h lj_ir.h \ - lj_dispatch.h lj_bc.h lj_traceerr.h lj_lib.h lj_alloc.h -lib_base.o: lib_base.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \ - lj_def.h lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_debug.h lj_str.h \ - lj_tab.h lj_meta.h lj_state.h lj_ctype.h lj_cconv.h lj_bc.h lj_ff.h \ - lj_ffdef.h lj_dispatch.h lj_jit.h lj_ir.h lj_char.h lj_strscan.h \ - lj_lib.h lj_libdef.h -lib_bit.o: lib_bit.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h lj_def.h \ - lj_arch.h lj_err.h lj_errmsg.h lj_str.h lj_lib.h lj_libdef.h -lib_debug.o: lib_debug.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \ - lj_def.h lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_debug.h lj_lib.h \ - lj_libdef.h -lib_ffi.o: lib_ffi.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h lj_def.h \ - lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_meta.h \ - lj_ctype.h lj_cparse.h lj_cdata.h lj_cconv.h lj_carith.h lj_ccall.h \ - lj_ccallback.h lj_clib.h lj_ff.h lj_ffdef.h lj_lib.h lj_libdef.h -lib_init.o: lib_init.c lua.h luaconf.h lauxlib.h lualib.h lj_arch.h -lib_io.o: lib_io.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h lj_def.h \ - lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_state.h lj_ff.h \ - lj_ffdef.h lj_lib.h lj_libdef.h -lib_jit.o: lib_jit.c lua.h luaconf.h lauxlib.h lualib.h lj_arch.h \ - lj_obj.h lj_def.h lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_tab.h \ - lj_bc.h lj_ir.h lj_jit.h lj_ircall.h lj_iropt.h lj_target.h \ - lj_target_*.h lj_dispatch.h lj_vm.h lj_vmevent.h lj_lib.h luajit.h \ - lj_libdef.h -lib_math.o: lib_math.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \ - lj_def.h lj_arch.h lj_lib.h lj_vm.h lj_libdef.h -lib_os.o: lib_os.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h lj_def.h \ - lj_arch.h lj_err.h lj_errmsg.h lj_lib.h lj_libdef.h -lib_package.o: lib_package.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \ - lj_def.h lj_arch.h lj_err.h lj_errmsg.h lj_lib.h -lib_string.o: lib_string.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \ - lj_def.h lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h \ - lj_meta.h lj_state.h lj_ff.h lj_ffdef.h lj_bcdump.h lj_lex.h lj_char.h \ - lj_lib.h lj_libdef.h -lib_table.o: lib_table.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \ - lj_def.h lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_tab.h lj_lib.h \ - lj_libdef.h -lj_alloc.o: lj_alloc.c lj_def.h lua.h luaconf.h lj_arch.h lj_alloc.h -lj_api.o: lj_api.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ - lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_tab.h lj_func.h lj_udata.h \ - lj_meta.h lj_state.h lj_bc.h lj_frame.h lj_trace.h lj_jit.h lj_ir.h \ - lj_dispatch.h lj_traceerr.h lj_vm.h lj_strscan.h -lj_asm.o: lj_asm.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ - lj_str.h lj_tab.h lj_frame.h lj_bc.h lj_ctype.h lj_ir.h lj_jit.h \ - lj_ircall.h lj_iropt.h lj_mcode.h lj_trace.h lj_dispatch.h lj_traceerr.h \ - lj_snap.h lj_asm.h lj_vm.h lj_target.h lj_target_*.h lj_emit_*.h \ - lj_asm_*.h -lj_bc.o: lj_bc.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_bc.h \ - lj_bcdef.h -lj_bcread.o: lj_bcread.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_bc.h lj_ctype.h \ - lj_cdata.h lualib.h lj_lex.h lj_bcdump.h lj_state.h -lj_bcwrite.o: lj_bcwrite.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_str.h lj_bc.h lj_ctype.h lj_dispatch.h lj_jit.h lj_ir.h \ - lj_bcdump.h lj_lex.h lj_err.h lj_errmsg.h lj_vm.h -lj_carith.o: lj_carith.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_err.h lj_errmsg.h lj_tab.h lj_meta.h lj_ctype.h lj_cconv.h \ - lj_cdata.h lj_carith.h -lj_ccall.o: lj_ccall.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_ctype.h lj_cconv.h \ - lj_cdata.h lj_ccall.h lj_trace.h lj_jit.h lj_ir.h lj_dispatch.h lj_bc.h \ - lj_traceerr.h -lj_ccallback.o: lj_ccallback.c lj_obj.h lua.h luaconf.h lj_def.h \ - lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_tab.h lj_state.h lj_frame.h \ - lj_bc.h lj_ctype.h lj_cconv.h lj_ccall.h lj_ccallback.h lj_target.h \ - lj_target_*.h lj_mcode.h lj_jit.h lj_ir.h lj_trace.h lj_dispatch.h \ - lj_traceerr.h lj_vm.h -lj_cconv.o: lj_cconv.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_err.h lj_errmsg.h lj_tab.h lj_ctype.h lj_gc.h lj_cdata.h lj_cconv.h \ - lj_ccallback.h -lj_cdata.o: lj_cdata.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_ctype.h lj_cconv.h \ - lj_cdata.h -lj_char.o: lj_char.c lj_char.h lj_def.h lua.h luaconf.h -lj_clib.o: lj_clib.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ - lj_err.h lj_errmsg.h lj_tab.h lj_str.h lj_udata.h lj_ctype.h lj_cconv.h \ - lj_cdata.h lj_clib.h -lj_cparse.o: lj_cparse.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_ctype.h lj_cparse.h lj_frame.h \ - lj_bc.h lj_vm.h lj_char.h lj_strscan.h -lj_crecord.o: lj_crecord.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_frame.h lj_bc.h lj_ctype.h \ - lj_gc.h lj_cdata.h lj_cparse.h lj_cconv.h lj_clib.h lj_ccall.h lj_ff.h \ - lj_ffdef.h lj_ir.h lj_jit.h lj_ircall.h lj_iropt.h lj_trace.h \ - lj_dispatch.h lj_traceerr.h lj_record.h lj_ffrecord.h lj_snap.h \ - lj_crecord.h -lj_ctype.o: lj_ctype.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_ctype.h lj_ccallback.h -lj_debug.o: lj_debug.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_tab.h lj_state.h lj_frame.h \ - lj_bc.h lj_vm.h lj_jit.h lj_ir.h -lj_dispatch.o: lj_dispatch.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_err.h lj_errmsg.h lj_func.h lj_str.h lj_tab.h lj_meta.h lj_debug.h \ - lj_state.h lj_frame.h lj_bc.h lj_ff.h lj_ffdef.h lj_jit.h lj_ir.h \ - lj_ccallback.h lj_ctype.h lj_gc.h lj_trace.h lj_dispatch.h lj_traceerr.h \ - lj_vm.h luajit.h -lj_err.o: lj_err.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_err.h \ - lj_errmsg.h lj_debug.h lj_str.h lj_func.h lj_state.h lj_frame.h lj_bc.h \ - lj_ff.h lj_ffdef.h lj_trace.h lj_jit.h lj_ir.h lj_dispatch.h \ - lj_traceerr.h lj_vm.h -lj_ffrecord.o: lj_ffrecord.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_frame.h lj_bc.h lj_ff.h \ - lj_ffdef.h lj_ir.h lj_jit.h lj_ircall.h lj_iropt.h lj_trace.h \ - lj_dispatch.h lj_traceerr.h lj_record.h lj_ffrecord.h lj_crecord.h \ - lj_vm.h lj_strscan.h lj_recdef.h -lj_func.o: lj_func.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ - lj_func.h lj_trace.h lj_jit.h lj_ir.h lj_dispatch.h lj_bc.h \ - lj_traceerr.h lj_vm.h -lj_gc.o: lj_gc.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ - lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_func.h lj_udata.h lj_meta.h \ - lj_state.h lj_frame.h lj_bc.h lj_ctype.h lj_cdata.h lj_trace.h lj_jit.h \ - lj_ir.h lj_dispatch.h lj_traceerr.h lj_vm.h -lj_gdbjit.o: lj_gdbjit.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_err.h lj_errmsg.h lj_debug.h lj_frame.h lj_bc.h lj_jit.h \ - lj_ir.h lj_dispatch.h -lj_ir.o: lj_ir.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ - lj_str.h lj_tab.h lj_ir.h lj_jit.h lj_ircall.h lj_iropt.h lj_trace.h \ - lj_dispatch.h lj_bc.h lj_traceerr.h lj_ctype.h lj_cdata.h lj_carith.h \ - lj_vm.h lj_strscan.h lj_lib.h -lj_lex.o: lj_lex.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ - lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_ctype.h lj_cdata.h lualib.h \ - lj_state.h lj_lex.h lj_parse.h lj_char.h lj_strscan.h -lj_lib.o: lj_lib.c lauxlib.h lua.h luaconf.h lj_obj.h lj_def.h lj_arch.h \ - lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_func.h lj_bc.h \ - lj_dispatch.h lj_jit.h lj_ir.h lj_vm.h lj_strscan.h lj_lib.h -lj_load.o: lj_load.c lua.h luaconf.h lauxlib.h lj_obj.h lj_def.h \ - lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_func.h lj_frame.h \ - lj_bc.h lj_vm.h lj_lex.h lj_bcdump.h lj_parse.h -lj_mcode.o: lj_mcode.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_err.h lj_errmsg.h lj_jit.h lj_ir.h lj_mcode.h lj_trace.h \ - lj_dispatch.h lj_bc.h lj_traceerr.h lj_vm.h -lj_meta.o: lj_meta.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ - lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_meta.h lj_frame.h lj_bc.h \ - lj_vm.h lj_strscan.h -lj_obj.o: lj_obj.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h -lj_opt_dce.o: lj_opt_dce.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_ir.h lj_jit.h lj_iropt.h -lj_opt_fold.o: lj_opt_fold.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_str.h lj_tab.h lj_ir.h lj_jit.h lj_iropt.h lj_trace.h lj_dispatch.h \ - lj_bc.h lj_traceerr.h lj_ctype.h lj_gc.h lj_carith.h lj_vm.h \ - lj_strscan.h lj_folddef.h -lj_opt_loop.o: lj_opt_loop.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_err.h lj_errmsg.h lj_str.h lj_ir.h lj_jit.h lj_iropt.h lj_trace.h \ - lj_dispatch.h lj_bc.h lj_traceerr.h lj_snap.h lj_vm.h -lj_opt_mem.o: lj_opt_mem.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_tab.h lj_ir.h lj_jit.h lj_iropt.h -lj_opt_narrow.o: lj_opt_narrow.c lj_obj.h lua.h luaconf.h lj_def.h \ - lj_arch.h lj_bc.h lj_ir.h lj_jit.h lj_iropt.h lj_trace.h lj_dispatch.h \ - lj_traceerr.h lj_vm.h lj_strscan.h -lj_opt_sink.o: lj_opt_sink.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_ir.h lj_jit.h lj_iropt.h lj_target.h lj_target_*.h -lj_opt_split.o: lj_opt_split.c lj_obj.h lua.h luaconf.h lj_def.h \ - lj_arch.h lj_err.h lj_errmsg.h lj_str.h lj_ir.h lj_jit.h lj_ircall.h \ - lj_iropt.h lj_vm.h -lj_parse.o: lj_parse.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_tab.h lj_func.h \ - lj_state.h lj_bc.h lj_ctype.h lj_lex.h lj_parse.h lj_vm.h lj_vmevent.h -lj_record.o: lj_record.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_meta.h lj_frame.h lj_bc.h \ - lj_ctype.h lj_gc.h lj_ff.h lj_ffdef.h lj_ir.h lj_jit.h lj_ircall.h \ - lj_iropt.h lj_trace.h lj_dispatch.h lj_traceerr.h lj_record.h \ - lj_ffrecord.h lj_snap.h lj_vm.h -lj_snap.o: lj_snap.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ - lj_tab.h lj_state.h lj_frame.h lj_bc.h lj_ir.h lj_jit.h lj_iropt.h \ - lj_trace.h lj_dispatch.h lj_traceerr.h lj_snap.h lj_target.h \ - lj_target_*.h lj_ctype.h lj_cdata.h -lj_state.o: lj_state.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_func.h lj_meta.h \ - lj_state.h lj_frame.h lj_bc.h lj_ctype.h lj_trace.h lj_jit.h lj_ir.h \ - lj_dispatch.h lj_traceerr.h lj_vm.h lj_lex.h lj_alloc.h -lj_str.o: lj_str.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ - lj_err.h lj_errmsg.h lj_str.h lj_state.h lj_char.h -lj_strscan.o: lj_strscan.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_char.h lj_strscan.h -lj_tab.o: lj_tab.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \ - lj_err.h lj_errmsg.h lj_tab.h -lj_trace.o: lj_trace.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_frame.h lj_bc.h \ - lj_state.h lj_ir.h lj_jit.h lj_iropt.h lj_mcode.h lj_trace.h \ - lj_dispatch.h lj_traceerr.h lj_snap.h lj_gdbjit.h lj_record.h lj_asm.h \ - lj_vm.h lj_vmevent.h lj_target.h lj_target_*.h -lj_udata.o: lj_udata.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_gc.h lj_udata.h -lj_vmevent.o: lj_vmevent.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_str.h lj_tab.h lj_state.h lj_dispatch.h lj_bc.h lj_jit.h lj_ir.h \ - lj_vm.h lj_vmevent.h -lj_vmmath.o: lj_vmmath.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ - lj_ir.h lj_vm.h -ljamalg.o: ljamalg.c lua.h luaconf.h lauxlib.h lj_gc.c lj_obj.h lj_def.h \ - lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_func.h \ - lj_udata.h lj_meta.h lj_state.h lj_frame.h lj_bc.h lj_ctype.h lj_cdata.h \ - lj_trace.h lj_jit.h lj_ir.h lj_dispatch.h lj_traceerr.h lj_vm.h lj_err.c \ - lj_debug.h lj_ff.h lj_ffdef.h lj_char.c lj_char.h lj_bc.c lj_bcdef.h \ - lj_obj.c lj_str.c lj_tab.c lj_func.c lj_udata.c lj_meta.c lj_strscan.h \ - lj_debug.c lj_state.c lj_lex.h lj_alloc.h lj_dispatch.c lj_ccallback.h \ - luajit.h lj_vmevent.c lj_vmevent.h lj_vmmath.c lj_strscan.c lj_api.c \ - lj_lex.c lualib.h lj_parse.h lj_parse.c lj_bcread.c lj_bcdump.h \ - lj_bcwrite.c lj_load.c lj_ctype.c lj_cdata.c lj_cconv.h lj_cconv.c \ - lj_ccall.c lj_ccall.h lj_ccallback.c lj_target.h lj_target_*.h \ - lj_mcode.h lj_carith.c lj_carith.h lj_clib.c lj_clib.h lj_cparse.c \ - lj_cparse.h lj_lib.c lj_lib.h lj_ir.c lj_ircall.h lj_iropt.h \ - lj_opt_mem.c lj_opt_fold.c lj_folddef.h lj_opt_narrow.c lj_opt_dce.c \ - lj_opt_loop.c lj_snap.h lj_opt_split.c lj_opt_sink.c lj_mcode.c \ - lj_snap.c lj_record.c lj_record.h lj_ffrecord.h lj_crecord.c \ - lj_crecord.h lj_ffrecord.c lj_recdef.h lj_asm.c lj_asm.h lj_emit_*.h \ - lj_asm_*.h lj_trace.c lj_gdbjit.h lj_gdbjit.c lj_alloc.c lib_aux.c \ - lib_base.c lj_libdef.h lib_math.c lib_string.c lib_table.c lib_io.c \ - lib_os.c lib_package.c lib_debug.c lib_bit.c lib_jit.c lib_ffi.c \ - lib_init.c -luajit.o: luajit.c lua.h luaconf.h lauxlib.h lualib.h luajit.h lj_arch.h -host/buildvm.o: host/buildvm.c host/buildvm.h lj_def.h lua.h luaconf.h \ - lj_arch.h lj_obj.h lj_def.h lj_arch.h lj_gc.h lj_obj.h lj_bc.h lj_ir.h \ - lj_ircall.h lj_ir.h lj_jit.h lj_frame.h lj_bc.h lj_dispatch.h lj_ctype.h \ - lj_gc.h lj_ccall.h lj_ctype.h luajit.h \ - host/buildvm_arch.h lj_traceerr.h -host/buildvm_asm.o: host/buildvm_asm.c host/buildvm.h lj_def.h lua.h luaconf.h \ - lj_arch.h lj_bc.h lj_def.h lj_arch.h -host/buildvm_fold.o: host/buildvm_fold.c host/buildvm.h lj_def.h lua.h \ - luaconf.h lj_arch.h lj_obj.h lj_def.h lj_arch.h lj_ir.h lj_obj.h -host/buildvm_lib.o: host/buildvm_lib.c host/buildvm.h lj_def.h lua.h luaconf.h \ - lj_arch.h lj_obj.h lj_def.h lj_arch.h lj_lib.h lj_obj.h -host/buildvm_peobj.o: host/buildvm_peobj.c host/buildvm.h lj_def.h lua.h \ - luaconf.h lj_arch.h lj_bc.h lj_def.h lj_arch.h -host/minilua.o: host/minilua.c From 0be226aa6cc462a73bd2e22b362245656eeb0704 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 11 Feb 2019 19:57:55 -0500 Subject: [PATCH 092/271] meson: add wrapfiles for essential subprojects --- .gitignore | 9 +++++++++ subprojects/expat.wrap | 10 ++++++++++ subprojects/freetype2.wrap | 10 ++++++++++ subprojects/fribidi.wrap | 4 ++++ subprojects/gtest.wrap | 10 ++++++++++ subprojects/harfbuzz.wrap | 5 +++++ subprojects/libass.wrap | 4 ++++ subprojects/libpng.wrap | 10 ++++++++++ subprojects/zlib.wrap | 10 ++++++++++ 9 files changed, 72 insertions(+) create mode 100644 subprojects/expat.wrap create mode 100644 subprojects/freetype2.wrap create mode 100644 subprojects/fribidi.wrap create mode 100644 subprojects/gtest.wrap create mode 100644 subprojects/harfbuzz.wrap create mode 100644 subprojects/libass.wrap create mode 100644 subprojects/libpng.wrap create mode 100644 subprojects/zlib.wrap diff --git a/.gitignore b/.gitignore index d800491d4..4a19137ba 100644 --- a/.gitignore +++ b/.gitignore @@ -95,3 +95,12 @@ vendor/luajit/src/luajit .nuget .vs + +# Meson +subprojects/freetype* +subprojects/fribidi +subprojects/harfbuzz +subprojects/libass +subprojects/libpng* +subprojects/packagecache +subprojects/zlib* diff --git a/subprojects/expat.wrap b/subprojects/expat.wrap new file mode 100644 index 000000000..0a605d019 --- /dev/null +++ b/subprojects/expat.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = expat-2.2.6 + +source_url = https://github.com/libexpat/libexpat/releases/download/R_2_2_6/expat-2.2.6.tar.bz2 +source_filename = expat-2.2.6.tar.bz2 +source_hash = 17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/expat/2.2.6/1/get_zip +patch_filename = expat-2.2.6-1-wrap.zip +patch_hash = b8312fae757c7bff6f0cb430108104441a3da7a0a333809f5c80b354157eaa4d diff --git a/subprojects/freetype2.wrap b/subprojects/freetype2.wrap new file mode 100644 index 000000000..613f7d627 --- /dev/null +++ b/subprojects/freetype2.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = freetype-2.9.1 + +source_url = https://download.savannah.gnu.org/releases/freetype/freetype-2.9.1.tar.gz +source_filename = freetype-2.9.1.tar.gz +source_hash = ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/freetype2/2.9.1/1/get_zip +patch_filename = freetype2-2.9.1-1-wrap.zip +patch_hash = 06222607775e707c6d7b8d21ffdb04c7672f676a18c5ebb9880545130ab0407b diff --git a/subprojects/fribidi.wrap b/subprojects/fribidi.wrap new file mode 100644 index 000000000..e3f62a688 --- /dev/null +++ b/subprojects/fribidi.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory = fribidi +url = https://github.com/fribidi/fribidi.git +revision = master diff --git a/subprojects/gtest.wrap b/subprojects/gtest.wrap new file mode 100644 index 000000000..773a713c9 --- /dev/null +++ b/subprojects/gtest.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = googletest-release-1.8.0 + +source_url = https://github.com/google/googletest/archive/release-1.8.0.zip +source_filename = gtest-1.8.0.zip +source_hash = f3ed3b58511efd272eb074a3a6d6fb79d7c2e6a0e374323d1e6bcbcc1ef141bf + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/gtest/1.8.0/5/get_zip +patch_filename = gtest-1.8.0-5-wrap.zip +patch_hash = 7eeaede4aa2610a403313b74e04baf91ccfbaef03203d8f56312e22df1834ec5 diff --git a/subprojects/harfbuzz.wrap b/subprojects/harfbuzz.wrap new file mode 100644 index 000000000..20cafdae6 --- /dev/null +++ b/subprojects/harfbuzz.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory = harfbuzz +# Change this URL once upstreamed! +url = https://github.com/tp-m/harfbuzz.git +revision = meson-rebased diff --git a/subprojects/libass.wrap b/subprojects/libass.wrap new file mode 100644 index 000000000..2e0629c10 --- /dev/null +++ b/subprojects/libass.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory = libass +url = https://github.com/TypesettingTools/libass.git +revision = meson diff --git a/subprojects/libpng.wrap b/subprojects/libpng.wrap new file mode 100644 index 000000000..30774eb72 --- /dev/null +++ b/subprojects/libpng.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = libpng-1.6.35 + +source_url = https://github.com/glennrp/libpng/archive/v1.6.35.tar.gz +source_filename = libpng-1.6.35.tar.gz +source_hash = 6d59d6a154ccbb772ec11772cb8f8beb0d382b61e7ccc62435bf7311c9f4b210 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/libpng/1.6.35/5/get_zip +patch_filename = libpng-1.6.35-5-wrap.zip +patch_hash = da42b18e8d75a88615bdbc1c7bbf1f739ae19f63a8e70d96c90bc448326ae6b7 diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap new file mode 100644 index 000000000..97de00ef7 --- /dev/null +++ b/subprojects/zlib.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = zlib-1.2.11 + +source_url = http://zlib.net/fossils/zlib-1.2.11.tar.gz +source_filename = zlib-1.2.11.tar.gz +source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/3/get_zip +patch_filename = zlib-1.2.11-3-wrap.zip +patch_hash = f07dc491ab3d05daf00632a0591e2ae61b470615b5b73bcf9b3f061fff65cff0 From 42bfc53a77c49bce49b1647fd1a76709e311b8b7 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 11 Feb 2019 22:43:29 -0500 Subject: [PATCH 093/271] meson: bump c++ version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c919ae867..ee49e2b2f 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', meson_version: '>=0.49.0', - default_options: ['cpp_std=c++11', 'b_lto=true']) + default_options: ['cpp_std=c++14', 'b_lto=true']) if host_machine.system() == 'windows' version_sh = find_program('tools/version.ps1') From 6ca1d6463a5585e3c5ac6f40c170551ec8c56e59 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Wed, 13 Feb 2019 12:18:08 -0500 Subject: [PATCH 094/271] Remove submodules --- .gitmodules | 42 ------------------------------------------ vendor/boost | 1 - vendor/ffmpeg | 1 - vendor/ffms2 | 1 - vendor/fftw | 1 - vendor/freetype2 | 1 - vendor/googletest | 1 - vendor/icu | 1 - vendor/libass | 1 - vendor/uchardet | 1 - vendor/wxWidgets | 1 - 11 files changed, 52 deletions(-) delete mode 100644 .gitmodules delete mode 160000 vendor/boost delete mode 160000 vendor/ffmpeg delete mode 160000 vendor/ffms2 delete mode 160000 vendor/fftw delete mode 160000 vendor/freetype2 delete mode 160000 vendor/googletest delete mode 160000 vendor/icu delete mode 160000 vendor/libass delete mode 160000 vendor/uchardet delete mode 160000 vendor/wxWidgets diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e34fcc897..000000000 --- a/.gitmodules +++ /dev/null @@ -1,42 +0,0 @@ -[submodule "freetype2"] - path = vendor/freetype2 - url = git://git.sv.nongnu.org/freetype/freetype2.git - ignore = dirty -[submodule "wxWidgets"] - path = vendor/wxWidgets - url = git://github.com/Aegisub/wxWidgets.git - ignore = dirty -[submodule "googletest"] - path = vendor/googletest - url = git://github.com/svn2github/googletest.git - ignore = dirty -[submodule "ffmpeg"] - path = vendor/ffmpeg - url = git://source.ffmpeg.org/ffmpeg.git - ignore = dirty -[submodule "ffms2"] - path = vendor/ffms2 - url = git://github.com/FFMS/ffms2.git - branch = master - ignore = dirty -[submodule "libass"] - path = vendor/libass - url = git://github.com/libass/libass.git - branch = master -[submodule "icu"] - path = vendor/icu - url = git://github.com/svn2github/icu4c.git - branch = master - ignore = dirty -[submodule "boost"] - path = vendor/boost - url = https://github.com/boostorg/boost.git - ignore = dirty -[submodule "fftw"] - path = vendor/fftw - url = https://github.com/Aegisub/fftw3.git - ignore = dirty -[submodule "uchardet"] - path = vendor/uchardet - url = https://gitlab.freedesktop.org/uchardet/uchardet.git - ignore = dirty diff --git a/vendor/boost b/vendor/boost deleted file mode 160000 index 9ccd3390c..000000000 --- a/vendor/boost +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9ccd3390c8e9ef05f4cb681d15b2e14eac48886e diff --git a/vendor/ffmpeg b/vendor/ffmpeg deleted file mode 160000 index d290bb0c5..000000000 --- a/vendor/ffmpeg +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d290bb0c540425e937d11ed88e22c68ab97c57eb diff --git a/vendor/ffms2 b/vendor/ffms2 deleted file mode 160000 index f3c6b008b..000000000 --- a/vendor/ffms2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f3c6b008b53719dcac032293e3a42a3164c8d7ec diff --git a/vendor/fftw b/vendor/fftw deleted file mode 160000 index d68ca6315..000000000 --- a/vendor/fftw +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d68ca6315cafa5b8ff9367d9375314f32b7dbd81 diff --git a/vendor/freetype2 b/vendor/freetype2 deleted file mode 160000 index 51fee6558..000000000 --- a/vendor/freetype2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 51fee655837ef99084767873266aaddfa3a31da5 diff --git a/vendor/googletest b/vendor/googletest deleted file mode 160000 index cc0116f14..000000000 --- a/vendor/googletest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cc0116f14aa8ad9ab76226d082a96b1005221816 diff --git a/vendor/icu b/vendor/icu deleted file mode 160000 index 061be17bd..000000000 --- a/vendor/icu +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 061be17bd589bb65d37b70c23513ab530cad7821 diff --git a/vendor/libass b/vendor/libass deleted file mode 160000 index 98727c3b7..000000000 --- a/vendor/libass +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 98727c3b78f44cb3bbc955fcf5d977ebd911d5ca diff --git a/vendor/uchardet b/vendor/uchardet deleted file mode 160000 index bdfd6116a..000000000 --- a/vendor/uchardet +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bdfd6116a965fd210ef563613763e724424728b7 diff --git a/vendor/wxWidgets b/vendor/wxWidgets deleted file mode 160000 index d08c66fcb..000000000 --- a/vendor/wxWidgets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d08c66fcb46dea7d61e4a3565cd09fb4c675a201 From 609f5be03223cd74529feee344b9ff93f00d8f65 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Wed, 13 Feb 2019 12:20:49 -0500 Subject: [PATCH 095/271] Move CSRI to subprojects --- {vendor => subprojects}/csri/Doxyfile | 0 {vendor => subprojects}/csri/LICENSE | 0 {vendor => subprojects}/csri/Makefile.am | 0 {vendor => subprojects}/csri/ac/Makefile.am | 0 {vendor => subprojects}/csri/acinclude.m4 | 0 {vendor => subprojects}/csri/backends/Makefile.am | 0 {vendor => subprojects}/csri/backends/libass/Makefile.am | 0 {vendor => subprojects}/csri/backends/libass/libass_csri.c | 0 {vendor => subprojects}/csri/bootstrap | 0 {vendor => subprojects}/csri/configure.ac | 0 {vendor => subprojects}/csri/csri.pc.in | 0 {vendor => subprojects}/csri/csri_2008.vcproj | 0 {vendor => subprojects}/csri/frontends/Makefile.am | 0 {vendor => subprojects}/csri/frontends/avisynth25/Makefile.am | 0 {vendor => subprojects}/csri/frontends/avisynth25/avisynth.cpp | 0 {vendor => subprojects}/csri/frontends/avisynth25/avisynth.h | 0 {vendor => subprojects}/csri/frontends/cmdline/Makefile.am | 0 {vendor => subprojects}/csri/frontends/cmdline/cmdmain.c | 0 {vendor => subprojects}/csri/frontends/cmdline/render.c | 0 {vendor => subprojects}/csri/frontends/cmdline/render.h | 0 {vendor => subprojects}/csri/include/Makefile.am | 0 {vendor => subprojects}/csri/include/csri/csri.h | 0 {vendor => subprojects}/csri/include/csri/fmtids.h | 0 {vendor => subprojects}/csri/include/csri/logging.h | 0 {vendor => subprojects}/csri/include/csri/openerr.h | 0 {vendor => subprojects}/csri/include/csri/stream.h | 0 {vendor => subprojects}/csri/include/subhelp.h | 0 {vendor => subprojects}/csri/include/visibility.h | 0 {vendor => subprojects}/csri/lib/Makefile.am | 0 {vendor => subprojects}/csri/lib/csrilib.h | 0 {vendor => subprojects}/csri/lib/list.c | 0 {vendor => subprojects}/csri/lib/posix/csrilib_os.h | 0 {vendor => subprojects}/csri/lib/posix/enumerate.c | 0 {vendor => subprojects}/csri/lib/win32/csrilib_os.h | 0 {vendor => subprojects}/csri/lib/win32/enumerate.c | 0 {vendor => subprojects}/csri/lib/wrap.c | 0 {vendor => subprojects}/csri/subhelp/Makefile.am | 0 {vendor => subprojects}/csri/subhelp/logging.c | 0 {vendor => subprojects}/csri/subhelp/posix/openfile.c | 0 {vendor => subprojects}/csri/subhelp/win32/openfile.c | 0 40 files changed, 0 insertions(+), 0 deletions(-) rename {vendor => subprojects}/csri/Doxyfile (100%) rename {vendor => subprojects}/csri/LICENSE (100%) rename {vendor => subprojects}/csri/Makefile.am (100%) rename {vendor => subprojects}/csri/ac/Makefile.am (100%) rename {vendor => subprojects}/csri/acinclude.m4 (100%) rename {vendor => subprojects}/csri/backends/Makefile.am (100%) rename {vendor => subprojects}/csri/backends/libass/Makefile.am (100%) rename {vendor => subprojects}/csri/backends/libass/libass_csri.c (100%) rename {vendor => subprojects}/csri/bootstrap (100%) mode change 100755 => 100644 rename {vendor => subprojects}/csri/configure.ac (100%) rename {vendor => subprojects}/csri/csri.pc.in (100%) rename {vendor => subprojects}/csri/csri_2008.vcproj (100%) rename {vendor => subprojects}/csri/frontends/Makefile.am (100%) rename {vendor => subprojects}/csri/frontends/avisynth25/Makefile.am (100%) rename {vendor => subprojects}/csri/frontends/avisynth25/avisynth.cpp (100%) rename {vendor => subprojects}/csri/frontends/avisynth25/avisynth.h (100%) rename {vendor => subprojects}/csri/frontends/cmdline/Makefile.am (100%) rename {vendor => subprojects}/csri/frontends/cmdline/cmdmain.c (100%) rename {vendor => subprojects}/csri/frontends/cmdline/render.c (100%) rename {vendor => subprojects}/csri/frontends/cmdline/render.h (100%) rename {vendor => subprojects}/csri/include/Makefile.am (100%) rename {vendor => subprojects}/csri/include/csri/csri.h (100%) rename {vendor => subprojects}/csri/include/csri/fmtids.h (100%) rename {vendor => subprojects}/csri/include/csri/logging.h (100%) rename {vendor => subprojects}/csri/include/csri/openerr.h (100%) rename {vendor => subprojects}/csri/include/csri/stream.h (100%) rename {vendor => subprojects}/csri/include/subhelp.h (100%) rename {vendor => subprojects}/csri/include/visibility.h (100%) rename {vendor => subprojects}/csri/lib/Makefile.am (100%) rename {vendor => subprojects}/csri/lib/csrilib.h (100%) rename {vendor => subprojects}/csri/lib/list.c (100%) rename {vendor => subprojects}/csri/lib/posix/csrilib_os.h (100%) rename {vendor => subprojects}/csri/lib/posix/enumerate.c (100%) rename {vendor => subprojects}/csri/lib/win32/csrilib_os.h (100%) rename {vendor => subprojects}/csri/lib/win32/enumerate.c (100%) rename {vendor => subprojects}/csri/lib/wrap.c (100%) rename {vendor => subprojects}/csri/subhelp/Makefile.am (100%) rename {vendor => subprojects}/csri/subhelp/logging.c (100%) rename {vendor => subprojects}/csri/subhelp/posix/openfile.c (100%) rename {vendor => subprojects}/csri/subhelp/win32/openfile.c (100%) diff --git a/vendor/csri/Doxyfile b/subprojects/csri/Doxyfile similarity index 100% rename from vendor/csri/Doxyfile rename to subprojects/csri/Doxyfile diff --git a/vendor/csri/LICENSE b/subprojects/csri/LICENSE similarity index 100% rename from vendor/csri/LICENSE rename to subprojects/csri/LICENSE diff --git a/vendor/csri/Makefile.am b/subprojects/csri/Makefile.am similarity index 100% rename from vendor/csri/Makefile.am rename to subprojects/csri/Makefile.am diff --git a/vendor/csri/ac/Makefile.am b/subprojects/csri/ac/Makefile.am similarity index 100% rename from vendor/csri/ac/Makefile.am rename to subprojects/csri/ac/Makefile.am diff --git a/vendor/csri/acinclude.m4 b/subprojects/csri/acinclude.m4 similarity index 100% rename from vendor/csri/acinclude.m4 rename to subprojects/csri/acinclude.m4 diff --git a/vendor/csri/backends/Makefile.am b/subprojects/csri/backends/Makefile.am similarity index 100% rename from vendor/csri/backends/Makefile.am rename to subprojects/csri/backends/Makefile.am diff --git a/vendor/csri/backends/libass/Makefile.am b/subprojects/csri/backends/libass/Makefile.am similarity index 100% rename from vendor/csri/backends/libass/Makefile.am rename to subprojects/csri/backends/libass/Makefile.am diff --git a/vendor/csri/backends/libass/libass_csri.c b/subprojects/csri/backends/libass/libass_csri.c similarity index 100% rename from vendor/csri/backends/libass/libass_csri.c rename to subprojects/csri/backends/libass/libass_csri.c diff --git a/vendor/csri/bootstrap b/subprojects/csri/bootstrap old mode 100755 new mode 100644 similarity index 100% rename from vendor/csri/bootstrap rename to subprojects/csri/bootstrap diff --git a/vendor/csri/configure.ac b/subprojects/csri/configure.ac similarity index 100% rename from vendor/csri/configure.ac rename to subprojects/csri/configure.ac diff --git a/vendor/csri/csri.pc.in b/subprojects/csri/csri.pc.in similarity index 100% rename from vendor/csri/csri.pc.in rename to subprojects/csri/csri.pc.in diff --git a/vendor/csri/csri_2008.vcproj b/subprojects/csri/csri_2008.vcproj similarity index 100% rename from vendor/csri/csri_2008.vcproj rename to subprojects/csri/csri_2008.vcproj diff --git a/vendor/csri/frontends/Makefile.am b/subprojects/csri/frontends/Makefile.am similarity index 100% rename from vendor/csri/frontends/Makefile.am rename to subprojects/csri/frontends/Makefile.am diff --git a/vendor/csri/frontends/avisynth25/Makefile.am b/subprojects/csri/frontends/avisynth25/Makefile.am similarity index 100% rename from vendor/csri/frontends/avisynth25/Makefile.am rename to subprojects/csri/frontends/avisynth25/Makefile.am diff --git a/vendor/csri/frontends/avisynth25/avisynth.cpp b/subprojects/csri/frontends/avisynth25/avisynth.cpp similarity index 100% rename from vendor/csri/frontends/avisynth25/avisynth.cpp rename to subprojects/csri/frontends/avisynth25/avisynth.cpp diff --git a/vendor/csri/frontends/avisynth25/avisynth.h b/subprojects/csri/frontends/avisynth25/avisynth.h similarity index 100% rename from vendor/csri/frontends/avisynth25/avisynth.h rename to subprojects/csri/frontends/avisynth25/avisynth.h diff --git a/vendor/csri/frontends/cmdline/Makefile.am b/subprojects/csri/frontends/cmdline/Makefile.am similarity index 100% rename from vendor/csri/frontends/cmdline/Makefile.am rename to subprojects/csri/frontends/cmdline/Makefile.am diff --git a/vendor/csri/frontends/cmdline/cmdmain.c b/subprojects/csri/frontends/cmdline/cmdmain.c similarity index 100% rename from vendor/csri/frontends/cmdline/cmdmain.c rename to subprojects/csri/frontends/cmdline/cmdmain.c diff --git a/vendor/csri/frontends/cmdline/render.c b/subprojects/csri/frontends/cmdline/render.c similarity index 100% rename from vendor/csri/frontends/cmdline/render.c rename to subprojects/csri/frontends/cmdline/render.c diff --git a/vendor/csri/frontends/cmdline/render.h b/subprojects/csri/frontends/cmdline/render.h similarity index 100% rename from vendor/csri/frontends/cmdline/render.h rename to subprojects/csri/frontends/cmdline/render.h diff --git a/vendor/csri/include/Makefile.am b/subprojects/csri/include/Makefile.am similarity index 100% rename from vendor/csri/include/Makefile.am rename to subprojects/csri/include/Makefile.am diff --git a/vendor/csri/include/csri/csri.h b/subprojects/csri/include/csri/csri.h similarity index 100% rename from vendor/csri/include/csri/csri.h rename to subprojects/csri/include/csri/csri.h diff --git a/vendor/csri/include/csri/fmtids.h b/subprojects/csri/include/csri/fmtids.h similarity index 100% rename from vendor/csri/include/csri/fmtids.h rename to subprojects/csri/include/csri/fmtids.h diff --git a/vendor/csri/include/csri/logging.h b/subprojects/csri/include/csri/logging.h similarity index 100% rename from vendor/csri/include/csri/logging.h rename to subprojects/csri/include/csri/logging.h diff --git a/vendor/csri/include/csri/openerr.h b/subprojects/csri/include/csri/openerr.h similarity index 100% rename from vendor/csri/include/csri/openerr.h rename to subprojects/csri/include/csri/openerr.h diff --git a/vendor/csri/include/csri/stream.h b/subprojects/csri/include/csri/stream.h similarity index 100% rename from vendor/csri/include/csri/stream.h rename to subprojects/csri/include/csri/stream.h diff --git a/vendor/csri/include/subhelp.h b/subprojects/csri/include/subhelp.h similarity index 100% rename from vendor/csri/include/subhelp.h rename to subprojects/csri/include/subhelp.h diff --git a/vendor/csri/include/visibility.h b/subprojects/csri/include/visibility.h similarity index 100% rename from vendor/csri/include/visibility.h rename to subprojects/csri/include/visibility.h diff --git a/vendor/csri/lib/Makefile.am b/subprojects/csri/lib/Makefile.am similarity index 100% rename from vendor/csri/lib/Makefile.am rename to subprojects/csri/lib/Makefile.am diff --git a/vendor/csri/lib/csrilib.h b/subprojects/csri/lib/csrilib.h similarity index 100% rename from vendor/csri/lib/csrilib.h rename to subprojects/csri/lib/csrilib.h diff --git a/vendor/csri/lib/list.c b/subprojects/csri/lib/list.c similarity index 100% rename from vendor/csri/lib/list.c rename to subprojects/csri/lib/list.c diff --git a/vendor/csri/lib/posix/csrilib_os.h b/subprojects/csri/lib/posix/csrilib_os.h similarity index 100% rename from vendor/csri/lib/posix/csrilib_os.h rename to subprojects/csri/lib/posix/csrilib_os.h diff --git a/vendor/csri/lib/posix/enumerate.c b/subprojects/csri/lib/posix/enumerate.c similarity index 100% rename from vendor/csri/lib/posix/enumerate.c rename to subprojects/csri/lib/posix/enumerate.c diff --git a/vendor/csri/lib/win32/csrilib_os.h b/subprojects/csri/lib/win32/csrilib_os.h similarity index 100% rename from vendor/csri/lib/win32/csrilib_os.h rename to subprojects/csri/lib/win32/csrilib_os.h diff --git a/vendor/csri/lib/win32/enumerate.c b/subprojects/csri/lib/win32/enumerate.c similarity index 100% rename from vendor/csri/lib/win32/enumerate.c rename to subprojects/csri/lib/win32/enumerate.c diff --git a/vendor/csri/lib/wrap.c b/subprojects/csri/lib/wrap.c similarity index 100% rename from vendor/csri/lib/wrap.c rename to subprojects/csri/lib/wrap.c diff --git a/vendor/csri/subhelp/Makefile.am b/subprojects/csri/subhelp/Makefile.am similarity index 100% rename from vendor/csri/subhelp/Makefile.am rename to subprojects/csri/subhelp/Makefile.am diff --git a/vendor/csri/subhelp/logging.c b/subprojects/csri/subhelp/logging.c similarity index 100% rename from vendor/csri/subhelp/logging.c rename to subprojects/csri/subhelp/logging.c diff --git a/vendor/csri/subhelp/posix/openfile.c b/subprojects/csri/subhelp/posix/openfile.c similarity index 100% rename from vendor/csri/subhelp/posix/openfile.c rename to subprojects/csri/subhelp/posix/openfile.c diff --git a/vendor/csri/subhelp/win32/openfile.c b/subprojects/csri/subhelp/win32/openfile.c similarity index 100% rename from vendor/csri/subhelp/win32/openfile.c rename to subprojects/csri/subhelp/win32/openfile.c From 608d0c9c15f14f5e9fdbc6462c1fee42792616a5 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Wed, 13 Feb 2019 12:33:37 -0500 Subject: [PATCH 096/271] Move hunspell to subprojects --- {vendor => subprojects}/hunspell/ABOUT-NLS | 0 {vendor => subprojects}/hunspell/AUTHORS | 0 .../hunspell/AUTHORS.myspell | 0 {vendor => subprojects}/hunspell/BUGS | 0 {vendor => subprojects}/hunspell/COPYING | 0 {vendor => subprojects}/hunspell/COPYING.LGPL | 0 {vendor => subprojects}/hunspell/COPYING.MPL | 0 {vendor => subprojects}/hunspell/ChangeLog | 0 {vendor => subprojects}/hunspell/ChangeLog.O | 0 {vendor => subprojects}/hunspell/INSTALL | 0 {vendor => subprojects}/hunspell/NEWS | 0 {vendor => subprojects}/hunspell/README | 0 .../hunspell/README.myspell | 0 {vendor => subprojects}/hunspell/THANKS | 0 {vendor => subprojects}/hunspell/TODO | 0 .../hunspell/license.hunspell | 0 .../hunspell/license.myspell | 0 .../hunspell/src/hunspell/README | 0 .../hunspell/src/hunspell/affentry.cxx | 0 .../hunspell/src/hunspell/affentry.hxx | 0 .../hunspell/src/hunspell/affixmgr.cxx | 0 .../hunspell/src/hunspell/affixmgr.hxx | 0 .../hunspell/src/hunspell/atypes.hxx | 0 .../hunspell/src/hunspell/baseaffix.hxx | 0 .../hunspell/src/hunspell/csutil.cxx | 0 .../hunspell/src/hunspell/csutil.hxx | 0 .../hunspell/src/hunspell/dictmgr.cxx | 0 .../hunspell/src/hunspell/dictmgr.hxx | 0 .../hunspell/src/hunspell/filemgr.cxx | 0 .../hunspell/src/hunspell/filemgr.hxx | 0 .../hunspell/src/hunspell/hashmgr.cxx | 0 .../hunspell/src/hunspell/hashmgr.hxx | 0 .../hunspell/src/hunspell/htypes.hxx | 0 .../hunspell/src/hunspell/hunspell.cxx | 0 .../hunspell/src/hunspell/hunspell.dsp | 328 +++++++++--------- .../hunspell/src/hunspell/hunspell.h | 0 .../hunspell/src/hunspell/hunspell.hxx | 0 .../hunspell/src/hunspell/hunvisapi.h | 0 .../hunspell/src/hunspell/hunvisapi.h.in | 0 .../hunspell/src/hunspell/hunzip.cxx | 0 .../hunspell/src/hunspell/hunzip.hxx | 0 .../hunspell/src/hunspell/langnum.hxx | 0 .../hunspell/src/hunspell/license.hunspell | 0 .../hunspell/src/hunspell/license.myspell | 0 .../hunspell/src/hunspell/makefile.mk | 0 .../hunspell/src/hunspell/phonet.cxx | 0 .../hunspell/src/hunspell/phonet.hxx | 0 .../hunspell/src/hunspell/replist.cxx | 0 .../hunspell/src/hunspell/replist.hxx | 0 .../hunspell/src/hunspell/suggestmgr.cxx | 0 .../hunspell/src/hunspell/suggestmgr.hxx | 0 .../hunspell/src/hunspell/utf_info.cxx | 0 .../hunspell/src/hunspell/w_char.hxx | 0 .../hunspell/src/win_api/config.h | 0 54 files changed, 164 insertions(+), 164 deletions(-) rename {vendor => subprojects}/hunspell/ABOUT-NLS (100%) rename {vendor => subprojects}/hunspell/AUTHORS (100%) rename {vendor => subprojects}/hunspell/AUTHORS.myspell (100%) rename {vendor => subprojects}/hunspell/BUGS (100%) rename {vendor => subprojects}/hunspell/COPYING (100%) rename {vendor => subprojects}/hunspell/COPYING.LGPL (100%) rename {vendor => subprojects}/hunspell/COPYING.MPL (100%) rename {vendor => subprojects}/hunspell/ChangeLog (100%) rename {vendor => subprojects}/hunspell/ChangeLog.O (100%) rename {vendor => subprojects}/hunspell/INSTALL (100%) rename {vendor => subprojects}/hunspell/NEWS (100%) rename {vendor => subprojects}/hunspell/README (100%) rename {vendor => subprojects}/hunspell/README.myspell (100%) rename {vendor => subprojects}/hunspell/THANKS (100%) rename {vendor => subprojects}/hunspell/TODO (100%) rename {vendor => subprojects}/hunspell/license.hunspell (100%) rename {vendor => subprojects}/hunspell/license.myspell (100%) rename {vendor => subprojects}/hunspell/src/hunspell/README (100%) rename {vendor => subprojects}/hunspell/src/hunspell/affentry.cxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/affentry.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/affixmgr.cxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/affixmgr.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/atypes.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/baseaffix.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/csutil.cxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/csutil.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/dictmgr.cxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/dictmgr.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/filemgr.cxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/filemgr.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/hashmgr.cxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/hashmgr.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/htypes.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/hunspell.cxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/hunspell.dsp (95%) rename {vendor => subprojects}/hunspell/src/hunspell/hunspell.h (100%) rename {vendor => subprojects}/hunspell/src/hunspell/hunspell.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/hunvisapi.h (100%) rename {vendor => subprojects}/hunspell/src/hunspell/hunvisapi.h.in (100%) rename {vendor => subprojects}/hunspell/src/hunspell/hunzip.cxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/hunzip.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/langnum.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/license.hunspell (100%) rename {vendor => subprojects}/hunspell/src/hunspell/license.myspell (100%) rename {vendor => subprojects}/hunspell/src/hunspell/makefile.mk (100%) rename {vendor => subprojects}/hunspell/src/hunspell/phonet.cxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/phonet.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/replist.cxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/replist.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/suggestmgr.cxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/suggestmgr.hxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/utf_info.cxx (100%) rename {vendor => subprojects}/hunspell/src/hunspell/w_char.hxx (100%) rename {vendor => subprojects}/hunspell/src/win_api/config.h (100%) diff --git a/vendor/hunspell/ABOUT-NLS b/subprojects/hunspell/ABOUT-NLS similarity index 100% rename from vendor/hunspell/ABOUT-NLS rename to subprojects/hunspell/ABOUT-NLS diff --git a/vendor/hunspell/AUTHORS b/subprojects/hunspell/AUTHORS similarity index 100% rename from vendor/hunspell/AUTHORS rename to subprojects/hunspell/AUTHORS diff --git a/vendor/hunspell/AUTHORS.myspell b/subprojects/hunspell/AUTHORS.myspell similarity index 100% rename from vendor/hunspell/AUTHORS.myspell rename to subprojects/hunspell/AUTHORS.myspell diff --git a/vendor/hunspell/BUGS b/subprojects/hunspell/BUGS similarity index 100% rename from vendor/hunspell/BUGS rename to subprojects/hunspell/BUGS diff --git a/vendor/hunspell/COPYING b/subprojects/hunspell/COPYING similarity index 100% rename from vendor/hunspell/COPYING rename to subprojects/hunspell/COPYING diff --git a/vendor/hunspell/COPYING.LGPL b/subprojects/hunspell/COPYING.LGPL similarity index 100% rename from vendor/hunspell/COPYING.LGPL rename to subprojects/hunspell/COPYING.LGPL diff --git a/vendor/hunspell/COPYING.MPL b/subprojects/hunspell/COPYING.MPL similarity index 100% rename from vendor/hunspell/COPYING.MPL rename to subprojects/hunspell/COPYING.MPL diff --git a/vendor/hunspell/ChangeLog b/subprojects/hunspell/ChangeLog similarity index 100% rename from vendor/hunspell/ChangeLog rename to subprojects/hunspell/ChangeLog diff --git a/vendor/hunspell/ChangeLog.O b/subprojects/hunspell/ChangeLog.O similarity index 100% rename from vendor/hunspell/ChangeLog.O rename to subprojects/hunspell/ChangeLog.O diff --git a/vendor/hunspell/INSTALL b/subprojects/hunspell/INSTALL similarity index 100% rename from vendor/hunspell/INSTALL rename to subprojects/hunspell/INSTALL diff --git a/vendor/hunspell/NEWS b/subprojects/hunspell/NEWS similarity index 100% rename from vendor/hunspell/NEWS rename to subprojects/hunspell/NEWS diff --git a/vendor/hunspell/README b/subprojects/hunspell/README similarity index 100% rename from vendor/hunspell/README rename to subprojects/hunspell/README diff --git a/vendor/hunspell/README.myspell b/subprojects/hunspell/README.myspell similarity index 100% rename from vendor/hunspell/README.myspell rename to subprojects/hunspell/README.myspell diff --git a/vendor/hunspell/THANKS b/subprojects/hunspell/THANKS similarity index 100% rename from vendor/hunspell/THANKS rename to subprojects/hunspell/THANKS diff --git a/vendor/hunspell/TODO b/subprojects/hunspell/TODO similarity index 100% rename from vendor/hunspell/TODO rename to subprojects/hunspell/TODO diff --git a/vendor/hunspell/license.hunspell b/subprojects/hunspell/license.hunspell similarity index 100% rename from vendor/hunspell/license.hunspell rename to subprojects/hunspell/license.hunspell diff --git a/vendor/hunspell/license.myspell b/subprojects/hunspell/license.myspell similarity index 100% rename from vendor/hunspell/license.myspell rename to subprojects/hunspell/license.myspell diff --git a/vendor/hunspell/src/hunspell/README b/subprojects/hunspell/src/hunspell/README similarity index 100% rename from vendor/hunspell/src/hunspell/README rename to subprojects/hunspell/src/hunspell/README diff --git a/vendor/hunspell/src/hunspell/affentry.cxx b/subprojects/hunspell/src/hunspell/affentry.cxx similarity index 100% rename from vendor/hunspell/src/hunspell/affentry.cxx rename to subprojects/hunspell/src/hunspell/affentry.cxx diff --git a/vendor/hunspell/src/hunspell/affentry.hxx b/subprojects/hunspell/src/hunspell/affentry.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/affentry.hxx rename to subprojects/hunspell/src/hunspell/affentry.hxx diff --git a/vendor/hunspell/src/hunspell/affixmgr.cxx b/subprojects/hunspell/src/hunspell/affixmgr.cxx similarity index 100% rename from vendor/hunspell/src/hunspell/affixmgr.cxx rename to subprojects/hunspell/src/hunspell/affixmgr.cxx diff --git a/vendor/hunspell/src/hunspell/affixmgr.hxx b/subprojects/hunspell/src/hunspell/affixmgr.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/affixmgr.hxx rename to subprojects/hunspell/src/hunspell/affixmgr.hxx diff --git a/vendor/hunspell/src/hunspell/atypes.hxx b/subprojects/hunspell/src/hunspell/atypes.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/atypes.hxx rename to subprojects/hunspell/src/hunspell/atypes.hxx diff --git a/vendor/hunspell/src/hunspell/baseaffix.hxx b/subprojects/hunspell/src/hunspell/baseaffix.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/baseaffix.hxx rename to subprojects/hunspell/src/hunspell/baseaffix.hxx diff --git a/vendor/hunspell/src/hunspell/csutil.cxx b/subprojects/hunspell/src/hunspell/csutil.cxx similarity index 100% rename from vendor/hunspell/src/hunspell/csutil.cxx rename to subprojects/hunspell/src/hunspell/csutil.cxx diff --git a/vendor/hunspell/src/hunspell/csutil.hxx b/subprojects/hunspell/src/hunspell/csutil.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/csutil.hxx rename to subprojects/hunspell/src/hunspell/csutil.hxx diff --git a/vendor/hunspell/src/hunspell/dictmgr.cxx b/subprojects/hunspell/src/hunspell/dictmgr.cxx similarity index 100% rename from vendor/hunspell/src/hunspell/dictmgr.cxx rename to subprojects/hunspell/src/hunspell/dictmgr.cxx diff --git a/vendor/hunspell/src/hunspell/dictmgr.hxx b/subprojects/hunspell/src/hunspell/dictmgr.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/dictmgr.hxx rename to subprojects/hunspell/src/hunspell/dictmgr.hxx diff --git a/vendor/hunspell/src/hunspell/filemgr.cxx b/subprojects/hunspell/src/hunspell/filemgr.cxx similarity index 100% rename from vendor/hunspell/src/hunspell/filemgr.cxx rename to subprojects/hunspell/src/hunspell/filemgr.cxx diff --git a/vendor/hunspell/src/hunspell/filemgr.hxx b/subprojects/hunspell/src/hunspell/filemgr.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/filemgr.hxx rename to subprojects/hunspell/src/hunspell/filemgr.hxx diff --git a/vendor/hunspell/src/hunspell/hashmgr.cxx b/subprojects/hunspell/src/hunspell/hashmgr.cxx similarity index 100% rename from vendor/hunspell/src/hunspell/hashmgr.cxx rename to subprojects/hunspell/src/hunspell/hashmgr.cxx diff --git a/vendor/hunspell/src/hunspell/hashmgr.hxx b/subprojects/hunspell/src/hunspell/hashmgr.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/hashmgr.hxx rename to subprojects/hunspell/src/hunspell/hashmgr.hxx diff --git a/vendor/hunspell/src/hunspell/htypes.hxx b/subprojects/hunspell/src/hunspell/htypes.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/htypes.hxx rename to subprojects/hunspell/src/hunspell/htypes.hxx diff --git a/vendor/hunspell/src/hunspell/hunspell.cxx b/subprojects/hunspell/src/hunspell/hunspell.cxx similarity index 100% rename from vendor/hunspell/src/hunspell/hunspell.cxx rename to subprojects/hunspell/src/hunspell/hunspell.cxx diff --git a/vendor/hunspell/src/hunspell/hunspell.dsp b/subprojects/hunspell/src/hunspell/hunspell.dsp similarity index 95% rename from vendor/hunspell/src/hunspell/hunspell.dsp rename to subprojects/hunspell/src/hunspell/hunspell.dsp index c18262174..05e072fba 100644 --- a/vendor/hunspell/src/hunspell/hunspell.dsp +++ b/subprojects/hunspell/src/hunspell/hunspell.dsp @@ -1,164 +1,164 @@ -# Microsoft Developer Studio Project File - Name="hunspell" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=hunspell - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "hunspell.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "hunspell.mak" CFG="hunspell - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "hunspell - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "hunspell - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "hunspell - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "W32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /D "W32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x40e /d "NDEBUG" -# ADD RSC /l 0x40e /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "hunspell - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "W32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "W32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x40e /d "_DEBUG" -# ADD RSC /l 0x40e /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "hunspell - Win32 Release" -# Name "hunspell - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\affentry.cxx -# End Source File -# Begin Source File - -SOURCE=.\affixmgr.cxx -# End Source File -# Begin Source File - -SOURCE=.\csutil.cxx -# End Source File -# Begin Source File - -SOURCE=.\dictmgr.cxx -# End Source File -# Begin Source File - -SOURCE=.\hashmgr.cxx -# End Source File -# Begin Source File - -SOURCE=.\hunspell.cxx -# End Source File -# Begin Source File - -SOURCE=.\suggestmgr.cxx -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\affentry.hxx -# End Source File -# Begin Source File - -SOURCE=.\affixmgr.hxx -# End Source File -# Begin Source File - -SOURCE=.\atypes.hxx -# End Source File -# Begin Source File - -SOURCE=.\baseaffix.hxx -# End Source File -# Begin Source File - -SOURCE=.\csutil.hxx -# End Source File -# Begin Source File - -SOURCE=.\dictmgr.hxx -# End Source File -# Begin Source File - -SOURCE=.\hashmgr.hxx -# End Source File -# Begin Source File - -SOURCE=.\htypes.hxx -# End Source File -# Begin Source File - -SOURCE=.\langnum.hxx -# End Source File -# Begin Source File - -SOURCE=.\hunspell.hxx -# End Source File -# Begin Source File - -SOURCE=.\suggestmgr.hxx -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="hunspell" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=hunspell - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "hunspell.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "hunspell.mak" CFG="hunspell - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "hunspell - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "hunspell - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "hunspell - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "W32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "W32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x40e /d "NDEBUG" +# ADD RSC /l 0x40e /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "hunspell - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "W32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "W32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD BASE RSC /l 0x40e /d "_DEBUG" +# ADD RSC /l 0x40e /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "hunspell - Win32 Release" +# Name "hunspell - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\affentry.cxx +# End Source File +# Begin Source File + +SOURCE=.\affixmgr.cxx +# End Source File +# Begin Source File + +SOURCE=.\csutil.cxx +# End Source File +# Begin Source File + +SOURCE=.\dictmgr.cxx +# End Source File +# Begin Source File + +SOURCE=.\hashmgr.cxx +# End Source File +# Begin Source File + +SOURCE=.\hunspell.cxx +# End Source File +# Begin Source File + +SOURCE=.\suggestmgr.cxx +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\affentry.hxx +# End Source File +# Begin Source File + +SOURCE=.\affixmgr.hxx +# End Source File +# Begin Source File + +SOURCE=.\atypes.hxx +# End Source File +# Begin Source File + +SOURCE=.\baseaffix.hxx +# End Source File +# Begin Source File + +SOURCE=.\csutil.hxx +# End Source File +# Begin Source File + +SOURCE=.\dictmgr.hxx +# End Source File +# Begin Source File + +SOURCE=.\hashmgr.hxx +# End Source File +# Begin Source File + +SOURCE=.\htypes.hxx +# End Source File +# Begin Source File + +SOURCE=.\langnum.hxx +# End Source File +# Begin Source File + +SOURCE=.\hunspell.hxx +# End Source File +# Begin Source File + +SOURCE=.\suggestmgr.hxx +# End Source File +# End Group +# End Target +# End Project diff --git a/vendor/hunspell/src/hunspell/hunspell.h b/subprojects/hunspell/src/hunspell/hunspell.h similarity index 100% rename from vendor/hunspell/src/hunspell/hunspell.h rename to subprojects/hunspell/src/hunspell/hunspell.h diff --git a/vendor/hunspell/src/hunspell/hunspell.hxx b/subprojects/hunspell/src/hunspell/hunspell.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/hunspell.hxx rename to subprojects/hunspell/src/hunspell/hunspell.hxx diff --git a/vendor/hunspell/src/hunspell/hunvisapi.h b/subprojects/hunspell/src/hunspell/hunvisapi.h similarity index 100% rename from vendor/hunspell/src/hunspell/hunvisapi.h rename to subprojects/hunspell/src/hunspell/hunvisapi.h diff --git a/vendor/hunspell/src/hunspell/hunvisapi.h.in b/subprojects/hunspell/src/hunspell/hunvisapi.h.in similarity index 100% rename from vendor/hunspell/src/hunspell/hunvisapi.h.in rename to subprojects/hunspell/src/hunspell/hunvisapi.h.in diff --git a/vendor/hunspell/src/hunspell/hunzip.cxx b/subprojects/hunspell/src/hunspell/hunzip.cxx similarity index 100% rename from vendor/hunspell/src/hunspell/hunzip.cxx rename to subprojects/hunspell/src/hunspell/hunzip.cxx diff --git a/vendor/hunspell/src/hunspell/hunzip.hxx b/subprojects/hunspell/src/hunspell/hunzip.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/hunzip.hxx rename to subprojects/hunspell/src/hunspell/hunzip.hxx diff --git a/vendor/hunspell/src/hunspell/langnum.hxx b/subprojects/hunspell/src/hunspell/langnum.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/langnum.hxx rename to subprojects/hunspell/src/hunspell/langnum.hxx diff --git a/vendor/hunspell/src/hunspell/license.hunspell b/subprojects/hunspell/src/hunspell/license.hunspell similarity index 100% rename from vendor/hunspell/src/hunspell/license.hunspell rename to subprojects/hunspell/src/hunspell/license.hunspell diff --git a/vendor/hunspell/src/hunspell/license.myspell b/subprojects/hunspell/src/hunspell/license.myspell similarity index 100% rename from vendor/hunspell/src/hunspell/license.myspell rename to subprojects/hunspell/src/hunspell/license.myspell diff --git a/vendor/hunspell/src/hunspell/makefile.mk b/subprojects/hunspell/src/hunspell/makefile.mk similarity index 100% rename from vendor/hunspell/src/hunspell/makefile.mk rename to subprojects/hunspell/src/hunspell/makefile.mk diff --git a/vendor/hunspell/src/hunspell/phonet.cxx b/subprojects/hunspell/src/hunspell/phonet.cxx similarity index 100% rename from vendor/hunspell/src/hunspell/phonet.cxx rename to subprojects/hunspell/src/hunspell/phonet.cxx diff --git a/vendor/hunspell/src/hunspell/phonet.hxx b/subprojects/hunspell/src/hunspell/phonet.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/phonet.hxx rename to subprojects/hunspell/src/hunspell/phonet.hxx diff --git a/vendor/hunspell/src/hunspell/replist.cxx b/subprojects/hunspell/src/hunspell/replist.cxx similarity index 100% rename from vendor/hunspell/src/hunspell/replist.cxx rename to subprojects/hunspell/src/hunspell/replist.cxx diff --git a/vendor/hunspell/src/hunspell/replist.hxx b/subprojects/hunspell/src/hunspell/replist.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/replist.hxx rename to subprojects/hunspell/src/hunspell/replist.hxx diff --git a/vendor/hunspell/src/hunspell/suggestmgr.cxx b/subprojects/hunspell/src/hunspell/suggestmgr.cxx similarity index 100% rename from vendor/hunspell/src/hunspell/suggestmgr.cxx rename to subprojects/hunspell/src/hunspell/suggestmgr.cxx diff --git a/vendor/hunspell/src/hunspell/suggestmgr.hxx b/subprojects/hunspell/src/hunspell/suggestmgr.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/suggestmgr.hxx rename to subprojects/hunspell/src/hunspell/suggestmgr.hxx diff --git a/vendor/hunspell/src/hunspell/utf_info.cxx b/subprojects/hunspell/src/hunspell/utf_info.cxx similarity index 100% rename from vendor/hunspell/src/hunspell/utf_info.cxx rename to subprojects/hunspell/src/hunspell/utf_info.cxx diff --git a/vendor/hunspell/src/hunspell/w_char.hxx b/subprojects/hunspell/src/hunspell/w_char.hxx similarity index 100% rename from vendor/hunspell/src/hunspell/w_char.hxx rename to subprojects/hunspell/src/hunspell/w_char.hxx diff --git a/vendor/hunspell/src/win_api/config.h b/subprojects/hunspell/src/win_api/config.h similarity index 100% rename from vendor/hunspell/src/win_api/config.h rename to subprojects/hunspell/src/win_api/config.h From d3c709a2eafb1051b9327b05a24dd75659908298 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Wed, 13 Feb 2019 12:41:08 -0500 Subject: [PATCH 097/271] Move iconv to subprojects --- {vendor => subprojects}/iconv/AUTHORS | 0 {vendor => subprojects}/iconv/COPYING | 0 {vendor => subprojects}/iconv/ChangeLog | 0 {vendor => subprojects}/iconv/DEPENDENCIES | 0 {vendor => subprojects}/iconv/DESIGN | 0 {vendor => subprojects}/iconv/HACKING | 0 {vendor => subprojects}/iconv/NEWS | 0 {vendor => subprojects}/iconv/NOTES | 0 {vendor => subprojects}/iconv/PORTS | 0 {vendor => subprojects}/iconv/README | 0 {vendor => subprojects}/iconv/THANKS | 0 {vendor => subprojects}/iconv/include/iconv.h | 0 {vendor => subprojects}/iconv/include/libcharset.h | 0 {vendor => subprojects}/iconv/include/localcharset.h | 0 {vendor => subprojects}/iconv/include/stdbool.h | 0 {vendor => subprojects}/iconv/libcharset/config.h | 0 {vendor => subprojects}/iconv/libcharset/localcharset.c | 0 {vendor => subprojects}/iconv/libcharset/relocatable.c | 0 {vendor => subprojects}/iconv/libcharset/relocatable.h | 0 {vendor => subprojects}/iconv/libiconv/aliases.h | 0 {vendor => subprojects}/iconv/libiconv/aliases2.h | 0 {vendor => subprojects}/iconv/libiconv/aliases_aix.h | 0 {vendor => subprojects}/iconv/libiconv/aliases_aix_sysaix.h | 0 {vendor => subprojects}/iconv/libiconv/aliases_dos.h | 0 {vendor => subprojects}/iconv/libiconv/aliases_extra.h | 0 {vendor => subprojects}/iconv/libiconv/aliases_osf1.h | 0 {vendor => subprojects}/iconv/libiconv/aliases_osf1_sysosf1.h | 0 {vendor => subprojects}/iconv/libiconv/aliases_sysaix.h | 0 {vendor => subprojects}/iconv/libiconv/aliases_syshpux.h | 0 {vendor => subprojects}/iconv/libiconv/aliases_sysosf1.h | 0 {vendor => subprojects}/iconv/libiconv/aliases_syssolaris.h | 0 {vendor => subprojects}/iconv/libiconv/armscii_8.h | 0 {vendor => subprojects}/iconv/libiconv/ascii.h | 0 {vendor => subprojects}/iconv/libiconv/atarist.h | 0 {vendor => subprojects}/iconv/libiconv/big5.h | 0 {vendor => subprojects}/iconv/libiconv/big5_2003.h | 0 {vendor => subprojects}/iconv/libiconv/big5hkscs1999.h | 0 {vendor => subprojects}/iconv/libiconv/big5hkscs2001.h | 0 {vendor => subprojects}/iconv/libiconv/big5hkscs2004.h | 0 {vendor => subprojects}/iconv/libiconv/c99.h | 0 {vendor => subprojects}/iconv/libiconv/canonical.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_aix.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_aix_sysaix.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_dos.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_extra.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_local.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_local_sysaix.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_local_syshpux.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_local_sysosf1.h | 0 .../iconv/libiconv/canonical_local_syssolaris.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_osf1.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_osf1_sysosf1.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_sysaix.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_syshpux.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_sysosf1.h | 0 {vendor => subprojects}/iconv/libiconv/canonical_syssolaris.h | 0 {vendor => subprojects}/iconv/libiconv/ces_big5.h | 0 {vendor => subprojects}/iconv/libiconv/ces_gbk.h | 0 {vendor => subprojects}/iconv/libiconv/charset.alias | 0 {vendor => subprojects}/iconv/libiconv/cjk_variants.h | 0 {vendor => subprojects}/iconv/libiconv/cns11643.h | 0 {vendor => subprojects}/iconv/libiconv/cns11643_1.h | 0 {vendor => subprojects}/iconv/libiconv/cns11643_15.h | 0 {vendor => subprojects}/iconv/libiconv/cns11643_2.h | 0 {vendor => subprojects}/iconv/libiconv/cns11643_3.h | 0 {vendor => subprojects}/iconv/libiconv/cns11643_4.h | 0 {vendor => subprojects}/iconv/libiconv/cns11643_4a.h | 0 {vendor => subprojects}/iconv/libiconv/cns11643_4b.h | 0 {vendor => subprojects}/iconv/libiconv/cns11643_5.h | 0 {vendor => subprojects}/iconv/libiconv/cns11643_6.h | 0 {vendor => subprojects}/iconv/libiconv/cns11643_7.h | 0 {vendor => subprojects}/iconv/libiconv/cns11643_inv.h | 0 {vendor => subprojects}/iconv/libiconv/config.h | 0 {vendor => subprojects}/iconv/libiconv/converters.h | 0 {vendor => subprojects}/iconv/libiconv/cp1046.h | 0 {vendor => subprojects}/iconv/libiconv/cp1124.h | 0 {vendor => subprojects}/iconv/libiconv/cp1125.h | 0 {vendor => subprojects}/iconv/libiconv/cp1129.h | 0 {vendor => subprojects}/iconv/libiconv/cp1131.h | 0 {vendor => subprojects}/iconv/libiconv/cp1133.h | 0 {vendor => subprojects}/iconv/libiconv/cp1161.h | 0 {vendor => subprojects}/iconv/libiconv/cp1162.h | 0 {vendor => subprojects}/iconv/libiconv/cp1163.h | 0 {vendor => subprojects}/iconv/libiconv/cp1250.h | 0 {vendor => subprojects}/iconv/libiconv/cp1251.h | 0 {vendor => subprojects}/iconv/libiconv/cp1252.h | 0 {vendor => subprojects}/iconv/libiconv/cp1253.h | 0 {vendor => subprojects}/iconv/libiconv/cp1254.h | 0 {vendor => subprojects}/iconv/libiconv/cp1255.h | 0 {vendor => subprojects}/iconv/libiconv/cp1256.h | 0 {vendor => subprojects}/iconv/libiconv/cp1257.h | 0 {vendor => subprojects}/iconv/libiconv/cp1258.h | 0 {vendor => subprojects}/iconv/libiconv/cp437.h | 0 {vendor => subprojects}/iconv/libiconv/cp737.h | 0 {vendor => subprojects}/iconv/libiconv/cp775.h | 0 {vendor => subprojects}/iconv/libiconv/cp850.h | 0 {vendor => subprojects}/iconv/libiconv/cp852.h | 0 {vendor => subprojects}/iconv/libiconv/cp853.h | 0 {vendor => subprojects}/iconv/libiconv/cp855.h | 0 {vendor => subprojects}/iconv/libiconv/cp856.h | 0 {vendor => subprojects}/iconv/libiconv/cp857.h | 0 {vendor => subprojects}/iconv/libiconv/cp858.h | 0 {vendor => subprojects}/iconv/libiconv/cp860.h | 0 {vendor => subprojects}/iconv/libiconv/cp861.h | 0 {vendor => subprojects}/iconv/libiconv/cp862.h | 0 {vendor => subprojects}/iconv/libiconv/cp863.h | 0 {vendor => subprojects}/iconv/libiconv/cp864.h | 0 {vendor => subprojects}/iconv/libiconv/cp865.h | 0 {vendor => subprojects}/iconv/libiconv/cp866.h | 0 {vendor => subprojects}/iconv/libiconv/cp869.h | 0 {vendor => subprojects}/iconv/libiconv/cp874.h | 0 {vendor => subprojects}/iconv/libiconv/cp922.h | 0 {vendor => subprojects}/iconv/libiconv/cp932.h | 0 {vendor => subprojects}/iconv/libiconv/cp932ext.h | 0 {vendor => subprojects}/iconv/libiconv/cp936.h | 0 {vendor => subprojects}/iconv/libiconv/cp936ext.h | 0 {vendor => subprojects}/iconv/libiconv/cp943.h | 0 {vendor => subprojects}/iconv/libiconv/cp949.h | 0 {vendor => subprojects}/iconv/libiconv/cp950.h | 0 {vendor => subprojects}/iconv/libiconv/cp950ext.h | 0 {vendor => subprojects}/iconv/libiconv/dec_hanyu.h | 0 {vendor => subprojects}/iconv/libiconv/dec_kanji.h | 0 {vendor => subprojects}/iconv/libiconv/encodings.def | 0 {vendor => subprojects}/iconv/libiconv/encodings_aix.def | 0 {vendor => subprojects}/iconv/libiconv/encodings_dos.def | 0 {vendor => subprojects}/iconv/libiconv/encodings_extra.def | 0 {vendor => subprojects}/iconv/libiconv/encodings_local.def | 0 {vendor => subprojects}/iconv/libiconv/encodings_osf1.def | 0 {vendor => subprojects}/iconv/libiconv/euc_cn.h | 0 {vendor => subprojects}/iconv/libiconv/euc_jisx0213.h | 0 {vendor => subprojects}/iconv/libiconv/euc_jp.h | 0 {vendor => subprojects}/iconv/libiconv/euc_kr.h | 0 {vendor => subprojects}/iconv/libiconv/euc_tw.h | 0 {vendor => subprojects}/iconv/libiconv/flags.h | 0 {vendor => subprojects}/iconv/libiconv/flushwc.h | 0 {vendor => subprojects}/iconv/libiconv/gb12345.h | 0 {vendor => subprojects}/iconv/libiconv/gb12345ext.h | 0 {vendor => subprojects}/iconv/libiconv/gb18030.h | 0 {vendor => subprojects}/iconv/libiconv/gb18030ext.h | 0 {vendor => subprojects}/iconv/libiconv/gb18030uni.h | 0 {vendor => subprojects}/iconv/libiconv/gb2312.h | 0 {vendor => subprojects}/iconv/libiconv/gbk.h | 0 {vendor => subprojects}/iconv/libiconv/gbkext1.h | 0 {vendor => subprojects}/iconv/libiconv/gbkext2.h | 0 {vendor => subprojects}/iconv/libiconv/gbkext_inv.h | 0 {vendor => subprojects}/iconv/libiconv/genaliases.c | 0 {vendor => subprojects}/iconv/libiconv/genaliases2.c | 0 {vendor => subprojects}/iconv/libiconv/genflags.c | 0 {vendor => subprojects}/iconv/libiconv/gentranslit.c | 0 {vendor => subprojects}/iconv/libiconv/georgian_academy.h | 0 {vendor => subprojects}/iconv/libiconv/georgian_ps.h | 0 {vendor => subprojects}/iconv/libiconv/hkscs1999.h | 0 {vendor => subprojects}/iconv/libiconv/hkscs2001.h | 0 {vendor => subprojects}/iconv/libiconv/hkscs2004.h | 0 {vendor => subprojects}/iconv/libiconv/hp_roman8.h | 0 {vendor => subprojects}/iconv/libiconv/hz.h | 0 {vendor => subprojects}/iconv/libiconv/iconv.c | 0 {vendor => subprojects}/iconv/libiconv/iconv_open1.h | 0 {vendor => subprojects}/iconv/libiconv/iconv_open2.h | 0 {vendor => subprojects}/iconv/libiconv/iso2022_cn.h | 0 {vendor => subprojects}/iconv/libiconv/iso2022_cnext.h | 0 {vendor => subprojects}/iconv/libiconv/iso2022_jp.h | 0 {vendor => subprojects}/iconv/libiconv/iso2022_jp1.h | 0 {vendor => subprojects}/iconv/libiconv/iso2022_jp2.h | 0 {vendor => subprojects}/iconv/libiconv/iso2022_jp3.h | 0 {vendor => subprojects}/iconv/libiconv/iso2022_kr.h | 0 {vendor => subprojects}/iconv/libiconv/iso646_cn.h | 0 {vendor => subprojects}/iconv/libiconv/iso646_jp.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_1.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_10.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_11.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_13.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_14.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_15.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_16.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_2.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_3.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_4.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_5.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_6.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_7.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_8.h | 0 {vendor => subprojects}/iconv/libiconv/iso8859_9.h | 0 {vendor => subprojects}/iconv/libiconv/isoir165.h | 0 {vendor => subprojects}/iconv/libiconv/isoir165ext.h | 0 {vendor => subprojects}/iconv/libiconv/java.h | 0 {vendor => subprojects}/iconv/libiconv/jisx0201.h | 0 {vendor => subprojects}/iconv/libiconv/jisx0208.h | 0 {vendor => subprojects}/iconv/libiconv/jisx0212.h | 0 {vendor => subprojects}/iconv/libiconv/jisx0213.h | 0 {vendor => subprojects}/iconv/libiconv/johab.h | 0 {vendor => subprojects}/iconv/libiconv/johab_hangul.h | 0 {vendor => subprojects}/iconv/libiconv/koi8_r.h | 0 {vendor => subprojects}/iconv/libiconv/koi8_ru.h | 0 {vendor => subprojects}/iconv/libiconv/koi8_t.h | 0 {vendor => subprojects}/iconv/libiconv/koi8_u.h | 0 {vendor => subprojects}/iconv/libiconv/ksc5601.h | 0 {vendor => subprojects}/iconv/libiconv/libcharset.h | 0 {vendor => subprojects}/iconv/libiconv/localcharset.h | 0 {vendor => subprojects}/iconv/libiconv/loop_unicode.h | 0 {vendor => subprojects}/iconv/libiconv/loop_wchar.h | 0 {vendor => subprojects}/iconv/libiconv/loops.h | 0 {vendor => subprojects}/iconv/libiconv/mac_arabic.h | 0 {vendor => subprojects}/iconv/libiconv/mac_centraleurope.h | 0 {vendor => subprojects}/iconv/libiconv/mac_croatian.h | 0 {vendor => subprojects}/iconv/libiconv/mac_cyrillic.h | 0 {vendor => subprojects}/iconv/libiconv/mac_greek.h | 0 {vendor => subprojects}/iconv/libiconv/mac_hebrew.h | 0 {vendor => subprojects}/iconv/libiconv/mac_iceland.h | 0 {vendor => subprojects}/iconv/libiconv/mac_roman.h | 0 {vendor => subprojects}/iconv/libiconv/mac_romania.h | 0 {vendor => subprojects}/iconv/libiconv/mac_thai.h | 0 {vendor => subprojects}/iconv/libiconv/mac_turkish.h | 0 {vendor => subprojects}/iconv/libiconv/mac_ukraine.h | 0 {vendor => subprojects}/iconv/libiconv/mulelao.h | 0 {vendor => subprojects}/iconv/libiconv/nextstep.h | 0 {vendor => subprojects}/iconv/libiconv/pt154.h | 0 {vendor => subprojects}/iconv/libiconv/relocatable.c | 0 {vendor => subprojects}/iconv/libiconv/relocatable.h | 0 {vendor => subprojects}/iconv/libiconv/riscos1.h | 0 {vendor => subprojects}/iconv/libiconv/rk1048.h | 0 {vendor => subprojects}/iconv/libiconv/shift_jisx0213.h | 0 {vendor => subprojects}/iconv/libiconv/sjis.h | 0 {vendor => subprojects}/iconv/libiconv/tcvn.h | 0 {vendor => subprojects}/iconv/libiconv/tds565.h | 0 {vendor => subprojects}/iconv/libiconv/tis620.h | 0 {vendor => subprojects}/iconv/libiconv/translit.h | 0 {vendor => subprojects}/iconv/libiconv/ucs2.h | 0 {vendor => subprojects}/iconv/libiconv/ucs2be.h | 0 {vendor => subprojects}/iconv/libiconv/ucs2internal.h | 0 {vendor => subprojects}/iconv/libiconv/ucs2le.h | 0 {vendor => subprojects}/iconv/libiconv/ucs2swapped.h | 0 {vendor => subprojects}/iconv/libiconv/ucs4.h | 0 {vendor => subprojects}/iconv/libiconv/ucs4be.h | 0 {vendor => subprojects}/iconv/libiconv/ucs4internal.h | 0 {vendor => subprojects}/iconv/libiconv/ucs4le.h | 0 {vendor => subprojects}/iconv/libiconv/ucs4swapped.h | 0 {vendor => subprojects}/iconv/libiconv/uhc_1.h | 0 {vendor => subprojects}/iconv/libiconv/uhc_2.h | 0 {vendor => subprojects}/iconv/libiconv/utf16.h | 0 {vendor => subprojects}/iconv/libiconv/utf16be.h | 0 {vendor => subprojects}/iconv/libiconv/utf16le.h | 0 {vendor => subprojects}/iconv/libiconv/utf32.h | 0 {vendor => subprojects}/iconv/libiconv/utf32be.h | 0 {vendor => subprojects}/iconv/libiconv/utf32le.h | 0 {vendor => subprojects}/iconv/libiconv/utf7.h | 0 {vendor => subprojects}/iconv/libiconv/utf8.h | 0 {vendor => subprojects}/iconv/libiconv/vietcomb.h | 0 {vendor => subprojects}/iconv/libiconv/viscii.h | 0 249 files changed, 0 insertions(+), 0 deletions(-) rename {vendor => subprojects}/iconv/AUTHORS (100%) rename {vendor => subprojects}/iconv/COPYING (100%) rename {vendor => subprojects}/iconv/ChangeLog (100%) rename {vendor => subprojects}/iconv/DEPENDENCIES (100%) rename {vendor => subprojects}/iconv/DESIGN (100%) rename {vendor => subprojects}/iconv/HACKING (100%) rename {vendor => subprojects}/iconv/NEWS (100%) rename {vendor => subprojects}/iconv/NOTES (100%) rename {vendor => subprojects}/iconv/PORTS (100%) rename {vendor => subprojects}/iconv/README (100%) rename {vendor => subprojects}/iconv/THANKS (100%) rename {vendor => subprojects}/iconv/include/iconv.h (100%) rename {vendor => subprojects}/iconv/include/libcharset.h (100%) rename {vendor => subprojects}/iconv/include/localcharset.h (100%) rename {vendor => subprojects}/iconv/include/stdbool.h (100%) rename {vendor => subprojects}/iconv/libcharset/config.h (100%) rename {vendor => subprojects}/iconv/libcharset/localcharset.c (100%) rename {vendor => subprojects}/iconv/libcharset/relocatable.c (100%) rename {vendor => subprojects}/iconv/libcharset/relocatable.h (100%) rename {vendor => subprojects}/iconv/libiconv/aliases.h (100%) rename {vendor => subprojects}/iconv/libiconv/aliases2.h (100%) rename {vendor => subprojects}/iconv/libiconv/aliases_aix.h (100%) rename {vendor => subprojects}/iconv/libiconv/aliases_aix_sysaix.h (100%) rename {vendor => subprojects}/iconv/libiconv/aliases_dos.h (100%) rename {vendor => subprojects}/iconv/libiconv/aliases_extra.h (100%) rename {vendor => subprojects}/iconv/libiconv/aliases_osf1.h (100%) rename {vendor => subprojects}/iconv/libiconv/aliases_osf1_sysosf1.h (100%) rename {vendor => subprojects}/iconv/libiconv/aliases_sysaix.h (100%) rename {vendor => subprojects}/iconv/libiconv/aliases_syshpux.h (100%) rename {vendor => subprojects}/iconv/libiconv/aliases_sysosf1.h (100%) rename {vendor => subprojects}/iconv/libiconv/aliases_syssolaris.h (100%) rename {vendor => subprojects}/iconv/libiconv/armscii_8.h (100%) rename {vendor => subprojects}/iconv/libiconv/ascii.h (100%) rename {vendor => subprojects}/iconv/libiconv/atarist.h (100%) rename {vendor => subprojects}/iconv/libiconv/big5.h (100%) rename {vendor => subprojects}/iconv/libiconv/big5_2003.h (100%) rename {vendor => subprojects}/iconv/libiconv/big5hkscs1999.h (100%) rename {vendor => subprojects}/iconv/libiconv/big5hkscs2001.h (100%) rename {vendor => subprojects}/iconv/libiconv/big5hkscs2004.h (100%) rename {vendor => subprojects}/iconv/libiconv/c99.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_aix.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_aix_sysaix.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_dos.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_extra.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_local.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_local_sysaix.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_local_syshpux.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_local_sysosf1.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_local_syssolaris.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_osf1.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_osf1_sysosf1.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_sysaix.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_syshpux.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_sysosf1.h (100%) rename {vendor => subprojects}/iconv/libiconv/canonical_syssolaris.h (100%) rename {vendor => subprojects}/iconv/libiconv/ces_big5.h (100%) rename {vendor => subprojects}/iconv/libiconv/ces_gbk.h (100%) rename {vendor => subprojects}/iconv/libiconv/charset.alias (100%) rename {vendor => subprojects}/iconv/libiconv/cjk_variants.h (100%) rename {vendor => subprojects}/iconv/libiconv/cns11643.h (100%) rename {vendor => subprojects}/iconv/libiconv/cns11643_1.h (100%) rename {vendor => subprojects}/iconv/libiconv/cns11643_15.h (100%) rename {vendor => subprojects}/iconv/libiconv/cns11643_2.h (100%) rename {vendor => subprojects}/iconv/libiconv/cns11643_3.h (100%) rename {vendor => subprojects}/iconv/libiconv/cns11643_4.h (100%) rename {vendor => subprojects}/iconv/libiconv/cns11643_4a.h (100%) rename {vendor => subprojects}/iconv/libiconv/cns11643_4b.h (100%) rename {vendor => subprojects}/iconv/libiconv/cns11643_5.h (100%) rename {vendor => subprojects}/iconv/libiconv/cns11643_6.h (100%) rename {vendor => subprojects}/iconv/libiconv/cns11643_7.h (100%) rename {vendor => subprojects}/iconv/libiconv/cns11643_inv.h (100%) rename {vendor => subprojects}/iconv/libiconv/config.h (100%) rename {vendor => subprojects}/iconv/libiconv/converters.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1046.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1124.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1125.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1129.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1131.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1133.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1161.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1162.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1163.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1250.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1251.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1252.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1253.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1254.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1255.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1256.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1257.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp1258.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp437.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp737.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp775.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp850.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp852.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp853.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp855.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp856.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp857.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp858.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp860.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp861.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp862.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp863.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp864.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp865.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp866.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp869.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp874.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp922.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp932.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp932ext.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp936.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp936ext.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp943.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp949.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp950.h (100%) rename {vendor => subprojects}/iconv/libiconv/cp950ext.h (100%) rename {vendor => subprojects}/iconv/libiconv/dec_hanyu.h (100%) rename {vendor => subprojects}/iconv/libiconv/dec_kanji.h (100%) rename {vendor => subprojects}/iconv/libiconv/encodings.def (100%) rename {vendor => subprojects}/iconv/libiconv/encodings_aix.def (100%) rename {vendor => subprojects}/iconv/libiconv/encodings_dos.def (100%) rename {vendor => subprojects}/iconv/libiconv/encodings_extra.def (100%) rename {vendor => subprojects}/iconv/libiconv/encodings_local.def (100%) rename {vendor => subprojects}/iconv/libiconv/encodings_osf1.def (100%) rename {vendor => subprojects}/iconv/libiconv/euc_cn.h (100%) rename {vendor => subprojects}/iconv/libiconv/euc_jisx0213.h (100%) rename {vendor => subprojects}/iconv/libiconv/euc_jp.h (100%) rename {vendor => subprojects}/iconv/libiconv/euc_kr.h (100%) rename {vendor => subprojects}/iconv/libiconv/euc_tw.h (100%) rename {vendor => subprojects}/iconv/libiconv/flags.h (100%) rename {vendor => subprojects}/iconv/libiconv/flushwc.h (100%) rename {vendor => subprojects}/iconv/libiconv/gb12345.h (100%) rename {vendor => subprojects}/iconv/libiconv/gb12345ext.h (100%) rename {vendor => subprojects}/iconv/libiconv/gb18030.h (100%) rename {vendor => subprojects}/iconv/libiconv/gb18030ext.h (100%) rename {vendor => subprojects}/iconv/libiconv/gb18030uni.h (100%) rename {vendor => subprojects}/iconv/libiconv/gb2312.h (100%) rename {vendor => subprojects}/iconv/libiconv/gbk.h (100%) rename {vendor => subprojects}/iconv/libiconv/gbkext1.h (100%) rename {vendor => subprojects}/iconv/libiconv/gbkext2.h (100%) rename {vendor => subprojects}/iconv/libiconv/gbkext_inv.h (100%) rename {vendor => subprojects}/iconv/libiconv/genaliases.c (100%) rename {vendor => subprojects}/iconv/libiconv/genaliases2.c (100%) rename {vendor => subprojects}/iconv/libiconv/genflags.c (100%) rename {vendor => subprojects}/iconv/libiconv/gentranslit.c (100%) rename {vendor => subprojects}/iconv/libiconv/georgian_academy.h (100%) rename {vendor => subprojects}/iconv/libiconv/georgian_ps.h (100%) rename {vendor => subprojects}/iconv/libiconv/hkscs1999.h (100%) rename {vendor => subprojects}/iconv/libiconv/hkscs2001.h (100%) rename {vendor => subprojects}/iconv/libiconv/hkscs2004.h (100%) rename {vendor => subprojects}/iconv/libiconv/hp_roman8.h (100%) rename {vendor => subprojects}/iconv/libiconv/hz.h (100%) rename {vendor => subprojects}/iconv/libiconv/iconv.c (100%) rename {vendor => subprojects}/iconv/libiconv/iconv_open1.h (100%) rename {vendor => subprojects}/iconv/libiconv/iconv_open2.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso2022_cn.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso2022_cnext.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso2022_jp.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso2022_jp1.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso2022_jp2.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso2022_jp3.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso2022_kr.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso646_cn.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso646_jp.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_1.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_10.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_11.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_13.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_14.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_15.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_16.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_2.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_3.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_4.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_5.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_6.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_7.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_8.h (100%) rename {vendor => subprojects}/iconv/libiconv/iso8859_9.h (100%) rename {vendor => subprojects}/iconv/libiconv/isoir165.h (100%) rename {vendor => subprojects}/iconv/libiconv/isoir165ext.h (100%) rename {vendor => subprojects}/iconv/libiconv/java.h (100%) rename {vendor => subprojects}/iconv/libiconv/jisx0201.h (100%) rename {vendor => subprojects}/iconv/libiconv/jisx0208.h (100%) rename {vendor => subprojects}/iconv/libiconv/jisx0212.h (100%) rename {vendor => subprojects}/iconv/libiconv/jisx0213.h (100%) rename {vendor => subprojects}/iconv/libiconv/johab.h (100%) rename {vendor => subprojects}/iconv/libiconv/johab_hangul.h (100%) rename {vendor => subprojects}/iconv/libiconv/koi8_r.h (100%) rename {vendor => subprojects}/iconv/libiconv/koi8_ru.h (100%) rename {vendor => subprojects}/iconv/libiconv/koi8_t.h (100%) rename {vendor => subprojects}/iconv/libiconv/koi8_u.h (100%) rename {vendor => subprojects}/iconv/libiconv/ksc5601.h (100%) rename {vendor => subprojects}/iconv/libiconv/libcharset.h (100%) rename {vendor => subprojects}/iconv/libiconv/localcharset.h (100%) rename {vendor => subprojects}/iconv/libiconv/loop_unicode.h (100%) rename {vendor => subprojects}/iconv/libiconv/loop_wchar.h (100%) rename {vendor => subprojects}/iconv/libiconv/loops.h (100%) rename {vendor => subprojects}/iconv/libiconv/mac_arabic.h (100%) rename {vendor => subprojects}/iconv/libiconv/mac_centraleurope.h (100%) rename {vendor => subprojects}/iconv/libiconv/mac_croatian.h (100%) rename {vendor => subprojects}/iconv/libiconv/mac_cyrillic.h (100%) rename {vendor => subprojects}/iconv/libiconv/mac_greek.h (100%) rename {vendor => subprojects}/iconv/libiconv/mac_hebrew.h (100%) rename {vendor => subprojects}/iconv/libiconv/mac_iceland.h (100%) rename {vendor => subprojects}/iconv/libiconv/mac_roman.h (100%) rename {vendor => subprojects}/iconv/libiconv/mac_romania.h (100%) rename {vendor => subprojects}/iconv/libiconv/mac_thai.h (100%) rename {vendor => subprojects}/iconv/libiconv/mac_turkish.h (100%) rename {vendor => subprojects}/iconv/libiconv/mac_ukraine.h (100%) rename {vendor => subprojects}/iconv/libiconv/mulelao.h (100%) rename {vendor => subprojects}/iconv/libiconv/nextstep.h (100%) rename {vendor => subprojects}/iconv/libiconv/pt154.h (100%) rename {vendor => subprojects}/iconv/libiconv/relocatable.c (100%) rename {vendor => subprojects}/iconv/libiconv/relocatable.h (100%) rename {vendor => subprojects}/iconv/libiconv/riscos1.h (100%) rename {vendor => subprojects}/iconv/libiconv/rk1048.h (100%) rename {vendor => subprojects}/iconv/libiconv/shift_jisx0213.h (100%) rename {vendor => subprojects}/iconv/libiconv/sjis.h (100%) rename {vendor => subprojects}/iconv/libiconv/tcvn.h (100%) rename {vendor => subprojects}/iconv/libiconv/tds565.h (100%) rename {vendor => subprojects}/iconv/libiconv/tis620.h (100%) rename {vendor => subprojects}/iconv/libiconv/translit.h (100%) rename {vendor => subprojects}/iconv/libiconv/ucs2.h (100%) rename {vendor => subprojects}/iconv/libiconv/ucs2be.h (100%) rename {vendor => subprojects}/iconv/libiconv/ucs2internal.h (100%) rename {vendor => subprojects}/iconv/libiconv/ucs2le.h (100%) rename {vendor => subprojects}/iconv/libiconv/ucs2swapped.h (100%) rename {vendor => subprojects}/iconv/libiconv/ucs4.h (100%) rename {vendor => subprojects}/iconv/libiconv/ucs4be.h (100%) rename {vendor => subprojects}/iconv/libiconv/ucs4internal.h (100%) rename {vendor => subprojects}/iconv/libiconv/ucs4le.h (100%) rename {vendor => subprojects}/iconv/libiconv/ucs4swapped.h (100%) rename {vendor => subprojects}/iconv/libiconv/uhc_1.h (100%) rename {vendor => subprojects}/iconv/libiconv/uhc_2.h (100%) rename {vendor => subprojects}/iconv/libiconv/utf16.h (100%) rename {vendor => subprojects}/iconv/libiconv/utf16be.h (100%) rename {vendor => subprojects}/iconv/libiconv/utf16le.h (100%) rename {vendor => subprojects}/iconv/libiconv/utf32.h (100%) rename {vendor => subprojects}/iconv/libiconv/utf32be.h (100%) rename {vendor => subprojects}/iconv/libiconv/utf32le.h (100%) rename {vendor => subprojects}/iconv/libiconv/utf7.h (100%) rename {vendor => subprojects}/iconv/libiconv/utf8.h (100%) rename {vendor => subprojects}/iconv/libiconv/vietcomb.h (100%) rename {vendor => subprojects}/iconv/libiconv/viscii.h (100%) diff --git a/vendor/iconv/AUTHORS b/subprojects/iconv/AUTHORS similarity index 100% rename from vendor/iconv/AUTHORS rename to subprojects/iconv/AUTHORS diff --git a/vendor/iconv/COPYING b/subprojects/iconv/COPYING similarity index 100% rename from vendor/iconv/COPYING rename to subprojects/iconv/COPYING diff --git a/vendor/iconv/ChangeLog b/subprojects/iconv/ChangeLog similarity index 100% rename from vendor/iconv/ChangeLog rename to subprojects/iconv/ChangeLog diff --git a/vendor/iconv/DEPENDENCIES b/subprojects/iconv/DEPENDENCIES similarity index 100% rename from vendor/iconv/DEPENDENCIES rename to subprojects/iconv/DEPENDENCIES diff --git a/vendor/iconv/DESIGN b/subprojects/iconv/DESIGN similarity index 100% rename from vendor/iconv/DESIGN rename to subprojects/iconv/DESIGN diff --git a/vendor/iconv/HACKING b/subprojects/iconv/HACKING similarity index 100% rename from vendor/iconv/HACKING rename to subprojects/iconv/HACKING diff --git a/vendor/iconv/NEWS b/subprojects/iconv/NEWS similarity index 100% rename from vendor/iconv/NEWS rename to subprojects/iconv/NEWS diff --git a/vendor/iconv/NOTES b/subprojects/iconv/NOTES similarity index 100% rename from vendor/iconv/NOTES rename to subprojects/iconv/NOTES diff --git a/vendor/iconv/PORTS b/subprojects/iconv/PORTS similarity index 100% rename from vendor/iconv/PORTS rename to subprojects/iconv/PORTS diff --git a/vendor/iconv/README b/subprojects/iconv/README similarity index 100% rename from vendor/iconv/README rename to subprojects/iconv/README diff --git a/vendor/iconv/THANKS b/subprojects/iconv/THANKS similarity index 100% rename from vendor/iconv/THANKS rename to subprojects/iconv/THANKS diff --git a/vendor/iconv/include/iconv.h b/subprojects/iconv/include/iconv.h similarity index 100% rename from vendor/iconv/include/iconv.h rename to subprojects/iconv/include/iconv.h diff --git a/vendor/iconv/include/libcharset.h b/subprojects/iconv/include/libcharset.h similarity index 100% rename from vendor/iconv/include/libcharset.h rename to subprojects/iconv/include/libcharset.h diff --git a/vendor/iconv/include/localcharset.h b/subprojects/iconv/include/localcharset.h similarity index 100% rename from vendor/iconv/include/localcharset.h rename to subprojects/iconv/include/localcharset.h diff --git a/vendor/iconv/include/stdbool.h b/subprojects/iconv/include/stdbool.h similarity index 100% rename from vendor/iconv/include/stdbool.h rename to subprojects/iconv/include/stdbool.h diff --git a/vendor/iconv/libcharset/config.h b/subprojects/iconv/libcharset/config.h similarity index 100% rename from vendor/iconv/libcharset/config.h rename to subprojects/iconv/libcharset/config.h diff --git a/vendor/iconv/libcharset/localcharset.c b/subprojects/iconv/libcharset/localcharset.c similarity index 100% rename from vendor/iconv/libcharset/localcharset.c rename to subprojects/iconv/libcharset/localcharset.c diff --git a/vendor/iconv/libcharset/relocatable.c b/subprojects/iconv/libcharset/relocatable.c similarity index 100% rename from vendor/iconv/libcharset/relocatable.c rename to subprojects/iconv/libcharset/relocatable.c diff --git a/vendor/iconv/libcharset/relocatable.h b/subprojects/iconv/libcharset/relocatable.h similarity index 100% rename from vendor/iconv/libcharset/relocatable.h rename to subprojects/iconv/libcharset/relocatable.h diff --git a/vendor/iconv/libiconv/aliases.h b/subprojects/iconv/libiconv/aliases.h similarity index 100% rename from vendor/iconv/libiconv/aliases.h rename to subprojects/iconv/libiconv/aliases.h diff --git a/vendor/iconv/libiconv/aliases2.h b/subprojects/iconv/libiconv/aliases2.h similarity index 100% rename from vendor/iconv/libiconv/aliases2.h rename to subprojects/iconv/libiconv/aliases2.h diff --git a/vendor/iconv/libiconv/aliases_aix.h b/subprojects/iconv/libiconv/aliases_aix.h similarity index 100% rename from vendor/iconv/libiconv/aliases_aix.h rename to subprojects/iconv/libiconv/aliases_aix.h diff --git a/vendor/iconv/libiconv/aliases_aix_sysaix.h b/subprojects/iconv/libiconv/aliases_aix_sysaix.h similarity index 100% rename from vendor/iconv/libiconv/aliases_aix_sysaix.h rename to subprojects/iconv/libiconv/aliases_aix_sysaix.h diff --git a/vendor/iconv/libiconv/aliases_dos.h b/subprojects/iconv/libiconv/aliases_dos.h similarity index 100% rename from vendor/iconv/libiconv/aliases_dos.h rename to subprojects/iconv/libiconv/aliases_dos.h diff --git a/vendor/iconv/libiconv/aliases_extra.h b/subprojects/iconv/libiconv/aliases_extra.h similarity index 100% rename from vendor/iconv/libiconv/aliases_extra.h rename to subprojects/iconv/libiconv/aliases_extra.h diff --git a/vendor/iconv/libiconv/aliases_osf1.h b/subprojects/iconv/libiconv/aliases_osf1.h similarity index 100% rename from vendor/iconv/libiconv/aliases_osf1.h rename to subprojects/iconv/libiconv/aliases_osf1.h diff --git a/vendor/iconv/libiconv/aliases_osf1_sysosf1.h b/subprojects/iconv/libiconv/aliases_osf1_sysosf1.h similarity index 100% rename from vendor/iconv/libiconv/aliases_osf1_sysosf1.h rename to subprojects/iconv/libiconv/aliases_osf1_sysosf1.h diff --git a/vendor/iconv/libiconv/aliases_sysaix.h b/subprojects/iconv/libiconv/aliases_sysaix.h similarity index 100% rename from vendor/iconv/libiconv/aliases_sysaix.h rename to subprojects/iconv/libiconv/aliases_sysaix.h diff --git a/vendor/iconv/libiconv/aliases_syshpux.h b/subprojects/iconv/libiconv/aliases_syshpux.h similarity index 100% rename from vendor/iconv/libiconv/aliases_syshpux.h rename to subprojects/iconv/libiconv/aliases_syshpux.h diff --git a/vendor/iconv/libiconv/aliases_sysosf1.h b/subprojects/iconv/libiconv/aliases_sysosf1.h similarity index 100% rename from vendor/iconv/libiconv/aliases_sysosf1.h rename to subprojects/iconv/libiconv/aliases_sysosf1.h diff --git a/vendor/iconv/libiconv/aliases_syssolaris.h b/subprojects/iconv/libiconv/aliases_syssolaris.h similarity index 100% rename from vendor/iconv/libiconv/aliases_syssolaris.h rename to subprojects/iconv/libiconv/aliases_syssolaris.h diff --git a/vendor/iconv/libiconv/armscii_8.h b/subprojects/iconv/libiconv/armscii_8.h similarity index 100% rename from vendor/iconv/libiconv/armscii_8.h rename to subprojects/iconv/libiconv/armscii_8.h diff --git a/vendor/iconv/libiconv/ascii.h b/subprojects/iconv/libiconv/ascii.h similarity index 100% rename from vendor/iconv/libiconv/ascii.h rename to subprojects/iconv/libiconv/ascii.h diff --git a/vendor/iconv/libiconv/atarist.h b/subprojects/iconv/libiconv/atarist.h similarity index 100% rename from vendor/iconv/libiconv/atarist.h rename to subprojects/iconv/libiconv/atarist.h diff --git a/vendor/iconv/libiconv/big5.h b/subprojects/iconv/libiconv/big5.h similarity index 100% rename from vendor/iconv/libiconv/big5.h rename to subprojects/iconv/libiconv/big5.h diff --git a/vendor/iconv/libiconv/big5_2003.h b/subprojects/iconv/libiconv/big5_2003.h similarity index 100% rename from vendor/iconv/libiconv/big5_2003.h rename to subprojects/iconv/libiconv/big5_2003.h diff --git a/vendor/iconv/libiconv/big5hkscs1999.h b/subprojects/iconv/libiconv/big5hkscs1999.h similarity index 100% rename from vendor/iconv/libiconv/big5hkscs1999.h rename to subprojects/iconv/libiconv/big5hkscs1999.h diff --git a/vendor/iconv/libiconv/big5hkscs2001.h b/subprojects/iconv/libiconv/big5hkscs2001.h similarity index 100% rename from vendor/iconv/libiconv/big5hkscs2001.h rename to subprojects/iconv/libiconv/big5hkscs2001.h diff --git a/vendor/iconv/libiconv/big5hkscs2004.h b/subprojects/iconv/libiconv/big5hkscs2004.h similarity index 100% rename from vendor/iconv/libiconv/big5hkscs2004.h rename to subprojects/iconv/libiconv/big5hkscs2004.h diff --git a/vendor/iconv/libiconv/c99.h b/subprojects/iconv/libiconv/c99.h similarity index 100% rename from vendor/iconv/libiconv/c99.h rename to subprojects/iconv/libiconv/c99.h diff --git a/vendor/iconv/libiconv/canonical.h b/subprojects/iconv/libiconv/canonical.h similarity index 100% rename from vendor/iconv/libiconv/canonical.h rename to subprojects/iconv/libiconv/canonical.h diff --git a/vendor/iconv/libiconv/canonical_aix.h b/subprojects/iconv/libiconv/canonical_aix.h similarity index 100% rename from vendor/iconv/libiconv/canonical_aix.h rename to subprojects/iconv/libiconv/canonical_aix.h diff --git a/vendor/iconv/libiconv/canonical_aix_sysaix.h b/subprojects/iconv/libiconv/canonical_aix_sysaix.h similarity index 100% rename from vendor/iconv/libiconv/canonical_aix_sysaix.h rename to subprojects/iconv/libiconv/canonical_aix_sysaix.h diff --git a/vendor/iconv/libiconv/canonical_dos.h b/subprojects/iconv/libiconv/canonical_dos.h similarity index 100% rename from vendor/iconv/libiconv/canonical_dos.h rename to subprojects/iconv/libiconv/canonical_dos.h diff --git a/vendor/iconv/libiconv/canonical_extra.h b/subprojects/iconv/libiconv/canonical_extra.h similarity index 100% rename from vendor/iconv/libiconv/canonical_extra.h rename to subprojects/iconv/libiconv/canonical_extra.h diff --git a/vendor/iconv/libiconv/canonical_local.h b/subprojects/iconv/libiconv/canonical_local.h similarity index 100% rename from vendor/iconv/libiconv/canonical_local.h rename to subprojects/iconv/libiconv/canonical_local.h diff --git a/vendor/iconv/libiconv/canonical_local_sysaix.h b/subprojects/iconv/libiconv/canonical_local_sysaix.h similarity index 100% rename from vendor/iconv/libiconv/canonical_local_sysaix.h rename to subprojects/iconv/libiconv/canonical_local_sysaix.h diff --git a/vendor/iconv/libiconv/canonical_local_syshpux.h b/subprojects/iconv/libiconv/canonical_local_syshpux.h similarity index 100% rename from vendor/iconv/libiconv/canonical_local_syshpux.h rename to subprojects/iconv/libiconv/canonical_local_syshpux.h diff --git a/vendor/iconv/libiconv/canonical_local_sysosf1.h b/subprojects/iconv/libiconv/canonical_local_sysosf1.h similarity index 100% rename from vendor/iconv/libiconv/canonical_local_sysosf1.h rename to subprojects/iconv/libiconv/canonical_local_sysosf1.h diff --git a/vendor/iconv/libiconv/canonical_local_syssolaris.h b/subprojects/iconv/libiconv/canonical_local_syssolaris.h similarity index 100% rename from vendor/iconv/libiconv/canonical_local_syssolaris.h rename to subprojects/iconv/libiconv/canonical_local_syssolaris.h diff --git a/vendor/iconv/libiconv/canonical_osf1.h b/subprojects/iconv/libiconv/canonical_osf1.h similarity index 100% rename from vendor/iconv/libiconv/canonical_osf1.h rename to subprojects/iconv/libiconv/canonical_osf1.h diff --git a/vendor/iconv/libiconv/canonical_osf1_sysosf1.h b/subprojects/iconv/libiconv/canonical_osf1_sysosf1.h similarity index 100% rename from vendor/iconv/libiconv/canonical_osf1_sysosf1.h rename to subprojects/iconv/libiconv/canonical_osf1_sysosf1.h diff --git a/vendor/iconv/libiconv/canonical_sysaix.h b/subprojects/iconv/libiconv/canonical_sysaix.h similarity index 100% rename from vendor/iconv/libiconv/canonical_sysaix.h rename to subprojects/iconv/libiconv/canonical_sysaix.h diff --git a/vendor/iconv/libiconv/canonical_syshpux.h b/subprojects/iconv/libiconv/canonical_syshpux.h similarity index 100% rename from vendor/iconv/libiconv/canonical_syshpux.h rename to subprojects/iconv/libiconv/canonical_syshpux.h diff --git a/vendor/iconv/libiconv/canonical_sysosf1.h b/subprojects/iconv/libiconv/canonical_sysosf1.h similarity index 100% rename from vendor/iconv/libiconv/canonical_sysosf1.h rename to subprojects/iconv/libiconv/canonical_sysosf1.h diff --git a/vendor/iconv/libiconv/canonical_syssolaris.h b/subprojects/iconv/libiconv/canonical_syssolaris.h similarity index 100% rename from vendor/iconv/libiconv/canonical_syssolaris.h rename to subprojects/iconv/libiconv/canonical_syssolaris.h diff --git a/vendor/iconv/libiconv/ces_big5.h b/subprojects/iconv/libiconv/ces_big5.h similarity index 100% rename from vendor/iconv/libiconv/ces_big5.h rename to subprojects/iconv/libiconv/ces_big5.h diff --git a/vendor/iconv/libiconv/ces_gbk.h b/subprojects/iconv/libiconv/ces_gbk.h similarity index 100% rename from vendor/iconv/libiconv/ces_gbk.h rename to subprojects/iconv/libiconv/ces_gbk.h diff --git a/vendor/iconv/libiconv/charset.alias b/subprojects/iconv/libiconv/charset.alias similarity index 100% rename from vendor/iconv/libiconv/charset.alias rename to subprojects/iconv/libiconv/charset.alias diff --git a/vendor/iconv/libiconv/cjk_variants.h b/subprojects/iconv/libiconv/cjk_variants.h similarity index 100% rename from vendor/iconv/libiconv/cjk_variants.h rename to subprojects/iconv/libiconv/cjk_variants.h diff --git a/vendor/iconv/libiconv/cns11643.h b/subprojects/iconv/libiconv/cns11643.h similarity index 100% rename from vendor/iconv/libiconv/cns11643.h rename to subprojects/iconv/libiconv/cns11643.h diff --git a/vendor/iconv/libiconv/cns11643_1.h b/subprojects/iconv/libiconv/cns11643_1.h similarity index 100% rename from vendor/iconv/libiconv/cns11643_1.h rename to subprojects/iconv/libiconv/cns11643_1.h diff --git a/vendor/iconv/libiconv/cns11643_15.h b/subprojects/iconv/libiconv/cns11643_15.h similarity index 100% rename from vendor/iconv/libiconv/cns11643_15.h rename to subprojects/iconv/libiconv/cns11643_15.h diff --git a/vendor/iconv/libiconv/cns11643_2.h b/subprojects/iconv/libiconv/cns11643_2.h similarity index 100% rename from vendor/iconv/libiconv/cns11643_2.h rename to subprojects/iconv/libiconv/cns11643_2.h diff --git a/vendor/iconv/libiconv/cns11643_3.h b/subprojects/iconv/libiconv/cns11643_3.h similarity index 100% rename from vendor/iconv/libiconv/cns11643_3.h rename to subprojects/iconv/libiconv/cns11643_3.h diff --git a/vendor/iconv/libiconv/cns11643_4.h b/subprojects/iconv/libiconv/cns11643_4.h similarity index 100% rename from vendor/iconv/libiconv/cns11643_4.h rename to subprojects/iconv/libiconv/cns11643_4.h diff --git a/vendor/iconv/libiconv/cns11643_4a.h b/subprojects/iconv/libiconv/cns11643_4a.h similarity index 100% rename from vendor/iconv/libiconv/cns11643_4a.h rename to subprojects/iconv/libiconv/cns11643_4a.h diff --git a/vendor/iconv/libiconv/cns11643_4b.h b/subprojects/iconv/libiconv/cns11643_4b.h similarity index 100% rename from vendor/iconv/libiconv/cns11643_4b.h rename to subprojects/iconv/libiconv/cns11643_4b.h diff --git a/vendor/iconv/libiconv/cns11643_5.h b/subprojects/iconv/libiconv/cns11643_5.h similarity index 100% rename from vendor/iconv/libiconv/cns11643_5.h rename to subprojects/iconv/libiconv/cns11643_5.h diff --git a/vendor/iconv/libiconv/cns11643_6.h b/subprojects/iconv/libiconv/cns11643_6.h similarity index 100% rename from vendor/iconv/libiconv/cns11643_6.h rename to subprojects/iconv/libiconv/cns11643_6.h diff --git a/vendor/iconv/libiconv/cns11643_7.h b/subprojects/iconv/libiconv/cns11643_7.h similarity index 100% rename from vendor/iconv/libiconv/cns11643_7.h rename to subprojects/iconv/libiconv/cns11643_7.h diff --git a/vendor/iconv/libiconv/cns11643_inv.h b/subprojects/iconv/libiconv/cns11643_inv.h similarity index 100% rename from vendor/iconv/libiconv/cns11643_inv.h rename to subprojects/iconv/libiconv/cns11643_inv.h diff --git a/vendor/iconv/libiconv/config.h b/subprojects/iconv/libiconv/config.h similarity index 100% rename from vendor/iconv/libiconv/config.h rename to subprojects/iconv/libiconv/config.h diff --git a/vendor/iconv/libiconv/converters.h b/subprojects/iconv/libiconv/converters.h similarity index 100% rename from vendor/iconv/libiconv/converters.h rename to subprojects/iconv/libiconv/converters.h diff --git a/vendor/iconv/libiconv/cp1046.h b/subprojects/iconv/libiconv/cp1046.h similarity index 100% rename from vendor/iconv/libiconv/cp1046.h rename to subprojects/iconv/libiconv/cp1046.h diff --git a/vendor/iconv/libiconv/cp1124.h b/subprojects/iconv/libiconv/cp1124.h similarity index 100% rename from vendor/iconv/libiconv/cp1124.h rename to subprojects/iconv/libiconv/cp1124.h diff --git a/vendor/iconv/libiconv/cp1125.h b/subprojects/iconv/libiconv/cp1125.h similarity index 100% rename from vendor/iconv/libiconv/cp1125.h rename to subprojects/iconv/libiconv/cp1125.h diff --git a/vendor/iconv/libiconv/cp1129.h b/subprojects/iconv/libiconv/cp1129.h similarity index 100% rename from vendor/iconv/libiconv/cp1129.h rename to subprojects/iconv/libiconv/cp1129.h diff --git a/vendor/iconv/libiconv/cp1131.h b/subprojects/iconv/libiconv/cp1131.h similarity index 100% rename from vendor/iconv/libiconv/cp1131.h rename to subprojects/iconv/libiconv/cp1131.h diff --git a/vendor/iconv/libiconv/cp1133.h b/subprojects/iconv/libiconv/cp1133.h similarity index 100% rename from vendor/iconv/libiconv/cp1133.h rename to subprojects/iconv/libiconv/cp1133.h diff --git a/vendor/iconv/libiconv/cp1161.h b/subprojects/iconv/libiconv/cp1161.h similarity index 100% rename from vendor/iconv/libiconv/cp1161.h rename to subprojects/iconv/libiconv/cp1161.h diff --git a/vendor/iconv/libiconv/cp1162.h b/subprojects/iconv/libiconv/cp1162.h similarity index 100% rename from vendor/iconv/libiconv/cp1162.h rename to subprojects/iconv/libiconv/cp1162.h diff --git a/vendor/iconv/libiconv/cp1163.h b/subprojects/iconv/libiconv/cp1163.h similarity index 100% rename from vendor/iconv/libiconv/cp1163.h rename to subprojects/iconv/libiconv/cp1163.h diff --git a/vendor/iconv/libiconv/cp1250.h b/subprojects/iconv/libiconv/cp1250.h similarity index 100% rename from vendor/iconv/libiconv/cp1250.h rename to subprojects/iconv/libiconv/cp1250.h diff --git a/vendor/iconv/libiconv/cp1251.h b/subprojects/iconv/libiconv/cp1251.h similarity index 100% rename from vendor/iconv/libiconv/cp1251.h rename to subprojects/iconv/libiconv/cp1251.h diff --git a/vendor/iconv/libiconv/cp1252.h b/subprojects/iconv/libiconv/cp1252.h similarity index 100% rename from vendor/iconv/libiconv/cp1252.h rename to subprojects/iconv/libiconv/cp1252.h diff --git a/vendor/iconv/libiconv/cp1253.h b/subprojects/iconv/libiconv/cp1253.h similarity index 100% rename from vendor/iconv/libiconv/cp1253.h rename to subprojects/iconv/libiconv/cp1253.h diff --git a/vendor/iconv/libiconv/cp1254.h b/subprojects/iconv/libiconv/cp1254.h similarity index 100% rename from vendor/iconv/libiconv/cp1254.h rename to subprojects/iconv/libiconv/cp1254.h diff --git a/vendor/iconv/libiconv/cp1255.h b/subprojects/iconv/libiconv/cp1255.h similarity index 100% rename from vendor/iconv/libiconv/cp1255.h rename to subprojects/iconv/libiconv/cp1255.h diff --git a/vendor/iconv/libiconv/cp1256.h b/subprojects/iconv/libiconv/cp1256.h similarity index 100% rename from vendor/iconv/libiconv/cp1256.h rename to subprojects/iconv/libiconv/cp1256.h diff --git a/vendor/iconv/libiconv/cp1257.h b/subprojects/iconv/libiconv/cp1257.h similarity index 100% rename from vendor/iconv/libiconv/cp1257.h rename to subprojects/iconv/libiconv/cp1257.h diff --git a/vendor/iconv/libiconv/cp1258.h b/subprojects/iconv/libiconv/cp1258.h similarity index 100% rename from vendor/iconv/libiconv/cp1258.h rename to subprojects/iconv/libiconv/cp1258.h diff --git a/vendor/iconv/libiconv/cp437.h b/subprojects/iconv/libiconv/cp437.h similarity index 100% rename from vendor/iconv/libiconv/cp437.h rename to subprojects/iconv/libiconv/cp437.h diff --git a/vendor/iconv/libiconv/cp737.h b/subprojects/iconv/libiconv/cp737.h similarity index 100% rename from vendor/iconv/libiconv/cp737.h rename to subprojects/iconv/libiconv/cp737.h diff --git a/vendor/iconv/libiconv/cp775.h b/subprojects/iconv/libiconv/cp775.h similarity index 100% rename from vendor/iconv/libiconv/cp775.h rename to subprojects/iconv/libiconv/cp775.h diff --git a/vendor/iconv/libiconv/cp850.h b/subprojects/iconv/libiconv/cp850.h similarity index 100% rename from vendor/iconv/libiconv/cp850.h rename to subprojects/iconv/libiconv/cp850.h diff --git a/vendor/iconv/libiconv/cp852.h b/subprojects/iconv/libiconv/cp852.h similarity index 100% rename from vendor/iconv/libiconv/cp852.h rename to subprojects/iconv/libiconv/cp852.h diff --git a/vendor/iconv/libiconv/cp853.h b/subprojects/iconv/libiconv/cp853.h similarity index 100% rename from vendor/iconv/libiconv/cp853.h rename to subprojects/iconv/libiconv/cp853.h diff --git a/vendor/iconv/libiconv/cp855.h b/subprojects/iconv/libiconv/cp855.h similarity index 100% rename from vendor/iconv/libiconv/cp855.h rename to subprojects/iconv/libiconv/cp855.h diff --git a/vendor/iconv/libiconv/cp856.h b/subprojects/iconv/libiconv/cp856.h similarity index 100% rename from vendor/iconv/libiconv/cp856.h rename to subprojects/iconv/libiconv/cp856.h diff --git a/vendor/iconv/libiconv/cp857.h b/subprojects/iconv/libiconv/cp857.h similarity index 100% rename from vendor/iconv/libiconv/cp857.h rename to subprojects/iconv/libiconv/cp857.h diff --git a/vendor/iconv/libiconv/cp858.h b/subprojects/iconv/libiconv/cp858.h similarity index 100% rename from vendor/iconv/libiconv/cp858.h rename to subprojects/iconv/libiconv/cp858.h diff --git a/vendor/iconv/libiconv/cp860.h b/subprojects/iconv/libiconv/cp860.h similarity index 100% rename from vendor/iconv/libiconv/cp860.h rename to subprojects/iconv/libiconv/cp860.h diff --git a/vendor/iconv/libiconv/cp861.h b/subprojects/iconv/libiconv/cp861.h similarity index 100% rename from vendor/iconv/libiconv/cp861.h rename to subprojects/iconv/libiconv/cp861.h diff --git a/vendor/iconv/libiconv/cp862.h b/subprojects/iconv/libiconv/cp862.h similarity index 100% rename from vendor/iconv/libiconv/cp862.h rename to subprojects/iconv/libiconv/cp862.h diff --git a/vendor/iconv/libiconv/cp863.h b/subprojects/iconv/libiconv/cp863.h similarity index 100% rename from vendor/iconv/libiconv/cp863.h rename to subprojects/iconv/libiconv/cp863.h diff --git a/vendor/iconv/libiconv/cp864.h b/subprojects/iconv/libiconv/cp864.h similarity index 100% rename from vendor/iconv/libiconv/cp864.h rename to subprojects/iconv/libiconv/cp864.h diff --git a/vendor/iconv/libiconv/cp865.h b/subprojects/iconv/libiconv/cp865.h similarity index 100% rename from vendor/iconv/libiconv/cp865.h rename to subprojects/iconv/libiconv/cp865.h diff --git a/vendor/iconv/libiconv/cp866.h b/subprojects/iconv/libiconv/cp866.h similarity index 100% rename from vendor/iconv/libiconv/cp866.h rename to subprojects/iconv/libiconv/cp866.h diff --git a/vendor/iconv/libiconv/cp869.h b/subprojects/iconv/libiconv/cp869.h similarity index 100% rename from vendor/iconv/libiconv/cp869.h rename to subprojects/iconv/libiconv/cp869.h diff --git a/vendor/iconv/libiconv/cp874.h b/subprojects/iconv/libiconv/cp874.h similarity index 100% rename from vendor/iconv/libiconv/cp874.h rename to subprojects/iconv/libiconv/cp874.h diff --git a/vendor/iconv/libiconv/cp922.h b/subprojects/iconv/libiconv/cp922.h similarity index 100% rename from vendor/iconv/libiconv/cp922.h rename to subprojects/iconv/libiconv/cp922.h diff --git a/vendor/iconv/libiconv/cp932.h b/subprojects/iconv/libiconv/cp932.h similarity index 100% rename from vendor/iconv/libiconv/cp932.h rename to subprojects/iconv/libiconv/cp932.h diff --git a/vendor/iconv/libiconv/cp932ext.h b/subprojects/iconv/libiconv/cp932ext.h similarity index 100% rename from vendor/iconv/libiconv/cp932ext.h rename to subprojects/iconv/libiconv/cp932ext.h diff --git a/vendor/iconv/libiconv/cp936.h b/subprojects/iconv/libiconv/cp936.h similarity index 100% rename from vendor/iconv/libiconv/cp936.h rename to subprojects/iconv/libiconv/cp936.h diff --git a/vendor/iconv/libiconv/cp936ext.h b/subprojects/iconv/libiconv/cp936ext.h similarity index 100% rename from vendor/iconv/libiconv/cp936ext.h rename to subprojects/iconv/libiconv/cp936ext.h diff --git a/vendor/iconv/libiconv/cp943.h b/subprojects/iconv/libiconv/cp943.h similarity index 100% rename from vendor/iconv/libiconv/cp943.h rename to subprojects/iconv/libiconv/cp943.h diff --git a/vendor/iconv/libiconv/cp949.h b/subprojects/iconv/libiconv/cp949.h similarity index 100% rename from vendor/iconv/libiconv/cp949.h rename to subprojects/iconv/libiconv/cp949.h diff --git a/vendor/iconv/libiconv/cp950.h b/subprojects/iconv/libiconv/cp950.h similarity index 100% rename from vendor/iconv/libiconv/cp950.h rename to subprojects/iconv/libiconv/cp950.h diff --git a/vendor/iconv/libiconv/cp950ext.h b/subprojects/iconv/libiconv/cp950ext.h similarity index 100% rename from vendor/iconv/libiconv/cp950ext.h rename to subprojects/iconv/libiconv/cp950ext.h diff --git a/vendor/iconv/libiconv/dec_hanyu.h b/subprojects/iconv/libiconv/dec_hanyu.h similarity index 100% rename from vendor/iconv/libiconv/dec_hanyu.h rename to subprojects/iconv/libiconv/dec_hanyu.h diff --git a/vendor/iconv/libiconv/dec_kanji.h b/subprojects/iconv/libiconv/dec_kanji.h similarity index 100% rename from vendor/iconv/libiconv/dec_kanji.h rename to subprojects/iconv/libiconv/dec_kanji.h diff --git a/vendor/iconv/libiconv/encodings.def b/subprojects/iconv/libiconv/encodings.def similarity index 100% rename from vendor/iconv/libiconv/encodings.def rename to subprojects/iconv/libiconv/encodings.def diff --git a/vendor/iconv/libiconv/encodings_aix.def b/subprojects/iconv/libiconv/encodings_aix.def similarity index 100% rename from vendor/iconv/libiconv/encodings_aix.def rename to subprojects/iconv/libiconv/encodings_aix.def diff --git a/vendor/iconv/libiconv/encodings_dos.def b/subprojects/iconv/libiconv/encodings_dos.def similarity index 100% rename from vendor/iconv/libiconv/encodings_dos.def rename to subprojects/iconv/libiconv/encodings_dos.def diff --git a/vendor/iconv/libiconv/encodings_extra.def b/subprojects/iconv/libiconv/encodings_extra.def similarity index 100% rename from vendor/iconv/libiconv/encodings_extra.def rename to subprojects/iconv/libiconv/encodings_extra.def diff --git a/vendor/iconv/libiconv/encodings_local.def b/subprojects/iconv/libiconv/encodings_local.def similarity index 100% rename from vendor/iconv/libiconv/encodings_local.def rename to subprojects/iconv/libiconv/encodings_local.def diff --git a/vendor/iconv/libiconv/encodings_osf1.def b/subprojects/iconv/libiconv/encodings_osf1.def similarity index 100% rename from vendor/iconv/libiconv/encodings_osf1.def rename to subprojects/iconv/libiconv/encodings_osf1.def diff --git a/vendor/iconv/libiconv/euc_cn.h b/subprojects/iconv/libiconv/euc_cn.h similarity index 100% rename from vendor/iconv/libiconv/euc_cn.h rename to subprojects/iconv/libiconv/euc_cn.h diff --git a/vendor/iconv/libiconv/euc_jisx0213.h b/subprojects/iconv/libiconv/euc_jisx0213.h similarity index 100% rename from vendor/iconv/libiconv/euc_jisx0213.h rename to subprojects/iconv/libiconv/euc_jisx0213.h diff --git a/vendor/iconv/libiconv/euc_jp.h b/subprojects/iconv/libiconv/euc_jp.h similarity index 100% rename from vendor/iconv/libiconv/euc_jp.h rename to subprojects/iconv/libiconv/euc_jp.h diff --git a/vendor/iconv/libiconv/euc_kr.h b/subprojects/iconv/libiconv/euc_kr.h similarity index 100% rename from vendor/iconv/libiconv/euc_kr.h rename to subprojects/iconv/libiconv/euc_kr.h diff --git a/vendor/iconv/libiconv/euc_tw.h b/subprojects/iconv/libiconv/euc_tw.h similarity index 100% rename from vendor/iconv/libiconv/euc_tw.h rename to subprojects/iconv/libiconv/euc_tw.h diff --git a/vendor/iconv/libiconv/flags.h b/subprojects/iconv/libiconv/flags.h similarity index 100% rename from vendor/iconv/libiconv/flags.h rename to subprojects/iconv/libiconv/flags.h diff --git a/vendor/iconv/libiconv/flushwc.h b/subprojects/iconv/libiconv/flushwc.h similarity index 100% rename from vendor/iconv/libiconv/flushwc.h rename to subprojects/iconv/libiconv/flushwc.h diff --git a/vendor/iconv/libiconv/gb12345.h b/subprojects/iconv/libiconv/gb12345.h similarity index 100% rename from vendor/iconv/libiconv/gb12345.h rename to subprojects/iconv/libiconv/gb12345.h diff --git a/vendor/iconv/libiconv/gb12345ext.h b/subprojects/iconv/libiconv/gb12345ext.h similarity index 100% rename from vendor/iconv/libiconv/gb12345ext.h rename to subprojects/iconv/libiconv/gb12345ext.h diff --git a/vendor/iconv/libiconv/gb18030.h b/subprojects/iconv/libiconv/gb18030.h similarity index 100% rename from vendor/iconv/libiconv/gb18030.h rename to subprojects/iconv/libiconv/gb18030.h diff --git a/vendor/iconv/libiconv/gb18030ext.h b/subprojects/iconv/libiconv/gb18030ext.h similarity index 100% rename from vendor/iconv/libiconv/gb18030ext.h rename to subprojects/iconv/libiconv/gb18030ext.h diff --git a/vendor/iconv/libiconv/gb18030uni.h b/subprojects/iconv/libiconv/gb18030uni.h similarity index 100% rename from vendor/iconv/libiconv/gb18030uni.h rename to subprojects/iconv/libiconv/gb18030uni.h diff --git a/vendor/iconv/libiconv/gb2312.h b/subprojects/iconv/libiconv/gb2312.h similarity index 100% rename from vendor/iconv/libiconv/gb2312.h rename to subprojects/iconv/libiconv/gb2312.h diff --git a/vendor/iconv/libiconv/gbk.h b/subprojects/iconv/libiconv/gbk.h similarity index 100% rename from vendor/iconv/libiconv/gbk.h rename to subprojects/iconv/libiconv/gbk.h diff --git a/vendor/iconv/libiconv/gbkext1.h b/subprojects/iconv/libiconv/gbkext1.h similarity index 100% rename from vendor/iconv/libiconv/gbkext1.h rename to subprojects/iconv/libiconv/gbkext1.h diff --git a/vendor/iconv/libiconv/gbkext2.h b/subprojects/iconv/libiconv/gbkext2.h similarity index 100% rename from vendor/iconv/libiconv/gbkext2.h rename to subprojects/iconv/libiconv/gbkext2.h diff --git a/vendor/iconv/libiconv/gbkext_inv.h b/subprojects/iconv/libiconv/gbkext_inv.h similarity index 100% rename from vendor/iconv/libiconv/gbkext_inv.h rename to subprojects/iconv/libiconv/gbkext_inv.h diff --git a/vendor/iconv/libiconv/genaliases.c b/subprojects/iconv/libiconv/genaliases.c similarity index 100% rename from vendor/iconv/libiconv/genaliases.c rename to subprojects/iconv/libiconv/genaliases.c diff --git a/vendor/iconv/libiconv/genaliases2.c b/subprojects/iconv/libiconv/genaliases2.c similarity index 100% rename from vendor/iconv/libiconv/genaliases2.c rename to subprojects/iconv/libiconv/genaliases2.c diff --git a/vendor/iconv/libiconv/genflags.c b/subprojects/iconv/libiconv/genflags.c similarity index 100% rename from vendor/iconv/libiconv/genflags.c rename to subprojects/iconv/libiconv/genflags.c diff --git a/vendor/iconv/libiconv/gentranslit.c b/subprojects/iconv/libiconv/gentranslit.c similarity index 100% rename from vendor/iconv/libiconv/gentranslit.c rename to subprojects/iconv/libiconv/gentranslit.c diff --git a/vendor/iconv/libiconv/georgian_academy.h b/subprojects/iconv/libiconv/georgian_academy.h similarity index 100% rename from vendor/iconv/libiconv/georgian_academy.h rename to subprojects/iconv/libiconv/georgian_academy.h diff --git a/vendor/iconv/libiconv/georgian_ps.h b/subprojects/iconv/libiconv/georgian_ps.h similarity index 100% rename from vendor/iconv/libiconv/georgian_ps.h rename to subprojects/iconv/libiconv/georgian_ps.h diff --git a/vendor/iconv/libiconv/hkscs1999.h b/subprojects/iconv/libiconv/hkscs1999.h similarity index 100% rename from vendor/iconv/libiconv/hkscs1999.h rename to subprojects/iconv/libiconv/hkscs1999.h diff --git a/vendor/iconv/libiconv/hkscs2001.h b/subprojects/iconv/libiconv/hkscs2001.h similarity index 100% rename from vendor/iconv/libiconv/hkscs2001.h rename to subprojects/iconv/libiconv/hkscs2001.h diff --git a/vendor/iconv/libiconv/hkscs2004.h b/subprojects/iconv/libiconv/hkscs2004.h similarity index 100% rename from vendor/iconv/libiconv/hkscs2004.h rename to subprojects/iconv/libiconv/hkscs2004.h diff --git a/vendor/iconv/libiconv/hp_roman8.h b/subprojects/iconv/libiconv/hp_roman8.h similarity index 100% rename from vendor/iconv/libiconv/hp_roman8.h rename to subprojects/iconv/libiconv/hp_roman8.h diff --git a/vendor/iconv/libiconv/hz.h b/subprojects/iconv/libiconv/hz.h similarity index 100% rename from vendor/iconv/libiconv/hz.h rename to subprojects/iconv/libiconv/hz.h diff --git a/vendor/iconv/libiconv/iconv.c b/subprojects/iconv/libiconv/iconv.c similarity index 100% rename from vendor/iconv/libiconv/iconv.c rename to subprojects/iconv/libiconv/iconv.c diff --git a/vendor/iconv/libiconv/iconv_open1.h b/subprojects/iconv/libiconv/iconv_open1.h similarity index 100% rename from vendor/iconv/libiconv/iconv_open1.h rename to subprojects/iconv/libiconv/iconv_open1.h diff --git a/vendor/iconv/libiconv/iconv_open2.h b/subprojects/iconv/libiconv/iconv_open2.h similarity index 100% rename from vendor/iconv/libiconv/iconv_open2.h rename to subprojects/iconv/libiconv/iconv_open2.h diff --git a/vendor/iconv/libiconv/iso2022_cn.h b/subprojects/iconv/libiconv/iso2022_cn.h similarity index 100% rename from vendor/iconv/libiconv/iso2022_cn.h rename to subprojects/iconv/libiconv/iso2022_cn.h diff --git a/vendor/iconv/libiconv/iso2022_cnext.h b/subprojects/iconv/libiconv/iso2022_cnext.h similarity index 100% rename from vendor/iconv/libiconv/iso2022_cnext.h rename to subprojects/iconv/libiconv/iso2022_cnext.h diff --git a/vendor/iconv/libiconv/iso2022_jp.h b/subprojects/iconv/libiconv/iso2022_jp.h similarity index 100% rename from vendor/iconv/libiconv/iso2022_jp.h rename to subprojects/iconv/libiconv/iso2022_jp.h diff --git a/vendor/iconv/libiconv/iso2022_jp1.h b/subprojects/iconv/libiconv/iso2022_jp1.h similarity index 100% rename from vendor/iconv/libiconv/iso2022_jp1.h rename to subprojects/iconv/libiconv/iso2022_jp1.h diff --git a/vendor/iconv/libiconv/iso2022_jp2.h b/subprojects/iconv/libiconv/iso2022_jp2.h similarity index 100% rename from vendor/iconv/libiconv/iso2022_jp2.h rename to subprojects/iconv/libiconv/iso2022_jp2.h diff --git a/vendor/iconv/libiconv/iso2022_jp3.h b/subprojects/iconv/libiconv/iso2022_jp3.h similarity index 100% rename from vendor/iconv/libiconv/iso2022_jp3.h rename to subprojects/iconv/libiconv/iso2022_jp3.h diff --git a/vendor/iconv/libiconv/iso2022_kr.h b/subprojects/iconv/libiconv/iso2022_kr.h similarity index 100% rename from vendor/iconv/libiconv/iso2022_kr.h rename to subprojects/iconv/libiconv/iso2022_kr.h diff --git a/vendor/iconv/libiconv/iso646_cn.h b/subprojects/iconv/libiconv/iso646_cn.h similarity index 100% rename from vendor/iconv/libiconv/iso646_cn.h rename to subprojects/iconv/libiconv/iso646_cn.h diff --git a/vendor/iconv/libiconv/iso646_jp.h b/subprojects/iconv/libiconv/iso646_jp.h similarity index 100% rename from vendor/iconv/libiconv/iso646_jp.h rename to subprojects/iconv/libiconv/iso646_jp.h diff --git a/vendor/iconv/libiconv/iso8859_1.h b/subprojects/iconv/libiconv/iso8859_1.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_1.h rename to subprojects/iconv/libiconv/iso8859_1.h diff --git a/vendor/iconv/libiconv/iso8859_10.h b/subprojects/iconv/libiconv/iso8859_10.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_10.h rename to subprojects/iconv/libiconv/iso8859_10.h diff --git a/vendor/iconv/libiconv/iso8859_11.h b/subprojects/iconv/libiconv/iso8859_11.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_11.h rename to subprojects/iconv/libiconv/iso8859_11.h diff --git a/vendor/iconv/libiconv/iso8859_13.h b/subprojects/iconv/libiconv/iso8859_13.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_13.h rename to subprojects/iconv/libiconv/iso8859_13.h diff --git a/vendor/iconv/libiconv/iso8859_14.h b/subprojects/iconv/libiconv/iso8859_14.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_14.h rename to subprojects/iconv/libiconv/iso8859_14.h diff --git a/vendor/iconv/libiconv/iso8859_15.h b/subprojects/iconv/libiconv/iso8859_15.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_15.h rename to subprojects/iconv/libiconv/iso8859_15.h diff --git a/vendor/iconv/libiconv/iso8859_16.h b/subprojects/iconv/libiconv/iso8859_16.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_16.h rename to subprojects/iconv/libiconv/iso8859_16.h diff --git a/vendor/iconv/libiconv/iso8859_2.h b/subprojects/iconv/libiconv/iso8859_2.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_2.h rename to subprojects/iconv/libiconv/iso8859_2.h diff --git a/vendor/iconv/libiconv/iso8859_3.h b/subprojects/iconv/libiconv/iso8859_3.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_3.h rename to subprojects/iconv/libiconv/iso8859_3.h diff --git a/vendor/iconv/libiconv/iso8859_4.h b/subprojects/iconv/libiconv/iso8859_4.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_4.h rename to subprojects/iconv/libiconv/iso8859_4.h diff --git a/vendor/iconv/libiconv/iso8859_5.h b/subprojects/iconv/libiconv/iso8859_5.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_5.h rename to subprojects/iconv/libiconv/iso8859_5.h diff --git a/vendor/iconv/libiconv/iso8859_6.h b/subprojects/iconv/libiconv/iso8859_6.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_6.h rename to subprojects/iconv/libiconv/iso8859_6.h diff --git a/vendor/iconv/libiconv/iso8859_7.h b/subprojects/iconv/libiconv/iso8859_7.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_7.h rename to subprojects/iconv/libiconv/iso8859_7.h diff --git a/vendor/iconv/libiconv/iso8859_8.h b/subprojects/iconv/libiconv/iso8859_8.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_8.h rename to subprojects/iconv/libiconv/iso8859_8.h diff --git a/vendor/iconv/libiconv/iso8859_9.h b/subprojects/iconv/libiconv/iso8859_9.h similarity index 100% rename from vendor/iconv/libiconv/iso8859_9.h rename to subprojects/iconv/libiconv/iso8859_9.h diff --git a/vendor/iconv/libiconv/isoir165.h b/subprojects/iconv/libiconv/isoir165.h similarity index 100% rename from vendor/iconv/libiconv/isoir165.h rename to subprojects/iconv/libiconv/isoir165.h diff --git a/vendor/iconv/libiconv/isoir165ext.h b/subprojects/iconv/libiconv/isoir165ext.h similarity index 100% rename from vendor/iconv/libiconv/isoir165ext.h rename to subprojects/iconv/libiconv/isoir165ext.h diff --git a/vendor/iconv/libiconv/java.h b/subprojects/iconv/libiconv/java.h similarity index 100% rename from vendor/iconv/libiconv/java.h rename to subprojects/iconv/libiconv/java.h diff --git a/vendor/iconv/libiconv/jisx0201.h b/subprojects/iconv/libiconv/jisx0201.h similarity index 100% rename from vendor/iconv/libiconv/jisx0201.h rename to subprojects/iconv/libiconv/jisx0201.h diff --git a/vendor/iconv/libiconv/jisx0208.h b/subprojects/iconv/libiconv/jisx0208.h similarity index 100% rename from vendor/iconv/libiconv/jisx0208.h rename to subprojects/iconv/libiconv/jisx0208.h diff --git a/vendor/iconv/libiconv/jisx0212.h b/subprojects/iconv/libiconv/jisx0212.h similarity index 100% rename from vendor/iconv/libiconv/jisx0212.h rename to subprojects/iconv/libiconv/jisx0212.h diff --git a/vendor/iconv/libiconv/jisx0213.h b/subprojects/iconv/libiconv/jisx0213.h similarity index 100% rename from vendor/iconv/libiconv/jisx0213.h rename to subprojects/iconv/libiconv/jisx0213.h diff --git a/vendor/iconv/libiconv/johab.h b/subprojects/iconv/libiconv/johab.h similarity index 100% rename from vendor/iconv/libiconv/johab.h rename to subprojects/iconv/libiconv/johab.h diff --git a/vendor/iconv/libiconv/johab_hangul.h b/subprojects/iconv/libiconv/johab_hangul.h similarity index 100% rename from vendor/iconv/libiconv/johab_hangul.h rename to subprojects/iconv/libiconv/johab_hangul.h diff --git a/vendor/iconv/libiconv/koi8_r.h b/subprojects/iconv/libiconv/koi8_r.h similarity index 100% rename from vendor/iconv/libiconv/koi8_r.h rename to subprojects/iconv/libiconv/koi8_r.h diff --git a/vendor/iconv/libiconv/koi8_ru.h b/subprojects/iconv/libiconv/koi8_ru.h similarity index 100% rename from vendor/iconv/libiconv/koi8_ru.h rename to subprojects/iconv/libiconv/koi8_ru.h diff --git a/vendor/iconv/libiconv/koi8_t.h b/subprojects/iconv/libiconv/koi8_t.h similarity index 100% rename from vendor/iconv/libiconv/koi8_t.h rename to subprojects/iconv/libiconv/koi8_t.h diff --git a/vendor/iconv/libiconv/koi8_u.h b/subprojects/iconv/libiconv/koi8_u.h similarity index 100% rename from vendor/iconv/libiconv/koi8_u.h rename to subprojects/iconv/libiconv/koi8_u.h diff --git a/vendor/iconv/libiconv/ksc5601.h b/subprojects/iconv/libiconv/ksc5601.h similarity index 100% rename from vendor/iconv/libiconv/ksc5601.h rename to subprojects/iconv/libiconv/ksc5601.h diff --git a/vendor/iconv/libiconv/libcharset.h b/subprojects/iconv/libiconv/libcharset.h similarity index 100% rename from vendor/iconv/libiconv/libcharset.h rename to subprojects/iconv/libiconv/libcharset.h diff --git a/vendor/iconv/libiconv/localcharset.h b/subprojects/iconv/libiconv/localcharset.h similarity index 100% rename from vendor/iconv/libiconv/localcharset.h rename to subprojects/iconv/libiconv/localcharset.h diff --git a/vendor/iconv/libiconv/loop_unicode.h b/subprojects/iconv/libiconv/loop_unicode.h similarity index 100% rename from vendor/iconv/libiconv/loop_unicode.h rename to subprojects/iconv/libiconv/loop_unicode.h diff --git a/vendor/iconv/libiconv/loop_wchar.h b/subprojects/iconv/libiconv/loop_wchar.h similarity index 100% rename from vendor/iconv/libiconv/loop_wchar.h rename to subprojects/iconv/libiconv/loop_wchar.h diff --git a/vendor/iconv/libiconv/loops.h b/subprojects/iconv/libiconv/loops.h similarity index 100% rename from vendor/iconv/libiconv/loops.h rename to subprojects/iconv/libiconv/loops.h diff --git a/vendor/iconv/libiconv/mac_arabic.h b/subprojects/iconv/libiconv/mac_arabic.h similarity index 100% rename from vendor/iconv/libiconv/mac_arabic.h rename to subprojects/iconv/libiconv/mac_arabic.h diff --git a/vendor/iconv/libiconv/mac_centraleurope.h b/subprojects/iconv/libiconv/mac_centraleurope.h similarity index 100% rename from vendor/iconv/libiconv/mac_centraleurope.h rename to subprojects/iconv/libiconv/mac_centraleurope.h diff --git a/vendor/iconv/libiconv/mac_croatian.h b/subprojects/iconv/libiconv/mac_croatian.h similarity index 100% rename from vendor/iconv/libiconv/mac_croatian.h rename to subprojects/iconv/libiconv/mac_croatian.h diff --git a/vendor/iconv/libiconv/mac_cyrillic.h b/subprojects/iconv/libiconv/mac_cyrillic.h similarity index 100% rename from vendor/iconv/libiconv/mac_cyrillic.h rename to subprojects/iconv/libiconv/mac_cyrillic.h diff --git a/vendor/iconv/libiconv/mac_greek.h b/subprojects/iconv/libiconv/mac_greek.h similarity index 100% rename from vendor/iconv/libiconv/mac_greek.h rename to subprojects/iconv/libiconv/mac_greek.h diff --git a/vendor/iconv/libiconv/mac_hebrew.h b/subprojects/iconv/libiconv/mac_hebrew.h similarity index 100% rename from vendor/iconv/libiconv/mac_hebrew.h rename to subprojects/iconv/libiconv/mac_hebrew.h diff --git a/vendor/iconv/libiconv/mac_iceland.h b/subprojects/iconv/libiconv/mac_iceland.h similarity index 100% rename from vendor/iconv/libiconv/mac_iceland.h rename to subprojects/iconv/libiconv/mac_iceland.h diff --git a/vendor/iconv/libiconv/mac_roman.h b/subprojects/iconv/libiconv/mac_roman.h similarity index 100% rename from vendor/iconv/libiconv/mac_roman.h rename to subprojects/iconv/libiconv/mac_roman.h diff --git a/vendor/iconv/libiconv/mac_romania.h b/subprojects/iconv/libiconv/mac_romania.h similarity index 100% rename from vendor/iconv/libiconv/mac_romania.h rename to subprojects/iconv/libiconv/mac_romania.h diff --git a/vendor/iconv/libiconv/mac_thai.h b/subprojects/iconv/libiconv/mac_thai.h similarity index 100% rename from vendor/iconv/libiconv/mac_thai.h rename to subprojects/iconv/libiconv/mac_thai.h diff --git a/vendor/iconv/libiconv/mac_turkish.h b/subprojects/iconv/libiconv/mac_turkish.h similarity index 100% rename from vendor/iconv/libiconv/mac_turkish.h rename to subprojects/iconv/libiconv/mac_turkish.h diff --git a/vendor/iconv/libiconv/mac_ukraine.h b/subprojects/iconv/libiconv/mac_ukraine.h similarity index 100% rename from vendor/iconv/libiconv/mac_ukraine.h rename to subprojects/iconv/libiconv/mac_ukraine.h diff --git a/vendor/iconv/libiconv/mulelao.h b/subprojects/iconv/libiconv/mulelao.h similarity index 100% rename from vendor/iconv/libiconv/mulelao.h rename to subprojects/iconv/libiconv/mulelao.h diff --git a/vendor/iconv/libiconv/nextstep.h b/subprojects/iconv/libiconv/nextstep.h similarity index 100% rename from vendor/iconv/libiconv/nextstep.h rename to subprojects/iconv/libiconv/nextstep.h diff --git a/vendor/iconv/libiconv/pt154.h b/subprojects/iconv/libiconv/pt154.h similarity index 100% rename from vendor/iconv/libiconv/pt154.h rename to subprojects/iconv/libiconv/pt154.h diff --git a/vendor/iconv/libiconv/relocatable.c b/subprojects/iconv/libiconv/relocatable.c similarity index 100% rename from vendor/iconv/libiconv/relocatable.c rename to subprojects/iconv/libiconv/relocatable.c diff --git a/vendor/iconv/libiconv/relocatable.h b/subprojects/iconv/libiconv/relocatable.h similarity index 100% rename from vendor/iconv/libiconv/relocatable.h rename to subprojects/iconv/libiconv/relocatable.h diff --git a/vendor/iconv/libiconv/riscos1.h b/subprojects/iconv/libiconv/riscos1.h similarity index 100% rename from vendor/iconv/libiconv/riscos1.h rename to subprojects/iconv/libiconv/riscos1.h diff --git a/vendor/iconv/libiconv/rk1048.h b/subprojects/iconv/libiconv/rk1048.h similarity index 100% rename from vendor/iconv/libiconv/rk1048.h rename to subprojects/iconv/libiconv/rk1048.h diff --git a/vendor/iconv/libiconv/shift_jisx0213.h b/subprojects/iconv/libiconv/shift_jisx0213.h similarity index 100% rename from vendor/iconv/libiconv/shift_jisx0213.h rename to subprojects/iconv/libiconv/shift_jisx0213.h diff --git a/vendor/iconv/libiconv/sjis.h b/subprojects/iconv/libiconv/sjis.h similarity index 100% rename from vendor/iconv/libiconv/sjis.h rename to subprojects/iconv/libiconv/sjis.h diff --git a/vendor/iconv/libiconv/tcvn.h b/subprojects/iconv/libiconv/tcvn.h similarity index 100% rename from vendor/iconv/libiconv/tcvn.h rename to subprojects/iconv/libiconv/tcvn.h diff --git a/vendor/iconv/libiconv/tds565.h b/subprojects/iconv/libiconv/tds565.h similarity index 100% rename from vendor/iconv/libiconv/tds565.h rename to subprojects/iconv/libiconv/tds565.h diff --git a/vendor/iconv/libiconv/tis620.h b/subprojects/iconv/libiconv/tis620.h similarity index 100% rename from vendor/iconv/libiconv/tis620.h rename to subprojects/iconv/libiconv/tis620.h diff --git a/vendor/iconv/libiconv/translit.h b/subprojects/iconv/libiconv/translit.h similarity index 100% rename from vendor/iconv/libiconv/translit.h rename to subprojects/iconv/libiconv/translit.h diff --git a/vendor/iconv/libiconv/ucs2.h b/subprojects/iconv/libiconv/ucs2.h similarity index 100% rename from vendor/iconv/libiconv/ucs2.h rename to subprojects/iconv/libiconv/ucs2.h diff --git a/vendor/iconv/libiconv/ucs2be.h b/subprojects/iconv/libiconv/ucs2be.h similarity index 100% rename from vendor/iconv/libiconv/ucs2be.h rename to subprojects/iconv/libiconv/ucs2be.h diff --git a/vendor/iconv/libiconv/ucs2internal.h b/subprojects/iconv/libiconv/ucs2internal.h similarity index 100% rename from vendor/iconv/libiconv/ucs2internal.h rename to subprojects/iconv/libiconv/ucs2internal.h diff --git a/vendor/iconv/libiconv/ucs2le.h b/subprojects/iconv/libiconv/ucs2le.h similarity index 100% rename from vendor/iconv/libiconv/ucs2le.h rename to subprojects/iconv/libiconv/ucs2le.h diff --git a/vendor/iconv/libiconv/ucs2swapped.h b/subprojects/iconv/libiconv/ucs2swapped.h similarity index 100% rename from vendor/iconv/libiconv/ucs2swapped.h rename to subprojects/iconv/libiconv/ucs2swapped.h diff --git a/vendor/iconv/libiconv/ucs4.h b/subprojects/iconv/libiconv/ucs4.h similarity index 100% rename from vendor/iconv/libiconv/ucs4.h rename to subprojects/iconv/libiconv/ucs4.h diff --git a/vendor/iconv/libiconv/ucs4be.h b/subprojects/iconv/libiconv/ucs4be.h similarity index 100% rename from vendor/iconv/libiconv/ucs4be.h rename to subprojects/iconv/libiconv/ucs4be.h diff --git a/vendor/iconv/libiconv/ucs4internal.h b/subprojects/iconv/libiconv/ucs4internal.h similarity index 100% rename from vendor/iconv/libiconv/ucs4internal.h rename to subprojects/iconv/libiconv/ucs4internal.h diff --git a/vendor/iconv/libiconv/ucs4le.h b/subprojects/iconv/libiconv/ucs4le.h similarity index 100% rename from vendor/iconv/libiconv/ucs4le.h rename to subprojects/iconv/libiconv/ucs4le.h diff --git a/vendor/iconv/libiconv/ucs4swapped.h b/subprojects/iconv/libiconv/ucs4swapped.h similarity index 100% rename from vendor/iconv/libiconv/ucs4swapped.h rename to subprojects/iconv/libiconv/ucs4swapped.h diff --git a/vendor/iconv/libiconv/uhc_1.h b/subprojects/iconv/libiconv/uhc_1.h similarity index 100% rename from vendor/iconv/libiconv/uhc_1.h rename to subprojects/iconv/libiconv/uhc_1.h diff --git a/vendor/iconv/libiconv/uhc_2.h b/subprojects/iconv/libiconv/uhc_2.h similarity index 100% rename from vendor/iconv/libiconv/uhc_2.h rename to subprojects/iconv/libiconv/uhc_2.h diff --git a/vendor/iconv/libiconv/utf16.h b/subprojects/iconv/libiconv/utf16.h similarity index 100% rename from vendor/iconv/libiconv/utf16.h rename to subprojects/iconv/libiconv/utf16.h diff --git a/vendor/iconv/libiconv/utf16be.h b/subprojects/iconv/libiconv/utf16be.h similarity index 100% rename from vendor/iconv/libiconv/utf16be.h rename to subprojects/iconv/libiconv/utf16be.h diff --git a/vendor/iconv/libiconv/utf16le.h b/subprojects/iconv/libiconv/utf16le.h similarity index 100% rename from vendor/iconv/libiconv/utf16le.h rename to subprojects/iconv/libiconv/utf16le.h diff --git a/vendor/iconv/libiconv/utf32.h b/subprojects/iconv/libiconv/utf32.h similarity index 100% rename from vendor/iconv/libiconv/utf32.h rename to subprojects/iconv/libiconv/utf32.h diff --git a/vendor/iconv/libiconv/utf32be.h b/subprojects/iconv/libiconv/utf32be.h similarity index 100% rename from vendor/iconv/libiconv/utf32be.h rename to subprojects/iconv/libiconv/utf32be.h diff --git a/vendor/iconv/libiconv/utf32le.h b/subprojects/iconv/libiconv/utf32le.h similarity index 100% rename from vendor/iconv/libiconv/utf32le.h rename to subprojects/iconv/libiconv/utf32le.h diff --git a/vendor/iconv/libiconv/utf7.h b/subprojects/iconv/libiconv/utf7.h similarity index 100% rename from vendor/iconv/libiconv/utf7.h rename to subprojects/iconv/libiconv/utf7.h diff --git a/vendor/iconv/libiconv/utf8.h b/subprojects/iconv/libiconv/utf8.h similarity index 100% rename from vendor/iconv/libiconv/utf8.h rename to subprojects/iconv/libiconv/utf8.h diff --git a/vendor/iconv/libiconv/vietcomb.h b/subprojects/iconv/libiconv/vietcomb.h similarity index 100% rename from vendor/iconv/libiconv/vietcomb.h rename to subprojects/iconv/libiconv/vietcomb.h diff --git a/vendor/iconv/libiconv/viscii.h b/subprojects/iconv/libiconv/viscii.h similarity index 100% rename from vendor/iconv/libiconv/viscii.h rename to subprojects/iconv/libiconv/viscii.h From 631dad170fc10ef965108fa33cd88c637b143ed8 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 17 Feb 2019 12:22:30 -0500 Subject: [PATCH 098/271] meson: fix luajit compiler args --- subprojects/luajit/meson.build | 15 ++++++--------- subprojects/luajit/src/host/meson.build | 4 ++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/subprojects/luajit/meson.build b/subprojects/luajit/meson.build index 38b2f9743..2a838bd18 100644 --- a/subprojects/luajit/meson.build +++ b/subprojects/luajit/meson.build @@ -7,25 +7,22 @@ system_deps = [ cc.find_library('m', required: false) ] -system_deps_native = [ - cc.find_library('dl', required: false, native: true), - cc.find_library('m', required: false, native: true) -] - add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', language: 'c') if host_machine.system() == 'linux' - add_project_arguments('-DLUAJIT_USE_LINUX', language: 'c') + add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_LINUX', language: 'c') readline_dep = cc.find_library('readline') ljvm_mode = 'elfasm' ljvm_bout = 'lj_vm.s' elif host_machine.system() == 'darwin' - add_project_arguments(['-DLUAJIT_USE_MACOSX'], language: 'c') + add_project_arguments(['-DLUAJIT_OS=LUAJIT_OS_OSX'], language: 'c') readline_dep = cc.find_library('readline') ljvm_mode = 'machasm' ljvm_bout = 'lj_vm.s' elif host_machine.system() == 'windows' - add_project_arguments('-DLUAJIT_USE_WINDOWS', '-DWIN', - '-malign-double', language: 'c') + add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_WINDOWS', language: 'c') + if cc.get_id() != 'msvc' + add_project_arguments('-malign-double', language: 'c') + endif readline_dep = [] ljvm_mode = 'peobj' ljvm_bout = 'lj_vm.o' diff --git a/subprojects/luajit/src/host/meson.build b/subprojects/luajit/src/host/meson.build index eca091c46..d6ae5c943 100644 --- a/subprojects/luajit/src/host/meson.build +++ b/subprojects/luajit/src/host/meson.build @@ -1,5 +1,5 @@ minilua = executable('minilua', 'minilua.c', - dependencies: system_deps_native, + dependencies: system_deps, native: true) if host_machine.cpu_family() == 'x86_64' @@ -45,6 +45,6 @@ buildvm_arch = custom_target('buildvm_arch.h', output: 'buildvm_arch.h') buildvm = executable('buildvm', buildvm_src, buildvm_arch, - dependencies: system_deps_native, + dependencies: system_deps, include_directories: src_inc, native: true) From 9aeaceb6e71443e6ca2cae2833f52fabaa7703b0 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 17 Feb 2019 12:24:35 -0500 Subject: [PATCH 099/271] meson: add basic libiconv subproject functionality --- meson.build | 8 +++++++- subprojects/iconv/meson.build | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 subprojects/iconv/meson.build diff --git a/meson.build b/meson.build index ee49e2b2f..ab4242d20 100644 --- a/meson.build +++ b/meson.build @@ -36,7 +36,13 @@ cxx = meson.get_compiler('cpp') cc = meson.get_compiler('c') deps += cc.find_library('m', required: false) deps += cc.find_library('dl', required: false) -deps += cc.find_library('iconv', required: false) +iconv_dep = cc.find_library('iconv', required: false) +if not iconv_dep.found() and host_machine.system() == 'windows' + iconv_sp = subproject('iconv') # this really needs to be replaced with a proper port + deps_inc += iconv_sp.get_variable('iconv_incs') + iconv_dep = iconv_sp.get_variable('libiconv_dep') +endif +deps += iconv_dep deps += dependency('libass', version: '>=0.9.7') deps += dependency('boost', version: '>=1.50.0', diff --git a/subprojects/iconv/meson.build b/subprojects/iconv/meson.build new file mode 100644 index 000000000..75261a585 --- /dev/null +++ b/subprojects/iconv/meson.build @@ -0,0 +1,19 @@ +project('iconv', 'c', license: 'LGPL', + meson_version: '>=0.49.0') + +iconv_src = [ + 'libcharset/localcharset.c', + 'libiconv/iconv.c' +] + +iconv_headers = ['include/iconv.h'] + +iconv_incs = include_directories( + 'include', + 'libcharset', + 'libiconv' +) + +libiconv = library('iconv', iconv_src, include_directories: iconv_incs) +libiconv_dep = declare_dependency(link_with: libiconv, + include_directories: iconv_incs) From 9e284660b1735d7878069f4d489ac6bb773836f4 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 17 Feb 2019 12:25:57 -0500 Subject: [PATCH 100/271] meson: add DirectSound detection --- meson.build | 15 +++++++++++++++ meson_options.txt | 3 ++- src/meson.build | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ab4242d20..9c9b7ace7 100644 --- a/meson.build +++ b/meson.build @@ -82,6 +82,21 @@ foreach dep: [ endif endforeach +if host_machine.system() == 'windows' and not get_option('directsound').disabled() + dsound_dep = cc.find_library('dsound', required: get_option('directsound')) + winmm_dep = cc.find_library('winmm', required: get_option('directsound')) + ole32_dep = cc.find_library('ole32', required: get_option('directsound')) + have_dsound_h = cc.has_header('dsound.h') + if not have_dsound_h and get_option('directsound').enabled() + error('DirectSound enabled but dsound.h not found') + endif + if dsound_dep.found() and winmm_dep.found() and ole32_dep.found() and have_dsound_h + deps += [dsound_dep, winmm_dep, ole32_dep] + conf.set('WITH_DIRECTSOUND', '1') + dep_avail += 'DirectSound' + endif +endif + # TODO: OSS def_audio = get_option('default_audio_output') diff --git a/meson_options.txt b/meson_options.txt index 80e0ddf73..e99e25cc8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -2,7 +2,8 @@ option('alsa', type: 'feature', description: 'ALSA audio output') option('openal', type: 'feature', description: 'OpenAL audio output') option('libpulse', type: 'feature', description: 'PulseAudio audio output') option('portaudio', type: 'feature', description: 'PortAudio audio output') -option('default_audio_output', type: 'combo', choices: ['auto', 'ALSA', 'OpenAL', 'PulseAudio', 'PortAudio'], description: 'Default audio output') +option('directsound', type: 'feature', description: 'DirectSound audio output') +option('default_audio_output', type: 'combo', choices: ['auto', 'ALSA', 'OpenAL', 'PulseAudio', 'PortAudio', 'DirectSound'], description: 'Default audio output') option('ffms2', type: 'feature', description: 'FFMS2 video source') diff --git a/src/meson.build b/src/meson.build index df94b4b6f..183cfb075 100644 --- a/src/meson.build +++ b/src/meson.build @@ -181,6 +181,8 @@ opt_src = [ ['PulseAudio', 'audio_player_pulse.cpp'], ['OpenAL', 'audio_player_openal.cpp'], ['OSS', 'audio_player_oss.cpp'], + ['DirectSound', ['audio_player_dsound.cpp', + 'audio_player_dsound2.cpp']], ['FFMS2', ['audio_provider_ffmpegsource.cpp', 'video_provider_ffmpegsource.cpp', From 2eaf9b0062488379b35dade67216114c7c7faeef Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 17 Feb 2019 12:27:06 -0500 Subject: [PATCH 101/271] meson: fix option name lookup in build file --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 9c9b7ace7..7f7995b88 100644 --- a/meson.build +++ b/meson.build @@ -72,7 +72,7 @@ foreach dep: [ d = dependency(dep[0], version: dep[1] != '' ? dep[1]: '>=0', required: false) - optname = 'enable_@0@'.format(dep[0].split('-')[0]) + optname = dep[0].split('-')[0] if d.found() and not get_option(optname).disabled() deps += d conf.set('WITH_@0@'.format(dep[0].split('-')[0].to_upper()), '1') From df396b67b23073effb6a71e7fdc075c0c80a327b Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 17 Feb 2019 12:27:37 -0500 Subject: [PATCH 102/271] meson: add Windows-specific project args --- meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meson.build b/meson.build index 7f7995b88..df2ca6eb2 100644 --- a/meson.build +++ b/meson.build @@ -17,6 +17,10 @@ version_h = custom_target('git_version.h', dataroot = get_option('prefix') / get_option('datadir') / 'aegisub' add_project_arguments('-DP_DATA="@0@"'.format(dataroot), language: 'cpp') +if host_machine.system() == 'windows' + add_project_arguments('-DNOMINMAX', '-D_WIN32_WINNT=0x0602', language: 'cpp') +endif + conf = configuration_data() conf.set_quoted('P_DATA', dataroot) if get_option('build_credit') != '' From d2d3168904906edba79edc42f8c0e6b102767b48 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 17 Feb 2019 12:29:23 -0500 Subject: [PATCH 103/271] meson: allow additional include directories for manually located deps --- meson.build | 1 + src/libresrc/meson.build | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index df2ca6eb2..71110c16f 100644 --- a/meson.build +++ b/meson.build @@ -29,6 +29,7 @@ endif conf.set('WITH_UPDATE_CHECKER', get_option('enable_update_checker')) deps = [] +deps_inc = [] if host_machine.system() == 'darwin' add_languages('objc') diff --git a/src/libresrc/meson.build b/src/libresrc/meson.build index 9c4ab499e..e6189a3ca 100644 --- a/src/libresrc/meson.build +++ b/src/libresrc/meson.build @@ -25,4 +25,4 @@ endif libresrc_inc = include_directories('.') -libresrc = static_library('resrc', 'libresrc.cpp', resrc, dependencies: deps) +libresrc = static_library('resrc', 'libresrc.cpp', resrc, include_directories: deps_inc, dependencies: deps) From 3b2d770d74262f51a8bd7dd23cd3078dc089980c Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 21 Jul 2019 14:40:21 -0400 Subject: [PATCH 104/271] Fix PCH usage Hopefully this time in a way that doesn't ruin life for Unix folks! --- libaegisub/include/lagi_pre.h | 44 ++++++- libaegisub/lagi_pre.h | 43 ------- libaegisub/meson.build | 11 +- libaegisub/windows/lagi_pre.cpp | 0 src/agi_pre.cpp | 1 - src/agi_pre.h | 217 ------------------------------- src/include/agi_pre.cpp | 6 + src/include/agi_pre.h | 218 +++++++++++++++++++++++++++++++- src/meson.build | 9 +- 9 files changed, 280 insertions(+), 269 deletions(-) mode change 120000 => 100644 libaegisub/include/lagi_pre.h delete mode 100644 libaegisub/lagi_pre.h delete mode 100644 libaegisub/windows/lagi_pre.cpp delete mode 100644 src/agi_pre.cpp delete mode 100644 src/agi_pre.h create mode 100644 src/include/agi_pre.cpp mode change 120000 => 100644 src/include/agi_pre.h diff --git a/libaegisub/include/lagi_pre.h b/libaegisub/include/lagi_pre.h deleted file mode 120000 index 13ed6ac57..000000000 --- a/libaegisub/include/lagi_pre.h +++ /dev/null @@ -1 +0,0 @@ -../lagi_pre.h \ No newline at end of file diff --git a/libaegisub/include/lagi_pre.h b/libaegisub/include/lagi_pre.h new file mode 100644 index 000000000..50ce877e2 --- /dev/null +++ b/libaegisub/include/lagi_pre.h @@ -0,0 +1,43 @@ +#ifdef __cplusplus +#ifndef _WIN32 +#include "../acconf.h" +#endif + +#define WIN32_LEAN_AND_MEAN + +// Common C +#include +#include +#include +#include +#include +#include + +// Common C++ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4996) +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +// Boost +#include +#include +#include +#define BOOST_NO_SCOPED_ENUMS +#include +#undef BOOST_NO_SCOPED_ENUMS +#include +#endif diff --git a/libaegisub/lagi_pre.h b/libaegisub/lagi_pre.h deleted file mode 100644 index 50ce877e2..000000000 --- a/libaegisub/lagi_pre.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifdef __cplusplus -#ifndef _WIN32 -#include "../acconf.h" -#endif - -#define WIN32_LEAN_AND_MEAN - -// Common C -#include -#include -#include -#include -#include -#include - -// Common C++ -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4996) -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -// Boost -#include -#include -#include -#define BOOST_NO_SCOPED_ENUMS -#include -#undef BOOST_NO_SCOPED_ENUMS -#include -#endif diff --git a/libaegisub/meson.build b/libaegisub/meson.build index a02cc8750..be19b4860 100644 --- a/libaegisub/meson.build +++ b/libaegisub/meson.build @@ -63,7 +63,6 @@ else 'windows/access.cpp', 'windows/charset_conv_win.cpp', 'windows/fs.cpp', - 'windows/lagi_pre.cpp', 'windows/log_win.cpp', 'windows/path_win.cpp', 'windows/util_win.cpp', @@ -79,10 +78,14 @@ else endif endif -libaegisub_cpp_pch = ['lagi_pre.h'] +libaegisub_cpp_pch = ['include/lagi_pre.h'] +if cxx.get_id() == 'msvc' + libaegisub_cpp_pch += 'include/lagi_pre.cpp' +endif + libaegisub_inc = include_directories('include') libaegisub = static_library('aegisub', libaegisub_src, acconf, - include_directories: libaegisub_inc, - cpp_pch: 'include/lagi_pre.h', + include_directories: [libaegisub_inc, deps_inc], + cpp_pch: libaegisub_cpp_pch, dependencies: deps) diff --git a/libaegisub/windows/lagi_pre.cpp b/libaegisub/windows/lagi_pre.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/agi_pre.cpp b/src/agi_pre.cpp deleted file mode 100644 index a9486c83e..000000000 --- a/src/agi_pre.cpp +++ /dev/null @@ -1 +0,0 @@ -// A dummy file for compiling the precompiled header with VC++ diff --git a/src/agi_pre.h b/src/agi_pre.h deleted file mode 100644 index 63e045dca..000000000 --- a/src/agi_pre.h +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) 2006, Rodrigo Braz Monteiro -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of the Aegisub Group nor the names of its contributors -// may 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. -// -// Aegisub Project http://www.aegisub.org/ - -/// @file agi_pre.h -/// @brief Precompiled headers include file, including all headers that should be precompiled -/// @ingroup main -/// -/// In order to use it, set the project to use this header as precompiled and -/// insert it in every source file (under C/C++ -> Advanced -> Force Includes), -/// then set stdwx.cpp to generate the precompiled header -/// -/// @note Make sure that you disable use of precompiled headers on md5.c and -/// MatroskaParser.c, as well as any possible future .c files. - -#ifdef __cplusplus - -// Block msvc from complaining about not using msvc-specific versions for -// insecure C functions. -#ifdef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS_DEFINED -#else -#define _CRT_SECURE_NO_WARNINGS -#endif - -#ifndef _WIN32 -#include "../acconf.h" -#endif - -#define WIN32_LEAN_AND_MEAN - -// Common C -#include -#include -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4996) -#endif - -// Common C++ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -#ifdef _WIN32 -#include -#include -#else -#include -#endif - -// Boost -#include -#include -#include -#include -#include -#include -#include -#include -#define BOOST_NO_SCOPED_ENUMS -#include -#undef BOOST_NO_SCOPED_ENUMS -#include -#include - -// wxWidgets headers -#include // Leave this first. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_OPENGL_GL_H -#include -#else -#include -#endif - -#ifndef _CRT_SECURE_NO_WARNINGS_DEFINED -#undef _CRT_SECURE_NO_WARNINGS -#endif - -#endif diff --git a/src/include/agi_pre.cpp b/src/include/agi_pre.cpp new file mode 100644 index 000000000..d4d26d28c --- /dev/null +++ b/src/include/agi_pre.cpp @@ -0,0 +1,6 @@ +// A dummy file for compiling the precompiled header with VC++ +#if !defined(_MSC_VER) +#error "This file is only for use with MSVC." +#endif + +#include "agi_pre.h" diff --git a/src/include/agi_pre.h b/src/include/agi_pre.h deleted file mode 120000 index 7b2f4b2e2..000000000 --- a/src/include/agi_pre.h +++ /dev/null @@ -1 +0,0 @@ -../agi_pre.h \ No newline at end of file diff --git a/src/include/agi_pre.h b/src/include/agi_pre.h new file mode 100644 index 000000000..63e045dca --- /dev/null +++ b/src/include/agi_pre.h @@ -0,0 +1,217 @@ +// Copyright (c) 2006, Rodrigo Braz Monteiro +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * 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. +// * Neither the name of the Aegisub Group nor the names of its contributors +// may 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. +// +// Aegisub Project http://www.aegisub.org/ + +/// @file agi_pre.h +/// @brief Precompiled headers include file, including all headers that should be precompiled +/// @ingroup main +/// +/// In order to use it, set the project to use this header as precompiled and +/// insert it in every source file (under C/C++ -> Advanced -> Force Includes), +/// then set stdwx.cpp to generate the precompiled header +/// +/// @note Make sure that you disable use of precompiled headers on md5.c and +/// MatroskaParser.c, as well as any possible future .c files. + +#ifdef __cplusplus + +// Block msvc from complaining about not using msvc-specific versions for +// insecure C functions. +#ifdef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS_DEFINED +#else +#define _CRT_SECURE_NO_WARNINGS +#endif + +#ifndef _WIN32 +#include "../acconf.h" +#endif + +#define WIN32_LEAN_AND_MEAN + +// Common C +#include +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4996) +#endif + +// Common C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#ifdef _WIN32 +#include +#include +#else +#include +#endif + +// Boost +#include +#include +#include +#include +#include +#include +#include +#include +#define BOOST_NO_SCOPED_ENUMS +#include +#undef BOOST_NO_SCOPED_ENUMS +#include +#include + +// wxWidgets headers +#include // Leave this first. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_OPENGL_GL_H +#include +#else +#include +#endif + +#ifndef _CRT_SECURE_NO_WARNINGS_DEFINED +#undef _CRT_SECURE_NO_WARNINGS +#endif + +#endif diff --git a/src/meson.build b/src/meson.build index 183cfb075..bf6a564f1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -197,9 +197,14 @@ foreach opt: opt_src endif endforeach +aegisub_cpp_pch = ['include/agi_pre.h'] +if cxx.get_id() == 'msvc' + aegisub_cpp_pch += 'include/agi_pre.cpp' +endif + aegisub = executable('aegisub', aegisub_src, version_h, acconf, link_with: [libresrc, libluabins, libaegisub], - include_directories: [libaegisub_inc, libresrc_inc, version_inc], - cpp_pch: 'include/agi_pre.h', + include_directories: [libaegisub_inc, libresrc_inc, version_inc, deps_inc], + cpp_pch: aegisub_cpp_pch, install: true, dependencies: deps) From 1599858c923652df87da7ef15c9b4888aa28f209 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 21 Jul 2019 14:41:09 -0400 Subject: [PATCH 105/271] Make version.sh executable --- tools/version.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/version.sh diff --git a/tools/version.sh b/tools/version.sh old mode 100644 new mode 100755 From 13711128fa6645b3d96a08cf99783231540b75b5 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 21 Jul 2019 15:08:41 -0400 Subject: [PATCH 106/271] meson: remove 'build_' prefix from option --- meson.build | 4 ++-- meson_options.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 71110c16f..1765e6c47 100644 --- a/meson.build +++ b/meson.build @@ -23,8 +23,8 @@ endif conf = configuration_data() conf.set_quoted('P_DATA', dataroot) -if get_option('build_credit') != '' - conf.set_quoted('BUILD_CREDIT', get_option('build_credit')) +if get_option('credit') != '' + conf.set_quoted('BUILD_CREDIT', get_option('credit')) endif conf.set('WITH_UPDATE_CHECKER', get_option('enable_update_checker')) diff --git a/meson_options.txt b/meson_options.txt index e99e25cc8..ea1fe5e30 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -13,7 +13,7 @@ option('uchardet', type: 'feature', description: 'uchardet character encoding de option('system_luajit', type: 'boolean', value: false, description: 'Force using system luajit') -option('build_credit', type: 'string', value: '', description: 'Build credit shown in program title') +option('credit', type: 'string', value: '', description: 'Build credit shown in program title') option('enable_update_checker', type: 'boolean', value: false, description: 'Enable the update checker') option('update_server', type: 'string', value: 'updates.aegisub.org', description: 'Server to use for the update checker') From 57e4f788d0eb39f4148c61664fa8ff0dccd75932 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 21 Jul 2019 15:06:42 -0400 Subject: [PATCH 107/271] meson: update subprojects --- subprojects/gtest.wrap | 14 +++++++------- subprojects/libass.wrap | 2 +- subprojects/zlib.wrap | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/subprojects/gtest.wrap b/subprojects/gtest.wrap index 773a713c9..ba9c9b95f 100644 --- a/subprojects/gtest.wrap +++ b/subprojects/gtest.wrap @@ -1,10 +1,10 @@ [wrap-file] -directory = googletest-release-1.8.0 +directory = googletest-release-1.8.1 -source_url = https://github.com/google/googletest/archive/release-1.8.0.zip -source_filename = gtest-1.8.0.zip -source_hash = f3ed3b58511efd272eb074a3a6d6fb79d7c2e6a0e374323d1e6bcbcc1ef141bf +source_url = https://github.com/google/googletest/archive/release-1.8.1.zip +source_filename = gtest-1.8.1.zip +source_hash = 927827c183d01734cc5cfef85e0ff3f5a92ffe6188e0d18e909c5efebf28a0c7 -patch_url = https://wrapdb.mesonbuild.com/v1/projects/gtest/1.8.0/5/get_zip -patch_filename = gtest-1.8.0-5-wrap.zip -patch_hash = 7eeaede4aa2610a403313b74e04baf91ccfbaef03203d8f56312e22df1834ec5 +patch_url = https://wrapdb.mesonbuild.com/v1/projects/gtest/1.8.1/1/get_zip +patch_filename = gtest-1.8.1-1-wrap.zip +patch_hash = f79f5fd46e09507b3f2e09a51ea6eb20020effe543335f5aee59f30cc8d15805 diff --git a/subprojects/libass.wrap b/subprojects/libass.wrap index 2e0629c10..3e64a4ab2 100644 --- a/subprojects/libass.wrap +++ b/subprojects/libass.wrap @@ -1,4 +1,4 @@ [wrap-git] directory = libass url = https://github.com/TypesettingTools/libass.git -revision = meson +revision = meson-pr diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap index 97de00ef7..91c1d4d99 100644 --- a/subprojects/zlib.wrap +++ b/subprojects/zlib.wrap @@ -5,6 +5,6 @@ source_url = http://zlib.net/fossils/zlib-1.2.11.tar.gz source_filename = zlib-1.2.11.tar.gz source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 -patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/3/get_zip -patch_filename = zlib-1.2.11-3-wrap.zip -patch_hash = f07dc491ab3d05daf00632a0591e2ae61b470615b5b73bcf9b3f061fff65cff0 +patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/4/get_zip +patch_filename = zlib-1.2.11-4-wrap.zip +patch_hash = f733976fbfc59e0bcde01aa9469a24eeb16faf0a4280b17e9eaa60a301d75657 From a853f7c4b0f79a27c6c14379cb4e039074c33e05 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 21 Jul 2019 15:12:28 -0400 Subject: [PATCH 108/271] Windows installer: always include vc+ runtime --- packages/win_installer/aegisub3.iss | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/win_installer/aegisub3.iss b/packages/win_installer/aegisub3.iss index 2683e02c1..4ca458efc 100644 --- a/packages/win_installer/aegisub3.iss +++ b/packages/win_installer/aegisub3.iss @@ -50,9 +50,7 @@ ArchitecturesAllowed=x64 #include "fragment_automation.iss" #include "fragment_translations.iss" #include "fragment_spelling.iss" -#ifdef DEPCTRL #include "fragment_runtimes.iss" -#endif [Code] #include "fragment_shell_code.iss" From 7befd5e7597d320783f06a26e4fd9e41f47ec10e Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 21 Jul 2019 15:13:01 -0400 Subject: [PATCH 109/271] gitignore: mass cleaning --- .gitignore | 47 ++++------------------------------------------- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index 4a19137ba..7a967423c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,48 +1,11 @@ -*.App -*.[oadi] -*.ass -*.avi -*.bz2 -*.cache -*.dep -*.db -*.dll -*.dmg -*.exe -*.gch -*.gz +*.vcxproj.user *.idb -*.ilk -*.log -*.manifest -*.mkv -*.mo -*.ncb -*.obj -*.opensdf -*.orig -*.patch -*.pch *.pdb -*.profdata -*.profraw -*.sdf -*.so -*.srt -*.suo -*.swp -*.ts -*.user -*.vsp -*.y4m -*.zip -*~ +*.mo +*.exe -/bin +/output /include -/ipch -/lib -/obj /tests/data .lvimrc @@ -65,7 +28,6 @@ git_version.xml packages/desktop/aegisub.desktop packages/desktop/aegisub.desktop.template packages/win_installer/vendor -src/aegisub src/libresrc/bitmap.cpp src/libresrc/bitmap.h src/libresrc/default_config.cpp @@ -79,7 +41,6 @@ tools/osx-bundle-restart-helper tools/osx-bundle.sed tools/repack-thes-dict tools/repack-thes-dict.dSYM -vendor/fribidi vendor/luajit/src/host/buildvm vendor/luajit/src/host/minilua vendor/luajit/src/host/buildvm_arch.h From 5e14a9265b28219f151db4499f0cb3ad47aa8e5b Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 21 Jul 2019 15:14:26 -0400 Subject: [PATCH 110/271] meson: attempt to wrangle dependencies --- meson.build | 39 +++++++++++++++++++++++++++++---------- meson_options.txt | 3 +++ src/include/agi_pre.h | 2 +- 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index 1765e6c47..acdba7448 100644 --- a/meson.build +++ b/meson.build @@ -49,15 +49,35 @@ if not iconv_dep.found() and host_machine.system() == 'windows' endif deps += iconv_dep -deps += dependency('libass', version: '>=0.9.7') +deps += dependency('libass', version: '>=0.9.7', + fallback: ['libass', 'libass_dep']) deps += dependency('boost', version: '>=1.50.0', modules: ['chrono', 'filesystem', 'locale', 'regex', 'system', 'thread']) -deps += dependency('zlib') +deps += dependency('zlib', fallback: ['zlib', 'zlib_dep']) -icu_uc_dep = dependency('icu-uc', version: '>=4.8.1.1') +# TODO: overhaul all this to properly handle windows vs non-windows +wx_dep = dependency('wxWidgets', version: '>=3.0.0', required: false, + modules: ['std', 'stc', 'gl']) +if not wx_dep.found() + deps_inc += include_directories(get_option('wx_path') / 'include' / 'msvc', get_option('wx_path') / 'include') + add_project_arguments('-DUNICODE', '-D_UNICODE', language: 'cpp') + add_project_arguments('-DwxMSVC_VERSION_AUTO', '-DWXUSINGDLL', language: 'cpp') +endif +deps += wx_dep + +icu_uc_dep = dependency('icu-uc', version: '>=4.8.1.1', required: false) +icu_i18n_dep = dependency('icu-i18n', version: '>=4.8.1.1', required: false) +if not (icu_uc_dep.found() and icu_i18n_dep.found()) + deps_inc += include_directories(get_option('icu_path') / 'include') +endif +if not icu_uc_dep.found() # check for non-empty, only work with windows, etc + icu_uc_dep = cxx.find_library('icuuc', dirs: get_option('icu_path') / 'lib64') +endif deps += icu_uc_dep -icu_i18n_dep = dependency('icu-i18n', version: '>=4.8.1.1') +if not icu_i18n_dep.found() + icu_i18n_dep = cxx.find_library('icuin', dirs: get_option('icu_path') / 'lib64') +endif deps += icu_i18n_dep dep_avail = [] @@ -68,11 +88,11 @@ foreach dep: [ ['portaudio-2.0', '', 'PortAudio'], ['openal', '>=0.0.8', 'OpenAL'], # video - ['ffms2', '', 'FFMS2'], + ['ffms2', '', 'FFMS2'], # needs a proper port # other ['fftw3', '', 'FFTW3'], - ['hunspell', '', 'Hunspell'], - ['uchardet', '', 'uchardet'], + ['hunspell', '', 'Hunspell'], # needs a proper port + ['uchardet', '', 'uchardet'], # needs a proper port ] d = dependency(dep[0], version: dep[1] != '' ? dep[1]: '>=0', required: false) @@ -152,9 +172,6 @@ else endif subdir('vendor/luabins/src') -deps += dependency('wxWidgets', version: '>=3.0.0', - modules: ['std', 'stc', 'gl']) - dep_gl = dependency('gl', required: false) if not dep_gl.found() if host_machine.system() == 'windows' @@ -174,6 +191,8 @@ endif deps += dep_gl +# sort out csri + acconf = configure_file(output: 'acconf.h', configuration: conf) subdir('automation') diff --git a/meson_options.txt b/meson_options.txt index ea1fe5e30..917aa32db 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -13,6 +13,9 @@ option('uchardet', type: 'feature', description: 'uchardet character encoding de option('system_luajit', type: 'boolean', value: false, description: 'Force using system luajit') +option('icu_path', type: 'string', value: '', description: 'Path to ICU libraries on Windows') +option('wx_path', type: 'string', value: '', description: 'Path to wxWidgets libraries on Windows') + option('credit', type: 'string', value: '', description: 'Build credit shown in program title') option('enable_update_checker', type: 'boolean', value: false, description: 'Enable the update checker') diff --git a/src/include/agi_pre.h b/src/include/agi_pre.h index 63e045dca..c40b0b862 100644 --- a/src/include/agi_pre.h +++ b/src/include/agi_pre.h @@ -49,7 +49,7 @@ #endif #ifndef _WIN32 -#include "../acconf.h" +#include "../../acconf.h" #endif #define WIN32_LEAN_AND_MEAN From 8704f837431ec83dd6e0258a36c63588c5f96d11 Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Wed, 28 Aug 2019 22:04:38 +0200 Subject: [PATCH 111/271] Fix git_version.h generation --- tools/version.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/version.sh b/tools/version.sh index 8cea0a3f3..114c38752 100755 --- a/tools/version.sh +++ b/tools/version.sh @@ -1,8 +1,8 @@ srcdir="$1" # If no git repo try to read from the existing git_version.h, for building from tarballs +version_h_path="${srcdir}/git_version.h" if ! test -d "${srcdir}/.git"; then - version_h_path="${srcdir}/build/git_version.h" if test -f "${version_h_path}"; then while read line; do set -- $line @@ -52,9 +52,6 @@ new_version_h="\ #define INSTALLER_VERSION \"${installer_version}\" #define RESOURCE_BASE_VERSION ${resource_version}" -# may not exist yet for out of tree builds -mkdir -p build -version_h_path="build/git_version.h" # Write it only if it's changed to avoid spurious rebuilds # This bizzare comparison method is due to that newlines in shell variables are very exciting @@ -68,7 +65,7 @@ export BUILD_GIT_VERSION_NUMBER="${git_revision}" export BUILD_GIT_VERSION_STRING="${git_version_str}" export VERSION_SOURCE="from git" -cat << EOF > build/git_version.xml +cat << EOF > "${srcdir}/git_version.xml" From 9fdf490cffaa7f8da09d277e846f05386580b5bd Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Mon, 30 Jan 2017 02:37:01 +0100 Subject: [PATCH 112/271] Use git rev-list to determine revision number --- tools/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/version.sh b/tools/version.sh index 114c38752..a950bae2f 100755 --- a/tools/version.sh +++ b/tools/version.sh @@ -24,7 +24,7 @@ fi last_svn_revision=6962 last_svn_hash="16cd907fe7482cb54a7374cd28b8501f138116be" -git_revision=$(expr $last_svn_revision + $(git log --pretty=oneline $last_svn_hash..HEAD 2>/dev/null | wc -l)) +git_revision=$(expr $last_svn_revision + $(git rev-list --count $last_svn_hash..HEAD)) git_version_str=$(git describe --exact-match 2> /dev/null) installer_version='0.0.0' resource_version='0, 0, 0' From 2cb6d5b81490e24475d7b732edb2bcff40f629bf Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 8 Sep 2019 17:38:59 -0400 Subject: [PATCH 113/271] meson: fix up OSX and non-MSVC detection --- meson.build | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index acdba7448..5025f6e3d 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,8 @@ -project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', +project('Aegisub', ['c', 'cpp'], + license: 'BSD-3-Clause', meson_version: '>=0.49.0', - default_options: ['cpp_std=c++14', 'b_lto=true']) + default_options: ['c_std=c11', 'cpp_std=c++11', 'b_lto=true'], + version: '3.2.2') if host_machine.system() == 'windows' version_sh = find_program('tools/version.ps1') @@ -32,7 +34,10 @@ deps = [] deps_inc = [] if host_machine.system() == 'darwin' - add_languages('objc') + add_languages('objc', 'objcpp') + add_project_arguments('-DGL_SILENCE_DEPRECATION', language: 'cpp') + # meson does not currently support objcpp_std + add_project_arguments('-std=c++11', language: 'objcpp') elif host_machine.system() != 'windows' deps += dependency('fontconfig') endif @@ -56,22 +61,30 @@ deps += dependency('boost', version: '>=1.50.0', 'system', 'thread']) deps += dependency('zlib', fallback: ['zlib', 'zlib_dep']) -# TODO: overhaul all this to properly handle windows vs non-windows -wx_dep = dependency('wxWidgets', version: '>=3.0.0', required: false, +wx_dep = dependency('wxWidgets', version: '>=3.0.0', + required: cxx.get_id() != 'msvc', modules: ['std', 'stc', 'gl']) -if not wx_dep.found() - deps_inc += include_directories(get_option('wx_path') / 'include' / 'msvc', get_option('wx_path') / 'include') - add_project_arguments('-DUNICODE', '-D_UNICODE', language: 'cpp') - add_project_arguments('-DwxMSVC_VERSION_AUTO', '-DWXUSINGDLL', language: 'cpp') +if not wx_dep.found() # this will only be hit with msvc + if get_option('wx_path') != '' + deps_inc += include_directories(get_option('wx_path') / 'include' / 'msvc', get_option('wx_path') / 'include') + add_project_arguments('-DUNICODE', '-D_UNICODE', language: 'cpp') + add_project_arguments('-DwxMSVC_VERSION_AUTO', '-DWXUSINGDLL', language: 'cpp') + else + error('wxWidgets not found and no wx_path defined.') + endif endif deps += wx_dep -icu_uc_dep = dependency('icu-uc', version: '>=4.8.1.1', required: false) -icu_i18n_dep = dependency('icu-i18n', version: '>=4.8.1.1', required: false) +icu_uc_dep = dependency('icu-uc', version: '>=4.8.1.1', required: cxx.get_id() != 'msvc') +icu_i18n_dep = dependency('icu-i18n', version: '>=4.8.1.1', required: cxx.get_id() != 'msvc') if not (icu_uc_dep.found() and icu_i18n_dep.found()) - deps_inc += include_directories(get_option('icu_path') / 'include') + if get_option('icu_path') != '' + deps_inc += include_directories(get_option('icu_path') / 'include') + else + error('ICU not found and no icu_path defined.') + endif endif -if not icu_uc_dep.found() # check for non-empty, only work with windows, etc +if not icu_uc_dep.found() icu_uc_dep = cxx.find_library('icuuc', dirs: get_option('icu_path') / 'lib64') endif deps += icu_uc_dep @@ -122,6 +135,11 @@ if host_machine.system() == 'windows' and not get_option('directsound').disabled endif endif +if host_machine.system() == 'darwin' + frameworks_dep = dependency('appleframeworks', modules : ['CoreText', 'CoreFoundation']) + deps += frameworks_dep +endif + # TODO: OSS def_audio = get_option('default_audio_output') @@ -191,7 +209,7 @@ endif deps += dep_gl -# sort out csri +# TODO: csri acconf = configure_file(output: 'acconf.h', configuration: conf) From 9708ca8e5efb731e0c177a3665ed978564828379 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 8 Sep 2019 17:42:37 -0400 Subject: [PATCH 114/271] Add virtual destructor to SignalBase Quashes a frequent warning --- libaegisub/include/libaegisub/signal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libaegisub/include/libaegisub/signal.h b/libaegisub/include/libaegisub/signal.h index ca520e49f..091cc7873 100644 --- a/libaegisub/include/libaegisub/signal.h +++ b/libaegisub/include/libaegisub/signal.h @@ -100,6 +100,7 @@ namespace detail { SignalBase& operator=(SignalBase const&) = delete; protected: SignalBase() = default; + virtual ~SignalBase() {}; /// @brief Notify a slot that it has been disconnected /// @param tok Token to disconnect /// From 443dd5146d4ec7e580360d1835e925d8ac494fcc Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Tue, 23 Jul 2019 02:07:55 +0200 Subject: [PATCH 115/271] Properly build aegisub.desktop --- packages/meson.build | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/meson.build b/packages/meson.build index c114848f6..963505d10 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -4,10 +4,17 @@ c_pkg.set('AEGISUB_COMMAND', 'aegisub') if host_machine.system() == 'windows' elif host_machine.system() == 'darwin' else - configure_file(input: 'desktop/aegisub.desktop.template.in', - output: 'aegisub.desktop', - configuration: c_pkg, - install_dir: get_option('datadir') / 'applications') + desktop_template = configure_file(input: 'desktop/aegisub.desktop.template.in', + output: 'aegisub.desktop.template', + configuration: c_pkg) + + intltool_merge = find_program('intltool-merge') + desktop = custom_target('aegisub.desktop', + input: desktop_template, + output: 'aegisub.desktop', + command: [intltool_merge, '--desktop-style', '--quiet', '../po', '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: get_option('datadir') / 'applications') endif aegisub_logos = ['16x16.png', '22x22.png', '24x24.png', '32x32.png', '48x48.png', '64x64.png', 'scalable.svg'] From 650954f28e0a56ff122612fb1e88208026872021 Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Mon, 19 Mar 2018 17:45:32 +0100 Subject: [PATCH 116/271] Move language specifications to LINGUAS file This is required when using i18n.merge_file. --- po/LINGUAS | 29 +++++++++++++++++++++++++++++ po/meson.build | 34 +--------------------------------- 2 files changed, 30 insertions(+), 33 deletions(-) create mode 100644 po/LINGUAS diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 000000000..7f49d7af9 --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1,29 @@ +ar +bg +ca +cs +da +de +el +es +eu +fa +fi +fr_FR +gl +hu +id +it +ja +ko +nl +pl +pt_BR +pt_PT +ru +sr_RS@latin +sr_RS +uk_UA +vi +zh_CN +zh_TW diff --git a/po/meson.build b/po/meson.build index 48bded975..5d61f0efc 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,34 +1,2 @@ i18n = import('i18n') -langs = [ - 'ar', - 'bg', - 'ca', - 'cs', - 'da', - 'de', - 'el', - 'es', - 'eu', - 'fa', - 'fi', - 'fr_FR', - 'gl', - 'hu', - 'id', - 'it', - 'ja', - 'ko', - 'nl', - 'pl', - 'pt_BR', - 'pt_PT', - 'ru', - 'sr_RS@latin', - 'sr_RS', - 'uk_UA', - 'vi', - 'zh_CN', - 'zh_TW', -] - -i18n.gettext('aegisub', languages: langs) +i18n.gettext('aegisub') From 6343d36169f02f29605f13318c5a8e7c901aa635 Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Tue, 23 Jul 2019 02:10:18 +0200 Subject: [PATCH 117/271] Add commented i18n.merge_file version Using that makes use of gettext (and msgfmt) rather than intltool, which is the proper way but requires a more recent gettext version and I'm not comfortable adding that dependency for now. Specifically, it would require updating the autotools chain as well as the template files are incompatible. See https://wiki.gnome.org/MigratingFromIntltoolToGettext for more info. --- packages/meson.build | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/meson.build b/packages/meson.build index 963505d10..2ce40828b 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -8,6 +8,17 @@ else output: 'aegisub.desktop.template', configuration: c_pkg) + # TODO: switch this to gettext from intltool + # requires modifying the autotools chain and a recent-ish gettext + # https://wiki.gnome.org/MigratingFromIntltoolToGettext + # + # i18n = import('i18n') + # i18n.merge_file(input: desktop_template, + # output: 'aegisub.desktop', + # type: 'desktop', + # po_dir: '../po', + # install: true, + # install_dir: join_paths(get_option('datadir'), 'applications')) intltool_merge = find_program('intltool-merge') desktop = custom_target('aegisub.desktop', input: desktop_template, From a91c4f70c335bd8cbeab23c7ebd3227bec65907c Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Mon, 4 Feb 2019 15:31:32 +0100 Subject: [PATCH 118/271] Use i18n.merge_file for real Requires gettext 0.19, which is available on all major linux dists. Not compatible with autotools chain! (For now, anyway.) --- packages/desktop/aegisub.desktop.template.in | 6 ++--- packages/meson.build | 25 ++++++-------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/packages/desktop/aegisub.desktop.template.in b/packages/desktop/aegisub.desktop.template.in index b11a3e359..e36595c93 100644 --- a/packages/desktop/aegisub.desktop.template.in +++ b/packages/desktop/aegisub.desktop.template.in @@ -1,9 +1,9 @@ [Desktop Entry] Version=1.0 Type=Application -_Name=Aegisub -_GenericName=Subtitle Editor -_Comment=Create and edit subtitles for film and videos. +Name=Aegisub +GenericName=Subtitle Editor +Comment=Create and edit subtitles for film and videos. Exec=@AEGISUB_COMMAND@ %f TryExec=@AEGISUB_COMMAND@ Icon=aegisub diff --git a/packages/meson.build b/packages/meson.build index 2ce40828b..b4db1e0e0 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -8,24 +8,13 @@ else output: 'aegisub.desktop.template', configuration: c_pkg) - # TODO: switch this to gettext from intltool - # requires modifying the autotools chain and a recent-ish gettext - # https://wiki.gnome.org/MigratingFromIntltoolToGettext - # - # i18n = import('i18n') - # i18n.merge_file(input: desktop_template, - # output: 'aegisub.desktop', - # type: 'desktop', - # po_dir: '../po', - # install: true, - # install_dir: join_paths(get_option('datadir'), 'applications')) - intltool_merge = find_program('intltool-merge') - desktop = custom_target('aegisub.desktop', - input: desktop_template, - output: 'aegisub.desktop', - command: [intltool_merge, '--desktop-style', '--quiet', '../po', '@INPUT@', '@OUTPUT@'], - install: true, - install_dir: get_option('datadir') / 'applications') + i18n = import('i18n') + i18n.merge_file(input: desktop_template, + output: 'aegisub.desktop', + type: 'desktop', + po_dir: '../po', + install: true, + install_dir: join_paths(get_option('datadir'), 'applications')) endif aegisub_logos = ['16x16.png', '22x22.png', '24x24.png', '32x32.png', '48x48.png', '64x64.png', 'scalable.svg'] From b8e2cf83fdcaef7951592ec44e86004ce65827f3 Mon Sep 17 00:00:00 2001 From: line0 Date: Sun, 27 Oct 2019 02:18:06 +0100 Subject: [PATCH 119/271] fix PCHs on VS2019 * separate PCH for C and C++ * acconf.h now included in PCHs on windows, too * meson now auto-generates companion source files for PCH headers --- libaegisub/include/lagi_pre.h | 2 -- libaegisub/include/lagi_pre_c.h | 3 +++ libaegisub/meson.build | 5 ++-- src/include/agi_pre.cpp | 6 ----- src/include/agi_pre.h | 2 -- src/include/agi_pre_c.h | 46 +++++++++++++++++++++++++++++++++ src/meson.build | 5 ++-- 7 files changed, 53 insertions(+), 16 deletions(-) create mode 100644 libaegisub/include/lagi_pre_c.h delete mode 100644 src/include/agi_pre.cpp create mode 100644 src/include/agi_pre_c.h diff --git a/libaegisub/include/lagi_pre.h b/libaegisub/include/lagi_pre.h index 50ce877e2..7dcf1cb2e 100644 --- a/libaegisub/include/lagi_pre.h +++ b/libaegisub/include/lagi_pre.h @@ -1,7 +1,5 @@ #ifdef __cplusplus -#ifndef _WIN32 #include "../acconf.h" -#endif #define WIN32_LEAN_AND_MEAN diff --git a/libaegisub/include/lagi_pre_c.h b/libaegisub/include/lagi_pre_c.h new file mode 100644 index 000000000..622cf2215 --- /dev/null +++ b/libaegisub/include/lagi_pre_c.h @@ -0,0 +1,3 @@ +#include "../acconf.h" + +#define WIN32_LEAN_AND_MEAN \ No newline at end of file diff --git a/libaegisub/meson.build b/libaegisub/meson.build index be19b4860..bb9842bfa 100644 --- a/libaegisub/meson.build +++ b/libaegisub/meson.build @@ -79,13 +79,12 @@ else endif libaegisub_cpp_pch = ['include/lagi_pre.h'] -if cxx.get_id() == 'msvc' - libaegisub_cpp_pch += 'include/lagi_pre.cpp' -endif +libaegisub_c_pch = ['include/lagi_pre_c.h'] libaegisub_inc = include_directories('include') libaegisub = static_library('aegisub', libaegisub_src, acconf, include_directories: [libaegisub_inc, deps_inc], cpp_pch: libaegisub_cpp_pch, + c_pch: libaegisub_c_pch, dependencies: deps) diff --git a/src/include/agi_pre.cpp b/src/include/agi_pre.cpp deleted file mode 100644 index d4d26d28c..000000000 --- a/src/include/agi_pre.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// A dummy file for compiling the precompiled header with VC++ -#if !defined(_MSC_VER) -#error "This file is only for use with MSVC." -#endif - -#include "agi_pre.h" diff --git a/src/include/agi_pre.h b/src/include/agi_pre.h index c40b0b862..e82216b88 100644 --- a/src/include/agi_pre.h +++ b/src/include/agi_pre.h @@ -48,9 +48,7 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#ifndef _WIN32 #include "../../acconf.h" -#endif #define WIN32_LEAN_AND_MEAN diff --git a/src/include/agi_pre_c.h b/src/include/agi_pre_c.h new file mode 100644 index 000000000..c4d6924f4 --- /dev/null +++ b/src/include/agi_pre_c.h @@ -0,0 +1,46 @@ +// Copyright (c) 2006, Rodrigo Braz Monteiro +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * 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. +// * Neither the name of the Aegisub Group nor the names of its contributors +// may 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. +// +// Aegisub Project http://www.aegisub.org/ + +#include "../../acconf.h" + +#define WIN32_LEAN_AND_MEAN + +#ifdef _WIN32 +#include +#include +#else +#include +#endif + +#ifdef HAVE_OPENGL_GL_H +#include +#else +#include +#endif + diff --git a/src/meson.build b/src/meson.build index bf6a564f1..34d5da291 100644 --- a/src/meson.build +++ b/src/meson.build @@ -198,13 +198,12 @@ foreach opt: opt_src endforeach aegisub_cpp_pch = ['include/agi_pre.h'] -if cxx.get_id() == 'msvc' - aegisub_cpp_pch += 'include/agi_pre.cpp' -endif +aegisub_c_pch = ['include/agi_pre_c.h'] aegisub = executable('aegisub', aegisub_src, version_h, acconf, link_with: [libresrc, libluabins, libaegisub], include_directories: [libaegisub_inc, libresrc_inc, version_inc, deps_inc], cpp_pch: aegisub_cpp_pch, + c_pch: aegisub_c_pch, install: true, dependencies: deps) From b6c0f2d5448b7063baedb326d8179aa3b003da34 Mon Sep 17 00:00:00 2001 From: line0 Date: Sun, 27 Oct 2019 02:23:40 +0100 Subject: [PATCH 120/271] meson: don't build fontconfig file lister on windows --- meson.build | 2 ++ src/meson.build | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 5025f6e3d..5175005be 100644 --- a/meson.build +++ b/meson.build @@ -33,12 +33,14 @@ conf.set('WITH_UPDATE_CHECKER', get_option('enable_update_checker')) deps = [] deps_inc = [] +conf.set('WITH_FONTCONFIG', '0') if host_machine.system() == 'darwin' add_languages('objc', 'objcpp') add_project_arguments('-DGL_SILENCE_DEPRECATION', language: 'cpp') # meson does not currently support objcpp_std add_project_arguments('-std=c++11', language: 'objcpp') elif host_machine.system() != 'windows' + conf.set('WITH_FONTCONFIG', '1') deps += dependency('fontconfig') endif diff --git a/src/meson.build b/src/meson.build index 34d5da291..e01353ae4 100644 --- a/src/meson.build +++ b/src/meson.build @@ -171,7 +171,7 @@ if host_machine.system() == 'darwin' 'osx/retina_helper.mm', 'osx/scintilla_ime.mm', ] -else +elif conf.get('WITH_FONTCONFIG') == '1' aegisub_src += 'font_file_lister_fontconfig.cpp' endif From 609d38e605ba099081942372d8c85b6a76a6f2a0 Mon Sep 17 00:00:00 2001 From: line0 Date: Sun, 27 Oct 2019 02:28:12 +0100 Subject: [PATCH 121/271] meson: update dependencies switch back to official harfbuzz upstream now that meson has landed --- subprojects/harfbuzz.wrap | 5 ++--- subprojects/libass.wrap | 2 +- subprojects/libpng.wrap | 14 +++++++------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/subprojects/harfbuzz.wrap b/subprojects/harfbuzz.wrap index 20cafdae6..3d320e894 100644 --- a/subprojects/harfbuzz.wrap +++ b/subprojects/harfbuzz.wrap @@ -1,5 +1,4 @@ [wrap-git] directory = harfbuzz -# Change this URL once upstreamed! -url = https://github.com/tp-m/harfbuzz.git -revision = meson-rebased +url = https://github.com/harfbuzz/harfbuzz +revision = master diff --git a/subprojects/libass.wrap b/subprojects/libass.wrap index 3e64a4ab2..3e8e691d0 100644 --- a/subprojects/libass.wrap +++ b/subprojects/libass.wrap @@ -1,4 +1,4 @@ [wrap-git] directory = libass url = https://github.com/TypesettingTools/libass.git -revision = meson-pr +revision = meson-no-rasterizer-approximation diff --git a/subprojects/libpng.wrap b/subprojects/libpng.wrap index 30774eb72..b7af9091c 100644 --- a/subprojects/libpng.wrap +++ b/subprojects/libpng.wrap @@ -1,10 +1,10 @@ [wrap-file] -directory = libpng-1.6.35 +directory = libpng-1.6.37 -source_url = https://github.com/glennrp/libpng/archive/v1.6.35.tar.gz -source_filename = libpng-1.6.35.tar.gz -source_hash = 6d59d6a154ccbb772ec11772cb8f8beb0d382b61e7ccc62435bf7311c9f4b210 +source_url = https://github.com/glennrp/libpng/archive/v1.6.37.tar.gz +source_filename = libpng-1.6.37.tar.gz +source_hash = ca74a0dace179a8422187671aee97dd3892b53e168627145271cad5b5ac81307 -patch_url = https://wrapdb.mesonbuild.com/v1/projects/libpng/1.6.35/5/get_zip -patch_filename = libpng-1.6.35-5-wrap.zip -patch_hash = da42b18e8d75a88615bdbc1c7bbf1f739ae19f63a8e70d96c90bc448326ae6b7 +patch_url = https://wrapdb.mesonbuild.com/v1/projects/libpng/1.6.37/1/get_zip +patch_filename = libpng-1.6.37-1-wrap.zip +patch_hash = 9a863ae8a5657315a484c94c51f9f636b1fb9f49a15196cc896b72e5f21d78f0 From e56ab6c78498a3ab63ecce88f36df6eaae8b6824 Mon Sep 17 00:00:00 2001 From: line0 Date: Sun, 27 Oct 2019 02:29:31 +0100 Subject: [PATCH 122/271] meson: define BOOST_USE_WINDOWS_H on Windows fixes symbol redefinition errors in VS 2019 --- meson.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meson.build b/meson.build index 5175005be..db004ef2a 100644 --- a/meson.build +++ b/meson.build @@ -58,9 +58,14 @@ deps += iconv_dep deps += dependency('libass', version: '>=0.9.7', fallback: ['libass', 'libass_dep']) + deps += dependency('boost', version: '>=1.50.0', modules: ['chrono', 'filesystem', 'locale', 'regex', 'system', 'thread']) +if host_machine.system() == 'windows' + conf.set('BOOST_USE_WINDOWS_H', '1') +endif + deps += dependency('zlib', fallback: ['zlib', 'zlib_dep']) wx_dep = dependency('wxWidgets', version: '>=3.0.0', From 23e86bf074193ea338677082ed70c8ea3a46bade Mon Sep 17 00:00:00 2001 From: line0 Date: Sun, 27 Oct 2019 02:30:01 +0100 Subject: [PATCH 123/271] meson: build libiconv as static library --- subprojects/iconv/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/iconv/meson.build b/subprojects/iconv/meson.build index 75261a585..eee208a42 100644 --- a/subprojects/iconv/meson.build +++ b/subprojects/iconv/meson.build @@ -14,6 +14,6 @@ iconv_incs = include_directories( 'libiconv' ) -libiconv = library('iconv', iconv_src, include_directories: iconv_incs) +libiconv = static_library('iconv', iconv_src, include_directories: iconv_incs) libiconv_dep = declare_dependency(link_with: libiconv, include_directories: iconv_incs) From 18fe7918f3cb36a2411454cc8789b981d7abf4c8 Mon Sep 17 00:00:00 2001 From: line0 Date: Tue, 31 Mar 2020 21:19:15 +0200 Subject: [PATCH 124/271] meson: make boost honor the global default_library option --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index db004ef2a..5307f06a1 100644 --- a/meson.build +++ b/meson.build @@ -61,7 +61,8 @@ deps += dependency('libass', version: '>=0.9.7', deps += dependency('boost', version: '>=1.50.0', modules: ['chrono', 'filesystem', 'locale', 'regex', - 'system', 'thread']) + 'system', 'thread'], + static: get_option('default_library') == 'static') if host_machine.system() == 'windows' conf.set('BOOST_USE_WINDOWS_H', '1') endif From f0393950035b5968f074f26b3ad58b25a92fdb02 Mon Sep 17 00:00:00 2001 From: line0 Date: Sat, 11 Apr 2020 00:56:21 +0200 Subject: [PATCH 125/271] meson: generate git_version header in build root rather than within the source tree fixes an issue where the windows version of the git version update script generated the header in a place where it couldn't be found by the include in version.cpp --- meson.build | 2 +- tools/version.ps1 | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 5307f06a1..20fc56fe0 100644 --- a/meson.build +++ b/meson.build @@ -11,7 +11,7 @@ else endif version_inc = include_directories('.') version_h = custom_target('git_version.h', - command: [version_sh, meson.source_root()], + command: [version_sh, meson.current_build_dir()], build_by_default: true, build_always_stale: true, # has internal check whether target file will be refreshed output: ['git_version.h', 'git_version.xml']) diff --git a/tools/version.ps1 b/tools/version.ps1 index 03d02dbef..0d61c7176 100644 --- a/tools/version.ps1 +++ b/tools/version.ps1 @@ -1,20 +1,32 @@ #!/usr/bin/env powershell + +param ( + [Parameter(Position = 0, Mandatory = $false)] + [string]$BuildRoot = $null +) + $lastSvnRevision = 6962 $lastSvnHash = '16cd907fe7482cb54a7374cd28b8501f138116be' $defineNumberMatch = [regex] '^#define\s+(\w+)\s+(\d+)$' $defineStringMatch = [regex] "^#define\s+(\w+)\s+[`"']?(.+?)[`"']?$" $semVerMatch = [regex] 'v?(\d+)\.(\d+).(\d+)(?:-(\w+))?' - $repositoryRootPath = Join-Path $PSScriptRoot .. | Resolve-Path if (!(git -C $repositoryRootPath rev-parse --is-inside-work-tree 2>$null)) { throw "$repositoryRootPath is not a git repository" } -$gitVersionHeaderPath = Join-Path $repositoryRootPath 'src' | Join-Path -ChildPath 'include' | Join-Path -ChildPath 'aegisub' ` - | Join-Path -ChildPath 'git_version.h' -$gitVersionXmlPath = Join-Path $repositoryRootPath 'packages' | Join-Path -ChildPath 'win_installer' ` - | Join-Path -ChildPath 'git_version.xml' +if ($BuildRoot -eq $null -or $BuildRoot.Trim() -eq "") { + $BuildRoot = $repositoryRootPath +} + +# support legacy in-tree builds +if ([System.IO.Path]::GetFullPath([System.IO.Path]::Combine((pwd).Path, $BuildRoot)) -eq + [System.IO.Path]::GetFullPath([System.IO.Path]::Combine((pwd).Path, $repositoryRootPath))) { + $BuildRoot = Join-Path $repositoryRootPath 'build' + } +$gitVersionHeaderPath = Join-Path $BuildRoot 'git_version.h' +$gitVersionXmlPath = Join-Path $repositoryRootPath 'build' | Join-Path -ChildPath 'git_version.xml' $version = @{} if (Test-Path $gitVersionHeaderPath) { From 37230683fba78959286db79926f8f65a7ddad829 Mon Sep 17 00:00:00 2001 From: line0 Date: Sat, 11 Apr 2020 01:14:53 +0200 Subject: [PATCH 126/271] utils: work around missing C++11 char16_t overload in wx string conversion --- src/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.cpp b/src/utils.cpp index 2416aa7a2..69c53bd1c 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -275,7 +275,7 @@ wxString LocalizedLanguageName(wxString const& lang) { icu::UnicodeString ustr; iculoc.getDisplayName(iculoc, ustr); #ifdef _MSC_VER - return wxString(ustr.getBuffer()); + return wxString((const wchar_t*)ustr.getBuffer()); #else std::string utf8; ustr.toUTF8String(utf8); From 88e24db7339e0fe65698c22dd2aec776eec733ff Mon Sep 17 00:00:00 2001 From: line0 Date: Sat, 11 Apr 2020 01:27:16 +0200 Subject: [PATCH 127/271] meson: add support for building wxWidgets as a subproject (WIP) monolithic build only and disabled precompiled headers due to limited cmake support in meson still missing linker dependencies refs to Windows SDK libs --- meson.build | 27 +++++++++++++++++++++++---- subprojects/wxWidgets.wrap | 5 +++++ 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 subprojects/wxWidgets.wrap diff --git a/meson.build b/meson.build index 20fc56fe0..c85f076bc 100644 --- a/meson.build +++ b/meson.build @@ -1,9 +1,11 @@ project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', - meson_version: '>=0.49.0', + meson_version: '>=0.51.0', default_options: ['c_std=c11', 'cpp_std=c++11', 'b_lto=true'], version: '3.2.2') +cmake = import('cmake') + if host_machine.system() == 'windows' version_sh = find_program('tools/version.ps1') else @@ -72,16 +74,33 @@ deps += dependency('zlib', fallback: ['zlib', 'zlib_dep']) wx_dep = dependency('wxWidgets', version: '>=3.0.0', required: cxx.get_id() != 'msvc', modules: ['std', 'stc', 'gl']) -if not wx_dep.found() # this will only be hit with msvc + +if wx_dep.found() + deps += wx_dep +else # this will only be hit with msvc if get_option('wx_path') != '' deps_inc += include_directories(get_option('wx_path') / 'include' / 'msvc', get_option('wx_path') / 'include') add_project_arguments('-DUNICODE', '-D_UNICODE', language: 'cpp') add_project_arguments('-DwxMSVC_VERSION_AUTO', '-DWXUSINGDLL', language: 'cpp') else - error('wxWidgets not found and no wx_path defined.') + buildShared = 'ON' + if get_option('default_library') == 'static' + buildShared = 'OFF' + endif + + wx = cmake.subproject('wxWidgets', cmake_options: ['-DwxBUILD_INSTALL=OFF', + '-DwxBUILD_PRECOMP=OFF', # breaks project generation w/ meson + '-DwxBUILD_SHARED=@0@'.format(buildShared), + '-DwxBUILD_MONOLITHIC=ON']) + deps += [ + wx.dependency('mono'), + wx.dependency('wxzlib'), + wx.dependency('wxpng'), + wx.dependency('wxexpat'), + wx.dependency('wxscintilla') + ] endif endif -deps += wx_dep icu_uc_dep = dependency('icu-uc', version: '>=4.8.1.1', required: cxx.get_id() != 'msvc') icu_i18n_dep = dependency('icu-i18n', version: '>=4.8.1.1', required: cxx.get_id() != 'msvc') diff --git a/subprojects/wxWidgets.wrap b/subprojects/wxWidgets.wrap new file mode 100644 index 000000000..a77194055 --- /dev/null +++ b/subprojects/wxWidgets.wrap @@ -0,0 +1,5 @@ +[wrap-git] +directory = wxWidgets +url = https://github.com/wxWidgets/wxWidgets.git +revision = master +clone-recursive = true \ No newline at end of file From bfdcbdefad0f177317748d85cbf93532c4063c45 Mon Sep 17 00:00:00 2001 From: line0 Date: Sun, 12 Apr 2020 21:51:28 +0200 Subject: [PATCH 128/271] meson: add missing link dependencies on windows --- meson.build | 23 +++++++++++++++++++---- src/meson.build | 14 ++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index c85f076bc..5ba12f0f0 100644 --- a/meson.build +++ b/meson.build @@ -89,9 +89,9 @@ else # this will only be hit with msvc endif wx = cmake.subproject('wxWidgets', cmake_options: ['-DwxBUILD_INSTALL=OFF', - '-DwxBUILD_PRECOMP=OFF', # breaks project generation w/ meson + '-DwxBUILD_PRECOMP=OFF', # otherwise breaks project generation w/ meson '-DwxBUILD_SHARED=@0@'.format(buildShared), - '-DwxBUILD_MONOLITHIC=ON']) + '-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson deps += [ wx.dependency('mono'), wx.dependency('wxzlib'), @@ -99,6 +99,19 @@ else # this will only be hit with msvc wx.dependency('wxexpat'), wx.dependency('wxscintilla') ] + + if host_machine.system() == 'windows' + if cc.has_header('rpc.h') + deps += cc.find_library('rpcrt4', required: true) + else + error('Missing Windows SDK RPC Library (rpc.h / rpcrt4.lib)') + endif + if cc.has_header('commctrl.h') + deps += cc.find_library('comctl32', required: true) + else + error('Missing Windows SDK Common Controls Library (commctrl.h / comctl32.lib)') + endif + endif endif endif @@ -155,8 +168,10 @@ if host_machine.system() == 'windows' and not get_option('directsound').disabled if not have_dsound_h and get_option('directsound').enabled() error('DirectSound enabled but dsound.h not found') endif - if dsound_dep.found() and winmm_dep.found() and ole32_dep.found() and have_dsound_h - deps += [dsound_dep, winmm_dep, ole32_dep] + + dxguid_dep = cc.find_library('dxguid', required: true) + if dsound_dep.found() and winmm_dep.found() and ole32_dep.found() and dxguid_dep.found() and have_dsound_h + deps += [dsound_dep, winmm_dep, ole32_dep, dxguid_dep] conf.set('WITH_DIRECTSOUND', '1') dep_avail += 'DirectSound' endif diff --git a/src/meson.build b/src/meson.build index e01353ae4..bf932654e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -171,6 +171,20 @@ if host_machine.system() == 'darwin' 'osx/retina_helper.mm', 'osx/scintilla_ime.mm', ] +elif host_machine.system() == 'windows' + aegisub_src += [ + 'font_file_lister_gdi.cpp' + ] + if cc.has_header('wingdi.h') + deps += cc.find_library('gdi32', required: true) + else + error('Missing Windows SDK GDI Library (wingdi.h / gdi32.lib)') + endif + if cc.has_header('usp10.h') + deps += cc.find_library('usp10', required: true) + else + error('Missing Windows SDK Uniscribe Library (usp10.h / usp10.lib)') + endif elif conf.get('WITH_FONTCONFIG') == '1' aegisub_src += 'font_file_lister_fontconfig.cpp' endif From 2e613f547695d5ecc829afb3743f09c7d2ac249f Mon Sep 17 00:00:00 2001 From: line0 Date: Thu, 21 May 2020 09:07:58 +0200 Subject: [PATCH 129/271] meson: flag aegisub as a GUI app --- src/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index bf932654e..7e5dc7788 100644 --- a/src/meson.build +++ b/src/meson.build @@ -220,4 +220,5 @@ aegisub = executable('aegisub', aegisub_src, version_h, acconf, cpp_pch: aegisub_cpp_pch, c_pch: aegisub_c_pch, install: true, - dependencies: deps) + dependencies: deps, + gui_app: true) From f6b74331dae472ad855a6eaa9fb238f609ac04de Mon Sep 17 00:00:00 2001 From: Myaamori Date: Tue, 27 Oct 2020 17:02:31 +0000 Subject: [PATCH 130/271] meson: update zlib wrapper --- meson.build | 4 ++-- subprojects/zlib.wrap | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 5ba12f0f0..afcf8e247 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', - meson_version: '>=0.51.0', + meson_version: '>=0.55.0', default_options: ['c_std=c11', 'cpp_std=c++11', 'b_lto=true'], version: '3.2.2') @@ -69,7 +69,7 @@ if host_machine.system() == 'windows' conf.set('BOOST_USE_WINDOWS_H', '1') endif -deps += dependency('zlib', fallback: ['zlib', 'zlib_dep']) +deps += dependency('zlib') wx_dep = dependency('wxWidgets', version: '>=3.0.0', required: cxx.get_id() != 'msvc', diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap index 91c1d4d99..ce20fb053 100644 --- a/subprojects/zlib.wrap +++ b/subprojects/zlib.wrap @@ -1,10 +1,12 @@ [wrap-file] directory = zlib-1.2.11 - source_url = http://zlib.net/fossils/zlib-1.2.11.tar.gz source_filename = zlib-1.2.11.tar.gz source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 +patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/5/get_zip +patch_filename = zlib-1.2.11-5-wrap.zip +patch_hash = 728c8e24acbc2e6682fbd950fec39e2fc77528af361adb87259f8a8511434004 + +[provide] +zlib = zlib_dep -patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/4/get_zip -patch_filename = zlib-1.2.11-4-wrap.zip -patch_hash = f733976fbfc59e0bcde01aa9469a24eeb16faf0a4280b17e9eaa60a301d75657 From 1fc019447ae3cd696a0b80ec9b44e013d5229017 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Tue, 27 Oct 2020 17:06:35 +0000 Subject: [PATCH 131/271] meson: enable Lua 5.2 compat for both native and host builds --- subprojects/luajit/meson.build | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/subprojects/luajit/meson.build b/subprojects/luajit/meson.build index 2a838bd18..bc74a2935 100644 --- a/subprojects/luajit/meson.build +++ b/subprojects/luajit/meson.build @@ -7,21 +7,23 @@ system_deps = [ cc.find_library('m', required: false) ] -add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', language: 'c') +# compat flag is needed for both the buildvm code generator (compiled natively) and luajit itself +add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', language: 'c', native: true) +add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', language: 'c', native: false) if host_machine.system() == 'linux' - add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_LINUX', language: 'c') + add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_LINUX', language: 'c', native: true) readline_dep = cc.find_library('readline') ljvm_mode = 'elfasm' ljvm_bout = 'lj_vm.s' elif host_machine.system() == 'darwin' - add_project_arguments(['-DLUAJIT_OS=LUAJIT_OS_OSX'], language: 'c') + add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_OSX', language: 'c', native: true) readline_dep = cc.find_library('readline') ljvm_mode = 'machasm' ljvm_bout = 'lj_vm.s' elif host_machine.system() == 'windows' - add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_WINDOWS', language: 'c') + add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_WINDOWS', language: 'c', native: true) if cc.get_id() != 'msvc' - add_project_arguments('-malign-double', language: 'c') + add_project_arguments('-malign-double', language: 'c', native: true) endif readline_dep = [] ljvm_mode = 'peobj' From 130339a3d6c4349eb7875b6d27d0b615941c317e Mon Sep 17 00:00:00 2001 From: Myaamori Date: Tue, 27 Oct 2020 17:07:14 +0000 Subject: [PATCH 132/271] meson: set correct flags when compiling LuaJIT on Windows --- subprojects/luajit/src/host/meson.build | 44 +++++++++++++++---------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/subprojects/luajit/src/host/meson.build b/subprojects/luajit/src/host/meson.build index d6ae5c943..5354f153f 100644 --- a/subprojects/luajit/src/host/meson.build +++ b/subprojects/luajit/src/host/meson.build @@ -11,25 +11,33 @@ endif dynasm_dasc = files('../vm_@0@.dasc'.format(dynasm_arch)) dasm = [minilua, files('../../dynasm/dynasm.lua')] -# BUG: meson does not resolve paths correctly for subprojects -hpre = '#include "@0@/../lj_arch.h"'.format(meson.current_source_dir()) - -checkdefs = [ - ['LJ_ARCH_BITS', '64', ['-D', 'P64']], - ['LJ_HASJIT', '1', ['-D', 'JIT']], - ['LJ_HASFFI', '1', ['-D', 'FFI']], - ['LJ_DUALNUM', '1', ['-D', 'DUALNUM']], -] - -if host_machine.cpu_family() == 'x86' - checkdefs += ['__SSE2__', '1', ['-D', 'SSE']] -endif - -foreach def: checkdefs - if cc.get_define(def[0], prefix: hpre) == def[1] - dasm += def[2] +if cc.get_id() == 'msvc' + # the cl.exe preprocessor seemingly removes/expands macros, so hardcode flags + dasm += ['-D', 'WIN', '-D', 'JIT', '-D', 'FFI'] + if host_machine.cpu_family() == 'x86_64' + dasm += ['-D', 'P64'] endif -endforeach +else + # BUG: meson does not resolve paths correctly for subprojects + hpre = '#include "@0@/../lj_arch.h"'.format(meson.current_source_dir()) + + checkdefs = [ + ['LJ_ARCH_BITS', '64', ['-D', 'P64']], + ['LJ_HASJIT', '1', ['-D', 'JIT']], + ['LJ_HASFFI', '1', ['-D', 'FFI']], + ['LJ_DUALNUM', '1', ['-D', 'DUALNUM']], + ] + + if host_machine.cpu_family() == 'x86' + checkdefs += ['__SSE2__', '1', ['-D', 'SSE']] + endif + + foreach def: checkdefs + if cc.get_define(def[0], prefix: hpre) == def[1] + dasm += def[2] + endif + endforeach +endif buildvm_src = files( 'buildvm.c', From 64df2d61c79836193b8c0e9b8023b389db87beda Mon Sep 17 00:00:00 2001 From: Myaamori Date: Tue, 27 Oct 2020 17:07:46 +0000 Subject: [PATCH 133/271] meson: have iconv subproject override iconv dependency --- subprojects/iconv/meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subprojects/iconv/meson.build b/subprojects/iconv/meson.build index eee208a42..66cdc9806 100644 --- a/subprojects/iconv/meson.build +++ b/subprojects/iconv/meson.build @@ -17,3 +17,5 @@ iconv_incs = include_directories( libiconv = static_library('iconv', iconv_src, include_directories: iconv_incs) libiconv_dep = declare_dependency(link_with: libiconv, include_directories: iconv_incs) + +meson.override_dependency('iconv', libiconv_dep) From d6ee06eb544629968dc80f9619d4a1631d0ce2a9 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Tue, 27 Oct 2020 17:09:32 +0000 Subject: [PATCH 134/271] meson: add ICU wrap --- meson.build | 19 +- subprojects/icu.wrap | 11 + subprojects/packagefiles/icu/meson.build | 32 +++ .../icu/source/common/meson.build | 202 +++++++++++++++ .../icu/source/data/generate_icupkg_inc.py | 53 ++++ .../packagefiles/icu/source/data/meson.build | 44 ++++ .../packagefiles/icu/source/i18n/meson.build | 239 ++++++++++++++++++ .../packagefiles/icu/source/io/meson.build | 18 ++ .../packagefiles/icu/source/meson.build | 80 ++++++ .../icu/source/stubdata/meson.build | 1 + .../icu/source/tools/ctestfw/meson.build | 18 ++ .../icu/source/tools/icupkg/meson.build | 3 + .../icu/source/tools/pkgdata/meson.build | 3 + .../icu/source/tools/toolutil/meson.build | 30 +++ 14 files changed, 736 insertions(+), 17 deletions(-) create mode 100644 subprojects/icu.wrap create mode 100644 subprojects/packagefiles/icu/meson.build create mode 100644 subprojects/packagefiles/icu/source/common/meson.build create mode 100755 subprojects/packagefiles/icu/source/data/generate_icupkg_inc.py create mode 100644 subprojects/packagefiles/icu/source/data/meson.build create mode 100644 subprojects/packagefiles/icu/source/i18n/meson.build create mode 100644 subprojects/packagefiles/icu/source/io/meson.build create mode 100644 subprojects/packagefiles/icu/source/meson.build create mode 100644 subprojects/packagefiles/icu/source/stubdata/meson.build create mode 100644 subprojects/packagefiles/icu/source/tools/ctestfw/meson.build create mode 100644 subprojects/packagefiles/icu/source/tools/icupkg/meson.build create mode 100644 subprojects/packagefiles/icu/source/tools/pkgdata/meson.build create mode 100644 subprojects/packagefiles/icu/source/tools/toolutil/meson.build diff --git a/meson.build b/meson.build index afcf8e247..3e5301c82 100644 --- a/meson.build +++ b/meson.build @@ -115,23 +115,8 @@ else # this will only be hit with msvc endif endif -icu_uc_dep = dependency('icu-uc', version: '>=4.8.1.1', required: cxx.get_id() != 'msvc') -icu_i18n_dep = dependency('icu-i18n', version: '>=4.8.1.1', required: cxx.get_id() != 'msvc') -if not (icu_uc_dep.found() and icu_i18n_dep.found()) - if get_option('icu_path') != '' - deps_inc += include_directories(get_option('icu_path') / 'include') - else - error('ICU not found and no icu_path defined.') - endif -endif -if not icu_uc_dep.found() - icu_uc_dep = cxx.find_library('icuuc', dirs: get_option('icu_path') / 'lib64') -endif -deps += icu_uc_dep -if not icu_i18n_dep.found() - icu_i18n_dep = cxx.find_library('icuin', dirs: get_option('icu_path') / 'lib64') -endif -deps += icu_i18n_dep +deps += dependency('icu-uc', version: '>=4.8.1.1') +deps += dependency('icu-i18n', version: '>=4.8.1.1') dep_avail = [] foreach dep: [ diff --git a/subprojects/icu.wrap b/subprojects/icu.wrap new file mode 100644 index 000000000..3aaf822c6 --- /dev/null +++ b/subprojects/icu.wrap @@ -0,0 +1,11 @@ +[wrap-file] +directory = icu +source_url = https://github.com/unicode-org/icu/releases/download/release-67-1/icu4c-67_1-src.tgz +source_filename = icu4c-67_1-src.tgz +source_hash = 94a80cd6f251a53bd2a997f6f1b5ac6653fe791dfab66e1eb0227740fb86d5dc +patch_directory = icu + +[provide] +icu-uc = icuuc_dep +icu-io = icuio_dep +icu-i18n = icui18n_dep diff --git a/subprojects/packagefiles/icu/meson.build b/subprojects/packagefiles/icu/meson.build new file mode 100644 index 000000000..11e1cc25b --- /dev/null +++ b/subprojects/packagefiles/icu/meson.build @@ -0,0 +1,32 @@ +project('icu', 'c', 'cpp', + version: '67.1', + meson_version: '>=0.55.0', + default_options: 'cpp_std=c++17') + +cpp = meson.get_compiler('cpp') + +if host_machine.system() == 'windows' + add_project_arguments('-DWIN32', '-DWIN64', '-D_MBCS', '/utf-8', language : 'cpp') + add_project_arguments('-DWIN32', '-DWIN64', '-D_MBCS', '/utf-8', language : 'c') +endif + +if cpp.has_header('elf.h') + add_project_arguments('-DU_HAVE_ELF_H=1', language: 'c') + add_project_arguments('-DU_HAVE_ELF_H=1', language: 'cpp') +endif + +dl_dep = cpp.find_library('dl', required: false) +thread_dep = dependency('threads') + +# Compiler flags the users of this library must use. +usage_args = [] + +if get_option('default_library') == 'static' + add_project_arguments('-DU_STATIC_IMPLEMENTATION', language : 'c') + add_project_arguments('-DU_STATIC_IMPLEMENTATION', language : 'cpp') + usage_args = ['-DU_STATIC_IMPLEMENTATION'] +elif host_machine.system() == 'windows' + error('Shared library build not supported on Windows. Set default_library to static.') +endif + +subdir('source') diff --git a/subprojects/packagefiles/icu/source/common/meson.build b/subprojects/packagefiles/icu/source/common/meson.build new file mode 100644 index 000000000..6dad1a77a --- /dev/null +++ b/subprojects/packagefiles/icu/source/common/meson.build @@ -0,0 +1,202 @@ +uc_sources = files( + 'errorcode.cpp', + 'putil.cpp', + 'umath.cpp', + 'utypes.cpp', + 'uinvchar.cpp', + 'umutex.cpp', + 'ucln_cmn.cpp', + 'uinit.cpp', + 'uobject.cpp', + 'cmemory.cpp', + 'charstr.cpp', + 'cstr.cpp', + 'udata.cpp', + 'ucmndata.cpp', + 'udatamem.cpp', + 'umapfile.cpp', + 'udataswp.cpp', + 'utrie_swap.cpp', + 'ucol_swp.cpp', + 'utrace.cpp', + 'uhash.cpp', + 'uhash_us.cpp', + 'uenum.cpp', + 'ustrenum.cpp', + 'uvector.cpp', + 'ustack.cpp', + 'uvectr32.cpp', + 'uvectr64.cpp', + 'ucnv.cpp', + 'ucnv_bld.cpp', + 'ucnv_cnv.cpp', + 'ucnv_io.cpp', + 'ucnv_cb.cpp', + 'ucnv_err.cpp', + 'ucnvlat1.cpp', + 'ucnv_u7.cpp', + 'ucnv_u8.cpp', + 'ucnv_u16.cpp', + 'ucnv_u32.cpp', + 'ucnvscsu.cpp', + 'ucnvbocu.cpp', + 'ucnv_ext.cpp', + 'ucnvmbcs.cpp', + 'ucnv2022.cpp', + 'ucnvhz.cpp', + 'ucnv_lmb.cpp', + 'ucnvisci.cpp', + 'ucnvdisp.cpp', + 'ucnv_set.cpp', + 'ucnv_ct.cpp', + 'resource.cpp', + 'uresbund.cpp', + 'ures_cnv.cpp', + 'uresdata.cpp', + 'resbund.cpp', + 'resbund_cnv.cpp', + 'ucurr.cpp', + 'localebuilder.cpp', + 'localeprioritylist.cpp', + 'messagepattern.cpp', + 'ucat.cpp', + 'locmap.cpp', + 'uloc.cpp', + 'locid.cpp', + 'locutil.cpp', + 'locavailable.cpp', + 'locdispnames.cpp', + 'locdspnm.cpp', + 'loclikely.cpp', + 'locresdata.cpp', + 'lsr.cpp', + 'loclikelysubtags.cpp', + 'locdistance.cpp', + 'localematcher.cpp', + 'bytestream.cpp', + 'stringpiece.cpp', + 'bytesinkutil.cpp', + 'stringtriebuilder.cpp', + 'bytestriebuilder.cpp', + 'bytestrie.cpp', + 'bytestrieiterator.cpp', + 'ucharstrie.cpp', + 'ucharstriebuilder.cpp', + 'ucharstrieiterator.cpp', + 'dictionarydata.cpp', + 'edits.cpp', + 'appendable.cpp', + 'ustr_cnv.cpp', + 'unistr_cnv.cpp', + 'unistr.cpp', + 'unistr_case.cpp', + 'unistr_props.cpp', + 'utf_impl.cpp', + 'ustring.cpp', + 'ustrcase.cpp', + 'ucasemap.cpp', + 'ucasemap_titlecase_brkiter.cpp', + 'cstring.cpp', + 'ustrfmt.cpp', + 'ustrtrns.cpp', + 'ustr_wcs.cpp', + 'utext.cpp', + 'unistr_case_locale.cpp', + 'ustrcase_locale.cpp', + 'unistr_titlecase_brkiter.cpp', + 'ustr_titlecase_brkiter.cpp', + 'normalizer2impl.cpp', + 'normalizer2.cpp', + 'filterednormalizer2.cpp', + 'normlzr.cpp', + 'unorm.cpp', + 'unormcmp.cpp', + 'loadednormalizer2impl.cpp', + 'chariter.cpp', + 'schriter.cpp', + 'uchriter.cpp', + 'uiter.cpp', + 'patternprops.cpp', + 'uchar.cpp', + 'uprops.cpp', + 'ucase.cpp', + 'propname.cpp', + 'ubidi_props.cpp', + 'characterproperties.cpp', + 'ubidi.cpp', + 'ubidiwrt.cpp', + 'ubidiln.cpp', + 'ushape.cpp', + 'uscript.cpp', + 'uscript_props.cpp', + 'usc_impl.cpp', + 'unames.cpp', + 'utrie.cpp', + 'utrie2.cpp', + 'utrie2_builder.cpp', + 'ucptrie.cpp', + 'umutablecptrie.cpp', + 'bmpset.cpp', + 'unisetspan.cpp', + 'uset_props.cpp', + 'uniset_props.cpp', + 'uniset_closure.cpp', + 'uset.cpp', + 'uniset.cpp', + 'usetiter.cpp', + 'ruleiter.cpp', + 'caniter.cpp', + 'unifilt.cpp', + 'unifunct.cpp', + 'uarrsort.cpp', + 'brkiter.cpp', + 'ubrk.cpp', + 'brkeng.cpp', + 'dictbe.cpp', + 'filteredbrk.cpp', + 'rbbi.cpp', + 'rbbidata.cpp', + 'rbbinode.cpp', + 'rbbirb.cpp', + 'rbbiscan.cpp', + 'rbbisetb.cpp', + 'rbbistbl.cpp', + 'rbbitblb.cpp', + 'rbbi_cache.cpp', + 'serv.cpp', + 'servnotf.cpp', + 'servls.cpp', + 'servlk.cpp', + 'servlkf.cpp', + 'servrbf.cpp', + 'servslkf.cpp', + 'uidna.cpp', + 'usprep.cpp', + 'uts46.cpp', + 'punycode.cpp', + 'util.cpp', + 'util_props.cpp', + 'parsepos.cpp', + 'locbased.cpp', + 'cwchar.cpp', + 'wintz.cpp', + 'dtintrv.cpp', + 'ucnvsel.cpp', + 'propsvec.cpp', + 'ulist.cpp', + 'uloc_tag.cpp', + 'icudataver.cpp', + 'icuplug.cpp', + 'sharedobject.cpp', + 'simpleformatter.cpp', + 'unifiedcache.cpp', + 'uloc_keytype.cpp', + 'ubiditransform.cpp', + 'pluralmap.cpp', + 'static_unicode_sets.cpp', + 'restrace.cpp', +) + +uc_args = ['-DU_COMMON_IMPLEMENTATION'] +uc_link = [] +uc_deps = dl_dep diff --git a/subprojects/packagefiles/icu/source/data/generate_icupkg_inc.py b/subprojects/packagefiles/icu/source/data/generate_icupkg_inc.py new file mode 100755 index 000000000..c4265c686 --- /dev/null +++ b/subprojects/packagefiles/icu/source/data/generate_icupkg_inc.py @@ -0,0 +1,53 @@ +import json +import sys + +host = sys.argv[1] +cpu_family = sys.argv[2] +outfile = sys.argv[3] + +with open('meson-info/intro-targets.json', 'r') as f: + targets = json.load(f) + +def get_arguments(name): + target = next(target for target in targets + if target['name'] == name) + sources = next(sources for sources in target['target_sources'] + if sources['language'] == 'c') + return sources['compiler'] + sources['parameters'] + +def quote(arguments): + return " ".join(json.dumps(arg) for arg in arguments) + +obj_arguments = get_arguments("pkgdata") + ['-c'] +lib_arguments = get_arguments("icutest") + ['-Wl,-Bsymbolic'] + +config = { + 'A': 'a', + 'LIBPREFIX': 'lib', + 'LIB_EXT_ORDER': '.', + 'COMPILE': quote(obj_arguments), + 'LIBFLAGS': '', # already included in COMPILE + 'LDICUDTFLAGS': '-nodefaultlibs -nostdlib', + 'RPATH_FLAGS': '', + 'BIR_LDFLAGS': '-Wl,-Bsymbolic', + 'AR': 'ar', + 'ARFLAGS': 'r', + 'RANLIB': 'ranlib', + 'LD_SONAME': '', + 'INSTALL_CMD': '' +} + +if host == 'darwin': + config['GENCCODE_ASSEMBLY_TYPE'] = '-a gcc-darwin' + config['SO'] = 'dylib' + config['SOBJ'] = 'dylib' + config['GENLIB'] = quote(lib_arguments + ['-dynamiclib', '-dynamic']) +else: + config['GENCCODE_ASSEMBLY_TYPE'] = '-a gcc' + config['SO'] = 'so' + config['SOBJ'] = 'so' + config['GENLIB'] = quote(lib_arguments + ['-shared']) + +with open(outfile, 'w') as f: + for k, v in config.items(): + f.write("{}={}\n".format(k, v)) diff --git a/subprojects/packagefiles/icu/source/data/meson.build b/subprojects/packagefiles/icu/source/data/meson.build new file mode 100644 index 000000000..ebac3b413 --- /dev/null +++ b/subprojects/packagefiles/icu/source/data/meson.build @@ -0,0 +1,44 @@ +icudata_lst = custom_target('icudata.lst', + # not sure how to ensure that @PRIVATE_DIR@ exists + #command: [icupkg, '-d', '@PRIVATE_DIR@', '--list', '-x', '*', '@INPUT@', '-o', '@OUTPUT@'], + command: [icupkg, '-d', '@OUTDIR@', '--list', '-x', '*', '@INPUT@', '-o', '@OUTPUT@'], + input: files('in/icudt67l.dat'), + output: 'icudata.lst') + +is_static = get_option('default_library') == 'static' + +if host_machine.system() == 'windows' # only msvc supported + data_lib_static = custom_target( + 'icudata_static', command: [pkgdata, '-q', '-c', '-e', 'icudt67', '-L', 'icudata_static', + '-d', '@OUTDIR@', '-s', '@OUTDIR@', '-p', 'icudt67l', + '-m', 'static', '@INPUT@'], + input: icudata_lst, output: 'icudata_static.lib') +else + if host_machine.system() == 'darwin' + suffix = is_static ? '.a' : '.dylib' + else + suffix = is_static ? '.a' : '.so' + endif + suffix = '.a' + + icupkg_inc = custom_target('icupkg.inc', + command: [python3, '@INPUT@', host_machine.system(), + host_machine.cpu_family(), '@OUTPUT@'], + input: 'generate_icupkg_inc.py', + output: 'icupkg.inc') + data_lib_static = custom_target( + 'icudata_static', command: [pkgdata, '-q', '-c', '-e', 'icudt67', '-L', 'icudata_static', + '-d', '@OUTDIR@', '-s', '@OUTDIR@', + '-p', 'icudt67l', '-O', icupkg_inc, + '-m', 'static', '@INPUT@'], + input: icudata_lst, output: 'libicudata_static' + suffix) +endif + +if is_static + data_lib = data_lib_static +else + # convert to proper library object to make sure rpath gets set properly + data_lib = library('icudata', link_whole: data_lib_static) +endif + +# -nodefaultlibs -nostdlib for stubdata diff --git a/subprojects/packagefiles/icu/source/i18n/meson.build b/subprojects/packagefiles/icu/source/i18n/meson.build new file mode 100644 index 000000000..916e39622 --- /dev/null +++ b/subprojects/packagefiles/icu/source/i18n/meson.build @@ -0,0 +1,239 @@ +i18n_sources = files( + 'ucln_in.cpp', + 'fmtable.cpp', + 'format.cpp', + 'msgfmt.cpp', + 'umsg.cpp', + 'numfmt.cpp', + 'unum.cpp', + 'decimfmt.cpp', + 'dcfmtsym.cpp', + 'fmtable_cnv.cpp', + 'choicfmt.cpp', + 'datefmt.cpp', + 'smpdtfmt.cpp', + 'reldtfmt.cpp', + 'dtfmtsym.cpp', + 'udat.cpp', + 'dtptngen.cpp', + 'udatpg.cpp', + 'nfrs.cpp', + 'nfrule.cpp', + 'nfsubs.cpp', + 'rbnf.cpp', + 'numsys.cpp', + 'unumsys.cpp', + 'ucsdet.cpp', + 'ucal.cpp', + 'calendar.cpp', + 'gregocal.cpp', + 'timezone.cpp', + 'simpletz.cpp', + 'olsontz.cpp', + 'astro.cpp', + 'taiwncal.cpp', + 'buddhcal.cpp', + 'persncal.cpp', + 'islamcal.cpp', + 'japancal.cpp', + 'gregoimp.cpp', + 'hebrwcal.cpp', + 'indiancal.cpp', + 'chnsecal.cpp', + 'cecal.cpp', + 'coptccal.cpp', + 'dangical.cpp', + 'ethpccal.cpp', + 'coleitr.cpp', + 'coll.cpp', + 'sortkey.cpp', + 'bocsu.cpp', + 'ucoleitr.cpp', + 'ucol.cpp', + 'ucol_res.cpp', + 'ucol_sit.cpp', + 'collation.cpp', + 'collationsettings.cpp', + 'collationdata.cpp', + 'collationtailoring.cpp', + 'collationdatareader.cpp', + 'collationdatawriter.cpp', + 'collationfcd.cpp', + 'collationiterator.cpp', + 'utf16collationiterator.cpp', + 'utf8collationiterator.cpp', + 'uitercollationiterator.cpp', + 'collationsets.cpp', + 'collationcompare.cpp', + 'collationfastlatin.cpp', + 'collationkeys.cpp', + 'rulebasedcollator.cpp', + 'collationroot.cpp', + 'collationrootelements.cpp', + 'collationdatabuilder.cpp', + 'collationweights.cpp', + 'collationruleparser.cpp', + 'collationbuilder.cpp', + 'collationfastlatinbuilder.cpp', + 'listformatter.cpp', + 'ulistformatter.cpp', + 'strmatch.cpp', + 'usearch.cpp', + 'search.cpp', + 'stsearch.cpp', + 'translit.cpp', + 'utrans.cpp', + 'esctrn.cpp', + 'unesctrn.cpp', + 'funcrepl.cpp', + 'strrepl.cpp', + 'tridpars.cpp', + 'cpdtrans.cpp', + 'rbt.cpp', + 'rbt_data.cpp', + 'rbt_pars.cpp', + 'rbt_rule.cpp', + 'rbt_set.cpp', + 'nultrans.cpp', + 'remtrans.cpp', + 'casetrn.cpp', + 'titletrn.cpp', + 'tolowtrn.cpp', + 'toupptrn.cpp', + 'anytrans.cpp', + 'name2uni.cpp', + 'uni2name.cpp', + 'nortrans.cpp', + 'quant.cpp', + 'transreg.cpp', + 'brktrans.cpp', + 'regexcmp.cpp', + 'rematch.cpp', + 'repattrn.cpp', + 'regexst.cpp', + 'regextxt.cpp', + 'regeximp.cpp', + 'uregex.cpp', + 'uregexc.cpp', + 'ulocdata.cpp', + 'measfmt.cpp', + 'currfmt.cpp', + 'curramt.cpp', + 'currunit.cpp', + 'measure.cpp', + 'utmscale.cpp', + 'csdetect.cpp', + 'csmatch.cpp', + 'csr2022.cpp', + 'csrecog.cpp', + 'csrmbcs.cpp', + 'csrsbcs.cpp', + 'csrucode.cpp', + 'csrutf8.cpp', + 'inputext.cpp', + 'wintzimpl.cpp', + 'windtfmt.cpp', + 'winnmfmt.cpp', + 'basictz.cpp', + 'dtrule.cpp', + 'rbtz.cpp', + 'tzrule.cpp', + 'tztrans.cpp', + 'vtzone.cpp', + 'zonemeta.cpp', + 'standardplural.cpp', + 'upluralrules.cpp', + 'plurrule.cpp', + 'plurfmt.cpp', + 'selfmt.cpp', + 'dtitvfmt.cpp', + 'dtitvinf.cpp', + 'udateintervalformat.cpp', + 'tmunit.cpp', + 'tmutamt.cpp', + 'tmutfmt.cpp', + 'currpinf.cpp', + 'uspoof.cpp', + 'uspoof_impl.cpp', + 'uspoof_build.cpp', + 'uspoof_conf.cpp', + 'smpdtfst.cpp', + 'ztrans.cpp', + 'zrule.cpp', + 'vzone.cpp', + 'fphdlimp.cpp', + 'fpositer.cpp', + 'ufieldpositer.cpp', + 'decNumber.cpp', + 'decContext.cpp', + 'alphaindex.cpp', + 'tznames.cpp', + 'tznames_impl.cpp', + 'tzgnames.cpp', + 'tzfmt.cpp', + 'compactdecimalformat.cpp', + 'gender.cpp', + 'region.cpp', + 'scriptset.cpp', + 'uregion.cpp', + 'reldatefmt.cpp', + 'quantityformatter.cpp', + 'measunit.cpp', + 'measunit_extra.cpp', + 'sharedbreakiterator.cpp', + 'scientificnumberformatter.cpp', + 'dayperiodrules.cpp', + 'nounit.cpp', + 'number_affixutils.cpp', + 'number_compact.cpp', + 'number_decimalquantity.cpp', + 'number_decimfmtprops.cpp', + 'number_fluent.cpp', + 'number_formatimpl.cpp', + 'number_grouping.cpp', + 'number_integerwidth.cpp', + 'number_longnames.cpp', + 'number_modifiers.cpp', + 'number_notation.cpp', + 'number_output.cpp', + 'number_padding.cpp', + 'number_patternmodifier.cpp', + 'number_patternstring.cpp', + 'number_rounding.cpp', + 'number_scientific.cpp', + 'number_utils.cpp', + 'number_asformat.cpp', + 'number_mapper.cpp', + 'number_multiplier.cpp', + 'number_currencysymbols.cpp', + 'number_skeletons.cpp', + 'number_capi.cpp', + 'double-conversion-string-to-double.cpp', + 'double-conversion-double-to-string.cpp', + 'double-conversion-bignum-dtoa.cpp', + 'double-conversion-bignum.cpp', + 'double-conversion-cached-powers.cpp', + 'double-conversion-fast-dtoa.cpp', + 'double-conversion-strtod.cpp', + 'string_segment.cpp', + 'numparse_parsednumber.cpp', + 'numparse_impl.cpp', + 'numparse_symbols.cpp', + 'numparse_decimal.cpp', + 'numparse_scientific.cpp', + 'numparse_currency.cpp', + 'numparse_affixes.cpp', + 'numparse_compositions.cpp', + 'numparse_validators.cpp', + 'numrange_fluent.cpp', + 'numrange_impl.cpp', + 'erarules.cpp', + 'formattedvalue.cpp', + 'formattedval_iterimpl.cpp', + 'formattedval_sbimpl.cpp', + 'formatted_string_builder.cpp', +) + +i18n_args = '-DU_I18N_IMPLEMENTATION' +i18n_link = ['uc'] +i18n_deps = [] diff --git a/subprojects/packagefiles/icu/source/io/meson.build b/subprojects/packagefiles/icu/source/io/meson.build new file mode 100644 index 000000000..514c0924d --- /dev/null +++ b/subprojects/packagefiles/icu/source/io/meson.build @@ -0,0 +1,18 @@ +io_sources = files( + 'locbund.cpp', + 'ufile.cpp', + 'ufmt_cmn.cpp', + 'uprintf.cpp', + 'uprntf_p.cpp', + 'uscanf.cpp', + 'uscanf_p.cpp', + 'ustdio.cpp', + 'sprintf.cpp', + 'sscanf.cpp', + 'ustream.cpp', + 'ucln_io.cpp', +) + +io_args = '-DU_IO_IMPLEMENTATION' +io_link = ['i18n', 'uc'] +io_deps = [] diff --git a/subprojects/packagefiles/icu/source/meson.build b/subprojects/packagefiles/icu/source/meson.build new file mode 100644 index 000000000..a144c9db3 --- /dev/null +++ b/subprojects/packagefiles/icu/source/meson.build @@ -0,0 +1,80 @@ +python3 = import('python').find_installation('python3') + +incdir = include_directories('common', 'i18n') +toolinc = include_directories('tools/toolutil') +ctestinc = include_directories('tools/ctestfw') + +subdir('stubdata') + +# get sources and dependencies for required libraries +subdir('common') +subdir('i18n') +subdir('io') +subdir('tools/toolutil') + +# create [library name]_lib_stub artifacts linking against stub data +icu_libs = ['uc', 'i18n', 'io', 'tu'] +foreach lib: icu_libs + liblinks = [] + foreach link: get_variable(lib + '_link') + liblinks += get_variable(link + '_lib_stub') + endforeach + set_variable(lib + '_lib_stub', library( + 'icu' + lib + '_stub', + get_variable(lib + '_sources'), + include_directories: incdir, + c_args: get_variable(lib + '_args'), + cpp_args: get_variable(lib + '_args'), + link_with: liblinks + [stubdata_lib], + dependencies: get_variable(lib + '_deps') + )) +endforeach + +# build tools and full data library using the libraries linked with the stub library +subdir('tools/icupkg') +subdir('tools/pkgdata') +subdir('data') + +# rebuild libraries linking with the full data library +foreach lib: icu_libs + liblinks = [] + foreach link: get_variable(lib + '_link') + liblinks += get_variable(link + '_lib') + endforeach + set_variable(lib + '_lib', library( + 'icu' + lib, + get_variable(lib + '_sources'), + include_directories: incdir, + c_args: get_variable(lib + '_args'), + cpp_args: get_variable(lib + '_args'), + link_with: liblinks + [data_lib], + dependencies: get_variable(lib + '_deps') + )) +endforeach + +# icutest not needed for bootstrapping, link with non-boostrap libs +subdir('tools/ctestfw') + +icudata_dep = declare_dependency(link_with: [data_lib], + compile_args: usage_args, + include_directories: incdir) + +icuuc_dep = declare_dependency(link_with: [uc_lib], + compile_args: usage_args, + include_directories: incdir) + +icuio_dep = declare_dependency(link_with: [io_lib], + compile_args: usage_args, + include_directories: incdir) + +icui18n_dep = declare_dependency(link_with: [i18n_lib], + compile_args: usage_args, + include_directories: incdir) + +icutu_dep = declare_dependency(link_with: [tu_lib], + compile_args: usage_args, + include_directories: incdir) + +icutest_dep = declare_dependency(link_with: [test_lib], + compile_args: usage_args, + include_directories: [incdir, ctestinc]) diff --git a/subprojects/packagefiles/icu/source/stubdata/meson.build b/subprojects/packagefiles/icu/source/stubdata/meson.build new file mode 100644 index 000000000..599aac88c --- /dev/null +++ b/subprojects/packagefiles/icu/source/stubdata/meson.build @@ -0,0 +1 @@ +stubdata_lib = library('icudata', 'stubdata.cpp', include_directories: incdir) diff --git a/subprojects/packagefiles/icu/source/tools/ctestfw/meson.build b/subprojects/packagefiles/icu/source/tools/ctestfw/meson.build new file mode 100644 index 000000000..0deee6d85 --- /dev/null +++ b/subprojects/packagefiles/icu/source/tools/ctestfw/meson.build @@ -0,0 +1,18 @@ +test_sources = files( + 'ctest.c', + 'tstdtmod.cpp', + 'testdata.cpp', + 'datamap.cpp', + 'uperf.cpp', + 'ucln_ct.c', +) + +test_args = '-DT_CTEST_IMPLEMENTATION' + +test_lib = library('icutest', + test_sources, + include_directories: [incdir, toolinc], + c_args: test_args, + cpp_args: test_args, + link_with: [data_lib, tu_lib, uc_lib], +) diff --git a/subprojects/packagefiles/icu/source/tools/icupkg/meson.build b/subprojects/packagefiles/icu/source/tools/icupkg/meson.build new file mode 100644 index 000000000..ef96ae33a --- /dev/null +++ b/subprojects/packagefiles/icu/source/tools/icupkg/meson.build @@ -0,0 +1,3 @@ +icupkg = executable('icupkg', 'icupkg.cpp', + include_directories: [incdir, toolinc], + link_with: [tu_lib_stub, i18n_lib_stub, uc_lib_stub, stubdata_lib]) diff --git a/subprojects/packagefiles/icu/source/tools/pkgdata/meson.build b/subprojects/packagefiles/icu/source/tools/pkgdata/meson.build new file mode 100644 index 000000000..2bacac6ac --- /dev/null +++ b/subprojects/packagefiles/icu/source/tools/pkgdata/meson.build @@ -0,0 +1,3 @@ +pkgdata = executable('pkgdata', 'pkgdata.cpp', 'pkgtypes.c', + include_directories: [incdir, toolinc], + link_with: [tu_lib_stub, i18n_lib_stub, uc_lib_stub, stubdata_lib]) diff --git a/subprojects/packagefiles/icu/source/tools/toolutil/meson.build b/subprojects/packagefiles/icu/source/tools/toolutil/meson.build new file mode 100644 index 000000000..cdbecb231 --- /dev/null +++ b/subprojects/packagefiles/icu/source/tools/toolutil/meson.build @@ -0,0 +1,30 @@ +tu_sources = files( + 'filestrm.cpp', + 'package.cpp', + 'pkgitems.cpp', + 'swapimpl.cpp', + 'toolutil.cpp', + 'unewdata.cpp', + 'collationinfo.cpp', + 'denseranges.cpp', + 'ucm.cpp', + 'ucmstate.cpp', + 'uoptions.cpp', + 'uparse.cpp', + 'ucbuf.cpp', + 'xmlparser.cpp', + 'writesrc.cpp', + 'pkg_icu.cpp', + 'pkg_genc.cpp', + 'pkg_gencmn.cpp', + 'ppucd.cpp', + 'flagparser.cpp', + 'filetools.cpp', + 'udbgutil.cpp', + 'dbgutil.cpp', + 'ucln_tu.cpp', +) + +tu_args = ['-DU_TOOLUTIL_IMPLEMENTATION'] +tu_link = ['uc', 'i18n'] +tu_deps = [] From ce791773f698037476b315a4edf45a0366fab1cb Mon Sep 17 00:00:00 2001 From: Myaamori Date: Tue, 27 Oct 2020 17:13:11 +0000 Subject: [PATCH 135/271] meson: add Boost wrap --- meson.build | 21 ++++- meson_options.txt | 1 + subprojects/boost.wrap | 6 ++ .../boost/libs/chrono/meson.build | 15 ++++ .../boost/libs/filesystem/meson.build | 37 +++++++++ .../boost/libs/locale/meson.build | 78 +++++++++++++++++++ .../boost/libs/program_options/meson.build | 28 +++++++ .../packagefiles/boost/libs/regex/meson.build | 33 ++++++++ .../boost/libs/thread/meson.build | 30 +++++++ subprojects/packagefiles/boost/meson.build | 26 +++++++ 10 files changed, 271 insertions(+), 4 deletions(-) create mode 100644 subprojects/boost.wrap create mode 100644 subprojects/packagefiles/boost/libs/chrono/meson.build create mode 100644 subprojects/packagefiles/boost/libs/filesystem/meson.build create mode 100644 subprojects/packagefiles/boost/libs/locale/meson.build create mode 100644 subprojects/packagefiles/boost/libs/program_options/meson.build create mode 100644 subprojects/packagefiles/boost/libs/regex/meson.build create mode 100644 subprojects/packagefiles/boost/libs/thread/meson.build create mode 100644 subprojects/packagefiles/boost/meson.build diff --git a/meson.build b/meson.build index 3e5301c82..56752902a 100644 --- a/meson.build +++ b/meson.build @@ -61,10 +61,23 @@ deps += iconv_dep deps += dependency('libass', version: '>=0.9.7', fallback: ['libass', 'libass_dep']) -deps += dependency('boost', version: '>=1.50.0', - modules: ['chrono', 'filesystem', 'locale', 'regex', - 'system', 'thread'], - static: get_option('default_library') == 'static') +boost_modules = ['chrono', 'filesystem', 'thread', 'locale', 'regex'] +if not get_option('local_boost') + boost_dep = dependency('boost', version: '>=1.50.0', + modules: boost_modules, + required: cxx.get_id() != 'msvc', + static: get_option('default_library') == 'static') +endif + +if get_option('local_boost') or not boost_dep.found() + boost_dep = [] + boost = subproject('boost') + foreach module: boost_modules + boost_dep += boost.get_variable('boost_' + module + '_dep') + endforeach +endif + +deps += boost_dep if host_machine.system() == 'windows' conf.set('BOOST_USE_WINDOWS_H', '1') endif diff --git a/meson_options.txt b/meson_options.txt index 917aa32db..fa24825cc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -12,6 +12,7 @@ option('hunspell', type: 'feature', description: 'Hunspell spell checker') option('uchardet', type: 'feature', description: 'uchardet character encoding detection') option('system_luajit', type: 'boolean', value: false, description: 'Force using system luajit') +option('local_boost', type: 'boolean', value: false, description: 'Force using locally compiled Boost') option('icu_path', type: 'string', value: '', description: 'Path to ICU libraries on Windows') option('wx_path', type: 'string', value: '', description: 'Path to wxWidgets libraries on Windows') diff --git a/subprojects/boost.wrap b/subprojects/boost.wrap new file mode 100644 index 000000000..e66c7ff5b --- /dev/null +++ b/subprojects/boost.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = boost_1_74_0 +source_url = https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.gz +source_filename = boost_1_74_0.tar.gz +source_hash = afff36d392885120bcac079148c177d1f6f7730ec3d47233aa51b0afa4db94a5 +patch_directory = boost diff --git a/subprojects/packagefiles/boost/libs/chrono/meson.build b/subprojects/packagefiles/boost/libs/chrono/meson.build new file mode 100644 index 000000000..b2dfc4d22 --- /dev/null +++ b/subprojects/packagefiles/boost/libs/chrono/meson.build @@ -0,0 +1,15 @@ +chrono_sources = files([ + 'src/chrono.cpp', + 'src/thread_clock.cpp', + 'src/process_cpu_clocks.cpp', +]) + +boost_chrono = library('boost_chrono', chrono_sources, + include_directories: inc, + cpp_args: is_static ? '-DBOOST_All_STATIC_LINK=1' : '-DBOOST_All_DYN_LINK=1', + dependencies: thread_dep) + +boost_chrono_dep = declare_dependency(link_with: boost_chrono, include_directories: inc, + compile_args: [is_static ? '-DBOOST_CHRONO_STATIC_LINK=1' + : '-DBOOST_CHRONO_DYN_LINK=1', + '-DBOOST_ALL_NO_LIB=1']) diff --git a/subprojects/packagefiles/boost/libs/filesystem/meson.build b/subprojects/packagefiles/boost/libs/filesystem/meson.build new file mode 100644 index 000000000..b255d4c97 --- /dev/null +++ b/subprojects/packagefiles/boost/libs/filesystem/meson.build @@ -0,0 +1,37 @@ +filesystem_sources = files([ + 'src/codecvt_error_category.cpp', + 'src/exception.cpp', + 'src/directory.cpp', + 'src/operations.cpp', + 'src/path.cpp', + 'src/path_traits.cpp', + 'src/portability.cpp', + 'src/unique_path.cpp', + 'src/utf8_codecvt_facet.cpp', + 'src/windows_file_codecvt.cpp', +]) + +filesystem_args = ['-DBOOST_FILESYSTEM_SOURCE', + is_static ? '-DBOOST_FILESYSTEM_STATIC_LINK=1' : '-DBOOST_FILESYSTEM_DYN_LINK=1'] + +filesystem_deps = [] +if host_machine.system() == 'windows' + bcrypt_dep = dependency('bcrypt', required: false) + if bcrypt_dep.found() + filesystem_deps += bcrypt_dep + filesystem_args += '-DBOOST_FILESYSTEM_HAS_BCRYPT' + else + filesystem_deps += cpp.find_library('advapi32') + filesystem_args += '-DBOOST_FILESYSTEM_HAS_WINCRYPT' + endif +endif + +boost_filesystem = library('boost_filesystem', filesystem_sources, + include_directories: inc, + cpp_args: filesystem_args, + dependencies: [thread_dep, filesystem_deps]) + +boost_filesystem_dep = declare_dependency(link_with: boost_filesystem, include_directories: inc, + compile_args: [is_static ? '-DBOOST_FILESYSTEM_STATIC_LINK=1' + : '-DBOOST_FILESYSTEM_DYN_LINK=1', + '-DBOOST_ALL_NO_LIB=1']) diff --git a/subprojects/packagefiles/boost/libs/locale/meson.build b/subprojects/packagefiles/boost/libs/locale/meson.build new file mode 100644 index 000000000..6abd3cd1b --- /dev/null +++ b/subprojects/packagefiles/boost/libs/locale/meson.build @@ -0,0 +1,78 @@ +locale_sources = files([ + 'src/encoding/codepage.cpp', + 'src/shared/date_time.cpp', + 'src/shared/format.cpp', + 'src/shared/formatting.cpp', + 'src/shared/generator.cpp', + 'src/shared/ids.cpp', + 'src/shared/localization_backend.cpp', + 'src/shared/message.cpp', + 'src/shared/mo_lambda.cpp', + 'src/util/codecvt_converter.cpp', + 'src/util/default_locale.cpp', + 'src/util/info.cpp', + 'src/util/locale_data.cpp', + # icu + 'src/icu/boundary.cpp', + 'src/icu/codecvt.cpp', + 'src/icu/collator.cpp', + 'src/icu/conversion.cpp', + 'src/icu/date_time.cpp', + 'src/icu/formatter.cpp', + 'src/icu/icu_backend.cpp', + 'src/icu/numeric.cpp', + 'src/icu/time_zone.cpp', + # std - docs say disabled by default on windows and solaris, + # but jamfile seemingly only disables on solaris + 'src/std/codecvt.cpp', + 'src/std/collate.cpp', + 'src/std/converter.cpp', + 'src/std/numeric.cpp', + 'src/std/std_backend.cpp', + # included if using posix, win32 or std backend (ie always) + 'src/util/gregorian.cpp', +]) + +locale_args = ['-DBOOST_THREAD_NO_LIB=1'] +locale_deps = [] + +if not is_static + locale_args += '-DBOOST_LOCALE_DYN_LINK=1' +endif + +if host_machine.system() == 'windows' + locale_sources += files([ + 'src/win32/collate.cpp', + 'src/win32/converter.cpp', + 'src/win32/numeric.cpp', + 'src/win32/win_backend.cpp', + # included on windows/cygwin if std *or* win32 included + 'src/win32/lcid.cpp', + ]) + locale_args += '-DBOOST_LOCALE_NO_POSIX_BACKEND=1' +else + locale_sources += files([ + 'src/posix/collate.cpp', + 'src/posix/converter.cpp', + 'src/posix/numeric.cpp', + 'src/posix/codecvt.cpp', + 'src/posix/posix_backend.cpp', + ]) + locale_args += '-DBOOST_LOCALE_NO_WINAPI_BACKEND=1' +endif + +if not cpp.check_header('iconv.h') + locale_deps += dependency('iconv') +endif +locale_args += '-DBOOST_LOCALE_WITH_ICONV=1' + +locale_deps += icu_deps +locale_args += '-DBOOST_LOCALE_WITH_ICU=1' + +boost_locale = library('boost_locale', locale_sources, + include_directories: inc, + cpp_args: locale_args, + dependencies: [thread_dep, locale_deps, boost_thread_dep]) + +boost_locale_dep = declare_dependency(link_with: boost_locale, include_directories: inc, + compile_args: '-DBOOST_ALL_NO_LIB=1') diff --git a/subprojects/packagefiles/boost/libs/program_options/meson.build b/subprojects/packagefiles/boost/libs/program_options/meson.build new file mode 100644 index 000000000..9ee11eb29 --- /dev/null +++ b/subprojects/packagefiles/boost/libs/program_options/meson.build @@ -0,0 +1,28 @@ +program_options_sources = files([ + 'src/cmdline.cpp', + 'src/config_file.cpp', + 'src/options_description.cpp', + 'src/parsers.cpp', + 'src/variables_map.cpp', + 'src/value_semantic.cpp', + 'src/positional_options.cpp', + 'src/utf8_codecvt_facet.cpp', + 'src/convert.cpp', + 'src/winmain.cpp', + 'src/split.cpp', +]) + +program_options_args = [] +if not is_static + program_options_args += '-DBOOST_PROGRAM_OPTIONS_DYN_LINK=1' +endif + +boost_program_options = library('boost_program_options', program_options_sources, + cpp_args: program_options_args, + include_directories: inc, + dependencies: thread_dep) + +boost_program_options_dep = declare_dependency(link_with: boost_program_options, + include_directories: inc, + compile_args: program_options_args + + ['-DBOOST_ALL_NO_LIB=1']) diff --git a/subprojects/packagefiles/boost/libs/regex/meson.build b/subprojects/packagefiles/boost/libs/regex/meson.build new file mode 100644 index 000000000..f073f33d8 --- /dev/null +++ b/subprojects/packagefiles/boost/libs/regex/meson.build @@ -0,0 +1,33 @@ +regex_sources = files([ + 'src/c_regex_traits.cpp', + 'src/cpp_regex_traits.cpp', + 'src/cregex.cpp', + 'src/fileiter.cpp', + 'src/icu.cpp', + 'src/instances.cpp', + 'src/posix_api.cpp', + 'src/regex.cpp', + 'src/regex_debug.cpp', + 'src/regex_raw_buffer.cpp', + 'src/regex_traits_defaults.cpp', + 'src/static_mutex.cpp', + 'src/w32_regex_traits.cpp', + 'src/wc_regex_traits.cpp', + 'src/wide_posix_api.cpp', + 'src/winstances.cpp', + 'src/usinstances.cpp', +]) + +regex_args = ['-DBOOST_HAS_ICU=1'] + +if not is_static + regex_args += '-DBOOST_REGEX_DYN_LINK=1' +endif + +boost_regex = library('boost_regex', regex_sources, + include_directories: inc, + cpp_args: regex_args, + dependencies: [thread_dep, icu_deps]) + +boost_regex_dep = declare_dependency(link_with: boost_regex, include_directories: inc, + compile_args: '-DBOOST_ALL_NO_LIB=1') diff --git a/subprojects/packagefiles/boost/libs/thread/meson.build b/subprojects/packagefiles/boost/libs/thread/meson.build new file mode 100644 index 000000000..e14d344dd --- /dev/null +++ b/subprojects/packagefiles/boost/libs/thread/meson.build @@ -0,0 +1,30 @@ +thread_args = [is_static ? '-DBOOST_THREAD_BUILD_LIB=1' : '-DBOOST_THREAD_BUILD_DLL=1'] + +if host_machine.system() == 'windows' + thread_sources = files([ + 'src/win32/thread.cpp', + 'src/win32/tss_dll.cpp', + 'src/win32/tss_pe.cpp', + 'src/win32/thread_primitives.cpp', + 'src/future.cpp', + ]) + thread_args += ['-DWIN32_LEAN_AND_MEAN', '-DBOOST_USE_WINDOWS_H', '-DBOOST_THREAD_WIN32', + '-DBOOST_THREAD_USES_CHRONO'] +else + thread_sources = files([ + 'src/pthread/thread.cpp', + 'src/pthread/once.cpp', + 'src/future.cpp', + ]) + thread_args += ['-DBOOST_THREAD_POSIX', '-DBOOST_THREAD_DONT_USE_CHRONO'] +endif + +boost_thread = library('boost_thread', thread_sources, + include_directories: inc, + cpp_args: thread_args, + dependencies: [thread_dep, boost_chrono_dep]) + +boost_thread_dep = declare_dependency(link_with: boost_thread, include_directories: inc, + compile_args: [is_static ? '-DBOOST_THREAD_BUILD_LIB=1' + : '-DBOOST_THREAD_BUILD_DLL=1', + '-DBOOST_ALL_NO_LIB=1']) diff --git a/subprojects/packagefiles/boost/meson.build b/subprojects/packagefiles/boost/meson.build new file mode 100644 index 000000000..a0a9881d8 --- /dev/null +++ b/subprojects/packagefiles/boost/meson.build @@ -0,0 +1,26 @@ +project('boost', 'cpp', + version: '1.74.0', + meson_version: '>=0.55.0') + +cpp = meson.get_compiler('cpp') +thread_dep = dependency('threads') +inc = include_directories('.') +is_static = get_option('default_library') == 'static' + +add_project_arguments('-DBOOST_ALL_NO_LIB=1', language: 'cpp') + +if get_option('buildtype').startswith('release') + add_project_arguments('-DNDEBUG', language: 'cpp') +endif + +if host_machine.system() == 'windows' + add_project_arguments('-DWIN32', language: 'cpp') +endif + +icu_deps = [dependency('icu-uc'), + dependency('icu-i18n')] + +modules = ['chrono', 'thread', 'filesystem', 'locale', 'regex', 'program_options'] +foreach module: modules + subdir('libs/' + module) +endforeach From f9f8b6c4d39f3bdd7adc63733caa8ecaaa874f6e Mon Sep 17 00:00:00 2001 From: Myaamori Date: Tue, 27 Oct 2020 17:16:01 +0000 Subject: [PATCH 136/271] meson: add FFMS2 wrap --- meson.build | 2 +- subprojects/ffmpeg.wrap | 11 ++++++ subprojects/ffms2.wrap | 9 +++++ subprojects/packagefiles/ffms2/meson.build | 45 ++++++++++++++++++++++ 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 subprojects/ffmpeg.wrap create mode 100644 subprojects/ffms2.wrap create mode 100644 subprojects/packagefiles/ffms2/meson.build diff --git a/meson.build b/meson.build index 56752902a..a5e872afc 100644 --- a/meson.build +++ b/meson.build @@ -139,7 +139,7 @@ foreach dep: [ ['portaudio-2.0', '', 'PortAudio'], ['openal', '>=0.0.8', 'OpenAL'], # video - ['ffms2', '', 'FFMS2'], # needs a proper port + ['ffms2', '', 'FFMS2'], # other ['fftw3', '', 'FFTW3'], ['hunspell', '', 'Hunspell'], # needs a proper port diff --git a/subprojects/ffmpeg.wrap b/subprojects/ffmpeg.wrap new file mode 100644 index 000000000..0a59585ad --- /dev/null +++ b/subprojects/ffmpeg.wrap @@ -0,0 +1,11 @@ +[wrap-git] +directory = ffmpeg +url = https://gitlab.freedesktop.org/gstreamer/meson-ports/ffmpeg.git +revision = meson-4.3 + +[provide] +libavformat = libavformat_dep +libavcodec = libavcodec_dep +libswscale = libswscale_dep +libavutil = libavutil_dep +libswresample = libswresample_dep diff --git a/subprojects/ffms2.wrap b/subprojects/ffms2.wrap new file mode 100644 index 000000000..9cb18212f --- /dev/null +++ b/subprojects/ffms2.wrap @@ -0,0 +1,9 @@ +[wrap-file] +directory = ffms2-2.40 +source_url = https://github.com/FFMS/ffms2/archive/2.40.tar.gz +source_filename = 2.40.tar.gz +source_hash = 82e95662946f3d6e1b529eadbd72bed196adfbc41368b2d50493efce6e716320 +patch_directory = ffms2 + +[provide] +ffms2 = ffms2_dep diff --git a/subprojects/packagefiles/ffms2/meson.build b/subprojects/packagefiles/ffms2/meson.build new file mode 100644 index 000000000..a7328ea8d --- /dev/null +++ b/subprojects/packagefiles/ffms2/meson.build @@ -0,0 +1,45 @@ +project('ffms2', 'cpp', version: '2.40.0') + +deps = [] + +deps += dependency('zlib') +deps += dependency('libavformat') +deps += dependency('libavcodec') +deps += dependency('libswscale') +deps += dependency('libavutil') +deps += dependency('libswresample') + +args = ['-D_FILE_OFFSET_BITNS=64', '-DFFMS_EXPORTS', '-D__STDC_CONSTANT_MACROS'] +usage_args = [] + +if get_option('default_library') == 'static' + usage_args += '-DFFMS_STATIC' +endif + +ffms2_sources = [ + 'src/core/audiosource.cpp', + #'src/core/audiosource.h', + 'src/core/ffms.cpp', + 'src/core/filehandle.cpp', + #'src/core/filehandle.h', + 'src/core/indexing.cpp', + #'src/core/indexing.h', + 'src/core/track.cpp', + #'src/core/track.h', + 'src/core/utils.cpp', + #'src/core/utils.h', + 'src/core/videosource.cpp', + #'src/core/videosource.h', + 'src/core/videoutils.cpp', + #'src/core/videoutils.h', + 'src/core/zipfile.cpp', + #'src/core/zipfile.h', +] + +deps_inc = include_directories('include') + +ffms2 = library('ffms2', ffms2_sources, include_directories: deps_inc, dependencies: deps, + cpp_args: args + usage_args) +ffms2_dep = declare_dependency(link_with: ffms2, + include_directories: deps_inc, + compile_args: usage_args) From bb02d3bc5ef500fb867aa3f99e2574b1406cc184 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Tue, 27 Oct 2020 19:30:51 +0000 Subject: [PATCH 137/271] meson: don't build with C11 C11 breaks the LuaJIT build --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a5e872afc..bbdc86a72 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', meson_version: '>=0.55.0', - default_options: ['c_std=c11', 'cpp_std=c++11', 'b_lto=true'], + default_options: ['cpp_std=c++11', 'b_lto=true'], version: '3.2.2') cmake = import('cmake') From 51b8248ac8043f920ecb54529e9066371c73f518 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Tue, 27 Oct 2020 19:31:58 +0000 Subject: [PATCH 138/271] meson: create git_version.h in build directory in version.sh --- meson.build | 2 +- tools/version.sh | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index bbdc86a72..b1fdc0ae9 100644 --- a/meson.build +++ b/meson.build @@ -13,7 +13,7 @@ else endif version_inc = include_directories('.') version_h = custom_target('git_version.h', - command: [version_sh, meson.current_build_dir()], + command: [version_sh, meson.current_build_dir(), meson.current_source_dir()], build_by_default: true, build_always_stale: true, # has internal check whether target file will be refreshed output: ['git_version.h', 'git_version.xml']) diff --git a/tools/version.sh b/tools/version.sh index a950bae2f..a2d3c7b39 100755 --- a/tools/version.sh +++ b/tools/version.sh @@ -1,7 +1,8 @@ -srcdir="$1" +builddir="$1" +srcdir="$2" # If no git repo try to read from the existing git_version.h, for building from tarballs -version_h_path="${srcdir}/git_version.h" +version_h_path="${builddir}/git_version.h" if ! test -d "${srcdir}/.git"; then if test -f "${version_h_path}"; then while read line; do @@ -65,7 +66,7 @@ export BUILD_GIT_VERSION_NUMBER="${git_revision}" export BUILD_GIT_VERSION_STRING="${git_version_str}" export VERSION_SOURCE="from git" -cat << EOF > "${srcdir}/git_version.xml" +cat << EOF > "${builddir}/git_version.xml" From 0b7e244232440f37f81e167b5cffa2878bb3857c Mon Sep 17 00:00:00 2001 From: Myaamori Date: Tue, 27 Oct 2020 19:32:23 +0000 Subject: [PATCH 139/271] meson: define fallbacks for optional dependencies --- meson.build | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index b1fdc0ae9..df03749f8 100644 --- a/meson.build +++ b/meson.build @@ -134,19 +134,28 @@ deps += dependency('icu-i18n', version: '>=4.8.1.1') dep_avail = [] foreach dep: [ # audio, in order of precedence - ['libpulse', '', 'PulseAudio'], - ['alsa', '', 'ALSA'], - ['portaudio-2.0', '', 'PortAudio'], - ['openal', '>=0.0.8', 'OpenAL'], + ['libpulse', '', 'PulseAudio', []], + ['alsa', '', 'ALSA', []], + ['portaudio-2.0', '', 'PortAudio', []], + ['openal', '>=0.0.8', 'OpenAL', []], # video - ['ffms2', '', 'FFMS2'], + ['ffms2', '', 'FFMS2', ['ffms2', 'ffms2_dep']], # other - ['fftw3', '', 'FFTW3'], - ['hunspell', '', 'Hunspell'], # needs a proper port - ['uchardet', '', 'uchardet'], # needs a proper port + ['fftw3', '', 'FFTW3', []], + ['hunspell', '', 'Hunspell', []], # needs a proper port + ['uchardet', '', 'uchardet', []], # needs a proper port ] - d = dependency(dep[0], version: dep[1] != '' ? dep[1]: '>=0', - required: false) + dep_version = dep[1] != '' ? dep[1] : '>=0' + # [provide] section is ignored if required is false; + # must provided define fallback explicitly + # (with meson 0.56 you can do allow_fallback: true): + #d = dependency(dep[0], version: dep_version, + # required: false, allow_fallback: true) + if dep[3].length() > 0 + d = dependency(dep[0], version: dep_version, fallback: dep[3]) + else + d = dependency(dep[0], version: dep_version, required: false) + endif optname = dep[0].split('-')[0] if d.found() and not get_option(optname).disabled() From 441daf5aeba00250c9b062749272c6ee78e51e02 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Tue, 27 Oct 2020 21:50:15 +0000 Subject: [PATCH 140/271] meson: use check_header to check for iconv iconv is not a standalone library on Linux, so find_library is pointless --- meson.build | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index df03749f8..7abdfa449 100644 --- a/meson.build +++ b/meson.build @@ -50,13 +50,10 @@ cxx = meson.get_compiler('cpp') cc = meson.get_compiler('c') deps += cc.find_library('m', required: false) deps += cc.find_library('dl', required: false) -iconv_dep = cc.find_library('iconv', required: false) -if not iconv_dep.found() and host_machine.system() == 'windows' +if not cxx.check_header('iconv.h') iconv_sp = subproject('iconv') # this really needs to be replaced with a proper port - deps_inc += iconv_sp.get_variable('iconv_incs') - iconv_dep = iconv_sp.get_variable('libiconv_dep') + deps += iconv_sp.get_variable('libiconv_dep') endif -deps += iconv_dep deps += dependency('libass', version: '>=0.9.7', fallback: ['libass', 'libass_dep']) From 03de8929d4546f06ac4f3d606954e6286c431054 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Wed, 28 Oct 2020 04:13:08 +0000 Subject: [PATCH 141/271] meson: pin wx version and fix dependencies --- meson.build | 3 ++- subprojects/wxWidgets.wrap | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 7abdfa449..695cbfd81 100644 --- a/meson.build +++ b/meson.build @@ -103,10 +103,11 @@ else # this will only be hit with msvc '-DwxBUILD_SHARED=@0@'.format(buildShared), '-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson deps += [ - wx.dependency('mono'), + wx.dependency('wxmono'), wx.dependency('wxzlib'), wx.dependency('wxpng'), wx.dependency('wxexpat'), + wx.dependency('wxregex'), wx.dependency('wxscintilla') ] diff --git a/subprojects/wxWidgets.wrap b/subprojects/wxWidgets.wrap index a77194055..949a03927 100644 --- a/subprojects/wxWidgets.wrap +++ b/subprojects/wxWidgets.wrap @@ -1,5 +1,5 @@ [wrap-git] directory = wxWidgets url = https://github.com/wxWidgets/wxWidgets.git -revision = master -clone-recursive = true \ No newline at end of file +revision = v3.1.4 +clone-recursive = true From 2510ef25c283a3b1e096b51d44fdb6f33e7f3be1 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Wed, 28 Oct 2020 04:14:00 +0000 Subject: [PATCH 142/271] meson: patch libass with stub dirent.h this should probably be handled by the libass meson port at some point --- subprojects/libass.wrap | 1 + subprojects/packagefiles/libass/dirent.h | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 subprojects/packagefiles/libass/dirent.h diff --git a/subprojects/libass.wrap b/subprojects/libass.wrap index 3e8e691d0..90101e922 100644 --- a/subprojects/libass.wrap +++ b/subprojects/libass.wrap @@ -2,3 +2,4 @@ directory = libass url = https://github.com/TypesettingTools/libass.git revision = meson-no-rasterizer-approximation +patch_directory = libass diff --git a/subprojects/packagefiles/libass/dirent.h b/subprojects/packagefiles/libass/dirent.h new file mode 100644 index 000000000..fcbd0289b --- /dev/null +++ b/subprojects/packagefiles/libass/dirent.h @@ -0,0 +1,6 @@ +// libass uses dirent in a function we don't use, so just provide a dummy version +typedef struct DIR { int dummy; } DIR; +typedef struct dirent { char *d_name; } dirent; +static inline DIR *opendir(const char *x) { return 0; } +static inline struct dirent *readdir(DIR *x) { return 0; } +static inline void closedir(DIR *x) { } From b1c2fbdb198f64f27a9712798b185f90fd9b8c1f Mon Sep 17 00:00:00 2001 From: Myaamori Date: Wed, 28 Oct 2020 04:15:02 +0000 Subject: [PATCH 143/271] meson: add nasm wrap for Windows --- meson.build | 8 ++++++++ subprojects/nasm.wrap | 6 ++++++ subprojects/packagefiles/nasm/meson.build | 3 +++ 3 files changed, 17 insertions(+) create mode 100644 subprojects/nasm.wrap create mode 100644 subprojects/packagefiles/nasm/meson.build diff --git a/meson.build b/meson.build index 695cbfd81..ce0a24e35 100644 --- a/meson.build +++ b/meson.build @@ -6,6 +6,14 @@ project('Aegisub', ['c', 'cpp'], cmake = import('cmake') +if host_machine.system() == 'windows' + sys_nasm = find_program('nasm', required: false) + if not sys_nasm.found() + nasm = subproject('nasm').get_variable('nasm') + meson.override_find_program('nasm', nasm) + endif +endif + if host_machine.system() == 'windows' version_sh = find_program('tools/version.ps1') else diff --git a/subprojects/nasm.wrap b/subprojects/nasm.wrap new file mode 100644 index 000000000..6f1ad8dab --- /dev/null +++ b/subprojects/nasm.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = nasm-2.15.05 +source_url = https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win64/nasm-2.15.05-win64.zip +source_filename = nasm-2.15.05-win64.zip +source_hash = f5c93c146f52b4f1664fa3ce6579f961a910e869ab0dae431bd871bdd2584ef2 +patch_directory = nasm diff --git a/subprojects/packagefiles/nasm/meson.build b/subprojects/packagefiles/nasm/meson.build new file mode 100644 index 000000000..0f2b11986 --- /dev/null +++ b/subprojects/packagefiles/nasm/meson.build @@ -0,0 +1,3 @@ +project('nasm', version: '2.15.05') + +nasm = find_program('nasm.exe', dirs: meson.current_source_dir()) From 65fc7c0f308b94c1a3b2e408093c674b20d89010 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Wed, 28 Oct 2020 04:15:33 +0000 Subject: [PATCH 144/271] meson: ignore second argument in version.ps1 for compatibility with bf2dca2e4c0 --- tools/version.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/version.ps1 b/tools/version.ps1 index 0d61c7176..8ce776474 100644 --- a/tools/version.ps1 +++ b/tools/version.ps1 @@ -2,7 +2,9 @@ param ( [Parameter(Position = 0, Mandatory = $false)] - [string]$BuildRoot = $null + [string]$BuildRoot = $null, + [Parameter(Position = 1, Mandatory = $false)] + [string]$SourceRoot = $null ) $lastSvnRevision = 6962 From 5dff6c92348953d2cee98c756f928300b6074a65 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Wed, 28 Oct 2020 04:17:56 +0000 Subject: [PATCH 145/271] update .gitignore --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 7a967423c..59e1893bb 100644 --- a/.gitignore +++ b/.gitignore @@ -54,10 +54,14 @@ vendor/luajit/src/lj_libdef.h vendor/luajit/src/lj_recdef.h vendor/luajit/src/luajit +# IDE-specific .nuget .vs +.kdev4/ +*.kdev4 # Meson +builddir/ subprojects/freetype* subprojects/fribidi subprojects/harfbuzz @@ -65,3 +69,8 @@ subprojects/libass subprojects/libpng* subprojects/packagecache subprojects/zlib* +subprojects/libass +subprojects/icu +subprojects/ffmpeg +subprojects/ffms2* +subprojects/boost* From 0e51dba59bfc6218c559a5b4446e634f1bda9b1c Mon Sep 17 00:00:00 2001 From: Myaamori Date: Wed, 28 Oct 2020 19:26:10 +0000 Subject: [PATCH 146/271] meson: remove DUALNUM check from LuaJIT --- subprojects/luajit/src/host/meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/subprojects/luajit/src/host/meson.build b/subprojects/luajit/src/host/meson.build index 5354f153f..ce0a6e244 100644 --- a/subprojects/luajit/src/host/meson.build +++ b/subprojects/luajit/src/host/meson.build @@ -25,7 +25,6 @@ else ['LJ_ARCH_BITS', '64', ['-D', 'P64']], ['LJ_HASJIT', '1', ['-D', 'JIT']], ['LJ_HASFFI', '1', ['-D', 'FFI']], - ['LJ_DUALNUM', '1', ['-D', 'DUALNUM']], ] if host_machine.cpu_family() == 'x86' From fa2c35a058f783bd901453c3af939c634d807bee Mon Sep 17 00:00:00 2001 From: Myaamori Date: Wed, 28 Oct 2020 19:58:33 +0000 Subject: [PATCH 147/271] remove build, .nuget, Aegisub.sln --- .gitignore | 2 +- .nuget/NuGet.Config | 9 - .nuget/NuGet.targets | 150 - Aegisub.sln | 572 ---- build/Aegisub/Aegisub.targets | 163 - build/Aegisub/Aegisub.vcxproj | 440 --- build/Aegisub/Aegisub.vcxproj.filters | 1096 ------- build/Aegisub/Aegisub.xml | 254 -- build/Aegisub/standard-libraries.props | 32 - build/BuildTasks/BuildTasks.csproj | 81 - build/BuildTasks/DownloadTgzFile.cs | 54 - build/BuildTasks/GitVersion.cs | 117 - build/BuildTasks/Properties/AssemblyInfo.cs | 36 - build/BuildTasks/TarballProject.cs | 96 - build/BuildTasks/packages.config | 5 - build/DefaultConfiguration.props | 65 - .../PortableInstaller.vcxproj | 147 - .../PortableInstaller.vcxproj.filters | 127 - build/aegisub.props | 66 - build/boost/boost.vcxproj | 139 - build/boost/boost.vcxproj.filters | 222 -- build/boost/locale_stubs.cpp | 69 - build/csrihelper/csrihelper.vcxproj | 51 - build/csrihelper/csrihelper.vcxproj.filters | 63 - build/expat/expat.vcxproj | 55 - build/expat/expat.vcxproj.filters | 17 - build/ffmpeg/config-x64.asm | 2460 --------------- build/ffmpeg/config-x64.h | 2476 --------------- build/ffmpeg/config-x86.asm | 2460 --------------- build/ffmpeg/config-x86.h | 2476 --------------- build/ffmpeg/config.h | 5 - build/ffmpeg/configure.sh | 54 - build/ffmpeg/ffmpeg.vcxproj | 1413 --------- build/ffmpeg/ffmpeg.vcxproj.filters | 2659 ----------------- build/ffmpeg/get-file-list.sh | 13 - build/ffmpeg/libavcodec/bsf_list.c | 33 - build/ffmpeg/libavcodec/codec_list.c | 426 --- build/ffmpeg/libavcodec/parser_list.c | 45 - build/ffmpeg/libavdevice/indev_list.c | 2 - build/ffmpeg/libavdevice/outdev_list.c | 2 - build/ffmpeg/libavformat/demuxer_list.c | 287 -- build/ffmpeg/libavformat/muxer_list.c | 2 - build/ffmpeg/libavformat/protocol_list.c | 14 - build/ffmpeg/libavutil/avconfig.h | 6 - build/ffmpeg/libavutil/ffversion.h | 4 - build/ffms2/ffms2.vcxproj | 96 - build/ffms2/ffms2.vcxproj.filters | 126 - build/fftw/config.h | 393 --- build/fftw/fftw.vcxproj | 677 ----- build/fftw/fftw.vcxproj.filters | 1937 ------------ build/freetype2/freetype.vcxproj | 86 - build/freetype2/freetype.vcxproj.filters | 152 - build/freetype2/ftsystem.cpp | 75 - build/fribidi/fribidi-config.h | 22 - build/fribidi/fribidi.vcxproj | 64 - build/fribidi/fribidi.vcxproj.filters | 2 - build/googletest/googletest.vcxproj | 62 - build/googletest/googletest.vcxproj.filters | 97 - build/hunspell/hunspell.vcxproj | 56 - build/hunspell/hunspell.vcxproj.filters | 92 - build/icu/icu.vcxproj | 703 ----- build/icu/icu.vcxproj.filters | 1744 ----------- build/icu/pack-dt.lua | 47 - build/install.targets | 42 - build/libaegisub/libaegisub.vcxproj | 188 -- build/libaegisub/libaegisub.vcxproj.filters | 388 --- build/libass/config.h | 6 - build/libass/dirent.h | 6 - build/libass/libass.vcxproj | 120 - build/libass/libass.vcxproj.filters | 176 -- build/libass/strings.h | 3 - build/libass/unistd.h | 0 build/libiconv/libiconv.vcxproj | 44 - build/libiconv/libiconv.vcxproj.filters | 42 - build/libpng/libpng.vcxproj | 64 - build/libpng/libpng.vcxproj.filters | 17 - build/libresrc/libresrc.vcxproj | 75 - build/libresrc/libresrc.vcxproj.filters | 50 - build/luabins/luabins.vcxproj | 51 - build/luabins/luabins.vcxproj.filters | 57 - build/luajit-buildvm/luajit-buildvm.vcxproj | 79 - .../luajit-buildvm.vcxproj.filters | 14 - build/luajit-minilua/luajit-minilua.vcxproj | 35 - .../luajit-minilua.vcxproj.filters | 6 - build/luajit/luajit.vcxproj | 234 -- build/luajit/luajit.vcxproj.filters | 447 --- build/paths.props | 25 - build/respack.targets | 27 - build/scintilla/catalogue.cpp | 13 - build/scintilla/scintilla.vcxproj | 95 - build/scintilla/scintilla.vcxproj.filters | 17 - build/standard-outdirs.props | 68 - build/standard-settings.props | 71 - build/tasks.props | 35 - build/tests/tests.vcxproj | 101 - build/tests/tests.vcxproj.filters | 106 - .../universalchardet/universalchardet.vcxproj | 117 - .../universalchardet.vcxproj.filters | 249 -- build/userconfig/ft2.props.sample | 24 - build/userconfig/paths.props.sample | 20 - build/userconfig/readme.txt | 12 - build/userconfig/wx.props.sample | 22 - build/wx/setup-build.h | 262 -- build/wx/setup-installed.h | 3 - build/wx/stc-fi.h | 7 - build/wx/wxWidgets.vcxproj | 425 --- build/yasm.targets | 101 - build/zlib/zconf.h | 513 ---- build/zlib/zlib.vcxproj | 60 - 109 files changed, 1 insertion(+), 29912 deletions(-) delete mode 100644 .nuget/NuGet.Config delete mode 100644 .nuget/NuGet.targets delete mode 100644 Aegisub.sln delete mode 100644 build/Aegisub/Aegisub.targets delete mode 100644 build/Aegisub/Aegisub.vcxproj delete mode 100644 build/Aegisub/Aegisub.vcxproj.filters delete mode 100644 build/Aegisub/Aegisub.xml delete mode 100644 build/Aegisub/standard-libraries.props delete mode 100644 build/BuildTasks/BuildTasks.csproj delete mode 100644 build/BuildTasks/DownloadTgzFile.cs delete mode 100644 build/BuildTasks/GitVersion.cs delete mode 100644 build/BuildTasks/Properties/AssemblyInfo.cs delete mode 100644 build/BuildTasks/TarballProject.cs delete mode 100644 build/BuildTasks/packages.config delete mode 100644 build/DefaultConfiguration.props delete mode 100644 build/PortableInstaller/PortableInstaller.vcxproj delete mode 100644 build/PortableInstaller/PortableInstaller.vcxproj.filters delete mode 100644 build/aegisub.props delete mode 100644 build/boost/boost.vcxproj delete mode 100644 build/boost/boost.vcxproj.filters delete mode 100644 build/boost/locale_stubs.cpp delete mode 100644 build/csrihelper/csrihelper.vcxproj delete mode 100644 build/csrihelper/csrihelper.vcxproj.filters delete mode 100644 build/expat/expat.vcxproj delete mode 100644 build/expat/expat.vcxproj.filters delete mode 100755 build/ffmpeg/config-x64.asm delete mode 100755 build/ffmpeg/config-x64.h delete mode 100755 build/ffmpeg/config-x86.asm delete mode 100755 build/ffmpeg/config-x86.h delete mode 100644 build/ffmpeg/config.h delete mode 100755 build/ffmpeg/configure.sh delete mode 100644 build/ffmpeg/ffmpeg.vcxproj delete mode 100644 build/ffmpeg/ffmpeg.vcxproj.filters delete mode 100755 build/ffmpeg/get-file-list.sh delete mode 100644 build/ffmpeg/libavcodec/bsf_list.c delete mode 100644 build/ffmpeg/libavcodec/codec_list.c delete mode 100644 build/ffmpeg/libavcodec/parser_list.c delete mode 100644 build/ffmpeg/libavdevice/indev_list.c delete mode 100644 build/ffmpeg/libavdevice/outdev_list.c delete mode 100644 build/ffmpeg/libavformat/demuxer_list.c delete mode 100644 build/ffmpeg/libavformat/muxer_list.c delete mode 100644 build/ffmpeg/libavformat/protocol_list.c delete mode 100644 build/ffmpeg/libavutil/avconfig.h delete mode 100644 build/ffmpeg/libavutil/ffversion.h delete mode 100644 build/ffms2/ffms2.vcxproj delete mode 100644 build/ffms2/ffms2.vcxproj.filters delete mode 100755 build/fftw/config.h delete mode 100644 build/fftw/fftw.vcxproj delete mode 100644 build/fftw/fftw.vcxproj.filters delete mode 100644 build/freetype2/freetype.vcxproj delete mode 100644 build/freetype2/freetype.vcxproj.filters delete mode 100644 build/freetype2/ftsystem.cpp delete mode 100644 build/fribidi/fribidi-config.h delete mode 100644 build/fribidi/fribidi.vcxproj delete mode 100644 build/fribidi/fribidi.vcxproj.filters delete mode 100644 build/googletest/googletest.vcxproj delete mode 100644 build/googletest/googletest.vcxproj.filters delete mode 100644 build/hunspell/hunspell.vcxproj delete mode 100644 build/hunspell/hunspell.vcxproj.filters delete mode 100644 build/icu/icu.vcxproj delete mode 100644 build/icu/icu.vcxproj.filters delete mode 100644 build/icu/pack-dt.lua delete mode 100644 build/install.targets delete mode 100644 build/libaegisub/libaegisub.vcxproj delete mode 100644 build/libaegisub/libaegisub.vcxproj.filters delete mode 100644 build/libass/config.h delete mode 100644 build/libass/dirent.h delete mode 100644 build/libass/libass.vcxproj delete mode 100644 build/libass/libass.vcxproj.filters delete mode 100644 build/libass/strings.h delete mode 100644 build/libass/unistd.h delete mode 100644 build/libiconv/libiconv.vcxproj delete mode 100644 build/libiconv/libiconv.vcxproj.filters delete mode 100644 build/libpng/libpng.vcxproj delete mode 100644 build/libpng/libpng.vcxproj.filters delete mode 100644 build/libresrc/libresrc.vcxproj delete mode 100644 build/libresrc/libresrc.vcxproj.filters delete mode 100644 build/luabins/luabins.vcxproj delete mode 100644 build/luabins/luabins.vcxproj.filters delete mode 100644 build/luajit-buildvm/luajit-buildvm.vcxproj delete mode 100644 build/luajit-buildvm/luajit-buildvm.vcxproj.filters delete mode 100644 build/luajit-minilua/luajit-minilua.vcxproj delete mode 100644 build/luajit-minilua/luajit-minilua.vcxproj.filters delete mode 100644 build/luajit/luajit.vcxproj delete mode 100644 build/luajit/luajit.vcxproj.filters delete mode 100644 build/paths.props delete mode 100644 build/respack.targets delete mode 100644 build/scintilla/catalogue.cpp delete mode 100644 build/scintilla/scintilla.vcxproj delete mode 100644 build/scintilla/scintilla.vcxproj.filters delete mode 100644 build/standard-outdirs.props delete mode 100644 build/standard-settings.props delete mode 100644 build/tasks.props delete mode 100644 build/tests/tests.vcxproj delete mode 100644 build/tests/tests.vcxproj.filters delete mode 100644 build/universalchardet/universalchardet.vcxproj delete mode 100644 build/universalchardet/universalchardet.vcxproj.filters delete mode 100644 build/userconfig/ft2.props.sample delete mode 100644 build/userconfig/paths.props.sample delete mode 100644 build/userconfig/readme.txt delete mode 100644 build/userconfig/wx.props.sample delete mode 100644 build/wx/setup-build.h delete mode 100644 build/wx/setup-installed.h delete mode 100644 build/wx/stc-fi.h delete mode 100644 build/wx/wxWidgets.vcxproj delete mode 100644 build/yasm.targets delete mode 100644 build/zlib/zconf.h delete mode 100644 build/zlib/zlib.vcxproj diff --git a/.gitignore b/.gitignore index 59e1893bb..67fb79e98 100644 --- a/.gitignore +++ b/.gitignore @@ -61,7 +61,7 @@ vendor/luajit/src/luajit *.kdev4 # Meson -builddir/ +build*/ subprojects/freetype* subprojects/fribidi subprojects/harfbuzz diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config deleted file mode 100644 index 25dfbe7ab..000000000 --- a/.nuget/NuGet.Config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/.nuget/NuGet.targets b/.nuget/NuGet.targets deleted file mode 100644 index 2cada41fb..000000000 --- a/.nuget/NuGet.targets +++ /dev/null @@ -1,150 +0,0 @@ - - - - $(MSBuildProjectDirectory)\..\ - - - true - - - false - - - false - - - true - - - - - - - - - - $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) - $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) - - - - - $(SolutionDir).nuget - packages.config - - - - - $(NuGetToolsPath)\nuget.exe - @(PackageSource) - - "$(NuGetExePath)" - mono --runtime=v4.0.30319 $(NuGetExePath) - - $(TargetDir.Trim('\\')) - - -RequireConsent - - $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " - $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols - - - - RestorePackages; - $(ResolveReferencesDependsOn); - - - - - $(BuildDependsOn); - BuildPackage; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Aegisub.sln b/Aegisub.sln deleted file mode 100644 index c8bdcada0..000000000 --- a/Aegisub.sln +++ /dev/null @@ -1,572 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30324.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Aegisub", "build\Aegisub\Aegisub.vcxproj", "{9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csrihelper", "build\csrihelper\csrihelper.vcxproj", "{C832EAF3-860D-4373-A02C-933626B47A5E}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hunspell", "build\hunspell\hunspell.vcxproj", "{CC791693-6B28-40AC-879D-64A6C16468E3}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaegisub", "build\libaegisub\libaegisub.vcxproj", "{BB3FED86-DB7A-4DC7-964A-260FB86CDE61}" - ProjectSection(ProjectDependencies) = postProject - {A649D828-A399-4D81-ADEF-94CFDBA7847F} = {A649D828-A399-4D81-ADEF-94CFDBA7847F} - {F934AB7B-186B-4E96-B20C-A58C38C1B818} = {F934AB7B-186B-4E96-B20C-A58C38C1B818} - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F} = {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F} - {965054D2-44F2-4EB2-9879-051CC3D7EF08} = {965054D2-44F2-4EB2-9879-051CC3D7EF08} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libiconv", "build\libiconv\libiconv.vcxproj", "{965054D2-44F2-4EB2-9879-051CC3D7EF08}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libresrc", "build\libresrc\libresrc.vcxproj", "{BD00D65F-24DA-4784-8860-3B972EA125FC}" - ProjectSection(ProjectDependencies) = postProject - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC} = {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "luabins", "build\luabins\luabins.vcxproj", "{A7A30702-8162-4E1A-A010-EF51B590C121}" - ProjectSection(ProjectDependencies) = postProject - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F} = {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "universalchardet", "build\universalchardet\universalchardet.vcxproj", "{7B56955D-5162-4698-AA5B-47484EDC8783}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fftw", "build\fftw\fftw.vcxproj", "{EA3DCC95-2423-4EA0-A508-7A427B4C0594}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "build\freetype2\freetype.vcxproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fribidi", "build\fribidi\fribidi.vcxproj", "{FB8E8D19-A4D6-4181-943C-282075F49B41}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ffms2", "build\ffms2\ffms2.vcxproj", "{AA137613-96A1-4388-8905-71345B4F8F87}" - ProjectSection(ProjectDependencies) = postProject - {F934AB7B-186B-4E96-B20C-A58C38C1B819} = {F934AB7B-186B-4E96-B20C-A58C38C1B819} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ffmpeg", "build\ffmpeg\ffmpeg.vcxproj", "{F934AB7B-186B-4E96-B20C-A58C38C1B819}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE} = {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "build\zlib\zlib.vcxproj", "{10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CEAEFCB9-3759-4D03-8D51-7287D7B7E7DF}" - ProjectSection(SolutionItems) = preProject - .nuget\NuGet.Config = .nuget\NuGet.Config - .nuget\NuGet.exe = .nuget\NuGet.exe - .nuget\NuGet.targets = .nuget\NuGet.targets - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxWidgets", "build\wx\wxWidgets.vcxproj", "{0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libass", "build\libass\libass.vcxproj", "{8804F253-DA67-4CC4-926B-0CD2AEE5778D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PortableInstaller", "build\PortableInstaller\PortableInstaller.vcxproj", "{5B0E9978-E76F-4BBC-8194-228323F59B53}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost", "build\boost\boost.vcxproj", "{A649D828-A399-4D81-ADEF-94CFDBA7847F}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - {F934AB7B-186B-4E96-B20C-A58C38C1B818} = {F934AB7B-186B-4E96-B20C-A58C38C1B818} - {965054D2-44F2-4EB2-9879-051CC3D7EF08} = {965054D2-44F2-4EB2-9879-051CC3D7EF08} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icu", "build\icu\icu.vcxproj", "{F934AB7B-186B-4E96-B20C-A58C38C1B818}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "googletest", "build\googletest\googletest.vcxproj", "{FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "build\tests\tests.vcxproj", "{49766286-2B5D-4177-A860-BD7CE1846EEF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildTasks", "build\BuildTasks\BuildTasks.csproj", "{914A5B35-66B2-4293-BB6C-D93DA9BC68C6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "luajit-minilua", "build\luajit-minilua\luajit-minilua.vcxproj", "{FCAED410-90EF-4EF9-916C-4B86DC13A3CF}" - ProjectSection(ProjectDependencies) = postProject - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} = {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "luajit-buildvm", "build\luajit-buildvm\luajit-buildvm.vcxproj", "{7CA6A4EB-A11B-4975-8F3A-F633111C6213}" - ProjectSection(ProjectDependencies) = postProject - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF} = {FCAED410-90EF-4EF9-916C-4B86DC13A3CF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "luajit", "build\luajit\luajit.vcxproj", "{5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}" - ProjectSection(ProjectDependencies) = postProject - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF} = {FCAED410-90EF-4EF9-916C-4B86DC13A3CF} - {7CA6A4EB-A11B-4975-8F3A-F633111C6213} = {7CA6A4EB-A11B-4975-8F3A-F633111C6213} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "expat", "build\expat\expat.vcxproj", "{D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "build\libpng\libpng.vcxproj", "{5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scintilla", "build\scintilla\scintilla.vcxproj", "{D6EA54FD-F15C-42F6-929B-A83F299A4582}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Debug-MinDep|Win32 = Debug-MinDep|Win32 - Debug-MinDep|x64 = Debug-MinDep|x64 - Debug-Tests|Win32 = Debug-Tests|Win32 - Debug-Tests|x64 = Debug-Tests|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - Release-MinDep|Win32 = Release-MinDep|Win32 - Release-MinDep|x64 = Release-MinDep|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Debug|Win32.ActiveCfg = Debug|Win32 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Debug|Win32.Build.0 = Debug|Win32 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Debug|x64.ActiveCfg = Debug|x64 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Debug|x64.Build.0 = Debug|x64 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Debug-MinDep|Win32.Build.0 = Debug|Win32 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Debug-MinDep|x64.Build.0 = Debug|x64 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Debug-Tests|x64.Build.0 = Debug|x64 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Release|Win32.ActiveCfg = Release|Win32 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Release|Win32.Build.0 = Release|Win32 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Release|x64.ActiveCfg = Release|x64 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Release|x64.Build.0 = Release|x64 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Release-MinDep|Win32.Build.0 = Release|Win32 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Release-MinDep|x64.ActiveCfg = Release|x64 - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A}.Release-MinDep|x64.Build.0 = Release|x64 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Debug|Win32.ActiveCfg = Debug|Win32 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Debug|Win32.Build.0 = Debug|Win32 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Debug|x64.ActiveCfg = Debug|x64 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Debug|x64.Build.0 = Debug|x64 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Release|Win32.ActiveCfg = Release|Win32 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Release|Win32.Build.0 = Release|Win32 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Release|x64.ActiveCfg = Release|x64 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Release|x64.Build.0 = Release|x64 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {C832EAF3-860D-4373-A02C-933626B47A5E}.Release-MinDep|x64.ActiveCfg = Release|x64 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Debug|Win32.ActiveCfg = Debug|Win32 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Debug|Win32.Build.0 = Debug|Win32 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Debug|x64.ActiveCfg = Debug|x64 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Debug|x64.Build.0 = Debug|x64 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Release|Win32.ActiveCfg = Release|Win32 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Release|Win32.Build.0 = Release|Win32 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Release|x64.ActiveCfg = Release|x64 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Release|x64.Build.0 = Release|x64 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {CC791693-6B28-40AC-879D-64A6C16468E3}.Release-MinDep|x64.ActiveCfg = Release|x64 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Debug|Win32.ActiveCfg = Debug|Win32 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Debug|Win32.Build.0 = Debug|Win32 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Debug|x64.ActiveCfg = Debug|x64 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Debug|x64.Build.0 = Debug|x64 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Debug-MinDep|Win32.Build.0 = Debug|Win32 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Debug-MinDep|x64.Build.0 = Debug|x64 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Debug-Tests|Win32.Build.0 = Debug|Win32 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Debug-Tests|x64.Build.0 = Debug|x64 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Release|Win32.ActiveCfg = Release|Win32 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Release|Win32.Build.0 = Release|Win32 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Release|x64.ActiveCfg = Release|x64 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Release|x64.Build.0 = Release|x64 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Release-MinDep|Win32.Build.0 = Release|Win32 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Release-MinDep|x64.ActiveCfg = Release|x64 - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61}.Release-MinDep|x64.Build.0 = Release|x64 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Debug|Win32.ActiveCfg = Debug|Win32 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Debug|Win32.Build.0 = Debug|Win32 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Debug|x64.ActiveCfg = Debug|x64 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Debug|x64.Build.0 = Debug|x64 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Release|Win32.ActiveCfg = Release|Win32 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Release|Win32.Build.0 = Release|Win32 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Release|x64.ActiveCfg = Release|x64 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Release|x64.Build.0 = Release|x64 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {965054D2-44F2-4EB2-9879-051CC3D7EF08}.Release-MinDep|x64.ActiveCfg = Release|x64 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Debug|Win32.ActiveCfg = Debug|Win32 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Debug|Win32.Build.0 = Debug|Win32 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Debug|x64.ActiveCfg = Debug|x64 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Debug|x64.Build.0 = Debug|x64 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Debug-MinDep|Win32.Build.0 = Debug|Win32 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Debug-MinDep|x64.Build.0 = Debug|x64 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Release|Win32.ActiveCfg = Release|Win32 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Release|Win32.Build.0 = Release|Win32 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Release|x64.ActiveCfg = Release|x64 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Release|x64.Build.0 = Release|x64 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Release-MinDep|Win32.Build.0 = Release|Win32 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Release-MinDep|x64.ActiveCfg = Release|x64 - {BD00D65F-24DA-4784-8860-3B972EA125FC}.Release-MinDep|x64.Build.0 = Release|x64 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Debug|Win32.ActiveCfg = Debug|Win32 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Debug|Win32.Build.0 = Debug|Win32 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Debug|x64.ActiveCfg = Debug|x64 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Debug|x64.Build.0 = Debug|x64 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Debug-Tests|x64.Build.0 = Debug|x64 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Release|Win32.ActiveCfg = Release|Win32 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Release|Win32.Build.0 = Release|Win32 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Release|x64.ActiveCfg = Release|x64 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Release|x64.Build.0 = Release|x64 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {A7A30702-8162-4E1A-A010-EF51B590C121}.Release-MinDep|x64.ActiveCfg = Release|x64 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Debug|Win32.ActiveCfg = Debug|Win32 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Debug|Win32.Build.0 = Debug|Win32 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Debug|x64.ActiveCfg = Debug|x64 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Debug|x64.Build.0 = Debug|x64 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Release|Win32.ActiveCfg = Release|Win32 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Release|Win32.Build.0 = Release|Win32 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Release|x64.ActiveCfg = Release|x64 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Release|x64.Build.0 = Release|x64 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {7B56955D-5162-4698-AA5B-47484EDC8783}.Release-MinDep|x64.ActiveCfg = Release|x64 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Debug|Win32.ActiveCfg = Debug|Win32 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Debug|Win32.Build.0 = Debug|Win32 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Debug|x64.ActiveCfg = Debug|x64 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Debug|x64.Build.0 = Debug|x64 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Release|Win32.ActiveCfg = Release|Win32 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Release|Win32.Build.0 = Release|Win32 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Release|x64.ActiveCfg = Release|x64 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Release|x64.Build.0 = Release|x64 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {EA3DCC95-2423-4EA0-A508-7A427B4C0594}.Release-MinDep|x64.ActiveCfg = Release|x64 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release-MinDep|x64.ActiveCfg = Release|x64 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Debug|Win32.ActiveCfg = Debug|Win32 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Debug|Win32.Build.0 = Debug|Win32 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Debug|x64.ActiveCfg = Debug|x64 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Debug|x64.Build.0 = Debug|x64 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Release|Win32.ActiveCfg = Release|Win32 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Release|Win32.Build.0 = Release|Win32 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Release|x64.ActiveCfg = Release|x64 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Release|x64.Build.0 = Release|x64 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {AD56899E-961B-47B7-BD0F-14D0DA50D141}.Release-MinDep|x64.ActiveCfg = Release|x64 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Debug|Win32.ActiveCfg = Debug|Win32 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Debug|Win32.Build.0 = Debug|Win32 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Debug|x64.ActiveCfg = Debug|x64 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Debug|x64.Build.0 = Debug|x64 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Release|Win32.ActiveCfg = Release|Win32 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Release|Win32.Build.0 = Release|Win32 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Release|x64.ActiveCfg = Release|x64 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Release|x64.Build.0 = Release|x64 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {FB8E8D19-A4D6-4181-943C-282075F49B41}.Release-MinDep|x64.ActiveCfg = Release|x64 - {AA137613-96A1-4388-8905-71345B4F8F87}.Debug|Win32.ActiveCfg = Debug|Win32 - {AA137613-96A1-4388-8905-71345B4F8F87}.Debug|Win32.Build.0 = Debug|Win32 - {AA137613-96A1-4388-8905-71345B4F8F87}.Debug|x64.ActiveCfg = Debug|x64 - {AA137613-96A1-4388-8905-71345B4F8F87}.Debug|x64.Build.0 = Debug|x64 - {AA137613-96A1-4388-8905-71345B4F8F87}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {AA137613-96A1-4388-8905-71345B4F8F87}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {AA137613-96A1-4388-8905-71345B4F8F87}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {AA137613-96A1-4388-8905-71345B4F8F87}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {AA137613-96A1-4388-8905-71345B4F8F87}.Release|Win32.ActiveCfg = Release|Win32 - {AA137613-96A1-4388-8905-71345B4F8F87}.Release|Win32.Build.0 = Release|Win32 - {AA137613-96A1-4388-8905-71345B4F8F87}.Release|x64.ActiveCfg = Release|x64 - {AA137613-96A1-4388-8905-71345B4F8F87}.Release|x64.Build.0 = Release|x64 - {AA137613-96A1-4388-8905-71345B4F8F87}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {AA137613-96A1-4388-8905-71345B4F8F87}.Release-MinDep|x64.ActiveCfg = Release|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Debug|Win32.ActiveCfg = Debug|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Debug|Win32.Build.0 = Debug|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Debug|x64.ActiveCfg = Debug|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Debug|x64.Build.0 = Debug|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Release|Win32.ActiveCfg = Release|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Release|Win32.Build.0 = Release|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Release|x64.ActiveCfg = Release|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Release|x64.Build.0 = Release|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B819}.Release-MinDep|x64.ActiveCfg = Release|x64 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Debug|Win32.ActiveCfg = Debug|Win32 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Debug|Win32.Build.0 = Debug|Win32 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Debug|x64.ActiveCfg = Debug|x64 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Debug|x64.Build.0 = Debug|x64 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Release|Win32.ActiveCfg = Release|Win32 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Release|Win32.Build.0 = Release|Win32 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Release|x64.ActiveCfg = Release|x64 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Release|x64.Build.0 = Release|x64 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE}.Release-MinDep|x64.ActiveCfg = Release|x64 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Debug|Win32.ActiveCfg = Debug|Win32 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Debug|Win32.Build.0 = Debug|Win32 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Debug|x64.ActiveCfg = Debug|x64 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Debug|x64.Build.0 = Debug|x64 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Release|Win32.ActiveCfg = Release|Win32 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Release|Win32.Build.0 = Release|Win32 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Release|x64.ActiveCfg = Release|x64 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Release|x64.Build.0 = Release|x64 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC}.Release-MinDep|x64.ActiveCfg = Release|x64 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Debug|Win32.ActiveCfg = Debug|Win32 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Debug|Win32.Build.0 = Debug|Win32 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Debug|x64.ActiveCfg = Debug|x64 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Debug|x64.Build.0 = Debug|x64 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Release|Win32.ActiveCfg = Release|Win32 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Release|Win32.Build.0 = Release|Win32 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Release|x64.ActiveCfg = Release|x64 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Release|x64.Build.0 = Release|x64 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {8804F253-DA67-4CC4-926B-0CD2AEE5778D}.Release-MinDep|x64.ActiveCfg = Release|x64 - {5B0E9978-E76F-4BBC-8194-228323F59B53}.Debug|Win32.ActiveCfg = Debug|Win32 - {5B0E9978-E76F-4BBC-8194-228323F59B53}.Debug|x64.ActiveCfg = Debug|x64 - {5B0E9978-E76F-4BBC-8194-228323F59B53}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {5B0E9978-E76F-4BBC-8194-228323F59B53}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {5B0E9978-E76F-4BBC-8194-228323F59B53}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {5B0E9978-E76F-4BBC-8194-228323F59B53}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {5B0E9978-E76F-4BBC-8194-228323F59B53}.Release|Win32.ActiveCfg = Release|Win32 - {5B0E9978-E76F-4BBC-8194-228323F59B53}.Release|x64.ActiveCfg = Release|x64 - {5B0E9978-E76F-4BBC-8194-228323F59B53}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {5B0E9978-E76F-4BBC-8194-228323F59B53}.Release-MinDep|x64.ActiveCfg = Release|x64 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Debug|Win32.ActiveCfg = Debug|Win32 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Debug|Win32.Build.0 = Debug|Win32 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Debug|x64.ActiveCfg = Debug|x64 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Debug|x64.Build.0 = Debug|x64 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Release|Win32.ActiveCfg = Release|Win32 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Release|Win32.Build.0 = Release|Win32 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Release|x64.ActiveCfg = Release|x64 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Release|x64.Build.0 = Release|x64 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {A649D828-A399-4D81-ADEF-94CFDBA7847F}.Release-MinDep|x64.ActiveCfg = Release|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Debug|Win32.ActiveCfg = Debug|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Debug|Win32.Build.0 = Debug|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Debug|x64.ActiveCfg = Debug|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Debug|x64.Build.0 = Debug|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Debug-Tests|x64.Build.0 = Debug|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Release|Win32.ActiveCfg = Release|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Release|Win32.Build.0 = Release|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Release|x64.ActiveCfg = Release|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Release|x64.Build.0 = Release|x64 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {F934AB7B-186B-4E96-B20C-A58C38C1B818}.Release-MinDep|x64.ActiveCfg = Release|x64 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Debug|Win32.ActiveCfg = Debug|Win32 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Debug|Win32.Build.0 = Debug|Win32 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Debug|x64.ActiveCfg = Debug|x64 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Debug|x64.Build.0 = Debug|x64 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Debug-MinDep|x64.ActiveCfg = Debug|Win32 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Release|Win32.ActiveCfg = Release|Win32 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Release|Win32.Build.0 = Release|Win32 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Release|x64.ActiveCfg = Release|x64 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Release|x64.Build.0 = Release|x64 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2}.Release-MinDep|x64.ActiveCfg = Release|x64 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Debug|Win32.ActiveCfg = Debug|Win32 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Debug|Win32.Build.0 = Debug|Win32 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Debug|x64.ActiveCfg = Debug|x64 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Debug|x64.Build.0 = Debug|x64 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Debug-MinDep|x64.ActiveCfg = Debug|Win32 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Debug-Tests|Win32.Build.0 = Debug|Win32 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Release|Win32.ActiveCfg = Release|Win32 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Release|x64.ActiveCfg = Release|x64 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {49766286-2B5D-4177-A860-BD7CE1846EEF}.Release-MinDep|x64.ActiveCfg = Release|x64 - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6}.Debug|Win32.ActiveCfg = Debug|Any CPU - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6}.Debug|Win32.Build.0 = Debug|Any CPU - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6}.Debug|x64.ActiveCfg = Debug|Any CPU - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6}.Debug-MinDep|Win32.ActiveCfg = Debug|Any CPU - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6}.Debug-MinDep|x64.ActiveCfg = Debug|Any CPU - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6}.Debug-Tests|Win32.ActiveCfg = Debug|Any CPU - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6}.Debug-Tests|x64.ActiveCfg = Debug|Any CPU - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6}.Release|Win32.ActiveCfg = Release|Any CPU - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6}.Release|x64.ActiveCfg = Release|Any CPU - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6}.Release-MinDep|Win32.ActiveCfg = Release|Any CPU - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6}.Release-MinDep|x64.ActiveCfg = Release|Any CPU - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Debug|Win32.ActiveCfg = Debug|Win32 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Debug|Win32.Build.0 = Debug|Win32 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Debug|x64.ActiveCfg = Debug|x64 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Debug|x64.Build.0 = Debug|x64 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Debug-Tests|x64.ActiveCfg = Debug|Win32 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Release|Win32.ActiveCfg = Release|Win32 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Release|Win32.Build.0 = Release|Win32 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Release|x64.ActiveCfg = Release|x64 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Release|x64.Build.0 = Release|x64 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF}.Release-MinDep|x64.ActiveCfg = Release|x64 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Debug|Win32.ActiveCfg = Debug|Win32 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Debug|Win32.Build.0 = Debug|Win32 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Debug|x64.ActiveCfg = Debug|x64 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Debug|x64.Build.0 = Debug|x64 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Debug-Tests|x64.ActiveCfg = Debug|Win32 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Release|Win32.ActiveCfg = Release|Win32 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Release|Win32.Build.0 = Release|Win32 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Release|x64.ActiveCfg = Release|x64 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Release|x64.Build.0 = Release|x64 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {7CA6A4EB-A11B-4975-8F3A-F633111C6213}.Release-MinDep|x64.ActiveCfg = Release|x64 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Debug|Win32.ActiveCfg = Debug|Win32 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Debug|Win32.Build.0 = Debug|Win32 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Debug|x64.ActiveCfg = Debug|x64 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Debug|x64.Build.0 = Debug|x64 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Debug-Tests|x64.Build.0 = Debug|x64 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Release|Win32.ActiveCfg = Release|Win32 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Release|Win32.Build.0 = Release|Win32 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Release|x64.ActiveCfg = Release|x64 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Release|x64.Build.0 = Release|x64 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F}.Release-MinDep|x64.ActiveCfg = Release|x64 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Debug|Win32.ActiveCfg = Debug|Win32 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Debug|Win32.Build.0 = Debug|Win32 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Debug|x64.ActiveCfg = Debug|x64 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Debug|x64.Build.0 = Debug|x64 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Debug-Tests|Win32.Build.0 = Debug|Win32 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Debug-Tests|x64.Build.0 = Debug|x64 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Release|Win32.ActiveCfg = Release|Win32 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Release|Win32.Build.0 = Release|Win32 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Release|x64.ActiveCfg = Release|x64 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Release|x64.Build.0 = Release|x64 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A}.Release-MinDep|x64.ActiveCfg = Release|x64 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Debug|Win32.ActiveCfg = Debug|Win32 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Debug|Win32.Build.0 = Debug|Win32 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Debug|x64.ActiveCfg = Debug|x64 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Debug|x64.Build.0 = Debug|x64 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Debug-Tests|Win32.Build.0 = Debug|Win32 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Debug-Tests|x64.Build.0 = Debug|x64 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Release|Win32.ActiveCfg = Release|Win32 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Release|Win32.Build.0 = Release|Win32 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Release|x64.ActiveCfg = Release|x64 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Release|x64.Build.0 = Release|x64 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96}.Release-MinDep|x64.ActiveCfg = Release|x64 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Debug|Win32.ActiveCfg = Debug|Win32 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Debug|Win32.Build.0 = Debug|Win32 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Debug|x64.ActiveCfg = Debug|x64 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Debug|x64.Build.0 = Debug|x64 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Debug-MinDep|Win32.ActiveCfg = Debug|Win32 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Debug-MinDep|x64.ActiveCfg = Debug|x64 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Debug-Tests|Win32.ActiveCfg = Debug|Win32 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Debug-Tests|Win32.Build.0 = Debug|Win32 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Debug-Tests|x64.ActiveCfg = Debug|x64 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Debug-Tests|x64.Build.0 = Debug|x64 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Release|Win32.ActiveCfg = Release|Win32 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Release|Win32.Build.0 = Release|Win32 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Release|x64.ActiveCfg = Release|x64 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Release|x64.Build.0 = Release|x64 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Release-MinDep|Win32.ActiveCfg = Release|Win32 - {D6EA54FD-F15C-42F6-929B-A83F299A4582}.Release-MinDep|x64.ActiveCfg = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/build/Aegisub/Aegisub.targets b/build/Aegisub/Aegisub.targets deleted file mode 100644 index 78d939088..000000000 --- a/build/Aegisub/Aegisub.targets +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - BUILD_CREDIT="$(AegisubBuildCredit)";%(PreprocessorDefinitions) - - - - - - - - WITH_UPDATE_CHECKER; - UPDATE_CHECKER_SERVER="$(UpdateCheckerServer)"; - UPDATE_CHECKER_BASE_URL="$(UpdateCheckerURL)"; - %(PreprocessorDefinitions) - - - - - - - - WITH_HUNSPELL;%(PreprocessorDefinitions) - $(AegisubContribBase)hunspell\src;%(AdditionalIncludeDirectories) - - - - - - - WITH_CSRI;%(PreprocessorDefinitions) - - - - - - - WITH_CSRI;%(PreprocessorDefinitions) - - - $(CsriLibraryPath);%(AdditionalLibraryDirectories) - $(CsriLibraryName);%(AdditionalDependencies) - - - - - - - WITH_FFMS2;FFMS_STATIC;%(PreprocessorDefinitions) - - - - - - - WITH_AVISYNTH;%(PreprocessorDefinitions) - - - - - - - WITH_FFTW3;%(PreprocessorDefinitions) - - - - - - - WITH_OPENAL;%(PreprocessorDefinitions) - - - - - - - WITH_DIRECTSOUND;%(PreprocessorDefinitions) - - - dsound.lib;dxguid.lib;%(AdditionalDependencies) - - - - - - - WITH_STARTUPLOG;%(PreprocessorDefinitions) - - - - - - - - NOMINMAX; - _WIN32_WINNT=0x0602; - %(PreprocessorDefinitions) - - - $(SrcDir)include\; - $(AegisubSourceBase)libaegisub\include; - $(AegisubSourceBase)build; - $(AegisubSourceBase)include; - $(AegisubSourceBase)src; - %(AdditionalIncludeDirectories) - - - - $(AegisubLibraryDir);%(AdditionalLibraryDirectories) - - - - - - - - - - - - - - - - diff --git a/build/Aegisub/Aegisub.vcxproj b/build/Aegisub/Aegisub.vcxproj deleted file mode 100644 index 9d5ae17af..000000000 --- a/build/Aegisub/Aegisub.vcxproj +++ /dev/null @@ -1,440 +0,0 @@ - - - - - {9DDDB9E5-E4A1-423D-A224-F6D4E5AAC06A} - Aegisub - - - - - exe - ..\..\src\ - - - - - - - - aegisub$(AegisubPlatformSuffix) - - - - Use - agi_pre.h - agi_pre.h - /Zm150 %(AdditionalOptions) - - - $(DXSDK_DIR)\Lib\x86 - $(DXSDK_DIR)\Lib\x64 - - - - - - - - - - - - {a649d828-a399-4d81-adef-94cfdba7847f} - - - {c832eaf3-860d-4373-a02c-933626b47a5e} - - - {aa137613-96a1-4388-8905-71345b4f8f87} - - - {ea3dcc95-2423-4ea0-a508-7a427b4c0594} - - - {78b079bd-9fc7-4b9e-b4a6-96da0f00248b} - - - {fb8e8d19-a4d6-4181-943c-282075f49b41} - - - {cc791693-6b28-40ac-879d-64a6c16468e3} - - - {f934ab7b-186b-4e96-b20c-a58c38c1b818} - - - {bb3fed86-db7a-4dc7-964a-260fb86cde61} - - - {8804f253-da67-4cc4-926b-0cd2aee5778d} - - - {965054d2-44f2-4eb2-9879-051cc3d7ef08} - - - {bd00d65f-24da-4784-8860-3b972ea125fc} - - - {A7A30702-8162-4E1A-A010-EF51B590C121} - - - {5391a8b1-9c70-4dc4-92ad-d3e34c6b803f} - - - {7b56955d-5162-4698-aa5b-47484edc8783} - - - {0518d6c0-7bf6-4fd1-91fb-191bd10db2ac} - - - {10f22a5a-dd9e-44a1-ba2e-2a9a7c78b0ee} - - - {d6ba6815-0aac-48fa-8372-d32cde8bf07a} - - - {5cabcbef-e79a-4d27-94a5-cf4eaaf1dd96} - - - {d6ea54fd-f15c-42f6-929b-a83f299a4582} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create - - - NotUsing - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4345;4307;4800 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/Aegisub/Aegisub.vcxproj.filters b/build/Aegisub/Aegisub.vcxproj.filters deleted file mode 100644 index d8c2da283..000000000 --- a/build/Aegisub/Aegisub.vcxproj.filters +++ /dev/null @@ -1,1096 +0,0 @@ - - - - - {b5d22cd4-b7ec-48ad-b78b-948b41e5dc15} - - - {9aad5f25-72b4-4438-9899-b0c405ab5995} - - - {4125e713-d173-48b3-ae2f-e19b889cc926} - - - {2617cdfa-8833-495b-9f75-4950210c628d} - - - {90b18753-1a32-47a0-869d-64ae16e8732d} - - - {4f326b57-8caa-4f6f-90c4-185cf3efc317} - - - {5977a633-1e03-4503-83c6-d3c8994c8002} - - - {97c0a35b-30d3-48ca-9b6a-ab7b97351f9e} - - - {93bfdee7-d33e-466e-ae04-93157adcfa46} - - - {3df67931-35ea-4b94-97eb-adb652294046} - - - {3a5174c9-548b-47a0-a25d-2d03111fb5a7} - - - {113403b0-d0ed-4cc0-a806-9c2802cf9042} - - - {479b034b-3b4d-4225-9fb0-061f469ff90f} - - - {d20479a0-e0cf-47af-a57f-7be8989fb489} - - - {4079897b-063b-432c-9554-f9302fef4d50} - - - {d8a621a5-3f03-409b-94be-ad2295e1ee36} - - - {aaf66839-8213-4eba-9b2a-13576b5529d0} - - - {0f4d31a3-388e-4927-af19-7da06b86f279} - - - {c69ec6d0-05f4-45d1-878e-5130e6fd3a53} - - - {048d6559-42b4-4dca-af9a-b9b15b6013f7} - - - {01522e6d-8711-4a71-b9b8-a94a24ef0de0} - - - {1f3f1f35-6805-4367-871d-b7e876fe88ab} - - - {ac0a16bb-3474-4468-8a75-e094f32759e6} - - - {822cb96c-6c7c-4602-93cb-5fdd8fd81559} - - - {a7868613-b0f5-4460-ab27-6be2f75b0b4b} - - - {e0404060-b33b-4a55-8181-b5dbb36bfa95} - - - {98daa273-a000-4c7c-b40a-887e96441885} - - - {e58def38-4472-43c0-ad27-e5c461aaf8f7} - - - {b480102a-5ea0-4397-96c5-8ddb6f0368b9} - - - {db74dafc-a06f-4750-9af7-d9a9ed69b21e} - - - {5093b49a-3cb0-4b01-b301-51994f2020dd} - - - {c22e763b-46cf-415f-8bc7-0ca7f7a8c480} - - - {2a4cb9b1-8651-4b71-bdca-e14fe33d8f47} - - - {a789b2c9-c65c-4a60-a25d-caa32f5aa1d0} - - - {ba371dc7-556e-4e45-a5bd-3d9013bf0e29} - - - {7b32f9be-de39-4892-9afc-0656d4dfff91} - - - {e555b022-7aaf-483e-9b88-9a407f29e9c8} - - - {cea88d45-ff52-425f-b552-69d126142a34} - - - {8c5b1ccb-1afc-4d50-ada9-884e4cca2f1b} - - - {423c43df-bad0-443b-9252-17c4b3e196f7} - - - {7ece8180-ee96-41f3-8fe6-d1dd38eae79c} - - - {76ce8128-70e2-4d8f-8e8e-5336bacd2aec} - - - {18a9fba6-a508-4818-be63-244453b7a253} - - - {9d6859f4-b01a-43d7-be84-2694076fc064} - - - {9f657627-e879-4f7b-bb40-b65d9ba2cd12} - - - {d6c66065-8df9-4897-a37f-1f3c31d0e7ce} - - - {258406b7-fae3-494a-80ff-80410051be27} - - - {39646be7-5dce-471c-ab93-1e3f7f6f9fe1} - - - {fde3be82-3653-4519-88f5-8c16ddfb1531} - - - - - ASS - - - ASS - - - ASS - - - ASS - - - ASS - - - ASS - - - ASS - - - ASS - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Automation - - - Commands - - - Audio\Players - - - Utilities - - - Audio - - - Features\Style editor - - - Features\Font collector - - - Video\UI - - - Features\Export - - - Features\Export - - - Features\Export - - - Automation\Lua - - - Automation\Lua - - - Features\Translation Assistant - - - Features\Colour picker - - - Video\UI - - - Video\UI - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Features\Spell checker - - - Features\Thesaurus - - - Features\Styling assistant - - - Video - - - Video - - - Video\UI - - - Video\UI - - - Video\UI - - - Video\Providers - - - Video\Providers - - - Video\UI - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Audio - - - AV support - - - AV support - - - AV support - - - AV support - - - AV support - - - Video\Subtitle renderers - - - Video\Subtitle renderers - - - Features\Style editor - - - Utilities - - - Config - - - Main UI - - - Main UI - - - Main UI\Grid - - - Main UI\Grid - - - Main UI\Edit box - - - Main UI\Edit box - - - Features\Import - - - Features\Help - - - Features\Colour picker - - - Utilities - - - Utilities - - - Utilities - - - Preferences - - - Audio\Players - - - Audio\Providers - - - Main UI - - - Main UI - - - Main UI - - - Features\Spell checker - - - Video\Subtitle renderers - - - Main UI - - - Video\Providers - - - Video\Visual tools - - - Video\Visual tools - - - Features\About box - - - Features\Search-replace - - - Utilities\UI utilities - - - Utilities\UI utilities - - - Utilities\Logging - - - Utilities - - - ASS - - - ASS - - - Utilities - - - Features\Help - - - Controls - - - Utilities - - - Utilities - - - Controls - - - Video\Visual tools - - - Preferences - - - Preferences - - - Utilities\UI utilities - - - Main UI\Edit box - - - ASS - - - Utilities\UI utilities - - - Audio - - - Controls - - - ASS - - - Preferences - - - Features\Search-replace - - - Utilities - - - ASS - - - Features\Resolution resampler - - - Main UI\Grid - - - Subtitle formats - - - Video\Providers - - - Main UI - - - Features - - - Utilities - - - - - ASS - - - ASS - - - ASS - - - ASS - - - ASS - - - ASS - - - ASS - - - ASS - - - Audio\Providers - - - Audio\Providers - - - Audio\Providers - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Audio\UI - - - Commands - - - Automation - - - Commands - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Visual tools - - - Video\Providers - - - Video\Providers - - - Video\Providers - - - Video\Providers - - - Video\Providers - - - Video\Providers - - - Video\UI - - - Video\UI - - - Video\UI - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Subtitle formats - - - Video\Subtitle renderers - - - Video\Subtitle renderers - - - Video\Subtitle renderers - - - Commands - - - Audio\Players - - - Audio\Players - - - Audio\Players - - - Audio\Players - - - Audio\Players - - - Audio\Players - - - Audio\Players - - - Audio\Players - - - Video - - - Audio - - - Features\Attachments - - - Video\UI - - - Video\UI - - - Features\Style editor - - - Features\Style editor - - - Features\Font collector - - - Features\Font collector - - - Video\UI - - - Video\UI - - - Features\Export - - - Features\Export - - - Features\Export - - - Features\Export - - - Automation\Lua - - - Automation\Lua - - - Automation\Lua - - - Automation\Lua - - - Automation\UI - - - Features\Paste Over - - - Features\Shift Times - - - Features\Translation Assistant - - - Features\Colour picker - - - Features\Colour picker - - - Features\Karaoke copier - - - Features\Font collector - - - Video\UI - - - Video\UI - - - Features\Spell checker - - - Features\Spell checker - - - Features\Spell checker - - - Features\Thesaurus - - - Features\Resolution resampler - - - Features\Import - - - Features\Timing post-processor - - - Features\Styling assistant - - - Features\Update checker - - - Video - - - Video\UI - - - Audio - - - AV support - - - AV support - - - AV support - - - AV support - - - Features\Style editor - - - Utilities - - - Main UI - - - Config - - - Main UI - - - Main UI\Grid - - - Main UI\Grid - - - Main UI\Edit box - - - Main UI\Edit box - - - Features\Import - - - Features\Help - - - Features\Colour picker - - - Utilities - - - Utilities - - - Preferences - - - Main UI - - - Main UI - - - Video\Visual tools - - - Video\Visual tools - - - Commands - - - Features\About box - - - Features\About box - - - Features\Conditional select lines - - - Features\Search-replace - - - Utilities\UI utilities - - - Utilities\UI utilities - - - Utilities\UI utilities - - - Utilities\Logging - - - Commands - - - Commands - - - Utilities - - - Features\File properties - - - ASS - - - ASS - - - Commands - - - Main UI - - - Commands - - - Commands - - - Utilities - - - Features\Help - - - Controls - - - Utilities - - - Utilities - - - Controls - - - Video\Visual tools - - - Preferences - - - Preferences - - - Commands - - - Commands - - - Commands - - - Commands - - - Commands - - - Utilities\UI utilities - - - ASS - - - Commands - - - Features\Autosave - - - Features\Search-replace - - - Utilities - - - ASS - - - Features\Resolution resampler - - - Utilities\Logging - - - Utilities\Logging - - - Main UI - - - Main UI\Edit box - - - Main UI\Grid - - - Subtitle formats - - - Features\Resolution resampler - - - Video\Providers - - - Main UI - - - - - - - diff --git a/build/Aegisub/Aegisub.xml b/build/Aegisub/Aegisub.xml deleted file mode 100644 index 9012b3dfb..000000000 --- a/build/Aegisub/Aegisub.xml +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/Aegisub/standard-libraries.props b/build/Aegisub/standard-libraries.props deleted file mode 100644 index b4f5074e1..000000000 --- a/build/Aegisub/standard-libraries.props +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - <_PropertySheetDisplayName>Standard Libraries - - - - - Usp10.lib; - Vfw32.lib; - advapi32.lib; - bcrypt.lib; - comctl32.lib; - comdlg32.lib; - gdi32.lib; - kernel32.lib; - ole32.lib; - oleaut32.lib; - opengl32.lib; - rpcrt4.lib; - shell32.lib; - user32.lib; - uuid.lib; - wsock32.lib; - %(AdditionalDependencies) - - - - - diff --git a/build/BuildTasks/BuildTasks.csproj b/build/BuildTasks/BuildTasks.csproj deleted file mode 100644 index 4bbea1f2b..000000000 --- a/build/BuildTasks/BuildTasks.csproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - - Debug - AnyCPU - {914A5B35-66B2-4293-BB6C-D93DA9BC68C6} - Library - Properties - BuildTasks - BuildTasks - v4.5 - 512 - ..\..\..\ - - - - $(AegisubBinaryDir) - $(AegisubObjectDir) - - - true - full - false - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - TRACE - prompt - 4 - - - - ..\..\.nuget\lib\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll - - - ..\..\.nuget\lib\LibGit2Sharp.0.17.0.0\lib\net35\LibGit2Sharp.dll - - - - - - - - - - - - - - - - - - - - - - - - - - -if not exist "$(TargetDir)NativeBinaries" md "$(TargetDir)NativeBinaries" -if not exist "$(TargetDir)NativeBinaries\x86" md "$(TargetDir)NativeBinaries\x86" -xcopy /s /y /d "$(SolutionDir).nuget\lib\LibGit2Sharp.0.17.0.0\lib\net35\NativeBinaries\x86\*.*" "$(TargetDir)NativeBinaries\x86" -if not exist "$(TargetDir)NativeBinaries\amd64" md "$(TargetDir)NativeBinaries\amd64" -xcopy /s /y /d "$(SolutionDir).nuget\lib\LibGit2Sharp.0.17.0.0\lib\net35\NativeBinaries\amd64\*.*" "$(TargetDir)NativeBinaries\amd64" - - - diff --git a/build/BuildTasks/DownloadTgzFile.cs b/build/BuildTasks/DownloadTgzFile.cs deleted file mode 100644 index aee359034..000000000 --- a/build/BuildTasks/DownloadTgzFile.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2014, Thomas Goyne -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// Aegisub Project http://www.aegisub.org/ - -namespace BuildTasks { - public class DownloadTgzFile : Microsoft.Build.Utilities.Task { - public string Url { get; set; } - public string OutputFile { get; set; } - public string Hash { get; set; } - - private void DownloadArchive(string url, string unpackDest) { - var downloadStream = new System.Net.WebClient().OpenRead(url); - var gzStream = new ICSharpCode.SharpZipLib.GZip.GZipInputStream(downloadStream); - using (var file = System.IO.File.Create(unpackDest)) { - gzStream.CopyTo(file); - } - } - - public override bool Execute() { - try { - using (var fs = System.IO.File.OpenRead(this.OutputFile)) { - var hash = new System.Security.Cryptography.SHA1Managed().ComputeHash(fs); - if (System.BitConverter.ToString(hash).Replace("-", "").ToLower() == this.Hash) - return true; - } - } - catch (System.IO.IOException) { - // Need to download if file not present or not readable - } - - try { - DownloadArchive(this.Url, this.OutputFile); - } - catch (System.Exception e) { - this.Log.LogErrorFromException(e); - return false; - } - - return true; - } - } -} diff --git a/build/BuildTasks/GitVersion.cs b/build/BuildTasks/GitVersion.cs deleted file mode 100644 index ee29227b0..000000000 --- a/build/BuildTasks/GitVersion.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) 2014, Thomas Goyne -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// Aegisub Project http://www.aegisub.org/ - -using LibGit2Sharp; -using System; -using System.IO; -using System.Linq; -using System.Text.RegularExpressions; - -namespace BuildTasks { - public class GitVersion : Microsoft.Build.Utilities.Task { - public string Root { get; set; } - - private static ObjectId LastSVNCommit = new ObjectId("16cd907fe7482cb54a7374cd28b8501f138116be"); - private const string versionHTemplate = -@"#define BUILD_GIT_VERSION_NUMBER {0} -#define BUILD_GIT_VERSION_STRING ""{1}"" -#define TAGGED_RELEASE {2} -#define INSTALLER_VERSION ""{3}"" -#define RESOURCE_BASE_VERSION {4} -"; - private const string versionXmlTemplate = -@" - - - {0} - {1} - - -"; - - private string UniqueAbbreviation(Repository repo, string full) { - for (int len = 7; len < 40; ++len) { - try { - repo.Lookup(full.Substring(0, len)); - return full.Substring(0, len); - } - catch (AmbiguousSpecificationException) { - continue; - } - } - return full; - } - - private void WriteIfChanged(string path, string template, params object[] args) { - var body = string.Format(template, args).Replace("\r\n", "\n"); - try { - var oldBody = File.ReadAllText(path); - if (body != oldBody) - File.WriteAllText(path, body); - } - catch (IOException) { - File.WriteAllText(path, body); - } - } - - public override bool Execute() { - string versionHPath = Root + "build/git_version.h"; - string versionXmlPath = Root + "build/git_version.xml"; - - if (!Directory.Exists(Root + ".git")) { - if (File.Exists(versionHPath)) { - Log.LogMessage("Using cached version.h"); - return true; - } - Log.LogError("git repo not found and no cached git_version.h"); - return false; - } - - int commits = 6962; // Rev ID when we switched away from SVN - string installerVersion = "0.0.0"; - string resourceVersion = "0, 0, 0"; - string versionStr = null; - bool taggedRelease = false; - using (var repo = new Repository(Root + ".git")) { - commits += repo.Commits.TakeWhile(c => !c.Id.Equals(LastSVNCommit)).Count(); - - foreach (var tag in repo.Tags) { - if (!tag.Target.Id.Equals(repo.Head.Tip.Id)) continue; - - taggedRelease = true; - versionStr = tag.Name; - if (versionStr.StartsWith("v")) versionStr = versionStr.Substring(1); - if (Regex.Match(versionStr, @"(\d)\.(\d)\.(\d)").Success) { - installerVersion = versionStr; - resourceVersion = versionStr.Replace(".", ", "); - } - break; - } - - if (versionStr == null) { - string branch = repo.Head.Name ?? "(unnamed branch)"; - versionStr = string.Format("{0}-{1}-{2}", commits, branch, - UniqueAbbreviation(repo, repo.Head.Tip.Sha.ToString())); - } - } - - WriteIfChanged(versionHPath, versionHTemplate, commits, versionStr, taggedRelease ? "1" : "0", installerVersion, resourceVersion); - WriteIfChanged(versionXmlPath, versionXmlTemplate, commits, versionStr); - - return true; - } - } -} diff --git a/build/BuildTasks/Properties/AssemblyInfo.cs b/build/BuildTasks/Properties/AssemblyInfo.cs deleted file mode 100644 index 5de350117..000000000 --- a/build/BuildTasks/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("BuildTasks")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("BuildTasks")] -[assembly: AssemblyCopyright("Copyright © Thomas Goyne 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("157803fb-ca11-4802-8394-1ee152112561")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/build/BuildTasks/TarballProject.cs b/build/BuildTasks/TarballProject.cs deleted file mode 100644 index f1b60d1d6..000000000 --- a/build/BuildTasks/TarballProject.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) 2014, Thomas Goyne -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// Aegisub Project http://www.aegisub.org/ - -using ICSharpCode.SharpZipLib.Tar; -using System; -using System.IO; -using System.Security.Cryptography; - -namespace BuildTasks { - public class TarballProject : Microsoft.Build.Utilities.Task { - public string Url { get; set; } - public string Root { get; set; } - public string Hash { get; set; } - - private bool NeedsUpdate() { - try { - return Hash != File.ReadAllText(Path.Combine(Root, "aegisub.hash")); - } - catch (IOException) { - return true; - } - } - - private void ExtractEntry(string destDir, TarEntry entry, ICSharpCode.SharpZipLib.Tar.TarInputStream stream) { - string name = entry.Name; - if (Path.IsPathRooted(name)) - name = name.Substring(Path.GetPathRoot(name).Length); - name = name.Replace('/', Path.DirectorySeparatorChar); - name = name.Substring(name.IndexOf(Path.DirectorySeparatorChar) + 1); - - string dest = Path.Combine(destDir, name); - if (entry.IsDirectory) - Directory.CreateDirectory(dest); - else { - Directory.CreateDirectory(Path.GetDirectoryName(dest)); - using (Stream outputStream = File.Create(dest)) { - stream.CopyEntryContents(outputStream); - } - } - } - - public override bool Execute() { - if (!NeedsUpdate()) return true; - - try { - var ms = new MemoryStream(); - var downloadStream = new System.Net.WebClient().OpenRead(Url); - downloadStream.CopyTo(ms); - ms.Seek(0, SeekOrigin.Begin); - - var hash = new SHA256Managed().ComputeHash(ms); - if (BitConverter.ToString(hash).Replace("-", "").ToLower() != this.Hash) { - Log.LogError("Got wrong hash for {0}", Url); - return false; - } - - try { - Directory.Delete(Root, true); - } - catch (DirectoryNotFoundException) { - // Obviously not an issue - } - - ms.Seek(0, SeekOrigin.Begin); - var bzStream = new ICSharpCode.SharpZipLib.BZip2.BZip2InputStream(ms); - var tarStream = new ICSharpCode.SharpZipLib.Tar.TarInputStream(bzStream); - while (true) { - TarEntry entry = tarStream.GetNextEntry(); - if (entry == null) break; - ExtractEntry(Root, entry, tarStream); - } - - File.WriteAllText(Path.Combine(Root, "aegisub.hash"), Hash); - - return true; - } - catch (Exception e) { - Log.LogErrorFromException(e); - return false; - } - } - } -} diff --git a/build/BuildTasks/packages.config b/build/BuildTasks/packages.config deleted file mode 100644 index 3d28d4b1a..000000000 --- a/build/BuildTasks/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/build/DefaultConfiguration.props b/build/DefaultConfiguration.props deleted file mode 100644 index 504b2637e..000000000 --- a/build/DefaultConfiguration.props +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - Anonymous - true - false - HelperLibrary - true - true - true - false - true - vsfilter.lib - false - updates.aegisub.org - /trunk - - $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\vendor)) - $(VendorRoot)\boost - $(VendorRoot)\ffms2 - $(VendorRoot)\ffmpeg - $(VendorRoot)\fftw - $(VendorRoot)\freetype2 - $(VendorRoot)\fribidi - $(VendorRoot)\googletest - $(VendorRoot)\icu\source - $(VendorRoot)\libass - $(VendorRoot)\wxWidgets - $(VendorRoot)\wxWidgets\src\zlib - - diff --git a/build/PortableInstaller/PortableInstaller.vcxproj b/build/PortableInstaller/PortableInstaller.vcxproj deleted file mode 100644 index 23e6b5efb..000000000 --- a/build/PortableInstaller/PortableInstaller.vcxproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - {5B0E9978-E76F-4BBC-8194-228323F59B53} - PortableInstaller - - - - - - - - - x86 - x64 - aegisub-$(GitVersionString)-portable-$(AegisubPlatformSuffix) - $(AegisubSourceBase)packages\win_installer\output\$(FileName).exe - - - - - - - - - - - - - - - - - - - - automation\autoload\ - - - automation\autoload\ - - - automation\autoload\ - - - automation\autoload\ - - - automation\autoload\ - - - automation\autoload\ - - - automation\autoload\ - - - automation\demos\ - - - automation\demos\ - - - automation\include\aegisub\ - - - automation\include\aegisub\ - - - automation\include\aegisub\ - - - automation\include\aegisub\ - - - automation\include\aegisub\ - - - automation\include\aegisub\ - - - automation\include\aegisub\ - - - automation\include\ - - - automation\include\ - - - automation\include\ - - - automation\include\ - - - automation\include\ - - - automation\include\ - - - automation\include\ - - - automation\include\ - - - automation\include\ - - - - - - - - csri\ - - - - - dictionaries\ - - - dictionaries\ - - - - - - - - diff --git a/build/PortableInstaller/PortableInstaller.vcxproj.filters b/build/PortableInstaller/PortableInstaller.vcxproj.filters deleted file mode 100644 index cf2d140a8..000000000 --- a/build/PortableInstaller/PortableInstaller.vcxproj.filters +++ /dev/null @@ -1,127 +0,0 @@ - - - - - {2c1914de-647f-44ab-a698-a289b10ec29c} - - - {862d477a-6db6-4ef0-b547-fa347b8d3aff} - - - {d15cec98-3f6e-4713-a192-8cfdf1bac1d0} - - - {61b13b0c-d018-48c6-8629-b44b83aa0dc8} - - - {8880eb0c-4bf7-424d-9a79-73c20c2dd169} - - - {743db065-17d0-4595-b241-9baa143dd68c} - - - {8e48f676-fdad-4b6e-a146-58a300ee528d} - - - {63aff439-dbde-4092-8dad-905a01c4be6c} - - - {baf7aa4e-709d-4a03-aee1-b54749006b82} - - - - - - Automation\Autoload - - - Automation\Autoload - - - Automation\Autoload - - - Automation\Autoload - - - Automation\Autoload - - - Automation\Autoload - - - Automation\Autoload - - - Automation\Demos - - - Automation\Demos - - - Automation\Include - - - Automation\Include - - - Automation\Include - - - Automation\Include - - - Automation\Include - - - Automation\Include - - - Automation\Include - - - Automation\Include - - - Automation\Include - - - Automation\Include - - - Automation\Include - - - Automation\Include - - - Automation\Include - - - - - CSRI - - - AssDraw - - - AssDraw - - - Avisynth - - - Avisynth - - - Avisynth - - - Dictionaries - - - Dictionaries - - - diff --git a/build/aegisub.props b/build/aegisub.props deleted file mode 100644 index aa07badea..000000000 --- a/build/aegisub.props +++ /dev/null @@ -1,66 +0,0 @@ - - - - <_PropertySheetDisplayName>Aegisub project - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - StaticLibrary - DynamicLibrary - Application - true - false - true - Unicode - MultiByte - v141 - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/boost/boost.vcxproj b/build/boost/boost.vcxproj deleted file mode 100644 index fff93799e..000000000 --- a/build/boost/boost.vcxproj +++ /dev/null @@ -1,139 +0,0 @@ - - - - {A649D828-A399-4D81-ADEF-94CFDBA7847F} - boost - - - - - lib - - - - - - - - - - BOOST_LOCALE_WITH_ICONV=1; - BOOST_LOCALE_WITH_ICU=1; - BOOST_LOCALE_NO_STD_BACKEND=1; - BOOST_LOCALE_NO_WINAPI_BACKEND=1; - BOOST_LOCALE_NO_POSIX_BACKEND=1; - BOOST_THREAD_BUILD_LIB; - %(PreprocessorDefinitions) - - - - - - - $(BuildGenerateSourcesTargets); - CopyBoostHeaders - - - - - - - - - - - - - - - - - - {f934ab7b-186b-4e96-b20c-a58c38c1b818} - - - {965054d2-44f2-4eb2-9879-051cc3d7ef08} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/boost/boost.vcxproj.filters b/build/boost/boost.vcxproj.filters deleted file mode 100644 index 07cced6a6..000000000 --- a/build/boost/boost.vcxproj.filters +++ /dev/null @@ -1,222 +0,0 @@ - - - - - {e091980d-4374-41b8-aa61-1b07695e1b17} - - - {be9f03e9-74a3-4705-97ee-105a404d8a10} - - - {98abe5b9-aca6-4145-ab6d-e472e24eb522} - - - {0dae6521-8684-471f-8d62-9fe3b9295b0c} - - - {8c30568b-1ab1-4815-82e0-127ad31732d7} - - - {47e5ad22-f37e-4512-a8e1-bcb5f04ad24b} - - - {52190269-979d-429b-a825-8e68eacc2274} - - - {829ed5fb-dcba-4d3e-910c-33341e0e6379} - - - {c76e09db-3a8e-4eaf-bb9a-6bac6945fd6f} - - - - - regex - - - regex - - - regex - - - regex - - - regex - - - regex - - - regex - - - regex - - - regex - - - regex - - - regex - - - regex - - - regex - - - regex - - - regex - - - system - - - filesystem - - - filesystem - - - filesystem - - - filesystem - - - filesystem - - - filesystem - - - filesystem - - - filesystem - - - regex - - - locale\icu - - - locale\icu - - - locale\icu - - - locale\icu - - - locale\icu - - - locale\util - - - locale\util - - - locale\util - - - locale\util - - - locale\shared - - - locale\shared - - - locale\shared - - - locale\encoding - - - thread - - - thread - - - - - - regex - - - filesystem - - - locale\icu - - - locale\icu - - - locale\icu - - - locale\icu - - - locale\icu - - - locale\icu - - - locale\icu - - - locale\util - - - locale\util - - - locale\util - - - locale\util - - - locale\util - - - locale\shared - - - locale\shared - - - locale\shared - - - locale\encoding - - - - - locale\encoding - - - locale\encoding - - - locale\encoding - - - \ No newline at end of file diff --git a/build/boost/locale_stubs.cpp b/build/boost/locale_stubs.cpp deleted file mode 100644 index 57c3e921c..000000000 --- a/build/boost/locale_stubs.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2014, Thomas Goyne -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// Aegisub Project http://www.aegisub.org/ - -#include -#include -#include - -// Boost.locale doesn't support partial builds of ICU, so provide stub versions -// of some of the things we don't use -namespace boost { namespace locale { -namespace impl_icu { -struct cdata { - icu::Locale locale; - std::string encoding; - bool utf8; -}; - -std::locale create_formatting(std::locale const& in, cdata const& cd, character_facet_type type) { - return in; -} - -std::locale create_parsing(std::locale const& in, cdata const& cd, character_facet_type type) { - return in; -} - -std::locale create_calendar(std::locale const& in, cdata const& cd) { - return in; -} - -} -namespace gnu_gettext { -template<> -message_format *create_messages_facet(messages_info const &info) { - return nullptr; -} - -template<> -message_format *create_messages_facet(messages_info const &info) { - return nullptr; -} - -#ifdef BOOST_HAS_CHAR16_T -template<> -message_format *create_messages_facet(messages_info const &info) { - return nullptr; -} -#endif - -#ifdef BOOST_HAS_CHAR32_T -template<> -message_format *create_messages_facet(messages_info const &info) { - return nullptr; -} -#endif -} -} } diff --git a/build/csrihelper/csrihelper.vcxproj b/build/csrihelper/csrihelper.vcxproj deleted file mode 100644 index c4115f23b..000000000 --- a/build/csrihelper/csrihelper.vcxproj +++ /dev/null @@ -1,51 +0,0 @@ - - - - - {C832EAF3-860D-4373-A02C-933626B47A5E} - csrihelper - - - - - lib - ..\..\vendor\csri\ - - - - - - - - - CSRI_NO_EXPORT;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - $(SrcDir)include\;$(SrcDir)lib\;$(SrcDir)lib\win32\;%(AdditionalIncludeDirectories) - - - $(SrcDir)include - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/csrihelper/csrihelper.vcxproj.filters b/build/csrihelper/csrihelper.vcxproj.filters deleted file mode 100644 index 0dd2ca51c..000000000 --- a/build/csrihelper/csrihelper.vcxproj.filters +++ /dev/null @@ -1,63 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - diff --git a/build/expat/expat.vcxproj b/build/expat/expat.vcxproj deleted file mode 100644 index 399d6ec12..000000000 --- a/build/expat/expat.vcxproj +++ /dev/null @@ -1,55 +0,0 @@ - - - - {D6BA6815-0AAC-48FA-8372-D32CDE8BF07A} - expat - - - - - lib - ..\..\vendor\wxWidgets\src\expat\lib - - - - - - - - - COMPILED_FROM_DSP;%(PreprocessorDefinitions) - - - $(SrcDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/expat/expat.vcxproj.filters b/build/expat/expat.vcxproj.filters deleted file mode 100644 index 355924ee7..000000000 --- a/build/expat/expat.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/build/ffmpeg/config-x64.asm b/build/ffmpeg/config-x64.asm deleted file mode 100755 index 3cc5a6c31..000000000 --- a/build/ffmpeg/config-x64.asm +++ /dev/null @@ -1,2460 +0,0 @@ -; Automatically generated by configure - do not modify! -%define ARCH_AARCH64 0 -%define ARCH_ALPHA 0 -%define ARCH_ARM 0 -%define ARCH_AVR32 0 -%define ARCH_AVR32_AP 0 -%define ARCH_AVR32_UC 0 -%define ARCH_BFIN 0 -%define ARCH_IA64 0 -%define ARCH_M68K 0 -%define ARCH_MIPS 0 -%define ARCH_MIPS64 0 -%define ARCH_PARISC 0 -%define ARCH_PPC 0 -%define ARCH_PPC64 0 -%define ARCH_S390 0 -%define ARCH_SH4 0 -%define ARCH_SPARC 0 -%define ARCH_SPARC64 0 -%define ARCH_TILEGX 0 -%define ARCH_TILEPRO 0 -%define ARCH_TOMI 0 -%define ARCH_X86 1 -%define ARCH_X86_32 0 -%define ARCH_X86_64 1 -%define HAVE_ARMV5TE 0 -%define HAVE_ARMV6 0 -%define HAVE_ARMV6T2 0 -%define HAVE_ARMV8 0 -%define HAVE_NEON 0 -%define HAVE_VFP 0 -%define HAVE_VFPV3 0 -%define HAVE_SETEND 0 -%define HAVE_ALTIVEC 0 -%define HAVE_DCBZL 0 -%define HAVE_LDBRX 0 -%define HAVE_POWER8 0 -%define HAVE_PPC4XX 0 -%define HAVE_VSX 0 -%define HAVE_AESNI 1 -%define HAVE_AMD3DNOW 1 -%define HAVE_AMD3DNOWEXT 1 -%define HAVE_AVX 1 -%define HAVE_AVX2 1 -%define HAVE_AVX512 1 -%define HAVE_FMA3 1 -%define HAVE_FMA4 1 -%define HAVE_MMX 1 -%define HAVE_MMXEXT 1 -%define HAVE_SSE 1 -%define HAVE_SSE2 1 -%define HAVE_SSE3 1 -%define HAVE_SSE4 1 -%define HAVE_SSE42 1 -%define HAVE_SSSE3 1 -%define HAVE_XOP 1 -%define HAVE_CPUNOP 1 -%define HAVE_I686 1 -%define HAVE_MIPSFPU 0 -%define HAVE_MIPS32R2 0 -%define HAVE_MIPS32R5 0 -%define HAVE_MIPS64R2 0 -%define HAVE_MIPS32R6 0 -%define HAVE_MIPS64R6 0 -%define HAVE_MIPSDSP 0 -%define HAVE_MIPSDSPR2 0 -%define HAVE_MSA 0 -%define HAVE_LOONGSON2 0 -%define HAVE_LOONGSON3 0 -%define HAVE_MMI 0 -%define HAVE_ARMV5TE_EXTERNAL 0 -%define HAVE_ARMV6_EXTERNAL 0 -%define HAVE_ARMV6T2_EXTERNAL 0 -%define HAVE_ARMV8_EXTERNAL 0 -%define HAVE_NEON_EXTERNAL 0 -%define HAVE_VFP_EXTERNAL 0 -%define HAVE_VFPV3_EXTERNAL 0 -%define HAVE_SETEND_EXTERNAL 0 -%define HAVE_ALTIVEC_EXTERNAL 0 -%define HAVE_DCBZL_EXTERNAL 0 -%define HAVE_LDBRX_EXTERNAL 0 -%define HAVE_POWER8_EXTERNAL 0 -%define HAVE_PPC4XX_EXTERNAL 0 -%define HAVE_VSX_EXTERNAL 0 -%define HAVE_AESNI_EXTERNAL 1 -%define HAVE_AMD3DNOW_EXTERNAL 1 -%define HAVE_AMD3DNOWEXT_EXTERNAL 1 -%define HAVE_AVX_EXTERNAL 1 -%define HAVE_AVX2_EXTERNAL 0 -%define HAVE_AVX512_EXTERNAL 0 -%define HAVE_FMA3_EXTERNAL 1 -%define HAVE_FMA4_EXTERNAL 1 -%define HAVE_MMX_EXTERNAL 1 -%define HAVE_MMXEXT_EXTERNAL 1 -%define HAVE_SSE_EXTERNAL 1 -%define HAVE_SSE2_EXTERNAL 1 -%define HAVE_SSE3_EXTERNAL 1 -%define HAVE_SSE4_EXTERNAL 1 -%define HAVE_SSE42_EXTERNAL 1 -%define HAVE_SSSE3_EXTERNAL 1 -%define HAVE_XOP_EXTERNAL 1 -%define HAVE_CPUNOP_EXTERNAL 0 -%define HAVE_I686_EXTERNAL 0 -%define HAVE_MIPSFPU_EXTERNAL 0 -%define HAVE_MIPS32R2_EXTERNAL 0 -%define HAVE_MIPS32R5_EXTERNAL 0 -%define HAVE_MIPS64R2_EXTERNAL 0 -%define HAVE_MIPS32R6_EXTERNAL 0 -%define HAVE_MIPS64R6_EXTERNAL 0 -%define HAVE_MIPSDSP_EXTERNAL 0 -%define HAVE_MIPSDSPR2_EXTERNAL 0 -%define HAVE_MSA_EXTERNAL 0 -%define HAVE_LOONGSON2_EXTERNAL 0 -%define HAVE_LOONGSON3_EXTERNAL 0 -%define HAVE_MMI_EXTERNAL 0 -%define HAVE_ARMV5TE_INLINE 0 -%define HAVE_ARMV6_INLINE 0 -%define HAVE_ARMV6T2_INLINE 0 -%define HAVE_ARMV8_INLINE 0 -%define HAVE_NEON_INLINE 0 -%define HAVE_VFP_INLINE 0 -%define HAVE_VFPV3_INLINE 0 -%define HAVE_SETEND_INLINE 0 -%define HAVE_ALTIVEC_INLINE 0 -%define HAVE_DCBZL_INLINE 0 -%define HAVE_LDBRX_INLINE 0 -%define HAVE_POWER8_INLINE 0 -%define HAVE_PPC4XX_INLINE 0 -%define HAVE_VSX_INLINE 0 -%define HAVE_AESNI_INLINE 0 -%define HAVE_AMD3DNOW_INLINE 0 -%define HAVE_AMD3DNOWEXT_INLINE 0 -%define HAVE_AVX_INLINE 0 -%define HAVE_AVX2_INLINE 0 -%define HAVE_AVX512_INLINE 0 -%define HAVE_FMA3_INLINE 0 -%define HAVE_FMA4_INLINE 0 -%define HAVE_MMX_INLINE 0 -%define HAVE_MMXEXT_INLINE 0 -%define HAVE_SSE_INLINE 0 -%define HAVE_SSE2_INLINE 0 -%define HAVE_SSE3_INLINE 0 -%define HAVE_SSE4_INLINE 0 -%define HAVE_SSE42_INLINE 0 -%define HAVE_SSSE3_INLINE 0 -%define HAVE_XOP_INLINE 0 -%define HAVE_CPUNOP_INLINE 0 -%define HAVE_I686_INLINE 0 -%define HAVE_MIPSFPU_INLINE 0 -%define HAVE_MIPS32R2_INLINE 0 -%define HAVE_MIPS32R5_INLINE 0 -%define HAVE_MIPS64R2_INLINE 0 -%define HAVE_MIPS32R6_INLINE 0 -%define HAVE_MIPS64R6_INLINE 0 -%define HAVE_MIPSDSP_INLINE 0 -%define HAVE_MIPSDSPR2_INLINE 0 -%define HAVE_MSA_INLINE 0 -%define HAVE_LOONGSON2_INLINE 0 -%define HAVE_LOONGSON3_INLINE 0 -%define HAVE_MMI_INLINE 0 -%define HAVE_ALIGNED_STACK 1 -%define HAVE_FAST_64BIT 1 -%define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 1 -%define HAVE_LOCAL_ALIGNED 1 -%define HAVE_SIMD_ALIGN_16 1 -%define HAVE_SIMD_ALIGN_32 1 -%define HAVE_SIMD_ALIGN_64 1 -%define HAVE_ATOMIC_CAS_PTR 0 -%define HAVE_MACHINE_RW_BARRIER 0 -%define HAVE_MEMORYBARRIER 1 -%define HAVE_MM_EMPTY 0 -%define HAVE_RDTSC 1 -%define HAVE_SEM_TIMEDWAIT 0 -%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0 -%define HAVE_CABS 0 -%define HAVE_CEXP 0 -%define HAVE_INLINE_ASM 0 -%define HAVE_SYMVER 0 -%define HAVE_X86ASM 1 -%define HAVE_BIGENDIAN 0 -%define HAVE_FAST_UNALIGNED 1 -%define HAVE_ARPA_INET_H 0 -%define HAVE_ASM_TYPES_H 0 -%define HAVE_CDIO_PARANOIA_H 0 -%define HAVE_CDIO_PARANOIA_PARANOIA_H 0 -%define HAVE_CUDA_H 0 -%define HAVE_DISPATCH_DISPATCH_H 0 -%define HAVE_DEV_BKTR_IOCTL_BT848_H 0 -%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0 -%define HAVE_DEV_IC_BT8XX_H 0 -%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0 -%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0 -%define HAVE_DIRECT_H 1 -%define HAVE_DIRENT_H 0 -%define HAVE_DXGIDEBUG_H 1 -%define HAVE_DXVA_H 1 -%define HAVE_ES2_GL_H 0 -%define HAVE_GSM_H 0 -%define HAVE_IO_H 1 -%define HAVE_LINUX_PERF_EVENT_H 0 -%define HAVE_MACHINE_IOCTL_BT848_H 0 -%define HAVE_MACHINE_IOCTL_METEOR_H 0 -%define HAVE_MALLOC_H 1 -%define HAVE_OPENCV2_CORE_CORE_C_H 0 -%define HAVE_OPENGL_GL3_H 0 -%define HAVE_POLL_H 0 -%define HAVE_SYS_PARAM_H 0 -%define HAVE_SYS_RESOURCE_H 0 -%define HAVE_SYS_SELECT_H 0 -%define HAVE_SYS_SOUNDCARD_H 0 -%define HAVE_SYS_TIME_H 0 -%define HAVE_SYS_UN_H 0 -%define HAVE_SYS_VIDEOIO_H 0 -%define HAVE_TERMIOS_H 0 -%define HAVE_UDPLITE_H 0 -%define HAVE_UNISTD_H 0 -%define HAVE_VALGRIND_VALGRIND_H 0 -%define HAVE_WINDOWS_H 1 -%define HAVE_WINSOCK2_H 0 -%define HAVE_INTRINSICS_NEON 0 -%define HAVE_ATANF 1 -%define HAVE_ATAN2F 1 -%define HAVE_CBRT 1 -%define HAVE_CBRTF 1 -%define HAVE_COPYSIGN 1 -%define HAVE_COSF 1 -%define HAVE_ERF 1 -%define HAVE_EXP2 1 -%define HAVE_EXP2F 1 -%define HAVE_EXPF 1 -%define HAVE_HYPOT 1 -%define HAVE_ISFINITE 1 -%define HAVE_ISINF 1 -%define HAVE_ISNAN 1 -%define HAVE_LDEXPF 1 -%define HAVE_LLRINT 1 -%define HAVE_LLRINTF 1 -%define HAVE_LOG2 1 -%define HAVE_LOG2F 1 -%define HAVE_LOG10F 1 -%define HAVE_LRINT 1 -%define HAVE_LRINTF 1 -%define HAVE_POWF 1 -%define HAVE_RINT 1 -%define HAVE_ROUND 1 -%define HAVE_ROUNDF 1 -%define HAVE_SINF 1 -%define HAVE_TRUNC 1 -%define HAVE_TRUNCF 1 -%define HAVE_DOS_PATHS 1 -%define HAVE_LIBC_MSVCRT 1 -%define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0 -%define HAVE_SECTION_DATA_REL_RO 0 -%define HAVE_THREADS 1 -%define HAVE_UWP 0 -%define HAVE_WINRT 0 -%define HAVE_ACCESS 1 -%define HAVE_ALIGNED_MALLOC 1 -%define HAVE_ARC4RANDOM 0 -%define HAVE_CLOCK_GETTIME 0 -%define HAVE_CLOSESOCKET 0 -%define HAVE_COMMANDLINETOARGVW 1 -%define HAVE_FCNTL 0 -%define HAVE_GETADDRINFO 0 -%define HAVE_GETHRTIME 0 -%define HAVE_GETOPT 0 -%define HAVE_GETPROCESSAFFINITYMASK 1 -%define HAVE_GETPROCESSMEMORYINFO 1 -%define HAVE_GETPROCESSTIMES 1 -%define HAVE_GETRUSAGE 0 -%define HAVE_GETSYSTEMTIMEASFILETIME 1 -%define HAVE_GETTIMEOFDAY 0 -%define HAVE_GLOB 0 -%define HAVE_GLXGETPROCADDRESS 0 -%define HAVE_GMTIME_R 0 -%define HAVE_INET_ATON 0 -%define HAVE_ISATTY 1 -%define HAVE_KBHIT 1 -%define HAVE_LOCALTIME_R 0 -%define HAVE_LSTAT 0 -%define HAVE_LZO1X_999_COMPRESS 0 -%define HAVE_MACH_ABSOLUTE_TIME 0 -%define HAVE_MAPVIEWOFFILE 1 -%define HAVE_MEMALIGN 0 -%define HAVE_MKSTEMP 0 -%define HAVE_MMAP 0 -%define HAVE_MPROTECT 0 -%define HAVE_NANOSLEEP 0 -%define HAVE_PEEKNAMEDPIPE 1 -%define HAVE_POSIX_MEMALIGN 0 -%define HAVE_PTHREAD_CANCEL 0 -%define HAVE_SCHED_GETAFFINITY 0 -%define HAVE_SECITEMIMPORT 0 -%define HAVE_SETCONSOLETEXTATTRIBUTE 1 -%define HAVE_SETCONSOLECTRLHANDLER 1 -%define HAVE_SETMODE 1 -%define HAVE_SETRLIMIT 0 -%define HAVE_SLEEP 1 -%define HAVE_STRERROR_R 0 -%define HAVE_SYSCONF 0 -%define HAVE_SYSCTL 0 -%define HAVE_USLEEP 0 -%define HAVE_UTGETOSTYPEFROMSTRING 0 -%define HAVE_VIRTUALALLOC 1 -%define HAVE_WGLGETPROCADDRESS 0 -%define HAVE_BCRYPT 1 -%define HAVE_VAAPI_DRM 0 -%define HAVE_VAAPI_X11 0 -%define HAVE_VDPAU_X11 0 -%define HAVE_PTHREADS 0 -%define HAVE_OS2THREADS 0 -%define HAVE_W32THREADS 1 -%define HAVE_AS_ARCH_DIRECTIVE 0 -%define HAVE_AS_DN_DIRECTIVE 0 -%define HAVE_AS_FPU_DIRECTIVE 0 -%define HAVE_AS_FUNC 0 -%define HAVE_AS_OBJECT_ARCH 0 -%define HAVE_ASM_MOD_Q 0 -%define HAVE_BLOCKS_EXTENSION 0 -%define HAVE_EBP_AVAILABLE 0 -%define HAVE_EBX_AVAILABLE 0 -%define HAVE_GNU_AS 0 -%define HAVE_GNU_WINDRES 0 -%define HAVE_IBM_ASM 0 -%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0 -%define HAVE_INLINE_ASM_LABELS 0 -%define HAVE_INLINE_ASM_NONLOCAL_LABELS 0 -%define HAVE_PRAGMA_DEPRECATED 1 -%define HAVE_RSYNC_CONTIMEOUT 0 -%define HAVE_SYMVER_ASM_LABEL 0 -%define HAVE_SYMVER_GNU_ASM 0 -%define HAVE_VFP_ARGS 0 -%define HAVE_XFORM_ASM 0 -%define HAVE_XMM_CLOBBERS 0 -%define HAVE_KCMVIDEOCODECTYPE_HEVC 0 -%define HAVE_SOCKLEN_T 0 -%define HAVE_STRUCT_ADDRINFO 0 -%define HAVE_STRUCT_GROUP_SOURCE_REQ 0 -%define HAVE_STRUCT_IP_MREQ_SOURCE 0 -%define HAVE_STRUCT_IPV6_MREQ 0 -%define HAVE_STRUCT_MSGHDR_MSG_FLAGS 0 -%define HAVE_STRUCT_POLLFD 0 -%define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0 -%define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0 -%define HAVE_STRUCT_SOCKADDR_IN6 0 -%define HAVE_STRUCT_SOCKADDR_SA_LEN 0 -%define HAVE_STRUCT_SOCKADDR_STORAGE 0 -%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0 -%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0 -%define HAVE_MAKEINFO 0 -%define HAVE_MAKEINFO_HTML 0 -%define HAVE_OPENCL_D3D11 0 -%define HAVE_OPENCL_DRM_ARM 0 -%define HAVE_OPENCL_DRM_BEIGNET 0 -%define HAVE_OPENCL_DXVA2 0 -%define HAVE_OPENCL_VAAPI_BEIGNET 0 -%define HAVE_OPENCL_VAAPI_INTEL_MEDIA 0 -%define HAVE_PERL 1 -%define HAVE_POD2MAN 0 -%define HAVE_TEXI2HTML 0 -%define CONFIG_DOC 0 -%define CONFIG_HTMLPAGES 0 -%define CONFIG_MANPAGES 0 -%define CONFIG_PODPAGES 1 -%define CONFIG_TXTPAGES 0 -%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1 -%define CONFIG_AVIO_READING_EXAMPLE 1 -%define CONFIG_DECODE_AUDIO_EXAMPLE 1 -%define CONFIG_DECODE_VIDEO_EXAMPLE 1 -%define CONFIG_DEMUXING_DECODING_EXAMPLE 1 -%define CONFIG_ENCODE_AUDIO_EXAMPLE 1 -%define CONFIG_ENCODE_VIDEO_EXAMPLE 1 -%define CONFIG_EXTRACT_MVS_EXAMPLE 1 -%define CONFIG_FILTER_AUDIO_EXAMPLE 0 -%define CONFIG_FILTERING_AUDIO_EXAMPLE 0 -%define CONFIG_FILTERING_VIDEO_EXAMPLE 0 -%define CONFIG_HTTP_MULTICLIENT_EXAMPLE 0 -%define CONFIG_HW_DECODE_EXAMPLE 1 -%define CONFIG_METADATA_EXAMPLE 1 -%define CONFIG_MUXING_EXAMPLE 1 -%define CONFIG_QSVDEC_EXAMPLE 0 -%define CONFIG_REMUXING_EXAMPLE 1 -%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 1 -%define CONFIG_SCALING_VIDEO_EXAMPLE 1 -%define CONFIG_TRANSCODE_AAC_EXAMPLE 1 -%define CONFIG_TRANSCODING_EXAMPLE 0 -%define CONFIG_VAAPI_ENCODE_EXAMPLE 0 -%define CONFIG_VAAPI_TRANSCODE_EXAMPLE 0 -%define CONFIG_AVISYNTH 0 -%define CONFIG_FREI0R 0 -%define CONFIG_LIBCDIO 0 -%define CONFIG_LIBDAVS2 0 -%define CONFIG_LIBRUBBERBAND 0 -%define CONFIG_LIBVIDSTAB 0 -%define CONFIG_LIBX264 0 -%define CONFIG_LIBX265 0 -%define CONFIG_LIBXAVS 0 -%define CONFIG_LIBXAVS2 0 -%define CONFIG_LIBXVID 0 -%define CONFIG_DECKLINK 0 -%define CONFIG_LIBNDI_NEWTEK 0 -%define CONFIG_LIBFDK_AAC 0 -%define CONFIG_OPENSSL 0 -%define CONFIG_LIBTLS 0 -%define CONFIG_GMP 0 -%define CONFIG_LIBLENSFUN 0 -%define CONFIG_LIBOPENCORE_AMRNB 0 -%define CONFIG_LIBOPENCORE_AMRWB 0 -%define CONFIG_LIBVMAF 0 -%define CONFIG_LIBVO_AMRWBENC 0 -%define CONFIG_MBEDTLS 0 -%define CONFIG_RKMPP 0 -%define CONFIG_LIBSMBCLIENT 0 -%define CONFIG_CHROMAPRINT 0 -%define CONFIG_GCRYPT 0 -%define CONFIG_GNUTLS 0 -%define CONFIG_JNI 0 -%define CONFIG_LADSPA 0 -%define CONFIG_LIBAOM 0 -%define CONFIG_LIBASS 0 -%define CONFIG_LIBBLURAY 0 -%define CONFIG_LIBBS2B 0 -%define CONFIG_LIBCACA 0 -%define CONFIG_LIBCELT 0 -%define CONFIG_LIBCODEC2 0 -%define CONFIG_LIBDAV1D 0 -%define CONFIG_LIBDC1394 0 -%define CONFIG_LIBDRM 0 -%define CONFIG_LIBFLITE 0 -%define CONFIG_LIBFONTCONFIG 0 -%define CONFIG_LIBFREETYPE 0 -%define CONFIG_LIBFRIBIDI 0 -%define CONFIG_LIBGME 0 -%define CONFIG_LIBGSM 0 -%define CONFIG_LIBIEC61883 0 -%define CONFIG_LIBILBC 0 -%define CONFIG_LIBJACK 0 -%define CONFIG_LIBKLVANC 0 -%define CONFIG_LIBKVAZAAR 0 -%define CONFIG_LIBMODPLUG 0 -%define CONFIG_LIBMP3LAME 0 -%define CONFIG_LIBMYSOFA 0 -%define CONFIG_LIBOPENCV 0 -%define CONFIG_LIBOPENH264 0 -%define CONFIG_LIBOPENJPEG 0 -%define CONFIG_LIBOPENMPT 0 -%define CONFIG_LIBOPUS 0 -%define CONFIG_LIBPULSE 0 -%define CONFIG_LIBRSVG 0 -%define CONFIG_LIBRTMP 0 -%define CONFIG_LIBSHINE 0 -%define CONFIG_LIBSMBCLIENT 0 -%define CONFIG_LIBSNAPPY 0 -%define CONFIG_LIBSOXR 0 -%define CONFIG_LIBSPEEX 0 -%define CONFIG_LIBSRT 0 -%define CONFIG_LIBSSH 0 -%define CONFIG_LIBTENSORFLOW 0 -%define CONFIG_LIBTESSERACT 0 -%define CONFIG_LIBTHEORA 0 -%define CONFIG_LIBTWOLAME 0 -%define CONFIG_LIBV4L2 0 -%define CONFIG_LIBVORBIS 0 -%define CONFIG_LIBVPX 0 -%define CONFIG_LIBWAVPACK 0 -%define CONFIG_LIBWEBP 0 -%define CONFIG_LIBXML2 0 -%define CONFIG_LIBZIMG 0 -%define CONFIG_LIBZMQ 0 -%define CONFIG_LIBZVBI 0 -%define CONFIG_LV2 0 -%define CONFIG_MEDIACODEC 0 -%define CONFIG_OPENAL 0 -%define CONFIG_OPENGL 0 -%define CONFIG_VAPOURSYNTH 0 -%define CONFIG_ALSA 0 -%define CONFIG_APPKIT 0 -%define CONFIG_AVFOUNDATION 0 -%define CONFIG_BZLIB 0 -%define CONFIG_COREIMAGE 0 -%define CONFIG_ICONV 0 -%define CONFIG_LIBXCB 0 -%define CONFIG_LIBXCB_SHM 0 -%define CONFIG_LIBXCB_SHAPE 0 -%define CONFIG_LIBXCB_XFIXES 0 -%define CONFIG_LZMA 0 -%define CONFIG_SCHANNEL 1 -%define CONFIG_SDL2 0 -%define CONFIG_SECURETRANSPORT 0 -%define CONFIG_SNDIO 0 -%define CONFIG_XLIB 0 -%define CONFIG_ZLIB 1 -%define CONFIG_CUDA_SDK 0 -%define CONFIG_LIBNPP 0 -%define CONFIG_LIBMFX 0 -%define CONFIG_MMAL 0 -%define CONFIG_OMX 0 -%define CONFIG_OPENCL 0 -%define CONFIG_AMF 0 -%define CONFIG_AUDIOTOOLBOX 0 -%define CONFIG_CRYSTALHD 0 -%define CONFIG_CUDA 0 -%define CONFIG_CUVID 0 -%define CONFIG_D3D11VA 0 -%define CONFIG_DXVA2 0 -%define CONFIG_FFNVCODEC 0 -%define CONFIG_NVDEC 0 -%define CONFIG_NVENC 0 -%define CONFIG_VAAPI 0 -%define CONFIG_VDPAU 0 -%define CONFIG_VIDEOTOOLBOX 0 -%define CONFIG_V4L2_M2M 0 -%define CONFIG_XVMC 0 -%define CONFIG_FTRAPV 0 -%define CONFIG_GRAY 0 -%define CONFIG_HARDCODED_TABLES 0 -%define CONFIG_OMX_RPI 0 -%define CONFIG_RUNTIME_CPUDETECT 1 -%define CONFIG_SAFE_BITSTREAM_READER 1 -%define CONFIG_SHARED 0 -%define CONFIG_SMALL 1 -%define CONFIG_STATIC 1 -%define CONFIG_SWSCALE_ALPHA 1 -%define CONFIG_GPL 1 -%define CONFIG_NONFREE 0 -%define CONFIG_VERSION3 0 -%define CONFIG_AVDEVICE 1 -%define CONFIG_AVFILTER 0 -%define CONFIG_SWSCALE 1 -%define CONFIG_POSTPROC 0 -%define CONFIG_AVFORMAT 1 -%define CONFIG_AVCODEC 1 -%define CONFIG_SWRESAMPLE 1 -%define CONFIG_AVRESAMPLE 0 -%define CONFIG_AVUTIL 1 -%define CONFIG_FFPLAY 0 -%define CONFIG_FFPROBE 0 -%define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 -%define CONFIG_DWT 1 -%define CONFIG_ERROR_RESILIENCE 1 -%define CONFIG_FAAN 1 -%define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 -%define CONFIG_LSP 1 -%define CONFIG_LZO 1 -%define CONFIG_MDCT 1 -%define CONFIG_PIXELUTILS 0 -%define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 -%define CONFIG_AUTODETECT 0 -%define CONFIG_FONTCONFIG 0 -%define CONFIG_LINUX_PERF 0 -%define CONFIG_MEMORY_POISONING 0 -%define CONFIG_NEON_CLOBBER_TEST 0 -%define CONFIG_OSSFUZZ 0 -%define CONFIG_PIC 0 -%define CONFIG_THUMB 0 -%define CONFIG_VALGRIND_BACKTRACE 0 -%define CONFIG_XMM_CLOBBER_TEST 0 -%define CONFIG_BSFS 1 -%define CONFIG_DECODERS 1 -%define CONFIG_ENCODERS 0 -%define CONFIG_HWACCELS 0 -%define CONFIG_PARSERS 1 -%define CONFIG_INDEVS 0 -%define CONFIG_OUTDEVS 0 -%define CONFIG_FILTERS 0 -%define CONFIG_DEMUXERS 1 -%define CONFIG_MUXERS 0 -%define CONFIG_PROTOCOLS 1 -%define CONFIG_AANDCTTABLES 1 -%define CONFIG_AC3DSP 1 -%define CONFIG_ADTS_HEADER 1 -%define CONFIG_AUDIO_FRAME_QUEUE 1 -%define CONFIG_AUDIODSP 1 -%define CONFIG_BLOCKDSP 1 -%define CONFIG_BSWAPDSP 1 -%define CONFIG_CABAC 1 -%define CONFIG_CBS 1 -%define CONFIG_CBS_AV1 1 -%define CONFIG_CBS_H264 1 -%define CONFIG_CBS_H265 1 -%define CONFIG_CBS_JPEG 0 -%define CONFIG_CBS_MPEG2 1 -%define CONFIG_CBS_VP9 1 -%define CONFIG_DIRAC_PARSE 1 -%define CONFIG_DNN 0 -%define CONFIG_DVPROFILE 1 -%define CONFIG_EXIF 1 -%define CONFIG_FAANDCT 1 -%define CONFIG_FAANIDCT 1 -%define CONFIG_FDCTDSP 1 -%define CONFIG_FLACDSP 1 -%define CONFIG_FMTCONVERT 1 -%define CONFIG_FRAME_THREAD_ENCODER 0 -%define CONFIG_G722DSP 1 -%define CONFIG_GOLOMB 1 -%define CONFIG_GPLV3 0 -%define CONFIG_H263DSP 1 -%define CONFIG_H264CHROMA 1 -%define CONFIG_H264DSP 1 -%define CONFIG_H264PARSE 1 -%define CONFIG_H264PRED 1 -%define CONFIG_H264QPEL 1 -%define CONFIG_HEVCPARSE 1 -%define CONFIG_HPELDSP 1 -%define CONFIG_HUFFMAN 1 -%define CONFIG_HUFFYUVDSP 1 -%define CONFIG_HUFFYUVENCDSP 0 -%define CONFIG_IDCTDSP 1 -%define CONFIG_IIRFILTER 0 -%define CONFIG_MDCT15 1 -%define CONFIG_INTRAX8 1 -%define CONFIG_ISO_MEDIA 1 -%define CONFIG_IVIDSP 0 -%define CONFIG_JPEGTABLES 1 -%define CONFIG_LGPLV3 0 -%define CONFIG_LIBX262 0 -%define CONFIG_LLAUDDSP 1 -%define CONFIG_LLVIDDSP 1 -%define CONFIG_LLVIDENCDSP 0 -%define CONFIG_LPC 0 -%define CONFIG_LZF 1 -%define CONFIG_ME_CMP 1 -%define CONFIG_MPEG_ER 1 -%define CONFIG_MPEGAUDIO 1 -%define CONFIG_MPEGAUDIODSP 1 -%define CONFIG_MPEGAUDIOHEADER 1 -%define CONFIG_MPEGVIDEO 1 -%define CONFIG_MPEGVIDEOENC 1 -%define CONFIG_MSS34DSP 1 -%define CONFIG_PIXBLOCKDSP 1 -%define CONFIG_QPELDSP 1 -%define CONFIG_QSV 0 -%define CONFIG_QSVDEC 0 -%define CONFIG_QSVENC 0 -%define CONFIG_QSVVPP 0 -%define CONFIG_RANGECODER 1 -%define CONFIG_RIFFDEC 1 -%define CONFIG_RIFFENC 0 -%define CONFIG_RTPDEC 0 -%define CONFIG_RTPENC_CHAIN 0 -%define CONFIG_RV34DSP 1 -%define CONFIG_SCENE_SAD 0 -%define CONFIG_SINEWIN 1 -%define CONFIG_SNAPPY 1 -%define CONFIG_SRTP 0 -%define CONFIG_STARTCODE 1 -%define CONFIG_TEXTUREDSP 1 -%define CONFIG_TEXTUREDSPENC 0 -%define CONFIG_TPELDSP 1 -%define CONFIG_VAAPI_1 0 -%define CONFIG_VAAPI_ENCODE 0 -%define CONFIG_VC1DSP 1 -%define CONFIG_VIDEODSP 1 -%define CONFIG_VP3DSP 1 -%define CONFIG_VP56DSP 1 -%define CONFIG_VP8DSP 1 -%define CONFIG_WMA_FREQS 1 -%define CONFIG_WMV2DSP 1 -%define CONFIG_AAC_ADTSTOASC_BSF 1 -%define CONFIG_AV1_METADATA_BSF 1 -%define CONFIG_CHOMP_BSF 1 -%define CONFIG_DUMP_EXTRADATA_BSF 1 -%define CONFIG_DCA_CORE_BSF 1 -%define CONFIG_EAC3_CORE_BSF 1 -%define CONFIG_EXTRACT_EXTRADATA_BSF 1 -%define CONFIG_FILTER_UNITS_BSF 1 -%define CONFIG_H264_METADATA_BSF 1 -%define CONFIG_H264_MP4TOANNEXB_BSF 1 -%define CONFIG_H264_REDUNDANT_PPS_BSF 1 -%define CONFIG_HAPQA_EXTRACT_BSF 1 -%define CONFIG_HEVC_METADATA_BSF 1 -%define CONFIG_HEVC_MP4TOANNEXB_BSF 1 -%define CONFIG_IMX_DUMP_HEADER_BSF 1 -%define CONFIG_MJPEG2JPEG_BSF 1 -%define CONFIG_MJPEGA_DUMP_HEADER_BSF 1 -%define CONFIG_MP3_HEADER_DECOMPRESS_BSF 1 -%define CONFIG_MPEG2_METADATA_BSF 1 -%define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 1 -%define CONFIG_MOV2TEXTSUB_BSF 1 -%define CONFIG_NOISE_BSF 1 -%define CONFIG_NULL_BSF 1 -%define CONFIG_PRORES_METADATA_BSF 1 -%define CONFIG_REMOVE_EXTRADATA_BSF 1 -%define CONFIG_TEXT2MOVSUB_BSF 1 -%define CONFIG_TRACE_HEADERS_BSF 1 -%define CONFIG_VP9_METADATA_BSF 1 -%define CONFIG_VP9_RAW_REORDER_BSF 1 -%define CONFIG_VP9_SUPERFRAME_BSF 1 -%define CONFIG_VP9_SUPERFRAME_SPLIT_BSF 1 -%define CONFIG_AASC_DECODER 1 -%define CONFIG_AIC_DECODER 1 -%define CONFIG_ALIAS_PIX_DECODER 1 -%define CONFIG_AMV_DECODER 1 -%define CONFIG_ANM_DECODER 1 -%define CONFIG_ANSI_DECODER 1 -%define CONFIG_APNG_DECODER 1 -%define CONFIG_ASV1_DECODER 1 -%define CONFIG_ASV2_DECODER 1 -%define CONFIG_AURA_DECODER 1 -%define CONFIG_AURA2_DECODER 1 -%define CONFIG_AVRP_DECODER 1 -%define CONFIG_AVRN_DECODER 1 -%define CONFIG_AVS_DECODER 1 -%define CONFIG_AVUI_DECODER 1 -%define CONFIG_AYUV_DECODER 1 -%define CONFIG_BETHSOFTVID_DECODER 1 -%define CONFIG_BFI_DECODER 1 -%define CONFIG_BINK_DECODER 1 -%define CONFIG_BITPACKED_DECODER 1 -%define CONFIG_BMP_DECODER 1 -%define CONFIG_BMV_VIDEO_DECODER 1 -%define CONFIG_BRENDER_PIX_DECODER 1 -%define CONFIG_C93_DECODER 1 -%define CONFIG_CAVS_DECODER 1 -%define CONFIG_CDGRAPHICS_DECODER 1 -%define CONFIG_CDXL_DECODER 1 -%define CONFIG_CFHD_DECODER 1 -%define CONFIG_CINEPAK_DECODER 1 -%define CONFIG_CLEARVIDEO_DECODER 1 -%define CONFIG_CLJR_DECODER 1 -%define CONFIG_CLLC_DECODER 1 -%define CONFIG_COMFORTNOISE_DECODER 1 -%define CONFIG_CPIA_DECODER 1 -%define CONFIG_CSCD_DECODER 1 -%define CONFIG_CYUV_DECODER 1 -%define CONFIG_DDS_DECODER 1 -%define CONFIG_DFA_DECODER 1 -%define CONFIG_DIRAC_DECODER 1 -%define CONFIG_DNXHD_DECODER 1 -%define CONFIG_DPX_DECODER 1 -%define CONFIG_DSICINVIDEO_DECODER 1 -%define CONFIG_DVAUDIO_DECODER 1 -%define CONFIG_DVVIDEO_DECODER 1 -%define CONFIG_DXA_DECODER 1 -%define CONFIG_DXTORY_DECODER 1 -%define CONFIG_DXV_DECODER 1 -%define CONFIG_EACMV_DECODER 1 -%define CONFIG_EAMAD_DECODER 1 -%define CONFIG_EATGQ_DECODER 1 -%define CONFIG_EATGV_DECODER 1 -%define CONFIG_EATQI_DECODER 1 -%define CONFIG_EIGHTBPS_DECODER 1 -%define CONFIG_EIGHTSVX_EXP_DECODER 1 -%define CONFIG_EIGHTSVX_FIB_DECODER 1 -%define CONFIG_ESCAPE124_DECODER 1 -%define CONFIG_ESCAPE130_DECODER 1 -%define CONFIG_EXR_DECODER 1 -%define CONFIG_FFV1_DECODER 1 -%define CONFIG_FFVHUFF_DECODER 1 -%define CONFIG_FIC_DECODER 1 -%define CONFIG_FITS_DECODER 1 -%define CONFIG_FLASHSV_DECODER 1 -%define CONFIG_FLASHSV2_DECODER 1 -%define CONFIG_FLIC_DECODER 1 -%define CONFIG_FLV_DECODER 1 -%define CONFIG_FMVC_DECODER 1 -%define CONFIG_FOURXM_DECODER 1 -%define CONFIG_FRAPS_DECODER 1 -%define CONFIG_FRWU_DECODER 1 -%define CONFIG_G2M_DECODER 1 -%define CONFIG_GDV_DECODER 1 -%define CONFIG_GIF_DECODER 1 -%define CONFIG_H261_DECODER 1 -%define CONFIG_H263_DECODER 1 -%define CONFIG_H263I_DECODER 1 -%define CONFIG_H263P_DECODER 1 -%define CONFIG_H263_V4L2M2M_DECODER 0 -%define CONFIG_H264_DECODER 1 -%define CONFIG_H264_CRYSTALHD_DECODER 0 -%define CONFIG_H264_V4L2M2M_DECODER 0 -%define CONFIG_H264_MEDIACODEC_DECODER 0 -%define CONFIG_H264_MMAL_DECODER 0 -%define CONFIG_H264_QSV_DECODER 0 -%define CONFIG_H264_RKMPP_DECODER 0 -%define CONFIG_HAP_DECODER 1 -%define CONFIG_HEVC_DECODER 1 -%define CONFIG_HEVC_QSV_DECODER 0 -%define CONFIG_HEVC_RKMPP_DECODER 0 -%define CONFIG_HEVC_V4L2M2M_DECODER 0 -%define CONFIG_HNM4_VIDEO_DECODER 1 -%define CONFIG_HQ_HQA_DECODER 1 -%define CONFIG_HQX_DECODER 1 -%define CONFIG_HUFFYUV_DECODER 1 -%define CONFIG_IDCIN_DECODER 1 -%define CONFIG_IFF_ILBM_DECODER 1 -%define CONFIG_IMM4_DECODER 1 -%define CONFIG_INDEO2_DECODER 0 -%define CONFIG_INDEO3_DECODER 0 -%define CONFIG_INDEO4_DECODER 0 -%define CONFIG_INDEO5_DECODER 0 -%define CONFIG_INTERPLAY_VIDEO_DECODER 1 -%define CONFIG_JPEG2000_DECODER 1 -%define CONFIG_JPEGLS_DECODER 1 -%define CONFIG_JV_DECODER 1 -%define CONFIG_KGV1_DECODER 1 -%define CONFIG_KMVC_DECODER 1 -%define CONFIG_LAGARITH_DECODER 1 -%define CONFIG_LOCO_DECODER 1 -%define CONFIG_M101_DECODER 1 -%define CONFIG_MAGICYUV_DECODER 1 -%define CONFIG_MDEC_DECODER 1 -%define CONFIG_MIMIC_DECODER 1 -%define CONFIG_MJPEG_DECODER 1 -%define CONFIG_MJPEGB_DECODER 1 -%define CONFIG_MMVIDEO_DECODER 1 -%define CONFIG_MOTIONPIXELS_DECODER 1 -%define CONFIG_MPEG1VIDEO_DECODER 1 -%define CONFIG_MPEG2VIDEO_DECODER 1 -%define CONFIG_MPEG4_DECODER 1 -%define CONFIG_MPEG4_CRYSTALHD_DECODER 0 -%define CONFIG_MPEG4_V4L2M2M_DECODER 0 -%define CONFIG_MPEG4_MMAL_DECODER 0 -%define CONFIG_MPEGVIDEO_DECODER 1 -%define CONFIG_MPEG1_V4L2M2M_DECODER 0 -%define CONFIG_MPEG2_MMAL_DECODER 0 -%define CONFIG_MPEG2_CRYSTALHD_DECODER 0 -%define CONFIG_MPEG2_V4L2M2M_DECODER 0 -%define CONFIG_MPEG2_QSV_DECODER 0 -%define CONFIG_MPEG2_MEDIACODEC_DECODER 0 -%define CONFIG_MSA1_DECODER 1 -%define CONFIG_MSCC_DECODER 1 -%define CONFIG_MSMPEG4V1_DECODER 1 -%define CONFIG_MSMPEG4V2_DECODER 1 -%define CONFIG_MSMPEG4V3_DECODER 1 -%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0 -%define CONFIG_MSRLE_DECODER 1 -%define CONFIG_MSS1_DECODER 1 -%define CONFIG_MSS2_DECODER 1 -%define CONFIG_MSVIDEO1_DECODER 1 -%define CONFIG_MSZH_DECODER 1 -%define CONFIG_MTS2_DECODER 1 -%define CONFIG_MVC1_DECODER 1 -%define CONFIG_MVC2_DECODER 1 -%define CONFIG_MWSC_DECODER 1 -%define CONFIG_MXPEG_DECODER 1 -%define CONFIG_NUV_DECODER 1 -%define CONFIG_PAF_VIDEO_DECODER 1 -%define CONFIG_PAM_DECODER 1 -%define CONFIG_PBM_DECODER 1 -%define CONFIG_PCX_DECODER 1 -%define CONFIG_PGM_DECODER 1 -%define CONFIG_PGMYUV_DECODER 1 -%define CONFIG_PICTOR_DECODER 1 -%define CONFIG_PIXLET_DECODER 1 -%define CONFIG_PNG_DECODER 1 -%define CONFIG_PPM_DECODER 1 -%define CONFIG_PRORES_DECODER 1 -%define CONFIG_PROSUMER_DECODER 1 -%define CONFIG_PSD_DECODER 1 -%define CONFIG_PTX_DECODER 1 -%define CONFIG_QDRAW_DECODER 1 -%define CONFIG_QPEG_DECODER 1 -%define CONFIG_QTRLE_DECODER 1 -%define CONFIG_R10K_DECODER 1 -%define CONFIG_R210_DECODER 1 -%define CONFIG_RASC_DECODER 1 -%define CONFIG_RAWVIDEO_DECODER 1 -%define CONFIG_RL2_DECODER 1 -%define CONFIG_ROQ_DECODER 1 -%define CONFIG_RPZA_DECODER 1 -%define CONFIG_RSCC_DECODER 1 -%define CONFIG_RV10_DECODER 1 -%define CONFIG_RV20_DECODER 1 -%define CONFIG_RV30_DECODER 1 -%define CONFIG_RV40_DECODER 1 -%define CONFIG_S302M_DECODER 1 -%define CONFIG_SANM_DECODER 1 -%define CONFIG_SCPR_DECODER 1 -%define CONFIG_SCREENPRESSO_DECODER 1 -%define CONFIG_SDX2_DPCM_DECODER 1 -%define CONFIG_SGI_DECODER 1 -%define CONFIG_SGIRLE_DECODER 1 -%define CONFIG_SHEERVIDEO_DECODER 1 -%define CONFIG_SMACKER_DECODER 1 -%define CONFIG_SMC_DECODER 1 -%define CONFIG_SMVJPEG_DECODER 1 -%define CONFIG_SNOW_DECODER 1 -%define CONFIG_SP5X_DECODER 1 -%define CONFIG_SPEEDHQ_DECODER 1 -%define CONFIG_SRGC_DECODER 1 -%define CONFIG_SUNRAST_DECODER 1 -%define CONFIG_SVQ1_DECODER 1 -%define CONFIG_SVQ3_DECODER 1 -%define CONFIG_TARGA_DECODER 1 -%define CONFIG_TARGA_Y216_DECODER 1 -%define CONFIG_TDSC_DECODER 1 -%define CONFIG_THEORA_DECODER 1 -%define CONFIG_THP_DECODER 1 -%define CONFIG_TIERTEXSEQVIDEO_DECODER 1 -%define CONFIG_TIFF_DECODER 1 -%define CONFIG_TMV_DECODER 1 -%define CONFIG_TRUEMOTION1_DECODER 1 -%define CONFIG_TRUEMOTION2_DECODER 1 -%define CONFIG_TRUEMOTION2RT_DECODER 1 -%define CONFIG_TSCC_DECODER 1 -%define CONFIG_TSCC2_DECODER 1 -%define CONFIG_TXD_DECODER 1 -%define CONFIG_ULTI_DECODER 1 -%define CONFIG_UTVIDEO_DECODER 1 -%define CONFIG_V210_DECODER 1 -%define CONFIG_V210X_DECODER 1 -%define CONFIG_V308_DECODER 1 -%define CONFIG_V408_DECODER 1 -%define CONFIG_V410_DECODER 1 -%define CONFIG_VB_DECODER 1 -%define CONFIG_VBLE_DECODER 1 -%define CONFIG_VC1_DECODER 1 -%define CONFIG_VC1_CRYSTALHD_DECODER 0 -%define CONFIG_VC1IMAGE_DECODER 1 -%define CONFIG_VC1_MMAL_DECODER 0 -%define CONFIG_VC1_QSV_DECODER 0 -%define CONFIG_VC1_V4L2M2M_DECODER 0 -%define CONFIG_VCR1_DECODER 1 -%define CONFIG_VMDVIDEO_DECODER 1 -%define CONFIG_VMNC_DECODER 1 -%define CONFIG_VP3_DECODER 1 -%define CONFIG_VP5_DECODER 1 -%define CONFIG_VP6_DECODER 1 -%define CONFIG_VP6A_DECODER 1 -%define CONFIG_VP6F_DECODER 1 -%define CONFIG_VP7_DECODER 1 -%define CONFIG_VP8_DECODER 1 -%define CONFIG_VP8_RKMPP_DECODER 0 -%define CONFIG_VP8_V4L2M2M_DECODER 0 -%define CONFIG_VP9_DECODER 1 -%define CONFIG_VP9_RKMPP_DECODER 0 -%define CONFIG_VP9_V4L2M2M_DECODER 0 -%define CONFIG_VQA_DECODER 1 -%define CONFIG_WEBP_DECODER 1 -%define CONFIG_WCMV_DECODER 1 -%define CONFIG_WRAPPED_AVFRAME_DECODER 1 -%define CONFIG_WMV1_DECODER 1 -%define CONFIG_WMV2_DECODER 1 -%define CONFIG_WMV3_DECODER 1 -%define CONFIG_WMV3_CRYSTALHD_DECODER 0 -%define CONFIG_WMV3IMAGE_DECODER 1 -%define CONFIG_WNV1_DECODER 1 -%define CONFIG_XAN_WC3_DECODER 1 -%define CONFIG_XAN_WC4_DECODER 1 -%define CONFIG_XBM_DECODER 1 -%define CONFIG_XFACE_DECODER 1 -%define CONFIG_XL_DECODER 1 -%define CONFIG_XPM_DECODER 1 -%define CONFIG_XWD_DECODER 1 -%define CONFIG_Y41P_DECODER 1 -%define CONFIG_YLC_DECODER 1 -%define CONFIG_YOP_DECODER 1 -%define CONFIG_YUV4_DECODER 1 -%define CONFIG_ZERO12V_DECODER 1 -%define CONFIG_ZEROCODEC_DECODER 1 -%define CONFIG_ZLIB_DECODER 1 -%define CONFIG_ZMBV_DECODER 1 -%define CONFIG_AAC_DECODER 1 -%define CONFIG_AAC_FIXED_DECODER 1 -%define CONFIG_AAC_LATM_DECODER 1 -%define CONFIG_AC3_DECODER 1 -%define CONFIG_AC3_FIXED_DECODER 1 -%define CONFIG_ALAC_DECODER 1 -%define CONFIG_ALS_DECODER 1 -%define CONFIG_AMRNB_DECODER 1 -%define CONFIG_AMRWB_DECODER 1 -%define CONFIG_APE_DECODER 1 -%define CONFIG_APTX_DECODER 1 -%define CONFIG_APTX_HD_DECODER 1 -%define CONFIG_ATRAC1_DECODER 1 -%define CONFIG_ATRAC3_DECODER 1 -%define CONFIG_ATRAC3AL_DECODER 1 -%define CONFIG_ATRAC3P_DECODER 0 -%define CONFIG_ATRAC3PAL_DECODER 1 -%define CONFIG_ATRAC9_DECODER 1 -%define CONFIG_BINKAUDIO_DCT_DECODER 1 -%define CONFIG_BINKAUDIO_RDFT_DECODER 1 -%define CONFIG_BMV_AUDIO_DECODER 1 -%define CONFIG_COOK_DECODER 1 -%define CONFIG_DCA_DECODER 1 -%define CONFIG_DOLBY_E_DECODER 1 -%define CONFIG_DSD_LSBF_DECODER 1 -%define CONFIG_DSD_MSBF_DECODER 1 -%define CONFIG_DSD_LSBF_PLANAR_DECODER 1 -%define CONFIG_DSD_MSBF_PLANAR_DECODER 1 -%define CONFIG_DSICINAUDIO_DECODER 1 -%define CONFIG_DSS_SP_DECODER 1 -%define CONFIG_DST_DECODER 1 -%define CONFIG_EAC3_DECODER 1 -%define CONFIG_EVRC_DECODER 1 -%define CONFIG_FFWAVESYNTH_DECODER 1 -%define CONFIG_FLAC_DECODER 1 -%define CONFIG_G723_1_DECODER 1 -%define CONFIG_G729_DECODER 1 -%define CONFIG_GSM_DECODER 1 -%define CONFIG_GSM_MS_DECODER 1 -%define CONFIG_IAC_DECODER 1 -%define CONFIG_ILBC_DECODER 1 -%define CONFIG_IMC_DECODER 1 -%define CONFIG_INTERPLAY_ACM_DECODER 1 -%define CONFIG_MACE3_DECODER 1 -%define CONFIG_MACE6_DECODER 1 -%define CONFIG_METASOUND_DECODER 1 -%define CONFIG_MLP_DECODER 1 -%define CONFIG_MP1_DECODER 1 -%define CONFIG_MP1FLOAT_DECODER 1 -%define CONFIG_MP2_DECODER 1 -%define CONFIG_MP2FLOAT_DECODER 1 -%define CONFIG_MP3FLOAT_DECODER 1 -%define CONFIG_MP3_DECODER 1 -%define CONFIG_MP3ADUFLOAT_DECODER 1 -%define CONFIG_MP3ADU_DECODER 1 -%define CONFIG_MP3ON4FLOAT_DECODER 1 -%define CONFIG_MP3ON4_DECODER 1 -%define CONFIG_MPC7_DECODER 1 -%define CONFIG_MPC8_DECODER 1 -%define CONFIG_NELLYMOSER_DECODER 1 -%define CONFIG_ON2AVC_DECODER 1 -%define CONFIG_OPUS_DECODER 1 -%define CONFIG_PAF_AUDIO_DECODER 1 -%define CONFIG_QCELP_DECODER 1 -%define CONFIG_QDM2_DECODER 1 -%define CONFIG_QDMC_DECODER 1 -%define CONFIG_RA_144_DECODER 1 -%define CONFIG_RA_288_DECODER 1 -%define CONFIG_RALF_DECODER 1 -%define CONFIG_SBC_DECODER 1 -%define CONFIG_SHORTEN_DECODER 1 -%define CONFIG_SIPR_DECODER 1 -%define CONFIG_SMACKAUD_DECODER 1 -%define CONFIG_SONIC_DECODER 1 -%define CONFIG_TAK_DECODER 1 -%define CONFIG_TRUEHD_DECODER 1 -%define CONFIG_TRUESPEECH_DECODER 1 -%define CONFIG_TTA_DECODER 1 -%define CONFIG_TWINVQ_DECODER 0 -%define CONFIG_VMDAUDIO_DECODER 1 -%define CONFIG_VORBIS_DECODER 1 -%define CONFIG_WAVPACK_DECODER 1 -%define CONFIG_WMALOSSLESS_DECODER 1 -%define CONFIG_WMAPRO_DECODER 1 -%define CONFIG_WMAV1_DECODER 1 -%define CONFIG_WMAV2_DECODER 1 -%define CONFIG_WMAVOICE_DECODER 1 -%define CONFIG_WS_SND1_DECODER 1 -%define CONFIG_XMA1_DECODER 1 -%define CONFIG_XMA2_DECODER 1 -%define CONFIG_PCM_ALAW_DECODER 1 -%define CONFIG_PCM_BLURAY_DECODER 1 -%define CONFIG_PCM_DVD_DECODER 1 -%define CONFIG_PCM_F16LE_DECODER 1 -%define CONFIG_PCM_F24LE_DECODER 1 -%define CONFIG_PCM_F32BE_DECODER 1 -%define CONFIG_PCM_F32LE_DECODER 1 -%define CONFIG_PCM_F64BE_DECODER 1 -%define CONFIG_PCM_F64LE_DECODER 1 -%define CONFIG_PCM_LXF_DECODER 1 -%define CONFIG_PCM_MULAW_DECODER 1 -%define CONFIG_PCM_S8_DECODER 1 -%define CONFIG_PCM_S8_PLANAR_DECODER 1 -%define CONFIG_PCM_S16BE_DECODER 1 -%define CONFIG_PCM_S16BE_PLANAR_DECODER 1 -%define CONFIG_PCM_S16LE_DECODER 1 -%define CONFIG_PCM_S16LE_PLANAR_DECODER 1 -%define CONFIG_PCM_S24BE_DECODER 1 -%define CONFIG_PCM_S24DAUD_DECODER 1 -%define CONFIG_PCM_S24LE_DECODER 1 -%define CONFIG_PCM_S24LE_PLANAR_DECODER 1 -%define CONFIG_PCM_S32BE_DECODER 1 -%define CONFIG_PCM_S32LE_DECODER 1 -%define CONFIG_PCM_S32LE_PLANAR_DECODER 1 -%define CONFIG_PCM_S64BE_DECODER 1 -%define CONFIG_PCM_S64LE_DECODER 1 -%define CONFIG_PCM_U8_DECODER 1 -%define CONFIG_PCM_U16BE_DECODER 1 -%define CONFIG_PCM_U16LE_DECODER 1 -%define CONFIG_PCM_U24BE_DECODER 1 -%define CONFIG_PCM_U24LE_DECODER 1 -%define CONFIG_PCM_U32BE_DECODER 1 -%define CONFIG_PCM_U32LE_DECODER 1 -%define CONFIG_PCM_VIDC_DECODER 1 -%define CONFIG_PCM_ZORK_DECODER 1 -%define CONFIG_GREMLIN_DPCM_DECODER 1 -%define CONFIG_INTERPLAY_DPCM_DECODER 1 -%define CONFIG_ROQ_DPCM_DECODER 1 -%define CONFIG_SOL_DPCM_DECODER 1 -%define CONFIG_XAN_DPCM_DECODER 1 -%define CONFIG_ADPCM_4XM_DECODER 1 -%define CONFIG_ADPCM_ADX_DECODER 1 -%define CONFIG_ADPCM_AFC_DECODER 1 -%define CONFIG_ADPCM_AICA_DECODER 1 -%define CONFIG_ADPCM_CT_DECODER 1 -%define CONFIG_ADPCM_DTK_DECODER 1 -%define CONFIG_ADPCM_EA_DECODER 1 -%define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 1 -%define CONFIG_ADPCM_EA_R1_DECODER 1 -%define CONFIG_ADPCM_EA_R2_DECODER 1 -%define CONFIG_ADPCM_EA_R3_DECODER 1 -%define CONFIG_ADPCM_EA_XAS_DECODER 1 -%define CONFIG_ADPCM_G722_DECODER 1 -%define CONFIG_ADPCM_G726_DECODER 1 -%define CONFIG_ADPCM_G726LE_DECODER 1 -%define CONFIG_ADPCM_IMA_AMV_DECODER 1 -%define CONFIG_ADPCM_IMA_APC_DECODER 1 -%define CONFIG_ADPCM_IMA_DAT4_DECODER 1 -%define CONFIG_ADPCM_IMA_DK3_DECODER 1 -%define CONFIG_ADPCM_IMA_DK4_DECODER 1 -%define CONFIG_ADPCM_IMA_EA_EACS_DECODER 1 -%define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 1 -%define CONFIG_ADPCM_IMA_ISS_DECODER 1 -%define CONFIG_ADPCM_IMA_OKI_DECODER 1 -%define CONFIG_ADPCM_IMA_QT_DECODER 1 -%define CONFIG_ADPCM_IMA_RAD_DECODER 1 -%define CONFIG_ADPCM_IMA_SMJPEG_DECODER 1 -%define CONFIG_ADPCM_IMA_WAV_DECODER 1 -%define CONFIG_ADPCM_IMA_WS_DECODER 1 -%define CONFIG_ADPCM_MS_DECODER 1 -%define CONFIG_ADPCM_MTAF_DECODER 1 -%define CONFIG_ADPCM_PSX_DECODER 1 -%define CONFIG_ADPCM_SBPRO_2_DECODER 1 -%define CONFIG_ADPCM_SBPRO_3_DECODER 1 -%define CONFIG_ADPCM_SBPRO_4_DECODER 1 -%define CONFIG_ADPCM_SWF_DECODER 1 -%define CONFIG_ADPCM_THP_DECODER 1 -%define CONFIG_ADPCM_THP_LE_DECODER 1 -%define CONFIG_ADPCM_VIMA_DECODER 1 -%define CONFIG_ADPCM_XA_DECODER 1 -%define CONFIG_ADPCM_YAMAHA_DECODER 1 -%define CONFIG_SSA_DECODER 1 -%define CONFIG_ASS_DECODER 1 -%define CONFIG_CCAPTION_DECODER 1 -%define CONFIG_DVBSUB_DECODER 1 -%define CONFIG_DVDSUB_DECODER 1 -%define CONFIG_JACOSUB_DECODER 1 -%define CONFIG_MICRODVD_DECODER 1 -%define CONFIG_MOVTEXT_DECODER 1 -%define CONFIG_MPL2_DECODER 1 -%define CONFIG_PGSSUB_DECODER 1 -%define CONFIG_PJS_DECODER 1 -%define CONFIG_REALTEXT_DECODER 1 -%define CONFIG_SAMI_DECODER 1 -%define CONFIG_SRT_DECODER 1 -%define CONFIG_STL_DECODER 1 -%define CONFIG_SUBRIP_DECODER 1 -%define CONFIG_SUBVIEWER_DECODER 1 -%define CONFIG_SUBVIEWER1_DECODER 1 -%define CONFIG_TEXT_DECODER 1 -%define CONFIG_VPLAYER_DECODER 1 -%define CONFIG_WEBVTT_DECODER 1 -%define CONFIG_XSUB_DECODER 1 -%define CONFIG_AAC_AT_DECODER 0 -%define CONFIG_AC3_AT_DECODER 0 -%define CONFIG_ADPCM_IMA_QT_AT_DECODER 0 -%define CONFIG_ALAC_AT_DECODER 0 -%define CONFIG_AMR_NB_AT_DECODER 0 -%define CONFIG_EAC3_AT_DECODER 0 -%define CONFIG_GSM_MS_AT_DECODER 0 -%define CONFIG_ILBC_AT_DECODER 0 -%define CONFIG_MP1_AT_DECODER 0 -%define CONFIG_MP2_AT_DECODER 0 -%define CONFIG_MP3_AT_DECODER 0 -%define CONFIG_PCM_ALAW_AT_DECODER 0 -%define CONFIG_PCM_MULAW_AT_DECODER 0 -%define CONFIG_QDMC_AT_DECODER 0 -%define CONFIG_QDM2_AT_DECODER 0 -%define CONFIG_LIBAOM_AV1_DECODER 0 -%define CONFIG_LIBCELT_DECODER 0 -%define CONFIG_LIBCODEC2_DECODER 0 -%define CONFIG_LIBDAV1D_DECODER 0 -%define CONFIG_LIBDAVS2_DECODER 0 -%define CONFIG_LIBFDK_AAC_DECODER 0 -%define CONFIG_LIBGSM_DECODER 0 -%define CONFIG_LIBGSM_MS_DECODER 0 -%define CONFIG_LIBILBC_DECODER 0 -%define CONFIG_LIBOPENCORE_AMRNB_DECODER 0 -%define CONFIG_LIBOPENCORE_AMRWB_DECODER 0 -%define CONFIG_LIBOPENJPEG_DECODER 0 -%define CONFIG_LIBOPUS_DECODER 0 -%define CONFIG_LIBRSVG_DECODER 0 -%define CONFIG_LIBSPEEX_DECODER 0 -%define CONFIG_LIBVORBIS_DECODER 0 -%define CONFIG_LIBVPX_VP8_DECODER 0 -%define CONFIG_LIBVPX_VP9_DECODER 0 -%define CONFIG_LIBZVBI_TELETEXT_DECODER 0 -%define CONFIG_BINTEXT_DECODER 1 -%define CONFIG_XBIN_DECODER 1 -%define CONFIG_IDF_DECODER 1 -%define CONFIG_LIBOPENH264_DECODER 0 -%define CONFIG_H264_CUVID_DECODER 0 -%define CONFIG_HEVC_CUVID_DECODER 0 -%define CONFIG_HEVC_MEDIACODEC_DECODER 0 -%define CONFIG_MJPEG_CUVID_DECODER 0 -%define CONFIG_MPEG1_CUVID_DECODER 0 -%define CONFIG_MPEG2_CUVID_DECODER 0 -%define CONFIG_MPEG4_CUVID_DECODER 0 -%define CONFIG_MPEG4_MEDIACODEC_DECODER 0 -%define CONFIG_VC1_CUVID_DECODER 0 -%define CONFIG_VP8_CUVID_DECODER 0 -%define CONFIG_VP8_MEDIACODEC_DECODER 0 -%define CONFIG_VP8_QSV_DECODER 0 -%define CONFIG_VP9_CUVID_DECODER 0 -%define CONFIG_VP9_MEDIACODEC_DECODER 0 -%define CONFIG_A64MULTI_ENCODER 0 -%define CONFIG_A64MULTI5_ENCODER 0 -%define CONFIG_ALIAS_PIX_ENCODER 0 -%define CONFIG_AMV_ENCODER 0 -%define CONFIG_APNG_ENCODER 0 -%define CONFIG_ASV1_ENCODER 0 -%define CONFIG_ASV2_ENCODER 0 -%define CONFIG_AVRP_ENCODER 0 -%define CONFIG_AVUI_ENCODER 0 -%define CONFIG_AYUV_ENCODER 0 -%define CONFIG_BMP_ENCODER 0 -%define CONFIG_CINEPAK_ENCODER 0 -%define CONFIG_CLJR_ENCODER 0 -%define CONFIG_COMFORTNOISE_ENCODER 0 -%define CONFIG_DNXHD_ENCODER 0 -%define CONFIG_DPX_ENCODER 0 -%define CONFIG_DVVIDEO_ENCODER 0 -%define CONFIG_FFV1_ENCODER 0 -%define CONFIG_FFVHUFF_ENCODER 0 -%define CONFIG_FITS_ENCODER 0 -%define CONFIG_FLASHSV_ENCODER 0 -%define CONFIG_FLASHSV2_ENCODER 0 -%define CONFIG_FLV_ENCODER 0 -%define CONFIG_GIF_ENCODER 0 -%define CONFIG_H261_ENCODER 0 -%define CONFIG_H263_ENCODER 0 -%define CONFIG_H263P_ENCODER 0 -%define CONFIG_HAP_ENCODER 0 -%define CONFIG_HUFFYUV_ENCODER 0 -%define CONFIG_JPEG2000_ENCODER 0 -%define CONFIG_JPEGLS_ENCODER 0 -%define CONFIG_LJPEG_ENCODER 0 -%define CONFIG_MAGICYUV_ENCODER 0 -%define CONFIG_MJPEG_ENCODER 0 -%define CONFIG_MPEG1VIDEO_ENCODER 0 -%define CONFIG_MPEG2VIDEO_ENCODER 0 -%define CONFIG_MPEG4_ENCODER 0 -%define CONFIG_MSMPEG4V2_ENCODER 0 -%define CONFIG_MSMPEG4V3_ENCODER 0 -%define CONFIG_MSVIDEO1_ENCODER 0 -%define CONFIG_PAM_ENCODER 0 -%define CONFIG_PBM_ENCODER 0 -%define CONFIG_PCX_ENCODER 0 -%define CONFIG_PGM_ENCODER 0 -%define CONFIG_PGMYUV_ENCODER 0 -%define CONFIG_PNG_ENCODER 0 -%define CONFIG_PPM_ENCODER 0 -%define CONFIG_PRORES_ENCODER 0 -%define CONFIG_PRORES_AW_ENCODER 0 -%define CONFIG_PRORES_KS_ENCODER 0 -%define CONFIG_QTRLE_ENCODER 0 -%define CONFIG_R10K_ENCODER 0 -%define CONFIG_R210_ENCODER 0 -%define CONFIG_RAWVIDEO_ENCODER 0 -%define CONFIG_ROQ_ENCODER 0 -%define CONFIG_RV10_ENCODER 0 -%define CONFIG_RV20_ENCODER 0 -%define CONFIG_S302M_ENCODER 0 -%define CONFIG_SGI_ENCODER 0 -%define CONFIG_SNOW_ENCODER 0 -%define CONFIG_SUNRAST_ENCODER 0 -%define CONFIG_SVQ1_ENCODER 0 -%define CONFIG_TARGA_ENCODER 0 -%define CONFIG_TIFF_ENCODER 0 -%define CONFIG_UTVIDEO_ENCODER 0 -%define CONFIG_V210_ENCODER 0 -%define CONFIG_V308_ENCODER 0 -%define CONFIG_V408_ENCODER 0 -%define CONFIG_V410_ENCODER 0 -%define CONFIG_VC2_ENCODER 0 -%define CONFIG_WRAPPED_AVFRAME_ENCODER 0 -%define CONFIG_WMV1_ENCODER 0 -%define CONFIG_WMV2_ENCODER 0 -%define CONFIG_XBM_ENCODER 0 -%define CONFIG_XFACE_ENCODER 0 -%define CONFIG_XWD_ENCODER 0 -%define CONFIG_Y41P_ENCODER 0 -%define CONFIG_YUV4_ENCODER 0 -%define CONFIG_ZLIB_ENCODER 0 -%define CONFIG_ZMBV_ENCODER 0 -%define CONFIG_AAC_ENCODER 0 -%define CONFIG_AC3_ENCODER 0 -%define CONFIG_AC3_FIXED_ENCODER 0 -%define CONFIG_ALAC_ENCODER 0 -%define CONFIG_APTX_ENCODER 0 -%define CONFIG_APTX_HD_ENCODER 0 -%define CONFIG_DCA_ENCODER 0 -%define CONFIG_EAC3_ENCODER 0 -%define CONFIG_FLAC_ENCODER 0 -%define CONFIG_G723_1_ENCODER 0 -%define CONFIG_MLP_ENCODER 0 -%define CONFIG_MP2_ENCODER 0 -%define CONFIG_MP2FIXED_ENCODER 0 -%define CONFIG_NELLYMOSER_ENCODER 0 -%define CONFIG_OPUS_ENCODER 0 -%define CONFIG_RA_144_ENCODER 0 -%define CONFIG_SBC_ENCODER 0 -%define CONFIG_SONIC_ENCODER 0 -%define CONFIG_SONIC_LS_ENCODER 0 -%define CONFIG_TRUEHD_ENCODER 0 -%define CONFIG_TTA_ENCODER 0 -%define CONFIG_VORBIS_ENCODER 0 -%define CONFIG_WAVPACK_ENCODER 0 -%define CONFIG_WMAV1_ENCODER 0 -%define CONFIG_WMAV2_ENCODER 0 -%define CONFIG_PCM_ALAW_ENCODER 0 -%define CONFIG_PCM_F32BE_ENCODER 0 -%define CONFIG_PCM_F32LE_ENCODER 0 -%define CONFIG_PCM_F64BE_ENCODER 0 -%define CONFIG_PCM_F64LE_ENCODER 0 -%define CONFIG_PCM_MULAW_ENCODER 0 -%define CONFIG_PCM_S8_ENCODER 0 -%define CONFIG_PCM_S8_PLANAR_ENCODER 0 -%define CONFIG_PCM_S16BE_ENCODER 0 -%define CONFIG_PCM_S16BE_PLANAR_ENCODER 0 -%define CONFIG_PCM_S16LE_ENCODER 0 -%define CONFIG_PCM_S16LE_PLANAR_ENCODER 0 -%define CONFIG_PCM_S24BE_ENCODER 0 -%define CONFIG_PCM_S24DAUD_ENCODER 0 -%define CONFIG_PCM_S24LE_ENCODER 0 -%define CONFIG_PCM_S24LE_PLANAR_ENCODER 0 -%define CONFIG_PCM_S32BE_ENCODER 0 -%define CONFIG_PCM_S32LE_ENCODER 0 -%define CONFIG_PCM_S32LE_PLANAR_ENCODER 0 -%define CONFIG_PCM_S64BE_ENCODER 0 -%define CONFIG_PCM_S64LE_ENCODER 0 -%define CONFIG_PCM_U8_ENCODER 0 -%define CONFIG_PCM_U16BE_ENCODER 0 -%define CONFIG_PCM_U16LE_ENCODER 0 -%define CONFIG_PCM_U24BE_ENCODER 0 -%define CONFIG_PCM_U24LE_ENCODER 0 -%define CONFIG_PCM_U32BE_ENCODER 0 -%define CONFIG_PCM_U32LE_ENCODER 0 -%define CONFIG_PCM_VIDC_ENCODER 0 -%define CONFIG_ROQ_DPCM_ENCODER 0 -%define CONFIG_ADPCM_ADX_ENCODER 0 -%define CONFIG_ADPCM_G722_ENCODER 0 -%define CONFIG_ADPCM_G726_ENCODER 0 -%define CONFIG_ADPCM_G726LE_ENCODER 0 -%define CONFIG_ADPCM_IMA_QT_ENCODER 0 -%define CONFIG_ADPCM_IMA_WAV_ENCODER 0 -%define CONFIG_ADPCM_MS_ENCODER 0 -%define CONFIG_ADPCM_SWF_ENCODER 0 -%define CONFIG_ADPCM_YAMAHA_ENCODER 0 -%define CONFIG_SSA_ENCODER 0 -%define CONFIG_ASS_ENCODER 0 -%define CONFIG_DVBSUB_ENCODER 0 -%define CONFIG_DVDSUB_ENCODER 0 -%define CONFIG_MOVTEXT_ENCODER 0 -%define CONFIG_SRT_ENCODER 0 -%define CONFIG_SUBRIP_ENCODER 0 -%define CONFIG_TEXT_ENCODER 0 -%define CONFIG_WEBVTT_ENCODER 0 -%define CONFIG_XSUB_ENCODER 0 -%define CONFIG_AAC_AT_ENCODER 0 -%define CONFIG_ALAC_AT_ENCODER 0 -%define CONFIG_ILBC_AT_ENCODER 0 -%define CONFIG_PCM_ALAW_AT_ENCODER 0 -%define CONFIG_PCM_MULAW_AT_ENCODER 0 -%define CONFIG_LIBAOM_AV1_ENCODER 0 -%define CONFIG_LIBCODEC2_ENCODER 0 -%define CONFIG_LIBFDK_AAC_ENCODER 0 -%define CONFIG_LIBGSM_ENCODER 0 -%define CONFIG_LIBGSM_MS_ENCODER 0 -%define CONFIG_LIBILBC_ENCODER 0 -%define CONFIG_LIBMP3LAME_ENCODER 0 -%define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0 -%define CONFIG_LIBOPENJPEG_ENCODER 0 -%define CONFIG_LIBOPUS_ENCODER 0 -%define CONFIG_LIBSHINE_ENCODER 0 -%define CONFIG_LIBSPEEX_ENCODER 0 -%define CONFIG_LIBTHEORA_ENCODER 0 -%define CONFIG_LIBTWOLAME_ENCODER 0 -%define CONFIG_LIBVO_AMRWBENC_ENCODER 0 -%define CONFIG_LIBVORBIS_ENCODER 0 -%define CONFIG_LIBVPX_VP8_ENCODER 0 -%define CONFIG_LIBVPX_VP9_ENCODER 0 -%define CONFIG_LIBWAVPACK_ENCODER 0 -%define CONFIG_LIBWEBP_ANIM_ENCODER 0 -%define CONFIG_LIBWEBP_ENCODER 0 -%define CONFIG_LIBX262_ENCODER 0 -%define CONFIG_LIBX264_ENCODER 0 -%define CONFIG_LIBX264RGB_ENCODER 0 -%define CONFIG_LIBX265_ENCODER 0 -%define CONFIG_LIBXAVS_ENCODER 0 -%define CONFIG_LIBXAVS2_ENCODER 0 -%define CONFIG_LIBXVID_ENCODER 0 -%define CONFIG_H263_V4L2M2M_ENCODER 0 -%define CONFIG_LIBOPENH264_ENCODER 0 -%define CONFIG_H264_AMF_ENCODER 0 -%define CONFIG_H264_NVENC_ENCODER 0 -%define CONFIG_H264_OMX_ENCODER 0 -%define CONFIG_H264_QSV_ENCODER 0 -%define CONFIG_H264_V4L2M2M_ENCODER 0 -%define CONFIG_H264_VAAPI_ENCODER 0 -%define CONFIG_H264_VIDEOTOOLBOX_ENCODER 0 -%define CONFIG_NVENC_ENCODER 0 -%define CONFIG_NVENC_H264_ENCODER 0 -%define CONFIG_NVENC_HEVC_ENCODER 0 -%define CONFIG_HEVC_AMF_ENCODER 0 -%define CONFIG_HEVC_NVENC_ENCODER 0 -%define CONFIG_HEVC_QSV_ENCODER 0 -%define CONFIG_HEVC_V4L2M2M_ENCODER 0 -%define CONFIG_HEVC_VAAPI_ENCODER 0 -%define CONFIG_HEVC_VIDEOTOOLBOX_ENCODER 0 -%define CONFIG_LIBKVAZAAR_ENCODER 0 -%define CONFIG_MJPEG_QSV_ENCODER 0 -%define CONFIG_MJPEG_VAAPI_ENCODER 0 -%define CONFIG_MPEG2_QSV_ENCODER 0 -%define CONFIG_MPEG2_VAAPI_ENCODER 0 -%define CONFIG_MPEG4_V4L2M2M_ENCODER 0 -%define CONFIG_VP8_V4L2M2M_ENCODER 0 -%define CONFIG_VP8_VAAPI_ENCODER 0 -%define CONFIG_VP9_VAAPI_ENCODER 0 -%define CONFIG_H263_VAAPI_HWACCEL 0 -%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0 -%define CONFIG_H264_D3D11VA_HWACCEL 0 -%define CONFIG_H264_D3D11VA2_HWACCEL 0 -%define CONFIG_H264_DXVA2_HWACCEL 0 -%define CONFIG_H264_NVDEC_HWACCEL 0 -%define CONFIG_H264_VAAPI_HWACCEL 0 -%define CONFIG_H264_VDPAU_HWACCEL 0 -%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0 -%define CONFIG_HEVC_D3D11VA_HWACCEL 0 -%define CONFIG_HEVC_D3D11VA2_HWACCEL 0 -%define CONFIG_HEVC_DXVA2_HWACCEL 0 -%define CONFIG_HEVC_NVDEC_HWACCEL 0 -%define CONFIG_HEVC_VAAPI_HWACCEL 0 -%define CONFIG_HEVC_VDPAU_HWACCEL 0 -%define CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL 0 -%define CONFIG_MJPEG_NVDEC_HWACCEL 0 -%define CONFIG_MJPEG_VAAPI_HWACCEL 0 -%define CONFIG_MPEG1_NVDEC_HWACCEL 0 -%define CONFIG_MPEG1_VDPAU_HWACCEL 0 -%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 -%define CONFIG_MPEG1_XVMC_HWACCEL 0 -%define CONFIG_MPEG2_D3D11VA_HWACCEL 0 -%define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -%define CONFIG_MPEG2_NVDEC_HWACCEL 0 -%define CONFIG_MPEG2_DXVA2_HWACCEL 0 -%define CONFIG_MPEG2_VAAPI_HWACCEL 0 -%define CONFIG_MPEG2_VDPAU_HWACCEL 0 -%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 -%define CONFIG_MPEG2_XVMC_HWACCEL 0 -%define CONFIG_MPEG4_NVDEC_HWACCEL 0 -%define CONFIG_MPEG4_VAAPI_HWACCEL 0 -%define CONFIG_MPEG4_VDPAU_HWACCEL 0 -%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0 -%define CONFIG_VC1_D3D11VA_HWACCEL 0 -%define CONFIG_VC1_D3D11VA2_HWACCEL 0 -%define CONFIG_VC1_DXVA2_HWACCEL 0 -%define CONFIG_VC1_NVDEC_HWACCEL 0 -%define CONFIG_VC1_VAAPI_HWACCEL 0 -%define CONFIG_VC1_VDPAU_HWACCEL 0 -%define CONFIG_VP8_NVDEC_HWACCEL 0 -%define CONFIG_VP8_VAAPI_HWACCEL 0 -%define CONFIG_VP9_D3D11VA_HWACCEL 0 -%define CONFIG_VP9_D3D11VA2_HWACCEL 0 -%define CONFIG_VP9_DXVA2_HWACCEL 0 -%define CONFIG_VP9_NVDEC_HWACCEL 0 -%define CONFIG_VP9_VAAPI_HWACCEL 0 -%define CONFIG_WMV3_D3D11VA_HWACCEL 0 -%define CONFIG_WMV3_D3D11VA2_HWACCEL 0 -%define CONFIG_WMV3_DXVA2_HWACCEL 0 -%define CONFIG_WMV3_NVDEC_HWACCEL 0 -%define CONFIG_WMV3_VAAPI_HWACCEL 0 -%define CONFIG_WMV3_VDPAU_HWACCEL 0 -%define CONFIG_AAC_PARSER 1 -%define CONFIG_AAC_LATM_PARSER 1 -%define CONFIG_AC3_PARSER 1 -%define CONFIG_ADX_PARSER 1 -%define CONFIG_AV1_PARSER 1 -%define CONFIG_AVS2_PARSER 1 -%define CONFIG_BMP_PARSER 1 -%define CONFIG_CAVSVIDEO_PARSER 1 -%define CONFIG_COOK_PARSER 1 -%define CONFIG_DCA_PARSER 1 -%define CONFIG_DIRAC_PARSER 1 -%define CONFIG_DNXHD_PARSER 1 -%define CONFIG_DPX_PARSER 1 -%define CONFIG_DVAUDIO_PARSER 1 -%define CONFIG_DVBSUB_PARSER 1 -%define CONFIG_DVDSUB_PARSER 1 -%define CONFIG_DVD_NAV_PARSER 1 -%define CONFIG_FLAC_PARSER 1 -%define CONFIG_G729_PARSER 1 -%define CONFIG_GSM_PARSER 1 -%define CONFIG_H261_PARSER 1 -%define CONFIG_H263_PARSER 1 -%define CONFIG_H264_PARSER 1 -%define CONFIG_HEVC_PARSER 1 -%define CONFIG_MJPEG_PARSER 1 -%define CONFIG_MLP_PARSER 1 -%define CONFIG_MPEG4VIDEO_PARSER 1 -%define CONFIG_MPEGAUDIO_PARSER 1 -%define CONFIG_MPEGVIDEO_PARSER 1 -%define CONFIG_OPUS_PARSER 1 -%define CONFIG_PNG_PARSER 1 -%define CONFIG_PNM_PARSER 1 -%define CONFIG_RV30_PARSER 1 -%define CONFIG_RV40_PARSER 1 -%define CONFIG_SBC_PARSER 1 -%define CONFIG_SIPR_PARSER 1 -%define CONFIG_TAK_PARSER 1 -%define CONFIG_VC1_PARSER 1 -%define CONFIG_VORBIS_PARSER 1 -%define CONFIG_VP3_PARSER 1 -%define CONFIG_VP8_PARSER 1 -%define CONFIG_VP9_PARSER 1 -%define CONFIG_XMA_PARSER 1 -%define CONFIG_ALSA_INDEV 0 -%define CONFIG_ANDROID_CAMERA_INDEV 0 -%define CONFIG_AVFOUNDATION_INDEV 0 -%define CONFIG_BKTR_INDEV 0 -%define CONFIG_DECKLINK_INDEV 0 -%define CONFIG_LIBNDI_NEWTEK_INDEV 0 -%define CONFIG_DSHOW_INDEV 0 -%define CONFIG_FBDEV_INDEV 0 -%define CONFIG_GDIGRAB_INDEV 0 -%define CONFIG_IEC61883_INDEV 0 -%define CONFIG_JACK_INDEV 0 -%define CONFIG_KMSGRAB_INDEV 0 -%define CONFIG_LAVFI_INDEV 0 -%define CONFIG_OPENAL_INDEV 0 -%define CONFIG_OSS_INDEV 0 -%define CONFIG_PULSE_INDEV 0 -%define CONFIG_SNDIO_INDEV 0 -%define CONFIG_V4L2_INDEV 0 -%define CONFIG_VFWCAP_INDEV 0 -%define CONFIG_XCBGRAB_INDEV 0 -%define CONFIG_LIBCDIO_INDEV 0 -%define CONFIG_LIBDC1394_INDEV 0 -%define CONFIG_ALSA_OUTDEV 0 -%define CONFIG_CACA_OUTDEV 0 -%define CONFIG_DECKLINK_OUTDEV 0 -%define CONFIG_LIBNDI_NEWTEK_OUTDEV 0 -%define CONFIG_FBDEV_OUTDEV 0 -%define CONFIG_OPENGL_OUTDEV 0 -%define CONFIG_OSS_OUTDEV 0 -%define CONFIG_PULSE_OUTDEV 0 -%define CONFIG_SDL2_OUTDEV 0 -%define CONFIG_SNDIO_OUTDEV 0 -%define CONFIG_V4L2_OUTDEV 0 -%define CONFIG_XV_OUTDEV 0 -%define CONFIG_ABENCH_FILTER 0 -%define CONFIG_ACOMPRESSOR_FILTER 0 -%define CONFIG_ACONTRAST_FILTER 0 -%define CONFIG_ACOPY_FILTER 0 -%define CONFIG_ACUE_FILTER 0 -%define CONFIG_ACROSSFADE_FILTER 0 -%define CONFIG_ACROSSOVER_FILTER 0 -%define CONFIG_ACRUSHER_FILTER 0 -%define CONFIG_ADECLICK_FILTER 0 -%define CONFIG_ADECLIP_FILTER 0 -%define CONFIG_ADELAY_FILTER 0 -%define CONFIG_ADERIVATIVE_FILTER 0 -%define CONFIG_AECHO_FILTER 0 -%define CONFIG_AEMPHASIS_FILTER 0 -%define CONFIG_AEVAL_FILTER 0 -%define CONFIG_AFADE_FILTER 0 -%define CONFIG_AFFTDN_FILTER 0 -%define CONFIG_AFFTFILT_FILTER 0 -%define CONFIG_AFIR_FILTER 0 -%define CONFIG_AFORMAT_FILTER 0 -%define CONFIG_AGATE_FILTER 0 -%define CONFIG_AIIR_FILTER 0 -%define CONFIG_AINTEGRAL_FILTER 0 -%define CONFIG_AINTERLEAVE_FILTER 0 -%define CONFIG_ALIMITER_FILTER 0 -%define CONFIG_ALLPASS_FILTER 0 -%define CONFIG_ALOOP_FILTER 0 -%define CONFIG_AMERGE_FILTER 0 -%define CONFIG_AMETADATA_FILTER 0 -%define CONFIG_AMIX_FILTER 0 -%define CONFIG_AMULTIPLY_FILTER 0 -%define CONFIG_ANEQUALIZER_FILTER 0 -%define CONFIG_ANULL_FILTER 0 -%define CONFIG_APAD_FILTER 0 -%define CONFIG_APERMS_FILTER 0 -%define CONFIG_APHASER_FILTER 0 -%define CONFIG_APULSATOR_FILTER 0 -%define CONFIG_AREALTIME_FILTER 0 -%define CONFIG_ARESAMPLE_FILTER 0 -%define CONFIG_AREVERSE_FILTER 0 -%define CONFIG_ASELECT_FILTER 0 -%define CONFIG_ASENDCMD_FILTER 0 -%define CONFIG_ASETNSAMPLES_FILTER 0 -%define CONFIG_ASETPTS_FILTER 0 -%define CONFIG_ASETRATE_FILTER 0 -%define CONFIG_ASETTB_FILTER 0 -%define CONFIG_ASHOWINFO_FILTER 0 -%define CONFIG_ASIDEDATA_FILTER 0 -%define CONFIG_ASPLIT_FILTER 0 -%define CONFIG_ASTATS_FILTER 0 -%define CONFIG_ASTREAMSELECT_FILTER 0 -%define CONFIG_ATEMPO_FILTER 0 -%define CONFIG_ATRIM_FILTER 0 -%define CONFIG_AZMQ_FILTER 0 -%define CONFIG_BANDPASS_FILTER 0 -%define CONFIG_BANDREJECT_FILTER 0 -%define CONFIG_BASS_FILTER 0 -%define CONFIG_BIQUAD_FILTER 0 -%define CONFIG_BS2B_FILTER 0 -%define CONFIG_CHANNELMAP_FILTER 0 -%define CONFIG_CHANNELSPLIT_FILTER 0 -%define CONFIG_CHORUS_FILTER 0 -%define CONFIG_COMPAND_FILTER 0 -%define CONFIG_COMPENSATIONDELAY_FILTER 0 -%define CONFIG_CROSSFEED_FILTER 0 -%define CONFIG_CRYSTALIZER_FILTER 0 -%define CONFIG_DCSHIFT_FILTER 0 -%define CONFIG_DRMETER_FILTER 0 -%define CONFIG_DYNAUDNORM_FILTER 0 -%define CONFIG_EARWAX_FILTER 0 -%define CONFIG_EBUR128_FILTER 0 -%define CONFIG_EQUALIZER_FILTER 0 -%define CONFIG_EXTRASTEREO_FILTER 0 -%define CONFIG_FIREQUALIZER_FILTER 0 -%define CONFIG_FLANGER_FILTER 0 -%define CONFIG_HAAS_FILTER 0 -%define CONFIG_HDCD_FILTER 0 -%define CONFIG_HEADPHONE_FILTER 0 -%define CONFIG_HIGHPASS_FILTER 0 -%define CONFIG_HIGHSHELF_FILTER 0 -%define CONFIG_JOIN_FILTER 0 -%define CONFIG_LADSPA_FILTER 0 -%define CONFIG_LOUDNORM_FILTER 0 -%define CONFIG_LOWPASS_FILTER 0 -%define CONFIG_LOWSHELF_FILTER 0 -%define CONFIG_LV2_FILTER 0 -%define CONFIG_MCOMPAND_FILTER 0 -%define CONFIG_PAN_FILTER 0 -%define CONFIG_REPLAYGAIN_FILTER 0 -%define CONFIG_RESAMPLE_FILTER 0 -%define CONFIG_RUBBERBAND_FILTER 0 -%define CONFIG_SIDECHAINCOMPRESS_FILTER 0 -%define CONFIG_SIDECHAINGATE_FILTER 0 -%define CONFIG_SILENCEDETECT_FILTER 0 -%define CONFIG_SILENCEREMOVE_FILTER 0 -%define CONFIG_SOFALIZER_FILTER 0 -%define CONFIG_STEREOTOOLS_FILTER 0 -%define CONFIG_STEREOWIDEN_FILTER 0 -%define CONFIG_SUPEREQUALIZER_FILTER 0 -%define CONFIG_SURROUND_FILTER 0 -%define CONFIG_TREBLE_FILTER 0 -%define CONFIG_TREMOLO_FILTER 0 -%define CONFIG_VIBRATO_FILTER 0 -%define CONFIG_VOLUME_FILTER 0 -%define CONFIG_VOLUMEDETECT_FILTER 0 -%define CONFIG_AEVALSRC_FILTER 0 -%define CONFIG_ANOISESRC_FILTER 0 -%define CONFIG_ANULLSRC_FILTER 0 -%define CONFIG_FLITE_FILTER 0 -%define CONFIG_HILBERT_FILTER 0 -%define CONFIG_SINC_FILTER 0 -%define CONFIG_SINE_FILTER 0 -%define CONFIG_ANULLSINK_FILTER 0 -%define CONFIG_ALPHAEXTRACT_FILTER 0 -%define CONFIG_ALPHAMERGE_FILTER 0 -%define CONFIG_AMPLIFY_FILTER 0 -%define CONFIG_ASS_FILTER 0 -%define CONFIG_ATADENOISE_FILTER 0 -%define CONFIG_AVGBLUR_FILTER 0 -%define CONFIG_AVGBLUR_OPENCL_FILTER 0 -%define CONFIG_BBOX_FILTER 0 -%define CONFIG_BENCH_FILTER 0 -%define CONFIG_BITPLANENOISE_FILTER 0 -%define CONFIG_BLACKDETECT_FILTER 0 -%define CONFIG_BLACKFRAME_FILTER 0 -%define CONFIG_BLEND_FILTER 0 -%define CONFIG_BM3D_FILTER 0 -%define CONFIG_BOXBLUR_FILTER 0 -%define CONFIG_BOXBLUR_OPENCL_FILTER 0 -%define CONFIG_BWDIF_FILTER 0 -%define CONFIG_CHROMAHOLD_FILTER 0 -%define CONFIG_CHROMAKEY_FILTER 0 -%define CONFIG_CHROMASHIFT_FILTER 0 -%define CONFIG_CIESCOPE_FILTER 0 -%define CONFIG_CODECVIEW_FILTER 0 -%define CONFIG_COLORBALANCE_FILTER 0 -%define CONFIG_COLORCHANNELMIXER_FILTER 0 -%define CONFIG_COLORKEY_FILTER 0 -%define CONFIG_COLORLEVELS_FILTER 0 -%define CONFIG_COLORMATRIX_FILTER 0 -%define CONFIG_COLORSPACE_FILTER 0 -%define CONFIG_CONVOLUTION_FILTER 0 -%define CONFIG_CONVOLUTION_OPENCL_FILTER 0 -%define CONFIG_CONVOLVE_FILTER 0 -%define CONFIG_COPY_FILTER 0 -%define CONFIG_COREIMAGE_FILTER 0 -%define CONFIG_COVER_RECT_FILTER 0 -%define CONFIG_CROP_FILTER 0 -%define CONFIG_CROPDETECT_FILTER 0 -%define CONFIG_CUE_FILTER 0 -%define CONFIG_CURVES_FILTER 0 -%define CONFIG_DATASCOPE_FILTER 0 -%define CONFIG_DCTDNOIZ_FILTER 0 -%define CONFIG_DEBAND_FILTER 0 -%define CONFIG_DEBLOCK_FILTER 0 -%define CONFIG_DECIMATE_FILTER 0 -%define CONFIG_DECONVOLVE_FILTER 0 -%define CONFIG_DEDOT_FILTER 0 -%define CONFIG_DEFLATE_FILTER 0 -%define CONFIG_DEFLICKER_FILTER 0 -%define CONFIG_DEINTERLACE_QSV_FILTER 0 -%define CONFIG_DEINTERLACE_VAAPI_FILTER 0 -%define CONFIG_DEJUDDER_FILTER 0 -%define CONFIG_DELOGO_FILTER 0 -%define CONFIG_DENOISE_VAAPI_FILTER 0 -%define CONFIG_DESHAKE_FILTER 0 -%define CONFIG_DESPILL_FILTER 0 -%define CONFIG_DETELECINE_FILTER 0 -%define CONFIG_DILATION_FILTER 0 -%define CONFIG_DILATION_OPENCL_FILTER 0 -%define CONFIG_DISPLACE_FILTER 0 -%define CONFIG_DOUBLEWEAVE_FILTER 0 -%define CONFIG_DRAWBOX_FILTER 0 -%define CONFIG_DRAWGRAPH_FILTER 0 -%define CONFIG_DRAWGRID_FILTER 0 -%define CONFIG_DRAWTEXT_FILTER 0 -%define CONFIG_EDGEDETECT_FILTER 0 -%define CONFIG_ELBG_FILTER 0 -%define CONFIG_ENTROPY_FILTER 0 -%define CONFIG_EQ_FILTER 0 -%define CONFIG_EROSION_FILTER 0 -%define CONFIG_EROSION_OPENCL_FILTER 0 -%define CONFIG_EXTRACTPLANES_FILTER 0 -%define CONFIG_FADE_FILTER 0 -%define CONFIG_FFTDNOIZ_FILTER 0 -%define CONFIG_FFTFILT_FILTER 0 -%define CONFIG_FIELD_FILTER 0 -%define CONFIG_FIELDHINT_FILTER 0 -%define CONFIG_FIELDMATCH_FILTER 0 -%define CONFIG_FIELDORDER_FILTER 0 -%define CONFIG_FILLBORDERS_FILTER 0 -%define CONFIG_FIND_RECT_FILTER 0 -%define CONFIG_FLOODFILL_FILTER 0 -%define CONFIG_FORMAT_FILTER 0 -%define CONFIG_FPS_FILTER 0 -%define CONFIG_FRAMEPACK_FILTER 0 -%define CONFIG_FRAMERATE_FILTER 0 -%define CONFIG_FRAMESTEP_FILTER 0 -%define CONFIG_FREEZEDETECT_FILTER 0 -%define CONFIG_FREI0R_FILTER 0 -%define CONFIG_FSPP_FILTER 0 -%define CONFIG_GBLUR_FILTER 0 -%define CONFIG_GEQ_FILTER 0 -%define CONFIG_GRADFUN_FILTER 0 -%define CONFIG_GRAPHMONITOR_FILTER 0 -%define CONFIG_GREYEDGE_FILTER 0 -%define CONFIG_HALDCLUT_FILTER 0 -%define CONFIG_HFLIP_FILTER 0 -%define CONFIG_HISTEQ_FILTER 0 -%define CONFIG_HISTOGRAM_FILTER 0 -%define CONFIG_HQDN3D_FILTER 0 -%define CONFIG_HQX_FILTER 0 -%define CONFIG_HSTACK_FILTER 0 -%define CONFIG_HUE_FILTER 0 -%define CONFIG_HWDOWNLOAD_FILTER 0 -%define CONFIG_HWMAP_FILTER 0 -%define CONFIG_HWUPLOAD_FILTER 0 -%define CONFIG_HWUPLOAD_CUDA_FILTER 0 -%define CONFIG_HYSTERESIS_FILTER 0 -%define CONFIG_IDET_FILTER 0 -%define CONFIG_IL_FILTER 0 -%define CONFIG_INFLATE_FILTER 0 -%define CONFIG_INTERLACE_FILTER 0 -%define CONFIG_INTERLEAVE_FILTER 0 -%define CONFIG_KERNDEINT_FILTER 0 -%define CONFIG_LENSCORRECTION_FILTER 0 -%define CONFIG_LENSFUN_FILTER 0 -%define CONFIG_LIBVMAF_FILTER 0 -%define CONFIG_LIMITER_FILTER 0 -%define CONFIG_LOOP_FILTER 0 -%define CONFIG_LUMAKEY_FILTER 0 -%define CONFIG_LUT_FILTER 0 -%define CONFIG_LUT1D_FILTER 0 -%define CONFIG_LUT2_FILTER 0 -%define CONFIG_LUT3D_FILTER 0 -%define CONFIG_LUTRGB_FILTER 0 -%define CONFIG_LUTYUV_FILTER 0 -%define CONFIG_MASKEDCLAMP_FILTER 0 -%define CONFIG_MASKEDMERGE_FILTER 0 -%define CONFIG_MCDEINT_FILTER 0 -%define CONFIG_MERGEPLANES_FILTER 0 -%define CONFIG_MESTIMATE_FILTER 0 -%define CONFIG_METADATA_FILTER 0 -%define CONFIG_MIDEQUALIZER_FILTER 0 -%define CONFIG_MINTERPOLATE_FILTER 0 -%define CONFIG_MIX_FILTER 0 -%define CONFIG_MPDECIMATE_FILTER 0 -%define CONFIG_NEGATE_FILTER 0 -%define CONFIG_NLMEANS_FILTER 0 -%define CONFIG_NNEDI_FILTER 0 -%define CONFIG_NOFORMAT_FILTER 0 -%define CONFIG_NOISE_FILTER 0 -%define CONFIG_NORMALIZE_FILTER 0 -%define CONFIG_NULL_FILTER 0 -%define CONFIG_OCR_FILTER 0 -%define CONFIG_OCV_FILTER 0 -%define CONFIG_OSCILLOSCOPE_FILTER 0 -%define CONFIG_OVERLAY_FILTER 0 -%define CONFIG_OVERLAY_OPENCL_FILTER 0 -%define CONFIG_OVERLAY_QSV_FILTER 0 -%define CONFIG_OWDENOISE_FILTER 0 -%define CONFIG_PAD_FILTER 0 -%define CONFIG_PALETTEGEN_FILTER 0 -%define CONFIG_PALETTEUSE_FILTER 0 -%define CONFIG_PERMS_FILTER 0 -%define CONFIG_PERSPECTIVE_FILTER 0 -%define CONFIG_PHASE_FILTER 0 -%define CONFIG_PIXDESCTEST_FILTER 0 -%define CONFIG_PIXSCOPE_FILTER 0 -%define CONFIG_PP_FILTER 0 -%define CONFIG_PP7_FILTER 0 -%define CONFIG_PREMULTIPLY_FILTER 0 -%define CONFIG_PREWITT_FILTER 0 -%define CONFIG_PREWITT_OPENCL_FILTER 0 -%define CONFIG_PROCAMP_VAAPI_FILTER 0 -%define CONFIG_PROGRAM_OPENCL_FILTER 0 -%define CONFIG_PSEUDOCOLOR_FILTER 0 -%define CONFIG_PSNR_FILTER 0 -%define CONFIG_PULLUP_FILTER 0 -%define CONFIG_QP_FILTER 0 -%define CONFIG_RANDOM_FILTER 0 -%define CONFIG_READEIA608_FILTER 0 -%define CONFIG_READVITC_FILTER 0 -%define CONFIG_REALTIME_FILTER 0 -%define CONFIG_REMAP_FILTER 0 -%define CONFIG_REMOVEGRAIN_FILTER 0 -%define CONFIG_REMOVELOGO_FILTER 0 -%define CONFIG_REPEATFIELDS_FILTER 0 -%define CONFIG_REVERSE_FILTER 0 -%define CONFIG_RGBASHIFT_FILTER 0 -%define CONFIG_ROBERTS_FILTER 0 -%define CONFIG_ROBERTS_OPENCL_FILTER 0 -%define CONFIG_ROTATE_FILTER 0 -%define CONFIG_SAB_FILTER 0 -%define CONFIG_SCALE_FILTER 0 -%define CONFIG_SCALE_CUDA_FILTER 0 -%define CONFIG_SCALE_NPP_FILTER 0 -%define CONFIG_SCALE_QSV_FILTER 0 -%define CONFIG_SCALE_VAAPI_FILTER 0 -%define CONFIG_SCALE2REF_FILTER 0 -%define CONFIG_SELECT_FILTER 0 -%define CONFIG_SELECTIVECOLOR_FILTER 0 -%define CONFIG_SENDCMD_FILTER 0 -%define CONFIG_SEPARATEFIELDS_FILTER 0 -%define CONFIG_SETDAR_FILTER 0 -%define CONFIG_SETFIELD_FILTER 0 -%define CONFIG_SETPARAMS_FILTER 0 -%define CONFIG_SETPTS_FILTER 0 -%define CONFIG_SETRANGE_FILTER 0 -%define CONFIG_SETSAR_FILTER 0 -%define CONFIG_SETTB_FILTER 0 -%define CONFIG_SHARPNESS_VAAPI_FILTER 0 -%define CONFIG_SHOWINFO_FILTER 0 -%define CONFIG_SHOWPALETTE_FILTER 0 -%define CONFIG_SHUFFLEFRAMES_FILTER 0 -%define CONFIG_SHUFFLEPLANES_FILTER 0 -%define CONFIG_SIDEDATA_FILTER 0 -%define CONFIG_SIGNALSTATS_FILTER 0 -%define CONFIG_SIGNATURE_FILTER 0 -%define CONFIG_SMARTBLUR_FILTER 0 -%define CONFIG_SOBEL_FILTER 0 -%define CONFIG_SOBEL_OPENCL_FILTER 0 -%define CONFIG_SPLIT_FILTER 0 -%define CONFIG_SPP_FILTER 0 -%define CONFIG_SR_FILTER 0 -%define CONFIG_SSIM_FILTER 0 -%define CONFIG_STEREO3D_FILTER 0 -%define CONFIG_STREAMSELECT_FILTER 0 -%define CONFIG_SUBTITLES_FILTER 0 -%define CONFIG_SUPER2XSAI_FILTER 0 -%define CONFIG_SWAPRECT_FILTER 0 -%define CONFIG_SWAPUV_FILTER 0 -%define CONFIG_TBLEND_FILTER 0 -%define CONFIG_TELECINE_FILTER 0 -%define CONFIG_THRESHOLD_FILTER 0 -%define CONFIG_THUMBNAIL_FILTER 0 -%define CONFIG_THUMBNAIL_CUDA_FILTER 0 -%define CONFIG_TILE_FILTER 0 -%define CONFIG_TINTERLACE_FILTER 0 -%define CONFIG_TLUT2_FILTER 0 -%define CONFIG_TMIX_FILTER 0 -%define CONFIG_TONEMAP_FILTER 0 -%define CONFIG_TONEMAP_OPENCL_FILTER 0 -%define CONFIG_TPAD_FILTER 0 -%define CONFIG_TRANSPOSE_FILTER 0 -%define CONFIG_TRANSPOSE_NPP_FILTER 0 -%define CONFIG_TRIM_FILTER 0 -%define CONFIG_UNPREMULTIPLY_FILTER 0 -%define CONFIG_UNSHARP_FILTER 0 -%define CONFIG_UNSHARP_OPENCL_FILTER 0 -%define CONFIG_USPP_FILTER 0 -%define CONFIG_VAGUEDENOISER_FILTER 0 -%define CONFIG_VECTORSCOPE_FILTER 0 -%define CONFIG_VFLIP_FILTER 0 -%define CONFIG_VFRDET_FILTER 0 -%define CONFIG_VIBRANCE_FILTER 0 -%define CONFIG_VIDSTABDETECT_FILTER 0 -%define CONFIG_VIDSTABTRANSFORM_FILTER 0 -%define CONFIG_VIGNETTE_FILTER 0 -%define CONFIG_VMAFMOTION_FILTER 0 -%define CONFIG_VPP_QSV_FILTER 0 -%define CONFIG_VSTACK_FILTER 0 -%define CONFIG_W3FDIF_FILTER 0 -%define CONFIG_WAVEFORM_FILTER 0 -%define CONFIG_WEAVE_FILTER 0 -%define CONFIG_XBR_FILTER 0 -%define CONFIG_XSTACK_FILTER 0 -%define CONFIG_YADIF_FILTER 0 -%define CONFIG_YADIF_CUDA_FILTER 0 -%define CONFIG_ZMQ_FILTER 0 -%define CONFIG_ZOOMPAN_FILTER 0 -%define CONFIG_ZSCALE_FILTER 0 -%define CONFIG_ALLRGB_FILTER 0 -%define CONFIG_ALLYUV_FILTER 0 -%define CONFIG_CELLAUTO_FILTER 0 -%define CONFIG_COLOR_FILTER 0 -%define CONFIG_COREIMAGESRC_FILTER 0 -%define CONFIG_FREI0R_SRC_FILTER 0 -%define CONFIG_HALDCLUTSRC_FILTER 0 -%define CONFIG_LIFE_FILTER 0 -%define CONFIG_MANDELBROT_FILTER 0 -%define CONFIG_MPTESTSRC_FILTER 0 -%define CONFIG_NULLSRC_FILTER 0 -%define CONFIG_OPENCLSRC_FILTER 0 -%define CONFIG_PAL75BARS_FILTER 0 -%define CONFIG_PAL100BARS_FILTER 0 -%define CONFIG_RGBTESTSRC_FILTER 0 -%define CONFIG_SMPTEBARS_FILTER 0 -%define CONFIG_SMPTEHDBARS_FILTER 0 -%define CONFIG_TESTSRC_FILTER 0 -%define CONFIG_TESTSRC2_FILTER 0 -%define CONFIG_YUVTESTSRC_FILTER 0 -%define CONFIG_NULLSINK_FILTER 0 -%define CONFIG_ABITSCOPE_FILTER 0 -%define CONFIG_ADRAWGRAPH_FILTER 0 -%define CONFIG_AGRAPHMONITOR_FILTER 0 -%define CONFIG_AHISTOGRAM_FILTER 0 -%define CONFIG_APHASEMETER_FILTER 0 -%define CONFIG_AVECTORSCOPE_FILTER 0 -%define CONFIG_CONCAT_FILTER 0 -%define CONFIG_SHOWCQT_FILTER 0 -%define CONFIG_SHOWFREQS_FILTER 0 -%define CONFIG_SHOWSPECTRUM_FILTER 0 -%define CONFIG_SHOWSPECTRUMPIC_FILTER 0 -%define CONFIG_SHOWVOLUME_FILTER 0 -%define CONFIG_SHOWWAVES_FILTER 0 -%define CONFIG_SHOWWAVESPIC_FILTER 0 -%define CONFIG_SPECTRUMSYNTH_FILTER 0 -%define CONFIG_AMOVIE_FILTER 0 -%define CONFIG_MOVIE_FILTER 0 -%define CONFIG_AFIFO_FILTER 0 -%define CONFIG_FIFO_FILTER 0 -%define CONFIG_AA_DEMUXER 1 -%define CONFIG_AAC_DEMUXER 1 -%define CONFIG_AC3_DEMUXER 1 -%define CONFIG_ACM_DEMUXER 1 -%define CONFIG_ACT_DEMUXER 1 -%define CONFIG_ADF_DEMUXER 1 -%define CONFIG_ADP_DEMUXER 1 -%define CONFIG_ADS_DEMUXER 1 -%define CONFIG_ADX_DEMUXER 1 -%define CONFIG_AEA_DEMUXER 1 -%define CONFIG_AFC_DEMUXER 1 -%define CONFIG_AIFF_DEMUXER 1 -%define CONFIG_AIX_DEMUXER 1 -%define CONFIG_AMR_DEMUXER 1 -%define CONFIG_AMRNB_DEMUXER 1 -%define CONFIG_AMRWB_DEMUXER 1 -%define CONFIG_ANM_DEMUXER 1 -%define CONFIG_APC_DEMUXER 1 -%define CONFIG_APE_DEMUXER 1 -%define CONFIG_APNG_DEMUXER 1 -%define CONFIG_APTX_DEMUXER 1 -%define CONFIG_APTX_HD_DEMUXER 1 -%define CONFIG_AQTITLE_DEMUXER 1 -%define CONFIG_ASF_DEMUXER 1 -%define CONFIG_ASF_O_DEMUXER 1 -%define CONFIG_ASS_DEMUXER 1 -%define CONFIG_AST_DEMUXER 1 -%define CONFIG_AU_DEMUXER 1 -%define CONFIG_AVI_DEMUXER 1 -%define CONFIG_AVISYNTH_DEMUXER 0 -%define CONFIG_AVR_DEMUXER 1 -%define CONFIG_AVS_DEMUXER 1 -%define CONFIG_AVS2_DEMUXER 1 -%define CONFIG_BETHSOFTVID_DEMUXER 1 -%define CONFIG_BFI_DEMUXER 1 -%define CONFIG_BINTEXT_DEMUXER 1 -%define CONFIG_BINK_DEMUXER 1 -%define CONFIG_BIT_DEMUXER 1 -%define CONFIG_BMV_DEMUXER 1 -%define CONFIG_BFSTM_DEMUXER 1 -%define CONFIG_BRSTM_DEMUXER 1 -%define CONFIG_BOA_DEMUXER 1 -%define CONFIG_C93_DEMUXER 1 -%define CONFIG_CAF_DEMUXER 1 -%define CONFIG_CAVSVIDEO_DEMUXER 1 -%define CONFIG_CDG_DEMUXER 1 -%define CONFIG_CDXL_DEMUXER 1 -%define CONFIG_CINE_DEMUXER 1 -%define CONFIG_CODEC2_DEMUXER 1 -%define CONFIG_CODEC2RAW_DEMUXER 1 -%define CONFIG_CONCAT_DEMUXER 1 -%define CONFIG_DASH_DEMUXER 0 -%define CONFIG_DATA_DEMUXER 1 -%define CONFIG_DAUD_DEMUXER 1 -%define CONFIG_DCSTR_DEMUXER 1 -%define CONFIG_DFA_DEMUXER 1 -%define CONFIG_DIRAC_DEMUXER 1 -%define CONFIG_DNXHD_DEMUXER 1 -%define CONFIG_DSF_DEMUXER 1 -%define CONFIG_DSICIN_DEMUXER 1 -%define CONFIG_DSS_DEMUXER 1 -%define CONFIG_DTS_DEMUXER 1 -%define CONFIG_DTSHD_DEMUXER 1 -%define CONFIG_DV_DEMUXER 1 -%define CONFIG_DVBSUB_DEMUXER 1 -%define CONFIG_DVBTXT_DEMUXER 1 -%define CONFIG_DXA_DEMUXER 1 -%define CONFIG_EA_DEMUXER 1 -%define CONFIG_EA_CDATA_DEMUXER 1 -%define CONFIG_EAC3_DEMUXER 1 -%define CONFIG_EPAF_DEMUXER 1 -%define CONFIG_FFMETADATA_DEMUXER 1 -%define CONFIG_FILMSTRIP_DEMUXER 1 -%define CONFIG_FITS_DEMUXER 1 -%define CONFIG_FLAC_DEMUXER 1 -%define CONFIG_FLIC_DEMUXER 1 -%define CONFIG_FLV_DEMUXER 1 -%define CONFIG_LIVE_FLV_DEMUXER 1 -%define CONFIG_FOURXM_DEMUXER 1 -%define CONFIG_FRM_DEMUXER 1 -%define CONFIG_FSB_DEMUXER 1 -%define CONFIG_G722_DEMUXER 1 -%define CONFIG_G723_1_DEMUXER 1 -%define CONFIG_G726_DEMUXER 1 -%define CONFIG_G726LE_DEMUXER 1 -%define CONFIG_G729_DEMUXER 1 -%define CONFIG_GDV_DEMUXER 1 -%define CONFIG_GENH_DEMUXER 1 -%define CONFIG_GIF_DEMUXER 1 -%define CONFIG_GSM_DEMUXER 1 -%define CONFIG_GXF_DEMUXER 1 -%define CONFIG_H261_DEMUXER 1 -%define CONFIG_H263_DEMUXER 1 -%define CONFIG_H264_DEMUXER 1 -%define CONFIG_HEVC_DEMUXER 1 -%define CONFIG_HLS_DEMUXER 1 -%define CONFIG_HNM_DEMUXER 1 -%define CONFIG_ICO_DEMUXER 1 -%define CONFIG_IDCIN_DEMUXER 1 -%define CONFIG_IDF_DEMUXER 1 -%define CONFIG_IFF_DEMUXER 1 -%define CONFIG_ILBC_DEMUXER 1 -%define CONFIG_IMAGE2_DEMUXER 1 -%define CONFIG_IMAGE2PIPE_DEMUXER 1 -%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 1 -%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 1 -%define CONFIG_INGENIENT_DEMUXER 1 -%define CONFIG_IPMOVIE_DEMUXER 1 -%define CONFIG_IRCAM_DEMUXER 1 -%define CONFIG_ISS_DEMUXER 1 -%define CONFIG_IV8_DEMUXER 1 -%define CONFIG_IVF_DEMUXER 1 -%define CONFIG_IVR_DEMUXER 1 -%define CONFIG_JACOSUB_DEMUXER 1 -%define CONFIG_JV_DEMUXER 1 -%define CONFIG_LMLM4_DEMUXER 1 -%define CONFIG_LOAS_DEMUXER 1 -%define CONFIG_LRC_DEMUXER 1 -%define CONFIG_LVF_DEMUXER 1 -%define CONFIG_LXF_DEMUXER 1 -%define CONFIG_M4V_DEMUXER 1 -%define CONFIG_MATROSKA_DEMUXER 1 -%define CONFIG_MGSTS_DEMUXER 1 -%define CONFIG_MICRODVD_DEMUXER 1 -%define CONFIG_MJPEG_DEMUXER 1 -%define CONFIG_MJPEG_2000_DEMUXER 1 -%define CONFIG_MLP_DEMUXER 1 -%define CONFIG_MLV_DEMUXER 1 -%define CONFIG_MM_DEMUXER 1 -%define CONFIG_MMF_DEMUXER 1 -%define CONFIG_MOV_DEMUXER 1 -%define CONFIG_MP3_DEMUXER 1 -%define CONFIG_MPC_DEMUXER 1 -%define CONFIG_MPC8_DEMUXER 1 -%define CONFIG_MPEGPS_DEMUXER 1 -%define CONFIG_MPEGTS_DEMUXER 1 -%define CONFIG_MPEGTSRAW_DEMUXER 1 -%define CONFIG_MPEGVIDEO_DEMUXER 1 -%define CONFIG_MPJPEG_DEMUXER 1 -%define CONFIG_MPL2_DEMUXER 1 -%define CONFIG_MPSUB_DEMUXER 1 -%define CONFIG_MSF_DEMUXER 1 -%define CONFIG_MSNWC_TCP_DEMUXER 1 -%define CONFIG_MTAF_DEMUXER 1 -%define CONFIG_MTV_DEMUXER 1 -%define CONFIG_MUSX_DEMUXER 1 -%define CONFIG_MV_DEMUXER 1 -%define CONFIG_MVI_DEMUXER 1 -%define CONFIG_MXF_DEMUXER 1 -%define CONFIG_MXG_DEMUXER 1 -%define CONFIG_NC_DEMUXER 1 -%define CONFIG_NISTSPHERE_DEMUXER 1 -%define CONFIG_NSP_DEMUXER 1 -%define CONFIG_NSV_DEMUXER 1 -%define CONFIG_NUT_DEMUXER 1 -%define CONFIG_NUV_DEMUXER 1 -%define CONFIG_OGG_DEMUXER 1 -%define CONFIG_OMA_DEMUXER 1 -%define CONFIG_PAF_DEMUXER 1 -%define CONFIG_PCM_ALAW_DEMUXER 1 -%define CONFIG_PCM_MULAW_DEMUXER 1 -%define CONFIG_PCM_VIDC_DEMUXER 1 -%define CONFIG_PCM_F64BE_DEMUXER 1 -%define CONFIG_PCM_F64LE_DEMUXER 1 -%define CONFIG_PCM_F32BE_DEMUXER 1 -%define CONFIG_PCM_F32LE_DEMUXER 1 -%define CONFIG_PCM_S32BE_DEMUXER 1 -%define CONFIG_PCM_S32LE_DEMUXER 1 -%define CONFIG_PCM_S24BE_DEMUXER 1 -%define CONFIG_PCM_S24LE_DEMUXER 1 -%define CONFIG_PCM_S16BE_DEMUXER 1 -%define CONFIG_PCM_S16LE_DEMUXER 1 -%define CONFIG_PCM_S8_DEMUXER 1 -%define CONFIG_PCM_U32BE_DEMUXER 1 -%define CONFIG_PCM_U32LE_DEMUXER 1 -%define CONFIG_PCM_U24BE_DEMUXER 1 -%define CONFIG_PCM_U24LE_DEMUXER 1 -%define CONFIG_PCM_U16BE_DEMUXER 1 -%define CONFIG_PCM_U16LE_DEMUXER 1 -%define CONFIG_PCM_U8_DEMUXER 1 -%define CONFIG_PJS_DEMUXER 1 -%define CONFIG_PMP_DEMUXER 1 -%define CONFIG_PVA_DEMUXER 1 -%define CONFIG_PVF_DEMUXER 1 -%define CONFIG_QCP_DEMUXER 1 -%define CONFIG_R3D_DEMUXER 1 -%define CONFIG_RAWVIDEO_DEMUXER 1 -%define CONFIG_REALTEXT_DEMUXER 1 -%define CONFIG_REDSPARK_DEMUXER 1 -%define CONFIG_RL2_DEMUXER 1 -%define CONFIG_RM_DEMUXER 1 -%define CONFIG_ROQ_DEMUXER 1 -%define CONFIG_RPL_DEMUXER 1 -%define CONFIG_RSD_DEMUXER 1 -%define CONFIG_RSO_DEMUXER 1 -%define CONFIG_RTP_DEMUXER 0 -%define CONFIG_RTSP_DEMUXER 0 -%define CONFIG_S337M_DEMUXER 1 -%define CONFIG_SAMI_DEMUXER 1 -%define CONFIG_SAP_DEMUXER 0 -%define CONFIG_SBC_DEMUXER 1 -%define CONFIG_SBG_DEMUXER 1 -%define CONFIG_SCC_DEMUXER 1 -%define CONFIG_SDP_DEMUXER 0 -%define CONFIG_SDR2_DEMUXER 1 -%define CONFIG_SDS_DEMUXER 1 -%define CONFIG_SDX_DEMUXER 1 -%define CONFIG_SEGAFILM_DEMUXER 1 -%define CONFIG_SER_DEMUXER 1 -%define CONFIG_SHORTEN_DEMUXER 1 -%define CONFIG_SIFF_DEMUXER 1 -%define CONFIG_SLN_DEMUXER 1 -%define CONFIG_SMACKER_DEMUXER 1 -%define CONFIG_SMJPEG_DEMUXER 1 -%define CONFIG_SMUSH_DEMUXER 1 -%define CONFIG_SOL_DEMUXER 1 -%define CONFIG_SOX_DEMUXER 1 -%define CONFIG_SPDIF_DEMUXER 1 -%define CONFIG_SRT_DEMUXER 1 -%define CONFIG_STR_DEMUXER 1 -%define CONFIG_STL_DEMUXER 1 -%define CONFIG_SUBVIEWER1_DEMUXER 1 -%define CONFIG_SUBVIEWER_DEMUXER 1 -%define CONFIG_SUP_DEMUXER 1 -%define CONFIG_SVAG_DEMUXER 1 -%define CONFIG_SWF_DEMUXER 1 -%define CONFIG_TAK_DEMUXER 1 -%define CONFIG_TEDCAPTIONS_DEMUXER 1 -%define CONFIG_THP_DEMUXER 1 -%define CONFIG_THREEDOSTR_DEMUXER 1 -%define CONFIG_TIERTEXSEQ_DEMUXER 1 -%define CONFIG_TMV_DEMUXER 1 -%define CONFIG_TRUEHD_DEMUXER 1 -%define CONFIG_TTA_DEMUXER 1 -%define CONFIG_TXD_DEMUXER 1 -%define CONFIG_TTY_DEMUXER 1 -%define CONFIG_TY_DEMUXER 1 -%define CONFIG_V210_DEMUXER 1 -%define CONFIG_V210X_DEMUXER 1 -%define CONFIG_VAG_DEMUXER 1 -%define CONFIG_VC1_DEMUXER 1 -%define CONFIG_VC1T_DEMUXER 1 -%define CONFIG_VIVO_DEMUXER 1 -%define CONFIG_VMD_DEMUXER 1 -%define CONFIG_VOBSUB_DEMUXER 1 -%define CONFIG_VOC_DEMUXER 1 -%define CONFIG_VPK_DEMUXER 1 -%define CONFIG_VPLAYER_DEMUXER 1 -%define CONFIG_VQF_DEMUXER 1 -%define CONFIG_W64_DEMUXER 1 -%define CONFIG_WAV_DEMUXER 1 -%define CONFIG_WC3_DEMUXER 1 -%define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 1 -%define CONFIG_WEBVTT_DEMUXER 1 -%define CONFIG_WSAUD_DEMUXER 1 -%define CONFIG_WSD_DEMUXER 1 -%define CONFIG_WSVQA_DEMUXER 1 -%define CONFIG_WTV_DEMUXER 1 -%define CONFIG_WVE_DEMUXER 1 -%define CONFIG_WV_DEMUXER 1 -%define CONFIG_XA_DEMUXER 1 -%define CONFIG_XBIN_DEMUXER 1 -%define CONFIG_XMV_DEMUXER 1 -%define CONFIG_XVAG_DEMUXER 1 -%define CONFIG_XWMA_DEMUXER 1 -%define CONFIG_YOP_DEMUXER 1 -%define CONFIG_YUV4MPEGPIPE_DEMUXER 1 -%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PAM_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PBM_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PCX_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PGM_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PNG_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PPM_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PSD_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_SGI_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_SVG_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_XPM_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_XWD_PIPE_DEMUXER 1 -%define CONFIG_LIBGME_DEMUXER 0 -%define CONFIG_LIBMODPLUG_DEMUXER 0 -%define CONFIG_LIBOPENMPT_DEMUXER 0 -%define CONFIG_VAPOURSYNTH_DEMUXER 0 -%define CONFIG_A64_MUXER 0 -%define CONFIG_AC3_MUXER 0 -%define CONFIG_ADTS_MUXER 0 -%define CONFIG_ADX_MUXER 0 -%define CONFIG_AIFF_MUXER 0 -%define CONFIG_AMR_MUXER 0 -%define CONFIG_APNG_MUXER 0 -%define CONFIG_APTX_MUXER 0 -%define CONFIG_APTX_HD_MUXER 0 -%define CONFIG_ASF_MUXER 0 -%define CONFIG_ASS_MUXER 0 -%define CONFIG_AST_MUXER 0 -%define CONFIG_ASF_STREAM_MUXER 0 -%define CONFIG_AU_MUXER 0 -%define CONFIG_AVI_MUXER 0 -%define CONFIG_AVM2_MUXER 0 -%define CONFIG_AVS2_MUXER 0 -%define CONFIG_BIT_MUXER 0 -%define CONFIG_CAF_MUXER 0 -%define CONFIG_CAVSVIDEO_MUXER 0 -%define CONFIG_CODEC2_MUXER 0 -%define CONFIG_CODEC2RAW_MUXER 0 -%define CONFIG_CRC_MUXER 0 -%define CONFIG_DASH_MUXER 0 -%define CONFIG_DATA_MUXER 0 -%define CONFIG_DAUD_MUXER 0 -%define CONFIG_DIRAC_MUXER 0 -%define CONFIG_DNXHD_MUXER 0 -%define CONFIG_DTS_MUXER 0 -%define CONFIG_DV_MUXER 0 -%define CONFIG_EAC3_MUXER 0 -%define CONFIG_F4V_MUXER 0 -%define CONFIG_FFMETADATA_MUXER 0 -%define CONFIG_FIFO_MUXER 0 -%define CONFIG_FIFO_TEST_MUXER 0 -%define CONFIG_FILMSTRIP_MUXER 0 -%define CONFIG_FITS_MUXER 0 -%define CONFIG_FLAC_MUXER 0 -%define CONFIG_FLV_MUXER 0 -%define CONFIG_FRAMECRC_MUXER 0 -%define CONFIG_FRAMEHASH_MUXER 0 -%define CONFIG_FRAMEMD5_MUXER 0 -%define CONFIG_G722_MUXER 0 -%define CONFIG_G723_1_MUXER 0 -%define CONFIG_G726_MUXER 0 -%define CONFIG_G726LE_MUXER 0 -%define CONFIG_GIF_MUXER 0 -%define CONFIG_GSM_MUXER 0 -%define CONFIG_GXF_MUXER 0 -%define CONFIG_H261_MUXER 0 -%define CONFIG_H263_MUXER 0 -%define CONFIG_H264_MUXER 0 -%define CONFIG_HASH_MUXER 0 -%define CONFIG_HDS_MUXER 0 -%define CONFIG_HEVC_MUXER 0 -%define CONFIG_HLS_MUXER 0 -%define CONFIG_ICO_MUXER 0 -%define CONFIG_ILBC_MUXER 0 -%define CONFIG_IMAGE2_MUXER 0 -%define CONFIG_IMAGE2PIPE_MUXER 0 -%define CONFIG_IPOD_MUXER 0 -%define CONFIG_IRCAM_MUXER 0 -%define CONFIG_ISMV_MUXER 0 -%define CONFIG_IVF_MUXER 0 -%define CONFIG_JACOSUB_MUXER 0 -%define CONFIG_LATM_MUXER 0 -%define CONFIG_LRC_MUXER 0 -%define CONFIG_M4V_MUXER 0 -%define CONFIG_MD5_MUXER 0 -%define CONFIG_MATROSKA_MUXER 0 -%define CONFIG_MATROSKA_AUDIO_MUXER 0 -%define CONFIG_MICRODVD_MUXER 0 -%define CONFIG_MJPEG_MUXER 0 -%define CONFIG_MLP_MUXER 0 -%define CONFIG_MMF_MUXER 0 -%define CONFIG_MOV_MUXER 0 -%define CONFIG_MP2_MUXER 0 -%define CONFIG_MP3_MUXER 0 -%define CONFIG_MP4_MUXER 0 -%define CONFIG_MPEG1SYSTEM_MUXER 0 -%define CONFIG_MPEG1VCD_MUXER 0 -%define CONFIG_MPEG1VIDEO_MUXER 0 -%define CONFIG_MPEG2DVD_MUXER 0 -%define CONFIG_MPEG2SVCD_MUXER 0 -%define CONFIG_MPEG2VIDEO_MUXER 0 -%define CONFIG_MPEG2VOB_MUXER 0 -%define CONFIG_MPEGTS_MUXER 0 -%define CONFIG_MPJPEG_MUXER 0 -%define CONFIG_MXF_MUXER 0 -%define CONFIG_MXF_D10_MUXER 0 -%define CONFIG_MXF_OPATOM_MUXER 0 -%define CONFIG_NULL_MUXER 0 -%define CONFIG_NUT_MUXER 0 -%define CONFIG_OGA_MUXER 0 -%define CONFIG_OGG_MUXER 0 -%define CONFIG_OGV_MUXER 0 -%define CONFIG_OMA_MUXER 0 -%define CONFIG_OPUS_MUXER 0 -%define CONFIG_PCM_ALAW_MUXER 0 -%define CONFIG_PCM_MULAW_MUXER 0 -%define CONFIG_PCM_VIDC_MUXER 0 -%define CONFIG_PCM_F64BE_MUXER 0 -%define CONFIG_PCM_F64LE_MUXER 0 -%define CONFIG_PCM_F32BE_MUXER 0 -%define CONFIG_PCM_F32LE_MUXER 0 -%define CONFIG_PCM_S32BE_MUXER 0 -%define CONFIG_PCM_S32LE_MUXER 0 -%define CONFIG_PCM_S24BE_MUXER 0 -%define CONFIG_PCM_S24LE_MUXER 0 -%define CONFIG_PCM_S16BE_MUXER 0 -%define CONFIG_PCM_S16LE_MUXER 0 -%define CONFIG_PCM_S8_MUXER 0 -%define CONFIG_PCM_U32BE_MUXER 0 -%define CONFIG_PCM_U32LE_MUXER 0 -%define CONFIG_PCM_U24BE_MUXER 0 -%define CONFIG_PCM_U24LE_MUXER 0 -%define CONFIG_PCM_U16BE_MUXER 0 -%define CONFIG_PCM_U16LE_MUXER 0 -%define CONFIG_PCM_U8_MUXER 0 -%define CONFIG_PSP_MUXER 0 -%define CONFIG_RAWVIDEO_MUXER 0 -%define CONFIG_RM_MUXER 0 -%define CONFIG_ROQ_MUXER 0 -%define CONFIG_RSO_MUXER 0 -%define CONFIG_RTP_MUXER 0 -%define CONFIG_RTP_MPEGTS_MUXER 0 -%define CONFIG_RTSP_MUXER 0 -%define CONFIG_SAP_MUXER 0 -%define CONFIG_SBC_MUXER 0 -%define CONFIG_SCC_MUXER 0 -%define CONFIG_SEGAFILM_MUXER 0 -%define CONFIG_SEGMENT_MUXER 0 -%define CONFIG_STREAM_SEGMENT_MUXER 0 -%define CONFIG_SINGLEJPEG_MUXER 0 -%define CONFIG_SMJPEG_MUXER 0 -%define CONFIG_SMOOTHSTREAMING_MUXER 0 -%define CONFIG_SOX_MUXER 0 -%define CONFIG_SPX_MUXER 0 -%define CONFIG_SPDIF_MUXER 0 -%define CONFIG_SRT_MUXER 0 -%define CONFIG_SUP_MUXER 0 -%define CONFIG_SWF_MUXER 0 -%define CONFIG_TEE_MUXER 0 -%define CONFIG_TG2_MUXER 0 -%define CONFIG_TGP_MUXER 0 -%define CONFIG_MKVTIMESTAMP_V2_MUXER 0 -%define CONFIG_TRUEHD_MUXER 0 -%define CONFIG_TTA_MUXER 0 -%define CONFIG_UNCODEDFRAMECRC_MUXER 0 -%define CONFIG_VC1_MUXER 0 -%define CONFIG_VC1T_MUXER 0 -%define CONFIG_VOC_MUXER 0 -%define CONFIG_W64_MUXER 0 -%define CONFIG_WAV_MUXER 0 -%define CONFIG_WEBM_MUXER 0 -%define CONFIG_WEBM_DASH_MANIFEST_MUXER 0 -%define CONFIG_WEBM_CHUNK_MUXER 0 -%define CONFIG_WEBP_MUXER 0 -%define CONFIG_WEBVTT_MUXER 0 -%define CONFIG_WTV_MUXER 0 -%define CONFIG_WV_MUXER 0 -%define CONFIG_YUV4MPEGPIPE_MUXER 0 -%define CONFIG_CHROMAPRINT_MUXER 0 -%define CONFIG_ASYNC_PROTOCOL 1 -%define CONFIG_BLURAY_PROTOCOL 0 -%define CONFIG_CACHE_PROTOCOL 1 -%define CONFIG_CONCAT_PROTOCOL 1 -%define CONFIG_CRYPTO_PROTOCOL 1 -%define CONFIG_DATA_PROTOCOL 1 -%define CONFIG_FFRTMPCRYPT_PROTOCOL 0 -%define CONFIG_FFRTMPHTTP_PROTOCOL 0 -%define CONFIG_FILE_PROTOCOL 1 -%define CONFIG_FTP_PROTOCOL 0 -%define CONFIG_GOPHER_PROTOCOL 0 -%define CONFIG_HLS_PROTOCOL 1 -%define CONFIG_HTTP_PROTOCOL 0 -%define CONFIG_HTTPPROXY_PROTOCOL 0 -%define CONFIG_HTTPS_PROTOCOL 0 -%define CONFIG_ICECAST_PROTOCOL 0 -%define CONFIG_MMSH_PROTOCOL 0 -%define CONFIG_MMST_PROTOCOL 0 -%define CONFIG_MD5_PROTOCOL 1 -%define CONFIG_PIPE_PROTOCOL 1 -%define CONFIG_PROMPEG_PROTOCOL 1 -%define CONFIG_RTMP_PROTOCOL 0 -%define CONFIG_RTMPE_PROTOCOL 0 -%define CONFIG_RTMPS_PROTOCOL 0 -%define CONFIG_RTMPT_PROTOCOL 0 -%define CONFIG_RTMPTE_PROTOCOL 0 -%define CONFIG_RTMPTS_PROTOCOL 0 -%define CONFIG_RTP_PROTOCOL 0 -%define CONFIG_SCTP_PROTOCOL 0 -%define CONFIG_SRTP_PROTOCOL 0 -%define CONFIG_SUBFILE_PROTOCOL 1 -%define CONFIG_TEE_PROTOCOL 1 -%define CONFIG_TCP_PROTOCOL 0 -%define CONFIG_TLS_PROTOCOL 0 -%define CONFIG_UDP_PROTOCOL 0 -%define CONFIG_UDPLITE_PROTOCOL 0 -%define CONFIG_UNIX_PROTOCOL 0 -%define CONFIG_LIBRTMP_PROTOCOL 0 -%define CONFIG_LIBRTMPE_PROTOCOL 0 -%define CONFIG_LIBRTMPS_PROTOCOL 0 -%define CONFIG_LIBRTMPT_PROTOCOL 0 -%define CONFIG_LIBRTMPTE_PROTOCOL 0 -%define CONFIG_LIBSRT_PROTOCOL 0 -%define CONFIG_LIBSSH_PROTOCOL 0 -%define CONFIG_LIBSMBCLIENT_PROTOCOL 0 diff --git a/build/ffmpeg/config-x64.h b/build/ffmpeg/config-x64.h deleted file mode 100755 index 52eed2f2f..000000000 --- a/build/ffmpeg/config-x64.h +++ /dev/null @@ -1,2476 +0,0 @@ -/* Automatically generated by configure - do not modify! */ -#ifndef FFMPEG_CONFIG_H -#define FFMPEG_CONFIG_H -#define FFMPEG_CONFIGURATION "--disable-avfilter --disable-avresample --disable-bzlib --disable-d3d11va --disable-dxva2 --disable-decoder='atrac3p,indeo2,indeo3,indeo4,indeo5,twinvq' --disable-devices --disable-doc --disable-encoders --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-filters --disable-hwaccels --disable-muxers --disable-network --disable-postproc --disable-pthreads --disable-shared --enable-gpl --enable-runtime-cpudetect --enable-static --enable-small --enable-x86asm --x86asmexe=yasm --enable-zlib --extra-cflags=-D_SYSCRT --extra-cflags=-I../../include --extra-cflags=-MD --extra-cflags=-wd4005 --extra-cflags=-wd4189 --extra-ldflags='-LIBPATH:../../lib/x64/Release' --toolchain=msvc" -#define FFMPEG_LICENSE "GPL version 2 or later" -#define CONFIG_THIS_YEAR 2018 -#define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -#define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "Microsoft(R) C/C++ Optimizing Compiler Version 19.16.27025.1 for x64" -#define av_restrict __restrict -#define EXTERN_PREFIX "" -#define EXTERN_ASM -#define BUILDSUF "" -#define SLIBSUF ".dll" -#define HAVE_MMX2 HAVE_MMXEXT -#define SWS_MAX_FILTER_SIZE 256 -#define ARCH_AARCH64 0 -#define ARCH_ALPHA 0 -#define ARCH_ARM 0 -#define ARCH_AVR32 0 -#define ARCH_AVR32_AP 0 -#define ARCH_AVR32_UC 0 -#define ARCH_BFIN 0 -#define ARCH_IA64 0 -#define ARCH_M68K 0 -#define ARCH_MIPS 0 -#define ARCH_MIPS64 0 -#define ARCH_PARISC 0 -#define ARCH_PPC 0 -#define ARCH_PPC64 0 -#define ARCH_S390 0 -#define ARCH_SH4 0 -#define ARCH_SPARC 0 -#define ARCH_SPARC64 0 -#define ARCH_TILEGX 0 -#define ARCH_TILEPRO 0 -#define ARCH_TOMI 0 -#define ARCH_X86 1 -#define ARCH_X86_32 0 -#define ARCH_X86_64 1 -#define HAVE_ARMV5TE 0 -#define HAVE_ARMV6 0 -#define HAVE_ARMV6T2 0 -#define HAVE_ARMV8 0 -#define HAVE_NEON 0 -#define HAVE_VFP 0 -#define HAVE_VFPV3 0 -#define HAVE_SETEND 0 -#define HAVE_ALTIVEC 0 -#define HAVE_DCBZL 0 -#define HAVE_LDBRX 0 -#define HAVE_POWER8 0 -#define HAVE_PPC4XX 0 -#define HAVE_VSX 0 -#define HAVE_AESNI 1 -#define HAVE_AMD3DNOW 1 -#define HAVE_AMD3DNOWEXT 1 -#define HAVE_AVX 1 -#define HAVE_AVX2 1 -#define HAVE_AVX512 1 -#define HAVE_FMA3 1 -#define HAVE_FMA4 1 -#define HAVE_MMX 1 -#define HAVE_MMXEXT 1 -#define HAVE_SSE 1 -#define HAVE_SSE2 1 -#define HAVE_SSE3 1 -#define HAVE_SSE4 1 -#define HAVE_SSE42 1 -#define HAVE_SSSE3 1 -#define HAVE_XOP 1 -#define HAVE_CPUNOP 1 -#define HAVE_I686 1 -#define HAVE_MIPSFPU 0 -#define HAVE_MIPS32R2 0 -#define HAVE_MIPS32R5 0 -#define HAVE_MIPS64R2 0 -#define HAVE_MIPS32R6 0 -#define HAVE_MIPS64R6 0 -#define HAVE_MIPSDSP 0 -#define HAVE_MIPSDSPR2 0 -#define HAVE_MSA 0 -#define HAVE_LOONGSON2 0 -#define HAVE_LOONGSON3 0 -#define HAVE_MMI 0 -#define HAVE_ARMV5TE_EXTERNAL 0 -#define HAVE_ARMV6_EXTERNAL 0 -#define HAVE_ARMV6T2_EXTERNAL 0 -#define HAVE_ARMV8_EXTERNAL 0 -#define HAVE_NEON_EXTERNAL 0 -#define HAVE_VFP_EXTERNAL 0 -#define HAVE_VFPV3_EXTERNAL 0 -#define HAVE_SETEND_EXTERNAL 0 -#define HAVE_ALTIVEC_EXTERNAL 0 -#define HAVE_DCBZL_EXTERNAL 0 -#define HAVE_LDBRX_EXTERNAL 0 -#define HAVE_POWER8_EXTERNAL 0 -#define HAVE_PPC4XX_EXTERNAL 0 -#define HAVE_VSX_EXTERNAL 0 -#define HAVE_AESNI_EXTERNAL 1 -#define HAVE_AMD3DNOW_EXTERNAL 1 -#define HAVE_AMD3DNOWEXT_EXTERNAL 1 -#define HAVE_AVX_EXTERNAL 1 -#define HAVE_AVX2_EXTERNAL 0 -#define HAVE_AVX512_EXTERNAL 0 -#define HAVE_FMA3_EXTERNAL 1 -#define HAVE_FMA4_EXTERNAL 1 -#define HAVE_MMX_EXTERNAL 1 -#define HAVE_MMXEXT_EXTERNAL 1 -#define HAVE_SSE_EXTERNAL 1 -#define HAVE_SSE2_EXTERNAL 1 -#define HAVE_SSE3_EXTERNAL 1 -#define HAVE_SSE4_EXTERNAL 1 -#define HAVE_SSE42_EXTERNAL 1 -#define HAVE_SSSE3_EXTERNAL 1 -#define HAVE_XOP_EXTERNAL 1 -#define HAVE_CPUNOP_EXTERNAL 0 -#define HAVE_I686_EXTERNAL 0 -#define HAVE_MIPSFPU_EXTERNAL 0 -#define HAVE_MIPS32R2_EXTERNAL 0 -#define HAVE_MIPS32R5_EXTERNAL 0 -#define HAVE_MIPS64R2_EXTERNAL 0 -#define HAVE_MIPS32R6_EXTERNAL 0 -#define HAVE_MIPS64R6_EXTERNAL 0 -#define HAVE_MIPSDSP_EXTERNAL 0 -#define HAVE_MIPSDSPR2_EXTERNAL 0 -#define HAVE_MSA_EXTERNAL 0 -#define HAVE_LOONGSON2_EXTERNAL 0 -#define HAVE_LOONGSON3_EXTERNAL 0 -#define HAVE_MMI_EXTERNAL 0 -#define HAVE_ARMV5TE_INLINE 0 -#define HAVE_ARMV6_INLINE 0 -#define HAVE_ARMV6T2_INLINE 0 -#define HAVE_ARMV8_INLINE 0 -#define HAVE_NEON_INLINE 0 -#define HAVE_VFP_INLINE 0 -#define HAVE_VFPV3_INLINE 0 -#define HAVE_SETEND_INLINE 0 -#define HAVE_ALTIVEC_INLINE 0 -#define HAVE_DCBZL_INLINE 0 -#define HAVE_LDBRX_INLINE 0 -#define HAVE_POWER8_INLINE 0 -#define HAVE_PPC4XX_INLINE 0 -#define HAVE_VSX_INLINE 0 -#define HAVE_AESNI_INLINE 0 -#define HAVE_AMD3DNOW_INLINE 0 -#define HAVE_AMD3DNOWEXT_INLINE 0 -#define HAVE_AVX_INLINE 0 -#define HAVE_AVX2_INLINE 0 -#define HAVE_AVX512_INLINE 0 -#define HAVE_FMA3_INLINE 0 -#define HAVE_FMA4_INLINE 0 -#define HAVE_MMX_INLINE 0 -#define HAVE_MMXEXT_INLINE 0 -#define HAVE_SSE_INLINE 0 -#define HAVE_SSE2_INLINE 0 -#define HAVE_SSE3_INLINE 0 -#define HAVE_SSE4_INLINE 0 -#define HAVE_SSE42_INLINE 0 -#define HAVE_SSSE3_INLINE 0 -#define HAVE_XOP_INLINE 0 -#define HAVE_CPUNOP_INLINE 0 -#define HAVE_I686_INLINE 0 -#define HAVE_MIPSFPU_INLINE 0 -#define HAVE_MIPS32R2_INLINE 0 -#define HAVE_MIPS32R5_INLINE 0 -#define HAVE_MIPS64R2_INLINE 0 -#define HAVE_MIPS32R6_INLINE 0 -#define HAVE_MIPS64R6_INLINE 0 -#define HAVE_MIPSDSP_INLINE 0 -#define HAVE_MIPSDSPR2_INLINE 0 -#define HAVE_MSA_INLINE 0 -#define HAVE_LOONGSON2_INLINE 0 -#define HAVE_LOONGSON3_INLINE 0 -#define HAVE_MMI_INLINE 0 -#define HAVE_ALIGNED_STACK 1 -#define HAVE_FAST_64BIT 1 -#define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 1 -#define HAVE_LOCAL_ALIGNED 1 -#define HAVE_SIMD_ALIGN_16 1 -#define HAVE_SIMD_ALIGN_32 1 -#define HAVE_SIMD_ALIGN_64 1 -#define HAVE_ATOMIC_CAS_PTR 0 -#define HAVE_MACHINE_RW_BARRIER 0 -#define HAVE_MEMORYBARRIER 1 -#define HAVE_MM_EMPTY 0 -#define HAVE_RDTSC 1 -#define HAVE_SEM_TIMEDWAIT 0 -#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0 -#define HAVE_CABS 0 -#define HAVE_CEXP 0 -#define HAVE_INLINE_ASM 0 -#define HAVE_SYMVER 0 -#define HAVE_X86ASM 1 -#define HAVE_BIGENDIAN 0 -#define HAVE_FAST_UNALIGNED 1 -#define HAVE_ARPA_INET_H 0 -#define HAVE_ASM_TYPES_H 0 -#define HAVE_CDIO_PARANOIA_H 0 -#define HAVE_CDIO_PARANOIA_PARANOIA_H 0 -#define HAVE_CUDA_H 0 -#define HAVE_DISPATCH_DISPATCH_H 0 -#define HAVE_DEV_BKTR_IOCTL_BT848_H 0 -#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0 -#define HAVE_DEV_IC_BT8XX_H 0 -#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0 -#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0 -#define HAVE_DIRECT_H 1 -#define HAVE_DIRENT_H 0 -#define HAVE_DXGIDEBUG_H 1 -#define HAVE_DXVA_H 1 -#define HAVE_ES2_GL_H 0 -#define HAVE_GSM_H 0 -#define HAVE_IO_H 1 -#define HAVE_LINUX_PERF_EVENT_H 0 -#define HAVE_MACHINE_IOCTL_BT848_H 0 -#define HAVE_MACHINE_IOCTL_METEOR_H 0 -#define HAVE_MALLOC_H 1 -#define HAVE_OPENCV2_CORE_CORE_C_H 0 -#define HAVE_OPENGL_GL3_H 0 -#define HAVE_POLL_H 0 -#define HAVE_SYS_PARAM_H 0 -#define HAVE_SYS_RESOURCE_H 0 -#define HAVE_SYS_SELECT_H 0 -#define HAVE_SYS_SOUNDCARD_H 0 -#define HAVE_SYS_TIME_H 0 -#define HAVE_SYS_UN_H 0 -#define HAVE_SYS_VIDEOIO_H 0 -#define HAVE_TERMIOS_H 0 -#define HAVE_UDPLITE_H 0 -#define HAVE_UNISTD_H 0 -#define HAVE_VALGRIND_VALGRIND_H 0 -#define HAVE_WINDOWS_H 1 -#define HAVE_WINSOCK2_H 0 -#define HAVE_INTRINSICS_NEON 0 -#define HAVE_ATANF 1 -#define HAVE_ATAN2F 1 -#define HAVE_CBRT 1 -#define HAVE_CBRTF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COSF 1 -#define HAVE_ERF 1 -#define HAVE_EXP2 1 -#define HAVE_EXP2F 1 -#define HAVE_EXPF 1 -#define HAVE_HYPOT 1 -#define HAVE_ISFINITE 1 -#define HAVE_ISINF 1 -#define HAVE_ISNAN 1 -#define HAVE_LDEXPF 1 -#define HAVE_LLRINT 1 -#define HAVE_LLRINTF 1 -#define HAVE_LOG2 1 -#define HAVE_LOG2F 1 -#define HAVE_LOG10F 1 -#define HAVE_LRINT 1 -#define HAVE_LRINTF 1 -#define HAVE_POWF 1 -#define HAVE_RINT 1 -#define HAVE_ROUND 1 -#define HAVE_ROUNDF 1 -#define HAVE_SINF 1 -#define HAVE_TRUNC 1 -#define HAVE_TRUNCF 1 -#define HAVE_DOS_PATHS 1 -#define HAVE_LIBC_MSVCRT 1 -#define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0 -#define HAVE_SECTION_DATA_REL_RO 0 -#define HAVE_THREADS 1 -#define HAVE_UWP 0 -#define HAVE_WINRT 0 -#define HAVE_ACCESS 1 -#define HAVE_ALIGNED_MALLOC 1 -#define HAVE_ARC4RANDOM 0 -#define HAVE_CLOCK_GETTIME 0 -#define HAVE_CLOSESOCKET 0 -#define HAVE_COMMANDLINETOARGVW 1 -#define HAVE_FCNTL 0 -#define HAVE_GETADDRINFO 0 -#define HAVE_GETHRTIME 0 -#define HAVE_GETOPT 0 -#define HAVE_GETPROCESSAFFINITYMASK 1 -#define HAVE_GETPROCESSMEMORYINFO 1 -#define HAVE_GETPROCESSTIMES 1 -#define HAVE_GETRUSAGE 0 -#define HAVE_GETSYSTEMTIMEASFILETIME 1 -#define HAVE_GETTIMEOFDAY 0 -#define HAVE_GLOB 0 -#define HAVE_GLXGETPROCADDRESS 0 -#define HAVE_GMTIME_R 0 -#define HAVE_INET_ATON 0 -#define HAVE_ISATTY 1 -#define HAVE_KBHIT 1 -#define HAVE_LOCALTIME_R 0 -#define HAVE_LSTAT 0 -#define HAVE_LZO1X_999_COMPRESS 0 -#define HAVE_MACH_ABSOLUTE_TIME 0 -#define HAVE_MAPVIEWOFFILE 1 -#define HAVE_MEMALIGN 0 -#define HAVE_MKSTEMP 0 -#define HAVE_MMAP 0 -#define HAVE_MPROTECT 0 -#define HAVE_NANOSLEEP 0 -#define HAVE_PEEKNAMEDPIPE 1 -#define HAVE_POSIX_MEMALIGN 0 -#define HAVE_PTHREAD_CANCEL 0 -#define HAVE_SCHED_GETAFFINITY 0 -#define HAVE_SECITEMIMPORT 0 -#define HAVE_SETCONSOLETEXTATTRIBUTE 1 -#define HAVE_SETCONSOLECTRLHANDLER 1 -#define HAVE_SETMODE 1 -#define HAVE_SETRLIMIT 0 -#define HAVE_SLEEP 1 -#define HAVE_STRERROR_R 0 -#define HAVE_SYSCONF 0 -#define HAVE_SYSCTL 0 -#define HAVE_USLEEP 0 -#define HAVE_UTGETOSTYPEFROMSTRING 0 -#define HAVE_VIRTUALALLOC 1 -#define HAVE_WGLGETPROCADDRESS 0 -#define HAVE_BCRYPT 1 -#define HAVE_VAAPI_DRM 0 -#define HAVE_VAAPI_X11 0 -#define HAVE_VDPAU_X11 0 -#define HAVE_PTHREADS 0 -#define HAVE_OS2THREADS 0 -#define HAVE_W32THREADS 1 -#define HAVE_AS_ARCH_DIRECTIVE 0 -#define HAVE_AS_DN_DIRECTIVE 0 -#define HAVE_AS_FPU_DIRECTIVE 0 -#define HAVE_AS_FUNC 0 -#define HAVE_AS_OBJECT_ARCH 0 -#define HAVE_ASM_MOD_Q 0 -#define HAVE_BLOCKS_EXTENSION 0 -#define HAVE_EBP_AVAILABLE 0 -#define HAVE_EBX_AVAILABLE 0 -#define HAVE_GNU_AS 0 -#define HAVE_GNU_WINDRES 0 -#define HAVE_IBM_ASM 0 -#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0 -#define HAVE_INLINE_ASM_LABELS 0 -#define HAVE_INLINE_ASM_NONLOCAL_LABELS 0 -#define HAVE_PRAGMA_DEPRECATED 1 -#define HAVE_RSYNC_CONTIMEOUT 0 -#define HAVE_SYMVER_ASM_LABEL 0 -#define HAVE_SYMVER_GNU_ASM 0 -#define HAVE_VFP_ARGS 0 -#define HAVE_XFORM_ASM 0 -#define HAVE_XMM_CLOBBERS 0 -#define HAVE_KCMVIDEOCODECTYPE_HEVC 0 -#define HAVE_SOCKLEN_T 0 -#define HAVE_STRUCT_ADDRINFO 0 -#define HAVE_STRUCT_GROUP_SOURCE_REQ 0 -#define HAVE_STRUCT_IP_MREQ_SOURCE 0 -#define HAVE_STRUCT_IPV6_MREQ 0 -#define HAVE_STRUCT_MSGHDR_MSG_FLAGS 0 -#define HAVE_STRUCT_POLLFD 0 -#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0 -#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0 -#define HAVE_STRUCT_SOCKADDR_IN6 0 -#define HAVE_STRUCT_SOCKADDR_SA_LEN 0 -#define HAVE_STRUCT_SOCKADDR_STORAGE 0 -#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0 -#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0 -#define HAVE_MAKEINFO 0 -#define HAVE_MAKEINFO_HTML 0 -#define HAVE_OPENCL_D3D11 0 -#define HAVE_OPENCL_DRM_ARM 0 -#define HAVE_OPENCL_DRM_BEIGNET 0 -#define HAVE_OPENCL_DXVA2 0 -#define HAVE_OPENCL_VAAPI_BEIGNET 0 -#define HAVE_OPENCL_VAAPI_INTEL_MEDIA 0 -#define HAVE_PERL 1 -#define HAVE_POD2MAN 0 -#define HAVE_TEXI2HTML 0 -#define CONFIG_DOC 0 -#define CONFIG_HTMLPAGES 0 -#define CONFIG_MANPAGES 0 -#define CONFIG_PODPAGES 1 -#define CONFIG_TXTPAGES 0 -#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1 -#define CONFIG_AVIO_READING_EXAMPLE 1 -#define CONFIG_DECODE_AUDIO_EXAMPLE 1 -#define CONFIG_DECODE_VIDEO_EXAMPLE 1 -#define CONFIG_DEMUXING_DECODING_EXAMPLE 1 -#define CONFIG_ENCODE_AUDIO_EXAMPLE 1 -#define CONFIG_ENCODE_VIDEO_EXAMPLE 1 -#define CONFIG_EXTRACT_MVS_EXAMPLE 1 -#define CONFIG_FILTER_AUDIO_EXAMPLE 0 -#define CONFIG_FILTERING_AUDIO_EXAMPLE 0 -#define CONFIG_FILTERING_VIDEO_EXAMPLE 0 -#define CONFIG_HTTP_MULTICLIENT_EXAMPLE 0 -#define CONFIG_HW_DECODE_EXAMPLE 1 -#define CONFIG_METADATA_EXAMPLE 1 -#define CONFIG_MUXING_EXAMPLE 1 -#define CONFIG_QSVDEC_EXAMPLE 0 -#define CONFIG_REMUXING_EXAMPLE 1 -#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 1 -#define CONFIG_SCALING_VIDEO_EXAMPLE 1 -#define CONFIG_TRANSCODE_AAC_EXAMPLE 1 -#define CONFIG_TRANSCODING_EXAMPLE 0 -#define CONFIG_VAAPI_ENCODE_EXAMPLE 0 -#define CONFIG_VAAPI_TRANSCODE_EXAMPLE 0 -#define CONFIG_AVISYNTH 0 -#define CONFIG_FREI0R 0 -#define CONFIG_LIBCDIO 0 -#define CONFIG_LIBDAVS2 0 -#define CONFIG_LIBRUBBERBAND 0 -#define CONFIG_LIBVIDSTAB 0 -#define CONFIG_LIBX264 0 -#define CONFIG_LIBX265 0 -#define CONFIG_LIBXAVS 0 -#define CONFIG_LIBXAVS2 0 -#define CONFIG_LIBXVID 0 -#define CONFIG_DECKLINK 0 -#define CONFIG_LIBNDI_NEWTEK 0 -#define CONFIG_LIBFDK_AAC 0 -#define CONFIG_OPENSSL 0 -#define CONFIG_LIBTLS 0 -#define CONFIG_GMP 0 -#define CONFIG_LIBLENSFUN 0 -#define CONFIG_LIBOPENCORE_AMRNB 0 -#define CONFIG_LIBOPENCORE_AMRWB 0 -#define CONFIG_LIBVMAF 0 -#define CONFIG_LIBVO_AMRWBENC 0 -#define CONFIG_MBEDTLS 0 -#define CONFIG_RKMPP 0 -#define CONFIG_LIBSMBCLIENT 0 -#define CONFIG_CHROMAPRINT 0 -#define CONFIG_GCRYPT 0 -#define CONFIG_GNUTLS 0 -#define CONFIG_JNI 0 -#define CONFIG_LADSPA 0 -#define CONFIG_LIBAOM 0 -#define CONFIG_LIBASS 0 -#define CONFIG_LIBBLURAY 0 -#define CONFIG_LIBBS2B 0 -#define CONFIG_LIBCACA 0 -#define CONFIG_LIBCELT 0 -#define CONFIG_LIBCODEC2 0 -#define CONFIG_LIBDAV1D 0 -#define CONFIG_LIBDC1394 0 -#define CONFIG_LIBDRM 0 -#define CONFIG_LIBFLITE 0 -#define CONFIG_LIBFONTCONFIG 0 -#define CONFIG_LIBFREETYPE 0 -#define CONFIG_LIBFRIBIDI 0 -#define CONFIG_LIBGME 0 -#define CONFIG_LIBGSM 0 -#define CONFIG_LIBIEC61883 0 -#define CONFIG_LIBILBC 0 -#define CONFIG_LIBJACK 0 -#define CONFIG_LIBKLVANC 0 -#define CONFIG_LIBKVAZAAR 0 -#define CONFIG_LIBMODPLUG 0 -#define CONFIG_LIBMP3LAME 0 -#define CONFIG_LIBMYSOFA 0 -#define CONFIG_LIBOPENCV 0 -#define CONFIG_LIBOPENH264 0 -#define CONFIG_LIBOPENJPEG 0 -#define CONFIG_LIBOPENMPT 0 -#define CONFIG_LIBOPUS 0 -#define CONFIG_LIBPULSE 0 -#define CONFIG_LIBRSVG 0 -#define CONFIG_LIBRTMP 0 -#define CONFIG_LIBSHINE 0 -#define CONFIG_LIBSMBCLIENT 0 -#define CONFIG_LIBSNAPPY 0 -#define CONFIG_LIBSOXR 0 -#define CONFIG_LIBSPEEX 0 -#define CONFIG_LIBSRT 0 -#define CONFIG_LIBSSH 0 -#define CONFIG_LIBTENSORFLOW 0 -#define CONFIG_LIBTESSERACT 0 -#define CONFIG_LIBTHEORA 0 -#define CONFIG_LIBTWOLAME 0 -#define CONFIG_LIBV4L2 0 -#define CONFIG_LIBVORBIS 0 -#define CONFIG_LIBVPX 0 -#define CONFIG_LIBWAVPACK 0 -#define CONFIG_LIBWEBP 0 -#define CONFIG_LIBXML2 0 -#define CONFIG_LIBZIMG 0 -#define CONFIG_LIBZMQ 0 -#define CONFIG_LIBZVBI 0 -#define CONFIG_LV2 0 -#define CONFIG_MEDIACODEC 0 -#define CONFIG_OPENAL 0 -#define CONFIG_OPENGL 0 -#define CONFIG_VAPOURSYNTH 0 -#define CONFIG_ALSA 0 -#define CONFIG_APPKIT 0 -#define CONFIG_AVFOUNDATION 0 -#define CONFIG_BZLIB 0 -#define CONFIG_COREIMAGE 0 -#define CONFIG_ICONV 0 -#define CONFIG_LIBXCB 0 -#define CONFIG_LIBXCB_SHM 0 -#define CONFIG_LIBXCB_SHAPE 0 -#define CONFIG_LIBXCB_XFIXES 0 -#define CONFIG_LZMA 0 -#define CONFIG_SCHANNEL 1 -#define CONFIG_SDL2 0 -#define CONFIG_SECURETRANSPORT 0 -#define CONFIG_SNDIO 0 -#define CONFIG_XLIB 0 -#define CONFIG_ZLIB 1 -#define CONFIG_CUDA_SDK 0 -#define CONFIG_LIBNPP 0 -#define CONFIG_LIBMFX 0 -#define CONFIG_MMAL 0 -#define CONFIG_OMX 0 -#define CONFIG_OPENCL 0 -#define CONFIG_AMF 0 -#define CONFIG_AUDIOTOOLBOX 0 -#define CONFIG_CRYSTALHD 0 -#define CONFIG_CUDA 0 -#define CONFIG_CUVID 0 -#define CONFIG_D3D11VA 0 -#define CONFIG_DXVA2 0 -#define CONFIG_FFNVCODEC 0 -#define CONFIG_NVDEC 0 -#define CONFIG_NVENC 0 -#define CONFIG_VAAPI 0 -#define CONFIG_VDPAU 0 -#define CONFIG_VIDEOTOOLBOX 0 -#define CONFIG_V4L2_M2M 0 -#define CONFIG_XVMC 0 -#define CONFIG_FTRAPV 0 -#define CONFIG_GRAY 0 -#define CONFIG_HARDCODED_TABLES 0 -#define CONFIG_OMX_RPI 0 -#define CONFIG_RUNTIME_CPUDETECT 1 -#define CONFIG_SAFE_BITSTREAM_READER 1 -#define CONFIG_SHARED 0 -#define CONFIG_SMALL 1 -#define CONFIG_STATIC 1 -#define CONFIG_SWSCALE_ALPHA 1 -#define CONFIG_GPL 1 -#define CONFIG_NONFREE 0 -#define CONFIG_VERSION3 0 -#define CONFIG_AVDEVICE 1 -#define CONFIG_AVFILTER 0 -#define CONFIG_SWSCALE 1 -#define CONFIG_POSTPROC 0 -#define CONFIG_AVFORMAT 1 -#define CONFIG_AVCODEC 1 -#define CONFIG_SWRESAMPLE 1 -#define CONFIG_AVRESAMPLE 0 -#define CONFIG_AVUTIL 1 -#define CONFIG_FFPLAY 0 -#define CONFIG_FFPROBE 0 -#define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 -#define CONFIG_DWT 1 -#define CONFIG_ERROR_RESILIENCE 1 -#define CONFIG_FAAN 1 -#define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 -#define CONFIG_LSP 1 -#define CONFIG_LZO 1 -#define CONFIG_MDCT 1 -#define CONFIG_PIXELUTILS 0 -#define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 -#define CONFIG_AUTODETECT 0 -#define CONFIG_FONTCONFIG 0 -#define CONFIG_LINUX_PERF 0 -#define CONFIG_MEMORY_POISONING 0 -#define CONFIG_NEON_CLOBBER_TEST 0 -#define CONFIG_OSSFUZZ 0 -#define CONFIG_PIC 0 -#define CONFIG_THUMB 0 -#define CONFIG_VALGRIND_BACKTRACE 0 -#define CONFIG_XMM_CLOBBER_TEST 0 -#define CONFIG_BSFS 1 -#define CONFIG_DECODERS 1 -#define CONFIG_ENCODERS 0 -#define CONFIG_HWACCELS 0 -#define CONFIG_PARSERS 1 -#define CONFIG_INDEVS 0 -#define CONFIG_OUTDEVS 0 -#define CONFIG_FILTERS 0 -#define CONFIG_DEMUXERS 1 -#define CONFIG_MUXERS 0 -#define CONFIG_PROTOCOLS 1 -#define CONFIG_AANDCTTABLES 1 -#define CONFIG_AC3DSP 1 -#define CONFIG_ADTS_HEADER 1 -#define CONFIG_AUDIO_FRAME_QUEUE 1 -#define CONFIG_AUDIODSP 1 -#define CONFIG_BLOCKDSP 1 -#define CONFIG_BSWAPDSP 1 -#define CONFIG_CABAC 1 -#define CONFIG_CBS 1 -#define CONFIG_CBS_AV1 1 -#define CONFIG_CBS_H264 1 -#define CONFIG_CBS_H265 1 -#define CONFIG_CBS_JPEG 0 -#define CONFIG_CBS_MPEG2 1 -#define CONFIG_CBS_VP9 1 -#define CONFIG_DIRAC_PARSE 1 -#define CONFIG_DNN 0 -#define CONFIG_DVPROFILE 1 -#define CONFIG_EXIF 1 -#define CONFIG_FAANDCT 1 -#define CONFIG_FAANIDCT 1 -#define CONFIG_FDCTDSP 1 -#define CONFIG_FLACDSP 1 -#define CONFIG_FMTCONVERT 1 -#define CONFIG_FRAME_THREAD_ENCODER 0 -#define CONFIG_G722DSP 1 -#define CONFIG_GOLOMB 1 -#define CONFIG_GPLV3 0 -#define CONFIG_H263DSP 1 -#define CONFIG_H264CHROMA 1 -#define CONFIG_H264DSP 1 -#define CONFIG_H264PARSE 1 -#define CONFIG_H264PRED 1 -#define CONFIG_H264QPEL 1 -#define CONFIG_HEVCPARSE 1 -#define CONFIG_HPELDSP 1 -#define CONFIG_HUFFMAN 1 -#define CONFIG_HUFFYUVDSP 1 -#define CONFIG_HUFFYUVENCDSP 0 -#define CONFIG_IDCTDSP 1 -#define CONFIG_IIRFILTER 0 -#define CONFIG_MDCT15 1 -#define CONFIG_INTRAX8 1 -#define CONFIG_ISO_MEDIA 1 -#define CONFIG_IVIDSP 0 -#define CONFIG_JPEGTABLES 1 -#define CONFIG_LGPLV3 0 -#define CONFIG_LIBX262 0 -#define CONFIG_LLAUDDSP 1 -#define CONFIG_LLVIDDSP 1 -#define CONFIG_LLVIDENCDSP 0 -#define CONFIG_LPC 0 -#define CONFIG_LZF 1 -#define CONFIG_ME_CMP 1 -#define CONFIG_MPEG_ER 1 -#define CONFIG_MPEGAUDIO 1 -#define CONFIG_MPEGAUDIODSP 1 -#define CONFIG_MPEGAUDIOHEADER 1 -#define CONFIG_MPEGVIDEO 1 -#define CONFIG_MPEGVIDEOENC 1 -#define CONFIG_MSS34DSP 1 -#define CONFIG_PIXBLOCKDSP 1 -#define CONFIG_QPELDSP 1 -#define CONFIG_QSV 0 -#define CONFIG_QSVDEC 0 -#define CONFIG_QSVENC 0 -#define CONFIG_QSVVPP 0 -#define CONFIG_RANGECODER 1 -#define CONFIG_RIFFDEC 1 -#define CONFIG_RIFFENC 0 -#define CONFIG_RTPDEC 0 -#define CONFIG_RTPENC_CHAIN 0 -#define CONFIG_RV34DSP 1 -#define CONFIG_SCENE_SAD 0 -#define CONFIG_SINEWIN 1 -#define CONFIG_SNAPPY 1 -#define CONFIG_SRTP 0 -#define CONFIG_STARTCODE 1 -#define CONFIG_TEXTUREDSP 1 -#define CONFIG_TEXTUREDSPENC 0 -#define CONFIG_TPELDSP 1 -#define CONFIG_VAAPI_1 0 -#define CONFIG_VAAPI_ENCODE 0 -#define CONFIG_VC1DSP 1 -#define CONFIG_VIDEODSP 1 -#define CONFIG_VP3DSP 1 -#define CONFIG_VP56DSP 1 -#define CONFIG_VP8DSP 1 -#define CONFIG_WMA_FREQS 1 -#define CONFIG_WMV2DSP 1 -#define CONFIG_AAC_ADTSTOASC_BSF 1 -#define CONFIG_AV1_METADATA_BSF 1 -#define CONFIG_CHOMP_BSF 1 -#define CONFIG_DUMP_EXTRADATA_BSF 1 -#define CONFIG_DCA_CORE_BSF 1 -#define CONFIG_EAC3_CORE_BSF 1 -#define CONFIG_EXTRACT_EXTRADATA_BSF 1 -#define CONFIG_FILTER_UNITS_BSF 1 -#define CONFIG_H264_METADATA_BSF 1 -#define CONFIG_H264_MP4TOANNEXB_BSF 1 -#define CONFIG_H264_REDUNDANT_PPS_BSF 1 -#define CONFIG_HAPQA_EXTRACT_BSF 1 -#define CONFIG_HEVC_METADATA_BSF 1 -#define CONFIG_HEVC_MP4TOANNEXB_BSF 1 -#define CONFIG_IMX_DUMP_HEADER_BSF 1 -#define CONFIG_MJPEG2JPEG_BSF 1 -#define CONFIG_MJPEGA_DUMP_HEADER_BSF 1 -#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 1 -#define CONFIG_MPEG2_METADATA_BSF 1 -#define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 1 -#define CONFIG_MOV2TEXTSUB_BSF 1 -#define CONFIG_NOISE_BSF 1 -#define CONFIG_NULL_BSF 1 -#define CONFIG_PRORES_METADATA_BSF 1 -#define CONFIG_REMOVE_EXTRADATA_BSF 1 -#define CONFIG_TEXT2MOVSUB_BSF 1 -#define CONFIG_TRACE_HEADERS_BSF 1 -#define CONFIG_VP9_METADATA_BSF 1 -#define CONFIG_VP9_RAW_REORDER_BSF 1 -#define CONFIG_VP9_SUPERFRAME_BSF 1 -#define CONFIG_VP9_SUPERFRAME_SPLIT_BSF 1 -#define CONFIG_AASC_DECODER 1 -#define CONFIG_AIC_DECODER 1 -#define CONFIG_ALIAS_PIX_DECODER 1 -#define CONFIG_AMV_DECODER 1 -#define CONFIG_ANM_DECODER 1 -#define CONFIG_ANSI_DECODER 1 -#define CONFIG_APNG_DECODER 1 -#define CONFIG_ASV1_DECODER 1 -#define CONFIG_ASV2_DECODER 1 -#define CONFIG_AURA_DECODER 1 -#define CONFIG_AURA2_DECODER 1 -#define CONFIG_AVRP_DECODER 1 -#define CONFIG_AVRN_DECODER 1 -#define CONFIG_AVS_DECODER 1 -#define CONFIG_AVUI_DECODER 1 -#define CONFIG_AYUV_DECODER 1 -#define CONFIG_BETHSOFTVID_DECODER 1 -#define CONFIG_BFI_DECODER 1 -#define CONFIG_BINK_DECODER 1 -#define CONFIG_BITPACKED_DECODER 1 -#define CONFIG_BMP_DECODER 1 -#define CONFIG_BMV_VIDEO_DECODER 1 -#define CONFIG_BRENDER_PIX_DECODER 1 -#define CONFIG_C93_DECODER 1 -#define CONFIG_CAVS_DECODER 1 -#define CONFIG_CDGRAPHICS_DECODER 1 -#define CONFIG_CDXL_DECODER 1 -#define CONFIG_CFHD_DECODER 1 -#define CONFIG_CINEPAK_DECODER 1 -#define CONFIG_CLEARVIDEO_DECODER 1 -#define CONFIG_CLJR_DECODER 1 -#define CONFIG_CLLC_DECODER 1 -#define CONFIG_COMFORTNOISE_DECODER 1 -#define CONFIG_CPIA_DECODER 1 -#define CONFIG_CSCD_DECODER 1 -#define CONFIG_CYUV_DECODER 1 -#define CONFIG_DDS_DECODER 1 -#define CONFIG_DFA_DECODER 1 -#define CONFIG_DIRAC_DECODER 1 -#define CONFIG_DNXHD_DECODER 1 -#define CONFIG_DPX_DECODER 1 -#define CONFIG_DSICINVIDEO_DECODER 1 -#define CONFIG_DVAUDIO_DECODER 1 -#define CONFIG_DVVIDEO_DECODER 1 -#define CONFIG_DXA_DECODER 1 -#define CONFIG_DXTORY_DECODER 1 -#define CONFIG_DXV_DECODER 1 -#define CONFIG_EACMV_DECODER 1 -#define CONFIG_EAMAD_DECODER 1 -#define CONFIG_EATGQ_DECODER 1 -#define CONFIG_EATGV_DECODER 1 -#define CONFIG_EATQI_DECODER 1 -#define CONFIG_EIGHTBPS_DECODER 1 -#define CONFIG_EIGHTSVX_EXP_DECODER 1 -#define CONFIG_EIGHTSVX_FIB_DECODER 1 -#define CONFIG_ESCAPE124_DECODER 1 -#define CONFIG_ESCAPE130_DECODER 1 -#define CONFIG_EXR_DECODER 1 -#define CONFIG_FFV1_DECODER 1 -#define CONFIG_FFVHUFF_DECODER 1 -#define CONFIG_FIC_DECODER 1 -#define CONFIG_FITS_DECODER 1 -#define CONFIG_FLASHSV_DECODER 1 -#define CONFIG_FLASHSV2_DECODER 1 -#define CONFIG_FLIC_DECODER 1 -#define CONFIG_FLV_DECODER 1 -#define CONFIG_FMVC_DECODER 1 -#define CONFIG_FOURXM_DECODER 1 -#define CONFIG_FRAPS_DECODER 1 -#define CONFIG_FRWU_DECODER 1 -#define CONFIG_G2M_DECODER 1 -#define CONFIG_GDV_DECODER 1 -#define CONFIG_GIF_DECODER 1 -#define CONFIG_H261_DECODER 1 -#define CONFIG_H263_DECODER 1 -#define CONFIG_H263I_DECODER 1 -#define CONFIG_H263P_DECODER 1 -#define CONFIG_H263_V4L2M2M_DECODER 0 -#define CONFIG_H264_DECODER 1 -#define CONFIG_H264_CRYSTALHD_DECODER 0 -#define CONFIG_H264_V4L2M2M_DECODER 0 -#define CONFIG_H264_MEDIACODEC_DECODER 0 -#define CONFIG_H264_MMAL_DECODER 0 -#define CONFIG_H264_QSV_DECODER 0 -#define CONFIG_H264_RKMPP_DECODER 0 -#define CONFIG_HAP_DECODER 1 -#define CONFIG_HEVC_DECODER 1 -#define CONFIG_HEVC_QSV_DECODER 0 -#define CONFIG_HEVC_RKMPP_DECODER 0 -#define CONFIG_HEVC_V4L2M2M_DECODER 0 -#define CONFIG_HNM4_VIDEO_DECODER 1 -#define CONFIG_HQ_HQA_DECODER 1 -#define CONFIG_HQX_DECODER 1 -#define CONFIG_HUFFYUV_DECODER 1 -#define CONFIG_IDCIN_DECODER 1 -#define CONFIG_IFF_ILBM_DECODER 1 -#define CONFIG_IMM4_DECODER 1 -#define CONFIG_INDEO2_DECODER 0 -#define CONFIG_INDEO3_DECODER 0 -#define CONFIG_INDEO4_DECODER 0 -#define CONFIG_INDEO5_DECODER 0 -#define CONFIG_INTERPLAY_VIDEO_DECODER 1 -#define CONFIG_JPEG2000_DECODER 1 -#define CONFIG_JPEGLS_DECODER 1 -#define CONFIG_JV_DECODER 1 -#define CONFIG_KGV1_DECODER 1 -#define CONFIG_KMVC_DECODER 1 -#define CONFIG_LAGARITH_DECODER 1 -#define CONFIG_LOCO_DECODER 1 -#define CONFIG_M101_DECODER 1 -#define CONFIG_MAGICYUV_DECODER 1 -#define CONFIG_MDEC_DECODER 1 -#define CONFIG_MIMIC_DECODER 1 -#define CONFIG_MJPEG_DECODER 1 -#define CONFIG_MJPEGB_DECODER 1 -#define CONFIG_MMVIDEO_DECODER 1 -#define CONFIG_MOTIONPIXELS_DECODER 1 -#define CONFIG_MPEG1VIDEO_DECODER 1 -#define CONFIG_MPEG2VIDEO_DECODER 1 -#define CONFIG_MPEG4_DECODER 1 -#define CONFIG_MPEG4_CRYSTALHD_DECODER 0 -#define CONFIG_MPEG4_V4L2M2M_DECODER 0 -#define CONFIG_MPEG4_MMAL_DECODER 0 -#define CONFIG_MPEGVIDEO_DECODER 1 -#define CONFIG_MPEG1_V4L2M2M_DECODER 0 -#define CONFIG_MPEG2_MMAL_DECODER 0 -#define CONFIG_MPEG2_CRYSTALHD_DECODER 0 -#define CONFIG_MPEG2_V4L2M2M_DECODER 0 -#define CONFIG_MPEG2_QSV_DECODER 0 -#define CONFIG_MPEG2_MEDIACODEC_DECODER 0 -#define CONFIG_MSA1_DECODER 1 -#define CONFIG_MSCC_DECODER 1 -#define CONFIG_MSMPEG4V1_DECODER 1 -#define CONFIG_MSMPEG4V2_DECODER 1 -#define CONFIG_MSMPEG4V3_DECODER 1 -#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0 -#define CONFIG_MSRLE_DECODER 1 -#define CONFIG_MSS1_DECODER 1 -#define CONFIG_MSS2_DECODER 1 -#define CONFIG_MSVIDEO1_DECODER 1 -#define CONFIG_MSZH_DECODER 1 -#define CONFIG_MTS2_DECODER 1 -#define CONFIG_MVC1_DECODER 1 -#define CONFIG_MVC2_DECODER 1 -#define CONFIG_MWSC_DECODER 1 -#define CONFIG_MXPEG_DECODER 1 -#define CONFIG_NUV_DECODER 1 -#define CONFIG_PAF_VIDEO_DECODER 1 -#define CONFIG_PAM_DECODER 1 -#define CONFIG_PBM_DECODER 1 -#define CONFIG_PCX_DECODER 1 -#define CONFIG_PGM_DECODER 1 -#define CONFIG_PGMYUV_DECODER 1 -#define CONFIG_PICTOR_DECODER 1 -#define CONFIG_PIXLET_DECODER 1 -#define CONFIG_PNG_DECODER 1 -#define CONFIG_PPM_DECODER 1 -#define CONFIG_PRORES_DECODER 1 -#define CONFIG_PROSUMER_DECODER 1 -#define CONFIG_PSD_DECODER 1 -#define CONFIG_PTX_DECODER 1 -#define CONFIG_QDRAW_DECODER 1 -#define CONFIG_QPEG_DECODER 1 -#define CONFIG_QTRLE_DECODER 1 -#define CONFIG_R10K_DECODER 1 -#define CONFIG_R210_DECODER 1 -#define CONFIG_RASC_DECODER 1 -#define CONFIG_RAWVIDEO_DECODER 1 -#define CONFIG_RL2_DECODER 1 -#define CONFIG_ROQ_DECODER 1 -#define CONFIG_RPZA_DECODER 1 -#define CONFIG_RSCC_DECODER 1 -#define CONFIG_RV10_DECODER 1 -#define CONFIG_RV20_DECODER 1 -#define CONFIG_RV30_DECODER 1 -#define CONFIG_RV40_DECODER 1 -#define CONFIG_S302M_DECODER 1 -#define CONFIG_SANM_DECODER 1 -#define CONFIG_SCPR_DECODER 1 -#define CONFIG_SCREENPRESSO_DECODER 1 -#define CONFIG_SDX2_DPCM_DECODER 1 -#define CONFIG_SGI_DECODER 1 -#define CONFIG_SGIRLE_DECODER 1 -#define CONFIG_SHEERVIDEO_DECODER 1 -#define CONFIG_SMACKER_DECODER 1 -#define CONFIG_SMC_DECODER 1 -#define CONFIG_SMVJPEG_DECODER 1 -#define CONFIG_SNOW_DECODER 1 -#define CONFIG_SP5X_DECODER 1 -#define CONFIG_SPEEDHQ_DECODER 1 -#define CONFIG_SRGC_DECODER 1 -#define CONFIG_SUNRAST_DECODER 1 -#define CONFIG_SVQ1_DECODER 1 -#define CONFIG_SVQ3_DECODER 1 -#define CONFIG_TARGA_DECODER 1 -#define CONFIG_TARGA_Y216_DECODER 1 -#define CONFIG_TDSC_DECODER 1 -#define CONFIG_THEORA_DECODER 1 -#define CONFIG_THP_DECODER 1 -#define CONFIG_TIERTEXSEQVIDEO_DECODER 1 -#define CONFIG_TIFF_DECODER 1 -#define CONFIG_TMV_DECODER 1 -#define CONFIG_TRUEMOTION1_DECODER 1 -#define CONFIG_TRUEMOTION2_DECODER 1 -#define CONFIG_TRUEMOTION2RT_DECODER 1 -#define CONFIG_TSCC_DECODER 1 -#define CONFIG_TSCC2_DECODER 1 -#define CONFIG_TXD_DECODER 1 -#define CONFIG_ULTI_DECODER 1 -#define CONFIG_UTVIDEO_DECODER 1 -#define CONFIG_V210_DECODER 1 -#define CONFIG_V210X_DECODER 1 -#define CONFIG_V308_DECODER 1 -#define CONFIG_V408_DECODER 1 -#define CONFIG_V410_DECODER 1 -#define CONFIG_VB_DECODER 1 -#define CONFIG_VBLE_DECODER 1 -#define CONFIG_VC1_DECODER 1 -#define CONFIG_VC1_CRYSTALHD_DECODER 0 -#define CONFIG_VC1IMAGE_DECODER 1 -#define CONFIG_VC1_MMAL_DECODER 0 -#define CONFIG_VC1_QSV_DECODER 0 -#define CONFIG_VC1_V4L2M2M_DECODER 0 -#define CONFIG_VCR1_DECODER 1 -#define CONFIG_VMDVIDEO_DECODER 1 -#define CONFIG_VMNC_DECODER 1 -#define CONFIG_VP3_DECODER 1 -#define CONFIG_VP5_DECODER 1 -#define CONFIG_VP6_DECODER 1 -#define CONFIG_VP6A_DECODER 1 -#define CONFIG_VP6F_DECODER 1 -#define CONFIG_VP7_DECODER 1 -#define CONFIG_VP8_DECODER 1 -#define CONFIG_VP8_RKMPP_DECODER 0 -#define CONFIG_VP8_V4L2M2M_DECODER 0 -#define CONFIG_VP9_DECODER 1 -#define CONFIG_VP9_RKMPP_DECODER 0 -#define CONFIG_VP9_V4L2M2M_DECODER 0 -#define CONFIG_VQA_DECODER 1 -#define CONFIG_WEBP_DECODER 1 -#define CONFIG_WCMV_DECODER 1 -#define CONFIG_WRAPPED_AVFRAME_DECODER 1 -#define CONFIG_WMV1_DECODER 1 -#define CONFIG_WMV2_DECODER 1 -#define CONFIG_WMV3_DECODER 1 -#define CONFIG_WMV3_CRYSTALHD_DECODER 0 -#define CONFIG_WMV3IMAGE_DECODER 1 -#define CONFIG_WNV1_DECODER 1 -#define CONFIG_XAN_WC3_DECODER 1 -#define CONFIG_XAN_WC4_DECODER 1 -#define CONFIG_XBM_DECODER 1 -#define CONFIG_XFACE_DECODER 1 -#define CONFIG_XL_DECODER 1 -#define CONFIG_XPM_DECODER 1 -#define CONFIG_XWD_DECODER 1 -#define CONFIG_Y41P_DECODER 1 -#define CONFIG_YLC_DECODER 1 -#define CONFIG_YOP_DECODER 1 -#define CONFIG_YUV4_DECODER 1 -#define CONFIG_ZERO12V_DECODER 1 -#define CONFIG_ZEROCODEC_DECODER 1 -#define CONFIG_ZLIB_DECODER 1 -#define CONFIG_ZMBV_DECODER 1 -#define CONFIG_AAC_DECODER 1 -#define CONFIG_AAC_FIXED_DECODER 1 -#define CONFIG_AAC_LATM_DECODER 1 -#define CONFIG_AC3_DECODER 1 -#define CONFIG_AC3_FIXED_DECODER 1 -#define CONFIG_ALAC_DECODER 1 -#define CONFIG_ALS_DECODER 1 -#define CONFIG_AMRNB_DECODER 1 -#define CONFIG_AMRWB_DECODER 1 -#define CONFIG_APE_DECODER 1 -#define CONFIG_APTX_DECODER 1 -#define CONFIG_APTX_HD_DECODER 1 -#define CONFIG_ATRAC1_DECODER 1 -#define CONFIG_ATRAC3_DECODER 1 -#define CONFIG_ATRAC3AL_DECODER 1 -#define CONFIG_ATRAC3P_DECODER 0 -#define CONFIG_ATRAC3PAL_DECODER 1 -#define CONFIG_ATRAC9_DECODER 1 -#define CONFIG_BINKAUDIO_DCT_DECODER 1 -#define CONFIG_BINKAUDIO_RDFT_DECODER 1 -#define CONFIG_BMV_AUDIO_DECODER 1 -#define CONFIG_COOK_DECODER 1 -#define CONFIG_DCA_DECODER 1 -#define CONFIG_DOLBY_E_DECODER 1 -#define CONFIG_DSD_LSBF_DECODER 1 -#define CONFIG_DSD_MSBF_DECODER 1 -#define CONFIG_DSD_LSBF_PLANAR_DECODER 1 -#define CONFIG_DSD_MSBF_PLANAR_DECODER 1 -#define CONFIG_DSICINAUDIO_DECODER 1 -#define CONFIG_DSS_SP_DECODER 1 -#define CONFIG_DST_DECODER 1 -#define CONFIG_EAC3_DECODER 1 -#define CONFIG_EVRC_DECODER 1 -#define CONFIG_FFWAVESYNTH_DECODER 1 -#define CONFIG_FLAC_DECODER 1 -#define CONFIG_G723_1_DECODER 1 -#define CONFIG_G729_DECODER 1 -#define CONFIG_GSM_DECODER 1 -#define CONFIG_GSM_MS_DECODER 1 -#define CONFIG_IAC_DECODER 1 -#define CONFIG_ILBC_DECODER 1 -#define CONFIG_IMC_DECODER 1 -#define CONFIG_INTERPLAY_ACM_DECODER 1 -#define CONFIG_MACE3_DECODER 1 -#define CONFIG_MACE6_DECODER 1 -#define CONFIG_METASOUND_DECODER 1 -#define CONFIG_MLP_DECODER 1 -#define CONFIG_MP1_DECODER 1 -#define CONFIG_MP1FLOAT_DECODER 1 -#define CONFIG_MP2_DECODER 1 -#define CONFIG_MP2FLOAT_DECODER 1 -#define CONFIG_MP3FLOAT_DECODER 1 -#define CONFIG_MP3_DECODER 1 -#define CONFIG_MP3ADUFLOAT_DECODER 1 -#define CONFIG_MP3ADU_DECODER 1 -#define CONFIG_MP3ON4FLOAT_DECODER 1 -#define CONFIG_MP3ON4_DECODER 1 -#define CONFIG_MPC7_DECODER 1 -#define CONFIG_MPC8_DECODER 1 -#define CONFIG_NELLYMOSER_DECODER 1 -#define CONFIG_ON2AVC_DECODER 1 -#define CONFIG_OPUS_DECODER 1 -#define CONFIG_PAF_AUDIO_DECODER 1 -#define CONFIG_QCELP_DECODER 1 -#define CONFIG_QDM2_DECODER 1 -#define CONFIG_QDMC_DECODER 1 -#define CONFIG_RA_144_DECODER 1 -#define CONFIG_RA_288_DECODER 1 -#define CONFIG_RALF_DECODER 1 -#define CONFIG_SBC_DECODER 1 -#define CONFIG_SHORTEN_DECODER 1 -#define CONFIG_SIPR_DECODER 1 -#define CONFIG_SMACKAUD_DECODER 1 -#define CONFIG_SONIC_DECODER 1 -#define CONFIG_TAK_DECODER 1 -#define CONFIG_TRUEHD_DECODER 1 -#define CONFIG_TRUESPEECH_DECODER 1 -#define CONFIG_TTA_DECODER 1 -#define CONFIG_TWINVQ_DECODER 0 -#define CONFIG_VMDAUDIO_DECODER 1 -#define CONFIG_VORBIS_DECODER 1 -#define CONFIG_WAVPACK_DECODER 1 -#define CONFIG_WMALOSSLESS_DECODER 1 -#define CONFIG_WMAPRO_DECODER 1 -#define CONFIG_WMAV1_DECODER 1 -#define CONFIG_WMAV2_DECODER 1 -#define CONFIG_WMAVOICE_DECODER 1 -#define CONFIG_WS_SND1_DECODER 1 -#define CONFIG_XMA1_DECODER 1 -#define CONFIG_XMA2_DECODER 1 -#define CONFIG_PCM_ALAW_DECODER 1 -#define CONFIG_PCM_BLURAY_DECODER 1 -#define CONFIG_PCM_DVD_DECODER 1 -#define CONFIG_PCM_F16LE_DECODER 1 -#define CONFIG_PCM_F24LE_DECODER 1 -#define CONFIG_PCM_F32BE_DECODER 1 -#define CONFIG_PCM_F32LE_DECODER 1 -#define CONFIG_PCM_F64BE_DECODER 1 -#define CONFIG_PCM_F64LE_DECODER 1 -#define CONFIG_PCM_LXF_DECODER 1 -#define CONFIG_PCM_MULAW_DECODER 1 -#define CONFIG_PCM_S8_DECODER 1 -#define CONFIG_PCM_S8_PLANAR_DECODER 1 -#define CONFIG_PCM_S16BE_DECODER 1 -#define CONFIG_PCM_S16BE_PLANAR_DECODER 1 -#define CONFIG_PCM_S16LE_DECODER 1 -#define CONFIG_PCM_S16LE_PLANAR_DECODER 1 -#define CONFIG_PCM_S24BE_DECODER 1 -#define CONFIG_PCM_S24DAUD_DECODER 1 -#define CONFIG_PCM_S24LE_DECODER 1 -#define CONFIG_PCM_S24LE_PLANAR_DECODER 1 -#define CONFIG_PCM_S32BE_DECODER 1 -#define CONFIG_PCM_S32LE_DECODER 1 -#define CONFIG_PCM_S32LE_PLANAR_DECODER 1 -#define CONFIG_PCM_S64BE_DECODER 1 -#define CONFIG_PCM_S64LE_DECODER 1 -#define CONFIG_PCM_U8_DECODER 1 -#define CONFIG_PCM_U16BE_DECODER 1 -#define CONFIG_PCM_U16LE_DECODER 1 -#define CONFIG_PCM_U24BE_DECODER 1 -#define CONFIG_PCM_U24LE_DECODER 1 -#define CONFIG_PCM_U32BE_DECODER 1 -#define CONFIG_PCM_U32LE_DECODER 1 -#define CONFIG_PCM_VIDC_DECODER 1 -#define CONFIG_PCM_ZORK_DECODER 1 -#define CONFIG_GREMLIN_DPCM_DECODER 1 -#define CONFIG_INTERPLAY_DPCM_DECODER 1 -#define CONFIG_ROQ_DPCM_DECODER 1 -#define CONFIG_SOL_DPCM_DECODER 1 -#define CONFIG_XAN_DPCM_DECODER 1 -#define CONFIG_ADPCM_4XM_DECODER 1 -#define CONFIG_ADPCM_ADX_DECODER 1 -#define CONFIG_ADPCM_AFC_DECODER 1 -#define CONFIG_ADPCM_AICA_DECODER 1 -#define CONFIG_ADPCM_CT_DECODER 1 -#define CONFIG_ADPCM_DTK_DECODER 1 -#define CONFIG_ADPCM_EA_DECODER 1 -#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 1 -#define CONFIG_ADPCM_EA_R1_DECODER 1 -#define CONFIG_ADPCM_EA_R2_DECODER 1 -#define CONFIG_ADPCM_EA_R3_DECODER 1 -#define CONFIG_ADPCM_EA_XAS_DECODER 1 -#define CONFIG_ADPCM_G722_DECODER 1 -#define CONFIG_ADPCM_G726_DECODER 1 -#define CONFIG_ADPCM_G726LE_DECODER 1 -#define CONFIG_ADPCM_IMA_AMV_DECODER 1 -#define CONFIG_ADPCM_IMA_APC_DECODER 1 -#define CONFIG_ADPCM_IMA_DAT4_DECODER 1 -#define CONFIG_ADPCM_IMA_DK3_DECODER 1 -#define CONFIG_ADPCM_IMA_DK4_DECODER 1 -#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 1 -#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 1 -#define CONFIG_ADPCM_IMA_ISS_DECODER 1 -#define CONFIG_ADPCM_IMA_OKI_DECODER 1 -#define CONFIG_ADPCM_IMA_QT_DECODER 1 -#define CONFIG_ADPCM_IMA_RAD_DECODER 1 -#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 1 -#define CONFIG_ADPCM_IMA_WAV_DECODER 1 -#define CONFIG_ADPCM_IMA_WS_DECODER 1 -#define CONFIG_ADPCM_MS_DECODER 1 -#define CONFIG_ADPCM_MTAF_DECODER 1 -#define CONFIG_ADPCM_PSX_DECODER 1 -#define CONFIG_ADPCM_SBPRO_2_DECODER 1 -#define CONFIG_ADPCM_SBPRO_3_DECODER 1 -#define CONFIG_ADPCM_SBPRO_4_DECODER 1 -#define CONFIG_ADPCM_SWF_DECODER 1 -#define CONFIG_ADPCM_THP_DECODER 1 -#define CONFIG_ADPCM_THP_LE_DECODER 1 -#define CONFIG_ADPCM_VIMA_DECODER 1 -#define CONFIG_ADPCM_XA_DECODER 1 -#define CONFIG_ADPCM_YAMAHA_DECODER 1 -#define CONFIG_SSA_DECODER 1 -#define CONFIG_ASS_DECODER 1 -#define CONFIG_CCAPTION_DECODER 1 -#define CONFIG_DVBSUB_DECODER 1 -#define CONFIG_DVDSUB_DECODER 1 -#define CONFIG_JACOSUB_DECODER 1 -#define CONFIG_MICRODVD_DECODER 1 -#define CONFIG_MOVTEXT_DECODER 1 -#define CONFIG_MPL2_DECODER 1 -#define CONFIG_PGSSUB_DECODER 1 -#define CONFIG_PJS_DECODER 1 -#define CONFIG_REALTEXT_DECODER 1 -#define CONFIG_SAMI_DECODER 1 -#define CONFIG_SRT_DECODER 1 -#define CONFIG_STL_DECODER 1 -#define CONFIG_SUBRIP_DECODER 1 -#define CONFIG_SUBVIEWER_DECODER 1 -#define CONFIG_SUBVIEWER1_DECODER 1 -#define CONFIG_TEXT_DECODER 1 -#define CONFIG_VPLAYER_DECODER 1 -#define CONFIG_WEBVTT_DECODER 1 -#define CONFIG_XSUB_DECODER 1 -#define CONFIG_AAC_AT_DECODER 0 -#define CONFIG_AC3_AT_DECODER 0 -#define CONFIG_ADPCM_IMA_QT_AT_DECODER 0 -#define CONFIG_ALAC_AT_DECODER 0 -#define CONFIG_AMR_NB_AT_DECODER 0 -#define CONFIG_EAC3_AT_DECODER 0 -#define CONFIG_GSM_MS_AT_DECODER 0 -#define CONFIG_ILBC_AT_DECODER 0 -#define CONFIG_MP1_AT_DECODER 0 -#define CONFIG_MP2_AT_DECODER 0 -#define CONFIG_MP3_AT_DECODER 0 -#define CONFIG_PCM_ALAW_AT_DECODER 0 -#define CONFIG_PCM_MULAW_AT_DECODER 0 -#define CONFIG_QDMC_AT_DECODER 0 -#define CONFIG_QDM2_AT_DECODER 0 -#define CONFIG_LIBAOM_AV1_DECODER 0 -#define CONFIG_LIBCELT_DECODER 0 -#define CONFIG_LIBCODEC2_DECODER 0 -#define CONFIG_LIBDAV1D_DECODER 0 -#define CONFIG_LIBDAVS2_DECODER 0 -#define CONFIG_LIBFDK_AAC_DECODER 0 -#define CONFIG_LIBGSM_DECODER 0 -#define CONFIG_LIBGSM_MS_DECODER 0 -#define CONFIG_LIBILBC_DECODER 0 -#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0 -#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0 -#define CONFIG_LIBOPENJPEG_DECODER 0 -#define CONFIG_LIBOPUS_DECODER 0 -#define CONFIG_LIBRSVG_DECODER 0 -#define CONFIG_LIBSPEEX_DECODER 0 -#define CONFIG_LIBVORBIS_DECODER 0 -#define CONFIG_LIBVPX_VP8_DECODER 0 -#define CONFIG_LIBVPX_VP9_DECODER 0 -#define CONFIG_LIBZVBI_TELETEXT_DECODER 0 -#define CONFIG_BINTEXT_DECODER 1 -#define CONFIG_XBIN_DECODER 1 -#define CONFIG_IDF_DECODER 1 -#define CONFIG_LIBOPENH264_DECODER 0 -#define CONFIG_H264_CUVID_DECODER 0 -#define CONFIG_HEVC_CUVID_DECODER 0 -#define CONFIG_HEVC_MEDIACODEC_DECODER 0 -#define CONFIG_MJPEG_CUVID_DECODER 0 -#define CONFIG_MPEG1_CUVID_DECODER 0 -#define CONFIG_MPEG2_CUVID_DECODER 0 -#define CONFIG_MPEG4_CUVID_DECODER 0 -#define CONFIG_MPEG4_MEDIACODEC_DECODER 0 -#define CONFIG_VC1_CUVID_DECODER 0 -#define CONFIG_VP8_CUVID_DECODER 0 -#define CONFIG_VP8_MEDIACODEC_DECODER 0 -#define CONFIG_VP8_QSV_DECODER 0 -#define CONFIG_VP9_CUVID_DECODER 0 -#define CONFIG_VP9_MEDIACODEC_DECODER 0 -#define CONFIG_A64MULTI_ENCODER 0 -#define CONFIG_A64MULTI5_ENCODER 0 -#define CONFIG_ALIAS_PIX_ENCODER 0 -#define CONFIG_AMV_ENCODER 0 -#define CONFIG_APNG_ENCODER 0 -#define CONFIG_ASV1_ENCODER 0 -#define CONFIG_ASV2_ENCODER 0 -#define CONFIG_AVRP_ENCODER 0 -#define CONFIG_AVUI_ENCODER 0 -#define CONFIG_AYUV_ENCODER 0 -#define CONFIG_BMP_ENCODER 0 -#define CONFIG_CINEPAK_ENCODER 0 -#define CONFIG_CLJR_ENCODER 0 -#define CONFIG_COMFORTNOISE_ENCODER 0 -#define CONFIG_DNXHD_ENCODER 0 -#define CONFIG_DPX_ENCODER 0 -#define CONFIG_DVVIDEO_ENCODER 0 -#define CONFIG_FFV1_ENCODER 0 -#define CONFIG_FFVHUFF_ENCODER 0 -#define CONFIG_FITS_ENCODER 0 -#define CONFIG_FLASHSV_ENCODER 0 -#define CONFIG_FLASHSV2_ENCODER 0 -#define CONFIG_FLV_ENCODER 0 -#define CONFIG_GIF_ENCODER 0 -#define CONFIG_H261_ENCODER 0 -#define CONFIG_H263_ENCODER 0 -#define CONFIG_H263P_ENCODER 0 -#define CONFIG_HAP_ENCODER 0 -#define CONFIG_HUFFYUV_ENCODER 0 -#define CONFIG_JPEG2000_ENCODER 0 -#define CONFIG_JPEGLS_ENCODER 0 -#define CONFIG_LJPEG_ENCODER 0 -#define CONFIG_MAGICYUV_ENCODER 0 -#define CONFIG_MJPEG_ENCODER 0 -#define CONFIG_MPEG1VIDEO_ENCODER 0 -#define CONFIG_MPEG2VIDEO_ENCODER 0 -#define CONFIG_MPEG4_ENCODER 0 -#define CONFIG_MSMPEG4V2_ENCODER 0 -#define CONFIG_MSMPEG4V3_ENCODER 0 -#define CONFIG_MSVIDEO1_ENCODER 0 -#define CONFIG_PAM_ENCODER 0 -#define CONFIG_PBM_ENCODER 0 -#define CONFIG_PCX_ENCODER 0 -#define CONFIG_PGM_ENCODER 0 -#define CONFIG_PGMYUV_ENCODER 0 -#define CONFIG_PNG_ENCODER 0 -#define CONFIG_PPM_ENCODER 0 -#define CONFIG_PRORES_ENCODER 0 -#define CONFIG_PRORES_AW_ENCODER 0 -#define CONFIG_PRORES_KS_ENCODER 0 -#define CONFIG_QTRLE_ENCODER 0 -#define CONFIG_R10K_ENCODER 0 -#define CONFIG_R210_ENCODER 0 -#define CONFIG_RAWVIDEO_ENCODER 0 -#define CONFIG_ROQ_ENCODER 0 -#define CONFIG_RV10_ENCODER 0 -#define CONFIG_RV20_ENCODER 0 -#define CONFIG_S302M_ENCODER 0 -#define CONFIG_SGI_ENCODER 0 -#define CONFIG_SNOW_ENCODER 0 -#define CONFIG_SUNRAST_ENCODER 0 -#define CONFIG_SVQ1_ENCODER 0 -#define CONFIG_TARGA_ENCODER 0 -#define CONFIG_TIFF_ENCODER 0 -#define CONFIG_UTVIDEO_ENCODER 0 -#define CONFIG_V210_ENCODER 0 -#define CONFIG_V308_ENCODER 0 -#define CONFIG_V408_ENCODER 0 -#define CONFIG_V410_ENCODER 0 -#define CONFIG_VC2_ENCODER 0 -#define CONFIG_WRAPPED_AVFRAME_ENCODER 0 -#define CONFIG_WMV1_ENCODER 0 -#define CONFIG_WMV2_ENCODER 0 -#define CONFIG_XBM_ENCODER 0 -#define CONFIG_XFACE_ENCODER 0 -#define CONFIG_XWD_ENCODER 0 -#define CONFIG_Y41P_ENCODER 0 -#define CONFIG_YUV4_ENCODER 0 -#define CONFIG_ZLIB_ENCODER 0 -#define CONFIG_ZMBV_ENCODER 0 -#define CONFIG_AAC_ENCODER 0 -#define CONFIG_AC3_ENCODER 0 -#define CONFIG_AC3_FIXED_ENCODER 0 -#define CONFIG_ALAC_ENCODER 0 -#define CONFIG_APTX_ENCODER 0 -#define CONFIG_APTX_HD_ENCODER 0 -#define CONFIG_DCA_ENCODER 0 -#define CONFIG_EAC3_ENCODER 0 -#define CONFIG_FLAC_ENCODER 0 -#define CONFIG_G723_1_ENCODER 0 -#define CONFIG_MLP_ENCODER 0 -#define CONFIG_MP2_ENCODER 0 -#define CONFIG_MP2FIXED_ENCODER 0 -#define CONFIG_NELLYMOSER_ENCODER 0 -#define CONFIG_OPUS_ENCODER 0 -#define CONFIG_RA_144_ENCODER 0 -#define CONFIG_SBC_ENCODER 0 -#define CONFIG_SONIC_ENCODER 0 -#define CONFIG_SONIC_LS_ENCODER 0 -#define CONFIG_TRUEHD_ENCODER 0 -#define CONFIG_TTA_ENCODER 0 -#define CONFIG_VORBIS_ENCODER 0 -#define CONFIG_WAVPACK_ENCODER 0 -#define CONFIG_WMAV1_ENCODER 0 -#define CONFIG_WMAV2_ENCODER 0 -#define CONFIG_PCM_ALAW_ENCODER 0 -#define CONFIG_PCM_F32BE_ENCODER 0 -#define CONFIG_PCM_F32LE_ENCODER 0 -#define CONFIG_PCM_F64BE_ENCODER 0 -#define CONFIG_PCM_F64LE_ENCODER 0 -#define CONFIG_PCM_MULAW_ENCODER 0 -#define CONFIG_PCM_S8_ENCODER 0 -#define CONFIG_PCM_S8_PLANAR_ENCODER 0 -#define CONFIG_PCM_S16BE_ENCODER 0 -#define CONFIG_PCM_S16BE_PLANAR_ENCODER 0 -#define CONFIG_PCM_S16LE_ENCODER 0 -#define CONFIG_PCM_S16LE_PLANAR_ENCODER 0 -#define CONFIG_PCM_S24BE_ENCODER 0 -#define CONFIG_PCM_S24DAUD_ENCODER 0 -#define CONFIG_PCM_S24LE_ENCODER 0 -#define CONFIG_PCM_S24LE_PLANAR_ENCODER 0 -#define CONFIG_PCM_S32BE_ENCODER 0 -#define CONFIG_PCM_S32LE_ENCODER 0 -#define CONFIG_PCM_S32LE_PLANAR_ENCODER 0 -#define CONFIG_PCM_S64BE_ENCODER 0 -#define CONFIG_PCM_S64LE_ENCODER 0 -#define CONFIG_PCM_U8_ENCODER 0 -#define CONFIG_PCM_U16BE_ENCODER 0 -#define CONFIG_PCM_U16LE_ENCODER 0 -#define CONFIG_PCM_U24BE_ENCODER 0 -#define CONFIG_PCM_U24LE_ENCODER 0 -#define CONFIG_PCM_U32BE_ENCODER 0 -#define CONFIG_PCM_U32LE_ENCODER 0 -#define CONFIG_PCM_VIDC_ENCODER 0 -#define CONFIG_ROQ_DPCM_ENCODER 0 -#define CONFIG_ADPCM_ADX_ENCODER 0 -#define CONFIG_ADPCM_G722_ENCODER 0 -#define CONFIG_ADPCM_G726_ENCODER 0 -#define CONFIG_ADPCM_G726LE_ENCODER 0 -#define CONFIG_ADPCM_IMA_QT_ENCODER 0 -#define CONFIG_ADPCM_IMA_WAV_ENCODER 0 -#define CONFIG_ADPCM_MS_ENCODER 0 -#define CONFIG_ADPCM_SWF_ENCODER 0 -#define CONFIG_ADPCM_YAMAHA_ENCODER 0 -#define CONFIG_SSA_ENCODER 0 -#define CONFIG_ASS_ENCODER 0 -#define CONFIG_DVBSUB_ENCODER 0 -#define CONFIG_DVDSUB_ENCODER 0 -#define CONFIG_MOVTEXT_ENCODER 0 -#define CONFIG_SRT_ENCODER 0 -#define CONFIG_SUBRIP_ENCODER 0 -#define CONFIG_TEXT_ENCODER 0 -#define CONFIG_WEBVTT_ENCODER 0 -#define CONFIG_XSUB_ENCODER 0 -#define CONFIG_AAC_AT_ENCODER 0 -#define CONFIG_ALAC_AT_ENCODER 0 -#define CONFIG_ILBC_AT_ENCODER 0 -#define CONFIG_PCM_ALAW_AT_ENCODER 0 -#define CONFIG_PCM_MULAW_AT_ENCODER 0 -#define CONFIG_LIBAOM_AV1_ENCODER 0 -#define CONFIG_LIBCODEC2_ENCODER 0 -#define CONFIG_LIBFDK_AAC_ENCODER 0 -#define CONFIG_LIBGSM_ENCODER 0 -#define CONFIG_LIBGSM_MS_ENCODER 0 -#define CONFIG_LIBILBC_ENCODER 0 -#define CONFIG_LIBMP3LAME_ENCODER 0 -#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0 -#define CONFIG_LIBOPENJPEG_ENCODER 0 -#define CONFIG_LIBOPUS_ENCODER 0 -#define CONFIG_LIBSHINE_ENCODER 0 -#define CONFIG_LIBSPEEX_ENCODER 0 -#define CONFIG_LIBTHEORA_ENCODER 0 -#define CONFIG_LIBTWOLAME_ENCODER 0 -#define CONFIG_LIBVO_AMRWBENC_ENCODER 0 -#define CONFIG_LIBVORBIS_ENCODER 0 -#define CONFIG_LIBVPX_VP8_ENCODER 0 -#define CONFIG_LIBVPX_VP9_ENCODER 0 -#define CONFIG_LIBWAVPACK_ENCODER 0 -#define CONFIG_LIBWEBP_ANIM_ENCODER 0 -#define CONFIG_LIBWEBP_ENCODER 0 -#define CONFIG_LIBX262_ENCODER 0 -#define CONFIG_LIBX264_ENCODER 0 -#define CONFIG_LIBX264RGB_ENCODER 0 -#define CONFIG_LIBX265_ENCODER 0 -#define CONFIG_LIBXAVS_ENCODER 0 -#define CONFIG_LIBXAVS2_ENCODER 0 -#define CONFIG_LIBXVID_ENCODER 0 -#define CONFIG_H263_V4L2M2M_ENCODER 0 -#define CONFIG_LIBOPENH264_ENCODER 0 -#define CONFIG_H264_AMF_ENCODER 0 -#define CONFIG_H264_NVENC_ENCODER 0 -#define CONFIG_H264_OMX_ENCODER 0 -#define CONFIG_H264_QSV_ENCODER 0 -#define CONFIG_H264_V4L2M2M_ENCODER 0 -#define CONFIG_H264_VAAPI_ENCODER 0 -#define CONFIG_H264_VIDEOTOOLBOX_ENCODER 0 -#define CONFIG_NVENC_ENCODER 0 -#define CONFIG_NVENC_H264_ENCODER 0 -#define CONFIG_NVENC_HEVC_ENCODER 0 -#define CONFIG_HEVC_AMF_ENCODER 0 -#define CONFIG_HEVC_NVENC_ENCODER 0 -#define CONFIG_HEVC_QSV_ENCODER 0 -#define CONFIG_HEVC_V4L2M2M_ENCODER 0 -#define CONFIG_HEVC_VAAPI_ENCODER 0 -#define CONFIG_HEVC_VIDEOTOOLBOX_ENCODER 0 -#define CONFIG_LIBKVAZAAR_ENCODER 0 -#define CONFIG_MJPEG_QSV_ENCODER 0 -#define CONFIG_MJPEG_VAAPI_ENCODER 0 -#define CONFIG_MPEG2_QSV_ENCODER 0 -#define CONFIG_MPEG2_VAAPI_ENCODER 0 -#define CONFIG_MPEG4_V4L2M2M_ENCODER 0 -#define CONFIG_VP8_V4L2M2M_ENCODER 0 -#define CONFIG_VP8_VAAPI_ENCODER 0 -#define CONFIG_VP9_VAAPI_ENCODER 0 -#define CONFIG_H263_VAAPI_HWACCEL 0 -#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0 -#define CONFIG_H264_D3D11VA_HWACCEL 0 -#define CONFIG_H264_D3D11VA2_HWACCEL 0 -#define CONFIG_H264_DXVA2_HWACCEL 0 -#define CONFIG_H264_NVDEC_HWACCEL 0 -#define CONFIG_H264_VAAPI_HWACCEL 0 -#define CONFIG_H264_VDPAU_HWACCEL 0 -#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0 -#define CONFIG_HEVC_D3D11VA_HWACCEL 0 -#define CONFIG_HEVC_D3D11VA2_HWACCEL 0 -#define CONFIG_HEVC_DXVA2_HWACCEL 0 -#define CONFIG_HEVC_NVDEC_HWACCEL 0 -#define CONFIG_HEVC_VAAPI_HWACCEL 0 -#define CONFIG_HEVC_VDPAU_HWACCEL 0 -#define CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL 0 -#define CONFIG_MJPEG_NVDEC_HWACCEL 0 -#define CONFIG_MJPEG_VAAPI_HWACCEL 0 -#define CONFIG_MPEG1_NVDEC_HWACCEL 0 -#define CONFIG_MPEG1_VDPAU_HWACCEL 0 -#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 -#define CONFIG_MPEG1_XVMC_HWACCEL 0 -#define CONFIG_MPEG2_D3D11VA_HWACCEL 0 -#define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 -#define CONFIG_MPEG2_DXVA2_HWACCEL 0 -#define CONFIG_MPEG2_VAAPI_HWACCEL 0 -#define CONFIG_MPEG2_VDPAU_HWACCEL 0 -#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 -#define CONFIG_MPEG2_XVMC_HWACCEL 0 -#define CONFIG_MPEG4_NVDEC_HWACCEL 0 -#define CONFIG_MPEG4_VAAPI_HWACCEL 0 -#define CONFIG_MPEG4_VDPAU_HWACCEL 0 -#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0 -#define CONFIG_VC1_D3D11VA_HWACCEL 0 -#define CONFIG_VC1_D3D11VA2_HWACCEL 0 -#define CONFIG_VC1_DXVA2_HWACCEL 0 -#define CONFIG_VC1_NVDEC_HWACCEL 0 -#define CONFIG_VC1_VAAPI_HWACCEL 0 -#define CONFIG_VC1_VDPAU_HWACCEL 0 -#define CONFIG_VP8_NVDEC_HWACCEL 0 -#define CONFIG_VP8_VAAPI_HWACCEL 0 -#define CONFIG_VP9_D3D11VA_HWACCEL 0 -#define CONFIG_VP9_D3D11VA2_HWACCEL 0 -#define CONFIG_VP9_DXVA2_HWACCEL 0 -#define CONFIG_VP9_NVDEC_HWACCEL 0 -#define CONFIG_VP9_VAAPI_HWACCEL 0 -#define CONFIG_WMV3_D3D11VA_HWACCEL 0 -#define CONFIG_WMV3_D3D11VA2_HWACCEL 0 -#define CONFIG_WMV3_DXVA2_HWACCEL 0 -#define CONFIG_WMV3_NVDEC_HWACCEL 0 -#define CONFIG_WMV3_VAAPI_HWACCEL 0 -#define CONFIG_WMV3_VDPAU_HWACCEL 0 -#define CONFIG_AAC_PARSER 1 -#define CONFIG_AAC_LATM_PARSER 1 -#define CONFIG_AC3_PARSER 1 -#define CONFIG_ADX_PARSER 1 -#define CONFIG_AV1_PARSER 1 -#define CONFIG_AVS2_PARSER 1 -#define CONFIG_BMP_PARSER 1 -#define CONFIG_CAVSVIDEO_PARSER 1 -#define CONFIG_COOK_PARSER 1 -#define CONFIG_DCA_PARSER 1 -#define CONFIG_DIRAC_PARSER 1 -#define CONFIG_DNXHD_PARSER 1 -#define CONFIG_DPX_PARSER 1 -#define CONFIG_DVAUDIO_PARSER 1 -#define CONFIG_DVBSUB_PARSER 1 -#define CONFIG_DVDSUB_PARSER 1 -#define CONFIG_DVD_NAV_PARSER 1 -#define CONFIG_FLAC_PARSER 1 -#define CONFIG_G729_PARSER 1 -#define CONFIG_GSM_PARSER 1 -#define CONFIG_H261_PARSER 1 -#define CONFIG_H263_PARSER 1 -#define CONFIG_H264_PARSER 1 -#define CONFIG_HEVC_PARSER 1 -#define CONFIG_MJPEG_PARSER 1 -#define CONFIG_MLP_PARSER 1 -#define CONFIG_MPEG4VIDEO_PARSER 1 -#define CONFIG_MPEGAUDIO_PARSER 1 -#define CONFIG_MPEGVIDEO_PARSER 1 -#define CONFIG_OPUS_PARSER 1 -#define CONFIG_PNG_PARSER 1 -#define CONFIG_PNM_PARSER 1 -#define CONFIG_RV30_PARSER 1 -#define CONFIG_RV40_PARSER 1 -#define CONFIG_SBC_PARSER 1 -#define CONFIG_SIPR_PARSER 1 -#define CONFIG_TAK_PARSER 1 -#define CONFIG_VC1_PARSER 1 -#define CONFIG_VORBIS_PARSER 1 -#define CONFIG_VP3_PARSER 1 -#define CONFIG_VP8_PARSER 1 -#define CONFIG_VP9_PARSER 1 -#define CONFIG_XMA_PARSER 1 -#define CONFIG_ALSA_INDEV 0 -#define CONFIG_ANDROID_CAMERA_INDEV 0 -#define CONFIG_AVFOUNDATION_INDEV 0 -#define CONFIG_BKTR_INDEV 0 -#define CONFIG_DECKLINK_INDEV 0 -#define CONFIG_LIBNDI_NEWTEK_INDEV 0 -#define CONFIG_DSHOW_INDEV 0 -#define CONFIG_FBDEV_INDEV 0 -#define CONFIG_GDIGRAB_INDEV 0 -#define CONFIG_IEC61883_INDEV 0 -#define CONFIG_JACK_INDEV 0 -#define CONFIG_KMSGRAB_INDEV 0 -#define CONFIG_LAVFI_INDEV 0 -#define CONFIG_OPENAL_INDEV 0 -#define CONFIG_OSS_INDEV 0 -#define CONFIG_PULSE_INDEV 0 -#define CONFIG_SNDIO_INDEV 0 -#define CONFIG_V4L2_INDEV 0 -#define CONFIG_VFWCAP_INDEV 0 -#define CONFIG_XCBGRAB_INDEV 0 -#define CONFIG_LIBCDIO_INDEV 0 -#define CONFIG_LIBDC1394_INDEV 0 -#define CONFIG_ALSA_OUTDEV 0 -#define CONFIG_CACA_OUTDEV 0 -#define CONFIG_DECKLINK_OUTDEV 0 -#define CONFIG_LIBNDI_NEWTEK_OUTDEV 0 -#define CONFIG_FBDEV_OUTDEV 0 -#define CONFIG_OPENGL_OUTDEV 0 -#define CONFIG_OSS_OUTDEV 0 -#define CONFIG_PULSE_OUTDEV 0 -#define CONFIG_SDL2_OUTDEV 0 -#define CONFIG_SNDIO_OUTDEV 0 -#define CONFIG_V4L2_OUTDEV 0 -#define CONFIG_XV_OUTDEV 0 -#define CONFIG_ABENCH_FILTER 0 -#define CONFIG_ACOMPRESSOR_FILTER 0 -#define CONFIG_ACONTRAST_FILTER 0 -#define CONFIG_ACOPY_FILTER 0 -#define CONFIG_ACUE_FILTER 0 -#define CONFIG_ACROSSFADE_FILTER 0 -#define CONFIG_ACROSSOVER_FILTER 0 -#define CONFIG_ACRUSHER_FILTER 0 -#define CONFIG_ADECLICK_FILTER 0 -#define CONFIG_ADECLIP_FILTER 0 -#define CONFIG_ADELAY_FILTER 0 -#define CONFIG_ADERIVATIVE_FILTER 0 -#define CONFIG_AECHO_FILTER 0 -#define CONFIG_AEMPHASIS_FILTER 0 -#define CONFIG_AEVAL_FILTER 0 -#define CONFIG_AFADE_FILTER 0 -#define CONFIG_AFFTDN_FILTER 0 -#define CONFIG_AFFTFILT_FILTER 0 -#define CONFIG_AFIR_FILTER 0 -#define CONFIG_AFORMAT_FILTER 0 -#define CONFIG_AGATE_FILTER 0 -#define CONFIG_AIIR_FILTER 0 -#define CONFIG_AINTEGRAL_FILTER 0 -#define CONFIG_AINTERLEAVE_FILTER 0 -#define CONFIG_ALIMITER_FILTER 0 -#define CONFIG_ALLPASS_FILTER 0 -#define CONFIG_ALOOP_FILTER 0 -#define CONFIG_AMERGE_FILTER 0 -#define CONFIG_AMETADATA_FILTER 0 -#define CONFIG_AMIX_FILTER 0 -#define CONFIG_AMULTIPLY_FILTER 0 -#define CONFIG_ANEQUALIZER_FILTER 0 -#define CONFIG_ANULL_FILTER 0 -#define CONFIG_APAD_FILTER 0 -#define CONFIG_APERMS_FILTER 0 -#define CONFIG_APHASER_FILTER 0 -#define CONFIG_APULSATOR_FILTER 0 -#define CONFIG_AREALTIME_FILTER 0 -#define CONFIG_ARESAMPLE_FILTER 0 -#define CONFIG_AREVERSE_FILTER 0 -#define CONFIG_ASELECT_FILTER 0 -#define CONFIG_ASENDCMD_FILTER 0 -#define CONFIG_ASETNSAMPLES_FILTER 0 -#define CONFIG_ASETPTS_FILTER 0 -#define CONFIG_ASETRATE_FILTER 0 -#define CONFIG_ASETTB_FILTER 0 -#define CONFIG_ASHOWINFO_FILTER 0 -#define CONFIG_ASIDEDATA_FILTER 0 -#define CONFIG_ASPLIT_FILTER 0 -#define CONFIG_ASTATS_FILTER 0 -#define CONFIG_ASTREAMSELECT_FILTER 0 -#define CONFIG_ATEMPO_FILTER 0 -#define CONFIG_ATRIM_FILTER 0 -#define CONFIG_AZMQ_FILTER 0 -#define CONFIG_BANDPASS_FILTER 0 -#define CONFIG_BANDREJECT_FILTER 0 -#define CONFIG_BASS_FILTER 0 -#define CONFIG_BIQUAD_FILTER 0 -#define CONFIG_BS2B_FILTER 0 -#define CONFIG_CHANNELMAP_FILTER 0 -#define CONFIG_CHANNELSPLIT_FILTER 0 -#define CONFIG_CHORUS_FILTER 0 -#define CONFIG_COMPAND_FILTER 0 -#define CONFIG_COMPENSATIONDELAY_FILTER 0 -#define CONFIG_CROSSFEED_FILTER 0 -#define CONFIG_CRYSTALIZER_FILTER 0 -#define CONFIG_DCSHIFT_FILTER 0 -#define CONFIG_DRMETER_FILTER 0 -#define CONFIG_DYNAUDNORM_FILTER 0 -#define CONFIG_EARWAX_FILTER 0 -#define CONFIG_EBUR128_FILTER 0 -#define CONFIG_EQUALIZER_FILTER 0 -#define CONFIG_EXTRASTEREO_FILTER 0 -#define CONFIG_FIREQUALIZER_FILTER 0 -#define CONFIG_FLANGER_FILTER 0 -#define CONFIG_HAAS_FILTER 0 -#define CONFIG_HDCD_FILTER 0 -#define CONFIG_HEADPHONE_FILTER 0 -#define CONFIG_HIGHPASS_FILTER 0 -#define CONFIG_HIGHSHELF_FILTER 0 -#define CONFIG_JOIN_FILTER 0 -#define CONFIG_LADSPA_FILTER 0 -#define CONFIG_LOUDNORM_FILTER 0 -#define CONFIG_LOWPASS_FILTER 0 -#define CONFIG_LOWSHELF_FILTER 0 -#define CONFIG_LV2_FILTER 0 -#define CONFIG_MCOMPAND_FILTER 0 -#define CONFIG_PAN_FILTER 0 -#define CONFIG_REPLAYGAIN_FILTER 0 -#define CONFIG_RESAMPLE_FILTER 0 -#define CONFIG_RUBBERBAND_FILTER 0 -#define CONFIG_SIDECHAINCOMPRESS_FILTER 0 -#define CONFIG_SIDECHAINGATE_FILTER 0 -#define CONFIG_SILENCEDETECT_FILTER 0 -#define CONFIG_SILENCEREMOVE_FILTER 0 -#define CONFIG_SOFALIZER_FILTER 0 -#define CONFIG_STEREOTOOLS_FILTER 0 -#define CONFIG_STEREOWIDEN_FILTER 0 -#define CONFIG_SUPEREQUALIZER_FILTER 0 -#define CONFIG_SURROUND_FILTER 0 -#define CONFIG_TREBLE_FILTER 0 -#define CONFIG_TREMOLO_FILTER 0 -#define CONFIG_VIBRATO_FILTER 0 -#define CONFIG_VOLUME_FILTER 0 -#define CONFIG_VOLUMEDETECT_FILTER 0 -#define CONFIG_AEVALSRC_FILTER 0 -#define CONFIG_ANOISESRC_FILTER 0 -#define CONFIG_ANULLSRC_FILTER 0 -#define CONFIG_FLITE_FILTER 0 -#define CONFIG_HILBERT_FILTER 0 -#define CONFIG_SINC_FILTER 0 -#define CONFIG_SINE_FILTER 0 -#define CONFIG_ANULLSINK_FILTER 0 -#define CONFIG_ALPHAEXTRACT_FILTER 0 -#define CONFIG_ALPHAMERGE_FILTER 0 -#define CONFIG_AMPLIFY_FILTER 0 -#define CONFIG_ASS_FILTER 0 -#define CONFIG_ATADENOISE_FILTER 0 -#define CONFIG_AVGBLUR_FILTER 0 -#define CONFIG_AVGBLUR_OPENCL_FILTER 0 -#define CONFIG_BBOX_FILTER 0 -#define CONFIG_BENCH_FILTER 0 -#define CONFIG_BITPLANENOISE_FILTER 0 -#define CONFIG_BLACKDETECT_FILTER 0 -#define CONFIG_BLACKFRAME_FILTER 0 -#define CONFIG_BLEND_FILTER 0 -#define CONFIG_BM3D_FILTER 0 -#define CONFIG_BOXBLUR_FILTER 0 -#define CONFIG_BOXBLUR_OPENCL_FILTER 0 -#define CONFIG_BWDIF_FILTER 0 -#define CONFIG_CHROMAHOLD_FILTER 0 -#define CONFIG_CHROMAKEY_FILTER 0 -#define CONFIG_CHROMASHIFT_FILTER 0 -#define CONFIG_CIESCOPE_FILTER 0 -#define CONFIG_CODECVIEW_FILTER 0 -#define CONFIG_COLORBALANCE_FILTER 0 -#define CONFIG_COLORCHANNELMIXER_FILTER 0 -#define CONFIG_COLORKEY_FILTER 0 -#define CONFIG_COLORLEVELS_FILTER 0 -#define CONFIG_COLORMATRIX_FILTER 0 -#define CONFIG_COLORSPACE_FILTER 0 -#define CONFIG_CONVOLUTION_FILTER 0 -#define CONFIG_CONVOLUTION_OPENCL_FILTER 0 -#define CONFIG_CONVOLVE_FILTER 0 -#define CONFIG_COPY_FILTER 0 -#define CONFIG_COREIMAGE_FILTER 0 -#define CONFIG_COVER_RECT_FILTER 0 -#define CONFIG_CROP_FILTER 0 -#define CONFIG_CROPDETECT_FILTER 0 -#define CONFIG_CUE_FILTER 0 -#define CONFIG_CURVES_FILTER 0 -#define CONFIG_DATASCOPE_FILTER 0 -#define CONFIG_DCTDNOIZ_FILTER 0 -#define CONFIG_DEBAND_FILTER 0 -#define CONFIG_DEBLOCK_FILTER 0 -#define CONFIG_DECIMATE_FILTER 0 -#define CONFIG_DECONVOLVE_FILTER 0 -#define CONFIG_DEDOT_FILTER 0 -#define CONFIG_DEFLATE_FILTER 0 -#define CONFIG_DEFLICKER_FILTER 0 -#define CONFIG_DEINTERLACE_QSV_FILTER 0 -#define CONFIG_DEINTERLACE_VAAPI_FILTER 0 -#define CONFIG_DEJUDDER_FILTER 0 -#define CONFIG_DELOGO_FILTER 0 -#define CONFIG_DENOISE_VAAPI_FILTER 0 -#define CONFIG_DESHAKE_FILTER 0 -#define CONFIG_DESPILL_FILTER 0 -#define CONFIG_DETELECINE_FILTER 0 -#define CONFIG_DILATION_FILTER 0 -#define CONFIG_DILATION_OPENCL_FILTER 0 -#define CONFIG_DISPLACE_FILTER 0 -#define CONFIG_DOUBLEWEAVE_FILTER 0 -#define CONFIG_DRAWBOX_FILTER 0 -#define CONFIG_DRAWGRAPH_FILTER 0 -#define CONFIG_DRAWGRID_FILTER 0 -#define CONFIG_DRAWTEXT_FILTER 0 -#define CONFIG_EDGEDETECT_FILTER 0 -#define CONFIG_ELBG_FILTER 0 -#define CONFIG_ENTROPY_FILTER 0 -#define CONFIG_EQ_FILTER 0 -#define CONFIG_EROSION_FILTER 0 -#define CONFIG_EROSION_OPENCL_FILTER 0 -#define CONFIG_EXTRACTPLANES_FILTER 0 -#define CONFIG_FADE_FILTER 0 -#define CONFIG_FFTDNOIZ_FILTER 0 -#define CONFIG_FFTFILT_FILTER 0 -#define CONFIG_FIELD_FILTER 0 -#define CONFIG_FIELDHINT_FILTER 0 -#define CONFIG_FIELDMATCH_FILTER 0 -#define CONFIG_FIELDORDER_FILTER 0 -#define CONFIG_FILLBORDERS_FILTER 0 -#define CONFIG_FIND_RECT_FILTER 0 -#define CONFIG_FLOODFILL_FILTER 0 -#define CONFIG_FORMAT_FILTER 0 -#define CONFIG_FPS_FILTER 0 -#define CONFIG_FRAMEPACK_FILTER 0 -#define CONFIG_FRAMERATE_FILTER 0 -#define CONFIG_FRAMESTEP_FILTER 0 -#define CONFIG_FREEZEDETECT_FILTER 0 -#define CONFIG_FREI0R_FILTER 0 -#define CONFIG_FSPP_FILTER 0 -#define CONFIG_GBLUR_FILTER 0 -#define CONFIG_GEQ_FILTER 0 -#define CONFIG_GRADFUN_FILTER 0 -#define CONFIG_GRAPHMONITOR_FILTER 0 -#define CONFIG_GREYEDGE_FILTER 0 -#define CONFIG_HALDCLUT_FILTER 0 -#define CONFIG_HFLIP_FILTER 0 -#define CONFIG_HISTEQ_FILTER 0 -#define CONFIG_HISTOGRAM_FILTER 0 -#define CONFIG_HQDN3D_FILTER 0 -#define CONFIG_HQX_FILTER 0 -#define CONFIG_HSTACK_FILTER 0 -#define CONFIG_HUE_FILTER 0 -#define CONFIG_HWDOWNLOAD_FILTER 0 -#define CONFIG_HWMAP_FILTER 0 -#define CONFIG_HWUPLOAD_FILTER 0 -#define CONFIG_HWUPLOAD_CUDA_FILTER 0 -#define CONFIG_HYSTERESIS_FILTER 0 -#define CONFIG_IDET_FILTER 0 -#define CONFIG_IL_FILTER 0 -#define CONFIG_INFLATE_FILTER 0 -#define CONFIG_INTERLACE_FILTER 0 -#define CONFIG_INTERLEAVE_FILTER 0 -#define CONFIG_KERNDEINT_FILTER 0 -#define CONFIG_LENSCORRECTION_FILTER 0 -#define CONFIG_LENSFUN_FILTER 0 -#define CONFIG_LIBVMAF_FILTER 0 -#define CONFIG_LIMITER_FILTER 0 -#define CONFIG_LOOP_FILTER 0 -#define CONFIG_LUMAKEY_FILTER 0 -#define CONFIG_LUT_FILTER 0 -#define CONFIG_LUT1D_FILTER 0 -#define CONFIG_LUT2_FILTER 0 -#define CONFIG_LUT3D_FILTER 0 -#define CONFIG_LUTRGB_FILTER 0 -#define CONFIG_LUTYUV_FILTER 0 -#define CONFIG_MASKEDCLAMP_FILTER 0 -#define CONFIG_MASKEDMERGE_FILTER 0 -#define CONFIG_MCDEINT_FILTER 0 -#define CONFIG_MERGEPLANES_FILTER 0 -#define CONFIG_MESTIMATE_FILTER 0 -#define CONFIG_METADATA_FILTER 0 -#define CONFIG_MIDEQUALIZER_FILTER 0 -#define CONFIG_MINTERPOLATE_FILTER 0 -#define CONFIG_MIX_FILTER 0 -#define CONFIG_MPDECIMATE_FILTER 0 -#define CONFIG_NEGATE_FILTER 0 -#define CONFIG_NLMEANS_FILTER 0 -#define CONFIG_NNEDI_FILTER 0 -#define CONFIG_NOFORMAT_FILTER 0 -#define CONFIG_NOISE_FILTER 0 -#define CONFIG_NORMALIZE_FILTER 0 -#define CONFIG_NULL_FILTER 0 -#define CONFIG_OCR_FILTER 0 -#define CONFIG_OCV_FILTER 0 -#define CONFIG_OSCILLOSCOPE_FILTER 0 -#define CONFIG_OVERLAY_FILTER 0 -#define CONFIG_OVERLAY_OPENCL_FILTER 0 -#define CONFIG_OVERLAY_QSV_FILTER 0 -#define CONFIG_OWDENOISE_FILTER 0 -#define CONFIG_PAD_FILTER 0 -#define CONFIG_PALETTEGEN_FILTER 0 -#define CONFIG_PALETTEUSE_FILTER 0 -#define CONFIG_PERMS_FILTER 0 -#define CONFIG_PERSPECTIVE_FILTER 0 -#define CONFIG_PHASE_FILTER 0 -#define CONFIG_PIXDESCTEST_FILTER 0 -#define CONFIG_PIXSCOPE_FILTER 0 -#define CONFIG_PP_FILTER 0 -#define CONFIG_PP7_FILTER 0 -#define CONFIG_PREMULTIPLY_FILTER 0 -#define CONFIG_PREWITT_FILTER 0 -#define CONFIG_PREWITT_OPENCL_FILTER 0 -#define CONFIG_PROCAMP_VAAPI_FILTER 0 -#define CONFIG_PROGRAM_OPENCL_FILTER 0 -#define CONFIG_PSEUDOCOLOR_FILTER 0 -#define CONFIG_PSNR_FILTER 0 -#define CONFIG_PULLUP_FILTER 0 -#define CONFIG_QP_FILTER 0 -#define CONFIG_RANDOM_FILTER 0 -#define CONFIG_READEIA608_FILTER 0 -#define CONFIG_READVITC_FILTER 0 -#define CONFIG_REALTIME_FILTER 0 -#define CONFIG_REMAP_FILTER 0 -#define CONFIG_REMOVEGRAIN_FILTER 0 -#define CONFIG_REMOVELOGO_FILTER 0 -#define CONFIG_REPEATFIELDS_FILTER 0 -#define CONFIG_REVERSE_FILTER 0 -#define CONFIG_RGBASHIFT_FILTER 0 -#define CONFIG_ROBERTS_FILTER 0 -#define CONFIG_ROBERTS_OPENCL_FILTER 0 -#define CONFIG_ROTATE_FILTER 0 -#define CONFIG_SAB_FILTER 0 -#define CONFIG_SCALE_FILTER 0 -#define CONFIG_SCALE_CUDA_FILTER 0 -#define CONFIG_SCALE_NPP_FILTER 0 -#define CONFIG_SCALE_QSV_FILTER 0 -#define CONFIG_SCALE_VAAPI_FILTER 0 -#define CONFIG_SCALE2REF_FILTER 0 -#define CONFIG_SELECT_FILTER 0 -#define CONFIG_SELECTIVECOLOR_FILTER 0 -#define CONFIG_SENDCMD_FILTER 0 -#define CONFIG_SEPARATEFIELDS_FILTER 0 -#define CONFIG_SETDAR_FILTER 0 -#define CONFIG_SETFIELD_FILTER 0 -#define CONFIG_SETPARAMS_FILTER 0 -#define CONFIG_SETPTS_FILTER 0 -#define CONFIG_SETRANGE_FILTER 0 -#define CONFIG_SETSAR_FILTER 0 -#define CONFIG_SETTB_FILTER 0 -#define CONFIG_SHARPNESS_VAAPI_FILTER 0 -#define CONFIG_SHOWINFO_FILTER 0 -#define CONFIG_SHOWPALETTE_FILTER 0 -#define CONFIG_SHUFFLEFRAMES_FILTER 0 -#define CONFIG_SHUFFLEPLANES_FILTER 0 -#define CONFIG_SIDEDATA_FILTER 0 -#define CONFIG_SIGNALSTATS_FILTER 0 -#define CONFIG_SIGNATURE_FILTER 0 -#define CONFIG_SMARTBLUR_FILTER 0 -#define CONFIG_SOBEL_FILTER 0 -#define CONFIG_SOBEL_OPENCL_FILTER 0 -#define CONFIG_SPLIT_FILTER 0 -#define CONFIG_SPP_FILTER 0 -#define CONFIG_SR_FILTER 0 -#define CONFIG_SSIM_FILTER 0 -#define CONFIG_STEREO3D_FILTER 0 -#define CONFIG_STREAMSELECT_FILTER 0 -#define CONFIG_SUBTITLES_FILTER 0 -#define CONFIG_SUPER2XSAI_FILTER 0 -#define CONFIG_SWAPRECT_FILTER 0 -#define CONFIG_SWAPUV_FILTER 0 -#define CONFIG_TBLEND_FILTER 0 -#define CONFIG_TELECINE_FILTER 0 -#define CONFIG_THRESHOLD_FILTER 0 -#define CONFIG_THUMBNAIL_FILTER 0 -#define CONFIG_THUMBNAIL_CUDA_FILTER 0 -#define CONFIG_TILE_FILTER 0 -#define CONFIG_TINTERLACE_FILTER 0 -#define CONFIG_TLUT2_FILTER 0 -#define CONFIG_TMIX_FILTER 0 -#define CONFIG_TONEMAP_FILTER 0 -#define CONFIG_TONEMAP_OPENCL_FILTER 0 -#define CONFIG_TPAD_FILTER 0 -#define CONFIG_TRANSPOSE_FILTER 0 -#define CONFIG_TRANSPOSE_NPP_FILTER 0 -#define CONFIG_TRIM_FILTER 0 -#define CONFIG_UNPREMULTIPLY_FILTER 0 -#define CONFIG_UNSHARP_FILTER 0 -#define CONFIG_UNSHARP_OPENCL_FILTER 0 -#define CONFIG_USPP_FILTER 0 -#define CONFIG_VAGUEDENOISER_FILTER 0 -#define CONFIG_VECTORSCOPE_FILTER 0 -#define CONFIG_VFLIP_FILTER 0 -#define CONFIG_VFRDET_FILTER 0 -#define CONFIG_VIBRANCE_FILTER 0 -#define CONFIG_VIDSTABDETECT_FILTER 0 -#define CONFIG_VIDSTABTRANSFORM_FILTER 0 -#define CONFIG_VIGNETTE_FILTER 0 -#define CONFIG_VMAFMOTION_FILTER 0 -#define CONFIG_VPP_QSV_FILTER 0 -#define CONFIG_VSTACK_FILTER 0 -#define CONFIG_W3FDIF_FILTER 0 -#define CONFIG_WAVEFORM_FILTER 0 -#define CONFIG_WEAVE_FILTER 0 -#define CONFIG_XBR_FILTER 0 -#define CONFIG_XSTACK_FILTER 0 -#define CONFIG_YADIF_FILTER 0 -#define CONFIG_YADIF_CUDA_FILTER 0 -#define CONFIG_ZMQ_FILTER 0 -#define CONFIG_ZOOMPAN_FILTER 0 -#define CONFIG_ZSCALE_FILTER 0 -#define CONFIG_ALLRGB_FILTER 0 -#define CONFIG_ALLYUV_FILTER 0 -#define CONFIG_CELLAUTO_FILTER 0 -#define CONFIG_COLOR_FILTER 0 -#define CONFIG_COREIMAGESRC_FILTER 0 -#define CONFIG_FREI0R_SRC_FILTER 0 -#define CONFIG_HALDCLUTSRC_FILTER 0 -#define CONFIG_LIFE_FILTER 0 -#define CONFIG_MANDELBROT_FILTER 0 -#define CONFIG_MPTESTSRC_FILTER 0 -#define CONFIG_NULLSRC_FILTER 0 -#define CONFIG_OPENCLSRC_FILTER 0 -#define CONFIG_PAL75BARS_FILTER 0 -#define CONFIG_PAL100BARS_FILTER 0 -#define CONFIG_RGBTESTSRC_FILTER 0 -#define CONFIG_SMPTEBARS_FILTER 0 -#define CONFIG_SMPTEHDBARS_FILTER 0 -#define CONFIG_TESTSRC_FILTER 0 -#define CONFIG_TESTSRC2_FILTER 0 -#define CONFIG_YUVTESTSRC_FILTER 0 -#define CONFIG_NULLSINK_FILTER 0 -#define CONFIG_ABITSCOPE_FILTER 0 -#define CONFIG_ADRAWGRAPH_FILTER 0 -#define CONFIG_AGRAPHMONITOR_FILTER 0 -#define CONFIG_AHISTOGRAM_FILTER 0 -#define CONFIG_APHASEMETER_FILTER 0 -#define CONFIG_AVECTORSCOPE_FILTER 0 -#define CONFIG_CONCAT_FILTER 0 -#define CONFIG_SHOWCQT_FILTER 0 -#define CONFIG_SHOWFREQS_FILTER 0 -#define CONFIG_SHOWSPECTRUM_FILTER 0 -#define CONFIG_SHOWSPECTRUMPIC_FILTER 0 -#define CONFIG_SHOWVOLUME_FILTER 0 -#define CONFIG_SHOWWAVES_FILTER 0 -#define CONFIG_SHOWWAVESPIC_FILTER 0 -#define CONFIG_SPECTRUMSYNTH_FILTER 0 -#define CONFIG_AMOVIE_FILTER 0 -#define CONFIG_MOVIE_FILTER 0 -#define CONFIG_AFIFO_FILTER 0 -#define CONFIG_FIFO_FILTER 0 -#define CONFIG_AA_DEMUXER 1 -#define CONFIG_AAC_DEMUXER 1 -#define CONFIG_AC3_DEMUXER 1 -#define CONFIG_ACM_DEMUXER 1 -#define CONFIG_ACT_DEMUXER 1 -#define CONFIG_ADF_DEMUXER 1 -#define CONFIG_ADP_DEMUXER 1 -#define CONFIG_ADS_DEMUXER 1 -#define CONFIG_ADX_DEMUXER 1 -#define CONFIG_AEA_DEMUXER 1 -#define CONFIG_AFC_DEMUXER 1 -#define CONFIG_AIFF_DEMUXER 1 -#define CONFIG_AIX_DEMUXER 1 -#define CONFIG_AMR_DEMUXER 1 -#define CONFIG_AMRNB_DEMUXER 1 -#define CONFIG_AMRWB_DEMUXER 1 -#define CONFIG_ANM_DEMUXER 1 -#define CONFIG_APC_DEMUXER 1 -#define CONFIG_APE_DEMUXER 1 -#define CONFIG_APNG_DEMUXER 1 -#define CONFIG_APTX_DEMUXER 1 -#define CONFIG_APTX_HD_DEMUXER 1 -#define CONFIG_AQTITLE_DEMUXER 1 -#define CONFIG_ASF_DEMUXER 1 -#define CONFIG_ASF_O_DEMUXER 1 -#define CONFIG_ASS_DEMUXER 1 -#define CONFIG_AST_DEMUXER 1 -#define CONFIG_AU_DEMUXER 1 -#define CONFIG_AVI_DEMUXER 1 -#define CONFIG_AVISYNTH_DEMUXER 0 -#define CONFIG_AVR_DEMUXER 1 -#define CONFIG_AVS_DEMUXER 1 -#define CONFIG_AVS2_DEMUXER 1 -#define CONFIG_BETHSOFTVID_DEMUXER 1 -#define CONFIG_BFI_DEMUXER 1 -#define CONFIG_BINTEXT_DEMUXER 1 -#define CONFIG_BINK_DEMUXER 1 -#define CONFIG_BIT_DEMUXER 1 -#define CONFIG_BMV_DEMUXER 1 -#define CONFIG_BFSTM_DEMUXER 1 -#define CONFIG_BRSTM_DEMUXER 1 -#define CONFIG_BOA_DEMUXER 1 -#define CONFIG_C93_DEMUXER 1 -#define CONFIG_CAF_DEMUXER 1 -#define CONFIG_CAVSVIDEO_DEMUXER 1 -#define CONFIG_CDG_DEMUXER 1 -#define CONFIG_CDXL_DEMUXER 1 -#define CONFIG_CINE_DEMUXER 1 -#define CONFIG_CODEC2_DEMUXER 1 -#define CONFIG_CODEC2RAW_DEMUXER 1 -#define CONFIG_CONCAT_DEMUXER 1 -#define CONFIG_DASH_DEMUXER 0 -#define CONFIG_DATA_DEMUXER 1 -#define CONFIG_DAUD_DEMUXER 1 -#define CONFIG_DCSTR_DEMUXER 1 -#define CONFIG_DFA_DEMUXER 1 -#define CONFIG_DIRAC_DEMUXER 1 -#define CONFIG_DNXHD_DEMUXER 1 -#define CONFIG_DSF_DEMUXER 1 -#define CONFIG_DSICIN_DEMUXER 1 -#define CONFIG_DSS_DEMUXER 1 -#define CONFIG_DTS_DEMUXER 1 -#define CONFIG_DTSHD_DEMUXER 1 -#define CONFIG_DV_DEMUXER 1 -#define CONFIG_DVBSUB_DEMUXER 1 -#define CONFIG_DVBTXT_DEMUXER 1 -#define CONFIG_DXA_DEMUXER 1 -#define CONFIG_EA_DEMUXER 1 -#define CONFIG_EA_CDATA_DEMUXER 1 -#define CONFIG_EAC3_DEMUXER 1 -#define CONFIG_EPAF_DEMUXER 1 -#define CONFIG_FFMETADATA_DEMUXER 1 -#define CONFIG_FILMSTRIP_DEMUXER 1 -#define CONFIG_FITS_DEMUXER 1 -#define CONFIG_FLAC_DEMUXER 1 -#define CONFIG_FLIC_DEMUXER 1 -#define CONFIG_FLV_DEMUXER 1 -#define CONFIG_LIVE_FLV_DEMUXER 1 -#define CONFIG_FOURXM_DEMUXER 1 -#define CONFIG_FRM_DEMUXER 1 -#define CONFIG_FSB_DEMUXER 1 -#define CONFIG_G722_DEMUXER 1 -#define CONFIG_G723_1_DEMUXER 1 -#define CONFIG_G726_DEMUXER 1 -#define CONFIG_G726LE_DEMUXER 1 -#define CONFIG_G729_DEMUXER 1 -#define CONFIG_GDV_DEMUXER 1 -#define CONFIG_GENH_DEMUXER 1 -#define CONFIG_GIF_DEMUXER 1 -#define CONFIG_GSM_DEMUXER 1 -#define CONFIG_GXF_DEMUXER 1 -#define CONFIG_H261_DEMUXER 1 -#define CONFIG_H263_DEMUXER 1 -#define CONFIG_H264_DEMUXER 1 -#define CONFIG_HEVC_DEMUXER 1 -#define CONFIG_HLS_DEMUXER 1 -#define CONFIG_HNM_DEMUXER 1 -#define CONFIG_ICO_DEMUXER 1 -#define CONFIG_IDCIN_DEMUXER 1 -#define CONFIG_IDF_DEMUXER 1 -#define CONFIG_IFF_DEMUXER 1 -#define CONFIG_ILBC_DEMUXER 1 -#define CONFIG_IMAGE2_DEMUXER 1 -#define CONFIG_IMAGE2PIPE_DEMUXER 1 -#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 1 -#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 1 -#define CONFIG_INGENIENT_DEMUXER 1 -#define CONFIG_IPMOVIE_DEMUXER 1 -#define CONFIG_IRCAM_DEMUXER 1 -#define CONFIG_ISS_DEMUXER 1 -#define CONFIG_IV8_DEMUXER 1 -#define CONFIG_IVF_DEMUXER 1 -#define CONFIG_IVR_DEMUXER 1 -#define CONFIG_JACOSUB_DEMUXER 1 -#define CONFIG_JV_DEMUXER 1 -#define CONFIG_LMLM4_DEMUXER 1 -#define CONFIG_LOAS_DEMUXER 1 -#define CONFIG_LRC_DEMUXER 1 -#define CONFIG_LVF_DEMUXER 1 -#define CONFIG_LXF_DEMUXER 1 -#define CONFIG_M4V_DEMUXER 1 -#define CONFIG_MATROSKA_DEMUXER 1 -#define CONFIG_MGSTS_DEMUXER 1 -#define CONFIG_MICRODVD_DEMUXER 1 -#define CONFIG_MJPEG_DEMUXER 1 -#define CONFIG_MJPEG_2000_DEMUXER 1 -#define CONFIG_MLP_DEMUXER 1 -#define CONFIG_MLV_DEMUXER 1 -#define CONFIG_MM_DEMUXER 1 -#define CONFIG_MMF_DEMUXER 1 -#define CONFIG_MOV_DEMUXER 1 -#define CONFIG_MP3_DEMUXER 1 -#define CONFIG_MPC_DEMUXER 1 -#define CONFIG_MPC8_DEMUXER 1 -#define CONFIG_MPEGPS_DEMUXER 1 -#define CONFIG_MPEGTS_DEMUXER 1 -#define CONFIG_MPEGTSRAW_DEMUXER 1 -#define CONFIG_MPEGVIDEO_DEMUXER 1 -#define CONFIG_MPJPEG_DEMUXER 1 -#define CONFIG_MPL2_DEMUXER 1 -#define CONFIG_MPSUB_DEMUXER 1 -#define CONFIG_MSF_DEMUXER 1 -#define CONFIG_MSNWC_TCP_DEMUXER 1 -#define CONFIG_MTAF_DEMUXER 1 -#define CONFIG_MTV_DEMUXER 1 -#define CONFIG_MUSX_DEMUXER 1 -#define CONFIG_MV_DEMUXER 1 -#define CONFIG_MVI_DEMUXER 1 -#define CONFIG_MXF_DEMUXER 1 -#define CONFIG_MXG_DEMUXER 1 -#define CONFIG_NC_DEMUXER 1 -#define CONFIG_NISTSPHERE_DEMUXER 1 -#define CONFIG_NSP_DEMUXER 1 -#define CONFIG_NSV_DEMUXER 1 -#define CONFIG_NUT_DEMUXER 1 -#define CONFIG_NUV_DEMUXER 1 -#define CONFIG_OGG_DEMUXER 1 -#define CONFIG_OMA_DEMUXER 1 -#define CONFIG_PAF_DEMUXER 1 -#define CONFIG_PCM_ALAW_DEMUXER 1 -#define CONFIG_PCM_MULAW_DEMUXER 1 -#define CONFIG_PCM_VIDC_DEMUXER 1 -#define CONFIG_PCM_F64BE_DEMUXER 1 -#define CONFIG_PCM_F64LE_DEMUXER 1 -#define CONFIG_PCM_F32BE_DEMUXER 1 -#define CONFIG_PCM_F32LE_DEMUXER 1 -#define CONFIG_PCM_S32BE_DEMUXER 1 -#define CONFIG_PCM_S32LE_DEMUXER 1 -#define CONFIG_PCM_S24BE_DEMUXER 1 -#define CONFIG_PCM_S24LE_DEMUXER 1 -#define CONFIG_PCM_S16BE_DEMUXER 1 -#define CONFIG_PCM_S16LE_DEMUXER 1 -#define CONFIG_PCM_S8_DEMUXER 1 -#define CONFIG_PCM_U32BE_DEMUXER 1 -#define CONFIG_PCM_U32LE_DEMUXER 1 -#define CONFIG_PCM_U24BE_DEMUXER 1 -#define CONFIG_PCM_U24LE_DEMUXER 1 -#define CONFIG_PCM_U16BE_DEMUXER 1 -#define CONFIG_PCM_U16LE_DEMUXER 1 -#define CONFIG_PCM_U8_DEMUXER 1 -#define CONFIG_PJS_DEMUXER 1 -#define CONFIG_PMP_DEMUXER 1 -#define CONFIG_PVA_DEMUXER 1 -#define CONFIG_PVF_DEMUXER 1 -#define CONFIG_QCP_DEMUXER 1 -#define CONFIG_R3D_DEMUXER 1 -#define CONFIG_RAWVIDEO_DEMUXER 1 -#define CONFIG_REALTEXT_DEMUXER 1 -#define CONFIG_REDSPARK_DEMUXER 1 -#define CONFIG_RL2_DEMUXER 1 -#define CONFIG_RM_DEMUXER 1 -#define CONFIG_ROQ_DEMUXER 1 -#define CONFIG_RPL_DEMUXER 1 -#define CONFIG_RSD_DEMUXER 1 -#define CONFIG_RSO_DEMUXER 1 -#define CONFIG_RTP_DEMUXER 0 -#define CONFIG_RTSP_DEMUXER 0 -#define CONFIG_S337M_DEMUXER 1 -#define CONFIG_SAMI_DEMUXER 1 -#define CONFIG_SAP_DEMUXER 0 -#define CONFIG_SBC_DEMUXER 1 -#define CONFIG_SBG_DEMUXER 1 -#define CONFIG_SCC_DEMUXER 1 -#define CONFIG_SDP_DEMUXER 0 -#define CONFIG_SDR2_DEMUXER 1 -#define CONFIG_SDS_DEMUXER 1 -#define CONFIG_SDX_DEMUXER 1 -#define CONFIG_SEGAFILM_DEMUXER 1 -#define CONFIG_SER_DEMUXER 1 -#define CONFIG_SHORTEN_DEMUXER 1 -#define CONFIG_SIFF_DEMUXER 1 -#define CONFIG_SLN_DEMUXER 1 -#define CONFIG_SMACKER_DEMUXER 1 -#define CONFIG_SMJPEG_DEMUXER 1 -#define CONFIG_SMUSH_DEMUXER 1 -#define CONFIG_SOL_DEMUXER 1 -#define CONFIG_SOX_DEMUXER 1 -#define CONFIG_SPDIF_DEMUXER 1 -#define CONFIG_SRT_DEMUXER 1 -#define CONFIG_STR_DEMUXER 1 -#define CONFIG_STL_DEMUXER 1 -#define CONFIG_SUBVIEWER1_DEMUXER 1 -#define CONFIG_SUBVIEWER_DEMUXER 1 -#define CONFIG_SUP_DEMUXER 1 -#define CONFIG_SVAG_DEMUXER 1 -#define CONFIG_SWF_DEMUXER 1 -#define CONFIG_TAK_DEMUXER 1 -#define CONFIG_TEDCAPTIONS_DEMUXER 1 -#define CONFIG_THP_DEMUXER 1 -#define CONFIG_THREEDOSTR_DEMUXER 1 -#define CONFIG_TIERTEXSEQ_DEMUXER 1 -#define CONFIG_TMV_DEMUXER 1 -#define CONFIG_TRUEHD_DEMUXER 1 -#define CONFIG_TTA_DEMUXER 1 -#define CONFIG_TXD_DEMUXER 1 -#define CONFIG_TTY_DEMUXER 1 -#define CONFIG_TY_DEMUXER 1 -#define CONFIG_V210_DEMUXER 1 -#define CONFIG_V210X_DEMUXER 1 -#define CONFIG_VAG_DEMUXER 1 -#define CONFIG_VC1_DEMUXER 1 -#define CONFIG_VC1T_DEMUXER 1 -#define CONFIG_VIVO_DEMUXER 1 -#define CONFIG_VMD_DEMUXER 1 -#define CONFIG_VOBSUB_DEMUXER 1 -#define CONFIG_VOC_DEMUXER 1 -#define CONFIG_VPK_DEMUXER 1 -#define CONFIG_VPLAYER_DEMUXER 1 -#define CONFIG_VQF_DEMUXER 1 -#define CONFIG_W64_DEMUXER 1 -#define CONFIG_WAV_DEMUXER 1 -#define CONFIG_WC3_DEMUXER 1 -#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 1 -#define CONFIG_WEBVTT_DEMUXER 1 -#define CONFIG_WSAUD_DEMUXER 1 -#define CONFIG_WSD_DEMUXER 1 -#define CONFIG_WSVQA_DEMUXER 1 -#define CONFIG_WTV_DEMUXER 1 -#define CONFIG_WVE_DEMUXER 1 -#define CONFIG_WV_DEMUXER 1 -#define CONFIG_XA_DEMUXER 1 -#define CONFIG_XBIN_DEMUXER 1 -#define CONFIG_XMV_DEMUXER 1 -#define CONFIG_XVAG_DEMUXER 1 -#define CONFIG_XWMA_DEMUXER 1 -#define CONFIG_YOP_DEMUXER 1 -#define CONFIG_YUV4MPEGPIPE_DEMUXER 1 -#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PAM_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PBM_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PCX_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PGM_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PPM_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PSD_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_SVG_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_XPM_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_XWD_PIPE_DEMUXER 1 -#define CONFIG_LIBGME_DEMUXER 0 -#define CONFIG_LIBMODPLUG_DEMUXER 0 -#define CONFIG_LIBOPENMPT_DEMUXER 0 -#define CONFIG_VAPOURSYNTH_DEMUXER 0 -#define CONFIG_A64_MUXER 0 -#define CONFIG_AC3_MUXER 0 -#define CONFIG_ADTS_MUXER 0 -#define CONFIG_ADX_MUXER 0 -#define CONFIG_AIFF_MUXER 0 -#define CONFIG_AMR_MUXER 0 -#define CONFIG_APNG_MUXER 0 -#define CONFIG_APTX_MUXER 0 -#define CONFIG_APTX_HD_MUXER 0 -#define CONFIG_ASF_MUXER 0 -#define CONFIG_ASS_MUXER 0 -#define CONFIG_AST_MUXER 0 -#define CONFIG_ASF_STREAM_MUXER 0 -#define CONFIG_AU_MUXER 0 -#define CONFIG_AVI_MUXER 0 -#define CONFIG_AVM2_MUXER 0 -#define CONFIG_AVS2_MUXER 0 -#define CONFIG_BIT_MUXER 0 -#define CONFIG_CAF_MUXER 0 -#define CONFIG_CAVSVIDEO_MUXER 0 -#define CONFIG_CODEC2_MUXER 0 -#define CONFIG_CODEC2RAW_MUXER 0 -#define CONFIG_CRC_MUXER 0 -#define CONFIG_DASH_MUXER 0 -#define CONFIG_DATA_MUXER 0 -#define CONFIG_DAUD_MUXER 0 -#define CONFIG_DIRAC_MUXER 0 -#define CONFIG_DNXHD_MUXER 0 -#define CONFIG_DTS_MUXER 0 -#define CONFIG_DV_MUXER 0 -#define CONFIG_EAC3_MUXER 0 -#define CONFIG_F4V_MUXER 0 -#define CONFIG_FFMETADATA_MUXER 0 -#define CONFIG_FIFO_MUXER 0 -#define CONFIG_FIFO_TEST_MUXER 0 -#define CONFIG_FILMSTRIP_MUXER 0 -#define CONFIG_FITS_MUXER 0 -#define CONFIG_FLAC_MUXER 0 -#define CONFIG_FLV_MUXER 0 -#define CONFIG_FRAMECRC_MUXER 0 -#define CONFIG_FRAMEHASH_MUXER 0 -#define CONFIG_FRAMEMD5_MUXER 0 -#define CONFIG_G722_MUXER 0 -#define CONFIG_G723_1_MUXER 0 -#define CONFIG_G726_MUXER 0 -#define CONFIG_G726LE_MUXER 0 -#define CONFIG_GIF_MUXER 0 -#define CONFIG_GSM_MUXER 0 -#define CONFIG_GXF_MUXER 0 -#define CONFIG_H261_MUXER 0 -#define CONFIG_H263_MUXER 0 -#define CONFIG_H264_MUXER 0 -#define CONFIG_HASH_MUXER 0 -#define CONFIG_HDS_MUXER 0 -#define CONFIG_HEVC_MUXER 0 -#define CONFIG_HLS_MUXER 0 -#define CONFIG_ICO_MUXER 0 -#define CONFIG_ILBC_MUXER 0 -#define CONFIG_IMAGE2_MUXER 0 -#define CONFIG_IMAGE2PIPE_MUXER 0 -#define CONFIG_IPOD_MUXER 0 -#define CONFIG_IRCAM_MUXER 0 -#define CONFIG_ISMV_MUXER 0 -#define CONFIG_IVF_MUXER 0 -#define CONFIG_JACOSUB_MUXER 0 -#define CONFIG_LATM_MUXER 0 -#define CONFIG_LRC_MUXER 0 -#define CONFIG_M4V_MUXER 0 -#define CONFIG_MD5_MUXER 0 -#define CONFIG_MATROSKA_MUXER 0 -#define CONFIG_MATROSKA_AUDIO_MUXER 0 -#define CONFIG_MICRODVD_MUXER 0 -#define CONFIG_MJPEG_MUXER 0 -#define CONFIG_MLP_MUXER 0 -#define CONFIG_MMF_MUXER 0 -#define CONFIG_MOV_MUXER 0 -#define CONFIG_MP2_MUXER 0 -#define CONFIG_MP3_MUXER 0 -#define CONFIG_MP4_MUXER 0 -#define CONFIG_MPEG1SYSTEM_MUXER 0 -#define CONFIG_MPEG1VCD_MUXER 0 -#define CONFIG_MPEG1VIDEO_MUXER 0 -#define CONFIG_MPEG2DVD_MUXER 0 -#define CONFIG_MPEG2SVCD_MUXER 0 -#define CONFIG_MPEG2VIDEO_MUXER 0 -#define CONFIG_MPEG2VOB_MUXER 0 -#define CONFIG_MPEGTS_MUXER 0 -#define CONFIG_MPJPEG_MUXER 0 -#define CONFIG_MXF_MUXER 0 -#define CONFIG_MXF_D10_MUXER 0 -#define CONFIG_MXF_OPATOM_MUXER 0 -#define CONFIG_NULL_MUXER 0 -#define CONFIG_NUT_MUXER 0 -#define CONFIG_OGA_MUXER 0 -#define CONFIG_OGG_MUXER 0 -#define CONFIG_OGV_MUXER 0 -#define CONFIG_OMA_MUXER 0 -#define CONFIG_OPUS_MUXER 0 -#define CONFIG_PCM_ALAW_MUXER 0 -#define CONFIG_PCM_MULAW_MUXER 0 -#define CONFIG_PCM_VIDC_MUXER 0 -#define CONFIG_PCM_F64BE_MUXER 0 -#define CONFIG_PCM_F64LE_MUXER 0 -#define CONFIG_PCM_F32BE_MUXER 0 -#define CONFIG_PCM_F32LE_MUXER 0 -#define CONFIG_PCM_S32BE_MUXER 0 -#define CONFIG_PCM_S32LE_MUXER 0 -#define CONFIG_PCM_S24BE_MUXER 0 -#define CONFIG_PCM_S24LE_MUXER 0 -#define CONFIG_PCM_S16BE_MUXER 0 -#define CONFIG_PCM_S16LE_MUXER 0 -#define CONFIG_PCM_S8_MUXER 0 -#define CONFIG_PCM_U32BE_MUXER 0 -#define CONFIG_PCM_U32LE_MUXER 0 -#define CONFIG_PCM_U24BE_MUXER 0 -#define CONFIG_PCM_U24LE_MUXER 0 -#define CONFIG_PCM_U16BE_MUXER 0 -#define CONFIG_PCM_U16LE_MUXER 0 -#define CONFIG_PCM_U8_MUXER 0 -#define CONFIG_PSP_MUXER 0 -#define CONFIG_RAWVIDEO_MUXER 0 -#define CONFIG_RM_MUXER 0 -#define CONFIG_ROQ_MUXER 0 -#define CONFIG_RSO_MUXER 0 -#define CONFIG_RTP_MUXER 0 -#define CONFIG_RTP_MPEGTS_MUXER 0 -#define CONFIG_RTSP_MUXER 0 -#define CONFIG_SAP_MUXER 0 -#define CONFIG_SBC_MUXER 0 -#define CONFIG_SCC_MUXER 0 -#define CONFIG_SEGAFILM_MUXER 0 -#define CONFIG_SEGMENT_MUXER 0 -#define CONFIG_STREAM_SEGMENT_MUXER 0 -#define CONFIG_SINGLEJPEG_MUXER 0 -#define CONFIG_SMJPEG_MUXER 0 -#define CONFIG_SMOOTHSTREAMING_MUXER 0 -#define CONFIG_SOX_MUXER 0 -#define CONFIG_SPX_MUXER 0 -#define CONFIG_SPDIF_MUXER 0 -#define CONFIG_SRT_MUXER 0 -#define CONFIG_SUP_MUXER 0 -#define CONFIG_SWF_MUXER 0 -#define CONFIG_TEE_MUXER 0 -#define CONFIG_TG2_MUXER 0 -#define CONFIG_TGP_MUXER 0 -#define CONFIG_MKVTIMESTAMP_V2_MUXER 0 -#define CONFIG_TRUEHD_MUXER 0 -#define CONFIG_TTA_MUXER 0 -#define CONFIG_UNCODEDFRAMECRC_MUXER 0 -#define CONFIG_VC1_MUXER 0 -#define CONFIG_VC1T_MUXER 0 -#define CONFIG_VOC_MUXER 0 -#define CONFIG_W64_MUXER 0 -#define CONFIG_WAV_MUXER 0 -#define CONFIG_WEBM_MUXER 0 -#define CONFIG_WEBM_DASH_MANIFEST_MUXER 0 -#define CONFIG_WEBM_CHUNK_MUXER 0 -#define CONFIG_WEBP_MUXER 0 -#define CONFIG_WEBVTT_MUXER 0 -#define CONFIG_WTV_MUXER 0 -#define CONFIG_WV_MUXER 0 -#define CONFIG_YUV4MPEGPIPE_MUXER 0 -#define CONFIG_CHROMAPRINT_MUXER 0 -#define CONFIG_ASYNC_PROTOCOL 1 -#define CONFIG_BLURAY_PROTOCOL 0 -#define CONFIG_CACHE_PROTOCOL 1 -#define CONFIG_CONCAT_PROTOCOL 1 -#define CONFIG_CRYPTO_PROTOCOL 1 -#define CONFIG_DATA_PROTOCOL 1 -#define CONFIG_FFRTMPCRYPT_PROTOCOL 0 -#define CONFIG_FFRTMPHTTP_PROTOCOL 0 -#define CONFIG_FILE_PROTOCOL 1 -#define CONFIG_FTP_PROTOCOL 0 -#define CONFIG_GOPHER_PROTOCOL 0 -#define CONFIG_HLS_PROTOCOL 1 -#define CONFIG_HTTP_PROTOCOL 0 -#define CONFIG_HTTPPROXY_PROTOCOL 0 -#define CONFIG_HTTPS_PROTOCOL 0 -#define CONFIG_ICECAST_PROTOCOL 0 -#define CONFIG_MMSH_PROTOCOL 0 -#define CONFIG_MMST_PROTOCOL 0 -#define CONFIG_MD5_PROTOCOL 1 -#define CONFIG_PIPE_PROTOCOL 1 -#define CONFIG_PROMPEG_PROTOCOL 1 -#define CONFIG_RTMP_PROTOCOL 0 -#define CONFIG_RTMPE_PROTOCOL 0 -#define CONFIG_RTMPS_PROTOCOL 0 -#define CONFIG_RTMPT_PROTOCOL 0 -#define CONFIG_RTMPTE_PROTOCOL 0 -#define CONFIG_RTMPTS_PROTOCOL 0 -#define CONFIG_RTP_PROTOCOL 0 -#define CONFIG_SCTP_PROTOCOL 0 -#define CONFIG_SRTP_PROTOCOL 0 -#define CONFIG_SUBFILE_PROTOCOL 1 -#define CONFIG_TEE_PROTOCOL 1 -#define CONFIG_TCP_PROTOCOL 0 -#define CONFIG_TLS_PROTOCOL 0 -#define CONFIG_UDP_PROTOCOL 0 -#define CONFIG_UDPLITE_PROTOCOL 0 -#define CONFIG_UNIX_PROTOCOL 0 -#define CONFIG_LIBRTMP_PROTOCOL 0 -#define CONFIG_LIBRTMPE_PROTOCOL 0 -#define CONFIG_LIBRTMPS_PROTOCOL 0 -#define CONFIG_LIBRTMPT_PROTOCOL 0 -#define CONFIG_LIBRTMPTE_PROTOCOL 0 -#define CONFIG_LIBSRT_PROTOCOL 0 -#define CONFIG_LIBSSH_PROTOCOL 0 -#define CONFIG_LIBSMBCLIENT_PROTOCOL 0 -#endif /* FFMPEG_CONFIG_H */ diff --git a/build/ffmpeg/config-x86.asm b/build/ffmpeg/config-x86.asm deleted file mode 100755 index 5475555d4..000000000 --- a/build/ffmpeg/config-x86.asm +++ /dev/null @@ -1,2460 +0,0 @@ -; Automatically generated by configure - do not modify! -%define ARCH_AARCH64 0 -%define ARCH_ALPHA 0 -%define ARCH_ARM 0 -%define ARCH_AVR32 0 -%define ARCH_AVR32_AP 0 -%define ARCH_AVR32_UC 0 -%define ARCH_BFIN 0 -%define ARCH_IA64 0 -%define ARCH_M68K 0 -%define ARCH_MIPS 0 -%define ARCH_MIPS64 0 -%define ARCH_PARISC 0 -%define ARCH_PPC 0 -%define ARCH_PPC64 0 -%define ARCH_S390 0 -%define ARCH_SH4 0 -%define ARCH_SPARC 0 -%define ARCH_SPARC64 0 -%define ARCH_TILEGX 0 -%define ARCH_TILEPRO 0 -%define ARCH_TOMI 0 -%define ARCH_X86 1 -%define ARCH_X86_32 1 -%define ARCH_X86_64 0 -%define HAVE_ARMV5TE 0 -%define HAVE_ARMV6 0 -%define HAVE_ARMV6T2 0 -%define HAVE_ARMV8 0 -%define HAVE_NEON 0 -%define HAVE_VFP 0 -%define HAVE_VFPV3 0 -%define HAVE_SETEND 0 -%define HAVE_ALTIVEC 0 -%define HAVE_DCBZL 0 -%define HAVE_LDBRX 0 -%define HAVE_POWER8 0 -%define HAVE_PPC4XX 0 -%define HAVE_VSX 0 -%define HAVE_AESNI 1 -%define HAVE_AMD3DNOW 1 -%define HAVE_AMD3DNOWEXT 1 -%define HAVE_AVX 1 -%define HAVE_AVX2 1 -%define HAVE_AVX512 1 -%define HAVE_FMA3 1 -%define HAVE_FMA4 1 -%define HAVE_MMX 1 -%define HAVE_MMXEXT 1 -%define HAVE_SSE 1 -%define HAVE_SSE2 1 -%define HAVE_SSE3 1 -%define HAVE_SSE4 1 -%define HAVE_SSE42 1 -%define HAVE_SSSE3 1 -%define HAVE_XOP 1 -%define HAVE_CPUNOP 1 -%define HAVE_I686 1 -%define HAVE_MIPSFPU 0 -%define HAVE_MIPS32R2 0 -%define HAVE_MIPS32R5 0 -%define HAVE_MIPS64R2 0 -%define HAVE_MIPS32R6 0 -%define HAVE_MIPS64R6 0 -%define HAVE_MIPSDSP 0 -%define HAVE_MIPSDSPR2 0 -%define HAVE_MSA 0 -%define HAVE_LOONGSON2 0 -%define HAVE_LOONGSON3 0 -%define HAVE_MMI 0 -%define HAVE_ARMV5TE_EXTERNAL 0 -%define HAVE_ARMV6_EXTERNAL 0 -%define HAVE_ARMV6T2_EXTERNAL 0 -%define HAVE_ARMV8_EXTERNAL 0 -%define HAVE_NEON_EXTERNAL 0 -%define HAVE_VFP_EXTERNAL 0 -%define HAVE_VFPV3_EXTERNAL 0 -%define HAVE_SETEND_EXTERNAL 0 -%define HAVE_ALTIVEC_EXTERNAL 0 -%define HAVE_DCBZL_EXTERNAL 0 -%define HAVE_LDBRX_EXTERNAL 0 -%define HAVE_POWER8_EXTERNAL 0 -%define HAVE_PPC4XX_EXTERNAL 0 -%define HAVE_VSX_EXTERNAL 0 -%define HAVE_AESNI_EXTERNAL 1 -%define HAVE_AMD3DNOW_EXTERNAL 1 -%define HAVE_AMD3DNOWEXT_EXTERNAL 1 -%define HAVE_AVX_EXTERNAL 1 -%define HAVE_AVX2_EXTERNAL 0 -%define HAVE_AVX512_EXTERNAL 0 -%define HAVE_FMA3_EXTERNAL 1 -%define HAVE_FMA4_EXTERNAL 1 -%define HAVE_MMX_EXTERNAL 1 -%define HAVE_MMXEXT_EXTERNAL 1 -%define HAVE_SSE_EXTERNAL 1 -%define HAVE_SSE2_EXTERNAL 1 -%define HAVE_SSE3_EXTERNAL 1 -%define HAVE_SSE4_EXTERNAL 1 -%define HAVE_SSE42_EXTERNAL 1 -%define HAVE_SSSE3_EXTERNAL 1 -%define HAVE_XOP_EXTERNAL 1 -%define HAVE_CPUNOP_EXTERNAL 0 -%define HAVE_I686_EXTERNAL 0 -%define HAVE_MIPSFPU_EXTERNAL 0 -%define HAVE_MIPS32R2_EXTERNAL 0 -%define HAVE_MIPS32R5_EXTERNAL 0 -%define HAVE_MIPS64R2_EXTERNAL 0 -%define HAVE_MIPS32R6_EXTERNAL 0 -%define HAVE_MIPS64R6_EXTERNAL 0 -%define HAVE_MIPSDSP_EXTERNAL 0 -%define HAVE_MIPSDSPR2_EXTERNAL 0 -%define HAVE_MSA_EXTERNAL 0 -%define HAVE_LOONGSON2_EXTERNAL 0 -%define HAVE_LOONGSON3_EXTERNAL 0 -%define HAVE_MMI_EXTERNAL 0 -%define HAVE_ARMV5TE_INLINE 0 -%define HAVE_ARMV6_INLINE 0 -%define HAVE_ARMV6T2_INLINE 0 -%define HAVE_ARMV8_INLINE 0 -%define HAVE_NEON_INLINE 0 -%define HAVE_VFP_INLINE 0 -%define HAVE_VFPV3_INLINE 0 -%define HAVE_SETEND_INLINE 0 -%define HAVE_ALTIVEC_INLINE 0 -%define HAVE_DCBZL_INLINE 0 -%define HAVE_LDBRX_INLINE 0 -%define HAVE_POWER8_INLINE 0 -%define HAVE_PPC4XX_INLINE 0 -%define HAVE_VSX_INLINE 0 -%define HAVE_AESNI_INLINE 0 -%define HAVE_AMD3DNOW_INLINE 0 -%define HAVE_AMD3DNOWEXT_INLINE 0 -%define HAVE_AVX_INLINE 0 -%define HAVE_AVX2_INLINE 0 -%define HAVE_AVX512_INLINE 0 -%define HAVE_FMA3_INLINE 0 -%define HAVE_FMA4_INLINE 0 -%define HAVE_MMX_INLINE 0 -%define HAVE_MMXEXT_INLINE 0 -%define HAVE_SSE_INLINE 0 -%define HAVE_SSE2_INLINE 0 -%define HAVE_SSE3_INLINE 0 -%define HAVE_SSE4_INLINE 0 -%define HAVE_SSE42_INLINE 0 -%define HAVE_SSSE3_INLINE 0 -%define HAVE_XOP_INLINE 0 -%define HAVE_CPUNOP_INLINE 0 -%define HAVE_I686_INLINE 0 -%define HAVE_MIPSFPU_INLINE 0 -%define HAVE_MIPS32R2_INLINE 0 -%define HAVE_MIPS32R5_INLINE 0 -%define HAVE_MIPS64R2_INLINE 0 -%define HAVE_MIPS32R6_INLINE 0 -%define HAVE_MIPS64R6_INLINE 0 -%define HAVE_MIPSDSP_INLINE 0 -%define HAVE_MIPSDSPR2_INLINE 0 -%define HAVE_MSA_INLINE 0 -%define HAVE_LOONGSON2_INLINE 0 -%define HAVE_LOONGSON3_INLINE 0 -%define HAVE_MMI_INLINE 0 -%define HAVE_ALIGNED_STACK 0 -%define HAVE_FAST_64BIT 0 -%define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 -%define HAVE_LOCAL_ALIGNED 1 -%define HAVE_SIMD_ALIGN_16 1 -%define HAVE_SIMD_ALIGN_32 1 -%define HAVE_SIMD_ALIGN_64 1 -%define HAVE_ATOMIC_CAS_PTR 0 -%define HAVE_MACHINE_RW_BARRIER 0 -%define HAVE_MEMORYBARRIER 1 -%define HAVE_MM_EMPTY 1 -%define HAVE_RDTSC 1 -%define HAVE_SEM_TIMEDWAIT 0 -%define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0 -%define HAVE_CABS 0 -%define HAVE_CEXP 0 -%define HAVE_INLINE_ASM 0 -%define HAVE_SYMVER 0 -%define HAVE_X86ASM 1 -%define HAVE_BIGENDIAN 0 -%define HAVE_FAST_UNALIGNED 1 -%define HAVE_ARPA_INET_H 0 -%define HAVE_ASM_TYPES_H 0 -%define HAVE_CDIO_PARANOIA_H 0 -%define HAVE_CDIO_PARANOIA_PARANOIA_H 0 -%define HAVE_CUDA_H 0 -%define HAVE_DISPATCH_DISPATCH_H 0 -%define HAVE_DEV_BKTR_IOCTL_BT848_H 0 -%define HAVE_DEV_BKTR_IOCTL_METEOR_H 0 -%define HAVE_DEV_IC_BT8XX_H 0 -%define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0 -%define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0 -%define HAVE_DIRECT_H 1 -%define HAVE_DIRENT_H 0 -%define HAVE_DXGIDEBUG_H 1 -%define HAVE_DXVA_H 1 -%define HAVE_ES2_GL_H 0 -%define HAVE_GSM_H 0 -%define HAVE_IO_H 1 -%define HAVE_LINUX_PERF_EVENT_H 0 -%define HAVE_MACHINE_IOCTL_BT848_H 0 -%define HAVE_MACHINE_IOCTL_METEOR_H 0 -%define HAVE_MALLOC_H 1 -%define HAVE_OPENCV2_CORE_CORE_C_H 0 -%define HAVE_OPENGL_GL3_H 0 -%define HAVE_POLL_H 0 -%define HAVE_SYS_PARAM_H 0 -%define HAVE_SYS_RESOURCE_H 0 -%define HAVE_SYS_SELECT_H 0 -%define HAVE_SYS_SOUNDCARD_H 0 -%define HAVE_SYS_TIME_H 0 -%define HAVE_SYS_UN_H 0 -%define HAVE_SYS_VIDEOIO_H 0 -%define HAVE_TERMIOS_H 0 -%define HAVE_UDPLITE_H 0 -%define HAVE_UNISTD_H 0 -%define HAVE_VALGRIND_VALGRIND_H 0 -%define HAVE_WINDOWS_H 1 -%define HAVE_WINSOCK2_H 0 -%define HAVE_INTRINSICS_NEON 0 -%define HAVE_ATANF 1 -%define HAVE_ATAN2F 1 -%define HAVE_CBRT 1 -%define HAVE_CBRTF 1 -%define HAVE_COPYSIGN 1 -%define HAVE_COSF 1 -%define HAVE_ERF 1 -%define HAVE_EXP2 1 -%define HAVE_EXP2F 1 -%define HAVE_EXPF 1 -%define HAVE_HYPOT 1 -%define HAVE_ISFINITE 1 -%define HAVE_ISINF 1 -%define HAVE_ISNAN 1 -%define HAVE_LDEXPF 1 -%define HAVE_LLRINT 1 -%define HAVE_LLRINTF 1 -%define HAVE_LOG2 1 -%define HAVE_LOG2F 1 -%define HAVE_LOG10F 1 -%define HAVE_LRINT 1 -%define HAVE_LRINTF 1 -%define HAVE_POWF 1 -%define HAVE_RINT 1 -%define HAVE_ROUND 1 -%define HAVE_ROUNDF 1 -%define HAVE_SINF 1 -%define HAVE_TRUNC 1 -%define HAVE_TRUNCF 1 -%define HAVE_DOS_PATHS 1 -%define HAVE_LIBC_MSVCRT 1 -%define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0 -%define HAVE_SECTION_DATA_REL_RO 0 -%define HAVE_THREADS 1 -%define HAVE_UWP 0 -%define HAVE_WINRT 0 -%define HAVE_ACCESS 1 -%define HAVE_ALIGNED_MALLOC 1 -%define HAVE_ARC4RANDOM 0 -%define HAVE_CLOCK_GETTIME 0 -%define HAVE_CLOSESOCKET 0 -%define HAVE_COMMANDLINETOARGVW 1 -%define HAVE_FCNTL 0 -%define HAVE_GETADDRINFO 0 -%define HAVE_GETHRTIME 0 -%define HAVE_GETOPT 0 -%define HAVE_GETPROCESSAFFINITYMASK 1 -%define HAVE_GETPROCESSMEMORYINFO 1 -%define HAVE_GETPROCESSTIMES 1 -%define HAVE_GETRUSAGE 0 -%define HAVE_GETSYSTEMTIMEASFILETIME 1 -%define HAVE_GETTIMEOFDAY 0 -%define HAVE_GLOB 0 -%define HAVE_GLXGETPROCADDRESS 0 -%define HAVE_GMTIME_R 0 -%define HAVE_INET_ATON 0 -%define HAVE_ISATTY 1 -%define HAVE_KBHIT 1 -%define HAVE_LOCALTIME_R 0 -%define HAVE_LSTAT 0 -%define HAVE_LZO1X_999_COMPRESS 0 -%define HAVE_MACH_ABSOLUTE_TIME 0 -%define HAVE_MAPVIEWOFFILE 1 -%define HAVE_MEMALIGN 0 -%define HAVE_MKSTEMP 0 -%define HAVE_MMAP 0 -%define HAVE_MPROTECT 0 -%define HAVE_NANOSLEEP 0 -%define HAVE_PEEKNAMEDPIPE 1 -%define HAVE_POSIX_MEMALIGN 0 -%define HAVE_PTHREAD_CANCEL 0 -%define HAVE_SCHED_GETAFFINITY 0 -%define HAVE_SECITEMIMPORT 0 -%define HAVE_SETCONSOLETEXTATTRIBUTE 1 -%define HAVE_SETCONSOLECTRLHANDLER 1 -%define HAVE_SETMODE 1 -%define HAVE_SETRLIMIT 0 -%define HAVE_SLEEP 1 -%define HAVE_STRERROR_R 0 -%define HAVE_SYSCONF 0 -%define HAVE_SYSCTL 0 -%define HAVE_USLEEP 0 -%define HAVE_UTGETOSTYPEFROMSTRING 0 -%define HAVE_VIRTUALALLOC 1 -%define HAVE_WGLGETPROCADDRESS 0 -%define HAVE_BCRYPT 1 -%define HAVE_VAAPI_DRM 0 -%define HAVE_VAAPI_X11 0 -%define HAVE_VDPAU_X11 0 -%define HAVE_PTHREADS 0 -%define HAVE_OS2THREADS 0 -%define HAVE_W32THREADS 1 -%define HAVE_AS_ARCH_DIRECTIVE 0 -%define HAVE_AS_DN_DIRECTIVE 0 -%define HAVE_AS_FPU_DIRECTIVE 0 -%define HAVE_AS_FUNC 0 -%define HAVE_AS_OBJECT_ARCH 0 -%define HAVE_ASM_MOD_Q 0 -%define HAVE_BLOCKS_EXTENSION 0 -%define HAVE_EBP_AVAILABLE 0 -%define HAVE_EBX_AVAILABLE 0 -%define HAVE_GNU_AS 0 -%define HAVE_GNU_WINDRES 0 -%define HAVE_IBM_ASM 0 -%define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0 -%define HAVE_INLINE_ASM_LABELS 0 -%define HAVE_INLINE_ASM_NONLOCAL_LABELS 0 -%define HAVE_PRAGMA_DEPRECATED 1 -%define HAVE_RSYNC_CONTIMEOUT 0 -%define HAVE_SYMVER_ASM_LABEL 0 -%define HAVE_SYMVER_GNU_ASM 0 -%define HAVE_VFP_ARGS 0 -%define HAVE_XFORM_ASM 0 -%define HAVE_XMM_CLOBBERS 0 -%define HAVE_KCMVIDEOCODECTYPE_HEVC 0 -%define HAVE_SOCKLEN_T 0 -%define HAVE_STRUCT_ADDRINFO 0 -%define HAVE_STRUCT_GROUP_SOURCE_REQ 0 -%define HAVE_STRUCT_IP_MREQ_SOURCE 0 -%define HAVE_STRUCT_IPV6_MREQ 0 -%define HAVE_STRUCT_MSGHDR_MSG_FLAGS 0 -%define HAVE_STRUCT_POLLFD 0 -%define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0 -%define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0 -%define HAVE_STRUCT_SOCKADDR_IN6 0 -%define HAVE_STRUCT_SOCKADDR_SA_LEN 0 -%define HAVE_STRUCT_SOCKADDR_STORAGE 0 -%define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0 -%define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0 -%define HAVE_MAKEINFO 1 -%define HAVE_MAKEINFO_HTML 0 -%define HAVE_OPENCL_D3D11 0 -%define HAVE_OPENCL_DRM_ARM 0 -%define HAVE_OPENCL_DRM_BEIGNET 0 -%define HAVE_OPENCL_DXVA2 0 -%define HAVE_OPENCL_VAAPI_BEIGNET 0 -%define HAVE_OPENCL_VAAPI_INTEL_MEDIA 0 -%define HAVE_PERL 1 -%define HAVE_POD2MAN 0 -%define HAVE_TEXI2HTML 0 -%define CONFIG_DOC 0 -%define CONFIG_HTMLPAGES 0 -%define CONFIG_MANPAGES 0 -%define CONFIG_PODPAGES 1 -%define CONFIG_TXTPAGES 1 -%define CONFIG_AVIO_DIR_CMD_EXAMPLE 1 -%define CONFIG_AVIO_READING_EXAMPLE 1 -%define CONFIG_DECODE_AUDIO_EXAMPLE 1 -%define CONFIG_DECODE_VIDEO_EXAMPLE 1 -%define CONFIG_DEMUXING_DECODING_EXAMPLE 1 -%define CONFIG_ENCODE_AUDIO_EXAMPLE 1 -%define CONFIG_ENCODE_VIDEO_EXAMPLE 1 -%define CONFIG_EXTRACT_MVS_EXAMPLE 1 -%define CONFIG_FILTER_AUDIO_EXAMPLE 0 -%define CONFIG_FILTERING_AUDIO_EXAMPLE 0 -%define CONFIG_FILTERING_VIDEO_EXAMPLE 0 -%define CONFIG_HTTP_MULTICLIENT_EXAMPLE 0 -%define CONFIG_HW_DECODE_EXAMPLE 1 -%define CONFIG_METADATA_EXAMPLE 1 -%define CONFIG_MUXING_EXAMPLE 1 -%define CONFIG_QSVDEC_EXAMPLE 0 -%define CONFIG_REMUXING_EXAMPLE 1 -%define CONFIG_RESAMPLING_AUDIO_EXAMPLE 1 -%define CONFIG_SCALING_VIDEO_EXAMPLE 1 -%define CONFIG_TRANSCODE_AAC_EXAMPLE 1 -%define CONFIG_TRANSCODING_EXAMPLE 0 -%define CONFIG_VAAPI_ENCODE_EXAMPLE 0 -%define CONFIG_VAAPI_TRANSCODE_EXAMPLE 0 -%define CONFIG_AVISYNTH 0 -%define CONFIG_FREI0R 0 -%define CONFIG_LIBCDIO 0 -%define CONFIG_LIBDAVS2 0 -%define CONFIG_LIBRUBBERBAND 0 -%define CONFIG_LIBVIDSTAB 0 -%define CONFIG_LIBX264 0 -%define CONFIG_LIBX265 0 -%define CONFIG_LIBXAVS 0 -%define CONFIG_LIBXAVS2 0 -%define CONFIG_LIBXVID 0 -%define CONFIG_DECKLINK 0 -%define CONFIG_LIBNDI_NEWTEK 0 -%define CONFIG_LIBFDK_AAC 0 -%define CONFIG_OPENSSL 0 -%define CONFIG_LIBTLS 0 -%define CONFIG_GMP 0 -%define CONFIG_LIBLENSFUN 0 -%define CONFIG_LIBOPENCORE_AMRNB 0 -%define CONFIG_LIBOPENCORE_AMRWB 0 -%define CONFIG_LIBVMAF 0 -%define CONFIG_LIBVO_AMRWBENC 0 -%define CONFIG_MBEDTLS 0 -%define CONFIG_RKMPP 0 -%define CONFIG_LIBSMBCLIENT 0 -%define CONFIG_CHROMAPRINT 0 -%define CONFIG_GCRYPT 0 -%define CONFIG_GNUTLS 0 -%define CONFIG_JNI 0 -%define CONFIG_LADSPA 0 -%define CONFIG_LIBAOM 0 -%define CONFIG_LIBASS 0 -%define CONFIG_LIBBLURAY 0 -%define CONFIG_LIBBS2B 0 -%define CONFIG_LIBCACA 0 -%define CONFIG_LIBCELT 0 -%define CONFIG_LIBCODEC2 0 -%define CONFIG_LIBDAV1D 0 -%define CONFIG_LIBDC1394 0 -%define CONFIG_LIBDRM 0 -%define CONFIG_LIBFLITE 0 -%define CONFIG_LIBFONTCONFIG 0 -%define CONFIG_LIBFREETYPE 0 -%define CONFIG_LIBFRIBIDI 0 -%define CONFIG_LIBGME 0 -%define CONFIG_LIBGSM 0 -%define CONFIG_LIBIEC61883 0 -%define CONFIG_LIBILBC 0 -%define CONFIG_LIBJACK 0 -%define CONFIG_LIBKLVANC 0 -%define CONFIG_LIBKVAZAAR 0 -%define CONFIG_LIBMODPLUG 0 -%define CONFIG_LIBMP3LAME 0 -%define CONFIG_LIBMYSOFA 0 -%define CONFIG_LIBOPENCV 0 -%define CONFIG_LIBOPENH264 0 -%define CONFIG_LIBOPENJPEG 0 -%define CONFIG_LIBOPENMPT 0 -%define CONFIG_LIBOPUS 0 -%define CONFIG_LIBPULSE 0 -%define CONFIG_LIBRSVG 0 -%define CONFIG_LIBRTMP 0 -%define CONFIG_LIBSHINE 0 -%define CONFIG_LIBSMBCLIENT 0 -%define CONFIG_LIBSNAPPY 0 -%define CONFIG_LIBSOXR 0 -%define CONFIG_LIBSPEEX 0 -%define CONFIG_LIBSRT 0 -%define CONFIG_LIBSSH 0 -%define CONFIG_LIBTENSORFLOW 0 -%define CONFIG_LIBTESSERACT 0 -%define CONFIG_LIBTHEORA 0 -%define CONFIG_LIBTWOLAME 0 -%define CONFIG_LIBV4L2 0 -%define CONFIG_LIBVORBIS 0 -%define CONFIG_LIBVPX 0 -%define CONFIG_LIBWAVPACK 0 -%define CONFIG_LIBWEBP 0 -%define CONFIG_LIBXML2 0 -%define CONFIG_LIBZIMG 0 -%define CONFIG_LIBZMQ 0 -%define CONFIG_LIBZVBI 0 -%define CONFIG_LV2 0 -%define CONFIG_MEDIACODEC 0 -%define CONFIG_OPENAL 0 -%define CONFIG_OPENGL 0 -%define CONFIG_VAPOURSYNTH 0 -%define CONFIG_ALSA 0 -%define CONFIG_APPKIT 0 -%define CONFIG_AVFOUNDATION 0 -%define CONFIG_BZLIB 0 -%define CONFIG_COREIMAGE 0 -%define CONFIG_ICONV 0 -%define CONFIG_LIBXCB 0 -%define CONFIG_LIBXCB_SHM 0 -%define CONFIG_LIBXCB_SHAPE 0 -%define CONFIG_LIBXCB_XFIXES 0 -%define CONFIG_LZMA 0 -%define CONFIG_SCHANNEL 1 -%define CONFIG_SDL2 0 -%define CONFIG_SECURETRANSPORT 0 -%define CONFIG_SNDIO 0 -%define CONFIG_XLIB 0 -%define CONFIG_ZLIB 1 -%define CONFIG_CUDA_SDK 0 -%define CONFIG_LIBNPP 0 -%define CONFIG_LIBMFX 0 -%define CONFIG_MMAL 0 -%define CONFIG_OMX 0 -%define CONFIG_OPENCL 0 -%define CONFIG_AMF 0 -%define CONFIG_AUDIOTOOLBOX 0 -%define CONFIG_CRYSTALHD 0 -%define CONFIG_CUDA 0 -%define CONFIG_CUVID 0 -%define CONFIG_D3D11VA 0 -%define CONFIG_DXVA2 0 -%define CONFIG_FFNVCODEC 0 -%define CONFIG_NVDEC 0 -%define CONFIG_NVENC 0 -%define CONFIG_VAAPI 0 -%define CONFIG_VDPAU 0 -%define CONFIG_VIDEOTOOLBOX 0 -%define CONFIG_V4L2_M2M 0 -%define CONFIG_XVMC 0 -%define CONFIG_FTRAPV 0 -%define CONFIG_GRAY 0 -%define CONFIG_HARDCODED_TABLES 0 -%define CONFIG_OMX_RPI 0 -%define CONFIG_RUNTIME_CPUDETECT 1 -%define CONFIG_SAFE_BITSTREAM_READER 1 -%define CONFIG_SHARED 0 -%define CONFIG_SMALL 1 -%define CONFIG_STATIC 1 -%define CONFIG_SWSCALE_ALPHA 1 -%define CONFIG_GPL 1 -%define CONFIG_NONFREE 0 -%define CONFIG_VERSION3 0 -%define CONFIG_AVDEVICE 1 -%define CONFIG_AVFILTER 0 -%define CONFIG_SWSCALE 1 -%define CONFIG_POSTPROC 0 -%define CONFIG_AVFORMAT 1 -%define CONFIG_AVCODEC 1 -%define CONFIG_SWRESAMPLE 1 -%define CONFIG_AVRESAMPLE 0 -%define CONFIG_AVUTIL 1 -%define CONFIG_FFPLAY 0 -%define CONFIG_FFPROBE 0 -%define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 -%define CONFIG_DWT 1 -%define CONFIG_ERROR_RESILIENCE 1 -%define CONFIG_FAAN 1 -%define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 -%define CONFIG_LSP 1 -%define CONFIG_LZO 1 -%define CONFIG_MDCT 1 -%define CONFIG_PIXELUTILS 0 -%define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 -%define CONFIG_AUTODETECT 0 -%define CONFIG_FONTCONFIG 0 -%define CONFIG_LINUX_PERF 0 -%define CONFIG_MEMORY_POISONING 0 -%define CONFIG_NEON_CLOBBER_TEST 0 -%define CONFIG_OSSFUZZ 0 -%define CONFIG_PIC 0 -%define CONFIG_THUMB 0 -%define CONFIG_VALGRIND_BACKTRACE 0 -%define CONFIG_XMM_CLOBBER_TEST 0 -%define CONFIG_BSFS 1 -%define CONFIG_DECODERS 1 -%define CONFIG_ENCODERS 0 -%define CONFIG_HWACCELS 0 -%define CONFIG_PARSERS 1 -%define CONFIG_INDEVS 0 -%define CONFIG_OUTDEVS 0 -%define CONFIG_FILTERS 0 -%define CONFIG_DEMUXERS 1 -%define CONFIG_MUXERS 0 -%define CONFIG_PROTOCOLS 1 -%define CONFIG_AANDCTTABLES 1 -%define CONFIG_AC3DSP 1 -%define CONFIG_ADTS_HEADER 1 -%define CONFIG_AUDIO_FRAME_QUEUE 1 -%define CONFIG_AUDIODSP 1 -%define CONFIG_BLOCKDSP 1 -%define CONFIG_BSWAPDSP 1 -%define CONFIG_CABAC 1 -%define CONFIG_CBS 1 -%define CONFIG_CBS_AV1 1 -%define CONFIG_CBS_H264 1 -%define CONFIG_CBS_H265 1 -%define CONFIG_CBS_JPEG 0 -%define CONFIG_CBS_MPEG2 1 -%define CONFIG_CBS_VP9 1 -%define CONFIG_DIRAC_PARSE 1 -%define CONFIG_DNN 0 -%define CONFIG_DVPROFILE 1 -%define CONFIG_EXIF 1 -%define CONFIG_FAANDCT 1 -%define CONFIG_FAANIDCT 1 -%define CONFIG_FDCTDSP 1 -%define CONFIG_FLACDSP 1 -%define CONFIG_FMTCONVERT 1 -%define CONFIG_FRAME_THREAD_ENCODER 0 -%define CONFIG_G722DSP 1 -%define CONFIG_GOLOMB 1 -%define CONFIG_GPLV3 0 -%define CONFIG_H263DSP 1 -%define CONFIG_H264CHROMA 1 -%define CONFIG_H264DSP 1 -%define CONFIG_H264PARSE 1 -%define CONFIG_H264PRED 1 -%define CONFIG_H264QPEL 1 -%define CONFIG_HEVCPARSE 1 -%define CONFIG_HPELDSP 1 -%define CONFIG_HUFFMAN 1 -%define CONFIG_HUFFYUVDSP 1 -%define CONFIG_HUFFYUVENCDSP 0 -%define CONFIG_IDCTDSP 1 -%define CONFIG_IIRFILTER 0 -%define CONFIG_MDCT15 1 -%define CONFIG_INTRAX8 1 -%define CONFIG_ISO_MEDIA 1 -%define CONFIG_IVIDSP 0 -%define CONFIG_JPEGTABLES 1 -%define CONFIG_LGPLV3 0 -%define CONFIG_LIBX262 0 -%define CONFIG_LLAUDDSP 1 -%define CONFIG_LLVIDDSP 1 -%define CONFIG_LLVIDENCDSP 0 -%define CONFIG_LPC 0 -%define CONFIG_LZF 1 -%define CONFIG_ME_CMP 1 -%define CONFIG_MPEG_ER 1 -%define CONFIG_MPEGAUDIO 1 -%define CONFIG_MPEGAUDIODSP 1 -%define CONFIG_MPEGAUDIOHEADER 1 -%define CONFIG_MPEGVIDEO 1 -%define CONFIG_MPEGVIDEOENC 1 -%define CONFIG_MSS34DSP 1 -%define CONFIG_PIXBLOCKDSP 1 -%define CONFIG_QPELDSP 1 -%define CONFIG_QSV 0 -%define CONFIG_QSVDEC 0 -%define CONFIG_QSVENC 0 -%define CONFIG_QSVVPP 0 -%define CONFIG_RANGECODER 1 -%define CONFIG_RIFFDEC 1 -%define CONFIG_RIFFENC 0 -%define CONFIG_RTPDEC 0 -%define CONFIG_RTPENC_CHAIN 0 -%define CONFIG_RV34DSP 1 -%define CONFIG_SCENE_SAD 0 -%define CONFIG_SINEWIN 1 -%define CONFIG_SNAPPY 1 -%define CONFIG_SRTP 0 -%define CONFIG_STARTCODE 1 -%define CONFIG_TEXTUREDSP 1 -%define CONFIG_TEXTUREDSPENC 0 -%define CONFIG_TPELDSP 1 -%define CONFIG_VAAPI_1 0 -%define CONFIG_VAAPI_ENCODE 0 -%define CONFIG_VC1DSP 1 -%define CONFIG_VIDEODSP 1 -%define CONFIG_VP3DSP 1 -%define CONFIG_VP56DSP 1 -%define CONFIG_VP8DSP 1 -%define CONFIG_WMA_FREQS 1 -%define CONFIG_WMV2DSP 1 -%define CONFIG_AAC_ADTSTOASC_BSF 1 -%define CONFIG_AV1_METADATA_BSF 1 -%define CONFIG_CHOMP_BSF 1 -%define CONFIG_DUMP_EXTRADATA_BSF 1 -%define CONFIG_DCA_CORE_BSF 1 -%define CONFIG_EAC3_CORE_BSF 1 -%define CONFIG_EXTRACT_EXTRADATA_BSF 1 -%define CONFIG_FILTER_UNITS_BSF 1 -%define CONFIG_H264_METADATA_BSF 1 -%define CONFIG_H264_MP4TOANNEXB_BSF 1 -%define CONFIG_H264_REDUNDANT_PPS_BSF 1 -%define CONFIG_HAPQA_EXTRACT_BSF 1 -%define CONFIG_HEVC_METADATA_BSF 1 -%define CONFIG_HEVC_MP4TOANNEXB_BSF 1 -%define CONFIG_IMX_DUMP_HEADER_BSF 1 -%define CONFIG_MJPEG2JPEG_BSF 1 -%define CONFIG_MJPEGA_DUMP_HEADER_BSF 1 -%define CONFIG_MP3_HEADER_DECOMPRESS_BSF 1 -%define CONFIG_MPEG2_METADATA_BSF 1 -%define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 1 -%define CONFIG_MOV2TEXTSUB_BSF 1 -%define CONFIG_NOISE_BSF 1 -%define CONFIG_NULL_BSF 1 -%define CONFIG_PRORES_METADATA_BSF 1 -%define CONFIG_REMOVE_EXTRADATA_BSF 1 -%define CONFIG_TEXT2MOVSUB_BSF 1 -%define CONFIG_TRACE_HEADERS_BSF 1 -%define CONFIG_VP9_METADATA_BSF 1 -%define CONFIG_VP9_RAW_REORDER_BSF 1 -%define CONFIG_VP9_SUPERFRAME_BSF 1 -%define CONFIG_VP9_SUPERFRAME_SPLIT_BSF 1 -%define CONFIG_AASC_DECODER 1 -%define CONFIG_AIC_DECODER 1 -%define CONFIG_ALIAS_PIX_DECODER 1 -%define CONFIG_AMV_DECODER 1 -%define CONFIG_ANM_DECODER 1 -%define CONFIG_ANSI_DECODER 1 -%define CONFIG_APNG_DECODER 1 -%define CONFIG_ASV1_DECODER 1 -%define CONFIG_ASV2_DECODER 1 -%define CONFIG_AURA_DECODER 1 -%define CONFIG_AURA2_DECODER 1 -%define CONFIG_AVRP_DECODER 1 -%define CONFIG_AVRN_DECODER 1 -%define CONFIG_AVS_DECODER 1 -%define CONFIG_AVUI_DECODER 1 -%define CONFIG_AYUV_DECODER 1 -%define CONFIG_BETHSOFTVID_DECODER 1 -%define CONFIG_BFI_DECODER 1 -%define CONFIG_BINK_DECODER 1 -%define CONFIG_BITPACKED_DECODER 1 -%define CONFIG_BMP_DECODER 1 -%define CONFIG_BMV_VIDEO_DECODER 1 -%define CONFIG_BRENDER_PIX_DECODER 1 -%define CONFIG_C93_DECODER 1 -%define CONFIG_CAVS_DECODER 1 -%define CONFIG_CDGRAPHICS_DECODER 1 -%define CONFIG_CDXL_DECODER 1 -%define CONFIG_CFHD_DECODER 1 -%define CONFIG_CINEPAK_DECODER 1 -%define CONFIG_CLEARVIDEO_DECODER 1 -%define CONFIG_CLJR_DECODER 1 -%define CONFIG_CLLC_DECODER 1 -%define CONFIG_COMFORTNOISE_DECODER 1 -%define CONFIG_CPIA_DECODER 1 -%define CONFIG_CSCD_DECODER 1 -%define CONFIG_CYUV_DECODER 1 -%define CONFIG_DDS_DECODER 1 -%define CONFIG_DFA_DECODER 1 -%define CONFIG_DIRAC_DECODER 1 -%define CONFIG_DNXHD_DECODER 1 -%define CONFIG_DPX_DECODER 1 -%define CONFIG_DSICINVIDEO_DECODER 1 -%define CONFIG_DVAUDIO_DECODER 1 -%define CONFIG_DVVIDEO_DECODER 1 -%define CONFIG_DXA_DECODER 1 -%define CONFIG_DXTORY_DECODER 1 -%define CONFIG_DXV_DECODER 1 -%define CONFIG_EACMV_DECODER 1 -%define CONFIG_EAMAD_DECODER 1 -%define CONFIG_EATGQ_DECODER 1 -%define CONFIG_EATGV_DECODER 1 -%define CONFIG_EATQI_DECODER 1 -%define CONFIG_EIGHTBPS_DECODER 1 -%define CONFIG_EIGHTSVX_EXP_DECODER 1 -%define CONFIG_EIGHTSVX_FIB_DECODER 1 -%define CONFIG_ESCAPE124_DECODER 1 -%define CONFIG_ESCAPE130_DECODER 1 -%define CONFIG_EXR_DECODER 1 -%define CONFIG_FFV1_DECODER 1 -%define CONFIG_FFVHUFF_DECODER 1 -%define CONFIG_FIC_DECODER 1 -%define CONFIG_FITS_DECODER 1 -%define CONFIG_FLASHSV_DECODER 1 -%define CONFIG_FLASHSV2_DECODER 1 -%define CONFIG_FLIC_DECODER 1 -%define CONFIG_FLV_DECODER 1 -%define CONFIG_FMVC_DECODER 1 -%define CONFIG_FOURXM_DECODER 1 -%define CONFIG_FRAPS_DECODER 1 -%define CONFIG_FRWU_DECODER 1 -%define CONFIG_G2M_DECODER 1 -%define CONFIG_GDV_DECODER 1 -%define CONFIG_GIF_DECODER 1 -%define CONFIG_H261_DECODER 1 -%define CONFIG_H263_DECODER 1 -%define CONFIG_H263I_DECODER 1 -%define CONFIG_H263P_DECODER 1 -%define CONFIG_H263_V4L2M2M_DECODER 0 -%define CONFIG_H264_DECODER 1 -%define CONFIG_H264_CRYSTALHD_DECODER 0 -%define CONFIG_H264_V4L2M2M_DECODER 0 -%define CONFIG_H264_MEDIACODEC_DECODER 0 -%define CONFIG_H264_MMAL_DECODER 0 -%define CONFIG_H264_QSV_DECODER 0 -%define CONFIG_H264_RKMPP_DECODER 0 -%define CONFIG_HAP_DECODER 1 -%define CONFIG_HEVC_DECODER 1 -%define CONFIG_HEVC_QSV_DECODER 0 -%define CONFIG_HEVC_RKMPP_DECODER 0 -%define CONFIG_HEVC_V4L2M2M_DECODER 0 -%define CONFIG_HNM4_VIDEO_DECODER 1 -%define CONFIG_HQ_HQA_DECODER 1 -%define CONFIG_HQX_DECODER 1 -%define CONFIG_HUFFYUV_DECODER 1 -%define CONFIG_IDCIN_DECODER 1 -%define CONFIG_IFF_ILBM_DECODER 1 -%define CONFIG_IMM4_DECODER 1 -%define CONFIG_INDEO2_DECODER 0 -%define CONFIG_INDEO3_DECODER 0 -%define CONFIG_INDEO4_DECODER 0 -%define CONFIG_INDEO5_DECODER 0 -%define CONFIG_INTERPLAY_VIDEO_DECODER 1 -%define CONFIG_JPEG2000_DECODER 1 -%define CONFIG_JPEGLS_DECODER 1 -%define CONFIG_JV_DECODER 1 -%define CONFIG_KGV1_DECODER 1 -%define CONFIG_KMVC_DECODER 1 -%define CONFIG_LAGARITH_DECODER 1 -%define CONFIG_LOCO_DECODER 1 -%define CONFIG_M101_DECODER 1 -%define CONFIG_MAGICYUV_DECODER 1 -%define CONFIG_MDEC_DECODER 1 -%define CONFIG_MIMIC_DECODER 1 -%define CONFIG_MJPEG_DECODER 1 -%define CONFIG_MJPEGB_DECODER 1 -%define CONFIG_MMVIDEO_DECODER 1 -%define CONFIG_MOTIONPIXELS_DECODER 1 -%define CONFIG_MPEG1VIDEO_DECODER 1 -%define CONFIG_MPEG2VIDEO_DECODER 1 -%define CONFIG_MPEG4_DECODER 1 -%define CONFIG_MPEG4_CRYSTALHD_DECODER 0 -%define CONFIG_MPEG4_V4L2M2M_DECODER 0 -%define CONFIG_MPEG4_MMAL_DECODER 0 -%define CONFIG_MPEGVIDEO_DECODER 1 -%define CONFIG_MPEG1_V4L2M2M_DECODER 0 -%define CONFIG_MPEG2_MMAL_DECODER 0 -%define CONFIG_MPEG2_CRYSTALHD_DECODER 0 -%define CONFIG_MPEG2_V4L2M2M_DECODER 0 -%define CONFIG_MPEG2_QSV_DECODER 0 -%define CONFIG_MPEG2_MEDIACODEC_DECODER 0 -%define CONFIG_MSA1_DECODER 1 -%define CONFIG_MSCC_DECODER 1 -%define CONFIG_MSMPEG4V1_DECODER 1 -%define CONFIG_MSMPEG4V2_DECODER 1 -%define CONFIG_MSMPEG4V3_DECODER 1 -%define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0 -%define CONFIG_MSRLE_DECODER 1 -%define CONFIG_MSS1_DECODER 1 -%define CONFIG_MSS2_DECODER 1 -%define CONFIG_MSVIDEO1_DECODER 1 -%define CONFIG_MSZH_DECODER 1 -%define CONFIG_MTS2_DECODER 1 -%define CONFIG_MVC1_DECODER 1 -%define CONFIG_MVC2_DECODER 1 -%define CONFIG_MWSC_DECODER 1 -%define CONFIG_MXPEG_DECODER 1 -%define CONFIG_NUV_DECODER 1 -%define CONFIG_PAF_VIDEO_DECODER 1 -%define CONFIG_PAM_DECODER 1 -%define CONFIG_PBM_DECODER 1 -%define CONFIG_PCX_DECODER 1 -%define CONFIG_PGM_DECODER 1 -%define CONFIG_PGMYUV_DECODER 1 -%define CONFIG_PICTOR_DECODER 1 -%define CONFIG_PIXLET_DECODER 1 -%define CONFIG_PNG_DECODER 1 -%define CONFIG_PPM_DECODER 1 -%define CONFIG_PRORES_DECODER 1 -%define CONFIG_PROSUMER_DECODER 1 -%define CONFIG_PSD_DECODER 1 -%define CONFIG_PTX_DECODER 1 -%define CONFIG_QDRAW_DECODER 1 -%define CONFIG_QPEG_DECODER 1 -%define CONFIG_QTRLE_DECODER 1 -%define CONFIG_R10K_DECODER 1 -%define CONFIG_R210_DECODER 1 -%define CONFIG_RASC_DECODER 1 -%define CONFIG_RAWVIDEO_DECODER 1 -%define CONFIG_RL2_DECODER 1 -%define CONFIG_ROQ_DECODER 1 -%define CONFIG_RPZA_DECODER 1 -%define CONFIG_RSCC_DECODER 1 -%define CONFIG_RV10_DECODER 1 -%define CONFIG_RV20_DECODER 1 -%define CONFIG_RV30_DECODER 1 -%define CONFIG_RV40_DECODER 1 -%define CONFIG_S302M_DECODER 1 -%define CONFIG_SANM_DECODER 1 -%define CONFIG_SCPR_DECODER 1 -%define CONFIG_SCREENPRESSO_DECODER 1 -%define CONFIG_SDX2_DPCM_DECODER 1 -%define CONFIG_SGI_DECODER 1 -%define CONFIG_SGIRLE_DECODER 1 -%define CONFIG_SHEERVIDEO_DECODER 1 -%define CONFIG_SMACKER_DECODER 1 -%define CONFIG_SMC_DECODER 1 -%define CONFIG_SMVJPEG_DECODER 1 -%define CONFIG_SNOW_DECODER 1 -%define CONFIG_SP5X_DECODER 1 -%define CONFIG_SPEEDHQ_DECODER 1 -%define CONFIG_SRGC_DECODER 1 -%define CONFIG_SUNRAST_DECODER 1 -%define CONFIG_SVQ1_DECODER 1 -%define CONFIG_SVQ3_DECODER 1 -%define CONFIG_TARGA_DECODER 1 -%define CONFIG_TARGA_Y216_DECODER 1 -%define CONFIG_TDSC_DECODER 1 -%define CONFIG_THEORA_DECODER 1 -%define CONFIG_THP_DECODER 1 -%define CONFIG_TIERTEXSEQVIDEO_DECODER 1 -%define CONFIG_TIFF_DECODER 1 -%define CONFIG_TMV_DECODER 1 -%define CONFIG_TRUEMOTION1_DECODER 1 -%define CONFIG_TRUEMOTION2_DECODER 1 -%define CONFIG_TRUEMOTION2RT_DECODER 1 -%define CONFIG_TSCC_DECODER 1 -%define CONFIG_TSCC2_DECODER 1 -%define CONFIG_TXD_DECODER 1 -%define CONFIG_ULTI_DECODER 1 -%define CONFIG_UTVIDEO_DECODER 1 -%define CONFIG_V210_DECODER 1 -%define CONFIG_V210X_DECODER 1 -%define CONFIG_V308_DECODER 1 -%define CONFIG_V408_DECODER 1 -%define CONFIG_V410_DECODER 1 -%define CONFIG_VB_DECODER 1 -%define CONFIG_VBLE_DECODER 1 -%define CONFIG_VC1_DECODER 1 -%define CONFIG_VC1_CRYSTALHD_DECODER 0 -%define CONFIG_VC1IMAGE_DECODER 1 -%define CONFIG_VC1_MMAL_DECODER 0 -%define CONFIG_VC1_QSV_DECODER 0 -%define CONFIG_VC1_V4L2M2M_DECODER 0 -%define CONFIG_VCR1_DECODER 1 -%define CONFIG_VMDVIDEO_DECODER 1 -%define CONFIG_VMNC_DECODER 1 -%define CONFIG_VP3_DECODER 1 -%define CONFIG_VP5_DECODER 1 -%define CONFIG_VP6_DECODER 1 -%define CONFIG_VP6A_DECODER 1 -%define CONFIG_VP6F_DECODER 1 -%define CONFIG_VP7_DECODER 1 -%define CONFIG_VP8_DECODER 1 -%define CONFIG_VP8_RKMPP_DECODER 0 -%define CONFIG_VP8_V4L2M2M_DECODER 0 -%define CONFIG_VP9_DECODER 1 -%define CONFIG_VP9_RKMPP_DECODER 0 -%define CONFIG_VP9_V4L2M2M_DECODER 0 -%define CONFIG_VQA_DECODER 1 -%define CONFIG_WEBP_DECODER 1 -%define CONFIG_WCMV_DECODER 1 -%define CONFIG_WRAPPED_AVFRAME_DECODER 1 -%define CONFIG_WMV1_DECODER 1 -%define CONFIG_WMV2_DECODER 1 -%define CONFIG_WMV3_DECODER 1 -%define CONFIG_WMV3_CRYSTALHD_DECODER 0 -%define CONFIG_WMV3IMAGE_DECODER 1 -%define CONFIG_WNV1_DECODER 1 -%define CONFIG_XAN_WC3_DECODER 1 -%define CONFIG_XAN_WC4_DECODER 1 -%define CONFIG_XBM_DECODER 1 -%define CONFIG_XFACE_DECODER 1 -%define CONFIG_XL_DECODER 1 -%define CONFIG_XPM_DECODER 1 -%define CONFIG_XWD_DECODER 1 -%define CONFIG_Y41P_DECODER 1 -%define CONFIG_YLC_DECODER 1 -%define CONFIG_YOP_DECODER 1 -%define CONFIG_YUV4_DECODER 1 -%define CONFIG_ZERO12V_DECODER 1 -%define CONFIG_ZEROCODEC_DECODER 1 -%define CONFIG_ZLIB_DECODER 1 -%define CONFIG_ZMBV_DECODER 1 -%define CONFIG_AAC_DECODER 1 -%define CONFIG_AAC_FIXED_DECODER 1 -%define CONFIG_AAC_LATM_DECODER 1 -%define CONFIG_AC3_DECODER 1 -%define CONFIG_AC3_FIXED_DECODER 1 -%define CONFIG_ALAC_DECODER 1 -%define CONFIG_ALS_DECODER 1 -%define CONFIG_AMRNB_DECODER 1 -%define CONFIG_AMRWB_DECODER 1 -%define CONFIG_APE_DECODER 1 -%define CONFIG_APTX_DECODER 1 -%define CONFIG_APTX_HD_DECODER 1 -%define CONFIG_ATRAC1_DECODER 1 -%define CONFIG_ATRAC3_DECODER 1 -%define CONFIG_ATRAC3AL_DECODER 1 -%define CONFIG_ATRAC3P_DECODER 0 -%define CONFIG_ATRAC3PAL_DECODER 1 -%define CONFIG_ATRAC9_DECODER 1 -%define CONFIG_BINKAUDIO_DCT_DECODER 1 -%define CONFIG_BINKAUDIO_RDFT_DECODER 1 -%define CONFIG_BMV_AUDIO_DECODER 1 -%define CONFIG_COOK_DECODER 1 -%define CONFIG_DCA_DECODER 1 -%define CONFIG_DOLBY_E_DECODER 1 -%define CONFIG_DSD_LSBF_DECODER 1 -%define CONFIG_DSD_MSBF_DECODER 1 -%define CONFIG_DSD_LSBF_PLANAR_DECODER 1 -%define CONFIG_DSD_MSBF_PLANAR_DECODER 1 -%define CONFIG_DSICINAUDIO_DECODER 1 -%define CONFIG_DSS_SP_DECODER 1 -%define CONFIG_DST_DECODER 1 -%define CONFIG_EAC3_DECODER 1 -%define CONFIG_EVRC_DECODER 1 -%define CONFIG_FFWAVESYNTH_DECODER 1 -%define CONFIG_FLAC_DECODER 1 -%define CONFIG_G723_1_DECODER 1 -%define CONFIG_G729_DECODER 1 -%define CONFIG_GSM_DECODER 1 -%define CONFIG_GSM_MS_DECODER 1 -%define CONFIG_IAC_DECODER 1 -%define CONFIG_ILBC_DECODER 1 -%define CONFIG_IMC_DECODER 1 -%define CONFIG_INTERPLAY_ACM_DECODER 1 -%define CONFIG_MACE3_DECODER 1 -%define CONFIG_MACE6_DECODER 1 -%define CONFIG_METASOUND_DECODER 1 -%define CONFIG_MLP_DECODER 1 -%define CONFIG_MP1_DECODER 1 -%define CONFIG_MP1FLOAT_DECODER 1 -%define CONFIG_MP2_DECODER 1 -%define CONFIG_MP2FLOAT_DECODER 1 -%define CONFIG_MP3FLOAT_DECODER 1 -%define CONFIG_MP3_DECODER 1 -%define CONFIG_MP3ADUFLOAT_DECODER 1 -%define CONFIG_MP3ADU_DECODER 1 -%define CONFIG_MP3ON4FLOAT_DECODER 1 -%define CONFIG_MP3ON4_DECODER 1 -%define CONFIG_MPC7_DECODER 1 -%define CONFIG_MPC8_DECODER 1 -%define CONFIG_NELLYMOSER_DECODER 1 -%define CONFIG_ON2AVC_DECODER 1 -%define CONFIG_OPUS_DECODER 1 -%define CONFIG_PAF_AUDIO_DECODER 1 -%define CONFIG_QCELP_DECODER 1 -%define CONFIG_QDM2_DECODER 1 -%define CONFIG_QDMC_DECODER 1 -%define CONFIG_RA_144_DECODER 1 -%define CONFIG_RA_288_DECODER 1 -%define CONFIG_RALF_DECODER 1 -%define CONFIG_SBC_DECODER 1 -%define CONFIG_SHORTEN_DECODER 1 -%define CONFIG_SIPR_DECODER 1 -%define CONFIG_SMACKAUD_DECODER 1 -%define CONFIG_SONIC_DECODER 1 -%define CONFIG_TAK_DECODER 1 -%define CONFIG_TRUEHD_DECODER 1 -%define CONFIG_TRUESPEECH_DECODER 1 -%define CONFIG_TTA_DECODER 1 -%define CONFIG_TWINVQ_DECODER 0 -%define CONFIG_VMDAUDIO_DECODER 1 -%define CONFIG_VORBIS_DECODER 1 -%define CONFIG_WAVPACK_DECODER 1 -%define CONFIG_WMALOSSLESS_DECODER 1 -%define CONFIG_WMAPRO_DECODER 1 -%define CONFIG_WMAV1_DECODER 1 -%define CONFIG_WMAV2_DECODER 1 -%define CONFIG_WMAVOICE_DECODER 1 -%define CONFIG_WS_SND1_DECODER 1 -%define CONFIG_XMA1_DECODER 1 -%define CONFIG_XMA2_DECODER 1 -%define CONFIG_PCM_ALAW_DECODER 1 -%define CONFIG_PCM_BLURAY_DECODER 1 -%define CONFIG_PCM_DVD_DECODER 1 -%define CONFIG_PCM_F16LE_DECODER 1 -%define CONFIG_PCM_F24LE_DECODER 1 -%define CONFIG_PCM_F32BE_DECODER 1 -%define CONFIG_PCM_F32LE_DECODER 1 -%define CONFIG_PCM_F64BE_DECODER 1 -%define CONFIG_PCM_F64LE_DECODER 1 -%define CONFIG_PCM_LXF_DECODER 1 -%define CONFIG_PCM_MULAW_DECODER 1 -%define CONFIG_PCM_S8_DECODER 1 -%define CONFIG_PCM_S8_PLANAR_DECODER 1 -%define CONFIG_PCM_S16BE_DECODER 1 -%define CONFIG_PCM_S16BE_PLANAR_DECODER 1 -%define CONFIG_PCM_S16LE_DECODER 1 -%define CONFIG_PCM_S16LE_PLANAR_DECODER 1 -%define CONFIG_PCM_S24BE_DECODER 1 -%define CONFIG_PCM_S24DAUD_DECODER 1 -%define CONFIG_PCM_S24LE_DECODER 1 -%define CONFIG_PCM_S24LE_PLANAR_DECODER 1 -%define CONFIG_PCM_S32BE_DECODER 1 -%define CONFIG_PCM_S32LE_DECODER 1 -%define CONFIG_PCM_S32LE_PLANAR_DECODER 1 -%define CONFIG_PCM_S64BE_DECODER 1 -%define CONFIG_PCM_S64LE_DECODER 1 -%define CONFIG_PCM_U8_DECODER 1 -%define CONFIG_PCM_U16BE_DECODER 1 -%define CONFIG_PCM_U16LE_DECODER 1 -%define CONFIG_PCM_U24BE_DECODER 1 -%define CONFIG_PCM_U24LE_DECODER 1 -%define CONFIG_PCM_U32BE_DECODER 1 -%define CONFIG_PCM_U32LE_DECODER 1 -%define CONFIG_PCM_VIDC_DECODER 1 -%define CONFIG_PCM_ZORK_DECODER 1 -%define CONFIG_GREMLIN_DPCM_DECODER 1 -%define CONFIG_INTERPLAY_DPCM_DECODER 1 -%define CONFIG_ROQ_DPCM_DECODER 1 -%define CONFIG_SOL_DPCM_DECODER 1 -%define CONFIG_XAN_DPCM_DECODER 1 -%define CONFIG_ADPCM_4XM_DECODER 1 -%define CONFIG_ADPCM_ADX_DECODER 1 -%define CONFIG_ADPCM_AFC_DECODER 1 -%define CONFIG_ADPCM_AICA_DECODER 1 -%define CONFIG_ADPCM_CT_DECODER 1 -%define CONFIG_ADPCM_DTK_DECODER 1 -%define CONFIG_ADPCM_EA_DECODER 1 -%define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 1 -%define CONFIG_ADPCM_EA_R1_DECODER 1 -%define CONFIG_ADPCM_EA_R2_DECODER 1 -%define CONFIG_ADPCM_EA_R3_DECODER 1 -%define CONFIG_ADPCM_EA_XAS_DECODER 1 -%define CONFIG_ADPCM_G722_DECODER 1 -%define CONFIG_ADPCM_G726_DECODER 1 -%define CONFIG_ADPCM_G726LE_DECODER 1 -%define CONFIG_ADPCM_IMA_AMV_DECODER 1 -%define CONFIG_ADPCM_IMA_APC_DECODER 1 -%define CONFIG_ADPCM_IMA_DAT4_DECODER 1 -%define CONFIG_ADPCM_IMA_DK3_DECODER 1 -%define CONFIG_ADPCM_IMA_DK4_DECODER 1 -%define CONFIG_ADPCM_IMA_EA_EACS_DECODER 1 -%define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 1 -%define CONFIG_ADPCM_IMA_ISS_DECODER 1 -%define CONFIG_ADPCM_IMA_OKI_DECODER 1 -%define CONFIG_ADPCM_IMA_QT_DECODER 1 -%define CONFIG_ADPCM_IMA_RAD_DECODER 1 -%define CONFIG_ADPCM_IMA_SMJPEG_DECODER 1 -%define CONFIG_ADPCM_IMA_WAV_DECODER 1 -%define CONFIG_ADPCM_IMA_WS_DECODER 1 -%define CONFIG_ADPCM_MS_DECODER 1 -%define CONFIG_ADPCM_MTAF_DECODER 1 -%define CONFIG_ADPCM_PSX_DECODER 1 -%define CONFIG_ADPCM_SBPRO_2_DECODER 1 -%define CONFIG_ADPCM_SBPRO_3_DECODER 1 -%define CONFIG_ADPCM_SBPRO_4_DECODER 1 -%define CONFIG_ADPCM_SWF_DECODER 1 -%define CONFIG_ADPCM_THP_DECODER 1 -%define CONFIG_ADPCM_THP_LE_DECODER 1 -%define CONFIG_ADPCM_VIMA_DECODER 1 -%define CONFIG_ADPCM_XA_DECODER 1 -%define CONFIG_ADPCM_YAMAHA_DECODER 1 -%define CONFIG_SSA_DECODER 1 -%define CONFIG_ASS_DECODER 1 -%define CONFIG_CCAPTION_DECODER 1 -%define CONFIG_DVBSUB_DECODER 1 -%define CONFIG_DVDSUB_DECODER 1 -%define CONFIG_JACOSUB_DECODER 1 -%define CONFIG_MICRODVD_DECODER 1 -%define CONFIG_MOVTEXT_DECODER 1 -%define CONFIG_MPL2_DECODER 1 -%define CONFIG_PGSSUB_DECODER 1 -%define CONFIG_PJS_DECODER 1 -%define CONFIG_REALTEXT_DECODER 1 -%define CONFIG_SAMI_DECODER 1 -%define CONFIG_SRT_DECODER 1 -%define CONFIG_STL_DECODER 1 -%define CONFIG_SUBRIP_DECODER 1 -%define CONFIG_SUBVIEWER_DECODER 1 -%define CONFIG_SUBVIEWER1_DECODER 1 -%define CONFIG_TEXT_DECODER 1 -%define CONFIG_VPLAYER_DECODER 1 -%define CONFIG_WEBVTT_DECODER 1 -%define CONFIG_XSUB_DECODER 1 -%define CONFIG_AAC_AT_DECODER 0 -%define CONFIG_AC3_AT_DECODER 0 -%define CONFIG_ADPCM_IMA_QT_AT_DECODER 0 -%define CONFIG_ALAC_AT_DECODER 0 -%define CONFIG_AMR_NB_AT_DECODER 0 -%define CONFIG_EAC3_AT_DECODER 0 -%define CONFIG_GSM_MS_AT_DECODER 0 -%define CONFIG_ILBC_AT_DECODER 0 -%define CONFIG_MP1_AT_DECODER 0 -%define CONFIG_MP2_AT_DECODER 0 -%define CONFIG_MP3_AT_DECODER 0 -%define CONFIG_PCM_ALAW_AT_DECODER 0 -%define CONFIG_PCM_MULAW_AT_DECODER 0 -%define CONFIG_QDMC_AT_DECODER 0 -%define CONFIG_QDM2_AT_DECODER 0 -%define CONFIG_LIBAOM_AV1_DECODER 0 -%define CONFIG_LIBCELT_DECODER 0 -%define CONFIG_LIBCODEC2_DECODER 0 -%define CONFIG_LIBDAV1D_DECODER 0 -%define CONFIG_LIBDAVS2_DECODER 0 -%define CONFIG_LIBFDK_AAC_DECODER 0 -%define CONFIG_LIBGSM_DECODER 0 -%define CONFIG_LIBGSM_MS_DECODER 0 -%define CONFIG_LIBILBC_DECODER 0 -%define CONFIG_LIBOPENCORE_AMRNB_DECODER 0 -%define CONFIG_LIBOPENCORE_AMRWB_DECODER 0 -%define CONFIG_LIBOPENJPEG_DECODER 0 -%define CONFIG_LIBOPUS_DECODER 0 -%define CONFIG_LIBRSVG_DECODER 0 -%define CONFIG_LIBSPEEX_DECODER 0 -%define CONFIG_LIBVORBIS_DECODER 0 -%define CONFIG_LIBVPX_VP8_DECODER 0 -%define CONFIG_LIBVPX_VP9_DECODER 0 -%define CONFIG_LIBZVBI_TELETEXT_DECODER 0 -%define CONFIG_BINTEXT_DECODER 1 -%define CONFIG_XBIN_DECODER 1 -%define CONFIG_IDF_DECODER 1 -%define CONFIG_LIBOPENH264_DECODER 0 -%define CONFIG_H264_CUVID_DECODER 0 -%define CONFIG_HEVC_CUVID_DECODER 0 -%define CONFIG_HEVC_MEDIACODEC_DECODER 0 -%define CONFIG_MJPEG_CUVID_DECODER 0 -%define CONFIG_MPEG1_CUVID_DECODER 0 -%define CONFIG_MPEG2_CUVID_DECODER 0 -%define CONFIG_MPEG4_CUVID_DECODER 0 -%define CONFIG_MPEG4_MEDIACODEC_DECODER 0 -%define CONFIG_VC1_CUVID_DECODER 0 -%define CONFIG_VP8_CUVID_DECODER 0 -%define CONFIG_VP8_MEDIACODEC_DECODER 0 -%define CONFIG_VP8_QSV_DECODER 0 -%define CONFIG_VP9_CUVID_DECODER 0 -%define CONFIG_VP9_MEDIACODEC_DECODER 0 -%define CONFIG_A64MULTI_ENCODER 0 -%define CONFIG_A64MULTI5_ENCODER 0 -%define CONFIG_ALIAS_PIX_ENCODER 0 -%define CONFIG_AMV_ENCODER 0 -%define CONFIG_APNG_ENCODER 0 -%define CONFIG_ASV1_ENCODER 0 -%define CONFIG_ASV2_ENCODER 0 -%define CONFIG_AVRP_ENCODER 0 -%define CONFIG_AVUI_ENCODER 0 -%define CONFIG_AYUV_ENCODER 0 -%define CONFIG_BMP_ENCODER 0 -%define CONFIG_CINEPAK_ENCODER 0 -%define CONFIG_CLJR_ENCODER 0 -%define CONFIG_COMFORTNOISE_ENCODER 0 -%define CONFIG_DNXHD_ENCODER 0 -%define CONFIG_DPX_ENCODER 0 -%define CONFIG_DVVIDEO_ENCODER 0 -%define CONFIG_FFV1_ENCODER 0 -%define CONFIG_FFVHUFF_ENCODER 0 -%define CONFIG_FITS_ENCODER 0 -%define CONFIG_FLASHSV_ENCODER 0 -%define CONFIG_FLASHSV2_ENCODER 0 -%define CONFIG_FLV_ENCODER 0 -%define CONFIG_GIF_ENCODER 0 -%define CONFIG_H261_ENCODER 0 -%define CONFIG_H263_ENCODER 0 -%define CONFIG_H263P_ENCODER 0 -%define CONFIG_HAP_ENCODER 0 -%define CONFIG_HUFFYUV_ENCODER 0 -%define CONFIG_JPEG2000_ENCODER 0 -%define CONFIG_JPEGLS_ENCODER 0 -%define CONFIG_LJPEG_ENCODER 0 -%define CONFIG_MAGICYUV_ENCODER 0 -%define CONFIG_MJPEG_ENCODER 0 -%define CONFIG_MPEG1VIDEO_ENCODER 0 -%define CONFIG_MPEG2VIDEO_ENCODER 0 -%define CONFIG_MPEG4_ENCODER 0 -%define CONFIG_MSMPEG4V2_ENCODER 0 -%define CONFIG_MSMPEG4V3_ENCODER 0 -%define CONFIG_MSVIDEO1_ENCODER 0 -%define CONFIG_PAM_ENCODER 0 -%define CONFIG_PBM_ENCODER 0 -%define CONFIG_PCX_ENCODER 0 -%define CONFIG_PGM_ENCODER 0 -%define CONFIG_PGMYUV_ENCODER 0 -%define CONFIG_PNG_ENCODER 0 -%define CONFIG_PPM_ENCODER 0 -%define CONFIG_PRORES_ENCODER 0 -%define CONFIG_PRORES_AW_ENCODER 0 -%define CONFIG_PRORES_KS_ENCODER 0 -%define CONFIG_QTRLE_ENCODER 0 -%define CONFIG_R10K_ENCODER 0 -%define CONFIG_R210_ENCODER 0 -%define CONFIG_RAWVIDEO_ENCODER 0 -%define CONFIG_ROQ_ENCODER 0 -%define CONFIG_RV10_ENCODER 0 -%define CONFIG_RV20_ENCODER 0 -%define CONFIG_S302M_ENCODER 0 -%define CONFIG_SGI_ENCODER 0 -%define CONFIG_SNOW_ENCODER 0 -%define CONFIG_SUNRAST_ENCODER 0 -%define CONFIG_SVQ1_ENCODER 0 -%define CONFIG_TARGA_ENCODER 0 -%define CONFIG_TIFF_ENCODER 0 -%define CONFIG_UTVIDEO_ENCODER 0 -%define CONFIG_V210_ENCODER 0 -%define CONFIG_V308_ENCODER 0 -%define CONFIG_V408_ENCODER 0 -%define CONFIG_V410_ENCODER 0 -%define CONFIG_VC2_ENCODER 0 -%define CONFIG_WRAPPED_AVFRAME_ENCODER 0 -%define CONFIG_WMV1_ENCODER 0 -%define CONFIG_WMV2_ENCODER 0 -%define CONFIG_XBM_ENCODER 0 -%define CONFIG_XFACE_ENCODER 0 -%define CONFIG_XWD_ENCODER 0 -%define CONFIG_Y41P_ENCODER 0 -%define CONFIG_YUV4_ENCODER 0 -%define CONFIG_ZLIB_ENCODER 0 -%define CONFIG_ZMBV_ENCODER 0 -%define CONFIG_AAC_ENCODER 0 -%define CONFIG_AC3_ENCODER 0 -%define CONFIG_AC3_FIXED_ENCODER 0 -%define CONFIG_ALAC_ENCODER 0 -%define CONFIG_APTX_ENCODER 0 -%define CONFIG_APTX_HD_ENCODER 0 -%define CONFIG_DCA_ENCODER 0 -%define CONFIG_EAC3_ENCODER 0 -%define CONFIG_FLAC_ENCODER 0 -%define CONFIG_G723_1_ENCODER 0 -%define CONFIG_MLP_ENCODER 0 -%define CONFIG_MP2_ENCODER 0 -%define CONFIG_MP2FIXED_ENCODER 0 -%define CONFIG_NELLYMOSER_ENCODER 0 -%define CONFIG_OPUS_ENCODER 0 -%define CONFIG_RA_144_ENCODER 0 -%define CONFIG_SBC_ENCODER 0 -%define CONFIG_SONIC_ENCODER 0 -%define CONFIG_SONIC_LS_ENCODER 0 -%define CONFIG_TRUEHD_ENCODER 0 -%define CONFIG_TTA_ENCODER 0 -%define CONFIG_VORBIS_ENCODER 0 -%define CONFIG_WAVPACK_ENCODER 0 -%define CONFIG_WMAV1_ENCODER 0 -%define CONFIG_WMAV2_ENCODER 0 -%define CONFIG_PCM_ALAW_ENCODER 0 -%define CONFIG_PCM_F32BE_ENCODER 0 -%define CONFIG_PCM_F32LE_ENCODER 0 -%define CONFIG_PCM_F64BE_ENCODER 0 -%define CONFIG_PCM_F64LE_ENCODER 0 -%define CONFIG_PCM_MULAW_ENCODER 0 -%define CONFIG_PCM_S8_ENCODER 0 -%define CONFIG_PCM_S8_PLANAR_ENCODER 0 -%define CONFIG_PCM_S16BE_ENCODER 0 -%define CONFIG_PCM_S16BE_PLANAR_ENCODER 0 -%define CONFIG_PCM_S16LE_ENCODER 0 -%define CONFIG_PCM_S16LE_PLANAR_ENCODER 0 -%define CONFIG_PCM_S24BE_ENCODER 0 -%define CONFIG_PCM_S24DAUD_ENCODER 0 -%define CONFIG_PCM_S24LE_ENCODER 0 -%define CONFIG_PCM_S24LE_PLANAR_ENCODER 0 -%define CONFIG_PCM_S32BE_ENCODER 0 -%define CONFIG_PCM_S32LE_ENCODER 0 -%define CONFIG_PCM_S32LE_PLANAR_ENCODER 0 -%define CONFIG_PCM_S64BE_ENCODER 0 -%define CONFIG_PCM_S64LE_ENCODER 0 -%define CONFIG_PCM_U8_ENCODER 0 -%define CONFIG_PCM_U16BE_ENCODER 0 -%define CONFIG_PCM_U16LE_ENCODER 0 -%define CONFIG_PCM_U24BE_ENCODER 0 -%define CONFIG_PCM_U24LE_ENCODER 0 -%define CONFIG_PCM_U32BE_ENCODER 0 -%define CONFIG_PCM_U32LE_ENCODER 0 -%define CONFIG_PCM_VIDC_ENCODER 0 -%define CONFIG_ROQ_DPCM_ENCODER 0 -%define CONFIG_ADPCM_ADX_ENCODER 0 -%define CONFIG_ADPCM_G722_ENCODER 0 -%define CONFIG_ADPCM_G726_ENCODER 0 -%define CONFIG_ADPCM_G726LE_ENCODER 0 -%define CONFIG_ADPCM_IMA_QT_ENCODER 0 -%define CONFIG_ADPCM_IMA_WAV_ENCODER 0 -%define CONFIG_ADPCM_MS_ENCODER 0 -%define CONFIG_ADPCM_SWF_ENCODER 0 -%define CONFIG_ADPCM_YAMAHA_ENCODER 0 -%define CONFIG_SSA_ENCODER 0 -%define CONFIG_ASS_ENCODER 0 -%define CONFIG_DVBSUB_ENCODER 0 -%define CONFIG_DVDSUB_ENCODER 0 -%define CONFIG_MOVTEXT_ENCODER 0 -%define CONFIG_SRT_ENCODER 0 -%define CONFIG_SUBRIP_ENCODER 0 -%define CONFIG_TEXT_ENCODER 0 -%define CONFIG_WEBVTT_ENCODER 0 -%define CONFIG_XSUB_ENCODER 0 -%define CONFIG_AAC_AT_ENCODER 0 -%define CONFIG_ALAC_AT_ENCODER 0 -%define CONFIG_ILBC_AT_ENCODER 0 -%define CONFIG_PCM_ALAW_AT_ENCODER 0 -%define CONFIG_PCM_MULAW_AT_ENCODER 0 -%define CONFIG_LIBAOM_AV1_ENCODER 0 -%define CONFIG_LIBCODEC2_ENCODER 0 -%define CONFIG_LIBFDK_AAC_ENCODER 0 -%define CONFIG_LIBGSM_ENCODER 0 -%define CONFIG_LIBGSM_MS_ENCODER 0 -%define CONFIG_LIBILBC_ENCODER 0 -%define CONFIG_LIBMP3LAME_ENCODER 0 -%define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0 -%define CONFIG_LIBOPENJPEG_ENCODER 0 -%define CONFIG_LIBOPUS_ENCODER 0 -%define CONFIG_LIBSHINE_ENCODER 0 -%define CONFIG_LIBSPEEX_ENCODER 0 -%define CONFIG_LIBTHEORA_ENCODER 0 -%define CONFIG_LIBTWOLAME_ENCODER 0 -%define CONFIG_LIBVO_AMRWBENC_ENCODER 0 -%define CONFIG_LIBVORBIS_ENCODER 0 -%define CONFIG_LIBVPX_VP8_ENCODER 0 -%define CONFIG_LIBVPX_VP9_ENCODER 0 -%define CONFIG_LIBWAVPACK_ENCODER 0 -%define CONFIG_LIBWEBP_ANIM_ENCODER 0 -%define CONFIG_LIBWEBP_ENCODER 0 -%define CONFIG_LIBX262_ENCODER 0 -%define CONFIG_LIBX264_ENCODER 0 -%define CONFIG_LIBX264RGB_ENCODER 0 -%define CONFIG_LIBX265_ENCODER 0 -%define CONFIG_LIBXAVS_ENCODER 0 -%define CONFIG_LIBXAVS2_ENCODER 0 -%define CONFIG_LIBXVID_ENCODER 0 -%define CONFIG_H263_V4L2M2M_ENCODER 0 -%define CONFIG_LIBOPENH264_ENCODER 0 -%define CONFIG_H264_AMF_ENCODER 0 -%define CONFIG_H264_NVENC_ENCODER 0 -%define CONFIG_H264_OMX_ENCODER 0 -%define CONFIG_H264_QSV_ENCODER 0 -%define CONFIG_H264_V4L2M2M_ENCODER 0 -%define CONFIG_H264_VAAPI_ENCODER 0 -%define CONFIG_H264_VIDEOTOOLBOX_ENCODER 0 -%define CONFIG_NVENC_ENCODER 0 -%define CONFIG_NVENC_H264_ENCODER 0 -%define CONFIG_NVENC_HEVC_ENCODER 0 -%define CONFIG_HEVC_AMF_ENCODER 0 -%define CONFIG_HEVC_NVENC_ENCODER 0 -%define CONFIG_HEVC_QSV_ENCODER 0 -%define CONFIG_HEVC_V4L2M2M_ENCODER 0 -%define CONFIG_HEVC_VAAPI_ENCODER 0 -%define CONFIG_HEVC_VIDEOTOOLBOX_ENCODER 0 -%define CONFIG_LIBKVAZAAR_ENCODER 0 -%define CONFIG_MJPEG_QSV_ENCODER 0 -%define CONFIG_MJPEG_VAAPI_ENCODER 0 -%define CONFIG_MPEG2_QSV_ENCODER 0 -%define CONFIG_MPEG2_VAAPI_ENCODER 0 -%define CONFIG_MPEG4_V4L2M2M_ENCODER 0 -%define CONFIG_VP8_V4L2M2M_ENCODER 0 -%define CONFIG_VP8_VAAPI_ENCODER 0 -%define CONFIG_VP9_VAAPI_ENCODER 0 -%define CONFIG_H263_VAAPI_HWACCEL 0 -%define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0 -%define CONFIG_H264_D3D11VA_HWACCEL 0 -%define CONFIG_H264_D3D11VA2_HWACCEL 0 -%define CONFIG_H264_DXVA2_HWACCEL 0 -%define CONFIG_H264_NVDEC_HWACCEL 0 -%define CONFIG_H264_VAAPI_HWACCEL 0 -%define CONFIG_H264_VDPAU_HWACCEL 0 -%define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0 -%define CONFIG_HEVC_D3D11VA_HWACCEL 0 -%define CONFIG_HEVC_D3D11VA2_HWACCEL 0 -%define CONFIG_HEVC_DXVA2_HWACCEL 0 -%define CONFIG_HEVC_NVDEC_HWACCEL 0 -%define CONFIG_HEVC_VAAPI_HWACCEL 0 -%define CONFIG_HEVC_VDPAU_HWACCEL 0 -%define CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL 0 -%define CONFIG_MJPEG_NVDEC_HWACCEL 0 -%define CONFIG_MJPEG_VAAPI_HWACCEL 0 -%define CONFIG_MPEG1_NVDEC_HWACCEL 0 -%define CONFIG_MPEG1_VDPAU_HWACCEL 0 -%define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 -%define CONFIG_MPEG1_XVMC_HWACCEL 0 -%define CONFIG_MPEG2_D3D11VA_HWACCEL 0 -%define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -%define CONFIG_MPEG2_NVDEC_HWACCEL 0 -%define CONFIG_MPEG2_DXVA2_HWACCEL 0 -%define CONFIG_MPEG2_VAAPI_HWACCEL 0 -%define CONFIG_MPEG2_VDPAU_HWACCEL 0 -%define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 -%define CONFIG_MPEG2_XVMC_HWACCEL 0 -%define CONFIG_MPEG4_NVDEC_HWACCEL 0 -%define CONFIG_MPEG4_VAAPI_HWACCEL 0 -%define CONFIG_MPEG4_VDPAU_HWACCEL 0 -%define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0 -%define CONFIG_VC1_D3D11VA_HWACCEL 0 -%define CONFIG_VC1_D3D11VA2_HWACCEL 0 -%define CONFIG_VC1_DXVA2_HWACCEL 0 -%define CONFIG_VC1_NVDEC_HWACCEL 0 -%define CONFIG_VC1_VAAPI_HWACCEL 0 -%define CONFIG_VC1_VDPAU_HWACCEL 0 -%define CONFIG_VP8_NVDEC_HWACCEL 0 -%define CONFIG_VP8_VAAPI_HWACCEL 0 -%define CONFIG_VP9_D3D11VA_HWACCEL 0 -%define CONFIG_VP9_D3D11VA2_HWACCEL 0 -%define CONFIG_VP9_DXVA2_HWACCEL 0 -%define CONFIG_VP9_NVDEC_HWACCEL 0 -%define CONFIG_VP9_VAAPI_HWACCEL 0 -%define CONFIG_WMV3_D3D11VA_HWACCEL 0 -%define CONFIG_WMV3_D3D11VA2_HWACCEL 0 -%define CONFIG_WMV3_DXVA2_HWACCEL 0 -%define CONFIG_WMV3_NVDEC_HWACCEL 0 -%define CONFIG_WMV3_VAAPI_HWACCEL 0 -%define CONFIG_WMV3_VDPAU_HWACCEL 0 -%define CONFIG_AAC_PARSER 1 -%define CONFIG_AAC_LATM_PARSER 1 -%define CONFIG_AC3_PARSER 1 -%define CONFIG_ADX_PARSER 1 -%define CONFIG_AV1_PARSER 1 -%define CONFIG_AVS2_PARSER 1 -%define CONFIG_BMP_PARSER 1 -%define CONFIG_CAVSVIDEO_PARSER 1 -%define CONFIG_COOK_PARSER 1 -%define CONFIG_DCA_PARSER 1 -%define CONFIG_DIRAC_PARSER 1 -%define CONFIG_DNXHD_PARSER 1 -%define CONFIG_DPX_PARSER 1 -%define CONFIG_DVAUDIO_PARSER 1 -%define CONFIG_DVBSUB_PARSER 1 -%define CONFIG_DVDSUB_PARSER 1 -%define CONFIG_DVD_NAV_PARSER 1 -%define CONFIG_FLAC_PARSER 1 -%define CONFIG_G729_PARSER 1 -%define CONFIG_GSM_PARSER 1 -%define CONFIG_H261_PARSER 1 -%define CONFIG_H263_PARSER 1 -%define CONFIG_H264_PARSER 1 -%define CONFIG_HEVC_PARSER 1 -%define CONFIG_MJPEG_PARSER 1 -%define CONFIG_MLP_PARSER 1 -%define CONFIG_MPEG4VIDEO_PARSER 1 -%define CONFIG_MPEGAUDIO_PARSER 1 -%define CONFIG_MPEGVIDEO_PARSER 1 -%define CONFIG_OPUS_PARSER 1 -%define CONFIG_PNG_PARSER 1 -%define CONFIG_PNM_PARSER 1 -%define CONFIG_RV30_PARSER 1 -%define CONFIG_RV40_PARSER 1 -%define CONFIG_SBC_PARSER 1 -%define CONFIG_SIPR_PARSER 1 -%define CONFIG_TAK_PARSER 1 -%define CONFIG_VC1_PARSER 1 -%define CONFIG_VORBIS_PARSER 1 -%define CONFIG_VP3_PARSER 1 -%define CONFIG_VP8_PARSER 1 -%define CONFIG_VP9_PARSER 1 -%define CONFIG_XMA_PARSER 1 -%define CONFIG_ALSA_INDEV 0 -%define CONFIG_ANDROID_CAMERA_INDEV 0 -%define CONFIG_AVFOUNDATION_INDEV 0 -%define CONFIG_BKTR_INDEV 0 -%define CONFIG_DECKLINK_INDEV 0 -%define CONFIG_LIBNDI_NEWTEK_INDEV 0 -%define CONFIG_DSHOW_INDEV 0 -%define CONFIG_FBDEV_INDEV 0 -%define CONFIG_GDIGRAB_INDEV 0 -%define CONFIG_IEC61883_INDEV 0 -%define CONFIG_JACK_INDEV 0 -%define CONFIG_KMSGRAB_INDEV 0 -%define CONFIG_LAVFI_INDEV 0 -%define CONFIG_OPENAL_INDEV 0 -%define CONFIG_OSS_INDEV 0 -%define CONFIG_PULSE_INDEV 0 -%define CONFIG_SNDIO_INDEV 0 -%define CONFIG_V4L2_INDEV 0 -%define CONFIG_VFWCAP_INDEV 0 -%define CONFIG_XCBGRAB_INDEV 0 -%define CONFIG_LIBCDIO_INDEV 0 -%define CONFIG_LIBDC1394_INDEV 0 -%define CONFIG_ALSA_OUTDEV 0 -%define CONFIG_CACA_OUTDEV 0 -%define CONFIG_DECKLINK_OUTDEV 0 -%define CONFIG_LIBNDI_NEWTEK_OUTDEV 0 -%define CONFIG_FBDEV_OUTDEV 0 -%define CONFIG_OPENGL_OUTDEV 0 -%define CONFIG_OSS_OUTDEV 0 -%define CONFIG_PULSE_OUTDEV 0 -%define CONFIG_SDL2_OUTDEV 0 -%define CONFIG_SNDIO_OUTDEV 0 -%define CONFIG_V4L2_OUTDEV 0 -%define CONFIG_XV_OUTDEV 0 -%define CONFIG_ABENCH_FILTER 0 -%define CONFIG_ACOMPRESSOR_FILTER 0 -%define CONFIG_ACONTRAST_FILTER 0 -%define CONFIG_ACOPY_FILTER 0 -%define CONFIG_ACUE_FILTER 0 -%define CONFIG_ACROSSFADE_FILTER 0 -%define CONFIG_ACROSSOVER_FILTER 0 -%define CONFIG_ACRUSHER_FILTER 0 -%define CONFIG_ADECLICK_FILTER 0 -%define CONFIG_ADECLIP_FILTER 0 -%define CONFIG_ADELAY_FILTER 0 -%define CONFIG_ADERIVATIVE_FILTER 0 -%define CONFIG_AECHO_FILTER 0 -%define CONFIG_AEMPHASIS_FILTER 0 -%define CONFIG_AEVAL_FILTER 0 -%define CONFIG_AFADE_FILTER 0 -%define CONFIG_AFFTDN_FILTER 0 -%define CONFIG_AFFTFILT_FILTER 0 -%define CONFIG_AFIR_FILTER 0 -%define CONFIG_AFORMAT_FILTER 0 -%define CONFIG_AGATE_FILTER 0 -%define CONFIG_AIIR_FILTER 0 -%define CONFIG_AINTEGRAL_FILTER 0 -%define CONFIG_AINTERLEAVE_FILTER 0 -%define CONFIG_ALIMITER_FILTER 0 -%define CONFIG_ALLPASS_FILTER 0 -%define CONFIG_ALOOP_FILTER 0 -%define CONFIG_AMERGE_FILTER 0 -%define CONFIG_AMETADATA_FILTER 0 -%define CONFIG_AMIX_FILTER 0 -%define CONFIG_AMULTIPLY_FILTER 0 -%define CONFIG_ANEQUALIZER_FILTER 0 -%define CONFIG_ANULL_FILTER 0 -%define CONFIG_APAD_FILTER 0 -%define CONFIG_APERMS_FILTER 0 -%define CONFIG_APHASER_FILTER 0 -%define CONFIG_APULSATOR_FILTER 0 -%define CONFIG_AREALTIME_FILTER 0 -%define CONFIG_ARESAMPLE_FILTER 0 -%define CONFIG_AREVERSE_FILTER 0 -%define CONFIG_ASELECT_FILTER 0 -%define CONFIG_ASENDCMD_FILTER 0 -%define CONFIG_ASETNSAMPLES_FILTER 0 -%define CONFIG_ASETPTS_FILTER 0 -%define CONFIG_ASETRATE_FILTER 0 -%define CONFIG_ASETTB_FILTER 0 -%define CONFIG_ASHOWINFO_FILTER 0 -%define CONFIG_ASIDEDATA_FILTER 0 -%define CONFIG_ASPLIT_FILTER 0 -%define CONFIG_ASTATS_FILTER 0 -%define CONFIG_ASTREAMSELECT_FILTER 0 -%define CONFIG_ATEMPO_FILTER 0 -%define CONFIG_ATRIM_FILTER 0 -%define CONFIG_AZMQ_FILTER 0 -%define CONFIG_BANDPASS_FILTER 0 -%define CONFIG_BANDREJECT_FILTER 0 -%define CONFIG_BASS_FILTER 0 -%define CONFIG_BIQUAD_FILTER 0 -%define CONFIG_BS2B_FILTER 0 -%define CONFIG_CHANNELMAP_FILTER 0 -%define CONFIG_CHANNELSPLIT_FILTER 0 -%define CONFIG_CHORUS_FILTER 0 -%define CONFIG_COMPAND_FILTER 0 -%define CONFIG_COMPENSATIONDELAY_FILTER 0 -%define CONFIG_CROSSFEED_FILTER 0 -%define CONFIG_CRYSTALIZER_FILTER 0 -%define CONFIG_DCSHIFT_FILTER 0 -%define CONFIG_DRMETER_FILTER 0 -%define CONFIG_DYNAUDNORM_FILTER 0 -%define CONFIG_EARWAX_FILTER 0 -%define CONFIG_EBUR128_FILTER 0 -%define CONFIG_EQUALIZER_FILTER 0 -%define CONFIG_EXTRASTEREO_FILTER 0 -%define CONFIG_FIREQUALIZER_FILTER 0 -%define CONFIG_FLANGER_FILTER 0 -%define CONFIG_HAAS_FILTER 0 -%define CONFIG_HDCD_FILTER 0 -%define CONFIG_HEADPHONE_FILTER 0 -%define CONFIG_HIGHPASS_FILTER 0 -%define CONFIG_HIGHSHELF_FILTER 0 -%define CONFIG_JOIN_FILTER 0 -%define CONFIG_LADSPA_FILTER 0 -%define CONFIG_LOUDNORM_FILTER 0 -%define CONFIG_LOWPASS_FILTER 0 -%define CONFIG_LOWSHELF_FILTER 0 -%define CONFIG_LV2_FILTER 0 -%define CONFIG_MCOMPAND_FILTER 0 -%define CONFIG_PAN_FILTER 0 -%define CONFIG_REPLAYGAIN_FILTER 0 -%define CONFIG_RESAMPLE_FILTER 0 -%define CONFIG_RUBBERBAND_FILTER 0 -%define CONFIG_SIDECHAINCOMPRESS_FILTER 0 -%define CONFIG_SIDECHAINGATE_FILTER 0 -%define CONFIG_SILENCEDETECT_FILTER 0 -%define CONFIG_SILENCEREMOVE_FILTER 0 -%define CONFIG_SOFALIZER_FILTER 0 -%define CONFIG_STEREOTOOLS_FILTER 0 -%define CONFIG_STEREOWIDEN_FILTER 0 -%define CONFIG_SUPEREQUALIZER_FILTER 0 -%define CONFIG_SURROUND_FILTER 0 -%define CONFIG_TREBLE_FILTER 0 -%define CONFIG_TREMOLO_FILTER 0 -%define CONFIG_VIBRATO_FILTER 0 -%define CONFIG_VOLUME_FILTER 0 -%define CONFIG_VOLUMEDETECT_FILTER 0 -%define CONFIG_AEVALSRC_FILTER 0 -%define CONFIG_ANOISESRC_FILTER 0 -%define CONFIG_ANULLSRC_FILTER 0 -%define CONFIG_FLITE_FILTER 0 -%define CONFIG_HILBERT_FILTER 0 -%define CONFIG_SINC_FILTER 0 -%define CONFIG_SINE_FILTER 0 -%define CONFIG_ANULLSINK_FILTER 0 -%define CONFIG_ALPHAEXTRACT_FILTER 0 -%define CONFIG_ALPHAMERGE_FILTER 0 -%define CONFIG_AMPLIFY_FILTER 0 -%define CONFIG_ASS_FILTER 0 -%define CONFIG_ATADENOISE_FILTER 0 -%define CONFIG_AVGBLUR_FILTER 0 -%define CONFIG_AVGBLUR_OPENCL_FILTER 0 -%define CONFIG_BBOX_FILTER 0 -%define CONFIG_BENCH_FILTER 0 -%define CONFIG_BITPLANENOISE_FILTER 0 -%define CONFIG_BLACKDETECT_FILTER 0 -%define CONFIG_BLACKFRAME_FILTER 0 -%define CONFIG_BLEND_FILTER 0 -%define CONFIG_BM3D_FILTER 0 -%define CONFIG_BOXBLUR_FILTER 0 -%define CONFIG_BOXBLUR_OPENCL_FILTER 0 -%define CONFIG_BWDIF_FILTER 0 -%define CONFIG_CHROMAHOLD_FILTER 0 -%define CONFIG_CHROMAKEY_FILTER 0 -%define CONFIG_CHROMASHIFT_FILTER 0 -%define CONFIG_CIESCOPE_FILTER 0 -%define CONFIG_CODECVIEW_FILTER 0 -%define CONFIG_COLORBALANCE_FILTER 0 -%define CONFIG_COLORCHANNELMIXER_FILTER 0 -%define CONFIG_COLORKEY_FILTER 0 -%define CONFIG_COLORLEVELS_FILTER 0 -%define CONFIG_COLORMATRIX_FILTER 0 -%define CONFIG_COLORSPACE_FILTER 0 -%define CONFIG_CONVOLUTION_FILTER 0 -%define CONFIG_CONVOLUTION_OPENCL_FILTER 0 -%define CONFIG_CONVOLVE_FILTER 0 -%define CONFIG_COPY_FILTER 0 -%define CONFIG_COREIMAGE_FILTER 0 -%define CONFIG_COVER_RECT_FILTER 0 -%define CONFIG_CROP_FILTER 0 -%define CONFIG_CROPDETECT_FILTER 0 -%define CONFIG_CUE_FILTER 0 -%define CONFIG_CURVES_FILTER 0 -%define CONFIG_DATASCOPE_FILTER 0 -%define CONFIG_DCTDNOIZ_FILTER 0 -%define CONFIG_DEBAND_FILTER 0 -%define CONFIG_DEBLOCK_FILTER 0 -%define CONFIG_DECIMATE_FILTER 0 -%define CONFIG_DECONVOLVE_FILTER 0 -%define CONFIG_DEDOT_FILTER 0 -%define CONFIG_DEFLATE_FILTER 0 -%define CONFIG_DEFLICKER_FILTER 0 -%define CONFIG_DEINTERLACE_QSV_FILTER 0 -%define CONFIG_DEINTERLACE_VAAPI_FILTER 0 -%define CONFIG_DEJUDDER_FILTER 0 -%define CONFIG_DELOGO_FILTER 0 -%define CONFIG_DENOISE_VAAPI_FILTER 0 -%define CONFIG_DESHAKE_FILTER 0 -%define CONFIG_DESPILL_FILTER 0 -%define CONFIG_DETELECINE_FILTER 0 -%define CONFIG_DILATION_FILTER 0 -%define CONFIG_DILATION_OPENCL_FILTER 0 -%define CONFIG_DISPLACE_FILTER 0 -%define CONFIG_DOUBLEWEAVE_FILTER 0 -%define CONFIG_DRAWBOX_FILTER 0 -%define CONFIG_DRAWGRAPH_FILTER 0 -%define CONFIG_DRAWGRID_FILTER 0 -%define CONFIG_DRAWTEXT_FILTER 0 -%define CONFIG_EDGEDETECT_FILTER 0 -%define CONFIG_ELBG_FILTER 0 -%define CONFIG_ENTROPY_FILTER 0 -%define CONFIG_EQ_FILTER 0 -%define CONFIG_EROSION_FILTER 0 -%define CONFIG_EROSION_OPENCL_FILTER 0 -%define CONFIG_EXTRACTPLANES_FILTER 0 -%define CONFIG_FADE_FILTER 0 -%define CONFIG_FFTDNOIZ_FILTER 0 -%define CONFIG_FFTFILT_FILTER 0 -%define CONFIG_FIELD_FILTER 0 -%define CONFIG_FIELDHINT_FILTER 0 -%define CONFIG_FIELDMATCH_FILTER 0 -%define CONFIG_FIELDORDER_FILTER 0 -%define CONFIG_FILLBORDERS_FILTER 0 -%define CONFIG_FIND_RECT_FILTER 0 -%define CONFIG_FLOODFILL_FILTER 0 -%define CONFIG_FORMAT_FILTER 0 -%define CONFIG_FPS_FILTER 0 -%define CONFIG_FRAMEPACK_FILTER 0 -%define CONFIG_FRAMERATE_FILTER 0 -%define CONFIG_FRAMESTEP_FILTER 0 -%define CONFIG_FREEZEDETECT_FILTER 0 -%define CONFIG_FREI0R_FILTER 0 -%define CONFIG_FSPP_FILTER 0 -%define CONFIG_GBLUR_FILTER 0 -%define CONFIG_GEQ_FILTER 0 -%define CONFIG_GRADFUN_FILTER 0 -%define CONFIG_GRAPHMONITOR_FILTER 0 -%define CONFIG_GREYEDGE_FILTER 0 -%define CONFIG_HALDCLUT_FILTER 0 -%define CONFIG_HFLIP_FILTER 0 -%define CONFIG_HISTEQ_FILTER 0 -%define CONFIG_HISTOGRAM_FILTER 0 -%define CONFIG_HQDN3D_FILTER 0 -%define CONFIG_HQX_FILTER 0 -%define CONFIG_HSTACK_FILTER 0 -%define CONFIG_HUE_FILTER 0 -%define CONFIG_HWDOWNLOAD_FILTER 0 -%define CONFIG_HWMAP_FILTER 0 -%define CONFIG_HWUPLOAD_FILTER 0 -%define CONFIG_HWUPLOAD_CUDA_FILTER 0 -%define CONFIG_HYSTERESIS_FILTER 0 -%define CONFIG_IDET_FILTER 0 -%define CONFIG_IL_FILTER 0 -%define CONFIG_INFLATE_FILTER 0 -%define CONFIG_INTERLACE_FILTER 0 -%define CONFIG_INTERLEAVE_FILTER 0 -%define CONFIG_KERNDEINT_FILTER 0 -%define CONFIG_LENSCORRECTION_FILTER 0 -%define CONFIG_LENSFUN_FILTER 0 -%define CONFIG_LIBVMAF_FILTER 0 -%define CONFIG_LIMITER_FILTER 0 -%define CONFIG_LOOP_FILTER 0 -%define CONFIG_LUMAKEY_FILTER 0 -%define CONFIG_LUT_FILTER 0 -%define CONFIG_LUT1D_FILTER 0 -%define CONFIG_LUT2_FILTER 0 -%define CONFIG_LUT3D_FILTER 0 -%define CONFIG_LUTRGB_FILTER 0 -%define CONFIG_LUTYUV_FILTER 0 -%define CONFIG_MASKEDCLAMP_FILTER 0 -%define CONFIG_MASKEDMERGE_FILTER 0 -%define CONFIG_MCDEINT_FILTER 0 -%define CONFIG_MERGEPLANES_FILTER 0 -%define CONFIG_MESTIMATE_FILTER 0 -%define CONFIG_METADATA_FILTER 0 -%define CONFIG_MIDEQUALIZER_FILTER 0 -%define CONFIG_MINTERPOLATE_FILTER 0 -%define CONFIG_MIX_FILTER 0 -%define CONFIG_MPDECIMATE_FILTER 0 -%define CONFIG_NEGATE_FILTER 0 -%define CONFIG_NLMEANS_FILTER 0 -%define CONFIG_NNEDI_FILTER 0 -%define CONFIG_NOFORMAT_FILTER 0 -%define CONFIG_NOISE_FILTER 0 -%define CONFIG_NORMALIZE_FILTER 0 -%define CONFIG_NULL_FILTER 0 -%define CONFIG_OCR_FILTER 0 -%define CONFIG_OCV_FILTER 0 -%define CONFIG_OSCILLOSCOPE_FILTER 0 -%define CONFIG_OVERLAY_FILTER 0 -%define CONFIG_OVERLAY_OPENCL_FILTER 0 -%define CONFIG_OVERLAY_QSV_FILTER 0 -%define CONFIG_OWDENOISE_FILTER 0 -%define CONFIG_PAD_FILTER 0 -%define CONFIG_PALETTEGEN_FILTER 0 -%define CONFIG_PALETTEUSE_FILTER 0 -%define CONFIG_PERMS_FILTER 0 -%define CONFIG_PERSPECTIVE_FILTER 0 -%define CONFIG_PHASE_FILTER 0 -%define CONFIG_PIXDESCTEST_FILTER 0 -%define CONFIG_PIXSCOPE_FILTER 0 -%define CONFIG_PP_FILTER 0 -%define CONFIG_PP7_FILTER 0 -%define CONFIG_PREMULTIPLY_FILTER 0 -%define CONFIG_PREWITT_FILTER 0 -%define CONFIG_PREWITT_OPENCL_FILTER 0 -%define CONFIG_PROCAMP_VAAPI_FILTER 0 -%define CONFIG_PROGRAM_OPENCL_FILTER 0 -%define CONFIG_PSEUDOCOLOR_FILTER 0 -%define CONFIG_PSNR_FILTER 0 -%define CONFIG_PULLUP_FILTER 0 -%define CONFIG_QP_FILTER 0 -%define CONFIG_RANDOM_FILTER 0 -%define CONFIG_READEIA608_FILTER 0 -%define CONFIG_READVITC_FILTER 0 -%define CONFIG_REALTIME_FILTER 0 -%define CONFIG_REMAP_FILTER 0 -%define CONFIG_REMOVEGRAIN_FILTER 0 -%define CONFIG_REMOVELOGO_FILTER 0 -%define CONFIG_REPEATFIELDS_FILTER 0 -%define CONFIG_REVERSE_FILTER 0 -%define CONFIG_RGBASHIFT_FILTER 0 -%define CONFIG_ROBERTS_FILTER 0 -%define CONFIG_ROBERTS_OPENCL_FILTER 0 -%define CONFIG_ROTATE_FILTER 0 -%define CONFIG_SAB_FILTER 0 -%define CONFIG_SCALE_FILTER 0 -%define CONFIG_SCALE_CUDA_FILTER 0 -%define CONFIG_SCALE_NPP_FILTER 0 -%define CONFIG_SCALE_QSV_FILTER 0 -%define CONFIG_SCALE_VAAPI_FILTER 0 -%define CONFIG_SCALE2REF_FILTER 0 -%define CONFIG_SELECT_FILTER 0 -%define CONFIG_SELECTIVECOLOR_FILTER 0 -%define CONFIG_SENDCMD_FILTER 0 -%define CONFIG_SEPARATEFIELDS_FILTER 0 -%define CONFIG_SETDAR_FILTER 0 -%define CONFIG_SETFIELD_FILTER 0 -%define CONFIG_SETPARAMS_FILTER 0 -%define CONFIG_SETPTS_FILTER 0 -%define CONFIG_SETRANGE_FILTER 0 -%define CONFIG_SETSAR_FILTER 0 -%define CONFIG_SETTB_FILTER 0 -%define CONFIG_SHARPNESS_VAAPI_FILTER 0 -%define CONFIG_SHOWINFO_FILTER 0 -%define CONFIG_SHOWPALETTE_FILTER 0 -%define CONFIG_SHUFFLEFRAMES_FILTER 0 -%define CONFIG_SHUFFLEPLANES_FILTER 0 -%define CONFIG_SIDEDATA_FILTER 0 -%define CONFIG_SIGNALSTATS_FILTER 0 -%define CONFIG_SIGNATURE_FILTER 0 -%define CONFIG_SMARTBLUR_FILTER 0 -%define CONFIG_SOBEL_FILTER 0 -%define CONFIG_SOBEL_OPENCL_FILTER 0 -%define CONFIG_SPLIT_FILTER 0 -%define CONFIG_SPP_FILTER 0 -%define CONFIG_SR_FILTER 0 -%define CONFIG_SSIM_FILTER 0 -%define CONFIG_STEREO3D_FILTER 0 -%define CONFIG_STREAMSELECT_FILTER 0 -%define CONFIG_SUBTITLES_FILTER 0 -%define CONFIG_SUPER2XSAI_FILTER 0 -%define CONFIG_SWAPRECT_FILTER 0 -%define CONFIG_SWAPUV_FILTER 0 -%define CONFIG_TBLEND_FILTER 0 -%define CONFIG_TELECINE_FILTER 0 -%define CONFIG_THRESHOLD_FILTER 0 -%define CONFIG_THUMBNAIL_FILTER 0 -%define CONFIG_THUMBNAIL_CUDA_FILTER 0 -%define CONFIG_TILE_FILTER 0 -%define CONFIG_TINTERLACE_FILTER 0 -%define CONFIG_TLUT2_FILTER 0 -%define CONFIG_TMIX_FILTER 0 -%define CONFIG_TONEMAP_FILTER 0 -%define CONFIG_TONEMAP_OPENCL_FILTER 0 -%define CONFIG_TPAD_FILTER 0 -%define CONFIG_TRANSPOSE_FILTER 0 -%define CONFIG_TRANSPOSE_NPP_FILTER 0 -%define CONFIG_TRIM_FILTER 0 -%define CONFIG_UNPREMULTIPLY_FILTER 0 -%define CONFIG_UNSHARP_FILTER 0 -%define CONFIG_UNSHARP_OPENCL_FILTER 0 -%define CONFIG_USPP_FILTER 0 -%define CONFIG_VAGUEDENOISER_FILTER 0 -%define CONFIG_VECTORSCOPE_FILTER 0 -%define CONFIG_VFLIP_FILTER 0 -%define CONFIG_VFRDET_FILTER 0 -%define CONFIG_VIBRANCE_FILTER 0 -%define CONFIG_VIDSTABDETECT_FILTER 0 -%define CONFIG_VIDSTABTRANSFORM_FILTER 0 -%define CONFIG_VIGNETTE_FILTER 0 -%define CONFIG_VMAFMOTION_FILTER 0 -%define CONFIG_VPP_QSV_FILTER 0 -%define CONFIG_VSTACK_FILTER 0 -%define CONFIG_W3FDIF_FILTER 0 -%define CONFIG_WAVEFORM_FILTER 0 -%define CONFIG_WEAVE_FILTER 0 -%define CONFIG_XBR_FILTER 0 -%define CONFIG_XSTACK_FILTER 0 -%define CONFIG_YADIF_FILTER 0 -%define CONFIG_YADIF_CUDA_FILTER 0 -%define CONFIG_ZMQ_FILTER 0 -%define CONFIG_ZOOMPAN_FILTER 0 -%define CONFIG_ZSCALE_FILTER 0 -%define CONFIG_ALLRGB_FILTER 0 -%define CONFIG_ALLYUV_FILTER 0 -%define CONFIG_CELLAUTO_FILTER 0 -%define CONFIG_COLOR_FILTER 0 -%define CONFIG_COREIMAGESRC_FILTER 0 -%define CONFIG_FREI0R_SRC_FILTER 0 -%define CONFIG_HALDCLUTSRC_FILTER 0 -%define CONFIG_LIFE_FILTER 0 -%define CONFIG_MANDELBROT_FILTER 0 -%define CONFIG_MPTESTSRC_FILTER 0 -%define CONFIG_NULLSRC_FILTER 0 -%define CONFIG_OPENCLSRC_FILTER 0 -%define CONFIG_PAL75BARS_FILTER 0 -%define CONFIG_PAL100BARS_FILTER 0 -%define CONFIG_RGBTESTSRC_FILTER 0 -%define CONFIG_SMPTEBARS_FILTER 0 -%define CONFIG_SMPTEHDBARS_FILTER 0 -%define CONFIG_TESTSRC_FILTER 0 -%define CONFIG_TESTSRC2_FILTER 0 -%define CONFIG_YUVTESTSRC_FILTER 0 -%define CONFIG_NULLSINK_FILTER 0 -%define CONFIG_ABITSCOPE_FILTER 0 -%define CONFIG_ADRAWGRAPH_FILTER 0 -%define CONFIG_AGRAPHMONITOR_FILTER 0 -%define CONFIG_AHISTOGRAM_FILTER 0 -%define CONFIG_APHASEMETER_FILTER 0 -%define CONFIG_AVECTORSCOPE_FILTER 0 -%define CONFIG_CONCAT_FILTER 0 -%define CONFIG_SHOWCQT_FILTER 0 -%define CONFIG_SHOWFREQS_FILTER 0 -%define CONFIG_SHOWSPECTRUM_FILTER 0 -%define CONFIG_SHOWSPECTRUMPIC_FILTER 0 -%define CONFIG_SHOWVOLUME_FILTER 0 -%define CONFIG_SHOWWAVES_FILTER 0 -%define CONFIG_SHOWWAVESPIC_FILTER 0 -%define CONFIG_SPECTRUMSYNTH_FILTER 0 -%define CONFIG_AMOVIE_FILTER 0 -%define CONFIG_MOVIE_FILTER 0 -%define CONFIG_AFIFO_FILTER 0 -%define CONFIG_FIFO_FILTER 0 -%define CONFIG_AA_DEMUXER 1 -%define CONFIG_AAC_DEMUXER 1 -%define CONFIG_AC3_DEMUXER 1 -%define CONFIG_ACM_DEMUXER 1 -%define CONFIG_ACT_DEMUXER 1 -%define CONFIG_ADF_DEMUXER 1 -%define CONFIG_ADP_DEMUXER 1 -%define CONFIG_ADS_DEMUXER 1 -%define CONFIG_ADX_DEMUXER 1 -%define CONFIG_AEA_DEMUXER 1 -%define CONFIG_AFC_DEMUXER 1 -%define CONFIG_AIFF_DEMUXER 1 -%define CONFIG_AIX_DEMUXER 1 -%define CONFIG_AMR_DEMUXER 1 -%define CONFIG_AMRNB_DEMUXER 1 -%define CONFIG_AMRWB_DEMUXER 1 -%define CONFIG_ANM_DEMUXER 1 -%define CONFIG_APC_DEMUXER 1 -%define CONFIG_APE_DEMUXER 1 -%define CONFIG_APNG_DEMUXER 1 -%define CONFIG_APTX_DEMUXER 1 -%define CONFIG_APTX_HD_DEMUXER 1 -%define CONFIG_AQTITLE_DEMUXER 1 -%define CONFIG_ASF_DEMUXER 1 -%define CONFIG_ASF_O_DEMUXER 1 -%define CONFIG_ASS_DEMUXER 1 -%define CONFIG_AST_DEMUXER 1 -%define CONFIG_AU_DEMUXER 1 -%define CONFIG_AVI_DEMUXER 1 -%define CONFIG_AVISYNTH_DEMUXER 0 -%define CONFIG_AVR_DEMUXER 1 -%define CONFIG_AVS_DEMUXER 1 -%define CONFIG_AVS2_DEMUXER 1 -%define CONFIG_BETHSOFTVID_DEMUXER 1 -%define CONFIG_BFI_DEMUXER 1 -%define CONFIG_BINTEXT_DEMUXER 1 -%define CONFIG_BINK_DEMUXER 1 -%define CONFIG_BIT_DEMUXER 1 -%define CONFIG_BMV_DEMUXER 1 -%define CONFIG_BFSTM_DEMUXER 1 -%define CONFIG_BRSTM_DEMUXER 1 -%define CONFIG_BOA_DEMUXER 1 -%define CONFIG_C93_DEMUXER 1 -%define CONFIG_CAF_DEMUXER 1 -%define CONFIG_CAVSVIDEO_DEMUXER 1 -%define CONFIG_CDG_DEMUXER 1 -%define CONFIG_CDXL_DEMUXER 1 -%define CONFIG_CINE_DEMUXER 1 -%define CONFIG_CODEC2_DEMUXER 1 -%define CONFIG_CODEC2RAW_DEMUXER 1 -%define CONFIG_CONCAT_DEMUXER 1 -%define CONFIG_DASH_DEMUXER 0 -%define CONFIG_DATA_DEMUXER 1 -%define CONFIG_DAUD_DEMUXER 1 -%define CONFIG_DCSTR_DEMUXER 1 -%define CONFIG_DFA_DEMUXER 1 -%define CONFIG_DIRAC_DEMUXER 1 -%define CONFIG_DNXHD_DEMUXER 1 -%define CONFIG_DSF_DEMUXER 1 -%define CONFIG_DSICIN_DEMUXER 1 -%define CONFIG_DSS_DEMUXER 1 -%define CONFIG_DTS_DEMUXER 1 -%define CONFIG_DTSHD_DEMUXER 1 -%define CONFIG_DV_DEMUXER 1 -%define CONFIG_DVBSUB_DEMUXER 1 -%define CONFIG_DVBTXT_DEMUXER 1 -%define CONFIG_DXA_DEMUXER 1 -%define CONFIG_EA_DEMUXER 1 -%define CONFIG_EA_CDATA_DEMUXER 1 -%define CONFIG_EAC3_DEMUXER 1 -%define CONFIG_EPAF_DEMUXER 1 -%define CONFIG_FFMETADATA_DEMUXER 1 -%define CONFIG_FILMSTRIP_DEMUXER 1 -%define CONFIG_FITS_DEMUXER 1 -%define CONFIG_FLAC_DEMUXER 1 -%define CONFIG_FLIC_DEMUXER 1 -%define CONFIG_FLV_DEMUXER 1 -%define CONFIG_LIVE_FLV_DEMUXER 1 -%define CONFIG_FOURXM_DEMUXER 1 -%define CONFIG_FRM_DEMUXER 1 -%define CONFIG_FSB_DEMUXER 1 -%define CONFIG_G722_DEMUXER 1 -%define CONFIG_G723_1_DEMUXER 1 -%define CONFIG_G726_DEMUXER 1 -%define CONFIG_G726LE_DEMUXER 1 -%define CONFIG_G729_DEMUXER 1 -%define CONFIG_GDV_DEMUXER 1 -%define CONFIG_GENH_DEMUXER 1 -%define CONFIG_GIF_DEMUXER 1 -%define CONFIG_GSM_DEMUXER 1 -%define CONFIG_GXF_DEMUXER 1 -%define CONFIG_H261_DEMUXER 1 -%define CONFIG_H263_DEMUXER 1 -%define CONFIG_H264_DEMUXER 1 -%define CONFIG_HEVC_DEMUXER 1 -%define CONFIG_HLS_DEMUXER 1 -%define CONFIG_HNM_DEMUXER 1 -%define CONFIG_ICO_DEMUXER 1 -%define CONFIG_IDCIN_DEMUXER 1 -%define CONFIG_IDF_DEMUXER 1 -%define CONFIG_IFF_DEMUXER 1 -%define CONFIG_ILBC_DEMUXER 1 -%define CONFIG_IMAGE2_DEMUXER 1 -%define CONFIG_IMAGE2PIPE_DEMUXER 1 -%define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 1 -%define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 1 -%define CONFIG_INGENIENT_DEMUXER 1 -%define CONFIG_IPMOVIE_DEMUXER 1 -%define CONFIG_IRCAM_DEMUXER 1 -%define CONFIG_ISS_DEMUXER 1 -%define CONFIG_IV8_DEMUXER 1 -%define CONFIG_IVF_DEMUXER 1 -%define CONFIG_IVR_DEMUXER 1 -%define CONFIG_JACOSUB_DEMUXER 1 -%define CONFIG_JV_DEMUXER 1 -%define CONFIG_LMLM4_DEMUXER 1 -%define CONFIG_LOAS_DEMUXER 1 -%define CONFIG_LRC_DEMUXER 1 -%define CONFIG_LVF_DEMUXER 1 -%define CONFIG_LXF_DEMUXER 1 -%define CONFIG_M4V_DEMUXER 1 -%define CONFIG_MATROSKA_DEMUXER 1 -%define CONFIG_MGSTS_DEMUXER 1 -%define CONFIG_MICRODVD_DEMUXER 1 -%define CONFIG_MJPEG_DEMUXER 1 -%define CONFIG_MJPEG_2000_DEMUXER 1 -%define CONFIG_MLP_DEMUXER 1 -%define CONFIG_MLV_DEMUXER 1 -%define CONFIG_MM_DEMUXER 1 -%define CONFIG_MMF_DEMUXER 1 -%define CONFIG_MOV_DEMUXER 1 -%define CONFIG_MP3_DEMUXER 1 -%define CONFIG_MPC_DEMUXER 1 -%define CONFIG_MPC8_DEMUXER 1 -%define CONFIG_MPEGPS_DEMUXER 1 -%define CONFIG_MPEGTS_DEMUXER 1 -%define CONFIG_MPEGTSRAW_DEMUXER 1 -%define CONFIG_MPEGVIDEO_DEMUXER 1 -%define CONFIG_MPJPEG_DEMUXER 1 -%define CONFIG_MPL2_DEMUXER 1 -%define CONFIG_MPSUB_DEMUXER 1 -%define CONFIG_MSF_DEMUXER 1 -%define CONFIG_MSNWC_TCP_DEMUXER 1 -%define CONFIG_MTAF_DEMUXER 1 -%define CONFIG_MTV_DEMUXER 1 -%define CONFIG_MUSX_DEMUXER 1 -%define CONFIG_MV_DEMUXER 1 -%define CONFIG_MVI_DEMUXER 1 -%define CONFIG_MXF_DEMUXER 1 -%define CONFIG_MXG_DEMUXER 1 -%define CONFIG_NC_DEMUXER 1 -%define CONFIG_NISTSPHERE_DEMUXER 1 -%define CONFIG_NSP_DEMUXER 1 -%define CONFIG_NSV_DEMUXER 1 -%define CONFIG_NUT_DEMUXER 1 -%define CONFIG_NUV_DEMUXER 1 -%define CONFIG_OGG_DEMUXER 1 -%define CONFIG_OMA_DEMUXER 1 -%define CONFIG_PAF_DEMUXER 1 -%define CONFIG_PCM_ALAW_DEMUXER 1 -%define CONFIG_PCM_MULAW_DEMUXER 1 -%define CONFIG_PCM_VIDC_DEMUXER 1 -%define CONFIG_PCM_F64BE_DEMUXER 1 -%define CONFIG_PCM_F64LE_DEMUXER 1 -%define CONFIG_PCM_F32BE_DEMUXER 1 -%define CONFIG_PCM_F32LE_DEMUXER 1 -%define CONFIG_PCM_S32BE_DEMUXER 1 -%define CONFIG_PCM_S32LE_DEMUXER 1 -%define CONFIG_PCM_S24BE_DEMUXER 1 -%define CONFIG_PCM_S24LE_DEMUXER 1 -%define CONFIG_PCM_S16BE_DEMUXER 1 -%define CONFIG_PCM_S16LE_DEMUXER 1 -%define CONFIG_PCM_S8_DEMUXER 1 -%define CONFIG_PCM_U32BE_DEMUXER 1 -%define CONFIG_PCM_U32LE_DEMUXER 1 -%define CONFIG_PCM_U24BE_DEMUXER 1 -%define CONFIG_PCM_U24LE_DEMUXER 1 -%define CONFIG_PCM_U16BE_DEMUXER 1 -%define CONFIG_PCM_U16LE_DEMUXER 1 -%define CONFIG_PCM_U8_DEMUXER 1 -%define CONFIG_PJS_DEMUXER 1 -%define CONFIG_PMP_DEMUXER 1 -%define CONFIG_PVA_DEMUXER 1 -%define CONFIG_PVF_DEMUXER 1 -%define CONFIG_QCP_DEMUXER 1 -%define CONFIG_R3D_DEMUXER 1 -%define CONFIG_RAWVIDEO_DEMUXER 1 -%define CONFIG_REALTEXT_DEMUXER 1 -%define CONFIG_REDSPARK_DEMUXER 1 -%define CONFIG_RL2_DEMUXER 1 -%define CONFIG_RM_DEMUXER 1 -%define CONFIG_ROQ_DEMUXER 1 -%define CONFIG_RPL_DEMUXER 1 -%define CONFIG_RSD_DEMUXER 1 -%define CONFIG_RSO_DEMUXER 1 -%define CONFIG_RTP_DEMUXER 0 -%define CONFIG_RTSP_DEMUXER 0 -%define CONFIG_S337M_DEMUXER 1 -%define CONFIG_SAMI_DEMUXER 1 -%define CONFIG_SAP_DEMUXER 0 -%define CONFIG_SBC_DEMUXER 1 -%define CONFIG_SBG_DEMUXER 1 -%define CONFIG_SCC_DEMUXER 1 -%define CONFIG_SDP_DEMUXER 0 -%define CONFIG_SDR2_DEMUXER 1 -%define CONFIG_SDS_DEMUXER 1 -%define CONFIG_SDX_DEMUXER 1 -%define CONFIG_SEGAFILM_DEMUXER 1 -%define CONFIG_SER_DEMUXER 1 -%define CONFIG_SHORTEN_DEMUXER 1 -%define CONFIG_SIFF_DEMUXER 1 -%define CONFIG_SLN_DEMUXER 1 -%define CONFIG_SMACKER_DEMUXER 1 -%define CONFIG_SMJPEG_DEMUXER 1 -%define CONFIG_SMUSH_DEMUXER 1 -%define CONFIG_SOL_DEMUXER 1 -%define CONFIG_SOX_DEMUXER 1 -%define CONFIG_SPDIF_DEMUXER 1 -%define CONFIG_SRT_DEMUXER 1 -%define CONFIG_STR_DEMUXER 1 -%define CONFIG_STL_DEMUXER 1 -%define CONFIG_SUBVIEWER1_DEMUXER 1 -%define CONFIG_SUBVIEWER_DEMUXER 1 -%define CONFIG_SUP_DEMUXER 1 -%define CONFIG_SVAG_DEMUXER 1 -%define CONFIG_SWF_DEMUXER 1 -%define CONFIG_TAK_DEMUXER 1 -%define CONFIG_TEDCAPTIONS_DEMUXER 1 -%define CONFIG_THP_DEMUXER 1 -%define CONFIG_THREEDOSTR_DEMUXER 1 -%define CONFIG_TIERTEXSEQ_DEMUXER 1 -%define CONFIG_TMV_DEMUXER 1 -%define CONFIG_TRUEHD_DEMUXER 1 -%define CONFIG_TTA_DEMUXER 1 -%define CONFIG_TXD_DEMUXER 1 -%define CONFIG_TTY_DEMUXER 1 -%define CONFIG_TY_DEMUXER 1 -%define CONFIG_V210_DEMUXER 1 -%define CONFIG_V210X_DEMUXER 1 -%define CONFIG_VAG_DEMUXER 1 -%define CONFIG_VC1_DEMUXER 1 -%define CONFIG_VC1T_DEMUXER 1 -%define CONFIG_VIVO_DEMUXER 1 -%define CONFIG_VMD_DEMUXER 1 -%define CONFIG_VOBSUB_DEMUXER 1 -%define CONFIG_VOC_DEMUXER 1 -%define CONFIG_VPK_DEMUXER 1 -%define CONFIG_VPLAYER_DEMUXER 1 -%define CONFIG_VQF_DEMUXER 1 -%define CONFIG_W64_DEMUXER 1 -%define CONFIG_WAV_DEMUXER 1 -%define CONFIG_WC3_DEMUXER 1 -%define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 1 -%define CONFIG_WEBVTT_DEMUXER 1 -%define CONFIG_WSAUD_DEMUXER 1 -%define CONFIG_WSD_DEMUXER 1 -%define CONFIG_WSVQA_DEMUXER 1 -%define CONFIG_WTV_DEMUXER 1 -%define CONFIG_WVE_DEMUXER 1 -%define CONFIG_WV_DEMUXER 1 -%define CONFIG_XA_DEMUXER 1 -%define CONFIG_XBIN_DEMUXER 1 -%define CONFIG_XMV_DEMUXER 1 -%define CONFIG_XVAG_DEMUXER 1 -%define CONFIG_XWMA_DEMUXER 1 -%define CONFIG_YOP_DEMUXER 1 -%define CONFIG_YUV4MPEGPIPE_DEMUXER 1 -%define CONFIG_IMAGE_BMP_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_DDS_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_DPX_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_EXR_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_J2K_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PAM_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PBM_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PCX_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PGM_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PNG_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PPM_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_PSD_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_SGI_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_SVG_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_XPM_PIPE_DEMUXER 1 -%define CONFIG_IMAGE_XWD_PIPE_DEMUXER 1 -%define CONFIG_LIBGME_DEMUXER 0 -%define CONFIG_LIBMODPLUG_DEMUXER 0 -%define CONFIG_LIBOPENMPT_DEMUXER 0 -%define CONFIG_VAPOURSYNTH_DEMUXER 0 -%define CONFIG_A64_MUXER 0 -%define CONFIG_AC3_MUXER 0 -%define CONFIG_ADTS_MUXER 0 -%define CONFIG_ADX_MUXER 0 -%define CONFIG_AIFF_MUXER 0 -%define CONFIG_AMR_MUXER 0 -%define CONFIG_APNG_MUXER 0 -%define CONFIG_APTX_MUXER 0 -%define CONFIG_APTX_HD_MUXER 0 -%define CONFIG_ASF_MUXER 0 -%define CONFIG_ASS_MUXER 0 -%define CONFIG_AST_MUXER 0 -%define CONFIG_ASF_STREAM_MUXER 0 -%define CONFIG_AU_MUXER 0 -%define CONFIG_AVI_MUXER 0 -%define CONFIG_AVM2_MUXER 0 -%define CONFIG_AVS2_MUXER 0 -%define CONFIG_BIT_MUXER 0 -%define CONFIG_CAF_MUXER 0 -%define CONFIG_CAVSVIDEO_MUXER 0 -%define CONFIG_CODEC2_MUXER 0 -%define CONFIG_CODEC2RAW_MUXER 0 -%define CONFIG_CRC_MUXER 0 -%define CONFIG_DASH_MUXER 0 -%define CONFIG_DATA_MUXER 0 -%define CONFIG_DAUD_MUXER 0 -%define CONFIG_DIRAC_MUXER 0 -%define CONFIG_DNXHD_MUXER 0 -%define CONFIG_DTS_MUXER 0 -%define CONFIG_DV_MUXER 0 -%define CONFIG_EAC3_MUXER 0 -%define CONFIG_F4V_MUXER 0 -%define CONFIG_FFMETADATA_MUXER 0 -%define CONFIG_FIFO_MUXER 0 -%define CONFIG_FIFO_TEST_MUXER 0 -%define CONFIG_FILMSTRIP_MUXER 0 -%define CONFIG_FITS_MUXER 0 -%define CONFIG_FLAC_MUXER 0 -%define CONFIG_FLV_MUXER 0 -%define CONFIG_FRAMECRC_MUXER 0 -%define CONFIG_FRAMEHASH_MUXER 0 -%define CONFIG_FRAMEMD5_MUXER 0 -%define CONFIG_G722_MUXER 0 -%define CONFIG_G723_1_MUXER 0 -%define CONFIG_G726_MUXER 0 -%define CONFIG_G726LE_MUXER 0 -%define CONFIG_GIF_MUXER 0 -%define CONFIG_GSM_MUXER 0 -%define CONFIG_GXF_MUXER 0 -%define CONFIG_H261_MUXER 0 -%define CONFIG_H263_MUXER 0 -%define CONFIG_H264_MUXER 0 -%define CONFIG_HASH_MUXER 0 -%define CONFIG_HDS_MUXER 0 -%define CONFIG_HEVC_MUXER 0 -%define CONFIG_HLS_MUXER 0 -%define CONFIG_ICO_MUXER 0 -%define CONFIG_ILBC_MUXER 0 -%define CONFIG_IMAGE2_MUXER 0 -%define CONFIG_IMAGE2PIPE_MUXER 0 -%define CONFIG_IPOD_MUXER 0 -%define CONFIG_IRCAM_MUXER 0 -%define CONFIG_ISMV_MUXER 0 -%define CONFIG_IVF_MUXER 0 -%define CONFIG_JACOSUB_MUXER 0 -%define CONFIG_LATM_MUXER 0 -%define CONFIG_LRC_MUXER 0 -%define CONFIG_M4V_MUXER 0 -%define CONFIG_MD5_MUXER 0 -%define CONFIG_MATROSKA_MUXER 0 -%define CONFIG_MATROSKA_AUDIO_MUXER 0 -%define CONFIG_MICRODVD_MUXER 0 -%define CONFIG_MJPEG_MUXER 0 -%define CONFIG_MLP_MUXER 0 -%define CONFIG_MMF_MUXER 0 -%define CONFIG_MOV_MUXER 0 -%define CONFIG_MP2_MUXER 0 -%define CONFIG_MP3_MUXER 0 -%define CONFIG_MP4_MUXER 0 -%define CONFIG_MPEG1SYSTEM_MUXER 0 -%define CONFIG_MPEG1VCD_MUXER 0 -%define CONFIG_MPEG1VIDEO_MUXER 0 -%define CONFIG_MPEG2DVD_MUXER 0 -%define CONFIG_MPEG2SVCD_MUXER 0 -%define CONFIG_MPEG2VIDEO_MUXER 0 -%define CONFIG_MPEG2VOB_MUXER 0 -%define CONFIG_MPEGTS_MUXER 0 -%define CONFIG_MPJPEG_MUXER 0 -%define CONFIG_MXF_MUXER 0 -%define CONFIG_MXF_D10_MUXER 0 -%define CONFIG_MXF_OPATOM_MUXER 0 -%define CONFIG_NULL_MUXER 0 -%define CONFIG_NUT_MUXER 0 -%define CONFIG_OGA_MUXER 0 -%define CONFIG_OGG_MUXER 0 -%define CONFIG_OGV_MUXER 0 -%define CONFIG_OMA_MUXER 0 -%define CONFIG_OPUS_MUXER 0 -%define CONFIG_PCM_ALAW_MUXER 0 -%define CONFIG_PCM_MULAW_MUXER 0 -%define CONFIG_PCM_VIDC_MUXER 0 -%define CONFIG_PCM_F64BE_MUXER 0 -%define CONFIG_PCM_F64LE_MUXER 0 -%define CONFIG_PCM_F32BE_MUXER 0 -%define CONFIG_PCM_F32LE_MUXER 0 -%define CONFIG_PCM_S32BE_MUXER 0 -%define CONFIG_PCM_S32LE_MUXER 0 -%define CONFIG_PCM_S24BE_MUXER 0 -%define CONFIG_PCM_S24LE_MUXER 0 -%define CONFIG_PCM_S16BE_MUXER 0 -%define CONFIG_PCM_S16LE_MUXER 0 -%define CONFIG_PCM_S8_MUXER 0 -%define CONFIG_PCM_U32BE_MUXER 0 -%define CONFIG_PCM_U32LE_MUXER 0 -%define CONFIG_PCM_U24BE_MUXER 0 -%define CONFIG_PCM_U24LE_MUXER 0 -%define CONFIG_PCM_U16BE_MUXER 0 -%define CONFIG_PCM_U16LE_MUXER 0 -%define CONFIG_PCM_U8_MUXER 0 -%define CONFIG_PSP_MUXER 0 -%define CONFIG_RAWVIDEO_MUXER 0 -%define CONFIG_RM_MUXER 0 -%define CONFIG_ROQ_MUXER 0 -%define CONFIG_RSO_MUXER 0 -%define CONFIG_RTP_MUXER 0 -%define CONFIG_RTP_MPEGTS_MUXER 0 -%define CONFIG_RTSP_MUXER 0 -%define CONFIG_SAP_MUXER 0 -%define CONFIG_SBC_MUXER 0 -%define CONFIG_SCC_MUXER 0 -%define CONFIG_SEGAFILM_MUXER 0 -%define CONFIG_SEGMENT_MUXER 0 -%define CONFIG_STREAM_SEGMENT_MUXER 0 -%define CONFIG_SINGLEJPEG_MUXER 0 -%define CONFIG_SMJPEG_MUXER 0 -%define CONFIG_SMOOTHSTREAMING_MUXER 0 -%define CONFIG_SOX_MUXER 0 -%define CONFIG_SPX_MUXER 0 -%define CONFIG_SPDIF_MUXER 0 -%define CONFIG_SRT_MUXER 0 -%define CONFIG_SUP_MUXER 0 -%define CONFIG_SWF_MUXER 0 -%define CONFIG_TEE_MUXER 0 -%define CONFIG_TG2_MUXER 0 -%define CONFIG_TGP_MUXER 0 -%define CONFIG_MKVTIMESTAMP_V2_MUXER 0 -%define CONFIG_TRUEHD_MUXER 0 -%define CONFIG_TTA_MUXER 0 -%define CONFIG_UNCODEDFRAMECRC_MUXER 0 -%define CONFIG_VC1_MUXER 0 -%define CONFIG_VC1T_MUXER 0 -%define CONFIG_VOC_MUXER 0 -%define CONFIG_W64_MUXER 0 -%define CONFIG_WAV_MUXER 0 -%define CONFIG_WEBM_MUXER 0 -%define CONFIG_WEBM_DASH_MANIFEST_MUXER 0 -%define CONFIG_WEBM_CHUNK_MUXER 0 -%define CONFIG_WEBP_MUXER 0 -%define CONFIG_WEBVTT_MUXER 0 -%define CONFIG_WTV_MUXER 0 -%define CONFIG_WV_MUXER 0 -%define CONFIG_YUV4MPEGPIPE_MUXER 0 -%define CONFIG_CHROMAPRINT_MUXER 0 -%define CONFIG_ASYNC_PROTOCOL 1 -%define CONFIG_BLURAY_PROTOCOL 0 -%define CONFIG_CACHE_PROTOCOL 1 -%define CONFIG_CONCAT_PROTOCOL 1 -%define CONFIG_CRYPTO_PROTOCOL 1 -%define CONFIG_DATA_PROTOCOL 1 -%define CONFIG_FFRTMPCRYPT_PROTOCOL 0 -%define CONFIG_FFRTMPHTTP_PROTOCOL 0 -%define CONFIG_FILE_PROTOCOL 1 -%define CONFIG_FTP_PROTOCOL 0 -%define CONFIG_GOPHER_PROTOCOL 0 -%define CONFIG_HLS_PROTOCOL 1 -%define CONFIG_HTTP_PROTOCOL 0 -%define CONFIG_HTTPPROXY_PROTOCOL 0 -%define CONFIG_HTTPS_PROTOCOL 0 -%define CONFIG_ICECAST_PROTOCOL 0 -%define CONFIG_MMSH_PROTOCOL 0 -%define CONFIG_MMST_PROTOCOL 0 -%define CONFIG_MD5_PROTOCOL 1 -%define CONFIG_PIPE_PROTOCOL 1 -%define CONFIG_PROMPEG_PROTOCOL 1 -%define CONFIG_RTMP_PROTOCOL 0 -%define CONFIG_RTMPE_PROTOCOL 0 -%define CONFIG_RTMPS_PROTOCOL 0 -%define CONFIG_RTMPT_PROTOCOL 0 -%define CONFIG_RTMPTE_PROTOCOL 0 -%define CONFIG_RTMPTS_PROTOCOL 0 -%define CONFIG_RTP_PROTOCOL 0 -%define CONFIG_SCTP_PROTOCOL 0 -%define CONFIG_SRTP_PROTOCOL 0 -%define CONFIG_SUBFILE_PROTOCOL 1 -%define CONFIG_TEE_PROTOCOL 1 -%define CONFIG_TCP_PROTOCOL 0 -%define CONFIG_TLS_PROTOCOL 0 -%define CONFIG_UDP_PROTOCOL 0 -%define CONFIG_UDPLITE_PROTOCOL 0 -%define CONFIG_UNIX_PROTOCOL 0 -%define CONFIG_LIBRTMP_PROTOCOL 0 -%define CONFIG_LIBRTMPE_PROTOCOL 0 -%define CONFIG_LIBRTMPS_PROTOCOL 0 -%define CONFIG_LIBRTMPT_PROTOCOL 0 -%define CONFIG_LIBRTMPTE_PROTOCOL 0 -%define CONFIG_LIBSRT_PROTOCOL 0 -%define CONFIG_LIBSSH_PROTOCOL 0 -%define CONFIG_LIBSMBCLIENT_PROTOCOL 0 diff --git a/build/ffmpeg/config-x86.h b/build/ffmpeg/config-x86.h deleted file mode 100755 index 0a1483e3b..000000000 --- a/build/ffmpeg/config-x86.h +++ /dev/null @@ -1,2476 +0,0 @@ -/* Automatically generated by configure - do not modify! */ -#ifndef FFMPEG_CONFIG_H -#define FFMPEG_CONFIG_H -#define FFMPEG_CONFIGURATION "--disable-avfilter --disable-avresample --disable-bzlib --disable-d3d11va --disable-dxva2 --disable-decoder='atrac3p,indeo2,indeo3,indeo4,indeo5,twinvq' --disable-devices --disable-doc --disable-encoders --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-filters --disable-hwaccels --disable-muxers --disable-network --disable-postproc --disable-pthreads --disable-shared --enable-gpl --enable-runtime-cpudetect --enable-static --enable-small --enable-x86asm --x86asmexe=yasm --enable-zlib --extra-cflags=-D_SYSCRT --extra-cflags=-I../../include --extra-cflags=-MD --extra-cflags=-wd4005 --extra-cflags=-wd4189 --extra-ldflags='-LIBPATH:../../lib/Win32/Release' --toolchain=msvc" -#define FFMPEG_LICENSE "GPL version 2 or later" -#define CONFIG_THIS_YEAR 2018 -#define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -#define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26132 for x86" -#define av_restrict __restrict -#define EXTERN_PREFIX "_" -#define EXTERN_ASM _ -#define BUILDSUF "" -#define SLIBSUF ".dll" -#define HAVE_MMX2 HAVE_MMXEXT -#define SWS_MAX_FILTER_SIZE 256 -#define ARCH_AARCH64 0 -#define ARCH_ALPHA 0 -#define ARCH_ARM 0 -#define ARCH_AVR32 0 -#define ARCH_AVR32_AP 0 -#define ARCH_AVR32_UC 0 -#define ARCH_BFIN 0 -#define ARCH_IA64 0 -#define ARCH_M68K 0 -#define ARCH_MIPS 0 -#define ARCH_MIPS64 0 -#define ARCH_PARISC 0 -#define ARCH_PPC 0 -#define ARCH_PPC64 0 -#define ARCH_S390 0 -#define ARCH_SH4 0 -#define ARCH_SPARC 0 -#define ARCH_SPARC64 0 -#define ARCH_TILEGX 0 -#define ARCH_TILEPRO 0 -#define ARCH_TOMI 0 -#define ARCH_X86 1 -#define ARCH_X86_32 1 -#define ARCH_X86_64 0 -#define HAVE_ARMV5TE 0 -#define HAVE_ARMV6 0 -#define HAVE_ARMV6T2 0 -#define HAVE_ARMV8 0 -#define HAVE_NEON 0 -#define HAVE_VFP 0 -#define HAVE_VFPV3 0 -#define HAVE_SETEND 0 -#define HAVE_ALTIVEC 0 -#define HAVE_DCBZL 0 -#define HAVE_LDBRX 0 -#define HAVE_POWER8 0 -#define HAVE_PPC4XX 0 -#define HAVE_VSX 0 -#define HAVE_AESNI 1 -#define HAVE_AMD3DNOW 1 -#define HAVE_AMD3DNOWEXT 1 -#define HAVE_AVX 1 -#define HAVE_AVX2 1 -#define HAVE_AVX512 1 -#define HAVE_FMA3 1 -#define HAVE_FMA4 1 -#define HAVE_MMX 1 -#define HAVE_MMXEXT 1 -#define HAVE_SSE 1 -#define HAVE_SSE2 1 -#define HAVE_SSE3 1 -#define HAVE_SSE4 1 -#define HAVE_SSE42 1 -#define HAVE_SSSE3 1 -#define HAVE_XOP 1 -#define HAVE_CPUNOP 1 -#define HAVE_I686 1 -#define HAVE_MIPSFPU 0 -#define HAVE_MIPS32R2 0 -#define HAVE_MIPS32R5 0 -#define HAVE_MIPS64R2 0 -#define HAVE_MIPS32R6 0 -#define HAVE_MIPS64R6 0 -#define HAVE_MIPSDSP 0 -#define HAVE_MIPSDSPR2 0 -#define HAVE_MSA 0 -#define HAVE_LOONGSON2 0 -#define HAVE_LOONGSON3 0 -#define HAVE_MMI 0 -#define HAVE_ARMV5TE_EXTERNAL 0 -#define HAVE_ARMV6_EXTERNAL 0 -#define HAVE_ARMV6T2_EXTERNAL 0 -#define HAVE_ARMV8_EXTERNAL 0 -#define HAVE_NEON_EXTERNAL 0 -#define HAVE_VFP_EXTERNAL 0 -#define HAVE_VFPV3_EXTERNAL 0 -#define HAVE_SETEND_EXTERNAL 0 -#define HAVE_ALTIVEC_EXTERNAL 0 -#define HAVE_DCBZL_EXTERNAL 0 -#define HAVE_LDBRX_EXTERNAL 0 -#define HAVE_POWER8_EXTERNAL 0 -#define HAVE_PPC4XX_EXTERNAL 0 -#define HAVE_VSX_EXTERNAL 0 -#define HAVE_AESNI_EXTERNAL 1 -#define HAVE_AMD3DNOW_EXTERNAL 1 -#define HAVE_AMD3DNOWEXT_EXTERNAL 1 -#define HAVE_AVX_EXTERNAL 1 -#define HAVE_AVX2_EXTERNAL 0 -#define HAVE_AVX512_EXTERNAL 0 -#define HAVE_FMA3_EXTERNAL 1 -#define HAVE_FMA4_EXTERNAL 1 -#define HAVE_MMX_EXTERNAL 1 -#define HAVE_MMXEXT_EXTERNAL 1 -#define HAVE_SSE_EXTERNAL 1 -#define HAVE_SSE2_EXTERNAL 1 -#define HAVE_SSE3_EXTERNAL 1 -#define HAVE_SSE4_EXTERNAL 1 -#define HAVE_SSE42_EXTERNAL 1 -#define HAVE_SSSE3_EXTERNAL 1 -#define HAVE_XOP_EXTERNAL 1 -#define HAVE_CPUNOP_EXTERNAL 0 -#define HAVE_I686_EXTERNAL 0 -#define HAVE_MIPSFPU_EXTERNAL 0 -#define HAVE_MIPS32R2_EXTERNAL 0 -#define HAVE_MIPS32R5_EXTERNAL 0 -#define HAVE_MIPS64R2_EXTERNAL 0 -#define HAVE_MIPS32R6_EXTERNAL 0 -#define HAVE_MIPS64R6_EXTERNAL 0 -#define HAVE_MIPSDSP_EXTERNAL 0 -#define HAVE_MIPSDSPR2_EXTERNAL 0 -#define HAVE_MSA_EXTERNAL 0 -#define HAVE_LOONGSON2_EXTERNAL 0 -#define HAVE_LOONGSON3_EXTERNAL 0 -#define HAVE_MMI_EXTERNAL 0 -#define HAVE_ARMV5TE_INLINE 0 -#define HAVE_ARMV6_INLINE 0 -#define HAVE_ARMV6T2_INLINE 0 -#define HAVE_ARMV8_INLINE 0 -#define HAVE_NEON_INLINE 0 -#define HAVE_VFP_INLINE 0 -#define HAVE_VFPV3_INLINE 0 -#define HAVE_SETEND_INLINE 0 -#define HAVE_ALTIVEC_INLINE 0 -#define HAVE_DCBZL_INLINE 0 -#define HAVE_LDBRX_INLINE 0 -#define HAVE_POWER8_INLINE 0 -#define HAVE_PPC4XX_INLINE 0 -#define HAVE_VSX_INLINE 0 -#define HAVE_AESNI_INLINE 0 -#define HAVE_AMD3DNOW_INLINE 0 -#define HAVE_AMD3DNOWEXT_INLINE 0 -#define HAVE_AVX_INLINE 0 -#define HAVE_AVX2_INLINE 0 -#define HAVE_AVX512_INLINE 0 -#define HAVE_FMA3_INLINE 0 -#define HAVE_FMA4_INLINE 0 -#define HAVE_MMX_INLINE 0 -#define HAVE_MMXEXT_INLINE 0 -#define HAVE_SSE_INLINE 0 -#define HAVE_SSE2_INLINE 0 -#define HAVE_SSE3_INLINE 0 -#define HAVE_SSE4_INLINE 0 -#define HAVE_SSE42_INLINE 0 -#define HAVE_SSSE3_INLINE 0 -#define HAVE_XOP_INLINE 0 -#define HAVE_CPUNOP_INLINE 0 -#define HAVE_I686_INLINE 0 -#define HAVE_MIPSFPU_INLINE 0 -#define HAVE_MIPS32R2_INLINE 0 -#define HAVE_MIPS32R5_INLINE 0 -#define HAVE_MIPS64R2_INLINE 0 -#define HAVE_MIPS32R6_INLINE 0 -#define HAVE_MIPS64R6_INLINE 0 -#define HAVE_MIPSDSP_INLINE 0 -#define HAVE_MIPSDSPR2_INLINE 0 -#define HAVE_MSA_INLINE 0 -#define HAVE_LOONGSON2_INLINE 0 -#define HAVE_LOONGSON3_INLINE 0 -#define HAVE_MMI_INLINE 0 -#define HAVE_ALIGNED_STACK 0 -#define HAVE_FAST_64BIT 0 -#define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 -#define HAVE_LOCAL_ALIGNED 1 -#define HAVE_SIMD_ALIGN_16 1 -#define HAVE_SIMD_ALIGN_32 1 -#define HAVE_SIMD_ALIGN_64 1 -#define HAVE_ATOMIC_CAS_PTR 0 -#define HAVE_MACHINE_RW_BARRIER 0 -#define HAVE_MEMORYBARRIER 1 -#define HAVE_MM_EMPTY 1 -#define HAVE_RDTSC 1 -#define HAVE_SEM_TIMEDWAIT 0 -#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0 -#define HAVE_CABS 0 -#define HAVE_CEXP 0 -#define HAVE_INLINE_ASM 0 -#define HAVE_SYMVER 0 -#define HAVE_X86ASM 1 -#define HAVE_BIGENDIAN 0 -#define HAVE_FAST_UNALIGNED 1 -#define HAVE_ARPA_INET_H 0 -#define HAVE_ASM_TYPES_H 0 -#define HAVE_CDIO_PARANOIA_H 0 -#define HAVE_CDIO_PARANOIA_PARANOIA_H 0 -#define HAVE_CUDA_H 0 -#define HAVE_DISPATCH_DISPATCH_H 0 -#define HAVE_DEV_BKTR_IOCTL_BT848_H 0 -#define HAVE_DEV_BKTR_IOCTL_METEOR_H 0 -#define HAVE_DEV_IC_BT8XX_H 0 -#define HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H 0 -#define HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H 0 -#define HAVE_DIRECT_H 1 -#define HAVE_DIRENT_H 0 -#define HAVE_DXGIDEBUG_H 1 -#define HAVE_DXVA_H 1 -#define HAVE_ES2_GL_H 0 -#define HAVE_GSM_H 0 -#define HAVE_IO_H 1 -#define HAVE_LINUX_PERF_EVENT_H 0 -#define HAVE_MACHINE_IOCTL_BT848_H 0 -#define HAVE_MACHINE_IOCTL_METEOR_H 0 -#define HAVE_MALLOC_H 1 -#define HAVE_OPENCV2_CORE_CORE_C_H 0 -#define HAVE_OPENGL_GL3_H 0 -#define HAVE_POLL_H 0 -#define HAVE_SYS_PARAM_H 0 -#define HAVE_SYS_RESOURCE_H 0 -#define HAVE_SYS_SELECT_H 0 -#define HAVE_SYS_SOUNDCARD_H 0 -#define HAVE_SYS_TIME_H 0 -#define HAVE_SYS_UN_H 0 -#define HAVE_SYS_VIDEOIO_H 0 -#define HAVE_TERMIOS_H 0 -#define HAVE_UDPLITE_H 0 -#define HAVE_UNISTD_H 0 -#define HAVE_VALGRIND_VALGRIND_H 0 -#define HAVE_WINDOWS_H 1 -#define HAVE_WINSOCK2_H 0 -#define HAVE_INTRINSICS_NEON 0 -#define HAVE_ATANF 1 -#define HAVE_ATAN2F 1 -#define HAVE_CBRT 1 -#define HAVE_CBRTF 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COSF 1 -#define HAVE_ERF 1 -#define HAVE_EXP2 1 -#define HAVE_EXP2F 1 -#define HAVE_EXPF 1 -#define HAVE_HYPOT 1 -#define HAVE_ISFINITE 1 -#define HAVE_ISINF 1 -#define HAVE_ISNAN 1 -#define HAVE_LDEXPF 1 -#define HAVE_LLRINT 1 -#define HAVE_LLRINTF 1 -#define HAVE_LOG2 1 -#define HAVE_LOG2F 1 -#define HAVE_LOG10F 1 -#define HAVE_LRINT 1 -#define HAVE_LRINTF 1 -#define HAVE_POWF 1 -#define HAVE_RINT 1 -#define HAVE_ROUND 1 -#define HAVE_ROUNDF 1 -#define HAVE_SINF 1 -#define HAVE_TRUNC 1 -#define HAVE_TRUNCF 1 -#define HAVE_DOS_PATHS 1 -#define HAVE_LIBC_MSVCRT 1 -#define HAVE_MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS 0 -#define HAVE_SECTION_DATA_REL_RO 0 -#define HAVE_THREADS 1 -#define HAVE_UWP 0 -#define HAVE_WINRT 0 -#define HAVE_ACCESS 1 -#define HAVE_ALIGNED_MALLOC 1 -#define HAVE_ARC4RANDOM 0 -#define HAVE_CLOCK_GETTIME 0 -#define HAVE_CLOSESOCKET 0 -#define HAVE_COMMANDLINETOARGVW 1 -#define HAVE_FCNTL 0 -#define HAVE_GETADDRINFO 0 -#define HAVE_GETHRTIME 0 -#define HAVE_GETOPT 0 -#define HAVE_GETPROCESSAFFINITYMASK 1 -#define HAVE_GETPROCESSMEMORYINFO 1 -#define HAVE_GETPROCESSTIMES 1 -#define HAVE_GETRUSAGE 0 -#define HAVE_GETSYSTEMTIMEASFILETIME 1 -#define HAVE_GETTIMEOFDAY 0 -#define HAVE_GLOB 0 -#define HAVE_GLXGETPROCADDRESS 0 -#define HAVE_GMTIME_R 0 -#define HAVE_INET_ATON 0 -#define HAVE_ISATTY 1 -#define HAVE_KBHIT 1 -#define HAVE_LOCALTIME_R 0 -#define HAVE_LSTAT 0 -#define HAVE_LZO1X_999_COMPRESS 0 -#define HAVE_MACH_ABSOLUTE_TIME 0 -#define HAVE_MAPVIEWOFFILE 1 -#define HAVE_MEMALIGN 0 -#define HAVE_MKSTEMP 0 -#define HAVE_MMAP 0 -#define HAVE_MPROTECT 0 -#define HAVE_NANOSLEEP 0 -#define HAVE_PEEKNAMEDPIPE 1 -#define HAVE_POSIX_MEMALIGN 0 -#define HAVE_PTHREAD_CANCEL 0 -#define HAVE_SCHED_GETAFFINITY 0 -#define HAVE_SECITEMIMPORT 0 -#define HAVE_SETCONSOLETEXTATTRIBUTE 1 -#define HAVE_SETCONSOLECTRLHANDLER 1 -#define HAVE_SETMODE 1 -#define HAVE_SETRLIMIT 0 -#define HAVE_SLEEP 1 -#define HAVE_STRERROR_R 0 -#define HAVE_SYSCONF 0 -#define HAVE_SYSCTL 0 -#define HAVE_USLEEP 0 -#define HAVE_UTGETOSTYPEFROMSTRING 0 -#define HAVE_VIRTUALALLOC 1 -#define HAVE_WGLGETPROCADDRESS 0 -#define HAVE_BCRYPT 1 -#define HAVE_VAAPI_DRM 0 -#define HAVE_VAAPI_X11 0 -#define HAVE_VDPAU_X11 0 -#define HAVE_PTHREADS 0 -#define HAVE_OS2THREADS 0 -#define HAVE_W32THREADS 1 -#define HAVE_AS_ARCH_DIRECTIVE 0 -#define HAVE_AS_DN_DIRECTIVE 0 -#define HAVE_AS_FPU_DIRECTIVE 0 -#define HAVE_AS_FUNC 0 -#define HAVE_AS_OBJECT_ARCH 0 -#define HAVE_ASM_MOD_Q 0 -#define HAVE_BLOCKS_EXTENSION 0 -#define HAVE_EBP_AVAILABLE 0 -#define HAVE_EBX_AVAILABLE 0 -#define HAVE_GNU_AS 0 -#define HAVE_GNU_WINDRES 0 -#define HAVE_IBM_ASM 0 -#define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 0 -#define HAVE_INLINE_ASM_LABELS 0 -#define HAVE_INLINE_ASM_NONLOCAL_LABELS 0 -#define HAVE_PRAGMA_DEPRECATED 1 -#define HAVE_RSYNC_CONTIMEOUT 0 -#define HAVE_SYMVER_ASM_LABEL 0 -#define HAVE_SYMVER_GNU_ASM 0 -#define HAVE_VFP_ARGS 0 -#define HAVE_XFORM_ASM 0 -#define HAVE_XMM_CLOBBERS 0 -#define HAVE_KCMVIDEOCODECTYPE_HEVC 0 -#define HAVE_SOCKLEN_T 0 -#define HAVE_STRUCT_ADDRINFO 0 -#define HAVE_STRUCT_GROUP_SOURCE_REQ 0 -#define HAVE_STRUCT_IP_MREQ_SOURCE 0 -#define HAVE_STRUCT_IPV6_MREQ 0 -#define HAVE_STRUCT_MSGHDR_MSG_FLAGS 0 -#define HAVE_STRUCT_POLLFD 0 -#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 0 -#define HAVE_STRUCT_SCTP_EVENT_SUBSCRIBE 0 -#define HAVE_STRUCT_SOCKADDR_IN6 0 -#define HAVE_STRUCT_SOCKADDR_SA_LEN 0 -#define HAVE_STRUCT_SOCKADDR_STORAGE 0 -#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 0 -#define HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE 0 -#define HAVE_MAKEINFO 1 -#define HAVE_MAKEINFO_HTML 0 -#define HAVE_OPENCL_D3D11 0 -#define HAVE_OPENCL_DRM_ARM 0 -#define HAVE_OPENCL_DRM_BEIGNET 0 -#define HAVE_OPENCL_DXVA2 0 -#define HAVE_OPENCL_VAAPI_BEIGNET 0 -#define HAVE_OPENCL_VAAPI_INTEL_MEDIA 0 -#define HAVE_PERL 1 -#define HAVE_POD2MAN 0 -#define HAVE_TEXI2HTML 0 -#define CONFIG_DOC 0 -#define CONFIG_HTMLPAGES 0 -#define CONFIG_MANPAGES 0 -#define CONFIG_PODPAGES 1 -#define CONFIG_TXTPAGES 1 -#define CONFIG_AVIO_DIR_CMD_EXAMPLE 1 -#define CONFIG_AVIO_READING_EXAMPLE 1 -#define CONFIG_DECODE_AUDIO_EXAMPLE 1 -#define CONFIG_DECODE_VIDEO_EXAMPLE 1 -#define CONFIG_DEMUXING_DECODING_EXAMPLE 1 -#define CONFIG_ENCODE_AUDIO_EXAMPLE 1 -#define CONFIG_ENCODE_VIDEO_EXAMPLE 1 -#define CONFIG_EXTRACT_MVS_EXAMPLE 1 -#define CONFIG_FILTER_AUDIO_EXAMPLE 0 -#define CONFIG_FILTERING_AUDIO_EXAMPLE 0 -#define CONFIG_FILTERING_VIDEO_EXAMPLE 0 -#define CONFIG_HTTP_MULTICLIENT_EXAMPLE 0 -#define CONFIG_HW_DECODE_EXAMPLE 1 -#define CONFIG_METADATA_EXAMPLE 1 -#define CONFIG_MUXING_EXAMPLE 1 -#define CONFIG_QSVDEC_EXAMPLE 0 -#define CONFIG_REMUXING_EXAMPLE 1 -#define CONFIG_RESAMPLING_AUDIO_EXAMPLE 1 -#define CONFIG_SCALING_VIDEO_EXAMPLE 1 -#define CONFIG_TRANSCODE_AAC_EXAMPLE 1 -#define CONFIG_TRANSCODING_EXAMPLE 0 -#define CONFIG_VAAPI_ENCODE_EXAMPLE 0 -#define CONFIG_VAAPI_TRANSCODE_EXAMPLE 0 -#define CONFIG_AVISYNTH 0 -#define CONFIG_FREI0R 0 -#define CONFIG_LIBCDIO 0 -#define CONFIG_LIBDAVS2 0 -#define CONFIG_LIBRUBBERBAND 0 -#define CONFIG_LIBVIDSTAB 0 -#define CONFIG_LIBX264 0 -#define CONFIG_LIBX265 0 -#define CONFIG_LIBXAVS 0 -#define CONFIG_LIBXAVS2 0 -#define CONFIG_LIBXVID 0 -#define CONFIG_DECKLINK 0 -#define CONFIG_LIBNDI_NEWTEK 0 -#define CONFIG_LIBFDK_AAC 0 -#define CONFIG_OPENSSL 0 -#define CONFIG_LIBTLS 0 -#define CONFIG_GMP 0 -#define CONFIG_LIBLENSFUN 0 -#define CONFIG_LIBOPENCORE_AMRNB 0 -#define CONFIG_LIBOPENCORE_AMRWB 0 -#define CONFIG_LIBVMAF 0 -#define CONFIG_LIBVO_AMRWBENC 0 -#define CONFIG_MBEDTLS 0 -#define CONFIG_RKMPP 0 -#define CONFIG_LIBSMBCLIENT 0 -#define CONFIG_CHROMAPRINT 0 -#define CONFIG_GCRYPT 0 -#define CONFIG_GNUTLS 0 -#define CONFIG_JNI 0 -#define CONFIG_LADSPA 0 -#define CONFIG_LIBAOM 0 -#define CONFIG_LIBASS 0 -#define CONFIG_LIBBLURAY 0 -#define CONFIG_LIBBS2B 0 -#define CONFIG_LIBCACA 0 -#define CONFIG_LIBCELT 0 -#define CONFIG_LIBCODEC2 0 -#define CONFIG_LIBDAV1D 0 -#define CONFIG_LIBDC1394 0 -#define CONFIG_LIBDRM 0 -#define CONFIG_LIBFLITE 0 -#define CONFIG_LIBFONTCONFIG 0 -#define CONFIG_LIBFREETYPE 0 -#define CONFIG_LIBFRIBIDI 0 -#define CONFIG_LIBGME 0 -#define CONFIG_LIBGSM 0 -#define CONFIG_LIBIEC61883 0 -#define CONFIG_LIBILBC 0 -#define CONFIG_LIBJACK 0 -#define CONFIG_LIBKLVANC 0 -#define CONFIG_LIBKVAZAAR 0 -#define CONFIG_LIBMODPLUG 0 -#define CONFIG_LIBMP3LAME 0 -#define CONFIG_LIBMYSOFA 0 -#define CONFIG_LIBOPENCV 0 -#define CONFIG_LIBOPENH264 0 -#define CONFIG_LIBOPENJPEG 0 -#define CONFIG_LIBOPENMPT 0 -#define CONFIG_LIBOPUS 0 -#define CONFIG_LIBPULSE 0 -#define CONFIG_LIBRSVG 0 -#define CONFIG_LIBRTMP 0 -#define CONFIG_LIBSHINE 0 -#define CONFIG_LIBSMBCLIENT 0 -#define CONFIG_LIBSNAPPY 0 -#define CONFIG_LIBSOXR 0 -#define CONFIG_LIBSPEEX 0 -#define CONFIG_LIBSRT 0 -#define CONFIG_LIBSSH 0 -#define CONFIG_LIBTENSORFLOW 0 -#define CONFIG_LIBTESSERACT 0 -#define CONFIG_LIBTHEORA 0 -#define CONFIG_LIBTWOLAME 0 -#define CONFIG_LIBV4L2 0 -#define CONFIG_LIBVORBIS 0 -#define CONFIG_LIBVPX 0 -#define CONFIG_LIBWAVPACK 0 -#define CONFIG_LIBWEBP 0 -#define CONFIG_LIBXML2 0 -#define CONFIG_LIBZIMG 0 -#define CONFIG_LIBZMQ 0 -#define CONFIG_LIBZVBI 0 -#define CONFIG_LV2 0 -#define CONFIG_MEDIACODEC 0 -#define CONFIG_OPENAL 0 -#define CONFIG_OPENGL 0 -#define CONFIG_VAPOURSYNTH 0 -#define CONFIG_ALSA 0 -#define CONFIG_APPKIT 0 -#define CONFIG_AVFOUNDATION 0 -#define CONFIG_BZLIB 0 -#define CONFIG_COREIMAGE 0 -#define CONFIG_ICONV 0 -#define CONFIG_LIBXCB 0 -#define CONFIG_LIBXCB_SHM 0 -#define CONFIG_LIBXCB_SHAPE 0 -#define CONFIG_LIBXCB_XFIXES 0 -#define CONFIG_LZMA 0 -#define CONFIG_SCHANNEL 1 -#define CONFIG_SDL2 0 -#define CONFIG_SECURETRANSPORT 0 -#define CONFIG_SNDIO 0 -#define CONFIG_XLIB 0 -#define CONFIG_ZLIB 1 -#define CONFIG_CUDA_SDK 0 -#define CONFIG_LIBNPP 0 -#define CONFIG_LIBMFX 0 -#define CONFIG_MMAL 0 -#define CONFIG_OMX 0 -#define CONFIG_OPENCL 0 -#define CONFIG_AMF 0 -#define CONFIG_AUDIOTOOLBOX 0 -#define CONFIG_CRYSTALHD 0 -#define CONFIG_CUDA 0 -#define CONFIG_CUVID 0 -#define CONFIG_D3D11VA 0 -#define CONFIG_DXVA2 0 -#define CONFIG_FFNVCODEC 0 -#define CONFIG_NVDEC 0 -#define CONFIG_NVENC 0 -#define CONFIG_VAAPI 0 -#define CONFIG_VDPAU 0 -#define CONFIG_VIDEOTOOLBOX 0 -#define CONFIG_V4L2_M2M 0 -#define CONFIG_XVMC 0 -#define CONFIG_FTRAPV 0 -#define CONFIG_GRAY 0 -#define CONFIG_HARDCODED_TABLES 0 -#define CONFIG_OMX_RPI 0 -#define CONFIG_RUNTIME_CPUDETECT 1 -#define CONFIG_SAFE_BITSTREAM_READER 1 -#define CONFIG_SHARED 0 -#define CONFIG_SMALL 1 -#define CONFIG_STATIC 1 -#define CONFIG_SWSCALE_ALPHA 1 -#define CONFIG_GPL 1 -#define CONFIG_NONFREE 0 -#define CONFIG_VERSION3 0 -#define CONFIG_AVDEVICE 1 -#define CONFIG_AVFILTER 0 -#define CONFIG_SWSCALE 1 -#define CONFIG_POSTPROC 0 -#define CONFIG_AVFORMAT 1 -#define CONFIG_AVCODEC 1 -#define CONFIG_SWRESAMPLE 1 -#define CONFIG_AVRESAMPLE 0 -#define CONFIG_AVUTIL 1 -#define CONFIG_FFPLAY 0 -#define CONFIG_FFPROBE 0 -#define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 -#define CONFIG_DWT 1 -#define CONFIG_ERROR_RESILIENCE 1 -#define CONFIG_FAAN 1 -#define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 -#define CONFIG_LSP 1 -#define CONFIG_LZO 1 -#define CONFIG_MDCT 1 -#define CONFIG_PIXELUTILS 0 -#define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 -#define CONFIG_AUTODETECT 0 -#define CONFIG_FONTCONFIG 0 -#define CONFIG_LINUX_PERF 0 -#define CONFIG_MEMORY_POISONING 0 -#define CONFIG_NEON_CLOBBER_TEST 0 -#define CONFIG_OSSFUZZ 0 -#define CONFIG_PIC 0 -#define CONFIG_THUMB 0 -#define CONFIG_VALGRIND_BACKTRACE 0 -#define CONFIG_XMM_CLOBBER_TEST 0 -#define CONFIG_BSFS 1 -#define CONFIG_DECODERS 1 -#define CONFIG_ENCODERS 0 -#define CONFIG_HWACCELS 0 -#define CONFIG_PARSERS 1 -#define CONFIG_INDEVS 0 -#define CONFIG_OUTDEVS 0 -#define CONFIG_FILTERS 0 -#define CONFIG_DEMUXERS 1 -#define CONFIG_MUXERS 0 -#define CONFIG_PROTOCOLS 1 -#define CONFIG_AANDCTTABLES 1 -#define CONFIG_AC3DSP 1 -#define CONFIG_ADTS_HEADER 1 -#define CONFIG_AUDIO_FRAME_QUEUE 1 -#define CONFIG_AUDIODSP 1 -#define CONFIG_BLOCKDSP 1 -#define CONFIG_BSWAPDSP 1 -#define CONFIG_CABAC 1 -#define CONFIG_CBS 1 -#define CONFIG_CBS_AV1 1 -#define CONFIG_CBS_H264 1 -#define CONFIG_CBS_H265 1 -#define CONFIG_CBS_JPEG 0 -#define CONFIG_CBS_MPEG2 1 -#define CONFIG_CBS_VP9 1 -#define CONFIG_DIRAC_PARSE 1 -#define CONFIG_DNN 0 -#define CONFIG_DVPROFILE 1 -#define CONFIG_EXIF 1 -#define CONFIG_FAANDCT 1 -#define CONFIG_FAANIDCT 1 -#define CONFIG_FDCTDSP 1 -#define CONFIG_FLACDSP 1 -#define CONFIG_FMTCONVERT 1 -#define CONFIG_FRAME_THREAD_ENCODER 0 -#define CONFIG_G722DSP 1 -#define CONFIG_GOLOMB 1 -#define CONFIG_GPLV3 0 -#define CONFIG_H263DSP 1 -#define CONFIG_H264CHROMA 1 -#define CONFIG_H264DSP 1 -#define CONFIG_H264PARSE 1 -#define CONFIG_H264PRED 1 -#define CONFIG_H264QPEL 1 -#define CONFIG_HEVCPARSE 1 -#define CONFIG_HPELDSP 1 -#define CONFIG_HUFFMAN 1 -#define CONFIG_HUFFYUVDSP 1 -#define CONFIG_HUFFYUVENCDSP 0 -#define CONFIG_IDCTDSP 1 -#define CONFIG_IIRFILTER 0 -#define CONFIG_MDCT15 1 -#define CONFIG_INTRAX8 1 -#define CONFIG_ISO_MEDIA 1 -#define CONFIG_IVIDSP 0 -#define CONFIG_JPEGTABLES 1 -#define CONFIG_LGPLV3 0 -#define CONFIG_LIBX262 0 -#define CONFIG_LLAUDDSP 1 -#define CONFIG_LLVIDDSP 1 -#define CONFIG_LLVIDENCDSP 0 -#define CONFIG_LPC 0 -#define CONFIG_LZF 1 -#define CONFIG_ME_CMP 1 -#define CONFIG_MPEG_ER 1 -#define CONFIG_MPEGAUDIO 1 -#define CONFIG_MPEGAUDIODSP 1 -#define CONFIG_MPEGAUDIOHEADER 1 -#define CONFIG_MPEGVIDEO 1 -#define CONFIG_MPEGVIDEOENC 1 -#define CONFIG_MSS34DSP 1 -#define CONFIG_PIXBLOCKDSP 1 -#define CONFIG_QPELDSP 1 -#define CONFIG_QSV 0 -#define CONFIG_QSVDEC 0 -#define CONFIG_QSVENC 0 -#define CONFIG_QSVVPP 0 -#define CONFIG_RANGECODER 1 -#define CONFIG_RIFFDEC 1 -#define CONFIG_RIFFENC 0 -#define CONFIG_RTPDEC 0 -#define CONFIG_RTPENC_CHAIN 0 -#define CONFIG_RV34DSP 1 -#define CONFIG_SCENE_SAD 0 -#define CONFIG_SINEWIN 1 -#define CONFIG_SNAPPY 1 -#define CONFIG_SRTP 0 -#define CONFIG_STARTCODE 1 -#define CONFIG_TEXTUREDSP 1 -#define CONFIG_TEXTUREDSPENC 0 -#define CONFIG_TPELDSP 1 -#define CONFIG_VAAPI_1 0 -#define CONFIG_VAAPI_ENCODE 0 -#define CONFIG_VC1DSP 1 -#define CONFIG_VIDEODSP 1 -#define CONFIG_VP3DSP 1 -#define CONFIG_VP56DSP 1 -#define CONFIG_VP8DSP 1 -#define CONFIG_WMA_FREQS 1 -#define CONFIG_WMV2DSP 1 -#define CONFIG_AAC_ADTSTOASC_BSF 1 -#define CONFIG_AV1_METADATA_BSF 1 -#define CONFIG_CHOMP_BSF 1 -#define CONFIG_DUMP_EXTRADATA_BSF 1 -#define CONFIG_DCA_CORE_BSF 1 -#define CONFIG_EAC3_CORE_BSF 1 -#define CONFIG_EXTRACT_EXTRADATA_BSF 1 -#define CONFIG_FILTER_UNITS_BSF 1 -#define CONFIG_H264_METADATA_BSF 1 -#define CONFIG_H264_MP4TOANNEXB_BSF 1 -#define CONFIG_H264_REDUNDANT_PPS_BSF 1 -#define CONFIG_HAPQA_EXTRACT_BSF 1 -#define CONFIG_HEVC_METADATA_BSF 1 -#define CONFIG_HEVC_MP4TOANNEXB_BSF 1 -#define CONFIG_IMX_DUMP_HEADER_BSF 1 -#define CONFIG_MJPEG2JPEG_BSF 1 -#define CONFIG_MJPEGA_DUMP_HEADER_BSF 1 -#define CONFIG_MP3_HEADER_DECOMPRESS_BSF 1 -#define CONFIG_MPEG2_METADATA_BSF 1 -#define CONFIG_MPEG4_UNPACK_BFRAMES_BSF 1 -#define CONFIG_MOV2TEXTSUB_BSF 1 -#define CONFIG_NOISE_BSF 1 -#define CONFIG_NULL_BSF 1 -#define CONFIG_PRORES_METADATA_BSF 1 -#define CONFIG_REMOVE_EXTRADATA_BSF 1 -#define CONFIG_TEXT2MOVSUB_BSF 1 -#define CONFIG_TRACE_HEADERS_BSF 1 -#define CONFIG_VP9_METADATA_BSF 1 -#define CONFIG_VP9_RAW_REORDER_BSF 1 -#define CONFIG_VP9_SUPERFRAME_BSF 1 -#define CONFIG_VP9_SUPERFRAME_SPLIT_BSF 1 -#define CONFIG_AASC_DECODER 1 -#define CONFIG_AIC_DECODER 1 -#define CONFIG_ALIAS_PIX_DECODER 1 -#define CONFIG_AMV_DECODER 1 -#define CONFIG_ANM_DECODER 1 -#define CONFIG_ANSI_DECODER 1 -#define CONFIG_APNG_DECODER 1 -#define CONFIG_ASV1_DECODER 1 -#define CONFIG_ASV2_DECODER 1 -#define CONFIG_AURA_DECODER 1 -#define CONFIG_AURA2_DECODER 1 -#define CONFIG_AVRP_DECODER 1 -#define CONFIG_AVRN_DECODER 1 -#define CONFIG_AVS_DECODER 1 -#define CONFIG_AVUI_DECODER 1 -#define CONFIG_AYUV_DECODER 1 -#define CONFIG_BETHSOFTVID_DECODER 1 -#define CONFIG_BFI_DECODER 1 -#define CONFIG_BINK_DECODER 1 -#define CONFIG_BITPACKED_DECODER 1 -#define CONFIG_BMP_DECODER 1 -#define CONFIG_BMV_VIDEO_DECODER 1 -#define CONFIG_BRENDER_PIX_DECODER 1 -#define CONFIG_C93_DECODER 1 -#define CONFIG_CAVS_DECODER 1 -#define CONFIG_CDGRAPHICS_DECODER 1 -#define CONFIG_CDXL_DECODER 1 -#define CONFIG_CFHD_DECODER 1 -#define CONFIG_CINEPAK_DECODER 1 -#define CONFIG_CLEARVIDEO_DECODER 1 -#define CONFIG_CLJR_DECODER 1 -#define CONFIG_CLLC_DECODER 1 -#define CONFIG_COMFORTNOISE_DECODER 1 -#define CONFIG_CPIA_DECODER 1 -#define CONFIG_CSCD_DECODER 1 -#define CONFIG_CYUV_DECODER 1 -#define CONFIG_DDS_DECODER 1 -#define CONFIG_DFA_DECODER 1 -#define CONFIG_DIRAC_DECODER 1 -#define CONFIG_DNXHD_DECODER 1 -#define CONFIG_DPX_DECODER 1 -#define CONFIG_DSICINVIDEO_DECODER 1 -#define CONFIG_DVAUDIO_DECODER 1 -#define CONFIG_DVVIDEO_DECODER 1 -#define CONFIG_DXA_DECODER 1 -#define CONFIG_DXTORY_DECODER 1 -#define CONFIG_DXV_DECODER 1 -#define CONFIG_EACMV_DECODER 1 -#define CONFIG_EAMAD_DECODER 1 -#define CONFIG_EATGQ_DECODER 1 -#define CONFIG_EATGV_DECODER 1 -#define CONFIG_EATQI_DECODER 1 -#define CONFIG_EIGHTBPS_DECODER 1 -#define CONFIG_EIGHTSVX_EXP_DECODER 1 -#define CONFIG_EIGHTSVX_FIB_DECODER 1 -#define CONFIG_ESCAPE124_DECODER 1 -#define CONFIG_ESCAPE130_DECODER 1 -#define CONFIG_EXR_DECODER 1 -#define CONFIG_FFV1_DECODER 1 -#define CONFIG_FFVHUFF_DECODER 1 -#define CONFIG_FIC_DECODER 1 -#define CONFIG_FITS_DECODER 1 -#define CONFIG_FLASHSV_DECODER 1 -#define CONFIG_FLASHSV2_DECODER 1 -#define CONFIG_FLIC_DECODER 1 -#define CONFIG_FLV_DECODER 1 -#define CONFIG_FMVC_DECODER 1 -#define CONFIG_FOURXM_DECODER 1 -#define CONFIG_FRAPS_DECODER 1 -#define CONFIG_FRWU_DECODER 1 -#define CONFIG_G2M_DECODER 1 -#define CONFIG_GDV_DECODER 1 -#define CONFIG_GIF_DECODER 1 -#define CONFIG_H261_DECODER 1 -#define CONFIG_H263_DECODER 1 -#define CONFIG_H263I_DECODER 1 -#define CONFIG_H263P_DECODER 1 -#define CONFIG_H263_V4L2M2M_DECODER 0 -#define CONFIG_H264_DECODER 1 -#define CONFIG_H264_CRYSTALHD_DECODER 0 -#define CONFIG_H264_V4L2M2M_DECODER 0 -#define CONFIG_H264_MEDIACODEC_DECODER 0 -#define CONFIG_H264_MMAL_DECODER 0 -#define CONFIG_H264_QSV_DECODER 0 -#define CONFIG_H264_RKMPP_DECODER 0 -#define CONFIG_HAP_DECODER 1 -#define CONFIG_HEVC_DECODER 1 -#define CONFIG_HEVC_QSV_DECODER 0 -#define CONFIG_HEVC_RKMPP_DECODER 0 -#define CONFIG_HEVC_V4L2M2M_DECODER 0 -#define CONFIG_HNM4_VIDEO_DECODER 1 -#define CONFIG_HQ_HQA_DECODER 1 -#define CONFIG_HQX_DECODER 1 -#define CONFIG_HUFFYUV_DECODER 1 -#define CONFIG_IDCIN_DECODER 1 -#define CONFIG_IFF_ILBM_DECODER 1 -#define CONFIG_IMM4_DECODER 1 -#define CONFIG_INDEO2_DECODER 0 -#define CONFIG_INDEO3_DECODER 0 -#define CONFIG_INDEO4_DECODER 0 -#define CONFIG_INDEO5_DECODER 0 -#define CONFIG_INTERPLAY_VIDEO_DECODER 1 -#define CONFIG_JPEG2000_DECODER 1 -#define CONFIG_JPEGLS_DECODER 1 -#define CONFIG_JV_DECODER 1 -#define CONFIG_KGV1_DECODER 1 -#define CONFIG_KMVC_DECODER 1 -#define CONFIG_LAGARITH_DECODER 1 -#define CONFIG_LOCO_DECODER 1 -#define CONFIG_M101_DECODER 1 -#define CONFIG_MAGICYUV_DECODER 1 -#define CONFIG_MDEC_DECODER 1 -#define CONFIG_MIMIC_DECODER 1 -#define CONFIG_MJPEG_DECODER 1 -#define CONFIG_MJPEGB_DECODER 1 -#define CONFIG_MMVIDEO_DECODER 1 -#define CONFIG_MOTIONPIXELS_DECODER 1 -#define CONFIG_MPEG1VIDEO_DECODER 1 -#define CONFIG_MPEG2VIDEO_DECODER 1 -#define CONFIG_MPEG4_DECODER 1 -#define CONFIG_MPEG4_CRYSTALHD_DECODER 0 -#define CONFIG_MPEG4_V4L2M2M_DECODER 0 -#define CONFIG_MPEG4_MMAL_DECODER 0 -#define CONFIG_MPEGVIDEO_DECODER 1 -#define CONFIG_MPEG1_V4L2M2M_DECODER 0 -#define CONFIG_MPEG2_MMAL_DECODER 0 -#define CONFIG_MPEG2_CRYSTALHD_DECODER 0 -#define CONFIG_MPEG2_V4L2M2M_DECODER 0 -#define CONFIG_MPEG2_QSV_DECODER 0 -#define CONFIG_MPEG2_MEDIACODEC_DECODER 0 -#define CONFIG_MSA1_DECODER 1 -#define CONFIG_MSCC_DECODER 1 -#define CONFIG_MSMPEG4V1_DECODER 1 -#define CONFIG_MSMPEG4V2_DECODER 1 -#define CONFIG_MSMPEG4V3_DECODER 1 -#define CONFIG_MSMPEG4_CRYSTALHD_DECODER 0 -#define CONFIG_MSRLE_DECODER 1 -#define CONFIG_MSS1_DECODER 1 -#define CONFIG_MSS2_DECODER 1 -#define CONFIG_MSVIDEO1_DECODER 1 -#define CONFIG_MSZH_DECODER 1 -#define CONFIG_MTS2_DECODER 1 -#define CONFIG_MVC1_DECODER 1 -#define CONFIG_MVC2_DECODER 1 -#define CONFIG_MWSC_DECODER 1 -#define CONFIG_MXPEG_DECODER 1 -#define CONFIG_NUV_DECODER 1 -#define CONFIG_PAF_VIDEO_DECODER 1 -#define CONFIG_PAM_DECODER 1 -#define CONFIG_PBM_DECODER 1 -#define CONFIG_PCX_DECODER 1 -#define CONFIG_PGM_DECODER 1 -#define CONFIG_PGMYUV_DECODER 1 -#define CONFIG_PICTOR_DECODER 1 -#define CONFIG_PIXLET_DECODER 1 -#define CONFIG_PNG_DECODER 1 -#define CONFIG_PPM_DECODER 1 -#define CONFIG_PRORES_DECODER 1 -#define CONFIG_PROSUMER_DECODER 1 -#define CONFIG_PSD_DECODER 1 -#define CONFIG_PTX_DECODER 1 -#define CONFIG_QDRAW_DECODER 1 -#define CONFIG_QPEG_DECODER 1 -#define CONFIG_QTRLE_DECODER 1 -#define CONFIG_R10K_DECODER 1 -#define CONFIG_R210_DECODER 1 -#define CONFIG_RASC_DECODER 1 -#define CONFIG_RAWVIDEO_DECODER 1 -#define CONFIG_RL2_DECODER 1 -#define CONFIG_ROQ_DECODER 1 -#define CONFIG_RPZA_DECODER 1 -#define CONFIG_RSCC_DECODER 1 -#define CONFIG_RV10_DECODER 1 -#define CONFIG_RV20_DECODER 1 -#define CONFIG_RV30_DECODER 1 -#define CONFIG_RV40_DECODER 1 -#define CONFIG_S302M_DECODER 1 -#define CONFIG_SANM_DECODER 1 -#define CONFIG_SCPR_DECODER 1 -#define CONFIG_SCREENPRESSO_DECODER 1 -#define CONFIG_SDX2_DPCM_DECODER 1 -#define CONFIG_SGI_DECODER 1 -#define CONFIG_SGIRLE_DECODER 1 -#define CONFIG_SHEERVIDEO_DECODER 1 -#define CONFIG_SMACKER_DECODER 1 -#define CONFIG_SMC_DECODER 1 -#define CONFIG_SMVJPEG_DECODER 1 -#define CONFIG_SNOW_DECODER 1 -#define CONFIG_SP5X_DECODER 1 -#define CONFIG_SPEEDHQ_DECODER 1 -#define CONFIG_SRGC_DECODER 1 -#define CONFIG_SUNRAST_DECODER 1 -#define CONFIG_SVQ1_DECODER 1 -#define CONFIG_SVQ3_DECODER 1 -#define CONFIG_TARGA_DECODER 1 -#define CONFIG_TARGA_Y216_DECODER 1 -#define CONFIG_TDSC_DECODER 1 -#define CONFIG_THEORA_DECODER 1 -#define CONFIG_THP_DECODER 1 -#define CONFIG_TIERTEXSEQVIDEO_DECODER 1 -#define CONFIG_TIFF_DECODER 1 -#define CONFIG_TMV_DECODER 1 -#define CONFIG_TRUEMOTION1_DECODER 1 -#define CONFIG_TRUEMOTION2_DECODER 1 -#define CONFIG_TRUEMOTION2RT_DECODER 1 -#define CONFIG_TSCC_DECODER 1 -#define CONFIG_TSCC2_DECODER 1 -#define CONFIG_TXD_DECODER 1 -#define CONFIG_ULTI_DECODER 1 -#define CONFIG_UTVIDEO_DECODER 1 -#define CONFIG_V210_DECODER 1 -#define CONFIG_V210X_DECODER 1 -#define CONFIG_V308_DECODER 1 -#define CONFIG_V408_DECODER 1 -#define CONFIG_V410_DECODER 1 -#define CONFIG_VB_DECODER 1 -#define CONFIG_VBLE_DECODER 1 -#define CONFIG_VC1_DECODER 1 -#define CONFIG_VC1_CRYSTALHD_DECODER 0 -#define CONFIG_VC1IMAGE_DECODER 1 -#define CONFIG_VC1_MMAL_DECODER 0 -#define CONFIG_VC1_QSV_DECODER 0 -#define CONFIG_VC1_V4L2M2M_DECODER 0 -#define CONFIG_VCR1_DECODER 1 -#define CONFIG_VMDVIDEO_DECODER 1 -#define CONFIG_VMNC_DECODER 1 -#define CONFIG_VP3_DECODER 1 -#define CONFIG_VP5_DECODER 1 -#define CONFIG_VP6_DECODER 1 -#define CONFIG_VP6A_DECODER 1 -#define CONFIG_VP6F_DECODER 1 -#define CONFIG_VP7_DECODER 1 -#define CONFIG_VP8_DECODER 1 -#define CONFIG_VP8_RKMPP_DECODER 0 -#define CONFIG_VP8_V4L2M2M_DECODER 0 -#define CONFIG_VP9_DECODER 1 -#define CONFIG_VP9_RKMPP_DECODER 0 -#define CONFIG_VP9_V4L2M2M_DECODER 0 -#define CONFIG_VQA_DECODER 1 -#define CONFIG_WEBP_DECODER 1 -#define CONFIG_WCMV_DECODER 1 -#define CONFIG_WRAPPED_AVFRAME_DECODER 1 -#define CONFIG_WMV1_DECODER 1 -#define CONFIG_WMV2_DECODER 1 -#define CONFIG_WMV3_DECODER 1 -#define CONFIG_WMV3_CRYSTALHD_DECODER 0 -#define CONFIG_WMV3IMAGE_DECODER 1 -#define CONFIG_WNV1_DECODER 1 -#define CONFIG_XAN_WC3_DECODER 1 -#define CONFIG_XAN_WC4_DECODER 1 -#define CONFIG_XBM_DECODER 1 -#define CONFIG_XFACE_DECODER 1 -#define CONFIG_XL_DECODER 1 -#define CONFIG_XPM_DECODER 1 -#define CONFIG_XWD_DECODER 1 -#define CONFIG_Y41P_DECODER 1 -#define CONFIG_YLC_DECODER 1 -#define CONFIG_YOP_DECODER 1 -#define CONFIG_YUV4_DECODER 1 -#define CONFIG_ZERO12V_DECODER 1 -#define CONFIG_ZEROCODEC_DECODER 1 -#define CONFIG_ZLIB_DECODER 1 -#define CONFIG_ZMBV_DECODER 1 -#define CONFIG_AAC_DECODER 1 -#define CONFIG_AAC_FIXED_DECODER 1 -#define CONFIG_AAC_LATM_DECODER 1 -#define CONFIG_AC3_DECODER 1 -#define CONFIG_AC3_FIXED_DECODER 1 -#define CONFIG_ALAC_DECODER 1 -#define CONFIG_ALS_DECODER 1 -#define CONFIG_AMRNB_DECODER 1 -#define CONFIG_AMRWB_DECODER 1 -#define CONFIG_APE_DECODER 1 -#define CONFIG_APTX_DECODER 1 -#define CONFIG_APTX_HD_DECODER 1 -#define CONFIG_ATRAC1_DECODER 1 -#define CONFIG_ATRAC3_DECODER 1 -#define CONFIG_ATRAC3AL_DECODER 1 -#define CONFIG_ATRAC3P_DECODER 0 -#define CONFIG_ATRAC3PAL_DECODER 1 -#define CONFIG_ATRAC9_DECODER 1 -#define CONFIG_BINKAUDIO_DCT_DECODER 1 -#define CONFIG_BINKAUDIO_RDFT_DECODER 1 -#define CONFIG_BMV_AUDIO_DECODER 1 -#define CONFIG_COOK_DECODER 1 -#define CONFIG_DCA_DECODER 1 -#define CONFIG_DOLBY_E_DECODER 1 -#define CONFIG_DSD_LSBF_DECODER 1 -#define CONFIG_DSD_MSBF_DECODER 1 -#define CONFIG_DSD_LSBF_PLANAR_DECODER 1 -#define CONFIG_DSD_MSBF_PLANAR_DECODER 1 -#define CONFIG_DSICINAUDIO_DECODER 1 -#define CONFIG_DSS_SP_DECODER 1 -#define CONFIG_DST_DECODER 1 -#define CONFIG_EAC3_DECODER 1 -#define CONFIG_EVRC_DECODER 1 -#define CONFIG_FFWAVESYNTH_DECODER 1 -#define CONFIG_FLAC_DECODER 1 -#define CONFIG_G723_1_DECODER 1 -#define CONFIG_G729_DECODER 1 -#define CONFIG_GSM_DECODER 1 -#define CONFIG_GSM_MS_DECODER 1 -#define CONFIG_IAC_DECODER 1 -#define CONFIG_ILBC_DECODER 1 -#define CONFIG_IMC_DECODER 1 -#define CONFIG_INTERPLAY_ACM_DECODER 1 -#define CONFIG_MACE3_DECODER 1 -#define CONFIG_MACE6_DECODER 1 -#define CONFIG_METASOUND_DECODER 1 -#define CONFIG_MLP_DECODER 1 -#define CONFIG_MP1_DECODER 1 -#define CONFIG_MP1FLOAT_DECODER 1 -#define CONFIG_MP2_DECODER 1 -#define CONFIG_MP2FLOAT_DECODER 1 -#define CONFIG_MP3FLOAT_DECODER 1 -#define CONFIG_MP3_DECODER 1 -#define CONFIG_MP3ADUFLOAT_DECODER 1 -#define CONFIG_MP3ADU_DECODER 1 -#define CONFIG_MP3ON4FLOAT_DECODER 1 -#define CONFIG_MP3ON4_DECODER 1 -#define CONFIG_MPC7_DECODER 1 -#define CONFIG_MPC8_DECODER 1 -#define CONFIG_NELLYMOSER_DECODER 1 -#define CONFIG_ON2AVC_DECODER 1 -#define CONFIG_OPUS_DECODER 1 -#define CONFIG_PAF_AUDIO_DECODER 1 -#define CONFIG_QCELP_DECODER 1 -#define CONFIG_QDM2_DECODER 1 -#define CONFIG_QDMC_DECODER 1 -#define CONFIG_RA_144_DECODER 1 -#define CONFIG_RA_288_DECODER 1 -#define CONFIG_RALF_DECODER 1 -#define CONFIG_SBC_DECODER 1 -#define CONFIG_SHORTEN_DECODER 1 -#define CONFIG_SIPR_DECODER 1 -#define CONFIG_SMACKAUD_DECODER 1 -#define CONFIG_SONIC_DECODER 1 -#define CONFIG_TAK_DECODER 1 -#define CONFIG_TRUEHD_DECODER 1 -#define CONFIG_TRUESPEECH_DECODER 1 -#define CONFIG_TTA_DECODER 1 -#define CONFIG_TWINVQ_DECODER 0 -#define CONFIG_VMDAUDIO_DECODER 1 -#define CONFIG_VORBIS_DECODER 1 -#define CONFIG_WAVPACK_DECODER 1 -#define CONFIG_WMALOSSLESS_DECODER 1 -#define CONFIG_WMAPRO_DECODER 1 -#define CONFIG_WMAV1_DECODER 1 -#define CONFIG_WMAV2_DECODER 1 -#define CONFIG_WMAVOICE_DECODER 1 -#define CONFIG_WS_SND1_DECODER 1 -#define CONFIG_XMA1_DECODER 1 -#define CONFIG_XMA2_DECODER 1 -#define CONFIG_PCM_ALAW_DECODER 1 -#define CONFIG_PCM_BLURAY_DECODER 1 -#define CONFIG_PCM_DVD_DECODER 1 -#define CONFIG_PCM_F16LE_DECODER 1 -#define CONFIG_PCM_F24LE_DECODER 1 -#define CONFIG_PCM_F32BE_DECODER 1 -#define CONFIG_PCM_F32LE_DECODER 1 -#define CONFIG_PCM_F64BE_DECODER 1 -#define CONFIG_PCM_F64LE_DECODER 1 -#define CONFIG_PCM_LXF_DECODER 1 -#define CONFIG_PCM_MULAW_DECODER 1 -#define CONFIG_PCM_S8_DECODER 1 -#define CONFIG_PCM_S8_PLANAR_DECODER 1 -#define CONFIG_PCM_S16BE_DECODER 1 -#define CONFIG_PCM_S16BE_PLANAR_DECODER 1 -#define CONFIG_PCM_S16LE_DECODER 1 -#define CONFIG_PCM_S16LE_PLANAR_DECODER 1 -#define CONFIG_PCM_S24BE_DECODER 1 -#define CONFIG_PCM_S24DAUD_DECODER 1 -#define CONFIG_PCM_S24LE_DECODER 1 -#define CONFIG_PCM_S24LE_PLANAR_DECODER 1 -#define CONFIG_PCM_S32BE_DECODER 1 -#define CONFIG_PCM_S32LE_DECODER 1 -#define CONFIG_PCM_S32LE_PLANAR_DECODER 1 -#define CONFIG_PCM_S64BE_DECODER 1 -#define CONFIG_PCM_S64LE_DECODER 1 -#define CONFIG_PCM_U8_DECODER 1 -#define CONFIG_PCM_U16BE_DECODER 1 -#define CONFIG_PCM_U16LE_DECODER 1 -#define CONFIG_PCM_U24BE_DECODER 1 -#define CONFIG_PCM_U24LE_DECODER 1 -#define CONFIG_PCM_U32BE_DECODER 1 -#define CONFIG_PCM_U32LE_DECODER 1 -#define CONFIG_PCM_VIDC_DECODER 1 -#define CONFIG_PCM_ZORK_DECODER 1 -#define CONFIG_GREMLIN_DPCM_DECODER 1 -#define CONFIG_INTERPLAY_DPCM_DECODER 1 -#define CONFIG_ROQ_DPCM_DECODER 1 -#define CONFIG_SOL_DPCM_DECODER 1 -#define CONFIG_XAN_DPCM_DECODER 1 -#define CONFIG_ADPCM_4XM_DECODER 1 -#define CONFIG_ADPCM_ADX_DECODER 1 -#define CONFIG_ADPCM_AFC_DECODER 1 -#define CONFIG_ADPCM_AICA_DECODER 1 -#define CONFIG_ADPCM_CT_DECODER 1 -#define CONFIG_ADPCM_DTK_DECODER 1 -#define CONFIG_ADPCM_EA_DECODER 1 -#define CONFIG_ADPCM_EA_MAXIS_XA_DECODER 1 -#define CONFIG_ADPCM_EA_R1_DECODER 1 -#define CONFIG_ADPCM_EA_R2_DECODER 1 -#define CONFIG_ADPCM_EA_R3_DECODER 1 -#define CONFIG_ADPCM_EA_XAS_DECODER 1 -#define CONFIG_ADPCM_G722_DECODER 1 -#define CONFIG_ADPCM_G726_DECODER 1 -#define CONFIG_ADPCM_G726LE_DECODER 1 -#define CONFIG_ADPCM_IMA_AMV_DECODER 1 -#define CONFIG_ADPCM_IMA_APC_DECODER 1 -#define CONFIG_ADPCM_IMA_DAT4_DECODER 1 -#define CONFIG_ADPCM_IMA_DK3_DECODER 1 -#define CONFIG_ADPCM_IMA_DK4_DECODER 1 -#define CONFIG_ADPCM_IMA_EA_EACS_DECODER 1 -#define CONFIG_ADPCM_IMA_EA_SEAD_DECODER 1 -#define CONFIG_ADPCM_IMA_ISS_DECODER 1 -#define CONFIG_ADPCM_IMA_OKI_DECODER 1 -#define CONFIG_ADPCM_IMA_QT_DECODER 1 -#define CONFIG_ADPCM_IMA_RAD_DECODER 1 -#define CONFIG_ADPCM_IMA_SMJPEG_DECODER 1 -#define CONFIG_ADPCM_IMA_WAV_DECODER 1 -#define CONFIG_ADPCM_IMA_WS_DECODER 1 -#define CONFIG_ADPCM_MS_DECODER 1 -#define CONFIG_ADPCM_MTAF_DECODER 1 -#define CONFIG_ADPCM_PSX_DECODER 1 -#define CONFIG_ADPCM_SBPRO_2_DECODER 1 -#define CONFIG_ADPCM_SBPRO_3_DECODER 1 -#define CONFIG_ADPCM_SBPRO_4_DECODER 1 -#define CONFIG_ADPCM_SWF_DECODER 1 -#define CONFIG_ADPCM_THP_DECODER 1 -#define CONFIG_ADPCM_THP_LE_DECODER 1 -#define CONFIG_ADPCM_VIMA_DECODER 1 -#define CONFIG_ADPCM_XA_DECODER 1 -#define CONFIG_ADPCM_YAMAHA_DECODER 1 -#define CONFIG_SSA_DECODER 1 -#define CONFIG_ASS_DECODER 1 -#define CONFIG_CCAPTION_DECODER 1 -#define CONFIG_DVBSUB_DECODER 1 -#define CONFIG_DVDSUB_DECODER 1 -#define CONFIG_JACOSUB_DECODER 1 -#define CONFIG_MICRODVD_DECODER 1 -#define CONFIG_MOVTEXT_DECODER 1 -#define CONFIG_MPL2_DECODER 1 -#define CONFIG_PGSSUB_DECODER 1 -#define CONFIG_PJS_DECODER 1 -#define CONFIG_REALTEXT_DECODER 1 -#define CONFIG_SAMI_DECODER 1 -#define CONFIG_SRT_DECODER 1 -#define CONFIG_STL_DECODER 1 -#define CONFIG_SUBRIP_DECODER 1 -#define CONFIG_SUBVIEWER_DECODER 1 -#define CONFIG_SUBVIEWER1_DECODER 1 -#define CONFIG_TEXT_DECODER 1 -#define CONFIG_VPLAYER_DECODER 1 -#define CONFIG_WEBVTT_DECODER 1 -#define CONFIG_XSUB_DECODER 1 -#define CONFIG_AAC_AT_DECODER 0 -#define CONFIG_AC3_AT_DECODER 0 -#define CONFIG_ADPCM_IMA_QT_AT_DECODER 0 -#define CONFIG_ALAC_AT_DECODER 0 -#define CONFIG_AMR_NB_AT_DECODER 0 -#define CONFIG_EAC3_AT_DECODER 0 -#define CONFIG_GSM_MS_AT_DECODER 0 -#define CONFIG_ILBC_AT_DECODER 0 -#define CONFIG_MP1_AT_DECODER 0 -#define CONFIG_MP2_AT_DECODER 0 -#define CONFIG_MP3_AT_DECODER 0 -#define CONFIG_PCM_ALAW_AT_DECODER 0 -#define CONFIG_PCM_MULAW_AT_DECODER 0 -#define CONFIG_QDMC_AT_DECODER 0 -#define CONFIG_QDM2_AT_DECODER 0 -#define CONFIG_LIBAOM_AV1_DECODER 0 -#define CONFIG_LIBCELT_DECODER 0 -#define CONFIG_LIBCODEC2_DECODER 0 -#define CONFIG_LIBDAV1D_DECODER 0 -#define CONFIG_LIBDAVS2_DECODER 0 -#define CONFIG_LIBFDK_AAC_DECODER 0 -#define CONFIG_LIBGSM_DECODER 0 -#define CONFIG_LIBGSM_MS_DECODER 0 -#define CONFIG_LIBILBC_DECODER 0 -#define CONFIG_LIBOPENCORE_AMRNB_DECODER 0 -#define CONFIG_LIBOPENCORE_AMRWB_DECODER 0 -#define CONFIG_LIBOPENJPEG_DECODER 0 -#define CONFIG_LIBOPUS_DECODER 0 -#define CONFIG_LIBRSVG_DECODER 0 -#define CONFIG_LIBSPEEX_DECODER 0 -#define CONFIG_LIBVORBIS_DECODER 0 -#define CONFIG_LIBVPX_VP8_DECODER 0 -#define CONFIG_LIBVPX_VP9_DECODER 0 -#define CONFIG_LIBZVBI_TELETEXT_DECODER 0 -#define CONFIG_BINTEXT_DECODER 1 -#define CONFIG_XBIN_DECODER 1 -#define CONFIG_IDF_DECODER 1 -#define CONFIG_LIBOPENH264_DECODER 0 -#define CONFIG_H264_CUVID_DECODER 0 -#define CONFIG_HEVC_CUVID_DECODER 0 -#define CONFIG_HEVC_MEDIACODEC_DECODER 0 -#define CONFIG_MJPEG_CUVID_DECODER 0 -#define CONFIG_MPEG1_CUVID_DECODER 0 -#define CONFIG_MPEG2_CUVID_DECODER 0 -#define CONFIG_MPEG4_CUVID_DECODER 0 -#define CONFIG_MPEG4_MEDIACODEC_DECODER 0 -#define CONFIG_VC1_CUVID_DECODER 0 -#define CONFIG_VP8_CUVID_DECODER 0 -#define CONFIG_VP8_MEDIACODEC_DECODER 0 -#define CONFIG_VP8_QSV_DECODER 0 -#define CONFIG_VP9_CUVID_DECODER 0 -#define CONFIG_VP9_MEDIACODEC_DECODER 0 -#define CONFIG_A64MULTI_ENCODER 0 -#define CONFIG_A64MULTI5_ENCODER 0 -#define CONFIG_ALIAS_PIX_ENCODER 0 -#define CONFIG_AMV_ENCODER 0 -#define CONFIG_APNG_ENCODER 0 -#define CONFIG_ASV1_ENCODER 0 -#define CONFIG_ASV2_ENCODER 0 -#define CONFIG_AVRP_ENCODER 0 -#define CONFIG_AVUI_ENCODER 0 -#define CONFIG_AYUV_ENCODER 0 -#define CONFIG_BMP_ENCODER 0 -#define CONFIG_CINEPAK_ENCODER 0 -#define CONFIG_CLJR_ENCODER 0 -#define CONFIG_COMFORTNOISE_ENCODER 0 -#define CONFIG_DNXHD_ENCODER 0 -#define CONFIG_DPX_ENCODER 0 -#define CONFIG_DVVIDEO_ENCODER 0 -#define CONFIG_FFV1_ENCODER 0 -#define CONFIG_FFVHUFF_ENCODER 0 -#define CONFIG_FITS_ENCODER 0 -#define CONFIG_FLASHSV_ENCODER 0 -#define CONFIG_FLASHSV2_ENCODER 0 -#define CONFIG_FLV_ENCODER 0 -#define CONFIG_GIF_ENCODER 0 -#define CONFIG_H261_ENCODER 0 -#define CONFIG_H263_ENCODER 0 -#define CONFIG_H263P_ENCODER 0 -#define CONFIG_HAP_ENCODER 0 -#define CONFIG_HUFFYUV_ENCODER 0 -#define CONFIG_JPEG2000_ENCODER 0 -#define CONFIG_JPEGLS_ENCODER 0 -#define CONFIG_LJPEG_ENCODER 0 -#define CONFIG_MAGICYUV_ENCODER 0 -#define CONFIG_MJPEG_ENCODER 0 -#define CONFIG_MPEG1VIDEO_ENCODER 0 -#define CONFIG_MPEG2VIDEO_ENCODER 0 -#define CONFIG_MPEG4_ENCODER 0 -#define CONFIG_MSMPEG4V2_ENCODER 0 -#define CONFIG_MSMPEG4V3_ENCODER 0 -#define CONFIG_MSVIDEO1_ENCODER 0 -#define CONFIG_PAM_ENCODER 0 -#define CONFIG_PBM_ENCODER 0 -#define CONFIG_PCX_ENCODER 0 -#define CONFIG_PGM_ENCODER 0 -#define CONFIG_PGMYUV_ENCODER 0 -#define CONFIG_PNG_ENCODER 0 -#define CONFIG_PPM_ENCODER 0 -#define CONFIG_PRORES_ENCODER 0 -#define CONFIG_PRORES_AW_ENCODER 0 -#define CONFIG_PRORES_KS_ENCODER 0 -#define CONFIG_QTRLE_ENCODER 0 -#define CONFIG_R10K_ENCODER 0 -#define CONFIG_R210_ENCODER 0 -#define CONFIG_RAWVIDEO_ENCODER 0 -#define CONFIG_ROQ_ENCODER 0 -#define CONFIG_RV10_ENCODER 0 -#define CONFIG_RV20_ENCODER 0 -#define CONFIG_S302M_ENCODER 0 -#define CONFIG_SGI_ENCODER 0 -#define CONFIG_SNOW_ENCODER 0 -#define CONFIG_SUNRAST_ENCODER 0 -#define CONFIG_SVQ1_ENCODER 0 -#define CONFIG_TARGA_ENCODER 0 -#define CONFIG_TIFF_ENCODER 0 -#define CONFIG_UTVIDEO_ENCODER 0 -#define CONFIG_V210_ENCODER 0 -#define CONFIG_V308_ENCODER 0 -#define CONFIG_V408_ENCODER 0 -#define CONFIG_V410_ENCODER 0 -#define CONFIG_VC2_ENCODER 0 -#define CONFIG_WRAPPED_AVFRAME_ENCODER 0 -#define CONFIG_WMV1_ENCODER 0 -#define CONFIG_WMV2_ENCODER 0 -#define CONFIG_XBM_ENCODER 0 -#define CONFIG_XFACE_ENCODER 0 -#define CONFIG_XWD_ENCODER 0 -#define CONFIG_Y41P_ENCODER 0 -#define CONFIG_YUV4_ENCODER 0 -#define CONFIG_ZLIB_ENCODER 0 -#define CONFIG_ZMBV_ENCODER 0 -#define CONFIG_AAC_ENCODER 0 -#define CONFIG_AC3_ENCODER 0 -#define CONFIG_AC3_FIXED_ENCODER 0 -#define CONFIG_ALAC_ENCODER 0 -#define CONFIG_APTX_ENCODER 0 -#define CONFIG_APTX_HD_ENCODER 0 -#define CONFIG_DCA_ENCODER 0 -#define CONFIG_EAC3_ENCODER 0 -#define CONFIG_FLAC_ENCODER 0 -#define CONFIG_G723_1_ENCODER 0 -#define CONFIG_MLP_ENCODER 0 -#define CONFIG_MP2_ENCODER 0 -#define CONFIG_MP2FIXED_ENCODER 0 -#define CONFIG_NELLYMOSER_ENCODER 0 -#define CONFIG_OPUS_ENCODER 0 -#define CONFIG_RA_144_ENCODER 0 -#define CONFIG_SBC_ENCODER 0 -#define CONFIG_SONIC_ENCODER 0 -#define CONFIG_SONIC_LS_ENCODER 0 -#define CONFIG_TRUEHD_ENCODER 0 -#define CONFIG_TTA_ENCODER 0 -#define CONFIG_VORBIS_ENCODER 0 -#define CONFIG_WAVPACK_ENCODER 0 -#define CONFIG_WMAV1_ENCODER 0 -#define CONFIG_WMAV2_ENCODER 0 -#define CONFIG_PCM_ALAW_ENCODER 0 -#define CONFIG_PCM_F32BE_ENCODER 0 -#define CONFIG_PCM_F32LE_ENCODER 0 -#define CONFIG_PCM_F64BE_ENCODER 0 -#define CONFIG_PCM_F64LE_ENCODER 0 -#define CONFIG_PCM_MULAW_ENCODER 0 -#define CONFIG_PCM_S8_ENCODER 0 -#define CONFIG_PCM_S8_PLANAR_ENCODER 0 -#define CONFIG_PCM_S16BE_ENCODER 0 -#define CONFIG_PCM_S16BE_PLANAR_ENCODER 0 -#define CONFIG_PCM_S16LE_ENCODER 0 -#define CONFIG_PCM_S16LE_PLANAR_ENCODER 0 -#define CONFIG_PCM_S24BE_ENCODER 0 -#define CONFIG_PCM_S24DAUD_ENCODER 0 -#define CONFIG_PCM_S24LE_ENCODER 0 -#define CONFIG_PCM_S24LE_PLANAR_ENCODER 0 -#define CONFIG_PCM_S32BE_ENCODER 0 -#define CONFIG_PCM_S32LE_ENCODER 0 -#define CONFIG_PCM_S32LE_PLANAR_ENCODER 0 -#define CONFIG_PCM_S64BE_ENCODER 0 -#define CONFIG_PCM_S64LE_ENCODER 0 -#define CONFIG_PCM_U8_ENCODER 0 -#define CONFIG_PCM_U16BE_ENCODER 0 -#define CONFIG_PCM_U16LE_ENCODER 0 -#define CONFIG_PCM_U24BE_ENCODER 0 -#define CONFIG_PCM_U24LE_ENCODER 0 -#define CONFIG_PCM_U32BE_ENCODER 0 -#define CONFIG_PCM_U32LE_ENCODER 0 -#define CONFIG_PCM_VIDC_ENCODER 0 -#define CONFIG_ROQ_DPCM_ENCODER 0 -#define CONFIG_ADPCM_ADX_ENCODER 0 -#define CONFIG_ADPCM_G722_ENCODER 0 -#define CONFIG_ADPCM_G726_ENCODER 0 -#define CONFIG_ADPCM_G726LE_ENCODER 0 -#define CONFIG_ADPCM_IMA_QT_ENCODER 0 -#define CONFIG_ADPCM_IMA_WAV_ENCODER 0 -#define CONFIG_ADPCM_MS_ENCODER 0 -#define CONFIG_ADPCM_SWF_ENCODER 0 -#define CONFIG_ADPCM_YAMAHA_ENCODER 0 -#define CONFIG_SSA_ENCODER 0 -#define CONFIG_ASS_ENCODER 0 -#define CONFIG_DVBSUB_ENCODER 0 -#define CONFIG_DVDSUB_ENCODER 0 -#define CONFIG_MOVTEXT_ENCODER 0 -#define CONFIG_SRT_ENCODER 0 -#define CONFIG_SUBRIP_ENCODER 0 -#define CONFIG_TEXT_ENCODER 0 -#define CONFIG_WEBVTT_ENCODER 0 -#define CONFIG_XSUB_ENCODER 0 -#define CONFIG_AAC_AT_ENCODER 0 -#define CONFIG_ALAC_AT_ENCODER 0 -#define CONFIG_ILBC_AT_ENCODER 0 -#define CONFIG_PCM_ALAW_AT_ENCODER 0 -#define CONFIG_PCM_MULAW_AT_ENCODER 0 -#define CONFIG_LIBAOM_AV1_ENCODER 0 -#define CONFIG_LIBCODEC2_ENCODER 0 -#define CONFIG_LIBFDK_AAC_ENCODER 0 -#define CONFIG_LIBGSM_ENCODER 0 -#define CONFIG_LIBGSM_MS_ENCODER 0 -#define CONFIG_LIBILBC_ENCODER 0 -#define CONFIG_LIBMP3LAME_ENCODER 0 -#define CONFIG_LIBOPENCORE_AMRNB_ENCODER 0 -#define CONFIG_LIBOPENJPEG_ENCODER 0 -#define CONFIG_LIBOPUS_ENCODER 0 -#define CONFIG_LIBSHINE_ENCODER 0 -#define CONFIG_LIBSPEEX_ENCODER 0 -#define CONFIG_LIBTHEORA_ENCODER 0 -#define CONFIG_LIBTWOLAME_ENCODER 0 -#define CONFIG_LIBVO_AMRWBENC_ENCODER 0 -#define CONFIG_LIBVORBIS_ENCODER 0 -#define CONFIG_LIBVPX_VP8_ENCODER 0 -#define CONFIG_LIBVPX_VP9_ENCODER 0 -#define CONFIG_LIBWAVPACK_ENCODER 0 -#define CONFIG_LIBWEBP_ANIM_ENCODER 0 -#define CONFIG_LIBWEBP_ENCODER 0 -#define CONFIG_LIBX262_ENCODER 0 -#define CONFIG_LIBX264_ENCODER 0 -#define CONFIG_LIBX264RGB_ENCODER 0 -#define CONFIG_LIBX265_ENCODER 0 -#define CONFIG_LIBXAVS_ENCODER 0 -#define CONFIG_LIBXAVS2_ENCODER 0 -#define CONFIG_LIBXVID_ENCODER 0 -#define CONFIG_H263_V4L2M2M_ENCODER 0 -#define CONFIG_LIBOPENH264_ENCODER 0 -#define CONFIG_H264_AMF_ENCODER 0 -#define CONFIG_H264_NVENC_ENCODER 0 -#define CONFIG_H264_OMX_ENCODER 0 -#define CONFIG_H264_QSV_ENCODER 0 -#define CONFIG_H264_V4L2M2M_ENCODER 0 -#define CONFIG_H264_VAAPI_ENCODER 0 -#define CONFIG_H264_VIDEOTOOLBOX_ENCODER 0 -#define CONFIG_NVENC_ENCODER 0 -#define CONFIG_NVENC_H264_ENCODER 0 -#define CONFIG_NVENC_HEVC_ENCODER 0 -#define CONFIG_HEVC_AMF_ENCODER 0 -#define CONFIG_HEVC_NVENC_ENCODER 0 -#define CONFIG_HEVC_QSV_ENCODER 0 -#define CONFIG_HEVC_V4L2M2M_ENCODER 0 -#define CONFIG_HEVC_VAAPI_ENCODER 0 -#define CONFIG_HEVC_VIDEOTOOLBOX_ENCODER 0 -#define CONFIG_LIBKVAZAAR_ENCODER 0 -#define CONFIG_MJPEG_QSV_ENCODER 0 -#define CONFIG_MJPEG_VAAPI_ENCODER 0 -#define CONFIG_MPEG2_QSV_ENCODER 0 -#define CONFIG_MPEG2_VAAPI_ENCODER 0 -#define CONFIG_MPEG4_V4L2M2M_ENCODER 0 -#define CONFIG_VP8_V4L2M2M_ENCODER 0 -#define CONFIG_VP8_VAAPI_ENCODER 0 -#define CONFIG_VP9_VAAPI_ENCODER 0 -#define CONFIG_H263_VAAPI_HWACCEL 0 -#define CONFIG_H263_VIDEOTOOLBOX_HWACCEL 0 -#define CONFIG_H264_D3D11VA_HWACCEL 0 -#define CONFIG_H264_D3D11VA2_HWACCEL 0 -#define CONFIG_H264_DXVA2_HWACCEL 0 -#define CONFIG_H264_NVDEC_HWACCEL 0 -#define CONFIG_H264_VAAPI_HWACCEL 0 -#define CONFIG_H264_VDPAU_HWACCEL 0 -#define CONFIG_H264_VIDEOTOOLBOX_HWACCEL 0 -#define CONFIG_HEVC_D3D11VA_HWACCEL 0 -#define CONFIG_HEVC_D3D11VA2_HWACCEL 0 -#define CONFIG_HEVC_DXVA2_HWACCEL 0 -#define CONFIG_HEVC_NVDEC_HWACCEL 0 -#define CONFIG_HEVC_VAAPI_HWACCEL 0 -#define CONFIG_HEVC_VDPAU_HWACCEL 0 -#define CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL 0 -#define CONFIG_MJPEG_NVDEC_HWACCEL 0 -#define CONFIG_MJPEG_VAAPI_HWACCEL 0 -#define CONFIG_MPEG1_NVDEC_HWACCEL 0 -#define CONFIG_MPEG1_VDPAU_HWACCEL 0 -#define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 -#define CONFIG_MPEG1_XVMC_HWACCEL 0 -#define CONFIG_MPEG2_D3D11VA_HWACCEL 0 -#define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 -#define CONFIG_MPEG2_DXVA2_HWACCEL 0 -#define CONFIG_MPEG2_VAAPI_HWACCEL 0 -#define CONFIG_MPEG2_VDPAU_HWACCEL 0 -#define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 -#define CONFIG_MPEG2_XVMC_HWACCEL 0 -#define CONFIG_MPEG4_NVDEC_HWACCEL 0 -#define CONFIG_MPEG4_VAAPI_HWACCEL 0 -#define CONFIG_MPEG4_VDPAU_HWACCEL 0 -#define CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL 0 -#define CONFIG_VC1_D3D11VA_HWACCEL 0 -#define CONFIG_VC1_D3D11VA2_HWACCEL 0 -#define CONFIG_VC1_DXVA2_HWACCEL 0 -#define CONFIG_VC1_NVDEC_HWACCEL 0 -#define CONFIG_VC1_VAAPI_HWACCEL 0 -#define CONFIG_VC1_VDPAU_HWACCEL 0 -#define CONFIG_VP8_NVDEC_HWACCEL 0 -#define CONFIG_VP8_VAAPI_HWACCEL 0 -#define CONFIG_VP9_D3D11VA_HWACCEL 0 -#define CONFIG_VP9_D3D11VA2_HWACCEL 0 -#define CONFIG_VP9_DXVA2_HWACCEL 0 -#define CONFIG_VP9_NVDEC_HWACCEL 0 -#define CONFIG_VP9_VAAPI_HWACCEL 0 -#define CONFIG_WMV3_D3D11VA_HWACCEL 0 -#define CONFIG_WMV3_D3D11VA2_HWACCEL 0 -#define CONFIG_WMV3_DXVA2_HWACCEL 0 -#define CONFIG_WMV3_NVDEC_HWACCEL 0 -#define CONFIG_WMV3_VAAPI_HWACCEL 0 -#define CONFIG_WMV3_VDPAU_HWACCEL 0 -#define CONFIG_AAC_PARSER 1 -#define CONFIG_AAC_LATM_PARSER 1 -#define CONFIG_AC3_PARSER 1 -#define CONFIG_ADX_PARSER 1 -#define CONFIG_AV1_PARSER 1 -#define CONFIG_AVS2_PARSER 1 -#define CONFIG_BMP_PARSER 1 -#define CONFIG_CAVSVIDEO_PARSER 1 -#define CONFIG_COOK_PARSER 1 -#define CONFIG_DCA_PARSER 1 -#define CONFIG_DIRAC_PARSER 1 -#define CONFIG_DNXHD_PARSER 1 -#define CONFIG_DPX_PARSER 1 -#define CONFIG_DVAUDIO_PARSER 1 -#define CONFIG_DVBSUB_PARSER 1 -#define CONFIG_DVDSUB_PARSER 1 -#define CONFIG_DVD_NAV_PARSER 1 -#define CONFIG_FLAC_PARSER 1 -#define CONFIG_G729_PARSER 1 -#define CONFIG_GSM_PARSER 1 -#define CONFIG_H261_PARSER 1 -#define CONFIG_H263_PARSER 1 -#define CONFIG_H264_PARSER 1 -#define CONFIG_HEVC_PARSER 1 -#define CONFIG_MJPEG_PARSER 1 -#define CONFIG_MLP_PARSER 1 -#define CONFIG_MPEG4VIDEO_PARSER 1 -#define CONFIG_MPEGAUDIO_PARSER 1 -#define CONFIG_MPEGVIDEO_PARSER 1 -#define CONFIG_OPUS_PARSER 1 -#define CONFIG_PNG_PARSER 1 -#define CONFIG_PNM_PARSER 1 -#define CONFIG_RV30_PARSER 1 -#define CONFIG_RV40_PARSER 1 -#define CONFIG_SBC_PARSER 1 -#define CONFIG_SIPR_PARSER 1 -#define CONFIG_TAK_PARSER 1 -#define CONFIG_VC1_PARSER 1 -#define CONFIG_VORBIS_PARSER 1 -#define CONFIG_VP3_PARSER 1 -#define CONFIG_VP8_PARSER 1 -#define CONFIG_VP9_PARSER 1 -#define CONFIG_XMA_PARSER 1 -#define CONFIG_ALSA_INDEV 0 -#define CONFIG_ANDROID_CAMERA_INDEV 0 -#define CONFIG_AVFOUNDATION_INDEV 0 -#define CONFIG_BKTR_INDEV 0 -#define CONFIG_DECKLINK_INDEV 0 -#define CONFIG_LIBNDI_NEWTEK_INDEV 0 -#define CONFIG_DSHOW_INDEV 0 -#define CONFIG_FBDEV_INDEV 0 -#define CONFIG_GDIGRAB_INDEV 0 -#define CONFIG_IEC61883_INDEV 0 -#define CONFIG_JACK_INDEV 0 -#define CONFIG_KMSGRAB_INDEV 0 -#define CONFIG_LAVFI_INDEV 0 -#define CONFIG_OPENAL_INDEV 0 -#define CONFIG_OSS_INDEV 0 -#define CONFIG_PULSE_INDEV 0 -#define CONFIG_SNDIO_INDEV 0 -#define CONFIG_V4L2_INDEV 0 -#define CONFIG_VFWCAP_INDEV 0 -#define CONFIG_XCBGRAB_INDEV 0 -#define CONFIG_LIBCDIO_INDEV 0 -#define CONFIG_LIBDC1394_INDEV 0 -#define CONFIG_ALSA_OUTDEV 0 -#define CONFIG_CACA_OUTDEV 0 -#define CONFIG_DECKLINK_OUTDEV 0 -#define CONFIG_LIBNDI_NEWTEK_OUTDEV 0 -#define CONFIG_FBDEV_OUTDEV 0 -#define CONFIG_OPENGL_OUTDEV 0 -#define CONFIG_OSS_OUTDEV 0 -#define CONFIG_PULSE_OUTDEV 0 -#define CONFIG_SDL2_OUTDEV 0 -#define CONFIG_SNDIO_OUTDEV 0 -#define CONFIG_V4L2_OUTDEV 0 -#define CONFIG_XV_OUTDEV 0 -#define CONFIG_ABENCH_FILTER 0 -#define CONFIG_ACOMPRESSOR_FILTER 0 -#define CONFIG_ACONTRAST_FILTER 0 -#define CONFIG_ACOPY_FILTER 0 -#define CONFIG_ACUE_FILTER 0 -#define CONFIG_ACROSSFADE_FILTER 0 -#define CONFIG_ACROSSOVER_FILTER 0 -#define CONFIG_ACRUSHER_FILTER 0 -#define CONFIG_ADECLICK_FILTER 0 -#define CONFIG_ADECLIP_FILTER 0 -#define CONFIG_ADELAY_FILTER 0 -#define CONFIG_ADERIVATIVE_FILTER 0 -#define CONFIG_AECHO_FILTER 0 -#define CONFIG_AEMPHASIS_FILTER 0 -#define CONFIG_AEVAL_FILTER 0 -#define CONFIG_AFADE_FILTER 0 -#define CONFIG_AFFTDN_FILTER 0 -#define CONFIG_AFFTFILT_FILTER 0 -#define CONFIG_AFIR_FILTER 0 -#define CONFIG_AFORMAT_FILTER 0 -#define CONFIG_AGATE_FILTER 0 -#define CONFIG_AIIR_FILTER 0 -#define CONFIG_AINTEGRAL_FILTER 0 -#define CONFIG_AINTERLEAVE_FILTER 0 -#define CONFIG_ALIMITER_FILTER 0 -#define CONFIG_ALLPASS_FILTER 0 -#define CONFIG_ALOOP_FILTER 0 -#define CONFIG_AMERGE_FILTER 0 -#define CONFIG_AMETADATA_FILTER 0 -#define CONFIG_AMIX_FILTER 0 -#define CONFIG_AMULTIPLY_FILTER 0 -#define CONFIG_ANEQUALIZER_FILTER 0 -#define CONFIG_ANULL_FILTER 0 -#define CONFIG_APAD_FILTER 0 -#define CONFIG_APERMS_FILTER 0 -#define CONFIG_APHASER_FILTER 0 -#define CONFIG_APULSATOR_FILTER 0 -#define CONFIG_AREALTIME_FILTER 0 -#define CONFIG_ARESAMPLE_FILTER 0 -#define CONFIG_AREVERSE_FILTER 0 -#define CONFIG_ASELECT_FILTER 0 -#define CONFIG_ASENDCMD_FILTER 0 -#define CONFIG_ASETNSAMPLES_FILTER 0 -#define CONFIG_ASETPTS_FILTER 0 -#define CONFIG_ASETRATE_FILTER 0 -#define CONFIG_ASETTB_FILTER 0 -#define CONFIG_ASHOWINFO_FILTER 0 -#define CONFIG_ASIDEDATA_FILTER 0 -#define CONFIG_ASPLIT_FILTER 0 -#define CONFIG_ASTATS_FILTER 0 -#define CONFIG_ASTREAMSELECT_FILTER 0 -#define CONFIG_ATEMPO_FILTER 0 -#define CONFIG_ATRIM_FILTER 0 -#define CONFIG_AZMQ_FILTER 0 -#define CONFIG_BANDPASS_FILTER 0 -#define CONFIG_BANDREJECT_FILTER 0 -#define CONFIG_BASS_FILTER 0 -#define CONFIG_BIQUAD_FILTER 0 -#define CONFIG_BS2B_FILTER 0 -#define CONFIG_CHANNELMAP_FILTER 0 -#define CONFIG_CHANNELSPLIT_FILTER 0 -#define CONFIG_CHORUS_FILTER 0 -#define CONFIG_COMPAND_FILTER 0 -#define CONFIG_COMPENSATIONDELAY_FILTER 0 -#define CONFIG_CROSSFEED_FILTER 0 -#define CONFIG_CRYSTALIZER_FILTER 0 -#define CONFIG_DCSHIFT_FILTER 0 -#define CONFIG_DRMETER_FILTER 0 -#define CONFIG_DYNAUDNORM_FILTER 0 -#define CONFIG_EARWAX_FILTER 0 -#define CONFIG_EBUR128_FILTER 0 -#define CONFIG_EQUALIZER_FILTER 0 -#define CONFIG_EXTRASTEREO_FILTER 0 -#define CONFIG_FIREQUALIZER_FILTER 0 -#define CONFIG_FLANGER_FILTER 0 -#define CONFIG_HAAS_FILTER 0 -#define CONFIG_HDCD_FILTER 0 -#define CONFIG_HEADPHONE_FILTER 0 -#define CONFIG_HIGHPASS_FILTER 0 -#define CONFIG_HIGHSHELF_FILTER 0 -#define CONFIG_JOIN_FILTER 0 -#define CONFIG_LADSPA_FILTER 0 -#define CONFIG_LOUDNORM_FILTER 0 -#define CONFIG_LOWPASS_FILTER 0 -#define CONFIG_LOWSHELF_FILTER 0 -#define CONFIG_LV2_FILTER 0 -#define CONFIG_MCOMPAND_FILTER 0 -#define CONFIG_PAN_FILTER 0 -#define CONFIG_REPLAYGAIN_FILTER 0 -#define CONFIG_RESAMPLE_FILTER 0 -#define CONFIG_RUBBERBAND_FILTER 0 -#define CONFIG_SIDECHAINCOMPRESS_FILTER 0 -#define CONFIG_SIDECHAINGATE_FILTER 0 -#define CONFIG_SILENCEDETECT_FILTER 0 -#define CONFIG_SILENCEREMOVE_FILTER 0 -#define CONFIG_SOFALIZER_FILTER 0 -#define CONFIG_STEREOTOOLS_FILTER 0 -#define CONFIG_STEREOWIDEN_FILTER 0 -#define CONFIG_SUPEREQUALIZER_FILTER 0 -#define CONFIG_SURROUND_FILTER 0 -#define CONFIG_TREBLE_FILTER 0 -#define CONFIG_TREMOLO_FILTER 0 -#define CONFIG_VIBRATO_FILTER 0 -#define CONFIG_VOLUME_FILTER 0 -#define CONFIG_VOLUMEDETECT_FILTER 0 -#define CONFIG_AEVALSRC_FILTER 0 -#define CONFIG_ANOISESRC_FILTER 0 -#define CONFIG_ANULLSRC_FILTER 0 -#define CONFIG_FLITE_FILTER 0 -#define CONFIG_HILBERT_FILTER 0 -#define CONFIG_SINC_FILTER 0 -#define CONFIG_SINE_FILTER 0 -#define CONFIG_ANULLSINK_FILTER 0 -#define CONFIG_ALPHAEXTRACT_FILTER 0 -#define CONFIG_ALPHAMERGE_FILTER 0 -#define CONFIG_AMPLIFY_FILTER 0 -#define CONFIG_ASS_FILTER 0 -#define CONFIG_ATADENOISE_FILTER 0 -#define CONFIG_AVGBLUR_FILTER 0 -#define CONFIG_AVGBLUR_OPENCL_FILTER 0 -#define CONFIG_BBOX_FILTER 0 -#define CONFIG_BENCH_FILTER 0 -#define CONFIG_BITPLANENOISE_FILTER 0 -#define CONFIG_BLACKDETECT_FILTER 0 -#define CONFIG_BLACKFRAME_FILTER 0 -#define CONFIG_BLEND_FILTER 0 -#define CONFIG_BM3D_FILTER 0 -#define CONFIG_BOXBLUR_FILTER 0 -#define CONFIG_BOXBLUR_OPENCL_FILTER 0 -#define CONFIG_BWDIF_FILTER 0 -#define CONFIG_CHROMAHOLD_FILTER 0 -#define CONFIG_CHROMAKEY_FILTER 0 -#define CONFIG_CHROMASHIFT_FILTER 0 -#define CONFIG_CIESCOPE_FILTER 0 -#define CONFIG_CODECVIEW_FILTER 0 -#define CONFIG_COLORBALANCE_FILTER 0 -#define CONFIG_COLORCHANNELMIXER_FILTER 0 -#define CONFIG_COLORKEY_FILTER 0 -#define CONFIG_COLORLEVELS_FILTER 0 -#define CONFIG_COLORMATRIX_FILTER 0 -#define CONFIG_COLORSPACE_FILTER 0 -#define CONFIG_CONVOLUTION_FILTER 0 -#define CONFIG_CONVOLUTION_OPENCL_FILTER 0 -#define CONFIG_CONVOLVE_FILTER 0 -#define CONFIG_COPY_FILTER 0 -#define CONFIG_COREIMAGE_FILTER 0 -#define CONFIG_COVER_RECT_FILTER 0 -#define CONFIG_CROP_FILTER 0 -#define CONFIG_CROPDETECT_FILTER 0 -#define CONFIG_CUE_FILTER 0 -#define CONFIG_CURVES_FILTER 0 -#define CONFIG_DATASCOPE_FILTER 0 -#define CONFIG_DCTDNOIZ_FILTER 0 -#define CONFIG_DEBAND_FILTER 0 -#define CONFIG_DEBLOCK_FILTER 0 -#define CONFIG_DECIMATE_FILTER 0 -#define CONFIG_DECONVOLVE_FILTER 0 -#define CONFIG_DEDOT_FILTER 0 -#define CONFIG_DEFLATE_FILTER 0 -#define CONFIG_DEFLICKER_FILTER 0 -#define CONFIG_DEINTERLACE_QSV_FILTER 0 -#define CONFIG_DEINTERLACE_VAAPI_FILTER 0 -#define CONFIG_DEJUDDER_FILTER 0 -#define CONFIG_DELOGO_FILTER 0 -#define CONFIG_DENOISE_VAAPI_FILTER 0 -#define CONFIG_DESHAKE_FILTER 0 -#define CONFIG_DESPILL_FILTER 0 -#define CONFIG_DETELECINE_FILTER 0 -#define CONFIG_DILATION_FILTER 0 -#define CONFIG_DILATION_OPENCL_FILTER 0 -#define CONFIG_DISPLACE_FILTER 0 -#define CONFIG_DOUBLEWEAVE_FILTER 0 -#define CONFIG_DRAWBOX_FILTER 0 -#define CONFIG_DRAWGRAPH_FILTER 0 -#define CONFIG_DRAWGRID_FILTER 0 -#define CONFIG_DRAWTEXT_FILTER 0 -#define CONFIG_EDGEDETECT_FILTER 0 -#define CONFIG_ELBG_FILTER 0 -#define CONFIG_ENTROPY_FILTER 0 -#define CONFIG_EQ_FILTER 0 -#define CONFIG_EROSION_FILTER 0 -#define CONFIG_EROSION_OPENCL_FILTER 0 -#define CONFIG_EXTRACTPLANES_FILTER 0 -#define CONFIG_FADE_FILTER 0 -#define CONFIG_FFTDNOIZ_FILTER 0 -#define CONFIG_FFTFILT_FILTER 0 -#define CONFIG_FIELD_FILTER 0 -#define CONFIG_FIELDHINT_FILTER 0 -#define CONFIG_FIELDMATCH_FILTER 0 -#define CONFIG_FIELDORDER_FILTER 0 -#define CONFIG_FILLBORDERS_FILTER 0 -#define CONFIG_FIND_RECT_FILTER 0 -#define CONFIG_FLOODFILL_FILTER 0 -#define CONFIG_FORMAT_FILTER 0 -#define CONFIG_FPS_FILTER 0 -#define CONFIG_FRAMEPACK_FILTER 0 -#define CONFIG_FRAMERATE_FILTER 0 -#define CONFIG_FRAMESTEP_FILTER 0 -#define CONFIG_FREEZEDETECT_FILTER 0 -#define CONFIG_FREI0R_FILTER 0 -#define CONFIG_FSPP_FILTER 0 -#define CONFIG_GBLUR_FILTER 0 -#define CONFIG_GEQ_FILTER 0 -#define CONFIG_GRADFUN_FILTER 0 -#define CONFIG_GRAPHMONITOR_FILTER 0 -#define CONFIG_GREYEDGE_FILTER 0 -#define CONFIG_HALDCLUT_FILTER 0 -#define CONFIG_HFLIP_FILTER 0 -#define CONFIG_HISTEQ_FILTER 0 -#define CONFIG_HISTOGRAM_FILTER 0 -#define CONFIG_HQDN3D_FILTER 0 -#define CONFIG_HQX_FILTER 0 -#define CONFIG_HSTACK_FILTER 0 -#define CONFIG_HUE_FILTER 0 -#define CONFIG_HWDOWNLOAD_FILTER 0 -#define CONFIG_HWMAP_FILTER 0 -#define CONFIG_HWUPLOAD_FILTER 0 -#define CONFIG_HWUPLOAD_CUDA_FILTER 0 -#define CONFIG_HYSTERESIS_FILTER 0 -#define CONFIG_IDET_FILTER 0 -#define CONFIG_IL_FILTER 0 -#define CONFIG_INFLATE_FILTER 0 -#define CONFIG_INTERLACE_FILTER 0 -#define CONFIG_INTERLEAVE_FILTER 0 -#define CONFIG_KERNDEINT_FILTER 0 -#define CONFIG_LENSCORRECTION_FILTER 0 -#define CONFIG_LENSFUN_FILTER 0 -#define CONFIG_LIBVMAF_FILTER 0 -#define CONFIG_LIMITER_FILTER 0 -#define CONFIG_LOOP_FILTER 0 -#define CONFIG_LUMAKEY_FILTER 0 -#define CONFIG_LUT_FILTER 0 -#define CONFIG_LUT1D_FILTER 0 -#define CONFIG_LUT2_FILTER 0 -#define CONFIG_LUT3D_FILTER 0 -#define CONFIG_LUTRGB_FILTER 0 -#define CONFIG_LUTYUV_FILTER 0 -#define CONFIG_MASKEDCLAMP_FILTER 0 -#define CONFIG_MASKEDMERGE_FILTER 0 -#define CONFIG_MCDEINT_FILTER 0 -#define CONFIG_MERGEPLANES_FILTER 0 -#define CONFIG_MESTIMATE_FILTER 0 -#define CONFIG_METADATA_FILTER 0 -#define CONFIG_MIDEQUALIZER_FILTER 0 -#define CONFIG_MINTERPOLATE_FILTER 0 -#define CONFIG_MIX_FILTER 0 -#define CONFIG_MPDECIMATE_FILTER 0 -#define CONFIG_NEGATE_FILTER 0 -#define CONFIG_NLMEANS_FILTER 0 -#define CONFIG_NNEDI_FILTER 0 -#define CONFIG_NOFORMAT_FILTER 0 -#define CONFIG_NOISE_FILTER 0 -#define CONFIG_NORMALIZE_FILTER 0 -#define CONFIG_NULL_FILTER 0 -#define CONFIG_OCR_FILTER 0 -#define CONFIG_OCV_FILTER 0 -#define CONFIG_OSCILLOSCOPE_FILTER 0 -#define CONFIG_OVERLAY_FILTER 0 -#define CONFIG_OVERLAY_OPENCL_FILTER 0 -#define CONFIG_OVERLAY_QSV_FILTER 0 -#define CONFIG_OWDENOISE_FILTER 0 -#define CONFIG_PAD_FILTER 0 -#define CONFIG_PALETTEGEN_FILTER 0 -#define CONFIG_PALETTEUSE_FILTER 0 -#define CONFIG_PERMS_FILTER 0 -#define CONFIG_PERSPECTIVE_FILTER 0 -#define CONFIG_PHASE_FILTER 0 -#define CONFIG_PIXDESCTEST_FILTER 0 -#define CONFIG_PIXSCOPE_FILTER 0 -#define CONFIG_PP_FILTER 0 -#define CONFIG_PP7_FILTER 0 -#define CONFIG_PREMULTIPLY_FILTER 0 -#define CONFIG_PREWITT_FILTER 0 -#define CONFIG_PREWITT_OPENCL_FILTER 0 -#define CONFIG_PROCAMP_VAAPI_FILTER 0 -#define CONFIG_PROGRAM_OPENCL_FILTER 0 -#define CONFIG_PSEUDOCOLOR_FILTER 0 -#define CONFIG_PSNR_FILTER 0 -#define CONFIG_PULLUP_FILTER 0 -#define CONFIG_QP_FILTER 0 -#define CONFIG_RANDOM_FILTER 0 -#define CONFIG_READEIA608_FILTER 0 -#define CONFIG_READVITC_FILTER 0 -#define CONFIG_REALTIME_FILTER 0 -#define CONFIG_REMAP_FILTER 0 -#define CONFIG_REMOVEGRAIN_FILTER 0 -#define CONFIG_REMOVELOGO_FILTER 0 -#define CONFIG_REPEATFIELDS_FILTER 0 -#define CONFIG_REVERSE_FILTER 0 -#define CONFIG_RGBASHIFT_FILTER 0 -#define CONFIG_ROBERTS_FILTER 0 -#define CONFIG_ROBERTS_OPENCL_FILTER 0 -#define CONFIG_ROTATE_FILTER 0 -#define CONFIG_SAB_FILTER 0 -#define CONFIG_SCALE_FILTER 0 -#define CONFIG_SCALE_CUDA_FILTER 0 -#define CONFIG_SCALE_NPP_FILTER 0 -#define CONFIG_SCALE_QSV_FILTER 0 -#define CONFIG_SCALE_VAAPI_FILTER 0 -#define CONFIG_SCALE2REF_FILTER 0 -#define CONFIG_SELECT_FILTER 0 -#define CONFIG_SELECTIVECOLOR_FILTER 0 -#define CONFIG_SENDCMD_FILTER 0 -#define CONFIG_SEPARATEFIELDS_FILTER 0 -#define CONFIG_SETDAR_FILTER 0 -#define CONFIG_SETFIELD_FILTER 0 -#define CONFIG_SETPARAMS_FILTER 0 -#define CONFIG_SETPTS_FILTER 0 -#define CONFIG_SETRANGE_FILTER 0 -#define CONFIG_SETSAR_FILTER 0 -#define CONFIG_SETTB_FILTER 0 -#define CONFIG_SHARPNESS_VAAPI_FILTER 0 -#define CONFIG_SHOWINFO_FILTER 0 -#define CONFIG_SHOWPALETTE_FILTER 0 -#define CONFIG_SHUFFLEFRAMES_FILTER 0 -#define CONFIG_SHUFFLEPLANES_FILTER 0 -#define CONFIG_SIDEDATA_FILTER 0 -#define CONFIG_SIGNALSTATS_FILTER 0 -#define CONFIG_SIGNATURE_FILTER 0 -#define CONFIG_SMARTBLUR_FILTER 0 -#define CONFIG_SOBEL_FILTER 0 -#define CONFIG_SOBEL_OPENCL_FILTER 0 -#define CONFIG_SPLIT_FILTER 0 -#define CONFIG_SPP_FILTER 0 -#define CONFIG_SR_FILTER 0 -#define CONFIG_SSIM_FILTER 0 -#define CONFIG_STEREO3D_FILTER 0 -#define CONFIG_STREAMSELECT_FILTER 0 -#define CONFIG_SUBTITLES_FILTER 0 -#define CONFIG_SUPER2XSAI_FILTER 0 -#define CONFIG_SWAPRECT_FILTER 0 -#define CONFIG_SWAPUV_FILTER 0 -#define CONFIG_TBLEND_FILTER 0 -#define CONFIG_TELECINE_FILTER 0 -#define CONFIG_THRESHOLD_FILTER 0 -#define CONFIG_THUMBNAIL_FILTER 0 -#define CONFIG_THUMBNAIL_CUDA_FILTER 0 -#define CONFIG_TILE_FILTER 0 -#define CONFIG_TINTERLACE_FILTER 0 -#define CONFIG_TLUT2_FILTER 0 -#define CONFIG_TMIX_FILTER 0 -#define CONFIG_TONEMAP_FILTER 0 -#define CONFIG_TONEMAP_OPENCL_FILTER 0 -#define CONFIG_TPAD_FILTER 0 -#define CONFIG_TRANSPOSE_FILTER 0 -#define CONFIG_TRANSPOSE_NPP_FILTER 0 -#define CONFIG_TRIM_FILTER 0 -#define CONFIG_UNPREMULTIPLY_FILTER 0 -#define CONFIG_UNSHARP_FILTER 0 -#define CONFIG_UNSHARP_OPENCL_FILTER 0 -#define CONFIG_USPP_FILTER 0 -#define CONFIG_VAGUEDENOISER_FILTER 0 -#define CONFIG_VECTORSCOPE_FILTER 0 -#define CONFIG_VFLIP_FILTER 0 -#define CONFIG_VFRDET_FILTER 0 -#define CONFIG_VIBRANCE_FILTER 0 -#define CONFIG_VIDSTABDETECT_FILTER 0 -#define CONFIG_VIDSTABTRANSFORM_FILTER 0 -#define CONFIG_VIGNETTE_FILTER 0 -#define CONFIG_VMAFMOTION_FILTER 0 -#define CONFIG_VPP_QSV_FILTER 0 -#define CONFIG_VSTACK_FILTER 0 -#define CONFIG_W3FDIF_FILTER 0 -#define CONFIG_WAVEFORM_FILTER 0 -#define CONFIG_WEAVE_FILTER 0 -#define CONFIG_XBR_FILTER 0 -#define CONFIG_XSTACK_FILTER 0 -#define CONFIG_YADIF_FILTER 0 -#define CONFIG_YADIF_CUDA_FILTER 0 -#define CONFIG_ZMQ_FILTER 0 -#define CONFIG_ZOOMPAN_FILTER 0 -#define CONFIG_ZSCALE_FILTER 0 -#define CONFIG_ALLRGB_FILTER 0 -#define CONFIG_ALLYUV_FILTER 0 -#define CONFIG_CELLAUTO_FILTER 0 -#define CONFIG_COLOR_FILTER 0 -#define CONFIG_COREIMAGESRC_FILTER 0 -#define CONFIG_FREI0R_SRC_FILTER 0 -#define CONFIG_HALDCLUTSRC_FILTER 0 -#define CONFIG_LIFE_FILTER 0 -#define CONFIG_MANDELBROT_FILTER 0 -#define CONFIG_MPTESTSRC_FILTER 0 -#define CONFIG_NULLSRC_FILTER 0 -#define CONFIG_OPENCLSRC_FILTER 0 -#define CONFIG_PAL75BARS_FILTER 0 -#define CONFIG_PAL100BARS_FILTER 0 -#define CONFIG_RGBTESTSRC_FILTER 0 -#define CONFIG_SMPTEBARS_FILTER 0 -#define CONFIG_SMPTEHDBARS_FILTER 0 -#define CONFIG_TESTSRC_FILTER 0 -#define CONFIG_TESTSRC2_FILTER 0 -#define CONFIG_YUVTESTSRC_FILTER 0 -#define CONFIG_NULLSINK_FILTER 0 -#define CONFIG_ABITSCOPE_FILTER 0 -#define CONFIG_ADRAWGRAPH_FILTER 0 -#define CONFIG_AGRAPHMONITOR_FILTER 0 -#define CONFIG_AHISTOGRAM_FILTER 0 -#define CONFIG_APHASEMETER_FILTER 0 -#define CONFIG_AVECTORSCOPE_FILTER 0 -#define CONFIG_CONCAT_FILTER 0 -#define CONFIG_SHOWCQT_FILTER 0 -#define CONFIG_SHOWFREQS_FILTER 0 -#define CONFIG_SHOWSPECTRUM_FILTER 0 -#define CONFIG_SHOWSPECTRUMPIC_FILTER 0 -#define CONFIG_SHOWVOLUME_FILTER 0 -#define CONFIG_SHOWWAVES_FILTER 0 -#define CONFIG_SHOWWAVESPIC_FILTER 0 -#define CONFIG_SPECTRUMSYNTH_FILTER 0 -#define CONFIG_AMOVIE_FILTER 0 -#define CONFIG_MOVIE_FILTER 0 -#define CONFIG_AFIFO_FILTER 0 -#define CONFIG_FIFO_FILTER 0 -#define CONFIG_AA_DEMUXER 1 -#define CONFIG_AAC_DEMUXER 1 -#define CONFIG_AC3_DEMUXER 1 -#define CONFIG_ACM_DEMUXER 1 -#define CONFIG_ACT_DEMUXER 1 -#define CONFIG_ADF_DEMUXER 1 -#define CONFIG_ADP_DEMUXER 1 -#define CONFIG_ADS_DEMUXER 1 -#define CONFIG_ADX_DEMUXER 1 -#define CONFIG_AEA_DEMUXER 1 -#define CONFIG_AFC_DEMUXER 1 -#define CONFIG_AIFF_DEMUXER 1 -#define CONFIG_AIX_DEMUXER 1 -#define CONFIG_AMR_DEMUXER 1 -#define CONFIG_AMRNB_DEMUXER 1 -#define CONFIG_AMRWB_DEMUXER 1 -#define CONFIG_ANM_DEMUXER 1 -#define CONFIG_APC_DEMUXER 1 -#define CONFIG_APE_DEMUXER 1 -#define CONFIG_APNG_DEMUXER 1 -#define CONFIG_APTX_DEMUXER 1 -#define CONFIG_APTX_HD_DEMUXER 1 -#define CONFIG_AQTITLE_DEMUXER 1 -#define CONFIG_ASF_DEMUXER 1 -#define CONFIG_ASF_O_DEMUXER 1 -#define CONFIG_ASS_DEMUXER 1 -#define CONFIG_AST_DEMUXER 1 -#define CONFIG_AU_DEMUXER 1 -#define CONFIG_AVI_DEMUXER 1 -#define CONFIG_AVISYNTH_DEMUXER 0 -#define CONFIG_AVR_DEMUXER 1 -#define CONFIG_AVS_DEMUXER 1 -#define CONFIG_AVS2_DEMUXER 1 -#define CONFIG_BETHSOFTVID_DEMUXER 1 -#define CONFIG_BFI_DEMUXER 1 -#define CONFIG_BINTEXT_DEMUXER 1 -#define CONFIG_BINK_DEMUXER 1 -#define CONFIG_BIT_DEMUXER 1 -#define CONFIG_BMV_DEMUXER 1 -#define CONFIG_BFSTM_DEMUXER 1 -#define CONFIG_BRSTM_DEMUXER 1 -#define CONFIG_BOA_DEMUXER 1 -#define CONFIG_C93_DEMUXER 1 -#define CONFIG_CAF_DEMUXER 1 -#define CONFIG_CAVSVIDEO_DEMUXER 1 -#define CONFIG_CDG_DEMUXER 1 -#define CONFIG_CDXL_DEMUXER 1 -#define CONFIG_CINE_DEMUXER 1 -#define CONFIG_CODEC2_DEMUXER 1 -#define CONFIG_CODEC2RAW_DEMUXER 1 -#define CONFIG_CONCAT_DEMUXER 1 -#define CONFIG_DASH_DEMUXER 0 -#define CONFIG_DATA_DEMUXER 1 -#define CONFIG_DAUD_DEMUXER 1 -#define CONFIG_DCSTR_DEMUXER 1 -#define CONFIG_DFA_DEMUXER 1 -#define CONFIG_DIRAC_DEMUXER 1 -#define CONFIG_DNXHD_DEMUXER 1 -#define CONFIG_DSF_DEMUXER 1 -#define CONFIG_DSICIN_DEMUXER 1 -#define CONFIG_DSS_DEMUXER 1 -#define CONFIG_DTS_DEMUXER 1 -#define CONFIG_DTSHD_DEMUXER 1 -#define CONFIG_DV_DEMUXER 1 -#define CONFIG_DVBSUB_DEMUXER 1 -#define CONFIG_DVBTXT_DEMUXER 1 -#define CONFIG_DXA_DEMUXER 1 -#define CONFIG_EA_DEMUXER 1 -#define CONFIG_EA_CDATA_DEMUXER 1 -#define CONFIG_EAC3_DEMUXER 1 -#define CONFIG_EPAF_DEMUXER 1 -#define CONFIG_FFMETADATA_DEMUXER 1 -#define CONFIG_FILMSTRIP_DEMUXER 1 -#define CONFIG_FITS_DEMUXER 1 -#define CONFIG_FLAC_DEMUXER 1 -#define CONFIG_FLIC_DEMUXER 1 -#define CONFIG_FLV_DEMUXER 1 -#define CONFIG_LIVE_FLV_DEMUXER 1 -#define CONFIG_FOURXM_DEMUXER 1 -#define CONFIG_FRM_DEMUXER 1 -#define CONFIG_FSB_DEMUXER 1 -#define CONFIG_G722_DEMUXER 1 -#define CONFIG_G723_1_DEMUXER 1 -#define CONFIG_G726_DEMUXER 1 -#define CONFIG_G726LE_DEMUXER 1 -#define CONFIG_G729_DEMUXER 1 -#define CONFIG_GDV_DEMUXER 1 -#define CONFIG_GENH_DEMUXER 1 -#define CONFIG_GIF_DEMUXER 1 -#define CONFIG_GSM_DEMUXER 1 -#define CONFIG_GXF_DEMUXER 1 -#define CONFIG_H261_DEMUXER 1 -#define CONFIG_H263_DEMUXER 1 -#define CONFIG_H264_DEMUXER 1 -#define CONFIG_HEVC_DEMUXER 1 -#define CONFIG_HLS_DEMUXER 1 -#define CONFIG_HNM_DEMUXER 1 -#define CONFIG_ICO_DEMUXER 1 -#define CONFIG_IDCIN_DEMUXER 1 -#define CONFIG_IDF_DEMUXER 1 -#define CONFIG_IFF_DEMUXER 1 -#define CONFIG_ILBC_DEMUXER 1 -#define CONFIG_IMAGE2_DEMUXER 1 -#define CONFIG_IMAGE2PIPE_DEMUXER 1 -#define CONFIG_IMAGE2_ALIAS_PIX_DEMUXER 1 -#define CONFIG_IMAGE2_BRENDER_PIX_DEMUXER 1 -#define CONFIG_INGENIENT_DEMUXER 1 -#define CONFIG_IPMOVIE_DEMUXER 1 -#define CONFIG_IRCAM_DEMUXER 1 -#define CONFIG_ISS_DEMUXER 1 -#define CONFIG_IV8_DEMUXER 1 -#define CONFIG_IVF_DEMUXER 1 -#define CONFIG_IVR_DEMUXER 1 -#define CONFIG_JACOSUB_DEMUXER 1 -#define CONFIG_JV_DEMUXER 1 -#define CONFIG_LMLM4_DEMUXER 1 -#define CONFIG_LOAS_DEMUXER 1 -#define CONFIG_LRC_DEMUXER 1 -#define CONFIG_LVF_DEMUXER 1 -#define CONFIG_LXF_DEMUXER 1 -#define CONFIG_M4V_DEMUXER 1 -#define CONFIG_MATROSKA_DEMUXER 1 -#define CONFIG_MGSTS_DEMUXER 1 -#define CONFIG_MICRODVD_DEMUXER 1 -#define CONFIG_MJPEG_DEMUXER 1 -#define CONFIG_MJPEG_2000_DEMUXER 1 -#define CONFIG_MLP_DEMUXER 1 -#define CONFIG_MLV_DEMUXER 1 -#define CONFIG_MM_DEMUXER 1 -#define CONFIG_MMF_DEMUXER 1 -#define CONFIG_MOV_DEMUXER 1 -#define CONFIG_MP3_DEMUXER 1 -#define CONFIG_MPC_DEMUXER 1 -#define CONFIG_MPC8_DEMUXER 1 -#define CONFIG_MPEGPS_DEMUXER 1 -#define CONFIG_MPEGTS_DEMUXER 1 -#define CONFIG_MPEGTSRAW_DEMUXER 1 -#define CONFIG_MPEGVIDEO_DEMUXER 1 -#define CONFIG_MPJPEG_DEMUXER 1 -#define CONFIG_MPL2_DEMUXER 1 -#define CONFIG_MPSUB_DEMUXER 1 -#define CONFIG_MSF_DEMUXER 1 -#define CONFIG_MSNWC_TCP_DEMUXER 1 -#define CONFIG_MTAF_DEMUXER 1 -#define CONFIG_MTV_DEMUXER 1 -#define CONFIG_MUSX_DEMUXER 1 -#define CONFIG_MV_DEMUXER 1 -#define CONFIG_MVI_DEMUXER 1 -#define CONFIG_MXF_DEMUXER 1 -#define CONFIG_MXG_DEMUXER 1 -#define CONFIG_NC_DEMUXER 1 -#define CONFIG_NISTSPHERE_DEMUXER 1 -#define CONFIG_NSP_DEMUXER 1 -#define CONFIG_NSV_DEMUXER 1 -#define CONFIG_NUT_DEMUXER 1 -#define CONFIG_NUV_DEMUXER 1 -#define CONFIG_OGG_DEMUXER 1 -#define CONFIG_OMA_DEMUXER 1 -#define CONFIG_PAF_DEMUXER 1 -#define CONFIG_PCM_ALAW_DEMUXER 1 -#define CONFIG_PCM_MULAW_DEMUXER 1 -#define CONFIG_PCM_VIDC_DEMUXER 1 -#define CONFIG_PCM_F64BE_DEMUXER 1 -#define CONFIG_PCM_F64LE_DEMUXER 1 -#define CONFIG_PCM_F32BE_DEMUXER 1 -#define CONFIG_PCM_F32LE_DEMUXER 1 -#define CONFIG_PCM_S32BE_DEMUXER 1 -#define CONFIG_PCM_S32LE_DEMUXER 1 -#define CONFIG_PCM_S24BE_DEMUXER 1 -#define CONFIG_PCM_S24LE_DEMUXER 1 -#define CONFIG_PCM_S16BE_DEMUXER 1 -#define CONFIG_PCM_S16LE_DEMUXER 1 -#define CONFIG_PCM_S8_DEMUXER 1 -#define CONFIG_PCM_U32BE_DEMUXER 1 -#define CONFIG_PCM_U32LE_DEMUXER 1 -#define CONFIG_PCM_U24BE_DEMUXER 1 -#define CONFIG_PCM_U24LE_DEMUXER 1 -#define CONFIG_PCM_U16BE_DEMUXER 1 -#define CONFIG_PCM_U16LE_DEMUXER 1 -#define CONFIG_PCM_U8_DEMUXER 1 -#define CONFIG_PJS_DEMUXER 1 -#define CONFIG_PMP_DEMUXER 1 -#define CONFIG_PVA_DEMUXER 1 -#define CONFIG_PVF_DEMUXER 1 -#define CONFIG_QCP_DEMUXER 1 -#define CONFIG_R3D_DEMUXER 1 -#define CONFIG_RAWVIDEO_DEMUXER 1 -#define CONFIG_REALTEXT_DEMUXER 1 -#define CONFIG_REDSPARK_DEMUXER 1 -#define CONFIG_RL2_DEMUXER 1 -#define CONFIG_RM_DEMUXER 1 -#define CONFIG_ROQ_DEMUXER 1 -#define CONFIG_RPL_DEMUXER 1 -#define CONFIG_RSD_DEMUXER 1 -#define CONFIG_RSO_DEMUXER 1 -#define CONFIG_RTP_DEMUXER 0 -#define CONFIG_RTSP_DEMUXER 0 -#define CONFIG_S337M_DEMUXER 1 -#define CONFIG_SAMI_DEMUXER 1 -#define CONFIG_SAP_DEMUXER 0 -#define CONFIG_SBC_DEMUXER 1 -#define CONFIG_SBG_DEMUXER 1 -#define CONFIG_SCC_DEMUXER 1 -#define CONFIG_SDP_DEMUXER 0 -#define CONFIG_SDR2_DEMUXER 1 -#define CONFIG_SDS_DEMUXER 1 -#define CONFIG_SDX_DEMUXER 1 -#define CONFIG_SEGAFILM_DEMUXER 1 -#define CONFIG_SER_DEMUXER 1 -#define CONFIG_SHORTEN_DEMUXER 1 -#define CONFIG_SIFF_DEMUXER 1 -#define CONFIG_SLN_DEMUXER 1 -#define CONFIG_SMACKER_DEMUXER 1 -#define CONFIG_SMJPEG_DEMUXER 1 -#define CONFIG_SMUSH_DEMUXER 1 -#define CONFIG_SOL_DEMUXER 1 -#define CONFIG_SOX_DEMUXER 1 -#define CONFIG_SPDIF_DEMUXER 1 -#define CONFIG_SRT_DEMUXER 1 -#define CONFIG_STR_DEMUXER 1 -#define CONFIG_STL_DEMUXER 1 -#define CONFIG_SUBVIEWER1_DEMUXER 1 -#define CONFIG_SUBVIEWER_DEMUXER 1 -#define CONFIG_SUP_DEMUXER 1 -#define CONFIG_SVAG_DEMUXER 1 -#define CONFIG_SWF_DEMUXER 1 -#define CONFIG_TAK_DEMUXER 1 -#define CONFIG_TEDCAPTIONS_DEMUXER 1 -#define CONFIG_THP_DEMUXER 1 -#define CONFIG_THREEDOSTR_DEMUXER 1 -#define CONFIG_TIERTEXSEQ_DEMUXER 1 -#define CONFIG_TMV_DEMUXER 1 -#define CONFIG_TRUEHD_DEMUXER 1 -#define CONFIG_TTA_DEMUXER 1 -#define CONFIG_TXD_DEMUXER 1 -#define CONFIG_TTY_DEMUXER 1 -#define CONFIG_TY_DEMUXER 1 -#define CONFIG_V210_DEMUXER 1 -#define CONFIG_V210X_DEMUXER 1 -#define CONFIG_VAG_DEMUXER 1 -#define CONFIG_VC1_DEMUXER 1 -#define CONFIG_VC1T_DEMUXER 1 -#define CONFIG_VIVO_DEMUXER 1 -#define CONFIG_VMD_DEMUXER 1 -#define CONFIG_VOBSUB_DEMUXER 1 -#define CONFIG_VOC_DEMUXER 1 -#define CONFIG_VPK_DEMUXER 1 -#define CONFIG_VPLAYER_DEMUXER 1 -#define CONFIG_VQF_DEMUXER 1 -#define CONFIG_W64_DEMUXER 1 -#define CONFIG_WAV_DEMUXER 1 -#define CONFIG_WC3_DEMUXER 1 -#define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 1 -#define CONFIG_WEBVTT_DEMUXER 1 -#define CONFIG_WSAUD_DEMUXER 1 -#define CONFIG_WSD_DEMUXER 1 -#define CONFIG_WSVQA_DEMUXER 1 -#define CONFIG_WTV_DEMUXER 1 -#define CONFIG_WVE_DEMUXER 1 -#define CONFIG_WV_DEMUXER 1 -#define CONFIG_XA_DEMUXER 1 -#define CONFIG_XBIN_DEMUXER 1 -#define CONFIG_XMV_DEMUXER 1 -#define CONFIG_XVAG_DEMUXER 1 -#define CONFIG_XWMA_DEMUXER 1 -#define CONFIG_YOP_DEMUXER 1 -#define CONFIG_YUV4MPEGPIPE_DEMUXER 1 -#define CONFIG_IMAGE_BMP_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_DDS_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_DPX_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_EXR_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_J2K_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PAM_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PBM_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PCX_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PGM_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PNG_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PPM_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_PSD_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_QDRAW_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_SGI_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_SVG_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_TIFF_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_WEBP_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_XPM_PIPE_DEMUXER 1 -#define CONFIG_IMAGE_XWD_PIPE_DEMUXER 1 -#define CONFIG_LIBGME_DEMUXER 0 -#define CONFIG_LIBMODPLUG_DEMUXER 0 -#define CONFIG_LIBOPENMPT_DEMUXER 0 -#define CONFIG_VAPOURSYNTH_DEMUXER 0 -#define CONFIG_A64_MUXER 0 -#define CONFIG_AC3_MUXER 0 -#define CONFIG_ADTS_MUXER 0 -#define CONFIG_ADX_MUXER 0 -#define CONFIG_AIFF_MUXER 0 -#define CONFIG_AMR_MUXER 0 -#define CONFIG_APNG_MUXER 0 -#define CONFIG_APTX_MUXER 0 -#define CONFIG_APTX_HD_MUXER 0 -#define CONFIG_ASF_MUXER 0 -#define CONFIG_ASS_MUXER 0 -#define CONFIG_AST_MUXER 0 -#define CONFIG_ASF_STREAM_MUXER 0 -#define CONFIG_AU_MUXER 0 -#define CONFIG_AVI_MUXER 0 -#define CONFIG_AVM2_MUXER 0 -#define CONFIG_AVS2_MUXER 0 -#define CONFIG_BIT_MUXER 0 -#define CONFIG_CAF_MUXER 0 -#define CONFIG_CAVSVIDEO_MUXER 0 -#define CONFIG_CODEC2_MUXER 0 -#define CONFIG_CODEC2RAW_MUXER 0 -#define CONFIG_CRC_MUXER 0 -#define CONFIG_DASH_MUXER 0 -#define CONFIG_DATA_MUXER 0 -#define CONFIG_DAUD_MUXER 0 -#define CONFIG_DIRAC_MUXER 0 -#define CONFIG_DNXHD_MUXER 0 -#define CONFIG_DTS_MUXER 0 -#define CONFIG_DV_MUXER 0 -#define CONFIG_EAC3_MUXER 0 -#define CONFIG_F4V_MUXER 0 -#define CONFIG_FFMETADATA_MUXER 0 -#define CONFIG_FIFO_MUXER 0 -#define CONFIG_FIFO_TEST_MUXER 0 -#define CONFIG_FILMSTRIP_MUXER 0 -#define CONFIG_FITS_MUXER 0 -#define CONFIG_FLAC_MUXER 0 -#define CONFIG_FLV_MUXER 0 -#define CONFIG_FRAMECRC_MUXER 0 -#define CONFIG_FRAMEHASH_MUXER 0 -#define CONFIG_FRAMEMD5_MUXER 0 -#define CONFIG_G722_MUXER 0 -#define CONFIG_G723_1_MUXER 0 -#define CONFIG_G726_MUXER 0 -#define CONFIG_G726LE_MUXER 0 -#define CONFIG_GIF_MUXER 0 -#define CONFIG_GSM_MUXER 0 -#define CONFIG_GXF_MUXER 0 -#define CONFIG_H261_MUXER 0 -#define CONFIG_H263_MUXER 0 -#define CONFIG_H264_MUXER 0 -#define CONFIG_HASH_MUXER 0 -#define CONFIG_HDS_MUXER 0 -#define CONFIG_HEVC_MUXER 0 -#define CONFIG_HLS_MUXER 0 -#define CONFIG_ICO_MUXER 0 -#define CONFIG_ILBC_MUXER 0 -#define CONFIG_IMAGE2_MUXER 0 -#define CONFIG_IMAGE2PIPE_MUXER 0 -#define CONFIG_IPOD_MUXER 0 -#define CONFIG_IRCAM_MUXER 0 -#define CONFIG_ISMV_MUXER 0 -#define CONFIG_IVF_MUXER 0 -#define CONFIG_JACOSUB_MUXER 0 -#define CONFIG_LATM_MUXER 0 -#define CONFIG_LRC_MUXER 0 -#define CONFIG_M4V_MUXER 0 -#define CONFIG_MD5_MUXER 0 -#define CONFIG_MATROSKA_MUXER 0 -#define CONFIG_MATROSKA_AUDIO_MUXER 0 -#define CONFIG_MICRODVD_MUXER 0 -#define CONFIG_MJPEG_MUXER 0 -#define CONFIG_MLP_MUXER 0 -#define CONFIG_MMF_MUXER 0 -#define CONFIG_MOV_MUXER 0 -#define CONFIG_MP2_MUXER 0 -#define CONFIG_MP3_MUXER 0 -#define CONFIG_MP4_MUXER 0 -#define CONFIG_MPEG1SYSTEM_MUXER 0 -#define CONFIG_MPEG1VCD_MUXER 0 -#define CONFIG_MPEG1VIDEO_MUXER 0 -#define CONFIG_MPEG2DVD_MUXER 0 -#define CONFIG_MPEG2SVCD_MUXER 0 -#define CONFIG_MPEG2VIDEO_MUXER 0 -#define CONFIG_MPEG2VOB_MUXER 0 -#define CONFIG_MPEGTS_MUXER 0 -#define CONFIG_MPJPEG_MUXER 0 -#define CONFIG_MXF_MUXER 0 -#define CONFIG_MXF_D10_MUXER 0 -#define CONFIG_MXF_OPATOM_MUXER 0 -#define CONFIG_NULL_MUXER 0 -#define CONFIG_NUT_MUXER 0 -#define CONFIG_OGA_MUXER 0 -#define CONFIG_OGG_MUXER 0 -#define CONFIG_OGV_MUXER 0 -#define CONFIG_OMA_MUXER 0 -#define CONFIG_OPUS_MUXER 0 -#define CONFIG_PCM_ALAW_MUXER 0 -#define CONFIG_PCM_MULAW_MUXER 0 -#define CONFIG_PCM_VIDC_MUXER 0 -#define CONFIG_PCM_F64BE_MUXER 0 -#define CONFIG_PCM_F64LE_MUXER 0 -#define CONFIG_PCM_F32BE_MUXER 0 -#define CONFIG_PCM_F32LE_MUXER 0 -#define CONFIG_PCM_S32BE_MUXER 0 -#define CONFIG_PCM_S32LE_MUXER 0 -#define CONFIG_PCM_S24BE_MUXER 0 -#define CONFIG_PCM_S24LE_MUXER 0 -#define CONFIG_PCM_S16BE_MUXER 0 -#define CONFIG_PCM_S16LE_MUXER 0 -#define CONFIG_PCM_S8_MUXER 0 -#define CONFIG_PCM_U32BE_MUXER 0 -#define CONFIG_PCM_U32LE_MUXER 0 -#define CONFIG_PCM_U24BE_MUXER 0 -#define CONFIG_PCM_U24LE_MUXER 0 -#define CONFIG_PCM_U16BE_MUXER 0 -#define CONFIG_PCM_U16LE_MUXER 0 -#define CONFIG_PCM_U8_MUXER 0 -#define CONFIG_PSP_MUXER 0 -#define CONFIG_RAWVIDEO_MUXER 0 -#define CONFIG_RM_MUXER 0 -#define CONFIG_ROQ_MUXER 0 -#define CONFIG_RSO_MUXER 0 -#define CONFIG_RTP_MUXER 0 -#define CONFIG_RTP_MPEGTS_MUXER 0 -#define CONFIG_RTSP_MUXER 0 -#define CONFIG_SAP_MUXER 0 -#define CONFIG_SBC_MUXER 0 -#define CONFIG_SCC_MUXER 0 -#define CONFIG_SEGAFILM_MUXER 0 -#define CONFIG_SEGMENT_MUXER 0 -#define CONFIG_STREAM_SEGMENT_MUXER 0 -#define CONFIG_SINGLEJPEG_MUXER 0 -#define CONFIG_SMJPEG_MUXER 0 -#define CONFIG_SMOOTHSTREAMING_MUXER 0 -#define CONFIG_SOX_MUXER 0 -#define CONFIG_SPX_MUXER 0 -#define CONFIG_SPDIF_MUXER 0 -#define CONFIG_SRT_MUXER 0 -#define CONFIG_SUP_MUXER 0 -#define CONFIG_SWF_MUXER 0 -#define CONFIG_TEE_MUXER 0 -#define CONFIG_TG2_MUXER 0 -#define CONFIG_TGP_MUXER 0 -#define CONFIG_MKVTIMESTAMP_V2_MUXER 0 -#define CONFIG_TRUEHD_MUXER 0 -#define CONFIG_TTA_MUXER 0 -#define CONFIG_UNCODEDFRAMECRC_MUXER 0 -#define CONFIG_VC1_MUXER 0 -#define CONFIG_VC1T_MUXER 0 -#define CONFIG_VOC_MUXER 0 -#define CONFIG_W64_MUXER 0 -#define CONFIG_WAV_MUXER 0 -#define CONFIG_WEBM_MUXER 0 -#define CONFIG_WEBM_DASH_MANIFEST_MUXER 0 -#define CONFIG_WEBM_CHUNK_MUXER 0 -#define CONFIG_WEBP_MUXER 0 -#define CONFIG_WEBVTT_MUXER 0 -#define CONFIG_WTV_MUXER 0 -#define CONFIG_WV_MUXER 0 -#define CONFIG_YUV4MPEGPIPE_MUXER 0 -#define CONFIG_CHROMAPRINT_MUXER 0 -#define CONFIG_ASYNC_PROTOCOL 1 -#define CONFIG_BLURAY_PROTOCOL 0 -#define CONFIG_CACHE_PROTOCOL 1 -#define CONFIG_CONCAT_PROTOCOL 1 -#define CONFIG_CRYPTO_PROTOCOL 1 -#define CONFIG_DATA_PROTOCOL 1 -#define CONFIG_FFRTMPCRYPT_PROTOCOL 0 -#define CONFIG_FFRTMPHTTP_PROTOCOL 0 -#define CONFIG_FILE_PROTOCOL 1 -#define CONFIG_FTP_PROTOCOL 0 -#define CONFIG_GOPHER_PROTOCOL 0 -#define CONFIG_HLS_PROTOCOL 1 -#define CONFIG_HTTP_PROTOCOL 0 -#define CONFIG_HTTPPROXY_PROTOCOL 0 -#define CONFIG_HTTPS_PROTOCOL 0 -#define CONFIG_ICECAST_PROTOCOL 0 -#define CONFIG_MMSH_PROTOCOL 0 -#define CONFIG_MMST_PROTOCOL 0 -#define CONFIG_MD5_PROTOCOL 1 -#define CONFIG_PIPE_PROTOCOL 1 -#define CONFIG_PROMPEG_PROTOCOL 1 -#define CONFIG_RTMP_PROTOCOL 0 -#define CONFIG_RTMPE_PROTOCOL 0 -#define CONFIG_RTMPS_PROTOCOL 0 -#define CONFIG_RTMPT_PROTOCOL 0 -#define CONFIG_RTMPTE_PROTOCOL 0 -#define CONFIG_RTMPTS_PROTOCOL 0 -#define CONFIG_RTP_PROTOCOL 0 -#define CONFIG_SCTP_PROTOCOL 0 -#define CONFIG_SRTP_PROTOCOL 0 -#define CONFIG_SUBFILE_PROTOCOL 1 -#define CONFIG_TEE_PROTOCOL 1 -#define CONFIG_TCP_PROTOCOL 0 -#define CONFIG_TLS_PROTOCOL 0 -#define CONFIG_UDP_PROTOCOL 0 -#define CONFIG_UDPLITE_PROTOCOL 0 -#define CONFIG_UNIX_PROTOCOL 0 -#define CONFIG_LIBRTMP_PROTOCOL 0 -#define CONFIG_LIBRTMPE_PROTOCOL 0 -#define CONFIG_LIBRTMPS_PROTOCOL 0 -#define CONFIG_LIBRTMPT_PROTOCOL 0 -#define CONFIG_LIBRTMPTE_PROTOCOL 0 -#define CONFIG_LIBSRT_PROTOCOL 0 -#define CONFIG_LIBSSH_PROTOCOL 0 -#define CONFIG_LIBSMBCLIENT_PROTOCOL 0 -#endif /* FFMPEG_CONFIG_H */ diff --git a/build/ffmpeg/config.h b/build/ffmpeg/config.h deleted file mode 100644 index 40152db8c..000000000 --- a/build/ffmpeg/config.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef _WIN64 -#include "config-x64.h" -#else -#include "config-x86.h" -#endif diff --git a/build/ffmpeg/configure.sh b/build/ffmpeg/configure.sh deleted file mode 100755 index 624783893..000000000 --- a/build/ffmpeg/configure.sh +++ /dev/null @@ -1,54 +0,0 @@ -platform='Win32' -suffix='x86' -if [[ $LIB =~ x64 ]]; then - platform='x64' - suffix='x64' -fi - -./configure $@ \ - --disable-avfilter \ - --disable-avresample \ - --disable-bzlib \ - --disable-d3d11va \ - --disable-dxva2 \ - --disable-decoder=atrac3p,indeo2,indeo3,indeo4,indeo5,twinvq \ - --disable-devices \ - --disable-doc \ - --disable-encoders \ - --disable-ffmpeg \ - --disable-ffplay \ - --disable-ffprobe \ - --disable-filters \ - --disable-hwaccels \ - --disable-muxers \ - --disable-network \ - --disable-postproc \ - --disable-pthreads \ - --disable-shared \ - --enable-gpl \ - --enable-runtime-cpudetect \ - --enable-static \ - --enable-small \ - --enable-x86asm \ - --x86asmexe=yasm \ - --enable-zlib \ - --extra-cflags=-D_SYSCRT \ - --extra-cflags=-I../../include \ - --extra-cflags=-MD \ - --extra-cflags=-wd4005 \ - --extra-cflags=-wd4189 \ - --extra-ldflags=-LIBPATH:../../lib/$platform/Release \ - --toolchain=msvc - -mv config.asm ../../build/ffmpeg/config-$suffix.asm -mv config.h ../../build/ffmpeg/config-$suffix.h -mv libavcodec/bsf_list.c ../../build/ffmpeg/libavcodec/bsf_list.c -mv libavcodec/codec_list.c ../../build/ffmpeg/libavcodec/codec_list.c -mv libavcodec/parser_list.c ../../build/ffmpeg/libavcodec/parser_list.c -mv libavdevice/indev_list.c ../../build/ffmpeg/libavdevice/indev_list.c -mv libavdevice/outdev_list.c ../../build/ffmpeg/libavdevice/outdev_list.c -mv libavformat/demuxer_list.c ../../build/ffmpeg/libavformat/demuxer_list.c -mv libavformat/muxer_list.c ../../build/ffmpeg/libavformat/muxer_list.c -mv libavformat/protocol_list.c ../../build/ffmpeg/libavformat/protocol_list.c -mv libavutil/avconfig.h ../../build/ffmpeg/libavutil/avconfig.h -mv libavutil/ffversion.h ../../build/ffmpeg/libavutil/ffversion.h diff --git a/build/ffmpeg/ffmpeg.vcxproj b/build/ffmpeg/ffmpeg.vcxproj deleted file mode 100644 index 6753294ee..000000000 --- a/build/ffmpeg/ffmpeg.vcxproj +++ /dev/null @@ -1,1413 +0,0 @@ - - - - {F934AB7B-186B-4E96-B20C-A58C38C1B819} - ffmpeg - lib - $(FfmpegSrcDir) - - - - - - - - - - - - - - - - $(MSBuildThisFileDirectory); - $(FfmpegSrcDir); - $(FfmpegSrcDir)\compat\atomics\win32; - $(AegisubSourceBase)\include; - - - HAVE_AV_CONFIG_H; - _CRT_SECURE_NO_WARNINGS; - _FILE_OFFSET_BITS=64; - _ISOC99_SOURCE; - _LARGEFILE_SOURCE; - _SYSCRT; - _USE_MATH_DEFINES; - _WIN32_WINNT=0x0602; - inline=__inline; - %(PreprocessorDefinitions) - - stdlib.h;%(ForcedIncludeFiles) - Level1 - - - MinSpace - ProgramDatabase - Default - true - false - $(FfmpegSrcDir) - - - $(FfmpegSrcDir) - - - $(FfmpegSrcDir)\ - %(Include) -I$(MSBuildThisFileDirectory) -I$(FfmpegSrcDir) - %(Config) -DPREFIX -Pconfig-x86.asm - %(Config) -Pconfig-x64.asm - - - - - - - {10f22a5a-dd9e-44a1-ba2e-2a9a7c78b0ee} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(MSBuildThisFileDirectory) - - - $(MSBuildThisFileDirectory) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/ffmpeg/ffmpeg.vcxproj.filters b/build/ffmpeg/ffmpeg.vcxproj.filters deleted file mode 100644 index 25c259cfc..000000000 --- a/build/ffmpeg/ffmpeg.vcxproj.filters +++ /dev/null @@ -1,2659 +0,0 @@ - - - - - libavdevice - - - libavdevice - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavformat - - - libavresample - - - libavresample - - - libavresample - - - libavresample - - - libavresample - - - libavresample - - - libavresample - - - libavresample - - - libavresample - - - libavresample - - - libavresample - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libavcodec - - - libswscale - - - libswscale - - - libswscale - - - libswscale - - - libswscale - - - libswscale - - - libswscale - - - libswscale - - - libswscale - - - libswscale - - - libswscale - - - compat - - - compat - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - libavutil - - - - - {37917d7c-3879-482a-bb0c-36ad05f4b6ff} - - - {6b42873d-3fb7-4135-a5a0-0c80b081519f} - - - {aa5c6ccd-b317-41a7-9fc5-e319d1154e97} - - - {a667d61f-5608-4726-9052-28df0130c602} - - - {2ca1cbec-46c2-41d7-b3e0-94bafb352413} - - - {b3cb6744-99da-450a-86f6-914bebe58ff2} - - - {ad571b1a-bdc8-4b66-bfee-9a2695bd50c3} - - - diff --git a/build/ffmpeg/get-file-list.sh b/build/ffmpeg/get-file-list.sh deleted file mode 100755 index d5b5b5213..000000000 --- a/build/ffmpeg/get-file-list.sh +++ /dev/null @@ -1,13 +0,0 @@ -rm -f make-dry -make -n > make-dry -grep '^cl' make-dry \ - | sed 's/.*\(lib[^ ]*.c\) .*/\1/' \ - | sed 's/\//\\/g' \ - | sed 's/\(.*\)//' \ - | sort -echo -grep '^yasm' make-dry \ - | sed 's/.*\(lib[^ ]*.asm\) .*/\1/' \ - | sed 's/\//\\/g' \ - | sed 's/\(.*\)//' \ - | sort diff --git a/build/ffmpeg/libavcodec/bsf_list.c b/build/ffmpeg/libavcodec/bsf_list.c deleted file mode 100644 index 9c0766c2a..000000000 --- a/build/ffmpeg/libavcodec/bsf_list.c +++ /dev/null @@ -1,33 +0,0 @@ -static const AVBitStreamFilter * const bitstream_filters[] = { - &ff_aac_adtstoasc_bsf, - &ff_av1_metadata_bsf, - &ff_chomp_bsf, - &ff_dump_extradata_bsf, - &ff_dca_core_bsf, - &ff_eac3_core_bsf, - &ff_extract_extradata_bsf, - &ff_filter_units_bsf, - &ff_h264_metadata_bsf, - &ff_h264_mp4toannexb_bsf, - &ff_h264_redundant_pps_bsf, - &ff_hapqa_extract_bsf, - &ff_hevc_metadata_bsf, - &ff_hevc_mp4toannexb_bsf, - &ff_imx_dump_header_bsf, - &ff_mjpeg2jpeg_bsf, - &ff_mjpega_dump_header_bsf, - &ff_mp3_header_decompress_bsf, - &ff_mpeg2_metadata_bsf, - &ff_mpeg4_unpack_bframes_bsf, - &ff_mov2textsub_bsf, - &ff_noise_bsf, - &ff_null_bsf, - &ff_prores_metadata_bsf, - &ff_remove_extradata_bsf, - &ff_text2movsub_bsf, - &ff_trace_headers_bsf, - &ff_vp9_metadata_bsf, - &ff_vp9_raw_reorder_bsf, - &ff_vp9_superframe_bsf, - &ff_vp9_superframe_split_bsf, - NULL }; diff --git a/build/ffmpeg/libavcodec/codec_list.c b/build/ffmpeg/libavcodec/codec_list.c deleted file mode 100644 index 17228aa9f..000000000 --- a/build/ffmpeg/libavcodec/codec_list.c +++ /dev/null @@ -1,426 +0,0 @@ -static const AVCodec * const codec_list[] = { - &ff_aasc_decoder, - &ff_aic_decoder, - &ff_alias_pix_decoder, - &ff_amv_decoder, - &ff_anm_decoder, - &ff_ansi_decoder, - &ff_apng_decoder, - &ff_asv1_decoder, - &ff_asv2_decoder, - &ff_aura_decoder, - &ff_aura2_decoder, - &ff_avrp_decoder, - &ff_avrn_decoder, - &ff_avs_decoder, - &ff_avui_decoder, - &ff_ayuv_decoder, - &ff_bethsoftvid_decoder, - &ff_bfi_decoder, - &ff_bink_decoder, - &ff_bitpacked_decoder, - &ff_bmp_decoder, - &ff_bmv_video_decoder, - &ff_brender_pix_decoder, - &ff_c93_decoder, - &ff_cavs_decoder, - &ff_cdgraphics_decoder, - &ff_cdxl_decoder, - &ff_cfhd_decoder, - &ff_cinepak_decoder, - &ff_clearvideo_decoder, - &ff_cljr_decoder, - &ff_cllc_decoder, - &ff_comfortnoise_decoder, - &ff_cpia_decoder, - &ff_cscd_decoder, - &ff_cyuv_decoder, - &ff_dds_decoder, - &ff_dfa_decoder, - &ff_dirac_decoder, - &ff_dnxhd_decoder, - &ff_dpx_decoder, - &ff_dsicinvideo_decoder, - &ff_dvaudio_decoder, - &ff_dvvideo_decoder, - &ff_dxa_decoder, - &ff_dxtory_decoder, - &ff_dxv_decoder, - &ff_eacmv_decoder, - &ff_eamad_decoder, - &ff_eatgq_decoder, - &ff_eatgv_decoder, - &ff_eatqi_decoder, - &ff_eightbps_decoder, - &ff_eightsvx_exp_decoder, - &ff_eightsvx_fib_decoder, - &ff_escape124_decoder, - &ff_escape130_decoder, - &ff_exr_decoder, - &ff_ffv1_decoder, - &ff_ffvhuff_decoder, - &ff_fic_decoder, - &ff_fits_decoder, - &ff_flashsv_decoder, - &ff_flashsv2_decoder, - &ff_flic_decoder, - &ff_flv_decoder, - &ff_fmvc_decoder, - &ff_fourxm_decoder, - &ff_fraps_decoder, - &ff_frwu_decoder, - &ff_g2m_decoder, - &ff_gdv_decoder, - &ff_gif_decoder, - &ff_h261_decoder, - &ff_h263_decoder, - &ff_h263i_decoder, - &ff_h263p_decoder, - &ff_h264_decoder, - &ff_hap_decoder, - &ff_hevc_decoder, - &ff_hnm4_video_decoder, - &ff_hq_hqa_decoder, - &ff_hqx_decoder, - &ff_huffyuv_decoder, - &ff_idcin_decoder, - &ff_iff_ilbm_decoder, - &ff_imm4_decoder, - &ff_interplay_video_decoder, - &ff_jpeg2000_decoder, - &ff_jpegls_decoder, - &ff_jv_decoder, - &ff_kgv1_decoder, - &ff_kmvc_decoder, - &ff_lagarith_decoder, - &ff_loco_decoder, - &ff_m101_decoder, - &ff_magicyuv_decoder, - &ff_mdec_decoder, - &ff_mimic_decoder, - &ff_mjpeg_decoder, - &ff_mjpegb_decoder, - &ff_mmvideo_decoder, - &ff_motionpixels_decoder, - &ff_mpeg1video_decoder, - &ff_mpeg2video_decoder, - &ff_mpeg4_decoder, - &ff_mpegvideo_decoder, - &ff_msa1_decoder, - &ff_mscc_decoder, - &ff_msmpeg4v1_decoder, - &ff_msmpeg4v2_decoder, - &ff_msmpeg4v3_decoder, - &ff_msrle_decoder, - &ff_mss1_decoder, - &ff_mss2_decoder, - &ff_msvideo1_decoder, - &ff_mszh_decoder, - &ff_mts2_decoder, - &ff_mvc1_decoder, - &ff_mvc2_decoder, - &ff_mwsc_decoder, - &ff_mxpeg_decoder, - &ff_nuv_decoder, - &ff_paf_video_decoder, - &ff_pam_decoder, - &ff_pbm_decoder, - &ff_pcx_decoder, - &ff_pgm_decoder, - &ff_pgmyuv_decoder, - &ff_pictor_decoder, - &ff_pixlet_decoder, - &ff_png_decoder, - &ff_ppm_decoder, - &ff_prores_decoder, - &ff_prosumer_decoder, - &ff_psd_decoder, - &ff_ptx_decoder, - &ff_qdraw_decoder, - &ff_qpeg_decoder, - &ff_qtrle_decoder, - &ff_r10k_decoder, - &ff_r210_decoder, - &ff_rasc_decoder, - &ff_rawvideo_decoder, - &ff_rl2_decoder, - &ff_roq_decoder, - &ff_rpza_decoder, - &ff_rscc_decoder, - &ff_rv10_decoder, - &ff_rv20_decoder, - &ff_rv30_decoder, - &ff_rv40_decoder, - &ff_s302m_decoder, - &ff_sanm_decoder, - &ff_scpr_decoder, - &ff_screenpresso_decoder, - &ff_sdx2_dpcm_decoder, - &ff_sgi_decoder, - &ff_sgirle_decoder, - &ff_sheervideo_decoder, - &ff_smacker_decoder, - &ff_smc_decoder, - &ff_smvjpeg_decoder, - &ff_snow_decoder, - &ff_sp5x_decoder, - &ff_speedhq_decoder, - &ff_srgc_decoder, - &ff_sunrast_decoder, - &ff_svq1_decoder, - &ff_svq3_decoder, - &ff_targa_decoder, - &ff_targa_y216_decoder, - &ff_tdsc_decoder, - &ff_theora_decoder, - &ff_thp_decoder, - &ff_tiertexseqvideo_decoder, - &ff_tiff_decoder, - &ff_tmv_decoder, - &ff_truemotion1_decoder, - &ff_truemotion2_decoder, - &ff_truemotion2rt_decoder, - &ff_tscc_decoder, - &ff_tscc2_decoder, - &ff_txd_decoder, - &ff_ulti_decoder, - &ff_utvideo_decoder, - &ff_v210_decoder, - &ff_v210x_decoder, - &ff_v308_decoder, - &ff_v408_decoder, - &ff_v410_decoder, - &ff_vb_decoder, - &ff_vble_decoder, - &ff_vc1_decoder, - &ff_vc1image_decoder, - &ff_vcr1_decoder, - &ff_vmdvideo_decoder, - &ff_vmnc_decoder, - &ff_vp3_decoder, - &ff_vp5_decoder, - &ff_vp6_decoder, - &ff_vp6a_decoder, - &ff_vp6f_decoder, - &ff_vp7_decoder, - &ff_vp8_decoder, - &ff_vp9_decoder, - &ff_vqa_decoder, - &ff_webp_decoder, - &ff_wcmv_decoder, - &ff_wrapped_avframe_decoder, - &ff_wmv1_decoder, - &ff_wmv2_decoder, - &ff_wmv3_decoder, - &ff_wmv3image_decoder, - &ff_wnv1_decoder, - &ff_xan_wc3_decoder, - &ff_xan_wc4_decoder, - &ff_xbm_decoder, - &ff_xface_decoder, - &ff_xl_decoder, - &ff_xpm_decoder, - &ff_xwd_decoder, - &ff_y41p_decoder, - &ff_ylc_decoder, - &ff_yop_decoder, - &ff_yuv4_decoder, - &ff_zero12v_decoder, - &ff_zerocodec_decoder, - &ff_zlib_decoder, - &ff_zmbv_decoder, - &ff_aac_decoder, - &ff_aac_fixed_decoder, - &ff_aac_latm_decoder, - &ff_ac3_decoder, - &ff_ac3_fixed_decoder, - &ff_alac_decoder, - &ff_als_decoder, - &ff_amrnb_decoder, - &ff_amrwb_decoder, - &ff_ape_decoder, - &ff_aptx_decoder, - &ff_aptx_hd_decoder, - &ff_atrac1_decoder, - &ff_atrac3_decoder, - &ff_atrac3al_decoder, - &ff_atrac3pal_decoder, - &ff_atrac9_decoder, - &ff_binkaudio_dct_decoder, - &ff_binkaudio_rdft_decoder, - &ff_bmv_audio_decoder, - &ff_cook_decoder, - &ff_dca_decoder, - &ff_dolby_e_decoder, - &ff_dsd_lsbf_decoder, - &ff_dsd_msbf_decoder, - &ff_dsd_lsbf_planar_decoder, - &ff_dsd_msbf_planar_decoder, - &ff_dsicinaudio_decoder, - &ff_dss_sp_decoder, - &ff_dst_decoder, - &ff_eac3_decoder, - &ff_evrc_decoder, - &ff_ffwavesynth_decoder, - &ff_flac_decoder, - &ff_g723_1_decoder, - &ff_g729_decoder, - &ff_gsm_decoder, - &ff_gsm_ms_decoder, - &ff_iac_decoder, - &ff_ilbc_decoder, - &ff_imc_decoder, - &ff_interplay_acm_decoder, - &ff_mace3_decoder, - &ff_mace6_decoder, - &ff_metasound_decoder, - &ff_mlp_decoder, - &ff_mp1_decoder, - &ff_mp1float_decoder, - &ff_mp2_decoder, - &ff_mp2float_decoder, - &ff_mp3float_decoder, - &ff_mp3_decoder, - &ff_mp3adufloat_decoder, - &ff_mp3adu_decoder, - &ff_mp3on4float_decoder, - &ff_mp3on4_decoder, - &ff_mpc7_decoder, - &ff_mpc8_decoder, - &ff_nellymoser_decoder, - &ff_on2avc_decoder, - &ff_opus_decoder, - &ff_paf_audio_decoder, - &ff_qcelp_decoder, - &ff_qdm2_decoder, - &ff_qdmc_decoder, - &ff_ra_144_decoder, - &ff_ra_288_decoder, - &ff_ralf_decoder, - &ff_sbc_decoder, - &ff_shorten_decoder, - &ff_sipr_decoder, - &ff_smackaud_decoder, - &ff_sonic_decoder, - &ff_tak_decoder, - &ff_truehd_decoder, - &ff_truespeech_decoder, - &ff_tta_decoder, - &ff_vmdaudio_decoder, - &ff_vorbis_decoder, - &ff_wavpack_decoder, - &ff_wmalossless_decoder, - &ff_wmapro_decoder, - &ff_wmav1_decoder, - &ff_wmav2_decoder, - &ff_wmavoice_decoder, - &ff_ws_snd1_decoder, - &ff_xma1_decoder, - &ff_xma2_decoder, - &ff_pcm_alaw_decoder, - &ff_pcm_bluray_decoder, - &ff_pcm_dvd_decoder, - &ff_pcm_f16le_decoder, - &ff_pcm_f24le_decoder, - &ff_pcm_f32be_decoder, - &ff_pcm_f32le_decoder, - &ff_pcm_f64be_decoder, - &ff_pcm_f64le_decoder, - &ff_pcm_lxf_decoder, - &ff_pcm_mulaw_decoder, - &ff_pcm_s8_decoder, - &ff_pcm_s8_planar_decoder, - &ff_pcm_s16be_decoder, - &ff_pcm_s16be_planar_decoder, - &ff_pcm_s16le_decoder, - &ff_pcm_s16le_planar_decoder, - &ff_pcm_s24be_decoder, - &ff_pcm_s24daud_decoder, - &ff_pcm_s24le_decoder, - &ff_pcm_s24le_planar_decoder, - &ff_pcm_s32be_decoder, - &ff_pcm_s32le_decoder, - &ff_pcm_s32le_planar_decoder, - &ff_pcm_s64be_decoder, - &ff_pcm_s64le_decoder, - &ff_pcm_u8_decoder, - &ff_pcm_u16be_decoder, - &ff_pcm_u16le_decoder, - &ff_pcm_u24be_decoder, - &ff_pcm_u24le_decoder, - &ff_pcm_u32be_decoder, - &ff_pcm_u32le_decoder, - &ff_pcm_vidc_decoder, - &ff_pcm_zork_decoder, - &ff_gremlin_dpcm_decoder, - &ff_interplay_dpcm_decoder, - &ff_roq_dpcm_decoder, - &ff_sol_dpcm_decoder, - &ff_xan_dpcm_decoder, - &ff_adpcm_4xm_decoder, - &ff_adpcm_adx_decoder, - &ff_adpcm_afc_decoder, - &ff_adpcm_aica_decoder, - &ff_adpcm_ct_decoder, - &ff_adpcm_dtk_decoder, - &ff_adpcm_ea_decoder, - &ff_adpcm_ea_maxis_xa_decoder, - &ff_adpcm_ea_r1_decoder, - &ff_adpcm_ea_r2_decoder, - &ff_adpcm_ea_r3_decoder, - &ff_adpcm_ea_xas_decoder, - &ff_adpcm_g722_decoder, - &ff_adpcm_g726_decoder, - &ff_adpcm_g726le_decoder, - &ff_adpcm_ima_amv_decoder, - &ff_adpcm_ima_apc_decoder, - &ff_adpcm_ima_dat4_decoder, - &ff_adpcm_ima_dk3_decoder, - &ff_adpcm_ima_dk4_decoder, - &ff_adpcm_ima_ea_eacs_decoder, - &ff_adpcm_ima_ea_sead_decoder, - &ff_adpcm_ima_iss_decoder, - &ff_adpcm_ima_oki_decoder, - &ff_adpcm_ima_qt_decoder, - &ff_adpcm_ima_rad_decoder, - &ff_adpcm_ima_smjpeg_decoder, - &ff_adpcm_ima_wav_decoder, - &ff_adpcm_ima_ws_decoder, - &ff_adpcm_ms_decoder, - &ff_adpcm_mtaf_decoder, - &ff_adpcm_psx_decoder, - &ff_adpcm_sbpro_2_decoder, - &ff_adpcm_sbpro_3_decoder, - &ff_adpcm_sbpro_4_decoder, - &ff_adpcm_swf_decoder, - &ff_adpcm_thp_decoder, - &ff_adpcm_thp_le_decoder, - &ff_adpcm_vima_decoder, - &ff_adpcm_xa_decoder, - &ff_adpcm_yamaha_decoder, - &ff_ssa_decoder, - &ff_ass_decoder, - &ff_ccaption_decoder, - &ff_dvbsub_decoder, - &ff_dvdsub_decoder, - &ff_jacosub_decoder, - &ff_microdvd_decoder, - &ff_movtext_decoder, - &ff_mpl2_decoder, - &ff_pgssub_decoder, - &ff_pjs_decoder, - &ff_realtext_decoder, - &ff_sami_decoder, - &ff_srt_decoder, - &ff_stl_decoder, - &ff_subrip_decoder, - &ff_subviewer_decoder, - &ff_subviewer1_decoder, - &ff_text_decoder, - &ff_vplayer_decoder, - &ff_webvtt_decoder, - &ff_xsub_decoder, - &ff_bintext_decoder, - &ff_xbin_decoder, - &ff_idf_decoder, - NULL }; diff --git a/build/ffmpeg/libavcodec/parser_list.c b/build/ffmpeg/libavcodec/parser_list.c deleted file mode 100644 index 020cd0969..000000000 --- a/build/ffmpeg/libavcodec/parser_list.c +++ /dev/null @@ -1,45 +0,0 @@ -static const AVCodecParser * const parser_list[] = { - &ff_aac_parser, - &ff_aac_latm_parser, - &ff_ac3_parser, - &ff_adx_parser, - &ff_av1_parser, - &ff_avs2_parser, - &ff_bmp_parser, - &ff_cavsvideo_parser, - &ff_cook_parser, - &ff_dca_parser, - &ff_dirac_parser, - &ff_dnxhd_parser, - &ff_dpx_parser, - &ff_dvaudio_parser, - &ff_dvbsub_parser, - &ff_dvdsub_parser, - &ff_dvd_nav_parser, - &ff_flac_parser, - &ff_g729_parser, - &ff_gsm_parser, - &ff_h261_parser, - &ff_h263_parser, - &ff_h264_parser, - &ff_hevc_parser, - &ff_mjpeg_parser, - &ff_mlp_parser, - &ff_mpeg4video_parser, - &ff_mpegaudio_parser, - &ff_mpegvideo_parser, - &ff_opus_parser, - &ff_png_parser, - &ff_pnm_parser, - &ff_rv30_parser, - &ff_rv40_parser, - &ff_sbc_parser, - &ff_sipr_parser, - &ff_tak_parser, - &ff_vc1_parser, - &ff_vorbis_parser, - &ff_vp3_parser, - &ff_vp8_parser, - &ff_vp9_parser, - &ff_xma_parser, - NULL }; diff --git a/build/ffmpeg/libavdevice/indev_list.c b/build/ffmpeg/libavdevice/indev_list.c deleted file mode 100644 index 03ffb4036..000000000 --- a/build/ffmpeg/libavdevice/indev_list.c +++ /dev/null @@ -1,2 +0,0 @@ -static const AVInputFormat * const indev_list[] = { - NULL }; diff --git a/build/ffmpeg/libavdevice/outdev_list.c b/build/ffmpeg/libavdevice/outdev_list.c deleted file mode 100644 index d1b87ed7b..000000000 --- a/build/ffmpeg/libavdevice/outdev_list.c +++ /dev/null @@ -1,2 +0,0 @@ -static const AVOutputFormat * const outdev_list[] = { - NULL }; diff --git a/build/ffmpeg/libavformat/demuxer_list.c b/build/ffmpeg/libavformat/demuxer_list.c deleted file mode 100644 index 5a2baedbb..000000000 --- a/build/ffmpeg/libavformat/demuxer_list.c +++ /dev/null @@ -1,287 +0,0 @@ -static const AVInputFormat * const demuxer_list[] = { - &ff_aa_demuxer, - &ff_aac_demuxer, - &ff_ac3_demuxer, - &ff_acm_demuxer, - &ff_act_demuxer, - &ff_adf_demuxer, - &ff_adp_demuxer, - &ff_ads_demuxer, - &ff_adx_demuxer, - &ff_aea_demuxer, - &ff_afc_demuxer, - &ff_aiff_demuxer, - &ff_aix_demuxer, - &ff_amr_demuxer, - &ff_amrnb_demuxer, - &ff_amrwb_demuxer, - &ff_anm_demuxer, - &ff_apc_demuxer, - &ff_ape_demuxer, - &ff_apng_demuxer, - &ff_aptx_demuxer, - &ff_aptx_hd_demuxer, - &ff_aqtitle_demuxer, - &ff_asf_demuxer, - &ff_asf_o_demuxer, - &ff_ass_demuxer, - &ff_ast_demuxer, - &ff_au_demuxer, - &ff_avi_demuxer, - &ff_avr_demuxer, - &ff_avs_demuxer, - &ff_avs2_demuxer, - &ff_bethsoftvid_demuxer, - &ff_bfi_demuxer, - &ff_bintext_demuxer, - &ff_bink_demuxer, - &ff_bit_demuxer, - &ff_bmv_demuxer, - &ff_bfstm_demuxer, - &ff_brstm_demuxer, - &ff_boa_demuxer, - &ff_c93_demuxer, - &ff_caf_demuxer, - &ff_cavsvideo_demuxer, - &ff_cdg_demuxer, - &ff_cdxl_demuxer, - &ff_cine_demuxer, - &ff_codec2_demuxer, - &ff_codec2raw_demuxer, - &ff_concat_demuxer, - &ff_data_demuxer, - &ff_daud_demuxer, - &ff_dcstr_demuxer, - &ff_dfa_demuxer, - &ff_dirac_demuxer, - &ff_dnxhd_demuxer, - &ff_dsf_demuxer, - &ff_dsicin_demuxer, - &ff_dss_demuxer, - &ff_dts_demuxer, - &ff_dtshd_demuxer, - &ff_dv_demuxer, - &ff_dvbsub_demuxer, - &ff_dvbtxt_demuxer, - &ff_dxa_demuxer, - &ff_ea_demuxer, - &ff_ea_cdata_demuxer, - &ff_eac3_demuxer, - &ff_epaf_demuxer, - &ff_ffmetadata_demuxer, - &ff_filmstrip_demuxer, - &ff_fits_demuxer, - &ff_flac_demuxer, - &ff_flic_demuxer, - &ff_flv_demuxer, - &ff_live_flv_demuxer, - &ff_fourxm_demuxer, - &ff_frm_demuxer, - &ff_fsb_demuxer, - &ff_g722_demuxer, - &ff_g723_1_demuxer, - &ff_g726_demuxer, - &ff_g726le_demuxer, - &ff_g729_demuxer, - &ff_gdv_demuxer, - &ff_genh_demuxer, - &ff_gif_demuxer, - &ff_gsm_demuxer, - &ff_gxf_demuxer, - &ff_h261_demuxer, - &ff_h263_demuxer, - &ff_h264_demuxer, - &ff_hevc_demuxer, - &ff_hls_demuxer, - &ff_hnm_demuxer, - &ff_ico_demuxer, - &ff_idcin_demuxer, - &ff_idf_demuxer, - &ff_iff_demuxer, - &ff_ilbc_demuxer, - &ff_image2_demuxer, - &ff_image2pipe_demuxer, - &ff_image2_alias_pix_demuxer, - &ff_image2_brender_pix_demuxer, - &ff_ingenient_demuxer, - &ff_ipmovie_demuxer, - &ff_ircam_demuxer, - &ff_iss_demuxer, - &ff_iv8_demuxer, - &ff_ivf_demuxer, - &ff_ivr_demuxer, - &ff_jacosub_demuxer, - &ff_jv_demuxer, - &ff_lmlm4_demuxer, - &ff_loas_demuxer, - &ff_lrc_demuxer, - &ff_lvf_demuxer, - &ff_lxf_demuxer, - &ff_m4v_demuxer, - &ff_matroska_demuxer, - &ff_mgsts_demuxer, - &ff_microdvd_demuxer, - &ff_mjpeg_demuxer, - &ff_mjpeg_2000_demuxer, - &ff_mlp_demuxer, - &ff_mlv_demuxer, - &ff_mm_demuxer, - &ff_mmf_demuxer, - &ff_mov_demuxer, - &ff_mp3_demuxer, - &ff_mpc_demuxer, - &ff_mpc8_demuxer, - &ff_mpegps_demuxer, - &ff_mpegts_demuxer, - &ff_mpegtsraw_demuxer, - &ff_mpegvideo_demuxer, - &ff_mpjpeg_demuxer, - &ff_mpl2_demuxer, - &ff_mpsub_demuxer, - &ff_msf_demuxer, - &ff_msnwc_tcp_demuxer, - &ff_mtaf_demuxer, - &ff_mtv_demuxer, - &ff_musx_demuxer, - &ff_mv_demuxer, - &ff_mvi_demuxer, - &ff_mxf_demuxer, - &ff_mxg_demuxer, - &ff_nc_demuxer, - &ff_nistsphere_demuxer, - &ff_nsp_demuxer, - &ff_nsv_demuxer, - &ff_nut_demuxer, - &ff_nuv_demuxer, - &ff_ogg_demuxer, - &ff_oma_demuxer, - &ff_paf_demuxer, - &ff_pcm_alaw_demuxer, - &ff_pcm_mulaw_demuxer, - &ff_pcm_vidc_demuxer, - &ff_pcm_f64be_demuxer, - &ff_pcm_f64le_demuxer, - &ff_pcm_f32be_demuxer, - &ff_pcm_f32le_demuxer, - &ff_pcm_s32be_demuxer, - &ff_pcm_s32le_demuxer, - &ff_pcm_s24be_demuxer, - &ff_pcm_s24le_demuxer, - &ff_pcm_s16be_demuxer, - &ff_pcm_s16le_demuxer, - &ff_pcm_s8_demuxer, - &ff_pcm_u32be_demuxer, - &ff_pcm_u32le_demuxer, - &ff_pcm_u24be_demuxer, - &ff_pcm_u24le_demuxer, - &ff_pcm_u16be_demuxer, - &ff_pcm_u16le_demuxer, - &ff_pcm_u8_demuxer, - &ff_pjs_demuxer, - &ff_pmp_demuxer, - &ff_pva_demuxer, - &ff_pvf_demuxer, - &ff_qcp_demuxer, - &ff_r3d_demuxer, - &ff_rawvideo_demuxer, - &ff_realtext_demuxer, - &ff_redspark_demuxer, - &ff_rl2_demuxer, - &ff_rm_demuxer, - &ff_roq_demuxer, - &ff_rpl_demuxer, - &ff_rsd_demuxer, - &ff_rso_demuxer, - &ff_s337m_demuxer, - &ff_sami_demuxer, - &ff_sbc_demuxer, - &ff_sbg_demuxer, - &ff_scc_demuxer, - &ff_sdr2_demuxer, - &ff_sds_demuxer, - &ff_sdx_demuxer, - &ff_segafilm_demuxer, - &ff_ser_demuxer, - &ff_shorten_demuxer, - &ff_siff_demuxer, - &ff_sln_demuxer, - &ff_smacker_demuxer, - &ff_smjpeg_demuxer, - &ff_smush_demuxer, - &ff_sol_demuxer, - &ff_sox_demuxer, - &ff_spdif_demuxer, - &ff_srt_demuxer, - &ff_str_demuxer, - &ff_stl_demuxer, - &ff_subviewer1_demuxer, - &ff_subviewer_demuxer, - &ff_sup_demuxer, - &ff_svag_demuxer, - &ff_swf_demuxer, - &ff_tak_demuxer, - &ff_tedcaptions_demuxer, - &ff_thp_demuxer, - &ff_threedostr_demuxer, - &ff_tiertexseq_demuxer, - &ff_tmv_demuxer, - &ff_truehd_demuxer, - &ff_tta_demuxer, - &ff_txd_demuxer, - &ff_tty_demuxer, - &ff_ty_demuxer, - &ff_v210_demuxer, - &ff_v210x_demuxer, - &ff_vag_demuxer, - &ff_vc1_demuxer, - &ff_vc1t_demuxer, - &ff_vivo_demuxer, - &ff_vmd_demuxer, - &ff_vobsub_demuxer, - &ff_voc_demuxer, - &ff_vpk_demuxer, - &ff_vplayer_demuxer, - &ff_vqf_demuxer, - &ff_w64_demuxer, - &ff_wav_demuxer, - &ff_wc3_demuxer, - &ff_webm_dash_manifest_demuxer, - &ff_webvtt_demuxer, - &ff_wsaud_demuxer, - &ff_wsd_demuxer, - &ff_wsvqa_demuxer, - &ff_wtv_demuxer, - &ff_wve_demuxer, - &ff_wv_demuxer, - &ff_xa_demuxer, - &ff_xbin_demuxer, - &ff_xmv_demuxer, - &ff_xvag_demuxer, - &ff_xwma_demuxer, - &ff_yop_demuxer, - &ff_yuv4mpegpipe_demuxer, - &ff_image_bmp_pipe_demuxer, - &ff_image_dds_pipe_demuxer, - &ff_image_dpx_pipe_demuxer, - &ff_image_exr_pipe_demuxer, - &ff_image_j2k_pipe_demuxer, - &ff_image_jpeg_pipe_demuxer, - &ff_image_jpegls_pipe_demuxer, - &ff_image_pam_pipe_demuxer, - &ff_image_pbm_pipe_demuxer, - &ff_image_pcx_pipe_demuxer, - &ff_image_pgmyuv_pipe_demuxer, - &ff_image_pgm_pipe_demuxer, - &ff_image_pictor_pipe_demuxer, - &ff_image_png_pipe_demuxer, - &ff_image_ppm_pipe_demuxer, - &ff_image_psd_pipe_demuxer, - &ff_image_qdraw_pipe_demuxer, - &ff_image_sgi_pipe_demuxer, - &ff_image_svg_pipe_demuxer, - &ff_image_sunrast_pipe_demuxer, - &ff_image_tiff_pipe_demuxer, - &ff_image_webp_pipe_demuxer, - &ff_image_xpm_pipe_demuxer, - &ff_image_xwd_pipe_demuxer, - NULL }; diff --git a/build/ffmpeg/libavformat/muxer_list.c b/build/ffmpeg/libavformat/muxer_list.c deleted file mode 100644 index f36d9499c..000000000 --- a/build/ffmpeg/libavformat/muxer_list.c +++ /dev/null @@ -1,2 +0,0 @@ -static const AVOutputFormat * const muxer_list[] = { - NULL }; diff --git a/build/ffmpeg/libavformat/protocol_list.c b/build/ffmpeg/libavformat/protocol_list.c deleted file mode 100644 index b9b925a4b..000000000 --- a/build/ffmpeg/libavformat/protocol_list.c +++ /dev/null @@ -1,14 +0,0 @@ -static const URLProtocol * const url_protocols[] = { - &ff_async_protocol, - &ff_cache_protocol, - &ff_concat_protocol, - &ff_crypto_protocol, - &ff_data_protocol, - &ff_file_protocol, - &ff_hls_protocol, - &ff_md5_protocol, - &ff_pipe_protocol, - &ff_prompeg_protocol, - &ff_subfile_protocol, - &ff_tee_protocol, - NULL }; diff --git a/build/ffmpeg/libavutil/avconfig.h b/build/ffmpeg/libavutil/avconfig.h deleted file mode 100644 index c289fbb55..000000000 --- a/build/ffmpeg/libavutil/avconfig.h +++ /dev/null @@ -1,6 +0,0 @@ -/* Generated by ffmpeg configure */ -#ifndef AVUTIL_AVCONFIG_H -#define AVUTIL_AVCONFIG_H -#define AV_HAVE_BIGENDIAN 0 -#define AV_HAVE_FAST_UNALIGNED 1 -#endif /* AVUTIL_AVCONFIG_H */ diff --git a/build/ffmpeg/libavutil/ffversion.h b/build/ffmpeg/libavutil/ffversion.h deleted file mode 100644 index 3322c7d0e..000000000 --- a/build/ffmpeg/libavutil/ffversion.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef AVUTIL_FFVERSION_H -#define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-74177-g802e512" -#endif /* AVUTIL_FFVERSION_H */ diff --git a/build/ffms2/ffms2.vcxproj b/build/ffms2/ffms2.vcxproj deleted file mode 100644 index a8dd49750..000000000 --- a/build/ffms2/ffms2.vcxproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - {AA137613-96A1-4388-8905-71345B4F8F87} - ffms2 - - - - - lib - - - - - - - - - - - $(FfmsSrcDir)\include; - %(AdditionalIncludeDirectories) - - - WITH_SWRESAMPLE; - FFMS_EXPORTS; - FFMS_STATIC; - _CRT_SECURE_NO_WARNINGS; - _CRT_NONSTDC_NO_DEPRECATE; - _SCL_SECURE_NO_WARNINGS; - __STDC_CONSTANT_MACROS; - %(PreprocessorDefinitions) - - 4250;%(DisableSpecificWarnings) - false - - - $(AegisubLibraryDir);%(AdditionalLibraryDirectories) - - - $(FfmsSrcDir)\include - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {f934ab7b-186b-4e96-b20c-a58c38c1b819} - - - {10f22a5a-dd9e-44a1-ba2e-2a9a7c78b0ee} - - - diff --git a/build/ffms2/ffms2.vcxproj.filters b/build/ffms2/ffms2.vcxproj.filters deleted file mode 100644 index 6e948bff6..000000000 --- a/build/ffms2/ffms2.vcxproj.filters +++ /dev/null @@ -1,126 +0,0 @@ - - - - - {ed366ac0-ef41-4c15-b40e-4db3c76b17db} - - - {a5f150b5-ae8e-448c-a724-bbdca106ea10} - - - {14a03221-39fc-4803-b677-e90f2290666b} - - - {132a91ed-71ff-4574-aba8-09d496869832} - - - {7e197647-eb8c-44bc-b6d8-6368b242478c} - - - {fab6c2c7-eeae-4009-a932-fc079402db63} - - - {8a87437e-fe04-4b74-a917-f8c108247e3f} - - - - - Audio - - - Indexing - - - Video - - - API - - - Utils - - - Avisynth - - - Avisynth - - - Avisynth - - - Avisynth - - - Video - - - VapourSynth - - - VapourSynth - - - Utils - - - Utils - - - Utils - - - Indexing - - - - - Audio - - - Indexing - - - Video - - - API - - - Utils - - - Utils - - - Avisynth - - - Avisynth - - - Avisynth - - - Avisynth - - - Video - - - VapourSynth - - - VapourSynth - - - Utils - - - Utils - - - Indexing - - - diff --git a/build/fftw/config.h b/build/fftw/config.h deleted file mode 100755 index 9b69b7c1b..000000000 --- a/build/fftw/config.h +++ /dev/null @@ -1,393 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to compile in long-double precision. */ -#undef BENCHFFT_LDOUBLE - -/* Define to compile in quad precision. */ -#undef BENCHFFT_QUAD - -/* Define to compile in single precision. */ -#undef BENCHFFT_SINGLE - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ -#undef C_ALLOCA - -/* Define to disable Fortran wrappers. */ -#define DISABLE_FORTRAN 1 - -/* Define to dummy `main' function (if any) required to link to the Fortran - libraries. */ -#undef F77_DUMMY_MAIN - -/* Define to a macro mangling the given C identifier (in lower and upper - case), which must not contain underscores, for linking with Fortran. */ -#undef F77_FUNC - -/* As F77_FUNC, but for C identifiers containing underscores. */ -#undef F77_FUNC_ - -/* Define if F77_FUNC and F77_FUNC_ are equivalent. */ -#undef F77_FUNC_EQUIV - -/* Define if F77 and FC dummy `main' functions are identical. */ -#undef FC_DUMMY_MAIN_EQ_F77 - -/* C compiler name and flags */ -#define FFTW_CC "cl" - -/* Define to enable extra FFTW debugging code. */ -#undef FFTW_DEBUG - -/* Define to enable alignment debugging hacks. */ -#undef FFTW_DEBUG_ALIGNMENT - -/* Define to enable debugging malloc. */ -#undef FFTW_DEBUG_MALLOC - -/* Define to enable the use of alloca(). */ -#undef FFTW_ENABLE_ALLOCA - -/* Define to compile in long-double precision. */ -#undef FFTW_LDOUBLE - -/* Define to compile in quad precision. */ -#undef FFTW_QUAD - -/* Define to enable pseudorandom estimate planning for debugging. */ -#undef FFTW_RANDOM_ESTIMATOR - -/* Define to compile in single precision. */ -#undef FFTW_SINGLE - -/* Define to 1 if you have the `abort' function. */ -#define HAVE_ABORT 1 - -/* Define to 1 if you have `alloca', as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define to 1 if you have and it should be used (not on Ultrix). - */ -#undef HAVE_ALLOCA_H - -/* Define to enable Altivec optimizations. */ -#undef HAVE_ALTIVEC - -/* Define to 1 if you have the header file. */ -#undef HAVE_ALTIVEC_H - -/* Define to enable AVX optimizations. */ -#undef HAVE_AVX - -/* Define to 1 if you have the `BSDgettimeofday' function. */ -#undef HAVE_BSDGETTIMEOFDAY - -/* Define to 1 if you have the `clock_gettime' function. */ -#undef HAVE_CLOCK_GETTIME - -/* Define to 1 if you have the `cosl' function. */ -#define HAVE_COSL 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_C_ASM_H - -/* Define to 1 if you have the declaration of `cosl', and to 0 if you don't. - */ -#define HAVE_DECL_COSL 1 - -/* Define to 1 if you have the declaration of `cosq', and to 0 if you don't. */ -#define HAVE_DECL_COSQ 0 - -/* Define to 1 if you have the declaration of `drand48', and to 0 if you don't. */ -#define HAVE_DECL_DRAND48 0 - -/* Define to 1 if you have the declaration of `memalign', and to 0 if you don't. */ -#define HAVE_DECL_MEMALIGN 0 - -/* Define to 1 if you have the declaration of `posix_memalign', and to 0 if you don't. */ -#define HAVE_DECL_POSIX_MEMALIGN 0 - -/* Define to 1 if you have the declaration of `sinl', and to 0 if you don't. */ -#define HAVE_DECL_SINL 1 - -/* Define to 1 if you have the declaration of `sinq', and to 0 if you don't. - */ -#define HAVE_DECL_SINQ 0 - -/* Define to 1 if you have the declaration of `srand48', and to 0 if you - don't. */ -#define HAVE_DECL_SRAND48 0 - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the `drand48' function. */ -#undef HAVE_DRAND48 - -/* Define if you have a machine with fused multiply-add */ -#undef HAVE_FMA - -/* Define to 1 if you have the `gethrtime' function. */ -#undef HAVE_GETHRTIME - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if hrtime_t is defined in */ -#undef HAVE_HRTIME_T - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTRINSICS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define if the isnan() function/macro is available. */ -#undef HAVE_ISNAN - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBINTL_H - -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - -/* Define to 1 if you have the `quadmath' library (-lquadmath). */ -#undef HAVE_LIBQUADMATH - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if the compiler supports `long double' */ -#define HAVE_LONG_DOUBLE 1 - -/* Define to 1 if you have the `mach_absolute_time' function. */ -#undef HAVE_MACH_ABSOLUTE_TIME - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACH_MACH_TIME_H - -/* Define to 1 if you have the header file. */ -#define HAVE_MALLOC_H 1 - -/* Define to 1 if you have the `memalign' function. */ -#undef HAVE_MEMALIGN - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `memset' function. */ -#define HAVE_MEMSET 1 - -/* Define to enable MIPS paired-single optimizations. */ -#undef HAVE_MIPS_PS - -/* Define to enable use of MIPS ZBus cycle-counter. */ -#undef HAVE_MIPS_ZBUS_TIMER - -/* Define if you have the MPI library. */ -#undef HAVE_MPI - -/* Define if OpenMP is enabled */ -#define HAVE_OPENMP 1 - -/* Define to 1 if you have the `posix_memalign' function. */ -#undef HAVE_POSIX_MEMALIGN - -/* Define if you have POSIX threads libraries and header files. */ -#undef HAVE_PTHREAD - -/* Define to 1 if you have the `read_real_time' function. */ -#undef HAVE_READ_REAL_TIME - -/* Define to 1 if you have the `sinl' function. */ -#define HAVE_SINL 1 - -/* Define to 1 if you have the `snprintf' function. */ -#undef HAVE_SNPRINTF - -/* Define to 1 if you have the `sqrt' function. */ -#define HAVE_SQRT 1 - -/* Define to enable SSE/SSE2 optimizations. */ -#define HAVE_SSE2 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `sysctl' function. */ -#undef HAVE_SYSCTL - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the `tanl' function. */ -#define HAVE_TANL 1 - -/* Define if we have a threads library. */ -#undef HAVE_THREADS - -/* Define to 1 if you have the `time_base_to_time' function. */ -#undef HAVE_TIME_BASE_TO_TIME - -/* Define to 1 if the system has the type `uintptr_t'. */ -#define HAVE_UINTPTR_T 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vprintf' function. */ -#define HAVE_VPRINTF 1 - -/* Define to 1 if you have the `_mm_free' function. */ -#undef HAVE__MM_FREE - -/* Define to 1 if you have the `_mm_malloc' function. */ -#undef HAVE__MM_MALLOC - -/* Define if you have the UNICOS _rtc() intrinsic. */ -#undef HAVE__RTC - -/* 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 - -/* Name of package */ -#define PACKAGE "fftw" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "fftw@fftw.org" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "fftw" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "fftw-3.3" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "fftw" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "http://www.fftw.org" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "3.3" - -/* Define to necessary symbol if this constant uses a non-standard name on - your system. */ -#undef PTHREAD_CREATE_JOINABLE - -/* The size of `double', as computed by sizeof. */ -#define SIZEOF_DOUBLE 8 - -/* The size of `fftw_r2r_kind', as computed by sizeof. */ -#undef SIZEOF_FFTW_R2R_KIND - -/* The size of `float', as computed by sizeof. */ -#define SIZEOF_FLOAT 4 - -/* The size of `int', as computed by sizeof. */ -#define SIZEOF_INT 4 - -/* The size of `long', as computed by sizeof. */ -#define SIZEOF_LONG 4 - -/* The size of `long long', as computed by sizeof. */ -#define SIZEOF_LONG_LONG 8 - -/* The size of `MPI_Fint', as computed by sizeof. */ -#undef SIZEOF_MPI_FINT - -/* The size of `ptrdiff_t', as computed by sizeof. */ -#define SIZEOF_PTRDIFF_T 4 - -/* The size of `size_t', as computed by sizeof. */ -#define SIZEOF_SIZE_T 4 - -/* The size of `unsigned int', as computed by sizeof. */ -#define SIZEOF_UNSIGNED_INT 4 - -/* The size of `unsigned long', as computed by sizeof. */ -#define SIZEOF_UNSIGNED_LONG 4 - -/* The size of `unsigned long long', as computed by sizeof. */ -#define SIZEOF_UNSIGNED_LONG_LONG 8 - -/* The size of `void *', as computed by sizeof. */ -#define SIZEOF_VOID_P 4 - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at runtime. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -#undef STACK_DIRECTION - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define if we have and are using POSIX threads. */ -#undef USING_POSIX_THREADS - -/* Version number of package */ -#define VERSION "3.3" - -/* Use common Windows Fortran mangling styles for the Fortran interfaces. */ -#undef WINDOWS_F77_MANGLING - -/* Include g77-compatible wrappers in addition to any other Fortran wrappers. - */ -#undef WITH_G77_WRAPPERS - -/* Use our own aligned malloc routine; mainly helpful for Windows systems - lacking aligned allocation system-library routines. */ -#define WITH_OUR_MALLOC 1 - -/* Use low-precision timers, making planner very slow */ -#undef WITH_SLOW_TIMER - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#define inline __inline -#endif - -/* Define to `unsigned int' if does not define. */ -#undef size_t diff --git a/build/fftw/fftw.vcxproj b/build/fftw/fftw.vcxproj deleted file mode 100644 index d33267b42..000000000 --- a/build/fftw/fftw.vcxproj +++ /dev/null @@ -1,677 +0,0 @@ - - - - {EA3DCC95-2423-4EA0-A508-7A427B4C0594} - fftw - - - - - lib - - - - - - - - - - - $(FftwSrcDir)\; - $(FftwSrcDir)\api; - $(FftwSrcDir)\kernel; - $(FftwSrcDir)\dft; - $(FftwSrcDir)\dft\simd; - $(FftwSrcDir)\dft\scalar; - $(FftwSrcDir)\rdft; - $(FftwSrcDir)\rdft\simd; - $(FftwSrcDir)\rdft\scalar; - $(FftwSrcDir)\reodft; - $(FftwSrcDir)\simd-support; - $(FftwSrcDir)\threads; - $(MSBuildThisFileDirectory); - %(AdditionalIncludeDirectories) - - StreamingSIMDExtensions2 - true - Default - $(FftwSrcDir) - - - $(FftwSrcDir)\api - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/fftw/fftw.vcxproj.filters b/build/fftw/fftw.vcxproj.filters deleted file mode 100644 index 94f248c47..000000000 --- a/build/fftw/fftw.vcxproj.filters +++ /dev/null @@ -1,1937 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {3dd1ffe6-144b-43e1-8a12-fb7f8aafb1e2} - - - {da4b7e4d-80be-454f-bfc7-1b2c1166c53e} - - - {f0807dd9-20c0-4fbd-8628-cee199b26f80} - - - {b2393625-a2c0-4936-a3fe-af75442e1b88} - - - {07faef18-6f66-4a44-af6c-7147c0f36a05} - - - {8ed8b906-1abd-4a9c-96a1-ade012dcffa9} - - - {d74e2c56-219c-4720-a426-3af6711fff69} - - - {6259dc8b-53b4-4a22-b39a-bf803ceb5678} - - - {e2e67124-a7eb-4f3e-af46-2b104ff6b27c} - - - {e1e8f092-fc93-41bc-b81d-6cb49c8e3d70} - - - {b14b7826-b537-4773-ab25-01b0b6d3b3f2} - - - {c39e48d8-19e1-4029-b066-9ea7de26dd9e} - - - {d36658fc-ec66-4810-8e07-4b62cc98fd67} - - - {1fb426ff-71da-4196-9b6a-4cd5b0996ac0} - - - {ea0ee65f-3857-436a-877e-65585dc398b7} - - - {49fa6be1-8f5c-4f77-a35b-337d7affb158} - - - {a004fba2-72cd-4762-b21e-7982b7801d79} - - - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - diff --git a/build/freetype2/freetype.vcxproj b/build/freetype2/freetype.vcxproj deleted file mode 100644 index fdb8fbdf4..000000000 --- a/build/freetype2/freetype.vcxproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} - freetype - - - - - lib - - - - - - - - - - $(Freetype2SrcDir)\include;%(AdditionalIncludeDirectories) - _LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) - true - true - 4001 - - - 0x0409 - - - $(Freetype2SrcDir)\include - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/freetype2/freetype.vcxproj.filters b/build/freetype2/freetype.vcxproj.filters deleted file mode 100644 index 9787c9d06..000000000 --- a/build/freetype2/freetype.vcxproj.filters +++ /dev/null @@ -1,152 +0,0 @@ - - - - - {b4c15893-ec11-491d-9507-0ac184f9cc78} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {4d3e4eff-3fbc-4b20-b413-2743b23b7109} - - - {e6cf6a0f-0404-4024-8bf8-ff5b29f35657} - h;hpp;hxx;hm;inl - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - diff --git a/build/freetype2/ftsystem.cpp b/build/freetype2/ftsystem.cpp deleted file mode 100644 index c380bb058..000000000 --- a/build/freetype2/ftsystem.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2014, Thomas Goyne -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// Aegisub Project http://www.aegisub.org/ - -// The non-unix version of ftsystem.c uses stdio functions, but freetype uses -// streams as if they had mmap's performance characteristics (as it uses mmap -// on unix), which results in mind-blowingly poor performance (35%+ of the -// fontconfig caching runtime is spent on fseek). - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_SYSTEM_H -#include FT_ERRORS_H - -#include -#include - -extern "C" FT_Error FT_Stream_Open(FT_Stream stream, const char *filepathname) { - if (!stream) - return FT_THROW(Invalid_Stream_Handle); - - stream->descriptor.pointer = nullptr; - stream->pathname.pointer = const_cast(filepathname); - stream->base = nullptr; - stream->pos = 0; - stream->read = nullptr; - stream->close = nullptr; - - std::wstring_convert, wchar_t> converter; - std::ifstream file(converter.from_bytes(filepathname), std::ios::binary); - if (!file.good()) - return FT_THROW(Cannot_Open_Resource); - - file.seekg(0, std::ios::end); - stream->size = (unsigned long)file.tellg(); - if (!stream->size) - return FT_THROW(Cannot_Open_Stream); - file.seekg(0, std::ios::beg); - - stream->base = (unsigned char *)malloc(stream->size); - file.read((char *)stream->base, stream->size); - - stream->close = [](FT_Stream stream) { - free(stream->base); - stream->size = 0; - stream->base = nullptr; - }; - - return FT_Err_Ok; -} - -extern "C" FT_Memory FT_New_Memory() { - return new FT_MemoryRec_{ - nullptr, - [](FT_Memory, long size) { return malloc(size); }, - [](FT_Memory, void *ptr) { free(ptr); }, - [](FT_Memory, long, long size, void *ptr) { return realloc(ptr, size); }}; -} - -extern "C" void FT_Done_Memory(FT_Memory memory) { - delete memory; -} diff --git a/build/fribidi/fribidi-config.h b/build/fribidi/fribidi-config.h deleted file mode 100644 index 43af643a9..000000000 --- a/build/fribidi/fribidi-config.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef FRIBIDI_CONFIG_H -#define FRIBIDI_CONFIG_H - -#define FRIBIDI "fribidi" -#define FRIBIDI_NAME "GNU FriBidi" -#define FRIBIDI_BUGREPORT "http://bugs.freedesktop.org/enter_bug.cgi?product=fribidi" - -#define FRIBIDI_VERSION "0.19.6" -#define FRIBIDI_MAJOR_VERSION 0 -#define FRIBIDI_MINOR_VERSION 19 -#define FRIBIDI_MICRO_VERSION 6 -#define FRIBIDI_INTERFACE_VERSION 3 -#define FRIBIDI_INTERFACE_VERSION_STRING "3" - -#define FRIBIDI_CHARSETS 0 -#define FRIBIDI_USE_GLIB 0 -#define FRIBIDI_SIZEOF_INT 4 -#define HAVE_STDLIB_H 1 -#define USE_SIMPLE_MALLOC 1 - -#define HAVE_STRINGIZE 1 -#endif diff --git a/build/fribidi/fribidi.vcxproj b/build/fribidi/fribidi.vcxproj deleted file mode 100644 index 860a6767d..000000000 --- a/build/fribidi/fribidi.vcxproj +++ /dev/null @@ -1,64 +0,0 @@ - - - - {FB8E8D19-A4D6-4181-943C-282075F49B41} - fribidi - lib - - - - - - - - - - - - $(FribidiSrcDir)\lib; - $(MSBuildThisFileDirectory); - %(AdditionalIncludeDirectories) - - - FRIBIDI_ENTRY=; - %(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - $(FribidiSrcDir)\lib - - - $(MSBuildThisFileDirectory) - - - diff --git a/build/fribidi/fribidi.vcxproj.filters b/build/fribidi/fribidi.vcxproj.filters deleted file mode 100644 index c9768c8a5..000000000 --- a/build/fribidi/fribidi.vcxproj.filters +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/build/googletest/googletest.vcxproj b/build/googletest/googletest.vcxproj deleted file mode 100644 index ff7e14560..000000000 --- a/build/googletest/googletest.vcxproj +++ /dev/null @@ -1,62 +0,0 @@ - - - - {FBE51B37-8B12-41E8-B5E0-F00A06B4BCD2} - googletest - - - - - lib - - - - - - - - - - GTEST_HAS_TR1_TUPLE=0; - %(PreprocessorDefinitions) - - - $(GtestSrcDir); - %(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/googletest/googletest.vcxproj.filters b/build/googletest/googletest.vcxproj.filters deleted file mode 100644 index 883838a26..000000000 --- a/build/googletest/googletest.vcxproj.filters +++ /dev/null @@ -1,97 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {ad1eaa10-1448-406d-924c-ec1a608cec0b} - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files\internal - - - Header Files\internal - - - Header Files\internal - - - Header Files\internal - - - Header Files\internal - - - Header Files\internal - - - Header Files\internal - - - Header Files\internal - - - Header Files\internal - - - Header Files\internal - - - - - Header Files - - - Header Files\internal - - - Header Files\internal - - - Header Files\internal - - - - - Source Files - - - diff --git a/build/hunspell/hunspell.vcxproj b/build/hunspell/hunspell.vcxproj deleted file mode 100644 index 0de22503f..000000000 --- a/build/hunspell/hunspell.vcxproj +++ /dev/null @@ -1,56 +0,0 @@ - - - - {CC791693-6B28-40AC-879D-64A6C16468E3} - hunspell - - - - - lib - ..\..\vendor\hunspell\src\ - - - - - - - - - HUNSPELL_STATIC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - $(SrcDir)win_api;$(SrcDir)hunspell;%(AdditionalIncludeDirectories) - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/hunspell/hunspell.vcxproj.filters b/build/hunspell/hunspell.vcxproj.filters deleted file mode 100644 index fdb464513..000000000 --- a/build/hunspell/hunspell.vcxproj.filters +++ /dev/null @@ -1,92 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/build/icu/icu.vcxproj b/build/icu/icu.vcxproj deleted file mode 100644 index 602b7e3e9..000000000 --- a/build/icu/icu.vcxproj +++ /dev/null @@ -1,703 +0,0 @@ - - - - {F934AB7B-186B-4E96-B20C-A58C38C1B818} - icu - lib - true - - - - - - - - - - - - $(IcuSrcDir)\common; - $(IcuSrcDir)\common\unicode; - $(IcuSrcDir)\i18n; - $(IcuSrcDir)\i18n\unicode; - %(AdditionalIncludeDirectories) - - - U_ENABLE_DYLOAD=0; - U_CHECK_DYLOAD=0; - UCONFIG_NO_FILE_IO=1; - UCONFIG_NO_LEGACY_CONVERSION=1; - U_CHARSET_IS_UTF8=1; - UCONFIG_NO_IDNA=1; - UCONFIG_NO_FORMATTING=1; - UCONFIG_NO_TRANSLITERATION=1; - - U_ATTRIBUTE_DEPRECATED=; - _CRT_SECURE_NO_DEPRECATE; - U_COMMON_IMPLEMENTATION; - U_I18N_IMPLEMENTATION; - %(PreprocessorDefinitions) - - - - - - - $(AegisubBinaryDir)luajit-minilua$(AegisubPlatformSuffix) - $(MSBuildThisFileDirectory)pack-dt.lua - icudt53l - MultiByte - - - - - - - - - - - - - - - - $(IcuSrcDir)\i18n - - - $(IcuSrcDir)\common - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - false - - - - false - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - false - - - false - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - false - - - false - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {fcaed410-90ef-4ef9-916c-4b86dc13a3cf} - - - diff --git a/build/icu/icu.vcxproj.filters b/build/icu/icu.vcxproj.filters deleted file mode 100644 index d638dafec..000000000 --- a/build/icu/icu.vcxproj.filters +++ /dev/null @@ -1,1744 +0,0 @@ - - - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - common - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - i18n - - - - - {12edb004-4c5b-4b0d-ae85-3dd475dbb4c3} - - - {7d3ae04e-88bb-462a-8923-eb7438de142e} - - - diff --git a/build/icu/pack-dt.lua b/build/icu/pack-dt.lua deleted file mode 100644 index 0e95ed1e7..000000000 --- a/build/icu/pack-dt.lua +++ /dev/null @@ -1,47 +0,0 @@ --- Copyright (c) 2014, Thomas Goyne --- --- Permission to use, copy, modify, and distribute this software for any --- purpose with or without fee is hereby granted, provided that the above --- copyright notice and this permission notice appear in all copies. --- --- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --- --- Aegisub Project http://www.aegisub.org/ - -local ICU_VERSION = 'icudt53' - -local function try_open(filename, mode) - local file, err = io.open(filename, mode) - if not file then - io.stdout:write(string.format('Failed to open "%s": %s\n', filename, err)) - os.exit(1) - end - return file -end - -local icu_root, out_path = ... - -local infile = try_open(string.format('%s/data/in/%sl.dat', icu_root, ICU_VERSION), 'rb') -local outfile = try_open(out_path, 'w') - -outfile:write("const unsigned char " .. ICU_VERSION .. "_dat[] = {") - -local len = 0 -while true do - local bytes = infile:read(65536) - if not bytes then break end - - for i = 1, #bytes do - if len > 0 then outfile:write(',') end - outfile:write(string.format('%d', bytes:byte(i))) - len = len + 1 - end -end -outfile:write('};\n') - diff --git a/build/install.targets b/build/install.targets deleted file mode 100644 index 818536fbb..000000000 --- a/build/install.targets +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/build/libaegisub/libaegisub.vcxproj b/build/libaegisub/libaegisub.vcxproj deleted file mode 100644 index a431eb5eb..000000000 --- a/build/libaegisub/libaegisub.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - {BB3FED86-DB7A-4DC7-964A-260FB86CDE61} - libaegisub - - - - lib - ..\..\libaegisub\ - - - - - - - - - $(WindowsSDK_IncludePath); - $(SrcDir); - $(SrcDir)include; - %(AdditionalIncludeDirectories) - - - NOMINMAX; - _WIN32_WINNT=0x0602; - _CRT_NONSTDC_NO_DEPRECATE; - WITH_UCHARDET; - %(PreprocessorDefinitions) - - Use - lagi_pre.h - lagi_pre.h - $(SrcDir) - - - - - - - {a649d828-a399-4d81-adef-94cfdba7847f} - - - {f934ab7b-186b-4e96-b20c-a58c38c1b818} - - - {965054d2-44f2-4eb2-9879-051cc3d7ef08} - - - {A7A30702-8162-4E1A-A010-EF51B590C121} - - - {5391a8b1-9c70-4dc4-92ad-d3e34c6b803f} - - - {7b56955d-5162-4698-aa5b-47484edc8783} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create - lagi_pre.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NotUsing - - - - - - - - - - - - - - - - - diff --git a/build/libaegisub/libaegisub.vcxproj.filters b/build/libaegisub/libaegisub.vcxproj.filters deleted file mode 100644 index 157c48198..000000000 --- a/build/libaegisub/libaegisub.vcxproj.filters +++ /dev/null @@ -1,388 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {4084442f-51e9-4c31-8d5a-c825e076c012} - - - {1d2e187a-1681-4c30-8912-a4b5a5d0ab9d} - - - {c97bd8a3-ebb7-4c43-9ca0-4ab8479d9388} - - - {ce495b25-1630-42e1-8ab0-053c313448f0} - - - {2cf3ad94-e8a9-4a89-b47e-29523d90fd08} - - - {fce4f3aa-dc34-44fe-9a6a-99b0914e3436} - - - {5af331b5-ea1f-493f-abf9-f5912e2350df} - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - cajun - - - cajun - - - cajun - - - cajun - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - ASS - - - ASS - - - ASS - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - ASS - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Lua - - - Lua - - - Lua\Modules - - - Lua - - - Lua - - - Header Files - - - Audio - - - - - Source Files - - - Source Files\Windows - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Source Files\Windows - - - Source Files\Windows - - - Source Files\Common - - - Source Files\Common - - - Source Files\Windows - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Source Files\Windows - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - cajun - - - cajun - - - cajun - - - ASS - - - ASS - - - ASS - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Source Files\Windows - - - Source Files\Windows - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Source Files\Common - - - Lua - - - Lua - - - Lua\Modules - - - Lua\Modules - - - Lua\Modules - - - Lua - - - Lua\Modules - - - Source Files\Common - - - Audio - - - Audio - - - Audio - - - Audio - - - Audio - - - Audio - - - Audio - - - - - Header Files - - - diff --git a/build/libass/config.h b/build/libass/config.h deleted file mode 100644 index d2fc12117..000000000 --- a/build/libass/config.h +++ /dev/null @@ -1,6 +0,0 @@ -#define _CRT_SECURE_NO_WARNINGS -#define _CRT_NONSTDC_NO_DEPRECATE - -#define CONFIG_ASM 1 -#define CONFIG_RASTERIZER 1 -#define CONFIG_DIRECTWRITE 1 diff --git a/build/libass/dirent.h b/build/libass/dirent.h deleted file mode 100644 index fcbd0289b..000000000 --- a/build/libass/dirent.h +++ /dev/null @@ -1,6 +0,0 @@ -// libass uses dirent in a function we don't use, so just provide a dummy version -typedef struct DIR { int dummy; } DIR; -typedef struct dirent { char *d_name; } dirent; -static inline DIR *opendir(const char *x) { return 0; } -static inline struct dirent *readdir(DIR *x) { return 0; } -static inline void closedir(DIR *x) { } diff --git a/build/libass/libass.vcxproj b/build/libass/libass.vcxproj deleted file mode 100644 index cf21877c8..000000000 --- a/build/libass/libass.vcxproj +++ /dev/null @@ -1,120 +0,0 @@ - - - - {8804F253-DA67-4CC4-926B-0CD2AEE5778D} - libass - - - - - lib - - - - - - - - - - - - - - $(LibassSrcDir)\libass; - $(MSBuildThisFileDirectory); - $(FribidiSrcDir)\fribidi; - %(AdditionalIncludeDirectories) - - - inline=__inline; - FRIBIDI_ENTRY=; - _USE_MATH_DEFINES=; - %(PreprocessorDefinitions) - - - - $(LibassSrcDir)\libass - ass\ - - - %(Config) -DARCH_X86_64=0 -DPREFIX -DHAVE_ALIGNED_STACK=0 -DHAVE_CPUNOP=1 - %(Config) -DARCH_X86_64=1 -DHAVE_ALIGNED_STACK=1 -DHAVE_CPUNOP=1 - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {78b079bd-9fc7-4b9e-b4a6-96da0f00248b} - - - {fb8e8d19-a4d6-4181-943c-282075f49b41} - - - diff --git a/build/libass/libass.vcxproj.filters b/build/libass/libass.vcxproj.filters deleted file mode 100644 index 9623c769c..000000000 --- a/build/libass/libass.vcxproj.filters +++ /dev/null @@ -1,176 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {56793734-89BD-4b04-88EB-625FBE52EBFB} - asm - - - - - Assembly Files - - - Assembly Files - - - Assembly Files - - - Assembly Files - - - Assembly Files - - - Assembly Files - - - Assembly Files - - - Assembly Files - - - Assembly Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/build/libass/strings.h b/build/libass/strings.h deleted file mode 100644 index 8279fd78d..000000000 --- a/build/libass/strings.h +++ /dev/null @@ -1,3 +0,0 @@ -#define strncasecmp _strnicmp -#define strcasecmp _stricmp - diff --git a/build/libass/unistd.h b/build/libass/unistd.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/libiconv/libiconv.vcxproj b/build/libiconv/libiconv.vcxproj deleted file mode 100644 index 712551531..000000000 --- a/build/libiconv/libiconv.vcxproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - {965054D2-44F2-4EB2-9879-051CC3D7EF08} - libiconv - - - - - lib - ..\..\vendor\iconv\ - - - - - - - - - $(SrcDir)include;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - CompileAsC - - - $(SrcDir)include - - - - - - - - - - - - - - - - - - - diff --git a/build/libiconv/libiconv.vcxproj.filters b/build/libiconv/libiconv.vcxproj.filters deleted file mode 100644 index 4e4a8972b..000000000 --- a/build/libiconv/libiconv.vcxproj.filters +++ /dev/null @@ -1,42 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - diff --git a/build/libpng/libpng.vcxproj b/build/libpng/libpng.vcxproj deleted file mode 100644 index 9d57ff478..000000000 --- a/build/libpng/libpng.vcxproj +++ /dev/null @@ -1,64 +0,0 @@ - - - - {5CABCBEF-E79A-4D27-94A5-CF4EAAF1DD96} - libpng - - - - - lib - ..\..\vendor\wxWidgets\src\png\ - - - - - - - - - {10f22a5a-dd9e-44a1-ba2e-2a9a7c78b0ee} - - - - - - $(SrcDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/libpng/libpng.vcxproj.filters b/build/libpng/libpng.vcxproj.filters deleted file mode 100644 index 355924ee7..000000000 --- a/build/libpng/libpng.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/build/libresrc/libresrc.vcxproj b/build/libresrc/libresrc.vcxproj deleted file mode 100644 index 5a5fafee1..000000000 --- a/build/libresrc/libresrc.vcxproj +++ /dev/null @@ -1,75 +0,0 @@ - - - - {BD00D65F-24DA-4784-8860-3B972EA125FC} - libresrc - - - - - lib - $(MSBuildThisFileDirectory)..\..\src\libresrc\ - - - - - - - - - _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - - - - - - - - - - - - {0518d6c0-7bf6-4fd1-91fb-191bd10db2ac} - - - {fcaed410-90ef-4ef9-916c-4b86dc13a3cf} - - - {5cabcbef-e79a-4d27-94a5-cf4eaaf1dd96} - - - - - - - default_config - $(SrcDir) - - - bitmap - $(SrcDir) - - - - - - - - - - - - - - - - - - - diff --git a/build/libresrc/libresrc.vcxproj.filters b/build/libresrc/libresrc.vcxproj.filters deleted file mode 100644 index 9cedcca48..000000000 --- a/build/libresrc/libresrc.vcxproj.filters +++ /dev/null @@ -1,50 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - diff --git a/build/luabins/luabins.vcxproj b/build/luabins/luabins.vcxproj deleted file mode 100644 index ef162ac35..000000000 --- a/build/luabins/luabins.vcxproj +++ /dev/null @@ -1,51 +0,0 @@ - - - - {A7A30702-8162-4E1A-A010-EF51B590C121} - luabins - - - - - lib - ..\..\vendor\luabins\src\ - - - - - - - - - _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - $(SrcDir)..\..\lua51\src;%(AdditionalIncludeDirectories) - - - - - - - {5391a8b1-9c70-4dc4-92ad-d3e34c6b803f} - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/luabins/luabins.vcxproj.filters b/build/luabins/luabins.vcxproj.filters deleted file mode 100644 index 67677205b..000000000 --- a/build/luabins/luabins.vcxproj.filters +++ /dev/null @@ -1,57 +0,0 @@ - - - - - {0A33FF05-970D-49a7-B722-73E8EA350084} - - - {2C50401A-5AC6-4630-B633-DFCC190306A8} - - - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - Source - - - - - Headers - - - Headers - - - Headers - - - Headers - - - Headers - - - Headers - - - Headers - - - diff --git a/build/luajit-buildvm/luajit-buildvm.vcxproj b/build/luajit-buildvm/luajit-buildvm.vcxproj deleted file mode 100644 index 3132e2ab4..000000000 --- a/build/luajit-buildvm/luajit-buildvm.vcxproj +++ /dev/null @@ -1,79 +0,0 @@ - - - - {7CA6A4EB-A11B-4975-8F3A-F633111C6213} - luajitbuildvm - - - - - exe - ..\..\vendor\luajit\ - - - - - - - - $(ProjectDir) - luajit-buildvm$(AegisubPlatformSuffix) - - - - - _CRT_SECURE_NO_WARNINGS; - LUAJIT_ENABLE_LUA52COMPAT; - %(PreprocessorDefinitions) - - - $(AegisubObjectDir); - $(SrcDir)dynasm; - $(SrcDir)src; - $(SrcDir)src/host; - %(AdditionalIncludeDirectories) - - - - $(AegisubLibraryDir);%(AdditionalLibraryDirectories) - Console - - - - - - $(AegisubBinaryDir)luajit-minilua$(AegisubPlatformSuffix) - -D P64 - - - - - - - - - - - - - - - - - - - - - {fcaed410-90ef-4ef9-916c-4b86dc13a3cf} - - - diff --git a/build/luajit-buildvm/luajit-buildvm.vcxproj.filters b/build/luajit-buildvm/luajit-buildvm.vcxproj.filters deleted file mode 100644 index e9cb57b99..000000000 --- a/build/luajit-buildvm/luajit-buildvm.vcxproj.filters +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/build/luajit-minilua/luajit-minilua.vcxproj b/build/luajit-minilua/luajit-minilua.vcxproj deleted file mode 100644 index f27dbca75..000000000 --- a/build/luajit-minilua/luajit-minilua.vcxproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - {FCAED410-90EF-4EF9-916C-4B86DC13A3CF} - luajitminilua - - - - - exe - - - - - - - - $(ProjectDir) - luajit-minilua$(AegisubPlatformSuffix) - - - - _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - $(AegisubLibraryDir);%(AdditionalLibraryDirectories) - Console - - - - - - - - diff --git a/build/luajit-minilua/luajit-minilua.vcxproj.filters b/build/luajit-minilua/luajit-minilua.vcxproj.filters deleted file mode 100644 index 5243cbd1d..000000000 --- a/build/luajit-minilua/luajit-minilua.vcxproj.filters +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/build/luajit/luajit.vcxproj b/build/luajit/luajit.vcxproj deleted file mode 100644 index 58a34500d..000000000 --- a/build/luajit/luajit.vcxproj +++ /dev/null @@ -1,234 +0,0 @@ - - - - {5391A8B1-9C70-4DC4-92AD-D3E34C6B803F} - luajit - - - - - lib - ..\..\vendor\luajit\ - - - - - - - - - - _CRT_SECURE_NO_WARNINGS; - LUAJIT_ENABLE_LUA52COMPAT; - %(PreprocessorDefinitions) - - $(AegisubObjectDir);%(AdditionalIncludeDirectories) - - - $(SrcDir)include - - - - - - $(AegisubBinaryDir)luajit-buildvm$(AegisubPlatformSuffix) - - BuildVM; - ComputeLibDefNames; - BuildLibDefs; - $(BuildCompileTargets) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {7ca6a4eb-a11b-4975-8f3a-f633111c6213} - - - diff --git a/build/luajit/luajit.vcxproj.filters b/build/luajit/luajit.vcxproj.filters deleted file mode 100644 index 59e9479a1..000000000 --- a/build/luajit/luajit.vcxproj.filters +++ /dev/null @@ -1,447 +0,0 @@ - - - - - {dfbe0704-0805-42a9-b221-0eb02d38e473} - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - - - {46f51bca-6fac-4e83-b18b-5e8145f11f3c} - - - {947aec3e-b05b-404f-bd0d-27dfec92f4d0} - - - {5877d6d7-abc5-4e4d-9c16-64ae7538072e} - - - - - - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - Core - - - - - Headers - - - Headers - - - Headers - - - Headers - - - Headers - - - Headers - - - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - Internal headers - - - - - Standard library - - - Standard library - - - Standard library - - - Standard library - - - Standard library - - - Standard library - - - Standard library - - - Standard library - - - Standard library - - - Standard library - - - Standard library - - - Standard library - - - Standard library - - - - - JIT - - - JIT - - - JIT - - - JIT - - - JIT - - - JIT - - - JIT - - - JIT - - - JIT - - - JIT - - - JIT - - - diff --git a/build/paths.props b/build/paths.props deleted file mode 100644 index cc6e5d677..000000000 --- a/build/paths.props +++ /dev/null @@ -1,25 +0,0 @@ - - - - <_PropertySheetDisplayName>Path definitions - - - - - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\')) - - $(AegisubSourceBase)vendor\ - - $(AegisubSourceBase) - - $(AegisubOutputBase)bin\ - - $(AegisubOutputBase)lib\$(Platform)\$(Configuration)\ - - $(AegisubOutputBase)obj\$(ProjectName)-$(Platform)-$(Configuration)\ - - $(PlatformArchitecture)d - $(PlatformArchitecture) - (unk) - - diff --git a/build/respack.targets b/build/respack.targets deleted file mode 100644 index 5d8cf0194..000000000 --- a/build/respack.targets +++ /dev/null @@ -1,27 +0,0 @@ - - - - $(AegisubBinaryDir)luajit-minilua$(AegisubPlatformSuffix) - $(AegisubSourceBase)tools\respack.lua - - - - - - - - - - diff --git a/build/scintilla/catalogue.cpp b/build/scintilla/catalogue.cpp deleted file mode 100644 index a424dcd50..000000000 --- a/build/scintilla/catalogue.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// A dummy replacement for Catalogue.cxx that doesn't support any lexers - -#include - -#include "ILexer.h" -#include "LexerModule.h" -#include "Catalogue.h" - -const LexerModule *Catalogue::Find(int language) { return nullptr; } -const LexerModule *Catalogue::Find(const char *languageName) { return nullptr; } -void Catalogue::AddLexerModule(LexerModule *plm) { } -int Scintilla_LinkLexers() { return 1; } - diff --git a/build/scintilla/scintilla.vcxproj b/build/scintilla/scintilla.vcxproj deleted file mode 100644 index 70c1b6e27..000000000 --- a/build/scintilla/scintilla.vcxproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - {D6EA54FD-F15C-42F6-929B-A83F299A4582} - scintilla - - - - - lib - ..\..\vendor\wxWidgets\src\stc\scintilla - - - - - - - - - $(SrcDir)\include\;$(SrcDir)\lexlib\;$(SrcDir)\src\;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_WARNINGS;__WX__;PreprocessorDefinitions) - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/scintilla/scintilla.vcxproj.filters b/build/scintilla/scintilla.vcxproj.filters deleted file mode 100644 index 355924ee7..000000000 --- a/build/scintilla/scintilla.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/build/standard-outdirs.props b/build/standard-outdirs.props deleted file mode 100644 index ba4f2b275..000000000 --- a/build/standard-outdirs.props +++ /dev/null @@ -1,68 +0,0 @@ - - - - <_PropertySheetDisplayName>Output directories - - - - $(AegisubBinaryDir) - $(AegisubBinaryDir) - $(AegisubLibraryDir) - $(AegisubObjectDir) - $(ProjectName)_$(AegisubPlatformSuffix) - $(ProjectName)$(AegisubPlatformSuffix) - $(ProjectName) - - - - - - - $(AegisubBinaryDir)$(TargetName)$(TargetExt) - $(AegisubBinaryDir)$(TargetName).pdb - $(AegisubLibraryDir)$(ProjectName).lib - - - $(AegisubLibraryDir)$(ProjectName).lib - - - - - - - ComputeClRelativeObjectFileName; - $(ComputeCompileInputsTargets) - - - - - - - - - - <_RelativeClCompile Condition="'%(_RelativeClCompile.OutputDir)' != ''"> - $(IntDir)%(_RelativeClCompile.OutputDir) - - - - - - <_RelativeClCompile Remove="@(_RelativeClCompile)" /> - - - diff --git a/build/standard-settings.props b/build/standard-settings.props deleted file mode 100644 index bdd8e7ac6..000000000 --- a/build/standard-settings.props +++ /dev/null @@ -1,71 +0,0 @@ - - - - <_PropertySheetDisplayName>Compiler settings - - - - true - - - false - - - - - true - false - Level3 - - BOOST_ALL_NO_LIB; - BOOST_HAS_ICU; - BOOST_SYSTEM_NO_DEPRECATED; - BOOST_MULTI_INDEX_DISABLE_SERIALIZATION; - U_STATIC_IMPLEMENTATION; - WIN32; - _WINDOWS; - %(PreprocessorDefinitions) - - $(AegisubSourceBase)\include; - $(BoostPath); - $(GtestSrcDir)\include; - $(IcuSrcDir)\include; - %(AdditionalIncludeDirectories) - - 4345 - - - $(AegisubSourceBase)include;%(AdditionalIncludeDirectories) - - - Windows - true - true - true - - - - - - MultiThreadedDebugDLL - Disabled - _DEBUG;%(PreprocessorDefinitions) - - - - - - MultiThreadedDLL - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions) - /Gw %(AdditionalOptions) - - - true - true - - - - diff --git a/build/tasks.props b/build/tasks.props deleted file mode 100644 index 39c594f90..000000000 --- a/build/tasks.props +++ /dev/null @@ -1,35 +0,0 @@ - - - - <_PropertySheetDisplayName>Custom Tasks - - - - - - - - - - - - - - - - - diff --git a/build/tests/tests.vcxproj b/build/tests/tests.vcxproj deleted file mode 100644 index 1dbbfb1af..000000000 --- a/build/tests/tests.vcxproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - {49766286-2B5D-4177-A860-BD7CE1846EEF} - tests - - - - - exe - ..\..\tests\ - - - - - - - - - - GTEST_HAS_TR1_TUPLE=0; - %(PreprocessorDefinitions) - - - $(AegisubSourceBase)libaegisub\include; - $(SrcDir)support; - %(AdditionalIncludeDirectories) - - $(SrcDir) - - - $(AegisubLibraryDir);%(AdditionalLibraryDirectories) - Console - - - $(SrcDir)setup.bat "$(AegisubBinaryDir)" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - {a649d828-a399-4d81-adef-94cfdba7847f} - - - {fbe51b37-8b12-41e8-b5e0-f00a06b4bcd2} - - - {f934ab7b-186b-4e96-b20c-a58c38c1b818} - - - {bb3fed86-db7a-4dc7-964a-260fb86cde61} - - - {965054d2-44f2-4eb2-9879-051cc3d7ef08} - - - {7b56955d-5162-4698-aa5b-47484edc8783} - - - diff --git a/build/tests/tests.vcxproj.filters b/build/tests/tests.vcxproj.filters deleted file mode 100644 index dceeba91b..000000000 --- a/build/tests/tests.vcxproj.filters +++ /dev/null @@ -1,106 +0,0 @@ - - - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Support - - - Support - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - Tests - - - - - Support - - - Support - - - - - Support - - - Support - - - diff --git a/build/universalchardet/universalchardet.vcxproj b/build/universalchardet/universalchardet.vcxproj deleted file mode 100644 index 4479436d2..000000000 --- a/build/universalchardet/universalchardet.vcxproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - {7B56955D-5162-4698-AA5B-47484EDC8783} - universalchardet - - - - - lib - ..\..\vendor\uchardet\src\ - - - - - - - - - false - false - - _CRT_NONSTDC_NO_DEPRECATE; - %(PreprocessorDefinitions) - - - - $(SrcDir) - uchardet\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/universalchardet/universalchardet.vcxproj.filters b/build/universalchardet/universalchardet.vcxproj.filters deleted file mode 100644 index a3b82a996..000000000 --- a/build/universalchardet/universalchardet.vcxproj.filters +++ /dev/null @@ -1,249 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {f628048a-0e81-4ea7-b20c-09e14f767db1} - *.tab - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Frequency tables - - - Frequency tables - - - Frequency tables - - - Frequency tables - - - Frequency tables - - - diff --git a/build/userconfig/ft2.props.sample b/build/userconfig/ft2.props.sample deleted file mode 100644 index 926813596..000000000 --- a/build/userconfig/ft2.props.sample +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - C:\Dev\freetype-2.4.3\include - - C:\Dev\freetype-2.4.3\objs\win32\vc2010 - - freetype2.4.3_32d.lib - freetype2.4.3_32.lib - freetype2.4.3_64d.lib - freetype2.4.3_64.lib - - diff --git a/build/userconfig/paths.props.sample b/build/userconfig/paths.props.sample deleted file mode 100644 index 8b57248e3..000000000 --- a/build/userconfig/paths.props.sample +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - C:\Dev\Aegisub\BuildFiles\ - - C:\Dev\Aegisub\BuiltBinaries\$(Platform)\ - - diff --git a/build/userconfig/readme.txt b/build/userconfig/readme.txt deleted file mode 100644 index 58e634860..000000000 --- a/build/userconfig/readme.txt +++ /dev/null @@ -1,12 +0,0 @@ -You can put MSBuild property files in this folder to override the default -build configuration for Aegisub's build system. - -A number of sample files are provided. These can be copied and used as -templates for common configuration. Importantly, configuring the location -of several library dependencies. -The copied sample files should be renamed to *.props, otherwise they will -not be found by the build system. - -You should not check files placed in this folder into source control. - -Files must be named *.props to be found by the build system. diff --git a/build/userconfig/wx.props.sample b/build/userconfig/wx.props.sample deleted file mode 100644 index 0fdeba05d..000000000 --- a/build/userconfig/wx.props.sample +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - C:\Dev\wxWidgets-2.9\install-vc10 - - $(WxBasePath)\lib32 - $(WxBasePath)\lib64 - - $(WxBasePath)\include - - diff --git a/build/wx/setup-build.h b/build/wx/setup-build.h deleted file mode 100644 index caf5b8fbd..000000000 --- a/build/wx/setup-build.h +++ /dev/null @@ -1,262 +0,0 @@ -#ifndef _WX_SETUP_H_ -#define _WX_SETUP_H_ -#ifndef wxUSE_GUI -#define wxUSE_GUI 1 -#endif -#ifdef wxUSE_UNICODE -#undef wxUSE_UNICODE -#endif -#define WXWIN_COMPATIBILITY_2_4 0 -#define WXWIN_COMPATIBILITY_2_6 0 -#define WXWIN_COMPATIBILITY_2_8 0 -#define wxDIALOG_UNIT_COMPATIBILITY 0 -#define wxUSE_ON_FATAL_EXCEPTION 1 -#define wxUSE_STACKWALKER 0 -#define wxUSE_DEBUGREPORT 0 -#define wxUSE_DEBUG_CONTEXT 0 -#define wxUSE_MEMORY_TRACING 0 -#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 -#define wxUSE_DEBUG_NEW_ALWAYS 0 -#define wxUSE_UNICODE 1 -#define wxUSE_WCHAR_T 1 -#define wxUSE_EXCEPTIONS 1 -#define wxUSE_EXTENDED_RTTI 0 -#define wxUSE_STL 0 -#define wxUSE_LOG 1 -#define wxUSE_LOGWINDOW 1 -#define wxUSE_LOGGUI 1 -#define wxUSE_LOG_DIALOG 1 -#define wxUSE_CMDLINE_PARSER 0 -#define wxUSE_THREADS 1 -#define wxUSE_STREAMS 1 -#define wxUSE_STD_IOSTREAM 0 -#define wxUSE_STD_STRING 1 -#define wxUSE_PRINTF_POS_PARAMS 1 -#define wxUSE_LONGLONG 1 -#define wxUSE_BASE64 0 -#define wxUSE_CONSOLE_EVENTLOOP 1 -#define wxUSE_FILE 1 -#define wxUSE_FFILE 1 -#define wxUSE_FSVOLUME 0 -#define wxUSE_STDPATHS 1 -#define wxUSE_TEXTBUFFER 0 -#define wxUSE_TEXTFILE 0 -#define wxUSE_INTL 1 -#define wxUSE_XLOCALE 1 -#define wxUSE_DATETIME 1 -#define wxUSE_TIMER 1 -#define wxUSE_STOPWATCH 1 -#define wxUSE_FSWATCHER 0 -#define wxUSE_CONFIG 0 -#define wxUSE_CONFIG_NATIVE 0 -#define wxUSE_DIALUP_MANAGER 0 -#define wxUSE_DYNLIB_CLASS 1 -#define wxUSE_DYNAMIC_LOADER 1 -#define wxUSE_SOCKETS 0 -#define wxUSE_IPV6 0 -#define wxUSE_FILESYSTEM 0 -#define wxUSE_FS_ZIP 0 -#define wxUSE_FS_ARCHIVE 0 -#define wxUSE_FS_INET 0 -#define wxUSE_ARCHIVE_STREAMS 1 -#define wxUSE_ZIPSTREAM 1 -#define wxUSE_TARSTREAM 0 -#define wxUSE_ZLIB 1 -#define wxUSE_APPLE_IEEE 0 -#define wxUSE_JOYSTICK 0 -#define wxUSE_FONTENUM 1 -#define wxUSE_FONTMAP 1 -#define wxUSE_MIMETYPE 0 -#define wxUSE_PROTOCOL 0 -#define wxUSE_PROTOCOL_FILE 0 -#define wxUSE_PROTOCOL_FTP 0 -#define wxUSE_PROTOCOL_HTTP 0 -#define wxUSE_URL 0 -#define wxUSE_URL_NATIVE 0 -#define wxUSE_VARIANT 1 -#define wxUSE_ANY 0 -#define wxUSE_REGEX 0 -#define wxUSE_SYSTEM_OPTIONS 1 -#define wxUSE_SOUND 0 -#define wxUSE_MEDIACTRL 0 -#define wxUSE_GSTREAMER 0 -#define wxUSE_XRC 0 -#define wxUSE_XML 1 -#define wxUSE_AUI 0 -#define wxUSE_RIBBON 0 -#define wxUSE_PROPGRID 0 -#define wxUSE_STC 1 -#define wxUSE_GRAPHICS_CONTEXT 1 -#define wxUSE_GRAPHICS_GDIPLUS 1 -#define wxUSE_CONTROLS 1 -#define wxUSE_POPUPWIN 1 -#define wxUSE_TIPWINDOW 0 -#define wxUSE_ANIMATIONCTRL 0 -#define wxUSE_BUTTON 1 -#define wxUSE_BMPBUTTON 1 -#define wxUSE_CALENDARCTRL 1 -#define wxUSE_CHECKBOX 1 -#define wxUSE_CHECKLISTBOX 1 -#define wxUSE_CHOICE 1 -#define wxUSE_COLLPANE 0 -#define wxUSE_COLOURPICKERCTRL 1 -#define wxUSE_COMBOBOX 1 -#define wxUSE_DATAVIEWCTRL 1 -#define wxUSE_DATEPICKCTRL 1 -#define wxUSE_DIRPICKERCTRL 1 -#define wxUSE_EDITABLELISTBOX 1 -#define wxUSE_FILECTRL 1 -#define wxUSE_FILEPICKERCTRL 1 -#define wxUSE_FONTPICKERCTRL 1 -#define wxUSE_GAUGE 1 -#define wxUSE_HEADERCTRL 1 -#define wxUSE_HYPERLINKCTRL 1 -#define wxUSE_LISTBOX 1 -#define wxUSE_LISTCTRL 1 -#define wxUSE_RADIOBOX 1 -#define wxUSE_RADIOBTN 1 -#define wxUSE_SCROLLBAR 1 -#define wxUSE_SEARCHCTRL 1 -#define wxUSE_SLIDER 1 -#define wxUSE_SPINBTN 1 -#define wxUSE_SPINCTRL 1 -#define wxUSE_STATBOX 1 -#define wxUSE_STATLINE 1 -#define wxUSE_STATTEXT 1 -#define wxUSE_STATBMP 1 -#define wxUSE_TEXTCTRL 1 -#define wxUSE_TOGGLEBTN 1 -#define wxUSE_TREECTRL 1 -#define wxUSE_STATUSBAR 1 -#define wxUSE_NATIVE_STATUSBAR 1 -#define wxUSE_TOOLBAR 1 -#define wxUSE_TOOLBAR_NATIVE 1 -#define wxUSE_NOTEBOOK 1 -#define wxUSE_LISTBOOK 1 -#define wxUSE_CHOICEBOOK 1 -#define wxUSE_TREEBOOK 1 -#define wxUSE_TOOLBOOK 1 -#define wxUSE_TASKBARICON 0 -#define wxUSE_TAB_DIALOG 0 -#define wxUSE_GRID 0 -#define wxUSE_MINIFRAME 0 -#define wxUSE_COMBOCTRL 1 -#define wxUSE_ODCOMBOBOX 1 -#define wxUSE_BITMAPCOMBOBOX 0 -#define wxUSE_REARRANGECTRL 1 -#define wxUSE_ACCEL 1 -#define wxUSE_HOTKEY 1 -#define wxUSE_CARET 1 -#define wxUSE_DISPLAY 1 -#define wxUSE_GEOMETRY 1 -#define wxUSE_IMAGLIST 1 -#define wxUSE_INFOBAR 1 -#define wxUSE_MENUS 1 -#define wxUSE_NOTIFICATION_MESSAGE 0 -#define wxUSE_SASH 1 -#define wxUSE_SPLITTER 1 -#define wxUSE_TOOLTIPS 1 -#define wxUSE_VALIDATORS 1 -#define wxUSE_COMMON_DIALOGS 1 -#define wxUSE_BUSYINFO 1 -#define wxUSE_CHOICEDLG 1 -#define wxUSE_COLOURDLG 1 -#define wxUSE_DIRDLG 1 -#define wxUSE_FILEDLG 1 -#define wxUSE_FINDREPLDLG 0 -#define wxUSE_FONTDLG 1 -#define wxUSE_MSGDLG 1 -#define wxUSE_PROGRESSDLG 0 -#define wxUSE_STARTUP_TIPS 0 -#define wxUSE_TEXTDLG 1 -#define wxUSE_NUMBERDLG 1 -#define wxUSE_SPLASH 0 -#define wxUSE_WIZARDDLG 0 -#define wxUSE_ABOUTDLG 1 -#define wxUSE_METAFILE 0 -#define wxUSE_ENH_METAFILE 0 -#define wxUSE_WIN_METAFILES_ALWAYS 0 -#define wxUSE_MDI 0 -#define wxUSE_DOC_VIEW_ARCHITECTURE 0 -#define wxUSE_MDI_ARCHITECTURE 0 -#define wxUSE_PRINTING_ARCHITECTURE 0 -#define wxUSE_HTML 0 -#define wxUSE_GLCANVAS 1 -#define wxUSE_RICHTEXT 0 -#define wxUSE_CLIPBOARD 1 -#define wxUSE_DATAOBJ 1 -#define wxUSE_DRAG_AND_DROP 1 -#define wxUSE_ACCESSIBILITY 0 -#define wxUSE_SNGLINST_CHECKER 1 -#define wxUSE_DRAGIMAGE 1 -#define wxUSE_IPC 0 -#define wxUSE_HELP 0 -#define wxUSE_MS_HTML_HELP 0 -#define wxUSE_WXHTML_HELP 0 -#define wxUSE_RESOURCES 0 -#define wxUSE_CONSTRAINTS 0 -#define wxUSE_SPLINES 0 -#define wxUSE_MOUSEWHEEL 1 -#define wxUSE_POSTSCRIPT 0 -#define wxUSE_AFM_FOR_POSTSCRIPT 0 -#define wxUSE_SVG 0 -#define wxODBC_FWD_ONLY_CURSORS 0 -#define wxODBC_BACKWARD_COMPATABILITY 0 -#define wxUSE_IOSTREAMH 0 -#define wxUSE_IMAGE 1 -#define wxUSE_LIBPNG 1 -#define wxUSE_LIBJPEG 0 -#define wxUSE_LIBTIFF 0 -#define wxUSE_TGA 0 -#define wxUSE_GIF 0 -#define wxUSE_PNM 0 -#define wxUSE_PCX 0 -#define wxUSE_IFF 0 -#define wxUSE_XPM 0 -#define wxUSE_ICO_CUR 1 -#define wxUSE_PALETTE 1 -#define wxUSE_ALL_THEMES 1 -#define wxUSE_UNICODE_MSLU 0 -#define wxUSE_MFC 0 -#define wxUSE_OLE 1 -#define wxUSE_OLE_AUTOMATION 0 -#define wxUSE_ACTIVEX 0 -#define wxUSE_DC_CACHEING 1 -#define wxUSE_DIB_FOR_BITMAP 0 -#define wxUSE_WXDIB 1 -#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0 -#define wxUSE_REGKEY 1 -#define wxUSE_RICHEDIT 0 -#define wxUSE_RICHEDIT2 0 -#define wxUSE_OWNER_DRAWN 1 -#define wxUSE_TASKBARICON_BALLOONS 0 -#define wxUSE_UXTHEME 1 -#define wxUSE_UXTHEME_AUTO 1 -#define wxUSE_INKEDIT 0 -#define wxUSE_INICONF 0 -#define wxUSE_DATEPICKCTRL_GENERIC 0 -#define wxUSE_CRASHREPORT 1 -#define wxUSE_AUTOID_MANAGEMENT 1 -#define wxUSE_FILE_HISTORY 0 -#define wxUSE_UIACTIONSIMULATOR 0 -#define wxUSE_CAIRO 0 -#define wxUSE_COMMANDLINKBUTTON 0 -#define wxUSE_RICHMSGDLG 0 -#define wxUSE_STD_CONTAINERS 1 -#define wxUSE_STD_STRING_CONV_IN_WXSTRING 0 -#define wxUSE_ARTPROVIDER_STD 0 -#define wxUSE_ARTPROVIDER_TANGO 0 -#define wxUSE_DC_TRANSFORM_MATRIX 0 -#define wxUSE_MARKUP 0 -#define wxUSE_TREELISTCTRL 1 -#define wxUSE_TIMEPICKCTRL 1 -#define wxUSE_WEBVIEW 0 -#define wxUSE_RICHTOOLTIP 0 -#define wxUSE_COMPILER_TLS 2 -#define wxUSE_PREFERENCES_EDITOR 0 -#define wxUSE_STD_CONTAINERS_COMPATIBLY 0 -#define wxUSE_TASKBARBUTTON 0 -#define wxUSE_ADDREMOVECTRL 0 -#define wxUSE_ACTIVITYINDICATOR 0 -#define wxUSE_WINRT 0 -#endif diff --git a/build/wx/setup-installed.h b/build/wx/setup-installed.h deleted file mode 100644 index 791db0ffc..000000000 --- a/build/wx/setup-installed.h +++ /dev/null @@ -1,3 +0,0 @@ -#include "wx/version.h" -#include "wx/cpp.h" -#include "wx/msw/setup.h" diff --git a/build/wx/stc-fi.h b/build/wx/stc-fi.h deleted file mode 100644 index 053e86b0d..000000000 --- a/build/wx/stc-fi.h +++ /dev/null @@ -1,7 +0,0 @@ -#include - -#include "Platform.h" -#include "SciLexer.h" -#include "ILexer.h" -#include "LexerModule.h" - diff --git a/build/wx/wxWidgets.vcxproj b/build/wx/wxWidgets.vcxproj deleted file mode 100644 index 4567381ed..000000000 --- a/build/wx/wxWidgets.vcxproj +++ /dev/null @@ -1,425 +0,0 @@ - - - - {0518D6C0-7BF6-4FD1-91FB-191BD10DB2AC} - wxWidgets - - - - - lib - ..\..\vendor\wxWidgets\ - - - - - - - - - _CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WX__;WXBUILDING;%(PreprocessorDefinitions) - $(SrcDir)include;%(AdditionalIncludeDirectories) - Use - wx/wxprec.h - /Zm150 %(AdditionalOptions) - - - $(SrcDir)include - - - - - - - - - - - - - - - - - - - - - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(SrcDir)src\stc\scintilla\include;$(SrcDir)src\stc\scintilla\src;$(SrcDir)src\stc\scintilla\lexlib;%(AdditionalIncludeDirectories) - - - - $(MSBuildThisFileDirectory)stc-fi.h - NotUsing - $(SrcDir)src\stc\scintilla\include;$(SrcDir)src\stc\scintilla\src;$(SrcDir)src\stc\scintilla\lexlib;%(AdditionalIncludeDirectories) - - - SCI_LEXER;%(PreprocessorDefinitions) - $(SrcDir)src\stc\scintilla\include;$(SrcDir)src\stc\scintilla\src;$(SrcDir)src\stc\scintilla\lexlib;%(AdditionalIncludeDirectories) - - - - - - - - {d6ba6815-0aac-48fa-8372-d32cde8bf07a} - - - {5cabcbef-e79a-4d27-94a5-cf4eaaf1dd96} - - - {d6ea54fd-f15c-42f6-929b-a83f299a4582} - - - {10f22a5a-dd9e-44a1-ba2e-2a9a7c78b0ee} - - - diff --git a/build/yasm.targets b/build/yasm.targets deleted file mode 100644 index 57fde6103..000000000 --- a/build/yasm.targets +++ /dev/null @@ -1,101 +0,0 @@ - - - - - <_PropertySheetDisplayName>Yasm compile targets - - - - - _YasmAssemble; - $(BuildCompileTargets) - - - - - - - false - -m x86 - -m amd64 - - - - - - - - - - - - - <_Yasm Include="@(Yasm)" Condition="'%(Yasm.InputRelativeSourceDir)' == ''"> - - - - <_Yasm Remove="@(_Yasm->WithMetadataValue('ExcludeFromBuild','true'))" /> - - - - - <_Yasm> - %(Include) -I%(RootDir)%(Directory)..\ - - %(OutputDir) - $(AegisubObjectDir)%(OutputDir) - - - - - - - - - - - - - - - - - - - diff --git a/build/zlib/zconf.h b/build/zlib/zconf.h deleted file mode 100644 index 69610ac37..000000000 --- a/build/zlib/zconf.h +++ /dev/null @@ -1,513 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2012 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - * Even better than compiling with -DZ_PREFIX would be to use configure to set - * this permanently in zconf.h using "./configure --zprefix". - */ -#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ -# define Z_PREFIX_SET - -/* all linked symbols */ -# define _dist_code z__dist_code -# define _length_code z__length_code -# define _tr_align z__tr_align -# define _tr_flush_block z__tr_flush_block -# define _tr_init z__tr_init -# define _tr_stored_block z__tr_stored_block -# define _tr_tally z__tr_tally -# define adler32 z_adler32 -# define adler32_combine z_adler32_combine -# define adler32_combine64 z_adler32_combine64 -# ifndef Z_SOLO -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# endif -# define crc32 z_crc32 -# define crc32_combine z_crc32_combine -# define crc32_combine64 z_crc32_combine64 -# define deflate z_deflate -# define deflateBound z_deflateBound -# define deflateCopy z_deflateCopy -# define deflateEnd z_deflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateInit_ z_deflateInit_ -# define deflateParams z_deflateParams -# define deflatePending z_deflatePending -# define deflatePrime z_deflatePrime -# define deflateReset z_deflateReset -# define deflateResetKeep z_deflateResetKeep -# define deflateSetDictionary z_deflateSetDictionary -# define deflateSetHeader z_deflateSetHeader -# define deflateTune z_deflateTune -# define deflate_copyright z_deflate_copyright -# define get_crc_table z_get_crc_table -# ifndef Z_SOLO -# define gz_error z_gz_error -# define gz_intmax z_gz_intmax -# define gz_strwinerror z_gz_strwinerror -# define gzbuffer z_gzbuffer -# define gzclearerr z_gzclearerr -# define gzclose z_gzclose -# define gzclose_r z_gzclose_r -# define gzclose_w z_gzclose_w -# define gzdirect z_gzdirect -# define gzdopen z_gzdopen -# define gzeof z_gzeof -# define gzerror z_gzerror -# define gzflush z_gzflush -# define gzgetc z_gzgetc -# define gzgetc_ z_gzgetc_ -# define gzgets z_gzgets -# define gzoffset z_gzoffset -# define gzoffset64 z_gzoffset64 -# define gzopen z_gzopen -# define gzopen64 z_gzopen64 -# ifdef _WIN32 -# define gzopen_w z_gzopen_w -# endif -# define gzprintf z_gzprintf -# define gzputc z_gzputc -# define gzputs z_gzputs -# define gzread z_gzread -# define gzrewind z_gzrewind -# define gzseek z_gzseek -# define gzseek64 z_gzseek64 -# define gzsetparams z_gzsetparams -# define gztell z_gztell -# define gztell64 z_gztell64 -# define gzungetc z_gzungetc -# define gzwrite z_gzwrite -# endif -# define inflate z_inflate -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define inflateBackInit_ z_inflateBackInit_ -# define inflateCopy z_inflateCopy -# define inflateEnd z_inflateEnd -# define inflateGetHeader z_inflateGetHeader -# define inflateInit2_ z_inflateInit2_ -# define inflateInit_ z_inflateInit_ -# define inflateMark z_inflateMark -# define inflatePrime z_inflatePrime -# define inflateReset z_inflateReset -# define inflateReset2 z_inflateReset2 -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateUndermine z_inflateUndermine -# define inflateResetKeep z_inflateResetKeep -# define inflate_copyright z_inflate_copyright -# define inflate_fast z_inflate_fast -# define inflate_table z_inflate_table -# ifndef Z_SOLO -# define uncompress z_uncompress -# endif -# define zError z_zError -# ifndef Z_SOLO -# define zcalloc z_zcalloc -# define zcfree z_zcfree -# endif -# define zlibCompileFlags z_zlibCompileFlags -# define zlibVersion z_zlibVersion - -/* all zlib typedefs in zlib.h and zconf.h */ -# define Byte z_Byte -# define Bytef z_Bytef -# define alloc_func z_alloc_func -# define charf z_charf -# define free_func z_free_func -# ifndef Z_SOLO -# define gzFile z_gzFile -# endif -# define gz_header z_gz_header -# define gz_headerp z_gz_headerp -# define in_func z_in_func -# define intf z_intf -# define out_func z_out_func -# define uInt z_uInt -# define uIntf z_uIntf -# define uLong z_uLong -# define uLongf z_uLongf -# define voidp z_voidp -# define voidpc z_voidpc -# define voidpf z_voidpf - -/* all zlib structs in zlib.h and zconf.h */ -# define gz_header_s z_gz_header_s -# define internal_state z_internal_state - -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -#if defined(ZLIB_CONST) && !defined(z_const) -# define z_const const -#else -# define z_const -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -/* ./configure may #define Z_U4 here */ - -#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) -# include -# if (UINT_MAX == 0xffffffffUL) -# define Z_U4 unsigned -# else -# if (ULONG_MAX == 0xffffffffUL) -# define Z_U4 unsigned long -# else -# if (USHRT_MAX == 0xffffffffUL) -# define Z_U4 unsigned short -# endif -# endif -# endif -#endif - -#ifdef Z_U4 - typedef Z_U4 z_crc_t; -#else - typedef unsigned long z_crc_t; -#endif - -#if defined(HAVE_UNISTD_H) && -HAVE_UNISTD_H - -1 == 1 -# undef HAVE_UNISTD_H -#endif - -#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ -# define Z_HAVE_UNISTD_H -#endif - -#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ -# define Z_HAVE_STDARG_H -#endif - -#ifdef STDC -# ifndef Z_SOLO -# include /* for off_t */ -# endif -#endif - -#ifdef _WIN32 -# include /* for wchar_t */ -#endif - -/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and - * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even - * though the former does not conform to the LFS document), but considering - * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as - * equivalently requesting no 64-bit operations - */ -#if defined(LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 -# undef _LARGEFILE64_SOURCE -#endif - -#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) -# define Z_HAVE_UNISTD_H -#endif -#ifndef Z_SOLO -# if defined(Z_HAVE_UNISTD_H) || defined(LARGEFILE64_SOURCE) -# ifdef Z_HAVE_UNISTD_H -# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ -# endif -# ifdef VMS -# include /* for off_t */ -# endif -# ifndef z_off_t -# define z_off_t off_t -# endif -# endif -#endif - -#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 -# define Z_LFS64 -#endif - -#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) -# define Z_LARGE64 -#endif - -#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) -# define Z_WANT64 -#endif - -#if !defined(SEEK_SET) && !defined(Z_SOLO) -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif - -#ifndef z_off_t -# define z_off_t long -#endif - -#if !defined(_WIN32) && defined(Z_LARGE64) -# define z_off64_t off64_t -#else -# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) -# define z_off64_t __int64 -# else -# define z_off64_t z_off_t -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) - #pragma map(deflateInit_,"DEIN") - #pragma map(deflateInit2_,"DEIN2") - #pragma map(deflateEnd,"DEEND") - #pragma map(deflateBound,"DEBND") - #pragma map(inflateInit_,"ININ") - #pragma map(inflateInit2_,"ININ2") - #pragma map(inflateEnd,"INEND") - #pragma map(inflateSync,"INSY") - #pragma map(inflateSetDictionary,"INSEDI") - #pragma map(compressBound,"CMBND") - #pragma map(inflate_table,"INTABL") - #pragma map(inflate_fast,"INFA") - #pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ - diff --git a/build/zlib/zlib.vcxproj b/build/zlib/zlib.vcxproj deleted file mode 100644 index 1dbf4345d..000000000 --- a/build/zlib/zlib.vcxproj +++ /dev/null @@ -1,60 +0,0 @@ - - - - {10F22A5A-DD9E-44A1-BA2E-2A9A7C78B0EE} - zlib - lib - - - - - - - - - - $(ZlibSrcDir)\ - 4996;%(DisableSpecificWarnings) - - - - - - - $(ZlibSrcDir) - - - $(MSBuildThisFileDirectory) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From d80b8d6de0cdae29936e0c26b45100fbe8887d80 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Wed, 28 Oct 2020 20:50:45 +0000 Subject: [PATCH 148/271] meson: use meson-pr branch for libass --- subprojects/libass.wrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/libass.wrap b/subprojects/libass.wrap index 90101e922..326b3a87b 100644 --- a/subprojects/libass.wrap +++ b/subprojects/libass.wrap @@ -1,5 +1,5 @@ [wrap-git] directory = libass url = https://github.com/TypesettingTools/libass.git -revision = meson-no-rasterizer-approximation +revision = meson-pr patch_directory = libass From 3147f303c8991cff3ab0d449acbaf8498cb16c49 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Wed, 28 Oct 2020 20:51:06 +0000 Subject: [PATCH 149/271] meson: save git_version.xml to meson build directory in version.ps1 --- tools/version.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/version.ps1 b/tools/version.ps1 index 8ce776474..3d0c62655 100644 --- a/tools/version.ps1 +++ b/tools/version.ps1 @@ -28,7 +28,7 @@ if ([System.IO.Path]::GetFullPath([System.IO.Path]::Combine((pwd).Path, $BuildRo $BuildRoot = Join-Path $repositoryRootPath 'build' } $gitVersionHeaderPath = Join-Path $BuildRoot 'git_version.h' -$gitVersionXmlPath = Join-Path $repositoryRootPath 'build' | Join-Path -ChildPath 'git_version.xml' +$gitVersionXmlPath = Join-Path $BuildRoot 'git_version.xml' $version = @{} if (Test-Path $gitVersionHeaderPath) { From 5ec5271eb58f709b4ae426b1f0dd2b94c7e0d835 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 5 Oct 2019 20:44:54 -0400 Subject: [PATCH 150/271] meson: fix source file inclusion in libaegisub on osx --- libaegisub/meson.build | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/libaegisub/meson.build b/libaegisub/meson.build index bb9842bfa..e780a399c 100644 --- a/libaegisub/meson.build +++ b/libaegisub/meson.build @@ -58,24 +58,25 @@ if host_machine.system() == 'darwin' ] else libaegisub_src += 'common/dispatch.cpp' - if host_machine.system() == 'windows' - libaegisub_src += [ - 'windows/access.cpp', - 'windows/charset_conv_win.cpp', - 'windows/fs.cpp', - 'windows/log_win.cpp', - 'windows/path_win.cpp', - 'windows/util_win.cpp', - ] - else - libaegisub_src += [ - 'unix/access.cpp', - 'unix/fs.cpp', - 'unix/log.cpp', - 'unix/path.cpp', - 'unix/util.cpp', - ] - endif +endif + +if host_machine.system() == 'windows' + libaegisub_src += [ + 'windows/access.cpp', + 'windows/charset_conv_win.cpp', + 'windows/fs.cpp', + 'windows/log_win.cpp', + 'windows/path_win.cpp', + 'windows/util_win.cpp', + ] +else + libaegisub_src += [ + 'unix/access.cpp', + 'unix/fs.cpp', + 'unix/log.cpp', + 'unix/path.cpp', + 'unix/util.cpp', + ] endif libaegisub_cpp_pch = ['include/lagi_pre.h'] From e08772802148e1ac6c047c312bb16d69adbae954 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 8 Nov 2020 12:11:22 -0500 Subject: [PATCH 151/271] gitignore: mass purge, add .DS_STORE --- .gitignore | 42 +++--------------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/.gitignore b/.gitignore index 67fb79e98..b8181d675 100644 --- a/.gitignore +++ b/.gitignore @@ -1,30 +1,5 @@ -*.vcxproj.user -*.idb -*.pdb -*.mo -*.exe - -/output -/include /tests/data -.lvimrc -.syntastic_cpp_config -/Makefile.inc -BuildLog.htm -acconf.h -acconf.h.in -aclocal.m4 -autom4te.cache -automation/aegisub-lua -build/userconfig/*.props -conf.sh -config.log -config.status -config_windows.h -configure -git_version.h -git_version.xml packages/desktop/aegisub.desktop packages/desktop/aegisub.desktop.template packages/win_installer/vendor @@ -33,26 +8,12 @@ src/libresrc/bitmap.h src/libresrc/default_config.cpp src/libresrc/default_config.h src/libresrc/default_config_platform.json -svn-revision.h -svn_revision tests/*.json tests/run tools/osx-bundle-restart-helper tools/osx-bundle.sed tools/repack-thes-dict tools/repack-thes-dict.dSYM -vendor/luajit/src/host/buildvm -vendor/luajit/src/host/minilua -vendor/luajit/src/host/buildvm_arch.h -vendor/luajit/src/jit/vmdef.lua -vendor/luajit/src/gen -vendor/luajit/src/lj_vm.s -vendor/luajit/src/lj_bcdef.h -vendor/luajit/src/lj_ffdef.h -vendor/luajit/src/lj_folddef.h -vendor/luajit/src/lj_libdef.h -vendor/luajit/src/lj_recdef.h -vendor/luajit/src/luajit # IDE-specific .nuget @@ -60,6 +21,9 @@ vendor/luajit/src/luajit .kdev4/ *.kdev4 +# Platform-specific +.DS_Store + # Meson build*/ subprojects/freetype* From 44af99a16388a1788a3eef81be7fb25a41701a0a Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 8 Nov 2020 12:13:50 -0500 Subject: [PATCH 152/271] meson: move luabins to subprojects --- meson.build | 5 ++++- {vendor => subprojects}/luabins/AUTHORS | 0 {vendor => subprojects}/luabins/BENCHMARK | 0 {vendor => subprojects}/luabins/COPYRIGHT | 0 {vendor => subprojects}/luabins/HISTORY | 0 {vendor => subprojects}/luabins/Makefile | 0 {vendor => subprojects}/luabins/README.md | 0 {vendor => subprojects}/luabins/TODO | 0 {vendor => subprojects}/luabins/etc/benchmark.lua | 0 {vendor => subprojects}/luabins/etc/checkfmt.lua | 0 {vendor => subprojects}/luabins/etc/dataset.lua | 0 {vendor => subprojects}/luabins/etc/tolua.lua | 0 {vendor => subprojects}/luabins/etc/toluabins.lua | 0 {vendor => subprojects}/luabins/include/.keepme | 0 {vendor => subprojects}/luabins/lib/.keepme | 0 {vendor => subprojects}/luabins/obj/.keepme | 0 .../luabins/rockspec/luabins-0.1.1-1.rockspec | 0 .../luabins/rockspec/luabins-0.1.1-2.rockspec | 0 .../luabins/rockspec/luabins-0.2-1.rockspec | 0 .../luabins/rockspec/luabins-0.3-1.rockspec | 0 .../luabins/rockspec/luabins-scm-1.rockspec | 0 .../luabins/rockspec/luabins-scm-2.rockspec | 0 {vendor => subprojects}/luabins/src/fwrite.c | 0 {vendor => subprojects}/luabins/src/fwrite.h | 0 {vendor => subprojects}/luabins/src/load.c | 0 {vendor => subprojects}/luabins/src/luabins.c | 0 {vendor => subprojects}/luabins/src/luabins.h | 0 {vendor => subprojects}/luabins/src/luaheaders.h | 0 {vendor => subprojects}/luabins/src/luainternals.c | 0 {vendor => subprojects}/luabins/src/luainternals.h | 0 {vendor => subprojects}/luabins/src/lualess.h | 0 {vendor => subprojects}/luabins/src/meson.build | 0 {vendor => subprojects}/luabins/src/save.c | 0 {vendor => subprojects}/luabins/src/savebuffer.c | 0 {vendor => subprojects}/luabins/src/savebuffer.h | 0 {vendor => subprojects}/luabins/src/saveload.h | 0 {vendor => subprojects}/luabins/src/write.c | 0 {vendor => subprojects}/luabins/src/write.h | 0 {vendor => subprojects}/luabins/test/large_data.lua | 0 .../luabins/test/large_data.luabins | Bin {vendor => subprojects}/luabins/test/test.c | 0 {vendor => subprojects}/luabins/test/test.h | 0 {vendor => subprojects}/luabins/test/test.lua | 0 {vendor => subprojects}/luabins/test/test_api.c | 0 .../luabins/test/test_fwrite_api.c | 0 .../luabins/test/test_savebuffer.c | 0 .../luabins/test/test_write_api.c | 0 {vendor => subprojects}/luabins/test/util.c | 0 {vendor => subprojects}/luabins/test/util.h | 0 .../luabins/test/write_tests.inc | 0 {vendor => subprojects}/luabins/tmp/.keepme | 0 51 files changed, 4 insertions(+), 1 deletion(-) rename {vendor => subprojects}/luabins/AUTHORS (100%) rename {vendor => subprojects}/luabins/BENCHMARK (100%) rename {vendor => subprojects}/luabins/COPYRIGHT (100%) rename {vendor => subprojects}/luabins/HISTORY (100%) rename {vendor => subprojects}/luabins/Makefile (100%) rename {vendor => subprojects}/luabins/README.md (100%) rename {vendor => subprojects}/luabins/TODO (100%) rename {vendor => subprojects}/luabins/etc/benchmark.lua (100%) rename {vendor => subprojects}/luabins/etc/checkfmt.lua (100%) rename {vendor => subprojects}/luabins/etc/dataset.lua (100%) rename {vendor => subprojects}/luabins/etc/tolua.lua (100%) rename {vendor => subprojects}/luabins/etc/toluabins.lua (100%) rename {vendor => subprojects}/luabins/include/.keepme (100%) rename {vendor => subprojects}/luabins/lib/.keepme (100%) rename {vendor => subprojects}/luabins/obj/.keepme (100%) rename {vendor => subprojects}/luabins/rockspec/luabins-0.1.1-1.rockspec (100%) rename {vendor => subprojects}/luabins/rockspec/luabins-0.1.1-2.rockspec (100%) rename {vendor => subprojects}/luabins/rockspec/luabins-0.2-1.rockspec (100%) rename {vendor => subprojects}/luabins/rockspec/luabins-0.3-1.rockspec (100%) rename {vendor => subprojects}/luabins/rockspec/luabins-scm-1.rockspec (100%) rename {vendor => subprojects}/luabins/rockspec/luabins-scm-2.rockspec (100%) rename {vendor => subprojects}/luabins/src/fwrite.c (100%) rename {vendor => subprojects}/luabins/src/fwrite.h (100%) rename {vendor => subprojects}/luabins/src/load.c (100%) rename {vendor => subprojects}/luabins/src/luabins.c (100%) rename {vendor => subprojects}/luabins/src/luabins.h (100%) rename {vendor => subprojects}/luabins/src/luaheaders.h (100%) rename {vendor => subprojects}/luabins/src/luainternals.c (100%) rename {vendor => subprojects}/luabins/src/luainternals.h (100%) rename {vendor => subprojects}/luabins/src/lualess.h (100%) rename {vendor => subprojects}/luabins/src/meson.build (100%) rename {vendor => subprojects}/luabins/src/save.c (100%) rename {vendor => subprojects}/luabins/src/savebuffer.c (100%) rename {vendor => subprojects}/luabins/src/savebuffer.h (100%) rename {vendor => subprojects}/luabins/src/saveload.h (100%) rename {vendor => subprojects}/luabins/src/write.c (100%) rename {vendor => subprojects}/luabins/src/write.h (100%) rename {vendor => subprojects}/luabins/test/large_data.lua (100%) rename {vendor => subprojects}/luabins/test/large_data.luabins (100%) rename {vendor => subprojects}/luabins/test/test.c (100%) rename {vendor => subprojects}/luabins/test/test.h (100%) rename {vendor => subprojects}/luabins/test/test.lua (100%) rename {vendor => subprojects}/luabins/test/test_api.c (100%) rename {vendor => subprojects}/luabins/test/test_fwrite_api.c (100%) rename {vendor => subprojects}/luabins/test/test_savebuffer.c (100%) rename {vendor => subprojects}/luabins/test/test_write_api.c (100%) rename {vendor => subprojects}/luabins/test/util.c (100%) rename {vendor => subprojects}/luabins/test/util.h (100%) rename {vendor => subprojects}/luabins/test/write_tests.inc (100%) rename {vendor => subprojects}/luabins/tmp/.keepme (100%) diff --git a/meson.build b/meson.build index ce0a24e35..be8feb3d5 100644 --- a/meson.build +++ b/meson.build @@ -243,7 +243,7 @@ if not deps.contains(luajit) else luajit_inc = include_directories(luajit.get_pkgconfig_variable('includedir')) endif -subdir('vendor/luabins/src') +subdir('subprojects/luabins/src') dep_gl = dependency('gl', required: false) if not dep_gl.found() @@ -257,6 +257,9 @@ if not dep_gl.found() dep_gl = dependency('', required: false) endif endif +if host_machine.system() == 'darwin' + conf.set('HAVE_OPENGL_GL_H', 1) +endif if not dep_gl.found() error('OpenGL implementation not found') diff --git a/vendor/luabins/AUTHORS b/subprojects/luabins/AUTHORS similarity index 100% rename from vendor/luabins/AUTHORS rename to subprojects/luabins/AUTHORS diff --git a/vendor/luabins/BENCHMARK b/subprojects/luabins/BENCHMARK similarity index 100% rename from vendor/luabins/BENCHMARK rename to subprojects/luabins/BENCHMARK diff --git a/vendor/luabins/COPYRIGHT b/subprojects/luabins/COPYRIGHT similarity index 100% rename from vendor/luabins/COPYRIGHT rename to subprojects/luabins/COPYRIGHT diff --git a/vendor/luabins/HISTORY b/subprojects/luabins/HISTORY similarity index 100% rename from vendor/luabins/HISTORY rename to subprojects/luabins/HISTORY diff --git a/vendor/luabins/Makefile b/subprojects/luabins/Makefile similarity index 100% rename from vendor/luabins/Makefile rename to subprojects/luabins/Makefile diff --git a/vendor/luabins/README.md b/subprojects/luabins/README.md similarity index 100% rename from vendor/luabins/README.md rename to subprojects/luabins/README.md diff --git a/vendor/luabins/TODO b/subprojects/luabins/TODO similarity index 100% rename from vendor/luabins/TODO rename to subprojects/luabins/TODO diff --git a/vendor/luabins/etc/benchmark.lua b/subprojects/luabins/etc/benchmark.lua similarity index 100% rename from vendor/luabins/etc/benchmark.lua rename to subprojects/luabins/etc/benchmark.lua diff --git a/vendor/luabins/etc/checkfmt.lua b/subprojects/luabins/etc/checkfmt.lua similarity index 100% rename from vendor/luabins/etc/checkfmt.lua rename to subprojects/luabins/etc/checkfmt.lua diff --git a/vendor/luabins/etc/dataset.lua b/subprojects/luabins/etc/dataset.lua similarity index 100% rename from vendor/luabins/etc/dataset.lua rename to subprojects/luabins/etc/dataset.lua diff --git a/vendor/luabins/etc/tolua.lua b/subprojects/luabins/etc/tolua.lua similarity index 100% rename from vendor/luabins/etc/tolua.lua rename to subprojects/luabins/etc/tolua.lua diff --git a/vendor/luabins/etc/toluabins.lua b/subprojects/luabins/etc/toluabins.lua similarity index 100% rename from vendor/luabins/etc/toluabins.lua rename to subprojects/luabins/etc/toluabins.lua diff --git a/vendor/luabins/include/.keepme b/subprojects/luabins/include/.keepme similarity index 100% rename from vendor/luabins/include/.keepme rename to subprojects/luabins/include/.keepme diff --git a/vendor/luabins/lib/.keepme b/subprojects/luabins/lib/.keepme similarity index 100% rename from vendor/luabins/lib/.keepme rename to subprojects/luabins/lib/.keepme diff --git a/vendor/luabins/obj/.keepme b/subprojects/luabins/obj/.keepme similarity index 100% rename from vendor/luabins/obj/.keepme rename to subprojects/luabins/obj/.keepme diff --git a/vendor/luabins/rockspec/luabins-0.1.1-1.rockspec b/subprojects/luabins/rockspec/luabins-0.1.1-1.rockspec similarity index 100% rename from vendor/luabins/rockspec/luabins-0.1.1-1.rockspec rename to subprojects/luabins/rockspec/luabins-0.1.1-1.rockspec diff --git a/vendor/luabins/rockspec/luabins-0.1.1-2.rockspec b/subprojects/luabins/rockspec/luabins-0.1.1-2.rockspec similarity index 100% rename from vendor/luabins/rockspec/luabins-0.1.1-2.rockspec rename to subprojects/luabins/rockspec/luabins-0.1.1-2.rockspec diff --git a/vendor/luabins/rockspec/luabins-0.2-1.rockspec b/subprojects/luabins/rockspec/luabins-0.2-1.rockspec similarity index 100% rename from vendor/luabins/rockspec/luabins-0.2-1.rockspec rename to subprojects/luabins/rockspec/luabins-0.2-1.rockspec diff --git a/vendor/luabins/rockspec/luabins-0.3-1.rockspec b/subprojects/luabins/rockspec/luabins-0.3-1.rockspec similarity index 100% rename from vendor/luabins/rockspec/luabins-0.3-1.rockspec rename to subprojects/luabins/rockspec/luabins-0.3-1.rockspec diff --git a/vendor/luabins/rockspec/luabins-scm-1.rockspec b/subprojects/luabins/rockspec/luabins-scm-1.rockspec similarity index 100% rename from vendor/luabins/rockspec/luabins-scm-1.rockspec rename to subprojects/luabins/rockspec/luabins-scm-1.rockspec diff --git a/vendor/luabins/rockspec/luabins-scm-2.rockspec b/subprojects/luabins/rockspec/luabins-scm-2.rockspec similarity index 100% rename from vendor/luabins/rockspec/luabins-scm-2.rockspec rename to subprojects/luabins/rockspec/luabins-scm-2.rockspec diff --git a/vendor/luabins/src/fwrite.c b/subprojects/luabins/src/fwrite.c similarity index 100% rename from vendor/luabins/src/fwrite.c rename to subprojects/luabins/src/fwrite.c diff --git a/vendor/luabins/src/fwrite.h b/subprojects/luabins/src/fwrite.h similarity index 100% rename from vendor/luabins/src/fwrite.h rename to subprojects/luabins/src/fwrite.h diff --git a/vendor/luabins/src/load.c b/subprojects/luabins/src/load.c similarity index 100% rename from vendor/luabins/src/load.c rename to subprojects/luabins/src/load.c diff --git a/vendor/luabins/src/luabins.c b/subprojects/luabins/src/luabins.c similarity index 100% rename from vendor/luabins/src/luabins.c rename to subprojects/luabins/src/luabins.c diff --git a/vendor/luabins/src/luabins.h b/subprojects/luabins/src/luabins.h similarity index 100% rename from vendor/luabins/src/luabins.h rename to subprojects/luabins/src/luabins.h diff --git a/vendor/luabins/src/luaheaders.h b/subprojects/luabins/src/luaheaders.h similarity index 100% rename from vendor/luabins/src/luaheaders.h rename to subprojects/luabins/src/luaheaders.h diff --git a/vendor/luabins/src/luainternals.c b/subprojects/luabins/src/luainternals.c similarity index 100% rename from vendor/luabins/src/luainternals.c rename to subprojects/luabins/src/luainternals.c diff --git a/vendor/luabins/src/luainternals.h b/subprojects/luabins/src/luainternals.h similarity index 100% rename from vendor/luabins/src/luainternals.h rename to subprojects/luabins/src/luainternals.h diff --git a/vendor/luabins/src/lualess.h b/subprojects/luabins/src/lualess.h similarity index 100% rename from vendor/luabins/src/lualess.h rename to subprojects/luabins/src/lualess.h diff --git a/vendor/luabins/src/meson.build b/subprojects/luabins/src/meson.build similarity index 100% rename from vendor/luabins/src/meson.build rename to subprojects/luabins/src/meson.build diff --git a/vendor/luabins/src/save.c b/subprojects/luabins/src/save.c similarity index 100% rename from vendor/luabins/src/save.c rename to subprojects/luabins/src/save.c diff --git a/vendor/luabins/src/savebuffer.c b/subprojects/luabins/src/savebuffer.c similarity index 100% rename from vendor/luabins/src/savebuffer.c rename to subprojects/luabins/src/savebuffer.c diff --git a/vendor/luabins/src/savebuffer.h b/subprojects/luabins/src/savebuffer.h similarity index 100% rename from vendor/luabins/src/savebuffer.h rename to subprojects/luabins/src/savebuffer.h diff --git a/vendor/luabins/src/saveload.h b/subprojects/luabins/src/saveload.h similarity index 100% rename from vendor/luabins/src/saveload.h rename to subprojects/luabins/src/saveload.h diff --git a/vendor/luabins/src/write.c b/subprojects/luabins/src/write.c similarity index 100% rename from vendor/luabins/src/write.c rename to subprojects/luabins/src/write.c diff --git a/vendor/luabins/src/write.h b/subprojects/luabins/src/write.h similarity index 100% rename from vendor/luabins/src/write.h rename to subprojects/luabins/src/write.h diff --git a/vendor/luabins/test/large_data.lua b/subprojects/luabins/test/large_data.lua similarity index 100% rename from vendor/luabins/test/large_data.lua rename to subprojects/luabins/test/large_data.lua diff --git a/vendor/luabins/test/large_data.luabins b/subprojects/luabins/test/large_data.luabins similarity index 100% rename from vendor/luabins/test/large_data.luabins rename to subprojects/luabins/test/large_data.luabins diff --git a/vendor/luabins/test/test.c b/subprojects/luabins/test/test.c similarity index 100% rename from vendor/luabins/test/test.c rename to subprojects/luabins/test/test.c diff --git a/vendor/luabins/test/test.h b/subprojects/luabins/test/test.h similarity index 100% rename from vendor/luabins/test/test.h rename to subprojects/luabins/test/test.h diff --git a/vendor/luabins/test/test.lua b/subprojects/luabins/test/test.lua similarity index 100% rename from vendor/luabins/test/test.lua rename to subprojects/luabins/test/test.lua diff --git a/vendor/luabins/test/test_api.c b/subprojects/luabins/test/test_api.c similarity index 100% rename from vendor/luabins/test/test_api.c rename to subprojects/luabins/test/test_api.c diff --git a/vendor/luabins/test/test_fwrite_api.c b/subprojects/luabins/test/test_fwrite_api.c similarity index 100% rename from vendor/luabins/test/test_fwrite_api.c rename to subprojects/luabins/test/test_fwrite_api.c diff --git a/vendor/luabins/test/test_savebuffer.c b/subprojects/luabins/test/test_savebuffer.c similarity index 100% rename from vendor/luabins/test/test_savebuffer.c rename to subprojects/luabins/test/test_savebuffer.c diff --git a/vendor/luabins/test/test_write_api.c b/subprojects/luabins/test/test_write_api.c similarity index 100% rename from vendor/luabins/test/test_write_api.c rename to subprojects/luabins/test/test_write_api.c diff --git a/vendor/luabins/test/util.c b/subprojects/luabins/test/util.c similarity index 100% rename from vendor/luabins/test/util.c rename to subprojects/luabins/test/util.c diff --git a/vendor/luabins/test/util.h b/subprojects/luabins/test/util.h similarity index 100% rename from vendor/luabins/test/util.h rename to subprojects/luabins/test/util.h diff --git a/vendor/luabins/test/write_tests.inc b/subprojects/luabins/test/write_tests.inc similarity index 100% rename from vendor/luabins/test/write_tests.inc rename to subprojects/luabins/test/write_tests.inc diff --git a/vendor/luabins/tmp/.keepme b/subprojects/luabins/tmp/.keepme similarity index 100% rename from vendor/luabins/tmp/.keepme rename to subprojects/luabins/tmp/.keepme From 0d45c67dcf026dbc7296a4a29e3dfdc33a583367 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 6 Oct 2019 15:59:40 -0400 Subject: [PATCH 153/271] meson: move all .desktop file work into linux conditional --- packages/meson.build | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/meson.build b/packages/meson.build index b4db1e0e0..f2a02902c 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -1,12 +1,13 @@ -c_pkg = configuration_data() -c_pkg.set('AEGISUB_COMMAND', 'aegisub') +conf_pkg = configuration_data() if host_machine.system() == 'windows' elif host_machine.system() == 'darwin' else + conf_pkg.set('AEGISUB_COMMAND', 'aegisub') + desktop_template = configure_file(input: 'desktop/aegisub.desktop.template.in', output: 'aegisub.desktop.template', - configuration: c_pkg) + configuration: conf_pkg) i18n = import('i18n') i18n.merge_file(input: desktop_template, @@ -15,13 +16,13 @@ else po_dir: '../po', install: true, install_dir: join_paths(get_option('datadir'), 'applications')) + + aegisub_logos = ['16x16.png', '22x22.png', '24x24.png', '32x32.png', '48x48.png', '64x64.png', 'scalable.svg'] + + foreach s: aegisub_logos + dir = s.split('.')[0] + ext = s.split('.')[1] + install_data('desktop' / dir / 'aegisub.' + ext, + install_dir: get_option('datadir') / 'icons' / 'hicolor' / dir / 'apps') + endforeach endif - -aegisub_logos = ['16x16.png', '22x22.png', '24x24.png', '32x32.png', '48x48.png', '64x64.png', 'scalable.svg'] - -foreach s: aegisub_logos - dir = s.split('.')[0] - ext = s.split('.')[1] - install_data('desktop' / dir / 'aegisub.' + ext, - install_dir: get_option('datadir') / 'icons' / 'hicolor' / dir / 'apps') -endforeach From 2e898c461a1e9fec1765a4a7449ac4e7fb5f2fc5 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 6 Oct 2019 16:00:08 -0400 Subject: [PATCH 154/271] win-installer: remove fragment_opengl --- packages/win_installer/fragment_opengl.iss | 68 ---------------------- 1 file changed, 68 deletions(-) delete mode 100644 packages/win_installer/fragment_opengl.iss diff --git a/packages/win_installer/fragment_opengl.iss b/packages/win_installer/fragment_opengl.iss deleted file mode 100644 index 21cb3ee14..000000000 --- a/packages/win_installer/fragment_opengl.iss +++ /dev/null @@ -1,68 +0,0 @@ -; Copyright (c) 2007-2009, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; - - -; Check whether the user has a possibly redundant OPENGL32.DLL file in his program folder and offer to remove it - -[InstallDelete] -Type: files; Name: {app}\opengl32.dll; Tasks: RemoveRedundantOpenGL -Type: files; Name: {app}\opengl32.txt; Tasks: RemoveRedundantOpenGL -Type: files; Name: {app}\opengl32.lib; Tasks: RemoveRedundantOpenGL - -[Tasks] -Name: RemoveRedundantOpenGL; Description: Remove OPENGL32.DLL from Aegisub folder; Check: OpenGLdllPresent - -[Messages] -WizardSelectTasks=Select Additional Tasks -SelectTasksDesc=Which additional tasks should be performed? -SelectTasksLabel2=You appear to have a Mesa3D OPENGL32.DLL file installed in your Aegisub directory. This file has previously helped make video display more stable, but is no longer needed because Aegisub's code has been made more robust.%nThis file will be removed by default, but if you want to keep it you can unselect the option below. - -[Code] -function OpenGLdllPresent: Boolean; -begin - try - Result := - FileExists(ExpandConstant('{app}\opengl32.dll')) - // MD5 hash of the DLL distributed on Aegisub's forum - and (GetMD5OfFile(ExpandConstant('{app}\opengl32.dll')) = 'f928a03f4b265658589be951cbd09a27') - ; - except - Result := False; - end; -end; -[/Code] - - - - From 9fd62692af3b7f4bb0d4a676bc506b2f16f0df26 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 6 Oct 2019 16:00:37 -0400 Subject: [PATCH 155/271] win-installer: auto-populate current year for copyright --- packages/win_installer/fragment_setupbase.iss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/win_installer/fragment_setupbase.iss b/packages/win_installer/fragment_setupbase.iss index 4ab7f44ed..8935e256c 100644 --- a/packages/win_installer/fragment_setupbase.iss +++ b/packages/win_installer/fragment_setupbase.iss @@ -34,6 +34,8 @@ #include "../../build/git_version.h" +#define CURRENT_YEAR GetDateTimeString('yyyy', '', ''); + [Setup] AppName=Aegisub AppVerName=Aegisub {#BUILD_GIT_VERSION_STRING} @@ -41,7 +43,7 @@ AppVersion={#INSTALLER_VERSION} AppPublisher=Aegisub Team AppPublisherURL=http://www.aegisub.org/ AppSupportURL=https://github.com/TypesettingTools/Aegisub/issues -AppCopyright=2005-2018 The Aegisub Team +AppCopyright=2005-{#CURRENT_YEAR} The Aegisub Team VersionInfoVersion={#INSTALLER_VERSION} DefaultGroupName=Aegisub AllowNoIcons=true From 8f42f11b11e3ae1129a6b67b5bd5273f9391f28d Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 6 Oct 2019 20:53:57 -0400 Subject: [PATCH 156/271] Convert osx-fix-libs.py to py3 --- tools/osx-fix-libs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/osx-fix-libs.py b/tools/osx-fix-libs.py index ac4327a9a..845a56b97 100755 --- a/tools/osx-fix-libs.py +++ b/tools/osx-fix-libs.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import re import sys From e3826cb17eb54b4a106c304dd12d7b31e00b3d37 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 8 Nov 2020 12:33:37 -0500 Subject: [PATCH 157/271] meson: initial attempt to generate Aegisub.app on macOS --- automation/meson.build | 2 +- meson.build | 14 +++- meson_options.txt | 2 + packages/meson.build | 10 ++- .../osx_bundle}/osx-bundle.sed.in | 0 po/meson.build | 4 +- src/meson.build | 1 + tools/osx-bundle.sh | 74 +++++++++---------- 8 files changed, 63 insertions(+), 44 deletions(-) rename {tools => packages/osx_bundle}/osx-bundle.sed.in (100%) diff --git a/automation/meson.build b/automation/meson.build index fff6b45c1..043d40c8c 100644 --- a/automation/meson.build +++ b/automation/meson.build @@ -1,4 +1,4 @@ -automation_dir = get_option('datadir') / 'aegisub' / 'automation' +automation_dir = dataroot / 'automation' install_data( 'autoload/cleantags-autoload.lua', diff --git a/meson.build b/meson.build index be8feb3d5..cf9cfe66e 100644 --- a/meson.build +++ b/meson.build @@ -26,7 +26,19 @@ version_h = custom_target('git_version.h', build_always_stale: true, # has internal check whether target file will be refreshed output: ['git_version.h', 'git_version.xml']) -dataroot = get_option('prefix') / get_option('datadir') / 'aegisub' +if host_machine.system() == 'darwin' and get_option('build_osx_bundle') + prefix = meson.current_build_dir() / 'Aegisub.app' / 'Contents' + bindir = prefix / 'MacOS' + datadir = prefix / 'SharedSupport' + localedir = prefix / 'Resources' +else + prefix = get_option('prefix') + bindir = prefix / get_option('bindir') + datadir = prefix / get_option('datadir') + localedir = prefix / get_option('localedir') +endif +docdir = prefix / 'doc' +dataroot = datadir / 'aegisub' add_project_arguments('-DP_DATA="@0@"'.format(dataroot), language: 'cpp') if host_machine.system() == 'windows' diff --git a/meson_options.txt b/meson_options.txt index fa24825cc..c003fbc1d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -22,3 +22,5 @@ option('credit', type: 'string', value: '', description: 'Build credit shown in option('enable_update_checker', type: 'boolean', value: false, description: 'Enable the update checker') option('update_server', type: 'string', value: 'updates.aegisub.org', description: 'Server to use for the update checker') option('update_url', type: 'string', value: '/trunk', description: 'Base path to use for the update checker') + +option('build_osx_bundle', type: 'boolean', value: 'false', description: 'Package Aegisub.app on OSX') diff --git a/packages/meson.build b/packages/meson.build index f2a02902c..41676bfb2 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -2,6 +2,12 @@ conf_pkg = configuration_data() if host_machine.system() == 'windows' elif host_machine.system() == 'darwin' + # temporary hack until version.sh generates this properly + run_command('cp', meson.source_root() / 'tools' / 'osx-bundle.sed', meson.build_root()) + fontconfig_conf = run_command('pkg-config', '--variable=confdir', 'fontconfig').stdout().strip() + run_target('osx-bundle', + command: ['../tools/osx-bundle.sh', meson.source_root(), meson.build_root(), 'wx-config', fontconfig_conf, '', + get_option('build_osx_bundle') ? 'TRUE' : 'FALSE']) else conf_pkg.set('AEGISUB_COMMAND', 'aegisub') @@ -15,7 +21,7 @@ else type: 'desktop', po_dir: '../po', install: true, - install_dir: join_paths(get_option('datadir'), 'applications')) + install_dir: datadir / 'applications') aegisub_logos = ['16x16.png', '22x22.png', '24x24.png', '32x32.png', '48x48.png', '64x64.png', 'scalable.svg'] @@ -23,6 +29,6 @@ else dir = s.split('.')[0] ext = s.split('.')[1] install_data('desktop' / dir / 'aegisub.' + ext, - install_dir: get_option('datadir') / 'icons' / 'hicolor' / dir / 'apps') + install_dir: datadir / 'icons' / 'hicolor' / dir / 'apps') endforeach endif diff --git a/tools/osx-bundle.sed.in b/packages/osx_bundle/osx-bundle.sed.in similarity index 100% rename from tools/osx-bundle.sed.in rename to packages/osx_bundle/osx-bundle.sed.in diff --git a/po/meson.build b/po/meson.build index 5d61f0efc..5aae381d1 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,2 +1,4 @@ i18n = import('i18n') -i18n.gettext('aegisub') +# This is currently busted on OSX +i18n.gettext('aegisub', + install_dir: localedir) diff --git a/src/meson.build b/src/meson.build index 7e5dc7788..1238f6dea 100644 --- a/src/meson.build +++ b/src/meson.build @@ -220,5 +220,6 @@ aegisub = executable('aegisub', aegisub_src, version_h, acconf, cpp_pch: aegisub_cpp_pch, c_pch: aegisub_c_pch, install: true, + install_dir: bindir, dependencies: deps, gui_app: true) diff --git a/tools/osx-bundle.sh b/tools/osx-bundle.sh index eb82b554f..dbec657d8 100755 --- a/tools/osx-bundle.sh +++ b/tools/osx-bundle.sh @@ -2,22 +2,25 @@ set -e -PKG_DIR=Aegisub.app -SKEL_DIR="packages/osx_bundle" -AEGISUB_BIN="${1}" -SRCDIR=`pwd` -HOME_DIR=`echo ~` -WX_PREFIX=`${2} --prefix` -FONTCONFIG_CONF_DIR="${3}" +SRC_DIR="${1}" +BUILD_DIR="${2}" +WX_PREFIX=`${3} --prefix` +FONTCONFIG_CONF_DIR="${4}" +DICT_DIR="${5}" +MESON_BUILD_OSX_BUNDLE="${6}" -if ! test -d packages/osx_bundle; then - echo - echo "Make sure you're in the toplevel source directory" +if [ "${MESON_BUILD_OSX_BUNDLE}" != "TRUE" ]; then + echo "Project not built with \`build_osx_bundle\`" + echo "Please run \`meson configure -Dbuild_osx_bundle=true\` and rebuild" exit 1 fi +PKG_DIR="${BUILD_DIR}/Aegisub.app" +SKEL_DIR="${SRC_DIR}/packages/osx_bundle" + if test -d "${PKG_DIR}"; then rm -rf "${PKG_DIR}" + echo "Removing old Aegisub.app" fi echo @@ -31,41 +34,34 @@ mkdir -v "${PKG_DIR}/Contents/SharedSupport/dictionaries" echo echo "---- Copying Skel Files ----" -if ! test -f "tools/osx-bundle.sed"; then +if ! test -f "${BUILD_DIR}/osx-bundle.sed"; then echo - echo "NOT FOUND: tools/osx-bundle.sed" + echo "NOT FOUND: ${BUILD_DIR}/osx-bundle.sed" exit 1 fi # used by osx-bundle.sed -find po -name *.po | sed 's/.*\/\(.*\)\.po/ \1<\/string>/; s/RS/YU/' > languages +find "${SRC_DIR}/po" -name *.po | sed 's/.*\/\(.*\)\.po/ \1<\/string>/; s/RS/YU/' > "${BUILD_DIR}/languages" -find ${SKEL_DIR} -type f -not -regex ".*.svn.*" -cp ${SKEL_DIR}/Contents/Resources/*.icns "${PKG_DIR}/Contents/Resources" -cat ${SKEL_DIR}/Contents/Info.plist | sed -f tools/osx-bundle.sed > "${PKG_DIR}/Contents/Info.plist" +#find "${SKEL_DIR}" -type f -not -regex ".*.svn.*" +cp -v ${SKEL_DIR}/Contents/Resources/*.icns "${PKG_DIR}/Contents/Resources" +cat "${SKEL_DIR}/Contents/Info.plist" | sed -f "${BUILD_DIR}/osx-bundle.sed" > "${PKG_DIR}/Contents/Info.plist" -rm languages +rm "${BUILD_DIR}/languages" echo echo "---- Installing files ----" -make install \ - DESTDIR="${PKG_DIR}/Contents" \ - P_DATA="/SharedSupport" \ - P_DOC="/SharedSupport/doc" \ - P_LOCALE="/Resources" \ - P_BINDIR="/MacOS" +CURRENT_DIR=`pwd` +cd ${BUILD_DIR} +ninja install +cd ${CURRENT_DIR} echo echo "---- Copying dictionaries ----" -if test -z "${DICT_DIR}"; then - DICT_DIR="${HOME_DIR}/dict" -fi - -if test -d "${DICT_DIR}"; then - cp -v ${DICT_DIR}/* "${PKG_DIR}/Contents/SharedSupport/dictionaries" +if test -f "${DICT_DIR}"; then + cp -v "${DICT_DIR}/*" "${PKG_DIR}/Contents/SharedSupport/dictionaries" else - echo "WARNING: Dictionaries not found, please set $$DICT_DIR to a directiory" - echo " where the *.aff and *.dic files can be found" + echo "Specified dictionary directory ${DICT_DIR} not found!" fi echo @@ -74,14 +70,15 @@ echo "---- Copying Aegisub locale files ----" # internal so we don't need an aegisub.mo file. mkdir -vp "${PKG_DIR}/Contents/Resources/en.lproj" +# FIXME # 10.8 wants sr_YU rather than sr_RS -mv "${PKG_DIR}/Contents/Resources/sr_RS.lproj" "${PKG_DIR}/Contents/Resources/sr_YU.lproj" -mv "${PKG_DIR}/Contents/Resources/sr_RS@latin.lproj" "${PKG_DIR}/Contents/Resources/sr_YU@latin.lproj" +#mv "${PKG_DIR}/Contents/Resources/sr_RS.lproj" "${PKG_DIR}/Contents/Resources/sr_YU.lproj" +#mv "${PKG_DIR}/Contents/Resources/sr_RS@latin.lproj" "${PKG_DIR}/Contents/Resources/sr_YU@latin.lproj" echo echo "---- Copying WX locale files ----" -for i in `ls -1 po/*.mo|sed "s|po/\(.*\).mo|\1|"`; do +for i in `ls -1 ${SRC_DIR}/po/*.mo|sed "s|po/\(.*\).mo|\1|"`; do WX_MO="${WX_PREFIX}/share/locale/${i}/LC_MESSAGES/wxstd.mo" if ! test -f "${WX_MO}"; then @@ -95,10 +92,9 @@ for i in `ls -1 po/*.mo|sed "s|po/\(.*\).mo|\1|"`; do fi done +echo +echo "---- Fixing libraries ----" +sudo python "${SRC_DIR}/tools/osx-fix-libs.py" "${PKG_DIR}/Contents/MacOS/aegisub" || exit $? echo -echo "---- Libraries ----" -python tools/osx-fix-libs.py "${PKG_DIR}/Contents/MacOS/aegisub" || exit $? - -echo -echo "Done Creating \"${PKG_DIR}\"" +echo "Done creating \"${PKG_DIR}\"" From e3935095153e7846376409b4104b3e4095c8fef1 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 8 Nov 2020 12:57:29 -0500 Subject: [PATCH 158/271] meson: default to buildtype debugoptimized --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index cf9cfe66e..73cf0d51f 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', meson_version: '>=0.55.0', - default_options: ['cpp_std=c++11', 'b_lto=true'], + default_options: ['cpp_std=c++11', 'b_lto=true', 'buildtype=debugoptimized'], version: '3.2.2') cmake = import('cmake') From 7d0028799f7ee75f4d857ed5c819286526c32641 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 8 Nov 2020 12:58:07 -0500 Subject: [PATCH 159/271] meson: remove old wx_path and icu_path hacks --- meson.build | 62 +++++++++++++++++++++-------------------------- meson_options.txt | 3 --- 2 files changed, 28 insertions(+), 37 deletions(-) diff --git a/meson.build b/meson.build index 73cf0d51f..01df6a50f 100644 --- a/meson.build +++ b/meson.build @@ -107,41 +107,35 @@ wx_dep = dependency('wxWidgets', version: '>=3.0.0', if wx_dep.found() deps += wx_dep -else # this will only be hit with msvc - if get_option('wx_path') != '' - deps_inc += include_directories(get_option('wx_path') / 'include' / 'msvc', get_option('wx_path') / 'include') - add_project_arguments('-DUNICODE', '-D_UNICODE', language: 'cpp') - add_project_arguments('-DwxMSVC_VERSION_AUTO', '-DWXUSINGDLL', language: 'cpp') - else - buildShared = 'ON' - if get_option('default_library') == 'static' - buildShared = 'OFF' +else + build_shared = 'ON' + if get_option('default_library') == 'static' + build_shared = 'OFF' + endif + + wx = cmake.subproject('wxWidgets', cmake_options: ['-DwxBUILD_INSTALL=OFF', + '-DwxBUILD_PRECOMP=OFF', # otherwise breaks project generation w/ meson + '-DwxBUILD_SHARED=@0@'.format(build_shared), + '-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson + deps += [ + wx.dependency('wxmono'), + wx.dependency('wxzlib'), + wx.dependency('wxpng'), + wx.dependency('wxexpat'), + wx.dependency('wxregex'), + wx.dependency('wxscintilla') + ] + + if host_machine.system() == 'windows' + if cc.has_header('rpc.h') + deps += cc.find_library('rpcrt4', required: true) + else + error('Missing Windows SDK RPC Library (rpc.h / rpcrt4.lib)') endif - - wx = cmake.subproject('wxWidgets', cmake_options: ['-DwxBUILD_INSTALL=OFF', - '-DwxBUILD_PRECOMP=OFF', # otherwise breaks project generation w/ meson - '-DwxBUILD_SHARED=@0@'.format(buildShared), - '-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson - deps += [ - wx.dependency('wxmono'), - wx.dependency('wxzlib'), - wx.dependency('wxpng'), - wx.dependency('wxexpat'), - wx.dependency('wxregex'), - wx.dependency('wxscintilla') - ] - - if host_machine.system() == 'windows' - if cc.has_header('rpc.h') - deps += cc.find_library('rpcrt4', required: true) - else - error('Missing Windows SDK RPC Library (rpc.h / rpcrt4.lib)') - endif - if cc.has_header('commctrl.h') - deps += cc.find_library('comctl32', required: true) - else - error('Missing Windows SDK Common Controls Library (commctrl.h / comctl32.lib)') - endif + if cc.has_header('commctrl.h') + deps += cc.find_library('comctl32', required: true) + else + error('Missing Windows SDK Common Controls Library (commctrl.h / comctl32.lib)') endif endif endif diff --git a/meson_options.txt b/meson_options.txt index c003fbc1d..4481aa69d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -14,9 +14,6 @@ option('uchardet', type: 'feature', description: 'uchardet character encoding de option('system_luajit', type: 'boolean', value: false, description: 'Force using system luajit') option('local_boost', type: 'boolean', value: false, description: 'Force using locally compiled Boost') -option('icu_path', type: 'string', value: '', description: 'Path to ICU libraries on Windows') -option('wx_path', type: 'string', value: '', description: 'Path to wxWidgets libraries on Windows') - option('credit', type: 'string', value: '', description: 'Build credit shown in program title') option('enable_update_checker', type: 'boolean', value: false, description: 'Enable the update checker') From 60431862faf774bf79d78518e9509ab9f675a5ed Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 8 Nov 2020 13:04:16 -0500 Subject: [PATCH 160/271] meson: allow wx fallback on all platforms --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 01df6a50f..f32659344 100644 --- a/meson.build +++ b/meson.build @@ -102,7 +102,7 @@ endif deps += dependency('zlib') wx_dep = dependency('wxWidgets', version: '>=3.0.0', - required: cxx.get_id() != 'msvc', + required: false, modules: ['std', 'stc', 'gl']) if wx_dep.found() From 454c79c8ccad04fe785c0c37f55cb2f62cbee212 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Nov 2020 12:40:06 -0500 Subject: [PATCH 161/271] Remove travis file --- .travis.yml | 68 ----------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 421119d72..000000000 --- a/.travis.yml +++ /dev/null @@ -1,68 +0,0 @@ -sudo: required -dist: trusty -language: cpp - -git: - submodules: false - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - libasound2-dev - - libfftw3-dev - - libhunspell-dev - - yasm - - libfribidi-dev - - libass-dev - - libicu-dev - - luarocks - - g++-5 - -matrix: - include: - - compiler: gcc - env: BOOST_VERSION=55 - - compiler: gcc - env: BOOST_VERSION=60 - before_install: - - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 --slave /usr/bin/gcov gcov /usr/bin/gcov-5 - -install: - # Can't install these via the apt addon due to the whitelist - - sudo apt-get install -y -qq libffms2-dev libwxgtk3.0-dev libuchardet-dev - - - sudo pip install cpp-coveralls - - sudo luarocks install busted > /dev/null - - sudo luarocks install moonscript > /dev/null - - sudo luarocks install uuid > /dev/null - - - git submodule --quiet init - - git submodule --quiet update vendor/googletest - - - cd vendor - - rm -rf boost - - wget http://sourceforge.net/projects/boost/files/boost/1.${BOOST_VERSION}.0/boost_1_${BOOST_VERSION}_0.tar.bz2/download - - tar xjf download - - mv boost_1_${BOOST_VERSION}_0 boost - - cd boost - - ./bootstrap.sh - - ./b2 -j3 -layout=system threading=multi cxxflags=-std=c++11 link=shared variant=release --without-python --without-iostreams --without-serialization --without-graph --without-log --without-math --without-signals --without-test --without-wave --without-mpi --without-program_options --without-graph_parallel --without-context --without-coroutine --without-random --without-timer --without-date_time - - cd ../.. - -script: - - export CPATH=$(pwd)/vendor/boost - - export LD_LIBRARY_PATH=$(pwd)/vendor/boost/stage/lib:$LD_LIBRARY_PATH - - export CPPFLAGS="-fprofile-arcs -ftest-coverage" - - export LIBS="-lgcov" - - autoreconf -if - - ./configure BOOST_LDFLAGS="-L$(pwd)/vendor/boost/stage/lib" --enable-debug || cat config.log - - make -j3 all test - - coveralls --exclude vendor --exclude src --exclude build --exclude tools --exclude libaegisub/windows > /dev/null - -notifications: - email: - - on_success: change - - on_failure: change - From dc3aaa5df069883ef62f36a8938da2cc2b5a3fd6 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Nov 2020 12:42:12 -0500 Subject: [PATCH 162/271] meson: allow boost fallback under msvc --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f32659344..6b8e0b128 100644 --- a/meson.build +++ b/meson.build @@ -82,7 +82,7 @@ boost_modules = ['chrono', 'filesystem', 'thread', 'locale', 'regex'] if not get_option('local_boost') boost_dep = dependency('boost', version: '>=1.50.0', modules: boost_modules, - required: cxx.get_id() != 'msvc', + required: false, static: get_option('default_library') == 'static') endif From daa4cc8bbccefead573d07dec8e3f2c01e1ed5c7 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Nov 2020 12:43:26 -0500 Subject: [PATCH 163/271] meson: search for 'system' module with system boost System was made header-only by 1.74, so we can't check for it in the submodule, but when linking with older system boosts we need to make sure it gets linked in --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 6b8e0b128..88e222983 100644 --- a/meson.build +++ b/meson.build @@ -81,7 +81,7 @@ deps += dependency('libass', version: '>=0.9.7', boost_modules = ['chrono', 'filesystem', 'thread', 'locale', 'regex'] if not get_option('local_boost') boost_dep = dependency('boost', version: '>=1.50.0', - modules: boost_modules, + modules: boost_modules + ['system'], required: false, static: get_option('default_library') == 'static') endif From 7d4c99db5a6bb216b77a7d2855d5c11bb4cdde31 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Nov 2020 12:44:54 -0500 Subject: [PATCH 164/271] meson: switch to upstream freetype --- subprojects/freetype2.wrap | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/subprojects/freetype2.wrap b/subprojects/freetype2.wrap index 613f7d627..751c91d3c 100644 --- a/subprojects/freetype2.wrap +++ b/subprojects/freetype2.wrap @@ -1,10 +1,4 @@ -[wrap-file] -directory = freetype-2.9.1 - -source_url = https://download.savannah.gnu.org/releases/freetype/freetype-2.9.1.tar.gz -source_filename = freetype-2.9.1.tar.gz -source_hash = ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce - -patch_url = https://wrapdb.mesonbuild.com/v1/projects/freetype2/2.9.1/1/get_zip -patch_filename = freetype2-2.9.1-1-wrap.zip -patch_hash = 06222607775e707c6d7b8d21ffdb04c7672f676a18c5ebb9880545130ab0407b +[wrap-git] +directory = freetype2 +url = https://git.savannah.gnu.org/git/freetype/freetype2.git +revision = master From 17303d3846957383762117fd08f1e31ecefe97c8 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Nov 2020 12:46:43 -0500 Subject: [PATCH 165/271] actions: add initial ubuntu workflow --- .github/workflows/ci.yml | 71 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..d6f79acee --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,71 @@ +name: Meson CI + +on: + push: + branches: [ meson-vs2019 ] + pull_request: + branches: [ meson-vs2019 ] + +jobs: + build: + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + + strategy: + matrix: + config: + #- { + # name: Windows MSVC, + # os: windows-latest, + # msvc: true + #} + #- { + # name: Windows MinGW, + # os: windows-latest, + # msvc: false + #} + - { + name: "Ubuntu", + os: ubuntu-latest + } + #- { + # name: "macOS", + # os: macos-latest + #} + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + + - uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Setup Meson + run: | + python -m pip install --upgrade pip + pip install meson + + - name: Setup MSVC + if: matrix.config.os == 'windows-latest' && matrix.config.msvc == true + uses: ilammy/msvc-dev-cmd@v1 + + - name: Install dependencies (Windows) + if: matrix.config.os == 'windows-latest' + run: choco install ninja + + - name: Install dependencies (Linux) + if: matrix.config.os == 'ubuntu-latest' + run: sudo apt-get install ninja-build build-essential libx11-dev libwxgtk3.0-gtk3-dev libfreetype6-dev pkg-config libfontconfig1-dev libass-dev libasound2-dev libffms2-dev intltool libboost-all-dev + + - name: Configure (Windows) + if: matrix.config.os == 'windows-latest' + run: meson build -Db_vscrt=mdd -Ddefault_library=static + + - name: Configure (Linux) + if: matrix.config.os == 'ubuntu-latest' + run: meson build + + - name: Build + run: meson compile -C build From 0ea6d36fcaf2323de4dba723642b2ef02cdbbae1 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Thu, 19 Nov 2020 17:33:20 +0000 Subject: [PATCH 166/271] meson: don't generate git_version.xml and don't regenerate git_version.h on windows Also fix incorrect use of return outside function. Fixes #80 --- meson.build | 2 +- tools/version.ps1 | 19 ++++--------------- tools/version.sh | 17 +---------------- 3 files changed, 6 insertions(+), 32 deletions(-) diff --git a/meson.build b/meson.build index 88e222983..beecfd707 100644 --- a/meson.build +++ b/meson.build @@ -24,7 +24,7 @@ version_h = custom_target('git_version.h', command: [version_sh, meson.current_build_dir(), meson.current_source_dir()], build_by_default: true, build_always_stale: true, # has internal check whether target file will be refreshed - output: ['git_version.h', 'git_version.xml']) + output: ['git_version.h']) if host_machine.system() == 'darwin' and get_option('build_osx_bundle') prefix = meson.current_build_dir() / 'Aegisub.app' / 'Contents' diff --git a/tools/version.ps1 b/tools/version.ps1 index 3d0c62655..f02e47dc6 100644 --- a/tools/version.ps1 +++ b/tools/version.ps1 @@ -28,7 +28,6 @@ if ([System.IO.Path]::GetFullPath([System.IO.Path]::Combine((pwd).Path, $BuildRo $BuildRoot = Join-Path $repositoryRootPath 'build' } $gitVersionHeaderPath = Join-Path $BuildRoot 'git_version.h' -$gitVersionXmlPath = Join-Path $BuildRoot 'git_version.xml' $version = @{} if (Test-Path $gitVersionHeaderPath) { @@ -50,6 +49,10 @@ $gitHash = git -C $repositoryRootPath rev-parse --short HEAD 2>$null $gitVersionString = $gitRevision, $gitBranch, $gitHash -join '-' $exactGitTag = git -C $repositoryRootPath describe --exact-match --tags 2>$null +if ($gitVersionString -eq $version['BUILD_GIT_VERSION_STRING']) { + exit 0 +} + if ($exactGitTag -match $semVerMatch) { $version['TAGGED_RELEASE'] = $true $version['RESOURCE_BASE_VERSION'] = $Matches[1..3] @@ -84,17 +87,3 @@ $version.GetEnumerator() | %{ } "#define $($_.Key) $($fmtValue)" } | Out-File -FilePath $gitVersionHeaderPath -Encoding utf8 - -$gitVersionXml = [xml]@' - - - - - - - -'@ - -$gitVersionXml.Project.PropertyGroup.GitVersionNumber = $gitRevision.ToString() -$gitVersionXml.Project.PropertyGroup.GitVersionString = $gitVersionString -$gitVersionXml.Save($gitVersionXmlPath) diff --git a/tools/version.sh b/tools/version.sh index a2d3c7b39..485f45113 100755 --- a/tools/version.sh +++ b/tools/version.sh @@ -10,8 +10,7 @@ if ! test -d "${srcdir}/.git"; then export $2=$(echo $3 | sed 's/"//g') done < "${version_h_path}" if test x$BUILD_GIT_VERSION_NUMBER != x -a x$BUILD_GIT_VERSION_STRING != x; then - export VERSION_SOURCE="from cached git_version.h" - return 0 + exit 0 else echo "invalid git_version.h" exit 2 @@ -61,17 +60,3 @@ in "${new_version_h}");; *) echo "${new_version_h}" > "${version_h_path}" esac - -export BUILD_GIT_VERSION_NUMBER="${git_revision}" -export BUILD_GIT_VERSION_STRING="${git_version_str}" -export VERSION_SOURCE="from git" - -cat << EOF > "${builddir}/git_version.xml" - - - - ${git_revision} - ${git_version_str} - - -EOF From 8bb8b34fe7a5bd69fa6c58ad07a86a65de083259 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Thu, 19 Nov 2020 18:37:41 +0000 Subject: [PATCH 167/271] meson: set _DEBUG on all platforms for debug builds --- meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meson.build b/meson.build index beecfd707..e3f0aef76 100644 --- a/meson.build +++ b/meson.build @@ -45,6 +45,10 @@ if host_machine.system() == 'windows' add_project_arguments('-DNOMINMAX', '-D_WIN32_WINNT=0x0602', language: 'cpp') endif +if get_option('debug') + add_project_arguments('-D_DEBUG', language: 'cpp') +endif + conf = configuration_data() conf.set_quoted('P_DATA', dataroot) if get_option('credit') != '' From 6ff17293035bda123b2356609b1d244f8add454c Mon Sep 17 00:00:00 2001 From: Myaamori Date: Sun, 22 Nov 2020 19:54:56 +0000 Subject: [PATCH 168/271] meson: update/promote libass dependency wraps --- subprojects/freetype2.wrap | 3 +++ subprojects/fribidi.wrap | 3 +++ subprojects/libpng.wrap | 10 ++++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/subprojects/freetype2.wrap b/subprojects/freetype2.wrap index 751c91d3c..a86e85e54 100644 --- a/subprojects/freetype2.wrap +++ b/subprojects/freetype2.wrap @@ -2,3 +2,6 @@ directory = freetype2 url = https://git.savannah.gnu.org/git/freetype/freetype2.git revision = master + +[provide] +freetype = freetype2_dep diff --git a/subprojects/fribidi.wrap b/subprojects/fribidi.wrap index e3f62a688..55458fca9 100644 --- a/subprojects/fribidi.wrap +++ b/subprojects/fribidi.wrap @@ -2,3 +2,6 @@ directory = fribidi url = https://github.com/fribidi/fribidi.git revision = master + +[provide] +fribidi = libfribidi_dep diff --git a/subprojects/libpng.wrap b/subprojects/libpng.wrap index b7af9091c..8c7e3fdce 100644 --- a/subprojects/libpng.wrap +++ b/subprojects/libpng.wrap @@ -1,10 +1,12 @@ [wrap-file] directory = libpng-1.6.37 - source_url = https://github.com/glennrp/libpng/archive/v1.6.37.tar.gz source_filename = libpng-1.6.37.tar.gz source_hash = ca74a0dace179a8422187671aee97dd3892b53e168627145271cad5b5ac81307 +patch_url = https://wrapdb.mesonbuild.com/v1/projects/libpng/1.6.37/3/get_zip +patch_filename = libpng-1.6.37-3-wrap.zip +patch_hash = 6c9f32fd9150b3a96ab89be52af664e32207e10aa9f5fb9aa015989ee2dd7100 + +[provide] +libpng = libpng_dep -patch_url = https://wrapdb.mesonbuild.com/v1/projects/libpng/1.6.37/1/get_zip -patch_filename = libpng-1.6.37-1-wrap.zip -patch_hash = 9a863ae8a5657315a484c94c51f9f636b1fb9f49a15196cc896b72e5f21d78f0 From 93b2794c85ff3c9cec604432e8ccaa761f6144f5 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Sun, 22 Nov 2020 18:17:19 +0000 Subject: [PATCH 169/271] Correct wxStyledTextCtrl::StartStyling for wx 3.1 --- src/dialog_fonts_collector.cpp | 6 +++++- src/dialog_translation.cpp | 6 +++++- src/subs_edit_ctrl.cpp | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/dialog_fonts_collector.cpp b/src/dialog_fonts_collector.cpp index 78ac20ef5..d4d675e8a 100644 --- a/src/dialog_fonts_collector.cpp +++ b/src/dialog_fonts_collector.cpp @@ -400,7 +400,11 @@ void DialogFontsCollector::OnAddText(ValueEvent &event) { auto const& utf8 = str.second.utf8_str(); collection_log->AppendTextRaw(utf8.data(), utf8.length()); if (str.first) { - collection_log->StartStyling(pos, 31); +#if wxVERSION_NUMBER >= 3100 + collection_log->StartStyling(pos); +#else + collection_log->StartStyling(pos, 255); +#endif collection_log->SetStyling(utf8.length(), str.first); } collection_log->GotoPos(pos + utf8.length()); diff --git a/src/dialog_translation.cpp b/src/dialog_translation.cpp index c953b6874..b47d01b4c 100644 --- a/src/dialog_translation.cpp +++ b/src/dialog_translation.cpp @@ -246,7 +246,11 @@ void DialogTranslation::UpdateDisplay() { int initial_pos = original_text->GetLength(); original_text->AppendTextRaw(block->GetText().c_str()); if (i == cur_block) { - original_text->StartStyling(initial_pos, 31); +#if wxVERSION_NUMBER >= 3100 + original_text->StartStyling(initial_pos); +#else + original_text->StartStyling(initial_pos, 255); +#endif original_text->SetStyling(block->GetText().size(), 1); } } diff --git a/src/subs_edit_ctrl.cpp b/src/subs_edit_ctrl.cpp index 4618ea409..d744900eb 100644 --- a/src/subs_edit_ctrl.cpp +++ b/src/subs_edit_ctrl.cpp @@ -261,7 +261,11 @@ void SubsTextEditCtrl::UpdateStyle() { cursor_pos = -1; UpdateCallTip(); - StartStyling(0,255); +#if wxVERSION_NUMBER >= 3100 + StartStyling(0); +#else + StartStyling(0, 255); +#endif if (!OPT_GET("Subtitle/Highlight/Syntax")->GetBool()) { SetStyling(line_text.size(), 0); From aecf09a64d27f378e7fe2d721bc51f4ba49ded4d Mon Sep 17 00:00:00 2001 From: Myaamori Date: Sun, 22 Nov 2020 18:18:19 +0000 Subject: [PATCH 170/271] Use wxSizer::RepositionChildren instead of RecalcSizes on wx 3.1.3+ --- src/frame_main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frame_main.cpp b/src/frame_main.cpp index b35c32960..12172eb41 100644 --- a/src/frame_main.cpp +++ b/src/frame_main.cpp @@ -240,8 +240,12 @@ void FrameMain::SetDisplayMode(int video, int audio) { TopSizer->Show(videoBox, showVideo, true); ToolsSizer->Show(audioBox, showAudio, true); - MainSizer->CalcMin(); + auto min_size = MainSizer->CalcMin(); +#if wxVERSION_NUMBER >= 3103 + MainSizer->RepositionChildren(min_size); +#else MainSizer->RecalcSizes(); +#endif MainSizer->Layout(); Layout(); From abec21f4e0a06a581685be545352d382da0db421 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Sun, 22 Nov 2020 18:21:23 +0000 Subject: [PATCH 171/271] meson: fix wx subproject on Linux --- meson.build | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index e3f0aef76..4961e4a7b 100644 --- a/meson.build +++ b/meson.build @@ -120,17 +120,21 @@ else wx = cmake.subproject('wxWidgets', cmake_options: ['-DwxBUILD_INSTALL=OFF', '-DwxBUILD_PRECOMP=OFF', # otherwise breaks project generation w/ meson '-DwxBUILD_SHARED=@0@'.format(build_shared), + '-DwxUSE_WEBVIEW=OFF', # breaks build on linux '-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson deps += [ wx.dependency('wxmono'), - wx.dependency('wxzlib'), - wx.dependency('wxpng'), - wx.dependency('wxexpat'), wx.dependency('wxregex'), wx.dependency('wxscintilla') ] if host_machine.system() == 'windows' + deps += [ + wx.dependency('wxzlib'), + wx.dependency('wxpng'), + wx.dependency('wxexpat') + ] + if cc.has_header('rpc.h') deps += cc.find_library('rpcrt4', required: true) else From 3f1c315dfedab917ed9bca93ba6155f6bdbc4df5 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Nov 2020 13:08:33 -0500 Subject: [PATCH 172/271] meson: force zlib subproject for freetype --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6f79acee..7bd2ce18d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: - name: Configure (Windows) if: matrix.config.os == 'windows-latest' - run: meson build -Db_vscrt=mdd -Ddefault_library=static + run: meson build -Db_vscrt=mdd -Ddefault_library=static -Dfreetype2:zlib=system --force-fallback-for=zlib - name: Configure (Linux) if: matrix.config.os == 'ubuntu-latest' From 8a09d00081f6baf57eee4f205e92d6849d0279cb Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Nov 2020 13:10:21 -0500 Subject: [PATCH 173/271] actions: enable MSVC --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7bd2ce18d..ae08ccb87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,11 +14,11 @@ jobs: strategy: matrix: config: - #- { - # name: Windows MSVC, - # os: windows-latest, - # msvc: true - #} + - { + name: Windows MSVC, + os: windows-latest, + msvc: true + } #- { # name: Windows MinGW, # os: windows-latest, From 18ccc1d7f00b61ffbee69a5693c37dc43c5572ea Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Nov 2020 14:43:40 -0500 Subject: [PATCH 174/271] meson: disable building ffmpeg tests --- subprojects/packagefiles/ffms2/meson.build | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subprojects/packagefiles/ffms2/meson.build b/subprojects/packagefiles/ffms2/meson.build index a7328ea8d..8c6a07851 100644 --- a/subprojects/packagefiles/ffms2/meson.build +++ b/subprojects/packagefiles/ffms2/meson.build @@ -3,11 +3,11 @@ project('ffms2', 'cpp', version: '2.40.0') deps = [] deps += dependency('zlib') -deps += dependency('libavformat') -deps += dependency('libavcodec') -deps += dependency('libswscale') -deps += dependency('libavutil') -deps += dependency('libswresample') +deps += dependency('libavformat', default_options: ['tests=disabled']) +deps += dependency('libavcodec', default_options: ['tests=disabled']) +deps += dependency('libswscale', default_options: ['tests=disabled']) +deps += dependency('libavutil', default_options: ['tests=disabled']) +deps += dependency('libswresample', default_options: ['tests=disabled']) args = ['-D_FILE_OFFSET_BITNS=64', '-DFFMS_EXPORTS', '-D__STDC_CONSTANT_MACROS'] usage_args = [] From f91f6f07438d833579295c87b64dbeebc4b5edf0 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Nov 2020 15:41:56 -0500 Subject: [PATCH 175/271] meson: pass png=enable to freetype2 to work around bug See https://savannah.nongnu.org/bugs/?59458 --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae08ccb87..0b6d8879e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,8 @@ jobs: - name: Configure (Windows) if: matrix.config.os == 'windows-latest' - run: meson build -Db_vscrt=mdd -Ddefault_library=static -Dfreetype2:zlib=system --force-fallback-for=zlib + # -Dfreetype2:png=enabled is a workaround for https://savannah.nongnu.org/bugs/?59458 + run: meson build -Db_vscrt=mdd -Ddefault_library=static -Dfreetype2:zlib=system --force-fallback-for=zlib -Dfreetype2:png=enabled - name: Configure (Linux) if: matrix.config.os == 'ubuntu-latest' From cd0eee968f961372335828dacce6e2338dfb500d Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Nov 2020 15:59:26 -0500 Subject: [PATCH 176/271] meson: minor subproject cleanup, update gitignore --- .gitignore | 29 +++++++++++++++++------------ subprojects/harfbuzz.wrap | 3 +++ subprojects/iconv/meson.build | 2 +- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index b8181d675..854d4d565 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ packages/desktop/aegisub.desktop packages/desktop/aegisub.desktop.template -packages/win_installer/vendor src/libresrc/bitmap.cpp src/libresrc/bitmap.h src/libresrc/default_config.cpp @@ -26,15 +25,21 @@ tools/repack-thes-dict.dSYM # Meson build*/ -subprojects/freetype* -subprojects/fribidi -subprojects/harfbuzz -subprojects/libass -subprojects/libpng* -subprojects/packagecache -subprojects/zlib* -subprojects/libass -subprojects/icu +subprojects/boost*/ +subprojects/cairo* subprojects/ffmpeg -subprojects/ffms2* -subprojects/boost* +subprojects/ffms2-* +subprojects/fontconfig* +subprojects/freetype2 +subprojects/fribidi +subprojects/glib* +subprojects/harfbuzz +subprojects/icu +subprojects/libass +subprojects/libffi* +subprojects/libpng-* +subprojects/nasm-* +subprojects/packagecache +subprojects/proxy-libintl* +subprojects/wxWidgets +subprojects/zlib-* diff --git a/subprojects/harfbuzz.wrap b/subprojects/harfbuzz.wrap index 3d320e894..08bfb0850 100644 --- a/subprojects/harfbuzz.wrap +++ b/subprojects/harfbuzz.wrap @@ -2,3 +2,6 @@ directory = harfbuzz url = https://github.com/harfbuzz/harfbuzz revision = master + +[provide] +harfbuzz = libharfbuzz_dep diff --git a/subprojects/iconv/meson.build b/subprojects/iconv/meson.build index 66cdc9806..458cd9d51 100644 --- a/subprojects/iconv/meson.build +++ b/subprojects/iconv/meson.build @@ -1,5 +1,5 @@ project('iconv', 'c', license: 'LGPL', - meson_version: '>=0.49.0') + meson_version: '>=0.54.0') iconv_src = [ 'libcharset/localcharset.c', From 4dc65303a1291e6037272f60b299292cca30adb4 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Nov 2020 16:49:04 -0500 Subject: [PATCH 177/271] actions: force default_library=static for freetype --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b6d8879e..12890a584 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: - name: Configure (Windows) if: matrix.config.os == 'windows-latest' # -Dfreetype2:png=enabled is a workaround for https://savannah.nongnu.org/bugs/?59458 - run: meson build -Db_vscrt=mdd -Ddefault_library=static -Dfreetype2:zlib=system --force-fallback-for=zlib -Dfreetype2:png=enabled + run: meson build -Db_vscrt=mdd -Ddefault_library=static -Dfreetype2:zlib=system --force-fallback-for=zlib -Dfreetype2:png=enabled -Dfreetype2:default_library=static - name: Configure (Linux) if: matrix.config.os == 'ubuntu-latest' From c5111b492b9ee4802cefa2717255eed1f0bd07d8 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 15 Nov 2020 19:26:59 -0500 Subject: [PATCH 178/271] actions: force fallback for harfbuzz --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12890a584..705b545d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: - name: Configure (Windows) if: matrix.config.os == 'windows-latest' # -Dfreetype2:png=enabled is a workaround for https://savannah.nongnu.org/bugs/?59458 - run: meson build -Db_vscrt=mdd -Ddefault_library=static -Dfreetype2:zlib=system --force-fallback-for=zlib -Dfreetype2:png=enabled -Dfreetype2:default_library=static + run: meson build -Db_vscrt=mdd -Ddefault_library=static --force-fallback-for=zlib,harfbuzz -Dfreetype2:zlib=system -Dfreetype2:png=enabled -Dfreetype2:default_library=static - name: Configure (Linux) if: matrix.config.os == 'ubuntu-latest' From 89c788a4b3673b1abed5492b9c059726b2f70913 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 21 Nov 2020 15:44:46 -0500 Subject: [PATCH 179/271] autotools: remove remaining makefiles --- packages/desktop/Makefile | 26 -- po/Makefile | 24 -- src/Makefile | 208 ---------- src/libresrc/Makefile | 37 -- subprojects/luabins/Makefile | 8 - subprojects/luajit/Makefile | 15 - subprojects/luajit/src/Makefile | 689 -------------------------------- tools/Makefile | 17 - 8 files changed, 1024 deletions(-) delete mode 100644 packages/desktop/Makefile delete mode 100644 po/Makefile delete mode 100644 src/Makefile delete mode 100644 src/libresrc/Makefile delete mode 100644 subprojects/luabins/Makefile delete mode 100644 subprojects/luajit/Makefile delete mode 100644 subprojects/luajit/src/Makefile delete mode 100644 tools/Makefile diff --git a/packages/desktop/Makefile b/packages/desktop/Makefile deleted file mode 100644 index 47a21a63a..000000000 --- a/packages/desktop/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))../../header.mk -DESKTOP_SRC := $(d) - -ICONS = $(sort $(wildcard $(d)*.png)) $(sort $(wildcard $(d)*.svg)) -ICONS_INSTALLED = $(DESTDIR)$(P_ICON)/hicolor/%/apps/aegisub. - -DESKTOP_FILE := $(d)aegisub.desktop -DESKTOP_FILE_PO := $(d)../../po -DESKTOP_FILE_INSTALLED = $(DESTDIR)$(P_DESKTOP)/$(notdir $(DESKTOP_FILE)) - -DISTCLEANFILES += $(DESKTOP_FILE) - -%.desktop: %.desktop.template $(DESKTOP_FILE_PO) - intltool-merge --quiet --desktop-style $(DESKTOP_FILE_PO) $< $@ - -$(ICONS_INSTALLED)png: $(d)%.png ; $(MKDIR_INSTALL) -$(ICONS_INSTALLED)svg: $(d)%.svg ; $(MKDIR_INSTALL) -$(DESKTOP_FILE_INSTALLED): $(DESKTOP_FILE) ; $(MKDIR_INSTALL) - -ifneq (yes, $(BUILD_DARWIN)) -install: \ - $(DESKTOP_FILE_INSTALLED) \ - $(patsubst %.png, $(ICONS_INSTALLED)png, $(patsubst %.svg, $(ICONS_INSTALLED)svg, $(notdir $(ICONS)))) -endif - -include $(TOP)Makefile.target diff --git a/po/Makefile b/po/Makefile deleted file mode 100644 index 4c7832b6a..000000000 --- a/po/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk - -.SUFFIXES: .po .mo - -PO := $(wildcard $(d)*.po) -MO := $(PO:po=mo) - -ifeq (yes, $(BUILD_DARWIN)) -MO_INSTALLED = $(DESTDIR)$(P_LOCALE)/%.lproj/$(AEGISUB_CATALOG).mo -else -MO_INSTALLED = $(DESTDIR)$(P_LOCALE)/%/LC_MESSAGES/$(AEGISUB_CATALOG).mo -endif - -%.mo: %.po - $(BIN_MSGFMT) -o $@ $< - -$(MO_INSTALLED): $(d)%.mo ; $(MKDIR_INSTALL) - -all: $(MO) -install: $(patsubst %.mo, $(MO_INSTALLED), $(notdir $(MO))) - -CLEANFILES += $(MO) - -include $(TOP)Makefile.target diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index 38a809c06..000000000 --- a/src/Makefile +++ /dev/null @@ -1,208 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk - -PROGRAM += $(d)src - -src_CPPFLAGS := -I$(d) -I.. -I$(d)include -I$(TOP)libaegisub/include -I$(TOP)build \ - $(CFLAGS_PTHREAD) $(CFLAGS_FFTW3) $(CFLAGS_ICU) $(CPPFLAGS_BOOST) -src_CXXFLAGS := $(CXXFLAGS_WX) -src_LIBS := $(LIBS_GL) $(LIBS_PTHREAD) $(LIBS_WX) $(LIBS_FREETYPE) \ - $(LIBS_LIBASS) $(LIBS_FONTCONFIG) $(LIBS_FFTW3) $(LIBS_BOOST) $(LIBS_ICU) -src_PCH := $(d)agi_pre.h -src_INSTALLNAME := $(AEGISUB_COMMAND) - -src_OBJ := \ - $(patsubst %.cpp,%.o,$(sort $(wildcard $(d)command/*.cpp))) \ - $(patsubst %.cpp,%.o,$(sort $(wildcard $(d)dialog_*.cpp))) \ - $(patsubst %.cpp,%.o,$(sort $(wildcard $(d)subtitle_format*.cpp))) \ - $(patsubst %.cpp,%.o,$(sort $(wildcard $(d)visual_tool*.cpp))) \ - $(d)MatroskaParser.o \ - $(d)aegisublocale.o \ - $(d)ass_attachment.o \ - $(d)ass_dialogue.o \ - $(d)ass_entry.o \ - $(d)ass_export_filter.o \ - $(d)ass_exporter.o \ - $(d)ass_file.o \ - $(d)ass_karaoke.o \ - $(d)ass_override.o \ - $(d)ass_parser.o \ - $(d)ass_style.o \ - $(d)ass_style_storage.o \ - $(d)async_video_provider.o \ - $(d)audio_box.o \ - $(d)audio_colorscheme.o \ - $(d)audio_controller.o \ - $(d)audio_display.o \ - $(d)audio_karaoke.o \ - $(d)audio_marker.o \ - $(d)audio_player.o \ - $(d)audio_provider_factory.o \ - $(d)audio_renderer.o \ - $(d)audio_renderer_spectrum.o \ - $(d)audio_renderer_waveform.o \ - $(d)audio_timing_dialogue.o \ - $(d)audio_timing_karaoke.o \ - $(d)auto4_base.o \ - $(d)auto4_lua.o \ - $(d)auto4_lua_assfile.o \ - $(d)auto4_lua_dialog.o \ - $(d)auto4_lua_progresssink.o \ - $(d)avisynth_wrap.o \ - $(d)base_grid.o \ - $(d)charset_detect.o \ - $(d)colorspace.o \ - $(d)colour_button.o \ - $(d)compat.o \ - $(d)context.o \ - $(d)crash_writer.o \ - $(d)export_fixstyle.o \ - $(d)export_framerate.o \ - $(d)fft.o \ - $(d)font_file_lister.o \ - $(d)frame_main.o \ - $(d)gl_text.o \ - $(d)gl_wrap.o \ - $(d)grid_column.o \ - $(d)help_button.o \ - $(d)hotkey.o \ - $(d)hotkey_data_view_model.o \ - $(d)initial_line_state.o \ - $(d)main.o \ - $(d)menu.o \ - $(d)mkv_wrap.o \ - $(d)pen.o \ - $(d)persist_location.o \ - $(d)preferences.o \ - $(d)preferences_base.o \ - $(d)project.o \ - $(d)resolution_resampler.o \ - $(d)search_replace_engine.o \ - $(d)selection_controller.o \ - $(d)spellchecker.o \ - $(d)spline.o \ - $(d)spline_curve.o \ - $(d)string_codec.o \ - $(d)subs_controller.o \ - $(d)subs_edit_box.o \ - $(d)subs_edit_ctrl.o \ - $(d)subs_preview.o \ - $(d)subtitles_provider.o \ - $(d)subtitles_provider_libass.o \ - $(d)text_file_reader.o \ - $(d)text_file_writer.o \ - $(d)text_selection_controller.o \ - $(d)thesaurus.o \ - $(d)timeedit_ctrl.o \ - $(d)toggle_bitmap.o \ - $(d)toolbar.o \ - $(d)tooltip_manager.o \ - $(d)utils.o \ - $(d)validators.o \ - $(d)vector2d.o \ - $(d)version.o \ - $(d)video_box.o \ - $(d)video_controller.o \ - $(d)video_display.o \ - $(d)video_frame.o \ - $(d)video_out_gl.o \ - $(d)video_provider_cache.o \ - $(d)video_provider_dummy.o \ - $(d)video_provider_manager.o \ - $(d)video_provider_yuv4mpeg.o \ - $(d)video_slider.o \ - $(d)visual_feature.o \ - $(LIBS_LUA) \ - $(TOP)lib/libaegisub.a \ - $(TOP)lib/libluabins.a \ - $(TOP)lib/libresrc.a \ - -ifeq (yes, $(BUILD_DARWIN)) -src_OBJ += $(d)font_file_lister_coretext.o -src_OBJ += $(patsubst %.mm,%.o,$(sort $(wildcard $(d)osx/*.mm))) -$(d)font_file_lister_coretext.o_FLAGS := -fobjc-arc -else -src_OBJ += $(d)font_file_lister_fontconfig.o -endif - -############### -# AUDIO PLAYERS -############### -$(d)audio_player_alsa.o_FLAGS := $(CFLAGS_ALSA) -$(d)audio_player_portaudio.o_FLAGS := $(CFLAGS_PORTAUDIO) -$(d)audio_player_pulse.o_FLAGS := $(CFLAGS_LIBPULSE) -$(d)audio_player_openal.o_FLAGS := $(CFLAGS_OPENAL) -$(d)audio_player_oss.o_FLAGS := $(CFLAGS_OSS) - -ifeq (yes, $(HAVE_ALSA)) -src_LIBS += $(LIBS_ALSA) -src_OBJ += $(d)audio_player_alsa.o -endif - -ifeq (yes, $(HAVE_PORTAUDIO)) -src_LIBS += $(LIBS_PORTAUDIO) -src_OBJ += $(d)audio_player_portaudio.o -endif - -ifeq (yes, $(HAVE_LIBPULSE)) -src_LIBS += $(LIBS_LIBPULSE) -src_OBJ += $(d)audio_player_pulse.o -endif - -ifeq (yes, $(HAVE_OPENAL)) -src_LIBS += $(LIBS_OPENAL) -src_OBJ += $(d)audio_player_openal.o -endif - -ifeq (yes, $(HAVE_OSS)) -src_OBJ += $(d)audio_player_oss.o -endif - -####################### -# AUDIO / VIDEO SUPPORT -####################### -ifeq (yes, $(HAVE_FFMS2)) -$(d)audio_provider_ffmpegsource.o_FLAGS := $(CFLAGS_FFMS2) -$(d)video_provider_ffmpegsource.o_FLAGS := $(CFLAGS_FFMS2) -$(d)ffmpegsource_common.o_FLAGS := $(CFLAGS_FFMS2) -$(d)preferences.o_FLAGS := $(CFLAGS_FFMS2) -src_LIBS += $(LIBS_FFMS2) -src_OBJ += \ - $(d)audio_provider_ffmpegsource.o \ - $(d)video_provider_ffmpegsource.o \ - $(d)ffmpegsource_common.o -endif - -############## -# MISCELLANOUS -############## -ifeq (yes, $(HAVE_HUNSPELL)) -$(d)spellchecker_hunspell.o_FLAGS := $(CFLAGS_HUNSPELL) -src_LIBS += $(LIBS_HUNSPELL) -src_OBJ += $(d)spellchecker_hunspell.o -endif - -ifeq (yes, $(HAVE_UCHARDET)) -src_LIBS += $(LIBS_UCHARDET) -endif - -##################### -# SOURCE-LEVEL CFLAGS -##################### -$(d)MatroskaParser.o_FLAGS := -Wno-sometimes-uninitialized -$(d)audio_player.o_FLAGS := $(CFLAGS_ALSA) $(CFLAGS_PORTAUDIO) $(CFLAGS_LIBPULSE) $(CFLAGS_OPENAL) -$(d)audio_provider_factory.o_FLAGS := $(CFLAGS_FFMS2) -$(d)auto4_base.o_FLAGS := $(CFLAGS_FREETYPE) -$(d)charset_detect.o_FLAGS := -D_X86_ -$(d)font_file_lister_fontconfig.o_FLAGS := $(CFLAGS_FONTCONFIG) -$(d)subtitles_provider.o_FLAGS := $(CFLAGS_LIBASS) -$(d)subtitles_provider_libass.o_FLAGS := $(CFLAGS_LIBASS) -Wno-c++11-narrowing -$(d)text_file_reader.o_FLAGS := -D_X86_ -$(d)video_provider_manager.o_FLAGS := $(CFLAGS_FFMS2) -$(d)auto4_lua.o_FLAGS := $(CFLAGS_LUA) -$(d)auto4_lua_assfile.o_FLAGS := $(CFLAGS_LUA) -$(d)auto4_lua_dialog.o_FLAGS := $(CFLAGS_LUA) -$(d)auto4_lua_progresssink.o_FLAGS := $(CFLAGS_LUA) - -$(src_OBJ): $(d)libresrc/bitmap.h $(d)libresrc/default_config.h - -include $(d)libresrc/Makefile diff --git a/src/libresrc/Makefile b/src/libresrc/Makefile deleted file mode 100644 index 8b6d19595..000000000 --- a/src/libresrc/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))../../header.mk - -LIB += resrc - -resrc_CPPFLAGS := -I$(TOP) -I$(d) $(CPPFLAGS_WX) -resrc_OBJ := \ - $(d)bitmap.o \ - $(d)default_config.o \ - $(d)libresrc.o - -$(resrc_OBJ): $(d)default_config.h $(d)bitmap.h $(d)default_config.cpp $(d)bitmap.cpp - -RESPACK := cd $(TOP)src/libresrc; $(BIN_LUA) $(TOP)tools/respack.lua - -$(d)bitmap.cpp: $(d)bitmap.h -$(d)default_config.cpp: $(d)default_config.h - -$(d)bitmap.h: $(TOP)tools/respack.lua $(d)../bitmaps/button - $(RESPACK) ../bitmaps/manifest.respack bitmap.cpp bitmap.h - -ifeq (yes, $(BUILD_DARWIN)) -$(d)default_config.h: $(TOP)tools/respack.lua $(d)*.json $(d)osx/*.json - $(RESPACK) manifest_osx.respack default_config.cpp default_config.h -else -$(d)default_config.h: $(TOP)tools/respack.lua $(d)*.json - $(RESPACK) manifest.respack default_config.cpp default_config.h -endif - -CLEANFILES += \ - $(d)bitmap.cpp \ - $(d)bitmap.h \ - $(d)default_config.cpp \ - $(d)default_config.h - -DISTCLEANFILES += $(d)default_config_platform.json - -include $(TOP)Makefile.target diff --git a/subprojects/luabins/Makefile b/subprojects/luabins/Makefile deleted file mode 100644 index b4b01036e..000000000 --- a/subprojects/luabins/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))../../header.mk - -luabins_OBJ := $(patsubst %.c,%.o,$(sort $(wildcard $(d)src/*.c))) -luabins_CPPFLAGS := $(CFLAGS_LUA) - -LIB += luabins - -include $(TOP)Makefile.target diff --git a/subprojects/luajit/Makefile b/subprojects/luajit/Makefile deleted file mode 100644 index 67c67f727..000000000 --- a/subprojects/luajit/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))../../header.mk - -LUAJIT_DIR := $(abspath $(d)src) - -$(LIBS_LUA): $(LUAJIT_DIR)/host/minilua - $(MAKE) -C $(LUAJIT_DIR) amalg V=$(V) - -$(LUAJIT_DIR)/host/minilua: - $(MAKE) -C $(LUAJIT_DIR) host/minilua V=$(V) - -clean-luajit: - $(MAKE) -C $(LUAJIT_DIR) clean - -clean: clean-luajit -distclean: clean-luajit diff --git a/subprojects/luajit/src/Makefile b/subprojects/luajit/src/Makefile deleted file mode 100644 index 16ddd9a17..000000000 --- a/subprojects/luajit/src/Makefile +++ /dev/null @@ -1,689 +0,0 @@ -############################################################################## -# LuaJIT Makefile. Requires GNU Make. -# -# Please read doc/install.html before changing any variables! -# -# Suitable for POSIX platforms (Linux, *BSD, OSX etc.). -# Also works with MinGW and Cygwin on Windows. -# Please check msvcbuild.bat for building with MSVC on Windows. -# -# Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -############################################################################## - -MAJVER= 2 -MINVER= 0 -RELVER= 5 -ABIVER= 5.1 -NODOTABIVER= 51 - -############################################################################## -############################# COMPILER OPTIONS ############################# -############################################################################## -# These options mainly affect the speed of the JIT compiler itself, not the -# speed of the JIT-compiled code. Turn any of the optional settings on by -# removing the '#' in front of them. Make sure you force a full recompile -# with "make clean", followed by "make" if you change any options. -# -DEFAULT_CC = gcc -# -# LuaJIT builds as a native 32 or 64 bit binary by default. -CC= $(DEFAULT_CC) -# -# Use this if you want to force a 32 bit build on a 64 bit multilib OS. -#CC= $(DEFAULT_CC) -m32 -# -# Since the assembler part does NOT maintain a frame pointer, it's pointless -# to slow down the C part by not omitting it. Debugging, tracebacks and -# unwinding are not affected -- the assembler part has frame unwind -# information and GCC emits it where needed (x64) or with -g (see CCDEBUG). -CCOPT= -O2 -fomit-frame-pointer -# Use this if you want to generate a smaller binary (but it's slower): -#CCOPT= -Os -fomit-frame-pointer -# Note: it's no longer recommended to use -O3 with GCC 4.x. -# The I-Cache bloat usually outweighs the benefits from aggressive inlining. -# -# Target-specific compiler options: -# -# x86 only: it's recommended to compile at least for i686. Better yet, -# compile for an architecture that has SSE2, too (-msse -msse2). -# -# x86/x64 only: For GCC 4.2 or higher and if you don't intend to distribute -# the binaries to a different machine you could also use: -march=native -# -CCOPT_x86= -march=i686 -CCOPT_x64= -CCOPT_arm= -CCOPT_ppc= -CCOPT_ppcspe= -CCOPT_mips= -# -CCDEBUG= -# Uncomment the next line to generate debug information: -#CCDEBUG= -g -# -CCWARN= -Wall -# Uncomment the next line to enable more warnings: -#CCWARN+= -Wextra -Wdeclaration-after-statement -Wredundant-decls -Wshadow -Wpointer-arith -# -############################################################################## - -############################################################################## -################################ BUILD MODE ################################ -############################################################################## -# The default build mode is mixed mode on POSIX. On Windows this is the same -# as dynamic mode. -# -# Mixed mode creates a static + dynamic library and a statically linked luajit. -#BUILDMODE= mixed -# -# Static mode creates a static library and a statically linked luajit. -BUILDMODE= static -# -# Dynamic mode creates a dynamic library and a dynamically linked luajit. -# Note: this executable will only run when the library is installed! -#BUILDMODE= dynamic -# -############################################################################## - -############################################################################## -################################# FEATURES ################################# -############################################################################## -# Enable/disable these features as needed, but make sure you force a full -# recompile with "make clean", followed by "make". -XCFLAGS= -# -# Permanently disable the FFI extension to reduce the size of the LuaJIT -# executable. But please consider that the FFI library is compiled-in, -# but NOT loaded by default. It only allocates any memory, if you actually -# make use of it. -#XCFLAGS+= -DLUAJIT_DISABLE_FFI -# -# Features from Lua 5.2 that are unlikely to break existing code are -# enabled by default. Some other features that *might* break some existing -# code (e.g. __pairs or os.execute() return values) can be enabled here. -# Note: this does not provide full compatibility with Lua 5.2 at this time. -XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT -# -# Disable the JIT compiler, i.e. turn LuaJIT into a pure interpreter. -#XCFLAGS+= -DLUAJIT_DISABLE_JIT -# -# Some architectures (e.g. PPC) can use either single-number (1) or -# dual-number (2) mode. Uncomment one of these lines to override the -# default mode. Please see LJ_ARCH_NUMMODE in lj_arch.h for details. -#XCFLAGS+= -DLUAJIT_NUMMODE=1 -#XCFLAGS+= -DLUAJIT_NUMMODE=2 -# -############################################################################## - -############################################################################## -############################ DEBUGGING SUPPORT ############################# -############################################################################## -# Enable these options as needed, but make sure you force a full recompile -# with "make clean", followed by "make". -# Note that most of these are NOT suitable for benchmarking or release mode! -# -# Use the system provided memory allocator (realloc) instead of the -# bundled memory allocator. This is slower, but sometimes helpful for -# debugging. This option cannot be enabled on x64, since realloc usually -# doesn't return addresses in the right address range. -# OTOH this option is mandatory for Valgrind's memcheck tool on x64 and -# the only way to get useful results from it for all other architectures. -#XCFLAGS+= -DLUAJIT_USE_SYSMALLOC -# -# This define is required to run LuaJIT under Valgrind. The Valgrind -# header files must be installed. You should enable debug information, too. -# Use --suppressions=lj.supp to avoid some false positives. -#XCFLAGS+= -DLUAJIT_USE_VALGRIND -# -# This is the client for the GDB JIT API. GDB 7.0 or higher is required -# to make use of it. See lj_gdbjit.c for details. Enabling this causes -# a non-negligible overhead, even when not running under GDB. -#XCFLAGS+= -DLUAJIT_USE_GDBJIT -# -# Turn on assertions for the Lua/C API to debug problems with lua_* calls. -# This is rather slow -- use only while developing C libraries/embeddings. -#XCFLAGS+= -DLUA_USE_APICHECK -# -# Turn on assertions for the whole LuaJIT VM. This significantly slows down -# everything. Use only if you suspect a problem with LuaJIT itself. -#XCFLAGS+= -DLUA_USE_ASSERT -# -############################################################################## -# You probably don't need to change anything below this line! -############################################################################## - -############################################################################## -# Host system detection. -############################################################################## - -ifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM)) - HOST_SYS= Windows - HOST_RM= del -else - HOST_SYS:= $(shell uname -s) - ifneq (,$(findstring MINGW,$(HOST_SYS))) - HOST_SYS= Windows - HOST_MSYS= mingw - endif - ifneq (,$(findstring CYGWIN,$(HOST_SYS))) - HOST_SYS= Windows - HOST_MSYS= cygwin - endif -endif - -############################################################################## -# Flags and options for host and target. -############################################################################## - -# You can override the following variables at the make command line: -# CC HOST_CC STATIC_CC DYNAMIC_CC -# CFLAGS HOST_CFLAGS TARGET_CFLAGS -# LDFLAGS HOST_LDFLAGS TARGET_LDFLAGS TARGET_SHLDFLAGS -# LIBS HOST_LIBS TARGET_LIBS -# CROSS HOST_SYS TARGET_SYS TARGET_FLAGS -# -# Cross-compilation examples: -# make HOST_CC="gcc -m32" CROSS=i586-mingw32msvc- TARGET_SYS=Windows -# make HOST_CC="gcc -m32" CROSS=powerpc-linux-gnu- - -CCOPTIONS= $(CCDEBUG) $(CCOPT) $(CCWARN) $(XCFLAGS) $(CFLAGS) -LDOPTIONS= $(CCDEBUG) $(LDFLAGS) - -HOST_CC= $(CC) -HOST_RM= rm -f -# If left blank, minilua is built and used. You can supply an installed -# copy of (plain) Lua 5.1 or 5.2, plus Lua BitOp. E.g. with: HOST_LUA=lua -HOST_LUA= - -HOST_XCFLAGS= -I. -HOST_XLDFLAGS= -HOST_XLIBS= -HOST_ACFLAGS= $(CCOPTIONS) $(HOST_XCFLAGS) $(TARGET_ARCH) $(HOST_CFLAGS) -HOST_ALDFLAGS= $(LDOPTIONS) $(HOST_XLDFLAGS) $(HOST_LDFLAGS) -HOST_ALIBS= $(HOST_XLIBS) $(LIBS) $(HOST_LIBS) - -STATIC_CC = $(CROSS)$(CC) -DYNAMIC_CC = $(CROSS)$(CC) -fPIC -TARGET_CC= $(STATIC_CC) -TARGET_STCC= $(STATIC_CC) -TARGET_DYNCC= $(DYNAMIC_CC) -TARGET_LD= $(CROSS)$(CC) -TARGET_AR= $(CROSS)ar rcus 2>/dev/null -TARGET_STRIP= $(CROSS)strip - -TARGET_LIBPATH= $(or $(PREFIX),/usr/local)/$(or $(MULTILIB),lib) -TARGET_SONAME= libluajit-$(ABIVER).so.$(MAJVER) -TARGET_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).dylib -TARGET_DYLIBPATH= $(TARGET_LIBPATH)/$(TARGET_DYLIBNAME) -TARGET_DLLNAME= lua$(NODOTABIVER).dll -TARGET_XSHLDFLAGS= -shared -fPIC -Wl,-soname,$(TARGET_SONAME) -TARGET_DYNXLDOPTS= - -TARGET_LFSFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -TARGET_XCFLAGS= $(TARGET_LFSFLAGS) -U_FORTIFY_SOURCE -TARGET_XLDFLAGS= -TARGET_XLIBS= -lm -TARGET_TCFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS) -TARGET_ACFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS) -TARGET_ALDFLAGS= $(LDOPTIONS) $(TARGET_XLDFLAGS) $(TARGET_FLAGS) $(TARGET_LDFLAGS) -TARGET_ASHLDFLAGS= $(LDOPTIONS) $(TARGET_XSHLDFLAGS) $(TARGET_FLAGS) $(TARGET_SHLDFLAGS) -TARGET_ALIBS= $(TARGET_XLIBS) $(LIBS) $(TARGET_LIBS) - -TARGET_TESTARCH=$(shell $(TARGET_CC) $(TARGET_TCFLAGS) -E lj_arch.h -dM) -ifneq (,$(findstring LJ_TARGET_X64 ,$(TARGET_TESTARCH))) - TARGET_LJARCH= x64 -else -ifneq (,$(findstring LJ_TARGET_X86 ,$(TARGET_TESTARCH))) - TARGET_LJARCH= x86 -else -ifneq (,$(findstring LJ_TARGET_ARM ,$(TARGET_TESTARCH))) - TARGET_LJARCH= arm -else -ifneq (,$(findstring LJ_TARGET_PPC ,$(TARGET_TESTARCH))) - TARGET_LJARCH= ppc -else -ifneq (,$(findstring LJ_TARGET_PPCSPE ,$(TARGET_TESTARCH))) - TARGET_LJARCH= ppcspe -else -ifneq (,$(findstring LJ_TARGET_MIPS ,$(TARGET_TESTARCH))) - ifneq (,$(findstring MIPSEL ,$(TARGET_TESTARCH))) - TARGET_ARCH= -D__MIPSEL__=1 - endif - TARGET_LJARCH= mips -else - $(error Unsupported target architecture) -endif -endif -endif -endif -endif -endif - -ifneq (,$(findstring LJ_TARGET_PS3 1,$(TARGET_TESTARCH))) - TARGET_SYS= PS3 - TARGET_ARCH+= -D__CELLOS_LV2__ - TARGET_XCFLAGS+= -DLUAJIT_USE_SYSMALLOC -endif - -TARGET_XCFLAGS+= $(CCOPT_$(TARGET_LJARCH)) -TARGET_ARCH+= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET_LJARCH)) - -ifneq (,$(PREFIX)) -ifneq (/usr/local,$(PREFIX)) - TARGET_XCFLAGS+= -DLUA_ROOT=\"$(PREFIX)\" - ifneq (/usr,$(PREFIX)) - TARGET_DYNXLDOPTS= -Wl,-rpath,$(TARGET_LIBPATH) - endif -endif -endif -ifneq (,$(MULTILIB)) - TARGET_XCFLAGS+= -DLUA_MULTILIB=\"$(MULTILIB)\" -endif -ifneq (,$(LMULTILIB)) - TARGET_XCFLAGS+= -DLUA_LMULTILIB=\"$(LMULTILIB)\" -endif - -############################################################################## -# Target system detection. -############################################################################## - -TARGET_SYS?= $(HOST_SYS) -ifeq (Windows,$(TARGET_SYS)) - TARGET_STRIP+= --strip-unneeded - TARGET_XSHLDFLAGS= -shared - TARGET_DYNXLDOPTS= -else -ifeq (,$(shell $(TARGET_CC) -o /dev/null -c -x c /dev/null -fno-stack-protector 2>/dev/null || echo 1)) - TARGET_XCFLAGS+= -fno-stack-protector -endif -ifeq (Darwin,$(TARGET_SYS)) - ifeq (,$(MACOSX_DEPLOYMENT_TARGET)) - export MACOSX_DEPLOYMENT_TARGET=10.6 - endif - TARGET_STRIP+= -x - TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC - TARGET_DYNXLDOPTS= - TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) - ifeq (x64,$(TARGET_LJARCH)) - TARGET_XLDFLAGS+= -pagezero_size 10000 -image_base 100000000 - TARGET_XSHLDFLAGS+= -image_base 7fff04c4a000 - endif -else -ifeq (iOS,$(TARGET_SYS)) - TARGET_STRIP+= -x - TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC - TARGET_DYNXLDOPTS= - TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) -else - ifneq (SunOS,$(TARGET_SYS)) - ifneq (PS3,$(TARGET_SYS)) - TARGET_XLDFLAGS+= -Wl,-E - endif - endif - ifeq (Linux,$(TARGET_SYS)) - TARGET_XLIBS+= -ldl - endif - ifeq (GNU/kFreeBSD,$(TARGET_SYS)) - TARGET_XLIBS+= -ldl - endif -endif -endif -endif - -ifneq ($(HOST_SYS),$(TARGET_SYS)) - ifeq (Windows,$(TARGET_SYS)) - HOST_XCFLAGS+= -malign-double -DLUAJIT_OS=LUAJIT_OS_WINDOWS - else - ifeq (Linux,$(TARGET_SYS)) - HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_LINUX - else - ifeq (Darwin,$(TARGET_SYS)) - HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OSX - else - ifeq (iOS,$(TARGET_SYS)) - HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OSX - else - HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OTHER - endif - endif - endif - endif -endif - -ifneq (,$(CCDEBUG)) - TARGET_STRIP= @: -endif - -############################################################################## -# Files and pathnames. -############################################################################## - -MINILUA_O= host/minilua.o -MINILUA_LIBS= -lm -MINILUA_T= host/minilua -MINILUA_X= $(MINILUA_T) - -ifeq (,$(HOST_LUA)) - HOST_LUA= $(MINILUA_X) - DASM_DEP= $(MINILUA_T) -endif - -DASM_DIR= ../dynasm -DASM= $(HOST_LUA) $(DASM_DIR)/dynasm.lua -DASM_XFLAGS= -DASM_AFLAGS= -DASM_ARCH= $(TARGET_LJARCH) - -ifneq (,$(findstring LJ_ARCH_BITS 64,$(TARGET_TESTARCH))) - DASM_AFLAGS+= -D P64 -endif -ifneq (,$(findstring LJ_HASJIT 1,$(TARGET_TESTARCH))) - DASM_AFLAGS+= -D JIT -endif -ifneq (,$(findstring LJ_HASFFI 1,$(TARGET_TESTARCH))) - DASM_AFLAGS+= -D FFI -endif -ifneq (,$(findstring LJ_DUALNUM 1,$(TARGET_TESTARCH))) - DASM_AFLAGS+= -D DUALNUM -endif -ifneq (,$(findstring LJ_ARCH_HASFPU 1,$(TARGET_TESTARCH))) - DASM_AFLAGS+= -D FPU - TARGET_ARCH+= -DLJ_ARCH_HASFPU=1 -else - TARGET_ARCH+= -DLJ_ARCH_HASFPU=0 -endif -ifeq (,$(findstring LJ_ABI_SOFTFP 1,$(TARGET_TESTARCH))) - DASM_AFLAGS+= -D HFABI - TARGET_ARCH+= -DLJ_ABI_SOFTFP=0 -else - TARGET_ARCH+= -DLJ_ABI_SOFTFP=1 -endif -ifneq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH))) - DASM_AFLAGS+= -D NO_UNWIND - TARGET_ARCH+= -DLUAJIT_NO_UNWIND -endif -DASM_AFLAGS+= -D VER=$(subst LJ_ARCH_VERSION_,,$(filter LJ_ARCH_VERSION_%,$(subst LJ_ARCH_VERSION ,LJ_ARCH_VERSION_,$(TARGET_TESTARCH)))) -ifeq (Windows,$(TARGET_SYS)) - DASM_AFLAGS+= -D WIN -endif -ifeq (x86,$(TARGET_LJARCH)) - ifneq (,$(findstring __SSE2__ 1,$(TARGET_TESTARCH))) - DASM_AFLAGS+= -D SSE - endif -else -ifeq (x64,$(TARGET_LJARCH)) - DASM_ARCH= x86 -else -ifeq (arm,$(TARGET_LJARCH)) - ifeq (iOS,$(TARGET_SYS)) - DASM_AFLAGS+= -D IOS - endif -else -ifeq (ppc,$(TARGET_LJARCH)) - ifneq (,$(findstring LJ_ARCH_SQRT 1,$(TARGET_TESTARCH))) - DASM_AFLAGS+= -D SQRT - endif - ifneq (,$(findstring LJ_ARCH_ROUND 1,$(TARGET_TESTARCH))) - DASM_AFLAGS+= -D ROUND - endif - ifneq (,$(findstring LJ_ARCH_PPC64 1,$(TARGET_TESTARCH))) - DASM_AFLAGS+= -D GPR64 - endif - ifeq (PS3,$(TARGET_SYS)) - DASM_AFLAGS+= -D PPE -D TOC - endif -endif -endif -endif -endif - -DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS) -DASM_DASC= vm_$(DASM_ARCH).dasc - -BUILDVM_O= host/buildvm.o host/buildvm_asm.o host/buildvm_peobj.o \ - host/buildvm_lib.o host/buildvm_fold.o -BUILDVM_T= host/buildvm -BUILDVM_X= $(BUILDVM_T) - -HOST_O= $(MINILUA_O) $(BUILDVM_O) -HOST_T= $(MINILUA_T) $(BUILDVM_T) - -LJVM_S= lj_vm.s -LJVM_O= lj_vm.o -LJVM_BOUT= $(LJVM_S) -LJVM_MODE= elfasm - -LJLIB_O= lib_base.o lib_math.o lib_bit.o lib_string.o lib_table.o \ - lib_io.o lib_os.o lib_package.o lib_debug.o lib_jit.o lib_ffi.o -LJLIB_C= $(LJLIB_O:.o=.c) - -LJCORE_O= lj_gc.o lj_err.o lj_char.o lj_bc.o lj_obj.o \ - lj_str.o lj_tab.o lj_func.o lj_udata.o lj_meta.o lj_debug.o \ - lj_state.o lj_dispatch.o lj_vmevent.o lj_vmmath.o lj_strscan.o \ - lj_api.o lj_lex.o lj_parse.o lj_bcread.o lj_bcwrite.o lj_load.o \ - lj_ir.o lj_opt_mem.o lj_opt_fold.o lj_opt_narrow.o \ - lj_opt_dce.o lj_opt_loop.o lj_opt_split.o lj_opt_sink.o \ - lj_mcode.o lj_snap.o lj_record.o lj_crecord.o lj_ffrecord.o \ - lj_asm.o lj_trace.o lj_gdbjit.o \ - lj_ctype.o lj_cdata.o lj_cconv.o lj_ccall.o lj_ccallback.o \ - lj_carith.o lj_clib.o lj_cparse.o \ - lj_lib.o lj_alloc.o lib_aux.o \ - $(LJLIB_O) lib_init.o - -LJVMCORE_O= $(LJVM_O) $(LJCORE_O) -LJVMCORE_DYNO= $(LJVMCORE_O:.o=_dyn.o) - -LIB_VMDEF= jit/vmdef.lua -LIB_VMDEFP= $(LIB_VMDEF) - -LUAJIT_O= luajit.o -LUAJIT_A= libluajit.a -LUAJIT_SO= libluajit.so -LUAJIT_T= luajit - -ALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(HOST_T) -ALL_HDRGEN= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h \ - host/buildvm_arch.h -ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) $(LIB_VMDEFP) -WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk -ALL_RM= $(ALL_T) $(ALL_GEN) *.o host/*.o $(WIN_RM) - -############################################################################## -# Build mode handling. -############################################################################## - -# Mixed mode defaults. -TARGET_O= $(LUAJIT_A) -TARGET_T= $(LUAJIT_T) $(LUAJIT_SO) -TARGET_DEP= $(LIB_VMDEF) $(LUAJIT_SO) - -ifeq (Windows,$(TARGET_SYS)) - TARGET_DYNCC= $(STATIC_CC) - LJVM_MODE= peobj - LJVM_BOUT= $(LJVM_O) - LUAJIT_T= luajit.exe - ifeq (cygwin,$(HOST_MSYS)) - LUAJIT_SO= cyg$(TARGET_DLLNAME) - else - LUAJIT_SO= $(TARGET_DLLNAME) - endif - # Mixed mode is not supported on Windows. And static mode doesn't work well. - # C modules cannot be loaded, because they bind to lua51.dll. - ifneq (static,$(BUILDMODE)) - BUILDMODE= dynamic - TARGET_XCFLAGS+= -DLUA_BUILD_AS_DLL - endif -endif -ifeq (Darwin,$(TARGET_SYS)) - LJVM_MODE= machasm -endif -ifeq (iOS,$(TARGET_SYS)) - LJVM_MODE= machasm -endif -ifeq (SunOS,$(TARGET_SYS)) - BUILDMODE= static -endif -ifeq (PS3,$(TARGET_SYS)) - BUILDMODE= static -endif - -ifeq (Windows,$(HOST_SYS)) - MINILUA_T= host/minilua.exe - BUILDVM_T= host/buildvm.exe - ifeq (,$(HOST_MSYS)) - MINILUA_X= host\minilua - BUILDVM_X= host\buildvm - ALL_RM:= $(subst /,\,$(ALL_RM)) - endif -endif - -ifeq (static,$(BUILDMODE)) - TARGET_DYNCC= @: - TARGET_T= $(LUAJIT_T) - TARGET_DEP= $(LIB_VMDEF) -else -ifeq (dynamic,$(BUILDMODE)) - ifneq (Windows,$(TARGET_SYS)) - TARGET_CC= $(DYNAMIC_CC) - endif - TARGET_DYNCC= @: - LJVMCORE_DYNO= $(LJVMCORE_O) - TARGET_O= $(LUAJIT_SO) - TARGET_XLDFLAGS+= $(TARGET_DYNXLDOPTS) -else -ifeq (Darwin,$(TARGET_SYS)) - TARGET_DYNCC= @: - LJVMCORE_DYNO= $(LJVMCORE_O) -endif -ifeq (iOS,$(TARGET_SYS)) - TARGET_DYNCC= @: - LJVMCORE_DYNO= $(LJVMCORE_O) -endif -endif -endif - -Q= @ -E= @echo -#Q= -#E= @: - -############################################################################## -# Make targets. -############################################################################## - -default all: $(TARGET_T) - -amalg: - @grep "^[+|]" ljamalg.c - $(MAKE) all "LJCORE_O=ljamalg.o" - -clean: - $(HOST_RM) $(ALL_RM) - -depend: - @for file in $(ALL_HDRGEN); do \ - test -f $$file || touch $$file; \ - done - @$(HOST_CC) $(HOST_ACFLAGS) -MM *.c host/*.c | \ - sed -e "s| [^ ]*/dasm_\S*\.h||g" \ - -e "s|^\([^l ]\)|host/\1|" \ - -e "s| lj_target_\S*\.h| lj_target_*.h|g" \ - -e "s| lj_emit_\S*\.h| lj_emit_*.h|g" \ - -e "s| lj_asm_\S*\.h| lj_asm_*.h|g" >Makefile.dep - @for file in $(ALL_HDRGEN); do \ - test -s $$file || $(HOST_RM) $$file; \ - done - -.PHONY: default all amalg clean depend - -############################################################################## -# Rules for generated files. -############################################################################## - -$(MINILUA_T): $(MINILUA_O) - $(E) "HOSTLINK $@" - $(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS) - -host/buildvm_arch.h: $(DASM_DASC) $(DASM_DEP) - $(E) "DYNASM $@" - $(Q)$(DASM) $(DASM_FLAGS) -o $@ $(DASM_DASC) - -host/buildvm.o: $(DASM_DIR)/dasm_*.h - -$(BUILDVM_T): $(BUILDVM_O) - $(E) "HOSTLINK $@" - $(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(BUILDVM_O) $(HOST_ALIBS) - -$(LJVM_BOUT): $(BUILDVM_T) - $(E) "BUILDVM $@" - $(Q)$(BUILDVM_X) -m $(LJVM_MODE) -o $@ - -lj_bcdef.h: $(BUILDVM_T) $(LJLIB_C) - $(E) "BUILDVM $@" - $(Q)$(BUILDVM_X) -m bcdef -o $@ $(LJLIB_C) - -lj_ffdef.h: $(BUILDVM_T) $(LJLIB_C) - $(E) "BUILDVM $@" - $(Q)$(BUILDVM_X) -m ffdef -o $@ $(LJLIB_C) - -lj_libdef.h: $(BUILDVM_T) $(LJLIB_C) - $(E) "BUILDVM $@" - $(Q)$(BUILDVM_X) -m libdef -o $@ $(LJLIB_C) - -lj_recdef.h: $(BUILDVM_T) $(LJLIB_C) - $(E) "BUILDVM $@" - $(Q)$(BUILDVM_X) -m recdef -o $@ $(LJLIB_C) - -$(LIB_VMDEF): $(BUILDVM_T) $(LJLIB_C) - $(E) "BUILDVM $@" - $(Q)$(BUILDVM_X) -m vmdef -o $(LIB_VMDEFP) $(LJLIB_C) - -lj_folddef.h: $(BUILDVM_T) lj_opt_fold.c - $(E) "BUILDVM $@" - $(Q)$(BUILDVM_X) -m folddef -o $@ lj_opt_fold.c - -############################################################################## -# Object file rules. -############################################################################## - -%.o: %.c - $(E) "CC $@" - $(Q)$(TARGET_DYNCC) $(TARGET_ACFLAGS) -c -o $(@:.o=_dyn.o) $< - $(Q)$(TARGET_CC) $(TARGET_ACFLAGS) -c -o $@ $< - -%.o: %.s - $(E) "ASM $@" - $(Q)$(TARGET_DYNCC) $(TARGET_ACFLAGS) -c -o $(@:.o=_dyn.o) $< - $(Q)$(TARGET_CC) $(TARGET_ACFLAGS) -c -o $@ $< - -$(LUAJIT_O): - $(E) "CC $@" - $(Q)$(TARGET_STCC) $(TARGET_ACFLAGS) -c -o $@ $< - -$(HOST_O): %.o: %.c - $(E) "HOSTCC $@" - $(Q)$(HOST_CC) $(HOST_ACFLAGS) -c -o $@ $< - -include Makefile.dep - -############################################################################## -# Target file rules. -############################################################################## - -$(LUAJIT_A): $(LJVMCORE_O) - $(E) "AR $@" - $(Q)$(TARGET_AR) $@ $(LJVMCORE_O) - -# The dependency on _O, but linking with _DYNO is intentional. -$(LUAJIT_SO): $(LJVMCORE_O) - $(E) "DYNLINK $@" - $(Q)$(TARGET_LD) $(TARGET_ASHLDFLAGS) -o $@ $(LJVMCORE_DYNO) $(TARGET_ALIBS) - $(Q)$(TARGET_STRIP) $@ - -$(LUAJIT_T): $(TARGET_O) $(LUAJIT_O) $(TARGET_DEP) - $(E) "LINK $@" - $(Q)$(TARGET_LD) $(TARGET_ALDFLAGS) -o $@ $(LUAJIT_O) $(TARGET_O) $(TARGET_ALIBS) - $(Q)$(TARGET_STRIP) $@ - $(E) "OK Successfully built LuaJIT" - -############################################################################## diff --git a/tools/Makefile b/tools/Makefile deleted file mode 100644 index de6166a1e..000000000 --- a/tools/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk - -osx-bundle-restart-helper_OBJ := $(d)osx-bundle-restart-helper.o - -ifeq (yes, $(BUILD_DARWIN)) -PROGRAM += $(d)osx-bundle-restart-helper -endif - -repack-thes-dict_OBJ := $(d)repack-thes-dict.o $(TOP)lib/libaegisub.a -repack-thes-dict_LIBS := $(LIBS_BOOST) $(LIBS_ICU) $(LIBS_PTHREAD) -repack-thes-dict_CPPFLAGS := -I$(TOP) -I$(TOP)libaegisub/include $(CFLAGS_ICU) - -PROGRAM += $(d)repack-thes-dict - -$(TOP)tools/respack.lua: $(shell command -v "$(BIN_LUA)") - -include $(TOP)Makefile.target From 47f7aa879de8aad14a6b123925269f6e56a88de1 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 21 Nov 2020 15:51:59 -0500 Subject: [PATCH 180/271] README: update Windows section to reflect the switch to Meson --- README.md | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 5739c3688..e173ae9e7 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ For binaries and general information [see the homepage](http://www.aegisub.org). -The bug tracker can be found at http://devel.aegisub.org. +The bug tracker can be found at https://github.com/TypesettingTools/Aegisub/issues. -Support is available on [the forums](http://forum.aegisub.org) or [on IRC](irc://irc.rizon.net/aegisub). +Support is available on [Discord](https://discord.com/invite/AZaVyPr) or [IRC](irc://irc.rizon.net/aegisub). ## Building Aegisub @@ -12,9 +12,10 @@ Support is available on [the forums](http://forum.aegisub.org) or [on IRC](irc:/ Prerequisites: -1. Visual Studio 2015 (the free Community edition is good enough) +1. Visual Studio (Community edition of any recent version is fine) 2. The June 2010 DirectX SDK (the final release before DirectSound was dropped) -3. [Yasm](http://yasm.tortall.net/) installed to somewhere on your path. +3. Python 3 +4. Meson There are a few optional dependencies: @@ -26,22 +27,19 @@ All other dependencies are either stored in the repository or are included as su Building: -1. Clone Aegisub's repository recursively to fetch it and all submodules: `git clone --recursive git@github.com:Aegisub/Aegisub.git` This will take quite a while and requires about 2.5 GB of disk space. -2. Open Aegisub.sln -3. Build the BuildTasks project. -4. Build the entire solution. +1. Clone Aegisub's repository: `git clone https://github.com/TypesettingTools/Aegisub.git` +2. From the Visual Studio "x64 Native Tools Command Prompt", generate the build directory: `meson build -Ddefault_library=static -Dfreetype2:zlib=system -Dfreetype2:png=enabled -Dfreetype2:default_library=static` +3. Build with `cd build` and `meson compile` -You should now have a `bin` directory in your Aegisub directory which contains `aegisub32d.exe`, along with a pile of other files. +You should now have a binary at `src/aegisub.exe`. -The Aegisub installer includes some files not built as part of Aegisub (such as Avisynth and VSFilter), so for a fully functional copy of Aegisub you now need to copy all of the files from an installed copy of Aegisub into your `bin` directory (and don't overwrite any of the files already there). -You'll also either need to copy the `automation` directory into the `bin` directory, or edit your automation search paths to include the `automation` directory in the source tree. +Installer: -After building the solution once, you'll want to switch to the Debug-MinDep configuration, which skips checking if the dependencies are out of date, as that takes a while. +You can generate the installer with `ninja win-installer` after a successful build. This assumes you have InnoSetup present on your `PATH` and a working internet connection. ### OS X A vaguely recent version of Xcode and the corresponding command-line tools are required. -Nothing older than Xcode 5 has been tested recently, but it is likely that some later versions of Xcode 4 are good enough. For personal usage, you can use homebrew to install almost all of Aegisub's dependencies: From 194521e777f484767b86882f40b896dc444383c1 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 22 Nov 2020 16:30:18 -0500 Subject: [PATCH 181/271] meson: set wx subproject buildtype, remove d_vscrt hack --- .github/workflows/ci.yml | 2 +- meson.build | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 705b545d8..01dbbf193 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: - name: Configure (Windows) if: matrix.config.os == 'windows-latest' # -Dfreetype2:png=enabled is a workaround for https://savannah.nongnu.org/bugs/?59458 - run: meson build -Db_vscrt=mdd -Ddefault_library=static --force-fallback-for=zlib,harfbuzz -Dfreetype2:zlib=system -Dfreetype2:png=enabled -Dfreetype2:default_library=static + run: meson build -Ddefault_library=static --force-fallback-for=zlib,harfbuzz -Dfreetype2:zlib=system -Dfreetype2:png=enabled -Dfreetype2:default_library=static - name: Configure (Linux) if: matrix.config.os == 'ubuntu-latest' diff --git a/meson.build b/meson.build index 4961e4a7b..3c331b620 100644 --- a/meson.build +++ b/meson.build @@ -116,11 +116,16 @@ else if get_option('default_library') == 'static' build_shared = 'OFF' endif + build_type = 'Release' + if get_option('buildtype') == 'debug' + build_type = 'Debug' + endif wx = cmake.subproject('wxWidgets', cmake_options: ['-DwxBUILD_INSTALL=OFF', '-DwxBUILD_PRECOMP=OFF', # otherwise breaks project generation w/ meson '-DwxBUILD_SHARED=@0@'.format(build_shared), '-DwxUSE_WEBVIEW=OFF', # breaks build on linux + '-DCMAKE_BUILD_TYPE=@0@'.format(build_type), '-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson deps += [ wx.dependency('wxmono'), From 44fdeb361f4ecd7fda7a563ba3d28712ffa6653e Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sun, 22 Nov 2020 16:33:02 -0500 Subject: [PATCH 182/271] actions: upload artifacts --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01dbbf193..95e8f4e51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,3 +70,11 @@ jobs: - name: Build run: meson compile -C build + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + if: matrix.config.os == 'windows-latest' + with: + name: ${{ matrix.config.name }} + path: | + build/Aegisub-*.exe From 72edb889827a8d3fce112d140bd8d17ac285b830 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 22 Dec 2020 01:01:12 -0500 Subject: [PATCH 183/271] meson: add Avisynth option, compile libass_gdi_fontselect Sadly, building with Avisynth is still broken. --- meson.build | 4 ++++ meson_options.txt | 1 + src/meson.build | 7 +++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 3c331b620..0b53d1967 100644 --- a/meson.build +++ b/meson.build @@ -192,6 +192,10 @@ foreach dep: [ endif endforeach +if host_machine.system() == 'windows' and get_option('avisynth').enabled() + conf.set('WITH_AVISYNTH', 1) # bundled separately with installer +endif + if host_machine.system() == 'windows' and not get_option('directsound').disabled() dsound_dep = cc.find_library('dsound', required: get_option('directsound')) winmm_dep = cc.find_library('winmm', required: get_option('directsound')) diff --git a/meson_options.txt b/meson_options.txt index 4481aa69d..20bac21ae 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,6 +6,7 @@ option('directsound', type: 'feature', description: 'DirectSound audio output') option('default_audio_output', type: 'combo', choices: ['auto', 'ALSA', 'OpenAL', 'PulseAudio', 'PortAudio', 'DirectSound'], description: 'Default audio output') option('ffms2', type: 'feature', description: 'FFMS2 video source') +option('avisynth', type: 'feature', description: 'AviSynth video source') option('fftw3', type: 'feature', description: 'FFTW3 support') option('hunspell', type: 'feature', description: 'Hunspell spell checker') diff --git a/src/meson.build b/src/meson.build index 1238f6dea..29dfe2169 100644 --- a/src/meson.build +++ b/src/meson.build @@ -33,7 +33,6 @@ aegisub_src = files( 'auto4_lua_assfile.cpp', 'auto4_lua_dialog.cpp', 'auto4_lua_progresssink.cpp', - 'avisynth_wrap.cpp', 'base_grid.cpp', 'charset_detect.cpp', 'colorspace.cpp', @@ -173,8 +172,12 @@ if host_machine.system() == 'darwin' ] elif host_machine.system() == 'windows' aegisub_src += [ - 'font_file_lister_gdi.cpp' + 'avisynth_wrap.cpp', + 'font_file_lister_gdi.cpp', + 'libass_gdi_fontselect.cpp', + 'video_provider_avs.cpp', ] + if cc.has_header('wingdi.h') deps += cc.find_library('gdi32', required: true) else From a3ec466ff64fa96aae098899d7c90ae89ef1bbdb Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 22 Dec 2020 01:05:02 -0500 Subject: [PATCH 184/271] meson: fix Windows installer generation This includes some miscellaneous cleanup to the installer files as well --- README.md | 8 +- packages/meson.build | 3 + packages/win_installer/aegisub3.iss | 35 ------ packages/win_installer/aegisub_depctrl.iss | 2 + .../dictionaries/fragment_dictbase.iss | 35 ------ .../dictionaries/fragment_stddict.iss | 36 ------ .../win_installer/fragment_associations.iss | 34 ------ .../win_installer/fragment_automation.iss | 103 ++++++------------ .../win_installer/fragment_beautify_code.iss | 38 ------- packages/win_installer/fragment_codecs.iss | 42 +------ .../win_installer/fragment_mainprogram.iss | 38 +------ .../win_installer/fragment_migrate_code.iss | 43 -------- packages/win_installer/fragment_runtimes.iss | 42 +------ packages/win_installer/fragment_setupbase.iss | 97 ++++++----------- .../win_installer/fragment_shell_code.iss | 37 ------- packages/win_installer/fragment_spelling.iss | 40 +------ packages/win_installer/fragment_strings.iss | 33 ++++-- .../win_installer/fragment_translations.iss | 98 ++++++----------- packages/win_installer/license.txt | 2 +- tools/version.ps1 | 2 +- tools/win-installer-setup.ps1 | 80 ++++++++++++++ 21 files changed, 228 insertions(+), 620 deletions(-) create mode 100644 tools/win-installer-setup.ps1 diff --git a/README.md b/README.md index e173ae9e7..f009c4235 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,16 @@ Prerequisites: 2. The June 2010 DirectX SDK (the final release before DirectSound was dropped) 3. Python 3 4. Meson +5. CMake +6. Powershell execution policy set to Unrestricted -There are a few optional dependencies: +There are a few optional dependencies that must be installed and on your PATH: 1. msgfmt, to build the translations 2. WinRAR, to build the portable installer 3. InnoSetup, to build the regular installer +4. 7zip, to build the regular installer +5. Moonscript, to build the regular installer All other dependencies are either stored in the repository or are included as submodules. @@ -35,7 +39,7 @@ You should now have a binary at `src/aegisub.exe`. Installer: -You can generate the installer with `ninja win-installer` after a successful build. This assumes you have InnoSetup present on your `PATH` and a working internet connection. +You can generate the installer with `ninja win-installer` after a successful build. This assumes a working internet connection and installation of the optional dependencies. ### OS X diff --git a/packages/meson.build b/packages/meson.build index 41676bfb2..d2298cd27 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -1,6 +1,9 @@ conf_pkg = configuration_data() if host_machine.system() == 'windows' + installer_setup = find_program(meson.source_root() / 'tools/win-installer-setup.ps1', ) + run_target('win-installer', + command: [installer_setup, meson.build_root(), meson.source_root()]) elif host_machine.system() == 'darwin' # temporary hack until version.sh generates this properly run_command('cp', meson.source_root() / 'tools' / 'osx-bundle.sed', meson.build_root()) diff --git a/packages/win_installer/aegisub3.iss b/packages/win_installer/aegisub3.iss index 4ca458efc..61960ad36 100644 --- a/packages/win_installer/aegisub3.iss +++ b/packages/win_installer/aegisub3.iss @@ -1,37 +1,3 @@ -; Copyright (c) 2007-2009, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; - #define ARCH 64 #include "fragment_setupbase.iss" @@ -88,4 +54,3 @@ begin False); end; end; - diff --git a/packages/win_installer/aegisub_depctrl.iss b/packages/win_installer/aegisub_depctrl.iss index 069eac029..0cc857265 100644 --- a/packages/win_installer/aegisub_depctrl.iss +++ b/packages/win_installer/aegisub_depctrl.iss @@ -1,3 +1,5 @@ #define DEPCTRL +;#define UNOFFICIAL_LANGUAGES +;#define ENABLE_TRANSLATIONS #include "aegisub3.iss" diff --git a/packages/win_installer/dictionaries/fragment_dictbase.iss b/packages/win_installer/dictionaries/fragment_dictbase.iss index 5d694f98c..6f07dcc37 100644 --- a/packages/win_installer/dictionaries/fragment_dictbase.iss +++ b/packages/win_installer/dictionaries/fragment_dictbase.iss @@ -1,37 +1,3 @@ -; Copyright (c) 2011, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; - [Setup] AppID={{24BC8B57-716C-444F-B46B-A3349B9164C5} AppName=Aegisub @@ -75,7 +41,6 @@ WelcomeLabel2=This will install {#LANGNAME} dictionaries for Aegisub 3.0 on your DestDir: {tmp}; Flags: dontcopy; Source: welcome.bmp DestDir: {tmp}; Flags: dontcopy; Source: aegisub.bmp - [Code] #include "..\fragment_shell_code.iss" #include "..\fragment_beautify_code.iss" diff --git a/packages/win_installer/dictionaries/fragment_stddict.iss b/packages/win_installer/dictionaries/fragment_stddict.iss index 7b7ee1924..acad697be 100644 --- a/packages/win_installer/dictionaries/fragment_stddict.iss +++ b/packages/win_installer/dictionaries/fragment_stddict.iss @@ -1,44 +1,9 @@ -; Copyright (c) 2007-2009, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; - #include "fragment_dictbase.iss" [Setup] OutputBaseFilename=Aegisub-3.0-dict-{#LANGCODE} VersionInfoDescription=Aegisub 3.0 {#LANGNAME} dictionary - [Files] Source: src\dictionaries\{#LANGCODE}.aff; DestDir: {app}\dictionaries; Flags: ignoreversion; Components: dic/{#LANGCODE} Source: src\dictionaries\{#LANGCODE}.dic; DestDir: {app}\dictionaries; Flags: ignoreversion; Components: dic/{#LANGCODE} @@ -54,4 +19,3 @@ Name: dic/{#LANGCODE}; Description: {#LANGNAME} dictionary; Types: full Name: th; Description: Thesaurus; Types: full Name: th/{#LANGCODE}; Description: {#LANGNAME} thesaurus; Types: full #endif - diff --git a/packages/win_installer/fragment_associations.iss b/packages/win_installer/fragment_associations.iss index 113b42dce..15567fb61 100644 --- a/packages/win_installer/fragment_associations.iss +++ b/packages/win_installer/fragment_associations.iss @@ -1,37 +1,3 @@ -; Copyright (c) 2007-2011, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; - [Files] DestDir: {commontemplates}; Source: template.ass; DestName: Aegisub.ass diff --git a/packages/win_installer/fragment_automation.iss b/packages/win_installer/fragment_automation.iss index 4b224aad7..c754c4752 100644 --- a/packages/win_installer/fragment_automation.iss +++ b/packages/win_installer/fragment_automation.iss @@ -1,79 +1,48 @@ -; Copyright (c) 2007-2009, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; - ; This file declares all installables related to Aegisub Automation [Files] -DestDir: {app}\automation\autoload; Source: ..\..\automation\autoload\cleantags-autoload.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\bundled -DestDir: {app}\automation\autoload; Source: ..\..\automation\autoload\karaoke-auto-leadin.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\bundled -DestDir: {app}\automation\autoload; Source: ..\..\automation\autoload\kara-templater.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\bundled -DestDir: {app}\automation\autoload; Source: ..\..\automation\autoload\select-overlaps.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\bundled -DestDir: {app}\automation\autoload; Source: ..\..\automation\autoload\strip-tags.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\bundled +DestDir: {app}\automation\autoload; Source: {#SOURCE_ROOT}\automation\autoload\cleantags-autoload.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\bundled +DestDir: {app}\automation\autoload; Source: {#SOURCE_ROOT}\automation\autoload\karaoke-auto-leadin.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\bundled +DestDir: {app}\automation\autoload; Source: {#SOURCE_ROOT}\automation\autoload\kara-templater.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\bundled +DestDir: {app}\automation\autoload; Source: {#SOURCE_ROOT}\automation\autoload\select-overlaps.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\bundled +DestDir: {app}\automation\autoload; Source: {#SOURCE_ROOT}\automation\autoload\strip-tags.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\bundled -DestDir: {app}\automation\demos; Source: ..\..\automation\demos\future-windy-blur.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\demos -DestDir: {app}\automation\demos; Source: ..\..\automation\demos\raytracer.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\demos +DestDir: {app}\automation\demos; Source: {#SOURCE_ROOT}\automation\demos\future-windy-blur.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\demos +DestDir: {app}\automation\demos; Source: {#SOURCE_ROOT}\automation\demos\raytracer.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: macros\demos -DestDir: {app}\automation\include\aegisub; Source: ..\..\automation\include\aegisub\argcheck.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include\aegisub; Source: ..\..\automation\include\aegisub\clipboard.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include\aegisub; Source: ..\..\automation\include\aegisub\ffi.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include\aegisub; Source: ..\..\automation\include\aegisub\lfs.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include\aegisub; Source: ..\..\automation\include\aegisub\re.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include\aegisub; Source: ..\..\automation\include\aegisub\unicode.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include\aegisub; Source: ..\..\automation\include\aegisub\util.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include\aegisub; Source: {#SOURCE_ROOT}\automation\include\aegisub\argcheck.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include\aegisub; Source: {#SOURCE_ROOT}\automation\include\aegisub\clipboard.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include\aegisub; Source: {#SOURCE_ROOT}\automation\include\aegisub\ffi.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include\aegisub; Source: {#SOURCE_ROOT}\automation\include\aegisub\lfs.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include\aegisub; Source: {#SOURCE_ROOT}\automation\include\aegisub\re.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include\aegisub; Source: {#SOURCE_ROOT}\automation\include\aegisub\unicode.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include\aegisub; Source: {#SOURCE_ROOT}\automation\include\aegisub\util.moon; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include; Source: ..\..\automation\include\cleantags.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include; Source: ..\..\automation\include\clipboard.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include; Source: ..\..\automation\include\karaskel.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include; Source: ..\..\automation\include\karaskel-auto4.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include; Source: ..\..\automation\include\lfs.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include; Source: ..\..\automation\include\moonscript.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include; Source: ..\..\automation\include\re.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include; Source: ..\..\automation\include\unicode.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include; Source: ..\..\automation\include\utils.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -DestDir: {app}\automation\include; Source: ..\..\automation\include\utils-auto4.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\cleantags.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\clipboard.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\karaskel.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\karaskel-auto4.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\lfs.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\moonscript.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\re.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\unicode.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\utils.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\utils-auto4.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main -; DepCtrl #ifdef DEPCTRL -DestDir: {userappdata}\Aegisub\automation\include\l0; Source: vendor\DependencyControl\modules\*; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl -DestDir: {userappdata}\Aegisub\automation\autoload; Source: vendor\DependencyControl\macros\*; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl -DestDir: {userappdata}\Aegisub\automation\include; Source: vendor\Yutils\src\Yutils.lua; Flags: ignoreversion; Components: macros\modules\yutils -DestDir: {userappdata}\Aegisub\automation\include; Source: vendor\ffi-experiments\luajson\*; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\luajson -DestDir: {userappdata}\Aegisub\automation\include\requireffi; Source: vendor\ffi-experiments\requireffi\*; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl +; DepCtrl +DestDir: {userappdata}\Aegisub\automation\include\l0; Source: {#DEPS_DIR}\DependencyControl\modules\*; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl +DestDir: {userappdata}\Aegisub\automation\autoload; Source: {#DEPS_DIR}\DependencyControl\macros\*; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl +DestDir: {userappdata}\Aegisub\automation\include; Source: {#DEPS_DIR}\Yutils\src\Yutils.lua; Flags: ignoreversion; Components: macros\modules\yutils +DestDir: {userappdata}\Aegisub\automation\include; Source: {#DEPS_DIR}\luajson\lua\*; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\luajson -DestDir: {userappdata}\Aegisub\automation\include; Source: vendor\ffi-experiments\BadMutex\*; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl -DestDir: {userappdata}\Aegisub\automation\include; Source: vendor\ffi-experiments\PreciseTimer\*; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl -DestDir: {userappdata}\Aegisub\automation\include; Source: vendor\ffi-experiments\DownloadManager\*; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl +DestDir: {userappdata}\Aegisub\automation\include\requireffi; Source: {#DEPS_DIR}\ffi-experiments\build\requireffi\requireffi.lua; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl +DestDir: {userappdata}\Aegisub\automation\include\BM\BadMutex; Source: {#DEPS_DIR}\ffi-experiments\build\bad-mutex\BadMutex.dll; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl +DestDir: {userappdata}\Aegisub\automation\include\BM; Source: {#DEPS_DIR}\ffi-experiments\build\bad-mutex\BadMutex.lua; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl +DestDir: {userappdata}\Aegisub\automation\include\PT\PreciseTimer; Source: {#DEPS_DIR}\ffi-experiments\build\precise-timer\PreciseTimer.dll; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl +DestDir: {userappdata}\Aegisub\automation\include\PT; Source: {#DEPS_DIR}\ffi-experiments\build\precise-timer\PreciseTimer.lua; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl +DestDir: {userappdata}\Aegisub\automation\include\DM\DownloadManager; Source: {#DEPS_DIR}\ffi-experiments\build\download-manager\DownloadManager.dll; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl +DestDir: {userappdata}\Aegisub\automation\include\DM; Source: {#DEPS_DIR}\ffi-experiments\build\download-manager\DownloadManager.lua; Flags: ignoreversion recursesubdirs createallsubdirs; Components: macros\modules\depctrl [Dirs] Name: {userappdata}\Aegisub\automation\test\DepUnit\automation; Components: macros\modules\depctrl; diff --git a/packages/win_installer/fragment_beautify_code.iss b/packages/win_installer/fragment_beautify_code.iss index 25552ecdd..9e7155b91 100644 --- a/packages/win_installer/fragment_beautify_code.iss +++ b/packages/win_installer/fragment_beautify_code.iss @@ -1,41 +1,4 @@ [Code] -(* -; Copyright (c) 2007-2009, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; -*) - - function SHAutoComplete(hWnd: Integer; dwFlags: DWORD): Integer; external 'SHAutoComplete@shlwapi.dll stdcall delayload'; const @@ -81,4 +44,3 @@ begin Log('Could not add autocomplete to dir edit box'); end; end; - diff --git a/packages/win_installer/fragment_codecs.iss b/packages/win_installer/fragment_codecs.iss index 5951f8ddd..06e73b037 100644 --- a/packages/win_installer/fragment_codecs.iss +++ b/packages/win_installer/fragment_codecs.iss @@ -1,41 +1,7 @@ -; Copyright (c) 2007-2009, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; - [Files] ; Avisynth -DestDir: {app}; Source: vendor\AvisynthPlus64\devil.dll; Flags: ignoreversion; Components: main -DestDir: {app}; Source: vendor\AvisynthPlus64\avisynth.dll; Flags: ignoreversion; Components: main -DestDir: {app}; Source: vendor\AvisynthPlus64\DirectShowSource.dll; Flags: ignoreversion; Components: main +DestDir: {app}; Source: {#DEPS_DIR}\AvisynthPlus64\x64\system\DevIL.dll; Flags: ignoreversion; Components: main +DestDir: {app}; Source: {#DEPS_DIR}\AvisynthPlus64\x64\AviSynth.dll; Flags: ignoreversion; Components: main +DestDir: {app}; Source: {#DEPS_DIR}\AvisynthPlus64\x64\plugins\DirectShowSource.dll; Flags: ignoreversion; Components: main ; VSFilter -DestDir: {app}\csri; Source: vendor\xy-vsfilter\xy-vsfilter-aegisub64.dll; Flags: ignoreversion; Components: main +DestDir: {app}\csri; Source: {#DEPS_DIR}\VSFilter\x64\VSFilter.dll; Flags: ignoreversion; Components: main diff --git a/packages/win_installer/fragment_mainprogram.iss b/packages/win_installer/fragment_mainprogram.iss index 0eed59a86..003efde7d 100644 --- a/packages/win_installer/fragment_mainprogram.iss +++ b/packages/win_installer/fragment_mainprogram.iss @@ -1,37 +1,3 @@ -; Copyright (c) 2007-2009, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; - [Components] Name: "main"; Description: "Main Files"; Types: full compact custom; Flags: fixed Name: "macros"; Description: "Automation Scripts"; Types: full @@ -53,8 +19,8 @@ Name: "checkforupdates"; Description: "{cm:CheckForUpdates}"; GroupDescription: [Files] ; main -DestDir: {app}; Source: ..\..\bin\aegisub{#ARCH}.exe; Flags: ignoreversion; Components: main -DestDir: {app}; Source: license.txt; Flags: ignoreversion; Components: main +DestDir: {app}; Source: "{#BUILD_ROOT}\src\aegisub.exe"; Flags: ignoreversion; Components: main +DestDir: {app}; Source: "{#INSTALLER_DIR}\license.txt"; Flags: ignoreversion; Components: main [Icons] Name: {commonprograms}\Aegisub; Filename: {app}\aegisub{#ARCH}.exe; WorkingDir: {app}; IconIndex: 0; Tasks: startmenuicon; Comment: Create and edit subtitle files diff --git a/packages/win_installer/fragment_migrate_code.iss b/packages/win_installer/fragment_migrate_code.iss index 7be07c916..ff655154f 100644 --- a/packages/win_installer/fragment_migrate_code.iss +++ b/packages/win_installer/fragment_migrate_code.iss @@ -1,41 +1,4 @@ [Code] -(* -; Copyright (c) 2007-2009, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; -*) - - var HasLegacyVersion: Boolean; LegacyStartMenuFolder: string; @@ -390,9 +353,3 @@ begin CleanUpOldVersion; end; end; - - - - - - diff --git a/packages/win_installer/fragment_runtimes.iss b/packages/win_installer/fragment_runtimes.iss index 8d7f56436..ae71daf74 100644 --- a/packages/win_installer/fragment_runtimes.iss +++ b/packages/win_installer/fragment_runtimes.iss @@ -1,47 +1,7 @@ -; Copyright (c) 2007-2009, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; - ; This file implements checking for and installing runtime libraries for Aegisub [Files] -DestDir: {tmp}; Source: src\vcredist_{#ARCH}.exe; Flags: nocompression deleteafterinstall -;Source: src\redist\{#ARCH}\Microsoft.VC140.CRT\msvcp140.dll; DestDir: {app}; Flags: ignoreversion -;Source: src\redist\{#ARCH}\Microsoft.VC140.CRT\concrt140.dll; DestDir: {app}; Flags: ignoreversion -;Source: src\redist\{#ARCH}\Microsoft.VC140.CRT\vccorlib140.dll; DestDir: {app}; Flags: ignoreversion -;Source: src\redist\{#ARCH}\Microsoft.VC140.CRT\vcruntime140.dll; DestDir: {app}; Flags: ignoreversion -;Source: src\redist\{#ARCH}\Microsoft.VC140.MFC\mfc140u.dll; DestDir: {app}; Flags: ignoreversion -;Source: src\redist\{#ARCH}\Microsoft.VC140.MFC\mfcm140u.dll; DestDir: {app}; Flags: ignoreversion +DestDir: {tmp}; Source: "{#DEPS_DIR}\VC_redist\VC_redist.x{#ARCH}.exe"; Flags: nocompression deleteafterinstall [Run] Filename: {tmp}\vcredist_{#ARCH}.exe; StatusMsg: {cm:InstallRuntime}; Parameters: "/install /quiet /norestart" diff --git a/packages/win_installer/fragment_setupbase.iss b/packages/win_installer/fragment_setupbase.iss index 8935e256c..168c5f88b 100644 --- a/packages/win_installer/fragment_setupbase.iss +++ b/packages/win_installer/fragment_setupbase.iss @@ -1,40 +1,10 @@ -; Copyright (c) 2007-2009, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; - -#include "../../build/git_version.h" - #define CURRENT_YEAR GetDateTimeString('yyyy', '', ''); +#define BUILD_ROOT GetEnv('BUILD_ROOT') +#define SOURCE_ROOT GetEnv('SOURCE_ROOT') +#define INSTALLER_DIR SOURCE_ROOT + "\packages\win_installer" +#define DEPS_DIR BUILD_ROOT + "\installer-deps" + +#include BUILD_ROOT + "\git_version.h" [Setup] AppName=Aegisub @@ -47,10 +17,10 @@ AppCopyright=2005-{#CURRENT_YEAR} The Aegisub Team VersionInfoVersion={#INSTALLER_VERSION} DefaultGroupName=Aegisub AllowNoIcons=true -OutputDir=output +OutputDir={#BUILD_ROOT} Compression=lzma/ultra64 SolidCompression=true -MinVersion=0,5.0 +MinVersion=6.1sp1 ShowLanguageDialog=yes LanguageDetectionMethod=none DisableProgramGroupPage=yes @@ -61,51 +31,54 @@ UsePreviousTasks=no UninstallDisplayIcon={app}\aegisub{#ARCH}.exe ; Default to a large welcome bitmap, suitable for large fonts ; The normal fonts version is selected by code below -WizardImageFile=welcome-large.bmp -WizardSmallImageFile=aegisub-large.bmp +WizardImageFile={#INSTALLER_DIR}\welcome-large.bmp +WizardSmallImageFile={#INSTALLER_DIR}\aegisub-large.bmp OutputBaseFilename=Aegisub-{#BUILD_GIT_VERSION_STRING}-{#ARCH} VersionInfoDescription=Aegisub {#BUILD_GIT_VERSION_STRING} {#ARCH}-bit [Languages] Name: "en"; MessagesFile: "compiler:Default.isl" -Name: "bg"; MessagesFile: "compiler:Languages\Bulgarian.isl" Name: "ca"; MessagesFile: "compiler:Languages\Catalan.isl" Name: "cz"; MessagesFile: "compiler:Languages\Czech.isl" Name: "da"; MessagesFile: "compiler:Languages\Danish.isl" Name: "de"; MessagesFile: "compiler:Languages\German.isl" -Name: "el"; MessagesFile: "compiler:Languages\Greek.isl" Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl" -Name: "eu"; MessagesFile: "compiler:Languages\Basque.isl" Name: "fi"; MessagesFile: "compiler:Languages\Finnish.isl" Name: "fr_FR"; MessagesFile: "compiler:Languages\French.isl" -Name: "gl"; MessagesFile: "compiler:Languages\Galician.isl" -Name: "hu"; MessagesFile: "compiler:Languages\Hungarian.isl" -Name: "id"; MessagesFile: "compiler:Languages\Indonesian.isl" Name: "it"; MessagesFile: "compiler:Languages\Italian.isl" Name: "ja"; MessagesFile: "compiler:Languages\Japanese.isl" -Name: "ko"; MessagesFile: "compiler:Languages\Korean.isl" -Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl" Name: "pl"; MessagesFile: "compiler:Languages\Polish.isl" Name: "pt_BR"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl" Name: "pt_PT"; MessagesFile: "compiler:Languages\Portuguese.isl" Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl" -Name: "sr_RS"; MessagesFile: "compiler:Languages\SerbianCyrillic.isl" -Name: "sr_RS_latin"; MessagesFile: "compiler:Languages\SerbianLatin.isl" Name: "uk_UA"; MessagesFile: "compiler:Languages\Ukrainian.isl" -Name: "zh_CN"; MessagesFile: "compiler:Languages\ChineseSimplified.isl" -Name: "zh_TW"; MessagesFile: "compiler:Languages\ChineseTraditional.isl" +#ifdef UNOFFICIAL_LANGUAGES +; These languages are not shipped with InnoSetup by default and would need to be fetched from https://jrsoftware.org/files/istrans/ +;Name: "bg"; MessagesFile: "compiler:Languages\Bulgarian.isl" +;Name: "el"; MessagesFile: "compiler:Languages\Greek.isl" +;Name: "eu"; MessagesFile: "compiler:Languages\Basque.isl" +;Name: "gl"; MessagesFile: "compiler:Languages\Galician.isl" +;Name: "hu"; MessagesFile: "compiler:Languages\Hungarian.isl" +;Name: "id"; MessagesFile: "compiler:Languages\Indonesian.isl" +;Name: "ko"; MessagesFile: "compiler:Languages\Korean.isl" +;Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl" +;Name: "sr_RS"; MessagesFile: "compiler:Languages\SerbianCyrillic.isl" +;Name: "sr_RS_latin"; MessagesFile: "compiler:Languages\SerbianLatin.isl" +;Name: "zh_CN"; MessagesFile: "compiler:Languages\ChineseSimplified.isl" +;Name: "zh_TW"; MessagesFile: "compiler:Languages\ChineseTraditional.isl" +#endif [Files] ; small bitmaps (used by beautify code) -DestDir: {tmp}; Flags: dontcopy; Source: welcome.bmp -DestDir: {tmp}; Flags: dontcopy; Source: aegisub.bmp +DestDir: {tmp}; Flags: dontcopy; Source: {#INSTALLER_DIR}\welcome.bmp +DestDir: {tmp}; Flags: dontcopy; Source: {#INSTALLER_DIR}\aegisub.bmp ; uninstall data (used by migration code) -DestDir: {tmp}; Flags: dontcopy; Source: legacy_filelist.txt -DestDir: {tmp}; Flags: dontcopy; Source: legacy_dirlist.txt -DestDir: {tmp}; Flags: dontcopy; Source: legacy_locales.txt -DestDir: {tmp}; Flags: dontcopy; Source: legacy_shortcutlist.txt -DestDir: {tmp}; Flags: dontcopy; Source: old_filelist.txt -DestDir: {tmp}; Flags: dontcopy; Source: old_dirlist.txt -DestDir: {tmp}; Flags: dontcopy; Source: old_locales.txt -DestDir: {tmp}; Flags: dontcopy; Source: old_shortcutlist.txt +DestDir: {tmp}; Flags: dontcopy; Source: {#INSTALLER_DIR}\legacy_filelist.txt +DestDir: {tmp}; Flags: dontcopy; Source: {#INSTALLER_DIR}\legacy_dirlist.txt +DestDir: {tmp}; Flags: dontcopy; Source: {#INSTALLER_DIR}\legacy_locales.txt +DestDir: {tmp}; Flags: dontcopy; Source: {#INSTALLER_DIR}\legacy_shortcutlist.txt +DestDir: {tmp}; Flags: dontcopy; Source: {#INSTALLER_DIR}\old_filelist.txt +DestDir: {tmp}; Flags: dontcopy; Source: {#INSTALLER_DIR}\old_dirlist.txt +DestDir: {tmp}; Flags: dontcopy; Source: {#INSTALLER_DIR}\old_locales.txt +DestDir: {tmp}; Flags: dontcopy; Source: {#INSTALLER_DIR}\old_shortcutlist.txt diff --git a/packages/win_installer/fragment_shell_code.iss b/packages/win_installer/fragment_shell_code.iss index 259d45a06..53cea58a9 100644 --- a/packages/win_installer/fragment_shell_code.iss +++ b/packages/win_installer/fragment_shell_code.iss @@ -1,40 +1,4 @@ [Code] -(* -; Copyright (c) 2007-2009, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; -*) - // IShellLink interface and CLSID taken from sample const MAX_PATH = 260; @@ -121,4 +85,3 @@ begin Result := ''; end; end; - diff --git a/packages/win_installer/fragment_spelling.iss b/packages/win_installer/fragment_spelling.iss index 1ce979d8f..331f3eb29 100644 --- a/packages/win_installer/fragment_spelling.iss +++ b/packages/win_installer/fragment_spelling.iss @@ -1,41 +1,5 @@ -; Copyright (c) 2007-2011, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; - - ; This file declares all installables related to spell checking and thesaurii in Aegisub [Files] -Source: src\dictionaries\en_US.aff; DestDir: {app}\dictionaries; Flags: skipifsourcedoesntexist ignoreversion -Source: src\dictionaries\en_US.dic; DestDir: {app}\dictionaries; Flags: skipifsourcedoesntexist ignoreversion - +Source: {#DEPS_DIR}\dictionaries\en_US.aff; DestDir: {app}\dictionaries; Flags: skipifsourcedoesntexist ignoreversion +Source: {#DEPS_DIR}\dictionaries\en_US.dic; DestDir: {app}\dictionaries; Flags: skipifsourcedoesntexist ignoreversion diff --git a/packages/win_installer/fragment_strings.iss b/packages/win_installer/fragment_strings.iss index f558865da..f572d8618 100644 --- a/packages/win_installer/fragment_strings.iss +++ b/packages/win_installer/fragment_strings.iss @@ -1,44 +1,57 @@ [CustomMessages] InstallRuntime=Installing runtime libraries... +pt_PT.InstallRuntime=A instalar livrarias de runtime... +uk_UA.InstallRuntime=Встановлюю бібліотеки реального часу... +#ifdef UNOFFICIAL_LANGUAGES el.InstallRuntime=Εγκατάσταση βιβλιοθηκών... eu.InstallRuntime=Runtime liburutegiak ezartzen... id.InstallRuntime=Memasang runtime libraries... -pt_PT.InstallRuntime=A instalar livrarias de runtime... -uk_UA.InstallRuntime=Встановлюю бібліотеки реального часу... zh_CN.InstallRuntime=正在安装运行库…… zh_TW.InstallRuntime=正在安裝運行庫…… +#endif + StartMenuIcon=Create a start menu icon +pt_PT.StartMenuIcon=Criar ícone no menu iniciar +uk_UA.StartMenuIcon=Створити піктограму в меню Запустити +#ifdef UNOFFICIAL_LANGUAGES el.StartMenuIcon=Δημιουργία εικονιδίου στο μενού έναρξης eu.StartMenuIcon=Sortu hasiera menuko ikur bat id.StartMenuIcon=Buat ikon di menu awal -pt_PT.StartMenuIcon=Criar ícone no menu iniciar -uk_UA.StartMenuIcon=Створити піктограму в меню Запустити zh_CN.StartMenuIcon=创建开始菜单图标 zh_TW.StartMenuIcon=創建開始功能表圖示 +#endif + CheckForUpdates=Automatically check for new versions of Aegisub +pt_PT.CheckForUpdates=Verifica automaticamente a existência de novas versões do Aegisub +uk_UA.CheckForUpdates=Автоматично перевіряти Aegisub на нові версії +#ifdef UNOFFICIAL_LANGUAGES el.CheckForUpdates=Αυτόματος έλεγχος για καινούριες εκδόσεις του Aegisub eu.CheckForUpdates=Berezgaitasunez egiaztatu Aegisub-ren bertsio berririk dagoen id.CheckForUpdates=Otomatis cek versi terbaru Aegisub -pt_PT.CheckForUpdates=Verifica automaticamente a existência de novas versões do Aegisub -uk_UA.CheckForUpdates=Автоматично перевіряти Aegisub на нові версії zh_CN.CheckForUpdates=自动检查Aegisub的新版本 zh_TW.CheckForUpdates=自動檢查Aegisub的新版本 +#endif + UpdatesGroup=Update Checker: +pt_PT.UpdatesGroup=Verificar Actualizações: +uk_UA.UpdatesGroup=Модуль Перевірки на Оновлення: +#ifdef UNOFFICIAL_LANGUAGES el.UpdatesGroup=Έλεγχος Ενημερώσεων: eu.UpdatesGroup=Eguneraketa Egiaztatzailea: id.UpdatesGroup=Pemeriksa Pembaharuan -pt_PT.UpdatesGroup=Verificar Actualizações: -uk_UA.UpdatesGroup=Модуль Перевірки на Оновлення: zh_CN.UpdatesGroup=自动更新: zh_TW.UpdatesGroup=自動更新: +#endif ; Replacement for License page, no need to bother the user with legal mumbo-jumbo [Messages] WelcomeLabel2=This will install Aegisub {#BUILD_GIT_VERSION_STRING} on your computer.%n%nAegisub is covered by the GNU General Public License version 2. This means you may use the application for any purpose without charge, but that no warranties of any kind are given either.%n%nSee the Aegisub website for information on obtaining the source code. +pt_PT.WelcomeLabel2=Irá ser instalado no seu computador a versão {#BUILD_GIT_VERSION_STRING} do Aegisub.%n%nO Aegisub está protegido sob a Licença Pública Geral GNU (GPL version 2). O que significa que poderá fazer uso da aplicação para qualquer propósito, sem que seja cobrado, mas não serão dadas quaisquer tipos de garantias.%n%nVeja a página do Aegisub para mais informações sobre como obter o código-fonte. +uk_UA.WelcomeLabel2=Зараз буде встанвлено Aegisub {#BUILD_GIT_VERSION_STRING} на ваш комп'ютер.%n%nAegisub захищено універсальною громадською ліцензією GNU, версія 2. Це означає, що ви можете використосувати цю програму для будь яких цілей безкоштовно, але, в будь-якому випадку, ми не даємо жодних гарантій.%n%nДивіться сайт Aegisub для інформації щодо отримання вихідного коду. +#ifdef UNOFFICIAL_LANGUAGES el.WelcomeLabel2=Αυτό θα εγκαταστήσει το Aegisub {#BUILD_GIT_VERSION_STRING} στον υπολογιστή σας.%n%nΤο Aegisub καλύπτεται από τον άδεια GNU General Public License version 2. Αυτό σημαίνει ότι μπορείτε να χρησιμοποιήσετε την εφαρμογή για κάθε σκοπό χωρίς χρέωση, αλλά δεν υπάρχουν εγγυήσεις καμίας φύσης.%n%nΔείτε την ιστοσελίδα του Aegisub για πληροφορίες σχετικά με την απόκτηση του πηγαίου κώδικα. eu.WelcomeLabel2=Honek Aegisub {#BUILD_GIT_VERSION_STRING} ezarriko du zure ordenagailuan.%n%nAegisub GNU Baimen Publiko Orokorra 2. bertsioa Baimenak estalia dago. Honek esanahi du aplikazio hau edozein asmotarako erabili dezakezula ordaindu behar izan gabe, baina ez da inolako berme motarik ematen.%n%nIkusi Aegisub webgunea iturburu kodea lortzeko argibideetarako. id.WelcomeLabel2=Ini akan memasang Aegisub {#BUILD_GIT_VERSION_STRING} di komputer Anda.%n%nAegisub dilindungi oleh Lisensi Publik Umum GNU versi 2. Artinya Anda bisa menggunakan aplikasi ini untuk tujuan apa pun tanpad dipungut biaya, tapi tidak ada jaminan yang bisa diberikan.%n%nLihat laman situs Aegisub untuk memperoleh informasi sumber kode. -pt_PT.WelcomeLabel2=Irá ser instalado no seu computador a versão {#BUILD_GIT_VERSION_STRING} do Aegisub.%n%nO Aegisub está protegido sob a Licença Pública Geral GNU (GPL version 2). O que significa que poderá fazer uso da aplicação para qualquer propósito, sem que seja cobrado, mas não serão dadas quaisquer tipos de garantias.%n%nVeja a página do Aegisub para mais informações sobre como obter o código-fonte. -uk_UA.WelcomeLabel2=Зараз буде встанвлено Aegisub {#BUILD_GIT_VERSION_STRING} на ваш комп'ютер.%n%nAegisub захищено універсальною громадською ліцензією GNU, версія 2. Це означає, що ви можете використосувати цю програму для будь яких цілей безкоштовно, але, в будь-якому випадку, ми не даємо жодних гарантій.%n%nДивіться сайт Aegisub для інформації щодо отримання вихідного коду. zh_CN.WelcomeLabel2=将会在您的电脑上安装Aegisub {#BUILD_GIT_VERSION_STRING} 。%n%n Aegisub适用于GNU通用公共许可证第二版(GPLv2),这意味着您可以将该应用程序用于任何目的而不需要支付费用,但同时也不会得到任何形式的担保。%n%n您可以到Aegisub官网获取源代码信息。 zh_TW.WelcomeLabel2=將會在您的電腦上安裝Aegisub {#BUILD_GIT_VERSION_STRING} 。%n%n Aegisub適用於GNU通用公共許可證第二版(GPLv2),這意味著您可以將該應用程式用於任何目的而不需要支付費用,但同時也不會得到任何形式的擔保。%n%n您可以到Aegisub官網獲取原始程式碼資訊。 +#endif diff --git a/packages/win_installer/fragment_translations.iss b/packages/win_installer/fragment_translations.iss index 08d6a5ca5..2e6098711 100644 --- a/packages/win_installer/fragment_translations.iss +++ b/packages/win_installer/fragment_translations.iss @@ -1,98 +1,64 @@ -; Copyright (c) 2007-2009, Niels Martin Hansen -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions are met: -; -; * Redistributions of source code must retain the above copyright notice, -; this list of conditions and the following disclaimer. -; * 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. -; * Neither the name of the Aegisub Group nor the names of its contributors -; may 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. -; -; ----------------------------------------------------------------------------- -; -; AEGISUB -; -; Website: http://www.aegisub.org/ -; Contact: mailto:nielsm@indvikleren.dk -; - - -; This file declares everything related to installable translations of Aegisub +; This file declares everything related to installable translations of Aegisub [Files] ; localization (commented out ones are out of date; some don't have wxstd.mo) -Source: ..\..\po\ar.mo; DestDir: {app}\locale\ar; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +#ifdef ENABLE_TRANSLATIONS +Source: {#BUILD_ROOT}\po\ar.mo; DestDir: {app}\locale\ar; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-ar.mo; DestDir: {app}\locale\ar; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\bg.mo; DestDir: {app}\locale\bg; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\bg.mo; DestDir: {app}\locale\bg; DestName: aegisub.mo; Flags: ignoreversion; Components: translations ; Missing wxstd for Bulgarian -Source: ..\..\po\ca.mo; DestDir: {app}\locale\ca; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\ca.mo; DestDir: {app}\locale\ca; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-ca.mo; DestDir: {app}\locale\ca; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\cs.mo; DestDir: {app}\locale\cs; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\cs.mo; DestDir: {app}\locale\cs; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-cs.mo; DestDir: {app}\locale\cs; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\da.mo; DestDir: {app}\locale\da; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\da.mo; DestDir: {app}\locale\da; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-da.mo; DestDir: {app}\locale\da; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\de.mo; DestDir: {app}\locale\de; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\de.mo; DestDir: {app}\locale\de; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-de.mo; DestDir: {app}\locale\de; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\el.mo; DestDir: {app}\locale\el; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\el.mo; DestDir: {app}\locale\el; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-el.mo; DestDir: {app}\locale\el; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\es.mo; DestDir: {app}\locale\es; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\es.mo; DestDir: {app}\locale\es; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-es.mo; DestDir: {app}\locale\es; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\eu.mo; DestDir: {app}\locale\eu; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\eu.mo; DestDir: {app}\locale\eu; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-eu.mo; DestDir: {app}\locale\eu; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\fa.mo; DestDir: {app}\locale\fa; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\fa.mo; DestDir: {app}\locale\fa; DestName: aegisub.mo; Flags: ignoreversion; Components: translations ; Farsi wxstd missing ;Source: src\mo\wxstd-fa.mo; DestDir: {app}\locale\fa; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\fi.mo; DestDir: {app}\locale\fi; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\fi.mo; DestDir: {app}\locale\fi; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-fi.mo; DestDir: {app}\locale\fi; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\fr_FR.mo; DestDir: {app}\locale\fr_FR; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\fr_FR.mo; DestDir: {app}\locale\fr_FR; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-fr.mo; DestDir: {app}\locale\fr_FR; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\gl.mo; DestDir: {app}\locale\gl; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\gl.mo; DestDir: {app}\locale\gl; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-gl_ES.mo; DestDir: {app}\locale\gl; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\hu.mo; DestDir: {app}\locale\hu; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\hu.mo; DestDir: {app}\locale\hu; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-hu.mo; DestDir: {app}\locale\hu; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\id.mo; DestDir: {app}\locale\id; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\id.mo; DestDir: {app}\locale\id; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-id.mo; DestDir: {app}\locale\id; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\it.mo; DestDir: {app}\locale\it; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\it.mo; DestDir: {app}\locale\it; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-it.mo; DestDir: {app}\locale\it; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\ja.mo; DestDir: {app}\locale\ja; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\ja.mo; DestDir: {app}\locale\ja; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-ja.mo; DestDir: {app}\locale\ja; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\ko.mo; DestDir: {app}\locale\ko; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\ko.mo; DestDir: {app}\locale\ko; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-ko_KR.mo; DestDir: {app}\locale\ko; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\nl.mo; DestDir: {app}\locale\nl; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\nl.mo; DestDir: {app}\locale\nl; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-nl.mo; DestDir: {app}\locale\nl; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\pl.mo; DestDir: {app}\locale\pl; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\pl.mo; DestDir: {app}\locale\pl; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-pl.mo; DestDir: {app}\locale\pl; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\pt_BR.mo; DestDir: {app}\locale\pt_BR; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\pt_BR.mo; DestDir: {app}\locale\pt_BR; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-pt_BR.mo; DestDir: {app}\locale\pt_BR; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\pt_PT.mo; DestDir: {app}\locale\pt_PT; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\pt_PT.mo; DestDir: {app}\locale\pt_PT; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-pt.mo; DestDir: {app}\locale\pt_PT; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\ru.mo; DestDir: {app}\locale\ru; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\ru.mo; DestDir: {app}\locale\ru; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-ru.mo; DestDir: {app}\locale\ru; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\sr_RS.mo; DestDir: {app}\locale\sr_RS; DestName: aegisub.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\sr_RS@latin.mo; DestDir: {app}\locale\sr_RS@latin; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\sr_RS.mo; DestDir: {app}\locale\sr_RS; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\sr_RS@latin.mo; DestDir: {app}\locale\sr_RS@latin; DestName: aegisub.mo; Flags: ignoreversion; Components: translations ; Missing wxstd for Serbian -Source: ..\..\po\uk_UA.mo; DestDir: {app}\locale\uk_UA; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\uk_UA.mo; DestDir: {app}\locale\uk_UA; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-uk_UA.mo; DestDir: {app}\locale\uk_UA; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\vi.mo; DestDir: {app}\locale\vi; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\vi.mo; DestDir: {app}\locale\vi; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-vi.mo; DestDir: {app}\locale\vi; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\zh_CN.mo; DestDir: {app}\locale\zh_CN; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\zh_CN.mo; DestDir: {app}\locale\zh_CN; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-zh_CN.mo; DestDir: {app}\locale\zh_CN; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: ..\..\po\zh_TW.mo; DestDir: {app}\locale\zh_TW; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\zh_TW.mo; DestDir: {app}\locale\zh_TW; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-zh_TW.mo; DestDir: {app}\locale\zh_TW; DestName: wxstd.mo; Flags: ignoreversion; Components: translations - +#endif diff --git a/packages/win_installer/license.txt b/packages/win_installer/license.txt index 732874e53..d78767c5c 100644 --- a/packages/win_installer/license.txt +++ b/packages/win_installer/license.txt @@ -1,4 +1,4 @@ -Copyright (c) 2005-2014, the Aegisub Team. +Copyright (c) 2005-2020, the Aegisub Team. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/tools/version.ps1 b/tools/version.ps1 index f02e47dc6..13e51b4f2 100644 --- a/tools/version.ps1 +++ b/tools/version.ps1 @@ -63,7 +63,7 @@ if ($exactGitTag -match $semVerMatch) { if ($tag -match $semVerMatch) {# $version['TAGGED_RELEASE'] = $false $version['RESOURCE_BASE_VERSION'] = $Matches[1..3] + $gitRevision - $version['INSTALLER_VERSION'] = ($Matches[1..3] -join '.') + "-" + $gitBranch + $version['INSTALLER_VERSION'] = ($Matches[1..3] -join '.') break; } } diff --git a/tools/win-installer-setup.ps1 b/tools/win-installer-setup.ps1 new file mode 100644 index 000000000..42ee0cc42 --- /dev/null +++ b/tools/win-installer-setup.ps1 @@ -0,0 +1,80 @@ +#!/usr/bin/env powershell + +param ( + [Parameter(Position = 0)] + [string]$BuildRoot, + [Parameter(Position = 1)] + [string]$SourceRoot +) + +$InstallerDir = Join-Path $SourceRoot "packages\win_installer" | Resolve-Path +$DepsDir = Join-Path $BuildRoot "installer-deps" +if (!(Test-Path $DepsDir)) { + New-Item -ItemType Directory -Path $DepsDir +} + +$Env:BUILD_ROOT = $BuildRoot +$Env:SOURCE_ROOT = $SourceRoot + +Set-Location $DepsDir + +# DepCtrl +if (!(Test-Path DependencyControl)) { + git clone https://github.com/TypesettingTools/DependencyControl.git +} + +# YUtils +if (!(Test-Path YUtils)) { + git clone https://github.com/TypesettingTools/YUtils.git +} + +# luajson +if (!(Test-Path luajson)) { + git clone https://github.com/harningt/luajson.git +} + +# Avisynth +if (!(Test-Path AviSynthPlus64)) { + $avsReleases = Invoke-WebRequest "https://api.github.com/repos/AviSynth/AviSynthPlus/releases/latest" -UseBasicParsing | ConvertFrom-Json + $avsUrl = $avsReleases.assets[0].browser_download_url + Invoke-WebRequest $avsUrl -OutFile AviSynthPlus.7z -UseBasicParsing + 7z x AviSynthPlus.7z + Rename-Item (Get-ChildItem -Filter "AviSynthPlus_*" -Directory) AviSynthPlus64 + Remove-Item AviSynthPlus.7z +} + +# VSFilter +if (!(Test-Path VSFilter)) { + $vsFilterDir = New-Item -ItemType Directory VSFilter + Set-Location $vsFilterDir + $vsFilterReleases = Invoke-WebRequest "https://api.github.com/repos/pinterf/xy-VSFilter/releases/latest" -UseBasicParsing | ConvertFrom-Json + $vsFilterUrl = $vsFilterReleases.assets[0].browser_download_url + Invoke-WebRequest $vsFilterUrl -OutFile VSFilter.7z -UseBasicParsing + 7z x VSFilter.7z + Remove-Item VSFilter.7z + Set-Location $DepsDir +} + +# ffi-experiments +if (!(Test-Path ffi-experiments)) { + Get-Command "moonc" # check to ensure Moonscript is present + git clone https://github.com/TypesettingTools/ffi-experiments.git + Set-Location ffi-experiments + meson build -Ddefault_library=static + meson compile -C build + Set-Location $DepsDir +} + +# VC++ redistributable +if (!(Test-Path VC_redist)) { + $redistDir = New-Item -ItemType Directory VC_redist + Invoke-WebRequest https://aka.ms/vs/16/release/VC_redist.x64.exe -OutFile "$redistDir\VC_redist.x64.exe" -UseBasicParsing +} + +# TODO dictionaries + +# TODO localization + +# Invoke InnoSetup +$IssUrl = Join-Path $InstallerDir "aegisub_depctrl.iss" +iscc $IssUrl From 106c7537820ad14d02e36f24b50e1d6a4deea858 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 22 Dec 2020 01:06:07 -0500 Subject: [PATCH 185/271] actions: support installer generation on CI --- .github/workflows/ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95e8f4e51..a676d1ef4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,14 @@ jobs: - name: Install dependencies (Windows) if: matrix.config.os == 'windows-latest' - run: choco install ninja + run: | + choco install ninja + $url = "https://github.com/leafo/moonscript/releases/download/win32-v0.5.0/moonscript-187bac54ee5a7450013e9c38e005a0e671b76f45.zip" + mkdir moonscript + Invoke-WebRequest -Uri $url -OutFile ".\moonscript\moonscript.zip" + cd moonscript + 7z e moonscript.zip + Get-Location | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Install dependencies (Linux) if: matrix.config.os == 'ubuntu-latest' @@ -71,6 +78,10 @@ jobs: - name: Build run: meson compile -C build + - name: Generate Windows installer + if: matrix.config.os == 'windows-latest' + run: ninja win-installer + - name: Upload artifacts uses: actions/upload-artifact@v2 if: matrix.config.os == 'windows-latest' From 8cf4100c871b83e1f55d431ec22b3425a99e2660 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 22 Dec 2020 22:52:28 -0500 Subject: [PATCH 186/271] meson: fix resource file compilation This enables video to load correctly in Windows builds --- src/meson.build | 27 +++++++++++++++++++++++++++ src/res/res.rc | 20 +++----------------- tools/version.ps1 | 4 ++-- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/meson.build b/src/meson.build index 29dfe2169..90c981792 100644 --- a/src/meson.build +++ b/src/meson.build @@ -188,6 +188,33 @@ elif host_machine.system() == 'windows' else error('Missing Windows SDK Uniscribe Library (usp10.h / usp10.lib)') endif + + res_inc = include_directories('bitmaps/windows') + res_dep_files = files( + 'bitmaps/windows/icon.ico', + 'bitmaps/windows/eyedropper.cur', + ) + windows = import('windows') + if wx_dep.type_name() != 'not-found' # system wx + raw_wx_windres_args = wx_dep.get_variable(configtool: 'rescomp').split() + wx_windres_args = [] + foreach arg: raw_wx_windres_args + if arg != 'windres' + wx_windres_args += arg + endif + endforeach + aegisub_src += windows.compile_resources('res/res.rc', + args: wx_windres_args, + depend_files: res_dep_files, + depends: version_h, + include_directories: [res_inc, version_inc]) + else # subproject + wx_inc = wx.include_directories('wxmono') + aegisub_src += windows.compile_resources('res/res.rc', + depend_files: res_dep_files, + depends: version_h, + include_directories: [res_inc, version_inc, wx_inc]) + endif elif conf.get('WITH_FONTCONFIG') == '1' aegisub_src += 'font_file_lister_fontconfig.cpp' endif diff --git a/src/res/res.rc b/src/res/res.rc index 45616b8cb..26f268165 100644 --- a/src/res/res.rc +++ b/src/res/res.rc @@ -23,23 +23,9 @@ eyedropper_cursor CURSOR "../bitmaps/windows/eyedropper.cur" #define wxUSE_NO_MANIFEST 1 #include "wx/msw/wx.rc" -#include "../../build/git_version.h" +#include "git_version.h" #include -#ifdef _DEBUG - #ifdef _WIN64 - #define AGI_RC_FILENAME "aegisub64d" - #else - #define AGI_RC_FILENAME "aegisub32d" - #endif -#else - #ifdef _WIN64 - #define AGI_RC_FILENAME "aegisub64" - #else - #define AGI_RC_FILENAME "aegisub32" - #endif -#endif - #ifdef _DEBUG #define AGI_RC_FLAG_DEBUG VS_FF_DEBUG #else @@ -68,8 +54,8 @@ BEGIN VALUE "CompanyName", "Aegisub" VALUE "FileDescription", "Aegisub subtitle editor" VALUE "FileVersion", BUILD_GIT_VERSION_STRING - VALUE "InternalName", AGI_RC_FILENAME - VALUE "OriginalFilename", AGI_RC_FILENAME ".exe" + VALUE "InternalName", "aegisub" + VALUE "OriginalFilename", "aegisub.exe" VALUE "ProductName", "Aegisub" VALUE "ProductVersion", BUILD_GIT_VERSION_STRING END diff --git a/tools/version.ps1 b/tools/version.ps1 index 13e51b4f2..7a05b7bf5 100644 --- a/tools/version.ps1 +++ b/tools/version.ps1 @@ -62,7 +62,7 @@ if ($exactGitTag -match $semVerMatch) { $tag = git -C $repositoryRootPath describe --exact-match --tags $rev 2>$null if ($tag -match $semVerMatch) {# $version['TAGGED_RELEASE'] = $false - $version['RESOURCE_BASE_VERSION'] = $Matches[1..3] + $gitRevision + $version['RESOURCE_BASE_VERSION'] = $Matches[1..3] $version['INSTALLER_VERSION'] = ($Matches[1..3] -join '.') break; } @@ -85,5 +85,5 @@ $version.GetEnumerator() | %{ {"`"$($value.ToString())`""} } } - "#define $($_.Key) $($fmtValue)" + "`n#define $($_.Key) $($fmtValue)" } | Out-File -FilePath $gitVersionHeaderPath -Encoding utf8 From 9211b7b632419c63c87d46f70e8ccc1e2717ea87 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 23 Dec 2020 02:59:57 -0500 Subject: [PATCH 187/271] win-installer: fix warnings --- packages/win_installer/aegisub3.iss | 4 ++-- packages/win_installer/fragment_migrate_code.iss | 2 +- packages/win_installer/fragment_setupbase.iss | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/win_installer/aegisub3.iss b/packages/win_installer/aegisub3.iss index 61960ad36..b4361a733 100644 --- a/packages/win_installer/aegisub3.iss +++ b/packages/win_installer/aegisub3.iss @@ -5,7 +5,7 @@ [Setup] AppID={{24BC8B57-716C-444F-B46B-A3349B9164C5} -DefaultDirName={pf}\Aegisub +DefaultDirName={commonpf}\Aegisub PrivilegesRequired=poweruser ArchitecturesInstallIn64BitMode=x64 ArchitecturesAllowed=x64 @@ -41,7 +41,7 @@ begin if CurStep = ssPostInstall then begin - if IsTaskSelected('checkforupdates') then + if WizardIsTaskSelected('checkforupdates') then Updates := 'true' else Updates := 'false'; diff --git a/packages/win_installer/fragment_migrate_code.iss b/packages/win_installer/fragment_migrate_code.iss index ff655154f..2ba53ffdd 100644 --- a/packages/win_installer/fragment_migrate_code.iss +++ b/packages/win_installer/fragment_migrate_code.iss @@ -31,7 +31,7 @@ end; function InitializeSetupMigration: Boolean; begin LegacyStartMenuFolder := 'Aegisub'; - LegacyInstallFolder := ExpandConstant('{pf}\Aegisub'); + LegacyInstallFolder := ExpandConstant('{commonpf32}\Aegisub'); LegacyVersionNumber := '1.x'; try diff --git a/packages/win_installer/fragment_setupbase.iss b/packages/win_installer/fragment_setupbase.iss index 168c5f88b..1d4529587 100644 --- a/packages/win_installer/fragment_setupbase.iss +++ b/packages/win_installer/fragment_setupbase.iss @@ -28,6 +28,7 @@ UsePreviousGroup=yes UsePreviousSetupType=no UsePreviousAppDir=yes UsePreviousTasks=no +UsedUserAreasWarning=no UninstallDisplayIcon={app}\aegisub{#ARCH}.exe ; Default to a large welcome bitmap, suitable for large fonts ; The normal fonts version is selected by code below From 32729800dfd5b8b3b105ef29cf09f6cfd617f511 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 23 Dec 2020 03:58:36 -0500 Subject: [PATCH 188/271] actions: build as release for Windows CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a676d1ef4..30c0b75a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,7 @@ jobs: - name: Configure (Windows) if: matrix.config.os == 'windows-latest' # -Dfreetype2:png=enabled is a workaround for https://savannah.nongnu.org/bugs/?59458 - run: meson build -Ddefault_library=static --force-fallback-for=zlib,harfbuzz -Dfreetype2:zlib=system -Dfreetype2:png=enabled -Dfreetype2:default_library=static + run: meson build -Ddefault_library=static --force-fallback-for=zlib,harfbuzz -Dfreetype2:zlib=system -Dfreetype2:png=enabled -Dfreetype2:default_library=static -Dbuildtype=release - name: Configure (Linux) if: matrix.config.os == 'ubuntu-latest' From 56581fbce30d395619468e11e061820ad64e54ba Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 23 Dec 2020 05:07:02 -0500 Subject: [PATCH 189/271] actions: invoke win-installer correctly, install innosetup on ci --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30c0b75a5..5ece2b685 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: - name: Install dependencies (Windows) if: matrix.config.os == 'windows-latest' run: | - choco install ninja + choco install ninja innosetup $url = "https://github.com/leafo/moonscript/releases/download/win32-v0.5.0/moonscript-187bac54ee5a7450013e9c38e005a0e671b76f45.zip" mkdir moonscript Invoke-WebRequest -Uri $url -OutFile ".\moonscript\moonscript.zip" @@ -80,7 +80,7 @@ jobs: - name: Generate Windows installer if: matrix.config.os == 'windows-latest' - run: ninja win-installer + run: meson compile win-installer -C build - name: Upload artifacts uses: actions/upload-artifact@v2 From f240c01cbc88ca8c4bec4e0de64dcabdc6ef7310 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 24 Dec 2020 16:57:08 -0500 Subject: [PATCH 190/271] meson: only manually set _DEBUG on non-windows --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 0b53d1967..dd5e84877 100644 --- a/meson.build +++ b/meson.build @@ -45,7 +45,8 @@ if host_machine.system() == 'windows' add_project_arguments('-DNOMINMAX', '-D_WIN32_WINNT=0x0602', language: 'cpp') endif -if get_option('debug') +# MSVC sets this automatically with -MDd, but it has a different meaning on other platforms +if get_option('debug') and host_machine.system() != 'windows' add_project_arguments('-D_DEBUG', language: 'cpp') endif From c487dd2bdbab58ad9f50da6624132165abd7a123 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 9 Jan 2021 03:17:05 -0500 Subject: [PATCH 191/271] Parially revert fffb138b8175b4838b6a063863756b7c6b2db547 I haven't checked whether reverting this breaks IME input, and if it doesn't what changed on wx's end. However, this is the commit that uses private symbols, and so reverting it lets us build against upstream wx. Even if this is a loss in functionality, for now it's fine. --- src/meson.build | 1 - src/osx/scintilla_ime.mm | 212 --------------------------------------- src/subs_edit_box.cpp | 4 +- src/subs_edit_ctrl.cpp | 8 -- src/utils.cpp | 7 -- src/utils.h | 9 -- 6 files changed, 1 insertion(+), 240 deletions(-) delete mode 100644 src/osx/scintilla_ime.mm diff --git a/src/meson.build b/src/meson.build index 90c981792..13570c139 100644 --- a/src/meson.build +++ b/src/meson.build @@ -168,7 +168,6 @@ if host_machine.system() == 'darwin' 'font_file_lister_coretext.mm', 'osx/osx_utils.mm', 'osx/retina_helper.mm', - 'osx/scintilla_ime.mm', ] elif host_machine.system() == 'windows' aegisub_src += [ diff --git a/src/osx/scintilla_ime.mm b/src/osx/scintilla_ime.mm deleted file mode 100644 index 4806d1797..000000000 --- a/src/osx/scintilla_ime.mm +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) 2014, Thomas Goyne -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -// -// Aegisub Project http://www.aegisub.org/ - -#import -#import -#import - -// from src/osx/cocoa/window.mm -@interface wxNSView : NSView { - BOOL _hasToolTip; - NSTrackingRectTag _lastToolTipTrackTag; - id _lastToolTipOwner; - void *_lastUserData; -} -@end - -@interface IMEState : NSObject -@property (nonatomic) NSRange markedRange; -@property (nonatomic) bool undoActive; -@end - -@implementation IMEState -- (id)init { - self = [super init]; - self.markedRange = NSMakeRange(NSNotFound, 0); - self.undoActive = false; - return self; -} -@end - -@interface ScintillaNSView : wxNSView -@property (nonatomic, readonly) wxStyledTextCtrl *stc; -@property (nonatomic, readonly) IMEState *state; -@end - -@implementation ScintillaNSView -- (Class)superclass { - return [wxNSView superclass]; -} - -- (wxStyledTextCtrl *)stc { - return static_cast(wxWidgetImpl::FindFromWXWidget(self)->GetWXPeer()); -} - -- (IMEState *)state { - return objc_getAssociatedObject(self, [IMEState class]); -} - -- (void)invalidate { - self.state.markedRange = NSMakeRange(NSNotFound, 0); - [self.inputContext discardMarkedText]; -} - -#pragma mark - NSTextInputClient - -- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange - actualRange:(NSRangePointer)actualRange -{ - return nil; -} - -- (NSUInteger)characterIndexForPoint:(NSPoint)point { - return self.stc->PositionFromPoint(wxPoint(point.x, point.y)); -} - -- (BOOL)drawsVerticallyForCharacterAtIndex:(NSUInteger)charIndex { - return NO; -} - -- (NSRect)firstRectForCharacterRange:(NSRange)range - actualRange:(NSRangePointer)actualRange -{ - auto stc = self.stc; - int line = stc->LineFromPosition(range.location); - int height = stc->TextHeight(line); - auto pt = stc->PointFromPosition(range.location); - - int width = 0; - if (range.length > 0) { - // If the end of the range is on the next line, the range should be - // truncated to the current line and actualRange should be set to the - // truncated range - int end_line = stc->LineFromPosition(range.location + range.length); - if (end_line > line) { - range.length = stc->PositionFromLine(line + 1) - 1 - range.location; - *actualRange = range; - } - - auto end_pt = stc->PointFromPosition(range.location + range.length); - width = end_pt.x - pt.x; - } - - auto rect = NSMakeRect(pt.x, pt.y, width, height); - rect = [self convertRect:rect toView:nil]; - return [self.window convertRectToScreen:rect]; -} - -- (BOOL)hasMarkedText { - return self.state.markedRange.length > 0; -} - -- (void)insertText:(id)str replacementRange:(NSRange)replacementRange { - [self unmarkText]; - [super insertText:str replacementRange:replacementRange]; -} - -- (NSRange)markedRange { - return self.state.markedRange; -} - -- (NSRange)selectedRange { - long from = 0, to = 0; - self.stc->GetSelection(&from, &to); - return NSMakeRange(from, to - from); -} - -- (void)setMarkedText:(id)str - selectedRange:(NSRange)range - replacementRange:(NSRange)replacementRange -{ - if ([str isKindOfClass:[NSAttributedString class]]) - str = [str string]; - - auto stc = self.stc; - auto state = self.state; - - int pos = stc->GetInsertionPoint(); - if (state.markedRange.length > 0) { - pos = state.markedRange.location; - stc->DeleteRange(pos, state.markedRange.length); - stc->SetSelection(pos, pos); - } else { - state.undoActive = stc->GetUndoCollection(); - if (state.undoActive) - stc->SetUndoCollection(false); - } - - auto utf8 = [str UTF8String]; - auto utf8len = strlen(utf8); - stc->AddTextRaw(utf8, utf8len); - - state.markedRange = NSMakeRange(pos, utf8len); - - stc->SetIndicatorCurrent(1); - stc->IndicatorFillRange(pos, utf8len); - - // Re-enable undo if we got a zero-length string as that means we're done - if (!utf8len && state.undoActive) - stc->SetUndoCollection(true); - else { - int start = pos; - // Range is in utf-16 code units - if (range.location > 0) - start += [[str substringToIndex:range.location] lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; - int length = [[str substringWithRange:range] lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; - stc->SetSelection(start, start + length); - } -} - -- (void)unmarkText { - auto state = self.state; - if (state.markedRange.length > 0) { - self.stc->DeleteRange(state.markedRange.location, state.markedRange.length); - state.markedRange = NSMakeRange(NSNotFound, 0); - if (state.undoActive) - self.stc->SetUndoCollection(true); - } -} - -- (NSArray *)validAttributesForMarkedText { - return @[]; -} -@end - -namespace osx { namespace ime { -void inject(wxStyledTextCtrl *ctrl) { - id view = (id)ctrl->GetHandle(); - object_setClass(view, [ScintillaNSView class]); - - auto state = [IMEState new]; - objc_setAssociatedObject(view, [IMEState class], state, - OBJC_ASSOCIATION_RETAIN_NONATOMIC); - [state release]; -} - -void invalidate(wxStyledTextCtrl *ctrl) { - [(ScintillaNSView *)ctrl->GetHandle() invalidate]; -} - -bool process_key_event(wxStyledTextCtrl *ctrl, wxKeyEvent &evt) { - if (evt.GetModifiers() != 0) return false; - if (evt.GetKeyCode() != WXK_RETURN && evt.GetKeyCode() != WXK_TAB) return false; - if (![(ScintillaNSView *)ctrl->GetHandle() hasMarkedText]) return false; - - evt.Skip(); - return true; -} - -} } diff --git a/src/subs_edit_box.cpp b/src/subs_edit_box.cpp index ca08b4177..8ae123713 100644 --- a/src/subs_edit_box.cpp +++ b/src/subs_edit_box.cpp @@ -52,7 +52,6 @@ #include "text_selection_controller.h" #include "timeedit_ctrl.h" #include "tooltip_manager.h" -#include "utils.h" #include "validators.h" #include @@ -427,8 +426,7 @@ void SubsEditBox::UpdateFrameTiming(agi::vfr::Framerate const& fps) { } void SubsEditBox::OnKeyDown(wxKeyEvent &event) { - if (!osx::ime::process_key_event(edit_ctrl, event)) - hotkey::check("Subtitle Edit Box", c, event); + hotkey::check("Subtitle Edit Box", c, event); } void SubsEditBox::OnChange(wxStyledTextEvent &event) { diff --git a/src/subs_edit_ctrl.cpp b/src/subs_edit_ctrl.cpp index d744900eb..d2d31ee6b 100644 --- a/src/subs_edit_ctrl.cpp +++ b/src/subs_edit_ctrl.cpp @@ -83,8 +83,6 @@ SubsTextEditCtrl::SubsTextEditCtrl(wxWindow* parent, wxSize wsize, long style, a , thesaurus(agi::make_unique()) , context(context) { - osx::ime::inject(this); - // Set properties SetWrapMode(wxSTC_WRAP_WORD); SetMarginWidth(1,0); @@ -187,7 +185,6 @@ void SubsTextEditCtrl::OnLoseFocus(wxFocusEvent &event) { } void SubsTextEditCtrl::OnKeyDown(wxKeyEvent &event) { - if (osx::ime::process_key_event(this, event)) return; event.Skip(); // Workaround for wxSTC eating tabs. @@ -245,10 +242,6 @@ void SubsTextEditCtrl::SetStyles() { // Misspelling indicator IndicatorSetStyle(0,wxSTC_INDIC_SQUIGGLE); IndicatorSetForeground(0,wxColour(255,0,0)); - - // IME pending text indicator - IndicatorSetStyle(1, wxSTC_INDIC_PLAIN); - IndicatorSetUnder(1, true); } void SubsTextEditCtrl::UpdateStyle() { @@ -313,7 +306,6 @@ void SubsTextEditCtrl::UpdateCallTip() { } void SubsTextEditCtrl::SetTextTo(std::string const& text) { - osx::ime::invalidate(this); SetEvtHandlerEnabled(false); Freeze(); diff --git a/src/utils.cpp b/src/utils.cpp index 69c53bd1c..a014b0a29 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -217,13 +217,6 @@ void SetFloatOnParent(wxWindow *) { } RetinaHelper::RetinaHelper(wxWindow *) { } RetinaHelper::~RetinaHelper() { } int RetinaHelper::GetScaleFactor() const { return 1; } - -// OS X implementation in scintilla_ime.mm -namespace osx { namespace ime { - void inject(wxStyledTextCtrl *) { } - void invalidate(wxStyledTextCtrl *) { } - bool process_key_event(wxStyledTextCtrl *, wxKeyEvent&) { return false; } -} } #endif wxString FontFace(std::string opt_prefix) { diff --git a/src/utils.h b/src/utils.h index 269100de8..02ef78aac 100644 --- a/src/utils.h +++ b/src/utils.h @@ -106,13 +106,4 @@ namespace osx { bool activate_top_window_other_than(wxFrame *wx); // Bring all windows to the front, maintaining relative z-order void bring_to_front(); - -namespace ime { - /// Inject the IME helper into the given wxSTC - void inject(wxStyledTextCtrl *ctrl); - /// Invalidate any pending text from the IME - void invalidate(wxStyledTextCtrl *ctrl); - /// Give the IME a chance to process a key event and return whether it did - bool process_key_event(wxStyledTextCtrl *ctrl, wxKeyEvent &); -} } From b51463a5f5eb334f253912f470b90d21de341cc9 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 9 Jan 2021 03:18:11 -0500 Subject: [PATCH 192/271] meson: Fix build on OSX --- meson.build | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index dd5e84877..043d9809e 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', - meson_version: '>=0.55.0', + meson_version: '>=0.56.1', default_options: ['cpp_std=c++11', 'b_lto=true', 'buildtype=debugoptimized'], version: '3.2.2') @@ -64,7 +64,7 @@ conf.set('WITH_FONTCONFIG', '0') if host_machine.system() == 'darwin' add_languages('objc', 'objcpp') add_project_arguments('-DGL_SILENCE_DEPRECATION', language: 'cpp') - # meson does not currently support objcpp_std + # meson neither supports objcpp_std nor inherits cpp_std https://github.com/mesonbuild/meson/issues/5495 add_project_arguments('-std=c++11', language: 'objcpp') elif host_machine.system() != 'windows' conf.set('WITH_FONTCONFIG', '1') @@ -106,7 +106,11 @@ endif deps += dependency('zlib') -wx_dep = dependency('wxWidgets', version: '>=3.0.0', +wx_minver = '>=3.0.0' +if host_machine.system() == 'darwin' + wx_minver = '>=3.1.0' +endif +wx_dep = dependency('wxWidgets', version: wx_minver, required: false, modules: ['std', 'stc', 'gl']) @@ -134,11 +138,16 @@ else wx.dependency('wxscintilla') ] + if host_machine.system() == 'windows' or host_machine.system() == 'darwin' + deps += [ + wx.dependency('wxpng'), + ] + endif + if host_machine.system() == 'windows' deps += [ wx.dependency('wxzlib'), - wx.dependency('wxpng'), - wx.dependency('wxexpat') + wx.dependency('wxexpat'), ] if cc.has_header('rpc.h') @@ -215,7 +224,7 @@ if host_machine.system() == 'windows' and not get_option('directsound').disabled endif if host_machine.system() == 'darwin' - frameworks_dep = dependency('appleframeworks', modules : ['CoreText', 'CoreFoundation']) + frameworks_dep = dependency('appleframeworks', modules : ['CoreText', 'CoreFoundation', 'AppKit', 'Carbon']) deps += frameworks_dep endif From bc079922c083fc7cae01d89a1d7dacf110f5f8f1 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 9 Jan 2021 03:18:33 -0500 Subject: [PATCH 193/271] actions: Enable OSX CI --- .github/workflows/ci.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ece2b685..2e9652425 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,10 +28,10 @@ jobs: name: "Ubuntu", os: ubuntu-latest } - #- { - # name: "macOS", - # os: macos-latest - #} + - { + name: "macOS", + os: macos-latest + } steps: - uses: actions/checkout@v2 @@ -62,6 +62,12 @@ jobs: 7z e moonscript.zip Get-Location | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + - name: Install dependencies (MacOS) + if: matrix.config.os == 'macos-latest' + run: | + brew install luarocks nasm ninja + luarocks install moonscript --dev + - name: Install dependencies (Linux) if: matrix.config.os == 'ubuntu-latest' run: sudo apt-get install ninja-build build-essential libx11-dev libwxgtk3.0-gtk3-dev libfreetype6-dev pkg-config libfontconfig1-dev libass-dev libasound2-dev libffms2-dev intltool libboost-all-dev @@ -71,6 +77,10 @@ jobs: # -Dfreetype2:png=enabled is a workaround for https://savannah.nongnu.org/bugs/?59458 run: meson build -Ddefault_library=static --force-fallback-for=zlib,harfbuzz -Dfreetype2:zlib=system -Dfreetype2:png=enabled -Dfreetype2:default_library=static -Dbuildtype=release + - name: Configure (MacOS) + if: matrix.config.os == 'macos-latest' + run: meson build -Ddefault_library=static + - name: Configure (Linux) if: matrix.config.os == 'ubuntu-latest' run: meson build From a77f7d48dfa0b387de9599c16594ed42ceddf1c6 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 9 Jan 2021 05:16:32 -0500 Subject: [PATCH 194/271] meson: update to reflect fixes in dependencies --- .github/workflows/ci.yml | 3 +-- README.md | 2 +- subprojects/freetype2.wrap | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e9652425..671e06116 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,8 +74,7 @@ jobs: - name: Configure (Windows) if: matrix.config.os == 'windows-latest' - # -Dfreetype2:png=enabled is a workaround for https://savannah.nongnu.org/bugs/?59458 - run: meson build -Ddefault_library=static --force-fallback-for=zlib,harfbuzz -Dfreetype2:zlib=system -Dfreetype2:png=enabled -Dfreetype2:default_library=static -Dbuildtype=release + run: meson build -Ddefault_library=static --force-fallback-for=zlib,harfbuzz -Dbuildtype=release - name: Configure (MacOS) if: matrix.config.os == 'macos-latest' diff --git a/README.md b/README.md index f009c4235..713382f1c 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ All other dependencies are either stored in the repository or are included as su Building: 1. Clone Aegisub's repository: `git clone https://github.com/TypesettingTools/Aegisub.git` -2. From the Visual Studio "x64 Native Tools Command Prompt", generate the build directory: `meson build -Ddefault_library=static -Dfreetype2:zlib=system -Dfreetype2:png=enabled -Dfreetype2:default_library=static` +2. From the Visual Studio "x64 Native Tools Command Prompt", generate the build directory: `meson build -Ddefault_library=static` 3. Build with `cd build` and `meson compile` You should now have a binary at `src/aegisub.exe`. diff --git a/subprojects/freetype2.wrap b/subprojects/freetype2.wrap index a86e85e54..d9903f108 100644 --- a/subprojects/freetype2.wrap +++ b/subprojects/freetype2.wrap @@ -5,3 +5,4 @@ revision = master [provide] freetype = freetype2_dep +freetype2 = freetype2_dep From 28bc329678d16a441ce425c44cc56b6077af2985 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 9 Jan 2021 22:50:59 -0500 Subject: [PATCH 195/271] actions: apt-get update on ubuntu --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 671e06116..44fbf0fc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,9 @@ jobs: - name: Install dependencies (Linux) if: matrix.config.os == 'ubuntu-latest' - run: sudo apt-get install ninja-build build-essential libx11-dev libwxgtk3.0-gtk3-dev libfreetype6-dev pkg-config libfontconfig1-dev libass-dev libasound2-dev libffms2-dev intltool libboost-all-dev + run: | + sudo apt-get update + sudo apt-get install ninja-build build-essential libx11-dev libwxgtk3.0-gtk3-dev libfreetype6-dev pkg-config libfontconfig1-dev libass-dev libasound2-dev libffms2-dev intltool libboost-all-dev - name: Configure (Windows) if: matrix.config.os == 'windows-latest' From 1a5c19c4d743aafc32ef2de1c4a0d594eac6b3c1 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 10 Jan 2021 00:01:47 -0500 Subject: [PATCH 196/271] actions: force LFS 1.8.0 on macOS --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44fbf0fc2..5a48f4638 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,6 +66,7 @@ jobs: if: matrix.config.os == 'macos-latest' run: | brew install luarocks nasm ninja + luarocks install luafilesystem 1.8.0 luarocks install moonscript --dev - name: Install dependencies (Linux) From 7f46b687e17d19a374fb371cfcc009245f9bd720 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 10 Jan 2021 01:03:45 -0500 Subject: [PATCH 197/271] meson: remove libass dirent patch Handled more properly in libass itself --- subprojects/libass.wrap | 1 - subprojects/packagefiles/libass/dirent.h | 6 ------ 2 files changed, 7 deletions(-) delete mode 100644 subprojects/packagefiles/libass/dirent.h diff --git a/subprojects/libass.wrap b/subprojects/libass.wrap index 326b3a87b..3e64a4ab2 100644 --- a/subprojects/libass.wrap +++ b/subprojects/libass.wrap @@ -2,4 +2,3 @@ directory = libass url = https://github.com/TypesettingTools/libass.git revision = meson-pr -patch_directory = libass diff --git a/subprojects/packagefiles/libass/dirent.h b/subprojects/packagefiles/libass/dirent.h deleted file mode 100644 index fcbd0289b..000000000 --- a/subprojects/packagefiles/libass/dirent.h +++ /dev/null @@ -1,6 +0,0 @@ -// libass uses dirent in a function we don't use, so just provide a dummy version -typedef struct DIR { int dummy; } DIR; -typedef struct dirent { char *d_name; } dirent; -static inline DIR *opendir(const char *x) { return 0; } -static inline struct dirent *readdir(DIR *x) { return 0; } -static inline void closedir(DIR *x) { } From 4b1d23e6be1d8d8a4e1722fe95cca9484339095e Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 10 Jan 2021 01:59:09 -0500 Subject: [PATCH 198/271] actions: add separate debug/release lanes No debug on Windows because the container isn't powerful enough --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a48f4638..ca6010a08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,11 @@ jobs: matrix: config: - { - name: Windows MSVC, + name: Windows MSVC Release, os: windows-latest, - msvc: true + msvc: true, + buildtype: release, + args: -Ddefault_library=static --force-fallback-for=zlib,harfbuzz } #- { # name: Windows MinGW, @@ -25,12 +27,28 @@ jobs: # msvc: false #} - { - name: "Ubuntu", - os: ubuntu-latest + name: Ubuntu Debug, + os: ubuntu-latest, + buildtype: debugoptimized, + args: "" } - { - name: "macOS", - os: macos-latest + name: Ubuntu Release, + os: ubuntu-latest, + buildtype: release, + args: "" + } + - { + name: macOS Debug, + os: macos-latest, + buildtype: debugoptimized, + args: -Ddefault_library=static + } + - { + name: macOS Release, + os: macos-latest, + buildtype: release, + args: -Ddefault_library=static } steps: @@ -75,17 +93,8 @@ jobs: sudo apt-get update sudo apt-get install ninja-build build-essential libx11-dev libwxgtk3.0-gtk3-dev libfreetype6-dev pkg-config libfontconfig1-dev libass-dev libasound2-dev libffms2-dev intltool libboost-all-dev - - name: Configure (Windows) - if: matrix.config.os == 'windows-latest' - run: meson build -Ddefault_library=static --force-fallback-for=zlib,harfbuzz -Dbuildtype=release - - - name: Configure (MacOS) - if: matrix.config.os == 'macos-latest' - run: meson build -Ddefault_library=static - - - name: Configure (Linux) - if: matrix.config.os == 'ubuntu-latest' - run: meson build + - name: Configure + run: meson build ${{ matrix.config.args }} -Dbuildtype=${{ matrix.config.buildtype }} - name: Build run: meson compile -C build From 2211b7a0a59f252e18eb708f2518b9a322a7a76e Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 10 Jan 2021 02:56:53 -0500 Subject: [PATCH 199/271] README: update for macOS with meson --- README.md | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 713382f1c..87c0c0258 100644 --- a/README.md +++ b/README.md @@ -45,43 +45,16 @@ You can generate the installer with `ninja win-installer` after a successful bui A vaguely recent version of Xcode and the corresponding command-line tools are required. -For personal usage, you can use homebrew to install almost all of Aegisub's dependencies: +For personal usage, you can use pip and homebrew to install almost all of Aegisub's dependencies: - brew install autoconf automake ffmpeg ffms2 fftw freetype fribidi gettext icu4c libass m4 pkg-config boost - brew install luajit --HEAD + brew install libass nasm ninja boost zlib icu4c pkg-config ffms2 fftw hunspell gettext cmake brew link --force gettext export LDFLAGS="-L/usr/local/opt/icu4c/lib" export CPPFLAGS="-I/usr/local/opt/icu4c/include" export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig" + pip install meson -wxWidgets is located in vendor/wxWidgets, and can be built like so: - - CPPFLAGS="$CPPFLAGS -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=1" \ - ./configure --disable-aboutdlg --disable-animatectrl --disable-aui --disable-any \ - --disable-bannerwindow --disable-base64 --disable-calendar --disable-caret \ - --disable-cmdline --disable-colourpicker --disable-compat28 --disable-config \ - --disable-constraints --disable-datepick --disable-dctransform --disable-debugreport \ - --disable-dialupman --disable-docview --disable-filehistory --disable-finddlg \ - --disable-fs_archive --disable-fs_inet --disable-fs_zip --disable-fsvolume \ - --disable-fswatcher --disable-gif --disable-help --disable-html --disable-ipc \ - --disable-joystick --disable-jpeg --disable-largefile --disable-markup --disable-mdi \ - --disable-mediactrl --disable-metafiles --disable-miniframe --disable-notifmsg \ - --disable-numberdlg --disable-pcx --disable-pnm --disable-postscript \ - --disable-prefseditor --disable-printarch --disable-progressdlg --disable-propgrid \ - --disable-protocol --disable-protocols --disable-rearrangectrl --disable-ribbon \ - --disable-richtext --disable-richtooltip --disable-snglinst --disable-sockets \ - --disable-sockets --disable-sound --disable-splash --disable-splines \ - --disable-std_iostreams --disable-svg --disable-tarstream --disable-tiff \ - --disable-tipdlg --disable-tipwindow --disable-url --disable-webkit --disable-webview \ - --disable-wizarddlg --disable-xrc \ - --enable-geometry --enable-imaglist --enable-listctrl --enable-stc --with-cocoa \ - --with-libpng=yes --with-macosx-version-min=10.9 \ - --with-opengl \ - --without-libjpeg --without-libtiff --without-regex \ - && make - -Once the dependencies are installed, build Aegisub with `autoreconf && ./configure --with-wxdir=/path/to/Aegisub/vendor/wxWidgets && make && make osx-bundle`. -`autoreconf` should be skipped if you are building from a source tarball rather than `git`. +Once the dependencies are installed, build Aegisub with `meson build && meson compile -C build`. ## Updating Moonscript From 417ba4ff2db712466c419e6ebb5648208393ec73 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 10 Jan 2021 03:09:34 -0500 Subject: [PATCH 200/271] actions: change branch to master --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca6010a08..1dd3fa87e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: Meson CI on: push: - branches: [ meson-vs2019 ] + branches: [ master ] pull_request: - branches: [ meson-vs2019 ] + branches: [ master ] jobs: build: From 25a62f4f122b78020ccca166c1222aab7da94033 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 16 Jan 2021 01:24:19 -0500 Subject: [PATCH 201/271] libass_gdi_fontselect: don't redefine NOMINMAX It's now defined in the build system itself --- src/libass_gdi_fontselect.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libass_gdi_fontselect.cpp b/src/libass_gdi_fontselect.cpp index 3623968e5..dcba736ef 100644 --- a/src/libass_gdi_fontselect.cpp +++ b/src/libass_gdi_fontselect.cpp @@ -23,7 +23,6 @@ extern "C" { #include #define WIN32_LEAN_AND_MEAN -#define NOMINMAX #include namespace { From a2da1616c0dc5f7823d61ff9ec0e75095260cd6d Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 16 Jan 2021 01:26:19 -0500 Subject: [PATCH 202/271] meson: set minimum win version to 7 I think setting it at 8 was accidental? This matches the installer, so we should be consistent throughout --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 043d9809e..29d449597 100644 --- a/meson.build +++ b/meson.build @@ -42,7 +42,7 @@ dataroot = datadir / 'aegisub' add_project_arguments('-DP_DATA="@0@"'.format(dataroot), language: 'cpp') if host_machine.system() == 'windows' - add_project_arguments('-DNOMINMAX', '-D_WIN32_WINNT=0x0602', language: 'cpp') + add_project_arguments('-DNOMINMAX', '-D_WIN32_WINNT=0x0601', language: 'cpp') endif # MSVC sets this automatically with -MDd, but it has a different meaning on other platforms From 308ef6cbb053c2cf37b321acf5c125fc05f6843a Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 16 Jan 2021 04:51:10 -0500 Subject: [PATCH 203/271] meson: promote dirent wrap --- .gitignore | 1 + subprojects/tronkko-dirent.wrap | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 subprojects/tronkko-dirent.wrap diff --git a/.gitignore b/.gitignore index 921303c29..f05385c6e 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ subprojects/packagecache subprojects/proxy-libintl* subprojects/wxWidgets subprojects/zlib-* +subprojects/dirent-* diff --git a/subprojects/tronkko-dirent.wrap b/subprojects/tronkko-dirent.wrap new file mode 100644 index 000000000..17abc0c19 --- /dev/null +++ b/subprojects/tronkko-dirent.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = dirent-1.23.2 + +source_url = https://github.com/tronkko/dirent/archive/1.23.2.tar.gz +source_filename = dirent-1.23.2.tar.gz +source_hash = f72d39e3c39610b6901e391b140aa69b51e0eb99216939ed5e547b5dad03afb1 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/tronkko-dirent/1.23.2/1/get_zip +patch_filename = tronkko-dirent-1.23.2-1-wrap.zip +patch_hash = 036957f6dee31d0b92f14cf3676d13baf44e9a1be950c248468440ffc40c78a4 From 6660594f648af5bec97d7dce515a49d92c70e6ba Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 16 Jan 2021 04:53:09 -0500 Subject: [PATCH 204/271] Update URLs to point at the main repo --- README.md | 2 +- packages/win_installer/fragment_setupbase.iss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 87c0c0258..bebe2ac57 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ For binaries and general information [see the homepage](http://www.aegisub.org). -The bug tracker can be found at https://github.com/TypesettingTools/Aegisub/issues. +The bug tracker can be found at https://github.com/Aegisub/Aegisub/issues. Support is available on [Discord](https://discord.com/invite/AZaVyPr) or [IRC](irc://irc.rizon.net/aegisub). diff --git a/packages/win_installer/fragment_setupbase.iss b/packages/win_installer/fragment_setupbase.iss index 1d4529587..a26c33889 100644 --- a/packages/win_installer/fragment_setupbase.iss +++ b/packages/win_installer/fragment_setupbase.iss @@ -12,7 +12,7 @@ AppVerName=Aegisub {#BUILD_GIT_VERSION_STRING} AppVersion={#INSTALLER_VERSION} AppPublisher=Aegisub Team AppPublisherURL=http://www.aegisub.org/ -AppSupportURL=https://github.com/TypesettingTools/Aegisub/issues +AppSupportURL=https://github.com/Aegsiub/Aegisub/issues AppCopyright=2005-{#CURRENT_YEAR} The Aegisub Team VersionInfoVersion={#INSTALLER_VERSION} DefaultGroupName=Aegisub From 8b8f4a39257d974ffcd91be59cc3f98cda97063f Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 16 Jan 2021 05:07:26 -0500 Subject: [PATCH 205/271] meson: bump minimum ffms2 version to 2.22 It's been out for 6 years, so this should be fairly safe. Also fix a build error that somehow snuck in during the merge --- meson.build | 2 +- src/video_provider_ffmpegsource.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 29d449597..5783379c8 100644 --- a/meson.build +++ b/meson.build @@ -174,7 +174,7 @@ foreach dep: [ ['portaudio-2.0', '', 'PortAudio', []], ['openal', '>=0.0.8', 'OpenAL', []], # video - ['ffms2', '', 'FFMS2', ['ffms2', 'ffms2_dep']], + ['ffms2', '>=2.22', 'FFMS2', ['ffms2', 'ffms2_dep']], # other ['fftw3', '', 'FFTW3', []], ['hunspell', '', 'Hunspell', []], # needs a proper port diff --git a/src/video_provider_ffmpegsource.cpp b/src/video_provider_ffmpegsource.cpp index 7340317b1..de3304576 100644 --- a/src/video_provider_ffmpegsource.cpp +++ b/src/video_provider_ffmpegsource.cpp @@ -267,7 +267,6 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st CS = Width > 1024 || Height >= 600 ? AGI_CS_BT709 : AGI_CS_BT470BG; RealColorSpace = ColorSpace = colormatrix_description(CS, CR); -#if FFMS_VERSION >= ((2 << 24) | (17 << 16) | (1 << 8) | 0) if (CS != AGI_CS_RGB && CS != AGI_CS_BT470BG && ColorSpace != colormatrix && colormatrix == "TV.601") { CS = AGI_CS_BT470BG; ColorSpace = colormatrix_description(AGI_CS_BT470BG, CR); From 1384123e2db34851b2e8b57708a97539901dd341 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 16 Jan 2021 05:16:55 -0500 Subject: [PATCH 206/271] iconv wrapper: allocate a smaller buffer on the stack --- libaegisub/common/charset_conv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libaegisub/common/charset_conv.cpp b/libaegisub/common/charset_conv.cpp index 498d360b4..47644eb1c 100644 --- a/libaegisub/common/charset_conv.cpp +++ b/libaegisub/common/charset_conv.cpp @@ -366,7 +366,7 @@ size_t IconvWrapper::RequiredBufferSize(std::string const& str) { } size_t IconvWrapper::RequiredBufferSize(const char* src, size_t srcLen) { - char buff[65536]; + char buff[4096]; size_t charsWritten = 0; size_t res; From 35b2ca5532c93779d6cfbcf07bdc904b09477037 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 16 Jan 2021 06:02:32 -0500 Subject: [PATCH 207/271] win_installer: fix paths for Avisynth+ dlls 3.7.0 changed the layout, so just match the new one --- packages/win_installer/fragment_codecs.iss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/win_installer/fragment_codecs.iss b/packages/win_installer/fragment_codecs.iss index 06e73b037..b9d55257a 100644 --- a/packages/win_installer/fragment_codecs.iss +++ b/packages/win_installer/fragment_codecs.iss @@ -1,7 +1,7 @@ [Files] ; Avisynth -DestDir: {app}; Source: {#DEPS_DIR}\AvisynthPlus64\x64\system\DevIL.dll; Flags: ignoreversion; Components: main -DestDir: {app}; Source: {#DEPS_DIR}\AvisynthPlus64\x64\AviSynth.dll; Flags: ignoreversion; Components: main -DestDir: {app}; Source: {#DEPS_DIR}\AvisynthPlus64\x64\plugins\DirectShowSource.dll; Flags: ignoreversion; Components: main +DestDir: {app}; Source: {#DEPS_DIR}\AvisynthPlus64\x86-64\DevIL.dll; Flags: ignoreversion; Components: main +DestDir: {app}; Source: {#DEPS_DIR}\AvisynthPlus64\x86-64\AviSynth.dll; Flags: ignoreversion; Components: main +DestDir: {app}; Source: {#DEPS_DIR}\AvisynthPlus64\x86-64\plugins\DirectShowSource.dll; Flags: ignoreversion; Components: main ; VSFilter DestDir: {app}\csri; Source: {#DEPS_DIR}\VSFilter\x64\VSFilter.dll; Flags: ignoreversion; Components: main From b42da504a0d30a66d82bd8603120745b6a993cc5 Mon Sep 17 00:00:00 2001 From: Myaamori <44215352+Myaamori@users.noreply.github.com> Date: Sat, 16 Jan 2021 11:13:37 +0000 Subject: [PATCH 208/271] Save unexpanded path in font collector (#79) Fixes #78 --- src/dialog_fonts_collector.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/dialog_fonts_collector.cpp b/src/dialog_fonts_collector.cpp index 3c849c987..bc97c152d 100644 --- a/src/dialog_fonts_collector.cpp +++ b/src/dialog_fonts_collector.cpp @@ -243,7 +243,7 @@ DialogFontsCollector::DialogFontsCollector(agi::Context *c) wxStaticBoxSizer *destination_box = new wxStaticBoxSizer(wxVERTICAL, this, _("Destination")); dest_label = new wxStaticText(this, -1, " "); - dest_ctrl = new wxTextCtrl(this, -1, c->path->Decode(OPT_GET("Path/Fonts Collector Destination")->GetString()).wstring()); + dest_ctrl = new wxTextCtrl(this, -1, to_wx(OPT_GET("Path/Fonts Collector Destination")->GetString())); dest_browse_button = new wxButton(this, -1, _("&Browse...")); wxSizer *dest_browse_sizer = new wxBoxSizer(wxHORIZONTAL); @@ -294,29 +294,29 @@ void DialogFontsCollector::OnStart(wxCommandEvent &) { collection_log->ClearAll(); collection_log->SetReadOnly(true); - agi::fs::path dest; + agi::fs::path dest_path; if (mode != FcMode::CheckFontsOnly) { - dest = path.Decode(mode == FcMode::CopyToScriptFolder ? "?script/" : from_wx(dest_ctrl->GetValue())); + auto dest = mode == FcMode::CopyToScriptFolder ? "?script/" : from_wx(dest_ctrl->GetValue()); + dest_path = path.Decode(dest); if (mode != FcMode::CopyToZip) { - if (agi::fs::FileExists(dest)) + if (agi::fs::FileExists(dest_path)) wxMessageBox(_("Invalid destination."), _("Error"), wxOK | wxICON_ERROR | wxCENTER, this); try { - agi::fs::CreateDirectory(dest); + agi::fs::CreateDirectory(dest_path); } catch (agi::Exception const&) { wxMessageBox(_("Could not create destination folder."), _("Error"), wxOK | wxICON_ERROR | wxCENTER, this); return; } } - else if (agi::fs::DirectoryExists(dest) || dest.filename().empty()) { + else if (agi::fs::DirectoryExists(dest_path) || dest_path.filename().empty()) { wxMessageBox(_("Invalid path for .zip file."), _("Error"), wxOK | wxICON_ERROR | wxCENTER, this); return; } - } - if (mode != FcMode::CheckFontsOnly) - OPT_SET("Path/Fonts Collector Destination")->SetString(dest.string()); + OPT_SET("Path/Fonts Collector Destination")->SetString(dest); + } // Disable the UI while it runs as we don't support canceling EnableCloseButton(false); @@ -327,7 +327,7 @@ void DialogFontsCollector::OnStart(wxCommandEvent &) { collection_mode->Enable(false); dest_label->Enable(false); - FontsCollectorThread(subs, dest, mode, GetEventHandler()); + FontsCollectorThread(subs, dest_path, mode, GetEventHandler()); } void DialogFontsCollector::OnBrowse(wxCommandEvent &) { From b8d1864a077fbff5bbed32f3763ce6b8e69ce0d2 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 16 Jan 2021 13:01:51 -0500 Subject: [PATCH 209/271] aegisub: ifdef wxBitmap constructor to scale on MacOS only Quick fix to unblock the build; need better HiDPI handling across the board --- meson.build | 1 + src/libresrc/libresrc.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/meson.build b/meson.build index 5783379c8..7c0e27331 100644 --- a/meson.build +++ b/meson.build @@ -131,6 +131,7 @@ else '-DwxBUILD_SHARED=@0@'.format(build_shared), '-DwxUSE_WEBVIEW=OFF', # breaks build on linux '-DCMAKE_BUILD_TYPE=@0@'.format(build_type), + '-DwxUSE_IMAGE=ON', '-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson deps += [ wx.dependency('wxmono'), diff --git a/src/libresrc/libresrc.cpp b/src/libresrc/libresrc.cpp index 79dc0f16c..bc0cda22f 100644 --- a/src/libresrc/libresrc.cpp +++ b/src/libresrc/libresrc.cpp @@ -23,8 +23,13 @@ wxBitmap libresrc_getimage(const unsigned char *buff, size_t size, double scale, int dir) { wxMemoryInputStream mem(buff, size); if (dir != wxLayout_RightToLeft) +#ifdef __WXMAC__ return wxBitmap(wxImage(mem), -1, scale); return wxBitmap(wxImage(mem).Mirror(), -1, scale); +#else + return wxBitmap(wxImage(mem)); + return wxBitmap(wxImage(mem).Mirror()); +#endif } wxIcon libresrc_geticon(const unsigned char *buff, size_t size) { From bec44eaab82c1bb4c3c5d9cb06fbbf3934155711 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 16 Jan 2021 13:15:05 -0500 Subject: [PATCH 210/271] meson: define P_LOCALE --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 7c0e27331..41879a456 100644 --- a/meson.build +++ b/meson.build @@ -39,7 +39,7 @@ else endif docdir = prefix / 'doc' dataroot = datadir / 'aegisub' -add_project_arguments('-DP_DATA="@0@"'.format(dataroot), language: 'cpp') +add_project_arguments('-DP_DATA="@0@"'.format(dataroot), '-DP_LOCALE="@0@"'.format(localedir), language: 'cpp') if host_machine.system() == 'windows' add_project_arguments('-DNOMINMAX', '-D_WIN32_WINNT=0x0601', language: 'cpp') From 1981f4db3e84d70bd7b9fe83b7eb3b2ed3a2da84 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 17 Jan 2021 09:30:26 -0500 Subject: [PATCH 211/271] win_installer: fix vc redist name in run section to match source --- packages/win_installer/fragment_runtimes.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/win_installer/fragment_runtimes.iss b/packages/win_installer/fragment_runtimes.iss index ae71daf74..c7c69762f 100644 --- a/packages/win_installer/fragment_runtimes.iss +++ b/packages/win_installer/fragment_runtimes.iss @@ -4,4 +4,4 @@ DestDir: {tmp}; Source: "{#DEPS_DIR}\VC_redist\VC_redist.x{#ARCH}.exe"; Flags: nocompression deleteafterinstall [Run] -Filename: {tmp}\vcredist_{#ARCH}.exe; StatusMsg: {cm:InstallRuntime}; Parameters: "/install /quiet /norestart" +Filename: {tmp}\VC_redist.x{#ARCH}.exe; StatusMsg: {cm:InstallRuntime}; Parameters: "/install /quiet /norestart" From 73c54cef99729fd97808d2fe777c87ea91864279 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 17 Jan 2021 09:53:01 -0500 Subject: [PATCH 212/271] win_installer: use plain aegisub.exe everywhere --- .../win_installer/fragment_associations.iss | 122 +++++++++--------- .../win_installer/fragment_mainprogram.iss | 8 +- packages/win_installer/fragment_setupbase.iss | 2 +- 3 files changed, 66 insertions(+), 66 deletions(-) diff --git a/packages/win_installer/fragment_associations.iss b/packages/win_installer/fragment_associations.iss index 15567fb61..c766011da 100644 --- a/packages/win_installer/fragment_associations.iss +++ b/packages/win_installer/fragment_associations.iss @@ -4,120 +4,120 @@ DestDir: {commontemplates}; Source: template.ass; DestName: Aegisub.ass [Registry] ; File type registration ; Application registration for Open With dialogue -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe"; ValueType: string; ValueName: "FriendlyAppName"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10000"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe"; ValueType: string; ValueName: "ApplicationCompany"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\shell"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; SubKey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\shell\open"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\shell\open"; ValueType: string; ValueName: "FriendlyAppName"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10000"; Flags: uninsdeletekey -Root: HKLM; SubKey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub{#ARCH}.exe"" ""%1"""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".ass"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".ssa"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".srt"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".sub"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".ttxt"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".txt"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".mkv"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".mka"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".mks"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".avi"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".mp3"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".mp4"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".aac"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".m4a"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".wav"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".ogg"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".avs"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".opus"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".h264"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".hevc"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".eac3"; ValueData: ""; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub{#ARCH}.exe\SupportedTypes"; ValueType: string; ValueName: ".webm"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe"; ValueType: none; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe"; ValueType: string; ValueName: "FriendlyAppName"; ValueData: "@{app}\aegisub.exe,-10000"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe"; ValueType: string; ValueName: "ApplicationCompany"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\shell"; ValueType: none; Flags: uninsdeletekey +Root: HKLM; SubKey: "SOFTWARE\Classes\Applications\aegisub.exe\shell\open"; ValueType: none; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\shell\open"; ValueType: string; ValueName: "FriendlyAppName"; ValueData: "@{app}\aegisub.exe,-10000"; Flags: uninsdeletekey +Root: HKLM; SubKey: "SOFTWARE\Classes\Applications\aegisub.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub.exe"" ""%1"""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: none; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".ass"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".ssa"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".srt"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".sub"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".ttxt"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".txt"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".mkv"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".mka"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".mks"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".avi"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".mp3"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".mp4"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".aac"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".m4a"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".wav"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".ogg"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".avs"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".opus"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".h264"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".hevc"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".eac3"; ValueData: ""; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Applications\aegisub.exe\SupportedTypes"; ValueType: string; ValueName: ".webm"; ValueData: ""; Flags: uninsdeletekey ; Class for general subtitle formats Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Subtitle.1"; ValueType: string; ValueName: ""; ValueData: "Aegisub subtitle file"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Subtitle.1"; ValueType: dword; ValueName: "EditFlags"; ValueData: $af0; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Subtitle.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10101"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Subtitle.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub{#ARCH}.exe,0"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Subtitle.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub.exe,-10101"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Subtitle.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub.exe,0"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Subtitle.1\shell"; ValueType: string; ValueName: ""; ValueData: "open"; Flags: uninsdeletekey Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.Subtitle.1\shell\open"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.Subtitle.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub{#ARCH}.exe"" ""%L"""; Flags: uninsdeletekey +Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.Subtitle.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub.exe"" ""%L"""; Flags: uninsdeletekey ; Class for .ass files Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.ASSA.1"; ValueType: string; ValueName: ""; ValueData: "Aegisub Advanced SSA subtitles"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.ASSA.1"; ValueType: dword; ValueName: "EditFlags"; ValueData: $af0; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.ASSA.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10102"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.ASSA.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub{#ARCH}.exe,0"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.ASSA.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub.exe,-10102"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.ASSA.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub.exe,0"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.ASSA.1\shell"; ValueType: string; ValueName: ""; ValueData: "open"; Flags: uninsdeletekey Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.ASSA.1\shell\open"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.ASSA.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub{#ARCH}.exe"" ""%L"""; Flags: uninsdeletekey +Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.ASSA.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub.exe"" ""%L"""; Flags: uninsdeletekey ; Class for .ssa files Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SSA.1"; ValueType: string; ValueName: ""; ValueData: "Aegisub SubStation Alpha subtitles"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SSA.1"; ValueType: dword; ValueName: "EditFlags"; ValueData: $af0; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SSA.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10103"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SSA.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub{#ARCH}.exe,0"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SSA.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub.exe,-10103"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SSA.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub.exe,0"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SSA.1\shell"; ValueType: string; ValueName: ""; ValueData: "open"; Flags: uninsdeletekey Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.SSA.1\shell\open"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.SSA.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub{#ARCH}.exe"" ""%L"""; Flags: uninsdeletekey +Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.SSA.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub.exe"" ""%L"""; Flags: uninsdeletekey ; Class for .srt files Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SRT.1"; ValueType: string; ValueName: ""; ValueData: "Aegisub SubRip text subtitles"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SRT.1"; ValueType: dword; ValueName: "EditFlags"; ValueData: $af0; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SRT.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10104"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SRT.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub{#ARCH}.exe,0"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SRT.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub.exe,-10104"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SRT.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub.exe,0"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.SRT.1\shell"; ValueType: string; ValueName: ""; ValueData: "open"; Flags: uninsdeletekey Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.SRT.1\shell\open"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.SRT.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub{#ARCH}.exe"" ""%L"""; Flags: uninsdeletekey +Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.SRT.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub.exe"" ""%L"""; Flags: uninsdeletekey ; Class for .ttxt files Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TTXT.1"; ValueType: string; ValueName: ""; ValueData: "Aegisub MPEG-4 timed text"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TTXT.1"; ValueType: dword; ValueName: "EditFlags"; ValueData: $af0; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TTXT.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10105"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TTXT.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub{#ARCH}.exe,0"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TTXT.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub.exe,-10105"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TTXT.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub.exe,0"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TTXT.1\shell"; ValueType: string; ValueName: ""; ValueData: "open"; Flags: uninsdeletekey Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.TTXT.1\shell\open"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.TTXT.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub{#ARCH}.exe"" ""%L"""; Flags: uninsdeletekey +Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.TTXT.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub.exe"" ""%L"""; Flags: uninsdeletekey ; Class for .mks files Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.MKS.1"; ValueType: string; ValueName: ""; ValueData: "Aegisub Matroska subtitles"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.MKS.1"; ValueType: dword; ValueName: "EditFlags"; ValueData: $af0; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.MKS.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10106"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.MKS.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub{#ARCH}.exe,0"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.MKS.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub.exe,-10106"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.MKS.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub.exe,0"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.MKS.1\shell"; ValueType: string; ValueName: ""; ValueData: "open"; Flags: uninsdeletekey Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.MKS.1\shell\open"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.MKS.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub{#ARCH}.exe"" ""%L"""; Flags: uninsdeletekey +Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.MKS.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub.exe"" ""%L"""; Flags: uninsdeletekey ; Class for .txt files Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TXT.1"; ValueType: string; ValueName: ""; ValueData: "Aegisub raw text file"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TXT.1"; ValueType: dword; ValueName: "EditFlags"; ValueData: $af0; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TXT.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10107"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TXT.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub{#ARCH}.exe,0"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TXT.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub.exe,-10107"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TXT.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub.exe,0"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.TXT.1\shell"; ValueType: string; ValueName: ""; ValueData: "open"; Flags: uninsdeletekey Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.TXT.1\shell\open"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.TXT.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub{#ARCH}.exe"" ""%L"""; Flags: uninsdeletekey +Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.TXT.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub.exe"" ""%L"""; Flags: uninsdeletekey ; Class for undecideable media file types Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Media.1"; ValueType: string; ValueName: ""; ValueData: "Aegisub media file"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Media.1"; ValueType: dword; ValueName: "EditFlags"; ValueData: $af0; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Media.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10108"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Media.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub{#ARCH}.exe,0"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Media.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub.exe,-10108"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Media.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub.exe,0"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Media.1\shell"; ValueType: string; ValueName: ""; ValueData: "open"; Flags: uninsdeletekey Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.Media.1\shell\open"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.Media.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub{#ARCH}.exe"" ""%L"""; Flags: uninsdeletekey +Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.Media.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub.exe"" ""%L"""; Flags: uninsdeletekey ; Class for audio file types Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Audio.1"; ValueType: string; ValueName: ""; ValueData: "Aegisub audio file"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Audio.1"; ValueType: dword; ValueName: "EditFlags"; ValueData: $af0; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Audio.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10109"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Audio.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub{#ARCH}.exe,0"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Audio.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub.exe,-10109"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Audio.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub.exe,0"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Audio.1\shell"; ValueType: string; ValueName: ""; ValueData: "open"; Flags: uninsdeletekey Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.Audio.1\shell\open"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.Audio.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub{#ARCH}.exe"" ""%L"""; Flags: uninsdeletekey +Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.Audio.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub.exe"" ""%L"""; Flags: uninsdeletekey ; Class for video file types Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Video.1"; ValueType: string; ValueName: ""; ValueData: "Aegisub video file"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Video.1"; ValueType: dword; ValueName: "EditFlags"; ValueData: $af0; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Video.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10110"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Video.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub{#ARCH}.exe,0"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Video.1"; ValueType: string; ValueName: "FriendlyTypeName"; ValueData: "@{app}\aegisub.exe,-10110"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Video.1\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub.exe,0"; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Classes\Aegisub.Video.1\shell"; ValueType: string; ValueName: ""; ValueData: "open"; Flags: uninsdeletekey Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.Video.1\shell\open"; ValueType: none; Flags: uninsdeletekey -Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.Video.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub{#ARCH}.exe"" ""%L"""; Flags: uninsdeletekey +Root: HKLM; SubKey: "SOFTWARE\Classes\Aegisub.Video.1\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\aegisub.exe"" ""%L"""; Flags: uninsdeletekey ; Default Programs registration Root: HKLM; Subkey: "SOFTWARE\Aegisub"; ValueType: none; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Aegisub\Capabilities"; ValueType: none -Root: HKLM; Subkey: "SOFTWARE\Aegisub\Capabilities"; ValueType: string; ValueName: "ApplicationDescription"; ValueData: "@{app}\aegisub{#ARCH}.exe,-10001" +Root: HKLM; Subkey: "SOFTWARE\Aegisub\Capabilities"; ValueType: string; ValueName: "ApplicationDescription"; ValueData: "@{app}\aegisub.exe,-10001" Root: HKLM; Subkey: "SOFTWARE\Aegisub\Capabilities\FileAssociations"; ValueType: none Root: HKLM; Subkey: "SOFTWARE\Aegisub\Capabilities\FileAssociations"; ValueType: string; ValueName: ".ass"; ValueData: "Aegisub.ASSA.1" Root: HKLM; Subkey: "SOFTWARE\Aegisub\Capabilities\FileAssociations"; ValueType: string; ValueName: ".ssa"; ValueData: "Aegisub.SSA.1" diff --git a/packages/win_installer/fragment_mainprogram.iss b/packages/win_installer/fragment_mainprogram.iss index 003efde7d..87615ec01 100644 --- a/packages/win_installer/fragment_mainprogram.iss +++ b/packages/win_installer/fragment_mainprogram.iss @@ -23,15 +23,15 @@ DestDir: {app}; Source: "{#BUILD_ROOT}\src\aegisub.exe"; Flags: ignoreversion; C DestDir: {app}; Source: "{#INSTALLER_DIR}\license.txt"; Flags: ignoreversion; Components: main [Icons] -Name: {commonprograms}\Aegisub; Filename: {app}\aegisub{#ARCH}.exe; WorkingDir: {app}; IconIndex: 0; Tasks: startmenuicon; Comment: Create and edit subtitle files +Name: {commonprograms}\Aegisub; Filename: {app}\aegisub.exe; WorkingDir: {app}; IconIndex: 0; Tasks: startmenuicon; Comment: Create and edit subtitle files [Registry] ; Register in App Paths so the user can conveniently enter 'aegisub' in their Run box -Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\aegisub{#ARCH}.exe"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub{#ARCH}.exe"; Flags: uninsdeletekey -Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\aegisub.exe"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub{#ARCH}.exe"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\aegisub.exe"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub.exe"; Flags: uninsdeletekey +Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\aegisub.exe"; ValueType: string; ValueName: ""; ValueData: "{app}\aegisub.exe"; Flags: uninsdeletekey [Run] -Filename: {app}\aegisub{#ARCH}.exe; Description: {cm:LaunchProgram,Aegisub}; Flags: nowait postinstall skipifsilent +Filename: {app}\aegisub.exe; Description: {cm:LaunchProgram,Aegisub}; Flags: nowait postinstall skipifsilent [InstallDelete] Type: files; Name: "{app}\ffms2_64.dll" diff --git a/packages/win_installer/fragment_setupbase.iss b/packages/win_installer/fragment_setupbase.iss index a26c33889..8092bd4e5 100644 --- a/packages/win_installer/fragment_setupbase.iss +++ b/packages/win_installer/fragment_setupbase.iss @@ -29,7 +29,7 @@ UsePreviousSetupType=no UsePreviousAppDir=yes UsePreviousTasks=no UsedUserAreasWarning=no -UninstallDisplayIcon={app}\aegisub{#ARCH}.exe +UninstallDisplayIcon={app}\aegisub.exe ; Default to a large welcome bitmap, suitable for large fonts ; The normal fonts version is selected by code below WizardImageFile={#INSTALLER_DIR}\welcome-large.bmp From 8acc8be2babfe1ce2dc46eb7b15f559ad8f5edd1 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 17 Jan 2021 09:53:19 -0500 Subject: [PATCH 213/271] win_installer: checkout DepCtrl 0.6.3 --- tools/win-installer-setup.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/win-installer-setup.ps1 b/tools/win-installer-setup.ps1 index 42ee0cc42..c9a669568 100644 --- a/tools/win-installer-setup.ps1 +++ b/tools/win-installer-setup.ps1 @@ -21,6 +21,8 @@ Set-Location $DepsDir # DepCtrl if (!(Test-Path DependencyControl)) { git clone https://github.com/TypesettingTools/DependencyControl.git + Set-Location DependencyControl + git checkout v0.6.3-alpha } # YUtils From 7640576cc94b5bef431a5af6476baf0b73c7dcb5 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 21 Jan 2021 04:56:47 -0500 Subject: [PATCH 214/271] meson: use conf object for defines where appropriate --- meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 41879a456..c96d5a63b 100644 --- a/meson.build +++ b/meson.build @@ -39,7 +39,6 @@ else endif docdir = prefix / 'doc' dataroot = datadir / 'aegisub' -add_project_arguments('-DP_DATA="@0@"'.format(dataroot), '-DP_LOCALE="@0@"'.format(localedir), language: 'cpp') if host_machine.system() == 'windows' add_project_arguments('-DNOMINMAX', '-D_WIN32_WINNT=0x0601', language: 'cpp') @@ -52,6 +51,7 @@ endif conf = configuration_data() conf.set_quoted('P_DATA', dataroot) +conf.set_quoted('P_LOCALE', localedir) if get_option('credit') != '' conf.set_quoted('BUILD_CREDIT', get_option('credit')) endif @@ -60,7 +60,6 @@ conf.set('WITH_UPDATE_CHECKER', get_option('enable_update_checker')) deps = [] deps_inc = [] -conf.set('WITH_FONTCONFIG', '0') if host_machine.system() == 'darwin' add_languages('objc', 'objcpp') add_project_arguments('-DGL_SILENCE_DEPRECATION', language: 'cpp') From 8d8ea166df71e148a54a5a396c2faa44ec87779c Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 21 Jan 2021 06:02:19 -0500 Subject: [PATCH 215/271] lua: remove usage of luaL_reg in favor of luaL_Reg The former was deprecated with 5.1, and removed entirely in later versions and in LuaJIT --- libaegisub/lua/modules/lpeg.c | 4 ++-- subprojects/luabins/include/.keepme | 0 subprojects/luabins/lib/.keepme | 0 subprojects/luabins/obj/.keepme | 0 subprojects/luabins/src/luabins.c | 2 +- subprojects/luabins/tmp/.keepme | 0 6 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 subprojects/luabins/include/.keepme delete mode 100644 subprojects/luabins/lib/.keepme delete mode 100644 subprojects/luabins/obj/.keepme delete mode 100644 subprojects/luabins/tmp/.keepme diff --git a/libaegisub/lua/modules/lpeg.c b/libaegisub/lua/modules/lpeg.c index 8d67335ab..5261c2061 100644 --- a/libaegisub/lua/modules/lpeg.c +++ b/libaegisub/lua/modules/lpeg.c @@ -2334,7 +2334,7 @@ static int matchl (lua_State *L) { } -static struct luaL_reg pattreg[] = { +static struct luaL_Reg pattreg[] = { {"match", matchl}, {"print", printpat_l}, {"locale", locale_l}, @@ -2360,7 +2360,7 @@ static struct luaL_reg pattreg[] = { }; -static struct luaL_reg metapattreg[] = { +static struct luaL_Reg metapattreg[] = { {"__add", union_l}, {"__pow", star_l}, {"__sub", diff_l}, diff --git a/subprojects/luabins/include/.keepme b/subprojects/luabins/include/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/subprojects/luabins/lib/.keepme b/subprojects/luabins/lib/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/subprojects/luabins/obj/.keepme b/subprojects/luabins/obj/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/subprojects/luabins/src/luabins.c b/subprojects/luabins/src/luabins.c index 60668213f..35b177629 100644 --- a/subprojects/luabins/src/luabins.c +++ b/subprojects/luabins/src/luabins.c @@ -54,7 +54,7 @@ static int l_load(lua_State * L) } /* luabins Lua module API */ -static const struct luaL_reg R[] = +static const struct luaL_Reg R[] = { { "save", l_save }, { "load", l_load }, diff --git a/subprojects/luabins/tmp/.keepme b/subprojects/luabins/tmp/.keepme deleted file mode 100644 index e69de29bb..000000000 From f3958288acb5b4ff439287cbb4c3e5d0c60a6725 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 30 Jan 2021 07:29:45 -0500 Subject: [PATCH 216/271] libresrc: put new wxBitmap constructor behind wx version check Based off https://github.com/Aegisub/Aegisub/pull/175 --- src/libresrc/libresrc.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libresrc/libresrc.cpp b/src/libresrc/libresrc.cpp index bc0cda22f..f42bf0e05 100644 --- a/src/libresrc/libresrc.cpp +++ b/src/libresrc/libresrc.cpp @@ -23,9 +23,11 @@ wxBitmap libresrc_getimage(const unsigned char *buff, size_t size, double scale, int dir) { wxMemoryInputStream mem(buff, size); if (dir != wxLayout_RightToLeft) -#ifdef __WXMAC__ - return wxBitmap(wxImage(mem), -1, scale); - return wxBitmap(wxImage(mem).Mirror(), -1, scale); +#if wxCHECK_VERSION(3, 1, 0) + // Since wxWidgets 3.1.0, there is an undocumented third parameter in the ctor of wxBitmap from wxImage + // This "scale" parameter sets the logical scale factor of the created wxBitmap + return wxBitmap(wxImage(mem), wxBITMAP_SCREEN_DEPTH, scale); + return wxBitmap(wxImage(mem).Mirror(), wxBITMAP_SCREEN_DEPTH, scale); #else return wxBitmap(wxImage(mem)); return wxBitmap(wxImage(mem).Mirror()); From d8c348e89764ee7612854662f42e03bca17ef3ae Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 30 Jan 2021 08:56:01 -0500 Subject: [PATCH 217/271] meson: standardized config defines to set integer 1 --- meson.build | 8 ++++---- src/meson.build | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index c96d5a63b..b3849b78c 100644 --- a/meson.build +++ b/meson.build @@ -66,7 +66,7 @@ if host_machine.system() == 'darwin' # meson neither supports objcpp_std nor inherits cpp_std https://github.com/mesonbuild/meson/issues/5495 add_project_arguments('-std=c++11', language: 'objcpp') elif host_machine.system() != 'windows' - conf.set('WITH_FONTCONFIG', '1') + conf.set('WITH_FONTCONFIG', 1) deps += dependency('fontconfig') endif @@ -100,7 +100,7 @@ endif deps += boost_dep if host_machine.system() == 'windows' - conf.set('BOOST_USE_WINDOWS_H', '1') + conf.set('BOOST_USE_WINDOWS_H', 1) endif deps += dependency('zlib') @@ -195,7 +195,7 @@ foreach dep: [ optname = dep[0].split('-')[0] if d.found() and not get_option(optname).disabled() deps += d - conf.set('WITH_@0@'.format(dep[0].split('-')[0].to_upper()), '1') + conf.set('WITH_@0@'.format(dep[0].split('-')[0].to_upper()), 1) dep_avail += dep[2] elif get_option(optname).enabled() error('@0@ enabled but not found'.format(dep[2])) @@ -218,7 +218,7 @@ if host_machine.system() == 'windows' and not get_option('directsound').disabled dxguid_dep = cc.find_library('dxguid', required: true) if dsound_dep.found() and winmm_dep.found() and ole32_dep.found() and dxguid_dep.found() and have_dsound_h deps += [dsound_dep, winmm_dep, ole32_dep, dxguid_dep] - conf.set('WITH_DIRECTSOUND', '1') + conf.set('WITH_DIRECTSOUND', 1) dep_avail += 'DirectSound' endif endif diff --git a/src/meson.build b/src/meson.build index 13570c139..8498cdbe6 100644 --- a/src/meson.build +++ b/src/meson.build @@ -214,7 +214,9 @@ elif host_machine.system() == 'windows' depends: version_h, include_directories: [res_inc, version_inc, wx_inc]) endif -elif conf.get('WITH_FONTCONFIG') == '1' +endif + +if conf.has('WITH_FONTCONFIG') aegisub_src += 'font_file_lister_fontconfig.cpp' endif From 7d9feca5785702b04b50cc0ce1a1f8069d702fde Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 30 Jan 2021 08:57:39 -0500 Subject: [PATCH 218/271] meson: add CSRI support --- meson.build | 11 ++++++++++- meson_options.txt | 1 + src/meson.build | 4 ++++ subprojects/csri/meson.build | 20 ++++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 subprojects/csri/meson.build diff --git a/meson.build b/meson.build index b3849b78c..bd27bf4f1 100644 --- a/meson.build +++ b/meson.build @@ -42,6 +42,10 @@ dataroot = datadir / 'aegisub' if host_machine.system() == 'windows' add_project_arguments('-DNOMINMAX', '-D_WIN32_WINNT=0x0601', language: 'cpp') + + if not get_option('csri').disabled() + add_global_arguments('-DCSRI_NO_EXPORT', language: 'c') + endif endif # MSVC sets this automatically with -MDd, but it has a different meaning on other platforms @@ -300,7 +304,12 @@ endif deps += dep_gl -# TODO: csri +if not get_option('csri').disabled() + conf.set('WITH_CSRI', 1) + + csri_sp = subproject('csri') + deps += csri_sp.get_variable('csri_dep') +endif acconf = configure_file(output: 'acconf.h', configuration: conf) diff --git a/meson_options.txt b/meson_options.txt index 20bac21ae..5212635fb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -11,6 +11,7 @@ option('avisynth', type: 'feature', description: 'AviSynth video source') option('fftw3', type: 'feature', description: 'FFTW3 support') option('hunspell', type: 'feature', description: 'Hunspell spell checker') option('uchardet', type: 'feature', description: 'uchardet character encoding detection') +option('csri', type: 'feature', description: 'CSRI support') option('system_luajit', type: 'boolean', value: false, description: 'Force using system luajit') option('local_boost', type: 'boolean', value: false, description: 'Force using locally compiled Boost') diff --git a/src/meson.build b/src/meson.build index 8498cdbe6..1c643ea09 100644 --- a/src/meson.build +++ b/src/meson.build @@ -220,6 +220,10 @@ if conf.has('WITH_FONTCONFIG') aegisub_src += 'font_file_lister_fontconfig.cpp' endif +if conf.has('WITH_CSRI') + aegisub_src += 'subtitles_provider_csri.cpp' +endif + opt_src = [ ['ALSA', 'audio_player_alsa.cpp'], ['PortAudio', 'audio_player_portaudio.cpp'], diff --git a/subprojects/csri/meson.build b/subprojects/csri/meson.build new file mode 100644 index 000000000..f5d338843 --- /dev/null +++ b/subprojects/csri/meson.build @@ -0,0 +1,20 @@ +project('csri', 'c') + +csri_sources = [ + 'lib/list.c', + 'lib/wrap.c', + 'subhelp/logging.c', +] + +csri_inc = [include_directories('include')] + +if host_machine.system() == 'windows' + csri_inc += include_directories('lib/win32') + csri_sources += ['lib/win32/enumerate.c', 'subhelp/win32/openfile.c'] +else + csri_inc += include_directories('lib/posix') + csri_sources += ['lib/posix/enumerate.c', 'subhelp/posix/openfile.c'] +endif + +csri = library('csri', csri_sources, include_directories: csri_inc) +csri_dep = declare_dependency(link_with: csri, include_directories: csri_inc) From 1ac52a24d61ad49747a6bdbe82c0f699c93b6fe0 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 30 Jan 2021 08:58:45 -0500 Subject: [PATCH 219/271] meson: disable gdi_fontselect for now This one continues to be controversial, so for now the plan will be to report issues upstream that come up as a result of this being removed --- src/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index 1c643ea09..4a601f41a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -173,7 +173,7 @@ elif host_machine.system() == 'windows' aegisub_src += [ 'avisynth_wrap.cpp', 'font_file_lister_gdi.cpp', - 'libass_gdi_fontselect.cpp', + # 'libass_gdi_fontselect.cpp', 'video_provider_avs.cpp', ] From e186fa4627327de17e9069e00fc354c430cd725d Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 30 Jan 2021 09:04:22 -0500 Subject: [PATCH 220/271] meson: disable CSRI on non-windows for now --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index bd27bf4f1..7b8ecb7ab 100644 --- a/meson.build +++ b/meson.build @@ -304,7 +304,7 @@ endif deps += dep_gl -if not get_option('csri').disabled() +if not get_option('csri').disabled() and host_machine.system() == 'windows' conf.set('WITH_CSRI', 1) csri_sp = subproject('csri') From 2cb759a6e22cacbab4979e847546dbc239babbf2 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 30 Jan 2021 09:11:34 -0500 Subject: [PATCH 221/271] win_installer: set directory correctly after DepCtrl checkout --- tools/win-installer-setup.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/win-installer-setup.ps1 b/tools/win-installer-setup.ps1 index c9a669568..61fc5bbc9 100644 --- a/tools/win-installer-setup.ps1 +++ b/tools/win-installer-setup.ps1 @@ -23,6 +23,7 @@ if (!(Test-Path DependencyControl)) { git clone https://github.com/TypesettingTools/DependencyControl.git Set-Location DependencyControl git checkout v0.6.3-alpha + Set-Location $DepsDir } # YUtils From 73ad926880e5b47a3240d39f8f7bc934951b53ff Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 30 Jan 2021 09:12:13 -0500 Subject: [PATCH 222/271] meson: define CSRI_NO_EXPORT earlier in setup --- meson.build | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 7b8ecb7ab..303266dc3 100644 --- a/meson.build +++ b/meson.build @@ -12,6 +12,12 @@ if host_machine.system() == 'windows' nasm = subproject('nasm').get_variable('nasm') meson.override_find_program('nasm', nasm) endif + + add_project_arguments('-DNOMINMAX', '-D_WIN32_WINNT=0x0601', language: 'cpp') + + if not get_option('csri').disabled() + add_global_arguments('-DCSRI_NO_EXPORT', language: 'c') + endif endif if host_machine.system() == 'windows' @@ -41,11 +47,7 @@ docdir = prefix / 'doc' dataroot = datadir / 'aegisub' if host_machine.system() == 'windows' - add_project_arguments('-DNOMINMAX', '-D_WIN32_WINNT=0x0601', language: 'cpp') - if not get_option('csri').disabled() - add_global_arguments('-DCSRI_NO_EXPORT', language: 'c') - endif endif # MSVC sets this automatically with -MDd, but it has a different meaning on other platforms From 36b75b827d31293302c565f089088c0a5fec6c7c Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 30 Jan 2021 12:02:18 -0500 Subject: [PATCH 223/271] meson: fix warnings, cleanup --- meson.build | 4 ---- packages/meson.build | 8 ++++---- src/libresrc/meson.build | 2 +- src/meson.build | 2 +- tools/respack.py | 3 +-- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index 303266dc3..8b511e94c 100644 --- a/meson.build +++ b/meson.build @@ -46,10 +46,6 @@ endif docdir = prefix / 'doc' dataroot = datadir / 'aegisub' -if host_machine.system() == 'windows' - -endif - # MSVC sets this automatically with -MDd, but it has a different meaning on other platforms if get_option('debug') and host_machine.system() != 'windows' add_project_arguments('-D_DEBUG', language: 'cpp') diff --git a/packages/meson.build b/packages/meson.build index d2298cd27..4a7d79a65 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -1,15 +1,15 @@ conf_pkg = configuration_data() if host_machine.system() == 'windows' - installer_setup = find_program(meson.source_root() / 'tools/win-installer-setup.ps1', ) + installer_setup = find_program(meson.project_source_root() / 'tools/win-installer-setup.ps1', ) run_target('win-installer', - command: [installer_setup, meson.build_root(), meson.source_root()]) + command: [installer_setup, meson.project_build_root(), meson.project_source_root()]) elif host_machine.system() == 'darwin' # temporary hack until version.sh generates this properly - run_command('cp', meson.source_root() / 'tools' / 'osx-bundle.sed', meson.build_root()) + run_command('cp', meson.project_source_root() / 'tools' / 'osx-bundle.sed', meson.project_build_root()) fontconfig_conf = run_command('pkg-config', '--variable=confdir', 'fontconfig').stdout().strip() run_target('osx-bundle', - command: ['../tools/osx-bundle.sh', meson.source_root(), meson.build_root(), 'wx-config', fontconfig_conf, '', + command: ['../tools/osx-bundle.sh', meson.project_source_root(), meson.project_build_root(), 'wx-config', fontconfig_conf, '', get_option('build_osx_bundle') ? 'TRUE' : 'FALSE']) else conf_pkg.set('AEGISUB_COMMAND', 'aegisub') diff --git a/src/libresrc/meson.build b/src/libresrc/meson.build index e6189a3ca..d4be467d7 100644 --- a/src/libresrc/meson.build +++ b/src/libresrc/meson.build @@ -1,4 +1,4 @@ -respack = find_program('../../tools/respack.py') +respack = find_program(meson.project_source_root() / 'tools/respack.py') resrc = [ custom_target('bitmap.{cpp,h}', diff --git a/src/meson.build b/src/meson.build index 4a601f41a..d8228f486 100644 --- a/src/meson.build +++ b/src/meson.build @@ -257,4 +257,4 @@ aegisub = executable('aegisub', aegisub_src, version_h, acconf, install: true, install_dir: bindir, dependencies: deps, - gui_app: true) + win_subsystem: 'windows') diff --git a/tools/respack.py b/tools/respack.py index c1c78fb73..9e5902eb5 100755 --- a/tools/respack.py +++ b/tools/respack.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -import sys -import os +import sys, os manifestfile, cppfile, hfile = sys.argv[1:] From 248785d7ad7bdcd26e02fb49f053dc8103669509 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 30 Jan 2021 12:02:34 -0500 Subject: [PATCH 224/271] meson: apply manifest on windows --- src/meson.build | 10 ++++++++++ tools/apply-manifest.py | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 tools/apply-manifest.py diff --git a/src/meson.build b/src/meson.build index d8228f486..e5f59b991 100644 --- a/src/meson.build +++ b/src/meson.build @@ -258,3 +258,13 @@ aegisub = executable('aegisub', aegisub_src, version_h, acconf, install_dir: bindir, dependencies: deps, win_subsystem: 'windows') + +if host_machine.system() == 'windows' + mt_exe = find_program('mt.exe') + apply_manifest = find_program(meson.project_source_root() / 'tools/apply-manifest.py') + custom_target('apply-manifest', + input: aegisub, + output: 'applied_manifest', + command: [apply_manifest, mt_exe, '@INPUT@'], + build_by_default: true) +endif diff --git a/tools/apply-manifest.py b/tools/apply-manifest.py new file mode 100644 index 000000000..3ea84624d --- /dev/null +++ b/tools/apply-manifest.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +import sys, subprocess, pathlib, os + +mt_exe, executable = sys.argv[1:] + +subprocess.run([mt_exe, '-manifest', executable + '.manifest', '-outputresource:' + executable + ';1']) +pathlib.Path(os.path.join(os.path.dirname(executable), 'applied_manifest')).touch() From b72f02b9f286690a8e1ed5848368146f5311caad Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 30 Jan 2021 12:11:34 -0500 Subject: [PATCH 225/271] meson: reorder nasm download to work with global args --- meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 8b511e94c..9b361f50f 100644 --- a/meson.build +++ b/meson.build @@ -7,17 +7,17 @@ project('Aegisub', ['c', 'cpp'], cmake = import('cmake') if host_machine.system() == 'windows' - sys_nasm = find_program('nasm', required: false) - if not sys_nasm.found() - nasm = subproject('nasm').get_variable('nasm') - meson.override_find_program('nasm', nasm) - endif - add_project_arguments('-DNOMINMAX', '-D_WIN32_WINNT=0x0601', language: 'cpp') if not get_option('csri').disabled() add_global_arguments('-DCSRI_NO_EXPORT', language: 'c') endif + + sys_nasm = find_program('nasm', required: false) + if not sys_nasm.found() + nasm = subproject('nasm').get_variable('nasm') + meson.override_find_program('nasm', nasm) + endif endif if host_machine.system() == 'windows' From 1fd574f556fa57284a4fd54aa9429f6723623470 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 30 Jan 2021 12:20:24 -0500 Subject: [PATCH 226/271] win_installer: don't include arch in file name --- packages/win_installer/fragment_setupbase.iss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/win_installer/fragment_setupbase.iss b/packages/win_installer/fragment_setupbase.iss index 8092bd4e5..f6c7de493 100644 --- a/packages/win_installer/fragment_setupbase.iss +++ b/packages/win_installer/fragment_setupbase.iss @@ -35,8 +35,8 @@ UninstallDisplayIcon={app}\aegisub.exe WizardImageFile={#INSTALLER_DIR}\welcome-large.bmp WizardSmallImageFile={#INSTALLER_DIR}\aegisub-large.bmp -OutputBaseFilename=Aegisub-{#BUILD_GIT_VERSION_STRING}-{#ARCH} -VersionInfoDescription=Aegisub {#BUILD_GIT_VERSION_STRING} {#ARCH}-bit +OutputBaseFilename=Aegisub-{#BUILD_GIT_VERSION_STRING} +VersionInfoDescription=Aegisub {#BUILD_GIT_VERSION_STRING} [Languages] Name: "en"; MessagesFile: "compiler:Default.isl" From c32c612dc32c7bbf0c7a15feb8f30b4dafc58918 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 30 Jan 2021 16:22:05 -0500 Subject: [PATCH 227/271] meson: set dataroot correctly for osx bundle --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 9b361f50f..aaa800cb8 100644 --- a/meson.build +++ b/meson.build @@ -37,14 +37,15 @@ if host_machine.system() == 'darwin' and get_option('build_osx_bundle') bindir = prefix / 'MacOS' datadir = prefix / 'SharedSupport' localedir = prefix / 'Resources' + dataroot = datadir else prefix = get_option('prefix') bindir = prefix / get_option('bindir') datadir = prefix / get_option('datadir') localedir = prefix / get_option('localedir') + dataroot = datadir / 'aegisub' endif docdir = prefix / 'doc' -dataroot = datadir / 'aegisub' # MSVC sets this automatically with -MDd, but it has a different meaning on other platforms if get_option('debug') and host_machine.system() != 'windows' From ca7501c7ed7657775c1b3980fc28234f15daed45 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Sun, 31 Jan 2021 23:26:35 +0000 Subject: [PATCH 228/271] Remove unused alignment flags for combo boxes in resampler Causes an assertion error with wx 3.1 --- src/dialog_resample.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dialog_resample.cpp b/src/dialog_resample.cpp index bf616cb83..2b7d40ee9 100644 --- a/src/dialog_resample.cpp +++ b/src/dialog_resample.cpp @@ -170,7 +170,7 @@ DialogResample::DialogResample(agi::Context *c, ResampleSettings &settings) auto source_matrix_sizer = new wxBoxSizer(wxHORIZONTAL); source_matrix_sizer->Add(new wxStaticText(&d, -1, _("YCbCr Matrix:")), wxSizerFlags().Border(wxRIGHT).Center()); - source_matrix_sizer->Add(source_matrix, wxSizerFlags(1).Center().Right()); + source_matrix_sizer->Add(source_matrix, wxSizerFlags(1).Center()); auto source_res_box = new wxStaticBoxSizer(wxVERTICAL, &d, _("Source Resolution")); source_res_box->Add(source_res_sizer, wxSizerFlags(1).Expand().Border(wxBOTTOM)); @@ -184,7 +184,7 @@ DialogResample::DialogResample(agi::Context *c, ResampleSettings &settings) auto dest_matrix_sizer = new wxBoxSizer(wxHORIZONTAL); dest_matrix_sizer->Add(new wxStaticText(&d, -1, _("YCbCr Matrix:")), wxSizerFlags().Border(wxRIGHT).Center()); - dest_matrix_sizer->Add(dest_matrix, wxSizerFlags(1).Center().Right()); + dest_matrix_sizer->Add(dest_matrix, wxSizerFlags(1).Center()); auto dest_res_box = new wxStaticBoxSizer(wxVERTICAL, &d, _("Destination Resolution")); dest_res_box->Add(dest_res_sizer, wxSizerFlags(1).Expand().Border(wxBOTTOM)); From c6f4ea45aaf83f27b5d862acb2beeeb9c16f6cd5 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Sun, 31 Jan 2021 23:28:12 +0000 Subject: [PATCH 229/271] Let search field in Hotkeys menu expand horizontally On Linux with wx 3.1 it was too small to use by default --- src/preferences.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/preferences.cpp b/src/preferences.cpp index 7850af5f9..f6320dd75 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -607,8 +607,7 @@ Interface_Hotkeys::Interface_Hotkeys(wxTreebook *book, Preferences *parent) dvc->AppendTextColumn("Description", 2, wxDATAVIEW_CELL_INERT, 300, wxALIGN_LEFT, wxCOL_SORTABLE | wxCOL_RESIZABLE); wxSizer *buttons = new wxBoxSizer(wxHORIZONTAL); - buttons->Add(quick_search, wxSizerFlags().Border()); - buttons->AddStretchSpacer(1); + buttons->Add(quick_search, wxSizerFlags(1).Expand().Border()); buttons->Add(new_button, wxSizerFlags().Border()); buttons->Add(edit_button, wxSizerFlags().Border()); buttons->Add(delete_button, wxSizerFlags().Border()); From 2abb098bd1101ac23bdb39d21ff036d648483af7 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 22 Feb 2021 12:25:36 -0500 Subject: [PATCH 230/271] meson: improve iconv detection --- meson.build | 7 +++++-- subprojects/packagefiles/boost/libs/locale/meson.build | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index aaa800cb8..9612414b4 100644 --- a/meson.build +++ b/meson.build @@ -77,10 +77,13 @@ cxx = meson.get_compiler('cpp') cc = meson.get_compiler('c') deps += cc.find_library('m', required: false) deps += cc.find_library('dl', required: false) -if not cxx.check_header('iconv.h') + +iconv_dep = cc.find_library('iconv', required: false) +if not (iconv_dep.found() or cc.has_function('iconv_open')) iconv_sp = subproject('iconv') # this really needs to be replaced with a proper port - deps += iconv_sp.get_variable('libiconv_dep') + iconv_dep = iconv_sp.get_variable('libiconv_dep') endif +deps += iconv_dep deps += dependency('libass', version: '>=0.9.7', fallback: ['libass', 'libass_dep']) diff --git a/subprojects/packagefiles/boost/libs/locale/meson.build b/subprojects/packagefiles/boost/libs/locale/meson.build index 6abd3cd1b..c52b18f7a 100644 --- a/subprojects/packagefiles/boost/libs/locale/meson.build +++ b/subprojects/packagefiles/boost/libs/locale/meson.build @@ -61,9 +61,12 @@ else locale_args += '-DBOOST_LOCALE_NO_WINAPI_BACKEND=1' endif -if not cpp.check_header('iconv.h') - locale_deps += dependency('iconv') +cxx = meson.get_compiler('cpp') +iconv_dep = cxx.find_library('iconv', required: false) +if not (iconv_dep.found() or cxx.has_function('iconv_open')) + iconv_dep = dependency('iconv') endif +locale_deps += iconv_dep locale_args += '-DBOOST_LOCALE_WITH_ICONV=1' locale_deps += icu_deps From 43751546f4020d0c226e410ca3d71c7152fc4c50 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 22 Feb 2021 14:29:14 -0500 Subject: [PATCH 231/271] spectrum view: allow 32-bit wxBitmap Required on MacOS --- src/audio_renderer_spectrum.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio_renderer_spectrum.cpp b/src/audio_renderer_spectrum.cpp index d0a299a86..4331febfc 100644 --- a/src/audio_renderer_spectrum.cpp +++ b/src/audio_renderer_spectrum.cpp @@ -215,7 +215,7 @@ void AudioSpectrumRenderer::Render(wxBitmap &bmp, int start, AudioRenderingStyle return; assert(bmp.IsOk()); - assert(bmp.GetDepth() == 24); + assert(bmp.GetDepth() == 24 || bmp.GetDepth() == 32); int end = start + bmp.GetWidth(); From dc3ffa30aff2ef3a3038223a92300091f138cac7 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 27 Feb 2021 20:21:29 -0500 Subject: [PATCH 232/271] actions: stylistic cleanup --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dd3fa87e..8adbf8741 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: os: windows-latest, msvc: true, buildtype: release, - args: -Ddefault_library=static --force-fallback-for=zlib,harfbuzz + args: '-Ddefault_library=static --force-fallback-for=zlib,harfbuzz' } #- { # name: Windows MinGW, @@ -30,13 +30,13 @@ jobs: name: Ubuntu Debug, os: ubuntu-latest, buildtype: debugoptimized, - args: "" + args: '' } - { name: Ubuntu Release, os: ubuntu-latest, buildtype: release, - args: "" + args: '' } - { name: macOS Debug, @@ -108,5 +108,4 @@ jobs: if: matrix.config.os == 'windows-latest' with: name: ${{ matrix.config.name }} - path: | - build/Aegisub-*.exe + path: build/Aegisub-*.exe From 8fa0fa352b6f91d510da7aa144acc643ca0874e2 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 27 Feb 2021 21:11:56 -0500 Subject: [PATCH 233/271] meson: generate osx-bundle.sed --- .gitignore | 1 - packages/meson.build | 2 -- tools/version.sh | 14 +++++++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f05385c6e..1b60e3f20 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ src/libresrc/default_config_platform.json tests/*.json tests/run tools/osx-bundle-restart-helper -tools/osx-bundle.sed tools/repack-thes-dict tools/repack-thes-dict.dSYM diff --git a/packages/meson.build b/packages/meson.build index 4a7d79a65..41a0ab5cf 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -5,8 +5,6 @@ if host_machine.system() == 'windows' run_target('win-installer', command: [installer_setup, meson.project_build_root(), meson.project_source_root()]) elif host_machine.system() == 'darwin' - # temporary hack until version.sh generates this properly - run_command('cp', meson.project_source_root() / 'tools' / 'osx-bundle.sed', meson.project_build_root()) fontconfig_conf = run_command('pkg-config', '--variable=confdir', 'fontconfig').stdout().strip() run_target('osx-bundle', command: ['../tools/osx-bundle.sh', meson.project_source_root(), meson.project_build_root(), 'wx-config', fontconfig_conf, '', diff --git a/tools/version.sh b/tools/version.sh index 485f45113..8df33e175 100755 --- a/tools/version.sh +++ b/tools/version.sh @@ -20,6 +20,7 @@ if ! test -d "${srcdir}/.git"; then exit 2 fi fi +osx_bundle_sed_path="${builddir}/osx-bundle.sed" last_svn_revision=6962 last_svn_hash="16cd907fe7482cb54a7374cd28b8501f138116be" @@ -44,6 +45,7 @@ else tagged_release=0 fi +build_date="$(date "+%Y-%m-%d %H:%M %Z")" new_version_h="\ #define BUILD_GIT_VERSION_NUMBER ${git_revision} @@ -52,11 +54,21 @@ new_version_h="\ #define INSTALLER_VERSION \"${installer_version}\" #define RESOURCE_BASE_VERSION ${resource_version}" +osx_bundle_sed="\ +s/@PLIST_VERSION@/${git_version_str}/g +s/@PLIST_BUILD_DATE@/${build_date}/g +/ *@LOCALIZATIONS@/ { + r languages + d +}" # Write it only if it's changed to avoid spurious rebuilds # This bizzare comparison method is due to that newlines in shell variables are very exciting case "$(cat ${version_h_path} 2> /dev/null)" in "${new_version_h}");; - *) echo "${new_version_h}" > "${version_h_path}" + *) + echo "${new_version_h}" > "${version_h_path}" + echo "${osx_bundle_sed}" > "${osx_bundle_sed_path}" + ;; esac From 19429b0f6ed2638a2ea1fde96921cd67c808c538 Mon Sep 17 00:00:00 2001 From: petzku Date: Tue, 2 Mar 2021 02:28:14 +0200 Subject: [PATCH 234/271] Fix negative margin handling (closes #104) Previously, margins were clamped to 0..9999, but negative margins are well supported by most renderers. In addition, previously lua automations automations were able to produce these negative margin values, and they would be saved correctly. However, re-opening the file would clamp the values, and they could not be edited in the edit box. This commit changes the clamping to be -9999..99999, and allows entering (and editing) negative values in all relevant fields. In addition, this makes the subtitle edit box margin fields take 5 characters instead of 4 to accommodate negative numbers up to 9999 (also the reason for raising the upper bound). --- src/ass_dialogue.cpp | 2 +- src/ass_style.cpp | 6 +++--- src/dialog_style_editor.cpp | 2 +- src/subs_edit_box.cpp | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ass_dialogue.cpp b/src/ass_dialogue.cpp index 88ce9386a..518e4d4fe 100644 --- a/src/ass_dialogue.cpp +++ b/src/ass_dialogue.cpp @@ -118,7 +118,7 @@ void AssDialogue::Parse(std::string const& raw) { Style = tkn.next_str_trim(); Actor = tkn.next_str_trim(); for (int& margin : Margin) - margin = mid(0, boost::lexical_cast(tkn.next_str()), 9999); + margin = mid(-9999, boost::lexical_cast(tkn.next_str()), 99999); Effect = tkn.next_str_trim(); std::string text{tkn.next_tok().begin(), str.end()}; diff --git a/src/ass_style.cpp b/src/ass_style.cpp index 37645c043..0b778b328 100644 --- a/src/ass_style.cpp +++ b/src/ass_style.cpp @@ -158,9 +158,9 @@ AssStyle::AssStyle(std::string const& str, int version) { if (version == 0) alignment = SsaToAss(alignment); - Margin[0] = mid(0, p.next_int(), 9999); - Margin[1] = mid(0, p.next_int(), 9999); - Margin[2] = mid(0, p.next_int(), 9999); + Margin[0] = mid(-9999, p.next_int(), 99999); + Margin[1] = mid(-9999, p.next_int(), 99999); + Margin[2] = mid(-9999, p.next_int(), 99999); // Skip alpha level if (version == 0) diff --git a/src/dialog_style_editor.cpp b/src/dialog_style_editor.cpp index 039caee17..b186e5fd7 100644 --- a/src/dialog_style_editor.cpp +++ b/src/dialog_style_editor.cpp @@ -200,7 +200,7 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con for (int i = 0; i < 3; i++) margin[i] = new wxSpinCtrl(this, -1, std::to_wstring(style->Margin[i]), wxDefaultPosition, wxSize(60, -1), - wxSP_ARROW_KEYS, 0, 9999, style->Margin[i]); + wxSP_ARROW_KEYS, -9999, 99999, style->Margin[i]); Alignment = new wxRadioBox(this, -1, _("Alignment"), wxDefaultPosition, wxDefaultSize, 9, alignValues, 3, wxRA_SPECIFY_COLS); auto Outline = num_text_ctrl(&work->outline_w, 0.0, 1000.0, 0.1); diff --git a/src/subs_edit_box.cpp b/src/subs_edit_box.cpp index a72204fdb..9c4bb1f49 100644 --- a/src/subs_edit_box.cpp +++ b/src/subs_edit_box.cpp @@ -250,13 +250,13 @@ SubsEditBox::~SubsEditBox() { } wxTextCtrl *SubsEditBox::MakeMarginCtrl(wxString const& tooltip, int margin, wxString const& commit_msg) { - wxTextCtrl *ctrl = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxSize(40,-1), wxTE_CENTRE | wxTE_PROCESS_ENTER, IntValidator()); - ctrl->SetMaxLength(4); + wxTextCtrl *ctrl = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxSize(40,-1), wxTE_CENTRE | wxTE_PROCESS_ENTER, IntValidator(0, true)); + ctrl->SetMaxLength(5); ctrl->SetToolTip(tooltip); middle_left_sizer->Add(ctrl, wxSizerFlags().Center()); Bind(wxEVT_TEXT, [=](wxCommandEvent&) { - int value = agi::util::mid(0, atoi(ctrl->GetValue().utf8_str()), 9999); + int value = agi::util::mid(-9999, atoi(ctrl->GetValue().utf8_str()), 99999); SetSelectedRows([&](AssDialogue *d) { d->Margin[margin] = value; }, commit_msg, AssFile::COMMIT_DIAG_META); }, ctrl->GetId()); From c218db6f349aed809040801c44b59c1d2e0d8739 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 6 Mar 2021 14:57:27 -0500 Subject: [PATCH 235/271] meson: disable LTO by default --- README.md | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bebe2ac57..7b52923f8 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ All other dependencies are either stored in the repository or are included as su Building: 1. Clone Aegisub's repository: `git clone https://github.com/TypesettingTools/Aegisub.git` -2. From the Visual Studio "x64 Native Tools Command Prompt", generate the build directory: `meson build -Ddefault_library=static` +2. From the Visual Studio "x64 Native Tools Command Prompt", generate the build directory: `meson build -Ddefault_library=static -Db_lto=true` 3. Build with `cd build` and `meson compile` You should now have a binary at `src/aegisub.exe`. diff --git a/meson.build b/meson.build index 9612414b4..2e485793c 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', meson_version: '>=0.56.1', - default_options: ['cpp_std=c++11', 'b_lto=true', 'buildtype=debugoptimized'], + default_options: ['cpp_std=c++11', 'buildtype=debugoptimized'], version: '3.2.2') cmake = import('cmake') From 1246534b7b95561407091bb7637eacdee7fce14e Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 27 Mar 2021 08:09:11 -0400 Subject: [PATCH 236/271] Move AddSeparator to VisualTool::SetToolbar Co-authored-by: wangqr --- src/video_display.cpp | 1 - src/visual_tool_drag.cpp | 1 + src/visual_tool_vector_clip.cpp | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video_display.cpp b/src/video_display.cpp index 3579c194e..8d85311a6 100644 --- a/src/video_display.cpp +++ b/src/video_display.cpp @@ -415,7 +415,6 @@ void VideoDisplay::SetTool(std::unique_ptr new_tool) { // Hide the tool bar first to eliminate unecessary size changes toolBar->Show(false); toolBar->ClearTools(); - toolBar->AddSeparator(); tool->SetToolbar(toolBar); // Update size as the new typesetting tool may have changed the subtoolbar size diff --git a/src/visual_tool_drag.cpp b/src/visual_tool_drag.cpp index 63daa498d..96212da7f 100644 --- a/src/visual_tool_drag.cpp +++ b/src/visual_tool_drag.cpp @@ -54,6 +54,7 @@ VisualToolDrag::VisualToolDrag(VideoDisplay *parent, agi::Context *context) void VisualToolDrag::SetToolbar(wxToolBar *tb) { toolbar = tb; + toolbar->AddSeparator(); toolbar->AddTool(-1, _("Toggle between \\move and \\pos"), ICON(visual_move_conv_move)); toolbar->Realize(); toolbar->Show(true); diff --git a/src/visual_tool_vector_clip.cpp b/src/visual_tool_vector_clip.cpp index bbe00d8e9..701937798 100644 --- a/src/visual_tool_vector_clip.cpp +++ b/src/visual_tool_vector_clip.cpp @@ -52,6 +52,8 @@ VisualToolVectorClip::VisualToolVectorClip(VideoDisplay *parent, agi::Context *c void VisualToolVectorClip::SetToolbar(wxToolBar *toolBar) { this->toolBar = toolBar; + toolBar->AddSeparator(); + int icon_size = OPT_GET("App/Toolbar Icon Size")->GetInt(); #define ICON(name) icon_size == 16 ? GETIMAGE(name ## _16) : GETIMAGE(name ## _24) From d32ef75cba8aed1d31fa67b07249423d26264bd6 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 27 Mar 2021 09:29:37 -0400 Subject: [PATCH 237/271] meson: move executable to the root directory --- README.md | 2 +- meson.build | 23 ++++++++++++ .../win_installer/fragment_mainprogram.iss | 2 +- src/meson.build | 37 ++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 7b52923f8..cc71b0fc0 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Building: 2. From the Visual Studio "x64 Native Tools Command Prompt", generate the build directory: `meson build -Ddefault_library=static -Db_lto=true` 3. Build with `cd build` and `meson compile` -You should now have a binary at `src/aegisub.exe`. +You should now have a binary: `aegisub.exe`. Installer: diff --git a/meson.build b/meson.build index 2e485793c..ac325ba9d 100644 --- a/meson.build +++ b/meson.build @@ -320,3 +320,26 @@ subdir('libaegisub') subdir('packages') subdir('po') subdir('src') + +aegisub_cpp_pch = ['src/include/agi_pre.h'] +aegisub_c_pch = ['src/include/agi_pre_c.h'] + +aegisub = executable('aegisub', aegisub_src, version_h, acconf, + link_with: [libresrc, libluabins, libaegisub], + include_directories: [libaegisub_inc, libresrc_inc, version_inc, deps_inc], + cpp_pch: aegisub_cpp_pch, + c_pch: aegisub_c_pch, + install: true, + install_dir: bindir, + dependencies: deps, + win_subsystem: 'windows') + +if host_machine.system() == 'windows' + mt_exe = find_program('mt.exe') + apply_manifest = find_program(meson.project_source_root() / 'tools/apply-manifest.py') + custom_target('apply-manifest', + input: aegisub, + output: 'applied_manifest', + command: [apply_manifest, mt_exe, '@INPUT@'], + build_by_default: true) +endif diff --git a/packages/win_installer/fragment_mainprogram.iss b/packages/win_installer/fragment_mainprogram.iss index 87615ec01..7feeaf740 100644 --- a/packages/win_installer/fragment_mainprogram.iss +++ b/packages/win_installer/fragment_mainprogram.iss @@ -19,7 +19,7 @@ Name: "checkforupdates"; Description: "{cm:CheckForUpdates}"; GroupDescription: [Files] ; main -DestDir: {app}; Source: "{#BUILD_ROOT}\src\aegisub.exe"; Flags: ignoreversion; Components: main +DestDir: {app}; Source: "{#BUILD_ROOT}\aegisub.exe"; Flags: ignoreversion; Components: main DestDir: {app}; Source: "{#INSTALLER_DIR}\license.txt"; Flags: ignoreversion; Components: main [Icons] diff --git a/src/meson.build b/src/meson.build index e5f59b991..72587d366 100644 --- a/src/meson.build +++ b/src/meson.build @@ -164,18 +164,18 @@ aegisub_src = files( ) if host_machine.system() == 'darwin' - aegisub_src += [ + aegisub_src += files( 'font_file_lister_coretext.mm', 'osx/osx_utils.mm', 'osx/retina_helper.mm', - ] + ) elif host_machine.system() == 'windows' - aegisub_src += [ + aegisub_src += files( 'avisynth_wrap.cpp', 'font_file_lister_gdi.cpp', # 'libass_gdi_fontselect.cpp', 'video_provider_avs.cpp', - ] + ) if cc.has_header('wingdi.h') deps += cc.find_library('gdi32', required: true) @@ -217,11 +217,11 @@ elif host_machine.system() == 'windows' endif if conf.has('WITH_FONTCONFIG') - aegisub_src += 'font_file_lister_fontconfig.cpp' + aegisub_src += files('font_file_lister_fontconfig.cpp') endif if conf.has('WITH_CSRI') - aegisub_src += 'subtitles_provider_csri.cpp' + aegisub_src += files('subtitles_provider_csri.cpp') endif opt_src = [ @@ -242,29 +242,6 @@ opt_src = [ foreach opt: opt_src if dep_avail.contains(opt[0]) - aegisub_src += opt[1] + aegisub_src += files(opt[1]) endif endforeach - -aegisub_cpp_pch = ['include/agi_pre.h'] -aegisub_c_pch = ['include/agi_pre_c.h'] - -aegisub = executable('aegisub', aegisub_src, version_h, acconf, - link_with: [libresrc, libluabins, libaegisub], - include_directories: [libaegisub_inc, libresrc_inc, version_inc, deps_inc], - cpp_pch: aegisub_cpp_pch, - c_pch: aegisub_c_pch, - install: true, - install_dir: bindir, - dependencies: deps, - win_subsystem: 'windows') - -if host_machine.system() == 'windows' - mt_exe = find_program('mt.exe') - apply_manifest = find_program(meson.project_source_root() / 'tools/apply-manifest.py') - custom_target('apply-manifest', - input: aegisub, - output: 'applied_manifest', - command: [apply_manifest, mt_exe, '@INPUT@'], - build_by_default: true) -endif From f5122a392771128745ee973169455d6f86b9be8d Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 27 Mar 2021 09:30:21 -0400 Subject: [PATCH 238/271] meson: copy automation files to build directory This enables running Moonscript on Windows builds without relying on system files --- automation/include/aegisub/meson.build | 14 ++++++++++++++ automation/include/meson.build | 19 +++++++++++++++++++ automation/meson.build | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 automation/include/aegisub/meson.build create mode 100644 automation/include/meson.build diff --git a/automation/include/aegisub/meson.build b/automation/include/aegisub/meson.build new file mode 100644 index 000000000..3cc4959e8 --- /dev/null +++ b/automation/include/aegisub/meson.build @@ -0,0 +1,14 @@ +# Copy files to build directory for testing purposes +lua_files = files( + 'argcheck.moon', + 'clipboard.lua', + 'ffi.moon', + 'lfs.moon', + 're.moon', + 'unicode.moon', + 'util.moon', +) + +foreach f: lua_files + configure_file(input: f, output: '@PLAINNAME@', copy: true) +endforeach diff --git a/automation/include/meson.build b/automation/include/meson.build new file mode 100644 index 000000000..3c820ff03 --- /dev/null +++ b/automation/include/meson.build @@ -0,0 +1,19 @@ +# Copy files to build directory for testing purposes +lua_files = files( + 'cleantags.lua', + 'clipboard.lua', + 'karaskel-auto4.lua', + 'karaskel.lua', + 'lfs.lua', + 'moonscript.lua', + 're.lua', + 'unicode.lua', + 'utils-auto4.lua', + 'utils.lua', +) + +foreach f: lua_files + configure_file(input: f, output: '@PLAINNAME@', copy: true) +endforeach + +subdir('aegisub') diff --git a/automation/meson.build b/automation/meson.build index 043d40c8c..e32a0cd9d 100644 --- a/automation/meson.build +++ b/automation/meson.build @@ -1,3 +1,5 @@ +subdir('include') + automation_dir = dataroot / 'automation' install_data( From 48c3acd3aaf1e3dc02b37bd7c73352d08e6b47f1 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 27 Mar 2021 09:31:10 -0400 Subject: [PATCH 239/271] actions: disable MacOS The LTO change broke this somehow, but disable until I can investigate why --- .github/workflows/ci.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8adbf8741..d06e8e2c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,18 +38,18 @@ jobs: buildtype: release, args: '' } - - { - name: macOS Debug, - os: macos-latest, - buildtype: debugoptimized, - args: -Ddefault_library=static - } - - { - name: macOS Release, - os: macos-latest, - buildtype: release, - args: -Ddefault_library=static - } + #- { + # name: macOS Debug, + # os: macos-latest, + # buildtype: debugoptimized, + # args: -Ddefault_library=static + #} + #- { + # name: macOS Release, + # os: macos-latest, + # buildtype: release, + # args: -Ddefault_library=static + #} steps: - uses: actions/checkout@v2 From ef64307ba15eacb67d861d3edc4664e1323b6e20 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 21 Jan 2021 06:23:28 -0500 Subject: [PATCH 240/271] Switch to upstream LuaJIT This does not yet handle the patching, but should build without issue --- .gitignore | 1 + meson.build | 2 +- subprojects/luajit.wrap | 8 + subprojects/luajit/COPYRIGHT | 56 - subprojects/luajit/README | 16 - subprojects/luajit/dynasm/dasm_arm.h | 456 - subprojects/luajit/dynasm/dasm_arm.lua | 1125 --- subprojects/luajit/dynasm/dasm_mips.h | 416 - subprojects/luajit/dynasm/dasm_mips.lua | 953 -- subprojects/luajit/dynasm/dasm_ppc.h | 412 - subprojects/luajit/dynasm/dasm_ppc.lua | 1249 --- subprojects/luajit/dynasm/dasm_proto.h | 83 - subprojects/luajit/dynasm/dasm_x64.lua | 12 - subprojects/luajit/dynasm/dasm_x86.h | 472 - subprojects/luajit/dynasm/dasm_x86.lua | 1946 ----- subprojects/luajit/dynasm/dynasm.lua | 1094 --- subprojects/luajit/include/lauxlib.h | 167 - subprojects/luajit/include/lua.h | 393 - subprojects/luajit/include/lua.hpp | 9 - subprojects/luajit/include/luaconf.h | 156 - subprojects/luajit/include/luajit.h | 70 - subprojects/luajit/include/lualib.h | 43 - subprojects/luajit/src/host/README | 4 - subprojects/luajit/src/host/buildvm.c | 516 -- subprojects/luajit/src/host/buildvm.h | 104 - subprojects/luajit/src/host/buildvm_asm.c | 314 - subprojects/luajit/src/host/buildvm_fold.c | 229 - subprojects/luajit/src/host/buildvm_lib.c | 398 - subprojects/luajit/src/host/buildvm_peobj.c | 368 - subprojects/luajit/src/host/genminilua.lua | 429 - subprojects/luajit/src/host/minilua.c | 7770 ----------------- subprojects/luajit/src/jit/bc.lua | 191 - subprojects/luajit/src/jit/bcsave.lua | 659 -- subprojects/luajit/src/jit/dis_arm.lua | 689 -- subprojects/luajit/src/jit/dis_mips.lua | 428 - subprojects/luajit/src/jit/dis_mipsel.lua | 20 - subprojects/luajit/src/jit/dis_ppc.lua | 591 -- subprojects/luajit/src/jit/dis_x64.lua | 20 - subprojects/luajit/src/jit/dis_x86.lua | 836 -- subprojects/luajit/src/jit/dump.lua | 701 -- subprojects/luajit/src/jit/v.lua | 167 - subprojects/luajit/src/lauxlib.h | 167 - subprojects/luajit/src/lib_aux.c | 356 - subprojects/luajit/src/lib_base.c | 683 -- subprojects/luajit/src/lib_bit.c | 74 - subprojects/luajit/src/lib_debug.c | 405 - subprojects/luajit/src/lib_ffi.c | 851 -- subprojects/luajit/src/lib_init.c | 55 - subprojects/luajit/src/lib_io.c | 574 -- subprojects/luajit/src/lib_jit.c | 664 -- subprojects/luajit/src/lib_math.c | 233 - subprojects/luajit/src/lib_os.c | 304 - subprojects/luajit/src/lib_package.c | 602 -- subprojects/luajit/src/lib_string.c | 940 -- subprojects/luajit/src/lib_table.c | 300 - subprojects/luajit/src/lj.supp | 41 - subprojects/luajit/src/lj_alloc.c | 1396 --- subprojects/luajit/src/lj_alloc.h | 17 - subprojects/luajit/src/lj_api.c | 1200 --- subprojects/luajit/src/lj_arch.h | 452 - subprojects/luajit/src/lj_asm.c | 1920 ---- subprojects/luajit/src/lj_asm.h | 17 - subprojects/luajit/src/lj_asm_arm.h | 2360 ----- subprojects/luajit/src/lj_asm_mips.h | 1972 ----- subprojects/luajit/src/lj_asm_ppc.h | 2168 ----- subprojects/luajit/src/lj_asm_x86.h | 2900 ------ subprojects/luajit/src/lj_bc.c | 14 - subprojects/luajit/src/lj_bc.h | 261 - subprojects/luajit/src/lj_bcdump.h | 66 - subprojects/luajit/src/lj_bcread.c | 476 - subprojects/luajit/src/lj_bcwrite.c | 396 - subprojects/luajit/src/lj_carith.c | 353 - subprojects/luajit/src/lj_carith.h | 27 - subprojects/luajit/src/lj_ccall.c | 900 -- subprojects/luajit/src/lj_ccall.h | 171 - subprojects/luajit/src/lj_ccallback.c | 644 -- subprojects/luajit/src/lj_ccallback.h | 25 - subprojects/luajit/src/lj_cconv.c | 752 -- subprojects/luajit/src/lj_cconv.h | 70 - subprojects/luajit/src/lj_cdata.c | 285 - subprojects/luajit/src/lj_cdata.h | 75 - subprojects/luajit/src/lj_char.c | 43 - subprojects/luajit/src/lj_char.h | 42 - subprojects/luajit/src/lj_clib.c | 409 - subprojects/luajit/src/lj_clib.h | 29 - subprojects/luajit/src/lj_cparse.c | 1881 ---- subprojects/luajit/src/lj_cparse.h | 65 - subprojects/luajit/src/lj_crecord.c | 1672 ---- subprojects/luajit/src/lj_crecord.h | 31 - subprojects/luajit/src/lj_ctype.c | 634 -- subprojects/luajit/src/lj_ctype.h | 461 - subprojects/luajit/src/lj_debug.c | 605 -- subprojects/luajit/src/lj_debug.h | 61 - subprojects/luajit/src/lj_def.h | 353 - subprojects/luajit/src/lj_dispatch.c | 494 -- subprojects/luajit/src/lj_dispatch.h | 131 - subprojects/luajit/src/lj_emit_arm.h | 356 - subprojects/luajit/src/lj_emit_mips.h | 211 - subprojects/luajit/src/lj_emit_ppc.h | 238 - subprojects/luajit/src/lj_emit_x86.h | 466 - subprojects/luajit/src/lj_err.c | 802 -- subprojects/luajit/src/lj_err.h | 41 - subprojects/luajit/src/lj_errmsg.h | 193 - subprojects/luajit/src/lj_ff.h | 18 - subprojects/luajit/src/lj_ffrecord.c | 887 -- subprojects/luajit/src/lj_ffrecord.h | 24 - subprojects/luajit/src/lj_frame.h | 187 - subprojects/luajit/src/lj_func.c | 187 - subprojects/luajit/src/lj_func.h | 24 - subprojects/luajit/src/lj_gc.c | 856 -- subprojects/luajit/src/lj_gc.h | 134 - subprojects/luajit/src/lj_gdbjit.c | 795 -- subprojects/luajit/src/lj_gdbjit.h | 22 - subprojects/luajit/src/lj_ir.c | 501 -- subprojects/luajit/src/lj_ir.h | 551 -- subprojects/luajit/src/lj_ircall.h | 271 - subprojects/luajit/src/lj_iropt.h | 161 - subprojects/luajit/src/lj_jit.h | 417 - subprojects/luajit/src/lj_lex.c | 482 - subprojects/luajit/src/lj_lex.h | 85 - subprojects/luajit/src/lj_lib.c | 258 - subprojects/luajit/src/lj_lib.h | 112 - subprojects/luajit/src/lj_load.c | 168 - subprojects/luajit/src/lj_mcode.c | 387 - subprojects/luajit/src/lj_mcode.h | 30 - subprojects/luajit/src/lj_meta.c | 466 - subprojects/luajit/src/lj_meta.h | 37 - subprojects/luajit/src/lj_obj.c | 35 - subprojects/luajit/src/lj_obj.h | 856 -- subprojects/luajit/src/lj_opt_dce.c | 78 - subprojects/luajit/src/lj_opt_fold.c | 2304 ----- subprojects/luajit/src/lj_opt_loop.c | 436 - subprojects/luajit/src/lj_opt_mem.c | 916 -- subprojects/luajit/src/lj_opt_narrow.c | 654 -- subprojects/luajit/src/lj_opt_sink.c | 244 - subprojects/luajit/src/lj_opt_split.c | 732 -- subprojects/luajit/src/lj_parse.c | 2756 ------ subprojects/luajit/src/lj_parse.h | 18 - subprojects/luajit/src/lj_record.c | 2261 ----- subprojects/luajit/src/lj_record.h | 44 - subprojects/luajit/src/lj_snap.c | 862 -- subprojects/luajit/src/lj_snap.h | 34 - subprojects/luajit/src/lj_state.c | 287 - subprojects/luajit/src/lj_state.h | 35 - subprojects/luajit/src/lj_str.c | 339 - subprojects/luajit/src/lj_str.h | 50 - subprojects/luajit/src/lj_strscan.c | 498 -- subprojects/luajit/src/lj_strscan.h | 39 - subprojects/luajit/src/lj_tab.c | 631 -- subprojects/luajit/src/lj_tab.h | 70 - subprojects/luajit/src/lj_target.h | 162 - subprojects/luajit/src/lj_target_arm.h | 274 - subprojects/luajit/src/lj_target_mips.h | 258 - subprojects/luajit/src/lj_target_ppc.h | 280 - subprojects/luajit/src/lj_target_x86.h | 342 - subprojects/luajit/src/lj_trace.c | 824 -- subprojects/luajit/src/lj_trace.h | 53 - subprojects/luajit/src/lj_traceerr.h | 61 - subprojects/luajit/src/lj_udata.c | 34 - subprojects/luajit/src/lj_udata.h | 14 - subprojects/luajit/src/lj_vm.h | 116 - subprojects/luajit/src/lj_vmevent.c | 57 - subprojects/luajit/src/lj_vmevent.h | 59 - subprojects/luajit/src/lj_vmmath.c | 140 - subprojects/luajit/src/ljamalg.c | 93 - subprojects/luajit/src/lua.h | 393 - subprojects/luajit/src/lua.hpp | 9 - subprojects/luajit/src/luaconf.h | 156 - subprojects/luajit/src/luajit.c | 571 -- subprojects/luajit/src/luajit.h | 70 - subprojects/luajit/src/lualib.h | 43 - subprojects/luajit/src/vm_arm.dasc | 4486 ---------- subprojects/luajit/src/vm_mips.dasc | 4248 --------- subprojects/luajit/src/vm_ppc.dasc | 5160 ----------- subprojects/luajit/src/vm_ppcspe.dasc | 3691 -------- subprojects/luajit/src/vm_x86.dasc | 6401 -------------- .../{ => packagefiles}/luajit/meson.build | 7 +- .../luajit/src/host/meson.build | 0 .../{ => packagefiles}/luajit/src/meson.build | 6 + .../luajit/unicode-io.patch | 0 .../luajit/unicode-os.patch | 0 181 files changed, 18 insertions(+), 107186 deletions(-) create mode 100644 subprojects/luajit.wrap delete mode 100644 subprojects/luajit/COPYRIGHT delete mode 100644 subprojects/luajit/README delete mode 100644 subprojects/luajit/dynasm/dasm_arm.h delete mode 100644 subprojects/luajit/dynasm/dasm_arm.lua delete mode 100644 subprojects/luajit/dynasm/dasm_mips.h delete mode 100644 subprojects/luajit/dynasm/dasm_mips.lua delete mode 100644 subprojects/luajit/dynasm/dasm_ppc.h delete mode 100644 subprojects/luajit/dynasm/dasm_ppc.lua delete mode 100644 subprojects/luajit/dynasm/dasm_proto.h delete mode 100644 subprojects/luajit/dynasm/dasm_x64.lua delete mode 100644 subprojects/luajit/dynasm/dasm_x86.h delete mode 100644 subprojects/luajit/dynasm/dasm_x86.lua delete mode 100644 subprojects/luajit/dynasm/dynasm.lua delete mode 100644 subprojects/luajit/include/lauxlib.h delete mode 100644 subprojects/luajit/include/lua.h delete mode 100644 subprojects/luajit/include/lua.hpp delete mode 100644 subprojects/luajit/include/luaconf.h delete mode 100644 subprojects/luajit/include/luajit.h delete mode 100644 subprojects/luajit/include/lualib.h delete mode 100644 subprojects/luajit/src/host/README delete mode 100644 subprojects/luajit/src/host/buildvm.c delete mode 100644 subprojects/luajit/src/host/buildvm.h delete mode 100644 subprojects/luajit/src/host/buildvm_asm.c delete mode 100644 subprojects/luajit/src/host/buildvm_fold.c delete mode 100644 subprojects/luajit/src/host/buildvm_lib.c delete mode 100644 subprojects/luajit/src/host/buildvm_peobj.c delete mode 100644 subprojects/luajit/src/host/genminilua.lua delete mode 100644 subprojects/luajit/src/host/minilua.c delete mode 100644 subprojects/luajit/src/jit/bc.lua delete mode 100644 subprojects/luajit/src/jit/bcsave.lua delete mode 100644 subprojects/luajit/src/jit/dis_arm.lua delete mode 100644 subprojects/luajit/src/jit/dis_mips.lua delete mode 100644 subprojects/luajit/src/jit/dis_mipsel.lua delete mode 100644 subprojects/luajit/src/jit/dis_ppc.lua delete mode 100644 subprojects/luajit/src/jit/dis_x64.lua delete mode 100644 subprojects/luajit/src/jit/dis_x86.lua delete mode 100644 subprojects/luajit/src/jit/dump.lua delete mode 100644 subprojects/luajit/src/jit/v.lua delete mode 100644 subprojects/luajit/src/lauxlib.h delete mode 100644 subprojects/luajit/src/lib_aux.c delete mode 100644 subprojects/luajit/src/lib_base.c delete mode 100644 subprojects/luajit/src/lib_bit.c delete mode 100644 subprojects/luajit/src/lib_debug.c delete mode 100644 subprojects/luajit/src/lib_ffi.c delete mode 100644 subprojects/luajit/src/lib_init.c delete mode 100644 subprojects/luajit/src/lib_io.c delete mode 100644 subprojects/luajit/src/lib_jit.c delete mode 100644 subprojects/luajit/src/lib_math.c delete mode 100644 subprojects/luajit/src/lib_os.c delete mode 100644 subprojects/luajit/src/lib_package.c delete mode 100644 subprojects/luajit/src/lib_string.c delete mode 100644 subprojects/luajit/src/lib_table.c delete mode 100644 subprojects/luajit/src/lj.supp delete mode 100644 subprojects/luajit/src/lj_alloc.c delete mode 100644 subprojects/luajit/src/lj_alloc.h delete mode 100644 subprojects/luajit/src/lj_api.c delete mode 100644 subprojects/luajit/src/lj_arch.h delete mode 100644 subprojects/luajit/src/lj_asm.c delete mode 100644 subprojects/luajit/src/lj_asm.h delete mode 100644 subprojects/luajit/src/lj_asm_arm.h delete mode 100644 subprojects/luajit/src/lj_asm_mips.h delete mode 100644 subprojects/luajit/src/lj_asm_ppc.h delete mode 100644 subprojects/luajit/src/lj_asm_x86.h delete mode 100644 subprojects/luajit/src/lj_bc.c delete mode 100644 subprojects/luajit/src/lj_bc.h delete mode 100644 subprojects/luajit/src/lj_bcdump.h delete mode 100644 subprojects/luajit/src/lj_bcread.c delete mode 100644 subprojects/luajit/src/lj_bcwrite.c delete mode 100644 subprojects/luajit/src/lj_carith.c delete mode 100644 subprojects/luajit/src/lj_carith.h delete mode 100644 subprojects/luajit/src/lj_ccall.c delete mode 100644 subprojects/luajit/src/lj_ccall.h delete mode 100644 subprojects/luajit/src/lj_ccallback.c delete mode 100644 subprojects/luajit/src/lj_ccallback.h delete mode 100644 subprojects/luajit/src/lj_cconv.c delete mode 100644 subprojects/luajit/src/lj_cconv.h delete mode 100644 subprojects/luajit/src/lj_cdata.c delete mode 100644 subprojects/luajit/src/lj_cdata.h delete mode 100644 subprojects/luajit/src/lj_char.c delete mode 100644 subprojects/luajit/src/lj_char.h delete mode 100644 subprojects/luajit/src/lj_clib.c delete mode 100644 subprojects/luajit/src/lj_clib.h delete mode 100644 subprojects/luajit/src/lj_cparse.c delete mode 100644 subprojects/luajit/src/lj_cparse.h delete mode 100644 subprojects/luajit/src/lj_crecord.c delete mode 100644 subprojects/luajit/src/lj_crecord.h delete mode 100644 subprojects/luajit/src/lj_ctype.c delete mode 100644 subprojects/luajit/src/lj_ctype.h delete mode 100644 subprojects/luajit/src/lj_debug.c delete mode 100644 subprojects/luajit/src/lj_debug.h delete mode 100644 subprojects/luajit/src/lj_def.h delete mode 100644 subprojects/luajit/src/lj_dispatch.c delete mode 100644 subprojects/luajit/src/lj_dispatch.h delete mode 100644 subprojects/luajit/src/lj_emit_arm.h delete mode 100644 subprojects/luajit/src/lj_emit_mips.h delete mode 100644 subprojects/luajit/src/lj_emit_ppc.h delete mode 100644 subprojects/luajit/src/lj_emit_x86.h delete mode 100644 subprojects/luajit/src/lj_err.c delete mode 100644 subprojects/luajit/src/lj_err.h delete mode 100644 subprojects/luajit/src/lj_errmsg.h delete mode 100644 subprojects/luajit/src/lj_ff.h delete mode 100644 subprojects/luajit/src/lj_ffrecord.c delete mode 100644 subprojects/luajit/src/lj_ffrecord.h delete mode 100644 subprojects/luajit/src/lj_frame.h delete mode 100644 subprojects/luajit/src/lj_func.c delete mode 100644 subprojects/luajit/src/lj_func.h delete mode 100644 subprojects/luajit/src/lj_gc.c delete mode 100644 subprojects/luajit/src/lj_gc.h delete mode 100644 subprojects/luajit/src/lj_gdbjit.c delete mode 100644 subprojects/luajit/src/lj_gdbjit.h delete mode 100644 subprojects/luajit/src/lj_ir.c delete mode 100644 subprojects/luajit/src/lj_ir.h delete mode 100644 subprojects/luajit/src/lj_ircall.h delete mode 100644 subprojects/luajit/src/lj_iropt.h delete mode 100644 subprojects/luajit/src/lj_jit.h delete mode 100644 subprojects/luajit/src/lj_lex.c delete mode 100644 subprojects/luajit/src/lj_lex.h delete mode 100644 subprojects/luajit/src/lj_lib.c delete mode 100644 subprojects/luajit/src/lj_lib.h delete mode 100644 subprojects/luajit/src/lj_load.c delete mode 100644 subprojects/luajit/src/lj_mcode.c delete mode 100644 subprojects/luajit/src/lj_mcode.h delete mode 100644 subprojects/luajit/src/lj_meta.c delete mode 100644 subprojects/luajit/src/lj_meta.h delete mode 100644 subprojects/luajit/src/lj_obj.c delete mode 100644 subprojects/luajit/src/lj_obj.h delete mode 100644 subprojects/luajit/src/lj_opt_dce.c delete mode 100644 subprojects/luajit/src/lj_opt_fold.c delete mode 100644 subprojects/luajit/src/lj_opt_loop.c delete mode 100644 subprojects/luajit/src/lj_opt_mem.c delete mode 100644 subprojects/luajit/src/lj_opt_narrow.c delete mode 100644 subprojects/luajit/src/lj_opt_sink.c delete mode 100644 subprojects/luajit/src/lj_opt_split.c delete mode 100644 subprojects/luajit/src/lj_parse.c delete mode 100644 subprojects/luajit/src/lj_parse.h delete mode 100644 subprojects/luajit/src/lj_record.c delete mode 100644 subprojects/luajit/src/lj_record.h delete mode 100644 subprojects/luajit/src/lj_snap.c delete mode 100644 subprojects/luajit/src/lj_snap.h delete mode 100644 subprojects/luajit/src/lj_state.c delete mode 100644 subprojects/luajit/src/lj_state.h delete mode 100644 subprojects/luajit/src/lj_str.c delete mode 100644 subprojects/luajit/src/lj_str.h delete mode 100644 subprojects/luajit/src/lj_strscan.c delete mode 100644 subprojects/luajit/src/lj_strscan.h delete mode 100644 subprojects/luajit/src/lj_tab.c delete mode 100644 subprojects/luajit/src/lj_tab.h delete mode 100644 subprojects/luajit/src/lj_target.h delete mode 100644 subprojects/luajit/src/lj_target_arm.h delete mode 100644 subprojects/luajit/src/lj_target_mips.h delete mode 100644 subprojects/luajit/src/lj_target_ppc.h delete mode 100644 subprojects/luajit/src/lj_target_x86.h delete mode 100644 subprojects/luajit/src/lj_trace.c delete mode 100644 subprojects/luajit/src/lj_trace.h delete mode 100644 subprojects/luajit/src/lj_traceerr.h delete mode 100644 subprojects/luajit/src/lj_udata.c delete mode 100644 subprojects/luajit/src/lj_udata.h delete mode 100644 subprojects/luajit/src/lj_vm.h delete mode 100644 subprojects/luajit/src/lj_vmevent.c delete mode 100644 subprojects/luajit/src/lj_vmevent.h delete mode 100644 subprojects/luajit/src/lj_vmmath.c delete mode 100644 subprojects/luajit/src/ljamalg.c delete mode 100644 subprojects/luajit/src/lua.h delete mode 100644 subprojects/luajit/src/lua.hpp delete mode 100644 subprojects/luajit/src/luaconf.h delete mode 100644 subprojects/luajit/src/luajit.c delete mode 100644 subprojects/luajit/src/luajit.h delete mode 100644 subprojects/luajit/src/lualib.h delete mode 100644 subprojects/luajit/src/vm_arm.dasc delete mode 100644 subprojects/luajit/src/vm_mips.dasc delete mode 100644 subprojects/luajit/src/vm_ppc.dasc delete mode 100644 subprojects/luajit/src/vm_ppcspe.dasc delete mode 100644 subprojects/luajit/src/vm_x86.dasc rename subprojects/{ => packagefiles}/luajit/meson.build (85%) rename subprojects/{ => packagefiles}/luajit/src/host/meson.build (100%) rename subprojects/{ => packagefiles}/luajit/src/meson.build (94%) rename subprojects/{ => packagefiles}/luajit/unicode-io.patch (100%) rename subprojects/{ => packagefiles}/luajit/unicode-os.patch (100%) diff --git a/.gitignore b/.gitignore index 1b60e3f20..7fcada57b 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ subprojects/icu subprojects/libass subprojects/libffi* subprojects/libpng-* +subprojects/luajit subprojects/nasm-* subprojects/packagecache subprojects/proxy-libintl* diff --git a/meson.build b/meson.build index ac325ba9d..470eb81d4 100644 --- a/meson.build +++ b/meson.build @@ -277,7 +277,7 @@ endif if not deps.contains(luajit) luajit_sp = subproject('luajit') - luajit_inc = luajit_sp.get_variable('incdir') + luajit_inc = luajit_sp.get_variable('src_inc') deps += luajit_sp.get_variable('luajit_dep') else luajit_inc = include_directories(luajit.get_pkgconfig_variable('includedir')) diff --git a/subprojects/luajit.wrap b/subprojects/luajit.wrap new file mode 100644 index 000000000..e1daad5ab --- /dev/null +++ b/subprojects/luajit.wrap @@ -0,0 +1,8 @@ +[wrap-git] +directory = luajit +url = https://github.com/LuaJIT/LuaJIT.git +revision = v2.1 +patch_directory = luajit + +[provide] +luajit = luajit_dep diff --git a/subprojects/luajit/COPYRIGHT b/subprojects/luajit/COPYRIGHT deleted file mode 100644 index 1ef7df624..000000000 --- a/subprojects/luajit/COPYRIGHT +++ /dev/null @@ -1,56 +0,0 @@ -=============================================================================== -LuaJIT -- a Just-In-Time Compiler for Lua. http://luajit.org/ - -Copyright (C) 2005-2015 Mike Pall. All rights reserved. - -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 -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -[ MIT license: http://www.opensource.org/licenses/mit-license.php ] - -=============================================================================== -[ LuaJIT includes code from Lua 5.1/5.2, which has this license statement: ] - -Copyright (C) 1994-2012 Lua.org, PUC-Rio. - -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 -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -=============================================================================== -[ LuaJIT includes code from dlmalloc, which has this license statement: ] - -This is a version (aka dlmalloc) of malloc/free/realloc written by -Doug Lea and released to the public domain, as explained at -http://creativecommons.org/licenses/publicdomain - -=============================================================================== diff --git a/subprojects/luajit/README b/subprojects/luajit/README deleted file mode 100644 index 44366af51..000000000 --- a/subprojects/luajit/README +++ /dev/null @@ -1,16 +0,0 @@ -README for LuaJIT 2.0.4 ------------------------ - -LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. - -Project Homepage: http://luajit.org/ - -LuaJIT is Copyright (C) 2005-2015 Mike Pall. -LuaJIT is free software, released under the MIT license. -See full Copyright Notice in the COPYRIGHT file or in luajit.h. - -Documentation for LuaJIT is available in HTML format. -Please point your favorite browser to: - - doc/luajit.html - diff --git a/subprojects/luajit/dynasm/dasm_arm.h b/subprojects/luajit/dynasm/dasm_arm.h deleted file mode 100644 index a43f7c664..000000000 --- a/subprojects/luajit/dynasm/dasm_arm.h +++ /dev/null @@ -1,456 +0,0 @@ -/* -** DynASM ARM encoding engine. -** Copyright (C) 2005-2017 Mike Pall. All rights reserved. -** Released under the MIT license. See dynasm.lua for full copyright notice. -*/ - -#include -#include -#include -#include - -#define DASM_ARCH "arm" - -#ifndef DASM_EXTERN -#define DASM_EXTERN(a,b,c,d) 0 -#endif - -/* Action definitions. */ -enum { - DASM_STOP, DASM_SECTION, DASM_ESC, DASM_REL_EXT, - /* The following actions need a buffer position. */ - DASM_ALIGN, DASM_REL_LG, DASM_LABEL_LG, - /* The following actions also have an argument. */ - DASM_REL_PC, DASM_LABEL_PC, - DASM_IMM, DASM_IMM12, DASM_IMM16, DASM_IMML8, DASM_IMML12, DASM_IMMV8, - DASM__MAX -}; - -/* Maximum number of section buffer positions for a single dasm_put() call. */ -#define DASM_MAXSECPOS 25 - -/* DynASM encoder status codes. Action list offset or number are or'ed in. */ -#define DASM_S_OK 0x00000000 -#define DASM_S_NOMEM 0x01000000 -#define DASM_S_PHASE 0x02000000 -#define DASM_S_MATCH_SEC 0x03000000 -#define DASM_S_RANGE_I 0x11000000 -#define DASM_S_RANGE_SEC 0x12000000 -#define DASM_S_RANGE_LG 0x13000000 -#define DASM_S_RANGE_PC 0x14000000 -#define DASM_S_RANGE_REL 0x15000000 -#define DASM_S_UNDEF_LG 0x21000000 -#define DASM_S_UNDEF_PC 0x22000000 - -/* Macros to convert positions (8 bit section + 24 bit index). */ -#define DASM_POS2IDX(pos) ((pos)&0x00ffffff) -#define DASM_POS2BIAS(pos) ((pos)&0xff000000) -#define DASM_SEC2POS(sec) ((sec)<<24) -#define DASM_POS2SEC(pos) ((pos)>>24) -#define DASM_POS2PTR(D, pos) (D->sections[DASM_POS2SEC(pos)].rbuf + (pos)) - -/* Action list type. */ -typedef const unsigned int *dasm_ActList; - -/* Per-section structure. */ -typedef struct dasm_Section { - int *rbuf; /* Biased buffer pointer (negative section bias). */ - int *buf; /* True buffer pointer. */ - size_t bsize; /* Buffer size in bytes. */ - int pos; /* Biased buffer position. */ - int epos; /* End of biased buffer position - max single put. */ - int ofs; /* Byte offset into section. */ -} dasm_Section; - -/* Core structure holding the DynASM encoding state. */ -struct dasm_State { - size_t psize; /* Allocated size of this structure. */ - dasm_ActList actionlist; /* Current actionlist pointer. */ - int *lglabels; /* Local/global chain/pos ptrs. */ - size_t lgsize; - int *pclabels; /* PC label chains/pos ptrs. */ - size_t pcsize; - void **globals; /* Array of globals (bias -10). */ - dasm_Section *section; /* Pointer to active section. */ - size_t codesize; /* Total size of all code sections. */ - int maxsection; /* 0 <= sectionidx < maxsection. */ - int status; /* Status code. */ - dasm_Section sections[1]; /* All sections. Alloc-extended. */ -}; - -/* The size of the core structure depends on the max. number of sections. */ -#define DASM_PSZ(ms) (sizeof(dasm_State)+(ms-1)*sizeof(dasm_Section)) - - -/* Initialize DynASM state. */ -void dasm_init(Dst_DECL, int maxsection) -{ - dasm_State *D; - size_t psz = 0; - int i; - Dst_REF = NULL; - DASM_M_GROW(Dst, struct dasm_State, Dst_REF, psz, DASM_PSZ(maxsection)); - D = Dst_REF; - D->psize = psz; - D->lglabels = NULL; - D->lgsize = 0; - D->pclabels = NULL; - D->pcsize = 0; - D->globals = NULL; - D->maxsection = maxsection; - for (i = 0; i < maxsection; i++) { - D->sections[i].buf = NULL; /* Need this for pass3. */ - D->sections[i].rbuf = D->sections[i].buf - DASM_SEC2POS(i); - D->sections[i].bsize = 0; - D->sections[i].epos = 0; /* Wrong, but is recalculated after resize. */ - } -} - -/* Free DynASM state. */ -void dasm_free(Dst_DECL) -{ - dasm_State *D = Dst_REF; - int i; - for (i = 0; i < D->maxsection; i++) - if (D->sections[i].buf) - DASM_M_FREE(Dst, D->sections[i].buf, D->sections[i].bsize); - if (D->pclabels) DASM_M_FREE(Dst, D->pclabels, D->pcsize); - if (D->lglabels) DASM_M_FREE(Dst, D->lglabels, D->lgsize); - DASM_M_FREE(Dst, D, D->psize); -} - -/* Setup global label array. Must be called before dasm_setup(). */ -void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl) -{ - dasm_State *D = Dst_REF; - D->globals = gl - 10; /* Negative bias to compensate for locals. */ - DASM_M_GROW(Dst, int, D->lglabels, D->lgsize, (10+maxgl)*sizeof(int)); -} - -/* Grow PC label array. Can be called after dasm_setup(), too. */ -void dasm_growpc(Dst_DECL, unsigned int maxpc) -{ - dasm_State *D = Dst_REF; - size_t osz = D->pcsize; - DASM_M_GROW(Dst, int, D->pclabels, D->pcsize, maxpc*sizeof(int)); - memset((void *)(((unsigned char *)D->pclabels)+osz), 0, D->pcsize-osz); -} - -/* Setup encoder. */ -void dasm_setup(Dst_DECL, const void *actionlist) -{ - dasm_State *D = Dst_REF; - int i; - D->actionlist = (dasm_ActList)actionlist; - D->status = DASM_S_OK; - D->section = &D->sections[0]; - memset((void *)D->lglabels, 0, D->lgsize); - if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize); - for (i = 0; i < D->maxsection; i++) { - D->sections[i].pos = DASM_SEC2POS(i); - D->sections[i].ofs = 0; - } -} - - -#ifdef DASM_CHECKS -#define CK(x, st) \ - do { if (!(x)) { \ - D->status = DASM_S_##st|(p-D->actionlist-1); return; } } while (0) -#define CKPL(kind, st) \ - do { if ((size_t)((char *)pl-(char *)D->kind##labels) >= D->kind##size) { \ - D->status = DASM_S_RANGE_##st|(p-D->actionlist-1); return; } } while (0) -#else -#define CK(x, st) ((void)0) -#define CKPL(kind, st) ((void)0) -#endif - -static int dasm_imm12(unsigned int n) -{ - int i; - for (i = 0; i < 16; i++, n = (n << 2) | (n >> 30)) - if (n <= 255) return (int)(n + (i << 8)); - return -1; -} - -/* Pass 1: Store actions and args, link branches/labels, estimate offsets. */ -void dasm_put(Dst_DECL, int start, ...) -{ - va_list ap; - dasm_State *D = Dst_REF; - dasm_ActList p = D->actionlist + start; - dasm_Section *sec = D->section; - int pos = sec->pos, ofs = sec->ofs; - int *b; - - if (pos >= sec->epos) { - DASM_M_GROW(Dst, int, sec->buf, sec->bsize, - sec->bsize + 2*DASM_MAXSECPOS*sizeof(int)); - sec->rbuf = sec->buf - DASM_POS2BIAS(pos); - sec->epos = (int)sec->bsize/sizeof(int) - DASM_MAXSECPOS+DASM_POS2BIAS(pos); - } - - b = sec->rbuf; - b[pos++] = start; - - va_start(ap, start); - while (1) { - unsigned int ins = *p++; - unsigned int action = (ins >> 16); - if (action >= DASM__MAX) { - ofs += 4; - } else { - int *pl, n = action >= DASM_REL_PC ? va_arg(ap, int) : 0; - switch (action) { - case DASM_STOP: goto stop; - case DASM_SECTION: - n = (ins & 255); CK(n < D->maxsection, RANGE_SEC); - D->section = &D->sections[n]; goto stop; - case DASM_ESC: p++; ofs += 4; break; - case DASM_REL_EXT: break; - case DASM_ALIGN: ofs += (ins & 255); b[pos++] = ofs; break; - case DASM_REL_LG: - n = (ins & 2047) - 10; pl = D->lglabels + n; - /* Bkwd rel or global. */ - if (n >= 0) { CK(n>=10||*pl<0, RANGE_LG); CKPL(lg, LG); goto putrel; } - pl += 10; n = *pl; - if (n < 0) n = 0; /* Start new chain for fwd rel if label exists. */ - goto linkrel; - case DASM_REL_PC: - pl = D->pclabels + n; CKPL(pc, PC); - putrel: - n = *pl; - if (n < 0) { /* Label exists. Get label pos and store it. */ - b[pos] = -n; - } else { - linkrel: - b[pos] = n; /* Else link to rel chain, anchored at label. */ - *pl = pos; - } - pos++; - break; - case DASM_LABEL_LG: - pl = D->lglabels + (ins & 2047) - 10; CKPL(lg, LG); goto putlabel; - case DASM_LABEL_PC: - pl = D->pclabels + n; CKPL(pc, PC); - putlabel: - n = *pl; /* n > 0: Collapse rel chain and replace with label pos. */ - while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = pos; - } - *pl = -pos; /* Label exists now. */ - b[pos++] = ofs; /* Store pass1 offset estimate. */ - break; - case DASM_IMM: - case DASM_IMM16: -#ifdef DASM_CHECKS - CK((n & ((1<<((ins>>10)&31))-1)) == 0, RANGE_I); - if ((ins & 0x8000)) - CK(((n + (1<<(((ins>>5)&31)-1)))>>((ins>>5)&31)) == 0, RANGE_I); - else - CK((n>>((ins>>5)&31)) == 0, RANGE_I); -#endif - b[pos++] = n; - break; - case DASM_IMMV8: - CK((n & 3) == 0, RANGE_I); - n >>= 2; - case DASM_IMML8: - case DASM_IMML12: - CK(n >= 0 ? ((n>>((ins>>5)&31)) == 0) : - (((-n)>>((ins>>5)&31)) == 0), RANGE_I); - b[pos++] = n; - break; - case DASM_IMM12: - CK(dasm_imm12((unsigned int)n) != -1, RANGE_I); - b[pos++] = n; - break; - } - } - } -stop: - va_end(ap); - sec->pos = pos; - sec->ofs = ofs; -} -#undef CK - -/* Pass 2: Link sections, shrink aligns, fix label offsets. */ -int dasm_link(Dst_DECL, size_t *szp) -{ - dasm_State *D = Dst_REF; - int secnum; - int ofs = 0; - -#ifdef DASM_CHECKS - *szp = 0; - if (D->status != DASM_S_OK) return D->status; - { - int pc; - for (pc = 0; pc*sizeof(int) < D->pcsize; pc++) - if (D->pclabels[pc] > 0) return DASM_S_UNDEF_PC|pc; - } -#endif - - { /* Handle globals not defined in this translation unit. */ - int idx; - for (idx = 20; idx*sizeof(int) < D->lgsize; idx++) { - int n = D->lglabels[idx]; - /* Undefined label: Collapse rel chain and replace with marker (< 0). */ - while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = -idx; } - } - } - - /* Combine all code sections. No support for data sections (yet). */ - for (secnum = 0; secnum < D->maxsection; secnum++) { - dasm_Section *sec = D->sections + secnum; - int *b = sec->rbuf; - int pos = DASM_SEC2POS(secnum); - int lastpos = sec->pos; - - while (pos != lastpos) { - dasm_ActList p = D->actionlist + b[pos++]; - while (1) { - unsigned int ins = *p++; - unsigned int action = (ins >> 16); - switch (action) { - case DASM_STOP: case DASM_SECTION: goto stop; - case DASM_ESC: p++; break; - case DASM_REL_EXT: break; - case DASM_ALIGN: ofs -= (b[pos++] + ofs) & (ins & 255); break; - case DASM_REL_LG: case DASM_REL_PC: pos++; break; - case DASM_LABEL_LG: case DASM_LABEL_PC: b[pos++] += ofs; break; - case DASM_IMM: case DASM_IMM12: case DASM_IMM16: - case DASM_IMML8: case DASM_IMML12: case DASM_IMMV8: pos++; break; - } - } - stop: (void)0; - } - ofs += sec->ofs; /* Next section starts right after current section. */ - } - - D->codesize = ofs; /* Total size of all code sections */ - *szp = ofs; - return DASM_S_OK; -} - -#ifdef DASM_CHECKS -#define CK(x, st) \ - do { if (!(x)) return DASM_S_##st|(p-D->actionlist-1); } while (0) -#else -#define CK(x, st) ((void)0) -#endif - -/* Pass 3: Encode sections. */ -int dasm_encode(Dst_DECL, void *buffer) -{ - dasm_State *D = Dst_REF; - char *base = (char *)buffer; - unsigned int *cp = (unsigned int *)buffer; - int secnum; - - /* Encode all code sections. No support for data sections (yet). */ - for (secnum = 0; secnum < D->maxsection; secnum++) { - dasm_Section *sec = D->sections + secnum; - int *b = sec->buf; - int *endb = sec->rbuf + sec->pos; - - while (b != endb) { - dasm_ActList p = D->actionlist + *b++; - while (1) { - unsigned int ins = *p++; - unsigned int action = (ins >> 16); - int n = (action >= DASM_ALIGN && action < DASM__MAX) ? *b++ : 0; - switch (action) { - case DASM_STOP: case DASM_SECTION: goto stop; - case DASM_ESC: *cp++ = *p++; break; - case DASM_REL_EXT: - n = DASM_EXTERN(Dst, (unsigned char *)cp, (ins&2047), !(ins&2048)); - goto patchrel; - case DASM_ALIGN: - ins &= 255; while ((((char *)cp - base) & ins)) *cp++ = 0xe1a00000; - break; - case DASM_REL_LG: - CK(n >= 0, UNDEF_LG); - case DASM_REL_PC: - CK(n >= 0, UNDEF_PC); - n = *DASM_POS2PTR(D, n) - (int)((char *)cp - base) - 4; - patchrel: - if ((ins & 0x800) == 0) { - CK((n & 3) == 0 && ((n+0x02000000) >> 26) == 0, RANGE_REL); - cp[-1] |= ((n >> 2) & 0x00ffffff); - } else if ((ins & 0x1000)) { - CK((n & 3) == 0 && -256 <= n && n <= 256, RANGE_REL); - goto patchimml8; - } else if ((ins & 0x2000) == 0) { - CK((n & 3) == 0 && -4096 <= n && n <= 4096, RANGE_REL); - goto patchimml; - } else { - CK((n & 3) == 0 && -1020 <= n && n <= 1020, RANGE_REL); - n >>= 2; - goto patchimml; - } - break; - case DASM_LABEL_LG: - ins &= 2047; if (ins >= 20) D->globals[ins-10] = (void *)(base + n); - break; - case DASM_LABEL_PC: break; - case DASM_IMM: - cp[-1] |= ((n>>((ins>>10)&31)) & ((1<<((ins>>5)&31))-1)) << (ins&31); - break; - case DASM_IMM12: - cp[-1] |= dasm_imm12((unsigned int)n); - break; - case DASM_IMM16: - cp[-1] |= ((n & 0xf000) << 4) | (n & 0x0fff); - break; - case DASM_IMML8: patchimml8: - cp[-1] |= n >= 0 ? (0x00800000 | (n & 0x0f) | ((n & 0xf0) << 4)) : - ((-n & 0x0f) | ((-n & 0xf0) << 4)); - break; - case DASM_IMML12: case DASM_IMMV8: patchimml: - cp[-1] |= n >= 0 ? (0x00800000 | n) : (-n); - break; - default: *cp++ = ins; break; - } - } - stop: (void)0; - } - } - - if (base + D->codesize != (char *)cp) /* Check for phase errors. */ - return DASM_S_PHASE; - return DASM_S_OK; -} -#undef CK - -/* Get PC label offset. */ -int dasm_getpclabel(Dst_DECL, unsigned int pc) -{ - dasm_State *D = Dst_REF; - if (pc*sizeof(int) < D->pcsize) { - int pos = D->pclabels[pc]; - if (pos < 0) return *DASM_POS2PTR(D, -pos); - if (pos > 0) return -1; /* Undefined. */ - } - return -2; /* Unused or out of range. */ -} - -#ifdef DASM_CHECKS -/* Optional sanity checker to call between isolated encoding steps. */ -int dasm_checkstep(Dst_DECL, int secmatch) -{ - dasm_State *D = Dst_REF; - if (D->status == DASM_S_OK) { - int i; - for (i = 1; i <= 9; i++) { - if (D->lglabels[i] > 0) { D->status = DASM_S_UNDEF_LG|i; break; } - D->lglabels[i] = 0; - } - } - if (D->status == DASM_S_OK && secmatch >= 0 && - D->section != &D->sections[secmatch]) - D->status = DASM_S_MATCH_SEC|(D->section-D->sections); - return D->status; -} -#endif - diff --git a/subprojects/luajit/dynasm/dasm_arm.lua b/subprojects/luajit/dynasm/dasm_arm.lua deleted file mode 100644 index 9ece1d7f5..000000000 --- a/subprojects/luajit/dynasm/dasm_arm.lua +++ /dev/null @@ -1,1125 +0,0 @@ ------------------------------------------------------------------------------- --- DynASM ARM module. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------- - --- Module information: -local _info = { - arch = "arm", - description = "DynASM ARM module", - version = "1.3.0", - vernum = 10300, - release = "2011-05-05", - author = "Mike Pall", - license = "MIT", -} - --- Exported glue functions for the arch-specific module. -local _M = { _info = _info } - --- Cache library functions. -local type, tonumber, pairs, ipairs = type, tonumber, pairs, ipairs -local assert, setmetatable, rawget = assert, setmetatable, rawget -local _s = string -local sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char -local match, gmatch, gsub = _s.match, _s.gmatch, _s.gsub -local concat, sort, insert = table.concat, table.sort, table.insert -local bit = bit or require("bit") -local band, shl, shr, sar = bit.band, bit.lshift, bit.rshift, bit.arshift -local ror, tohex = bit.ror, bit.tohex - --- Inherited tables and callbacks. -local g_opt, g_arch -local wline, werror, wfatal, wwarn - --- Action name list. --- CHECK: Keep this in sync with the C code! -local action_names = { - "STOP", "SECTION", "ESC", "REL_EXT", - "ALIGN", "REL_LG", "LABEL_LG", - "REL_PC", "LABEL_PC", "IMM", "IMM12", "IMM16", "IMML8", "IMML12", "IMMV8", -} - --- Maximum number of section buffer positions for dasm_put(). --- CHECK: Keep this in sync with the C code! -local maxsecpos = 25 -- Keep this low, to avoid excessively long C lines. - --- Action name -> action number. -local map_action = {} -for n,name in ipairs(action_names) do - map_action[name] = n-1 -end - --- Action list buffer. -local actlist = {} - --- Argument list for next dasm_put(). Start with offset 0 into action list. -local actargs = { 0 } - --- Current number of section buffer positions for dasm_put(). -local secpos = 1 - ------------------------------------------------------------------------------- - --- Dump action names and numbers. -local function dumpactions(out) - out:write("DynASM encoding engine action codes:\n") - for n,name in ipairs(action_names) do - local num = map_action[name] - out:write(format(" %-10s %02X %d\n", name, num, num)) - end - out:write("\n") -end - --- Write action list buffer as a huge static C array. -local function writeactions(out, name) - local nn = #actlist - if nn == 0 then nn = 1; actlist[0] = map_action.STOP end - out:write("static const unsigned int ", name, "[", nn, "] = {\n") - for i = 1,nn-1 do - assert(out:write("0x", tohex(actlist[i]), ",\n")) - end - assert(out:write("0x", tohex(actlist[nn]), "\n};\n\n")) -end - ------------------------------------------------------------------------------- - --- Add word to action list. -local function wputxw(n) - assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, "word out of range") - actlist[#actlist+1] = n -end - --- Add action to list with optional arg. Advance buffer pos, too. -local function waction(action, val, a, num) - local w = assert(map_action[action], "bad action name `"..action.."'") - wputxw(w * 0x10000 + (val or 0)) - if a then actargs[#actargs+1] = a end - if a or num then secpos = secpos + (num or 1) end -end - --- Flush action list (intervening C code or buffer pos overflow). -local function wflush(term) - if #actlist == actargs[1] then return end -- Nothing to flush. - if not term then waction("STOP") end -- Terminate action list. - wline(format("dasm_put(Dst, %s);", concat(actargs, ", ")), true) - actargs = { #actlist } -- Actionlist offset is 1st arg to next dasm_put(). - secpos = 1 -- The actionlist offset occupies a buffer position, too. -end - --- Put escaped word. -local function wputw(n) - if n <= 0x000fffff then waction("ESC") end - wputxw(n) -end - --- Reserve position for word. -local function wpos() - local pos = #actlist+1 - actlist[pos] = "" - return pos -end - --- Store word to reserved position. -local function wputpos(pos, n) - assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, "word out of range") - if n <= 0x000fffff then - insert(actlist, pos+1, n) - n = map_action.ESC * 0x10000 - end - actlist[pos] = n -end - ------------------------------------------------------------------------------- - --- Global label name -> global label number. With auto assignment on 1st use. -local next_global = 20 -local map_global = setmetatable({}, { __index = function(t, name) - if not match(name, "^[%a_][%w_]*$") then werror("bad global label") end - local n = next_global - if n > 2047 then werror("too many global labels") end - next_global = n + 1 - t[name] = n - return n -end}) - --- Dump global labels. -local function dumpglobals(out, lvl) - local t = {} - for name, n in pairs(map_global) do t[n] = name end - out:write("Global labels:\n") - for i=20,next_global-1 do - out:write(format(" %s\n", t[i])) - end - out:write("\n") -end - --- Write global label enum. -local function writeglobals(out, prefix) - local t = {} - for name, n in pairs(map_global) do t[n] = name end - out:write("enum {\n") - for i=20,next_global-1 do - out:write(" ", prefix, t[i], ",\n") - end - out:write(" ", prefix, "_MAX\n};\n") -end - --- Write global label names. -local function writeglobalnames(out, name) - local t = {} - for name, n in pairs(map_global) do t[n] = name end - out:write("static const char *const ", name, "[] = {\n") - for i=20,next_global-1 do - out:write(" \"", t[i], "\",\n") - end - out:write(" (const char *)0\n};\n") -end - ------------------------------------------------------------------------------- - --- Extern label name -> extern label number. With auto assignment on 1st use. -local next_extern = 0 -local map_extern_ = {} -local map_extern = setmetatable({}, { __index = function(t, name) - -- No restrictions on the name for now. - local n = next_extern - if n > 2047 then werror("too many extern labels") end - next_extern = n + 1 - t[name] = n - map_extern_[n] = name - return n -end}) - --- Dump extern labels. -local function dumpexterns(out, lvl) - out:write("Extern labels:\n") - for i=0,next_extern-1 do - out:write(format(" %s\n", map_extern_[i])) - end - out:write("\n") -end - --- Write extern label names. -local function writeexternnames(out, name) - out:write("static const char *const ", name, "[] = {\n") - for i=0,next_extern-1 do - out:write(" \"", map_extern_[i], "\",\n") - end - out:write(" (const char *)0\n};\n") -end - ------------------------------------------------------------------------------- - --- Arch-specific maps. - --- Ext. register name -> int. name. -local map_archdef = { sp = "r13", lr = "r14", pc = "r15", } - --- Int. register name -> ext. name. -local map_reg_rev = { r13 = "sp", r14 = "lr", r15 = "pc", } - -local map_type = {} -- Type name -> { ctype, reg } -local ctypenum = 0 -- Type number (for Dt... macros). - --- Reverse defines for registers. -function _M.revdef(s) - return map_reg_rev[s] or s -end - -local map_shift = { lsl = 0, lsr = 1, asr = 2, ror = 3, } - -local map_cond = { - eq = 0, ne = 1, cs = 2, cc = 3, mi = 4, pl = 5, vs = 6, vc = 7, - hi = 8, ls = 9, ge = 10, lt = 11, gt = 12, le = 13, al = 14, - hs = 2, lo = 3, -} - ------------------------------------------------------------------------------- - --- Template strings for ARM instructions. -local map_op = { - -- Basic data processing instructions. - and_3 = "e0000000DNPs", - eor_3 = "e0200000DNPs", - sub_3 = "e0400000DNPs", - rsb_3 = "e0600000DNPs", - add_3 = "e0800000DNPs", - adc_3 = "e0a00000DNPs", - sbc_3 = "e0c00000DNPs", - rsc_3 = "e0e00000DNPs", - tst_2 = "e1100000NP", - teq_2 = "e1300000NP", - cmp_2 = "e1500000NP", - cmn_2 = "e1700000NP", - orr_3 = "e1800000DNPs", - mov_2 = "e1a00000DPs", - bic_3 = "e1c00000DNPs", - mvn_2 = "e1e00000DPs", - - and_4 = "e0000000DNMps", - eor_4 = "e0200000DNMps", - sub_4 = "e0400000DNMps", - rsb_4 = "e0600000DNMps", - add_4 = "e0800000DNMps", - adc_4 = "e0a00000DNMps", - sbc_4 = "e0c00000DNMps", - rsc_4 = "e0e00000DNMps", - tst_3 = "e1100000NMp", - teq_3 = "e1300000NMp", - cmp_3 = "e1500000NMp", - cmn_3 = "e1700000NMp", - orr_4 = "e1800000DNMps", - mov_3 = "e1a00000DMps", - bic_4 = "e1c00000DNMps", - mvn_3 = "e1e00000DMps", - - lsl_3 = "e1a00000DMws", - lsr_3 = "e1a00020DMws", - asr_3 = "e1a00040DMws", - ror_3 = "e1a00060DMws", - rrx_2 = "e1a00060DMs", - - -- Multiply and multiply-accumulate. - mul_3 = "e0000090NMSs", - mla_4 = "e0200090NMSDs", - umaal_4 = "e0400090DNMSs", -- v6 - mls_4 = "e0600090DNMSs", -- v6T2 - umull_4 = "e0800090DNMSs", - umlal_4 = "e0a00090DNMSs", - smull_4 = "e0c00090DNMSs", - smlal_4 = "e0e00090DNMSs", - - -- Halfword multiply and multiply-accumulate. - smlabb_4 = "e1000080NMSD", -- v5TE - smlatb_4 = "e10000a0NMSD", -- v5TE - smlabt_4 = "e10000c0NMSD", -- v5TE - smlatt_4 = "e10000e0NMSD", -- v5TE - smlawb_4 = "e1200080NMSD", -- v5TE - smulwb_3 = "e12000a0NMS", -- v5TE - smlawt_4 = "e12000c0NMSD", -- v5TE - smulwt_3 = "e12000e0NMS", -- v5TE - smlalbb_4 = "e1400080NMSD", -- v5TE - smlaltb_4 = "e14000a0NMSD", -- v5TE - smlalbt_4 = "e14000c0NMSD", -- v5TE - smlaltt_4 = "e14000e0NMSD", -- v5TE - smulbb_3 = "e1600080NMS", -- v5TE - smultb_3 = "e16000a0NMS", -- v5TE - smulbt_3 = "e16000c0NMS", -- v5TE - smultt_3 = "e16000e0NMS", -- v5TE - - -- Miscellaneous data processing instructions. - clz_2 = "e16f0f10DM", -- v5T - rev_2 = "e6bf0f30DM", -- v6 - rev16_2 = "e6bf0fb0DM", -- v6 - revsh_2 = "e6ff0fb0DM", -- v6 - sel_3 = "e6800fb0DNM", -- v6 - usad8_3 = "e780f010NMS", -- v6 - usada8_4 = "e7800010NMSD", -- v6 - rbit_2 = "e6ff0f30DM", -- v6T2 - movw_2 = "e3000000DW", -- v6T2 - movt_2 = "e3400000DW", -- v6T2 - -- Note: the X encodes width-1, not width. - sbfx_4 = "e7a00050DMvX", -- v6T2 - ubfx_4 = "e7e00050DMvX", -- v6T2 - -- Note: the X encodes the msb field, not the width. - bfc_3 = "e7c0001fDvX", -- v6T2 - bfi_4 = "e7c00010DMvX", -- v6T2 - - -- Packing and unpacking instructions. - pkhbt_3 = "e6800010DNM", pkhbt_4 = "e6800010DNMv", -- v6 - pkhtb_3 = "e6800050DNM", pkhtb_4 = "e6800050DNMv", -- v6 - sxtab_3 = "e6a00070DNM", sxtab_4 = "e6a00070DNMv", -- v6 - sxtab16_3 = "e6800070DNM", sxtab16_4 = "e6800070DNMv", -- v6 - sxtah_3 = "e6b00070DNM", sxtah_4 = "e6b00070DNMv", -- v6 - sxtb_2 = "e6af0070DM", sxtb_3 = "e6af0070DMv", -- v6 - sxtb16_2 = "e68f0070DM", sxtb16_3 = "e68f0070DMv", -- v6 - sxth_2 = "e6bf0070DM", sxth_3 = "e6bf0070DMv", -- v6 - uxtab_3 = "e6e00070DNM", uxtab_4 = "e6e00070DNMv", -- v6 - uxtab16_3 = "e6c00070DNM", uxtab16_4 = "e6c00070DNMv", -- v6 - uxtah_3 = "e6f00070DNM", uxtah_4 = "e6f00070DNMv", -- v6 - uxtb_2 = "e6ef0070DM", uxtb_3 = "e6ef0070DMv", -- v6 - uxtb16_2 = "e6cf0070DM", uxtb16_3 = "e6cf0070DMv", -- v6 - uxth_2 = "e6ff0070DM", uxth_3 = "e6ff0070DMv", -- v6 - - -- Saturating instructions. - qadd_3 = "e1000050DMN", -- v5TE - qsub_3 = "e1200050DMN", -- v5TE - qdadd_3 = "e1400050DMN", -- v5TE - qdsub_3 = "e1600050DMN", -- v5TE - -- Note: the X for ssat* encodes sat_imm-1, not sat_imm. - ssat_3 = "e6a00010DXM", ssat_4 = "e6a00010DXMp", -- v6 - usat_3 = "e6e00010DXM", usat_4 = "e6e00010DXMp", -- v6 - ssat16_3 = "e6a00f30DXM", -- v6 - usat16_3 = "e6e00f30DXM", -- v6 - - -- Parallel addition and subtraction. - sadd16_3 = "e6100f10DNM", -- v6 - sasx_3 = "e6100f30DNM", -- v6 - ssax_3 = "e6100f50DNM", -- v6 - ssub16_3 = "e6100f70DNM", -- v6 - sadd8_3 = "e6100f90DNM", -- v6 - ssub8_3 = "e6100ff0DNM", -- v6 - qadd16_3 = "e6200f10DNM", -- v6 - qasx_3 = "e6200f30DNM", -- v6 - qsax_3 = "e6200f50DNM", -- v6 - qsub16_3 = "e6200f70DNM", -- v6 - qadd8_3 = "e6200f90DNM", -- v6 - qsub8_3 = "e6200ff0DNM", -- v6 - shadd16_3 = "e6300f10DNM", -- v6 - shasx_3 = "e6300f30DNM", -- v6 - shsax_3 = "e6300f50DNM", -- v6 - shsub16_3 = "e6300f70DNM", -- v6 - shadd8_3 = "e6300f90DNM", -- v6 - shsub8_3 = "e6300ff0DNM", -- v6 - uadd16_3 = "e6500f10DNM", -- v6 - uasx_3 = "e6500f30DNM", -- v6 - usax_3 = "e6500f50DNM", -- v6 - usub16_3 = "e6500f70DNM", -- v6 - uadd8_3 = "e6500f90DNM", -- v6 - usub8_3 = "e6500ff0DNM", -- v6 - uqadd16_3 = "e6600f10DNM", -- v6 - uqasx_3 = "e6600f30DNM", -- v6 - uqsax_3 = "e6600f50DNM", -- v6 - uqsub16_3 = "e6600f70DNM", -- v6 - uqadd8_3 = "e6600f90DNM", -- v6 - uqsub8_3 = "e6600ff0DNM", -- v6 - uhadd16_3 = "e6700f10DNM", -- v6 - uhasx_3 = "e6700f30DNM", -- v6 - uhsax_3 = "e6700f50DNM", -- v6 - uhsub16_3 = "e6700f70DNM", -- v6 - uhadd8_3 = "e6700f90DNM", -- v6 - uhsub8_3 = "e6700ff0DNM", -- v6 - - -- Load/store instructions. - str_2 = "e4000000DL", str_3 = "e4000000DL", str_4 = "e4000000DL", - strb_2 = "e4400000DL", strb_3 = "e4400000DL", strb_4 = "e4400000DL", - ldr_2 = "e4100000DL", ldr_3 = "e4100000DL", ldr_4 = "e4100000DL", - ldrb_2 = "e4500000DL", ldrb_3 = "e4500000DL", ldrb_4 = "e4500000DL", - strh_2 = "e00000b0DL", strh_3 = "e00000b0DL", - ldrh_2 = "e01000b0DL", ldrh_3 = "e01000b0DL", - ldrd_2 = "e00000d0DL", ldrd_3 = "e00000d0DL", -- v5TE - ldrsb_2 = "e01000d0DL", ldrsb_3 = "e01000d0DL", - strd_2 = "e00000f0DL", strd_3 = "e00000f0DL", -- v5TE - ldrsh_2 = "e01000f0DL", ldrsh_3 = "e01000f0DL", - - ldm_2 = "e8900000oR", ldmia_2 = "e8900000oR", ldmfd_2 = "e8900000oR", - ldmda_2 = "e8100000oR", ldmfa_2 = "e8100000oR", - ldmdb_2 = "e9100000oR", ldmea_2 = "e9100000oR", - ldmib_2 = "e9900000oR", ldmed_2 = "e9900000oR", - stm_2 = "e8800000oR", stmia_2 = "e8800000oR", stmfd_2 = "e8800000oR", - stmda_2 = "e8000000oR", stmfa_2 = "e8000000oR", - stmdb_2 = "e9000000oR", stmea_2 = "e9000000oR", - stmib_2 = "e9800000oR", stmed_2 = "e9800000oR", - pop_1 = "e8bd0000R", push_1 = "e92d0000R", - - -- Branch instructions. - b_1 = "ea000000B", - bl_1 = "eb000000B", - blx_1 = "e12fff30C", - bx_1 = "e12fff10M", - - -- Miscellaneous instructions. - nop_0 = "e1a00000", - mrs_1 = "e10f0000D", - bkpt_1 = "e1200070K", -- v5T - svc_1 = "ef000000T", swi_1 = "ef000000T", - ud_0 = "e7f001f0", - - -- VFP instructions. - ["vadd.f32_3"] = "ee300a00dnm", - ["vadd.f64_3"] = "ee300b00Gdnm", - ["vsub.f32_3"] = "ee300a40dnm", - ["vsub.f64_3"] = "ee300b40Gdnm", - ["vmul.f32_3"] = "ee200a00dnm", - ["vmul.f64_3"] = "ee200b00Gdnm", - ["vnmul.f32_3"] = "ee200a40dnm", - ["vnmul.f64_3"] = "ee200b40Gdnm", - ["vmla.f32_3"] = "ee000a00dnm", - ["vmla.f64_3"] = "ee000b00Gdnm", - ["vmls.f32_3"] = "ee000a40dnm", - ["vmls.f64_3"] = "ee000b40Gdnm", - ["vnmla.f32_3"] = "ee100a40dnm", - ["vnmla.f64_3"] = "ee100b40Gdnm", - ["vnmls.f32_3"] = "ee100a00dnm", - ["vnmls.f64_3"] = "ee100b00Gdnm", - ["vdiv.f32_3"] = "ee800a00dnm", - ["vdiv.f64_3"] = "ee800b00Gdnm", - - ["vabs.f32_2"] = "eeb00ac0dm", - ["vabs.f64_2"] = "eeb00bc0Gdm", - ["vneg.f32_2"] = "eeb10a40dm", - ["vneg.f64_2"] = "eeb10b40Gdm", - ["vsqrt.f32_2"] = "eeb10ac0dm", - ["vsqrt.f64_2"] = "eeb10bc0Gdm", - ["vcmp.f32_2"] = "eeb40a40dm", - ["vcmp.f64_2"] = "eeb40b40Gdm", - ["vcmpe.f32_2"] = "eeb40ac0dm", - ["vcmpe.f64_2"] = "eeb40bc0Gdm", - ["vcmpz.f32_1"] = "eeb50a40d", - ["vcmpz.f64_1"] = "eeb50b40Gd", - ["vcmpze.f32_1"] = "eeb50ac0d", - ["vcmpze.f64_1"] = "eeb50bc0Gd", - - vldr_2 = "ed100a00dl|ed100b00Gdl", - vstr_2 = "ed000a00dl|ed000b00Gdl", - vldm_2 = "ec900a00or", - vldmia_2 = "ec900a00or", - vldmdb_2 = "ed100a00or", - vpop_1 = "ecbd0a00r", - vstm_2 = "ec800a00or", - vstmia_2 = "ec800a00or", - vstmdb_2 = "ed000a00or", - vpush_1 = "ed2d0a00r", - - ["vmov.f32_2"] = "eeb00a40dm|eeb00a00dY", -- #imm is VFPv3 only - ["vmov.f64_2"] = "eeb00b40Gdm|eeb00b00GdY", -- #imm is VFPv3 only - vmov_2 = "ee100a10Dn|ee000a10nD", - vmov_3 = "ec500a10DNm|ec400a10mDN|ec500b10GDNm|ec400b10GmDN", - - vmrs_0 = "eef1fa10", - vmrs_1 = "eef10a10D", - vmsr_1 = "eee10a10D", - - ["vcvt.s32.f32_2"] = "eebd0ac0dm", - ["vcvt.s32.f64_2"] = "eebd0bc0dGm", - ["vcvt.u32.f32_2"] = "eebc0ac0dm", - ["vcvt.u32.f64_2"] = "eebc0bc0dGm", - ["vcvtr.s32.f32_2"] = "eebd0a40dm", - ["vcvtr.s32.f64_2"] = "eebd0b40dGm", - ["vcvtr.u32.f32_2"] = "eebc0a40dm", - ["vcvtr.u32.f64_2"] = "eebc0b40dGm", - ["vcvt.f32.s32_2"] = "eeb80ac0dm", - ["vcvt.f64.s32_2"] = "eeb80bc0GdFm", - ["vcvt.f32.u32_2"] = "eeb80a40dm", - ["vcvt.f64.u32_2"] = "eeb80b40GdFm", - ["vcvt.f32.f64_2"] = "eeb70bc0dGm", - ["vcvt.f64.f32_2"] = "eeb70ac0GdFm", - - -- VFPv4 only: - ["vfma.f32_3"] = "eea00a00dnm", - ["vfma.f64_3"] = "eea00b00Gdnm", - ["vfms.f32_3"] = "eea00a40dnm", - ["vfms.f64_3"] = "eea00b40Gdnm", - ["vfnma.f32_3"] = "ee900a40dnm", - ["vfnma.f64_3"] = "ee900b40Gdnm", - ["vfnms.f32_3"] = "ee900a00dnm", - ["vfnms.f64_3"] = "ee900b00Gdnm", - - -- NYI: Advanced SIMD instructions. - - -- NYI: I have no need for these instructions right now: - -- swp, swpb, strex, ldrex, strexd, ldrexd, strexb, ldrexb, strexh, ldrexh - -- msr, nopv6, yield, wfe, wfi, sev, dbg, bxj, smc, srs, rfe - -- cps, setend, pli, pld, pldw, clrex, dsb, dmb, isb - -- stc, ldc, mcr, mcr2, mrc, mrc2, mcrr, mcrr2, mrrc, mrrc2, cdp, cdp2 -} - --- Add mnemonics for "s" variants. -do - local t = {} - for k,v in pairs(map_op) do - if sub(v, -1) == "s" then - local v2 = sub(v, 1, 2)..char(byte(v, 3)+1)..sub(v, 4, -2) - t[sub(k, 1, -3).."s"..sub(k, -2)] = v2 - end - end - for k,v in pairs(t) do - map_op[k] = v - end -end - ------------------------------------------------------------------------------- - -local function parse_gpr(expr) - local tname, ovreg = match(expr, "^([%w_]+):(r1?[0-9])$") - local tp = map_type[tname or expr] - if tp then - local reg = ovreg or tp.reg - if not reg then - werror("type `"..(tname or expr).."' needs a register override") - end - expr = reg - end - local r = match(expr, "^r(1?[0-9])$") - if r then - r = tonumber(r) - if r <= 15 then return r, tp end - end - werror("bad register name `"..expr.."'") -end - -local function parse_gpr_pm(expr) - local pm, expr2 = match(expr, "^([+-]?)(.*)$") - return parse_gpr(expr2), (pm == "-") -end - -local function parse_vr(expr, tp) - local t, r = match(expr, "^([sd])([0-9]+)$") - if t == tp then - r = tonumber(r) - if r <= 31 then - if t == "s" then return shr(r, 1), band(r, 1) end - return band(r, 15), shr(r, 4) - end - end - werror("bad register name `"..expr.."'") -end - -local function parse_reglist(reglist) - reglist = match(reglist, "^{%s*([^}]*)}$") - if not reglist then werror("register list expected") end - local rr = 0 - for p in gmatch(reglist..",", "%s*([^,]*),") do - local rbit = shl(1, parse_gpr(gsub(p, "%s+$", ""))) - if band(rr, rbit) ~= 0 then - werror("duplicate register `"..p.."'") - end - rr = rr + rbit - end - return rr -end - -local function parse_vrlist(reglist) - local ta, ra, tb, rb = match(reglist, - "^{%s*([sd])([0-9]+)%s*%-%s*([sd])([0-9]+)%s*}$") - ra, rb = tonumber(ra), tonumber(rb) - if ta and ta == tb and ra and rb and ra <= 31 and rb <= 31 and ra <= rb then - local nr = rb+1 - ra - if ta == "s" then - return shl(shr(ra,1),12)+shl(band(ra,1),22) + nr - else - return shl(band(ra,15),12)+shl(shr(ra,4),22) + nr*2 + 0x100 - end - end - werror("register list expected") -end - -local function parse_imm(imm, bits, shift, scale, signed) - imm = match(imm, "^#(.*)$") - if not imm then werror("expected immediate operand") end - local n = tonumber(imm) - if n then - local m = sar(n, scale) - if shl(m, scale) == n then - if signed then - local s = sar(m, bits-1) - if s == 0 then return shl(m, shift) - elseif s == -1 then return shl(m + shl(1, bits), shift) end - else - if sar(m, bits) == 0 then return shl(m, shift) end - end - end - werror("out of range immediate `"..imm.."'") - else - waction("IMM", (signed and 32768 or 0)+scale*1024+bits*32+shift, imm) - return 0 - end -end - -local function parse_imm12(imm) - local n = tonumber(imm) - if n then - local m = band(n) - for i=0,-15,-1 do - if shr(m, 8) == 0 then return m + shl(band(i, 15), 8) end - m = ror(m, 2) - end - werror("out of range immediate `"..imm.."'") - else - waction("IMM12", 0, imm) - return 0 - end -end - -local function parse_imm16(imm) - imm = match(imm, "^#(.*)$") - if not imm then werror("expected immediate operand") end - local n = tonumber(imm) - if n then - if shr(n, 16) == 0 then return band(n, 0x0fff) + shl(band(n, 0xf000), 4) end - werror("out of range immediate `"..imm.."'") - else - waction("IMM16", 32*16, imm) - return 0 - end -end - -local function parse_imm_load(imm, ext) - local n = tonumber(imm) - if n then - if ext then - if n >= -255 and n <= 255 then - local up = 0x00800000 - if n < 0 then n = -n; up = 0 end - return shl(band(n, 0xf0), 4) + band(n, 0x0f) + up - end - else - if n >= -4095 and n <= 4095 then - if n >= 0 then return n+0x00800000 end - return -n - end - end - werror("out of range immediate `"..imm.."'") - else - waction(ext and "IMML8" or "IMML12", 32768 + shl(ext and 8 or 12, 5), imm) - return 0 - end -end - -local function parse_shift(shift, gprok) - if shift == "rrx" then - return 3 * 32 - else - local s, s2 = match(shift, "^(%S+)%s*(.*)$") - s = map_shift[s] - if not s then werror("expected shift operand") end - if sub(s2, 1, 1) == "#" then - return parse_imm(s2, 5, 7, 0, false) + shl(s, 5) - else - if not gprok then werror("expected immediate shift operand") end - return shl(parse_gpr(s2), 8) + shl(s, 5) + 16 - end - end -end - -local function parse_label(label, def) - local prefix = sub(label, 1, 2) - -- =>label (pc label reference) - if prefix == "=>" then - return "PC", 0, sub(label, 3) - end - -- ->name (global label reference) - if prefix == "->" then - return "LG", map_global[sub(label, 3)] - end - if def then - -- [1-9] (local label definition) - if match(label, "^[1-9]$") then - return "LG", 10+tonumber(label) - end - else - -- [<>][1-9] (local label reference) - local dir, lnum = match(label, "^([<>])([1-9])$") - if dir then -- Fwd: 1-9, Bkwd: 11-19. - return "LG", lnum + (dir == ">" and 0 or 10) - end - -- extern label (extern label reference) - local extname = match(label, "^extern%s+(%S+)$") - if extname then - return "EXT", map_extern[extname] - end - end - werror("bad label `"..label.."'") -end - -local function parse_load(params, nparams, n, op) - local oplo = band(op, 255) - local ext, ldrd = (oplo ~= 0), (oplo == 208) - local d - if (ldrd or oplo == 240) then - d = band(shr(op, 12), 15) - if band(d, 1) ~= 0 then werror("odd destination register") end - end - local pn = params[n] - local p1, wb = match(pn, "^%[%s*(.-)%s*%](!?)$") - local p2 = params[n+1] - if not p1 then - if not p2 then - if match(pn, "^[<>=%-]") or match(pn, "^extern%s+") then - local mode, n, s = parse_label(pn, false) - waction("REL_"..mode, n + (ext and 0x1800 or 0x0800), s, 1) - return op + 15 * 65536 + 0x01000000 + (ext and 0x00400000 or 0) - end - local reg, tailr = match(pn, "^([%w_:]+)%s*(.*)$") - if reg and tailr ~= "" then - local d, tp = parse_gpr(reg) - if tp then - waction(ext and "IMML8" or "IMML12", 32768 + 32*(ext and 8 or 12), - format(tp.ctypefmt, tailr)) - return op + shl(d, 16) + 0x01000000 + (ext and 0x00400000 or 0) - end - end - end - werror("expected address operand") - end - if wb == "!" then op = op + 0x00200000 end - if p2 then - if wb == "!" then werror("bad use of '!'") end - local p3 = params[n+2] - op = op + shl(parse_gpr(p1), 16) - local imm = match(p2, "^#(.*)$") - if imm then - local m = parse_imm_load(imm, ext) - if p3 then werror("too many parameters") end - op = op + m + (ext and 0x00400000 or 0) - else - local m, neg = parse_gpr_pm(p2) - if ldrd and (m == d or m-1 == d) then werror("register conflict") end - op = op + m + (neg and 0 or 0x00800000) + (ext and 0 or 0x02000000) - if p3 then op = op + parse_shift(p3) end - end - else - local p1a, p2 = match(p1, "^([^,%s]*)%s*(.*)$") - op = op + shl(parse_gpr(p1a), 16) + 0x01000000 - if p2 ~= "" then - local imm = match(p2, "^,%s*#(.*)$") - if imm then - local m = parse_imm_load(imm, ext) - op = op + m + (ext and 0x00400000 or 0) - else - local p2a, p3 = match(p2, "^,%s*([^,%s]*)%s*,?%s*(.*)$") - local m, neg = parse_gpr_pm(p2a) - if ldrd and (m == d or m-1 == d) then werror("register conflict") end - op = op + m + (neg and 0 or 0x00800000) + (ext and 0 or 0x02000000) - if p3 ~= "" then - if ext then werror("too many parameters") end - op = op + parse_shift(p3) - end - end - else - if wb == "!" then werror("bad use of '!'") end - op = op + (ext and 0x00c00000 or 0x00800000) - end - end - return op -end - -local function parse_vload(q) - local reg, imm = match(q, "^%[%s*([^,%s]*)%s*(.*)%]$") - if reg then - local d = shl(parse_gpr(reg), 16) - if imm == "" then return d end - imm = match(imm, "^,%s*#(.*)$") - if imm then - local n = tonumber(imm) - if n then - if n >= -1020 and n <= 1020 and n%4 == 0 then - return d + (n >= 0 and n/4+0x00800000 or -n/4) - end - werror("out of range immediate `"..imm.."'") - else - waction("IMMV8", 32768 + 32*8, imm) - return d - end - end - else - if match(q, "^[<>=%-]") or match(q, "^extern%s+") then - local mode, n, s = parse_label(q, false) - waction("REL_"..mode, n + 0x2800, s, 1) - return 15 * 65536 - end - local reg, tailr = match(q, "^([%w_:]+)%s*(.*)$") - if reg and tailr ~= "" then - local d, tp = parse_gpr(reg) - if tp then - waction("IMMV8", 32768 + 32*8, format(tp.ctypefmt, tailr)) - return shl(d, 16) - end - end - end - werror("expected address operand") -end - ------------------------------------------------------------------------------- - --- Handle opcodes defined with template strings. -local function parse_template(params, template, nparams, pos) - local op = tonumber(sub(template, 1, 8), 16) - local n = 1 - local vr = "s" - - -- Process each character. - for p in gmatch(sub(template, 9), ".") do - local q = params[n] - if p == "D" then - op = op + shl(parse_gpr(q), 12); n = n + 1 - elseif p == "N" then - op = op + shl(parse_gpr(q), 16); n = n + 1 - elseif p == "S" then - op = op + shl(parse_gpr(q), 8); n = n + 1 - elseif p == "M" then - op = op + parse_gpr(q); n = n + 1 - elseif p == "d" then - local r,h = parse_vr(q, vr); op = op+shl(r,12)+shl(h,22); n = n + 1 - elseif p == "n" then - local r,h = parse_vr(q, vr); op = op+shl(r,16)+shl(h,7); n = n + 1 - elseif p == "m" then - local r,h = parse_vr(q, vr); op = op+r+shl(h,5); n = n + 1 - elseif p == "P" then - local imm = match(q, "^#(.*)$") - if imm then - op = op + parse_imm12(imm) + 0x02000000 - else - op = op + parse_gpr(q) - end - n = n + 1 - elseif p == "p" then - op = op + parse_shift(q, true); n = n + 1 - elseif p == "L" then - op = parse_load(params, nparams, n, op) - elseif p == "l" then - op = op + parse_vload(q) - elseif p == "B" then - local mode, n, s = parse_label(q, false) - waction("REL_"..mode, n, s, 1) - elseif p == "C" then -- blx gpr vs. blx label. - if match(q, "^([%w_]+):(r1?[0-9])$") or match(q, "^r(1?[0-9])$") then - op = op + parse_gpr(q) - else - if op < 0xe0000000 then werror("unconditional instruction") end - local mode, n, s = parse_label(q, false) - waction("REL_"..mode, n, s, 1) - op = 0xfa000000 - end - elseif p == "F" then - vr = "s" - elseif p == "G" then - vr = "d" - elseif p == "o" then - local r, wb = match(q, "^([^!]*)(!?)$") - op = op + shl(parse_gpr(r), 16) + (wb == "!" and 0x00200000 or 0) - n = n + 1 - elseif p == "R" then - op = op + parse_reglist(q); n = n + 1 - elseif p == "r" then - op = op + parse_vrlist(q); n = n + 1 - elseif p == "W" then - op = op + parse_imm16(q); n = n + 1 - elseif p == "v" then - op = op + parse_imm(q, 5, 7, 0, false); n = n + 1 - elseif p == "w" then - local imm = match(q, "^#(.*)$") - if imm then - op = op + parse_imm(q, 5, 7, 0, false); n = n + 1 - else - op = op + shl(parse_gpr(q), 8) + 16 - end - elseif p == "X" then - op = op + parse_imm(q, 5, 16, 0, false); n = n + 1 - elseif p == "Y" then - local imm = tonumber(match(q, "^#(.*)$")); n = n + 1 - if not imm or shr(imm, 8) ~= 0 then - werror("bad immediate operand") - end - op = op + shl(band(imm, 0xf0), 12) + band(imm, 0x0f) - elseif p == "K" then - local imm = tonumber(match(q, "^#(.*)$")); n = n + 1 - if not imm or shr(imm, 16) ~= 0 then - werror("bad immediate operand") - end - op = op + shl(band(imm, 0xfff0), 4) + band(imm, 0x000f) - elseif p == "T" then - op = op + parse_imm(q, 24, 0, 0, false); n = n + 1 - elseif p == "s" then - -- Ignored. - else - assert(false) - end - end - wputpos(pos, op) -end - -map_op[".template__"] = function(params, template, nparams) - if not params then return template:gsub("%x%x%x%x%x%x%x%x", "") end - - -- Limit number of section buffer positions used by a single dasm_put(). - -- A single opcode needs a maximum of 3 positions. - if secpos+3 > maxsecpos then wflush() end - local pos = wpos() - local lpos, apos, spos = #actlist, #actargs, secpos - - local ok, err - for t in gmatch(template, "[^|]+") do - ok, err = pcall(parse_template, params, t, nparams, pos) - if ok then return end - secpos = spos - actlist[lpos+1] = nil - actlist[lpos+2] = nil - actlist[lpos+3] = nil - actargs[apos+1] = nil - actargs[apos+2] = nil - actargs[apos+3] = nil - end - error(err, 0) -end - ------------------------------------------------------------------------------- - --- Pseudo-opcode to mark the position where the action list is to be emitted. -map_op[".actionlist_1"] = function(params) - if not params then return "cvar" end - local name = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeactions(out, name) end) -end - --- Pseudo-opcode to mark the position where the global enum is to be emitted. -map_op[".globals_1"] = function(params) - if not params then return "prefix" end - local prefix = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeglobals(out, prefix) end) -end - --- Pseudo-opcode to mark the position where the global names are to be emitted. -map_op[".globalnames_1"] = function(params) - if not params then return "cvar" end - local name = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeglobalnames(out, name) end) -end - --- Pseudo-opcode to mark the position where the extern names are to be emitted. -map_op[".externnames_1"] = function(params) - if not params then return "cvar" end - local name = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeexternnames(out, name) end) -end - ------------------------------------------------------------------------------- - --- Label pseudo-opcode (converted from trailing colon form). -map_op[".label_1"] = function(params) - if not params then return "[1-9] | ->global | =>pcexpr" end - if secpos+1 > maxsecpos then wflush() end - local mode, n, s = parse_label(params[1], true) - if mode == "EXT" then werror("bad label definition") end - waction("LABEL_"..mode, n, s, 1) -end - ------------------------------------------------------------------------------- - --- Pseudo-opcodes for data storage. -map_op[".long_*"] = function(params) - if not params then return "imm..." end - for _,p in ipairs(params) do - local n = tonumber(p) - if not n then werror("bad immediate `"..p.."'") end - if n < 0 then n = n + 2^32 end - wputw(n) - if secpos+2 > maxsecpos then wflush() end - end -end - --- Alignment pseudo-opcode. -map_op[".align_1"] = function(params) - if not params then return "numpow2" end - if secpos+1 > maxsecpos then wflush() end - local align = tonumber(params[1]) - if align then - local x = align - -- Must be a power of 2 in the range (2 ... 256). - for i=1,8 do - x = x / 2 - if x == 1 then - waction("ALIGN", align-1, nil, 1) -- Action byte is 2**n-1. - return - end - end - end - werror("bad alignment") -end - ------------------------------------------------------------------------------- - --- Pseudo-opcode for (primitive) type definitions (map to C types). -map_op[".type_3"] = function(params, nparams) - if not params then - return nparams == 2 and "name, ctype" or "name, ctype, reg" - end - local name, ctype, reg = params[1], params[2], params[3] - if not match(name, "^[%a_][%w_]*$") then - werror("bad type name `"..name.."'") - end - local tp = map_type[name] - if tp then - werror("duplicate type `"..name.."'") - end - -- Add #type to defines. A bit unclean to put it in map_archdef. - map_archdef["#"..name] = "sizeof("..ctype..")" - -- Add new type and emit shortcut define. - local num = ctypenum + 1 - map_type[name] = { - ctype = ctype, - ctypefmt = format("Dt%X(%%s)", num), - reg = reg, - } - wline(format("#define Dt%X(_V) (int)(ptrdiff_t)&(((%s *)0)_V)", num, ctype)) - ctypenum = num -end -map_op[".type_2"] = map_op[".type_3"] - --- Dump type definitions. -local function dumptypes(out, lvl) - local t = {} - for name in pairs(map_type) do t[#t+1] = name end - sort(t) - out:write("Type definitions:\n") - for _,name in ipairs(t) do - local tp = map_type[name] - local reg = tp.reg or "" - out:write(format(" %-20s %-20s %s\n", name, tp.ctype, reg)) - end - out:write("\n") -end - ------------------------------------------------------------------------------- - --- Set the current section. -function _M.section(num) - waction("SECTION", num) - wflush(true) -- SECTION is a terminal action. -end - ------------------------------------------------------------------------------- - --- Dump architecture description. -function _M.dumparch(out) - out:write(format("DynASM %s version %s, released %s\n\n", - _info.arch, _info.version, _info.release)) - dumpactions(out) -end - --- Dump all user defined elements. -function _M.dumpdef(out, lvl) - dumptypes(out, lvl) - dumpglobals(out, lvl) - dumpexterns(out, lvl) -end - ------------------------------------------------------------------------------- - --- Pass callbacks from/to the DynASM core. -function _M.passcb(wl, we, wf, ww) - wline, werror, wfatal, wwarn = wl, we, wf, ww - return wflush -end - --- Setup the arch-specific module. -function _M.setup(arch, opt) - g_arch, g_opt = arch, opt -end - --- Merge the core maps and the arch-specific maps. -function _M.mergemaps(map_coreop, map_def) - setmetatable(map_op, { __index = function(t, k) - local v = map_coreop[k] - if v then return v end - local k1, cc, k2 = match(k, "^(.-)(..)([._].*)$") - local cv = map_cond[cc] - if cv then - local v = rawget(t, k1..k2) - if type(v) == "string" then - local scv = format("%x", cv) - return gsub(scv..sub(v, 2), "|e", "|"..scv) - end - end - end }) - setmetatable(map_def, { __index = map_archdef }) - return map_op, map_def -end - -return _M - ------------------------------------------------------------------------------- - diff --git a/subprojects/luajit/dynasm/dasm_mips.h b/subprojects/luajit/dynasm/dasm_mips.h deleted file mode 100644 index 7eac66948..000000000 --- a/subprojects/luajit/dynasm/dasm_mips.h +++ /dev/null @@ -1,416 +0,0 @@ -/* -** DynASM MIPS encoding engine. -** Copyright (C) 2005-2017 Mike Pall. All rights reserved. -** Released under the MIT license. See dynasm.lua for full copyright notice. -*/ - -#include -#include -#include -#include - -#define DASM_ARCH "mips" - -#ifndef DASM_EXTERN -#define DASM_EXTERN(a,b,c,d) 0 -#endif - -/* Action definitions. */ -enum { - DASM_STOP, DASM_SECTION, DASM_ESC, DASM_REL_EXT, - /* The following actions need a buffer position. */ - DASM_ALIGN, DASM_REL_LG, DASM_LABEL_LG, - /* The following actions also have an argument. */ - DASM_REL_PC, DASM_LABEL_PC, DASM_IMM, - DASM__MAX -}; - -/* Maximum number of section buffer positions for a single dasm_put() call. */ -#define DASM_MAXSECPOS 25 - -/* DynASM encoder status codes. Action list offset or number are or'ed in. */ -#define DASM_S_OK 0x00000000 -#define DASM_S_NOMEM 0x01000000 -#define DASM_S_PHASE 0x02000000 -#define DASM_S_MATCH_SEC 0x03000000 -#define DASM_S_RANGE_I 0x11000000 -#define DASM_S_RANGE_SEC 0x12000000 -#define DASM_S_RANGE_LG 0x13000000 -#define DASM_S_RANGE_PC 0x14000000 -#define DASM_S_RANGE_REL 0x15000000 -#define DASM_S_UNDEF_LG 0x21000000 -#define DASM_S_UNDEF_PC 0x22000000 - -/* Macros to convert positions (8 bit section + 24 bit index). */ -#define DASM_POS2IDX(pos) ((pos)&0x00ffffff) -#define DASM_POS2BIAS(pos) ((pos)&0xff000000) -#define DASM_SEC2POS(sec) ((sec)<<24) -#define DASM_POS2SEC(pos) ((pos)>>24) -#define DASM_POS2PTR(D, pos) (D->sections[DASM_POS2SEC(pos)].rbuf + (pos)) - -/* Action list type. */ -typedef const unsigned int *dasm_ActList; - -/* Per-section structure. */ -typedef struct dasm_Section { - int *rbuf; /* Biased buffer pointer (negative section bias). */ - int *buf; /* True buffer pointer. */ - size_t bsize; /* Buffer size in bytes. */ - int pos; /* Biased buffer position. */ - int epos; /* End of biased buffer position - max single put. */ - int ofs; /* Byte offset into section. */ -} dasm_Section; - -/* Core structure holding the DynASM encoding state. */ -struct dasm_State { - size_t psize; /* Allocated size of this structure. */ - dasm_ActList actionlist; /* Current actionlist pointer. */ - int *lglabels; /* Local/global chain/pos ptrs. */ - size_t lgsize; - int *pclabels; /* PC label chains/pos ptrs. */ - size_t pcsize; - void **globals; /* Array of globals (bias -10). */ - dasm_Section *section; /* Pointer to active section. */ - size_t codesize; /* Total size of all code sections. */ - int maxsection; /* 0 <= sectionidx < maxsection. */ - int status; /* Status code. */ - dasm_Section sections[1]; /* All sections. Alloc-extended. */ -}; - -/* The size of the core structure depends on the max. number of sections. */ -#define DASM_PSZ(ms) (sizeof(dasm_State)+(ms-1)*sizeof(dasm_Section)) - - -/* Initialize DynASM state. */ -void dasm_init(Dst_DECL, int maxsection) -{ - dasm_State *D; - size_t psz = 0; - int i; - Dst_REF = NULL; - DASM_M_GROW(Dst, struct dasm_State, Dst_REF, psz, DASM_PSZ(maxsection)); - D = Dst_REF; - D->psize = psz; - D->lglabels = NULL; - D->lgsize = 0; - D->pclabels = NULL; - D->pcsize = 0; - D->globals = NULL; - D->maxsection = maxsection; - for (i = 0; i < maxsection; i++) { - D->sections[i].buf = NULL; /* Need this for pass3. */ - D->sections[i].rbuf = D->sections[i].buf - DASM_SEC2POS(i); - D->sections[i].bsize = 0; - D->sections[i].epos = 0; /* Wrong, but is recalculated after resize. */ - } -} - -/* Free DynASM state. */ -void dasm_free(Dst_DECL) -{ - dasm_State *D = Dst_REF; - int i; - for (i = 0; i < D->maxsection; i++) - if (D->sections[i].buf) - DASM_M_FREE(Dst, D->sections[i].buf, D->sections[i].bsize); - if (D->pclabels) DASM_M_FREE(Dst, D->pclabels, D->pcsize); - if (D->lglabels) DASM_M_FREE(Dst, D->lglabels, D->lgsize); - DASM_M_FREE(Dst, D, D->psize); -} - -/* Setup global label array. Must be called before dasm_setup(). */ -void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl) -{ - dasm_State *D = Dst_REF; - D->globals = gl - 10; /* Negative bias to compensate for locals. */ - DASM_M_GROW(Dst, int, D->lglabels, D->lgsize, (10+maxgl)*sizeof(int)); -} - -/* Grow PC label array. Can be called after dasm_setup(), too. */ -void dasm_growpc(Dst_DECL, unsigned int maxpc) -{ - dasm_State *D = Dst_REF; - size_t osz = D->pcsize; - DASM_M_GROW(Dst, int, D->pclabels, D->pcsize, maxpc*sizeof(int)); - memset((void *)(((unsigned char *)D->pclabels)+osz), 0, D->pcsize-osz); -} - -/* Setup encoder. */ -void dasm_setup(Dst_DECL, const void *actionlist) -{ - dasm_State *D = Dst_REF; - int i; - D->actionlist = (dasm_ActList)actionlist; - D->status = DASM_S_OK; - D->section = &D->sections[0]; - memset((void *)D->lglabels, 0, D->lgsize); - if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize); - for (i = 0; i < D->maxsection; i++) { - D->sections[i].pos = DASM_SEC2POS(i); - D->sections[i].ofs = 0; - } -} - - -#ifdef DASM_CHECKS -#define CK(x, st) \ - do { if (!(x)) { \ - D->status = DASM_S_##st|(p-D->actionlist-1); return; } } while (0) -#define CKPL(kind, st) \ - do { if ((size_t)((char *)pl-(char *)D->kind##labels) >= D->kind##size) { \ - D->status = DASM_S_RANGE_##st|(p-D->actionlist-1); return; } } while (0) -#else -#define CK(x, st) ((void)0) -#define CKPL(kind, st) ((void)0) -#endif - -/* Pass 1: Store actions and args, link branches/labels, estimate offsets. */ -void dasm_put(Dst_DECL, int start, ...) -{ - va_list ap; - dasm_State *D = Dst_REF; - dasm_ActList p = D->actionlist + start; - dasm_Section *sec = D->section; - int pos = sec->pos, ofs = sec->ofs; - int *b; - - if (pos >= sec->epos) { - DASM_M_GROW(Dst, int, sec->buf, sec->bsize, - sec->bsize + 2*DASM_MAXSECPOS*sizeof(int)); - sec->rbuf = sec->buf - DASM_POS2BIAS(pos); - sec->epos = (int)sec->bsize/sizeof(int) - DASM_MAXSECPOS+DASM_POS2BIAS(pos); - } - - b = sec->rbuf; - b[pos++] = start; - - va_start(ap, start); - while (1) { - unsigned int ins = *p++; - unsigned int action = (ins >> 16) - 0xff00; - if (action >= DASM__MAX) { - ofs += 4; - } else { - int *pl, n = action >= DASM_REL_PC ? va_arg(ap, int) : 0; - switch (action) { - case DASM_STOP: goto stop; - case DASM_SECTION: - n = (ins & 255); CK(n < D->maxsection, RANGE_SEC); - D->section = &D->sections[n]; goto stop; - case DASM_ESC: p++; ofs += 4; break; - case DASM_REL_EXT: break; - case DASM_ALIGN: ofs += (ins & 255); b[pos++] = ofs; break; - case DASM_REL_LG: - n = (ins & 2047) - 10; pl = D->lglabels + n; - /* Bkwd rel or global. */ - if (n >= 0) { CK(n>=10||*pl<0, RANGE_LG); CKPL(lg, LG); goto putrel; } - pl += 10; n = *pl; - if (n < 0) n = 0; /* Start new chain for fwd rel if label exists. */ - goto linkrel; - case DASM_REL_PC: - pl = D->pclabels + n; CKPL(pc, PC); - putrel: - n = *pl; - if (n < 0) { /* Label exists. Get label pos and store it. */ - b[pos] = -n; - } else { - linkrel: - b[pos] = n; /* Else link to rel chain, anchored at label. */ - *pl = pos; - } - pos++; - break; - case DASM_LABEL_LG: - pl = D->lglabels + (ins & 2047) - 10; CKPL(lg, LG); goto putlabel; - case DASM_LABEL_PC: - pl = D->pclabels + n; CKPL(pc, PC); - putlabel: - n = *pl; /* n > 0: Collapse rel chain and replace with label pos. */ - while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = pos; - } - *pl = -pos; /* Label exists now. */ - b[pos++] = ofs; /* Store pass1 offset estimate. */ - break; - case DASM_IMM: -#ifdef DASM_CHECKS - CK((n & ((1<<((ins>>10)&31))-1)) == 0, RANGE_I); -#endif - n >>= ((ins>>10)&31); -#ifdef DASM_CHECKS - if (ins & 0x8000) - CK(((n + (1<<(((ins>>5)&31)-1)))>>((ins>>5)&31)) == 0, RANGE_I); - else - CK((n>>((ins>>5)&31)) == 0, RANGE_I); -#endif - b[pos++] = n; - break; - } - } - } -stop: - va_end(ap); - sec->pos = pos; - sec->ofs = ofs; -} -#undef CK - -/* Pass 2: Link sections, shrink aligns, fix label offsets. */ -int dasm_link(Dst_DECL, size_t *szp) -{ - dasm_State *D = Dst_REF; - int secnum; - int ofs = 0; - -#ifdef DASM_CHECKS - *szp = 0; - if (D->status != DASM_S_OK) return D->status; - { - int pc; - for (pc = 0; pc*sizeof(int) < D->pcsize; pc++) - if (D->pclabels[pc] > 0) return DASM_S_UNDEF_PC|pc; - } -#endif - - { /* Handle globals not defined in this translation unit. */ - int idx; - for (idx = 20; idx*sizeof(int) < D->lgsize; idx++) { - int n = D->lglabels[idx]; - /* Undefined label: Collapse rel chain and replace with marker (< 0). */ - while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = -idx; } - } - } - - /* Combine all code sections. No support for data sections (yet). */ - for (secnum = 0; secnum < D->maxsection; secnum++) { - dasm_Section *sec = D->sections + secnum; - int *b = sec->rbuf; - int pos = DASM_SEC2POS(secnum); - int lastpos = sec->pos; - - while (pos != lastpos) { - dasm_ActList p = D->actionlist + b[pos++]; - while (1) { - unsigned int ins = *p++; - unsigned int action = (ins >> 16) - 0xff00; - switch (action) { - case DASM_STOP: case DASM_SECTION: goto stop; - case DASM_ESC: p++; break; - case DASM_REL_EXT: break; - case DASM_ALIGN: ofs -= (b[pos++] + ofs) & (ins & 255); break; - case DASM_REL_LG: case DASM_REL_PC: pos++; break; - case DASM_LABEL_LG: case DASM_LABEL_PC: b[pos++] += ofs; break; - case DASM_IMM: pos++; break; - } - } - stop: (void)0; - } - ofs += sec->ofs; /* Next section starts right after current section. */ - } - - D->codesize = ofs; /* Total size of all code sections */ - *szp = ofs; - return DASM_S_OK; -} - -#ifdef DASM_CHECKS -#define CK(x, st) \ - do { if (!(x)) return DASM_S_##st|(p-D->actionlist-1); } while (0) -#else -#define CK(x, st) ((void)0) -#endif - -/* Pass 3: Encode sections. */ -int dasm_encode(Dst_DECL, void *buffer) -{ - dasm_State *D = Dst_REF; - char *base = (char *)buffer; - unsigned int *cp = (unsigned int *)buffer; - int secnum; - - /* Encode all code sections. No support for data sections (yet). */ - for (secnum = 0; secnum < D->maxsection; secnum++) { - dasm_Section *sec = D->sections + secnum; - int *b = sec->buf; - int *endb = sec->rbuf + sec->pos; - - while (b != endb) { - dasm_ActList p = D->actionlist + *b++; - while (1) { - unsigned int ins = *p++; - unsigned int action = (ins >> 16) - 0xff00; - int n = (action >= DASM_ALIGN && action < DASM__MAX) ? *b++ : 0; - switch (action) { - case DASM_STOP: case DASM_SECTION: goto stop; - case DASM_ESC: *cp++ = *p++; break; - case DASM_REL_EXT: - n = DASM_EXTERN(Dst, (unsigned char *)cp, (ins & 2047), 1); - goto patchrel; - case DASM_ALIGN: - ins &= 255; while ((((char *)cp - base) & ins)) *cp++ = 0x60000000; - break; - case DASM_REL_LG: - CK(n >= 0, UNDEF_LG); - case DASM_REL_PC: - CK(n >= 0, UNDEF_PC); - n = *DASM_POS2PTR(D, n); - if (ins & 2048) - n = n - (int)((char *)cp - base); - else - n = (n + (int)base) & 0x0fffffff; - patchrel: - CK((n & 3) == 0 && - ((n + ((ins & 2048) ? 0x00020000 : 0)) >> - ((ins & 2048) ? 18 : 28)) == 0, RANGE_REL); - cp[-1] |= ((n>>2) & ((ins & 2048) ? 0x0000ffff: 0x03ffffff)); - break; - case DASM_LABEL_LG: - ins &= 2047; if (ins >= 20) D->globals[ins-10] = (void *)(base + n); - break; - case DASM_LABEL_PC: break; - case DASM_IMM: - cp[-1] |= (n & ((1<<((ins>>5)&31))-1)) << (ins&31); - break; - default: *cp++ = ins; break; - } - } - stop: (void)0; - } - } - - if (base + D->codesize != (char *)cp) /* Check for phase errors. */ - return DASM_S_PHASE; - return DASM_S_OK; -} -#undef CK - -/* Get PC label offset. */ -int dasm_getpclabel(Dst_DECL, unsigned int pc) -{ - dasm_State *D = Dst_REF; - if (pc*sizeof(int) < D->pcsize) { - int pos = D->pclabels[pc]; - if (pos < 0) return *DASM_POS2PTR(D, -pos); - if (pos > 0) return -1; /* Undefined. */ - } - return -2; /* Unused or out of range. */ -} - -#ifdef DASM_CHECKS -/* Optional sanity checker to call between isolated encoding steps. */ -int dasm_checkstep(Dst_DECL, int secmatch) -{ - dasm_State *D = Dst_REF; - if (D->status == DASM_S_OK) { - int i; - for (i = 1; i <= 9; i++) { - if (D->lglabels[i] > 0) { D->status = DASM_S_UNDEF_LG|i; break; } - D->lglabels[i] = 0; - } - } - if (D->status == DASM_S_OK && secmatch >= 0 && - D->section != &D->sections[secmatch]) - D->status = DASM_S_MATCH_SEC|(D->section-D->sections); - return D->status; -} -#endif - diff --git a/subprojects/luajit/dynasm/dasm_mips.lua b/subprojects/luajit/dynasm/dasm_mips.lua deleted file mode 100644 index 8e250ceff..000000000 --- a/subprojects/luajit/dynasm/dasm_mips.lua +++ /dev/null @@ -1,953 +0,0 @@ ------------------------------------------------------------------------------- --- DynASM MIPS module. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------- - --- Module information: -local _info = { - arch = "mips", - description = "DynASM MIPS module", - version = "1.3.0", - vernum = 10300, - release = "2012-01-23", - author = "Mike Pall", - license = "MIT", -} - --- Exported glue functions for the arch-specific module. -local _M = { _info = _info } - --- Cache library functions. -local type, tonumber, pairs, ipairs = type, tonumber, pairs, ipairs -local assert, setmetatable = assert, setmetatable -local _s = string -local sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char -local match, gmatch = _s.match, _s.gmatch -local concat, sort = table.concat, table.sort -local bit = bit or require("bit") -local band, shl, sar, tohex = bit.band, bit.lshift, bit.arshift, bit.tohex - --- Inherited tables and callbacks. -local g_opt, g_arch -local wline, werror, wfatal, wwarn - --- Action name list. --- CHECK: Keep this in sync with the C code! -local action_names = { - "STOP", "SECTION", "ESC", "REL_EXT", - "ALIGN", "REL_LG", "LABEL_LG", - "REL_PC", "LABEL_PC", "IMM", -} - --- Maximum number of section buffer positions for dasm_put(). --- CHECK: Keep this in sync with the C code! -local maxsecpos = 25 -- Keep this low, to avoid excessively long C lines. - --- Action name -> action number. -local map_action = {} -for n,name in ipairs(action_names) do - map_action[name] = n-1 -end - --- Action list buffer. -local actlist = {} - --- Argument list for next dasm_put(). Start with offset 0 into action list. -local actargs = { 0 } - --- Current number of section buffer positions for dasm_put(). -local secpos = 1 - ------------------------------------------------------------------------------- - --- Dump action names and numbers. -local function dumpactions(out) - out:write("DynASM encoding engine action codes:\n") - for n,name in ipairs(action_names) do - local num = map_action[name] - out:write(format(" %-10s %02X %d\n", name, num, num)) - end - out:write("\n") -end - --- Write action list buffer as a huge static C array. -local function writeactions(out, name) - local nn = #actlist - if nn == 0 then nn = 1; actlist[0] = map_action.STOP end - out:write("static const unsigned int ", name, "[", nn, "] = {\n") - for i = 1,nn-1 do - assert(out:write("0x", tohex(actlist[i]), ",\n")) - end - assert(out:write("0x", tohex(actlist[nn]), "\n};\n\n")) -end - ------------------------------------------------------------------------------- - --- Add word to action list. -local function wputxw(n) - assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, "word out of range") - actlist[#actlist+1] = n -end - --- Add action to list with optional arg. Advance buffer pos, too. -local function waction(action, val, a, num) - local w = assert(map_action[action], "bad action name `"..action.."'") - wputxw(0xff000000 + w * 0x10000 + (val or 0)) - if a then actargs[#actargs+1] = a end - if a or num then secpos = secpos + (num or 1) end -end - --- Flush action list (intervening C code or buffer pos overflow). -local function wflush(term) - if #actlist == actargs[1] then return end -- Nothing to flush. - if not term then waction("STOP") end -- Terminate action list. - wline(format("dasm_put(Dst, %s);", concat(actargs, ", ")), true) - actargs = { #actlist } -- Actionlist offset is 1st arg to next dasm_put(). - secpos = 1 -- The actionlist offset occupies a buffer position, too. -end - --- Put escaped word. -local function wputw(n) - if n >= 0xff000000 then waction("ESC") end - wputxw(n) -end - --- Reserve position for word. -local function wpos() - local pos = #actlist+1 - actlist[pos] = "" - return pos -end - --- Store word to reserved position. -local function wputpos(pos, n) - assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, "word out of range") - actlist[pos] = n -end - ------------------------------------------------------------------------------- - --- Global label name -> global label number. With auto assignment on 1st use. -local next_global = 20 -local map_global = setmetatable({}, { __index = function(t, name) - if not match(name, "^[%a_][%w_]*$") then werror("bad global label") end - local n = next_global - if n > 2047 then werror("too many global labels") end - next_global = n + 1 - t[name] = n - return n -end}) - --- Dump global labels. -local function dumpglobals(out, lvl) - local t = {} - for name, n in pairs(map_global) do t[n] = name end - out:write("Global labels:\n") - for i=20,next_global-1 do - out:write(format(" %s\n", t[i])) - end - out:write("\n") -end - --- Write global label enum. -local function writeglobals(out, prefix) - local t = {} - for name, n in pairs(map_global) do t[n] = name end - out:write("enum {\n") - for i=20,next_global-1 do - out:write(" ", prefix, t[i], ",\n") - end - out:write(" ", prefix, "_MAX\n};\n") -end - --- Write global label names. -local function writeglobalnames(out, name) - local t = {} - for name, n in pairs(map_global) do t[n] = name end - out:write("static const char *const ", name, "[] = {\n") - for i=20,next_global-1 do - out:write(" \"", t[i], "\",\n") - end - out:write(" (const char *)0\n};\n") -end - ------------------------------------------------------------------------------- - --- Extern label name -> extern label number. With auto assignment on 1st use. -local next_extern = 0 -local map_extern_ = {} -local map_extern = setmetatable({}, { __index = function(t, name) - -- No restrictions on the name for now. - local n = next_extern - if n > 2047 then werror("too many extern labels") end - next_extern = n + 1 - t[name] = n - map_extern_[n] = name - return n -end}) - --- Dump extern labels. -local function dumpexterns(out, lvl) - out:write("Extern labels:\n") - for i=0,next_extern-1 do - out:write(format(" %s\n", map_extern_[i])) - end - out:write("\n") -end - --- Write extern label names. -local function writeexternnames(out, name) - out:write("static const char *const ", name, "[] = {\n") - for i=0,next_extern-1 do - out:write(" \"", map_extern_[i], "\",\n") - end - out:write(" (const char *)0\n};\n") -end - ------------------------------------------------------------------------------- - --- Arch-specific maps. -local map_archdef = { sp="r29", ra="r31" } -- Ext. register name -> int. name. - -local map_type = {} -- Type name -> { ctype, reg } -local ctypenum = 0 -- Type number (for Dt... macros). - --- Reverse defines for registers. -function _M.revdef(s) - if s == "r29" then return "sp" - elseif s == "r31" then return "ra" end - return s -end - ------------------------------------------------------------------------------- - --- Template strings for MIPS instructions. -local map_op = { - -- First-level opcodes. - j_1 = "08000000J", - jal_1 = "0c000000J", - b_1 = "10000000B", - beqz_2 = "10000000SB", - beq_3 = "10000000STB", - bnez_2 = "14000000SB", - bne_3 = "14000000STB", - blez_2 = "18000000SB", - bgtz_2 = "1c000000SB", - addi_3 = "20000000TSI", - li_2 = "24000000TI", - addiu_3 = "24000000TSI", - slti_3 = "28000000TSI", - sltiu_3 = "2c000000TSI", - andi_3 = "30000000TSU", - lu_2 = "34000000TU", - ori_3 = "34000000TSU", - xori_3 = "38000000TSU", - lui_2 = "3c000000TU", - beqzl_2 = "50000000SB", - beql_3 = "50000000STB", - bnezl_2 = "54000000SB", - bnel_3 = "54000000STB", - blezl_2 = "58000000SB", - bgtzl_2 = "5c000000SB", - lb_2 = "80000000TO", - lh_2 = "84000000TO", - lwl_2 = "88000000TO", - lw_2 = "8c000000TO", - lbu_2 = "90000000TO", - lhu_2 = "94000000TO", - lwr_2 = "98000000TO", - sb_2 = "a0000000TO", - sh_2 = "a4000000TO", - swl_2 = "a8000000TO", - sw_2 = "ac000000TO", - swr_2 = "b8000000TO", - cache_2 = "bc000000NO", - ll_2 = "c0000000TO", - lwc1_2 = "c4000000HO", - pref_2 = "cc000000NO", - ldc1_2 = "d4000000HO", - sc_2 = "e0000000TO", - swc1_2 = "e4000000HO", - sdc1_2 = "f4000000HO", - - -- Opcode SPECIAL. - nop_0 = "00000000", - sll_3 = "00000000DTA", - movf_2 = "00000001DS", - movf_3 = "00000001DSC", - movt_2 = "00010001DS", - movt_3 = "00010001DSC", - srl_3 = "00000002DTA", - rotr_3 = "00200002DTA", - sra_3 = "00000003DTA", - sllv_3 = "00000004DTS", - srlv_3 = "00000006DTS", - rotrv_3 = "00000046DTS", - srav_3 = "00000007DTS", - jr_1 = "00000008S", - jalr_1 = "0000f809S", - jalr_2 = "00000009DS", - movz_3 = "0000000aDST", - movn_3 = "0000000bDST", - syscall_0 = "0000000c", - syscall_1 = "0000000cY", - break_0 = "0000000d", - break_1 = "0000000dY", - sync_0 = "0000000f", - mfhi_1 = "00000010D", - mthi_1 = "00000011S", - mflo_1 = "00000012D", - mtlo_1 = "00000013S", - mult_2 = "00000018ST", - multu_2 = "00000019ST", - div_2 = "0000001aST", - divu_2 = "0000001bST", - add_3 = "00000020DST", - move_2 = "00000021DS", - addu_3 = "00000021DST", - sub_3 = "00000022DST", - negu_2 = "00000023DT", - subu_3 = "00000023DST", - and_3 = "00000024DST", - or_3 = "00000025DST", - xor_3 = "00000026DST", - not_2 = "00000027DS", - nor_3 = "00000027DST", - slt_3 = "0000002aDST", - sltu_3 = "0000002bDST", - tge_2 = "00000030ST", - tge_3 = "00000030STZ", - tgeu_2 = "00000031ST", - tgeu_3 = "00000031STZ", - tlt_2 = "00000032ST", - tlt_3 = "00000032STZ", - tltu_2 = "00000033ST", - tltu_3 = "00000033STZ", - teq_2 = "00000034ST", - teq_3 = "00000034STZ", - tne_2 = "00000036ST", - tne_3 = "00000036STZ", - - -- Opcode REGIMM. - bltz_2 = "04000000SB", - bgez_2 = "04010000SB", - bltzl_2 = "04020000SB", - bgezl_2 = "04030000SB", - tgei_2 = "04080000SI", - tgeiu_2 = "04090000SI", - tlti_2 = "040a0000SI", - tltiu_2 = "040b0000SI", - teqi_2 = "040c0000SI", - tnei_2 = "040e0000SI", - bltzal_2 = "04100000SB", - bal_1 = "04110000B", - bgezal_2 = "04110000SB", - bltzall_2 = "04120000SB", - bgezall_2 = "04130000SB", - synci_1 = "041f0000O", - - -- Opcode SPECIAL2. - madd_2 = "70000000ST", - maddu_2 = "70000001ST", - mul_3 = "70000002DST", - msub_2 = "70000004ST", - msubu_2 = "70000005ST", - clz_2 = "70000020DS=", - clo_2 = "70000021DS=", - sdbbp_0 = "7000003f", - sdbbp_1 = "7000003fY", - - -- Opcode SPECIAL3. - ext_4 = "7c000000TSAM", -- Note: last arg is msbd = size-1 - ins_4 = "7c000004TSAM", -- Note: last arg is msb = pos+size-1 - wsbh_2 = "7c0000a0DT", - seb_2 = "7c000420DT", - seh_2 = "7c000620DT", - rdhwr_2 = "7c00003bTD", - - -- Opcode COP0. - mfc0_2 = "40000000TD", - mfc0_3 = "40000000TDW", - mtc0_2 = "40800000TD", - mtc0_3 = "40800000TDW", - rdpgpr_2 = "41400000DT", - di_0 = "41606000", - di_1 = "41606000T", - ei_0 = "41606020", - ei_1 = "41606020T", - wrpgpr_2 = "41c00000DT", - tlbr_0 = "42000001", - tlbwi_0 = "42000002", - tlbwr_0 = "42000006", - tlbp_0 = "42000008", - eret_0 = "42000018", - deret_0 = "4200001f", - wait_0 = "42000020", - - -- Opcode COP1. - mfc1_2 = "44000000TG", - cfc1_2 = "44400000TG", - mfhc1_2 = "44600000TG", - mtc1_2 = "44800000TG", - ctc1_2 = "44c00000TG", - mthc1_2 = "44e00000TG", - - bc1f_1 = "45000000B", - bc1f_2 = "45000000CB", - bc1t_1 = "45010000B", - bc1t_2 = "45010000CB", - bc1fl_1 = "45020000B", - bc1fl_2 = "45020000CB", - bc1tl_1 = "45030000B", - bc1tl_2 = "45030000CB", - - ["add.s_3"] = "46000000FGH", - ["sub.s_3"] = "46000001FGH", - ["mul.s_3"] = "46000002FGH", - ["div.s_3"] = "46000003FGH", - ["sqrt.s_2"] = "46000004FG", - ["abs.s_2"] = "46000005FG", - ["mov.s_2"] = "46000006FG", - ["neg.s_2"] = "46000007FG", - ["round.l.s_2"] = "46000008FG", - ["trunc.l.s_2"] = "46000009FG", - ["ceil.l.s_2"] = "4600000aFG", - ["floor.l.s_2"] = "4600000bFG", - ["round.w.s_2"] = "4600000cFG", - ["trunc.w.s_2"] = "4600000dFG", - ["ceil.w.s_2"] = "4600000eFG", - ["floor.w.s_2"] = "4600000fFG", - ["movf.s_2"] = "46000011FG", - ["movf.s_3"] = "46000011FGC", - ["movt.s_2"] = "46010011FG", - ["movt.s_3"] = "46010011FGC", - ["movz.s_3"] = "46000012FGT", - ["movn.s_3"] = "46000013FGT", - ["recip.s_2"] = "46000015FG", - ["rsqrt.s_2"] = "46000016FG", - ["cvt.d.s_2"] = "46000021FG", - ["cvt.w.s_2"] = "46000024FG", - ["cvt.l.s_2"] = "46000025FG", - ["cvt.ps.s_3"] = "46000026FGH", - ["c.f.s_2"] = "46000030GH", - ["c.f.s_3"] = "46000030VGH", - ["c.un.s_2"] = "46000031GH", - ["c.un.s_3"] = "46000031VGH", - ["c.eq.s_2"] = "46000032GH", - ["c.eq.s_3"] = "46000032VGH", - ["c.ueq.s_2"] = "46000033GH", - ["c.ueq.s_3"] = "46000033VGH", - ["c.olt.s_2"] = "46000034GH", - ["c.olt.s_3"] = "46000034VGH", - ["c.ult.s_2"] = "46000035GH", - ["c.ult.s_3"] = "46000035VGH", - ["c.ole.s_2"] = "46000036GH", - ["c.ole.s_3"] = "46000036VGH", - ["c.ule.s_2"] = "46000037GH", - ["c.ule.s_3"] = "46000037VGH", - ["c.sf.s_2"] = "46000038GH", - ["c.sf.s_3"] = "46000038VGH", - ["c.ngle.s_2"] = "46000039GH", - ["c.ngle.s_3"] = "46000039VGH", - ["c.seq.s_2"] = "4600003aGH", - ["c.seq.s_3"] = "4600003aVGH", - ["c.ngl.s_2"] = "4600003bGH", - ["c.ngl.s_3"] = "4600003bVGH", - ["c.lt.s_2"] = "4600003cGH", - ["c.lt.s_3"] = "4600003cVGH", - ["c.nge.s_2"] = "4600003dGH", - ["c.nge.s_3"] = "4600003dVGH", - ["c.le.s_2"] = "4600003eGH", - ["c.le.s_3"] = "4600003eVGH", - ["c.ngt.s_2"] = "4600003fGH", - ["c.ngt.s_3"] = "4600003fVGH", - - ["add.d_3"] = "46200000FGH", - ["sub.d_3"] = "46200001FGH", - ["mul.d_3"] = "46200002FGH", - ["div.d_3"] = "46200003FGH", - ["sqrt.d_2"] = "46200004FG", - ["abs.d_2"] = "46200005FG", - ["mov.d_2"] = "46200006FG", - ["neg.d_2"] = "46200007FG", - ["round.l.d_2"] = "46200008FG", - ["trunc.l.d_2"] = "46200009FG", - ["ceil.l.d_2"] = "4620000aFG", - ["floor.l.d_2"] = "4620000bFG", - ["round.w.d_2"] = "4620000cFG", - ["trunc.w.d_2"] = "4620000dFG", - ["ceil.w.d_2"] = "4620000eFG", - ["floor.w.d_2"] = "4620000fFG", - ["movf.d_2"] = "46200011FG", - ["movf.d_3"] = "46200011FGC", - ["movt.d_2"] = "46210011FG", - ["movt.d_3"] = "46210011FGC", - ["movz.d_3"] = "46200012FGT", - ["movn.d_3"] = "46200013FGT", - ["recip.d_2"] = "46200015FG", - ["rsqrt.d_2"] = "46200016FG", - ["cvt.s.d_2"] = "46200020FG", - ["cvt.w.d_2"] = "46200024FG", - ["cvt.l.d_2"] = "46200025FG", - ["c.f.d_2"] = "46200030GH", - ["c.f.d_3"] = "46200030VGH", - ["c.un.d_2"] = "46200031GH", - ["c.un.d_3"] = "46200031VGH", - ["c.eq.d_2"] = "46200032GH", - ["c.eq.d_3"] = "46200032VGH", - ["c.ueq.d_2"] = "46200033GH", - ["c.ueq.d_3"] = "46200033VGH", - ["c.olt.d_2"] = "46200034GH", - ["c.olt.d_3"] = "46200034VGH", - ["c.ult.d_2"] = "46200035GH", - ["c.ult.d_3"] = "46200035VGH", - ["c.ole.d_2"] = "46200036GH", - ["c.ole.d_3"] = "46200036VGH", - ["c.ule.d_2"] = "46200037GH", - ["c.ule.d_3"] = "46200037VGH", - ["c.sf.d_2"] = "46200038GH", - ["c.sf.d_3"] = "46200038VGH", - ["c.ngle.d_2"] = "46200039GH", - ["c.ngle.d_3"] = "46200039VGH", - ["c.seq.d_2"] = "4620003aGH", - ["c.seq.d_3"] = "4620003aVGH", - ["c.ngl.d_2"] = "4620003bGH", - ["c.ngl.d_3"] = "4620003bVGH", - ["c.lt.d_2"] = "4620003cGH", - ["c.lt.d_3"] = "4620003cVGH", - ["c.nge.d_2"] = "4620003dGH", - ["c.nge.d_3"] = "4620003dVGH", - ["c.le.d_2"] = "4620003eGH", - ["c.le.d_3"] = "4620003eVGH", - ["c.ngt.d_2"] = "4620003fGH", - ["c.ngt.d_3"] = "4620003fVGH", - - ["add.ps_3"] = "46c00000FGH", - ["sub.ps_3"] = "46c00001FGH", - ["mul.ps_3"] = "46c00002FGH", - ["abs.ps_2"] = "46c00005FG", - ["mov.ps_2"] = "46c00006FG", - ["neg.ps_2"] = "46c00007FG", - ["movf.ps_2"] = "46c00011FG", - ["movf.ps_3"] = "46c00011FGC", - ["movt.ps_2"] = "46c10011FG", - ["movt.ps_3"] = "46c10011FGC", - ["movz.ps_3"] = "46c00012FGT", - ["movn.ps_3"] = "46c00013FGT", - ["cvt.s.pu_2"] = "46c00020FG", - ["cvt.s.pl_2"] = "46c00028FG", - ["pll.ps_3"] = "46c0002cFGH", - ["plu.ps_3"] = "46c0002dFGH", - ["pul.ps_3"] = "46c0002eFGH", - ["puu.ps_3"] = "46c0002fFGH", - ["c.f.ps_2"] = "46c00030GH", - ["c.f.ps_3"] = "46c00030VGH", - ["c.un.ps_2"] = "46c00031GH", - ["c.un.ps_3"] = "46c00031VGH", - ["c.eq.ps_2"] = "46c00032GH", - ["c.eq.ps_3"] = "46c00032VGH", - ["c.ueq.ps_2"] = "46c00033GH", - ["c.ueq.ps_3"] = "46c00033VGH", - ["c.olt.ps_2"] = "46c00034GH", - ["c.olt.ps_3"] = "46c00034VGH", - ["c.ult.ps_2"] = "46c00035GH", - ["c.ult.ps_3"] = "46c00035VGH", - ["c.ole.ps_2"] = "46c00036GH", - ["c.ole.ps_3"] = "46c00036VGH", - ["c.ule.ps_2"] = "46c00037GH", - ["c.ule.ps_3"] = "46c00037VGH", - ["c.sf.ps_2"] = "46c00038GH", - ["c.sf.ps_3"] = "46c00038VGH", - ["c.ngle.ps_2"] = "46c00039GH", - ["c.ngle.ps_3"] = "46c00039VGH", - ["c.seq.ps_2"] = "46c0003aGH", - ["c.seq.ps_3"] = "46c0003aVGH", - ["c.ngl.ps_2"] = "46c0003bGH", - ["c.ngl.ps_3"] = "46c0003bVGH", - ["c.lt.ps_2"] = "46c0003cGH", - ["c.lt.ps_3"] = "46c0003cVGH", - ["c.nge.ps_2"] = "46c0003dGH", - ["c.nge.ps_3"] = "46c0003dVGH", - ["c.le.ps_2"] = "46c0003eGH", - ["c.le.ps_3"] = "46c0003eVGH", - ["c.ngt.ps_2"] = "46c0003fGH", - ["c.ngt.ps_3"] = "46c0003fVGH", - - ["cvt.s.w_2"] = "46800020FG", - ["cvt.d.w_2"] = "46800021FG", - - ["cvt.s.l_2"] = "46a00020FG", - ["cvt.d.l_2"] = "46a00021FG", - - -- Opcode COP1X. - lwxc1_2 = "4c000000FX", - ldxc1_2 = "4c000001FX", - luxc1_2 = "4c000005FX", - swxc1_2 = "4c000008FX", - sdxc1_2 = "4c000009FX", - suxc1_2 = "4c00000dFX", - prefx_2 = "4c00000fMX", - ["alnv.ps_4"] = "4c00001eFGHS", - ["madd.s_4"] = "4c000020FRGH", - ["madd.d_4"] = "4c000021FRGH", - ["madd.ps_4"] = "4c000026FRGH", - ["msub.s_4"] = "4c000028FRGH", - ["msub.d_4"] = "4c000029FRGH", - ["msub.ps_4"] = "4c00002eFRGH", - ["nmadd.s_4"] = "4c000030FRGH", - ["nmadd.d_4"] = "4c000031FRGH", - ["nmadd.ps_4"] = "4c000036FRGH", - ["nmsub.s_4"] = "4c000038FRGH", - ["nmsub.d_4"] = "4c000039FRGH", - ["nmsub.ps_4"] = "4c00003eFRGH", -} - ------------------------------------------------------------------------------- - -local function parse_gpr(expr) - local tname, ovreg = match(expr, "^([%w_]+):(r[1-3]?[0-9])$") - local tp = map_type[tname or expr] - if tp then - local reg = ovreg or tp.reg - if not reg then - werror("type `"..(tname or expr).."' needs a register override") - end - expr = reg - end - local r = match(expr, "^r([1-3]?[0-9])$") - if r then - r = tonumber(r) - if r <= 31 then return r, tp end - end - werror("bad register name `"..expr.."'") -end - -local function parse_fpr(expr) - local r = match(expr, "^f([1-3]?[0-9])$") - if r then - r = tonumber(r) - if r <= 31 then return r end - end - werror("bad register name `"..expr.."'") -end - -local function parse_imm(imm, bits, shift, scale, signed) - local n = tonumber(imm) - if n then - local m = sar(n, scale) - if shl(m, scale) == n then - if signed then - local s = sar(m, bits-1) - if s == 0 then return shl(m, shift) - elseif s == -1 then return shl(m + shl(1, bits), shift) end - else - if sar(m, bits) == 0 then return shl(m, shift) end - end - end - werror("out of range immediate `"..imm.."'") - elseif match(imm, "^[rf]([1-3]?[0-9])$") or - match(imm, "^([%w_]+):([rf][1-3]?[0-9])$") then - werror("expected immediate operand, got register") - else - waction("IMM", (signed and 32768 or 0)+scale*1024+bits*32+shift, imm) - return 0 - end -end - -local function parse_disp(disp) - local imm, reg = match(disp, "^(.*)%(([%w_:]+)%)$") - if imm then - local r = shl(parse_gpr(reg), 21) - local extname = match(imm, "^extern%s+(%S+)$") - if extname then - waction("REL_EXT", map_extern[extname], nil, 1) - return r - else - return r + parse_imm(imm, 16, 0, 0, true) - end - end - local reg, tailr = match(disp, "^([%w_:]+)%s*(.*)$") - if reg and tailr ~= "" then - local r, tp = parse_gpr(reg) - if tp then - waction("IMM", 32768+16*32, format(tp.ctypefmt, tailr)) - return shl(r, 21) - end - end - werror("bad displacement `"..disp.."'") -end - -local function parse_index(idx) - local rt, rs = match(idx, "^(.*)%(([%w_:]+)%)$") - if rt then - rt = parse_gpr(rt) - rs = parse_gpr(rs) - return shl(rt, 16) + shl(rs, 21) - end - werror("bad index `"..idx.."'") -end - -local function parse_label(label, def) - local prefix = sub(label, 1, 2) - -- =>label (pc label reference) - if prefix == "=>" then - return "PC", 0, sub(label, 3) - end - -- ->name (global label reference) - if prefix == "->" then - return "LG", map_global[sub(label, 3)] - end - if def then - -- [1-9] (local label definition) - if match(label, "^[1-9]$") then - return "LG", 10+tonumber(label) - end - else - -- [<>][1-9] (local label reference) - local dir, lnum = match(label, "^([<>])([1-9])$") - if dir then -- Fwd: 1-9, Bkwd: 11-19. - return "LG", lnum + (dir == ">" and 0 or 10) - end - -- extern label (extern label reference) - local extname = match(label, "^extern%s+(%S+)$") - if extname then - return "EXT", map_extern[extname] - end - end - werror("bad label `"..label.."'") -end - ------------------------------------------------------------------------------- - --- Handle opcodes defined with template strings. -map_op[".template__"] = function(params, template, nparams) - if not params then return sub(template, 9) end - local op = tonumber(sub(template, 1, 8), 16) - local n = 1 - - -- Limit number of section buffer positions used by a single dasm_put(). - -- A single opcode needs a maximum of 2 positions (ins/ext). - if secpos+2 > maxsecpos then wflush() end - local pos = wpos() - - -- Process each character. - for p in gmatch(sub(template, 9), ".") do - if p == "D" then - op = op + shl(parse_gpr(params[n]), 11); n = n + 1 - elseif p == "T" then - op = op + shl(parse_gpr(params[n]), 16); n = n + 1 - elseif p == "S" then - op = op + shl(parse_gpr(params[n]), 21); n = n + 1 - elseif p == "F" then - op = op + shl(parse_fpr(params[n]), 6); n = n + 1 - elseif p == "G" then - op = op + shl(parse_fpr(params[n]), 11); n = n + 1 - elseif p == "H" then - op = op + shl(parse_fpr(params[n]), 16); n = n + 1 - elseif p == "R" then - op = op + shl(parse_fpr(params[n]), 21); n = n + 1 - elseif p == "I" then - op = op + parse_imm(params[n], 16, 0, 0, true); n = n + 1 - elseif p == "U" then - op = op + parse_imm(params[n], 16, 0, 0, false); n = n + 1 - elseif p == "O" then - op = op + parse_disp(params[n]); n = n + 1 - elseif p == "X" then - op = op + parse_index(params[n]); n = n + 1 - elseif p == "B" or p == "J" then - local mode, n, s = parse_label(params[n], false) - if p == "B" then n = n + 2048 end - waction("REL_"..mode, n, s, 1) - n = n + 1 - elseif p == "A" then - op = op + parse_imm(params[n], 5, 6, 0, false); n = n + 1 - elseif p == "M" then - op = op + parse_imm(params[n], 5, 11, 0, false); n = n + 1 - elseif p == "N" then - op = op + parse_imm(params[n], 5, 16, 0, false); n = n + 1 - elseif p == "C" then - op = op + parse_imm(params[n], 3, 18, 0, false); n = n + 1 - elseif p == "V" then - op = op + parse_imm(params[n], 3, 8, 0, false); n = n + 1 - elseif p == "W" then - op = op + parse_imm(params[n], 3, 0, 0, false); n = n + 1 - elseif p == "Y" then - op = op + parse_imm(params[n], 20, 6, 0, false); n = n + 1 - elseif p == "Z" then - op = op + parse_imm(params[n], 10, 6, 0, false); n = n + 1 - elseif p == "=" then - op = op + shl(band(op, 0xf800), 5) -- Copy D to T for clz, clo. - else - assert(false) - end - end - wputpos(pos, op) -end - ------------------------------------------------------------------------------- - --- Pseudo-opcode to mark the position where the action list is to be emitted. -map_op[".actionlist_1"] = function(params) - if not params then return "cvar" end - local name = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeactions(out, name) end) -end - --- Pseudo-opcode to mark the position where the global enum is to be emitted. -map_op[".globals_1"] = function(params) - if not params then return "prefix" end - local prefix = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeglobals(out, prefix) end) -end - --- Pseudo-opcode to mark the position where the global names are to be emitted. -map_op[".globalnames_1"] = function(params) - if not params then return "cvar" end - local name = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeglobalnames(out, name) end) -end - --- Pseudo-opcode to mark the position where the extern names are to be emitted. -map_op[".externnames_1"] = function(params) - if not params then return "cvar" end - local name = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeexternnames(out, name) end) -end - ------------------------------------------------------------------------------- - --- Label pseudo-opcode (converted from trailing colon form). -map_op[".label_1"] = function(params) - if not params then return "[1-9] | ->global | =>pcexpr" end - if secpos+1 > maxsecpos then wflush() end - local mode, n, s = parse_label(params[1], true) - if mode == "EXT" then werror("bad label definition") end - waction("LABEL_"..mode, n, s, 1) -end - ------------------------------------------------------------------------------- - --- Pseudo-opcodes for data storage. -map_op[".long_*"] = function(params) - if not params then return "imm..." end - for _,p in ipairs(params) do - local n = tonumber(p) - if not n then werror("bad immediate `"..p.."'") end - if n < 0 then n = n + 2^32 end - wputw(n) - if secpos+2 > maxsecpos then wflush() end - end -end - --- Alignment pseudo-opcode. -map_op[".align_1"] = function(params) - if not params then return "numpow2" end - if secpos+1 > maxsecpos then wflush() end - local align = tonumber(params[1]) - if align then - local x = align - -- Must be a power of 2 in the range (2 ... 256). - for i=1,8 do - x = x / 2 - if x == 1 then - waction("ALIGN", align-1, nil, 1) -- Action byte is 2**n-1. - return - end - end - end - werror("bad alignment") -end - ------------------------------------------------------------------------------- - --- Pseudo-opcode for (primitive) type definitions (map to C types). -map_op[".type_3"] = function(params, nparams) - if not params then - return nparams == 2 and "name, ctype" or "name, ctype, reg" - end - local name, ctype, reg = params[1], params[2], params[3] - if not match(name, "^[%a_][%w_]*$") then - werror("bad type name `"..name.."'") - end - local tp = map_type[name] - if tp then - werror("duplicate type `"..name.."'") - end - -- Add #type to defines. A bit unclean to put it in map_archdef. - map_archdef["#"..name] = "sizeof("..ctype..")" - -- Add new type and emit shortcut define. - local num = ctypenum + 1 - map_type[name] = { - ctype = ctype, - ctypefmt = format("Dt%X(%%s)", num), - reg = reg, - } - wline(format("#define Dt%X(_V) (int)(ptrdiff_t)&(((%s *)0)_V)", num, ctype)) - ctypenum = num -end -map_op[".type_2"] = map_op[".type_3"] - --- Dump type definitions. -local function dumptypes(out, lvl) - local t = {} - for name in pairs(map_type) do t[#t+1] = name end - sort(t) - out:write("Type definitions:\n") - for _,name in ipairs(t) do - local tp = map_type[name] - local reg = tp.reg or "" - out:write(format(" %-20s %-20s %s\n", name, tp.ctype, reg)) - end - out:write("\n") -end - ------------------------------------------------------------------------------- - --- Set the current section. -function _M.section(num) - waction("SECTION", num) - wflush(true) -- SECTION is a terminal action. -end - ------------------------------------------------------------------------------- - --- Dump architecture description. -function _M.dumparch(out) - out:write(format("DynASM %s version %s, released %s\n\n", - _info.arch, _info.version, _info.release)) - dumpactions(out) -end - --- Dump all user defined elements. -function _M.dumpdef(out, lvl) - dumptypes(out, lvl) - dumpglobals(out, lvl) - dumpexterns(out, lvl) -end - ------------------------------------------------------------------------------- - --- Pass callbacks from/to the DynASM core. -function _M.passcb(wl, we, wf, ww) - wline, werror, wfatal, wwarn = wl, we, wf, ww - return wflush -end - --- Setup the arch-specific module. -function _M.setup(arch, opt) - g_arch, g_opt = arch, opt -end - --- Merge the core maps and the arch-specific maps. -function _M.mergemaps(map_coreop, map_def) - setmetatable(map_op, { __index = map_coreop }) - setmetatable(map_def, { __index = map_archdef }) - return map_op, map_def -end - -return _M - ------------------------------------------------------------------------------- - diff --git a/subprojects/luajit/dynasm/dasm_ppc.h b/subprojects/luajit/dynasm/dasm_ppc.h deleted file mode 100644 index 611036126..000000000 --- a/subprojects/luajit/dynasm/dasm_ppc.h +++ /dev/null @@ -1,412 +0,0 @@ -/* -** DynASM PPC encoding engine. -** Copyright (C) 2005-2017 Mike Pall. All rights reserved. -** Released under the MIT license. See dynasm.lua for full copyright notice. -*/ - -#include -#include -#include -#include - -#define DASM_ARCH "ppc" - -#ifndef DASM_EXTERN -#define DASM_EXTERN(a,b,c,d) 0 -#endif - -/* Action definitions. */ -enum { - DASM_STOP, DASM_SECTION, DASM_ESC, DASM_REL_EXT, - /* The following actions need a buffer position. */ - DASM_ALIGN, DASM_REL_LG, DASM_LABEL_LG, - /* The following actions also have an argument. */ - DASM_REL_PC, DASM_LABEL_PC, DASM_IMM, - DASM__MAX -}; - -/* Maximum number of section buffer positions for a single dasm_put() call. */ -#define DASM_MAXSECPOS 25 - -/* DynASM encoder status codes. Action list offset or number are or'ed in. */ -#define DASM_S_OK 0x00000000 -#define DASM_S_NOMEM 0x01000000 -#define DASM_S_PHASE 0x02000000 -#define DASM_S_MATCH_SEC 0x03000000 -#define DASM_S_RANGE_I 0x11000000 -#define DASM_S_RANGE_SEC 0x12000000 -#define DASM_S_RANGE_LG 0x13000000 -#define DASM_S_RANGE_PC 0x14000000 -#define DASM_S_RANGE_REL 0x15000000 -#define DASM_S_UNDEF_LG 0x21000000 -#define DASM_S_UNDEF_PC 0x22000000 - -/* Macros to convert positions (8 bit section + 24 bit index). */ -#define DASM_POS2IDX(pos) ((pos)&0x00ffffff) -#define DASM_POS2BIAS(pos) ((pos)&0xff000000) -#define DASM_SEC2POS(sec) ((sec)<<24) -#define DASM_POS2SEC(pos) ((pos)>>24) -#define DASM_POS2PTR(D, pos) (D->sections[DASM_POS2SEC(pos)].rbuf + (pos)) - -/* Action list type. */ -typedef const unsigned int *dasm_ActList; - -/* Per-section structure. */ -typedef struct dasm_Section { - int *rbuf; /* Biased buffer pointer (negative section bias). */ - int *buf; /* True buffer pointer. */ - size_t bsize; /* Buffer size in bytes. */ - int pos; /* Biased buffer position. */ - int epos; /* End of biased buffer position - max single put. */ - int ofs; /* Byte offset into section. */ -} dasm_Section; - -/* Core structure holding the DynASM encoding state. */ -struct dasm_State { - size_t psize; /* Allocated size of this structure. */ - dasm_ActList actionlist; /* Current actionlist pointer. */ - int *lglabels; /* Local/global chain/pos ptrs. */ - size_t lgsize; - int *pclabels; /* PC label chains/pos ptrs. */ - size_t pcsize; - void **globals; /* Array of globals (bias -10). */ - dasm_Section *section; /* Pointer to active section. */ - size_t codesize; /* Total size of all code sections. */ - int maxsection; /* 0 <= sectionidx < maxsection. */ - int status; /* Status code. */ - dasm_Section sections[1]; /* All sections. Alloc-extended. */ -}; - -/* The size of the core structure depends on the max. number of sections. */ -#define DASM_PSZ(ms) (sizeof(dasm_State)+(ms-1)*sizeof(dasm_Section)) - - -/* Initialize DynASM state. */ -void dasm_init(Dst_DECL, int maxsection) -{ - dasm_State *D; - size_t psz = 0; - int i; - Dst_REF = NULL; - DASM_M_GROW(Dst, struct dasm_State, Dst_REF, psz, DASM_PSZ(maxsection)); - D = Dst_REF; - D->psize = psz; - D->lglabels = NULL; - D->lgsize = 0; - D->pclabels = NULL; - D->pcsize = 0; - D->globals = NULL; - D->maxsection = maxsection; - for (i = 0; i < maxsection; i++) { - D->sections[i].buf = NULL; /* Need this for pass3. */ - D->sections[i].rbuf = D->sections[i].buf - DASM_SEC2POS(i); - D->sections[i].bsize = 0; - D->sections[i].epos = 0; /* Wrong, but is recalculated after resize. */ - } -} - -/* Free DynASM state. */ -void dasm_free(Dst_DECL) -{ - dasm_State *D = Dst_REF; - int i; - for (i = 0; i < D->maxsection; i++) - if (D->sections[i].buf) - DASM_M_FREE(Dst, D->sections[i].buf, D->sections[i].bsize); - if (D->pclabels) DASM_M_FREE(Dst, D->pclabels, D->pcsize); - if (D->lglabels) DASM_M_FREE(Dst, D->lglabels, D->lgsize); - DASM_M_FREE(Dst, D, D->psize); -} - -/* Setup global label array. Must be called before dasm_setup(). */ -void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl) -{ - dasm_State *D = Dst_REF; - D->globals = gl - 10; /* Negative bias to compensate for locals. */ - DASM_M_GROW(Dst, int, D->lglabels, D->lgsize, (10+maxgl)*sizeof(int)); -} - -/* Grow PC label array. Can be called after dasm_setup(), too. */ -void dasm_growpc(Dst_DECL, unsigned int maxpc) -{ - dasm_State *D = Dst_REF; - size_t osz = D->pcsize; - DASM_M_GROW(Dst, int, D->pclabels, D->pcsize, maxpc*sizeof(int)); - memset((void *)(((unsigned char *)D->pclabels)+osz), 0, D->pcsize-osz); -} - -/* Setup encoder. */ -void dasm_setup(Dst_DECL, const void *actionlist) -{ - dasm_State *D = Dst_REF; - int i; - D->actionlist = (dasm_ActList)actionlist; - D->status = DASM_S_OK; - D->section = &D->sections[0]; - memset((void *)D->lglabels, 0, D->lgsize); - if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize); - for (i = 0; i < D->maxsection; i++) { - D->sections[i].pos = DASM_SEC2POS(i); - D->sections[i].ofs = 0; - } -} - - -#ifdef DASM_CHECKS -#define CK(x, st) \ - do { if (!(x)) { \ - D->status = DASM_S_##st|(p-D->actionlist-1); return; } } while (0) -#define CKPL(kind, st) \ - do { if ((size_t)((char *)pl-(char *)D->kind##labels) >= D->kind##size) { \ - D->status = DASM_S_RANGE_##st|(p-D->actionlist-1); return; } } while (0) -#else -#define CK(x, st) ((void)0) -#define CKPL(kind, st) ((void)0) -#endif - -/* Pass 1: Store actions and args, link branches/labels, estimate offsets. */ -void dasm_put(Dst_DECL, int start, ...) -{ - va_list ap; - dasm_State *D = Dst_REF; - dasm_ActList p = D->actionlist + start; - dasm_Section *sec = D->section; - int pos = sec->pos, ofs = sec->ofs; - int *b; - - if (pos >= sec->epos) { - DASM_M_GROW(Dst, int, sec->buf, sec->bsize, - sec->bsize + 2*DASM_MAXSECPOS*sizeof(int)); - sec->rbuf = sec->buf - DASM_POS2BIAS(pos); - sec->epos = (int)sec->bsize/sizeof(int) - DASM_MAXSECPOS+DASM_POS2BIAS(pos); - } - - b = sec->rbuf; - b[pos++] = start; - - va_start(ap, start); - while (1) { - unsigned int ins = *p++; - unsigned int action = (ins >> 16); - if (action >= DASM__MAX) { - ofs += 4; - } else { - int *pl, n = action >= DASM_REL_PC ? va_arg(ap, int) : 0; - switch (action) { - case DASM_STOP: goto stop; - case DASM_SECTION: - n = (ins & 255); CK(n < D->maxsection, RANGE_SEC); - D->section = &D->sections[n]; goto stop; - case DASM_ESC: p++; ofs += 4; break; - case DASM_REL_EXT: break; - case DASM_ALIGN: ofs += (ins & 255); b[pos++] = ofs; break; - case DASM_REL_LG: - n = (ins & 2047) - 10; pl = D->lglabels + n; - /* Bkwd rel or global. */ - if (n >= 0) { CK(n>=10||*pl<0, RANGE_LG); CKPL(lg, LG); goto putrel; } - pl += 10; n = *pl; - if (n < 0) n = 0; /* Start new chain for fwd rel if label exists. */ - goto linkrel; - case DASM_REL_PC: - pl = D->pclabels + n; CKPL(pc, PC); - putrel: - n = *pl; - if (n < 0) { /* Label exists. Get label pos and store it. */ - b[pos] = -n; - } else { - linkrel: - b[pos] = n; /* Else link to rel chain, anchored at label. */ - *pl = pos; - } - pos++; - break; - case DASM_LABEL_LG: - pl = D->lglabels + (ins & 2047) - 10; CKPL(lg, LG); goto putlabel; - case DASM_LABEL_PC: - pl = D->pclabels + n; CKPL(pc, PC); - putlabel: - n = *pl; /* n > 0: Collapse rel chain and replace with label pos. */ - while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = pos; - } - *pl = -pos; /* Label exists now. */ - b[pos++] = ofs; /* Store pass1 offset estimate. */ - break; - case DASM_IMM: -#ifdef DASM_CHECKS - CK((n & ((1<<((ins>>10)&31))-1)) == 0, RANGE_I); -#endif - n >>= ((ins>>10)&31); -#ifdef DASM_CHECKS - if (ins & 0x8000) - CK(((n + (1<<(((ins>>5)&31)-1)))>>((ins>>5)&31)) == 0, RANGE_I); - else - CK((n>>((ins>>5)&31)) == 0, RANGE_I); -#endif - b[pos++] = n; - break; - } - } - } -stop: - va_end(ap); - sec->pos = pos; - sec->ofs = ofs; -} -#undef CK - -/* Pass 2: Link sections, shrink aligns, fix label offsets. */ -int dasm_link(Dst_DECL, size_t *szp) -{ - dasm_State *D = Dst_REF; - int secnum; - int ofs = 0; - -#ifdef DASM_CHECKS - *szp = 0; - if (D->status != DASM_S_OK) return D->status; - { - int pc; - for (pc = 0; pc*sizeof(int) < D->pcsize; pc++) - if (D->pclabels[pc] > 0) return DASM_S_UNDEF_PC|pc; - } -#endif - - { /* Handle globals not defined in this translation unit. */ - int idx; - for (idx = 20; idx*sizeof(int) < D->lgsize; idx++) { - int n = D->lglabels[idx]; - /* Undefined label: Collapse rel chain and replace with marker (< 0). */ - while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = -idx; } - } - } - - /* Combine all code sections. No support for data sections (yet). */ - for (secnum = 0; secnum < D->maxsection; secnum++) { - dasm_Section *sec = D->sections + secnum; - int *b = sec->rbuf; - int pos = DASM_SEC2POS(secnum); - int lastpos = sec->pos; - - while (pos != lastpos) { - dasm_ActList p = D->actionlist + b[pos++]; - while (1) { - unsigned int ins = *p++; - unsigned int action = (ins >> 16); - switch (action) { - case DASM_STOP: case DASM_SECTION: goto stop; - case DASM_ESC: p++; break; - case DASM_REL_EXT: break; - case DASM_ALIGN: ofs -= (b[pos++] + ofs) & (ins & 255); break; - case DASM_REL_LG: case DASM_REL_PC: pos++; break; - case DASM_LABEL_LG: case DASM_LABEL_PC: b[pos++] += ofs; break; - case DASM_IMM: pos++; break; - } - } - stop: (void)0; - } - ofs += sec->ofs; /* Next section starts right after current section. */ - } - - D->codesize = ofs; /* Total size of all code sections */ - *szp = ofs; - return DASM_S_OK; -} - -#ifdef DASM_CHECKS -#define CK(x, st) \ - do { if (!(x)) return DASM_S_##st|(p-D->actionlist-1); } while (0) -#else -#define CK(x, st) ((void)0) -#endif - -/* Pass 3: Encode sections. */ -int dasm_encode(Dst_DECL, void *buffer) -{ - dasm_State *D = Dst_REF; - char *base = (char *)buffer; - unsigned int *cp = (unsigned int *)buffer; - int secnum; - - /* Encode all code sections. No support for data sections (yet). */ - for (secnum = 0; secnum < D->maxsection; secnum++) { - dasm_Section *sec = D->sections + secnum; - int *b = sec->buf; - int *endb = sec->rbuf + sec->pos; - - while (b != endb) { - dasm_ActList p = D->actionlist + *b++; - while (1) { - unsigned int ins = *p++; - unsigned int action = (ins >> 16); - int n = (action >= DASM_ALIGN && action < DASM__MAX) ? *b++ : 0; - switch (action) { - case DASM_STOP: case DASM_SECTION: goto stop; - case DASM_ESC: *cp++ = *p++; break; - case DASM_REL_EXT: - n = DASM_EXTERN(Dst, (unsigned char *)cp, (ins & 2047), 1) - 4; - goto patchrel; - case DASM_ALIGN: - ins &= 255; while ((((char *)cp - base) & ins)) *cp++ = 0x60000000; - break; - case DASM_REL_LG: - CK(n >= 0, UNDEF_LG); - case DASM_REL_PC: - CK(n >= 0, UNDEF_PC); - n = *DASM_POS2PTR(D, n) - (int)((char *)cp - base); - patchrel: - CK((n & 3) == 0 && - (((n+4) + ((ins & 2048) ? 0x00008000 : 0x02000000)) >> - ((ins & 2048) ? 16 : 26)) == 0, RANGE_REL); - cp[-1] |= ((n+4) & ((ins & 2048) ? 0x0000fffc: 0x03fffffc)); - break; - case DASM_LABEL_LG: - ins &= 2047; if (ins >= 20) D->globals[ins-10] = (void *)(base + n); - break; - case DASM_LABEL_PC: break; - case DASM_IMM: - cp[-1] |= (n & ((1<<((ins>>5)&31))-1)) << (ins&31); - break; - default: *cp++ = ins; break; - } - } - stop: (void)0; - } - } - - if (base + D->codesize != (char *)cp) /* Check for phase errors. */ - return DASM_S_PHASE; - return DASM_S_OK; -} -#undef CK - -/* Get PC label offset. */ -int dasm_getpclabel(Dst_DECL, unsigned int pc) -{ - dasm_State *D = Dst_REF; - if (pc*sizeof(int) < D->pcsize) { - int pos = D->pclabels[pc]; - if (pos < 0) return *DASM_POS2PTR(D, -pos); - if (pos > 0) return -1; /* Undefined. */ - } - return -2; /* Unused or out of range. */ -} - -#ifdef DASM_CHECKS -/* Optional sanity checker to call between isolated encoding steps. */ -int dasm_checkstep(Dst_DECL, int secmatch) -{ - dasm_State *D = Dst_REF; - if (D->status == DASM_S_OK) { - int i; - for (i = 1; i <= 9; i++) { - if (D->lglabels[i] > 0) { D->status = DASM_S_UNDEF_LG|i; break; } - D->lglabels[i] = 0; - } - } - if (D->status == DASM_S_OK && secmatch >= 0 && - D->section != &D->sections[secmatch]) - D->status = DASM_S_MATCH_SEC|(D->section-D->sections); - return D->status; -} -#endif - diff --git a/subprojects/luajit/dynasm/dasm_ppc.lua b/subprojects/luajit/dynasm/dasm_ppc.lua deleted file mode 100644 index 4e1656e3c..000000000 --- a/subprojects/luajit/dynasm/dasm_ppc.lua +++ /dev/null @@ -1,1249 +0,0 @@ ------------------------------------------------------------------------------- --- DynASM PPC module. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------- - --- Module information: -local _info = { - arch = "ppc", - description = "DynASM PPC module", - version = "1.3.0", - vernum = 10300, - release = "2011-05-05", - author = "Mike Pall", - license = "MIT", -} - --- Exported glue functions for the arch-specific module. -local _M = { _info = _info } - --- Cache library functions. -local type, tonumber, pairs, ipairs = type, tonumber, pairs, ipairs -local assert, setmetatable = assert, setmetatable -local _s = string -local sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char -local match, gmatch = _s.match, _s.gmatch -local concat, sort = table.concat, table.sort -local bit = bit or require("bit") -local band, shl, shr, sar = bit.band, bit.lshift, bit.rshift, bit.arshift -local tohex = bit.tohex - --- Inherited tables and callbacks. -local g_opt, g_arch -local wline, werror, wfatal, wwarn - --- Action name list. --- CHECK: Keep this in sync with the C code! -local action_names = { - "STOP", "SECTION", "ESC", "REL_EXT", - "ALIGN", "REL_LG", "LABEL_LG", - "REL_PC", "LABEL_PC", "IMM", -} - --- Maximum number of section buffer positions for dasm_put(). --- CHECK: Keep this in sync with the C code! -local maxsecpos = 25 -- Keep this low, to avoid excessively long C lines. - --- Action name -> action number. -local map_action = {} -for n,name in ipairs(action_names) do - map_action[name] = n-1 -end - --- Action list buffer. -local actlist = {} - --- Argument list for next dasm_put(). Start with offset 0 into action list. -local actargs = { 0 } - --- Current number of section buffer positions for dasm_put(). -local secpos = 1 - ------------------------------------------------------------------------------- - --- Dump action names and numbers. -local function dumpactions(out) - out:write("DynASM encoding engine action codes:\n") - for n,name in ipairs(action_names) do - local num = map_action[name] - out:write(format(" %-10s %02X %d\n", name, num, num)) - end - out:write("\n") -end - --- Write action list buffer as a huge static C array. -local function writeactions(out, name) - local nn = #actlist - if nn == 0 then nn = 1; actlist[0] = map_action.STOP end - out:write("static const unsigned int ", name, "[", nn, "] = {\n") - for i = 1,nn-1 do - assert(out:write("0x", tohex(actlist[i]), ",\n")) - end - assert(out:write("0x", tohex(actlist[nn]), "\n};\n\n")) -end - ------------------------------------------------------------------------------- - --- Add word to action list. -local function wputxw(n) - assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, "word out of range") - actlist[#actlist+1] = n -end - --- Add action to list with optional arg. Advance buffer pos, too. -local function waction(action, val, a, num) - local w = assert(map_action[action], "bad action name `"..action.."'") - wputxw(w * 0x10000 + (val or 0)) - if a then actargs[#actargs+1] = a end - if a or num then secpos = secpos + (num or 1) end -end - --- Flush action list (intervening C code or buffer pos overflow). -local function wflush(term) - if #actlist == actargs[1] then return end -- Nothing to flush. - if not term then waction("STOP") end -- Terminate action list. - wline(format("dasm_put(Dst, %s);", concat(actargs, ", ")), true) - actargs = { #actlist } -- Actionlist offset is 1st arg to next dasm_put(). - secpos = 1 -- The actionlist offset occupies a buffer position, too. -end - --- Put escaped word. -local function wputw(n) - if n <= 0xffffff then waction("ESC") end - wputxw(n) -end - --- Reserve position for word. -local function wpos() - local pos = #actlist+1 - actlist[pos] = "" - return pos -end - --- Store word to reserved position. -local function wputpos(pos, n) - assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, "word out of range") - actlist[pos] = n -end - ------------------------------------------------------------------------------- - --- Global label name -> global label number. With auto assignment on 1st use. -local next_global = 20 -local map_global = setmetatable({}, { __index = function(t, name) - if not match(name, "^[%a_][%w_]*$") then werror("bad global label") end - local n = next_global - if n > 2047 then werror("too many global labels") end - next_global = n + 1 - t[name] = n - return n -end}) - --- Dump global labels. -local function dumpglobals(out, lvl) - local t = {} - for name, n in pairs(map_global) do t[n] = name end - out:write("Global labels:\n") - for i=20,next_global-1 do - out:write(format(" %s\n", t[i])) - end - out:write("\n") -end - --- Write global label enum. -local function writeglobals(out, prefix) - local t = {} - for name, n in pairs(map_global) do t[n] = name end - out:write("enum {\n") - for i=20,next_global-1 do - out:write(" ", prefix, t[i], ",\n") - end - out:write(" ", prefix, "_MAX\n};\n") -end - --- Write global label names. -local function writeglobalnames(out, name) - local t = {} - for name, n in pairs(map_global) do t[n] = name end - out:write("static const char *const ", name, "[] = {\n") - for i=20,next_global-1 do - out:write(" \"", t[i], "\",\n") - end - out:write(" (const char *)0\n};\n") -end - ------------------------------------------------------------------------------- - --- Extern label name -> extern label number. With auto assignment on 1st use. -local next_extern = 0 -local map_extern_ = {} -local map_extern = setmetatable({}, { __index = function(t, name) - -- No restrictions on the name for now. - local n = next_extern - if n > 2047 then werror("too many extern labels") end - next_extern = n + 1 - t[name] = n - map_extern_[n] = name - return n -end}) - --- Dump extern labels. -local function dumpexterns(out, lvl) - out:write("Extern labels:\n") - for i=0,next_extern-1 do - out:write(format(" %s\n", map_extern_[i])) - end - out:write("\n") -end - --- Write extern label names. -local function writeexternnames(out, name) - out:write("static const char *const ", name, "[] = {\n") - for i=0,next_extern-1 do - out:write(" \"", map_extern_[i], "\",\n") - end - out:write(" (const char *)0\n};\n") -end - ------------------------------------------------------------------------------- - --- Arch-specific maps. -local map_archdef = { sp = "r1" } -- Ext. register name -> int. name. - -local map_type = {} -- Type name -> { ctype, reg } -local ctypenum = 0 -- Type number (for Dt... macros). - --- Reverse defines for registers. -function _M.revdef(s) - if s == "r1" then return "sp" end - return s -end - -local map_cond = { - lt = 0, gt = 1, eq = 2, so = 3, - ge = 4, le = 5, ne = 6, ns = 7, -} - ------------------------------------------------------------------------------- - --- Template strings for PPC instructions. -local map_op = { - tdi_3 = "08000000ARI", - twi_3 = "0c000000ARI", - mulli_3 = "1c000000RRI", - subfic_3 = "20000000RRI", - cmplwi_3 = "28000000XRU", - cmplwi_2 = "28000000-RU", - cmpldi_3 = "28200000XRU", - cmpldi_2 = "28200000-RU", - cmpwi_3 = "2c000000XRI", - cmpwi_2 = "2c000000-RI", - cmpdi_3 = "2c200000XRI", - cmpdi_2 = "2c200000-RI", - addic_3 = "30000000RRI", - ["addic._3"] = "34000000RRI", - addi_3 = "38000000RR0I", - li_2 = "38000000RI", - la_2 = "38000000RD", - addis_3 = "3c000000RR0I", - lis_2 = "3c000000RI", - lus_2 = "3c000000RU", - bc_3 = "40000000AAK", - bcl_3 = "40000001AAK", - bdnz_1 = "42000000K", - bdz_1 = "42400000K", - sc_0 = "44000000", - b_1 = "48000000J", - bl_1 = "48000001J", - rlwimi_5 = "50000000RR~AAA.", - rlwinm_5 = "54000000RR~AAA.", - rlwnm_5 = "5c000000RR~RAA.", - ori_3 = "60000000RR~U", - nop_0 = "60000000", - oris_3 = "64000000RR~U", - xori_3 = "68000000RR~U", - xoris_3 = "6c000000RR~U", - ["andi._3"] = "70000000RR~U", - ["andis._3"] = "74000000RR~U", - lwz_2 = "80000000RD", - lwzu_2 = "84000000RD", - lbz_2 = "88000000RD", - lbzu_2 = "8c000000RD", - stw_2 = "90000000RD", - stwu_2 = "94000000RD", - stb_2 = "98000000RD", - stbu_2 = "9c000000RD", - lhz_2 = "a0000000RD", - lhzu_2 = "a4000000RD", - lha_2 = "a8000000RD", - lhau_2 = "ac000000RD", - sth_2 = "b0000000RD", - sthu_2 = "b4000000RD", - lmw_2 = "b8000000RD", - stmw_2 = "bc000000RD", - lfs_2 = "c0000000FD", - lfsu_2 = "c4000000FD", - lfd_2 = "c8000000FD", - lfdu_2 = "cc000000FD", - stfs_2 = "d0000000FD", - stfsu_2 = "d4000000FD", - stfd_2 = "d8000000FD", - stfdu_2 = "dc000000FD", - ld_2 = "e8000000RD", -- NYI: displacement must be divisible by 4. - ldu_2 = "e8000001RD", - lwa_2 = "e8000002RD", - std_2 = "f8000000RD", - stdu_2 = "f8000001RD", - - -- Primary opcode 19: - mcrf_2 = "4c000000XX", - isync_0 = "4c00012c", - crnor_3 = "4c000042CCC", - crnot_2 = "4c000042CC=", - crandc_3 = "4c000102CCC", - crxor_3 = "4c000182CCC", - crclr_1 = "4c000182C==", - crnand_3 = "4c0001c2CCC", - crand_3 = "4c000202CCC", - creqv_3 = "4c000242CCC", - crset_1 = "4c000242C==", - crorc_3 = "4c000342CCC", - cror_3 = "4c000382CCC", - crmove_2 = "4c000382CC=", - bclr_2 = "4c000020AA", - bclrl_2 = "4c000021AA", - bcctr_2 = "4c000420AA", - bcctrl_2 = "4c000421AA", - blr_0 = "4e800020", - blrl_0 = "4e800021", - bctr_0 = "4e800420", - bctrl_0 = "4e800421", - - -- Primary opcode 31: - cmpw_3 = "7c000000XRR", - cmpw_2 = "7c000000-RR", - cmpd_3 = "7c200000XRR", - cmpd_2 = "7c200000-RR", - tw_3 = "7c000008ARR", - subfc_3 = "7c000010RRR.", - subc_3 = "7c000010RRR~.", - mulhdu_3 = "7c000012RRR.", - addc_3 = "7c000014RRR.", - mulhwu_3 = "7c000016RRR.", - isel_4 = "7c00001eRRRC", - isellt_3 = "7c00001eRRR", - iselgt_3 = "7c00005eRRR", - iseleq_3 = "7c00009eRRR", - mfcr_1 = "7c000026R", - mfocrf_2 = "7c100026RG", - mtcrf_2 = "7c000120GR", - mtocrf_2 = "7c100120GR", - lwarx_3 = "7c000028RR0R", - ldx_3 = "7c00002aRR0R", - lwzx_3 = "7c00002eRR0R", - slw_3 = "7c000030RR~R.", - cntlzw_2 = "7c000034RR~", - sld_3 = "7c000036RR~R.", - and_3 = "7c000038RR~R.", - cmplw_3 = "7c000040XRR", - cmplw_2 = "7c000040-RR", - cmpld_3 = "7c200040XRR", - cmpld_2 = "7c200040-RR", - subf_3 = "7c000050RRR.", - sub_3 = "7c000050RRR~.", - ldux_3 = "7c00006aRR0R", - dcbst_2 = "7c00006c-RR", - lwzux_3 = "7c00006eRR0R", - cntlzd_2 = "7c000074RR~", - andc_3 = "7c000078RR~R.", - td_3 = "7c000088ARR", - mulhd_3 = "7c000092RRR.", - mulhw_3 = "7c000096RRR.", - ldarx_3 = "7c0000a8RR0R", - dcbf_2 = "7c0000ac-RR", - lbzx_3 = "7c0000aeRR0R", - neg_2 = "7c0000d0RR.", - lbzux_3 = "7c0000eeRR0R", - popcntb_2 = "7c0000f4RR~", - not_2 = "7c0000f8RR~%.", - nor_3 = "7c0000f8RR~R.", - subfe_3 = "7c000110RRR.", - sube_3 = "7c000110RRR~.", - adde_3 = "7c000114RRR.", - stdx_3 = "7c00012aRR0R", - stwcx_3 = "7c00012cRR0R.", - stwx_3 = "7c00012eRR0R", - prtyw_2 = "7c000134RR~", - stdux_3 = "7c00016aRR0R", - stwux_3 = "7c00016eRR0R", - prtyd_2 = "7c000174RR~", - subfze_2 = "7c000190RR.", - addze_2 = "7c000194RR.", - stdcx_3 = "7c0001acRR0R.", - stbx_3 = "7c0001aeRR0R", - subfme_2 = "7c0001d0RR.", - mulld_3 = "7c0001d2RRR.", - addme_2 = "7c0001d4RR.", - mullw_3 = "7c0001d6RRR.", - dcbtst_2 = "7c0001ec-RR", - stbux_3 = "7c0001eeRR0R", - add_3 = "7c000214RRR.", - dcbt_2 = "7c00022c-RR", - lhzx_3 = "7c00022eRR0R", - eqv_3 = "7c000238RR~R.", - eciwx_3 = "7c00026cRR0R", - lhzux_3 = "7c00026eRR0R", - xor_3 = "7c000278RR~R.", - mfspefscr_1 = "7c0082a6R", - mfxer_1 = "7c0102a6R", - mflr_1 = "7c0802a6R", - mfctr_1 = "7c0902a6R", - lwax_3 = "7c0002aaRR0R", - lhax_3 = "7c0002aeRR0R", - mftb_1 = "7c0c42e6R", - mftbu_1 = "7c0d42e6R", - lwaux_3 = "7c0002eaRR0R", - lhaux_3 = "7c0002eeRR0R", - sthx_3 = "7c00032eRR0R", - orc_3 = "7c000338RR~R.", - ecowx_3 = "7c00036cRR0R", - sthux_3 = "7c00036eRR0R", - or_3 = "7c000378RR~R.", - mr_2 = "7c000378RR~%.", - divdu_3 = "7c000392RRR.", - divwu_3 = "7c000396RRR.", - mtspefscr_1 = "7c0083a6R", - mtxer_1 = "7c0103a6R", - mtlr_1 = "7c0803a6R", - mtctr_1 = "7c0903a6R", - dcbi_2 = "7c0003ac-RR", - nand_3 = "7c0003b8RR~R.", - divd_3 = "7c0003d2RRR.", - divw_3 = "7c0003d6RRR.", - cmpb_3 = "7c0003f8RR~R.", - mcrxr_1 = "7c000400X", - subfco_3 = "7c000410RRR.", - subco_3 = "7c000410RRR~.", - addco_3 = "7c000414RRR.", - ldbrx_3 = "7c000428RR0R", - lswx_3 = "7c00042aRR0R", - lwbrx_3 = "7c00042cRR0R", - lfsx_3 = "7c00042eFR0R", - srw_3 = "7c000430RR~R.", - srd_3 = "7c000436RR~R.", - subfo_3 = "7c000450RRR.", - subo_3 = "7c000450RRR~.", - lfsux_3 = "7c00046eFR0R", - lswi_3 = "7c0004aaRR0A", - sync_0 = "7c0004ac", - lwsync_0 = "7c2004ac", - ptesync_0 = "7c4004ac", - lfdx_3 = "7c0004aeFR0R", - nego_2 = "7c0004d0RR.", - lfdux_3 = "7c0004eeFR0R", - subfeo_3 = "7c000510RRR.", - subeo_3 = "7c000510RRR~.", - addeo_3 = "7c000514RRR.", - stdbrx_3 = "7c000528RR0R", - stswx_3 = "7c00052aRR0R", - stwbrx_3 = "7c00052cRR0R", - stfsx_3 = "7c00052eFR0R", - stfsux_3 = "7c00056eFR0R", - subfzeo_2 = "7c000590RR.", - addzeo_2 = "7c000594RR.", - stswi_3 = "7c0005aaRR0A", - stfdx_3 = "7c0005aeFR0R", - subfmeo_2 = "7c0005d0RR.", - mulldo_3 = "7c0005d2RRR.", - addmeo_2 = "7c0005d4RR.", - mullwo_3 = "7c0005d6RRR.", - dcba_2 = "7c0005ec-RR", - stfdux_3 = "7c0005eeFR0R", - addo_3 = "7c000614RRR.", - lhbrx_3 = "7c00062cRR0R", - sraw_3 = "7c000630RR~R.", - srad_3 = "7c000634RR~R.", - srawi_3 = "7c000670RR~A.", - sradi_3 = "7c000674RR~H.", - eieio_0 = "7c0006ac", - lfiwax_3 = "7c0006aeFR0R", - sthbrx_3 = "7c00072cRR0R", - extsh_2 = "7c000734RR~.", - extsb_2 = "7c000774RR~.", - divduo_3 = "7c000792RRR.", - divwou_3 = "7c000796RRR.", - icbi_2 = "7c0007ac-RR", - stfiwx_3 = "7c0007aeFR0R", - extsw_2 = "7c0007b4RR~.", - divdo_3 = "7c0007d2RRR.", - divwo_3 = "7c0007d6RRR.", - dcbz_2 = "7c0007ec-RR", - - -- Primary opcode 30: - rldicl_4 = "78000000RR~HM.", - rldicr_4 = "78000004RR~HM.", - rldic_4 = "78000008RR~HM.", - rldimi_4 = "7800000cRR~HM.", - rldcl_4 = "78000010RR~RM.", - rldcr_4 = "78000012RR~RM.", - - -- Primary opcode 59: - fdivs_3 = "ec000024FFF.", - fsubs_3 = "ec000028FFF.", - fadds_3 = "ec00002aFFF.", - fsqrts_2 = "ec00002cF-F.", - fres_2 = "ec000030F-F.", - fmuls_3 = "ec000032FF-F.", - frsqrtes_2 = "ec000034F-F.", - fmsubs_4 = "ec000038FFFF~.", - fmadds_4 = "ec00003aFFFF~.", - fnmsubs_4 = "ec00003cFFFF~.", - fnmadds_4 = "ec00003eFFFF~.", - - -- Primary opcode 63: - fdiv_3 = "fc000024FFF.", - fsub_3 = "fc000028FFF.", - fadd_3 = "fc00002aFFF.", - fsqrt_2 = "fc00002cF-F.", - fsel_4 = "fc00002eFFFF~.", - fre_2 = "fc000030F-F.", - fmul_3 = "fc000032FF-F.", - frsqrte_2 = "fc000034F-F.", - fmsub_4 = "fc000038FFFF~.", - fmadd_4 = "fc00003aFFFF~.", - fnmsub_4 = "fc00003cFFFF~.", - fnmadd_4 = "fc00003eFFFF~.", - fcmpu_3 = "fc000000XFF", - fcpsgn_3 = "fc000010FFF.", - fcmpo_3 = "fc000040XFF", - mtfsb1_1 = "fc00004cA", - fneg_2 = "fc000050F-F.", - mcrfs_2 = "fc000080XX", - mtfsb0_1 = "fc00008cA", - fmr_2 = "fc000090F-F.", - frsp_2 = "fc000018F-F.", - fctiw_2 = "fc00001cF-F.", - fctiwz_2 = "fc00001eF-F.", - mtfsfi_2 = "fc00010cAA", -- NYI: upshift. - fnabs_2 = "fc000110F-F.", - fabs_2 = "fc000210F-F.", - frin_2 = "fc000310F-F.", - friz_2 = "fc000350F-F.", - frip_2 = "fc000390F-F.", - frim_2 = "fc0003d0F-F.", - mffs_1 = "fc00048eF.", - -- NYI: mtfsf, mtfsb0, mtfsb1. - fctid_2 = "fc00065cF-F.", - fctidz_2 = "fc00065eF-F.", - fcfid_2 = "fc00069cF-F.", - - -- Primary opcode 4, SPE APU extension: - evaddw_3 = "10000200RRR", - evaddiw_3 = "10000202RAR~", - evsubw_3 = "10000204RRR~", - evsubiw_3 = "10000206RAR~", - evabs_2 = "10000208RR", - evneg_2 = "10000209RR", - evextsb_2 = "1000020aRR", - evextsh_2 = "1000020bRR", - evrndw_2 = "1000020cRR", - evcntlzw_2 = "1000020dRR", - evcntlsw_2 = "1000020eRR", - brinc_3 = "1000020fRRR", - evand_3 = "10000211RRR", - evandc_3 = "10000212RRR", - evxor_3 = "10000216RRR", - evor_3 = "10000217RRR", - evmr_2 = "10000217RR=", - evnor_3 = "10000218RRR", - evnot_2 = "10000218RR=", - eveqv_3 = "10000219RRR", - evorc_3 = "1000021bRRR", - evnand_3 = "1000021eRRR", - evsrwu_3 = "10000220RRR", - evsrws_3 = "10000221RRR", - evsrwiu_3 = "10000222RRA", - evsrwis_3 = "10000223RRA", - evslw_3 = "10000224RRR", - evslwi_3 = "10000226RRA", - evrlw_3 = "10000228RRR", - evsplati_2 = "10000229RS", - evrlwi_3 = "1000022aRRA", - evsplatfi_2 = "1000022bRS", - evmergehi_3 = "1000022cRRR", - evmergelo_3 = "1000022dRRR", - evcmpgtu_3 = "10000230XRR", - evcmpgtu_2 = "10000230-RR", - evcmpgts_3 = "10000231XRR", - evcmpgts_2 = "10000231-RR", - evcmpltu_3 = "10000232XRR", - evcmpltu_2 = "10000232-RR", - evcmplts_3 = "10000233XRR", - evcmplts_2 = "10000233-RR", - evcmpeq_3 = "10000234XRR", - evcmpeq_2 = "10000234-RR", - evsel_4 = "10000278RRRW", - evsel_3 = "10000278RRR", - evfsadd_3 = "10000280RRR", - evfssub_3 = "10000281RRR", - evfsabs_2 = "10000284RR", - evfsnabs_2 = "10000285RR", - evfsneg_2 = "10000286RR", - evfsmul_3 = "10000288RRR", - evfsdiv_3 = "10000289RRR", - evfscmpgt_3 = "1000028cXRR", - evfscmpgt_2 = "1000028c-RR", - evfscmplt_3 = "1000028dXRR", - evfscmplt_2 = "1000028d-RR", - evfscmpeq_3 = "1000028eXRR", - evfscmpeq_2 = "1000028e-RR", - evfscfui_2 = "10000290R-R", - evfscfsi_2 = "10000291R-R", - evfscfuf_2 = "10000292R-R", - evfscfsf_2 = "10000293R-R", - evfsctui_2 = "10000294R-R", - evfsctsi_2 = "10000295R-R", - evfsctuf_2 = "10000296R-R", - evfsctsf_2 = "10000297R-R", - evfsctuiz_2 = "10000298R-R", - evfsctsiz_2 = "1000029aR-R", - evfststgt_3 = "1000029cXRR", - evfststgt_2 = "1000029c-RR", - evfststlt_3 = "1000029dXRR", - evfststlt_2 = "1000029d-RR", - evfststeq_3 = "1000029eXRR", - evfststeq_2 = "1000029e-RR", - efsadd_3 = "100002c0RRR", - efssub_3 = "100002c1RRR", - efsabs_2 = "100002c4RR", - efsnabs_2 = "100002c5RR", - efsneg_2 = "100002c6RR", - efsmul_3 = "100002c8RRR", - efsdiv_3 = "100002c9RRR", - efscmpgt_3 = "100002ccXRR", - efscmpgt_2 = "100002cc-RR", - efscmplt_3 = "100002cdXRR", - efscmplt_2 = "100002cd-RR", - efscmpeq_3 = "100002ceXRR", - efscmpeq_2 = "100002ce-RR", - efscfd_2 = "100002cfR-R", - efscfui_2 = "100002d0R-R", - efscfsi_2 = "100002d1R-R", - efscfuf_2 = "100002d2R-R", - efscfsf_2 = "100002d3R-R", - efsctui_2 = "100002d4R-R", - efsctsi_2 = "100002d5R-R", - efsctuf_2 = "100002d6R-R", - efsctsf_2 = "100002d7R-R", - efsctuiz_2 = "100002d8R-R", - efsctsiz_2 = "100002daR-R", - efststgt_3 = "100002dcXRR", - efststgt_2 = "100002dc-RR", - efststlt_3 = "100002ddXRR", - efststlt_2 = "100002dd-RR", - efststeq_3 = "100002deXRR", - efststeq_2 = "100002de-RR", - efdadd_3 = "100002e0RRR", - efdsub_3 = "100002e1RRR", - efdcfuid_2 = "100002e2R-R", - efdcfsid_2 = "100002e3R-R", - efdabs_2 = "100002e4RR", - efdnabs_2 = "100002e5RR", - efdneg_2 = "100002e6RR", - efdmul_3 = "100002e8RRR", - efddiv_3 = "100002e9RRR", - efdctuidz_2 = "100002eaR-R", - efdctsidz_2 = "100002ebR-R", - efdcmpgt_3 = "100002ecXRR", - efdcmpgt_2 = "100002ec-RR", - efdcmplt_3 = "100002edXRR", - efdcmplt_2 = "100002ed-RR", - efdcmpeq_3 = "100002eeXRR", - efdcmpeq_2 = "100002ee-RR", - efdcfs_2 = "100002efR-R", - efdcfui_2 = "100002f0R-R", - efdcfsi_2 = "100002f1R-R", - efdcfuf_2 = "100002f2R-R", - efdcfsf_2 = "100002f3R-R", - efdctui_2 = "100002f4R-R", - efdctsi_2 = "100002f5R-R", - efdctuf_2 = "100002f6R-R", - efdctsf_2 = "100002f7R-R", - efdctuiz_2 = "100002f8R-R", - efdctsiz_2 = "100002faR-R", - efdtstgt_3 = "100002fcXRR", - efdtstgt_2 = "100002fc-RR", - efdtstlt_3 = "100002fdXRR", - efdtstlt_2 = "100002fd-RR", - efdtsteq_3 = "100002feXRR", - efdtsteq_2 = "100002fe-RR", - evlddx_3 = "10000300RR0R", - evldd_2 = "10000301R8", - evldwx_3 = "10000302RR0R", - evldw_2 = "10000303R8", - evldhx_3 = "10000304RR0R", - evldh_2 = "10000305R8", - evlwhex_3 = "10000310RR0R", - evlwhe_2 = "10000311R4", - evlwhoux_3 = "10000314RR0R", - evlwhou_2 = "10000315R4", - evlwhosx_3 = "10000316RR0R", - evlwhos_2 = "10000317R4", - evstddx_3 = "10000320RR0R", - evstdd_2 = "10000321R8", - evstdwx_3 = "10000322RR0R", - evstdw_2 = "10000323R8", - evstdhx_3 = "10000324RR0R", - evstdh_2 = "10000325R8", - evstwhex_3 = "10000330RR0R", - evstwhe_2 = "10000331R4", - evstwhox_3 = "10000334RR0R", - evstwho_2 = "10000335R4", - evstwwex_3 = "10000338RR0R", - evstwwe_2 = "10000339R4", - evstwwox_3 = "1000033cRR0R", - evstwwo_2 = "1000033dR4", - evmhessf_3 = "10000403RRR", - evmhossf_3 = "10000407RRR", - evmheumi_3 = "10000408RRR", - evmhesmi_3 = "10000409RRR", - evmhesmf_3 = "1000040bRRR", - evmhoumi_3 = "1000040cRRR", - evmhosmi_3 = "1000040dRRR", - evmhosmf_3 = "1000040fRRR", - evmhessfa_3 = "10000423RRR", - evmhossfa_3 = "10000427RRR", - evmheumia_3 = "10000428RRR", - evmhesmia_3 = "10000429RRR", - evmhesmfa_3 = "1000042bRRR", - evmhoumia_3 = "1000042cRRR", - evmhosmia_3 = "1000042dRRR", - evmhosmfa_3 = "1000042fRRR", - evmwhssf_3 = "10000447RRR", - evmwlumi_3 = "10000448RRR", - evmwhumi_3 = "1000044cRRR", - evmwhsmi_3 = "1000044dRRR", - evmwhsmf_3 = "1000044fRRR", - evmwssf_3 = "10000453RRR", - evmwumi_3 = "10000458RRR", - evmwsmi_3 = "10000459RRR", - evmwsmf_3 = "1000045bRRR", - evmwhssfa_3 = "10000467RRR", - evmwlumia_3 = "10000468RRR", - evmwhumia_3 = "1000046cRRR", - evmwhsmia_3 = "1000046dRRR", - evmwhsmfa_3 = "1000046fRRR", - evmwssfa_3 = "10000473RRR", - evmwumia_3 = "10000478RRR", - evmwsmia_3 = "10000479RRR", - evmwsmfa_3 = "1000047bRRR", - evmra_2 = "100004c4RR", - evdivws_3 = "100004c6RRR", - evdivwu_3 = "100004c7RRR", - evmwssfaa_3 = "10000553RRR", - evmwumiaa_3 = "10000558RRR", - evmwsmiaa_3 = "10000559RRR", - evmwsmfaa_3 = "1000055bRRR", - evmwssfan_3 = "100005d3RRR", - evmwumian_3 = "100005d8RRR", - evmwsmian_3 = "100005d9RRR", - evmwsmfan_3 = "100005dbRRR", - evmergehilo_3 = "1000022eRRR", - evmergelohi_3 = "1000022fRRR", - evlhhesplatx_3 = "10000308RR0R", - evlhhesplat_2 = "10000309R2", - evlhhousplatx_3 = "1000030cRR0R", - evlhhousplat_2 = "1000030dR2", - evlhhossplatx_3 = "1000030eRR0R", - evlhhossplat_2 = "1000030fR2", - evlwwsplatx_3 = "10000318RR0R", - evlwwsplat_2 = "10000319R4", - evlwhsplatx_3 = "1000031cRR0R", - evlwhsplat_2 = "1000031dR4", - evaddusiaaw_2 = "100004c0RR", - evaddssiaaw_2 = "100004c1RR", - evsubfusiaaw_2 = "100004c2RR", - evsubfssiaaw_2 = "100004c3RR", - evaddumiaaw_2 = "100004c8RR", - evaddsmiaaw_2 = "100004c9RR", - evsubfumiaaw_2 = "100004caRR", - evsubfsmiaaw_2 = "100004cbRR", - evmheusiaaw_3 = "10000500RRR", - evmhessiaaw_3 = "10000501RRR", - evmhessfaaw_3 = "10000503RRR", - evmhousiaaw_3 = "10000504RRR", - evmhossiaaw_3 = "10000505RRR", - evmhossfaaw_3 = "10000507RRR", - evmheumiaaw_3 = "10000508RRR", - evmhesmiaaw_3 = "10000509RRR", - evmhesmfaaw_3 = "1000050bRRR", - evmhoumiaaw_3 = "1000050cRRR", - evmhosmiaaw_3 = "1000050dRRR", - evmhosmfaaw_3 = "1000050fRRR", - evmhegumiaa_3 = "10000528RRR", - evmhegsmiaa_3 = "10000529RRR", - evmhegsmfaa_3 = "1000052bRRR", - evmhogumiaa_3 = "1000052cRRR", - evmhogsmiaa_3 = "1000052dRRR", - evmhogsmfaa_3 = "1000052fRRR", - evmwlusiaaw_3 = "10000540RRR", - evmwlssiaaw_3 = "10000541RRR", - evmwlumiaaw_3 = "10000548RRR", - evmwlsmiaaw_3 = "10000549RRR", - evmheusianw_3 = "10000580RRR", - evmhessianw_3 = "10000581RRR", - evmhessfanw_3 = "10000583RRR", - evmhousianw_3 = "10000584RRR", - evmhossianw_3 = "10000585RRR", - evmhossfanw_3 = "10000587RRR", - evmheumianw_3 = "10000588RRR", - evmhesmianw_3 = "10000589RRR", - evmhesmfanw_3 = "1000058bRRR", - evmhoumianw_3 = "1000058cRRR", - evmhosmianw_3 = "1000058dRRR", - evmhosmfanw_3 = "1000058fRRR", - evmhegumian_3 = "100005a8RRR", - evmhegsmian_3 = "100005a9RRR", - evmhegsmfan_3 = "100005abRRR", - evmhogumian_3 = "100005acRRR", - evmhogsmian_3 = "100005adRRR", - evmhogsmfan_3 = "100005afRRR", - evmwlusianw_3 = "100005c0RRR", - evmwlssianw_3 = "100005c1RRR", - evmwlumianw_3 = "100005c8RRR", - evmwlsmianw_3 = "100005c9RRR", - - -- NYI: Book E instructions. -} - --- Add mnemonics for "." variants. -do - local t = {} - for k,v in pairs(map_op) do - if sub(v, -1) == "." then - local v2 = sub(v, 1, 7)..char(byte(v, 8)+1)..sub(v, 9, -2) - t[sub(k, 1, -3).."."..sub(k, -2)] = v2 - end - end - for k,v in pairs(t) do - map_op[k] = v - end -end - --- Add more branch mnemonics. -for cond,c in pairs(map_cond) do - local b1 = "b"..cond - local c1 = shl(band(c, 3), 16) + (c < 4 and 0x01000000 or 0) - -- bX[l] - map_op[b1.."_1"] = tohex(0x40800000 + c1).."K" - map_op[b1.."y_1"] = tohex(0x40a00000 + c1).."K" - map_op[b1.."l_1"] = tohex(0x40800001 + c1).."K" - map_op[b1.."_2"] = tohex(0x40800000 + c1).."-XK" - map_op[b1.."y_2"] = tohex(0x40a00000 + c1).."-XK" - map_op[b1.."l_2"] = tohex(0x40800001 + c1).."-XK" - -- bXlr[l] - map_op[b1.."lr_0"] = tohex(0x4c800020 + c1) - map_op[b1.."lrl_0"] = tohex(0x4c800021 + c1) - map_op[b1.."ctr_0"] = tohex(0x4c800420 + c1) - map_op[b1.."ctrl_0"] = tohex(0x4c800421 + c1) - -- bXctr[l] - map_op[b1.."lr_1"] = tohex(0x4c800020 + c1).."-X" - map_op[b1.."lrl_1"] = tohex(0x4c800021 + c1).."-X" - map_op[b1.."ctr_1"] = tohex(0x4c800420 + c1).."-X" - map_op[b1.."ctrl_1"] = tohex(0x4c800421 + c1).."-X" -end - ------------------------------------------------------------------------------- - -local function parse_gpr(expr) - local tname, ovreg = match(expr, "^([%w_]+):(r[1-3]?[0-9])$") - local tp = map_type[tname or expr] - if tp then - local reg = ovreg or tp.reg - if not reg then - werror("type `"..(tname or expr).."' needs a register override") - end - expr = reg - end - local r = match(expr, "^r([1-3]?[0-9])$") - if r then - r = tonumber(r) - if r <= 31 then return r, tp end - end - werror("bad register name `"..expr.."'") -end - -local function parse_fpr(expr) - local r = match(expr, "^f([1-3]?[0-9])$") - if r then - r = tonumber(r) - if r <= 31 then return r end - end - werror("bad register name `"..expr.."'") -end - -local function parse_cr(expr) - local r = match(expr, "^cr([0-7])$") - if r then return tonumber(r) end - werror("bad condition register name `"..expr.."'") -end - -local function parse_cond(expr) - local r, cond = match(expr, "^4%*cr([0-7])%+(%w%w)$") - if r then - r = tonumber(r) - local c = map_cond[cond] - if c and c < 4 then return r*4+c end - end - werror("bad condition bit name `"..expr.."'") -end - -local function parse_imm(imm, bits, shift, scale, signed) - local n = tonumber(imm) - if n then - local m = sar(n, scale) - if shl(m, scale) == n then - if signed then - local s = sar(m, bits-1) - if s == 0 then return shl(m, shift) - elseif s == -1 then return shl(m + shl(1, bits), shift) end - else - if sar(m, bits) == 0 then return shl(m, shift) end - end - end - werror("out of range immediate `"..imm.."'") - elseif match(imm, "^r([1-3]?[0-9])$") or - match(imm, "^([%w_]+):(r[1-3]?[0-9])$") then - werror("expected immediate operand, got register") - else - waction("IMM", (signed and 32768 or 0)+scale*1024+bits*32+shift, imm) - return 0 - end -end - -local function parse_shiftmask(imm, isshift) - local n = tonumber(imm) - if n then - if shr(n, 6) == 0 then - local lsb = band(imm, 31) - local msb = imm - lsb - return isshift and (shl(lsb, 11)+shr(msb, 4)) or (shl(lsb, 6)+msb) - end - werror("out of range immediate `"..imm.."'") - elseif match(imm, "^r([1-3]?[0-9])$") or - match(imm, "^([%w_]+):(r[1-3]?[0-9])$") then - werror("expected immediate operand, got register") - else - werror("NYI: parameterized 64 bit shift/mask") - end -end - -local function parse_disp(disp) - local imm, reg = match(disp, "^(.*)%(([%w_:]+)%)$") - if imm then - local r = parse_gpr(reg) - if r == 0 then werror("cannot use r0 in displacement") end - return shl(r, 16) + parse_imm(imm, 16, 0, 0, true) - end - local reg, tailr = match(disp, "^([%w_:]+)%s*(.*)$") - if reg and tailr ~= "" then - local r, tp = parse_gpr(reg) - if r == 0 then werror("cannot use r0 in displacement") end - if tp then - waction("IMM", 32768+16*32, format(tp.ctypefmt, tailr)) - return shl(r, 16) - end - end - werror("bad displacement `"..disp.."'") -end - -local function parse_u5disp(disp, scale) - local imm, reg = match(disp, "^(.*)%(([%w_:]+)%)$") - if imm then - local r = parse_gpr(reg) - if r == 0 then werror("cannot use r0 in displacement") end - return shl(r, 16) + parse_imm(imm, 5, 11, scale, false) - end - local reg, tailr = match(disp, "^([%w_:]+)%s*(.*)$") - if reg and tailr ~= "" then - local r, tp = parse_gpr(reg) - if r == 0 then werror("cannot use r0 in displacement") end - if tp then - waction("IMM", scale*1024+5*32+11, format(tp.ctypefmt, tailr)) - return shl(r, 16) - end - end - werror("bad displacement `"..disp.."'") -end - -local function parse_label(label, def) - local prefix = sub(label, 1, 2) - -- =>label (pc label reference) - if prefix == "=>" then - return "PC", 0, sub(label, 3) - end - -- ->name (global label reference) - if prefix == "->" then - return "LG", map_global[sub(label, 3)] - end - if def then - -- [1-9] (local label definition) - if match(label, "^[1-9]$") then - return "LG", 10+tonumber(label) - end - else - -- [<>][1-9] (local label reference) - local dir, lnum = match(label, "^([<>])([1-9])$") - if dir then -- Fwd: 1-9, Bkwd: 11-19. - return "LG", lnum + (dir == ">" and 0 or 10) - end - -- extern label (extern label reference) - local extname = match(label, "^extern%s+(%S+)$") - if extname then - return "EXT", map_extern[extname] - end - end - werror("bad label `"..label.."'") -end - ------------------------------------------------------------------------------- - --- Handle opcodes defined with template strings. -map_op[".template__"] = function(params, template, nparams) - if not params then return sub(template, 9) end - local op = tonumber(sub(template, 1, 8), 16) - local n, rs = 1, 26 - - -- Limit number of section buffer positions used by a single dasm_put(). - -- A single opcode needs a maximum of 3 positions (rlwinm). - if secpos+3 > maxsecpos then wflush() end - local pos = wpos() - - -- Process each character. - for p in gmatch(sub(template, 9), ".") do - if p == "R" then - rs = rs - 5; op = op + shl(parse_gpr(params[n]), rs); n = n + 1 - elseif p == "F" then - rs = rs - 5; op = op + shl(parse_fpr(params[n]), rs); n = n + 1 - elseif p == "A" then - rs = rs - 5; op = op + parse_imm(params[n], 5, rs, 0, false); n = n + 1 - elseif p == "S" then - rs = rs - 5; op = op + parse_imm(params[n], 5, rs, 0, true); n = n + 1 - elseif p == "I" then - op = op + parse_imm(params[n], 16, 0, 0, true); n = n + 1 - elseif p == "U" then - op = op + parse_imm(params[n], 16, 0, 0, false); n = n + 1 - elseif p == "D" then - op = op + parse_disp(params[n]); n = n + 1 - elseif p == "2" then - op = op + parse_u5disp(params[n], 1); n = n + 1 - elseif p == "4" then - op = op + parse_u5disp(params[n], 2); n = n + 1 - elseif p == "8" then - op = op + parse_u5disp(params[n], 3); n = n + 1 - elseif p == "C" then - rs = rs - 5; op = op + shl(parse_cond(params[n]), rs); n = n + 1 - elseif p == "X" then - rs = rs - 5; op = op + shl(parse_cr(params[n]), rs+2); n = n + 1 - elseif p == "W" then - op = op + parse_cr(params[n]); n = n + 1 - elseif p == "G" then - op = op + parse_imm(params[n], 8, 12, 0, false); n = n + 1 - elseif p == "H" then - op = op + parse_shiftmask(params[n], true); n = n + 1 - elseif p == "M" then - op = op + parse_shiftmask(params[n], false); n = n + 1 - elseif p == "J" or p == "K" then - local mode, n, s = parse_label(params[n], false) - if p == "K" then n = n + 2048 end - waction("REL_"..mode, n, s, 1) - n = n + 1 - elseif p == "0" then - if band(shr(op, rs), 31) == 0 then werror("cannot use r0") end - elseif p == "=" or p == "%" then - local t = band(shr(op, p == "%" and rs+5 or rs), 31) - rs = rs - 5 - op = op + shl(t, rs) - elseif p == "~" then - local mm = shl(31, rs) - local lo = band(op, mm) - local hi = band(op, shl(mm, 5)) - op = op - lo - hi + shl(lo, 5) + shr(hi, 5) - elseif p == "-" then - rs = rs - 5 - elseif p == "." then - -- Ignored. - else - assert(false) - end - end - wputpos(pos, op) -end - ------------------------------------------------------------------------------- - --- Pseudo-opcode to mark the position where the action list is to be emitted. -map_op[".actionlist_1"] = function(params) - if not params then return "cvar" end - local name = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeactions(out, name) end) -end - --- Pseudo-opcode to mark the position where the global enum is to be emitted. -map_op[".globals_1"] = function(params) - if not params then return "prefix" end - local prefix = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeglobals(out, prefix) end) -end - --- Pseudo-opcode to mark the position where the global names are to be emitted. -map_op[".globalnames_1"] = function(params) - if not params then return "cvar" end - local name = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeglobalnames(out, name) end) -end - --- Pseudo-opcode to mark the position where the extern names are to be emitted. -map_op[".externnames_1"] = function(params) - if not params then return "cvar" end - local name = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeexternnames(out, name) end) -end - ------------------------------------------------------------------------------- - --- Label pseudo-opcode (converted from trailing colon form). -map_op[".label_1"] = function(params) - if not params then return "[1-9] | ->global | =>pcexpr" end - if secpos+1 > maxsecpos then wflush() end - local mode, n, s = parse_label(params[1], true) - if mode == "EXT" then werror("bad label definition") end - waction("LABEL_"..mode, n, s, 1) -end - ------------------------------------------------------------------------------- - --- Pseudo-opcodes for data storage. -map_op[".long_*"] = function(params) - if not params then return "imm..." end - for _,p in ipairs(params) do - local n = tonumber(p) - if not n then werror("bad immediate `"..p.."'") end - if n < 0 then n = n + 2^32 end - wputw(n) - if secpos+2 > maxsecpos then wflush() end - end -end - --- Alignment pseudo-opcode. -map_op[".align_1"] = function(params) - if not params then return "numpow2" end - if secpos+1 > maxsecpos then wflush() end - local align = tonumber(params[1]) - if align then - local x = align - -- Must be a power of 2 in the range (2 ... 256). - for i=1,8 do - x = x / 2 - if x == 1 then - waction("ALIGN", align-1, nil, 1) -- Action byte is 2**n-1. - return - end - end - end - werror("bad alignment") -end - ------------------------------------------------------------------------------- - --- Pseudo-opcode for (primitive) type definitions (map to C types). -map_op[".type_3"] = function(params, nparams) - if not params then - return nparams == 2 and "name, ctype" or "name, ctype, reg" - end - local name, ctype, reg = params[1], params[2], params[3] - if not match(name, "^[%a_][%w_]*$") then - werror("bad type name `"..name.."'") - end - local tp = map_type[name] - if tp then - werror("duplicate type `"..name.."'") - end - -- Add #type to defines. A bit unclean to put it in map_archdef. - map_archdef["#"..name] = "sizeof("..ctype..")" - -- Add new type and emit shortcut define. - local num = ctypenum + 1 - map_type[name] = { - ctype = ctype, - ctypefmt = format("Dt%X(%%s)", num), - reg = reg, - } - wline(format("#define Dt%X(_V) (int)(ptrdiff_t)&(((%s *)0)_V)", num, ctype)) - ctypenum = num -end -map_op[".type_2"] = map_op[".type_3"] - --- Dump type definitions. -local function dumptypes(out, lvl) - local t = {} - for name in pairs(map_type) do t[#t+1] = name end - sort(t) - out:write("Type definitions:\n") - for _,name in ipairs(t) do - local tp = map_type[name] - local reg = tp.reg or "" - out:write(format(" %-20s %-20s %s\n", name, tp.ctype, reg)) - end - out:write("\n") -end - ------------------------------------------------------------------------------- - --- Set the current section. -function _M.section(num) - waction("SECTION", num) - wflush(true) -- SECTION is a terminal action. -end - ------------------------------------------------------------------------------- - --- Dump architecture description. -function _M.dumparch(out) - out:write(format("DynASM %s version %s, released %s\n\n", - _info.arch, _info.version, _info.release)) - dumpactions(out) -end - --- Dump all user defined elements. -function _M.dumpdef(out, lvl) - dumptypes(out, lvl) - dumpglobals(out, lvl) - dumpexterns(out, lvl) -end - ------------------------------------------------------------------------------- - --- Pass callbacks from/to the DynASM core. -function _M.passcb(wl, we, wf, ww) - wline, werror, wfatal, wwarn = wl, we, wf, ww - return wflush -end - --- Setup the arch-specific module. -function _M.setup(arch, opt) - g_arch, g_opt = arch, opt -end - --- Merge the core maps and the arch-specific maps. -function _M.mergemaps(map_coreop, map_def) - setmetatable(map_op, { __index = map_coreop }) - setmetatable(map_def, { __index = map_archdef }) - return map_op, map_def -end - -return _M - ------------------------------------------------------------------------------- - diff --git a/subprojects/luajit/dynasm/dasm_proto.h b/subprojects/luajit/dynasm/dasm_proto.h deleted file mode 100644 index f5e79c7a3..000000000 --- a/subprojects/luajit/dynasm/dasm_proto.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -** DynASM encoding engine prototypes. -** Copyright (C) 2005-2017 Mike Pall. All rights reserved. -** Released under the MIT license. See dynasm.lua for full copyright notice. -*/ - -#ifndef _DASM_PROTO_H -#define _DASM_PROTO_H - -#include -#include - -#define DASM_IDENT "DynASM 1.3.0" -#define DASM_VERSION 10300 /* 1.3.0 */ - -#ifndef Dst_DECL -#define Dst_DECL dasm_State **Dst -#endif - -#ifndef Dst_REF -#define Dst_REF (*Dst) -#endif - -#ifndef DASM_FDEF -#define DASM_FDEF extern -#endif - -#ifndef DASM_M_GROW -#define DASM_M_GROW(ctx, t, p, sz, need) \ - do { \ - size_t _sz = (sz), _need = (need); \ - if (_sz < _need) { \ - if (_sz < 16) _sz = 16; \ - while (_sz < _need) _sz += _sz; \ - (p) = (t *)realloc((p), _sz); \ - if ((p) == NULL) exit(1); \ - (sz) = _sz; \ - } \ - } while(0) -#endif - -#ifndef DASM_M_FREE -#define DASM_M_FREE(ctx, p, sz) free(p) -#endif - -/* Internal DynASM encoder state. */ -typedef struct dasm_State dasm_State; - - -/* Initialize and free DynASM state. */ -DASM_FDEF void dasm_init(Dst_DECL, int maxsection); -DASM_FDEF void dasm_free(Dst_DECL); - -/* Setup global array. Must be called before dasm_setup(). */ -DASM_FDEF void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl); - -/* Grow PC label array. Can be called after dasm_setup(), too. */ -DASM_FDEF void dasm_growpc(Dst_DECL, unsigned int maxpc); - -/* Setup encoder. */ -DASM_FDEF void dasm_setup(Dst_DECL, const void *actionlist); - -/* Feed encoder with actions. Calls are generated by pre-processor. */ -DASM_FDEF void dasm_put(Dst_DECL, int start, ...); - -/* Link sections and return the resulting size. */ -DASM_FDEF int dasm_link(Dst_DECL, size_t *szp); - -/* Encode sections into buffer. */ -DASM_FDEF int dasm_encode(Dst_DECL, void *buffer); - -/* Get PC label offset. */ -DASM_FDEF int dasm_getpclabel(Dst_DECL, unsigned int pc); - -#ifdef DASM_CHECKS -/* Optional sanity checker to call between isolated encoding steps. */ -DASM_FDEF int dasm_checkstep(Dst_DECL, int secmatch); -#else -#define dasm_checkstep(a, b) 0 -#endif - - -#endif /* _DASM_PROTO_H */ diff --git a/subprojects/luajit/dynasm/dasm_x64.lua b/subprojects/luajit/dynasm/dasm_x64.lua deleted file mode 100644 index e8bdeb37d..000000000 --- a/subprojects/luajit/dynasm/dasm_x64.lua +++ /dev/null @@ -1,12 +0,0 @@ ------------------------------------------------------------------------------- --- DynASM x64 module. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------- --- This module just sets 64 bit mode for the combined x86/x64 module. --- All the interesting stuff is there. ------------------------------------------------------------------------------- - -x64 = true -- Using a global is an ugly, but effective solution. -return require("dasm_x86") diff --git a/subprojects/luajit/dynasm/dasm_x86.h b/subprojects/luajit/dynasm/dasm_x86.h deleted file mode 100644 index 90dc5d159..000000000 --- a/subprojects/luajit/dynasm/dasm_x86.h +++ /dev/null @@ -1,472 +0,0 @@ -/* -** DynASM x86 encoding engine. -** Copyright (C) 2005-2017 Mike Pall. All rights reserved. -** Released under the MIT license. See dynasm.lua for full copyright notice. -*/ - -#include -#include -#include -#include - -#define DASM_ARCH "x86" - -#ifndef DASM_EXTERN -#define DASM_EXTERN(a,b,c,d) 0 -#endif - -/* Action definitions. DASM_STOP must be 255. */ -enum { - DASM_DISP = 233, - DASM_IMM_S, DASM_IMM_B, DASM_IMM_W, DASM_IMM_D, DASM_IMM_WB, DASM_IMM_DB, - DASM_VREG, DASM_SPACE, DASM_SETLABEL, DASM_REL_A, DASM_REL_LG, DASM_REL_PC, - DASM_IMM_LG, DASM_IMM_PC, DASM_LABEL_LG, DASM_LABEL_PC, DASM_ALIGN, - DASM_EXTERN, DASM_ESC, DASM_MARK, DASM_SECTION, DASM_STOP -}; - -/* Maximum number of section buffer positions for a single dasm_put() call. */ -#define DASM_MAXSECPOS 25 - -/* DynASM encoder status codes. Action list offset or number are or'ed in. */ -#define DASM_S_OK 0x00000000 -#define DASM_S_NOMEM 0x01000000 -#define DASM_S_PHASE 0x02000000 -#define DASM_S_MATCH_SEC 0x03000000 -#define DASM_S_RANGE_I 0x11000000 -#define DASM_S_RANGE_SEC 0x12000000 -#define DASM_S_RANGE_LG 0x13000000 -#define DASM_S_RANGE_PC 0x14000000 -#define DASM_S_RANGE_VREG 0x15000000 -#define DASM_S_UNDEF_L 0x21000000 -#define DASM_S_UNDEF_PC 0x22000000 - -/* Macros to convert positions (8 bit section + 24 bit index). */ -#define DASM_POS2IDX(pos) ((pos)&0x00ffffff) -#define DASM_POS2BIAS(pos) ((pos)&0xff000000) -#define DASM_SEC2POS(sec) ((sec)<<24) -#define DASM_POS2SEC(pos) ((pos)>>24) -#define DASM_POS2PTR(D, pos) (D->sections[DASM_POS2SEC(pos)].rbuf + (pos)) - -/* Action list type. */ -typedef const unsigned char *dasm_ActList; - -/* Per-section structure. */ -typedef struct dasm_Section { - int *rbuf; /* Biased buffer pointer (negative section bias). */ - int *buf; /* True buffer pointer. */ - size_t bsize; /* Buffer size in bytes. */ - int pos; /* Biased buffer position. */ - int epos; /* End of biased buffer position - max single put. */ - int ofs; /* Byte offset into section. */ -} dasm_Section; - -/* Core structure holding the DynASM encoding state. */ -struct dasm_State { - size_t psize; /* Allocated size of this structure. */ - dasm_ActList actionlist; /* Current actionlist pointer. */ - int *lglabels; /* Local/global chain/pos ptrs. */ - size_t lgsize; - int *pclabels; /* PC label chains/pos ptrs. */ - size_t pcsize; - void **globals; /* Array of globals (bias -10). */ - dasm_Section *section; /* Pointer to active section. */ - size_t codesize; /* Total size of all code sections. */ - int maxsection; /* 0 <= sectionidx < maxsection. */ - int status; /* Status code. */ - dasm_Section sections[1]; /* All sections. Alloc-extended. */ -}; - -/* The size of the core structure depends on the max. number of sections. */ -#define DASM_PSZ(ms) (sizeof(dasm_State)+(ms-1)*sizeof(dasm_Section)) - - -/* Initialize DynASM state. */ -void dasm_init(Dst_DECL, int maxsection) -{ - dasm_State *D; - size_t psz = 0; - int i; - Dst_REF = NULL; - DASM_M_GROW(Dst, struct dasm_State, Dst_REF, psz, DASM_PSZ(maxsection)); - D = Dst_REF; - D->psize = psz; - D->lglabels = NULL; - D->lgsize = 0; - D->pclabels = NULL; - D->pcsize = 0; - D->globals = NULL; - D->maxsection = maxsection; - for (i = 0; i < maxsection; i++) { - D->sections[i].buf = NULL; /* Need this for pass3. */ - D->sections[i].rbuf = D->sections[i].buf - DASM_SEC2POS(i); - D->sections[i].bsize = 0; - D->sections[i].epos = 0; /* Wrong, but is recalculated after resize. */ - } -} - -/* Free DynASM state. */ -void dasm_free(Dst_DECL) -{ - dasm_State *D = Dst_REF; - int i; - for (i = 0; i < D->maxsection; i++) - if (D->sections[i].buf) - DASM_M_FREE(Dst, D->sections[i].buf, D->sections[i].bsize); - if (D->pclabels) DASM_M_FREE(Dst, D->pclabels, D->pcsize); - if (D->lglabels) DASM_M_FREE(Dst, D->lglabels, D->lgsize); - DASM_M_FREE(Dst, D, D->psize); -} - -/* Setup global label array. Must be called before dasm_setup(). */ -void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl) -{ - dasm_State *D = Dst_REF; - D->globals = gl - 10; /* Negative bias to compensate for locals. */ - DASM_M_GROW(Dst, int, D->lglabels, D->lgsize, (10+maxgl)*sizeof(int)); -} - -/* Grow PC label array. Can be called after dasm_setup(), too. */ -void dasm_growpc(Dst_DECL, unsigned int maxpc) -{ - dasm_State *D = Dst_REF; - size_t osz = D->pcsize; - DASM_M_GROW(Dst, int, D->pclabels, D->pcsize, maxpc*sizeof(int)); - memset((void *)(((unsigned char *)D->pclabels)+osz), 0, D->pcsize-osz); -} - -/* Setup encoder. */ -void dasm_setup(Dst_DECL, const void *actionlist) -{ - dasm_State *D = Dst_REF; - int i; - D->actionlist = (dasm_ActList)actionlist; - D->status = DASM_S_OK; - D->section = &D->sections[0]; - memset((void *)D->lglabels, 0, D->lgsize); - if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize); - for (i = 0; i < D->maxsection; i++) { - D->sections[i].pos = DASM_SEC2POS(i); - D->sections[i].ofs = 0; - } -} - - -#ifdef DASM_CHECKS -#define CK(x, st) \ - do { if (!(x)) { \ - D->status = DASM_S_##st|(int)(p-D->actionlist-1); return; } } while (0) -#define CKPL(kind, st) \ - do { if ((size_t)((char *)pl-(char *)D->kind##labels) >= D->kind##size) { \ - D->status=DASM_S_RANGE_##st|(int)(p-D->actionlist-1); return; } } while (0) -#else -#define CK(x, st) ((void)0) -#define CKPL(kind, st) ((void)0) -#endif - -/* Pass 1: Store actions and args, link branches/labels, estimate offsets. */ -void dasm_put(Dst_DECL, int start, ...) -{ - va_list ap; - dasm_State *D = Dst_REF; - dasm_ActList p = D->actionlist + start; - dasm_Section *sec = D->section; - int pos = sec->pos, ofs = sec->ofs, mrm = 4; - int *b; - - if (pos >= sec->epos) { - DASM_M_GROW(Dst, int, sec->buf, sec->bsize, - sec->bsize + 2*DASM_MAXSECPOS*sizeof(int)); - sec->rbuf = sec->buf - DASM_POS2BIAS(pos); - sec->epos = (int)sec->bsize/sizeof(int) - DASM_MAXSECPOS+DASM_POS2BIAS(pos); - } - - b = sec->rbuf; - b[pos++] = start; - - va_start(ap, start); - while (1) { - int action = *p++; - if (action < DASM_DISP) { - ofs++; - } else if (action <= DASM_REL_A) { - int n = va_arg(ap, int); - b[pos++] = n; - switch (action) { - case DASM_DISP: - if (n == 0) { if ((mrm&7) == 4) mrm = p[-2]; if ((mrm&7) != 5) break; } - case DASM_IMM_DB: if (((n+128)&-256) == 0) goto ob; - case DASM_REL_A: /* Assumes ptrdiff_t is int. !x64 */ - case DASM_IMM_D: ofs += 4; break; - case DASM_IMM_S: CK(((n+128)&-256) == 0, RANGE_I); goto ob; - case DASM_IMM_B: CK((n&-256) == 0, RANGE_I); ob: ofs++; break; - case DASM_IMM_WB: if (((n+128)&-256) == 0) goto ob; - case DASM_IMM_W: CK((n&-65536) == 0, RANGE_I); ofs += 2; break; - case DASM_SPACE: p++; ofs += n; break; - case DASM_SETLABEL: b[pos-2] = -0x40000000; break; /* Neg. label ofs. */ - case DASM_VREG: CK((n&-8) == 0 && (n != 4 || (*p&1) == 0), RANGE_VREG); - if (*p++ == 1 && *p == DASM_DISP) mrm = n; - continue; - } - mrm = 4; - } else { - int *pl, n; - switch (action) { - case DASM_REL_LG: - case DASM_IMM_LG: - n = *p++; pl = D->lglabels + n; - /* Bkwd rel or global. */ - if (n <= 246) { CK(n>=10||*pl<0, RANGE_LG); CKPL(lg, LG); goto putrel; } - pl -= 246; n = *pl; - if (n < 0) n = 0; /* Start new chain for fwd rel if label exists. */ - goto linkrel; - case DASM_REL_PC: - case DASM_IMM_PC: pl = D->pclabels + va_arg(ap, int); CKPL(pc, PC); - putrel: - n = *pl; - if (n < 0) { /* Label exists. Get label pos and store it. */ - b[pos] = -n; - } else { - linkrel: - b[pos] = n; /* Else link to rel chain, anchored at label. */ - *pl = pos; - } - pos++; - ofs += 4; /* Maximum offset needed. */ - if (action == DASM_REL_LG || action == DASM_REL_PC) - b[pos++] = ofs; /* Store pass1 offset estimate. */ - break; - case DASM_LABEL_LG: pl = D->lglabels + *p++; CKPL(lg, LG); goto putlabel; - case DASM_LABEL_PC: pl = D->pclabels + va_arg(ap, int); CKPL(pc, PC); - putlabel: - n = *pl; /* n > 0: Collapse rel chain and replace with label pos. */ - while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = pos; } - *pl = -pos; /* Label exists now. */ - b[pos++] = ofs; /* Store pass1 offset estimate. */ - break; - case DASM_ALIGN: - ofs += *p++; /* Maximum alignment needed (arg is 2**n-1). */ - b[pos++] = ofs; /* Store pass1 offset estimate. */ - break; - case DASM_EXTERN: p += 2; ofs += 4; break; - case DASM_ESC: p++; ofs++; break; - case DASM_MARK: mrm = p[-2]; break; - case DASM_SECTION: - n = *p; CK(n < D->maxsection, RANGE_SEC); D->section = &D->sections[n]; - case DASM_STOP: goto stop; - } - } - } -stop: - va_end(ap); - sec->pos = pos; - sec->ofs = ofs; -} -#undef CK - -/* Pass 2: Link sections, shrink branches/aligns, fix label offsets. */ -int dasm_link(Dst_DECL, size_t *szp) -{ - dasm_State *D = Dst_REF; - int secnum; - int ofs = 0; - -#ifdef DASM_CHECKS - *szp = 0; - if (D->status != DASM_S_OK) return D->status; - { - int pc; - for (pc = 0; pc*sizeof(int) < D->pcsize; pc++) - if (D->pclabels[pc] > 0) return DASM_S_UNDEF_PC|pc; - } -#endif - - { /* Handle globals not defined in this translation unit. */ - int idx; - for (idx = 10; idx*sizeof(int) < D->lgsize; idx++) { - int n = D->lglabels[idx]; - /* Undefined label: Collapse rel chain and replace with marker (< 0). */ - while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = -idx; } - } - } - - /* Combine all code sections. No support for data sections (yet). */ - for (secnum = 0; secnum < D->maxsection; secnum++) { - dasm_Section *sec = D->sections + secnum; - int *b = sec->rbuf; - int pos = DASM_SEC2POS(secnum); - int lastpos = sec->pos; - - while (pos != lastpos) { - dasm_ActList p = D->actionlist + b[pos++]; - while (1) { - int op, action = *p++; - switch (action) { - case DASM_REL_LG: p++; op = p[-3]; goto rel_pc; - case DASM_REL_PC: op = p[-2]; rel_pc: { - int shrink = op == 0xe9 ? 3 : ((op&0xf0) == 0x80 ? 4 : 0); - if (shrink) { /* Shrinkable branch opcode? */ - int lofs, lpos = b[pos]; - if (lpos < 0) goto noshrink; /* Ext global? */ - lofs = *DASM_POS2PTR(D, lpos); - if (lpos > pos) { /* Fwd label: add cumulative section offsets. */ - int i; - for (i = secnum; i < DASM_POS2SEC(lpos); i++) - lofs += D->sections[i].ofs; - } else { - lofs -= ofs; /* Bkwd label: unfix offset. */ - } - lofs -= b[pos+1]; /* Short branch ok? */ - if (lofs >= -128-shrink && lofs <= 127) ofs -= shrink; /* Yes. */ - else { noshrink: shrink = 0; } /* No, cannot shrink op. */ - } - b[pos+1] = shrink; - pos += 2; - break; - } - case DASM_SPACE: case DASM_IMM_LG: case DASM_VREG: p++; - case DASM_DISP: case DASM_IMM_S: case DASM_IMM_B: case DASM_IMM_W: - case DASM_IMM_D: case DASM_IMM_WB: case DASM_IMM_DB: - case DASM_SETLABEL: case DASM_REL_A: case DASM_IMM_PC: pos++; break; - case DASM_LABEL_LG: p++; - case DASM_LABEL_PC: b[pos++] += ofs; break; /* Fix label offset. */ - case DASM_ALIGN: ofs -= (b[pos++]+ofs)&*p++; break; /* Adjust ofs. */ - case DASM_EXTERN: p += 2; break; - case DASM_ESC: p++; break; - case DASM_MARK: break; - case DASM_SECTION: case DASM_STOP: goto stop; - } - } - stop: (void)0; - } - ofs += sec->ofs; /* Next section starts right after current section. */ - } - - D->codesize = ofs; /* Total size of all code sections */ - *szp = ofs; - return DASM_S_OK; -} - -#define dasmb(x) *cp++ = (unsigned char)(x) -#ifndef DASM_ALIGNED_WRITES -#define dasmw(x) \ - do { *((unsigned short *)cp) = (unsigned short)(x); cp+=2; } while (0) -#define dasmd(x) \ - do { *((unsigned int *)cp) = (unsigned int)(x); cp+=4; } while (0) -#else -#define dasmw(x) do { dasmb(x); dasmb((x)>>8); } while (0) -#define dasmd(x) do { dasmw(x); dasmw((x)>>16); } while (0) -#endif - -/* Pass 3: Encode sections. */ -int dasm_encode(Dst_DECL, void *buffer) -{ - dasm_State *D = Dst_REF; - unsigned char *base = (unsigned char *)buffer; - unsigned char *cp = base; - int secnum; - - /* Encode all code sections. No support for data sections (yet). */ - for (secnum = 0; secnum < D->maxsection; secnum++) { - dasm_Section *sec = D->sections + secnum; - int *b = sec->buf; - int *endb = sec->rbuf + sec->pos; - - while (b != endb) { - dasm_ActList p = D->actionlist + *b++; - unsigned char *mark = NULL; - while (1) { - int action = *p++; - int n = (action >= DASM_DISP && action <= DASM_ALIGN) ? *b++ : 0; - switch (action) { - case DASM_DISP: if (!mark) mark = cp; { - unsigned char *mm = mark; - if (*p != DASM_IMM_DB && *p != DASM_IMM_WB) mark = NULL; - if (n == 0) { int mrm = mm[-1]&7; if (mrm == 4) mrm = mm[0]&7; - if (mrm != 5) { mm[-1] -= 0x80; break; } } - if (((n+128) & -256) != 0) goto wd; else mm[-1] -= 0x40; - } - case DASM_IMM_S: case DASM_IMM_B: wb: dasmb(n); break; - case DASM_IMM_DB: if (((n+128)&-256) == 0) { - db: if (!mark) mark = cp; mark[-2] += 2; mark = NULL; goto wb; - } else mark = NULL; - case DASM_IMM_D: wd: dasmd(n); break; - case DASM_IMM_WB: if (((n+128)&-256) == 0) goto db; else mark = NULL; - case DASM_IMM_W: dasmw(n); break; - case DASM_VREG: { int t = *p++; if (t >= 2) n<<=3; cp[-1] |= n; break; } - case DASM_REL_LG: p++; if (n >= 0) goto rel_pc; - b++; n = (int)(ptrdiff_t)D->globals[-n]; - case DASM_REL_A: rel_a: n -= (int)(ptrdiff_t)(cp+4); goto wd; /* !x64 */ - case DASM_REL_PC: rel_pc: { - int shrink = *b++; - int *pb = DASM_POS2PTR(D, n); if (*pb < 0) { n = pb[1]; goto rel_a; } - n = *pb - ((int)(cp-base) + 4-shrink); - if (shrink == 0) goto wd; - if (shrink == 4) { cp--; cp[-1] = *cp-0x10; } else cp[-1] = 0xeb; - goto wb; - } - case DASM_IMM_LG: - p++; if (n < 0) { n = (int)(ptrdiff_t)D->globals[-n]; goto wd; } - case DASM_IMM_PC: { - int *pb = DASM_POS2PTR(D, n); - n = *pb < 0 ? pb[1] : (*pb + (int)(ptrdiff_t)base); - goto wd; - } - case DASM_LABEL_LG: { - int idx = *p++; - if (idx >= 10) - D->globals[idx] = (void *)(base + (*p == DASM_SETLABEL ? *b : n)); - break; - } - case DASM_LABEL_PC: case DASM_SETLABEL: break; - case DASM_SPACE: { int fill = *p++; while (n--) *cp++ = fill; break; } - case DASM_ALIGN: - n = *p++; - while (((cp-base) & n)) *cp++ = 0x90; /* nop */ - break; - case DASM_EXTERN: n = DASM_EXTERN(Dst, cp, p[1], *p); p += 2; goto wd; - case DASM_MARK: mark = cp; break; - case DASM_ESC: action = *p++; - default: *cp++ = action; break; - case DASM_SECTION: case DASM_STOP: goto stop; - } - } - stop: (void)0; - } - } - - if (base + D->codesize != cp) /* Check for phase errors. */ - return DASM_S_PHASE; - return DASM_S_OK; -} - -/* Get PC label offset. */ -int dasm_getpclabel(Dst_DECL, unsigned int pc) -{ - dasm_State *D = Dst_REF; - if (pc*sizeof(int) < D->pcsize) { - int pos = D->pclabels[pc]; - if (pos < 0) return *DASM_POS2PTR(D, -pos); - if (pos > 0) return -1; /* Undefined. */ - } - return -2; /* Unused or out of range. */ -} - -#ifdef DASM_CHECKS -/* Optional sanity checker to call between isolated encoding steps. */ -int dasm_checkstep(Dst_DECL, int secmatch) -{ - dasm_State *D = Dst_REF; - if (D->status == DASM_S_OK) { - int i; - for (i = 1; i <= 9; i++) { - if (D->lglabels[i] > 0) { D->status = DASM_S_UNDEF_L|i; break; } - D->lglabels[i] = 0; - } - } - if (D->status == DASM_S_OK && secmatch >= 0 && - D->section != &D->sections[secmatch]) - D->status = DASM_S_MATCH_SEC|(int)(D->section-D->sections); - return D->status; -} -#endif - diff --git a/subprojects/luajit/dynasm/dasm_x86.lua b/subprojects/luajit/dynasm/dasm_x86.lua deleted file mode 100644 index 21c208655..000000000 --- a/subprojects/luajit/dynasm/dasm_x86.lua +++ /dev/null @@ -1,1946 +0,0 @@ ------------------------------------------------------------------------------- --- DynASM x86/x64 module. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------- - -local x64 = x64 - --- Module information: -local _info = { - arch = x64 and "x64" or "x86", - description = "DynASM x86/x64 module", - version = "1.3.0", - vernum = 10300, - release = "2011-05-05", - author = "Mike Pall", - license = "MIT", -} - --- Exported glue functions for the arch-specific module. -local _M = { _info = _info } - --- Cache library functions. -local type, tonumber, pairs, ipairs = type, tonumber, pairs, ipairs -local assert, unpack, setmetatable = assert, unpack or table.unpack, setmetatable -local _s = string -local sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char -local find, match, gmatch, gsub = _s.find, _s.match, _s.gmatch, _s.gsub -local concat, sort = table.concat, table.sort -local bit = bit or require("bit") -local band, shl, shr = bit.band, bit.lshift, bit.rshift - --- Inherited tables and callbacks. -local g_opt, g_arch -local wline, werror, wfatal, wwarn - --- Action name list. --- CHECK: Keep this in sync with the C code! -local action_names = { - -- int arg, 1 buffer pos: - "DISP", "IMM_S", "IMM_B", "IMM_W", "IMM_D", "IMM_WB", "IMM_DB", - -- action arg (1 byte), int arg, 1 buffer pos (reg/num): - "VREG", "SPACE", -- !x64: VREG support NYI. - -- ptrdiff_t arg, 1 buffer pos (address): !x64 - "SETLABEL", "REL_A", - -- action arg (1 byte) or int arg, 2 buffer pos (link, offset): - "REL_LG", "REL_PC", - -- action arg (1 byte) or int arg, 1 buffer pos (link): - "IMM_LG", "IMM_PC", - -- action arg (1 byte) or int arg, 1 buffer pos (offset): - "LABEL_LG", "LABEL_PC", - -- action arg (1 byte), 1 buffer pos (offset): - "ALIGN", - -- action args (2 bytes), no buffer pos. - "EXTERN", - -- action arg (1 byte), no buffer pos. - "ESC", - -- no action arg, no buffer pos. - "MARK", - -- action arg (1 byte), no buffer pos, terminal action: - "SECTION", - -- no args, no buffer pos, terminal action: - "STOP" -} - --- Maximum number of section buffer positions for dasm_put(). --- CHECK: Keep this in sync with the C code! -local maxsecpos = 25 -- Keep this low, to avoid excessively long C lines. - --- Action name -> action number (dynamically generated below). -local map_action = {} --- First action number. Everything below does not need to be escaped. -local actfirst = 256-#action_names - --- Action list buffer and string (only used to remove dupes). -local actlist = {} -local actstr = "" - --- Argument list for next dasm_put(). Start with offset 0 into action list. -local actargs = { 0 } - --- Current number of section buffer positions for dasm_put(). -local secpos = 1 - ------------------------------------------------------------------------------- - --- Compute action numbers for action names. -for n,name in ipairs(action_names) do - local num = actfirst + n - 1 - map_action[name] = num -end - --- Dump action names and numbers. -local function dumpactions(out) - out:write("DynASM encoding engine action codes:\n") - for n,name in ipairs(action_names) do - local num = map_action[name] - out:write(format(" %-10s %02X %d\n", name, num, num)) - end - out:write("\n") -end - --- Write action list buffer as a huge static C array. -local function writeactions(out, name) - local nn = #actlist - local last = actlist[nn] or 255 - actlist[nn] = nil -- Remove last byte. - if nn == 0 then nn = 1 end - out:write("static const unsigned char ", name, "[", nn, "] = {\n") - local s = " " - for n,b in ipairs(actlist) do - s = s..b.."," - if #s >= 75 then - assert(out:write(s, "\n")) - s = " " - end - end - out:write(s, last, "\n};\n\n") -- Add last byte back. -end - ------------------------------------------------------------------------------- - --- Add byte to action list. -local function wputxb(n) - assert(n >= 0 and n <= 255 and n % 1 == 0, "byte out of range") - actlist[#actlist+1] = n -end - --- Add action to list with optional arg. Advance buffer pos, too. -local function waction(action, a, num) - wputxb(assert(map_action[action], "bad action name `"..action.."'")) - if a then actargs[#actargs+1] = a end - if a or num then secpos = secpos + (num or 1) end -end - --- Add call to embedded DynASM C code. -local function wcall(func, args) - wline(format("dasm_%s(Dst, %s);", func, concat(args, ", ")), true) -end - --- Delete duplicate action list chunks. A tad slow, but so what. -local function dedupechunk(offset) - local al, as = actlist, actstr - local chunk = char(unpack(al, offset+1, #al)) - local orig = find(as, chunk, 1, true) - if orig then - actargs[1] = orig-1 -- Replace with original offset. - for i=offset+1,#al do al[i] = nil end -- Kill dupe. - else - actstr = as..chunk - end -end - --- Flush action list (intervening C code or buffer pos overflow). -local function wflush(term) - local offset = actargs[1] - if #actlist == offset then return end -- Nothing to flush. - if not term then waction("STOP") end -- Terminate action list. - dedupechunk(offset) - wcall("put", actargs) -- Add call to dasm_put(). - actargs = { #actlist } -- Actionlist offset is 1st arg to next dasm_put(). - secpos = 1 -- The actionlist offset occupies a buffer position, too. -end - --- Put escaped byte. -local function wputb(n) - if n >= actfirst then waction("ESC") end -- Need to escape byte. - wputxb(n) -end - ------------------------------------------------------------------------------- - --- Global label name -> global label number. With auto assignment on 1st use. -local next_global = 10 -local map_global = setmetatable({}, { __index = function(t, name) - if not match(name, "^[%a_][%w_@]*$") then werror("bad global label") end - local n = next_global - if n > 246 then werror("too many global labels") end - next_global = n + 1 - t[name] = n - return n -end}) - --- Dump global labels. -local function dumpglobals(out, lvl) - local t = {} - for name, n in pairs(map_global) do t[n] = name end - out:write("Global labels:\n") - for i=10,next_global-1 do - out:write(format(" %s\n", t[i])) - end - out:write("\n") -end - --- Write global label enum. -local function writeglobals(out, prefix) - local t = {} - for name, n in pairs(map_global) do t[n] = name end - out:write("enum {\n") - for i=10,next_global-1 do - out:write(" ", prefix, gsub(t[i], "@.*", ""), ",\n") - end - out:write(" ", prefix, "_MAX\n};\n") -end - --- Write global label names. -local function writeglobalnames(out, name) - local t = {} - for name, n in pairs(map_global) do t[n] = name end - out:write("static const char *const ", name, "[] = {\n") - for i=10,next_global-1 do - out:write(" \"", t[i], "\",\n") - end - out:write(" (const char *)0\n};\n") -end - ------------------------------------------------------------------------------- - --- Extern label name -> extern label number. With auto assignment on 1st use. -local next_extern = -1 -local map_extern = setmetatable({}, { __index = function(t, name) - -- No restrictions on the name for now. - local n = next_extern - if n < -256 then werror("too many extern labels") end - next_extern = n - 1 - t[name] = n - return n -end}) - --- Dump extern labels. -local function dumpexterns(out, lvl) - local t = {} - for name, n in pairs(map_extern) do t[-n] = name end - out:write("Extern labels:\n") - for i=1,-next_extern-1 do - out:write(format(" %s\n", t[i])) - end - out:write("\n") -end - --- Write extern label names. -local function writeexternnames(out, name) - local t = {} - for name, n in pairs(map_extern) do t[-n] = name end - out:write("static const char *const ", name, "[] = {\n") - for i=1,-next_extern-1 do - out:write(" \"", t[i], "\",\n") - end - out:write(" (const char *)0\n};\n") -end - ------------------------------------------------------------------------------- - --- Arch-specific maps. -local map_archdef = {} -- Ext. register name -> int. name. -local map_reg_rev = {} -- Int. register name -> ext. name. -local map_reg_num = {} -- Int. register name -> register number. -local map_reg_opsize = {} -- Int. register name -> operand size. -local map_reg_valid_base = {} -- Int. register name -> valid base register? -local map_reg_valid_index = {} -- Int. register name -> valid index register? -local map_reg_needrex = {} -- Int. register name -> need rex vs. no rex. -local reg_list = {} -- Canonical list of int. register names. - -local map_type = {} -- Type name -> { ctype, reg } -local ctypenum = 0 -- Type number (for _PTx macros). - -local addrsize = x64 and "q" or "d" -- Size for address operands. - --- Helper functions to fill register maps. -local function mkrmap(sz, cl, names) - local cname = format("@%s", sz) - reg_list[#reg_list+1] = cname - map_archdef[cl] = cname - map_reg_rev[cname] = cl - map_reg_num[cname] = -1 - map_reg_opsize[cname] = sz - if sz == addrsize or sz == "d" then - map_reg_valid_base[cname] = true - map_reg_valid_index[cname] = true - end - if names then - for n,name in ipairs(names) do - local iname = format("@%s%x", sz, n-1) - reg_list[#reg_list+1] = iname - map_archdef[name] = iname - map_reg_rev[iname] = name - map_reg_num[iname] = n-1 - map_reg_opsize[iname] = sz - if sz == "b" and n > 4 then map_reg_needrex[iname] = false end - if sz == addrsize or sz == "d" then - map_reg_valid_base[iname] = true - map_reg_valid_index[iname] = true - end - end - end - for i=0,(x64 and sz ~= "f") and 15 or 7 do - local needrex = sz == "b" and i > 3 - local iname = format("@%s%x%s", sz, i, needrex and "R" or "") - if needrex then map_reg_needrex[iname] = true end - local name - if sz == "o" then name = format("xmm%d", i) - elseif sz == "f" then name = format("st%d", i) - else name = format("r%d%s", i, sz == addrsize and "" or sz) end - map_archdef[name] = iname - if not map_reg_rev[iname] then - reg_list[#reg_list+1] = iname - map_reg_rev[iname] = name - map_reg_num[iname] = i - map_reg_opsize[iname] = sz - if sz == addrsize or sz == "d" then - map_reg_valid_base[iname] = true - map_reg_valid_index[iname] = true - end - end - end - reg_list[#reg_list+1] = "" -end - --- Integer registers (qword, dword, word and byte sized). -if x64 then - mkrmap("q", "Rq", {"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi"}) -end -mkrmap("d", "Rd", {"eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi"}) -mkrmap("w", "Rw", {"ax", "cx", "dx", "bx", "sp", "bp", "si", "di"}) -mkrmap("b", "Rb", {"al", "cl", "dl", "bl", "ah", "ch", "dh", "bh"}) -map_reg_valid_index[map_archdef.esp] = false -if x64 then map_reg_valid_index[map_archdef.rsp] = false end -map_archdef["Ra"] = "@"..addrsize - --- FP registers (internally tword sized, but use "f" as operand size). -mkrmap("f", "Rf") - --- SSE registers (oword sized, but qword and dword accessible). -mkrmap("o", "xmm") - --- Operand size prefixes to codes. -local map_opsize = { - byte = "b", word = "w", dword = "d", qword = "q", oword = "o", tword = "t", - aword = addrsize, -} - --- Operand size code to number. -local map_opsizenum = { - b = 1, w = 2, d = 4, q = 8, o = 16, t = 10, -} - --- Operand size code to name. -local map_opsizename = { - b = "byte", w = "word", d = "dword", q = "qword", o = "oword", t = "tword", - f = "fpword", -} - --- Valid index register scale factors. -local map_xsc = { - ["1"] = 0, ["2"] = 1, ["4"] = 2, ["8"] = 3, -} - --- Condition codes. -local map_cc = { - o = 0, no = 1, b = 2, nb = 3, e = 4, ne = 5, be = 6, nbe = 7, - s = 8, ns = 9, p = 10, np = 11, l = 12, nl = 13, le = 14, nle = 15, - c = 2, nae = 2, nc = 3, ae = 3, z = 4, nz = 5, na = 6, a = 7, - pe = 10, po = 11, nge = 12, ge = 13, ng = 14, g = 15, -} - - --- Reverse defines for registers. -function _M.revdef(s) - return gsub(s, "@%w+", map_reg_rev) -end - --- Dump register names and numbers -local function dumpregs(out) - out:write("Register names, sizes and internal numbers:\n") - for _,reg in ipairs(reg_list) do - if reg == "" then - out:write("\n") - else - local name = map_reg_rev[reg] - local num = map_reg_num[reg] - local opsize = map_opsizename[map_reg_opsize[reg]] - out:write(format(" %-5s %-8s %s\n", name, opsize, - num < 0 and "(variable)" or num)) - end - end -end - ------------------------------------------------------------------------------- - --- Put action for label arg (IMM_LG, IMM_PC, REL_LG, REL_PC). -local function wputlabel(aprefix, imm, num) - if type(imm) == "number" then - if imm < 0 then - waction("EXTERN") - wputxb(aprefix == "IMM_" and 0 or 1) - imm = -imm-1 - else - waction(aprefix.."LG", nil, num); - end - wputxb(imm) - else - waction(aprefix.."PC", imm, num) - end -end - --- Put signed byte or arg. -local function wputsbarg(n) - if type(n) == "number" then - if n < -128 or n > 127 then - werror("signed immediate byte out of range") - end - if n < 0 then n = n + 256 end - wputb(n) - else waction("IMM_S", n) end -end - --- Put unsigned byte or arg. -local function wputbarg(n) - if type(n) == "number" then - if n < 0 or n > 255 then - werror("unsigned immediate byte out of range") - end - wputb(n) - else waction("IMM_B", n) end -end - --- Put unsigned word or arg. -local function wputwarg(n) - if type(n) == "number" then - if shr(n, 16) ~= 0 then - werror("unsigned immediate word out of range") - end - wputb(band(n, 255)); wputb(shr(n, 8)); - else waction("IMM_W", n) end -end - --- Put signed or unsigned dword or arg. -local function wputdarg(n) - local tn = type(n) - if tn == "number" then - wputb(band(n, 255)) - wputb(band(shr(n, 8), 255)) - wputb(band(shr(n, 16), 255)) - wputb(shr(n, 24)) - elseif tn == "table" then - wputlabel("IMM_", n[1], 1) - else - waction("IMM_D", n) - end -end - --- Put operand-size dependent number or arg (defaults to dword). -local function wputszarg(sz, n) - if not sz or sz == "d" or sz == "q" then wputdarg(n) - elseif sz == "w" then wputwarg(n) - elseif sz == "b" then wputbarg(n) - elseif sz == "s" then wputsbarg(n) - else werror("bad operand size") end -end - --- Put multi-byte opcode with operand-size dependent modifications. -local function wputop(sz, op, rex) - local r - if rex ~= 0 and not x64 then werror("bad operand size") end - if sz == "w" then wputb(102) end - -- Needs >32 bit numbers, but only for crc32 eax, word [ebx] - if op >= 4294967296 then r = op%4294967296 wputb((op-r)/4294967296) op = r end - if op >= 16777216 then wputb(shr(op, 24)); op = band(op, 0xffffff) end - if op >= 65536 then - if rex ~= 0 then - local opc3 = band(op, 0xffff00) - if opc3 == 0x0f3a00 or opc3 == 0x0f3800 then - wputb(64 + band(rex, 15)); rex = 0 - end - end - wputb(shr(op, 16)); op = band(op, 0xffff) - end - if op >= 256 then - local b = shr(op, 8) - if b == 15 and rex ~= 0 then wputb(64 + band(rex, 15)); rex = 0 end - wputb(b) - op = band(op, 255) - end - if rex ~= 0 then wputb(64 + band(rex, 15)) end - if sz == "b" then op = op - 1 end - wputb(op) -end - --- Put ModRM or SIB formatted byte. -local function wputmodrm(m, s, rm, vs, vrm) - assert(m < 4 and s < 16 and rm < 16, "bad modrm operands") - wputb(shl(m, 6) + shl(band(s, 7), 3) + band(rm, 7)) -end - --- Put ModRM/SIB plus optional displacement. -local function wputmrmsib(t, imark, s, vsreg) - local vreg, vxreg - local reg, xreg = t.reg, t.xreg - if reg and reg < 0 then reg = 0; vreg = t.vreg end - if xreg and xreg < 0 then xreg = 0; vxreg = t.vxreg end - if s < 0 then s = 0 end - - -- Register mode. - if sub(t.mode, 1, 1) == "r" then - wputmodrm(3, s, reg) - if vsreg then waction("VREG", vsreg); wputxb(2) end - if vreg then waction("VREG", vreg); wputxb(0) end - return - end - - local disp = t.disp - local tdisp = type(disp) - -- No base register? - if not reg then - local riprel = false - if xreg then - -- Indexed mode with index register only. - -- [xreg*xsc+disp] -> (0, s, esp) (xsc, xreg, ebp) - wputmodrm(0, s, 4) - if imark == "I" then waction("MARK") end - if vsreg then waction("VREG", vsreg); wputxb(2) end - wputmodrm(t.xsc, xreg, 5) - if vxreg then waction("VREG", vxreg); wputxb(3) end - else - -- Pure 32 bit displacement. - if x64 and tdisp ~= "table" then - wputmodrm(0, s, 4) -- [disp] -> (0, s, esp) (0, esp, ebp) - if imark == "I" then waction("MARK") end - wputmodrm(0, 4, 5) - else - riprel = x64 - wputmodrm(0, s, 5) -- [disp|rip-label] -> (0, s, ebp) - if imark == "I" then waction("MARK") end - end - if vsreg then waction("VREG", vsreg); wputxb(2) end - end - if riprel then -- Emit rip-relative displacement. - if match("UWSiI", imark) then - werror("NYI: rip-relative displacement followed by immediate") - end - -- The previous byte in the action buffer cannot be 0xe9 or 0x80-0x8f. - wputlabel("REL_", disp[1], 2) - else - wputdarg(disp) - end - return - end - - local m - if tdisp == "number" then -- Check displacement size at assembly time. - if disp == 0 and band(reg, 7) ~= 5 then -- [ebp] -> [ebp+0] (in SIB, too) - if not vreg then m = 0 end -- Force DISP to allow [Rd(5)] -> [ebp+0] - elseif disp >= -128 and disp <= 127 then m = 1 - else m = 2 end - elseif tdisp == "table" then - m = 2 - end - - -- Index register present or esp as base register: need SIB encoding. - if xreg or band(reg, 7) == 4 then - wputmodrm(m or 2, s, 4) -- ModRM. - if m == nil or imark == "I" then waction("MARK") end - if vsreg then waction("VREG", vsreg); wputxb(2) end - wputmodrm(t.xsc or 0, xreg or 4, reg) -- SIB. - if vxreg then waction("VREG", vxreg); wputxb(3) end - if vreg then waction("VREG", vreg); wputxb(1) end - else - wputmodrm(m or 2, s, reg) -- ModRM. - if (imark == "I" and (m == 1 or m == 2)) or - (m == nil and (vsreg or vreg)) then waction("MARK") end - if vsreg then waction("VREG", vsreg); wputxb(2) end - if vreg then waction("VREG", vreg); wputxb(1) end - end - - -- Put displacement. - if m == 1 then wputsbarg(disp) - elseif m == 2 then wputdarg(disp) - elseif m == nil then waction("DISP", disp) end -end - ------------------------------------------------------------------------------- - --- Return human-readable operand mode string. -local function opmodestr(op, args) - local m = {} - for i=1,#args do - local a = args[i] - m[#m+1] = sub(a.mode, 1, 1)..(a.opsize or "?") - end - return op.." "..concat(m, ",") -end - --- Convert number to valid integer or nil. -local function toint(expr) - local n = tonumber(expr) - if n then - if n % 1 ~= 0 or n < -2147483648 or n > 4294967295 then - werror("bad integer number `"..expr.."'") - end - return n - end -end - --- Parse immediate expression. -local function immexpr(expr) - -- &expr (pointer) - if sub(expr, 1, 1) == "&" then - return "iPJ", format("(ptrdiff_t)(%s)", sub(expr,2)) - end - - local prefix = sub(expr, 1, 2) - -- =>expr (pc label reference) - if prefix == "=>" then - return "iJ", sub(expr, 3) - end - -- ->name (global label reference) - if prefix == "->" then - return "iJ", map_global[sub(expr, 3)] - end - - -- [<>][1-9] (local label reference) - local dir, lnum = match(expr, "^([<>])([1-9])$") - if dir then -- Fwd: 247-255, Bkwd: 1-9. - return "iJ", lnum + (dir == ">" and 246 or 0) - end - - local extname = match(expr, "^extern%s+(%S+)$") - if extname then - return "iJ", map_extern[extname] - end - - -- expr (interpreted as immediate) - return "iI", expr -end - --- Parse displacement expression: +-num, +-expr, +-opsize*num -local function dispexpr(expr) - local disp = expr == "" and 0 or toint(expr) - if disp then return disp end - local c, dispt = match(expr, "^([+-])%s*(.+)$") - if c == "+" then - expr = dispt - elseif not c then - werror("bad displacement expression `"..expr.."'") - end - local opsize, tailops = match(dispt, "^(%w+)%s*%*%s*(.+)$") - local ops, imm = map_opsize[opsize], toint(tailops) - if ops and imm then - if c == "-" then imm = -imm end - return imm*map_opsizenum[ops] - end - local mode, iexpr = immexpr(dispt) - if mode == "iJ" then - if c == "-" then werror("cannot invert label reference") end - return { iexpr } - end - return expr -- Need to return original signed expression. -end - --- Parse register or type expression. -local function rtexpr(expr) - if not expr then return end - local tname, ovreg = match(expr, "^([%w_]+):(@[%w_]+)$") - local tp = map_type[tname or expr] - if tp then - local reg = ovreg or tp.reg - local rnum = map_reg_num[reg] - if not rnum then - werror("type `"..(tname or expr).."' needs a register override") - end - if not map_reg_valid_base[reg] then - werror("bad base register override `"..(map_reg_rev[reg] or reg).."'") - end - return reg, rnum, tp - end - return expr, map_reg_num[expr] -end - --- Parse operand and return { mode, opsize, reg, xreg, xsc, disp, imm }. -local function parseoperand(param) - local t = {} - - local expr = param - local opsize, tailops = match(param, "^(%w+)%s*(.+)$") - if opsize then - t.opsize = map_opsize[opsize] - if t.opsize then expr = tailops end - end - - local br = match(expr, "^%[%s*(.-)%s*%]$") - repeat - if br then - t.mode = "xm" - - -- [disp] - t.disp = toint(br) - if t.disp then - t.mode = x64 and "xm" or "xmO" - break - end - - -- [reg...] - local tp - local reg, tailr = match(br, "^([@%w_:]+)%s*(.*)$") - reg, t.reg, tp = rtexpr(reg) - if not t.reg then - -- [expr] - t.mode = x64 and "xm" or "xmO" - t.disp = dispexpr("+"..br) - break - end - - if t.reg == -1 then - t.vreg, tailr = match(tailr, "^(%b())(.*)$") - if not t.vreg then werror("bad variable register expression") end - end - - -- [xreg*xsc] or [xreg*xsc+-disp] or [xreg*xsc+-expr] - local xsc, tailsc = match(tailr, "^%*%s*([1248])%s*(.*)$") - if xsc then - if not map_reg_valid_index[reg] then - werror("bad index register `"..map_reg_rev[reg].."'") - end - t.xsc = map_xsc[xsc] - t.xreg = t.reg - t.vxreg = t.vreg - t.reg = nil - t.vreg = nil - t.disp = dispexpr(tailsc) - break - end - if not map_reg_valid_base[reg] then - werror("bad base register `"..map_reg_rev[reg].."'") - end - - -- [reg] or [reg+-disp] - t.disp = toint(tailr) or (tailr == "" and 0) - if t.disp then break end - - -- [reg+xreg...] - local xreg, tailx = match(tailr, "^+%s*([@%w_:]+)%s*(.*)$") - xreg, t.xreg, tp = rtexpr(xreg) - if not t.xreg then - -- [reg+-expr] - t.disp = dispexpr(tailr) - break - end - if not map_reg_valid_index[xreg] then - werror("bad index register `"..map_reg_rev[xreg].."'") - end - - if t.xreg == -1 then - t.vxreg, tailx = match(tailx, "^(%b())(.*)$") - if not t.vxreg then werror("bad variable register expression") end - end - - -- [reg+xreg*xsc...] - local xsc, tailsc = match(tailx, "^%*%s*([1248])%s*(.*)$") - if xsc then - t.xsc = map_xsc[xsc] - tailx = tailsc - end - - -- [...] or [...+-disp] or [...+-expr] - t.disp = dispexpr(tailx) - else - -- imm or opsize*imm - local imm = toint(expr) - if not imm and sub(expr, 1, 1) == "*" and t.opsize then - imm = toint(sub(expr, 2)) - if imm then - imm = imm * map_opsizenum[t.opsize] - t.opsize = nil - end - end - if imm then - if t.opsize then werror("bad operand size override") end - local m = "i" - if imm == 1 then m = m.."1" end - if imm >= 4294967168 and imm <= 4294967295 then imm = imm-4294967296 end - if imm >= -128 and imm <= 127 then m = m.."S" end - t.imm = imm - t.mode = m - break - end - - local tp - local reg, tailr = match(expr, "^([@%w_:]+)%s*(.*)$") - reg, t.reg, tp = rtexpr(reg) - if t.reg then - if t.reg == -1 then - t.vreg, tailr = match(tailr, "^(%b())(.*)$") - if not t.vreg then werror("bad variable register expression") end - end - -- reg - if tailr == "" then - if t.opsize then werror("bad operand size override") end - t.opsize = map_reg_opsize[reg] - if t.opsize == "f" then - t.mode = t.reg == 0 and "fF" or "f" - else - if reg == "@w4" or (x64 and reg == "@d4") then - wwarn("bad idea, try again with `"..(x64 and "rsp'" or "esp'")) - end - t.mode = t.reg == 0 and "rmR" or (reg == "@b1" and "rmC" or "rm") - end - t.needrex = map_reg_needrex[reg] - break - end - - -- type[idx], type[idx].field, type->field -> [reg+offset_expr] - if not tp then werror("bad operand `"..param.."'") end - t.mode = "xm" - t.disp = format(tp.ctypefmt, tailr) - else - t.mode, t.imm = immexpr(expr) - if sub(t.mode, -1) == "J" then - if t.opsize and t.opsize ~= addrsize then - werror("bad operand size override") - end - t.opsize = addrsize - end - end - end - until true - return t -end - ------------------------------------------------------------------------------- --- x86 Template String Description --- =============================== --- --- Each template string is a list of [match:]pattern pairs, --- separated by "|". The first match wins. No match means a --- bad or unsupported combination of operand modes or sizes. --- --- The match part and the ":" is omitted if the operation has --- no operands. Otherwise the first N characters are matched --- against the mode strings of each of the N operands. --- --- The mode string for each operand type is (see parseoperand()): --- Integer register: "rm", +"R" for eax, ax, al, +"C" for cl --- FP register: "f", +"F" for st0 --- Index operand: "xm", +"O" for [disp] (pure offset) --- Immediate: "i", +"S" for signed 8 bit, +"1" for 1, --- +"I" for arg, +"P" for pointer --- Any: +"J" for valid jump targets --- --- So a match character "m" (mixed) matches both an integer register --- and an index operand (to be encoded with the ModRM/SIB scheme). --- But "r" matches only a register and "x" only an index operand --- (e.g. for FP memory access operations). --- --- The operand size match string starts right after the mode match --- characters and ends before the ":". "dwb" or "qdwb" is assumed, if empty. --- The effective data size of the operation is matched against this list. --- --- If only the regular "b", "w", "d", "q", "t" operand sizes are --- present, then all operands must be the same size. Unspecified sizes --- are ignored, but at least one operand must have a size or the pattern --- won't match (use the "byte", "word", "dword", "qword", "tword" --- operand size overrides. E.g.: mov dword [eax], 1). --- --- If the list has a "1" or "2" prefix, the operand size is taken --- from the respective operand and any other operand sizes are ignored. --- If the list contains only ".", all operand sizes are ignored. --- If the list has a "/" prefix, the concatenated (mixed) operand sizes --- are compared to the match. --- --- E.g. "rrdw" matches for either two dword registers or two word --- registers. "Fx2dq" matches an st0 operand plus an index operand --- pointing to a dword (float) or qword (double). --- --- Every character after the ":" is part of the pattern string: --- Hex chars are accumulated to form the opcode (left to right). --- "n" disables the standard opcode mods --- (otherwise: -1 for "b", o16 prefix for "w", rex.w for "q") --- "X" Force REX.W. --- "r"/"R" adds the reg. number from the 1st/2nd operand to the opcode. --- "m"/"M" generates ModRM/SIB from the 1st/2nd operand. --- The spare 3 bits are either filled with the last hex digit or --- the result from a previous "r"/"R". The opcode is restored. --- --- All of the following characters force a flush of the opcode: --- "o"/"O" stores a pure 32 bit disp (offset) from the 1st/2nd operand. --- "S" stores a signed 8 bit immediate from the last operand. --- "U" stores an unsigned 8 bit immediate from the last operand. --- "W" stores an unsigned 16 bit immediate from the last operand. --- "i" stores an operand sized immediate from the last operand. --- "I" dito, but generates an action code to optionally modify --- the opcode (+2) for a signed 8 bit immediate. --- "J" generates one of the REL action codes from the last operand. --- ------------------------------------------------------------------------------- - --- Template strings for x86 instructions. Ordered by first opcode byte. --- Unimplemented opcodes (deliberate omissions) are marked with *. -local map_op = { - -- 00-05: add... - -- 06: *push es - -- 07: *pop es - -- 08-0D: or... - -- 0E: *push cs - -- 0F: two byte opcode prefix - -- 10-15: adc... - -- 16: *push ss - -- 17: *pop ss - -- 18-1D: sbb... - -- 1E: *push ds - -- 1F: *pop ds - -- 20-25: and... - es_0 = "26", - -- 27: *daa - -- 28-2D: sub... - cs_0 = "2E", - -- 2F: *das - -- 30-35: xor... - ss_0 = "36", - -- 37: *aaa - -- 38-3D: cmp... - ds_0 = "3E", - -- 3F: *aas - inc_1 = x64 and "m:FF0m" or "rdw:40r|m:FF0m", - dec_1 = x64 and "m:FF1m" or "rdw:48r|m:FF1m", - push_1 = (x64 and "rq:n50r|rw:50r|mq:nFF6m|mw:FF6m" or - "rdw:50r|mdw:FF6m").."|S.:6AS|ib:n6Ai|i.:68i", - pop_1 = x64 and "rq:n58r|rw:58r|mq:n8F0m|mw:8F0m" or "rdw:58r|mdw:8F0m", - -- 60: *pusha, *pushad, *pushaw - -- 61: *popa, *popad, *popaw - -- 62: *bound rdw,x - -- 63: x86: *arpl mw,rw - movsxd_2 = x64 and "rm/qd:63rM", - fs_0 = "64", - gs_0 = "65", - o16_0 = "66", - a16_0 = not x64 and "67" or nil, - a32_0 = x64 and "67", - -- 68: push idw - -- 69: imul rdw,mdw,idw - -- 6A: push ib - -- 6B: imul rdw,mdw,S - -- 6C: *insb - -- 6D: *insd, *insw - -- 6E: *outsb - -- 6F: *outsd, *outsw - -- 70-7F: jcc lb - -- 80: add... mb,i - -- 81: add... mdw,i - -- 82: *undefined - -- 83: add... mdw,S - test_2 = "mr:85Rm|rm:85rM|Ri:A9ri|mi:F70mi", - -- 86: xchg rb,mb - -- 87: xchg rdw,mdw - -- 88: mov mb,r - -- 89: mov mdw,r - -- 8A: mov r,mb - -- 8B: mov r,mdw - -- 8C: *mov mdw,seg - lea_2 = "rx1dq:8DrM", - -- 8E: *mov seg,mdw - -- 8F: pop mdw - nop_0 = "90", - xchg_2 = "Rrqdw:90R|rRqdw:90r|rm:87rM|mr:87Rm", - cbw_0 = "6698", - cwde_0 = "98", - cdqe_0 = "4898", - cwd_0 = "6699", - cdq_0 = "99", - cqo_0 = "4899", - -- 9A: *call iw:idw - wait_0 = "9B", - fwait_0 = "9B", - pushf_0 = "9C", - pushfd_0 = not x64 and "9C", - pushfq_0 = x64 and "9C", - popf_0 = "9D", - popfd_0 = not x64 and "9D", - popfq_0 = x64 and "9D", - sahf_0 = "9E", - lahf_0 = "9F", - mov_2 = "OR:A3o|RO:A1O|mr:89Rm|rm:8BrM|rib:nB0ri|ridw:B8ri|mi:C70mi", - movsb_0 = "A4", - movsw_0 = "66A5", - movsd_0 = "A5", - cmpsb_0 = "A6", - cmpsw_0 = "66A7", - cmpsd_0 = "A7", - -- A8: test Rb,i - -- A9: test Rdw,i - stosb_0 = "AA", - stosw_0 = "66AB", - stosd_0 = "AB", - lodsb_0 = "AC", - lodsw_0 = "66AD", - lodsd_0 = "AD", - scasb_0 = "AE", - scasw_0 = "66AF", - scasd_0 = "AF", - -- B0-B7: mov rb,i - -- B8-BF: mov rdw,i - -- C0: rol... mb,i - -- C1: rol... mdw,i - ret_1 = "i.:nC2W", - ret_0 = "C3", - -- C4: *les rdw,mq - -- C5: *lds rdw,mq - -- C6: mov mb,i - -- C7: mov mdw,i - -- C8: *enter iw,ib - leave_0 = "C9", - -- CA: *retf iw - -- CB: *retf - int3_0 = "CC", - int_1 = "i.:nCDU", - into_0 = "CE", - -- CF: *iret - -- D0: rol... mb,1 - -- D1: rol... mdw,1 - -- D2: rol... mb,cl - -- D3: rol... mb,cl - -- D4: *aam ib - -- D5: *aad ib - -- D6: *salc - -- D7: *xlat - -- D8-DF: floating point ops - -- E0: *loopne - -- E1: *loope - -- E2: *loop - -- E3: *jcxz, *jecxz - -- E4: *in Rb,ib - -- E5: *in Rdw,ib - -- E6: *out ib,Rb - -- E7: *out ib,Rdw - call_1 = x64 and "mq:nFF2m|J.:E8nJ" or "md:FF2m|J.:E8J", - jmp_1 = x64 and "mq:nFF4m|J.:E9nJ" or "md:FF4m|J.:E9J", -- short: EB - -- EA: *jmp iw:idw - -- EB: jmp ib - -- EC: *in Rb,dx - -- ED: *in Rdw,dx - -- EE: *out dx,Rb - -- EF: *out dx,Rdw - lock_0 = "F0", - int1_0 = "F1", - repne_0 = "F2", - repnz_0 = "F2", - rep_0 = "F3", - repe_0 = "F3", - repz_0 = "F3", - -- F4: *hlt - cmc_0 = "F5", - -- F6: test... mb,i; div... mb - -- F7: test... mdw,i; div... mdw - clc_0 = "F8", - stc_0 = "F9", - -- FA: *cli - cld_0 = "FC", - std_0 = "FD", - -- FE: inc... mb - -- FF: inc... mdw - - -- misc ops - not_1 = "m:F72m", - neg_1 = "m:F73m", - mul_1 = "m:F74m", - imul_1 = "m:F75m", - div_1 = "m:F76m", - idiv_1 = "m:F77m", - - imul_2 = "rmqdw:0FAFrM|rIqdw:69rmI|rSqdw:6BrmS|riqdw:69rmi", - imul_3 = "rmIqdw:69rMI|rmSqdw:6BrMS|rmiqdw:69rMi", - - movzx_2 = "rm/db:0FB6rM|rm/qb:|rm/wb:0FB6rM|rm/dw:0FB7rM|rm/qw:", - movsx_2 = "rm/db:0FBErM|rm/qb:|rm/wb:0FBErM|rm/dw:0FBFrM|rm/qw:", - - bswap_1 = "rqd:0FC8r", - bsf_2 = "rmqdw:0FBCrM", - bsr_2 = "rmqdw:0FBDrM", - bt_2 = "mrqdw:0FA3Rm|miqdw:0FBA4mU", - btc_2 = "mrqdw:0FBBRm|miqdw:0FBA7mU", - btr_2 = "mrqdw:0FB3Rm|miqdw:0FBA6mU", - bts_2 = "mrqdw:0FABRm|miqdw:0FBA5mU", - - shld_3 = "mriqdw:0FA4RmU|mrC/qq:0FA5Rm|mrC/dd:|mrC/ww:", - shrd_3 = "mriqdw:0FACRmU|mrC/qq:0FADRm|mrC/dd:|mrC/ww:", - - rdtsc_0 = "0F31", -- P1+ - rdpmc_0 = "0F33", -- P6+ - cpuid_0 = "0FA2", -- P1+ - - -- floating point ops - fst_1 = "ff:DDD0r|xd:D92m|xq:nDD2m", - fstp_1 = "ff:DDD8r|xd:D93m|xq:nDD3m|xt:DB7m", - fld_1 = "ff:D9C0r|xd:D90m|xq:nDD0m|xt:DB5m", - - fpop_0 = "DDD8", -- Alias for fstp st0. - - fist_1 = "xw:nDF2m|xd:DB2m", - fistp_1 = "xw:nDF3m|xd:DB3m|xq:nDF7m", - fild_1 = "xw:nDF0m|xd:DB0m|xq:nDF5m", - - fxch_0 = "D9C9", - fxch_1 = "ff:D9C8r", - fxch_2 = "fFf:D9C8r|Fff:D9C8R", - - fucom_1 = "ff:DDE0r", - fucom_2 = "Fff:DDE0R", - fucomp_1 = "ff:DDE8r", - fucomp_2 = "Fff:DDE8R", - fucomi_1 = "ff:DBE8r", -- P6+ - fucomi_2 = "Fff:DBE8R", -- P6+ - fucomip_1 = "ff:DFE8r", -- P6+ - fucomip_2 = "Fff:DFE8R", -- P6+ - fcomi_1 = "ff:DBF0r", -- P6+ - fcomi_2 = "Fff:DBF0R", -- P6+ - fcomip_1 = "ff:DFF0r", -- P6+ - fcomip_2 = "Fff:DFF0R", -- P6+ - fucompp_0 = "DAE9", - fcompp_0 = "DED9", - - fldenv_1 = "x.:D94m", - fnstenv_1 = "x.:D96m", - fstenv_1 = "x.:9BD96m", - fldcw_1 = "xw:nD95m", - fstcw_1 = "xw:n9BD97m", - fnstcw_1 = "xw:nD97m", - fstsw_1 = "Rw:n9BDFE0|xw:n9BDD7m", - fnstsw_1 = "Rw:nDFE0|xw:nDD7m", - fclex_0 = "9BDBE2", - fnclex_0 = "DBE2", - - fnop_0 = "D9D0", - -- D9D1-D9DF: unassigned - - fchs_0 = "D9E0", - fabs_0 = "D9E1", - -- D9E2: unassigned - -- D9E3: unassigned - ftst_0 = "D9E4", - fxam_0 = "D9E5", - -- D9E6: unassigned - -- D9E7: unassigned - fld1_0 = "D9E8", - fldl2t_0 = "D9E9", - fldl2e_0 = "D9EA", - fldpi_0 = "D9EB", - fldlg2_0 = "D9EC", - fldln2_0 = "D9ED", - fldz_0 = "D9EE", - -- D9EF: unassigned - - f2xm1_0 = "D9F0", - fyl2x_0 = "D9F1", - fptan_0 = "D9F2", - fpatan_0 = "D9F3", - fxtract_0 = "D9F4", - fprem1_0 = "D9F5", - fdecstp_0 = "D9F6", - fincstp_0 = "D9F7", - fprem_0 = "D9F8", - fyl2xp1_0 = "D9F9", - fsqrt_0 = "D9FA", - fsincos_0 = "D9FB", - frndint_0 = "D9FC", - fscale_0 = "D9FD", - fsin_0 = "D9FE", - fcos_0 = "D9FF", - - -- SSE, SSE2 - andnpd_2 = "rmo:660F55rM", - andnps_2 = "rmo:0F55rM", - andpd_2 = "rmo:660F54rM", - andps_2 = "rmo:0F54rM", - clflush_1 = "x.:0FAE7m", - cmppd_3 = "rmio:660FC2rMU", - cmpps_3 = "rmio:0FC2rMU", - cmpsd_3 = "rrio:F20FC2rMU|rxi/oq:", - cmpss_3 = "rrio:F30FC2rMU|rxi/od:", - comisd_2 = "rro:660F2FrM|rx/oq:", - comiss_2 = "rro:0F2FrM|rx/od:", - cvtdq2pd_2 = "rro:F30FE6rM|rx/oq:", - cvtdq2ps_2 = "rmo:0F5BrM", - cvtpd2dq_2 = "rmo:F20FE6rM", - cvtpd2ps_2 = "rmo:660F5ArM", - cvtpi2pd_2 = "rx/oq:660F2ArM", - cvtpi2ps_2 = "rx/oq:0F2ArM", - cvtps2dq_2 = "rmo:660F5BrM", - cvtps2pd_2 = "rro:0F5ArM|rx/oq:", - cvtsd2si_2 = "rr/do:F20F2DrM|rr/qo:|rx/dq:|rxq:", - cvtsd2ss_2 = "rro:F20F5ArM|rx/oq:", - cvtsi2sd_2 = "rm/od:F20F2ArM|rm/oq:F20F2ArXM", - cvtsi2ss_2 = "rm/od:F30F2ArM|rm/oq:F30F2ArXM", - cvtss2sd_2 = "rro:F30F5ArM|rx/od:", - cvtss2si_2 = "rr/do:F30F2DrM|rr/qo:|rxd:|rx/qd:", - cvttpd2dq_2 = "rmo:660FE6rM", - cvttps2dq_2 = "rmo:F30F5BrM", - cvttsd2si_2 = "rr/do:F20F2CrM|rr/qo:|rx/dq:|rxq:", - cvttss2si_2 = "rr/do:F30F2CrM|rr/qo:|rxd:|rx/qd:", - fxsave_1 = "x.:0FAE0m", - fxrstor_1 = "x.:0FAE1m", - ldmxcsr_1 = "xd:0FAE2m", - lfence_0 = "0FAEE8", - maskmovdqu_2 = "rro:660FF7rM", - mfence_0 = "0FAEF0", - movapd_2 = "rmo:660F28rM|mro:660F29Rm", - movaps_2 = "rmo:0F28rM|mro:0F29Rm", - movd_2 = "rm/od:660F6ErM|rm/oq:660F6ErXM|mr/do:660F7ERm|mr/qo:", - movdqa_2 = "rmo:660F6FrM|mro:660F7FRm", - movdqu_2 = "rmo:F30F6FrM|mro:F30F7FRm", - movhlps_2 = "rro:0F12rM", - movhpd_2 = "rx/oq:660F16rM|xr/qo:n660F17Rm", - movhps_2 = "rx/oq:0F16rM|xr/qo:n0F17Rm", - movlhps_2 = "rro:0F16rM", - movlpd_2 = "rx/oq:660F12rM|xr/qo:n660F13Rm", - movlps_2 = "rx/oq:0F12rM|xr/qo:n0F13Rm", - movmskpd_2 = "rr/do:660F50rM", - movmskps_2 = "rr/do:0F50rM", - movntdq_2 = "xro:660FE7Rm", - movnti_2 = "xrqd:0FC3Rm", - movntpd_2 = "xro:660F2BRm", - movntps_2 = "xro:0F2BRm", - movq_2 = "rro:F30F7ErM|rx/oq:|xr/qo:n660FD6Rm", - movsd_2 = "rro:F20F10rM|rx/oq:|xr/qo:nF20F11Rm", - movss_2 = "rro:F30F10rM|rx/od:|xr/do:F30F11Rm", - movupd_2 = "rmo:660F10rM|mro:660F11Rm", - movups_2 = "rmo:0F10rM|mro:0F11Rm", - orpd_2 = "rmo:660F56rM", - orps_2 = "rmo:0F56rM", - packssdw_2 = "rmo:660F6BrM", - packsswb_2 = "rmo:660F63rM", - packuswb_2 = "rmo:660F67rM", - paddb_2 = "rmo:660FFCrM", - paddd_2 = "rmo:660FFErM", - paddq_2 = "rmo:660FD4rM", - paddsb_2 = "rmo:660FECrM", - paddsw_2 = "rmo:660FEDrM", - paddusb_2 = "rmo:660FDCrM", - paddusw_2 = "rmo:660FDDrM", - paddw_2 = "rmo:660FFDrM", - pand_2 = "rmo:660FDBrM", - pandn_2 = "rmo:660FDFrM", - pause_0 = "F390", - pavgb_2 = "rmo:660FE0rM", - pavgw_2 = "rmo:660FE3rM", - pcmpeqb_2 = "rmo:660F74rM", - pcmpeqd_2 = "rmo:660F76rM", - pcmpeqw_2 = "rmo:660F75rM", - pcmpgtb_2 = "rmo:660F64rM", - pcmpgtd_2 = "rmo:660F66rM", - pcmpgtw_2 = "rmo:660F65rM", - pextrw_3 = "rri/do:660FC5rMU|xri/wo:660F3A15nRmU", -- Mem op: SSE4.1 only. - pinsrw_3 = "rri/od:660FC4rMU|rxi/ow:", - pmaddwd_2 = "rmo:660FF5rM", - pmaxsw_2 = "rmo:660FEErM", - pmaxub_2 = "rmo:660FDErM", - pminsw_2 = "rmo:660FEArM", - pminub_2 = "rmo:660FDArM", - pmovmskb_2 = "rr/do:660FD7rM", - pmulhuw_2 = "rmo:660FE4rM", - pmulhw_2 = "rmo:660FE5rM", - pmullw_2 = "rmo:660FD5rM", - pmuludq_2 = "rmo:660FF4rM", - por_2 = "rmo:660FEBrM", - prefetchnta_1 = "xb:n0F180m", - prefetcht0_1 = "xb:n0F181m", - prefetcht1_1 = "xb:n0F182m", - prefetcht2_1 = "xb:n0F183m", - psadbw_2 = "rmo:660FF6rM", - pshufd_3 = "rmio:660F70rMU", - pshufhw_3 = "rmio:F30F70rMU", - pshuflw_3 = "rmio:F20F70rMU", - pslld_2 = "rmo:660FF2rM|rio:660F726mU", - pslldq_2 = "rio:660F737mU", - psllq_2 = "rmo:660FF3rM|rio:660F736mU", - psllw_2 = "rmo:660FF1rM|rio:660F716mU", - psrad_2 = "rmo:660FE2rM|rio:660F724mU", - psraw_2 = "rmo:660FE1rM|rio:660F714mU", - psrld_2 = "rmo:660FD2rM|rio:660F722mU", - psrldq_2 = "rio:660F733mU", - psrlq_2 = "rmo:660FD3rM|rio:660F732mU", - psrlw_2 = "rmo:660FD1rM|rio:660F712mU", - psubb_2 = "rmo:660FF8rM", - psubd_2 = "rmo:660FFArM", - psubq_2 = "rmo:660FFBrM", - psubsb_2 = "rmo:660FE8rM", - psubsw_2 = "rmo:660FE9rM", - psubusb_2 = "rmo:660FD8rM", - psubusw_2 = "rmo:660FD9rM", - psubw_2 = "rmo:660FF9rM", - punpckhbw_2 = "rmo:660F68rM", - punpckhdq_2 = "rmo:660F6ArM", - punpckhqdq_2 = "rmo:660F6DrM", - punpckhwd_2 = "rmo:660F69rM", - punpcklbw_2 = "rmo:660F60rM", - punpckldq_2 = "rmo:660F62rM", - punpcklqdq_2 = "rmo:660F6CrM", - punpcklwd_2 = "rmo:660F61rM", - pxor_2 = "rmo:660FEFrM", - rcpps_2 = "rmo:0F53rM", - rcpss_2 = "rro:F30F53rM|rx/od:", - rsqrtps_2 = "rmo:0F52rM", - rsqrtss_2 = "rmo:F30F52rM", - sfence_0 = "0FAEF8", - shufpd_3 = "rmio:660FC6rMU", - shufps_3 = "rmio:0FC6rMU", - stmxcsr_1 = "xd:0FAE3m", - ucomisd_2 = "rro:660F2ErM|rx/oq:", - ucomiss_2 = "rro:0F2ErM|rx/od:", - unpckhpd_2 = "rmo:660F15rM", - unpckhps_2 = "rmo:0F15rM", - unpcklpd_2 = "rmo:660F14rM", - unpcklps_2 = "rmo:0F14rM", - xorpd_2 = "rmo:660F57rM", - xorps_2 = "rmo:0F57rM", - - -- SSE3 ops - fisttp_1 = "xw:nDF1m|xd:DB1m|xq:nDD1m", - addsubpd_2 = "rmo:660FD0rM", - addsubps_2 = "rmo:F20FD0rM", - haddpd_2 = "rmo:660F7CrM", - haddps_2 = "rmo:F20F7CrM", - hsubpd_2 = "rmo:660F7DrM", - hsubps_2 = "rmo:F20F7DrM", - lddqu_2 = "rxo:F20FF0rM", - movddup_2 = "rmo:F20F12rM", - movshdup_2 = "rmo:F30F16rM", - movsldup_2 = "rmo:F30F12rM", - - -- SSSE3 ops - pabsb_2 = "rmo:660F381CrM", - pabsd_2 = "rmo:660F381ErM", - pabsw_2 = "rmo:660F381DrM", - palignr_3 = "rmio:660F3A0FrMU", - phaddd_2 = "rmo:660F3802rM", - phaddsw_2 = "rmo:660F3803rM", - phaddw_2 = "rmo:660F3801rM", - phsubd_2 = "rmo:660F3806rM", - phsubsw_2 = "rmo:660F3807rM", - phsubw_2 = "rmo:660F3805rM", - pmaddubsw_2 = "rmo:660F3804rM", - pmulhrsw_2 = "rmo:660F380BrM", - pshufb_2 = "rmo:660F3800rM", - psignb_2 = "rmo:660F3808rM", - psignd_2 = "rmo:660F380ArM", - psignw_2 = "rmo:660F3809rM", - - -- SSE4.1 ops - blendpd_3 = "rmio:660F3A0DrMU", - blendps_3 = "rmio:660F3A0CrMU", - blendvpd_3 = "rmRo:660F3815rM", - blendvps_3 = "rmRo:660F3814rM", - dppd_3 = "rmio:660F3A41rMU", - dpps_3 = "rmio:660F3A40rMU", - extractps_3 = "mri/do:660F3A17RmU|rri/qo:660F3A17RXmU", - insertps_3 = "rrio:660F3A41rMU|rxi/od:", - movntdqa_2 = "rxo:660F382ArM", - mpsadbw_3 = "rmio:660F3A42rMU", - packusdw_2 = "rmo:660F382BrM", - pblendvb_3 = "rmRo:660F3810rM", - pblendw_3 = "rmio:660F3A0ErMU", - pcmpeqq_2 = "rmo:660F3829rM", - pextrb_3 = "rri/do:660F3A14nRmU|rri/qo:|xri/bo:", - pextrd_3 = "mri/do:660F3A16RmU", - pextrq_3 = "mri/qo:660F3A16RmU", - -- pextrw is SSE2, mem operand is SSE4.1 only - phminposuw_2 = "rmo:660F3841rM", - pinsrb_3 = "rri/od:660F3A20nrMU|rxi/ob:", - pinsrd_3 = "rmi/od:660F3A22rMU", - pinsrq_3 = "rmi/oq:660F3A22rXMU", - pmaxsb_2 = "rmo:660F383CrM", - pmaxsd_2 = "rmo:660F383DrM", - pmaxud_2 = "rmo:660F383FrM", - pmaxuw_2 = "rmo:660F383ErM", - pminsb_2 = "rmo:660F3838rM", - pminsd_2 = "rmo:660F3839rM", - pminud_2 = "rmo:660F383BrM", - pminuw_2 = "rmo:660F383ArM", - pmovsxbd_2 = "rro:660F3821rM|rx/od:", - pmovsxbq_2 = "rro:660F3822rM|rx/ow:", - pmovsxbw_2 = "rro:660F3820rM|rx/oq:", - pmovsxdq_2 = "rro:660F3825rM|rx/oq:", - pmovsxwd_2 = "rro:660F3823rM|rx/oq:", - pmovsxwq_2 = "rro:660F3824rM|rx/od:", - pmovzxbd_2 = "rro:660F3831rM|rx/od:", - pmovzxbq_2 = "rro:660F3832rM|rx/ow:", - pmovzxbw_2 = "rro:660F3830rM|rx/oq:", - pmovzxdq_2 = "rro:660F3835rM|rx/oq:", - pmovzxwd_2 = "rro:660F3833rM|rx/oq:", - pmovzxwq_2 = "rro:660F3834rM|rx/od:", - pmuldq_2 = "rmo:660F3828rM", - pmulld_2 = "rmo:660F3840rM", - ptest_2 = "rmo:660F3817rM", - roundpd_3 = "rmio:660F3A09rMU", - roundps_3 = "rmio:660F3A08rMU", - roundsd_3 = "rrio:660F3A0BrMU|rxi/oq:", - roundss_3 = "rrio:660F3A0ArMU|rxi/od:", - - -- SSE4.2 ops - crc32_2 = "rmqd:F20F38F1rM|rm/dw:66F20F38F1rM|rm/db:F20F38F0rM|rm/qb:", - pcmpestri_3 = "rmio:660F3A61rMU", - pcmpestrm_3 = "rmio:660F3A60rMU", - pcmpgtq_2 = "rmo:660F3837rM", - pcmpistri_3 = "rmio:660F3A63rMU", - pcmpistrm_3 = "rmio:660F3A62rMU", - popcnt_2 = "rmqdw:F30FB8rM", - - -- SSE4a - extrq_2 = "rro:660F79rM", - extrq_3 = "riio:660F780mUU", - insertq_2 = "rro:F20F79rM", - insertq_4 = "rriio:F20F78rMUU", - lzcnt_2 = "rmqdw:F30FBDrM", - movntsd_2 = "xr/qo:nF20F2BRm", - movntss_2 = "xr/do:F30F2BRm", - -- popcnt is also in SSE4.2 -} - ------------------------------------------------------------------------------- - --- Arithmetic ops. -for name,n in pairs{ add = 0, ["or"] = 1, adc = 2, sbb = 3, - ["and"] = 4, sub = 5, xor = 6, cmp = 7 } do - local n8 = shl(n, 3) - map_op[name.."_2"] = format( - "mr:%02XRm|rm:%02XrM|mI1qdw:81%XmI|mS1qdw:83%XmS|Ri1qdwb:%02Xri|mi1qdwb:81%Xmi", - 1+n8, 3+n8, n, n, 5+n8, n) -end - --- Shift ops. -for name,n in pairs{ rol = 0, ror = 1, rcl = 2, rcr = 3, - shl = 4, shr = 5, sar = 7, sal = 4 } do - map_op[name.."_2"] = format("m1:D1%Xm|mC1qdwb:D3%Xm|mi:C1%XmU", n, n, n) -end - --- Conditional ops. -for cc,n in pairs(map_cc) do - map_op["j"..cc.."_1"] = format("J.:n0F8%XJ", n) -- short: 7%X - map_op["set"..cc.."_1"] = format("mb:n0F9%X2m", n) - map_op["cmov"..cc.."_2"] = format("rmqdw:0F4%XrM", n) -- P6+ -end - --- FP arithmetic ops. -for name,n in pairs{ add = 0, mul = 1, com = 2, comp = 3, - sub = 4, subr = 5, div = 6, divr = 7 } do - local nc = 0xc0 + shl(n, 3) - local nr = nc + (n < 4 and 0 or (n % 2 == 0 and 8 or -8)) - local fn = "f"..name - map_op[fn.."_1"] = format("ff:D8%02Xr|xd:D8%Xm|xq:nDC%Xm", nc, n, n) - if n == 2 or n == 3 then - map_op[fn.."_2"] = format("Fff:D8%02XR|Fx2d:D8%XM|Fx2q:nDC%XM", nc, n, n) - else - map_op[fn.."_2"] = format("Fff:D8%02XR|fFf:DC%02Xr|Fx2d:D8%XM|Fx2q:nDC%XM", nc, nr, n, n) - map_op[fn.."p_1"] = format("ff:DE%02Xr", nr) - map_op[fn.."p_2"] = format("fFf:DE%02Xr", nr) - end - map_op["fi"..name.."_1"] = format("xd:DA%Xm|xw:nDE%Xm", n, n) -end - --- FP conditional moves. -for cc,n in pairs{ b=0, e=1, be=2, u=3, nb=4, ne=5, nbe=6, nu=7 } do - local nc = 0xdac0 + shl(band(n, 3), 3) + shl(band(n, 4), 6) - map_op["fcmov"..cc.."_1"] = format("ff:%04Xr", nc) -- P6+ - map_op["fcmov"..cc.."_2"] = format("Fff:%04XR", nc) -- P6+ -end - --- SSE FP arithmetic ops. -for name,n in pairs{ sqrt = 1, add = 8, mul = 9, - sub = 12, min = 13, div = 14, max = 15 } do - map_op[name.."ps_2"] = format("rmo:0F5%XrM", n) - map_op[name.."ss_2"] = format("rro:F30F5%XrM|rx/od:", n) - map_op[name.."pd_2"] = format("rmo:660F5%XrM", n) - map_op[name.."sd_2"] = format("rro:F20F5%XrM|rx/oq:", n) -end - ------------------------------------------------------------------------------- - --- Process pattern string. -local function dopattern(pat, args, sz, op, needrex) - local digit, addin - local opcode = 0 - local szov = sz - local narg = 1 - local rex = 0 - - -- Limit number of section buffer positions used by a single dasm_put(). - -- A single opcode needs a maximum of 5 positions. - if secpos+5 > maxsecpos then wflush() end - - -- Process each character. - for c in gmatch(pat.."|", ".") do - if match(c, "%x") then -- Hex digit. - digit = byte(c) - 48 - if digit > 48 then digit = digit - 39 - elseif digit > 16 then digit = digit - 7 end - opcode = opcode*16 + digit - addin = nil - elseif c == "n" then -- Disable operand size mods for opcode. - szov = nil - elseif c == "X" then -- Force REX.W. - rex = 8 - elseif c == "r" then -- Merge 1st operand regno. into opcode. - addin = args[1]; opcode = opcode + (addin.reg % 8) - if narg < 2 then narg = 2 end - elseif c == "R" then -- Merge 2nd operand regno. into opcode. - addin = args[2]; opcode = opcode + (addin.reg % 8) - narg = 3 - elseif c == "m" or c == "M" then -- Encode ModRM/SIB. - local s - if addin then - s = addin.reg - opcode = opcode - band(s, 7) -- Undo regno opcode merge. - else - s = band(opcode, 15) -- Undo last digit. - opcode = shr(opcode, 4) - end - local nn = c == "m" and 1 or 2 - local t = args[nn] - if narg <= nn then narg = nn + 1 end - if szov == "q" and rex == 0 then rex = rex + 8 end - if t.reg and t.reg > 7 then rex = rex + 1 end - if t.xreg and t.xreg > 7 then rex = rex + 2 end - if s > 7 then rex = rex + 4 end - if needrex then rex = rex + 16 end - wputop(szov, opcode, rex); opcode = nil - local imark = sub(pat, -1) -- Force a mark (ugly). - -- Put ModRM/SIB with regno/last digit as spare. - wputmrmsib(t, imark, s, addin and addin.vreg) - addin = nil - else - if opcode then -- Flush opcode. - if szov == "q" and rex == 0 then rex = rex + 8 end - if needrex then rex = rex + 16 end - if addin and addin.reg == -1 then - wputop(szov, opcode - 7, rex) - waction("VREG", addin.vreg); wputxb(0) - else - if addin and addin.reg > 7 then rex = rex + 1 end - wputop(szov, opcode, rex) - end - opcode = nil - end - if c == "|" then break end - if c == "o" then -- Offset (pure 32 bit displacement). - wputdarg(args[1].disp); if narg < 2 then narg = 2 end - elseif c == "O" then - wputdarg(args[2].disp); narg = 3 - else - -- Anything else is an immediate operand. - local a = args[narg] - narg = narg + 1 - local mode, imm = a.mode, a.imm - if mode == "iJ" and not match("iIJ", c) then - werror("bad operand size for label") - end - if c == "S" then - wputsbarg(imm) - elseif c == "U" then - wputbarg(imm) - elseif c == "W" then - wputwarg(imm) - elseif c == "i" or c == "I" then - if mode == "iJ" then - wputlabel("IMM_", imm, 1) - elseif mode == "iI" and c == "I" then - waction(sz == "w" and "IMM_WB" or "IMM_DB", imm) - else - wputszarg(sz, imm) - end - elseif c == "J" then - if mode == "iPJ" then - waction("REL_A", imm) -- !x64 (secpos) - else - wputlabel("REL_", imm, 2) - end - else - werror("bad char `"..c.."' in pattern `"..pat.."' for `"..op.."'") - end - end - end - end -end - ------------------------------------------------------------------------------- - --- Mapping of operand modes to short names. Suppress output with '#'. -local map_modename = { - r = "reg", R = "eax", C = "cl", x = "mem", m = "mrm", i = "imm", - f = "stx", F = "st0", J = "lbl", ["1"] = "1", - I = "#", S = "#", O = "#", -} - --- Return a table/string showing all possible operand modes. -local function templatehelp(template, nparams) - if nparams == 0 then return "" end - local t = {} - for tm in gmatch(template, "[^%|]+") do - local s = map_modename[sub(tm, 1, 1)] - s = s..gsub(sub(tm, 2, nparams), ".", function(c) - return ", "..map_modename[c] - end) - if not match(s, "#") then t[#t+1] = s end - end - return t -end - --- Match operand modes against mode match part of template. -local function matchtm(tm, args) - for i=1,#args do - if not match(args[i].mode, sub(tm, i, i)) then return end - end - return true -end - --- Handle opcodes defined with template strings. -map_op[".template__"] = function(params, template, nparams) - if not params then return templatehelp(template, nparams) end - local args = {} - - -- Zero-operand opcodes have no match part. - if #params == 0 then - dopattern(template, args, "d", params.op, nil) - return - end - - -- Determine common operand size (coerce undefined size) or flag as mixed. - local sz, szmix, needrex - for i,p in ipairs(params) do - args[i] = parseoperand(p) - local nsz = args[i].opsize - if nsz then - if sz and sz ~= nsz then szmix = true else sz = nsz end - end - local nrex = args[i].needrex - if nrex ~= nil then - if needrex == nil then - needrex = nrex - elseif needrex ~= nrex then - werror("bad mix of byte-addressable registers") - end - end - end - - -- Try all match:pattern pairs (separated by '|'). - local gotmatch, lastpat - for tm in gmatch(template, "[^%|]+") do - -- Split off size match (starts after mode match) and pattern string. - local szm, pat = match(tm, "^(.-):(.*)$", #args+1) - if pat == "" then pat = lastpat else lastpat = pat end - if matchtm(tm, args) then - local prefix = sub(szm, 1, 1) - if prefix == "/" then -- Match both operand sizes. - if args[1].opsize == sub(szm, 2, 2) and - args[2].opsize == sub(szm, 3, 3) then - dopattern(pat, args, sz, params.op, needrex) -- Process pattern. - return - end - else -- Match common operand size. - local szp = sz - if szm == "" then szm = x64 and "qdwb" or "dwb" end -- Default sizes. - if prefix == "1" then szp = args[1].opsize; szmix = nil - elseif prefix == "2" then szp = args[2].opsize; szmix = nil end - if not szmix and (prefix == "." or match(szm, szp or "#")) then - dopattern(pat, args, szp, params.op, needrex) -- Process pattern. - return - end - end - gotmatch = true - end - end - - local msg = "bad operand mode" - if gotmatch then - if szmix then - msg = "mixed operand size" - else - msg = sz and "bad operand size" or "missing operand size" - end - end - - werror(msg.." in `"..opmodestr(params.op, args).."'") -end - ------------------------------------------------------------------------------- - --- x64-specific opcode for 64 bit immediates and displacements. -if x64 then - function map_op.mov64_2(params) - if not params then return { "reg, imm", "reg, [disp]", "[disp], reg" } end - if secpos+2 > maxsecpos then wflush() end - local opcode, op64, sz, rex, vreg - local op64 = match(params[1], "^%[%s*(.-)%s*%]$") - if op64 then - local a = parseoperand(params[2]) - if a.mode ~= "rmR" then werror("bad operand mode") end - sz = a.opsize - rex = sz == "q" and 8 or 0 - opcode = 0xa3 - else - op64 = match(params[2], "^%[%s*(.-)%s*%]$") - local a = parseoperand(params[1]) - if op64 then - if a.mode ~= "rmR" then werror("bad operand mode") end - sz = a.opsize - rex = sz == "q" and 8 or 0 - opcode = 0xa1 - else - if sub(a.mode, 1, 1) ~= "r" or a.opsize ~= "q" then - werror("bad operand mode") - end - op64 = params[2] - if a.reg == -1 then - vreg = a.vreg - opcode = 0xb8 - else - opcode = 0xb8 + band(a.reg, 7) - end - rex = a.reg > 7 and 9 or 8 - end - end - wputop(sz, opcode, rex) - if vreg then waction("VREG", vreg); wputxb(0) end - waction("IMM_D", format("(unsigned int)(%s)", op64)) - waction("IMM_D", format("(unsigned int)((%s)>>32)", op64)) - end -end - ------------------------------------------------------------------------------- - --- Pseudo-opcodes for data storage. -local function op_data(params) - if not params then return "imm..." end - local sz = sub(params.op, 2, 2) - if sz == "a" then sz = addrsize end - for _,p in ipairs(params) do - local a = parseoperand(p) - if sub(a.mode, 1, 1) ~= "i" or (a.opsize and a.opsize ~= sz) then - werror("bad mode or size in `"..p.."'") - end - if a.mode == "iJ" then - wputlabel("IMM_", a.imm, 1) - else - wputszarg(sz, a.imm) - end - if secpos+2 > maxsecpos then wflush() end - end -end - -map_op[".byte_*"] = op_data -map_op[".sbyte_*"] = op_data -map_op[".word_*"] = op_data -map_op[".dword_*"] = op_data -map_op[".aword_*"] = op_data - ------------------------------------------------------------------------------- - --- Pseudo-opcode to mark the position where the action list is to be emitted. -map_op[".actionlist_1"] = function(params) - if not params then return "cvar" end - local name = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeactions(out, name) end) -end - --- Pseudo-opcode to mark the position where the global enum is to be emitted. -map_op[".globals_1"] = function(params) - if not params then return "prefix" end - local prefix = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeglobals(out, prefix) end) -end - --- Pseudo-opcode to mark the position where the global names are to be emitted. -map_op[".globalnames_1"] = function(params) - if not params then return "cvar" end - local name = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeglobalnames(out, name) end) -end - --- Pseudo-opcode to mark the position where the extern names are to be emitted. -map_op[".externnames_1"] = function(params) - if not params then return "cvar" end - local name = params[1] -- No syntax check. You get to keep the pieces. - wline(function(out) writeexternnames(out, name) end) -end - ------------------------------------------------------------------------------- - --- Label pseudo-opcode (converted from trailing colon form). -map_op[".label_2"] = function(params) - if not params then return "[1-9] | ->global | =>pcexpr [, addr]" end - if secpos+2 > maxsecpos then wflush() end - local a = parseoperand(params[1]) - local mode, imm = a.mode, a.imm - if type(imm) == "number" and (mode == "iJ" or (imm >= 1 and imm <= 9)) then - -- Local label (1: ... 9:) or global label (->global:). - waction("LABEL_LG", nil, 1) - wputxb(imm) - elseif mode == "iJ" then - -- PC label (=>pcexpr:). - waction("LABEL_PC", imm) - else - werror("bad label definition") - end - -- SETLABEL must immediately follow LABEL_LG/LABEL_PC. - local addr = params[2] - if addr then - local a = parseoperand(addr) - if a.mode == "iPJ" then - waction("SETLABEL", a.imm) - else - werror("bad label assignment") - end - end -end -map_op[".label_1"] = map_op[".label_2"] - ------------------------------------------------------------------------------- - --- Alignment pseudo-opcode. -map_op[".align_1"] = function(params) - if not params then return "numpow2" end - if secpos+1 > maxsecpos then wflush() end - local align = tonumber(params[1]) or map_opsizenum[map_opsize[params[1]]] - if align then - local x = align - -- Must be a power of 2 in the range (2 ... 256). - for i=1,8 do - x = x / 2 - if x == 1 then - waction("ALIGN", nil, 1) - wputxb(align-1) -- Action byte is 2**n-1. - return - end - end - end - werror("bad alignment") -end - --- Spacing pseudo-opcode. -map_op[".space_2"] = function(params) - if not params then return "num [, filler]" end - if secpos+1 > maxsecpos then wflush() end - waction("SPACE", params[1]) - local fill = params[2] - if fill then - fill = tonumber(fill) - if not fill or fill < 0 or fill > 255 then werror("bad filler") end - end - wputxb(fill or 0) -end -map_op[".space_1"] = map_op[".space_2"] - ------------------------------------------------------------------------------- - --- Pseudo-opcode for (primitive) type definitions (map to C types). -map_op[".type_3"] = function(params, nparams) - if not params then - return nparams == 2 and "name, ctype" or "name, ctype, reg" - end - local name, ctype, reg = params[1], params[2], params[3] - if not match(name, "^[%a_][%w_]*$") then - werror("bad type name `"..name.."'") - end - local tp = map_type[name] - if tp then - werror("duplicate type `"..name.."'") - end - if reg and not map_reg_valid_base[reg] then - werror("bad base register `"..(map_reg_rev[reg] or reg).."'") - end - -- Add #type to defines. A bit unclean to put it in map_archdef. - map_archdef["#"..name] = "sizeof("..ctype..")" - -- Add new type and emit shortcut define. - local num = ctypenum + 1 - map_type[name] = { - ctype = ctype, - ctypefmt = format("Dt%X(%%s)", num), - reg = reg, - } - wline(format("#define Dt%X(_V) (int)(ptrdiff_t)&(((%s *)0)_V)", num, ctype)) - ctypenum = num -end -map_op[".type_2"] = map_op[".type_3"] - --- Dump type definitions. -local function dumptypes(out, lvl) - local t = {} - for name in pairs(map_type) do t[#t+1] = name end - sort(t) - out:write("Type definitions:\n") - for _,name in ipairs(t) do - local tp = map_type[name] - local reg = tp.reg and map_reg_rev[tp.reg] or "" - out:write(format(" %-20s %-20s %s\n", name, tp.ctype, reg)) - end - out:write("\n") -end - ------------------------------------------------------------------------------- - --- Set the current section. -function _M.section(num) - waction("SECTION") - wputxb(num) - wflush(true) -- SECTION is a terminal action. -end - ------------------------------------------------------------------------------- - --- Dump architecture description. -function _M.dumparch(out) - out:write(format("DynASM %s version %s, released %s\n\n", - _info.arch, _info.version, _info.release)) - dumpregs(out) - dumpactions(out) -end - --- Dump all user defined elements. -function _M.dumpdef(out, lvl) - dumptypes(out, lvl) - dumpglobals(out, lvl) - dumpexterns(out, lvl) -end - ------------------------------------------------------------------------------- - --- Pass callbacks from/to the DynASM core. -function _M.passcb(wl, we, wf, ww) - wline, werror, wfatal, wwarn = wl, we, wf, ww - return wflush -end - --- Setup the arch-specific module. -function _M.setup(arch, opt) - g_arch, g_opt = arch, opt -end - --- Merge the core maps and the arch-specific maps. -function _M.mergemaps(map_coreop, map_def) - setmetatable(map_op, { __index = map_coreop }) - setmetatable(map_def, { __index = map_archdef }) - return map_op, map_def -end - -return _M - ------------------------------------------------------------------------------- - diff --git a/subprojects/luajit/dynasm/dynasm.lua b/subprojects/luajit/dynasm/dynasm.lua deleted file mode 100644 index c46e956e6..000000000 --- a/subprojects/luajit/dynasm/dynasm.lua +++ /dev/null @@ -1,1094 +0,0 @@ ------------------------------------------------------------------------------- --- DynASM. A dynamic assembler for code generation engines. --- Originally designed and implemented for LuaJIT. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- See below for full copyright notice. ------------------------------------------------------------------------------- - --- Application information. -local _info = { - name = "DynASM", - description = "A dynamic assembler for code generation engines", - version = "1.3.0", - vernum = 10300, - release = "2011-05-05", - author = "Mike Pall", - url = "http://luajit.org/dynasm.html", - license = "MIT", - copyright = [[ -Copyright (C) 2005-2017 Mike Pall. All rights reserved. - -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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -[ MIT license: http://www.opensource.org/licenses/mit-license.php ] -]], -} - --- Cache library functions. -local type, pairs, ipairs = type, pairs, ipairs -local pcall, error, assert = pcall, error, assert -local _s = string -local sub, match, gmatch, gsub = _s.sub, _s.match, _s.gmatch, _s.gsub -local format, rep, upper = _s.format, _s.rep, _s.upper -local _t = table -local insert, remove, concat, sort = _t.insert, _t.remove, _t.concat, _t.sort -local exit = os.exit -local io = io -local stdin, stdout, stderr = io.stdin, io.stdout, io.stderr - ------------------------------------------------------------------------------- - --- Program options. -local g_opt = {} - --- Global state for current file. -local g_fname, g_curline, g_indent, g_lineno, g_synclineno, g_arch -local g_errcount = 0 - --- Write buffer for output file. -local g_wbuffer, g_capbuffer - ------------------------------------------------------------------------------- - --- Write an output line (or callback function) to the buffer. -local function wline(line, needindent) - local buf = g_capbuffer or g_wbuffer - buf[#buf+1] = needindent and g_indent..line or line - g_synclineno = g_synclineno + 1 -end - --- Write assembler line as a comment, if requestd. -local function wcomment(aline) - if g_opt.comment then - wline(g_opt.comment..aline..g_opt.endcomment, true) - end -end - --- Resync CPP line numbers. -local function wsync() - if g_synclineno ~= g_lineno and g_opt.cpp then - wline("#line "..g_lineno..' "'..g_fname..'"') - g_synclineno = g_lineno - end -end - --- Dummy action flush function. Replaced with arch-specific function later. -local function wflush(term) -end - --- Dump all buffered output lines. -local function wdumplines(out, buf) - for _,line in ipairs(buf) do - if type(line) == "string" then - assert(out:write(line, "\n")) - else - -- Special callback to dynamically insert lines after end of processing. - line(out) - end - end -end - ------------------------------------------------------------------------------- - --- Emit an error. Processing continues with next statement. -local function werror(msg) - error(format("%s:%s: error: %s:\n%s", g_fname, g_lineno, msg, g_curline), 0) -end - --- Emit a fatal error. Processing stops. -local function wfatal(msg) - g_errcount = "fatal" - werror(msg) -end - --- Print a warning. Processing continues. -local function wwarn(msg) - stderr:write(format("%s:%s: warning: %s:\n%s\n", - g_fname, g_lineno, msg, g_curline)) -end - --- Print caught error message. But suppress excessive errors. -local function wprinterr(...) - if type(g_errcount) == "number" then - -- Regular error. - g_errcount = g_errcount + 1 - if g_errcount < 21 then -- Seems to be a reasonable limit. - stderr:write(...) - elseif g_errcount == 21 then - stderr:write(g_fname, - ":*: warning: too many errors (suppressed further messages).\n") - end - else - -- Fatal error. - stderr:write(...) - return true -- Stop processing. - end -end - ------------------------------------------------------------------------------- - --- Map holding all option handlers. -local opt_map = {} -local opt_current - --- Print error and exit with error status. -local function opterror(...) - stderr:write("dynasm.lua: ERROR: ", ...) - stderr:write("\n") - exit(1) -end - --- Get option parameter. -local function optparam(args) - local argn = args.argn - local p = args[argn] - if not p then - opterror("missing parameter for option `", opt_current, "'.") - end - args.argn = argn + 1 - return p -end - ------------------------------------------------------------------------------- - --- Core pseudo-opcodes. -local map_coreop = {} --- Dummy opcode map. Replaced by arch-specific map. -local map_op = {} - --- Forward declarations. -local dostmt -local readfile - ------------------------------------------------------------------------------- - --- Map for defines (initially empty, chains to arch-specific map). -local map_def = {} - --- Pseudo-opcode to define a substitution. -map_coreop[".define_2"] = function(params, nparams) - if not params then return nparams == 1 and "name" or "name, subst" end - local name, def = params[1], params[2] or "1" - if not match(name, "^[%a_][%w_]*$") then werror("bad or duplicate define") end - map_def[name] = def -end -map_coreop[".define_1"] = map_coreop[".define_2"] - --- Define a substitution on the command line. -function opt_map.D(args) - local namesubst = optparam(args) - local name, subst = match(namesubst, "^([%a_][%w_]*)=(.*)$") - if name then - map_def[name] = subst - elseif match(namesubst, "^[%a_][%w_]*$") then - map_def[namesubst] = "1" - else - opterror("bad define") - end -end - --- Undefine a substitution on the command line. -function opt_map.U(args) - local name = optparam(args) - if match(name, "^[%a_][%w_]*$") then - map_def[name] = nil - else - opterror("bad define") - end -end - --- Helper for definesubst. -local gotsubst - -local function definesubst_one(word) - local subst = map_def[word] - if subst then gotsubst = word; return subst else return word end -end - --- Iteratively substitute defines. -local function definesubst(stmt) - -- Limit number of iterations. - for i=1,100 do - gotsubst = false - stmt = gsub(stmt, "#?[%w_]+", definesubst_one) - if not gotsubst then break end - end - if gotsubst then wfatal("recursive define involving `"..gotsubst.."'") end - return stmt -end - --- Dump all defines. -local function dumpdefines(out, lvl) - local t = {} - for name in pairs(map_def) do - t[#t+1] = name - end - sort(t) - out:write("Defines:\n") - for _,name in ipairs(t) do - local subst = map_def[name] - if g_arch then subst = g_arch.revdef(subst) end - out:write(format(" %-20s %s\n", name, subst)) - end - out:write("\n") -end - ------------------------------------------------------------------------------- - --- Support variables for conditional assembly. -local condlevel = 0 -local condstack = {} - --- Evaluate condition with a Lua expression. Substitutions already performed. -local function cond_eval(cond) - local func, err - if setfenv then - func, err = loadstring("return "..cond, "=expr") - else - -- No globals. All unknown identifiers evaluate to nil. - func, err = load("return "..cond, "=expr", "t", {}) - end - if func then - if setfenv then - setfenv(func, {}) -- No globals. All unknown identifiers evaluate to nil. - end - local ok, res = pcall(func) - if ok then - if res == 0 then return false end -- Oh well. - return not not res - end - err = res - end - wfatal("bad condition: "..err) -end - --- Skip statements until next conditional pseudo-opcode at the same level. -local function stmtskip() - local dostmt_save = dostmt - local lvl = 0 - dostmt = function(stmt) - local op = match(stmt, "^%s*(%S+)") - if op == ".if" then - lvl = lvl + 1 - elseif lvl ~= 0 then - if op == ".endif" then lvl = lvl - 1 end - elseif op == ".elif" or op == ".else" or op == ".endif" then - dostmt = dostmt_save - dostmt(stmt) - end - end -end - --- Pseudo-opcodes for conditional assembly. -map_coreop[".if_1"] = function(params) - if not params then return "condition" end - local lvl = condlevel + 1 - local res = cond_eval(params[1]) - condlevel = lvl - condstack[lvl] = res - if not res then stmtskip() end -end - -map_coreop[".elif_1"] = function(params) - if not params then return "condition" end - if condlevel == 0 then wfatal(".elif without .if") end - local lvl = condlevel - local res = condstack[lvl] - if res then - if res == "else" then wfatal(".elif after .else") end - else - res = cond_eval(params[1]) - if res then - condstack[lvl] = res - return - end - end - stmtskip() -end - -map_coreop[".else_0"] = function(params) - if condlevel == 0 then wfatal(".else without .if") end - local lvl = condlevel - local res = condstack[lvl] - condstack[lvl] = "else" - if res then - if res == "else" then wfatal(".else after .else") end - stmtskip() - end -end - -map_coreop[".endif_0"] = function(params) - local lvl = condlevel - if lvl == 0 then wfatal(".endif without .if") end - condlevel = lvl - 1 -end - --- Check for unfinished conditionals. -local function checkconds() - if g_errcount ~= "fatal" and condlevel ~= 0 then - wprinterr(g_fname, ":*: error: unbalanced conditional\n") - end -end - ------------------------------------------------------------------------------- - --- Search for a file in the given path and open it for reading. -local function pathopen(path, name) - local dirsep = package and match(package.path, "\\") and "\\" or "/" - for _,p in ipairs(path) do - local fullname = p == "" and name or p..dirsep..name - local fin = io.open(fullname, "r") - if fin then - g_fname = fullname - return fin - end - end -end - --- Include a file. -map_coreop[".include_1"] = function(params) - if not params then return "filename" end - local name = params[1] - -- Save state. Ugly, I know. but upvalues are fast. - local gf, gl, gcl, gi = g_fname, g_lineno, g_curline, g_indent - -- Read the included file. - local fatal = readfile(pathopen(g_opt.include, name) or - wfatal("include file `"..name.."' not found")) - -- Restore state. - g_synclineno = -1 - g_fname, g_lineno, g_curline, g_indent = gf, gl, gcl, gi - if fatal then wfatal("in include file") end -end - --- Make .include and conditionals initially available, too. -map_op[".include_1"] = map_coreop[".include_1"] -map_op[".if_1"] = map_coreop[".if_1"] -map_op[".elif_1"] = map_coreop[".elif_1"] -map_op[".else_0"] = map_coreop[".else_0"] -map_op[".endif_0"] = map_coreop[".endif_0"] - ------------------------------------------------------------------------------- - --- Support variables for macros. -local mac_capture, mac_lineno, mac_name -local mac_active = {} -local mac_list = {} - --- Pseudo-opcode to define a macro. -map_coreop[".macro_*"] = function(mparams) - if not mparams then return "name [, params...]" end - -- Split off and validate macro name. - local name = remove(mparams, 1) - if not name then werror("missing macro name") end - if not (match(name, "^[%a_][%w_%.]*$") or match(name, "^%.[%w_%.]*$")) then - wfatal("bad macro name `"..name.."'") - end - -- Validate macro parameter names. - local mdup = {} - for _,mp in ipairs(mparams) do - if not match(mp, "^[%a_][%w_]*$") then - wfatal("bad macro parameter name `"..mp.."'") - end - if mdup[mp] then wfatal("duplicate macro parameter name `"..mp.."'") end - mdup[mp] = true - end - -- Check for duplicate or recursive macro definitions. - local opname = name.."_"..#mparams - if map_op[opname] or map_op[name.."_*"] then - wfatal("duplicate macro `"..name.."' ("..#mparams.." parameters)") - end - if mac_capture then wfatal("recursive macro definition") end - - -- Enable statement capture. - local lines = {} - mac_lineno = g_lineno - mac_name = name - mac_capture = function(stmt) -- Statement capture function. - -- Stop macro definition with .endmacro pseudo-opcode. - if not match(stmt, "^%s*.endmacro%s*$") then - lines[#lines+1] = stmt - return - end - mac_capture = nil - mac_lineno = nil - mac_name = nil - mac_list[#mac_list+1] = opname - -- Add macro-op definition. - map_op[opname] = function(params) - if not params then return mparams, lines end - -- Protect against recursive macro invocation. - if mac_active[opname] then wfatal("recursive macro invocation") end - mac_active[opname] = true - -- Setup substitution map. - local subst = {} - for i,mp in ipairs(mparams) do subst[mp] = params[i] end - local mcom - if g_opt.maccomment and g_opt.comment then - mcom = " MACRO "..name.." ("..#mparams..")" - wcomment("{"..mcom) - end - -- Loop through all captured statements - for _,stmt in ipairs(lines) do - -- Substitute macro parameters. - local st = gsub(stmt, "[%w_]+", subst) - st = definesubst(st) - st = gsub(st, "%s*%.%.%s*", "") -- Token paste a..b. - if mcom and sub(st, 1, 1) ~= "|" then wcomment(st) end - -- Emit statement. Use a protected call for better diagnostics. - local ok, err = pcall(dostmt, st) - if not ok then - -- Add the captured statement to the error. - wprinterr(err, "\n", g_indent, "| ", stmt, - "\t[MACRO ", name, " (", #mparams, ")]\n") - end - end - if mcom then wcomment("}"..mcom) end - mac_active[opname] = nil - end - end -end - --- An .endmacro pseudo-opcode outside of a macro definition is an error. -map_coreop[".endmacro_0"] = function(params) - wfatal(".endmacro without .macro") -end - --- Dump all macros and their contents (with -PP only). -local function dumpmacros(out, lvl) - sort(mac_list) - out:write("Macros:\n") - for _,opname in ipairs(mac_list) do - local name = sub(opname, 1, -3) - local params, lines = map_op[opname]() - out:write(format(" %-20s %s\n", name, concat(params, ", "))) - if lvl > 1 then - for _,line in ipairs(lines) do - out:write(" |", line, "\n") - end - out:write("\n") - end - end - out:write("\n") -end - --- Check for unfinished macro definitions. -local function checkmacros() - if mac_capture then - wprinterr(g_fname, ":", mac_lineno, - ": error: unfinished .macro `", mac_name ,"'\n") - end -end - ------------------------------------------------------------------------------- - --- Support variables for captures. -local cap_lineno, cap_name -local cap_buffers = {} -local cap_used = {} - --- Start a capture. -map_coreop[".capture_1"] = function(params) - if not params then return "name" end - wflush() - local name = params[1] - if not match(name, "^[%a_][%w_]*$") then - wfatal("bad capture name `"..name.."'") - end - if cap_name then - wfatal("already capturing to `"..cap_name.."' since line "..cap_lineno) - end - cap_name = name - cap_lineno = g_lineno - -- Create or continue a capture buffer and start the output line capture. - local buf = cap_buffers[name] - if not buf then buf = {}; cap_buffers[name] = buf end - g_capbuffer = buf - g_synclineno = 0 -end - --- Stop a capture. -map_coreop[".endcapture_0"] = function(params) - wflush() - if not cap_name then wfatal(".endcapture without a valid .capture") end - cap_name = nil - cap_lineno = nil - g_capbuffer = nil - g_synclineno = 0 -end - --- Dump a capture buffer. -map_coreop[".dumpcapture_1"] = function(params) - if not params then return "name" end - wflush() - local name = params[1] - if not match(name, "^[%a_][%w_]*$") then - wfatal("bad capture name `"..name.."'") - end - cap_used[name] = true - wline(function(out) - local buf = cap_buffers[name] - if buf then wdumplines(out, buf) end - end) - g_synclineno = 0 -end - --- Dump all captures and their buffers (with -PP only). -local function dumpcaptures(out, lvl) - out:write("Captures:\n") - for name,buf in pairs(cap_buffers) do - out:write(format(" %-20s %4s)\n", name, "("..#buf)) - if lvl > 1 then - local bar = rep("=", 76) - out:write(" ", bar, "\n") - for _,line in ipairs(buf) do - out:write(" ", line, "\n") - end - out:write(" ", bar, "\n\n") - end - end - out:write("\n") -end - --- Check for unfinished or unused captures. -local function checkcaptures() - if cap_name then - wprinterr(g_fname, ":", cap_lineno, - ": error: unfinished .capture `", cap_name,"'\n") - return - end - for name in pairs(cap_buffers) do - if not cap_used[name] then - wprinterr(g_fname, ":*: error: missing .dumpcapture ", name ,"\n") - end - end -end - ------------------------------------------------------------------------------- - --- Sections names. -local map_sections = {} - --- Pseudo-opcode to define code sections. --- TODO: Data sections, BSS sections. Needs extra C code and API. -map_coreop[".section_*"] = function(params) - if not params then return "name..." end - if #map_sections > 0 then werror("duplicate section definition") end - wflush() - for sn,name in ipairs(params) do - local opname = "."..name.."_0" - if not match(name, "^[%a][%w_]*$") or - map_op[opname] or map_op["."..name.."_*"] then - werror("bad section name `"..name.."'") - end - map_sections[#map_sections+1] = name - wline(format("#define DASM_SECTION_%s\t%d", upper(name), sn-1)) - map_op[opname] = function(params) g_arch.section(sn-1) end - end - wline(format("#define DASM_MAXSECTION\t\t%d", #map_sections)) -end - --- Dump all sections. -local function dumpsections(out, lvl) - out:write("Sections:\n") - for _,name in ipairs(map_sections) do - out:write(format(" %s\n", name)) - end - out:write("\n") -end - ------------------------------------------------------------------------------- - --- Replacement for customized Lua, which lacks the package library. -local prefix = "" -if not require then - function require(name) - local fp = assert(io.open(prefix..name..".lua")) - local s = fp:read("*a") - assert(fp:close()) - return assert(loadstring(s, "@"..name..".lua"))() - end -end - --- Load architecture-specific module. -local function loadarch(arch) - if not match(arch, "^[%w_]+$") then return "bad arch name" end - local ok, m_arch = pcall(require, "dasm_"..arch) - if not ok then return "cannot load module: "..m_arch end - g_arch = m_arch - wflush = m_arch.passcb(wline, werror, wfatal, wwarn) - m_arch.setup(arch, g_opt) - map_op, map_def = m_arch.mergemaps(map_coreop, map_def) -end - --- Dump architecture description. -function opt_map.dumparch(args) - local name = optparam(args) - if not g_arch then - local err = loadarch(name) - if err then opterror(err) end - end - - local t = {} - for name in pairs(map_coreop) do t[#t+1] = name end - for name in pairs(map_op) do t[#t+1] = name end - sort(t) - - local out = stdout - local _arch = g_arch._info - out:write(format("%s version %s, released %s, %s\n", - _info.name, _info.version, _info.release, _info.url)) - g_arch.dumparch(out) - - local pseudo = true - out:write("Pseudo-Opcodes:\n") - for _,sname in ipairs(t) do - local name, nparam = match(sname, "^(.+)_([0-9%*])$") - if name then - if pseudo and sub(name, 1, 1) ~= "." then - out:write("\nOpcodes:\n") - pseudo = false - end - local f = map_op[sname] - local s - if nparam ~= "*" then nparam = nparam + 0 end - if nparam == 0 then - s = "" - elseif type(f) == "string" then - s = map_op[".template__"](nil, f, nparam) - else - s = f(nil, nparam) - end - if type(s) == "table" then - for _,s2 in ipairs(s) do - out:write(format(" %-12s %s\n", name, s2)) - end - else - out:write(format(" %-12s %s\n", name, s)) - end - end - end - out:write("\n") - exit(0) -end - --- Pseudo-opcode to set the architecture. --- Only initially available (map_op is replaced when called). -map_op[".arch_1"] = function(params) - if not params then return "name" end - local err = loadarch(params[1]) - if err then wfatal(err) end - wline(format("#if DASM_VERSION != %d", _info.vernum)) - wline('#error "Version mismatch between DynASM and included encoding engine"') - wline("#endif") -end - --- Dummy .arch pseudo-opcode to improve the error report. -map_coreop[".arch_1"] = function(params) - if not params then return "name" end - wfatal("duplicate .arch statement") -end - ------------------------------------------------------------------------------- - --- Dummy pseudo-opcode. Don't confuse '.nop' with 'nop'. -map_coreop[".nop_*"] = function(params) - if not params then return "[ignored...]" end -end - --- Pseudo-opcodes to raise errors. -map_coreop[".error_1"] = function(params) - if not params then return "message" end - werror(params[1]) -end - -map_coreop[".fatal_1"] = function(params) - if not params then return "message" end - wfatal(params[1]) -end - --- Dump all user defined elements. -local function dumpdef(out) - local lvl = g_opt.dumpdef - if lvl == 0 then return end - dumpsections(out, lvl) - dumpdefines(out, lvl) - if g_arch then g_arch.dumpdef(out, lvl) end - dumpmacros(out, lvl) - dumpcaptures(out, lvl) -end - ------------------------------------------------------------------------------- - --- Helper for splitstmt. -local splitlvl - -local function splitstmt_one(c) - if c == "(" then - splitlvl = ")"..splitlvl - elseif c == "[" then - splitlvl = "]"..splitlvl - elseif c == "{" then - splitlvl = "}"..splitlvl - elseif c == ")" or c == "]" or c == "}" then - if sub(splitlvl, 1, 1) ~= c then werror("unbalanced (), [] or {}") end - splitlvl = sub(splitlvl, 2) - elseif splitlvl == "" then - return " \0 " - end - return c -end - --- Split statement into (pseudo-)opcode and params. -local function splitstmt(stmt) - -- Convert label with trailing-colon into .label statement. - local label = match(stmt, "^%s*(.+):%s*$") - if label then return ".label", {label} end - - -- Split at commas and equal signs, but obey parentheses and brackets. - splitlvl = "" - stmt = gsub(stmt, "[,%(%)%[%]{}]", splitstmt_one) - if splitlvl ~= "" then werror("unbalanced () or []") end - - -- Split off opcode. - local op, other = match(stmt, "^%s*([^%s%z]+)%s*(.*)$") - if not op then werror("bad statement syntax") end - - -- Split parameters. - local params = {} - for p in gmatch(other, "%s*(%Z+)%z?") do - params[#params+1] = gsub(p, "%s+$", "") - end - if #params > 16 then werror("too many parameters") end - - params.op = op - return op, params -end - --- Process a single statement. -dostmt = function(stmt) - -- Ignore empty statements. - if match(stmt, "^%s*$") then return end - - -- Capture macro defs before substitution. - if mac_capture then return mac_capture(stmt) end - stmt = definesubst(stmt) - - -- Emit C code without parsing the line. - if sub(stmt, 1, 1) == "|" then - local tail = sub(stmt, 2) - wflush() - if sub(tail, 1, 2) == "//" then wcomment(tail) else wline(tail, true) end - return - end - - -- Split into (pseudo-)opcode and params. - local op, params = splitstmt(stmt) - - -- Get opcode handler (matching # of parameters or generic handler). - local f = map_op[op.."_"..#params] or map_op[op.."_*"] - if not f then - if not g_arch then wfatal("first statement must be .arch") end - -- Improve error report. - for i=0,9 do - if map_op[op.."_"..i] then - werror("wrong number of parameters for `"..op.."'") - end - end - werror("unknown statement `"..op.."'") - end - - -- Call opcode handler or special handler for template strings. - if type(f) == "string" then - map_op[".template__"](params, f) - else - f(params) - end -end - --- Process a single line. -local function doline(line) - if g_opt.flushline then wflush() end - - -- Assembler line? - local indent, aline = match(line, "^(%s*)%|(.*)$") - if not aline then - -- No, plain C code line, need to flush first. - wflush() - wsync() - wline(line, false) - return - end - - g_indent = indent -- Remember current line indentation. - - -- Emit C code (even from macros). Avoids echo and line parsing. - if sub(aline, 1, 1) == "|" then - if not mac_capture then - wsync() - elseif g_opt.comment then - wsync() - wcomment(aline) - end - dostmt(aline) - return - end - - -- Echo assembler line as a comment. - if g_opt.comment then - wsync() - wcomment(aline) - end - - -- Strip assembler comments. - aline = gsub(aline, "//.*$", "") - - -- Split line into statements at semicolons. - if match(aline, ";") then - for stmt in gmatch(aline, "[^;]+") do dostmt(stmt) end - else - dostmt(aline) - end -end - ------------------------------------------------------------------------------- - --- Write DynASM header. -local function dasmhead(out) - out:write(format([[ -/* -** This file has been pre-processed with DynASM. -** %s -** DynASM version %s, DynASM %s version %s -** DO NOT EDIT! The original file is in "%s". -*/ - -]], _info.url, - _info.version, g_arch._info.arch, g_arch._info.version, - g_fname)) -end - --- Read input file. -readfile = function(fin) - g_indent = "" - g_lineno = 0 - g_synclineno = -1 - - -- Process all lines. - for line in fin:lines() do - g_lineno = g_lineno + 1 - g_curline = line - local ok, err = pcall(doline, line) - if not ok and wprinterr(err, "\n") then return true end - end - wflush() - - -- Close input file. - assert(fin == stdin or fin:close()) -end - --- Write output file. -local function writefile(outfile) - local fout - - -- Open output file. - if outfile == nil or outfile == "-" then - fout = stdout - else - fout = assert(io.open(outfile, "w")) - end - - -- Write all buffered lines - wdumplines(fout, g_wbuffer) - - -- Close output file. - assert(fout == stdout or fout:close()) - - -- Optionally dump definitions. - dumpdef(fout == stdout and stderr or stdout) -end - --- Translate an input file to an output file. -local function translate(infile, outfile) - g_wbuffer = {} - g_indent = "" - g_lineno = 0 - g_synclineno = -1 - - -- Put header. - wline(dasmhead) - - -- Read input file. - local fin - if infile == "-" then - g_fname = "(stdin)" - fin = stdin - else - g_fname = infile - fin = assert(io.open(infile, "r")) - end - readfile(fin) - - -- Check for errors. - if not g_arch then - wprinterr(g_fname, ":*: error: missing .arch directive\n") - end - checkconds() - checkmacros() - checkcaptures() - - if g_errcount ~= 0 then - stderr:write(g_fname, ":*: info: ", g_errcount, " error", - (type(g_errcount) == "number" and g_errcount > 1) and "s" or "", - " in input file -- no output file generated.\n") - dumpdef(stderr) - exit(1) - end - - -- Write output file. - writefile(outfile) -end - ------------------------------------------------------------------------------- - --- Print help text. -function opt_map.help() - stdout:write("DynASM -- ", _info.description, ".\n") - stdout:write("DynASM ", _info.version, " ", _info.release, " ", _info.url, "\n") - stdout:write[[ - -Usage: dynasm [OPTION]... INFILE.dasc|- - - -h, --help Display this help text. - -V, --version Display version and copyright information. - - -o, --outfile FILE Output file name (default is stdout). - -I, --include DIR Add directory to the include search path. - - -c, --ccomment Use /* */ comments for assembler lines. - -C, --cppcomment Use // comments for assembler lines (default). - -N, --nocomment Suppress assembler lines in output. - -M, --maccomment Show macro expansions as comments (default off). - - -L, --nolineno Suppress CPP line number information in output. - -F, --flushline Flush action list for every line. - - -D NAME[=SUBST] Define a substitution. - -U NAME Undefine a substitution. - - -P, --dumpdef Dump defines, macros, etc. Repeat for more output. - -A, --dumparch ARCH Load architecture ARCH and dump description. -]] - exit(0) -end - --- Print version information. -function opt_map.version() - stdout:write(format("%s version %s, released %s\n%s\n\n%s", - _info.name, _info.version, _info.release, _info.url, _info.copyright)) - exit(0) -end - --- Misc. options. -function opt_map.outfile(args) g_opt.outfile = optparam(args) end -function opt_map.include(args) insert(g_opt.include, 1, optparam(args)) end -function opt_map.ccomment() g_opt.comment = "/*|"; g_opt.endcomment = " */" end -function opt_map.cppcomment() g_opt.comment = "//|"; g_opt.endcomment = "" end -function opt_map.nocomment() g_opt.comment = false end -function opt_map.maccomment() g_opt.maccomment = true end -function opt_map.nolineno() g_opt.cpp = false end -function opt_map.flushline() g_opt.flushline = true end -function opt_map.dumpdef() g_opt.dumpdef = g_opt.dumpdef + 1 end - ------------------------------------------------------------------------------- - --- Short aliases for long options. -local opt_alias = { - h = "help", ["?"] = "help", V = "version", - o = "outfile", I = "include", - c = "ccomment", C = "cppcomment", N = "nocomment", M = "maccomment", - L = "nolineno", F = "flushline", - P = "dumpdef", A = "dumparch", -} - --- Parse single option. -local function parseopt(opt, args) - opt_current = #opt == 1 and "-"..opt or "--"..opt - local f = opt_map[opt] or opt_map[opt_alias[opt]] - if not f then - opterror("unrecognized option `", opt_current, "'. Try `--help'.\n") - end - f(args) -end - --- Parse arguments. -local function parseargs(args) - -- Default options. - g_opt.comment = "//|" - g_opt.endcomment = "" - g_opt.cpp = true - g_opt.dumpdef = 0 - g_opt.include = { "" } - - -- Process all option arguments. - args.argn = 1 - repeat - local a = args[args.argn] - if not a then break end - local lopt, opt = match(a, "^%-(%-?)(.+)") - if not opt then break end - args.argn = args.argn + 1 - if lopt == "" then - -- Loop through short options. - for o in gmatch(opt, ".") do parseopt(o, args) end - else - -- Long option. - parseopt(opt, args) - end - until false - - -- Check for proper number of arguments. - local nargs = #args - args.argn + 1 - if nargs ~= 1 then - if nargs == 0 then - if g_opt.dumpdef > 0 then return dumpdef(stdout) end - end - opt_map.help() - end - - -- Translate a single input file to a single output file - -- TODO: Handle multiple files? - translate(args[args.argn], g_opt.outfile) -end - ------------------------------------------------------------------------------- - --- Add the directory dynasm.lua resides in to the Lua module search path. -local arg = arg -if arg and arg[0] then - prefix = match(arg[0], "^(.*[/\\])") - if package and prefix then package.path = prefix.."?.lua;"..package.path end -end - --- Start DynASM. -parseargs{...} - ------------------------------------------------------------------------------- - diff --git a/subprojects/luajit/include/lauxlib.h b/subprojects/luajit/include/lauxlib.h deleted file mode 100644 index fed1491b8..000000000 --- a/subprojects/luajit/include/lauxlib.h +++ /dev/null @@ -1,167 +0,0 @@ -/* -** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $ -** Auxiliary functions for building Lua libraries -** See Copyright Notice in lua.h -*/ - - -#ifndef lauxlib_h -#define lauxlib_h - - -#include -#include - -#include "lua.h" - - -#define luaL_getn(L,i) ((int)lua_objlen(L, i)) -#define luaL_setn(L,i,j) ((void)0) /* no op! */ - -/* extra error code for `luaL_load' */ -#define LUA_ERRFILE (LUA_ERRERR+1) - -typedef struct luaL_Reg { - const char *name; - lua_CFunction func; -} luaL_Reg; - -LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, - const luaL_Reg *l, int nup); -LUALIB_API void (luaL_register) (lua_State *L, const char *libname, - const luaL_Reg *l); -LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); -LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); -LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); -LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); -LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, - size_t *l); -LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg, - const char *def, size_t *l); -LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg); -LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def); - -LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg); -LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg, - lua_Integer def); - -LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg); -LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t); -LUALIB_API void (luaL_checkany) (lua_State *L, int narg); - -LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname); -LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname); - -LUALIB_API void (luaL_where) (lua_State *L, int lvl); -LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); - -LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, - const char *const lst[]); - -LUALIB_API int (luaL_ref) (lua_State *L, int t); -LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); - -LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename); -LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, - const char *name); -LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); - -LUALIB_API lua_State *(luaL_newstate) (void); - - -LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, - const char *r); - -LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx, - const char *fname, int szhint); - -/* From Lua 5.2. */ -LUALIB_API int luaL_fileresult(lua_State *L, int stat, const char *fname); -LUALIB_API int luaL_execresult(lua_State *L, int stat); -LUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename, - const char *mode); -LUALIB_API int (luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz, - const char *name, const char *mode); -LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, const char *msg, - int level); - - -/* -** =============================================================== -** some useful macros -** =============================================================== -*/ - -#define luaL_argcheck(L, cond,numarg,extramsg) \ - ((void)((cond) || luaL_argerror(L, (numarg), (extramsg)))) -#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) -#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) -#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) -#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) -#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) -#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) - -#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i))) - -#define luaL_dofile(L, fn) \ - (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) - -#define luaL_dostring(L, s) \ - (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0)) - -#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n))) - -#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) - -/* -** {====================================================== -** Generic Buffer manipulation -** ======================================================= -*/ - - - -typedef struct luaL_Buffer { - char *p; /* current position in buffer */ - int lvl; /* number of strings in the stack (level) */ - lua_State *L; - char buffer[LUAL_BUFFERSIZE]; -} luaL_Buffer; - -#define luaL_addchar(B,c) \ - ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \ - (*(B)->p++ = (char)(c))) - -/* compatibility only */ -#define luaL_putchar(B,c) luaL_addchar(B,c) - -#define luaL_addsize(B,n) ((B)->p += (n)) - -LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B); -LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B); -LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l); -LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s); -LUALIB_API void (luaL_addvalue) (luaL_Buffer *B); -LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); - - -/* }====================================================== */ - - -/* compatibility with ref system */ - -/* pre-defined references */ -#define LUA_NOREF (-2) -#define LUA_REFNIL (-1) - -#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ - (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) - -#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) - -#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref)) - - -#define luaL_reg luaL_Reg - -#endif diff --git a/subprojects/luajit/include/lua.h b/subprojects/luajit/include/lua.h deleted file mode 100644 index c83fd3bbe..000000000 --- a/subprojects/luajit/include/lua.h +++ /dev/null @@ -1,393 +0,0 @@ -/* -** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $ -** Lua - An Extensible Extension Language -** Lua.org, PUC-Rio, Brazil (http://www.lua.org) -** See Copyright Notice at the end of this file -*/ - - -#ifndef lua_h -#define lua_h - -#include -#include - - -#include "luaconf.h" - - -#define LUA_VERSION "Lua 5.1" -#define LUA_RELEASE "Lua 5.1.4" -#define LUA_VERSION_NUM 501 -#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio" -#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" - - -/* mark for precompiled code (`Lua') */ -#define LUA_SIGNATURE "\033Lua" - -/* option for multiple returns in `lua_pcall' and `lua_call' */ -#define LUA_MULTRET (-1) - - -/* -** pseudo-indices -*/ -#define LUA_REGISTRYINDEX (-10000) -#define LUA_ENVIRONINDEX (-10001) -#define LUA_GLOBALSINDEX (-10002) -#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i)) - - -/* thread status; 0 is OK */ -#define LUA_YIELD 1 -#define LUA_ERRRUN 2 -#define LUA_ERRSYNTAX 3 -#define LUA_ERRMEM 4 -#define LUA_ERRERR 5 - - -typedef struct lua_State lua_State; - -typedef int (*lua_CFunction) (lua_State *L); - - -/* -** functions that read/write blocks when loading/dumping Lua chunks -*/ -typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz); - -typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud); - - -/* -** prototype for memory-allocation functions -*/ -typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); - - -/* -** basic types -*/ -#define LUA_TNONE (-1) - -#define LUA_TNIL 0 -#define LUA_TBOOLEAN 1 -#define LUA_TLIGHTUSERDATA 2 -#define LUA_TNUMBER 3 -#define LUA_TSTRING 4 -#define LUA_TTABLE 5 -#define LUA_TFUNCTION 6 -#define LUA_TUSERDATA 7 -#define LUA_TTHREAD 8 - - - -/* minimum Lua stack available to a C function */ -#define LUA_MINSTACK 20 - - -/* -** generic extra include file -*/ -#if defined(LUA_USER_H) -#include LUA_USER_H -#endif - - -/* type of numbers in Lua */ -typedef LUA_NUMBER lua_Number; - - -/* type for integer functions */ -typedef LUA_INTEGER lua_Integer; - - - -/* -** state manipulation -*/ -LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); -LUA_API void (lua_close) (lua_State *L); -LUA_API lua_State *(lua_newthread) (lua_State *L); - -LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); - - -/* -** basic stack manipulation -*/ -LUA_API int (lua_gettop) (lua_State *L); -LUA_API void (lua_settop) (lua_State *L, int idx); -LUA_API void (lua_pushvalue) (lua_State *L, int idx); -LUA_API void (lua_remove) (lua_State *L, int idx); -LUA_API void (lua_insert) (lua_State *L, int idx); -LUA_API void (lua_replace) (lua_State *L, int idx); -LUA_API int (lua_checkstack) (lua_State *L, int sz); - -LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n); - - -/* -** access functions (stack -> C) -*/ - -LUA_API int (lua_isnumber) (lua_State *L, int idx); -LUA_API int (lua_isstring) (lua_State *L, int idx); -LUA_API int (lua_iscfunction) (lua_State *L, int idx); -LUA_API int (lua_isuserdata) (lua_State *L, int idx); -LUA_API int (lua_type) (lua_State *L, int idx); -LUA_API const char *(lua_typename) (lua_State *L, int tp); - -LUA_API int (lua_equal) (lua_State *L, int idx1, int idx2); -LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2); -LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2); - -LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx); -LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx); -LUA_API int (lua_toboolean) (lua_State *L, int idx); -LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); -LUA_API size_t (lua_objlen) (lua_State *L, int idx); -LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); -LUA_API void *(lua_touserdata) (lua_State *L, int idx); -LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); -LUA_API const void *(lua_topointer) (lua_State *L, int idx); - - -/* -** push functions (C -> stack) -*/ -LUA_API void (lua_pushnil) (lua_State *L); -LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n); -LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n); -LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l); -LUA_API void (lua_pushstring) (lua_State *L, const char *s); -LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt, - va_list argp); -LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...); -LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n); -LUA_API void (lua_pushboolean) (lua_State *L, int b); -LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p); -LUA_API int (lua_pushthread) (lua_State *L); - - -/* -** get functions (Lua -> stack) -*/ -LUA_API void (lua_gettable) (lua_State *L, int idx); -LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k); -LUA_API void (lua_rawget) (lua_State *L, int idx); -LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n); -LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); -LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); -LUA_API int (lua_getmetatable) (lua_State *L, int objindex); -LUA_API void (lua_getfenv) (lua_State *L, int idx); - - -/* -** set functions (stack -> Lua) -*/ -LUA_API void (lua_settable) (lua_State *L, int idx); -LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); -LUA_API void (lua_rawset) (lua_State *L, int idx); -LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); -LUA_API int (lua_setmetatable) (lua_State *L, int objindex); -LUA_API int (lua_setfenv) (lua_State *L, int idx); - - -/* -** `load' and `call' functions (load and run Lua code) -*/ -LUA_API void (lua_call) (lua_State *L, int nargs, int nresults); -LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc); -LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud); -LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt, - const char *chunkname); - -LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data); - - -/* -** coroutine functions -*/ -LUA_API int (lua_yield) (lua_State *L, int nresults); -LUA_API int (lua_resume) (lua_State *L, int narg); -LUA_API int (lua_status) (lua_State *L); - -/* -** garbage-collection function and options -*/ - -#define LUA_GCSTOP 0 -#define LUA_GCRESTART 1 -#define LUA_GCCOLLECT 2 -#define LUA_GCCOUNT 3 -#define LUA_GCCOUNTB 4 -#define LUA_GCSTEP 5 -#define LUA_GCSETPAUSE 6 -#define LUA_GCSETSTEPMUL 7 - -LUA_API int (lua_gc) (lua_State *L, int what, int data); - - -/* -** miscellaneous functions -*/ - -LUA_API int (lua_error) (lua_State *L); - -LUA_API int (lua_next) (lua_State *L, int idx); - -LUA_API void (lua_concat) (lua_State *L, int n); - -LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); -LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); - - - -/* -** =============================================================== -** some useful macros -** =============================================================== -*/ - -#define lua_pop(L,n) lua_settop(L, -(n)-1) - -#define lua_newtable(L) lua_createtable(L, 0, 0) - -#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) - -#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) - -#define lua_strlen(L,i) lua_objlen(L, (i)) - -#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION) -#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE) -#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA) -#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL) -#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN) -#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD) -#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE) -#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0) - -#define lua_pushliteral(L, s) \ - lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1) - -#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s)) -#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s)) - -#define lua_tostring(L,i) lua_tolstring(L, (i), NULL) - - - -/* -** compatibility macros and functions -*/ - -#define lua_open() luaL_newstate() - -#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX) - -#define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0) - -#define lua_Chunkreader lua_Reader -#define lua_Chunkwriter lua_Writer - - -/* hack */ -LUA_API void lua_setlevel (lua_State *from, lua_State *to); - - -/* -** {====================================================================== -** Debug API -** ======================================================================= -*/ - - -/* -** Event codes -*/ -#define LUA_HOOKCALL 0 -#define LUA_HOOKRET 1 -#define LUA_HOOKLINE 2 -#define LUA_HOOKCOUNT 3 -#define LUA_HOOKTAILRET 4 - - -/* -** Event masks -*/ -#define LUA_MASKCALL (1 << LUA_HOOKCALL) -#define LUA_MASKRET (1 << LUA_HOOKRET) -#define LUA_MASKLINE (1 << LUA_HOOKLINE) -#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT) - -typedef struct lua_Debug lua_Debug; /* activation record */ - - -/* Functions to be called by the debuger in specific events */ -typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); - - -LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar); -LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); -LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); -LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); -LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n); -LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n); -LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count); -LUA_API lua_Hook lua_gethook (lua_State *L); -LUA_API int lua_gethookmask (lua_State *L); -LUA_API int lua_gethookcount (lua_State *L); - -/* From Lua 5.2. */ -LUA_API void *lua_upvalueid (lua_State *L, int idx, int n); -LUA_API void lua_upvaluejoin (lua_State *L, int idx1, int n1, int idx2, int n2); -LUA_API int lua_loadx (lua_State *L, lua_Reader reader, void *dt, - const char *chunkname, const char *mode); - - -struct lua_Debug { - int event; - const char *name; /* (n) */ - const char *namewhat; /* (n) `global', `local', `field', `method' */ - const char *what; /* (S) `Lua', `C', `main', `tail' */ - const char *source; /* (S) */ - int currentline; /* (l) */ - int nups; /* (u) number of upvalues */ - int linedefined; /* (S) */ - int lastlinedefined; /* (S) */ - char short_src[LUA_IDSIZE]; /* (S) */ - /* private part */ - int i_ci; /* active function */ -}; - -/* }====================================================================== */ - - -/****************************************************************************** -* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved. -* -* 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -******************************************************************************/ - - -#endif diff --git a/subprojects/luajit/include/lua.hpp b/subprojects/luajit/include/lua.hpp deleted file mode 100644 index 07e9002dc..000000000 --- a/subprojects/luajit/include/lua.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// C++ wrapper for LuaJIT header files. - -extern "C" { -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" -#include "luajit.h" -} - diff --git a/subprojects/luajit/include/luaconf.h b/subprojects/luajit/include/luaconf.h deleted file mode 100644 index b33e91b77..000000000 --- a/subprojects/luajit/include/luaconf.h +++ /dev/null @@ -1,156 +0,0 @@ -/* -** Configuration header. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef luaconf_h -#define luaconf_h - -#ifndef WINVER -#define WINVER 0x0501 -#endif -#include -#include - -/* Default path for loading Lua and C modules with require(). */ -#if defined(_WIN32) -/* -** In Windows, any exclamation mark ('!') in the path is replaced by the -** path of the directory of the executable file of the current process. -*/ -#define LUA_LDIR "!\\lua\\" -#define LUA_CDIR "!\\" -#define LUA_PATH_DEFAULT \ - ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" -#define LUA_CPATH_DEFAULT \ - ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" -#else -/* -** Note to distribution maintainers: do NOT patch the following lines! -** Please read ../doc/install.html#distro and pass PREFIX=/usr instead. -*/ -#ifndef LUA_MULTILIB -#define LUA_MULTILIB "lib" -#endif -#ifndef LUA_LMULTILIB -#define LUA_LMULTILIB "lib" -#endif -#define LUA_LROOT "/usr/local" -#define LUA_LUADIR "/lua/5.1/" -#define LUA_LJDIR "/luajit-2.0.5/" - -#ifdef LUA_ROOT -#define LUA_JROOT LUA_ROOT -#define LUA_RLDIR LUA_ROOT "/share" LUA_LUADIR -#define LUA_RCDIR LUA_ROOT "/" LUA_MULTILIB LUA_LUADIR -#define LUA_RLPATH ";" LUA_RLDIR "?.lua;" LUA_RLDIR "?/init.lua" -#define LUA_RCPATH ";" LUA_RCDIR "?.so" -#else -#define LUA_JROOT LUA_LROOT -#define LUA_RLPATH -#define LUA_RCPATH -#endif - -#define LUA_JPATH ";" LUA_JROOT "/share" LUA_LJDIR "?.lua" -#define LUA_LLDIR LUA_LROOT "/share" LUA_LUADIR -#define LUA_LCDIR LUA_LROOT "/" LUA_LMULTILIB LUA_LUADIR -#define LUA_LLPATH ";" LUA_LLDIR "?.lua;" LUA_LLDIR "?/init.lua" -#define LUA_LCPATH1 ";" LUA_LCDIR "?.so" -#define LUA_LCPATH2 ";" LUA_LCDIR "loadall.so" - -#define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH -#define LUA_CPATH_DEFAULT "./?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2 -#endif - -/* Environment variable names for path overrides and initialization code. */ -#define LUA_PATH "LUA_PATH" -#define LUA_CPATH "LUA_CPATH" -#define LUA_INIT "LUA_INIT" - -/* Special file system characters. */ -#if defined(_WIN32) -#define LUA_DIRSEP "\\" -#else -#define LUA_DIRSEP "/" -#endif -#define LUA_PATHSEP ";" -#define LUA_PATH_MARK "?" -#define LUA_EXECDIR "!" -#define LUA_IGMARK "-" -#define LUA_PATH_CONFIG \ - LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" \ - LUA_EXECDIR "\n" LUA_IGMARK - -/* Quoting in error messages. */ -#define LUA_QL(x) "'" x "'" -#define LUA_QS LUA_QL("%s") - -/* Various tunables. */ -#define LUAI_MAXSTACK 65500 /* Max. # of stack slots for a thread (<64K). */ -#define LUAI_MAXCSTACK 8000 /* Max. # of stack slots for a C func (<10K). */ -#define LUAI_GCPAUSE 200 /* Pause GC until memory is at 200%. */ -#define LUAI_GCMUL 200 /* Run GC at 200% of allocation speed. */ -#define LUA_MAXCAPTURES 32 /* Max. pattern captures. */ - -/* Compatibility with older library function names. */ -#define LUA_COMPAT_MOD /* OLD: math.mod, NEW: math.fmod */ -#define LUA_COMPAT_GFIND /* OLD: string.gfind, NEW: string.gmatch */ - -/* Configuration for the frontend (the luajit executable). */ -#if defined(luajit_c) -#define LUA_PROGNAME "luajit" /* Fallback frontend name. */ -#define LUA_PROMPT "> " /* Interactive prompt. */ -#define LUA_PROMPT2 ">> " /* Continuation prompt. */ -#define LUA_MAXINPUT 512 /* Max. input line length. */ -#endif - -/* Note: changing the following defines breaks the Lua 5.1 ABI. */ -#define LUA_INTEGER ptrdiff_t -#define LUA_IDSIZE 60 /* Size of lua_Debug.short_src. */ -/* -** Size of lauxlib and io.* on-stack buffers. Weird workaround to avoid using -** unreasonable amounts of stack space, but still retain ABI compatibility. -** Blame Lua for depending on BUFSIZ in the ABI, blame **** for wrecking it. -*/ -#define LUAL_BUFFERSIZE (BUFSIZ > 16384 ? 8192 : BUFSIZ) - -/* The following defines are here only for compatibility with luaconf.h -** from the standard Lua distribution. They must not be changed for LuaJIT. -*/ -#define LUA_NUMBER_DOUBLE -#define LUA_NUMBER double -#define LUAI_UACNUMBER double -#define LUA_NUMBER_SCAN "%lf" -#define LUA_NUMBER_FMT "%.14g" -#define lua_number2str(s, n) sprintf((s), LUA_NUMBER_FMT, (n)) -#define LUAI_MAXNUMBER2STR 32 -#define LUA_INTFRMLEN "l" -#define LUA_INTFRM_T long - -/* Linkage of public API functions. */ -#if defined(LUA_BUILD_AS_DLL) -#if defined(LUA_CORE) || defined(LUA_LIB) -#define LUA_API __declspec(dllexport) -#else -#define LUA_API __declspec(dllimport) -#endif -#else -#define LUA_API extern -#endif - -#define LUALIB_API LUA_API - -/* Support for internal assertions. */ -#if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK) -#include -#endif -#ifdef LUA_USE_ASSERT -#define lua_assert(x) assert(x) -#endif -#ifdef LUA_USE_APICHECK -#define luai_apicheck(L, o) { (void)L; assert(o); } -#else -#define luai_apicheck(L, o) { (void)L; } -#endif - -#endif diff --git a/subprojects/luajit/include/luajit.h b/subprojects/luajit/include/luajit.h deleted file mode 100644 index c5ff3acb4..000000000 --- a/subprojects/luajit/include/luajit.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -** LuaJIT -- a Just-In-Time Compiler for Lua. http://luajit.org/ -** -** Copyright (C) 2005-2017 Mike Pall. All rights reserved. -** -** 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -** -** [ MIT license: http://www.opensource.org/licenses/mit-license.php ] -*/ - -#ifndef _LUAJIT_H -#define _LUAJIT_H - -#include "lua.h" - -#define LUAJIT_VERSION "LuaJIT 2.0.5" -#define LUAJIT_VERSION_NUM 20005 /* Version 2.0.5 = 02.00.05. */ -#define LUAJIT_VERSION_SYM luaJIT_version_2_0_5 -#define LUAJIT_COPYRIGHT "Copyright (C) 2005-2017 Mike Pall" -#define LUAJIT_URL "http://luajit.org/" - -/* Modes for luaJIT_setmode. */ -#define LUAJIT_MODE_MASK 0x00ff - -enum { - LUAJIT_MODE_ENGINE, /* Set mode for whole JIT engine. */ - LUAJIT_MODE_DEBUG, /* Set debug mode (idx = level). */ - - LUAJIT_MODE_FUNC, /* Change mode for a function. */ - LUAJIT_MODE_ALLFUNC, /* Recurse into subroutine protos. */ - LUAJIT_MODE_ALLSUBFUNC, /* Change only the subroutines. */ - - LUAJIT_MODE_TRACE, /* Flush a compiled trace. */ - - LUAJIT_MODE_WRAPCFUNC = 0x10, /* Set wrapper mode for C function calls. */ - - LUAJIT_MODE_MAX -}; - -/* Flags or'ed in to the mode. */ -#define LUAJIT_MODE_OFF 0x0000 /* Turn feature off. */ -#define LUAJIT_MODE_ON 0x0100 /* Turn feature on. */ -#define LUAJIT_MODE_FLUSH 0x0200 /* Flush JIT-compiled code. */ - -/* LuaJIT public C API. */ - -/* Control the JIT engine. */ -LUA_API int luaJIT_setmode(lua_State *L, int idx, int mode); - -/* Enforce (dynamic) linker error for version mismatches. Call from main. */ -LUA_API void LUAJIT_VERSION_SYM(void); - -#endif diff --git a/subprojects/luajit/include/lualib.h b/subprojects/luajit/include/lualib.h deleted file mode 100644 index bfc130a1a..000000000 --- a/subprojects/luajit/include/lualib.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -** Standard library header. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LUALIB_H -#define _LUALIB_H - -#include "lua.h" - -#define LUA_FILEHANDLE "FILE*" - -#define LUA_COLIBNAME "coroutine" -#define LUA_MATHLIBNAME "math" -#define LUA_STRLIBNAME "string" -#define LUA_TABLIBNAME "table" -#define LUA_IOLIBNAME "io" -#define LUA_OSLIBNAME "os" -#define LUA_LOADLIBNAME "package" -#define LUA_DBLIBNAME "debug" -#define LUA_BITLIBNAME "bit" -#define LUA_JITLIBNAME "jit" -#define LUA_FFILIBNAME "ffi" - -LUALIB_API int luaopen_base(lua_State *L); -LUALIB_API int luaopen_math(lua_State *L); -LUALIB_API int luaopen_string(lua_State *L); -LUALIB_API int luaopen_table(lua_State *L); -LUALIB_API int luaopen_io(lua_State *L); -LUALIB_API int luaopen_os(lua_State *L); -LUALIB_API int luaopen_package(lua_State *L); -LUALIB_API int luaopen_debug(lua_State *L); -LUALIB_API int luaopen_bit(lua_State *L); -LUALIB_API int luaopen_jit(lua_State *L); -LUALIB_API int luaopen_ffi(lua_State *L); - -LUALIB_API void luaL_openlibs(lua_State *L); - -#ifndef lua_assert -#define lua_assert(x) ((void)0) -#endif - -#endif diff --git a/subprojects/luajit/src/host/README b/subprojects/luajit/src/host/README deleted file mode 100644 index abfcdaa76..000000000 --- a/subprojects/luajit/src/host/README +++ /dev/null @@ -1,4 +0,0 @@ -The files in this directory are only used during the build process of LuaJIT. -For cross-compilation, they must be executed on the host, not on the target. - -These files should NOT be installed! diff --git a/subprojects/luajit/src/host/buildvm.c b/subprojects/luajit/src/host/buildvm.c deleted file mode 100644 index b9560f313..000000000 --- a/subprojects/luajit/src/host/buildvm.c +++ /dev/null @@ -1,516 +0,0 @@ -/* -** LuaJIT VM builder. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** This is a tool to build the hand-tuned assembler code required for -** LuaJIT's bytecode interpreter. It supports a variety of output formats -** to feed different toolchains (see usage() below). -** -** This tool is not particularly optimized because it's only used while -** _building_ LuaJIT. There's no point in distributing or installing it. -** Only the object code generated by this tool is linked into LuaJIT. -** -** Caveat: some memory is not free'd, error handling is lazy. -** It's a one-shot tool -- any effort fixing this would be wasted. -*/ - -#include "buildvm.h" -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_bc.h" -#include "lj_ir.h" -#include "lj_ircall.h" -#include "lj_frame.h" -#include "lj_dispatch.h" -#if LJ_HASFFI -#include "lj_ctype.h" -#include "lj_ccall.h" -#endif -#include "luajit.h" - -#if defined(_WIN32) -#include -#include -#endif - -/* ------------------------------------------------------------------------ */ - -/* DynASM glue definitions. */ -#define Dst ctx -#define Dst_DECL BuildCtx *ctx -#define Dst_REF (ctx->D) -#define DASM_CHECKS 1 - -#include "../dynasm/dasm_proto.h" - -/* Glue macros for DynASM. */ -static int collect_reloc(BuildCtx *ctx, uint8_t *addr, int idx, int type); - -#define DASM_EXTERN(ctx, addr, idx, type) \ - collect_reloc(ctx, addr, idx, type) - -/* ------------------------------------------------------------------------ */ - -/* Avoid trouble if cross-compiling for an x86 target. Speed doesn't matter. */ -#define DASM_ALIGNED_WRITES 1 - -/* Embed architecture-specific DynASM encoder. */ -#if LJ_TARGET_X86ORX64 -#include "../dynasm/dasm_x86.h" -#elif LJ_TARGET_ARM -#include "../dynasm/dasm_arm.h" -#elif LJ_TARGET_PPC -#include "../dynasm/dasm_ppc.h" -#elif LJ_TARGET_PPCSPE -#include "../dynasm/dasm_ppc.h" -#elif LJ_TARGET_MIPS -#include "../dynasm/dasm_mips.h" -#else -#error "No support for this architecture (yet)" -#endif - -/* Embed generated architecture-specific backend. */ -#include "buildvm_arch.h" - -/* ------------------------------------------------------------------------ */ - -void owrite(BuildCtx *ctx, const void *ptr, size_t sz) -{ - if (fwrite(ptr, 1, sz, ctx->fp) != sz) { - fprintf(stderr, "Error: cannot write to output file: %s\n", - strerror(errno)); - exit(1); - } -} - -/* ------------------------------------------------------------------------ */ - -/* Emit code as raw bytes. Only used for DynASM debugging. */ -static void emit_raw(BuildCtx *ctx) -{ - owrite(ctx, ctx->code, ctx->codesz); -} - -/* -- Build machine code -------------------------------------------------- */ - -static const char *sym_decorate(BuildCtx *ctx, - const char *prefix, const char *suffix) -{ - char name[256]; - char *p; -#if LJ_64 - const char *symprefix = ctx->mode == BUILD_machasm ? "_" : ""; -#elif LJ_TARGET_XBOX360 - const char *symprefix = ""; -#else - const char *symprefix = ctx->mode != BUILD_elfasm ? "_" : ""; -#endif - sprintf(name, "%s%s%s", symprefix, prefix, suffix); - p = strchr(name, '@'); - if (p) { -#if LJ_TARGET_X86ORX64 - if (!LJ_64 && (ctx->mode == BUILD_coffasm || ctx->mode == BUILD_peobj)) - name[0] = '@'; - else - *p = '\0'; -#elif (LJ_TARGET_PPC || LJ_TARGET_PPCSPE) && !LJ_TARGET_CONSOLE - /* Keep @plt. */ -#else - *p = '\0'; -#endif - } - p = (char *)malloc(strlen(name)+1); /* MSVC doesn't like strdup. */ - strcpy(p, name); - return p; -} - -#define NRELOCSYM (sizeof(extnames)/sizeof(extnames[0])-1) - -static int relocmap[NRELOCSYM]; - -/* Collect external relocations. */ -static int collect_reloc(BuildCtx *ctx, uint8_t *addr, int idx, int type) -{ - if (ctx->nreloc >= BUILD_MAX_RELOC) { - fprintf(stderr, "Error: too many relocations, increase BUILD_MAX_RELOC.\n"); - exit(1); - } - if (relocmap[idx] < 0) { - relocmap[idx] = ctx->nrelocsym; - ctx->relocsym[ctx->nrelocsym] = sym_decorate(ctx, "", extnames[idx]); - ctx->nrelocsym++; - } - ctx->reloc[ctx->nreloc].ofs = (int32_t)(addr - ctx->code); - ctx->reloc[ctx->nreloc].sym = relocmap[idx]; - ctx->reloc[ctx->nreloc].type = type; - ctx->nreloc++; -#if LJ_TARGET_XBOX360 - return (int)(ctx->code - addr) + 4; /* Encode symbol offset of .text. */ -#else - return 0; /* Encode symbol offset of 0. */ -#endif -} - -/* Naive insertion sort. Performance doesn't matter here. */ -static void sym_insert(BuildCtx *ctx, int32_t ofs, - const char *prefix, const char *suffix) -{ - ptrdiff_t i = ctx->nsym++; - while (i > 0) { - if (ctx->sym[i-1].ofs <= ofs) - break; - ctx->sym[i] = ctx->sym[i-1]; - i--; - } - ctx->sym[i].ofs = ofs; - ctx->sym[i].name = sym_decorate(ctx, prefix, suffix); -} - -/* Build the machine code. */ -static int build_code(BuildCtx *ctx) -{ - int status; - int i; - - /* Initialize DynASM structures. */ - ctx->nglob = GLOB__MAX; - ctx->glob = (void **)malloc(ctx->nglob*sizeof(void *)); - memset(ctx->glob, 0, ctx->nglob*sizeof(void *)); - ctx->nreloc = 0; - - ctx->globnames = globnames; - ctx->relocsym = (const char **)malloc(NRELOCSYM*sizeof(const char *)); - ctx->nrelocsym = 0; - for (i = 0; i < (int)NRELOCSYM; i++) relocmap[i] = -1; - - ctx->dasm_ident = DASM_IDENT; - ctx->dasm_arch = DASM_ARCH; - - dasm_init(Dst, DASM_MAXSECTION); - dasm_setupglobal(Dst, ctx->glob, ctx->nglob); - dasm_setup(Dst, build_actionlist); - - /* Call arch-specific backend to emit the code. */ - ctx->npc = build_backend(ctx); - - /* Finalize the code. */ - (void)dasm_checkstep(Dst, -1); - if ((status = dasm_link(Dst, &ctx->codesz))) return status; - ctx->code = (uint8_t *)malloc(ctx->codesz); - if ((status = dasm_encode(Dst, (void *)ctx->code))) return status; - - /* Allocate symbol table and bytecode offsets. */ - ctx->beginsym = sym_decorate(ctx, "", LABEL_PREFIX "vm_asm_begin"); - ctx->sym = (BuildSym *)malloc((ctx->npc+ctx->nglob+1)*sizeof(BuildSym)); - ctx->nsym = 0; - ctx->bc_ofs = (int32_t *)malloc(ctx->npc*sizeof(int32_t)); - - /* Collect the opcodes (PC labels). */ - for (i = 0; i < ctx->npc; i++) { - int32_t ofs = dasm_getpclabel(Dst, i); - if (ofs < 0) return 0x22000000|i; - ctx->bc_ofs[i] = ofs; - if ((LJ_HASJIT || - !(i == BC_JFORI || i == BC_JFORL || i == BC_JITERL || i == BC_JLOOP || - i == BC_IFORL || i == BC_IITERL || i == BC_ILOOP)) && - (LJ_HASFFI || i != BC_KCDATA)) - sym_insert(ctx, ofs, LABEL_PREFIX_BC, bc_names[i]); - } - - /* Collect the globals (named labels). */ - for (i = 0; i < ctx->nglob; i++) { - const char *gl = globnames[i]; - int len = (int)strlen(gl); - if (!ctx->glob[i]) { - fprintf(stderr, "Error: undefined global %s\n", gl); - exit(2); - } - /* Skip the _Z symbols. */ - if (!(len >= 2 && gl[len-2] == '_' && gl[len-1] == 'Z')) - sym_insert(ctx, (int32_t)((uint8_t *)(ctx->glob[i]) - ctx->code), - LABEL_PREFIX, globnames[i]); - } - - /* Close the address range. */ - sym_insert(ctx, (int32_t)ctx->codesz, "", ""); - ctx->nsym--; - - dasm_free(Dst); - - return 0; -} - -/* -- Generate VM enums --------------------------------------------------- */ - -const char *const bc_names[] = { -#define BCNAME(name, ma, mb, mc, mt) #name, -BCDEF(BCNAME) -#undef BCNAME - NULL -}; - -const char *const ir_names[] = { -#define IRNAME(name, m, m1, m2) #name, -IRDEF(IRNAME) -#undef IRNAME - NULL -}; - -const char *const irt_names[] = { -#define IRTNAME(name, size) #name, -IRTDEF(IRTNAME) -#undef IRTNAME - NULL -}; - -const char *const irfpm_names[] = { -#define FPMNAME(name) #name, -IRFPMDEF(FPMNAME) -#undef FPMNAME - NULL -}; - -const char *const irfield_names[] = { -#define FLNAME(name, ofs) #name, -IRFLDEF(FLNAME) -#undef FLNAME - NULL -}; - -const char *const ircall_names[] = { -#define IRCALLNAME(cond, name, nargs, kind, type, flags) #name, -IRCALLDEF(IRCALLNAME) -#undef IRCALLNAME - NULL -}; - -static const char *const trace_errors[] = { -#define TREDEF(name, msg) msg, -#include "lj_traceerr.h" - NULL -}; - -static const char *lower(char *buf, const char *s) -{ - char *p = buf; - while (*s) { - *p++ = (*s >= 'A' && *s <= 'Z') ? *s+0x20 : *s; - s++; - } - *p = '\0'; - return buf; -} - -/* Emit C source code for bytecode-related definitions. */ -static void emit_bcdef(BuildCtx *ctx) -{ - int i; - fprintf(ctx->fp, "/* This is a generated file. DO NOT EDIT! */\n\n"); - fprintf(ctx->fp, "LJ_DATADEF const uint16_t lj_bc_ofs[] = {\n"); - for (i = 0; i < ctx->npc; i++) { - if (i != 0) - fprintf(ctx->fp, ",\n"); - fprintf(ctx->fp, "%d", ctx->bc_ofs[i]); - } -} - -/* Emit VM definitions as Lua code for debug modules. */ -static void emit_vmdef(BuildCtx *ctx) -{ - char buf[80]; - int i; - fprintf(ctx->fp, "-- This is a generated file. DO NOT EDIT!\n\n"); - fprintf(ctx->fp, "module(...)\n\n"); - - fprintf(ctx->fp, "bcnames = \""); - for (i = 0; bc_names[i]; i++) fprintf(ctx->fp, "%-6s", bc_names[i]); - fprintf(ctx->fp, "\"\n\n"); - - fprintf(ctx->fp, "irnames = \""); - for (i = 0; ir_names[i]; i++) fprintf(ctx->fp, "%-6s", ir_names[i]); - fprintf(ctx->fp, "\"\n\n"); - - fprintf(ctx->fp, "irfpm = { [0]="); - for (i = 0; irfpm_names[i]; i++) - fprintf(ctx->fp, "\"%s\", ", lower(buf, irfpm_names[i])); - fprintf(ctx->fp, "}\n\n"); - - fprintf(ctx->fp, "irfield = { [0]="); - for (i = 0; irfield_names[i]; i++) { - char *p; - lower(buf, irfield_names[i]); - p = strchr(buf, '_'); - if (p) *p = '.'; - fprintf(ctx->fp, "\"%s\", ", buf); - } - fprintf(ctx->fp, "}\n\n"); - - fprintf(ctx->fp, "ircall = {\n[0]="); - for (i = 0; ircall_names[i]; i++) - fprintf(ctx->fp, "\"%s\",\n", ircall_names[i]); - fprintf(ctx->fp, "}\n\n"); - - fprintf(ctx->fp, "traceerr = {\n[0]="); - for (i = 0; trace_errors[i]; i++) - fprintf(ctx->fp, "\"%s\",\n", trace_errors[i]); - fprintf(ctx->fp, "}\n\n"); -} - -/* -- Argument parsing ---------------------------------------------------- */ - -/* Build mode names. */ -static const char *const modenames[] = { -#define BUILDNAME(name) #name, -BUILDDEF(BUILDNAME) -#undef BUILDNAME - NULL -}; - -/* Print usage information and exit. */ -static void usage(void) -{ - int i; - fprintf(stderr, LUAJIT_VERSION " VM builder.\n"); - fprintf(stderr, LUAJIT_COPYRIGHT ", " LUAJIT_URL "\n"); - fprintf(stderr, "Target architecture: " LJ_ARCH_NAME "\n\n"); - fprintf(stderr, "Usage: buildvm -m mode [-o outfile] [infiles...]\n\n"); - fprintf(stderr, "Available modes:\n"); - for (i = 0; i < BUILD__MAX; i++) - fprintf(stderr, " %s\n", modenames[i]); - exit(1); -} - -/* Parse the output mode name. */ -static BuildMode parsemode(const char *mode) -{ - int i; - for (i = 0; modenames[i]; i++) - if (!strcmp(mode, modenames[i])) - return (BuildMode)i; - usage(); - return (BuildMode)-1; -} - -/* Parse arguments. */ -static void parseargs(BuildCtx *ctx, char **argv) -{ - const char *a; - int i; - ctx->mode = (BuildMode)-1; - ctx->outname = "-"; - for (i = 1; (a = argv[i]) != NULL; i++) { - if (a[0] != '-') - break; - switch (a[1]) { - case '-': - if (a[2]) goto err; - i++; - goto ok; - case '\0': - goto ok; - case 'm': - i++; - if (a[2] || argv[i] == NULL) goto err; - ctx->mode = parsemode(argv[i]); - break; - case 'o': - i++; - if (a[2] || argv[i] == NULL) goto err; - ctx->outname = argv[i]; - break; - default: err: - usage(); - break; - } - } -ok: - ctx->args = argv+i; - if (ctx->mode == (BuildMode)-1) goto err; -} - -int main(int argc, char **argv) -{ - BuildCtx ctx_; - BuildCtx *ctx = &ctx_; - int status, binmode; - - if (sizeof(void *) != 4*LJ_32+8*LJ_64) { - fprintf(stderr,"Error: pointer size mismatch in cross-build.\n"); - fprintf(stderr,"Try: make HOST_CC=\"gcc -m32\" CROSS=...\n\n"); - return 1; - } - - UNUSED(argc); - parseargs(ctx, argv); - - if ((status = build_code(ctx))) { - fprintf(stderr,"Error: DASM error %08x\n", status); - return 1; - } - - switch (ctx->mode) { - case BUILD_peobj: - case BUILD_raw: - binmode = 1; - break; - default: - binmode = 0; - break; - } - - if (ctx->outname[0] == '-' && ctx->outname[1] == '\0') { - ctx->fp = stdout; -#if defined(_WIN32) - if (binmode) - _setmode(_fileno(stdout), _O_BINARY); /* Yuck. */ -#endif - } else if (!(ctx->fp = fopen(ctx->outname, binmode ? "wb" : "w"))) { - fprintf(stderr, "Error: cannot open output file '%s': %s\n", - ctx->outname, strerror(errno)); - exit(1); - } - - switch (ctx->mode) { - case BUILD_elfasm: - case BUILD_coffasm: - case BUILD_machasm: - emit_asm(ctx); - emit_asm_debug(ctx); - break; - case BUILD_peobj: - emit_peobj(ctx); - break; - case BUILD_raw: - emit_raw(ctx); - break; - case BUILD_bcdef: - emit_bcdef(ctx); - emit_lib(ctx); - break; - case BUILD_vmdef: - emit_vmdef(ctx); - emit_lib(ctx); - break; - case BUILD_ffdef: - case BUILD_libdef: - case BUILD_recdef: - emit_lib(ctx); - break; - case BUILD_folddef: - emit_fold(ctx); - break; - default: - break; - } - - fflush(ctx->fp); - if (ferror(ctx->fp)) { - fprintf(stderr, "Error: cannot write to output file: %s\n", - strerror(errno)); - exit(1); - } - fclose(ctx->fp); - - return 0; -} - diff --git a/subprojects/luajit/src/host/buildvm.h b/subprojects/luajit/src/host/buildvm.h deleted file mode 100644 index e6dd3dcbe..000000000 --- a/subprojects/luajit/src/host/buildvm.h +++ /dev/null @@ -1,104 +0,0 @@ -/* -** LuaJIT VM builder. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _BUILDVM_H -#define _BUILDVM_H - -#include -#include -#include -#include -#include - -#include "lj_def.h" -#include "lj_arch.h" - -/* Hardcoded limits. Increase as needed. */ -#define BUILD_MAX_RELOC 200 /* Max. number of relocations. */ -#define BUILD_MAX_FOLD 4096 /* Max. number of fold rules. */ - -/* Prefix for scanned library definitions. */ -#define LIBDEF_PREFIX "LJLIB_" - -/* Prefix for scanned fold definitions. */ -#define FOLDDEF_PREFIX "LJFOLD" - -/* Prefixes for generated labels. */ -#define LABEL_PREFIX "lj_" -#define LABEL_PREFIX_BC LABEL_PREFIX "BC_" -#define LABEL_PREFIX_FF LABEL_PREFIX "ff_" -#define LABEL_PREFIX_CF LABEL_PREFIX "cf_" -#define LABEL_PREFIX_FFH LABEL_PREFIX "ffh_" -#define LABEL_PREFIX_LIBCF LABEL_PREFIX "lib_cf_" -#define LABEL_PREFIX_LIBINIT LABEL_PREFIX "lib_init_" - -/* Forward declaration. */ -struct dasm_State; - -/* Build modes. */ -#define BUILDDEF(_) \ - _(elfasm) _(coffasm) _(machasm) _(peobj) _(raw) \ - _(bcdef) _(ffdef) _(libdef) _(recdef) _(vmdef) \ - _(folddef) - -typedef enum { -#define BUILDENUM(name) BUILD_##name, -BUILDDEF(BUILDENUM) -#undef BUILDENUM - BUILD__MAX -} BuildMode; - -/* Code relocation. */ -typedef struct BuildReloc { - int32_t ofs; - int sym; - int type; -} BuildReloc; - -typedef struct BuildSym { - const char *name; - int32_t ofs; -} BuildSym; - -/* Build context structure. */ -typedef struct BuildCtx { - /* DynASM state pointer. Should be first member. */ - struct dasm_State *D; - /* Parsed command line. */ - BuildMode mode; - FILE *fp; - const char *outname; - char **args; - /* Code and symbols generated by DynASM. */ - uint8_t *code; - size_t codesz; - int npc, nglob, nsym, nreloc, nrelocsym; - void **glob; - BuildSym *sym; - const char **relocsym; - int32_t *bc_ofs; - const char *beginsym; - /* Strings generated by DynASM. */ - const char *const *globnames; - const char *dasm_ident; - const char *dasm_arch; - /* Relocations. */ - BuildReloc reloc[BUILD_MAX_RELOC]; -} BuildCtx; - -extern void owrite(BuildCtx *ctx, const void *ptr, size_t sz); -extern void emit_asm(BuildCtx *ctx); -extern void emit_peobj(BuildCtx *ctx); -extern void emit_lib(BuildCtx *ctx); -extern void emit_fold(BuildCtx *ctx); - -extern const char *const bc_names[]; -extern const char *const ir_names[]; -extern const char *const irt_names[]; -extern const char *const irfpm_names[]; -extern const char *const irfield_names[]; -extern const char *const ircall_names[]; - -#endif diff --git a/subprojects/luajit/src/host/buildvm_asm.c b/subprojects/luajit/src/host/buildvm_asm.c deleted file mode 100644 index 81a3969a1..000000000 --- a/subprojects/luajit/src/host/buildvm_asm.c +++ /dev/null @@ -1,314 +0,0 @@ -/* -** LuaJIT VM builder: Assembler source code emitter. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include "buildvm.h" -#include "lj_bc.h" - -/* ------------------------------------------------------------------------ */ - -#if LJ_TARGET_X86ORX64 -/* Emit bytes piecewise as assembler text. */ -static void emit_asm_bytes(BuildCtx *ctx, uint8_t *p, int n) -{ - int i; - for (i = 0; i < n; i++) { - if ((i & 15) == 0) - fprintf(ctx->fp, "\t.byte %d", p[i]); - else - fprintf(ctx->fp, ",%d", p[i]); - if ((i & 15) == 15) putc('\n', ctx->fp); - } - if ((n & 15) != 0) putc('\n', ctx->fp); -} - -/* Emit relocation */ -static void emit_asm_reloc(BuildCtx *ctx, int type, const char *sym) -{ - switch (ctx->mode) { - case BUILD_elfasm: - if (type) - fprintf(ctx->fp, "\t.long %s-.-4\n", sym); - else - fprintf(ctx->fp, "\t.long %s\n", sym); - break; - case BUILD_coffasm: - fprintf(ctx->fp, "\t.def %s; .scl 3; .type 32; .endef\n", sym); - if (type) - fprintf(ctx->fp, "\t.long %s-.-4\n", sym); - else - fprintf(ctx->fp, "\t.long %s\n", sym); - break; - default: /* BUILD_machasm for relative relocations handled below. */ - fprintf(ctx->fp, "\t.long %s\n", sym); - break; - } -} - -static const char *const jccnames[] = { - "jo", "jno", "jb", "jnb", "jz", "jnz", "jbe", "ja", - "js", "jns", "jpe", "jpo", "jl", "jge", "jle", "jg" -}; - -/* Emit relocation for the incredibly stupid OSX assembler. */ -static void emit_asm_reloc_mach(BuildCtx *ctx, uint8_t *cp, int n, - const char *sym) -{ - const char *opname = NULL; - if (--n < 0) goto err; - if (cp[n] == 0xe8) { - opname = "call"; - } else if (cp[n] == 0xe9) { - opname = "jmp"; - } else if (cp[n] >= 0x80 && cp[n] <= 0x8f && n > 0 && cp[n-1] == 0x0f) { - opname = jccnames[cp[n]-0x80]; - n--; - } else { -err: - fprintf(stderr, "Error: unsupported opcode for %s symbol relocation.\n", - sym); - exit(1); - } - emit_asm_bytes(ctx, cp, n); - fprintf(ctx->fp, "\t%s %s\n", opname, sym); -} -#else -/* Emit words piecewise as assembler text. */ -static void emit_asm_words(BuildCtx *ctx, uint8_t *p, int n) -{ - int i; - for (i = 0; i < n; i += 4) { - if ((i & 15) == 0) - fprintf(ctx->fp, "\t.long 0x%08x", *(uint32_t *)(p+i)); - else - fprintf(ctx->fp, ",0x%08x", *(uint32_t *)(p+i)); - if ((i & 15) == 12) putc('\n', ctx->fp); - } - if ((n & 15) != 0) putc('\n', ctx->fp); -} - -/* Emit relocation as part of an instruction. */ -static void emit_asm_wordreloc(BuildCtx *ctx, uint8_t *p, int n, - const char *sym) -{ - uint32_t ins; - emit_asm_words(ctx, p, n-4); - ins = *(uint32_t *)(p+n-4); -#if LJ_TARGET_ARM - if ((ins & 0xff000000u) == 0xfa000000u) { - fprintf(ctx->fp, "\tblx %s\n", sym); - } else if ((ins & 0x0e000000u) == 0x0a000000u) { - fprintf(ctx->fp, "\t%s%.2s %s\n", (ins & 0x01000000u) ? "bl" : "b", - &"eqnecsccmiplvsvchilsgeltgtle"[2*(ins >> 28)], sym); - } else { - fprintf(stderr, - "Error: unsupported opcode %08x for %s symbol relocation.\n", - ins, sym); - exit(1); - } -#elif LJ_TARGET_PPC || LJ_TARGET_PPCSPE -#if LJ_TARGET_PS3 -#define TOCPREFIX "." -#else -#define TOCPREFIX "" -#endif - if ((ins >> 26) == 16) { - fprintf(ctx->fp, "\t%s %d, %d, " TOCPREFIX "%s\n", - (ins & 1) ? "bcl" : "bc", (ins >> 21) & 31, (ins >> 16) & 31, sym); - } else if ((ins >> 26) == 18) { - fprintf(ctx->fp, "\t%s " TOCPREFIX "%s\n", (ins & 1) ? "bl" : "b", sym); - } else { - fprintf(stderr, - "Error: unsupported opcode %08x for %s symbol relocation.\n", - ins, sym); - exit(1); - } -#elif LJ_TARGET_MIPS - fprintf(stderr, - "Error: unsupported opcode %08x for %s symbol relocation.\n", - ins, sym); - exit(1); -#else -#error "missing relocation support for this architecture" -#endif -} -#endif - -#if LJ_TARGET_ARM -#define ELFASM_PX "%%" -#else -#define ELFASM_PX "@" -#endif - -/* Emit an assembler label. */ -static void emit_asm_label(BuildCtx *ctx, const char *name, int size, int isfunc) -{ - switch (ctx->mode) { - case BUILD_elfasm: -#if LJ_TARGET_PS3 - if (!strncmp(name, "lj_vm_", 6) && - strcmp(name, ctx->beginsym) && - !strstr(name, "hook")) { - fprintf(ctx->fp, - "\n\t.globl %s\n" - "\t.section \".opd\",\"aw\"\n" - "%s:\n" - "\t.long .%s,.TOC.@tocbase32\n" - "\t.size %s,8\n" - "\t.previous\n" - "\t.globl .%s\n" - "\t.hidden .%s\n" - "\t.type .%s, " ELFASM_PX "function\n" - "\t.size .%s, %d\n" - ".%s:\n", - name, name, name, name, name, name, name, name, size, name); - break; - } -#endif - fprintf(ctx->fp, - "\n\t.globl %s\n" - "\t.hidden %s\n" - "\t.type %s, " ELFASM_PX "%s\n" - "\t.size %s, %d\n" - "%s:\n", - name, name, name, isfunc ? "function" : "object", name, size, name); - break; - case BUILD_coffasm: - fprintf(ctx->fp, "\n\t.globl %s\n", name); - if (isfunc) - fprintf(ctx->fp, "\t.def %s; .scl 3; .type 32; .endef\n", name); - fprintf(ctx->fp, "%s:\n", name); - break; - case BUILD_machasm: - fprintf(ctx->fp, - "\n\t.private_extern %s\n" - "\t.no_dead_strip %s\n" - "%s:\n", name, name, name); - break; - default: - break; - } -} - -/* Emit alignment. */ -static void emit_asm_align(BuildCtx *ctx, int bits) -{ - switch (ctx->mode) { - case BUILD_elfasm: - case BUILD_coffasm: - fprintf(ctx->fp, "\t.p2align %d\n", bits); - break; - case BUILD_machasm: - fprintf(ctx->fp, "\t.align %d\n", bits); - break; - default: - break; - } -} - -/* ------------------------------------------------------------------------ */ - -/* Emit assembler source code. */ -void emit_asm(BuildCtx *ctx) -{ - int i, rel; - - fprintf(ctx->fp, "\t.file \"buildvm_%s.dasc\"\n", ctx->dasm_arch); - fprintf(ctx->fp, "\t.text\n"); - emit_asm_align(ctx, 4); - -#if LJ_TARGET_PS3 - emit_asm_label(ctx, ctx->beginsym, ctx->codesz, 0); -#else - emit_asm_label(ctx, ctx->beginsym, 0, 0); -#endif - if (ctx->mode != BUILD_machasm) - fprintf(ctx->fp, ".Lbegin:\n"); - -#if LJ_TARGET_ARM && defined(__GNUC__) && !LJ_NO_UNWIND - /* This should really be moved into buildvm_arm.dasc. */ - fprintf(ctx->fp, - ".fnstart\n" - ".save {r4, r5, r6, r7, r8, r9, r10, r11, lr}\n" - ".pad #28\n"); -#endif -#if LJ_TARGET_MIPS - fprintf(ctx->fp, ".set nomips16\n.abicalls\n.set noreorder\n.set nomacro\n"); -#endif - - for (i = rel = 0; i < ctx->nsym; i++) { - int32_t ofs = ctx->sym[i].ofs; - int32_t next = ctx->sym[i+1].ofs; -#if LJ_TARGET_ARM && defined(__GNUC__) && !LJ_NO_UNWIND && LJ_HASFFI - if (!strcmp(ctx->sym[i].name, "lj_vm_ffi_call")) - fprintf(ctx->fp, - ".globl lj_err_unwind_arm\n" - ".personality lj_err_unwind_arm\n" - ".fnend\n" - ".fnstart\n" - ".save {r4, r5, r11, lr}\n" - ".setfp r11, sp\n"); -#endif - emit_asm_label(ctx, ctx->sym[i].name, next - ofs, 1); - while (rel < ctx->nreloc && ctx->reloc[rel].ofs <= next) { - BuildReloc *r = &ctx->reloc[rel]; - int n = r->ofs - ofs; -#if LJ_TARGET_X86ORX64 - if (ctx->mode == BUILD_machasm && r->type != 0) { - emit_asm_reloc_mach(ctx, ctx->code+ofs, n, ctx->relocsym[r->sym]); - } else { - emit_asm_bytes(ctx, ctx->code+ofs, n); - emit_asm_reloc(ctx, r->type, ctx->relocsym[r->sym]); - } - ofs += n+4; -#else - emit_asm_wordreloc(ctx, ctx->code+ofs, n, ctx->relocsym[r->sym]); - ofs += n; -#endif - rel++; - } -#if LJ_TARGET_X86ORX64 - emit_asm_bytes(ctx, ctx->code+ofs, next-ofs); -#else - emit_asm_words(ctx, ctx->code+ofs, next-ofs); -#endif - } - -#if LJ_TARGET_ARM && defined(__GNUC__) && !LJ_NO_UNWIND - fprintf(ctx->fp, -#if !LJ_HASFFI - ".globl lj_err_unwind_arm\n" - ".personality lj_err_unwind_arm\n" -#endif - ".fnend\n"); -#endif - - fprintf(ctx->fp, "\n"); - switch (ctx->mode) { - case BUILD_elfasm: -#if !(LJ_TARGET_PS3 || LJ_TARGET_PSVITA) - fprintf(ctx->fp, "\t.section .note.GNU-stack,\"\"," ELFASM_PX "progbits\n"); -#endif -#if LJ_TARGET_PPCSPE - /* Soft-float ABI + SPE. */ - fprintf(ctx->fp, "\t.gnu_attribute 4, 2\n\t.gnu_attribute 8, 3\n"); -#elif LJ_TARGET_PPC && !LJ_TARGET_PS3 - /* Hard-float ABI. */ - fprintf(ctx->fp, "\t.gnu_attribute 4, 1\n"); -#endif - /* fallthrough */ - case BUILD_coffasm: - fprintf(ctx->fp, "\t.ident \"%s\"\n", ctx->dasm_ident); - break; - case BUILD_machasm: - fprintf(ctx->fp, - "\t.cstring\n" - "\t.ascii \"%s\\0\"\n", ctx->dasm_ident); - break; - default: - break; - } - fprintf(ctx->fp, "\n"); -} - diff --git a/subprojects/luajit/src/host/buildvm_fold.c b/subprojects/luajit/src/host/buildvm_fold.c deleted file mode 100644 index d579f4d41..000000000 --- a/subprojects/luajit/src/host/buildvm_fold.c +++ /dev/null @@ -1,229 +0,0 @@ -/* -** LuaJIT VM builder: IR folding hash table generator. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include "buildvm.h" -#include "lj_obj.h" -#include "lj_ir.h" - -/* Context for the folding hash table generator. */ -static int lineno; -static uint32_t funcidx; -static uint32_t foldkeys[BUILD_MAX_FOLD]; -static uint32_t nkeys; - -/* Try to fill the hash table with keys using the hash parameters. */ -static int tryhash(uint32_t *htab, uint32_t sz, uint32_t r, int dorol) -{ - uint32_t i; - if (dorol && ((r & 31) == 0 || (r>>5) == 0)) - return 0; /* Avoid zero rotates. */ - memset(htab, 0xff, (sz+1)*sizeof(uint32_t)); - for (i = 0; i < nkeys; i++) { - uint32_t key = foldkeys[i]; - uint32_t k = key & 0xffffff; - uint32_t h = (dorol ? lj_rol(lj_rol(k, r>>5) - k, r&31) : - (((k << (r>>5)) - k) << (r&31))) % sz; - if (htab[h] != 0xffffffff) { /* Collision on primary slot. */ - if (htab[h+1] != 0xffffffff) { /* Collision on secondary slot. */ - /* Try to move the colliding key, if possible. */ - if (h < sz-1 && htab[h+2] == 0xffffffff) { - uint32_t k2 = htab[h+1] & 0xffffff; - uint32_t h2 = (dorol ? lj_rol(lj_rol(k2, r>>5) - k2, r&31) : - (((k2 << (r>>5)) - k2) << (r&31))) % sz; - if (h2 != h+1) return 0; /* Cannot resolve collision. */ - htab[h+2] = htab[h+1]; /* Move colliding key to secondary slot. */ - } else { - return 0; /* Collision. */ - } - } - htab[h+1] = key; - } else { - htab[h] = key; - } - } - return 1; /* Success, all keys could be stored. */ -} - -/* Print the generated hash table. */ -static void printhash(BuildCtx *ctx, uint32_t *htab, uint32_t sz) -{ - uint32_t i; - fprintf(ctx->fp, "static const uint32_t fold_hash[%d] = {\n0x%08x", - sz+1, htab[0]); - for (i = 1; i < sz+1; i++) - fprintf(ctx->fp, ",\n0x%08x", htab[i]); - fprintf(ctx->fp, "\n};\n\n"); -} - -/* Exhaustive search for the shortest semi-perfect hash table. */ -static void makehash(BuildCtx *ctx) -{ - uint32_t htab[BUILD_MAX_FOLD*2+1]; - uint32_t sz, r; - /* Search for the smallest hash table with an odd size. */ - for (sz = (nkeys|1); sz < BUILD_MAX_FOLD*2; sz += 2) { - /* First try all shift hash combinations. */ - for (r = 0; r < 32*32; r++) { - if (tryhash(htab, sz, r, 0)) { - printhash(ctx, htab, sz); - fprintf(ctx->fp, - "#define fold_hashkey(k)\t(((((k)<<%u)-(k))<<%u)%%%u)\n\n", - r>>5, r&31, sz); - return; - } - } - /* Then try all rotate hash combinations. */ - for (r = 0; r < 32*32; r++) { - if (tryhash(htab, sz, r, 1)) { - printhash(ctx, htab, sz); - fprintf(ctx->fp, - "#define fold_hashkey(k)\t(lj_rol(lj_rol((k),%u)-(k),%u)%%%u)\n\n", - r>>5, r&31, sz); - return; - } - } - } - fprintf(stderr, "Error: search for perfect hash failed\n"); - exit(1); -} - -/* Parse one token of a fold rule. */ -static uint32_t nexttoken(char **pp, int allowlit, int allowany) -{ - char *p = *pp; - if (p) { - uint32_t i; - char *q = strchr(p, ' '); - if (q) *q++ = '\0'; - *pp = q; - if (allowlit && !strncmp(p, "IRFPM_", 6)) { - for (i = 0; irfpm_names[i]; i++) - if (!strcmp(irfpm_names[i], p+6)) - return i; - } else if (allowlit && !strncmp(p, "IRFL_", 5)) { - for (i = 0; irfield_names[i]; i++) - if (!strcmp(irfield_names[i], p+5)) - return i; - } else if (allowlit && !strncmp(p, "IRCALL_", 7)) { - for (i = 0; ircall_names[i]; i++) - if (!strcmp(ircall_names[i], p+7)) - return i; - } else if (allowlit && !strncmp(p, "IRCONV_", 7)) { - for (i = 0; irt_names[i]; i++) { - const char *r = strchr(p+7, '_'); - if (r && !strncmp(irt_names[i], p+7, r-(p+7))) { - uint32_t j; - for (j = 0; irt_names[j]; j++) - if (!strcmp(irt_names[j], r+1)) - return (i << 5) + j; - } - } - } else if (allowlit && *p >= '0' && *p <= '9') { - for (i = 0; *p >= '0' && *p <= '9'; p++) - i = i*10 + (*p - '0'); - if (*p == '\0') - return i; - } else if (allowany && !strcmp("any", p)) { - return allowany; - } else { - for (i = 0; ir_names[i]; i++) - if (!strcmp(ir_names[i], p)) - return i; - } - fprintf(stderr, "Error: bad fold definition token \"%s\" at line %d\n", p, lineno); - exit(1); - } - return 0; -} - -/* Parse a fold rule. */ -static void foldrule(char *p) -{ - uint32_t op = nexttoken(&p, 0, 0); - uint32_t left = nexttoken(&p, 0, 0x7f); - uint32_t right = nexttoken(&p, 1, 0x3ff); - uint32_t key = (funcidx << 24) | (op << 17) | (left << 10) | right; - uint32_t i; - if (nkeys >= BUILD_MAX_FOLD) { - fprintf(stderr, "Error: too many fold rules, increase BUILD_MAX_FOLD.\n"); - exit(1); - } - /* Simple insertion sort to detect duplicates. */ - for (i = nkeys; i > 0; i--) { - if ((foldkeys[i-1]&0xffffff) < (key & 0xffffff)) - break; - if ((foldkeys[i-1]&0xffffff) == (key & 0xffffff)) { - fprintf(stderr, "Error: duplicate fold definition at line %d\n", lineno); - exit(1); - } - foldkeys[i] = foldkeys[i-1]; - } - foldkeys[i] = key; - nkeys++; -} - -/* Emit C source code for IR folding hash table. */ -void emit_fold(BuildCtx *ctx) -{ - char buf[256]; /* We don't care about analyzing lines longer than that. */ - const char *fname = ctx->args[0]; - FILE *fp; - - if (fname == NULL) { - fprintf(stderr, "Error: missing input filename\n"); - exit(1); - } - - if (fname[0] == '-' && fname[1] == '\0') { - fp = stdin; - } else { - fp = fopen(fname, "r"); - if (!fp) { - fprintf(stderr, "Error: cannot open input file '%s': %s\n", - fname, strerror(errno)); - exit(1); - } - } - - fprintf(ctx->fp, "/* This is a generated file. DO NOT EDIT! */\n\n"); - fprintf(ctx->fp, "static const FoldFunc fold_func[] = {\n"); - - lineno = 0; - funcidx = 0; - nkeys = 0; - while (fgets(buf, sizeof(buf), fp) != NULL) { - lineno++; - /* The prefix must be at the start of a line, otherwise it's ignored. */ - if (!strncmp(buf, FOLDDEF_PREFIX, sizeof(FOLDDEF_PREFIX)-1)) { - char *p = buf+sizeof(FOLDDEF_PREFIX)-1; - char *q = strchr(p, ')'); - if (p[0] == '(' && q) { - p++; - *q = '\0'; - foldrule(p); - } else if ((p[0] == 'F' || p[0] == 'X') && p[1] == '(' && q) { - p += 2; - *q = '\0'; - if (funcidx) - fprintf(ctx->fp, ",\n"); - if (p[-2] == 'X') - fprintf(ctx->fp, " %s", p); - else - fprintf(ctx->fp, " fold_%s", p); - funcidx++; - } else { - buf[strlen(buf)-1] = '\0'; - fprintf(stderr, "Error: unknown fold definition tag %s%s at line %d\n", - FOLDDEF_PREFIX, p, lineno); - exit(1); - } - } - } - fclose(fp); - fprintf(ctx->fp, "\n};\n\n"); - - makehash(ctx); -} - diff --git a/subprojects/luajit/src/host/buildvm_lib.c b/subprojects/luajit/src/host/buildvm_lib.c deleted file mode 100644 index 569e2cafd..000000000 --- a/subprojects/luajit/src/host/buildvm_lib.c +++ /dev/null @@ -1,398 +0,0 @@ -/* -** LuaJIT VM builder: library definition compiler. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include "buildvm.h" -#include "lj_obj.h" -#include "lj_lib.h" - -/* Context for library definitions. */ -static uint8_t obuf[8192]; -static uint8_t *optr; -static char modname[80]; -static size_t modnamelen; -static char funcname[80]; -static int modstate, regfunc; -static int ffid, recffid, ffasmfunc; - -enum { - REGFUNC_OK, - REGFUNC_NOREG, - REGFUNC_NOREGUV -}; - -static void libdef_name(const char *p, int kind) -{ - size_t n = strlen(p); - if (kind != LIBINIT_STRING) { - if (n > modnamelen && p[modnamelen] == '_' && - !strncmp(p, modname, modnamelen)) { - p += modnamelen+1; - n -= modnamelen+1; - } - } - if (n > LIBINIT_MAXSTR) { - fprintf(stderr, "Error: string too long: '%s'\n", p); - exit(1); - } - if (optr+1+n+2 > obuf+sizeof(obuf)) { /* +2 for caller. */ - fprintf(stderr, "Error: output buffer overflow\n"); - exit(1); - } - *optr++ = (uint8_t)(n | kind); - memcpy(optr, p, n); - optr += n; -} - -static void libdef_endmodule(BuildCtx *ctx) -{ - if (modstate != 0) { - char line[80]; - const uint8_t *p; - int n; - if (modstate == 1) - fprintf(ctx->fp, " (lua_CFunction)0"); - fprintf(ctx->fp, "\n};\n"); - fprintf(ctx->fp, "static const uint8_t %s%s[] = {\n", - LABEL_PREFIX_LIBINIT, modname); - line[0] = '\0'; - for (n = 0, p = obuf; p < optr; p++) { - n += sprintf(line+n, "%d,", *p); - if (n >= 75) { - fprintf(ctx->fp, "%s\n", line); - n = 0; - line[0] = '\0'; - } - } - fprintf(ctx->fp, "%s%d\n};\n#endif\n\n", line, LIBINIT_END); - } -} - -static void libdef_module(BuildCtx *ctx, char *p, int arg) -{ - UNUSED(arg); - if (ctx->mode == BUILD_libdef) { - libdef_endmodule(ctx); - optr = obuf; - *optr++ = (uint8_t)ffid; - *optr++ = (uint8_t)ffasmfunc; - *optr++ = 0; /* Hash table size. */ - modstate = 1; - fprintf(ctx->fp, "#ifdef %sMODULE_%s\n", LIBDEF_PREFIX, p); - fprintf(ctx->fp, "#undef %sMODULE_%s\n", LIBDEF_PREFIX, p); - fprintf(ctx->fp, "static const lua_CFunction %s%s[] = {\n", - LABEL_PREFIX_LIBCF, p); - } - modnamelen = strlen(p); - if (modnamelen > sizeof(modname)-1) { - fprintf(stderr, "Error: module name too long: '%s'\n", p); - exit(1); - } - strcpy(modname, p); -} - -static int find_ffofs(BuildCtx *ctx, const char *name) -{ - int i; - for (i = 0; i < ctx->nglob; i++) { - const char *gl = ctx->globnames[i]; - if (gl[0] == 'f' && gl[1] == 'f' && gl[2] == '_' && !strcmp(gl+3, name)) { - return (int)((uint8_t *)ctx->glob[i] - ctx->code); - } - } - fprintf(stderr, "Error: undefined fast function %s%s\n", - LABEL_PREFIX_FF, name); - exit(1); -} - -static void libdef_func(BuildCtx *ctx, char *p, int arg) -{ - if (arg != LIBINIT_CF) - ffasmfunc++; - if (ctx->mode == BUILD_libdef) { - if (modstate == 0) { - fprintf(stderr, "Error: no module for function definition %s\n", p); - exit(1); - } - if (regfunc == REGFUNC_NOREG) { - if (optr+1 > obuf+sizeof(obuf)) { - fprintf(stderr, "Error: output buffer overflow\n"); - exit(1); - } - *optr++ = LIBINIT_FFID; - } else { - if (arg != LIBINIT_ASM_) { - if (modstate != 1) fprintf(ctx->fp, ",\n"); - modstate = 2; - fprintf(ctx->fp, " %s%s", arg ? LABEL_PREFIX_FFH : LABEL_PREFIX_CF, p); - } - if (regfunc != REGFUNC_NOREGUV) obuf[2]++; /* Bump hash table size. */ - libdef_name(regfunc == REGFUNC_NOREGUV ? "" : p, arg); - } - } else if (ctx->mode == BUILD_ffdef) { - fprintf(ctx->fp, "FFDEF(%s)\n", p); - } else if (ctx->mode == BUILD_recdef) { - if (strlen(p) > sizeof(funcname)-1) { - fprintf(stderr, "Error: function name too long: '%s'\n", p); - exit(1); - } - strcpy(funcname, p); - } else if (ctx->mode == BUILD_vmdef) { - int i; - for (i = 1; p[i] && modname[i-1]; i++) - if (p[i] == '_') p[i] = '.'; - fprintf(ctx->fp, "\"%s\",\n", p); - } else if (ctx->mode == BUILD_bcdef) { - if (arg != LIBINIT_CF) - fprintf(ctx->fp, ",\n%d", find_ffofs(ctx, p)); - } - ffid++; - regfunc = REGFUNC_OK; -} - -static uint32_t find_rec(char *name) -{ - char *p = (char *)obuf; - uint32_t n; - for (n = 2; *p; n++) { - if (strcmp(p, name) == 0) - return n; - p += strlen(p)+1; - } - if (p+strlen(name)+1 >= (char *)obuf+sizeof(obuf)) { - fprintf(stderr, "Error: output buffer overflow\n"); - exit(1); - } - strcpy(p, name); - return n; -} - -static void libdef_rec(BuildCtx *ctx, char *p, int arg) -{ - UNUSED(arg); - if (ctx->mode == BUILD_recdef) { - char *q; - uint32_t n; - for (; recffid+1 < ffid; recffid++) - fprintf(ctx->fp, ",\n0"); - recffid = ffid; - if (*p == '.') p = funcname; - q = strchr(p, ' '); - if (q) *q++ = '\0'; - n = find_rec(p); - if (q) - fprintf(ctx->fp, ",\n0x%02x00+(%s)", n, q); - else - fprintf(ctx->fp, ",\n0x%02x00", n); - } -} - -static void memcpy_endian(void *dst, void *src, size_t n) -{ - union { uint8_t b; uint32_t u; } host_endian; - host_endian.u = 1; - if (host_endian.b == LJ_ENDIAN_SELECT(1, 0)) { - memcpy(dst, src, n); - } else { - size_t i; - for (i = 0; i < n; i++) - ((uint8_t *)dst)[i] = ((uint8_t *)src)[n-i-1]; - } -} - -static void libdef_push(BuildCtx *ctx, char *p, int arg) -{ - UNUSED(arg); - if (ctx->mode == BUILD_libdef) { - int len = (int)strlen(p); - if (*p == '"') { - if (len > 1 && p[len-1] == '"') { - p[len-1] = '\0'; - libdef_name(p+1, LIBINIT_STRING); - return; - } - } else if (*p >= '0' && *p <= '9') { - char *ep; - double d = strtod(p, &ep); - if (*ep == '\0') { - if (optr+1+sizeof(double) > obuf+sizeof(obuf)) { - fprintf(stderr, "Error: output buffer overflow\n"); - exit(1); - } - *optr++ = LIBINIT_NUMBER; - memcpy_endian(optr, &d, sizeof(double)); - optr += sizeof(double); - return; - } - } else if (!strcmp(p, "lastcl")) { - if (optr+1 > obuf+sizeof(obuf)) { - fprintf(stderr, "Error: output buffer overflow\n"); - exit(1); - } - *optr++ = LIBINIT_LASTCL; - return; - } else if (len > 4 && !strncmp(p, "top-", 4)) { - if (optr+2 > obuf+sizeof(obuf)) { - fprintf(stderr, "Error: output buffer overflow\n"); - exit(1); - } - *optr++ = LIBINIT_COPY; - *optr++ = (uint8_t)atoi(p+4); - return; - } - fprintf(stderr, "Error: bad value for %sPUSH(%s)\n", LIBDEF_PREFIX, p); - exit(1); - } -} - -static void libdef_set(BuildCtx *ctx, char *p, int arg) -{ - UNUSED(arg); - if (ctx->mode == BUILD_libdef) { - if (p[0] == '!' && p[1] == '\0') p[0] = '\0'; /* Set env. */ - libdef_name(p, LIBINIT_STRING); - *optr++ = LIBINIT_SET; - obuf[2]++; /* Bump hash table size. */ - } -} - -static void libdef_regfunc(BuildCtx *ctx, char *p, int arg) -{ - UNUSED(ctx); UNUSED(p); - regfunc = arg; -} - -typedef void (*LibDefFunc)(BuildCtx *ctx, char *p, int arg); - -typedef struct LibDefHandler { - const char *suffix; - const char *stop; - const LibDefFunc func; - const int arg; -} LibDefHandler; - -static const LibDefHandler libdef_handlers[] = { - { "MODULE_", " \t\r\n", libdef_module, 0 }, - { "CF(", ")", libdef_func, LIBINIT_CF }, - { "ASM(", ")", libdef_func, LIBINIT_ASM }, - { "ASM_(", ")", libdef_func, LIBINIT_ASM_ }, - { "REC(", ")", libdef_rec, 0 }, - { "PUSH(", ")", libdef_push, 0 }, - { "SET(", ")", libdef_set, 0 }, - { "NOREGUV", NULL, libdef_regfunc, REGFUNC_NOREGUV }, - { "NOREG", NULL, libdef_regfunc, REGFUNC_NOREG }, - { NULL, NULL, (LibDefFunc)0, 0 } -}; - -/* Emit C source code for library function definitions. */ -void emit_lib(BuildCtx *ctx) -{ - const char *fname; - - if (ctx->mode == BUILD_ffdef || ctx->mode == BUILD_libdef || - ctx->mode == BUILD_recdef) - fprintf(ctx->fp, "/* This is a generated file. DO NOT EDIT! */\n\n"); - else if (ctx->mode == BUILD_vmdef) - fprintf(ctx->fp, "ffnames = {\n[0]=\"Lua\",\n\"C\",\n"); - if (ctx->mode == BUILD_recdef) - fprintf(ctx->fp, "static const uint16_t recff_idmap[] = {\n0,\n0x0100"); - recffid = ffid = FF_C+1; - ffasmfunc = 0; - - while ((fname = *ctx->args++)) { - char buf[256]; /* We don't care about analyzing lines longer than that. */ - FILE *fp; - if (fname[0] == '-' && fname[1] == '\0') { - fp = stdin; - } else { - fp = fopen(fname, "r"); - if (!fp) { - fprintf(stderr, "Error: cannot open input file '%s': %s\n", - fname, strerror(errno)); - exit(1); - } - } - modstate = 0; - regfunc = REGFUNC_OK; - while (fgets(buf, sizeof(buf), fp) != NULL) { - char *p; - /* Simplistic pre-processor. Only handles top-level #if/#endif. */ - if (buf[0] == '#' && buf[1] == 'i' && buf[2] == 'f') { - int ok = 1; - if (!strcmp(buf, "#if LJ_52\n")) - ok = LJ_52; - else if (!strcmp(buf, "#if LJ_HASJIT\n")) - ok = LJ_HASJIT; - else if (!strcmp(buf, "#if LJ_HASFFI\n")) - ok = LJ_HASFFI; - if (!ok) { - int lvl = 1; - while (fgets(buf, sizeof(buf), fp) != NULL) { - if (buf[0] == '#' && buf[1] == 'e' && buf[2] == 'n') { - if (--lvl == 0) break; - } else if (buf[0] == '#' && buf[1] == 'i' && buf[2] == 'f') { - lvl++; - } - } - continue; - } - } - for (p = buf; (p = strstr(p, LIBDEF_PREFIX)) != NULL; ) { - const LibDefHandler *ldh; - p += sizeof(LIBDEF_PREFIX)-1; - for (ldh = libdef_handlers; ldh->suffix != NULL; ldh++) { - size_t n, len = strlen(ldh->suffix); - if (!strncmp(p, ldh->suffix, len)) { - p += len; - n = ldh->stop ? strcspn(p, ldh->stop) : 0; - if (!p[n]) break; - p[n] = '\0'; - ldh->func(ctx, p, ldh->arg); - p += n+1; - break; - } - } - if (ldh->suffix == NULL) { - buf[strlen(buf)-1] = '\0'; - fprintf(stderr, "Error: unknown library definition tag %s%s\n", - LIBDEF_PREFIX, p); - exit(1); - } - } - } - fclose(fp); - if (ctx->mode == BUILD_libdef) { - libdef_endmodule(ctx); - } - } - - if (ctx->mode == BUILD_ffdef) { - fprintf(ctx->fp, "\n#undef FFDEF\n\n"); - fprintf(ctx->fp, - "#ifndef FF_NUM_ASMFUNC\n#define FF_NUM_ASMFUNC %d\n#endif\n\n", - ffasmfunc); - } else if (ctx->mode == BUILD_vmdef) { - fprintf(ctx->fp, "}\n\n"); - } else if (ctx->mode == BUILD_bcdef) { - int i; - fprintf(ctx->fp, "\n};\n\n"); - fprintf(ctx->fp, "LJ_DATADEF const uint16_t lj_bc_mode[] = {\n"); - fprintf(ctx->fp, "BCDEF(BCMODE)\n"); - for (i = ffasmfunc-1; i > 0; i--) - fprintf(ctx->fp, "BCMODE_FF,\n"); - fprintf(ctx->fp, "BCMODE_FF\n};\n\n"); - } else if (ctx->mode == BUILD_recdef) { - char *p = (char *)obuf; - fprintf(ctx->fp, "\n};\n\n"); - fprintf(ctx->fp, "static const RecordFunc recff_func[] = {\n" - "recff_nyi,\n" - "recff_c"); - while (*p) { - fprintf(ctx->fp, ",\nrecff_%s", p); - p += strlen(p)+1; - } - fprintf(ctx->fp, "\n};\n\n"); - } -} - diff --git a/subprojects/luajit/src/host/buildvm_peobj.c b/subprojects/luajit/src/host/buildvm_peobj.c deleted file mode 100644 index aab00d68f..000000000 --- a/subprojects/luajit/src/host/buildvm_peobj.c +++ /dev/null @@ -1,368 +0,0 @@ -/* -** LuaJIT VM builder: PE object emitter. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Only used for building on Windows, since we cannot assume the presence -** of a suitable assembler. The host and target byte order must match. -*/ - -#include "buildvm.h" -#include "lj_bc.h" - -#if LJ_TARGET_X86ORX64 || LJ_TARGET_PPC - -/* Context for PE object emitter. */ -static char *strtab; -static size_t strtabofs; - -/* -- PE object definitions ----------------------------------------------- */ - -/* PE header. */ -typedef struct PEheader { - uint16_t arch; - uint16_t nsects; - uint32_t time; - uint32_t symtabofs; - uint32_t nsyms; - uint16_t opthdrsz; - uint16_t flags; -} PEheader; - -/* PE section. */ -typedef struct PEsection { - char name[8]; - uint32_t vsize; - uint32_t vaddr; - uint32_t size; - uint32_t ofs; - uint32_t relocofs; - uint32_t lineofs; - uint16_t nreloc; - uint16_t nline; - uint32_t flags; -} PEsection; - -/* PE relocation. */ -typedef struct PEreloc { - uint32_t vaddr; - uint32_t symidx; - uint16_t type; -} PEreloc; - -/* Cannot use sizeof, because it pads up to the max. alignment. */ -#define PEOBJ_RELOC_SIZE (4+4+2) - -/* PE symbol table entry. */ -typedef struct PEsym { - union { - char name[8]; - uint32_t nameref[2]; - } n; - uint32_t value; - int16_t sect; - uint16_t type; - uint8_t scl; - uint8_t naux; -} PEsym; - -/* PE symbol table auxiliary entry for a section. */ -typedef struct PEsymaux { - uint32_t size; - uint16_t nreloc; - uint16_t nline; - uint32_t cksum; - uint16_t assoc; - uint8_t comdatsel; - uint8_t unused[3]; -} PEsymaux; - -/* Cannot use sizeof, because it pads up to the max. alignment. */ -#define PEOBJ_SYM_SIZE (8+4+2+2+1+1) - -/* PE object CPU specific defines. */ -#if LJ_TARGET_X86 -#define PEOBJ_ARCH_TARGET 0x014c -#define PEOBJ_RELOC_REL32 0x14 /* MS: REL32, GNU: DISP32. */ -#define PEOBJ_RELOC_DIR32 0x06 -#define PEOBJ_RELOC_OFS 0 -#define PEOBJ_TEXT_FLAGS 0x60500020 /* 60=r+x, 50=align16, 20=code. */ -#elif LJ_TARGET_X64 -#define PEOBJ_ARCH_TARGET 0x8664 -#define PEOBJ_RELOC_REL32 0x04 /* MS: REL32, GNU: DISP32. */ -#define PEOBJ_RELOC_DIR32 0x02 -#define PEOBJ_RELOC_ADDR32NB 0x03 -#define PEOBJ_RELOC_OFS 0 -#define PEOBJ_TEXT_FLAGS 0x60500020 /* 60=r+x, 50=align16, 20=code. */ -#elif LJ_TARGET_PPC -#define PEOBJ_ARCH_TARGET 0x01f2 -#define PEOBJ_RELOC_REL32 0x06 -#define PEOBJ_RELOC_DIR32 0x02 -#define PEOBJ_RELOC_OFS (-4) -#define PEOBJ_TEXT_FLAGS 0x60400020 /* 60=r+x, 40=align8, 20=code. */ -#endif - -/* Section numbers (0-based). */ -enum { - PEOBJ_SECT_ABS = -2, - PEOBJ_SECT_UNDEF = -1, - PEOBJ_SECT_TEXT, -#if LJ_TARGET_X64 - PEOBJ_SECT_PDATA, - PEOBJ_SECT_XDATA, -#endif - PEOBJ_SECT_RDATA_Z, - PEOBJ_NSECTIONS -}; - -/* Symbol types. */ -#define PEOBJ_TYPE_NULL 0 -#define PEOBJ_TYPE_FUNC 0x20 - -/* Symbol storage class. */ -#define PEOBJ_SCL_EXTERN 2 -#define PEOBJ_SCL_STATIC 3 - -/* -- PE object emitter --------------------------------------------------- */ - -/* Emit PE object symbol. */ -static void emit_peobj_sym(BuildCtx *ctx, const char *name, uint32_t value, - int sect, int type, int scl) -{ - PEsym sym; - size_t len = strlen(name); - if (!strtab) { /* Pass 1: only calculate string table length. */ - if (len > 8) strtabofs += len+1; - return; - } - if (len <= 8) { - memcpy(sym.n.name, name, len); - memset(sym.n.name+len, 0, 8-len); - } else { - sym.n.nameref[0] = 0; - sym.n.nameref[1] = (uint32_t)strtabofs; - memcpy(strtab + strtabofs, name, len); - strtab[strtabofs+len] = 0; - strtabofs += len+1; - } - sym.value = value; - sym.sect = (int16_t)(sect+1); /* 1-based section number. */ - sym.type = (uint16_t)type; - sym.scl = (uint8_t)scl; - sym.naux = 0; - owrite(ctx, &sym, PEOBJ_SYM_SIZE); -} - -/* Emit PE object section symbol. */ -static void emit_peobj_sym_sect(BuildCtx *ctx, PEsection *pesect, int sect) -{ - PEsym sym; - PEsymaux aux; - if (!strtab) return; /* Pass 1: no output. */ - memcpy(sym.n.name, pesect[sect].name, 8); - sym.value = 0; - sym.sect = (int16_t)(sect+1); /* 1-based section number. */ - sym.type = PEOBJ_TYPE_NULL; - sym.scl = PEOBJ_SCL_STATIC; - sym.naux = 1; - owrite(ctx, &sym, PEOBJ_SYM_SIZE); - memset(&aux, 0, sizeof(PEsymaux)); - aux.size = pesect[sect].size; - aux.nreloc = pesect[sect].nreloc; - owrite(ctx, &aux, PEOBJ_SYM_SIZE); -} - -/* Emit Windows PE object file. */ -void emit_peobj(BuildCtx *ctx) -{ - PEheader pehdr; - PEsection pesect[PEOBJ_NSECTIONS]; - uint32_t sofs; - int i, nrsym; - union { uint8_t b; uint32_t u; } host_endian; - - sofs = sizeof(PEheader) + PEOBJ_NSECTIONS*sizeof(PEsection); - - /* Fill in PE sections. */ - memset(&pesect, 0, PEOBJ_NSECTIONS*sizeof(PEsection)); - memcpy(pesect[PEOBJ_SECT_TEXT].name, ".text", sizeof(".text")-1); - pesect[PEOBJ_SECT_TEXT].ofs = sofs; - sofs += (pesect[PEOBJ_SECT_TEXT].size = (uint32_t)ctx->codesz); - pesect[PEOBJ_SECT_TEXT].relocofs = sofs; - sofs += (pesect[PEOBJ_SECT_TEXT].nreloc = (uint16_t)ctx->nreloc) * PEOBJ_RELOC_SIZE; - /* Flags: 60 = read+execute, 50 = align16, 20 = code. */ - pesect[PEOBJ_SECT_TEXT].flags = PEOBJ_TEXT_FLAGS; - -#if LJ_TARGET_X64 - memcpy(pesect[PEOBJ_SECT_PDATA].name, ".pdata", sizeof(".pdata")-1); - pesect[PEOBJ_SECT_PDATA].ofs = sofs; - sofs += (pesect[PEOBJ_SECT_PDATA].size = 6*4); - pesect[PEOBJ_SECT_PDATA].relocofs = sofs; - sofs += (pesect[PEOBJ_SECT_PDATA].nreloc = 6) * PEOBJ_RELOC_SIZE; - /* Flags: 40 = read, 30 = align4, 40 = initialized data. */ - pesect[PEOBJ_SECT_PDATA].flags = 0x40300040; - - memcpy(pesect[PEOBJ_SECT_XDATA].name, ".xdata", sizeof(".xdata")-1); - pesect[PEOBJ_SECT_XDATA].ofs = sofs; - sofs += (pesect[PEOBJ_SECT_XDATA].size = 8*2+4+6*2); /* See below. */ - pesect[PEOBJ_SECT_XDATA].relocofs = sofs; - sofs += (pesect[PEOBJ_SECT_XDATA].nreloc = 1) * PEOBJ_RELOC_SIZE; - /* Flags: 40 = read, 30 = align4, 40 = initialized data. */ - pesect[PEOBJ_SECT_XDATA].flags = 0x40300040; -#endif - - memcpy(pesect[PEOBJ_SECT_RDATA_Z].name, ".rdata$Z", sizeof(".rdata$Z")-1); - pesect[PEOBJ_SECT_RDATA_Z].ofs = sofs; - sofs += (pesect[PEOBJ_SECT_RDATA_Z].size = (uint32_t)strlen(ctx->dasm_ident)+1); - /* Flags: 40 = read, 30 = align4, 40 = initialized data. */ - pesect[PEOBJ_SECT_RDATA_Z].flags = 0x40300040; - - /* Fill in PE header. */ - pehdr.arch = PEOBJ_ARCH_TARGET; - pehdr.nsects = PEOBJ_NSECTIONS; - pehdr.time = 0; /* Timestamp is optional. */ - pehdr.symtabofs = sofs; - pehdr.opthdrsz = 0; - pehdr.flags = 0; - - /* Compute the size of the symbol table: - ** @feat.00 + nsections*2 - ** + asm_start + nsym - ** + nrsym - */ - nrsym = ctx->nrelocsym; - pehdr.nsyms = 1+PEOBJ_NSECTIONS*2 + 1+ctx->nsym + nrsym; -#if LJ_TARGET_X64 - pehdr.nsyms += 1; /* Symbol for lj_err_unwind_win64. */ -#endif - - /* Write PE object header and all sections. */ - owrite(ctx, &pehdr, sizeof(PEheader)); - owrite(ctx, &pesect, sizeof(PEsection)*PEOBJ_NSECTIONS); - - /* Write .text section. */ - host_endian.u = 1; - if (host_endian.b != LJ_ENDIAN_SELECT(1, 0)) { -#if LJ_TARGET_PPC - uint32_t *p = (uint32_t *)ctx->code; - int n = (int)(ctx->codesz >> 2); - for (i = 0; i < n; i++, p++) - *p = lj_bswap(*p); /* Byteswap .text section. */ -#else - fprintf(stderr, "Error: different byte order for host and target\n"); - exit(1); -#endif - } - owrite(ctx, ctx->code, ctx->codesz); - for (i = 0; i < ctx->nreloc; i++) { - PEreloc reloc; - reloc.vaddr = (uint32_t)ctx->reloc[i].ofs + PEOBJ_RELOC_OFS; - reloc.symidx = 1+2+ctx->reloc[i].sym; /* Reloc syms are after .text sym. */ - reloc.type = ctx->reloc[i].type ? PEOBJ_RELOC_REL32 : PEOBJ_RELOC_DIR32; - owrite(ctx, &reloc, PEOBJ_RELOC_SIZE); - } - -#if LJ_TARGET_X64 - { /* Write .pdata section. */ - uint32_t fcofs = (uint32_t)ctx->sym[ctx->nsym-1].ofs; - uint32_t pdata[3]; /* Start of .text, end of .text and .xdata. */ - PEreloc reloc; - pdata[0] = 0; pdata[1] = fcofs; pdata[2] = 0; - owrite(ctx, &pdata, sizeof(pdata)); - pdata[0] = fcofs; pdata[1] = (uint32_t)ctx->codesz; pdata[2] = 20; - owrite(ctx, &pdata, sizeof(pdata)); - reloc.vaddr = 0; reloc.symidx = 1+2+nrsym+2+2+1; - reloc.type = PEOBJ_RELOC_ADDR32NB; - owrite(ctx, &reloc, PEOBJ_RELOC_SIZE); - reloc.vaddr = 4; reloc.symidx = 1+2+nrsym+2+2+1; - reloc.type = PEOBJ_RELOC_ADDR32NB; - owrite(ctx, &reloc, PEOBJ_RELOC_SIZE); - reloc.vaddr = 8; reloc.symidx = 1+2+nrsym+2; - reloc.type = PEOBJ_RELOC_ADDR32NB; - owrite(ctx, &reloc, PEOBJ_RELOC_SIZE); - reloc.vaddr = 12; reloc.symidx = 1+2+nrsym+2+2+1; - reloc.type = PEOBJ_RELOC_ADDR32NB; - owrite(ctx, &reloc, PEOBJ_RELOC_SIZE); - reloc.vaddr = 16; reloc.symidx = 1+2+nrsym+2+2+1; - reloc.type = PEOBJ_RELOC_ADDR32NB; - owrite(ctx, &reloc, PEOBJ_RELOC_SIZE); - reloc.vaddr = 20; reloc.symidx = 1+2+nrsym+2; - reloc.type = PEOBJ_RELOC_ADDR32NB; - owrite(ctx, &reloc, PEOBJ_RELOC_SIZE); - } - { /* Write .xdata section. */ - uint16_t xdata[8+2+6]; - PEreloc reloc; - xdata[0] = 0x01|0x08|0x10; /* Ver. 1, uhandler/ehandler, prolog size 0. */ - xdata[1] = 0x0005; /* Number of unwind codes, no frame pointer. */ - xdata[2] = 0x4200; /* Stack offset 4*8+8 = aword*5. */ - xdata[3] = 0x3000; /* Push rbx. */ - xdata[4] = 0x6000; /* Push rsi. */ - xdata[5] = 0x7000; /* Push rdi. */ - xdata[6] = 0x5000; /* Push rbp. */ - xdata[7] = 0; /* Alignment. */ - xdata[8] = xdata[9] = 0; /* Relocated address of exception handler. */ - xdata[10] = 0x01; /* Ver. 1, no handler, prolog size 0. */ - xdata[11] = 0x1504; /* Number of unwind codes, fp = rbp, fpofs = 16. */ - xdata[12] = 0x0300; /* set_fpreg. */ - xdata[13] = 0x0200; /* stack offset 0*8+8 = aword*1. */ - xdata[14] = 0x3000; /* Push rbx. */ - xdata[15] = 0x5000; /* Push rbp. */ - owrite(ctx, &xdata, sizeof(xdata)); - reloc.vaddr = 2*8; reloc.symidx = 1+2+nrsym+2+2; - reloc.type = PEOBJ_RELOC_ADDR32NB; - owrite(ctx, &reloc, PEOBJ_RELOC_SIZE); - } -#endif - - /* Write .rdata$Z section. */ - owrite(ctx, ctx->dasm_ident, strlen(ctx->dasm_ident)+1); - - /* Write symbol table. */ - strtab = NULL; /* 1st pass: collect string sizes. */ - for (;;) { - strtabofs = 4; - /* Mark as SafeSEH compliant. */ - emit_peobj_sym(ctx, "@feat.00", 1, - PEOBJ_SECT_ABS, PEOBJ_TYPE_NULL, PEOBJ_SCL_STATIC); - - emit_peobj_sym_sect(ctx, pesect, PEOBJ_SECT_TEXT); - for (i = 0; i < nrsym; i++) - emit_peobj_sym(ctx, ctx->relocsym[i], 0, - PEOBJ_SECT_UNDEF, PEOBJ_TYPE_FUNC, PEOBJ_SCL_EXTERN); - -#if LJ_TARGET_X64 - emit_peobj_sym_sect(ctx, pesect, PEOBJ_SECT_PDATA); - emit_peobj_sym_sect(ctx, pesect, PEOBJ_SECT_XDATA); - emit_peobj_sym(ctx, "lj_err_unwind_win64", 0, - PEOBJ_SECT_UNDEF, PEOBJ_TYPE_FUNC, PEOBJ_SCL_EXTERN); -#endif - - emit_peobj_sym(ctx, ctx->beginsym, 0, - PEOBJ_SECT_TEXT, PEOBJ_TYPE_NULL, PEOBJ_SCL_EXTERN); - for (i = 0; i < ctx->nsym; i++) - emit_peobj_sym(ctx, ctx->sym[i].name, (uint32_t)ctx->sym[i].ofs, - PEOBJ_SECT_TEXT, PEOBJ_TYPE_FUNC, PEOBJ_SCL_EXTERN); - - emit_peobj_sym_sect(ctx, pesect, PEOBJ_SECT_RDATA_Z); - - if (strtab) - break; - /* 2nd pass: alloc strtab, write syms and copy strings. */ - strtab = (char *)malloc(strtabofs); - *(uint32_t *)strtab = (uint32_t)strtabofs; - } - - /* Write string table. */ - owrite(ctx, strtab, strtabofs); -} - -#else - -void emit_peobj(BuildCtx *ctx) -{ - UNUSED(ctx); - fprintf(stderr, "Error: no PE object support for this target\n"); - exit(1); -} - -#endif diff --git a/subprojects/luajit/src/host/genminilua.lua b/subprojects/luajit/src/host/genminilua.lua deleted file mode 100644 index 50feff014..000000000 --- a/subprojects/luajit/src/host/genminilua.lua +++ /dev/null @@ -1,429 +0,0 @@ ----------------------------------------------------------------------------- --- Lua script to generate a customized, minified version of Lua. --- The resulting 'minilua' is used for the build process of LuaJIT. ----------------------------------------------------------------------------- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- Released under the MIT license. See Copyright Notice in luajit.h ----------------------------------------------------------------------------- - -local sub, match, gsub = string.sub, string.match, string.gsub - -local LUA_VERSION = "5.1.5" -local LUA_SOURCE - -local function usage() - io.stderr:write("Usage: ", arg and arg[0] or "genminilua", - " lua-", LUA_VERSION, "-source-dir\n") - os.exit(1) -end - -local function find_sources() - LUA_SOURCE = arg and arg[1] - if not LUA_SOURCE then usage() end - if sub(LUA_SOURCE, -1) ~= "/" then LUA_SOURCE = LUA_SOURCE.."/" end - local fp = io.open(LUA_SOURCE .. "lua.h") - if not fp then - LUA_SOURCE = LUA_SOURCE.."src/" - fp = io.open(LUA_SOURCE .. "lua.h") - if not fp then usage() end - end - local all = fp:read("*a") - fp:close() - if not match(all, 'LUA_RELEASE%s*"Lua '..LUA_VERSION..'"') then - io.stderr:write("Error: version mismatch\n") - usage() - end -end - -local LUA_FILES = { -"lmem.c", "lobject.c", "ltm.c", "lfunc.c", "ldo.c", "lstring.c", "ltable.c", -"lgc.c", "lstate.c", "ldebug.c", "lzio.c", "lopcodes.c", -"llex.c", "lcode.c", "lparser.c", "lvm.c", "lapi.c", "lauxlib.c", -"lbaselib.c", "ltablib.c", "liolib.c", "loslib.c", "lstrlib.c", "linit.c", -} - -local REMOVE_LIB = {} -gsub([[ -collectgarbage dofile gcinfo getfenv getmetatable load print rawequal rawset -select tostring xpcall -foreach foreachi getn maxn setn -popen tmpfile seek setvbuf __tostring -clock date difftime execute getenv rename setlocale time tmpname -dump gfind len reverse -LUA_LOADLIBNAME LUA_MATHLIBNAME LUA_DBLIBNAME -]], "%S+", function(name) - REMOVE_LIB[name] = true -end) - -local REMOVE_EXTINC = { [""] = true, [""] = true, } - -local CUSTOM_MAIN = [[ -typedef unsigned int UB; -static UB barg(lua_State *L,int idx){ -union{lua_Number n;U64 b;}bn; -bn.n=lua_tonumber(L,idx)+6755399441055744.0; -if (bn.n==0.0&&!lua_isnumber(L,idx))luaL_typerror(L,idx,"number"); -return(UB)bn.b; -} -#define BRET(b) lua_pushnumber(L,(lua_Number)(int)(b));return 1; -static int tobit(lua_State *L){ -BRET(barg(L,1))} -static int bnot(lua_State *L){ -BRET(~barg(L,1))} -static int band(lua_State *L){ -int i;UB b=barg(L,1);for(i=lua_gettop(L);i>1;i--)b&=barg(L,i);BRET(b)} -static int bor(lua_State *L){ -int i;UB b=barg(L,1);for(i=lua_gettop(L);i>1;i--)b|=barg(L,i);BRET(b)} -static int bxor(lua_State *L){ -int i;UB b=barg(L,1);for(i=lua_gettop(L);i>1;i--)b^=barg(L,i);BRET(b)} -static int lshift(lua_State *L){ -UB b=barg(L,1),n=barg(L,2)&31;BRET(b<>n)} -static int arshift(lua_State *L){ -UB b=barg(L,1),n=barg(L,2)&31;BRET((int)b>>n)} -static int rol(lua_State *L){ -UB b=barg(L,1),n=barg(L,2)&31;BRET((b<>(32-n)))} -static int ror(lua_State *L){ -UB b=barg(L,1),n=barg(L,2)&31;BRET((b>>n)|(b<<(32-n)))} -static int bswap(lua_State *L){ -UB b=barg(L,1);b=(b>>24)|((b>>8)&0xff00)|((b&0xff00)<<8)|(b<<24);BRET(b)} -static int tohex(lua_State *L){ -UB b=barg(L,1); -int n=lua_isnone(L,2)?8:(int)barg(L,2); -const char *hexdigits="0123456789abcdef"; -char buf[8]; -int i; -if(n<0){n=-n;hexdigits="0123456789ABCDEF";} -if(n>8)n=8; -for(i=(int)n;--i>=0;){buf[i]=hexdigits[b&15];b>>=4;} -lua_pushlstring(L,buf,(size_t)n); -return 1; -} -static const struct luaL_Reg bitlib[] = { -{"tobit",tobit}, -{"bnot",bnot}, -{"band",band}, -{"bor",bor}, -{"bxor",bxor}, -{"lshift",lshift}, -{"rshift",rshift}, -{"arshift",arshift}, -{"rol",rol}, -{"ror",ror}, -{"bswap",bswap}, -{"tohex",tohex}, -{NULL,NULL} -}; -int main(int argc, char **argv){ - lua_State *L = luaL_newstate(); - int i; - luaL_openlibs(L); - luaL_register(L, "bit", bitlib); - if (argc < 2) return sizeof(void *); - lua_createtable(L, 0, 1); - lua_pushstring(L, argv[1]); - lua_rawseti(L, -2, 0); - lua_setglobal(L, "arg"); - if (luaL_loadfile(L, argv[1])) - goto err; - for (i = 2; i < argc; i++) - lua_pushstring(L, argv[i]); - if (lua_pcall(L, argc - 2, 0, 0)) { - err: - fprintf(stderr, "Error: %s\n", lua_tostring(L, -1)); - return 1; - } - lua_close(L); - return 0; -} -]] - -local function read_sources() - local t = {} - for i, name in ipairs(LUA_FILES) do - local fp = assert(io.open(LUA_SOURCE..name, "r")) - t[i] = fp:read("*a") - assert(fp:close()) - end - t[#t+1] = CUSTOM_MAIN - return table.concat(t) -end - -local includes = {} - -local function merge_includes(src) - return gsub(src, '#include%s*"([^"]*)"%s*\n', function(name) - if includes[name] then return "" end - includes[name] = true - local fp = assert(io.open(LUA_SOURCE..name, "r")) - local inc = fp:read("*a") - assert(fp:close()) - inc = gsub(inc, "#ifndef%s+%w+_h\n#define%s+%w+_h\n", "") - inc = gsub(inc, "#endif%s*$", "") - return merge_includes(inc) - end) -end - -local function get_license(src) - return match(src, "/%*+\n%* Copyright %(.-%*/\n") -end - -local function fold_lines(src) - return gsub(src, "\\\n", " ") -end - -local strings = {} - -local function save_str(str) - local n = #strings+1 - strings[n] = str - return "\1"..n.."\2" -end - -local function save_strings(src) - src = gsub(src, '"[^"\n]*"', save_str) - return gsub(src, "'[^'\n]*'", save_str) -end - -local function restore_strings(src) - return gsub(src, "\1(%d+)\2", function(numstr) - return strings[tonumber(numstr)] - end) -end - -local function def_istrue(def) - return def == "INT_MAX > 2147483640L" or - def == "LUAI_BITSINT >= 32" or - def == "SIZE_Bx < LUAI_BITSINT-1" or - def == "cast" or - def == "defined(LUA_CORE)" or - def == "MINSTRTABSIZE" or - def == "LUA_MINBUFFER" or - def == "HARDSTACKTESTS" or - def == "UNUSED" -end - -local head, defs = {[[ -#ifdef _MSC_VER -typedef unsigned __int64 U64; -#else -typedef unsigned long long U64; -#endif -int _CRT_glob = 0; -]]}, {} - -local function preprocess(src) - local t = { match(src, "^(.-)#") } - local lvl, on, oldon = 0, true, {} - for pp, def, txt in string.gmatch(src, "#(%w+) *([^\n]*)\n([^#]*)") do - if pp == "if" or pp == "ifdef" or pp == "ifndef" then - lvl = lvl + 1 - oldon[lvl] = on - on = def_istrue(def) - elseif pp == "else" then - if oldon[lvl] then - if on == false then on = true else on = false end - end - elseif pp == "elif" then - if oldon[lvl] then - on = def_istrue(def) - end - elseif pp == "endif" then - on = oldon[lvl] - lvl = lvl - 1 - elseif on then - if pp == "include" then - if not head[def] and not REMOVE_EXTINC[def] then - head[def] = true - head[#head+1] = "#include "..def.."\n" - end - elseif pp == "define" then - local k, sp, v = match(def, "([%w_]+)(%s*)(.*)") - if k and not (sp == "" and sub(v, 1, 1) == "(") then - defs[k] = gsub(v, "%a[%w_]*", function(tok) - return defs[tok] or tok - end) - else - t[#t+1] = "#define "..def.."\n" - end - elseif pp ~= "undef" then - error("unexpected directive: "..pp.." "..def) - end - end - if on then t[#t+1] = txt end - end - return gsub(table.concat(t), "%a[%w_]*", function(tok) - return defs[tok] or tok - end) -end - -local function merge_header(src, license) - local hdr = string.format([[ -/* This is a heavily customized and minimized copy of Lua %s. */ -/* It's only used to build LuaJIT. It does NOT have all standard functions! */ -]], LUA_VERSION) - return hdr..license..table.concat(head)..src -end - -local function strip_unused1(src) - return gsub(src, '( {"?([%w_]+)"?,%s+%a[%w_]*},\n)', function(line, func) - return REMOVE_LIB[func] and "" or line - end) -end - -local function strip_unused2(src) - return gsub(src, "Symbolic Execution.-}=", "") -end - -local function strip_unused3(src) - src = gsub(src, "extern", "static") - src = gsub(src, "\nstatic([^\n]-)%(([^)]*)%)%(", "\nstatic%1 %2(") - src = gsub(src, "#define lua_assert[^\n]*\n", "") - src = gsub(src, "lua_assert%b();?", "") - src = gsub(src, "default:\n}", "default:;\n}") - src = gsub(src, "lua_lock%b();", "") - src = gsub(src, "lua_unlock%b();", "") - src = gsub(src, "luai_threadyield%b();", "") - src = gsub(src, "luai_userstateopen%b();", "{}") - src = gsub(src, "luai_userstate%w+%b();", "") - src = gsub(src, "%(%(c==.*luaY_parser%)", "luaY_parser") - src = gsub(src, "trydecpoint%(ls,seminfo%)", - "luaX_lexerror(ls,\"malformed number\",TK_NUMBER)") - src = gsub(src, "int c=luaZ_lookahead%b();", "") - src = gsub(src, "luaL_register%(L,[^,]*,co_funcs%);\nreturn 2;", - "return 1;") - src = gsub(src, "getfuncname%b():", "NULL:") - src = gsub(src, "getobjname%b():", "NULL:") - src = gsub(src, "if%([^\n]*hookmask[^\n]*%)\n[^\n]*\n", "") - src = gsub(src, "if%([^\n]*hookmask[^\n]*%)%b{}\n", "") - src = gsub(src, "if%([^\n]*hookmask[^\n]*&&\n[^\n]*%b{}\n", "") - src = gsub(src, "(twoto%b()%()", "%1(size_t)") - src = gsub(src, "i -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -typedef enum{ -TM_INDEX, -TM_NEWINDEX, -TM_GC, -TM_MODE, -TM_EQ, -TM_ADD, -TM_SUB, -TM_MUL, -TM_DIV, -TM_MOD, -TM_POW, -TM_UNM, -TM_LEN, -TM_LT, -TM_LE, -TM_CONCAT, -TM_CALL, -TM_N -}TMS; -enum OpMode{iABC,iABx,iAsBx}; -typedef enum{ -OP_MOVE, -OP_LOADK, -OP_LOADBOOL, -OP_LOADNIL, -OP_GETUPVAL, -OP_GETGLOBAL, -OP_GETTABLE, -OP_SETGLOBAL, -OP_SETUPVAL, -OP_SETTABLE, -OP_NEWTABLE, -OP_SELF, -OP_ADD, -OP_SUB, -OP_MUL, -OP_DIV, -OP_MOD, -OP_POW, -OP_UNM, -OP_NOT, -OP_LEN, -OP_CONCAT, -OP_JMP, -OP_EQ, -OP_LT, -OP_LE, -OP_TEST, -OP_TESTSET, -OP_CALL, -OP_TAILCALL, -OP_RETURN, -OP_FORLOOP, -OP_FORPREP, -OP_TFORLOOP, -OP_SETLIST, -OP_CLOSE, -OP_CLOSURE, -OP_VARARG -}OpCode; -enum OpArgMask{ -OpArgN, -OpArgU, -OpArgR, -OpArgK -}; -typedef enum{ -VVOID, -VNIL, -VTRUE, -VFALSE, -VK, -VKNUM, -VLOCAL, -VUPVAL, -VGLOBAL, -VINDEXED, -VJMP, -VRELOCABLE, -VNONRELOC, -VCALL, -VVARARG -}expkind; -enum RESERVED{ -TK_AND=257,TK_BREAK, -TK_DO,TK_ELSE,TK_ELSEIF,TK_END,TK_FALSE,TK_FOR,TK_FUNCTION, -TK_IF,TK_IN,TK_LOCAL,TK_NIL,TK_NOT,TK_OR,TK_REPEAT, -TK_RETURN,TK_THEN,TK_TRUE,TK_UNTIL,TK_WHILE, -TK_CONCAT,TK_DOTS,TK_EQ,TK_GE,TK_LE,TK_NE,TK_NUMBER, -TK_NAME,TK_STRING,TK_EOS -}; -typedef enum BinOpr{ -OPR_ADD,OPR_SUB,OPR_MUL,OPR_DIV,OPR_MOD,OPR_POW, -OPR_CONCAT, -OPR_NE,OPR_EQ, -OPR_LT,OPR_LE,OPR_GT,OPR_GE, -OPR_AND,OPR_OR, -OPR_NOBINOPR -}BinOpr; -typedef enum UnOpr{OPR_MINUS,OPR_NOT,OPR_LEN,OPR_NOUNOPR}UnOpr; -#define LUA_QL(x)"'"x"'" -#define luai_apicheck(L,o){(void)L;} -#define lua_number2str(s,n)sprintf((s),"%.14g",(n)) -#define lua_str2number(s,p)strtod((s),(p)) -#define luai_numadd(a,b)((a)+(b)) -#define luai_numsub(a,b)((a)-(b)) -#define luai_nummul(a,b)((a)*(b)) -#define luai_numdiv(a,b)((a)/(b)) -#define luai_nummod(a,b)((a)-floor((a)/(b))*(b)) -#define luai_numpow(a,b)(pow(a,b)) -#define luai_numunm(a)(-(a)) -#define luai_numeq(a,b)((a)==(b)) -#define luai_numlt(a,b)((a)<(b)) -#define luai_numle(a,b)((a)<=(b)) -#define luai_numisnan(a)(!luai_numeq((a),(a))) -#define lua_number2int(i,d)((i)=(int)(d)) -#define lua_number2integer(i,d)((i)=(lua_Integer)(d)) -#define LUAI_THROW(L,c)longjmp((c)->b,1) -#define LUAI_TRY(L,c,a)if(setjmp((c)->b)==0){a} -#define lua_pclose(L,file)((void)((void)L,file),0) -#define lua_upvalueindex(i)((-10002)-(i)) -typedef struct lua_State lua_State; -typedef int(*lua_CFunction)(lua_State*L); -typedef const char*(*lua_Reader)(lua_State*L,void*ud,size_t*sz); -typedef void*(*lua_Alloc)(void*ud,void*ptr,size_t osize,size_t nsize); -typedef double lua_Number; -typedef ptrdiff_t lua_Integer; -static void lua_settop(lua_State*L,int idx); -static int lua_type(lua_State*L,int idx); -static const char* lua_tolstring(lua_State*L,int idx,size_t*len); -static size_t lua_objlen(lua_State*L,int idx); -static void lua_pushlstring(lua_State*L,const char*s,size_t l); -static void lua_pushcclosure(lua_State*L,lua_CFunction fn,int n); -static void lua_createtable(lua_State*L,int narr,int nrec); -static void lua_setfield(lua_State*L,int idx,const char*k); -#define lua_pop(L,n)lua_settop(L,-(n)-1) -#define lua_newtable(L)lua_createtable(L,0,0) -#define lua_pushcfunction(L,f)lua_pushcclosure(L,(f),0) -#define lua_strlen(L,i)lua_objlen(L,(i)) -#define lua_isfunction(L,n)(lua_type(L,(n))==6) -#define lua_istable(L,n)(lua_type(L,(n))==5) -#define lua_isnil(L,n)(lua_type(L,(n))==0) -#define lua_isboolean(L,n)(lua_type(L,(n))==1) -#define lua_isnone(L,n)(lua_type(L,(n))==(-1)) -#define lua_isnoneornil(L,n)(lua_type(L,(n))<=0) -#define lua_pushliteral(L,s)lua_pushlstring(L,""s,(sizeof(s)/sizeof(char))-1) -#define lua_setglobal(L,s)lua_setfield(L,(-10002),(s)) -#define lua_tostring(L,i)lua_tolstring(L,(i),NULL) -typedef struct lua_Debug lua_Debug; -typedef void(*lua_Hook)(lua_State*L,lua_Debug*ar); -struct lua_Debug{ -int event; -const char*name; -const char*namewhat; -const char*what; -const char*source; -int currentline; -int nups; -int linedefined; -int lastlinedefined; -char short_src[60]; -int i_ci; -}; -typedef unsigned int lu_int32; -typedef size_t lu_mem; -typedef ptrdiff_t l_mem; -typedef unsigned char lu_byte; -#define IntPoint(p)((unsigned int)(lu_mem)(p)) -typedef union{double u;void*s;long l;}L_Umaxalign; -typedef double l_uacNumber; -#define check_exp(c,e)(e) -#define UNUSED(x)((void)(x)) -#define cast(t,exp)((t)(exp)) -#define cast_byte(i)cast(lu_byte,(i)) -#define cast_num(i)cast(lua_Number,(i)) -#define cast_int(i)cast(int,(i)) -typedef lu_int32 Instruction; -#define condhardstacktests(x)((void)0) -typedef union GCObject GCObject; -typedef struct GCheader{ -GCObject*next;lu_byte tt;lu_byte marked; -}GCheader; -typedef union{ -GCObject*gc; -void*p; -lua_Number n; -int b; -}Value; -typedef struct lua_TValue{ -Value value;int tt; -}TValue; -#define ttisnil(o)(ttype(o)==0) -#define ttisnumber(o)(ttype(o)==3) -#define ttisstring(o)(ttype(o)==4) -#define ttistable(o)(ttype(o)==5) -#define ttisfunction(o)(ttype(o)==6) -#define ttisboolean(o)(ttype(o)==1) -#define ttisuserdata(o)(ttype(o)==7) -#define ttisthread(o)(ttype(o)==8) -#define ttislightuserdata(o)(ttype(o)==2) -#define ttype(o)((o)->tt) -#define gcvalue(o)check_exp(iscollectable(o),(o)->value.gc) -#define pvalue(o)check_exp(ttislightuserdata(o),(o)->value.p) -#define nvalue(o)check_exp(ttisnumber(o),(o)->value.n) -#define rawtsvalue(o)check_exp(ttisstring(o),&(o)->value.gc->ts) -#define tsvalue(o)(&rawtsvalue(o)->tsv) -#define rawuvalue(o)check_exp(ttisuserdata(o),&(o)->value.gc->u) -#define uvalue(o)(&rawuvalue(o)->uv) -#define clvalue(o)check_exp(ttisfunction(o),&(o)->value.gc->cl) -#define hvalue(o)check_exp(ttistable(o),&(o)->value.gc->h) -#define bvalue(o)check_exp(ttisboolean(o),(o)->value.b) -#define thvalue(o)check_exp(ttisthread(o),&(o)->value.gc->th) -#define l_isfalse(o)(ttisnil(o)||(ttisboolean(o)&&bvalue(o)==0)) -#define checkconsistency(obj) -#define checkliveness(g,obj) -#define setnilvalue(obj)((obj)->tt=0) -#define setnvalue(obj,x){TValue*i_o=(obj);i_o->value.n=(x);i_o->tt=3;} -#define setbvalue(obj,x){TValue*i_o=(obj);i_o->value.b=(x);i_o->tt=1;} -#define setsvalue(L,obj,x){TValue*i_o=(obj);i_o->value.gc=cast(GCObject*,(x));i_o->tt=4;checkliveness(G(L),i_o);} -#define setuvalue(L,obj,x){TValue*i_o=(obj);i_o->value.gc=cast(GCObject*,(x));i_o->tt=7;checkliveness(G(L),i_o);} -#define setthvalue(L,obj,x){TValue*i_o=(obj);i_o->value.gc=cast(GCObject*,(x));i_o->tt=8;checkliveness(G(L),i_o);} -#define setclvalue(L,obj,x){TValue*i_o=(obj);i_o->value.gc=cast(GCObject*,(x));i_o->tt=6;checkliveness(G(L),i_o);} -#define sethvalue(L,obj,x){TValue*i_o=(obj);i_o->value.gc=cast(GCObject*,(x));i_o->tt=5;checkliveness(G(L),i_o);} -#define setptvalue(L,obj,x){TValue*i_o=(obj);i_o->value.gc=cast(GCObject*,(x));i_o->tt=(8+1);checkliveness(G(L),i_o);} -#define setobj(L,obj1,obj2){const TValue*o2=(obj2);TValue*o1=(obj1);o1->value=o2->value;o1->tt=o2->tt;checkliveness(G(L),o1);} -#define setttype(obj,tt)(ttype(obj)=(tt)) -#define iscollectable(o)(ttype(o)>=4) -typedef TValue*StkId; -typedef union TString{ -L_Umaxalign dummy; -struct{ -GCObject*next;lu_byte tt;lu_byte marked; -lu_byte reserved; -unsigned int hash; -size_t len; -}tsv; -}TString; -#define getstr(ts)cast(const char*,(ts)+1) -#define svalue(o)getstr(rawtsvalue(o)) -typedef union Udata{ -L_Umaxalign dummy; -struct{ -GCObject*next;lu_byte tt;lu_byte marked; -struct Table*metatable; -struct Table*env; -size_t len; -}uv; -}Udata; -typedef struct Proto{ -GCObject*next;lu_byte tt;lu_byte marked; -TValue*k; -Instruction*code; -struct Proto**p; -int*lineinfo; -struct LocVar*locvars; -TString**upvalues; -TString*source; -int sizeupvalues; -int sizek; -int sizecode; -int sizelineinfo; -int sizep; -int sizelocvars; -int linedefined; -int lastlinedefined; -GCObject*gclist; -lu_byte nups; -lu_byte numparams; -lu_byte is_vararg; -lu_byte maxstacksize; -}Proto; -typedef struct LocVar{ -TString*varname; -int startpc; -int endpc; -}LocVar; -typedef struct UpVal{ -GCObject*next;lu_byte tt;lu_byte marked; -TValue*v; -union{ -TValue value; -struct{ -struct UpVal*prev; -struct UpVal*next; -}l; -}u; -}UpVal; -typedef struct CClosure{ -GCObject*next;lu_byte tt;lu_byte marked;lu_byte isC;lu_byte nupvalues;GCObject*gclist;struct Table*env; -lua_CFunction f; -TValue upvalue[1]; -}CClosure; -typedef struct LClosure{ -GCObject*next;lu_byte tt;lu_byte marked;lu_byte isC;lu_byte nupvalues;GCObject*gclist;struct Table*env; -struct Proto*p; -UpVal*upvals[1]; -}LClosure; -typedef union Closure{ -CClosure c; -LClosure l; -}Closure; -#define iscfunction(o)(ttype(o)==6&&clvalue(o)->c.isC) -typedef union TKey{ -struct{ -Value value;int tt; -struct Node*next; -}nk; -TValue tvk; -}TKey; -typedef struct Node{ -TValue i_val; -TKey i_key; -}Node; -typedef struct Table{ -GCObject*next;lu_byte tt;lu_byte marked; -lu_byte flags; -lu_byte lsizenode; -struct Table*metatable; -TValue*array; -Node*node; -Node*lastfree; -GCObject*gclist; -int sizearray; -}Table; -#define lmod(s,size)(check_exp((size&(size-1))==0,(cast(int,(s)&((size)-1))))) -#define twoto(x)((size_t)1<<(x)) -#define sizenode(t)(twoto((t)->lsizenode)) -static const TValue luaO_nilobject_; -#define ceillog2(x)(luaO_log2((x)-1)+1) -static int luaO_log2(unsigned int x); -#define gfasttm(g,et,e)((et)==NULL?NULL:((et)->flags&(1u<<(e)))?NULL:luaT_gettm(et,e,(g)->tmname[e])) -#define fasttm(l,et,e)gfasttm(G(l),et,e) -static const TValue*luaT_gettm(Table*events,TMS event,TString*ename); -#define luaM_reallocv(L,b,on,n,e)((cast(size_t,(n)+1)<=((size_t)(~(size_t)0)-2)/(e))?luaM_realloc_(L,(b),(on)*(e),(n)*(e)):luaM_toobig(L)) -#define luaM_freemem(L,b,s)luaM_realloc_(L,(b),(s),0) -#define luaM_free(L,b)luaM_realloc_(L,(b),sizeof(*(b)),0) -#define luaM_freearray(L,b,n,t)luaM_reallocv(L,(b),n,0,sizeof(t)) -#define luaM_malloc(L,t)luaM_realloc_(L,NULL,0,(t)) -#define luaM_new(L,t)cast(t*,luaM_malloc(L,sizeof(t))) -#define luaM_newvector(L,n,t)cast(t*,luaM_reallocv(L,NULL,0,n,sizeof(t))) -#define luaM_growvector(L,v,nelems,size,t,limit,e)if((nelems)+1>(size))((v)=cast(t*,luaM_growaux_(L,v,&(size),sizeof(t),limit,e))) -#define luaM_reallocvector(L,v,oldn,n,t)((v)=cast(t*,luaM_reallocv(L,v,oldn,n,sizeof(t)))) -static void*luaM_realloc_(lua_State*L,void*block,size_t oldsize, -size_t size); -static void*luaM_toobig(lua_State*L); -static void*luaM_growaux_(lua_State*L,void*block,int*size, -size_t size_elem,int limit, -const char*errormsg); -typedef struct Zio ZIO; -#define char2int(c)cast(int,cast(unsigned char,(c))) -#define zgetc(z)(((z)->n--)>0?char2int(*(z)->p++):luaZ_fill(z)) -typedef struct Mbuffer{ -char*buffer; -size_t n; -size_t buffsize; -}Mbuffer; -#define luaZ_initbuffer(L,buff)((buff)->buffer=NULL,(buff)->buffsize=0) -#define luaZ_buffer(buff)((buff)->buffer) -#define luaZ_sizebuffer(buff)((buff)->buffsize) -#define luaZ_bufflen(buff)((buff)->n) -#define luaZ_resetbuffer(buff)((buff)->n=0) -#define luaZ_resizebuffer(L,buff,size)(luaM_reallocvector(L,(buff)->buffer,(buff)->buffsize,size,char),(buff)->buffsize=size) -#define luaZ_freebuffer(L,buff)luaZ_resizebuffer(L,buff,0) -struct Zio{ -size_t n; -const char*p; -lua_Reader reader; -void*data; -lua_State*L; -}; -static int luaZ_fill(ZIO*z); -struct lua_longjmp; -#define gt(L)(&L->l_gt) -#define registry(L)(&G(L)->l_registry) -typedef struct stringtable{ -GCObject**hash; -lu_int32 nuse; -int size; -}stringtable; -typedef struct CallInfo{ -StkId base; -StkId func; -StkId top; -const Instruction*savedpc; -int nresults; -int tailcalls; -}CallInfo; -#define curr_func(L)(clvalue(L->ci->func)) -#define ci_func(ci)(clvalue((ci)->func)) -#define f_isLua(ci)(!ci_func(ci)->c.isC) -#define isLua(ci)(ttisfunction((ci)->func)&&f_isLua(ci)) -typedef struct global_State{ -stringtable strt; -lua_Alloc frealloc; -void*ud; -lu_byte currentwhite; -lu_byte gcstate; -int sweepstrgc; -GCObject*rootgc; -GCObject**sweepgc; -GCObject*gray; -GCObject*grayagain; -GCObject*weak; -GCObject*tmudata; -Mbuffer buff; -lu_mem GCthreshold; -lu_mem totalbytes; -lu_mem estimate; -lu_mem gcdept; -int gcpause; -int gcstepmul; -lua_CFunction panic; -TValue l_registry; -struct lua_State*mainthread; -UpVal uvhead; -struct Table*mt[(8+1)]; -TString*tmname[TM_N]; -}global_State; -struct lua_State{ -GCObject*next;lu_byte tt;lu_byte marked; -lu_byte status; -StkId top; -StkId base; -global_State*l_G; -CallInfo*ci; -const Instruction*savedpc; -StkId stack_last; -StkId stack; -CallInfo*end_ci; -CallInfo*base_ci; -int stacksize; -int size_ci; -unsigned short nCcalls; -unsigned short baseCcalls; -lu_byte hookmask; -lu_byte allowhook; -int basehookcount; -int hookcount; -lua_Hook hook; -TValue l_gt; -TValue env; -GCObject*openupval; -GCObject*gclist; -struct lua_longjmp*errorJmp; -ptrdiff_t errfunc; -}; -#define G(L)(L->l_G) -union GCObject{ -GCheader gch; -union TString ts; -union Udata u; -union Closure cl; -struct Table h; -struct Proto p; -struct UpVal uv; -struct lua_State th; -}; -#define rawgco2ts(o)check_exp((o)->gch.tt==4,&((o)->ts)) -#define gco2ts(o)(&rawgco2ts(o)->tsv) -#define rawgco2u(o)check_exp((o)->gch.tt==7,&((o)->u)) -#define gco2u(o)(&rawgco2u(o)->uv) -#define gco2cl(o)check_exp((o)->gch.tt==6,&((o)->cl)) -#define gco2h(o)check_exp((o)->gch.tt==5,&((o)->h)) -#define gco2p(o)check_exp((o)->gch.tt==(8+1),&((o)->p)) -#define gco2uv(o)check_exp((o)->gch.tt==(8+2),&((o)->uv)) -#define ngcotouv(o)check_exp((o)==NULL||(o)->gch.tt==(8+2),&((o)->uv)) -#define gco2th(o)check_exp((o)->gch.tt==8,&((o)->th)) -#define obj2gco(v)(cast(GCObject*,(v))) -static void luaE_freethread(lua_State*L,lua_State*L1); -#define pcRel(pc,p)(cast(int,(pc)-(p)->code)-1) -#define getline_(f,pc)(((f)->lineinfo)?(f)->lineinfo[pc]:0) -#define resethookcount(L)(L->hookcount=L->basehookcount) -static void luaG_typeerror(lua_State*L,const TValue*o, -const char*opname); -static void luaG_runerror(lua_State*L,const char*fmt,...); -#define luaD_checkstack(L,n)if((char*)L->stack_last-(char*)L->top<=(n)*(int)sizeof(TValue))luaD_growstack(L,n);else condhardstacktests(luaD_reallocstack(L,L->stacksize-5-1)); -#define incr_top(L){luaD_checkstack(L,1);L->top++;} -#define savestack(L,p)((char*)(p)-(char*)L->stack) -#define restorestack(L,n)((TValue*)((char*)L->stack+(n))) -#define saveci(L,p)((char*)(p)-(char*)L->base_ci) -#define restoreci(L,n)((CallInfo*)((char*)L->base_ci+(n))) -typedef void(*Pfunc)(lua_State*L,void*ud); -static int luaD_poscall(lua_State*L,StkId firstResult); -static void luaD_reallocCI(lua_State*L,int newsize); -static void luaD_reallocstack(lua_State*L,int newsize); -static void luaD_growstack(lua_State*L,int n); -static void luaD_throw(lua_State*L,int errcode); -static void*luaM_growaux_(lua_State*L,void*block,int*size,size_t size_elems, -int limit,const char*errormsg){ -void*newblock; -int newsize; -if(*size>=limit/2){ -if(*size>=limit) -luaG_runerror(L,errormsg); -newsize=limit; -} -else{ -newsize=(*size)*2; -if(newsize<4) -newsize=4; -} -newblock=luaM_reallocv(L,block,*size,newsize,size_elems); -*size=newsize; -return newblock; -} -static void*luaM_toobig(lua_State*L){ -luaG_runerror(L,"memory allocation error: block too big"); -return NULL; -} -static void*luaM_realloc_(lua_State*L,void*block,size_t osize,size_t nsize){ -global_State*g=G(L); -block=(*g->frealloc)(g->ud,block,osize,nsize); -if(block==NULL&&nsize>0) -luaD_throw(L,4); -g->totalbytes=(g->totalbytes-osize)+nsize; -return block; -} -#define resetbits(x,m)((x)&=cast(lu_byte,~(m))) -#define setbits(x,m)((x)|=(m)) -#define testbits(x,m)((x)&(m)) -#define bitmask(b)(1<<(b)) -#define bit2mask(b1,b2)(bitmask(b1)|bitmask(b2)) -#define l_setbit(x,b)setbits(x,bitmask(b)) -#define resetbit(x,b)resetbits(x,bitmask(b)) -#define testbit(x,b)testbits(x,bitmask(b)) -#define set2bits(x,b1,b2)setbits(x,(bit2mask(b1,b2))) -#define reset2bits(x,b1,b2)resetbits(x,(bit2mask(b1,b2))) -#define test2bits(x,b1,b2)testbits(x,(bit2mask(b1,b2))) -#define iswhite(x)test2bits((x)->gch.marked,0,1) -#define isblack(x)testbit((x)->gch.marked,2) -#define isgray(x)(!isblack(x)&&!iswhite(x)) -#define otherwhite(g)(g->currentwhite^bit2mask(0,1)) -#define isdead(g,v)((v)->gch.marked&otherwhite(g)&bit2mask(0,1)) -#define changewhite(x)((x)->gch.marked^=bit2mask(0,1)) -#define gray2black(x)l_setbit((x)->gch.marked,2) -#define valiswhite(x)(iscollectable(x)&&iswhite(gcvalue(x))) -#define luaC_white(g)cast(lu_byte,(g)->currentwhite&bit2mask(0,1)) -#define luaC_checkGC(L){condhardstacktests(luaD_reallocstack(L,L->stacksize-5-1));if(G(L)->totalbytes>=G(L)->GCthreshold)luaC_step(L);} -#define luaC_barrier(L,p,v){if(valiswhite(v)&&isblack(obj2gco(p)))luaC_barrierf(L,obj2gco(p),gcvalue(v));} -#define luaC_barriert(L,t,v){if(valiswhite(v)&&isblack(obj2gco(t)))luaC_barrierback(L,t);} -#define luaC_objbarrier(L,p,o){if(iswhite(obj2gco(o))&&isblack(obj2gco(p)))luaC_barrierf(L,obj2gco(p),obj2gco(o));} -#define luaC_objbarriert(L,t,o){if(iswhite(obj2gco(o))&&isblack(obj2gco(t)))luaC_barrierback(L,t);} -static void luaC_step(lua_State*L); -static void luaC_link(lua_State*L,GCObject*o,lu_byte tt); -static void luaC_linkupval(lua_State*L,UpVal*uv); -static void luaC_barrierf(lua_State*L,GCObject*o,GCObject*v); -static void luaC_barrierback(lua_State*L,Table*t); -#define sizestring(s)(sizeof(union TString)+((s)->len+1)*sizeof(char)) -#define sizeudata(u)(sizeof(union Udata)+(u)->len) -#define luaS_new(L,s)(luaS_newlstr(L,s,strlen(s))) -#define luaS_newliteral(L,s)(luaS_newlstr(L,""s,(sizeof(s)/sizeof(char))-1)) -#define luaS_fix(s)l_setbit((s)->tsv.marked,5) -static TString*luaS_newlstr(lua_State*L,const char*str,size_t l); -#define tostring(L,o)((ttype(o)==4)||(luaV_tostring(L,o))) -#define tonumber(o,n)(ttype(o)==3||(((o)=luaV_tonumber(o,n))!=NULL)) -#define equalobj(L,o1,o2)(ttype(o1)==ttype(o2)&&luaV_equalval(L,o1,o2)) -static int luaV_equalval(lua_State*L,const TValue*t1,const TValue*t2); -static const TValue*luaV_tonumber(const TValue*obj,TValue*n); -static int luaV_tostring(lua_State*L,StkId obj); -static void luaV_execute(lua_State*L,int nexeccalls); -static void luaV_concat(lua_State*L,int total,int last); -static const TValue luaO_nilobject_={{NULL},0}; -static int luaO_int2fb(unsigned int x){ -int e=0; -while(x>=16){ -x=(x+1)>>1; -e++; -} -if(x<8)return x; -else return((e+1)<<3)|(cast_int(x)-8); -} -static int luaO_fb2int(int x){ -int e=(x>>3)&31; -if(e==0)return x; -else return((x&7)+8)<<(e-1); -} -static int luaO_log2(unsigned int x){ -static const lu_byte log_2[256]={ -0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, -8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, -8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, -8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 -}; -int l=-1; -while(x>=256){l+=8;x>>=8;} -return l+log_2[x]; -} -static int luaO_rawequalObj(const TValue*t1,const TValue*t2){ -if(ttype(t1)!=ttype(t2))return 0; -else switch(ttype(t1)){ -case 0: -return 1; -case 3: -return luai_numeq(nvalue(t1),nvalue(t2)); -case 1: -return bvalue(t1)==bvalue(t2); -case 2: -return pvalue(t1)==pvalue(t2); -default: -return gcvalue(t1)==gcvalue(t2); -} -} -static int luaO_str2d(const char*s,lua_Number*result){ -char*endptr; -*result=lua_str2number(s,&endptr); -if(endptr==s)return 0; -if(*endptr=='x'||*endptr=='X') -*result=cast_num(strtoul(s,&endptr,16)); -if(*endptr=='\0')return 1; -while(isspace(cast(unsigned char,*endptr)))endptr++; -if(*endptr!='\0')return 0; -return 1; -} -static void pushstr(lua_State*L,const char*str){ -setsvalue(L,L->top,luaS_new(L,str)); -incr_top(L); -} -static const char*luaO_pushvfstring(lua_State*L,const char*fmt,va_list argp){ -int n=1; -pushstr(L,""); -for(;;){ -const char*e=strchr(fmt,'%'); -if(e==NULL)break; -setsvalue(L,L->top,luaS_newlstr(L,fmt,e-fmt)); -incr_top(L); -switch(*(e+1)){ -case's':{ -const char*s=va_arg(argp,char*); -if(s==NULL)s="(null)"; -pushstr(L,s); -break; -} -case'c':{ -char buff[2]; -buff[0]=cast(char,va_arg(argp,int)); -buff[1]='\0'; -pushstr(L,buff); -break; -} -case'd':{ -setnvalue(L->top,cast_num(va_arg(argp,int))); -incr_top(L); -break; -} -case'f':{ -setnvalue(L->top,cast_num(va_arg(argp,l_uacNumber))); -incr_top(L); -break; -} -case'p':{ -char buff[4*sizeof(void*)+8]; -sprintf(buff,"%p",va_arg(argp,void*)); -pushstr(L,buff); -break; -} -case'%':{ -pushstr(L,"%"); -break; -} -default:{ -char buff[3]; -buff[0]='%'; -buff[1]=*(e+1); -buff[2]='\0'; -pushstr(L,buff); -break; -} -} -n+=2; -fmt=e+2; -} -pushstr(L,fmt); -luaV_concat(L,n+1,cast_int(L->top-L->base)-1); -L->top-=n; -return svalue(L->top-1); -} -static const char*luaO_pushfstring(lua_State*L,const char*fmt,...){ -const char*msg; -va_list argp; -va_start(argp,fmt); -msg=luaO_pushvfstring(L,fmt,argp); -va_end(argp); -return msg; -} -static void luaO_chunkid(char*out,const char*source,size_t bufflen){ -if(*source=='='){ -strncpy(out,source+1,bufflen); -out[bufflen-1]='\0'; -} -else{ -if(*source=='@'){ -size_t l; -source++; -bufflen-=sizeof(" '...' "); -l=strlen(source); -strcpy(out,""); -if(l>bufflen){ -source+=(l-bufflen); -strcat(out,"..."); -} -strcat(out,source); -} -else{ -size_t len=strcspn(source,"\n\r"); -bufflen-=sizeof(" [string \"...\"] "); -if(len>bufflen)len=bufflen; -strcpy(out,"[string \""); -if(source[len]!='\0'){ -strncat(out,source,len); -strcat(out,"..."); -} -else -strcat(out,source); -strcat(out,"\"]"); -} -} -} -#define gnode(t,i)(&(t)->node[i]) -#define gkey(n)(&(n)->i_key.nk) -#define gval(n)(&(n)->i_val) -#define gnext(n)((n)->i_key.nk.next) -#define key2tval(n)(&(n)->i_key.tvk) -static TValue*luaH_setnum(lua_State*L,Table*t,int key); -static const TValue*luaH_getstr(Table*t,TString*key); -static TValue*luaH_set(lua_State*L,Table*t,const TValue*key); -static const char*const luaT_typenames[]={ -"nil","boolean","userdata","number", -"string","table","function","userdata","thread", -"proto","upval" -}; -static void luaT_init(lua_State*L){ -static const char*const luaT_eventname[]={ -"__index","__newindex", -"__gc","__mode","__eq", -"__add","__sub","__mul","__div","__mod", -"__pow","__unm","__len","__lt","__le", -"__concat","__call" -}; -int i; -for(i=0;itmname[i]=luaS_new(L,luaT_eventname[i]); -luaS_fix(G(L)->tmname[i]); -} -} -static const TValue*luaT_gettm(Table*events,TMS event,TString*ename){ -const TValue*tm=luaH_getstr(events,ename); -if(ttisnil(tm)){ -events->flags|=cast_byte(1u<metatable; -break; -case 7: -mt=uvalue(o)->metatable; -break; -default: -mt=G(L)->mt[ttype(o)]; -} -return(mt?luaH_getstr(mt,G(L)->tmname[event]):(&luaO_nilobject_)); -} -#define sizeCclosure(n)(cast(int,sizeof(CClosure))+cast(int,sizeof(TValue)*((n)-1))) -#define sizeLclosure(n)(cast(int,sizeof(LClosure))+cast(int,sizeof(TValue*)*((n)-1))) -static Closure*luaF_newCclosure(lua_State*L,int nelems,Table*e){ -Closure*c=cast(Closure*,luaM_malloc(L,sizeCclosure(nelems))); -luaC_link(L,obj2gco(c),6); -c->c.isC=1; -c->c.env=e; -c->c.nupvalues=cast_byte(nelems); -return c; -} -static Closure*luaF_newLclosure(lua_State*L,int nelems,Table*e){ -Closure*c=cast(Closure*,luaM_malloc(L,sizeLclosure(nelems))); -luaC_link(L,obj2gco(c),6); -c->l.isC=0; -c->l.env=e; -c->l.nupvalues=cast_byte(nelems); -while(nelems--)c->l.upvals[nelems]=NULL; -return c; -} -static UpVal*luaF_newupval(lua_State*L){ -UpVal*uv=luaM_new(L,UpVal); -luaC_link(L,obj2gco(uv),(8+2)); -uv->v=&uv->u.value; -setnilvalue(uv->v); -return uv; -} -static UpVal*luaF_findupval(lua_State*L,StkId level){ -global_State*g=G(L); -GCObject**pp=&L->openupval; -UpVal*p; -UpVal*uv; -while(*pp!=NULL&&(p=ngcotouv(*pp))->v>=level){ -if(p->v==level){ -if(isdead(g,obj2gco(p))) -changewhite(obj2gco(p)); -return p; -} -pp=&p->next; -} -uv=luaM_new(L,UpVal); -uv->tt=(8+2); -uv->marked=luaC_white(g); -uv->v=level; -uv->next=*pp; -*pp=obj2gco(uv); -uv->u.l.prev=&g->uvhead; -uv->u.l.next=g->uvhead.u.l.next; -uv->u.l.next->u.l.prev=uv; -g->uvhead.u.l.next=uv; -return uv; -} -static void unlinkupval(UpVal*uv){ -uv->u.l.next->u.l.prev=uv->u.l.prev; -uv->u.l.prev->u.l.next=uv->u.l.next; -} -static void luaF_freeupval(lua_State*L,UpVal*uv){ -if(uv->v!=&uv->u.value) -unlinkupval(uv); -luaM_free(L,uv); -} -static void luaF_close(lua_State*L,StkId level){ -UpVal*uv; -global_State*g=G(L); -while(L->openupval!=NULL&&(uv=ngcotouv(L->openupval))->v>=level){ -GCObject*o=obj2gco(uv); -L->openupval=uv->next; -if(isdead(g,o)) -luaF_freeupval(L,uv); -else{ -unlinkupval(uv); -setobj(L,&uv->u.value,uv->v); -uv->v=&uv->u.value; -luaC_linkupval(L,uv); -} -} -} -static Proto*luaF_newproto(lua_State*L){ -Proto*f=luaM_new(L,Proto); -luaC_link(L,obj2gco(f),(8+1)); -f->k=NULL; -f->sizek=0; -f->p=NULL; -f->sizep=0; -f->code=NULL; -f->sizecode=0; -f->sizelineinfo=0; -f->sizeupvalues=0; -f->nups=0; -f->upvalues=NULL; -f->numparams=0; -f->is_vararg=0; -f->maxstacksize=0; -f->lineinfo=NULL; -f->sizelocvars=0; -f->locvars=NULL; -f->linedefined=0; -f->lastlinedefined=0; -f->source=NULL; -return f; -} -static void luaF_freeproto(lua_State*L,Proto*f){ -luaM_freearray(L,f->code,f->sizecode,Instruction); -luaM_freearray(L,f->p,f->sizep,Proto*); -luaM_freearray(L,f->k,f->sizek,TValue); -luaM_freearray(L,f->lineinfo,f->sizelineinfo,int); -luaM_freearray(L,f->locvars,f->sizelocvars,struct LocVar); -luaM_freearray(L,f->upvalues,f->sizeupvalues,TString*); -luaM_free(L,f); -} -static void luaF_freeclosure(lua_State*L,Closure*c){ -int size=(c->c.isC)?sizeCclosure(c->c.nupvalues): -sizeLclosure(c->l.nupvalues); -luaM_freemem(L,c,size); -} -#define MASK1(n,p)((~((~(Instruction)0)<>0)&MASK1(6,0))) -#define SET_OPCODE(i,o)((i)=(((i)&MASK0(6,0))|((cast(Instruction,o)<<0)&MASK1(6,0)))) -#define GETARG_A(i)(cast(int,((i)>>(0+6))&MASK1(8,0))) -#define SETARG_A(i,u)((i)=(((i)&MASK0(8,(0+6)))|((cast(Instruction,u)<<(0+6))&MASK1(8,(0+6))))) -#define GETARG_B(i)(cast(int,((i)>>(((0+6)+8)+9))&MASK1(9,0))) -#define SETARG_B(i,b)((i)=(((i)&MASK0(9,(((0+6)+8)+9)))|((cast(Instruction,b)<<(((0+6)+8)+9))&MASK1(9,(((0+6)+8)+9))))) -#define GETARG_C(i)(cast(int,((i)>>((0+6)+8))&MASK1(9,0))) -#define SETARG_C(i,b)((i)=(((i)&MASK0(9,((0+6)+8)))|((cast(Instruction,b)<<((0+6)+8))&MASK1(9,((0+6)+8))))) -#define GETARG_Bx(i)(cast(int,((i)>>((0+6)+8))&MASK1((9+9),0))) -#define SETARG_Bx(i,b)((i)=(((i)&MASK0((9+9),((0+6)+8)))|((cast(Instruction,b)<<((0+6)+8))&MASK1((9+9),((0+6)+8))))) -#define GETARG_sBx(i)(GETARG_Bx(i)-(((1<<(9+9))-1)>>1)) -#define SETARG_sBx(i,b)SETARG_Bx((i),cast(unsigned int,(b)+(((1<<(9+9))-1)>>1))) -#define CREATE_ABC(o,a,b,c)((cast(Instruction,o)<<0)|(cast(Instruction,a)<<(0+6))|(cast(Instruction,b)<<(((0+6)+8)+9))|(cast(Instruction,c)<<((0+6)+8))) -#define CREATE_ABx(o,a,bc)((cast(Instruction,o)<<0)|(cast(Instruction,a)<<(0+6))|(cast(Instruction,bc)<<((0+6)+8))) -#define ISK(x)((x)&(1<<(9-1))) -#define INDEXK(r)((int)(r)&~(1<<(9-1))) -#define RKASK(x)((x)|(1<<(9-1))) -static const lu_byte luaP_opmodes[(cast(int,OP_VARARG)+1)]; -#define getBMode(m)(cast(enum OpArgMask,(luaP_opmodes[m]>>4)&3)) -#define getCMode(m)(cast(enum OpArgMask,(luaP_opmodes[m]>>2)&3)) -#define testTMode(m)(luaP_opmodes[m]&(1<<7)) -typedef struct expdesc{ -expkind k; -union{ -struct{int info,aux;}s; -lua_Number nval; -}u; -int t; -int f; -}expdesc; -typedef struct upvaldesc{ -lu_byte k; -lu_byte info; -}upvaldesc; -struct BlockCnt; -typedef struct FuncState{ -Proto*f; -Table*h; -struct FuncState*prev; -struct LexState*ls; -struct lua_State*L; -struct BlockCnt*bl; -int pc; -int lasttarget; -int jpc; -int freereg; -int nk; -int np; -short nlocvars; -lu_byte nactvar; -upvaldesc upvalues[60]; -unsigned short actvar[200]; -}FuncState; -static Proto*luaY_parser(lua_State*L,ZIO*z,Mbuffer*buff, -const char*name); -struct lua_longjmp{ -struct lua_longjmp*previous; -jmp_buf b; -volatile int status; -}; -static void luaD_seterrorobj(lua_State*L,int errcode,StkId oldtop){ -switch(errcode){ -case 4:{ -setsvalue(L,oldtop,luaS_newliteral(L,"not enough memory")); -break; -} -case 5:{ -setsvalue(L,oldtop,luaS_newliteral(L,"error in error handling")); -break; -} -case 3: -case 2:{ -setobj(L,oldtop,L->top-1); -break; -} -} -L->top=oldtop+1; -} -static void restore_stack_limit(lua_State*L){ -if(L->size_ci>20000){ -int inuse=cast_int(L->ci-L->base_ci); -if(inuse+1<20000) -luaD_reallocCI(L,20000); -} -} -static void resetstack(lua_State*L,int status){ -L->ci=L->base_ci; -L->base=L->ci->base; -luaF_close(L,L->base); -luaD_seterrorobj(L,status,L->base); -L->nCcalls=L->baseCcalls; -L->allowhook=1; -restore_stack_limit(L); -L->errfunc=0; -L->errorJmp=NULL; -} -static void luaD_throw(lua_State*L,int errcode){ -if(L->errorJmp){ -L->errorJmp->status=errcode; -LUAI_THROW(L,L->errorJmp); -} -else{ -L->status=cast_byte(errcode); -if(G(L)->panic){ -resetstack(L,errcode); -G(L)->panic(L); -} -exit(EXIT_FAILURE); -} -} -static int luaD_rawrunprotected(lua_State*L,Pfunc f,void*ud){ -struct lua_longjmp lj; -lj.status=0; -lj.previous=L->errorJmp; -L->errorJmp=&lj; -LUAI_TRY(L,&lj, -(*f)(L,ud); -); -L->errorJmp=lj.previous; -return lj.status; -} -static void correctstack(lua_State*L,TValue*oldstack){ -CallInfo*ci; -GCObject*up; -L->top=(L->top-oldstack)+L->stack; -for(up=L->openupval;up!=NULL;up=up->gch.next) -gco2uv(up)->v=(gco2uv(up)->v-oldstack)+L->stack; -for(ci=L->base_ci;ci<=L->ci;ci++){ -ci->top=(ci->top-oldstack)+L->stack; -ci->base=(ci->base-oldstack)+L->stack; -ci->func=(ci->func-oldstack)+L->stack; -} -L->base=(L->base-oldstack)+L->stack; -} -static void luaD_reallocstack(lua_State*L,int newsize){ -TValue*oldstack=L->stack; -int realsize=newsize+1+5; -luaM_reallocvector(L,L->stack,L->stacksize,realsize,TValue); -L->stacksize=realsize; -L->stack_last=L->stack+newsize; -correctstack(L,oldstack); -} -static void luaD_reallocCI(lua_State*L,int newsize){ -CallInfo*oldci=L->base_ci; -luaM_reallocvector(L,L->base_ci,L->size_ci,newsize,CallInfo); -L->size_ci=newsize; -L->ci=(L->ci-oldci)+L->base_ci; -L->end_ci=L->base_ci+L->size_ci-1; -} -static void luaD_growstack(lua_State*L,int n){ -if(n<=L->stacksize) -luaD_reallocstack(L,2*L->stacksize); -else -luaD_reallocstack(L,L->stacksize+n); -} -static CallInfo*growCI(lua_State*L){ -if(L->size_ci>20000) -luaD_throw(L,5); -else{ -luaD_reallocCI(L,2*L->size_ci); -if(L->size_ci>20000) -luaG_runerror(L,"stack overflow"); -} -return++L->ci; -} -static StkId adjust_varargs(lua_State*L,Proto*p,int actual){ -int i; -int nfixargs=p->numparams; -Table*htab=NULL; -StkId base,fixed; -for(;actualtop++); -fixed=L->top-actual; -base=L->top; -for(i=0;itop++,fixed+i); -setnilvalue(fixed+i); -} -if(htab){ -sethvalue(L,L->top++,htab); -} -return base; -} -static StkId tryfuncTM(lua_State*L,StkId func){ -const TValue*tm=luaT_gettmbyobj(L,func,TM_CALL); -StkId p; -ptrdiff_t funcr=savestack(L,func); -if(!ttisfunction(tm)) -luaG_typeerror(L,func,"call"); -for(p=L->top;p>func;p--)setobj(L,p,p-1); -incr_top(L); -func=restorestack(L,funcr); -setobj(L,func,tm); -return func; -} -#define inc_ci(L)((L->ci==L->end_ci)?growCI(L):(condhardstacktests(luaD_reallocCI(L,L->size_ci)),++L->ci)) -static int luaD_precall(lua_State*L,StkId func,int nresults){ -LClosure*cl; -ptrdiff_t funcr; -if(!ttisfunction(func)) -func=tryfuncTM(L,func); -funcr=savestack(L,func); -cl=&clvalue(func)->l; -L->ci->savedpc=L->savedpc; -if(!cl->isC){ -CallInfo*ci; -StkId st,base; -Proto*p=cl->p; -luaD_checkstack(L,p->maxstacksize); -func=restorestack(L,funcr); -if(!p->is_vararg){ -base=func+1; -if(L->top>base+p->numparams) -L->top=base+p->numparams; -} -else{ -int nargs=cast_int(L->top-func)-1; -base=adjust_varargs(L,p,nargs); -func=restorestack(L,funcr); -} -ci=inc_ci(L); -ci->func=func; -L->base=ci->base=base; -ci->top=L->base+p->maxstacksize; -L->savedpc=p->code; -ci->tailcalls=0; -ci->nresults=nresults; -for(st=L->top;sttop;st++) -setnilvalue(st); -L->top=ci->top; -return 0; -} -else{ -CallInfo*ci; -int n; -luaD_checkstack(L,20); -ci=inc_ci(L); -ci->func=restorestack(L,funcr); -L->base=ci->base=ci->func+1; -ci->top=L->top+20; -ci->nresults=nresults; -n=(*curr_func(L)->c.f)(L); -if(n<0) -return 2; -else{ -luaD_poscall(L,L->top-n); -return 1; -} -} -} -static int luaD_poscall(lua_State*L,StkId firstResult){ -StkId res; -int wanted,i; -CallInfo*ci; -ci=L->ci--; -res=ci->func; -wanted=ci->nresults; -L->base=(ci-1)->base; -L->savedpc=(ci-1)->savedpc; -for(i=wanted;i!=0&&firstResulttop;i--) -setobj(L,res++,firstResult++); -while(i-->0) -setnilvalue(res++); -L->top=res; -return(wanted-(-1)); -} -static void luaD_call(lua_State*L,StkId func,int nResults){ -if(++L->nCcalls>=200){ -if(L->nCcalls==200) -luaG_runerror(L,"C stack overflow"); -else if(L->nCcalls>=(200+(200>>3))) -luaD_throw(L,5); -} -if(luaD_precall(L,func,nResults)==0) -luaV_execute(L,1); -L->nCcalls--; -luaC_checkGC(L); -} -static int luaD_pcall(lua_State*L,Pfunc func,void*u, -ptrdiff_t old_top,ptrdiff_t ef){ -int status; -unsigned short oldnCcalls=L->nCcalls; -ptrdiff_t old_ci=saveci(L,L->ci); -lu_byte old_allowhooks=L->allowhook; -ptrdiff_t old_errfunc=L->errfunc; -L->errfunc=ef; -status=luaD_rawrunprotected(L,func,u); -if(status!=0){ -StkId oldtop=restorestack(L,old_top); -luaF_close(L,oldtop); -luaD_seterrorobj(L,status,oldtop); -L->nCcalls=oldnCcalls; -L->ci=restoreci(L,old_ci); -L->base=L->ci->base; -L->savedpc=L->ci->savedpc; -L->allowhook=old_allowhooks; -restore_stack_limit(L); -} -L->errfunc=old_errfunc; -return status; -} -struct SParser{ -ZIO*z; -Mbuffer buff; -const char*name; -}; -static void f_parser(lua_State*L,void*ud){ -int i; -Proto*tf; -Closure*cl; -struct SParser*p=cast(struct SParser*,ud); -luaC_checkGC(L); -tf=luaY_parser(L,p->z, -&p->buff,p->name); -cl=luaF_newLclosure(L,tf->nups,hvalue(gt(L))); -cl->l.p=tf; -for(i=0;inups;i++) -cl->l.upvals[i]=luaF_newupval(L); -setclvalue(L,L->top,cl); -incr_top(L); -} -static int luaD_protectedparser(lua_State*L,ZIO*z,const char*name){ -struct SParser p; -int status; -p.z=z;p.name=name; -luaZ_initbuffer(L,&p.buff); -status=luaD_pcall(L,f_parser,&p,savestack(L,L->top),L->errfunc); -luaZ_freebuffer(L,&p.buff); -return status; -} -static void luaS_resize(lua_State*L,int newsize){ -GCObject**newhash; -stringtable*tb; -int i; -if(G(L)->gcstate==2) -return; -newhash=luaM_newvector(L,newsize,GCObject*); -tb=&G(L)->strt; -for(i=0;isize;i++){ -GCObject*p=tb->hash[i]; -while(p){ -GCObject*next=p->gch.next; -unsigned int h=gco2ts(p)->hash; -int h1=lmod(h,newsize); -p->gch.next=newhash[h1]; -newhash[h1]=p; -p=next; -} -} -luaM_freearray(L,tb->hash,tb->size,TString*); -tb->size=newsize; -tb->hash=newhash; -} -static TString*newlstr(lua_State*L,const char*str,size_t l, -unsigned int h){ -TString*ts; -stringtable*tb; -if(l+1>(((size_t)(~(size_t)0)-2)-sizeof(TString))/sizeof(char)) -luaM_toobig(L); -ts=cast(TString*,luaM_malloc(L,(l+1)*sizeof(char)+sizeof(TString))); -ts->tsv.len=l; -ts->tsv.hash=h; -ts->tsv.marked=luaC_white(G(L)); -ts->tsv.tt=4; -ts->tsv.reserved=0; -memcpy(ts+1,str,l*sizeof(char)); -((char*)(ts+1))[l]='\0'; -tb=&G(L)->strt; -h=lmod(h,tb->size); -ts->tsv.next=tb->hash[h]; -tb->hash[h]=obj2gco(ts); -tb->nuse++; -if(tb->nuse>cast(lu_int32,tb->size)&&tb->size<=(INT_MAX-2)/2) -luaS_resize(L,tb->size*2); -return ts; -} -static TString*luaS_newlstr(lua_State*L,const char*str,size_t l){ -GCObject*o; -unsigned int h=cast(unsigned int,l); -size_t step=(l>>5)+1; -size_t l1; -for(l1=l;l1>=step;l1-=step) -h=h^((h<<5)+(h>>2)+cast(unsigned char,str[l1-1])); -for(o=G(L)->strt.hash[lmod(h,G(L)->strt.size)]; -o!=NULL; -o=o->gch.next){ -TString*ts=rawgco2ts(o); -if(ts->tsv.len==l&&(memcmp(str,getstr(ts),l)==0)){ -if(isdead(G(L),o))changewhite(o); -return ts; -} -} -return newlstr(L,str,l,h); -} -static Udata*luaS_newudata(lua_State*L,size_t s,Table*e){ -Udata*u; -if(s>((size_t)(~(size_t)0)-2)-sizeof(Udata)) -luaM_toobig(L); -u=cast(Udata*,luaM_malloc(L,s+sizeof(Udata))); -u->uv.marked=luaC_white(G(L)); -u->uv.tt=7; -u->uv.len=s; -u->uv.metatable=NULL; -u->uv.env=e; -u->uv.next=G(L)->mainthread->next; -G(L)->mainthread->next=obj2gco(u); -return u; -} -#define hashpow2(t,n)(gnode(t,lmod((n),sizenode(t)))) -#define hashstr(t,str)hashpow2(t,(str)->tsv.hash) -#define hashboolean(t,p)hashpow2(t,p) -#define hashmod(t,n)(gnode(t,((n)%((sizenode(t)-1)|1)))) -#define hashpointer(t,p)hashmod(t,IntPoint(p)) -static const Node dummynode_={ -{{NULL},0}, -{{{NULL},0,NULL}} -}; -static Node*hashnum(const Table*t,lua_Number n){ -unsigned int a[cast_int(sizeof(lua_Number)/sizeof(int))]; -int i; -if(luai_numeq(n,0)) -return gnode(t,0); -memcpy(a,&n,sizeof(a)); -for(i=1;isizearray) -return i-1; -else{ -Node*n=mainposition(t,key); -do{ -if(luaO_rawequalObj(key2tval(n),key)|| -(ttype(gkey(n))==(8+3)&&iscollectable(key)&& -gcvalue(gkey(n))==gcvalue(key))){ -i=cast_int(n-gnode(t,0)); -return i+t->sizearray; -} -else n=gnext(n); -}while(n); -luaG_runerror(L,"invalid key to "LUA_QL("next")); -return 0; -} -} -static int luaH_next(lua_State*L,Table*t,StkId key){ -int i=findindex(L,t,key); -for(i++;isizearray;i++){ -if(!ttisnil(&t->array[i])){ -setnvalue(key,cast_num(i+1)); -setobj(L,key+1,&t->array[i]); -return 1; -} -} -for(i-=t->sizearray;i<(int)sizenode(t);i++){ -if(!ttisnil(gval(gnode(t,i)))){ -setobj(L,key,key2tval(gnode(t,i))); -setobj(L,key+1,gval(gnode(t,i))); -return 1; -} -} -return 0; -} -static int computesizes(int nums[],int*narray){ -int i; -int twotoi; -int a=0; -int na=0; -int n=0; -for(i=0,twotoi=1;twotoi/2<*narray;i++,twotoi*=2){ -if(nums[i]>0){ -a+=nums[i]; -if(a>twotoi/2){ -n=twotoi; -na=a; -} -} -if(a==*narray)break; -} -*narray=n; -return na; -} -static int countint(const TValue*key,int*nums){ -int k=arrayindex(key); -if(0t->sizearray){ -lim=t->sizearray; -if(i>lim) -break; -} -for(;i<=lim;i++){ -if(!ttisnil(&t->array[i-1])) -lc++; -} -nums[lg]+=lc; -ause+=lc; -} -return ause; -} -static int numusehash(const Table*t,int*nums,int*pnasize){ -int totaluse=0; -int ause=0; -int i=sizenode(t); -while(i--){ -Node*n=&t->node[i]; -if(!ttisnil(gval(n))){ -ause+=countint(key2tval(n),nums); -totaluse++; -} -} -*pnasize+=ause; -return totaluse; -} -static void setarrayvector(lua_State*L,Table*t,int size){ -int i; -luaM_reallocvector(L,t->array,t->sizearray,size,TValue); -for(i=t->sizearray;iarray[i]); -t->sizearray=size; -} -static void setnodevector(lua_State*L,Table*t,int size){ -int lsize; -if(size==0){ -t->node=cast(Node*,(&dummynode_)); -lsize=0; -} -else{ -int i; -lsize=ceillog2(size); -if(lsize>(32-2)) -luaG_runerror(L,"table overflow"); -size=twoto(lsize); -t->node=luaM_newvector(L,size,Node); -for(i=0;ilsizenode=cast_byte(lsize); -t->lastfree=gnode(t,size); -} -static void resize(lua_State*L,Table*t,int nasize,int nhsize){ -int i; -int oldasize=t->sizearray; -int oldhsize=t->lsizenode; -Node*nold=t->node; -if(nasize>oldasize) -setarrayvector(L,t,nasize); -setnodevector(L,t,nhsize); -if(nasizesizearray=nasize; -for(i=nasize;iarray[i])) -setobj(L,luaH_setnum(L,t,i+1),&t->array[i]); -} -luaM_reallocvector(L,t->array,oldasize,nasize,TValue); -} -for(i=twoto(oldhsize)-1;i>=0;i--){ -Node*old=nold+i; -if(!ttisnil(gval(old))) -setobj(L,luaH_set(L,t,key2tval(old)),gval(old)); -} -if(nold!=(&dummynode_)) -luaM_freearray(L,nold,twoto(oldhsize),Node); -} -static void luaH_resizearray(lua_State*L,Table*t,int nasize){ -int nsize=(t->node==(&dummynode_))?0:sizenode(t); -resize(L,t,nasize,nsize); -} -static void rehash(lua_State*L,Table*t,const TValue*ek){ -int nasize,na; -int nums[(32-2)+1]; -int i; -int totaluse; -for(i=0;i<=(32-2);i++)nums[i]=0; -nasize=numusearray(t,nums); -totaluse=nasize; -totaluse+=numusehash(t,nums,&nasize); -nasize+=countint(ek,nums); -totaluse++; -na=computesizes(nums,&nasize); -resize(L,t,nasize,totaluse-na); -} -static Table*luaH_new(lua_State*L,int narray,int nhash){ -Table*t=luaM_new(L,Table); -luaC_link(L,obj2gco(t),5); -t->metatable=NULL; -t->flags=cast_byte(~0); -t->array=NULL; -t->sizearray=0; -t->lsizenode=0; -t->node=cast(Node*,(&dummynode_)); -setarrayvector(L,t,narray); -setnodevector(L,t,nhash); -return t; -} -static void luaH_free(lua_State*L,Table*t){ -if(t->node!=(&dummynode_)) -luaM_freearray(L,t->node,sizenode(t),Node); -luaM_freearray(L,t->array,t->sizearray,TValue); -luaM_free(L,t); -} -static Node*getfreepos(Table*t){ -while(t->lastfree-->t->node){ -if(ttisnil(gkey(t->lastfree))) -return t->lastfree; -} -return NULL; -} -static TValue*newkey(lua_State*L,Table*t,const TValue*key){ -Node*mp=mainposition(t,key); -if(!ttisnil(gval(mp))||mp==(&dummynode_)){ -Node*othern; -Node*n=getfreepos(t); -if(n==NULL){ -rehash(L,t,key); -return luaH_set(L,t,key); -} -othern=mainposition(t,key2tval(mp)); -if(othern!=mp){ -while(gnext(othern)!=mp)othern=gnext(othern); -gnext(othern)=n; -*n=*mp; -gnext(mp)=NULL; -setnilvalue(gval(mp)); -} -else{ -gnext(n)=gnext(mp); -gnext(mp)=n; -mp=n; -} -} -gkey(mp)->value=key->value;gkey(mp)->tt=key->tt; -luaC_barriert(L,t,key); -return gval(mp); -} -static const TValue*luaH_getnum(Table*t,int key){ -if(cast(unsigned int,key)-1sizearray)) -return&t->array[key-1]; -else{ -lua_Number nk=cast_num(key); -Node*n=hashnum(t,nk); -do{ -if(ttisnumber(gkey(n))&&luai_numeq(nvalue(gkey(n)),nk)) -return gval(n); -else n=gnext(n); -}while(n); -return(&luaO_nilobject_); -} -} -static const TValue*luaH_getstr(Table*t,TString*key){ -Node*n=hashstr(t,key); -do{ -if(ttisstring(gkey(n))&&rawtsvalue(gkey(n))==key) -return gval(n); -else n=gnext(n); -}while(n); -return(&luaO_nilobject_); -} -static const TValue*luaH_get(Table*t,const TValue*key){ -switch(ttype(key)){ -case 0:return(&luaO_nilobject_); -case 4:return luaH_getstr(t,rawtsvalue(key)); -case 3:{ -int k; -lua_Number n=nvalue(key); -lua_number2int(k,n); -if(luai_numeq(cast_num(k),nvalue(key))) -return luaH_getnum(t,k); -} -default:{ -Node*n=mainposition(t,key); -do{ -if(luaO_rawequalObj(key2tval(n),key)) -return gval(n); -else n=gnext(n); -}while(n); -return(&luaO_nilobject_); -} -} -} -static TValue*luaH_set(lua_State*L,Table*t,const TValue*key){ -const TValue*p=luaH_get(t,key); -t->flags=0; -if(p!=(&luaO_nilobject_)) -return cast(TValue*,p); -else{ -if(ttisnil(key))luaG_runerror(L,"table index is nil"); -else if(ttisnumber(key)&&luai_numisnan(nvalue(key))) -luaG_runerror(L,"table index is NaN"); -return newkey(L,t,key); -} -} -static TValue*luaH_setnum(lua_State*L,Table*t,int key){ -const TValue*p=luaH_getnum(t,key); -if(p!=(&luaO_nilobject_)) -return cast(TValue*,p); -else{ -TValue k; -setnvalue(&k,cast_num(key)); -return newkey(L,t,&k); -} -} -static TValue*luaH_setstr(lua_State*L,Table*t,TString*key){ -const TValue*p=luaH_getstr(t,key); -if(p!=(&luaO_nilobject_)) -return cast(TValue*,p); -else{ -TValue k; -setsvalue(L,&k,key); -return newkey(L,t,&k); -} -} -static int unbound_search(Table*t,unsigned int j){ -unsigned int i=j; -j++; -while(!ttisnil(luaH_getnum(t,j))){ -i=j; -j*=2; -if(j>cast(unsigned int,(INT_MAX-2))){ -i=1; -while(!ttisnil(luaH_getnum(t,i)))i++; -return i-1; -} -} -while(j-i>1){ -unsigned int m=(i+j)/2; -if(ttisnil(luaH_getnum(t,m)))j=m; -else i=m; -} -return i; -} -static int luaH_getn(Table*t){ -unsigned int j=t->sizearray; -if(j>0&&ttisnil(&t->array[j-1])){ -unsigned int i=0; -while(j-i>1){ -unsigned int m=(i+j)/2; -if(ttisnil(&t->array[m-1]))j=m; -else i=m; -} -return i; -} -else if(t->node==(&dummynode_)) -return j; -else return unbound_search(t,j); -} -#define makewhite(g,x)((x)->gch.marked=cast_byte(((x)->gch.marked&cast_byte(~(bitmask(2)|bit2mask(0,1))))|luaC_white(g))) -#define white2gray(x)reset2bits((x)->gch.marked,0,1) -#define black2gray(x)resetbit((x)->gch.marked,2) -#define stringmark(s)reset2bits((s)->tsv.marked,0,1) -#define isfinalized(u)testbit((u)->marked,3) -#define markfinalized(u)l_setbit((u)->marked,3) -#define markvalue(g,o){checkconsistency(o);if(iscollectable(o)&&iswhite(gcvalue(o)))reallymarkobject(g,gcvalue(o));} -#define markobject(g,t){if(iswhite(obj2gco(t)))reallymarkobject(g,obj2gco(t));} -#define setthreshold(g)(g->GCthreshold=(g->estimate/100)*g->gcpause) -static void removeentry(Node*n){ -if(iscollectable(gkey(n))) -setttype(gkey(n),(8+3)); -} -static void reallymarkobject(global_State*g,GCObject*o){ -white2gray(o); -switch(o->gch.tt){ -case 4:{ -return; -} -case 7:{ -Table*mt=gco2u(o)->metatable; -gray2black(o); -if(mt)markobject(g,mt); -markobject(g,gco2u(o)->env); -return; -} -case(8+2):{ -UpVal*uv=gco2uv(o); -markvalue(g,uv->v); -if(uv->v==&uv->u.value) -gray2black(o); -return; -} -case 6:{ -gco2cl(o)->c.gclist=g->gray; -g->gray=o; -break; -} -case 5:{ -gco2h(o)->gclist=g->gray; -g->gray=o; -break; -} -case 8:{ -gco2th(o)->gclist=g->gray; -g->gray=o; -break; -} -case(8+1):{ -gco2p(o)->gclist=g->gray; -g->gray=o; -break; -} -default:; -} -} -static void marktmu(global_State*g){ -GCObject*u=g->tmudata; -if(u){ -do{ -u=u->gch.next; -makewhite(g,u); -reallymarkobject(g,u); -}while(u!=g->tmudata); -} -} -static size_t luaC_separateudata(lua_State*L,int all){ -global_State*g=G(L); -size_t deadmem=0; -GCObject**p=&g->mainthread->next; -GCObject*curr; -while((curr=*p)!=NULL){ -if(!(iswhite(curr)||all)||isfinalized(gco2u(curr))) -p=&curr->gch.next; -else if(fasttm(L,gco2u(curr)->metatable,TM_GC)==NULL){ -markfinalized(gco2u(curr)); -p=&curr->gch.next; -} -else{ -deadmem+=sizeudata(gco2u(curr)); -markfinalized(gco2u(curr)); -*p=curr->gch.next; -if(g->tmudata==NULL) -g->tmudata=curr->gch.next=curr; -else{ -curr->gch.next=g->tmudata->gch.next; -g->tmudata->gch.next=curr; -g->tmudata=curr; -} -} -} -return deadmem; -} -static int traversetable(global_State*g,Table*h){ -int i; -int weakkey=0; -int weakvalue=0; -const TValue*mode; -if(h->metatable) -markobject(g,h->metatable); -mode=gfasttm(g,h->metatable,TM_MODE); -if(mode&&ttisstring(mode)){ -weakkey=(strchr(svalue(mode),'k')!=NULL); -weakvalue=(strchr(svalue(mode),'v')!=NULL); -if(weakkey||weakvalue){ -h->marked&=~(bitmask(3)|bitmask(4)); -h->marked|=cast_byte((weakkey<<3)| -(weakvalue<<4)); -h->gclist=g->weak; -g->weak=obj2gco(h); -} -} -if(weakkey&&weakvalue)return 1; -if(!weakvalue){ -i=h->sizearray; -while(i--) -markvalue(g,&h->array[i]); -} -i=sizenode(h); -while(i--){ -Node*n=gnode(h,i); -if(ttisnil(gval(n))) -removeentry(n); -else{ -if(!weakkey)markvalue(g,gkey(n)); -if(!weakvalue)markvalue(g,gval(n)); -} -} -return weakkey||weakvalue; -} -static void traverseproto(global_State*g,Proto*f){ -int i; -if(f->source)stringmark(f->source); -for(i=0;isizek;i++) -markvalue(g,&f->k[i]); -for(i=0;isizeupvalues;i++){ -if(f->upvalues[i]) -stringmark(f->upvalues[i]); -} -for(i=0;isizep;i++){ -if(f->p[i]) -markobject(g,f->p[i]); -} -for(i=0;isizelocvars;i++){ -if(f->locvars[i].varname) -stringmark(f->locvars[i].varname); -} -} -static void traverseclosure(global_State*g,Closure*cl){ -markobject(g,cl->c.env); -if(cl->c.isC){ -int i; -for(i=0;ic.nupvalues;i++) -markvalue(g,&cl->c.upvalue[i]); -} -else{ -int i; -markobject(g,cl->l.p); -for(i=0;il.nupvalues;i++) -markobject(g,cl->l.upvals[i]); -} -} -static void checkstacksizes(lua_State*L,StkId max){ -int ci_used=cast_int(L->ci-L->base_ci); -int s_used=cast_int(max-L->stack); -if(L->size_ci>20000) -return; -if(4*ci_usedsize_ci&&2*8size_ci) -luaD_reallocCI(L,L->size_ci/2); -condhardstacktests(luaD_reallocCI(L,ci_used+1)); -if(4*s_usedstacksize&& -2*((2*20)+5)stacksize) -luaD_reallocstack(L,L->stacksize/2); -condhardstacktests(luaD_reallocstack(L,s_used)); -} -static void traversestack(global_State*g,lua_State*l){ -StkId o,lim; -CallInfo*ci; -markvalue(g,gt(l)); -lim=l->top; -for(ci=l->base_ci;ci<=l->ci;ci++){ -if(limtop)lim=ci->top; -} -for(o=l->stack;otop;o++) -markvalue(g,o); -for(;o<=lim;o++) -setnilvalue(o); -checkstacksizes(l,lim); -} -static l_mem propagatemark(global_State*g){ -GCObject*o=g->gray; -gray2black(o); -switch(o->gch.tt){ -case 5:{ -Table*h=gco2h(o); -g->gray=h->gclist; -if(traversetable(g,h)) -black2gray(o); -return sizeof(Table)+sizeof(TValue)*h->sizearray+ -sizeof(Node)*sizenode(h); -} -case 6:{ -Closure*cl=gco2cl(o); -g->gray=cl->c.gclist; -traverseclosure(g,cl); -return(cl->c.isC)?sizeCclosure(cl->c.nupvalues): -sizeLclosure(cl->l.nupvalues); -} -case 8:{ -lua_State*th=gco2th(o); -g->gray=th->gclist; -th->gclist=g->grayagain; -g->grayagain=o; -black2gray(o); -traversestack(g,th); -return sizeof(lua_State)+sizeof(TValue)*th->stacksize+ -sizeof(CallInfo)*th->size_ci; -} -case(8+1):{ -Proto*p=gco2p(o); -g->gray=p->gclist; -traverseproto(g,p); -return sizeof(Proto)+sizeof(Instruction)*p->sizecode+ -sizeof(Proto*)*p->sizep+ -sizeof(TValue)*p->sizek+ -sizeof(int)*p->sizelineinfo+ -sizeof(LocVar)*p->sizelocvars+ -sizeof(TString*)*p->sizeupvalues; -} -default:return 0; -} -} -static size_t propagateall(global_State*g){ -size_t m=0; -while(g->gray)m+=propagatemark(g); -return m; -} -static int iscleared(const TValue*o,int iskey){ -if(!iscollectable(o))return 0; -if(ttisstring(o)){ -stringmark(rawtsvalue(o)); -return 0; -} -return iswhite(gcvalue(o))|| -(ttisuserdata(o)&&(!iskey&&isfinalized(uvalue(o)))); -} -static void cleartable(GCObject*l){ -while(l){ -Table*h=gco2h(l); -int i=h->sizearray; -if(testbit(h->marked,4)){ -while(i--){ -TValue*o=&h->array[i]; -if(iscleared(o,0)) -setnilvalue(o); -} -} -i=sizenode(h); -while(i--){ -Node*n=gnode(h,i); -if(!ttisnil(gval(n))&& -(iscleared(key2tval(n),1)||iscleared(gval(n),0))){ -setnilvalue(gval(n)); -removeentry(n); -} -} -l=h->gclist; -} -} -static void freeobj(lua_State*L,GCObject*o){ -switch(o->gch.tt){ -case(8+1):luaF_freeproto(L,gco2p(o));break; -case 6:luaF_freeclosure(L,gco2cl(o));break; -case(8+2):luaF_freeupval(L,gco2uv(o));break; -case 5:luaH_free(L,gco2h(o));break; -case 8:{ -luaE_freethread(L,gco2th(o)); -break; -} -case 4:{ -G(L)->strt.nuse--; -luaM_freemem(L,o,sizestring(gco2ts(o))); -break; -} -case 7:{ -luaM_freemem(L,o,sizeudata(gco2u(o))); -break; -} -default:; -} -} -#define sweepwholelist(L,p)sweeplist(L,p,((lu_mem)(~(lu_mem)0)-2)) -static GCObject**sweeplist(lua_State*L,GCObject**p,lu_mem count){ -GCObject*curr; -global_State*g=G(L); -int deadmask=otherwhite(g); -while((curr=*p)!=NULL&&count-->0){ -if(curr->gch.tt==8) -sweepwholelist(L,&gco2th(curr)->openupval); -if((curr->gch.marked^bit2mask(0,1))&deadmask){ -makewhite(g,curr); -p=&curr->gch.next; -} -else{ -*p=curr->gch.next; -if(curr==g->rootgc) -g->rootgc=curr->gch.next; -freeobj(L,curr); -} -} -return p; -} -static void checkSizes(lua_State*L){ -global_State*g=G(L); -if(g->strt.nusestrt.size/4)&& -g->strt.size>32*2) -luaS_resize(L,g->strt.size/2); -if(luaZ_sizebuffer(&g->buff)>32*2){ -size_t newsize=luaZ_sizebuffer(&g->buff)/2; -luaZ_resizebuffer(L,&g->buff,newsize); -} -} -static void GCTM(lua_State*L){ -global_State*g=G(L); -GCObject*o=g->tmudata->gch.next; -Udata*udata=rawgco2u(o); -const TValue*tm; -if(o==g->tmudata) -g->tmudata=NULL; -else -g->tmudata->gch.next=udata->uv.next; -udata->uv.next=g->mainthread->next; -g->mainthread->next=o; -makewhite(g,o); -tm=fasttm(L,udata->uv.metatable,TM_GC); -if(tm!=NULL){ -lu_byte oldah=L->allowhook; -lu_mem oldt=g->GCthreshold; -L->allowhook=0; -g->GCthreshold=2*g->totalbytes; -setobj(L,L->top,tm); -setuvalue(L,L->top+1,udata); -L->top+=2; -luaD_call(L,L->top-2,0); -L->allowhook=oldah; -g->GCthreshold=oldt; -} -} -static void luaC_callGCTM(lua_State*L){ -while(G(L)->tmudata) -GCTM(L); -} -static void luaC_freeall(lua_State*L){ -global_State*g=G(L); -int i; -g->currentwhite=bit2mask(0,1)|bitmask(6); -sweepwholelist(L,&g->rootgc); -for(i=0;istrt.size;i++) -sweepwholelist(L,&g->strt.hash[i]); -} -static void markmt(global_State*g){ -int i; -for(i=0;i<(8+1);i++) -if(g->mt[i])markobject(g,g->mt[i]); -} -static void markroot(lua_State*L){ -global_State*g=G(L); -g->gray=NULL; -g->grayagain=NULL; -g->weak=NULL; -markobject(g,g->mainthread); -markvalue(g,gt(g->mainthread)); -markvalue(g,registry(L)); -markmt(g); -g->gcstate=1; -} -static void remarkupvals(global_State*g){ -UpVal*uv; -for(uv=g->uvhead.u.l.next;uv!=&g->uvhead;uv=uv->u.l.next){ -if(isgray(obj2gco(uv))) -markvalue(g,uv->v); -} -} -static void atomic(lua_State*L){ -global_State*g=G(L); -size_t udsize; -remarkupvals(g); -propagateall(g); -g->gray=g->weak; -g->weak=NULL; -markobject(g,L); -markmt(g); -propagateall(g); -g->gray=g->grayagain; -g->grayagain=NULL; -propagateall(g); -udsize=luaC_separateudata(L,0); -marktmu(g); -udsize+=propagateall(g); -cleartable(g->weak); -g->currentwhite=cast_byte(otherwhite(g)); -g->sweepstrgc=0; -g->sweepgc=&g->rootgc; -g->gcstate=2; -g->estimate=g->totalbytes-udsize; -} -static l_mem singlestep(lua_State*L){ -global_State*g=G(L); -switch(g->gcstate){ -case 0:{ -markroot(L); -return 0; -} -case 1:{ -if(g->gray) -return propagatemark(g); -else{ -atomic(L); -return 0; -} -} -case 2:{ -lu_mem old=g->totalbytes; -sweepwholelist(L,&g->strt.hash[g->sweepstrgc++]); -if(g->sweepstrgc>=g->strt.size) -g->gcstate=3; -g->estimate-=old-g->totalbytes; -return 10; -} -case 3:{ -lu_mem old=g->totalbytes; -g->sweepgc=sweeplist(L,g->sweepgc,40); -if(*g->sweepgc==NULL){ -checkSizes(L); -g->gcstate=4; -} -g->estimate-=old-g->totalbytes; -return 40*10; -} -case 4:{ -if(g->tmudata){ -GCTM(L); -if(g->estimate>100) -g->estimate-=100; -return 100; -} -else{ -g->gcstate=0; -g->gcdept=0; -return 0; -} -} -default:return 0; -} -} -static void luaC_step(lua_State*L){ -global_State*g=G(L); -l_mem lim=(1024u/100)*g->gcstepmul; -if(lim==0) -lim=(((lu_mem)(~(lu_mem)0)-2)-1)/2; -g->gcdept+=g->totalbytes-g->GCthreshold; -do{ -lim-=singlestep(L); -if(g->gcstate==0) -break; -}while(lim>0); -if(g->gcstate!=0){ -if(g->gcdept<1024u) -g->GCthreshold=g->totalbytes+1024u; -else{ -g->gcdept-=1024u; -g->GCthreshold=g->totalbytes; -} -} -else{ -setthreshold(g); -} -} -static void luaC_barrierf(lua_State*L,GCObject*o,GCObject*v){ -global_State*g=G(L); -if(g->gcstate==1) -reallymarkobject(g,v); -else -makewhite(g,o); -} -static void luaC_barrierback(lua_State*L,Table*t){ -global_State*g=G(L); -GCObject*o=obj2gco(t); -black2gray(o); -t->gclist=g->grayagain; -g->grayagain=o; -} -static void luaC_link(lua_State*L,GCObject*o,lu_byte tt){ -global_State*g=G(L); -o->gch.next=g->rootgc; -g->rootgc=o; -o->gch.marked=luaC_white(g); -o->gch.tt=tt; -} -static void luaC_linkupval(lua_State*L,UpVal*uv){ -global_State*g=G(L); -GCObject*o=obj2gco(uv); -o->gch.next=g->rootgc; -g->rootgc=o; -if(isgray(o)){ -if(g->gcstate==1){ -gray2black(o); -luaC_barrier(L,uv,uv->v); -} -else{ -makewhite(g,o); -} -} -} -typedef union{ -lua_Number r; -TString*ts; -}SemInfo; -typedef struct Token{ -int token; -SemInfo seminfo; -}Token; -typedef struct LexState{ -int current; -int linenumber; -int lastline; -Token t; -Token lookahead; -struct FuncState*fs; -struct lua_State*L; -ZIO*z; -Mbuffer*buff; -TString*source; -char decpoint; -}LexState; -static void luaX_init(lua_State*L); -static void luaX_lexerror(LexState*ls,const char*msg,int token); -#define state_size(x)(sizeof(x)+0) -#define fromstate(l)(cast(lu_byte*,(l))-0) -#define tostate(l)(cast(lua_State*,cast(lu_byte*,l)+0)) -typedef struct LG{ -lua_State l; -global_State g; -}LG; -static void stack_init(lua_State*L1,lua_State*L){ -L1->base_ci=luaM_newvector(L,8,CallInfo); -L1->ci=L1->base_ci; -L1->size_ci=8; -L1->end_ci=L1->base_ci+L1->size_ci-1; -L1->stack=luaM_newvector(L,(2*20)+5,TValue); -L1->stacksize=(2*20)+5; -L1->top=L1->stack; -L1->stack_last=L1->stack+(L1->stacksize-5)-1; -L1->ci->func=L1->top; -setnilvalue(L1->top++); -L1->base=L1->ci->base=L1->top; -L1->ci->top=L1->top+20; -} -static void freestack(lua_State*L,lua_State*L1){ -luaM_freearray(L,L1->base_ci,L1->size_ci,CallInfo); -luaM_freearray(L,L1->stack,L1->stacksize,TValue); -} -static void f_luaopen(lua_State*L,void*ud){ -global_State*g=G(L); -UNUSED(ud); -stack_init(L,L); -sethvalue(L,gt(L),luaH_new(L,0,2)); -sethvalue(L,registry(L),luaH_new(L,0,2)); -luaS_resize(L,32); -luaT_init(L); -luaX_init(L); -luaS_fix(luaS_newliteral(L,"not enough memory")); -g->GCthreshold=4*g->totalbytes; -} -static void preinit_state(lua_State*L,global_State*g){ -G(L)=g; -L->stack=NULL; -L->stacksize=0; -L->errorJmp=NULL; -L->hook=NULL; -L->hookmask=0; -L->basehookcount=0; -L->allowhook=1; -resethookcount(L); -L->openupval=NULL; -L->size_ci=0; -L->nCcalls=L->baseCcalls=0; -L->status=0; -L->base_ci=L->ci=NULL; -L->savedpc=NULL; -L->errfunc=0; -setnilvalue(gt(L)); -} -static void close_state(lua_State*L){ -global_State*g=G(L); -luaF_close(L,L->stack); -luaC_freeall(L); -luaM_freearray(L,G(L)->strt.hash,G(L)->strt.size,TString*); -luaZ_freebuffer(L,&g->buff); -freestack(L,L); -(*g->frealloc)(g->ud,fromstate(L),state_size(LG),0); -} -static void luaE_freethread(lua_State*L,lua_State*L1){ -luaF_close(L1,L1->stack); -freestack(L,L1); -luaM_freemem(L,fromstate(L1),state_size(lua_State)); -} -static lua_State*lua_newstate(lua_Alloc f,void*ud){ -int i; -lua_State*L; -global_State*g; -void*l=(*f)(ud,NULL,0,state_size(LG)); -if(l==NULL)return NULL; -L=tostate(l); -g=&((LG*)L)->g; -L->next=NULL; -L->tt=8; -g->currentwhite=bit2mask(0,5); -L->marked=luaC_white(g); -set2bits(L->marked,5,6); -preinit_state(L,g); -g->frealloc=f; -g->ud=ud; -g->mainthread=L; -g->uvhead.u.l.prev=&g->uvhead; -g->uvhead.u.l.next=&g->uvhead; -g->GCthreshold=0; -g->strt.size=0; -g->strt.nuse=0; -g->strt.hash=NULL; -setnilvalue(registry(L)); -luaZ_initbuffer(L,&g->buff); -g->panic=NULL; -g->gcstate=0; -g->rootgc=obj2gco(L); -g->sweepstrgc=0; -g->sweepgc=&g->rootgc; -g->gray=NULL; -g->grayagain=NULL; -g->weak=NULL; -g->tmudata=NULL; -g->totalbytes=sizeof(LG); -g->gcpause=200; -g->gcstepmul=200; -g->gcdept=0; -for(i=0;i<(8+1);i++)g->mt[i]=NULL; -if(luaD_rawrunprotected(L,f_luaopen,NULL)!=0){ -close_state(L); -L=NULL; -} -else -{} -return L; -} -static void callallgcTM(lua_State*L,void*ud){ -UNUSED(ud); -luaC_callGCTM(L); -} -static void lua_close(lua_State*L){ -L=G(L)->mainthread; -luaF_close(L,L->stack); -luaC_separateudata(L,1); -L->errfunc=0; -do{ -L->ci=L->base_ci; -L->base=L->top=L->ci->base; -L->nCcalls=L->baseCcalls=0; -}while(luaD_rawrunprotected(L,callallgcTM,NULL)!=0); -close_state(L); -} -#define getcode(fs,e)((fs)->f->code[(e)->u.s.info]) -#define luaK_codeAsBx(fs,o,A,sBx)luaK_codeABx(fs,o,A,(sBx)+(((1<<(9+9))-1)>>1)) -#define luaK_setmultret(fs,e)luaK_setreturns(fs,e,(-1)) -static int luaK_codeABx(FuncState*fs,OpCode o,int A,unsigned int Bx); -static int luaK_codeABC(FuncState*fs,OpCode o,int A,int B,int C); -static void luaK_setreturns(FuncState*fs,expdesc*e,int nresults); -static void luaK_patchtohere(FuncState*fs,int list); -static void luaK_concat(FuncState*fs,int*l1,int l2); -static int currentpc(lua_State*L,CallInfo*ci){ -if(!isLua(ci))return-1; -if(ci==L->ci) -ci->savedpc=L->savedpc; -return pcRel(ci->savedpc,ci_func(ci)->l.p); -} -static int currentline(lua_State*L,CallInfo*ci){ -int pc=currentpc(L,ci); -if(pc<0) -return-1; -else -return getline_(ci_func(ci)->l.p,pc); -} -static int lua_getstack(lua_State*L,int level,lua_Debug*ar){ -int status; -CallInfo*ci; -for(ci=L->ci;level>0&&ci>L->base_ci;ci--){ -level--; -if(f_isLua(ci)) -level-=ci->tailcalls; -} -if(level==0&&ci>L->base_ci){ -status=1; -ar->i_ci=cast_int(ci-L->base_ci); -} -else if(level<0){ -status=1; -ar->i_ci=0; -} -else status=0; -return status; -} -static Proto*getluaproto(CallInfo*ci){ -return(isLua(ci)?ci_func(ci)->l.p:NULL); -} -static void funcinfo(lua_Debug*ar,Closure*cl){ -if(cl->c.isC){ -ar->source="=[C]"; -ar->linedefined=-1; -ar->lastlinedefined=-1; -ar->what="C"; -} -else{ -ar->source=getstr(cl->l.p->source); -ar->linedefined=cl->l.p->linedefined; -ar->lastlinedefined=cl->l.p->lastlinedefined; -ar->what=(ar->linedefined==0)?"main":"Lua"; -} -luaO_chunkid(ar->short_src,ar->source,60); -} -static void info_tailcall(lua_Debug*ar){ -ar->name=ar->namewhat=""; -ar->what="tail"; -ar->lastlinedefined=ar->linedefined=ar->currentline=-1; -ar->source="=(tail call)"; -luaO_chunkid(ar->short_src,ar->source,60); -ar->nups=0; -} -static void collectvalidlines(lua_State*L,Closure*f){ -if(f==NULL||f->c.isC){ -setnilvalue(L->top); -} -else{ -Table*t=luaH_new(L,0,0); -int*lineinfo=f->l.p->lineinfo; -int i; -for(i=0;il.p->sizelineinfo;i++) -setbvalue(luaH_setnum(L,t,lineinfo[i]),1); -sethvalue(L,L->top,t); -} -incr_top(L); -} -static int auxgetinfo(lua_State*L,const char*what,lua_Debug*ar, -Closure*f,CallInfo*ci){ -int status=1; -if(f==NULL){ -info_tailcall(ar); -return status; -} -for(;*what;what++){ -switch(*what){ -case'S':{ -funcinfo(ar,f); -break; -} -case'l':{ -ar->currentline=(ci)?currentline(L,ci):-1; -break; -} -case'u':{ -ar->nups=f->c.nupvalues; -break; -} -case'n':{ -ar->namewhat=(ci)?NULL:NULL; -if(ar->namewhat==NULL){ -ar->namewhat=""; -ar->name=NULL; -} -break; -} -case'L': -case'f': -break; -default:status=0; -} -} -return status; -} -static int lua_getinfo(lua_State*L,const char*what,lua_Debug*ar){ -int status; -Closure*f=NULL; -CallInfo*ci=NULL; -if(*what=='>'){ -StkId func=L->top-1; -luai_apicheck(L,ttisfunction(func)); -what++; -f=clvalue(func); -L->top--; -} -else if(ar->i_ci!=0){ -ci=L->base_ci+ar->i_ci; -f=clvalue(ci->func); -} -status=auxgetinfo(L,what,ar,f,ci); -if(strchr(what,'f')){ -if(f==NULL)setnilvalue(L->top); -else setclvalue(L,L->top,f); -incr_top(L); -} -if(strchr(what,'L')) -collectvalidlines(L,f); -return status; -} -static int isinstack(CallInfo*ci,const TValue*o){ -StkId p; -for(p=ci->base;ptop;p++) -if(o==p)return 1; -return 0; -} -static void luaG_typeerror(lua_State*L,const TValue*o,const char*op){ -const char*name=NULL; -const char*t=luaT_typenames[ttype(o)]; -const char*kind=(isinstack(L->ci,o))? -NULL: -NULL; -if(kind) -luaG_runerror(L,"attempt to %s %s "LUA_QL("%s")" (a %s value)", -op,kind,name,t); -else -luaG_runerror(L,"attempt to %s a %s value",op,t); -} -static void luaG_concaterror(lua_State*L,StkId p1,StkId p2){ -if(ttisstring(p1)||ttisnumber(p1))p1=p2; -luaG_typeerror(L,p1,"concatenate"); -} -static void luaG_aritherror(lua_State*L,const TValue*p1,const TValue*p2){ -TValue temp; -if(luaV_tonumber(p1,&temp)==NULL) -p2=p1; -luaG_typeerror(L,p2,"perform arithmetic on"); -} -static int luaG_ordererror(lua_State*L,const TValue*p1,const TValue*p2){ -const char*t1=luaT_typenames[ttype(p1)]; -const char*t2=luaT_typenames[ttype(p2)]; -if(t1[2]==t2[2]) -luaG_runerror(L,"attempt to compare two %s values",t1); -else -luaG_runerror(L,"attempt to compare %s with %s",t1,t2); -return 0; -} -static void addinfo(lua_State*L,const char*msg){ -CallInfo*ci=L->ci; -if(isLua(ci)){ -char buff[60]; -int line=currentline(L,ci); -luaO_chunkid(buff,getstr(getluaproto(ci)->source),60); -luaO_pushfstring(L,"%s:%d: %s",buff,line,msg); -} -} -static void luaG_errormsg(lua_State*L){ -if(L->errfunc!=0){ -StkId errfunc=restorestack(L,L->errfunc); -if(!ttisfunction(errfunc))luaD_throw(L,5); -setobj(L,L->top,L->top-1); -setobj(L,L->top-1,errfunc); -incr_top(L); -luaD_call(L,L->top-2,1); -} -luaD_throw(L,2); -} -static void luaG_runerror(lua_State*L,const char*fmt,...){ -va_list argp; -va_start(argp,fmt); -addinfo(L,luaO_pushvfstring(L,fmt,argp)); -va_end(argp); -luaG_errormsg(L); -} -static int luaZ_fill(ZIO*z){ -size_t size; -lua_State*L=z->L; -const char*buff; -buff=z->reader(L,z->data,&size); -if(buff==NULL||size==0)return(-1); -z->n=size-1; -z->p=buff; -return char2int(*(z->p++)); -} -static void luaZ_init(lua_State*L,ZIO*z,lua_Reader reader,void*data){ -z->L=L; -z->reader=reader; -z->data=data; -z->n=0; -z->p=NULL; -} -static char*luaZ_openspace(lua_State*L,Mbuffer*buff,size_t n){ -if(n>buff->buffsize){ -if(n<32)n=32; -luaZ_resizebuffer(L,buff,n); -} -return buff->buffer; -} -#define opmode(t,a,b,c,m)(((t)<<7)|((a)<<6)|((b)<<4)|((c)<<2)|(m)) -static const lu_byte luaP_opmodes[(cast(int,OP_VARARG)+1)]={ -opmode(0,1,OpArgR,OpArgN,iABC) -,opmode(0,1,OpArgK,OpArgN,iABx) -,opmode(0,1,OpArgU,OpArgU,iABC) -,opmode(0,1,OpArgR,OpArgN,iABC) -,opmode(0,1,OpArgU,OpArgN,iABC) -,opmode(0,1,OpArgK,OpArgN,iABx) -,opmode(0,1,OpArgR,OpArgK,iABC) -,opmode(0,0,OpArgK,OpArgN,iABx) -,opmode(0,0,OpArgU,OpArgN,iABC) -,opmode(0,0,OpArgK,OpArgK,iABC) -,opmode(0,1,OpArgU,OpArgU,iABC) -,opmode(0,1,OpArgR,OpArgK,iABC) -,opmode(0,1,OpArgK,OpArgK,iABC) -,opmode(0,1,OpArgK,OpArgK,iABC) -,opmode(0,1,OpArgK,OpArgK,iABC) -,opmode(0,1,OpArgK,OpArgK,iABC) -,opmode(0,1,OpArgK,OpArgK,iABC) -,opmode(0,1,OpArgK,OpArgK,iABC) -,opmode(0,1,OpArgR,OpArgN,iABC) -,opmode(0,1,OpArgR,OpArgN,iABC) -,opmode(0,1,OpArgR,OpArgN,iABC) -,opmode(0,1,OpArgR,OpArgR,iABC) -,opmode(0,0,OpArgR,OpArgN,iAsBx) -,opmode(1,0,OpArgK,OpArgK,iABC) -,opmode(1,0,OpArgK,OpArgK,iABC) -,opmode(1,0,OpArgK,OpArgK,iABC) -,opmode(1,1,OpArgR,OpArgU,iABC) -,opmode(1,1,OpArgR,OpArgU,iABC) -,opmode(0,1,OpArgU,OpArgU,iABC) -,opmode(0,1,OpArgU,OpArgU,iABC) -,opmode(0,0,OpArgU,OpArgN,iABC) -,opmode(0,1,OpArgR,OpArgN,iAsBx) -,opmode(0,1,OpArgR,OpArgN,iAsBx) -,opmode(1,0,OpArgN,OpArgU,iABC) -,opmode(0,0,OpArgU,OpArgU,iABC) -,opmode(0,0,OpArgN,OpArgN,iABC) -,opmode(0,1,OpArgU,OpArgN,iABx) -,opmode(0,1,OpArgU,OpArgN,iABC) -}; -#define next(ls)(ls->current=zgetc(ls->z)) -#define currIsNewline(ls)(ls->current=='\n'||ls->current=='\r') -static const char*const luaX_tokens[]={ -"and","break","do","else","elseif", -"end","false","for","function","if", -"in","local","nil","not","or","repeat", -"return","then","true","until","while", -"..","...","==",">=","<=","~=", -"","","","", -NULL -}; -#define save_and_next(ls)(save(ls,ls->current),next(ls)) -static void save(LexState*ls,int c){ -Mbuffer*b=ls->buff; -if(b->n+1>b->buffsize){ -size_t newsize; -if(b->buffsize>=((size_t)(~(size_t)0)-2)/2) -luaX_lexerror(ls,"lexical element too long",0); -newsize=b->buffsize*2; -luaZ_resizebuffer(ls->L,b,newsize); -} -b->buffer[b->n++]=cast(char,c); -} -static void luaX_init(lua_State*L){ -int i; -for(i=0;i<(cast(int,TK_WHILE-257+1));i++){ -TString*ts=luaS_new(L,luaX_tokens[i]); -luaS_fix(ts); -ts->tsv.reserved=cast_byte(i+1); -} -} -static const char*luaX_token2str(LexState*ls,int token){ -if(token<257){ -return(iscntrl(token))?luaO_pushfstring(ls->L,"char(%d)",token): -luaO_pushfstring(ls->L,"%c",token); -} -else -return luaX_tokens[token-257]; -} -static const char*txtToken(LexState*ls,int token){ -switch(token){ -case TK_NAME: -case TK_STRING: -case TK_NUMBER: -save(ls,'\0'); -return luaZ_buffer(ls->buff); -default: -return luaX_token2str(ls,token); -} -} -static void luaX_lexerror(LexState*ls,const char*msg,int token){ -char buff[80]; -luaO_chunkid(buff,getstr(ls->source),80); -msg=luaO_pushfstring(ls->L,"%s:%d: %s",buff,ls->linenumber,msg); -if(token) -luaO_pushfstring(ls->L,"%s near "LUA_QL("%s"),msg,txtToken(ls,token)); -luaD_throw(ls->L,3); -} -static void luaX_syntaxerror(LexState*ls,const char*msg){ -luaX_lexerror(ls,msg,ls->t.token); -} -static TString*luaX_newstring(LexState*ls,const char*str,size_t l){ -lua_State*L=ls->L; -TString*ts=luaS_newlstr(L,str,l); -TValue*o=luaH_setstr(L,ls->fs->h,ts); -if(ttisnil(o)){ -setbvalue(o,1); -luaC_checkGC(L); -} -return ts; -} -static void inclinenumber(LexState*ls){ -int old=ls->current; -next(ls); -if(currIsNewline(ls)&&ls->current!=old) -next(ls); -if(++ls->linenumber>=(INT_MAX-2)) -luaX_syntaxerror(ls,"chunk has too many lines"); -} -static void luaX_setinput(lua_State*L,LexState*ls,ZIO*z,TString*source){ -ls->decpoint='.'; -ls->L=L; -ls->lookahead.token=TK_EOS; -ls->z=z; -ls->fs=NULL; -ls->linenumber=1; -ls->lastline=1; -ls->source=source; -luaZ_resizebuffer(ls->L,ls->buff,32); -next(ls); -} -static int check_next(LexState*ls,const char*set){ -if(!strchr(set,ls->current)) -return 0; -save_and_next(ls); -return 1; -} -static void buffreplace(LexState*ls,char from,char to){ -size_t n=luaZ_bufflen(ls->buff); -char*p=luaZ_buffer(ls->buff); -while(n--) -if(p[n]==from)p[n]=to; -} -static void read_numeral(LexState*ls,SemInfo*seminfo){ -do{ -save_and_next(ls); -}while(isdigit(ls->current)||ls->current=='.'); -if(check_next(ls,"Ee")) -check_next(ls,"+-"); -while(isalnum(ls->current)||ls->current=='_') -save_and_next(ls); -save(ls,'\0'); -buffreplace(ls,'.',ls->decpoint); -if(!luaO_str2d(luaZ_buffer(ls->buff),&seminfo->r)) -luaX_lexerror(ls,"malformed number",TK_NUMBER); -} -static int skip_sep(LexState*ls){ -int count=0; -int s=ls->current; -save_and_next(ls); -while(ls->current=='='){ -save_and_next(ls); -count++; -} -return(ls->current==s)?count:(-count)-1; -} -static void read_long_string(LexState*ls,SemInfo*seminfo,int sep){ -int cont=0; -(void)(cont); -save_and_next(ls); -if(currIsNewline(ls)) -inclinenumber(ls); -for(;;){ -switch(ls->current){ -case(-1): -luaX_lexerror(ls,(seminfo)?"unfinished long string": -"unfinished long comment",TK_EOS); -break; -case']':{ -if(skip_sep(ls)==sep){ -save_and_next(ls); -goto endloop; -} -break; -} -case'\n': -case'\r':{ -save(ls,'\n'); -inclinenumber(ls); -if(!seminfo)luaZ_resetbuffer(ls->buff); -break; -} -default:{ -if(seminfo)save_and_next(ls); -else next(ls); -} -} -}endloop: -if(seminfo) -seminfo->ts=luaX_newstring(ls,luaZ_buffer(ls->buff)+(2+sep), -luaZ_bufflen(ls->buff)-2*(2+sep)); -} -static void read_string(LexState*ls,int del,SemInfo*seminfo){ -save_and_next(ls); -while(ls->current!=del){ -switch(ls->current){ -case(-1): -luaX_lexerror(ls,"unfinished string",TK_EOS); -continue; -case'\n': -case'\r': -luaX_lexerror(ls,"unfinished string",TK_STRING); -continue; -case'\\':{ -int c; -next(ls); -switch(ls->current){ -case'a':c='\a';break; -case'b':c='\b';break; -case'f':c='\f';break; -case'n':c='\n';break; -case'r':c='\r';break; -case't':c='\t';break; -case'v':c='\v';break; -case'\n': -case'\r':save(ls,'\n');inclinenumber(ls);continue; -case(-1):continue; -default:{ -if(!isdigit(ls->current)) -save_and_next(ls); -else{ -int i=0; -c=0; -do{ -c=10*c+(ls->current-'0'); -next(ls); -}while(++i<3&&isdigit(ls->current)); -if(c>UCHAR_MAX) -luaX_lexerror(ls,"escape sequence too large",TK_STRING); -save(ls,c); -} -continue; -} -} -save(ls,c); -next(ls); -continue; -} -default: -save_and_next(ls); -} -} -save_and_next(ls); -seminfo->ts=luaX_newstring(ls,luaZ_buffer(ls->buff)+1, -luaZ_bufflen(ls->buff)-2); -} -static int llex(LexState*ls,SemInfo*seminfo){ -luaZ_resetbuffer(ls->buff); -for(;;){ -switch(ls->current){ -case'\n': -case'\r':{ -inclinenumber(ls); -continue; -} -case'-':{ -next(ls); -if(ls->current!='-')return'-'; -next(ls); -if(ls->current=='['){ -int sep=skip_sep(ls); -luaZ_resetbuffer(ls->buff); -if(sep>=0){ -read_long_string(ls,NULL,sep); -luaZ_resetbuffer(ls->buff); -continue; -} -} -while(!currIsNewline(ls)&&ls->current!=(-1)) -next(ls); -continue; -} -case'[':{ -int sep=skip_sep(ls); -if(sep>=0){ -read_long_string(ls,seminfo,sep); -return TK_STRING; -} -else if(sep==-1)return'['; -else luaX_lexerror(ls,"invalid long string delimiter",TK_STRING); -} -case'=':{ -next(ls); -if(ls->current!='=')return'='; -else{next(ls);return TK_EQ;} -} -case'<':{ -next(ls); -if(ls->current!='=')return'<'; -else{next(ls);return TK_LE;} -} -case'>':{ -next(ls); -if(ls->current!='=')return'>'; -else{next(ls);return TK_GE;} -} -case'~':{ -next(ls); -if(ls->current!='=')return'~'; -else{next(ls);return TK_NE;} -} -case'"': -case'\'':{ -read_string(ls,ls->current,seminfo); -return TK_STRING; -} -case'.':{ -save_and_next(ls); -if(check_next(ls,".")){ -if(check_next(ls,".")) -return TK_DOTS; -else return TK_CONCAT; -} -else if(!isdigit(ls->current))return'.'; -else{ -read_numeral(ls,seminfo); -return TK_NUMBER; -} -} -case(-1):{ -return TK_EOS; -} -default:{ -if(isspace(ls->current)){ -next(ls); -continue; -} -else if(isdigit(ls->current)){ -read_numeral(ls,seminfo); -return TK_NUMBER; -} -else if(isalpha(ls->current)||ls->current=='_'){ -TString*ts; -do{ -save_and_next(ls); -}while(isalnum(ls->current)||ls->current=='_'); -ts=luaX_newstring(ls,luaZ_buffer(ls->buff), -luaZ_bufflen(ls->buff)); -if(ts->tsv.reserved>0) -return ts->tsv.reserved-1+257; -else{ -seminfo->ts=ts; -return TK_NAME; -} -} -else{ -int c=ls->current; -next(ls); -return c; -} -} -} -} -} -static void luaX_next(LexState*ls){ -ls->lastline=ls->linenumber; -if(ls->lookahead.token!=TK_EOS){ -ls->t=ls->lookahead; -ls->lookahead.token=TK_EOS; -} -else -ls->t.token=llex(ls,&ls->t.seminfo); -} -static void luaX_lookahead(LexState*ls){ -ls->lookahead.token=llex(ls,&ls->lookahead.seminfo); -} -#define hasjumps(e)((e)->t!=(e)->f) -static int isnumeral(expdesc*e){ -return(e->k==VKNUM&&e->t==(-1)&&e->f==(-1)); -} -static void luaK_nil(FuncState*fs,int from,int n){ -Instruction*previous; -if(fs->pc>fs->lasttarget){ -if(fs->pc==0){ -if(from>=fs->nactvar) -return; -} -else{ -previous=&fs->f->code[fs->pc-1]; -if(GET_OPCODE(*previous)==OP_LOADNIL){ -int pfrom=GETARG_A(*previous); -int pto=GETARG_B(*previous); -if(pfrom<=from&&from<=pto+1){ -if(from+n-1>pto) -SETARG_B(*previous,from+n-1); -return; -} -} -} -} -luaK_codeABC(fs,OP_LOADNIL,from,from+n-1,0); -} -static int luaK_jump(FuncState*fs){ -int jpc=fs->jpc; -int j; -fs->jpc=(-1); -j=luaK_codeAsBx(fs,OP_JMP,0,(-1)); -luaK_concat(fs,&j,jpc); -return j; -} -static void luaK_ret(FuncState*fs,int first,int nret){ -luaK_codeABC(fs,OP_RETURN,first,nret+1,0); -} -static int condjump(FuncState*fs,OpCode op,int A,int B,int C){ -luaK_codeABC(fs,op,A,B,C); -return luaK_jump(fs); -} -static void fixjump(FuncState*fs,int pc,int dest){ -Instruction*jmp=&fs->f->code[pc]; -int offset=dest-(pc+1); -if(abs(offset)>(((1<<(9+9))-1)>>1)) -luaX_syntaxerror(fs->ls,"control structure too long"); -SETARG_sBx(*jmp,offset); -} -static int luaK_getlabel(FuncState*fs){ -fs->lasttarget=fs->pc; -return fs->pc; -} -static int getjump(FuncState*fs,int pc){ -int offset=GETARG_sBx(fs->f->code[pc]); -if(offset==(-1)) -return(-1); -else -return(pc+1)+offset; -} -static Instruction*getjumpcontrol(FuncState*fs,int pc){ -Instruction*pi=&fs->f->code[pc]; -if(pc>=1&&testTMode(GET_OPCODE(*(pi-1)))) -return pi-1; -else -return pi; -} -static int need_value(FuncState*fs,int list){ -for(;list!=(-1);list=getjump(fs,list)){ -Instruction i=*getjumpcontrol(fs,list); -if(GET_OPCODE(i)!=OP_TESTSET)return 1; -} -return 0; -} -static int patchtestreg(FuncState*fs,int node,int reg){ -Instruction*i=getjumpcontrol(fs,node); -if(GET_OPCODE(*i)!=OP_TESTSET) -return 0; -if(reg!=((1<<8)-1)&®!=GETARG_B(*i)) -SETARG_A(*i,reg); -else -*i=CREATE_ABC(OP_TEST,GETARG_B(*i),0,GETARG_C(*i)); -return 1; -} -static void removevalues(FuncState*fs,int list){ -for(;list!=(-1);list=getjump(fs,list)) -patchtestreg(fs,list,((1<<8)-1)); -} -static void patchlistaux(FuncState*fs,int list,int vtarget,int reg, -int dtarget){ -while(list!=(-1)){ -int next=getjump(fs,list); -if(patchtestreg(fs,list,reg)) -fixjump(fs,list,vtarget); -else -fixjump(fs,list,dtarget); -list=next; -} -} -static void dischargejpc(FuncState*fs){ -patchlistaux(fs,fs->jpc,fs->pc,((1<<8)-1),fs->pc); -fs->jpc=(-1); -} -static void luaK_patchlist(FuncState*fs,int list,int target){ -if(target==fs->pc) -luaK_patchtohere(fs,list); -else{ -patchlistaux(fs,list,target,((1<<8)-1),target); -} -} -static void luaK_patchtohere(FuncState*fs,int list){ -luaK_getlabel(fs); -luaK_concat(fs,&fs->jpc,list); -} -static void luaK_concat(FuncState*fs,int*l1,int l2){ -if(l2==(-1))return; -else if(*l1==(-1)) -*l1=l2; -else{ -int list=*l1; -int next; -while((next=getjump(fs,list))!=(-1)) -list=next; -fixjump(fs,list,l2); -} -} -static void luaK_checkstack(FuncState*fs,int n){ -int newstack=fs->freereg+n; -if(newstack>fs->f->maxstacksize){ -if(newstack>=250) -luaX_syntaxerror(fs->ls,"function or expression too complex"); -fs->f->maxstacksize=cast_byte(newstack); -} -} -static void luaK_reserveregs(FuncState*fs,int n){ -luaK_checkstack(fs,n); -fs->freereg+=n; -} -static void freereg(FuncState*fs,int reg){ -if(!ISK(reg)&®>=fs->nactvar){ -fs->freereg--; -} -} -static void freeexp(FuncState*fs,expdesc*e){ -if(e->k==VNONRELOC) -freereg(fs,e->u.s.info); -} -static int addk(FuncState*fs,TValue*k,TValue*v){ -lua_State*L=fs->L; -TValue*idx=luaH_set(L,fs->h,k); -Proto*f=fs->f; -int oldsize=f->sizek; -if(ttisnumber(idx)){ -return cast_int(nvalue(idx)); -} -else{ -setnvalue(idx,cast_num(fs->nk)); -luaM_growvector(L,f->k,fs->nk,f->sizek,TValue, -((1<<(9+9))-1),"constant table overflow"); -while(oldsizesizek)setnilvalue(&f->k[oldsize++]); -setobj(L,&f->k[fs->nk],v); -luaC_barrier(L,f,v); -return fs->nk++; -} -} -static int luaK_stringK(FuncState*fs,TString*s){ -TValue o; -setsvalue(fs->L,&o,s); -return addk(fs,&o,&o); -} -static int luaK_numberK(FuncState*fs,lua_Number r){ -TValue o; -setnvalue(&o,r); -return addk(fs,&o,&o); -} -static int boolK(FuncState*fs,int b){ -TValue o; -setbvalue(&o,b); -return addk(fs,&o,&o); -} -static int nilK(FuncState*fs){ -TValue k,v; -setnilvalue(&v); -sethvalue(fs->L,&k,fs->h); -return addk(fs,&k,&v); -} -static void luaK_setreturns(FuncState*fs,expdesc*e,int nresults){ -if(e->k==VCALL){ -SETARG_C(getcode(fs,e),nresults+1); -} -else if(e->k==VVARARG){ -SETARG_B(getcode(fs,e),nresults+1); -SETARG_A(getcode(fs,e),fs->freereg); -luaK_reserveregs(fs,1); -} -} -static void luaK_setoneret(FuncState*fs,expdesc*e){ -if(e->k==VCALL){ -e->k=VNONRELOC; -e->u.s.info=GETARG_A(getcode(fs,e)); -} -else if(e->k==VVARARG){ -SETARG_B(getcode(fs,e),2); -e->k=VRELOCABLE; -} -} -static void luaK_dischargevars(FuncState*fs,expdesc*e){ -switch(e->k){ -case VLOCAL:{ -e->k=VNONRELOC; -break; -} -case VUPVAL:{ -e->u.s.info=luaK_codeABC(fs,OP_GETUPVAL,0,e->u.s.info,0); -e->k=VRELOCABLE; -break; -} -case VGLOBAL:{ -e->u.s.info=luaK_codeABx(fs,OP_GETGLOBAL,0,e->u.s.info); -e->k=VRELOCABLE; -break; -} -case VINDEXED:{ -freereg(fs,e->u.s.aux); -freereg(fs,e->u.s.info); -e->u.s.info=luaK_codeABC(fs,OP_GETTABLE,0,e->u.s.info,e->u.s.aux); -e->k=VRELOCABLE; -break; -} -case VVARARG: -case VCALL:{ -luaK_setoneret(fs,e); -break; -} -default:break; -} -} -static int code_label(FuncState*fs,int A,int b,int jump){ -luaK_getlabel(fs); -return luaK_codeABC(fs,OP_LOADBOOL,A,b,jump); -} -static void discharge2reg(FuncState*fs,expdesc*e,int reg){ -luaK_dischargevars(fs,e); -switch(e->k){ -case VNIL:{ -luaK_nil(fs,reg,1); -break; -} -case VFALSE:case VTRUE:{ -luaK_codeABC(fs,OP_LOADBOOL,reg,e->k==VTRUE,0); -break; -} -case VK:{ -luaK_codeABx(fs,OP_LOADK,reg,e->u.s.info); -break; -} -case VKNUM:{ -luaK_codeABx(fs,OP_LOADK,reg,luaK_numberK(fs,e->u.nval)); -break; -} -case VRELOCABLE:{ -Instruction*pc=&getcode(fs,e); -SETARG_A(*pc,reg); -break; -} -case VNONRELOC:{ -if(reg!=e->u.s.info) -luaK_codeABC(fs,OP_MOVE,reg,e->u.s.info,0); -break; -} -default:{ -return; -} -} -e->u.s.info=reg; -e->k=VNONRELOC; -} -static void discharge2anyreg(FuncState*fs,expdesc*e){ -if(e->k!=VNONRELOC){ -luaK_reserveregs(fs,1); -discharge2reg(fs,e,fs->freereg-1); -} -} -static void exp2reg(FuncState*fs,expdesc*e,int reg){ -discharge2reg(fs,e,reg); -if(e->k==VJMP) -luaK_concat(fs,&e->t,e->u.s.info); -if(hasjumps(e)){ -int final; -int p_f=(-1); -int p_t=(-1); -if(need_value(fs,e->t)||need_value(fs,e->f)){ -int fj=(e->k==VJMP)?(-1):luaK_jump(fs); -p_f=code_label(fs,reg,0,1); -p_t=code_label(fs,reg,1,0); -luaK_patchtohere(fs,fj); -} -final=luaK_getlabel(fs); -patchlistaux(fs,e->f,final,reg,p_f); -patchlistaux(fs,e->t,final,reg,p_t); -} -e->f=e->t=(-1); -e->u.s.info=reg; -e->k=VNONRELOC; -} -static void luaK_exp2nextreg(FuncState*fs,expdesc*e){ -luaK_dischargevars(fs,e); -freeexp(fs,e); -luaK_reserveregs(fs,1); -exp2reg(fs,e,fs->freereg-1); -} -static int luaK_exp2anyreg(FuncState*fs,expdesc*e){ -luaK_dischargevars(fs,e); -if(e->k==VNONRELOC){ -if(!hasjumps(e))return e->u.s.info; -if(e->u.s.info>=fs->nactvar){ -exp2reg(fs,e,e->u.s.info); -return e->u.s.info; -} -} -luaK_exp2nextreg(fs,e); -return e->u.s.info; -} -static void luaK_exp2val(FuncState*fs,expdesc*e){ -if(hasjumps(e)) -luaK_exp2anyreg(fs,e); -else -luaK_dischargevars(fs,e); -} -static int luaK_exp2RK(FuncState*fs,expdesc*e){ -luaK_exp2val(fs,e); -switch(e->k){ -case VKNUM: -case VTRUE: -case VFALSE: -case VNIL:{ -if(fs->nk<=((1<<(9-1))-1)){ -e->u.s.info=(e->k==VNIL)?nilK(fs): -(e->k==VKNUM)?luaK_numberK(fs,e->u.nval): -boolK(fs,(e->k==VTRUE)); -e->k=VK; -return RKASK(e->u.s.info); -} -else break; -} -case VK:{ -if(e->u.s.info<=((1<<(9-1))-1)) -return RKASK(e->u.s.info); -else break; -} -default:break; -} -return luaK_exp2anyreg(fs,e); -} -static void luaK_storevar(FuncState*fs,expdesc*var,expdesc*ex){ -switch(var->k){ -case VLOCAL:{ -freeexp(fs,ex); -exp2reg(fs,ex,var->u.s.info); -return; -} -case VUPVAL:{ -int e=luaK_exp2anyreg(fs,ex); -luaK_codeABC(fs,OP_SETUPVAL,e,var->u.s.info,0); -break; -} -case VGLOBAL:{ -int e=luaK_exp2anyreg(fs,ex); -luaK_codeABx(fs,OP_SETGLOBAL,e,var->u.s.info); -break; -} -case VINDEXED:{ -int e=luaK_exp2RK(fs,ex); -luaK_codeABC(fs,OP_SETTABLE,var->u.s.info,var->u.s.aux,e); -break; -} -default:{ -break; -} -} -freeexp(fs,ex); -} -static void luaK_self(FuncState*fs,expdesc*e,expdesc*key){ -int func; -luaK_exp2anyreg(fs,e); -freeexp(fs,e); -func=fs->freereg; -luaK_reserveregs(fs,2); -luaK_codeABC(fs,OP_SELF,func,e->u.s.info,luaK_exp2RK(fs,key)); -freeexp(fs,key); -e->u.s.info=func; -e->k=VNONRELOC; -} -static void invertjump(FuncState*fs,expdesc*e){ -Instruction*pc=getjumpcontrol(fs,e->u.s.info); -SETARG_A(*pc,!(GETARG_A(*pc))); -} -static int jumponcond(FuncState*fs,expdesc*e,int cond){ -if(e->k==VRELOCABLE){ -Instruction ie=getcode(fs,e); -if(GET_OPCODE(ie)==OP_NOT){ -fs->pc--; -return condjump(fs,OP_TEST,GETARG_B(ie),0,!cond); -} -} -discharge2anyreg(fs,e); -freeexp(fs,e); -return condjump(fs,OP_TESTSET,((1<<8)-1),e->u.s.info,cond); -} -static void luaK_goiftrue(FuncState*fs,expdesc*e){ -int pc; -luaK_dischargevars(fs,e); -switch(e->k){ -case VK:case VKNUM:case VTRUE:{ -pc=(-1); -break; -} -case VJMP:{ -invertjump(fs,e); -pc=e->u.s.info; -break; -} -default:{ -pc=jumponcond(fs,e,0); -break; -} -} -luaK_concat(fs,&e->f,pc); -luaK_patchtohere(fs,e->t); -e->t=(-1); -} -static void luaK_goiffalse(FuncState*fs,expdesc*e){ -int pc; -luaK_dischargevars(fs,e); -switch(e->k){ -case VNIL:case VFALSE:{ -pc=(-1); -break; -} -case VJMP:{ -pc=e->u.s.info; -break; -} -default:{ -pc=jumponcond(fs,e,1); -break; -} -} -luaK_concat(fs,&e->t,pc); -luaK_patchtohere(fs,e->f); -e->f=(-1); -} -static void codenot(FuncState*fs,expdesc*e){ -luaK_dischargevars(fs,e); -switch(e->k){ -case VNIL:case VFALSE:{ -e->k=VTRUE; -break; -} -case VK:case VKNUM:case VTRUE:{ -e->k=VFALSE; -break; -} -case VJMP:{ -invertjump(fs,e); -break; -} -case VRELOCABLE: -case VNONRELOC:{ -discharge2anyreg(fs,e); -freeexp(fs,e); -e->u.s.info=luaK_codeABC(fs,OP_NOT,0,e->u.s.info,0); -e->k=VRELOCABLE; -break; -} -default:{ -break; -} -} -{int temp=e->f;e->f=e->t;e->t=temp;} -removevalues(fs,e->f); -removevalues(fs,e->t); -} -static void luaK_indexed(FuncState*fs,expdesc*t,expdesc*k){ -t->u.s.aux=luaK_exp2RK(fs,k); -t->k=VINDEXED; -} -static int constfolding(OpCode op,expdesc*e1,expdesc*e2){ -lua_Number v1,v2,r; -if(!isnumeral(e1)||!isnumeral(e2))return 0; -v1=e1->u.nval; -v2=e2->u.nval; -switch(op){ -case OP_ADD:r=luai_numadd(v1,v2);break; -case OP_SUB:r=luai_numsub(v1,v2);break; -case OP_MUL:r=luai_nummul(v1,v2);break; -case OP_DIV: -if(v2==0)return 0; -r=luai_numdiv(v1,v2);break; -case OP_MOD: -if(v2==0)return 0; -r=luai_nummod(v1,v2);break; -case OP_POW:r=luai_numpow(v1,v2);break; -case OP_UNM:r=luai_numunm(v1);break; -case OP_LEN:return 0; -default:r=0;break; -} -if(luai_numisnan(r))return 0; -e1->u.nval=r; -return 1; -} -static void codearith(FuncState*fs,OpCode op,expdesc*e1,expdesc*e2){ -if(constfolding(op,e1,e2)) -return; -else{ -int o2=(op!=OP_UNM&&op!=OP_LEN)?luaK_exp2RK(fs,e2):0; -int o1=luaK_exp2RK(fs,e1); -if(o1>o2){ -freeexp(fs,e1); -freeexp(fs,e2); -} -else{ -freeexp(fs,e2); -freeexp(fs,e1); -} -e1->u.s.info=luaK_codeABC(fs,op,0,o1,o2); -e1->k=VRELOCABLE; -} -} -static void codecomp(FuncState*fs,OpCode op,int cond,expdesc*e1, -expdesc*e2){ -int o1=luaK_exp2RK(fs,e1); -int o2=luaK_exp2RK(fs,e2); -freeexp(fs,e2); -freeexp(fs,e1); -if(cond==0&&op!=OP_EQ){ -int temp; -temp=o1;o1=o2;o2=temp; -cond=1; -} -e1->u.s.info=condjump(fs,op,cond,o1,o2); -e1->k=VJMP; -} -static void luaK_prefix(FuncState*fs,UnOpr op,expdesc*e){ -expdesc e2; -e2.t=e2.f=(-1);e2.k=VKNUM;e2.u.nval=0; -switch(op){ -case OPR_MINUS:{ -if(!isnumeral(e)) -luaK_exp2anyreg(fs,e); -codearith(fs,OP_UNM,e,&e2); -break; -} -case OPR_NOT:codenot(fs,e);break; -case OPR_LEN:{ -luaK_exp2anyreg(fs,e); -codearith(fs,OP_LEN,e,&e2); -break; -} -default:; -} -} -static void luaK_infix(FuncState*fs,BinOpr op,expdesc*v){ -switch(op){ -case OPR_AND:{ -luaK_goiftrue(fs,v); -break; -} -case OPR_OR:{ -luaK_goiffalse(fs,v); -break; -} -case OPR_CONCAT:{ -luaK_exp2nextreg(fs,v); -break; -} -case OPR_ADD:case OPR_SUB:case OPR_MUL:case OPR_DIV: -case OPR_MOD:case OPR_POW:{ -if(!isnumeral(v))luaK_exp2RK(fs,v); -break; -} -default:{ -luaK_exp2RK(fs,v); -break; -} -} -} -static void luaK_posfix(FuncState*fs,BinOpr op,expdesc*e1,expdesc*e2){ -switch(op){ -case OPR_AND:{ -luaK_dischargevars(fs,e2); -luaK_concat(fs,&e2->f,e1->f); -*e1=*e2; -break; -} -case OPR_OR:{ -luaK_dischargevars(fs,e2); -luaK_concat(fs,&e2->t,e1->t); -*e1=*e2; -break; -} -case OPR_CONCAT:{ -luaK_exp2val(fs,e2); -if(e2->k==VRELOCABLE&&GET_OPCODE(getcode(fs,e2))==OP_CONCAT){ -freeexp(fs,e1); -SETARG_B(getcode(fs,e2),e1->u.s.info); -e1->k=VRELOCABLE;e1->u.s.info=e2->u.s.info; -} -else{ -luaK_exp2nextreg(fs,e2); -codearith(fs,OP_CONCAT,e1,e2); -} -break; -} -case OPR_ADD:codearith(fs,OP_ADD,e1,e2);break; -case OPR_SUB:codearith(fs,OP_SUB,e1,e2);break; -case OPR_MUL:codearith(fs,OP_MUL,e1,e2);break; -case OPR_DIV:codearith(fs,OP_DIV,e1,e2);break; -case OPR_MOD:codearith(fs,OP_MOD,e1,e2);break; -case OPR_POW:codearith(fs,OP_POW,e1,e2);break; -case OPR_EQ:codecomp(fs,OP_EQ,1,e1,e2);break; -case OPR_NE:codecomp(fs,OP_EQ,0,e1,e2);break; -case OPR_LT:codecomp(fs,OP_LT,1,e1,e2);break; -case OPR_LE:codecomp(fs,OP_LE,1,e1,e2);break; -case OPR_GT:codecomp(fs,OP_LT,0,e1,e2);break; -case OPR_GE:codecomp(fs,OP_LE,0,e1,e2);break; -default:; -} -} -static void luaK_fixline(FuncState*fs,int line){ -fs->f->lineinfo[fs->pc-1]=line; -} -static int luaK_code(FuncState*fs,Instruction i,int line){ -Proto*f=fs->f; -dischargejpc(fs); -luaM_growvector(fs->L,f->code,fs->pc,f->sizecode,Instruction, -(INT_MAX-2),"code size overflow"); -f->code[fs->pc]=i; -luaM_growvector(fs->L,f->lineinfo,fs->pc,f->sizelineinfo,int, -(INT_MAX-2),"code size overflow"); -f->lineinfo[fs->pc]=line; -return fs->pc++; -} -static int luaK_codeABC(FuncState*fs,OpCode o,int a,int b,int c){ -return luaK_code(fs,CREATE_ABC(o,a,b,c),fs->ls->lastline); -} -static int luaK_codeABx(FuncState*fs,OpCode o,int a,unsigned int bc){ -return luaK_code(fs,CREATE_ABx(o,a,bc),fs->ls->lastline); -} -static void luaK_setlist(FuncState*fs,int base,int nelems,int tostore){ -int c=(nelems-1)/50+1; -int b=(tostore==(-1))?0:tostore; -if(c<=((1<<9)-1)) -luaK_codeABC(fs,OP_SETLIST,base,b,c); -else{ -luaK_codeABC(fs,OP_SETLIST,base,b,0); -luaK_code(fs,cast(Instruction,c),fs->ls->lastline); -} -fs->freereg=base+1; -} -#define hasmultret(k)((k)==VCALL||(k)==VVARARG) -#define getlocvar(fs,i)((fs)->f->locvars[(fs)->actvar[i]]) -#define luaY_checklimit(fs,v,l,m)if((v)>(l))errorlimit(fs,l,m) -typedef struct BlockCnt{ -struct BlockCnt*previous; -int breaklist; -lu_byte nactvar; -lu_byte upval; -lu_byte isbreakable; -}BlockCnt; -static void chunk(LexState*ls); -static void expr(LexState*ls,expdesc*v); -static void anchor_token(LexState*ls){ -if(ls->t.token==TK_NAME||ls->t.token==TK_STRING){ -TString*ts=ls->t.seminfo.ts; -luaX_newstring(ls,getstr(ts),ts->tsv.len); -} -} -static void error_expected(LexState*ls,int token){ -luaX_syntaxerror(ls, -luaO_pushfstring(ls->L,LUA_QL("%s")" expected",luaX_token2str(ls,token))); -} -static void errorlimit(FuncState*fs,int limit,const char*what){ -const char*msg=(fs->f->linedefined==0)? -luaO_pushfstring(fs->L,"main function has more than %d %s",limit,what): -luaO_pushfstring(fs->L,"function at line %d has more than %d %s", -fs->f->linedefined,limit,what); -luaX_lexerror(fs->ls,msg,0); -} -static int testnext(LexState*ls,int c){ -if(ls->t.token==c){ -luaX_next(ls); -return 1; -} -else return 0; -} -static void check(LexState*ls,int c){ -if(ls->t.token!=c) -error_expected(ls,c); -} -static void checknext(LexState*ls,int c){ -check(ls,c); -luaX_next(ls); -} -#define check_condition(ls,c,msg){if(!(c))luaX_syntaxerror(ls,msg);} -static void check_match(LexState*ls,int what,int who,int where){ -if(!testnext(ls,what)){ -if(where==ls->linenumber) -error_expected(ls,what); -else{ -luaX_syntaxerror(ls,luaO_pushfstring(ls->L, -LUA_QL("%s")" expected (to close "LUA_QL("%s")" at line %d)", -luaX_token2str(ls,what),luaX_token2str(ls,who),where)); -} -} -} -static TString*str_checkname(LexState*ls){ -TString*ts; -check(ls,TK_NAME); -ts=ls->t.seminfo.ts; -luaX_next(ls); -return ts; -} -static void init_exp(expdesc*e,expkind k,int i){ -e->f=e->t=(-1); -e->k=k; -e->u.s.info=i; -} -static void codestring(LexState*ls,expdesc*e,TString*s){ -init_exp(e,VK,luaK_stringK(ls->fs,s)); -} -static void checkname(LexState*ls,expdesc*e){ -codestring(ls,e,str_checkname(ls)); -} -static int registerlocalvar(LexState*ls,TString*varname){ -FuncState*fs=ls->fs; -Proto*f=fs->f; -int oldsize=f->sizelocvars; -luaM_growvector(ls->L,f->locvars,fs->nlocvars,f->sizelocvars, -LocVar,SHRT_MAX,"too many local variables"); -while(oldsizesizelocvars)f->locvars[oldsize++].varname=NULL; -f->locvars[fs->nlocvars].varname=varname; -luaC_objbarrier(ls->L,f,varname); -return fs->nlocvars++; -} -#define new_localvarliteral(ls,v,n)new_localvar(ls,luaX_newstring(ls,""v,(sizeof(v)/sizeof(char))-1),n) -static void new_localvar(LexState*ls,TString*name,int n){ -FuncState*fs=ls->fs; -luaY_checklimit(fs,fs->nactvar+n+1,200,"local variables"); -fs->actvar[fs->nactvar+n]=cast(unsigned short,registerlocalvar(ls,name)); -} -static void adjustlocalvars(LexState*ls,int nvars){ -FuncState*fs=ls->fs; -fs->nactvar=cast_byte(fs->nactvar+nvars); -for(;nvars;nvars--){ -getlocvar(fs,fs->nactvar-nvars).startpc=fs->pc; -} -} -static void removevars(LexState*ls,int tolevel){ -FuncState*fs=ls->fs; -while(fs->nactvar>tolevel) -getlocvar(fs,--fs->nactvar).endpc=fs->pc; -} -static int indexupvalue(FuncState*fs,TString*name,expdesc*v){ -int i; -Proto*f=fs->f; -int oldsize=f->sizeupvalues; -for(i=0;inups;i++){ -if(fs->upvalues[i].k==v->k&&fs->upvalues[i].info==v->u.s.info){ -return i; -} -} -luaY_checklimit(fs,f->nups+1,60,"upvalues"); -luaM_growvector(fs->L,f->upvalues,f->nups,f->sizeupvalues, -TString*,(INT_MAX-2),""); -while(oldsizesizeupvalues)f->upvalues[oldsize++]=NULL; -f->upvalues[f->nups]=name; -luaC_objbarrier(fs->L,f,name); -fs->upvalues[f->nups].k=cast_byte(v->k); -fs->upvalues[f->nups].info=cast_byte(v->u.s.info); -return f->nups++; -} -static int searchvar(FuncState*fs,TString*n){ -int i; -for(i=fs->nactvar-1;i>=0;i--){ -if(n==getlocvar(fs,i).varname) -return i; -} -return-1; -} -static void markupval(FuncState*fs,int level){ -BlockCnt*bl=fs->bl; -while(bl&&bl->nactvar>level)bl=bl->previous; -if(bl)bl->upval=1; -} -static int singlevaraux(FuncState*fs,TString*n,expdesc*var,int base){ -if(fs==NULL){ -init_exp(var,VGLOBAL,((1<<8)-1)); -return VGLOBAL; -} -else{ -int v=searchvar(fs,n); -if(v>=0){ -init_exp(var,VLOCAL,v); -if(!base) -markupval(fs,v); -return VLOCAL; -} -else{ -if(singlevaraux(fs->prev,n,var,0)==VGLOBAL) -return VGLOBAL; -var->u.s.info=indexupvalue(fs,n,var); -var->k=VUPVAL; -return VUPVAL; -} -} -} -static void singlevar(LexState*ls,expdesc*var){ -TString*varname=str_checkname(ls); -FuncState*fs=ls->fs; -if(singlevaraux(fs,varname,var,1)==VGLOBAL) -var->u.s.info=luaK_stringK(fs,varname); -} -static void adjust_assign(LexState*ls,int nvars,int nexps,expdesc*e){ -FuncState*fs=ls->fs; -int extra=nvars-nexps; -if(hasmultret(e->k)){ -extra++; -if(extra<0)extra=0; -luaK_setreturns(fs,e,extra); -if(extra>1)luaK_reserveregs(fs,extra-1); -} -else{ -if(e->k!=VVOID)luaK_exp2nextreg(fs,e); -if(extra>0){ -int reg=fs->freereg; -luaK_reserveregs(fs,extra); -luaK_nil(fs,reg,extra); -} -} -} -static void enterlevel(LexState*ls){ -if(++ls->L->nCcalls>200) -luaX_lexerror(ls,"chunk has too many syntax levels",0); -} -#define leavelevel(ls)((ls)->L->nCcalls--) -static void enterblock(FuncState*fs,BlockCnt*bl,lu_byte isbreakable){ -bl->breaklist=(-1); -bl->isbreakable=isbreakable; -bl->nactvar=fs->nactvar; -bl->upval=0; -bl->previous=fs->bl; -fs->bl=bl; -} -static void leaveblock(FuncState*fs){ -BlockCnt*bl=fs->bl; -fs->bl=bl->previous; -removevars(fs->ls,bl->nactvar); -if(bl->upval) -luaK_codeABC(fs,OP_CLOSE,bl->nactvar,0,0); -fs->freereg=fs->nactvar; -luaK_patchtohere(fs,bl->breaklist); -} -static void pushclosure(LexState*ls,FuncState*func,expdesc*v){ -FuncState*fs=ls->fs; -Proto*f=fs->f; -int oldsize=f->sizep; -int i; -luaM_growvector(ls->L,f->p,fs->np,f->sizep,Proto*, -((1<<(9+9))-1),"constant table overflow"); -while(oldsizesizep)f->p[oldsize++]=NULL; -f->p[fs->np++]=func->f; -luaC_objbarrier(ls->L,f,func->f); -init_exp(v,VRELOCABLE,luaK_codeABx(fs,OP_CLOSURE,0,fs->np-1)); -for(i=0;if->nups;i++){ -OpCode o=(func->upvalues[i].k==VLOCAL)?OP_MOVE:OP_GETUPVAL; -luaK_codeABC(fs,o,0,func->upvalues[i].info,0); -} -} -static void open_func(LexState*ls,FuncState*fs){ -lua_State*L=ls->L; -Proto*f=luaF_newproto(L); -fs->f=f; -fs->prev=ls->fs; -fs->ls=ls; -fs->L=L; -ls->fs=fs; -fs->pc=0; -fs->lasttarget=-1; -fs->jpc=(-1); -fs->freereg=0; -fs->nk=0; -fs->np=0; -fs->nlocvars=0; -fs->nactvar=0; -fs->bl=NULL; -f->source=ls->source; -f->maxstacksize=2; -fs->h=luaH_new(L,0,0); -sethvalue(L,L->top,fs->h); -incr_top(L); -setptvalue(L,L->top,f); -incr_top(L); -} -static void close_func(LexState*ls){ -lua_State*L=ls->L; -FuncState*fs=ls->fs; -Proto*f=fs->f; -removevars(ls,0); -luaK_ret(fs,0,0); -luaM_reallocvector(L,f->code,f->sizecode,fs->pc,Instruction); -f->sizecode=fs->pc; -luaM_reallocvector(L,f->lineinfo,f->sizelineinfo,fs->pc,int); -f->sizelineinfo=fs->pc; -luaM_reallocvector(L,f->k,f->sizek,fs->nk,TValue); -f->sizek=fs->nk; -luaM_reallocvector(L,f->p,f->sizep,fs->np,Proto*); -f->sizep=fs->np; -luaM_reallocvector(L,f->locvars,f->sizelocvars,fs->nlocvars,LocVar); -f->sizelocvars=fs->nlocvars; -luaM_reallocvector(L,f->upvalues,f->sizeupvalues,f->nups,TString*); -f->sizeupvalues=f->nups; -ls->fs=fs->prev; -if(fs)anchor_token(ls); -L->top-=2; -} -static Proto*luaY_parser(lua_State*L,ZIO*z,Mbuffer*buff,const char*name){ -struct LexState lexstate; -struct FuncState funcstate; -lexstate.buff=buff; -luaX_setinput(L,&lexstate,z,luaS_new(L,name)); -open_func(&lexstate,&funcstate); -funcstate.f->is_vararg=2; -luaX_next(&lexstate); -chunk(&lexstate); -check(&lexstate,TK_EOS); -close_func(&lexstate); -return funcstate.f; -} -static void field(LexState*ls,expdesc*v){ -FuncState*fs=ls->fs; -expdesc key; -luaK_exp2anyreg(fs,v); -luaX_next(ls); -checkname(ls,&key); -luaK_indexed(fs,v,&key); -} -static void yindex(LexState*ls,expdesc*v){ -luaX_next(ls); -expr(ls,v); -luaK_exp2val(ls->fs,v); -checknext(ls,']'); -} -struct ConsControl{ -expdesc v; -expdesc*t; -int nh; -int na; -int tostore; -}; -static void recfield(LexState*ls,struct ConsControl*cc){ -FuncState*fs=ls->fs; -int reg=ls->fs->freereg; -expdesc key,val; -int rkkey; -if(ls->t.token==TK_NAME){ -luaY_checklimit(fs,cc->nh,(INT_MAX-2),"items in a constructor"); -checkname(ls,&key); -} -else -yindex(ls,&key); -cc->nh++; -checknext(ls,'='); -rkkey=luaK_exp2RK(fs,&key); -expr(ls,&val); -luaK_codeABC(fs,OP_SETTABLE,cc->t->u.s.info,rkkey,luaK_exp2RK(fs,&val)); -fs->freereg=reg; -} -static void closelistfield(FuncState*fs,struct ConsControl*cc){ -if(cc->v.k==VVOID)return; -luaK_exp2nextreg(fs,&cc->v); -cc->v.k=VVOID; -if(cc->tostore==50){ -luaK_setlist(fs,cc->t->u.s.info,cc->na,cc->tostore); -cc->tostore=0; -} -} -static void lastlistfield(FuncState*fs,struct ConsControl*cc){ -if(cc->tostore==0)return; -if(hasmultret(cc->v.k)){ -luaK_setmultret(fs,&cc->v); -luaK_setlist(fs,cc->t->u.s.info,cc->na,(-1)); -cc->na--; -} -else{ -if(cc->v.k!=VVOID) -luaK_exp2nextreg(fs,&cc->v); -luaK_setlist(fs,cc->t->u.s.info,cc->na,cc->tostore); -} -} -static void listfield(LexState*ls,struct ConsControl*cc){ -expr(ls,&cc->v); -luaY_checklimit(ls->fs,cc->na,(INT_MAX-2),"items in a constructor"); -cc->na++; -cc->tostore++; -} -static void constructor(LexState*ls,expdesc*t){ -FuncState*fs=ls->fs; -int line=ls->linenumber; -int pc=luaK_codeABC(fs,OP_NEWTABLE,0,0,0); -struct ConsControl cc; -cc.na=cc.nh=cc.tostore=0; -cc.t=t; -init_exp(t,VRELOCABLE,pc); -init_exp(&cc.v,VVOID,0); -luaK_exp2nextreg(ls->fs,t); -checknext(ls,'{'); -do{ -if(ls->t.token=='}')break; -closelistfield(fs,&cc); -switch(ls->t.token){ -case TK_NAME:{ -luaX_lookahead(ls); -if(ls->lookahead.token!='=') -listfield(ls,&cc); -else -recfield(ls,&cc); -break; -} -case'[':{ -recfield(ls,&cc); -break; -} -default:{ -listfield(ls,&cc); -break; -} -} -}while(testnext(ls,',')||testnext(ls,';')); -check_match(ls,'}','{',line); -lastlistfield(fs,&cc); -SETARG_B(fs->f->code[pc],luaO_int2fb(cc.na)); -SETARG_C(fs->f->code[pc],luaO_int2fb(cc.nh)); -} -static void parlist(LexState*ls){ -FuncState*fs=ls->fs; -Proto*f=fs->f; -int nparams=0; -f->is_vararg=0; -if(ls->t.token!=')'){ -do{ -switch(ls->t.token){ -case TK_NAME:{ -new_localvar(ls,str_checkname(ls),nparams++); -break; -} -case TK_DOTS:{ -luaX_next(ls); -f->is_vararg|=2; -break; -} -default:luaX_syntaxerror(ls," or "LUA_QL("...")" expected"); -} -}while(!f->is_vararg&&testnext(ls,',')); -} -adjustlocalvars(ls,nparams); -f->numparams=cast_byte(fs->nactvar-(f->is_vararg&1)); -luaK_reserveregs(fs,fs->nactvar); -} -static void body(LexState*ls,expdesc*e,int needself,int line){ -FuncState new_fs; -open_func(ls,&new_fs); -new_fs.f->linedefined=line; -checknext(ls,'('); -if(needself){ -new_localvarliteral(ls,"self",0); -adjustlocalvars(ls,1); -} -parlist(ls); -checknext(ls,')'); -chunk(ls); -new_fs.f->lastlinedefined=ls->linenumber; -check_match(ls,TK_END,TK_FUNCTION,line); -close_func(ls); -pushclosure(ls,&new_fs,e); -} -static int explist1(LexState*ls,expdesc*v){ -int n=1; -expr(ls,v); -while(testnext(ls,',')){ -luaK_exp2nextreg(ls->fs,v); -expr(ls,v); -n++; -} -return n; -} -static void funcargs(LexState*ls,expdesc*f){ -FuncState*fs=ls->fs; -expdesc args; -int base,nparams; -int line=ls->linenumber; -switch(ls->t.token){ -case'(':{ -if(line!=ls->lastline) -luaX_syntaxerror(ls,"ambiguous syntax (function call x new statement)"); -luaX_next(ls); -if(ls->t.token==')') -args.k=VVOID; -else{ -explist1(ls,&args); -luaK_setmultret(fs,&args); -} -check_match(ls,')','(',line); -break; -} -case'{':{ -constructor(ls,&args); -break; -} -case TK_STRING:{ -codestring(ls,&args,ls->t.seminfo.ts); -luaX_next(ls); -break; -} -default:{ -luaX_syntaxerror(ls,"function arguments expected"); -return; -} -} -base=f->u.s.info; -if(hasmultret(args.k)) -nparams=(-1); -else{ -if(args.k!=VVOID) -luaK_exp2nextreg(fs,&args); -nparams=fs->freereg-(base+1); -} -init_exp(f,VCALL,luaK_codeABC(fs,OP_CALL,base,nparams+1,2)); -luaK_fixline(fs,line); -fs->freereg=base+1; -} -static void prefixexp(LexState*ls,expdesc*v){ -switch(ls->t.token){ -case'(':{ -int line=ls->linenumber; -luaX_next(ls); -expr(ls,v); -check_match(ls,')','(',line); -luaK_dischargevars(ls->fs,v); -return; -} -case TK_NAME:{ -singlevar(ls,v); -return; -} -default:{ -luaX_syntaxerror(ls,"unexpected symbol"); -return; -} -} -} -static void primaryexp(LexState*ls,expdesc*v){ -FuncState*fs=ls->fs; -prefixexp(ls,v); -for(;;){ -switch(ls->t.token){ -case'.':{ -field(ls,v); -break; -} -case'[':{ -expdesc key; -luaK_exp2anyreg(fs,v); -yindex(ls,&key); -luaK_indexed(fs,v,&key); -break; -} -case':':{ -expdesc key; -luaX_next(ls); -checkname(ls,&key); -luaK_self(fs,v,&key); -funcargs(ls,v); -break; -} -case'(':case TK_STRING:case'{':{ -luaK_exp2nextreg(fs,v); -funcargs(ls,v); -break; -} -default:return; -} -} -} -static void simpleexp(LexState*ls,expdesc*v){ -switch(ls->t.token){ -case TK_NUMBER:{ -init_exp(v,VKNUM,0); -v->u.nval=ls->t.seminfo.r; -break; -} -case TK_STRING:{ -codestring(ls,v,ls->t.seminfo.ts); -break; -} -case TK_NIL:{ -init_exp(v,VNIL,0); -break; -} -case TK_TRUE:{ -init_exp(v,VTRUE,0); -break; -} -case TK_FALSE:{ -init_exp(v,VFALSE,0); -break; -} -case TK_DOTS:{ -FuncState*fs=ls->fs; -check_condition(ls,fs->f->is_vararg, -"cannot use "LUA_QL("...")" outside a vararg function"); -fs->f->is_vararg&=~4; -init_exp(v,VVARARG,luaK_codeABC(fs,OP_VARARG,0,1,0)); -break; -} -case'{':{ -constructor(ls,v); -return; -} -case TK_FUNCTION:{ -luaX_next(ls); -body(ls,v,0,ls->linenumber); -return; -} -default:{ -primaryexp(ls,v); -return; -} -} -luaX_next(ls); -} -static UnOpr getunopr(int op){ -switch(op){ -case TK_NOT:return OPR_NOT; -case'-':return OPR_MINUS; -case'#':return OPR_LEN; -default:return OPR_NOUNOPR; -} -} -static BinOpr getbinopr(int op){ -switch(op){ -case'+':return OPR_ADD; -case'-':return OPR_SUB; -case'*':return OPR_MUL; -case'/':return OPR_DIV; -case'%':return OPR_MOD; -case'^':return OPR_POW; -case TK_CONCAT:return OPR_CONCAT; -case TK_NE:return OPR_NE; -case TK_EQ:return OPR_EQ; -case'<':return OPR_LT; -case TK_LE:return OPR_LE; -case'>':return OPR_GT; -case TK_GE:return OPR_GE; -case TK_AND:return OPR_AND; -case TK_OR:return OPR_OR; -default:return OPR_NOBINOPR; -} -} -static const struct{ -lu_byte left; -lu_byte right; -}priority[]={ -{6,6},{6,6},{7,7},{7,7},{7,7}, -{10,9},{5,4}, -{3,3},{3,3}, -{3,3},{3,3},{3,3},{3,3}, -{2,2},{1,1} -}; -static BinOpr subexpr(LexState*ls,expdesc*v,unsigned int limit){ -BinOpr op; -UnOpr uop; -enterlevel(ls); -uop=getunopr(ls->t.token); -if(uop!=OPR_NOUNOPR){ -luaX_next(ls); -subexpr(ls,v,8); -luaK_prefix(ls->fs,uop,v); -} -else simpleexp(ls,v); -op=getbinopr(ls->t.token); -while(op!=OPR_NOBINOPR&&priority[op].left>limit){ -expdesc v2; -BinOpr nextop; -luaX_next(ls); -luaK_infix(ls->fs,op,v); -nextop=subexpr(ls,&v2,priority[op].right); -luaK_posfix(ls->fs,op,v,&v2); -op=nextop; -} -leavelevel(ls); -return op; -} -static void expr(LexState*ls,expdesc*v){ -subexpr(ls,v,0); -} -static int block_follow(int token){ -switch(token){ -case TK_ELSE:case TK_ELSEIF:case TK_END: -case TK_UNTIL:case TK_EOS: -return 1; -default:return 0; -} -} -static void block(LexState*ls){ -FuncState*fs=ls->fs; -BlockCnt bl; -enterblock(fs,&bl,0); -chunk(ls); -leaveblock(fs); -} -struct LHS_assign{ -struct LHS_assign*prev; -expdesc v; -}; -static void check_conflict(LexState*ls,struct LHS_assign*lh,expdesc*v){ -FuncState*fs=ls->fs; -int extra=fs->freereg; -int conflict=0; -for(;lh;lh=lh->prev){ -if(lh->v.k==VINDEXED){ -if(lh->v.u.s.info==v->u.s.info){ -conflict=1; -lh->v.u.s.info=extra; -} -if(lh->v.u.s.aux==v->u.s.info){ -conflict=1; -lh->v.u.s.aux=extra; -} -} -} -if(conflict){ -luaK_codeABC(fs,OP_MOVE,fs->freereg,v->u.s.info,0); -luaK_reserveregs(fs,1); -} -} -static void assignment(LexState*ls,struct LHS_assign*lh,int nvars){ -expdesc e; -check_condition(ls,VLOCAL<=lh->v.k&&lh->v.k<=VINDEXED, -"syntax error"); -if(testnext(ls,',')){ -struct LHS_assign nv; -nv.prev=lh; -primaryexp(ls,&nv.v); -if(nv.v.k==VLOCAL) -check_conflict(ls,lh,&nv.v); -luaY_checklimit(ls->fs,nvars,200-ls->L->nCcalls, -"variables in assignment"); -assignment(ls,&nv,nvars+1); -} -else{ -int nexps; -checknext(ls,'='); -nexps=explist1(ls,&e); -if(nexps!=nvars){ -adjust_assign(ls,nvars,nexps,&e); -if(nexps>nvars) -ls->fs->freereg-=nexps-nvars; -} -else{ -luaK_setoneret(ls->fs,&e); -luaK_storevar(ls->fs,&lh->v,&e); -return; -} -} -init_exp(&e,VNONRELOC,ls->fs->freereg-1); -luaK_storevar(ls->fs,&lh->v,&e); -} -static int cond(LexState*ls){ -expdesc v; -expr(ls,&v); -if(v.k==VNIL)v.k=VFALSE; -luaK_goiftrue(ls->fs,&v); -return v.f; -} -static void breakstat(LexState*ls){ -FuncState*fs=ls->fs; -BlockCnt*bl=fs->bl; -int upval=0; -while(bl&&!bl->isbreakable){ -upval|=bl->upval; -bl=bl->previous; -} -if(!bl) -luaX_syntaxerror(ls,"no loop to break"); -if(upval) -luaK_codeABC(fs,OP_CLOSE,bl->nactvar,0,0); -luaK_concat(fs,&bl->breaklist,luaK_jump(fs)); -} -static void whilestat(LexState*ls,int line){ -FuncState*fs=ls->fs; -int whileinit; -int condexit; -BlockCnt bl; -luaX_next(ls); -whileinit=luaK_getlabel(fs); -condexit=cond(ls); -enterblock(fs,&bl,1); -checknext(ls,TK_DO); -block(ls); -luaK_patchlist(fs,luaK_jump(fs),whileinit); -check_match(ls,TK_END,TK_WHILE,line); -leaveblock(fs); -luaK_patchtohere(fs,condexit); -} -static void repeatstat(LexState*ls,int line){ -int condexit; -FuncState*fs=ls->fs; -int repeat_init=luaK_getlabel(fs); -BlockCnt bl1,bl2; -enterblock(fs,&bl1,1); -enterblock(fs,&bl2,0); -luaX_next(ls); -chunk(ls); -check_match(ls,TK_UNTIL,TK_REPEAT,line); -condexit=cond(ls); -if(!bl2.upval){ -leaveblock(fs); -luaK_patchlist(ls->fs,condexit,repeat_init); -} -else{ -breakstat(ls); -luaK_patchtohere(ls->fs,condexit); -leaveblock(fs); -luaK_patchlist(ls->fs,luaK_jump(fs),repeat_init); -} -leaveblock(fs); -} -static int exp1(LexState*ls){ -expdesc e; -int k; -expr(ls,&e); -k=e.k; -luaK_exp2nextreg(ls->fs,&e); -return k; -} -static void forbody(LexState*ls,int base,int line,int nvars,int isnum){ -BlockCnt bl; -FuncState*fs=ls->fs; -int prep,endfor; -adjustlocalvars(ls,3); -checknext(ls,TK_DO); -prep=isnum?luaK_codeAsBx(fs,OP_FORPREP,base,(-1)):luaK_jump(fs); -enterblock(fs,&bl,0); -adjustlocalvars(ls,nvars); -luaK_reserveregs(fs,nvars); -block(ls); -leaveblock(fs); -luaK_patchtohere(fs,prep); -endfor=(isnum)?luaK_codeAsBx(fs,OP_FORLOOP,base,(-1)): -luaK_codeABC(fs,OP_TFORLOOP,base,0,nvars); -luaK_fixline(fs,line); -luaK_patchlist(fs,(isnum?endfor:luaK_jump(fs)),prep+1); -} -static void fornum(LexState*ls,TString*varname,int line){ -FuncState*fs=ls->fs; -int base=fs->freereg; -new_localvarliteral(ls,"(for index)",0); -new_localvarliteral(ls,"(for limit)",1); -new_localvarliteral(ls,"(for step)",2); -new_localvar(ls,varname,3); -checknext(ls,'='); -exp1(ls); -checknext(ls,','); -exp1(ls); -if(testnext(ls,',')) -exp1(ls); -else{ -luaK_codeABx(fs,OP_LOADK,fs->freereg,luaK_numberK(fs,1)); -luaK_reserveregs(fs,1); -} -forbody(ls,base,line,1,1); -} -static void forlist(LexState*ls,TString*indexname){ -FuncState*fs=ls->fs; -expdesc e; -int nvars=0; -int line; -int base=fs->freereg; -new_localvarliteral(ls,"(for generator)",nvars++); -new_localvarliteral(ls,"(for state)",nvars++); -new_localvarliteral(ls,"(for control)",nvars++); -new_localvar(ls,indexname,nvars++); -while(testnext(ls,',')) -new_localvar(ls,str_checkname(ls),nvars++); -checknext(ls,TK_IN); -line=ls->linenumber; -adjust_assign(ls,3,explist1(ls,&e),&e); -luaK_checkstack(fs,3); -forbody(ls,base,line,nvars-3,0); -} -static void forstat(LexState*ls,int line){ -FuncState*fs=ls->fs; -TString*varname; -BlockCnt bl; -enterblock(fs,&bl,1); -luaX_next(ls); -varname=str_checkname(ls); -switch(ls->t.token){ -case'=':fornum(ls,varname,line);break; -case',':case TK_IN:forlist(ls,varname);break; -default:luaX_syntaxerror(ls,LUA_QL("=")" or "LUA_QL("in")" expected"); -} -check_match(ls,TK_END,TK_FOR,line); -leaveblock(fs); -} -static int test_then_block(LexState*ls){ -int condexit; -luaX_next(ls); -condexit=cond(ls); -checknext(ls,TK_THEN); -block(ls); -return condexit; -} -static void ifstat(LexState*ls,int line){ -FuncState*fs=ls->fs; -int flist; -int escapelist=(-1); -flist=test_then_block(ls); -while(ls->t.token==TK_ELSEIF){ -luaK_concat(fs,&escapelist,luaK_jump(fs)); -luaK_patchtohere(fs,flist); -flist=test_then_block(ls); -} -if(ls->t.token==TK_ELSE){ -luaK_concat(fs,&escapelist,luaK_jump(fs)); -luaK_patchtohere(fs,flist); -luaX_next(ls); -block(ls); -} -else -luaK_concat(fs,&escapelist,flist); -luaK_patchtohere(fs,escapelist); -check_match(ls,TK_END,TK_IF,line); -} -static void localfunc(LexState*ls){ -expdesc v,b; -FuncState*fs=ls->fs; -new_localvar(ls,str_checkname(ls),0); -init_exp(&v,VLOCAL,fs->freereg); -luaK_reserveregs(fs,1); -adjustlocalvars(ls,1); -body(ls,&b,0,ls->linenumber); -luaK_storevar(fs,&v,&b); -getlocvar(fs,fs->nactvar-1).startpc=fs->pc; -} -static void localstat(LexState*ls){ -int nvars=0; -int nexps; -expdesc e; -do{ -new_localvar(ls,str_checkname(ls),nvars++); -}while(testnext(ls,',')); -if(testnext(ls,'=')) -nexps=explist1(ls,&e); -else{ -e.k=VVOID; -nexps=0; -} -adjust_assign(ls,nvars,nexps,&e); -adjustlocalvars(ls,nvars); -} -static int funcname(LexState*ls,expdesc*v){ -int needself=0; -singlevar(ls,v); -while(ls->t.token=='.') -field(ls,v); -if(ls->t.token==':'){ -needself=1; -field(ls,v); -} -return needself; -} -static void funcstat(LexState*ls,int line){ -int needself; -expdesc v,b; -luaX_next(ls); -needself=funcname(ls,&v); -body(ls,&b,needself,line); -luaK_storevar(ls->fs,&v,&b); -luaK_fixline(ls->fs,line); -} -static void exprstat(LexState*ls){ -FuncState*fs=ls->fs; -struct LHS_assign v; -primaryexp(ls,&v.v); -if(v.v.k==VCALL) -SETARG_C(getcode(fs,&v.v),1); -else{ -v.prev=NULL; -assignment(ls,&v,1); -} -} -static void retstat(LexState*ls){ -FuncState*fs=ls->fs; -expdesc e; -int first,nret; -luaX_next(ls); -if(block_follow(ls->t.token)||ls->t.token==';') -first=nret=0; -else{ -nret=explist1(ls,&e); -if(hasmultret(e.k)){ -luaK_setmultret(fs,&e); -if(e.k==VCALL&&nret==1){ -SET_OPCODE(getcode(fs,&e),OP_TAILCALL); -} -first=fs->nactvar; -nret=(-1); -} -else{ -if(nret==1) -first=luaK_exp2anyreg(fs,&e); -else{ -luaK_exp2nextreg(fs,&e); -first=fs->nactvar; -} -} -} -luaK_ret(fs,first,nret); -} -static int statement(LexState*ls){ -int line=ls->linenumber; -switch(ls->t.token){ -case TK_IF:{ -ifstat(ls,line); -return 0; -} -case TK_WHILE:{ -whilestat(ls,line); -return 0; -} -case TK_DO:{ -luaX_next(ls); -block(ls); -check_match(ls,TK_END,TK_DO,line); -return 0; -} -case TK_FOR:{ -forstat(ls,line); -return 0; -} -case TK_REPEAT:{ -repeatstat(ls,line); -return 0; -} -case TK_FUNCTION:{ -funcstat(ls,line); -return 0; -} -case TK_LOCAL:{ -luaX_next(ls); -if(testnext(ls,TK_FUNCTION)) -localfunc(ls); -else -localstat(ls); -return 0; -} -case TK_RETURN:{ -retstat(ls); -return 1; -} -case TK_BREAK:{ -luaX_next(ls); -breakstat(ls); -return 1; -} -default:{ -exprstat(ls); -return 0; -} -} -} -static void chunk(LexState*ls){ -int islast=0; -enterlevel(ls); -while(!islast&&!block_follow(ls->t.token)){ -islast=statement(ls); -testnext(ls,';'); -ls->fs->freereg=ls->fs->nactvar; -} -leavelevel(ls); -} -static const TValue*luaV_tonumber(const TValue*obj,TValue*n){ -lua_Number num; -if(ttisnumber(obj))return obj; -if(ttisstring(obj)&&luaO_str2d(svalue(obj),&num)){ -setnvalue(n,num); -return n; -} -else -return NULL; -} -static int luaV_tostring(lua_State*L,StkId obj){ -if(!ttisnumber(obj)) -return 0; -else{ -char s[32]; -lua_Number n=nvalue(obj); -lua_number2str(s,n); -setsvalue(L,obj,luaS_new(L,s)); -return 1; -} -} -static void callTMres(lua_State*L,StkId res,const TValue*f, -const TValue*p1,const TValue*p2){ -ptrdiff_t result=savestack(L,res); -setobj(L,L->top,f); -setobj(L,L->top+1,p1); -setobj(L,L->top+2,p2); -luaD_checkstack(L,3); -L->top+=3; -luaD_call(L,L->top-3,1); -res=restorestack(L,result); -L->top--; -setobj(L,res,L->top); -} -static void callTM(lua_State*L,const TValue*f,const TValue*p1, -const TValue*p2,const TValue*p3){ -setobj(L,L->top,f); -setobj(L,L->top+1,p1); -setobj(L,L->top+2,p2); -setobj(L,L->top+3,p3); -luaD_checkstack(L,4); -L->top+=4; -luaD_call(L,L->top-4,0); -} -static void luaV_gettable(lua_State*L,const TValue*t,TValue*key,StkId val){ -int loop; -for(loop=0;loop<100;loop++){ -const TValue*tm; -if(ttistable(t)){ -Table*h=hvalue(t); -const TValue*res=luaH_get(h,key); -if(!ttisnil(res)|| -(tm=fasttm(L,h->metatable,TM_INDEX))==NULL){ -setobj(L,val,res); -return; -} -} -else if(ttisnil(tm=luaT_gettmbyobj(L,t,TM_INDEX))) -luaG_typeerror(L,t,"index"); -if(ttisfunction(tm)){ -callTMres(L,val,tm,t,key); -return; -} -t=tm; -} -luaG_runerror(L,"loop in gettable"); -} -static void luaV_settable(lua_State*L,const TValue*t,TValue*key,StkId val){ -int loop; -TValue temp; -for(loop=0;loop<100;loop++){ -const TValue*tm; -if(ttistable(t)){ -Table*h=hvalue(t); -TValue*oldval=luaH_set(L,h,key); -if(!ttisnil(oldval)|| -(tm=fasttm(L,h->metatable,TM_NEWINDEX))==NULL){ -setobj(L,oldval,val); -h->flags=0; -luaC_barriert(L,h,val); -return; -} -} -else if(ttisnil(tm=luaT_gettmbyobj(L,t,TM_NEWINDEX))) -luaG_typeerror(L,t,"index"); -if(ttisfunction(tm)){ -callTM(L,tm,t,key,val); -return; -} -setobj(L,&temp,tm); -t=&temp; -} -luaG_runerror(L,"loop in settable"); -} -static int call_binTM(lua_State*L,const TValue*p1,const TValue*p2, -StkId res,TMS event){ -const TValue*tm=luaT_gettmbyobj(L,p1,event); -if(ttisnil(tm)) -tm=luaT_gettmbyobj(L,p2,event); -if(ttisnil(tm))return 0; -callTMres(L,res,tm,p1,p2); -return 1; -} -static const TValue*get_compTM(lua_State*L,Table*mt1,Table*mt2, -TMS event){ -const TValue*tm1=fasttm(L,mt1,event); -const TValue*tm2; -if(tm1==NULL)return NULL; -if(mt1==mt2)return tm1; -tm2=fasttm(L,mt2,event); -if(tm2==NULL)return NULL; -if(luaO_rawequalObj(tm1,tm2)) -return tm1; -return NULL; -} -static int call_orderTM(lua_State*L,const TValue*p1,const TValue*p2, -TMS event){ -const TValue*tm1=luaT_gettmbyobj(L,p1,event); -const TValue*tm2; -if(ttisnil(tm1))return-1; -tm2=luaT_gettmbyobj(L,p2,event); -if(!luaO_rawequalObj(tm1,tm2)) -return-1; -callTMres(L,L->top,tm1,p1,p2); -return!l_isfalse(L->top); -} -static int l_strcmp(const TString*ls,const TString*rs){ -const char*l=getstr(ls); -size_t ll=ls->tsv.len; -const char*r=getstr(rs); -size_t lr=rs->tsv.len; -for(;;){ -int temp=strcoll(l,r); -if(temp!=0)return temp; -else{ -size_t len=strlen(l); -if(len==lr) -return(len==ll)?0:1; -else if(len==ll) -return-1; -len++; -l+=len;ll-=len;r+=len;lr-=len; -} -} -} -static int luaV_lessthan(lua_State*L,const TValue*l,const TValue*r){ -int res; -if(ttype(l)!=ttype(r)) -return luaG_ordererror(L,l,r); -else if(ttisnumber(l)) -return luai_numlt(nvalue(l),nvalue(r)); -else if(ttisstring(l)) -return l_strcmp(rawtsvalue(l),rawtsvalue(r))<0; -else if((res=call_orderTM(L,l,r,TM_LT))!=-1) -return res; -return luaG_ordererror(L,l,r); -} -static int lessequal(lua_State*L,const TValue*l,const TValue*r){ -int res; -if(ttype(l)!=ttype(r)) -return luaG_ordererror(L,l,r); -else if(ttisnumber(l)) -return luai_numle(nvalue(l),nvalue(r)); -else if(ttisstring(l)) -return l_strcmp(rawtsvalue(l),rawtsvalue(r))<=0; -else if((res=call_orderTM(L,l,r,TM_LE))!=-1) -return res; -else if((res=call_orderTM(L,r,l,TM_LT))!=-1) -return!res; -return luaG_ordererror(L,l,r); -} -static int luaV_equalval(lua_State*L,const TValue*t1,const TValue*t2){ -const TValue*tm; -switch(ttype(t1)){ -case 0:return 1; -case 3:return luai_numeq(nvalue(t1),nvalue(t2)); -case 1:return bvalue(t1)==bvalue(t2); -case 2:return pvalue(t1)==pvalue(t2); -case 7:{ -if(uvalue(t1)==uvalue(t2))return 1; -tm=get_compTM(L,uvalue(t1)->metatable,uvalue(t2)->metatable, -TM_EQ); -break; -} -case 5:{ -if(hvalue(t1)==hvalue(t2))return 1; -tm=get_compTM(L,hvalue(t1)->metatable,hvalue(t2)->metatable,TM_EQ); -break; -} -default:return gcvalue(t1)==gcvalue(t2); -} -if(tm==NULL)return 0; -callTMres(L,L->top,tm,t1,t2); -return!l_isfalse(L->top); -} -static void luaV_concat(lua_State*L,int total,int last){ -do{ -StkId top=L->base+last+1; -int n=2; -if(!(ttisstring(top-2)||ttisnumber(top-2))||!tostring(L,top-1)){ -if(!call_binTM(L,top-2,top-1,top-2,TM_CONCAT)) -luaG_concaterror(L,top-2,top-1); -}else if(tsvalue(top-1)->len==0) -(void)tostring(L,top-2); -else{ -size_t tl=tsvalue(top-1)->len; -char*buffer; -int i; -for(n=1;nlen; -if(l>=((size_t)(~(size_t)0)-2)-tl)luaG_runerror(L,"string length overflow"); -tl+=l; -} -buffer=luaZ_openspace(L,&G(L)->buff,tl); -tl=0; -for(i=n;i>0;i--){ -size_t l=tsvalue(top-i)->len; -memcpy(buffer+tl,svalue(top-i),l); -tl+=l; -} -setsvalue(L,top-n,luaS_newlstr(L,buffer,tl)); -} -total-=n-1; -last-=n-1; -}while(total>1); -} -static void Arith(lua_State*L,StkId ra,const TValue*rb, -const TValue*rc,TMS op){ -TValue tempb,tempc; -const TValue*b,*c; -if((b=luaV_tonumber(rb,&tempb))!=NULL&& -(c=luaV_tonumber(rc,&tempc))!=NULL){ -lua_Number nb=nvalue(b),nc=nvalue(c); -switch(op){ -case TM_ADD:setnvalue(ra,luai_numadd(nb,nc));break; -case TM_SUB:setnvalue(ra,luai_numsub(nb,nc));break; -case TM_MUL:setnvalue(ra,luai_nummul(nb,nc));break; -case TM_DIV:setnvalue(ra,luai_numdiv(nb,nc));break; -case TM_MOD:setnvalue(ra,luai_nummod(nb,nc));break; -case TM_POW:setnvalue(ra,luai_numpow(nb,nc));break; -case TM_UNM:setnvalue(ra,luai_numunm(nb));break; -default:break; -} -} -else if(!call_binTM(L,rb,rc,ra,op)) -luaG_aritherror(L,rb,rc); -} -#define runtime_check(L,c){if(!(c))break;} -#define RA(i)(base+GETARG_A(i)) -#define RB(i)check_exp(getBMode(GET_OPCODE(i))==OpArgR,base+GETARG_B(i)) -#define RKB(i)check_exp(getBMode(GET_OPCODE(i))==OpArgK,ISK(GETARG_B(i))?k+INDEXK(GETARG_B(i)):base+GETARG_B(i)) -#define RKC(i)check_exp(getCMode(GET_OPCODE(i))==OpArgK,ISK(GETARG_C(i))?k+INDEXK(GETARG_C(i)):base+GETARG_C(i)) -#define KBx(i)check_exp(getBMode(GET_OPCODE(i))==OpArgK,k+GETARG_Bx(i)) -#define dojump(L,pc,i){(pc)+=(i);} -#define Protect(x){L->savedpc=pc;{x;};base=L->base;} -#define arith_op(op,tm){TValue*rb=RKB(i);TValue*rc=RKC(i);if(ttisnumber(rb)&&ttisnumber(rc)){lua_Number nb=nvalue(rb),nc=nvalue(rc);setnvalue(ra,op(nb,nc));}else Protect(Arith(L,ra,rb,rc,tm));} -static void luaV_execute(lua_State*L,int nexeccalls){ -LClosure*cl; -StkId base; -TValue*k; -const Instruction*pc; -reentry: -pc=L->savedpc; -cl=&clvalue(L->ci->func)->l; -base=L->base; -k=cl->p->k; -for(;;){ -const Instruction i=*pc++; -StkId ra; -ra=RA(i); -switch(GET_OPCODE(i)){ -case OP_MOVE:{ -setobj(L,ra,RB(i)); -continue; -} -case OP_LOADK:{ -setobj(L,ra,KBx(i)); -continue; -} -case OP_LOADBOOL:{ -setbvalue(ra,GETARG_B(i)); -if(GETARG_C(i))pc++; -continue; -} -case OP_LOADNIL:{ -TValue*rb=RB(i); -do{ -setnilvalue(rb--); -}while(rb>=ra); -continue; -} -case OP_GETUPVAL:{ -int b=GETARG_B(i); -setobj(L,ra,cl->upvals[b]->v); -continue; -} -case OP_GETGLOBAL:{ -TValue g; -TValue*rb=KBx(i); -sethvalue(L,&g,cl->env); -Protect(luaV_gettable(L,&g,rb,ra)); -continue; -} -case OP_GETTABLE:{ -Protect(luaV_gettable(L,RB(i),RKC(i),ra)); -continue; -} -case OP_SETGLOBAL:{ -TValue g; -sethvalue(L,&g,cl->env); -Protect(luaV_settable(L,&g,KBx(i),ra)); -continue; -} -case OP_SETUPVAL:{ -UpVal*uv=cl->upvals[GETARG_B(i)]; -setobj(L,uv->v,ra); -luaC_barrier(L,uv,ra); -continue; -} -case OP_SETTABLE:{ -Protect(luaV_settable(L,ra,RKB(i),RKC(i))); -continue; -} -case OP_NEWTABLE:{ -int b=GETARG_B(i); -int c=GETARG_C(i); -sethvalue(L,ra,luaH_new(L,luaO_fb2int(b),luaO_fb2int(c))); -Protect(luaC_checkGC(L)); -continue; -} -case OP_SELF:{ -StkId rb=RB(i); -setobj(L,ra+1,rb); -Protect(luaV_gettable(L,rb,RKC(i),ra)); -continue; -} -case OP_ADD:{ -arith_op(luai_numadd,TM_ADD); -continue; -} -case OP_SUB:{ -arith_op(luai_numsub,TM_SUB); -continue; -} -case OP_MUL:{ -arith_op(luai_nummul,TM_MUL); -continue; -} -case OP_DIV:{ -arith_op(luai_numdiv,TM_DIV); -continue; -} -case OP_MOD:{ -arith_op(luai_nummod,TM_MOD); -continue; -} -case OP_POW:{ -arith_op(luai_numpow,TM_POW); -continue; -} -case OP_UNM:{ -TValue*rb=RB(i); -if(ttisnumber(rb)){ -lua_Number nb=nvalue(rb); -setnvalue(ra,luai_numunm(nb)); -} -else{ -Protect(Arith(L,ra,rb,rb,TM_UNM)); -} -continue; -} -case OP_NOT:{ -int res=l_isfalse(RB(i)); -setbvalue(ra,res); -continue; -} -case OP_LEN:{ -const TValue*rb=RB(i); -switch(ttype(rb)){ -case 5:{ -setnvalue(ra,cast_num(luaH_getn(hvalue(rb)))); -break; -} -case 4:{ -setnvalue(ra,cast_num(tsvalue(rb)->len)); -break; -} -default:{ -Protect( -if(!call_binTM(L,rb,(&luaO_nilobject_),ra,TM_LEN)) -luaG_typeerror(L,rb,"get length of"); -) -} -} -continue; -} -case OP_CONCAT:{ -int b=GETARG_B(i); -int c=GETARG_C(i); -Protect(luaV_concat(L,c-b+1,c);luaC_checkGC(L)); -setobj(L,RA(i),base+b); -continue; -} -case OP_JMP:{ -dojump(L,pc,GETARG_sBx(i)); -continue; -} -case OP_EQ:{ -TValue*rb=RKB(i); -TValue*rc=RKC(i); -Protect( -if(equalobj(L,rb,rc)==GETARG_A(i)) -dojump(L,pc,GETARG_sBx(*pc)); -) -pc++; -continue; -} -case OP_LT:{ -Protect( -if(luaV_lessthan(L,RKB(i),RKC(i))==GETARG_A(i)) -dojump(L,pc,GETARG_sBx(*pc)); -) -pc++; -continue; -} -case OP_LE:{ -Protect( -if(lessequal(L,RKB(i),RKC(i))==GETARG_A(i)) -dojump(L,pc,GETARG_sBx(*pc)); -) -pc++; -continue; -} -case OP_TEST:{ -if(l_isfalse(ra)!=GETARG_C(i)) -dojump(L,pc,GETARG_sBx(*pc)); -pc++; -continue; -} -case OP_TESTSET:{ -TValue*rb=RB(i); -if(l_isfalse(rb)!=GETARG_C(i)){ -setobj(L,ra,rb); -dojump(L,pc,GETARG_sBx(*pc)); -} -pc++; -continue; -} -case OP_CALL:{ -int b=GETARG_B(i); -int nresults=GETARG_C(i)-1; -if(b!=0)L->top=ra+b; -L->savedpc=pc; -switch(luaD_precall(L,ra,nresults)){ -case 0:{ -nexeccalls++; -goto reentry; -} -case 1:{ -if(nresults>=0)L->top=L->ci->top; -base=L->base; -continue; -} -default:{ -return; -} -} -} -case OP_TAILCALL:{ -int b=GETARG_B(i); -if(b!=0)L->top=ra+b; -L->savedpc=pc; -switch(luaD_precall(L,ra,(-1))){ -case 0:{ -CallInfo*ci=L->ci-1; -int aux; -StkId func=ci->func; -StkId pfunc=(ci+1)->func; -if(L->openupval)luaF_close(L,ci->base); -L->base=ci->base=ci->func+((ci+1)->base-pfunc); -for(aux=0;pfunc+auxtop;aux++) -setobj(L,func+aux,pfunc+aux); -ci->top=L->top=func+aux; -ci->savedpc=L->savedpc; -ci->tailcalls++; -L->ci--; -goto reentry; -} -case 1:{ -base=L->base; -continue; -} -default:{ -return; -} -} -} -case OP_RETURN:{ -int b=GETARG_B(i); -if(b!=0)L->top=ra+b-1; -if(L->openupval)luaF_close(L,base); -L->savedpc=pc; -b=luaD_poscall(L,ra); -if(--nexeccalls==0) -return; -else{ -if(b)L->top=L->ci->top; -goto reentry; -} -} -case OP_FORLOOP:{ -lua_Number step=nvalue(ra+2); -lua_Number idx=luai_numadd(nvalue(ra),step); -lua_Number limit=nvalue(ra+1); -if(luai_numlt(0,step)?luai_numle(idx,limit) -:luai_numle(limit,idx)){ -dojump(L,pc,GETARG_sBx(i)); -setnvalue(ra,idx); -setnvalue(ra+3,idx); -} -continue; -} -case OP_FORPREP:{ -const TValue*init=ra; -const TValue*plimit=ra+1; -const TValue*pstep=ra+2; -L->savedpc=pc; -if(!tonumber(init,ra)) -luaG_runerror(L,LUA_QL("for")" initial value must be a number"); -else if(!tonumber(plimit,ra+1)) -luaG_runerror(L,LUA_QL("for")" limit must be a number"); -else if(!tonumber(pstep,ra+2)) -luaG_runerror(L,LUA_QL("for")" step must be a number"); -setnvalue(ra,luai_numsub(nvalue(ra),nvalue(pstep))); -dojump(L,pc,GETARG_sBx(i)); -continue; -} -case OP_TFORLOOP:{ -StkId cb=ra+3; -setobj(L,cb+2,ra+2); -setobj(L,cb+1,ra+1); -setobj(L,cb,ra); -L->top=cb+3; -Protect(luaD_call(L,cb,GETARG_C(i))); -L->top=L->ci->top; -cb=RA(i)+3; -if(!ttisnil(cb)){ -setobj(L,cb-1,cb); -dojump(L,pc,GETARG_sBx(*pc)); -} -pc++; -continue; -} -case OP_SETLIST:{ -int n=GETARG_B(i); -int c=GETARG_C(i); -int last; -Table*h; -if(n==0){ -n=cast_int(L->top-ra)-1; -L->top=L->ci->top; -} -if(c==0)c=cast_int(*pc++); -runtime_check(L,ttistable(ra)); -h=hvalue(ra); -last=((c-1)*50)+n; -if(last>h->sizearray) -luaH_resizearray(L,h,last); -for(;n>0;n--){ -TValue*val=ra+n; -setobj(L,luaH_setnum(L,h,last--),val); -luaC_barriert(L,h,val); -} -continue; -} -case OP_CLOSE:{ -luaF_close(L,ra); -continue; -} -case OP_CLOSURE:{ -Proto*p; -Closure*ncl; -int nup,j; -p=cl->p->p[GETARG_Bx(i)]; -nup=p->nups; -ncl=luaF_newLclosure(L,nup,cl->env); -ncl->l.p=p; -for(j=0;jl.upvals[j]=cl->upvals[GETARG_B(*pc)]; -else{ -ncl->l.upvals[j]=luaF_findupval(L,base+GETARG_B(*pc)); -} -} -setclvalue(L,ra,ncl); -Protect(luaC_checkGC(L)); -continue; -} -case OP_VARARG:{ -int b=GETARG_B(i)-1; -int j; -CallInfo*ci=L->ci; -int n=cast_int(ci->base-ci->func)-cl->p->numparams-1; -if(b==(-1)){ -Protect(luaD_checkstack(L,n)); -ra=RA(i); -b=n; -L->top=ra+n; -} -for(j=0;jbase-n+j); -} -else{ -setnilvalue(ra+j); -} -} -continue; -} -} -} -} -#define api_checknelems(L,n)luai_apicheck(L,(n)<=(L->top-L->base)) -#define api_checkvalidindex(L,i)luai_apicheck(L,(i)!=(&luaO_nilobject_)) -#define api_incr_top(L){luai_apicheck(L,L->topci->top);L->top++;} -static TValue*index2adr(lua_State*L,int idx){ -if(idx>0){ -TValue*o=L->base+(idx-1); -luai_apicheck(L,idx<=L->ci->top-L->base); -if(o>=L->top)return cast(TValue*,(&luaO_nilobject_)); -else return o; -} -else if(idx>(-10000)){ -luai_apicheck(L,idx!=0&&-idx<=L->top-L->base); -return L->top+idx; -} -else switch(idx){ -case(-10000):return registry(L); -case(-10001):{ -Closure*func=curr_func(L); -sethvalue(L,&L->env,func->c.env); -return&L->env; -} -case(-10002):return gt(L); -default:{ -Closure*func=curr_func(L); -idx=(-10002)-idx; -return(idx<=func->c.nupvalues) -?&func->c.upvalue[idx-1] -:cast(TValue*,(&luaO_nilobject_)); -} -} -} -static Table*getcurrenv(lua_State*L){ -if(L->ci==L->base_ci) -return hvalue(gt(L)); -else{ -Closure*func=curr_func(L); -return func->c.env; -} -} -static int lua_checkstack(lua_State*L,int size){ -int res=1; -if(size>8000||(L->top-L->base+size)>8000) -res=0; -else if(size>0){ -luaD_checkstack(L,size); -if(L->ci->toptop+size) -L->ci->top=L->top+size; -} -return res; -} -static lua_CFunction lua_atpanic(lua_State*L,lua_CFunction panicf){ -lua_CFunction old; -old=G(L)->panic; -G(L)->panic=panicf; -return old; -} -static int lua_gettop(lua_State*L){ -return cast_int(L->top-L->base); -} -static void lua_settop(lua_State*L,int idx){ -if(idx>=0){ -luai_apicheck(L,idx<=L->stack_last-L->base); -while(L->topbase+idx) -setnilvalue(L->top++); -L->top=L->base+idx; -} -else{ -luai_apicheck(L,-(idx+1)<=(L->top-L->base)); -L->top+=idx+1; -} -} -static void lua_remove(lua_State*L,int idx){ -StkId p; -p=index2adr(L,idx); -api_checkvalidindex(L,p); -while(++ptop)setobj(L,p-1,p); -L->top--; -} -static void lua_insert(lua_State*L,int idx){ -StkId p; -StkId q; -p=index2adr(L,idx); -api_checkvalidindex(L,p); -for(q=L->top;q>p;q--)setobj(L,q,q-1); -setobj(L,p,L->top); -} -static void lua_replace(lua_State*L,int idx){ -StkId o; -if(idx==(-10001)&&L->ci==L->base_ci) -luaG_runerror(L,"no calling environment"); -api_checknelems(L,1); -o=index2adr(L,idx); -api_checkvalidindex(L,o); -if(idx==(-10001)){ -Closure*func=curr_func(L); -luai_apicheck(L,ttistable(L->top-1)); -func->c.env=hvalue(L->top-1); -luaC_barrier(L,func,L->top-1); -} -else{ -setobj(L,o,L->top-1); -if(idx<(-10002)) -luaC_barrier(L,curr_func(L),L->top-1); -} -L->top--; -} -static void lua_pushvalue(lua_State*L,int idx){ -setobj(L,L->top,index2adr(L,idx)); -api_incr_top(L); -} -static int lua_type(lua_State*L,int idx){ -StkId o=index2adr(L,idx); -return(o==(&luaO_nilobject_))?(-1):ttype(o); -} -static const char*lua_typename(lua_State*L,int t){ -UNUSED(L); -return(t==(-1))?"no value":luaT_typenames[t]; -} -static int lua_iscfunction(lua_State*L,int idx){ -StkId o=index2adr(L,idx); -return iscfunction(o); -} -static int lua_isnumber(lua_State*L,int idx){ -TValue n; -const TValue*o=index2adr(L,idx); -return tonumber(o,&n); -} -static int lua_isstring(lua_State*L,int idx){ -int t=lua_type(L,idx); -return(t==4||t==3); -} -static int lua_rawequal(lua_State*L,int index1,int index2){ -StkId o1=index2adr(L,index1); -StkId o2=index2adr(L,index2); -return(o1==(&luaO_nilobject_)||o2==(&luaO_nilobject_))?0 -:luaO_rawequalObj(o1,o2); -} -static int lua_lessthan(lua_State*L,int index1,int index2){ -StkId o1,o2; -int i; -o1=index2adr(L,index1); -o2=index2adr(L,index2); -i=(o1==(&luaO_nilobject_)||o2==(&luaO_nilobject_))?0 -:luaV_lessthan(L,o1,o2); -return i; -} -static lua_Number lua_tonumber(lua_State*L,int idx){ -TValue n; -const TValue*o=index2adr(L,idx); -if(tonumber(o,&n)) -return nvalue(o); -else -return 0; -} -static lua_Integer lua_tointeger(lua_State*L,int idx){ -TValue n; -const TValue*o=index2adr(L,idx); -if(tonumber(o,&n)){ -lua_Integer res; -lua_Number num=nvalue(o); -lua_number2integer(res,num); -return res; -} -else -return 0; -} -static int lua_toboolean(lua_State*L,int idx){ -const TValue*o=index2adr(L,idx); -return!l_isfalse(o); -} -static const char*lua_tolstring(lua_State*L,int idx,size_t*len){ -StkId o=index2adr(L,idx); -if(!ttisstring(o)){ -if(!luaV_tostring(L,o)){ -if(len!=NULL)*len=0; -return NULL; -} -luaC_checkGC(L); -o=index2adr(L,idx); -} -if(len!=NULL)*len=tsvalue(o)->len; -return svalue(o); -} -static size_t lua_objlen(lua_State*L,int idx){ -StkId o=index2adr(L,idx); -switch(ttype(o)){ -case 4:return tsvalue(o)->len; -case 7:return uvalue(o)->len; -case 5:return luaH_getn(hvalue(o)); -case 3:{ -size_t l; -l=(luaV_tostring(L,o)?tsvalue(o)->len:0); -return l; -} -default:return 0; -} -} -static lua_CFunction lua_tocfunction(lua_State*L,int idx){ -StkId o=index2adr(L,idx); -return(!iscfunction(o))?NULL:clvalue(o)->c.f; -} -static void*lua_touserdata(lua_State*L,int idx){ -StkId o=index2adr(L,idx); -switch(ttype(o)){ -case 7:return(rawuvalue(o)+1); -case 2:return pvalue(o); -default:return NULL; -} -} -static void lua_pushnil(lua_State*L){ -setnilvalue(L->top); -api_incr_top(L); -} -static void lua_pushnumber(lua_State*L,lua_Number n){ -setnvalue(L->top,n); -api_incr_top(L); -} -static void lua_pushinteger(lua_State*L,lua_Integer n){ -setnvalue(L->top,cast_num(n)); -api_incr_top(L); -} -static void lua_pushlstring(lua_State*L,const char*s,size_t len){ -luaC_checkGC(L); -setsvalue(L,L->top,luaS_newlstr(L,s,len)); -api_incr_top(L); -} -static void lua_pushstring(lua_State*L,const char*s){ -if(s==NULL) -lua_pushnil(L); -else -lua_pushlstring(L,s,strlen(s)); -} -static const char*lua_pushvfstring(lua_State*L,const char*fmt, -va_list argp){ -const char*ret; -luaC_checkGC(L); -ret=luaO_pushvfstring(L,fmt,argp); -return ret; -} -static const char*lua_pushfstring(lua_State*L,const char*fmt,...){ -const char*ret; -va_list argp; -luaC_checkGC(L); -va_start(argp,fmt); -ret=luaO_pushvfstring(L,fmt,argp); -va_end(argp); -return ret; -} -static void lua_pushcclosure(lua_State*L,lua_CFunction fn,int n){ -Closure*cl; -luaC_checkGC(L); -api_checknelems(L,n); -cl=luaF_newCclosure(L,n,getcurrenv(L)); -cl->c.f=fn; -L->top-=n; -while(n--) -setobj(L,&cl->c.upvalue[n],L->top+n); -setclvalue(L,L->top,cl); -api_incr_top(L); -} -static void lua_pushboolean(lua_State*L,int b){ -setbvalue(L->top,(b!=0)); -api_incr_top(L); -} -static int lua_pushthread(lua_State*L){ -setthvalue(L,L->top,L); -api_incr_top(L); -return(G(L)->mainthread==L); -} -static void lua_gettable(lua_State*L,int idx){ -StkId t; -t=index2adr(L,idx); -api_checkvalidindex(L,t); -luaV_gettable(L,t,L->top-1,L->top-1); -} -static void lua_getfield(lua_State*L,int idx,const char*k){ -StkId t; -TValue key; -t=index2adr(L,idx); -api_checkvalidindex(L,t); -setsvalue(L,&key,luaS_new(L,k)); -luaV_gettable(L,t,&key,L->top); -api_incr_top(L); -} -static void lua_rawget(lua_State*L,int idx){ -StkId t; -t=index2adr(L,idx); -luai_apicheck(L,ttistable(t)); -setobj(L,L->top-1,luaH_get(hvalue(t),L->top-1)); -} -static void lua_rawgeti(lua_State*L,int idx,int n){ -StkId o; -o=index2adr(L,idx); -luai_apicheck(L,ttistable(o)); -setobj(L,L->top,luaH_getnum(hvalue(o),n)); -api_incr_top(L); -} -static void lua_createtable(lua_State*L,int narray,int nrec){ -luaC_checkGC(L); -sethvalue(L,L->top,luaH_new(L,narray,nrec)); -api_incr_top(L); -} -static int lua_getmetatable(lua_State*L,int objindex){ -const TValue*obj; -Table*mt=NULL; -int res; -obj=index2adr(L,objindex); -switch(ttype(obj)){ -case 5: -mt=hvalue(obj)->metatable; -break; -case 7: -mt=uvalue(obj)->metatable; -break; -default: -mt=G(L)->mt[ttype(obj)]; -break; -} -if(mt==NULL) -res=0; -else{ -sethvalue(L,L->top,mt); -api_incr_top(L); -res=1; -} -return res; -} -static void lua_getfenv(lua_State*L,int idx){ -StkId o; -o=index2adr(L,idx); -api_checkvalidindex(L,o); -switch(ttype(o)){ -case 6: -sethvalue(L,L->top,clvalue(o)->c.env); -break; -case 7: -sethvalue(L,L->top,uvalue(o)->env); -break; -case 8: -setobj(L,L->top,gt(thvalue(o))); -break; -default: -setnilvalue(L->top); -break; -} -api_incr_top(L); -} -static void lua_settable(lua_State*L,int idx){ -StkId t; -api_checknelems(L,2); -t=index2adr(L,idx); -api_checkvalidindex(L,t); -luaV_settable(L,t,L->top-2,L->top-1); -L->top-=2; -} -static void lua_setfield(lua_State*L,int idx,const char*k){ -StkId t; -TValue key; -api_checknelems(L,1); -t=index2adr(L,idx); -api_checkvalidindex(L,t); -setsvalue(L,&key,luaS_new(L,k)); -luaV_settable(L,t,&key,L->top-1); -L->top--; -} -static void lua_rawset(lua_State*L,int idx){ -StkId t; -api_checknelems(L,2); -t=index2adr(L,idx); -luai_apicheck(L,ttistable(t)); -setobj(L,luaH_set(L,hvalue(t),L->top-2),L->top-1); -luaC_barriert(L,hvalue(t),L->top-1); -L->top-=2; -} -static void lua_rawseti(lua_State*L,int idx,int n){ -StkId o; -api_checknelems(L,1); -o=index2adr(L,idx); -luai_apicheck(L,ttistable(o)); -setobj(L,luaH_setnum(L,hvalue(o),n),L->top-1); -luaC_barriert(L,hvalue(o),L->top-1); -L->top--; -} -static int lua_setmetatable(lua_State*L,int objindex){ -TValue*obj; -Table*mt; -api_checknelems(L,1); -obj=index2adr(L,objindex); -api_checkvalidindex(L,obj); -if(ttisnil(L->top-1)) -mt=NULL; -else{ -luai_apicheck(L,ttistable(L->top-1)); -mt=hvalue(L->top-1); -} -switch(ttype(obj)){ -case 5:{ -hvalue(obj)->metatable=mt; -if(mt) -luaC_objbarriert(L,hvalue(obj),mt); -break; -} -case 7:{ -uvalue(obj)->metatable=mt; -if(mt) -luaC_objbarrier(L,rawuvalue(obj),mt); -break; -} -default:{ -G(L)->mt[ttype(obj)]=mt; -break; -} -} -L->top--; -return 1; -} -static int lua_setfenv(lua_State*L,int idx){ -StkId o; -int res=1; -api_checknelems(L,1); -o=index2adr(L,idx); -api_checkvalidindex(L,o); -luai_apicheck(L,ttistable(L->top-1)); -switch(ttype(o)){ -case 6: -clvalue(o)->c.env=hvalue(L->top-1); -break; -case 7: -uvalue(o)->env=hvalue(L->top-1); -break; -case 8: -sethvalue(L,gt(thvalue(o)),hvalue(L->top-1)); -break; -default: -res=0; -break; -} -if(res)luaC_objbarrier(L,gcvalue(o),hvalue(L->top-1)); -L->top--; -return res; -} -#define adjustresults(L,nres){if(nres==(-1)&&L->top>=L->ci->top)L->ci->top=L->top;} -#define checkresults(L,na,nr)luai_apicheck(L,(nr)==(-1)||(L->ci->top-L->top>=(nr)-(na))) -static void lua_call(lua_State*L,int nargs,int nresults){ -StkId func; -api_checknelems(L,nargs+1); -checkresults(L,nargs,nresults); -func=L->top-(nargs+1); -luaD_call(L,func,nresults); -adjustresults(L,nresults); -} -struct CallS{ -StkId func; -int nresults; -}; -static void f_call(lua_State*L,void*ud){ -struct CallS*c=cast(struct CallS*,ud); -luaD_call(L,c->func,c->nresults); -} -static int lua_pcall(lua_State*L,int nargs,int nresults,int errfunc){ -struct CallS c; -int status; -ptrdiff_t func; -api_checknelems(L,nargs+1); -checkresults(L,nargs,nresults); -if(errfunc==0) -func=0; -else{ -StkId o=index2adr(L,errfunc); -api_checkvalidindex(L,o); -func=savestack(L,o); -} -c.func=L->top-(nargs+1); -c.nresults=nresults; -status=luaD_pcall(L,f_call,&c,savestack(L,c.func),func); -adjustresults(L,nresults); -return status; -} -static int lua_load(lua_State*L,lua_Reader reader,void*data, -const char*chunkname){ -ZIO z; -int status; -if(!chunkname)chunkname="?"; -luaZ_init(L,&z,reader,data); -status=luaD_protectedparser(L,&z,chunkname); -return status; -} -static int lua_error(lua_State*L){ -api_checknelems(L,1); -luaG_errormsg(L); -return 0; -} -static int lua_next(lua_State*L,int idx){ -StkId t; -int more; -t=index2adr(L,idx); -luai_apicheck(L,ttistable(t)); -more=luaH_next(L,hvalue(t),L->top-1); -if(more){ -api_incr_top(L); -} -else -L->top-=1; -return more; -} -static void lua_concat(lua_State*L,int n){ -api_checknelems(L,n); -if(n>=2){ -luaC_checkGC(L); -luaV_concat(L,n,cast_int(L->top-L->base)-1); -L->top-=(n-1); -} -else if(n==0){ -setsvalue(L,L->top,luaS_newlstr(L,"",0)); -api_incr_top(L); -} -} -static void*lua_newuserdata(lua_State*L,size_t size){ -Udata*u; -luaC_checkGC(L); -u=luaS_newudata(L,size,getcurrenv(L)); -setuvalue(L,L->top,u); -api_incr_top(L); -return u+1; -} -#define luaL_getn(L,i)((int)lua_objlen(L,i)) -#define luaL_setn(L,i,j)((void)0) -typedef struct luaL_Reg{ -const char*name; -lua_CFunction func; -}luaL_Reg; -static void luaI_openlib(lua_State*L,const char*libname, -const luaL_Reg*l,int nup); -static int luaL_argerror(lua_State*L,int numarg,const char*extramsg); -static const char* luaL_checklstring(lua_State*L,int numArg, -size_t*l); -static const char* luaL_optlstring(lua_State*L,int numArg, -const char*def,size_t*l); -static lua_Integer luaL_checkinteger(lua_State*L,int numArg); -static lua_Integer luaL_optinteger(lua_State*L,int nArg, -lua_Integer def); -static int luaL_error(lua_State*L,const char*fmt,...); -static const char* luaL_findtable(lua_State*L,int idx, -const char*fname,int szhint); -#define luaL_argcheck(L,cond,numarg,extramsg)((void)((cond)||luaL_argerror(L,(numarg),(extramsg)))) -#define luaL_checkstring(L,n)(luaL_checklstring(L,(n),NULL)) -#define luaL_optstring(L,n,d)(luaL_optlstring(L,(n),(d),NULL)) -#define luaL_checkint(L,n)((int)luaL_checkinteger(L,(n))) -#define luaL_optint(L,n,d)((int)luaL_optinteger(L,(n),(d))) -#define luaL_typename(L,i)lua_typename(L,lua_type(L,(i))) -#define luaL_getmetatable(L,n)(lua_getfield(L,(-10000),(n))) -#define luaL_opt(L,f,n,d)(lua_isnoneornil(L,(n))?(d):f(L,(n))) -typedef struct luaL_Buffer{ -char*p; -int lvl; -lua_State*L; -char buffer[BUFSIZ]; -}luaL_Buffer; -#define luaL_addchar(B,c)((void)((B)->p<((B)->buffer+BUFSIZ)||luaL_prepbuffer(B)),(*(B)->p++=(char)(c))) -#define luaL_addsize(B,n)((B)->p+=(n)) -static char* luaL_prepbuffer(luaL_Buffer*B); -static int luaL_argerror(lua_State*L,int narg,const char*extramsg){ -lua_Debug ar; -if(!lua_getstack(L,0,&ar)) -return luaL_error(L,"bad argument #%d (%s)",narg,extramsg); -lua_getinfo(L,"n",&ar); -if(strcmp(ar.namewhat,"method")==0){ -narg--; -if(narg==0) -return luaL_error(L,"calling "LUA_QL("%s")" on bad self (%s)", -ar.name,extramsg); -} -if(ar.name==NULL) -ar.name="?"; -return luaL_error(L,"bad argument #%d to "LUA_QL("%s")" (%s)", -narg,ar.name,extramsg); -} -static int luaL_typerror(lua_State*L,int narg,const char*tname){ -const char*msg=lua_pushfstring(L,"%s expected, got %s", -tname,luaL_typename(L,narg)); -return luaL_argerror(L,narg,msg); -} -static void tag_error(lua_State*L,int narg,int tag){ -luaL_typerror(L,narg,lua_typename(L,tag)); -} -static void luaL_where(lua_State*L,int level){ -lua_Debug ar; -if(lua_getstack(L,level,&ar)){ -lua_getinfo(L,"Sl",&ar); -if(ar.currentline>0){ -lua_pushfstring(L,"%s:%d: ",ar.short_src,ar.currentline); -return; -} -} -lua_pushliteral(L,""); -} -static int luaL_error(lua_State*L,const char*fmt,...){ -va_list argp; -va_start(argp,fmt); -luaL_where(L,1); -lua_pushvfstring(L,fmt,argp); -va_end(argp); -lua_concat(L,2); -return lua_error(L); -} -static int luaL_newmetatable(lua_State*L,const char*tname){ -lua_getfield(L,(-10000),tname); -if(!lua_isnil(L,-1)) -return 0; -lua_pop(L,1); -lua_newtable(L); -lua_pushvalue(L,-1); -lua_setfield(L,(-10000),tname); -return 1; -} -static void*luaL_checkudata(lua_State*L,int ud,const char*tname){ -void*p=lua_touserdata(L,ud); -if(p!=NULL){ -if(lua_getmetatable(L,ud)){ -lua_getfield(L,(-10000),tname); -if(lua_rawequal(L,-1,-2)){ -lua_pop(L,2); -return p; -} -} -} -luaL_typerror(L,ud,tname); -return NULL; -} -static void luaL_checkstack(lua_State*L,int space,const char*mes){ -if(!lua_checkstack(L,space)) -luaL_error(L,"stack overflow (%s)",mes); -} -static void luaL_checktype(lua_State*L,int narg,int t){ -if(lua_type(L,narg)!=t) -tag_error(L,narg,t); -} -static void luaL_checkany(lua_State*L,int narg){ -if(lua_type(L,narg)==(-1)) -luaL_argerror(L,narg,"value expected"); -} -static const char*luaL_checklstring(lua_State*L,int narg,size_t*len){ -const char*s=lua_tolstring(L,narg,len); -if(!s)tag_error(L,narg,4); -return s; -} -static const char*luaL_optlstring(lua_State*L,int narg, -const char*def,size_t*len){ -if(lua_isnoneornil(L,narg)){ -if(len) -*len=(def?strlen(def):0); -return def; -} -else return luaL_checklstring(L,narg,len); -} -static lua_Number luaL_checknumber(lua_State*L,int narg){ -lua_Number d=lua_tonumber(L,narg); -if(d==0&&!lua_isnumber(L,narg)) -tag_error(L,narg,3); -return d; -} -static lua_Integer luaL_checkinteger(lua_State*L,int narg){ -lua_Integer d=lua_tointeger(L,narg); -if(d==0&&!lua_isnumber(L,narg)) -tag_error(L,narg,3); -return d; -} -static lua_Integer luaL_optinteger(lua_State*L,int narg, -lua_Integer def){ -return luaL_opt(L,luaL_checkinteger,narg,def); -} -static int luaL_getmetafield(lua_State*L,int obj,const char*event){ -if(!lua_getmetatable(L,obj)) -return 0; -lua_pushstring(L,event); -lua_rawget(L,-2); -if(lua_isnil(L,-1)){ -lua_pop(L,2); -return 0; -} -else{ -lua_remove(L,-2); -return 1; -} -} -static void luaL_register(lua_State*L,const char*libname, -const luaL_Reg*l){ -luaI_openlib(L,libname,l,0); -} -static int libsize(const luaL_Reg*l){ -int size=0; -for(;l->name;l++)size++; -return size; -} -static void luaI_openlib(lua_State*L,const char*libname, -const luaL_Reg*l,int nup){ -if(libname){ -int size=libsize(l); -luaL_findtable(L,(-10000),"_LOADED",1); -lua_getfield(L,-1,libname); -if(!lua_istable(L,-1)){ -lua_pop(L,1); -if(luaL_findtable(L,(-10002),libname,size)!=NULL) -luaL_error(L,"name conflict for module "LUA_QL("%s"),libname); -lua_pushvalue(L,-1); -lua_setfield(L,-3,libname); -} -lua_remove(L,-2); -lua_insert(L,-(nup+1)); -} -for(;l->name;l++){ -int i; -for(i=0;ifunc,nup); -lua_setfield(L,-(nup+2),l->name); -} -lua_pop(L,nup); -} -static const char*luaL_findtable(lua_State*L,int idx, -const char*fname,int szhint){ -const char*e; -lua_pushvalue(L,idx); -do{ -e=strchr(fname,'.'); -if(e==NULL)e=fname+strlen(fname); -lua_pushlstring(L,fname,e-fname); -lua_rawget(L,-2); -if(lua_isnil(L,-1)){ -lua_pop(L,1); -lua_createtable(L,0,(*e=='.'?1:szhint)); -lua_pushlstring(L,fname,e-fname); -lua_pushvalue(L,-2); -lua_settable(L,-4); -} -else if(!lua_istable(L,-1)){ -lua_pop(L,2); -return fname; -} -lua_remove(L,-2); -fname=e+1; -}while(*e=='.'); -return NULL; -} -#define bufflen(B)((B)->p-(B)->buffer) -#define bufffree(B)((size_t)(BUFSIZ-bufflen(B))) -static int emptybuffer(luaL_Buffer*B){ -size_t l=bufflen(B); -if(l==0)return 0; -else{ -lua_pushlstring(B->L,B->buffer,l); -B->p=B->buffer; -B->lvl++; -return 1; -} -} -static void adjuststack(luaL_Buffer*B){ -if(B->lvl>1){ -lua_State*L=B->L; -int toget=1; -size_t toplen=lua_strlen(L,-1); -do{ -size_t l=lua_strlen(L,-(toget+1)); -if(B->lvl-toget+1>=(20/2)||toplen>l){ -toplen+=l; -toget++; -} -else break; -}while(togetlvl); -lua_concat(L,toget); -B->lvl=B->lvl-toget+1; -} -} -static char*luaL_prepbuffer(luaL_Buffer*B){ -if(emptybuffer(B)) -adjuststack(B); -return B->buffer; -} -static void luaL_addlstring(luaL_Buffer*B,const char*s,size_t l){ -while(l--) -luaL_addchar(B,*s++); -} -static void luaL_pushresult(luaL_Buffer*B){ -emptybuffer(B); -lua_concat(B->L,B->lvl); -B->lvl=1; -} -static void luaL_addvalue(luaL_Buffer*B){ -lua_State*L=B->L; -size_t vl; -const char*s=lua_tolstring(L,-1,&vl); -if(vl<=bufffree(B)){ -memcpy(B->p,s,vl); -B->p+=vl; -lua_pop(L,1); -} -else{ -if(emptybuffer(B)) -lua_insert(L,-2); -B->lvl++; -adjuststack(B); -} -} -static void luaL_buffinit(lua_State*L,luaL_Buffer*B){ -B->L=L; -B->p=B->buffer; -B->lvl=0; -} -typedef struct LoadF{ -int extraline; -FILE*f; -char buff[BUFSIZ]; -}LoadF; -static const char*getF(lua_State*L,void*ud,size_t*size){ -LoadF*lf=(LoadF*)ud; -(void)L; -if(lf->extraline){ -lf->extraline=0; -*size=1; -return"\n"; -} -if(feof(lf->f))return NULL; -*size=fread(lf->buff,1,sizeof(lf->buff),lf->f); -return(*size>0)?lf->buff:NULL; -} -static int errfile(lua_State*L,const char*what,int fnameindex){ -const char*serr=strerror(errno); -const char*filename=lua_tostring(L,fnameindex)+1; -lua_pushfstring(L,"cannot %s %s: %s",what,filename,serr); -lua_remove(L,fnameindex); -return(5+1); -} -static int luaL_loadfile(lua_State*L,const char*filename){ -LoadF lf; -int status,readstatus; -int c; -int fnameindex=lua_gettop(L)+1; -lf.extraline=0; -if(filename==NULL){ -lua_pushliteral(L,"=stdin"); -lf.f=stdin; -} -else{ -lua_pushfstring(L,"@%s",filename); -lf.f=fopen(filename,"r"); -if(lf.f==NULL)return errfile(L,"open",fnameindex); -} -c=getc(lf.f); -if(c=='#'){ -lf.extraline=1; -while((c=getc(lf.f))!=EOF&&c!='\n'); -if(c=='\n')c=getc(lf.f); -} -if(c=="\033Lua"[0]&&filename){ -lf.f=freopen(filename,"rb",lf.f); -if(lf.f==NULL)return errfile(L,"reopen",fnameindex); -while((c=getc(lf.f))!=EOF&&c!="\033Lua"[0]); -lf.extraline=0; -} -ungetc(c,lf.f); -status=lua_load(L,getF,&lf,lua_tostring(L,-1)); -readstatus=ferror(lf.f); -if(filename)fclose(lf.f); -if(readstatus){ -lua_settop(L,fnameindex); -return errfile(L,"read",fnameindex); -} -lua_remove(L,fnameindex); -return status; -} -typedef struct LoadS{ -const char*s; -size_t size; -}LoadS; -static const char*getS(lua_State*L,void*ud,size_t*size){ -LoadS*ls=(LoadS*)ud; -(void)L; -if(ls->size==0)return NULL; -*size=ls->size; -ls->size=0; -return ls->s; -} -static int luaL_loadbuffer(lua_State*L,const char*buff,size_t size, -const char*name){ -LoadS ls; -ls.s=buff; -ls.size=size; -return lua_load(L,getS,&ls,name); -} -static void*l_alloc(void*ud,void*ptr,size_t osize,size_t nsize){ -(void)ud; -(void)osize; -if(nsize==0){ -free(ptr); -return NULL; -} -else -return realloc(ptr,nsize); -} -static int panic(lua_State*L){ -(void)L; -fprintf(stderr,"PANIC: unprotected error in call to Lua API (%s)\n", -lua_tostring(L,-1)); -return 0; -} -static lua_State*luaL_newstate(void){ -lua_State*L=lua_newstate(l_alloc,NULL); -if(L)lua_atpanic(L,&panic); -return L; -} -static int luaB_tonumber(lua_State*L){ -int base=luaL_optint(L,2,10); -if(base==10){ -luaL_checkany(L,1); -if(lua_isnumber(L,1)){ -lua_pushnumber(L,lua_tonumber(L,1)); -return 1; -} -} -else{ -const char*s1=luaL_checkstring(L,1); -char*s2; -unsigned long n; -luaL_argcheck(L,2<=base&&base<=36,2,"base out of range"); -n=strtoul(s1,&s2,base); -if(s1!=s2){ -while(isspace((unsigned char)(*s2)))s2++; -if(*s2=='\0'){ -lua_pushnumber(L,(lua_Number)n); -return 1; -} -} -} -lua_pushnil(L); -return 1; -} -static int luaB_error(lua_State*L){ -int level=luaL_optint(L,2,1); -lua_settop(L,1); -if(lua_isstring(L,1)&&level>0){ -luaL_where(L,level); -lua_pushvalue(L,1); -lua_concat(L,2); -} -return lua_error(L); -} -static int luaB_setmetatable(lua_State*L){ -int t=lua_type(L,2); -luaL_checktype(L,1,5); -luaL_argcheck(L,t==0||t==5,2, -"nil or table expected"); -if(luaL_getmetafield(L,1,"__metatable")) -luaL_error(L,"cannot change a protected metatable"); -lua_settop(L,2); -lua_setmetatable(L,1); -return 1; -} -static void getfunc(lua_State*L,int opt){ -if(lua_isfunction(L,1))lua_pushvalue(L,1); -else{ -lua_Debug ar; -int level=opt?luaL_optint(L,1,1):luaL_checkint(L,1); -luaL_argcheck(L,level>=0,1,"level must be non-negative"); -if(lua_getstack(L,level,&ar)==0) -luaL_argerror(L,1,"invalid level"); -lua_getinfo(L,"f",&ar); -if(lua_isnil(L,-1)) -luaL_error(L,"no function environment for tail call at level %d", -level); -} -} -static int luaB_setfenv(lua_State*L){ -luaL_checktype(L,2,5); -getfunc(L,0); -lua_pushvalue(L,2); -if(lua_isnumber(L,1)&&lua_tonumber(L,1)==0){ -lua_pushthread(L); -lua_insert(L,-2); -lua_setfenv(L,-2); -return 0; -} -else if(lua_iscfunction(L,-2)||lua_setfenv(L,-2)==0) -luaL_error(L, -LUA_QL("setfenv")" cannot change environment of given object"); -return 1; -} -static int luaB_rawget(lua_State*L){ -luaL_checktype(L,1,5); -luaL_checkany(L,2); -lua_settop(L,2); -lua_rawget(L,1); -return 1; -} -static int luaB_type(lua_State*L){ -luaL_checkany(L,1); -lua_pushstring(L,luaL_typename(L,1)); -return 1; -} -static int luaB_next(lua_State*L){ -luaL_checktype(L,1,5); -lua_settop(L,2); -if(lua_next(L,1)) -return 2; -else{ -lua_pushnil(L); -return 1; -} -} -static int luaB_pairs(lua_State*L){ -luaL_checktype(L,1,5); -lua_pushvalue(L,lua_upvalueindex(1)); -lua_pushvalue(L,1); -lua_pushnil(L); -return 3; -} -static int ipairsaux(lua_State*L){ -int i=luaL_checkint(L,2); -luaL_checktype(L,1,5); -i++; -lua_pushinteger(L,i); -lua_rawgeti(L,1,i); -return(lua_isnil(L,-1))?0:2; -} -static int luaB_ipairs(lua_State*L){ -luaL_checktype(L,1,5); -lua_pushvalue(L,lua_upvalueindex(1)); -lua_pushvalue(L,1); -lua_pushinteger(L,0); -return 3; -} -static int load_aux(lua_State*L,int status){ -if(status==0) -return 1; -else{ -lua_pushnil(L); -lua_insert(L,-2); -return 2; -} -} -static int luaB_loadstring(lua_State*L){ -size_t l; -const char*s=luaL_checklstring(L,1,&l); -const char*chunkname=luaL_optstring(L,2,s); -return load_aux(L,luaL_loadbuffer(L,s,l,chunkname)); -} -static int luaB_loadfile(lua_State*L){ -const char*fname=luaL_optstring(L,1,NULL); -return load_aux(L,luaL_loadfile(L,fname)); -} -static int luaB_assert(lua_State*L){ -luaL_checkany(L,1); -if(!lua_toboolean(L,1)) -return luaL_error(L,"%s",luaL_optstring(L,2,"assertion failed!")); -return lua_gettop(L); -} -static int luaB_unpack(lua_State*L){ -int i,e,n; -luaL_checktype(L,1,5); -i=luaL_optint(L,2,1); -e=luaL_opt(L,luaL_checkint,3,luaL_getn(L,1)); -if(i>e)return 0; -n=e-i+1; -if(n<=0||!lua_checkstack(L,n)) -return luaL_error(L,"too many results to unpack"); -lua_rawgeti(L,1,i); -while(i++e)e=pos; -for(i=e;i>pos;i--){ -lua_rawgeti(L,1,i-1); -lua_rawseti(L,1,i); -} -break; -} -default:{ -return luaL_error(L,"wrong number of arguments to "LUA_QL("insert")); -} -} -luaL_setn(L,1,e); -lua_rawseti(L,1,pos); -return 0; -} -static int tremove(lua_State*L){ -int e=aux_getn(L,1); -int pos=luaL_optint(L,2,e); -if(!(1<=pos&&pos<=e)) -return 0; -luaL_setn(L,1,e-1); -lua_rawgeti(L,1,pos); -for(;posu)luaL_error(L,"invalid order function for sorting"); -lua_pop(L,1); -} -while(lua_rawgeti(L,1,--j),sort_comp(L,-3,-1)){ -if(j0); -} -l=strlen(p); -if(l==0||p[l-1]!='\n') -luaL_addsize(&b,l); -else{ -luaL_addsize(&b,l-1); -luaL_pushresult(&b); -return 1; -} -} -} -static int read_chars(lua_State*L,FILE*f,size_t n){ -size_t rlen; -size_t nr; -luaL_Buffer b; -luaL_buffinit(L,&b); -rlen=BUFSIZ; -do{ -char*p=luaL_prepbuffer(&b); -if(rlen>n)rlen=n; -nr=fread(p,sizeof(char),rlen,f); -luaL_addsize(&b,nr); -n-=nr; -}while(n>0&&nr==rlen); -luaL_pushresult(&b); -return(n==0||lua_objlen(L,-1)>0); -} -static int g_read(lua_State*L,FILE*f,int first){ -int nargs=lua_gettop(L)-1; -int success; -int n; -clearerr(f); -if(nargs==0){ -success=read_line(L,f); -n=first+1; -} -else{ -luaL_checkstack(L,nargs+20,"too many arguments"); -success=1; -for(n=first;nargs--&&success;n++){ -if(lua_type(L,n)==3){ -size_t l=(size_t)lua_tointeger(L,n); -success=(l==0)?test_eof(L,f):read_chars(L,f,l); -} -else{ -const char*p=lua_tostring(L,n); -luaL_argcheck(L,p&&p[0]=='*',n,"invalid option"); -switch(p[1]){ -case'n': -success=read_number(L,f); -break; -case'l': -success=read_line(L,f); -break; -case'a': -read_chars(L,f,~((size_t)0)); -success=1; -break; -default: -return luaL_argerror(L,n,"invalid format"); -} -} -} -} -if(ferror(f)) -return pushresult(L,0,NULL); -if(!success){ -lua_pop(L,1); -lua_pushnil(L); -} -return n-first; -} -static int io_read(lua_State*L){ -return g_read(L,getiofile(L,1),1); -} -static int f_read(lua_State*L){ -return g_read(L,tofile(L),2); -} -static int io_readline(lua_State*L){ -FILE*f=*(FILE**)lua_touserdata(L,lua_upvalueindex(1)); -int sucess; -if(f==NULL) -luaL_error(L,"file is already closed"); -sucess=read_line(L,f); -if(ferror(f)) -return luaL_error(L,"%s",strerror(errno)); -if(sucess)return 1; -else{ -if(lua_toboolean(L,lua_upvalueindex(2))){ -lua_settop(L,0); -lua_pushvalue(L,lua_upvalueindex(1)); -aux_close(L); -} -return 0; -} -} -static int g_write(lua_State*L,FILE*f,int arg){ -int nargs=lua_gettop(L)-1; -int status=1; -for(;nargs--;arg++){ -if(lua_type(L,arg)==3){ -status=status&& -fprintf(f,"%.14g",lua_tonumber(L,arg))>0; -} -else{ -size_t l; -const char*s=luaL_checklstring(L,arg,&l); -status=status&&(fwrite(s,sizeof(char),l,f)==l); -} -} -return pushresult(L,status,NULL); -} -static int io_write(lua_State*L){ -return g_write(L,getiofile(L,2),1); -} -static int f_write(lua_State*L){ -return g_write(L,tofile(L),2); -} -static int io_flush(lua_State*L){ -return pushresult(L,fflush(getiofile(L,2))==0,NULL); -} -static int f_flush(lua_State*L){ -return pushresult(L,fflush(tofile(L))==0,NULL); -} -static const luaL_Reg iolib[]={ -{"close",io_close}, -{"flush",io_flush}, -{"input",io_input}, -{"lines",io_lines}, -{"open",io_open}, -{"output",io_output}, -{"read",io_read}, -{"type",io_type}, -{"write",io_write}, -{NULL,NULL} -}; -static const luaL_Reg flib[]={ -{"close",io_close}, -{"flush",f_flush}, -{"lines",f_lines}, -{"read",f_read}, -{"write",f_write}, -{"__gc",io_gc}, -{NULL,NULL} -}; -static void createmeta(lua_State*L){ -luaL_newmetatable(L,"FILE*"); -lua_pushvalue(L,-1); -lua_setfield(L,-2,"__index"); -luaL_register(L,NULL,flib); -} -static void createstdfile(lua_State*L,FILE*f,int k,const char*fname){ -*newfile(L)=f; -if(k>0){ -lua_pushvalue(L,-1); -lua_rawseti(L,(-10001),k); -} -lua_pushvalue(L,-2); -lua_setfenv(L,-2); -lua_setfield(L,-3,fname); -} -static void newfenv(lua_State*L,lua_CFunction cls){ -lua_createtable(L,0,1); -lua_pushcfunction(L,cls); -lua_setfield(L,-2,"__close"); -} -static int luaopen_io(lua_State*L){ -createmeta(L); -newfenv(L,io_fclose); -lua_replace(L,(-10001)); -luaL_register(L,"io",iolib); -newfenv(L,io_noclose); -createstdfile(L,stdin,1,"stdin"); -createstdfile(L,stdout,2,"stdout"); -createstdfile(L,stderr,0,"stderr"); -lua_pop(L,1); -lua_getfield(L,-1,"popen"); -newfenv(L,io_pclose); -lua_setfenv(L,-2); -lua_pop(L,1); -return 1; -} -static int os_pushresult(lua_State*L,int i,const char*filename){ -int en=errno; -if(i){ -lua_pushboolean(L,1); -return 1; -} -else{ -lua_pushnil(L); -lua_pushfstring(L,"%s: %s",filename,strerror(en)); -lua_pushinteger(L,en); -return 3; -} -} -static int os_remove(lua_State*L){ -const char*filename=luaL_checkstring(L,1); -return os_pushresult(L,remove(filename)==0,filename); -} -static int os_exit(lua_State*L){ -exit(luaL_optint(L,1,EXIT_SUCCESS)); -} -static const luaL_Reg syslib[]={ -{"exit",os_exit}, -{"remove",os_remove}, -{NULL,NULL} -}; -static int luaopen_os(lua_State*L){ -luaL_register(L,"os",syslib); -return 1; -} -#define uchar(c)((unsigned char)(c)) -static ptrdiff_t posrelat(ptrdiff_t pos,size_t len){ -if(pos<0)pos+=(ptrdiff_t)len+1; -return(pos>=0)?pos:0; -} -static int str_sub(lua_State*L){ -size_t l; -const char*s=luaL_checklstring(L,1,&l); -ptrdiff_t start=posrelat(luaL_checkinteger(L,2),l); -ptrdiff_t end=posrelat(luaL_optinteger(L,3,-1),l); -if(start<1)start=1; -if(end>(ptrdiff_t)l)end=(ptrdiff_t)l; -if(start<=end) -lua_pushlstring(L,s+start-1,end-start+1); -else lua_pushliteral(L,""); -return 1; -} -static int str_lower(lua_State*L){ -size_t l; -size_t i; -luaL_Buffer b; -const char*s=luaL_checklstring(L,1,&l); -luaL_buffinit(L,&b); -for(i=0;i0) -luaL_addlstring(&b,s,l); -luaL_pushresult(&b); -return 1; -} -static int str_byte(lua_State*L){ -size_t l; -const char*s=luaL_checklstring(L,1,&l); -ptrdiff_t posi=posrelat(luaL_optinteger(L,2,1),l); -ptrdiff_t pose=posrelat(luaL_optinteger(L,3,posi),l); -int n,i; -if(posi<=0)posi=1; -if((size_t)pose>l)pose=l; -if(posi>pose)return 0; -n=(int)(pose-posi+1); -if(posi+n<=pose) -luaL_error(L,"string slice too long"); -luaL_checkstack(L,n,"string slice too long"); -for(i=0;i=ms->level||ms->capture[l].len==(-1)) -return luaL_error(ms->L,"invalid capture index"); -return l; -} -static int capture_to_close(MatchState*ms){ -int level=ms->level; -for(level--;level>=0;level--) -if(ms->capture[level].len==(-1))return level; -return luaL_error(ms->L,"invalid pattern capture"); -} -static const char*classend(MatchState*ms,const char*p){ -switch(*p++){ -case'%':{ -if(*p=='\0') -luaL_error(ms->L,"malformed pattern (ends with "LUA_QL("%%")")"); -return p+1; -} -case'[':{ -if(*p=='^')p++; -do{ -if(*p=='\0') -luaL_error(ms->L,"malformed pattern (missing "LUA_QL("]")")"); -if(*(p++)=='%'&&*p!='\0') -p++; -}while(*p!=']'); -return p+1; -} -default:{ -return p; -} -} -} -static int match_class(int c,int cl){ -int res; -switch(tolower(cl)){ -case'a':res=isalpha(c);break; -case'c':res=iscntrl(c);break; -case'd':res=isdigit(c);break; -case'l':res=islower(c);break; -case'p':res=ispunct(c);break; -case's':res=isspace(c);break; -case'u':res=isupper(c);break; -case'w':res=isalnum(c);break; -case'x':res=isxdigit(c);break; -case'z':res=(c==0);break; -default:return(cl==c); -} -return(islower(cl)?res:!res); -} -static int matchbracketclass(int c,const char*p,const char*ec){ -int sig=1; -if(*(p+1)=='^'){ -sig=0; -p++; -} -while(++pL,"unbalanced pattern"); -if(*s!=*p)return NULL; -else{ -int b=*p; -int e=*(p+1); -int cont=1; -while(++ssrc_end){ -if(*s==e){ -if(--cont==0)return s+1; -} -else if(*s==b)cont++; -} -} -return NULL; -} -static const char*max_expand(MatchState*ms,const char*s, -const char*p,const char*ep){ -ptrdiff_t i=0; -while((s+i)src_end&&singlematch(uchar(*(s+i)),p,ep)) -i++; -while(i>=0){ -const char*res=match(ms,(s+i),ep+1); -if(res)return res; -i--; -} -return NULL; -} -static const char*min_expand(MatchState*ms,const char*s, -const char*p,const char*ep){ -for(;;){ -const char*res=match(ms,s,ep+1); -if(res!=NULL) -return res; -else if(ssrc_end&&singlematch(uchar(*s),p,ep)) -s++; -else return NULL; -} -} -static const char*start_capture(MatchState*ms,const char*s, -const char*p,int what){ -const char*res; -int level=ms->level; -if(level>=32)luaL_error(ms->L,"too many captures"); -ms->capture[level].init=s; -ms->capture[level].len=what; -ms->level=level+1; -if((res=match(ms,s,p))==NULL) -ms->level--; -return res; -} -static const char*end_capture(MatchState*ms,const char*s, -const char*p){ -int l=capture_to_close(ms); -const char*res; -ms->capture[l].len=s-ms->capture[l].init; -if((res=match(ms,s,p))==NULL) -ms->capture[l].len=(-1); -return res; -} -static const char*match_capture(MatchState*ms,const char*s,int l){ -size_t len; -l=check_capture(ms,l); -len=ms->capture[l].len; -if((size_t)(ms->src_end-s)>=len&& -memcmp(ms->capture[l].init,s,len)==0) -return s+len; -else return NULL; -} -static const char*match(MatchState*ms,const char*s,const char*p){ -init: -switch(*p){ -case'(':{ -if(*(p+1)==')') -return start_capture(ms,s,p+2,(-2)); -else -return start_capture(ms,s,p+1,(-1)); -} -case')':{ -return end_capture(ms,s,p+1); -} -case'%':{ -switch(*(p+1)){ -case'b':{ -s=matchbalance(ms,s,p+2); -if(s==NULL)return NULL; -p+=4;goto init; -} -case'f':{ -const char*ep;char previous; -p+=2; -if(*p!='[') -luaL_error(ms->L,"missing "LUA_QL("[")" after " -LUA_QL("%%f")" in pattern"); -ep=classend(ms,p); -previous=(s==ms->src_init)?'\0':*(s-1); -if(matchbracketclass(uchar(previous),p,ep-1)|| -!matchbracketclass(uchar(*s),p,ep-1))return NULL; -p=ep;goto init; -} -default:{ -if(isdigit(uchar(*(p+1)))){ -s=match_capture(ms,s,uchar(*(p+1))); -if(s==NULL)return NULL; -p+=2;goto init; -} -goto dflt; -} -} -} -case'\0':{ -return s; -} -case'$':{ -if(*(p+1)=='\0') -return(s==ms->src_end)?s:NULL; -else goto dflt; -} -default:dflt:{ -const char*ep=classend(ms,p); -int m=ssrc_end&&singlematch(uchar(*s),p,ep); -switch(*ep){ -case'?':{ -const char*res; -if(m&&((res=match(ms,s+1,ep+1))!=NULL)) -return res; -p=ep+1;goto init; -} -case'*':{ -return max_expand(ms,s,p,ep); -} -case'+':{ -return(m?max_expand(ms,s+1,p,ep):NULL); -} -case'-':{ -return min_expand(ms,s,p,ep); -} -default:{ -if(!m)return NULL; -s++;p=ep;goto init; -} -} -} -} -} -static const char*lmemfind(const char*s1,size_t l1, -const char*s2,size_t l2){ -if(l2==0)return s1; -else if(l2>l1)return NULL; -else{ -const char*init; -l2--; -l1=l1-l2; -while(l1>0&&(init=(const char*)memchr(s1,*s2,l1))!=NULL){ -init++; -if(memcmp(init,s2+1,l2)==0) -return init-1; -else{ -l1-=init-s1; -s1=init; -} -} -return NULL; -} -} -static void push_onecapture(MatchState*ms,int i,const char*s, -const char*e){ -if(i>=ms->level){ -if(i==0) -lua_pushlstring(ms->L,s,e-s); -else -luaL_error(ms->L,"invalid capture index"); -} -else{ -ptrdiff_t l=ms->capture[i].len; -if(l==(-1))luaL_error(ms->L,"unfinished capture"); -if(l==(-2)) -lua_pushinteger(ms->L,ms->capture[i].init-ms->src_init+1); -else -lua_pushlstring(ms->L,ms->capture[i].init,l); -} -} -static int push_captures(MatchState*ms,const char*s,const char*e){ -int i; -int nlevels=(ms->level==0&&s)?1:ms->level; -luaL_checkstack(ms->L,nlevels,"too many captures"); -for(i=0;il1)init=(ptrdiff_t)l1; -if(find&&(lua_toboolean(L,4)|| -strpbrk(p,"^$*+?.([%-")==NULL)){ -const char*s2=lmemfind(s+init,l1-init,p,l2); -if(s2){ -lua_pushinteger(L,s2-s+1); -lua_pushinteger(L,s2-s+l2); -return 2; -} -} -else{ -MatchState ms; -int anchor=(*p=='^')?(p++,1):0; -const char*s1=s+init; -ms.L=L; -ms.src_init=s; -ms.src_end=s+l1; -do{ -const char*res; -ms.level=0; -if((res=match(&ms,s1,p))!=NULL){ -if(find){ -lua_pushinteger(L,s1-s+1); -lua_pushinteger(L,res-s); -return push_captures(&ms,NULL,0)+2; -} -else -return push_captures(&ms,s1,res); -} -}while(s1++L,3,&l); -for(i=0;iL; -switch(lua_type(L,3)){ -case 3: -case 4:{ -add_s(ms,b,s,e); -return; -} -case 6:{ -int n; -lua_pushvalue(L,3); -n=push_captures(ms,s,e); -lua_call(L,n,1); -break; -} -case 5:{ -push_onecapture(ms,0,s,e); -lua_gettable(L,3); -break; -} -} -if(!lua_toboolean(L,-1)){ -lua_pop(L,1); -lua_pushlstring(L,s,e-s); -} -else if(!lua_isstring(L,-1)) -luaL_error(L,"invalid replacement value (a %s)",luaL_typename(L,-1)); -luaL_addvalue(b); -} -static int str_gsub(lua_State*L){ -size_t srcl; -const char*src=luaL_checklstring(L,1,&srcl); -const char*p=luaL_checkstring(L,2); -int tr=lua_type(L,3); -int max_s=luaL_optint(L,4,srcl+1); -int anchor=(*p=='^')?(p++,1):0; -int n=0; -MatchState ms; -luaL_Buffer b; -luaL_argcheck(L,tr==3||tr==4|| -tr==6||tr==5,3, -"string/function/table expected"); -luaL_buffinit(L,&b); -ms.L=L; -ms.src_init=src; -ms.src_end=src+srcl; -while(nsrc) -src=e; -else if(src=sizeof("-+ #0")) -luaL_error(L,"invalid format (repeated flags)"); -if(isdigit(uchar(*p)))p++; -if(isdigit(uchar(*p)))p++; -if(*p=='.'){ -p++; -if(isdigit(uchar(*p)))p++; -if(isdigit(uchar(*p)))p++; -} -if(isdigit(uchar(*p))) -luaL_error(L,"invalid format (width or precision too long)"); -*(form++)='%'; -strncpy(form,strfrmt,p-strfrmt+1); -form+=p-strfrmt+1; -*form='\0'; -return p; -} -static void addintlen(char*form){ -size_t l=strlen(form); -char spec=form[l-1]; -strcpy(form+l-1,"l"); -form[l+sizeof("l")-2]=spec; -form[l+sizeof("l")-1]='\0'; -} -static int str_format(lua_State*L){ -int top=lua_gettop(L); -int arg=1; -size_t sfl; -const char*strfrmt=luaL_checklstring(L,arg,&sfl); -const char*strfrmt_end=strfrmt+sfl; -luaL_Buffer b; -luaL_buffinit(L,&b); -while(strfrmttop) -luaL_argerror(L,arg,"no value"); -strfrmt=scanformat(L,strfrmt,form); -switch(*strfrmt++){ -case'c':{ -sprintf(buff,form,(int)luaL_checknumber(L,arg)); -break; -} -case'd':case'i':{ -addintlen(form); -sprintf(buff,form,(long)luaL_checknumber(L,arg)); -break; -} -case'o':case'u':case'x':case'X':{ -addintlen(form); -sprintf(buff,form,(unsigned long)luaL_checknumber(L,arg)); -break; -} -case'e':case'E':case'f': -case'g':case'G':{ -sprintf(buff,form,(double)luaL_checknumber(L,arg)); -break; -} -case'q':{ -addquoted(L,&b,arg); -continue; -} -case's':{ -size_t l; -const char*s=luaL_checklstring(L,arg,&l); -if(!strchr(form,'.')&&l>=100){ -lua_pushvalue(L,arg); -luaL_addvalue(&b); -continue; -} -else{ -sprintf(buff,form,s); -break; -} -} -default:{ -return luaL_error(L,"invalid option "LUA_QL("%%%c")" to " -LUA_QL("format"),*(strfrmt-1)); -} -} -luaL_addlstring(&b,buff,strlen(buff)); -} -} -luaL_pushresult(&b); -return 1; -} -static const luaL_Reg strlib[]={ -{"byte",str_byte}, -{"char",str_char}, -{"find",str_find}, -{"format",str_format}, -{"gmatch",gmatch}, -{"gsub",str_gsub}, -{"lower",str_lower}, -{"match",str_match}, -{"rep",str_rep}, -{"sub",str_sub}, -{"upper",str_upper}, -{NULL,NULL} -}; -static void createmetatable(lua_State*L){ -lua_createtable(L,0,1); -lua_pushliteral(L,""); -lua_pushvalue(L,-2); -lua_setmetatable(L,-2); -lua_pop(L,1); -lua_pushvalue(L,-2); -lua_setfield(L,-2,"__index"); -lua_pop(L,1); -} -static int luaopen_string(lua_State*L){ -luaL_register(L,"string",strlib); -createmetatable(L); -return 1; -} -static const luaL_Reg lualibs[]={ -{"",luaopen_base}, -{"table",luaopen_table}, -{"io",luaopen_io}, -{"os",luaopen_os}, -{"string",luaopen_string}, -{NULL,NULL} -}; -static void luaL_openlibs(lua_State*L){ -const luaL_Reg*lib=lualibs; -for(;lib->func;lib++){ -lua_pushcfunction(L,lib->func); -lua_pushstring(L,lib->name); -lua_call(L,1,0); -} -} -typedef unsigned int UB; -static UB barg(lua_State*L,int idx){ -union{lua_Number n;U64 b;}bn; -bn.n=lua_tonumber(L,idx)+6755399441055744.0; -if(bn.n==0.0&&!lua_isnumber(L,idx))luaL_typerror(L,idx,"number"); -return(UB)bn.b; -} -#define BRET(b)lua_pushnumber(L,(lua_Number)(int)(b));return 1; -static int tobit(lua_State*L){ -BRET(barg(L,1))} -static int bnot(lua_State*L){ -BRET(~barg(L,1))} -static int band(lua_State*L){ -int i;UB b=barg(L,1);for(i=lua_gettop(L);i>1;i--)b&=barg(L,i);BRET(b)} -static int bor(lua_State*L){ -int i;UB b=barg(L,1);for(i=lua_gettop(L);i>1;i--)b|=barg(L,i);BRET(b)} -static int bxor(lua_State*L){ -int i;UB b=barg(L,1);for(i=lua_gettop(L);i>1;i--)b^=barg(L,i);BRET(b)} -static int lshift(lua_State*L){ -UB b=barg(L,1),n=barg(L,2)&31;BRET(b<>n)} -static int arshift(lua_State*L){ -UB b=barg(L,1),n=barg(L,2)&31;BRET((int)b>>n)} -static int rol(lua_State*L){ -UB b=barg(L,1),n=barg(L,2)&31;BRET((b<>(32-n)))} -static int ror(lua_State*L){ -UB b=barg(L,1),n=barg(L,2)&31;BRET((b>>n)|(b<<(32-n)))} -static int bswap(lua_State*L){ -UB b=barg(L,1);b=(b>>24)|((b>>8)&0xff00)|((b&0xff00)<<8)|(b<<24);BRET(b)} -static int tohex(lua_State*L){ -UB b=barg(L,1); -int n=lua_isnone(L,2)?8:(int)barg(L,2); -const char*hexdigits="0123456789abcdef"; -char buf[8]; -int i; -if(n<0){n=-n;hexdigits="0123456789ABCDEF";} -if(n>8)n=8; -for(i=(int)n;--i>=0;){buf[i]=hexdigits[b&15];b>>=4;} -lua_pushlstring(L,buf,(size_t)n); -return 1; -} -static const struct luaL_Reg bitlib[]={ -{"tobit",tobit}, -{"bnot",bnot}, -{"band",band}, -{"bor",bor}, -{"bxor",bxor}, -{"lshift",lshift}, -{"rshift",rshift}, -{"arshift",arshift}, -{"rol",rol}, -{"ror",ror}, -{"bswap",bswap}, -{"tohex",tohex}, -{NULL,NULL} -}; -int main(int argc,char**argv){ -lua_State*L=luaL_newstate(); -int i; -luaL_openlibs(L); -luaL_register(L,"bit",bitlib); -if(argc<2)return sizeof(void*); -lua_createtable(L,0,1); -lua_pushstring(L,argv[1]); -lua_rawseti(L,-2,0); -lua_setglobal(L,"arg"); -if(luaL_loadfile(L,argv[1])) -goto err; -for(i=2;i -- BYTECODE -- [...] --- print(bc.line(foo, 2)) --> 0002 KSTR 1 1 ; "hello" --- --- local out = { --- -- Do something with each line: --- write = function(t, ...) io.write(...) end, --- close = function(t) end, --- flush = function(t) end, --- } --- bc.dump(foo, out) --- ------------------------------------------------------------------------------- - --- Cache some library functions and objects. -local jit = require("jit") -assert(jit.version_num == 20005, "LuaJIT core/library version mismatch") -local jutil = require("jit.util") -local vmdef = require("jit.vmdef") -local bit = require("bit") -local sub, gsub, format = string.sub, string.gsub, string.format -local byte, band, shr = string.byte, bit.band, bit.rshift -local funcinfo, funcbc, funck = jutil.funcinfo, jutil.funcbc, jutil.funck -local funcuvname = jutil.funcuvname -local bcnames = vmdef.bcnames -local stdout, stderr = io.stdout, io.stderr - ------------------------------------------------------------------------------- - -local function ctlsub(c) - if c == "\n" then return "\\n" - elseif c == "\r" then return "\\r" - elseif c == "\t" then return "\\t" - else return format("\\%03d", byte(c)) - end -end - --- Return one bytecode line. -local function bcline(func, pc, prefix) - local ins, m = funcbc(func, pc) - if not ins then return end - local ma, mb, mc = band(m, 7), band(m, 15*8), band(m, 15*128) - local a = band(shr(ins, 8), 0xff) - local oidx = 6*band(ins, 0xff) - local op = sub(bcnames, oidx+1, oidx+6) - local s = format("%04d %s %-6s %3s ", - pc, prefix or " ", op, ma == 0 and "" or a) - local d = shr(ins, 16) - if mc == 13*128 then -- BCMjump - return format("%s=> %04d\n", s, pc+d-0x7fff) - end - if mb ~= 0 then - d = band(d, 0xff) - elseif mc == 0 then - return s.."\n" - end - local kc - if mc == 10*128 then -- BCMstr - kc = funck(func, -d-1) - kc = format(#kc > 40 and '"%.40s"~' or '"%s"', gsub(kc, "%c", ctlsub)) - elseif mc == 9*128 then -- BCMnum - kc = funck(func, d) - if op == "TSETM " then kc = kc - 2^52 end - elseif mc == 12*128 then -- BCMfunc - local fi = funcinfo(funck(func, -d-1)) - if fi.ffid then - kc = vmdef.ffnames[fi.ffid] - else - kc = fi.loc - end - elseif mc == 5*128 then -- BCMuv - kc = funcuvname(func, d) - end - if ma == 5 then -- BCMuv - local ka = funcuvname(func, a) - if kc then kc = ka.." ; "..kc else kc = ka end - end - if mb ~= 0 then - local b = shr(ins, 24) - if kc then return format("%s%3d %3d ; %s\n", s, b, d, kc) end - return format("%s%3d %3d\n", s, b, d) - end - if kc then return format("%s%3d ; %s\n", s, d, kc) end - if mc == 7*128 and d > 32767 then d = d - 65536 end -- BCMlits - return format("%s%3d\n", s, d) -end - --- Collect branch targets of a function. -local function bctargets(func) - local target = {} - for pc=1,1000000000 do - local ins, m = funcbc(func, pc) - if not ins then break end - if band(m, 15*128) == 13*128 then target[pc+shr(ins, 16)-0x7fff] = true end - end - return target -end - --- Dump bytecode instructions of a function. -local function bcdump(func, out, all) - if not out then out = stdout end - local fi = funcinfo(func) - if all and fi.children then - for n=-1,-1000000000,-1 do - local k = funck(func, n) - if not k then break end - if type(k) == "proto" then bcdump(k, out, true) end - end - end - out:write(format("-- BYTECODE -- %s-%d\n", fi.loc, fi.lastlinedefined)) - local target = bctargets(func) - for pc=1,1000000000 do - local s = bcline(func, pc, target[pc] and "=>") - if not s then break end - out:write(s) - end - out:write("\n") - out:flush() -end - ------------------------------------------------------------------------------- - --- Active flag and output file handle. -local active, out - --- List handler. -local function h_list(func) - return bcdump(func, out) -end - --- Detach list handler. -local function bclistoff() - if active then - active = false - jit.attach(h_list) - if out and out ~= stdout and out ~= stderr then out:close() end - out = nil - end -end - --- Open the output file and attach list handler. -local function bcliston(outfile) - if active then bclistoff() end - if not outfile then outfile = os.getenv("LUAJIT_LISTFILE") end - if outfile then - out = outfile == "-" and stdout or assert(io.open(outfile, "w")) - else - out = stderr - end - jit.attach(h_list, "bc") - active = true -end - --- Public module functions. -module(...) - -line = bcline -dump = bcdump -targets = bctargets - -on = bcliston -off = bclistoff -start = bcliston -- For -j command line option. - diff --git a/subprojects/luajit/src/jit/bcsave.lua b/subprojects/luajit/src/jit/bcsave.lua deleted file mode 100644 index aa677dfc3..000000000 --- a/subprojects/luajit/src/jit/bcsave.lua +++ /dev/null @@ -1,659 +0,0 @@ ----------------------------------------------------------------------------- --- LuaJIT module to save/list bytecode. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- Released under the MIT license. See Copyright Notice in luajit.h ----------------------------------------------------------------------------- --- --- This module saves or lists the bytecode for an input file. --- It's run by the -b command line option. --- ------------------------------------------------------------------------------- - -local jit = require("jit") -assert(jit.version_num == 20005, "LuaJIT core/library version mismatch") -local bit = require("bit") - --- Symbol name prefix for LuaJIT bytecode. -local LJBC_PREFIX = "luaJIT_BC_" - ------------------------------------------------------------------------------- - -local function usage() - io.stderr:write[[ -Save LuaJIT bytecode: luajit -b[options] input output - -l Only list bytecode. - -s Strip debug info (default). - -g Keep debug info. - -n name Set module name (default: auto-detect from input name). - -t type Set output file type (default: auto-detect from output name). - -a arch Override architecture for object files (default: native). - -o os Override OS for object files (default: native). - -e chunk Use chunk string as input. - -- Stop handling options. - - Use stdin as input and/or stdout as output. - -File types: c h obj o raw (default) -]] - os.exit(1) -end - -local function check(ok, ...) - if ok then return ok, ... end - io.stderr:write("luajit: ", ...) - io.stderr:write("\n") - os.exit(1) -end - -local function readfile(input) - if type(input) == "function" then return input end - if input == "-" then input = nil end - return check(loadfile(input)) -end - -local function savefile(name, mode) - if name == "-" then return io.stdout end - return check(io.open(name, mode)) -end - ------------------------------------------------------------------------------- - -local map_type = { - raw = "raw", c = "c", h = "h", o = "obj", obj = "obj", -} - -local map_arch = { - x86 = true, x64 = true, arm = true, ppc = true, ppcspe = true, - mips = true, mipsel = true, -} - -local map_os = { - linux = true, windows = true, osx = true, freebsd = true, netbsd = true, - openbsd = true, dragonfly = true, solaris = true, -} - -local function checkarg(str, map, err) - str = string.lower(str) - local s = check(map[str], "unknown ", err) - return s == true and str or s -end - -local function detecttype(str) - local ext = string.match(string.lower(str), "%.(%a+)$") - return map_type[ext] or "raw" -end - -local function checkmodname(str) - check(string.match(str, "^[%w_.%-]+$"), "bad module name") - return string.gsub(str, "[%.%-]", "_") -end - -local function detectmodname(str) - if type(str) == "string" then - local tail = string.match(str, "[^/\\]+$") - if tail then str = tail end - local head = string.match(str, "^(.*)%.[^.]*$") - if head then str = head end - str = string.match(str, "^[%w_.%-]+") - else - str = nil - end - check(str, "cannot derive module name, use -n name") - return string.gsub(str, "[%.%-]", "_") -end - ------------------------------------------------------------------------------- - -local function bcsave_tail(fp, output, s) - local ok, err = fp:write(s) - if ok and output ~= "-" then ok, err = fp:close() end - check(ok, "cannot write ", output, ": ", err) -end - -local function bcsave_raw(output, s) - local fp = savefile(output, "wb") - bcsave_tail(fp, output, s) -end - -local function bcsave_c(ctx, output, s) - local fp = savefile(output, "w") - if ctx.type == "c" then - fp:write(string.format([[ -#ifdef _cplusplus -extern "C" -#endif -#ifdef _WIN32 -__declspec(dllexport) -#endif -const char %s%s[] = { -]], LJBC_PREFIX, ctx.modname)) - else - fp:write(string.format([[ -#define %s%s_SIZE %d -static const char %s%s[] = { -]], LJBC_PREFIX, ctx.modname, #s, LJBC_PREFIX, ctx.modname)) - end - local t, n, m = {}, 0, 0 - for i=1,#s do - local b = tostring(string.byte(s, i)) - m = m + #b + 1 - if m > 78 then - fp:write(table.concat(t, ",", 1, n), ",\n") - n, m = 0, #b + 1 - end - n = n + 1 - t[n] = b - end - bcsave_tail(fp, output, table.concat(t, ",", 1, n).."\n};\n") -end - -local function bcsave_elfobj(ctx, output, s, ffi) - ffi.cdef[[ -typedef struct { - uint8_t emagic[4], eclass, eendian, eversion, eosabi, eabiversion, epad[7]; - uint16_t type, machine; - uint32_t version; - uint32_t entry, phofs, shofs; - uint32_t flags; - uint16_t ehsize, phentsize, phnum, shentsize, shnum, shstridx; -} ELF32header; -typedef struct { - uint8_t emagic[4], eclass, eendian, eversion, eosabi, eabiversion, epad[7]; - uint16_t type, machine; - uint32_t version; - uint64_t entry, phofs, shofs; - uint32_t flags; - uint16_t ehsize, phentsize, phnum, shentsize, shnum, shstridx; -} ELF64header; -typedef struct { - uint32_t name, type, flags, addr, ofs, size, link, info, align, entsize; -} ELF32sectheader; -typedef struct { - uint32_t name, type; - uint64_t flags, addr, ofs, size; - uint32_t link, info; - uint64_t align, entsize; -} ELF64sectheader; -typedef struct { - uint32_t name, value, size; - uint8_t info, other; - uint16_t sectidx; -} ELF32symbol; -typedef struct { - uint32_t name; - uint8_t info, other; - uint16_t sectidx; - uint64_t value, size; -} ELF64symbol; -typedef struct { - ELF32header hdr; - ELF32sectheader sect[6]; - ELF32symbol sym[2]; - uint8_t space[4096]; -} ELF32obj; -typedef struct { - ELF64header hdr; - ELF64sectheader sect[6]; - ELF64symbol sym[2]; - uint8_t space[4096]; -} ELF64obj; -]] - local symname = LJBC_PREFIX..ctx.modname - local is64, isbe = false, false - if ctx.arch == "x64" then - is64 = true - elseif ctx.arch == "ppc" or ctx.arch == "ppcspe" or ctx.arch == "mips" then - isbe = true - end - - -- Handle different host/target endianess. - local function f32(x) return x end - local f16, fofs = f32, f32 - if ffi.abi("be") ~= isbe then - f32 = bit.bswap - function f16(x) return bit.rshift(bit.bswap(x), 16) end - if is64 then - local two32 = ffi.cast("int64_t", 2^32) - function fofs(x) return bit.bswap(x)*two32 end - else - fofs = f32 - end - end - - -- Create ELF object and fill in header. - local o = ffi.new(is64 and "ELF64obj" or "ELF32obj") - local hdr = o.hdr - if ctx.os == "bsd" or ctx.os == "other" then -- Determine native hdr.eosabi. - local bf = assert(io.open("/bin/ls", "rb")) - local bs = bf:read(9) - bf:close() - ffi.copy(o, bs, 9) - check(hdr.emagic[0] == 127, "no support for writing native object files") - else - hdr.emagic = "\127ELF" - hdr.eosabi = ({ freebsd=9, netbsd=2, openbsd=12, solaris=6 })[ctx.os] or 0 - end - hdr.eclass = is64 and 2 or 1 - hdr.eendian = isbe and 2 or 1 - hdr.eversion = 1 - hdr.type = f16(1) - hdr.machine = f16(({ x86=3, x64=62, arm=40, ppc=20, ppcspe=20, mips=8, mipsel=8 })[ctx.arch]) - if ctx.arch == "mips" or ctx.arch == "mipsel" then - hdr.flags = f32(0x50001006) - end - hdr.version = f32(1) - hdr.shofs = fofs(ffi.offsetof(o, "sect")) - hdr.ehsize = f16(ffi.sizeof(hdr)) - hdr.shentsize = f16(ffi.sizeof(o.sect[0])) - hdr.shnum = f16(6) - hdr.shstridx = f16(2) - - -- Fill in sections and symbols. - local sofs, ofs = ffi.offsetof(o, "space"), 1 - for i,name in ipairs{ - ".symtab", ".shstrtab", ".strtab", ".rodata", ".note.GNU-stack", - } do - local sect = o.sect[i] - sect.align = fofs(1) - sect.name = f32(ofs) - ffi.copy(o.space+ofs, name) - ofs = ofs + #name+1 - end - o.sect[1].type = f32(2) -- .symtab - o.sect[1].link = f32(3) - o.sect[1].info = f32(1) - o.sect[1].align = fofs(8) - o.sect[1].ofs = fofs(ffi.offsetof(o, "sym")) - o.sect[1].entsize = fofs(ffi.sizeof(o.sym[0])) - o.sect[1].size = fofs(ffi.sizeof(o.sym)) - o.sym[1].name = f32(1) - o.sym[1].sectidx = f16(4) - o.sym[1].size = fofs(#s) - o.sym[1].info = 17 - o.sect[2].type = f32(3) -- .shstrtab - o.sect[2].ofs = fofs(sofs) - o.sect[2].size = fofs(ofs) - o.sect[3].type = f32(3) -- .strtab - o.sect[3].ofs = fofs(sofs + ofs) - o.sect[3].size = fofs(#symname+1) - ffi.copy(o.space+ofs+1, symname) - ofs = ofs + #symname + 2 - o.sect[4].type = f32(1) -- .rodata - o.sect[4].flags = fofs(2) - o.sect[4].ofs = fofs(sofs + ofs) - o.sect[4].size = fofs(#s) - o.sect[5].type = f32(1) -- .note.GNU-stack - o.sect[5].ofs = fofs(sofs + ofs + #s) - - -- Write ELF object file. - local fp = savefile(output, "wb") - fp:write(ffi.string(o, ffi.sizeof(o)-4096+ofs)) - bcsave_tail(fp, output, s) -end - -local function bcsave_peobj(ctx, output, s, ffi) - ffi.cdef[[ -typedef struct { - uint16_t arch, nsects; - uint32_t time, symtabofs, nsyms; - uint16_t opthdrsz, flags; -} PEheader; -typedef struct { - char name[8]; - uint32_t vsize, vaddr, size, ofs, relocofs, lineofs; - uint16_t nreloc, nline; - uint32_t flags; -} PEsection; -typedef struct __attribute((packed)) { - union { - char name[8]; - uint32_t nameref[2]; - }; - uint32_t value; - int16_t sect; - uint16_t type; - uint8_t scl, naux; -} PEsym; -typedef struct __attribute((packed)) { - uint32_t size; - uint16_t nreloc, nline; - uint32_t cksum; - uint16_t assoc; - uint8_t comdatsel, unused[3]; -} PEsymaux; -typedef struct { - PEheader hdr; - PEsection sect[2]; - // Must be an even number of symbol structs. - PEsym sym0; - PEsymaux sym0aux; - PEsym sym1; - PEsymaux sym1aux; - PEsym sym2; - PEsym sym3; - uint32_t strtabsize; - uint8_t space[4096]; -} PEobj; -]] - local symname = LJBC_PREFIX..ctx.modname - local is64 = false - if ctx.arch == "x86" then - symname = "_"..symname - elseif ctx.arch == "x64" then - is64 = true - end - local symexport = " /EXPORT:"..symname..",DATA " - - -- The file format is always little-endian. Swap if the host is big-endian. - local function f32(x) return x end - local f16 = f32 - if ffi.abi("be") then - f32 = bit.bswap - function f16(x) return bit.rshift(bit.bswap(x), 16) end - end - - -- Create PE object and fill in header. - local o = ffi.new("PEobj") - local hdr = o.hdr - hdr.arch = f16(({ x86=0x14c, x64=0x8664, arm=0x1c0, ppc=0x1f2, mips=0x366, mipsel=0x366 })[ctx.arch]) - hdr.nsects = f16(2) - hdr.symtabofs = f32(ffi.offsetof(o, "sym0")) - hdr.nsyms = f32(6) - - -- Fill in sections and symbols. - o.sect[0].name = ".drectve" - o.sect[0].size = f32(#symexport) - o.sect[0].flags = f32(0x00100a00) - o.sym0.sect = f16(1) - o.sym0.scl = 3 - o.sym0.name = ".drectve" - o.sym0.naux = 1 - o.sym0aux.size = f32(#symexport) - o.sect[1].name = ".rdata" - o.sect[1].size = f32(#s) - o.sect[1].flags = f32(0x40300040) - o.sym1.sect = f16(2) - o.sym1.scl = 3 - o.sym1.name = ".rdata" - o.sym1.naux = 1 - o.sym1aux.size = f32(#s) - o.sym2.sect = f16(2) - o.sym2.scl = 2 - o.sym2.nameref[1] = f32(4) - o.sym3.sect = f16(-1) - o.sym3.scl = 2 - o.sym3.value = f32(1) - o.sym3.name = "@feat.00" -- Mark as SafeSEH compliant. - ffi.copy(o.space, symname) - local ofs = #symname + 1 - o.strtabsize = f32(ofs + 4) - o.sect[0].ofs = f32(ffi.offsetof(o, "space") + ofs) - ffi.copy(o.space + ofs, symexport) - ofs = ofs + #symexport - o.sect[1].ofs = f32(ffi.offsetof(o, "space") + ofs) - - -- Write PE object file. - local fp = savefile(output, "wb") - fp:write(ffi.string(o, ffi.sizeof(o)-4096+ofs)) - bcsave_tail(fp, output, s) -end - -local function bcsave_machobj(ctx, output, s, ffi) - ffi.cdef[[ -typedef struct -{ - uint32_t magic, cputype, cpusubtype, filetype, ncmds, sizeofcmds, flags; -} mach_header; -typedef struct -{ - mach_header; uint32_t reserved; -} mach_header_64; -typedef struct { - uint32_t cmd, cmdsize; - char segname[16]; - uint32_t vmaddr, vmsize, fileoff, filesize; - uint32_t maxprot, initprot, nsects, flags; -} mach_segment_command; -typedef struct { - uint32_t cmd, cmdsize; - char segname[16]; - uint64_t vmaddr, vmsize, fileoff, filesize; - uint32_t maxprot, initprot, nsects, flags; -} mach_segment_command_64; -typedef struct { - char sectname[16], segname[16]; - uint32_t addr, size; - uint32_t offset, align, reloff, nreloc, flags; - uint32_t reserved1, reserved2; -} mach_section; -typedef struct { - char sectname[16], segname[16]; - uint64_t addr, size; - uint32_t offset, align, reloff, nreloc, flags; - uint32_t reserved1, reserved2, reserved3; -} mach_section_64; -typedef struct { - uint32_t cmd, cmdsize, symoff, nsyms, stroff, strsize; -} mach_symtab_command; -typedef struct { - int32_t strx; - uint8_t type, sect; - int16_t desc; - uint32_t value; -} mach_nlist; -typedef struct { - uint32_t strx; - uint8_t type, sect; - uint16_t desc; - uint64_t value; -} mach_nlist_64; -typedef struct -{ - uint32_t magic, nfat_arch; -} mach_fat_header; -typedef struct -{ - uint32_t cputype, cpusubtype, offset, size, align; -} mach_fat_arch; -typedef struct { - struct { - mach_header hdr; - mach_segment_command seg; - mach_section sec; - mach_symtab_command sym; - } arch[1]; - mach_nlist sym_entry; - uint8_t space[4096]; -} mach_obj; -typedef struct { - struct { - mach_header_64 hdr; - mach_segment_command_64 seg; - mach_section_64 sec; - mach_symtab_command sym; - } arch[1]; - mach_nlist_64 sym_entry; - uint8_t space[4096]; -} mach_obj_64; -typedef struct { - mach_fat_header fat; - mach_fat_arch fat_arch[4]; - struct { - mach_header hdr; - mach_segment_command seg; - mach_section sec; - mach_symtab_command sym; - } arch[4]; - mach_nlist sym_entry; - uint8_t space[4096]; -} mach_fat_obj; -]] - local symname = '_'..LJBC_PREFIX..ctx.modname - local isfat, is64, align, mobj = false, false, 4, "mach_obj" - if ctx.arch == "x64" then - is64, align, mobj = true, 8, "mach_obj_64" - elseif ctx.arch == "arm" then - isfat, mobj = true, "mach_fat_obj" - else - check(ctx.arch == "x86", "unsupported architecture for OSX") - end - local function aligned(v, a) return bit.band(v+a-1, -a) end - local be32 = bit.bswap -- Mach-O FAT is BE, supported archs are LE. - - -- Create Mach-O object and fill in header. - local o = ffi.new(mobj) - local mach_size = aligned(ffi.offsetof(o, "space")+#symname+2, align) - local cputype = ({ x86={7}, x64={0x01000007}, arm={7,12,12,12} })[ctx.arch] - local cpusubtype = ({ x86={3}, x64={3}, arm={3,6,9,11} })[ctx.arch] - if isfat then - o.fat.magic = be32(0xcafebabe) - o.fat.nfat_arch = be32(#cpusubtype) - end - - -- Fill in sections and symbols. - for i=0,#cpusubtype-1 do - local ofs = 0 - if isfat then - local a = o.fat_arch[i] - a.cputype = be32(cputype[i+1]) - a.cpusubtype = be32(cpusubtype[i+1]) - -- Subsequent slices overlap each other to share data. - ofs = ffi.offsetof(o, "arch") + i*ffi.sizeof(o.arch[0]) - a.offset = be32(ofs) - a.size = be32(mach_size-ofs+#s) - end - local a = o.arch[i] - a.hdr.magic = is64 and 0xfeedfacf or 0xfeedface - a.hdr.cputype = cputype[i+1] - a.hdr.cpusubtype = cpusubtype[i+1] - a.hdr.filetype = 1 - a.hdr.ncmds = 2 - a.hdr.sizeofcmds = ffi.sizeof(a.seg)+ffi.sizeof(a.sec)+ffi.sizeof(a.sym) - a.seg.cmd = is64 and 0x19 or 0x1 - a.seg.cmdsize = ffi.sizeof(a.seg)+ffi.sizeof(a.sec) - a.seg.vmsize = #s - a.seg.fileoff = mach_size-ofs - a.seg.filesize = #s - a.seg.maxprot = 1 - a.seg.initprot = 1 - a.seg.nsects = 1 - ffi.copy(a.sec.sectname, "__data") - ffi.copy(a.sec.segname, "__DATA") - a.sec.size = #s - a.sec.offset = mach_size-ofs - a.sym.cmd = 2 - a.sym.cmdsize = ffi.sizeof(a.sym) - a.sym.symoff = ffi.offsetof(o, "sym_entry")-ofs - a.sym.nsyms = 1 - a.sym.stroff = ffi.offsetof(o, "sym_entry")+ffi.sizeof(o.sym_entry)-ofs - a.sym.strsize = aligned(#symname+2, align) - end - o.sym_entry.type = 0xf - o.sym_entry.sect = 1 - o.sym_entry.strx = 1 - ffi.copy(o.space+1, symname) - - -- Write Macho-O object file. - local fp = savefile(output, "wb") - fp:write(ffi.string(o, mach_size)) - bcsave_tail(fp, output, s) -end - -local function bcsave_obj(ctx, output, s) - local ok, ffi = pcall(require, "ffi") - check(ok, "FFI library required to write this file type") - if ctx.os == "windows" then - return bcsave_peobj(ctx, output, s, ffi) - elseif ctx.os == "osx" then - return bcsave_machobj(ctx, output, s, ffi) - else - return bcsave_elfobj(ctx, output, s, ffi) - end -end - ------------------------------------------------------------------------------- - -local function bclist(input, output) - local f = readfile(input) - require("jit.bc").dump(f, savefile(output, "w"), true) -end - -local function bcsave(ctx, input, output) - local f = readfile(input) - local s = string.dump(f, ctx.strip) - local t = ctx.type - if not t then - t = detecttype(output) - ctx.type = t - end - if t == "raw" then - bcsave_raw(output, s) - else - if not ctx.modname then ctx.modname = detectmodname(input) end - if t == "obj" then - bcsave_obj(ctx, output, s) - else - bcsave_c(ctx, output, s) - end - end -end - -local function docmd(...) - local arg = {...} - local n = 1 - local list = false - local ctx = { - strip = true, arch = jit.arch, os = string.lower(jit.os), - type = false, modname = false, - } - while n <= #arg do - local a = arg[n] - if type(a) == "string" and string.sub(a, 1, 1) == "-" and a ~= "-" then - table.remove(arg, n) - if a == "--" then break end - for m=2,#a do - local opt = string.sub(a, m, m) - if opt == "l" then - list = true - elseif opt == "s" then - ctx.strip = true - elseif opt == "g" then - ctx.strip = false - else - if arg[n] == nil or m ~= #a then usage() end - if opt == "e" then - if n ~= 1 then usage() end - arg[1] = check(loadstring(arg[1])) - elseif opt == "n" then - ctx.modname = checkmodname(table.remove(arg, n)) - elseif opt == "t" then - ctx.type = checkarg(table.remove(arg, n), map_type, "file type") - elseif opt == "a" then - ctx.arch = checkarg(table.remove(arg, n), map_arch, "architecture") - elseif opt == "o" then - ctx.os = checkarg(table.remove(arg, n), map_os, "OS name") - else - usage() - end - end - end - else - n = n + 1 - end - end - if list then - if #arg == 0 or #arg > 2 then usage() end - bclist(arg[1], arg[2] or "-") - else - if #arg ~= 2 then usage() end - bcsave(ctx, arg[1], arg[2]) - end -end - ------------------------------------------------------------------------------- - --- Public module functions. -module(...) - -start = docmd -- Process -b command line option. - diff --git a/subprojects/luajit/src/jit/dis_arm.lua b/subprojects/luajit/src/jit/dis_arm.lua deleted file mode 100644 index 91ebb7d5f..000000000 --- a/subprojects/luajit/src/jit/dis_arm.lua +++ /dev/null @@ -1,689 +0,0 @@ ----------------------------------------------------------------------------- --- LuaJIT ARM disassembler module. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- Released under the MIT license. See Copyright Notice in luajit.h ----------------------------------------------------------------------------- --- This is a helper module used by the LuaJIT machine code dumper module. --- --- It disassembles most user-mode ARMv7 instructions --- NYI: Advanced SIMD and VFP instructions. ------------------------------------------------------------------------------- - -local type = type -local sub, byte, format = string.sub, string.byte, string.format -local match, gmatch = string.match, string.gmatch -local concat = table.concat -local bit = require("bit") -local band, bor, ror, tohex = bit.band, bit.bor, bit.ror, bit.tohex -local lshift, rshift, arshift = bit.lshift, bit.rshift, bit.arshift - ------------------------------------------------------------------------------- --- Opcode maps ------------------------------------------------------------------------------- - -local map_loadc = { - shift = 8, mask = 15, - [10] = { - shift = 20, mask = 1, - [0] = { - shift = 23, mask = 3, - [0] = "vmovFmDN", "vstmFNdr", - _ = { - shift = 21, mask = 1, - [0] = "vstrFdl", - { shift = 16, mask = 15, [13] = "vpushFdr", _ = "vstmdbFNdr", } - }, - }, - { - shift = 23, mask = 3, - [0] = "vmovFDNm", - { shift = 16, mask = 15, [13] = "vpopFdr", _ = "vldmFNdr", }, - _ = { - shift = 21, mask = 1, - [0] = "vldrFdl", "vldmdbFNdr", - }, - }, - }, - [11] = { - shift = 20, mask = 1, - [0] = { - shift = 23, mask = 3, - [0] = "vmovGmDN", "vstmGNdr", - _ = { - shift = 21, mask = 1, - [0] = "vstrGdl", - { shift = 16, mask = 15, [13] = "vpushGdr", _ = "vstmdbGNdr", } - }, - }, - { - shift = 23, mask = 3, - [0] = "vmovGDNm", - { shift = 16, mask = 15, [13] = "vpopGdr", _ = "vldmGNdr", }, - _ = { - shift = 21, mask = 1, - [0] = "vldrGdl", "vldmdbGNdr", - }, - }, - }, - _ = { - shift = 0, mask = 0 -- NYI ldc, mcrr, mrrc. - }, -} - -local map_vfps = { - shift = 6, mask = 0x2c001, - [0] = "vmlaF.dnm", "vmlsF.dnm", - [0x04000] = "vnmlsF.dnm", [0x04001] = "vnmlaF.dnm", - [0x08000] = "vmulF.dnm", [0x08001] = "vnmulF.dnm", - [0x0c000] = "vaddF.dnm", [0x0c001] = "vsubF.dnm", - [0x20000] = "vdivF.dnm", - [0x24000] = "vfnmsF.dnm", [0x24001] = "vfnmaF.dnm", - [0x28000] = "vfmaF.dnm", [0x28001] = "vfmsF.dnm", - [0x2c000] = "vmovF.dY", - [0x2c001] = { - shift = 7, mask = 0x1e01, - [0] = "vmovF.dm", "vabsF.dm", - [0x0200] = "vnegF.dm", [0x0201] = "vsqrtF.dm", - [0x0800] = "vcmpF.dm", [0x0801] = "vcmpeF.dm", - [0x0a00] = "vcmpzF.d", [0x0a01] = "vcmpzeF.d", - [0x0e01] = "vcvtG.dF.m", - [0x1000] = "vcvt.f32.u32Fdm", [0x1001] = "vcvt.f32.s32Fdm", - [0x1800] = "vcvtr.u32F.dm", [0x1801] = "vcvt.u32F.dm", - [0x1a00] = "vcvtr.s32F.dm", [0x1a01] = "vcvt.s32F.dm", - }, -} - -local map_vfpd = { - shift = 6, mask = 0x2c001, - [0] = "vmlaG.dnm", "vmlsG.dnm", - [0x04000] = "vnmlsG.dnm", [0x04001] = "vnmlaG.dnm", - [0x08000] = "vmulG.dnm", [0x08001] = "vnmulG.dnm", - [0x0c000] = "vaddG.dnm", [0x0c001] = "vsubG.dnm", - [0x20000] = "vdivG.dnm", - [0x24000] = "vfnmsG.dnm", [0x24001] = "vfnmaG.dnm", - [0x28000] = "vfmaG.dnm", [0x28001] = "vfmsG.dnm", - [0x2c000] = "vmovG.dY", - [0x2c001] = { - shift = 7, mask = 0x1e01, - [0] = "vmovG.dm", "vabsG.dm", - [0x0200] = "vnegG.dm", [0x0201] = "vsqrtG.dm", - [0x0800] = "vcmpG.dm", [0x0801] = "vcmpeG.dm", - [0x0a00] = "vcmpzG.d", [0x0a01] = "vcmpzeG.d", - [0x0e01] = "vcvtF.dG.m", - [0x1000] = "vcvt.f64.u32GdFm", [0x1001] = "vcvt.f64.s32GdFm", - [0x1800] = "vcvtr.u32FdG.m", [0x1801] = "vcvt.u32FdG.m", - [0x1a00] = "vcvtr.s32FdG.m", [0x1a01] = "vcvt.s32FdG.m", - }, -} - -local map_datac = { - shift = 24, mask = 1, - [0] = { - shift = 4, mask = 1, - [0] = { - shift = 8, mask = 15, - [10] = map_vfps, - [11] = map_vfpd, - -- NYI cdp, mcr, mrc. - }, - { - shift = 8, mask = 15, - [10] = { - shift = 20, mask = 15, - [0] = "vmovFnD", "vmovFDn", - [14] = "vmsrD", - [15] = { shift = 12, mask = 15, [15] = "vmrs", _ = "vmrsD", }, - }, - }, - }, - "svcT", -} - -local map_loadcu = { - shift = 0, mask = 0, -- NYI unconditional CP load/store. -} - -local map_datacu = { - shift = 0, mask = 0, -- NYI unconditional CP data. -} - -local map_simddata = { - shift = 0, mask = 0, -- NYI SIMD data. -} - -local map_simdload = { - shift = 0, mask = 0, -- NYI SIMD load/store, preload. -} - -local map_preload = { - shift = 0, mask = 0, -- NYI preload. -} - -local map_media = { - shift = 20, mask = 31, - [0] = false, - { --01 - shift = 5, mask = 7, - [0] = "sadd16DNM", "sasxDNM", "ssaxDNM", "ssub16DNM", - "sadd8DNM", false, false, "ssub8DNM", - }, - { --02 - shift = 5, mask = 7, - [0] = "qadd16DNM", "qasxDNM", "qsaxDNM", "qsub16DNM", - "qadd8DNM", false, false, "qsub8DNM", - }, - { --03 - shift = 5, mask = 7, - [0] = "shadd16DNM", "shasxDNM", "shsaxDNM", "shsub16DNM", - "shadd8DNM", false, false, "shsub8DNM", - }, - false, - { --05 - shift = 5, mask = 7, - [0] = "uadd16DNM", "uasxDNM", "usaxDNM", "usub16DNM", - "uadd8DNM", false, false, "usub8DNM", - }, - { --06 - shift = 5, mask = 7, - [0] = "uqadd16DNM", "uqasxDNM", "uqsaxDNM", "uqsub16DNM", - "uqadd8DNM", false, false, "uqsub8DNM", - }, - { --07 - shift = 5, mask = 7, - [0] = "uhadd16DNM", "uhasxDNM", "uhsaxDNM", "uhsub16DNM", - "uhadd8DNM", false, false, "uhsub8DNM", - }, - { --08 - shift = 5, mask = 7, - [0] = "pkhbtDNMU", false, "pkhtbDNMU", - { shift = 16, mask = 15, [15] = "sxtb16DMU", _ = "sxtab16DNMU", }, - "pkhbtDNMU", "selDNM", "pkhtbDNMU", - }, - false, - { --0a - shift = 5, mask = 7, - [0] = "ssatDxMu", "ssat16DxM", "ssatDxMu", - { shift = 16, mask = 15, [15] = "sxtbDMU", _ = "sxtabDNMU", }, - "ssatDxMu", false, "ssatDxMu", - }, - { --0b - shift = 5, mask = 7, - [0] = "ssatDxMu", "revDM", "ssatDxMu", - { shift = 16, mask = 15, [15] = "sxthDMU", _ = "sxtahDNMU", }, - "ssatDxMu", "rev16DM", "ssatDxMu", - }, - { --0c - shift = 5, mask = 7, - [3] = { shift = 16, mask = 15, [15] = "uxtb16DMU", _ = "uxtab16DNMU", }, - }, - false, - { --0e - shift = 5, mask = 7, - [0] = "usatDwMu", "usat16DwM", "usatDwMu", - { shift = 16, mask = 15, [15] = "uxtbDMU", _ = "uxtabDNMU", }, - "usatDwMu", false, "usatDwMu", - }, - { --0f - shift = 5, mask = 7, - [0] = "usatDwMu", "rbitDM", "usatDwMu", - { shift = 16, mask = 15, [15] = "uxthDMU", _ = "uxtahDNMU", }, - "usatDwMu", "revshDM", "usatDwMu", - }, - { --10 - shift = 12, mask = 15, - [15] = { - shift = 5, mask = 7, - "smuadNMS", "smuadxNMS", "smusdNMS", "smusdxNMS", - }, - _ = { - shift = 5, mask = 7, - [0] = "smladNMSD", "smladxNMSD", "smlsdNMSD", "smlsdxNMSD", - }, - }, - false, false, false, - { --14 - shift = 5, mask = 7, - [0] = "smlaldDNMS", "smlaldxDNMS", "smlsldDNMS", "smlsldxDNMS", - }, - { --15 - shift = 5, mask = 7, - [0] = { shift = 12, mask = 15, [15] = "smmulNMS", _ = "smmlaNMSD", }, - { shift = 12, mask = 15, [15] = "smmulrNMS", _ = "smmlarNMSD", }, - false, false, false, false, - "smmlsNMSD", "smmlsrNMSD", - }, - false, false, - { --18 - shift = 5, mask = 7, - [0] = { shift = 12, mask = 15, [15] = "usad8NMS", _ = "usada8NMSD", }, - }, - false, - { --1a - shift = 5, mask = 3, [2] = "sbfxDMvw", - }, - { --1b - shift = 5, mask = 3, [2] = "sbfxDMvw", - }, - { --1c - shift = 5, mask = 3, - [0] = { shift = 0, mask = 15, [15] = "bfcDvX", _ = "bfiDMvX", }, - }, - { --1d - shift = 5, mask = 3, - [0] = { shift = 0, mask = 15, [15] = "bfcDvX", _ = "bfiDMvX", }, - }, - { --1e - shift = 5, mask = 3, [2] = "ubfxDMvw", - }, - { --1f - shift = 5, mask = 3, [2] = "ubfxDMvw", - }, -} - -local map_load = { - shift = 21, mask = 9, - { - shift = 20, mask = 5, - [0] = "strtDL", "ldrtDL", [4] = "strbtDL", [5] = "ldrbtDL", - }, - _ = { - shift = 20, mask = 5, - [0] = "strDL", "ldrDL", [4] = "strbDL", [5] = "ldrbDL", - } -} - -local map_load1 = { - shift = 4, mask = 1, - [0] = map_load, map_media, -} - -local map_loadm = { - shift = 20, mask = 1, - [0] = { - shift = 23, mask = 3, - [0] = "stmdaNR", "stmNR", - { shift = 16, mask = 63, [45] = "pushR", _ = "stmdbNR", }, "stmibNR", - }, - { - shift = 23, mask = 3, - [0] = "ldmdaNR", { shift = 16, mask = 63, [61] = "popR", _ = "ldmNR", }, - "ldmdbNR", "ldmibNR", - }, -} - -local map_data = { - shift = 21, mask = 15, - [0] = "andDNPs", "eorDNPs", "subDNPs", "rsbDNPs", - "addDNPs", "adcDNPs", "sbcDNPs", "rscDNPs", - "tstNP", "teqNP", "cmpNP", "cmnNP", - "orrDNPs", "movDPs", "bicDNPs", "mvnDPs", -} - -local map_mul = { - shift = 21, mask = 7, - [0] = "mulNMSs", "mlaNMSDs", "umaalDNMS", "mlsDNMS", - "umullDNMSs", "umlalDNMSs", "smullDNMSs", "smlalDNMSs", -} - -local map_sync = { - shift = 20, mask = 15, -- NYI: brackets around N. R(D+1) for ldrexd/strexd. - [0] = "swpDMN", false, false, false, - "swpbDMN", false, false, false, - "strexDMN", "ldrexDN", "strexdDN", "ldrexdDN", - "strexbDMN", "ldrexbDN", "strexhDN", "ldrexhDN", -} - -local map_mulh = { - shift = 21, mask = 3, - [0] = { shift = 5, mask = 3, - [0] = "smlabbNMSD", "smlatbNMSD", "smlabtNMSD", "smlattNMSD", }, - { shift = 5, mask = 3, - [0] = "smlawbNMSD", "smulwbNMS", "smlawtNMSD", "smulwtNMS", }, - { shift = 5, mask = 3, - [0] = "smlalbbDNMS", "smlaltbDNMS", "smlalbtDNMS", "smlalttDNMS", }, - { shift = 5, mask = 3, - [0] = "smulbbNMS", "smultbNMS", "smulbtNMS", "smulttNMS", }, -} - -local map_misc = { - shift = 4, mask = 7, - -- NYI: decode PSR bits of msr. - [0] = { shift = 21, mask = 1, [0] = "mrsD", "msrM", }, - { shift = 21, mask = 3, "bxM", false, "clzDM", }, - { shift = 21, mask = 3, "bxjM", }, - { shift = 21, mask = 3, "blxM", }, - false, - { shift = 21, mask = 3, [0] = "qaddDMN", "qsubDMN", "qdaddDMN", "qdsubDMN", }, - false, - { shift = 21, mask = 3, "bkptK", }, -} - -local map_datar = { - shift = 4, mask = 9, - [9] = { - shift = 5, mask = 3, - [0] = { shift = 24, mask = 1, [0] = map_mul, map_sync, }, - { shift = 20, mask = 1, [0] = "strhDL", "ldrhDL", }, - { shift = 20, mask = 1, [0] = "ldrdDL", "ldrsbDL", }, - { shift = 20, mask = 1, [0] = "strdDL", "ldrshDL", }, - }, - _ = { - shift = 20, mask = 25, - [16] = { shift = 7, mask = 1, [0] = map_misc, map_mulh, }, - _ = { - shift = 0, mask = 0xffffffff, - [bor(0xe1a00000)] = "nop", - _ = map_data, - } - }, -} - -local map_datai = { - shift = 20, mask = 31, -- NYI: decode PSR bits of msr. Decode imm12. - [16] = "movwDW", [20] = "movtDW", - [18] = { shift = 0, mask = 0xf00ff, [0] = "nopv6", _ = "msrNW", }, - [22] = "msrNW", - _ = map_data, -} - -local map_branch = { - shift = 24, mask = 1, - [0] = "bB", "blB" -} - -local map_condins = { - [0] = map_datar, map_datai, map_load, map_load1, - map_loadm, map_branch, map_loadc, map_datac -} - --- NYI: setend. -local map_uncondins = { - [0] = false, map_simddata, map_simdload, map_preload, - false, "blxB", map_loadcu, map_datacu, -} - ------------------------------------------------------------------------------- - -local map_gpr = { - [0] = "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", - "r8", "r9", "r10", "r11", "r12", "sp", "lr", "pc", -} - -local map_cond = { - [0] = "eq", "ne", "hs", "lo", "mi", "pl", "vs", "vc", - "hi", "ls", "ge", "lt", "gt", "le", "al", -} - -local map_shift = { [0] = "lsl", "lsr", "asr", "ror", } - ------------------------------------------------------------------------------- - --- Output a nicely formatted line with an opcode and operands. -local function putop(ctx, text, operands) - local pos = ctx.pos - local extra = "" - if ctx.rel then - local sym = ctx.symtab[ctx.rel] - if sym then - extra = "\t->"..sym - elseif band(ctx.op, 0x0e000000) ~= 0x0a000000 then - extra = "\t; 0x"..tohex(ctx.rel) - end - end - if ctx.hexdump > 0 then - ctx.out(format("%08x %s %-5s %s%s\n", - ctx.addr+pos, tohex(ctx.op), text, concat(operands, ", "), extra)) - else - ctx.out(format("%08x %-5s %s%s\n", - ctx.addr+pos, text, concat(operands, ", "), extra)) - end - ctx.pos = pos + 4 -end - --- Fallback for unknown opcodes. -local function unknown(ctx) - return putop(ctx, ".long", { "0x"..tohex(ctx.op) }) -end - --- Format operand 2 of load/store opcodes. -local function fmtload(ctx, op, pos) - local base = map_gpr[band(rshift(op, 16), 15)] - local x, ofs - local ext = (band(op, 0x04000000) == 0) - if not ext and band(op, 0x02000000) == 0 then - ofs = band(op, 4095) - if band(op, 0x00800000) == 0 then ofs = -ofs end - if base == "pc" then ctx.rel = ctx.addr + pos + 8 + ofs end - ofs = "#"..ofs - elseif ext and band(op, 0x00400000) ~= 0 then - ofs = band(op, 15) + band(rshift(op, 4), 0xf0) - if band(op, 0x00800000) == 0 then ofs = -ofs end - if base == "pc" then ctx.rel = ctx.addr + pos + 8 + ofs end - ofs = "#"..ofs - else - ofs = map_gpr[band(op, 15)] - if ext or band(op, 0xfe0) == 0 then - elseif band(op, 0xfe0) == 0x60 then - ofs = format("%s, rrx", ofs) - else - local sh = band(rshift(op, 7), 31) - if sh == 0 then sh = 32 end - ofs = format("%s, %s #%d", ofs, map_shift[band(rshift(op, 5), 3)], sh) - end - if band(op, 0x00800000) == 0 then ofs = "-"..ofs end - end - if ofs == "#0" then - x = format("[%s]", base) - elseif band(op, 0x01000000) == 0 then - x = format("[%s], %s", base, ofs) - else - x = format("[%s, %s]", base, ofs) - end - if band(op, 0x01200000) == 0x01200000 then x = x.."!" end - return x -end - --- Format operand 2 of vector load/store opcodes. -local function fmtvload(ctx, op, pos) - local base = map_gpr[band(rshift(op, 16), 15)] - local ofs = band(op, 255)*4 - if band(op, 0x00800000) == 0 then ofs = -ofs end - if base == "pc" then ctx.rel = ctx.addr + pos + 8 + ofs end - if ofs == 0 then - return format("[%s]", base) - else - return format("[%s, #%d]", base, ofs) - end -end - -local function fmtvr(op, vr, sh0, sh1) - if vr == "s" then - return format("s%d", 2*band(rshift(op, sh0), 15)+band(rshift(op, sh1), 1)) - else - return format("d%d", band(rshift(op, sh0), 15)+band(rshift(op, sh1-4), 16)) - end -end - --- Disassemble a single instruction. -local function disass_ins(ctx) - local pos = ctx.pos - local b0, b1, b2, b3 = byte(ctx.code, pos+1, pos+4) - local op = bor(lshift(b3, 24), lshift(b2, 16), lshift(b1, 8), b0) - local operands = {} - local suffix = "" - local last, name, pat - local vr - ctx.op = op - ctx.rel = nil - - local cond = rshift(op, 28) - local opat - if cond == 15 then - opat = map_uncondins[band(rshift(op, 25), 7)] - else - if cond ~= 14 then suffix = map_cond[cond] end - opat = map_condins[band(rshift(op, 25), 7)] - end - while type(opat) ~= "string" do - if not opat then return unknown(ctx) end - opat = opat[band(rshift(op, opat.shift), opat.mask)] or opat._ - end - name, pat = match(opat, "^([a-z0-9]*)(.*)") - if sub(pat, 1, 1) == "." then - local s2, p2 = match(pat, "^([a-z0-9.]*)(.*)") - suffix = suffix..s2 - pat = p2 - end - - for p in gmatch(pat, ".") do - local x = nil - if p == "D" then - x = map_gpr[band(rshift(op, 12), 15)] - elseif p == "N" then - x = map_gpr[band(rshift(op, 16), 15)] - elseif p == "S" then - x = map_gpr[band(rshift(op, 8), 15)] - elseif p == "M" then - x = map_gpr[band(op, 15)] - elseif p == "d" then - x = fmtvr(op, vr, 12, 22) - elseif p == "n" then - x = fmtvr(op, vr, 16, 7) - elseif p == "m" then - x = fmtvr(op, vr, 0, 5) - elseif p == "P" then - if band(op, 0x02000000) ~= 0 then - x = ror(band(op, 255), 2*band(rshift(op, 8), 15)) - else - x = map_gpr[band(op, 15)] - if band(op, 0xff0) ~= 0 then - operands[#operands+1] = x - local s = map_shift[band(rshift(op, 5), 3)] - local r = nil - if band(op, 0xf90) == 0 then - if s == "ror" then s = "rrx" else r = "#32" end - elseif band(op, 0x10) == 0 then - r = "#"..band(rshift(op, 7), 31) - else - r = map_gpr[band(rshift(op, 8), 15)] - end - if name == "mov" then name = s; x = r - elseif r then x = format("%s %s", s, r) - else x = s end - end - end - elseif p == "L" then - x = fmtload(ctx, op, pos) - elseif p == "l" then - x = fmtvload(ctx, op, pos) - elseif p == "B" then - local addr = ctx.addr + pos + 8 + arshift(lshift(op, 8), 6) - if cond == 15 then addr = addr + band(rshift(op, 23), 2) end - ctx.rel = addr - x = "0x"..tohex(addr) - elseif p == "F" then - vr = "s" - elseif p == "G" then - vr = "d" - elseif p == "." then - suffix = suffix..(vr == "s" and ".f32" or ".f64") - elseif p == "R" then - if band(op, 0x00200000) ~= 0 and #operands == 1 then - operands[1] = operands[1].."!" - end - local t = {} - for i=0,15 do - if band(rshift(op, i), 1) == 1 then t[#t+1] = map_gpr[i] end - end - x = "{"..concat(t, ", ").."}" - elseif p == "r" then - if band(op, 0x00200000) ~= 0 and #operands == 2 then - operands[1] = operands[1].."!" - end - local s = tonumber(sub(last, 2)) - local n = band(op, 255) - if vr == "d" then n = rshift(n, 1) end - operands[#operands] = format("{%s-%s%d}", last, vr, s+n-1) - elseif p == "W" then - x = band(op, 0x0fff) + band(rshift(op, 4), 0xf000) - elseif p == "T" then - x = "#0x"..tohex(band(op, 0x00ffffff), 6) - elseif p == "U" then - x = band(rshift(op, 7), 31) - if x == 0 then x = nil end - elseif p == "u" then - x = band(rshift(op, 7), 31) - if band(op, 0x40) == 0 then - if x == 0 then x = nil else x = "lsl #"..x end - else - if x == 0 then x = "asr #32" else x = "asr #"..x end - end - elseif p == "v" then - x = band(rshift(op, 7), 31) - elseif p == "w" then - x = band(rshift(op, 16), 31) - elseif p == "x" then - x = band(rshift(op, 16), 31) + 1 - elseif p == "X" then - x = band(rshift(op, 16), 31) - last + 1 - elseif p == "Y" then - x = band(rshift(op, 12), 0xf0) + band(op, 0x0f) - elseif p == "K" then - x = "#0x"..tohex(band(rshift(op, 4), 0x0000fff0) + band(op, 15), 4) - elseif p == "s" then - if band(op, 0x00100000) ~= 0 then suffix = "s"..suffix end - else - assert(false) - end - if x then - last = x - if type(x) == "number" then x = "#"..x end - operands[#operands+1] = x - end - end - - return putop(ctx, name..suffix, operands) -end - ------------------------------------------------------------------------------- - --- Disassemble a block of code. -local function disass_block(ctx, ofs, len) - if not ofs then ofs = 0 end - local stop = len and ofs+len or #ctx.code - ctx.pos = ofs - ctx.rel = nil - while ctx.pos < stop do disass_ins(ctx) end -end - --- Extended API: create a disassembler context. Then call ctx:disass(ofs, len). -local function create_(code, addr, out) - local ctx = {} - ctx.code = code - ctx.addr = addr or 0 - ctx.out = out or io.write - ctx.symtab = {} - ctx.disass = disass_block - ctx.hexdump = 8 - return ctx -end - --- Simple API: disassemble code (a string) at address and output via out. -local function disass_(code, addr, out) - create_(code, addr, out):disass() -end - --- Return register name for RID. -local function regname_(r) - if r < 16 then return map_gpr[r] end - return "d"..(r-16) -end - --- Public module functions. -module(...) - -create = create_ -disass = disass_ -regname = regname_ - diff --git a/subprojects/luajit/src/jit/dis_mips.lua b/subprojects/luajit/src/jit/dis_mips.lua deleted file mode 100644 index 02dfc1722..000000000 --- a/subprojects/luajit/src/jit/dis_mips.lua +++ /dev/null @@ -1,428 +0,0 @@ ----------------------------------------------------------------------------- --- LuaJIT MIPS disassembler module. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- Released under the MIT/X license. See Copyright Notice in luajit.h ----------------------------------------------------------------------------- --- This is a helper module used by the LuaJIT machine code dumper module. --- --- It disassembles all standard MIPS32R1/R2 instructions. --- Default mode is big-endian, but see: dis_mipsel.lua ------------------------------------------------------------------------------- - -local type = type -local byte, format = string.byte, string.format -local match, gmatch = string.match, string.gmatch -local concat = table.concat -local bit = require("bit") -local band, bor, tohex = bit.band, bit.bor, bit.tohex -local lshift, rshift, arshift = bit.lshift, bit.rshift, bit.arshift - ------------------------------------------------------------------------------- --- Primary and extended opcode maps ------------------------------------------------------------------------------- - -local map_movci = { shift = 16, mask = 1, [0] = "movfDSC", "movtDSC", } -local map_srl = { shift = 21, mask = 1, [0] = "srlDTA", "rotrDTA", } -local map_srlv = { shift = 6, mask = 1, [0] = "srlvDTS", "rotrvDTS", } - -local map_special = { - shift = 0, mask = 63, - [0] = { shift = 0, mask = -1, [0] = "nop", _ = "sllDTA" }, - map_movci, map_srl, "sraDTA", - "sllvDTS", false, map_srlv, "sravDTS", - "jrS", "jalrD1S", "movzDST", "movnDST", - "syscallY", "breakY", false, "sync", - "mfhiD", "mthiS", "mfloD", "mtloS", - false, false, false, false, - "multST", "multuST", "divST", "divuST", - false, false, false, false, - "addDST", "addu|moveDST0", "subDST", "subu|neguDS0T", - "andDST", "orDST", "xorDST", "nor|notDST0", - false, false, "sltDST", "sltuDST", - false, false, false, false, - "tgeSTZ", "tgeuSTZ", "tltSTZ", "tltuSTZ", - "teqSTZ", false, "tneSTZ", -} - -local map_special2 = { - shift = 0, mask = 63, - [0] = "maddST", "madduST", "mulDST", false, - "msubST", "msubuST", - [32] = "clzDS", [33] = "cloDS", - [63] = "sdbbpY", -} - -local map_bshfl = { - shift = 6, mask = 31, - [2] = "wsbhDT", - [16] = "sebDT", - [24] = "sehDT", -} - -local map_special3 = { - shift = 0, mask = 63, - [0] = "extTSAK", [4] = "insTSAL", - [32] = map_bshfl, - [59] = "rdhwrTD", -} - -local map_regimm = { - shift = 16, mask = 31, - [0] = "bltzSB", "bgezSB", "bltzlSB", "bgezlSB", - false, false, false, false, - "tgeiSI", "tgeiuSI", "tltiSI", "tltiuSI", - "teqiSI", false, "tneiSI", false, - "bltzalSB", "bgezalSB", "bltzallSB", "bgezallSB", - false, false, false, false, - false, false, false, false, - false, false, false, "synciSO", -} - -local map_cop0 = { - shift = 25, mask = 1, - [0] = { - shift = 21, mask = 15, - [0] = "mfc0TDW", [4] = "mtc0TDW", - [10] = "rdpgprDT", - [11] = { shift = 5, mask = 1, [0] = "diT0", "eiT0", }, - [14] = "wrpgprDT", - }, { - shift = 0, mask = 63, - [1] = "tlbr", [2] = "tlbwi", [6] = "tlbwr", [8] = "tlbp", - [24] = "eret", [31] = "deret", - [32] = "wait", - }, -} - -local map_cop1s = { - shift = 0, mask = 63, - [0] = "add.sFGH", "sub.sFGH", "mul.sFGH", "div.sFGH", - "sqrt.sFG", "abs.sFG", "mov.sFG", "neg.sFG", - "round.l.sFG", "trunc.l.sFG", "ceil.l.sFG", "floor.l.sFG", - "round.w.sFG", "trunc.w.sFG", "ceil.w.sFG", "floor.w.sFG", - false, - { shift = 16, mask = 1, [0] = "movf.sFGC", "movt.sFGC" }, - "movz.sFGT", "movn.sFGT", - false, "recip.sFG", "rsqrt.sFG", false, - false, false, false, false, - false, false, false, false, - false, "cvt.d.sFG", false, false, - "cvt.w.sFG", "cvt.l.sFG", "cvt.ps.sFGH", false, - false, false, false, false, - false, false, false, false, - "c.f.sVGH", "c.un.sVGH", "c.eq.sVGH", "c.ueq.sVGH", - "c.olt.sVGH", "c.ult.sVGH", "c.ole.sVGH", "c.ule.sVGH", - "c.sf.sVGH", "c.ngle.sVGH", "c.seq.sVGH", "c.ngl.sVGH", - "c.lt.sVGH", "c.nge.sVGH", "c.le.sVGH", "c.ngt.sVGH", -} - -local map_cop1d = { - shift = 0, mask = 63, - [0] = "add.dFGH", "sub.dFGH", "mul.dFGH", "div.dFGH", - "sqrt.dFG", "abs.dFG", "mov.dFG", "neg.dFG", - "round.l.dFG", "trunc.l.dFG", "ceil.l.dFG", "floor.l.dFG", - "round.w.dFG", "trunc.w.dFG", "ceil.w.dFG", "floor.w.dFG", - false, - { shift = 16, mask = 1, [0] = "movf.dFGC", "movt.dFGC" }, - "movz.dFGT", "movn.dFGT", - false, "recip.dFG", "rsqrt.dFG", false, - false, false, false, false, - false, false, false, false, - "cvt.s.dFG", false, false, false, - "cvt.w.dFG", "cvt.l.dFG", false, false, - false, false, false, false, - false, false, false, false, - "c.f.dVGH", "c.un.dVGH", "c.eq.dVGH", "c.ueq.dVGH", - "c.olt.dVGH", "c.ult.dVGH", "c.ole.dVGH", "c.ule.dVGH", - "c.df.dVGH", "c.ngle.dVGH", "c.deq.dVGH", "c.ngl.dVGH", - "c.lt.dVGH", "c.nge.dVGH", "c.le.dVGH", "c.ngt.dVGH", -} - -local map_cop1ps = { - shift = 0, mask = 63, - [0] = "add.psFGH", "sub.psFGH", "mul.psFGH", false, - false, "abs.psFG", "mov.psFG", "neg.psFG", - false, false, false, false, - false, false, false, false, - false, - { shift = 16, mask = 1, [0] = "movf.psFGC", "movt.psFGC" }, - "movz.psFGT", "movn.psFGT", - false, false, false, false, - false, false, false, false, - false, false, false, false, - "cvt.s.puFG", false, false, false, - false, false, false, false, - "cvt.s.plFG", false, false, false, - "pll.psFGH", "plu.psFGH", "pul.psFGH", "puu.psFGH", - "c.f.psVGH", "c.un.psVGH", "c.eq.psVGH", "c.ueq.psVGH", - "c.olt.psVGH", "c.ult.psVGH", "c.ole.psVGH", "c.ule.psVGH", - "c.psf.psVGH", "c.ngle.psVGH", "c.pseq.psVGH", "c.ngl.psVGH", - "c.lt.psVGH", "c.nge.psVGH", "c.le.psVGH", "c.ngt.psVGH", -} - -local map_cop1w = { - shift = 0, mask = 63, - [32] = "cvt.s.wFG", [33] = "cvt.d.wFG", -} - -local map_cop1l = { - shift = 0, mask = 63, - [32] = "cvt.s.lFG", [33] = "cvt.d.lFG", -} - -local map_cop1bc = { - shift = 16, mask = 3, - [0] = "bc1fCB", "bc1tCB", "bc1flCB", "bc1tlCB", -} - -local map_cop1 = { - shift = 21, mask = 31, - [0] = "mfc1TG", false, "cfc1TG", "mfhc1TG", - "mtc1TG", false, "ctc1TG", "mthc1TG", - map_cop1bc, false, false, false, - false, false, false, false, - map_cop1s, map_cop1d, false, false, - map_cop1w, map_cop1l, map_cop1ps, -} - -local map_cop1x = { - shift = 0, mask = 63, - [0] = "lwxc1FSX", "ldxc1FSX", false, false, - false, "luxc1FSX", false, false, - "swxc1FSX", "sdxc1FSX", false, false, - false, "suxc1FSX", false, "prefxMSX", - false, false, false, false, - false, false, false, false, - false, false, false, false, - false, false, "alnv.psFGHS", false, - "madd.sFRGH", "madd.dFRGH", false, false, - false, false, "madd.psFRGH", false, - "msub.sFRGH", "msub.dFRGH", false, false, - false, false, "msub.psFRGH", false, - "nmadd.sFRGH", "nmadd.dFRGH", false, false, - false, false, "nmadd.psFRGH", false, - "nmsub.sFRGH", "nmsub.dFRGH", false, false, - false, false, "nmsub.psFRGH", false, -} - -local map_pri = { - [0] = map_special, map_regimm, "jJ", "jalJ", - "beq|beqz|bST00B", "bne|bnezST0B", "blezSB", "bgtzSB", - "addiTSI", "addiu|liTS0I", "sltiTSI", "sltiuTSI", - "andiTSU", "ori|liTS0U", "xoriTSU", "luiTU", - map_cop0, map_cop1, false, map_cop1x, - "beql|beqzlST0B", "bnel|bnezlST0B", "blezlSB", "bgtzlSB", - false, false, false, false, - map_special2, false, false, map_special3, - "lbTSO", "lhTSO", "lwlTSO", "lwTSO", - "lbuTSO", "lhuTSO", "lwrTSO", false, - "sbTSO", "shTSO", "swlTSO", "swTSO", - false, false, "swrTSO", "cacheNSO", - "llTSO", "lwc1HSO", "lwc2TSO", "prefNSO", - false, "ldc1HSO", "ldc2TSO", false, - "scTSO", "swc1HSO", "swc2TSO", false, - false, "sdc1HSO", "sdc2TSO", false, -} - ------------------------------------------------------------------------------- - -local map_gpr = { - [0] = "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", "sp", "r30", "ra", -} - ------------------------------------------------------------------------------- - --- Output a nicely formatted line with an opcode and operands. -local function putop(ctx, text, operands) - local pos = ctx.pos - local extra = "" - if ctx.rel then - local sym = ctx.symtab[ctx.rel] - if sym then extra = "\t->"..sym end - end - if ctx.hexdump > 0 then - ctx.out(format("%08x %s %-7s %s%s\n", - ctx.addr+pos, tohex(ctx.op), text, concat(operands, ", "), extra)) - else - ctx.out(format("%08x %-7s %s%s\n", - ctx.addr+pos, text, concat(operands, ", "), extra)) - end - ctx.pos = pos + 4 -end - --- Fallback for unknown opcodes. -local function unknown(ctx) - return putop(ctx, ".long", { "0x"..tohex(ctx.op) }) -end - -local function get_be(ctx) - local pos = ctx.pos - local b0, b1, b2, b3 = byte(ctx.code, pos+1, pos+4) - return bor(lshift(b0, 24), lshift(b1, 16), lshift(b2, 8), b3) -end - -local function get_le(ctx) - local pos = ctx.pos - local b0, b1, b2, b3 = byte(ctx.code, pos+1, pos+4) - return bor(lshift(b3, 24), lshift(b2, 16), lshift(b1, 8), b0) -end - --- Disassemble a single instruction. -local function disass_ins(ctx) - local op = ctx:get() - local operands = {} - local last = nil - ctx.op = op - ctx.rel = nil - - local opat = map_pri[rshift(op, 26)] - while type(opat) ~= "string" do - if not opat then return unknown(ctx) end - opat = opat[band(rshift(op, opat.shift), opat.mask)] or opat._ - end - local name, pat = match(opat, "^([a-z0-9_.]*)(.*)") - local altname, pat2 = match(pat, "|([a-z0-9_.|]*)(.*)") - if altname then pat = pat2 end - - for p in gmatch(pat, ".") do - local x = nil - if p == "S" then - x = map_gpr[band(rshift(op, 21), 31)] - elseif p == "T" then - x = map_gpr[band(rshift(op, 16), 31)] - elseif p == "D" then - x = map_gpr[band(rshift(op, 11), 31)] - elseif p == "F" then - x = "f"..band(rshift(op, 6), 31) - elseif p == "G" then - x = "f"..band(rshift(op, 11), 31) - elseif p == "H" then - x = "f"..band(rshift(op, 16), 31) - elseif p == "R" then - x = "f"..band(rshift(op, 21), 31) - elseif p == "A" then - x = band(rshift(op, 6), 31) - elseif p == "M" then - x = band(rshift(op, 11), 31) - elseif p == "N" then - x = band(rshift(op, 16), 31) - elseif p == "C" then - x = band(rshift(op, 18), 7) - if x == 0 then x = nil end - elseif p == "K" then - x = band(rshift(op, 11), 31) + 1 - elseif p == "L" then - x = band(rshift(op, 11), 31) - last + 1 - elseif p == "I" then - x = arshift(lshift(op, 16), 16) - elseif p == "U" then - x = band(op, 0xffff) - elseif p == "O" then - local disp = arshift(lshift(op, 16), 16) - operands[#operands] = format("%d(%s)", disp, last) - elseif p == "X" then - local index = map_gpr[band(rshift(op, 16), 31)] - operands[#operands] = format("%s(%s)", index, last) - elseif p == "B" then - x = ctx.addr + ctx.pos + arshift(lshift(op, 16), 16)*4 + 4 - ctx.rel = x - x = "0x"..tohex(x) - elseif p == "J" then - x = band(ctx.addr + ctx.pos, 0xf0000000) + band(op, 0x03ffffff)*4 - ctx.rel = x - x = "0x"..tohex(x) - elseif p == "V" then - x = band(rshift(op, 8), 7) - if x == 0 then x = nil end - elseif p == "W" then - x = band(op, 7) - if x == 0 then x = nil end - elseif p == "Y" then - x = band(rshift(op, 6), 0x000fffff) - if x == 0 then x = nil end - elseif p == "Z" then - x = band(rshift(op, 6), 1023) - if x == 0 then x = nil end - elseif p == "0" then - if last == "r0" or last == 0 then - local n = #operands - operands[n] = nil - last = operands[n-1] - if altname then - local a1, a2 = match(altname, "([^|]*)|(.*)") - if a1 then name, altname = a1, a2 - else name = altname end - end - end - elseif p == "1" then - if last == "ra" then - operands[#operands] = nil - end - else - assert(false) - end - if x then operands[#operands+1] = x; last = x end - end - - return putop(ctx, name, operands) -end - ------------------------------------------------------------------------------- - --- Disassemble a block of code. -local function disass_block(ctx, ofs, len) - if not ofs then ofs = 0 end - local stop = len and ofs+len or #ctx.code - stop = stop - stop % 4 - ctx.pos = ofs - ofs % 4 - ctx.rel = nil - while ctx.pos < stop do disass_ins(ctx) end -end - --- Extended API: create a disassembler context. Then call ctx:disass(ofs, len). -local function create_(code, addr, out) - local ctx = {} - ctx.code = code - ctx.addr = addr or 0 - ctx.out = out or io.write - ctx.symtab = {} - ctx.disass = disass_block - ctx.hexdump = 8 - ctx.get = get_be - return ctx -end - -local function create_el_(code, addr, out) - local ctx = create_(code, addr, out) - ctx.get = get_le - return ctx -end - --- Simple API: disassemble code (a string) at address and output via out. -local function disass_(code, addr, out) - create_(code, addr, out):disass() -end - -local function disass_el_(code, addr, out) - create_el_(code, addr, out):disass() -end - --- Return register name for RID. -local function regname_(r) - if r < 32 then return map_gpr[r] end - return "f"..(r-32) -end - --- Public module functions. -module(...) - -create = create_ -create_el = create_el_ -disass = disass_ -disass_el = disass_el_ -regname = regname_ - diff --git a/subprojects/luajit/src/jit/dis_mipsel.lua b/subprojects/luajit/src/jit/dis_mipsel.lua deleted file mode 100644 index c9c2e2456..000000000 --- a/subprojects/luajit/src/jit/dis_mipsel.lua +++ /dev/null @@ -1,20 +0,0 @@ ----------------------------------------------------------------------------- --- LuaJIT MIPSEL disassembler wrapper module. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- Released under the MIT license. See Copyright Notice in luajit.h ----------------------------------------------------------------------------- --- This module just exports the little-endian functions from the --- MIPS disassembler module. All the interesting stuff is there. ------------------------------------------------------------------------------- - -local require = require - -module(...) - -local dis_mips = require(_PACKAGE.."dis_mips") - -create = dis_mips.create_el -disass = dis_mips.disass_el -regname = dis_mips.regname - diff --git a/subprojects/luajit/src/jit/dis_ppc.lua b/subprojects/luajit/src/jit/dis_ppc.lua deleted file mode 100644 index 4043aeb8d..000000000 --- a/subprojects/luajit/src/jit/dis_ppc.lua +++ /dev/null @@ -1,591 +0,0 @@ ----------------------------------------------------------------------------- --- LuaJIT PPC disassembler module. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- Released under the MIT/X license. See Copyright Notice in luajit.h ----------------------------------------------------------------------------- --- This is a helper module used by the LuaJIT machine code dumper module. --- --- It disassembles all common, non-privileged 32/64 bit PowerPC instructions --- plus the e500 SPE instructions and some Cell/Xenon extensions. --- --- NYI: VMX, VMX128 ------------------------------------------------------------------------------- - -local type = type -local byte, format = string.byte, string.format -local match, gmatch, gsub = string.match, string.gmatch, string.gsub -local concat = table.concat -local bit = require("bit") -local band, bor, tohex = bit.band, bit.bor, bit.tohex -local lshift, rshift, arshift = bit.lshift, bit.rshift, bit.arshift - ------------------------------------------------------------------------------- --- Primary and extended opcode maps ------------------------------------------------------------------------------- - -local map_crops = { - shift = 1, mask = 1023, - [0] = "mcrfXX", - [33] = "crnor|crnotCCC=", [129] = "crandcCCC", - [193] = "crxor|crclrCCC%", [225] = "crnandCCC", - [257] = "crandCCC", [289] = "creqv|crsetCCC%", - [417] = "crorcCCC", [449] = "cror|crmoveCCC=", - [16] = "b_lrKB", [528] = "b_ctrKB", - [150] = "isync", -} - -local map_rlwinm = setmetatable({ - shift = 0, mask = -1, -}, -{ __index = function(t, x) - local rot = band(rshift(x, 11), 31) - local mb = band(rshift(x, 6), 31) - local me = band(rshift(x, 1), 31) - if mb == 0 and me == 31-rot then - return "slwiRR~A." - elseif me == 31 and mb == 32-rot then - return "srwiRR~-A." - else - return "rlwinmRR~AAA." - end - end -}) - -local map_rld = { - shift = 2, mask = 7, - [0] = "rldiclRR~HM.", "rldicrRR~HM.", "rldicRR~HM.", "rldimiRR~HM.", - { - shift = 1, mask = 1, - [0] = "rldclRR~RM.", "rldcrRR~RM.", - }, -} - -local map_ext = setmetatable({ - shift = 1, mask = 1023, - - [0] = "cmp_YLRR", [32] = "cmpl_YLRR", - [4] = "twARR", [68] = "tdARR", - - [8] = "subfcRRR.", [40] = "subfRRR.", - [104] = "negRR.", [136] = "subfeRRR.", - [200] = "subfzeRR.", [232] = "subfmeRR.", - [520] = "subfcoRRR.", [552] = "subfoRRR.", - [616] = "negoRR.", [648] = "subfeoRRR.", - [712] = "subfzeoRR.", [744] = "subfmeoRR.", - - [9] = "mulhduRRR.", [73] = "mulhdRRR.", [233] = "mulldRRR.", - [457] = "divduRRR.", [489] = "divdRRR.", - [745] = "mulldoRRR.", - [969] = "divduoRRR.", [1001] = "divdoRRR.", - - [10] = "addcRRR.", [138] = "addeRRR.", - [202] = "addzeRR.", [234] = "addmeRR.", [266] = "addRRR.", - [522] = "addcoRRR.", [650] = "addeoRRR.", - [714] = "addzeoRR.", [746] = "addmeoRR.", [778] = "addoRRR.", - - [11] = "mulhwuRRR.", [75] = "mulhwRRR.", [235] = "mullwRRR.", - [459] = "divwuRRR.", [491] = "divwRRR.", - [747] = "mullwoRRR.", - [971] = "divwouRRR.", [1003] = "divwoRRR.", - - [15] = "iselltRRR", [47] = "iselgtRRR", [79] = "iseleqRRR", - - [144] = { shift = 20, mask = 1, [0] = "mtcrfRZ~", "mtocrfRZ~", }, - [19] = { shift = 20, mask = 1, [0] = "mfcrR", "mfocrfRZ", }, - [371] = { shift = 11, mask = 1023, [392] = "mftbR", [424] = "mftbuR", }, - [339] = { - shift = 11, mask = 1023, - [32] = "mferR", [256] = "mflrR", [288] = "mfctrR", [16] = "mfspefscrR", - }, - [467] = { - shift = 11, mask = 1023, - [32] = "mtxerR", [256] = "mtlrR", [288] = "mtctrR", [16] = "mtspefscrR", - }, - - [20] = "lwarxRR0R", [84] = "ldarxRR0R", - - [21] = "ldxRR0R", [53] = "lduxRRR", - [149] = "stdxRR0R", [181] = "stduxRRR", - [341] = "lwaxRR0R", [373] = "lwauxRRR", - - [23] = "lwzxRR0R", [55] = "lwzuxRRR", - [87] = "lbzxRR0R", [119] = "lbzuxRRR", - [151] = "stwxRR0R", [183] = "stwuxRRR", - [215] = "stbxRR0R", [247] = "stbuxRRR", - [279] = "lhzxRR0R", [311] = "lhzuxRRR", - [343] = "lhaxRR0R", [375] = "lhauxRRR", - [407] = "sthxRR0R", [439] = "sthuxRRR", - - [54] = "dcbst-R0R", [86] = "dcbf-R0R", - [150] = "stwcxRR0R.", [214] = "stdcxRR0R.", - [246] = "dcbtst-R0R", [278] = "dcbt-R0R", - [310] = "eciwxRR0R", [438] = "ecowxRR0R", - [470] = "dcbi-RR", - - [598] = { - shift = 21, mask = 3, - [0] = "sync", "lwsync", "ptesync", - }, - [758] = "dcba-RR", - [854] = "eieio", [982] = "icbi-R0R", [1014] = "dcbz-R0R", - - [26] = "cntlzwRR~", [58] = "cntlzdRR~", - [122] = "popcntbRR~", - [154] = "prtywRR~", [186] = "prtydRR~", - - [28] = "andRR~R.", [60] = "andcRR~R.", [124] = "nor|notRR~R=.", - [284] = "eqvRR~R.", [316] = "xorRR~R.", - [412] = "orcRR~R.", [444] = "or|mrRR~R=.", [476] = "nandRR~R.", - [508] = "cmpbRR~R", - - [512] = "mcrxrX", - - [532] = "ldbrxRR0R", [660] = "stdbrxRR0R", - - [533] = "lswxRR0R", [597] = "lswiRR0A", - [661] = "stswxRR0R", [725] = "stswiRR0A", - - [534] = "lwbrxRR0R", [662] = "stwbrxRR0R", - [790] = "lhbrxRR0R", [918] = "sthbrxRR0R", - - [535] = "lfsxFR0R", [567] = "lfsuxFRR", - [599] = "lfdxFR0R", [631] = "lfduxFRR", - [663] = "stfsxFR0R", [695] = "stfsuxFRR", - [727] = "stfdxFR0R", [759] = "stfduxFR0R", - [855] = "lfiwaxFR0R", - [983] = "stfiwxFR0R", - - [24] = "slwRR~R.", - - [27] = "sldRR~R.", [536] = "srwRR~R.", - [792] = "srawRR~R.", [824] = "srawiRR~A.", - - [794] = "sradRR~R.", [826] = "sradiRR~H.", [827] = "sradiRR~H.", - [922] = "extshRR~.", [954] = "extsbRR~.", [986] = "extswRR~.", - - [539] = "srdRR~R.", -}, -{ __index = function(t, x) - if band(x, 31) == 15 then return "iselRRRC" end - end -}) - -local map_ld = { - shift = 0, mask = 3, - [0] = "ldRRE", "lduRRE", "lwaRRE", -} - -local map_std = { - shift = 0, mask = 3, - [0] = "stdRRE", "stduRRE", -} - -local map_fps = { - shift = 5, mask = 1, - { - shift = 1, mask = 15, - [0] = false, false, "fdivsFFF.", false, - "fsubsFFF.", "faddsFFF.", "fsqrtsF-F.", false, - "fresF-F.", "fmulsFF-F.", "frsqrtesF-F.", false, - "fmsubsFFFF~.", "fmaddsFFFF~.", "fnmsubsFFFF~.", "fnmaddsFFFF~.", - } -} - -local map_fpd = { - shift = 5, mask = 1, - [0] = { - shift = 1, mask = 1023, - [0] = "fcmpuXFF", [32] = "fcmpoXFF", [64] = "mcrfsXX", - [38] = "mtfsb1A.", [70] = "mtfsb0A.", [134] = "mtfsfiA>>-A>", - [8] = "fcpsgnFFF.", [40] = "fnegF-F.", [72] = "fmrF-F.", - [136] = "fnabsF-F.", [264] = "fabsF-F.", - [12] = "frspF-F.", - [14] = "fctiwF-F.", [15] = "fctiwzF-F.", - [583] = "mffsF.", [711] = "mtfsfZF.", - [392] = "frinF-F.", [424] = "frizF-F.", - [456] = "fripF-F.", [488] = "frimF-F.", - [814] = "fctidF-F.", [815] = "fctidzF-F.", [846] = "fcfidF-F.", - }, - { - shift = 1, mask = 15, - [0] = false, false, "fdivFFF.", false, - "fsubFFF.", "faddFFF.", "fsqrtF-F.", "fselFFFF~.", - "freF-F.", "fmulFF-F.", "frsqrteF-F.", false, - "fmsubFFFF~.", "fmaddFFFF~.", "fnmsubFFFF~.", "fnmaddFFFF~.", - } -} - -local map_spe = { - shift = 0, mask = 2047, - - [512] = "evaddwRRR", [514] = "evaddiwRAR~", - [516] = "evsubwRRR~", [518] = "evsubiwRAR~", - [520] = "evabsRR", [521] = "evnegRR", - [522] = "evextsbRR", [523] = "evextshRR", [524] = "evrndwRR", - [525] = "evcntlzwRR", [526] = "evcntlswRR", - - [527] = "brincRRR", - - [529] = "evandRRR", [530] = "evandcRRR", [534] = "evxorRRR", - [535] = "evor|evmrRRR=", [536] = "evnor|evnotRRR=", - [537] = "eveqvRRR", [539] = "evorcRRR", [542] = "evnandRRR", - - [544] = "evsrwuRRR", [545] = "evsrwsRRR", - [546] = "evsrwiuRRA", [547] = "evsrwisRRA", - [548] = "evslwRRR", [550] = "evslwiRRA", - [552] = "evrlwRRR", [553] = "evsplatiRS", - [554] = "evrlwiRRA", [555] = "evsplatfiRS", - [556] = "evmergehiRRR", [557] = "evmergeloRRR", - [558] = "evmergehiloRRR", [559] = "evmergelohiRRR", - - [560] = "evcmpgtuYRR", [561] = "evcmpgtsYRR", - [562] = "evcmpltuYRR", [563] = "evcmpltsYRR", - [564] = "evcmpeqYRR", - - [632] = "evselRRR", [633] = "evselRRRW", - [634] = "evselRRRW", [635] = "evselRRRW", - [636] = "evselRRRW", [637] = "evselRRRW", - [638] = "evselRRRW", [639] = "evselRRRW", - - [640] = "evfsaddRRR", [641] = "evfssubRRR", - [644] = "evfsabsRR", [645] = "evfsnabsRR", [646] = "evfsnegRR", - [648] = "evfsmulRRR", [649] = "evfsdivRRR", - [652] = "evfscmpgtYRR", [653] = "evfscmpltYRR", [654] = "evfscmpeqYRR", - [656] = "evfscfuiR-R", [657] = "evfscfsiR-R", - [658] = "evfscfufR-R", [659] = "evfscfsfR-R", - [660] = "evfsctuiR-R", [661] = "evfsctsiR-R", - [662] = "evfsctufR-R", [663] = "evfsctsfR-R", - [664] = "evfsctuizR-R", [666] = "evfsctsizR-R", - [668] = "evfststgtYRR", [669] = "evfststltYRR", [670] = "evfststeqYRR", - - [704] = "efsaddRRR", [705] = "efssubRRR", - [708] = "efsabsRR", [709] = "efsnabsRR", [710] = "efsnegRR", - [712] = "efsmulRRR", [713] = "efsdivRRR", - [716] = "efscmpgtYRR", [717] = "efscmpltYRR", [718] = "efscmpeqYRR", - [719] = "efscfdR-R", - [720] = "efscfuiR-R", [721] = "efscfsiR-R", - [722] = "efscfufR-R", [723] = "efscfsfR-R", - [724] = "efsctuiR-R", [725] = "efsctsiR-R", - [726] = "efsctufR-R", [727] = "efsctsfR-R", - [728] = "efsctuizR-R", [730] = "efsctsizR-R", - [732] = "efststgtYRR", [733] = "efststltYRR", [734] = "efststeqYRR", - - [736] = "efdaddRRR", [737] = "efdsubRRR", - [738] = "efdcfuidR-R", [739] = "efdcfsidR-R", - [740] = "efdabsRR", [741] = "efdnabsRR", [742] = "efdnegRR", - [744] = "efdmulRRR", [745] = "efddivRRR", - [746] = "efdctuidzR-R", [747] = "efdctsidzR-R", - [748] = "efdcmpgtYRR", [749] = "efdcmpltYRR", [750] = "efdcmpeqYRR", - [751] = "efdcfsR-R", - [752] = "efdcfuiR-R", [753] = "efdcfsiR-R", - [754] = "efdcfufR-R", [755] = "efdcfsfR-R", - [756] = "efdctuiR-R", [757] = "efdctsiR-R", - [758] = "efdctufR-R", [759] = "efdctsfR-R", - [760] = "efdctuizR-R", [762] = "efdctsizR-R", - [764] = "efdtstgtYRR", [765] = "efdtstltYRR", [766] = "efdtsteqYRR", - - [768] = "evlddxRR0R", [769] = "evlddRR8", - [770] = "evldwxRR0R", [771] = "evldwRR8", - [772] = "evldhxRR0R", [773] = "evldhRR8", - [776] = "evlhhesplatxRR0R", [777] = "evlhhesplatRR2", - [780] = "evlhhousplatxRR0R", [781] = "evlhhousplatRR2", - [782] = "evlhhossplatxRR0R", [783] = "evlhhossplatRR2", - [784] = "evlwhexRR0R", [785] = "evlwheRR4", - [788] = "evlwhouxRR0R", [789] = "evlwhouRR4", - [790] = "evlwhosxRR0R", [791] = "evlwhosRR4", - [792] = "evlwwsplatxRR0R", [793] = "evlwwsplatRR4", - [796] = "evlwhsplatxRR0R", [797] = "evlwhsplatRR4", - - [800] = "evstddxRR0R", [801] = "evstddRR8", - [802] = "evstdwxRR0R", [803] = "evstdwRR8", - [804] = "evstdhxRR0R", [805] = "evstdhRR8", - [816] = "evstwhexRR0R", [817] = "evstwheRR4", - [820] = "evstwhoxRR0R", [821] = "evstwhoRR4", - [824] = "evstwwexRR0R", [825] = "evstwweRR4", - [828] = "evstwwoxRR0R", [829] = "evstwwoRR4", - - [1027] = "evmhessfRRR", [1031] = "evmhossfRRR", [1032] = "evmheumiRRR", - [1033] = "evmhesmiRRR", [1035] = "evmhesmfRRR", [1036] = "evmhoumiRRR", - [1037] = "evmhosmiRRR", [1039] = "evmhosmfRRR", [1059] = "evmhessfaRRR", - [1063] = "evmhossfaRRR", [1064] = "evmheumiaRRR", [1065] = "evmhesmiaRRR", - [1067] = "evmhesmfaRRR", [1068] = "evmhoumiaRRR", [1069] = "evmhosmiaRRR", - [1071] = "evmhosmfaRRR", [1095] = "evmwhssfRRR", [1096] = "evmwlumiRRR", - [1100] = "evmwhumiRRR", [1101] = "evmwhsmiRRR", [1103] = "evmwhsmfRRR", - [1107] = "evmwssfRRR", [1112] = "evmwumiRRR", [1113] = "evmwsmiRRR", - [1115] = "evmwsmfRRR", [1127] = "evmwhssfaRRR", [1128] = "evmwlumiaRRR", - [1132] = "evmwhumiaRRR", [1133] = "evmwhsmiaRRR", [1135] = "evmwhsmfaRRR", - [1139] = "evmwssfaRRR", [1144] = "evmwumiaRRR", [1145] = "evmwsmiaRRR", - [1147] = "evmwsmfaRRR", - - [1216] = "evaddusiaawRR", [1217] = "evaddssiaawRR", - [1218] = "evsubfusiaawRR", [1219] = "evsubfssiaawRR", - [1220] = "evmraRR", - [1222] = "evdivwsRRR", [1223] = "evdivwuRRR", - [1224] = "evaddumiaawRR", [1225] = "evaddsmiaawRR", - [1226] = "evsubfumiaawRR", [1227] = "evsubfsmiaawRR", - - [1280] = "evmheusiaawRRR", [1281] = "evmhessiaawRRR", - [1283] = "evmhessfaawRRR", [1284] = "evmhousiaawRRR", - [1285] = "evmhossiaawRRR", [1287] = "evmhossfaawRRR", - [1288] = "evmheumiaawRRR", [1289] = "evmhesmiaawRRR", - [1291] = "evmhesmfaawRRR", [1292] = "evmhoumiaawRRR", - [1293] = "evmhosmiaawRRR", [1295] = "evmhosmfaawRRR", - [1320] = "evmhegumiaaRRR", [1321] = "evmhegsmiaaRRR", - [1323] = "evmhegsmfaaRRR", [1324] = "evmhogumiaaRRR", - [1325] = "evmhogsmiaaRRR", [1327] = "evmhogsmfaaRRR", - [1344] = "evmwlusiaawRRR", [1345] = "evmwlssiaawRRR", - [1352] = "evmwlumiaawRRR", [1353] = "evmwlsmiaawRRR", - [1363] = "evmwssfaaRRR", [1368] = "evmwumiaaRRR", - [1369] = "evmwsmiaaRRR", [1371] = "evmwsmfaaRRR", - [1408] = "evmheusianwRRR", [1409] = "evmhessianwRRR", - [1411] = "evmhessfanwRRR", [1412] = "evmhousianwRRR", - [1413] = "evmhossianwRRR", [1415] = "evmhossfanwRRR", - [1416] = "evmheumianwRRR", [1417] = "evmhesmianwRRR", - [1419] = "evmhesmfanwRRR", [1420] = "evmhoumianwRRR", - [1421] = "evmhosmianwRRR", [1423] = "evmhosmfanwRRR", - [1448] = "evmhegumianRRR", [1449] = "evmhegsmianRRR", - [1451] = "evmhegsmfanRRR", [1452] = "evmhogumianRRR", - [1453] = "evmhogsmianRRR", [1455] = "evmhogsmfanRRR", - [1472] = "evmwlusianwRRR", [1473] = "evmwlssianwRRR", - [1480] = "evmwlumianwRRR", [1481] = "evmwlsmianwRRR", - [1491] = "evmwssfanRRR", [1496] = "evmwumianRRR", - [1497] = "evmwsmianRRR", [1499] = "evmwsmfanRRR", -} - -local map_pri = { - [0] = false, false, "tdiARI", "twiARI", - map_spe, false, false, "mulliRRI", - "subficRRI", false, "cmpl_iYLRU", "cmp_iYLRI", - "addicRRI", "addic.RRI", "addi|liRR0I", "addis|lisRR0I", - "b_KBJ", "sc", "bKJ", map_crops, - "rlwimiRR~AAA.", map_rlwinm, false, "rlwnmRR~RAA.", - "oriNRR~U", "orisRR~U", "xoriRR~U", "xorisRR~U", - "andi.RR~U", "andis.RR~U", map_rld, map_ext, - "lwzRRD", "lwzuRRD", "lbzRRD", "lbzuRRD", - "stwRRD", "stwuRRD", "stbRRD", "stbuRRD", - "lhzRRD", "lhzuRRD", "lhaRRD", "lhauRRD", - "sthRRD", "sthuRRD", "lmwRRD", "stmwRRD", - "lfsFRD", "lfsuFRD", "lfdFRD", "lfduFRD", - "stfsFRD", "stfsuFRD", "stfdFRD", "stfduFRD", - false, false, map_ld, map_fps, - false, false, map_std, map_fpd, -} - ------------------------------------------------------------------------------- - -local map_gpr = { - [0] = "r0", "sp", "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", -} - -local map_cond = { [0] = "lt", "gt", "eq", "so", "ge", "le", "ne", "ns", } - --- Format a condition bit. -local function condfmt(cond) - if cond <= 3 then - return map_cond[band(cond, 3)] - else - return format("4*cr%d+%s", rshift(cond, 2), map_cond[band(cond, 3)]) - end -end - ------------------------------------------------------------------------------- - --- Output a nicely formatted line with an opcode and operands. -local function putop(ctx, text, operands) - local pos = ctx.pos - local extra = "" - if ctx.rel then - local sym = ctx.symtab[ctx.rel] - if sym then extra = "\t->"..sym end - end - if ctx.hexdump > 0 then - ctx.out(format("%08x %s %-7s %s%s\n", - ctx.addr+pos, tohex(ctx.op), text, concat(operands, ", "), extra)) - else - ctx.out(format("%08x %-7s %s%s\n", - ctx.addr+pos, text, concat(operands, ", "), extra)) - end - ctx.pos = pos + 4 -end - --- Fallback for unknown opcodes. -local function unknown(ctx) - return putop(ctx, ".long", { "0x"..tohex(ctx.op) }) -end - --- Disassemble a single instruction. -local function disass_ins(ctx) - local pos = ctx.pos - local b0, b1, b2, b3 = byte(ctx.code, pos+1, pos+4) - local op = bor(lshift(b0, 24), lshift(b1, 16), lshift(b2, 8), b3) - local operands = {} - local last = nil - local rs = 21 - ctx.op = op - ctx.rel = nil - - local opat = map_pri[rshift(b0, 2)] - while type(opat) ~= "string" do - if not opat then return unknown(ctx) end - opat = opat[band(rshift(op, opat.shift), opat.mask)] - end - local name, pat = match(opat, "^([a-z0-9_.]*)(.*)") - local altname, pat2 = match(pat, "|([a-z0-9_.]*)(.*)") - if altname then pat = pat2 end - - for p in gmatch(pat, ".") do - local x = nil - if p == "R" then - x = map_gpr[band(rshift(op, rs), 31)] - rs = rs - 5 - elseif p == "F" then - x = "f"..band(rshift(op, rs), 31) - rs = rs - 5 - elseif p == "A" then - x = band(rshift(op, rs), 31) - rs = rs - 5 - elseif p == "S" then - x = arshift(lshift(op, 27-rs), 27) - rs = rs - 5 - elseif p == "I" then - x = arshift(lshift(op, 16), 16) - elseif p == "U" then - x = band(op, 0xffff) - elseif p == "D" or p == "E" then - local disp = arshift(lshift(op, 16), 16) - if p == "E" then disp = band(disp, -4) end - if last == "r0" then last = "0" end - operands[#operands] = format("%d(%s)", disp, last) - elseif p >= "2" and p <= "8" then - local disp = band(rshift(op, rs), 31) * p - if last == "r0" then last = "0" end - operands[#operands] = format("%d(%s)", disp, last) - elseif p == "H" then - x = band(rshift(op, rs), 31) + lshift(band(op, 2), 4) - rs = rs - 5 - elseif p == "M" then - x = band(rshift(op, rs), 31) + band(op, 0x20) - elseif p == "C" then - x = condfmt(band(rshift(op, rs), 31)) - rs = rs - 5 - elseif p == "B" then - local bo = rshift(op, 21) - local cond = band(rshift(op, 16), 31) - local cn = "" - rs = rs - 10 - if band(bo, 4) == 0 then - cn = band(bo, 2) == 0 and "dnz" or "dz" - if band(bo, 0x10) == 0 then - cn = cn..(band(bo, 8) == 0 and "f" or "t") - end - if band(bo, 0x10) == 0 then x = condfmt(cond) end - name = name..(band(bo, 1) == band(rshift(op, 15), 1) and "-" or "+") - elseif band(bo, 0x10) == 0 then - cn = map_cond[band(cond, 3) + (band(bo, 8) == 0 and 4 or 0)] - if cond > 3 then x = "cr"..rshift(cond, 2) end - name = name..(band(bo, 1) == band(rshift(op, 15), 1) and "-" or "+") - end - name = gsub(name, "_", cn) - elseif p == "J" then - x = arshift(lshift(op, 27-rs), 29-rs)*4 - if band(op, 2) == 0 then x = ctx.addr + pos + x end - ctx.rel = x - x = "0x"..tohex(x) - elseif p == "K" then - if band(op, 1) ~= 0 then name = name.."l" end - if band(op, 2) ~= 0 then name = name.."a" end - elseif p == "X" or p == "Y" then - x = band(rshift(op, rs+2), 7) - if x == 0 and p == "Y" then x = nil else x = "cr"..x end - rs = rs - 5 - elseif p == "W" then - x = "cr"..band(op, 7) - elseif p == "Z" then - x = band(rshift(op, rs-4), 255) - rs = rs - 10 - elseif p == ">" then - operands[#operands] = rshift(operands[#operands], 1) - elseif p == "0" then - if last == "r0" then - operands[#operands] = nil - if altname then name = altname end - end - elseif p == "L" then - name = gsub(name, "_", band(op, 0x00200000) ~= 0 and "d" or "w") - elseif p == "." then - if band(op, 1) == 1 then name = name.."." end - elseif p == "N" then - if op == 0x60000000 then name = "nop"; break end - elseif p == "~" then - local n = #operands - operands[n-1], operands[n] = operands[n], operands[n-1] - elseif p == "=" then - local n = #operands - if last == operands[n-1] then - operands[n] = nil - name = altname - end - elseif p == "%" then - local n = #operands - if last == operands[n-1] and last == operands[n-2] then - operands[n] = nil - operands[n-1] = nil - name = altname - end - elseif p == "-" then - rs = rs - 5 - else - assert(false) - end - if x then operands[#operands+1] = x; last = x end - end - - return putop(ctx, name, operands) -end - ------------------------------------------------------------------------------- - --- Disassemble a block of code. -local function disass_block(ctx, ofs, len) - if not ofs then ofs = 0 end - local stop = len and ofs+len or #ctx.code - stop = stop - stop % 4 - ctx.pos = ofs - ofs % 4 - ctx.rel = nil - while ctx.pos < stop do disass_ins(ctx) end -end - --- Extended API: create a disassembler context. Then call ctx:disass(ofs, len). -local function create_(code, addr, out) - local ctx = {} - ctx.code = code - ctx.addr = addr or 0 - ctx.out = out or io.write - ctx.symtab = {} - ctx.disass = disass_block - ctx.hexdump = 8 - return ctx -end - --- Simple API: disassemble code (a string) at address and output via out. -local function disass_(code, addr, out) - create_(code, addr, out):disass() -end - --- Return register name for RID. -local function regname_(r) - if r < 32 then return map_gpr[r] end - return "f"..(r-32) -end - --- Public module functions. -module(...) - -create = create_ -disass = disass_ -regname = regname_ - diff --git a/subprojects/luajit/src/jit/dis_x64.lua b/subprojects/luajit/src/jit/dis_x64.lua deleted file mode 100644 index 08918035e..000000000 --- a/subprojects/luajit/src/jit/dis_x64.lua +++ /dev/null @@ -1,20 +0,0 @@ ----------------------------------------------------------------------------- --- LuaJIT x64 disassembler wrapper module. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- Released under the MIT license. See Copyright Notice in luajit.h ----------------------------------------------------------------------------- --- This module just exports the 64 bit functions from the combined --- x86/x64 disassembler module. All the interesting stuff is there. ------------------------------------------------------------------------------- - -local require = require - -module(...) - -local dis_x86 = require(_PACKAGE.."dis_x86") - -create = dis_x86.create64 -disass = dis_x86.disass64 -regname = dis_x86.regname64 - diff --git a/subprojects/luajit/src/jit/dis_x86.lua b/subprojects/luajit/src/jit/dis_x86.lua deleted file mode 100644 index 74d0f5292..000000000 --- a/subprojects/luajit/src/jit/dis_x86.lua +++ /dev/null @@ -1,836 +0,0 @@ ----------------------------------------------------------------------------- --- LuaJIT x86/x64 disassembler module. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- Released under the MIT license. See Copyright Notice in luajit.h ----------------------------------------------------------------------------- --- This is a helper module used by the LuaJIT machine code dumper module. --- --- Sending small code snippets to an external disassembler and mixing the --- output with our own stuff was too fragile. So I had to bite the bullet --- and write yet another x86 disassembler. Oh well ... --- --- The output format is very similar to what ndisasm generates. But it has --- been developed independently by looking at the opcode tables from the --- Intel and AMD manuals. The supported instruction set is quite extensive --- and reflects what a current generation Intel or AMD CPU implements in --- 32 bit and 64 bit mode. Yes, this includes MMX, SSE, SSE2, SSE3, SSSE3, --- SSE4.1, SSE4.2, SSE4a and even privileged and hypervisor (VMX/SVM) --- instructions. --- --- Notes: --- * The (useless) a16 prefix, 3DNow and pre-586 opcodes are unsupported. --- * No attempt at optimization has been made -- it's fast enough for my needs. --- * The public API may change when more architectures are added. ------------------------------------------------------------------------------- - -local type = type -local sub, byte, format = string.sub, string.byte, string.format -local match, gmatch, gsub = string.match, string.gmatch, string.gsub -local lower, rep = string.lower, string.rep - --- Map for 1st opcode byte in 32 bit mode. Ugly? Well ... read on. -local map_opc1_32 = { ---0x -[0]="addBmr","addVmr","addBrm","addVrm","addBai","addVai","push es","pop es", -"orBmr","orVmr","orBrm","orVrm","orBai","orVai","push cs","opc2*", ---1x -"adcBmr","adcVmr","adcBrm","adcVrm","adcBai","adcVai","push ss","pop ss", -"sbbBmr","sbbVmr","sbbBrm","sbbVrm","sbbBai","sbbVai","push ds","pop ds", ---2x -"andBmr","andVmr","andBrm","andVrm","andBai","andVai","es:seg","daa", -"subBmr","subVmr","subBrm","subVrm","subBai","subVai","cs:seg","das", ---3x -"xorBmr","xorVmr","xorBrm","xorVrm","xorBai","xorVai","ss:seg","aaa", -"cmpBmr","cmpVmr","cmpBrm","cmpVrm","cmpBai","cmpVai","ds:seg","aas", ---4x -"incVR","incVR","incVR","incVR","incVR","incVR","incVR","incVR", -"decVR","decVR","decVR","decVR","decVR","decVR","decVR","decVR", ---5x -"pushUR","pushUR","pushUR","pushUR","pushUR","pushUR","pushUR","pushUR", -"popUR","popUR","popUR","popUR","popUR","popUR","popUR","popUR", ---6x -"sz*pushaw,pusha","sz*popaw,popa","boundVrm","arplWmr", -"fs:seg","gs:seg","o16:","a16", -"pushUi","imulVrmi","pushBs","imulVrms", -"insb","insVS","outsb","outsVS", ---7x -"joBj","jnoBj","jbBj","jnbBj","jzBj","jnzBj","jbeBj","jaBj", -"jsBj","jnsBj","jpeBj","jpoBj","jlBj","jgeBj","jleBj","jgBj", ---8x -"arith!Bmi","arith!Vmi","arith!Bmi","arith!Vms", -"testBmr","testVmr","xchgBrm","xchgVrm", -"movBmr","movVmr","movBrm","movVrm", -"movVmg","leaVrm","movWgm","popUm", ---9x -"nop*xchgVaR|pause|xchgWaR|repne nop","xchgVaR","xchgVaR","xchgVaR", -"xchgVaR","xchgVaR","xchgVaR","xchgVaR", -"sz*cbw,cwde,cdqe","sz*cwd,cdq,cqo","call farViw","wait", -"sz*pushfw,pushf","sz*popfw,popf","sahf","lahf", ---Ax -"movBao","movVao","movBoa","movVoa", -"movsb","movsVS","cmpsb","cmpsVS", -"testBai","testVai","stosb","stosVS", -"lodsb","lodsVS","scasb","scasVS", ---Bx -"movBRi","movBRi","movBRi","movBRi","movBRi","movBRi","movBRi","movBRi", -"movVRI","movVRI","movVRI","movVRI","movVRI","movVRI","movVRI","movVRI", ---Cx -"shift!Bmu","shift!Vmu","retBw","ret","$lesVrm","$ldsVrm","movBmi","movVmi", -"enterBwu","leave","retfBw","retf","int3","intBu","into","iretVS", ---Dx -"shift!Bm1","shift!Vm1","shift!Bmc","shift!Vmc","aamBu","aadBu","salc","xlatb", -"fp*0","fp*1","fp*2","fp*3","fp*4","fp*5","fp*6","fp*7", ---Ex -"loopneBj","loopeBj","loopBj","sz*jcxzBj,jecxzBj,jrcxzBj", -"inBau","inVau","outBua","outVua", -"callVj","jmpVj","jmp farViw","jmpBj","inBad","inVad","outBda","outVda", ---Fx -"lock:","int1","repne:rep","rep:","hlt","cmc","testb!Bm","testv!Vm", -"clc","stc","cli","sti","cld","std","incb!Bm","incd!Vm", -} -assert(#map_opc1_32 == 255) - --- Map for 1st opcode byte in 64 bit mode (overrides only). -local map_opc1_64 = setmetatable({ - [0x06]=false, [0x07]=false, [0x0e]=false, - [0x16]=false, [0x17]=false, [0x1e]=false, [0x1f]=false, - [0x27]=false, [0x2f]=false, [0x37]=false, [0x3f]=false, - [0x60]=false, [0x61]=false, [0x62]=false, [0x63]="movsxdVrDmt", [0x67]="a32:", - [0x40]="rex*", [0x41]="rex*b", [0x42]="rex*x", [0x43]="rex*xb", - [0x44]="rex*r", [0x45]="rex*rb", [0x46]="rex*rx", [0x47]="rex*rxb", - [0x48]="rex*w", [0x49]="rex*wb", [0x4a]="rex*wx", [0x4b]="rex*wxb", - [0x4c]="rex*wr", [0x4d]="rex*wrb", [0x4e]="rex*wrx", [0x4f]="rex*wrxb", - [0x82]=false, [0x9a]=false, [0xc4]=false, [0xc5]=false, [0xce]=false, - [0xd4]=false, [0xd5]=false, [0xd6]=false, [0xea]=false, -}, { __index = map_opc1_32 }) - --- Map for 2nd opcode byte (0F xx). True CISC hell. Hey, I told you. --- Prefix dependent MMX/SSE opcodes: (none)|rep|o16|repne, -|F3|66|F2 -local map_opc2 = { ---0x -[0]="sldt!Dmp","sgdt!Ump","larVrm","lslVrm",nil,"syscall","clts","sysret", -"invd","wbinvd",nil,"ud1",nil,"$prefetch!Bm","femms","3dnowMrmu", ---1x -"movupsXrm|movssXrm|movupdXrm|movsdXrm", -"movupsXmr|movssXmr|movupdXmr|movsdXmr", -"movhlpsXrm$movlpsXrm|movsldupXrm|movlpdXrm|movddupXrm", -"movlpsXmr||movlpdXmr", -"unpcklpsXrm||unpcklpdXrm", -"unpckhpsXrm||unpckhpdXrm", -"movlhpsXrm$movhpsXrm|movshdupXrm|movhpdXrm", -"movhpsXmr||movhpdXmr", -"$prefetcht!Bm","hintnopVm","hintnopVm","hintnopVm", -"hintnopVm","hintnopVm","hintnopVm","hintnopVm", ---2x -"movUmx$","movUmy$","movUxm$","movUym$","movUmz$",nil,"movUzm$",nil, -"movapsXrm||movapdXrm", -"movapsXmr||movapdXmr", -"cvtpi2psXrMm|cvtsi2ssXrVmt|cvtpi2pdXrMm|cvtsi2sdXrVmt", -"movntpsXmr|movntssXmr|movntpdXmr|movntsdXmr", -"cvttps2piMrXm|cvttss2siVrXm|cvttpd2piMrXm|cvttsd2siVrXm", -"cvtps2piMrXm|cvtss2siVrXm|cvtpd2piMrXm|cvtsd2siVrXm", -"ucomissXrm||ucomisdXrm", -"comissXrm||comisdXrm", ---3x -"wrmsr","rdtsc","rdmsr","rdpmc","sysenter","sysexit",nil,"getsec", -"opc3*38",nil,"opc3*3a",nil,nil,nil,nil,nil, ---4x -"cmovoVrm","cmovnoVrm","cmovbVrm","cmovnbVrm", -"cmovzVrm","cmovnzVrm","cmovbeVrm","cmovaVrm", -"cmovsVrm","cmovnsVrm","cmovpeVrm","cmovpoVrm", -"cmovlVrm","cmovgeVrm","cmovleVrm","cmovgVrm", ---5x -"movmskpsVrXm$||movmskpdVrXm$","sqrtpsXrm|sqrtssXrm|sqrtpdXrm|sqrtsdXrm", -"rsqrtpsXrm|rsqrtssXrm","rcppsXrm|rcpssXrm", -"andpsXrm||andpdXrm","andnpsXrm||andnpdXrm", -"orpsXrm||orpdXrm","xorpsXrm||xorpdXrm", -"addpsXrm|addssXrm|addpdXrm|addsdXrm","mulpsXrm|mulssXrm|mulpdXrm|mulsdXrm", -"cvtps2pdXrm|cvtss2sdXrm|cvtpd2psXrm|cvtsd2ssXrm", -"cvtdq2psXrm|cvttps2dqXrm|cvtps2dqXrm", -"subpsXrm|subssXrm|subpdXrm|subsdXrm","minpsXrm|minssXrm|minpdXrm|minsdXrm", -"divpsXrm|divssXrm|divpdXrm|divsdXrm","maxpsXrm|maxssXrm|maxpdXrm|maxsdXrm", ---6x -"punpcklbwPrm","punpcklwdPrm","punpckldqPrm","packsswbPrm", -"pcmpgtbPrm","pcmpgtwPrm","pcmpgtdPrm","packuswbPrm", -"punpckhbwPrm","punpckhwdPrm","punpckhdqPrm","packssdwPrm", -"||punpcklqdqXrm","||punpckhqdqXrm", -"movPrVSm","movqMrm|movdquXrm|movdqaXrm", ---7x -"pshufwMrmu|pshufhwXrmu|pshufdXrmu|pshuflwXrmu","pshiftw!Pmu", -"pshiftd!Pmu","pshiftq!Mmu||pshiftdq!Xmu", -"pcmpeqbPrm","pcmpeqwPrm","pcmpeqdPrm","emms|", -"vmreadUmr||extrqXmuu$|insertqXrmuu$","vmwriteUrm||extrqXrm$|insertqXrm$", -nil,nil, -"||haddpdXrm|haddpsXrm","||hsubpdXrm|hsubpsXrm", -"movVSmMr|movqXrm|movVSmXr","movqMmr|movdquXmr|movdqaXmr", ---8x -"joVj","jnoVj","jbVj","jnbVj","jzVj","jnzVj","jbeVj","jaVj", -"jsVj","jnsVj","jpeVj","jpoVj","jlVj","jgeVj","jleVj","jgVj", ---9x -"setoBm","setnoBm","setbBm","setnbBm","setzBm","setnzBm","setbeBm","setaBm", -"setsBm","setnsBm","setpeBm","setpoBm","setlBm","setgeBm","setleBm","setgBm", ---Ax -"push fs","pop fs","cpuid","btVmr","shldVmru","shldVmrc",nil,nil, -"push gs","pop gs","rsm","btsVmr","shrdVmru","shrdVmrc","fxsave!Dmp","imulVrm", ---Bx -"cmpxchgBmr","cmpxchgVmr","$lssVrm","btrVmr", -"$lfsVrm","$lgsVrm","movzxVrBmt","movzxVrWmt", -"|popcntVrm","ud2Dp","bt!Vmu","btcVmr", -"bsfVrm","bsrVrm|lzcntVrm|bsrWrm","movsxVrBmt","movsxVrWmt", ---Cx -"xaddBmr","xaddVmr", -"cmppsXrmu|cmpssXrmu|cmppdXrmu|cmpsdXrmu","$movntiVmr|", -"pinsrwPrWmu","pextrwDrPmu", -"shufpsXrmu||shufpdXrmu","$cmpxchg!Qmp", -"bswapVR","bswapVR","bswapVR","bswapVR","bswapVR","bswapVR","bswapVR","bswapVR", ---Dx -"||addsubpdXrm|addsubpsXrm","psrlwPrm","psrldPrm","psrlqPrm", -"paddqPrm","pmullwPrm", -"|movq2dqXrMm|movqXmr|movdq2qMrXm$","pmovmskbVrMm||pmovmskbVrXm", -"psubusbPrm","psubuswPrm","pminubPrm","pandPrm", -"paddusbPrm","padduswPrm","pmaxubPrm","pandnPrm", ---Ex -"pavgbPrm","psrawPrm","psradPrm","pavgwPrm", -"pmulhuwPrm","pmulhwPrm", -"|cvtdq2pdXrm|cvttpd2dqXrm|cvtpd2dqXrm","$movntqMmr||$movntdqXmr", -"psubsbPrm","psubswPrm","pminswPrm","porPrm", -"paddsbPrm","paddswPrm","pmaxswPrm","pxorPrm", ---Fx -"|||lddquXrm","psllwPrm","pslldPrm","psllqPrm", -"pmuludqPrm","pmaddwdPrm","psadbwPrm","maskmovqMrm||maskmovdquXrm$", -"psubbPrm","psubwPrm","psubdPrm","psubqPrm", -"paddbPrm","paddwPrm","padddPrm","ud", -} -assert(map_opc2[255] == "ud") - --- Map for three-byte opcodes. Can't wait for their next invention. -local map_opc3 = { -["38"] = { -- [66] 0f 38 xx ---0x -[0]="pshufbPrm","phaddwPrm","phadddPrm","phaddswPrm", -"pmaddubswPrm","phsubwPrm","phsubdPrm","phsubswPrm", -"psignbPrm","psignwPrm","psigndPrm","pmulhrswPrm", -nil,nil,nil,nil, ---1x -"||pblendvbXrma",nil,nil,nil, -"||blendvpsXrma","||blendvpdXrma",nil,"||ptestXrm", -nil,nil,nil,nil, -"pabsbPrm","pabswPrm","pabsdPrm",nil, ---2x -"||pmovsxbwXrm","||pmovsxbdXrm","||pmovsxbqXrm","||pmovsxwdXrm", -"||pmovsxwqXrm","||pmovsxdqXrm",nil,nil, -"||pmuldqXrm","||pcmpeqqXrm","||$movntdqaXrm","||packusdwXrm", -nil,nil,nil,nil, ---3x -"||pmovzxbwXrm","||pmovzxbdXrm","||pmovzxbqXrm","||pmovzxwdXrm", -"||pmovzxwqXrm","||pmovzxdqXrm",nil,"||pcmpgtqXrm", -"||pminsbXrm","||pminsdXrm","||pminuwXrm","||pminudXrm", -"||pmaxsbXrm","||pmaxsdXrm","||pmaxuwXrm","||pmaxudXrm", ---4x -"||pmulddXrm","||phminposuwXrm", ---Fx -[0xf0] = "|||crc32TrBmt",[0xf1] = "|||crc32TrVmt", -}, - -["3a"] = { -- [66] 0f 3a xx ---0x -[0x00]=nil,nil,nil,nil,nil,nil,nil,nil, -"||roundpsXrmu","||roundpdXrmu","||roundssXrmu","||roundsdXrmu", -"||blendpsXrmu","||blendpdXrmu","||pblendwXrmu","palignrPrmu", ---1x -nil,nil,nil,nil, -"||pextrbVmXru","||pextrwVmXru","||pextrVmSXru","||extractpsVmXru", -nil,nil,nil,nil,nil,nil,nil,nil, ---2x -"||pinsrbXrVmu","||insertpsXrmu","||pinsrXrVmuS",nil, ---4x -[0x40] = "||dppsXrmu", -[0x41] = "||dppdXrmu", -[0x42] = "||mpsadbwXrmu", ---6x -[0x60] = "||pcmpestrmXrmu",[0x61] = "||pcmpestriXrmu", -[0x62] = "||pcmpistrmXrmu",[0x63] = "||pcmpistriXrmu", -}, -} - --- Map for VMX/SVM opcodes 0F 01 C0-FF (sgdt group with register operands). -local map_opcvm = { -[0xc1]="vmcall",[0xc2]="vmlaunch",[0xc3]="vmresume",[0xc4]="vmxoff", -[0xc8]="monitor",[0xc9]="mwait", -[0xd8]="vmrun",[0xd9]="vmmcall",[0xda]="vmload",[0xdb]="vmsave", -[0xdc]="stgi",[0xdd]="clgi",[0xde]="skinit",[0xdf]="invlpga", -[0xf8]="swapgs",[0xf9]="rdtscp", -} - --- Map for FP opcodes. And you thought stack machines are simple? -local map_opcfp = { --- D8-DF 00-BF: opcodes with a memory operand. --- D8 -[0]="faddFm","fmulFm","fcomFm","fcompFm","fsubFm","fsubrFm","fdivFm","fdivrFm", -"fldFm",nil,"fstFm","fstpFm","fldenvVm","fldcwWm","fnstenvVm","fnstcwWm", --- DA -"fiaddDm","fimulDm","ficomDm","ficompDm", -"fisubDm","fisubrDm","fidivDm","fidivrDm", --- DB -"fildDm","fisttpDm","fistDm","fistpDm",nil,"fld twordFmp",nil,"fstp twordFmp", --- DC -"faddGm","fmulGm","fcomGm","fcompGm","fsubGm","fsubrGm","fdivGm","fdivrGm", --- DD -"fldGm","fisttpQm","fstGm","fstpGm","frstorDmp",nil,"fnsaveDmp","fnstswWm", --- DE -"fiaddWm","fimulWm","ficomWm","ficompWm", -"fisubWm","fisubrWm","fidivWm","fidivrWm", --- DF -"fildWm","fisttpWm","fistWm","fistpWm", -"fbld twordFmp","fildQm","fbstp twordFmp","fistpQm", --- xx C0-FF: opcodes with a pseudo-register operand. --- D8 -"faddFf","fmulFf","fcomFf","fcompFf","fsubFf","fsubrFf","fdivFf","fdivrFf", --- D9 -"fldFf","fxchFf",{"fnop"},nil, -{"fchs","fabs",nil,nil,"ftst","fxam"}, -{"fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz"}, -{"f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp"}, -{"fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos"}, --- DA -"fcmovbFf","fcmoveFf","fcmovbeFf","fcmovuFf",nil,{nil,"fucompp"},nil,nil, --- DB -"fcmovnbFf","fcmovneFf","fcmovnbeFf","fcmovnuFf", -{nil,nil,"fnclex","fninit"},"fucomiFf","fcomiFf",nil, --- DC -"fadd toFf","fmul toFf",nil,nil, -"fsub toFf","fsubr toFf","fdivr toFf","fdiv toFf", --- DD -"ffreeFf",nil,"fstFf","fstpFf","fucomFf","fucompFf",nil,nil, --- DE -"faddpFf","fmulpFf",nil,{nil,"fcompp"}, -"fsubrpFf","fsubpFf","fdivrpFf","fdivpFf", --- DF -nil,nil,nil,nil,{"fnstsw ax"},"fucomipFf","fcomipFf",nil, -} -assert(map_opcfp[126] == "fcomipFf") - --- Map for opcode groups. The subkey is sp from the ModRM byte. -local map_opcgroup = { - arith = { "add", "or", "adc", "sbb", "and", "sub", "xor", "cmp" }, - shift = { "rol", "ror", "rcl", "rcr", "shl", "shr", "sal", "sar" }, - testb = { "testBmi", "testBmi", "not", "neg", "mul", "imul", "div", "idiv" }, - testv = { "testVmi", "testVmi", "not", "neg", "mul", "imul", "div", "idiv" }, - incb = { "inc", "dec" }, - incd = { "inc", "dec", "callUmp", "$call farDmp", - "jmpUmp", "$jmp farDmp", "pushUm" }, - sldt = { "sldt", "str", "lldt", "ltr", "verr", "verw" }, - sgdt = { "vm*$sgdt", "vm*$sidt", "$lgdt", "vm*$lidt", - "smsw", nil, "lmsw", "vm*$invlpg" }, - bt = { nil, nil, nil, nil, "bt", "bts", "btr", "btc" }, - cmpxchg = { nil, "sz*,cmpxchg8bQmp,cmpxchg16bXmp", nil, nil, - nil, nil, "vmptrld|vmxon|vmclear", "vmptrst" }, - pshiftw = { nil, nil, "psrlw", nil, "psraw", nil, "psllw" }, - pshiftd = { nil, nil, "psrld", nil, "psrad", nil, "pslld" }, - pshiftq = { nil, nil, "psrlq", nil, nil, nil, "psllq" }, - pshiftdq = { nil, nil, "psrlq", "psrldq", nil, nil, "psllq", "pslldq" }, - fxsave = { "$fxsave", "$fxrstor", "$ldmxcsr", "$stmxcsr", - nil, "lfenceDp$", "mfenceDp$", "sfenceDp$clflush" }, - prefetch = { "prefetch", "prefetchw" }, - prefetcht = { "prefetchnta", "prefetcht0", "prefetcht1", "prefetcht2" }, -} - ------------------------------------------------------------------------------- - --- Maps for register names. -local map_regs = { - B = { "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh", - "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b" }, - B64 = { "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil", - "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b" }, - W = { "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", - "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" }, - D = { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", - "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" }, - Q = { "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", - "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" }, - M = { "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", - "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7" }, -- No x64 ext! - X = { "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", - "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15" }, -} -local map_segregs = { "es", "cs", "ss", "ds", "fs", "gs", "segr6", "segr7" } - --- Maps for size names. -local map_sz2n = { - B = 1, W = 2, D = 4, Q = 8, M = 8, X = 16, -} -local map_sz2prefix = { - B = "byte", W = "word", D = "dword", - Q = "qword", - M = "qword", X = "xword", - F = "dword", G = "qword", -- No need for sizes/register names for these two. -} - ------------------------------------------------------------------------------- - --- Output a nicely formatted line with an opcode and operands. -local function putop(ctx, text, operands) - local code, pos, hex = ctx.code, ctx.pos, "" - local hmax = ctx.hexdump - if hmax > 0 then - for i=ctx.start,pos-1 do - hex = hex..format("%02X", byte(code, i, i)) - end - if #hex > hmax then hex = sub(hex, 1, hmax)..". " - else hex = hex..rep(" ", hmax-#hex+2) end - end - if operands then text = text.." "..operands end - if ctx.o16 then text = "o16 "..text; ctx.o16 = false end - if ctx.a32 then text = "a32 "..text; ctx.a32 = false end - if ctx.rep then text = ctx.rep.." "..text; ctx.rep = false end - if ctx.rex then - local t = (ctx.rexw and "w" or "")..(ctx.rexr and "r" or "").. - (ctx.rexx and "x" or "")..(ctx.rexb and "b" or "") - if t ~= "" then text = "rex."..t.." "..text end - ctx.rexw = false; ctx.rexr = false; ctx.rexx = false; ctx.rexb = false - ctx.rex = false - end - if ctx.seg then - local text2, n = gsub(text, "%[", "["..ctx.seg..":") - if n == 0 then text = ctx.seg.." "..text else text = text2 end - ctx.seg = false - end - if ctx.lock then text = "lock "..text; ctx.lock = false end - local imm = ctx.imm - if imm then - local sym = ctx.symtab[imm] - if sym then text = text.."\t->"..sym end - end - ctx.out(format("%08x %s%s\n", ctx.addr+ctx.start, hex, text)) - ctx.mrm = false - ctx.start = pos - ctx.imm = nil -end - --- Clear all prefix flags. -local function clearprefixes(ctx) - ctx.o16 = false; ctx.seg = false; ctx.lock = false; ctx.rep = false - ctx.rexw = false; ctx.rexr = false; ctx.rexx = false; ctx.rexb = false - ctx.rex = false; ctx.a32 = false -end - --- Fallback for incomplete opcodes at the end. -local function incomplete(ctx) - ctx.pos = ctx.stop+1 - clearprefixes(ctx) - return putop(ctx, "(incomplete)") -end - --- Fallback for unknown opcodes. -local function unknown(ctx) - clearprefixes(ctx) - return putop(ctx, "(unknown)") -end - --- Return an immediate of the specified size. -local function getimm(ctx, pos, n) - if pos+n-1 > ctx.stop then return incomplete(ctx) end - local code = ctx.code - if n == 1 then - local b1 = byte(code, pos, pos) - return b1 - elseif n == 2 then - local b1, b2 = byte(code, pos, pos+1) - return b1+b2*256 - else - local b1, b2, b3, b4 = byte(code, pos, pos+3) - local imm = b1+b2*256+b3*65536+b4*16777216 - ctx.imm = imm - return imm - end -end - --- Process pattern string and generate the operands. -local function putpat(ctx, name, pat) - local operands, regs, sz, mode, sp, rm, sc, rx, sdisp - local code, pos, stop = ctx.code, ctx.pos, ctx.stop - - -- Chars used: 1DFGIMPQRSTUVWXacdfgijmoprstuwxyz - for p in gmatch(pat, ".") do - local x = nil - if p == "V" or p == "U" then - if ctx.rexw then sz = "Q"; ctx.rexw = false - elseif ctx.o16 then sz = "W"; ctx.o16 = false - elseif p == "U" and ctx.x64 then sz = "Q" - else sz = "D" end - regs = map_regs[sz] - elseif p == "T" then - if ctx.rexw then sz = "Q"; ctx.rexw = false else sz = "D" end - regs = map_regs[sz] - elseif p == "B" then - sz = "B" - regs = ctx.rex and map_regs.B64 or map_regs.B - elseif match(p, "[WDQMXFG]") then - sz = p - regs = map_regs[sz] - elseif p == "P" then - sz = ctx.o16 and "X" or "M"; ctx.o16 = false - regs = map_regs[sz] - elseif p == "S" then - name = name..lower(sz) - elseif p == "s" then - local imm = getimm(ctx, pos, 1); if not imm then return end - x = imm <= 127 and format("+0x%02x", imm) - or format("-0x%02x", 256-imm) - pos = pos+1 - elseif p == "u" then - local imm = getimm(ctx, pos, 1); if not imm then return end - x = format("0x%02x", imm) - pos = pos+1 - elseif p == "w" then - local imm = getimm(ctx, pos, 2); if not imm then return end - x = format("0x%x", imm) - pos = pos+2 - elseif p == "o" then -- [offset] - if ctx.x64 then - local imm1 = getimm(ctx, pos, 4); if not imm1 then return end - local imm2 = getimm(ctx, pos+4, 4); if not imm2 then return end - x = format("[0x%08x%08x]", imm2, imm1) - pos = pos+8 - else - local imm = getimm(ctx, pos, 4); if not imm then return end - x = format("[0x%08x]", imm) - pos = pos+4 - end - elseif p == "i" or p == "I" then - local n = map_sz2n[sz] - if n == 8 and ctx.x64 and p == "I" then - local imm1 = getimm(ctx, pos, 4); if not imm1 then return end - local imm2 = getimm(ctx, pos+4, 4); if not imm2 then return end - x = format("0x%08x%08x", imm2, imm1) - else - if n == 8 then n = 4 end - local imm = getimm(ctx, pos, n); if not imm then return end - if sz == "Q" and (imm < 0 or imm > 0x7fffffff) then - imm = (0xffffffff+1)-imm - x = format(imm > 65535 and "-0x%08x" or "-0x%x", imm) - else - x = format(imm > 65535 and "0x%08x" or "0x%x", imm) - end - end - pos = pos+n - elseif p == "j" then - local n = map_sz2n[sz] - if n == 8 then n = 4 end - local imm = getimm(ctx, pos, n); if not imm then return end - if sz == "B" and imm > 127 then imm = imm-256 - elseif imm > 2147483647 then imm = imm-4294967296 end - pos = pos+n - imm = imm + pos + ctx.addr - if imm > 4294967295 and not ctx.x64 then imm = imm-4294967296 end - ctx.imm = imm - if sz == "W" then - x = format("word 0x%04x", imm%65536) - elseif ctx.x64 then - local lo = imm % 0x1000000 - x = format("0x%02x%06x", (imm-lo) / 0x1000000, lo) - else - x = format("0x%08x", imm) - end - elseif p == "R" then - local r = byte(code, pos-1, pos-1)%8 - if ctx.rexb then r = r + 8; ctx.rexb = false end - x = regs[r+1] - elseif p == "a" then x = regs[1] - elseif p == "c" then x = "cl" - elseif p == "d" then x = "dx" - elseif p == "1" then x = "1" - else - if not mode then - mode = ctx.mrm - if not mode then - if pos > stop then return incomplete(ctx) end - mode = byte(code, pos, pos) - pos = pos+1 - end - rm = mode%8; mode = (mode-rm)/8 - sp = mode%8; mode = (mode-sp)/8 - sdisp = "" - if mode < 3 then - if rm == 4 then - if pos > stop then return incomplete(ctx) end - sc = byte(code, pos, pos) - pos = pos+1 - rm = sc%8; sc = (sc-rm)/8 - rx = sc%8; sc = (sc-rx)/8 - if ctx.rexx then rx = rx + 8; ctx.rexx = false end - if rx == 4 then rx = nil end - end - if mode > 0 or rm == 5 then - local dsz = mode - if dsz ~= 1 then dsz = 4 end - local disp = getimm(ctx, pos, dsz); if not disp then return end - if mode == 0 then rm = nil end - if rm or rx or (not sc and ctx.x64 and not ctx.a32) then - if dsz == 1 and disp > 127 then - sdisp = format("-0x%x", 256-disp) - elseif disp >= 0 and disp <= 0x7fffffff then - sdisp = format("+0x%x", disp) - else - sdisp = format("-0x%x", (0xffffffff+1)-disp) - end - else - sdisp = format(ctx.x64 and not ctx.a32 and - not (disp >= 0 and disp <= 0x7fffffff) - and "0xffffffff%08x" or "0x%08x", disp) - end - pos = pos+dsz - end - end - if rm and ctx.rexb then rm = rm + 8; ctx.rexb = false end - if ctx.rexr then sp = sp + 8; ctx.rexr = false end - end - if p == "m" then - if mode == 3 then x = regs[rm+1] - else - local aregs = ctx.a32 and map_regs.D or ctx.aregs - local srm, srx = "", "" - if rm then srm = aregs[rm+1] - elseif not sc and ctx.x64 and not ctx.a32 then srm = "rip" end - ctx.a32 = false - if rx then - if rm then srm = srm.."+" end - srx = aregs[rx+1] - if sc > 0 then srx = srx.."*"..(2^sc) end - end - x = format("[%s%s%s]", srm, srx, sdisp) - end - if mode < 3 and - (not match(pat, "[aRrgp]") or match(pat, "t")) then -- Yuck. - x = map_sz2prefix[sz].." "..x - end - elseif p == "r" then x = regs[sp+1] - elseif p == "g" then x = map_segregs[sp+1] - elseif p == "p" then -- Suppress prefix. - elseif p == "f" then x = "st"..rm - elseif p == "x" then - if sp == 0 and ctx.lock and not ctx.x64 then - x = "CR8"; ctx.lock = false - else - x = "CR"..sp - end - elseif p == "y" then x = "DR"..sp - elseif p == "z" then x = "TR"..sp - elseif p == "t" then - else - error("bad pattern `"..pat.."'") - end - end - if x then operands = operands and operands..", "..x or x end - end - ctx.pos = pos - return putop(ctx, name, operands) -end - --- Forward declaration. -local map_act - --- Fetch and cache MRM byte. -local function getmrm(ctx) - local mrm = ctx.mrm - if not mrm then - local pos = ctx.pos - if pos > ctx.stop then return nil end - mrm = byte(ctx.code, pos, pos) - ctx.pos = pos+1 - ctx.mrm = mrm - end - return mrm -end - --- Dispatch to handler depending on pattern. -local function dispatch(ctx, opat, patgrp) - if not opat then return unknown(ctx) end - if match(opat, "%|") then -- MMX/SSE variants depending on prefix. - local p - if ctx.rep then - p = ctx.rep=="rep" and "%|([^%|]*)" or "%|[^%|]*%|[^%|]*%|([^%|]*)" - ctx.rep = false - elseif ctx.o16 then p = "%|[^%|]*%|([^%|]*)"; ctx.o16 = false - else p = "^[^%|]*" end - opat = match(opat, p) - if not opat then return unknown(ctx) end --- ctx.rep = false; ctx.o16 = false - --XXX fails for 66 f2 0f 38 f1 06 crc32 eax,WORD PTR [esi] - --XXX remove in branches? - end - if match(opat, "%$") then -- reg$mem variants. - local mrm = getmrm(ctx); if not mrm then return incomplete(ctx) end - opat = match(opat, mrm >= 192 and "^[^%$]*" or "%$(.*)") - if opat == "" then return unknown(ctx) end - end - if opat == "" then return unknown(ctx) end - local name, pat = match(opat, "^([a-z0-9 ]*)(.*)") - if pat == "" and patgrp then pat = patgrp end - return map_act[sub(pat, 1, 1)](ctx, name, pat) -end - --- Get a pattern from an opcode map and dispatch to handler. -local function dispatchmap(ctx, opcmap) - local pos = ctx.pos - local opat = opcmap[byte(ctx.code, pos, pos)] - pos = pos + 1 - ctx.pos = pos - return dispatch(ctx, opat) -end - --- Map for action codes. The key is the first char after the name. -map_act = { - -- Simple opcodes without operands. - [""] = function(ctx, name, pat) - return putop(ctx, name) - end, - - -- Operand size chars fall right through. - B = putpat, W = putpat, D = putpat, Q = putpat, - V = putpat, U = putpat, T = putpat, - M = putpat, X = putpat, P = putpat, - F = putpat, G = putpat, - - -- Collect prefixes. - [":"] = function(ctx, name, pat) - ctx[pat == ":" and name or sub(pat, 2)] = name - if ctx.pos - ctx.start > 5 then return unknown(ctx) end -- Limit #prefixes. - end, - - -- Chain to special handler specified by name. - ["*"] = function(ctx, name, pat) - return map_act[name](ctx, name, sub(pat, 2)) - end, - - -- Use named subtable for opcode group. - ["!"] = function(ctx, name, pat) - local mrm = getmrm(ctx); if not mrm then return incomplete(ctx) end - return dispatch(ctx, map_opcgroup[name][((mrm-(mrm%8))/8)%8+1], sub(pat, 2)) - end, - - -- o16,o32[,o64] variants. - sz = function(ctx, name, pat) - if ctx.o16 then ctx.o16 = false - else - pat = match(pat, ",(.*)") - if ctx.rexw then - local p = match(pat, ",(.*)") - if p then pat = p; ctx.rexw = false end - end - end - pat = match(pat, "^[^,]*") - return dispatch(ctx, pat) - end, - - -- Two-byte opcode dispatch. - opc2 = function(ctx, name, pat) - return dispatchmap(ctx, map_opc2) - end, - - -- Three-byte opcode dispatch. - opc3 = function(ctx, name, pat) - return dispatchmap(ctx, map_opc3[pat]) - end, - - -- VMX/SVM dispatch. - vm = function(ctx, name, pat) - return dispatch(ctx, map_opcvm[ctx.mrm]) - end, - - -- Floating point opcode dispatch. - fp = function(ctx, name, pat) - local mrm = getmrm(ctx); if not mrm then return incomplete(ctx) end - local rm = mrm%8 - local idx = pat*8 + ((mrm-rm)/8)%8 - if mrm >= 192 then idx = idx + 64 end - local opat = map_opcfp[idx] - if type(opat) == "table" then opat = opat[rm+1] end - return dispatch(ctx, opat) - end, - - -- REX prefix. - rex = function(ctx, name, pat) - if ctx.rex then return unknown(ctx) end -- Only 1 REX prefix allowed. - for p in gmatch(pat, ".") do ctx["rex"..p] = true end - ctx.rex = true - end, - - -- Special case for nop with REX prefix. - nop = function(ctx, name, pat) - return dispatch(ctx, ctx.rex and pat or "nop") - end, -} - ------------------------------------------------------------------------------- - --- Disassemble a block of code. -local function disass_block(ctx, ofs, len) - if not ofs then ofs = 0 end - local stop = len and ofs+len or #ctx.code - ofs = ofs + 1 - ctx.start = ofs - ctx.pos = ofs - ctx.stop = stop - ctx.imm = nil - ctx.mrm = false - clearprefixes(ctx) - while ctx.pos <= stop do dispatchmap(ctx, ctx.map1) end - if ctx.pos ~= ctx.start then incomplete(ctx) end -end - --- Extended API: create a disassembler context. Then call ctx:disass(ofs, len). -local function create_(code, addr, out) - local ctx = {} - ctx.code = code - ctx.addr = (addr or 0) - 1 - ctx.out = out or io.write - ctx.symtab = {} - ctx.disass = disass_block - ctx.hexdump = 16 - ctx.x64 = false - ctx.map1 = map_opc1_32 - ctx.aregs = map_regs.D - return ctx -end - -local function create64_(code, addr, out) - local ctx = create_(code, addr, out) - ctx.x64 = true - ctx.map1 = map_opc1_64 - ctx.aregs = map_regs.Q - return ctx -end - --- Simple API: disassemble code (a string) at address and output via out. -local function disass_(code, addr, out) - create_(code, addr, out):disass() -end - -local function disass64_(code, addr, out) - create64_(code, addr, out):disass() -end - --- Return register name for RID. -local function regname_(r) - if r < 8 then return map_regs.D[r+1] end - return map_regs.X[r-7] -end - -local function regname64_(r) - if r < 16 then return map_regs.Q[r+1] end - return map_regs.X[r-15] -end - --- Public module functions. -module(...) - -create = create_ -create64 = create64_ -disass = disass_ -disass64 = disass64_ -regname = regname_ -regname64 = regname64_ - diff --git a/subprojects/luajit/src/jit/dump.lua b/subprojects/luajit/src/jit/dump.lua deleted file mode 100644 index 666ba438f..000000000 --- a/subprojects/luajit/src/jit/dump.lua +++ /dev/null @@ -1,701 +0,0 @@ ----------------------------------------------------------------------------- --- LuaJIT compiler dump module. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- Released under the MIT license. See Copyright Notice in luajit.h ----------------------------------------------------------------------------- --- --- This module can be used to debug the JIT compiler itself. It dumps the --- code representations and structures used in various compiler stages. --- --- Example usage: --- --- luajit -jdump -e "local x=0; for i=1,1e6 do x=x+i end; print(x)" --- luajit -jdump=im -e "for i=1,1000 do for j=1,1000 do end end" | less -R --- luajit -jdump=is myapp.lua | less -R --- luajit -jdump=-b myapp.lua --- luajit -jdump=+aH,myapp.html myapp.lua --- luajit -jdump=ixT,myapp.dump myapp.lua --- --- The first argument specifies the dump mode. The second argument gives --- the output file name. Default output is to stdout, unless the environment --- variable LUAJIT_DUMPFILE is set. The file is overwritten every time the --- module is started. --- --- Different features can be turned on or off with the dump mode. If the --- mode starts with a '+', the following features are added to the default --- set of features; a '-' removes them. Otherwise the features are replaced. --- --- The following dump features are available (* marks the default): --- --- * t Print a line for each started, ended or aborted trace (see also -jv). --- * b Dump the traced bytecode. --- * i Dump the IR (intermediate representation). --- r Augment the IR with register/stack slots. --- s Dump the snapshot map. --- * m Dump the generated machine code. --- x Print each taken trace exit. --- X Print each taken trace exit and the contents of all registers. --- a Print the IR of aborted traces, too. --- --- The output format can be set with the following characters: --- --- T Plain text output. --- A ANSI-colored text output --- H Colorized HTML + CSS output. --- --- The default output format is plain text. It's set to ANSI-colored text --- if the COLORTERM variable is set. Note: this is independent of any output --- redirection, which is actually considered a feature. --- --- You probably want to use less -R to enjoy viewing ANSI-colored text from --- a pipe or a file. Add this to your ~/.bashrc: export LESS="-R" --- ------------------------------------------------------------------------------- - --- Cache some library functions and objects. -local jit = require("jit") -assert(jit.version_num == 20005, "LuaJIT core/library version mismatch") -local jutil = require("jit.util") -local vmdef = require("jit.vmdef") -local funcinfo, funcbc = jutil.funcinfo, jutil.funcbc -local traceinfo, traceir, tracek = jutil.traceinfo, jutil.traceir, jutil.tracek -local tracemc, tracesnap = jutil.tracemc, jutil.tracesnap -local traceexitstub, ircalladdr = jutil.traceexitstub, jutil.ircalladdr -local bit = require("bit") -local band, shr = bit.band, bit.rshift -local sub, gsub, format = string.sub, string.gsub, string.format -local byte, rep = string.byte, string.rep -local type, tostring = type, tostring -local stdout, stderr = io.stdout, io.stderr - --- Load other modules on-demand. -local bcline, disass - --- Active flag, output file handle and dump mode. -local active, out, dumpmode - ------------------------------------------------------------------------------- - -local symtabmt = { __index = false } -local symtab = {} -local nexitsym = 0 - --- Fill nested symbol table with per-trace exit stub addresses. -local function fillsymtab_tr(tr, nexit) - local t = {} - symtabmt.__index = t - if jit.arch == "mips" or jit.arch == "mipsel" then - t[traceexitstub(tr, 0)] = "exit" - return - end - for i=0,nexit-1 do - local addr = traceexitstub(tr, i) - t[addr] = tostring(i) - end - local addr = traceexitstub(tr, nexit) - if addr then t[addr] = "stack_check" end -end - --- Fill symbol table with trace exit stub addresses. -local function fillsymtab(tr, nexit) - local t = symtab - if nexitsym == 0 then - local ircall = vmdef.ircall - for i=0,#ircall do - local addr = ircalladdr(i) - if addr ~= 0 then t[addr] = ircall[i] end - end - end - if nexitsym == 1000000 then -- Per-trace exit stubs. - fillsymtab_tr(tr, nexit) - elseif nexit > nexitsym then -- Shared exit stubs. - for i=nexitsym,nexit-1 do - local addr = traceexitstub(i) - if addr == nil then -- Fall back to per-trace exit stubs. - fillsymtab_tr(tr, nexit) - setmetatable(symtab, symtabmt) - nexit = 1000000 - break - end - t[addr] = tostring(i) - end - nexitsym = nexit - end - return t -end - -local function dumpwrite(s) - out:write(s) -end - --- Disassemble machine code. -local function dump_mcode(tr) - local info = traceinfo(tr) - if not info then return end - local mcode, addr, loop = tracemc(tr) - if not mcode then return end - if not disass then disass = require("jit.dis_"..jit.arch) end - out:write("---- TRACE ", tr, " mcode ", #mcode, "\n") - local ctx = disass.create(mcode, addr, dumpwrite) - ctx.hexdump = 0 - ctx.symtab = fillsymtab(tr, info.nexit) - if loop ~= 0 then - symtab[addr+loop] = "LOOP" - ctx:disass(0, loop) - out:write("->LOOP:\n") - ctx:disass(loop, #mcode-loop) - symtab[addr+loop] = nil - else - ctx:disass(0, #mcode) - end -end - ------------------------------------------------------------------------------- - -local irtype_text = { - [0] = "nil", - "fal", - "tru", - "lud", - "str", - "p32", - "thr", - "pro", - "fun", - "p64", - "cdt", - "tab", - "udt", - "flt", - "num", - "i8 ", - "u8 ", - "i16", - "u16", - "int", - "u32", - "i64", - "u64", - "sfp", -} - -local colortype_ansi = { - [0] = "%s", - "%s", - "%s", - "\027[36m%s\027[m", - "\027[32m%s\027[m", - "%s", - "\027[1m%s\027[m", - "%s", - "\027[1m%s\027[m", - "%s", - "\027[33m%s\027[m", - "\027[31m%s\027[m", - "\027[36m%s\027[m", - "\027[34m%s\027[m", - "\027[34m%s\027[m", - "\027[35m%s\027[m", - "\027[35m%s\027[m", - "\027[35m%s\027[m", - "\027[35m%s\027[m", - "\027[35m%s\027[m", - "\027[35m%s\027[m", - "\027[35m%s\027[m", - "\027[35m%s\027[m", - "\027[35m%s\027[m", -} - -local function colorize_text(s) - return s -end - -local function colorize_ansi(s, t) - return format(colortype_ansi[t], s) -end - -local irtype_ansi = setmetatable({}, - { __index = function(tab, t) - local s = colorize_ansi(irtype_text[t], t); tab[t] = s; return s; end }) - -local html_escape = { ["<"] = "<", [">"] = ">", ["&"] = "&", } - -local function colorize_html(s, t) - s = gsub(s, "[<>&]", html_escape) - return format('%s', irtype_text[t], s) -end - -local irtype_html = setmetatable({}, - { __index = function(tab, t) - local s = colorize_html(irtype_text[t], t); tab[t] = s; return s; end }) - -local header_html = [[ - -]] - -local colorize, irtype - --- Lookup tables to convert some literals into names. -local litname = { - ["SLOAD "] = setmetatable({}, { __index = function(t, mode) - local s = "" - if band(mode, 1) ~= 0 then s = s.."P" end - if band(mode, 2) ~= 0 then s = s.."F" end - if band(mode, 4) ~= 0 then s = s.."T" end - if band(mode, 8) ~= 0 then s = s.."C" end - if band(mode, 16) ~= 0 then s = s.."R" end - if band(mode, 32) ~= 0 then s = s.."I" end - t[mode] = s - return s - end}), - ["XLOAD "] = { [0] = "", "R", "V", "RV", "U", "RU", "VU", "RVU", }, - ["CONV "] = setmetatable({}, { __index = function(t, mode) - local s = irtype[band(mode, 31)] - s = irtype[band(shr(mode, 5), 31)].."."..s - if band(mode, 0x400) ~= 0 then s = s.." trunc" - elseif band(mode, 0x800) ~= 0 then s = s.." sext" end - local c = shr(mode, 14) - if c == 2 then s = s.." index" elseif c == 3 then s = s.." check" end - t[mode] = s - return s - end}), - ["FLOAD "] = vmdef.irfield, - ["FREF "] = vmdef.irfield, - ["FPMATH"] = vmdef.irfpm, -} - -local function ctlsub(c) - if c == "\n" then return "\\n" - elseif c == "\r" then return "\\r" - elseif c == "\t" then return "\\t" - else return format("\\%03d", byte(c)) - end -end - -local function fmtfunc(func, pc) - local fi = funcinfo(func, pc) - if fi.loc then - return fi.loc - elseif fi.ffid then - return vmdef.ffnames[fi.ffid] - elseif fi.addr then - return format("C:%x", fi.addr) - else - return "(?)" - end -end - -local function formatk(tr, idx) - local k, t, slot = tracek(tr, idx) - local tn = type(k) - local s - if tn == "number" then - if k == 2^52+2^51 then - s = "bias" - else - s = format("%+.14g", k) - end - elseif tn == "string" then - s = format(#k > 20 and '"%.20s"~' or '"%s"', gsub(k, "%c", ctlsub)) - elseif tn == "function" then - s = fmtfunc(k) - elseif tn == "table" then - s = format("{%p}", k) - elseif tn == "userdata" then - if t == 12 then - s = format("userdata:%p", k) - else - s = format("[%p]", k) - if s == "[NULL]" then s = "NULL" end - end - elseif t == 21 then -- int64_t - s = sub(tostring(k), 1, -3) - if sub(s, 1, 1) ~= "-" then s = "+"..s end - else - s = tostring(k) -- For primitives. - end - s = colorize(format("%-4s", s), t) - if slot then - s = format("%s @%d", s, slot) - end - return s -end - -local function printsnap(tr, snap) - local n = 2 - for s=0,snap[1]-1 do - local sn = snap[n] - if shr(sn, 24) == s then - n = n + 1 - local ref = band(sn, 0xffff) - 0x8000 -- REF_BIAS - if ref < 0 then - out:write(formatk(tr, ref)) - elseif band(sn, 0x80000) ~= 0 then -- SNAP_SOFTFPNUM - out:write(colorize(format("%04d/%04d", ref, ref+1), 14)) - else - local m, ot, op1, op2 = traceir(tr, ref) - out:write(colorize(format("%04d", ref), band(ot, 31))) - end - out:write(band(sn, 0x10000) == 0 and " " or "|") -- SNAP_FRAME - else - out:write("---- ") - end - end - out:write("]\n") -end - --- Dump snapshots (not interleaved with IR). -local function dump_snap(tr) - out:write("---- TRACE ", tr, " snapshots\n") - for i=0,1000000000 do - local snap = tracesnap(tr, i) - if not snap then break end - out:write(format("#%-3d %04d [ ", i, snap[0])) - printsnap(tr, snap) - end -end - --- Return a register name or stack slot for a rid/sp location. -local function ridsp_name(ridsp, ins) - if not disass then disass = require("jit.dis_"..jit.arch) end - local rid, slot = band(ridsp, 0xff), shr(ridsp, 8) - if rid == 253 or rid == 254 then - return (slot == 0 or slot == 255) and " {sink" or format(" {%04d", ins-slot) - end - if ridsp > 255 then return format("[%x]", slot*4) end - if rid < 128 then return disass.regname(rid) end - return "" -end - --- Dump CALL* function ref and return optional ctype. -local function dumpcallfunc(tr, ins) - local ctype - if ins > 0 then - local m, ot, op1, op2 = traceir(tr, ins) - if band(ot, 31) == 0 then -- nil type means CARG(func, ctype). - ins = op1 - ctype = formatk(tr, op2) - end - end - if ins < 0 then - out:write(format("[0x%x](", tonumber((tracek(tr, ins))))) - else - out:write(format("%04d (", ins)) - end - return ctype -end - --- Recursively gather CALL* args and dump them. -local function dumpcallargs(tr, ins) - if ins < 0 then - out:write(formatk(tr, ins)) - else - local m, ot, op1, op2 = traceir(tr, ins) - local oidx = 6*shr(ot, 8) - local op = sub(vmdef.irnames, oidx+1, oidx+6) - if op == "CARG " then - dumpcallargs(tr, op1) - if op2 < 0 then - out:write(" ", formatk(tr, op2)) - else - out:write(" ", format("%04d", op2)) - end - else - out:write(format("%04d", ins)) - end - end -end - --- Dump IR and interleaved snapshots. -local function dump_ir(tr, dumpsnap, dumpreg) - local info = traceinfo(tr) - if not info then return end - local nins = info.nins - out:write("---- TRACE ", tr, " IR\n") - local irnames = vmdef.irnames - local snapref = 65536 - local snap, snapno - if dumpsnap then - snap = tracesnap(tr, 0) - snapref = snap[0] - snapno = 0 - end - for ins=1,nins do - if ins >= snapref then - if dumpreg then - out:write(format(".... SNAP #%-3d [ ", snapno)) - else - out:write(format(".... SNAP #%-3d [ ", snapno)) - end - printsnap(tr, snap) - snapno = snapno + 1 - snap = tracesnap(tr, snapno) - snapref = snap and snap[0] or 65536 - end - local m, ot, op1, op2, ridsp = traceir(tr, ins) - local oidx, t = 6*shr(ot, 8), band(ot, 31) - local op = sub(irnames, oidx+1, oidx+6) - if op == "LOOP " then - if dumpreg then - out:write(format("%04d ------------ LOOP ------------\n", ins)) - else - out:write(format("%04d ------ LOOP ------------\n", ins)) - end - elseif op ~= "NOP " and op ~= "CARG " and - (dumpreg or op ~= "RENAME") then - local rid = band(ridsp, 255) - if dumpreg then - out:write(format("%04d %-6s", ins, ridsp_name(ridsp, ins))) - else - out:write(format("%04d ", ins)) - end - out:write(format("%s%s %s %s ", - (rid == 254 or rid == 253) and "}" or - (band(ot, 128) == 0 and " " or ">"), - band(ot, 64) == 0 and " " or "+", - irtype[t], op)) - local m1, m2 = band(m, 3), band(m, 3*4) - if sub(op, 1, 4) == "CALL" then - local ctype - if m2 == 1*4 then -- op2 == IRMlit - out:write(format("%-10s (", vmdef.ircall[op2])) - else - ctype = dumpcallfunc(tr, op2) - end - if op1 ~= -1 then dumpcallargs(tr, op1) end - out:write(")") - if ctype then out:write(" ctype ", ctype) end - elseif op == "CNEW " and op2 == -1 then - out:write(formatk(tr, op1)) - elseif m1 ~= 3 then -- op1 != IRMnone - if op1 < 0 then - out:write(formatk(tr, op1)) - else - out:write(format(m1 == 0 and "%04d" or "#%-3d", op1)) - end - if m2 ~= 3*4 then -- op2 != IRMnone - if m2 == 1*4 then -- op2 == IRMlit - local litn = litname[op] - if litn and litn[op2] then - out:write(" ", litn[op2]) - elseif op == "UREFO " or op == "UREFC " then - out:write(format(" #%-3d", shr(op2, 8))) - else - out:write(format(" #%-3d", op2)) - end - elseif op2 < 0 then - out:write(" ", formatk(tr, op2)) - else - out:write(format(" %04d", op2)) - end - end - end - out:write("\n") - end - end - if snap then - if dumpreg then - out:write(format(".... SNAP #%-3d [ ", snapno)) - else - out:write(format(".... SNAP #%-3d [ ", snapno)) - end - printsnap(tr, snap) - end -end - ------------------------------------------------------------------------------- - -local recprefix = "" -local recdepth = 0 - --- Format trace error message. -local function fmterr(err, info) - if type(err) == "number" then - if type(info) == "function" then info = fmtfunc(info) end - err = format(vmdef.traceerr[err], info) - end - return err -end - --- Dump trace states. -local function dump_trace(what, tr, func, pc, otr, oex) - if what == "stop" or (what == "abort" and dumpmode.a) then - if dumpmode.i then dump_ir(tr, dumpmode.s, dumpmode.r and what == "stop") - elseif dumpmode.s then dump_snap(tr) end - if dumpmode.m then dump_mcode(tr) end - end - if what == "start" then - if dumpmode.H then out:write('
\n') end
-    out:write("---- TRACE ", tr, " ", what)
-    if otr then out:write(" ", otr, "/", oex) end
-    out:write(" ", fmtfunc(func, pc), "\n")
-  elseif what == "stop" or what == "abort" then
-    out:write("---- TRACE ", tr, " ", what)
-    if what == "abort" then
-      out:write(" ", fmtfunc(func, pc), " -- ", fmterr(otr, oex), "\n")
-    else
-      local info = traceinfo(tr)
-      local link, ltype = info.link, info.linktype
-      if link == tr or link == 0 then
-	out:write(" -> ", ltype, "\n")
-      elseif ltype == "root" then
-	out:write(" -> ", link, "\n")
-      else
-	out:write(" -> ", link, " ", ltype, "\n")
-      end
-    end
-    if dumpmode.H then out:write("
\n\n") else out:write("\n") end - else - if what == "flush" then symtab, nexitsym = {}, 0 end - out:write("---- TRACE ", what, "\n\n") - end - out:flush() -end - --- Dump recorded bytecode. -local function dump_record(tr, func, pc, depth, callee) - if depth ~= recdepth then - recdepth = depth - recprefix = rep(" .", depth) - end - local line - if pc >= 0 then - line = bcline(func, pc, recprefix) - if dumpmode.H then line = gsub(line, "[<>&]", html_escape) end - else - line = "0000 "..recprefix.." FUNCC \n" - callee = func - end - if pc <= 0 then - out:write(sub(line, 1, -2), " ; ", fmtfunc(func), "\n") - else - out:write(line) - end - if pc >= 0 and band(funcbc(func, pc), 0xff) < 16 then -- ORDER BC - out:write(bcline(func, pc+1, recprefix)) -- Write JMP for cond. - end -end - ------------------------------------------------------------------------------- - --- Dump taken trace exits. -local function dump_texit(tr, ex, ngpr, nfpr, ...) - out:write("---- TRACE ", tr, " exit ", ex, "\n") - if dumpmode.X then - local regs = {...} - if jit.arch == "x64" then - for i=1,ngpr do - out:write(format(" %016x", regs[i])) - if i % 4 == 0 then out:write("\n") end - end - else - for i=1,ngpr do - out:write(format(" %08x", regs[i])) - if i % 8 == 0 then out:write("\n") end - end - end - if jit.arch == "mips" or jit.arch == "mipsel" then - for i=1,nfpr,2 do - out:write(format(" %+17.14g", regs[ngpr+i])) - if i % 8 == 7 then out:write("\n") end - end - else - for i=1,nfpr do - out:write(format(" %+17.14g", regs[ngpr+i])) - if i % 4 == 0 then out:write("\n") end - end - end - end -end - ------------------------------------------------------------------------------- - --- Detach dump handlers. -local function dumpoff() - if active then - active = false - jit.attach(dump_texit) - jit.attach(dump_record) - jit.attach(dump_trace) - if out and out ~= stdout and out ~= stderr then out:close() end - out = nil - end -end - --- Open the output file and attach dump handlers. -local function dumpon(opt, outfile) - if active then dumpoff() end - - local term = os.getenv("TERM") - local colormode = (term and term:match("color") or os.getenv("COLORTERM")) and "A" or "T" - if opt then - opt = gsub(opt, "[TAH]", function(mode) colormode = mode; return ""; end) - end - - local m = { t=true, b=true, i=true, m=true, } - if opt and opt ~= "" then - local o = sub(opt, 1, 1) - if o ~= "+" and o ~= "-" then m = {} end - for i=1,#opt do m[sub(opt, i, i)] = (o ~= "-") end - end - dumpmode = m - - if m.t or m.b or m.i or m.s or m.m then - jit.attach(dump_trace, "trace") - end - if m.b then - jit.attach(dump_record, "record") - if not bcline then bcline = require("jit.bc").line end - end - if m.x or m.X then - jit.attach(dump_texit, "texit") - end - - if not outfile then outfile = os.getenv("LUAJIT_DUMPFILE") end - if outfile then - out = outfile == "-" and stdout or assert(io.open(outfile, "w")) - else - out = stdout - end - - m[colormode] = true - if colormode == "A" then - colorize = colorize_ansi - irtype = irtype_ansi - elseif colormode == "H" then - colorize = colorize_html - irtype = irtype_html - out:write(header_html) - else - colorize = colorize_text - irtype = irtype_text - end - - active = true -end - --- Public module functions. -module(...) - -on = dumpon -off = dumpoff -start = dumpon -- For -j command line option. - diff --git a/subprojects/luajit/src/jit/v.lua b/subprojects/luajit/src/jit/v.lua deleted file mode 100644 index 47ee39410..000000000 --- a/subprojects/luajit/src/jit/v.lua +++ /dev/null @@ -1,167 +0,0 @@ ----------------------------------------------------------------------------- --- Verbose mode of the LuaJIT compiler. --- --- Copyright (C) 2005-2017 Mike Pall. All rights reserved. --- Released under the MIT license. See Copyright Notice in luajit.h ----------------------------------------------------------------------------- --- --- This module shows verbose information about the progress of the --- JIT compiler. It prints one line for each generated trace. This module --- is useful to see which code has been compiled or where the compiler --- punts and falls back to the interpreter. --- --- Example usage: --- --- luajit -jv -e "for i=1,1000 do for j=1,1000 do end end" --- luajit -jv=myapp.out myapp.lua --- --- Default output is to stderr. To redirect the output to a file, pass a --- filename as an argument (use '-' for stdout) or set the environment --- variable LUAJIT_VERBOSEFILE. The file is overwritten every time the --- module is started. --- --- The output from the first example should look like this: --- --- [TRACE 1 (command line):1 loop] --- [TRACE 2 (1/3) (command line):1 -> 1] --- --- The first number in each line is the internal trace number. Next are --- the file name ('(command line)') and the line number (':1') where the --- trace has started. Side traces also show the parent trace number and --- the exit number where they are attached to in parentheses ('(1/3)'). --- An arrow at the end shows where the trace links to ('-> 1'), unless --- it loops to itself. --- --- In this case the inner loop gets hot and is traced first, generating --- a root trace. Then the last exit from the 1st trace gets hot, too, --- and triggers generation of the 2nd trace. The side trace follows the --- path along the outer loop and *around* the inner loop, back to its --- start, and then links to the 1st trace. Yes, this may seem unusual, --- if you know how traditional compilers work. Trace compilers are full --- of surprises like this -- have fun! :-) --- --- Aborted traces are shown like this: --- --- [TRACE --- foo.lua:44 -- leaving loop in root trace at foo:lua:50] --- --- Don't worry -- trace aborts are quite common, even in programs which --- can be fully compiled. The compiler may retry several times until it --- finds a suitable trace. --- --- Of course this doesn't work with features that are not-yet-implemented --- (NYI error messages). The VM simply falls back to the interpreter. This --- may not matter at all if the particular trace is not very high up in --- the CPU usage profile. Oh, and the interpreter is quite fast, too. --- --- Also check out the -jdump module, which prints all the gory details. --- ------------------------------------------------------------------------------- - --- Cache some library functions and objects. -local jit = require("jit") -assert(jit.version_num == 20005, "LuaJIT core/library version mismatch") -local jutil = require("jit.util") -local vmdef = require("jit.vmdef") -local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo -local type, format = type, string.format -local stdout, stderr = io.stdout, io.stderr - --- Active flag and output file handle. -local active, out - ------------------------------------------------------------------------------- - -local startloc, startex - -local function fmtfunc(func, pc) - local fi = funcinfo(func, pc) - if fi.loc then - return fi.loc - elseif fi.ffid then - return vmdef.ffnames[fi.ffid] - elseif fi.addr then - return format("C:%x", fi.addr) - else - return "(?)" - end -end - --- Format trace error message. -local function fmterr(err, info) - if type(err) == "number" then - if type(info) == "function" then info = fmtfunc(info) end - err = format(vmdef.traceerr[err], info) - end - return err -end - --- Dump trace states. -local function dump_trace(what, tr, func, pc, otr, oex) - if what == "start" then - startloc = fmtfunc(func, pc) - startex = otr and "("..otr.."/"..oex..") " or "" - else - if what == "abort" then - local loc = fmtfunc(func, pc) - if loc ~= startloc then - out:write(format("[TRACE --- %s%s -- %s at %s]\n", - startex, startloc, fmterr(otr, oex), loc)) - else - out:write(format("[TRACE --- %s%s -- %s]\n", - startex, startloc, fmterr(otr, oex))) - end - elseif what == "stop" then - local info = traceinfo(tr) - local link, ltype = info.link, info.linktype - if ltype == "interpreter" then - out:write(format("[TRACE %3s %s%s -- fallback to interpreter]\n", - tr, startex, startloc)) - elseif link == tr or link == 0 then - out:write(format("[TRACE %3s %s%s %s]\n", - tr, startex, startloc, ltype)) - elseif ltype == "root" then - out:write(format("[TRACE %3s %s%s -> %d]\n", - tr, startex, startloc, link)) - else - out:write(format("[TRACE %3s %s%s -> %d %s]\n", - tr, startex, startloc, link, ltype)) - end - else - out:write(format("[TRACE %s]\n", what)) - end - out:flush() - end -end - ------------------------------------------------------------------------------- - --- Detach dump handlers. -local function dumpoff() - if active then - active = false - jit.attach(dump_trace) - if out and out ~= stdout and out ~= stderr then out:close() end - out = nil - end -end - --- Open the output file and attach dump handlers. -local function dumpon(outfile) - if active then dumpoff() end - if not outfile then outfile = os.getenv("LUAJIT_VERBOSEFILE") end - if outfile then - out = outfile == "-" and stdout or assert(io.open(outfile, "w")) - else - out = stderr - end - jit.attach(dump_trace, "trace") - active = true -end - --- Public module functions. -module(...) - -on = dumpon -off = dumpoff -start = dumpon -- For -j command line option. - diff --git a/subprojects/luajit/src/lauxlib.h b/subprojects/luajit/src/lauxlib.h deleted file mode 100644 index fed1491b8..000000000 --- a/subprojects/luajit/src/lauxlib.h +++ /dev/null @@ -1,167 +0,0 @@ -/* -** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $ -** Auxiliary functions for building Lua libraries -** See Copyright Notice in lua.h -*/ - - -#ifndef lauxlib_h -#define lauxlib_h - - -#include -#include - -#include "lua.h" - - -#define luaL_getn(L,i) ((int)lua_objlen(L, i)) -#define luaL_setn(L,i,j) ((void)0) /* no op! */ - -/* extra error code for `luaL_load' */ -#define LUA_ERRFILE (LUA_ERRERR+1) - -typedef struct luaL_Reg { - const char *name; - lua_CFunction func; -} luaL_Reg; - -LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, - const luaL_Reg *l, int nup); -LUALIB_API void (luaL_register) (lua_State *L, const char *libname, - const luaL_Reg *l); -LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); -LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); -LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); -LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); -LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, - size_t *l); -LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg, - const char *def, size_t *l); -LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg); -LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def); - -LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg); -LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg, - lua_Integer def); - -LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg); -LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t); -LUALIB_API void (luaL_checkany) (lua_State *L, int narg); - -LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname); -LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname); - -LUALIB_API void (luaL_where) (lua_State *L, int lvl); -LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); - -LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, - const char *const lst[]); - -LUALIB_API int (luaL_ref) (lua_State *L, int t); -LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); - -LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename); -LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, - const char *name); -LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); - -LUALIB_API lua_State *(luaL_newstate) (void); - - -LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, - const char *r); - -LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx, - const char *fname, int szhint); - -/* From Lua 5.2. */ -LUALIB_API int luaL_fileresult(lua_State *L, int stat, const char *fname); -LUALIB_API int luaL_execresult(lua_State *L, int stat); -LUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename, - const char *mode); -LUALIB_API int (luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz, - const char *name, const char *mode); -LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, const char *msg, - int level); - - -/* -** =============================================================== -** some useful macros -** =============================================================== -*/ - -#define luaL_argcheck(L, cond,numarg,extramsg) \ - ((void)((cond) || luaL_argerror(L, (numarg), (extramsg)))) -#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) -#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) -#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) -#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) -#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) -#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) - -#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i))) - -#define luaL_dofile(L, fn) \ - (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) - -#define luaL_dostring(L, s) \ - (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0)) - -#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n))) - -#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) - -/* -** {====================================================== -** Generic Buffer manipulation -** ======================================================= -*/ - - - -typedef struct luaL_Buffer { - char *p; /* current position in buffer */ - int lvl; /* number of strings in the stack (level) */ - lua_State *L; - char buffer[LUAL_BUFFERSIZE]; -} luaL_Buffer; - -#define luaL_addchar(B,c) \ - ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \ - (*(B)->p++ = (char)(c))) - -/* compatibility only */ -#define luaL_putchar(B,c) luaL_addchar(B,c) - -#define luaL_addsize(B,n) ((B)->p += (n)) - -LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B); -LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B); -LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l); -LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s); -LUALIB_API void (luaL_addvalue) (luaL_Buffer *B); -LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); - - -/* }====================================================== */ - - -/* compatibility with ref system */ - -/* pre-defined references */ -#define LUA_NOREF (-2) -#define LUA_REFNIL (-1) - -#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ - (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) - -#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) - -#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref)) - - -#define luaL_reg luaL_Reg - -#endif diff --git a/subprojects/luajit/src/lib_aux.c b/subprojects/luajit/src/lib_aux.c deleted file mode 100644 index 7af1cd43b..000000000 --- a/subprojects/luajit/src/lib_aux.c +++ /dev/null @@ -1,356 +0,0 @@ -/* -** Auxiliary library for the Lua/C API. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major parts taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#include -#include -#include - -#define lib_aux_c -#define LUA_LIB - -#include "lua.h" -#include "lauxlib.h" - -#include "lj_obj.h" -#include "lj_err.h" -#include "lj_state.h" -#include "lj_trace.h" -#include "lj_lib.h" - -#if LJ_TARGET_POSIX -#include -#endif - -/* -- I/O error handling -------------------------------------------------- */ - -LUALIB_API int luaL_fileresult(lua_State *L, int stat, const char *fname) -{ - if (stat) { - setboolV(L->top++, 1); - return 1; - } else { - int en = errno; /* Lua API calls may change this value. */ - setnilV(L->top++); - if (fname) - lua_pushfstring(L, "%s: %s", fname, strerror(en)); - else - lua_pushfstring(L, "%s", strerror(en)); - setintV(L->top++, en); - lj_trace_abort(G(L)); - return 3; - } -} - -LUALIB_API int luaL_execresult(lua_State *L, int stat) -{ - if (stat != -1) { -#if LJ_TARGET_POSIX - if (WIFSIGNALED(stat)) { - stat = WTERMSIG(stat); - setnilV(L->top++); - lua_pushliteral(L, "signal"); - } else { - if (WIFEXITED(stat)) - stat = WEXITSTATUS(stat); - if (stat == 0) - setboolV(L->top++, 1); - else - setnilV(L->top++); - lua_pushliteral(L, "exit"); - } -#else - if (stat == 0) - setboolV(L->top++, 1); - else - setnilV(L->top++); - lua_pushliteral(L, "exit"); -#endif - setintV(L->top++, stat); - return 3; - } - return luaL_fileresult(L, 0, NULL); -} - -/* -- Module registration ------------------------------------------------- */ - -LUALIB_API const char *luaL_findtable(lua_State *L, int idx, - const char *fname, int szhint) -{ - const char *e; - lua_pushvalue(L, idx); - do { - e = strchr(fname, '.'); - if (e == NULL) e = fname + strlen(fname); - lua_pushlstring(L, fname, (size_t)(e - fname)); - lua_rawget(L, -2); - if (lua_isnil(L, -1)) { /* no such field? */ - lua_pop(L, 1); /* remove this nil */ - lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */ - lua_pushlstring(L, fname, (size_t)(e - fname)); - lua_pushvalue(L, -2); - lua_settable(L, -4); /* set new table into field */ - } else if (!lua_istable(L, -1)) { /* field has a non-table value? */ - lua_pop(L, 2); /* remove table and value */ - return fname; /* return problematic part of the name */ - } - lua_remove(L, -2); /* remove previous table */ - fname = e + 1; - } while (*e == '.'); - return NULL; -} - -static int libsize(const luaL_Reg *l) -{ - int size = 0; - for (; l->name; l++) size++; - return size; -} - -LUALIB_API void luaL_openlib(lua_State *L, const char *libname, - const luaL_Reg *l, int nup) -{ - lj_lib_checkfpu(L); - if (libname) { - int size = libsize(l); - /* check whether lib already exists */ - luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 16); - lua_getfield(L, -1, libname); /* get _LOADED[libname] */ - if (!lua_istable(L, -1)) { /* not found? */ - lua_pop(L, 1); /* remove previous result */ - /* try global variable (and create one if it does not exist) */ - if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, size) != NULL) - lj_err_callerv(L, LJ_ERR_BADMODN, libname); - lua_pushvalue(L, -1); - lua_setfield(L, -3, libname); /* _LOADED[libname] = new table */ - } - lua_remove(L, -2); /* remove _LOADED table */ - lua_insert(L, -(nup+1)); /* move library table to below upvalues */ - } - for (; l->name; l++) { - int i; - for (i = 0; i < nup; i++) /* copy upvalues to the top */ - lua_pushvalue(L, -nup); - lua_pushcclosure(L, l->func, nup); - lua_setfield(L, -(nup+2), l->name); - } - lua_pop(L, nup); /* remove upvalues */ -} - -LUALIB_API void luaL_register(lua_State *L, const char *libname, - const luaL_Reg *l) -{ - luaL_openlib(L, libname, l, 0); -} - -LUALIB_API const char *luaL_gsub(lua_State *L, const char *s, - const char *p, const char *r) -{ - const char *wild; - size_t l = strlen(p); - luaL_Buffer b; - luaL_buffinit(L, &b); - while ((wild = strstr(s, p)) != NULL) { - luaL_addlstring(&b, s, (size_t)(wild - s)); /* push prefix */ - luaL_addstring(&b, r); /* push replacement in place of pattern */ - s = wild + l; /* continue after `p' */ - } - luaL_addstring(&b, s); /* push last suffix */ - luaL_pushresult(&b); - return lua_tostring(L, -1); -} - -/* -- Buffer handling ----------------------------------------------------- */ - -#define bufflen(B) ((size_t)((B)->p - (B)->buffer)) -#define bufffree(B) ((size_t)(LUAL_BUFFERSIZE - bufflen(B))) - -static int emptybuffer(luaL_Buffer *B) -{ - size_t l = bufflen(B); - if (l == 0) - return 0; /* put nothing on stack */ - lua_pushlstring(B->L, B->buffer, l); - B->p = B->buffer; - B->lvl++; - return 1; -} - -static void adjuststack(luaL_Buffer *B) -{ - if (B->lvl > 1) { - lua_State *L = B->L; - int toget = 1; /* number of levels to concat */ - size_t toplen = lua_strlen(L, -1); - do { - size_t l = lua_strlen(L, -(toget+1)); - if (!(B->lvl - toget + 1 >= LUA_MINSTACK/2 || toplen > l)) - break; - toplen += l; - toget++; - } while (toget < B->lvl); - lua_concat(L, toget); - B->lvl = B->lvl - toget + 1; - } -} - -LUALIB_API char *luaL_prepbuffer(luaL_Buffer *B) -{ - if (emptybuffer(B)) - adjuststack(B); - return B->buffer; -} - -LUALIB_API void luaL_addlstring(luaL_Buffer *B, const char *s, size_t l) -{ - while (l--) - luaL_addchar(B, *s++); -} - -LUALIB_API void luaL_addstring(luaL_Buffer *B, const char *s) -{ - luaL_addlstring(B, s, strlen(s)); -} - -LUALIB_API void luaL_pushresult(luaL_Buffer *B) -{ - emptybuffer(B); - lua_concat(B->L, B->lvl); - B->lvl = 1; -} - -LUALIB_API void luaL_addvalue(luaL_Buffer *B) -{ - lua_State *L = B->L; - size_t vl; - const char *s = lua_tolstring(L, -1, &vl); - if (vl <= bufffree(B)) { /* fit into buffer? */ - memcpy(B->p, s, vl); /* put it there */ - B->p += vl; - lua_pop(L, 1); /* remove from stack */ - } else { - if (emptybuffer(B)) - lua_insert(L, -2); /* put buffer before new value */ - B->lvl++; /* add new value into B stack */ - adjuststack(B); - } -} - -LUALIB_API void luaL_buffinit(lua_State *L, luaL_Buffer *B) -{ - B->L = L; - B->p = B->buffer; - B->lvl = 0; -} - -/* -- Reference management ------------------------------------------------ */ - -#define FREELIST_REF 0 - -/* Convert a stack index to an absolute index. */ -#define abs_index(L, i) \ - ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) - -LUALIB_API int luaL_ref(lua_State *L, int t) -{ - int ref; - t = abs_index(L, t); - if (lua_isnil(L, -1)) { - lua_pop(L, 1); /* remove from stack */ - return LUA_REFNIL; /* `nil' has a unique fixed reference */ - } - lua_rawgeti(L, t, FREELIST_REF); /* get first free element */ - ref = (int)lua_tointeger(L, -1); /* ref = t[FREELIST_REF] */ - lua_pop(L, 1); /* remove it from stack */ - if (ref != 0) { /* any free element? */ - lua_rawgeti(L, t, ref); /* remove it from list */ - lua_rawseti(L, t, FREELIST_REF); /* (t[FREELIST_REF] = t[ref]) */ - } else { /* no free elements */ - ref = (int)lua_objlen(L, t); - ref++; /* create new reference */ - } - lua_rawseti(L, t, ref); - return ref; -} - -LUALIB_API void luaL_unref(lua_State *L, int t, int ref) -{ - if (ref >= 0) { - t = abs_index(L, t); - lua_rawgeti(L, t, FREELIST_REF); - lua_rawseti(L, t, ref); /* t[ref] = t[FREELIST_REF] */ - lua_pushinteger(L, ref); - lua_rawseti(L, t, FREELIST_REF); /* t[FREELIST_REF] = ref */ - } -} - -/* -- Default allocator and panic function -------------------------------- */ - -static int panic(lua_State *L) -{ - const char *s = lua_tostring(L, -1); - fputs("PANIC: unprotected error in call to Lua API (", stderr); - fputs(s ? s : "?", stderr); - fputc(')', stderr); fputc('\n', stderr); - fflush(stderr); - return 0; -} - -#ifdef LUAJIT_USE_SYSMALLOC - -#if LJ_64 && !defined(LUAJIT_USE_VALGRIND) -#error "Must use builtin allocator for 64 bit target" -#endif - -static void *mem_alloc(void *ud, void *ptr, size_t osize, size_t nsize) -{ - (void)ud; - (void)osize; - if (nsize == 0) { - free(ptr); - return NULL; - } else { - return realloc(ptr, nsize); - } -} - -LUALIB_API lua_State *luaL_newstate(void) -{ - lua_State *L = lua_newstate(mem_alloc, NULL); - if (L) G(L)->panic = panic; - return L; -} - -#else - -#include "lj_alloc.h" - -LUALIB_API lua_State *luaL_newstate(void) -{ - lua_State *L; - void *ud = lj_alloc_create(); - if (ud == NULL) return NULL; -#if LJ_64 - L = lj_state_newstate(lj_alloc_f, ud); -#else - L = lua_newstate(lj_alloc_f, ud); -#endif - if (L) G(L)->panic = panic; - return L; -} - -#if LJ_64 -LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud) -{ - UNUSED(f); UNUSED(ud); - fputs("Must use luaL_newstate() for 64 bit target\n", stderr); - return NULL; -} -#endif - -#endif - diff --git a/subprojects/luajit/src/lib_base.c b/subprojects/luajit/src/lib_base.c deleted file mode 100644 index 162bbbb2e..000000000 --- a/subprojects/luajit/src/lib_base.c +++ /dev/null @@ -1,683 +0,0 @@ -/* -** Base and coroutine library. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2011 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#include - -#define lib_base_c -#define LUA_LIB - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_debug.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_meta.h" -#include "lj_state.h" -#if LJ_HASFFI -#include "lj_ctype.h" -#include "lj_cconv.h" -#endif -#include "lj_bc.h" -#include "lj_ff.h" -#include "lj_dispatch.h" -#include "lj_char.h" -#include "lj_strscan.h" -#include "lj_lib.h" - -/* -- Base library: checks ------------------------------------------------ */ - -#define LJLIB_MODULE_base - -LJLIB_ASM(assert) LJLIB_REC(.) -{ - GCstr *s; - lj_lib_checkany(L, 1); - s = lj_lib_optstr(L, 2); - if (s) - lj_err_callermsg(L, strdata(s)); - else - lj_err_caller(L, LJ_ERR_ASSERT); - return FFH_UNREACHABLE; -} - -/* ORDER LJ_T */ -LJLIB_PUSH("nil") -LJLIB_PUSH("boolean") -LJLIB_PUSH(top-1) /* boolean */ -LJLIB_PUSH("userdata") -LJLIB_PUSH("string") -LJLIB_PUSH("upval") -LJLIB_PUSH("thread") -LJLIB_PUSH("proto") -LJLIB_PUSH("function") -LJLIB_PUSH("trace") -LJLIB_PUSH("cdata") -LJLIB_PUSH("table") -LJLIB_PUSH(top-9) /* userdata */ -LJLIB_PUSH("number") -LJLIB_ASM_(type) LJLIB_REC(.) -/* Recycle the lj_lib_checkany(L, 1) from assert. */ - -/* -- Base library: iterators --------------------------------------------- */ - -/* This solves a circular dependency problem -- change FF_next_N as needed. */ -LJ_STATIC_ASSERT((int)FF_next == FF_next_N); - -LJLIB_ASM(next) -{ - lj_lib_checktab(L, 1); - return FFH_UNREACHABLE; -} - -#if LJ_52 || LJ_HASFFI -static int ffh_pairs(lua_State *L, MMS mm) -{ - TValue *o = lj_lib_checkany(L, 1); - cTValue *mo = lj_meta_lookup(L, o, mm); - if ((LJ_52 || tviscdata(o)) && !tvisnil(mo)) { - L->top = o+1; /* Only keep one argument. */ - copyTV(L, L->base-1, mo); /* Replace callable. */ - return FFH_TAILCALL; - } else { - if (!tvistab(o)) lj_err_argt(L, 1, LUA_TTABLE); - setfuncV(L, o-1, funcV(lj_lib_upvalue(L, 1))); - if (mm == MM_pairs) setnilV(o+1); else setintV(o+1, 0); - return FFH_RES(3); - } -} -#else -#define ffh_pairs(L, mm) (lj_lib_checktab(L, 1), FFH_UNREACHABLE) -#endif - -LJLIB_PUSH(lastcl) -LJLIB_ASM(pairs) -{ - return ffh_pairs(L, MM_pairs); -} - -LJLIB_NOREGUV LJLIB_ASM(ipairs_aux) LJLIB_REC(.) -{ - lj_lib_checktab(L, 1); - lj_lib_checkint(L, 2); - return FFH_UNREACHABLE; -} - -LJLIB_PUSH(lastcl) -LJLIB_ASM(ipairs) LJLIB_REC(.) -{ - return ffh_pairs(L, MM_ipairs); -} - -/* -- Base library: getters and setters ----------------------------------- */ - -LJLIB_ASM_(getmetatable) LJLIB_REC(.) -/* Recycle the lj_lib_checkany(L, 1) from assert. */ - -LJLIB_ASM(setmetatable) LJLIB_REC(.) -{ - GCtab *t = lj_lib_checktab(L, 1); - GCtab *mt = lj_lib_checktabornil(L, 2); - if (!tvisnil(lj_meta_lookup(L, L->base, MM_metatable))) - lj_err_caller(L, LJ_ERR_PROTMT); - setgcref(t->metatable, obj2gco(mt)); - if (mt) { lj_gc_objbarriert(L, t, mt); } - settabV(L, L->base-1, t); - return FFH_RES(1); -} - -LJLIB_CF(getfenv) -{ - GCfunc *fn; - cTValue *o = L->base; - if (!(o < L->top && tvisfunc(o))) { - int level = lj_lib_optint(L, 1, 1); - o = lj_debug_frame(L, level, &level); - if (o == NULL) - lj_err_arg(L, 1, LJ_ERR_INVLVL); - } - fn = &gcval(o)->fn; - settabV(L, L->top++, isluafunc(fn) ? tabref(fn->l.env) : tabref(L->env)); - return 1; -} - -LJLIB_CF(setfenv) -{ - GCfunc *fn; - GCtab *t = lj_lib_checktab(L, 2); - cTValue *o = L->base; - if (!(o < L->top && tvisfunc(o))) { - int level = lj_lib_checkint(L, 1); - if (level == 0) { - /* NOBARRIER: A thread (i.e. L) is never black. */ - setgcref(L->env, obj2gco(t)); - return 0; - } - o = lj_debug_frame(L, level, &level); - if (o == NULL) - lj_err_arg(L, 1, LJ_ERR_INVLVL); - } - fn = &gcval(o)->fn; - if (!isluafunc(fn)) - lj_err_caller(L, LJ_ERR_SETFENV); - setgcref(fn->l.env, obj2gco(t)); - lj_gc_objbarrier(L, obj2gco(fn), t); - setfuncV(L, L->top++, fn); - return 1; -} - -LJLIB_ASM(rawget) LJLIB_REC(.) -{ - lj_lib_checktab(L, 1); - lj_lib_checkany(L, 2); - return FFH_UNREACHABLE; -} - -LJLIB_CF(rawset) LJLIB_REC(.) -{ - lj_lib_checktab(L, 1); - lj_lib_checkany(L, 2); - L->top = 1+lj_lib_checkany(L, 3); - lua_rawset(L, 1); - return 1; -} - -LJLIB_CF(rawequal) LJLIB_REC(.) -{ - cTValue *o1 = lj_lib_checkany(L, 1); - cTValue *o2 = lj_lib_checkany(L, 2); - setboolV(L->top-1, lj_obj_equal(o1, o2)); - return 1; -} - -#if LJ_52 -LJLIB_CF(rawlen) LJLIB_REC(.) -{ - cTValue *o = L->base; - int32_t len; - if (L->top > o && tvisstr(o)) - len = (int32_t)strV(o)->len; - else - len = (int32_t)lj_tab_len(lj_lib_checktab(L, 1)); - setintV(L->top-1, len); - return 1; -} -#endif - -LJLIB_CF(unpack) -{ - GCtab *t = lj_lib_checktab(L, 1); - int32_t n, i = lj_lib_optint(L, 2, 1); - int32_t e = (L->base+3-1 < L->top && !tvisnil(L->base+3-1)) ? - lj_lib_checkint(L, 3) : (int32_t)lj_tab_len(t); - if (i > e) return 0; - n = e - i + 1; - if (n <= 0 || !lua_checkstack(L, n)) - lj_err_caller(L, LJ_ERR_UNPACK); - do { - cTValue *tv = lj_tab_getint(t, i); - if (tv) { - copyTV(L, L->top++, tv); - } else { - setnilV(L->top++); - } - } while (i++ < e); - return n; -} - -LJLIB_CF(select) LJLIB_REC(.) -{ - int32_t n = (int32_t)(L->top - L->base); - if (n >= 1 && tvisstr(L->base) && *strVdata(L->base) == '#') { - setintV(L->top-1, n-1); - return 1; - } else { - int32_t i = lj_lib_checkint(L, 1); - if (i < 0) i = n + i; else if (i > n) i = n; - if (i < 1) - lj_err_arg(L, 1, LJ_ERR_IDXRNG); - return n - i; - } -} - -/* -- Base library: conversions ------------------------------------------- */ - -LJLIB_ASM(tonumber) LJLIB_REC(.) -{ - int32_t base = lj_lib_optint(L, 2, 10); - if (base == 10) { - TValue *o = lj_lib_checkany(L, 1); - if (lj_strscan_numberobj(o)) { - copyTV(L, L->base-1, o); - return FFH_RES(1); - } -#if LJ_HASFFI - if (tviscdata(o)) { - CTState *cts = ctype_cts(L); - CType *ct = lj_ctype_rawref(cts, cdataV(o)->ctypeid); - if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); - if (ctype_isnum(ct->info) || ctype_iscomplex(ct->info)) { - if (LJ_DUALNUM && ctype_isinteger_or_bool(ct->info) && - ct->size <= 4 && !(ct->size == 4 && (ct->info & CTF_UNSIGNED))) { - int32_t i; - lj_cconv_ct_tv(cts, ctype_get(cts, CTID_INT32), (uint8_t *)&i, o, 0); - setintV(L->base-1, i); - return FFH_RES(1); - } - lj_cconv_ct_tv(cts, ctype_get(cts, CTID_DOUBLE), - (uint8_t *)&(L->base-1)->n, o, 0); - return FFH_RES(1); - } - } -#endif - } else { - const char *p = strdata(lj_lib_checkstr(L, 1)); - char *ep; - unsigned long ul; - if (base < 2 || base > 36) - lj_err_arg(L, 2, LJ_ERR_BASERNG); - ul = strtoul(p, &ep, base); - if (p != ep) { - while (lj_char_isspace((unsigned char)(*ep))) ep++; - if (*ep == '\0') { - if (LJ_DUALNUM && LJ_LIKELY(ul < 0x80000000u)) - setintV(L->base-1, (int32_t)ul); - else - setnumV(L->base-1, (lua_Number)ul); - return FFH_RES(1); - } - } - } - setnilV(L->base-1); - return FFH_RES(1); -} - -LJLIB_PUSH("nil") -LJLIB_PUSH("false") -LJLIB_PUSH("true") -LJLIB_ASM(tostring) LJLIB_REC(.) -{ - TValue *o = lj_lib_checkany(L, 1); - cTValue *mo; - L->top = o+1; /* Only keep one argument. */ - if (!tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) { - copyTV(L, L->base-1, mo); /* Replace callable. */ - return FFH_TAILCALL; - } else { - GCstr *s; - if (tvisnumber(o)) { - s = lj_str_fromnumber(L, o); - } else if (tvispri(o)) { - s = strV(lj_lib_upvalue(L, -(int32_t)itype(o))); - } else { - if (tvisfunc(o) && isffunc(funcV(o))) - lua_pushfstring(L, "function: builtin#%d", funcV(o)->c.ffid); - else - lua_pushfstring(L, "%s: %p", lj_typename(o), lua_topointer(L, 1)); - /* Note: lua_pushfstring calls the GC which may invalidate o. */ - s = strV(L->top-1); - } - setstrV(L, L->base-1, s); - return FFH_RES(1); - } -} - -/* -- Base library: throw and catch errors -------------------------------- */ - -LJLIB_CF(error) -{ - int32_t level = lj_lib_optint(L, 2, 1); - lua_settop(L, 1); - if (lua_isstring(L, 1) && level > 0) { - luaL_where(L, level); - lua_pushvalue(L, 1); - lua_concat(L, 2); - } - return lua_error(L); -} - -LJLIB_ASM(pcall) LJLIB_REC(.) -{ - lj_lib_checkany(L, 1); - lj_lib_checkfunc(L, 2); /* For xpcall only. */ - return FFH_UNREACHABLE; -} -LJLIB_ASM_(xpcall) LJLIB_REC(.) - -/* -- Base library: load Lua code ----------------------------------------- */ - -static int load_aux(lua_State *L, int status, int envarg) -{ - if (status == 0) { - if (tvistab(L->base+envarg-1)) { - GCfunc *fn = funcV(L->top-1); - GCtab *t = tabV(L->base+envarg-1); - setgcref(fn->c.env, obj2gco(t)); - lj_gc_objbarrier(L, fn, t); - } - return 1; - } else { - setnilV(L->top-2); - return 2; - } -} - -LJLIB_CF(loadfile) -{ - GCstr *fname = lj_lib_optstr(L, 1); - GCstr *mode = lj_lib_optstr(L, 2); - int status; - lua_settop(L, 3); /* Ensure env arg exists. */ - status = luaL_loadfilex(L, fname ? strdata(fname) : NULL, - mode ? strdata(mode) : NULL); - return load_aux(L, status, 3); -} - -static const char *reader_func(lua_State *L, void *ud, size_t *size) -{ - UNUSED(ud); - luaL_checkstack(L, 2, "too many nested functions"); - copyTV(L, L->top++, L->base); - lua_call(L, 0, 1); /* Call user-supplied function. */ - L->top--; - if (tvisnil(L->top)) { - *size = 0; - return NULL; - } else if (tvisstr(L->top) || tvisnumber(L->top)) { - copyTV(L, L->base+4, L->top); /* Anchor string in reserved stack slot. */ - return lua_tolstring(L, 5, size); - } else { - lj_err_caller(L, LJ_ERR_RDRSTR); - return NULL; - } -} - -LJLIB_CF(load) -{ - GCstr *name = lj_lib_optstr(L, 2); - GCstr *mode = lj_lib_optstr(L, 3); - int status; - if (L->base < L->top && (tvisstr(L->base) || tvisnumber(L->base))) { - GCstr *s = lj_lib_checkstr(L, 1); - lua_settop(L, 4); /* Ensure env arg exists. */ - status = luaL_loadbufferx(L, strdata(s), s->len, strdata(name ? name : s), - mode ? strdata(mode) : NULL); - } else { - lj_lib_checkfunc(L, 1); - lua_settop(L, 5); /* Reserve a slot for the string from the reader. */ - status = lua_loadx(L, reader_func, NULL, name ? strdata(name) : "=(load)", - mode ? strdata(mode) : NULL); - } - return load_aux(L, status, 4); -} - -LJLIB_CF(loadstring) -{ - return lj_cf_load(L); -} - -LJLIB_CF(dofile) -{ - GCstr *fname = lj_lib_optstr(L, 1); - setnilV(L->top); - L->top = L->base+1; - if (luaL_loadfile(L, fname ? strdata(fname) : NULL) != 0) - lua_error(L); - lua_call(L, 0, LUA_MULTRET); - return (int)(L->top - L->base) - 1; -} - -/* -- Base library: GC control -------------------------------------------- */ - -LJLIB_CF(gcinfo) -{ - setintV(L->top++, (G(L)->gc.total >> 10)); - return 1; -} - -LJLIB_CF(collectgarbage) -{ - int opt = lj_lib_checkopt(L, 1, LUA_GCCOLLECT, /* ORDER LUA_GC* */ - "\4stop\7restart\7collect\5count\1\377\4step\10setpause\12setstepmul"); - int32_t data = lj_lib_optint(L, 2, 0); - if (opt == LUA_GCCOUNT) { - setnumV(L->top, (lua_Number)G(L)->gc.total/1024.0); - } else { - int res = lua_gc(L, opt, data); - if (opt == LUA_GCSTEP) - setboolV(L->top, res); - else - setintV(L->top, res); - } - L->top++; - return 1; -} - -/* -- Base library: miscellaneous functions ------------------------------- */ - -LJLIB_PUSH(top-2) /* Upvalue holds weak table. */ -LJLIB_CF(newproxy) -{ - lua_settop(L, 1); - lua_newuserdata(L, 0); - if (lua_toboolean(L, 1) == 0) { /* newproxy(): without metatable. */ - return 1; - } else if (lua_isboolean(L, 1)) { /* newproxy(true): with metatable. */ - lua_newtable(L); - lua_pushvalue(L, -1); - lua_pushboolean(L, 1); - lua_rawset(L, lua_upvalueindex(1)); /* Remember mt in weak table. */ - } else { /* newproxy(proxy): inherit metatable. */ - int validproxy = 0; - if (lua_getmetatable(L, 1)) { - lua_rawget(L, lua_upvalueindex(1)); - validproxy = lua_toboolean(L, -1); - lua_pop(L, 1); - } - if (!validproxy) - lj_err_arg(L, 1, LJ_ERR_NOPROXY); - lua_getmetatable(L, 1); - } - lua_setmetatable(L, 2); - return 1; -} - -LJLIB_PUSH("tostring") -LJLIB_CF(print) -{ - ptrdiff_t i, nargs = L->top - L->base; - cTValue *tv = lj_tab_getstr(tabref(L->env), strV(lj_lib_upvalue(L, 1))); - int shortcut; - if (tv && !tvisnil(tv)) { - copyTV(L, L->top++, tv); - } else { - setstrV(L, L->top++, strV(lj_lib_upvalue(L, 1))); - lua_gettable(L, LUA_GLOBALSINDEX); - tv = L->top-1; - } - shortcut = (tvisfunc(tv) && funcV(tv)->c.ffid == FF_tostring); - for (i = 0; i < nargs; i++) { - const char *str; - size_t size; - cTValue *o = &L->base[i]; - if (shortcut && tvisstr(o)) { - str = strVdata(o); - size = strV(o)->len; - } else if (shortcut && tvisint(o)) { - char buf[LJ_STR_INTBUF]; - char *p = lj_str_bufint(buf, intV(o)); - size = (size_t)(buf+LJ_STR_INTBUF-p); - str = p; - } else if (shortcut && tvisnum(o)) { - char buf[LJ_STR_NUMBUF]; - size = lj_str_bufnum(buf, o); - str = buf; - } else { - copyTV(L, L->top+1, o); - copyTV(L, L->top, L->top-1); - L->top += 2; - lua_call(L, 1, 1); - str = lua_tolstring(L, -1, &size); - if (!str) - lj_err_caller(L, LJ_ERR_PRTOSTR); - L->top--; - } - if (i) - putchar('\t'); - fwrite(str, 1, size, stdout); - } - putchar('\n'); - return 0; -} - -LJLIB_PUSH(top-3) -LJLIB_SET(_VERSION) - -#include "lj_libdef.h" - -/* -- Coroutine library --------------------------------------------------- */ - -#define LJLIB_MODULE_coroutine - -LJLIB_CF(coroutine_status) -{ - const char *s; - lua_State *co; - if (!(L->top > L->base && tvisthread(L->base))) - lj_err_arg(L, 1, LJ_ERR_NOCORO); - co = threadV(L->base); - if (co == L) s = "running"; - else if (co->status == LUA_YIELD) s = "suspended"; - else if (co->status != 0) s = "dead"; - else if (co->base > tvref(co->stack)+1) s = "normal"; - else if (co->top == co->base) s = "dead"; - else s = "suspended"; - lua_pushstring(L, s); - return 1; -} - -LJLIB_CF(coroutine_running) -{ -#if LJ_52 - int ismain = lua_pushthread(L); - setboolV(L->top++, ismain); - return 2; -#else - if (lua_pushthread(L)) - setnilV(L->top++); - return 1; -#endif -} - -LJLIB_CF(coroutine_create) -{ - lua_State *L1; - if (!(L->base < L->top && tvisfunc(L->base))) - lj_err_argt(L, 1, LUA_TFUNCTION); - L1 = lua_newthread(L); - setfuncV(L, L1->top++, funcV(L->base)); - return 1; -} - -LJLIB_ASM(coroutine_yield) -{ - lj_err_caller(L, LJ_ERR_CYIELD); - return FFH_UNREACHABLE; -} - -static int ffh_resume(lua_State *L, lua_State *co, int wrap) -{ - if (co->cframe != NULL || co->status > LUA_YIELD || - (co->status == 0 && co->top == co->base)) { - ErrMsg em = co->cframe ? LJ_ERR_CORUN : LJ_ERR_CODEAD; - if (wrap) lj_err_caller(L, em); - setboolV(L->base-1, 0); - setstrV(L, L->base, lj_err_str(L, em)); - return FFH_RES(2); - } - lj_state_growstack(co, (MSize)(L->top - L->base)); - return FFH_RETRY; -} - -LJLIB_ASM(coroutine_resume) -{ - if (!(L->top > L->base && tvisthread(L->base))) - lj_err_arg(L, 1, LJ_ERR_NOCORO); - return ffh_resume(L, threadV(L->base), 0); -} - -LJLIB_NOREG LJLIB_ASM(coroutine_wrap_aux) -{ - return ffh_resume(L, threadV(lj_lib_upvalue(L, 1)), 1); -} - -/* Inline declarations. */ -LJ_ASMF void lj_ff_coroutine_wrap_aux(void); -#if !(LJ_TARGET_MIPS && defined(ljamalg_c)) -LJ_FUNCA_NORET void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L, - lua_State *co); -#endif - -/* Error handler, called from assembler VM. */ -void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L, lua_State *co) -{ - co->top--; copyTV(L, L->top, co->top); L->top++; - if (tvisstr(L->top-1)) - lj_err_callermsg(L, strVdata(L->top-1)); - else - lj_err_run(L); -} - -/* Forward declaration. */ -static void setpc_wrap_aux(lua_State *L, GCfunc *fn); - -LJLIB_CF(coroutine_wrap) -{ - lj_cf_coroutine_create(L); - lj_lib_pushcc(L, lj_ffh_coroutine_wrap_aux, FF_coroutine_wrap_aux, 1); - setpc_wrap_aux(L, funcV(L->top-1)); - return 1; -} - -#include "lj_libdef.h" - -/* Fix the PC of wrap_aux. Really ugly workaround. */ -static void setpc_wrap_aux(lua_State *L, GCfunc *fn) -{ - setmref(fn->c.pc, &L2GG(L)->bcff[lj_lib_init_coroutine[1]+2]); -} - -/* ------------------------------------------------------------------------ */ - -static void newproxy_weaktable(lua_State *L) -{ - /* NOBARRIER: The table is new (marked white). */ - GCtab *t = lj_tab_new(L, 0, 1); - settabV(L, L->top++, t); - setgcref(t->metatable, obj2gco(t)); - setstrV(L, lj_tab_setstr(L, t, lj_str_newlit(L, "__mode")), - lj_str_newlit(L, "kv")); - t->nomm = (uint8_t)(~(1u<env); - settabV(L, lj_tab_setstr(L, env, lj_str_newlit(L, "_G")), env); - lua_pushliteral(L, LUA_VERSION); /* top-3. */ - newproxy_weaktable(L); /* top-2. */ - LJ_LIB_REG(L, "_G", base); - LJ_LIB_REG(L, LUA_COLIBNAME, coroutine); - return 2; -} - diff --git a/subprojects/luajit/src/lib_bit.c b/subprojects/luajit/src/lib_bit.c deleted file mode 100644 index 6dffdfac0..000000000 --- a/subprojects/luajit/src/lib_bit.c +++ /dev/null @@ -1,74 +0,0 @@ -/* -** Bit manipulation library. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lib_bit_c -#define LUA_LIB - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" - -#include "lj_obj.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_lib.h" - -/* ------------------------------------------------------------------------ */ - -#define LJLIB_MODULE_bit - -LJLIB_ASM(bit_tobit) LJLIB_REC(bit_unary IR_TOBIT) -{ - lj_lib_checknumber(L, 1); - return FFH_RETRY; -} -LJLIB_ASM_(bit_bnot) LJLIB_REC(bit_unary IR_BNOT) -LJLIB_ASM_(bit_bswap) LJLIB_REC(bit_unary IR_BSWAP) - -LJLIB_ASM(bit_lshift) LJLIB_REC(bit_shift IR_BSHL) -{ - lj_lib_checknumber(L, 1); - lj_lib_checkbit(L, 2); - return FFH_RETRY; -} -LJLIB_ASM_(bit_rshift) LJLIB_REC(bit_shift IR_BSHR) -LJLIB_ASM_(bit_arshift) LJLIB_REC(bit_shift IR_BSAR) -LJLIB_ASM_(bit_rol) LJLIB_REC(bit_shift IR_BROL) -LJLIB_ASM_(bit_ror) LJLIB_REC(bit_shift IR_BROR) - -LJLIB_ASM(bit_band) LJLIB_REC(bit_nary IR_BAND) -{ - int i = 0; - do { lj_lib_checknumber(L, ++i); } while (L->base+i < L->top); - return FFH_RETRY; -} -LJLIB_ASM_(bit_bor) LJLIB_REC(bit_nary IR_BOR) -LJLIB_ASM_(bit_bxor) LJLIB_REC(bit_nary IR_BXOR) - -/* ------------------------------------------------------------------------ */ - -LJLIB_CF(bit_tohex) -{ - uint32_t b = (uint32_t)lj_lib_checkbit(L, 1); - int32_t i, n = L->base+1 >= L->top ? 8 : lj_lib_checkbit(L, 2); - const char *hexdigits = "0123456789abcdef"; - char buf[8]; - if (n < 0) { n = -n; hexdigits = "0123456789ABCDEF"; } - if (n > 8) n = 8; - for (i = n; --i >= 0; ) { buf[i] = hexdigits[b & 15]; b >>= 4; } - lua_pushlstring(L, buf, (size_t)n); - return 1; -} - -/* ------------------------------------------------------------------------ */ - -#include "lj_libdef.h" - -LUALIB_API int luaopen_bit(lua_State *L) -{ - LJ_LIB_REG(L, LUA_BITLIBNAME, bit); - return 1; -} - diff --git a/subprojects/luajit/src/lib_debug.c b/subprojects/luajit/src/lib_debug.c deleted file mode 100644 index 54c3b7e26..000000000 --- a/subprojects/luajit/src/lib_debug.c +++ /dev/null @@ -1,405 +0,0 @@ -/* -** Debug library. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#define lib_debug_c -#define LUA_LIB - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_debug.h" -#include "lj_lib.h" - -/* ------------------------------------------------------------------------ */ - -#define LJLIB_MODULE_debug - -LJLIB_CF(debug_getregistry) -{ - copyTV(L, L->top++, registry(L)); - return 1; -} - -LJLIB_CF(debug_getmetatable) -{ - lj_lib_checkany(L, 1); - if (!lua_getmetatable(L, 1)) { - setnilV(L->top-1); - } - return 1; -} - -LJLIB_CF(debug_setmetatable) -{ - lj_lib_checktabornil(L, 2); - L->top = L->base+2; - lua_setmetatable(L, 1); -#if !LJ_52 - setboolV(L->top-1, 1); -#endif - return 1; -} - -LJLIB_CF(debug_getfenv) -{ - lj_lib_checkany(L, 1); - lua_getfenv(L, 1); - return 1; -} - -LJLIB_CF(debug_setfenv) -{ - lj_lib_checktab(L, 2); - L->top = L->base+2; - if (!lua_setfenv(L, 1)) - lj_err_caller(L, LJ_ERR_SETFENV); - return 1; -} - -/* ------------------------------------------------------------------------ */ - -static void settabss(lua_State *L, const char *i, const char *v) -{ - lua_pushstring(L, v); - lua_setfield(L, -2, i); -} - -static void settabsi(lua_State *L, const char *i, int v) -{ - lua_pushinteger(L, v); - lua_setfield(L, -2, i); -} - -static void settabsb(lua_State *L, const char *i, int v) -{ - lua_pushboolean(L, v); - lua_setfield(L, -2, i); -} - -static lua_State *getthread(lua_State *L, int *arg) -{ - if (L->base < L->top && tvisthread(L->base)) { - *arg = 1; - return threadV(L->base); - } else { - *arg = 0; - return L; - } -} - -static void treatstackoption(lua_State *L, lua_State *L1, const char *fname) -{ - if (L == L1) { - lua_pushvalue(L, -2); - lua_remove(L, -3); - } - else - lua_xmove(L1, L, 1); - lua_setfield(L, -2, fname); -} - -LJLIB_CF(debug_getinfo) -{ - lj_Debug ar; - int arg, opt_f = 0, opt_L = 0; - lua_State *L1 = getthread(L, &arg); - const char *options = luaL_optstring(L, arg+2, "flnSu"); - if (lua_isnumber(L, arg+1)) { - if (!lua_getstack(L1, (int)lua_tointeger(L, arg+1), (lua_Debug *)&ar)) { - setnilV(L->top-1); - return 1; - } - } else if (L->base+arg < L->top && tvisfunc(L->base+arg)) { - options = lua_pushfstring(L, ">%s", options); - setfuncV(L1, L1->top++, funcV(L->base+arg)); - } else { - lj_err_arg(L, arg+1, LJ_ERR_NOFUNCL); - } - if (!lj_debug_getinfo(L1, options, &ar, 1)) - lj_err_arg(L, arg+2, LJ_ERR_INVOPT); - lua_createtable(L, 0, 16); /* Create result table. */ - for (; *options; options++) { - switch (*options) { - case 'S': - settabss(L, "source", ar.source); - settabss(L, "short_src", ar.short_src); - settabsi(L, "linedefined", ar.linedefined); - settabsi(L, "lastlinedefined", ar.lastlinedefined); - settabss(L, "what", ar.what); - break; - case 'l': - settabsi(L, "currentline", ar.currentline); - break; - case 'u': - settabsi(L, "nups", ar.nups); - settabsi(L, "nparams", ar.nparams); - settabsb(L, "isvararg", ar.isvararg); - break; - case 'n': - settabss(L, "name", ar.name); - settabss(L, "namewhat", ar.namewhat); - break; - case 'f': opt_f = 1; break; - case 'L': opt_L = 1; break; - default: break; - } - } - if (opt_L) treatstackoption(L, L1, "activelines"); - if (opt_f) treatstackoption(L, L1, "func"); - return 1; /* Return result table. */ -} - -LJLIB_CF(debug_getlocal) -{ - int arg; - lua_State *L1 = getthread(L, &arg); - lua_Debug ar; - const char *name; - int slot = lj_lib_checkint(L, arg+2); - if (tvisfunc(L->base+arg)) { - L->top = L->base+arg+1; - lua_pushstring(L, lua_getlocal(L, NULL, slot)); - return 1; - } - if (!lua_getstack(L1, lj_lib_checkint(L, arg+1), &ar)) - lj_err_arg(L, arg+1, LJ_ERR_LVLRNG); - name = lua_getlocal(L1, &ar, slot); - if (name) { - lua_xmove(L1, L, 1); - lua_pushstring(L, name); - lua_pushvalue(L, -2); - return 2; - } else { - setnilV(L->top-1); - return 1; - } -} - -LJLIB_CF(debug_setlocal) -{ - int arg; - lua_State *L1 = getthread(L, &arg); - lua_Debug ar; - TValue *tv; - if (!lua_getstack(L1, lj_lib_checkint(L, arg+1), &ar)) - lj_err_arg(L, arg+1, LJ_ERR_LVLRNG); - tv = lj_lib_checkany(L, arg+3); - copyTV(L1, L1->top++, tv); - lua_pushstring(L, lua_setlocal(L1, &ar, lj_lib_checkint(L, arg+2))); - return 1; -} - -static int debug_getupvalue(lua_State *L, int get) -{ - int32_t n = lj_lib_checkint(L, 2); - const char *name; - lj_lib_checkfunc(L, 1); - name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n); - if (name) { - lua_pushstring(L, name); - if (!get) return 1; - copyTV(L, L->top, L->top-2); - L->top++; - return 2; - } - return 0; -} - -LJLIB_CF(debug_getupvalue) -{ - return debug_getupvalue(L, 1); -} - -LJLIB_CF(debug_setupvalue) -{ - lj_lib_checkany(L, 3); - return debug_getupvalue(L, 0); -} - -LJLIB_CF(debug_upvalueid) -{ - GCfunc *fn = lj_lib_checkfunc(L, 1); - int32_t n = lj_lib_checkint(L, 2) - 1; - if ((uint32_t)n >= fn->l.nupvalues) - lj_err_arg(L, 2, LJ_ERR_IDXRNG); - setlightudV(L->top-1, isluafunc(fn) ? (void *)gcref(fn->l.uvptr[n]) : - (void *)&fn->c.upvalue[n]); - return 1; -} - -LJLIB_CF(debug_upvaluejoin) -{ - GCfunc *fn[2]; - GCRef *p[2]; - int i; - for (i = 0; i < 2; i++) { - int32_t n; - fn[i] = lj_lib_checkfunc(L, 2*i+1); - if (!isluafunc(fn[i])) - lj_err_arg(L, 2*i+1, LJ_ERR_NOLFUNC); - n = lj_lib_checkint(L, 2*i+2) - 1; - if ((uint32_t)n >= fn[i]->l.nupvalues) - lj_err_arg(L, 2*i+2, LJ_ERR_IDXRNG); - p[i] = &fn[i]->l.uvptr[n]; - } - setgcrefr(*p[0], *p[1]); - lj_gc_objbarrier(L, fn[0], gcref(*p[1])); - return 0; -} - -#if LJ_52 -LJLIB_CF(debug_getuservalue) -{ - TValue *o = L->base; - if (o < L->top && tvisudata(o)) - settabV(L, o, tabref(udataV(o)->env)); - else - setnilV(o); - L->top = o+1; - return 1; -} - -LJLIB_CF(debug_setuservalue) -{ - TValue *o = L->base; - if (!(o < L->top && tvisudata(o))) - lj_err_argt(L, 1, LUA_TUSERDATA); - if (!(o+1 < L->top && tvistab(o+1))) - lj_err_argt(L, 2, LUA_TTABLE); - L->top = o+2; - lua_setfenv(L, 1); - return 1; -} -#endif - -/* ------------------------------------------------------------------------ */ - -static const char KEY_HOOK = 'h'; - -static void hookf(lua_State *L, lua_Debug *ar) -{ - static const char *const hooknames[] = - {"call", "return", "line", "count", "tail return"}; - lua_pushlightuserdata(L, (void *)&KEY_HOOK); - lua_rawget(L, LUA_REGISTRYINDEX); - if (lua_isfunction(L, -1)) { - lua_pushstring(L, hooknames[(int)ar->event]); - if (ar->currentline >= 0) - lua_pushinteger(L, ar->currentline); - else lua_pushnil(L); - lua_call(L, 2, 0); - } -} - -static int makemask(const char *smask, int count) -{ - int mask = 0; - if (strchr(smask, 'c')) mask |= LUA_MASKCALL; - if (strchr(smask, 'r')) mask |= LUA_MASKRET; - if (strchr(smask, 'l')) mask |= LUA_MASKLINE; - if (count > 0) mask |= LUA_MASKCOUNT; - return mask; -} - -static char *unmakemask(int mask, char *smask) -{ - int i = 0; - if (mask & LUA_MASKCALL) smask[i++] = 'c'; - if (mask & LUA_MASKRET) smask[i++] = 'r'; - if (mask & LUA_MASKLINE) smask[i++] = 'l'; - smask[i] = '\0'; - return smask; -} - -LJLIB_CF(debug_sethook) -{ - int arg, mask, count; - lua_Hook func; - (void)getthread(L, &arg); - if (lua_isnoneornil(L, arg+1)) { - lua_settop(L, arg+1); - func = NULL; mask = 0; count = 0; /* turn off hooks */ - } else { - const char *smask = luaL_checkstring(L, arg+2); - luaL_checktype(L, arg+1, LUA_TFUNCTION); - count = luaL_optint(L, arg+3, 0); - func = hookf; mask = makemask(smask, count); - } - lua_pushlightuserdata(L, (void *)&KEY_HOOK); - lua_pushvalue(L, arg+1); - lua_rawset(L, LUA_REGISTRYINDEX); - lua_sethook(L, func, mask, count); - return 0; -} - -LJLIB_CF(debug_gethook) -{ - char buff[5]; - int mask = lua_gethookmask(L); - lua_Hook hook = lua_gethook(L); - if (hook != NULL && hook != hookf) { /* external hook? */ - lua_pushliteral(L, "external hook"); - } else { - lua_pushlightuserdata(L, (void *)&KEY_HOOK); - lua_rawget(L, LUA_REGISTRYINDEX); /* get hook */ - } - lua_pushstring(L, unmakemask(mask, buff)); - lua_pushinteger(L, lua_gethookcount(L)); - return 3; -} - -/* ------------------------------------------------------------------------ */ - -LJLIB_CF(debug_debug) -{ - for (;;) { - char buffer[250]; - fputs("lua_debug> ", stderr); - if (fgets(buffer, sizeof(buffer), stdin) == 0 || - strcmp(buffer, "cont\n") == 0) - return 0; - if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || - lua_pcall(L, 0, 0, 0)) { - fputs(lua_tostring(L, -1), stderr); - fputs("\n", stderr); - } - lua_settop(L, 0); /* remove eventual returns */ - } -} - -/* ------------------------------------------------------------------------ */ - -#define LEVELS1 12 /* size of the first part of the stack */ -#define LEVELS2 10 /* size of the second part of the stack */ - -LJLIB_CF(debug_traceback) -{ - int arg; - lua_State *L1 = getthread(L, &arg); - const char *msg = lua_tostring(L, arg+1); - if (msg == NULL && L->top > L->base+arg) - L->top = L->base+arg+1; - else - luaL_traceback(L, L1, msg, lj_lib_optint(L, arg+2, (L == L1))); - return 1; -} - -/* ------------------------------------------------------------------------ */ - -#include "lj_libdef.h" - -LUALIB_API int luaopen_debug(lua_State *L) -{ - LJ_LIB_REG(L, LUA_DBLIBNAME, debug); - return 1; -} - diff --git a/subprojects/luajit/src/lib_ffi.c b/subprojects/luajit/src/lib_ffi.c deleted file mode 100644 index f2f2ede45..000000000 --- a/subprojects/luajit/src/lib_ffi.c +++ /dev/null @@ -1,851 +0,0 @@ -/* -** FFI library. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lib_ffi_c -#define LUA_LIB - -#include - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" - -#include "lj_obj.h" - -#if LJ_HASFFI - -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_meta.h" -#include "lj_ctype.h" -#include "lj_cparse.h" -#include "lj_cdata.h" -#include "lj_cconv.h" -#include "lj_carith.h" -#include "lj_ccall.h" -#include "lj_ccallback.h" -#include "lj_clib.h" -#include "lj_ff.h" -#include "lj_lib.h" - -/* -- C type checks ------------------------------------------------------- */ - -/* Check first argument for a C type and returns its ID. */ -static CTypeID ffi_checkctype(lua_State *L, CTState *cts, TValue *param) -{ - TValue *o = L->base; - if (!(o < L->top)) { - err_argtype: - lj_err_argtype(L, 1, "C type"); - } - if (tvisstr(o)) { /* Parse an abstract C type declaration. */ - GCstr *s = strV(o); - CPState cp; - int errcode; - cp.L = L; - cp.cts = cts; - cp.srcname = strdata(s); - cp.p = strdata(s); - cp.param = param; - cp.mode = CPARSE_MODE_ABSTRACT|CPARSE_MODE_NOIMPLICIT; - errcode = lj_cparse(&cp); - if (errcode) lj_err_throw(L, errcode); /* Propagate errors. */ - return cp.val.id; - } else { - GCcdata *cd; - if (!tviscdata(o)) goto err_argtype; - if (param && param < L->top) lj_err_arg(L, 1, LJ_ERR_FFI_NUMPARAM); - cd = cdataV(o); - return cd->ctypeid == CTID_CTYPEID ? *(CTypeID *)cdataptr(cd) : cd->ctypeid; - } -} - -/* Check argument for C data and return it. */ -static GCcdata *ffi_checkcdata(lua_State *L, int narg) -{ - TValue *o = L->base + narg-1; - if (!(o < L->top && tviscdata(o))) - lj_err_argt(L, narg, LUA_TCDATA); - return cdataV(o); -} - -/* Convert argument to C pointer. */ -static void *ffi_checkptr(lua_State *L, int narg, CTypeID id) -{ - CTState *cts = ctype_cts(L); - TValue *o = L->base + narg-1; - void *p; - if (o >= L->top) - lj_err_arg(L, narg, LJ_ERR_NOVAL); - lj_cconv_ct_tv(cts, ctype_get(cts, id), (uint8_t *)&p, o, CCF_ARG(narg)); - return p; -} - -/* Convert argument to int32_t. */ -static int32_t ffi_checkint(lua_State *L, int narg) -{ - CTState *cts = ctype_cts(L); - TValue *o = L->base + narg-1; - int32_t i; - if (o >= L->top) - lj_err_arg(L, narg, LJ_ERR_NOVAL); - lj_cconv_ct_tv(cts, ctype_get(cts, CTID_INT32), (uint8_t *)&i, o, - CCF_ARG(narg)); - return i; -} - -/* -- C type metamethods -------------------------------------------------- */ - -#define LJLIB_MODULE_ffi_meta - -/* Handle ctype __index/__newindex metamethods. */ -static int ffi_index_meta(lua_State *L, CTState *cts, CType *ct, MMS mm) -{ - CTypeID id = ctype_typeid(cts, ct); - cTValue *tv = lj_ctype_meta(cts, id, mm); - TValue *base = L->base; - if (!tv) { - const char *s; - err_index: - s = strdata(lj_ctype_repr(L, id, NULL)); - if (tvisstr(L->base+1)) { - lj_err_callerv(L, LJ_ERR_FFI_BADMEMBER, s, strVdata(L->base+1)); - } else { - const char *key = tviscdata(L->base+1) ? - strdata(lj_ctype_repr(L, cdataV(L->base+1)->ctypeid, NULL)) : - lj_typename(L->base+1); - lj_err_callerv(L, LJ_ERR_FFI_BADIDXW, s, key); - } - } - if (!tvisfunc(tv)) { - if (mm == MM_index) { - cTValue *o = lj_meta_tget(L, tv, base+1); - if (o) { - if (tvisnil(o)) goto err_index; - copyTV(L, L->top-1, o); - return 1; - } - } else { - TValue *o = lj_meta_tset(L, tv, base+1); - if (o) { - copyTV(L, o, base+2); - return 0; - } - } - copyTV(L, base, L->top); - tv = L->top-1; - } - return lj_meta_tailcall(L, tv); -} - -LJLIB_CF(ffi_meta___index) LJLIB_REC(cdata_index 0) -{ - CTState *cts = ctype_cts(L); - CTInfo qual = 0; - CType *ct; - uint8_t *p; - TValue *o = L->base; - if (!(o+1 < L->top && tviscdata(o))) /* Also checks for presence of key. */ - lj_err_argt(L, 1, LUA_TCDATA); - ct = lj_cdata_index(cts, cdataV(o), o+1, &p, &qual); - if ((qual & 1)) - return ffi_index_meta(L, cts, ct, MM_index); - if (lj_cdata_get(cts, ct, L->top-1, p)) - lj_gc_check(L); - return 1; -} - -LJLIB_CF(ffi_meta___newindex) LJLIB_REC(cdata_index 1) -{ - CTState *cts = ctype_cts(L); - CTInfo qual = 0; - CType *ct; - uint8_t *p; - TValue *o = L->base; - if (!(o+2 < L->top && tviscdata(o))) /* Also checks for key and value. */ - lj_err_argt(L, 1, LUA_TCDATA); - ct = lj_cdata_index(cts, cdataV(o), o+1, &p, &qual); - if ((qual & 1)) { - if ((qual & CTF_CONST)) - lj_err_caller(L, LJ_ERR_FFI_WRCONST); - return ffi_index_meta(L, cts, ct, MM_newindex); - } - lj_cdata_set(cts, ct, p, o+2, qual); - return 0; -} - -/* Common handler for cdata arithmetic. */ -static int ffi_arith(lua_State *L) -{ - MMS mm = (MMS)(curr_func(L)->c.ffid - (int)FF_ffi_meta___eq + (int)MM_eq); - return lj_carith_op(L, mm); -} - -/* The following functions must be in contiguous ORDER MM. */ -LJLIB_CF(ffi_meta___eq) LJLIB_REC(cdata_arith MM_eq) -{ - return ffi_arith(L); -} - -LJLIB_CF(ffi_meta___len) LJLIB_REC(cdata_arith MM_len) -{ - return ffi_arith(L); -} - -LJLIB_CF(ffi_meta___lt) LJLIB_REC(cdata_arith MM_lt) -{ - return ffi_arith(L); -} - -LJLIB_CF(ffi_meta___le) LJLIB_REC(cdata_arith MM_le) -{ - return ffi_arith(L); -} - -LJLIB_CF(ffi_meta___concat) LJLIB_REC(cdata_arith MM_concat) -{ - return ffi_arith(L); -} - -/* Forward declaration. */ -static int lj_cf_ffi_new(lua_State *L); - -LJLIB_CF(ffi_meta___call) LJLIB_REC(cdata_call) -{ - CTState *cts = ctype_cts(L); - GCcdata *cd = ffi_checkcdata(L, 1); - CTypeID id = cd->ctypeid; - CType *ct; - cTValue *tv; - MMS mm = MM_call; - if (cd->ctypeid == CTID_CTYPEID) { - id = *(CTypeID *)cdataptr(cd); - mm = MM_new; - } else { - int ret = lj_ccall_func(L, cd); - if (ret >= 0) - return ret; - } - /* Handle ctype __call/__new metamethod. */ - ct = ctype_raw(cts, id); - if (ctype_isptr(ct->info)) id = ctype_cid(ct->info); - tv = lj_ctype_meta(cts, id, mm); - if (tv) - return lj_meta_tailcall(L, tv); - else if (mm == MM_call) - lj_err_callerv(L, LJ_ERR_FFI_BADCALL, strdata(lj_ctype_repr(L, id, NULL))); - return lj_cf_ffi_new(L); -} - -LJLIB_CF(ffi_meta___add) LJLIB_REC(cdata_arith MM_add) -{ - return ffi_arith(L); -} - -LJLIB_CF(ffi_meta___sub) LJLIB_REC(cdata_arith MM_sub) -{ - return ffi_arith(L); -} - -LJLIB_CF(ffi_meta___mul) LJLIB_REC(cdata_arith MM_mul) -{ - return ffi_arith(L); -} - -LJLIB_CF(ffi_meta___div) LJLIB_REC(cdata_arith MM_div) -{ - return ffi_arith(L); -} - -LJLIB_CF(ffi_meta___mod) LJLIB_REC(cdata_arith MM_mod) -{ - return ffi_arith(L); -} - -LJLIB_CF(ffi_meta___pow) LJLIB_REC(cdata_arith MM_pow) -{ - return ffi_arith(L); -} - -LJLIB_CF(ffi_meta___unm) LJLIB_REC(cdata_arith MM_unm) -{ - return ffi_arith(L); -} -/* End of contiguous ORDER MM. */ - -LJLIB_CF(ffi_meta___tostring) -{ - GCcdata *cd = ffi_checkcdata(L, 1); - const char *msg = "cdata<%s>: %p"; - CTypeID id = cd->ctypeid; - void *p = cdataptr(cd); - if (id == CTID_CTYPEID) { - msg = "ctype<%s>"; - id = *(CTypeID *)p; - } else { - CTState *cts = ctype_cts(L); - CType *ct = ctype_raw(cts, id); - if (ctype_isref(ct->info)) { - p = *(void **)p; - ct = ctype_rawchild(cts, ct); - } - if (ctype_iscomplex(ct->info)) { - setstrV(L, L->top-1, lj_ctype_repr_complex(L, cdataptr(cd), ct->size)); - goto checkgc; - } else if (ct->size == 8 && ctype_isinteger(ct->info)) { - setstrV(L, L->top-1, lj_ctype_repr_int64(L, *(uint64_t *)cdataptr(cd), - (ct->info & CTF_UNSIGNED))); - goto checkgc; - } else if (ctype_isfunc(ct->info)) { - p = *(void **)p; - } else if (ctype_isenum(ct->info)) { - msg = "cdata<%s>: %d"; - p = (void *)(uintptr_t)*(uint32_t **)p; - } else { - if (ctype_isptr(ct->info)) { - p = cdata_getptr(p, ct->size); - ct = ctype_rawchild(cts, ct); - } - if (ctype_isstruct(ct->info) || ctype_isvector(ct->info)) { - /* Handle ctype __tostring metamethod. */ - cTValue *tv = lj_ctype_meta(cts, ctype_typeid(cts, ct), MM_tostring); - if (tv) - return lj_meta_tailcall(L, tv); - } - } - } - lj_str_pushf(L, msg, strdata(lj_ctype_repr(L, id, NULL)), p); -checkgc: - lj_gc_check(L); - return 1; -} - -static int ffi_pairs(lua_State *L, MMS mm) -{ - CTState *cts = ctype_cts(L); - CTypeID id = ffi_checkcdata(L, 1)->ctypeid; - CType *ct = ctype_raw(cts, id); - cTValue *tv; - if (ctype_isptr(ct->info)) id = ctype_cid(ct->info); - tv = lj_ctype_meta(cts, id, mm); - if (!tv) - lj_err_callerv(L, LJ_ERR_FFI_BADMM, strdata(lj_ctype_repr(L, id, NULL)), - strdata(mmname_str(G(L), mm))); - return lj_meta_tailcall(L, tv); -} - -LJLIB_CF(ffi_meta___pairs) -{ - return ffi_pairs(L, MM_pairs); -} - -LJLIB_CF(ffi_meta___ipairs) -{ - return ffi_pairs(L, MM_ipairs); -} - -LJLIB_PUSH("ffi") LJLIB_SET(__metatable) - -#include "lj_libdef.h" - -/* -- C library metamethods ----------------------------------------------- */ - -#define LJLIB_MODULE_ffi_clib - -/* Index C library by a name. */ -static TValue *ffi_clib_index(lua_State *L) -{ - TValue *o = L->base; - CLibrary *cl; - if (!(o < L->top && tvisudata(o) && udataV(o)->udtype == UDTYPE_FFI_CLIB)) - lj_err_argt(L, 1, LUA_TUSERDATA); - cl = (CLibrary *)uddata(udataV(o)); - if (!(o+1 < L->top && tvisstr(o+1))) - lj_err_argt(L, 2, LUA_TSTRING); - return lj_clib_index(L, cl, strV(o+1)); -} - -LJLIB_CF(ffi_clib___index) LJLIB_REC(clib_index 1) -{ - TValue *tv = ffi_clib_index(L); - if (tviscdata(tv)) { - CTState *cts = ctype_cts(L); - GCcdata *cd = cdataV(tv); - CType *s = ctype_get(cts, cd->ctypeid); - if (ctype_isextern(s->info)) { - CTypeID sid = ctype_cid(s->info); - void *sp = *(void **)cdataptr(cd); - CType *ct = ctype_raw(cts, sid); - if (lj_cconv_tv_ct(cts, ct, sid, L->top-1, sp)) - lj_gc_check(L); - return 1; - } - } - copyTV(L, L->top-1, tv); - return 1; -} - -LJLIB_CF(ffi_clib___newindex) LJLIB_REC(clib_index 0) -{ - TValue *tv = ffi_clib_index(L); - TValue *o = L->base+2; - if (o < L->top && tviscdata(tv)) { - CTState *cts = ctype_cts(L); - GCcdata *cd = cdataV(tv); - CType *d = ctype_get(cts, cd->ctypeid); - if (ctype_isextern(d->info)) { - CTInfo qual = 0; - for (;;) { /* Skip attributes and collect qualifiers. */ - d = ctype_child(cts, d); - if (!ctype_isattrib(d->info)) break; - if (ctype_attrib(d->info) == CTA_QUAL) qual |= d->size; - } - if (!((d->info|qual) & CTF_CONST)) { - lj_cconv_ct_tv(cts, d, *(void **)cdataptr(cd), o, 0); - return 0; - } - } - } - lj_err_caller(L, LJ_ERR_FFI_WRCONST); - return 0; /* unreachable */ -} - -LJLIB_CF(ffi_clib___gc) -{ - TValue *o = L->base; - if (o < L->top && tvisudata(o) && udataV(o)->udtype == UDTYPE_FFI_CLIB) - lj_clib_unload((CLibrary *)uddata(udataV(o))); - return 0; -} - -#include "lj_libdef.h" - -/* -- Callback function metamethods --------------------------------------- */ - -#define LJLIB_MODULE_ffi_callback - -static int ffi_callback_set(lua_State *L, GCfunc *fn) -{ - GCcdata *cd = ffi_checkcdata(L, 1); - CTState *cts = ctype_cts(L); - CType *ct = ctype_raw(cts, cd->ctypeid); - if (ctype_isptr(ct->info) && (LJ_32 || ct->size == 8)) { - MSize slot = lj_ccallback_ptr2slot(cts, *(void **)cdataptr(cd)); - if (slot < cts->cb.sizeid && cts->cb.cbid[slot] != 0) { - GCtab *t = cts->miscmap; - TValue *tv = lj_tab_setint(L, t, (int32_t)slot); - if (fn) { - setfuncV(L, tv, fn); - lj_gc_anybarriert(L, t); - } else { - setnilV(tv); - cts->cb.cbid[slot] = 0; - cts->cb.topid = slot < cts->cb.topid ? slot : cts->cb.topid; - } - return 0; - } - } - lj_err_caller(L, LJ_ERR_FFI_BADCBACK); - return 0; -} - -LJLIB_CF(ffi_callback_free) -{ - return ffi_callback_set(L, NULL); -} - -LJLIB_CF(ffi_callback_set) -{ - GCfunc *fn = lj_lib_checkfunc(L, 2); - return ffi_callback_set(L, fn); -} - -LJLIB_PUSH(top-1) LJLIB_SET(__index) - -#include "lj_libdef.h" - -/* -- FFI library functions ----------------------------------------------- */ - -#define LJLIB_MODULE_ffi - -LJLIB_CF(ffi_cdef) -{ - GCstr *s = lj_lib_checkstr(L, 1); - CPState cp; - int errcode; - cp.L = L; - cp.cts = ctype_cts(L); - cp.srcname = strdata(s); - cp.p = strdata(s); - cp.param = L->base+1; - cp.mode = CPARSE_MODE_MULTI|CPARSE_MODE_DIRECT; - errcode = lj_cparse(&cp); - if (errcode) lj_err_throw(L, errcode); /* Propagate errors. */ - lj_gc_check(L); - return 0; -} - -LJLIB_CF(ffi_new) LJLIB_REC(.) -{ - CTState *cts = ctype_cts(L); - CTypeID id = ffi_checkctype(L, cts, NULL); - CType *ct = ctype_raw(cts, id); - CTSize sz; - CTInfo info = lj_ctype_info(cts, id, &sz); - TValue *o = L->base+1; - GCcdata *cd; - if ((info & CTF_VLA)) { - o++; - sz = lj_ctype_vlsize(cts, ct, (CTSize)ffi_checkint(L, 2)); - } - if (sz == CTSIZE_INVALID) - lj_err_arg(L, 1, LJ_ERR_FFI_INVSIZE); - if (!(info & CTF_VLA) && ctype_align(info) <= CT_MEMALIGN) - cd = lj_cdata_new(cts, id, sz); - else - cd = lj_cdata_newv(cts, id, sz, ctype_align(info)); - setcdataV(L, o-1, cd); /* Anchor the uninitialized cdata. */ - lj_cconv_ct_init(cts, ct, sz, cdataptr(cd), - o, (MSize)(L->top - o)); /* Initialize cdata. */ - if (ctype_isstruct(ct->info)) { - /* Handle ctype __gc metamethod. Use the fast lookup here. */ - cTValue *tv = lj_tab_getinth(cts->miscmap, -(int32_t)id); - if (tv && tvistab(tv) && (tv = lj_meta_fast(L, tabV(tv), MM_gc))) { - GCtab *t = cts->finalizer; - if (gcref(t->metatable)) { - /* Add to finalizer table, if still enabled. */ - copyTV(L, lj_tab_set(L, t, o-1), tv); - lj_gc_anybarriert(L, t); - cd->marked |= LJ_GC_CDATA_FIN; - } - } - } - L->top = o; /* Only return the cdata itself. */ - lj_gc_check(L); - return 1; -} - -LJLIB_CF(ffi_cast) LJLIB_REC(ffi_new) -{ - CTState *cts = ctype_cts(L); - CTypeID id = ffi_checkctype(L, cts, NULL); - CType *d = ctype_raw(cts, id); - TValue *o = lj_lib_checkany(L, 2); - L->top = o+1; /* Make sure this is the last item on the stack. */ - if (!(ctype_isnum(d->info) || ctype_isptr(d->info) || ctype_isenum(d->info))) - lj_err_arg(L, 1, LJ_ERR_FFI_INVTYPE); - if (!(tviscdata(o) && cdataV(o)->ctypeid == id)) { - GCcdata *cd = lj_cdata_new(cts, id, d->size); - lj_cconv_ct_tv(cts, d, cdataptr(cd), o, CCF_CAST); - setcdataV(L, o, cd); - lj_gc_check(L); - } - return 1; -} - -LJLIB_CF(ffi_typeof) LJLIB_REC(.) -{ - CTState *cts = ctype_cts(L); - CTypeID id = ffi_checkctype(L, cts, L->base+1); - GCcdata *cd = lj_cdata_new(cts, CTID_CTYPEID, 4); - *(CTypeID *)cdataptr(cd) = id; - setcdataV(L, L->top-1, cd); - lj_gc_check(L); - return 1; -} - -LJLIB_CF(ffi_istype) LJLIB_REC(.) -{ - CTState *cts = ctype_cts(L); - CTypeID id1 = ffi_checkctype(L, cts, NULL); - TValue *o = lj_lib_checkany(L, 2); - int b = 0; - if (tviscdata(o)) { - GCcdata *cd = cdataV(o); - CTypeID id2 = cd->ctypeid == CTID_CTYPEID ? *(CTypeID *)cdataptr(cd) : - cd->ctypeid; - CType *ct1 = lj_ctype_rawref(cts, id1); - CType *ct2 = lj_ctype_rawref(cts, id2); - if (ct1 == ct2) { - b = 1; - } else if (ctype_type(ct1->info) == ctype_type(ct2->info) && - ct1->size == ct2->size) { - if (ctype_ispointer(ct1->info)) - b = lj_cconv_compatptr(cts, ct1, ct2, CCF_IGNQUAL); - else if (ctype_isnum(ct1->info) || ctype_isvoid(ct1->info)) - b = (((ct1->info ^ ct2->info) & ~(CTF_QUAL|CTF_LONG)) == 0); - } else if (ctype_isstruct(ct1->info) && ctype_isptr(ct2->info) && - ct1 == ctype_rawchild(cts, ct2)) { - b = 1; - } - } - setboolV(L->top-1, b); - setboolV(&G(L)->tmptv2, b); /* Remember for trace recorder. */ - return 1; -} - -LJLIB_CF(ffi_sizeof) LJLIB_REC(ffi_xof FF_ffi_sizeof) -{ - CTState *cts = ctype_cts(L); - CTypeID id = ffi_checkctype(L, cts, NULL); - CTSize sz; - if (LJ_UNLIKELY(tviscdata(L->base) && cdataisv(cdataV(L->base)))) { - sz = cdatavlen(cdataV(L->base)); - } else { - CType *ct = lj_ctype_rawref(cts, id); - if (ctype_isvltype(ct->info)) - sz = lj_ctype_vlsize(cts, ct, (CTSize)ffi_checkint(L, 2)); - else - sz = ctype_hassize(ct->info) ? ct->size : CTSIZE_INVALID; - if (LJ_UNLIKELY(sz == CTSIZE_INVALID)) { - setnilV(L->top-1); - return 1; - } - } - setintV(L->top-1, (int32_t)sz); - return 1; -} - -LJLIB_CF(ffi_alignof) LJLIB_REC(ffi_xof FF_ffi_alignof) -{ - CTState *cts = ctype_cts(L); - CTypeID id = ffi_checkctype(L, cts, NULL); - CTSize sz = 0; - CTInfo info = lj_ctype_info(cts, id, &sz); - setintV(L->top-1, 1 << ctype_align(info)); - return 1; -} - -LJLIB_CF(ffi_offsetof) LJLIB_REC(ffi_xof FF_ffi_offsetof) -{ - CTState *cts = ctype_cts(L); - CTypeID id = ffi_checkctype(L, cts, NULL); - GCstr *name = lj_lib_checkstr(L, 2); - CType *ct = lj_ctype_rawref(cts, id); - CTSize ofs; - if (ctype_isstruct(ct->info) && ct->size != CTSIZE_INVALID) { - CType *fct = lj_ctype_getfield(cts, ct, name, &ofs); - if (fct) { - setintV(L->top-1, ofs); - if (ctype_isfield(fct->info)) { - return 1; - } else if (ctype_isbitfield(fct->info)) { - setintV(L->top++, ctype_bitpos(fct->info)); - setintV(L->top++, ctype_bitbsz(fct->info)); - return 3; - } - } - } - return 0; -} - -LJLIB_CF(ffi_errno) LJLIB_REC(.) -{ - int err = errno; - if (L->top > L->base) - errno = ffi_checkint(L, 1); - setintV(L->top++, err); - return 1; -} - -LJLIB_CF(ffi_string) LJLIB_REC(.) -{ - CTState *cts = ctype_cts(L); - TValue *o = lj_lib_checkany(L, 1); - const char *p; - size_t len; - if (o+1 < L->top && !tvisnil(o+1)) { - len = (size_t)ffi_checkint(L, 2); - lj_cconv_ct_tv(cts, ctype_get(cts, CTID_P_CVOID), (uint8_t *)&p, o, - CCF_ARG(1)); - } else { - lj_cconv_ct_tv(cts, ctype_get(cts, CTID_P_CCHAR), (uint8_t *)&p, o, - CCF_ARG(1)); - len = strlen(p); - } - L->top = o+1; /* Make sure this is the last item on the stack. */ - setstrV(L, o, lj_str_new(L, p, len)); - lj_gc_check(L); - return 1; -} - -LJLIB_CF(ffi_copy) LJLIB_REC(.) -{ - void *dp = ffi_checkptr(L, 1, CTID_P_VOID); - void *sp = ffi_checkptr(L, 2, CTID_P_CVOID); - TValue *o = L->base+1; - CTSize len; - if (tvisstr(o) && o+1 >= L->top) - len = strV(o)->len+1; /* Copy Lua string including trailing '\0'. */ - else - len = (CTSize)ffi_checkint(L, 3); - memcpy(dp, sp, len); - return 0; -} - -LJLIB_CF(ffi_fill) LJLIB_REC(.) -{ - void *dp = ffi_checkptr(L, 1, CTID_P_VOID); - CTSize len = (CTSize)ffi_checkint(L, 2); - int32_t fill = 0; - if (L->base+2 < L->top && !tvisnil(L->base+2)) fill = ffi_checkint(L, 3); - memset(dp, fill, len); - return 0; -} - -#define H_(le, be) LJ_ENDIAN_SELECT(0x##le, 0x##be) - -/* Test ABI string. */ -LJLIB_CF(ffi_abi) LJLIB_REC(.) -{ - GCstr *s = lj_lib_checkstr(L, 1); - int b = 0; - switch (s->hash) { -#if LJ_64 - case H_(849858eb,ad35fd06): b = 1; break; /* 64bit */ -#else - case H_(662d3c79,d0e22477): b = 1; break; /* 32bit */ -#endif -#if LJ_ARCH_HASFPU - case H_(e33ee463,e33ee463): b = 1; break; /* fpu */ -#endif -#if LJ_ABI_SOFTFP - case H_(61211a23,c2e8c81c): b = 1; break; /* softfp */ -#else - case H_(539417a8,8ce0812f): b = 1; break; /* hardfp */ -#endif -#if LJ_ABI_EABI - case H_(2182df8f,f2ed1152): b = 1; break; /* eabi */ -#endif -#if LJ_ABI_WIN - case H_(4ab624a8,4ab624a8): b = 1; break; /* win */ -#endif - case H_(3af93066,1f001464): b = 1; break; /* le/be */ - default: - break; - } - setboolV(L->top-1, b); - setboolV(&G(L)->tmptv2, b); /* Remember for trace recorder. */ - return 1; -} - -#undef H_ - -LJLIB_PUSH(top-8) LJLIB_SET(!) /* Store reference to miscmap table. */ - -LJLIB_CF(ffi_metatype) -{ - CTState *cts = ctype_cts(L); - CTypeID id = ffi_checkctype(L, cts, NULL); - GCtab *mt = lj_lib_checktab(L, 2); - GCtab *t = cts->miscmap; - CType *ct = ctype_get(cts, id); /* Only allow raw types. */ - TValue *tv; - GCcdata *cd; - if (!(ctype_isstruct(ct->info) || ctype_iscomplex(ct->info) || - ctype_isvector(ct->info))) - lj_err_arg(L, 1, LJ_ERR_FFI_INVTYPE); - tv = lj_tab_setinth(L, t, -(int32_t)id); - if (!tvisnil(tv)) - lj_err_caller(L, LJ_ERR_PROTMT); - settabV(L, tv, mt); - lj_gc_anybarriert(L, t); - cd = lj_cdata_new(cts, CTID_CTYPEID, 4); - *(CTypeID *)cdataptr(cd) = id; - setcdataV(L, L->top-1, cd); - lj_gc_check(L); - return 1; -} - -LJLIB_PUSH(top-7) LJLIB_SET(!) /* Store reference to finalizer table. */ - -LJLIB_CF(ffi_gc) LJLIB_REC(.) -{ - GCcdata *cd = ffi_checkcdata(L, 1); - TValue *fin = lj_lib_checkany(L, 2); - CTState *cts = ctype_cts(L); - GCtab *t = cts->finalizer; - CType *ct = ctype_raw(cts, cd->ctypeid); - if (!(ctype_isptr(ct->info) || ctype_isstruct(ct->info) || - ctype_isrefarray(ct->info))) - lj_err_arg(L, 1, LJ_ERR_FFI_INVTYPE); - if (gcref(t->metatable)) { /* Update finalizer table, if still enabled. */ - copyTV(L, lj_tab_set(L, t, L->base), fin); - lj_gc_anybarriert(L, t); - if (!tvisnil(fin)) - cd->marked |= LJ_GC_CDATA_FIN; - else - cd->marked &= ~LJ_GC_CDATA_FIN; - } - L->top = L->base+1; /* Pass through the cdata object. */ - return 1; -} - -LJLIB_PUSH(top-5) LJLIB_SET(!) /* Store clib metatable in func environment. */ - -LJLIB_CF(ffi_load) -{ - GCstr *name = lj_lib_checkstr(L, 1); - int global = (L->base+1 < L->top && tvistruecond(L->base+1)); - lj_clib_load(L, tabref(curr_func(L)->c.env), name, global); - return 1; -} - -LJLIB_PUSH(top-4) LJLIB_SET(C) -LJLIB_PUSH(top-3) LJLIB_SET(os) -LJLIB_PUSH(top-2) LJLIB_SET(arch) - -#include "lj_libdef.h" - -/* ------------------------------------------------------------------------ */ - -/* Create special weak-keyed finalizer table. */ -static GCtab *ffi_finalizer(lua_State *L) -{ - /* NOBARRIER: The table is new (marked white). */ - GCtab *t = lj_tab_new(L, 0, 1); - settabV(L, L->top++, t); - setgcref(t->metatable, obj2gco(t)); - setstrV(L, lj_tab_setstr(L, t, lj_str_newlit(L, "__mode")), - lj_str_newlit(L, "k")); - t->nomm = (uint8_t)(~(1u<top-1); - lj_gc_anybarriert(L, t); - } -} - -LUALIB_API int luaopen_ffi(lua_State *L) -{ - CTState *cts = lj_ctype_init(L); - settabV(L, L->top++, (cts->miscmap = lj_tab_new(L, 0, 1))); - cts->finalizer = ffi_finalizer(L); - LJ_LIB_REG(L, NULL, ffi_meta); - /* NOBARRIER: basemt is a GC root. */ - setgcref(basemt_it(G(L), LJ_TCDATA), obj2gco(tabV(L->top-1))); - LJ_LIB_REG(L, NULL, ffi_clib); - LJ_LIB_REG(L, NULL, ffi_callback); - /* NOBARRIER: the key is new and lj_tab_newkey() handles the barrier. */ - settabV(L, lj_tab_setstr(L, cts->miscmap, &cts->g->strempty), tabV(L->top-1)); - L->top--; - lj_clib_default(L, tabV(L->top-1)); /* Create ffi.C default namespace. */ - lua_pushliteral(L, LJ_OS_NAME); - lua_pushliteral(L, LJ_ARCH_NAME); - LJ_LIB_REG(L, NULL, ffi); /* Note: no global "ffi" created! */ - ffi_register_module(L); - return 1; -} - -#endif diff --git a/subprojects/luajit/src/lib_init.c b/subprojects/luajit/src/lib_init.c deleted file mode 100644 index 2ed370e96..000000000 --- a/subprojects/luajit/src/lib_init.c +++ /dev/null @@ -1,55 +0,0 @@ -/* -** Library initialization. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major parts taken verbatim from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#define lib_init_c -#define LUA_LIB - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" - -#include "lj_arch.h" - -static const luaL_Reg lj_lib_load[] = { - { "", luaopen_base }, - { LUA_LOADLIBNAME, luaopen_package }, - { LUA_TABLIBNAME, luaopen_table }, - { LUA_IOLIBNAME, luaopen_io }, - { LUA_OSLIBNAME, luaopen_os }, - { LUA_STRLIBNAME, luaopen_string }, - { LUA_MATHLIBNAME, luaopen_math }, - { LUA_DBLIBNAME, luaopen_debug }, - { LUA_BITLIBNAME, luaopen_bit }, - { LUA_JITLIBNAME, luaopen_jit }, - { NULL, NULL } -}; - -static const luaL_Reg lj_lib_preload[] = { -#if LJ_HASFFI - { LUA_FFILIBNAME, luaopen_ffi }, -#endif - { NULL, NULL } -}; - -LUALIB_API void luaL_openlibs(lua_State *L) -{ - const luaL_Reg *lib; - for (lib = lj_lib_load; lib->func; lib++) { - lua_pushcfunction(L, lib->func); - lua_pushstring(L, lib->name); - lua_call(L, 1, 0); - } - luaL_findtable(L, LUA_REGISTRYINDEX, "_PRELOAD", - sizeof(lj_lib_preload)/sizeof(lj_lib_preload[0])-1); - for (lib = lj_lib_preload; lib->func; lib++) { - lua_pushcfunction(L, lib->func); - lua_setfield(L, -2, lib->name); - } - lua_pop(L, 1); -} - diff --git a/subprojects/luajit/src/lib_io.c b/subprojects/luajit/src/lib_io.c deleted file mode 100644 index 6858e6455..000000000 --- a/subprojects/luajit/src/lib_io.c +++ /dev/null @@ -1,574 +0,0 @@ -/* -** I/O library. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2011 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#include -#include - -#define lib_io_c -#define LUA_LIB - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_state.h" -#include "lj_ff.h" -#include "lj_lib.h" - -#if LJ_TARGET_WINDOWS -#define WIN32_LEAN_AND_MEAN -#include - -static int widen(const char *in, wchar_t *out) -{ - return MultiByteToWideChar(CP_UTF8, 0, in, -1, out, MAX_PATH); -} -#endif - -/* Userdata payload for I/O file. */ -typedef struct IOFileUD { - FILE *fp; /* File handle. */ - uint32_t type; /* File type. */ -} IOFileUD; - -#define IOFILE_TYPE_FILE 0 /* Regular file. */ -#define IOFILE_TYPE_PIPE 1 /* Pipe. */ -#define IOFILE_TYPE_STDF 2 /* Standard file handle. */ -#define IOFILE_TYPE_MASK 3 - -#define IOFILE_FLAG_CLOSE 4 /* Close after io.lines() iterator. */ - -#define IOSTDF_UD(L, id) (&gcref(G(L)->gcroot[(id)])->ud) -#define IOSTDF_IOF(L, id) ((IOFileUD *)uddata(IOSTDF_UD(L, (id)))) - -/* -- Open/close helpers -------------------------------------------------- */ - -static IOFileUD *io_tofilep(lua_State *L) -{ - if (!(L->base < L->top && tvisudata(L->base) && - udataV(L->base)->udtype == UDTYPE_IO_FILE)) - lj_err_argtype(L, 1, "FILE*"); - return (IOFileUD *)uddata(udataV(L->base)); -} - -static IOFileUD *io_tofile(lua_State *L) -{ - IOFileUD *iof = io_tofilep(L); - if (iof->fp == NULL) - lj_err_caller(L, LJ_ERR_IOCLFL); - return iof; -} - -static FILE *io_stdfile(lua_State *L, ptrdiff_t id) -{ - IOFileUD *iof = IOSTDF_IOF(L, id); - if (iof->fp == NULL) - lj_err_caller(L, LJ_ERR_IOSTDCL); - return iof->fp; -} - -static IOFileUD *io_file_new(lua_State *L) -{ - IOFileUD *iof = (IOFileUD *)lua_newuserdata(L, sizeof(IOFileUD)); - GCudata *ud = udataV(L->top-1); - ud->udtype = UDTYPE_IO_FILE; - /* NOBARRIER: The GCudata is new (marked white). */ - setgcrefr(ud->metatable, curr_func(L)->c.env); - iof->fp = NULL; - iof->type = IOFILE_TYPE_FILE; - return iof; -} - -static IOFileUD *io_file_open(lua_State *L, const char *mode) -{ - const char *fname = strdata(lj_lib_checkstr(L, 1)); - IOFileUD *iof = io_file_new(L); -#if LJ_TARGET_WINDOWS - wchar_t wfname[MAX_PATH]; - wchar_t wmode[MAX_PATH]; - if (!widen(fname, wfname) || !widen(mode, wmode)) - luaL_argerror(L, 1, lj_str_pushf(L, "%s: failed to convert path to utf-16", fname)); - iof->fp = _wfopen(wfname, wmode); -#else - iof->fp = fopen(fname, mode); -#endif - if (iof->fp == NULL) - luaL_argerror(L, 1, lj_str_pushf(L, "%s: %s", fname, strerror(errno))); - return iof; -} - -static int io_file_close(lua_State *L, IOFileUD *iof) -{ - int ok; - if ((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_FILE) { - ok = (fclose(iof->fp) == 0); - } else if ((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_PIPE) { - int stat = -1; -#if LJ_TARGET_POSIX - stat = pclose(iof->fp); -#elif LJ_TARGET_WINDOWS - stat = _pclose(iof->fp); -#else - lua_assert(0); - return 0; -#endif -#if LJ_52 - iof->fp = NULL; - return luaL_execresult(L, stat); -#else - ok = (stat != -1); -#endif - } else { - lua_assert((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_STDF); - setnilV(L->top++); - lua_pushliteral(L, "cannot close standard file"); - return 2; - } - iof->fp = NULL; - return luaL_fileresult(L, ok, NULL); -} - -/* -- Read/write helpers -------------------------------------------------- */ - -static int io_file_readnum(lua_State *L, FILE *fp) -{ - lua_Number d; - if (fscanf(fp, LUA_NUMBER_SCAN, &d) == 1) { - if (LJ_DUALNUM) { - int32_t i = lj_num2int(d); - if (d == (lua_Number)i && !tvismzero((cTValue *)&d)) { - setintV(L->top++, i); - return 1; - } - } - setnumV(L->top++, d); - return 1; - } else { - setnilV(L->top++); - return 0; - } -} - -static int io_file_readline(lua_State *L, FILE *fp, MSize chop) -{ - MSize m = LUAL_BUFFERSIZE, n = 0, ok = 0; - char *buf; - for (;;) { - buf = lj_str_needbuf(L, &G(L)->tmpbuf, m); - if (fgets(buf+n, m-n, fp) == NULL) break; - n += (MSize)strlen(buf+n); - ok |= n; - if (n && buf[n-1] == '\n') { n -= chop; break; } - if (n >= m - 64) m += m; - } - setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n)); - lj_gc_check(L); - return (int)ok; -} - -static void io_file_readall(lua_State *L, FILE *fp) -{ - MSize m, n; - for (m = LUAL_BUFFERSIZE, n = 0; ; m += m) { - char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, m); - n += (MSize)fread(buf+n, 1, m-n, fp); - if (n != m) { - setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n)); - lj_gc_check(L); - return; - } - } -} - -static int io_file_readlen(lua_State *L, FILE *fp, MSize m) -{ - if (m) { - char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, m); - MSize n = (MSize)fread(buf, 1, m, fp); - setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n)); - lj_gc_check(L); - return (n > 0 || m == 0); - } else { - int c = getc(fp); - ungetc(c, fp); - setstrV(L, L->top++, &G(L)->strempty); - return (c != EOF); - } -} - -static int io_file_read(lua_State *L, FILE *fp, int start) -{ - int ok, n, nargs = (int)(L->top - L->base) - start; - clearerr(fp); - if (nargs == 0) { - ok = io_file_readline(L, fp, 1); - n = start+1; /* Return 1 result. */ - } else { - /* The results plus the buffers go on top of the args. */ - luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments"); - ok = 1; - for (n = start; nargs-- && ok; n++) { - if (tvisstr(L->base+n)) { - const char *p = strVdata(L->base+n); - if (p[0] != '*') - lj_err_arg(L, n+1, LJ_ERR_INVOPT); - if (p[1] == 'n') - ok = io_file_readnum(L, fp); - else if ((p[1] & ~0x20) == 'L') - ok = io_file_readline(L, fp, (p[1] == 'l')); - else if (p[1] == 'a') - io_file_readall(L, fp); - else - lj_err_arg(L, n+1, LJ_ERR_INVFMT); - } else if (tvisnumber(L->base+n)) { - ok = io_file_readlen(L, fp, (MSize)lj_lib_checkint(L, n+1)); - } else { - lj_err_arg(L, n+1, LJ_ERR_INVOPT); - } - } - } - if (ferror(fp)) - return luaL_fileresult(L, 0, NULL); - if (!ok) - setnilV(L->top-1); /* Replace last result with nil. */ - return n - start; -} - -static int io_file_write(lua_State *L, FILE *fp, int start) -{ - cTValue *tv; - int status = 1; - for (tv = L->base+start; tv < L->top; tv++) { - if (tvisstr(tv)) { - MSize len = strV(tv)->len; - status = status && (fwrite(strVdata(tv), 1, len, fp) == len); - } else if (tvisint(tv)) { - char buf[LJ_STR_INTBUF]; - char *p = lj_str_bufint(buf, intV(tv)); - size_t len = (size_t)(buf+LJ_STR_INTBUF-p); - status = status && (fwrite(p, 1, len, fp) == len); - } else if (tvisnum(tv)) { - status = status && (fprintf(fp, LUA_NUMBER_FMT, numV(tv)) > 0); - } else { - lj_err_argt(L, (int)(tv - L->base) + 1, LUA_TSTRING); - } - } - if (LJ_52 && status) { - L->top = L->base+1; - if (start == 0) - setudataV(L, L->base, IOSTDF_UD(L, GCROOT_IO_OUTPUT)); - return 1; - } - return luaL_fileresult(L, status, NULL); -} - -static int io_file_iter(lua_State *L) -{ - GCfunc *fn = curr_func(L); - IOFileUD *iof = uddata(udataV(&fn->c.upvalue[0])); - int n = fn->c.nupvalues - 1; - if (iof->fp == NULL) - lj_err_caller(L, LJ_ERR_IOCLFL); - L->top = L->base; - if (n) { /* Copy upvalues with options to stack. */ - if (n > LUAI_MAXCSTACK) - lj_err_caller(L, LJ_ERR_STKOV); - lj_state_checkstack(L, (MSize)n); - memcpy(L->top, &fn->c.upvalue[1], n*sizeof(TValue)); - L->top += n; - } - n = io_file_read(L, iof->fp, 0); - if (ferror(iof->fp)) - lj_err_callermsg(L, strVdata(L->top-2)); - if (tvisnil(L->base) && (iof->type & IOFILE_FLAG_CLOSE)) { - io_file_close(L, iof); /* Return values are ignored. */ - return 0; - } - return n; -} - -static int io_file_lines(lua_State *L) -{ - int n = (int)(L->top - L->base); - if (n > LJ_MAX_UPVAL) - lj_err_caller(L, LJ_ERR_UNPACK); - lua_pushcclosure(L, io_file_iter, n); - return 1; -} - -/* -- I/O file methods ---------------------------------------------------- */ - -#define LJLIB_MODULE_io_method - -LJLIB_CF(io_method_close) -{ - IOFileUD *iof = L->base < L->top ? io_tofile(L) : - IOSTDF_IOF(L, GCROOT_IO_OUTPUT); - return io_file_close(L, iof); -} - -LJLIB_CF(io_method_read) -{ - return io_file_read(L, io_tofile(L)->fp, 1); -} - -LJLIB_CF(io_method_write) LJLIB_REC(io_write 0) -{ - return io_file_write(L, io_tofile(L)->fp, 1); -} - -LJLIB_CF(io_method_flush) LJLIB_REC(io_flush 0) -{ - return luaL_fileresult(L, fflush(io_tofile(L)->fp) == 0, NULL); -} - -LJLIB_CF(io_method_seek) -{ - FILE *fp = io_tofile(L)->fp; - int opt = lj_lib_checkopt(L, 2, 1, "\3set\3cur\3end"); - int64_t ofs = 0; - cTValue *o; - int res; - if (opt == 0) opt = SEEK_SET; - else if (opt == 1) opt = SEEK_CUR; - else if (opt == 2) opt = SEEK_END; - o = L->base+2; - if (o < L->top) { - if (tvisint(o)) - ofs = (int64_t)intV(o); - else if (tvisnum(o)) - ofs = (int64_t)numV(o); - else if (!tvisnil(o)) - lj_err_argt(L, 3, LUA_TNUMBER); - } -#if LJ_TARGET_POSIX - res = fseeko(fp, ofs, opt); -#elif _MSC_VER >= 1400 - res = _fseeki64(fp, ofs, opt); -#elif defined(__MINGW32__) - res = fseeko64(fp, ofs, opt); -#else - res = fseek(fp, (long)ofs, opt); -#endif - if (res) - return luaL_fileresult(L, 0, NULL); -#if LJ_TARGET_POSIX - ofs = ftello(fp); -#elif _MSC_VER >= 1400 - ofs = _ftelli64(fp); -#elif defined(__MINGW32__) - ofs = ftello64(fp); -#else - ofs = (int64_t)ftell(fp); -#endif - setint64V(L->top-1, ofs); - return 1; -} - -LJLIB_CF(io_method_setvbuf) -{ - FILE *fp = io_tofile(L)->fp; - int opt = lj_lib_checkopt(L, 2, -1, "\4full\4line\2no"); - size_t sz = (size_t)lj_lib_optint(L, 3, LUAL_BUFFERSIZE); - if (opt == 0) opt = _IOFBF; - else if (opt == 1) opt = _IOLBF; - else if (opt == 2) opt = _IONBF; - return luaL_fileresult(L, setvbuf(fp, NULL, opt, sz) == 0, NULL); -} - -LJLIB_CF(io_method_lines) -{ - io_tofile(L); - return io_file_lines(L); -} - -LJLIB_CF(io_method___gc) -{ - IOFileUD *iof = io_tofilep(L); - if (iof->fp != NULL && (iof->type & IOFILE_TYPE_MASK) != IOFILE_TYPE_STDF) - io_file_close(L, iof); - return 0; -} - -LJLIB_CF(io_method___tostring) -{ - IOFileUD *iof = io_tofilep(L); - if (iof->fp != NULL) - lua_pushfstring(L, "file (%p)", iof->fp); - else - lua_pushliteral(L, "file (closed)"); - return 1; -} - -LJLIB_PUSH(top-1) LJLIB_SET(__index) - -#include "lj_libdef.h" - -/* -- I/O library functions ----------------------------------------------- */ - -#define LJLIB_MODULE_io - -LJLIB_PUSH(top-2) LJLIB_SET(!) /* Set environment. */ - -LJLIB_CF(io_open) -{ - const char *fname = strdata(lj_lib_checkstr(L, 1)); - GCstr *s = lj_lib_optstr(L, 2); - const char *mode = s ? strdata(s) : "r"; - IOFileUD *iof = io_file_new(L); -#if LJ_TARGET_WINDOWS - wchar_t wfname[MAX_PATH]; - wchar_t wmode[MAX_PATH]; - if (widen(fname, wfname) && widen(mode, wmode)) - iof->fp = _wfopen(wfname, wmode); -#else - iof->fp = fopen(fname, mode); -#endif - return iof->fp != NULL ? 1 : luaL_fileresult(L, 0, fname); -} - -LJLIB_CF(io_popen) -{ -#if LJ_TARGET_POSIX || LJ_TARGET_WINDOWS - const char *fname = strdata(lj_lib_checkstr(L, 1)); - GCstr *s = lj_lib_optstr(L, 2); - const char *mode = s ? strdata(s) : "r"; - IOFileUD *iof = io_file_new(L); - iof->type = IOFILE_TYPE_PIPE; -#if LJ_TARGET_POSIX - fflush(NULL); - iof->fp = popen(fname, mode); -#else - wchar_t wfname[MAX_PATH]; - wchar_t wmode[MAX_PATH]; - if (widen(fname, wfname) && widen(mode, wmode)) - iof->fp = _wpopen(wfname, wmode); -#endif - return iof->fp != NULL ? 1 : luaL_fileresult(L, 0, fname); -#else - return luaL_error(L, LUA_QL("popen") " not supported"); -#endif -} - -LJLIB_CF(io_tmpfile) -{ - IOFileUD *iof = io_file_new(L); -#if LJ_TARGET_PS3 || LJ_TARGET_PS4 || LJ_TARGET_PSVITA - iof->fp = NULL; errno = ENOSYS; -#else - iof->fp = tmpfile(); -#endif - return iof->fp != NULL ? 1 : luaL_fileresult(L, 0, NULL); -} - -LJLIB_CF(io_close) -{ - return lj_cf_io_method_close(L); -} - -LJLIB_CF(io_read) -{ - return io_file_read(L, io_stdfile(L, GCROOT_IO_INPUT), 0); -} - -LJLIB_CF(io_write) LJLIB_REC(io_write GCROOT_IO_OUTPUT) -{ - return io_file_write(L, io_stdfile(L, GCROOT_IO_OUTPUT), 0); -} - -LJLIB_CF(io_flush) LJLIB_REC(io_flush GCROOT_IO_OUTPUT) -{ - return luaL_fileresult(L, fflush(io_stdfile(L, GCROOT_IO_OUTPUT)) == 0, NULL); -} - -static int io_std_getset(lua_State *L, ptrdiff_t id, const char *mode) -{ - if (L->base < L->top && !tvisnil(L->base)) { - if (tvisudata(L->base)) { - io_tofile(L); - L->top = L->base+1; - } else { - io_file_open(L, mode); - } - /* NOBARRIER: The standard I/O handles are GC roots. */ - setgcref(G(L)->gcroot[id], gcV(L->top-1)); - } else { - setudataV(L, L->top++, IOSTDF_UD(L, id)); - } - return 1; -} - -LJLIB_CF(io_input) -{ - return io_std_getset(L, GCROOT_IO_INPUT, "r"); -} - -LJLIB_CF(io_output) -{ - return io_std_getset(L, GCROOT_IO_OUTPUT, "w"); -} - -LJLIB_CF(io_lines) -{ - if (L->base == L->top) setnilV(L->top++); - if (!tvisnil(L->base)) { /* io.lines(fname) */ - IOFileUD *iof = io_file_open(L, "r"); - iof->type = IOFILE_TYPE_FILE|IOFILE_FLAG_CLOSE; - L->top--; - setudataV(L, L->base, udataV(L->top)); - } else { /* io.lines() iterates over stdin. */ - setudataV(L, L->base, IOSTDF_UD(L, GCROOT_IO_INPUT)); - } - return io_file_lines(L); -} - -LJLIB_CF(io_type) -{ - cTValue *o = lj_lib_checkany(L, 1); - if (!(tvisudata(o) && udataV(o)->udtype == UDTYPE_IO_FILE)) - setnilV(L->top++); - else if (((IOFileUD *)uddata(udataV(o)))->fp != NULL) - lua_pushliteral(L, "file"); - else - lua_pushliteral(L, "closed file"); - return 1; -} - -#include "lj_libdef.h" - -/* ------------------------------------------------------------------------ */ - -static GCobj *io_std_new(lua_State *L, FILE *fp, const char *name) -{ - IOFileUD *iof = (IOFileUD *)lua_newuserdata(L, sizeof(IOFileUD)); - GCudata *ud = udataV(L->top-1); - ud->udtype = UDTYPE_IO_FILE; - /* NOBARRIER: The GCudata is new (marked white). */ - setgcref(ud->metatable, gcV(L->top-3)); - iof->fp = fp; - iof->type = IOFILE_TYPE_STDF; - lua_setfield(L, -2, name); - return obj2gco(ud); -} - -LUALIB_API int luaopen_io(lua_State *L) -{ - LJ_LIB_REG(L, NULL, io_method); - copyTV(L, L->top, L->top-1); L->top++; - lua_setfield(L, LUA_REGISTRYINDEX, LUA_FILEHANDLE); - LJ_LIB_REG(L, LUA_IOLIBNAME, io); - setgcref(G(L)->gcroot[GCROOT_IO_INPUT], io_std_new(L, stdin, "stdin")); - setgcref(G(L)->gcroot[GCROOT_IO_OUTPUT], io_std_new(L, stdout, "stdout")); - io_std_new(L, stderr, "stderr"); - return 1; -} - diff --git a/subprojects/luajit/src/lib_jit.c b/subprojects/luajit/src/lib_jit.c deleted file mode 100644 index d2fcf21be..000000000 --- a/subprojects/luajit/src/lib_jit.c +++ /dev/null @@ -1,664 +0,0 @@ -/* -** JIT library. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lib_jit_c -#define LUA_LIB - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" - -#include "lj_arch.h" -#include "lj_obj.h" -#include "lj_err.h" -#include "lj_debug.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_bc.h" -#if LJ_HASJIT -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_ircall.h" -#include "lj_iropt.h" -#include "lj_target.h" -#endif -#include "lj_dispatch.h" -#include "lj_vm.h" -#include "lj_vmevent.h" -#include "lj_lib.h" - -#include "luajit.h" - -/* -- jit.* functions ----------------------------------------------------- */ - -#define LJLIB_MODULE_jit - -static int setjitmode(lua_State *L, int mode) -{ - int idx = 0; - if (L->base == L->top || tvisnil(L->base)) { /* jit.on/off/flush([nil]) */ - mode |= LUAJIT_MODE_ENGINE; - } else { - /* jit.on/off/flush(func|proto, nil|true|false) */ - if (tvisfunc(L->base) || tvisproto(L->base)) - idx = 1; - else if (!tvistrue(L->base)) /* jit.on/off/flush(true, nil|true|false) */ - goto err; - if (L->base+1 < L->top && tvisbool(L->base+1)) - mode |= boolV(L->base+1) ? LUAJIT_MODE_ALLFUNC : LUAJIT_MODE_ALLSUBFUNC; - else - mode |= LUAJIT_MODE_FUNC; - } - if (luaJIT_setmode(L, idx, mode) != 1) { - if ((mode & LUAJIT_MODE_MASK) == LUAJIT_MODE_ENGINE) - lj_err_caller(L, LJ_ERR_NOJIT); - err: - lj_err_argt(L, 1, LUA_TFUNCTION); - } - return 0; -} - -LJLIB_CF(jit_on) -{ - return setjitmode(L, LUAJIT_MODE_ON); -} - -LJLIB_CF(jit_off) -{ - return setjitmode(L, LUAJIT_MODE_OFF); -} - -LJLIB_CF(jit_flush) -{ -#if LJ_HASJIT - if (L->base < L->top && tvisnumber(L->base)) { - int traceno = lj_lib_checkint(L, 1); - luaJIT_setmode(L, traceno, LUAJIT_MODE_FLUSH|LUAJIT_MODE_TRACE); - return 0; - } -#endif - return setjitmode(L, LUAJIT_MODE_FLUSH); -} - -#if LJ_HASJIT -/* Push a string for every flag bit that is set. */ -static void flagbits_to_strings(lua_State *L, uint32_t flags, uint32_t base, - const char *str) -{ - for (; *str; base <<= 1, str += 1+*str) - if (flags & base) - setstrV(L, L->top++, lj_str_new(L, str+1, *(uint8_t *)str)); -} -#endif - -LJLIB_CF(jit_status) -{ -#if LJ_HASJIT - jit_State *J = L2J(L); - L->top = L->base; - setboolV(L->top++, (J->flags & JIT_F_ON) ? 1 : 0); - flagbits_to_strings(L, J->flags, JIT_F_CPU_FIRST, JIT_F_CPUSTRING); - flagbits_to_strings(L, J->flags, JIT_F_OPT_FIRST, JIT_F_OPTSTRING); - return (int)(L->top - L->base); -#else - setboolV(L->top++, 0); - return 1; -#endif -} - -LJLIB_CF(jit_attach) -{ -#ifdef LUAJIT_DISABLE_VMEVENT - luaL_error(L, "vmevent API disabled"); -#else - GCfunc *fn = lj_lib_checkfunc(L, 1); - GCstr *s = lj_lib_optstr(L, 2); - luaL_findtable(L, LUA_REGISTRYINDEX, LJ_VMEVENTS_REGKEY, LJ_VMEVENTS_HSIZE); - if (s) { /* Attach to given event. */ - const uint8_t *p = (const uint8_t *)strdata(s); - uint32_t h = s->len; - while (*p) h = h ^ (lj_rol(h, 6) + *p++); - lua_pushvalue(L, 1); - lua_rawseti(L, -2, VMEVENT_HASHIDX(h)); - G(L)->vmevmask = VMEVENT_NOCACHE; /* Invalidate cache. */ - } else { /* Detach if no event given. */ - setnilV(L->top++); - while (lua_next(L, -2)) { - L->top--; - if (tvisfunc(L->top) && funcV(L->top) == fn) { - setnilV(lj_tab_set(L, tabV(L->top-2), L->top-1)); - } - } - } -#endif - return 0; -} - -LJLIB_PUSH(top-5) LJLIB_SET(os) -LJLIB_PUSH(top-4) LJLIB_SET(arch) -LJLIB_PUSH(top-3) LJLIB_SET(version_num) -LJLIB_PUSH(top-2) LJLIB_SET(version) - -#include "lj_libdef.h" - -/* -- jit.util.* functions ------------------------------------------------ */ - -#define LJLIB_MODULE_jit_util - -/* -- Reflection API for Lua functions ------------------------------------ */ - -/* Return prototype of first argument (Lua function or prototype object) */ -static GCproto *check_Lproto(lua_State *L, int nolua) -{ - TValue *o = L->base; - if (L->top > o) { - if (tvisproto(o)) { - return protoV(o); - } else if (tvisfunc(o)) { - if (isluafunc(funcV(o))) - return funcproto(funcV(o)); - else if (nolua) - return NULL; - } - } - lj_err_argt(L, 1, LUA_TFUNCTION); - return NULL; /* unreachable */ -} - -static void setintfield(lua_State *L, GCtab *t, const char *name, int32_t val) -{ - setintV(lj_tab_setstr(L, t, lj_str_newz(L, name)), val); -} - -/* local info = jit.util.funcinfo(func [,pc]) */ -LJLIB_CF(jit_util_funcinfo) -{ - GCproto *pt = check_Lproto(L, 1); - if (pt) { - BCPos pc = (BCPos)lj_lib_optint(L, 2, 0); - GCtab *t; - lua_createtable(L, 0, 16); /* Increment hash size if fields are added. */ - t = tabV(L->top-1); - setintfield(L, t, "linedefined", pt->firstline); - setintfield(L, t, "lastlinedefined", pt->firstline + pt->numline); - setintfield(L, t, "stackslots", pt->framesize); - setintfield(L, t, "params", pt->numparams); - setintfield(L, t, "bytecodes", (int32_t)pt->sizebc); - setintfield(L, t, "gcconsts", (int32_t)pt->sizekgc); - setintfield(L, t, "nconsts", (int32_t)pt->sizekn); - setintfield(L, t, "upvalues", (int32_t)pt->sizeuv); - if (pc < pt->sizebc) - setintfield(L, t, "currentline", lj_debug_line(pt, pc)); - lua_pushboolean(L, (pt->flags & PROTO_VARARG)); - lua_setfield(L, -2, "isvararg"); - lua_pushboolean(L, (pt->flags & PROTO_CHILD)); - lua_setfield(L, -2, "children"); - setstrV(L, L->top++, proto_chunkname(pt)); - lua_setfield(L, -2, "source"); - lj_debug_pushloc(L, pt, pc); - lua_setfield(L, -2, "loc"); - setprotoV(L, lj_tab_setstr(L, t, lj_str_newlit(L, "proto")), pt); - } else { - GCfunc *fn = funcV(L->base); - GCtab *t; - lua_createtable(L, 0, 4); /* Increment hash size if fields are added. */ - t = tabV(L->top-1); - if (!iscfunc(fn)) - setintfield(L, t, "ffid", fn->c.ffid); - setintptrV(lj_tab_setstr(L, t, lj_str_newlit(L, "addr")), - (intptr_t)(void *)fn->c.f); - setintfield(L, t, "upvalues", fn->c.nupvalues); - } - return 1; -} - -/* local ins, m = jit.util.funcbc(func, pc) */ -LJLIB_CF(jit_util_funcbc) -{ - GCproto *pt = check_Lproto(L, 0); - BCPos pc = (BCPos)lj_lib_checkint(L, 2); - if (pc < pt->sizebc) { - BCIns ins = proto_bc(pt)[pc]; - BCOp op = bc_op(ins); - lua_assert(op < BC__MAX); - setintV(L->top, ins); - setintV(L->top+1, lj_bc_mode[op]); - L->top += 2; - return 2; - } - return 0; -} - -/* local k = jit.util.funck(func, idx) */ -LJLIB_CF(jit_util_funck) -{ - GCproto *pt = check_Lproto(L, 0); - ptrdiff_t idx = (ptrdiff_t)lj_lib_checkint(L, 2); - if (idx >= 0) { - if (idx < (ptrdiff_t)pt->sizekn) { - copyTV(L, L->top-1, proto_knumtv(pt, idx)); - return 1; - } - } else { - if (~idx < (ptrdiff_t)pt->sizekgc) { - GCobj *gc = proto_kgc(pt, idx); - setgcV(L, L->top-1, gc, ~gc->gch.gct); - return 1; - } - } - return 0; -} - -/* local name = jit.util.funcuvname(func, idx) */ -LJLIB_CF(jit_util_funcuvname) -{ - GCproto *pt = check_Lproto(L, 0); - uint32_t idx = (uint32_t)lj_lib_checkint(L, 2); - if (idx < pt->sizeuv) { - setstrV(L, L->top-1, lj_str_newz(L, lj_debug_uvname(pt, idx))); - return 1; - } - return 0; -} - -/* -- Reflection API for traces ------------------------------------------- */ - -#if LJ_HASJIT - -/* Check trace argument. Must not throw for non-existent trace numbers. */ -static GCtrace *jit_checktrace(lua_State *L) -{ - TraceNo tr = (TraceNo)lj_lib_checkint(L, 1); - jit_State *J = L2J(L); - if (tr > 0 && tr < J->sizetrace) - return traceref(J, tr); - return NULL; -} - -/* Names of link types. ORDER LJ_TRLINK */ -static const char *const jit_trlinkname[] = { - "none", "root", "loop", "tail-recursion", "up-recursion", "down-recursion", - "interpreter", "return" -}; - -/* local info = jit.util.traceinfo(tr) */ -LJLIB_CF(jit_util_traceinfo) -{ - GCtrace *T = jit_checktrace(L); - if (T) { - GCtab *t; - lua_createtable(L, 0, 8); /* Increment hash size if fields are added. */ - t = tabV(L->top-1); - setintfield(L, t, "nins", (int32_t)T->nins - REF_BIAS - 1); - setintfield(L, t, "nk", REF_BIAS - (int32_t)T->nk); - setintfield(L, t, "link", T->link); - setintfield(L, t, "nexit", T->nsnap); - setstrV(L, L->top++, lj_str_newz(L, jit_trlinkname[T->linktype])); - lua_setfield(L, -2, "linktype"); - /* There are many more fields. Add them only when needed. */ - return 1; - } - return 0; -} - -/* local m, ot, op1, op2, prev = jit.util.traceir(tr, idx) */ -LJLIB_CF(jit_util_traceir) -{ - GCtrace *T = jit_checktrace(L); - IRRef ref = (IRRef)lj_lib_checkint(L, 2) + REF_BIAS; - if (T && ref >= REF_BIAS && ref < T->nins) { - IRIns *ir = &T->ir[ref]; - int32_t m = lj_ir_mode[ir->o]; - setintV(L->top-2, m); - setintV(L->top-1, ir->ot); - setintV(L->top++, (int32_t)ir->op1 - (irm_op1(m)==IRMref ? REF_BIAS : 0)); - setintV(L->top++, (int32_t)ir->op2 - (irm_op2(m)==IRMref ? REF_BIAS : 0)); - setintV(L->top++, ir->prev); - return 5; - } - return 0; -} - -/* local k, t [, slot] = jit.util.tracek(tr, idx) */ -LJLIB_CF(jit_util_tracek) -{ - GCtrace *T = jit_checktrace(L); - IRRef ref = (IRRef)lj_lib_checkint(L, 2) + REF_BIAS; - if (T && ref >= T->nk && ref < REF_BIAS) { - IRIns *ir = &T->ir[ref]; - int32_t slot = -1; - if (ir->o == IR_KSLOT) { - slot = ir->op2; - ir = &T->ir[ir->op1]; - } - lj_ir_kvalue(L, L->top-2, ir); - setintV(L->top-1, (int32_t)irt_type(ir->t)); - if (slot == -1) - return 2; - setintV(L->top++, slot); - return 3; - } - return 0; -} - -/* local snap = jit.util.tracesnap(tr, sn) */ -LJLIB_CF(jit_util_tracesnap) -{ - GCtrace *T = jit_checktrace(L); - SnapNo sn = (SnapNo)lj_lib_checkint(L, 2); - if (T && sn < T->nsnap) { - SnapShot *snap = &T->snap[sn]; - SnapEntry *map = &T->snapmap[snap->mapofs]; - MSize n, nent = snap->nent; - GCtab *t; - lua_createtable(L, nent+2, 0); - t = tabV(L->top-1); - setintV(lj_tab_setint(L, t, 0), (int32_t)snap->ref - REF_BIAS); - setintV(lj_tab_setint(L, t, 1), (int32_t)snap->nslots); - for (n = 0; n < nent; n++) - setintV(lj_tab_setint(L, t, (int32_t)(n+2)), (int32_t)map[n]); - setintV(lj_tab_setint(L, t, (int32_t)(nent+2)), (int32_t)SNAP(255, 0, 0)); - return 1; - } - return 0; -} - -/* local mcode, addr, loop = jit.util.tracemc(tr) */ -LJLIB_CF(jit_util_tracemc) -{ - GCtrace *T = jit_checktrace(L); - if (T && T->mcode != NULL) { - setstrV(L, L->top-1, lj_str_new(L, (const char *)T->mcode, T->szmcode)); - setintptrV(L->top++, (intptr_t)(void *)T->mcode); - setintV(L->top++, T->mcloop); - return 3; - } - return 0; -} - -/* local addr = jit.util.traceexitstub([tr,] exitno) */ -LJLIB_CF(jit_util_traceexitstub) -{ -#ifdef EXITSTUBS_PER_GROUP - ExitNo exitno = (ExitNo)lj_lib_checkint(L, 1); - jit_State *J = L2J(L); - if (exitno < EXITSTUBS_PER_GROUP*LJ_MAX_EXITSTUBGR) { - setintptrV(L->top-1, (intptr_t)(void *)exitstub_addr(J, exitno)); - return 1; - } -#else - if (L->top > L->base+1) { /* Don't throw for one-argument variant. */ - GCtrace *T = jit_checktrace(L); - ExitNo exitno = (ExitNo)lj_lib_checkint(L, 2); - ExitNo maxexit = T->root ? T->nsnap+1 : T->nsnap; - if (T && T->mcode != NULL && exitno < maxexit) { - setintptrV(L->top-1, (intptr_t)(void *)exitstub_trace_addr(T, exitno)); - return 1; - } - } -#endif - return 0; -} - -/* local addr = jit.util.ircalladdr(idx) */ -LJLIB_CF(jit_util_ircalladdr) -{ - uint32_t idx = (uint32_t)lj_lib_checkint(L, 1); - if (idx < IRCALL__MAX) { - setintptrV(L->top-1, (intptr_t)(void *)lj_ir_callinfo[idx].func); - return 1; - } - return 0; -} - -#endif - -#include "lj_libdef.h" - -/* -- jit.opt module ------------------------------------------------------ */ - -#if LJ_HASJIT - -#define LJLIB_MODULE_jit_opt - -/* Parse optimization level. */ -static int jitopt_level(jit_State *J, const char *str) -{ - if (str[0] >= '0' && str[0] <= '9' && str[1] == '\0') { - uint32_t flags; - if (str[0] == '0') flags = JIT_F_OPT_0; - else if (str[0] == '1') flags = JIT_F_OPT_1; - else if (str[0] == '2') flags = JIT_F_OPT_2; - else flags = JIT_F_OPT_3; - J->flags = (J->flags & ~JIT_F_OPT_MASK) | flags; - return 1; /* Ok. */ - } - return 0; /* No match. */ -} - -/* Parse optimization flag. */ -static int jitopt_flag(jit_State *J, const char *str) -{ - const char *lst = JIT_F_OPTSTRING; - uint32_t opt; - int set = 1; - if (str[0] == '+') { - str++; - } else if (str[0] == '-') { - str++; - set = 0; - } else if (str[0] == 'n' && str[1] == 'o') { - str += str[2] == '-' ? 3 : 2; - set = 0; - } - for (opt = JIT_F_OPT_FIRST; ; opt <<= 1) { - size_t len = *(const uint8_t *)lst; - if (len == 0) - break; - if (strncmp(str, lst+1, len) == 0 && str[len] == '\0') { - if (set) J->flags |= opt; else J->flags &= ~opt; - return 1; /* Ok. */ - } - lst += 1+len; - } - return 0; /* No match. */ -} - -/* Parse optimization parameter. */ -static int jitopt_param(jit_State *J, const char *str) -{ - const char *lst = JIT_P_STRING; - int i; - for (i = 0; i < JIT_P__MAX; i++) { - size_t len = *(const uint8_t *)lst; - lua_assert(len != 0); - if (strncmp(str, lst+1, len) == 0 && str[len] == '=') { - int32_t n = 0; - const char *p = &str[len+1]; - while (*p >= '0' && *p <= '9') - n = n*10 + (*p++ - '0'); - if (*p) return 0; /* Malformed number. */ - J->param[i] = n; - if (i == JIT_P_hotloop) - lj_dispatch_init_hotcount(J2G(J)); - return 1; /* Ok. */ - } - lst += 1+len; - } - return 0; /* No match. */ -} - -/* jit.opt.start(flags...) */ -LJLIB_CF(jit_opt_start) -{ - jit_State *J = L2J(L); - int nargs = (int)(L->top - L->base); - if (nargs == 0) { - J->flags = (J->flags & ~JIT_F_OPT_MASK) | JIT_F_OPT_DEFAULT; - } else { - int i; - for (i = 1; i <= nargs; i++) { - const char *str = strdata(lj_lib_checkstr(L, i)); - if (!jitopt_level(J, str) && - !jitopt_flag(J, str) && - !jitopt_param(J, str)) - lj_err_callerv(L, LJ_ERR_JITOPT, str); - } - } - return 0; -} - -#include "lj_libdef.h" - -#endif - -/* -- JIT compiler initialization ----------------------------------------- */ - -#if LJ_HASJIT -/* Default values for JIT parameters. */ -static const int32_t jit_param_default[JIT_P__MAX+1] = { -#define JIT_PARAMINIT(len, name, value) (value), -JIT_PARAMDEF(JIT_PARAMINIT) -#undef JIT_PARAMINIT - 0 -}; -#endif - -#if LJ_TARGET_ARM && LJ_TARGET_LINUX -#include -#endif - -/* Arch-dependent CPU detection. */ -static uint32_t jit_cpudetect(lua_State *L) -{ - uint32_t flags = 0; -#if LJ_TARGET_X86ORX64 - uint32_t vendor[4]; - uint32_t features[4]; - if (lj_vm_cpuid(0, vendor) && lj_vm_cpuid(1, features)) { -#if !LJ_HASJIT -#define JIT_F_CMOV 1 -#define JIT_F_SSE2 2 -#endif - flags |= ((features[3] >> 15)&1) * JIT_F_CMOV; - flags |= ((features[3] >> 26)&1) * JIT_F_SSE2; -#if LJ_HASJIT - flags |= ((features[2] >> 0)&1) * JIT_F_SSE3; - flags |= ((features[2] >> 19)&1) * JIT_F_SSE4_1; - if (vendor[2] == 0x6c65746e) { /* Intel. */ - if ((features[0] & 0x0ff00f00) == 0x00000f00) /* P4. */ - flags |= JIT_F_P4; /* Currently unused. */ - else if ((features[0] & 0x0fff0ff0) == 0x000106c0) /* Atom. */ - flags |= JIT_F_LEA_AGU; - } else if (vendor[2] == 0x444d4163) { /* AMD. */ - uint32_t fam = (features[0] & 0x0ff00f00); - if (fam == 0x00000f00) /* K8. */ - flags |= JIT_F_SPLIT_XMM; - if (fam >= 0x00000f00) /* K8, K10. */ - flags |= JIT_F_PREFER_IMUL; - } -#endif - } - /* Check for required instruction set support on x86 (unnecessary on x64). */ -#if LJ_TARGET_X86 -#if !defined(LUAJIT_CPU_NOCMOV) - if (!(flags & JIT_F_CMOV)) - luaL_error(L, "CPU not supported"); -#endif -#if defined(LUAJIT_CPU_SSE2) - if (!(flags & JIT_F_SSE2)) - luaL_error(L, "CPU does not support SSE2 (recompile without -DLUAJIT_CPU_SSE2)"); -#endif -#endif -#elif LJ_TARGET_ARM -#if LJ_HASJIT - int ver = LJ_ARCH_VERSION; /* Compile-time ARM CPU detection. */ -#if LJ_TARGET_LINUX - if (ver < 70) { /* Runtime ARM CPU detection. */ - struct utsname ut; - uname(&ut); - if (strncmp(ut.machine, "armv", 4) == 0) { - if (ut.machine[4] >= '7') - ver = 70; - else if (ut.machine[4] == '6') - ver = 60; - } - } -#endif - flags |= ver >= 70 ? JIT_F_ARMV7 : - ver >= 61 ? JIT_F_ARMV6T2_ : - ver >= 60 ? JIT_F_ARMV6_ : 0; - flags |= LJ_ARCH_HASFPU == 0 ? 0 : ver >= 70 ? JIT_F_VFPV3 : JIT_F_VFPV2; -#endif -#elif LJ_TARGET_PPC -#if LJ_HASJIT -#if LJ_ARCH_SQRT - flags |= JIT_F_SQRT; -#endif -#if LJ_ARCH_ROUND - flags |= JIT_F_ROUND; -#endif -#endif -#elif LJ_TARGET_PPCSPE - /* Nothing to do. */ -#elif LJ_TARGET_MIPS -#if LJ_HASJIT - /* Compile-time MIPS CPU detection. */ -#if LJ_ARCH_VERSION >= 20 - flags |= JIT_F_MIPS32R2; -#endif - /* Runtime MIPS CPU detection. */ -#if defined(__GNUC__) - if (!(flags & JIT_F_MIPS32R2)) { - int x; - /* On MIPS32R1 rotr is treated as srl. rotr r2,r2,1 -> srl r2,r2,1. */ - __asm__("li $2, 1\n\t.long 0x00221042\n\tmove %0, $2" : "=r"(x) : : "$2"); - if (x) flags |= JIT_F_MIPS32R2; /* Either 0x80000000 (R2) or 0 (R1). */ - } -#endif -#endif -#else -#error "Missing CPU detection for this architecture" -#endif - UNUSED(L); - return flags; -} - -/* Initialize JIT compiler. */ -static void jit_init(lua_State *L) -{ - uint32_t flags = jit_cpudetect(L); -#if LJ_HASJIT - jit_State *J = L2J(L); -#if LJ_TARGET_X86 - /* Silently turn off the JIT compiler on CPUs without SSE2. */ - if ((flags & JIT_F_SSE2)) -#endif - J->flags = flags | JIT_F_ON | JIT_F_OPT_DEFAULT; - memcpy(J->param, jit_param_default, sizeof(J->param)); - lj_dispatch_update(G(L)); -#else - UNUSED(flags); -#endif -} - -LUALIB_API int luaopen_jit(lua_State *L) -{ - lua_pushliteral(L, LJ_OS_NAME); - lua_pushliteral(L, LJ_ARCH_NAME); - lua_pushinteger(L, LUAJIT_VERSION_NUM); - lua_pushliteral(L, LUAJIT_VERSION); - LJ_LIB_REG(L, LUA_JITLIBNAME, jit); -#ifndef LUAJIT_DISABLE_JITUTIL - LJ_LIB_REG(L, "jit.util", jit_util); -#endif -#if LJ_HASJIT - LJ_LIB_REG(L, "jit.opt", jit_opt); -#endif - L->top -= 2; - jit_init(L); - return 1; -} - diff --git a/subprojects/luajit/src/lib_math.c b/subprojects/luajit/src/lib_math.c deleted file mode 100644 index 4c708a47e..000000000 --- a/subprojects/luajit/src/lib_math.c +++ /dev/null @@ -1,233 +0,0 @@ -/* -** Math library. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include - -#define lib_math_c -#define LUA_LIB - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" - -#include "lj_obj.h" -#include "lj_lib.h" -#include "lj_vm.h" - -/* ------------------------------------------------------------------------ */ - -#define LJLIB_MODULE_math - -LJLIB_ASM(math_abs) LJLIB_REC(.) -{ - lj_lib_checknumber(L, 1); - return FFH_RETRY; -} -LJLIB_ASM_(math_floor) LJLIB_REC(math_round IRFPM_FLOOR) -LJLIB_ASM_(math_ceil) LJLIB_REC(math_round IRFPM_CEIL) - -LJLIB_ASM(math_sqrt) LJLIB_REC(math_unary IRFPM_SQRT) -{ - lj_lib_checknum(L, 1); - return FFH_RETRY; -} -LJLIB_ASM_(math_log10) LJLIB_REC(math_unary IRFPM_LOG10) -LJLIB_ASM_(math_exp) LJLIB_REC(math_unary IRFPM_EXP) -LJLIB_ASM_(math_sin) LJLIB_REC(math_unary IRFPM_SIN) -LJLIB_ASM_(math_cos) LJLIB_REC(math_unary IRFPM_COS) -LJLIB_ASM_(math_tan) LJLIB_REC(math_unary IRFPM_TAN) -LJLIB_ASM_(math_asin) LJLIB_REC(math_atrig FF_math_asin) -LJLIB_ASM_(math_acos) LJLIB_REC(math_atrig FF_math_acos) -LJLIB_ASM_(math_atan) LJLIB_REC(math_atrig FF_math_atan) -LJLIB_ASM_(math_sinh) LJLIB_REC(math_htrig IRCALL_sinh) -LJLIB_ASM_(math_cosh) LJLIB_REC(math_htrig IRCALL_cosh) -LJLIB_ASM_(math_tanh) LJLIB_REC(math_htrig IRCALL_tanh) -LJLIB_ASM_(math_frexp) -LJLIB_ASM_(math_modf) LJLIB_REC(.) - -LJLIB_PUSH(57.29577951308232) -LJLIB_ASM_(math_deg) LJLIB_REC(math_degrad) - -LJLIB_PUSH(0.017453292519943295) -LJLIB_ASM_(math_rad) LJLIB_REC(math_degrad) - -LJLIB_ASM(math_log) LJLIB_REC(math_log) -{ - double x = lj_lib_checknum(L, 1); - if (L->base+1 < L->top) { - double y = lj_lib_checknum(L, 2); -#ifdef LUAJIT_NO_LOG2 - x = log(x); y = 1.0 / log(y); -#else - x = lj_vm_log2(x); y = 1.0 / lj_vm_log2(y); -#endif - setnumV(L->base-1, x*y); /* Do NOT join the expression to x / y. */ - return FFH_RES(1); - } - return FFH_RETRY; -} - -LJLIB_ASM(math_atan2) LJLIB_REC(.) -{ - lj_lib_checknum(L, 1); - lj_lib_checknum(L, 2); - return FFH_RETRY; -} -LJLIB_ASM_(math_pow) LJLIB_REC(.) -LJLIB_ASM_(math_fmod) - -LJLIB_ASM(math_ldexp) LJLIB_REC(.) -{ - lj_lib_checknum(L, 1); -#if LJ_DUALNUM && !LJ_TARGET_X86ORX64 - lj_lib_checkint(L, 2); -#else - lj_lib_checknum(L, 2); -#endif - return FFH_RETRY; -} - -LJLIB_ASM(math_min) LJLIB_REC(math_minmax IR_MIN) -{ - int i = 0; - do { lj_lib_checknumber(L, ++i); } while (L->base+i < L->top); - return FFH_RETRY; -} -LJLIB_ASM_(math_max) LJLIB_REC(math_minmax IR_MAX) - -LJLIB_PUSH(3.14159265358979323846) LJLIB_SET(pi) -LJLIB_PUSH(1e310) LJLIB_SET(huge) - -/* ------------------------------------------------------------------------ */ - -/* This implements a Tausworthe PRNG with period 2^223. Based on: -** Tables of maximally-equidistributed combined LFSR generators, -** Pierre L'Ecuyer, 1991, table 3, 1st entry. -** Full-period ME-CF generator with L=64, J=4, k=223, N1=49. -*/ - -/* PRNG state. */ -struct RandomState { - uint64_t gen[4]; /* State of the 4 LFSR generators. */ - int valid; /* State is valid. */ -}; - -/* Union needed for bit-pattern conversion between uint64_t and double. */ -typedef union { uint64_t u64; double d; } U64double; - -/* Update generator i and compute a running xor of all states. */ -#define TW223_GEN(i, k, q, s) \ - z = rs->gen[i]; \ - z = (((z<> (k-s)) ^ ((z&((uint64_t)(int64_t)-1 << (64-k)))<gen[i] = z; - -/* PRNG step function. Returns a double in the range 1.0 <= d < 2.0. */ -LJ_NOINLINE uint64_t LJ_FASTCALL lj_math_random_step(RandomState *rs) -{ - uint64_t z, r = 0; - TW223_GEN(0, 63, 31, 18) - TW223_GEN(1, 58, 19, 28) - TW223_GEN(2, 55, 24, 7) - TW223_GEN(3, 47, 21, 8) - return (r & U64x(000fffff,ffffffff)) | U64x(3ff00000,00000000); -} - -/* PRNG initialization function. */ -static void random_init(RandomState *rs, double d) -{ - uint32_t r = 0x11090601; /* 64-k[i] as four 8 bit constants. */ - int i; - for (i = 0; i < 4; i++) { - U64double u; - uint32_t m = 1u << (r&255); - r >>= 8; - u.d = d = d * 3.14159265358979323846 + 2.7182818284590452354; - if (u.u64 < m) u.u64 += m; /* Ensure k[i] MSB of gen[i] are non-zero. */ - rs->gen[i] = u.u64; - } - rs->valid = 1; - for (i = 0; i < 10; i++) - lj_math_random_step(rs); -} - -/* PRNG extract function. */ -LJLIB_PUSH(top-2) /* Upvalue holds userdata with RandomState. */ -LJLIB_CF(math_random) LJLIB_REC(.) -{ - int n = (int)(L->top - L->base); - RandomState *rs = (RandomState *)(uddata(udataV(lj_lib_upvalue(L, 1)))); - U64double u; - double d; - if (LJ_UNLIKELY(!rs->valid)) random_init(rs, 0.0); - u.u64 = lj_math_random_step(rs); - d = u.d - 1.0; - if (n > 0) { -#if LJ_DUALNUM - int isint = 1; - double r1; - lj_lib_checknumber(L, 1); - if (tvisint(L->base)) { - r1 = (lua_Number)intV(L->base); - } else { - isint = 0; - r1 = numV(L->base); - } -#else - double r1 = lj_lib_checknum(L, 1); -#endif - if (n == 1) { - d = lj_vm_floor(d*r1) + 1.0; /* d is an int in range [1, r1] */ - } else { -#if LJ_DUALNUM - double r2; - lj_lib_checknumber(L, 2); - if (tvisint(L->base+1)) { - r2 = (lua_Number)intV(L->base+1); - } else { - isint = 0; - r2 = numV(L->base+1); - } -#else - double r2 = lj_lib_checknum(L, 2); -#endif - d = lj_vm_floor(d*(r2-r1+1.0)) + r1; /* d is an int in range [r1, r2] */ - } -#if LJ_DUALNUM - if (isint) { - setintV(L->top-1, lj_num2int(d)); - return 1; - } -#endif - } /* else: d is a double in range [0, 1] */ - setnumV(L->top++, d); - return 1; -} - -/* PRNG seed function. */ -LJLIB_PUSH(top-2) /* Upvalue holds userdata with RandomState. */ -LJLIB_CF(math_randomseed) -{ - RandomState *rs = (RandomState *)(uddata(udataV(lj_lib_upvalue(L, 1)))); - random_init(rs, lj_lib_checknum(L, 1)); - return 0; -} - -/* ------------------------------------------------------------------------ */ - -#include "lj_libdef.h" - -LUALIB_API int luaopen_math(lua_State *L) -{ - RandomState *rs; - rs = (RandomState *)lua_newuserdata(L, sizeof(RandomState)); - rs->valid = 0; /* Use lazy initialization to save some time on startup. */ - LJ_LIB_REG(L, LUA_MATHLIBNAME, math); -#if defined(LUA_COMPAT_MOD) && !LJ_52 - lua_getfield(L, -1, "fmod"); - lua_setfield(L, -2, "mod"); -#endif - return 1; -} - diff --git a/subprojects/luajit/src/lib_os.c b/subprojects/luajit/src/lib_os.c deleted file mode 100644 index 05b324950..000000000 --- a/subprojects/luajit/src/lib_os.c +++ /dev/null @@ -1,304 +0,0 @@ -/* -** OS library. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#include -#include - -#define lib_os_c -#define LUA_LIB - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" - -#include "lj_obj.h" -#include "lj_err.h" -#include "lj_lib.h" - -#if LJ_TARGET_POSIX -#include -#else -#include -#endif - -#if !LJ_TARGET_PSVITA -#include -#endif - -/* ------------------------------------------------------------------------ */ - -#if LJ_TARGET_WINDOWS -#define WIN32_LEAN_AND_MEAN -#include - -static wchar_t *widen_static(const char *narrow, int idx) -{ - __declspec(thread) static wchar_t buffer[2][MAX_PATH]; - return MultiByteToWideChar(CP_UTF8, 0, narrow, -1, buffer[idx], MAX_PATH) ? buffer[idx] : L""; -} - -#define remove(x) _wremove(widen_static(x, 0)) -#define system(x) _wsystem(widen_static(x, 0)) -#define rename(x, y) _wrename(widen_static(x, 0), widen_static(y, 1)) -#endif - -/* ------------------------------------------------------------------------ */ - -#define LJLIB_MODULE_os - -LJLIB_CF(os_execute) -{ -#if LJ_NO_SYSTEM -#if LJ_52 - errno = ENOSYS; - return luaL_fileresult(L, 0, NULL); -#else - lua_pushinteger(L, -1); - return 1; -#endif -#else - const char *cmd = luaL_optstring(L, 1, NULL); - int stat = system(cmd); -#if LJ_52 - if (cmd) - return luaL_execresult(L, stat); - setboolV(L->top++, 1); -#else - setintV(L->top++, stat); -#endif - return 1; -#endif -} - -LJLIB_CF(os_remove) -{ - const char *filename = luaL_checkstring(L, 1); - return luaL_fileresult(L, remove(filename) == 0, filename); -} - -LJLIB_CF(os_rename) -{ - const char *fromname = luaL_checkstring(L, 1); - const char *toname = luaL_checkstring(L, 2); - return luaL_fileresult(L, rename(fromname, toname) == 0, fromname); -} - -LJLIB_CF(os_tmpname) -{ -#if LJ_TARGET_PS3 || LJ_TARGET_PS4 || LJ_TARGET_PSVITA - lj_err_caller(L, LJ_ERR_OSUNIQF); - return 0; -#else -#if LJ_TARGET_POSIX - char buf[15+1]; - int fp; - strcpy(buf, "/tmp/lua_XXXXXX"); - fp = mkstemp(buf); - if (fp != -1) - close(fp); - else - lj_err_caller(L, LJ_ERR_OSUNIQF); -#else - char buf[L_tmpnam]; - if (tmpnam(buf) == NULL) - lj_err_caller(L, LJ_ERR_OSUNIQF); -#endif - lua_pushstring(L, buf); - return 1; -#endif -} - -LJLIB_CF(os_getenv) -{ -#if LJ_TARGET_CONSOLE - lua_pushnil(L); -#else - lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */ -#endif - return 1; -} - -LJLIB_CF(os_exit) -{ - int status; - if (L->base < L->top && tvisbool(L->base)) - status = boolV(L->base) ? EXIT_SUCCESS : EXIT_FAILURE; - else - status = lj_lib_optint(L, 1, EXIT_SUCCESS); - if (L->base+1 < L->top && tvistruecond(L->base+1)) - lua_close(L); - exit(status); - return 0; /* Unreachable. */ -} - -LJLIB_CF(os_clock) -{ - setnumV(L->top++, ((lua_Number)clock())*(1.0/(lua_Number)CLOCKS_PER_SEC)); - return 1; -} - -/* ------------------------------------------------------------------------ */ - -static void setfield(lua_State *L, const char *key, int value) -{ - lua_pushinteger(L, value); - lua_setfield(L, -2, key); -} - -static void setboolfield(lua_State *L, const char *key, int value) -{ - if (value < 0) /* undefined? */ - return; /* does not set field */ - lua_pushboolean(L, value); - lua_setfield(L, -2, key); -} - -static int getboolfield(lua_State *L, const char *key) -{ - int res; - lua_getfield(L, -1, key); - res = lua_isnil(L, -1) ? -1 : lua_toboolean(L, -1); - lua_pop(L, 1); - return res; -} - -static int getfield(lua_State *L, const char *key, int d) -{ - int res; - lua_getfield(L, -1, key); - if (lua_isnumber(L, -1)) { - res = (int)lua_tointeger(L, -1); - } else { - if (d < 0) - lj_err_callerv(L, LJ_ERR_OSDATEF, key); - res = d; - } - lua_pop(L, 1); - return res; -} - -LJLIB_CF(os_date) -{ - const char *s = luaL_optstring(L, 1, "%c"); - time_t t = luaL_opt(L, (time_t)luaL_checknumber, 2, time(NULL)); - struct tm *stm; -#if LJ_TARGET_POSIX - struct tm rtm; -#endif - if (*s == '!') { /* UTC? */ - s++; /* Skip '!' */ -#if LJ_TARGET_POSIX - stm = gmtime_r(&t, &rtm); -#else - stm = gmtime(&t); -#endif - } else { -#if LJ_TARGET_POSIX - stm = localtime_r(&t, &rtm); -#else - stm = localtime(&t); -#endif - } - if (stm == NULL) { /* Invalid date? */ - setnilV(L->top-1); - } else if (strcmp(s, "*t") == 0) { - lua_createtable(L, 0, 9); /* 9 = number of fields */ - setfield(L, "sec", stm->tm_sec); - setfield(L, "min", stm->tm_min); - setfield(L, "hour", stm->tm_hour); - setfield(L, "day", stm->tm_mday); - setfield(L, "month", stm->tm_mon+1); - setfield(L, "year", stm->tm_year+1900); - setfield(L, "wday", stm->tm_wday+1); - setfield(L, "yday", stm->tm_yday+1); - setboolfield(L, "isdst", stm->tm_isdst); - } else { - char cc[3]; - luaL_Buffer b; - cc[0] = '%'; cc[2] = '\0'; - luaL_buffinit(L, &b); - for (; *s; s++) { - if (*s != '%' || *(s + 1) == '\0') { /* No conversion specifier? */ - luaL_addchar(&b, *s); - } else { - size_t reslen; - char buff[200]; /* Should be big enough for any conversion result. */ - cc[1] = *(++s); - reslen = strftime(buff, sizeof(buff), cc, stm); - luaL_addlstring(&b, buff, reslen); - } - } - luaL_pushresult(&b); - } - return 1; -} - -LJLIB_CF(os_time) -{ - time_t t; - if (lua_isnoneornil(L, 1)) { /* called without args? */ - t = time(NULL); /* get current time */ - } else { - struct tm ts; - luaL_checktype(L, 1, LUA_TTABLE); - lua_settop(L, 1); /* make sure table is at the top */ - ts.tm_sec = getfield(L, "sec", 0); - ts.tm_min = getfield(L, "min", 0); - ts.tm_hour = getfield(L, "hour", 12); - ts.tm_mday = getfield(L, "day", -1); - ts.tm_mon = getfield(L, "month", -1) - 1; - ts.tm_year = getfield(L, "year", -1) - 1900; - ts.tm_isdst = getboolfield(L, "isdst"); - t = mktime(&ts); - } - if (t == (time_t)(-1)) - lua_pushnil(L); - else - lua_pushnumber(L, (lua_Number)t); - return 1; -} - -LJLIB_CF(os_difftime) -{ - lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)), - (time_t)(luaL_optnumber(L, 2, (lua_Number)0)))); - return 1; -} - -/* ------------------------------------------------------------------------ */ - -LJLIB_CF(os_setlocale) -{ -#if LJ_TARGET_PSVITA - lua_pushliteral(L, "C"); -#else - GCstr *s = lj_lib_optstr(L, 1); - const char *str = s ? strdata(s) : NULL; - int opt = lj_lib_checkopt(L, 2, 6, - "\5ctype\7numeric\4time\7collate\10monetary\1\377\3all"); - if (opt == 0) opt = LC_CTYPE; - else if (opt == 1) opt = LC_NUMERIC; - else if (opt == 2) opt = LC_TIME; - else if (opt == 3) opt = LC_COLLATE; - else if (opt == 4) opt = LC_MONETARY; - else if (opt == 6) opt = LC_ALL; - lua_pushstring(L, setlocale(opt, str)); -#endif - return 1; -} - -/* ------------------------------------------------------------------------ */ - -#include "lj_libdef.h" - -LUALIB_API int luaopen_os(lua_State *L) -{ - LJ_LIB_REG(L, LUA_OSLIBNAME, os); - return 1; -} - diff --git a/subprojects/luajit/src/lib_package.c b/subprojects/luajit/src/lib_package.c deleted file mode 100644 index 01b63d638..000000000 --- a/subprojects/luajit/src/lib_package.c +++ /dev/null @@ -1,602 +0,0 @@ -/* -** Package library. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2012 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#define lib_package_c -#define LUA_LIB - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" - -#include "lj_obj.h" -#include "lj_err.h" -#include "lj_lib.h" - -/* ------------------------------------------------------------------------ */ - -/* Error codes for ll_loadfunc. */ -#define PACKAGE_ERR_LIB 1 -#define PACKAGE_ERR_FUNC 2 -#define PACKAGE_ERR_LOAD 3 - -/* Redefined in platform specific part. */ -#define PACKAGE_LIB_FAIL "open" -#define setprogdir(L) ((void)0) - -/* Symbol name prefixes. */ -#define SYMPREFIX_CF "luaopen_%s" -#define SYMPREFIX_BC "luaJIT_BC_%s" - -#if LJ_TARGET_DLOPEN - -#include - -static void ll_unloadlib(void *lib) -{ - dlclose(lib); -} - -static void *ll_load(lua_State *L, const char *path, int gl) -{ - void *lib = dlopen(path, RTLD_NOW | (gl ? RTLD_GLOBAL : RTLD_LOCAL)); - if (lib == NULL) lua_pushstring(L, dlerror()); - return lib; -} - -static lua_CFunction ll_sym(lua_State *L, void *lib, const char *sym) -{ - lua_CFunction f = (lua_CFunction)dlsym(lib, sym); - if (f == NULL) lua_pushstring(L, dlerror()); - return f; -} - -static const char *ll_bcsym(void *lib, const char *sym) -{ -#if defined(RTLD_DEFAULT) - if (lib == NULL) lib = RTLD_DEFAULT; -#elif LJ_TARGET_OSX || LJ_TARGET_BSD - if (lib == NULL) lib = (void *)(intptr_t)-2; -#endif - return (const char *)dlsym(lib, sym); -} - -#elif LJ_TARGET_WINDOWS - -#define WIN32_LEAN_AND_MEAN -#include - -#ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS -#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 4 -#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT 2 -BOOL WINAPI GetModuleHandleExA(DWORD, LPCSTR, HMODULE*); -#endif - -#undef setprogdir - -static void setprogdir(lua_State *L) -{ - char buff[MAX_PATH + 1]; - char *lb; - DWORD nsize = sizeof(buff); - DWORD n = GetModuleFileNameA(NULL, buff, nsize); - if (n == 0 || n == nsize || (lb = strrchr(buff, '\\')) == NULL) { - luaL_error(L, "unable to get ModuleFileName"); - } else { - *lb = '\0'; - luaL_gsub(L, lua_tostring(L, -1), LUA_EXECDIR, buff); - lua_remove(L, -2); /* remove original string */ - } -} - -static void pusherror(lua_State *L) -{ - DWORD error = GetLastError(); - char buffer[128]; - if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, error, 0, buffer, sizeof(buffer), NULL)) - lua_pushstring(L, buffer); - else - lua_pushfstring(L, "system error %d\n", error); -} - -static void ll_unloadlib(void *lib) -{ - FreeLibrary((HINSTANCE)lib); -} - -static void *ll_load(lua_State *L, const char *path, int gl) -{ - HINSTANCE lib = LoadLibraryA(path); - if (lib == NULL) pusherror(L); - UNUSED(gl); - return lib; -} - -static lua_CFunction ll_sym(lua_State *L, void *lib, const char *sym) -{ - lua_CFunction f = (lua_CFunction)GetProcAddress((HINSTANCE)lib, sym); - if (f == NULL) pusherror(L); - return f; -} - -static const char *ll_bcsym(void *lib, const char *sym) -{ - if (lib) { - return (const char *)GetProcAddress((HINSTANCE)lib, sym); - } else { - HINSTANCE h = GetModuleHandleA(NULL); - const char *p = (const char *)GetProcAddress(h, sym); - if (p == NULL && GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - (const char *)ll_bcsym, &h)) - p = (const char *)GetProcAddress(h, sym); - return p; - } -} - -#else - -#undef PACKAGE_LIB_FAIL -#define PACKAGE_LIB_FAIL "absent" - -#define DLMSG "dynamic libraries not enabled; no support for target OS" - -static void ll_unloadlib(void *lib) -{ - UNUSED(lib); -} - -static void *ll_load(lua_State *L, const char *path, int gl) -{ - UNUSED(path); UNUSED(gl); - lua_pushliteral(L, DLMSG); - return NULL; -} - -static lua_CFunction ll_sym(lua_State *L, void *lib, const char *sym) -{ - UNUSED(lib); UNUSED(sym); - lua_pushliteral(L, DLMSG); - return NULL; -} - -static const char *ll_bcsym(void *lib, const char *sym) -{ - UNUSED(lib); UNUSED(sym); - return NULL; -} - -#endif - -/* ------------------------------------------------------------------------ */ - -static void **ll_register(lua_State *L, const char *path) -{ - void **plib; - lua_pushfstring(L, "LOADLIB: %s", path); - lua_gettable(L, LUA_REGISTRYINDEX); /* check library in registry? */ - if (!lua_isnil(L, -1)) { /* is there an entry? */ - plib = (void **)lua_touserdata(L, -1); - } else { /* no entry yet; create one */ - lua_pop(L, 1); - plib = (void **)lua_newuserdata(L, sizeof(void *)); - *plib = NULL; - luaL_getmetatable(L, "_LOADLIB"); - lua_setmetatable(L, -2); - lua_pushfstring(L, "LOADLIB: %s", path); - lua_pushvalue(L, -2); - lua_settable(L, LUA_REGISTRYINDEX); - } - return plib; -} - -static const char *mksymname(lua_State *L, const char *modname, - const char *prefix) -{ - const char *funcname; - const char *mark = strchr(modname, *LUA_IGMARK); - if (mark) modname = mark + 1; - funcname = luaL_gsub(L, modname, ".", "_"); - funcname = lua_pushfstring(L, prefix, funcname); - lua_remove(L, -2); /* remove 'gsub' result */ - return funcname; -} - -static int ll_loadfunc(lua_State *L, const char *path, const char *name, int r) -{ - void **reg = ll_register(L, path); - if (*reg == NULL) *reg = ll_load(L, path, (*name == '*')); - if (*reg == NULL) { - return PACKAGE_ERR_LIB; /* Unable to load library. */ - } else if (*name == '*') { /* Only load library into global namespace. */ - lua_pushboolean(L, 1); - return 0; - } else { - const char *sym = r ? name : mksymname(L, name, SYMPREFIX_CF); - lua_CFunction f = ll_sym(L, *reg, sym); - if (f) { - lua_pushcfunction(L, f); - return 0; - } - if (!r) { - const char *bcdata = ll_bcsym(*reg, mksymname(L, name, SYMPREFIX_BC)); - lua_pop(L, 1); - if (bcdata) { - if (luaL_loadbuffer(L, bcdata, ~(size_t)0, name) != 0) - return PACKAGE_ERR_LOAD; - return 0; - } - } - return PACKAGE_ERR_FUNC; /* Unable to find function. */ - } -} - -static int lj_cf_package_loadlib(lua_State *L) -{ - const char *path = luaL_checkstring(L, 1); - const char *init = luaL_checkstring(L, 2); - int st = ll_loadfunc(L, path, init, 1); - if (st == 0) { /* no errors? */ - return 1; /* return the loaded function */ - } else { /* error; error message is on stack top */ - lua_pushnil(L); - lua_insert(L, -2); - lua_pushstring(L, (st == PACKAGE_ERR_LIB) ? PACKAGE_LIB_FAIL : "init"); - return 3; /* return nil, error message, and where */ - } -} - -static int lj_cf_package_unloadlib(lua_State *L) -{ - void **lib = (void **)luaL_checkudata(L, 1, "_LOADLIB"); - if (*lib) ll_unloadlib(*lib); - *lib = NULL; /* mark library as closed */ - return 0; -} - -/* ------------------------------------------------------------------------ */ - -static int readable(const char *filename) -{ - FILE *f = fopen(filename, "r"); /* try to open file */ - if (f == NULL) return 0; /* open failed */ - fclose(f); - return 1; -} - -static const char *pushnexttemplate(lua_State *L, const char *path) -{ - const char *l; - while (*path == *LUA_PATHSEP) path++; /* skip separators */ - if (*path == '\0') return NULL; /* no more templates */ - l = strchr(path, *LUA_PATHSEP); /* find next separator */ - if (l == NULL) l = path + strlen(path); - lua_pushlstring(L, path, (size_t)(l - path)); /* template */ - return l; -} - -static const char *searchpath (lua_State *L, const char *name, - const char *path, const char *sep, - const char *dirsep) -{ - luaL_Buffer msg; /* to build error message */ - luaL_buffinit(L, &msg); - if (*sep != '\0') /* non-empty separator? */ - name = luaL_gsub(L, name, sep, dirsep); /* replace it by 'dirsep' */ - while ((path = pushnexttemplate(L, path)) != NULL) { - const char *filename = luaL_gsub(L, lua_tostring(L, -1), - LUA_PATH_MARK, name); - lua_remove(L, -2); /* remove path template */ - if (readable(filename)) /* does file exist and is readable? */ - return filename; /* return that file name */ - lua_pushfstring(L, "\n\tno file " LUA_QS, filename); - lua_remove(L, -2); /* remove file name */ - luaL_addvalue(&msg); /* concatenate error msg. entry */ - } - luaL_pushresult(&msg); /* create error message */ - return NULL; /* not found */ -} - -static int lj_cf_package_searchpath(lua_State *L) -{ - const char *f = searchpath(L, luaL_checkstring(L, 1), - luaL_checkstring(L, 2), - luaL_optstring(L, 3, "."), - luaL_optstring(L, 4, LUA_DIRSEP)); - if (f != NULL) { - return 1; - } else { /* error message is on top of the stack */ - lua_pushnil(L); - lua_insert(L, -2); - return 2; /* return nil + error message */ - } -} - -static const char *findfile(lua_State *L, const char *name, - const char *pname) -{ - const char *path; - lua_getfield(L, LUA_ENVIRONINDEX, pname); - path = lua_tostring(L, -1); - if (path == NULL) - luaL_error(L, LUA_QL("package.%s") " must be a string", pname); - return searchpath(L, name, path, ".", LUA_DIRSEP); -} - -static void loaderror(lua_State *L, const char *filename) -{ - luaL_error(L, "error loading module " LUA_QS " from file " LUA_QS ":\n\t%s", - lua_tostring(L, 1), filename, lua_tostring(L, -1)); -} - -static int lj_cf_package_loader_lua(lua_State *L) -{ - const char *filename; - const char *name = luaL_checkstring(L, 1); - filename = findfile(L, name, "path"); - if (filename == NULL) return 1; /* library not found in this path */ - if (luaL_loadfile(L, filename) != 0) - loaderror(L, filename); - return 1; /* library loaded successfully */ -} - -static int lj_cf_package_loader_c(lua_State *L) -{ - const char *name = luaL_checkstring(L, 1); - const char *filename = findfile(L, name, "cpath"); - if (filename == NULL) return 1; /* library not found in this path */ - if (ll_loadfunc(L, filename, name, 0) != 0) - loaderror(L, filename); - return 1; /* library loaded successfully */ -} - -static int lj_cf_package_loader_croot(lua_State *L) -{ - const char *filename; - const char *name = luaL_checkstring(L, 1); - const char *p = strchr(name, '.'); - int st; - if (p == NULL) return 0; /* is root */ - lua_pushlstring(L, name, (size_t)(p - name)); - filename = findfile(L, lua_tostring(L, -1), "cpath"); - if (filename == NULL) return 1; /* root not found */ - if ((st = ll_loadfunc(L, filename, name, 0)) != 0) { - if (st != PACKAGE_ERR_FUNC) loaderror(L, filename); /* real error */ - lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS, - name, filename); - return 1; /* function not found */ - } - return 1; -} - -static int lj_cf_package_loader_preload(lua_State *L) -{ - const char *name = luaL_checkstring(L, 1); - lua_getfield(L, LUA_ENVIRONINDEX, "preload"); - if (!lua_istable(L, -1)) - luaL_error(L, LUA_QL("package.preload") " must be a table"); - lua_getfield(L, -1, name); - if (lua_isnil(L, -1)) { /* Not found? */ - const char *bcname = mksymname(L, name, SYMPREFIX_BC); - const char *bcdata = ll_bcsym(NULL, bcname); - if (bcdata == NULL || luaL_loadbuffer(L, bcdata, ~(size_t)0, name) != 0) - lua_pushfstring(L, "\n\tno field package.preload['%s']", name); - } - return 1; -} - -/* ------------------------------------------------------------------------ */ - -static const int sentinel_ = 0; -#define sentinel ((void *)&sentinel_) - -static int lj_cf_package_require(lua_State *L) -{ - const char *name = luaL_checkstring(L, 1); - int i; - lua_settop(L, 1); /* _LOADED table will be at index 2 */ - lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); - lua_getfield(L, 2, name); - if (lua_toboolean(L, -1)) { /* is it there? */ - if (lua_touserdata(L, -1) == sentinel) /* check loops */ - luaL_error(L, "loop or previous error loading module " LUA_QS, name); - return 1; /* package is already loaded */ - } - /* else must load it; iterate over available loaders */ - lua_getfield(L, LUA_ENVIRONINDEX, "loaders"); - if (!lua_istable(L, -1)) - luaL_error(L, LUA_QL("package.loaders") " must be a table"); - lua_pushliteral(L, ""); /* error message accumulator */ - for (i = 1; ; i++) { - lua_rawgeti(L, -2, i); /* get a loader */ - if (lua_isnil(L, -1)) - luaL_error(L, "module " LUA_QS " not found:%s", - name, lua_tostring(L, -2)); - lua_pushstring(L, name); - lua_call(L, 1, 1); /* call it */ - if (lua_isfunction(L, -1)) /* did it find module? */ - break; /* module loaded successfully */ - else if (lua_isstring(L, -1)) /* loader returned error message? */ - lua_concat(L, 2); /* accumulate it */ - else - lua_pop(L, 1); - } - lua_pushlightuserdata(L, sentinel); - lua_setfield(L, 2, name); /* _LOADED[name] = sentinel */ - lua_pushstring(L, name); /* pass name as argument to module */ - lua_call(L, 1, 1); /* run loaded module */ - if (!lua_isnil(L, -1)) /* non-nil return? */ - lua_setfield(L, 2, name); /* _LOADED[name] = returned value */ - lua_getfield(L, 2, name); - if (lua_touserdata(L, -1) == sentinel) { /* module did not set a value? */ - lua_pushboolean(L, 1); /* use true as result */ - lua_pushvalue(L, -1); /* extra copy to be returned */ - lua_setfield(L, 2, name); /* _LOADED[name] = true */ - } - lj_lib_checkfpu(L); - return 1; -} - -/* ------------------------------------------------------------------------ */ - -static void setfenv(lua_State *L) -{ - lua_Debug ar; - if (lua_getstack(L, 1, &ar) == 0 || - lua_getinfo(L, "f", &ar) == 0 || /* get calling function */ - lua_iscfunction(L, -1)) - luaL_error(L, LUA_QL("module") " not called from a Lua function"); - lua_pushvalue(L, -2); - lua_setfenv(L, -2); - lua_pop(L, 1); -} - -static void dooptions(lua_State *L, int n) -{ - int i; - for (i = 2; i <= n; i++) { - lua_pushvalue(L, i); /* get option (a function) */ - lua_pushvalue(L, -2); /* module */ - lua_call(L, 1, 0); - } -} - -static void modinit(lua_State *L, const char *modname) -{ - const char *dot; - lua_pushvalue(L, -1); - lua_setfield(L, -2, "_M"); /* module._M = module */ - lua_pushstring(L, modname); - lua_setfield(L, -2, "_NAME"); - dot = strrchr(modname, '.'); /* look for last dot in module name */ - if (dot == NULL) dot = modname; else dot++; - /* set _PACKAGE as package name (full module name minus last part) */ - lua_pushlstring(L, modname, (size_t)(dot - modname)); - lua_setfield(L, -2, "_PACKAGE"); -} - -static int lj_cf_package_module(lua_State *L) -{ - const char *modname = luaL_checkstring(L, 1); - int loaded = lua_gettop(L) + 1; /* index of _LOADED table */ - lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); - lua_getfield(L, loaded, modname); /* get _LOADED[modname] */ - if (!lua_istable(L, -1)) { /* not found? */ - lua_pop(L, 1); /* remove previous result */ - /* try global variable (and create one if it does not exist) */ - if (luaL_findtable(L, LUA_GLOBALSINDEX, modname, 1) != NULL) - lj_err_callerv(L, LJ_ERR_BADMODN, modname); - lua_pushvalue(L, -1); - lua_setfield(L, loaded, modname); /* _LOADED[modname] = new table */ - } - /* check whether table already has a _NAME field */ - lua_getfield(L, -1, "_NAME"); - if (!lua_isnil(L, -1)) { /* is table an initialized module? */ - lua_pop(L, 1); - } else { /* no; initialize it */ - lua_pop(L, 1); - modinit(L, modname); - } - lua_pushvalue(L, -1); - setfenv(L); - dooptions(L, loaded - 1); - return 0; -} - -static int lj_cf_package_seeall(lua_State *L) -{ - luaL_checktype(L, 1, LUA_TTABLE); - if (!lua_getmetatable(L, 1)) { - lua_createtable(L, 0, 1); /* create new metatable */ - lua_pushvalue(L, -1); - lua_setmetatable(L, 1); - } - lua_pushvalue(L, LUA_GLOBALSINDEX); - lua_setfield(L, -2, "__index"); /* mt.__index = _G */ - return 0; -} - -/* ------------------------------------------------------------------------ */ - -#define AUXMARK "\1" - -static void setpath(lua_State *L, const char *fieldname, const char *envname, - const char *def, int noenv) -{ -#if LJ_TARGET_CONSOLE - const char *path = NULL; - UNUSED(envname); -#else - const char *path = getenv(envname); -#endif - if (path == NULL || noenv) { - lua_pushstring(L, def); - } else { - path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP, - LUA_PATHSEP AUXMARK LUA_PATHSEP); - luaL_gsub(L, path, AUXMARK, def); - lua_remove(L, -2); - } - setprogdir(L); - lua_setfield(L, -2, fieldname); -} - -static const luaL_Reg package_lib[] = { - { "loadlib", lj_cf_package_loadlib }, - { "searchpath", lj_cf_package_searchpath }, - { "seeall", lj_cf_package_seeall }, - { NULL, NULL } -}; - -static const luaL_Reg package_global[] = { - { "module", lj_cf_package_module }, - { "require", lj_cf_package_require }, - { NULL, NULL } -}; - -static const lua_CFunction package_loaders[] = -{ - lj_cf_package_loader_preload, - lj_cf_package_loader_lua, - lj_cf_package_loader_c, - lj_cf_package_loader_croot, - NULL -}; - -LUALIB_API int luaopen_package(lua_State *L) -{ - int i; - int noenv; - luaL_newmetatable(L, "_LOADLIB"); - lj_lib_pushcf(L, lj_cf_package_unloadlib, 1); - lua_setfield(L, -2, "__gc"); - luaL_register(L, LUA_LOADLIBNAME, package_lib); - lua_pushvalue(L, -1); - lua_replace(L, LUA_ENVIRONINDEX); - lua_createtable(L, sizeof(package_loaders)/sizeof(package_loaders[0])-1, 0); - for (i = 0; package_loaders[i] != NULL; i++) { - lj_lib_pushcf(L, package_loaders[i], 1); - lua_rawseti(L, -2, i+1); - } - lua_setfield(L, -2, "loaders"); - lua_getfield(L, LUA_REGISTRYINDEX, "LUA_NOENV"); - noenv = lua_toboolean(L, -1); - lua_pop(L, 1); - setpath(L, "path", LUA_PATH, LUA_PATH_DEFAULT, noenv); - setpath(L, "cpath", LUA_CPATH, LUA_CPATH_DEFAULT, noenv); - lua_pushliteral(L, LUA_PATH_CONFIG); - lua_setfield(L, -2, "config"); - luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 16); - lua_setfield(L, -2, "loaded"); - luaL_findtable(L, LUA_REGISTRYINDEX, "_PRELOAD", 4); - lua_setfield(L, -2, "preload"); - lua_pushvalue(L, LUA_GLOBALSINDEX); - luaL_register(L, NULL, package_global); - lua_pop(L, 1); - return 1; -} - diff --git a/subprojects/luajit/src/lib_string.c b/subprojects/luajit/src/lib_string.c deleted file mode 100644 index d1a60b617..000000000 --- a/subprojects/luajit/src/lib_string.c +++ /dev/null @@ -1,940 +0,0 @@ -/* -** String library. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#include - -#define lib_string_c -#define LUA_LIB - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_meta.h" -#include "lj_state.h" -#include "lj_ff.h" -#include "lj_bcdump.h" -#include "lj_char.h" -#include "lj_lib.h" - -/* ------------------------------------------------------------------------ */ - -#define LJLIB_MODULE_string - -LJLIB_ASM(string_len) LJLIB_REC(.) -{ - lj_lib_checkstr(L, 1); - return FFH_RETRY; -} - -LJLIB_ASM(string_byte) LJLIB_REC(string_range 0) -{ - GCstr *s = lj_lib_checkstr(L, 1); - int32_t len = (int32_t)s->len; - int32_t start = lj_lib_optint(L, 2, 1); - int32_t stop = lj_lib_optint(L, 3, start); - int32_t n, i; - const unsigned char *p; - if (stop < 0) stop += len+1; - if (start < 0) start += len+1; - if (start <= 0) start = 1; - if (stop > len) stop = len; - if (start > stop) return FFH_RES(0); /* Empty interval: return no results. */ - start--; - n = stop - start; - if ((uint32_t)n > LUAI_MAXCSTACK) - lj_err_caller(L, LJ_ERR_STRSLC); - lj_state_checkstack(L, (MSize)n); - p = (const unsigned char *)strdata(s) + start; - for (i = 0; i < n; i++) - setintV(L->base + i-1, p[i]); - return FFH_RES(n); -} - -LJLIB_ASM(string_char) -{ - int i, nargs = (int)(L->top - L->base); - char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, (MSize)nargs); - for (i = 1; i <= nargs; i++) { - int32_t k = lj_lib_checkint(L, i); - if (!checku8(k)) - lj_err_arg(L, i, LJ_ERR_BADVAL); - buf[i-1] = (char)k; - } - setstrV(L, L->base-1, lj_str_new(L, buf, (size_t)nargs)); - return FFH_RES(1); -} - -LJLIB_ASM(string_sub) LJLIB_REC(string_range 1) -{ - lj_lib_checkstr(L, 1); - lj_lib_checkint(L, 2); - setintV(L->base+2, lj_lib_optint(L, 3, -1)); - return FFH_RETRY; -} - -LJLIB_ASM(string_rep) -{ - GCstr *s = lj_lib_checkstr(L, 1); - int32_t k = lj_lib_checkint(L, 2); - GCstr *sep = lj_lib_optstr(L, 3); - int32_t len = (int32_t)s->len; - global_State *g = G(L); - int64_t tlen; - const char *src; - char *buf; - if (k <= 0) { - empty: - setstrV(L, L->base-1, &g->strempty); - return FFH_RES(1); - } - if (sep) { - tlen = (int64_t)len + sep->len; - if (tlen > LJ_MAX_STR) - lj_err_caller(L, LJ_ERR_STROV); - tlen *= k; - if (tlen > LJ_MAX_STR) - lj_err_caller(L, LJ_ERR_STROV); - } else { - tlen = (int64_t)k * len; - if (tlen > LJ_MAX_STR) - lj_err_caller(L, LJ_ERR_STROV); - } - if (tlen == 0) goto empty; - buf = lj_str_needbuf(L, &g->tmpbuf, (MSize)tlen); - src = strdata(s); - if (sep) { - tlen -= sep->len; /* Ignore trailing separator. */ - if (k > 1) { /* Paste one string and one separator. */ - int32_t i; - i = 0; while (i < len) *buf++ = src[i++]; - src = strdata(sep); len = sep->len; - i = 0; while (i < len) *buf++ = src[i++]; - src = g->tmpbuf.buf; len += s->len; k--; /* Now copy that k-1 times. */ - } - } - do { - int32_t i = 0; - do { *buf++ = src[i++]; } while (i < len); - } while (--k > 0); - setstrV(L, L->base-1, lj_str_new(L, g->tmpbuf.buf, (size_t)tlen)); - return FFH_RES(1); -} - -LJLIB_ASM(string_reverse) -{ - GCstr *s = lj_lib_checkstr(L, 1); - lj_str_needbuf(L, &G(L)->tmpbuf, s->len); - return FFH_RETRY; -} -LJLIB_ASM_(string_lower) -LJLIB_ASM_(string_upper) - -/* ------------------------------------------------------------------------ */ - -static int writer_buf(lua_State *L, const void *p, size_t size, void *b) -{ - luaL_addlstring((luaL_Buffer *)b, (const char *)p, size); - UNUSED(L); - return 0; -} - -LJLIB_CF(string_dump) -{ - GCfunc *fn = lj_lib_checkfunc(L, 1); - int strip = L->base+1 < L->top && tvistruecond(L->base+1); - luaL_Buffer b; - L->top = L->base+1; - luaL_buffinit(L, &b); - if (!isluafunc(fn) || lj_bcwrite(L, funcproto(fn), writer_buf, &b, strip)) - lj_err_caller(L, LJ_ERR_STRDUMP); - luaL_pushresult(&b); - return 1; -} - -/* ------------------------------------------------------------------------ */ - -/* macro to `unsign' a character */ -#define uchar(c) ((unsigned char)(c)) - -#define CAP_UNFINISHED (-1) -#define CAP_POSITION (-2) - -typedef struct MatchState { - const char *src_init; /* init of source string */ - const char *src_end; /* end (`\0') of source string */ - lua_State *L; - int level; /* total number of captures (finished or unfinished) */ - int depth; - struct { - const char *init; - ptrdiff_t len; - } capture[LUA_MAXCAPTURES]; -} MatchState; - -#define L_ESC '%' -#define SPECIALS "^$*+?.([%-" - -static int check_capture(MatchState *ms, int l) -{ - l -= '1'; - if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED) - lj_err_caller(ms->L, LJ_ERR_STRCAPI); - return l; -} - -static int capture_to_close(MatchState *ms) -{ - int level = ms->level; - for (level--; level>=0; level--) - if (ms->capture[level].len == CAP_UNFINISHED) return level; - lj_err_caller(ms->L, LJ_ERR_STRPATC); - return 0; /* unreachable */ -} - -static const char *classend(MatchState *ms, const char *p) -{ - switch (*p++) { - case L_ESC: - if (*p == '\0') - lj_err_caller(ms->L, LJ_ERR_STRPATE); - return p+1; - case '[': - if (*p == '^') p++; - do { /* look for a `]' */ - if (*p == '\0') - lj_err_caller(ms->L, LJ_ERR_STRPATM); - if (*(p++) == L_ESC && *p != '\0') - p++; /* skip escapes (e.g. `%]') */ - } while (*p != ']'); - return p+1; - default: - return p; - } -} - -static const unsigned char match_class_map[32] = { - 0,LJ_CHAR_ALPHA,0,LJ_CHAR_CNTRL,LJ_CHAR_DIGIT,0,0,LJ_CHAR_GRAPH,0,0,0,0, - LJ_CHAR_LOWER,0,0,0,LJ_CHAR_PUNCT,0,0,LJ_CHAR_SPACE,0, - LJ_CHAR_UPPER,0,LJ_CHAR_ALNUM,LJ_CHAR_XDIGIT,0,0,0,0,0,0,0 -}; - -static int match_class(int c, int cl) -{ - if ((cl & 0xc0) == 0x40) { - int t = match_class_map[(cl&0x1f)]; - if (t) { - t = lj_char_isa(c, t); - return (cl & 0x20) ? t : !t; - } - if (cl == 'z') return c == 0; - if (cl == 'Z') return c != 0; - } - return (cl == c); -} - -static int matchbracketclass(int c, const char *p, const char *ec) -{ - int sig = 1; - if (*(p+1) == '^') { - sig = 0; - p++; /* skip the `^' */ - } - while (++p < ec) { - if (*p == L_ESC) { - p++; - if (match_class(c, uchar(*p))) - return sig; - } - else if ((*(p+1) == '-') && (p+2 < ec)) { - p+=2; - if (uchar(*(p-2)) <= c && c <= uchar(*p)) - return sig; - } - else if (uchar(*p) == c) return sig; - } - return !sig; -} - -static int singlematch(int c, const char *p, const char *ep) -{ - switch (*p) { - case '.': return 1; /* matches any char */ - case L_ESC: return match_class(c, uchar(*(p+1))); - case '[': return matchbracketclass(c, p, ep-1); - default: return (uchar(*p) == c); - } -} - -static const char *match(MatchState *ms, const char *s, const char *p); - -static const char *matchbalance(MatchState *ms, const char *s, const char *p) -{ - if (*p == 0 || *(p+1) == 0) - lj_err_caller(ms->L, LJ_ERR_STRPATU); - if (*s != *p) { - return NULL; - } else { - int b = *p; - int e = *(p+1); - int cont = 1; - while (++s < ms->src_end) { - if (*s == e) { - if (--cont == 0) return s+1; - } else if (*s == b) { - cont++; - } - } - } - return NULL; /* string ends out of balance */ -} - -static const char *max_expand(MatchState *ms, const char *s, - const char *p, const char *ep) -{ - ptrdiff_t i = 0; /* counts maximum expand for item */ - while ((s+i)src_end && singlematch(uchar(*(s+i)), p, ep)) - i++; - /* keeps trying to match with the maximum repetitions */ - while (i>=0) { - const char *res = match(ms, (s+i), ep+1); - if (res) return res; - i--; /* else didn't match; reduce 1 repetition to try again */ - } - return NULL; -} - -static const char *min_expand(MatchState *ms, const char *s, - const char *p, const char *ep) -{ - for (;;) { - const char *res = match(ms, s, ep+1); - if (res != NULL) - return res; - else if (ssrc_end && singlematch(uchar(*s), p, ep)) - s++; /* try with one more repetition */ - else - return NULL; - } -} - -static const char *start_capture(MatchState *ms, const char *s, - const char *p, int what) -{ - const char *res; - int level = ms->level; - if (level >= LUA_MAXCAPTURES) lj_err_caller(ms->L, LJ_ERR_STRCAPN); - ms->capture[level].init = s; - ms->capture[level].len = what; - ms->level = level+1; - if ((res=match(ms, s, p)) == NULL) /* match failed? */ - ms->level--; /* undo capture */ - return res; -} - -static const char *end_capture(MatchState *ms, const char *s, - const char *p) -{ - int l = capture_to_close(ms); - const char *res; - ms->capture[l].len = s - ms->capture[l].init; /* close capture */ - if ((res = match(ms, s, p)) == NULL) /* match failed? */ - ms->capture[l].len = CAP_UNFINISHED; /* undo capture */ - return res; -} - -static const char *match_capture(MatchState *ms, const char *s, int l) -{ - size_t len; - l = check_capture(ms, l); - len = (size_t)ms->capture[l].len; - if ((size_t)(ms->src_end-s) >= len && - memcmp(ms->capture[l].init, s, len) == 0) - return s+len; - else - return NULL; -} - -static const char *match(MatchState *ms, const char *s, const char *p) -{ - if (++ms->depth > LJ_MAX_XLEVEL) - lj_err_caller(ms->L, LJ_ERR_STRPATX); - init: /* using goto's to optimize tail recursion */ - switch (*p) { - case '(': /* start capture */ - if (*(p+1) == ')') /* position capture? */ - s = start_capture(ms, s, p+2, CAP_POSITION); - else - s = start_capture(ms, s, p+1, CAP_UNFINISHED); - break; - case ')': /* end capture */ - s = end_capture(ms, s, p+1); - break; - case L_ESC: - switch (*(p+1)) { - case 'b': /* balanced string? */ - s = matchbalance(ms, s, p+2); - if (s == NULL) break; - p+=4; - goto init; /* else s = match(ms, s, p+4); */ - case 'f': { /* frontier? */ - const char *ep; char previous; - p += 2; - if (*p != '[') - lj_err_caller(ms->L, LJ_ERR_STRPATB); - ep = classend(ms, p); /* points to what is next */ - previous = (s == ms->src_init) ? '\0' : *(s-1); - if (matchbracketclass(uchar(previous), p, ep-1) || - !matchbracketclass(uchar(*s), p, ep-1)) { s = NULL; break; } - p=ep; - goto init; /* else s = match(ms, s, ep); */ - } - default: - if (lj_char_isdigit(uchar(*(p+1)))) { /* capture results (%0-%9)? */ - s = match_capture(ms, s, uchar(*(p+1))); - if (s == NULL) break; - p+=2; - goto init; /* else s = match(ms, s, p+2) */ - } - goto dflt; /* case default */ - } - break; - case '\0': /* end of pattern */ - break; /* match succeeded */ - case '$': - /* is the `$' the last char in pattern? */ - if (*(p+1) != '\0') goto dflt; - if (s != ms->src_end) s = NULL; /* check end of string */ - break; - default: dflt: { /* it is a pattern item */ - const char *ep = classend(ms, p); /* points to what is next */ - int m = ssrc_end && singlematch(uchar(*s), p, ep); - switch (*ep) { - case '?': { /* optional */ - const char *res; - if (m && ((res=match(ms, s+1, ep+1)) != NULL)) { - s = res; - break; - } - p=ep+1; - goto init; /* else s = match(ms, s, ep+1); */ - } - case '*': /* 0 or more repetitions */ - s = max_expand(ms, s, p, ep); - break; - case '+': /* 1 or more repetitions */ - s = (m ? max_expand(ms, s+1, p, ep) : NULL); - break; - case '-': /* 0 or more repetitions (minimum) */ - s = min_expand(ms, s, p, ep); - break; - default: - if (m) { s++; p=ep; goto init; } /* else s = match(ms, s+1, ep); */ - s = NULL; - break; - } - break; - } - } - ms->depth--; - return s; -} - -static const char *lmemfind(const char *s1, size_t l1, - const char *s2, size_t l2) -{ - if (l2 == 0) { - return s1; /* empty strings are everywhere */ - } else if (l2 > l1) { - return NULL; /* avoids a negative `l1' */ - } else { - const char *init; /* to search for a `*s2' inside `s1' */ - l2--; /* 1st char will be checked by `memchr' */ - l1 = l1-l2; /* `s2' cannot be found after that */ - while (l1 > 0 && (init = (const char *)memchr(s1, *s2, l1)) != NULL) { - init++; /* 1st char is already checked */ - if (memcmp(init, s2+1, l2) == 0) { - return init-1; - } else { /* correct `l1' and `s1' to try again */ - l1 -= (size_t)(init-s1); - s1 = init; - } - } - return NULL; /* not found */ - } -} - -static void push_onecapture(MatchState *ms, int i, const char *s, const char *e) -{ - if (i >= ms->level) { - if (i == 0) /* ms->level == 0, too */ - lua_pushlstring(ms->L, s, (size_t)(e - s)); /* add whole match */ - else - lj_err_caller(ms->L, LJ_ERR_STRCAPI); - } else { - ptrdiff_t l = ms->capture[i].len; - if (l == CAP_UNFINISHED) lj_err_caller(ms->L, LJ_ERR_STRCAPU); - if (l == CAP_POSITION) - lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1); - else - lua_pushlstring(ms->L, ms->capture[i].init, (size_t)l); - } -} - -static int push_captures(MatchState *ms, const char *s, const char *e) -{ - int i; - int nlevels = (ms->level == 0 && s) ? 1 : ms->level; - luaL_checkstack(ms->L, nlevels, "too many captures"); - for (i = 0; i < nlevels; i++) - push_onecapture(ms, i, s, e); - return nlevels; /* number of strings pushed */ -} - -static ptrdiff_t posrelat(ptrdiff_t pos, size_t len) -{ - /* relative string position: negative means back from end */ - if (pos < 0) pos += (ptrdiff_t)len + 1; - return (pos >= 0) ? pos : 0; -} - -static int str_find_aux(lua_State *L, int find) -{ - size_t l1, l2; - const char *s = luaL_checklstring(L, 1, &l1); - const char *p = luaL_checklstring(L, 2, &l2); - ptrdiff_t init = posrelat(luaL_optinteger(L, 3, 1), l1) - 1; - if (init < 0) { - init = 0; - } else if ((size_t)(init) > l1) { -#if LJ_52 - setnilV(L->top-1); - return 1; -#else - init = (ptrdiff_t)l1; -#endif - } - if (find && (lua_toboolean(L, 4) || /* explicit request? */ - strpbrk(p, SPECIALS) == NULL)) { /* or no special characters? */ - /* do a plain search */ - const char *s2 = lmemfind(s+init, l1-(size_t)init, p, l2); - if (s2) { - lua_pushinteger(L, s2-s+1); - lua_pushinteger(L, s2-s+(ptrdiff_t)l2); - return 2; - } - } else { - MatchState ms; - int anchor = (*p == '^') ? (p++, 1) : 0; - const char *s1=s+init; - ms.L = L; - ms.src_init = s; - ms.src_end = s+l1; - do { - const char *res; - ms.level = ms.depth = 0; - if ((res=match(&ms, s1, p)) != NULL) { - if (find) { - lua_pushinteger(L, s1-s+1); /* start */ - lua_pushinteger(L, res-s); /* end */ - return push_captures(&ms, NULL, 0) + 2; - } else { - return push_captures(&ms, s1, res); - } - } - } while (s1++ < ms.src_end && !anchor); - } - lua_pushnil(L); /* not found */ - return 1; -} - -LJLIB_CF(string_find) -{ - return str_find_aux(L, 1); -} - -LJLIB_CF(string_match) -{ - return str_find_aux(L, 0); -} - -LJLIB_NOREG LJLIB_CF(string_gmatch_aux) -{ - const char *p = strVdata(lj_lib_upvalue(L, 2)); - GCstr *str = strV(lj_lib_upvalue(L, 1)); - const char *s = strdata(str); - TValue *tvpos = lj_lib_upvalue(L, 3); - const char *src = s + tvpos->u32.lo; - MatchState ms; - ms.L = L; - ms.src_init = s; - ms.src_end = s + str->len; - for (; src <= ms.src_end; src++) { - const char *e; - ms.level = ms.depth = 0; - if ((e = match(&ms, src, p)) != NULL) { - int32_t pos = (int32_t)(e - s); - if (e == src) pos++; /* Ensure progress for empty match. */ - tvpos->u32.lo = (uint32_t)pos; - return push_captures(&ms, src, e); - } - } - return 0; /* not found */ -} - -LJLIB_CF(string_gmatch) -{ - lj_lib_checkstr(L, 1); - lj_lib_checkstr(L, 2); - L->top = L->base+3; - (L->top-1)->u64 = 0; - lj_lib_pushcc(L, lj_cf_string_gmatch_aux, FF_string_gmatch_aux, 3); - return 1; -} - -static void add_s(MatchState *ms, luaL_Buffer *b, const char *s, const char *e) -{ - size_t l, i; - const char *news = lua_tolstring(ms->L, 3, &l); - for (i = 0; i < l; i++) { - if (news[i] != L_ESC) { - luaL_addchar(b, news[i]); - } else { - i++; /* skip ESC */ - if (!lj_char_isdigit(uchar(news[i]))) { - luaL_addchar(b, news[i]); - } else if (news[i] == '0') { - luaL_addlstring(b, s, (size_t)(e - s)); - } else { - push_onecapture(ms, news[i] - '1', s, e); - luaL_addvalue(b); /* add capture to accumulated result */ - } - } - } -} - -static void add_value(MatchState *ms, luaL_Buffer *b, - const char *s, const char *e) -{ - lua_State *L = ms->L; - switch (lua_type(L, 3)) { - case LUA_TNUMBER: - case LUA_TSTRING: { - add_s(ms, b, s, e); - return; - } - case LUA_TFUNCTION: { - int n; - lua_pushvalue(L, 3); - n = push_captures(ms, s, e); - lua_call(L, n, 1); - break; - } - case LUA_TTABLE: { - push_onecapture(ms, 0, s, e); - lua_gettable(L, 3); - break; - } - } - if (!lua_toboolean(L, -1)) { /* nil or false? */ - lua_pop(L, 1); - lua_pushlstring(L, s, (size_t)(e - s)); /* keep original text */ - } else if (!lua_isstring(L, -1)) { - lj_err_callerv(L, LJ_ERR_STRGSRV, luaL_typename(L, -1)); - } - luaL_addvalue(b); /* add result to accumulator */ -} - -LJLIB_CF(string_gsub) -{ - size_t srcl; - const char *src = luaL_checklstring(L, 1, &srcl); - const char *p = luaL_checkstring(L, 2); - int tr = lua_type(L, 3); - int max_s = luaL_optint(L, 4, (int)(srcl+1)); - int anchor = (*p == '^') ? (p++, 1) : 0; - int n = 0; - MatchState ms; - luaL_Buffer b; - if (!(tr == LUA_TNUMBER || tr == LUA_TSTRING || - tr == LUA_TFUNCTION || tr == LUA_TTABLE)) - lj_err_arg(L, 3, LJ_ERR_NOSFT); - luaL_buffinit(L, &b); - ms.L = L; - ms.src_init = src; - ms.src_end = src+srcl; - while (n < max_s) { - const char *e; - ms.level = ms.depth = 0; - e = match(&ms, src, p); - if (e) { - n++; - add_value(&ms, &b, src, e); - } - if (e && e>src) /* non empty match? */ - src = e; /* skip it */ - else if (src < ms.src_end) - luaL_addchar(&b, *src++); - else - break; - if (anchor) - break; - } - luaL_addlstring(&b, src, (size_t)(ms.src_end-src)); - luaL_pushresult(&b); - lua_pushinteger(L, n); /* number of substitutions */ - return 2; -} - -/* ------------------------------------------------------------------------ */ - -/* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */ -#define MAX_FMTITEM 512 -/* valid flags in a format specification */ -#define FMT_FLAGS "-+ #0" -/* -** maximum size of each format specification (such as '%-099.99d') -** (+10 accounts for %99.99x plus margin of error) -*/ -#define MAX_FMTSPEC (sizeof(FMT_FLAGS) + sizeof(LUA_INTFRMLEN) + 10) - -static void addquoted(lua_State *L, luaL_Buffer *b, int arg) -{ - GCstr *str = lj_lib_checkstr(L, arg); - int32_t len = (int32_t)str->len; - const char *s = strdata(str); - luaL_addchar(b, '"'); - while (len--) { - uint32_t c = uchar(*s); - if (c == '"' || c == '\\' || c == '\n') { - luaL_addchar(b, '\\'); - } else if (lj_char_iscntrl(c)) { /* This can only be 0-31 or 127. */ - uint32_t d; - luaL_addchar(b, '\\'); - if (c >= 100 || lj_char_isdigit(uchar(s[1]))) { - luaL_addchar(b, '0'+(c >= 100)); if (c >= 100) c -= 100; - goto tens; - } else if (c >= 10) { - tens: - d = (c * 205) >> 11; c -= d * 10; luaL_addchar(b, '0'+d); - } - c += '0'; - } - luaL_addchar(b, c); - s++; - } - luaL_addchar(b, '"'); -} - -static const char *scanformat(lua_State *L, const char *strfrmt, char *form) -{ - const char *p = strfrmt; - while (*p != '\0' && strchr(FMT_FLAGS, *p) != NULL) p++; /* skip flags */ - if ((size_t)(p - strfrmt) >= sizeof(FMT_FLAGS)) - lj_err_caller(L, LJ_ERR_STRFMTR); - if (lj_char_isdigit(uchar(*p))) p++; /* skip width */ - if (lj_char_isdigit(uchar(*p))) p++; /* (2 digits at most) */ - if (*p == '.') { - p++; - if (lj_char_isdigit(uchar(*p))) p++; /* skip precision */ - if (lj_char_isdigit(uchar(*p))) p++; /* (2 digits at most) */ - } - if (lj_char_isdigit(uchar(*p))) - lj_err_caller(L, LJ_ERR_STRFMTW); - *(form++) = '%'; - strncpy(form, strfrmt, (size_t)(p - strfrmt + 1)); - form += p - strfrmt + 1; - *form = '\0'; - return p; -} - -static void addintlen(char *form) -{ - size_t l = strlen(form); - char spec = form[l - 1]; - strcpy(form + l - 1, LUA_INTFRMLEN); - form[l + sizeof(LUA_INTFRMLEN) - 2] = spec; - form[l + sizeof(LUA_INTFRMLEN) - 1] = '\0'; -} - -static unsigned LUA_INTFRM_T num2intfrm(lua_State *L, int arg) -{ - if (sizeof(LUA_INTFRM_T) == 4) { - return (LUA_INTFRM_T)lj_lib_checkbit(L, arg); - } else { - cTValue *o; - lj_lib_checknumber(L, arg); - o = L->base+arg-1; - if (tvisint(o)) - return (LUA_INTFRM_T)intV(o); - else - return (LUA_INTFRM_T)numV(o); - } -} - -static unsigned LUA_INTFRM_T num2uintfrm(lua_State *L, int arg) -{ - if (sizeof(LUA_INTFRM_T) == 4) { - return (unsigned LUA_INTFRM_T)lj_lib_checkbit(L, arg); - } else { - cTValue *o; - lj_lib_checknumber(L, arg); - o = L->base+arg-1; - if (tvisint(o)) - return (unsigned LUA_INTFRM_T)intV(o); - else if ((int32_t)o->u32.hi < 0) - return (unsigned LUA_INTFRM_T)(LUA_INTFRM_T)numV(o); - else - return (unsigned LUA_INTFRM_T)numV(o); - } -} - -static GCstr *meta_tostring(lua_State *L, int arg) -{ - TValue *o = L->base+arg-1; - cTValue *mo; - lua_assert(o < L->top); /* Caller already checks for existence. */ - if (LJ_LIKELY(tvisstr(o))) - return strV(o); - if (!tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) { - copyTV(L, L->top++, mo); - copyTV(L, L->top++, o); - lua_call(L, 1, 1); - L->top--; - if (tvisstr(L->top)) - return strV(L->top); - o = L->base+arg-1; - copyTV(L, o, L->top); - } - if (tvisnumber(o)) { - return lj_str_fromnumber(L, o); - } else if (tvisnil(o)) { - return lj_str_newlit(L, "nil"); - } else if (tvisfalse(o)) { - return lj_str_newlit(L, "false"); - } else if (tvistrue(o)) { - return lj_str_newlit(L, "true"); - } else { - if (tvisfunc(o) && isffunc(funcV(o))) - lj_str_pushf(L, "function: builtin#%d", funcV(o)->c.ffid); - else - lj_str_pushf(L, "%s: %p", lj_typename(o), lua_topointer(L, arg)); - L->top--; - return strV(L->top); - } -} - -LJLIB_CF(string_format) -{ - int arg = 1, top = (int)(L->top - L->base); - GCstr *fmt = lj_lib_checkstr(L, arg); - const char *strfrmt = strdata(fmt); - const char *strfrmt_end = strfrmt + fmt->len; - luaL_Buffer b; - luaL_buffinit(L, &b); - while (strfrmt < strfrmt_end) { - if (*strfrmt != L_ESC) { - luaL_addchar(&b, *strfrmt++); - } else if (*++strfrmt == L_ESC) { - luaL_addchar(&b, *strfrmt++); /* %% */ - } else { /* format item */ - char form[MAX_FMTSPEC]; /* to store the format (`%...') */ - char buff[MAX_FMTITEM]; /* to store the formatted item */ - if (++arg > top) - luaL_argerror(L, arg, lj_obj_typename[0]); - strfrmt = scanformat(L, strfrmt, form); - switch (*strfrmt++) { - case 'c': - sprintf(buff, form, lj_lib_checkint(L, arg)); - break; - case 'd': case 'i': - addintlen(form); - sprintf(buff, form, num2intfrm(L, arg)); - break; - case 'o': case 'u': case 'x': case 'X': - addintlen(form); - sprintf(buff, form, num2uintfrm(L, arg)); - break; - case 'e': case 'E': case 'f': case 'g': case 'G': case 'a': case 'A': { - TValue tv; - tv.n = lj_lib_checknum(L, arg); - if (LJ_UNLIKELY((tv.u32.hi << 1) >= 0xffe00000)) { - /* Canonicalize output of non-finite values. */ - char *p, nbuf[LJ_STR_NUMBUF]; - size_t len = lj_str_bufnum(nbuf, &tv); - if (strfrmt[-1] < 'a') { - nbuf[len-3] = nbuf[len-3] - 0x20; - nbuf[len-2] = nbuf[len-2] - 0x20; - nbuf[len-1] = nbuf[len-1] - 0x20; - } - nbuf[len] = '\0'; - for (p = form; *p < 'A' && *p != '.'; p++) ; - *p++ = 's'; *p = '\0'; - sprintf(buff, form, nbuf); - break; - } - sprintf(buff, form, (double)tv.n); - break; - } - case 'q': - addquoted(L, &b, arg); - continue; - case 'p': - lj_str_pushf(L, "%p", lua_topointer(L, arg)); - luaL_addvalue(&b); - continue; - case 's': { - GCstr *str = meta_tostring(L, arg); - if (!strchr(form, '.') && str->len >= 100) { - /* no precision and string is too long to be formatted; - keep original string */ - setstrV(L, L->top++, str); - luaL_addvalue(&b); - continue; - } - sprintf(buff, form, strdata(str)); - break; - } - default: - lj_err_callerv(L, LJ_ERR_STRFMTO, *(strfrmt -1)); - break; - } - luaL_addlstring(&b, buff, strlen(buff)); - } - } - luaL_pushresult(&b); - return 1; -} - -/* ------------------------------------------------------------------------ */ - -#include "lj_libdef.h" - -LUALIB_API int luaopen_string(lua_State *L) -{ - GCtab *mt; - global_State *g; - LJ_LIB_REG(L, LUA_STRLIBNAME, string); -#if defined(LUA_COMPAT_GFIND) && !LJ_52 - lua_getfield(L, -1, "gmatch"); - lua_setfield(L, -2, "gfind"); -#endif - mt = lj_tab_new(L, 0, 1); - /* NOBARRIER: basemt is a GC root. */ - g = G(L); - setgcref(basemt_it(g, LJ_TSTR), obj2gco(mt)); - settabV(L, lj_tab_setstr(L, mt, mmname_str(g, MM_index)), tabV(L->top-1)); - mt->nomm = (uint8_t)(~(1u<top, func); - setintV(L->top+1, i); - val = lj_tab_getint(t, (int32_t)i); - if (val) { copyTV(L, L->top+2, val); } else { setnilV(L->top+2); } - L->top += 3; - lua_call(L, 2, 1); - if (!tvisnil(L->top-1)) - return 1; - L->top--; - } - return 0; -} - -LJLIB_CF(table_foreach) -{ - GCtab *t = lj_lib_checktab(L, 1); - GCfunc *func = lj_lib_checkfunc(L, 2); - L->top = L->base+3; - setnilV(L->top-1); - while (lj_tab_next(L, t, L->top-1)) { - copyTV(L, L->top+2, L->top); - copyTV(L, L->top+1, L->top-1); - setfuncV(L, L->top, func); - L->top += 3; - lua_call(L, 2, 1); - if (!tvisnil(L->top-1)) - return 1; - L->top--; - } - return 0; -} - -LJLIB_ASM(table_getn) LJLIB_REC(.) -{ - lj_lib_checktab(L, 1); - return FFH_UNREACHABLE; -} - -LJLIB_CF(table_maxn) -{ - GCtab *t = lj_lib_checktab(L, 1); - TValue *array = tvref(t->array); - Node *node; - lua_Number m = 0; - ptrdiff_t i; - for (i = (ptrdiff_t)t->asize - 1; i >= 0; i--) - if (!tvisnil(&array[i])) { - m = (lua_Number)(int32_t)i; - break; - } - node = noderef(t->node); - for (i = (ptrdiff_t)t->hmask; i >= 0; i--) - if (!tvisnil(&node[i].val) && tvisnumber(&node[i].key)) { - lua_Number n = numberVnum(&node[i].key); - if (n > m) m = n; - } - setnumV(L->top-1, m); - return 1; -} - -LJLIB_CF(table_insert) LJLIB_REC(.) -{ - GCtab *t = lj_lib_checktab(L, 1); - int32_t n, i = (int32_t)lj_tab_len(t) + 1; - int nargs = (int)((char *)L->top - (char *)L->base); - if (nargs != 2*sizeof(TValue)) { - if (nargs != 3*sizeof(TValue)) - lj_err_caller(L, LJ_ERR_TABINS); - /* NOBARRIER: This just moves existing elements around. */ - for (n = lj_lib_checkint(L, 2); i > n; i--) { - /* The set may invalidate the get pointer, so need to do it first! */ - TValue *dst = lj_tab_setint(L, t, i); - cTValue *src = lj_tab_getint(t, i-1); - if (src) { - copyTV(L, dst, src); - } else { - setnilV(dst); - } - } - i = n; - } - { - TValue *dst = lj_tab_setint(L, t, i); - copyTV(L, dst, L->top-1); /* Set new value. */ - lj_gc_barriert(L, t, dst); - } - return 0; -} - -LJLIB_CF(table_remove) LJLIB_REC(.) -{ - GCtab *t = lj_lib_checktab(L, 1); - int32_t e = (int32_t)lj_tab_len(t); - int32_t pos = lj_lib_optint(L, 2, e); - if (!(1 <= pos && pos <= e)) /* Nothing to remove? */ - return 0; - lua_rawgeti(L, 1, pos); /* Get previous value. */ - /* NOBARRIER: This just moves existing elements around. */ - for (; pos < e; pos++) { - cTValue *src = lj_tab_getint(t, pos+1); - TValue *dst = lj_tab_setint(L, t, pos); - if (src) { - copyTV(L, dst, src); - } else { - setnilV(dst); - } - } - setnilV(lj_tab_setint(L, t, e)); /* Remove (last) value. */ - return 1; /* Return previous value. */ -} - -LJLIB_CF(table_concat) -{ - luaL_Buffer b; - GCtab *t = lj_lib_checktab(L, 1); - GCstr *sep = lj_lib_optstr(L, 2); - MSize seplen = sep ? sep->len : 0; - int32_t i = lj_lib_optint(L, 3, 1); - int32_t e = (L->base+3 < L->top && !tvisnil(L->base+3)) ? - lj_lib_checkint(L, 4) : (int32_t)lj_tab_len(t); - luaL_buffinit(L, &b); - if (i <= e) { - for (;;) { - cTValue *o; - lua_rawgeti(L, 1, i); - o = L->top-1; - if (!(tvisstr(o) || tvisnumber(o))) - lj_err_callerv(L, LJ_ERR_TABCAT, lj_typename(o), i); - luaL_addvalue(&b); - if (i++ == e) break; - if (seplen) - luaL_addlstring(&b, strdata(sep), seplen); - } - } - luaL_pushresult(&b); - return 1; -} - -/* ------------------------------------------------------------------------ */ - -static void set2(lua_State *L, int i, int j) -{ - lua_rawseti(L, 1, i); - lua_rawseti(L, 1, j); -} - -static int sort_comp(lua_State *L, int a, int b) -{ - if (!lua_isnil(L, 2)) { /* function? */ - int res; - lua_pushvalue(L, 2); - lua_pushvalue(L, a-1); /* -1 to compensate function */ - lua_pushvalue(L, b-2); /* -2 to compensate function and `a' */ - lua_call(L, 2, 1); - res = lua_toboolean(L, -1); - lua_pop(L, 1); - return res; - } else { /* a < b? */ - return lua_lessthan(L, a, b); - } -} - -static void auxsort(lua_State *L, int l, int u) -{ - while (l < u) { /* for tail recursion */ - int i, j; - /* sort elements a[l], a[(l+u)/2] and a[u] */ - lua_rawgeti(L, 1, l); - lua_rawgeti(L, 1, u); - if (sort_comp(L, -1, -2)) /* a[u] < a[l]? */ - set2(L, l, u); /* swap a[l] - a[u] */ - else - lua_pop(L, 2); - if (u-l == 1) break; /* only 2 elements */ - i = (l+u)/2; - lua_rawgeti(L, 1, i); - lua_rawgeti(L, 1, l); - if (sort_comp(L, -2, -1)) { /* a[i]= P */ - while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) { - if (i>=u) lj_err_caller(L, LJ_ERR_TABSORT); - lua_pop(L, 1); /* remove a[i] */ - } - /* repeat --j until a[j] <= P */ - while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) { - if (j<=l) lj_err_caller(L, LJ_ERR_TABSORT); - lua_pop(L, 1); /* remove a[j] */ - } - if (jbase+1)) - lj_lib_checkfunc(L, 2); - auxsort(L, 1, n); - return 0; -} - -#if LJ_52 -LJLIB_PUSH("n") -LJLIB_CF(table_pack) -{ - TValue *array, *base = L->base; - MSize i, n = (uint32_t)(L->top - base); - GCtab *t = lj_tab_new(L, n ? n+1 : 0, 1); - /* NOBARRIER: The table is new (marked white). */ - setintV(lj_tab_setstr(L, t, strV(lj_lib_upvalue(L, 1))), (int32_t)n); - for (array = tvref(t->array) + 1, i = 0; i < n; i++) - copyTV(L, &array[i], &base[i]); - settabV(L, base, t); - L->top = base+1; - lj_gc_check(L); - return 1; -} -#endif - -/* ------------------------------------------------------------------------ */ - -#include "lj_libdef.h" - -LUALIB_API int luaopen_table(lua_State *L) -{ - LJ_LIB_REG(L, LUA_TABLIBNAME, table); -#if LJ_52 - lua_getglobal(L, "unpack"); - lua_setfield(L, -2, "unpack"); -#endif - return 1; -} - diff --git a/subprojects/luajit/src/lj.supp b/subprojects/luajit/src/lj.supp deleted file mode 100644 index 217f7c890..000000000 --- a/subprojects/luajit/src/lj.supp +++ /dev/null @@ -1,41 +0,0 @@ -# Valgrind suppression file for LuaJIT 2.0. -{ - Optimized string compare - Memcheck:Addr4 - fun:lj_str_cmp -} -{ - Optimized string compare - Memcheck:Addr1 - fun:lj_str_cmp -} -{ - Optimized string compare - Memcheck:Addr4 - fun:lj_str_new -} -{ - Optimized string compare - Memcheck:Addr1 - fun:lj_str_new -} -{ - Optimized string compare - Memcheck:Cond - fun:lj_str_new -} -{ - Optimized string compare - Memcheck:Addr4 - fun:str_fastcmp -} -{ - Optimized string compare - Memcheck:Addr1 - fun:str_fastcmp -} -{ - Optimized string compare - Memcheck:Cond - fun:str_fastcmp -} diff --git a/subprojects/luajit/src/lj_alloc.c b/subprojects/luajit/src/lj_alloc.c deleted file mode 100644 index dc64dca9a..000000000 --- a/subprojects/luajit/src/lj_alloc.c +++ /dev/null @@ -1,1396 +0,0 @@ -/* -** Bundled memory allocator. -** -** Beware: this is a HEAVILY CUSTOMIZED version of dlmalloc. -** The original bears the following remark: -** -** This is a version (aka dlmalloc) of malloc/free/realloc written by -** Doug Lea and released to the public domain, as explained at -** http://creativecommons.org/licenses/publicdomain. -** -** * Version pre-2.8.4 Wed Mar 29 19:46:29 2006 (dl at gee) -** -** No additional copyright is claimed over the customizations. -** Please do NOT bother the original author about this version here! -** -** If you want to use dlmalloc in another project, you should get -** the original from: ftp://gee.cs.oswego.edu/pub/misc/ -** For thread-safe derivatives, take a look at: -** - ptmalloc: http://www.malloc.de/ -** - nedmalloc: http://www.nedprod.com/programs/portable/nedmalloc/ -*/ - -#define lj_alloc_c -#define LUA_CORE - -/* To get the mremap prototype. Must be defined before any system includes. */ -#if defined(__linux__) && !defined(_GNU_SOURCE) -#define _GNU_SOURCE -#endif - -#include "lj_def.h" -#include "lj_arch.h" -#include "lj_alloc.h" - -#ifndef LUAJIT_USE_SYSMALLOC - -#define MAX_SIZE_T (~(size_t)0) -#define MALLOC_ALIGNMENT ((size_t)8U) - -#define DEFAULT_GRANULARITY ((size_t)128U * (size_t)1024U) -#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) -#define DEFAULT_MMAP_THRESHOLD ((size_t)128U * (size_t)1024U) -#define MAX_RELEASE_CHECK_RATE 255 - -/* ------------------- size_t and alignment properties -------------------- */ - -/* The byte and bit size of a size_t */ -#define SIZE_T_SIZE (sizeof(size_t)) -#define SIZE_T_BITSIZE (sizeof(size_t) << 3) - -/* Some constants coerced to size_t */ -/* Annoying but necessary to avoid errors on some platforms */ -#define SIZE_T_ZERO ((size_t)0) -#define SIZE_T_ONE ((size_t)1) -#define SIZE_T_TWO ((size_t)2) -#define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) -#define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) -#define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) - -/* The bit mask value corresponding to MALLOC_ALIGNMENT */ -#define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) - -/* the number of bytes to offset an address to align it */ -#define align_offset(A)\ - ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\ - ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK)) - -/* -------------------------- MMAP support ------------------------------- */ - -#define MFAIL ((void *)(MAX_SIZE_T)) -#define CMFAIL ((char *)(MFAIL)) /* defined for convenience */ - -#define IS_DIRECT_BIT (SIZE_T_ONE) - -#if LJ_TARGET_WINDOWS - -#define WIN32_LEAN_AND_MEAN -#include - -#if LJ_64 - -/* Undocumented, but hey, that's what we all love so much about Windows. */ -typedef long (*PNTAVM)(HANDLE handle, void **addr, ULONG zbits, - size_t *size, ULONG alloctype, ULONG prot); -static PNTAVM ntavm; - -/* Number of top bits of the lower 32 bits of an address that must be zero. -** Apparently 0 gives us full 64 bit addresses and 1 gives us the lower 2GB. -*/ -#define NTAVM_ZEROBITS 1 - -static void INIT_MMAP(void) -{ - ntavm = (PNTAVM)GetProcAddress(GetModuleHandleA("ntdll.dll"), - "NtAllocateVirtualMemory"); -} - -/* Win64 32 bit MMAP via NtAllocateVirtualMemory. */ -static LJ_AINLINE void *CALL_MMAP(size_t size) -{ - DWORD olderr = GetLastError(); - void *ptr = NULL; - long st = ntavm(INVALID_HANDLE_VALUE, &ptr, NTAVM_ZEROBITS, &size, - MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE); - SetLastError(olderr); - return st == 0 ? ptr : MFAIL; -} - -/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ -static LJ_AINLINE void *DIRECT_MMAP(size_t size) -{ - DWORD olderr = GetLastError(); - void *ptr = NULL; - long st = ntavm(INVALID_HANDLE_VALUE, &ptr, NTAVM_ZEROBITS, &size, - MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, PAGE_READWRITE); - SetLastError(olderr); - return st == 0 ? ptr : MFAIL; -} - -#else - -#define INIT_MMAP() ((void)0) - -/* Win32 MMAP via VirtualAlloc */ -static LJ_AINLINE void *CALL_MMAP(size_t size) -{ - DWORD olderr = GetLastError(); - void *ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE); - SetLastError(olderr); - return ptr ? ptr : MFAIL; -} - -/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ -static LJ_AINLINE void *DIRECT_MMAP(size_t size) -{ - DWORD olderr = GetLastError(); - void *ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, - PAGE_READWRITE); - SetLastError(olderr); - return ptr ? ptr : MFAIL; -} - -#endif - -/* This function supports releasing coalesed segments */ -static LJ_AINLINE int CALL_MUNMAP(void *ptr, size_t size) -{ - DWORD olderr = GetLastError(); - MEMORY_BASIC_INFORMATION minfo; - char *cptr = (char *)ptr; - while (size) { - if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0) - return -1; - if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr || - minfo.State != MEM_COMMIT || minfo.RegionSize > size) - return -1; - if (VirtualFree(cptr, 0, MEM_RELEASE) == 0) - return -1; - cptr += minfo.RegionSize; - size -= minfo.RegionSize; - } - SetLastError(olderr); - return 0; -} - -#else - -#include -#include - -#define MMAP_PROT (PROT_READ|PROT_WRITE) -#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) -#define MAP_ANONYMOUS MAP_ANON -#endif -#define MMAP_FLAGS (MAP_PRIVATE|MAP_ANONYMOUS) - -#if LJ_64 -/* 64 bit mode needs special support for allocating memory in the lower 2GB. */ - -#if defined(MAP_32BIT) - -#if defined(__sun__) -#define MMAP_REGION_START ((uintptr_t)0x1000) -#else -/* Actually this only gives us max. 1GB in current Linux kernels. */ -#define MMAP_REGION_START ((uintptr_t)0) -#endif - -static LJ_AINLINE void *CALL_MMAP(size_t size) -{ - int olderr = errno; - void *ptr = mmap((void *)MMAP_REGION_START, size, MMAP_PROT, MAP_32BIT|MMAP_FLAGS, -1, 0); - errno = olderr; - return ptr; -} - -#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__) || LJ_TARGET_CYGWIN - -/* OSX and FreeBSD mmap() use a naive first-fit linear search. -** That's perfect for us. Except that -pagezero_size must be set for OSX, -** otherwise the lower 4GB are blocked. And the 32GB RLIMIT_DATA needs -** to be reduced to 250MB on FreeBSD. -*/ -#if LJ_TARGET_OSX || defined(__DragonFly__) -#define MMAP_REGION_START ((uintptr_t)0x10000) -#elif LJ_TARGET_PS4 -#define MMAP_REGION_START ((uintptr_t)0x4000) -#else -#define MMAP_REGION_START ((uintptr_t)0x10000000) -#endif -#define MMAP_REGION_END ((uintptr_t)0x80000000) - -#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !LJ_TARGET_PS4 -#include -#endif - -static LJ_AINLINE void *CALL_MMAP(size_t size) -{ - int olderr = errno; - /* Hint for next allocation. Doesn't need to be thread-safe. */ - static uintptr_t alloc_hint = MMAP_REGION_START; - int retry = 0; -#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !LJ_TARGET_PS4 - static int rlimit_modified = 0; - if (LJ_UNLIKELY(rlimit_modified == 0)) { - struct rlimit rlim; - rlim.rlim_cur = rlim.rlim_max = MMAP_REGION_START; - setrlimit(RLIMIT_DATA, &rlim); /* Ignore result. May fail below. */ - rlimit_modified = 1; - } -#endif - for (;;) { - void *p = mmap((void *)alloc_hint, size, MMAP_PROT, MMAP_FLAGS, -1, 0); - if ((uintptr_t)p >= MMAP_REGION_START && - (uintptr_t)p + size < MMAP_REGION_END) { - alloc_hint = (uintptr_t)p + size; - errno = olderr; - return p; - } - if (p != CMFAIL) munmap(p, size); -#if defined(__sun__) || defined(__DragonFly__) - alloc_hint += 0x1000000; /* Need near-exhaustive linear scan. */ - if (alloc_hint + size < MMAP_REGION_END) continue; -#endif - if (retry) break; - retry = 1; - alloc_hint = MMAP_REGION_START; - } - errno = olderr; - return CMFAIL; -} - -#else - -#error "NYI: need an equivalent of MAP_32BIT for this 64 bit OS" - -#endif - -#else - -/* 32 bit mode is easy. */ -static LJ_AINLINE void *CALL_MMAP(size_t size) -{ - int olderr = errno; - void *ptr = mmap(NULL, size, MMAP_PROT, MMAP_FLAGS, -1, 0); - errno = olderr; - return ptr; -} - -#endif - -#define INIT_MMAP() ((void)0) -#define DIRECT_MMAP(s) CALL_MMAP(s) - -static LJ_AINLINE int CALL_MUNMAP(void *ptr, size_t size) -{ - int olderr = errno; - int ret = munmap(ptr, size); - errno = olderr; - return ret; -} - -#if LJ_TARGET_LINUX -/* Need to define _GNU_SOURCE to get the mremap prototype. */ -static LJ_AINLINE void *CALL_MREMAP_(void *ptr, size_t osz, size_t nsz, - int flags) -{ - int olderr = errno; - ptr = mremap(ptr, osz, nsz, flags); - errno = olderr; - return ptr; -} - -#define CALL_MREMAP(addr, osz, nsz, mv) CALL_MREMAP_((addr), (osz), (nsz), (mv)) -#define CALL_MREMAP_NOMOVE 0 -#define CALL_MREMAP_MAYMOVE 1 -#if LJ_64 -#define CALL_MREMAP_MV CALL_MREMAP_NOMOVE -#else -#define CALL_MREMAP_MV CALL_MREMAP_MAYMOVE -#endif -#endif - -#endif - -#ifndef CALL_MREMAP -#define CALL_MREMAP(addr, osz, nsz, mv) ((void)osz, MFAIL) -#endif - -/* ----------------------- Chunk representations ------------------------ */ - -struct malloc_chunk { - size_t prev_foot; /* Size of previous chunk (if free). */ - size_t head; /* Size and inuse bits. */ - struct malloc_chunk *fd; /* double links -- used only if free. */ - struct malloc_chunk *bk; -}; - -typedef struct malloc_chunk mchunk; -typedef struct malloc_chunk *mchunkptr; -typedef struct malloc_chunk *sbinptr; /* The type of bins of chunks */ -typedef size_t bindex_t; /* Described below */ -typedef unsigned int binmap_t; /* Described below */ -typedef unsigned int flag_t; /* The type of various bit flag sets */ - -/* ------------------- Chunks sizes and alignments ----------------------- */ - -#define MCHUNK_SIZE (sizeof(mchunk)) - -#define CHUNK_OVERHEAD (SIZE_T_SIZE) - -/* Direct chunks need a second word of overhead ... */ -#define DIRECT_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) -/* ... and additional padding for fake next-chunk at foot */ -#define DIRECT_FOOT_PAD (FOUR_SIZE_T_SIZES) - -/* The smallest size we can malloc is an aligned minimal chunk */ -#define MIN_CHUNK_SIZE\ - ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) - -/* conversion from malloc headers to user pointers, and back */ -#define chunk2mem(p) ((void *)((char *)(p) + TWO_SIZE_T_SIZES)) -#define mem2chunk(mem) ((mchunkptr)((char *)(mem) - TWO_SIZE_T_SIZES)) -/* chunk associated with aligned address A */ -#define align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A))) - -/* Bounds on request (not chunk) sizes. */ -#define MAX_REQUEST ((~MIN_CHUNK_SIZE+1) << 2) -#define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) - -/* pad request bytes into a usable size */ -#define pad_request(req) \ - (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) - -/* pad request, checking for minimum (but not maximum) */ -#define request2size(req) \ - (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) - -/* ------------------ Operations on head and foot fields ----------------- */ - -#define PINUSE_BIT (SIZE_T_ONE) -#define CINUSE_BIT (SIZE_T_TWO) -#define INUSE_BITS (PINUSE_BIT|CINUSE_BIT) - -/* Head value for fenceposts */ -#define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) - -/* extraction of fields from head words */ -#define cinuse(p) ((p)->head & CINUSE_BIT) -#define pinuse(p) ((p)->head & PINUSE_BIT) -#define chunksize(p) ((p)->head & ~(INUSE_BITS)) - -#define clear_pinuse(p) ((p)->head &= ~PINUSE_BIT) -#define clear_cinuse(p) ((p)->head &= ~CINUSE_BIT) - -/* Treat space at ptr +/- offset as a chunk */ -#define chunk_plus_offset(p, s) ((mchunkptr)(((char *)(p)) + (s))) -#define chunk_minus_offset(p, s) ((mchunkptr)(((char *)(p)) - (s))) - -/* Ptr to next or previous physical malloc_chunk. */ -#define next_chunk(p) ((mchunkptr)(((char *)(p)) + ((p)->head & ~INUSE_BITS))) -#define prev_chunk(p) ((mchunkptr)(((char *)(p)) - ((p)->prev_foot) )) - -/* extract next chunk's pinuse bit */ -#define next_pinuse(p) ((next_chunk(p)->head) & PINUSE_BIT) - -/* Get/set size at footer */ -#define get_foot(p, s) (((mchunkptr)((char *)(p) + (s)))->prev_foot) -#define set_foot(p, s) (((mchunkptr)((char *)(p) + (s)))->prev_foot = (s)) - -/* Set size, pinuse bit, and foot */ -#define set_size_and_pinuse_of_free_chunk(p, s)\ - ((p)->head = (s|PINUSE_BIT), set_foot(p, s)) - -/* Set size, pinuse bit, foot, and clear next pinuse */ -#define set_free_with_pinuse(p, s, n)\ - (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) - -#define is_direct(p)\ - (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_DIRECT_BIT)) - -/* Get the internal overhead associated with chunk p */ -#define overhead_for(p)\ - (is_direct(p)? DIRECT_CHUNK_OVERHEAD : CHUNK_OVERHEAD) - -/* ---------------------- Overlaid data structures ----------------------- */ - -struct malloc_tree_chunk { - /* The first four fields must be compatible with malloc_chunk */ - size_t prev_foot; - size_t head; - struct malloc_tree_chunk *fd; - struct malloc_tree_chunk *bk; - - struct malloc_tree_chunk *child[2]; - struct malloc_tree_chunk *parent; - bindex_t index; -}; - -typedef struct malloc_tree_chunk tchunk; -typedef struct malloc_tree_chunk *tchunkptr; -typedef struct malloc_tree_chunk *tbinptr; /* The type of bins of trees */ - -/* A little helper macro for trees */ -#define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) - -/* ----------------------------- Segments -------------------------------- */ - -struct malloc_segment { - char *base; /* base address */ - size_t size; /* allocated size */ - struct malloc_segment *next; /* ptr to next segment */ -}; - -typedef struct malloc_segment msegment; -typedef struct malloc_segment *msegmentptr; - -/* ---------------------------- malloc_state ----------------------------- */ - -/* Bin types, widths and sizes */ -#define NSMALLBINS (32U) -#define NTREEBINS (32U) -#define SMALLBIN_SHIFT (3U) -#define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) -#define TREEBIN_SHIFT (8U) -#define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) -#define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) -#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) - -struct malloc_state { - binmap_t smallmap; - binmap_t treemap; - size_t dvsize; - size_t topsize; - mchunkptr dv; - mchunkptr top; - size_t trim_check; - size_t release_checks; - mchunkptr smallbins[(NSMALLBINS+1)*2]; - tbinptr treebins[NTREEBINS]; - msegment seg; -}; - -typedef struct malloc_state *mstate; - -#define is_initialized(M) ((M)->top != 0) - -/* -------------------------- system alloc setup ------------------------- */ - -/* page-align a size */ -#define page_align(S)\ - (((S) + (LJ_PAGESIZE - SIZE_T_ONE)) & ~(LJ_PAGESIZE - SIZE_T_ONE)) - -/* granularity-align a size */ -#define granularity_align(S)\ - (((S) + (DEFAULT_GRANULARITY - SIZE_T_ONE))\ - & ~(DEFAULT_GRANULARITY - SIZE_T_ONE)) - -#if LJ_TARGET_WINDOWS -#define mmap_align(S) granularity_align(S) -#else -#define mmap_align(S) page_align(S) -#endif - -/* True if segment S holds address A */ -#define segment_holds(S, A)\ - ((char *)(A) >= S->base && (char *)(A) < S->base + S->size) - -/* Return segment holding given address */ -static msegmentptr segment_holding(mstate m, char *addr) -{ - msegmentptr sp = &m->seg; - for (;;) { - if (addr >= sp->base && addr < sp->base + sp->size) - return sp; - if ((sp = sp->next) == 0) - return 0; - } -} - -/* Return true if segment contains a segment link */ -static int has_segment_link(mstate m, msegmentptr ss) -{ - msegmentptr sp = &m->seg; - for (;;) { - if ((char *)sp >= ss->base && (char *)sp < ss->base + ss->size) - return 1; - if ((sp = sp->next) == 0) - return 0; - } -} - -/* - TOP_FOOT_SIZE is padding at the end of a segment, including space - that may be needed to place segment records and fenceposts when new - noncontiguous segments are added. -*/ -#define TOP_FOOT_SIZE\ - (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) - -/* ---------------------------- Indexing Bins ---------------------------- */ - -#define is_small(s) (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) -#define small_index(s) ((s) >> SMALLBIN_SHIFT) -#define small_index2size(i) ((i) << SMALLBIN_SHIFT) -#define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) - -/* addressing by index. See above about smallbin repositioning */ -#define smallbin_at(M, i) ((sbinptr)((char *)&((M)->smallbins[(i)<<1]))) -#define treebin_at(M,i) (&((M)->treebins[i])) - -/* assign tree index for size S to variable I */ -#define compute_tree_index(S, I)\ -{\ - unsigned int X = (unsigned int)(S >> TREEBIN_SHIFT);\ - if (X == 0) {\ - I = 0;\ - } else if (X > 0xFFFF) {\ - I = NTREEBINS-1;\ - } else {\ - unsigned int K = lj_fls(X);\ - I = (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\ - }\ -} - -/* Bit representing maximum resolved size in a treebin at i */ -#define bit_for_tree_index(i) \ - (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) - -/* Shift placing maximum resolved bit in a treebin at i as sign bit */ -#define leftshift_for_tree_index(i) \ - ((i == NTREEBINS-1)? 0 : \ - ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2))) - -/* The size of the smallest chunk held in bin with index i */ -#define minsize_for_tree_index(i) \ - ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) | \ - (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1))) - -/* ------------------------ Operations on bin maps ----------------------- */ - -/* bit corresponding to given index */ -#define idx2bit(i) ((binmap_t)(1) << (i)) - -/* Mark/Clear bits with given index */ -#define mark_smallmap(M,i) ((M)->smallmap |= idx2bit(i)) -#define clear_smallmap(M,i) ((M)->smallmap &= ~idx2bit(i)) -#define smallmap_is_marked(M,i) ((M)->smallmap & idx2bit(i)) - -#define mark_treemap(M,i) ((M)->treemap |= idx2bit(i)) -#define clear_treemap(M,i) ((M)->treemap &= ~idx2bit(i)) -#define treemap_is_marked(M,i) ((M)->treemap & idx2bit(i)) - -/* mask with all bits to left of least bit of x on */ -#define left_bits(x) ((x<<1) | (~(x<<1)+1)) - -/* Set cinuse bit and pinuse bit of next chunk */ -#define set_inuse(M,p,s)\ - ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\ - ((mchunkptr)(((char *)(p)) + (s)))->head |= PINUSE_BIT) - -/* Set cinuse and pinuse of this chunk and pinuse of next chunk */ -#define set_inuse_and_pinuse(M,p,s)\ - ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ - ((mchunkptr)(((char *)(p)) + (s)))->head |= PINUSE_BIT) - -/* Set size, cinuse and pinuse bit of this chunk */ -#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\ - ((p)->head = (s|PINUSE_BIT|CINUSE_BIT)) - -/* ----------------------- Operations on smallbins ----------------------- */ - -/* Link a free chunk into a smallbin */ -#define insert_small_chunk(M, P, S) {\ - bindex_t I = small_index(S);\ - mchunkptr B = smallbin_at(M, I);\ - mchunkptr F = B;\ - if (!smallmap_is_marked(M, I))\ - mark_smallmap(M, I);\ - else\ - F = B->fd;\ - B->fd = P;\ - F->bk = P;\ - P->fd = F;\ - P->bk = B;\ -} - -/* Unlink a chunk from a smallbin */ -#define unlink_small_chunk(M, P, S) {\ - mchunkptr F = P->fd;\ - mchunkptr B = P->bk;\ - bindex_t I = small_index(S);\ - if (F == B) {\ - clear_smallmap(M, I);\ - } else {\ - F->bk = B;\ - B->fd = F;\ - }\ -} - -/* Unlink the first chunk from a smallbin */ -#define unlink_first_small_chunk(M, B, P, I) {\ - mchunkptr F = P->fd;\ - if (B == F) {\ - clear_smallmap(M, I);\ - } else {\ - B->fd = F;\ - F->bk = B;\ - }\ -} - -/* Replace dv node, binning the old one */ -/* Used only when dvsize known to be small */ -#define replace_dv(M, P, S) {\ - size_t DVS = M->dvsize;\ - if (DVS != 0) {\ - mchunkptr DV = M->dv;\ - insert_small_chunk(M, DV, DVS);\ - }\ - M->dvsize = S;\ - M->dv = P;\ -} - -/* ------------------------- Operations on trees ------------------------- */ - -/* Insert chunk into tree */ -#define insert_large_chunk(M, X, S) {\ - tbinptr *H;\ - bindex_t I;\ - compute_tree_index(S, I);\ - H = treebin_at(M, I);\ - X->index = I;\ - X->child[0] = X->child[1] = 0;\ - if (!treemap_is_marked(M, I)) {\ - mark_treemap(M, I);\ - *H = X;\ - X->parent = (tchunkptr)H;\ - X->fd = X->bk = X;\ - } else {\ - tchunkptr T = *H;\ - size_t K = S << leftshift_for_tree_index(I);\ - for (;;) {\ - if (chunksize(T) != S) {\ - tchunkptr *C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\ - K <<= 1;\ - if (*C != 0) {\ - T = *C;\ - } else {\ - *C = X;\ - X->parent = T;\ - X->fd = X->bk = X;\ - break;\ - }\ - } else {\ - tchunkptr F = T->fd;\ - T->fd = F->bk = X;\ - X->fd = F;\ - X->bk = T;\ - X->parent = 0;\ - break;\ - }\ - }\ - }\ -} - -#define unlink_large_chunk(M, X) {\ - tchunkptr XP = X->parent;\ - tchunkptr R;\ - if (X->bk != X) {\ - tchunkptr F = X->fd;\ - R = X->bk;\ - F->bk = R;\ - R->fd = F;\ - } else {\ - tchunkptr *RP;\ - if (((R = *(RP = &(X->child[1]))) != 0) ||\ - ((R = *(RP = &(X->child[0]))) != 0)) {\ - tchunkptr *CP;\ - while ((*(CP = &(R->child[1])) != 0) ||\ - (*(CP = &(R->child[0])) != 0)) {\ - R = *(RP = CP);\ - }\ - *RP = 0;\ - }\ - }\ - if (XP != 0) {\ - tbinptr *H = treebin_at(M, X->index);\ - if (X == *H) {\ - if ((*H = R) == 0) \ - clear_treemap(M, X->index);\ - } else {\ - if (XP->child[0] == X) \ - XP->child[0] = R;\ - else \ - XP->child[1] = R;\ - }\ - if (R != 0) {\ - tchunkptr C0, C1;\ - R->parent = XP;\ - if ((C0 = X->child[0]) != 0) {\ - R->child[0] = C0;\ - C0->parent = R;\ - }\ - if ((C1 = X->child[1]) != 0) {\ - R->child[1] = C1;\ - C1->parent = R;\ - }\ - }\ - }\ -} - -/* Relays to large vs small bin operations */ - -#define insert_chunk(M, P, S)\ - if (is_small(S)) { insert_small_chunk(M, P, S)\ - } else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); } - -#define unlink_chunk(M, P, S)\ - if (is_small(S)) { unlink_small_chunk(M, P, S)\ - } else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); } - -/* ----------------------- Direct-mmapping chunks ----------------------- */ - -static void *direct_alloc(size_t nb) -{ - size_t mmsize = mmap_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK); - if (LJ_LIKELY(mmsize > nb)) { /* Check for wrap around 0 */ - char *mm = (char *)(DIRECT_MMAP(mmsize)); - if (mm != CMFAIL) { - size_t offset = align_offset(chunk2mem(mm)); - size_t psize = mmsize - offset - DIRECT_FOOT_PAD; - mchunkptr p = (mchunkptr)(mm + offset); - p->prev_foot = offset | IS_DIRECT_BIT; - p->head = psize|CINUSE_BIT; - chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD; - chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0; - return chunk2mem(p); - } - } - return NULL; -} - -static mchunkptr direct_resize(mchunkptr oldp, size_t nb) -{ - size_t oldsize = chunksize(oldp); - if (is_small(nb)) /* Can't shrink direct regions below small size */ - return NULL; - /* Keep old chunk if big enough but not too big */ - if (oldsize >= nb + SIZE_T_SIZE && - (oldsize - nb) <= (DEFAULT_GRANULARITY >> 1)) { - return oldp; - } else { - size_t offset = oldp->prev_foot & ~IS_DIRECT_BIT; - size_t oldmmsize = oldsize + offset + DIRECT_FOOT_PAD; - size_t newmmsize = mmap_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK); - char *cp = (char *)CALL_MREMAP((char *)oldp - offset, - oldmmsize, newmmsize, CALL_MREMAP_MV); - if (cp != CMFAIL) { - mchunkptr newp = (mchunkptr)(cp + offset); - size_t psize = newmmsize - offset - DIRECT_FOOT_PAD; - newp->head = psize|CINUSE_BIT; - chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD; - chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0; - return newp; - } - } - return NULL; -} - -/* -------------------------- mspace management -------------------------- */ - -/* Initialize top chunk and its size */ -static void init_top(mstate m, mchunkptr p, size_t psize) -{ - /* Ensure alignment */ - size_t offset = align_offset(chunk2mem(p)); - p = (mchunkptr)((char *)p + offset); - psize -= offset; - - m->top = p; - m->topsize = psize; - p->head = psize | PINUSE_BIT; - /* set size of fake trailing chunk holding overhead space only once */ - chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE; - m->trim_check = DEFAULT_TRIM_THRESHOLD; /* reset on each update */ -} - -/* Initialize bins for a new mstate that is otherwise zeroed out */ -static void init_bins(mstate m) -{ - /* Establish circular links for smallbins */ - bindex_t i; - for (i = 0; i < NSMALLBINS; i++) { - sbinptr bin = smallbin_at(m,i); - bin->fd = bin->bk = bin; - } -} - -/* Allocate chunk and prepend remainder with chunk in successor base. */ -static void *prepend_alloc(mstate m, char *newbase, char *oldbase, size_t nb) -{ - mchunkptr p = align_as_chunk(newbase); - mchunkptr oldfirst = align_as_chunk(oldbase); - size_t psize = (size_t)((char *)oldfirst - (char *)p); - mchunkptr q = chunk_plus_offset(p, nb); - size_t qsize = psize - nb; - set_size_and_pinuse_of_inuse_chunk(m, p, nb); - - /* consolidate remainder with first chunk of old base */ - if (oldfirst == m->top) { - size_t tsize = m->topsize += qsize; - m->top = q; - q->head = tsize | PINUSE_BIT; - } else if (oldfirst == m->dv) { - size_t dsize = m->dvsize += qsize; - m->dv = q; - set_size_and_pinuse_of_free_chunk(q, dsize); - } else { - if (!cinuse(oldfirst)) { - size_t nsize = chunksize(oldfirst); - unlink_chunk(m, oldfirst, nsize); - oldfirst = chunk_plus_offset(oldfirst, nsize); - qsize += nsize; - } - set_free_with_pinuse(q, qsize, oldfirst); - insert_chunk(m, q, qsize); - } - - return chunk2mem(p); -} - -/* Add a segment to hold a new noncontiguous region */ -static void add_segment(mstate m, char *tbase, size_t tsize) -{ - /* Determine locations and sizes of segment, fenceposts, old top */ - char *old_top = (char *)m->top; - msegmentptr oldsp = segment_holding(m, old_top); - char *old_end = oldsp->base + oldsp->size; - size_t ssize = pad_request(sizeof(struct malloc_segment)); - char *rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK); - size_t offset = align_offset(chunk2mem(rawsp)); - char *asp = rawsp + offset; - char *csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp; - mchunkptr sp = (mchunkptr)csp; - msegmentptr ss = (msegmentptr)(chunk2mem(sp)); - mchunkptr tnext = chunk_plus_offset(sp, ssize); - mchunkptr p = tnext; - - /* reset top to new space */ - init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); - - /* Set up segment record */ - set_size_and_pinuse_of_inuse_chunk(m, sp, ssize); - *ss = m->seg; /* Push current record */ - m->seg.base = tbase; - m->seg.size = tsize; - m->seg.next = ss; - - /* Insert trailing fenceposts */ - for (;;) { - mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE); - p->head = FENCEPOST_HEAD; - if ((char *)(&(nextp->head)) < old_end) - p = nextp; - else - break; - } - - /* Insert the rest of old top into a bin as an ordinary free chunk */ - if (csp != old_top) { - mchunkptr q = (mchunkptr)old_top; - size_t psize = (size_t)(csp - old_top); - mchunkptr tn = chunk_plus_offset(q, psize); - set_free_with_pinuse(q, psize, tn); - insert_chunk(m, q, psize); - } -} - -/* -------------------------- System allocation -------------------------- */ - -static void *alloc_sys(mstate m, size_t nb) -{ - char *tbase = CMFAIL; - size_t tsize = 0; - - /* Directly map large chunks */ - if (LJ_UNLIKELY(nb >= DEFAULT_MMAP_THRESHOLD)) { - void *mem = direct_alloc(nb); - if (mem != 0) - return mem; - } - - { - size_t req = nb + TOP_FOOT_SIZE + SIZE_T_ONE; - size_t rsize = granularity_align(req); - if (LJ_LIKELY(rsize > nb)) { /* Fail if wraps around zero */ - char *mp = (char *)(CALL_MMAP(rsize)); - if (mp != CMFAIL) { - tbase = mp; - tsize = rsize; - } - } - } - - if (tbase != CMFAIL) { - msegmentptr sp = &m->seg; - /* Try to merge with an existing segment */ - while (sp != 0 && tbase != sp->base + sp->size) - sp = sp->next; - if (sp != 0 && segment_holds(sp, m->top)) { /* append */ - sp->size += tsize; - init_top(m, m->top, m->topsize + tsize); - } else { - sp = &m->seg; - while (sp != 0 && sp->base != tbase + tsize) - sp = sp->next; - if (sp != 0) { - char *oldbase = sp->base; - sp->base = tbase; - sp->size += tsize; - return prepend_alloc(m, tbase, oldbase, nb); - } else { - add_segment(m, tbase, tsize); - } - } - - if (nb < m->topsize) { /* Allocate from new or extended top space */ - size_t rsize = m->topsize -= nb; - mchunkptr p = m->top; - mchunkptr r = m->top = chunk_plus_offset(p, nb); - r->head = rsize | PINUSE_BIT; - set_size_and_pinuse_of_inuse_chunk(m, p, nb); - return chunk2mem(p); - } - } - - return NULL; -} - -/* ----------------------- system deallocation -------------------------- */ - -/* Unmap and unlink any mmapped segments that don't contain used chunks */ -static size_t release_unused_segments(mstate m) -{ - size_t released = 0; - size_t nsegs = 0; - msegmentptr pred = &m->seg; - msegmentptr sp = pred->next; - while (sp != 0) { - char *base = sp->base; - size_t size = sp->size; - msegmentptr next = sp->next; - nsegs++; - { - mchunkptr p = align_as_chunk(base); - size_t psize = chunksize(p); - /* Can unmap if first chunk holds entire segment and not pinned */ - if (!cinuse(p) && (char *)p + psize >= base + size - TOP_FOOT_SIZE) { - tchunkptr tp = (tchunkptr)p; - if (p == m->dv) { - m->dv = 0; - m->dvsize = 0; - } else { - unlink_large_chunk(m, tp); - } - if (CALL_MUNMAP(base, size) == 0) { - released += size; - /* unlink obsoleted record */ - sp = pred; - sp->next = next; - } else { /* back out if cannot unmap */ - insert_large_chunk(m, tp, psize); - } - } - } - pred = sp; - sp = next; - } - /* Reset check counter */ - m->release_checks = nsegs > MAX_RELEASE_CHECK_RATE ? - nsegs : MAX_RELEASE_CHECK_RATE; - return released; -} - -static int alloc_trim(mstate m, size_t pad) -{ - size_t released = 0; - if (pad < MAX_REQUEST && is_initialized(m)) { - pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */ - - if (m->topsize > pad) { - /* Shrink top space in granularity-size units, keeping at least one */ - size_t unit = DEFAULT_GRANULARITY; - size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit - - SIZE_T_ONE) * unit; - msegmentptr sp = segment_holding(m, (char *)m->top); - - if (sp->size >= extra && - !has_segment_link(m, sp)) { /* can't shrink if pinned */ - size_t newsize = sp->size - extra; - /* Prefer mremap, fall back to munmap */ - if ((CALL_MREMAP(sp->base, sp->size, newsize, CALL_MREMAP_NOMOVE) != MFAIL) || - (CALL_MUNMAP(sp->base + newsize, extra) == 0)) { - released = extra; - } - } - - if (released != 0) { - sp->size -= released; - init_top(m, m->top, m->topsize - released); - } - } - - /* Unmap any unused mmapped segments */ - released += release_unused_segments(m); - - /* On failure, disable autotrim to avoid repeated failed future calls */ - if (released == 0 && m->topsize > m->trim_check) - m->trim_check = MAX_SIZE_T; - } - - return (released != 0)? 1 : 0; -} - -/* ---------------------------- malloc support --------------------------- */ - -/* allocate a large request from the best fitting chunk in a treebin */ -static void *tmalloc_large(mstate m, size_t nb) -{ - tchunkptr v = 0; - size_t rsize = ~nb+1; /* Unsigned negation */ - tchunkptr t; - bindex_t idx; - compute_tree_index(nb, idx); - - if ((t = *treebin_at(m, idx)) != 0) { - /* Traverse tree for this bin looking for node with size == nb */ - size_t sizebits = nb << leftshift_for_tree_index(idx); - tchunkptr rst = 0; /* The deepest untaken right subtree */ - for (;;) { - tchunkptr rt; - size_t trem = chunksize(t) - nb; - if (trem < rsize) { - v = t; - if ((rsize = trem) == 0) - break; - } - rt = t->child[1]; - t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; - if (rt != 0 && rt != t) - rst = rt; - if (t == 0) { - t = rst; /* set t to least subtree holding sizes > nb */ - break; - } - sizebits <<= 1; - } - } - - if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */ - binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap; - if (leftbits != 0) - t = *treebin_at(m, lj_ffs(leftbits)); - } - - while (t != 0) { /* find smallest of tree or subtree */ - size_t trem = chunksize(t) - nb; - if (trem < rsize) { - rsize = trem; - v = t; - } - t = leftmost_child(t); - } - - /* If dv is a better fit, return NULL so malloc will use it */ - if (v != 0 && rsize < (size_t)(m->dvsize - nb)) { - mchunkptr r = chunk_plus_offset(v, nb); - unlink_large_chunk(m, v); - if (rsize < MIN_CHUNK_SIZE) { - set_inuse_and_pinuse(m, v, (rsize + nb)); - } else { - set_size_and_pinuse_of_inuse_chunk(m, v, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - insert_chunk(m, r, rsize); - } - return chunk2mem(v); - } - return NULL; -} - -/* allocate a small request from the best fitting chunk in a treebin */ -static void *tmalloc_small(mstate m, size_t nb) -{ - tchunkptr t, v; - mchunkptr r; - size_t rsize; - bindex_t i = lj_ffs(m->treemap); - - v = t = *treebin_at(m, i); - rsize = chunksize(t) - nb; - - while ((t = leftmost_child(t)) != 0) { - size_t trem = chunksize(t) - nb; - if (trem < rsize) { - rsize = trem; - v = t; - } - } - - r = chunk_plus_offset(v, nb); - unlink_large_chunk(m, v); - if (rsize < MIN_CHUNK_SIZE) { - set_inuse_and_pinuse(m, v, (rsize + nb)); - } else { - set_size_and_pinuse_of_inuse_chunk(m, v, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - replace_dv(m, r, rsize); - } - return chunk2mem(v); -} - -/* ----------------------------------------------------------------------- */ - -void *lj_alloc_create(void) -{ - size_t tsize = DEFAULT_GRANULARITY; - char *tbase; - INIT_MMAP(); - tbase = (char *)(CALL_MMAP(tsize)); - if (tbase != CMFAIL) { - size_t msize = pad_request(sizeof(struct malloc_state)); - mchunkptr mn; - mchunkptr msp = align_as_chunk(tbase); - mstate m = (mstate)(chunk2mem(msp)); - memset(m, 0, msize); - msp->head = (msize|PINUSE_BIT|CINUSE_BIT); - m->seg.base = tbase; - m->seg.size = tsize; - m->release_checks = MAX_RELEASE_CHECK_RATE; - init_bins(m); - mn = next_chunk(mem2chunk(m)); - init_top(m, mn, (size_t)((tbase + tsize) - (char *)mn) - TOP_FOOT_SIZE); - return m; - } - return NULL; -} - -void lj_alloc_destroy(void *msp) -{ - mstate ms = (mstate)msp; - msegmentptr sp = &ms->seg; - while (sp != 0) { - char *base = sp->base; - size_t size = sp->size; - sp = sp->next; - CALL_MUNMAP(base, size); - } -} - -static LJ_NOINLINE void *lj_alloc_malloc(void *msp, size_t nsize) -{ - mstate ms = (mstate)msp; - void *mem; - size_t nb; - if (nsize <= MAX_SMALL_REQUEST) { - bindex_t idx; - binmap_t smallbits; - nb = (nsize < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(nsize); - idx = small_index(nb); - smallbits = ms->smallmap >> idx; - - if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ - mchunkptr b, p; - idx += ~smallbits & 1; /* Uses next bin if idx empty */ - b = smallbin_at(ms, idx); - p = b->fd; - unlink_first_small_chunk(ms, b, p, idx); - set_inuse_and_pinuse(ms, p, small_index2size(idx)); - mem = chunk2mem(p); - return mem; - } else if (nb > ms->dvsize) { - if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ - mchunkptr b, p, r; - size_t rsize; - binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); - bindex_t i = lj_ffs(leftbits); - b = smallbin_at(ms, i); - p = b->fd; - unlink_first_small_chunk(ms, b, p, i); - rsize = small_index2size(i) - nb; - /* Fit here cannot be remainderless if 4byte sizes */ - if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) { - set_inuse_and_pinuse(ms, p, small_index2size(i)); - } else { - set_size_and_pinuse_of_inuse_chunk(ms, p, nb); - r = chunk_plus_offset(p, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - replace_dv(ms, r, rsize); - } - mem = chunk2mem(p); - return mem; - } else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) { - return mem; - } - } - } else if (nsize >= MAX_REQUEST) { - nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ - } else { - nb = pad_request(nsize); - if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) { - return mem; - } - } - - if (nb <= ms->dvsize) { - size_t rsize = ms->dvsize - nb; - mchunkptr p = ms->dv; - if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ - mchunkptr r = ms->dv = chunk_plus_offset(p, nb); - ms->dvsize = rsize; - set_size_and_pinuse_of_free_chunk(r, rsize); - set_size_and_pinuse_of_inuse_chunk(ms, p, nb); - } else { /* exhaust dv */ - size_t dvs = ms->dvsize; - ms->dvsize = 0; - ms->dv = 0; - set_inuse_and_pinuse(ms, p, dvs); - } - mem = chunk2mem(p); - return mem; - } else if (nb < ms->topsize) { /* Split top */ - size_t rsize = ms->topsize -= nb; - mchunkptr p = ms->top; - mchunkptr r = ms->top = chunk_plus_offset(p, nb); - r->head = rsize | PINUSE_BIT; - set_size_and_pinuse_of_inuse_chunk(ms, p, nb); - mem = chunk2mem(p); - return mem; - } - return alloc_sys(ms, nb); -} - -static LJ_NOINLINE void *lj_alloc_free(void *msp, void *ptr) -{ - if (ptr != 0) { - mchunkptr p = mem2chunk(ptr); - mstate fm = (mstate)msp; - size_t psize = chunksize(p); - mchunkptr next = chunk_plus_offset(p, psize); - if (!pinuse(p)) { - size_t prevsize = p->prev_foot; - if ((prevsize & IS_DIRECT_BIT) != 0) { - prevsize &= ~IS_DIRECT_BIT; - psize += prevsize + DIRECT_FOOT_PAD; - CALL_MUNMAP((char *)p - prevsize, psize); - return NULL; - } else { - mchunkptr prev = chunk_minus_offset(p, prevsize); - psize += prevsize; - p = prev; - /* consolidate backward */ - if (p != fm->dv) { - unlink_chunk(fm, p, prevsize); - } else if ((next->head & INUSE_BITS) == INUSE_BITS) { - fm->dvsize = psize; - set_free_with_pinuse(p, psize, next); - return NULL; - } - } - } - if (!cinuse(next)) { /* consolidate forward */ - if (next == fm->top) { - size_t tsize = fm->topsize += psize; - fm->top = p; - p->head = tsize | PINUSE_BIT; - if (p == fm->dv) { - fm->dv = 0; - fm->dvsize = 0; - } - if (tsize > fm->trim_check) - alloc_trim(fm, 0); - return NULL; - } else if (next == fm->dv) { - size_t dsize = fm->dvsize += psize; - fm->dv = p; - set_size_and_pinuse_of_free_chunk(p, dsize); - return NULL; - } else { - size_t nsize = chunksize(next); - psize += nsize; - unlink_chunk(fm, next, nsize); - set_size_and_pinuse_of_free_chunk(p, psize); - if (p == fm->dv) { - fm->dvsize = psize; - return NULL; - } - } - } else { - set_free_with_pinuse(p, psize, next); - } - - if (is_small(psize)) { - insert_small_chunk(fm, p, psize); - } else { - tchunkptr tp = (tchunkptr)p; - insert_large_chunk(fm, tp, psize); - if (--fm->release_checks == 0) - release_unused_segments(fm); - } - } - return NULL; -} - -static LJ_NOINLINE void *lj_alloc_realloc(void *msp, void *ptr, size_t nsize) -{ - if (nsize >= MAX_REQUEST) { - return NULL; - } else { - mstate m = (mstate)msp; - mchunkptr oldp = mem2chunk(ptr); - size_t oldsize = chunksize(oldp); - mchunkptr next = chunk_plus_offset(oldp, oldsize); - mchunkptr newp = 0; - size_t nb = request2size(nsize); - - /* Try to either shrink or extend into top. Else malloc-copy-free */ - if (is_direct(oldp)) { - newp = direct_resize(oldp, nb); /* this may return NULL. */ - } else if (oldsize >= nb) { /* already big enough */ - size_t rsize = oldsize - nb; - newp = oldp; - if (rsize >= MIN_CHUNK_SIZE) { - mchunkptr rem = chunk_plus_offset(newp, nb); - set_inuse(m, newp, nb); - set_inuse(m, rem, rsize); - lj_alloc_free(m, chunk2mem(rem)); - } - } else if (next == m->top && oldsize + m->topsize > nb) { - /* Expand into top */ - size_t newsize = oldsize + m->topsize; - size_t newtopsize = newsize - nb; - mchunkptr newtop = chunk_plus_offset(oldp, nb); - set_inuse(m, oldp, nb); - newtop->head = newtopsize |PINUSE_BIT; - m->top = newtop; - m->topsize = newtopsize; - newp = oldp; - } - - if (newp != 0) { - return chunk2mem(newp); - } else { - void *newmem = lj_alloc_malloc(m, nsize); - if (newmem != 0) { - size_t oc = oldsize - overhead_for(oldp); - memcpy(newmem, ptr, oc < nsize ? oc : nsize); - lj_alloc_free(m, ptr); - } - return newmem; - } - } -} - -void *lj_alloc_f(void *msp, void *ptr, size_t osize, size_t nsize) -{ - (void)osize; - if (nsize == 0) { - return lj_alloc_free(msp, ptr); - } else if (ptr == NULL) { - return lj_alloc_malloc(msp, nsize); - } else { - return lj_alloc_realloc(msp, ptr, nsize); - } -} - -#endif diff --git a/subprojects/luajit/src/lj_alloc.h b/subprojects/luajit/src/lj_alloc.h deleted file mode 100644 index f87a7cf34..000000000 --- a/subprojects/luajit/src/lj_alloc.h +++ /dev/null @@ -1,17 +0,0 @@ -/* -** Bundled memory allocator. -** Donated to the public domain. -*/ - -#ifndef _LJ_ALLOC_H -#define _LJ_ALLOC_H - -#include "lj_def.h" - -#ifndef LUAJIT_USE_SYSMALLOC -LJ_FUNC void *lj_alloc_create(void); -LJ_FUNC void lj_alloc_destroy(void *msp); -LJ_FUNC void *lj_alloc_f(void *msp, void *ptr, size_t osize, size_t nsize); -#endif - -#endif diff --git a/subprojects/luajit/src/lj_api.c b/subprojects/luajit/src/lj_api.c deleted file mode 100644 index 7b0b3f9d0..000000000 --- a/subprojects/luajit/src/lj_api.c +++ /dev/null @@ -1,1200 +0,0 @@ -/* -** Public Lua/C API. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#define lj_api_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_debug.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_func.h" -#include "lj_udata.h" -#include "lj_meta.h" -#include "lj_state.h" -#include "lj_bc.h" -#include "lj_frame.h" -#include "lj_trace.h" -#include "lj_vm.h" -#include "lj_strscan.h" - -/* -- Common helper functions --------------------------------------------- */ - -#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base)) -#define api_checkvalidindex(L, i) api_check(L, (i) != niltv(L)) - -static TValue *index2adr(lua_State *L, int idx) -{ - if (idx > 0) { - TValue *o = L->base + (idx - 1); - return o < L->top ? o : niltv(L); - } else if (idx > LUA_REGISTRYINDEX) { - api_check(L, idx != 0 && -idx <= L->top - L->base); - return L->top + idx; - } else if (idx == LUA_GLOBALSINDEX) { - TValue *o = &G(L)->tmptv; - settabV(L, o, tabref(L->env)); - return o; - } else if (idx == LUA_REGISTRYINDEX) { - return registry(L); - } else { - GCfunc *fn = curr_func(L); - api_check(L, fn->c.gct == ~LJ_TFUNC && !isluafunc(fn)); - if (idx == LUA_ENVIRONINDEX) { - TValue *o = &G(L)->tmptv; - settabV(L, o, tabref(fn->c.env)); - return o; - } else { - idx = LUA_GLOBALSINDEX - idx; - return idx <= fn->c.nupvalues ? &fn->c.upvalue[idx-1] : niltv(L); - } - } -} - -static TValue *stkindex2adr(lua_State *L, int idx) -{ - if (idx > 0) { - TValue *o = L->base + (idx - 1); - return o < L->top ? o : niltv(L); - } else { - api_check(L, idx != 0 && -idx <= L->top - L->base); - return L->top + idx; - } -} - -static GCtab *getcurrenv(lua_State *L) -{ - GCfunc *fn = curr_func(L); - return fn->c.gct == ~LJ_TFUNC ? tabref(fn->c.env) : tabref(L->env); -} - -/* -- Miscellaneous API functions ----------------------------------------- */ - -LUA_API int lua_status(lua_State *L) -{ - return L->status; -} - -LUA_API int lua_checkstack(lua_State *L, int size) -{ - if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK) { - return 0; /* Stack overflow. */ - } else if (size > 0) { - lj_state_checkstack(L, (MSize)size); - } - return 1; -} - -LUALIB_API void luaL_checkstack(lua_State *L, int size, const char *msg) -{ - if (!lua_checkstack(L, size)) - lj_err_callerv(L, LJ_ERR_STKOVM, msg); -} - -LUA_API void lua_xmove(lua_State *from, lua_State *to, int n) -{ - TValue *f, *t; - if (from == to) return; - api_checknelems(from, n); - api_check(from, G(from) == G(to)); - lj_state_checkstack(to, (MSize)n); - f = from->top; - t = to->top = to->top + n; - while (--n >= 0) copyTV(to, --t, --f); - from->top = f; -} - -/* -- Stack manipulation -------------------------------------------------- */ - -LUA_API int lua_gettop(lua_State *L) -{ - return (int)(L->top - L->base); -} - -LUA_API void lua_settop(lua_State *L, int idx) -{ - if (idx >= 0) { - api_check(L, idx <= tvref(L->maxstack) - L->base); - if (L->base + idx > L->top) { - if (L->base + idx >= tvref(L->maxstack)) - lj_state_growstack(L, (MSize)idx - (MSize)(L->top - L->base)); - do { setnilV(L->top++); } while (L->top < L->base + idx); - } else { - L->top = L->base + idx; - } - } else { - api_check(L, -(idx+1) <= (L->top - L->base)); - L->top += idx+1; /* Shrinks top (idx < 0). */ - } -} - -LUA_API void lua_remove(lua_State *L, int idx) -{ - TValue *p = stkindex2adr(L, idx); - api_checkvalidindex(L, p); - while (++p < L->top) copyTV(L, p-1, p); - L->top--; -} - -LUA_API void lua_insert(lua_State *L, int idx) -{ - TValue *q, *p = stkindex2adr(L, idx); - api_checkvalidindex(L, p); - for (q = L->top; q > p; q--) copyTV(L, q, q-1); - copyTV(L, p, L->top); -} - -LUA_API void lua_replace(lua_State *L, int idx) -{ - api_checknelems(L, 1); - if (idx == LUA_GLOBALSINDEX) { - api_check(L, tvistab(L->top-1)); - /* NOBARRIER: A thread (i.e. L) is never black. */ - setgcref(L->env, obj2gco(tabV(L->top-1))); - } else if (idx == LUA_ENVIRONINDEX) { - GCfunc *fn = curr_func(L); - if (fn->c.gct != ~LJ_TFUNC) - lj_err_msg(L, LJ_ERR_NOENV); - api_check(L, tvistab(L->top-1)); - setgcref(fn->c.env, obj2gco(tabV(L->top-1))); - lj_gc_barrier(L, fn, L->top-1); - } else { - TValue *o = index2adr(L, idx); - api_checkvalidindex(L, o); - copyTV(L, o, L->top-1); - if (idx < LUA_GLOBALSINDEX) /* Need a barrier for upvalues. */ - lj_gc_barrier(L, curr_func(L), L->top-1); - } - L->top--; -} - -LUA_API void lua_pushvalue(lua_State *L, int idx) -{ - copyTV(L, L->top, index2adr(L, idx)); - incr_top(L); -} - -/* -- Stack getters ------------------------------------------------------- */ - -LUA_API int lua_type(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - if (tvisnumber(o)) { - return LUA_TNUMBER; -#if LJ_64 - } else if (tvislightud(o)) { - return LUA_TLIGHTUSERDATA; -#endif - } else if (o == niltv(L)) { - return LUA_TNONE; - } else { /* Magic internal/external tag conversion. ORDER LJ_T */ - uint32_t t = ~itype(o); -#if LJ_64 - int tt = (int)((U64x(75a06,98042110) >> 4*t) & 15u); -#else - int tt = (int)(((t < 8 ? 0x98042110u : 0x75a06u) >> 4*(t&7)) & 15u); -#endif - lua_assert(tt != LUA_TNIL || tvisnil(o)); - return tt; - } -} - -LUALIB_API void luaL_checktype(lua_State *L, int idx, int tt) -{ - if (lua_type(L, idx) != tt) - lj_err_argt(L, idx, tt); -} - -LUALIB_API void luaL_checkany(lua_State *L, int idx) -{ - if (index2adr(L, idx) == niltv(L)) - lj_err_arg(L, idx, LJ_ERR_NOVAL); -} - -LUA_API const char *lua_typename(lua_State *L, int t) -{ - UNUSED(L); - return lj_obj_typename[t+1]; -} - -LUA_API int lua_iscfunction(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - return tvisfunc(o) && !isluafunc(funcV(o)); -} - -LUA_API int lua_isnumber(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - TValue tmp; - return (tvisnumber(o) || (tvisstr(o) && lj_strscan_number(strV(o), &tmp))); -} - -LUA_API int lua_isstring(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - return (tvisstr(o) || tvisnumber(o)); -} - -LUA_API int lua_isuserdata(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - return (tvisudata(o) || tvislightud(o)); -} - -LUA_API int lua_rawequal(lua_State *L, int idx1, int idx2) -{ - cTValue *o1 = index2adr(L, idx1); - cTValue *o2 = index2adr(L, idx2); - return (o1 == niltv(L) || o2 == niltv(L)) ? 0 : lj_obj_equal(o1, o2); -} - -LUA_API int lua_equal(lua_State *L, int idx1, int idx2) -{ - cTValue *o1 = index2adr(L, idx1); - cTValue *o2 = index2adr(L, idx2); - if (tvisint(o1) && tvisint(o2)) { - return intV(o1) == intV(o2); - } else if (tvisnumber(o1) && tvisnumber(o2)) { - return numberVnum(o1) == numberVnum(o2); - } else if (itype(o1) != itype(o2)) { - return 0; - } else if (tvispri(o1)) { - return o1 != niltv(L) && o2 != niltv(L); -#if LJ_64 - } else if (tvislightud(o1)) { - return o1->u64 == o2->u64; -#endif - } else if (gcrefeq(o1->gcr, o2->gcr)) { - return 1; - } else if (!tvistabud(o1)) { - return 0; - } else { - TValue *base = lj_meta_equal(L, gcV(o1), gcV(o2), 0); - if ((uintptr_t)base <= 1) { - return (int)(uintptr_t)base; - } else { - L->top = base+2; - lj_vm_call(L, base, 1+1); - L->top -= 2; - return tvistruecond(L->top+1); - } - } -} - -LUA_API int lua_lessthan(lua_State *L, int idx1, int idx2) -{ - cTValue *o1 = index2adr(L, idx1); - cTValue *o2 = index2adr(L, idx2); - if (o1 == niltv(L) || o2 == niltv(L)) { - return 0; - } else if (tvisint(o1) && tvisint(o2)) { - return intV(o1) < intV(o2); - } else if (tvisnumber(o1) && tvisnumber(o2)) { - return numberVnum(o1) < numberVnum(o2); - } else { - TValue *base = lj_meta_comp(L, o1, o2, 0); - if ((uintptr_t)base <= 1) { - return (int)(uintptr_t)base; - } else { - L->top = base+2; - lj_vm_call(L, base, 1+1); - L->top -= 2; - return tvistruecond(L->top+1); - } - } -} - -LUA_API lua_Number lua_tonumber(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - TValue tmp; - if (LJ_LIKELY(tvisnumber(o))) - return numberVnum(o); - else if (tvisstr(o) && lj_strscan_num(strV(o), &tmp)) - return numV(&tmp); - else - return 0; -} - -LUALIB_API lua_Number luaL_checknumber(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - TValue tmp; - if (LJ_LIKELY(tvisnumber(o))) - return numberVnum(o); - else if (!(tvisstr(o) && lj_strscan_num(strV(o), &tmp))) - lj_err_argt(L, idx, LUA_TNUMBER); - return numV(&tmp); -} - -LUALIB_API lua_Number luaL_optnumber(lua_State *L, int idx, lua_Number def) -{ - cTValue *o = index2adr(L, idx); - TValue tmp; - if (LJ_LIKELY(tvisnumber(o))) - return numberVnum(o); - else if (tvisnil(o)) - return def; - else if (!(tvisstr(o) && lj_strscan_num(strV(o), &tmp))) - lj_err_argt(L, idx, LUA_TNUMBER); - return numV(&tmp); -} - -LUA_API lua_Integer lua_tointeger(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - TValue tmp; - lua_Number n; - if (LJ_LIKELY(tvisint(o))) { - return intV(o); - } else if (LJ_LIKELY(tvisnum(o))) { - n = numV(o); - } else { - if (!(tvisstr(o) && lj_strscan_number(strV(o), &tmp))) - return 0; - if (tvisint(&tmp)) - return (lua_Integer)intV(&tmp); - n = numV(&tmp); - } -#if LJ_64 - return (lua_Integer)n; -#else - return lj_num2int(n); -#endif -} - -LUALIB_API lua_Integer luaL_checkinteger(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - TValue tmp; - lua_Number n; - if (LJ_LIKELY(tvisint(o))) { - return intV(o); - } else if (LJ_LIKELY(tvisnum(o))) { - n = numV(o); - } else { - if (!(tvisstr(o) && lj_strscan_number(strV(o), &tmp))) - lj_err_argt(L, idx, LUA_TNUMBER); - if (tvisint(&tmp)) - return (lua_Integer)intV(&tmp); - n = numV(&tmp); - } -#if LJ_64 - return (lua_Integer)n; -#else - return lj_num2int(n); -#endif -} - -LUALIB_API lua_Integer luaL_optinteger(lua_State *L, int idx, lua_Integer def) -{ - cTValue *o = index2adr(L, idx); - TValue tmp; - lua_Number n; - if (LJ_LIKELY(tvisint(o))) { - return intV(o); - } else if (LJ_LIKELY(tvisnum(o))) { - n = numV(o); - } else if (tvisnil(o)) { - return def; - } else { - if (!(tvisstr(o) && lj_strscan_number(strV(o), &tmp))) - lj_err_argt(L, idx, LUA_TNUMBER); - if (tvisint(&tmp)) - return (lua_Integer)intV(&tmp); - n = numV(&tmp); - } -#if LJ_64 - return (lua_Integer)n; -#else - return lj_num2int(n); -#endif -} - -LUA_API int lua_toboolean(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - return tvistruecond(o); -} - -LUA_API const char *lua_tolstring(lua_State *L, int idx, size_t *len) -{ - TValue *o = index2adr(L, idx); - GCstr *s; - if (LJ_LIKELY(tvisstr(o))) { - s = strV(o); - } else if (tvisnumber(o)) { - lj_gc_check(L); - o = index2adr(L, idx); /* GC may move the stack. */ - s = lj_str_fromnumber(L, o); - setstrV(L, o, s); - } else { - if (len != NULL) *len = 0; - return NULL; - } - if (len != NULL) *len = s->len; - return strdata(s); -} - -LUALIB_API const char *luaL_checklstring(lua_State *L, int idx, size_t *len) -{ - TValue *o = index2adr(L, idx); - GCstr *s; - if (LJ_LIKELY(tvisstr(o))) { - s = strV(o); - } else if (tvisnumber(o)) { - lj_gc_check(L); - o = index2adr(L, idx); /* GC may move the stack. */ - s = lj_str_fromnumber(L, o); - setstrV(L, o, s); - } else { - lj_err_argt(L, idx, LUA_TSTRING); - } - if (len != NULL) *len = s->len; - return strdata(s); -} - -LUALIB_API const char *luaL_optlstring(lua_State *L, int idx, - const char *def, size_t *len) -{ - TValue *o = index2adr(L, idx); - GCstr *s; - if (LJ_LIKELY(tvisstr(o))) { - s = strV(o); - } else if (tvisnil(o)) { - if (len != NULL) *len = def ? strlen(def) : 0; - return def; - } else if (tvisnumber(o)) { - lj_gc_check(L); - o = index2adr(L, idx); /* GC may move the stack. */ - s = lj_str_fromnumber(L, o); - setstrV(L, o, s); - } else { - lj_err_argt(L, idx, LUA_TSTRING); - } - if (len != NULL) *len = s->len; - return strdata(s); -} - -LUALIB_API int luaL_checkoption(lua_State *L, int idx, const char *def, - const char *const lst[]) -{ - ptrdiff_t i; - const char *s = lua_tolstring(L, idx, NULL); - if (s == NULL && (s = def) == NULL) - lj_err_argt(L, idx, LUA_TSTRING); - for (i = 0; lst[i]; i++) - if (strcmp(lst[i], s) == 0) - return (int)i; - lj_err_argv(L, idx, LJ_ERR_INVOPTM, s); -} - -LUA_API size_t lua_objlen(lua_State *L, int idx) -{ - TValue *o = index2adr(L, idx); - if (tvisstr(o)) { - return strV(o)->len; - } else if (tvistab(o)) { - return (size_t)lj_tab_len(tabV(o)); - } else if (tvisudata(o)) { - return udataV(o)->len; - } else if (tvisnumber(o)) { - GCstr *s = lj_str_fromnumber(L, o); - setstrV(L, o, s); - return s->len; - } else { - return 0; - } -} - -LUA_API lua_CFunction lua_tocfunction(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - if (tvisfunc(o)) { - BCOp op = bc_op(*mref(funcV(o)->c.pc, BCIns)); - if (op == BC_FUNCC || op == BC_FUNCCW) - return funcV(o)->c.f; - } - return NULL; -} - -LUA_API void *lua_touserdata(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - if (tvisudata(o)) - return uddata(udataV(o)); - else if (tvislightud(o)) - return lightudV(o); - else - return NULL; -} - -LUA_API lua_State *lua_tothread(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - return (!tvisthread(o)) ? NULL : threadV(o); -} - -LUA_API const void *lua_topointer(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - if (tvisudata(o)) - return uddata(udataV(o)); - else if (tvislightud(o)) - return lightudV(o); - else if (tviscdata(o)) - return cdataptr(cdataV(o)); - else if (tvisgcv(o)) - return gcV(o); - else - return NULL; -} - -/* -- Stack setters (object creation) ------------------------------------- */ - -LUA_API void lua_pushnil(lua_State *L) -{ - setnilV(L->top); - incr_top(L); -} - -LUA_API void lua_pushnumber(lua_State *L, lua_Number n) -{ - setnumV(L->top, n); - if (LJ_UNLIKELY(tvisnan(L->top))) - setnanV(L->top); /* Canonicalize injected NaNs. */ - incr_top(L); -} - -LUA_API void lua_pushinteger(lua_State *L, lua_Integer n) -{ - setintptrV(L->top, n); - incr_top(L); -} - -LUA_API void lua_pushlstring(lua_State *L, const char *str, size_t len) -{ - GCstr *s; - lj_gc_check(L); - s = lj_str_new(L, str, len); - setstrV(L, L->top, s); - incr_top(L); -} - -LUA_API void lua_pushstring(lua_State *L, const char *str) -{ - if (str == NULL) { - setnilV(L->top); - } else { - GCstr *s; - lj_gc_check(L); - s = lj_str_newz(L, str); - setstrV(L, L->top, s); - } - incr_top(L); -} - -LUA_API const char *lua_pushvfstring(lua_State *L, const char *fmt, - va_list argp) -{ - lj_gc_check(L); - return lj_str_pushvf(L, fmt, argp); -} - -LUA_API const char *lua_pushfstring(lua_State *L, const char *fmt, ...) -{ - const char *ret; - va_list argp; - lj_gc_check(L); - va_start(argp, fmt); - ret = lj_str_pushvf(L, fmt, argp); - va_end(argp); - return ret; -} - -LUA_API void lua_pushcclosure(lua_State *L, lua_CFunction f, int n) -{ - GCfunc *fn; - lj_gc_check(L); - api_checknelems(L, n); - fn = lj_func_newC(L, (MSize)n, getcurrenv(L)); - fn->c.f = f; - L->top -= n; - while (n--) - copyTV(L, &fn->c.upvalue[n], L->top+n); - setfuncV(L, L->top, fn); - lua_assert(iswhite(obj2gco(fn))); - incr_top(L); -} - -LUA_API void lua_pushboolean(lua_State *L, int b) -{ - setboolV(L->top, (b != 0)); - incr_top(L); -} - -LUA_API void lua_pushlightuserdata(lua_State *L, void *p) -{ - setlightudV(L->top, checklightudptr(L, p)); - incr_top(L); -} - -LUA_API void lua_createtable(lua_State *L, int narray, int nrec) -{ - GCtab *t; - lj_gc_check(L); - t = lj_tab_new(L, (uint32_t)(narray > 0 ? narray+1 : 0), hsize2hbits(nrec)); - settabV(L, L->top, t); - incr_top(L); -} - -LUALIB_API int luaL_newmetatable(lua_State *L, const char *tname) -{ - GCtab *regt = tabV(registry(L)); - TValue *tv = lj_tab_setstr(L, regt, lj_str_newz(L, tname)); - if (tvisnil(tv)) { - GCtab *mt = lj_tab_new(L, 0, 1); - settabV(L, tv, mt); - settabV(L, L->top++, mt); - lj_gc_anybarriert(L, regt); - return 1; - } else { - copyTV(L, L->top++, tv); - return 0; - } -} - -LUA_API int lua_pushthread(lua_State *L) -{ - setthreadV(L, L->top, L); - incr_top(L); - return (mainthread(G(L)) == L); -} - -LUA_API lua_State *lua_newthread(lua_State *L) -{ - lua_State *L1; - lj_gc_check(L); - L1 = lj_state_new(L); - setthreadV(L, L->top, L1); - incr_top(L); - return L1; -} - -LUA_API void *lua_newuserdata(lua_State *L, size_t size) -{ - GCudata *ud; - lj_gc_check(L); - if (size > LJ_MAX_UDATA) - lj_err_msg(L, LJ_ERR_UDATAOV); - ud = lj_udata_new(L, (MSize)size, getcurrenv(L)); - setudataV(L, L->top, ud); - incr_top(L); - return uddata(ud); -} - -LUA_API void lua_concat(lua_State *L, int n) -{ - api_checknelems(L, n); - if (n >= 2) { - n--; - do { - TValue *top = lj_meta_cat(L, L->top-1, -n); - if (top == NULL) { - L->top -= n; - break; - } - n -= (int)(L->top - top); - L->top = top+2; - lj_vm_call(L, top, 1+1); - L->top--; - copyTV(L, L->top-1, L->top); - } while (--n > 0); - } else if (n == 0) { /* Push empty string. */ - setstrV(L, L->top, &G(L)->strempty); - incr_top(L); - } - /* else n == 1: nothing to do. */ -} - -/* -- Object getters ------------------------------------------------------ */ - -LUA_API void lua_gettable(lua_State *L, int idx) -{ - cTValue *v, *t = index2adr(L, idx); - api_checkvalidindex(L, t); - v = lj_meta_tget(L, t, L->top-1); - if (v == NULL) { - L->top += 2; - lj_vm_call(L, L->top-2, 1+1); - L->top -= 2; - v = L->top+1; - } - copyTV(L, L->top-1, v); -} - -LUA_API void lua_getfield(lua_State *L, int idx, const char *k) -{ - cTValue *v, *t = index2adr(L, idx); - TValue key; - api_checkvalidindex(L, t); - setstrV(L, &key, lj_str_newz(L, k)); - v = lj_meta_tget(L, t, &key); - if (v == NULL) { - L->top += 2; - lj_vm_call(L, L->top-2, 1+1); - L->top -= 2; - v = L->top+1; - } - copyTV(L, L->top, v); - incr_top(L); -} - -LUA_API void lua_rawget(lua_State *L, int idx) -{ - cTValue *t = index2adr(L, idx); - api_check(L, tvistab(t)); - copyTV(L, L->top-1, lj_tab_get(L, tabV(t), L->top-1)); -} - -LUA_API void lua_rawgeti(lua_State *L, int idx, int n) -{ - cTValue *v, *t = index2adr(L, idx); - api_check(L, tvistab(t)); - v = lj_tab_getint(tabV(t), n); - if (v) { - copyTV(L, L->top, v); - } else { - setnilV(L->top); - } - incr_top(L); -} - -LUA_API int lua_getmetatable(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - GCtab *mt = NULL; - if (tvistab(o)) - mt = tabref(tabV(o)->metatable); - else if (tvisudata(o)) - mt = tabref(udataV(o)->metatable); - else - mt = tabref(basemt_obj(G(L), o)); - if (mt == NULL) - return 0; - settabV(L, L->top, mt); - incr_top(L); - return 1; -} - -LUALIB_API int luaL_getmetafield(lua_State *L, int idx, const char *field) -{ - if (lua_getmetatable(L, idx)) { - cTValue *tv = lj_tab_getstr(tabV(L->top-1), lj_str_newz(L, field)); - if (tv && !tvisnil(tv)) { - copyTV(L, L->top-1, tv); - return 1; - } - L->top--; - } - return 0; -} - -LUA_API void lua_getfenv(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - api_checkvalidindex(L, o); - if (tvisfunc(o)) { - settabV(L, L->top, tabref(funcV(o)->c.env)); - } else if (tvisudata(o)) { - settabV(L, L->top, tabref(udataV(o)->env)); - } else if (tvisthread(o)) { - settabV(L, L->top, tabref(threadV(o)->env)); - } else { - setnilV(L->top); - } - incr_top(L); -} - -LUA_API int lua_next(lua_State *L, int idx) -{ - cTValue *t = index2adr(L, idx); - int more; - api_check(L, tvistab(t)); - more = lj_tab_next(L, tabV(t), L->top-1); - if (more) { - incr_top(L); /* Return new key and value slot. */ - } else { /* End of traversal. */ - L->top--; /* Remove key slot. */ - } - return more; -} - -LUA_API const char *lua_getupvalue(lua_State *L, int idx, int n) -{ - TValue *val; - const char *name = lj_debug_uvnamev(index2adr(L, idx), (uint32_t)(n-1), &val); - if (name) { - copyTV(L, L->top, val); - incr_top(L); - } - return name; -} - -LUA_API void *lua_upvalueid(lua_State *L, int idx, int n) -{ - GCfunc *fn = funcV(index2adr(L, idx)); - n--; - api_check(L, (uint32_t)n < fn->l.nupvalues); - return isluafunc(fn) ? (void *)gcref(fn->l.uvptr[n]) : - (void *)&fn->c.upvalue[n]; -} - -LUA_API void lua_upvaluejoin(lua_State *L, int idx1, int n1, int idx2, int n2) -{ - GCfunc *fn1 = funcV(index2adr(L, idx1)); - GCfunc *fn2 = funcV(index2adr(L, idx2)); - n1--; n2--; - api_check(L, isluafunc(fn1) && (uint32_t)n1 < fn1->l.nupvalues); - api_check(L, isluafunc(fn2) && (uint32_t)n2 < fn2->l.nupvalues); - setgcrefr(fn1->l.uvptr[n1], fn2->l.uvptr[n2]); - lj_gc_objbarrier(L, fn1, gcref(fn1->l.uvptr[n1])); -} - -LUALIB_API void *luaL_checkudata(lua_State *L, int idx, const char *tname) -{ - cTValue *o = index2adr(L, idx); - if (tvisudata(o)) { - GCudata *ud = udataV(o); - cTValue *tv = lj_tab_getstr(tabV(registry(L)), lj_str_newz(L, tname)); - if (tv && tvistab(tv) && tabV(tv) == tabref(ud->metatable)) - return uddata(ud); - } - lj_err_argtype(L, idx, tname); - return NULL; /* unreachable */ -} - -/* -- Object setters ------------------------------------------------------ */ - -LUA_API void lua_settable(lua_State *L, int idx) -{ - TValue *o; - cTValue *t = index2adr(L, idx); - api_checknelems(L, 2); - api_checkvalidindex(L, t); - o = lj_meta_tset(L, t, L->top-2); - if (o) { - /* NOBARRIER: lj_meta_tset ensures the table is not black. */ - copyTV(L, o, L->top-1); - L->top -= 2; - } else { - L->top += 3; - copyTV(L, L->top-1, L->top-6); - lj_vm_call(L, L->top-3, 0+1); - L->top -= 3; - } -} - -LUA_API void lua_setfield(lua_State *L, int idx, const char *k) -{ - TValue *o; - TValue key; - cTValue *t = index2adr(L, idx); - api_checknelems(L, 1); - api_checkvalidindex(L, t); - setstrV(L, &key, lj_str_newz(L, k)); - o = lj_meta_tset(L, t, &key); - if (o) { - L->top--; - /* NOBARRIER: lj_meta_tset ensures the table is not black. */ - copyTV(L, o, L->top); - } else { - L->top += 3; - copyTV(L, L->top-1, L->top-6); - lj_vm_call(L, L->top-3, 0+1); - L->top -= 2; - } -} - -LUA_API void lua_rawset(lua_State *L, int idx) -{ - GCtab *t = tabV(index2adr(L, idx)); - TValue *dst, *key; - api_checknelems(L, 2); - key = L->top-2; - dst = lj_tab_set(L, t, key); - copyTV(L, dst, key+1); - lj_gc_anybarriert(L, t); - L->top = key; -} - -LUA_API void lua_rawseti(lua_State *L, int idx, int n) -{ - GCtab *t = tabV(index2adr(L, idx)); - TValue *dst, *src; - api_checknelems(L, 1); - dst = lj_tab_setint(L, t, n); - src = L->top-1; - copyTV(L, dst, src); - lj_gc_barriert(L, t, dst); - L->top = src; -} - -LUA_API int lua_setmetatable(lua_State *L, int idx) -{ - global_State *g; - GCtab *mt; - cTValue *o = index2adr(L, idx); - api_checknelems(L, 1); - api_checkvalidindex(L, o); - if (tvisnil(L->top-1)) { - mt = NULL; - } else { - api_check(L, tvistab(L->top-1)); - mt = tabV(L->top-1); - } - g = G(L); - if (tvistab(o)) { - setgcref(tabV(o)->metatable, obj2gco(mt)); - if (mt) - lj_gc_objbarriert(L, tabV(o), mt); - } else if (tvisudata(o)) { - setgcref(udataV(o)->metatable, obj2gco(mt)); - if (mt) - lj_gc_objbarrier(L, udataV(o), mt); - } else { - /* Flush cache, since traces specialize to basemt. But not during __gc. */ - if (lj_trace_flushall(L)) - lj_err_caller(L, LJ_ERR_NOGCMM); - if (tvisbool(o)) { - /* NOBARRIER: basemt is a GC root. */ - setgcref(basemt_it(g, LJ_TTRUE), obj2gco(mt)); - setgcref(basemt_it(g, LJ_TFALSE), obj2gco(mt)); - } else { - /* NOBARRIER: basemt is a GC root. */ - setgcref(basemt_obj(g, o), obj2gco(mt)); - } - } - L->top--; - return 1; -} - -LUA_API int lua_setfenv(lua_State *L, int idx) -{ - cTValue *o = index2adr(L, idx); - GCtab *t; - api_checknelems(L, 1); - api_checkvalidindex(L, o); - api_check(L, tvistab(L->top-1)); - t = tabV(L->top-1); - if (tvisfunc(o)) { - setgcref(funcV(o)->c.env, obj2gco(t)); - } else if (tvisudata(o)) { - setgcref(udataV(o)->env, obj2gco(t)); - } else if (tvisthread(o)) { - setgcref(threadV(o)->env, obj2gco(t)); - } else { - L->top--; - return 0; - } - lj_gc_objbarrier(L, gcV(o), t); - L->top--; - return 1; -} - -LUA_API const char *lua_setupvalue(lua_State *L, int idx, int n) -{ - cTValue *f = index2adr(L, idx); - TValue *val; - const char *name; - api_checknelems(L, 1); - name = lj_debug_uvnamev(f, (uint32_t)(n-1), &val); - if (name) { - L->top--; - copyTV(L, val, L->top); - lj_gc_barrier(L, funcV(f), L->top); - } - return name; -} - -/* -- Calls --------------------------------------------------------------- */ - -LUA_API void lua_call(lua_State *L, int nargs, int nresults) -{ - api_check(L, L->status == 0 || L->status == LUA_ERRERR); - api_checknelems(L, nargs+1); - lj_vm_call(L, L->top - nargs, nresults+1); -} - -LUA_API int lua_pcall(lua_State *L, int nargs, int nresults, int errfunc) -{ - global_State *g = G(L); - uint8_t oldh = hook_save(g); - ptrdiff_t ef; - int status; - api_check(L, L->status == 0 || L->status == LUA_ERRERR); - api_checknelems(L, nargs+1); - if (errfunc == 0) { - ef = 0; - } else { - cTValue *o = stkindex2adr(L, errfunc); - api_checkvalidindex(L, o); - ef = savestack(L, o); - } - status = lj_vm_pcall(L, L->top - nargs, nresults+1, ef); - if (status) hook_restore(g, oldh); - return status; -} - -static TValue *cpcall(lua_State *L, lua_CFunction func, void *ud) -{ - GCfunc *fn = lj_func_newC(L, 0, getcurrenv(L)); - fn->c.f = func; - setfuncV(L, L->top, fn); - setlightudV(L->top+1, checklightudptr(L, ud)); - cframe_nres(L->cframe) = 1+0; /* Zero results. */ - L->top += 2; - return L->top-1; /* Now call the newly allocated C function. */ -} - -LUA_API int lua_cpcall(lua_State *L, lua_CFunction func, void *ud) -{ - global_State *g = G(L); - uint8_t oldh = hook_save(g); - int status; - api_check(L, L->status == 0 || L->status == LUA_ERRERR); - status = lj_vm_cpcall(L, func, ud, cpcall); - if (status) hook_restore(g, oldh); - return status; -} - -LUALIB_API int luaL_callmeta(lua_State *L, int idx, const char *field) -{ - if (luaL_getmetafield(L, idx, field)) { - TValue *base = L->top--; - copyTV(L, base, index2adr(L, idx)); - L->top = base+1; - lj_vm_call(L, base, 1+1); - return 1; - } - return 0; -} - -/* -- Coroutine yield and resume ------------------------------------------ */ - -LUA_API int lua_yield(lua_State *L, int nresults) -{ - void *cf = L->cframe; - global_State *g = G(L); - if (cframe_canyield(cf)) { - cf = cframe_raw(cf); - if (!hook_active(g)) { /* Regular yield: move results down if needed. */ - cTValue *f = L->top - nresults; - if (f > L->base) { - TValue *t = L->base; - while (--nresults >= 0) copyTV(L, t++, f++); - L->top = t; - } - L->cframe = NULL; - L->status = LUA_YIELD; - return -1; - } else { /* Yield from hook: add a pseudo-frame. */ - TValue *top = L->top; - hook_leave(g); - top->u64 = cframe_multres(cf); - setcont(top+1, lj_cont_hook); - setframe_pc(top+1, cframe_pc(cf)-1); - setframe_gc(top+2, obj2gco(L)); - setframe_ftsz(top+2, (int)((char *)(top+3)-(char *)L->base)+FRAME_CONT); - L->top = L->base = top+3; -#if LJ_TARGET_X64 - lj_err_throw(L, LUA_YIELD); -#else - L->cframe = NULL; - L->status = LUA_YIELD; - lj_vm_unwind_c(cf, LUA_YIELD); -#endif - } - } - lj_err_msg(L, LJ_ERR_CYIELD); - return 0; /* unreachable */ -} - -LUA_API int lua_resume(lua_State *L, int nargs) -{ - if (L->cframe == NULL && L->status <= LUA_YIELD) - return lj_vm_resume(L, L->top - nargs, 0, 0); - L->top = L->base; - setstrV(L, L->top, lj_err_str(L, LJ_ERR_COSUSP)); - incr_top(L); - return LUA_ERRRUN; -} - -/* -- GC and memory management -------------------------------------------- */ - -LUA_API int lua_gc(lua_State *L, int what, int data) -{ - global_State *g = G(L); - int res = 0; - switch (what) { - case LUA_GCSTOP: - g->gc.threshold = LJ_MAX_MEM; - break; - case LUA_GCRESTART: - g->gc.threshold = data == -1 ? (g->gc.total/100)*g->gc.pause : g->gc.total; - break; - case LUA_GCCOLLECT: - lj_gc_fullgc(L); - break; - case LUA_GCCOUNT: - res = (int)(g->gc.total >> 10); - break; - case LUA_GCCOUNTB: - res = (int)(g->gc.total & 0x3ff); - break; - case LUA_GCSTEP: { - MSize a = (MSize)data << 10; - g->gc.threshold = (a <= g->gc.total) ? (g->gc.total - a) : 0; - while (g->gc.total >= g->gc.threshold) - if (lj_gc_step(L) > 0) { - res = 1; - break; - } - break; - } - case LUA_GCSETPAUSE: - res = (int)(g->gc.pause); - g->gc.pause = (MSize)data; - break; - case LUA_GCSETSTEPMUL: - res = (int)(g->gc.stepmul); - g->gc.stepmul = (MSize)data; - break; - default: - res = -1; /* Invalid option. */ - } - return res; -} - -LUA_API lua_Alloc lua_getallocf(lua_State *L, void **ud) -{ - global_State *g = G(L); - if (ud) *ud = g->allocd; - return g->allocf; -} - -LUA_API void lua_setallocf(lua_State *L, lua_Alloc f, void *ud) -{ - global_State *g = G(L); - g->allocd = ud; - g->allocf = f; -} - diff --git a/subprojects/luajit/src/lj_arch.h b/subprojects/luajit/src/lj_arch.h deleted file mode 100644 index e04c4ee9f..000000000 --- a/subprojects/luajit/src/lj_arch.h +++ /dev/null @@ -1,452 +0,0 @@ -/* -** Target architecture selection. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_ARCH_H -#define _LJ_ARCH_H - -#include "lua.h" - -/* Target endianess. */ -#define LUAJIT_LE 0 -#define LUAJIT_BE 1 - -/* Target architectures. */ -#define LUAJIT_ARCH_X86 1 -#define LUAJIT_ARCH_x86 1 -#define LUAJIT_ARCH_X64 2 -#define LUAJIT_ARCH_x64 2 -#define LUAJIT_ARCH_ARM 3 -#define LUAJIT_ARCH_arm 3 -#define LUAJIT_ARCH_PPC 4 -#define LUAJIT_ARCH_ppc 4 -#define LUAJIT_ARCH_PPCSPE 5 -#define LUAJIT_ARCH_ppcspe 5 -#define LUAJIT_ARCH_MIPS 6 -#define LUAJIT_ARCH_mips 6 - -/* Target OS. */ -#define LUAJIT_OS_OTHER 0 -#define LUAJIT_OS_WINDOWS 1 -#define LUAJIT_OS_LINUX 2 -#define LUAJIT_OS_OSX 3 -#define LUAJIT_OS_BSD 4 -#define LUAJIT_OS_POSIX 5 - -/* Select native target if no target defined. */ -#ifndef LUAJIT_TARGET - -#if defined(__i386) || defined(__i386__) || defined(_M_IX86) -#define LUAJIT_TARGET LUAJIT_ARCH_X86 -#elif defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64) -#define LUAJIT_TARGET LUAJIT_ARCH_X64 -#elif defined(__arm__) || defined(__arm) || defined(__ARM__) || defined(__ARM) -#define LUAJIT_TARGET LUAJIT_ARCH_ARM -#elif defined(__ppc__) || defined(__ppc) || defined(__PPC__) || defined(__PPC) || defined(__powerpc__) || defined(__powerpc) || defined(__POWERPC__) || defined(__POWERPC) || defined(_M_PPC) -#ifdef __NO_FPRS__ -#define LUAJIT_TARGET LUAJIT_ARCH_PPCSPE -#else -#define LUAJIT_TARGET LUAJIT_ARCH_PPC -#endif -#elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(__MIPS) -#define LUAJIT_TARGET LUAJIT_ARCH_MIPS -#else -#error "No support for this architecture (yet)" -#endif - -#endif - -/* Select native OS if no target OS defined. */ -#ifndef LUAJIT_OS - -#if defined(_WIN32) && !defined(_XBOX_VER) -#define LUAJIT_OS LUAJIT_OS_WINDOWS -#elif defined(__linux__) -#define LUAJIT_OS LUAJIT_OS_LINUX -#elif defined(__MACH__) && defined(__APPLE__) -#define LUAJIT_OS LUAJIT_OS_OSX -#elif (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ - defined(__NetBSD__) || defined(__OpenBSD__) || \ - defined(__DragonFly__)) && !defined(__ORBIS__) -#define LUAJIT_OS LUAJIT_OS_BSD -#elif (defined(__sun__) && defined(__svr4__)) -#define LUAJIT_OS LUAJIT_OS_POSIX -#elif defined(__CYGWIN__) -#define LJ_TARGET_CYGWIN 1 -#define LUAJIT_OS LUAJIT_OS_POSIX -#else -#define LUAJIT_OS LUAJIT_OS_OTHER -#endif - -#endif - -/* Set target OS properties. */ -#if LUAJIT_OS == LUAJIT_OS_WINDOWS -#define LJ_OS_NAME "Windows" -#elif LUAJIT_OS == LUAJIT_OS_LINUX -#define LJ_OS_NAME "Linux" -#elif LUAJIT_OS == LUAJIT_OS_OSX -#define LJ_OS_NAME "OSX" -#elif LUAJIT_OS == LUAJIT_OS_BSD -#define LJ_OS_NAME "BSD" -#elif LUAJIT_OS == LUAJIT_OS_POSIX -#define LJ_OS_NAME "POSIX" -#else -#define LJ_OS_NAME "Other" -#endif - -#define LJ_TARGET_WINDOWS (LUAJIT_OS == LUAJIT_OS_WINDOWS) -#define LJ_TARGET_LINUX (LUAJIT_OS == LUAJIT_OS_LINUX) -#define LJ_TARGET_OSX (LUAJIT_OS == LUAJIT_OS_OSX) -#define LJ_TARGET_IOS (LJ_TARGET_OSX && LUAJIT_TARGET == LUAJIT_ARCH_ARM) -#define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS) -#define LJ_TARGET_DLOPEN LJ_TARGET_POSIX - -#ifdef __CELLOS_LV2__ -#define LJ_TARGET_PS3 1 -#define LJ_TARGET_CONSOLE 1 -#endif - -#ifdef __ORBIS__ -#define LJ_TARGET_PS4 1 -#define LJ_TARGET_CONSOLE 1 -#undef NULL -#define NULL ((void*)0) -#endif - -#ifdef __psp2__ -#define LJ_TARGET_PSVITA 1 -#define LJ_TARGET_CONSOLE 1 -#endif - -#if _XBOX_VER >= 200 -#define LJ_TARGET_XBOX360 1 -#define LJ_TARGET_CONSOLE 1 -#endif - -#define LJ_NUMMODE_SINGLE 0 /* Single-number mode only. */ -#define LJ_NUMMODE_SINGLE_DUAL 1 /* Default to single-number mode. */ -#define LJ_NUMMODE_DUAL 2 /* Dual-number mode only. */ -#define LJ_NUMMODE_DUAL_SINGLE 3 /* Default to dual-number mode. */ - -/* Set target architecture properties. */ -#if LUAJIT_TARGET == LUAJIT_ARCH_X86 - -#define LJ_ARCH_NAME "x86" -#define LJ_ARCH_BITS 32 -#define LJ_ARCH_ENDIAN LUAJIT_LE -#if LJ_TARGET_WINDOWS || LJ_TARGET_CYGWIN -#define LJ_ABI_WIN 1 -#else -#define LJ_ABI_WIN 0 -#endif -#define LJ_TARGET_X86 1 -#define LJ_TARGET_X86ORX64 1 -#define LJ_TARGET_EHRETREG 0 -#define LJ_TARGET_MASKSHIFT 1 -#define LJ_TARGET_MASKROT 1 -#define LJ_TARGET_UNALIGNED 1 -#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE_DUAL - -#elif LUAJIT_TARGET == LUAJIT_ARCH_X64 - -#define LJ_ARCH_NAME "x64" -#define LJ_ARCH_BITS 64 -#define LJ_ARCH_ENDIAN LUAJIT_LE -#if LJ_TARGET_WINDOWS || LJ_TARGET_CYGWIN -#define LJ_ABI_WIN 1 -#else -#define LJ_ABI_WIN 0 -#endif -#define LJ_TARGET_X64 1 -#define LJ_TARGET_X86ORX64 1 -#define LJ_TARGET_EHRETREG 0 -#define LJ_TARGET_JUMPRANGE 31 /* +-2^31 = +-2GB */ -#define LJ_TARGET_MASKSHIFT 1 -#define LJ_TARGET_MASKROT 1 -#define LJ_TARGET_UNALIGNED 1 -#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE_DUAL - -#elif LUAJIT_TARGET == LUAJIT_ARCH_ARM - -#define LJ_ARCH_NAME "arm" -#define LJ_ARCH_BITS 32 -#define LJ_ARCH_ENDIAN LUAJIT_LE -#if !defined(LJ_ARCH_HASFPU) && __SOFTFP__ -#define LJ_ARCH_HASFPU 0 -#endif -#if !defined(LJ_ABI_SOFTFP) && !__ARM_PCS_VFP -#define LJ_ABI_SOFTFP 1 -#endif -#define LJ_ABI_EABI 1 -#define LJ_TARGET_ARM 1 -#define LJ_TARGET_EHRETREG 0 -#define LJ_TARGET_JUMPRANGE 25 /* +-2^25 = +-32MB */ -#define LJ_TARGET_MASKSHIFT 0 -#define LJ_TARGET_MASKROT 1 -#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ -#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL - -#if __ARM_ARCH____ARM_ARCH_8__ || __ARM_ARCH_8A__ -#define LJ_ARCH_VERSION 80 -#elif __ARM_ARCH_7__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH_7S__ || __ARM_ARCH_7VE__ -#define LJ_ARCH_VERSION 70 -#elif __ARM_ARCH_6T2__ -#define LJ_ARCH_VERSION 61 -#elif __ARM_ARCH_6__ || __ARM_ARCH_6J__ || __ARM_ARCH_6K__ || __ARM_ARCH_6Z__ || __ARM_ARCH_6ZK__ -#define LJ_ARCH_VERSION 60 -#else -#define LJ_ARCH_VERSION 50 -#endif - -#elif LUAJIT_TARGET == LUAJIT_ARCH_PPC - -#define LJ_ARCH_NAME "ppc" -#if _LP64 -#define LJ_ARCH_BITS 64 -#else -#define LJ_ARCH_BITS 32 -#endif -#define LJ_ARCH_ENDIAN LUAJIT_BE -#define LJ_TARGET_PPC 1 -#define LJ_TARGET_EHRETREG 3 -#define LJ_TARGET_JUMPRANGE 25 /* +-2^25 = +-32MB */ -#define LJ_TARGET_MASKSHIFT 0 -#define LJ_TARGET_MASKROT 1 -#define LJ_TARGET_UNIFYROT 1 /* Want only IR_BROL. */ -#define LJ_ARCH_NUMMODE LJ_NUMMODE_DUAL_SINGLE - -#if _ARCH_PWR7 -#define LJ_ARCH_VERSION 70 -#elif _ARCH_PWR6 -#define LJ_ARCH_VERSION 60 -#elif _ARCH_PWR5X -#define LJ_ARCH_VERSION 51 -#elif _ARCH_PWR5 -#define LJ_ARCH_VERSION 50 -#elif _ARCH_PWR4 -#define LJ_ARCH_VERSION 40 -#else -#define LJ_ARCH_VERSION 0 -#endif -#if __PPC64__ || __powerpc64__ || LJ_TARGET_CONSOLE -#define LJ_ARCH_PPC64 1 -#define LJ_ARCH_NOFFI 1 -#endif -#if _ARCH_PPCSQ -#define LJ_ARCH_SQRT 1 -#endif -#if _ARCH_PWR5X -#define LJ_ARCH_ROUND 1 -#endif -#if __PPU__ -#define LJ_ARCH_CELL 1 -#endif -#if LJ_TARGET_XBOX360 -#define LJ_ARCH_XENON 1 -#endif - -#elif LUAJIT_TARGET == LUAJIT_ARCH_PPCSPE - -#define LJ_ARCH_NAME "ppcspe" -#define LJ_ARCH_BITS 32 -#define LJ_ARCH_ENDIAN LUAJIT_BE -#ifndef LJ_ABI_SOFTFP -#define LJ_ABI_SOFTFP 1 -#endif -#define LJ_ABI_EABI 1 -#define LJ_TARGET_PPCSPE 1 -#define LJ_TARGET_EHRETREG 3 -#define LJ_TARGET_JUMPRANGE 25 /* +-2^25 = +-32MB */ -#define LJ_TARGET_MASKSHIFT 0 -#define LJ_TARGET_MASKROT 1 -#define LJ_TARGET_UNIFYROT 1 /* Want only IR_BROL. */ -#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE -#define LJ_ARCH_NOFFI 1 /* NYI: comparisons, calls. */ -#define LJ_ARCH_NOJIT 1 - -#elif LUAJIT_TARGET == LUAJIT_ARCH_MIPS - -#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) -#define LJ_ARCH_NAME "mipsel" -#define LJ_ARCH_ENDIAN LUAJIT_LE -#else -#define LJ_ARCH_NAME "mips" -#define LJ_ARCH_ENDIAN LUAJIT_BE -#endif -#define LJ_ARCH_BITS 32 -#define LJ_TARGET_MIPS 1 -#define LJ_TARGET_EHRETREG 4 -#define LJ_TARGET_JUMPRANGE 27 /* 2*2^27 = 256MB-aligned region */ -#define LJ_TARGET_MASKSHIFT 1 -#define LJ_TARGET_MASKROT 1 -#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ -#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE - -#if _MIPS_ARCH_MIPS32R2 -#define LJ_ARCH_VERSION 20 -#else -#define LJ_ARCH_VERSION 10 -#endif - -#else -#error "No target architecture defined" -#endif - -#ifndef LJ_PAGESIZE -#define LJ_PAGESIZE 4096 -#endif - -/* Check for minimum required compiler versions. */ -#if defined(__GNUC__) -#if LJ_TARGET_X86 -#if (__GNUC__ < 3) || ((__GNUC__ == 3) && __GNUC_MINOR__ < 4) -#error "Need at least GCC 3.4 or newer" -#endif -#elif LJ_TARGET_X64 -#if __GNUC__ < 4 -#error "Need at least GCC 4.0 or newer" -#endif -#elif LJ_TARGET_ARM -#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 2) -#error "Need at least GCC 4.2 or newer" -#endif -#elif !LJ_TARGET_PS3 -#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3) -#error "Need at least GCC 4.3 or newer" -#endif -#endif -#endif - -/* Check target-specific constraints. */ -#ifndef _BUILDVM_H -#if LJ_TARGET_X64 -#if __USING_SJLJ_EXCEPTIONS__ -#error "Need a C compiler with native exception handling on x64" -#endif -#elif LJ_TARGET_ARM -#if defined(__ARMEB__) -#error "No support for big-endian ARM" -#endif -#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ -#error "No support for Cortex-M CPUs" -#endif -#if !(__ARM_EABI__ || LJ_TARGET_IOS) -#error "Only ARM EABI or iOS 3.0+ ABI is supported" -#endif -#elif LJ_TARGET_PPC || LJ_TARGET_PPCSPE -#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE) -#error "No support for PowerPC CPUs without double-precision FPU" -#endif -#if defined(_LITTLE_ENDIAN) -#error "No support for little-endian PowerPC" -#endif -#if defined(_LP64) -#error "No support for PowerPC 64 bit mode" -#endif -#elif LJ_TARGET_MIPS -#if defined(__mips_soft_float) -#error "No support for MIPS CPUs without FPU" -#endif -#if defined(_LP64) -#error "No support for MIPS64" -#endif -#endif -#endif - -/* Enable or disable the dual-number mode for the VM. */ -#if (LJ_ARCH_NUMMODE == LJ_NUMMODE_SINGLE && LUAJIT_NUMMODE == 2) || \ - (LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL && LUAJIT_NUMMODE == 1) -#error "No support for this number mode on this architecture" -#endif -#if LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL || \ - (LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL_SINGLE && LUAJIT_NUMMODE != 1) || \ - (LJ_ARCH_NUMMODE == LJ_NUMMODE_SINGLE_DUAL && LUAJIT_NUMMODE == 2) -#define LJ_DUALNUM 1 -#else -#define LJ_DUALNUM 0 -#endif - -#if LJ_TARGET_IOS || LJ_TARGET_CONSOLE -/* Runtime code generation is restricted on iOS. Complain to Apple, not me. */ -/* Ditto for the consoles. Complain to Sony or MS, not me. */ -#ifndef LUAJIT_ENABLE_JIT -#define LJ_OS_NOJIT 1 -#endif -#endif - -/* Disable or enable the JIT compiler. */ -#if defined(LUAJIT_DISABLE_JIT) || defined(LJ_ARCH_NOJIT) || defined(LJ_OS_NOJIT) -#define LJ_HASJIT 0 -#else -#define LJ_HASJIT 1 -#endif - -/* Disable or enable the FFI extension. */ -#if defined(LUAJIT_DISABLE_FFI) || defined(LJ_ARCH_NOFFI) -#define LJ_HASFFI 0 -#else -#define LJ_HASFFI 1 -#endif - -#ifndef LJ_ARCH_HASFPU -#define LJ_ARCH_HASFPU 1 -#endif -#ifndef LJ_ABI_SOFTFP -#define LJ_ABI_SOFTFP 0 -#endif -#define LJ_SOFTFP (!LJ_ARCH_HASFPU) - -#if LJ_ARCH_ENDIAN == LUAJIT_BE -#define LJ_LE 0 -#define LJ_BE 1 -#define LJ_ENDIAN_SELECT(le, be) be -#define LJ_ENDIAN_LOHI(lo, hi) hi lo -#else -#define LJ_LE 1 -#define LJ_BE 0 -#define LJ_ENDIAN_SELECT(le, be) le -#define LJ_ENDIAN_LOHI(lo, hi) lo hi -#endif - -#if LJ_ARCH_BITS == 32 -#define LJ_32 1 -#define LJ_64 0 -#else -#define LJ_32 0 -#define LJ_64 1 -#endif - -#ifndef LJ_TARGET_UNALIGNED -#define LJ_TARGET_UNALIGNED 0 -#endif - -/* Various workarounds for embedded operating systems. */ -#if (defined(__ANDROID__) && !defined(LJ_TARGET_X86ORX64)) || defined(__symbian__) || LJ_TARGET_XBOX360 -#define LUAJIT_NO_LOG2 -#endif -#if defined(__symbian__) -#define LUAJIT_NO_EXP2 -#endif -#if LJ_TARGET_CONSOLE || (LJ_TARGET_IOS && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0) -#define LJ_NO_SYSTEM 1 -#endif - -#if !defined(LUAJIT_NO_UNWIND) && __GNU_COMPACT_EH__ -/* NYI: no support for compact unwind specification, yet. */ -#define LUAJIT_NO_UNWIND 1 -#endif - -#if defined(LUAJIT_NO_UNWIND) || defined(__symbian__) || LJ_TARGET_IOS || LJ_TARGET_PS3 || LJ_TARGET_PS4 -#define LJ_NO_UNWIND 1 -#endif - -/* Compatibility with Lua 5.1 vs. 5.2. */ -#ifdef LUAJIT_ENABLE_LUA52COMPAT -#define LJ_52 1 -#else -#define LJ_52 0 -#endif - -#endif diff --git a/subprojects/luajit/src/lj_asm.c b/subprojects/luajit/src/lj_asm.c deleted file mode 100644 index 02714d4ef..000000000 --- a/subprojects/luajit/src/lj_asm.c +++ /dev/null @@ -1,1920 +0,0 @@ -/* -** IR assembler (SSA IR -> machine code). -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_asm_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_gc.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_frame.h" -#if LJ_HASFFI -#include "lj_ctype.h" -#endif -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_ircall.h" -#include "lj_iropt.h" -#include "lj_mcode.h" -#include "lj_iropt.h" -#include "lj_trace.h" -#include "lj_snap.h" -#include "lj_asm.h" -#include "lj_dispatch.h" -#include "lj_vm.h" -#include "lj_target.h" - -#ifdef LUA_USE_ASSERT -#include -#endif - -/* -- Assembler state and common macros ----------------------------------- */ - -/* Assembler state. */ -typedef struct ASMState { - RegCost cost[RID_MAX]; /* Reference and blended allocation cost for regs. */ - - MCode *mcp; /* Current MCode pointer (grows down). */ - MCode *mclim; /* Lower limit for MCode memory + red zone. */ -#ifdef LUA_USE_ASSERT - MCode *mcp_prev; /* Red zone overflow check. */ -#endif - - IRIns *ir; /* Copy of pointer to IR instructions/constants. */ - jit_State *J; /* JIT compiler state. */ - -#if LJ_TARGET_X86ORX64 - x86ModRM mrm; /* Fused x86 address operand. */ -#endif - - RegSet freeset; /* Set of free registers. */ - RegSet modset; /* Set of registers modified inside the loop. */ - RegSet weakset; /* Set of weakly referenced registers. */ - RegSet phiset; /* Set of PHI registers. */ - - uint32_t flags; /* Copy of JIT compiler flags. */ - int loopinv; /* Loop branch inversion (0:no, 1:yes, 2:yes+CC_P). */ - - int32_t evenspill; /* Next even spill slot. */ - int32_t oddspill; /* Next odd spill slot (or 0). */ - - IRRef curins; /* Reference of current instruction. */ - IRRef stopins; /* Stop assembly before hitting this instruction. */ - IRRef orignins; /* Original T->nins. */ - - IRRef snapref; /* Current snapshot is active after this reference. */ - IRRef snaprename; /* Rename highwater mark for snapshot check. */ - SnapNo snapno; /* Current snapshot number. */ - SnapNo loopsnapno; /* Loop snapshot number. */ - - IRRef fuseref; /* Fusion limit (loopref, 0 or FUSE_DISABLED). */ - IRRef sectref; /* Section base reference (loopref or 0). */ - IRRef loopref; /* Reference of LOOP instruction (or 0). */ - - BCReg topslot; /* Number of slots for stack check (unless 0). */ - int32_t gcsteps; /* Accumulated number of GC steps (per section). */ - - GCtrace *T; /* Trace to assemble. */ - GCtrace *parent; /* Parent trace (or NULL). */ - - MCode *mcbot; /* Bottom of reserved MCode. */ - MCode *mctop; /* Top of generated MCode. */ - MCode *mcloop; /* Pointer to loop MCode (or NULL). */ - MCode *invmcp; /* Points to invertible loop branch (or NULL). */ - MCode *flagmcp; /* Pending opportunity to merge flag setting ins. */ - MCode *realign; /* Realign loop if not NULL. */ - -#ifdef RID_NUM_KREF - int32_t krefk[RID_NUM_KREF]; -#endif - IRRef1 phireg[RID_MAX]; /* PHI register references. */ - uint16_t parentmap[LJ_MAX_JSLOTS]; /* Parent instruction to RegSP map. */ -} ASMState; - -#define IR(ref) (&as->ir[(ref)]) - -#define ASMREF_TMP1 REF_TRUE /* Temp. register. */ -#define ASMREF_TMP2 REF_FALSE /* Temp. register. */ -#define ASMREF_L REF_NIL /* Stores register for L. */ - -/* Check for variant to invariant references. */ -#define iscrossref(as, ref) ((ref) < as->sectref) - -/* Inhibit memory op fusion from variant to invariant references. */ -#define FUSE_DISABLED (~(IRRef)0) -#define mayfuse(as, ref) ((ref) > as->fuseref) -#define neverfuse(as) (as->fuseref == FUSE_DISABLED) -#define canfuse(as, ir) (!neverfuse(as) && !irt_isphi((ir)->t)) -#define opisfusableload(o) \ - ((o) == IR_ALOAD || (o) == IR_HLOAD || (o) == IR_ULOAD || \ - (o) == IR_FLOAD || (o) == IR_XLOAD || (o) == IR_SLOAD || (o) == IR_VLOAD) - -/* Sparse limit checks using a red zone before the actual limit. */ -#define MCLIM_REDZONE 64 - -static LJ_NORET LJ_NOINLINE void asm_mclimit(ASMState *as) -{ - lj_mcode_limiterr(as->J, (size_t)(as->mctop - as->mcp + 4*MCLIM_REDZONE)); -} - -static LJ_AINLINE void checkmclim(ASMState *as) -{ -#ifdef LUA_USE_ASSERT - if (as->mcp + MCLIM_REDZONE < as->mcp_prev) { - IRIns *ir = IR(as->curins+1); - fprintf(stderr, "RED ZONE OVERFLOW: %p IR %04d %02d %04d %04d\n", as->mcp, - as->curins+1-REF_BIAS, ir->o, ir->op1-REF_BIAS, ir->op2-REF_BIAS); - lua_assert(0); - } -#endif - if (LJ_UNLIKELY(as->mcp < as->mclim)) asm_mclimit(as); -#ifdef LUA_USE_ASSERT - as->mcp_prev = as->mcp; -#endif -} - -#ifdef RID_NUM_KREF -#define ra_iskref(ref) ((ref) < RID_NUM_KREF) -#define ra_krefreg(ref) ((Reg)(RID_MIN_KREF + (Reg)(ref))) -#define ra_krefk(as, ref) (as->krefk[(ref)]) - -static LJ_AINLINE void ra_setkref(ASMState *as, Reg r, int32_t k) -{ - IRRef ref = (IRRef)(r - RID_MIN_KREF); - as->krefk[ref] = k; - as->cost[r] = REGCOST(ref, ref); -} - -#else -#define ra_iskref(ref) 0 -#define ra_krefreg(ref) RID_MIN_GPR -#define ra_krefk(as, ref) 0 -#endif - -/* Arch-specific field offsets. */ -static const uint8_t field_ofs[IRFL__MAX+1] = { -#define FLOFS(name, ofs) (uint8_t)(ofs), -IRFLDEF(FLOFS) -#undef FLOFS - 0 -}; - -/* -- Target-specific instruction emitter --------------------------------- */ - -#if LJ_TARGET_X86ORX64 -#include "lj_emit_x86.h" -#elif LJ_TARGET_ARM -#include "lj_emit_arm.h" -#elif LJ_TARGET_PPC -#include "lj_emit_ppc.h" -#elif LJ_TARGET_MIPS -#include "lj_emit_mips.h" -#else -#error "Missing instruction emitter for target CPU" -#endif - -/* -- Register allocator debugging ---------------------------------------- */ - -/* #define LUAJIT_DEBUG_RA */ - -#ifdef LUAJIT_DEBUG_RA - -#include -#include - -#define RIDNAME(name) #name, -static const char *const ra_regname[] = { - GPRDEF(RIDNAME) - FPRDEF(RIDNAME) - VRIDDEF(RIDNAME) - NULL -}; -#undef RIDNAME - -static char ra_dbg_buf[65536]; -static char *ra_dbg_p; -static char *ra_dbg_merge; -static MCode *ra_dbg_mcp; - -static void ra_dstart(void) -{ - ra_dbg_p = ra_dbg_buf; - ra_dbg_merge = NULL; - ra_dbg_mcp = NULL; -} - -static void ra_dflush(void) -{ - fwrite(ra_dbg_buf, 1, (size_t)(ra_dbg_p-ra_dbg_buf), stdout); - ra_dstart(); -} - -static void ra_dprintf(ASMState *as, const char *fmt, ...) -{ - char *p; - va_list argp; - va_start(argp, fmt); - p = ra_dbg_mcp == as->mcp ? ra_dbg_merge : ra_dbg_p; - ra_dbg_mcp = NULL; - p += sprintf(p, "%08x \e[36m%04d ", (uintptr_t)as->mcp, as->curins-REF_BIAS); - for (;;) { - const char *e = strchr(fmt, '$'); - if (e == NULL) break; - memcpy(p, fmt, (size_t)(e-fmt)); - p += e-fmt; - if (e[1] == 'r') { - Reg r = va_arg(argp, Reg) & RID_MASK; - if (r <= RID_MAX) { - const char *q; - for (q = ra_regname[r]; *q; q++) - *p++ = *q >= 'A' && *q <= 'Z' ? *q + 0x20 : *q; - } else { - *p++ = '?'; - lua_assert(0); - } - } else if (e[1] == 'f' || e[1] == 'i') { - IRRef ref; - if (e[1] == 'f') - ref = va_arg(argp, IRRef); - else - ref = va_arg(argp, IRIns *) - as->ir; - if (ref >= REF_BIAS) - p += sprintf(p, "%04d", ref - REF_BIAS); - else - p += sprintf(p, "K%03d", REF_BIAS - ref); - } else if (e[1] == 's') { - uint32_t slot = va_arg(argp, uint32_t); - p += sprintf(p, "[sp+0x%x]", sps_scale(slot)); - } else if (e[1] == 'x') { - p += sprintf(p, "%08x", va_arg(argp, int32_t)); - } else { - lua_assert(0); - } - fmt = e+2; - } - va_end(argp); - while (*fmt) - *p++ = *fmt++; - *p++ = '\e'; *p++ = '['; *p++ = 'm'; *p++ = '\n'; - if (p > ra_dbg_buf+sizeof(ra_dbg_buf)-256) { - fwrite(ra_dbg_buf, 1, (size_t)(p-ra_dbg_buf), stdout); - p = ra_dbg_buf; - } - ra_dbg_p = p; -} - -#define RA_DBG_START() ra_dstart() -#define RA_DBG_FLUSH() ra_dflush() -#define RA_DBG_REF() \ - do { char *_p = ra_dbg_p; ra_dprintf(as, ""); \ - ra_dbg_merge = _p; ra_dbg_mcp = as->mcp; } while (0) -#define RA_DBGX(x) ra_dprintf x - -#else -#define RA_DBG_START() ((void)0) -#define RA_DBG_FLUSH() ((void)0) -#define RA_DBG_REF() ((void)0) -#define RA_DBGX(x) ((void)0) -#endif - -/* -- Register allocator -------------------------------------------------- */ - -#define ra_free(as, r) rset_set(as->freeset, (r)) -#define ra_modified(as, r) rset_set(as->modset, (r)) -#define ra_weak(as, r) rset_set(as->weakset, (r)) -#define ra_noweak(as, r) rset_clear(as->weakset, (r)) - -#define ra_used(ir) (ra_hasreg((ir)->r) || ra_hasspill((ir)->s)) - -/* Setup register allocator. */ -static void ra_setup(ASMState *as) -{ - Reg r; - /* Initially all regs (except the stack pointer) are free for use. */ - as->freeset = RSET_INIT; - as->modset = RSET_EMPTY; - as->weakset = RSET_EMPTY; - as->phiset = RSET_EMPTY; - memset(as->phireg, 0, sizeof(as->phireg)); - for (r = RID_MIN_GPR; r < RID_MAX; r++) - as->cost[r] = REGCOST(~0u, 0u); -} - -/* Rematerialize constants. */ -static Reg ra_rematk(ASMState *as, IRRef ref) -{ - IRIns *ir; - Reg r; - if (ra_iskref(ref)) { - r = ra_krefreg(ref); - lua_assert(!rset_test(as->freeset, r)); - ra_free(as, r); - ra_modified(as, r); - emit_loadi(as, r, ra_krefk(as, ref)); - return r; - } - ir = IR(ref); - r = ir->r; - lua_assert(ra_hasreg(r) && !ra_hasspill(ir->s)); - ra_free(as, r); - ra_modified(as, r); - ir->r = RID_INIT; /* Do not keep any hint. */ - RA_DBGX((as, "remat $i $r", ir, r)); -#if !LJ_SOFTFP - if (ir->o == IR_KNUM) { - emit_loadn(as, r, ir_knum(ir)); - } else -#endif - if (emit_canremat(REF_BASE) && ir->o == IR_BASE) { - ra_sethint(ir->r, RID_BASE); /* Restore BASE register hint. */ - emit_getgl(as, r, jit_base); - } else if (emit_canremat(ASMREF_L) && ir->o == IR_KPRI) { - lua_assert(irt_isnil(ir->t)); /* REF_NIL stores ASMREF_L register. */ - emit_getgl(as, r, jit_L); -#if LJ_64 - } else if (ir->o == IR_KINT64) { - emit_loadu64(as, r, ir_kint64(ir)->u64); -#endif - } else { - lua_assert(ir->o == IR_KINT || ir->o == IR_KGC || - ir->o == IR_KPTR || ir->o == IR_KKPTR || ir->o == IR_KNULL); - emit_loadi(as, r, ir->i); - } - return r; -} - -/* Force a spill. Allocate a new spill slot if needed. */ -static int32_t ra_spill(ASMState *as, IRIns *ir) -{ - int32_t slot = ir->s; - lua_assert(ir >= as->ir + REF_TRUE); - if (!ra_hasspill(slot)) { - if (irt_is64(ir->t)) { - slot = as->evenspill; - as->evenspill += 2; - } else if (as->oddspill) { - slot = as->oddspill; - as->oddspill = 0; - } else { - slot = as->evenspill; - as->oddspill = slot+1; - as->evenspill += 2; - } - if (as->evenspill > 256) - lj_trace_err(as->J, LJ_TRERR_SPILLOV); - ir->s = (uint8_t)slot; - } - return sps_scale(slot); -} - -/* Release the temporarily allocated register in ASMREF_TMP1/ASMREF_TMP2. */ -static Reg ra_releasetmp(ASMState *as, IRRef ref) -{ - IRIns *ir = IR(ref); - Reg r = ir->r; - lua_assert(ra_hasreg(r) && !ra_hasspill(ir->s)); - ra_free(as, r); - ra_modified(as, r); - ir->r = RID_INIT; - return r; -} - -/* Restore a register (marked as free). Rematerialize or force a spill. */ -static Reg ra_restore(ASMState *as, IRRef ref) -{ - if (emit_canremat(ref)) { - return ra_rematk(as, ref); - } else { - IRIns *ir = IR(ref); - int32_t ofs = ra_spill(as, ir); /* Force a spill slot. */ - Reg r = ir->r; - lua_assert(ra_hasreg(r)); - ra_sethint(ir->r, r); /* Keep hint. */ - ra_free(as, r); - if (!rset_test(as->weakset, r)) { /* Only restore non-weak references. */ - ra_modified(as, r); - RA_DBGX((as, "restore $i $r", ir, r)); - emit_spload(as, ir, r, ofs); - } - return r; - } -} - -/* Save a register to a spill slot. */ -static void ra_save(ASMState *as, IRIns *ir, Reg r) -{ - RA_DBGX((as, "save $i $r", ir, r)); - emit_spstore(as, ir, r, sps_scale(ir->s)); -} - -#define MINCOST(name) \ - if (rset_test(RSET_ALL, RID_##name) && \ - LJ_LIKELY(allow&RID2RSET(RID_##name)) && as->cost[RID_##name] < cost) \ - cost = as->cost[RID_##name]; - -/* Evict the register with the lowest cost, forcing a restore. */ -static Reg ra_evict(ASMState *as, RegSet allow) -{ - IRRef ref; - RegCost cost = ~(RegCost)0; - lua_assert(allow != RSET_EMPTY); - if (RID_NUM_FPR == 0 || allow < RID2RSET(RID_MAX_GPR)) { - GPRDEF(MINCOST) - } else { - FPRDEF(MINCOST) - } - ref = regcost_ref(cost); - lua_assert(ra_iskref(ref) || (ref >= as->T->nk && ref < as->T->nins)); - /* Preferably pick any weak ref instead of a non-weak, non-const ref. */ - if (!irref_isk(ref) && (as->weakset & allow)) { - IRIns *ir = IR(ref); - if (!rset_test(as->weakset, ir->r)) - ref = regcost_ref(as->cost[rset_pickbot((as->weakset & allow))]); - } - return ra_restore(as, ref); -} - -/* Pick any register (marked as free). Evict on-demand. */ -static Reg ra_pick(ASMState *as, RegSet allow) -{ - RegSet pick = as->freeset & allow; - if (!pick) - return ra_evict(as, allow); - else - return rset_picktop(pick); -} - -/* Get a scratch register (marked as free). */ -static Reg ra_scratch(ASMState *as, RegSet allow) -{ - Reg r = ra_pick(as, allow); - ra_modified(as, r); - RA_DBGX((as, "scratch $r", r)); - return r; -} - -/* Evict all registers from a set (if not free). */ -static void ra_evictset(ASMState *as, RegSet drop) -{ - RegSet work; - as->modset |= drop; -#if !LJ_SOFTFP - work = (drop & ~as->freeset) & RSET_FPR; - while (work) { - Reg r = rset_pickbot(work); - ra_restore(as, regcost_ref(as->cost[r])); - rset_clear(work, r); - checkmclim(as); - } -#endif - work = (drop & ~as->freeset); - while (work) { - Reg r = rset_pickbot(work); - ra_restore(as, regcost_ref(as->cost[r])); - rset_clear(work, r); - checkmclim(as); - } -} - -/* Evict (rematerialize) all registers allocated to constants. */ -static void ra_evictk(ASMState *as) -{ - RegSet work; -#if !LJ_SOFTFP - work = ~as->freeset & RSET_FPR; - while (work) { - Reg r = rset_pickbot(work); - IRRef ref = regcost_ref(as->cost[r]); - if (emit_canremat(ref) && irref_isk(ref)) { - ra_rematk(as, ref); - checkmclim(as); - } - rset_clear(work, r); - } -#endif - work = ~as->freeset & RSET_GPR; - while (work) { - Reg r = rset_pickbot(work); - IRRef ref = regcost_ref(as->cost[r]); - if (emit_canremat(ref) && irref_isk(ref)) { - ra_rematk(as, ref); - checkmclim(as); - } - rset_clear(work, r); - } -} - -#ifdef RID_NUM_KREF -/* Allocate a register for a constant. */ -static Reg ra_allock(ASMState *as, int32_t k, RegSet allow) -{ - /* First try to find a register which already holds the same constant. */ - RegSet pick, work = ~as->freeset & RSET_GPR; - Reg r; - while (work) { - IRRef ref; - r = rset_pickbot(work); - ref = regcost_ref(as->cost[r]); - if (ref < ASMREF_L && - k == (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i)) - return r; - rset_clear(work, r); - } - pick = as->freeset & allow; - if (pick) { - /* Constants should preferably get unmodified registers. */ - if ((pick & ~as->modset)) - pick &= ~as->modset; - r = rset_pickbot(pick); /* Reduce conflicts with inverse allocation. */ - } else { - r = ra_evict(as, allow); - } - RA_DBGX((as, "allock $x $r", k, r)); - ra_setkref(as, r, k); - rset_clear(as->freeset, r); - ra_noweak(as, r); - return r; -} - -/* Allocate a specific register for a constant. */ -static void ra_allockreg(ASMState *as, int32_t k, Reg r) -{ - Reg kr = ra_allock(as, k, RID2RSET(r)); - if (kr != r) { - IRIns irdummy; - irdummy.t.irt = IRT_INT; - ra_scratch(as, RID2RSET(r)); - emit_movrr(as, &irdummy, r, kr); - } -} -#else -#define ra_allockreg(as, k, r) emit_loadi(as, (r), (k)) -#endif - -/* Allocate a register for ref from the allowed set of registers. -** Note: this function assumes the ref does NOT have a register yet! -** Picks an optimal register, sets the cost and marks the register as non-free. -*/ -static Reg ra_allocref(ASMState *as, IRRef ref, RegSet allow) -{ - IRIns *ir = IR(ref); - RegSet pick = as->freeset & allow; - Reg r; - lua_assert(ra_noreg(ir->r)); - if (pick) { - /* First check register hint from propagation or PHI. */ - if (ra_hashint(ir->r)) { - r = ra_gethint(ir->r); - if (rset_test(pick, r)) /* Use hint register if possible. */ - goto found; - /* Rematerialization is cheaper than missing a hint. */ - if (rset_test(allow, r) && emit_canremat(regcost_ref(as->cost[r]))) { - ra_rematk(as, regcost_ref(as->cost[r])); - goto found; - } - RA_DBGX((as, "hintmiss $f $r", ref, r)); - } - /* Invariants should preferably get unmodified registers. */ - if (ref < as->loopref && !irt_isphi(ir->t)) { - if ((pick & ~as->modset)) - pick &= ~as->modset; - r = rset_pickbot(pick); /* Reduce conflicts with inverse allocation. */ - } else { - /* We've got plenty of regs, so get callee-save regs if possible. */ - if (RID_NUM_GPR > 8 && (pick & ~RSET_SCRATCH)) - pick &= ~RSET_SCRATCH; - r = rset_picktop(pick); - } - } else { - r = ra_evict(as, allow); - } -found: - RA_DBGX((as, "alloc $f $r", ref, r)); - ir->r = (uint8_t)r; - rset_clear(as->freeset, r); - ra_noweak(as, r); - as->cost[r] = REGCOST_REF_T(ref, irt_t(ir->t)); - return r; -} - -/* Allocate a register on-demand. */ -static Reg ra_alloc1(ASMState *as, IRRef ref, RegSet allow) -{ - Reg r = IR(ref)->r; - /* Note: allow is ignored if the register is already allocated. */ - if (ra_noreg(r)) r = ra_allocref(as, ref, allow); - ra_noweak(as, r); - return r; -} - -/* Rename register allocation and emit move. */ -static void ra_rename(ASMState *as, Reg down, Reg up) -{ - IRRef ren, ref = regcost_ref(as->cost[up] = as->cost[down]); - IRIns *ir = IR(ref); - ir->r = (uint8_t)up; - as->cost[down] = 0; - lua_assert((down < RID_MAX_GPR) == (up < RID_MAX_GPR)); - lua_assert(!rset_test(as->freeset, down) && rset_test(as->freeset, up)); - ra_free(as, down); /* 'down' is free ... */ - ra_modified(as, down); - rset_clear(as->freeset, up); /* ... and 'up' is now allocated. */ - ra_noweak(as, up); - RA_DBGX((as, "rename $f $r $r", regcost_ref(as->cost[up]), down, up)); - emit_movrr(as, ir, down, up); /* Backwards codegen needs inverse move. */ - if (!ra_hasspill(IR(ref)->s)) { /* Add the rename to the IR. */ - lj_ir_set(as->J, IRT(IR_RENAME, IRT_NIL), ref, as->snapno); - ren = tref_ref(lj_ir_emit(as->J)); - as->ir = as->T->ir; /* The IR may have been reallocated. */ - IR(ren)->r = (uint8_t)down; - IR(ren)->s = SPS_NONE; - } -} - -/* Pick a destination register (marked as free). -** Caveat: allow is ignored if there's already a destination register. -** Use ra_destreg() to get a specific register. -*/ -static Reg ra_dest(ASMState *as, IRIns *ir, RegSet allow) -{ - Reg dest = ir->r; - if (ra_hasreg(dest)) { - ra_free(as, dest); - ra_modified(as, dest); - } else { - if (ra_hashint(dest) && rset_test((as->freeset&allow), ra_gethint(dest))) { - dest = ra_gethint(dest); - ra_modified(as, dest); - RA_DBGX((as, "dest $r", dest)); - } else { - dest = ra_scratch(as, allow); - } - ir->r = dest; - } - if (LJ_UNLIKELY(ra_hasspill(ir->s))) ra_save(as, ir, dest); - return dest; -} - -/* Force a specific destination register (marked as free). */ -static void ra_destreg(ASMState *as, IRIns *ir, Reg r) -{ - Reg dest = ra_dest(as, ir, RID2RSET(r)); - if (dest != r) { - lua_assert(rset_test(as->freeset, r)); - ra_modified(as, r); - emit_movrr(as, ir, dest, r); - } -} - -#if LJ_TARGET_X86ORX64 -/* Propagate dest register to left reference. Emit moves as needed. -** This is a required fixup step for all 2-operand machine instructions. -*/ -static void ra_left(ASMState *as, Reg dest, IRRef lref) -{ - IRIns *ir = IR(lref); - Reg left = ir->r; - if (ra_noreg(left)) { - if (irref_isk(lref)) { - if (ir->o == IR_KNUM) { - cTValue *tv = ir_knum(ir); - /* FP remat needs a load except for +0. Still better than eviction. */ - if (tvispzero(tv) || !(as->freeset & RSET_FPR)) { - emit_loadn(as, dest, tv); - return; - } -#if LJ_64 - } else if (ir->o == IR_KINT64) { - emit_loadu64(as, dest, ir_kint64(ir)->u64); - return; -#endif - } else { - lua_assert(ir->o == IR_KINT || ir->o == IR_KGC || - ir->o == IR_KPTR || ir->o == IR_KKPTR || ir->o == IR_KNULL); - emit_loadi(as, dest, ir->i); - return; - } - } - if (!ra_hashint(left) && !iscrossref(as, lref)) - ra_sethint(ir->r, dest); /* Propagate register hint. */ - left = ra_allocref(as, lref, dest < RID_MAX_GPR ? RSET_GPR : RSET_FPR); - } - ra_noweak(as, left); - /* Move needed for true 3-operand instruction: y=a+b ==> y=a; y+=b. */ - if (dest != left) { - /* Use register renaming if dest is the PHI reg. */ - if (irt_isphi(ir->t) && as->phireg[dest] == lref) { - ra_modified(as, left); - ra_rename(as, left, dest); - } else { - emit_movrr(as, ir, dest, left); - } - } -} -#else -/* Similar to ra_left, except we override any hints. */ -static void ra_leftov(ASMState *as, Reg dest, IRRef lref) -{ - IRIns *ir = IR(lref); - Reg left = ir->r; - if (ra_noreg(left)) { - ra_sethint(ir->r, dest); /* Propagate register hint. */ - left = ra_allocref(as, lref, - (LJ_SOFTFP || dest < RID_MAX_GPR) ? RSET_GPR : RSET_FPR); - } - ra_noweak(as, left); - if (dest != left) { - /* Use register renaming if dest is the PHI reg. */ - if (irt_isphi(ir->t) && as->phireg[dest] == lref) { - ra_modified(as, left); - ra_rename(as, left, dest); - } else { - emit_movrr(as, ir, dest, left); - } - } -} -#endif - -#if !LJ_64 -/* Force a RID_RETLO/RID_RETHI destination register pair (marked as free). */ -static void ra_destpair(ASMState *as, IRIns *ir) -{ - Reg destlo = ir->r, desthi = (ir+1)->r; - /* First spill unrelated refs blocking the destination registers. */ - if (!rset_test(as->freeset, RID_RETLO) && - destlo != RID_RETLO && desthi != RID_RETLO) - ra_restore(as, regcost_ref(as->cost[RID_RETLO])); - if (!rset_test(as->freeset, RID_RETHI) && - destlo != RID_RETHI && desthi != RID_RETHI) - ra_restore(as, regcost_ref(as->cost[RID_RETHI])); - /* Next free the destination registers (if any). */ - if (ra_hasreg(destlo)) { - ra_free(as, destlo); - ra_modified(as, destlo); - } else { - destlo = RID_RETLO; - } - if (ra_hasreg(desthi)) { - ra_free(as, desthi); - ra_modified(as, desthi); - } else { - desthi = RID_RETHI; - } - /* Check for conflicts and shuffle the registers as needed. */ - if (destlo == RID_RETHI) { - if (desthi == RID_RETLO) { -#if LJ_TARGET_X86 - *--as->mcp = XI_XCHGa + RID_RETHI; -#else - emit_movrr(as, ir, RID_RETHI, RID_TMP); - emit_movrr(as, ir, RID_RETLO, RID_RETHI); - emit_movrr(as, ir, RID_TMP, RID_RETLO); -#endif - } else { - emit_movrr(as, ir, RID_RETHI, RID_RETLO); - if (desthi != RID_RETHI) emit_movrr(as, ir, desthi, RID_RETHI); - } - } else if (desthi == RID_RETLO) { - emit_movrr(as, ir, RID_RETLO, RID_RETHI); - if (destlo != RID_RETLO) emit_movrr(as, ir, destlo, RID_RETLO); - } else { - if (desthi != RID_RETHI) emit_movrr(as, ir, desthi, RID_RETHI); - if (destlo != RID_RETLO) emit_movrr(as, ir, destlo, RID_RETLO); - } - /* Restore spill slots (if any). */ - if (ra_hasspill((ir+1)->s)) ra_save(as, ir+1, RID_RETHI); - if (ra_hasspill(ir->s)) ra_save(as, ir, RID_RETLO); -} -#endif - -/* -- Snapshot handling --------- ----------------------------------------- */ - -/* Can we rematerialize a KNUM instead of forcing a spill? */ -static int asm_snap_canremat(ASMState *as) -{ - Reg r; - for (r = RID_MIN_FPR; r < RID_MAX_FPR; r++) - if (irref_isk(regcost_ref(as->cost[r]))) - return 1; - return 0; -} - -/* Check whether a sunk store corresponds to an allocation. */ -static int asm_sunk_store(ASMState *as, IRIns *ira, IRIns *irs) -{ - if (irs->s == 255) { - if (irs->o == IR_ASTORE || irs->o == IR_HSTORE || - irs->o == IR_FSTORE || irs->o == IR_XSTORE) { - IRIns *irk = IR(irs->op1); - if (irk->o == IR_AREF || irk->o == IR_HREFK) - irk = IR(irk->op1); - return (IR(irk->op1) == ira); - } - return 0; - } else { - return (ira + irs->s == irs); /* Quick check. */ - } -} - -/* Allocate register or spill slot for a ref that escapes to a snapshot. */ -static void asm_snap_alloc1(ASMState *as, IRRef ref) -{ - IRIns *ir = IR(ref); - if (!irref_isk(ref) && (!(ra_used(ir) || ir->r == RID_SUNK))) { - if (ir->r == RID_SINK) { - ir->r = RID_SUNK; -#if LJ_HASFFI - if (ir->o == IR_CNEWI) { /* Allocate CNEWI value. */ - asm_snap_alloc1(as, ir->op2); - if (LJ_32 && (ir+1)->o == IR_HIOP) - asm_snap_alloc1(as, (ir+1)->op2); - } else -#endif - { /* Allocate stored values for TNEW, TDUP and CNEW. */ - IRIns *irs; - lua_assert(ir->o == IR_TNEW || ir->o == IR_TDUP || ir->o == IR_CNEW); - for (irs = IR(as->snapref-1); irs > ir; irs--) - if (irs->r == RID_SINK && asm_sunk_store(as, ir, irs)) { - lua_assert(irs->o == IR_ASTORE || irs->o == IR_HSTORE || - irs->o == IR_FSTORE || irs->o == IR_XSTORE); - asm_snap_alloc1(as, irs->op2); - if (LJ_32 && (irs+1)->o == IR_HIOP) - asm_snap_alloc1(as, (irs+1)->op2); - } - } - } else { - RegSet allow; - if (ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT) { - IRIns *irc; - for (irc = IR(as->curins); irc > ir; irc--) - if ((irc->op1 == ref || irc->op2 == ref) && - !(irc->r == RID_SINK || irc->r == RID_SUNK)) - goto nosink; /* Don't sink conversion if result is used. */ - asm_snap_alloc1(as, ir->op1); - return; - } - nosink: - allow = (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR; - if ((as->freeset & allow) || - (allow == RSET_FPR && asm_snap_canremat(as))) { - /* Get a weak register if we have a free one or can rematerialize. */ - Reg r = ra_allocref(as, ref, allow); /* Allocate a register. */ - if (!irt_isphi(ir->t)) - ra_weak(as, r); /* But mark it as weakly referenced. */ - checkmclim(as); - RA_DBGX((as, "snapreg $f $r", ref, ir->r)); - } else { - ra_spill(as, ir); /* Otherwise force a spill slot. */ - RA_DBGX((as, "snapspill $f $s", ref, ir->s)); - } - } - } -} - -/* Allocate refs escaping to a snapshot. */ -static void asm_snap_alloc(ASMState *as) -{ - SnapShot *snap = &as->T->snap[as->snapno]; - SnapEntry *map = &as->T->snapmap[snap->mapofs]; - MSize n, nent = snap->nent; - for (n = 0; n < nent; n++) { - SnapEntry sn = map[n]; - IRRef ref = snap_ref(sn); - if (!irref_isk(ref)) { - asm_snap_alloc1(as, ref); - if (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM)) { - lua_assert(irt_type(IR(ref+1)->t) == IRT_SOFTFP); - asm_snap_alloc1(as, ref+1); - } - } - } -} - -/* All guards for a snapshot use the same exitno. This is currently the -** same as the snapshot number. Since the exact origin of the exit cannot -** be determined, all guards for the same snapshot must exit with the same -** RegSP mapping. -** A renamed ref which has been used in a prior guard for the same snapshot -** would cause an inconsistency. The easy way out is to force a spill slot. -*/ -static int asm_snap_checkrename(ASMState *as, IRRef ren) -{ - SnapShot *snap = &as->T->snap[as->snapno]; - SnapEntry *map = &as->T->snapmap[snap->mapofs]; - MSize n, nent = snap->nent; - for (n = 0; n < nent; n++) { - SnapEntry sn = map[n]; - IRRef ref = snap_ref(sn); - if (ref == ren || (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM) && ++ref == ren)) { - IRIns *ir = IR(ref); - ra_spill(as, ir); /* Register renamed, so force a spill slot. */ - RA_DBGX((as, "snaprensp $f $s", ref, ir->s)); - return 1; /* Found. */ - } - } - return 0; /* Not found. */ -} - -/* Prepare snapshot for next guard instruction. */ -static void asm_snap_prep(ASMState *as) -{ - if (as->curins < as->snapref) { - do { - if (as->snapno == 0) return; /* Called by sunk stores before snap #0. */ - as->snapno--; - as->snapref = as->T->snap[as->snapno].ref; - } while (as->curins < as->snapref); - asm_snap_alloc(as); - as->snaprename = as->T->nins; - } else { - /* Process any renames above the highwater mark. */ - for (; as->snaprename < as->T->nins; as->snaprename++) { - IRIns *ir = IR(as->snaprename); - if (asm_snap_checkrename(as, ir->op1)) - ir->op2 = REF_BIAS-1; /* Kill rename. */ - } - } -} - -/* -- Miscellaneous helpers ----------------------------------------------- */ - -/* Collect arguments from CALL* and CARG instructions. */ -static void asm_collectargs(ASMState *as, IRIns *ir, - const CCallInfo *ci, IRRef *args) -{ - uint32_t n = CCI_NARGS(ci); - lua_assert(n <= CCI_NARGS_MAX*2); /* Account for split args. */ - if ((ci->flags & CCI_L)) { *args++ = ASMREF_L; n--; } - while (n-- > 1) { - ir = IR(ir->op1); - lua_assert(ir->o == IR_CARG); - args[n] = ir->op2 == REF_NIL ? 0 : ir->op2; - } - args[0] = ir->op1 == REF_NIL ? 0 : ir->op1; - lua_assert(IR(ir->op1)->o != IR_CARG); -} - -/* Reconstruct CCallInfo flags for CALLX*. */ -static uint32_t asm_callx_flags(ASMState *as, IRIns *ir) -{ - uint32_t nargs = 0; - if (ir->op1 != REF_NIL) { /* Count number of arguments first. */ - IRIns *ira = IR(ir->op1); - nargs++; - while (ira->o == IR_CARG) { nargs++; ira = IR(ira->op1); } - } -#if LJ_HASFFI - if (IR(ir->op2)->o == IR_CARG) { /* Copy calling convention info. */ - CTypeID id = (CTypeID)IR(IR(ir->op2)->op2)->i; - CType *ct = ctype_get(ctype_ctsG(J2G(as->J)), id); - nargs |= ((ct->info & CTF_VARARG) ? CCI_VARARG : 0); -#if LJ_TARGET_X86 - nargs |= (ctype_cconv(ct->info) << CCI_CC_SHIFT); -#endif - } -#endif - return (nargs | (ir->t.irt << CCI_OTSHIFT)); -} - -/* Calculate stack adjustment. */ -static int32_t asm_stack_adjust(ASMState *as) -{ - if (as->evenspill <= SPS_FIXED) - return 0; - return sps_scale(sps_align(as->evenspill)); -} - -/* Must match with hash*() in lj_tab.c. */ -static uint32_t ir_khash(IRIns *ir) -{ - uint32_t lo, hi; - if (irt_isstr(ir->t)) { - return ir_kstr(ir)->hash; - } else if (irt_isnum(ir->t)) { - lo = ir_knum(ir)->u32.lo; - hi = ir_knum(ir)->u32.hi << 1; - } else if (irt_ispri(ir->t)) { - lua_assert(!irt_isnil(ir->t)); - return irt_type(ir->t)-IRT_FALSE; - } else { - lua_assert(irt_isgcv(ir->t)); - lo = u32ptr(ir_kgc(ir)); - hi = lo + HASH_BIAS; - } - return hashrot(lo, hi); -} - -/* -- Allocations --------------------------------------------------------- */ - -static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args); -static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci); - -static void asm_snew(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_new]; - IRRef args[3]; - args[0] = ASMREF_L; /* lua_State *L */ - args[1] = ir->op1; /* const char *str */ - args[2] = ir->op2; /* size_t len */ - as->gcsteps++; - asm_setupresult(as, ir, ci); /* GCstr * */ - asm_gencall(as, ci, args); -} - -static void asm_tnew(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_new1]; - IRRef args[2]; - args[0] = ASMREF_L; /* lua_State *L */ - args[1] = ASMREF_TMP1; /* uint32_t ahsize */ - as->gcsteps++; - asm_setupresult(as, ir, ci); /* GCtab * */ - asm_gencall(as, ci, args); - ra_allockreg(as, ir->op1 | (ir->op2 << 24), ra_releasetmp(as, ASMREF_TMP1)); -} - -static void asm_tdup(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_dup]; - IRRef args[2]; - args[0] = ASMREF_L; /* lua_State *L */ - args[1] = ir->op1; /* const GCtab *kt */ - as->gcsteps++; - asm_setupresult(as, ir, ci); /* GCtab * */ - asm_gencall(as, ci, args); -} - -static void asm_gc_check(ASMState *as); - -/* Explicit GC step. */ -static void asm_gcstep(ASMState *as, IRIns *ir) -{ - IRIns *ira; - for (ira = IR(as->stopins+1); ira < ir; ira++) - if ((ira->o == IR_TNEW || ira->o == IR_TDUP || - (LJ_HASFFI && (ira->o == IR_CNEW || ira->o == IR_CNEWI))) && - ra_used(ira)) - as->gcsteps++; - if (as->gcsteps) - asm_gc_check(as); - as->gcsteps = 0x80000000; /* Prevent implicit GC check further up. */ -} - -/* -- PHI and loop handling ----------------------------------------------- */ - -/* Break a PHI cycle by renaming to a free register (evict if needed). */ -static void asm_phi_break(ASMState *as, RegSet blocked, RegSet blockedby, - RegSet allow) -{ - RegSet candidates = blocked & allow; - if (candidates) { /* If this register file has candidates. */ - /* Note: the set for ra_pick cannot be empty, since each register file - ** has some registers never allocated to PHIs. - */ - Reg down, up = ra_pick(as, ~blocked & allow); /* Get a free register. */ - if (candidates & ~blockedby) /* Optimize shifts, else it's a cycle. */ - candidates = candidates & ~blockedby; - down = rset_picktop(candidates); /* Pick candidate PHI register. */ - ra_rename(as, down, up); /* And rename it to the free register. */ - } -} - -/* PHI register shuffling. -** -** The allocator tries hard to preserve PHI register assignments across -** the loop body. Most of the time this loop does nothing, since there -** are no register mismatches. -** -** If a register mismatch is detected and ... -** - the register is currently free: rename it. -** - the register is blocked by an invariant: restore/remat and rename it. -** - Otherwise the register is used by another PHI, so mark it as blocked. -** -** The renames are order-sensitive, so just retry the loop if a register -** is marked as blocked, but has been freed in the meantime. A cycle is -** detected if all of the blocked registers are allocated. To break the -** cycle rename one of them to a free register and retry. -** -** Note that PHI spill slots are kept in sync and don't need to be shuffled. -*/ -static void asm_phi_shuffle(ASMState *as) -{ - RegSet work; - - /* Find and resolve PHI register mismatches. */ - for (;;) { - RegSet blocked = RSET_EMPTY; - RegSet blockedby = RSET_EMPTY; - RegSet phiset = as->phiset; - while (phiset) { /* Check all left PHI operand registers. */ - Reg r = rset_pickbot(phiset); - IRIns *irl = IR(as->phireg[r]); - Reg left = irl->r; - if (r != left) { /* Mismatch? */ - if (!rset_test(as->freeset, r)) { /* PHI register blocked? */ - IRRef ref = regcost_ref(as->cost[r]); - /* Blocked by other PHI (w/reg)? */ - if (!ra_iskref(ref) && irt_ismarked(IR(ref)->t)) { - rset_set(blocked, r); - if (ra_hasreg(left)) - rset_set(blockedby, left); - left = RID_NONE; - } else { /* Otherwise grab register from invariant. */ - ra_restore(as, ref); - checkmclim(as); - } - } - if (ra_hasreg(left)) { - ra_rename(as, left, r); - checkmclim(as); - } - } - rset_clear(phiset, r); - } - if (!blocked) break; /* Finished. */ - if (!(as->freeset & blocked)) { /* Break cycles if none are free. */ - asm_phi_break(as, blocked, blockedby, RSET_GPR); - if (!LJ_SOFTFP) asm_phi_break(as, blocked, blockedby, RSET_FPR); - checkmclim(as); - } /* Else retry some more renames. */ - } - - /* Restore/remat invariants whose registers are modified inside the loop. */ -#if !LJ_SOFTFP - work = as->modset & ~(as->freeset | as->phiset) & RSET_FPR; - while (work) { - Reg r = rset_pickbot(work); - ra_restore(as, regcost_ref(as->cost[r])); - rset_clear(work, r); - checkmclim(as); - } -#endif - work = as->modset & ~(as->freeset | as->phiset); - while (work) { - Reg r = rset_pickbot(work); - ra_restore(as, regcost_ref(as->cost[r])); - rset_clear(work, r); - checkmclim(as); - } - - /* Allocate and save all unsaved PHI regs and clear marks. */ - work = as->phiset; - while (work) { - Reg r = rset_picktop(work); - IRRef lref = as->phireg[r]; - IRIns *ir = IR(lref); - if (ra_hasspill(ir->s)) { /* Left PHI gained a spill slot? */ - irt_clearmark(ir->t); /* Handled here, so clear marker now. */ - ra_alloc1(as, lref, RID2RSET(r)); - ra_save(as, ir, r); /* Save to spill slot inside the loop. */ - checkmclim(as); - } - rset_clear(work, r); - } -} - -/* Copy unsynced left/right PHI spill slots. Rarely needed. */ -static void asm_phi_copyspill(ASMState *as) -{ - int need = 0; - IRIns *ir; - for (ir = IR(as->orignins-1); ir->o == IR_PHI; ir--) - if (ra_hasspill(ir->s) && ra_hasspill(IR(ir->op1)->s)) - need |= irt_isfp(ir->t) ? 2 : 1; /* Unsynced spill slot? */ - if ((need & 1)) { /* Copy integer spill slots. */ -#if !LJ_TARGET_X86ORX64 - Reg r = RID_TMP; -#else - Reg r = RID_RET; - if ((as->freeset & RSET_GPR)) - r = rset_pickbot((as->freeset & RSET_GPR)); - else - emit_spload(as, IR(regcost_ref(as->cost[r])), r, SPOFS_TMP); -#endif - for (ir = IR(as->orignins-1); ir->o == IR_PHI; ir--) { - if (ra_hasspill(ir->s)) { - IRIns *irl = IR(ir->op1); - if (ra_hasspill(irl->s) && !irt_isfp(ir->t)) { - emit_spstore(as, irl, r, sps_scale(irl->s)); - emit_spload(as, ir, r, sps_scale(ir->s)); - checkmclim(as); - } - } - } -#if LJ_TARGET_X86ORX64 - if (!rset_test(as->freeset, r)) - emit_spstore(as, IR(regcost_ref(as->cost[r])), r, SPOFS_TMP); -#endif - } -#if !LJ_SOFTFP - if ((need & 2)) { /* Copy FP spill slots. */ -#if LJ_TARGET_X86 - Reg r = RID_XMM0; -#else - Reg r = RID_FPRET; -#endif - if ((as->freeset & RSET_FPR)) - r = rset_pickbot((as->freeset & RSET_FPR)); - if (!rset_test(as->freeset, r)) - emit_spload(as, IR(regcost_ref(as->cost[r])), r, SPOFS_TMP); - for (ir = IR(as->orignins-1); ir->o == IR_PHI; ir--) { - if (ra_hasspill(ir->s)) { - IRIns *irl = IR(ir->op1); - if (ra_hasspill(irl->s) && irt_isfp(ir->t)) { - emit_spstore(as, irl, r, sps_scale(irl->s)); - emit_spload(as, ir, r, sps_scale(ir->s)); - checkmclim(as); - } - } - } - if (!rset_test(as->freeset, r)) - emit_spstore(as, IR(regcost_ref(as->cost[r])), r, SPOFS_TMP); - } -#endif -} - -/* Emit renames for left PHIs which are only spilled outside the loop. */ -static void asm_phi_fixup(ASMState *as) -{ - RegSet work = as->phiset; - while (work) { - Reg r = rset_picktop(work); - IRRef lref = as->phireg[r]; - IRIns *ir = IR(lref); - if (irt_ismarked(ir->t)) { - irt_clearmark(ir->t); - /* Left PHI gained a spill slot before the loop? */ - if (ra_hasspill(ir->s)) { - IRRef ren; - lj_ir_set(as->J, IRT(IR_RENAME, IRT_NIL), lref, as->loopsnapno); - ren = tref_ref(lj_ir_emit(as->J)); - as->ir = as->T->ir; /* The IR may have been reallocated. */ - IR(ren)->r = (uint8_t)r; - IR(ren)->s = SPS_NONE; - } - } - rset_clear(work, r); - } -} - -/* Setup right PHI reference. */ -static void asm_phi(ASMState *as, IRIns *ir) -{ - RegSet allow = ((!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR) & - ~as->phiset; - RegSet afree = (as->freeset & allow); - IRIns *irl = IR(ir->op1); - IRIns *irr = IR(ir->op2); - if (ir->r == RID_SINK) /* Sink PHI. */ - return; - /* Spill slot shuffling is not implemented yet (but rarely needed). */ - if (ra_hasspill(irl->s) || ra_hasspill(irr->s)) - lj_trace_err(as->J, LJ_TRERR_NYIPHI); - /* Leave at least one register free for non-PHIs (and PHI cycle breaking). */ - if ((afree & (afree-1))) { /* Two or more free registers? */ - Reg r; - if (ra_noreg(irr->r)) { /* Get a register for the right PHI. */ - r = ra_allocref(as, ir->op2, allow); - } else { /* Duplicate right PHI, need a copy (rare). */ - r = ra_scratch(as, allow); - emit_movrr(as, irr, r, irr->r); - } - ir->r = (uint8_t)r; - rset_set(as->phiset, r); - as->phireg[r] = (IRRef1)ir->op1; - irt_setmark(irl->t); /* Marks left PHIs _with_ register. */ - if (ra_noreg(irl->r)) - ra_sethint(irl->r, r); /* Set register hint for left PHI. */ - } else { /* Otherwise allocate a spill slot. */ - /* This is overly restrictive, but it triggers only on synthetic code. */ - if (ra_hasreg(irl->r) || ra_hasreg(irr->r)) - lj_trace_err(as->J, LJ_TRERR_NYIPHI); - ra_spill(as, ir); - irr->s = ir->s; /* Set right PHI spill slot. Sync left slot later. */ - } -} - -static void asm_loop_fixup(ASMState *as); - -/* Middle part of a loop. */ -static void asm_loop(ASMState *as) -{ - MCode *mcspill; - /* LOOP is a guard, so the snapno is up to date. */ - as->loopsnapno = as->snapno; - if (as->gcsteps) - asm_gc_check(as); - /* LOOP marks the transition from the variant to the invariant part. */ - as->flagmcp = as->invmcp = NULL; - as->sectref = 0; - if (!neverfuse(as)) as->fuseref = 0; - asm_phi_shuffle(as); - mcspill = as->mcp; - asm_phi_copyspill(as); - asm_loop_fixup(as); - as->mcloop = as->mcp; - RA_DBGX((as, "===== LOOP =====")); - if (!as->realign) RA_DBG_FLUSH(); - if (as->mcp != mcspill) - emit_jmp(as, mcspill); -} - -/* -- Target-specific assembler ------------------------------------------- */ - -#if LJ_TARGET_X86ORX64 -#include "lj_asm_x86.h" -#elif LJ_TARGET_ARM -#include "lj_asm_arm.h" -#elif LJ_TARGET_PPC -#include "lj_asm_ppc.h" -#elif LJ_TARGET_MIPS -#include "lj_asm_mips.h" -#else -#error "Missing assembler for target CPU" -#endif - -/* -- Head of trace ------------------------------------------------------- */ - -/* Head of a root trace. */ -static void asm_head_root(ASMState *as) -{ - int32_t spadj; - asm_head_root_base(as); - emit_setvmstate(as, (int32_t)as->T->traceno); - spadj = asm_stack_adjust(as); - as->T->spadjust = (uint16_t)spadj; - emit_spsub(as, spadj); - /* Root traces assume a checked stack for the starting proto. */ - as->T->topslot = gcref(as->T->startpt)->pt.framesize; -} - -/* Head of a side trace. -** -** The current simplistic algorithm requires that all slots inherited -** from the parent are live in a register between pass 2 and pass 3. This -** avoids the complexity of stack slot shuffling. But of course this may -** overflow the register set in some cases and cause the dreaded error: -** "NYI: register coalescing too complex". A refined algorithm is needed. -*/ -static void asm_head_side(ASMState *as) -{ - IRRef1 sloadins[RID_MAX]; - RegSet allow = RSET_ALL; /* Inverse of all coalesced registers. */ - RegSet live = RSET_EMPTY; /* Live parent registers. */ - IRIns *irp = &as->parent->ir[REF_BASE]; /* Parent base. */ - int32_t spadj, spdelta; - int pass2 = 0; - int pass3 = 0; - IRRef i; - - if (as->snapno && as->topslot > as->parent->topslot) { - /* Force snap #0 alloc to prevent register overwrite in stack check. */ - as->snapno = 0; - asm_snap_alloc(as); - } - allow = asm_head_side_base(as, irp, allow); - - /* Scan all parent SLOADs and collect register dependencies. */ - for (i = as->stopins; i > REF_BASE; i--) { - IRIns *ir = IR(i); - RegSP rs; - lua_assert((ir->o == IR_SLOAD && (ir->op2 & IRSLOAD_PARENT)) || - (LJ_SOFTFP && ir->o == IR_HIOP) || ir->o == IR_PVAL); - rs = as->parentmap[i - REF_FIRST]; - if (ra_hasreg(ir->r)) { - rset_clear(allow, ir->r); - if (ra_hasspill(ir->s)) { - ra_save(as, ir, ir->r); - checkmclim(as); - } - } else if (ra_hasspill(ir->s)) { - irt_setmark(ir->t); - pass2 = 1; - } - if (ir->r == rs) { /* Coalesce matching registers right now. */ - ra_free(as, ir->r); - } else if (ra_hasspill(regsp_spill(rs))) { - if (ra_hasreg(ir->r)) - pass3 = 1; - } else if (ra_used(ir)) { - sloadins[rs] = (IRRef1)i; - rset_set(live, rs); /* Block live parent register. */ - } - } - - /* Calculate stack frame adjustment. */ - spadj = asm_stack_adjust(as); - spdelta = spadj - (int32_t)as->parent->spadjust; - if (spdelta < 0) { /* Don't shrink the stack frame. */ - spadj = (int32_t)as->parent->spadjust; - spdelta = 0; - } - as->T->spadjust = (uint16_t)spadj; - - /* Reload spilled target registers. */ - if (pass2) { - for (i = as->stopins; i > REF_BASE; i--) { - IRIns *ir = IR(i); - if (irt_ismarked(ir->t)) { - RegSet mask; - Reg r; - RegSP rs; - irt_clearmark(ir->t); - rs = as->parentmap[i - REF_FIRST]; - if (!ra_hasspill(regsp_spill(rs))) - ra_sethint(ir->r, rs); /* Hint may be gone, set it again. */ - else if (sps_scale(regsp_spill(rs))+spdelta == sps_scale(ir->s)) - continue; /* Same spill slot, do nothing. */ - mask = ((!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR) & allow; - if (mask == RSET_EMPTY) - lj_trace_err(as->J, LJ_TRERR_NYICOAL); - r = ra_allocref(as, i, mask); - ra_save(as, ir, r); - rset_clear(allow, r); - if (r == rs) { /* Coalesce matching registers right now. */ - ra_free(as, r); - rset_clear(live, r); - } else if (ra_hasspill(regsp_spill(rs))) { - pass3 = 1; - } - checkmclim(as); - } - } - } - - /* Store trace number and adjust stack frame relative to the parent. */ - emit_setvmstate(as, (int32_t)as->T->traceno); - emit_spsub(as, spdelta); - -#if !LJ_TARGET_X86ORX64 - /* Restore BASE register from parent spill slot. */ - if (ra_hasspill(irp->s)) - emit_spload(as, IR(REF_BASE), IR(REF_BASE)->r, sps_scale(irp->s)); -#endif - - /* Restore target registers from parent spill slots. */ - if (pass3) { - RegSet work = ~as->freeset & RSET_ALL; - while (work) { - Reg r = rset_pickbot(work); - IRRef ref = regcost_ref(as->cost[r]); - RegSP rs = as->parentmap[ref - REF_FIRST]; - rset_clear(work, r); - if (ra_hasspill(regsp_spill(rs))) { - int32_t ofs = sps_scale(regsp_spill(rs)); - ra_free(as, r); - emit_spload(as, IR(ref), r, ofs); - checkmclim(as); - } - } - } - - /* Shuffle registers to match up target regs with parent regs. */ - for (;;) { - RegSet work; - - /* Repeatedly coalesce free live registers by moving to their target. */ - while ((work = as->freeset & live) != RSET_EMPTY) { - Reg rp = rset_pickbot(work); - IRIns *ir = IR(sloadins[rp]); - rset_clear(live, rp); - rset_clear(allow, rp); - ra_free(as, ir->r); - emit_movrr(as, ir, ir->r, rp); - checkmclim(as); - } - - /* We're done if no live registers remain. */ - if (live == RSET_EMPTY) - break; - - /* Break cycles by renaming one target to a temp. register. */ - if (live & RSET_GPR) { - RegSet tmpset = as->freeset & ~live & allow & RSET_GPR; - if (tmpset == RSET_EMPTY) - lj_trace_err(as->J, LJ_TRERR_NYICOAL); - ra_rename(as, rset_pickbot(live & RSET_GPR), rset_pickbot(tmpset)); - } - if (!LJ_SOFTFP && (live & RSET_FPR)) { - RegSet tmpset = as->freeset & ~live & allow & RSET_FPR; - if (tmpset == RSET_EMPTY) - lj_trace_err(as->J, LJ_TRERR_NYICOAL); - ra_rename(as, rset_pickbot(live & RSET_FPR), rset_pickbot(tmpset)); - } - checkmclim(as); - /* Continue with coalescing to fix up the broken cycle(s). */ - } - - /* Inherit top stack slot already checked by parent trace. */ - as->T->topslot = as->parent->topslot; - if (as->topslot > as->T->topslot) { /* Need to check for higher slot? */ -#ifdef EXITSTATE_CHECKEXIT - /* Highest exit + 1 indicates stack check. */ - ExitNo exitno = as->T->nsnap; -#else - /* Reuse the parent exit in the context of the parent trace. */ - ExitNo exitno = as->J->exitno; -#endif - as->T->topslot = (uint8_t)as->topslot; /* Remember for child traces. */ - asm_stack_check(as, as->topslot, irp, allow & RSET_GPR, exitno); - } -} - -/* -- Tail of trace ------------------------------------------------------- */ - -/* Get base slot for a snapshot. */ -static BCReg asm_baseslot(ASMState *as, SnapShot *snap, int *gotframe) -{ - SnapEntry *map = &as->T->snapmap[snap->mapofs]; - MSize n; - for (n = snap->nent; n > 0; n--) { - SnapEntry sn = map[n-1]; - if ((sn & SNAP_FRAME)) { - *gotframe = 1; - return snap_slot(sn); - } - } - return 0; -} - -/* Link to another trace. */ -static void asm_tail_link(ASMState *as) -{ - SnapNo snapno = as->T->nsnap-1; /* Last snapshot. */ - SnapShot *snap = &as->T->snap[snapno]; - int gotframe = 0; - BCReg baseslot = asm_baseslot(as, snap, &gotframe); - - as->topslot = snap->topslot; - checkmclim(as); - ra_allocref(as, REF_BASE, RID2RSET(RID_BASE)); - - if (as->T->link == 0) { - /* Setup fixed registers for exit to interpreter. */ - const BCIns *pc = snap_pc(as->T->snapmap[snap->mapofs + snap->nent]); - int32_t mres; - if (bc_op(*pc) == BC_JLOOP) { /* NYI: find a better way to do this. */ - BCIns *retpc = &traceref(as->J, bc_d(*pc))->startins; - if (bc_isret(bc_op(*retpc))) - pc = retpc; - } - ra_allockreg(as, i32ptr(J2GG(as->J)->dispatch), RID_DISPATCH); - ra_allockreg(as, i32ptr(pc), RID_LPC); - mres = (int32_t)(snap->nslots - baseslot); - switch (bc_op(*pc)) { - case BC_CALLM: case BC_CALLMT: - mres -= (int32_t)(1 + bc_a(*pc) + bc_c(*pc)); break; - case BC_RETM: mres -= (int32_t)(bc_a(*pc) + bc_d(*pc)); break; - case BC_TSETM: mres -= (int32_t)bc_a(*pc); break; - default: if (bc_op(*pc) < BC_FUNCF) mres = 0; break; - } - ra_allockreg(as, mres, RID_RET); /* Return MULTRES or 0. */ - } else if (baseslot) { - /* Save modified BASE for linking to trace with higher start frame. */ - emit_setgl(as, RID_BASE, jit_base); - } - emit_addptr(as, RID_BASE, 8*(int32_t)baseslot); - - /* Sync the interpreter state with the on-trace state. */ - asm_stack_restore(as, snap); - - /* Root traces that add frames need to check the stack at the end. */ - if (!as->parent && gotframe) - asm_stack_check(as, as->topslot, NULL, as->freeset & RSET_GPR, snapno); -} - -/* -- Trace setup --------------------------------------------------------- */ - -/* Clear reg/sp for all instructions and add register hints. */ -static void asm_setup_regsp(ASMState *as) -{ - GCtrace *T = as->T; - int sink = T->sinktags; - IRRef nins = T->nins; - IRIns *ir, *lastir; - int inloop; -#if LJ_TARGET_ARM - uint32_t rload = 0xa6402a64; -#endif - - ra_setup(as); - - /* Clear reg/sp for constants. */ - for (ir = IR(T->nk), lastir = IR(REF_BASE); ir < lastir; ir++) - ir->prev = REGSP_INIT; - - /* REF_BASE is used for implicit references to the BASE register. */ - lastir->prev = REGSP_HINT(RID_BASE); - - ir = IR(nins-1); - if (ir->o == IR_RENAME) { - do { ir--; nins--; } while (ir->o == IR_RENAME); - T->nins = nins; /* Remove any renames left over from ASM restart. */ - } - as->snaprename = nins; - as->snapref = nins; - as->snapno = T->nsnap; - - as->stopins = REF_BASE; - as->orignins = nins; - as->curins = nins; - - /* Setup register hints for parent link instructions. */ - ir = IR(REF_FIRST); - if (as->parent) { - uint16_t *p; - lastir = lj_snap_regspmap(as->parent, as->J->exitno, ir); - if (lastir - ir > LJ_MAX_JSLOTS) - lj_trace_err(as->J, LJ_TRERR_NYICOAL); - as->stopins = (IRRef)((lastir-1) - as->ir); - for (p = as->parentmap; ir < lastir; ir++) { - RegSP rs = ir->prev; - *p++ = (uint16_t)rs; /* Copy original parent RegSP to parentmap. */ - if (!ra_hasspill(regsp_spill(rs))) - ir->prev = (uint16_t)REGSP_HINT(regsp_reg(rs)); - else - ir->prev = REGSP_INIT; - } - } - - inloop = 0; - as->evenspill = SPS_FIRST; - for (lastir = IR(nins); ir < lastir; ir++) { - if (sink) { - if (ir->r == RID_SINK) - continue; - if (ir->r == RID_SUNK) { /* Revert after ASM restart. */ - ir->r = RID_SINK; - continue; - } - } - switch (ir->o) { - case IR_LOOP: - inloop = 1; - break; -#if LJ_TARGET_ARM - case IR_SLOAD: - if (!((ir->op2 & IRSLOAD_TYPECHECK) || (ir+1)->o == IR_HIOP)) - break; - /* fallthrough */ - case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: - if (!LJ_SOFTFP && irt_isnum(ir->t)) break; - ir->prev = (uint16_t)REGSP_HINT((rload & 15)); - rload = lj_ror(rload, 4); - continue; -#endif - case IR_CALLXS: { - CCallInfo ci; - ci.flags = asm_callx_flags(as, ir); - ir->prev = asm_setup_call_slots(as, ir, &ci); - if (inloop) - as->modset |= RSET_SCRATCH; - continue; - } - case IR_CALLN: case IR_CALLL: case IR_CALLS: { - const CCallInfo *ci = &lj_ir_callinfo[ir->op2]; - ir->prev = asm_setup_call_slots(as, ir, ci); - if (inloop) - as->modset |= (ci->flags & CCI_NOFPRCLOBBER) ? - (RSET_SCRATCH & ~RSET_FPR) : RSET_SCRATCH; - continue; - } -#if LJ_SOFTFP || (LJ_32 && LJ_HASFFI) - case IR_HIOP: - switch ((ir-1)->o) { -#if LJ_SOFTFP && LJ_TARGET_ARM - case IR_SLOAD: case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: - if (ra_hashint((ir-1)->r)) { - ir->prev = (ir-1)->prev + 1; - continue; - } - break; -#endif -#if !LJ_SOFTFP && LJ_NEED_FP64 - case IR_CONV: - if (irt_isfp((ir-1)->t)) { - ir->prev = REGSP_HINT(RID_FPRET); - continue; - } - /* fallthrough */ -#endif - case IR_CALLN: case IR_CALLXS: -#if LJ_SOFTFP - case IR_MIN: case IR_MAX: -#endif - (ir-1)->prev = REGSP_HINT(RID_RETLO); - ir->prev = REGSP_HINT(RID_RETHI); - continue; - default: - break; - } - break; -#endif -#if LJ_SOFTFP - case IR_MIN: case IR_MAX: - if ((ir+1)->o != IR_HIOP) break; - /* fallthrough */ -#endif - /* C calls evict all scratch regs and return results in RID_RET. */ - case IR_SNEW: case IR_XSNEW: case IR_NEWREF: - if (REGARG_NUMGPR < 3 && as->evenspill < 3) - as->evenspill = 3; /* lj_str_new and lj_tab_newkey need 3 args. */ - case IR_TNEW: case IR_TDUP: case IR_CNEW: case IR_CNEWI: case IR_TOSTR: - ir->prev = REGSP_HINT(RID_RET); - if (inloop) - as->modset = RSET_SCRATCH; - continue; - case IR_STRTO: case IR_OBAR: - if (inloop) - as->modset = RSET_SCRATCH; - break; -#if !LJ_TARGET_X86ORX64 && !LJ_SOFTFP - case IR_ATAN2: case IR_LDEXP: -#endif - case IR_POW: - if (!LJ_SOFTFP && irt_isnum(ir->t)) { -#if LJ_TARGET_X86ORX64 - ir->prev = REGSP_HINT(RID_XMM0); - if (inloop) - as->modset |= RSET_RANGE(RID_XMM0, RID_XMM1+1)|RID2RSET(RID_EAX); -#else - ir->prev = REGSP_HINT(RID_FPRET); - if (inloop) - as->modset |= RSET_SCRATCH; -#endif - continue; - } - /* fallthrough for integer POW */ - case IR_DIV: case IR_MOD: - if (!irt_isnum(ir->t)) { - ir->prev = REGSP_HINT(RID_RET); - if (inloop) - as->modset |= (RSET_SCRATCH & RSET_GPR); - continue; - } - break; - case IR_FPMATH: -#if LJ_TARGET_X86ORX64 - if (ir->op2 == IRFPM_EXP2) { /* May be joined to lj_vm_pow_sse. */ - ir->prev = REGSP_HINT(RID_XMM0); -#if !LJ_64 - if (as->evenspill < 4) /* Leave room for 16 byte scratch area. */ - as->evenspill = 4; -#endif - if (inloop) - as->modset |= RSET_RANGE(RID_XMM0, RID_XMM2+1)|RID2RSET(RID_EAX); - continue; - } else if (ir->op2 <= IRFPM_TRUNC && !(as->flags & JIT_F_SSE4_1)) { - ir->prev = REGSP_HINT(RID_XMM0); - if (inloop) - as->modset |= RSET_RANGE(RID_XMM0, RID_XMM3+1)|RID2RSET(RID_EAX); - continue; - } - break; -#else - ir->prev = REGSP_HINT(RID_FPRET); - if (inloop) - as->modset |= RSET_SCRATCH; - continue; -#endif -#if LJ_TARGET_X86ORX64 - /* Non-constant shift counts need to be in RID_ECX on x86/x64. */ - case IR_BSHL: case IR_BSHR: case IR_BSAR: case IR_BROL: case IR_BROR: - if (!irref_isk(ir->op2) && !ra_hashint(IR(ir->op2)->r)) { - IR(ir->op2)->r = REGSP_HINT(RID_ECX); - if (inloop) - rset_set(as->modset, RID_ECX); - } - break; -#endif - /* Do not propagate hints across type conversions or loads. */ - case IR_TOBIT: - case IR_XLOAD: -#if !LJ_TARGET_ARM - case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: -#endif - break; - case IR_CONV: - if (irt_isfp(ir->t) || (ir->op2 & IRCONV_SRCMASK) == IRT_NUM || - (ir->op2 & IRCONV_SRCMASK) == IRT_FLOAT) - break; - /* fallthrough */ - default: - /* Propagate hints across likely 'op reg, imm' or 'op reg'. */ - if (irref_isk(ir->op2) && !irref_isk(ir->op1) && - ra_hashint(regsp_reg(IR(ir->op1)->prev))) { - ir->prev = IR(ir->op1)->prev; - continue; - } - break; - } - ir->prev = REGSP_INIT; - } - if ((as->evenspill & 1)) - as->oddspill = as->evenspill++; - else - as->oddspill = 0; -} - -/* -- Assembler core ------------------------------------------------------ */ - -/* Assemble a trace. */ -void lj_asm_trace(jit_State *J, GCtrace *T) -{ - ASMState as_; - ASMState *as = &as_; - MCode *origtop; - - /* Ensure an initialized instruction beyond the last one for HIOP checks. */ - J->cur.nins = lj_ir_nextins(J); - J->cur.ir[J->cur.nins].o = IR_NOP; - - /* Setup initial state. Copy some fields to reduce indirections. */ - as->J = J; - as->T = T; - as->ir = T->ir; - as->flags = J->flags; - as->loopref = J->loopref; - as->realign = NULL; - as->loopinv = 0; - as->parent = J->parent ? traceref(J, J->parent) : NULL; - - /* Reserve MCode memory. */ - as->mctop = origtop = lj_mcode_reserve(J, &as->mcbot); - as->mcp = as->mctop; - as->mclim = as->mcbot + MCLIM_REDZONE; - asm_setup_target(as); - - do { - as->mcp = as->mctop; -#ifdef LUA_USE_ASSERT - as->mcp_prev = as->mcp; -#endif - as->curins = T->nins; - RA_DBG_START(); - RA_DBGX((as, "===== STOP =====")); - - /* General trace setup. Emit tail of trace. */ - asm_tail_prep(as); - as->mcloop = NULL; - as->flagmcp = NULL; - as->topslot = 0; - as->gcsteps = 0; - as->sectref = as->loopref; - as->fuseref = (as->flags & JIT_F_OPT_FUSE) ? as->loopref : FUSE_DISABLED; - asm_setup_regsp(as); - if (!as->loopref) - asm_tail_link(as); - - /* Assemble a trace in linear backwards order. */ - for (as->curins--; as->curins > as->stopins; as->curins--) { - IRIns *ir = IR(as->curins); - lua_assert(!(LJ_32 && irt_isint64(ir->t))); /* Handled by SPLIT. */ - if (!ra_used(ir) && !ir_sideeff(ir) && (as->flags & JIT_F_OPT_DCE)) - continue; /* Dead-code elimination can be soooo easy. */ - if (irt_isguard(ir->t)) - asm_snap_prep(as); - RA_DBG_REF(); - checkmclim(as); - asm_ir(as, ir); - } - } while (as->realign); /* Retry in case the MCode needs to be realigned. */ - - /* Emit head of trace. */ - RA_DBG_REF(); - checkmclim(as); - if (as->gcsteps > 0) { - as->curins = as->T->snap[0].ref; - asm_snap_prep(as); /* The GC check is a guard. */ - asm_gc_check(as); - } - ra_evictk(as); - if (as->parent) - asm_head_side(as); - else - asm_head_root(as); - asm_phi_fixup(as); - - RA_DBGX((as, "===== START ====")); - RA_DBG_FLUSH(); - if (as->freeset != RSET_ALL) - lj_trace_err(as->J, LJ_TRERR_BADRA); /* Ouch! Should never happen. */ - - /* Set trace entry point before fixing up tail to allow link to self. */ - T->mcode = as->mcp; - T->mcloop = as->mcloop ? (MSize)((char *)as->mcloop - (char *)as->mcp) : 0; - if (!as->loopref) - asm_tail_fixup(as, T->link); /* Note: this may change as->mctop! */ - T->szmcode = (MSize)((char *)as->mctop - (char *)as->mcp); - lj_mcode_sync(T->mcode, origtop); -} - -#undef IR - -#endif diff --git a/subprojects/luajit/src/lj_asm.h b/subprojects/luajit/src/lj_asm.h deleted file mode 100644 index 2819481b6..000000000 --- a/subprojects/luajit/src/lj_asm.h +++ /dev/null @@ -1,17 +0,0 @@ -/* -** IR assembler (SSA IR -> machine code). -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_ASM_H -#define _LJ_ASM_H - -#include "lj_jit.h" - -#if LJ_HASJIT -LJ_FUNC void lj_asm_trace(jit_State *J, GCtrace *T); -LJ_FUNC void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, - MCode *target); -#endif - -#endif diff --git a/subprojects/luajit/src/lj_asm_arm.h b/subprojects/luajit/src/lj_asm_arm.h deleted file mode 100644 index 961f7e397..000000000 --- a/subprojects/luajit/src/lj_asm_arm.h +++ /dev/null @@ -1,2360 +0,0 @@ -/* -** ARM IR assembler (SSA IR -> machine code). -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -/* -- Register allocator extensions --------------------------------------- */ - -/* Allocate a register with a hint. */ -static Reg ra_hintalloc(ASMState *as, IRRef ref, Reg hint, RegSet allow) -{ - Reg r = IR(ref)->r; - if (ra_noreg(r)) { - if (!ra_hashint(r) && !iscrossref(as, ref)) - ra_sethint(IR(ref)->r, hint); /* Propagate register hint. */ - r = ra_allocref(as, ref, allow); - } - ra_noweak(as, r); - return r; -} - -/* Allocate a scratch register pair. */ -static Reg ra_scratchpair(ASMState *as, RegSet allow) -{ - RegSet pick1 = as->freeset & allow; - RegSet pick2 = pick1 & (pick1 >> 1) & RSET_GPREVEN; - Reg r; - if (pick2) { - r = rset_picktop(pick2); - } else { - RegSet pick = pick1 & (allow >> 1) & RSET_GPREVEN; - if (pick) { - r = rset_picktop(pick); - ra_restore(as, regcost_ref(as->cost[r+1])); - } else { - pick = pick1 & (allow << 1) & RSET_GPRODD; - if (pick) { - r = ra_restore(as, regcost_ref(as->cost[rset_picktop(pick)-1])); - } else { - r = ra_evict(as, allow & (allow >> 1) & RSET_GPREVEN); - ra_restore(as, regcost_ref(as->cost[r+1])); - } - } - } - lua_assert(rset_test(RSET_GPREVEN, r)); - ra_modified(as, r); - ra_modified(as, r+1); - RA_DBGX((as, "scratchpair $r $r", r, r+1)); - return r; -} - -#if !LJ_SOFTFP -/* Allocate two source registers for three-operand instructions. */ -static Reg ra_alloc2(ASMState *as, IRIns *ir, RegSet allow) -{ - IRIns *irl = IR(ir->op1), *irr = IR(ir->op2); - Reg left = irl->r, right = irr->r; - if (ra_hasreg(left)) { - ra_noweak(as, left); - if (ra_noreg(right)) - right = ra_allocref(as, ir->op2, rset_exclude(allow, left)); - else - ra_noweak(as, right); - } else if (ra_hasreg(right)) { - ra_noweak(as, right); - left = ra_allocref(as, ir->op1, rset_exclude(allow, right)); - } else if (ra_hashint(right)) { - right = ra_allocref(as, ir->op2, allow); - left = ra_alloc1(as, ir->op1, rset_exclude(allow, right)); - } else { - left = ra_allocref(as, ir->op1, allow); - right = ra_alloc1(as, ir->op2, rset_exclude(allow, left)); - } - return left | (right << 8); -} -#endif - -/* -- Guard handling ------------------------------------------------------ */ - -/* Generate an exit stub group at the bottom of the reserved MCode memory. */ -static MCode *asm_exitstub_gen(ASMState *as, ExitNo group) -{ - MCode *mxp = as->mcbot; - int i; - if (mxp + 4*4+4*EXITSTUBS_PER_GROUP >= as->mctop) - asm_mclimit(as); - /* str lr, [sp]; bl ->vm_exit_handler; .long DISPATCH_address, group. */ - *mxp++ = ARMI_STR|ARMI_LS_P|ARMI_LS_U|ARMF_D(RID_LR)|ARMF_N(RID_SP); - *mxp = ARMI_BL|((((MCode *)(void *)lj_vm_exit_handler-mxp)-2)&0x00ffffffu); - mxp++; - *mxp++ = (MCode)i32ptr(J2GG(as->J)->dispatch); /* DISPATCH address */ - *mxp++ = group*EXITSTUBS_PER_GROUP; - for (i = 0; i < EXITSTUBS_PER_GROUP; i++) - *mxp++ = ARMI_B|((-6-i)&0x00ffffffu); - lj_mcode_sync(as->mcbot, mxp); - lj_mcode_commitbot(as->J, mxp); - as->mcbot = mxp; - as->mclim = as->mcbot + MCLIM_REDZONE; - return mxp - EXITSTUBS_PER_GROUP; -} - -/* Setup all needed exit stubs. */ -static void asm_exitstub_setup(ASMState *as, ExitNo nexits) -{ - ExitNo i; - if (nexits >= EXITSTUBS_PER_GROUP*LJ_MAX_EXITSTUBGR) - lj_trace_err(as->J, LJ_TRERR_SNAPOV); - for (i = 0; i < (nexits+EXITSTUBS_PER_GROUP-1)/EXITSTUBS_PER_GROUP; i++) - if (as->J->exitstubgroup[i] == NULL) - as->J->exitstubgroup[i] = asm_exitstub_gen(as, i); -} - -/* Emit conditional branch to exit for guard. */ -static void asm_guardcc(ASMState *as, ARMCC cc) -{ - MCode *target = exitstub_addr(as->J, as->snapno); - MCode *p = as->mcp; - if (LJ_UNLIKELY(p == as->invmcp)) { - as->loopinv = 1; - *p = ARMI_BL | ((target-p-2) & 0x00ffffffu); - emit_branch(as, ARMF_CC(ARMI_B, cc^1), p+1); - return; - } - emit_branch(as, ARMF_CC(ARMI_BL, cc), target); -} - -/* -- Operand fusion ------------------------------------------------------ */ - -/* Limit linear search to this distance. Avoids O(n^2) behavior. */ -#define CONFLICT_SEARCH_LIM 31 - -/* Check if there's no conflicting instruction between curins and ref. */ -static int noconflict(ASMState *as, IRRef ref, IROp conflict) -{ - IRIns *ir = as->ir; - IRRef i = as->curins; - if (i > ref + CONFLICT_SEARCH_LIM) - return 0; /* Give up, ref is too far away. */ - while (--i > ref) - if (ir[i].o == conflict) - return 0; /* Conflict found. */ - return 1; /* Ok, no conflict. */ -} - -/* Fuse the array base of colocated arrays. */ -static int32_t asm_fuseabase(ASMState *as, IRRef ref) -{ - IRIns *ir = IR(ref); - if (ir->o == IR_TNEW && ir->op1 <= LJ_MAX_COLOSIZE && - !neverfuse(as) && noconflict(as, ref, IR_NEWREF)) - return (int32_t)sizeof(GCtab); - return 0; -} - -/* Fuse array/hash/upvalue reference into register+offset operand. */ -static Reg asm_fuseahuref(ASMState *as, IRRef ref, int32_t *ofsp, RegSet allow, - int lim) -{ - IRIns *ir = IR(ref); - if (ra_noreg(ir->r)) { - if (ir->o == IR_AREF) { - if (mayfuse(as, ref)) { - if (irref_isk(ir->op2)) { - IRRef tab = IR(ir->op1)->op1; - int32_t ofs = asm_fuseabase(as, tab); - IRRef refa = ofs ? tab : ir->op1; - ofs += 8*IR(ir->op2)->i; - if (ofs > -lim && ofs < lim) { - *ofsp = ofs; - return ra_alloc1(as, refa, allow); - } - } - } - } else if (ir->o == IR_HREFK) { - if (mayfuse(as, ref)) { - int32_t ofs = (int32_t)(IR(ir->op2)->op2 * sizeof(Node)); - if (ofs < lim) { - *ofsp = ofs; - return ra_alloc1(as, ir->op1, allow); - } - } - } else if (ir->o == IR_UREFC) { - if (irref_isk(ir->op1)) { - GCfunc *fn = ir_kfunc(IR(ir->op1)); - int32_t ofs = i32ptr(&gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.tv); - *ofsp = (ofs & 255); /* Mask out less bits to allow LDRD. */ - return ra_allock(as, (ofs & ~255), allow); - } - } - } - *ofsp = 0; - return ra_alloc1(as, ref, allow); -} - -/* Fuse m operand into arithmetic/logic instructions. */ -static uint32_t asm_fuseopm(ASMState *as, ARMIns ai, IRRef ref, RegSet allow) -{ - IRIns *ir = IR(ref); - if (ra_hasreg(ir->r)) { - ra_noweak(as, ir->r); - return ARMF_M(ir->r); - } else if (irref_isk(ref)) { - uint32_t k = emit_isk12(ai, ir->i); - if (k) - return k; - } else if (mayfuse(as, ref)) { - if (ir->o >= IR_BSHL && ir->o <= IR_BROR) { - Reg m = ra_alloc1(as, ir->op1, allow); - ARMShift sh = ir->o == IR_BSHL ? ARMSH_LSL : - ir->o == IR_BSHR ? ARMSH_LSR : - ir->o == IR_BSAR ? ARMSH_ASR : ARMSH_ROR; - if (irref_isk(ir->op2)) { - return m | ARMF_SH(sh, (IR(ir->op2)->i & 31)); - } else { - Reg s = ra_alloc1(as, ir->op2, rset_exclude(allow, m)); - return m | ARMF_RSH(sh, s); - } - } else if (ir->o == IR_ADD && ir->op1 == ir->op2) { - Reg m = ra_alloc1(as, ir->op1, allow); - return m | ARMF_SH(ARMSH_LSL, 1); - } - } - return ra_allocref(as, ref, allow); -} - -/* Fuse shifts into loads/stores. Only bother with BSHL 2 => lsl #2. */ -static IRRef asm_fuselsl2(ASMState *as, IRRef ref) -{ - IRIns *ir = IR(ref); - if (ra_noreg(ir->r) && mayfuse(as, ref) && ir->o == IR_BSHL && - irref_isk(ir->op2) && IR(ir->op2)->i == 2) - return ir->op1; - return 0; /* No fusion. */ -} - -/* Fuse XLOAD/XSTORE reference into load/store operand. */ -static void asm_fusexref(ASMState *as, ARMIns ai, Reg rd, IRRef ref, - RegSet allow, int32_t ofs) -{ - IRIns *ir = IR(ref); - Reg base; - if (ra_noreg(ir->r) && canfuse(as, ir)) { - int32_t lim = (!LJ_SOFTFP && (ai & 0x08000000)) ? 1024 : - (ai & 0x04000000) ? 4096 : 256; - if (ir->o == IR_ADD) { - int32_t ofs2; - if (irref_isk(ir->op2) && - (ofs2 = ofs + IR(ir->op2)->i) > -lim && ofs2 < lim && - (!(!LJ_SOFTFP && (ai & 0x08000000)) || !(ofs2 & 3))) { - ofs = ofs2; - ref = ir->op1; - } else if (ofs == 0 && !(!LJ_SOFTFP && (ai & 0x08000000))) { - IRRef lref = ir->op1, rref = ir->op2; - Reg rn, rm; - if ((ai & 0x04000000)) { - IRRef sref = asm_fuselsl2(as, rref); - if (sref) { - rref = sref; - ai |= ARMF_SH(ARMSH_LSL, 2); - } else if ((sref = asm_fuselsl2(as, lref)) != 0) { - lref = rref; - rref = sref; - ai |= ARMF_SH(ARMSH_LSL, 2); - } - } - rn = ra_alloc1(as, lref, allow); - rm = ra_alloc1(as, rref, rset_exclude(allow, rn)); - if ((ai & 0x04000000)) ai |= ARMI_LS_R; - emit_dnm(as, ai|ARMI_LS_P|ARMI_LS_U, rd, rn, rm); - return; - } - } else if (ir->o == IR_STRREF && !(!LJ_SOFTFP && (ai & 0x08000000))) { - lua_assert(ofs == 0); - ofs = (int32_t)sizeof(GCstr); - if (irref_isk(ir->op2)) { - ofs += IR(ir->op2)->i; - ref = ir->op1; - } else if (irref_isk(ir->op1)) { - ofs += IR(ir->op1)->i; - ref = ir->op2; - } else { - /* NYI: Fuse ADD with constant. */ - Reg rn = ra_alloc1(as, ir->op1, allow); - uint32_t m = asm_fuseopm(as, 0, ir->op2, rset_exclude(allow, rn)); - if ((ai & 0x04000000)) - emit_lso(as, ai, rd, rd, ofs); - else - emit_lsox(as, ai, rd, rd, ofs); - emit_dn(as, ARMI_ADD^m, rd, rn); - return; - } - if (ofs <= -lim || ofs >= lim) { - Reg rn = ra_alloc1(as, ref, allow); - Reg rm = ra_allock(as, ofs, rset_exclude(allow, rn)); - if ((ai & 0x04000000)) ai |= ARMI_LS_R; - emit_dnm(as, ai|ARMI_LS_P|ARMI_LS_U, rd, rn, rm); - return; - } - } - } - base = ra_alloc1(as, ref, allow); -#if !LJ_SOFTFP - if ((ai & 0x08000000)) - emit_vlso(as, ai, rd, base, ofs); - else -#endif - if ((ai & 0x04000000)) - emit_lso(as, ai, rd, base, ofs); - else - emit_lsox(as, ai, rd, base, ofs); -} - -#if !LJ_SOFTFP -/* Fuse to multiply-add/sub instruction. */ -static int asm_fusemadd(ASMState *as, IRIns *ir, ARMIns ai, ARMIns air) -{ - IRRef lref = ir->op1, rref = ir->op2; - IRIns *irm; - if (lref != rref && - ((mayfuse(as, lref) && (irm = IR(lref), irm->o == IR_MUL) && - ra_noreg(irm->r)) || - (mayfuse(as, rref) && (irm = IR(rref), irm->o == IR_MUL) && - (rref = lref, ai = air, ra_noreg(irm->r))))) { - Reg dest = ra_dest(as, ir, RSET_FPR); - Reg add = ra_hintalloc(as, rref, dest, RSET_FPR); - Reg right, left = ra_alloc2(as, irm, - rset_exclude(rset_exclude(RSET_FPR, dest), add)); - right = (left >> 8); left &= 255; - emit_dnm(as, ai, (dest & 15), (left & 15), (right & 15)); - if (dest != add) emit_dm(as, ARMI_VMOV_D, (dest & 15), (add & 15)); - return 1; - } - return 0; -} -#endif - -/* -- Calls --------------------------------------------------------------- */ - -/* Generate a call to a C function. */ -static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args) -{ - uint32_t n, nargs = CCI_NARGS(ci); - int32_t ofs = 0; -#if LJ_SOFTFP - Reg gpr = REGARG_FIRSTGPR; -#else - Reg gpr, fpr = REGARG_FIRSTFPR, fprodd = 0; -#endif - if ((void *)ci->func) - emit_call(as, (void *)ci->func); -#if !LJ_SOFTFP - for (gpr = REGARG_FIRSTGPR; gpr <= REGARG_LASTGPR; gpr++) - as->cost[gpr] = REGCOST(~0u, ASMREF_L); - gpr = REGARG_FIRSTGPR; -#endif - for (n = 0; n < nargs; n++) { /* Setup args. */ - IRRef ref = args[n]; - IRIns *ir = IR(ref); -#if !LJ_SOFTFP - if (ref && irt_isfp(ir->t)) { - RegSet of = as->freeset; - Reg src; - if (!LJ_ABI_SOFTFP && !(ci->flags & CCI_VARARG)) { - if (irt_isnum(ir->t)) { - if (fpr <= REGARG_LASTFPR) { - ra_leftov(as, fpr, ref); - fpr++; - continue; - } - } else if (fprodd) { /* Ick. */ - src = ra_alloc1(as, ref, RSET_FPR); - emit_dm(as, ARMI_VMOV_S, (fprodd & 15), (src & 15) | 0x00400000); - fprodd = 0; - continue; - } else if (fpr <= REGARG_LASTFPR) { - ra_leftov(as, fpr, ref); - fprodd = fpr++; - continue; - } - /* Workaround to protect argument GPRs from being used for remat. */ - as->freeset &= ~RSET_RANGE(REGARG_FIRSTGPR, REGARG_LASTGPR+1); - src = ra_alloc1(as, ref, RSET_FPR); /* May alloc GPR to remat FPR. */ - as->freeset |= (of & RSET_RANGE(REGARG_FIRSTGPR, REGARG_LASTGPR+1)); - fprodd = 0; - goto stackfp; - } - /* Workaround to protect argument GPRs from being used for remat. */ - as->freeset &= ~RSET_RANGE(REGARG_FIRSTGPR, REGARG_LASTGPR+1); - src = ra_alloc1(as, ref, RSET_FPR); /* May alloc GPR to remat FPR. */ - as->freeset |= (of & RSET_RANGE(REGARG_FIRSTGPR, REGARG_LASTGPR+1)); - if (irt_isnum(ir->t)) gpr = (gpr+1) & ~1u; - if (gpr <= REGARG_LASTGPR) { - lua_assert(rset_test(as->freeset, gpr)); /* Must have been evicted. */ - if (irt_isnum(ir->t)) { - lua_assert(rset_test(as->freeset, gpr+1)); /* Ditto. */ - emit_dnm(as, ARMI_VMOV_RR_D, gpr, gpr+1, (src & 15)); - gpr += 2; - } else { - emit_dn(as, ARMI_VMOV_R_S, gpr, (src & 15)); - gpr++; - } - } else { - stackfp: - if (irt_isnum(ir->t)) ofs = (ofs + 4) & ~4; - emit_spstore(as, ir, src, ofs); - ofs += irt_isnum(ir->t) ? 8 : 4; - } - } else -#endif - { - if (gpr <= REGARG_LASTGPR) { - lua_assert(rset_test(as->freeset, gpr)); /* Must have been evicted. */ - if (ref) ra_leftov(as, gpr, ref); - gpr++; - } else { - if (ref) { - Reg r = ra_alloc1(as, ref, RSET_GPR); - emit_spstore(as, ir, r, ofs); - } - ofs += 4; - } - } - } -} - -/* Setup result reg/sp for call. Evict scratch regs. */ -static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci) -{ - RegSet drop = RSET_SCRATCH; - int hiop = ((ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t)); - if (ra_hasreg(ir->r)) - rset_clear(drop, ir->r); /* Dest reg handled below. */ - if (hiop && ra_hasreg((ir+1)->r)) - rset_clear(drop, (ir+1)->r); /* Dest reg handled below. */ - ra_evictset(as, drop); /* Evictions must be performed first. */ - if (ra_used(ir)) { - lua_assert(!irt_ispri(ir->t)); - if (!LJ_SOFTFP && irt_isfp(ir->t)) { - if (LJ_ABI_SOFTFP || (ci->flags & (CCI_CASTU64|CCI_VARARG))) { - Reg dest = (ra_dest(as, ir, RSET_FPR) & 15); - if (irt_isnum(ir->t)) - emit_dnm(as, ARMI_VMOV_D_RR, RID_RETLO, RID_RETHI, dest); - else - emit_dn(as, ARMI_VMOV_S_R, RID_RET, dest); - } else { - ra_destreg(as, ir, RID_FPRET); - } - } else if (hiop) { - ra_destpair(as, ir); - } else { - ra_destreg(as, ir, RID_RET); - } - } - UNUSED(ci); -} - -static void asm_call(ASMState *as, IRIns *ir) -{ - IRRef args[CCI_NARGS_MAX]; - const CCallInfo *ci = &lj_ir_callinfo[ir->op2]; - asm_collectargs(as, ir, ci, args); - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); -} - -static void asm_callx(ASMState *as, IRIns *ir) -{ - IRRef args[CCI_NARGS_MAX*2]; - CCallInfo ci; - IRRef func; - IRIns *irf; - ci.flags = asm_callx_flags(as, ir); - asm_collectargs(as, ir, &ci, args); - asm_setupresult(as, ir, &ci); - func = ir->op2; irf = IR(func); - if (irf->o == IR_CARG) { func = irf->op1; irf = IR(func); } - if (irref_isk(func)) { /* Call to constant address. */ - ci.func = (ASMFunction)(void *)(irf->i); - } else { /* Need a non-argument register for indirect calls. */ - Reg freg = ra_alloc1(as, func, RSET_RANGE(RID_R4, RID_R12+1)); - emit_m(as, ARMI_BLXr, freg); - ci.func = (ASMFunction)(void *)0; - } - asm_gencall(as, &ci, args); -} - -/* -- Returns ------------------------------------------------------------- */ - -/* Return to lower frame. Guard that it goes to the right spot. */ -static void asm_retf(ASMState *as, IRIns *ir) -{ - Reg base = ra_alloc1(as, REF_BASE, RSET_GPR); - void *pc = ir_kptr(IR(ir->op2)); - int32_t delta = 1+bc_a(*((const BCIns *)pc - 1)); - as->topslot -= (BCReg)delta; - if ((int32_t)as->topslot < 0) as->topslot = 0; - irt_setmark(IR(REF_BASE)->t); /* Children must not coalesce with BASE reg. */ - /* Need to force a spill on REF_BASE now to update the stack slot. */ - emit_lso(as, ARMI_STR, base, RID_SP, ra_spill(as, IR(REF_BASE))); - emit_setgl(as, base, jit_base); - emit_addptr(as, base, -8*delta); - asm_guardcc(as, CC_NE); - emit_nm(as, ARMI_CMP, RID_TMP, - ra_allock(as, i32ptr(pc), rset_exclude(RSET_GPR, base))); - emit_lso(as, ARMI_LDR, RID_TMP, base, -4); -} - -/* -- Type conversions ---------------------------------------------------- */ - -#if !LJ_SOFTFP -static void asm_tointg(ASMState *as, IRIns *ir, Reg left) -{ - Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, left)); - Reg dest = ra_dest(as, ir, RSET_GPR); - asm_guardcc(as, CC_NE); - emit_d(as, ARMI_VMRS, 0); - emit_dm(as, ARMI_VCMP_D, (tmp & 15), (left & 15)); - emit_dm(as, ARMI_VCVT_F64_S32, (tmp & 15), (tmp & 15)); - emit_dn(as, ARMI_VMOV_R_S, dest, (tmp & 15)); - emit_dm(as, ARMI_VCVT_S32_F64, (tmp & 15), (left & 15)); -} - -static void asm_tobit(ASMState *as, IRIns *ir) -{ - RegSet allow = RSET_FPR; - Reg left = ra_alloc1(as, ir->op1, allow); - Reg right = ra_alloc1(as, ir->op2, rset_clear(allow, left)); - Reg tmp = ra_scratch(as, rset_clear(allow, right)); - Reg dest = ra_dest(as, ir, RSET_GPR); - emit_dn(as, ARMI_VMOV_R_S, dest, (tmp & 15)); - emit_dnm(as, ARMI_VADD_D, (tmp & 15), (left & 15), (right & 15)); -} -#endif - -static void asm_conv(ASMState *as, IRIns *ir) -{ - IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK); -#if !LJ_SOFTFP - int stfp = (st == IRT_NUM || st == IRT_FLOAT); -#endif - IRRef lref = ir->op1; - /* 64 bit integer conversions are handled by SPLIT. */ - lua_assert(!irt_isint64(ir->t) && !(st == IRT_I64 || st == IRT_U64)); -#if LJ_SOFTFP - /* FP conversions are handled by SPLIT. */ - lua_assert(!irt_isfp(ir->t) && !(st == IRT_NUM || st == IRT_FLOAT)); - /* Can't check for same types: SPLIT uses CONV int.int + BXOR for sfp NEG. */ -#else - lua_assert(irt_type(ir->t) != st); - if (irt_isfp(ir->t)) { - Reg dest = ra_dest(as, ir, RSET_FPR); - if (stfp) { /* FP to FP conversion. */ - emit_dm(as, st == IRT_NUM ? ARMI_VCVT_F32_F64 : ARMI_VCVT_F64_F32, - (dest & 15), (ra_alloc1(as, lref, RSET_FPR) & 15)); - } else { /* Integer to FP conversion. */ - Reg left = ra_alloc1(as, lref, RSET_GPR); - ARMIns ai = irt_isfloat(ir->t) ? - (st == IRT_INT ? ARMI_VCVT_F32_S32 : ARMI_VCVT_F32_U32) : - (st == IRT_INT ? ARMI_VCVT_F64_S32 : ARMI_VCVT_F64_U32); - emit_dm(as, ai, (dest & 15), (dest & 15)); - emit_dn(as, ARMI_VMOV_S_R, left, (dest & 15)); - } - } else if (stfp) { /* FP to integer conversion. */ - if (irt_isguard(ir->t)) { - /* Checked conversions are only supported from number to int. */ - lua_assert(irt_isint(ir->t) && st == IRT_NUM); - asm_tointg(as, ir, ra_alloc1(as, lref, RSET_FPR)); - } else { - Reg left = ra_alloc1(as, lref, RSET_FPR); - Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, left)); - Reg dest = ra_dest(as, ir, RSET_GPR); - ARMIns ai; - emit_dn(as, ARMI_VMOV_R_S, dest, (tmp & 15)); - ai = irt_isint(ir->t) ? - (st == IRT_NUM ? ARMI_VCVT_S32_F64 : ARMI_VCVT_S32_F32) : - (st == IRT_NUM ? ARMI_VCVT_U32_F64 : ARMI_VCVT_U32_F32); - emit_dm(as, ai, (tmp & 15), (left & 15)); - } - } else -#endif - { - Reg dest = ra_dest(as, ir, RSET_GPR); - if (st >= IRT_I8 && st <= IRT_U16) { /* Extend to 32 bit integer. */ - Reg left = ra_alloc1(as, lref, RSET_GPR); - lua_assert(irt_isint(ir->t) || irt_isu32(ir->t)); - if ((as->flags & JIT_F_ARMV6)) { - ARMIns ai = st == IRT_I8 ? ARMI_SXTB : - st == IRT_U8 ? ARMI_UXTB : - st == IRT_I16 ? ARMI_SXTH : ARMI_UXTH; - emit_dm(as, ai, dest, left); - } else if (st == IRT_U8) { - emit_dn(as, ARMI_AND|ARMI_K12|255, dest, left); - } else { - uint32_t shift = st == IRT_I8 ? 24 : 16; - ARMShift sh = st == IRT_U16 ? ARMSH_LSR : ARMSH_ASR; - emit_dm(as, ARMI_MOV|ARMF_SH(sh, shift), dest, RID_TMP); - emit_dm(as, ARMI_MOV|ARMF_SH(ARMSH_LSL, shift), RID_TMP, left); - } - } else { /* Handle 32/32 bit no-op (cast). */ - ra_leftov(as, dest, lref); /* Do nothing, but may need to move regs. */ - } - } -} - -#if !LJ_SOFTFP && LJ_HASFFI -static void asm_conv64(ASMState *as, IRIns *ir) -{ - IRType st = (IRType)((ir-1)->op2 & IRCONV_SRCMASK); - IRType dt = (((ir-1)->op2 & IRCONV_DSTMASK) >> IRCONV_DSH); - IRCallID id; - CCallInfo ci; - IRRef args[2]; - args[0] = (ir-1)->op1; - args[1] = ir->op1; - if (st == IRT_NUM || st == IRT_FLOAT) { - id = IRCALL_fp64_d2l + ((st == IRT_FLOAT) ? 2 : 0) + (dt - IRT_I64); - ir--; - } else { - id = IRCALL_fp64_l2d + ((dt == IRT_FLOAT) ? 2 : 0) + (st - IRT_I64); - } - ci = lj_ir_callinfo[id]; -#if !LJ_ABI_SOFTFP - ci.flags |= CCI_VARARG; /* These calls don't use the hard-float ABI! */ -#endif - asm_setupresult(as, ir, &ci); - asm_gencall(as, &ci, args); -} -#endif - -static void asm_strto(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num]; - IRRef args[2]; - Reg rlo = 0, rhi = 0, tmp; - int destused = ra_used(ir); - int32_t ofs = 0; - ra_evictset(as, RSET_SCRATCH); -#if LJ_SOFTFP - if (destused) { - if (ra_hasspill(ir->s) && ra_hasspill((ir+1)->s) && - (ir->s & 1) == 0 && ir->s + 1 == (ir+1)->s) { - int i; - for (i = 0; i < 2; i++) { - Reg r = (ir+i)->r; - if (ra_hasreg(r)) { - ra_free(as, r); - ra_modified(as, r); - emit_spload(as, ir+i, r, sps_scale((ir+i)->s)); - } - } - ofs = sps_scale(ir->s); - destused = 0; - } else { - rhi = ra_dest(as, ir+1, RSET_GPR); - rlo = ra_dest(as, ir, rset_exclude(RSET_GPR, rhi)); - } - } - asm_guardcc(as, CC_EQ); - if (destused) { - emit_lso(as, ARMI_LDR, rhi, RID_SP, 4); - emit_lso(as, ARMI_LDR, rlo, RID_SP, 0); - } -#else - UNUSED(rhi); - if (destused) { - if (ra_hasspill(ir->s)) { - ofs = sps_scale(ir->s); - destused = 0; - if (ra_hasreg(ir->r)) { - ra_free(as, ir->r); - ra_modified(as, ir->r); - emit_spload(as, ir, ir->r, ofs); - } - } else { - rlo = ra_dest(as, ir, RSET_FPR); - } - } - asm_guardcc(as, CC_EQ); - if (destused) - emit_vlso(as, ARMI_VLDR_D, rlo, RID_SP, 0); -#endif - emit_n(as, ARMI_CMP|ARMI_K12|0, RID_RET); /* Test return status. */ - args[0] = ir->op1; /* GCstr *str */ - args[1] = ASMREF_TMP1; /* TValue *n */ - asm_gencall(as, ci, args); - tmp = ra_releasetmp(as, ASMREF_TMP1); - if (ofs == 0) - emit_dm(as, ARMI_MOV, tmp, RID_SP); - else - emit_opk(as, ARMI_ADD, tmp, RID_SP, ofs, RSET_GPR); -} - -/* Get pointer to TValue. */ -static void asm_tvptr(ASMState *as, Reg dest, IRRef ref) -{ - IRIns *ir = IR(ref); - if (irt_isnum(ir->t)) { - if (irref_isk(ref)) { - /* Use the number constant itself as a TValue. */ - ra_allockreg(as, i32ptr(ir_knum(ir)), dest); - } else { -#if LJ_SOFTFP - lua_assert(0); -#else - /* Otherwise force a spill and use the spill slot. */ - emit_opk(as, ARMI_ADD, dest, RID_SP, ra_spill(as, ir), RSET_GPR); -#endif - } - } else { - /* Otherwise use [sp] and [sp+4] to hold the TValue. */ - RegSet allow = rset_exclude(RSET_GPR, dest); - Reg type; - emit_dm(as, ARMI_MOV, dest, RID_SP); - if (!irt_ispri(ir->t)) { - Reg src = ra_alloc1(as, ref, allow); - emit_lso(as, ARMI_STR, src, RID_SP, 0); - } - if ((ir+1)->o == IR_HIOP) - type = ra_alloc1(as, ref+1, allow); - else - type = ra_allock(as, irt_toitype(ir->t), allow); - emit_lso(as, ARMI_STR, type, RID_SP, 4); - } -} - -static void asm_tostr(ASMState *as, IRIns *ir) -{ - IRRef args[2]; - args[0] = ASMREF_L; - as->gcsteps++; - if (irt_isnum(IR(ir->op1)->t) || (ir+1)->o == IR_HIOP) { - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromnum]; - args[1] = ASMREF_TMP1; /* const lua_Number * */ - asm_setupresult(as, ir, ci); /* GCstr * */ - asm_gencall(as, ci, args); - asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op1); - } else { - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromint]; - args[1] = ir->op1; /* int32_t k */ - asm_setupresult(as, ir, ci); /* GCstr * */ - asm_gencall(as, ci, args); - } -} - -/* -- Memory references --------------------------------------------------- */ - -static void asm_aref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg idx, base; - if (irref_isk(ir->op2)) { - IRRef tab = IR(ir->op1)->op1; - int32_t ofs = asm_fuseabase(as, tab); - IRRef refa = ofs ? tab : ir->op1; - uint32_t k = emit_isk12(ARMI_ADD, ofs + 8*IR(ir->op2)->i); - if (k) { - base = ra_alloc1(as, refa, RSET_GPR); - emit_dn(as, ARMI_ADD^k, dest, base); - return; - } - } - base = ra_alloc1(as, ir->op1, RSET_GPR); - idx = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, base)); - emit_dnm(as, ARMI_ADD|ARMF_SH(ARMSH_LSL, 3), dest, base, idx); -} - -/* Inlined hash lookup. Specialized for key type and for const keys. -** The equivalent C code is: -** Node *n = hashkey(t, key); -** do { -** if (lj_obj_equal(&n->key, key)) return &n->val; -** } while ((n = nextnode(n))); -** return niltv(L); -*/ -static void asm_href(ASMState *as, IRIns *ir, IROp merge) -{ - RegSet allow = RSET_GPR; - int destused = ra_used(ir); - Reg dest = ra_dest(as, ir, allow); - Reg tab = ra_alloc1(as, ir->op1, rset_clear(allow, dest)); - Reg key = 0, keyhi = 0, keynumhi = RID_NONE, tmp = RID_TMP; - IRRef refkey = ir->op2; - IRIns *irkey = IR(refkey); - IRType1 kt = irkey->t; - int32_t k = 0, khi = emit_isk12(ARMI_CMP, irt_toitype(kt)); - uint32_t khash; - MCLabel l_end, l_loop; - rset_clear(allow, tab); - if (!irref_isk(refkey) || irt_isstr(kt)) { -#if LJ_SOFTFP - key = ra_alloc1(as, refkey, allow); - rset_clear(allow, key); - if (irkey[1].o == IR_HIOP) { - if (ra_hasreg((irkey+1)->r)) { - keynumhi = (irkey+1)->r; - keyhi = RID_TMP; - ra_noweak(as, keynumhi); - } else { - keyhi = keynumhi = ra_allocref(as, refkey+1, allow); - } - rset_clear(allow, keynumhi); - khi = 0; - } -#else - if (irt_isnum(kt)) { - key = ra_scratch(as, allow); - rset_clear(allow, key); - keyhi = keynumhi = ra_scratch(as, allow); - rset_clear(allow, keyhi); - khi = 0; - } else { - key = ra_alloc1(as, refkey, allow); - rset_clear(allow, key); - } -#endif - } else if (irt_isnum(kt)) { - int32_t val = (int32_t)ir_knum(irkey)->u32.lo; - k = emit_isk12(ARMI_CMP, val); - if (!k) { - key = ra_allock(as, val, allow); - rset_clear(allow, key); - } - val = (int32_t)ir_knum(irkey)->u32.hi; - khi = emit_isk12(ARMI_CMP, val); - if (!khi) { - keyhi = ra_allock(as, val, allow); - rset_clear(allow, keyhi); - } - } else if (!irt_ispri(kt)) { - k = emit_isk12(ARMI_CMP, irkey->i); - if (!k) { - key = ra_alloc1(as, refkey, allow); - rset_clear(allow, key); - } - } - if (!irt_ispri(kt)) - tmp = ra_scratchpair(as, allow); - - /* Key not found in chain: jump to exit (if merged) or load niltv. */ - l_end = emit_label(as); - as->invmcp = NULL; - if (merge == IR_NE) - asm_guardcc(as, CC_AL); - else if (destused) - emit_loada(as, dest, niltvg(J2G(as->J))); - - /* Follow hash chain until the end. */ - l_loop = --as->mcp; - emit_n(as, ARMI_CMP|ARMI_K12|0, dest); - emit_lso(as, ARMI_LDR, dest, dest, (int32_t)offsetof(Node, next)); - - /* Type and value comparison. */ - if (merge == IR_EQ) - asm_guardcc(as, CC_EQ); - else - emit_branch(as, ARMF_CC(ARMI_B, CC_EQ), l_end); - if (!irt_ispri(kt)) { - emit_nm(as, ARMF_CC(ARMI_CMP, CC_EQ)^k, tmp, key); - emit_nm(as, ARMI_CMP^khi, tmp+1, keyhi); - emit_lsox(as, ARMI_LDRD, tmp, dest, (int32_t)offsetof(Node, key)); - } else { - emit_n(as, ARMI_CMP^khi, tmp); - emit_lso(as, ARMI_LDR, tmp, dest, (int32_t)offsetof(Node, key.it)); - } - *l_loop = ARMF_CC(ARMI_B, CC_NE) | ((as->mcp-l_loop-2) & 0x00ffffffu); - - /* Load main position relative to tab->node into dest. */ - khash = irref_isk(refkey) ? ir_khash(irkey) : 1; - if (khash == 0) { - emit_lso(as, ARMI_LDR, dest, tab, (int32_t)offsetof(GCtab, node)); - } else { - emit_dnm(as, ARMI_ADD|ARMF_SH(ARMSH_LSL, 3), dest, dest, tmp); - emit_dnm(as, ARMI_ADD|ARMF_SH(ARMSH_LSL, 1), tmp, tmp, tmp); - if (irt_isstr(kt)) { /* Fetch of str->hash is cheaper than ra_allock. */ - emit_dnm(as, ARMI_AND, tmp, tmp+1, RID_TMP); - emit_lso(as, ARMI_LDR, dest, tab, (int32_t)offsetof(GCtab, node)); - emit_lso(as, ARMI_LDR, tmp+1, key, (int32_t)offsetof(GCstr, hash)); - emit_lso(as, ARMI_LDR, RID_TMP, tab, (int32_t)offsetof(GCtab, hmask)); - } else if (irref_isk(refkey)) { - emit_opk(as, ARMI_AND, tmp, RID_TMP, (int32_t)khash, - rset_exclude(rset_exclude(RSET_GPR, tab), dest)); - emit_lso(as, ARMI_LDR, dest, tab, (int32_t)offsetof(GCtab, node)); - emit_lso(as, ARMI_LDR, RID_TMP, tab, (int32_t)offsetof(GCtab, hmask)); - } else { /* Must match with hash*() in lj_tab.c. */ - if (ra_hasreg(keynumhi)) { /* Canonicalize +-0.0 to 0.0. */ - if (keyhi == RID_TMP) - emit_dm(as, ARMF_CC(ARMI_MOV, CC_NE), keyhi, keynumhi); - emit_d(as, ARMF_CC(ARMI_MOV, CC_EQ)|ARMI_K12|0, keyhi); - } - emit_dnm(as, ARMI_AND, tmp, tmp, RID_TMP); - emit_dnm(as, ARMI_SUB|ARMF_SH(ARMSH_ROR, 32-HASH_ROT3), tmp, tmp, tmp+1); - emit_lso(as, ARMI_LDR, dest, tab, (int32_t)offsetof(GCtab, node)); - emit_dnm(as, ARMI_EOR|ARMF_SH(ARMSH_ROR, 32-((HASH_ROT2+HASH_ROT1)&31)), - tmp, tmp+1, tmp); - emit_lso(as, ARMI_LDR, RID_TMP, tab, (int32_t)offsetof(GCtab, hmask)); - emit_dnm(as, ARMI_SUB|ARMF_SH(ARMSH_ROR, 32-HASH_ROT1), tmp+1, tmp+1, tmp); - if (ra_hasreg(keynumhi)) { - emit_dnm(as, ARMI_EOR, tmp+1, tmp, key); - emit_dnm(as, ARMI_ORR|ARMI_S, RID_TMP, tmp, key); /* Test for +-0.0. */ - emit_dnm(as, ARMI_ADD, tmp, keynumhi, keynumhi); -#if !LJ_SOFTFP - emit_dnm(as, ARMI_VMOV_RR_D, key, keynumhi, - (ra_alloc1(as, refkey, RSET_FPR) & 15)); -#endif - } else { - emit_dnm(as, ARMI_EOR, tmp+1, tmp, key); - emit_opk(as, ARMI_ADD, tmp, key, (int32_t)HASH_BIAS, - rset_exclude(rset_exclude(RSET_GPR, tab), key)); - } - } - } -} - -static void asm_hrefk(ASMState *as, IRIns *ir) -{ - IRIns *kslot = IR(ir->op2); - IRIns *irkey = IR(kslot->op1); - int32_t ofs = (int32_t)(kslot->op2 * sizeof(Node)); - int32_t kofs = ofs + (int32_t)offsetof(Node, key); - Reg dest = (ra_used(ir) || ofs > 4095) ? ra_dest(as, ir, RSET_GPR) : RID_NONE; - Reg node = ra_alloc1(as, ir->op1, RSET_GPR); - Reg key = RID_NONE, type = RID_TMP, idx = node; - RegSet allow = rset_exclude(RSET_GPR, node); - lua_assert(ofs % sizeof(Node) == 0); - if (ofs > 4095) { - idx = dest; - rset_clear(allow, dest); - kofs = (int32_t)offsetof(Node, key); - } else if (ra_hasreg(dest)) { - emit_opk(as, ARMI_ADD, dest, node, ofs, allow); - } - asm_guardcc(as, CC_NE); - if (!irt_ispri(irkey->t)) { - RegSet even = (as->freeset & allow); - even = even & (even >> 1) & RSET_GPREVEN; - if (even) { - key = ra_scratch(as, even); - if (rset_test(as->freeset, key+1)) { - type = key+1; - ra_modified(as, type); - } - } else { - key = ra_scratch(as, allow); - } - rset_clear(allow, key); - } - rset_clear(allow, type); - if (irt_isnum(irkey->t)) { - emit_opk(as, ARMF_CC(ARMI_CMP, CC_EQ), 0, type, - (int32_t)ir_knum(irkey)->u32.hi, allow); - emit_opk(as, ARMI_CMP, 0, key, - (int32_t)ir_knum(irkey)->u32.lo, allow); - } else { - if (ra_hasreg(key)) - emit_opk(as, ARMF_CC(ARMI_CMP, CC_EQ), 0, key, irkey->i, allow); - emit_n(as, ARMI_CMN|ARMI_K12|-irt_toitype(irkey->t), type); - } - emit_lso(as, ARMI_LDR, type, idx, kofs+4); - if (ra_hasreg(key)) emit_lso(as, ARMI_LDR, key, idx, kofs); - if (ofs > 4095) - emit_opk(as, ARMI_ADD, dest, node, ofs, RSET_GPR); -} - -static void asm_newref(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey]; - IRRef args[3]; - if (ir->r == RID_SINK) - return; - args[0] = ASMREF_L; /* lua_State *L */ - args[1] = ir->op1; /* GCtab *t */ - args[2] = ASMREF_TMP1; /* cTValue *key */ - asm_setupresult(as, ir, ci); /* TValue * */ - asm_gencall(as, ci, args); - asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op2); -} - -static void asm_uref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - if (irref_isk(ir->op1)) { - GCfunc *fn = ir_kfunc(IR(ir->op1)); - MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v; - emit_lsptr(as, ARMI_LDR, dest, v); - } else { - Reg uv = ra_scratch(as, RSET_GPR); - Reg func = ra_alloc1(as, ir->op1, RSET_GPR); - if (ir->o == IR_UREFC) { - asm_guardcc(as, CC_NE); - emit_n(as, ARMI_CMP|ARMI_K12|1, RID_TMP); - emit_opk(as, ARMI_ADD, dest, uv, - (int32_t)offsetof(GCupval, tv), RSET_GPR); - emit_lso(as, ARMI_LDRB, RID_TMP, uv, (int32_t)offsetof(GCupval, closed)); - } else { - emit_lso(as, ARMI_LDR, dest, uv, (int32_t)offsetof(GCupval, v)); - } - emit_lso(as, ARMI_LDR, uv, func, - (int32_t)offsetof(GCfuncL, uvptr) + 4*(int32_t)(ir->op2 >> 8)); - } -} - -static void asm_fref(ASMState *as, IRIns *ir) -{ - UNUSED(as); UNUSED(ir); - lua_assert(!ra_used(ir)); -} - -static void asm_strref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - IRRef ref = ir->op2, refk = ir->op1; - Reg r; - if (irref_isk(ref)) { - IRRef tmp = refk; refk = ref; ref = tmp; - } else if (!irref_isk(refk)) { - uint32_t k, m = ARMI_K12|sizeof(GCstr); - Reg right, left = ra_alloc1(as, ir->op1, RSET_GPR); - IRIns *irr = IR(ir->op2); - if (ra_hasreg(irr->r)) { - ra_noweak(as, irr->r); - right = irr->r; - } else if (mayfuse(as, irr->op2) && - irr->o == IR_ADD && irref_isk(irr->op2) && - (k = emit_isk12(ARMI_ADD, - (int32_t)sizeof(GCstr) + IR(irr->op2)->i))) { - m = k; - right = ra_alloc1(as, irr->op1, rset_exclude(RSET_GPR, left)); - } else { - right = ra_allocref(as, ir->op2, rset_exclude(RSET_GPR, left)); - } - emit_dn(as, ARMI_ADD^m, dest, dest); - emit_dnm(as, ARMI_ADD, dest, left, right); - return; - } - r = ra_alloc1(as, ref, RSET_GPR); - emit_opk(as, ARMI_ADD, dest, r, - sizeof(GCstr) + IR(refk)->i, rset_exclude(RSET_GPR, r)); -} - -/* -- Loads and stores ---------------------------------------------------- */ - -static ARMIns asm_fxloadins(IRIns *ir) -{ - switch (irt_type(ir->t)) { - case IRT_I8: return ARMI_LDRSB; - case IRT_U8: return ARMI_LDRB; - case IRT_I16: return ARMI_LDRSH; - case IRT_U16: return ARMI_LDRH; - case IRT_NUM: lua_assert(!LJ_SOFTFP); return ARMI_VLDR_D; - case IRT_FLOAT: if (!LJ_SOFTFP) return ARMI_VLDR_S; - default: return ARMI_LDR; - } -} - -static ARMIns asm_fxstoreins(IRIns *ir) -{ - switch (irt_type(ir->t)) { - case IRT_I8: case IRT_U8: return ARMI_STRB; - case IRT_I16: case IRT_U16: return ARMI_STRH; - case IRT_NUM: lua_assert(!LJ_SOFTFP); return ARMI_VSTR_D; - case IRT_FLOAT: if (!LJ_SOFTFP) return ARMI_VSTR_S; - default: return ARMI_STR; - } -} - -static void asm_fload(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg idx = ra_alloc1(as, ir->op1, RSET_GPR); - ARMIns ai = asm_fxloadins(ir); - int32_t ofs; - if (ir->op2 == IRFL_TAB_ARRAY) { - ofs = asm_fuseabase(as, ir->op1); - if (ofs) { /* Turn the t->array load into an add for colocated arrays. */ - emit_dn(as, ARMI_ADD|ARMI_K12|ofs, dest, idx); - return; - } - } - ofs = field_ofs[ir->op2]; - if ((ai & 0x04000000)) - emit_lso(as, ai, dest, idx, ofs); - else - emit_lsox(as, ai, dest, idx, ofs); -} - -static void asm_fstore(ASMState *as, IRIns *ir) -{ - if (ir->r != RID_SINK) { - Reg src = ra_alloc1(as, ir->op2, RSET_GPR); - IRIns *irf = IR(ir->op1); - Reg idx = ra_alloc1(as, irf->op1, rset_exclude(RSET_GPR, src)); - int32_t ofs = field_ofs[irf->op2]; - ARMIns ai = asm_fxstoreins(ir); - if ((ai & 0x04000000)) - emit_lso(as, ai, src, idx, ofs); - else - emit_lsox(as, ai, src, idx, ofs); - } -} - -static void asm_xload(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, - (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR); - lua_assert(!(ir->op2 & IRXLOAD_UNALIGNED)); - asm_fusexref(as, asm_fxloadins(ir), dest, ir->op1, RSET_GPR, 0); -} - -static void asm_xstore(ASMState *as, IRIns *ir, int32_t ofs) -{ - if (ir->r != RID_SINK) { - Reg src = ra_alloc1(as, ir->op2, - (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR); - asm_fusexref(as, asm_fxstoreins(ir), src, ir->op1, - rset_exclude(RSET_GPR, src), ofs); - } -} - -static void asm_ahuvload(ASMState *as, IRIns *ir) -{ - int hiop = (LJ_SOFTFP && (ir+1)->o == IR_HIOP); - IRType t = hiop ? IRT_NUM : irt_type(ir->t); - Reg dest = RID_NONE, type = RID_NONE, idx; - RegSet allow = RSET_GPR; - int32_t ofs = 0; - if (hiop && ra_used(ir+1)) { - type = ra_dest(as, ir+1, allow); - rset_clear(allow, type); - } - if (ra_used(ir)) { - lua_assert((LJ_SOFTFP ? 0 : irt_isnum(ir->t)) || - irt_isint(ir->t) || irt_isaddr(ir->t)); - dest = ra_dest(as, ir, (!LJ_SOFTFP && t == IRT_NUM) ? RSET_FPR : allow); - rset_clear(allow, dest); - } - idx = asm_fuseahuref(as, ir->op1, &ofs, allow, - (!LJ_SOFTFP && t == IRT_NUM) ? 1024 : 4096); - if (!hiop || type == RID_NONE) { - rset_clear(allow, idx); - if (ofs < 256 && ra_hasreg(dest) && (dest & 1) == 0 && - rset_test((as->freeset & allow), dest+1)) { - type = dest+1; - ra_modified(as, type); - } else { - type = RID_TMP; - } - } - asm_guardcc(as, t == IRT_NUM ? CC_HS : CC_NE); - emit_n(as, ARMI_CMN|ARMI_K12|-irt_toitype_(t), type); - if (ra_hasreg(dest)) { -#if !LJ_SOFTFP - if (t == IRT_NUM) - emit_vlso(as, ARMI_VLDR_D, dest, idx, ofs); - else -#endif - emit_lso(as, ARMI_LDR, dest, idx, ofs); - } - emit_lso(as, ARMI_LDR, type, idx, ofs+4); -} - -static void asm_ahustore(ASMState *as, IRIns *ir) -{ - if (ir->r != RID_SINK) { - RegSet allow = RSET_GPR; - Reg idx, src = RID_NONE, type = RID_NONE; - int32_t ofs = 0; -#if !LJ_SOFTFP - if (irt_isnum(ir->t)) { - src = ra_alloc1(as, ir->op2, RSET_FPR); - idx = asm_fuseahuref(as, ir->op1, &ofs, allow, 1024); - emit_vlso(as, ARMI_VSTR_D, src, idx, ofs); - } else -#endif - { - int hiop = (LJ_SOFTFP && (ir+1)->o == IR_HIOP); - if (!irt_ispri(ir->t)) { - src = ra_alloc1(as, ir->op2, allow); - rset_clear(allow, src); - } - if (hiop) - type = ra_alloc1(as, (ir+1)->op2, allow); - else - type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow); - idx = asm_fuseahuref(as, ir->op1, &ofs, rset_exclude(allow, type), 4096); - if (ra_hasreg(src)) emit_lso(as, ARMI_STR, src, idx, ofs); - emit_lso(as, ARMI_STR, type, idx, ofs+4); - } - } -} - -static void asm_sload(ASMState *as, IRIns *ir) -{ - int32_t ofs = 8*((int32_t)ir->op1-1) + ((ir->op2 & IRSLOAD_FRAME) ? 4 : 0); - int hiop = (LJ_SOFTFP && (ir+1)->o == IR_HIOP); - IRType t = hiop ? IRT_NUM : irt_type(ir->t); - Reg dest = RID_NONE, type = RID_NONE, base; - RegSet allow = RSET_GPR; - lua_assert(!(ir->op2 & IRSLOAD_PARENT)); /* Handled by asm_head_side(). */ - lua_assert(irt_isguard(ir->t) || !(ir->op2 & IRSLOAD_TYPECHECK)); -#if LJ_SOFTFP - lua_assert(!(ir->op2 & IRSLOAD_CONVERT)); /* Handled by LJ_SOFTFP SPLIT. */ - if (hiop && ra_used(ir+1)) { - type = ra_dest(as, ir+1, allow); - rset_clear(allow, type); - } -#else - if ((ir->op2 & IRSLOAD_CONVERT) && irt_isguard(ir->t) && t == IRT_INT) { - dest = ra_scratch(as, RSET_FPR); - asm_tointg(as, ir, dest); - t = IRT_NUM; /* Continue with a regular number type check. */ - } else -#endif - if (ra_used(ir)) { - Reg tmp = RID_NONE; - if ((ir->op2 & IRSLOAD_CONVERT)) - tmp = ra_scratch(as, t == IRT_INT ? RSET_FPR : RSET_GPR); - lua_assert((LJ_SOFTFP ? 0 : irt_isnum(ir->t)) || - irt_isint(ir->t) || irt_isaddr(ir->t)); - dest = ra_dest(as, ir, (!LJ_SOFTFP && t == IRT_NUM) ? RSET_FPR : allow); - rset_clear(allow, dest); - base = ra_alloc1(as, REF_BASE, allow); - if ((ir->op2 & IRSLOAD_CONVERT)) { - if (t == IRT_INT) { - emit_dn(as, ARMI_VMOV_R_S, dest, (tmp & 15)); - emit_dm(as, ARMI_VCVT_S32_F64, (tmp & 15), (tmp & 15)); - t = IRT_NUM; /* Check for original type. */ - } else { - emit_dm(as, ARMI_VCVT_F64_S32, (dest & 15), (dest & 15)); - emit_dn(as, ARMI_VMOV_S_R, tmp, (dest & 15)); - t = IRT_INT; /* Check for original type. */ - } - dest = tmp; - } - goto dotypecheck; - } - base = ra_alloc1(as, REF_BASE, allow); -dotypecheck: - rset_clear(allow, base); - if ((ir->op2 & IRSLOAD_TYPECHECK)) { - if (ra_noreg(type)) { - if (ofs < 256 && ra_hasreg(dest) && (dest & 1) == 0 && - rset_test((as->freeset & allow), dest+1)) { - type = dest+1; - ra_modified(as, type); - } else { - type = RID_TMP; - } - } - asm_guardcc(as, t == IRT_NUM ? CC_HS : CC_NE); - emit_n(as, ARMI_CMN|ARMI_K12|-irt_toitype_(t), type); - } - if (ra_hasreg(dest)) { -#if !LJ_SOFTFP - if (t == IRT_NUM) { - if (ofs < 1024) { - emit_vlso(as, ARMI_VLDR_D, dest, base, ofs); - } else { - if (ra_hasreg(type)) emit_lso(as, ARMI_LDR, type, base, ofs+4); - emit_vlso(as, ARMI_VLDR_D, dest, RID_TMP, 0); - emit_opk(as, ARMI_ADD, RID_TMP, base, ofs, allow); - return; - } - } else -#endif - emit_lso(as, ARMI_LDR, dest, base, ofs); - } - if (ra_hasreg(type)) emit_lso(as, ARMI_LDR, type, base, ofs+4); -} - -/* -- Allocations --------------------------------------------------------- */ - -#if LJ_HASFFI -static void asm_cnew(ASMState *as, IRIns *ir) -{ - CTState *cts = ctype_ctsG(J2G(as->J)); - CTypeID ctypeid = (CTypeID)IR(ir->op1)->i; - CTSize sz = (ir->o == IR_CNEWI || ir->op2 == REF_NIL) ? - lj_ctype_size(cts, ctypeid) : (CTSize)IR(ir->op2)->i; - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco]; - IRRef args[2]; - RegSet allow = (RSET_GPR & ~RSET_SCRATCH); - RegSet drop = RSET_SCRATCH; - lua_assert(sz != CTSIZE_INVALID); - - args[0] = ASMREF_L; /* lua_State *L */ - args[1] = ASMREF_TMP1; /* MSize size */ - as->gcsteps++; - - if (ra_hasreg(ir->r)) - rset_clear(drop, ir->r); /* Dest reg handled below. */ - ra_evictset(as, drop); - if (ra_used(ir)) - ra_destreg(as, ir, RID_RET); /* GCcdata * */ - - /* Initialize immutable cdata object. */ - if (ir->o == IR_CNEWI) { - int32_t ofs = sizeof(GCcdata); - lua_assert(sz == 4 || sz == 8); - if (sz == 8) { - ofs += 4; ir++; - lua_assert(ir->o == IR_HIOP); - } - for (;;) { - Reg r = ra_alloc1(as, ir->op2, allow); - emit_lso(as, ARMI_STR, r, RID_RET, ofs); - rset_clear(allow, r); - if (ofs == sizeof(GCcdata)) break; - ofs -= 4; ir--; - } - } - /* Initialize gct and ctypeid. lj_mem_newgco() already sets marked. */ - { - uint32_t k = emit_isk12(ARMI_MOV, ctypeid); - Reg r = k ? RID_R1 : ra_allock(as, ctypeid, allow); - emit_lso(as, ARMI_STRB, RID_TMP, RID_RET, offsetof(GCcdata, gct)); - emit_lsox(as, ARMI_STRH, r, RID_RET, offsetof(GCcdata, ctypeid)); - emit_d(as, ARMI_MOV|ARMI_K12|~LJ_TCDATA, RID_TMP); - if (k) emit_d(as, ARMI_MOV^k, RID_R1); - } - asm_gencall(as, ci, args); - ra_allockreg(as, (int32_t)(sz+sizeof(GCcdata)), - ra_releasetmp(as, ASMREF_TMP1)); -} -#else -#define asm_cnew(as, ir) ((void)0) -#endif - -/* -- Write barriers ------------------------------------------------------ */ - -static void asm_tbar(ASMState *as, IRIns *ir) -{ - Reg tab = ra_alloc1(as, ir->op1, RSET_GPR); - Reg link = ra_scratch(as, rset_exclude(RSET_GPR, tab)); - Reg gr = ra_allock(as, i32ptr(J2G(as->J)), - rset_exclude(rset_exclude(RSET_GPR, tab), link)); - Reg mark = RID_TMP; - MCLabel l_end = emit_label(as); - emit_lso(as, ARMI_STR, link, tab, (int32_t)offsetof(GCtab, gclist)); - emit_lso(as, ARMI_STRB, mark, tab, (int32_t)offsetof(GCtab, marked)); - emit_lso(as, ARMI_STR, tab, gr, - (int32_t)offsetof(global_State, gc.grayagain)); - emit_dn(as, ARMI_BIC|ARMI_K12|LJ_GC_BLACK, mark, mark); - emit_lso(as, ARMI_LDR, link, gr, - (int32_t)offsetof(global_State, gc.grayagain)); - emit_branch(as, ARMF_CC(ARMI_B, CC_EQ), l_end); - emit_n(as, ARMI_TST|ARMI_K12|LJ_GC_BLACK, mark); - emit_lso(as, ARMI_LDRB, mark, tab, (int32_t)offsetof(GCtab, marked)); -} - -static void asm_obar(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_barrieruv]; - IRRef args[2]; - MCLabel l_end; - Reg obj, val, tmp; - /* No need for other object barriers (yet). */ - lua_assert(IR(ir->op1)->o == IR_UREFC); - ra_evictset(as, RSET_SCRATCH); - l_end = emit_label(as); - args[0] = ASMREF_TMP1; /* global_State *g */ - args[1] = ir->op1; /* TValue *tv */ - asm_gencall(as, ci, args); - if ((l_end[-1] >> 28) == CC_AL) - l_end[-1] = ARMF_CC(l_end[-1], CC_NE); - else - emit_branch(as, ARMF_CC(ARMI_B, CC_EQ), l_end); - ra_allockreg(as, i32ptr(J2G(as->J)), ra_releasetmp(as, ASMREF_TMP1)); - obj = IR(ir->op1)->r; - tmp = ra_scratch(as, rset_exclude(RSET_GPR, obj)); - emit_n(as, ARMF_CC(ARMI_TST, CC_NE)|ARMI_K12|LJ_GC_BLACK, tmp); - emit_n(as, ARMI_TST|ARMI_K12|LJ_GC_WHITES, RID_TMP); - val = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, obj)); - emit_lso(as, ARMI_LDRB, tmp, obj, - (int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)); - emit_lso(as, ARMI_LDRB, RID_TMP, val, (int32_t)offsetof(GChead, marked)); -} - -/* -- Arithmetic and logic operations ------------------------------------- */ - -#if !LJ_SOFTFP -static void asm_fparith(ASMState *as, IRIns *ir, ARMIns ai) -{ - Reg dest = ra_dest(as, ir, RSET_FPR); - Reg right, left = ra_alloc2(as, ir, RSET_FPR); - right = (left >> 8); left &= 255; - emit_dnm(as, ai, (dest & 15), (left & 15), (right & 15)); -} - -static void asm_fpunary(ASMState *as, IRIns *ir, ARMIns ai) -{ - Reg dest = ra_dest(as, ir, RSET_FPR); - Reg left = ra_hintalloc(as, ir->op1, dest, RSET_FPR); - emit_dm(as, ai, (dest & 15), (left & 15)); -} - -static int asm_fpjoin_pow(ASMState *as, IRIns *ir) -{ - IRIns *irp = IR(ir->op1); - if (irp == ir-1 && irp->o == IR_MUL && !ra_used(irp)) { - IRIns *irpp = IR(irp->op1); - if (irpp == ir-2 && irpp->o == IR_FPMATH && - irpp->op2 == IRFPM_LOG2 && !ra_used(irpp)) { - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_pow]; - IRRef args[2]; - args[0] = irpp->op1; - args[1] = irp->op2; - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); - return 1; - } - } - return 0; -} -#endif - -static int asm_swapops(ASMState *as, IRRef lref, IRRef rref) -{ - IRIns *ir; - if (irref_isk(rref)) - return 0; /* Don't swap constants to the left. */ - if (irref_isk(lref)) - return 1; /* But swap constants to the right. */ - ir = IR(rref); - if ((ir->o >= IR_BSHL && ir->o <= IR_BROR) || - (ir->o == IR_ADD && ir->op1 == ir->op2)) - return 0; /* Don't swap fusable operands to the left. */ - ir = IR(lref); - if ((ir->o >= IR_BSHL && ir->o <= IR_BROR) || - (ir->o == IR_ADD && ir->op1 == ir->op2)) - return 1; /* But swap fusable operands to the right. */ - return 0; /* Otherwise don't swap. */ -} - -static void asm_intop(ASMState *as, IRIns *ir, ARMIns ai) -{ - IRRef lref = ir->op1, rref = ir->op2; - Reg left, dest = ra_dest(as, ir, RSET_GPR); - uint32_t m; - if (asm_swapops(as, lref, rref)) { - IRRef tmp = lref; lref = rref; rref = tmp; - if ((ai & ~ARMI_S) == ARMI_SUB || (ai & ~ARMI_S) == ARMI_SBC) - ai ^= (ARMI_SUB^ARMI_RSB); - } - left = ra_hintalloc(as, lref, dest, RSET_GPR); - m = asm_fuseopm(as, ai, rref, rset_exclude(RSET_GPR, left)); - if (irt_isguard(ir->t)) { /* For IR_ADDOV etc. */ - asm_guardcc(as, CC_VS); - ai |= ARMI_S; - } - emit_dn(as, ai^m, dest, left); -} - -static void asm_intop_s(ASMState *as, IRIns *ir, ARMIns ai) -{ - if (as->flagmcp == as->mcp) { /* Drop cmp r, #0. */ - as->flagmcp = NULL; - as->mcp++; - ai |= ARMI_S; - } - asm_intop(as, ir, ai); -} - -static void asm_bitop(ASMState *as, IRIns *ir, ARMIns ai) -{ - if (as->flagmcp == as->mcp) { /* Try to drop cmp r, #0. */ - uint32_t cc = (as->mcp[1] >> 28); - as->flagmcp = NULL; - if (cc <= CC_NE) { - as->mcp++; - ai |= ARMI_S; - } else if (cc == CC_GE) { - *++as->mcp ^= ((CC_GE^CC_PL) << 28); - ai |= ARMI_S; - } else if (cc == CC_LT) { - *++as->mcp ^= ((CC_LT^CC_MI) << 28); - ai |= ARMI_S; - } /* else: other conds don't work with bit ops. */ - } - if (ir->op2 == 0) { - Reg dest = ra_dest(as, ir, RSET_GPR); - uint32_t m = asm_fuseopm(as, ai, ir->op1, RSET_GPR); - emit_d(as, ai^m, dest); - } else { - /* NYI: Turn BAND !k12 into uxtb, uxth or bfc or shl+shr. */ - asm_intop(as, ir, ai); - } -} - -static void asm_intneg(ASMState *as, IRIns *ir, ARMIns ai) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - emit_dn(as, ai|ARMI_K12|0, dest, left); -} - -/* NYI: use add/shift for MUL(OV) with constants. FOLD only does 2^k. */ -static void asm_intmul(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_alloc1(as, ir->op1, rset_exclude(RSET_GPR, dest)); - Reg right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - Reg tmp = RID_NONE; - /* ARMv5 restriction: dest != left and dest_hi != left. */ - if (dest == left && left != right) { left = right; right = dest; } - if (irt_isguard(ir->t)) { /* IR_MULOV */ - if (!(as->flags & JIT_F_ARMV6) && dest == left) - tmp = left = ra_scratch(as, rset_exclude(RSET_GPR, left)); - asm_guardcc(as, CC_NE); - emit_nm(as, ARMI_TEQ|ARMF_SH(ARMSH_ASR, 31), RID_TMP, dest); - emit_dnm(as, ARMI_SMULL|ARMF_S(right), dest, RID_TMP, left); - } else { - if (!(as->flags & JIT_F_ARMV6) && dest == left) tmp = left = RID_TMP; - emit_nm(as, ARMI_MUL|ARMF_S(right), dest, left); - } - /* Only need this for the dest == left == right case. */ - if (ra_hasreg(tmp)) emit_dm(as, ARMI_MOV, tmp, right); -} - -static void asm_add(ASMState *as, IRIns *ir) -{ -#if !LJ_SOFTFP - if (irt_isnum(ir->t)) { - if (!asm_fusemadd(as, ir, ARMI_VMLA_D, ARMI_VMLA_D)) - asm_fparith(as, ir, ARMI_VADD_D); - return; - } -#endif - asm_intop_s(as, ir, ARMI_ADD); -} - -static void asm_sub(ASMState *as, IRIns *ir) -{ -#if !LJ_SOFTFP - if (irt_isnum(ir->t)) { - if (!asm_fusemadd(as, ir, ARMI_VNMLS_D, ARMI_VMLS_D)) - asm_fparith(as, ir, ARMI_VSUB_D); - return; - } -#endif - asm_intop_s(as, ir, ARMI_SUB); -} - -static void asm_mul(ASMState *as, IRIns *ir) -{ -#if !LJ_SOFTFP - if (irt_isnum(ir->t)) { - asm_fparith(as, ir, ARMI_VMUL_D); - return; - } -#endif - asm_intmul(as, ir); -} - -static void asm_neg(ASMState *as, IRIns *ir) -{ -#if !LJ_SOFTFP - if (irt_isnum(ir->t)) { - asm_fpunary(as, ir, ARMI_VNEG_D); - return; - } -#endif - asm_intneg(as, ir, ARMI_RSB); -} - -static void asm_callid(ASMState *as, IRIns *ir, IRCallID id) -{ - const CCallInfo *ci = &lj_ir_callinfo[id]; - IRRef args[2]; - args[0] = ir->op1; - args[1] = ir->op2; - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); -} - -#if !LJ_SOFTFP -static void asm_callround(ASMState *as, IRIns *ir, int id) -{ - /* The modified regs must match with the *.dasc implementation. */ - RegSet drop = RID2RSET(RID_R0)|RID2RSET(RID_R1)|RID2RSET(RID_R2)| - RID2RSET(RID_R3)|RID2RSET(RID_R12); - RegSet of; - Reg dest, src; - ra_evictset(as, drop); - dest = ra_dest(as, ir, RSET_FPR); - emit_dnm(as, ARMI_VMOV_D_RR, RID_RETLO, RID_RETHI, (dest & 15)); - emit_call(as, id == IRFPM_FLOOR ? (void *)lj_vm_floor_sf : - id == IRFPM_CEIL ? (void *)lj_vm_ceil_sf : - (void *)lj_vm_trunc_sf); - /* Workaround to protect argument GPRs from being used for remat. */ - of = as->freeset; - as->freeset &= ~RSET_RANGE(RID_R0, RID_R1+1); - as->cost[RID_R0] = as->cost[RID_R1] = REGCOST(~0u, ASMREF_L); - src = ra_alloc1(as, ir->op1, RSET_FPR); /* May alloc GPR to remat FPR. */ - as->freeset |= (of & RSET_RANGE(RID_R0, RID_R1+1)); - emit_dnm(as, ARMI_VMOV_RR_D, RID_R0, RID_R1, (src & 15)); -} -#endif - -static void asm_bitswap(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_alloc1(as, ir->op1, RSET_GPR); - if ((as->flags & JIT_F_ARMV6)) { - emit_dm(as, ARMI_REV, dest, left); - } else { - Reg tmp2 = dest; - if (tmp2 == left) - tmp2 = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR, dest), left)); - emit_dnm(as, ARMI_EOR|ARMF_SH(ARMSH_LSR, 8), dest, tmp2, RID_TMP); - emit_dm(as, ARMI_MOV|ARMF_SH(ARMSH_ROR, 8), tmp2, left); - emit_dn(as, ARMI_BIC|ARMI_K12|256*8|255, RID_TMP, RID_TMP); - emit_dnm(as, ARMI_EOR|ARMF_SH(ARMSH_ROR, 16), RID_TMP, left, left); - } -} - -static void asm_bitshift(ASMState *as, IRIns *ir, ARMShift sh) -{ - if (irref_isk(ir->op2)) { /* Constant shifts. */ - /* NYI: Turn SHL+SHR or BAND+SHR into uxtb, uxth or ubfx. */ - /* NYI: Turn SHL+ASR into sxtb, sxth or sbfx. */ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_alloc1(as, ir->op1, RSET_GPR); - int32_t shift = (IR(ir->op2)->i & 31); - emit_dm(as, ARMI_MOV|ARMF_SH(sh, shift), dest, left); - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_alloc1(as, ir->op1, RSET_GPR); - Reg right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - emit_dm(as, ARMI_MOV|ARMF_RSH(sh, right), dest, left); - } -} - -static void asm_intmin_max(ASMState *as, IRIns *ir, int cc) -{ - uint32_t kcmp = 0, kmov = 0; - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - Reg right = 0; - if (irref_isk(ir->op2)) { - kcmp = emit_isk12(ARMI_CMP, IR(ir->op2)->i); - if (kcmp) kmov = emit_isk12(ARMI_MOV, IR(ir->op2)->i); - } - if (!kmov) { - kcmp = 0; - right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - } - if (kmov || dest != right) { - emit_dm(as, ARMF_CC(ARMI_MOV, cc)^kmov, dest, right); - cc ^= 1; /* Must use opposite conditions for paired moves. */ - } else { - cc ^= (CC_LT^CC_GT); /* Otherwise may swap CC_LT <-> CC_GT. */ - } - if (dest != left) emit_dm(as, ARMF_CC(ARMI_MOV, cc), dest, left); - emit_nm(as, ARMI_CMP^kcmp, left, right); -} - -#if LJ_SOFTFP -static void asm_sfpmin_max(ASMState *as, IRIns *ir, int cc) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_softfp_cmp]; - RegSet drop = RSET_SCRATCH; - Reg r; - IRRef args[4]; - args[0] = ir->op1; args[1] = (ir+1)->op1; - args[2] = ir->op2; args[3] = (ir+1)->op2; - /* __aeabi_cdcmple preserves r0-r3. */ - if (ra_hasreg(ir->r)) rset_clear(drop, ir->r); - if (ra_hasreg((ir+1)->r)) rset_clear(drop, (ir+1)->r); - if (!rset_test(as->freeset, RID_R2) && - regcost_ref(as->cost[RID_R2]) == args[2]) rset_clear(drop, RID_R2); - if (!rset_test(as->freeset, RID_R3) && - regcost_ref(as->cost[RID_R3]) == args[3]) rset_clear(drop, RID_R3); - ra_evictset(as, drop); - ra_destpair(as, ir); - emit_dm(as, ARMF_CC(ARMI_MOV, cc), RID_RETHI, RID_R3); - emit_dm(as, ARMF_CC(ARMI_MOV, cc), RID_RETLO, RID_R2); - emit_call(as, (void *)ci->func); - for (r = RID_R0; r <= RID_R3; r++) - ra_leftov(as, r, args[r-RID_R0]); -} -#else -static void asm_fpmin_max(ASMState *as, IRIns *ir, int cc) -{ - Reg dest = (ra_dest(as, ir, RSET_FPR) & 15); - Reg right, left = ra_alloc2(as, ir, RSET_FPR); - right = ((left >> 8) & 15); left &= 15; - if (dest != left) emit_dm(as, ARMF_CC(ARMI_VMOV_D, cc^1), dest, left); - if (dest != right) emit_dm(as, ARMF_CC(ARMI_VMOV_D, cc), dest, right); - emit_d(as, ARMI_VMRS, 0); - emit_dm(as, ARMI_VCMP_D, left, right); -} -#endif - -static void asm_min_max(ASMState *as, IRIns *ir, int cc, int fcc) -{ -#if LJ_SOFTFP - UNUSED(fcc); -#else - if (irt_isnum(ir->t)) - asm_fpmin_max(as, ir, fcc); - else -#endif - asm_intmin_max(as, ir, cc); -} - -/* -- Comparisons --------------------------------------------------------- */ - -/* Map of comparisons to flags. ORDER IR. */ -static const uint8_t asm_compmap[IR_ABC+1] = { - /* op FP swp int cc FP cc */ - /* LT */ CC_GE + (CC_HS << 4), - /* GE x */ CC_LT + (CC_HI << 4), - /* LE */ CC_GT + (CC_HI << 4), - /* GT x */ CC_LE + (CC_HS << 4), - /* ULT x */ CC_HS + (CC_LS << 4), - /* UGE */ CC_LO + (CC_LO << 4), - /* ULE x */ CC_HI + (CC_LO << 4), - /* UGT */ CC_LS + (CC_LS << 4), - /* EQ */ CC_NE + (CC_NE << 4), - /* NE */ CC_EQ + (CC_EQ << 4), - /* ABC */ CC_LS + (CC_LS << 4) /* Same as UGT. */ -}; - -#if LJ_SOFTFP -/* FP comparisons. */ -static void asm_sfpcomp(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_softfp_cmp]; - RegSet drop = RSET_SCRATCH; - Reg r; - IRRef args[4]; - int swp = (((ir->o ^ (ir->o >> 2)) & ~(ir->o >> 3) & 1) << 1); - args[swp^0] = ir->op1; args[swp^1] = (ir+1)->op1; - args[swp^2] = ir->op2; args[swp^3] = (ir+1)->op2; - /* __aeabi_cdcmple preserves r0-r3. This helps to reduce spills. */ - for (r = RID_R0; r <= RID_R3; r++) - if (!rset_test(as->freeset, r) && - regcost_ref(as->cost[r]) == args[r-RID_R0]) rset_clear(drop, r); - ra_evictset(as, drop); - asm_guardcc(as, (asm_compmap[ir->o] >> 4)); - emit_call(as, (void *)ci->func); - for (r = RID_R0; r <= RID_R3; r++) - ra_leftov(as, r, args[r-RID_R0]); -} -#else -/* FP comparisons. */ -static void asm_fpcomp(ASMState *as, IRIns *ir) -{ - Reg left, right; - ARMIns ai; - int swp = ((ir->o ^ (ir->o >> 2)) & ~(ir->o >> 3) & 1); - if (!swp && irref_isk(ir->op2) && ir_knum(IR(ir->op2))->u64 == 0) { - left = (ra_alloc1(as, ir->op1, RSET_FPR) & 15); - right = 0; - ai = ARMI_VCMPZ_D; - } else { - left = ra_alloc2(as, ir, RSET_FPR); - if (swp) { - right = (left & 15); left = ((left >> 8) & 15); - } else { - right = ((left >> 8) & 15); left &= 15; - } - ai = ARMI_VCMP_D; - } - asm_guardcc(as, (asm_compmap[ir->o] >> 4)); - emit_d(as, ARMI_VMRS, 0); - emit_dm(as, ai, left, right); -} -#endif - -/* Integer comparisons. */ -static void asm_intcomp(ASMState *as, IRIns *ir) -{ - ARMCC cc = (asm_compmap[ir->o] & 15); - IRRef lref = ir->op1, rref = ir->op2; - Reg left; - uint32_t m; - int cmpprev0 = 0; - lua_assert(irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t)); - if (asm_swapops(as, lref, rref)) { - Reg tmp = lref; lref = rref; rref = tmp; - if (cc >= CC_GE) cc ^= 7; /* LT <-> GT, LE <-> GE */ - else if (cc > CC_NE) cc ^= 11; /* LO <-> HI, LS <-> HS */ - } - if (irref_isk(rref) && IR(rref)->i == 0) { - IRIns *irl = IR(lref); - cmpprev0 = (irl+1 == ir); - /* Combine comp(BAND(left, right), 0) into tst left, right. */ - if (cmpprev0 && irl->o == IR_BAND && !ra_used(irl)) { - IRRef blref = irl->op1, brref = irl->op2; - uint32_t m2 = 0; - Reg bleft; - if (asm_swapops(as, blref, brref)) { - Reg tmp = blref; blref = brref; brref = tmp; - } - if (irref_isk(brref)) { - m2 = emit_isk12(ARMI_AND, IR(brref)->i); - if ((m2 & (ARMI_AND^ARMI_BIC))) - goto notst; /* Not beneficial if we miss a constant operand. */ - } - if (cc == CC_GE) cc = CC_PL; - else if (cc == CC_LT) cc = CC_MI; - else if (cc > CC_NE) goto notst; /* Other conds don't work with tst. */ - bleft = ra_alloc1(as, blref, RSET_GPR); - if (!m2) m2 = asm_fuseopm(as, 0, brref, rset_exclude(RSET_GPR, bleft)); - asm_guardcc(as, cc); - emit_n(as, ARMI_TST^m2, bleft); - return; - } - } -notst: - left = ra_alloc1(as, lref, RSET_GPR); - m = asm_fuseopm(as, ARMI_CMP, rref, rset_exclude(RSET_GPR, left)); - asm_guardcc(as, cc); - emit_n(as, ARMI_CMP^m, left); - /* Signed comparison with zero and referencing previous ins? */ - if (cmpprev0 && (cc <= CC_NE || cc >= CC_GE)) - as->flagmcp = as->mcp; /* Allow elimination of the compare. */ -} - -#if LJ_HASFFI -/* 64 bit integer comparisons. */ -static void asm_int64comp(ASMState *as, IRIns *ir) -{ - int signedcomp = (ir->o <= IR_GT); - ARMCC cclo, cchi; - Reg leftlo, lefthi; - uint32_t mlo, mhi; - RegSet allow = RSET_GPR, oldfree; - - /* Always use unsigned comparison for loword. */ - cclo = asm_compmap[ir->o + (signedcomp ? 4 : 0)] & 15; - leftlo = ra_alloc1(as, ir->op1, allow); - oldfree = as->freeset; - mlo = asm_fuseopm(as, ARMI_CMP, ir->op2, rset_clear(allow, leftlo)); - allow &= ~(oldfree & ~as->freeset); /* Update for allocs of asm_fuseopm. */ - - /* Use signed or unsigned comparison for hiword. */ - cchi = asm_compmap[ir->o] & 15; - lefthi = ra_alloc1(as, (ir+1)->op1, allow); - mhi = asm_fuseopm(as, ARMI_CMP, (ir+1)->op2, rset_clear(allow, lefthi)); - - /* All register allocations must be performed _before_ this point. */ - if (signedcomp) { - MCLabel l_around = emit_label(as); - asm_guardcc(as, cclo); - emit_n(as, ARMI_CMP^mlo, leftlo); - emit_branch(as, ARMF_CC(ARMI_B, CC_NE), l_around); - if (cchi == CC_GE || cchi == CC_LE) cchi ^= 6; /* GE -> GT, LE -> LT */ - asm_guardcc(as, cchi); - } else { - asm_guardcc(as, cclo); - emit_n(as, ARMF_CC(ARMI_CMP, CC_EQ)^mlo, leftlo); - } - emit_n(as, ARMI_CMP^mhi, lefthi); -} -#endif - -/* -- Support for 64 bit ops in 32 bit mode ------------------------------- */ - -/* Hiword op of a split 64 bit op. Previous op must be the loword op. */ -static void asm_hiop(ASMState *as, IRIns *ir) -{ -#if LJ_HASFFI || LJ_SOFTFP - /* HIOP is marked as a store because it needs its own DCE logic. */ - int uselo = ra_used(ir-1), usehi = ra_used(ir); /* Loword/hiword used? */ - if (LJ_UNLIKELY(!(as->flags & JIT_F_OPT_DCE))) uselo = usehi = 1; - if ((ir-1)->o <= IR_NE) { /* 64 bit integer or FP comparisons. ORDER IR. */ - as->curins--; /* Always skip the loword comparison. */ -#if LJ_SOFTFP - if (!irt_isint(ir->t)) { - asm_sfpcomp(as, ir-1); - return; - } -#endif -#if LJ_HASFFI - asm_int64comp(as, ir-1); -#endif - return; -#if LJ_SOFTFP - } else if ((ir-1)->o == IR_MIN || (ir-1)->o == IR_MAX) { - as->curins--; /* Always skip the loword min/max. */ - if (uselo || usehi) - asm_sfpmin_max(as, ir-1, (ir-1)->o == IR_MIN ? CC_HI : CC_LO); - return; -#elif LJ_HASFFI - } else if ((ir-1)->o == IR_CONV) { - as->curins--; /* Always skip the CONV. */ - if (usehi || uselo) - asm_conv64(as, ir); - return; -#endif - } else if ((ir-1)->o == IR_XSTORE) { - if ((ir-1)->r != RID_SINK) - asm_xstore(as, ir, 4); - return; - } - if (!usehi) return; /* Skip unused hiword op for all remaining ops. */ - switch ((ir-1)->o) { -#if LJ_HASFFI - case IR_ADD: - as->curins--; - asm_intop(as, ir, ARMI_ADC); - asm_intop(as, ir-1, ARMI_ADD|ARMI_S); - break; - case IR_SUB: - as->curins--; - asm_intop(as, ir, ARMI_SBC); - asm_intop(as, ir-1, ARMI_SUB|ARMI_S); - break; - case IR_NEG: - as->curins--; - asm_intneg(as, ir, ARMI_RSC); - asm_intneg(as, ir-1, ARMI_RSB|ARMI_S); - break; -#endif -#if LJ_SOFTFP - case IR_SLOAD: case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: - case IR_STRTO: - if (!uselo) - ra_allocref(as, ir->op1, RSET_GPR); /* Mark lo op as used. */ - break; -#endif - case IR_CALLN: - case IR_CALLS: - case IR_CALLXS: - if (!uselo) - ra_allocref(as, ir->op1, RID2RSET(RID_RETLO)); /* Mark lo op as used. */ - break; -#if LJ_SOFTFP - case IR_ASTORE: case IR_HSTORE: case IR_USTORE: case IR_TOSTR: -#endif - case IR_CNEWI: - /* Nothing to do here. Handled by lo op itself. */ - break; - default: lua_assert(0); break; - } -#else - UNUSED(as); UNUSED(ir); lua_assert(0); -#endif -} - -/* -- Stack handling ------------------------------------------------------ */ - -/* Check Lua stack size for overflow. Use exit handler as fallback. */ -static void asm_stack_check(ASMState *as, BCReg topslot, - IRIns *irp, RegSet allow, ExitNo exitno) -{ - Reg pbase; - uint32_t k; - if (irp) { - if (!ra_hasspill(irp->s)) { - pbase = irp->r; - lua_assert(ra_hasreg(pbase)); - } else if (allow) { - pbase = rset_pickbot(allow); - } else { - pbase = RID_RET; - emit_lso(as, ARMI_LDR, RID_RET, RID_SP, 0); /* Restore temp. register. */ - } - } else { - pbase = RID_BASE; - } - emit_branch(as, ARMF_CC(ARMI_BL, CC_LS), exitstub_addr(as->J, exitno)); - k = emit_isk12(0, (int32_t)(8*topslot)); - lua_assert(k); - emit_n(as, ARMI_CMP^k, RID_TMP); - emit_dnm(as, ARMI_SUB, RID_TMP, RID_TMP, pbase); - emit_lso(as, ARMI_LDR, RID_TMP, RID_TMP, - (int32_t)offsetof(lua_State, maxstack)); - if (irp) { /* Must not spill arbitrary registers in head of side trace. */ - int32_t i = i32ptr(&J2G(as->J)->jit_L); - if (ra_hasspill(irp->s)) - emit_lso(as, ARMI_LDR, pbase, RID_SP, sps_scale(irp->s)); - emit_lso(as, ARMI_LDR, RID_TMP, RID_TMP, (i & 4095)); - if (ra_hasspill(irp->s) && !allow) - emit_lso(as, ARMI_STR, RID_RET, RID_SP, 0); /* Save temp. register. */ - emit_loadi(as, RID_TMP, (i & ~4095)); - } else { - emit_getgl(as, RID_TMP, jit_L); - } -} - -/* Restore Lua stack from on-trace state. */ -static void asm_stack_restore(ASMState *as, SnapShot *snap) -{ - SnapEntry *map = &as->T->snapmap[snap->mapofs]; - SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1]; - MSize n, nent = snap->nent; - /* Store the value of all modified slots to the Lua stack. */ - for (n = 0; n < nent; n++) { - SnapEntry sn = map[n]; - BCReg s = snap_slot(sn); - int32_t ofs = 8*((int32_t)s-1); - IRRef ref = snap_ref(sn); - IRIns *ir = IR(ref); - if ((sn & SNAP_NORESTORE)) - continue; - if (irt_isnum(ir->t)) { -#if LJ_SOFTFP - RegSet odd = rset_exclude(RSET_GPRODD, RID_BASE); - Reg tmp; - lua_assert(irref_isk(ref)); /* LJ_SOFTFP: must be a number constant. */ - tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.lo, - rset_exclude(RSET_GPREVEN, RID_BASE)); - emit_lso(as, ARMI_STR, tmp, RID_BASE, ofs); - if (rset_test(as->freeset, tmp+1)) odd = RID2RSET(tmp+1); - tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.hi, odd); - emit_lso(as, ARMI_STR, tmp, RID_BASE, ofs+4); -#else - Reg src = ra_alloc1(as, ref, RSET_FPR); - emit_vlso(as, ARMI_VSTR_D, src, RID_BASE, ofs); -#endif - } else { - RegSet odd = rset_exclude(RSET_GPRODD, RID_BASE); - Reg type; - lua_assert(irt_ispri(ir->t) || irt_isaddr(ir->t) || irt_isinteger(ir->t)); - if (!irt_ispri(ir->t)) { - Reg src = ra_alloc1(as, ref, rset_exclude(RSET_GPREVEN, RID_BASE)); - emit_lso(as, ARMI_STR, src, RID_BASE, ofs); - if (rset_test(as->freeset, src+1)) odd = RID2RSET(src+1); - } - if ((sn & (SNAP_CONT|SNAP_FRAME))) { - if (s == 0) continue; /* Do not overwrite link to previous frame. */ - type = ra_allock(as, (int32_t)(*flinks--), odd); -#if LJ_SOFTFP - } else if ((sn & SNAP_SOFTFPNUM)) { - type = ra_alloc1(as, ref+1, rset_exclude(RSET_GPRODD, RID_BASE)); -#endif - } else { - type = ra_allock(as, (int32_t)irt_toitype(ir->t), odd); - } - emit_lso(as, ARMI_STR, type, RID_BASE, ofs+4); - } - checkmclim(as); - } - lua_assert(map + nent == flinks); -} - -/* -- GC handling --------------------------------------------------------- */ - -/* Check GC threshold and do one or more GC steps. */ -static void asm_gc_check(ASMState *as) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_step_jit]; - IRRef args[2]; - MCLabel l_end; - Reg tmp1, tmp2; - ra_evictset(as, RSET_SCRATCH); - l_end = emit_label(as); - /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */ - asm_guardcc(as, CC_NE); /* Assumes asm_snap_prep() already done. */ - emit_n(as, ARMI_CMP|ARMI_K12|0, RID_RET); - args[0] = ASMREF_TMP1; /* global_State *g */ - args[1] = ASMREF_TMP2; /* MSize steps */ - asm_gencall(as, ci, args); - tmp1 = ra_releasetmp(as, ASMREF_TMP1); - tmp2 = ra_releasetmp(as, ASMREF_TMP2); - emit_loadi(as, tmp2, as->gcsteps); - /* Jump around GC step if GC total < GC threshold. */ - emit_branch(as, ARMF_CC(ARMI_B, CC_LS), l_end); - emit_nm(as, ARMI_CMP, RID_TMP, tmp2); - emit_lso(as, ARMI_LDR, tmp2, tmp1, - (int32_t)offsetof(global_State, gc.threshold)); - emit_lso(as, ARMI_LDR, RID_TMP, tmp1, - (int32_t)offsetof(global_State, gc.total)); - ra_allockreg(as, i32ptr(J2G(as->J)), tmp1); - as->gcsteps = 0; - checkmclim(as); -} - -/* -- Loop handling ------------------------------------------------------- */ - -/* Fixup the loop branch. */ -static void asm_loop_fixup(ASMState *as) -{ - MCode *p = as->mctop; - MCode *target = as->mcp; - if (as->loopinv) { /* Inverted loop branch? */ - /* asm_guardcc already inverted the bcc and patched the final bl. */ - p[-2] |= ((uint32_t)(target-p) & 0x00ffffffu); - } else { - p[-1] = ARMI_B | ((uint32_t)((target-p)-1) & 0x00ffffffu); - } -} - -/* -- Head of trace ------------------------------------------------------- */ - -/* Reload L register from g->jit_L. */ -static void asm_head_lreg(ASMState *as) -{ - IRIns *ir = IR(ASMREF_L); - if (ra_used(ir)) { - Reg r = ra_dest(as, ir, RSET_GPR); - emit_getgl(as, r, jit_L); - ra_evictk(as); - } -} - -/* Coalesce BASE register for a root trace. */ -static void asm_head_root_base(ASMState *as) -{ - IRIns *ir; - asm_head_lreg(as); - ir = IR(REF_BASE); - if (ra_hasreg(ir->r) && (rset_test(as->modset, ir->r) || irt_ismarked(ir->t))) - ra_spill(as, ir); - ra_destreg(as, ir, RID_BASE); -} - -/* Coalesce BASE register for a side trace. */ -static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow) -{ - IRIns *ir; - asm_head_lreg(as); - ir = IR(REF_BASE); - if (ra_hasreg(ir->r) && (rset_test(as->modset, ir->r) || irt_ismarked(ir->t))) - ra_spill(as, ir); - if (ra_hasspill(irp->s)) { - rset_clear(allow, ra_dest(as, ir, allow)); - } else { - Reg r = irp->r; - lua_assert(ra_hasreg(r)); - rset_clear(allow, r); - if (r != ir->r && !rset_test(as->freeset, r)) - ra_restore(as, regcost_ref(as->cost[r])); - ra_destreg(as, ir, r); - } - return allow; -} - -/* -- Tail of trace ------------------------------------------------------- */ - -/* Fixup the tail code. */ -static void asm_tail_fixup(ASMState *as, TraceNo lnk) -{ - MCode *p = as->mctop; - MCode *target; - int32_t spadj = as->T->spadjust; - if (spadj == 0) { - as->mctop = --p; - } else { - /* Patch stack adjustment. */ - uint32_t k = emit_isk12(ARMI_ADD, spadj); - lua_assert(k); - p[-2] = (ARMI_ADD^k) | ARMF_D(RID_SP) | ARMF_N(RID_SP); - } - /* Patch exit branch. */ - target = lnk ? traceref(as->J, lnk)->mcode : (MCode *)lj_vm_exit_interp; - p[-1] = ARMI_B|(((target-p)-1)&0x00ffffffu); -} - -/* Prepare tail of code. */ -static void asm_tail_prep(ASMState *as) -{ - MCode *p = as->mctop - 1; /* Leave room for exit branch. */ - if (as->loopref) { - as->invmcp = as->mcp = p; - } else { - as->mcp = p-1; /* Leave room for stack pointer adjustment. */ - as->invmcp = NULL; - } - *p = 0; /* Prevent load/store merging. */ -} - -/* -- Instruction dispatch ------------------------------------------------ */ - -/* Assemble a single instruction. */ -static void asm_ir(ASMState *as, IRIns *ir) -{ - switch ((IROp)ir->o) { - /* Miscellaneous ops. */ - case IR_LOOP: asm_loop(as); break; - case IR_NOP: case IR_XBAR: lua_assert(!ra_used(ir)); break; - case IR_USE: - ra_alloc1(as, ir->op1, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); break; - case IR_PHI: asm_phi(as, ir); break; - case IR_HIOP: asm_hiop(as, ir); break; - case IR_GCSTEP: asm_gcstep(as, ir); break; - - /* Guarded assertions. */ - case IR_EQ: case IR_NE: - if ((ir-1)->o == IR_HREF && ir->op1 == as->curins-1) { - as->curins--; - asm_href(as, ir-1, (IROp)ir->o); - break; - } - /* fallthrough */ - case IR_LT: case IR_GE: case IR_LE: case IR_GT: - case IR_ULT: case IR_UGE: case IR_ULE: case IR_UGT: - case IR_ABC: -#if !LJ_SOFTFP - if (irt_isnum(ir->t)) { asm_fpcomp(as, ir); break; } -#endif - asm_intcomp(as, ir); - break; - - case IR_RETF: asm_retf(as, ir); break; - - /* Bit ops. */ - case IR_BNOT: asm_bitop(as, ir, ARMI_MVN); break; - case IR_BSWAP: asm_bitswap(as, ir); break; - - case IR_BAND: asm_bitop(as, ir, ARMI_AND); break; - case IR_BOR: asm_bitop(as, ir, ARMI_ORR); break; - case IR_BXOR: asm_bitop(as, ir, ARMI_EOR); break; - - case IR_BSHL: asm_bitshift(as, ir, ARMSH_LSL); break; - case IR_BSHR: asm_bitshift(as, ir, ARMSH_LSR); break; - case IR_BSAR: asm_bitshift(as, ir, ARMSH_ASR); break; - case IR_BROR: asm_bitshift(as, ir, ARMSH_ROR); break; - case IR_BROL: lua_assert(0); break; - - /* Arithmetic ops. */ - case IR_ADD: case IR_ADDOV: asm_add(as, ir); break; - case IR_SUB: case IR_SUBOV: asm_sub(as, ir); break; - case IR_MUL: case IR_MULOV: asm_mul(as, ir); break; - case IR_MOD: asm_callid(as, ir, IRCALL_lj_vm_modi); break; - case IR_NEG: asm_neg(as, ir); break; - -#if LJ_SOFTFP - case IR_DIV: case IR_POW: case IR_ABS: - case IR_ATAN2: case IR_LDEXP: case IR_FPMATH: case IR_TOBIT: - lua_assert(0); /* Unused for LJ_SOFTFP. */ - break; -#else - case IR_DIV: asm_fparith(as, ir, ARMI_VDIV_D); break; - case IR_POW: asm_callid(as, ir, IRCALL_lj_vm_powi); break; - case IR_ABS: asm_fpunary(as, ir, ARMI_VABS_D); break; - case IR_ATAN2: asm_callid(as, ir, IRCALL_atan2); break; - case IR_LDEXP: asm_callid(as, ir, IRCALL_ldexp); break; - case IR_FPMATH: - if (ir->op2 == IRFPM_EXP2 && asm_fpjoin_pow(as, ir)) - break; - if (ir->op2 <= IRFPM_TRUNC) - asm_callround(as, ir, ir->op2); - else if (ir->op2 == IRFPM_SQRT) - asm_fpunary(as, ir, ARMI_VSQRT_D); - else - asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2); - break; - case IR_TOBIT: asm_tobit(as, ir); break; -#endif - - case IR_MIN: asm_min_max(as, ir, CC_GT, CC_HI); break; - case IR_MAX: asm_min_max(as, ir, CC_LT, CC_LO); break; - - /* Memory references. */ - case IR_AREF: asm_aref(as, ir); break; - case IR_HREF: asm_href(as, ir, 0); break; - case IR_HREFK: asm_hrefk(as, ir); break; - case IR_NEWREF: asm_newref(as, ir); break; - case IR_UREFO: case IR_UREFC: asm_uref(as, ir); break; - case IR_FREF: asm_fref(as, ir); break; - case IR_STRREF: asm_strref(as, ir); break; - - /* Loads and stores. */ - case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: - asm_ahuvload(as, ir); - break; - case IR_FLOAD: asm_fload(as, ir); break; - case IR_XLOAD: asm_xload(as, ir); break; - case IR_SLOAD: asm_sload(as, ir); break; - - case IR_ASTORE: case IR_HSTORE: case IR_USTORE: asm_ahustore(as, ir); break; - case IR_FSTORE: asm_fstore(as, ir); break; - case IR_XSTORE: asm_xstore(as, ir, 0); break; - - /* Allocations. */ - case IR_SNEW: case IR_XSNEW: asm_snew(as, ir); break; - case IR_TNEW: asm_tnew(as, ir); break; - case IR_TDUP: asm_tdup(as, ir); break; - case IR_CNEW: case IR_CNEWI: asm_cnew(as, ir); break; - - /* Write barriers. */ - case IR_TBAR: asm_tbar(as, ir); break; - case IR_OBAR: asm_obar(as, ir); break; - - /* Type conversions. */ - case IR_CONV: asm_conv(as, ir); break; - case IR_TOSTR: asm_tostr(as, ir); break; - case IR_STRTO: asm_strto(as, ir); break; - - /* Calls. */ - case IR_CALLN: case IR_CALLL: case IR_CALLS: asm_call(as, ir); break; - case IR_CALLXS: asm_callx(as, ir); break; - case IR_CARG: break; - - default: - setintV(&as->J->errinfo, ir->o); - lj_trace_err_info(as->J, LJ_TRERR_NYIIR); - break; - } -} - -/* -- Trace setup --------------------------------------------------------- */ - -/* Ensure there are enough stack slots for call arguments. */ -static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci) -{ - IRRef args[CCI_NARGS_MAX*2]; - uint32_t i, nargs = (int)CCI_NARGS(ci); - int nslots = 0, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR, fprodd = 0; - asm_collectargs(as, ir, ci, args); - for (i = 0; i < nargs; i++) { - if (!LJ_SOFTFP && args[i] && irt_isfp(IR(args[i])->t)) { - if (!LJ_ABI_SOFTFP && !(ci->flags & CCI_VARARG)) { - if (irt_isnum(IR(args[i])->t)) { - if (nfpr > 0) nfpr--; - else fprodd = 0, nslots = (nslots + 3) & ~1; - } else { - if (fprodd) fprodd--; - else if (nfpr > 0) fprodd = 1, nfpr--; - else nslots++; - } - } else if (irt_isnum(IR(args[i])->t)) { - ngpr &= ~1; - if (ngpr > 0) ngpr -= 2; else nslots += 2; - } else { - if (ngpr > 0) ngpr--; else nslots++; - } - } else { - if (ngpr > 0) ngpr--; else nslots++; - } - } - if (nslots > as->evenspill) /* Leave room for args in stack slots. */ - as->evenspill = nslots; - return REGSP_HINT(RID_RET); -} - -static void asm_setup_target(ASMState *as) -{ - /* May need extra exit for asm_stack_check on side traces. */ - asm_exitstub_setup(as, as->T->nsnap + (as->parent ? 1 : 0)); -} - -/* -- Trace patching ------------------------------------------------------ */ - -/* Patch exit jumps of existing machine code to a new target. */ -void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target) -{ - MCode *p = T->mcode; - MCode *pe = (MCode *)((char *)p + T->szmcode); - MCode *cstart = NULL, *cend = p; - MCode *mcarea = lj_mcode_patch(J, p, 0); - MCode *px = exitstub_addr(J, exitno) - 2; - for (; p < pe; p++) { - /* Look for bl_cc exitstub, replace with b_cc target. */ - uint32_t ins = *p; - if ((ins & 0x0f000000u) == 0x0b000000u && ins < 0xf0000000u && - ((ins ^ (px-p)) & 0x00ffffffu) == 0) { - *p = (ins & 0xfe000000u) | (((target-p)-2) & 0x00ffffffu); - cend = p+1; - if (!cstart) cstart = p; - } - } - lua_assert(cstart != NULL); - lj_mcode_sync(cstart, cend); - lj_mcode_patch(J, mcarea, 1); -} - diff --git a/subprojects/luajit/src/lj_asm_mips.h b/subprojects/luajit/src/lj_asm_mips.h deleted file mode 100644 index 03270ccaa..000000000 --- a/subprojects/luajit/src/lj_asm_mips.h +++ /dev/null @@ -1,1972 +0,0 @@ -/* -** MIPS IR assembler (SSA IR -> machine code). -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -/* -- Register allocator extensions --------------------------------------- */ - -/* Allocate a register with a hint. */ -static Reg ra_hintalloc(ASMState *as, IRRef ref, Reg hint, RegSet allow) -{ - Reg r = IR(ref)->r; - if (ra_noreg(r)) { - if (!ra_hashint(r) && !iscrossref(as, ref)) - ra_sethint(IR(ref)->r, hint); /* Propagate register hint. */ - r = ra_allocref(as, ref, allow); - } - ra_noweak(as, r); - return r; -} - -/* Allocate a register or RID_ZERO. */ -static Reg ra_alloc1z(ASMState *as, IRRef ref, RegSet allow) -{ - Reg r = IR(ref)->r; - if (ra_noreg(r)) { - if (!(allow & RSET_FPR) && irref_isk(ref) && IR(ref)->i == 0) - return RID_ZERO; - r = ra_allocref(as, ref, allow); - } else { - ra_noweak(as, r); - } - return r; -} - -/* Allocate two source registers for three-operand instructions. */ -static Reg ra_alloc2(ASMState *as, IRIns *ir, RegSet allow) -{ - IRIns *irl = IR(ir->op1), *irr = IR(ir->op2); - Reg left = irl->r, right = irr->r; - if (ra_hasreg(left)) { - ra_noweak(as, left); - if (ra_noreg(right)) - right = ra_alloc1z(as, ir->op2, rset_exclude(allow, left)); - else - ra_noweak(as, right); - } else if (ra_hasreg(right)) { - ra_noweak(as, right); - left = ra_alloc1z(as, ir->op1, rset_exclude(allow, right)); - } else if (ra_hashint(right)) { - right = ra_alloc1z(as, ir->op2, allow); - left = ra_alloc1z(as, ir->op1, rset_exclude(allow, right)); - } else { - left = ra_alloc1z(as, ir->op1, allow); - right = ra_alloc1z(as, ir->op2, rset_exclude(allow, left)); - } - return left | (right << 8); -} - -/* -- Guard handling ------------------------------------------------------ */ - -/* Need some spare long-range jump slots, for out-of-range branches. */ -#define MIPS_SPAREJUMP 4 - -/* Setup spare long-range jump slots per mcarea. */ -static void asm_sparejump_setup(ASMState *as) -{ - MCode *mxp = as->mcbot; - /* Assumes sizeof(MCLink) == 8. */ - if (((uintptr_t)mxp & (LJ_PAGESIZE-1)) == 8) { - lua_assert(MIPSI_NOP == 0); - memset(mxp+2, 0, MIPS_SPAREJUMP*8); - mxp += MIPS_SPAREJUMP*2; - lua_assert(mxp < as->mctop); - lj_mcode_sync(as->mcbot, mxp); - lj_mcode_commitbot(as->J, mxp); - as->mcbot = mxp; - as->mclim = as->mcbot + MCLIM_REDZONE; - } -} - -/* Setup exit stub after the end of each trace. */ -static void asm_exitstub_setup(ASMState *as) -{ - MCode *mxp = as->mctop; - /* sw TMP, 0(sp); j ->vm_exit_handler; li TMP, traceno */ - *--mxp = MIPSI_LI|MIPSF_T(RID_TMP)|as->T->traceno; - *--mxp = MIPSI_J|((((uintptr_t)(void *)lj_vm_exit_handler)>>2)&0x03ffffffu); - lua_assert(((uintptr_t)mxp ^ (uintptr_t)(void *)lj_vm_exit_handler)>>28 == 0); - *--mxp = MIPSI_SW|MIPSF_T(RID_TMP)|MIPSF_S(RID_SP)|0; - as->mctop = mxp; -} - -/* Keep this in-sync with exitstub_trace_addr(). */ -#define asm_exitstub_addr(as) ((as)->mctop) - -/* Emit conditional branch to exit for guard. */ -static void asm_guard(ASMState *as, MIPSIns mi, Reg rs, Reg rt) -{ - MCode *target = asm_exitstub_addr(as); - MCode *p = as->mcp; - if (LJ_UNLIKELY(p == as->invmcp)) { - as->invmcp = NULL; - as->loopinv = 1; - as->mcp = p+1; - mi = mi ^ ((mi>>28) == 1 ? 0x04000000u : 0x00010000u); /* Invert cond. */ - target = p; /* Patch target later in asm_loop_fixup. */ - } - emit_ti(as, MIPSI_LI, RID_TMP, as->snapno); - emit_branch(as, mi, rs, rt, target); -} - -/* -- Operand fusion ------------------------------------------------------ */ - -/* Limit linear search to this distance. Avoids O(n^2) behavior. */ -#define CONFLICT_SEARCH_LIM 31 - -/* Check if there's no conflicting instruction between curins and ref. */ -static int noconflict(ASMState *as, IRRef ref, IROp conflict) -{ - IRIns *ir = as->ir; - IRRef i = as->curins; - if (i > ref + CONFLICT_SEARCH_LIM) - return 0; /* Give up, ref is too far away. */ - while (--i > ref) - if (ir[i].o == conflict) - return 0; /* Conflict found. */ - return 1; /* Ok, no conflict. */ -} - -/* Fuse the array base of colocated arrays. */ -static int32_t asm_fuseabase(ASMState *as, IRRef ref) -{ - IRIns *ir = IR(ref); - if (ir->o == IR_TNEW && ir->op1 <= LJ_MAX_COLOSIZE && - !neverfuse(as) && noconflict(as, ref, IR_NEWREF)) - return (int32_t)sizeof(GCtab); - return 0; -} - -/* Fuse array/hash/upvalue reference into register+offset operand. */ -static Reg asm_fuseahuref(ASMState *as, IRRef ref, int32_t *ofsp, RegSet allow) -{ - IRIns *ir = IR(ref); - if (ra_noreg(ir->r)) { - if (ir->o == IR_AREF) { - if (mayfuse(as, ref)) { - if (irref_isk(ir->op2)) { - IRRef tab = IR(ir->op1)->op1; - int32_t ofs = asm_fuseabase(as, tab); - IRRef refa = ofs ? tab : ir->op1; - ofs += 8*IR(ir->op2)->i; - if (checki16(ofs)) { - *ofsp = ofs; - return ra_alloc1(as, refa, allow); - } - } - } - } else if (ir->o == IR_HREFK) { - if (mayfuse(as, ref)) { - int32_t ofs = (int32_t)(IR(ir->op2)->op2 * sizeof(Node)); - if (checki16(ofs)) { - *ofsp = ofs; - return ra_alloc1(as, ir->op1, allow); - } - } - } else if (ir->o == IR_UREFC) { - if (irref_isk(ir->op1)) { - GCfunc *fn = ir_kfunc(IR(ir->op1)); - int32_t ofs = i32ptr(&gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.tv); - int32_t jgl = (intptr_t)J2G(as->J); - if ((uint32_t)(ofs-jgl) < 65536) { - *ofsp = ofs-jgl-32768; - return RID_JGL; - } else { - *ofsp = (int16_t)ofs; - return ra_allock(as, ofs-(int16_t)ofs, allow); - } - } - } - } - *ofsp = 0; - return ra_alloc1(as, ref, allow); -} - -/* Fuse XLOAD/XSTORE reference into load/store operand. */ -static void asm_fusexref(ASMState *as, MIPSIns mi, Reg rt, IRRef ref, - RegSet allow, int32_t ofs) -{ - IRIns *ir = IR(ref); - Reg base; - if (ra_noreg(ir->r) && canfuse(as, ir)) { - if (ir->o == IR_ADD) { - int32_t ofs2; - if (irref_isk(ir->op2) && (ofs2 = ofs + IR(ir->op2)->i, checki16(ofs2))) { - ref = ir->op1; - ofs = ofs2; - } - } else if (ir->o == IR_STRREF) { - int32_t ofs2 = 65536; - lua_assert(ofs == 0); - ofs = (int32_t)sizeof(GCstr); - if (irref_isk(ir->op2)) { - ofs2 = ofs + IR(ir->op2)->i; - ref = ir->op1; - } else if (irref_isk(ir->op1)) { - ofs2 = ofs + IR(ir->op1)->i; - ref = ir->op2; - } - if (!checki16(ofs2)) { - /* NYI: Fuse ADD with constant. */ - Reg right, left = ra_alloc2(as, ir, allow); - right = (left >> 8); left &= 255; - emit_hsi(as, mi, rt, RID_TMP, ofs); - emit_dst(as, MIPSI_ADDU, RID_TMP, left, right); - return; - } - ofs = ofs2; - } - } - base = ra_alloc1(as, ref, allow); - emit_hsi(as, mi, rt, base, ofs); -} - -/* -- Calls --------------------------------------------------------------- */ - -/* Generate a call to a C function. */ -static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args) -{ - uint32_t n, nargs = CCI_NARGS(ci); - int32_t ofs = 16; - Reg gpr, fpr = REGARG_FIRSTFPR; - if ((void *)ci->func) - emit_call(as, (void *)ci->func); - for (gpr = REGARG_FIRSTGPR; gpr <= REGARG_LASTGPR; gpr++) - as->cost[gpr] = REGCOST(~0u, ASMREF_L); - gpr = REGARG_FIRSTGPR; - for (n = 0; n < nargs; n++) { /* Setup args. */ - IRRef ref = args[n]; - if (ref) { - IRIns *ir = IR(ref); - if (irt_isfp(ir->t) && fpr <= REGARG_LASTFPR && - !(ci->flags & CCI_VARARG)) { - lua_assert(rset_test(as->freeset, fpr)); /* Already evicted. */ - ra_leftov(as, fpr, ref); - fpr += 2; - gpr += irt_isnum(ir->t) ? 2 : 1; - } else { - fpr = REGARG_LASTFPR+1; - if (irt_isnum(ir->t)) gpr = (gpr+1) & ~1; - if (gpr <= REGARG_LASTGPR) { - lua_assert(rset_test(as->freeset, gpr)); /* Already evicted. */ - if (irt_isfp(ir->t)) { - RegSet of = as->freeset; - Reg r; - /* Workaround to protect argument GPRs from being used for remat. */ - as->freeset &= ~RSET_RANGE(REGARG_FIRSTGPR, REGARG_LASTGPR+1); - r = ra_alloc1(as, ref, RSET_FPR); - as->freeset |= (of & RSET_RANGE(REGARG_FIRSTGPR, REGARG_LASTGPR+1)); - if (irt_isnum(ir->t)) { - emit_tg(as, MIPSI_MFC1, gpr+(LJ_BE?0:1), r+1); - emit_tg(as, MIPSI_MFC1, gpr+(LJ_BE?1:0), r); - lua_assert(rset_test(as->freeset, gpr+1)); /* Already evicted. */ - gpr += 2; - } else if (irt_isfloat(ir->t)) { - emit_tg(as, MIPSI_MFC1, gpr, r); - gpr++; - } - } else { - ra_leftov(as, gpr, ref); - gpr++; - } - } else { - Reg r = ra_alloc1z(as, ref, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); - if (irt_isnum(ir->t)) ofs = (ofs + 4) & ~4; - emit_spstore(as, ir, r, ofs); - ofs += irt_isnum(ir->t) ? 8 : 4; - } - } - } else { - fpr = REGARG_LASTFPR+1; - if (gpr <= REGARG_LASTGPR) - gpr++; - else - ofs += 4; - } - checkmclim(as); - } -} - -/* Setup result reg/sp for call. Evict scratch regs. */ -static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci) -{ - RegSet drop = RSET_SCRATCH; - int hiop = ((ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t)); - if ((ci->flags & CCI_NOFPRCLOBBER)) - drop &= ~RSET_FPR; - if (ra_hasreg(ir->r)) - rset_clear(drop, ir->r); /* Dest reg handled below. */ - if (hiop && ra_hasreg((ir+1)->r)) - rset_clear(drop, (ir+1)->r); /* Dest reg handled below. */ - ra_evictset(as, drop); /* Evictions must be performed first. */ - if (ra_used(ir)) { - lua_assert(!irt_ispri(ir->t)); - if (irt_isfp(ir->t)) { - if ((ci->flags & CCI_CASTU64)) { - int32_t ofs = sps_scale(ir->s); - Reg dest = ir->r; - if (ra_hasreg(dest)) { - ra_free(as, dest); - ra_modified(as, dest); - emit_tg(as, MIPSI_MTC1, RID_RETHI, dest+1); - emit_tg(as, MIPSI_MTC1, RID_RETLO, dest); - } - if (ofs) { - emit_tsi(as, MIPSI_SW, RID_RETLO, RID_SP, ofs+(LJ_BE?4:0)); - emit_tsi(as, MIPSI_SW, RID_RETHI, RID_SP, ofs+(LJ_BE?0:4)); - } - } else { - ra_destreg(as, ir, RID_FPRET); - } - } else if (hiop) { - ra_destpair(as, ir); - } else { - ra_destreg(as, ir, RID_RET); - } - } -} - -static void asm_call(ASMState *as, IRIns *ir) -{ - IRRef args[CCI_NARGS_MAX]; - const CCallInfo *ci = &lj_ir_callinfo[ir->op2]; - asm_collectargs(as, ir, ci, args); - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); -} - -static void asm_callx(ASMState *as, IRIns *ir) -{ - IRRef args[CCI_NARGS_MAX*2]; - CCallInfo ci; - IRRef func; - IRIns *irf; - ci.flags = asm_callx_flags(as, ir); - asm_collectargs(as, ir, &ci, args); - asm_setupresult(as, ir, &ci); - func = ir->op2; irf = IR(func); - if (irf->o == IR_CARG) { func = irf->op1; irf = IR(func); } - if (irref_isk(func)) { /* Call to constant address. */ - ci.func = (ASMFunction)(void *)(irf->i); - } else { /* Need specific register for indirect calls. */ - Reg r = ra_alloc1(as, func, RID2RSET(RID_CFUNCADDR)); - MCode *p = as->mcp; - if (r == RID_CFUNCADDR) - *--p = MIPSI_NOP; - else - *--p = MIPSI_MOVE | MIPSF_D(RID_CFUNCADDR) | MIPSF_S(r); - *--p = MIPSI_JALR | MIPSF_S(r); - as->mcp = p; - ci.func = (ASMFunction)(void *)0; - } - asm_gencall(as, &ci, args); -} - -static void asm_callid(ASMState *as, IRIns *ir, IRCallID id) -{ - const CCallInfo *ci = &lj_ir_callinfo[id]; - IRRef args[2]; - args[0] = ir->op1; - args[1] = ir->op2; - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); -} - -static void asm_callround(ASMState *as, IRIns *ir, IRCallID id) -{ - /* The modified regs must match with the *.dasc implementation. */ - RegSet drop = RID2RSET(RID_R1)|RID2RSET(RID_R12)|RID2RSET(RID_FPRET)| - RID2RSET(RID_F2)|RID2RSET(RID_F4)|RID2RSET(REGARG_FIRSTFPR); - if (ra_hasreg(ir->r)) rset_clear(drop, ir->r); - ra_evictset(as, drop); - ra_destreg(as, ir, RID_FPRET); - emit_call(as, (void *)lj_ir_callinfo[id].func); - ra_leftov(as, REGARG_FIRSTFPR, ir->op1); -} - -/* -- Returns ------------------------------------------------------------- */ - -/* Return to lower frame. Guard that it goes to the right spot. */ -static void asm_retf(ASMState *as, IRIns *ir) -{ - Reg base = ra_alloc1(as, REF_BASE, RSET_GPR); - void *pc = ir_kptr(IR(ir->op2)); - int32_t delta = 1+bc_a(*((const BCIns *)pc - 1)); - as->topslot -= (BCReg)delta; - if ((int32_t)as->topslot < 0) as->topslot = 0; - irt_setmark(IR(REF_BASE)->t); /* Children must not coalesce with BASE reg. */ - emit_setgl(as, base, jit_base); - emit_addptr(as, base, -8*delta); - asm_guard(as, MIPSI_BNE, RID_TMP, - ra_allock(as, i32ptr(pc), rset_exclude(RSET_GPR, base))); - emit_tsi(as, MIPSI_LW, RID_TMP, base, -8); -} - -/* -- Type conversions ---------------------------------------------------- */ - -static void asm_tointg(ASMState *as, IRIns *ir, Reg left) -{ - Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, left)); - Reg dest = ra_dest(as, ir, RSET_GPR); - asm_guard(as, MIPSI_BC1F, 0, 0); - emit_fgh(as, MIPSI_C_EQ_D, 0, tmp, left); - emit_fg(as, MIPSI_CVT_D_W, tmp, tmp); - emit_tg(as, MIPSI_MFC1, dest, tmp); - emit_fg(as, MIPSI_CVT_W_D, tmp, left); -} - -static void asm_tobit(ASMState *as, IRIns *ir) -{ - RegSet allow = RSET_FPR; - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_alloc1(as, ir->op1, allow); - Reg right = ra_alloc1(as, ir->op2, rset_clear(allow, left)); - Reg tmp = ra_scratch(as, rset_clear(allow, right)); - emit_tg(as, MIPSI_MFC1, dest, tmp); - emit_fgh(as, MIPSI_ADD_D, tmp, left, right); -} - -static void asm_conv(ASMState *as, IRIns *ir) -{ - IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK); - int stfp = (st == IRT_NUM || st == IRT_FLOAT); - IRRef lref = ir->op1; - lua_assert(irt_type(ir->t) != st); - lua_assert(!(irt_isint64(ir->t) || - (st == IRT_I64 || st == IRT_U64))); /* Handled by SPLIT. */ - if (irt_isfp(ir->t)) { - Reg dest = ra_dest(as, ir, RSET_FPR); - if (stfp) { /* FP to FP conversion. */ - emit_fg(as, st == IRT_NUM ? MIPSI_CVT_S_D : MIPSI_CVT_D_S, - dest, ra_alloc1(as, lref, RSET_FPR)); - } else if (st == IRT_U32) { /* U32 to FP conversion. */ - /* y = (x ^ 0x8000000) + 2147483648.0 */ - Reg left = ra_alloc1(as, lref, RSET_GPR); - Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, dest)); - if (irt_isfloat(ir->t)) - emit_fg(as, MIPSI_CVT_S_D, dest, dest); - /* Must perform arithmetic with doubles to keep the precision. */ - emit_fgh(as, MIPSI_ADD_D, dest, dest, tmp); - emit_fg(as, MIPSI_CVT_D_W, dest, dest); - emit_lsptr(as, MIPSI_LDC1, (tmp & 31), - (void *)lj_ir_k64_find(as->J, U64x(41e00000,00000000)), - RSET_GPR); - emit_tg(as, MIPSI_MTC1, RID_TMP, dest); - emit_dst(as, MIPSI_XOR, RID_TMP, RID_TMP, left); - emit_ti(as, MIPSI_LUI, RID_TMP, 0x8000); - } else { /* Integer to FP conversion. */ - Reg left = ra_alloc1(as, lref, RSET_GPR); - emit_fg(as, irt_isfloat(ir->t) ? MIPSI_CVT_S_W : MIPSI_CVT_D_W, - dest, dest); - emit_tg(as, MIPSI_MTC1, left, dest); - } - } else if (stfp) { /* FP to integer conversion. */ - if (irt_isguard(ir->t)) { - /* Checked conversions are only supported from number to int. */ - lua_assert(irt_isint(ir->t) && st == IRT_NUM); - asm_tointg(as, ir, ra_alloc1(as, lref, RSET_FPR)); - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_alloc1(as, lref, RSET_FPR); - Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, left)); - if (irt_isu32(ir->t)) { - /* y = (int)floor(x - 2147483648.0) ^ 0x80000000 */ - emit_dst(as, MIPSI_XOR, dest, dest, RID_TMP); - emit_ti(as, MIPSI_LUI, RID_TMP, 0x8000); - emit_tg(as, MIPSI_MFC1, dest, tmp); - emit_fg(as, st == IRT_FLOAT ? MIPSI_FLOOR_W_S : MIPSI_FLOOR_W_D, - tmp, tmp); - emit_fgh(as, st == IRT_FLOAT ? MIPSI_SUB_S : MIPSI_SUB_D, - tmp, left, tmp); - if (st == IRT_FLOAT) - emit_lsptr(as, MIPSI_LWC1, (tmp & 31), - (void *)lj_ir_k64_find(as->J, U64x(4f000000,4f000000)), - RSET_GPR); - else - emit_lsptr(as, MIPSI_LDC1, (tmp & 31), - (void *)lj_ir_k64_find(as->J, U64x(41e00000,00000000)), - RSET_GPR); - } else { - emit_tg(as, MIPSI_MFC1, dest, tmp); - emit_fg(as, st == IRT_FLOAT ? MIPSI_TRUNC_W_S : MIPSI_TRUNC_W_D, - tmp, left); - } - } - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - if (st >= IRT_I8 && st <= IRT_U16) { /* Extend to 32 bit integer. */ - Reg left = ra_alloc1(as, ir->op1, RSET_GPR); - lua_assert(irt_isint(ir->t) || irt_isu32(ir->t)); - if ((ir->op2 & IRCONV_SEXT)) { - if ((as->flags & JIT_F_MIPS32R2)) { - emit_dst(as, st == IRT_I8 ? MIPSI_SEB : MIPSI_SEH, dest, 0, left); - } else { - uint32_t shift = st == IRT_I8 ? 24 : 16; - emit_dta(as, MIPSI_SRA, dest, dest, shift); - emit_dta(as, MIPSI_SLL, dest, left, shift); - } - } else { - emit_tsi(as, MIPSI_ANDI, dest, left, - (int32_t)(st == IRT_U8 ? 0xff : 0xffff)); - } - } else { /* 32/64 bit integer conversions. */ - /* Only need to handle 32/32 bit no-op (cast) on 32 bit archs. */ - ra_leftov(as, dest, lref); /* Do nothing, but may need to move regs. */ - } - } -} - -#if LJ_HASFFI -static void asm_conv64(ASMState *as, IRIns *ir) -{ - IRType st = (IRType)((ir-1)->op2 & IRCONV_SRCMASK); - IRType dt = (((ir-1)->op2 & IRCONV_DSTMASK) >> IRCONV_DSH); - IRCallID id; - const CCallInfo *ci; - IRRef args[2]; - args[LJ_BE?0:1] = ir->op1; - args[LJ_BE?1:0] = (ir-1)->op1; - if (st == IRT_NUM || st == IRT_FLOAT) { - id = IRCALL_fp64_d2l + ((st == IRT_FLOAT) ? 2 : 0) + (dt - IRT_I64); - ir--; - } else { - id = IRCALL_fp64_l2d + ((dt == IRT_FLOAT) ? 2 : 0) + (st - IRT_I64); - } - ci = &lj_ir_callinfo[id]; - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); -} -#endif - -static void asm_strto(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num]; - IRRef args[2]; - RegSet drop = RSET_SCRATCH; - if (ra_hasreg(ir->r)) rset_set(drop, ir->r); /* Spill dest reg (if any). */ - ra_evictset(as, drop); - asm_guard(as, MIPSI_BEQ, RID_RET, RID_ZERO); /* Test return status. */ - args[0] = ir->op1; /* GCstr *str */ - args[1] = ASMREF_TMP1; /* TValue *n */ - asm_gencall(as, ci, args); - /* Store the result to the spill slot or temp slots. */ - emit_tsi(as, MIPSI_ADDIU, ra_releasetmp(as, ASMREF_TMP1), - RID_SP, sps_scale(ir->s)); -} - -/* Get pointer to TValue. */ -static void asm_tvptr(ASMState *as, Reg dest, IRRef ref) -{ - IRIns *ir = IR(ref); - if (irt_isnum(ir->t)) { - if (irref_isk(ref)) /* Use the number constant itself as a TValue. */ - ra_allockreg(as, i32ptr(ir_knum(ir)), dest); - else /* Otherwise force a spill and use the spill slot. */ - emit_tsi(as, MIPSI_ADDIU, dest, RID_SP, ra_spill(as, ir)); - } else { - /* Otherwise use g->tmptv to hold the TValue. */ - RegSet allow = rset_exclude(RSET_GPR, dest); - Reg type; - emit_tsi(as, MIPSI_ADDIU, dest, RID_JGL, offsetof(global_State, tmptv)-32768); - if (!irt_ispri(ir->t)) { - Reg src = ra_alloc1(as, ref, allow); - emit_setgl(as, src, tmptv.gcr); - } - type = ra_allock(as, irt_toitype(ir->t), allow); - emit_setgl(as, type, tmptv.it); - } -} - -static void asm_tostr(ASMState *as, IRIns *ir) -{ - IRRef args[2]; - args[0] = ASMREF_L; - as->gcsteps++; - if (irt_isnum(IR(ir->op1)->t) || (ir+1)->o == IR_HIOP) { - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromnum]; - args[1] = ASMREF_TMP1; /* const lua_Number * */ - asm_setupresult(as, ir, ci); /* GCstr * */ - asm_gencall(as, ci, args); - asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op1); - } else { - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromint]; - args[1] = ir->op1; /* int32_t k */ - asm_setupresult(as, ir, ci); /* GCstr * */ - asm_gencall(as, ci, args); - } -} - -/* -- Memory references --------------------------------------------------- */ - -static void asm_aref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg idx, base; - if (irref_isk(ir->op2)) { - IRRef tab = IR(ir->op1)->op1; - int32_t ofs = asm_fuseabase(as, tab); - IRRef refa = ofs ? tab : ir->op1; - ofs += 8*IR(ir->op2)->i; - if (checki16(ofs)) { - base = ra_alloc1(as, refa, RSET_GPR); - emit_tsi(as, MIPSI_ADDIU, dest, base, ofs); - return; - } - } - base = ra_alloc1(as, ir->op1, RSET_GPR); - idx = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, base)); - emit_dst(as, MIPSI_ADDU, dest, RID_TMP, base); - emit_dta(as, MIPSI_SLL, RID_TMP, idx, 3); -} - -/* Inlined hash lookup. Specialized for key type and for const keys. -** The equivalent C code is: -** Node *n = hashkey(t, key); -** do { -** if (lj_obj_equal(&n->key, key)) return &n->val; -** } while ((n = nextnode(n))); -** return niltv(L); -*/ -static void asm_href(ASMState *as, IRIns *ir) -{ - RegSet allow = RSET_GPR; - int destused = ra_used(ir); - Reg dest = ra_dest(as, ir, allow); - Reg tab = ra_alloc1(as, ir->op1, rset_clear(allow, dest)); - Reg key = RID_NONE, type = RID_NONE, tmpnum = RID_NONE, tmp1 = RID_TMP, tmp2; - IRRef refkey = ir->op2; - IRIns *irkey = IR(refkey); - IRType1 kt = irkey->t; - uint32_t khash; - MCLabel l_end, l_loop, l_next; - - rset_clear(allow, tab); - if (irt_isnum(kt)) { - key = ra_alloc1(as, refkey, RSET_FPR); - tmpnum = ra_scratch(as, rset_exclude(RSET_FPR, key)); - } else if (!irt_ispri(kt)) { - key = ra_alloc1(as, refkey, allow); - rset_clear(allow, key); - type = ra_allock(as, irt_toitype(irkey->t), allow); - rset_clear(allow, type); - } - tmp2 = ra_scratch(as, allow); - rset_clear(allow, tmp2); - - /* Key not found in chain: load niltv. */ - l_end = emit_label(as); - if (destused) - emit_loada(as, dest, niltvg(J2G(as->J))); - else - *--as->mcp = MIPSI_NOP; - /* Follow hash chain until the end. */ - emit_move(as, dest, tmp1); - l_loop = --as->mcp; - emit_tsi(as, MIPSI_LW, tmp1, dest, (int32_t)offsetof(Node, next)); - l_next = emit_label(as); - - /* Type and value comparison. */ - if (irt_isnum(kt)) { - emit_branch(as, MIPSI_BC1T, 0, 0, l_end); - emit_fgh(as, MIPSI_C_EQ_D, 0, tmpnum, key); - emit_tg(as, MIPSI_MFC1, tmp1, key+1); - emit_branch(as, MIPSI_BEQ, tmp1, RID_ZERO, l_next); - emit_tsi(as, MIPSI_SLTIU, tmp1, tmp1, (int32_t)LJ_TISNUM); - emit_hsi(as, MIPSI_LDC1, tmpnum, dest, (int32_t)offsetof(Node, key.n)); - } else { - if (irt_ispri(kt)) { - emit_branch(as, MIPSI_BEQ, tmp1, type, l_end); - } else { - emit_branch(as, MIPSI_BEQ, tmp2, key, l_end); - emit_tsi(as, MIPSI_LW, tmp2, dest, (int32_t)offsetof(Node, key.gcr)); - emit_branch(as, MIPSI_BNE, tmp1, type, l_next); - } - } - emit_tsi(as, MIPSI_LW, tmp1, dest, (int32_t)offsetof(Node, key.it)); - *l_loop = MIPSI_BNE | MIPSF_S(tmp1) | ((as->mcp-l_loop-1) & 0xffffu); - - /* Load main position relative to tab->node into dest. */ - khash = irref_isk(refkey) ? ir_khash(irkey) : 1; - if (khash == 0) { - emit_tsi(as, MIPSI_LW, dest, tab, (int32_t)offsetof(GCtab, node)); - } else { - Reg tmphash = tmp1; - if (irref_isk(refkey)) - tmphash = ra_allock(as, khash, allow); - emit_dst(as, MIPSI_ADDU, dest, dest, tmp1); - lua_assert(sizeof(Node) == 24); - emit_dst(as, MIPSI_SUBU, tmp1, tmp2, tmp1); - emit_dta(as, MIPSI_SLL, tmp1, tmp1, 3); - emit_dta(as, MIPSI_SLL, tmp2, tmp1, 5); - emit_dst(as, MIPSI_AND, tmp1, tmp2, tmphash); - emit_tsi(as, MIPSI_LW, dest, tab, (int32_t)offsetof(GCtab, node)); - emit_tsi(as, MIPSI_LW, tmp2, tab, (int32_t)offsetof(GCtab, hmask)); - if (irref_isk(refkey)) { - /* Nothing to do. */ - } else if (irt_isstr(kt)) { - emit_tsi(as, MIPSI_LW, tmp1, key, (int32_t)offsetof(GCstr, hash)); - } else { /* Must match with hash*() in lj_tab.c. */ - emit_dst(as, MIPSI_SUBU, tmp1, tmp1, tmp2); - emit_rotr(as, tmp2, tmp2, dest, (-HASH_ROT3)&31); - emit_dst(as, MIPSI_XOR, tmp1, tmp1, tmp2); - emit_rotr(as, tmp1, tmp1, dest, (-HASH_ROT2-HASH_ROT1)&31); - emit_dst(as, MIPSI_SUBU, tmp2, tmp2, dest); - if (irt_isnum(kt)) { - emit_dst(as, MIPSI_XOR, tmp2, tmp2, tmp1); - if ((as->flags & JIT_F_MIPS32R2)) { - emit_dta(as, MIPSI_ROTR, dest, tmp1, (-HASH_ROT1)&31); - } else { - emit_dst(as, MIPSI_OR, dest, dest, tmp1); - emit_dta(as, MIPSI_SLL, tmp1, tmp1, HASH_ROT1); - emit_dta(as, MIPSI_SRL, dest, tmp1, (-HASH_ROT1)&31); - } - emit_dst(as, MIPSI_ADDU, tmp1, tmp1, tmp1); - emit_tg(as, MIPSI_MFC1, tmp2, key); - emit_tg(as, MIPSI_MFC1, tmp1, key+1); - } else { - emit_dst(as, MIPSI_XOR, tmp2, key, tmp1); - emit_rotr(as, dest, tmp1, tmp2, (-HASH_ROT1)&31); - emit_dst(as, MIPSI_ADDU, tmp1, key, ra_allock(as, HASH_BIAS, allow)); - } - } - } -} - -static void asm_hrefk(ASMState *as, IRIns *ir) -{ - IRIns *kslot = IR(ir->op2); - IRIns *irkey = IR(kslot->op1); - int32_t ofs = (int32_t)(kslot->op2 * sizeof(Node)); - int32_t kofs = ofs + (int32_t)offsetof(Node, key); - Reg dest = (ra_used(ir)||ofs > 32736) ? ra_dest(as, ir, RSET_GPR) : RID_NONE; - Reg node = ra_alloc1(as, ir->op1, RSET_GPR); - Reg key = RID_NONE, type = RID_TMP, idx = node; - RegSet allow = rset_exclude(RSET_GPR, node); - int32_t lo, hi; - lua_assert(ofs % sizeof(Node) == 0); - if (ofs > 32736) { - idx = dest; - rset_clear(allow, dest); - kofs = (int32_t)offsetof(Node, key); - } else if (ra_hasreg(dest)) { - emit_tsi(as, MIPSI_ADDIU, dest, node, ofs); - } - if (!irt_ispri(irkey->t)) { - key = ra_scratch(as, allow); - rset_clear(allow, key); - } - if (irt_isnum(irkey->t)) { - lo = (int32_t)ir_knum(irkey)->u32.lo; - hi = (int32_t)ir_knum(irkey)->u32.hi; - } else { - lo = irkey->i; - hi = irt_toitype(irkey->t); - if (!ra_hasreg(key)) - goto nolo; - } - asm_guard(as, MIPSI_BNE, key, lo ? ra_allock(as, lo, allow) : RID_ZERO); -nolo: - asm_guard(as, MIPSI_BNE, type, hi ? ra_allock(as, hi, allow) : RID_ZERO); - if (ra_hasreg(key)) emit_tsi(as, MIPSI_LW, key, idx, kofs+(LJ_BE?4:0)); - emit_tsi(as, MIPSI_LW, type, idx, kofs+(LJ_BE?0:4)); - if (ofs > 32736) - emit_tsi(as, MIPSI_ADDU, dest, node, ra_allock(as, ofs, allow)); -} - -static void asm_newref(ASMState *as, IRIns *ir) -{ - if (ir->r != RID_SINK) { - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey]; - IRRef args[3]; - args[0] = ASMREF_L; /* lua_State *L */ - args[1] = ir->op1; /* GCtab *t */ - args[2] = ASMREF_TMP1; /* cTValue *key */ - asm_setupresult(as, ir, ci); /* TValue * */ - asm_gencall(as, ci, args); - asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op2); - } -} - -static void asm_uref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - if (irref_isk(ir->op1)) { - GCfunc *fn = ir_kfunc(IR(ir->op1)); - MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v; - emit_lsptr(as, MIPSI_LW, dest, v, RSET_GPR); - } else { - Reg uv = ra_scratch(as, RSET_GPR); - Reg func = ra_alloc1(as, ir->op1, RSET_GPR); - if (ir->o == IR_UREFC) { - asm_guard(as, MIPSI_BEQ, RID_TMP, RID_ZERO); - emit_tsi(as, MIPSI_ADDIU, dest, uv, (int32_t)offsetof(GCupval, tv)); - emit_tsi(as, MIPSI_LBU, RID_TMP, uv, (int32_t)offsetof(GCupval, closed)); - } else { - emit_tsi(as, MIPSI_LW, dest, uv, (int32_t)offsetof(GCupval, v)); - } - emit_tsi(as, MIPSI_LW, uv, func, - (int32_t)offsetof(GCfuncL, uvptr) + 4*(int32_t)(ir->op2 >> 8)); - } -} - -static void asm_fref(ASMState *as, IRIns *ir) -{ - UNUSED(as); UNUSED(ir); - lua_assert(!ra_used(ir)); -} - -static void asm_strref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - IRRef ref = ir->op2, refk = ir->op1; - int32_t ofs = (int32_t)sizeof(GCstr); - Reg r; - if (irref_isk(ref)) { - IRRef tmp = refk; refk = ref; ref = tmp; - } else if (!irref_isk(refk)) { - Reg right, left = ra_alloc1(as, ir->op1, RSET_GPR); - IRIns *irr = IR(ir->op2); - if (ra_hasreg(irr->r)) { - ra_noweak(as, irr->r); - right = irr->r; - } else if (mayfuse(as, irr->op2) && - irr->o == IR_ADD && irref_isk(irr->op2) && - checki16(ofs + IR(irr->op2)->i)) { - ofs += IR(irr->op2)->i; - right = ra_alloc1(as, irr->op1, rset_exclude(RSET_GPR, left)); - } else { - right = ra_allocref(as, ir->op2, rset_exclude(RSET_GPR, left)); - } - emit_tsi(as, MIPSI_ADDIU, dest, dest, ofs); - emit_dst(as, MIPSI_ADDU, dest, left, right); - return; - } - r = ra_alloc1(as, ref, RSET_GPR); - ofs += IR(refk)->i; - if (checki16(ofs)) - emit_tsi(as, MIPSI_ADDIU, dest, r, ofs); - else - emit_dst(as, MIPSI_ADDU, dest, r, - ra_allock(as, ofs, rset_exclude(RSET_GPR, r))); -} - -/* -- Loads and stores ---------------------------------------------------- */ - -static MIPSIns asm_fxloadins(IRIns *ir) -{ - switch (irt_type(ir->t)) { - case IRT_I8: return MIPSI_LB; - case IRT_U8: return MIPSI_LBU; - case IRT_I16: return MIPSI_LH; - case IRT_U16: return MIPSI_LHU; - case IRT_NUM: return MIPSI_LDC1; - case IRT_FLOAT: return MIPSI_LWC1; - default: return MIPSI_LW; - } -} - -static MIPSIns asm_fxstoreins(IRIns *ir) -{ - switch (irt_type(ir->t)) { - case IRT_I8: case IRT_U8: return MIPSI_SB; - case IRT_I16: case IRT_U16: return MIPSI_SH; - case IRT_NUM: return MIPSI_SDC1; - case IRT_FLOAT: return MIPSI_SWC1; - default: return MIPSI_SW; - } -} - -static void asm_fload(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg idx = ra_alloc1(as, ir->op1, RSET_GPR); - MIPSIns mi = asm_fxloadins(ir); - int32_t ofs; - if (ir->op2 == IRFL_TAB_ARRAY) { - ofs = asm_fuseabase(as, ir->op1); - if (ofs) { /* Turn the t->array load into an add for colocated arrays. */ - emit_tsi(as, MIPSI_ADDIU, dest, idx, ofs); - return; - } - } - ofs = field_ofs[ir->op2]; - lua_assert(!irt_isfp(ir->t)); - emit_tsi(as, mi, dest, idx, ofs); -} - -static void asm_fstore(ASMState *as, IRIns *ir) -{ - if (ir->r != RID_SINK) { - Reg src = ra_alloc1z(as, ir->op2, RSET_GPR); - IRIns *irf = IR(ir->op1); - Reg idx = ra_alloc1(as, irf->op1, rset_exclude(RSET_GPR, src)); - int32_t ofs = field_ofs[irf->op2]; - MIPSIns mi = asm_fxstoreins(ir); - lua_assert(!irt_isfp(ir->t)); - emit_tsi(as, mi, src, idx, ofs); - } -} - -static void asm_xload(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); - lua_assert(!(ir->op2 & IRXLOAD_UNALIGNED)); - asm_fusexref(as, asm_fxloadins(ir), dest, ir->op1, RSET_GPR, 0); -} - -static void asm_xstore(ASMState *as, IRIns *ir, int32_t ofs) -{ - if (ir->r != RID_SINK) { - Reg src = ra_alloc1z(as, ir->op2, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); - asm_fusexref(as, asm_fxstoreins(ir), src, ir->op1, - rset_exclude(RSET_GPR, src), ofs); - } -} - -static void asm_ahuvload(ASMState *as, IRIns *ir) -{ - IRType1 t = ir->t; - Reg dest = RID_NONE, type = RID_TMP, idx; - RegSet allow = RSET_GPR; - int32_t ofs = 0; - if (ra_used(ir)) { - lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t)); - dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR); - rset_clear(allow, dest); - } - idx = asm_fuseahuref(as, ir->op1, &ofs, allow); - rset_clear(allow, idx); - if (irt_isnum(t)) { - asm_guard(as, MIPSI_BEQ, type, RID_ZERO); - emit_tsi(as, MIPSI_SLTIU, type, type, (int32_t)LJ_TISNUM); - if (ra_hasreg(dest)) - emit_hsi(as, MIPSI_LDC1, dest, idx, ofs); - } else { - asm_guard(as, MIPSI_BNE, type, ra_allock(as, irt_toitype(t), allow)); - if (ra_hasreg(dest)) emit_tsi(as, MIPSI_LW, dest, idx, ofs+(LJ_BE?4:0)); - } - emit_tsi(as, MIPSI_LW, type, idx, ofs+(LJ_BE?0:4)); -} - -static void asm_ahustore(ASMState *as, IRIns *ir) -{ - RegSet allow = RSET_GPR; - Reg idx, src = RID_NONE, type = RID_NONE; - int32_t ofs = 0; - if (ir->r == RID_SINK) - return; - if (irt_isnum(ir->t)) { - src = ra_alloc1(as, ir->op2, RSET_FPR); - } else { - if (!irt_ispri(ir->t)) { - src = ra_alloc1(as, ir->op2, allow); - rset_clear(allow, src); - } - type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow); - rset_clear(allow, type); - } - idx = asm_fuseahuref(as, ir->op1, &ofs, allow); - if (irt_isnum(ir->t)) { - emit_hsi(as, MIPSI_SDC1, src, idx, ofs); - } else { - if (ra_hasreg(src)) - emit_tsi(as, MIPSI_SW, src, idx, ofs+(LJ_BE?4:0)); - emit_tsi(as, MIPSI_SW, type, idx, ofs+(LJ_BE?0:4)); - } -} - -static void asm_sload(ASMState *as, IRIns *ir) -{ - int32_t ofs = 8*((int32_t)ir->op1-1) + ((ir->op2 & IRSLOAD_FRAME) ? 4 : 0); - IRType1 t = ir->t; - Reg dest = RID_NONE, type = RID_NONE, base; - RegSet allow = RSET_GPR; - lua_assert(!(ir->op2 & IRSLOAD_PARENT)); /* Handled by asm_head_side(). */ - lua_assert(irt_isguard(t) || !(ir->op2 & IRSLOAD_TYPECHECK)); - lua_assert(!irt_isint(t) || (ir->op2 & (IRSLOAD_CONVERT|IRSLOAD_FRAME))); - if ((ir->op2 & IRSLOAD_CONVERT) && irt_isguard(t) && irt_isint(t)) { - dest = ra_scratch(as, RSET_FPR); - asm_tointg(as, ir, dest); - t.irt = IRT_NUM; /* Continue with a regular number type check. */ - } else if (ra_used(ir)) { - lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t)); - dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR); - rset_clear(allow, dest); - base = ra_alloc1(as, REF_BASE, allow); - rset_clear(allow, base); - if ((ir->op2 & IRSLOAD_CONVERT)) { - if (irt_isint(t)) { - Reg tmp = ra_scratch(as, RSET_FPR); - emit_tg(as, MIPSI_MFC1, dest, tmp); - emit_fg(as, MIPSI_CVT_W_D, tmp, tmp); - dest = tmp; - t.irt = IRT_NUM; /* Check for original type. */ - } else { - Reg tmp = ra_scratch(as, RSET_GPR); - emit_fg(as, MIPSI_CVT_D_W, dest, dest); - emit_tg(as, MIPSI_MTC1, tmp, dest); - dest = tmp; - t.irt = IRT_INT; /* Check for original type. */ - } - } - goto dotypecheck; - } - base = ra_alloc1(as, REF_BASE, allow); - rset_clear(allow, base); -dotypecheck: - if (irt_isnum(t)) { - if ((ir->op2 & IRSLOAD_TYPECHECK)) { - asm_guard(as, MIPSI_BEQ, RID_TMP, RID_ZERO); - emit_tsi(as, MIPSI_SLTIU, RID_TMP, RID_TMP, (int32_t)LJ_TISNUM); - type = RID_TMP; - } - if (ra_hasreg(dest)) emit_hsi(as, MIPSI_LDC1, dest, base, ofs); - } else { - if ((ir->op2 & IRSLOAD_TYPECHECK)) { - Reg ktype = ra_allock(as, irt_toitype(t), allow); - asm_guard(as, MIPSI_BNE, RID_TMP, ktype); - type = RID_TMP; - } - if (ra_hasreg(dest)) emit_tsi(as, MIPSI_LW, dest, base, ofs ^ (LJ_BE?4:0)); - } - if (ra_hasreg(type)) emit_tsi(as, MIPSI_LW, type, base, ofs ^ (LJ_BE?0:4)); -} - -/* -- Allocations --------------------------------------------------------- */ - -#if LJ_HASFFI -static void asm_cnew(ASMState *as, IRIns *ir) -{ - CTState *cts = ctype_ctsG(J2G(as->J)); - CTypeID ctypeid = (CTypeID)IR(ir->op1)->i; - CTSize sz = (ir->o == IR_CNEWI || ir->op2 == REF_NIL) ? - lj_ctype_size(cts, ctypeid) : (CTSize)IR(ir->op2)->i; - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco]; - IRRef args[2]; - RegSet allow = (RSET_GPR & ~RSET_SCRATCH); - RegSet drop = RSET_SCRATCH; - lua_assert(sz != CTSIZE_INVALID); - - args[0] = ASMREF_L; /* lua_State *L */ - args[1] = ASMREF_TMP1; /* MSize size */ - as->gcsteps++; - - if (ra_hasreg(ir->r)) - rset_clear(drop, ir->r); /* Dest reg handled below. */ - ra_evictset(as, drop); - if (ra_used(ir)) - ra_destreg(as, ir, RID_RET); /* GCcdata * */ - - /* Initialize immutable cdata object. */ - if (ir->o == IR_CNEWI) { - int32_t ofs = sizeof(GCcdata); - lua_assert(sz == 4 || sz == 8); - if (sz == 8) { - ofs += 4; - lua_assert((ir+1)->o == IR_HIOP); - if (LJ_LE) ir++; - } - for (;;) { - Reg r = ra_alloc1z(as, ir->op2, allow); - emit_tsi(as, MIPSI_SW, r, RID_RET, ofs); - rset_clear(allow, r); - if (ofs == sizeof(GCcdata)) break; - ofs -= 4; if (LJ_BE) ir++; else ir--; - } - } - /* Initialize gct and ctypeid. lj_mem_newgco() already sets marked. */ - emit_tsi(as, MIPSI_SB, RID_RET+1, RID_RET, offsetof(GCcdata, gct)); - emit_tsi(as, MIPSI_SH, RID_TMP, RID_RET, offsetof(GCcdata, ctypeid)); - emit_ti(as, MIPSI_LI, RID_RET+1, ~LJ_TCDATA); - emit_ti(as, MIPSI_LI, RID_TMP, ctypeid); /* Lower 16 bit used. Sign-ext ok. */ - asm_gencall(as, ci, args); - ra_allockreg(as, (int32_t)(sz+sizeof(GCcdata)), - ra_releasetmp(as, ASMREF_TMP1)); -} -#else -#define asm_cnew(as, ir) ((void)0) -#endif - -/* -- Write barriers ------------------------------------------------------ */ - -static void asm_tbar(ASMState *as, IRIns *ir) -{ - Reg tab = ra_alloc1(as, ir->op1, RSET_GPR); - Reg mark = ra_scratch(as, rset_exclude(RSET_GPR, tab)); - Reg link = RID_TMP; - MCLabel l_end = emit_label(as); - emit_tsi(as, MIPSI_SW, link, tab, (int32_t)offsetof(GCtab, gclist)); - emit_tsi(as, MIPSI_SB, mark, tab, (int32_t)offsetof(GCtab, marked)); - emit_setgl(as, tab, gc.grayagain); - emit_getgl(as, link, gc.grayagain); - emit_dst(as, MIPSI_XOR, mark, mark, RID_TMP); /* Clear black bit. */ - emit_branch(as, MIPSI_BEQ, RID_TMP, RID_ZERO, l_end); - emit_tsi(as, MIPSI_ANDI, RID_TMP, mark, LJ_GC_BLACK); - emit_tsi(as, MIPSI_LBU, mark, tab, (int32_t)offsetof(GCtab, marked)); -} - -static void asm_obar(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_barrieruv]; - IRRef args[2]; - MCLabel l_end; - Reg obj, val, tmp; - /* No need for other object barriers (yet). */ - lua_assert(IR(ir->op1)->o == IR_UREFC); - ra_evictset(as, RSET_SCRATCH); - l_end = emit_label(as); - args[0] = ASMREF_TMP1; /* global_State *g */ - args[1] = ir->op1; /* TValue *tv */ - asm_gencall(as, ci, args); - emit_tsi(as, MIPSI_ADDIU, ra_releasetmp(as, ASMREF_TMP1), RID_JGL, -32768); - obj = IR(ir->op1)->r; - tmp = ra_scratch(as, rset_exclude(RSET_GPR, obj)); - emit_branch(as, MIPSI_BEQ, RID_TMP, RID_ZERO, l_end); - emit_tsi(as, MIPSI_ANDI, tmp, tmp, LJ_GC_BLACK); - emit_branch(as, MIPSI_BEQ, RID_TMP, RID_ZERO, l_end); - emit_tsi(as, MIPSI_ANDI, RID_TMP, RID_TMP, LJ_GC_WHITES); - val = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, obj)); - emit_tsi(as, MIPSI_LBU, tmp, obj, - (int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)); - emit_tsi(as, MIPSI_LBU, RID_TMP, val, (int32_t)offsetof(GChead, marked)); -} - -/* -- Arithmetic and logic operations ------------------------------------- */ - -static void asm_fparith(ASMState *as, IRIns *ir, MIPSIns mi) -{ - Reg dest = ra_dest(as, ir, RSET_FPR); - Reg right, left = ra_alloc2(as, ir, RSET_FPR); - right = (left >> 8); left &= 255; - emit_fgh(as, mi, dest, left, right); -} - -static void asm_fpunary(ASMState *as, IRIns *ir, MIPSIns mi) -{ - Reg dest = ra_dest(as, ir, RSET_FPR); - Reg left = ra_hintalloc(as, ir->op1, dest, RSET_FPR); - emit_fg(as, mi, dest, left); -} - -static int asm_fpjoin_pow(ASMState *as, IRIns *ir) -{ - IRIns *irp = IR(ir->op1); - if (irp == ir-1 && irp->o == IR_MUL && !ra_used(irp)) { - IRIns *irpp = IR(irp->op1); - if (irpp == ir-2 && irpp->o == IR_FPMATH && - irpp->op2 == IRFPM_LOG2 && !ra_used(irpp)) { - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_pow]; - IRRef args[2]; - args[0] = irpp->op1; - args[1] = irp->op2; - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); - return 1; - } - } - return 0; -} - -static void asm_add(ASMState *as, IRIns *ir) -{ - if (irt_isnum(ir->t)) { - asm_fparith(as, ir, MIPSI_ADD_D); - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - if (irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - if (checki16(k)) { - emit_tsi(as, MIPSI_ADDIU, dest, left, k); - return; - } - } - right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - emit_dst(as, MIPSI_ADDU, dest, left, right); - } -} - -static void asm_sub(ASMState *as, IRIns *ir) -{ - if (irt_isnum(ir->t)) { - asm_fparith(as, ir, MIPSI_SUB_D); - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg right, left = ra_alloc2(as, ir, RSET_GPR); - right = (left >> 8); left &= 255; - emit_dst(as, MIPSI_SUBU, dest, left, right); - } -} - -static void asm_mul(ASMState *as, IRIns *ir) -{ - if (irt_isnum(ir->t)) { - asm_fparith(as, ir, MIPSI_MUL_D); - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg right, left = ra_alloc2(as, ir, RSET_GPR); - right = (left >> 8); left &= 255; - emit_dst(as, MIPSI_MUL, dest, left, right); - } -} - -static void asm_neg(ASMState *as, IRIns *ir) -{ - if (irt_isnum(ir->t)) { - asm_fpunary(as, ir, MIPSI_NEG_D); - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - emit_dst(as, MIPSI_SUBU, dest, RID_ZERO, left); - } -} - -static void asm_arithov(ASMState *as, IRIns *ir) -{ - Reg right, left, tmp, dest = ra_dest(as, ir, RSET_GPR); - if (irref_isk(ir->op2)) { - int k = IR(ir->op2)->i; - if (ir->o == IR_SUBOV) k = -k; - if (checki16(k)) { /* (dest < left) == (k >= 0 ? 1 : 0) */ - left = ra_alloc1(as, ir->op1, RSET_GPR); - asm_guard(as, k >= 0 ? MIPSI_BNE : MIPSI_BEQ, RID_TMP, RID_ZERO); - emit_dst(as, MIPSI_SLT, RID_TMP, dest, dest == left ? RID_TMP : left); - emit_tsi(as, MIPSI_ADDIU, dest, left, k); - if (dest == left) emit_move(as, RID_TMP, left); - return; - } - } - left = ra_alloc2(as, ir, RSET_GPR); - right = (left >> 8); left &= 255; - tmp = ra_scratch(as, rset_exclude(rset_exclude(rset_exclude(RSET_GPR, left), - right), dest)); - asm_guard(as, MIPSI_BLTZ, RID_TMP, 0); - emit_dst(as, MIPSI_AND, RID_TMP, RID_TMP, tmp); - if (ir->o == IR_ADDOV) { /* ((dest^left) & (dest^right)) < 0 */ - emit_dst(as, MIPSI_XOR, RID_TMP, dest, dest == right ? RID_TMP : right); - } else { /* ((dest^left) & (dest^~right)) < 0 */ - emit_dst(as, MIPSI_XOR, RID_TMP, RID_TMP, dest); - emit_dst(as, MIPSI_NOR, RID_TMP, dest == right ? RID_TMP : right, RID_ZERO); - } - emit_dst(as, MIPSI_XOR, tmp, dest, dest == left ? RID_TMP : left); - emit_dst(as, ir->o == IR_ADDOV ? MIPSI_ADDU : MIPSI_SUBU, dest, left, right); - if (dest == left || dest == right) - emit_move(as, RID_TMP, dest == left ? left : right); -} - -static void asm_mulov(ASMState *as, IRIns *ir) -{ -#if LJ_DUALNUM -#error "NYI: MULOV" -#else - UNUSED(as); UNUSED(ir); lua_assert(0); /* Unused in single-number mode. */ -#endif -} - -#if LJ_HASFFI -static void asm_add64(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg right, left = ra_alloc1(as, ir->op1, RSET_GPR); - if (irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - if (k == 0) { - emit_dst(as, MIPSI_ADDU, dest, left, RID_TMP); - goto loarith; - } else if (checki16(k)) { - emit_dst(as, MIPSI_ADDU, dest, dest, RID_TMP); - emit_tsi(as, MIPSI_ADDIU, dest, left, k); - goto loarith; - } - } - emit_dst(as, MIPSI_ADDU, dest, dest, RID_TMP); - right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - emit_dst(as, MIPSI_ADDU, dest, left, right); -loarith: - ir--; - dest = ra_dest(as, ir, RSET_GPR); - left = ra_alloc1(as, ir->op1, RSET_GPR); - if (irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - if (k == 0) { - if (dest != left) - emit_move(as, dest, left); - return; - } else if (checki16(k)) { - if (dest == left) { - Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, left)); - emit_move(as, dest, tmp); - dest = tmp; - } - emit_dst(as, MIPSI_SLTU, RID_TMP, dest, left); - emit_tsi(as, MIPSI_ADDIU, dest, left, k); - return; - } - } - right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - if (dest == left && dest == right) { - Reg tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR, left), right)); - emit_move(as, dest, tmp); - dest = tmp; - } - emit_dst(as, MIPSI_SLTU, RID_TMP, dest, dest == left ? right : left); - emit_dst(as, MIPSI_ADDU, dest, left, right); -} - -static void asm_sub64(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg right, left = ra_alloc2(as, ir, RSET_GPR); - right = (left >> 8); left &= 255; - emit_dst(as, MIPSI_SUBU, dest, dest, RID_TMP); - emit_dst(as, MIPSI_SUBU, dest, left, right); - ir--; - dest = ra_dest(as, ir, RSET_GPR); - left = ra_alloc2(as, ir, RSET_GPR); - right = (left >> 8); left &= 255; - if (dest == left) { - Reg tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR, left), right)); - emit_move(as, dest, tmp); - dest = tmp; - } - emit_dst(as, MIPSI_SLTU, RID_TMP, left, dest); - emit_dst(as, MIPSI_SUBU, dest, left, right); -} - -static void asm_neg64(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_alloc1(as, ir->op1, RSET_GPR); - emit_dst(as, MIPSI_SUBU, dest, dest, RID_TMP); - emit_dst(as, MIPSI_SUBU, dest, RID_ZERO, left); - ir--; - dest = ra_dest(as, ir, RSET_GPR); - left = ra_alloc1(as, ir->op1, RSET_GPR); - emit_dst(as, MIPSI_SLTU, RID_TMP, RID_ZERO, dest); - emit_dst(as, MIPSI_SUBU, dest, RID_ZERO, left); -} -#endif - -static void asm_bitnot(ASMState *as, IRIns *ir) -{ - Reg left, right, dest = ra_dest(as, ir, RSET_GPR); - IRIns *irl = IR(ir->op1); - if (mayfuse(as, ir->op1) && irl->o == IR_BOR) { - left = ra_alloc2(as, irl, RSET_GPR); - right = (left >> 8); left &= 255; - } else { - left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - right = RID_ZERO; - } - emit_dst(as, MIPSI_NOR, dest, left, right); -} - -static void asm_bitswap(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_alloc1(as, ir->op1, RSET_GPR); - if ((as->flags & JIT_F_MIPS32R2)) { - emit_dta(as, MIPSI_ROTR, dest, RID_TMP, 16); - emit_dst(as, MIPSI_WSBH, RID_TMP, 0, left); - } else { - Reg tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR, left), dest)); - emit_dst(as, MIPSI_OR, dest, dest, tmp); - emit_dst(as, MIPSI_OR, dest, dest, RID_TMP); - emit_tsi(as, MIPSI_ANDI, dest, dest, 0xff00); - emit_dta(as, MIPSI_SLL, RID_TMP, RID_TMP, 8); - emit_dta(as, MIPSI_SRL, dest, left, 8); - emit_tsi(as, MIPSI_ANDI, RID_TMP, left, 0xff00); - emit_dst(as, MIPSI_OR, tmp, tmp, RID_TMP); - emit_dta(as, MIPSI_SRL, tmp, left, 24); - emit_dta(as, MIPSI_SLL, RID_TMP, left, 24); - } -} - -static void asm_bitop(ASMState *as, IRIns *ir, MIPSIns mi, MIPSIns mik) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - if (irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - if (checku16(k)) { - emit_tsi(as, mik, dest, left, k); - return; - } - } - right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - emit_dst(as, mi, dest, left, right); -} - -static void asm_bitshift(ASMState *as, IRIns *ir, MIPSIns mi, MIPSIns mik) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - if (irref_isk(ir->op2)) { /* Constant shifts. */ - uint32_t shift = (uint32_t)(IR(ir->op2)->i & 31); - emit_dta(as, mik, dest, ra_hintalloc(as, ir->op1, dest, RSET_GPR), shift); - } else { - Reg right, left = ra_alloc2(as, ir, RSET_GPR); - right = (left >> 8); left &= 255; - emit_dst(as, mi, dest, right, left); /* Shift amount is in rs. */ - } -} - -static void asm_bitror(ASMState *as, IRIns *ir) -{ - if ((as->flags & JIT_F_MIPS32R2)) { - asm_bitshift(as, ir, MIPSI_ROTRV, MIPSI_ROTR); - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - if (irref_isk(ir->op2)) { /* Constant shifts. */ - uint32_t shift = (uint32_t)(IR(ir->op2)->i & 31); - Reg left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - emit_rotr(as, dest, left, RID_TMP, shift); - } else { - Reg right, left = ra_alloc2(as, ir, RSET_GPR); - right = (left >> 8); left &= 255; - emit_dst(as, MIPSI_OR, dest, dest, RID_TMP); - emit_dst(as, MIPSI_SRLV, dest, right, left); - emit_dst(as, MIPSI_SLLV, RID_TMP, RID_TMP, left); - emit_dst(as, MIPSI_SUBU, RID_TMP, ra_allock(as, 32, RSET_GPR), right); - } - } -} - -static void asm_min_max(ASMState *as, IRIns *ir, int ismax) -{ - if (irt_isnum(ir->t)) { - Reg dest = ra_dest(as, ir, RSET_FPR); - Reg right, left = ra_alloc2(as, ir, RSET_FPR); - right = (left >> 8); left &= 255; - if (dest == left) { - emit_fg(as, MIPSI_MOVT_D, dest, right); - } else { - emit_fg(as, MIPSI_MOVF_D, dest, left); - if (dest != right) emit_fg(as, MIPSI_MOV_D, dest, right); - } - emit_fgh(as, MIPSI_C_OLT_D, 0, ismax ? left : right, ismax ? right : left); - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg right, left = ra_alloc2(as, ir, RSET_GPR); - right = (left >> 8); left &= 255; - if (dest == left) { - emit_dst(as, MIPSI_MOVN, dest, right, RID_TMP); - } else { - emit_dst(as, MIPSI_MOVZ, dest, left, RID_TMP); - if (dest != right) emit_move(as, dest, right); - } - emit_dst(as, MIPSI_SLT, RID_TMP, - ismax ? left : right, ismax ? right : left); - } -} - -/* -- Comparisons --------------------------------------------------------- */ - -static void asm_comp(ASMState *as, IRIns *ir) -{ - /* ORDER IR: LT GE LE GT ULT UGE ULE UGT. */ - IROp op = ir->o; - if (irt_isnum(ir->t)) { - Reg right, left = ra_alloc2(as, ir, RSET_FPR); - right = (left >> 8); left &= 255; - asm_guard(as, (op&1) ? MIPSI_BC1T : MIPSI_BC1F, 0, 0); - emit_fgh(as, MIPSI_C_OLT_D + ((op&3) ^ ((op>>2)&1)), 0, left, right); - } else { - Reg right, left = ra_alloc1(as, ir->op1, RSET_GPR); - if (op == IR_ABC) op = IR_UGT; - if ((op&4) == 0 && irref_isk(ir->op2) && IR(ir->op2)->i == 0) { - MIPSIns mi = (op&2) ? ((op&1) ? MIPSI_BLEZ : MIPSI_BGTZ) : - ((op&1) ? MIPSI_BLTZ : MIPSI_BGEZ); - asm_guard(as, mi, left, 0); - } else { - if (irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - if ((op&2)) k++; - if (checki16(k)) { - asm_guard(as, (op&1) ? MIPSI_BNE : MIPSI_BEQ, RID_TMP, RID_ZERO); - emit_tsi(as, (op&4) ? MIPSI_SLTIU : MIPSI_SLTI, - RID_TMP, left, k); - return; - } - } - right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - asm_guard(as, ((op^(op>>1))&1) ? MIPSI_BNE : MIPSI_BEQ, RID_TMP, RID_ZERO); - emit_dst(as, (op&4) ? MIPSI_SLTU : MIPSI_SLT, - RID_TMP, (op&2) ? right : left, (op&2) ? left : right); - } - } -} - -static void asm_compeq(ASMState *as, IRIns *ir) -{ - Reg right, left = ra_alloc2(as, ir, irt_isnum(ir->t) ? RSET_FPR : RSET_GPR); - right = (left >> 8); left &= 255; - if (irt_isnum(ir->t)) { - asm_guard(as, (ir->o & 1) ? MIPSI_BC1T : MIPSI_BC1F, 0, 0); - emit_fgh(as, MIPSI_C_EQ_D, 0, left, right); - } else { - asm_guard(as, (ir->o & 1) ? MIPSI_BEQ : MIPSI_BNE, left, right); - } -} - -#if LJ_HASFFI -/* 64 bit integer comparisons. */ -static void asm_comp64(ASMState *as, IRIns *ir) -{ - /* ORDER IR: LT GE LE GT ULT UGE ULE UGT. */ - IROp op = (ir-1)->o; - MCLabel l_end; - Reg rightlo, leftlo, righthi, lefthi = ra_alloc2(as, ir, RSET_GPR); - righthi = (lefthi >> 8); lefthi &= 255; - leftlo = ra_alloc2(as, ir-1, - rset_exclude(rset_exclude(RSET_GPR, lefthi), righthi)); - rightlo = (leftlo >> 8); leftlo &= 255; - asm_guard(as, ((op^(op>>1))&1) ? MIPSI_BNE : MIPSI_BEQ, RID_TMP, RID_ZERO); - l_end = emit_label(as); - if (lefthi != righthi) - emit_dst(as, (op&4) ? MIPSI_SLTU : MIPSI_SLT, RID_TMP, - (op&2) ? righthi : lefthi, (op&2) ? lefthi : righthi); - emit_dst(as, MIPSI_SLTU, RID_TMP, - (op&2) ? rightlo : leftlo, (op&2) ? leftlo : rightlo); - if (lefthi != righthi) - emit_branch(as, MIPSI_BEQ, lefthi, righthi, l_end); -} - -static void asm_comp64eq(ASMState *as, IRIns *ir) -{ - Reg tmp, right, left = ra_alloc2(as, ir, RSET_GPR); - right = (left >> 8); left &= 255; - asm_guard(as, ((ir-1)->o & 1) ? MIPSI_BEQ : MIPSI_BNE, RID_TMP, RID_ZERO); - tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR, left), right)); - emit_dst(as, MIPSI_OR, RID_TMP, RID_TMP, tmp); - emit_dst(as, MIPSI_XOR, tmp, left, right); - left = ra_alloc2(as, ir-1, RSET_GPR); - right = (left >> 8); left &= 255; - emit_dst(as, MIPSI_XOR, RID_TMP, left, right); -} -#endif - -/* -- Support for 64 bit ops in 32 bit mode ------------------------------- */ - -/* Hiword op of a split 64 bit op. Previous op must be the loword op. */ -static void asm_hiop(ASMState *as, IRIns *ir) -{ -#if LJ_HASFFI - /* HIOP is marked as a store because it needs its own DCE logic. */ - int uselo = ra_used(ir-1), usehi = ra_used(ir); /* Loword/hiword used? */ - if (LJ_UNLIKELY(!(as->flags & JIT_F_OPT_DCE))) uselo = usehi = 1; - if ((ir-1)->o == IR_CONV) { /* Conversions to/from 64 bit. */ - as->curins--; /* Always skip the CONV. */ - if (usehi || uselo) - asm_conv64(as, ir); - return; - } else if ((ir-1)->o < IR_EQ) { /* 64 bit integer comparisons. ORDER IR. */ - as->curins--; /* Always skip the loword comparison. */ - asm_comp64(as, ir); - return; - } else if ((ir-1)->o <= IR_NE) { /* 64 bit integer comparisons. ORDER IR. */ - as->curins--; /* Always skip the loword comparison. */ - asm_comp64eq(as, ir); - return; - } else if ((ir-1)->o == IR_XSTORE) { - as->curins--; /* Handle both stores here. */ - if ((ir-1)->r != RID_SINK) { - asm_xstore(as, ir, LJ_LE ? 4 : 0); - asm_xstore(as, ir-1, LJ_LE ? 0 : 4); - } - return; - } - if (!usehi) return; /* Skip unused hiword op for all remaining ops. */ - switch ((ir-1)->o) { - case IR_ADD: as->curins--; asm_add64(as, ir); break; - case IR_SUB: as->curins--; asm_sub64(as, ir); break; - case IR_NEG: as->curins--; asm_neg64(as, ir); break; - case IR_CALLN: - case IR_CALLXS: - if (!uselo) - ra_allocref(as, ir->op1, RID2RSET(RID_RETLO)); /* Mark lo op as used. */ - break; - case IR_CNEWI: - /* Nothing to do here. Handled by lo op itself. */ - break; - default: lua_assert(0); break; - } -#else - UNUSED(as); UNUSED(ir); lua_assert(0); /* Unused without FFI. */ -#endif -} - -/* -- Stack handling ------------------------------------------------------ */ - -/* Check Lua stack size for overflow. Use exit handler as fallback. */ -static void asm_stack_check(ASMState *as, BCReg topslot, - IRIns *irp, RegSet allow, ExitNo exitno) -{ - /* Try to get an unused temp. register, otherwise spill/restore RID_RET*. */ - Reg tmp, pbase = irp ? (ra_hasreg(irp->r) ? irp->r : RID_TMP) : RID_BASE; - ExitNo oldsnap = as->snapno; - rset_clear(allow, pbase); - tmp = allow ? rset_pickbot(allow) : - (pbase == RID_RETHI ? RID_RETLO : RID_RETHI); - as->snapno = exitno; - asm_guard(as, MIPSI_BNE, RID_TMP, RID_ZERO); - as->snapno = oldsnap; - if (allow == RSET_EMPTY) /* Restore temp. register. */ - emit_tsi(as, MIPSI_LW, tmp, RID_SP, 0); - else - ra_modified(as, tmp); - emit_tsi(as, MIPSI_SLTIU, RID_TMP, RID_TMP, (int32_t)(8*topslot)); - emit_dst(as, MIPSI_SUBU, RID_TMP, tmp, pbase); - emit_tsi(as, MIPSI_LW, tmp, tmp, offsetof(lua_State, maxstack)); - if (pbase == RID_TMP) - emit_getgl(as, RID_TMP, jit_base); - emit_getgl(as, tmp, jit_L); - if (allow == RSET_EMPTY) /* Spill temp. register. */ - emit_tsi(as, MIPSI_SW, tmp, RID_SP, 0); -} - -/* Restore Lua stack from on-trace state. */ -static void asm_stack_restore(ASMState *as, SnapShot *snap) -{ - SnapEntry *map = &as->T->snapmap[snap->mapofs]; - SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1]; - MSize n, nent = snap->nent; - /* Store the value of all modified slots to the Lua stack. */ - for (n = 0; n < nent; n++) { - SnapEntry sn = map[n]; - BCReg s = snap_slot(sn); - int32_t ofs = 8*((int32_t)s-1); - IRRef ref = snap_ref(sn); - IRIns *ir = IR(ref); - if ((sn & SNAP_NORESTORE)) - continue; - if (irt_isnum(ir->t)) { - Reg src = ra_alloc1(as, ref, RSET_FPR); - emit_hsi(as, MIPSI_SDC1, src, RID_BASE, ofs); - } else { - Reg type; - RegSet allow = rset_exclude(RSET_GPR, RID_BASE); - lua_assert(irt_ispri(ir->t) || irt_isaddr(ir->t) || irt_isinteger(ir->t)); - if (!irt_ispri(ir->t)) { - Reg src = ra_alloc1(as, ref, allow); - rset_clear(allow, src); - emit_tsi(as, MIPSI_SW, src, RID_BASE, ofs+(LJ_BE?4:0)); - } - if ((sn & (SNAP_CONT|SNAP_FRAME))) { - if (s == 0) continue; /* Do not overwrite link to previous frame. */ - type = ra_allock(as, (int32_t)(*flinks--), allow); - } else { - type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow); - } - emit_tsi(as, MIPSI_SW, type, RID_BASE, ofs+(LJ_BE?0:4)); - } - checkmclim(as); - } - lua_assert(map + nent == flinks); -} - -/* -- GC handling --------------------------------------------------------- */ - -/* Check GC threshold and do one or more GC steps. */ -static void asm_gc_check(ASMState *as) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_step_jit]; - IRRef args[2]; - MCLabel l_end; - Reg tmp; - ra_evictset(as, RSET_SCRATCH); - l_end = emit_label(as); - /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */ - /* Assumes asm_snap_prep() already done. */ - asm_guard(as, MIPSI_BNE, RID_RET, RID_ZERO); - args[0] = ASMREF_TMP1; /* global_State *g */ - args[1] = ASMREF_TMP2; /* MSize steps */ - asm_gencall(as, ci, args); - emit_tsi(as, MIPSI_ADDIU, ra_releasetmp(as, ASMREF_TMP1), RID_JGL, -32768); - tmp = ra_releasetmp(as, ASMREF_TMP2); - emit_loadi(as, tmp, as->gcsteps); - /* Jump around GC step if GC total < GC threshold. */ - emit_branch(as, MIPSI_BNE, RID_TMP, RID_ZERO, l_end); - emit_dst(as, MIPSI_SLTU, RID_TMP, RID_TMP, tmp); - emit_getgl(as, tmp, gc.threshold); - emit_getgl(as, RID_TMP, gc.total); - as->gcsteps = 0; - checkmclim(as); -} - -/* -- Loop handling ------------------------------------------------------- */ - -/* Fixup the loop branch. */ -static void asm_loop_fixup(ASMState *as) -{ - MCode *p = as->mctop; - MCode *target = as->mcp; - p[-1] = MIPSI_NOP; - if (as->loopinv) { /* Inverted loop branch? */ - /* asm_guard already inverted the cond branch. Only patch the target. */ - p[-3] |= ((target-p+2) & 0x0000ffffu); - } else { - p[-2] = MIPSI_J|(((uintptr_t)target>>2)&0x03ffffffu); - } -} - -/* -- Head of trace ------------------------------------------------------- */ - -/* Coalesce BASE register for a root trace. */ -static void asm_head_root_base(ASMState *as) -{ - IRIns *ir = IR(REF_BASE); - Reg r = ir->r; - if (as->loopinv) as->mctop--; - if (ra_hasreg(r)) { - ra_free(as, r); - if (rset_test(as->modset, r) || irt_ismarked(ir->t)) - ir->r = RID_INIT; /* No inheritance for modified BASE register. */ - if (r != RID_BASE) - emit_move(as, r, RID_BASE); - } -} - -/* Coalesce BASE register for a side trace. */ -static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow) -{ - IRIns *ir = IR(REF_BASE); - Reg r = ir->r; - if (as->loopinv) as->mctop--; - if (ra_hasreg(r)) { - ra_free(as, r); - if (rset_test(as->modset, r) || irt_ismarked(ir->t)) - ir->r = RID_INIT; /* No inheritance for modified BASE register. */ - if (irp->r == r) { - rset_clear(allow, r); /* Mark same BASE register as coalesced. */ - } else if (ra_hasreg(irp->r) && rset_test(as->freeset, irp->r)) { - rset_clear(allow, irp->r); - emit_move(as, r, irp->r); /* Move from coalesced parent reg. */ - } else { - emit_getgl(as, r, jit_base); /* Otherwise reload BASE. */ - } - } - return allow; -} - -/* -- Tail of trace ------------------------------------------------------- */ - -/* Fixup the tail code. */ -static void asm_tail_fixup(ASMState *as, TraceNo lnk) -{ - MCode *target = lnk ? traceref(as->J,lnk)->mcode : (MCode *)lj_vm_exit_interp; - int32_t spadj = as->T->spadjust; - MCode *p = as->mctop-1; - *p = spadj ? (MIPSI_ADDIU|MIPSF_T(RID_SP)|MIPSF_S(RID_SP)|spadj) : MIPSI_NOP; - p[-1] = MIPSI_J|(((uintptr_t)target>>2)&0x03ffffffu); -} - -/* Prepare tail of code. */ -static void asm_tail_prep(ASMState *as) -{ - as->mcp = as->mctop-2; /* Leave room for branch plus nop or stack adj. */ - as->invmcp = as->loopref ? as->mcp : NULL; -} - -/* -- Instruction dispatch ------------------------------------------------ */ - -/* Assemble a single instruction. */ -static void asm_ir(ASMState *as, IRIns *ir) -{ - switch ((IROp)ir->o) { - /* Miscellaneous ops. */ - case IR_LOOP: asm_loop(as); break; - case IR_NOP: case IR_XBAR: lua_assert(!ra_used(ir)); break; - case IR_USE: - ra_alloc1(as, ir->op1, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); break; - case IR_PHI: asm_phi(as, ir); break; - case IR_HIOP: asm_hiop(as, ir); break; - case IR_GCSTEP: asm_gcstep(as, ir); break; - - /* Guarded assertions. */ - case IR_EQ: case IR_NE: asm_compeq(as, ir); break; - case IR_LT: case IR_GE: case IR_LE: case IR_GT: - case IR_ULT: case IR_UGE: case IR_ULE: case IR_UGT: - case IR_ABC: - asm_comp(as, ir); - break; - - case IR_RETF: asm_retf(as, ir); break; - - /* Bit ops. */ - case IR_BNOT: asm_bitnot(as, ir); break; - case IR_BSWAP: asm_bitswap(as, ir); break; - - case IR_BAND: asm_bitop(as, ir, MIPSI_AND, MIPSI_ANDI); break; - case IR_BOR: asm_bitop(as, ir, MIPSI_OR, MIPSI_ORI); break; - case IR_BXOR: asm_bitop(as, ir, MIPSI_XOR, MIPSI_XORI); break; - - case IR_BSHL: asm_bitshift(as, ir, MIPSI_SLLV, MIPSI_SLL); break; - case IR_BSHR: asm_bitshift(as, ir, MIPSI_SRLV, MIPSI_SRL); break; - case IR_BSAR: asm_bitshift(as, ir, MIPSI_SRAV, MIPSI_SRA); break; - case IR_BROL: lua_assert(0); break; - case IR_BROR: asm_bitror(as, ir); break; - - /* Arithmetic ops. */ - case IR_ADD: asm_add(as, ir); break; - case IR_SUB: asm_sub(as, ir); break; - case IR_MUL: asm_mul(as, ir); break; - case IR_DIV: asm_fparith(as, ir, MIPSI_DIV_D); break; - case IR_MOD: asm_callid(as, ir, IRCALL_lj_vm_modi); break; - case IR_POW: asm_callid(as, ir, IRCALL_lj_vm_powi); break; - case IR_NEG: asm_neg(as, ir); break; - - case IR_ABS: asm_fpunary(as, ir, MIPSI_ABS_D); break; - case IR_ATAN2: asm_callid(as, ir, IRCALL_atan2); break; - case IR_LDEXP: asm_callid(as, ir, IRCALL_ldexp); break; - case IR_MIN: asm_min_max(as, ir, 0); break; - case IR_MAX: asm_min_max(as, ir, 1); break; - case IR_FPMATH: - if (ir->op2 == IRFPM_EXP2 && asm_fpjoin_pow(as, ir)) - break; - if (ir->op2 <= IRFPM_TRUNC) - asm_callround(as, ir, IRCALL_lj_vm_floor + ir->op2); - else if (ir->op2 == IRFPM_SQRT) - asm_fpunary(as, ir, MIPSI_SQRT_D); - else - asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2); - break; - - /* Overflow-checking arithmetic ops. */ - case IR_ADDOV: asm_arithov(as, ir); break; - case IR_SUBOV: asm_arithov(as, ir); break; - case IR_MULOV: asm_mulov(as, ir); break; - - /* Memory references. */ - case IR_AREF: asm_aref(as, ir); break; - case IR_HREF: asm_href(as, ir); break; - case IR_HREFK: asm_hrefk(as, ir); break; - case IR_NEWREF: asm_newref(as, ir); break; - case IR_UREFO: case IR_UREFC: asm_uref(as, ir); break; - case IR_FREF: asm_fref(as, ir); break; - case IR_STRREF: asm_strref(as, ir); break; - - /* Loads and stores. */ - case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: - asm_ahuvload(as, ir); - break; - case IR_FLOAD: asm_fload(as, ir); break; - case IR_XLOAD: asm_xload(as, ir); break; - case IR_SLOAD: asm_sload(as, ir); break; - - case IR_ASTORE: case IR_HSTORE: case IR_USTORE: asm_ahustore(as, ir); break; - case IR_FSTORE: asm_fstore(as, ir); break; - case IR_XSTORE: asm_xstore(as, ir, 0); break; - - /* Allocations. */ - case IR_SNEW: case IR_XSNEW: asm_snew(as, ir); break; - case IR_TNEW: asm_tnew(as, ir); break; - case IR_TDUP: asm_tdup(as, ir); break; - case IR_CNEW: case IR_CNEWI: asm_cnew(as, ir); break; - - /* Write barriers. */ - case IR_TBAR: asm_tbar(as, ir); break; - case IR_OBAR: asm_obar(as, ir); break; - - /* Type conversions. */ - case IR_CONV: asm_conv(as, ir); break; - case IR_TOBIT: asm_tobit(as, ir); break; - case IR_TOSTR: asm_tostr(as, ir); break; - case IR_STRTO: asm_strto(as, ir); break; - - /* Calls. */ - case IR_CALLN: case IR_CALLL: case IR_CALLS: asm_call(as, ir); break; - case IR_CALLXS: asm_callx(as, ir); break; - case IR_CARG: break; - - default: - setintV(&as->J->errinfo, ir->o); - lj_trace_err_info(as->J, LJ_TRERR_NYIIR); - break; - } -} - -/* -- Trace setup --------------------------------------------------------- */ - -/* Ensure there are enough stack slots for call arguments. */ -static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci) -{ - IRRef args[CCI_NARGS_MAX*2]; - uint32_t i, nargs = (int)CCI_NARGS(ci); - int nslots = 4, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR; - asm_collectargs(as, ir, ci, args); - for (i = 0; i < nargs; i++) { - if (args[i] && irt_isfp(IR(args[i])->t) && - nfpr > 0 && !(ci->flags & CCI_VARARG)) { - nfpr--; - ngpr -= irt_isnum(IR(args[i])->t) ? 2 : 1; - } else if (args[i] && irt_isnum(IR(args[i])->t)) { - nfpr = 0; - ngpr = ngpr & ~1; - if (ngpr > 0) ngpr -= 2; else nslots = (nslots+3) & ~1; - } else { - nfpr = 0; - if (ngpr > 0) ngpr--; else nslots++; - } - } - if (nslots > as->evenspill) /* Leave room for args in stack slots. */ - as->evenspill = nslots; - return irt_isfp(ir->t) ? REGSP_HINT(RID_FPRET) : REGSP_HINT(RID_RET); -} - -static void asm_setup_target(ASMState *as) -{ - asm_sparejump_setup(as); - asm_exitstub_setup(as); -} - -/* -- Trace patching ------------------------------------------------------ */ - -/* Patch exit jumps of existing machine code to a new target. */ -void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target) -{ - MCode *p = T->mcode; - MCode *pe = (MCode *)((char *)p + T->szmcode); - MCode *px = exitstub_trace_addr(T, exitno); - MCode *cstart = NULL, *cstop = NULL; - MCode *mcarea = lj_mcode_patch(J, p, 0); - MCode exitload = MIPSI_LI | MIPSF_T(RID_TMP) | exitno; - MCode tjump = MIPSI_J|(((uintptr_t)target>>2)&0x03ffffffu); - for (p++; p < pe; p++) { - if (*p == exitload) { /* Look for load of exit number. */ - if (((p[-1] ^ (px-p)) & 0xffffu) == 0) { /* Look for exitstub branch. */ - ptrdiff_t delta = target - p; - if (((delta + 0x8000) >> 16) == 0) { /* Patch in-range branch. */ - patchbranch: - p[-1] = (p[-1] & 0xffff0000u) | (delta & 0xffffu); - *p = MIPSI_NOP; /* Replace the load of the exit number. */ - cstop = p; - if (!cstart) cstart = p-1; - } else { /* Branch out of range. Use spare jump slot in mcarea. */ - int i; - for (i = 2; i < 2+MIPS_SPAREJUMP*2; i += 2) { - if (mcarea[i] == tjump) { - delta = mcarea+i - p; - goto patchbranch; - } else if (mcarea[i] == MIPSI_NOP) { - mcarea[i] = tjump; - cstart = mcarea+i; - delta = mcarea+i - p; - goto patchbranch; - } - } - /* Ignore jump slot overflow. Child trace is simply not attached. */ - } - } else if (p+1 == pe) { - /* Patch NOP after code for inverted loop branch. Use of J is ok. */ - lua_assert(p[1] == MIPSI_NOP); - p[1] = tjump; - *p = MIPSI_NOP; /* Replace the load of the exit number. */ - cstop = p+2; - if (!cstart) cstart = p+1; - } - } - } - if (cstart) lj_mcode_sync(cstart, cstop); - lj_mcode_patch(J, mcarea, 1); -} - diff --git a/subprojects/luajit/src/lj_asm_ppc.h b/subprojects/luajit/src/lj_asm_ppc.h deleted file mode 100644 index d8a14c839..000000000 --- a/subprojects/luajit/src/lj_asm_ppc.h +++ /dev/null @@ -1,2168 +0,0 @@ -/* -** PPC IR assembler (SSA IR -> machine code). -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -/* -- Register allocator extensions --------------------------------------- */ - -/* Allocate a register with a hint. */ -static Reg ra_hintalloc(ASMState *as, IRRef ref, Reg hint, RegSet allow) -{ - Reg r = IR(ref)->r; - if (ra_noreg(r)) { - if (!ra_hashint(r) && !iscrossref(as, ref)) - ra_sethint(IR(ref)->r, hint); /* Propagate register hint. */ - r = ra_allocref(as, ref, allow); - } - ra_noweak(as, r); - return r; -} - -/* Allocate two source registers for three-operand instructions. */ -static Reg ra_alloc2(ASMState *as, IRIns *ir, RegSet allow) -{ - IRIns *irl = IR(ir->op1), *irr = IR(ir->op2); - Reg left = irl->r, right = irr->r; - if (ra_hasreg(left)) { - ra_noweak(as, left); - if (ra_noreg(right)) - right = ra_allocref(as, ir->op2, rset_exclude(allow, left)); - else - ra_noweak(as, right); - } else if (ra_hasreg(right)) { - ra_noweak(as, right); - left = ra_allocref(as, ir->op1, rset_exclude(allow, right)); - } else if (ra_hashint(right)) { - right = ra_allocref(as, ir->op2, allow); - left = ra_alloc1(as, ir->op1, rset_exclude(allow, right)); - } else { - left = ra_allocref(as, ir->op1, allow); - right = ra_alloc1(as, ir->op2, rset_exclude(allow, left)); - } - return left | (right << 8); -} - -/* -- Guard handling ------------------------------------------------------ */ - -/* Setup exit stubs after the end of each trace. */ -static void asm_exitstub_setup(ASMState *as, ExitNo nexits) -{ - ExitNo i; - MCode *mxp = as->mctop; - if (mxp - (nexits + 3 + MCLIM_REDZONE) < as->mclim) - asm_mclimit(as); - /* 1: mflr r0; bl ->vm_exit_handler; li r0, traceno; bl <1; bl <1; ... */ - for (i = nexits-1; (int32_t)i >= 0; i--) - *--mxp = PPCI_BL|(((-3-i)&0x00ffffffu)<<2); - *--mxp = PPCI_LI|PPCF_T(RID_TMP)|as->T->traceno; /* Read by exit handler. */ - mxp--; - *mxp = PPCI_BL|((((MCode *)(void *)lj_vm_exit_handler-mxp)&0x00ffffffu)<<2); - *--mxp = PPCI_MFLR|PPCF_T(RID_TMP); - as->mctop = mxp; -} - -static MCode *asm_exitstub_addr(ASMState *as, ExitNo exitno) -{ - /* Keep this in-sync with exitstub_trace_addr(). */ - return as->mctop + exitno + 3; -} - -/* Emit conditional branch to exit for guard. */ -static void asm_guardcc(ASMState *as, PPCCC cc) -{ - MCode *target = asm_exitstub_addr(as, as->snapno); - MCode *p = as->mcp; - if (LJ_UNLIKELY(p == as->invmcp)) { - as->loopinv = 1; - *p = PPCI_B | (((target-p) & 0x00ffffffu) << 2); - emit_condbranch(as, PPCI_BC, cc^4, p); - return; - } - emit_condbranch(as, PPCI_BC, cc, target); -} - -/* -- Operand fusion ------------------------------------------------------ */ - -/* Limit linear search to this distance. Avoids O(n^2) behavior. */ -#define CONFLICT_SEARCH_LIM 31 - -/* Check if there's no conflicting instruction between curins and ref. */ -static int noconflict(ASMState *as, IRRef ref, IROp conflict) -{ - IRIns *ir = as->ir; - IRRef i = as->curins; - if (i > ref + CONFLICT_SEARCH_LIM) - return 0; /* Give up, ref is too far away. */ - while (--i > ref) - if (ir[i].o == conflict) - return 0; /* Conflict found. */ - return 1; /* Ok, no conflict. */ -} - -/* Fuse the array base of colocated arrays. */ -static int32_t asm_fuseabase(ASMState *as, IRRef ref) -{ - IRIns *ir = IR(ref); - if (ir->o == IR_TNEW && ir->op1 <= LJ_MAX_COLOSIZE && - !neverfuse(as) && noconflict(as, ref, IR_NEWREF)) - return (int32_t)sizeof(GCtab); - return 0; -} - -/* Indicates load/store indexed is ok. */ -#define AHUREF_LSX ((int32_t)0x80000000) - -/* Fuse array/hash/upvalue reference into register+offset operand. */ -static Reg asm_fuseahuref(ASMState *as, IRRef ref, int32_t *ofsp, RegSet allow) -{ - IRIns *ir = IR(ref); - if (ra_noreg(ir->r)) { - if (ir->o == IR_AREF) { - if (mayfuse(as, ref)) { - if (irref_isk(ir->op2)) { - IRRef tab = IR(ir->op1)->op1; - int32_t ofs = asm_fuseabase(as, tab); - IRRef refa = ofs ? tab : ir->op1; - ofs += 8*IR(ir->op2)->i; - if (checki16(ofs)) { - *ofsp = ofs; - return ra_alloc1(as, refa, allow); - } - } - if (*ofsp == AHUREF_LSX) { - Reg base = ra_alloc1(as, ir->op1, allow); - Reg idx = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, base)); - return base | (idx << 8); - } - } - } else if (ir->o == IR_HREFK) { - if (mayfuse(as, ref)) { - int32_t ofs = (int32_t)(IR(ir->op2)->op2 * sizeof(Node)); - if (checki16(ofs)) { - *ofsp = ofs; - return ra_alloc1(as, ir->op1, allow); - } - } - } else if (ir->o == IR_UREFC) { - if (irref_isk(ir->op1)) { - GCfunc *fn = ir_kfunc(IR(ir->op1)); - int32_t ofs = i32ptr(&gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.tv); - int32_t jgl = (intptr_t)J2G(as->J); - if ((uint32_t)(ofs-jgl) < 65536) { - *ofsp = ofs-jgl-32768; - return RID_JGL; - } else { - *ofsp = (int16_t)ofs; - return ra_allock(as, ofs-(int16_t)ofs, allow); - } - } - } - } - *ofsp = 0; - return ra_alloc1(as, ref, allow); -} - -/* Fuse XLOAD/XSTORE reference into load/store operand. */ -static void asm_fusexref(ASMState *as, PPCIns pi, Reg rt, IRRef ref, - RegSet allow, int32_t ofs) -{ - IRIns *ir = IR(ref); - Reg base; - if (ra_noreg(ir->r) && canfuse(as, ir)) { - if (ir->o == IR_ADD) { - int32_t ofs2; - if (irref_isk(ir->op2) && (ofs2 = ofs + IR(ir->op2)->i, checki16(ofs2))) { - ofs = ofs2; - ref = ir->op1; - } else if (ofs == 0) { - Reg right, left = ra_alloc2(as, ir, allow); - right = (left >> 8); left &= 255; - emit_fab(as, PPCI_LWZX | ((pi >> 20) & 0x780), rt, left, right); - return; - } - } else if (ir->o == IR_STRREF) { - lua_assert(ofs == 0); - ofs = (int32_t)sizeof(GCstr); - if (irref_isk(ir->op2)) { - ofs += IR(ir->op2)->i; - ref = ir->op1; - } else if (irref_isk(ir->op1)) { - ofs += IR(ir->op1)->i; - ref = ir->op2; - } else { - /* NYI: Fuse ADD with constant. */ - Reg tmp, right, left = ra_alloc2(as, ir, allow); - right = (left >> 8); left &= 255; - tmp = ra_scratch(as, rset_exclude(rset_exclude(allow, left), right)); - emit_fai(as, pi, rt, tmp, ofs); - emit_tab(as, PPCI_ADD, tmp, left, right); - return; - } - if (!checki16(ofs)) { - Reg left = ra_alloc1(as, ref, allow); - Reg right = ra_allock(as, ofs, rset_exclude(allow, left)); - emit_fab(as, PPCI_LWZX | ((pi >> 20) & 0x780), rt, left, right); - return; - } - } - } - base = ra_alloc1(as, ref, allow); - emit_fai(as, pi, rt, base, ofs); -} - -/* Fuse XLOAD/XSTORE reference into indexed-only load/store operand. */ -static void asm_fusexrefx(ASMState *as, PPCIns pi, Reg rt, IRRef ref, - RegSet allow) -{ - IRIns *ira = IR(ref); - Reg right, left; - if (canfuse(as, ira) && ira->o == IR_ADD && ra_noreg(ira->r)) { - left = ra_alloc2(as, ira, allow); - right = (left >> 8); left &= 255; - } else { - right = ra_alloc1(as, ref, allow); - left = RID_R0; - } - emit_tab(as, pi, rt, left, right); -} - -/* Fuse to multiply-add/sub instruction. */ -static int asm_fusemadd(ASMState *as, IRIns *ir, PPCIns pi, PPCIns pir) -{ - IRRef lref = ir->op1, rref = ir->op2; - IRIns *irm; - if (lref != rref && - ((mayfuse(as, lref) && (irm = IR(lref), irm->o == IR_MUL) && - ra_noreg(irm->r)) || - (mayfuse(as, rref) && (irm = IR(rref), irm->o == IR_MUL) && - (rref = lref, pi = pir, ra_noreg(irm->r))))) { - Reg dest = ra_dest(as, ir, RSET_FPR); - Reg add = ra_alloc1(as, rref, RSET_FPR); - Reg right, left = ra_alloc2(as, irm, rset_exclude(RSET_FPR, add)); - right = (left >> 8); left &= 255; - emit_facb(as, pi, dest, left, right, add); - return 1; - } - return 0; -} - -/* -- Calls --------------------------------------------------------------- */ - -/* Generate a call to a C function. */ -static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args) -{ - uint32_t n, nargs = CCI_NARGS(ci); - int32_t ofs = 8; - Reg gpr = REGARG_FIRSTGPR, fpr = REGARG_FIRSTFPR; - if ((void *)ci->func) - emit_call(as, (void *)ci->func); - for (n = 0; n < nargs; n++) { /* Setup args. */ - IRRef ref = args[n]; - if (ref) { - IRIns *ir = IR(ref); - if (irt_isfp(ir->t)) { - if (fpr <= REGARG_LASTFPR) { - lua_assert(rset_test(as->freeset, fpr)); /* Already evicted. */ - ra_leftov(as, fpr, ref); - fpr++; - } else { - Reg r = ra_alloc1(as, ref, RSET_FPR); - if (irt_isnum(ir->t)) ofs = (ofs + 4) & ~4; - emit_spstore(as, ir, r, ofs); - ofs += irt_isnum(ir->t) ? 8 : 4; - } - } else { - if (gpr <= REGARG_LASTGPR) { - lua_assert(rset_test(as->freeset, gpr)); /* Already evicted. */ - ra_leftov(as, gpr, ref); - gpr++; - } else { - Reg r = ra_alloc1(as, ref, RSET_GPR); - emit_spstore(as, ir, r, ofs); - ofs += 4; - } - } - } else { - if (gpr <= REGARG_LASTGPR) - gpr++; - else - ofs += 4; - } - checkmclim(as); - } - if ((ci->flags & CCI_VARARG)) /* Vararg calls need to know about FPR use. */ - emit_tab(as, fpr == REGARG_FIRSTFPR ? PPCI_CRXOR : PPCI_CREQV, 6, 6, 6); -} - -/* Setup result reg/sp for call. Evict scratch regs. */ -static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci) -{ - RegSet drop = RSET_SCRATCH; - int hiop = ((ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t)); - if ((ci->flags & CCI_NOFPRCLOBBER)) - drop &= ~RSET_FPR; - if (ra_hasreg(ir->r)) - rset_clear(drop, ir->r); /* Dest reg handled below. */ - if (hiop && ra_hasreg((ir+1)->r)) - rset_clear(drop, (ir+1)->r); /* Dest reg handled below. */ - ra_evictset(as, drop); /* Evictions must be performed first. */ - if (ra_used(ir)) { - lua_assert(!irt_ispri(ir->t)); - if (irt_isfp(ir->t)) { - if ((ci->flags & CCI_CASTU64)) { - /* Use spill slot or temp slots. */ - int32_t ofs = ir->s ? sps_scale(ir->s) : SPOFS_TMP; - Reg dest = ir->r; - if (ra_hasreg(dest)) { - ra_free(as, dest); - ra_modified(as, dest); - emit_fai(as, PPCI_LFD, dest, RID_SP, ofs); - } - emit_tai(as, PPCI_STW, RID_RETHI, RID_SP, ofs); - emit_tai(as, PPCI_STW, RID_RETLO, RID_SP, ofs+4); - } else { - ra_destreg(as, ir, RID_FPRET); - } - } else if (hiop) { - ra_destpair(as, ir); - } else { - ra_destreg(as, ir, RID_RET); - } - } -} - -static void asm_call(ASMState *as, IRIns *ir) -{ - IRRef args[CCI_NARGS_MAX]; - const CCallInfo *ci = &lj_ir_callinfo[ir->op2]; - asm_collectargs(as, ir, ci, args); - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); -} - -static void asm_callx(ASMState *as, IRIns *ir) -{ - IRRef args[CCI_NARGS_MAX*2]; - CCallInfo ci; - IRRef func; - IRIns *irf; - ci.flags = asm_callx_flags(as, ir); - asm_collectargs(as, ir, &ci, args); - asm_setupresult(as, ir, &ci); - func = ir->op2; irf = IR(func); - if (irf->o == IR_CARG) { func = irf->op1; irf = IR(func); } - if (irref_isk(func)) { /* Call to constant address. */ - ci.func = (ASMFunction)(void *)(irf->i); - } else { /* Need a non-argument register for indirect calls. */ - RegSet allow = RSET_GPR & ~RSET_RANGE(RID_R0, REGARG_LASTGPR+1); - Reg freg = ra_alloc1(as, func, allow); - *--as->mcp = PPCI_BCTRL; - *--as->mcp = PPCI_MTCTR | PPCF_T(freg); - ci.func = (ASMFunction)(void *)0; - } - asm_gencall(as, &ci, args); -} - -static void asm_callid(ASMState *as, IRIns *ir, IRCallID id) -{ - const CCallInfo *ci = &lj_ir_callinfo[id]; - IRRef args[2]; - args[0] = ir->op1; - args[1] = ir->op2; - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); -} - -/* -- Returns ------------------------------------------------------------- */ - -/* Return to lower frame. Guard that it goes to the right spot. */ -static void asm_retf(ASMState *as, IRIns *ir) -{ - Reg base = ra_alloc1(as, REF_BASE, RSET_GPR); - void *pc = ir_kptr(IR(ir->op2)); - int32_t delta = 1+bc_a(*((const BCIns *)pc - 1)); - as->topslot -= (BCReg)delta; - if ((int32_t)as->topslot < 0) as->topslot = 0; - irt_setmark(IR(REF_BASE)->t); /* Children must not coalesce with BASE reg. */ - emit_setgl(as, base, jit_base); - emit_addptr(as, base, -8*delta); - asm_guardcc(as, CC_NE); - emit_ab(as, PPCI_CMPW, RID_TMP, - ra_allock(as, i32ptr(pc), rset_exclude(RSET_GPR, base))); - emit_tai(as, PPCI_LWZ, RID_TMP, base, -8); -} - -/* -- Type conversions ---------------------------------------------------- */ - -static void asm_tointg(ASMState *as, IRIns *ir, Reg left) -{ - RegSet allow = RSET_FPR; - Reg tmp = ra_scratch(as, rset_clear(allow, left)); - Reg fbias = ra_scratch(as, rset_clear(allow, tmp)); - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg hibias = ra_allock(as, 0x43300000, rset_exclude(RSET_GPR, dest)); - asm_guardcc(as, CC_NE); - emit_fab(as, PPCI_FCMPU, 0, tmp, left); - emit_fab(as, PPCI_FSUB, tmp, tmp, fbias); - emit_fai(as, PPCI_LFD, tmp, RID_SP, SPOFS_TMP); - emit_tai(as, PPCI_STW, RID_TMP, RID_SP, SPOFS_TMPLO); - emit_tai(as, PPCI_STW, hibias, RID_SP, SPOFS_TMPHI); - emit_asi(as, PPCI_XORIS, RID_TMP, dest, 0x8000); - emit_tai(as, PPCI_LWZ, dest, RID_SP, SPOFS_TMPLO); - emit_lsptr(as, PPCI_LFS, (fbias & 31), - (void *)lj_ir_k64_find(as->J, U64x(59800004,59800000)), - RSET_GPR); - emit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP); - emit_fb(as, PPCI_FCTIWZ, tmp, left); -} - -static void asm_tobit(ASMState *as, IRIns *ir) -{ - RegSet allow = RSET_FPR; - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_alloc1(as, ir->op1, allow); - Reg right = ra_alloc1(as, ir->op2, rset_clear(allow, left)); - Reg tmp = ra_scratch(as, rset_clear(allow, right)); - emit_tai(as, PPCI_LWZ, dest, RID_SP, SPOFS_TMPLO); - emit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP); - emit_fab(as, PPCI_FADD, tmp, left, right); -} - -static void asm_conv(ASMState *as, IRIns *ir) -{ - IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK); - int stfp = (st == IRT_NUM || st == IRT_FLOAT); - IRRef lref = ir->op1; - lua_assert(irt_type(ir->t) != st); - lua_assert(!(irt_isint64(ir->t) || - (st == IRT_I64 || st == IRT_U64))); /* Handled by SPLIT. */ - if (irt_isfp(ir->t)) { - Reg dest = ra_dest(as, ir, RSET_FPR); - if (stfp) { /* FP to FP conversion. */ - if (st == IRT_NUM) /* double -> float conversion. */ - emit_fb(as, PPCI_FRSP, dest, ra_alloc1(as, lref, RSET_FPR)); - else /* float -> double conversion is a no-op on PPC. */ - ra_leftov(as, dest, lref); /* Do nothing, but may need to move regs. */ - } else { /* Integer to FP conversion. */ - /* IRT_INT: Flip hibit, bias with 2^52, subtract 2^52+2^31. */ - /* IRT_U32: Bias with 2^52, subtract 2^52. */ - RegSet allow = RSET_GPR; - Reg left = ra_alloc1(as, lref, allow); - Reg hibias = ra_allock(as, 0x43300000, rset_clear(allow, left)); - Reg fbias = ra_scratch(as, rset_exclude(RSET_FPR, dest)); - const float *kbias; - if (irt_isfloat(ir->t)) emit_fb(as, PPCI_FRSP, dest, dest); - emit_fab(as, PPCI_FSUB, dest, dest, fbias); - emit_fai(as, PPCI_LFD, dest, RID_SP, SPOFS_TMP); - kbias = (const float *)lj_ir_k64_find(as->J, U64x(59800004,59800000)); - if (st == IRT_U32) kbias++; - emit_lsptr(as, PPCI_LFS, (fbias & 31), (void *)kbias, - rset_clear(allow, hibias)); - emit_tai(as, PPCI_STW, st == IRT_U32 ? left : RID_TMP, - RID_SP, SPOFS_TMPLO); - emit_tai(as, PPCI_STW, hibias, RID_SP, SPOFS_TMPHI); - if (st != IRT_U32) emit_asi(as, PPCI_XORIS, RID_TMP, left, 0x8000); - } - } else if (stfp) { /* FP to integer conversion. */ - if (irt_isguard(ir->t)) { - /* Checked conversions are only supported from number to int. */ - lua_assert(irt_isint(ir->t) && st == IRT_NUM); - asm_tointg(as, ir, ra_alloc1(as, lref, RSET_FPR)); - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_alloc1(as, lref, RSET_FPR); - Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, left)); - if (irt_isu32(ir->t)) { - /* Convert both x and x-2^31 to int and merge results. */ - Reg tmpi = ra_scratch(as, rset_exclude(RSET_GPR, dest)); - emit_asb(as, PPCI_OR, dest, dest, tmpi); /* Select with mask idiom. */ - emit_asb(as, PPCI_AND, tmpi, tmpi, RID_TMP); - emit_asb(as, PPCI_ANDC, dest, dest, RID_TMP); - emit_tai(as, PPCI_LWZ, tmpi, RID_SP, SPOFS_TMPLO); /* tmp = (int)(x) */ - emit_tai(as, PPCI_ADDIS, dest, dest, 0x8000); /* dest += 2^31 */ - emit_asb(as, PPCI_SRAWI, RID_TMP, dest, 31); /* mask = -(dest < 0) */ - emit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP); - emit_tai(as, PPCI_LWZ, dest, - RID_SP, SPOFS_TMPLO); /* dest = (int)(x-2^31) */ - emit_fb(as, PPCI_FCTIWZ, tmp, left); - emit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP); - emit_fb(as, PPCI_FCTIWZ, tmp, tmp); - emit_fab(as, PPCI_FSUB, tmp, left, tmp); - emit_lsptr(as, PPCI_LFS, (tmp & 31), - (void *)lj_ir_k64_find(as->J, U64x(4f000000,00000000)), - RSET_GPR); - } else { - emit_tai(as, PPCI_LWZ, dest, RID_SP, SPOFS_TMPLO); - emit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP); - emit_fb(as, PPCI_FCTIWZ, tmp, left); - } - } - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - if (st >= IRT_I8 && st <= IRT_U16) { /* Extend to 32 bit integer. */ - Reg left = ra_alloc1(as, ir->op1, RSET_GPR); - lua_assert(irt_isint(ir->t) || irt_isu32(ir->t)); - if ((ir->op2 & IRCONV_SEXT)) - emit_as(as, st == IRT_I8 ? PPCI_EXTSB : PPCI_EXTSH, dest, left); - else - emit_rot(as, PPCI_RLWINM, dest, left, 0, st == IRT_U8 ? 24 : 16, 31); - } else { /* 32/64 bit integer conversions. */ - /* Only need to handle 32/32 bit no-op (cast) on 32 bit archs. */ - ra_leftov(as, dest, lref); /* Do nothing, but may need to move regs. */ - } - } -} - -#if LJ_HASFFI -static void asm_conv64(ASMState *as, IRIns *ir) -{ - IRType st = (IRType)((ir-1)->op2 & IRCONV_SRCMASK); - IRType dt = (((ir-1)->op2 & IRCONV_DSTMASK) >> IRCONV_DSH); - IRCallID id; - const CCallInfo *ci; - IRRef args[2]; - args[0] = ir->op1; - args[1] = (ir-1)->op1; - if (st == IRT_NUM || st == IRT_FLOAT) { - id = IRCALL_fp64_d2l + ((st == IRT_FLOAT) ? 2 : 0) + (dt - IRT_I64); - ir--; - } else { - id = IRCALL_fp64_l2d + ((dt == IRT_FLOAT) ? 2 : 0) + (st - IRT_I64); - } - ci = &lj_ir_callinfo[id]; - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); -} -#endif - -static void asm_strto(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num]; - IRRef args[2]; - int32_t ofs; - RegSet drop = RSET_SCRATCH; - if (ra_hasreg(ir->r)) rset_set(drop, ir->r); /* Spill dest reg (if any). */ - ra_evictset(as, drop); - asm_guardcc(as, CC_EQ); - emit_ai(as, PPCI_CMPWI, RID_RET, 0); /* Test return status. */ - args[0] = ir->op1; /* GCstr *str */ - args[1] = ASMREF_TMP1; /* TValue *n */ - asm_gencall(as, ci, args); - /* Store the result to the spill slot or temp slots. */ - ofs = ir->s ? sps_scale(ir->s) : SPOFS_TMP; - emit_tai(as, PPCI_ADDI, ra_releasetmp(as, ASMREF_TMP1), RID_SP, ofs); -} - -/* Get pointer to TValue. */ -static void asm_tvptr(ASMState *as, Reg dest, IRRef ref) -{ - IRIns *ir = IR(ref); - if (irt_isnum(ir->t)) { - if (irref_isk(ref)) /* Use the number constant itself as a TValue. */ - ra_allockreg(as, i32ptr(ir_knum(ir)), dest); - else /* Otherwise force a spill and use the spill slot. */ - emit_tai(as, PPCI_ADDI, dest, RID_SP, ra_spill(as, ir)); - } else { - /* Otherwise use g->tmptv to hold the TValue. */ - RegSet allow = rset_exclude(RSET_GPR, dest); - Reg type; - emit_tai(as, PPCI_ADDI, dest, RID_JGL, offsetof(global_State, tmptv)-32768); - if (!irt_ispri(ir->t)) { - Reg src = ra_alloc1(as, ref, allow); - emit_setgl(as, src, tmptv.gcr); - } - type = ra_allock(as, irt_toitype(ir->t), allow); - emit_setgl(as, type, tmptv.it); - } -} - -static void asm_tostr(ASMState *as, IRIns *ir) -{ - IRRef args[2]; - args[0] = ASMREF_L; - as->gcsteps++; - if (irt_isnum(IR(ir->op1)->t) || (ir+1)->o == IR_HIOP) { - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromnum]; - args[1] = ASMREF_TMP1; /* const lua_Number * */ - asm_setupresult(as, ir, ci); /* GCstr * */ - asm_gencall(as, ci, args); - asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op1); - } else { - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromint]; - args[1] = ir->op1; /* int32_t k */ - asm_setupresult(as, ir, ci); /* GCstr * */ - asm_gencall(as, ci, args); - } -} - -/* -- Memory references --------------------------------------------------- */ - -static void asm_aref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg idx, base; - if (irref_isk(ir->op2)) { - IRRef tab = IR(ir->op1)->op1; - int32_t ofs = asm_fuseabase(as, tab); - IRRef refa = ofs ? tab : ir->op1; - ofs += 8*IR(ir->op2)->i; - if (checki16(ofs)) { - base = ra_alloc1(as, refa, RSET_GPR); - emit_tai(as, PPCI_ADDI, dest, base, ofs); - return; - } - } - base = ra_alloc1(as, ir->op1, RSET_GPR); - idx = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, base)); - emit_tab(as, PPCI_ADD, dest, RID_TMP, base); - emit_slwi(as, RID_TMP, idx, 3); -} - -/* Inlined hash lookup. Specialized for key type and for const keys. -** The equivalent C code is: -** Node *n = hashkey(t, key); -** do { -** if (lj_obj_equal(&n->key, key)) return &n->val; -** } while ((n = nextnode(n))); -** return niltv(L); -*/ -static void asm_href(ASMState *as, IRIns *ir, IROp merge) -{ - RegSet allow = RSET_GPR; - int destused = ra_used(ir); - Reg dest = ra_dest(as, ir, allow); - Reg tab = ra_alloc1(as, ir->op1, rset_clear(allow, dest)); - Reg key = RID_NONE, tmp1 = RID_TMP, tmp2; - Reg tisnum = RID_NONE, tmpnum = RID_NONE; - IRRef refkey = ir->op2; - IRIns *irkey = IR(refkey); - IRType1 kt = irkey->t; - uint32_t khash; - MCLabel l_end, l_loop, l_next; - - rset_clear(allow, tab); - if (irt_isnum(kt)) { - key = ra_alloc1(as, refkey, RSET_FPR); - tmpnum = ra_scratch(as, rset_exclude(RSET_FPR, key)); - tisnum = ra_allock(as, (int32_t)LJ_TISNUM, allow); - rset_clear(allow, tisnum); - } else if (!irt_ispri(kt)) { - key = ra_alloc1(as, refkey, allow); - rset_clear(allow, key); - } - tmp2 = ra_scratch(as, allow); - rset_clear(allow, tmp2); - - /* Key not found in chain: jump to exit (if merged) or load niltv. */ - l_end = emit_label(as); - as->invmcp = NULL; - if (merge == IR_NE) - asm_guardcc(as, CC_EQ); - else if (destused) - emit_loada(as, dest, niltvg(J2G(as->J))); - - /* Follow hash chain until the end. */ - l_loop = --as->mcp; - emit_ai(as, PPCI_CMPWI, dest, 0); - emit_tai(as, PPCI_LWZ, dest, dest, (int32_t)offsetof(Node, next)); - l_next = emit_label(as); - - /* Type and value comparison. */ - if (merge == IR_EQ) - asm_guardcc(as, CC_EQ); - else - emit_condbranch(as, PPCI_BC|PPCF_Y, CC_EQ, l_end); - if (irt_isnum(kt)) { - emit_fab(as, PPCI_FCMPU, 0, tmpnum, key); - emit_condbranch(as, PPCI_BC, CC_GE, l_next); - emit_ab(as, PPCI_CMPLW, tmp1, tisnum); - emit_fai(as, PPCI_LFD, tmpnum, dest, (int32_t)offsetof(Node, key.n)); - } else { - if (!irt_ispri(kt)) { - emit_ab(as, PPCI_CMPW, tmp2, key); - emit_condbranch(as, PPCI_BC, CC_NE, l_next); - } - emit_ai(as, PPCI_CMPWI, tmp1, irt_toitype(irkey->t)); - if (!irt_ispri(kt)) - emit_tai(as, PPCI_LWZ, tmp2, dest, (int32_t)offsetof(Node, key.gcr)); - } - emit_tai(as, PPCI_LWZ, tmp1, dest, (int32_t)offsetof(Node, key.it)); - *l_loop = PPCI_BC | PPCF_Y | PPCF_CC(CC_NE) | - (((char *)as->mcp-(char *)l_loop) & 0xffffu); - - /* Load main position relative to tab->node into dest. */ - khash = irref_isk(refkey) ? ir_khash(irkey) : 1; - if (khash == 0) { - emit_tai(as, PPCI_LWZ, dest, tab, (int32_t)offsetof(GCtab, node)); - } else { - Reg tmphash = tmp1; - if (irref_isk(refkey)) - tmphash = ra_allock(as, khash, allow); - emit_tab(as, PPCI_ADD, dest, dest, tmp1); - emit_tai(as, PPCI_MULLI, tmp1, tmp1, sizeof(Node)); - emit_asb(as, PPCI_AND, tmp1, tmp2, tmphash); - emit_tai(as, PPCI_LWZ, dest, tab, (int32_t)offsetof(GCtab, node)); - emit_tai(as, PPCI_LWZ, tmp2, tab, (int32_t)offsetof(GCtab, hmask)); - if (irref_isk(refkey)) { - /* Nothing to do. */ - } else if (irt_isstr(kt)) { - emit_tai(as, PPCI_LWZ, tmp1, key, (int32_t)offsetof(GCstr, hash)); - } else { /* Must match with hash*() in lj_tab.c. */ - emit_tab(as, PPCI_SUBF, tmp1, tmp2, tmp1); - emit_rotlwi(as, tmp2, tmp2, HASH_ROT3); - emit_asb(as, PPCI_XOR, tmp1, tmp1, tmp2); - emit_rotlwi(as, tmp1, tmp1, (HASH_ROT2+HASH_ROT1)&31); - emit_tab(as, PPCI_SUBF, tmp2, dest, tmp2); - if (irt_isnum(kt)) { - int32_t ofs = ra_spill(as, irkey); - emit_asb(as, PPCI_XOR, tmp2, tmp2, tmp1); - emit_rotlwi(as, dest, tmp1, HASH_ROT1); - emit_tab(as, PPCI_ADD, tmp1, tmp1, tmp1); - emit_tai(as, PPCI_LWZ, tmp2, RID_SP, ofs+4); - emit_tai(as, PPCI_LWZ, tmp1, RID_SP, ofs); - } else { - emit_asb(as, PPCI_XOR, tmp2, key, tmp1); - emit_rotlwi(as, dest, tmp1, HASH_ROT1); - emit_tai(as, PPCI_ADDI, tmp1, tmp2, HASH_BIAS); - emit_tai(as, PPCI_ADDIS, tmp2, key, (HASH_BIAS + 32768)>>16); - } - } - } -} - -static void asm_hrefk(ASMState *as, IRIns *ir) -{ - IRIns *kslot = IR(ir->op2); - IRIns *irkey = IR(kslot->op1); - int32_t ofs = (int32_t)(kslot->op2 * sizeof(Node)); - int32_t kofs = ofs + (int32_t)offsetof(Node, key); - Reg dest = (ra_used(ir)||ofs > 32736) ? ra_dest(as, ir, RSET_GPR) : RID_NONE; - Reg node = ra_alloc1(as, ir->op1, RSET_GPR); - Reg key = RID_NONE, type = RID_TMP, idx = node; - RegSet allow = rset_exclude(RSET_GPR, node); - lua_assert(ofs % sizeof(Node) == 0); - if (ofs > 32736) { - idx = dest; - rset_clear(allow, dest); - kofs = (int32_t)offsetof(Node, key); - } else if (ra_hasreg(dest)) { - emit_tai(as, PPCI_ADDI, dest, node, ofs); - } - asm_guardcc(as, CC_NE); - if (!irt_ispri(irkey->t)) { - key = ra_scratch(as, allow); - rset_clear(allow, key); - } - rset_clear(allow, type); - if (irt_isnum(irkey->t)) { - emit_cmpi(as, key, (int32_t)ir_knum(irkey)->u32.lo); - asm_guardcc(as, CC_NE); - emit_cmpi(as, type, (int32_t)ir_knum(irkey)->u32.hi); - } else { - if (ra_hasreg(key)) { - emit_cmpi(as, key, irkey->i); /* May use RID_TMP, i.e. type. */ - asm_guardcc(as, CC_NE); - } - emit_ai(as, PPCI_CMPWI, type, irt_toitype(irkey->t)); - } - if (ra_hasreg(key)) emit_tai(as, PPCI_LWZ, key, idx, kofs+4); - emit_tai(as, PPCI_LWZ, type, idx, kofs); - if (ofs > 32736) { - emit_tai(as, PPCI_ADDIS, dest, dest, (ofs + 32768) >> 16); - emit_tai(as, PPCI_ADDI, dest, node, ofs); - } -} - -static void asm_newref(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey]; - IRRef args[3]; - if (ir->r == RID_SINK) - return; - args[0] = ASMREF_L; /* lua_State *L */ - args[1] = ir->op1; /* GCtab *t */ - args[2] = ASMREF_TMP1; /* cTValue *key */ - asm_setupresult(as, ir, ci); /* TValue * */ - asm_gencall(as, ci, args); - asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op2); -} - -static void asm_uref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - if (irref_isk(ir->op1)) { - GCfunc *fn = ir_kfunc(IR(ir->op1)); - MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v; - emit_lsptr(as, PPCI_LWZ, dest, v, RSET_GPR); - } else { - Reg uv = ra_scratch(as, RSET_GPR); - Reg func = ra_alloc1(as, ir->op1, RSET_GPR); - if (ir->o == IR_UREFC) { - asm_guardcc(as, CC_NE); - emit_ai(as, PPCI_CMPWI, RID_TMP, 1); - emit_tai(as, PPCI_ADDI, dest, uv, (int32_t)offsetof(GCupval, tv)); - emit_tai(as, PPCI_LBZ, RID_TMP, uv, (int32_t)offsetof(GCupval, closed)); - } else { - emit_tai(as, PPCI_LWZ, dest, uv, (int32_t)offsetof(GCupval, v)); - } - emit_tai(as, PPCI_LWZ, uv, func, - (int32_t)offsetof(GCfuncL, uvptr) + 4*(int32_t)(ir->op2 >> 8)); - } -} - -static void asm_fref(ASMState *as, IRIns *ir) -{ - UNUSED(as); UNUSED(ir); - lua_assert(!ra_used(ir)); -} - -static void asm_strref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - IRRef ref = ir->op2, refk = ir->op1; - int32_t ofs = (int32_t)sizeof(GCstr); - Reg r; - if (irref_isk(ref)) { - IRRef tmp = refk; refk = ref; ref = tmp; - } else if (!irref_isk(refk)) { - Reg right, left = ra_alloc1(as, ir->op1, RSET_GPR); - IRIns *irr = IR(ir->op2); - if (ra_hasreg(irr->r)) { - ra_noweak(as, irr->r); - right = irr->r; - } else if (mayfuse(as, irr->op2) && - irr->o == IR_ADD && irref_isk(irr->op2) && - checki16(ofs + IR(irr->op2)->i)) { - ofs += IR(irr->op2)->i; - right = ra_alloc1(as, irr->op1, rset_exclude(RSET_GPR, left)); - } else { - right = ra_allocref(as, ir->op2, rset_exclude(RSET_GPR, left)); - } - emit_tai(as, PPCI_ADDI, dest, dest, ofs); - emit_tab(as, PPCI_ADD, dest, left, right); - return; - } - r = ra_alloc1(as, ref, RSET_GPR); - ofs += IR(refk)->i; - if (checki16(ofs)) - emit_tai(as, PPCI_ADDI, dest, r, ofs); - else - emit_tab(as, PPCI_ADD, dest, r, - ra_allock(as, ofs, rset_exclude(RSET_GPR, r))); -} - -/* -- Loads and stores ---------------------------------------------------- */ - -static PPCIns asm_fxloadins(IRIns *ir) -{ - switch (irt_type(ir->t)) { - case IRT_I8: return PPCI_LBZ; /* Needs sign-extension. */ - case IRT_U8: return PPCI_LBZ; - case IRT_I16: return PPCI_LHA; - case IRT_U16: return PPCI_LHZ; - case IRT_NUM: return PPCI_LFD; - case IRT_FLOAT: return PPCI_LFS; - default: return PPCI_LWZ; - } -} - -static PPCIns asm_fxstoreins(IRIns *ir) -{ - switch (irt_type(ir->t)) { - case IRT_I8: case IRT_U8: return PPCI_STB; - case IRT_I16: case IRT_U16: return PPCI_STH; - case IRT_NUM: return PPCI_STFD; - case IRT_FLOAT: return PPCI_STFS; - default: return PPCI_STW; - } -} - -static void asm_fload(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg idx = ra_alloc1(as, ir->op1, RSET_GPR); - PPCIns pi = asm_fxloadins(ir); - int32_t ofs; - if (ir->op2 == IRFL_TAB_ARRAY) { - ofs = asm_fuseabase(as, ir->op1); - if (ofs) { /* Turn the t->array load into an add for colocated arrays. */ - emit_tai(as, PPCI_ADDI, dest, idx, ofs); - return; - } - } - ofs = field_ofs[ir->op2]; - lua_assert(!irt_isi8(ir->t)); - emit_tai(as, pi, dest, idx, ofs); -} - -static void asm_fstore(ASMState *as, IRIns *ir) -{ - if (ir->r != RID_SINK) { - Reg src = ra_alloc1(as, ir->op2, RSET_GPR); - IRIns *irf = IR(ir->op1); - Reg idx = ra_alloc1(as, irf->op1, rset_exclude(RSET_GPR, src)); - int32_t ofs = field_ofs[irf->op2]; - PPCIns pi = asm_fxstoreins(ir); - emit_tai(as, pi, src, idx, ofs); - } -} - -static void asm_xload(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); - lua_assert(!(ir->op2 & IRXLOAD_UNALIGNED)); - if (irt_isi8(ir->t)) - emit_as(as, PPCI_EXTSB, dest, dest); - asm_fusexref(as, asm_fxloadins(ir), dest, ir->op1, RSET_GPR, 0); -} - -static void asm_xstore(ASMState *as, IRIns *ir, int32_t ofs) -{ - IRIns *irb; - if (ir->r == RID_SINK) - return; - if (ofs == 0 && mayfuse(as, ir->op2) && (irb = IR(ir->op2))->o == IR_BSWAP && - ra_noreg(irb->r) && (irt_isint(ir->t) || irt_isu32(ir->t))) { - /* Fuse BSWAP with XSTORE to stwbrx. */ - Reg src = ra_alloc1(as, irb->op1, RSET_GPR); - asm_fusexrefx(as, PPCI_STWBRX, src, ir->op1, rset_exclude(RSET_GPR, src)); - } else { - Reg src = ra_alloc1(as, ir->op2, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); - asm_fusexref(as, asm_fxstoreins(ir), src, ir->op1, - rset_exclude(RSET_GPR, src), ofs); - } -} - -static void asm_ahuvload(ASMState *as, IRIns *ir) -{ - IRType1 t = ir->t; - Reg dest = RID_NONE, type = RID_TMP, tmp = RID_TMP, idx; - RegSet allow = RSET_GPR; - int32_t ofs = AHUREF_LSX; - if (ra_used(ir)) { - lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t)); - if (!irt_isnum(t)) ofs = 0; - dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR); - rset_clear(allow, dest); - } - idx = asm_fuseahuref(as, ir->op1, &ofs, allow); - if (irt_isnum(t)) { - Reg tisnum = ra_allock(as, (int32_t)LJ_TISNUM, rset_exclude(allow, idx)); - asm_guardcc(as, CC_GE); - emit_ab(as, PPCI_CMPLW, type, tisnum); - if (ra_hasreg(dest)) { - if (ofs == AHUREF_LSX) { - tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR, - (idx&255)), (idx>>8))); - emit_fab(as, PPCI_LFDX, dest, (idx&255), tmp); - } else { - emit_fai(as, PPCI_LFD, dest, idx, ofs); - } - } - } else { - asm_guardcc(as, CC_NE); - emit_ai(as, PPCI_CMPWI, type, irt_toitype(t)); - if (ra_hasreg(dest)) emit_tai(as, PPCI_LWZ, dest, idx, ofs+4); - } - if (ofs == AHUREF_LSX) { - emit_tab(as, PPCI_LWZX, type, (idx&255), tmp); - emit_slwi(as, tmp, (idx>>8), 3); - } else { - emit_tai(as, PPCI_LWZ, type, idx, ofs); - } -} - -static void asm_ahustore(ASMState *as, IRIns *ir) -{ - RegSet allow = RSET_GPR; - Reg idx, src = RID_NONE, type = RID_NONE; - int32_t ofs = AHUREF_LSX; - if (ir->r == RID_SINK) - return; - if (irt_isnum(ir->t)) { - src = ra_alloc1(as, ir->op2, RSET_FPR); - } else { - if (!irt_ispri(ir->t)) { - src = ra_alloc1(as, ir->op2, allow); - rset_clear(allow, src); - ofs = 0; - } - type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow); - rset_clear(allow, type); - } - idx = asm_fuseahuref(as, ir->op1, &ofs, allow); - if (irt_isnum(ir->t)) { - if (ofs == AHUREF_LSX) { - emit_fab(as, PPCI_STFDX, src, (idx&255), RID_TMP); - emit_slwi(as, RID_TMP, (idx>>8), 3); - } else { - emit_fai(as, PPCI_STFD, src, idx, ofs); - } - } else { - if (ra_hasreg(src)) - emit_tai(as, PPCI_STW, src, idx, ofs+4); - if (ofs == AHUREF_LSX) { - emit_tab(as, PPCI_STWX, type, (idx&255), RID_TMP); - emit_slwi(as, RID_TMP, (idx>>8), 3); - } else { - emit_tai(as, PPCI_STW, type, idx, ofs); - } - } -} - -static void asm_sload(ASMState *as, IRIns *ir) -{ - int32_t ofs = 8*((int32_t)ir->op1-1) + ((ir->op2 & IRSLOAD_FRAME) ? 0 : 4); - IRType1 t = ir->t; - Reg dest = RID_NONE, type = RID_NONE, base; - RegSet allow = RSET_GPR; - lua_assert(!(ir->op2 & IRSLOAD_PARENT)); /* Handled by asm_head_side(). */ - lua_assert(irt_isguard(t) || !(ir->op2 & IRSLOAD_TYPECHECK)); - lua_assert(LJ_DUALNUM || - !irt_isint(t) || (ir->op2 & (IRSLOAD_CONVERT|IRSLOAD_FRAME))); - if ((ir->op2 & IRSLOAD_CONVERT) && irt_isguard(t) && irt_isint(t)) { - dest = ra_scratch(as, RSET_FPR); - asm_tointg(as, ir, dest); - t.irt = IRT_NUM; /* Continue with a regular number type check. */ - } else if (ra_used(ir)) { - lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t)); - dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR); - rset_clear(allow, dest); - base = ra_alloc1(as, REF_BASE, allow); - rset_clear(allow, base); - if ((ir->op2 & IRSLOAD_CONVERT)) { - if (irt_isint(t)) { - emit_tai(as, PPCI_LWZ, dest, RID_SP, SPOFS_TMPLO); - dest = ra_scratch(as, RSET_FPR); - emit_fai(as, PPCI_STFD, dest, RID_SP, SPOFS_TMP); - emit_fb(as, PPCI_FCTIWZ, dest, dest); - t.irt = IRT_NUM; /* Check for original type. */ - } else { - Reg tmp = ra_scratch(as, allow); - Reg hibias = ra_allock(as, 0x43300000, rset_clear(allow, tmp)); - Reg fbias = ra_scratch(as, rset_exclude(RSET_FPR, dest)); - emit_fab(as, PPCI_FSUB, dest, dest, fbias); - emit_fai(as, PPCI_LFD, dest, RID_SP, SPOFS_TMP); - emit_lsptr(as, PPCI_LFS, (fbias & 31), - (void *)lj_ir_k64_find(as->J, U64x(59800004,59800000)), - rset_clear(allow, hibias)); - emit_tai(as, PPCI_STW, tmp, RID_SP, SPOFS_TMPLO); - emit_tai(as, PPCI_STW, hibias, RID_SP, SPOFS_TMPHI); - emit_asi(as, PPCI_XORIS, tmp, tmp, 0x8000); - dest = tmp; - t.irt = IRT_INT; /* Check for original type. */ - } - } - goto dotypecheck; - } - base = ra_alloc1(as, REF_BASE, allow); - rset_clear(allow, base); -dotypecheck: - if (irt_isnum(t)) { - if ((ir->op2 & IRSLOAD_TYPECHECK)) { - Reg tisnum = ra_allock(as, (int32_t)LJ_TISNUM, allow); - asm_guardcc(as, CC_GE); - emit_ab(as, PPCI_CMPLW, RID_TMP, tisnum); - type = RID_TMP; - } - if (ra_hasreg(dest)) emit_fai(as, PPCI_LFD, dest, base, ofs-4); - } else { - if ((ir->op2 & IRSLOAD_TYPECHECK)) { - asm_guardcc(as, CC_NE); - emit_ai(as, PPCI_CMPWI, RID_TMP, irt_toitype(t)); - type = RID_TMP; - } - if (ra_hasreg(dest)) emit_tai(as, PPCI_LWZ, dest, base, ofs); - } - if (ra_hasreg(type)) emit_tai(as, PPCI_LWZ, type, base, ofs-4); -} - -/* -- Allocations --------------------------------------------------------- */ - -#if LJ_HASFFI -static void asm_cnew(ASMState *as, IRIns *ir) -{ - CTState *cts = ctype_ctsG(J2G(as->J)); - CTypeID ctypeid = (CTypeID)IR(ir->op1)->i; - CTSize sz = (ir->o == IR_CNEWI || ir->op2 == REF_NIL) ? - lj_ctype_size(cts, ctypeid) : (CTSize)IR(ir->op2)->i; - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco]; - IRRef args[2]; - RegSet allow = (RSET_GPR & ~RSET_SCRATCH); - RegSet drop = RSET_SCRATCH; - lua_assert(sz != CTSIZE_INVALID); - - args[0] = ASMREF_L; /* lua_State *L */ - args[1] = ASMREF_TMP1; /* MSize size */ - as->gcsteps++; - - if (ra_hasreg(ir->r)) - rset_clear(drop, ir->r); /* Dest reg handled below. */ - ra_evictset(as, drop); - if (ra_used(ir)) - ra_destreg(as, ir, RID_RET); /* GCcdata * */ - - /* Initialize immutable cdata object. */ - if (ir->o == IR_CNEWI) { - int32_t ofs = sizeof(GCcdata); - lua_assert(sz == 4 || sz == 8); - if (sz == 8) { - ofs += 4; - lua_assert((ir+1)->o == IR_HIOP); - } - for (;;) { - Reg r = ra_alloc1(as, ir->op2, allow); - emit_tai(as, PPCI_STW, r, RID_RET, ofs); - rset_clear(allow, r); - if (ofs == sizeof(GCcdata)) break; - ofs -= 4; ir++; - } - } - /* Initialize gct and ctypeid. lj_mem_newgco() already sets marked. */ - emit_tai(as, PPCI_STB, RID_RET+1, RID_RET, offsetof(GCcdata, gct)); - emit_tai(as, PPCI_STH, RID_TMP, RID_RET, offsetof(GCcdata, ctypeid)); - emit_ti(as, PPCI_LI, RID_RET+1, ~LJ_TCDATA); - emit_ti(as, PPCI_LI, RID_TMP, ctypeid); /* Lower 16 bit used. Sign-ext ok. */ - asm_gencall(as, ci, args); - ra_allockreg(as, (int32_t)(sz+sizeof(GCcdata)), - ra_releasetmp(as, ASMREF_TMP1)); -} -#else -#define asm_cnew(as, ir) ((void)0) -#endif - -/* -- Write barriers ------------------------------------------------------ */ - -static void asm_tbar(ASMState *as, IRIns *ir) -{ - Reg tab = ra_alloc1(as, ir->op1, RSET_GPR); - Reg mark = ra_scratch(as, rset_exclude(RSET_GPR, tab)); - Reg link = RID_TMP; - MCLabel l_end = emit_label(as); - emit_tai(as, PPCI_STW, link, tab, (int32_t)offsetof(GCtab, gclist)); - emit_tai(as, PPCI_STB, mark, tab, (int32_t)offsetof(GCtab, marked)); - emit_setgl(as, tab, gc.grayagain); - lua_assert(LJ_GC_BLACK == 0x04); - emit_rot(as, PPCI_RLWINM, mark, mark, 0, 30, 28); /* Clear black bit. */ - emit_getgl(as, link, gc.grayagain); - emit_condbranch(as, PPCI_BC|PPCF_Y, CC_EQ, l_end); - emit_asi(as, PPCI_ANDIDOT, RID_TMP, mark, LJ_GC_BLACK); - emit_tai(as, PPCI_LBZ, mark, tab, (int32_t)offsetof(GCtab, marked)); -} - -static void asm_obar(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_barrieruv]; - IRRef args[2]; - MCLabel l_end; - Reg obj, val, tmp; - /* No need for other object barriers (yet). */ - lua_assert(IR(ir->op1)->o == IR_UREFC); - ra_evictset(as, RSET_SCRATCH); - l_end = emit_label(as); - args[0] = ASMREF_TMP1; /* global_State *g */ - args[1] = ir->op1; /* TValue *tv */ - asm_gencall(as, ci, args); - emit_tai(as, PPCI_ADDI, ra_releasetmp(as, ASMREF_TMP1), RID_JGL, -32768); - obj = IR(ir->op1)->r; - tmp = ra_scratch(as, rset_exclude(RSET_GPR, obj)); - emit_condbranch(as, PPCI_BC|PPCF_Y, CC_EQ, l_end); - emit_asi(as, PPCI_ANDIDOT, tmp, tmp, LJ_GC_BLACK); - emit_condbranch(as, PPCI_BC, CC_EQ, l_end); - emit_asi(as, PPCI_ANDIDOT, RID_TMP, RID_TMP, LJ_GC_WHITES); - val = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, obj)); - emit_tai(as, PPCI_LBZ, tmp, obj, - (int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)); - emit_tai(as, PPCI_LBZ, RID_TMP, val, (int32_t)offsetof(GChead, marked)); -} - -/* -- Arithmetic and logic operations ------------------------------------- */ - -static void asm_fparith(ASMState *as, IRIns *ir, PPCIns pi) -{ - Reg dest = ra_dest(as, ir, RSET_FPR); - Reg right, left = ra_alloc2(as, ir, RSET_FPR); - right = (left >> 8); left &= 255; - if (pi == PPCI_FMUL) - emit_fac(as, pi, dest, left, right); - else - emit_fab(as, pi, dest, left, right); -} - -static void asm_fpunary(ASMState *as, IRIns *ir, PPCIns pi) -{ - Reg dest = ra_dest(as, ir, RSET_FPR); - Reg left = ra_hintalloc(as, ir->op1, dest, RSET_FPR); - emit_fb(as, pi, dest, left); -} - -static int asm_fpjoin_pow(ASMState *as, IRIns *ir) -{ - IRIns *irp = IR(ir->op1); - if (irp == ir-1 && irp->o == IR_MUL && !ra_used(irp)) { - IRIns *irpp = IR(irp->op1); - if (irpp == ir-2 && irpp->o == IR_FPMATH && - irpp->op2 == IRFPM_LOG2 && !ra_used(irpp)) { - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_pow]; - IRRef args[2]; - args[0] = irpp->op1; - args[1] = irp->op2; - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); - return 1; - } - } - return 0; -} - -static void asm_add(ASMState *as, IRIns *ir) -{ - if (irt_isnum(ir->t)) { - if (!asm_fusemadd(as, ir, PPCI_FMADD, PPCI_FMADD)) - asm_fparith(as, ir, PPCI_FADD); - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - PPCIns pi; - if (irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - if (checki16(k)) { - pi = PPCI_ADDI; - /* May fail due to spills/restores above, but simplifies the logic. */ - if (as->flagmcp == as->mcp) { - as->flagmcp = NULL; - as->mcp++; - pi = PPCI_ADDICDOT; - } - emit_tai(as, pi, dest, left, k); - return; - } else if ((k & 0xffff) == 0) { - emit_tai(as, PPCI_ADDIS, dest, left, (k >> 16)); - return; - } else if (!as->sectref) { - emit_tai(as, PPCI_ADDIS, dest, dest, (k + 32768) >> 16); - emit_tai(as, PPCI_ADDI, dest, left, k); - return; - } - } - pi = PPCI_ADD; - /* May fail due to spills/restores above, but simplifies the logic. */ - if (as->flagmcp == as->mcp) { - as->flagmcp = NULL; - as->mcp++; - pi |= PPCF_DOT; - } - right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - emit_tab(as, pi, dest, left, right); - } -} - -static void asm_sub(ASMState *as, IRIns *ir) -{ - if (irt_isnum(ir->t)) { - if (!asm_fusemadd(as, ir, PPCI_FMSUB, PPCI_FNMSUB)) - asm_fparith(as, ir, PPCI_FSUB); - } else { - PPCIns pi = PPCI_SUBF; - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left, right; - if (irref_isk(ir->op1)) { - int32_t k = IR(ir->op1)->i; - if (checki16(k)) { - right = ra_alloc1(as, ir->op2, RSET_GPR); - emit_tai(as, PPCI_SUBFIC, dest, right, k); - return; - } - } - /* May fail due to spills/restores above, but simplifies the logic. */ - if (as->flagmcp == as->mcp) { - as->flagmcp = NULL; - as->mcp++; - pi |= PPCF_DOT; - } - left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - emit_tab(as, pi, dest, right, left); /* Subtract right _from_ left. */ - } -} - -static void asm_mul(ASMState *as, IRIns *ir) -{ - if (irt_isnum(ir->t)) { - asm_fparith(as, ir, PPCI_FMUL); - } else { - PPCIns pi = PPCI_MULLW; - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - if (irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - if (checki16(k)) { - emit_tai(as, PPCI_MULLI, dest, left, k); - return; - } - } - /* May fail due to spills/restores above, but simplifies the logic. */ - if (as->flagmcp == as->mcp) { - as->flagmcp = NULL; - as->mcp++; - pi |= PPCF_DOT; - } - right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - emit_tab(as, pi, dest, left, right); - } -} - -static void asm_neg(ASMState *as, IRIns *ir) -{ - if (irt_isnum(ir->t)) { - asm_fpunary(as, ir, PPCI_FNEG); - } else { - Reg dest, left; - PPCIns pi = PPCI_NEG; - if (as->flagmcp == as->mcp) { - as->flagmcp = NULL; - as->mcp++; - pi |= PPCF_DOT; - } - dest = ra_dest(as, ir, RSET_GPR); - left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - emit_tab(as, pi, dest, left, 0); - } -} - -static void asm_arithov(ASMState *as, IRIns *ir, PPCIns pi) -{ - Reg dest, left, right; - if (as->flagmcp == as->mcp) { - as->flagmcp = NULL; - as->mcp++; - } - asm_guardcc(as, CC_SO); - dest = ra_dest(as, ir, RSET_GPR); - left = ra_alloc2(as, ir, RSET_GPR); - right = (left >> 8); left &= 255; - if (pi == PPCI_SUBFO) { Reg tmp = left; left = right; right = tmp; } - emit_tab(as, pi|PPCF_DOT, dest, left, right); -} - -#if LJ_HASFFI -static void asm_add64(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg right, left = ra_alloc1(as, ir->op1, RSET_GPR); - PPCIns pi = PPCI_ADDE; - if (irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - if (k == 0) - pi = PPCI_ADDZE; - else if (k == -1) - pi = PPCI_ADDME; - else - goto needright; - right = 0; - } else { - needright: - right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - } - emit_tab(as, pi, dest, left, right); - ir--; - dest = ra_dest(as, ir, RSET_GPR); - left = ra_alloc1(as, ir->op1, RSET_GPR); - if (irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - if (checki16(k)) { - emit_tai(as, PPCI_ADDIC, dest, left, k); - return; - } - } - right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - emit_tab(as, PPCI_ADDC, dest, left, right); -} - -static void asm_sub64(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left, right = ra_alloc1(as, ir->op2, RSET_GPR); - PPCIns pi = PPCI_SUBFE; - if (irref_isk(ir->op1)) { - int32_t k = IR(ir->op1)->i; - if (k == 0) - pi = PPCI_SUBFZE; - else if (k == -1) - pi = PPCI_SUBFME; - else - goto needleft; - left = 0; - } else { - needleft: - left = ra_alloc1(as, ir->op1, rset_exclude(RSET_GPR, right)); - } - emit_tab(as, pi, dest, right, left); /* Subtract right _from_ left. */ - ir--; - dest = ra_dest(as, ir, RSET_GPR); - right = ra_alloc1(as, ir->op2, RSET_GPR); - if (irref_isk(ir->op1)) { - int32_t k = IR(ir->op1)->i; - if (checki16(k)) { - emit_tai(as, PPCI_SUBFIC, dest, right, k); - return; - } - } - left = ra_alloc1(as, ir->op1, rset_exclude(RSET_GPR, right)); - emit_tab(as, PPCI_SUBFC, dest, right, left); -} - -static void asm_neg64(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg left = ra_alloc1(as, ir->op1, RSET_GPR); - emit_tab(as, PPCI_SUBFZE, dest, left, 0); - ir--; - dest = ra_dest(as, ir, RSET_GPR); - left = ra_alloc1(as, ir->op1, RSET_GPR); - emit_tai(as, PPCI_SUBFIC, dest, left, 0); -} -#endif - -static void asm_bitnot(ASMState *as, IRIns *ir) -{ - Reg dest, left, right; - PPCIns pi = PPCI_NOR; - if (as->flagmcp == as->mcp) { - as->flagmcp = NULL; - as->mcp++; - pi |= PPCF_DOT; - } - dest = ra_dest(as, ir, RSET_GPR); - if (mayfuse(as, ir->op1)) { - IRIns *irl = IR(ir->op1); - if (irl->o == IR_BAND) - pi ^= (PPCI_NOR ^ PPCI_NAND); - else if (irl->o == IR_BXOR) - pi ^= (PPCI_NOR ^ PPCI_EQV); - else if (irl->o != IR_BOR) - goto nofuse; - left = ra_hintalloc(as, irl->op1, dest, RSET_GPR); - right = ra_alloc1(as, irl->op2, rset_exclude(RSET_GPR, left)); - } else { -nofuse: - left = right = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - } - emit_asb(as, pi, dest, left, right); -} - -static void asm_bitswap(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - IRIns *irx; - if (mayfuse(as, ir->op1) && (irx = IR(ir->op1))->o == IR_XLOAD && - ra_noreg(irx->r) && (irt_isint(irx->t) || irt_isu32(irx->t))) { - /* Fuse BSWAP with XLOAD to lwbrx. */ - asm_fusexrefx(as, PPCI_LWBRX, dest, irx->op1, RSET_GPR); - } else { - Reg left = ra_alloc1(as, ir->op1, RSET_GPR); - Reg tmp = dest; - if (tmp == left) { - tmp = RID_TMP; - emit_mr(as, dest, RID_TMP); - } - emit_rot(as, PPCI_RLWIMI, tmp, left, 24, 16, 23); - emit_rot(as, PPCI_RLWIMI, tmp, left, 24, 0, 7); - emit_rotlwi(as, tmp, left, 8); - } -} - -static void asm_bitop(ASMState *as, IRIns *ir, PPCIns pi, PPCIns pik) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR); - if (irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - Reg tmp = left; - if ((checku16(k) || (k & 0xffff) == 0) || (tmp = dest, !as->sectref)) { - if (!checku16(k)) { - emit_asi(as, pik ^ (PPCI_ORI ^ PPCI_ORIS), dest, tmp, (k >> 16)); - if ((k & 0xffff) == 0) return; - } - emit_asi(as, pik, dest, left, k); - return; - } - } - /* May fail due to spills/restores above, but simplifies the logic. */ - if (as->flagmcp == as->mcp) { - as->flagmcp = NULL; - as->mcp++; - pi |= PPCF_DOT; - } - right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - emit_asb(as, pi, dest, left, right); -} - -/* Fuse BAND with contiguous bitmask and a shift to rlwinm. */ -static void asm_fuseandsh(ASMState *as, PPCIns pi, int32_t mask, IRRef ref) -{ - IRIns *ir; - Reg left; - if (mayfuse(as, ref) && (ir = IR(ref), ra_noreg(ir->r)) && - irref_isk(ir->op2) && ir->o >= IR_BSHL && ir->o <= IR_BROR) { - int32_t sh = (IR(ir->op2)->i & 31); - switch (ir->o) { - case IR_BSHL: - if ((mask & ((1u<>sh))) goto nofuse; - sh = ((32-sh)&31); - break; - case IR_BROL: - break; - default: - goto nofuse; - } - left = ra_alloc1(as, ir->op1, RSET_GPR); - *--as->mcp = pi | PPCF_T(left) | PPCF_B(sh); - return; - } -nofuse: - left = ra_alloc1(as, ref, RSET_GPR); - *--as->mcp = pi | PPCF_T(left); -} - -static void asm_bitand(ASMState *as, IRIns *ir) -{ - Reg dest, left, right; - IRRef lref = ir->op1; - PPCIns dot = 0; - IRRef op2; - if (as->flagmcp == as->mcp) { - as->flagmcp = NULL; - as->mcp++; - dot = PPCF_DOT; - } - dest = ra_dest(as, ir, RSET_GPR); - if (irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - if (k) { - /* First check for a contiguous bitmask as used by rlwinm. */ - uint32_t s1 = lj_ffs((uint32_t)k); - uint32_t k1 = ((uint32_t)k >> s1); - if ((k1 & (k1+1)) == 0) { - asm_fuseandsh(as, PPCI_RLWINM|dot | PPCF_A(dest) | - PPCF_MB(31-lj_fls((uint32_t)k)) | PPCF_ME(31-s1), - k, lref); - return; - } - if (~(uint32_t)k) { - uint32_t s2 = lj_ffs(~(uint32_t)k); - uint32_t k2 = (~(uint32_t)k >> s2); - if ((k2 & (k2+1)) == 0) { - asm_fuseandsh(as, PPCI_RLWINM|dot | PPCF_A(dest) | - PPCF_MB(32-s2) | PPCF_ME(30-lj_fls(~(uint32_t)k)), - k, lref); - return; - } - } - } - if (checku16(k)) { - left = ra_alloc1(as, lref, RSET_GPR); - emit_asi(as, PPCI_ANDIDOT, dest, left, k); - return; - } else if ((k & 0xffff) == 0) { - left = ra_alloc1(as, lref, RSET_GPR); - emit_asi(as, PPCI_ANDISDOT, dest, left, (k >> 16)); - return; - } - } - op2 = ir->op2; - if (mayfuse(as, op2) && IR(op2)->o == IR_BNOT && ra_noreg(IR(op2)->r)) { - dot ^= (PPCI_AND ^ PPCI_ANDC); - op2 = IR(op2)->op1; - } - left = ra_hintalloc(as, lref, dest, RSET_GPR); - right = ra_alloc1(as, op2, rset_exclude(RSET_GPR, left)); - emit_asb(as, PPCI_AND ^ dot, dest, left, right); -} - -static void asm_bitshift(ASMState *as, IRIns *ir, PPCIns pi, PPCIns pik) -{ - Reg dest, left; - Reg dot = 0; - if (as->flagmcp == as->mcp) { - as->flagmcp = NULL; - as->mcp++; - dot = PPCF_DOT; - } - dest = ra_dest(as, ir, RSET_GPR); - left = ra_alloc1(as, ir->op1, RSET_GPR); - if (irref_isk(ir->op2)) { /* Constant shifts. */ - int32_t shift = (IR(ir->op2)->i & 31); - if (pik == 0) /* SLWI */ - emit_rot(as, PPCI_RLWINM|dot, dest, left, shift, 0, 31-shift); - else if (pik == 1) /* SRWI */ - emit_rot(as, PPCI_RLWINM|dot, dest, left, (32-shift)&31, shift, 31); - else - emit_asb(as, pik|dot, dest, left, shift); - } else { - Reg right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); - emit_asb(as, pi|dot, dest, left, right); - } -} - -static void asm_min_max(ASMState *as, IRIns *ir, int ismax) -{ - if (irt_isnum(ir->t)) { - Reg dest = ra_dest(as, ir, RSET_FPR); - Reg tmp = dest; - Reg right, left = ra_alloc2(as, ir, RSET_FPR); - right = (left >> 8); left &= 255; - if (tmp == left || tmp == right) - tmp = ra_scratch(as, rset_exclude(rset_exclude(rset_exclude(RSET_FPR, - dest), left), right)); - emit_facb(as, PPCI_FSEL, dest, tmp, - ismax ? left : right, ismax ? right : left); - emit_fab(as, PPCI_FSUB, tmp, left, right); - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg tmp1 = RID_TMP, tmp2 = dest; - Reg right, left = ra_alloc2(as, ir, RSET_GPR); - right = (left >> 8); left &= 255; - if (tmp2 == left || tmp2 == right) - tmp2 = ra_scratch(as, rset_exclude(rset_exclude(rset_exclude(RSET_GPR, - dest), left), right)); - emit_tab(as, PPCI_ADD, dest, tmp2, right); - emit_asb(as, ismax ? PPCI_ANDC : PPCI_AND, tmp2, tmp2, tmp1); - emit_tab(as, PPCI_SUBFE, tmp1, tmp1, tmp1); - emit_tab(as, PPCI_SUBFC, tmp2, tmp2, tmp1); - emit_asi(as, PPCI_XORIS, tmp2, right, 0x8000); - emit_asi(as, PPCI_XORIS, tmp1, left, 0x8000); - } -} - -/* -- Comparisons --------------------------------------------------------- */ - -#define CC_UNSIGNED 0x08 /* Unsigned integer comparison. */ -#define CC_TWO 0x80 /* Check two flags for FP comparison. */ - -/* Map of comparisons to flags. ORDER IR. */ -static const uint8_t asm_compmap[IR_ABC+1] = { - /* op int cc FP cc */ - /* LT */ CC_GE + (CC_GE<<4), - /* GE */ CC_LT + (CC_LE<<4) + CC_TWO, - /* LE */ CC_GT + (CC_GE<<4) + CC_TWO, - /* GT */ CC_LE + (CC_LE<<4), - /* ULT */ CC_GE + CC_UNSIGNED + (CC_GT<<4) + CC_TWO, - /* UGE */ CC_LT + CC_UNSIGNED + (CC_LT<<4), - /* ULE */ CC_GT + CC_UNSIGNED + (CC_GT<<4), - /* UGT */ CC_LE + CC_UNSIGNED + (CC_LT<<4) + CC_TWO, - /* EQ */ CC_NE + (CC_NE<<4), - /* NE */ CC_EQ + (CC_EQ<<4), - /* ABC */ CC_LE + CC_UNSIGNED + (CC_LT<<4) + CC_TWO /* Same as UGT. */ -}; - -static void asm_intcomp_(ASMState *as, IRRef lref, IRRef rref, Reg cr, PPCCC cc) -{ - Reg right, left = ra_alloc1(as, lref, RSET_GPR); - if (irref_isk(rref)) { - int32_t k = IR(rref)->i; - if ((cc & CC_UNSIGNED) == 0) { /* Signed comparison with constant. */ - if (checki16(k)) { - emit_tai(as, PPCI_CMPWI, cr, left, k); - /* Signed comparison with zero and referencing previous ins? */ - if (k == 0 && lref == as->curins-1) - as->flagmcp = as->mcp; /* Allow elimination of the compare. */ - return; - } else if ((cc & 3) == (CC_EQ & 3)) { /* Use CMPLWI for EQ or NE. */ - if (checku16(k)) { - emit_tai(as, PPCI_CMPLWI, cr, left, k); - return; - } else if (!as->sectref && ra_noreg(IR(rref)->r)) { - emit_tai(as, PPCI_CMPLWI, cr, RID_TMP, k); - emit_asi(as, PPCI_XORIS, RID_TMP, left, (k >> 16)); - return; - } - } - } else { /* Unsigned comparison with constant. */ - if (checku16(k)) { - emit_tai(as, PPCI_CMPLWI, cr, left, k); - return; - } - } - } - right = ra_alloc1(as, rref, rset_exclude(RSET_GPR, left)); - emit_tab(as, (cc & CC_UNSIGNED) ? PPCI_CMPLW : PPCI_CMPW, cr, left, right); -} - -static void asm_comp(ASMState *as, IRIns *ir) -{ - PPCCC cc = asm_compmap[ir->o]; - if (irt_isnum(ir->t)) { - Reg right, left = ra_alloc2(as, ir, RSET_FPR); - right = (left >> 8); left &= 255; - asm_guardcc(as, (cc >> 4)); - if ((cc & CC_TWO)) - emit_tab(as, PPCI_CROR, ((cc>>4)&3), ((cc>>4)&3), (CC_EQ&3)); - emit_fab(as, PPCI_FCMPU, 0, left, right); - } else { - IRRef lref = ir->op1, rref = ir->op2; - if (irref_isk(lref) && !irref_isk(rref)) { - /* Swap constants to the right (only for ABC). */ - IRRef tmp = lref; lref = rref; rref = tmp; - if ((cc & 2) == 0) cc ^= 1; /* LT <-> GT, LE <-> GE */ - } - asm_guardcc(as, cc); - asm_intcomp_(as, lref, rref, 0, cc); - } -} - -#if LJ_HASFFI -/* 64 bit integer comparisons. */ -static void asm_comp64(ASMState *as, IRIns *ir) -{ - PPCCC cc = asm_compmap[(ir-1)->o]; - if ((cc&3) == (CC_EQ&3)) { - asm_guardcc(as, cc); - emit_tab(as, (cc&4) ? PPCI_CRAND : PPCI_CROR, - (CC_EQ&3), (CC_EQ&3), 4+(CC_EQ&3)); - } else { - asm_guardcc(as, CC_EQ); - emit_tab(as, PPCI_CROR, (CC_EQ&3), (CC_EQ&3), ((cc^~(cc>>2))&1)); - emit_tab(as, (cc&4) ? PPCI_CRAND : PPCI_CRANDC, - (CC_EQ&3), (CC_EQ&3), 4+(cc&3)); - } - /* Loword comparison sets cr1 and is unsigned, except for equality. */ - asm_intcomp_(as, (ir-1)->op1, (ir-1)->op2, 4, - cc | ((cc&3) == (CC_EQ&3) ? 0 : CC_UNSIGNED)); - /* Hiword comparison sets cr0. */ - asm_intcomp_(as, ir->op1, ir->op2, 0, cc); - as->flagmcp = NULL; /* Doesn't work here. */ -} -#endif - -/* -- Support for 64 bit ops in 32 bit mode ------------------------------- */ - -/* Hiword op of a split 64 bit op. Previous op must be the loword op. */ -static void asm_hiop(ASMState *as, IRIns *ir) -{ -#if LJ_HASFFI - /* HIOP is marked as a store because it needs its own DCE logic. */ - int uselo = ra_used(ir-1), usehi = ra_used(ir); /* Loword/hiword used? */ - if (LJ_UNLIKELY(!(as->flags & JIT_F_OPT_DCE))) uselo = usehi = 1; - if ((ir-1)->o == IR_CONV) { /* Conversions to/from 64 bit. */ - as->curins--; /* Always skip the CONV. */ - if (usehi || uselo) - asm_conv64(as, ir); - return; - } else if ((ir-1)->o <= IR_NE) { /* 64 bit integer comparisons. ORDER IR. */ - as->curins--; /* Always skip the loword comparison. */ - asm_comp64(as, ir); - return; - } else if ((ir-1)->o == IR_XSTORE) { - as->curins--; /* Handle both stores here. */ - if ((ir-1)->r != RID_SINK) { - asm_xstore(as, ir, 0); - asm_xstore(as, ir-1, 4); - } - return; - } - if (!usehi) return; /* Skip unused hiword op for all remaining ops. */ - switch ((ir-1)->o) { - case IR_ADD: as->curins--; asm_add64(as, ir); break; - case IR_SUB: as->curins--; asm_sub64(as, ir); break; - case IR_NEG: as->curins--; asm_neg64(as, ir); break; - case IR_CALLN: - case IR_CALLXS: - if (!uselo) - ra_allocref(as, ir->op1, RID2RSET(RID_RETLO)); /* Mark lo op as used. */ - break; - case IR_CNEWI: - /* Nothing to do here. Handled by lo op itself. */ - break; - default: lua_assert(0); break; - } -#else - UNUSED(as); UNUSED(ir); lua_assert(0); /* Unused without FFI. */ -#endif -} - -/* -- Stack handling ------------------------------------------------------ */ - -/* Check Lua stack size for overflow. Use exit handler as fallback. */ -static void asm_stack_check(ASMState *as, BCReg topslot, - IRIns *irp, RegSet allow, ExitNo exitno) -{ - /* Try to get an unused temp. register, otherwise spill/restore RID_RET*. */ - Reg tmp, pbase = irp ? (ra_hasreg(irp->r) ? irp->r : RID_TMP) : RID_BASE; - rset_clear(allow, pbase); - tmp = allow ? rset_pickbot(allow) : - (pbase == RID_RETHI ? RID_RETLO : RID_RETHI); - emit_condbranch(as, PPCI_BC, CC_LT, asm_exitstub_addr(as, exitno)); - if (allow == RSET_EMPTY) /* Restore temp. register. */ - emit_tai(as, PPCI_LWZ, tmp, RID_SP, SPOFS_TMPW); - else - ra_modified(as, tmp); - emit_ai(as, PPCI_CMPLWI, RID_TMP, (int32_t)(8*topslot)); - emit_tab(as, PPCI_SUBF, RID_TMP, pbase, tmp); - emit_tai(as, PPCI_LWZ, tmp, tmp, offsetof(lua_State, maxstack)); - if (pbase == RID_TMP) - emit_getgl(as, RID_TMP, jit_base); - emit_getgl(as, tmp, jit_L); - if (allow == RSET_EMPTY) /* Spill temp. register. */ - emit_tai(as, PPCI_STW, tmp, RID_SP, SPOFS_TMPW); -} - -/* Restore Lua stack from on-trace state. */ -static void asm_stack_restore(ASMState *as, SnapShot *snap) -{ - SnapEntry *map = &as->T->snapmap[snap->mapofs]; - SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1]; - MSize n, nent = snap->nent; - /* Store the value of all modified slots to the Lua stack. */ - for (n = 0; n < nent; n++) { - SnapEntry sn = map[n]; - BCReg s = snap_slot(sn); - int32_t ofs = 8*((int32_t)s-1); - IRRef ref = snap_ref(sn); - IRIns *ir = IR(ref); - if ((sn & SNAP_NORESTORE)) - continue; - if (irt_isnum(ir->t)) { - Reg src = ra_alloc1(as, ref, RSET_FPR); - emit_fai(as, PPCI_STFD, src, RID_BASE, ofs); - } else { - Reg type; - RegSet allow = rset_exclude(RSET_GPR, RID_BASE); - lua_assert(irt_ispri(ir->t) || irt_isaddr(ir->t) || irt_isinteger(ir->t)); - if (!irt_ispri(ir->t)) { - Reg src = ra_alloc1(as, ref, allow); - rset_clear(allow, src); - emit_tai(as, PPCI_STW, src, RID_BASE, ofs+4); - } - if ((sn & (SNAP_CONT|SNAP_FRAME))) { - if (s == 0) continue; /* Do not overwrite link to previous frame. */ - type = ra_allock(as, (int32_t)(*flinks--), allow); - } else { - type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow); - } - emit_tai(as, PPCI_STW, type, RID_BASE, ofs); - } - checkmclim(as); - } - lua_assert(map + nent == flinks); -} - -/* -- GC handling --------------------------------------------------------- */ - -/* Check GC threshold and do one or more GC steps. */ -static void asm_gc_check(ASMState *as) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_step_jit]; - IRRef args[2]; - MCLabel l_end; - Reg tmp; - ra_evictset(as, RSET_SCRATCH); - l_end = emit_label(as); - /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */ - asm_guardcc(as, CC_NE); /* Assumes asm_snap_prep() already done. */ - emit_ai(as, PPCI_CMPWI, RID_RET, 0); - args[0] = ASMREF_TMP1; /* global_State *g */ - args[1] = ASMREF_TMP2; /* MSize steps */ - asm_gencall(as, ci, args); - emit_tai(as, PPCI_ADDI, ra_releasetmp(as, ASMREF_TMP1), RID_JGL, -32768); - tmp = ra_releasetmp(as, ASMREF_TMP2); - emit_loadi(as, tmp, as->gcsteps); - /* Jump around GC step if GC total < GC threshold. */ - emit_condbranch(as, PPCI_BC|PPCF_Y, CC_LT, l_end); - emit_ab(as, PPCI_CMPLW, RID_TMP, tmp); - emit_getgl(as, tmp, gc.threshold); - emit_getgl(as, RID_TMP, gc.total); - as->gcsteps = 0; - checkmclim(as); -} - -/* -- Loop handling ------------------------------------------------------- */ - -/* Fixup the loop branch. */ -static void asm_loop_fixup(ASMState *as) -{ - MCode *p = as->mctop; - MCode *target = as->mcp; - if (as->loopinv) { /* Inverted loop branch? */ - /* asm_guardcc already inverted the cond branch and patched the final b. */ - p[-2] = (p[-2] & (0xffff0000u & ~PPCF_Y)) | (((target-p+2) & 0x3fffu) << 2); - } else { - p[-1] = PPCI_B|(((target-p+1)&0x00ffffffu)<<2); - } -} - -/* -- Head of trace ------------------------------------------------------- */ - -/* Coalesce BASE register for a root trace. */ -static void asm_head_root_base(ASMState *as) -{ - IRIns *ir = IR(REF_BASE); - Reg r = ir->r; - if (ra_hasreg(r)) { - ra_free(as, r); - if (rset_test(as->modset, r) || irt_ismarked(ir->t)) - ir->r = RID_INIT; /* No inheritance for modified BASE register. */ - if (r != RID_BASE) - emit_mr(as, r, RID_BASE); - } -} - -/* Coalesce BASE register for a side trace. */ -static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow) -{ - IRIns *ir = IR(REF_BASE); - Reg r = ir->r; - if (ra_hasreg(r)) { - ra_free(as, r); - if (rset_test(as->modset, r) || irt_ismarked(ir->t)) - ir->r = RID_INIT; /* No inheritance for modified BASE register. */ - if (irp->r == r) { - rset_clear(allow, r); /* Mark same BASE register as coalesced. */ - } else if (ra_hasreg(irp->r) && rset_test(as->freeset, irp->r)) { - rset_clear(allow, irp->r); - emit_mr(as, r, irp->r); /* Move from coalesced parent reg. */ - } else { - emit_getgl(as, r, jit_base); /* Otherwise reload BASE. */ - } - } - return allow; -} - -/* -- Tail of trace ------------------------------------------------------- */ - -/* Fixup the tail code. */ -static void asm_tail_fixup(ASMState *as, TraceNo lnk) -{ - MCode *p = as->mctop; - MCode *target; - int32_t spadj = as->T->spadjust; - if (spadj == 0) { - *--p = PPCI_NOP; - *--p = PPCI_NOP; - as->mctop = p; - } else { - /* Patch stack adjustment. */ - lua_assert(checki16(CFRAME_SIZE+spadj)); - p[-3] = PPCI_ADDI | PPCF_T(RID_TMP) | PPCF_A(RID_SP) | (CFRAME_SIZE+spadj); - p[-2] = PPCI_STWU | PPCF_T(RID_TMP) | PPCF_A(RID_SP) | spadj; - } - /* Patch exit branch. */ - target = lnk ? traceref(as->J, lnk)->mcode : (MCode *)lj_vm_exit_interp; - p[-1] = PPCI_B|(((target-p+1)&0x00ffffffu)<<2); -} - -/* Prepare tail of code. */ -static void asm_tail_prep(ASMState *as) -{ - MCode *p = as->mctop - 1; /* Leave room for exit branch. */ - if (as->loopref) { - as->invmcp = as->mcp = p; - } else { - as->mcp = p-2; /* Leave room for stack pointer adjustment. */ - as->invmcp = NULL; - } -} - -/* -- Instruction dispatch ------------------------------------------------ */ - -/* Assemble a single instruction. */ -static void asm_ir(ASMState *as, IRIns *ir) -{ - switch ((IROp)ir->o) { - /* Miscellaneous ops. */ - case IR_LOOP: asm_loop(as); break; - case IR_NOP: case IR_XBAR: lua_assert(!ra_used(ir)); break; - case IR_USE: - ra_alloc1(as, ir->op1, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); break; - case IR_PHI: asm_phi(as, ir); break; - case IR_HIOP: asm_hiop(as, ir); break; - case IR_GCSTEP: asm_gcstep(as, ir); break; - - /* Guarded assertions. */ - case IR_EQ: case IR_NE: - if ((ir-1)->o == IR_HREF && ir->op1 == as->curins-1) { - as->curins--; - asm_href(as, ir-1, (IROp)ir->o); - break; - } - /* fallthrough */ - case IR_LT: case IR_GE: case IR_LE: case IR_GT: - case IR_ULT: case IR_UGE: case IR_ULE: case IR_UGT: - case IR_ABC: - asm_comp(as, ir); - break; - - case IR_RETF: asm_retf(as, ir); break; - - /* Bit ops. */ - case IR_BNOT: asm_bitnot(as, ir); break; - case IR_BSWAP: asm_bitswap(as, ir); break; - - case IR_BAND: asm_bitand(as, ir); break; - case IR_BOR: asm_bitop(as, ir, PPCI_OR, PPCI_ORI); break; - case IR_BXOR: asm_bitop(as, ir, PPCI_XOR, PPCI_XORI); break; - - case IR_BSHL: asm_bitshift(as, ir, PPCI_SLW, 0); break; - case IR_BSHR: asm_bitshift(as, ir, PPCI_SRW, 1); break; - case IR_BSAR: asm_bitshift(as, ir, PPCI_SRAW, PPCI_SRAWI); break; - case IR_BROL: asm_bitshift(as, ir, PPCI_RLWNM|PPCF_MB(0)|PPCF_ME(31), - PPCI_RLWINM|PPCF_MB(0)|PPCF_ME(31)); break; - case IR_BROR: lua_assert(0); break; - - /* Arithmetic ops. */ - case IR_ADD: asm_add(as, ir); break; - case IR_SUB: asm_sub(as, ir); break; - case IR_MUL: asm_mul(as, ir); break; - case IR_DIV: asm_fparith(as, ir, PPCI_FDIV); break; - case IR_MOD: asm_callid(as, ir, IRCALL_lj_vm_modi); break; - case IR_POW: asm_callid(as, ir, IRCALL_lj_vm_powi); break; - case IR_NEG: asm_neg(as, ir); break; - - case IR_ABS: asm_fpunary(as, ir, PPCI_FABS); break; - case IR_ATAN2: asm_callid(as, ir, IRCALL_atan2); break; - case IR_LDEXP: asm_callid(as, ir, IRCALL_ldexp); break; - case IR_MIN: asm_min_max(as, ir, 0); break; - case IR_MAX: asm_min_max(as, ir, 1); break; - case IR_FPMATH: - if (ir->op2 == IRFPM_EXP2 && asm_fpjoin_pow(as, ir)) - break; - if (ir->op2 == IRFPM_SQRT && (as->flags & JIT_F_SQRT)) - asm_fpunary(as, ir, PPCI_FSQRT); - else - asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2); - break; - - /* Overflow-checking arithmetic ops. */ - case IR_ADDOV: asm_arithov(as, ir, PPCI_ADDO); break; - case IR_SUBOV: asm_arithov(as, ir, PPCI_SUBFO); break; - case IR_MULOV: asm_arithov(as, ir, PPCI_MULLWO); break; - - /* Memory references. */ - case IR_AREF: asm_aref(as, ir); break; - case IR_HREF: asm_href(as, ir, 0); break; - case IR_HREFK: asm_hrefk(as, ir); break; - case IR_NEWREF: asm_newref(as, ir); break; - case IR_UREFO: case IR_UREFC: asm_uref(as, ir); break; - case IR_FREF: asm_fref(as, ir); break; - case IR_STRREF: asm_strref(as, ir); break; - - /* Loads and stores. */ - case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: - asm_ahuvload(as, ir); - break; - case IR_FLOAD: asm_fload(as, ir); break; - case IR_XLOAD: asm_xload(as, ir); break; - case IR_SLOAD: asm_sload(as, ir); break; - - case IR_ASTORE: case IR_HSTORE: case IR_USTORE: asm_ahustore(as, ir); break; - case IR_FSTORE: asm_fstore(as, ir); break; - case IR_XSTORE: asm_xstore(as, ir, 0); break; - - /* Allocations. */ - case IR_SNEW: case IR_XSNEW: asm_snew(as, ir); break; - case IR_TNEW: asm_tnew(as, ir); break; - case IR_TDUP: asm_tdup(as, ir); break; - case IR_CNEW: case IR_CNEWI: asm_cnew(as, ir); break; - - /* Write barriers. */ - case IR_TBAR: asm_tbar(as, ir); break; - case IR_OBAR: asm_obar(as, ir); break; - - /* Type conversions. */ - case IR_CONV: asm_conv(as, ir); break; - case IR_TOBIT: asm_tobit(as, ir); break; - case IR_TOSTR: asm_tostr(as, ir); break; - case IR_STRTO: asm_strto(as, ir); break; - - /* Calls. */ - case IR_CALLN: case IR_CALLL: case IR_CALLS: asm_call(as, ir); break; - case IR_CALLXS: asm_callx(as, ir); break; - case IR_CARG: break; - - default: - setintV(&as->J->errinfo, ir->o); - lj_trace_err_info(as->J, LJ_TRERR_NYIIR); - break; - } -} - -/* -- Trace setup --------------------------------------------------------- */ - -/* Ensure there are enough stack slots for call arguments. */ -static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci) -{ - IRRef args[CCI_NARGS_MAX*2]; - uint32_t i, nargs = (int)CCI_NARGS(ci); - int nslots = 2, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR; - asm_collectargs(as, ir, ci, args); - for (i = 0; i < nargs; i++) - if (args[i] && irt_isfp(IR(args[i])->t)) { - if (nfpr > 0) nfpr--; else nslots = (nslots+3) & ~1; - } else { - if (ngpr > 0) ngpr--; else nslots++; - } - if (nslots > as->evenspill) /* Leave room for args in stack slots. */ - as->evenspill = nslots; - return irt_isfp(ir->t) ? REGSP_HINT(RID_FPRET) : REGSP_HINT(RID_RET); -} - -static void asm_setup_target(ASMState *as) -{ - asm_exitstub_setup(as, as->T->nsnap + (as->parent ? 1 : 0)); -} - -/* -- Trace patching ------------------------------------------------------ */ - -/* Patch exit jumps of existing machine code to a new target. */ -void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target) -{ - MCode *p = T->mcode; - MCode *pe = (MCode *)((char *)p + T->szmcode); - MCode *px = exitstub_trace_addr(T, exitno); - MCode *cstart = NULL; - MCode *mcarea = lj_mcode_patch(J, p, 0); - int clearso = 0; - for (; p < pe; p++) { - /* Look for exitstub branch, try to replace with branch to target. */ - uint32_t ins = *p; - if ((ins & 0xfc000000u) == 0x40000000u && - ((ins ^ ((char *)px-(char *)p)) & 0xffffu) == 0) { - ptrdiff_t delta = (char *)target - (char *)p; - if (((ins >> 16) & 3) == (CC_SO&3)) { - clearso = sizeof(MCode); - delta -= sizeof(MCode); - } - /* Many, but not all short-range branches can be patched directly. */ - if (((delta + 0x8000) >> 16) == 0) { - *p = (ins & 0xffdf0000u) | ((uint32_t)delta & 0xffffu) | - ((delta & 0x8000) * (PPCF_Y/0x8000)); - if (!cstart) cstart = p; - } - } else if ((ins & 0xfc000000u) == PPCI_B && - ((ins ^ ((char *)px-(char *)p)) & 0x03ffffffu) == 0) { - ptrdiff_t delta = (char *)target - (char *)p; - lua_assert(((delta + 0x02000000) >> 26) == 0); - *p = PPCI_B | ((uint32_t)delta & 0x03ffffffu); - if (!cstart) cstart = p; - } - } - { /* Always patch long-range branch in exit stub itself. */ - ptrdiff_t delta = (char *)target - (char *)px - clearso; - lua_assert(((delta + 0x02000000) >> 26) == 0); - *px = PPCI_B | ((uint32_t)delta & 0x03ffffffu); - } - if (!cstart) cstart = px; - lj_mcode_sync(cstart, px+1); - if (clearso) { /* Extend the current trace. Ugly workaround. */ - MCode *pp = J->cur.mcode; - J->cur.szmcode += sizeof(MCode); - *--pp = PPCI_MCRXR; /* Clear SO flag. */ - J->cur.mcode = pp; - lj_mcode_sync(pp, pp+1); - } - lj_mcode_patch(J, mcarea, 1); -} - diff --git a/subprojects/luajit/src/lj_asm_x86.h b/subprojects/luajit/src/lj_asm_x86.h deleted file mode 100644 index 10468bb71..000000000 --- a/subprojects/luajit/src/lj_asm_x86.h +++ /dev/null @@ -1,2900 +0,0 @@ -/* -** x86/x64 IR assembler (SSA IR -> machine code). -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -/* -- Guard handling ------------------------------------------------------ */ - -/* Generate an exit stub group at the bottom of the reserved MCode memory. */ -static MCode *asm_exitstub_gen(ASMState *as, ExitNo group) -{ - ExitNo i, groupofs = (group*EXITSTUBS_PER_GROUP) & 0xff; - MCode *mxp = as->mcbot; - MCode *mxpstart = mxp; - if (mxp + (2+2)*EXITSTUBS_PER_GROUP+8+5 >= as->mctop) - asm_mclimit(as); - /* Push low byte of exitno for each exit stub. */ - *mxp++ = XI_PUSHi8; *mxp++ = (MCode)groupofs; - for (i = 1; i < EXITSTUBS_PER_GROUP; i++) { - *mxp++ = XI_JMPs; *mxp++ = (MCode)((2+2)*(EXITSTUBS_PER_GROUP - i) - 2); - *mxp++ = XI_PUSHi8; *mxp++ = (MCode)(groupofs + i); - } - /* Push the high byte of the exitno for each exit stub group. */ - *mxp++ = XI_PUSHi8; *mxp++ = (MCode)((group*EXITSTUBS_PER_GROUP)>>8); - /* Store DISPATCH at original stack slot 0. Account for the two push ops. */ - *mxp++ = XI_MOVmi; - *mxp++ = MODRM(XM_OFS8, 0, RID_ESP); - *mxp++ = MODRM(XM_SCALE1, RID_ESP, RID_ESP); - *mxp++ = 2*sizeof(void *); - *(int32_t *)mxp = ptr2addr(J2GG(as->J)->dispatch); mxp += 4; - /* Jump to exit handler which fills in the ExitState. */ - *mxp++ = XI_JMP; mxp += 4; - *((int32_t *)(mxp-4)) = jmprel(mxp, (MCode *)(void *)lj_vm_exit_handler); - /* Commit the code for this group (even if assembly fails later on). */ - lj_mcode_commitbot(as->J, mxp); - as->mcbot = mxp; - as->mclim = as->mcbot + MCLIM_REDZONE; - return mxpstart; -} - -/* Setup all needed exit stubs. */ -static void asm_exitstub_setup(ASMState *as, ExitNo nexits) -{ - ExitNo i; - if (nexits >= EXITSTUBS_PER_GROUP*LJ_MAX_EXITSTUBGR) - lj_trace_err(as->J, LJ_TRERR_SNAPOV); - for (i = 0; i < (nexits+EXITSTUBS_PER_GROUP-1)/EXITSTUBS_PER_GROUP; i++) - if (as->J->exitstubgroup[i] == NULL) - as->J->exitstubgroup[i] = asm_exitstub_gen(as, i); -} - -/* Emit conditional branch to exit for guard. -** It's important to emit this *after* all registers have been allocated, -** because rematerializations may invalidate the flags. -*/ -static void asm_guardcc(ASMState *as, int cc) -{ - MCode *target = exitstub_addr(as->J, as->snapno); - MCode *p = as->mcp; - if (LJ_UNLIKELY(p == as->invmcp)) { - as->loopinv = 1; - *(int32_t *)(p+1) = jmprel(p+5, target); - target = p; - cc ^= 1; - if (as->realign) { - emit_sjcc(as, cc, target); - return; - } - } - emit_jcc(as, cc, target); -} - -/* -- Memory operand fusion ----------------------------------------------- */ - -/* Limit linear search to this distance. Avoids O(n^2) behavior. */ -#define CONFLICT_SEARCH_LIM 31 - -/* Check if a reference is a signed 32 bit constant. */ -static int asm_isk32(ASMState *as, IRRef ref, int32_t *k) -{ - if (irref_isk(ref)) { - IRIns *ir = IR(ref); - if (ir->o != IR_KINT64) { - *k = ir->i; - return 1; - } else if (checki32((int64_t)ir_kint64(ir)->u64)) { - *k = (int32_t)ir_kint64(ir)->u64; - return 1; - } - } - return 0; -} - -/* Check if there's no conflicting instruction between curins and ref. -** Also avoid fusing loads if there are multiple references. -*/ -static int noconflict(ASMState *as, IRRef ref, IROp conflict, int noload) -{ - IRIns *ir = as->ir; - IRRef i = as->curins; - if (i > ref + CONFLICT_SEARCH_LIM) - return 0; /* Give up, ref is too far away. */ - while (--i > ref) { - if (ir[i].o == conflict) - return 0; /* Conflict found. */ - else if (!noload && (ir[i].op1 == ref || ir[i].op2 == ref)) - return 0; - } - return 1; /* Ok, no conflict. */ -} - -/* Fuse array base into memory operand. */ -static IRRef asm_fuseabase(ASMState *as, IRRef ref) -{ - IRIns *irb = IR(ref); - as->mrm.ofs = 0; - if (irb->o == IR_FLOAD) { - IRIns *ira = IR(irb->op1); - lua_assert(irb->op2 == IRFL_TAB_ARRAY); - /* We can avoid the FLOAD of t->array for colocated arrays. */ - if (ira->o == IR_TNEW && ira->op1 <= LJ_MAX_COLOSIZE && - !neverfuse(as) && noconflict(as, irb->op1, IR_NEWREF, 1)) { - as->mrm.ofs = (int32_t)sizeof(GCtab); /* Ofs to colocated array. */ - return irb->op1; /* Table obj. */ - } - } else if (irb->o == IR_ADD && irref_isk(irb->op2)) { - /* Fuse base offset (vararg load). */ - as->mrm.ofs = IR(irb->op2)->i; - return irb->op1; - } - return ref; /* Otherwise use the given array base. */ -} - -/* Fuse array reference into memory operand. */ -static void asm_fusearef(ASMState *as, IRIns *ir, RegSet allow) -{ - IRIns *irx; - lua_assert(ir->o == IR_AREF); - as->mrm.base = (uint8_t)ra_alloc1(as, asm_fuseabase(as, ir->op1), allow); - irx = IR(ir->op2); - if (irref_isk(ir->op2)) { - as->mrm.ofs += 8*irx->i; - as->mrm.idx = RID_NONE; - } else { - rset_clear(allow, as->mrm.base); - as->mrm.scale = XM_SCALE8; - /* Fuse a constant ADD (e.g. t[i+1]) into the offset. - ** Doesn't help much without ABCelim, but reduces register pressure. - */ - if (!LJ_64 && /* Has bad effects with negative index on x64. */ - mayfuse(as, ir->op2) && ra_noreg(irx->r) && - irx->o == IR_ADD && irref_isk(irx->op2)) { - as->mrm.ofs += 8*IR(irx->op2)->i; - as->mrm.idx = (uint8_t)ra_alloc1(as, irx->op1, allow); - } else { - as->mrm.idx = (uint8_t)ra_alloc1(as, ir->op2, allow); - } - } -} - -/* Fuse array/hash/upvalue reference into memory operand. -** Caveat: this may allocate GPRs for the base/idx registers. Be sure to -** pass the final allow mask, excluding any GPRs used for other inputs. -** In particular: 2-operand GPR instructions need to call ra_dest() first! -*/ -static void asm_fuseahuref(ASMState *as, IRRef ref, RegSet allow) -{ - IRIns *ir = IR(ref); - if (ra_noreg(ir->r)) { - switch ((IROp)ir->o) { - case IR_AREF: - if (mayfuse(as, ref)) { - asm_fusearef(as, ir, allow); - return; - } - break; - case IR_HREFK: - if (mayfuse(as, ref)) { - as->mrm.base = (uint8_t)ra_alloc1(as, ir->op1, allow); - as->mrm.ofs = (int32_t)(IR(ir->op2)->op2 * sizeof(Node)); - as->mrm.idx = RID_NONE; - return; - } - break; - case IR_UREFC: - if (irref_isk(ir->op1)) { - GCfunc *fn = ir_kfunc(IR(ir->op1)); - GCupval *uv = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv; - as->mrm.ofs = ptr2addr(&uv->tv); - as->mrm.base = as->mrm.idx = RID_NONE; - return; - } - break; - default: - lua_assert(ir->o == IR_HREF || ir->o == IR_NEWREF || ir->o == IR_UREFO || - ir->o == IR_KKPTR); - break; - } - } - as->mrm.base = (uint8_t)ra_alloc1(as, ref, allow); - as->mrm.ofs = 0; - as->mrm.idx = RID_NONE; -} - -/* Fuse FLOAD/FREF reference into memory operand. */ -static void asm_fusefref(ASMState *as, IRIns *ir, RegSet allow) -{ - lua_assert(ir->o == IR_FLOAD || ir->o == IR_FREF); - as->mrm.ofs = field_ofs[ir->op2]; - as->mrm.idx = RID_NONE; - if (irref_isk(ir->op1)) { - as->mrm.ofs += IR(ir->op1)->i; - as->mrm.base = RID_NONE; - } else { - as->mrm.base = (uint8_t)ra_alloc1(as, ir->op1, allow); - } -} - -/* Fuse string reference into memory operand. */ -static void asm_fusestrref(ASMState *as, IRIns *ir, RegSet allow) -{ - IRIns *irr; - lua_assert(ir->o == IR_STRREF); - as->mrm.base = as->mrm.idx = RID_NONE; - as->mrm.scale = XM_SCALE1; - as->mrm.ofs = sizeof(GCstr); - if (irref_isk(ir->op1)) { - as->mrm.ofs += IR(ir->op1)->i; - } else { - Reg r = ra_alloc1(as, ir->op1, allow); - rset_clear(allow, r); - as->mrm.base = (uint8_t)r; - } - irr = IR(ir->op2); - if (irref_isk(ir->op2)) { - as->mrm.ofs += irr->i; - } else { - Reg r; - /* Fuse a constant add into the offset, e.g. string.sub(s, i+10). */ - if (!LJ_64 && /* Has bad effects with negative index on x64. */ - mayfuse(as, ir->op2) && irr->o == IR_ADD && irref_isk(irr->op2)) { - as->mrm.ofs += IR(irr->op2)->i; - r = ra_alloc1(as, irr->op1, allow); - } else { - r = ra_alloc1(as, ir->op2, allow); - } - if (as->mrm.base == RID_NONE) - as->mrm.base = (uint8_t)r; - else - as->mrm.idx = (uint8_t)r; - } -} - -static void asm_fusexref(ASMState *as, IRRef ref, RegSet allow) -{ - IRIns *ir = IR(ref); - as->mrm.idx = RID_NONE; - if (ir->o == IR_KPTR || ir->o == IR_KKPTR) { - as->mrm.ofs = ir->i; - as->mrm.base = RID_NONE; - } else if (ir->o == IR_STRREF) { - asm_fusestrref(as, ir, allow); - } else { - as->mrm.ofs = 0; - if (canfuse(as, ir) && ir->o == IR_ADD && ra_noreg(ir->r)) { - /* Gather (base+idx*sz)+ofs as emitted by cdata ptr/array indexing. */ - IRIns *irx; - IRRef idx; - Reg r; - if (asm_isk32(as, ir->op2, &as->mrm.ofs)) { /* Recognize x+ofs. */ - ref = ir->op1; - ir = IR(ref); - if (!(ir->o == IR_ADD && canfuse(as, ir) && ra_noreg(ir->r))) - goto noadd; - } - as->mrm.scale = XM_SCALE1; - idx = ir->op1; - ref = ir->op2; - irx = IR(idx); - if (!(irx->o == IR_BSHL || irx->o == IR_ADD)) { /* Try other operand. */ - idx = ir->op2; - ref = ir->op1; - irx = IR(idx); - } - if (canfuse(as, irx) && ra_noreg(irx->r)) { - if (irx->o == IR_BSHL && irref_isk(irx->op2) && IR(irx->op2)->i <= 3) { - /* Recognize idx<op1; - as->mrm.scale = (uint8_t)(IR(irx->op2)->i << 6); - } else if (irx->o == IR_ADD && irx->op1 == irx->op2) { - /* FOLD does idx*2 ==> idx<<1 ==> idx+idx. */ - idx = irx->op1; - as->mrm.scale = XM_SCALE2; - } - } - r = ra_alloc1(as, idx, allow); - rset_clear(allow, r); - as->mrm.idx = (uint8_t)r; - } - noadd: - as->mrm.base = (uint8_t)ra_alloc1(as, ref, allow); - } -} - -/* Fuse load into memory operand. */ -static Reg asm_fuseload(ASMState *as, IRRef ref, RegSet allow) -{ - IRIns *ir = IR(ref); - if (ra_hasreg(ir->r)) { - if (allow != RSET_EMPTY) { /* Fast path. */ - ra_noweak(as, ir->r); - return ir->r; - } - fusespill: - /* Force a spill if only memory operands are allowed (asm_x87load). */ - as->mrm.base = RID_ESP; - as->mrm.ofs = ra_spill(as, ir); - as->mrm.idx = RID_NONE; - return RID_MRM; - } - if (ir->o == IR_KNUM) { - RegSet avail = as->freeset & ~as->modset & RSET_FPR; - lua_assert(allow != RSET_EMPTY); - if (!(avail & (avail-1))) { /* Fuse if less than two regs available. */ - as->mrm.ofs = ptr2addr(ir_knum(ir)); - as->mrm.base = as->mrm.idx = RID_NONE; - return RID_MRM; - } - } else if (ref == REF_BASE || ir->o == IR_KINT64) { - RegSet avail = as->freeset & ~as->modset & RSET_GPR; - lua_assert(allow != RSET_EMPTY); - if (!(avail & (avail-1))) { /* Fuse if less than two regs available. */ - as->mrm.ofs = ptr2addr(ref == REF_BASE ? (void *)&J2G(as->J)->jit_base : (void *)ir_kint64(ir)); - as->mrm.base = as->mrm.idx = RID_NONE; - return RID_MRM; - } - } else if (mayfuse(as, ref)) { - RegSet xallow = (allow & RSET_GPR) ? allow : RSET_GPR; - if (ir->o == IR_SLOAD) { - if (!(ir->op2 & (IRSLOAD_PARENT|IRSLOAD_CONVERT)) && - noconflict(as, ref, IR_RETF, 0)) { - as->mrm.base = (uint8_t)ra_alloc1(as, REF_BASE, xallow); - as->mrm.ofs = 8*((int32_t)ir->op1-1) + ((ir->op2&IRSLOAD_FRAME)?4:0); - as->mrm.idx = RID_NONE; - return RID_MRM; - } - } else if (ir->o == IR_FLOAD) { - /* Generic fusion is only ok for 32 bit operand (but see asm_comp). */ - if ((irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t)) && - noconflict(as, ref, IR_FSTORE, 0)) { - asm_fusefref(as, ir, xallow); - return RID_MRM; - } - } else if (ir->o == IR_ALOAD || ir->o == IR_HLOAD || ir->o == IR_ULOAD) { - if (noconflict(as, ref, ir->o + IRDELTA_L2S, 0)) { - asm_fuseahuref(as, ir->op1, xallow); - return RID_MRM; - } - } else if (ir->o == IR_XLOAD) { - /* Generic fusion is not ok for 8/16 bit operands (but see asm_comp). - ** Fusing unaligned memory operands is ok on x86 (except for SIMD types). - */ - if ((!irt_typerange(ir->t, IRT_I8, IRT_U16)) && - noconflict(as, ref, IR_XSTORE, 0)) { - asm_fusexref(as, ir->op1, xallow); - return RID_MRM; - } - } else if (ir->o == IR_VLOAD) { - asm_fuseahuref(as, ir->op1, xallow); - return RID_MRM; - } - } - if (!(as->freeset & allow) && !emit_canremat(ref) && - (allow == RSET_EMPTY || ra_hasspill(ir->s) || iscrossref(as, ref))) - goto fusespill; - return ra_allocref(as, ref, allow); -} - -#if LJ_64 -/* Don't fuse a 32 bit load into a 64 bit operation. */ -static Reg asm_fuseloadm(ASMState *as, IRRef ref, RegSet allow, int is64) -{ - if (is64 && !irt_is64(IR(ref)->t)) - return ra_alloc1(as, ref, allow); - return asm_fuseload(as, ref, allow); -} -#else -#define asm_fuseloadm(as, ref, allow, is64) asm_fuseload(as, (ref), (allow)) -#endif - -/* -- Calls --------------------------------------------------------------- */ - -/* Count the required number of stack slots for a call. */ -static int asm_count_call_slots(ASMState *as, const CCallInfo *ci, IRRef *args) -{ - uint32_t i, nargs = CCI_NARGS(ci); - int nslots = 0; -#if LJ_64 - if (LJ_ABI_WIN) { - nslots = (int)(nargs*2); /* Only matters for more than four args. */ - } else { - int ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR; - for (i = 0; i < nargs; i++) - if (args[i] && irt_isfp(IR(args[i])->t)) { - if (nfpr > 0) nfpr--; else nslots += 2; - } else { - if (ngpr > 0) ngpr--; else nslots += 2; - } - } -#else - int ngpr = 0; - if ((ci->flags & CCI_CC_MASK) == CCI_CC_FASTCALL) - ngpr = 2; - else if ((ci->flags & CCI_CC_MASK) == CCI_CC_THISCALL) - ngpr = 1; - for (i = 0; i < nargs; i++) - if (args[i] && irt_isfp(IR(args[i])->t)) { - nslots += irt_isnum(IR(args[i])->t) ? 2 : 1; - } else { - if (ngpr > 0) ngpr--; else nslots++; - } -#endif - return nslots; -} - -/* Generate a call to a C function. */ -static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args) -{ - uint32_t n, nargs = CCI_NARGS(ci); - int32_t ofs = STACKARG_OFS; -#if LJ_64 - uint32_t gprs = REGARG_GPRS; - Reg fpr = REGARG_FIRSTFPR; -#if !LJ_ABI_WIN - MCode *patchnfpr = NULL; -#endif -#else - uint32_t gprs = 0; - if ((ci->flags & CCI_CC_MASK) != CCI_CC_CDECL) { - if ((ci->flags & CCI_CC_MASK) == CCI_CC_THISCALL) - gprs = (REGARG_GPRS & 31); - else if ((ci->flags & CCI_CC_MASK) == CCI_CC_FASTCALL) - gprs = REGARG_GPRS; - } -#endif - if ((void *)ci->func) - emit_call(as, ci->func); -#if LJ_64 - if ((ci->flags & CCI_VARARG)) { /* Special handling for vararg calls. */ -#if LJ_ABI_WIN - for (n = 0; n < 4 && n < nargs; n++) { - IRIns *ir = IR(args[n]); - if (irt_isfp(ir->t)) /* Duplicate FPRs in GPRs. */ - emit_rr(as, XO_MOVDto, (irt_isnum(ir->t) ? REX_64 : 0) | (fpr+n), - ((gprs >> (n*5)) & 31)); /* Either MOVD or MOVQ. */ - } -#else - patchnfpr = --as->mcp; /* Indicate number of used FPRs in register al. */ - *--as->mcp = XI_MOVrib | RID_EAX; -#endif - } -#endif - for (n = 0; n < nargs; n++) { /* Setup args. */ - IRRef ref = args[n]; - IRIns *ir = IR(ref); - Reg r; -#if LJ_64 && LJ_ABI_WIN - /* Windows/x64 argument registers are strictly positional. */ - r = irt_isfp(ir->t) ? (fpr <= REGARG_LASTFPR ? fpr : 0) : (gprs & 31); - fpr++; gprs >>= 5; -#elif LJ_64 - /* POSIX/x64 argument registers are used in order of appearance. */ - if (irt_isfp(ir->t)) { - r = fpr <= REGARG_LASTFPR ? fpr++ : 0; - } else { - r = gprs & 31; gprs >>= 5; - } -#else - if (ref && irt_isfp(ir->t)) { - r = 0; - } else { - r = gprs & 31; gprs >>= 5; - if (!ref) continue; - } -#endif - if (r) { /* Argument is in a register. */ - if (r < RID_MAX_GPR && ref < ASMREF_TMP1) { -#if LJ_64 - if (ir->o == IR_KINT64) - emit_loadu64(as, r, ir_kint64(ir)->u64); - else -#endif - emit_loadi(as, r, ir->i); - } else { - lua_assert(rset_test(as->freeset, r)); /* Must have been evicted. */ - if (ra_hasreg(ir->r)) { - ra_noweak(as, ir->r); - emit_movrr(as, ir, r, ir->r); - } else { - ra_allocref(as, ref, RID2RSET(r)); - } - } - } else if (irt_isfp(ir->t)) { /* FP argument is on stack. */ - lua_assert(!(irt_isfloat(ir->t) && irref_isk(ref))); /* No float k. */ - if (LJ_32 && (ofs & 4) && irref_isk(ref)) { - /* Split stores for unaligned FP consts. */ - emit_movmroi(as, RID_ESP, ofs, (int32_t)ir_knum(ir)->u32.lo); - emit_movmroi(as, RID_ESP, ofs+4, (int32_t)ir_knum(ir)->u32.hi); - } else { - r = ra_alloc1(as, ref, RSET_FPR); - emit_rmro(as, irt_isnum(ir->t) ? XO_MOVSDto : XO_MOVSSto, - r, RID_ESP, ofs); - } - ofs += (LJ_32 && irt_isfloat(ir->t)) ? 4 : 8; - } else { /* Non-FP argument is on stack. */ - if (LJ_32 && ref < ASMREF_TMP1) { - emit_movmroi(as, RID_ESP, ofs, ir->i); - } else { - r = ra_alloc1(as, ref, RSET_GPR); - emit_movtomro(as, REX_64 + r, RID_ESP, ofs); - } - ofs += sizeof(intptr_t); - } - checkmclim(as); - } -#if LJ_64 && !LJ_ABI_WIN - if (patchnfpr) *patchnfpr = fpr - REGARG_FIRSTFPR; -#endif -} - -/* Setup result reg/sp for call. Evict scratch regs. */ -static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci) -{ - RegSet drop = RSET_SCRATCH; - int hiop = (LJ_32 && (ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t)); - if ((ci->flags & CCI_NOFPRCLOBBER)) - drop &= ~RSET_FPR; - if (ra_hasreg(ir->r)) - rset_clear(drop, ir->r); /* Dest reg handled below. */ - if (hiop && ra_hasreg((ir+1)->r)) - rset_clear(drop, (ir+1)->r); /* Dest reg handled below. */ - ra_evictset(as, drop); /* Evictions must be performed first. */ - if (ra_used(ir)) { - if (irt_isfp(ir->t)) { - int32_t ofs = sps_scale(ir->s); /* Use spill slot or temp slots. */ -#if LJ_64 - if ((ci->flags & CCI_CASTU64)) { - Reg dest = ir->r; - if (ra_hasreg(dest)) { - ra_free(as, dest); - ra_modified(as, dest); - emit_rr(as, XO_MOVD, dest|REX_64, RID_RET); /* Really MOVQ. */ - } - if (ofs) emit_movtomro(as, RID_RET|REX_64, RID_ESP, ofs); - } else { - ra_destreg(as, ir, RID_FPRET); - } -#else - /* Number result is in x87 st0 for x86 calling convention. */ - Reg dest = ir->r; - if (ra_hasreg(dest)) { - ra_free(as, dest); - ra_modified(as, dest); - emit_rmro(as, irt_isnum(ir->t) ? XMM_MOVRM(as) : XO_MOVSS, - dest, RID_ESP, ofs); - } - if ((ci->flags & CCI_CASTU64)) { - emit_movtomro(as, RID_RETLO, RID_ESP, ofs); - emit_movtomro(as, RID_RETHI, RID_ESP, ofs+4); - } else { - emit_rmro(as, irt_isnum(ir->t) ? XO_FSTPq : XO_FSTPd, - irt_isnum(ir->t) ? XOg_FSTPq : XOg_FSTPd, RID_ESP, ofs); - } -#endif -#if LJ_32 - } else if (hiop) { - ra_destpair(as, ir); -#endif - } else { - lua_assert(!irt_ispri(ir->t)); - ra_destreg(as, ir, RID_RET); - } - } else if (LJ_32 && irt_isfp(ir->t) && !(ci->flags & CCI_CASTU64)) { - emit_x87op(as, XI_FPOP); /* Pop unused result from x87 st0. */ - } -} - -static void asm_call(ASMState *as, IRIns *ir) -{ - IRRef args[CCI_NARGS_MAX]; - const CCallInfo *ci = &lj_ir_callinfo[ir->op2]; - asm_collectargs(as, ir, ci, args); - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); -} - -/* Return a constant function pointer or NULL for indirect calls. */ -static void *asm_callx_func(ASMState *as, IRIns *irf, IRRef func) -{ -#if LJ_32 - UNUSED(as); - if (irref_isk(func)) - return (void *)irf->i; -#else - if (irref_isk(func)) { - MCode *p; - if (irf->o == IR_KINT64) - p = (MCode *)(void *)ir_k64(irf)->u64; - else - p = (MCode *)(void *)(uintptr_t)(uint32_t)irf->i; - if (p - as->mcp == (int32_t)(p - as->mcp)) - return p; /* Call target is still in +-2GB range. */ - /* Avoid the indirect case of emit_call(). Try to hoist func addr. */ - } -#endif - return NULL; -} - -static void asm_callx(ASMState *as, IRIns *ir) -{ - IRRef args[CCI_NARGS_MAX*2]; - CCallInfo ci; - IRRef func; - IRIns *irf; - int32_t spadj = 0; - ci.flags = asm_callx_flags(as, ir); - asm_collectargs(as, ir, &ci, args); - asm_setupresult(as, ir, &ci); -#if LJ_32 - /* Have to readjust stack after non-cdecl calls due to callee cleanup. */ - if ((ci.flags & CCI_CC_MASK) != CCI_CC_CDECL) - spadj = 4 * asm_count_call_slots(as, &ci, args); -#endif - func = ir->op2; irf = IR(func); - if (irf->o == IR_CARG) { func = irf->op1; irf = IR(func); } - ci.func = (ASMFunction)asm_callx_func(as, irf, func); - if (!(void *)ci.func) { - /* Use a (hoistable) non-scratch register for indirect calls. */ - RegSet allow = (RSET_GPR & ~RSET_SCRATCH); - Reg r = ra_alloc1(as, func, allow); - if (LJ_32) emit_spsub(as, spadj); /* Above code may cause restores! */ - emit_rr(as, XO_GROUP5, XOg_CALL, r); - } else if (LJ_32) { - emit_spsub(as, spadj); - } - asm_gencall(as, &ci, args); -} - -/* -- Returns ------------------------------------------------------------- */ - -/* Return to lower frame. Guard that it goes to the right spot. */ -static void asm_retf(ASMState *as, IRIns *ir) -{ - Reg base = ra_alloc1(as, REF_BASE, RSET_GPR); - void *pc = ir_kptr(IR(ir->op2)); - int32_t delta = 1+bc_a(*((const BCIns *)pc - 1)); - as->topslot -= (BCReg)delta; - if ((int32_t)as->topslot < 0) as->topslot = 0; - irt_setmark(IR(REF_BASE)->t); /* Children must not coalesce with BASE reg. */ - emit_setgl(as, base, jit_base); - emit_addptr(as, base, -8*delta); - asm_guardcc(as, CC_NE); - emit_gmroi(as, XG_ARITHi(XOg_CMP), base, -4, ptr2addr(pc)); -} - -/* -- Type conversions ---------------------------------------------------- */ - -static void asm_tointg(ASMState *as, IRIns *ir, Reg left) -{ - Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, left)); - Reg dest = ra_dest(as, ir, RSET_GPR); - asm_guardcc(as, CC_P); - asm_guardcc(as, CC_NE); - emit_rr(as, XO_UCOMISD, left, tmp); - emit_rr(as, XO_CVTSI2SD, tmp, dest); - if (!(as->flags & JIT_F_SPLIT_XMM)) - emit_rr(as, XO_XORPS, tmp, tmp); /* Avoid partial register stall. */ - emit_rr(as, XO_CVTTSD2SI, dest, left); - /* Can't fuse since left is needed twice. */ -} - -static void asm_tobit(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - Reg tmp = ra_noreg(IR(ir->op1)->r) ? - ra_alloc1(as, ir->op1, RSET_FPR) : - ra_scratch(as, RSET_FPR); - Reg right = asm_fuseload(as, ir->op2, rset_exclude(RSET_FPR, tmp)); - emit_rr(as, XO_MOVDto, tmp, dest); - emit_mrm(as, XO_ADDSD, tmp, right); - ra_left(as, tmp, ir->op1); -} - -static void asm_conv(ASMState *as, IRIns *ir) -{ - IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK); - int st64 = (st == IRT_I64 || st == IRT_U64 || (LJ_64 && st == IRT_P64)); - int stfp = (st == IRT_NUM || st == IRT_FLOAT); - IRRef lref = ir->op1; - lua_assert(irt_type(ir->t) != st); - lua_assert(!(LJ_32 && (irt_isint64(ir->t) || st64))); /* Handled by SPLIT. */ - if (irt_isfp(ir->t)) { - Reg dest = ra_dest(as, ir, RSET_FPR); - if (stfp) { /* FP to FP conversion. */ - Reg left = asm_fuseload(as, lref, RSET_FPR); - emit_mrm(as, st == IRT_NUM ? XO_CVTSD2SS : XO_CVTSS2SD, dest, left); - if (left == dest) return; /* Avoid the XO_XORPS. */ - } else if (LJ_32 && st == IRT_U32) { /* U32 to FP conversion on x86. */ - /* number = (2^52+2^51 .. u32) - (2^52+2^51) */ - cTValue *k = lj_ir_k64_find(as->J, U64x(43380000,00000000)); - Reg bias = ra_scratch(as, rset_exclude(RSET_FPR, dest)); - if (irt_isfloat(ir->t)) - emit_rr(as, XO_CVTSD2SS, dest, dest); - emit_rr(as, XO_SUBSD, dest, bias); /* Subtract 2^52+2^51 bias. */ - emit_rr(as, XO_XORPS, dest, bias); /* Merge bias and integer. */ - emit_loadn(as, bias, k); - emit_mrm(as, XO_MOVD, dest, asm_fuseload(as, lref, RSET_GPR)); - return; - } else { /* Integer to FP conversion. */ - Reg left = (LJ_64 && (st == IRT_U32 || st == IRT_U64)) ? - ra_alloc1(as, lref, RSET_GPR) : - asm_fuseloadm(as, lref, RSET_GPR, st64); - if (LJ_64 && st == IRT_U64) { - MCLabel l_end = emit_label(as); - const void *k = lj_ir_k64_find(as->J, U64x(43f00000,00000000)); - emit_rma(as, XO_ADDSD, dest, k); /* Add 2^64 to compensate. */ - emit_sjcc(as, CC_NS, l_end); - emit_rr(as, XO_TEST, left|REX_64, left); /* Check if u64 >= 2^63. */ - } - emit_mrm(as, irt_isnum(ir->t) ? XO_CVTSI2SD : XO_CVTSI2SS, - dest|((LJ_64 && (st64 || st == IRT_U32)) ? REX_64 : 0), left); - } - if (!(as->flags & JIT_F_SPLIT_XMM)) - emit_rr(as, XO_XORPS, dest, dest); /* Avoid partial register stall. */ - } else if (stfp) { /* FP to integer conversion. */ - if (irt_isguard(ir->t)) { - /* Checked conversions are only supported from number to int. */ - lua_assert(irt_isint(ir->t) && st == IRT_NUM); - asm_tointg(as, ir, ra_alloc1(as, lref, RSET_FPR)); - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - x86Op op = st == IRT_NUM ? - ((ir->op2 & IRCONV_TRUNC) ? XO_CVTTSD2SI : XO_CVTSD2SI) : - ((ir->op2 & IRCONV_TRUNC) ? XO_CVTTSS2SI : XO_CVTSS2SI); - if (LJ_64 ? irt_isu64(ir->t) : irt_isu32(ir->t)) { - /* LJ_64: For inputs >= 2^63 add -2^64, convert again. */ - /* LJ_32: For inputs >= 2^31 add -2^31, convert again and add 2^31. */ - Reg tmp = ra_noreg(IR(lref)->r) ? ra_alloc1(as, lref, RSET_FPR) : - ra_scratch(as, RSET_FPR); - MCLabel l_end = emit_label(as); - if (LJ_32) - emit_gri(as, XG_ARITHi(XOg_ADD), dest, (int32_t)0x80000000); - emit_rr(as, op, dest|REX_64, tmp); - if (st == IRT_NUM) - emit_rma(as, XO_ADDSD, tmp, lj_ir_k64_find(as->J, - LJ_64 ? U64x(c3f00000,00000000) : U64x(c1e00000,00000000))); - else - emit_rma(as, XO_ADDSS, tmp, lj_ir_k64_find(as->J, - LJ_64 ? U64x(00000000,df800000) : U64x(00000000,cf000000))); - emit_sjcc(as, CC_NS, l_end); - emit_rr(as, XO_TEST, dest|REX_64, dest); /* Check if dest negative. */ - emit_rr(as, op, dest|REX_64, tmp); - ra_left(as, tmp, lref); - } else { - Reg left = asm_fuseload(as, lref, RSET_FPR); - if (LJ_64 && irt_isu32(ir->t)) - emit_rr(as, XO_MOV, dest, dest); /* Zero hiword. */ - emit_mrm(as, op, - dest|((LJ_64 && - (irt_is64(ir->t) || irt_isu32(ir->t))) ? REX_64 : 0), - left); - } - } - } else if (st >= IRT_I8 && st <= IRT_U16) { /* Extend to 32 bit integer. */ - Reg left, dest = ra_dest(as, ir, RSET_GPR); - RegSet allow = RSET_GPR; - x86Op op; - lua_assert(irt_isint(ir->t) || irt_isu32(ir->t)); - if (st == IRT_I8) { - op = XO_MOVSXb; allow = RSET_GPR8; dest |= FORCE_REX; - } else if (st == IRT_U8) { - op = XO_MOVZXb; allow = RSET_GPR8; dest |= FORCE_REX; - } else if (st == IRT_I16) { - op = XO_MOVSXw; - } else { - op = XO_MOVZXw; - } - left = asm_fuseload(as, lref, allow); - /* Add extra MOV if source is already in wrong register. */ - if (!LJ_64 && left != RID_MRM && !rset_test(allow, left)) { - Reg tmp = ra_scratch(as, allow); - emit_rr(as, op, dest, tmp); - emit_rr(as, XO_MOV, tmp, left); - } else { - emit_mrm(as, op, dest, left); - } - } else { /* 32/64 bit integer conversions. */ - if (LJ_32) { /* Only need to handle 32/32 bit no-op (cast) on x86. */ - Reg dest = ra_dest(as, ir, RSET_GPR); - ra_left(as, dest, lref); /* Do nothing, but may need to move regs. */ - } else if (irt_is64(ir->t)) { - Reg dest = ra_dest(as, ir, RSET_GPR); - if (st64 || !(ir->op2 & IRCONV_SEXT)) { - /* 64/64 bit no-op (cast) or 32 to 64 bit zero extension. */ - ra_left(as, dest, lref); /* Do nothing, but may need to move regs. */ - } else { /* 32 to 64 bit sign extension. */ - Reg left = asm_fuseload(as, lref, RSET_GPR); - emit_mrm(as, XO_MOVSXd, dest|REX_64, left); - } - } else { - Reg dest = ra_dest(as, ir, RSET_GPR); - if (st64) { - Reg left = asm_fuseload(as, lref, RSET_GPR); - /* This is either a 32 bit reg/reg mov which zeroes the hiword - ** or a load of the loword from a 64 bit address. - */ - emit_mrm(as, XO_MOV, dest, left); - } else { /* 32/32 bit no-op (cast). */ - ra_left(as, dest, lref); /* Do nothing, but may need to move regs. */ - } - } - } -} - -#if LJ_32 && LJ_HASFFI -/* No SSE conversions to/from 64 bit on x86, so resort to ugly x87 code. */ - -/* 64 bit integer to FP conversion in 32 bit mode. */ -static void asm_conv_fp_int64(ASMState *as, IRIns *ir) -{ - Reg hi = ra_alloc1(as, ir->op1, RSET_GPR); - Reg lo = ra_alloc1(as, (ir-1)->op1, rset_exclude(RSET_GPR, hi)); - int32_t ofs = sps_scale(ir->s); /* Use spill slot or temp slots. */ - Reg dest = ir->r; - if (ra_hasreg(dest)) { - ra_free(as, dest); - ra_modified(as, dest); - emit_rmro(as, irt_isnum(ir->t) ? XMM_MOVRM(as) : XO_MOVSS, - dest, RID_ESP, ofs); - } - emit_rmro(as, irt_isnum(ir->t) ? XO_FSTPq : XO_FSTPd, - irt_isnum(ir->t) ? XOg_FSTPq : XOg_FSTPd, RID_ESP, ofs); - if (((ir-1)->op2 & IRCONV_SRCMASK) == IRT_U64) { - /* For inputs in [2^63,2^64-1] add 2^64 to compensate. */ - MCLabel l_end = emit_label(as); - emit_rma(as, XO_FADDq, XOg_FADDq, - lj_ir_k64_find(as->J, U64x(43f00000,00000000))); - emit_sjcc(as, CC_NS, l_end); - emit_rr(as, XO_TEST, hi, hi); /* Check if u64 >= 2^63. */ - } else { - lua_assert(((ir-1)->op2 & IRCONV_SRCMASK) == IRT_I64); - } - emit_rmro(as, XO_FILDq, XOg_FILDq, RID_ESP, 0); - /* NYI: Avoid narrow-to-wide store-to-load forwarding stall. */ - emit_rmro(as, XO_MOVto, hi, RID_ESP, 4); - emit_rmro(as, XO_MOVto, lo, RID_ESP, 0); -} - -/* FP to 64 bit integer conversion in 32 bit mode. */ -static void asm_conv_int64_fp(ASMState *as, IRIns *ir) -{ - IRType st = (IRType)((ir-1)->op2 & IRCONV_SRCMASK); - IRType dt = (((ir-1)->op2 & IRCONV_DSTMASK) >> IRCONV_DSH); - Reg lo, hi; - lua_assert(st == IRT_NUM || st == IRT_FLOAT); - lua_assert(dt == IRT_I64 || dt == IRT_U64); - lua_assert(((ir-1)->op2 & IRCONV_TRUNC)); - hi = ra_dest(as, ir, RSET_GPR); - lo = ra_dest(as, ir-1, rset_exclude(RSET_GPR, hi)); - if (ra_used(ir-1)) emit_rmro(as, XO_MOV, lo, RID_ESP, 0); - /* NYI: Avoid wide-to-narrow store-to-load forwarding stall. */ - if (!(as->flags & JIT_F_SSE3)) { /* Set FPU rounding mode to default. */ - emit_rmro(as, XO_FLDCW, XOg_FLDCW, RID_ESP, 4); - emit_rmro(as, XO_MOVto, lo, RID_ESP, 4); - emit_gri(as, XG_ARITHi(XOg_AND), lo, 0xf3ff); - } - if (dt == IRT_U64) { - /* For inputs in [2^63,2^64-1] add -2^64 and convert again. */ - MCLabel l_pop, l_end = emit_label(as); - emit_x87op(as, XI_FPOP); - l_pop = emit_label(as); - emit_sjmp(as, l_end); - emit_rmro(as, XO_MOV, hi, RID_ESP, 4); - if ((as->flags & JIT_F_SSE3)) - emit_rmro(as, XO_FISTTPq, XOg_FISTTPq, RID_ESP, 0); - else - emit_rmro(as, XO_FISTPq, XOg_FISTPq, RID_ESP, 0); - emit_rma(as, XO_FADDq, XOg_FADDq, - lj_ir_k64_find(as->J, U64x(c3f00000,00000000))); - emit_sjcc(as, CC_NS, l_pop); - emit_rr(as, XO_TEST, hi, hi); /* Check if out-of-range (2^63). */ - } - emit_rmro(as, XO_MOV, hi, RID_ESP, 4); - if ((as->flags & JIT_F_SSE3)) { /* Truncation is easy with SSE3. */ - emit_rmro(as, XO_FISTTPq, XOg_FISTTPq, RID_ESP, 0); - } else { /* Otherwise set FPU rounding mode to truncate before the store. */ - emit_rmro(as, XO_FISTPq, XOg_FISTPq, RID_ESP, 0); - emit_rmro(as, XO_FLDCW, XOg_FLDCW, RID_ESP, 0); - emit_rmro(as, XO_MOVtow, lo, RID_ESP, 0); - emit_rmro(as, XO_ARITHw(XOg_OR), lo, RID_ESP, 0); - emit_loadi(as, lo, 0xc00); - emit_rmro(as, XO_FNSTCW, XOg_FNSTCW, RID_ESP, 0); - } - if (dt == IRT_U64) - emit_x87op(as, XI_FDUP); - emit_mrm(as, st == IRT_NUM ? XO_FLDq : XO_FLDd, - st == IRT_NUM ? XOg_FLDq: XOg_FLDd, - asm_fuseload(as, ir->op1, RSET_EMPTY)); -} -#endif - -static void asm_strto(ASMState *as, IRIns *ir) -{ - /* Force a spill slot for the destination register (if any). */ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num]; - IRRef args[2]; - RegSet drop = RSET_SCRATCH; - if ((drop & RSET_FPR) != RSET_FPR && ra_hasreg(ir->r)) - rset_set(drop, ir->r); /* WIN64 doesn't spill all FPRs. */ - ra_evictset(as, drop); - asm_guardcc(as, CC_E); - emit_rr(as, XO_TEST, RID_RET, RID_RET); /* Test return status. */ - args[0] = ir->op1; /* GCstr *str */ - args[1] = ASMREF_TMP1; /* TValue *n */ - asm_gencall(as, ci, args); - /* Store the result to the spill slot or temp slots. */ - emit_rmro(as, XO_LEA, ra_releasetmp(as, ASMREF_TMP1)|REX_64, - RID_ESP, sps_scale(ir->s)); -} - -static void asm_tostr(ASMState *as, IRIns *ir) -{ - IRIns *irl = IR(ir->op1); - IRRef args[2]; - args[0] = ASMREF_L; - as->gcsteps++; - if (irt_isnum(irl->t)) { - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromnum]; - args[1] = ASMREF_TMP1; /* const lua_Number * */ - asm_setupresult(as, ir, ci); /* GCstr * */ - asm_gencall(as, ci, args); - emit_rmro(as, XO_LEA, ra_releasetmp(as, ASMREF_TMP1)|REX_64, - RID_ESP, ra_spill(as, irl)); - } else { - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromint]; - args[1] = ir->op1; /* int32_t k */ - asm_setupresult(as, ir, ci); /* GCstr * */ - asm_gencall(as, ci, args); - } -} - -/* -- Memory references --------------------------------------------------- */ - -static void asm_aref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - asm_fusearef(as, ir, RSET_GPR); - if (!(as->mrm.idx == RID_NONE && as->mrm.ofs == 0)) - emit_mrm(as, XO_LEA, dest, RID_MRM); - else if (as->mrm.base != dest) - emit_rr(as, XO_MOV, dest, as->mrm.base); -} - -/* Merge NE(HREF, niltv) check. */ -static MCode *merge_href_niltv(ASMState *as, IRIns *ir) -{ - /* Assumes nothing else generates NE of HREF. */ - if ((ir[1].o == IR_NE || ir[1].o == IR_EQ) && ir[1].op1 == as->curins && - ra_hasreg(ir->r)) { - MCode *p = as->mcp; - p += (LJ_64 && *p != XI_ARITHi) ? 7+6 : 6+6; - /* Ensure no loop branch inversion happened. */ - if (p[-6] == 0x0f && p[-5] == XI_JCCn+(CC_NE^(ir[1].o & 1))) { - as->mcp = p; /* Kill cmp reg, imm32 + jz exit. */ - return p + *(int32_t *)(p-4); /* Return exit address. */ - } - } - return NULL; -} - -/* Inlined hash lookup. Specialized for key type and for const keys. -** The equivalent C code is: -** Node *n = hashkey(t, key); -** do { -** if (lj_obj_equal(&n->key, key)) return &n->val; -** } while ((n = nextnode(n))); -** return niltv(L); -*/ -static void asm_href(ASMState *as, IRIns *ir) -{ - MCode *nilexit = merge_href_niltv(as, ir); /* Do this before any restores. */ - RegSet allow = RSET_GPR; - Reg dest = ra_dest(as, ir, allow); - Reg tab = ra_alloc1(as, ir->op1, rset_clear(allow, dest)); - Reg key = RID_NONE, tmp = RID_NONE; - IRIns *irkey = IR(ir->op2); - int isk = irref_isk(ir->op2); - IRType1 kt = irkey->t; - uint32_t khash; - MCLabel l_end, l_loop, l_next; - - if (!isk) { - rset_clear(allow, tab); - key = ra_alloc1(as, ir->op2, irt_isnum(kt) ? RSET_FPR : allow); - if (!irt_isstr(kt)) - tmp = ra_scratch(as, rset_exclude(allow, key)); - } - - /* Key not found in chain: jump to exit (if merged with NE) or load niltv. */ - l_end = emit_label(as); - if (nilexit && ir[1].o == IR_NE) { - emit_jcc(as, CC_E, nilexit); /* XI_JMP is not found by lj_asm_patchexit. */ - nilexit = NULL; - } else { - emit_loada(as, dest, niltvg(J2G(as->J))); - } - - /* Follow hash chain until the end. */ - l_loop = emit_sjcc_label(as, CC_NZ); - emit_rr(as, XO_TEST, dest, dest); - emit_rmro(as, XO_MOV, dest, dest, offsetof(Node, next)); - l_next = emit_label(as); - - /* Type and value comparison. */ - if (nilexit) - emit_jcc(as, CC_E, nilexit); - else - emit_sjcc(as, CC_E, l_end); - if (irt_isnum(kt)) { - if (isk) { - /* Assumes -0.0 is already canonicalized to +0.0. */ - emit_gmroi(as, XG_ARITHi(XOg_CMP), dest, offsetof(Node, key.u32.lo), - (int32_t)ir_knum(irkey)->u32.lo); - emit_sjcc(as, CC_NE, l_next); - emit_gmroi(as, XG_ARITHi(XOg_CMP), dest, offsetof(Node, key.u32.hi), - (int32_t)ir_knum(irkey)->u32.hi); - } else { - emit_sjcc(as, CC_P, l_next); - emit_rmro(as, XO_UCOMISD, key, dest, offsetof(Node, key.n)); - emit_sjcc(as, CC_AE, l_next); - /* The type check avoids NaN penalties and complaints from Valgrind. */ -#if LJ_64 - emit_u32(as, LJ_TISNUM); - emit_rmro(as, XO_ARITHi, XOg_CMP, dest, offsetof(Node, key.it)); -#else - emit_i8(as, LJ_TISNUM); - emit_rmro(as, XO_ARITHi8, XOg_CMP, dest, offsetof(Node, key.it)); -#endif - } -#if LJ_64 - } else if (irt_islightud(kt)) { - emit_rmro(as, XO_CMP, key|REX_64, dest, offsetof(Node, key.u64)); -#endif - } else { - if (!irt_ispri(kt)) { - lua_assert(irt_isaddr(kt)); - if (isk) - emit_gmroi(as, XG_ARITHi(XOg_CMP), dest, offsetof(Node, key.gcr), - ptr2addr(ir_kgc(irkey))); - else - emit_rmro(as, XO_CMP, key, dest, offsetof(Node, key.gcr)); - emit_sjcc(as, CC_NE, l_next); - } - lua_assert(!irt_isnil(kt)); - emit_i8(as, irt_toitype(kt)); - emit_rmro(as, XO_ARITHi8, XOg_CMP, dest, offsetof(Node, key.it)); - } - emit_sfixup(as, l_loop); - checkmclim(as); - - /* Load main position relative to tab->node into dest. */ - khash = isk ? ir_khash(irkey) : 1; - if (khash == 0) { - emit_rmro(as, XO_MOV, dest, tab, offsetof(GCtab, node)); - } else { - emit_rmro(as, XO_ARITH(XOg_ADD), dest, tab, offsetof(GCtab, node)); - if ((as->flags & JIT_F_PREFER_IMUL)) { - emit_i8(as, sizeof(Node)); - emit_rr(as, XO_IMULi8, dest, dest); - } else { - emit_shifti(as, XOg_SHL, dest, 3); - emit_rmrxo(as, XO_LEA, dest, dest, dest, XM_SCALE2, 0); - } - if (isk) { - emit_gri(as, XG_ARITHi(XOg_AND), dest, (int32_t)khash); - emit_rmro(as, XO_MOV, dest, tab, offsetof(GCtab, hmask)); - } else if (irt_isstr(kt)) { - emit_rmro(as, XO_ARITH(XOg_AND), dest, key, offsetof(GCstr, hash)); - emit_rmro(as, XO_MOV, dest, tab, offsetof(GCtab, hmask)); - } else { /* Must match with hashrot() in lj_tab.c. */ - emit_rmro(as, XO_ARITH(XOg_AND), dest, tab, offsetof(GCtab, hmask)); - emit_rr(as, XO_ARITH(XOg_SUB), dest, tmp); - emit_shifti(as, XOg_ROL, tmp, HASH_ROT3); - emit_rr(as, XO_ARITH(XOg_XOR), dest, tmp); - emit_shifti(as, XOg_ROL, dest, HASH_ROT2); - emit_rr(as, XO_ARITH(XOg_SUB), tmp, dest); - emit_shifti(as, XOg_ROL, dest, HASH_ROT1); - emit_rr(as, XO_ARITH(XOg_XOR), tmp, dest); - if (irt_isnum(kt)) { - emit_rr(as, XO_ARITH(XOg_ADD), dest, dest); -#if LJ_64 - emit_shifti(as, XOg_SHR|REX_64, dest, 32); - emit_rr(as, XO_MOV, tmp, dest); - emit_rr(as, XO_MOVDto, key|REX_64, dest); -#else - emit_rmro(as, XO_MOV, dest, RID_ESP, ra_spill(as, irkey)+4); - emit_rr(as, XO_MOVDto, key, tmp); -#endif - } else { - emit_rr(as, XO_MOV, tmp, key); - emit_rmro(as, XO_LEA, dest, key, HASH_BIAS); - } - } - } -} - -static void asm_hrefk(ASMState *as, IRIns *ir) -{ - IRIns *kslot = IR(ir->op2); - IRIns *irkey = IR(kslot->op1); - int32_t ofs = (int32_t)(kslot->op2 * sizeof(Node)); - Reg dest = ra_used(ir) ? ra_dest(as, ir, RSET_GPR) : RID_NONE; - Reg node = ra_alloc1(as, ir->op1, RSET_GPR); -#if !LJ_64 - MCLabel l_exit; -#endif - lua_assert(ofs % sizeof(Node) == 0); - if (ra_hasreg(dest)) { - if (ofs != 0) { - if (dest == node && !(as->flags & JIT_F_LEA_AGU)) - emit_gri(as, XG_ARITHi(XOg_ADD), dest, ofs); - else - emit_rmro(as, XO_LEA, dest, node, ofs); - } else if (dest != node) { - emit_rr(as, XO_MOV, dest, node); - } - } - asm_guardcc(as, CC_NE); -#if LJ_64 - if (!irt_ispri(irkey->t)) { - Reg key = ra_scratch(as, rset_exclude(RSET_GPR, node)); - emit_rmro(as, XO_CMP, key|REX_64, node, - ofs + (int32_t)offsetof(Node, key.u64)); - lua_assert(irt_isnum(irkey->t) || irt_isgcv(irkey->t)); - /* Assumes -0.0 is already canonicalized to +0.0. */ - emit_loadu64(as, key, irt_isnum(irkey->t) ? ir_knum(irkey)->u64 : - ((uint64_t)irt_toitype(irkey->t) << 32) | - (uint64_t)(uint32_t)ptr2addr(ir_kgc(irkey))); - } else { - lua_assert(!irt_isnil(irkey->t)); - emit_i8(as, irt_toitype(irkey->t)); - emit_rmro(as, XO_ARITHi8, XOg_CMP, node, - ofs + (int32_t)offsetof(Node, key.it)); - } -#else - l_exit = emit_label(as); - if (irt_isnum(irkey->t)) { - /* Assumes -0.0 is already canonicalized to +0.0. */ - emit_gmroi(as, XG_ARITHi(XOg_CMP), node, - ofs + (int32_t)offsetof(Node, key.u32.lo), - (int32_t)ir_knum(irkey)->u32.lo); - emit_sjcc(as, CC_NE, l_exit); - emit_gmroi(as, XG_ARITHi(XOg_CMP), node, - ofs + (int32_t)offsetof(Node, key.u32.hi), - (int32_t)ir_knum(irkey)->u32.hi); - } else { - if (!irt_ispri(irkey->t)) { - lua_assert(irt_isgcv(irkey->t)); - emit_gmroi(as, XG_ARITHi(XOg_CMP), node, - ofs + (int32_t)offsetof(Node, key.gcr), - ptr2addr(ir_kgc(irkey))); - emit_sjcc(as, CC_NE, l_exit); - } - lua_assert(!irt_isnil(irkey->t)); - emit_i8(as, irt_toitype(irkey->t)); - emit_rmro(as, XO_ARITHi8, XOg_CMP, node, - ofs + (int32_t)offsetof(Node, key.it)); - } -#endif -} - -static void asm_newref(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey]; - IRRef args[3]; - IRIns *irkey; - Reg tmp; - if (ir->r == RID_SINK) - return; - args[0] = ASMREF_L; /* lua_State *L */ - args[1] = ir->op1; /* GCtab *t */ - args[2] = ASMREF_TMP1; /* cTValue *key */ - asm_setupresult(as, ir, ci); /* TValue * */ - asm_gencall(as, ci, args); - tmp = ra_releasetmp(as, ASMREF_TMP1); - irkey = IR(ir->op2); - if (irt_isnum(irkey->t)) { - /* For numbers use the constant itself or a spill slot as a TValue. */ - if (irref_isk(ir->op2)) - emit_loada(as, tmp, ir_knum(irkey)); - else - emit_rmro(as, XO_LEA, tmp|REX_64, RID_ESP, ra_spill(as, irkey)); - } else { - /* Otherwise use g->tmptv to hold the TValue. */ - if (!irref_isk(ir->op2)) { - Reg src = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, tmp)); - emit_movtomro(as, REX_64IR(irkey, src), tmp, 0); - } else if (!irt_ispri(irkey->t)) { - emit_movmroi(as, tmp, 0, irkey->i); - } - if (!(LJ_64 && irt_islightud(irkey->t))) - emit_movmroi(as, tmp, 4, irt_toitype(irkey->t)); - emit_loada(as, tmp, &J2G(as->J)->tmptv); - } -} - -static void asm_uref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - if (irref_isk(ir->op1)) { - GCfunc *fn = ir_kfunc(IR(ir->op1)); - MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v; - emit_rma(as, XO_MOV, dest, v); - } else { - Reg uv = ra_scratch(as, RSET_GPR); - Reg func = ra_alloc1(as, ir->op1, RSET_GPR); - if (ir->o == IR_UREFC) { - emit_rmro(as, XO_LEA, dest, uv, offsetof(GCupval, tv)); - asm_guardcc(as, CC_NE); - emit_i8(as, 1); - emit_rmro(as, XO_ARITHib, XOg_CMP, uv, offsetof(GCupval, closed)); - } else { - emit_rmro(as, XO_MOV, dest, uv, offsetof(GCupval, v)); - } - emit_rmro(as, XO_MOV, uv, func, - (int32_t)offsetof(GCfuncL, uvptr) + 4*(int32_t)(ir->op2 >> 8)); - } -} - -static void asm_fref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - asm_fusefref(as, ir, RSET_GPR); - emit_mrm(as, XO_LEA, dest, RID_MRM); -} - -static void asm_strref(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - asm_fusestrref(as, ir, RSET_GPR); - if (as->mrm.base == RID_NONE) - emit_loadi(as, dest, as->mrm.ofs); - else if (as->mrm.base == dest && as->mrm.idx == RID_NONE) - emit_gri(as, XG_ARITHi(XOg_ADD), dest, as->mrm.ofs); - else - emit_mrm(as, XO_LEA, dest, RID_MRM); -} - -/* -- Loads and stores ---------------------------------------------------- */ - -static void asm_fxload(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); - x86Op xo; - if (ir->o == IR_FLOAD) - asm_fusefref(as, ir, RSET_GPR); - else - asm_fusexref(as, ir->op1, RSET_GPR); - /* ir->op2 is ignored -- unaligned loads are ok on x86. */ - switch (irt_type(ir->t)) { - case IRT_I8: xo = XO_MOVSXb; break; - case IRT_U8: xo = XO_MOVZXb; break; - case IRT_I16: xo = XO_MOVSXw; break; - case IRT_U16: xo = XO_MOVZXw; break; - case IRT_NUM: xo = XMM_MOVRM(as); break; - case IRT_FLOAT: xo = XO_MOVSS; break; - default: - if (LJ_64 && irt_is64(ir->t)) - dest |= REX_64; - else - lua_assert(irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t)); - xo = XO_MOV; - break; - } - emit_mrm(as, xo, dest, RID_MRM); -} - -static void asm_fxstore(ASMState *as, IRIns *ir) -{ - RegSet allow = RSET_GPR; - Reg src = RID_NONE, osrc = RID_NONE; - int32_t k = 0; - if (ir->r == RID_SINK) - return; - /* The IRT_I16/IRT_U16 stores should never be simplified for constant - ** values since mov word [mem], imm16 has a length-changing prefix. - */ - if (irt_isi16(ir->t) || irt_isu16(ir->t) || irt_isfp(ir->t) || - !asm_isk32(as, ir->op2, &k)) { - RegSet allow8 = irt_isfp(ir->t) ? RSET_FPR : - (irt_isi8(ir->t) || irt_isu8(ir->t)) ? RSET_GPR8 : RSET_GPR; - src = osrc = ra_alloc1(as, ir->op2, allow8); - if (!LJ_64 && !rset_test(allow8, src)) { /* Already in wrong register. */ - rset_clear(allow, osrc); - src = ra_scratch(as, allow8); - } - rset_clear(allow, src); - } - if (ir->o == IR_FSTORE) { - asm_fusefref(as, IR(ir->op1), allow); - } else { - asm_fusexref(as, ir->op1, allow); - if (LJ_32 && ir->o == IR_HIOP) as->mrm.ofs += 4; - } - if (ra_hasreg(src)) { - x86Op xo; - switch (irt_type(ir->t)) { - case IRT_I8: case IRT_U8: xo = XO_MOVtob; src |= FORCE_REX; break; - case IRT_I16: case IRT_U16: xo = XO_MOVtow; break; - case IRT_NUM: xo = XO_MOVSDto; break; - case IRT_FLOAT: xo = XO_MOVSSto; break; -#if LJ_64 - case IRT_LIGHTUD: lua_assert(0); /* NYI: mask 64 bit lightuserdata. */ -#endif - default: - if (LJ_64 && irt_is64(ir->t)) - src |= REX_64; - else - lua_assert(irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t)); - xo = XO_MOVto; - break; - } - emit_mrm(as, xo, src, RID_MRM); - if (!LJ_64 && src != osrc) { - ra_noweak(as, osrc); - emit_rr(as, XO_MOV, src, osrc); - } - } else { - if (irt_isi8(ir->t) || irt_isu8(ir->t)) { - emit_i8(as, k); - emit_mrm(as, XO_MOVmib, 0, RID_MRM); - } else { - lua_assert(irt_is64(ir->t) || irt_isint(ir->t) || irt_isu32(ir->t) || - irt_isaddr(ir->t)); - emit_i32(as, k); - emit_mrm(as, XO_MOVmi, REX_64IR(ir, 0), RID_MRM); - } - } -} - -#if LJ_64 -static Reg asm_load_lightud64(ASMState *as, IRIns *ir, int typecheck) -{ - if (ra_used(ir) || typecheck) { - Reg dest = ra_dest(as, ir, RSET_GPR); - if (typecheck) { - Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, dest)); - asm_guardcc(as, CC_NE); - emit_i8(as, -2); - emit_rr(as, XO_ARITHi8, XOg_CMP, tmp); - emit_shifti(as, XOg_SAR|REX_64, tmp, 47); - emit_rr(as, XO_MOV, tmp|REX_64, dest); - } - return dest; - } else { - return RID_NONE; - } -} -#endif - -static void asm_ahuvload(ASMState *as, IRIns *ir) -{ - lua_assert(irt_isnum(ir->t) || irt_ispri(ir->t) || irt_isaddr(ir->t) || - (LJ_DUALNUM && irt_isint(ir->t))); -#if LJ_64 - if (irt_islightud(ir->t)) { - Reg dest = asm_load_lightud64(as, ir, 1); - if (ra_hasreg(dest)) { - asm_fuseahuref(as, ir->op1, RSET_GPR); - emit_mrm(as, XO_MOV, dest|REX_64, RID_MRM); - } - return; - } else -#endif - if (ra_used(ir)) { - RegSet allow = irt_isnum(ir->t) ? RSET_FPR : RSET_GPR; - Reg dest = ra_dest(as, ir, allow); - asm_fuseahuref(as, ir->op1, RSET_GPR); - emit_mrm(as, dest < RID_MAX_GPR ? XO_MOV : XMM_MOVRM(as), dest, RID_MRM); - } else { - asm_fuseahuref(as, ir->op1, RSET_GPR); - } - /* Always do the type check, even if the load result is unused. */ - as->mrm.ofs += 4; - asm_guardcc(as, irt_isnum(ir->t) ? CC_AE : CC_NE); - if (LJ_64 && irt_type(ir->t) >= IRT_NUM) { - lua_assert(irt_isinteger(ir->t) || irt_isnum(ir->t)); - emit_u32(as, LJ_TISNUM); - emit_mrm(as, XO_ARITHi, XOg_CMP, RID_MRM); - } else { - emit_i8(as, irt_toitype(ir->t)); - emit_mrm(as, XO_ARITHi8, XOg_CMP, RID_MRM); - } -} - -static void asm_ahustore(ASMState *as, IRIns *ir) -{ - if (ir->r == RID_SINK) - return; - if (irt_isnum(ir->t)) { - Reg src = ra_alloc1(as, ir->op2, RSET_FPR); - asm_fuseahuref(as, ir->op1, RSET_GPR); - emit_mrm(as, XO_MOVSDto, src, RID_MRM); -#if LJ_64 - } else if (irt_islightud(ir->t)) { - Reg src = ra_alloc1(as, ir->op2, RSET_GPR); - asm_fuseahuref(as, ir->op1, rset_exclude(RSET_GPR, src)); - emit_mrm(as, XO_MOVto, src|REX_64, RID_MRM); -#endif - } else { - IRIns *irr = IR(ir->op2); - RegSet allow = RSET_GPR; - Reg src = RID_NONE; - if (!irref_isk(ir->op2)) { - src = ra_alloc1(as, ir->op2, allow); - rset_clear(allow, src); - } - asm_fuseahuref(as, ir->op1, allow); - if (ra_hasreg(src)) { - emit_mrm(as, XO_MOVto, src, RID_MRM); - } else if (!irt_ispri(irr->t)) { - lua_assert(irt_isaddr(ir->t) || (LJ_DUALNUM && irt_isinteger(ir->t))); - emit_i32(as, irr->i); - emit_mrm(as, XO_MOVmi, 0, RID_MRM); - } - as->mrm.ofs += 4; - emit_i32(as, (int32_t)irt_toitype(ir->t)); - emit_mrm(as, XO_MOVmi, 0, RID_MRM); - } -} - -static void asm_sload(ASMState *as, IRIns *ir) -{ - int32_t ofs = 8*((int32_t)ir->op1-1) + ((ir->op2 & IRSLOAD_FRAME) ? 4 : 0); - IRType1 t = ir->t; - Reg base; - lua_assert(!(ir->op2 & IRSLOAD_PARENT)); /* Handled by asm_head_side(). */ - lua_assert(irt_isguard(t) || !(ir->op2 & IRSLOAD_TYPECHECK)); - lua_assert(LJ_DUALNUM || - !irt_isint(t) || (ir->op2 & (IRSLOAD_CONVERT|IRSLOAD_FRAME))); - if ((ir->op2 & IRSLOAD_CONVERT) && irt_isguard(t) && irt_isint(t)) { - Reg left = ra_scratch(as, RSET_FPR); - asm_tointg(as, ir, left); /* Frees dest reg. Do this before base alloc. */ - base = ra_alloc1(as, REF_BASE, RSET_GPR); - emit_rmro(as, XMM_MOVRM(as), left, base, ofs); - t.irt = IRT_NUM; /* Continue with a regular number type check. */ -#if LJ_64 - } else if (irt_islightud(t)) { - Reg dest = asm_load_lightud64(as, ir, (ir->op2 & IRSLOAD_TYPECHECK)); - if (ra_hasreg(dest)) { - base = ra_alloc1(as, REF_BASE, RSET_GPR); - emit_rmro(as, XO_MOV, dest|REX_64, base, ofs); - } - return; -#endif - } else if (ra_used(ir)) { - RegSet allow = irt_isnum(t) ? RSET_FPR : RSET_GPR; - Reg dest = ra_dest(as, ir, allow); - base = ra_alloc1(as, REF_BASE, RSET_GPR); - lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t)); - if ((ir->op2 & IRSLOAD_CONVERT)) { - t.irt = irt_isint(t) ? IRT_NUM : IRT_INT; /* Check for original type. */ - emit_rmro(as, irt_isint(t) ? XO_CVTSI2SD : XO_CVTSD2SI, dest, base, ofs); - } else if (irt_isnum(t)) { - emit_rmro(as, XMM_MOVRM(as), dest, base, ofs); - } else { - emit_rmro(as, XO_MOV, dest, base, ofs); - } - } else { - if (!(ir->op2 & IRSLOAD_TYPECHECK)) - return; /* No type check: avoid base alloc. */ - base = ra_alloc1(as, REF_BASE, RSET_GPR); - } - if ((ir->op2 & IRSLOAD_TYPECHECK)) { - /* Need type check, even if the load result is unused. */ - asm_guardcc(as, irt_isnum(t) ? CC_AE : CC_NE); - if (LJ_64 && irt_type(t) >= IRT_NUM) { - lua_assert(irt_isinteger(t) || irt_isnum(t)); - emit_u32(as, LJ_TISNUM); - emit_rmro(as, XO_ARITHi, XOg_CMP, base, ofs+4); - } else { - emit_i8(as, irt_toitype(t)); - emit_rmro(as, XO_ARITHi8, XOg_CMP, base, ofs+4); - } - } -} - -/* -- Allocations --------------------------------------------------------- */ - -#if LJ_HASFFI -static void asm_cnew(ASMState *as, IRIns *ir) -{ - CTState *cts = ctype_ctsG(J2G(as->J)); - CTypeID ctypeid = (CTypeID)IR(ir->op1)->i; - CTSize sz = (ir->o == IR_CNEWI || ir->op2 == REF_NIL) ? - lj_ctype_size(cts, ctypeid) : (CTSize)IR(ir->op2)->i; - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco]; - IRRef args[2]; - lua_assert(sz != CTSIZE_INVALID); - - args[0] = ASMREF_L; /* lua_State *L */ - args[1] = ASMREF_TMP1; /* MSize size */ - as->gcsteps++; - asm_setupresult(as, ir, ci); /* GCcdata * */ - - /* Initialize immutable cdata object. */ - if (ir->o == IR_CNEWI) { - RegSet allow = (RSET_GPR & ~RSET_SCRATCH); -#if LJ_64 - Reg r64 = sz == 8 ? REX_64 : 0; - if (irref_isk(ir->op2)) { - IRIns *irk = IR(ir->op2); - uint64_t k = irk->o == IR_KINT64 ? ir_k64(irk)->u64 : - (uint64_t)(uint32_t)irk->i; - if (sz == 4 || checki32((int64_t)k)) { - emit_i32(as, (int32_t)k); - emit_rmro(as, XO_MOVmi, r64, RID_RET, sizeof(GCcdata)); - } else { - emit_movtomro(as, RID_ECX + r64, RID_RET, sizeof(GCcdata)); - emit_loadu64(as, RID_ECX, k); - } - } else { - Reg r = ra_alloc1(as, ir->op2, allow); - emit_movtomro(as, r + r64, RID_RET, sizeof(GCcdata)); - } -#else - int32_t ofs = sizeof(GCcdata); - if (sz == 8) { - ofs += 4; ir++; - lua_assert(ir->o == IR_HIOP); - } - do { - if (irref_isk(ir->op2)) { - emit_movmroi(as, RID_RET, ofs, IR(ir->op2)->i); - } else { - Reg r = ra_alloc1(as, ir->op2, allow); - emit_movtomro(as, r, RID_RET, ofs); - rset_clear(allow, r); - } - if (ofs == sizeof(GCcdata)) break; - ofs -= 4; ir--; - } while (1); -#endif - lua_assert(sz == 4 || sz == 8); - } - - /* Combine initialization of marked, gct and ctypeid. */ - emit_movtomro(as, RID_ECX, RID_RET, offsetof(GCcdata, marked)); - emit_gri(as, XG_ARITHi(XOg_OR), RID_ECX, - (int32_t)((~LJ_TCDATA<<8)+(ctypeid<<16))); - emit_gri(as, XG_ARITHi(XOg_AND), RID_ECX, LJ_GC_WHITES); - emit_opgl(as, XO_MOVZXb, RID_ECX, gc.currentwhite); - - asm_gencall(as, ci, args); - emit_loadi(as, ra_releasetmp(as, ASMREF_TMP1), (int32_t)(sz+sizeof(GCcdata))); -} -#else -#define asm_cnew(as, ir) ((void)0) -#endif - -/* -- Write barriers ------------------------------------------------------ */ - -static void asm_tbar(ASMState *as, IRIns *ir) -{ - Reg tab = ra_alloc1(as, ir->op1, RSET_GPR); - Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, tab)); - MCLabel l_end = emit_label(as); - emit_movtomro(as, tmp, tab, offsetof(GCtab, gclist)); - emit_setgl(as, tab, gc.grayagain); - emit_getgl(as, tmp, gc.grayagain); - emit_i8(as, ~LJ_GC_BLACK); - emit_rmro(as, XO_ARITHib, XOg_AND, tab, offsetof(GCtab, marked)); - emit_sjcc(as, CC_Z, l_end); - emit_i8(as, LJ_GC_BLACK); - emit_rmro(as, XO_GROUP3b, XOg_TEST, tab, offsetof(GCtab, marked)); -} - -static void asm_obar(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_barrieruv]; - IRRef args[2]; - MCLabel l_end; - Reg obj; - /* No need for other object barriers (yet). */ - lua_assert(IR(ir->op1)->o == IR_UREFC); - ra_evictset(as, RSET_SCRATCH); - l_end = emit_label(as); - args[0] = ASMREF_TMP1; /* global_State *g */ - args[1] = ir->op1; /* TValue *tv */ - asm_gencall(as, ci, args); - emit_loada(as, ra_releasetmp(as, ASMREF_TMP1), J2G(as->J)); - obj = IR(ir->op1)->r; - emit_sjcc(as, CC_Z, l_end); - emit_i8(as, LJ_GC_WHITES); - if (irref_isk(ir->op2)) { - GCobj *vp = ir_kgc(IR(ir->op2)); - emit_rma(as, XO_GROUP3b, XOg_TEST, &vp->gch.marked); - } else { - Reg val = ra_alloc1(as, ir->op2, rset_exclude(RSET_SCRATCH&RSET_GPR, obj)); - emit_rmro(as, XO_GROUP3b, XOg_TEST, val, (int32_t)offsetof(GChead, marked)); - } - emit_sjcc(as, CC_Z, l_end); - emit_i8(as, LJ_GC_BLACK); - emit_rmro(as, XO_GROUP3b, XOg_TEST, obj, - (int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)); -} - -/* -- FP/int arithmetic and logic operations ------------------------------ */ - -/* Load reference onto x87 stack. Force a spill to memory if needed. */ -static void asm_x87load(ASMState *as, IRRef ref) -{ - IRIns *ir = IR(ref); - if (ir->o == IR_KNUM) { - cTValue *tv = ir_knum(ir); - if (tvispzero(tv)) /* Use fldz only for +0. */ - emit_x87op(as, XI_FLDZ); - else if (tvispone(tv)) - emit_x87op(as, XI_FLD1); - else - emit_rma(as, XO_FLDq, XOg_FLDq, tv); - } else if (ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT && !ra_used(ir) && - !irref_isk(ir->op1) && mayfuse(as, ir->op1)) { - IRIns *iri = IR(ir->op1); - emit_rmro(as, XO_FILDd, XOg_FILDd, RID_ESP, ra_spill(as, iri)); - } else { - emit_mrm(as, XO_FLDq, XOg_FLDq, asm_fuseload(as, ref, RSET_EMPTY)); - } -} - -/* Try to rejoin pow from EXP2, MUL and LOG2 (if still unsplit). */ -static int fpmjoin_pow(ASMState *as, IRIns *ir) -{ - IRIns *irp = IR(ir->op1); - if (irp == ir-1 && irp->o == IR_MUL && !ra_used(irp)) { - IRIns *irpp = IR(irp->op1); - if (irpp == ir-2 && irpp->o == IR_FPMATH && - irpp->op2 == IRFPM_LOG2 && !ra_used(irpp)) { - /* The modified regs must match with the *.dasc implementation. */ - RegSet drop = RSET_RANGE(RID_XMM0, RID_XMM2+1)|RID2RSET(RID_EAX); - IRIns *irx; - if (ra_hasreg(ir->r)) - rset_clear(drop, ir->r); /* Dest reg handled below. */ - ra_evictset(as, drop); - ra_destreg(as, ir, RID_XMM0); - emit_call(as, lj_vm_pow_sse); - irx = IR(irpp->op1); - if (ra_noreg(irx->r) && ra_gethint(irx->r) == RID_XMM1) - irx->r = RID_INIT; /* Avoid allocating xmm1 for x. */ - ra_left(as, RID_XMM0, irpp->op1); - ra_left(as, RID_XMM1, irp->op2); - return 1; - } - } - return 0; -} - -static void asm_fpmath(ASMState *as, IRIns *ir) -{ - IRFPMathOp fpm = ir->o == IR_FPMATH ? (IRFPMathOp)ir->op2 : IRFPM_OTHER; - if (fpm == IRFPM_SQRT) { - Reg dest = ra_dest(as, ir, RSET_FPR); - Reg left = asm_fuseload(as, ir->op1, RSET_FPR); - emit_mrm(as, XO_SQRTSD, dest, left); - } else if (fpm <= IRFPM_TRUNC) { - if (as->flags & JIT_F_SSE4_1) { /* SSE4.1 has a rounding instruction. */ - Reg dest = ra_dest(as, ir, RSET_FPR); - Reg left = asm_fuseload(as, ir->op1, RSET_FPR); - /* ROUNDSD has a 4-byte opcode which doesn't fit in x86Op. - ** Let's pretend it's a 3-byte opcode, and compensate afterwards. - ** This is atrocious, but the alternatives are much worse. - */ - /* Round down/up/trunc == 1001/1010/1011. */ - emit_i8(as, 0x09 + fpm); - emit_mrm(as, XO_ROUNDSD, dest, left); - if (LJ_64 && as->mcp[1] != (MCode)(XO_ROUNDSD >> 16)) { - as->mcp[0] = as->mcp[1]; as->mcp[1] = 0x0f; /* Swap 0F and REX. */ - } - *--as->mcp = 0x66; /* 1st byte of ROUNDSD opcode. */ - } else { /* Call helper functions for SSE2 variant. */ - /* The modified regs must match with the *.dasc implementation. */ - RegSet drop = RSET_RANGE(RID_XMM0, RID_XMM3+1)|RID2RSET(RID_EAX); - if (ra_hasreg(ir->r)) - rset_clear(drop, ir->r); /* Dest reg handled below. */ - ra_evictset(as, drop); - ra_destreg(as, ir, RID_XMM0); - emit_call(as, fpm == IRFPM_FLOOR ? lj_vm_floor_sse : - fpm == IRFPM_CEIL ? lj_vm_ceil_sse : lj_vm_trunc_sse); - ra_left(as, RID_XMM0, ir->op1); - } - } else if (fpm == IRFPM_EXP2 && fpmjoin_pow(as, ir)) { - /* Rejoined to pow(). */ - } else { /* Handle x87 ops. */ - int32_t ofs = sps_scale(ir->s); /* Use spill slot or temp slots. */ - Reg dest = ir->r; - if (ra_hasreg(dest)) { - ra_free(as, dest); - ra_modified(as, dest); - emit_rmro(as, XMM_MOVRM(as), dest, RID_ESP, ofs); - } - emit_rmro(as, XO_FSTPq, XOg_FSTPq, RID_ESP, ofs); - switch (fpm) { /* st0 = lj_vm_*(st0) */ - case IRFPM_EXP: emit_call(as, lj_vm_exp_x87); break; - case IRFPM_EXP2: emit_call(as, lj_vm_exp2_x87); break; - case IRFPM_SIN: emit_x87op(as, XI_FSIN); break; - case IRFPM_COS: emit_x87op(as, XI_FCOS); break; - case IRFPM_TAN: emit_x87op(as, XI_FPOP); emit_x87op(as, XI_FPTAN); break; - case IRFPM_LOG: case IRFPM_LOG2: case IRFPM_LOG10: - /* Note: the use of fyl2xp1 would be pointless here. When computing - ** log(1.0+eps) the precision is already lost after 1.0 is added. - ** Subtracting 1.0 won't recover it. OTOH math.log1p would make sense. - */ - emit_x87op(as, XI_FYL2X); break; - case IRFPM_OTHER: - switch (ir->o) { - case IR_ATAN2: - emit_x87op(as, XI_FPATAN); asm_x87load(as, ir->op2); break; - case IR_LDEXP: - emit_x87op(as, XI_FPOP1); emit_x87op(as, XI_FSCALE); break; - default: lua_assert(0); break; - } - break; - default: lua_assert(0); break; - } - asm_x87load(as, ir->op1); - switch (fpm) { - case IRFPM_LOG: emit_x87op(as, XI_FLDLN2); break; - case IRFPM_LOG2: emit_x87op(as, XI_FLD1); break; - case IRFPM_LOG10: emit_x87op(as, XI_FLDLG2); break; - case IRFPM_OTHER: - if (ir->o == IR_LDEXP) asm_x87load(as, ir->op2); - break; - default: break; - } - } -} - -static void asm_fppowi(ASMState *as, IRIns *ir) -{ - /* The modified regs must match with the *.dasc implementation. */ - RegSet drop = RSET_RANGE(RID_XMM0, RID_XMM1+1)|RID2RSET(RID_EAX); - if (ra_hasreg(ir->r)) - rset_clear(drop, ir->r); /* Dest reg handled below. */ - ra_evictset(as, drop); - ra_destreg(as, ir, RID_XMM0); - emit_call(as, lj_vm_powi_sse); - ra_left(as, RID_XMM0, ir->op1); - ra_left(as, RID_EAX, ir->op2); -} - -#if LJ_64 && LJ_HASFFI -static void asm_arith64(ASMState *as, IRIns *ir, IRCallID id) -{ - const CCallInfo *ci = &lj_ir_callinfo[id]; - IRRef args[2]; - args[0] = ir->op1; - args[1] = ir->op2; - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); -} -#endif - -static void asm_intmod(ASMState *as, IRIns *ir) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_vm_modi]; - IRRef args[2]; - args[0] = ir->op1; - args[1] = ir->op2; - asm_setupresult(as, ir, ci); - asm_gencall(as, ci, args); -} - -static int asm_swapops(ASMState *as, IRIns *ir) -{ - IRIns *irl = IR(ir->op1); - IRIns *irr = IR(ir->op2); - lua_assert(ra_noreg(irr->r)); - if (!irm_iscomm(lj_ir_mode[ir->o])) - return 0; /* Can't swap non-commutative operations. */ - if (irref_isk(ir->op2)) - return 0; /* Don't swap constants to the left. */ - if (ra_hasreg(irl->r)) - return 1; /* Swap if left already has a register. */ - if (ra_samehint(ir->r, irr->r)) - return 1; /* Swap if dest and right have matching hints. */ - if (as->curins > as->loopref) { /* In variant part? */ - if (ir->op2 < as->loopref && !irt_isphi(irr->t)) - return 0; /* Keep invariants on the right. */ - if (ir->op1 < as->loopref && !irt_isphi(irl->t)) - return 1; /* Swap invariants to the right. */ - } - if (opisfusableload(irl->o)) - return 1; /* Swap fusable loads to the right. */ - return 0; /* Otherwise don't swap. */ -} - -static void asm_fparith(ASMState *as, IRIns *ir, x86Op xo) -{ - IRRef lref = ir->op1; - IRRef rref = ir->op2; - RegSet allow = RSET_FPR; - Reg dest; - Reg right = IR(rref)->r; - if (ra_hasreg(right)) { - rset_clear(allow, right); - ra_noweak(as, right); - } - dest = ra_dest(as, ir, allow); - if (lref == rref) { - right = dest; - } else if (ra_noreg(right)) { - if (asm_swapops(as, ir)) { - IRRef tmp = lref; lref = rref; rref = tmp; - } - right = asm_fuseload(as, rref, rset_clear(allow, dest)); - } - emit_mrm(as, xo, dest, right); - ra_left(as, dest, lref); -} - -static void asm_intarith(ASMState *as, IRIns *ir, x86Arith xa) -{ - IRRef lref = ir->op1; - IRRef rref = ir->op2; - RegSet allow = RSET_GPR; - Reg dest, right; - int32_t k = 0; - if (as->flagmcp == as->mcp) { /* Drop test r,r instruction. */ - MCode *p = as->mcp + ((LJ_64 && *as->mcp < XI_TESTb) ? 3 : 2); - if ((p[1] & 15) < 14) { - if ((p[1] & 15) >= 12) p[1] -= 4; /* L <->S, NL <-> NS */ - as->flagmcp = NULL; - as->mcp = p; - } /* else: cannot transform LE/NLE to cc without use of OF. */ - } - right = IR(rref)->r; - if (ra_hasreg(right)) { - rset_clear(allow, right); - ra_noweak(as, right); - } - dest = ra_dest(as, ir, allow); - if (lref == rref) { - right = dest; - } else if (ra_noreg(right) && !asm_isk32(as, rref, &k)) { - if (asm_swapops(as, ir)) { - IRRef tmp = lref; lref = rref; rref = tmp; - } - right = asm_fuseloadm(as, rref, rset_clear(allow, dest), irt_is64(ir->t)); - } - if (irt_isguard(ir->t)) /* For IR_ADDOV etc. */ - asm_guardcc(as, CC_O); - if (xa != XOg_X_IMUL) { - if (ra_hasreg(right)) - emit_mrm(as, XO_ARITH(xa), REX_64IR(ir, dest), right); - else - emit_gri(as, XG_ARITHi(xa), REX_64IR(ir, dest), k); - } else if (ra_hasreg(right)) { /* IMUL r, mrm. */ - emit_mrm(as, XO_IMUL, REX_64IR(ir, dest), right); - } else { /* IMUL r, r, k. */ - /* NYI: use lea/shl/add/sub (FOLD only does 2^k) depending on CPU. */ - Reg left = asm_fuseloadm(as, lref, RSET_GPR, irt_is64(ir->t)); - x86Op xo; - if (checki8(k)) { emit_i8(as, k); xo = XO_IMULi8; - } else { emit_i32(as, k); xo = XO_IMULi; } - emit_mrm(as, xo, REX_64IR(ir, dest), left); - return; - } - ra_left(as, dest, lref); -} - -/* LEA is really a 4-operand ADD with an independent destination register, -** up to two source registers and an immediate. One register can be scaled -** by 1, 2, 4 or 8. This can be used to avoid moves or to fuse several -** instructions. -** -** Currently only a few common cases are supported: -** - 3-operand ADD: y = a+b; y = a+k with a and b already allocated -** - Left ADD fusion: y = (a+b)+k; y = (a+k)+b -** - Right ADD fusion: y = a+(b+k) -** The ommited variants have already been reduced by FOLD. -** -** There are more fusion opportunities, like gathering shifts or joining -** common references. But these are probably not worth the trouble, since -** array indexing is not decomposed and already makes use of all fields -** of the ModRM operand. -*/ -static int asm_lea(ASMState *as, IRIns *ir) -{ - IRIns *irl = IR(ir->op1); - IRIns *irr = IR(ir->op2); - RegSet allow = RSET_GPR; - Reg dest; - as->mrm.base = as->mrm.idx = RID_NONE; - as->mrm.scale = XM_SCALE1; - as->mrm.ofs = 0; - if (ra_hasreg(irl->r)) { - rset_clear(allow, irl->r); - ra_noweak(as, irl->r); - as->mrm.base = irl->r; - if (irref_isk(ir->op2) || ra_hasreg(irr->r)) { - /* The PHI renaming logic does a better job in some cases. */ - if (ra_hasreg(ir->r) && - ((irt_isphi(irl->t) && as->phireg[ir->r] == ir->op1) || - (irt_isphi(irr->t) && as->phireg[ir->r] == ir->op2))) - return 0; - if (irref_isk(ir->op2)) { - as->mrm.ofs = irr->i; - } else { - rset_clear(allow, irr->r); - ra_noweak(as, irr->r); - as->mrm.idx = irr->r; - } - } else if (irr->o == IR_ADD && mayfuse(as, ir->op2) && - irref_isk(irr->op2)) { - Reg idx = ra_alloc1(as, irr->op1, allow); - rset_clear(allow, idx); - as->mrm.idx = (uint8_t)idx; - as->mrm.ofs = IR(irr->op2)->i; - } else { - return 0; - } - } else if (ir->op1 != ir->op2 && irl->o == IR_ADD && mayfuse(as, ir->op1) && - (irref_isk(ir->op2) || irref_isk(irl->op2))) { - Reg idx, base = ra_alloc1(as, irl->op1, allow); - rset_clear(allow, base); - as->mrm.base = (uint8_t)base; - if (irref_isk(ir->op2)) { - as->mrm.ofs = irr->i; - idx = ra_alloc1(as, irl->op2, allow); - } else { - as->mrm.ofs = IR(irl->op2)->i; - idx = ra_alloc1(as, ir->op2, allow); - } - rset_clear(allow, idx); - as->mrm.idx = (uint8_t)idx; - } else { - return 0; - } - dest = ra_dest(as, ir, allow); - emit_mrm(as, XO_LEA, dest, RID_MRM); - return 1; /* Success. */ -} - -static void asm_add(ASMState *as, IRIns *ir) -{ - if (irt_isnum(ir->t)) - asm_fparith(as, ir, XO_ADDSD); - else if ((as->flags & JIT_F_LEA_AGU) || as->flagmcp == as->mcp || - irt_is64(ir->t) || !asm_lea(as, ir)) - asm_intarith(as, ir, XOg_ADD); -} - -static void asm_neg_not(ASMState *as, IRIns *ir, x86Group3 xg) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - emit_rr(as, XO_GROUP3, REX_64IR(ir, xg), dest); - ra_left(as, dest, ir->op1); -} - -static void asm_min_max(ASMState *as, IRIns *ir, int cc) -{ - Reg right, dest = ra_dest(as, ir, RSET_GPR); - IRRef lref = ir->op1, rref = ir->op2; - if (irref_isk(rref)) { lref = rref; rref = ir->op1; } - right = ra_alloc1(as, rref, rset_exclude(RSET_GPR, dest)); - emit_rr(as, XO_CMOV + (cc<<24), REX_64IR(ir, dest), right); - emit_rr(as, XO_CMP, REX_64IR(ir, dest), right); - ra_left(as, dest, lref); -} - -static void asm_bitswap(ASMState *as, IRIns *ir) -{ - Reg dest = ra_dest(as, ir, RSET_GPR); - as->mcp = emit_op(XO_BSWAP + ((dest&7) << 24), - REX_64IR(ir, 0), dest, 0, as->mcp, 1); - ra_left(as, dest, ir->op1); -} - -static void asm_bitshift(ASMState *as, IRIns *ir, x86Shift xs) -{ - IRRef rref = ir->op2; - IRIns *irr = IR(rref); - Reg dest; - if (irref_isk(rref)) { /* Constant shifts. */ - int shift; - dest = ra_dest(as, ir, RSET_GPR); - shift = irr->i & (irt_is64(ir->t) ? 63 : 31); - switch (shift) { - case 0: break; - case 1: emit_rr(as, XO_SHIFT1, REX_64IR(ir, xs), dest); break; - default: emit_shifti(as, REX_64IR(ir, xs), dest, shift); break; - } - } else { /* Variable shifts implicitly use register cl (i.e. ecx). */ - Reg right; - dest = ra_dest(as, ir, rset_exclude(RSET_GPR, RID_ECX)); - if (dest == RID_ECX) { - dest = ra_scratch(as, rset_exclude(RSET_GPR, RID_ECX)); - emit_rr(as, XO_MOV, RID_ECX, dest); - } - right = irr->r; - if (ra_noreg(right)) - right = ra_allocref(as, rref, RID2RSET(RID_ECX)); - else if (right != RID_ECX) - ra_scratch(as, RID2RSET(RID_ECX)); - emit_rr(as, XO_SHIFTcl, REX_64IR(ir, xs), dest); - ra_noweak(as, right); - if (right != RID_ECX) - emit_rr(as, XO_MOV, RID_ECX, right); - } - ra_left(as, dest, ir->op1); - /* - ** Note: avoid using the flags resulting from a shift or rotate! - ** All of them cause a partial flag stall, except for r,1 shifts - ** (but not rotates). And a shift count of 0 leaves the flags unmodified. - */ -} - -/* -- Comparisons --------------------------------------------------------- */ - -/* Virtual flags for unordered FP comparisons. */ -#define VCC_U 0x1000 /* Unordered. */ -#define VCC_P 0x2000 /* Needs extra CC_P branch. */ -#define VCC_S 0x4000 /* Swap avoids CC_P branch. */ -#define VCC_PS (VCC_P|VCC_S) - -/* Map of comparisons to flags. ORDER IR. */ -#define COMPFLAGS(ci, cin, cu, cf) ((ci)+((cu)<<4)+((cin)<<8)+(cf)) -static const uint16_t asm_compmap[IR_ABC+1] = { - /* signed non-eq unsigned flags */ - /* LT */ COMPFLAGS(CC_GE, CC_G, CC_AE, VCC_PS), - /* GE */ COMPFLAGS(CC_L, CC_L, CC_B, 0), - /* LE */ COMPFLAGS(CC_G, CC_G, CC_A, VCC_PS), - /* GT */ COMPFLAGS(CC_LE, CC_L, CC_BE, 0), - /* ULT */ COMPFLAGS(CC_AE, CC_A, CC_AE, VCC_U), - /* UGE */ COMPFLAGS(CC_B, CC_B, CC_B, VCC_U|VCC_PS), - /* ULE */ COMPFLAGS(CC_A, CC_A, CC_A, VCC_U), - /* UGT */ COMPFLAGS(CC_BE, CC_B, CC_BE, VCC_U|VCC_PS), - /* EQ */ COMPFLAGS(CC_NE, CC_NE, CC_NE, VCC_P), - /* NE */ COMPFLAGS(CC_E, CC_E, CC_E, VCC_U|VCC_P), - /* ABC */ COMPFLAGS(CC_BE, CC_B, CC_BE, VCC_U|VCC_PS) /* Same as UGT. */ -}; - -/* FP and integer comparisons. */ -static void asm_comp(ASMState *as, IRIns *ir, uint32_t cc) -{ - if (irt_isnum(ir->t)) { - IRRef lref = ir->op1; - IRRef rref = ir->op2; - Reg left, right; - MCLabel l_around; - /* - ** An extra CC_P branch is required to preserve ordered/unordered - ** semantics for FP comparisons. This can be avoided by swapping - ** the operands and inverting the condition (except for EQ and UNE). - ** So always try to swap if possible. - ** - ** Another option would be to swap operands to achieve better memory - ** operand fusion. But it's unlikely that this outweighs the cost - ** of the extra branches. - */ - if (cc & VCC_S) { /* Swap? */ - IRRef tmp = lref; lref = rref; rref = tmp; - cc ^= (VCC_PS|(5<<4)); /* A <-> B, AE <-> BE, PS <-> none */ - } - left = ra_alloc1(as, lref, RSET_FPR); - right = asm_fuseload(as, rref, rset_exclude(RSET_FPR, left)); - l_around = emit_label(as); - asm_guardcc(as, cc >> 4); - if (cc & VCC_P) { /* Extra CC_P branch required? */ - if (!(cc & VCC_U)) { - asm_guardcc(as, CC_P); /* Branch to exit for ordered comparisons. */ - } else if (l_around != as->invmcp) { - emit_sjcc(as, CC_P, l_around); /* Branch around for unordered. */ - } else { - /* Patched to mcloop by asm_loop_fixup. */ - as->loopinv = 2; - if (as->realign) - emit_sjcc(as, CC_P, as->mcp); - else - emit_jcc(as, CC_P, as->mcp); - } - } - emit_mrm(as, XO_UCOMISD, left, right); - } else { - IRRef lref = ir->op1, rref = ir->op2; - IROp leftop = (IROp)(IR(lref)->o); - Reg r64 = REX_64IR(ir, 0); - int32_t imm = 0; - lua_assert(irt_is64(ir->t) || irt_isint(ir->t) || - irt_isu32(ir->t) || irt_isaddr(ir->t) || irt_isu8(ir->t)); - /* Swap constants (only for ABC) and fusable loads to the right. */ - if (irref_isk(lref) || (!irref_isk(rref) && opisfusableload(leftop))) { - if ((cc & 0xc) == 0xc) cc ^= 0x53; /* L <-> G, LE <-> GE */ - else if ((cc & 0xa) == 0x2) cc ^= 0x55; /* A <-> B, AE <-> BE */ - lref = ir->op2; rref = ir->op1; - } - if (asm_isk32(as, rref, &imm)) { - IRIns *irl = IR(lref); - /* Check wether we can use test ins. Not for unsigned, since CF=0. */ - int usetest = (imm == 0 && (cc & 0xa) != 0x2); - if (usetest && irl->o == IR_BAND && irl+1 == ir && !ra_used(irl)) { - /* Combine comp(BAND(ref, r/imm), 0) into test mrm, r/imm. */ - Reg right, left = RID_NONE; - RegSet allow = RSET_GPR; - if (!asm_isk32(as, irl->op2, &imm)) { - left = ra_alloc1(as, irl->op2, allow); - rset_clear(allow, left); - } else { /* Try to Fuse IRT_I8/IRT_U8 loads, too. See below. */ - IRIns *irll = IR(irl->op1); - if (opisfusableload((IROp)irll->o) && - (irt_isi8(irll->t) || irt_isu8(irll->t))) { - IRType1 origt = irll->t; /* Temporarily flip types. */ - irll->t.irt = (irll->t.irt & ~IRT_TYPE) | IRT_INT; - as->curins--; /* Skip to BAND to avoid failing in noconflict(). */ - right = asm_fuseload(as, irl->op1, RSET_GPR); - as->curins++; - irll->t = origt; - if (right != RID_MRM) goto test_nofuse; - /* Fusion succeeded, emit test byte mrm, imm8. */ - asm_guardcc(as, cc); - emit_i8(as, (imm & 0xff)); - emit_mrm(as, XO_GROUP3b, XOg_TEST, RID_MRM); - return; - } - } - as->curins--; /* Skip to BAND to avoid failing in noconflict(). */ - right = asm_fuseloadm(as, irl->op1, allow, r64); - as->curins++; /* Undo the above. */ - test_nofuse: - asm_guardcc(as, cc); - if (ra_noreg(left)) { - emit_i32(as, imm); - emit_mrm(as, XO_GROUP3, r64 + XOg_TEST, right); - } else { - emit_mrm(as, XO_TEST, r64 + left, right); - } - } else { - Reg left; - if (opisfusableload((IROp)irl->o) && - ((irt_isu8(irl->t) && checku8(imm)) || - ((irt_isi8(irl->t) || irt_isi16(irl->t)) && checki8(imm)) || - (irt_isu16(irl->t) && checku16(imm) && checki8((int16_t)imm)))) { - /* Only the IRT_INT case is fused by asm_fuseload. - ** The IRT_I8/IRT_U8 loads and some IRT_I16/IRT_U16 loads - ** are handled here. - ** Note that cmp word [mem], imm16 should not be generated, - ** since it has a length-changing prefix. Compares of a word - ** against a sign-extended imm8 are ok, however. - */ - IRType1 origt = irl->t; /* Temporarily flip types. */ - irl->t.irt = (irl->t.irt & ~IRT_TYPE) | IRT_INT; - left = asm_fuseload(as, lref, RSET_GPR); - irl->t = origt; - if (left == RID_MRM) { /* Fusion succeeded? */ - if (irt_isu8(irl->t) || irt_isu16(irl->t)) - cc >>= 4; /* Need unsigned compare. */ - asm_guardcc(as, cc); - emit_i8(as, imm); - emit_mrm(as, (irt_isi8(origt) || irt_isu8(origt)) ? - XO_ARITHib : XO_ARITHiw8, r64 + XOg_CMP, RID_MRM); - return; - } /* Otherwise handle register case as usual. */ - } else { - left = asm_fuseloadm(as, lref, - irt_isu8(ir->t) ? RSET_GPR8 : RSET_GPR, r64); - } - asm_guardcc(as, cc); - if (usetest && left != RID_MRM) { - /* Use test r,r instead of cmp r,0. */ - x86Op xo = XO_TEST; - if (irt_isu8(ir->t)) { - lua_assert(ir->o == IR_EQ || ir->o == IR_NE); - xo = XO_TESTb; - if (!rset_test(RSET_RANGE(RID_EAX, RID_EBX+1), left)) { - if (LJ_64) { - left |= FORCE_REX; - } else { - emit_i32(as, 0xff); - emit_mrm(as, XO_GROUP3, XOg_TEST, left); - return; - } - } - } - emit_rr(as, xo, r64 + left, left); - if (irl+1 == ir) /* Referencing previous ins? */ - as->flagmcp = as->mcp; /* Set flag to drop test r,r if possible. */ - } else { - emit_gmrmi(as, XG_ARITHi(XOg_CMP), r64 + left, imm); - } - } - } else { - Reg left = ra_alloc1(as, lref, RSET_GPR); - Reg right = asm_fuseloadm(as, rref, rset_exclude(RSET_GPR, left), r64); - asm_guardcc(as, cc); - emit_mrm(as, XO_CMP, r64 + left, right); - } - } -} - -#if LJ_32 && LJ_HASFFI -/* 64 bit integer comparisons in 32 bit mode. */ -static void asm_comp_int64(ASMState *as, IRIns *ir) -{ - uint32_t cc = asm_compmap[(ir-1)->o]; - RegSet allow = RSET_GPR; - Reg lefthi = RID_NONE, leftlo = RID_NONE; - Reg righthi = RID_NONE, rightlo = RID_NONE; - MCLabel l_around; - x86ModRM mrm; - - as->curins--; /* Skip loword ins. Avoids failing in noconflict(), too. */ - - /* Allocate/fuse hiword operands. */ - if (irref_isk(ir->op2)) { - lefthi = asm_fuseload(as, ir->op1, allow); - } else { - lefthi = ra_alloc1(as, ir->op1, allow); - rset_clear(allow, lefthi); - righthi = asm_fuseload(as, ir->op2, allow); - if (righthi == RID_MRM) { - if (as->mrm.base != RID_NONE) rset_clear(allow, as->mrm.base); - if (as->mrm.idx != RID_NONE) rset_clear(allow, as->mrm.idx); - } else { - rset_clear(allow, righthi); - } - } - mrm = as->mrm; /* Save state for hiword instruction. */ - - /* Allocate/fuse loword operands. */ - if (irref_isk((ir-1)->op2)) { - leftlo = asm_fuseload(as, (ir-1)->op1, allow); - } else { - leftlo = ra_alloc1(as, (ir-1)->op1, allow); - rset_clear(allow, leftlo); - rightlo = asm_fuseload(as, (ir-1)->op2, allow); - } - - /* All register allocations must be performed _before_ this point. */ - l_around = emit_label(as); - as->invmcp = as->flagmcp = NULL; /* Cannot use these optimizations. */ - - /* Loword comparison and branch. */ - asm_guardcc(as, cc >> 4); /* Always use unsigned compare for loword. */ - if (ra_noreg(rightlo)) { - int32_t imm = IR((ir-1)->op2)->i; - if (imm == 0 && ((cc >> 4) & 0xa) != 0x2 && leftlo != RID_MRM) - emit_rr(as, XO_TEST, leftlo, leftlo); - else - emit_gmrmi(as, XG_ARITHi(XOg_CMP), leftlo, imm); - } else { - emit_mrm(as, XO_CMP, leftlo, rightlo); - } - - /* Hiword comparison and branches. */ - if ((cc & 15) != CC_NE) - emit_sjcc(as, CC_NE, l_around); /* Hiword unequal: skip loword compare. */ - if ((cc & 15) != CC_E) - asm_guardcc(as, cc >> 8); /* Hiword compare without equality check. */ - as->mrm = mrm; /* Restore state. */ - if (ra_noreg(righthi)) { - int32_t imm = IR(ir->op2)->i; - if (imm == 0 && (cc & 0xa) != 0x2 && lefthi != RID_MRM) - emit_rr(as, XO_TEST, lefthi, lefthi); - else - emit_gmrmi(as, XG_ARITHi(XOg_CMP), lefthi, imm); - } else { - emit_mrm(as, XO_CMP, lefthi, righthi); - } -} -#endif - -/* -- Support for 64 bit ops in 32 bit mode ------------------------------- */ - -/* Hiword op of a split 64 bit op. Previous op must be the loword op. */ -static void asm_hiop(ASMState *as, IRIns *ir) -{ -#if LJ_32 && LJ_HASFFI - /* HIOP is marked as a store because it needs its own DCE logic. */ - int uselo = ra_used(ir-1), usehi = ra_used(ir); /* Loword/hiword used? */ - if (LJ_UNLIKELY(!(as->flags & JIT_F_OPT_DCE))) uselo = usehi = 1; - if ((ir-1)->o == IR_CONV) { /* Conversions to/from 64 bit. */ - if (usehi || uselo) { - if (irt_isfp(ir->t)) - asm_conv_fp_int64(as, ir); - else - asm_conv_int64_fp(as, ir); - } - as->curins--; /* Always skip the CONV. */ - return; - } else if ((ir-1)->o <= IR_NE) { /* 64 bit integer comparisons. ORDER IR. */ - asm_comp_int64(as, ir); - return; - } else if ((ir-1)->o == IR_XSTORE) { - if ((ir-1)->r != RID_SINK) - asm_fxstore(as, ir); - return; - } - if (!usehi) return; /* Skip unused hiword op for all remaining ops. */ - switch ((ir-1)->o) { - case IR_ADD: - as->flagmcp = NULL; - as->curins--; - asm_intarith(as, ir, XOg_ADC); - asm_intarith(as, ir-1, XOg_ADD); - break; - case IR_SUB: - as->flagmcp = NULL; - as->curins--; - asm_intarith(as, ir, XOg_SBB); - asm_intarith(as, ir-1, XOg_SUB); - break; - case IR_NEG: { - Reg dest = ra_dest(as, ir, RSET_GPR); - emit_rr(as, XO_GROUP3, XOg_NEG, dest); - emit_i8(as, 0); - emit_rr(as, XO_ARITHi8, XOg_ADC, dest); - ra_left(as, dest, ir->op1); - as->curins--; - asm_neg_not(as, ir-1, XOg_NEG); - break; - } - case IR_CALLN: - case IR_CALLXS: - if (!uselo) - ra_allocref(as, ir->op1, RID2RSET(RID_RETLO)); /* Mark lo op as used. */ - break; - case IR_CNEWI: - /* Nothing to do here. Handled by CNEWI itself. */ - break; - default: lua_assert(0); break; - } -#else - UNUSED(as); UNUSED(ir); lua_assert(0); /* Unused on x64 or without FFI. */ -#endif -} - -/* -- Stack handling ------------------------------------------------------ */ - -/* Check Lua stack size for overflow. Use exit handler as fallback. */ -static void asm_stack_check(ASMState *as, BCReg topslot, - IRIns *irp, RegSet allow, ExitNo exitno) -{ - /* Try to get an unused temp. register, otherwise spill/restore eax. */ - Reg pbase = irp ? irp->r : RID_BASE; - Reg r = allow ? rset_pickbot(allow) : RID_EAX; - emit_jcc(as, CC_B, exitstub_addr(as->J, exitno)); - if (allow == RSET_EMPTY) /* Restore temp. register. */ - emit_rmro(as, XO_MOV, r|REX_64, RID_ESP, 0); - else - ra_modified(as, r); - emit_gri(as, XG_ARITHi(XOg_CMP), r, (int32_t)(8*topslot)); - if (ra_hasreg(pbase) && pbase != r) - emit_rr(as, XO_ARITH(XOg_SUB), r, pbase); - else - emit_rmro(as, XO_ARITH(XOg_SUB), r, RID_NONE, - ptr2addr(&J2G(as->J)->jit_base)); - emit_rmro(as, XO_MOV, r, r, offsetof(lua_State, maxstack)); - emit_getgl(as, r, jit_L); - if (allow == RSET_EMPTY) /* Spill temp. register. */ - emit_rmro(as, XO_MOVto, r|REX_64, RID_ESP, 0); -} - -/* Restore Lua stack from on-trace state. */ -static void asm_stack_restore(ASMState *as, SnapShot *snap) -{ - SnapEntry *map = &as->T->snapmap[snap->mapofs]; - SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1]; - MSize n, nent = snap->nent; - /* Store the value of all modified slots to the Lua stack. */ - for (n = 0; n < nent; n++) { - SnapEntry sn = map[n]; - BCReg s = snap_slot(sn); - int32_t ofs = 8*((int32_t)s-1); - IRRef ref = snap_ref(sn); - IRIns *ir = IR(ref); - if ((sn & SNAP_NORESTORE)) - continue; - if (irt_isnum(ir->t)) { - Reg src = ra_alloc1(as, ref, RSET_FPR); - emit_rmro(as, XO_MOVSDto, src, RID_BASE, ofs); - } else { - lua_assert(irt_ispri(ir->t) || irt_isaddr(ir->t) || - (LJ_DUALNUM && irt_isinteger(ir->t))); - if (!irref_isk(ref)) { - Reg src = ra_alloc1(as, ref, rset_exclude(RSET_GPR, RID_BASE)); - emit_movtomro(as, REX_64IR(ir, src), RID_BASE, ofs); - } else if (!irt_ispri(ir->t)) { - emit_movmroi(as, RID_BASE, ofs, ir->i); - } - if ((sn & (SNAP_CONT|SNAP_FRAME))) { - if (s != 0) /* Do not overwrite link to previous frame. */ - emit_movmroi(as, RID_BASE, ofs+4, (int32_t)(*flinks--)); - } else { - if (!(LJ_64 && irt_islightud(ir->t))) - emit_movmroi(as, RID_BASE, ofs+4, irt_toitype(ir->t)); - } - } - checkmclim(as); - } - lua_assert(map + nent == flinks); -} - -/* -- GC handling --------------------------------------------------------- */ - -/* Check GC threshold and do one or more GC steps. */ -static void asm_gc_check(ASMState *as) -{ - const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_step_jit]; - IRRef args[2]; - MCLabel l_end; - Reg tmp; - ra_evictset(as, RSET_SCRATCH); - l_end = emit_label(as); - /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */ - asm_guardcc(as, CC_NE); /* Assumes asm_snap_prep() already done. */ - emit_rr(as, XO_TEST, RID_RET, RID_RET); - args[0] = ASMREF_TMP1; /* global_State *g */ - args[1] = ASMREF_TMP2; /* MSize steps */ - asm_gencall(as, ci, args); - tmp = ra_releasetmp(as, ASMREF_TMP1); - emit_loada(as, tmp, J2G(as->J)); - emit_loadi(as, ra_releasetmp(as, ASMREF_TMP2), as->gcsteps); - /* Jump around GC step if GC total < GC threshold. */ - emit_sjcc(as, CC_B, l_end); - emit_opgl(as, XO_ARITH(XOg_CMP), tmp, gc.threshold); - emit_getgl(as, tmp, gc.total); - as->gcsteps = 0; - checkmclim(as); -} - -/* -- Loop handling ------------------------------------------------------- */ - -/* Fixup the loop branch. */ -static void asm_loop_fixup(ASMState *as) -{ - MCode *p = as->mctop; - MCode *target = as->mcp; - if (as->realign) { /* Realigned loops use short jumps. */ - as->realign = NULL; /* Stop another retry. */ - lua_assert(((intptr_t)target & 15) == 0); - if (as->loopinv) { /* Inverted loop branch? */ - p -= 5; - p[0] = XI_JMP; - lua_assert(target - p >= -128); - p[-1] = (MCode)(target - p); /* Patch sjcc. */ - if (as->loopinv == 2) - p[-3] = (MCode)(target - p + 2); /* Patch opt. short jp. */ - } else { - lua_assert(target - p >= -128); - p[-1] = (MCode)(int8_t)(target - p); /* Patch short jmp. */ - p[-2] = XI_JMPs; - } - } else { - MCode *newloop; - p[-5] = XI_JMP; - if (as->loopinv) { /* Inverted loop branch? */ - /* asm_guardcc already inverted the jcc and patched the jmp. */ - p -= 5; - newloop = target+4; - *(int32_t *)(p-4) = (int32_t)(target - p); /* Patch jcc. */ - if (as->loopinv == 2) { - *(int32_t *)(p-10) = (int32_t)(target - p + 6); /* Patch opt. jp. */ - newloop = target+8; - } - } else { /* Otherwise just patch jmp. */ - *(int32_t *)(p-4) = (int32_t)(target - p); - newloop = target+3; - } - /* Realign small loops and shorten the loop branch. */ - if (newloop >= p - 128) { - as->realign = newloop; /* Force a retry and remember alignment. */ - as->curins = as->stopins; /* Abort asm_trace now. */ - as->T->nins = as->orignins; /* Remove any added renames. */ - } - } -} - -/* -- Head of trace ------------------------------------------------------- */ - -/* Coalesce BASE register for a root trace. */ -static void asm_head_root_base(ASMState *as) -{ - IRIns *ir = IR(REF_BASE); - Reg r = ir->r; - if (ra_hasreg(r)) { - ra_free(as, r); - if (rset_test(as->modset, r) || irt_ismarked(ir->t)) - ir->r = RID_INIT; /* No inheritance for modified BASE register. */ - if (r != RID_BASE) - emit_rr(as, XO_MOV, r, RID_BASE); - } -} - -/* Coalesce or reload BASE register for a side trace. */ -static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow) -{ - IRIns *ir = IR(REF_BASE); - Reg r = ir->r; - if (ra_hasreg(r)) { - ra_free(as, r); - if (rset_test(as->modset, r) || irt_ismarked(ir->t)) - ir->r = RID_INIT; /* No inheritance for modified BASE register. */ - if (irp->r == r) { - rset_clear(allow, r); /* Mark same BASE register as coalesced. */ - } else if (ra_hasreg(irp->r) && rset_test(as->freeset, irp->r)) { - rset_clear(allow, irp->r); - emit_rr(as, XO_MOV, r, irp->r); /* Move from coalesced parent reg. */ - } else { - emit_getgl(as, r, jit_base); /* Otherwise reload BASE. */ - } - } - return allow; -} - -/* -- Tail of trace ------------------------------------------------------- */ - -/* Fixup the tail code. */ -static void asm_tail_fixup(ASMState *as, TraceNo lnk) -{ - /* Note: don't use as->mcp swap + emit_*: emit_op overwrites more bytes. */ - MCode *p = as->mctop; - MCode *target, *q; - int32_t spadj = as->T->spadjust; - if (spadj == 0) { - p -= ((as->flags & JIT_F_LEA_AGU) ? 7 : 6) + (LJ_64 ? 1 : 0); - } else { - MCode *p1; - /* Patch stack adjustment. */ - if (checki8(spadj)) { - p -= 3; - p1 = p-6; - *p1 = (MCode)spadj; - } else { - p1 = p-9; - *(int32_t *)p1 = spadj; - } - if ((as->flags & JIT_F_LEA_AGU)) { -#if LJ_64 - p1[-4] = 0x48; -#endif - p1[-3] = (MCode)XI_LEA; - p1[-2] = MODRM(checki8(spadj) ? XM_OFS8 : XM_OFS32, RID_ESP, RID_ESP); - p1[-1] = MODRM(XM_SCALE1, RID_ESP, RID_ESP); - } else { -#if LJ_64 - p1[-3] = 0x48; -#endif - p1[-2] = (MCode)(checki8(spadj) ? XI_ARITHi8 : XI_ARITHi); - p1[-1] = MODRM(XM_REG, XOg_ADD, RID_ESP); - } - } - /* Patch exit branch. */ - target = lnk ? traceref(as->J, lnk)->mcode : (MCode *)lj_vm_exit_interp; - *(int32_t *)(p-4) = jmprel(p, target); - p[-5] = XI_JMP; - /* Drop unused mcode tail. Fill with NOPs to make the prefetcher happy. */ - for (q = as->mctop-1; q >= p; q--) - *q = XI_NOP; - as->mctop = p; -} - -/* Prepare tail of code. */ -static void asm_tail_prep(ASMState *as) -{ - MCode *p = as->mctop; - /* Realign and leave room for backwards loop branch or exit branch. */ - if (as->realign) { - int i = ((int)(intptr_t)as->realign) & 15; - /* Fill unused mcode tail with NOPs to make the prefetcher happy. */ - while (i-- > 0) - *--p = XI_NOP; - as->mctop = p; - p -= (as->loopinv ? 5 : 2); /* Space for short/near jmp. */ - } else { - p -= 5; /* Space for exit branch (near jmp). */ - } - if (as->loopref) { - as->invmcp = as->mcp = p; - } else { - /* Leave room for ESP adjustment: add esp, imm or lea esp, [esp+imm] */ - as->mcp = p - (((as->flags & JIT_F_LEA_AGU) ? 7 : 6) + (LJ_64 ? 1 : 0)); - as->invmcp = NULL; - } -} - -/* -- Instruction dispatch ------------------------------------------------ */ - -/* Assemble a single instruction. */ -static void asm_ir(ASMState *as, IRIns *ir) -{ - switch ((IROp)ir->o) { - /* Miscellaneous ops. */ - case IR_LOOP: asm_loop(as); break; - case IR_NOP: case IR_XBAR: lua_assert(!ra_used(ir)); break; - case IR_USE: - ra_alloc1(as, ir->op1, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); break; - case IR_PHI: asm_phi(as, ir); break; - case IR_HIOP: asm_hiop(as, ir); break; - case IR_GCSTEP: asm_gcstep(as, ir); break; - - /* Guarded assertions. */ - case IR_LT: case IR_GE: case IR_LE: case IR_GT: - case IR_ULT: case IR_UGE: case IR_ULE: case IR_UGT: - case IR_EQ: case IR_NE: case IR_ABC: - asm_comp(as, ir, asm_compmap[ir->o]); - break; - - case IR_RETF: asm_retf(as, ir); break; - - /* Bit ops. */ - case IR_BNOT: asm_neg_not(as, ir, XOg_NOT); break; - case IR_BSWAP: asm_bitswap(as, ir); break; - - case IR_BAND: asm_intarith(as, ir, XOg_AND); break; - case IR_BOR: asm_intarith(as, ir, XOg_OR); break; - case IR_BXOR: asm_intarith(as, ir, XOg_XOR); break; - - case IR_BSHL: asm_bitshift(as, ir, XOg_SHL); break; - case IR_BSHR: asm_bitshift(as, ir, XOg_SHR); break; - case IR_BSAR: asm_bitshift(as, ir, XOg_SAR); break; - case IR_BROL: asm_bitshift(as, ir, XOg_ROL); break; - case IR_BROR: asm_bitshift(as, ir, XOg_ROR); break; - - /* Arithmetic ops. */ - case IR_ADD: asm_add(as, ir); break; - case IR_SUB: - if (irt_isnum(ir->t)) - asm_fparith(as, ir, XO_SUBSD); - else /* Note: no need for LEA trick here. i-k is encoded as i+(-k). */ - asm_intarith(as, ir, XOg_SUB); - break; - case IR_MUL: - if (irt_isnum(ir->t)) - asm_fparith(as, ir, XO_MULSD); - else - asm_intarith(as, ir, XOg_X_IMUL); - break; - case IR_DIV: -#if LJ_64 && LJ_HASFFI - if (!irt_isnum(ir->t)) - asm_arith64(as, ir, irt_isi64(ir->t) ? IRCALL_lj_carith_divi64 : - IRCALL_lj_carith_divu64); - else -#endif - asm_fparith(as, ir, XO_DIVSD); - break; - case IR_MOD: -#if LJ_64 && LJ_HASFFI - if (!irt_isint(ir->t)) - asm_arith64(as, ir, irt_isi64(ir->t) ? IRCALL_lj_carith_modi64 : - IRCALL_lj_carith_modu64); - else -#endif - asm_intmod(as, ir); - break; - - case IR_NEG: - if (irt_isnum(ir->t)) - asm_fparith(as, ir, XO_XORPS); - else - asm_neg_not(as, ir, XOg_NEG); - break; - case IR_ABS: asm_fparith(as, ir, XO_ANDPS); break; - - case IR_MIN: - if (irt_isnum(ir->t)) - asm_fparith(as, ir, XO_MINSD); - else - asm_min_max(as, ir, CC_G); - break; - case IR_MAX: - if (irt_isnum(ir->t)) - asm_fparith(as, ir, XO_MAXSD); - else - asm_min_max(as, ir, CC_L); - break; - - case IR_FPMATH: case IR_ATAN2: case IR_LDEXP: - asm_fpmath(as, ir); - break; - case IR_POW: -#if LJ_64 && LJ_HASFFI - if (!irt_isnum(ir->t)) - asm_arith64(as, ir, irt_isi64(ir->t) ? IRCALL_lj_carith_powi64 : - IRCALL_lj_carith_powu64); - else -#endif - asm_fppowi(as, ir); - break; - - /* Overflow-checking arithmetic ops. Note: don't use LEA here! */ - case IR_ADDOV: asm_intarith(as, ir, XOg_ADD); break; - case IR_SUBOV: asm_intarith(as, ir, XOg_SUB); break; - case IR_MULOV: asm_intarith(as, ir, XOg_X_IMUL); break; - - /* Memory references. */ - case IR_AREF: asm_aref(as, ir); break; - case IR_HREF: asm_href(as, ir); break; - case IR_HREFK: asm_hrefk(as, ir); break; - case IR_NEWREF: asm_newref(as, ir); break; - case IR_UREFO: case IR_UREFC: asm_uref(as, ir); break; - case IR_FREF: asm_fref(as, ir); break; - case IR_STRREF: asm_strref(as, ir); break; - - /* Loads and stores. */ - case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: - asm_ahuvload(as, ir); - break; - case IR_FLOAD: case IR_XLOAD: asm_fxload(as, ir); break; - case IR_SLOAD: asm_sload(as, ir); break; - - case IR_ASTORE: case IR_HSTORE: case IR_USTORE: asm_ahustore(as, ir); break; - case IR_FSTORE: case IR_XSTORE: asm_fxstore(as, ir); break; - - /* Allocations. */ - case IR_SNEW: case IR_XSNEW: asm_snew(as, ir); break; - case IR_TNEW: asm_tnew(as, ir); break; - case IR_TDUP: asm_tdup(as, ir); break; - case IR_CNEW: case IR_CNEWI: asm_cnew(as, ir); break; - - /* Write barriers. */ - case IR_TBAR: asm_tbar(as, ir); break; - case IR_OBAR: asm_obar(as, ir); break; - - /* Type conversions. */ - case IR_TOBIT: asm_tobit(as, ir); break; - case IR_CONV: asm_conv(as, ir); break; - case IR_TOSTR: asm_tostr(as, ir); break; - case IR_STRTO: asm_strto(as, ir); break; - - /* Calls. */ - case IR_CALLN: case IR_CALLL: case IR_CALLS: asm_call(as, ir); break; - case IR_CALLXS: asm_callx(as, ir); break; - case IR_CARG: break; - - default: - setintV(&as->J->errinfo, ir->o); - lj_trace_err_info(as->J, LJ_TRERR_NYIIR); - break; - } -} - -/* -- Trace setup --------------------------------------------------------- */ - -/* Ensure there are enough stack slots for call arguments. */ -static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci) -{ - IRRef args[CCI_NARGS_MAX*2]; - int nslots; - asm_collectargs(as, ir, ci, args); - nslots = asm_count_call_slots(as, ci, args); - if (nslots > as->evenspill) /* Leave room for args in stack slots. */ - as->evenspill = nslots; -#if LJ_64 - return irt_isfp(ir->t) ? REGSP_HINT(RID_FPRET) : REGSP_HINT(RID_RET); -#else - return irt_isfp(ir->t) ? REGSP_INIT : REGSP_HINT(RID_RET); -#endif -} - -/* Target-specific setup. */ -static void asm_setup_target(ASMState *as) -{ - asm_exitstub_setup(as, as->T->nsnap); -} - -/* -- Trace patching ------------------------------------------------------ */ - -static const uint8_t map_op1[256] = { -0x92,0x92,0x92,0x92,0x52,0x45,0x51,0x51,0x92,0x92,0x92,0x92,0x52,0x45,0x51,0x20, -0x92,0x92,0x92,0x92,0x52,0x45,0x51,0x51,0x92,0x92,0x92,0x92,0x52,0x45,0x51,0x51, -0x92,0x92,0x92,0x92,0x52,0x45,0x10,0x51,0x92,0x92,0x92,0x92,0x52,0x45,0x10,0x51, -0x92,0x92,0x92,0x92,0x52,0x45,0x10,0x51,0x92,0x92,0x92,0x92,0x52,0x45,0x10,0x51, -#if LJ_64 -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14, -#else -0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51, -#endif -0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51, -0x51,0x51,0x92,0x92,0x10,0x10,0x12,0x11,0x45,0x86,0x52,0x93,0x51,0x51,0x51,0x51, -0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, -0x93,0x86,0x93,0x93,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92, -0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x47,0x51,0x51,0x51,0x51,0x51, -#if LJ_64 -0x59,0x59,0x59,0x59,0x51,0x51,0x51,0x51,0x52,0x45,0x51,0x51,0x51,0x51,0x51,0x51, -#else -0x55,0x55,0x55,0x55,0x51,0x51,0x51,0x51,0x52,0x45,0x51,0x51,0x51,0x51,0x51,0x51, -#endif -0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, -0x93,0x93,0x53,0x51,0x70,0x71,0x93,0x86,0x54,0x51,0x53,0x51,0x51,0x52,0x51,0x51, -0x92,0x92,0x92,0x92,0x52,0x52,0x51,0x51,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92, -0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x45,0x45,0x47,0x52,0x51,0x51,0x51,0x51, -0x10,0x51,0x10,0x10,0x51,0x51,0x63,0x66,0x51,0x51,0x51,0x51,0x51,0x51,0x92,0x92 -}; - -static const uint8_t map_op2[256] = { -0x93,0x93,0x93,0x93,0x52,0x52,0x52,0x52,0x52,0x52,0x51,0x52,0x51,0x93,0x52,0x94, -0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93, -0x53,0x53,0x53,0x53,0x53,0x53,0x53,0x53,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93, -0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x34,0x51,0x35,0x51,0x51,0x51,0x51,0x51, -0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93, -0x53,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93, -0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93, -0x94,0x54,0x54,0x54,0x93,0x93,0x93,0x52,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93, -0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46, -0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93, -0x52,0x52,0x52,0x93,0x94,0x93,0x51,0x51,0x52,0x52,0x52,0x93,0x94,0x93,0x93,0x93, -0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x94,0x93,0x93,0x93,0x93,0x93, -0x93,0x93,0x94,0x93,0x94,0x94,0x94,0x93,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, -0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93, -0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93, -0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x93,0x52 -}; - -static uint32_t asm_x86_inslen(const uint8_t* p) -{ - uint32_t result = 0; - uint32_t prefixes = 0; - uint32_t x = map_op1[*p]; - for (;;) { - switch (x >> 4) { - case 0: return result + x + (prefixes & 4); - case 1: prefixes |= x; x = map_op1[*++p]; result++; break; - case 2: x = map_op2[*++p]; break; - case 3: p++; goto mrm; - case 4: result -= (prefixes & 2); /* fallthrough */ - case 5: return result + (x & 15); - case 6: /* Group 3. */ - if (p[1] & 0x38) x = 2; - else if ((prefixes & 2) && (x == 0x66)) x = 4; - goto mrm; - case 7: /* VEX c4/c5. */ - if (LJ_32 && p[1] < 0xc0) { - x = 2; - goto mrm; - } - if (x == 0x70) { - x = *++p & 0x1f; - result++; - if (x >= 2) { - p += 2; - result += 2; - goto mrm; - } - } - p++; - result++; - x = map_op2[*++p]; - break; - case 8: result -= (prefixes & 2); /* fallthrough */ - case 9: mrm: /* ModR/M and possibly SIB. */ - result += (x & 15); - x = *++p; - switch (x >> 6) { - case 0: if ((x & 7) == 5) return result + 4; break; - case 1: result++; break; - case 2: result += 4; break; - case 3: return result; - } - if ((x & 7) == 4) { - result++; - if (x < 0x40 && (p[1] & 7) == 5) result += 4; - } - return result; - } - } -} - -/* Patch exit jumps of existing machine code to a new target. */ -void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target) -{ - MCode *p = T->mcode; - MCode *mcarea = lj_mcode_patch(J, p, 0); - MSize len = T->szmcode; - MCode *px = exitstub_addr(J, exitno) - 6; - MCode *pe = p+len-6; - uint32_t stateaddr = u32ptr(&J2G(J)->vmstate); - if (len > 5 && p[len-5] == XI_JMP && p+len-6 + *(int32_t *)(p+len-4) == px) - *(int32_t *)(p+len-4) = jmprel(p+len, target); - /* Do not patch parent exit for a stack check. Skip beyond vmstate update. */ - for (; p < pe; p += asm_x86_inslen(p)) - if (*(uint32_t *)(p+(LJ_64 ? 3 : 2)) == stateaddr && p[0] == XI_MOVmi) - break; - lua_assert(p < pe); - for (; p < pe; p += asm_x86_inslen(p)) - if ((*(uint16_t *)p & 0xf0ff) == 0x800f && p + *(int32_t *)(p+2) == px) - *(int32_t *)(p+2) = jmprel(p+6, target); - lj_mcode_sync(T->mcode, T->mcode + T->szmcode); - lj_mcode_patch(J, mcarea, 1); -} - diff --git a/subprojects/luajit/src/lj_bc.c b/subprojects/luajit/src/lj_bc.c deleted file mode 100644 index a597692ca..000000000 --- a/subprojects/luajit/src/lj_bc.c +++ /dev/null @@ -1,14 +0,0 @@ -/* -** Bytecode instruction modes. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_bc_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_bc.h" - -/* Bytecode offsets and bytecode instruction modes. */ -#include "lj_bcdef.h" - diff --git a/subprojects/luajit/src/lj_bc.h b/subprojects/luajit/src/lj_bc.h deleted file mode 100644 index 108c10f28..000000000 --- a/subprojects/luajit/src/lj_bc.h +++ /dev/null @@ -1,261 +0,0 @@ -/* -** Bytecode instruction format. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_BC_H -#define _LJ_BC_H - -#include "lj_def.h" -#include "lj_arch.h" - -/* Bytecode instruction format, 32 bit wide, fields of 8 or 16 bit: -** -** +----+----+----+----+ -** | B | C | A | OP | Format ABC -** +----+----+----+----+ -** | D | A | OP | Format AD -** +-------------------- -** MSB LSB -** -** In-memory instructions are always stored in host byte order. -*/ - -/* Operand ranges and related constants. */ -#define BCMAX_A 0xff -#define BCMAX_B 0xff -#define BCMAX_C 0xff -#define BCMAX_D 0xffff -#define BCBIAS_J 0x8000 -#define NO_REG BCMAX_A -#define NO_JMP (~(BCPos)0) - -/* Macros to get instruction fields. */ -#define bc_op(i) ((BCOp)((i)&0xff)) -#define bc_a(i) ((BCReg)(((i)>>8)&0xff)) -#define bc_b(i) ((BCReg)((i)>>24)) -#define bc_c(i) ((BCReg)(((i)>>16)&0xff)) -#define bc_d(i) ((BCReg)((i)>>16)) -#define bc_j(i) ((ptrdiff_t)bc_d(i)-BCBIAS_J) - -/* Macros to set instruction fields. */ -#define setbc_byte(p, x, ofs) \ - ((uint8_t *)(p))[LJ_ENDIAN_SELECT(ofs, 3-ofs)] = (uint8_t)(x) -#define setbc_op(p, x) setbc_byte(p, (x), 0) -#define setbc_a(p, x) setbc_byte(p, (x), 1) -#define setbc_b(p, x) setbc_byte(p, (x), 3) -#define setbc_c(p, x) setbc_byte(p, (x), 2) -#define setbc_d(p, x) \ - ((uint16_t *)(p))[LJ_ENDIAN_SELECT(1, 0)] = (uint16_t)(x) -#define setbc_j(p, x) setbc_d(p, (BCPos)((int32_t)(x)+BCBIAS_J)) - -/* Macros to compose instructions. */ -#define BCINS_ABC(o, a, b, c) \ - (((BCIns)(o))|((BCIns)(a)<<8)|((BCIns)(b)<<24)|((BCIns)(c)<<16)) -#define BCINS_AD(o, a, d) \ - (((BCIns)(o))|((BCIns)(a)<<8)|((BCIns)(d)<<16)) -#define BCINS_AJ(o, a, j) BCINS_AD(o, a, (BCPos)((int32_t)(j)+BCBIAS_J)) - -/* Bytecode instruction definition. Order matters, see below. -** -** (name, filler, Amode, Bmode, Cmode or Dmode, metamethod) -** -** The opcode name suffixes specify the type for RB/RC or RD: -** V = variable slot -** S = string const -** N = number const -** P = primitive type (~itype) -** B = unsigned byte literal -** M = multiple args/results -*/ -#define BCDEF(_) \ - /* Comparison ops. ORDER OPR. */ \ - _(ISLT, var, ___, var, lt) \ - _(ISGE, var, ___, var, lt) \ - _(ISLE, var, ___, var, le) \ - _(ISGT, var, ___, var, le) \ - \ - _(ISEQV, var, ___, var, eq) \ - _(ISNEV, var, ___, var, eq) \ - _(ISEQS, var, ___, str, eq) \ - _(ISNES, var, ___, str, eq) \ - _(ISEQN, var, ___, num, eq) \ - _(ISNEN, var, ___, num, eq) \ - _(ISEQP, var, ___, pri, eq) \ - _(ISNEP, var, ___, pri, eq) \ - \ - /* Unary test and copy ops. */ \ - _(ISTC, dst, ___, var, ___) \ - _(ISFC, dst, ___, var, ___) \ - _(IST, ___, ___, var, ___) \ - _(ISF, ___, ___, var, ___) \ - \ - /* Unary ops. */ \ - _(MOV, dst, ___, var, ___) \ - _(NOT, dst, ___, var, ___) \ - _(UNM, dst, ___, var, unm) \ - _(LEN, dst, ___, var, len) \ - \ - /* Binary ops. ORDER OPR. VV last, POW must be next. */ \ - _(ADDVN, dst, var, num, add) \ - _(SUBVN, dst, var, num, sub) \ - _(MULVN, dst, var, num, mul) \ - _(DIVVN, dst, var, num, div) \ - _(MODVN, dst, var, num, mod) \ - \ - _(ADDNV, dst, var, num, add) \ - _(SUBNV, dst, var, num, sub) \ - _(MULNV, dst, var, num, mul) \ - _(DIVNV, dst, var, num, div) \ - _(MODNV, dst, var, num, mod) \ - \ - _(ADDVV, dst, var, var, add) \ - _(SUBVV, dst, var, var, sub) \ - _(MULVV, dst, var, var, mul) \ - _(DIVVV, dst, var, var, div) \ - _(MODVV, dst, var, var, mod) \ - \ - _(POW, dst, var, var, pow) \ - _(CAT, dst, rbase, rbase, concat) \ - \ - /* Constant ops. */ \ - _(KSTR, dst, ___, str, ___) \ - _(KCDATA, dst, ___, cdata, ___) \ - _(KSHORT, dst, ___, lits, ___) \ - _(KNUM, dst, ___, num, ___) \ - _(KPRI, dst, ___, pri, ___) \ - _(KNIL, base, ___, base, ___) \ - \ - /* Upvalue and function ops. */ \ - _(UGET, dst, ___, uv, ___) \ - _(USETV, uv, ___, var, ___) \ - _(USETS, uv, ___, str, ___) \ - _(USETN, uv, ___, num, ___) \ - _(USETP, uv, ___, pri, ___) \ - _(UCLO, rbase, ___, jump, ___) \ - _(FNEW, dst, ___, func, gc) \ - \ - /* Table ops. */ \ - _(TNEW, dst, ___, lit, gc) \ - _(TDUP, dst, ___, tab, gc) \ - _(GGET, dst, ___, str, index) \ - _(GSET, var, ___, str, newindex) \ - _(TGETV, dst, var, var, index) \ - _(TGETS, dst, var, str, index) \ - _(TGETB, dst, var, lit, index) \ - _(TSETV, var, var, var, newindex) \ - _(TSETS, var, var, str, newindex) \ - _(TSETB, var, var, lit, newindex) \ - _(TSETM, base, ___, num, newindex) \ - \ - /* Calls and vararg handling. T = tail call. */ \ - _(CALLM, base, lit, lit, call) \ - _(CALL, base, lit, lit, call) \ - _(CALLMT, base, ___, lit, call) \ - _(CALLT, base, ___, lit, call) \ - _(ITERC, base, lit, lit, call) \ - _(ITERN, base, lit, lit, call) \ - _(VARG, base, lit, lit, ___) \ - _(ISNEXT, base, ___, jump, ___) \ - \ - /* Returns. */ \ - _(RETM, base, ___, lit, ___) \ - _(RET, rbase, ___, lit, ___) \ - _(RET0, rbase, ___, lit, ___) \ - _(RET1, rbase, ___, lit, ___) \ - \ - /* Loops and branches. I/J = interp/JIT, I/C/L = init/call/loop. */ \ - _(FORI, base, ___, jump, ___) \ - _(JFORI, base, ___, jump, ___) \ - \ - _(FORL, base, ___, jump, ___) \ - _(IFORL, base, ___, jump, ___) \ - _(JFORL, base, ___, lit, ___) \ - \ - _(ITERL, base, ___, jump, ___) \ - _(IITERL, base, ___, jump, ___) \ - _(JITERL, base, ___, lit, ___) \ - \ - _(LOOP, rbase, ___, jump, ___) \ - _(ILOOP, rbase, ___, jump, ___) \ - _(JLOOP, rbase, ___, lit, ___) \ - \ - _(JMP, rbase, ___, jump, ___) \ - \ - /* Function headers. I/J = interp/JIT, F/V/C = fixarg/vararg/C func. */ \ - _(FUNCF, rbase, ___, ___, ___) \ - _(IFUNCF, rbase, ___, ___, ___) \ - _(JFUNCF, rbase, ___, lit, ___) \ - _(FUNCV, rbase, ___, ___, ___) \ - _(IFUNCV, rbase, ___, ___, ___) \ - _(JFUNCV, rbase, ___, lit, ___) \ - _(FUNCC, rbase, ___, ___, ___) \ - _(FUNCCW, rbase, ___, ___, ___) - -/* Bytecode opcode numbers. */ -typedef enum { -#define BCENUM(name, ma, mb, mc, mt) BC_##name, -BCDEF(BCENUM) -#undef BCENUM - BC__MAX -} BCOp; - -LJ_STATIC_ASSERT((int)BC_ISEQV+1 == (int)BC_ISNEV); -LJ_STATIC_ASSERT(((int)BC_ISEQV^1) == (int)BC_ISNEV); -LJ_STATIC_ASSERT(((int)BC_ISEQS^1) == (int)BC_ISNES); -LJ_STATIC_ASSERT(((int)BC_ISEQN^1) == (int)BC_ISNEN); -LJ_STATIC_ASSERT(((int)BC_ISEQP^1) == (int)BC_ISNEP); -LJ_STATIC_ASSERT(((int)BC_ISLT^1) == (int)BC_ISGE); -LJ_STATIC_ASSERT(((int)BC_ISLE^1) == (int)BC_ISGT); -LJ_STATIC_ASSERT(((int)BC_ISLT^3) == (int)BC_ISGT); -LJ_STATIC_ASSERT((int)BC_IST-(int)BC_ISTC == (int)BC_ISF-(int)BC_ISFC); -LJ_STATIC_ASSERT((int)BC_CALLT-(int)BC_CALL == (int)BC_CALLMT-(int)BC_CALLM); -LJ_STATIC_ASSERT((int)BC_CALLMT + 1 == (int)BC_CALLT); -LJ_STATIC_ASSERT((int)BC_RETM + 1 == (int)BC_RET); -LJ_STATIC_ASSERT((int)BC_FORL + 1 == (int)BC_IFORL); -LJ_STATIC_ASSERT((int)BC_FORL + 2 == (int)BC_JFORL); -LJ_STATIC_ASSERT((int)BC_ITERL + 1 == (int)BC_IITERL); -LJ_STATIC_ASSERT((int)BC_ITERL + 2 == (int)BC_JITERL); -LJ_STATIC_ASSERT((int)BC_LOOP + 1 == (int)BC_ILOOP); -LJ_STATIC_ASSERT((int)BC_LOOP + 2 == (int)BC_JLOOP); -LJ_STATIC_ASSERT((int)BC_FUNCF + 1 == (int)BC_IFUNCF); -LJ_STATIC_ASSERT((int)BC_FUNCF + 2 == (int)BC_JFUNCF); -LJ_STATIC_ASSERT((int)BC_FUNCV + 1 == (int)BC_IFUNCV); -LJ_STATIC_ASSERT((int)BC_FUNCV + 2 == (int)BC_JFUNCV); - -/* This solves a circular dependency problem, change as needed. */ -#define FF_next_N 4 - -/* Stack slots used by FORI/FORL, relative to operand A. */ -enum { - FORL_IDX, FORL_STOP, FORL_STEP, FORL_EXT -}; - -/* Bytecode operand modes. ORDER BCMode */ -typedef enum { - BCMnone, BCMdst, BCMbase, BCMvar, BCMrbase, BCMuv, /* Mode A must be <= 7 */ - BCMlit, BCMlits, BCMpri, BCMnum, BCMstr, BCMtab, BCMfunc, BCMjump, BCMcdata, - BCM_max -} BCMode; -#define BCM___ BCMnone - -#define bcmode_a(op) ((BCMode)(lj_bc_mode[op] & 7)) -#define bcmode_b(op) ((BCMode)((lj_bc_mode[op]>>3) & 15)) -#define bcmode_c(op) ((BCMode)((lj_bc_mode[op]>>7) & 15)) -#define bcmode_d(op) bcmode_c(op) -#define bcmode_hasd(op) ((lj_bc_mode[op] & (15<<3)) == (BCMnone<<3)) -#define bcmode_mm(op) ((MMS)(lj_bc_mode[op]>>11)) - -#define BCMODE(name, ma, mb, mc, mm) \ - (BCM##ma|(BCM##mb<<3)|(BCM##mc<<7)|(MM_##mm<<11)), -#define BCMODE_FF 0 - -static LJ_AINLINE int bc_isret(BCOp op) -{ - return (op == BC_RETM || op == BC_RET || op == BC_RET0 || op == BC_RET1); -} - -LJ_DATA const uint16_t lj_bc_mode[]; -LJ_DATA const uint16_t lj_bc_ofs[]; - -#endif diff --git a/subprojects/luajit/src/lj_bcdump.h b/subprojects/luajit/src/lj_bcdump.h deleted file mode 100644 index ba53c0a11..000000000 --- a/subprojects/luajit/src/lj_bcdump.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -** Bytecode dump definitions. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_BCDUMP_H -#define _LJ_BCDUMP_H - -#include "lj_obj.h" -#include "lj_lex.h" - -/* -- Bytecode dump format ------------------------------------------------ */ - -/* -** dump = header proto+ 0U -** header = ESC 'L' 'J' versionB flagsU [namelenU nameB*] -** proto = lengthU pdata -** pdata = phead bcinsW* uvdataH* kgc* knum* [debugB*] -** phead = flagsB numparamsB framesizeB numuvB numkgcU numknU numbcU -** [debuglenU [firstlineU numlineU]] -** kgc = kgctypeU { ktab | (loU hiU) | (rloU rhiU iloU ihiU) | strB* } -** knum = intU0 | (loU1 hiU) -** ktab = narrayU nhashU karray* khash* -** karray = ktabk -** khash = ktabk ktabk -** ktabk = ktabtypeU { intU | (loU hiU) | strB* } -** -** B = 8 bit, H = 16 bit, W = 32 bit, U = ULEB128 of W, U0/U1 = ULEB128 of W+1 -*/ - -/* Bytecode dump header. */ -#define BCDUMP_HEAD1 0x1b -#define BCDUMP_HEAD2 0x4c -#define BCDUMP_HEAD3 0x4a - -/* If you perform *any* kind of private modifications to the bytecode itself -** or to the dump format, you *must* set BCDUMP_VERSION to 0x80 or higher. -*/ -#define BCDUMP_VERSION 1 - -/* Compatibility flags. */ -#define BCDUMP_F_BE 0x01 -#define BCDUMP_F_STRIP 0x02 -#define BCDUMP_F_FFI 0x04 - -#define BCDUMP_F_KNOWN (BCDUMP_F_FFI*2-1) - -/* Type codes for the GC constants of a prototype. Plus length for strings. */ -enum { - BCDUMP_KGC_CHILD, BCDUMP_KGC_TAB, BCDUMP_KGC_I64, BCDUMP_KGC_U64, - BCDUMP_KGC_COMPLEX, BCDUMP_KGC_STR -}; - -/* Type codes for the keys/values of a constant table. */ -enum { - BCDUMP_KTAB_NIL, BCDUMP_KTAB_FALSE, BCDUMP_KTAB_TRUE, - BCDUMP_KTAB_INT, BCDUMP_KTAB_NUM, BCDUMP_KTAB_STR -}; - -/* -- Bytecode reader/writer ---------------------------------------------- */ - -LJ_FUNC int lj_bcwrite(lua_State *L, GCproto *pt, lua_Writer writer, - void *data, int strip); -LJ_FUNC GCproto *lj_bcread(LexState *ls); - -#endif diff --git a/subprojects/luajit/src/lj_bcread.c b/subprojects/luajit/src/lj_bcread.c deleted file mode 100644 index 6a462bd6d..000000000 --- a/subprojects/luajit/src/lj_bcread.c +++ /dev/null @@ -1,476 +0,0 @@ -/* -** Bytecode reader. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_bcread_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_bc.h" -#if LJ_HASFFI -#include "lj_ctype.h" -#include "lj_cdata.h" -#include "lualib.h" -#endif -#include "lj_lex.h" -#include "lj_bcdump.h" -#include "lj_state.h" - -/* Reuse some lexer fields for our own purposes. */ -#define bcread_flags(ls) ls->level -#define bcread_swap(ls) \ - ((bcread_flags(ls) & BCDUMP_F_BE) != LJ_BE*BCDUMP_F_BE) -#define bcread_oldtop(L, ls) restorestack(L, ls->lastline) -#define bcread_savetop(L, ls, top) \ - ls->lastline = (BCLine)savestack(L, (top)) - -/* -- Input buffer handling ----------------------------------------------- */ - -/* Throw reader error. */ -static LJ_NOINLINE void bcread_error(LexState *ls, ErrMsg em) -{ - lua_State *L = ls->L; - const char *name = ls->chunkarg; - if (*name == BCDUMP_HEAD1) name = "(binary)"; - else if (*name == '@' || *name == '=') name++; - lj_str_pushf(L, "%s: %s", name, err2msg(em)); - lj_err_throw(L, LUA_ERRSYNTAX); -} - -/* Resize input buffer. */ -static void bcread_resize(LexState *ls, MSize len) -{ - if (ls->sb.sz < len) { - MSize sz = ls->sb.sz * 2; - while (len > sz) sz = sz * 2; - lj_str_resizebuf(ls->L, &ls->sb, sz); - /* Caveat: this may change ls->sb.buf which may affect ls->p. */ - } -} - -/* Refill buffer if needed. */ -static LJ_NOINLINE void bcread_fill(LexState *ls, MSize len, int need) -{ - lua_assert(len != 0); - if (len > LJ_MAX_MEM || ls->current < 0) - bcread_error(ls, LJ_ERR_BCBAD); - do { - const char *buf; - size_t size; - if (ls->n) { /* Copy remainder to buffer. */ - if (ls->sb.n) { /* Move down in buffer. */ - lua_assert(ls->p + ls->n == ls->sb.buf + ls->sb.n); - if (ls->n != ls->sb.n) - memmove(ls->sb.buf, ls->p, ls->n); - } else { /* Copy from buffer provided by reader. */ - bcread_resize(ls, len); - memcpy(ls->sb.buf, ls->p, ls->n); - } - ls->p = ls->sb.buf; - } - ls->sb.n = ls->n; - buf = ls->rfunc(ls->L, ls->rdata, &size); /* Get more data from reader. */ - if (buf == NULL || size == 0) { /* EOF? */ - if (need) bcread_error(ls, LJ_ERR_BCBAD); - ls->current = -1; /* Only bad if we get called again. */ - break; - } - if (ls->sb.n) { /* Append to buffer. */ - MSize n = ls->sb.n + (MSize)size; - bcread_resize(ls, n < len ? len : n); - memcpy(ls->sb.buf + ls->sb.n, buf, size); - ls->n = ls->sb.n = n; - ls->p = ls->sb.buf; - } else { /* Return buffer provided by reader. */ - ls->n = (MSize)size; - ls->p = buf; - } - } while (ls->n < len); -} - -/* Need a certain number of bytes. */ -static LJ_AINLINE void bcread_need(LexState *ls, MSize len) -{ - if (LJ_UNLIKELY(ls->n < len)) - bcread_fill(ls, len, 1); -} - -/* Want to read up to a certain number of bytes, but may need less. */ -static LJ_AINLINE void bcread_want(LexState *ls, MSize len) -{ - if (LJ_UNLIKELY(ls->n < len)) - bcread_fill(ls, len, 0); -} - -#define bcread_dec(ls) check_exp(ls->n > 0, ls->n--) -#define bcread_consume(ls, len) check_exp(ls->n >= (len), ls->n -= (len)) - -/* Return memory block from buffer. */ -static uint8_t *bcread_mem(LexState *ls, MSize len) -{ - uint8_t *p = (uint8_t *)ls->p; - bcread_consume(ls, len); - ls->p = (char *)p + len; - return p; -} - -/* Copy memory block from buffer. */ -static void bcread_block(LexState *ls, void *q, MSize len) -{ - memcpy(q, bcread_mem(ls, len), len); -} - -/* Read byte from buffer. */ -static LJ_AINLINE uint32_t bcread_byte(LexState *ls) -{ - bcread_dec(ls); - return (uint32_t)(uint8_t)*ls->p++; -} - -/* Read ULEB128 value from buffer. */ -static uint32_t bcread_uleb128(LexState *ls) -{ - const uint8_t *p = (const uint8_t *)ls->p; - uint32_t v = *p++; - if (LJ_UNLIKELY(v >= 0x80)) { - int sh = 0; - v &= 0x7f; - do { - v |= ((*p & 0x7f) << (sh += 7)); - bcread_dec(ls); - } while (*p++ >= 0x80); - } - bcread_dec(ls); - ls->p = (char *)p; - return v; -} - -/* Read top 32 bits of 33 bit ULEB128 value from buffer. */ -static uint32_t bcread_uleb128_33(LexState *ls) -{ - const uint8_t *p = (const uint8_t *)ls->p; - uint32_t v = (*p++ >> 1); - if (LJ_UNLIKELY(v >= 0x40)) { - int sh = -1; - v &= 0x3f; - do { - v |= ((*p & 0x7f) << (sh += 7)); - bcread_dec(ls); - } while (*p++ >= 0x80); - } - bcread_dec(ls); - ls->p = (char *)p; - return v; -} - -/* -- Bytecode reader ----------------------------------------------------- */ - -/* Read debug info of a prototype. */ -static void bcread_dbg(LexState *ls, GCproto *pt, MSize sizedbg) -{ - void *lineinfo = (void *)proto_lineinfo(pt); - bcread_block(ls, lineinfo, sizedbg); - /* Swap lineinfo if the endianess differs. */ - if (bcread_swap(ls) && pt->numline >= 256) { - MSize i, n = pt->sizebc-1; - if (pt->numline < 65536) { - uint16_t *p = (uint16_t *)lineinfo; - for (i = 0; i < n; i++) p[i] = (uint16_t)((p[i] >> 8)|(p[i] << 8)); - } else { - uint32_t *p = (uint32_t *)lineinfo; - for (i = 0; i < n; i++) p[i] = lj_bswap(p[i]); - } - } -} - -/* Find pointer to varinfo. */ -static const void *bcread_varinfo(GCproto *pt) -{ - const uint8_t *p = proto_uvinfo(pt); - MSize n = pt->sizeuv; - if (n) while (*p++ || --n) ; - return p; -} - -/* Read a single constant key/value of a template table. */ -static void bcread_ktabk(LexState *ls, TValue *o) -{ - MSize tp = bcread_uleb128(ls); - if (tp >= BCDUMP_KTAB_STR) { - MSize len = tp - BCDUMP_KTAB_STR; - const char *p = (const char *)bcread_mem(ls, len); - setstrV(ls->L, o, lj_str_new(ls->L, p, len)); - } else if (tp == BCDUMP_KTAB_INT) { - setintV(o, (int32_t)bcread_uleb128(ls)); - } else if (tp == BCDUMP_KTAB_NUM) { - o->u32.lo = bcread_uleb128(ls); - o->u32.hi = bcread_uleb128(ls); - } else { - lua_assert(tp <= BCDUMP_KTAB_TRUE); - setitype(o, ~tp); - } -} - -/* Read a template table. */ -static GCtab *bcread_ktab(LexState *ls) -{ - MSize narray = bcread_uleb128(ls); - MSize nhash = bcread_uleb128(ls); - GCtab *t = lj_tab_new(ls->L, narray, hsize2hbits(nhash)); - if (narray) { /* Read array entries. */ - MSize i; - TValue *o = tvref(t->array); - for (i = 0; i < narray; i++, o++) - bcread_ktabk(ls, o); - } - if (nhash) { /* Read hash entries. */ - MSize i; - for (i = 0; i < nhash; i++) { - TValue key; - bcread_ktabk(ls, &key); - lua_assert(!tvisnil(&key)); - bcread_ktabk(ls, lj_tab_set(ls->L, t, &key)); - } - } - return t; -} - -/* Read GC constants of a prototype. */ -static void bcread_kgc(LexState *ls, GCproto *pt, MSize sizekgc) -{ - MSize i; - GCRef *kr = mref(pt->k, GCRef) - (ptrdiff_t)sizekgc; - for (i = 0; i < sizekgc; i++, kr++) { - MSize tp = bcread_uleb128(ls); - if (tp >= BCDUMP_KGC_STR) { - MSize len = tp - BCDUMP_KGC_STR; - const char *p = (const char *)bcread_mem(ls, len); - setgcref(*kr, obj2gco(lj_str_new(ls->L, p, len))); - } else if (tp == BCDUMP_KGC_TAB) { - setgcref(*kr, obj2gco(bcread_ktab(ls))); -#if LJ_HASFFI - } else if (tp != BCDUMP_KGC_CHILD) { - CTypeID id = tp == BCDUMP_KGC_COMPLEX ? CTID_COMPLEX_DOUBLE : - tp == BCDUMP_KGC_I64 ? CTID_INT64 : CTID_UINT64; - CTSize sz = tp == BCDUMP_KGC_COMPLEX ? 16 : 8; - GCcdata *cd = lj_cdata_new_(ls->L, id, sz); - TValue *p = (TValue *)cdataptr(cd); - setgcref(*kr, obj2gco(cd)); - p[0].u32.lo = bcread_uleb128(ls); - p[0].u32.hi = bcread_uleb128(ls); - if (tp == BCDUMP_KGC_COMPLEX) { - p[1].u32.lo = bcread_uleb128(ls); - p[1].u32.hi = bcread_uleb128(ls); - } -#endif - } else { - lua_State *L = ls->L; - lua_assert(tp == BCDUMP_KGC_CHILD); - if (L->top <= bcread_oldtop(L, ls)) /* Stack underflow? */ - bcread_error(ls, LJ_ERR_BCBAD); - L->top--; - setgcref(*kr, obj2gco(protoV(L->top))); - } - } -} - -/* Read number constants of a prototype. */ -static void bcread_knum(LexState *ls, GCproto *pt, MSize sizekn) -{ - MSize i; - TValue *o = mref(pt->k, TValue); - for (i = 0; i < sizekn; i++, o++) { - int isnum = (ls->p[0] & 1); - uint32_t lo = bcread_uleb128_33(ls); - if (isnum) { - o->u32.lo = lo; - o->u32.hi = bcread_uleb128(ls); - } else { - setintV(o, lo); - } - } -} - -/* Read bytecode instructions. */ -static void bcread_bytecode(LexState *ls, GCproto *pt, MSize sizebc) -{ - BCIns *bc = proto_bc(pt); - bc[0] = BCINS_AD((pt->flags & PROTO_VARARG) ? BC_FUNCV : BC_FUNCF, - pt->framesize, 0); - bcread_block(ls, bc+1, (sizebc-1)*(MSize)sizeof(BCIns)); - /* Swap bytecode instructions if the endianess differs. */ - if (bcread_swap(ls)) { - MSize i; - for (i = 1; i < sizebc; i++) bc[i] = lj_bswap(bc[i]); - } -} - -/* Read upvalue refs. */ -static void bcread_uv(LexState *ls, GCproto *pt, MSize sizeuv) -{ - if (sizeuv) { - uint16_t *uv = proto_uv(pt); - bcread_block(ls, uv, sizeuv*2); - /* Swap upvalue refs if the endianess differs. */ - if (bcread_swap(ls)) { - MSize i; - for (i = 0; i < sizeuv; i++) - uv[i] = (uint16_t)((uv[i] >> 8)|(uv[i] << 8)); - } - } -} - -/* Read a prototype. */ -static GCproto *bcread_proto(LexState *ls) -{ - GCproto *pt; - MSize framesize, numparams, flags, sizeuv, sizekgc, sizekn, sizebc, sizept; - MSize ofsk, ofsuv, ofsdbg; - MSize sizedbg = 0; - BCLine firstline = 0, numline = 0; - MSize len, startn; - - /* Read length. */ - if (ls->n > 0 && ls->p[0] == 0) { /* Shortcut EOF. */ - ls->n--; ls->p++; - return NULL; - } - bcread_want(ls, 5); - len = bcread_uleb128(ls); - if (!len) return NULL; /* EOF */ - bcread_need(ls, len); - startn = ls->n; - - /* Read prototype header. */ - flags = bcread_byte(ls); - numparams = bcread_byte(ls); - framesize = bcread_byte(ls); - sizeuv = bcread_byte(ls); - sizekgc = bcread_uleb128(ls); - sizekn = bcread_uleb128(ls); - sizebc = bcread_uleb128(ls) + 1; - if (!(bcread_flags(ls) & BCDUMP_F_STRIP)) { - sizedbg = bcread_uleb128(ls); - if (sizedbg) { - firstline = bcread_uleb128(ls); - numline = bcread_uleb128(ls); - } - } - - /* Calculate total size of prototype including all colocated arrays. */ - sizept = (MSize)sizeof(GCproto) + - sizebc*(MSize)sizeof(BCIns) + - sizekgc*(MSize)sizeof(GCRef); - sizept = (sizept + (MSize)sizeof(TValue)-1) & ~((MSize)sizeof(TValue)-1); - ofsk = sizept; sizept += sizekn*(MSize)sizeof(TValue); - ofsuv = sizept; sizept += ((sizeuv+1)&~1)*2; - ofsdbg = sizept; sizept += sizedbg; - - /* Allocate prototype object and initialize its fields. */ - pt = (GCproto *)lj_mem_newgco(ls->L, (MSize)sizept); - pt->gct = ~LJ_TPROTO; - pt->numparams = (uint8_t)numparams; - pt->framesize = (uint8_t)framesize; - pt->sizebc = sizebc; - setmref(pt->k, (char *)pt + ofsk); - setmref(pt->uv, (char *)pt + ofsuv); - pt->sizekgc = 0; /* Set to zero until fully initialized. */ - pt->sizekn = sizekn; - pt->sizept = sizept; - pt->sizeuv = (uint8_t)sizeuv; - pt->flags = (uint8_t)flags; - pt->trace = 0; - setgcref(pt->chunkname, obj2gco(ls->chunkname)); - - /* Close potentially uninitialized gap between bc and kgc. */ - *(uint32_t *)((char *)pt + ofsk - sizeof(GCRef)*(sizekgc+1)) = 0; - - /* Read bytecode instructions and upvalue refs. */ - bcread_bytecode(ls, pt, sizebc); - bcread_uv(ls, pt, sizeuv); - - /* Read constants. */ - bcread_kgc(ls, pt, sizekgc); - pt->sizekgc = sizekgc; - bcread_knum(ls, pt, sizekn); - - /* Read and initialize debug info. */ - pt->firstline = firstline; - pt->numline = numline; - if (sizedbg) { - MSize sizeli = (sizebc-1) << (numline < 256 ? 0 : numline < 65536 ? 1 : 2); - setmref(pt->lineinfo, (char *)pt + ofsdbg); - setmref(pt->uvinfo, (char *)pt + ofsdbg + sizeli); - bcread_dbg(ls, pt, sizedbg); - setmref(pt->varinfo, bcread_varinfo(pt)); - } else { - setmref(pt->lineinfo, NULL); - setmref(pt->uvinfo, NULL); - setmref(pt->varinfo, NULL); - } - - if (len != startn - ls->n) - bcread_error(ls, LJ_ERR_BCBAD); - return pt; -} - -/* Read and check header of bytecode dump. */ -static int bcread_header(LexState *ls) -{ - uint32_t flags; - bcread_want(ls, 3+5+5); - if (bcread_byte(ls) != BCDUMP_HEAD2 || - bcread_byte(ls) != BCDUMP_HEAD3 || - bcread_byte(ls) != BCDUMP_VERSION) return 0; - bcread_flags(ls) = flags = bcread_uleb128(ls); - if ((flags & ~(BCDUMP_F_KNOWN)) != 0) return 0; - if ((flags & BCDUMP_F_FFI)) { -#if LJ_HASFFI - lua_State *L = ls->L; - if (!ctype_ctsG(G(L))) { - ptrdiff_t oldtop = savestack(L, L->top); - luaopen_ffi(L); /* Load FFI library on-demand. */ - L->top = restorestack(L, oldtop); - } -#else - return 0; -#endif - } - if ((flags & BCDUMP_F_STRIP)) { - ls->chunkname = lj_str_newz(ls->L, ls->chunkarg); - } else { - MSize len = bcread_uleb128(ls); - bcread_need(ls, len); - ls->chunkname = lj_str_new(ls->L, (const char *)bcread_mem(ls, len), len); - } - return 1; /* Ok. */ -} - -/* Read a bytecode dump. */ -GCproto *lj_bcread(LexState *ls) -{ - lua_State *L = ls->L; - lua_assert(ls->current == BCDUMP_HEAD1); - bcread_savetop(L, ls, L->top); - lj_str_resetbuf(&ls->sb); - /* Check for a valid bytecode dump header. */ - if (!bcread_header(ls)) - bcread_error(ls, LJ_ERR_BCFMT); - for (;;) { /* Process all prototypes in the bytecode dump. */ - GCproto *pt = bcread_proto(ls); - if (!pt) break; - setprotoV(L, L->top, pt); - incr_top(L); - } - if ((int32_t)ls->n > 0 || L->top-1 != bcread_oldtop(L, ls)) - bcread_error(ls, LJ_ERR_BCBAD); - /* Pop off last prototype. */ - L->top--; - return protoV(L->top); -} - diff --git a/subprojects/luajit/src/lj_bcwrite.c b/subprojects/luajit/src/lj_bcwrite.c deleted file mode 100644 index fae1ebb33..000000000 --- a/subprojects/luajit/src/lj_bcwrite.c +++ /dev/null @@ -1,396 +0,0 @@ -/* -** Bytecode writer. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_bcwrite_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_str.h" -#include "lj_bc.h" -#if LJ_HASFFI -#include "lj_ctype.h" -#endif -#if LJ_HASJIT -#include "lj_dispatch.h" -#include "lj_jit.h" -#endif -#include "lj_bcdump.h" -#include "lj_vm.h" - -/* Context for bytecode writer. */ -typedef struct BCWriteCtx { - SBuf sb; /* Output buffer. */ - lua_State *L; /* Lua state. */ - GCproto *pt; /* Root prototype. */ - lua_Writer wfunc; /* Writer callback. */ - void *wdata; /* Writer callback data. */ - int strip; /* Strip debug info. */ - int status; /* Status from writer callback. */ -} BCWriteCtx; - -/* -- Output buffer handling ---------------------------------------------- */ - -/* Resize buffer if needed. */ -static LJ_NOINLINE void bcwrite_resize(BCWriteCtx *ctx, MSize len) -{ - MSize sz = ctx->sb.sz * 2; - while (ctx->sb.n + len > sz) sz = sz * 2; - lj_str_resizebuf(ctx->L, &ctx->sb, sz); -} - -/* Need a certain amount of buffer space. */ -static LJ_AINLINE void bcwrite_need(BCWriteCtx *ctx, MSize len) -{ - if (LJ_UNLIKELY(ctx->sb.n + len > ctx->sb.sz)) - bcwrite_resize(ctx, len); -} - -/* Add memory block to buffer. */ -static void bcwrite_block(BCWriteCtx *ctx, const void *p, MSize len) -{ - uint8_t *q = (uint8_t *)(ctx->sb.buf + ctx->sb.n); - MSize i; - ctx->sb.n += len; - for (i = 0; i < len; i++) q[i] = ((uint8_t *)p)[i]; -} - -/* Add byte to buffer. */ -static LJ_AINLINE void bcwrite_byte(BCWriteCtx *ctx, uint8_t b) -{ - ctx->sb.buf[ctx->sb.n++] = b; -} - -/* Add ULEB128 value to buffer. */ -static void bcwrite_uleb128(BCWriteCtx *ctx, uint32_t v) -{ - MSize n = ctx->sb.n; - uint8_t *p = (uint8_t *)ctx->sb.buf; - for (; v >= 0x80; v >>= 7) - p[n++] = (uint8_t)((v & 0x7f) | 0x80); - p[n++] = (uint8_t)v; - ctx->sb.n = n; -} - -/* -- Bytecode writer ----------------------------------------------------- */ - -/* Write a single constant key/value of a template table. */ -static void bcwrite_ktabk(BCWriteCtx *ctx, cTValue *o, int narrow) -{ - bcwrite_need(ctx, 1+10); - if (tvisstr(o)) { - const GCstr *str = strV(o); - MSize len = str->len; - bcwrite_need(ctx, 5+len); - bcwrite_uleb128(ctx, BCDUMP_KTAB_STR+len); - bcwrite_block(ctx, strdata(str), len); - } else if (tvisint(o)) { - bcwrite_byte(ctx, BCDUMP_KTAB_INT); - bcwrite_uleb128(ctx, intV(o)); - } else if (tvisnum(o)) { - if (!LJ_DUALNUM && narrow) { /* Narrow number constants to integers. */ - lua_Number num = numV(o); - int32_t k = lj_num2int(num); - if (num == (lua_Number)k) { /* -0 is never a constant. */ - bcwrite_byte(ctx, BCDUMP_KTAB_INT); - bcwrite_uleb128(ctx, k); - return; - } - } - bcwrite_byte(ctx, BCDUMP_KTAB_NUM); - bcwrite_uleb128(ctx, o->u32.lo); - bcwrite_uleb128(ctx, o->u32.hi); - } else { - lua_assert(tvispri(o)); - bcwrite_byte(ctx, BCDUMP_KTAB_NIL+~itype(o)); - } -} - -/* Write a template table. */ -static void bcwrite_ktab(BCWriteCtx *ctx, const GCtab *t) -{ - MSize narray = 0, nhash = 0; - if (t->asize > 0) { /* Determine max. length of array part. */ - ptrdiff_t i; - TValue *array = tvref(t->array); - for (i = (ptrdiff_t)t->asize-1; i >= 0; i--) - if (!tvisnil(&array[i])) - break; - narray = (MSize)(i+1); - } - if (t->hmask > 0) { /* Count number of used hash slots. */ - MSize i, hmask = t->hmask; - Node *node = noderef(t->node); - for (i = 0; i <= hmask; i++) - nhash += !tvisnil(&node[i].val); - } - /* Write number of array slots and hash slots. */ - bcwrite_uleb128(ctx, narray); - bcwrite_uleb128(ctx, nhash); - if (narray) { /* Write array entries (may contain nil). */ - MSize i; - TValue *o = tvref(t->array); - for (i = 0; i < narray; i++, o++) - bcwrite_ktabk(ctx, o, 1); - } - if (nhash) { /* Write hash entries. */ - MSize i = nhash; - Node *node = noderef(t->node) + t->hmask; - for (;; node--) - if (!tvisnil(&node->val)) { - bcwrite_ktabk(ctx, &node->key, 0); - bcwrite_ktabk(ctx, &node->val, 1); - if (--i == 0) break; - } - } -} - -/* Write GC constants of a prototype. */ -static void bcwrite_kgc(BCWriteCtx *ctx, GCproto *pt) -{ - MSize i, sizekgc = pt->sizekgc; - GCRef *kr = mref(pt->k, GCRef) - (ptrdiff_t)sizekgc; - for (i = 0; i < sizekgc; i++, kr++) { - GCobj *o = gcref(*kr); - MSize tp, need = 1; - /* Determine constant type and needed size. */ - if (o->gch.gct == ~LJ_TSTR) { - tp = BCDUMP_KGC_STR + gco2str(o)->len; - need = 5+gco2str(o)->len; - } else if (o->gch.gct == ~LJ_TPROTO) { - lua_assert((pt->flags & PROTO_CHILD)); - tp = BCDUMP_KGC_CHILD; -#if LJ_HASFFI - } else if (o->gch.gct == ~LJ_TCDATA) { - CTypeID id = gco2cd(o)->ctypeid; - need = 1+4*5; - if (id == CTID_INT64) { - tp = BCDUMP_KGC_I64; - } else if (id == CTID_UINT64) { - tp = BCDUMP_KGC_U64; - } else { - lua_assert(id == CTID_COMPLEX_DOUBLE); - tp = BCDUMP_KGC_COMPLEX; - } -#endif - } else { - lua_assert(o->gch.gct == ~LJ_TTAB); - tp = BCDUMP_KGC_TAB; - need = 1+2*5; - } - /* Write constant type. */ - bcwrite_need(ctx, need); - bcwrite_uleb128(ctx, tp); - /* Write constant data (if any). */ - if (tp >= BCDUMP_KGC_STR) { - bcwrite_block(ctx, strdata(gco2str(o)), gco2str(o)->len); - } else if (tp == BCDUMP_KGC_TAB) { - bcwrite_ktab(ctx, gco2tab(o)); -#if LJ_HASFFI - } else if (tp != BCDUMP_KGC_CHILD) { - cTValue *p = (TValue *)cdataptr(gco2cd(o)); - bcwrite_uleb128(ctx, p[0].u32.lo); - bcwrite_uleb128(ctx, p[0].u32.hi); - if (tp == BCDUMP_KGC_COMPLEX) { - bcwrite_uleb128(ctx, p[1].u32.lo); - bcwrite_uleb128(ctx, p[1].u32.hi); - } -#endif - } - } -} - -/* Write number constants of a prototype. */ -static void bcwrite_knum(BCWriteCtx *ctx, GCproto *pt) -{ - MSize i, sizekn = pt->sizekn; - cTValue *o = mref(pt->k, TValue); - bcwrite_need(ctx, 10*sizekn); - for (i = 0; i < sizekn; i++, o++) { - int32_t k; - if (tvisint(o)) { - k = intV(o); - goto save_int; - } else { - /* Write a 33 bit ULEB128 for the int (lsb=0) or loword (lsb=1). */ - if (!LJ_DUALNUM) { /* Narrow number constants to integers. */ - lua_Number num = numV(o); - k = lj_num2int(num); - if (num == (lua_Number)k) { /* -0 is never a constant. */ - save_int: - bcwrite_uleb128(ctx, 2*(uint32_t)k | ((uint32_t)k & 0x80000000u)); - if (k < 0) { - char *p = &ctx->sb.buf[ctx->sb.n-1]; - *p = (*p & 7) | ((k>>27) & 0x18); - } - continue; - } - } - bcwrite_uleb128(ctx, 1+(2*o->u32.lo | (o->u32.lo & 0x80000000u))); - if (o->u32.lo >= 0x80000000u) { - char *p = &ctx->sb.buf[ctx->sb.n-1]; - *p = (*p & 7) | ((o->u32.lo>>27) & 0x18); - } - bcwrite_uleb128(ctx, o->u32.hi); - } - } -} - -/* Write bytecode instructions. */ -static void bcwrite_bytecode(BCWriteCtx *ctx, GCproto *pt) -{ - MSize nbc = pt->sizebc-1; /* Omit the [JI]FUNC* header. */ -#if LJ_HASJIT - uint8_t *p = (uint8_t *)&ctx->sb.buf[ctx->sb.n]; -#endif - bcwrite_block(ctx, proto_bc(pt)+1, nbc*(MSize)sizeof(BCIns)); -#if LJ_HASJIT - /* Unpatch modified bytecode containing ILOOP/JLOOP etc. */ - if ((pt->flags & PROTO_ILOOP) || pt->trace) { - jit_State *J = L2J(ctx->L); - MSize i; - for (i = 0; i < nbc; i++, p += sizeof(BCIns)) { - BCOp op = (BCOp)p[LJ_ENDIAN_SELECT(0, 3)]; - if (op == BC_IFORL || op == BC_IITERL || op == BC_ILOOP || - op == BC_JFORI) { - p[LJ_ENDIAN_SELECT(0, 3)] = (uint8_t)(op-BC_IFORL+BC_FORL); - } else if (op == BC_JFORL || op == BC_JITERL || op == BC_JLOOP) { - BCReg rd = p[LJ_ENDIAN_SELECT(2, 1)] + (p[LJ_ENDIAN_SELECT(3, 0)] << 8); - BCIns ins = traceref(J, rd)->startins; - p[LJ_ENDIAN_SELECT(0, 3)] = (uint8_t)(op-BC_JFORL+BC_FORL); - p[LJ_ENDIAN_SELECT(2, 1)] = bc_c(ins); - p[LJ_ENDIAN_SELECT(3, 0)] = bc_b(ins); - } - } - } -#endif -} - -/* Write prototype. */ -static void bcwrite_proto(BCWriteCtx *ctx, GCproto *pt) -{ - MSize sizedbg = 0; - - /* Recursively write children of prototype. */ - if ((pt->flags & PROTO_CHILD)) { - ptrdiff_t i, n = pt->sizekgc; - GCRef *kr = mref(pt->k, GCRef) - 1; - for (i = 0; i < n; i++, kr--) { - GCobj *o = gcref(*kr); - if (o->gch.gct == ~LJ_TPROTO) - bcwrite_proto(ctx, gco2pt(o)); - } - } - - /* Start writing the prototype info to a buffer. */ - lj_str_resetbuf(&ctx->sb); - ctx->sb.n = 5; /* Leave room for final size. */ - bcwrite_need(ctx, 4+6*5+(pt->sizebc-1)*(MSize)sizeof(BCIns)+pt->sizeuv*2); - - /* Write prototype header. */ - bcwrite_byte(ctx, (pt->flags & (PROTO_CHILD|PROTO_VARARG|PROTO_FFI))); - bcwrite_byte(ctx, pt->numparams); - bcwrite_byte(ctx, pt->framesize); - bcwrite_byte(ctx, pt->sizeuv); - bcwrite_uleb128(ctx, pt->sizekgc); - bcwrite_uleb128(ctx, pt->sizekn); - bcwrite_uleb128(ctx, pt->sizebc-1); - if (!ctx->strip) { - if (proto_lineinfo(pt)) - sizedbg = pt->sizept - (MSize)((char *)proto_lineinfo(pt) - (char *)pt); - bcwrite_uleb128(ctx, sizedbg); - if (sizedbg) { - bcwrite_uleb128(ctx, pt->firstline); - bcwrite_uleb128(ctx, pt->numline); - } - } - - /* Write bytecode instructions and upvalue refs. */ - bcwrite_bytecode(ctx, pt); - bcwrite_block(ctx, proto_uv(pt), pt->sizeuv*2); - - /* Write constants. */ - bcwrite_kgc(ctx, pt); - bcwrite_knum(ctx, pt); - - /* Write debug info, if not stripped. */ - if (sizedbg) { - bcwrite_need(ctx, sizedbg); - bcwrite_block(ctx, proto_lineinfo(pt), sizedbg); - } - - /* Pass buffer to writer function. */ - if (ctx->status == 0) { - MSize n = ctx->sb.n - 5; - MSize nn = (lj_fls(n)+8)*9 >> 6; - ctx->sb.n = 5 - nn; - bcwrite_uleb128(ctx, n); /* Fill in final size. */ - lua_assert(ctx->sb.n == 5); - ctx->status = ctx->wfunc(ctx->L, ctx->sb.buf+5-nn, nn+n, ctx->wdata); - } -} - -/* Write header of bytecode dump. */ -static void bcwrite_header(BCWriteCtx *ctx) -{ - GCstr *chunkname = proto_chunkname(ctx->pt); - const char *name = strdata(chunkname); - MSize len = chunkname->len; - lj_str_resetbuf(&ctx->sb); - bcwrite_need(ctx, 5+5+len); - bcwrite_byte(ctx, BCDUMP_HEAD1); - bcwrite_byte(ctx, BCDUMP_HEAD2); - bcwrite_byte(ctx, BCDUMP_HEAD3); - bcwrite_byte(ctx, BCDUMP_VERSION); - bcwrite_byte(ctx, (ctx->strip ? BCDUMP_F_STRIP : 0) + - (LJ_BE ? BCDUMP_F_BE : 0) + - ((ctx->pt->flags & PROTO_FFI) ? BCDUMP_F_FFI : 0)); - if (!ctx->strip) { - bcwrite_uleb128(ctx, len); - bcwrite_block(ctx, name, len); - } - ctx->status = ctx->wfunc(ctx->L, ctx->sb.buf, ctx->sb.n, ctx->wdata); -} - -/* Write footer of bytecode dump. */ -static void bcwrite_footer(BCWriteCtx *ctx) -{ - if (ctx->status == 0) { - uint8_t zero = 0; - ctx->status = ctx->wfunc(ctx->L, &zero, 1, ctx->wdata); - } -} - -/* Protected callback for bytecode writer. */ -static TValue *cpwriter(lua_State *L, lua_CFunction dummy, void *ud) -{ - BCWriteCtx *ctx = (BCWriteCtx *)ud; - UNUSED(dummy); - lj_str_resizebuf(L, &ctx->sb, 1024); /* Avoids resize for most prototypes. */ - bcwrite_header(ctx); - bcwrite_proto(ctx, ctx->pt); - bcwrite_footer(ctx); - return NULL; -} - -/* Write bytecode for a prototype. */ -int lj_bcwrite(lua_State *L, GCproto *pt, lua_Writer writer, void *data, - int strip) -{ - BCWriteCtx ctx; - int status; - ctx.L = L; - ctx.pt = pt; - ctx.wfunc = writer; - ctx.wdata = data; - ctx.strip = strip; - ctx.status = 0; - lj_str_initbuf(&ctx.sb); - status = lj_vm_cpcall(L, NULL, &ctx, cpwriter); - if (status == 0) status = ctx.status; - lj_str_freebuf(G(ctx.L), &ctx.sb); - return status; -} - diff --git a/subprojects/luajit/src/lj_carith.c b/subprojects/luajit/src/lj_carith.c deleted file mode 100644 index 6224dee62..000000000 --- a/subprojects/luajit/src/lj_carith.c +++ /dev/null @@ -1,353 +0,0 @@ -/* -** C data arithmetic. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include "lj_obj.h" - -#if LJ_HASFFI - -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_tab.h" -#include "lj_meta.h" -#include "lj_ctype.h" -#include "lj_cconv.h" -#include "lj_cdata.h" -#include "lj_carith.h" - -/* -- C data arithmetic --------------------------------------------------- */ - -/* Binary operands of an operator converted to ctypes. */ -typedef struct CDArith { - uint8_t *p[2]; - CType *ct[2]; -} CDArith; - -/* Check arguments for arithmetic metamethods. */ -static int carith_checkarg(lua_State *L, CTState *cts, CDArith *ca) -{ - TValue *o = L->base; - int ok = 1; - MSize i; - if (o+1 >= L->top) - lj_err_argt(L, 1, LUA_TCDATA); - for (i = 0; i < 2; i++, o++) { - if (tviscdata(o)) { - GCcdata *cd = cdataV(o); - CTypeID id = (CTypeID)cd->ctypeid; - CType *ct = ctype_raw(cts, id); - uint8_t *p = (uint8_t *)cdataptr(cd); - if (ctype_isptr(ct->info)) { - p = (uint8_t *)cdata_getptr(p, ct->size); - if (ctype_isref(ct->info)) ct = ctype_rawchild(cts, ct); - } else if (ctype_isfunc(ct->info)) { - p = (uint8_t *)*(void **)p; - ct = ctype_get(cts, - lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|id), CTSIZE_PTR)); - } - if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); - ca->ct[i] = ct; - ca->p[i] = p; - } else if (tvisint(o)) { - ca->ct[i] = ctype_get(cts, CTID_INT32); - ca->p[i] = (uint8_t *)&o->i; - } else if (tvisnum(o)) { - ca->ct[i] = ctype_get(cts, CTID_DOUBLE); - ca->p[i] = (uint8_t *)&o->n; - } else if (tvisnil(o)) { - ca->ct[i] = ctype_get(cts, CTID_P_VOID); - ca->p[i] = (uint8_t *)0; - } else if (tvisstr(o)) { - TValue *o2 = i == 0 ? o+1 : o-1; - CType *ct = ctype_raw(cts, cdataV(o2)->ctypeid); - ca->ct[i] = NULL; - ca->p[i] = (uint8_t *)strVdata(o); - ok = 0; - if (ctype_isenum(ct->info)) { - CTSize ofs; - CType *cct = lj_ctype_getfield(cts, ct, strV(o), &ofs); - if (cct && ctype_isconstval(cct->info)) { - ca->ct[i] = ctype_child(cts, cct); - ca->p[i] = (uint8_t *)&cct->size; /* Assumes ct does not grow. */ - ok = 1; - } else { - ca->ct[1-i] = ct; /* Use enum to improve error message. */ - ca->p[1-i] = NULL; - break; - } - } - } else { - ca->ct[i] = NULL; - ca->p[i] = (void *)(intptr_t)1; /* To make it unequal. */ - ok = 0; - } - } - return ok; -} - -/* Pointer arithmetic. */ -static int carith_ptr(lua_State *L, CTState *cts, CDArith *ca, MMS mm) -{ - CType *ctp = ca->ct[0]; - uint8_t *pp = ca->p[0]; - ptrdiff_t idx; - CTSize sz; - CTypeID id; - GCcdata *cd; - if (ctype_isptr(ctp->info) || ctype_isrefarray(ctp->info)) { - if ((mm == MM_sub || mm == MM_eq || mm == MM_lt || mm == MM_le) && - (ctype_isptr(ca->ct[1]->info) || ctype_isrefarray(ca->ct[1]->info))) { - uint8_t *pp2 = ca->p[1]; - if (mm == MM_eq) { /* Pointer equality. Incompatible pointers are ok. */ - setboolV(L->top-1, (pp == pp2)); - return 1; - } - if (!lj_cconv_compatptr(cts, ctp, ca->ct[1], CCF_IGNQUAL)) - return 0; - if (mm == MM_sub) { /* Pointer difference. */ - intptr_t diff; - sz = lj_ctype_size(cts, ctype_cid(ctp->info)); /* Element size. */ - if (sz == 0 || sz == CTSIZE_INVALID) - return 0; - diff = ((intptr_t)pp - (intptr_t)pp2) / (int32_t)sz; - /* All valid pointer differences on x64 are in (-2^47, +2^47), - ** which fits into a double without loss of precision. - */ - setintptrV(L->top-1, (int32_t)diff); - return 1; - } else if (mm == MM_lt) { /* Pointer comparison (unsigned). */ - setboolV(L->top-1, ((uintptr_t)pp < (uintptr_t)pp2)); - return 1; - } else { - lua_assert(mm == MM_le); - setboolV(L->top-1, ((uintptr_t)pp <= (uintptr_t)pp2)); - return 1; - } - } - if (!((mm == MM_add || mm == MM_sub) && ctype_isnum(ca->ct[1]->info))) - return 0; - lj_cconv_ct_ct(cts, ctype_get(cts, CTID_INT_PSZ), ca->ct[1], - (uint8_t *)&idx, ca->p[1], 0); - if (mm == MM_sub) idx = -idx; - } else if (mm == MM_add && ctype_isnum(ctp->info) && - (ctype_isptr(ca->ct[1]->info) || ctype_isrefarray(ca->ct[1]->info))) { - /* Swap pointer and index. */ - ctp = ca->ct[1]; pp = ca->p[1]; - lj_cconv_ct_ct(cts, ctype_get(cts, CTID_INT_PSZ), ca->ct[0], - (uint8_t *)&idx, ca->p[0], 0); - } else { - return 0; - } - sz = lj_ctype_size(cts, ctype_cid(ctp->info)); /* Element size. */ - if (sz == CTSIZE_INVALID) - return 0; - pp += idx*(int32_t)sz; /* Compute pointer + index. */ - id = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|ctype_cid(ctp->info)), - CTSIZE_PTR); - cd = lj_cdata_new(cts, id, CTSIZE_PTR); - *(uint8_t **)cdataptr(cd) = pp; - setcdataV(L, L->top-1, cd); - lj_gc_check(L); - return 1; -} - -/* 64 bit integer arithmetic. */ -static int carith_int64(lua_State *L, CTState *cts, CDArith *ca, MMS mm) -{ - if (ctype_isnum(ca->ct[0]->info) && ca->ct[0]->size <= 8 && - ctype_isnum(ca->ct[1]->info) && ca->ct[1]->size <= 8) { - CTypeID id = (((ca->ct[0]->info & CTF_UNSIGNED) && ca->ct[0]->size == 8) || - ((ca->ct[1]->info & CTF_UNSIGNED) && ca->ct[1]->size == 8)) ? - CTID_UINT64 : CTID_INT64; - CType *ct = ctype_get(cts, id); - GCcdata *cd; - uint64_t u0, u1, *up; - lj_cconv_ct_ct(cts, ct, ca->ct[0], (uint8_t *)&u0, ca->p[0], 0); - if (mm != MM_unm) - lj_cconv_ct_ct(cts, ct, ca->ct[1], (uint8_t *)&u1, ca->p[1], 0); - switch (mm) { - case MM_eq: - setboolV(L->top-1, (u0 == u1)); - return 1; - case MM_lt: - setboolV(L->top-1, - id == CTID_INT64 ? ((int64_t)u0 < (int64_t)u1) : (u0 < u1)); - return 1; - case MM_le: - setboolV(L->top-1, - id == CTID_INT64 ? ((int64_t)u0 <= (int64_t)u1) : (u0 <= u1)); - return 1; - default: break; - } - cd = lj_cdata_new(cts, id, 8); - up = (uint64_t *)cdataptr(cd); - setcdataV(L, L->top-1, cd); - switch (mm) { - case MM_add: *up = u0 + u1; break; - case MM_sub: *up = u0 - u1; break; - case MM_mul: *up = u0 * u1; break; - case MM_div: - if (id == CTID_INT64) - *up = (uint64_t)lj_carith_divi64((int64_t)u0, (int64_t)u1); - else - *up = lj_carith_divu64(u0, u1); - break; - case MM_mod: - if (id == CTID_INT64) - *up = (uint64_t)lj_carith_modi64((int64_t)u0, (int64_t)u1); - else - *up = lj_carith_modu64(u0, u1); - break; - case MM_pow: - if (id == CTID_INT64) - *up = (uint64_t)lj_carith_powi64((int64_t)u0, (int64_t)u1); - else - *up = lj_carith_powu64(u0, u1); - break; - case MM_unm: *up = (uint64_t)-(int64_t)u0; break; - default: lua_assert(0); break; - } - lj_gc_check(L); - return 1; - } - return 0; -} - -/* Handle ctype arithmetic metamethods. */ -static int lj_carith_meta(lua_State *L, CTState *cts, CDArith *ca, MMS mm) -{ - cTValue *tv = NULL; - if (tviscdata(L->base)) { - CTypeID id = cdataV(L->base)->ctypeid; - CType *ct = ctype_raw(cts, id); - if (ctype_isptr(ct->info)) id = ctype_cid(ct->info); - tv = lj_ctype_meta(cts, id, mm); - } - if (!tv && L->base+1 < L->top && tviscdata(L->base+1)) { - CTypeID id = cdataV(L->base+1)->ctypeid; - CType *ct = ctype_raw(cts, id); - if (ctype_isptr(ct->info)) id = ctype_cid(ct->info); - tv = lj_ctype_meta(cts, id, mm); - } - if (!tv) { - const char *repr[2]; - int i, isenum = -1, isstr = -1; - if (mm == MM_eq) { /* Equality checks never raise an error. */ - int eq = ca->p[0] == ca->p[1]; - setboolV(L->top-1, eq); - setboolV(&G(L)->tmptv2, eq); /* Remember for trace recorder. */ - return 1; - } - for (i = 0; i < 2; i++) { - if (ca->ct[i] && tviscdata(L->base+i)) { - if (ctype_isenum(ca->ct[i]->info)) isenum = i; - repr[i] = strdata(lj_ctype_repr(L, ctype_typeid(cts, ca->ct[i]), NULL)); - } else { - if (tvisstr(&L->base[i])) isstr = i; - repr[i] = lj_typename(&L->base[i]); - } - } - if ((isenum ^ isstr) == 1) - lj_err_callerv(L, LJ_ERR_FFI_BADCONV, repr[isstr], repr[isenum]); - lj_err_callerv(L, mm == MM_len ? LJ_ERR_FFI_BADLEN : - mm == MM_concat ? LJ_ERR_FFI_BADCONCAT : - mm < MM_add ? LJ_ERR_FFI_BADCOMP : LJ_ERR_FFI_BADARITH, - repr[0], repr[1]); - } - return lj_meta_tailcall(L, tv); -} - -/* Arithmetic operators for cdata. */ -int lj_carith_op(lua_State *L, MMS mm) -{ - CTState *cts = ctype_cts(L); - CDArith ca; - if (carith_checkarg(L, cts, &ca)) { - if (carith_int64(L, cts, &ca, mm) || carith_ptr(L, cts, &ca, mm)) { - copyTV(L, &G(L)->tmptv2, L->top-1); /* Remember for trace recorder. */ - return 1; - } - } - return lj_carith_meta(L, cts, &ca, mm); -} - -/* -- 64 bit integer arithmetic helpers ----------------------------------- */ - -#if LJ_32 && LJ_HASJIT -/* Signed/unsigned 64 bit multiplication. */ -int64_t lj_carith_mul64(int64_t a, int64_t b) -{ - return a * b; -} -#endif - -/* Unsigned 64 bit division. */ -uint64_t lj_carith_divu64(uint64_t a, uint64_t b) -{ - if (b == 0) return U64x(80000000,00000000); - return a / b; -} - -/* Signed 64 bit division. */ -int64_t lj_carith_divi64(int64_t a, int64_t b) -{ - if (b == 0 || (a == (int64_t)U64x(80000000,00000000) && b == -1)) - return U64x(80000000,00000000); - return a / b; -} - -/* Unsigned 64 bit modulo. */ -uint64_t lj_carith_modu64(uint64_t a, uint64_t b) -{ - if (b == 0) return U64x(80000000,00000000); - return a % b; -} - -/* Signed 64 bit modulo. */ -int64_t lj_carith_modi64(int64_t a, int64_t b) -{ - if (b == 0) return U64x(80000000,00000000); - if (a == (int64_t)U64x(80000000,00000000) && b == -1) return 0; - return a % b; -} - -/* Unsigned 64 bit x^k. */ -uint64_t lj_carith_powu64(uint64_t x, uint64_t k) -{ - uint64_t y; - if (k == 0) - return 1; - for (; (k & 1) == 0; k >>= 1) x *= x; - y = x; - if ((k >>= 1) != 0) { - for (;;) { - x *= x; - if (k == 1) break; - if (k & 1) y *= x; - k >>= 1; - } - y *= x; - } - return y; -} - -/* Signed 64 bit x^k. */ -int64_t lj_carith_powi64(int64_t x, int64_t k) -{ - if (k == 0) - return 1; - if (k < 0) { - if (x == 0) - return U64x(7fffffff,ffffffff); - else if (x == 1) - return 1; - else if (x == -1) - return (k & 1) ? -1 : 1; - else - return 0; - } - return (int64_t)lj_carith_powu64((uint64_t)x, (uint64_t)k); -} - -#endif diff --git a/subprojects/luajit/src/lj_carith.h b/subprojects/luajit/src/lj_carith.h deleted file mode 100644 index 3c1559107..000000000 --- a/subprojects/luajit/src/lj_carith.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -** C data arithmetic. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_CARITH_H -#define _LJ_CARITH_H - -#include "lj_obj.h" - -#if LJ_HASFFI - -LJ_FUNC int lj_carith_op(lua_State *L, MMS mm); - -#if LJ_32 && LJ_HASJIT -LJ_FUNC int64_t lj_carith_mul64(int64_t x, int64_t k); -#endif -LJ_FUNC uint64_t lj_carith_divu64(uint64_t a, uint64_t b); -LJ_FUNC int64_t lj_carith_divi64(int64_t a, int64_t b); -LJ_FUNC uint64_t lj_carith_modu64(uint64_t a, uint64_t b); -LJ_FUNC int64_t lj_carith_modi64(int64_t a, int64_t b); -LJ_FUNC uint64_t lj_carith_powu64(uint64_t x, uint64_t k); -LJ_FUNC int64_t lj_carith_powi64(int64_t x, int64_t k); - -#endif - -#endif diff --git a/subprojects/luajit/src/lj_ccall.c b/subprojects/luajit/src/lj_ccall.c deleted file mode 100644 index 65076e776..000000000 --- a/subprojects/luajit/src/lj_ccall.c +++ /dev/null @@ -1,900 +0,0 @@ -/* -** FFI C call handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include "lj_obj.h" - -#if LJ_HASFFI - -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_ctype.h" -#include "lj_cconv.h" -#include "lj_cdata.h" -#include "lj_ccall.h" -#include "lj_trace.h" - -/* Target-specific handling of register arguments. */ -#if LJ_TARGET_X86 -/* -- x86 calling conventions --------------------------------------------- */ - -#if LJ_ABI_WIN - -#define CCALL_HANDLE_STRUCTRET \ - /* Return structs bigger than 8 by reference (on stack only). */ \ - cc->retref = (sz > 8); \ - if (cc->retref) cc->stack[nsp++] = (GPRArg)dp; - -#define CCALL_HANDLE_COMPLEXRET CCALL_HANDLE_STRUCTRET - -#else - -#if LJ_TARGET_OSX - -#define CCALL_HANDLE_STRUCTRET \ - /* Return structs of size 1, 2, 4 or 8 in registers. */ \ - cc->retref = !(sz == 1 || sz == 2 || sz == 4 || sz == 8); \ - if (cc->retref) { \ - if (ngpr < maxgpr) \ - cc->gpr[ngpr++] = (GPRArg)dp; \ - else \ - cc->stack[nsp++] = (GPRArg)dp; \ - } else { /* Struct with single FP field ends up in FPR. */ \ - cc->resx87 = ccall_classify_struct(cts, ctr); \ - } - -#define CCALL_HANDLE_STRUCTRET2 \ - if (cc->resx87) sp = (uint8_t *)&cc->fpr[0]; \ - memcpy(dp, sp, ctr->size); - -#else - -#define CCALL_HANDLE_STRUCTRET \ - cc->retref = 1; /* Return all structs by reference (in reg or on stack). */ \ - if (ngpr < maxgpr) \ - cc->gpr[ngpr++] = (GPRArg)dp; \ - else \ - cc->stack[nsp++] = (GPRArg)dp; - -#endif - -#define CCALL_HANDLE_COMPLEXRET \ - /* Return complex float in GPRs and complex double by reference. */ \ - cc->retref = (sz > 8); \ - if (cc->retref) { \ - if (ngpr < maxgpr) \ - cc->gpr[ngpr++] = (GPRArg)dp; \ - else \ - cc->stack[nsp++] = (GPRArg)dp; \ - } - -#endif - -#define CCALL_HANDLE_COMPLEXRET2 \ - if (!cc->retref) \ - *(int64_t *)dp = *(int64_t *)sp; /* Copy complex float from GPRs. */ - -#define CCALL_HANDLE_STRUCTARG \ - ngpr = maxgpr; /* Pass all structs by value on the stack. */ - -#define CCALL_HANDLE_COMPLEXARG \ - isfp = 1; /* Pass complex by value on stack. */ - -#define CCALL_HANDLE_REGARG \ - if (!isfp) { /* Only non-FP values may be passed in registers. */ \ - if (n > 1) { /* Anything > 32 bit is passed on the stack. */ \ - if (!LJ_ABI_WIN) ngpr = maxgpr; /* Prevent reordering. */ \ - } else if (ngpr + 1 <= maxgpr) { \ - dp = &cc->gpr[ngpr]; \ - ngpr += n; \ - goto done; \ - } \ - } - -#elif LJ_TARGET_X64 && LJ_ABI_WIN -/* -- Windows/x64 calling conventions ------------------------------------- */ - -#define CCALL_HANDLE_STRUCTRET \ - /* Return structs of size 1, 2, 4 or 8 in a GPR. */ \ - cc->retref = !(sz == 1 || sz == 2 || sz == 4 || sz == 8); \ - if (cc->retref) cc->gpr[ngpr++] = (GPRArg)dp; - -#define CCALL_HANDLE_COMPLEXRET CCALL_HANDLE_STRUCTRET - -#define CCALL_HANDLE_COMPLEXRET2 \ - if (!cc->retref) \ - *(int64_t *)dp = *(int64_t *)sp; /* Copy complex float from GPRs. */ - -#define CCALL_HANDLE_STRUCTARG \ - /* Pass structs of size 1, 2, 4 or 8 in a GPR by value. */ \ - if (!(sz == 1 || sz == 2 || sz == 4 || sz == 8)) { \ - rp = cdataptr(lj_cdata_new(cts, did, sz)); \ - sz = CTSIZE_PTR; /* Pass all other structs by reference. */ \ - } - -#define CCALL_HANDLE_COMPLEXARG \ - /* Pass complex float in a GPR and complex double by reference. */ \ - if (sz != 2*sizeof(float)) { \ - rp = cdataptr(lj_cdata_new(cts, did, sz)); \ - sz = CTSIZE_PTR; \ - } - -/* Windows/x64 argument registers are strictly positional (use ngpr). */ -#define CCALL_HANDLE_REGARG \ - if (isfp) { \ - if (ngpr < maxgpr) { dp = &cc->fpr[ngpr++]; nfpr = ngpr; goto done; } \ - } else { \ - if (ngpr < maxgpr) { dp = &cc->gpr[ngpr++]; goto done; } \ - } - -#elif LJ_TARGET_X64 -/* -- POSIX/x64 calling conventions --------------------------------------- */ - -#define CCALL_HANDLE_STRUCTRET \ - int rcl[2]; rcl[0] = rcl[1] = 0; \ - if (ccall_classify_struct(cts, ctr, rcl, 0)) { \ - cc->retref = 1; /* Return struct by reference. */ \ - cc->gpr[ngpr++] = (GPRArg)dp; \ - } else { \ - cc->retref = 0; /* Return small structs in registers. */ \ - } - -#define CCALL_HANDLE_STRUCTRET2 \ - int rcl[2]; rcl[0] = rcl[1] = 0; \ - ccall_classify_struct(cts, ctr, rcl, 0); \ - ccall_struct_ret(cc, rcl, dp, ctr->size); - -#define CCALL_HANDLE_COMPLEXRET \ - /* Complex values are returned in one or two FPRs. */ \ - cc->retref = 0; - -#define CCALL_HANDLE_COMPLEXRET2 \ - if (ctr->size == 2*sizeof(float)) { /* Copy complex float from FPR. */ \ - *(int64_t *)dp = cc->fpr[0].l[0]; \ - } else { /* Copy non-contiguous complex double from FPRs. */ \ - ((int64_t *)dp)[0] = cc->fpr[0].l[0]; \ - ((int64_t *)dp)[1] = cc->fpr[1].l[0]; \ - } - -#define CCALL_HANDLE_STRUCTARG \ - int rcl[2]; rcl[0] = rcl[1] = 0; \ - if (!ccall_classify_struct(cts, d, rcl, 0)) { \ - cc->nsp = nsp; cc->ngpr = ngpr; cc->nfpr = nfpr; \ - if (ccall_struct_arg(cc, cts, d, rcl, o, narg)) goto err_nyi; \ - nsp = cc->nsp; ngpr = cc->ngpr; nfpr = cc->nfpr; \ - continue; \ - } /* Pass all other structs by value on stack. */ - -#define CCALL_HANDLE_COMPLEXARG \ - isfp = 2; /* Pass complex in FPRs or on stack. Needs postprocessing. */ - -#define CCALL_HANDLE_REGARG \ - if (isfp) { /* Try to pass argument in FPRs. */ \ - int n2 = ctype_isvector(d->info) ? 1 : n; \ - if (nfpr + n2 <= CCALL_NARG_FPR) { \ - dp = &cc->fpr[nfpr]; \ - nfpr += n2; \ - goto done; \ - } \ - } else { /* Try to pass argument in GPRs. */ \ - /* Note that reordering is explicitly allowed in the x64 ABI. */ \ - if (n <= 2 && ngpr + n <= maxgpr) { \ - dp = &cc->gpr[ngpr]; \ - ngpr += n; \ - goto done; \ - } \ - } - -#elif LJ_TARGET_ARM -/* -- ARM calling conventions --------------------------------------------- */ - -#if LJ_ABI_SOFTFP - -#define CCALL_HANDLE_STRUCTRET \ - /* Return structs of size <= 4 in a GPR. */ \ - cc->retref = !(sz <= 4); \ - if (cc->retref) cc->gpr[ngpr++] = (GPRArg)dp; - -#define CCALL_HANDLE_COMPLEXRET \ - cc->retref = 1; /* Return all complex values by reference. */ \ - cc->gpr[ngpr++] = (GPRArg)dp; - -#define CCALL_HANDLE_COMPLEXRET2 \ - UNUSED(dp); /* Nothing to do. */ - -#define CCALL_HANDLE_STRUCTARG \ - /* Pass all structs by value in registers and/or on the stack. */ - -#define CCALL_HANDLE_COMPLEXARG \ - /* Pass complex by value in 2 or 4 GPRs. */ - -#define CCALL_HANDLE_REGARG_FP1 -#define CCALL_HANDLE_REGARG_FP2 - -#else - -#define CCALL_HANDLE_STRUCTRET \ - cc->retref = !ccall_classify_struct(cts, ctr, ct); \ - if (cc->retref) cc->gpr[ngpr++] = (GPRArg)dp; - -#define CCALL_HANDLE_STRUCTRET2 \ - if (ccall_classify_struct(cts, ctr, ct) > 1) sp = (uint8_t *)&cc->fpr[0]; \ - memcpy(dp, sp, ctr->size); - -#define CCALL_HANDLE_COMPLEXRET \ - if (!(ct->info & CTF_VARARG)) cc->retref = 0; /* Return complex in FPRs. */ - -#define CCALL_HANDLE_COMPLEXRET2 \ - if (!(ct->info & CTF_VARARG)) memcpy(dp, &cc->fpr[0], ctr->size); - -#define CCALL_HANDLE_STRUCTARG \ - isfp = (ccall_classify_struct(cts, d, ct) > 1); - /* Pass all structs by value in registers and/or on the stack. */ - -#define CCALL_HANDLE_COMPLEXARG \ - isfp = 1; /* Pass complex by value in FPRs or on stack. */ - -#define CCALL_HANDLE_REGARG_FP1 \ - if (isfp && !(ct->info & CTF_VARARG)) { \ - if ((d->info & CTF_ALIGN) > CTALIGN_PTR) { \ - if (nfpr + (n >> 1) <= CCALL_NARG_FPR) { \ - dp = &cc->fpr[nfpr]; \ - nfpr += (n >> 1); \ - goto done; \ - } \ - } else { \ - if (sz > 1 && fprodd != nfpr) fprodd = 0; \ - if (fprodd) { \ - if (2*nfpr+n <= 2*CCALL_NARG_FPR+1) { \ - dp = (void *)&cc->fpr[fprodd-1].f[1]; \ - nfpr += (n >> 1); \ - if ((n & 1)) fprodd = 0; else fprodd = nfpr-1; \ - goto done; \ - } \ - } else { \ - if (2*nfpr+n <= 2*CCALL_NARG_FPR) { \ - dp = (void *)&cc->fpr[nfpr]; \ - nfpr += (n >> 1); \ - if ((n & 1)) fprodd = ++nfpr; else fprodd = 0; \ - goto done; \ - } \ - } \ - } \ - fprodd = 0; /* No reordering after the first FP value is on stack. */ \ - } else { - -#define CCALL_HANDLE_REGARG_FP2 } - -#endif - -#define CCALL_HANDLE_REGARG \ - CCALL_HANDLE_REGARG_FP1 \ - if ((d->info & CTF_ALIGN) > CTALIGN_PTR) { \ - if (ngpr < maxgpr) \ - ngpr = (ngpr + 1u) & ~1u; /* Align to regpair. */ \ - } \ - if (ngpr < maxgpr) { \ - dp = &cc->gpr[ngpr]; \ - if (ngpr + n > maxgpr) { \ - nsp += ngpr + n - maxgpr; /* Assumes contiguous gpr/stack fields. */ \ - if (nsp > CCALL_MAXSTACK) goto err_nyi; /* Too many arguments. */ \ - ngpr = maxgpr; \ - } else { \ - ngpr += n; \ - } \ - goto done; \ - } CCALL_HANDLE_REGARG_FP2 - -#define CCALL_HANDLE_RET \ - if ((ct->info & CTF_VARARG)) sp = (uint8_t *)&cc->gpr[0]; - -#elif LJ_TARGET_PPC -/* -- PPC calling conventions --------------------------------------------- */ - -#define CCALL_HANDLE_STRUCTRET \ - cc->retref = 1; /* Return all structs by reference. */ \ - cc->gpr[ngpr++] = (GPRArg)dp; - -#define CCALL_HANDLE_COMPLEXRET \ - /* Complex values are returned in 2 or 4 GPRs. */ \ - cc->retref = 0; - -#define CCALL_HANDLE_COMPLEXRET2 \ - memcpy(dp, sp, ctr->size); /* Copy complex from GPRs. */ - -#define CCALL_HANDLE_STRUCTARG \ - rp = cdataptr(lj_cdata_new(cts, did, sz)); \ - sz = CTSIZE_PTR; /* Pass all structs by reference. */ - -#define CCALL_HANDLE_COMPLEXARG \ - /* Pass complex by value in 2 or 4 GPRs. */ - -#define CCALL_HANDLE_REGARG \ - if (isfp) { /* Try to pass argument in FPRs. */ \ - if (nfpr + 1 <= CCALL_NARG_FPR) { \ - dp = &cc->fpr[nfpr]; \ - nfpr += 1; \ - d = ctype_get(cts, CTID_DOUBLE); /* FPRs always hold doubles. */ \ - goto done; \ - } \ - } else { /* Try to pass argument in GPRs. */ \ - if (n > 1) { \ - lua_assert(n == 2 || n == 4); /* int64_t or complex (float). */ \ - if (ctype_isinteger(d->info)) \ - ngpr = (ngpr + 1u) & ~1u; /* Align int64_t to regpair. */ \ - else if (ngpr + n > maxgpr) \ - ngpr = maxgpr; /* Prevent reordering. */ \ - } \ - if (ngpr + n <= maxgpr) { \ - dp = &cc->gpr[ngpr]; \ - ngpr += n; \ - goto done; \ - } \ - } - -#define CCALL_HANDLE_RET \ - if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \ - ctr = ctype_get(cts, CTID_DOUBLE); /* FPRs always hold doubles. */ - -#elif LJ_TARGET_PPCSPE -/* -- PPC/SPE calling conventions ----------------------------------------- */ - -#define CCALL_HANDLE_STRUCTRET \ - cc->retref = 1; /* Return all structs by reference. */ \ - cc->gpr[ngpr++] = (GPRArg)dp; - -#define CCALL_HANDLE_COMPLEXRET \ - /* Complex values are returned in 2 or 4 GPRs. */ \ - cc->retref = 0; - -#define CCALL_HANDLE_COMPLEXRET2 \ - memcpy(dp, sp, ctr->size); /* Copy complex from GPRs. */ - -#define CCALL_HANDLE_STRUCTARG \ - rp = cdataptr(lj_cdata_new(cts, did, sz)); \ - sz = CTSIZE_PTR; /* Pass all structs by reference. */ - -#define CCALL_HANDLE_COMPLEXARG \ - /* Pass complex by value in 2 or 4 GPRs. */ - -/* PPC/SPE has a softfp ABI. */ -#define CCALL_HANDLE_REGARG \ - if (n > 1) { /* Doesn't fit in a single GPR? */ \ - lua_assert(n == 2 || n == 4); /* int64_t, double or complex (float). */ \ - if (n == 2) \ - ngpr = (ngpr + 1u) & ~1u; /* Only align 64 bit value to regpair. */ \ - else if (ngpr + n > maxgpr) \ - ngpr = maxgpr; /* Prevent reordering. */ \ - } \ - if (ngpr + n <= maxgpr) { \ - dp = &cc->gpr[ngpr]; \ - ngpr += n; \ - goto done; \ - } - -#elif LJ_TARGET_MIPS -/* -- MIPS calling conventions -------------------------------------------- */ - -#define CCALL_HANDLE_STRUCTRET \ - cc->retref = 1; /* Return all structs by reference. */ \ - cc->gpr[ngpr++] = (GPRArg)dp; - -#define CCALL_HANDLE_COMPLEXRET \ - /* Complex values are returned in 1 or 2 FPRs. */ \ - cc->retref = 0; - -#define CCALL_HANDLE_COMPLEXRET2 \ - if (ctr->size == 2*sizeof(float)) { /* Copy complex float from FPRs. */ \ - ((float *)dp)[0] = cc->fpr[0].f; \ - ((float *)dp)[1] = cc->fpr[1].f; \ - } else { /* Copy complex double from FPRs. */ \ - ((double *)dp)[0] = cc->fpr[0].d; \ - ((double *)dp)[1] = cc->fpr[1].d; \ - } - -#define CCALL_HANDLE_STRUCTARG \ - /* Pass all structs by value in registers and/or on the stack. */ - -#define CCALL_HANDLE_COMPLEXARG \ - /* Pass complex by value in 2 or 4 GPRs. */ - -#define CCALL_HANDLE_REGARG \ - if (isfp && nfpr < CCALL_NARG_FPR && !(ct->info & CTF_VARARG)) { \ - /* Try to pass argument in FPRs. */ \ - dp = n == 1 ? (void *)&cc->fpr[nfpr].f : (void *)&cc->fpr[nfpr].d; \ - nfpr++; ngpr += n; \ - goto done; \ - } else { /* Try to pass argument in GPRs. */ \ - nfpr = CCALL_NARG_FPR; \ - if ((d->info & CTF_ALIGN) > CTALIGN_PTR) \ - ngpr = (ngpr + 1u) & ~1u; /* Align to regpair. */ \ - if (ngpr < maxgpr) { \ - dp = &cc->gpr[ngpr]; \ - if (ngpr + n > maxgpr) { \ - nsp += ngpr + n - maxgpr; /* Assumes contiguous gpr/stack fields. */ \ - if (nsp > CCALL_MAXSTACK) goto err_nyi; /* Too many arguments. */ \ - ngpr = maxgpr; \ - } else { \ - ngpr += n; \ - } \ - goto done; \ - } \ - } - -#define CCALL_HANDLE_RET \ - if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \ - sp = (uint8_t *)&cc->fpr[0].f; - -#else -#error "Missing calling convention definitions for this architecture" -#endif - -#ifndef CCALL_HANDLE_STRUCTRET2 -#define CCALL_HANDLE_STRUCTRET2 \ - memcpy(dp, sp, ctr->size); /* Copy struct return value from GPRs. */ -#endif - -/* -- x86 OSX ABI struct classification ----------------------------------- */ - -#if LJ_TARGET_X86 && LJ_TARGET_OSX - -/* Check for struct with single FP field. */ -static int ccall_classify_struct(CTState *cts, CType *ct) -{ - CTSize sz = ct->size; - if (!(sz == sizeof(float) || sz == sizeof(double))) return 0; - if ((ct->info & CTF_UNION)) return 0; - while (ct->sib) { - ct = ctype_get(cts, ct->sib); - if (ctype_isfield(ct->info)) { - CType *sct = ctype_rawchild(cts, ct); - if (ctype_isfp(sct->info)) { - if (sct->size == sz) - return (sz >> 2); /* Return 1 for float or 2 for double. */ - } else if (ctype_isstruct(sct->info)) { - if (sct->size) - return ccall_classify_struct(cts, sct); - } else { - break; - } - } else if (ctype_isbitfield(ct->info)) { - break; - } else if (ctype_isxattrib(ct->info, CTA_SUBTYPE)) { - CType *sct = ctype_rawchild(cts, ct); - if (sct->size) - return ccall_classify_struct(cts, sct); - } - } - return 0; -} - -#endif - -/* -- x64 struct classification ------------------------------------------- */ - -#if LJ_TARGET_X64 && !LJ_ABI_WIN - -/* Register classes for x64 struct classification. */ -#define CCALL_RCL_INT 1 -#define CCALL_RCL_SSE 2 -#define CCALL_RCL_MEM 4 -/* NYI: classify vectors. */ - -static int ccall_classify_struct(CTState *cts, CType *ct, int *rcl, CTSize ofs); - -/* Classify a C type. */ -static void ccall_classify_ct(CTState *cts, CType *ct, int *rcl, CTSize ofs) -{ - if (ctype_isarray(ct->info)) { - CType *cct = ctype_rawchild(cts, ct); - CTSize eofs, esz = cct->size, asz = ct->size; - for (eofs = 0; eofs < asz; eofs += esz) - ccall_classify_ct(cts, cct, rcl, ofs+eofs); - } else if (ctype_isstruct(ct->info)) { - ccall_classify_struct(cts, ct, rcl, ofs); - } else { - int cl = ctype_isfp(ct->info) ? CCALL_RCL_SSE : CCALL_RCL_INT; - lua_assert(ctype_hassize(ct->info)); - if ((ofs & (ct->size-1))) cl = CCALL_RCL_MEM; /* Unaligned. */ - rcl[(ofs >= 8)] |= cl; - } -} - -/* Recursively classify a struct based on its fields. */ -static int ccall_classify_struct(CTState *cts, CType *ct, int *rcl, CTSize ofs) -{ - if (ct->size > 16) return CCALL_RCL_MEM; /* Too big, gets memory class. */ - while (ct->sib) { - CTSize fofs; - ct = ctype_get(cts, ct->sib); - fofs = ofs+ct->size; - if (ctype_isfield(ct->info)) - ccall_classify_ct(cts, ctype_rawchild(cts, ct), rcl, fofs); - else if (ctype_isbitfield(ct->info)) - rcl[(fofs >= 8)] |= CCALL_RCL_INT; /* NYI: unaligned bitfields? */ - else if (ctype_isxattrib(ct->info, CTA_SUBTYPE)) - ccall_classify_struct(cts, ctype_rawchild(cts, ct), rcl, fofs); - } - return ((rcl[0]|rcl[1]) & CCALL_RCL_MEM); /* Memory class? */ -} - -/* Try to split up a small struct into registers. */ -static int ccall_struct_reg(CCallState *cc, GPRArg *dp, int *rcl) -{ - MSize ngpr = cc->ngpr, nfpr = cc->nfpr; - uint32_t i; - for (i = 0; i < 2; i++) { - lua_assert(!(rcl[i] & CCALL_RCL_MEM)); - if ((rcl[i] & CCALL_RCL_INT)) { /* Integer class takes precedence. */ - if (ngpr >= CCALL_NARG_GPR) return 1; /* Register overflow. */ - cc->gpr[ngpr++] = dp[i]; - } else if ((rcl[i] & CCALL_RCL_SSE)) { - if (nfpr >= CCALL_NARG_FPR) return 1; /* Register overflow. */ - cc->fpr[nfpr++].l[0] = dp[i]; - } - } - cc->ngpr = ngpr; cc->nfpr = nfpr; - return 0; /* Ok. */ -} - -/* Pass a small struct argument. */ -static int ccall_struct_arg(CCallState *cc, CTState *cts, CType *d, int *rcl, - TValue *o, int narg) -{ - GPRArg dp[2]; - dp[0] = dp[1] = 0; - /* Convert to temp. struct. */ - lj_cconv_ct_tv(cts, d, (uint8_t *)dp, o, CCF_ARG(narg)); - if (ccall_struct_reg(cc, dp, rcl)) { /* Register overflow? Pass on stack. */ - MSize nsp = cc->nsp, n = rcl[1] ? 2 : 1; - if (nsp + n > CCALL_MAXSTACK) return 1; /* Too many arguments. */ - cc->nsp = nsp + n; - memcpy(&cc->stack[nsp], dp, n*CTSIZE_PTR); - } - return 0; /* Ok. */ -} - -/* Combine returned small struct. */ -static void ccall_struct_ret(CCallState *cc, int *rcl, uint8_t *dp, CTSize sz) -{ - GPRArg sp[2]; - MSize ngpr = 0, nfpr = 0; - uint32_t i; - for (i = 0; i < 2; i++) { - if ((rcl[i] & CCALL_RCL_INT)) { /* Integer class takes precedence. */ - sp[i] = cc->gpr[ngpr++]; - } else if ((rcl[i] & CCALL_RCL_SSE)) { - sp[i] = cc->fpr[nfpr++].l[0]; - } - } - memcpy(dp, sp, sz); -} -#endif - -/* -- ARM hard-float ABI struct classification ---------------------------- */ - -#if LJ_TARGET_ARM && !LJ_ABI_SOFTFP - -/* Classify a struct based on its fields. */ -static unsigned int ccall_classify_struct(CTState *cts, CType *ct, CType *ctf) -{ - CTSize sz = ct->size; - unsigned int r = 0, n = 0, isu = (ct->info & CTF_UNION); - if ((ctf->info & CTF_VARARG)) goto noth; - while (ct->sib) { - CType *sct; - ct = ctype_get(cts, ct->sib); - if (ctype_isfield(ct->info)) { - sct = ctype_rawchild(cts, ct); - if (ctype_isfp(sct->info)) { - r |= sct->size; - if (!isu) n++; else if (n == 0) n = 1; - } else if (ctype_iscomplex(sct->info)) { - r |= (sct->size >> 1); - if (!isu) n += 2; else if (n < 2) n = 2; - } else if (ctype_isstruct(sct->info)) { - goto substruct; - } else { - goto noth; - } - } else if (ctype_isbitfield(ct->info)) { - goto noth; - } else if (ctype_isxattrib(ct->info, CTA_SUBTYPE)) { - sct = ctype_rawchild(cts, ct); - substruct: - if (sct->size > 0) { - unsigned int s = ccall_classify_struct(cts, sct, ctf); - if (s <= 1) goto noth; - r |= (s & 255); - if (!isu) n += (s >> 8); else if (n < (s >>8)) n = (s >> 8); - } - } - } - if ((r == 4 || r == 8) && n <= 4) - return r + (n << 8); -noth: /* Not a homogeneous float/double aggregate. */ - return (sz <= 4); /* Return structs of size <= 4 in a GPR. */ -} - -#endif - -/* -- Common C call handling ---------------------------------------------- */ - -/* Infer the destination CTypeID for a vararg argument. */ -CTypeID lj_ccall_ctid_vararg(CTState *cts, cTValue *o) -{ - if (tvisnumber(o)) { - return CTID_DOUBLE; - } else if (tviscdata(o)) { - CTypeID id = cdataV(o)->ctypeid; - CType *s = ctype_get(cts, id); - if (ctype_isrefarray(s->info)) { - return lj_ctype_intern(cts, - CTINFO(CT_PTR, CTALIGN_PTR|ctype_cid(s->info)), CTSIZE_PTR); - } else if (ctype_isstruct(s->info) || ctype_isfunc(s->info)) { - /* NYI: how to pass a struct by value in a vararg argument? */ - return lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|id), CTSIZE_PTR); - } else if (ctype_isfp(s->info) && s->size == sizeof(float)) { - return CTID_DOUBLE; - } else { - return id; - } - } else if (tvisstr(o)) { - return CTID_P_CCHAR; - } else if (tvisbool(o)) { - return CTID_BOOL; - } else { - return CTID_P_VOID; - } -} - -/* Setup arguments for C call. */ -static int ccall_set_args(lua_State *L, CTState *cts, CType *ct, - CCallState *cc) -{ - int gcsteps = 0; - TValue *o, *top = L->top; - CTypeID fid; - CType *ctr; - MSize maxgpr, ngpr = 0, nsp = 0, narg; -#if CCALL_NARG_FPR - MSize nfpr = 0; -#if LJ_TARGET_ARM - MSize fprodd = 0; -#endif -#endif - - /* Clear unused regs to get some determinism in case of misdeclaration. */ - memset(cc->gpr, 0, sizeof(cc->gpr)); -#if CCALL_NUM_FPR - memset(cc->fpr, 0, sizeof(cc->fpr)); -#endif - -#if LJ_TARGET_X86 - /* x86 has several different calling conventions. */ - cc->resx87 = 0; - switch (ctype_cconv(ct->info)) { - case CTCC_FASTCALL: maxgpr = 2; break; - case CTCC_THISCALL: maxgpr = 1; break; - default: maxgpr = 0; break; - } -#else - maxgpr = CCALL_NARG_GPR; -#endif - - /* Perform required setup for some result types. */ - ctr = ctype_rawchild(cts, ct); - if (ctype_isvector(ctr->info)) { - if (!(CCALL_VECTOR_REG && (ctr->size == 8 || ctr->size == 16))) - goto err_nyi; - } else if (ctype_iscomplex(ctr->info) || ctype_isstruct(ctr->info)) { - /* Preallocate cdata object and anchor it after arguments. */ - CTSize sz = ctr->size; - GCcdata *cd = lj_cdata_new(cts, ctype_cid(ct->info), sz); - void *dp = cdataptr(cd); - setcdataV(L, L->top++, cd); - if (ctype_isstruct(ctr->info)) { - CCALL_HANDLE_STRUCTRET - } else { - CCALL_HANDLE_COMPLEXRET - } -#if LJ_TARGET_X86 - } else if (ctype_isfp(ctr->info)) { - cc->resx87 = ctr->size == sizeof(float) ? 1 : 2; -#endif - } - - /* Skip initial attributes. */ - fid = ct->sib; - while (fid) { - CType *ctf = ctype_get(cts, fid); - if (!ctype_isattrib(ctf->info)) break; - fid = ctf->sib; - } - - /* Walk through all passed arguments. */ - for (o = L->base+1, narg = 1; o < top; o++, narg++) { - CTypeID did; - CType *d; - CTSize sz; - MSize n, isfp = 0, isva = 0; - void *dp, *rp = NULL; - - if (fid) { /* Get argument type from field. */ - CType *ctf = ctype_get(cts, fid); - fid = ctf->sib; - lua_assert(ctype_isfield(ctf->info)); - did = ctype_cid(ctf->info); - } else { - if (!(ct->info & CTF_VARARG)) - lj_err_caller(L, LJ_ERR_FFI_NUMARG); /* Too many arguments. */ - did = lj_ccall_ctid_vararg(cts, o); /* Infer vararg type. */ - isva = 1; - } - d = ctype_raw(cts, did); - sz = d->size; - - /* Find out how (by value/ref) and where (GPR/FPR) to pass an argument. */ - if (ctype_isnum(d->info)) { - if (sz > 8) goto err_nyi; - if ((d->info & CTF_FP)) - isfp = 1; - } else if (ctype_isvector(d->info)) { - if (CCALL_VECTOR_REG && (sz == 8 || sz == 16)) - isfp = 1; - else - goto err_nyi; - } else if (ctype_isstruct(d->info)) { - CCALL_HANDLE_STRUCTARG - } else if (ctype_iscomplex(d->info)) { - CCALL_HANDLE_COMPLEXARG - } else { - sz = CTSIZE_PTR; - } - sz = (sz + CTSIZE_PTR-1) & ~(CTSIZE_PTR-1); - n = sz / CTSIZE_PTR; /* Number of GPRs or stack slots needed. */ - - CCALL_HANDLE_REGARG /* Handle register arguments. */ - - /* Otherwise pass argument on stack. */ - if (CCALL_ALIGN_STACKARG && !rp && (d->info & CTF_ALIGN) > CTALIGN_PTR) { - MSize align = (1u << ctype_align(d->info-CTALIGN_PTR)) -1; - nsp = (nsp + align) & ~align; /* Align argument on stack. */ - } - if (nsp + n > CCALL_MAXSTACK) { /* Too many arguments. */ - err_nyi: - lj_err_caller(L, LJ_ERR_FFI_NYICALL); - } - dp = &cc->stack[nsp]; - nsp += n; - isva = 0; - - done: - if (rp) { /* Pass by reference. */ - gcsteps++; - *(void **)dp = rp; - dp = rp; - } - lj_cconv_ct_tv(cts, d, (uint8_t *)dp, o, CCF_ARG(narg)); - /* Extend passed integers to 32 bits at least. */ - if (ctype_isinteger_or_bool(d->info) && d->size < 4) { - if (d->info & CTF_UNSIGNED) - *(uint32_t *)dp = d->size == 1 ? (uint32_t)*(uint8_t *)dp : - (uint32_t)*(uint16_t *)dp; - else - *(int32_t *)dp = d->size == 1 ? (int32_t)*(int8_t *)dp : - (int32_t)*(int16_t *)dp; - } -#if LJ_TARGET_X64 && LJ_ABI_WIN - if (isva) { /* Windows/x64 mirrors varargs in both register sets. */ - if (nfpr == ngpr) - cc->gpr[ngpr-1] = cc->fpr[ngpr-1].l[0]; - else - cc->fpr[ngpr-1].l[0] = cc->gpr[ngpr-1]; - } -#else - UNUSED(isva); -#endif -#if LJ_TARGET_X64 && !LJ_ABI_WIN - if (isfp == 2 && n == 2 && (uint8_t *)dp == (uint8_t *)&cc->fpr[nfpr-2]) { - cc->fpr[nfpr-1].d[0] = cc->fpr[nfpr-2].d[1]; /* Split complex double. */ - cc->fpr[nfpr-2].d[1] = 0; - } -#else - UNUSED(isfp); -#endif - } - if (fid) lj_err_caller(L, LJ_ERR_FFI_NUMARG); /* Too few arguments. */ - -#if LJ_TARGET_X64 || LJ_TARGET_PPC - cc->nfpr = nfpr; /* Required for vararg functions. */ -#endif - cc->nsp = nsp; - cc->spadj = (CCALL_SPS_FREE + CCALL_SPS_EXTRA)*CTSIZE_PTR; - if (nsp > CCALL_SPS_FREE) - cc->spadj += (((nsp-CCALL_SPS_FREE)*CTSIZE_PTR + 15u) & ~15u); - return gcsteps; -} - -/* Get results from C call. */ -static int ccall_get_results(lua_State *L, CTState *cts, CType *ct, - CCallState *cc, int *ret) -{ - CType *ctr = ctype_rawchild(cts, ct); - uint8_t *sp = (uint8_t *)&cc->gpr[0]; - if (ctype_isvoid(ctr->info)) { - *ret = 0; /* Zero results. */ - return 0; /* No additional GC step. */ - } - *ret = 1; /* One result. */ - if (ctype_isstruct(ctr->info)) { - /* Return cdata object which is already on top of stack. */ - if (!cc->retref) { - void *dp = cdataptr(cdataV(L->top-1)); /* Use preallocated object. */ - CCALL_HANDLE_STRUCTRET2 - } - return 1; /* One GC step. */ - } - if (ctype_iscomplex(ctr->info)) { - /* Return cdata object which is already on top of stack. */ - void *dp = cdataptr(cdataV(L->top-1)); /* Use preallocated object. */ - CCALL_HANDLE_COMPLEXRET2 - return 1; /* One GC step. */ - } - if (LJ_BE && ctype_isinteger_or_bool(ctr->info) && ctr->size < CTSIZE_PTR) - sp += (CTSIZE_PTR - ctr->size); -#if CCALL_NUM_FPR - if (ctype_isfp(ctr->info) || ctype_isvector(ctr->info)) - sp = (uint8_t *)&cc->fpr[0]; -#endif -#ifdef CCALL_HANDLE_RET - CCALL_HANDLE_RET -#endif - /* No reference types end up here, so there's no need for the CTypeID. */ - lua_assert(!(ctype_isrefarray(ctr->info) || ctype_isstruct(ctr->info))); - return lj_cconv_tv_ct(cts, ctr, 0, L->top-1, sp); -} - -/* Call C function. */ -int lj_ccall_func(lua_State *L, GCcdata *cd) -{ - CTState *cts = ctype_cts(L); - CType *ct = ctype_raw(cts, cd->ctypeid); - CTSize sz = CTSIZE_PTR; - if (ctype_isptr(ct->info)) { - sz = ct->size; - ct = ctype_rawchild(cts, ct); - } - if (ctype_isfunc(ct->info)) { - CCallState cc; - int gcsteps, ret; - cc.func = (void (*)(void))cdata_getptr(cdataptr(cd), sz); - gcsteps = ccall_set_args(L, cts, ct, &cc); - ct = (CType *)((intptr_t)ct-(intptr_t)cts->tab); - cts->cb.slot = ~0u; - lj_vm_ffi_call(&cc); - if (cts->cb.slot != ~0u) { /* Blacklist function that called a callback. */ - TValue tv; - setlightudV(&tv, (void *)cc.func); - setboolV(lj_tab_set(L, cts->miscmap, &tv), 1); - } - ct = (CType *)((intptr_t)ct+(intptr_t)cts->tab); /* May be reallocated. */ - gcsteps += ccall_get_results(L, cts, ct, &cc, &ret); -#if LJ_TARGET_X86 && LJ_ABI_WIN - /* Automatically detect __stdcall and fix up C function declaration. */ - if (cc.spadj && ctype_cconv(ct->info) == CTCC_CDECL) { - CTF_INSERT(ct->info, CCONV, CTCC_STDCALL); - lj_trace_abort(G(L)); - } -#endif - while (gcsteps-- > 0) - lj_gc_check(L); - return ret; - } - return -1; /* Not a function. */ -} - -#endif diff --git a/subprojects/luajit/src/lj_ccall.h b/subprojects/luajit/src/lj_ccall.h deleted file mode 100644 index 9089e6c7e..000000000 --- a/subprojects/luajit/src/lj_ccall.h +++ /dev/null @@ -1,171 +0,0 @@ -/* -** FFI C call handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_CCALL_H -#define _LJ_CCALL_H - -#include "lj_obj.h" -#include "lj_ctype.h" - -#if LJ_HASFFI - -/* -- C calling conventions ----------------------------------------------- */ - -#if LJ_TARGET_X86ORX64 - -#if LJ_TARGET_X86 -#define CCALL_NARG_GPR 2 /* For fastcall arguments. */ -#define CCALL_NARG_FPR 0 -#define CCALL_NRET_GPR 2 -#define CCALL_NRET_FPR 1 /* For FP results on x87 stack. */ -#define CCALL_ALIGN_STACKARG 0 /* Don't align argument on stack. */ -#elif LJ_ABI_WIN -#define CCALL_NARG_GPR 4 -#define CCALL_NARG_FPR 4 -#define CCALL_NRET_GPR 1 -#define CCALL_NRET_FPR 1 -#define CCALL_SPS_EXTRA 4 -#else -#define CCALL_NARG_GPR 6 -#define CCALL_NARG_FPR 8 -#define CCALL_NRET_GPR 2 -#define CCALL_NRET_FPR 2 -#define CCALL_VECTOR_REG 1 /* Pass vectors in registers. */ -#endif - -#define CCALL_SPS_FREE 1 -#define CCALL_ALIGN_CALLSTATE 16 - -typedef LJ_ALIGN(16) union FPRArg { - double d[2]; - float f[4]; - uint8_t b[16]; - uint16_t s[8]; - int i[4]; - int64_t l[2]; -} FPRArg; - -typedef intptr_t GPRArg; - -#elif LJ_TARGET_ARM - -#define CCALL_NARG_GPR 4 -#define CCALL_NRET_GPR 2 /* For softfp double. */ -#if LJ_ABI_SOFTFP -#define CCALL_NARG_FPR 0 -#define CCALL_NRET_FPR 0 -#else -#define CCALL_NARG_FPR 8 -#define CCALL_NRET_FPR 4 -#endif -#define CCALL_SPS_FREE 0 - -typedef intptr_t GPRArg; -typedef union FPRArg { - double d; - float f[2]; -} FPRArg; - -#elif LJ_TARGET_PPC - -#define CCALL_NARG_GPR 8 -#define CCALL_NARG_FPR 8 -#define CCALL_NRET_GPR 4 /* For complex double. */ -#define CCALL_NRET_FPR 1 -#define CCALL_SPS_EXTRA 4 -#define CCALL_SPS_FREE 0 - -typedef intptr_t GPRArg; -typedef double FPRArg; - -#elif LJ_TARGET_PPCSPE - -#define CCALL_NARG_GPR 8 -#define CCALL_NARG_FPR 0 -#define CCALL_NRET_GPR 4 /* For softfp complex double. */ -#define CCALL_NRET_FPR 0 -#define CCALL_SPS_FREE 0 /* NYI */ - -typedef intptr_t GPRArg; - -#elif LJ_TARGET_MIPS - -#define CCALL_NARG_GPR 4 -#define CCALL_NARG_FPR 2 -#define CCALL_NRET_GPR 2 -#define CCALL_NRET_FPR 2 -#define CCALL_SPS_EXTRA 7 -#define CCALL_SPS_FREE 1 - -typedef intptr_t GPRArg; -typedef union FPRArg { - double d; - struct { LJ_ENDIAN_LOHI(float f; , float g;) }; -} FPRArg; - -#else -#error "Missing calling convention definitions for this architecture" -#endif - -#ifndef CCALL_SPS_EXTRA -#define CCALL_SPS_EXTRA 0 -#endif -#ifndef CCALL_VECTOR_REG -#define CCALL_VECTOR_REG 0 -#endif -#ifndef CCALL_ALIGN_STACKARG -#define CCALL_ALIGN_STACKARG 1 -#endif -#ifndef CCALL_ALIGN_CALLSTATE -#define CCALL_ALIGN_CALLSTATE 8 -#endif - -#define CCALL_NUM_GPR \ - (CCALL_NARG_GPR > CCALL_NRET_GPR ? CCALL_NARG_GPR : CCALL_NRET_GPR) -#define CCALL_NUM_FPR \ - (CCALL_NARG_FPR > CCALL_NRET_FPR ? CCALL_NARG_FPR : CCALL_NRET_FPR) - -/* Check against constants in lj_ctype.h. */ -LJ_STATIC_ASSERT(CCALL_NUM_GPR <= CCALL_MAX_GPR); -LJ_STATIC_ASSERT(CCALL_NUM_FPR <= CCALL_MAX_FPR); - -#define CCALL_MAXSTACK 32 - -/* -- C call state -------------------------------------------------------- */ - -typedef LJ_ALIGN(CCALL_ALIGN_CALLSTATE) struct CCallState { - void (*func)(void); /* Pointer to called function. */ - uint32_t spadj; /* Stack pointer adjustment. */ - uint8_t nsp; /* Number of stack slots. */ - uint8_t retref; /* Return value by reference. */ -#if LJ_TARGET_X64 - uint8_t ngpr; /* Number of arguments in GPRs. */ - uint8_t nfpr; /* Number of arguments in FPRs. */ -#elif LJ_TARGET_X86 - uint8_t resx87; /* Result on x87 stack: 1:float, 2:double. */ -#elif LJ_TARGET_PPC - uint8_t nfpr; /* Number of arguments in FPRs. */ -#endif -#if LJ_32 - int32_t align1; -#endif -#if CCALL_NUM_FPR - FPRArg fpr[CCALL_NUM_FPR]; /* Arguments/results in FPRs. */ -#endif - GPRArg gpr[CCALL_NUM_GPR]; /* Arguments/results in GPRs. */ - GPRArg stack[CCALL_MAXSTACK]; /* Stack slots. */ -} CCallState; - -/* -- C call handling ----------------------------------------------------- */ - -/* Really belongs to lj_vm.h. */ -LJ_ASMF void LJ_FASTCALL lj_vm_ffi_call(CCallState *cc); - -LJ_FUNC CTypeID lj_ccall_ctid_vararg(CTState *cts, cTValue *o); -LJ_FUNC int lj_ccall_func(lua_State *L, GCcdata *cd); - -#endif - -#endif diff --git a/subprojects/luajit/src/lj_ccallback.c b/subprojects/luajit/src/lj_ccallback.c deleted file mode 100644 index 06a740190..000000000 --- a/subprojects/luajit/src/lj_ccallback.c +++ /dev/null @@ -1,644 +0,0 @@ -/* -** FFI C callback handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include "lj_obj.h" - -#if LJ_HASFFI - -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_tab.h" -#include "lj_state.h" -#include "lj_frame.h" -#include "lj_ctype.h" -#include "lj_cconv.h" -#include "lj_ccall.h" -#include "lj_ccallback.h" -#include "lj_target.h" -#include "lj_mcode.h" -#include "lj_trace.h" -#include "lj_vm.h" - -/* -- Target-specific handling of callback slots -------------------------- */ - -#define CALLBACK_MCODE_SIZE (LJ_PAGESIZE * LJ_NUM_CBPAGE) - -#if LJ_OS_NOJIT - -/* Disabled callback support. */ -#define CALLBACK_SLOT2OFS(slot) (0*(slot)) -#define CALLBACK_OFS2SLOT(ofs) (0*(ofs)) -#define CALLBACK_MAX_SLOT 0 - -#elif LJ_TARGET_X86ORX64 - -#define CALLBACK_MCODE_HEAD (LJ_64 ? 8 : 0) -#define CALLBACK_MCODE_GROUP (-2+1+2+5+(LJ_64 ? 6 : 5)) - -#define CALLBACK_SLOT2OFS(slot) \ - (CALLBACK_MCODE_HEAD + CALLBACK_MCODE_GROUP*((slot)/32) + 4*(slot)) - -static MSize CALLBACK_OFS2SLOT(MSize ofs) -{ - MSize group; - ofs -= CALLBACK_MCODE_HEAD; - group = ofs / (32*4 + CALLBACK_MCODE_GROUP); - return (ofs % (32*4 + CALLBACK_MCODE_GROUP))/4 + group*32; -} - -#define CALLBACK_MAX_SLOT \ - (((CALLBACK_MCODE_SIZE-CALLBACK_MCODE_HEAD)/(CALLBACK_MCODE_GROUP+4*32))*32) - -#elif LJ_TARGET_ARM - -#define CALLBACK_MCODE_HEAD 32 -#define CALLBACK_SLOT2OFS(slot) (CALLBACK_MCODE_HEAD + 8*(slot)) -#define CALLBACK_OFS2SLOT(ofs) (((ofs)-CALLBACK_MCODE_HEAD)/8) -#define CALLBACK_MAX_SLOT (CALLBACK_OFS2SLOT(CALLBACK_MCODE_SIZE)) - -#elif LJ_TARGET_PPC - -#define CALLBACK_MCODE_HEAD 24 -#define CALLBACK_SLOT2OFS(slot) (CALLBACK_MCODE_HEAD + 8*(slot)) -#define CALLBACK_OFS2SLOT(ofs) (((ofs)-CALLBACK_MCODE_HEAD)/8) -#define CALLBACK_MAX_SLOT (CALLBACK_OFS2SLOT(CALLBACK_MCODE_SIZE)) - -#elif LJ_TARGET_MIPS - -#define CALLBACK_MCODE_HEAD 24 -#define CALLBACK_SLOT2OFS(slot) (CALLBACK_MCODE_HEAD + 8*(slot)) -#define CALLBACK_OFS2SLOT(ofs) (((ofs)-CALLBACK_MCODE_HEAD)/8) -#define CALLBACK_MAX_SLOT (CALLBACK_OFS2SLOT(CALLBACK_MCODE_SIZE)) - -#else - -/* Missing support for this architecture. */ -#define CALLBACK_SLOT2OFS(slot) (0*(slot)) -#define CALLBACK_OFS2SLOT(ofs) (0*(ofs)) -#define CALLBACK_MAX_SLOT 0 - -#endif - -/* Convert callback slot number to callback function pointer. */ -static void *callback_slot2ptr(CTState *cts, MSize slot) -{ - return (uint8_t *)cts->cb.mcode + CALLBACK_SLOT2OFS(slot); -} - -/* Convert callback function pointer to slot number. */ -MSize lj_ccallback_ptr2slot(CTState *cts, void *p) -{ - uintptr_t ofs = (uintptr_t)((uint8_t *)p -(uint8_t *)cts->cb.mcode); - if (ofs < CALLBACK_MCODE_SIZE) { - MSize slot = CALLBACK_OFS2SLOT((MSize)ofs); - if (CALLBACK_SLOT2OFS(slot) == (MSize)ofs) - return slot; - } - return ~0u; /* Not a known callback function pointer. */ -} - -/* Initialize machine code for callback function pointers. */ -#if LJ_OS_NOJIT -/* Disabled callback support. */ -#define callback_mcode_init(g, p) UNUSED(p) -#elif LJ_TARGET_X86ORX64 -static void callback_mcode_init(global_State *g, uint8_t *page) -{ - uint8_t *p = page; - uint8_t *target = (uint8_t *)(void *)lj_vm_ffi_callback; - MSize slot; -#if LJ_64 - *(void **)p = target; p += 8; -#endif - for (slot = 0; slot < CALLBACK_MAX_SLOT; slot++) { - /* mov al, slot; jmp group */ - *p++ = XI_MOVrib | RID_EAX; *p++ = (uint8_t)slot; - if ((slot & 31) == 31 || slot == CALLBACK_MAX_SLOT-1) { - /* push ebp/rbp; mov ah, slot>>8; mov ebp, &g. */ - *p++ = XI_PUSH + RID_EBP; - *p++ = XI_MOVrib | (RID_EAX+4); *p++ = (uint8_t)(slot >> 8); - *p++ = XI_MOVri | RID_EBP; - *(int32_t *)p = i32ptr(g); p += 4; -#if LJ_64 - /* jmp [rip-pageofs] where lj_vm_ffi_callback is stored. */ - *p++ = XI_GROUP5; *p++ = XM_OFS0 + (XOg_JMP<<3) + RID_EBP; - *(int32_t *)p = (int32_t)(page-(p+4)); p += 4; -#else - /* jmp lj_vm_ffi_callback. */ - *p++ = XI_JMP; *(int32_t *)p = target-(p+4); p += 4; -#endif - } else { - *p++ = XI_JMPs; *p++ = (uint8_t)((2+2)*(31-(slot&31)) - 2); - } - } - lua_assert(p - page <= CALLBACK_MCODE_SIZE); -} -#elif LJ_TARGET_ARM -static void callback_mcode_init(global_State *g, uint32_t *page) -{ - uint32_t *p = page; - void *target = (void *)lj_vm_ffi_callback; - MSize slot; - /* This must match with the saveregs macro in buildvm_arm.dasc. */ - *p++ = ARMI_SUB|ARMF_D(RID_R12)|ARMF_N(RID_R12)|ARMF_M(RID_PC); - *p++ = ARMI_PUSH|ARMF_N(RID_SP)|RSET_RANGE(RID_R4,RID_R11+1)|RID2RSET(RID_LR); - *p++ = ARMI_SUB|ARMI_K12|ARMF_D(RID_R12)|ARMF_N(RID_R12)|CALLBACK_MCODE_HEAD; - *p++ = ARMI_STR|ARMI_LS_P|ARMI_LS_W|ARMF_D(RID_R12)|ARMF_N(RID_SP)|(CFRAME_SIZE-4*9); - *p++ = ARMI_LDR|ARMI_LS_P|ARMI_LS_U|ARMF_D(RID_R12)|ARMF_N(RID_PC); - *p++ = ARMI_LDR|ARMI_LS_P|ARMI_LS_U|ARMF_D(RID_PC)|ARMF_N(RID_PC); - *p++ = u32ptr(g); - *p++ = u32ptr(target); - for (slot = 0; slot < CALLBACK_MAX_SLOT; slot++) { - *p++ = ARMI_MOV|ARMF_D(RID_R12)|ARMF_M(RID_PC); - *p = ARMI_B | ((page-p-2) & 0x00ffffffu); - p++; - } - lua_assert(p - page <= CALLBACK_MCODE_SIZE); -} -#elif LJ_TARGET_PPC -static void callback_mcode_init(global_State *g, uint32_t *page) -{ - uint32_t *p = page; - void *target = (void *)lj_vm_ffi_callback; - MSize slot; - *p++ = PPCI_LIS | PPCF_T(RID_TMP) | (u32ptr(target) >> 16); - *p++ = PPCI_LIS | PPCF_T(RID_R12) | (u32ptr(g) >> 16); - *p++ = PPCI_ORI | PPCF_A(RID_TMP)|PPCF_T(RID_TMP) | (u32ptr(target) & 0xffff); - *p++ = PPCI_ORI | PPCF_A(RID_R12)|PPCF_T(RID_R12) | (u32ptr(g) & 0xffff); - *p++ = PPCI_MTCTR | PPCF_T(RID_TMP); - *p++ = PPCI_BCTR; - for (slot = 0; slot < CALLBACK_MAX_SLOT; slot++) { - *p++ = PPCI_LI | PPCF_T(RID_R11) | slot; - *p = PPCI_B | (((page-p) & 0x00ffffffu) << 2); - p++; - } - lua_assert(p - page <= CALLBACK_MCODE_SIZE); -} -#elif LJ_TARGET_MIPS -static void callback_mcode_init(global_State *g, uint32_t *page) -{ - uint32_t *p = page; - void *target = (void *)lj_vm_ffi_callback; - MSize slot; - *p++ = MIPSI_SW | MIPSF_T(RID_R1)|MIPSF_S(RID_SP) | 0; - *p++ = MIPSI_LUI | MIPSF_T(RID_R3) | (u32ptr(target) >> 16); - *p++ = MIPSI_LUI | MIPSF_T(RID_R2) | (u32ptr(g) >> 16); - *p++ = MIPSI_ORI | MIPSF_T(RID_R3)|MIPSF_S(RID_R3) |(u32ptr(target)&0xffff); - *p++ = MIPSI_JR | MIPSF_S(RID_R3); - *p++ = MIPSI_ORI | MIPSF_T(RID_R2)|MIPSF_S(RID_R2) | (u32ptr(g)&0xffff); - for (slot = 0; slot < CALLBACK_MAX_SLOT; slot++) { - *p = MIPSI_B | ((page-p-1) & 0x0000ffffu); - p++; - *p++ = MIPSI_LI | MIPSF_T(RID_R1) | slot; - } - lua_assert(p - page <= CALLBACK_MCODE_SIZE); -} -#else -/* Missing support for this architecture. */ -#define callback_mcode_init(g, p) UNUSED(p) -#endif - -/* -- Machine code management --------------------------------------------- */ - -#if LJ_TARGET_WINDOWS - -#define WIN32_LEAN_AND_MEAN -#include - -#elif LJ_TARGET_POSIX - -#include -#ifndef MAP_ANONYMOUS -#define MAP_ANONYMOUS MAP_ANON -#endif - -#endif - -/* Allocate and initialize area for callback function pointers. */ -static void callback_mcode_new(CTState *cts) -{ - size_t sz = (size_t)CALLBACK_MCODE_SIZE; - void *p; - if (CALLBACK_MAX_SLOT == 0) - lj_err_caller(cts->L, LJ_ERR_FFI_CBACKOV); -#if LJ_TARGET_WINDOWS - p = VirtualAlloc(NULL, sz, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE); - if (!p) - lj_err_caller(cts->L, LJ_ERR_FFI_CBACKOV); -#elif LJ_TARGET_POSIX - p = mmap(NULL, sz, (PROT_READ|PROT_WRITE), MAP_PRIVATE|MAP_ANONYMOUS, - -1, 0); - if (p == MAP_FAILED) - lj_err_caller(cts->L, LJ_ERR_FFI_CBACKOV); -#else - /* Fallback allocator. Fails if memory is not executable by default. */ - p = lj_mem_new(cts->L, sz); -#endif - cts->cb.mcode = p; - callback_mcode_init(cts->g, p); - lj_mcode_sync(p, (char *)p + sz); -#if LJ_TARGET_WINDOWS - { - DWORD oprot; - VirtualProtect(p, sz, PAGE_EXECUTE_READ, &oprot); - } -#elif LJ_TARGET_POSIX - mprotect(p, sz, (PROT_READ|PROT_EXEC)); -#endif -} - -/* Free area for callback function pointers. */ -void lj_ccallback_mcode_free(CTState *cts) -{ - size_t sz = (size_t)CALLBACK_MCODE_SIZE; - void *p = cts->cb.mcode; - if (p == NULL) return; -#if LJ_TARGET_WINDOWS - VirtualFree(p, 0, MEM_RELEASE); - UNUSED(sz); -#elif LJ_TARGET_POSIX - munmap(p, sz); -#else - lj_mem_free(cts->g, p, sz); -#endif -} - -/* -- C callback entry ---------------------------------------------------- */ - -/* Target-specific handling of register arguments. Similar to lj_ccall.c. */ -#if LJ_TARGET_X86 - -#define CALLBACK_HANDLE_REGARG \ - if (!isfp) { /* Only non-FP values may be passed in registers. */ \ - if (n > 1) { /* Anything > 32 bit is passed on the stack. */ \ - if (!LJ_ABI_WIN) ngpr = maxgpr; /* Prevent reordering. */ \ - } else if (ngpr + 1 <= maxgpr) { \ - sp = &cts->cb.gpr[ngpr]; \ - ngpr += n; \ - goto done; \ - } \ - } - -#elif LJ_TARGET_X64 && LJ_ABI_WIN - -/* Windows/x64 argument registers are strictly positional (use ngpr). */ -#define CALLBACK_HANDLE_REGARG \ - if (isfp) { \ - if (ngpr < maxgpr) { sp = &cts->cb.fpr[ngpr++]; UNUSED(nfpr); goto done; } \ - } else { \ - if (ngpr < maxgpr) { sp = &cts->cb.gpr[ngpr++]; goto done; } \ - } - -#elif LJ_TARGET_X64 - -#define CALLBACK_HANDLE_REGARG \ - if (isfp) { \ - if (nfpr + n <= CCALL_NARG_FPR) { \ - sp = &cts->cb.fpr[nfpr]; \ - nfpr += n; \ - goto done; \ - } \ - } else { \ - if (ngpr + n <= maxgpr) { \ - sp = &cts->cb.gpr[ngpr]; \ - ngpr += n; \ - goto done; \ - } \ - } - -#elif LJ_TARGET_ARM - -#if LJ_ABI_SOFTFP - -#define CALLBACK_HANDLE_REGARG_FP1 UNUSED(isfp); -#define CALLBACK_HANDLE_REGARG_FP2 - -#else - -#define CALLBACK_HANDLE_REGARG_FP1 \ - if (isfp) { \ - if (n == 1) { \ - if (fprodd) { \ - sp = &cts->cb.fpr[fprodd-1]; \ - fprodd = 0; \ - goto done; \ - } else if (nfpr + 1 <= CCALL_NARG_FPR) { \ - sp = &cts->cb.fpr[nfpr++]; \ - fprodd = nfpr; \ - goto done; \ - } \ - } else { \ - if (nfpr + 1 <= CCALL_NARG_FPR) { \ - sp = &cts->cb.fpr[nfpr++]; \ - goto done; \ - } \ - } \ - fprodd = 0; /* No reordering after the first FP value is on stack. */ \ - } else { - -#define CALLBACK_HANDLE_REGARG_FP2 } - -#endif - -#define CALLBACK_HANDLE_REGARG \ - CALLBACK_HANDLE_REGARG_FP1 \ - if (n > 1) ngpr = (ngpr + 1u) & ~1u; /* Align to regpair. */ \ - if (ngpr + n <= maxgpr) { \ - sp = &cts->cb.gpr[ngpr]; \ - ngpr += n; \ - goto done; \ - } CALLBACK_HANDLE_REGARG_FP2 - -#elif LJ_TARGET_PPC - -#define CALLBACK_HANDLE_REGARG \ - if (isfp) { \ - if (nfpr + 1 <= CCALL_NARG_FPR) { \ - sp = &cts->cb.fpr[nfpr++]; \ - cta = ctype_get(cts, CTID_DOUBLE); /* FPRs always hold doubles. */ \ - goto done; \ - } \ - } else { /* Try to pass argument in GPRs. */ \ - if (n > 1) { \ - lua_assert(ctype_isinteger(cta->info) && n == 2); /* int64_t. */ \ - ngpr = (ngpr + 1u) & ~1u; /* Align int64_t to regpair. */ \ - } \ - if (ngpr + n <= maxgpr) { \ - sp = &cts->cb.gpr[ngpr]; \ - ngpr += n; \ - goto done; \ - } \ - } - -#define CALLBACK_HANDLE_RET \ - if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \ - *(double *)dp = *(float *)dp; /* FPRs always hold doubles. */ - -#elif LJ_TARGET_MIPS - -#define CALLBACK_HANDLE_REGARG \ - if (isfp && nfpr < CCALL_NARG_FPR) { /* Try to pass argument in FPRs. */ \ - sp = (void *)((uint8_t *)&cts->cb.fpr[nfpr] + ((LJ_BE && n==1) ? 4 : 0)); \ - nfpr++; ngpr += n; \ - goto done; \ - } else { /* Try to pass argument in GPRs. */ \ - nfpr = CCALL_NARG_FPR; \ - if (n > 1) ngpr = (ngpr + 1u) & ~1u; /* Align to regpair. */ \ - if (ngpr + n <= maxgpr) { \ - sp = &cts->cb.gpr[ngpr]; \ - ngpr += n; \ - goto done; \ - } \ - } - -#define CALLBACK_HANDLE_RET \ - if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \ - ((float *)dp)[1] = *(float *)dp; - -#else -#error "Missing calling convention definitions for this architecture" -#endif - -/* Convert and push callback arguments to Lua stack. */ -static void callback_conv_args(CTState *cts, lua_State *L) -{ - TValue *o = L->top; - intptr_t *stack = cts->cb.stack; - MSize slot = cts->cb.slot; - CTypeID id = 0, rid, fid; - int gcsteps = 0; - CType *ct; - GCfunc *fn; - MSize ngpr = 0, nsp = 0, maxgpr = CCALL_NARG_GPR; -#if CCALL_NARG_FPR - MSize nfpr = 0; -#if LJ_TARGET_ARM - MSize fprodd = 0; -#endif -#endif - - if (slot < cts->cb.sizeid && (id = cts->cb.cbid[slot]) != 0) { - ct = ctype_get(cts, id); - rid = ctype_cid(ct->info); - fn = funcV(lj_tab_getint(cts->miscmap, (int32_t)slot)); - } else { /* Must set up frame first, before throwing the error. */ - ct = NULL; - rid = 0; - fn = (GCfunc *)L; - } - o->u32.lo = LJ_CONT_FFI_CALLBACK; /* Continuation returns from callback. */ - o->u32.hi = rid; /* Return type. x86: +(spadj<<16). */ - o++; - setframe_gc(o, obj2gco(fn)); - setframe_ftsz(o, (int)((char *)(o+1) - (char *)L->base) + FRAME_CONT); - L->top = L->base = ++o; - if (!ct) - lj_err_caller(cts->L, LJ_ERR_FFI_BADCBACK); - if (isluafunc(fn)) - setcframe_pc(L->cframe, proto_bc(funcproto(fn))+1); - lj_state_checkstack(L, LUA_MINSTACK); /* May throw. */ - o = L->base; /* Might have been reallocated. */ - -#if LJ_TARGET_X86 - /* x86 has several different calling conventions. */ - switch (ctype_cconv(ct->info)) { - case CTCC_FASTCALL: maxgpr = 2; break; - case CTCC_THISCALL: maxgpr = 1; break; - default: maxgpr = 0; break; - } -#endif - - fid = ct->sib; - while (fid) { - CType *ctf = ctype_get(cts, fid); - if (!ctype_isattrib(ctf->info)) { - CType *cta; - void *sp; - CTSize sz; - int isfp; - MSize n; - lua_assert(ctype_isfield(ctf->info)); - cta = ctype_rawchild(cts, ctf); - isfp = ctype_isfp(cta->info); - sz = (cta->size + CTSIZE_PTR-1) & ~(CTSIZE_PTR-1); - n = sz / CTSIZE_PTR; /* Number of GPRs or stack slots needed. */ - - CALLBACK_HANDLE_REGARG /* Handle register arguments. */ - - /* Otherwise pass argument on stack. */ - if (CCALL_ALIGN_STACKARG && LJ_32 && sz == 8) - nsp = (nsp + 1) & ~1u; /* Align 64 bit argument on stack. */ - sp = &stack[nsp]; - nsp += n; - - done: - if (LJ_BE && cta->size < CTSIZE_PTR) - sp = (void *)((uint8_t *)sp + CTSIZE_PTR-cta->size); - gcsteps += lj_cconv_tv_ct(cts, cta, 0, o++, sp); - } - fid = ctf->sib; - } - L->top = o; -#if LJ_TARGET_X86 - /* Store stack adjustment for returns from non-cdecl callbacks. */ - if (ctype_cconv(ct->info) != CTCC_CDECL) - (L->base-2)->u32.hi |= (nsp << (16+2)); -#endif - while (gcsteps-- > 0) - lj_gc_check(L); -} - -/* Convert Lua object to callback result. */ -static void callback_conv_result(CTState *cts, lua_State *L, TValue *o) -{ - CType *ctr = ctype_raw(cts, (uint16_t)(L->base-2)->u32.hi); -#if LJ_TARGET_X86 - cts->cb.gpr[2] = 0; -#endif - if (!ctype_isvoid(ctr->info)) { - uint8_t *dp = (uint8_t *)&cts->cb.gpr[0]; -#if CCALL_NUM_FPR - if (ctype_isfp(ctr->info)) - dp = (uint8_t *)&cts->cb.fpr[0]; -#endif - lj_cconv_ct_tv(cts, ctr, dp, o, 0); -#ifdef CALLBACK_HANDLE_RET - CALLBACK_HANDLE_RET -#endif - /* Extend returned integers to (at least) 32 bits. */ - if (ctype_isinteger_or_bool(ctr->info) && ctr->size < 4) { - if (ctr->info & CTF_UNSIGNED) - *(uint32_t *)dp = ctr->size == 1 ? (uint32_t)*(uint8_t *)dp : - (uint32_t)*(uint16_t *)dp; - else - *(int32_t *)dp = ctr->size == 1 ? (int32_t)*(int8_t *)dp : - (int32_t)*(int16_t *)dp; - } -#if LJ_TARGET_X86 - if (ctype_isfp(ctr->info)) - cts->cb.gpr[2] = ctr->size == sizeof(float) ? 1 : 2; -#endif - } -} - -/* Enter callback. */ -lua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf) -{ - lua_State *L = cts->L; - global_State *g = cts->g; - lua_assert(L != NULL); - if (gcref(g->jit_L)) { - setstrV(L, L->top++, lj_err_str(L, LJ_ERR_FFI_BADCBACK)); - if (g->panic) g->panic(L); - exit(EXIT_FAILURE); - } - lj_trace_abort(g); /* Never record across callback. */ - /* Setup C frame. */ - cframe_prev(cf) = L->cframe; - setcframe_L(cf, L); - cframe_errfunc(cf) = -1; - cframe_nres(cf) = 0; - L->cframe = cf; - callback_conv_args(cts, L); - return L; /* Now call the function on this stack. */ -} - -/* Leave callback. */ -void LJ_FASTCALL lj_ccallback_leave(CTState *cts, TValue *o) -{ - lua_State *L = cts->L; - GCfunc *fn; - TValue *obase = L->base; - L->base = L->top; /* Keep continuation frame for throwing errors. */ - if (o >= L->base) { - /* PC of RET* is lost. Point to last line for result conv. errors. */ - fn = curr_func(L); - if (isluafunc(fn)) { - GCproto *pt = funcproto(fn); - setcframe_pc(L->cframe, proto_bc(pt)+pt->sizebc+1); - } - } - callback_conv_result(cts, L, o); - /* Finally drop C frame and continuation frame. */ - L->cframe = cframe_prev(L->cframe); - L->top -= 2; - L->base = obase; - cts->cb.slot = 0; /* Blacklist C function that called the callback. */ -} - -/* -- C callback management ----------------------------------------------- */ - -/* Get an unused slot in the callback slot table. */ -static MSize callback_slot_new(CTState *cts, CType *ct) -{ - CTypeID id = ctype_typeid(cts, ct); - CTypeID1 *cbid = cts->cb.cbid; - MSize top; - for (top = cts->cb.topid; top < cts->cb.sizeid; top++) - if (LJ_LIKELY(cbid[top] == 0)) - goto found; -#if CALLBACK_MAX_SLOT - if (top >= CALLBACK_MAX_SLOT) -#endif - lj_err_caller(cts->L, LJ_ERR_FFI_CBACKOV); - if (!cts->cb.mcode) - callback_mcode_new(cts); - lj_mem_growvec(cts->L, cbid, cts->cb.sizeid, CALLBACK_MAX_SLOT, CTypeID1); - cts->cb.cbid = cbid; - memset(cbid+top, 0, (cts->cb.sizeid-top)*sizeof(CTypeID1)); -found: - cbid[top] = id; - cts->cb.topid = top+1; - return top; -} - -/* Check for function pointer and supported argument/result types. */ -static CType *callback_checkfunc(CTState *cts, CType *ct) -{ - int narg = 0; - if (!ctype_isptr(ct->info) || (LJ_64 && ct->size != CTSIZE_PTR)) - return NULL; - ct = ctype_rawchild(cts, ct); - if (ctype_isfunc(ct->info)) { - CType *ctr = ctype_rawchild(cts, ct); - CTypeID fid = ct->sib; - if (!(ctype_isvoid(ctr->info) || ctype_isenum(ctr->info) || - ctype_isptr(ctr->info) || (ctype_isnum(ctr->info) && ctr->size <= 8))) - return NULL; - if ((ct->info & CTF_VARARG)) - return NULL; - while (fid) { - CType *ctf = ctype_get(cts, fid); - if (!ctype_isattrib(ctf->info)) { - CType *cta; - lua_assert(ctype_isfield(ctf->info)); - cta = ctype_rawchild(cts, ctf); - if (!(ctype_isenum(cta->info) || ctype_isptr(cta->info) || - (ctype_isnum(cta->info) && cta->size <= 8)) || - ++narg >= LUA_MINSTACK-3) - return NULL; - } - fid = ctf->sib; - } - return ct; - } - return NULL; -} - -/* Create a new callback and return the callback function pointer. */ -void *lj_ccallback_new(CTState *cts, CType *ct, GCfunc *fn) -{ - ct = callback_checkfunc(cts, ct); - if (ct) { - MSize slot = callback_slot_new(cts, ct); - GCtab *t = cts->miscmap; - setfuncV(cts->L, lj_tab_setint(cts->L, t, (int32_t)slot), fn); - lj_gc_anybarriert(cts->L, t); - return callback_slot2ptr(cts, slot); - } - return NULL; /* Bad conversion. */ -} - -#endif diff --git a/subprojects/luajit/src/lj_ccallback.h b/subprojects/luajit/src/lj_ccallback.h deleted file mode 100644 index a8cdad386..000000000 --- a/subprojects/luajit/src/lj_ccallback.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -** FFI C callback handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_CCALLBACK_H -#define _LJ_CCALLBACK_H - -#include "lj_obj.h" -#include "lj_ctype.h" - -#if LJ_HASFFI - -/* Really belongs to lj_vm.h. */ -LJ_ASMF void lj_vm_ffi_callback(void); - -LJ_FUNC MSize lj_ccallback_ptr2slot(CTState *cts, void *p); -LJ_FUNCA lua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf); -LJ_FUNCA void LJ_FASTCALL lj_ccallback_leave(CTState *cts, TValue *o); -LJ_FUNC void *lj_ccallback_new(CTState *cts, CType *ct, GCfunc *fn); -LJ_FUNC void lj_ccallback_mcode_free(CTState *cts); - -#endif - -#endif diff --git a/subprojects/luajit/src/lj_cconv.c b/subprojects/luajit/src/lj_cconv.c deleted file mode 100644 index ab398adcd..000000000 --- a/subprojects/luajit/src/lj_cconv.c +++ /dev/null @@ -1,752 +0,0 @@ -/* -** C type conversions. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include "lj_obj.h" - -#if LJ_HASFFI - -#include "lj_err.h" -#include "lj_tab.h" -#include "lj_ctype.h" -#include "lj_cdata.h" -#include "lj_cconv.h" -#include "lj_ccallback.h" - -/* -- Conversion errors --------------------------------------------------- */ - -/* Bad conversion. */ -LJ_NORET static void cconv_err_conv(CTState *cts, CType *d, CType *s, - CTInfo flags) -{ - const char *dst = strdata(lj_ctype_repr(cts->L, ctype_typeid(cts, d), NULL)); - const char *src; - if ((flags & CCF_FROMTV)) - src = lj_obj_typename[1+(ctype_isnum(s->info) ? LUA_TNUMBER : - ctype_isarray(s->info) ? LUA_TSTRING : LUA_TNIL)]; - else - src = strdata(lj_ctype_repr(cts->L, ctype_typeid(cts, s), NULL)); - if (CCF_GETARG(flags)) - lj_err_argv(cts->L, CCF_GETARG(flags), LJ_ERR_FFI_BADCONV, src, dst); - else - lj_err_callerv(cts->L, LJ_ERR_FFI_BADCONV, src, dst); -} - -/* Bad conversion from TValue. */ -LJ_NORET static void cconv_err_convtv(CTState *cts, CType *d, TValue *o, - CTInfo flags) -{ - const char *dst = strdata(lj_ctype_repr(cts->L, ctype_typeid(cts, d), NULL)); - const char *src = lj_typename(o); - if (CCF_GETARG(flags)) - lj_err_argv(cts->L, CCF_GETARG(flags), LJ_ERR_FFI_BADCONV, src, dst); - else - lj_err_callerv(cts->L, LJ_ERR_FFI_BADCONV, src, dst); -} - -/* Initializer overflow. */ -LJ_NORET static void cconv_err_initov(CTState *cts, CType *d) -{ - const char *dst = strdata(lj_ctype_repr(cts->L, ctype_typeid(cts, d), NULL)); - lj_err_callerv(cts->L, LJ_ERR_FFI_INITOV, dst); -} - -/* -- C type compatibility checks ----------------------------------------- */ - -/* Get raw type and qualifiers for a child type. Resolves enums, too. */ -static CType *cconv_childqual(CTState *cts, CType *ct, CTInfo *qual) -{ - ct = ctype_child(cts, ct); - for (;;) { - if (ctype_isattrib(ct->info)) { - if (ctype_attrib(ct->info) == CTA_QUAL) *qual |= ct->size; - } else if (!ctype_isenum(ct->info)) { - break; - } - ct = ctype_child(cts, ct); - } - *qual |= (ct->info & CTF_QUAL); - return ct; -} - -/* Check for compatible types when converting to a pointer. -** Note: these checks are more relaxed than what C99 mandates. -*/ -int lj_cconv_compatptr(CTState *cts, CType *d, CType *s, CTInfo flags) -{ - if (!((flags & CCF_CAST) || d == s)) { - CTInfo dqual = 0, squal = 0; - d = cconv_childqual(cts, d, &dqual); - if (!ctype_isstruct(s->info)) - s = cconv_childqual(cts, s, &squal); - if ((flags & CCF_SAME)) { - if (dqual != squal) - return 0; /* Different qualifiers. */ - } else if (!(flags & CCF_IGNQUAL)) { - if ((dqual & squal) != squal) - return 0; /* Discarded qualifiers. */ - if (ctype_isvoid(d->info) || ctype_isvoid(s->info)) - return 1; /* Converting to/from void * is always ok. */ - } - if (ctype_type(d->info) != ctype_type(s->info) || - d->size != s->size) - return 0; /* Different type or different size. */ - if (ctype_isnum(d->info)) { - if (((d->info ^ s->info) & (CTF_BOOL|CTF_FP))) - return 0; /* Different numeric types. */ - } else if (ctype_ispointer(d->info)) { - /* Check child types for compatibility. */ - return lj_cconv_compatptr(cts, d, s, flags|CCF_SAME); - } else if (ctype_isstruct(d->info)) { - if (d != s) - return 0; /* Must be exact same type for struct/union. */ - } else if (ctype_isfunc(d->info)) { - /* NYI: structural equality of functions. */ - } - } - return 1; /* Types are compatible. */ -} - -/* -- C type to C type conversion ----------------------------------------- */ - -/* Convert C type to C type. Caveat: expects to get the raw CType! -** -** Note: This is only used by the interpreter and not optimized at all. -** The JIT compiler will do a much better job specializing for each case. -*/ -void lj_cconv_ct_ct(CTState *cts, CType *d, CType *s, - uint8_t *dp, uint8_t *sp, CTInfo flags) -{ - CTSize dsize = d->size, ssize = s->size; - CTInfo dinfo = d->info, sinfo = s->info; - void *tmpptr; - - lua_assert(!ctype_isenum(dinfo) && !ctype_isenum(sinfo)); - lua_assert(!ctype_isattrib(dinfo) && !ctype_isattrib(sinfo)); - - if (ctype_type(dinfo) > CT_MAYCONVERT || ctype_type(sinfo) > CT_MAYCONVERT) - goto err_conv; - - /* Some basic sanity checks. */ - lua_assert(!ctype_isnum(dinfo) || dsize > 0); - lua_assert(!ctype_isnum(sinfo) || ssize > 0); - lua_assert(!ctype_isbool(dinfo) || dsize == 1 || dsize == 4); - lua_assert(!ctype_isbool(sinfo) || ssize == 1 || ssize == 4); - lua_assert(!ctype_isinteger(dinfo) || (1u< ssize) { /* Zero-extend or sign-extend LSB. */ -#if LJ_LE - uint8_t fill = (!(sinfo & CTF_UNSIGNED) && (sp[ssize-1]&0x80)) ? 0xff : 0; - memcpy(dp, sp, ssize); - memset(dp + ssize, fill, dsize-ssize); -#else - uint8_t fill = (!(sinfo & CTF_UNSIGNED) && (sp[0]&0x80)) ? 0xff : 0; - memset(dp, fill, dsize-ssize); - memcpy(dp + (dsize-ssize), sp, ssize); -#endif - } else { /* Copy LSB. */ -#if LJ_LE - memcpy(dp, sp, dsize); -#else - memcpy(dp, sp + (ssize-dsize), dsize); -#endif - } - break; - case CCX(I, F): { - double n; /* Always convert via double. */ - conv_I_F: - /* Convert source to double. */ - if (ssize == sizeof(double)) n = *(double *)sp; - else if (ssize == sizeof(float)) n = (double)*(float *)sp; - else goto err_conv; /* NYI: long double. */ - /* Then convert double to integer. */ - /* The conversion must exactly match the semantics of JIT-compiled code! */ - if (dsize < 4 || (dsize == 4 && !(dinfo & CTF_UNSIGNED))) { - int32_t i = (int32_t)n; - if (dsize == 4) *(int32_t *)dp = i; - else if (dsize == 2) *(int16_t *)dp = (int16_t)i; - else *(int8_t *)dp = (int8_t)i; - } else if (dsize == 4) { - *(uint32_t *)dp = (uint32_t)n; - } else if (dsize == 8) { - if (!(dinfo & CTF_UNSIGNED)) - *(int64_t *)dp = (int64_t)n; - else - *(uint64_t *)dp = lj_num2u64(n); - } else { - goto err_conv; /* NYI: conversion to >64 bit integers. */ - } - break; - } - case CCX(I, C): - s = ctype_child(cts, s); - sinfo = s->info; - ssize = s->size; - goto conv_I_F; /* Just convert re. */ - case CCX(I, P): - if (!(flags & CCF_CAST)) goto err_conv; - sinfo = CTINFO(CT_NUM, CTF_UNSIGNED); - goto conv_I_I; - case CCX(I, A): - if (!(flags & CCF_CAST)) goto err_conv; - sinfo = CTINFO(CT_NUM, CTF_UNSIGNED); - ssize = CTSIZE_PTR; - tmpptr = sp; - sp = (uint8_t *)&tmpptr; - goto conv_I_I; - - /* Destination is a floating-point number. */ - case CCX(F, B): - case CCX(F, I): { - double n; /* Always convert via double. */ - conv_F_I: - /* First convert source to double. */ - /* The conversion must exactly match the semantics of JIT-compiled code! */ - if (ssize < 4 || (ssize == 4 && !(sinfo & CTF_UNSIGNED))) { - int32_t i; - if (ssize == 4) { - i = *(int32_t *)sp; - } else if (!(sinfo & CTF_UNSIGNED)) { - if (ssize == 2) i = *(int16_t *)sp; - else i = *(int8_t *)sp; - } else { - if (ssize == 2) i = *(uint16_t *)sp; - else i = *(uint8_t *)sp; - } - n = (double)i; - } else if (ssize == 4) { - n = (double)*(uint32_t *)sp; - } else if (ssize == 8) { - if (!(sinfo & CTF_UNSIGNED)) n = (double)*(int64_t *)sp; - else n = (double)*(uint64_t *)sp; - } else { - goto err_conv; /* NYI: conversion from >64 bit integers. */ - } - /* Convert double to destination. */ - if (dsize == sizeof(double)) *(double *)dp = n; - else if (dsize == sizeof(float)) *(float *)dp = (float)n; - else goto err_conv; /* NYI: long double. */ - break; - } - case CCX(F, F): { - double n; /* Always convert via double. */ - conv_F_F: - if (ssize == dsize) goto copyval; - /* Convert source to double. */ - if (ssize == sizeof(double)) n = *(double *)sp; - else if (ssize == sizeof(float)) n = (double)*(float *)sp; - else goto err_conv; /* NYI: long double. */ - /* Convert double to destination. */ - if (dsize == sizeof(double)) *(double *)dp = n; - else if (dsize == sizeof(float)) *(float *)dp = (float)n; - else goto err_conv; /* NYI: long double. */ - break; - } - case CCX(F, C): - s = ctype_child(cts, s); - sinfo = s->info; - ssize = s->size; - goto conv_F_F; /* Ignore im, and convert from re. */ - - /* Destination is a complex number. */ - case CCX(C, I): - d = ctype_child(cts, d); - dinfo = d->info; - dsize = d->size; - memset(dp + dsize, 0, dsize); /* Clear im. */ - goto conv_F_I; /* Convert to re. */ - case CCX(C, F): - d = ctype_child(cts, d); - dinfo = d->info; - dsize = d->size; - memset(dp + dsize, 0, dsize); /* Clear im. */ - goto conv_F_F; /* Convert to re. */ - - case CCX(C, C): - if (dsize != ssize) { /* Different types: convert re/im separately. */ - CType *dc = ctype_child(cts, d); - CType *sc = ctype_child(cts, s); - lj_cconv_ct_ct(cts, dc, sc, dp, sp, flags); - lj_cconv_ct_ct(cts, dc, sc, dp + dc->size, sp + sc->size, flags); - return; - } - goto copyval; /* Otherwise this is easy. */ - - /* Destination is a vector. */ - case CCX(V, I): - case CCX(V, F): - case CCX(V, C): { - CType *dc = ctype_child(cts, d); - CTSize esize; - /* First convert the scalar to the first element. */ - lj_cconv_ct_ct(cts, dc, s, dp, sp, flags); - /* Then replicate it to the other elements (splat). */ - for (sp = dp, esize = dc->size; dsize > esize; dsize -= esize) { - dp += esize; - memcpy(dp, sp, esize); - } - break; - } - - case CCX(V, V): - /* Copy same-sized vectors, even for different lengths/element-types. */ - if (dsize != ssize) goto err_conv; - goto copyval; - - /* Destination is a pointer. */ - case CCX(P, I): - if (!(flags & CCF_CAST)) goto err_conv; - dinfo = CTINFO(CT_NUM, CTF_UNSIGNED); - goto conv_I_I; - - case CCX(P, F): - if (!(flags & CCF_CAST) || !(flags & CCF_FROMTV)) goto err_conv; - /* The signed conversion is cheaper. x64 really has 47 bit pointers. */ - dinfo = CTINFO(CT_NUM, (LJ_64 && dsize == 8) ? 0 : CTF_UNSIGNED); - goto conv_I_F; - - case CCX(P, P): - if (!lj_cconv_compatptr(cts, d, s, flags)) goto err_conv; - cdata_setptr(dp, dsize, cdata_getptr(sp, ssize)); - break; - - case CCX(P, A): - case CCX(P, S): - if (!lj_cconv_compatptr(cts, d, s, flags)) goto err_conv; - cdata_setptr(dp, dsize, sp); - break; - - /* Destination is an array. */ - case CCX(A, A): - if ((flags & CCF_CAST) || (d->info & CTF_VLA) || dsize != ssize || - d->size == CTSIZE_INVALID || !lj_cconv_compatptr(cts, d, s, flags)) - goto err_conv; - goto copyval; - - /* Destination is a struct/union. */ - case CCX(S, S): - if ((flags & CCF_CAST) || (d->info & CTF_VLA) || d != s) - goto err_conv; /* Must be exact same type. */ -copyval: /* Copy value. */ - lua_assert(dsize == ssize); - memcpy(dp, sp, dsize); - break; - - default: - err_conv: - cconv_err_conv(cts, d, s, flags); - } -} - -/* -- C type to TValue conversion ----------------------------------------- */ - -/* Convert C type to TValue. Caveat: expects to get the raw CType! */ -int lj_cconv_tv_ct(CTState *cts, CType *s, CTypeID sid, - TValue *o, uint8_t *sp) -{ - CTInfo sinfo = s->info; - if (ctype_isnum(sinfo)) { - if (!ctype_isbool(sinfo)) { - if (ctype_isinteger(sinfo) && s->size > 4) goto copyval; - if (LJ_DUALNUM && ctype_isinteger(sinfo)) { - int32_t i; - lj_cconv_ct_ct(cts, ctype_get(cts, CTID_INT32), s, - (uint8_t *)&i, sp, 0); - if ((sinfo & CTF_UNSIGNED) && i < 0) - setnumV(o, (lua_Number)(uint32_t)i); - else - setintV(o, i); - } else { - lj_cconv_ct_ct(cts, ctype_get(cts, CTID_DOUBLE), s, - (uint8_t *)&o->n, sp, 0); - /* Numbers are NOT canonicalized here! Beware of uninitialized data. */ - lua_assert(tvisnum(o)); - } - } else { - uint32_t b = s->size == 1 ? (*sp != 0) : (*(int *)sp != 0); - setboolV(o, b); - setboolV(&cts->g->tmptv2, b); /* Remember for trace recorder. */ - } - return 0; - } else if (ctype_isrefarray(sinfo) || ctype_isstruct(sinfo)) { - /* Create reference. */ - setcdataV(cts->L, o, lj_cdata_newref(cts, sp, sid)); - return 1; /* Need GC step. */ - } else { - GCcdata *cd; - CTSize sz; - copyval: /* Copy value. */ - sz = s->size; - lua_assert(sz != CTSIZE_INVALID); - /* Attributes are stripped, qualifiers are kept (but mostly ignored). */ - cd = lj_cdata_new(cts, ctype_typeid(cts, s), sz); - setcdataV(cts->L, o, cd); - memcpy(cdataptr(cd), sp, sz); - return 1; /* Need GC step. */ - } -} - -/* Convert bitfield to TValue. */ -int lj_cconv_tv_bf(CTState *cts, CType *s, TValue *o, uint8_t *sp) -{ - CTInfo info = s->info; - CTSize pos, bsz; - uint32_t val; - lua_assert(ctype_isbitfield(info)); - /* NYI: packed bitfields may cause misaligned reads. */ - switch (ctype_bitcsz(info)) { - case 4: val = *(uint32_t *)sp; break; - case 2: val = *(uint16_t *)sp; break; - case 1: val = *(uint8_t *)sp; break; - default: lua_assert(0); val = 0; break; - } - /* Check if a packed bitfield crosses a container boundary. */ - pos = ctype_bitpos(info); - bsz = ctype_bitbsz(info); - lua_assert(pos < 8*ctype_bitcsz(info)); - lua_assert(bsz > 0 && bsz <= 8*ctype_bitcsz(info)); - if (pos + bsz > 8*ctype_bitcsz(info)) - lj_err_caller(cts->L, LJ_ERR_FFI_NYIPACKBIT); - if (!(info & CTF_BOOL)) { - CTSize shift = 32 - bsz; - if (!(info & CTF_UNSIGNED)) { - setintV(o, (int32_t)(val << (shift-pos)) >> shift); - } else { - val = (val << (shift-pos)) >> shift; - if (!LJ_DUALNUM || (int32_t)val < 0) - setnumV(o, (lua_Number)(uint32_t)val); - else - setintV(o, (int32_t)val); - } - } else { - lua_assert(bsz == 1); - setboolV(o, (val >> pos) & 1); - } - return 0; /* No GC step needed. */ -} - -/* -- TValue to C type conversion ----------------------------------------- */ - -/* Convert table to array. */ -static void cconv_array_tab(CTState *cts, CType *d, - uint8_t *dp, GCtab *t, CTInfo flags) -{ - int32_t i; - CType *dc = ctype_rawchild(cts, d); /* Array element type. */ - CTSize size = d->size, esize = dc->size, ofs = 0; - for (i = 0; ; i++) { - TValue *tv = (TValue *)lj_tab_getint(t, i); - if (!tv || tvisnil(tv)) { - if (i == 0) continue; /* Try again for 1-based tables. */ - break; /* Stop at first nil. */ - } - if (ofs >= size) - cconv_err_initov(cts, d); - lj_cconv_ct_tv(cts, dc, dp + ofs, tv, flags); - ofs += esize; - } - if (size != CTSIZE_INVALID) { /* Only fill up arrays with known size. */ - if (ofs == esize) { /* Replicate a single element. */ - for (; ofs < size; ofs += esize) memcpy(dp + ofs, dp, esize); - } else { /* Otherwise fill the remainder with zero. */ - memset(dp + ofs, 0, size - ofs); - } - } -} - -/* Convert table to sub-struct/union. */ -static void cconv_substruct_tab(CTState *cts, CType *d, uint8_t *dp, - GCtab *t, int32_t *ip, CTInfo flags) -{ - CTypeID id = d->sib; - while (id) { - CType *df = ctype_get(cts, id); - id = df->sib; - if (ctype_isfield(df->info) || ctype_isbitfield(df->info)) { - TValue *tv; - int32_t i = *ip, iz = i; - if (!gcref(df->name)) continue; /* Ignore unnamed fields. */ - if (i >= 0) { - retry: - tv = (TValue *)lj_tab_getint(t, i); - if (!tv || tvisnil(tv)) { - if (i == 0) { i = 1; goto retry; } /* 1-based tables. */ - if (iz == 0) { *ip = i = -1; goto tryname; } /* Init named fields. */ - break; /* Stop at first nil. */ - } - *ip = i + 1; - } else { - tryname: - tv = (TValue *)lj_tab_getstr(t, gco2str(gcref(df->name))); - if (!tv || tvisnil(tv)) continue; - } - if (ctype_isfield(df->info)) - lj_cconv_ct_tv(cts, ctype_rawchild(cts, df), dp+df->size, tv, flags); - else - lj_cconv_bf_tv(cts, df, dp+df->size, tv); - if ((d->info & CTF_UNION)) break; - } else if (ctype_isxattrib(df->info, CTA_SUBTYPE)) { - cconv_substruct_tab(cts, ctype_rawchild(cts, df), - dp+df->size, t, ip, flags); - } /* Ignore all other entries in the chain. */ - } -} - -/* Convert table to struct/union. */ -static void cconv_struct_tab(CTState *cts, CType *d, - uint8_t *dp, GCtab *t, CTInfo flags) -{ - int32_t i = 0; - memset(dp, 0, d->size); /* Much simpler to clear the struct first. */ - cconv_substruct_tab(cts, d, dp, t, &i, flags); -} - -/* Convert TValue to C type. Caveat: expects to get the raw CType! */ -void lj_cconv_ct_tv(CTState *cts, CType *d, - uint8_t *dp, TValue *o, CTInfo flags) -{ - CTypeID sid = CTID_P_VOID; - CType *s; - void *tmpptr; - uint8_t tmpbool, *sp = (uint8_t *)&tmpptr; - if (LJ_LIKELY(tvisint(o))) { - sp = (uint8_t *)&o->i; - sid = CTID_INT32; - flags |= CCF_FROMTV; - } else if (LJ_LIKELY(tvisnum(o))) { - sp = (uint8_t *)&o->n; - sid = CTID_DOUBLE; - flags |= CCF_FROMTV; - } else if (tviscdata(o)) { - sp = cdataptr(cdataV(o)); - sid = cdataV(o)->ctypeid; - s = ctype_get(cts, sid); - if (ctype_isref(s->info)) { /* Resolve reference for value. */ - lua_assert(s->size == CTSIZE_PTR); - sp = *(void **)sp; - sid = ctype_cid(s->info); - } - s = ctype_raw(cts, sid); - if (ctype_isfunc(s->info)) { - sid = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|sid), CTSIZE_PTR); - } else { - if (ctype_isenum(s->info)) s = ctype_child(cts, s); - goto doconv; - } - } else if (tvisstr(o)) { - GCstr *str = strV(o); - if (ctype_isenum(d->info)) { /* Match string against enum constant. */ - CTSize ofs; - CType *cct = lj_ctype_getfield(cts, d, str, &ofs); - if (!cct || !ctype_isconstval(cct->info)) - goto err_conv; - lua_assert(d->size == 4); - sp = (uint8_t *)&cct->size; - sid = ctype_cid(cct->info); - } else if (ctype_isrefarray(d->info)) { /* Copy string to array. */ - CType *dc = ctype_rawchild(cts, d); - CTSize sz = str->len+1; - if (!ctype_isinteger(dc->info) || dc->size != 1) - goto err_conv; - if (d->size != 0 && d->size < sz) - sz = d->size; - memcpy(dp, strdata(str), sz); - return; - } else { /* Otherwise pass it as a const char[]. */ - sp = (uint8_t *)strdata(str); - sid = CTID_A_CCHAR; - flags |= CCF_FROMTV; - } - } else if (tvistab(o)) { - if (ctype_isarray(d->info)) { - cconv_array_tab(cts, d, dp, tabV(o), flags); - return; - } else if (ctype_isstruct(d->info)) { - cconv_struct_tab(cts, d, dp, tabV(o), flags); - return; - } else { - goto err_conv; - } - } else if (tvisbool(o)) { - tmpbool = boolV(o); - sp = &tmpbool; - sid = CTID_BOOL; - } else if (tvisnil(o)) { - tmpptr = (void *)0; - flags |= CCF_FROMTV; - } else if (tvisudata(o)) { - GCudata *ud = udataV(o); - tmpptr = uddata(ud); - if (ud->udtype == UDTYPE_IO_FILE) - tmpptr = *(void **)tmpptr; - } else if (tvislightud(o)) { - tmpptr = lightudV(o); - } else if (tvisfunc(o)) { - void *p = lj_ccallback_new(cts, d, funcV(o)); - if (p) { - *(void **)dp = p; - return; - } - goto err_conv; - } else { - err_conv: - cconv_err_convtv(cts, d, o, flags); - } - s = ctype_get(cts, sid); -doconv: - if (ctype_isenum(d->info)) d = ctype_child(cts, d); - lj_cconv_ct_ct(cts, d, s, dp, sp, flags); -} - -/* Convert TValue to bitfield. */ -void lj_cconv_bf_tv(CTState *cts, CType *d, uint8_t *dp, TValue *o) -{ - CTInfo info = d->info; - CTSize pos, bsz; - uint32_t val, mask; - lua_assert(ctype_isbitfield(info)); - if ((info & CTF_BOOL)) { - uint8_t tmpbool; - lua_assert(ctype_bitbsz(info) == 1); - lj_cconv_ct_tv(cts, ctype_get(cts, CTID_BOOL), &tmpbool, o, 0); - val = tmpbool; - } else { - CTypeID did = (info & CTF_UNSIGNED) ? CTID_UINT32 : CTID_INT32; - lj_cconv_ct_tv(cts, ctype_get(cts, did), (uint8_t *)&val, o, 0); - } - pos = ctype_bitpos(info); - bsz = ctype_bitbsz(info); - lua_assert(pos < 8*ctype_bitcsz(info)); - lua_assert(bsz > 0 && bsz <= 8*ctype_bitcsz(info)); - /* Check if a packed bitfield crosses a container boundary. */ - if (pos + bsz > 8*ctype_bitcsz(info)) - lj_err_caller(cts->L, LJ_ERR_FFI_NYIPACKBIT); - mask = ((1u << bsz) - 1u) << pos; - val = (val << pos) & mask; - /* NYI: packed bitfields may cause misaligned reads/writes. */ - switch (ctype_bitcsz(info)) { - case 4: *(uint32_t *)dp = (*(uint32_t *)dp & ~mask) | (uint32_t)val; break; - case 2: *(uint16_t *)dp = (*(uint16_t *)dp & ~mask) | (uint16_t)val; break; - case 1: *(uint8_t *)dp = (*(uint8_t *)dp & ~mask) | (uint8_t)val; break; - default: lua_assert(0); break; - } -} - -/* -- Initialize C type with TValues -------------------------------------- */ - -/* Initialize an array with TValues. */ -static void cconv_array_init(CTState *cts, CType *d, CTSize sz, uint8_t *dp, - TValue *o, MSize len) -{ - CType *dc = ctype_rawchild(cts, d); /* Array element type. */ - CTSize ofs, esize = dc->size; - MSize i; - if (len*esize > sz) - cconv_err_initov(cts, d); - for (i = 0, ofs = 0; i < len; i++, ofs += esize) - lj_cconv_ct_tv(cts, dc, dp + ofs, o + i, 0); - if (ofs == esize) { /* Replicate a single element. */ - for (; ofs < sz; ofs += esize) memcpy(dp + ofs, dp, esize); - } else { /* Otherwise fill the remainder with zero. */ - memset(dp + ofs, 0, sz - ofs); - } -} - -/* Initialize a sub-struct/union with TValues. */ -static void cconv_substruct_init(CTState *cts, CType *d, uint8_t *dp, - TValue *o, MSize len, MSize *ip) -{ - CTypeID id = d->sib; - while (id) { - CType *df = ctype_get(cts, id); - id = df->sib; - if (ctype_isfield(df->info) || ctype_isbitfield(df->info)) { - MSize i = *ip; - if (!gcref(df->name)) continue; /* Ignore unnamed fields. */ - if (i >= len) break; - *ip = i + 1; - if (ctype_isfield(df->info)) - lj_cconv_ct_tv(cts, ctype_rawchild(cts, df), dp+df->size, o + i, 0); - else - lj_cconv_bf_tv(cts, df, dp+df->size, o + i); - if ((d->info & CTF_UNION)) break; - } else if (ctype_isxattrib(df->info, CTA_SUBTYPE)) { - cconv_substruct_init(cts, ctype_rawchild(cts, df), - dp+df->size, o, len, ip); - if ((d->info & CTF_UNION)) break; - } /* Ignore all other entries in the chain. */ - } -} - -/* Initialize a struct/union with TValues. */ -static void cconv_struct_init(CTState *cts, CType *d, CTSize sz, uint8_t *dp, - TValue *o, MSize len) -{ - MSize i = 0; - memset(dp, 0, sz); /* Much simpler to clear the struct first. */ - cconv_substruct_init(cts, d, dp, o, len, &i); - if (i < len) - cconv_err_initov(cts, d); -} - -/* Check whether to use a multi-value initializer. -** This is true if an aggregate is to be initialized with a value. -** Valarrays are treated as values here so ct_tv handles (V|C, I|F). -*/ -int lj_cconv_multi_init(CTState *cts, CType *d, TValue *o) -{ - if (!(ctype_isrefarray(d->info) || ctype_isstruct(d->info))) - return 0; /* Destination is not an aggregate. */ - if (tvistab(o) || (tvisstr(o) && !ctype_isstruct(d->info))) - return 0; /* Initializer is not a value. */ - if (tviscdata(o) && lj_ctype_rawref(cts, cdataV(o)->ctypeid) == d) - return 0; /* Source and destination are identical aggregates. */ - return 1; /* Otherwise the initializer is a value. */ -} - -/* Initialize C type with TValues. Caveat: expects to get the raw CType! */ -void lj_cconv_ct_init(CTState *cts, CType *d, CTSize sz, - uint8_t *dp, TValue *o, MSize len) -{ - if (len == 0) - memset(dp, 0, sz); - else if (len == 1 && !lj_cconv_multi_init(cts, d, o)) - lj_cconv_ct_tv(cts, d, dp, o, 0); - else if (ctype_isarray(d->info)) /* Also handles valarray init with len>1. */ - cconv_array_init(cts, d, sz, dp, o, len); - else if (ctype_isstruct(d->info)) - cconv_struct_init(cts, d, sz, dp, o, len); - else - cconv_err_initov(cts, d); -} - -#endif diff --git a/subprojects/luajit/src/lj_cconv.h b/subprojects/luajit/src/lj_cconv.h deleted file mode 100644 index 0a0b66c90..000000000 --- a/subprojects/luajit/src/lj_cconv.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -** C type conversions. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_CCONV_H -#define _LJ_CCONV_H - -#include "lj_obj.h" -#include "lj_ctype.h" - -#if LJ_HASFFI - -/* Compressed C type index. ORDER CCX. */ -enum { - CCX_B, /* Bool. */ - CCX_I, /* Integer. */ - CCX_F, /* Floating-point number. */ - CCX_C, /* Complex. */ - CCX_V, /* Vector. */ - CCX_P, /* Pointer. */ - CCX_A, /* Refarray. */ - CCX_S /* Struct/union. */ -}; - -/* Convert C type info to compressed C type index. ORDER CT. ORDER CCX. */ -static LJ_AINLINE uint32_t cconv_idx(CTInfo info) -{ - uint32_t idx = ((info >> 26) & 15u); /* Dispatch bits. */ - lua_assert(ctype_type(info) <= CT_MAYCONVERT); -#if LJ_64 - idx = ((uint32_t)(U64x(f436fff5,fff7f021) >> 4*idx) & 15u); -#else - idx = (((idx < 8 ? 0xfff7f021u : 0xf436fff5) >> 4*(idx & 7u)) & 15u); -#endif - lua_assert(idx < 8); - return idx; -} - -#define cconv_idx2(dinfo, sinfo) \ - ((cconv_idx((dinfo)) << 3) + cconv_idx((sinfo))) - -#define CCX(dst, src) ((CCX_##dst << 3) + CCX_##src) - -/* Conversion flags. */ -#define CCF_CAST 0x00000001u -#define CCF_FROMTV 0x00000002u -#define CCF_SAME 0x00000004u -#define CCF_IGNQUAL 0x00000008u - -#define CCF_ARG_SHIFT 8 -#define CCF_ARG(n) ((n) << CCF_ARG_SHIFT) -#define CCF_GETARG(f) ((f) >> CCF_ARG_SHIFT) - -LJ_FUNC int lj_cconv_compatptr(CTState *cts, CType *d, CType *s, CTInfo flags); -LJ_FUNC void lj_cconv_ct_ct(CTState *cts, CType *d, CType *s, - uint8_t *dp, uint8_t *sp, CTInfo flags); -LJ_FUNC int lj_cconv_tv_ct(CTState *cts, CType *s, CTypeID sid, - TValue *o, uint8_t *sp); -LJ_FUNC int lj_cconv_tv_bf(CTState *cts, CType *s, TValue *o, uint8_t *sp); -LJ_FUNC void lj_cconv_ct_tv(CTState *cts, CType *d, - uint8_t *dp, TValue *o, CTInfo flags); -LJ_FUNC void lj_cconv_bf_tv(CTState *cts, CType *d, uint8_t *dp, TValue *o); -LJ_FUNC int lj_cconv_multi_init(CTState *cts, CType *d, TValue *o); -LJ_FUNC void lj_cconv_ct_init(CTState *cts, CType *d, CTSize sz, - uint8_t *dp, TValue *o, MSize len); - -#endif - -#endif diff --git a/subprojects/luajit/src/lj_cdata.c b/subprojects/luajit/src/lj_cdata.c deleted file mode 100644 index 49b1aa502..000000000 --- a/subprojects/luajit/src/lj_cdata.c +++ /dev/null @@ -1,285 +0,0 @@ -/* -** C data management. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include "lj_obj.h" - -#if LJ_HASFFI - -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_ctype.h" -#include "lj_cconv.h" -#include "lj_cdata.h" - -/* -- C data allocation --------------------------------------------------- */ - -/* Allocate a new C data object holding a reference to another object. */ -GCcdata *lj_cdata_newref(CTState *cts, const void *p, CTypeID id) -{ - CTypeID refid = lj_ctype_intern(cts, CTINFO_REF(id), CTSIZE_PTR); - GCcdata *cd = lj_cdata_new(cts, refid, CTSIZE_PTR); - *(const void **)cdataptr(cd) = p; - return cd; -} - -/* Allocate variable-sized or specially aligned C data object. */ -GCcdata *lj_cdata_newv(CTState *cts, CTypeID id, CTSize sz, CTSize align) -{ - global_State *g; - MSize extra = sizeof(GCcdataVar) + sizeof(GCcdata) + - (align > CT_MEMALIGN ? (1u<L, extra + sz, char); - uintptr_t adata = (uintptr_t)p + sizeof(GCcdataVar) + sizeof(GCcdata); - uintptr_t almask = (1u << align) - 1u; - GCcdata *cd = (GCcdata *)(((adata + almask) & ~almask) - sizeof(GCcdata)); - lua_assert((char *)cd - p < 65536); - cdatav(cd)->offset = (uint16_t)((char *)cd - p); - cdatav(cd)->extra = extra; - cdatav(cd)->len = sz; - g = cts->g; - setgcrefr(cd->nextgc, g->gc.root); - setgcref(g->gc.root, obj2gco(cd)); - newwhite(g, obj2gco(cd)); - cd->marked |= 0x80; - cd->gct = ~LJ_TCDATA; - cd->ctypeid = id; - return cd; -} - -/* Free a C data object. */ -void LJ_FASTCALL lj_cdata_free(global_State *g, GCcdata *cd) -{ - if (LJ_UNLIKELY(cd->marked & LJ_GC_CDATA_FIN)) { - GCobj *root; - makewhite(g, obj2gco(cd)); - markfinalized(obj2gco(cd)); - if ((root = gcref(g->gc.mmudata)) != NULL) { - setgcrefr(cd->nextgc, root->gch.nextgc); - setgcref(root->gch.nextgc, obj2gco(cd)); - setgcref(g->gc.mmudata, obj2gco(cd)); - } else { - setgcref(cd->nextgc, obj2gco(cd)); - setgcref(g->gc.mmudata, obj2gco(cd)); - } - } else if (LJ_LIKELY(!cdataisv(cd))) { - CType *ct = ctype_raw(ctype_ctsG(g), cd->ctypeid); - CTSize sz = ctype_hassize(ct->info) ? ct->size : CTSIZE_PTR; - lua_assert(ctype_hassize(ct->info) || ctype_isfunc(ct->info) || - ctype_isextern(ct->info)); - lj_mem_free(g, cd, sizeof(GCcdata) + sz); - } else { - lj_mem_free(g, memcdatav(cd), sizecdatav(cd)); - } -} - -TValue * LJ_FASTCALL lj_cdata_setfin(lua_State *L, GCcdata *cd) -{ - global_State *g = G(L); - GCtab *t = ctype_ctsG(g)->finalizer; - if (gcref(t->metatable)) { - /* Add cdata to finalizer table, if still enabled. */ - TValue *tv, tmp; - setcdataV(L, &tmp, cd); - lj_gc_anybarriert(L, t); - tv = lj_tab_set(L, t, &tmp); - cd->marked |= LJ_GC_CDATA_FIN; - return tv; - } else { - /* Otherwise return dummy TValue. */ - return &g->tmptv; - } -} - -/* -- C data indexing ----------------------------------------------------- */ - -/* Index C data by a TValue. Return CType and pointer. */ -CType *lj_cdata_index(CTState *cts, GCcdata *cd, cTValue *key, uint8_t **pp, - CTInfo *qual) -{ - uint8_t *p = (uint8_t *)cdataptr(cd); - CType *ct = ctype_get(cts, cd->ctypeid); - ptrdiff_t idx; - - /* Resolve reference for cdata object. */ - if (ctype_isref(ct->info)) { - lua_assert(ct->size == CTSIZE_PTR); - p = *(uint8_t **)p; - ct = ctype_child(cts, ct); - } - -collect_attrib: - /* Skip attributes and collect qualifiers. */ - while (ctype_isattrib(ct->info)) { - if (ctype_attrib(ct->info) == CTA_QUAL) *qual |= ct->size; - ct = ctype_child(cts, ct); - } - lua_assert(!ctype_isref(ct->info)); /* Interning rejects refs to refs. */ - - if (tvisint(key)) { - idx = (ptrdiff_t)intV(key); - goto integer_key; - } else if (tvisnum(key)) { /* Numeric key. */ - idx = LJ_64 ? (ptrdiff_t)numV(key) : (ptrdiff_t)lj_num2int(numV(key)); - integer_key: - if (ctype_ispointer(ct->info)) { - CTSize sz = lj_ctype_size(cts, ctype_cid(ct->info)); /* Element size. */ - if (sz == CTSIZE_INVALID) - lj_err_caller(cts->L, LJ_ERR_FFI_INVSIZE); - if (ctype_isptr(ct->info)) { - p = (uint8_t *)cdata_getptr(p, ct->size); - } else if ((ct->info & (CTF_VECTOR|CTF_COMPLEX))) { - if ((ct->info & CTF_COMPLEX)) idx &= 1; - *qual |= CTF_CONST; /* Valarray elements are constant. */ - } - *pp = p + idx*(int32_t)sz; - return ct; - } - } else if (tviscdata(key)) { /* Integer cdata key. */ - GCcdata *cdk = cdataV(key); - CType *ctk = ctype_raw(cts, cdk->ctypeid); - if (ctype_isenum(ctk->info)) ctk = ctype_child(cts, ctk); - if (ctype_isinteger(ctk->info)) { - lj_cconv_ct_ct(cts, ctype_get(cts, CTID_INT_PSZ), ctk, - (uint8_t *)&idx, cdataptr(cdk), 0); - goto integer_key; - } - } else if (tvisstr(key)) { /* String key. */ - GCstr *name = strV(key); - if (ctype_isstruct(ct->info)) { - CTSize ofs; - CType *fct = lj_ctype_getfieldq(cts, ct, name, &ofs, qual); - if (fct) { - *pp = p + ofs; - return fct; - } - } else if (ctype_iscomplex(ct->info)) { - if (name->len == 2) { - *qual |= CTF_CONST; /* Complex fields are constant. */ - if (strdata(name)[0] == 'r' && strdata(name)[1] == 'e') { - *pp = p; - return ct; - } else if (strdata(name)[0] == 'i' && strdata(name)[1] == 'm') { - *pp = p + (ct->size >> 1); - return ct; - } - } - } else if (cd->ctypeid == CTID_CTYPEID) { - /* Allow indexing a (pointer to) struct constructor to get constants. */ - CType *sct = ctype_raw(cts, *(CTypeID *)p); - if (ctype_isptr(sct->info)) - sct = ctype_rawchild(cts, sct); - if (ctype_isstruct(sct->info)) { - CTSize ofs; - CType *fct = lj_ctype_getfield(cts, sct, name, &ofs); - if (fct && ctype_isconstval(fct->info)) - return fct; - } - ct = sct; /* Allow resolving metamethods for constructors, too. */ - } - } - if (ctype_isptr(ct->info)) { /* Automatically perform '->'. */ - if (ctype_isstruct(ctype_rawchild(cts, ct)->info)) { - p = (uint8_t *)cdata_getptr(p, ct->size); - ct = ctype_child(cts, ct); - goto collect_attrib; - } - } - *qual |= 1; /* Lookup failed. */ - return ct; /* But return the resolved raw type. */ -} - -/* -- C data getters ------------------------------------------------------ */ - -/* Get constant value and convert to TValue. */ -static void cdata_getconst(CTState *cts, TValue *o, CType *ct) -{ - CType *ctt = ctype_child(cts, ct); - lua_assert(ctype_isinteger(ctt->info) && ctt->size <= 4); - /* Constants are already zero-extended/sign-extended to 32 bits. */ - if ((ctt->info & CTF_UNSIGNED) && (int32_t)ct->size < 0) - setnumV(o, (lua_Number)(uint32_t)ct->size); - else - setintV(o, (int32_t)ct->size); -} - -/* Get C data value and convert to TValue. */ -int lj_cdata_get(CTState *cts, CType *s, TValue *o, uint8_t *sp) -{ - CTypeID sid; - - if (ctype_isconstval(s->info)) { - cdata_getconst(cts, o, s); - return 0; /* No GC step needed. */ - } else if (ctype_isbitfield(s->info)) { - return lj_cconv_tv_bf(cts, s, o, sp); - } - - /* Get child type of pointer/array/field. */ - lua_assert(ctype_ispointer(s->info) || ctype_isfield(s->info)); - sid = ctype_cid(s->info); - s = ctype_get(cts, sid); - - /* Resolve reference for field. */ - if (ctype_isref(s->info)) { - lua_assert(s->size == CTSIZE_PTR); - sp = *(uint8_t **)sp; - sid = ctype_cid(s->info); - s = ctype_get(cts, sid); - } - - /* Skip attributes. */ - while (ctype_isattrib(s->info)) - s = ctype_child(cts, s); - - return lj_cconv_tv_ct(cts, s, sid, o, sp); -} - -/* -- C data setters ------------------------------------------------------ */ - -/* Convert TValue and set C data value. */ -void lj_cdata_set(CTState *cts, CType *d, uint8_t *dp, TValue *o, CTInfo qual) -{ - if (ctype_isconstval(d->info)) { - goto err_const; - } else if (ctype_isbitfield(d->info)) { - if (((d->info|qual) & CTF_CONST)) goto err_const; - lj_cconv_bf_tv(cts, d, dp, o); - return; - } - - /* Get child type of pointer/array/field. */ - lua_assert(ctype_ispointer(d->info) || ctype_isfield(d->info)); - d = ctype_child(cts, d); - - /* Resolve reference for field. */ - if (ctype_isref(d->info)) { - lua_assert(d->size == CTSIZE_PTR); - dp = *(uint8_t **)dp; - d = ctype_child(cts, d); - } - - /* Skip attributes and collect qualifiers. */ - for (;;) { - if (ctype_isattrib(d->info)) { - if (ctype_attrib(d->info) == CTA_QUAL) qual |= d->size; - } else { - break; - } - d = ctype_child(cts, d); - } - - lua_assert(ctype_hassize(d->info) && !ctype_isvoid(d->info)); - - if (((d->info|qual) & CTF_CONST)) { - err_const: - lj_err_caller(cts->L, LJ_ERR_FFI_WRCONST); - } - - lj_cconv_ct_tv(cts, d, dp, o, 0); -} - -#endif diff --git a/subprojects/luajit/src/lj_cdata.h b/subprojects/luajit/src/lj_cdata.h deleted file mode 100644 index 4bb65db2a..000000000 --- a/subprojects/luajit/src/lj_cdata.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -** C data management. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_CDATA_H -#define _LJ_CDATA_H - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_ctype.h" - -#if LJ_HASFFI - -/* Get C data pointer. */ -static LJ_AINLINE void *cdata_getptr(void *p, CTSize sz) -{ - if (LJ_64 && sz == 4) { /* Support 32 bit pointers on 64 bit targets. */ - return ((void *)(uintptr_t)*(uint32_t *)p); - } else { - lua_assert(sz == CTSIZE_PTR); - return *(void **)p; - } -} - -/* Set C data pointer. */ -static LJ_AINLINE void cdata_setptr(void *p, CTSize sz, const void *v) -{ - if (LJ_64 && sz == 4) { /* Support 32 bit pointers on 64 bit targets. */ - *(uint32_t *)p = (uint32_t)(uintptr_t)v; - } else { - lua_assert(sz == CTSIZE_PTR); - *(void **)p = (void *)v; - } -} - -/* Allocate fixed-size C data object. */ -static LJ_AINLINE GCcdata *lj_cdata_new(CTState *cts, CTypeID id, CTSize sz) -{ - GCcdata *cd; -#ifdef LUA_USE_ASSERT - CType *ct = ctype_raw(cts, id); - lua_assert((ctype_hassize(ct->info) ? ct->size : CTSIZE_PTR) == sz); -#endif - cd = (GCcdata *)lj_mem_newgco(cts->L, sizeof(GCcdata) + sz); - cd->gct = ~LJ_TCDATA; - cd->ctypeid = ctype_check(cts, id); - return cd; -} - -/* Variant which works without a valid CTState. */ -static LJ_AINLINE GCcdata *lj_cdata_new_(lua_State *L, CTypeID id, CTSize sz) -{ - GCcdata *cd = (GCcdata *)lj_mem_newgco(L, sizeof(GCcdata) + sz); - cd->gct = ~LJ_TCDATA; - cd->ctypeid = id; - return cd; -} - -LJ_FUNC GCcdata *lj_cdata_newref(CTState *cts, const void *pp, CTypeID id); -LJ_FUNC GCcdata *lj_cdata_newv(CTState *cts, CTypeID id, CTSize sz, - CTSize align); - -LJ_FUNC void LJ_FASTCALL lj_cdata_free(global_State *g, GCcdata *cd); -LJ_FUNCA TValue * LJ_FASTCALL lj_cdata_setfin(lua_State *L, GCcdata *cd); - -LJ_FUNC CType *lj_cdata_index(CTState *cts, GCcdata *cd, cTValue *key, - uint8_t **pp, CTInfo *qual); -LJ_FUNC int lj_cdata_get(CTState *cts, CType *s, TValue *o, uint8_t *sp); -LJ_FUNC void lj_cdata_set(CTState *cts, CType *d, uint8_t *dp, TValue *o, - CTInfo qual); - -#endif - -#endif diff --git a/subprojects/luajit/src/lj_char.c b/subprojects/luajit/src/lj_char.c deleted file mode 100644 index 11f23efe4..000000000 --- a/subprojects/luajit/src/lj_char.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -** Character types. -** Donated to the public domain. -** -** This is intended to replace the problematic libc single-byte NLS functions. -** These just don't make sense anymore with UTF-8 locales becoming the norm -** on POSIX systems. It never worked too well on Windows systems since hardly -** anyone bothered to call setlocale(). -** -** This table is hardcoded for ASCII. Identifiers include the characters -** 128-255, too. This allows for the use of all non-ASCII chars as identifiers -** in the lexer. This is a broad definition, but works well in practice -** for both UTF-8 locales and most single-byte locales (such as ISO-8859-*). -** -** If you really need proper character types for UTF-8 strings, please use -** an add-on library such as slnunicode: http://luaforge.net/projects/sln/ -*/ - -#define lj_char_c -#define LUA_CORE - -#include "lj_char.h" - -LJ_DATADEF const uint8_t lj_char_bits[257] = { - 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 152,152,152,152,152,152,152,152,152,152, 4, 4, 4, 4, 4, 4, - 4,176,176,176,176,176,176,160,160,160,160,160,160,160,160,160, - 160,160,160,160,160,160,160,160,160,160,160, 4, 4, 4, 4,132, - 4,208,208,208,208,208,208,192,192,192,192,192,192,192,192,192, - 192,192,192,192,192,192,192,192,192,192,192, 4, 4, 4, 4, 1, - 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, - 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, - 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, - 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, - 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, - 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, - 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, - 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 -}; - diff --git a/subprojects/luajit/src/lj_char.h b/subprojects/luajit/src/lj_char.h deleted file mode 100644 index c3c86d34b..000000000 --- a/subprojects/luajit/src/lj_char.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -** Character types. -** Donated to the public domain. -*/ - -#ifndef _LJ_CHAR_H -#define _LJ_CHAR_H - -#include "lj_def.h" - -#define LJ_CHAR_CNTRL 0x01 -#define LJ_CHAR_SPACE 0x02 -#define LJ_CHAR_PUNCT 0x04 -#define LJ_CHAR_DIGIT 0x08 -#define LJ_CHAR_XDIGIT 0x10 -#define LJ_CHAR_UPPER 0x20 -#define LJ_CHAR_LOWER 0x40 -#define LJ_CHAR_IDENT 0x80 -#define LJ_CHAR_ALPHA (LJ_CHAR_LOWER|LJ_CHAR_UPPER) -#define LJ_CHAR_ALNUM (LJ_CHAR_ALPHA|LJ_CHAR_DIGIT) -#define LJ_CHAR_GRAPH (LJ_CHAR_ALNUM|LJ_CHAR_PUNCT) - -/* Only pass -1 or 0..255 to these macros. Never pass a signed char! */ -#define lj_char_isa(c, t) ((lj_char_bits+1)[(c)] & t) -#define lj_char_iscntrl(c) lj_char_isa((c), LJ_CHAR_CNTRL) -#define lj_char_isspace(c) lj_char_isa((c), LJ_CHAR_SPACE) -#define lj_char_ispunct(c) lj_char_isa((c), LJ_CHAR_PUNCT) -#define lj_char_isdigit(c) lj_char_isa((c), LJ_CHAR_DIGIT) -#define lj_char_isxdigit(c) lj_char_isa((c), LJ_CHAR_XDIGIT) -#define lj_char_isupper(c) lj_char_isa((c), LJ_CHAR_UPPER) -#define lj_char_islower(c) lj_char_isa((c), LJ_CHAR_LOWER) -#define lj_char_isident(c) lj_char_isa((c), LJ_CHAR_IDENT) -#define lj_char_isalpha(c) lj_char_isa((c), LJ_CHAR_ALPHA) -#define lj_char_isalnum(c) lj_char_isa((c), LJ_CHAR_ALNUM) -#define lj_char_isgraph(c) lj_char_isa((c), LJ_CHAR_GRAPH) - -#define lj_char_toupper(c) ((c) - (lj_char_islower(c) >> 1)) -#define lj_char_tolower(c) ((c) + lj_char_isupper(c)) - -LJ_DATA const uint8_t lj_char_bits[257]; - -#endif diff --git a/subprojects/luajit/src/lj_clib.c b/subprojects/luajit/src/lj_clib.c deleted file mode 100644 index 8dc3c10e3..000000000 --- a/subprojects/luajit/src/lj_clib.c +++ /dev/null @@ -1,409 +0,0 @@ -/* -** FFI C library loader. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include "lj_obj.h" - -#if LJ_HASFFI - -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_tab.h" -#include "lj_str.h" -#include "lj_udata.h" -#include "lj_ctype.h" -#include "lj_cconv.h" -#include "lj_cdata.h" -#include "lj_clib.h" - -/* -- OS-specific functions ----------------------------------------------- */ - -#if LJ_TARGET_DLOPEN - -#include -#include - -#if defined(RTLD_DEFAULT) -#define CLIB_DEFHANDLE RTLD_DEFAULT -#elif LJ_TARGET_OSX || LJ_TARGET_BSD -#define CLIB_DEFHANDLE ((void *)(intptr_t)-2) -#else -#define CLIB_DEFHANDLE NULL -#endif - -LJ_NORET LJ_NOINLINE static void clib_error_(lua_State *L) -{ - lj_err_callermsg(L, dlerror()); -} - -#define clib_error(L, fmt, name) clib_error_(L) - -#if LJ_TARGET_CYGWIN -#define CLIB_SOPREFIX "cyg" -#else -#define CLIB_SOPREFIX "lib" -#endif - -#if LJ_TARGET_OSX -#define CLIB_SOEXT "%s.dylib" -#elif LJ_TARGET_CYGWIN -#define CLIB_SOEXT "%s.dll" -#else -#define CLIB_SOEXT "%s.so" -#endif - -static const char *clib_extname(lua_State *L, const char *name) -{ - if (!strchr(name, '/') -#if LJ_TARGET_CYGWIN - && !strchr(name, '\\') -#endif - ) { - if (!strchr(name, '.')) { - name = lj_str_pushf(L, CLIB_SOEXT, name); - L->top--; -#if LJ_TARGET_CYGWIN - } else { - return name; -#endif - } - if (!(name[0] == CLIB_SOPREFIX[0] && name[1] == CLIB_SOPREFIX[1] && - name[2] == CLIB_SOPREFIX[2])) { - name = lj_str_pushf(L, CLIB_SOPREFIX "%s", name); - L->top--; - } - } - return name; -} - -/* Check for a recognized ld script line. */ -static const char *clib_check_lds(lua_State *L, const char *buf) -{ - char *p, *e; - if ((!strncmp(buf, "GROUP", 5) || !strncmp(buf, "INPUT", 5)) && - (p = strchr(buf, '('))) { - while (*++p == ' ') ; - for (e = p; *e && *e != ' ' && *e != ')'; e++) ; - return strdata(lj_str_new(L, p, e-p)); - } - return NULL; -} - -/* Quick and dirty solution to resolve shared library name from ld script. */ -static const char *clib_resolve_lds(lua_State *L, const char *name) -{ - FILE *fp = fopen(name, "r"); - const char *p = NULL; - if (fp) { - char buf[256]; - if (fgets(buf, sizeof(buf), fp)) { - if (!strncmp(buf, "/* GNU ld script", 16)) { /* ld script magic? */ - while (fgets(buf, sizeof(buf), fp)) { /* Check all lines. */ - p = clib_check_lds(L, buf); - if (p) break; - } - } else { /* Otherwise check only the first line. */ - p = clib_check_lds(L, buf); - } - } - fclose(fp); - } - return p; -} - -static void *clib_loadlib(lua_State *L, const char *name, int global) -{ - void *h = dlopen(clib_extname(L, name), - RTLD_LAZY | (global?RTLD_GLOBAL:RTLD_LOCAL)); - if (!h) { - const char *e, *err = dlerror(); - if (*err == '/' && (e = strchr(err, ':')) && - (name = clib_resolve_lds(L, strdata(lj_str_new(L, err, e-err))))) { - h = dlopen(name, RTLD_LAZY | (global?RTLD_GLOBAL:RTLD_LOCAL)); - if (h) return h; - err = dlerror(); - } - lj_err_callermsg(L, err); - } - return h; -} - -static void clib_unloadlib(CLibrary *cl) -{ - if (cl->handle && cl->handle != CLIB_DEFHANDLE) - dlclose(cl->handle); -} - -static void *clib_getsym(CLibrary *cl, const char *name) -{ - void *p = dlsym(cl->handle, name); - return p; -} - -#elif LJ_TARGET_WINDOWS - -#define WIN32_LEAN_AND_MEAN -#include - -#ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS -#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 4 -#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT 2 -BOOL WINAPI GetModuleHandleExA(DWORD, LPCSTR, HMODULE*); -#endif - -#define CLIB_DEFHANDLE ((void *)-1) - -/* Default libraries. */ -enum { - CLIB_HANDLE_EXE, - CLIB_HANDLE_DLL, - CLIB_HANDLE_CRT, - CLIB_HANDLE_KERNEL32, - CLIB_HANDLE_USER32, - CLIB_HANDLE_GDI32, - CLIB_HANDLE_MAX -}; - -static void *clib_def_handle[CLIB_HANDLE_MAX]; - -LJ_NORET LJ_NOINLINE static void clib_error(lua_State *L, const char *fmt, - const char *name) -{ - DWORD err = GetLastError(); - char buf[128]; - if (!FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_FROM_SYSTEM, - NULL, err, 0, buf, sizeof(buf), NULL)) - buf[0] = '\0'; - lj_err_callermsg(L, lj_str_pushf(L, fmt, name, buf)); -} - -static int clib_needext(const char *s) -{ - while (*s) { - if (*s == '/' || *s == '\\' || *s == '.') return 0; - s++; - } - return 1; -} - -static const char *clib_extname(lua_State *L, const char *name) -{ - if (clib_needext(name)) { - name = lj_str_pushf(L, "%s.dll", name); - L->top--; - } - return name; -} - -static void *clib_loadlib(lua_State *L, const char *name, int global) -{ - DWORD oldwerr = GetLastError(); - void *h = (void *)LoadLibraryA(clib_extname(L, name)); - if (!h) clib_error(L, "cannot load module " LUA_QS ": %s", name); - SetLastError(oldwerr); - UNUSED(global); - return h; -} - -static void clib_unloadlib(CLibrary *cl) -{ - if (cl->handle == CLIB_DEFHANDLE) { - MSize i; - for (i = CLIB_HANDLE_KERNEL32; i < CLIB_HANDLE_MAX; i++) { - void *h = clib_def_handle[i]; - if (h) { - clib_def_handle[i] = NULL; - FreeLibrary((HINSTANCE)h); - } - } - } else if (cl->handle) { - FreeLibrary((HINSTANCE)cl->handle); - } -} - -static void *clib_getsym(CLibrary *cl, const char *name) -{ - void *p = NULL; - if (cl->handle == CLIB_DEFHANDLE) { /* Search default libraries. */ - MSize i; - for (i = 0; i < CLIB_HANDLE_MAX; i++) { - HINSTANCE h = (HINSTANCE)clib_def_handle[i]; - if (!(void *)h) { /* Resolve default library handles (once). */ - switch (i) { - case CLIB_HANDLE_EXE: GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, NULL, &h); break; - case CLIB_HANDLE_DLL: - GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - (const char *)clib_def_handle, &h); - break; - case CLIB_HANDLE_CRT: - GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - (const char *)&_fmode, &h); - break; - case CLIB_HANDLE_KERNEL32: h = LoadLibraryA("kernel32.dll"); break; - case CLIB_HANDLE_USER32: h = LoadLibraryA("user32.dll"); break; - case CLIB_HANDLE_GDI32: h = LoadLibraryA("gdi32.dll"); break; - } - if (!h) continue; - clib_def_handle[i] = (void *)h; - } - p = (void *)GetProcAddress(h, name); - if (p) break; - } - } else { - p = (void *)GetProcAddress((HINSTANCE)cl->handle, name); - } - return p; -} - -#else - -#define CLIB_DEFHANDLE NULL - -LJ_NORET LJ_NOINLINE static void clib_error(lua_State *L, const char *fmt, - const char *name) -{ - lj_err_callermsg(L, lj_str_pushf(L, fmt, name, "no support for this OS")); -} - -static void *clib_loadlib(lua_State *L, const char *name, int global) -{ - lj_err_callermsg(L, "no support for loading dynamic libraries for this OS"); - UNUSED(name); UNUSED(global); - return NULL; -} - -static void clib_unloadlib(CLibrary *cl) -{ - UNUSED(cl); -} - -static void *clib_getsym(CLibrary *cl, const char *name) -{ - UNUSED(cl); UNUSED(name); - return NULL; -} - -#endif - -/* -- C library indexing -------------------------------------------------- */ - -#if LJ_TARGET_X86 && LJ_ABI_WIN -/* Compute argument size for fastcall/stdcall functions. */ -static CTSize clib_func_argsize(CTState *cts, CType *ct) -{ - CTSize n = 0; - while (ct->sib) { - CType *d; - ct = ctype_get(cts, ct->sib); - if (ctype_isfield(ct->info)) { - d = ctype_rawchild(cts, ct); - n += ((d->size + 3) & ~3); - } - } - return n; -} -#endif - -/* Get redirected or mangled external symbol. */ -static const char *clib_extsym(CTState *cts, CType *ct, GCstr *name) -{ - if (ct->sib) { - CType *ctf = ctype_get(cts, ct->sib); - if (ctype_isxattrib(ctf->info, CTA_REDIR)) - return strdata(gco2str(gcref(ctf->name))); - } - return strdata(name); -} - -/* Index a C library by name. */ -TValue *lj_clib_index(lua_State *L, CLibrary *cl, GCstr *name) -{ - TValue *tv = lj_tab_setstr(L, cl->cache, name); - if (LJ_UNLIKELY(tvisnil(tv))) { - CTState *cts = ctype_cts(L); - CType *ct; - CTypeID id = lj_ctype_getname(cts, &ct, name, CLNS_INDEX); - if (!id) - lj_err_callerv(L, LJ_ERR_FFI_NODECL, strdata(name)); - if (ctype_isconstval(ct->info)) { - CType *ctt = ctype_child(cts, ct); - lua_assert(ctype_isinteger(ctt->info) && ctt->size <= 4); - if ((ctt->info & CTF_UNSIGNED) && (int32_t)ct->size < 0) - setnumV(tv, (lua_Number)(uint32_t)ct->size); - else - setintV(tv, (int32_t)ct->size); - } else { - const char *sym = clib_extsym(cts, ct, name); -#if LJ_TARGET_WINDOWS - DWORD oldwerr = GetLastError(); -#endif - void *p = clib_getsym(cl, sym); - GCcdata *cd; - lua_assert(ctype_isfunc(ct->info) || ctype_isextern(ct->info)); -#if LJ_TARGET_X86 && LJ_ABI_WIN - /* Retry with decorated name for fastcall/stdcall functions. */ - if (!p && ctype_isfunc(ct->info)) { - CTInfo cconv = ctype_cconv(ct->info); - if (cconv == CTCC_FASTCALL || cconv == CTCC_STDCALL) { - CTSize sz = clib_func_argsize(cts, ct); - const char *symd = lj_str_pushf(L, - cconv == CTCC_FASTCALL ? "@%s@%d" : "_%s@%d", - sym, sz); - L->top--; - p = clib_getsym(cl, symd); - } - } -#endif - if (!p) - clib_error(L, "cannot resolve symbol " LUA_QS ": %s", sym); -#if LJ_TARGET_WINDOWS - SetLastError(oldwerr); -#endif - cd = lj_cdata_new(cts, id, CTSIZE_PTR); - *(void **)cdataptr(cd) = p; - setcdataV(L, tv, cd); - } - } - return tv; -} - -/* -- C library management ------------------------------------------------ */ - -/* Create a new CLibrary object and push it on the stack. */ -static CLibrary *clib_new(lua_State *L, GCtab *mt) -{ - GCtab *t = lj_tab_new(L, 0, 0); - GCudata *ud = lj_udata_new(L, sizeof(CLibrary), t); - CLibrary *cl = (CLibrary *)uddata(ud); - cl->cache = t; - ud->udtype = UDTYPE_FFI_CLIB; - /* NOBARRIER: The GCudata is new (marked white). */ - setgcref(ud->metatable, obj2gco(mt)); - setudataV(L, L->top++, ud); - return cl; -} - -/* Load a C library. */ -void lj_clib_load(lua_State *L, GCtab *mt, GCstr *name, int global) -{ - void *handle = clib_loadlib(L, strdata(name), global); - CLibrary *cl = clib_new(L, mt); - cl->handle = handle; -} - -/* Unload a C library. */ -void lj_clib_unload(CLibrary *cl) -{ - clib_unloadlib(cl); - cl->handle = NULL; -} - -/* Create the default C library object. */ -void lj_clib_default(lua_State *L, GCtab *mt) -{ - CLibrary *cl = clib_new(L, mt); - cl->handle = CLIB_DEFHANDLE; -} - -#endif diff --git a/subprojects/luajit/src/lj_clib.h b/subprojects/luajit/src/lj_clib.h deleted file mode 100644 index fcc9dac59..000000000 --- a/subprojects/luajit/src/lj_clib.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -** FFI C library loader. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_CLIB_H -#define _LJ_CLIB_H - -#include "lj_obj.h" - -#if LJ_HASFFI - -/* Namespace for C library indexing. */ -#define CLNS_INDEX ((1u<env. */ -} CLibrary; - -LJ_FUNC TValue *lj_clib_index(lua_State *L, CLibrary *cl, GCstr *name); -LJ_FUNC void lj_clib_load(lua_State *L, GCtab *mt, GCstr *name, int global); -LJ_FUNC void lj_clib_unload(CLibrary *cl); -LJ_FUNC void lj_clib_default(lua_State *L, GCtab *mt); - -#endif - -#endif diff --git a/subprojects/luajit/src/lj_cparse.c b/subprojects/luajit/src/lj_cparse.c deleted file mode 100644 index 2ba50a722..000000000 --- a/subprojects/luajit/src/lj_cparse.c +++ /dev/null @@ -1,1881 +0,0 @@ -/* -** C declaration parser. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include "lj_obj.h" - -#if LJ_HASFFI - -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_ctype.h" -#include "lj_cparse.h" -#include "lj_frame.h" -#include "lj_vm.h" -#include "lj_char.h" -#include "lj_strscan.h" - -/* -** Important note: this is NOT a validating C parser! This is a minimal -** C declaration parser, solely for use by the LuaJIT FFI. -** -** It ought to return correct results for properly formed C declarations, -** but it may accept some invalid declarations, too (and return nonsense). -** Also, it shows rather generic error messages to avoid unnecessary bloat. -** If in doubt, please check the input against your favorite C compiler. -*/ - -/* -- C lexer ------------------------------------------------------------- */ - -/* C lexer token names. */ -static const char *const ctoknames[] = { -#define CTOKSTR(name, str) str, -CTOKDEF(CTOKSTR) -#undef CTOKSTR - NULL -}; - -/* Forward declaration. */ -LJ_NORET static void cp_err(CPState *cp, ErrMsg em); - -static const char *cp_tok2str(CPState *cp, CPToken tok) -{ - lua_assert(tok < CTOK_FIRSTDECL); - if (tok > CTOK_OFS) - return ctoknames[tok-CTOK_OFS-1]; - else if (!lj_char_iscntrl(tok)) - return lj_str_pushf(cp->L, "%c", tok); - else - return lj_str_pushf(cp->L, "char(%d)", tok); -} - -/* End-of-line? */ -static LJ_AINLINE int cp_iseol(CPChar c) -{ - return (c == '\n' || c == '\r'); -} - -/* Peek next raw character. */ -static LJ_AINLINE CPChar cp_rawpeek(CPState *cp) -{ - return (CPChar)(uint8_t)(*cp->p); -} - -static LJ_NOINLINE CPChar cp_get_bs(CPState *cp); - -/* Get next character. */ -static LJ_AINLINE CPChar cp_get(CPState *cp) -{ - cp->c = (CPChar)(uint8_t)(*cp->p++); - if (LJ_LIKELY(cp->c != '\\')) return cp->c; - return cp_get_bs(cp); -} - -/* Transparently skip backslash-escaped line breaks. */ -static LJ_NOINLINE CPChar cp_get_bs(CPState *cp) -{ - CPChar c2, c = cp_rawpeek(cp); - if (!cp_iseol(c)) return cp->c; - cp->p++; - c2 = cp_rawpeek(cp); - if (cp_iseol(c2) && c2 != c) cp->p++; - cp->linenumber++; - return cp_get(cp); -} - -/* Grow save buffer. */ -static LJ_NOINLINE void cp_save_grow(CPState *cp, CPChar c) -{ - MSize newsize; - if (cp->sb.sz >= CPARSE_MAX_BUF/2) - cp_err(cp, LJ_ERR_XELEM); - newsize = cp->sb.sz * 2; - lj_str_resizebuf(cp->L, &cp->sb, newsize); - cp->sb.buf[cp->sb.n++] = (char)c; -} - -/* Save character in buffer. */ -static LJ_AINLINE void cp_save(CPState *cp, CPChar c) -{ - if (LJ_UNLIKELY(cp->sb.n + 1 > cp->sb.sz)) - cp_save_grow(cp, c); - else - cp->sb.buf[cp->sb.n++] = (char)c; -} - -/* Skip line break. Handles "\n", "\r", "\r\n" or "\n\r". */ -static void cp_newline(CPState *cp) -{ - CPChar c = cp_rawpeek(cp); - if (cp_iseol(c) && c != cp->c) cp->p++; - cp->linenumber++; -} - -LJ_NORET static void cp_errmsg(CPState *cp, CPToken tok, ErrMsg em, ...) -{ - const char *msg, *tokstr; - lua_State *L; - va_list argp; - if (tok == 0) { - tokstr = NULL; - } else if (tok == CTOK_IDENT || tok == CTOK_INTEGER || tok == CTOK_STRING || - tok >= CTOK_FIRSTDECL) { - if (cp->sb.n == 0) cp_save(cp, '$'); - cp_save(cp, '\0'); - tokstr = cp->sb.buf; - } else { - tokstr = cp_tok2str(cp, tok); - } - L = cp->L; - va_start(argp, em); - msg = lj_str_pushvf(L, err2msg(em), argp); - va_end(argp); - if (tokstr) - msg = lj_str_pushf(L, err2msg(LJ_ERR_XNEAR), msg, tokstr); - if (cp->linenumber > 1) - msg = lj_str_pushf(L, "%s at line %d", msg, cp->linenumber); - lj_err_callermsg(L, msg); -} - -LJ_NORET LJ_NOINLINE static void cp_err_token(CPState *cp, CPToken tok) -{ - cp_errmsg(cp, cp->tok, LJ_ERR_XTOKEN, cp_tok2str(cp, tok)); -} - -LJ_NORET LJ_NOINLINE static void cp_err_badidx(CPState *cp, CType *ct) -{ - GCstr *s = lj_ctype_repr(cp->cts->L, ctype_typeid(cp->cts, ct), NULL); - cp_errmsg(cp, 0, LJ_ERR_FFI_BADIDX, strdata(s)); -} - -LJ_NORET LJ_NOINLINE static void cp_err(CPState *cp, ErrMsg em) -{ - cp_errmsg(cp, 0, em); -} - -/* -- Main lexical scanner ------------------------------------------------ */ - -/* Parse number literal. Only handles int32_t/uint32_t right now. */ -static CPToken cp_number(CPState *cp) -{ - StrScanFmt fmt; - TValue o; - do { cp_save(cp, cp->c); } while (lj_char_isident(cp_get(cp))); - cp_save(cp, '\0'); - fmt = lj_strscan_scan((const uint8_t *)cp->sb.buf, &o, STRSCAN_OPT_C); - if (fmt == STRSCAN_INT) cp->val.id = CTID_INT32; - else if (fmt == STRSCAN_U32) cp->val.id = CTID_UINT32; - else if (!(cp->mode & CPARSE_MODE_SKIP)) - cp_errmsg(cp, CTOK_INTEGER, LJ_ERR_XNUMBER); - cp->val.u32 = (uint32_t)o.i; - return CTOK_INTEGER; -} - -/* Parse identifier or keyword. */ -static CPToken cp_ident(CPState *cp) -{ - do { cp_save(cp, cp->c); } while (lj_char_isident(cp_get(cp))); - cp->str = lj_str_new(cp->L, cp->sb.buf, cp->sb.n); - cp->val.id = lj_ctype_getname(cp->cts, &cp->ct, cp->str, cp->tmask); - if (ctype_type(cp->ct->info) == CT_KW) - return ctype_cid(cp->ct->info); - return CTOK_IDENT; -} - -/* Parse parameter. */ -static CPToken cp_param(CPState *cp) -{ - CPChar c = cp_get(cp); - TValue *o = cp->param; - if (lj_char_isident(c) || c == '$') /* Reserve $xyz for future extensions. */ - cp_errmsg(cp, c, LJ_ERR_XSYNTAX); - if (!o || o >= cp->L->top) - cp_err(cp, LJ_ERR_FFI_NUMPARAM); - cp->param = o+1; - if (tvisstr(o)) { - cp->str = strV(o); - cp->val.id = 0; - cp->ct = &cp->cts->tab[0]; - return CTOK_IDENT; - } else if (tvisnumber(o)) { - cp->val.i32 = numberVint(o); - cp->val.id = CTID_INT32; - return CTOK_INTEGER; - } else { - GCcdata *cd; - if (!tviscdata(o)) - lj_err_argtype(cp->L, (int)(o-cp->L->base)+1, "type parameter"); - cd = cdataV(o); - if (cd->ctypeid == CTID_CTYPEID) - cp->val.id = *(CTypeID *)cdataptr(cd); - else - cp->val.id = cd->ctypeid; - return '$'; - } -} - -/* Parse string or character constant. */ -static CPToken cp_string(CPState *cp) -{ - CPChar delim = cp->c; - cp_get(cp); - while (cp->c != delim) { - CPChar c = cp->c; - if (c == '\0') cp_errmsg(cp, CTOK_EOF, LJ_ERR_XSTR); - if (c == '\\') { - c = cp_get(cp); - switch (c) { - case '\0': cp_errmsg(cp, CTOK_EOF, LJ_ERR_XSTR); break; - case 'a': c = '\a'; break; - case 'b': c = '\b'; break; - case 'f': c = '\f'; break; - case 'n': c = '\n'; break; - case 'r': c = '\r'; break; - case 't': c = '\t'; break; - case 'v': c = '\v'; break; - case 'e': c = 27; break; - case 'x': - c = 0; - while (lj_char_isxdigit(cp_get(cp))) - c = (c<<4) + (lj_char_isdigit(cp->c) ? cp->c-'0' : (cp->c&15)+9); - cp_save(cp, (c & 0xff)); - continue; - default: - if (lj_char_isdigit(c)) { - c -= '0'; - if (lj_char_isdigit(cp_get(cp))) { - c = c*8 + (cp->c - '0'); - if (lj_char_isdigit(cp_get(cp))) { - c = c*8 + (cp->c - '0'); - cp_get(cp); - } - } - cp_save(cp, (c & 0xff)); - continue; - } - break; - } - } - cp_save(cp, c); - cp_get(cp); - } - cp_get(cp); - if (delim == '"') { - cp->str = lj_str_new(cp->L, cp->sb.buf, cp->sb.n); - return CTOK_STRING; - } else { - if (cp->sb.n != 1) cp_err_token(cp, '\''); - cp->val.i32 = (int32_t)(char)cp->sb.buf[0]; - cp->val.id = CTID_INT32; - return CTOK_INTEGER; - } -} - -/* Skip C comment. */ -static void cp_comment_c(CPState *cp) -{ - do { - if (cp_get(cp) == '*') { - do { - if (cp_get(cp) == '/') { cp_get(cp); return; } - } while (cp->c == '*'); - } - if (cp_iseol(cp->c)) cp_newline(cp); - } while (cp->c != '\0'); -} - -/* Skip C++ comment. */ -static void cp_comment_cpp(CPState *cp) -{ - while (!cp_iseol(cp_get(cp)) && cp->c != '\0') - ; -} - -/* Lexical scanner for C. Only a minimal subset is implemented. */ -static CPToken cp_next_(CPState *cp) -{ - lj_str_resetbuf(&cp->sb); - for (;;) { - if (lj_char_isident(cp->c)) - return lj_char_isdigit(cp->c) ? cp_number(cp) : cp_ident(cp); - switch (cp->c) { - case '\n': case '\r': cp_newline(cp); /* fallthrough. */ - case ' ': case '\t': case '\v': case '\f': cp_get(cp); break; - case '"': case '\'': return cp_string(cp); - case '/': - if (cp_get(cp) == '*') cp_comment_c(cp); - else if (cp->c == '/') cp_comment_cpp(cp); - else return '/'; - break; - case '|': - if (cp_get(cp) != '|') return '|'; - cp_get(cp); return CTOK_OROR; - case '&': - if (cp_get(cp) != '&') return '&'; - cp_get(cp); return CTOK_ANDAND; - case '=': - if (cp_get(cp) != '=') return '='; - cp_get(cp); return CTOK_EQ; - case '!': - if (cp_get(cp) != '=') return '!'; - cp_get(cp); return CTOK_NE; - case '<': - if (cp_get(cp) == '=') { cp_get(cp); return CTOK_LE; } - else if (cp->c == '<') { cp_get(cp); return CTOK_SHL; } - return '<'; - case '>': - if (cp_get(cp) == '=') { cp_get(cp); return CTOK_GE; } - else if (cp->c == '>') { cp_get(cp); return CTOK_SHR; } - return '>'; - case '-': - if (cp_get(cp) != '>') return '-'; - cp_get(cp); return CTOK_DEREF; - case '$': - return cp_param(cp); - case '\0': return CTOK_EOF; - default: { CPToken c = cp->c; cp_get(cp); return c; } - } - } -} - -static LJ_NOINLINE CPToken cp_next(CPState *cp) -{ - return (cp->tok = cp_next_(cp)); -} - -/* -- C parser ------------------------------------------------------------ */ - -/* Namespaces for resolving identifiers. */ -#define CPNS_DEFAULT \ - ((1u<linenumber = 1; - cp->depth = 0; - cp->curpack = 0; - cp->packstack[0] = 255; - lj_str_initbuf(&cp->sb); - lj_str_resizebuf(cp->L, &cp->sb, LJ_MIN_SBUF); - lua_assert(cp->p != NULL); - cp_get(cp); /* Read-ahead first char. */ - cp->tok = 0; - cp->tmask = CPNS_DEFAULT; - cp_next(cp); /* Read-ahead first token. */ -} - -/* Cleanup C parser state. */ -static void cp_cleanup(CPState *cp) -{ - global_State *g = G(cp->L); - lj_str_freebuf(g, &cp->sb); -} - -/* Check and consume optional token. */ -static int cp_opt(CPState *cp, CPToken tok) -{ - if (cp->tok == tok) { cp_next(cp); return 1; } - return 0; -} - -/* Check and consume token. */ -static void cp_check(CPState *cp, CPToken tok) -{ - if (cp->tok != tok) cp_err_token(cp, tok); - cp_next(cp); -} - -/* Check if the next token may start a type declaration. */ -static int cp_istypedecl(CPState *cp) -{ - if (cp->tok >= CTOK_FIRSTDECL && cp->tok <= CTOK_LASTDECL) return 1; - if (cp->tok == CTOK_IDENT && ctype_istypedef(cp->ct->info)) return 1; - if (cp->tok == '$') return 1; - return 0; -} - -/* -- Constant expression evaluator --------------------------------------- */ - -/* Forward declarations. */ -static void cp_expr_unary(CPState *cp, CPValue *k); -static void cp_expr_sub(CPState *cp, CPValue *k, int pri); - -/* Please note that type handling is very weak here. Most ops simply -** assume integer operands. Accessors are only needed to compute types and -** return synthetic values. The only purpose of the expression evaluator -** is to compute the values of constant expressions one would typically -** find in C header files. And again: this is NOT a validating C parser! -*/ - -/* Parse comma separated expression and return last result. */ -static void cp_expr_comma(CPState *cp, CPValue *k) -{ - do { cp_expr_sub(cp, k, 0); } while (cp_opt(cp, ',')); -} - -/* Parse sizeof/alignof operator. */ -static void cp_expr_sizeof(CPState *cp, CPValue *k, int wantsz) -{ - CTSize sz; - CTInfo info; - if (cp_opt(cp, '(')) { - if (cp_istypedecl(cp)) - k->id = cp_decl_abstract(cp); - else - cp_expr_comma(cp, k); - cp_check(cp, ')'); - } else { - cp_expr_unary(cp, k); - } - info = lj_ctype_info(cp->cts, k->id, &sz); - if (wantsz) { - if (sz != CTSIZE_INVALID) - k->u32 = sz; - else if (k->id != CTID_A_CCHAR) /* Special case for sizeof("string"). */ - cp_err(cp, LJ_ERR_FFI_INVSIZE); - } else { - k->u32 = 1u << ctype_align(info); - } - k->id = CTID_UINT32; /* Really size_t. */ -} - -/* Parse prefix operators. */ -static void cp_expr_prefix(CPState *cp, CPValue *k) -{ - if (cp->tok == CTOK_INTEGER) { - *k = cp->val; cp_next(cp); - } else if (cp_opt(cp, '+')) { - cp_expr_unary(cp, k); /* Nothing to do (well, integer promotion). */ - } else if (cp_opt(cp, '-')) { - cp_expr_unary(cp, k); k->i32 = -k->i32; - } else if (cp_opt(cp, '~')) { - cp_expr_unary(cp, k); k->i32 = ~k->i32; - } else if (cp_opt(cp, '!')) { - cp_expr_unary(cp, k); k->i32 = !k->i32; k->id = CTID_INT32; - } else if (cp_opt(cp, '(')) { - if (cp_istypedecl(cp)) { /* Cast operator. */ - CTypeID id = cp_decl_abstract(cp); - cp_check(cp, ')'); - cp_expr_unary(cp, k); - k->id = id; /* No conversion performed. */ - } else { /* Sub-expression. */ - cp_expr_comma(cp, k); - cp_check(cp, ')'); - } - } else if (cp_opt(cp, '*')) { /* Indirection. */ - CType *ct; - cp_expr_unary(cp, k); - ct = lj_ctype_rawref(cp->cts, k->id); - if (!ctype_ispointer(ct->info)) - cp_err_badidx(cp, ct); - k->u32 = 0; k->id = ctype_cid(ct->info); - } else if (cp_opt(cp, '&')) { /* Address operator. */ - cp_expr_unary(cp, k); - k->id = lj_ctype_intern(cp->cts, CTINFO(CT_PTR, CTALIGN_PTR+k->id), - CTSIZE_PTR); - } else if (cp_opt(cp, CTOK_SIZEOF)) { - cp_expr_sizeof(cp, k, 1); - } else if (cp_opt(cp, CTOK_ALIGNOF)) { - cp_expr_sizeof(cp, k, 0); - } else if (cp->tok == CTOK_IDENT) { - if (ctype_type(cp->ct->info) == CT_CONSTVAL) { - k->u32 = cp->ct->size; k->id = ctype_cid(cp->ct->info); - } else if (ctype_type(cp->ct->info) == CT_EXTERN) { - k->u32 = cp->val.id; k->id = ctype_cid(cp->ct->info); - } else if (ctype_type(cp->ct->info) == CT_FUNC) { - k->u32 = cp->val.id; k->id = cp->val.id; - } else { - goto err_expr; - } - cp_next(cp); - } else if (cp->tok == CTOK_STRING) { - CTSize sz = cp->str->len; - while (cp_next(cp) == CTOK_STRING) - sz += cp->str->len; - k->u32 = sz + 1; - k->id = CTID_A_CCHAR; - } else { - err_expr: - cp_errmsg(cp, cp->tok, LJ_ERR_XSYMBOL); - } -} - -/* Parse postfix operators. */ -static void cp_expr_postfix(CPState *cp, CPValue *k) -{ - for (;;) { - CType *ct; - if (cp_opt(cp, '[')) { /* Array/pointer index. */ - CPValue k2; - cp_expr_comma(cp, &k2); - ct = lj_ctype_rawref(cp->cts, k->id); - if (!ctype_ispointer(ct->info)) { - ct = lj_ctype_rawref(cp->cts, k2.id); - if (!ctype_ispointer(ct->info)) - cp_err_badidx(cp, ct); - } - cp_check(cp, ']'); - k->u32 = 0; - } else if (cp->tok == '.' || cp->tok == CTOK_DEREF) { /* Struct deref. */ - CTSize ofs; - CType *fct; - ct = lj_ctype_rawref(cp->cts, k->id); - if (cp->tok == CTOK_DEREF) { - if (!ctype_ispointer(ct->info)) - cp_err_badidx(cp, ct); - ct = lj_ctype_rawref(cp->cts, ctype_cid(ct->info)); - } - cp_next(cp); - if (cp->tok != CTOK_IDENT) cp_err_token(cp, CTOK_IDENT); - if (!ctype_isstruct(ct->info) || ct->size == CTSIZE_INVALID || - !(fct = lj_ctype_getfield(cp->cts, ct, cp->str, &ofs)) || - ctype_isbitfield(fct->info)) { - GCstr *s = lj_ctype_repr(cp->cts->L, ctype_typeid(cp->cts, ct), NULL); - cp_errmsg(cp, 0, LJ_ERR_FFI_BADMEMBER, strdata(s), strdata(cp->str)); - } - ct = fct; - k->u32 = ctype_isconstval(ct->info) ? ct->size : 0; - cp_next(cp); - } else { - return; - } - k->id = ctype_cid(ct->info); - } -} - -/* Parse infix operators. */ -static void cp_expr_infix(CPState *cp, CPValue *k, int pri) -{ - CPValue k2; - k2.u32 = 0; k2.id = 0; /* Silence the compiler. */ - for (;;) { - switch (pri) { - case 0: - if (cp_opt(cp, '?')) { - CPValue k3; - cp_expr_comma(cp, &k2); /* Right-associative. */ - cp_check(cp, ':'); - cp_expr_sub(cp, &k3, 0); - k->u32 = k->u32 ? k2.u32 : k3.u32; - k->id = k2.id > k3.id ? k2.id : k3.id; - continue; - } - case 1: - if (cp_opt(cp, CTOK_OROR)) { - cp_expr_sub(cp, &k2, 2); k->i32 = k->u32 || k2.u32; k->id = CTID_INT32; - continue; - } - case 2: - if (cp_opt(cp, CTOK_ANDAND)) { - cp_expr_sub(cp, &k2, 3); k->i32 = k->u32 && k2.u32; k->id = CTID_INT32; - continue; - } - case 3: - if (cp_opt(cp, '|')) { - cp_expr_sub(cp, &k2, 4); k->u32 = k->u32 | k2.u32; goto arith_result; - } - case 4: - if (cp_opt(cp, '^')) { - cp_expr_sub(cp, &k2, 5); k->u32 = k->u32 ^ k2.u32; goto arith_result; - } - case 5: - if (cp_opt(cp, '&')) { - cp_expr_sub(cp, &k2, 6); k->u32 = k->u32 & k2.u32; goto arith_result; - } - case 6: - if (cp_opt(cp, CTOK_EQ)) { - cp_expr_sub(cp, &k2, 7); k->i32 = k->u32 == k2.u32; k->id = CTID_INT32; - continue; - } else if (cp_opt(cp, CTOK_NE)) { - cp_expr_sub(cp, &k2, 7); k->i32 = k->u32 != k2.u32; k->id = CTID_INT32; - continue; - } - case 7: - if (cp_opt(cp, '<')) { - cp_expr_sub(cp, &k2, 8); - if (k->id == CTID_INT32 && k2.id == CTID_INT32) - k->i32 = k->i32 < k2.i32; - else - k->i32 = k->u32 < k2.u32; - k->id = CTID_INT32; - continue; - } else if (cp_opt(cp, '>')) { - cp_expr_sub(cp, &k2, 8); - if (k->id == CTID_INT32 && k2.id == CTID_INT32) - k->i32 = k->i32 > k2.i32; - else - k->i32 = k->u32 > k2.u32; - k->id = CTID_INT32; - continue; - } else if (cp_opt(cp, CTOK_LE)) { - cp_expr_sub(cp, &k2, 8); - if (k->id == CTID_INT32 && k2.id == CTID_INT32) - k->i32 = k->i32 <= k2.i32; - else - k->i32 = k->u32 <= k2.u32; - k->id = CTID_INT32; - continue; - } else if (cp_opt(cp, CTOK_GE)) { - cp_expr_sub(cp, &k2, 8); - if (k->id == CTID_INT32 && k2.id == CTID_INT32) - k->i32 = k->i32 >= k2.i32; - else - k->i32 = k->u32 >= k2.u32; - k->id = CTID_INT32; - continue; - } - case 8: - if (cp_opt(cp, CTOK_SHL)) { - cp_expr_sub(cp, &k2, 9); k->u32 = k->u32 << k2.u32; - continue; - } else if (cp_opt(cp, CTOK_SHR)) { - cp_expr_sub(cp, &k2, 9); - if (k->id == CTID_INT32) - k->i32 = k->i32 >> k2.i32; - else - k->u32 = k->u32 >> k2.u32; - continue; - } - case 9: - if (cp_opt(cp, '+')) { - cp_expr_sub(cp, &k2, 10); k->u32 = k->u32 + k2.u32; - arith_result: - if (k2.id > k->id) k->id = k2.id; /* Trivial promotion to unsigned. */ - continue; - } else if (cp_opt(cp, '-')) { - cp_expr_sub(cp, &k2, 10); k->u32 = k->u32 - k2.u32; goto arith_result; - } - case 10: - if (cp_opt(cp, '*')) { - cp_expr_unary(cp, &k2); k->u32 = k->u32 * k2.u32; goto arith_result; - } else if (cp_opt(cp, '/')) { - cp_expr_unary(cp, &k2); - if (k2.id > k->id) k->id = k2.id; /* Trivial promotion to unsigned. */ - if (k2.u32 == 0 || - (k->id == CTID_INT32 && k->u32 == 0x80000000u && k2.i32 == -1)) - cp_err(cp, LJ_ERR_BADVAL); - if (k->id == CTID_INT32) - k->i32 = k->i32 / k2.i32; - else - k->u32 = k->u32 / k2.u32; - continue; - } else if (cp_opt(cp, '%')) { - cp_expr_unary(cp, &k2); - if (k2.id > k->id) k->id = k2.id; /* Trivial promotion to unsigned. */ - if (k2.u32 == 0 || - (k->id == CTID_INT32 && k->u32 == 0x80000000u && k2.i32 == -1)) - cp_err(cp, LJ_ERR_BADVAL); - if (k->id == CTID_INT32) - k->i32 = k->i32 % k2.i32; - else - k->u32 = k->u32 % k2.u32; - continue; - } - default: - return; - } - } -} - -/* Parse and evaluate unary expression. */ -static void cp_expr_unary(CPState *cp, CPValue *k) -{ - if (++cp->depth > CPARSE_MAX_DECLDEPTH) cp_err(cp, LJ_ERR_XLEVELS); - cp_expr_prefix(cp, k); - cp_expr_postfix(cp, k); - cp->depth--; -} - -/* Parse and evaluate sub-expression. */ -static void cp_expr_sub(CPState *cp, CPValue *k, int pri) -{ - cp_expr_unary(cp, k); - cp_expr_infix(cp, k, pri); -} - -/* Parse constant integer expression. */ -static void cp_expr_kint(CPState *cp, CPValue *k) -{ - CType *ct; - cp_expr_sub(cp, k, 0); - ct = ctype_raw(cp->cts, k->id); - if (!ctype_isinteger(ct->info)) cp_err(cp, LJ_ERR_BADVAL); -} - -/* Parse (non-negative) size expression. */ -static CTSize cp_expr_ksize(CPState *cp) -{ - CPValue k; - cp_expr_kint(cp, &k); - if (k.u32 >= 0x80000000u) cp_err(cp, LJ_ERR_FFI_INVSIZE); - return k.u32; -} - -/* -- Type declaration stack management ----------------------------------- */ - -/* Add declaration element behind the insertion position. */ -static CPDeclIdx cp_add(CPDecl *decl, CTInfo info, CTSize size) -{ - CPDeclIdx top = decl->top; - if (top >= CPARSE_MAX_DECLSTACK) cp_err(decl->cp, LJ_ERR_XLEVELS); - decl->stack[top].info = info; - decl->stack[top].size = size; - decl->stack[top].sib = 0; - setgcrefnull(decl->stack[top].name); - decl->stack[top].next = decl->stack[decl->pos].next; - decl->stack[decl->pos].next = (CTypeID1)top; - decl->top = top+1; - return top; -} - -/* Push declaration element before the insertion position. */ -static CPDeclIdx cp_push(CPDecl *decl, CTInfo info, CTSize size) -{ - return (decl->pos = cp_add(decl, info, size)); -} - -/* Push or merge attributes. */ -static void cp_push_attributes(CPDecl *decl) -{ - CType *ct = &decl->stack[decl->pos]; - if (ctype_isfunc(ct->info)) { /* Ok to modify in-place. */ -#if LJ_TARGET_X86 - if ((decl->fattr & CTFP_CCONV)) - ct->info = (ct->info & (CTMASK_NUM|CTF_VARARG|CTMASK_CID)) + - (decl->fattr & ~CTMASK_CID); -#endif - } else { - if ((decl->attr & CTFP_ALIGNED) && !(decl->mode & CPARSE_MODE_FIELD)) - cp_push(decl, CTINFO(CT_ATTRIB, CTATTRIB(CTA_ALIGN)), - ctype_align(decl->attr)); - } -} - -/* Push unrolled type to declaration stack and merge qualifiers. */ -static void cp_push_type(CPDecl *decl, CTypeID id) -{ - CType *ct = ctype_get(decl->cp->cts, id); - CTInfo info = ct->info; - CTSize size = ct->size; - switch (ctype_type(info)) { - case CT_STRUCT: case CT_ENUM: - cp_push(decl, CTINFO(CT_TYPEDEF, id), 0); /* Don't copy unique types. */ - if ((decl->attr & CTF_QUAL)) { /* Push unmerged qualifiers. */ - cp_push(decl, CTINFO(CT_ATTRIB, CTATTRIB(CTA_QUAL)), - (decl->attr & CTF_QUAL)); - decl->attr &= ~CTF_QUAL; - } - break; - case CT_ATTRIB: - if (ctype_isxattrib(info, CTA_QUAL)) - decl->attr &= ~size; /* Remove redundant qualifiers. */ - cp_push_type(decl, ctype_cid(info)); /* Unroll. */ - cp_push(decl, info & ~CTMASK_CID, size); /* Copy type. */ - break; - case CT_ARRAY: - if ((ct->info & (CTF_VECTOR|CTF_COMPLEX))) { - info |= (decl->attr & CTF_QUAL); - decl->attr &= ~CTF_QUAL; - } - cp_push_type(decl, ctype_cid(info)); /* Unroll. */ - cp_push(decl, info & ~CTMASK_CID, size); /* Copy type. */ - decl->stack[decl->pos].sib = 1; /* Mark as already checked and sized. */ - /* Note: this is not copied to the ct->sib in the C type table. */ - break; - case CT_FUNC: - /* Copy type, link parameters (shared). */ - decl->stack[cp_push(decl, info, size)].sib = ct->sib; - break; - default: - /* Copy type, merge common qualifiers. */ - cp_push(decl, info|(decl->attr & CTF_QUAL), size); - decl->attr &= ~CTF_QUAL; - break; - } -} - -/* Consume the declaration element chain and intern the C type. */ -static CTypeID cp_decl_intern(CPState *cp, CPDecl *decl) -{ - CTypeID id = 0; - CPDeclIdx idx = 0; - CTSize csize = CTSIZE_INVALID; - CTSize cinfo = 0; - do { - CType *ct = &decl->stack[idx]; - CTInfo info = ct->info; - CTInfo size = ct->size; - /* The cid is already part of info for copies of pointers/functions. */ - idx = ct->next; - if (ctype_istypedef(info)) { - lua_assert(id == 0); - id = ctype_cid(info); - /* Always refetch info/size, since struct/enum may have been completed. */ - cinfo = ctype_get(cp->cts, id)->info; - csize = ctype_get(cp->cts, id)->size; - lua_assert(ctype_isstruct(cinfo) || ctype_isenum(cinfo)); - } else if (ctype_isfunc(info)) { /* Intern function. */ - CType *fct; - CTypeID fid; - CTypeID sib; - if (id) { - CType *refct = ctype_raw(cp->cts, id); - /* Reject function or refarray return types. */ - if (ctype_isfunc(refct->info) || ctype_isrefarray(refct->info)) - cp_err(cp, LJ_ERR_FFI_INVTYPE); - } - /* No intervening attributes allowed, skip forward. */ - while (idx) { - CType *ctn = &decl->stack[idx]; - if (!ctype_isattrib(ctn->info)) break; - idx = ctn->next; /* Skip attribute. */ - } - sib = ct->sib; /* Next line may reallocate the C type table. */ - fid = lj_ctype_new(cp->cts, &fct); - csize = CTSIZE_INVALID; - fct->info = cinfo = info + id; - fct->size = size; - fct->sib = sib; - id = fid; - } else if (ctype_isattrib(info)) { - if (ctype_isxattrib(info, CTA_QUAL)) - cinfo |= size; - else if (ctype_isxattrib(info, CTA_ALIGN)) - CTF_INSERT(cinfo, ALIGN, size); - id = lj_ctype_intern(cp->cts, info+id, size); - /* Inherit csize/cinfo from original type. */ - } else { - if (ctype_isnum(info)) { /* Handle mode/vector-size attributes. */ - lua_assert(id == 0); - if (!(info & CTF_BOOL)) { - CTSize msize = ctype_msizeP(decl->attr); - CTSize vsize = ctype_vsizeP(decl->attr); - if (msize && (!(info & CTF_FP) || (msize == 4 || msize == 8))) { - CTSize malign = lj_fls(msize); - if (malign > 4) malign = 4; /* Limit alignment. */ - CTF_INSERT(info, ALIGN, malign); - size = msize; /* Override size via mode. */ - } - if (vsize) { /* Vector size set? */ - CTSize esize = lj_fls(size); - if (vsize >= esize) { - /* Intern the element type first. */ - id = lj_ctype_intern(cp->cts, info, size); - /* Then create a vector (array) with vsize alignment. */ - size = (1u << vsize); - if (vsize > 4) vsize = 4; /* Limit alignment. */ - if (ctype_align(info) > vsize) vsize = ctype_align(info); - info = CTINFO(CT_ARRAY, (info & CTF_QUAL) + CTF_VECTOR + - CTALIGN(vsize)); - } - } - } - } else if (ctype_isptr(info)) { - /* Reject pointer/ref to ref. */ - if (id && ctype_isref(ctype_raw(cp->cts, id)->info)) - cp_err(cp, LJ_ERR_FFI_INVTYPE); - if (ctype_isref(info)) { - info &= ~CTF_VOLATILE; /* Refs are always const, never volatile. */ - /* No intervening attributes allowed, skip forward. */ - while (idx) { - CType *ctn = &decl->stack[idx]; - if (!ctype_isattrib(ctn->info)) break; - idx = ctn->next; /* Skip attribute. */ - } - } - } else if (ctype_isarray(info)) { /* Check for valid array size etc. */ - if (ct->sib == 0) { /* Only check/size arrays not copied by unroll. */ - if (ctype_isref(cinfo)) /* Reject arrays of refs. */ - cp_err(cp, LJ_ERR_FFI_INVTYPE); - /* Reject VLS or unknown-sized types. */ - if (ctype_isvltype(cinfo) || csize == CTSIZE_INVALID) - cp_err(cp, LJ_ERR_FFI_INVSIZE); - /* a[] and a[?] keep their invalid size. */ - if (size != CTSIZE_INVALID) { - uint64_t xsz = (uint64_t)size * csize; - if (xsz >= 0x80000000u) cp_err(cp, LJ_ERR_FFI_INVSIZE); - size = (CTSize)xsz; - } - } - if ((cinfo & CTF_ALIGN) > (info & CTF_ALIGN)) /* Find max. align. */ - info = (info & ~CTF_ALIGN) | (cinfo & CTF_ALIGN); - info |= (cinfo & CTF_QUAL); /* Inherit qual. */ - } else { - lua_assert(ctype_isvoid(info)); - } - csize = size; - cinfo = info+id; - id = lj_ctype_intern(cp->cts, info+id, size); - } - } while (idx); - return id; -} - -/* -- C declaration parser ------------------------------------------------ */ - -#define H_(le, be) LJ_ENDIAN_SELECT(0x##le, 0x##be) - -/* Reset declaration state to declaration specifier. */ -static void cp_decl_reset(CPDecl *decl) -{ - decl->pos = decl->specpos; - decl->top = decl->specpos+1; - decl->stack[decl->specpos].next = 0; - decl->attr = decl->specattr; - decl->fattr = decl->specfattr; - decl->name = NULL; - decl->redir = NULL; -} - -/* Parse constant initializer. */ -/* NYI: FP constants and strings as initializers. */ -static CTypeID cp_decl_constinit(CPState *cp, CType **ctp, CTypeID ctypeid) -{ - CType *ctt = ctype_get(cp->cts, ctypeid); - CTInfo info; - CTSize size; - CPValue k; - CTypeID constid; - while (ctype_isattrib(ctt->info)) { /* Skip attributes. */ - ctypeid = ctype_cid(ctt->info); /* Update ID, too. */ - ctt = ctype_get(cp->cts, ctypeid); - } - info = ctt->info; - size = ctt->size; - if (!ctype_isinteger(info) || !(info & CTF_CONST) || size > 4) - cp_err(cp, LJ_ERR_FFI_INVTYPE); - cp_check(cp, '='); - cp_expr_sub(cp, &k, 0); - constid = lj_ctype_new(cp->cts, ctp); - (*ctp)->info = CTINFO(CT_CONSTVAL, CTF_CONST|ctypeid); - k.u32 <<= 8*(4-size); - if ((info & CTF_UNSIGNED)) - k.u32 >>= 8*(4-size); - else - k.u32 = (uint32_t)((int32_t)k.u32 >> 8*(4-size)); - (*ctp)->size = k.u32; - return constid; -} - -/* Parse size in parentheses as part of attribute. */ -static CTSize cp_decl_sizeattr(CPState *cp) -{ - CTSize sz; - uint32_t oldtmask = cp->tmask; - cp->tmask = CPNS_DEFAULT; /* Required for expression evaluator. */ - cp_check(cp, '('); - sz = cp_expr_ksize(cp); - cp->tmask = oldtmask; - cp_check(cp, ')'); - return sz; -} - -/* Parse alignment attribute. */ -static void cp_decl_align(CPState *cp, CPDecl *decl) -{ - CTSize al = 4; /* Unspecified alignment is 16 bytes. */ - if (cp->tok == '(') { - al = cp_decl_sizeattr(cp); - al = al ? lj_fls(al) : 0; - } - CTF_INSERT(decl->attr, ALIGN, al); - decl->attr |= CTFP_ALIGNED; -} - -/* Parse GCC asm("name") redirect. */ -static void cp_decl_asm(CPState *cp, CPDecl *decl) -{ - UNUSED(decl); - cp_next(cp); - cp_check(cp, '('); - if (cp->tok == CTOK_STRING) { - GCstr *str = cp->str; - while (cp_next(cp) == CTOK_STRING) { - lj_str_pushf(cp->L, "%s%s", strdata(str), strdata(cp->str)); - cp->L->top--; - str = strV(cp->L->top); - } - decl->redir = str; - } - cp_check(cp, ')'); -} - -/* Parse GCC __attribute__((mode(...))). */ -static void cp_decl_mode(CPState *cp, CPDecl *decl) -{ - cp_check(cp, '('); - if (cp->tok == CTOK_IDENT) { - const char *s = strdata(cp->str); - CTSize sz = 0, vlen = 0; - if (s[0] == '_' && s[1] == '_') s += 2; - if (*s == 'V') { - s++; - vlen = *s++ - '0'; - if (*s >= '0' && *s <= '9') - vlen = vlen*10 + (*s++ - '0'); - } - switch (*s++) { - case 'Q': sz = 1; break; - case 'H': sz = 2; break; - case 'S': sz = 4; break; - case 'D': sz = 8; break; - case 'T': sz = 16; break; - case 'O': sz = 32; break; - default: goto bad_size; - } - if (*s == 'I' || *s == 'F') { - CTF_INSERT(decl->attr, MSIZEP, sz); - if (vlen) CTF_INSERT(decl->attr, VSIZEP, lj_fls(vlen*sz)); - } - bad_size: - cp_next(cp); - } - cp_check(cp, ')'); -} - -/* Parse GCC __attribute__((...)). */ -static void cp_decl_gccattribute(CPState *cp, CPDecl *decl) -{ - cp_next(cp); - cp_check(cp, '('); - cp_check(cp, '('); - while (cp->tok != ')') { - if (cp->tok == CTOK_IDENT) { - GCstr *attrstr = cp->str; - cp_next(cp); - switch (attrstr->hash) { - case H_(64a9208e,8ce14319): case H_(8e6331b2,95a282af): /* aligned */ - cp_decl_align(cp, decl); - break; - case H_(42eb47de,f0ede26c): case H_(29f48a09,cf383e0c): /* packed */ - decl->attr |= CTFP_PACKED; - break; - case H_(0a84eef6,8dfab04c): case H_(995cf92c,d5696591): /* mode */ - cp_decl_mode(cp, decl); - break; - case H_(0ab31997,2d5213fa): case H_(bf875611,200e9990): /* vector_size */ - { - CTSize vsize = cp_decl_sizeattr(cp); - if (vsize) CTF_INSERT(decl->attr, VSIZEP, lj_fls(vsize)); - } - break; -#if LJ_TARGET_X86 - case H_(5ad22db8,c689b848): case H_(439150fa,65ea78cb): /* regparm */ - CTF_INSERT(decl->fattr, REGPARM, cp_decl_sizeattr(cp)); - decl->fattr |= CTFP_CCONV; - break; - case H_(18fc0b98,7ff4c074): case H_(4e62abed,0a747424): /* cdecl */ - CTF_INSERT(decl->fattr, CCONV, CTCC_CDECL); - decl->fattr |= CTFP_CCONV; - break; - case H_(72b2e41b,494c5a44): case H_(f2356d59,f25fc9bd): /* thiscall */ - CTF_INSERT(decl->fattr, CCONV, CTCC_THISCALL); - decl->fattr |= CTFP_CCONV; - break; - case H_(0d0ffc42,ab746f88): case H_(21c54ba1,7f0ca7e3): /* fastcall */ - CTF_INSERT(decl->fattr, CCONV, CTCC_FASTCALL); - decl->fattr |= CTFP_CCONV; - break; - case H_(ef76b040,9412e06a): case H_(de56697b,c750e6e1): /* stdcall */ - CTF_INSERT(decl->fattr, CCONV, CTCC_STDCALL); - decl->fattr |= CTFP_CCONV; - break; - case H_(ea78b622,f234bd8e): case H_(252ffb06,8d50f34b): /* sseregparm */ - decl->fattr |= CTF_SSEREGPARM; - decl->fattr |= CTFP_CCONV; - break; -#endif - default: /* Skip all other attributes. */ - goto skip_attr; - } - } else if (cp->tok >= CTOK_FIRSTDECL) { /* For __attribute((const)) etc. */ - cp_next(cp); - skip_attr: - if (cp_opt(cp, '(')) { - while (cp->tok != ')' && cp->tok != CTOK_EOF) cp_next(cp); - cp_check(cp, ')'); - } - } else { - break; - } - if (!cp_opt(cp, ',')) break; - } - cp_check(cp, ')'); - cp_check(cp, ')'); -} - -/* Parse MSVC __declspec(...). */ -static void cp_decl_msvcattribute(CPState *cp, CPDecl *decl) -{ - cp_next(cp); - cp_check(cp, '('); - while (cp->tok == CTOK_IDENT) { - GCstr *attrstr = cp->str; - cp_next(cp); - switch (attrstr->hash) { - case H_(bc2395fa,98f267f8): /* align */ - cp_decl_align(cp, decl); - break; - default: /* Ignore all other attributes. */ - if (cp_opt(cp, '(')) { - while (cp->tok != ')' && cp->tok != CTOK_EOF) cp_next(cp); - cp_check(cp, ')'); - } - break; - } - } - cp_check(cp, ')'); -} - -/* Parse declaration attributes (and common qualifiers). */ -static void cp_decl_attributes(CPState *cp, CPDecl *decl) -{ - for (;;) { - switch (cp->tok) { - case CTOK_CONST: decl->attr |= CTF_CONST; break; - case CTOK_VOLATILE: decl->attr |= CTF_VOLATILE; break; - case CTOK_RESTRICT: break; /* Ignore. */ - case CTOK_EXTENSION: break; /* Ignore. */ - case CTOK_ATTRIBUTE: cp_decl_gccattribute(cp, decl); continue; - case CTOK_ASM: cp_decl_asm(cp, decl); continue; - case CTOK_DECLSPEC: cp_decl_msvcattribute(cp, decl); continue; - case CTOK_CCDECL: -#if LJ_TARGET_X86 - CTF_INSERT(decl->fattr, CCONV, cp->ct->size); - decl->fattr |= CTFP_CCONV; -#endif - break; - case CTOK_PTRSZ: -#if LJ_64 - CTF_INSERT(decl->attr, MSIZEP, cp->ct->size); -#endif - break; - default: return; - } - cp_next(cp); - } -} - -/* Parse struct/union/enum name. */ -static CTypeID cp_struct_name(CPState *cp, CPDecl *sdecl, CTInfo info) -{ - CTypeID sid; - CType *ct; - cp->tmask = CPNS_STRUCT; - cp_next(cp); - cp_decl_attributes(cp, sdecl); - cp->tmask = CPNS_DEFAULT; - if (cp->tok != '{') { - if (cp->tok != CTOK_IDENT) cp_err_token(cp, CTOK_IDENT); - if (cp->val.id) { /* Name of existing struct/union/enum. */ - sid = cp->val.id; - ct = cp->ct; - if ((ct->info ^ info) & (CTMASK_NUM|CTF_UNION)) /* Wrong type. */ - cp_errmsg(cp, 0, LJ_ERR_FFI_REDEF, strdata(gco2str(gcref(ct->name)))); - } else { /* Create named, incomplete struct/union/enum. */ - if ((cp->mode & CPARSE_MODE_NOIMPLICIT)) - cp_errmsg(cp, 0, LJ_ERR_FFI_BADTAG, strdata(cp->str)); - sid = lj_ctype_new(cp->cts, &ct); - ct->info = info; - ct->size = CTSIZE_INVALID; - ctype_setname(ct, cp->str); - lj_ctype_addname(cp->cts, ct, sid); - } - cp_next(cp); - } else { /* Create anonymous, incomplete struct/union/enum. */ - sid = lj_ctype_new(cp->cts, &ct); - ct->info = info; - ct->size = CTSIZE_INVALID; - } - if (cp->tok == '{') { - if (ct->size != CTSIZE_INVALID || ct->sib) - cp_errmsg(cp, 0, LJ_ERR_FFI_REDEF, strdata(gco2str(gcref(ct->name)))); - ct->sib = 1; /* Indicate the type is currently being defined. */ - } - return sid; -} - -/* Determine field alignment. */ -static CTSize cp_field_align(CPState *cp, CType *ct, CTInfo info) -{ - CTSize align = ctype_align(info); - UNUSED(cp); UNUSED(ct); -#if (LJ_TARGET_X86 && !LJ_ABI_WIN) || (LJ_TARGET_ARM && __APPLE__) - /* The SYSV i386 and iOS ABIs limit alignment of non-vector fields to 2^2. */ - if (align > 2 && !(info & CTFP_ALIGNED)) { - if (ctype_isarray(info) && !(info & CTF_VECTOR)) { - do { - ct = ctype_rawchild(cp->cts, ct); - info = ct->info; - } while (ctype_isarray(info) && !(info & CTF_VECTOR)); - } - if (ctype_isnum(info) || ctype_isenum(info)) - align = 2; - } -#endif - return align; -} - -/* Layout struct/union fields. */ -static void cp_struct_layout(CPState *cp, CTypeID sid, CTInfo sattr) -{ - CTSize bofs = 0, bmaxofs = 0; /* Bit offset and max. bit offset. */ - CTSize maxalign = ctype_align(sattr); - CType *sct = ctype_get(cp->cts, sid); - CTInfo sinfo = sct->info; - CTypeID fieldid = sct->sib; - while (fieldid) { - CType *ct = ctype_get(cp->cts, fieldid); - CTInfo attr = ct->size; /* Field declaration attributes (temp.). */ - - if (ctype_isfield(ct->info) || - (ctype_isxattrib(ct->info, CTA_SUBTYPE) && attr)) { - CTSize align, amask; /* Alignment (pow2) and alignment mask (bits). */ - CTSize sz; - CTInfo info = lj_ctype_info(cp->cts, ctype_cid(ct->info), &sz); - CTSize bsz, csz = 8*sz; /* Field size and container size (in bits). */ - sinfo |= (info & (CTF_QUAL|CTF_VLA)); /* Merge pseudo-qualifiers. */ - - /* Check for size overflow and determine alignment. */ - if (sz >= 0x20000000u || bofs + csz < bofs || (info & CTF_VLA)) { - if (!(sz == CTSIZE_INVALID && ctype_isarray(info) && - !(sinfo & CTF_UNION))) - cp_err(cp, LJ_ERR_FFI_INVSIZE); - csz = sz = 0; /* Treat a[] and a[?] as zero-sized. */ - } - align = cp_field_align(cp, ct, info); - if (((attr|sattr) & CTFP_PACKED) || - ((attr & CTFP_ALIGNED) && ctype_align(attr) > align)) - align = ctype_align(attr); - if (cp->packstack[cp->curpack] < align) - align = cp->packstack[cp->curpack]; - if (align > maxalign) maxalign = align; - amask = (8u << align) - 1; - - bsz = ctype_bitcsz(ct->info); /* Bitfield size (temp.). */ - if (bsz == CTBSZ_FIELD || !ctype_isfield(ct->info)) { - bsz = csz; /* Regular fields or subtypes always fill the container. */ - bofs = (bofs + amask) & ~amask; /* Start new aligned field. */ - ct->size = (bofs >> 3); /* Store field offset. */ - } else { /* Bitfield. */ - if (bsz == 0 || (attr & CTFP_ALIGNED) || - (!((attr|sattr) & CTFP_PACKED) && (bofs & amask) + bsz > csz)) - bofs = (bofs + amask) & ~amask; /* Start new aligned field. */ - - /* Prefer regular field over bitfield. */ - if (bsz == csz && (bofs & amask) == 0) { - ct->info = CTINFO(CT_FIELD, ctype_cid(ct->info)); - ct->size = (bofs >> 3); /* Store field offset. */ - } else { - ct->info = CTINFO(CT_BITFIELD, - (info & (CTF_QUAL|CTF_UNSIGNED|CTF_BOOL)) + - (csz << (CTSHIFT_BITCSZ-3)) + (bsz << CTSHIFT_BITBSZ)); -#if LJ_BE - ct->info += ((csz - (bofs & (csz-1)) - bsz) << CTSHIFT_BITPOS); -#else - ct->info += ((bofs & (csz-1)) << CTSHIFT_BITPOS); -#endif - ct->size = ((bofs & ~(csz-1)) >> 3); /* Store container offset. */ - } - } - - /* Determine next offset or max. offset. */ - if ((sinfo & CTF_UNION)) { - if (bsz > bmaxofs) bmaxofs = bsz; - } else { - bofs += bsz; - } - } /* All other fields in the chain are already set up. */ - - fieldid = ct->sib; - } - - /* Complete struct/union. */ - sct->info = sinfo + CTALIGN(maxalign); - bofs = (sinfo & CTF_UNION) ? bmaxofs : bofs; - maxalign = (8u << maxalign) - 1; - sct->size = (((bofs + maxalign) & ~maxalign) >> 3); -} - -/* Parse struct/union declaration. */ -static CTypeID cp_decl_struct(CPState *cp, CPDecl *sdecl, CTInfo sinfo) -{ - CTypeID sid = cp_struct_name(cp, sdecl, sinfo); - if (cp_opt(cp, '{')) { /* Struct/union definition. */ - CTypeID lastid = sid; - int lastdecl = 0; - while (cp->tok != '}') { - CPDecl decl; - CPscl scl = cp_decl_spec(cp, &decl, CDF_STATIC); - decl.mode = scl ? CPARSE_MODE_DIRECT : - CPARSE_MODE_DIRECT|CPARSE_MODE_ABSTRACT|CPARSE_MODE_FIELD; - - for (;;) { - CTypeID ctypeid; - - if (lastdecl) cp_err_token(cp, '}'); - - /* Parse field declarator. */ - decl.bits = CTSIZE_INVALID; - cp_declarator(cp, &decl); - ctypeid = cp_decl_intern(cp, &decl); - - if ((scl & CDF_STATIC)) { /* Static constant in struct namespace. */ - CType *ct; - CTypeID fieldid = cp_decl_constinit(cp, &ct, ctypeid); - ctype_get(cp->cts, lastid)->sib = fieldid; - lastid = fieldid; - ctype_setname(ct, decl.name); - } else { - CTSize bsz = CTBSZ_FIELD; /* Temp. for layout phase. */ - CType *ct; - CTypeID fieldid = lj_ctype_new(cp->cts, &ct); /* Do this first. */ - CType *tct = ctype_raw(cp->cts, ctypeid); - - if (decl.bits == CTSIZE_INVALID) { /* Regular field. */ - if (ctype_isarray(tct->info) && tct->size == CTSIZE_INVALID) - lastdecl = 1; /* a[] or a[?] must be the last declared field. */ - - /* Accept transparent struct/union/enum. */ - if (!decl.name) { - if (!((ctype_isstruct(tct->info) && !(tct->info & CTF_VLA)) || - ctype_isenum(tct->info))) - cp_err_token(cp, CTOK_IDENT); - ct->info = CTINFO(CT_ATTRIB, CTATTRIB(CTA_SUBTYPE) + ctypeid); - ct->size = ctype_isstruct(tct->info) ? - (decl.attr|0x80000000u) : 0; /* For layout phase. */ - goto add_field; - } - } else { /* Bitfield. */ - bsz = decl.bits; - if (!ctype_isinteger_or_bool(tct->info) || - (bsz == 0 && decl.name) || 8*tct->size > CTBSZ_MAX || - bsz > ((tct->info & CTF_BOOL) ? 1 : 8*tct->size)) - cp_errmsg(cp, ':', LJ_ERR_BADVAL); - } - - /* Create temporary field for layout phase. */ - ct->info = CTINFO(CT_FIELD, ctypeid + (bsz << CTSHIFT_BITCSZ)); - ct->size = decl.attr; - if (decl.name) ctype_setname(ct, decl.name); - - add_field: - ctype_get(cp->cts, lastid)->sib = fieldid; - lastid = fieldid; - } - if (!cp_opt(cp, ',')) break; - cp_decl_reset(&decl); - } - cp_check(cp, ';'); - } - cp_check(cp, '}'); - ctype_get(cp->cts, lastid)->sib = 0; /* Drop sib = 1 for empty structs. */ - cp_decl_attributes(cp, sdecl); /* Layout phase needs postfix attributes. */ - cp_struct_layout(cp, sid, sdecl->attr); - } - return sid; -} - -/* Parse enum declaration. */ -static CTypeID cp_decl_enum(CPState *cp, CPDecl *sdecl) -{ - CTypeID eid = cp_struct_name(cp, sdecl, CTINFO(CT_ENUM, CTID_VOID)); - CTInfo einfo = CTINFO(CT_ENUM, CTALIGN(2) + CTID_UINT32); - CTSize esize = 4; /* Only 32 bit enums are supported. */ - if (cp_opt(cp, '{')) { /* Enum definition. */ - CPValue k; - CTypeID lastid = eid; - k.u32 = 0; - k.id = CTID_INT32; - do { - GCstr *name = cp->str; - if (cp->tok != CTOK_IDENT) cp_err_token(cp, CTOK_IDENT); - if (cp->val.id) cp_errmsg(cp, 0, LJ_ERR_FFI_REDEF, strdata(name)); - cp_next(cp); - if (cp_opt(cp, '=')) { - cp_expr_kint(cp, &k); - if (k.id == CTID_UINT32) { - /* C99 says that enum constants are always (signed) integers. - ** But since unsigned constants like 0x80000000 are quite common, - ** those are left as uint32_t. - */ - if (k.i32 >= 0) k.id = CTID_INT32; - } else { - /* OTOH it's common practice and even mandated by some ABIs - ** that the enum type itself is unsigned, unless there are any - ** negative constants. - */ - k.id = CTID_INT32; - if (k.i32 < 0) einfo = CTINFO(CT_ENUM, CTALIGN(2) + CTID_INT32); - } - } - /* Add named enum constant. */ - { - CType *ct; - CTypeID constid = lj_ctype_new(cp->cts, &ct); - ctype_get(cp->cts, lastid)->sib = constid; - lastid = constid; - ctype_setname(ct, name); - ct->info = CTINFO(CT_CONSTVAL, CTF_CONST|k.id); - ct->size = k.u32++; - if (k.u32 == 0x80000000u) k.id = CTID_UINT32; - lj_ctype_addname(cp->cts, ct, constid); - } - if (!cp_opt(cp, ',')) break; - } while (cp->tok != '}'); /* Trailing ',' is ok. */ - cp_check(cp, '}'); - /* Complete enum. */ - ctype_get(cp->cts, eid)->info = einfo; - ctype_get(cp->cts, eid)->size = esize; - } - return eid; -} - -/* Parse declaration specifiers. */ -static CPscl cp_decl_spec(CPState *cp, CPDecl *decl, CPscl scl) -{ - uint32_t cds = 0, sz = 0; - CTypeID tdef = 0; - - decl->cp = cp; - decl->mode = cp->mode; - decl->name = NULL; - decl->redir = NULL; - decl->attr = 0; - decl->fattr = 0; - decl->pos = decl->top = 0; - decl->stack[0].next = 0; - - for (;;) { /* Parse basic types. */ - cp_decl_attributes(cp, decl); - if (cp->tok >= CTOK_FIRSTDECL && cp->tok <= CTOK_LASTDECLFLAG) { - uint32_t cbit; - if (cp->ct->size) { - if (sz) goto end_decl; - sz = cp->ct->size; - } - cbit = (1u << (cp->tok - CTOK_FIRSTDECL)); - cds = cds | cbit | ((cbit & cds & CDF_LONG) << 1); - if (cp->tok >= CTOK_FIRSTSCL) { - if (!(scl & cbit)) cp_errmsg(cp, cp->tok, LJ_ERR_FFI_BADSCL); - } else if (tdef) { - goto end_decl; - } - cp_next(cp); - continue; - } - if (sz || tdef || - (cds & (CDF_SHORT|CDF_LONG|CDF_SIGNED|CDF_UNSIGNED|CDF_COMPLEX))) - break; - switch (cp->tok) { - case CTOK_STRUCT: - tdef = cp_decl_struct(cp, decl, CTINFO(CT_STRUCT, 0)); - continue; - case CTOK_UNION: - tdef = cp_decl_struct(cp, decl, CTINFO(CT_STRUCT, CTF_UNION)); - continue; - case CTOK_ENUM: - tdef = cp_decl_enum(cp, decl); - continue; - case CTOK_IDENT: - if (ctype_istypedef(cp->ct->info)) { - tdef = ctype_cid(cp->ct->info); /* Get typedef. */ - cp_next(cp); - continue; - } - break; - case '$': - tdef = cp->val.id; - cp_next(cp); - continue; - default: - break; - } - break; - } -end_decl: - - if ((cds & CDF_COMPLEX)) /* Use predefined complex types. */ - tdef = sz == 4 ? CTID_COMPLEX_FLOAT : CTID_COMPLEX_DOUBLE; - - if (tdef) { - cp_push_type(decl, tdef); - } else if ((cds & CDF_VOID)) { - cp_push(decl, CTINFO(CT_VOID, (decl->attr & CTF_QUAL)), CTSIZE_INVALID); - decl->attr &= ~CTF_QUAL; - } else { - /* Determine type info and size. */ - CTInfo info = CTINFO(CT_NUM, (cds & CDF_UNSIGNED) ? CTF_UNSIGNED : 0); - if ((cds & CDF_BOOL)) { - if ((cds & ~(CDF_SCL|CDF_BOOL|CDF_INT|CDF_SIGNED|CDF_UNSIGNED))) - cp_errmsg(cp, 0, LJ_ERR_FFI_INVTYPE); - info |= CTF_BOOL; - if (!(cds & CDF_SIGNED)) info |= CTF_UNSIGNED; - if (!sz) { - sz = 1; - } - } else if ((cds & CDF_FP)) { - info = CTINFO(CT_NUM, CTF_FP); - if ((cds & CDF_LONG)) sz = sizeof(long double); - } else if ((cds & CDF_CHAR)) { - if ((cds & (CDF_CHAR|CDF_SIGNED|CDF_UNSIGNED)) == CDF_CHAR) - info |= CTF_UCHAR; /* Handle platforms where char is unsigned. */ - } else if ((cds & CDF_SHORT)) { - sz = sizeof(short); - } else if ((cds & CDF_LONGLONG)) { - sz = 8; - } else if ((cds & CDF_LONG)) { - info |= CTF_LONG; - sz = sizeof(long); - } else if (!sz) { - if (!(cds & (CDF_SIGNED|CDF_UNSIGNED))) - cp_errmsg(cp, cp->tok, LJ_ERR_FFI_DECLSPEC); - sz = sizeof(int); - } - lua_assert(sz != 0); - info += CTALIGN(lj_fls(sz)); /* Use natural alignment. */ - info += (decl->attr & CTF_QUAL); /* Merge qualifiers. */ - cp_push(decl, info, sz); - decl->attr &= ~CTF_QUAL; - } - decl->specpos = decl->pos; - decl->specattr = decl->attr; - decl->specfattr = decl->fattr; - return (cds & CDF_SCL); /* Return storage class. */ -} - -/* Parse array declaration. */ -static void cp_decl_array(CPState *cp, CPDecl *decl) -{ - CTInfo info = CTINFO(CT_ARRAY, 0); - CTSize nelem = CTSIZE_INVALID; /* Default size for a[] or a[?]. */ - cp_decl_attributes(cp, decl); - if (cp_opt(cp, '?')) - info |= CTF_VLA; /* Create variable-length array a[?]. */ - else if (cp->tok != ']') - nelem = cp_expr_ksize(cp); - cp_check(cp, ']'); - cp_add(decl, info, nelem); -} - -/* Parse function declaration. */ -static void cp_decl_func(CPState *cp, CPDecl *fdecl) -{ - CTSize nargs = 0; - CTInfo info = CTINFO(CT_FUNC, 0); - CTypeID lastid = 0, anchor = 0; - if (cp->tok != ')') { - do { - CPDecl decl; - CTypeID ctypeid, fieldid; - CType *ct; - if (cp_opt(cp, '.')) { /* Vararg function. */ - cp_check(cp, '.'); /* Workaround for the minimalistic lexer. */ - cp_check(cp, '.'); - info |= CTF_VARARG; - break; - } - cp_decl_spec(cp, &decl, CDF_REGISTER); - decl.mode = CPARSE_MODE_DIRECT|CPARSE_MODE_ABSTRACT; - cp_declarator(cp, &decl); - ctypeid = cp_decl_intern(cp, &decl); - ct = ctype_raw(cp->cts, ctypeid); - if (ctype_isvoid(ct->info)) - break; - else if (ctype_isrefarray(ct->info)) - ctypeid = lj_ctype_intern(cp->cts, - CTINFO(CT_PTR, CTALIGN_PTR|ctype_cid(ct->info)), CTSIZE_PTR); - else if (ctype_isfunc(ct->info)) - ctypeid = lj_ctype_intern(cp->cts, - CTINFO(CT_PTR, CTALIGN_PTR|ctypeid), CTSIZE_PTR); - /* Add new parameter. */ - fieldid = lj_ctype_new(cp->cts, &ct); - if (anchor) - ctype_get(cp->cts, lastid)->sib = fieldid; - else - anchor = fieldid; - lastid = fieldid; - if (decl.name) ctype_setname(ct, decl.name); - ct->info = CTINFO(CT_FIELD, ctypeid); - ct->size = nargs++; - } while (cp_opt(cp, ',')); - } - cp_check(cp, ')'); - if (cp_opt(cp, '{')) { /* Skip function definition. */ - int level = 1; - cp->mode |= CPARSE_MODE_SKIP; - for (;;) { - if (cp->tok == '{') level++; - else if (cp->tok == '}' && --level == 0) break; - else if (cp->tok == CTOK_EOF) cp_err_token(cp, '}'); - cp_next(cp); - } - cp->mode &= ~CPARSE_MODE_SKIP; - cp->tok = ';'; /* Ok for cp_decl_multi(), error in cp_decl_single(). */ - } - info |= (fdecl->fattr & ~CTMASK_CID); - fdecl->fattr = 0; - fdecl->stack[cp_add(fdecl, info, nargs)].sib = anchor; -} - -/* Parse declarator. */ -static void cp_declarator(CPState *cp, CPDecl *decl) -{ - if (++cp->depth > CPARSE_MAX_DECLDEPTH) cp_err(cp, LJ_ERR_XLEVELS); - - for (;;) { /* Head of declarator. */ - if (cp_opt(cp, '*')) { /* Pointer. */ - CTSize sz; - CTInfo info; - cp_decl_attributes(cp, decl); - sz = CTSIZE_PTR; - info = CTINFO(CT_PTR, CTALIGN_PTR); -#if LJ_64 - if (ctype_msizeP(decl->attr) == 4) { - sz = 4; - info = CTINFO(CT_PTR, CTALIGN(2)); - } -#endif - info += (decl->attr & (CTF_QUAL|CTF_REF)); - decl->attr &= ~(CTF_QUAL|(CTMASK_MSIZEP<attr &= ~(CTF_QUAL|(CTMASK_MSIZEP<mode & CPARSE_MODE_ABSTRACT) && - (cp->tok == ')' || cp_istypedecl(cp))) goto func_decl; - pos = decl->pos; - cp_declarator(cp, decl); - cp_check(cp, ')'); - decl->pos = pos; - } else if (cp->tok == CTOK_IDENT) { /* Direct declarator. */ - if (!(decl->mode & CPARSE_MODE_DIRECT)) cp_err_token(cp, CTOK_EOF); - decl->name = cp->str; - decl->nameid = cp->val.id; - cp_next(cp); - } else { /* Abstract declarator. */ - if (!(decl->mode & CPARSE_MODE_ABSTRACT)) cp_err_token(cp, CTOK_IDENT); - } - - for (;;) { /* Tail of declarator. */ - if (cp_opt(cp, '[')) { /* Array. */ - cp_decl_array(cp, decl); - } else if (cp_opt(cp, '(')) { /* Function. */ - func_decl: - cp_decl_func(cp, decl); - } else { - break; - } - } - - if ((decl->mode & CPARSE_MODE_FIELD) && cp_opt(cp, ':')) /* Field width. */ - decl->bits = cp_expr_ksize(cp); - - /* Process postfix attributes. */ - cp_decl_attributes(cp, decl); - cp_push_attributes(decl); - - cp->depth--; -} - -/* Parse an abstract type declaration and return it's C type ID. */ -static CTypeID cp_decl_abstract(CPState *cp) -{ - CPDecl decl; - cp_decl_spec(cp, &decl, 0); - decl.mode = CPARSE_MODE_ABSTRACT; - cp_declarator(cp, &decl); - return cp_decl_intern(cp, &decl); -} - -/* Handle pragmas. */ -static void cp_pragma(CPState *cp, BCLine pragmaline) -{ - cp_next(cp); - if (cp->tok == CTOK_IDENT && - cp->str->hash == H_(e79b999f,42ca3e85)) { /* pack */ - cp_next(cp); - cp_check(cp, '('); - if (cp->tok == CTOK_IDENT) { - if (cp->str->hash == H_(738e923c,a1b65954)) { /* push */ - if (cp->curpack < CPARSE_MAX_PACKSTACK) { - cp->packstack[cp->curpack+1] = cp->packstack[cp->curpack]; - cp->curpack++; - } - } else if (cp->str->hash == H_(6c71cf27,6c71cf27)) { /* pop */ - if (cp->curpack > 0) cp->curpack--; - } else { - cp_errmsg(cp, cp->tok, LJ_ERR_XSYMBOL); - } - cp_next(cp); - if (!cp_opt(cp, ',')) goto end_pack; - } - if (cp->tok == CTOK_INTEGER) { - cp->packstack[cp->curpack] = cp->val.u32 ? lj_fls(cp->val.u32) : 0; - cp_next(cp); - } else { - cp->packstack[cp->curpack] = 255; - } - end_pack: - cp_check(cp, ')'); - } else { /* Ignore all other pragmas. */ - while (cp->tok != CTOK_EOF && cp->linenumber == pragmaline) - cp_next(cp); - } -} - -/* Parse multiple C declarations of types or extern identifiers. */ -static void cp_decl_multi(CPState *cp) -{ - int first = 1; - while (cp->tok != CTOK_EOF) { - CPDecl decl; - CPscl scl; - if (cp_opt(cp, ';')) { /* Skip empty statements. */ - first = 0; - continue; - } - if (cp->tok == '#') { /* Workaround, since we have no preprocessor, yet. */ - BCLine pragmaline = cp->linenumber; - if (!(cp_next(cp) == CTOK_IDENT && - cp->str->hash == H_(f5e6b4f8,1d509107))) /* pragma */ - cp_errmsg(cp, cp->tok, LJ_ERR_XSYMBOL); - cp_pragma(cp, pragmaline); - continue; - } - scl = cp_decl_spec(cp, &decl, CDF_TYPEDEF|CDF_EXTERN|CDF_STATIC); - if ((cp->tok == ';' || cp->tok == CTOK_EOF) && - ctype_istypedef(decl.stack[0].info)) { - CTInfo info = ctype_rawchild(cp->cts, &decl.stack[0])->info; - if (ctype_isstruct(info) || ctype_isenum(info)) - goto decl_end; /* Accept empty declaration of struct/union/enum. */ - } - for (;;) { - CTypeID ctypeid; - cp_declarator(cp, &decl); - ctypeid = cp_decl_intern(cp, &decl); - if (decl.name && !decl.nameid) { /* NYI: redeclarations are ignored. */ - CType *ct; - CTypeID id; - if ((scl & CDF_TYPEDEF)) { /* Create new typedef. */ - id = lj_ctype_new(cp->cts, &ct); - ct->info = CTINFO(CT_TYPEDEF, ctypeid); - goto noredir; - } else if (ctype_isfunc(ctype_get(cp->cts, ctypeid)->info)) { - /* Treat both static and extern function declarations as extern. */ - ct = ctype_get(cp->cts, ctypeid); - /* We always get new anonymous functions (typedefs are copied). */ - lua_assert(gcref(ct->name) == NULL); - id = ctypeid; /* Just name it. */ - } else if ((scl & CDF_STATIC)) { /* Accept static constants. */ - id = cp_decl_constinit(cp, &ct, ctypeid); - goto noredir; - } else { /* External references have extern or no storage class. */ - id = lj_ctype_new(cp->cts, &ct); - ct->info = CTINFO(CT_EXTERN, ctypeid); - } - if (decl.redir) { /* Add attribute for redirected symbol name. */ - CType *cta; - CTypeID aid = lj_ctype_new(cp->cts, &cta); - ct = ctype_get(cp->cts, id); /* Table may have been reallocated. */ - cta->info = CTINFO(CT_ATTRIB, CTATTRIB(CTA_REDIR)); - cta->sib = ct->sib; - ct->sib = aid; - ctype_setname(cta, decl.redir); - } - noredir: - ctype_setname(ct, decl.name); - lj_ctype_addname(cp->cts, ct, id); - } - if (!cp_opt(cp, ',')) break; - cp_decl_reset(&decl); - } - decl_end: - if (cp->tok == CTOK_EOF && first) break; /* May omit ';' for 1 decl. */ - first = 0; - cp_check(cp, ';'); - } -} - -/* Parse a single C type declaration. */ -static void cp_decl_single(CPState *cp) -{ - CPDecl decl; - cp_decl_spec(cp, &decl, 0); - cp_declarator(cp, &decl); - cp->val.id = cp_decl_intern(cp, &decl); - if (cp->tok != CTOK_EOF) cp_err_token(cp, CTOK_EOF); -} - -#undef H_ - -/* ------------------------------------------------------------------------ */ - -/* Protected callback for C parser. */ -static TValue *cpcparser(lua_State *L, lua_CFunction dummy, void *ud) -{ - CPState *cp = (CPState *)ud; - UNUSED(dummy); - cframe_errfunc(L->cframe) = -1; /* Inherit error function. */ - cp_init(cp); - if ((cp->mode & CPARSE_MODE_MULTI)) - cp_decl_multi(cp); - else - cp_decl_single(cp); - if (cp->param && cp->param != cp->L->top) - cp_err(cp, LJ_ERR_FFI_NUMPARAM); - lua_assert(cp->depth == 0); - return NULL; -} - -/* C parser. */ -int lj_cparse(CPState *cp) -{ - LJ_CTYPE_SAVE(cp->cts); - int errcode = lj_vm_cpcall(cp->L, NULL, cp, cpcparser); - if (errcode) - LJ_CTYPE_RESTORE(cp->cts); - cp_cleanup(cp); - return errcode; -} - -#endif diff --git a/subprojects/luajit/src/lj_cparse.h b/subprojects/luajit/src/lj_cparse.h deleted file mode 100644 index bad1060bb..000000000 --- a/subprojects/luajit/src/lj_cparse.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -** C declaration parser. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_CPARSE_H -#define _LJ_CPARSE_H - -#include "lj_obj.h" -#include "lj_ctype.h" - -#if LJ_HASFFI - -/* C parser limits. */ -#define CPARSE_MAX_BUF 32768 /* Max. token buffer size. */ -#define CPARSE_MAX_DECLSTACK 100 /* Max. declaration stack depth. */ -#define CPARSE_MAX_DECLDEPTH 20 /* Max. recursive declaration depth. */ -#define CPARSE_MAX_PACKSTACK 7 /* Max. pack pragma stack depth. */ - -/* Flags for C parser mode. */ -#define CPARSE_MODE_MULTI 1 /* Process multiple declarations. */ -#define CPARSE_MODE_ABSTRACT 2 /* Accept abstract declarators. */ -#define CPARSE_MODE_DIRECT 4 /* Accept direct declarators. */ -#define CPARSE_MODE_FIELD 8 /* Accept field width in bits, too. */ -#define CPARSE_MODE_NOIMPLICIT 16 /* Reject implicit declarations. */ -#define CPARSE_MODE_SKIP 32 /* Skip definitions, ignore errors. */ - -typedef int CPChar; /* C parser character. Unsigned ext. from char. */ -typedef int CPToken; /* C parser token. */ - -/* C parser internal value representation. */ -typedef struct CPValue { - union { - int32_t i32; /* Value for CTID_INT32. */ - uint32_t u32; /* Value for CTID_UINT32. */ - }; - CTypeID id; /* C Type ID of the value. */ -} CPValue; - -/* C parser state. */ -typedef struct CPState { - CPChar c; /* Current character. */ - CPToken tok; /* Current token. */ - CPValue val; /* Token value. */ - GCstr *str; /* Interned string of identifier/keyword. */ - CType *ct; /* C type table entry. */ - const char *p; /* Current position in input buffer. */ - SBuf sb; /* String buffer for tokens. */ - lua_State *L; /* Lua state. */ - CTState *cts; /* C type state. */ - TValue *param; /* C type parameters. */ - const char *srcname; /* Current source name. */ - BCLine linenumber; /* Input line counter. */ - int depth; /* Recursive declaration depth. */ - uint32_t tmask; /* Type mask for next identifier. */ - uint32_t mode; /* C parser mode. */ - uint8_t packstack[CPARSE_MAX_PACKSTACK]; /* Stack for pack pragmas. */ - uint8_t curpack; /* Current position in pack pragma stack. */ -} CPState; - -LJ_FUNC int lj_cparse(CPState *cp); - -#endif - -#endif diff --git a/subprojects/luajit/src/lj_crecord.c b/subprojects/luajit/src/lj_crecord.c deleted file mode 100644 index 84fc49ee1..000000000 --- a/subprojects/luajit/src/lj_crecord.c +++ /dev/null @@ -1,1672 +0,0 @@ -/* -** Trace recorder for C data operations. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_ffrecord_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT && LJ_HASFFI - -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_frame.h" -#include "lj_ctype.h" -#include "lj_cdata.h" -#include "lj_cparse.h" -#include "lj_cconv.h" -#include "lj_clib.h" -#include "lj_ccall.h" -#include "lj_ff.h" -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_ircall.h" -#include "lj_iropt.h" -#include "lj_trace.h" -#include "lj_record.h" -#include "lj_ffrecord.h" -#include "lj_snap.h" -#include "lj_crecord.h" -#include "lj_dispatch.h" - -/* Some local macros to save typing. Undef'd at the end. */ -#define IR(ref) (&J->cur.ir[(ref)]) - -/* Pass IR on to next optimization in chain (FOLD). */ -#define emitir(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J)) - -#define emitconv(a, dt, st, flags) \ - emitir(IRT(IR_CONV, (dt)), (a), (st)|((dt) << 5)|(flags)) - -/* -- C type checks ------------------------------------------------------- */ - -static GCcdata *argv2cdata(jit_State *J, TRef tr, cTValue *o) -{ - GCcdata *cd; - TRef trtypeid; - if (!tref_iscdata(tr)) - lj_trace_err(J, LJ_TRERR_BADTYPE); - cd = cdataV(o); - /* Specialize to the CTypeID. */ - trtypeid = emitir(IRT(IR_FLOAD, IRT_U16), tr, IRFL_CDATA_CTYPEID); - emitir(IRTG(IR_EQ, IRT_INT), trtypeid, lj_ir_kint(J, (int32_t)cd->ctypeid)); - return cd; -} - -/* Specialize to the CTypeID held by a cdata constructor. */ -static CTypeID crec_constructor(jit_State *J, GCcdata *cd, TRef tr) -{ - CTypeID id; - lua_assert(tref_iscdata(tr) && cd->ctypeid == CTID_CTYPEID); - id = *(CTypeID *)cdataptr(cd); - tr = emitir(IRT(IR_FLOAD, IRT_INT), tr, IRFL_CDATA_INT); - emitir(IRTG(IR_EQ, IRT_INT), tr, lj_ir_kint(J, (int32_t)id)); - return id; -} - -static CTypeID argv2ctype(jit_State *J, TRef tr, cTValue *o) -{ - if (tref_isstr(tr)) { - GCstr *s = strV(o); - CPState cp; - CTypeID oldtop; - /* Specialize to the string containing the C type declaration. */ - emitir(IRTG(IR_EQ, IRT_STR), tr, lj_ir_kstr(J, s)); - cp.L = J->L; - cp.cts = ctype_ctsG(J2G(J)); - oldtop = cp.cts->top; - cp.srcname = strdata(s); - cp.p = strdata(s); - cp.param = NULL; - cp.mode = CPARSE_MODE_ABSTRACT|CPARSE_MODE_NOIMPLICIT; - if (lj_cparse(&cp) || cp.cts->top > oldtop) /* Avoid new struct defs. */ - lj_trace_err(J, LJ_TRERR_BADTYPE); - return cp.val.id; - } else { - GCcdata *cd = argv2cdata(J, tr, o); - return cd->ctypeid == CTID_CTYPEID ? crec_constructor(J, cd, tr) : - cd->ctypeid; - } -} - -/* Convert CType to IRType (if possible). */ -static IRType crec_ct2irt(CTState *cts, CType *ct) -{ - if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); - if (LJ_LIKELY(ctype_isnum(ct->info))) { - if ((ct->info & CTF_FP)) { - if (ct->size == sizeof(double)) - return IRT_NUM; - else if (ct->size == sizeof(float)) - return IRT_FLOAT; - } else { - uint32_t b = lj_fls(ct->size); - if (b <= 3) - return IRT_I8 + 2*b + ((ct->info & CTF_UNSIGNED) ? 1 : 0); - } - } else if (ctype_isptr(ct->info)) { - return (LJ_64 && ct->size == 8) ? IRT_P64 : IRT_P32; - } else if (ctype_iscomplex(ct->info)) { - if (ct->size == 2*sizeof(double)) - return IRT_NUM; - else if (ct->size == 2*sizeof(float)) - return IRT_FLOAT; - } - return IRT_CDATA; -} - -/* -- Optimized memory fill and copy -------------------------------------- */ - -/* Maximum length and unroll of inlined copy/fill. */ -#define CREC_COPY_MAXUNROLL 16 -#define CREC_COPY_MAXLEN 128 - -#define CREC_FILL_MAXUNROLL 16 - -/* Number of windowed registers used for optimized memory copy. */ -#if LJ_TARGET_X86 -#define CREC_COPY_REGWIN 2 -#elif LJ_TARGET_PPC || LJ_TARGET_MIPS -#define CREC_COPY_REGWIN 8 -#else -#define CREC_COPY_REGWIN 4 -#endif - -/* List of memory offsets for copy/fill. */ -typedef struct CRecMemList { - CTSize ofs; /* Offset in bytes. */ - IRType tp; /* Type of load/store. */ - TRef trofs; /* TRef of interned offset. */ - TRef trval; /* TRef of load value. */ -} CRecMemList; - -/* Generate copy list for element-wise struct copy. */ -static MSize crec_copy_struct(CRecMemList *ml, CTState *cts, CType *ct) -{ - CTypeID fid = ct->sib; - MSize mlp = 0; - while (fid) { - CType *df = ctype_get(cts, fid); - fid = df->sib; - if (ctype_isfield(df->info)) { - CType *cct; - IRType tp; - if (!gcref(df->name)) continue; /* Ignore unnamed fields. */ - cct = ctype_rawchild(cts, df); /* Field type. */ - tp = crec_ct2irt(cts, cct); - if (tp == IRT_CDATA) return 0; /* NYI: aggregates. */ - if (mlp >= CREC_COPY_MAXUNROLL) return 0; - ml[mlp].ofs = df->size; - ml[mlp].tp = tp; - mlp++; - if (ctype_iscomplex(cct->info)) { - if (mlp >= CREC_COPY_MAXUNROLL) return 0; - ml[mlp].ofs = df->size + (cct->size >> 1); - ml[mlp].tp = tp; - mlp++; - } - } else if (!ctype_isconstval(df->info)) { - /* NYI: bitfields and sub-structures. */ - return 0; - } - } - return mlp; -} - -/* Generate unrolled copy list, from highest to lowest step size/alignment. */ -static MSize crec_copy_unroll(CRecMemList *ml, CTSize len, CTSize step, - IRType tp) -{ - CTSize ofs = 0; - MSize mlp = 0; - if (tp == IRT_CDATA) tp = IRT_U8 + 2*lj_fls(step); - do { - while (ofs + step <= len) { - if (mlp >= CREC_COPY_MAXUNROLL) return 0; - ml[mlp].ofs = ofs; - ml[mlp].tp = tp; - mlp++; - ofs += step; - } - step >>= 1; - tp -= 2; - } while (ofs < len); - return mlp; -} - -/* -** Emit copy list with windowed loads/stores. -** LJ_TARGET_UNALIGNED: may emit unaligned loads/stores (not marked as such). -*/ -static void crec_copy_emit(jit_State *J, CRecMemList *ml, MSize mlp, - TRef trdst, TRef trsrc) -{ - MSize i, j, rwin = 0; - for (i = 0, j = 0; i < mlp; ) { - TRef trofs = lj_ir_kintp(J, ml[i].ofs); - TRef trsptr = emitir(IRT(IR_ADD, IRT_PTR), trsrc, trofs); - ml[i].trval = emitir(IRT(IR_XLOAD, ml[i].tp), trsptr, 0); - ml[i].trofs = trofs; - i++; - rwin += (LJ_SOFTFP && ml[i].tp == IRT_NUM) ? 2 : 1; - if (rwin >= CREC_COPY_REGWIN || i >= mlp) { /* Flush buffered stores. */ - rwin = 0; - for ( ; j < i; j++) { - TRef trdptr = emitir(IRT(IR_ADD, IRT_PTR), trdst, ml[j].trofs); - emitir(IRT(IR_XSTORE, ml[j].tp), trdptr, ml[j].trval); - } - } - } -} - -/* Optimized memory copy. */ -static void crec_copy(jit_State *J, TRef trdst, TRef trsrc, TRef trlen, - CType *ct) -{ - if (tref_isk(trlen)) { /* Length must be constant. */ - CRecMemList ml[CREC_COPY_MAXUNROLL]; - MSize mlp = 0; - CTSize step = 1, len = (CTSize)IR(tref_ref(trlen))->i; - IRType tp = IRT_CDATA; - int needxbar = 0; - if (len == 0) return; /* Shortcut. */ - if (len > CREC_COPY_MAXLEN) goto fallback; - if (ct) { - CTState *cts = ctype_ctsG(J2G(J)); - lua_assert(ctype_isarray(ct->info) || ctype_isstruct(ct->info)); - if (ctype_isarray(ct->info)) { - CType *cct = ctype_rawchild(cts, ct); - tp = crec_ct2irt(cts, cct); - if (tp == IRT_CDATA) goto rawcopy; - step = lj_ir_type_size[tp]; - lua_assert((len & (step-1)) == 0); - } else if ((ct->info & CTF_UNION)) { - step = (1u << ctype_align(ct->info)); - goto rawcopy; - } else { - mlp = crec_copy_struct(ml, cts, ct); - goto emitcopy; - } - } else { - rawcopy: - needxbar = 1; - if (LJ_TARGET_UNALIGNED || step >= CTSIZE_PTR) - step = CTSIZE_PTR; - } - mlp = crec_copy_unroll(ml, len, step, tp); - emitcopy: - if (mlp) { - crec_copy_emit(J, ml, mlp, trdst, trsrc); - if (needxbar) - emitir(IRT(IR_XBAR, IRT_NIL), 0, 0); - return; - } - } -fallback: - /* Call memcpy. Always needs a barrier to disable alias analysis. */ - lj_ir_call(J, IRCALL_memcpy, trdst, trsrc, trlen); - emitir(IRT(IR_XBAR, IRT_NIL), 0, 0); -} - -/* Generate unrolled fill list, from highest to lowest step size/alignment. */ -static MSize crec_fill_unroll(CRecMemList *ml, CTSize len, CTSize step) -{ - CTSize ofs = 0; - MSize mlp = 0; - IRType tp = IRT_U8 + 2*lj_fls(step); - do { - while (ofs + step <= len) { - if (mlp >= CREC_COPY_MAXUNROLL) return 0; - ml[mlp].ofs = ofs; - ml[mlp].tp = tp; - mlp++; - ofs += step; - } - step >>= 1; - tp -= 2; - } while (ofs < len); - return mlp; -} - -/* -** Emit stores for fill list. -** LJ_TARGET_UNALIGNED: may emit unaligned stores (not marked as such). -*/ -static void crec_fill_emit(jit_State *J, CRecMemList *ml, MSize mlp, - TRef trdst, TRef trfill) -{ - MSize i; - for (i = 0; i < mlp; i++) { - TRef trofs = lj_ir_kintp(J, ml[i].ofs); - TRef trdptr = emitir(IRT(IR_ADD, IRT_PTR), trdst, trofs); - emitir(IRT(IR_XSTORE, ml[i].tp), trdptr, trfill); - } -} - -/* Optimized memory fill. */ -static void crec_fill(jit_State *J, TRef trdst, TRef trlen, TRef trfill, - CTSize step) -{ - if (tref_isk(trlen)) { /* Length must be constant. */ - CRecMemList ml[CREC_FILL_MAXUNROLL]; - MSize mlp; - CTSize len = (CTSize)IR(tref_ref(trlen))->i; - if (len == 0) return; /* Shortcut. */ - if (LJ_TARGET_UNALIGNED || step >= CTSIZE_PTR) - step = CTSIZE_PTR; - if (step * CREC_FILL_MAXUNROLL < len) goto fallback; - mlp = crec_fill_unroll(ml, len, step); - if (!mlp) goto fallback; - if (tref_isk(trfill) || ml[0].tp != IRT_U8) - trfill = emitconv(trfill, IRT_INT, IRT_U8, 0); - if (ml[0].tp != IRT_U8) { /* Scatter U8 to U16/U32/U64. */ - if (CTSIZE_PTR == 8 && ml[0].tp == IRT_U64) { - if (tref_isk(trfill)) /* Pointless on x64 with zero-extended regs. */ - trfill = emitconv(trfill, IRT_U64, IRT_U32, 0); - trfill = emitir(IRT(IR_MUL, IRT_U64), trfill, - lj_ir_kint64(J, U64x(01010101,01010101))); - } else { - trfill = emitir(IRTI(IR_MUL), trfill, - lj_ir_kint(J, ml[0].tp == IRT_U16 ? 0x0101 : 0x01010101)); - } - } - crec_fill_emit(J, ml, mlp, trdst, trfill); - } else { -fallback: - /* Call memset. Always needs a barrier to disable alias analysis. */ - lj_ir_call(J, IRCALL_memset, trdst, trfill, trlen); /* Note: arg order! */ - } - emitir(IRT(IR_XBAR, IRT_NIL), 0, 0); -} - -/* -- Convert C type to C type -------------------------------------------- */ - -/* -** This code mirrors the code in lj_cconv.c. It performs the same steps -** for the trace recorder that lj_cconv.c does for the interpreter. -** -** One major difference is that we can get away with much fewer checks -** here. E.g. checks for casts, constness or correct types can often be -** omitted, even if they might fail. The interpreter subsequently throws -** an error, which aborts the trace. -** -** All operations are specialized to their C types, so the on-trace -** outcome must be the same as the outcome in the interpreter. If the -** interpreter doesn't throw an error, then the trace is correct, too. -** Care must be taken not to generate invalid (temporary) IR or to -** trigger asserts. -*/ - -/* Determine whether a passed number or cdata number is non-zero. */ -static int crec_isnonzero(CType *s, void *p) -{ - if (p == (void *)0) - return 0; - if (p == (void *)1) - return 1; - if ((s->info & CTF_FP)) { - if (s->size == sizeof(float)) - return (*(float *)p != 0); - else - return (*(double *)p != 0); - } else { - if (s->size == 1) - return (*(uint8_t *)p != 0); - else if (s->size == 2) - return (*(uint16_t *)p != 0); - else if (s->size == 4) - return (*(uint32_t *)p != 0); - else - return (*(uint64_t *)p != 0); - } -} - -static TRef crec_ct_ct(jit_State *J, CType *d, CType *s, TRef dp, TRef sp, - void *svisnz) -{ - IRType dt = crec_ct2irt(ctype_ctsG(J2G(J)), d); - IRType st = crec_ct2irt(ctype_ctsG(J2G(J)), s); - CTSize dsize = d->size, ssize = s->size; - CTInfo dinfo = d->info, sinfo = s->info; - - if (ctype_type(dinfo) > CT_MAYCONVERT || ctype_type(sinfo) > CT_MAYCONVERT) - goto err_conv; - - /* - ** Note: Unlike lj_cconv_ct_ct(), sp holds the _value_ of pointers and - ** numbers up to 8 bytes. Otherwise sp holds a pointer. - */ - - switch (cconv_idx2(dinfo, sinfo)) { - /* Destination is a bool. */ - case CCX(B, B): - goto xstore; /* Source operand is already normalized. */ - case CCX(B, I): - case CCX(B, F): - if (st != IRT_CDATA) { - /* Specialize to the result of a comparison against 0. */ - TRef zero = (st == IRT_NUM || st == IRT_FLOAT) ? lj_ir_knum(J, 0) : - (st == IRT_I64 || st == IRT_U64) ? lj_ir_kint64(J, 0) : - lj_ir_kint(J, 0); - int isnz = crec_isnonzero(s, svisnz); - emitir(IRTG(isnz ? IR_NE : IR_EQ, st), sp, zero); - sp = lj_ir_kint(J, isnz); - goto xstore; - } - goto err_nyi; - - /* Destination is an integer. */ - case CCX(I, B): - case CCX(I, I): - conv_I_I: - if (dt == IRT_CDATA || st == IRT_CDATA) goto err_nyi; - /* Extend 32 to 64 bit integer. */ - if (dsize == 8 && ssize < 8 && !(LJ_64 && (sinfo & CTF_UNSIGNED))) - sp = emitconv(sp, dt, ssize < 4 ? IRT_INT : st, - (sinfo & CTF_UNSIGNED) ? 0 : IRCONV_SEXT); - else if (dsize < 8 && ssize == 8) /* Truncate from 64 bit integer. */ - sp = emitconv(sp, dsize < 4 ? IRT_INT : dt, st, 0); - else if (st == IRT_INT) - sp = lj_opt_narrow_toint(J, sp); - xstore: - if (dt == IRT_I64 || dt == IRT_U64) lj_needsplit(J); - if (dp == 0) return sp; - emitir(IRT(IR_XSTORE, dt), dp, sp); - break; - case CCX(I, C): - sp = emitir(IRT(IR_XLOAD, st), sp, 0); /* Load re. */ - /* fallthrough */ - case CCX(I, F): - if (dt == IRT_CDATA || st == IRT_CDATA) goto err_nyi; - sp = emitconv(sp, dsize < 4 ? IRT_INT : dt, st, IRCONV_TRUNC|IRCONV_ANY); - goto xstore; - case CCX(I, P): - case CCX(I, A): - sinfo = CTINFO(CT_NUM, CTF_UNSIGNED); - ssize = CTSIZE_PTR; - st = IRT_UINTP; - if (((dsize ^ ssize) & 8) == 0) { /* Must insert no-op type conversion. */ - sp = emitconv(sp, dsize < 4 ? IRT_INT : dt, IRT_PTR, 0); - goto xstore; - } - goto conv_I_I; - - /* Destination is a floating-point number. */ - case CCX(F, B): - case CCX(F, I): - conv_F_I: - if (dt == IRT_CDATA || st == IRT_CDATA) goto err_nyi; - sp = emitconv(sp, dt, ssize < 4 ? IRT_INT : st, 0); - goto xstore; - case CCX(F, C): - sp = emitir(IRT(IR_XLOAD, st), sp, 0); /* Load re. */ - /* fallthrough */ - case CCX(F, F): - conv_F_F: - if (dt == IRT_CDATA || st == IRT_CDATA) goto err_nyi; - if (dt != st) sp = emitconv(sp, dt, st, 0); - goto xstore; - - /* Destination is a complex number. */ - case CCX(C, I): - case CCX(C, F): - { /* Clear im. */ - TRef ptr = emitir(IRT(IR_ADD, IRT_PTR), dp, lj_ir_kintp(J, (dsize >> 1))); - emitir(IRT(IR_XSTORE, dt), ptr, lj_ir_knum(J, 0)); - } - /* Convert to re. */ - if ((sinfo & CTF_FP)) goto conv_F_F; else goto conv_F_I; - - case CCX(C, C): - if (dt == IRT_CDATA || st == IRT_CDATA) goto err_nyi; - { - TRef re, im, ptr; - re = emitir(IRT(IR_XLOAD, st), sp, 0); - ptr = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, (ssize >> 1))); - im = emitir(IRT(IR_XLOAD, st), ptr, 0); - if (dt != st) { - re = emitconv(re, dt, st, 0); - im = emitconv(im, dt, st, 0); - } - emitir(IRT(IR_XSTORE, dt), dp, re); - ptr = emitir(IRT(IR_ADD, IRT_PTR), dp, lj_ir_kintp(J, (dsize >> 1))); - emitir(IRT(IR_XSTORE, dt), ptr, im); - } - break; - - /* Destination is a vector. */ - case CCX(V, I): - case CCX(V, F): - case CCX(V, C): - case CCX(V, V): - goto err_nyi; - - /* Destination is a pointer. */ - case CCX(P, P): - case CCX(P, A): - case CCX(P, S): - /* There are only 32 bit pointers/addresses on 32 bit machines. - ** Also ok on x64, since all 32 bit ops clear the upper part of the reg. - */ - goto xstore; - case CCX(P, I): - if (st == IRT_CDATA) goto err_nyi; - if (!LJ_64 && ssize == 8) /* Truncate from 64 bit integer. */ - sp = emitconv(sp, IRT_U32, st, 0); - goto xstore; - case CCX(P, F): - if (st == IRT_CDATA) goto err_nyi; - /* The signed conversion is cheaper. x64 really has 47 bit pointers. */ - sp = emitconv(sp, (LJ_64 && dsize == 8) ? IRT_I64 : IRT_U32, - st, IRCONV_TRUNC|IRCONV_ANY); - goto xstore; - - /* Destination is an array. */ - case CCX(A, A): - /* Destination is a struct/union. */ - case CCX(S, S): - if (dp == 0) goto err_conv; - crec_copy(J, dp, sp, lj_ir_kint(J, dsize), d); - break; - - default: - err_conv: - err_nyi: - lj_trace_err(J, LJ_TRERR_NYICONV); - break; - } - return 0; -} - -/* -- Convert C type to TValue (load) ------------------------------------- */ - -static TRef crec_tv_ct(jit_State *J, CType *s, CTypeID sid, TRef sp) -{ - CTState *cts = ctype_ctsG(J2G(J)); - IRType t = crec_ct2irt(cts, s); - CTInfo sinfo = s->info; - if (ctype_isnum(sinfo)) { - TRef tr; - if (t == IRT_CDATA) - goto err_nyi; /* NYI: copyval of >64 bit integers. */ - tr = emitir(IRT(IR_XLOAD, t), sp, 0); - if (t == IRT_FLOAT || t == IRT_U32) { /* Keep uint32_t/float as numbers. */ - return emitconv(tr, IRT_NUM, t, 0); - } else if (t == IRT_I64 || t == IRT_U64) { /* Box 64 bit integer. */ - sp = tr; - lj_needsplit(J); - } else if ((sinfo & CTF_BOOL)) { - /* Assume not equal to zero. Fixup and emit pending guard later. */ - lj_ir_set(J, IRTGI(IR_NE), tr, lj_ir_kint(J, 0)); - J->postproc = LJ_POST_FIXGUARD; - return TREF_TRUE; - } else { - return tr; - } - } else if (ctype_isptr(sinfo) || ctype_isenum(sinfo)) { - sp = emitir(IRT(IR_XLOAD, t), sp, 0); /* Box pointers and enums. */ - } else if (ctype_isrefarray(sinfo) || ctype_isstruct(sinfo)) { - cts->L = J->L; - sid = lj_ctype_intern(cts, CTINFO_REF(sid), CTSIZE_PTR); /* Create ref. */ - } else if (ctype_iscomplex(sinfo)) { /* Unbox/box complex. */ - ptrdiff_t esz = (ptrdiff_t)(s->size >> 1); - TRef ptr, tr1, tr2, dp; - dp = emitir(IRTG(IR_CNEW, IRT_CDATA), lj_ir_kint(J, sid), TREF_NIL); - tr1 = emitir(IRT(IR_XLOAD, t), sp, 0); - ptr = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, esz)); - tr2 = emitir(IRT(IR_XLOAD, t), ptr, 0); - ptr = emitir(IRT(IR_ADD, IRT_PTR), dp, lj_ir_kintp(J, sizeof(GCcdata))); - emitir(IRT(IR_XSTORE, t), ptr, tr1); - ptr = emitir(IRT(IR_ADD, IRT_PTR), dp, lj_ir_kintp(J, sizeof(GCcdata)+esz)); - emitir(IRT(IR_XSTORE, t), ptr, tr2); - return dp; - } else { - /* NYI: copyval of vectors. */ - err_nyi: - lj_trace_err(J, LJ_TRERR_NYICONV); - } - /* Box pointer, ref, enum or 64 bit integer. */ - return emitir(IRTG(IR_CNEWI, IRT_CDATA), lj_ir_kint(J, sid), sp); -} - -/* -- Convert TValue to C type (store) ------------------------------------ */ - -static TRef crec_ct_tv(jit_State *J, CType *d, TRef dp, TRef sp, cTValue *sval) -{ - CTState *cts = ctype_ctsG(J2G(J)); - CTypeID sid = CTID_P_VOID; - void *svisnz = 0; - CType *s; - if (LJ_LIKELY(tref_isinteger(sp))) { - sid = CTID_INT32; - svisnz = (void *)(intptr_t)(tvisint(sval)?(intV(sval)!=0):!tviszero(sval)); - } else if (tref_isnum(sp)) { - sid = CTID_DOUBLE; - svisnz = (void *)(intptr_t)(tvisint(sval)?(intV(sval)!=0):!tviszero(sval)); - } else if (tref_isbool(sp)) { - sp = lj_ir_kint(J, tref_istrue(sp) ? 1 : 0); - sid = CTID_BOOL; - } else if (tref_isnil(sp)) { - sp = lj_ir_kptr(J, NULL); - } else if (tref_isudata(sp)) { - GCudata *ud = udataV(sval); - if (ud->udtype == UDTYPE_IO_FILE) { - TRef tr = emitir(IRT(IR_FLOAD, IRT_U8), sp, IRFL_UDATA_UDTYPE); - emitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, UDTYPE_IO_FILE)); - sp = emitir(IRT(IR_FLOAD, IRT_PTR), sp, IRFL_UDATA_FILE); - } else { - sp = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, sizeof(GCudata))); - } - } else if (tref_isstr(sp)) { - if (ctype_isenum(d->info)) { /* Match string against enum constant. */ - GCstr *str = strV(sval); - CTSize ofs; - CType *cct = lj_ctype_getfield(cts, d, str, &ofs); - /* Specialize to the name of the enum constant. */ - emitir(IRTG(IR_EQ, IRT_STR), sp, lj_ir_kstr(J, str)); - if (cct && ctype_isconstval(cct->info)) { - lua_assert(ctype_child(cts, cct)->size == 4); - svisnz = (void *)(intptr_t)(ofs != 0); - sp = lj_ir_kint(J, (int32_t)ofs); - sid = ctype_cid(cct->info); - } /* else: interpreter will throw. */ - } else if (ctype_isrefarray(d->info)) { /* Copy string to array. */ - lj_trace_err(J, LJ_TRERR_BADTYPE); /* NYI */ - } else { /* Otherwise pass the string data as a const char[]. */ - /* Don't use STRREF. It folds with SNEW, which loses the trailing NUL. */ - sp = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, sizeof(GCstr))); - sid = CTID_A_CCHAR; - } - } else { /* NYI: tref_istab(sp), tref_islightud(sp). */ - IRType t; - sid = argv2cdata(J, sp, sval)->ctypeid; - s = ctype_raw(cts, sid); - svisnz = cdataptr(cdataV(sval)); - t = crec_ct2irt(cts, s); - if (ctype_isptr(s->info)) { - sp = emitir(IRT(IR_FLOAD, t), sp, IRFL_CDATA_PTR); - if (ctype_isref(s->info)) { - svisnz = *(void **)svisnz; - s = ctype_rawchild(cts, s); - if (ctype_isenum(s->info)) s = ctype_child(cts, s); - t = crec_ct2irt(cts, s); - } else { - goto doconv; - } - } else if (t == IRT_I64 || t == IRT_U64) { - sp = emitir(IRT(IR_FLOAD, t), sp, IRFL_CDATA_INT64); - lj_needsplit(J); - goto doconv; - } else if (t == IRT_INT || t == IRT_U32) { - if (ctype_isenum(s->info)) s = ctype_child(cts, s); - sp = emitir(IRT(IR_FLOAD, t), sp, IRFL_CDATA_INT); - goto doconv; - } else { - sp = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, sizeof(GCcdata))); - } - if (ctype_isnum(s->info) && t != IRT_CDATA) - sp = emitir(IRT(IR_XLOAD, t), sp, 0); /* Load number value. */ - goto doconv; - } - s = ctype_get(cts, sid); -doconv: - if (ctype_isenum(d->info)) d = ctype_child(cts, d); - return crec_ct_ct(J, d, s, dp, sp, svisnz); -} - -/* -- C data metamethods -------------------------------------------------- */ - -/* This would be rather difficult in FOLD, so do it here: -** (base+k)+(idx*sz)+ofs ==> (base+idx*sz)+(ofs+k) -** (base+(idx+k)*sz)+ofs ==> (base+idx*sz)+(ofs+k*sz) -*/ -static TRef crec_reassoc_ofs(jit_State *J, TRef tr, ptrdiff_t *ofsp, MSize sz) -{ - IRIns *ir = IR(tref_ref(tr)); - if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD) && irref_isk(ir->op2) && - (ir->o == IR_ADD || ir->o == IR_ADDOV || ir->o == IR_SUBOV)) { - IRIns *irk = IR(ir->op2); - ptrdiff_t k; - if (LJ_64 && irk->o == IR_KINT64) - k = (ptrdiff_t)ir_kint64(irk)->u64 * sz; - else - k = (ptrdiff_t)irk->i * sz; - if (ir->o == IR_SUBOV) *ofsp -= k; else *ofsp += k; - tr = ir->op1; /* Not a TRef, but the caller doesn't care. */ - } - return tr; -} - -/* Record ctype __index/__newindex metamethods. */ -static void crec_index_meta(jit_State *J, CTState *cts, CType *ct, - RecordFFData *rd) -{ - CTypeID id = ctype_typeid(cts, ct); - cTValue *tv = lj_ctype_meta(cts, id, rd->data ? MM_newindex : MM_index); - if (!tv) - lj_trace_err(J, LJ_TRERR_BADTYPE); - if (tvisfunc(tv)) { - J->base[-1] = lj_ir_kfunc(J, funcV(tv)) | TREF_FRAME; - rd->nres = -1; /* Pending tailcall. */ - } else if (rd->data == 0 && tvistab(tv) && tref_isstr(J->base[1])) { - /* Specialize to result of __index lookup. */ - cTValue *o = lj_tab_get(J->L, tabV(tv), &rd->argv[1]); - J->base[0] = lj_record_constify(J, o); - if (!J->base[0]) - lj_trace_err(J, LJ_TRERR_BADTYPE); - /* Always specialize to the key. */ - emitir(IRTG(IR_EQ, IRT_STR), J->base[1], lj_ir_kstr(J, strV(&rd->argv[1]))); - } else { - /* NYI: resolving of non-function metamethods. */ - /* NYI: non-string keys for __index table. */ - /* NYI: stores to __newindex table. */ - lj_trace_err(J, LJ_TRERR_BADTYPE); - } -} - -void LJ_FASTCALL recff_cdata_index(jit_State *J, RecordFFData *rd) -{ - TRef idx, ptr = J->base[0]; - ptrdiff_t ofs = sizeof(GCcdata); - GCcdata *cd = argv2cdata(J, ptr, &rd->argv[0]); - CTState *cts = ctype_ctsG(J2G(J)); - CType *ct = ctype_raw(cts, cd->ctypeid); - CTypeID sid = 0; - - /* Resolve pointer or reference for cdata object. */ - if (ctype_isptr(ct->info)) { - IRType t = (LJ_64 && ct->size == 8) ? IRT_P64 : IRT_P32; - if (ctype_isref(ct->info)) ct = ctype_rawchild(cts, ct); - ptr = emitir(IRT(IR_FLOAD, t), ptr, IRFL_CDATA_PTR); - ofs = 0; - ptr = crec_reassoc_ofs(J, ptr, &ofs, 1); - } - -again: - idx = J->base[1]; - if (tref_isnumber(idx)) { - idx = lj_opt_narrow_cindex(J, idx); - if (ctype_ispointer(ct->info)) { - CTSize sz; - integer_key: - if ((ct->info & CTF_COMPLEX)) - idx = emitir(IRT(IR_BAND, IRT_INTP), idx, lj_ir_kintp(J, 1)); - sz = lj_ctype_size(cts, (sid = ctype_cid(ct->info))); - idx = crec_reassoc_ofs(J, idx, &ofs, sz); -#if LJ_TARGET_ARM || LJ_TARGET_PPC - /* Hoist base add to allow fusion of index/shift into operands. */ - if (LJ_LIKELY(J->flags & JIT_F_OPT_LOOP) && ofs -#if LJ_TARGET_ARM - && (sz == 1 || sz == 4) -#endif - ) { - ptr = emitir(IRT(IR_ADD, IRT_PTR), ptr, lj_ir_kintp(J, ofs)); - ofs = 0; - } -#endif - idx = emitir(IRT(IR_MUL, IRT_INTP), idx, lj_ir_kintp(J, sz)); - ptr = emitir(IRT(IR_ADD, IRT_PTR), idx, ptr); - } - } else if (tref_iscdata(idx)) { - GCcdata *cdk = cdataV(&rd->argv[1]); - CType *ctk = ctype_raw(cts, cdk->ctypeid); - IRType t = crec_ct2irt(cts, ctk); - if (ctype_ispointer(ct->info) && t >= IRT_I8 && t <= IRT_U64) { - if (ctk->size == 8) { - idx = emitir(IRT(IR_FLOAD, t), idx, IRFL_CDATA_INT64); - } else if (ctk->size == 4) { - idx = emitir(IRT(IR_FLOAD, t), idx, IRFL_CDATA_INT); - } else { - idx = emitir(IRT(IR_ADD, IRT_PTR), idx, - lj_ir_kintp(J, sizeof(GCcdata))); - idx = emitir(IRT(IR_XLOAD, t), idx, 0); - } - if (LJ_64 && ctk->size < sizeof(intptr_t) && !(ctk->info & CTF_UNSIGNED)) - idx = emitconv(idx, IRT_INTP, IRT_INT, IRCONV_SEXT); - if (!LJ_64 && ctk->size > sizeof(intptr_t)) { - idx = emitconv(idx, IRT_INTP, t, 0); - lj_needsplit(J); - } - goto integer_key; - } - } else if (tref_isstr(idx)) { - GCstr *name = strV(&rd->argv[1]); - if (cd && cd->ctypeid == CTID_CTYPEID) - ct = ctype_raw(cts, crec_constructor(J, cd, ptr)); - if (ctype_isstruct(ct->info)) { - CTSize fofs; - CType *fct; - fct = lj_ctype_getfield(cts, ct, name, &fofs); - if (fct) { - /* Always specialize to the field name. */ - emitir(IRTG(IR_EQ, IRT_STR), idx, lj_ir_kstr(J, name)); - if (ctype_isconstval(fct->info)) { - if (fct->size >= 0x80000000u && - (ctype_child(cts, fct)->info & CTF_UNSIGNED)) { - J->base[0] = lj_ir_knum(J, (lua_Number)(uint32_t)fct->size); - return; - } - J->base[0] = lj_ir_kint(J, (int32_t)fct->size); - return; /* Interpreter will throw for newindex. */ - } else if (ctype_isbitfield(fct->info)) { - lj_trace_err(J, LJ_TRERR_NYICONV); - } else { - lua_assert(ctype_isfield(fct->info)); - sid = ctype_cid(fct->info); - } - ofs += (ptrdiff_t)fofs; - } - } else if (ctype_iscomplex(ct->info)) { - if (name->len == 2 && - ((strdata(name)[0] == 'r' && strdata(name)[1] == 'e') || - (strdata(name)[0] == 'i' && strdata(name)[1] == 'm'))) { - /* Always specialize to the field name. */ - emitir(IRTG(IR_EQ, IRT_STR), idx, lj_ir_kstr(J, name)); - if (strdata(name)[0] == 'i') ofs += (ct->size >> 1); - sid = ctype_cid(ct->info); - } - } - } - if (!sid) { - if (ctype_isptr(ct->info)) { /* Automatically perform '->'. */ - CType *cct = ctype_rawchild(cts, ct); - if (ctype_isstruct(cct->info)) { - ct = cct; - cd = NULL; - if (tref_isstr(idx)) goto again; - } - } - crec_index_meta(J, cts, ct, rd); - return; - } - - if (ofs) - ptr = emitir(IRT(IR_ADD, IRT_PTR), ptr, lj_ir_kintp(J, ofs)); - - /* Resolve reference for field. */ - ct = ctype_get(cts, sid); - if (ctype_isref(ct->info)) { - ptr = emitir(IRT(IR_XLOAD, IRT_PTR), ptr, 0); - sid = ctype_cid(ct->info); - ct = ctype_get(cts, sid); - } - - while (ctype_isattrib(ct->info)) - ct = ctype_child(cts, ct); /* Skip attributes. */ - - if (rd->data == 0) { /* __index metamethod. */ - J->base[0] = crec_tv_ct(J, ct, sid, ptr); - } else { /* __newindex metamethod. */ - rd->nres = 0; - J->needsnap = 1; - crec_ct_tv(J, ct, ptr, J->base[2], &rd->argv[2]); - } -} - -/* Record setting a finalizer. */ -static void crec_finalizer(jit_State *J, TRef trcd, cTValue *fin) -{ - TRef trlo = lj_ir_call(J, IRCALL_lj_cdata_setfin, trcd); - TRef trhi = emitir(IRT(IR_ADD, IRT_P32), trlo, lj_ir_kint(J, 4)); - if (LJ_BE) { TRef tmp = trlo; trlo = trhi; trhi = tmp; } - if (tvisfunc(fin)) { - emitir(IRT(IR_XSTORE, IRT_P32), trlo, lj_ir_kfunc(J, funcV(fin))); - emitir(IRTI(IR_XSTORE), trhi, lj_ir_kint(J, LJ_TFUNC)); - } else if (tviscdata(fin)) { - emitir(IRT(IR_XSTORE, IRT_P32), trlo, - lj_ir_kgc(J, obj2gco(cdataV(fin)), IRT_CDATA)); - emitir(IRTI(IR_XSTORE), trhi, lj_ir_kint(J, LJ_TCDATA)); - } else { - lj_trace_err(J, LJ_TRERR_BADTYPE); - } - J->needsnap = 1; -} - -/* Record cdata allocation. */ -static void crec_alloc(jit_State *J, RecordFFData *rd, CTypeID id) -{ - CTState *cts = ctype_ctsG(J2G(J)); - CTSize sz; - CTInfo info = lj_ctype_info(cts, id, &sz); - CType *d = ctype_raw(cts, id); - TRef trid; - if (!sz || sz > 128 || (info & CTF_VLA) || ctype_align(info) > CT_MEMALIGN) - lj_trace_err(J, LJ_TRERR_NYICONV); /* NYI: large/special allocations. */ - trid = lj_ir_kint(J, id); - /* Use special instruction to box pointer or 32/64 bit integer. */ - if (ctype_isptr(info) || (ctype_isinteger(info) && (sz == 4 || sz == 8))) { - TRef sp = J->base[1] ? crec_ct_tv(J, d, 0, J->base[1], &rd->argv[1]) : - ctype_isptr(info) ? lj_ir_kptr(J, NULL) : - sz == 4 ? lj_ir_kint(J, 0) : - (lj_needsplit(J), lj_ir_kint64(J, 0)); - J->base[0] = emitir(IRTG(IR_CNEWI, IRT_CDATA), trid, sp); - } else { - TRef trcd = emitir(IRTG(IR_CNEW, IRT_CDATA), trid, TREF_NIL); - cTValue *fin; - J->base[0] = trcd; - if (J->base[1] && !J->base[2] && - !lj_cconv_multi_init(cts, d, &rd->argv[1])) { - goto single_init; - } else if (ctype_isarray(d->info)) { - CType *dc = ctype_rawchild(cts, d); /* Array element type. */ - CTSize ofs, esize = dc->size; - TRef sp = 0; - TValue tv; - TValue *sval = &tv; - MSize i; - tv.u64 = 0; - if (!(ctype_isnum(dc->info) || ctype_isptr(dc->info))) - lj_trace_err(J, LJ_TRERR_NYICONV); /* NYI: init array of aggregates. */ - for (i = 1, ofs = 0; ofs < sz; ofs += esize) { - TRef dp = emitir(IRT(IR_ADD, IRT_PTR), trcd, - lj_ir_kintp(J, ofs + sizeof(GCcdata))); - if (J->base[i]) { - sp = J->base[i]; - sval = &rd->argv[i]; - i++; - } else if (i != 2) { - sp = ctype_isnum(dc->info) ? lj_ir_kint(J, 0) : TREF_NIL; - } - crec_ct_tv(J, dc, dp, sp, sval); - } - } else if (ctype_isstruct(d->info)) { - CTypeID fid = d->sib; - MSize i = 1; - while (fid) { - CType *df = ctype_get(cts, fid); - fid = df->sib; - if (ctype_isfield(df->info)) { - CType *dc; - TRef sp, dp; - TValue tv; - TValue *sval = &tv; - setintV(&tv, 0); - if (!gcref(df->name)) continue; /* Ignore unnamed fields. */ - dc = ctype_rawchild(cts, df); /* Field type. */ - if (!(ctype_isnum(dc->info) || ctype_isptr(dc->info) || - ctype_isenum(dc->info))) - lj_trace_err(J, LJ_TRERR_NYICONV); /* NYI: init aggregates. */ - if (J->base[i]) { - sp = J->base[i]; - sval = &rd->argv[i]; - i++; - } else { - sp = ctype_isptr(dc->info) ? TREF_NIL : lj_ir_kint(J, 0); - } - dp = emitir(IRT(IR_ADD, IRT_PTR), trcd, - lj_ir_kintp(J, df->size + sizeof(GCcdata))); - crec_ct_tv(J, dc, dp, sp, sval); - } else if (!ctype_isconstval(df->info)) { - /* NYI: init bitfields and sub-structures. */ - lj_trace_err(J, LJ_TRERR_NYICONV); - } - } - } else { - TRef dp; - single_init: - dp = emitir(IRT(IR_ADD, IRT_PTR), trcd, lj_ir_kintp(J, sizeof(GCcdata))); - if (J->base[1]) { - crec_ct_tv(J, d, dp, J->base[1], &rd->argv[1]); - } else { - TValue tv; - tv.u64 = 0; - crec_ct_tv(J, d, dp, lj_ir_kint(J, 0), &tv); - } - } - /* Handle __gc metamethod. */ - fin = lj_ctype_meta(cts, id, MM_gc); - if (fin) - crec_finalizer(J, trcd, fin); - } -} - -/* Record argument conversions. */ -static TRef crec_call_args(jit_State *J, RecordFFData *rd, - CTState *cts, CType *ct) -{ - TRef args[CCI_NARGS_MAX]; - CTypeID fid; - MSize i, n; - TRef tr, *base; - cTValue *o; -#if LJ_TARGET_X86 -#if LJ_ABI_WIN - TRef *arg0 = NULL, *arg1 = NULL; -#endif - int ngpr = 0; - if (ctype_cconv(ct->info) == CTCC_THISCALL) - ngpr = 1; - else if (ctype_cconv(ct->info) == CTCC_FASTCALL) - ngpr = 2; -#endif - - /* Skip initial attributes. */ - fid = ct->sib; - while (fid) { - CType *ctf = ctype_get(cts, fid); - if (!ctype_isattrib(ctf->info)) break; - fid = ctf->sib; - } - args[0] = TREF_NIL; - for (n = 0, base = J->base+1, o = rd->argv+1; *base; n++, base++, o++) { - CTypeID did; - CType *d; - - if (n >= CCI_NARGS_MAX) - lj_trace_err(J, LJ_TRERR_NYICALL); - - if (fid) { /* Get argument type from field. */ - CType *ctf = ctype_get(cts, fid); - fid = ctf->sib; - lua_assert(ctype_isfield(ctf->info)); - did = ctype_cid(ctf->info); - } else { - if (!(ct->info & CTF_VARARG)) - lj_trace_err(J, LJ_TRERR_NYICALL); /* Too many arguments. */ - did = lj_ccall_ctid_vararg(cts, o); /* Infer vararg type. */ - } - d = ctype_raw(cts, did); - if (!(ctype_isnum(d->info) || ctype_isptr(d->info) || - ctype_isenum(d->info))) - lj_trace_err(J, LJ_TRERR_NYICALL); - tr = crec_ct_tv(J, d, 0, *base, o); - if (ctype_isinteger_or_bool(d->info)) { - if (d->size < 4) { - if ((d->info & CTF_UNSIGNED)) - tr = emitconv(tr, IRT_INT, d->size==1 ? IRT_U8 : IRT_U16, 0); - else - tr = emitconv(tr, IRT_INT, d->size==1 ? IRT_I8 : IRT_I16,IRCONV_SEXT); - } - } else if (LJ_SOFTFP && ctype_isfp(d->info) && d->size > 4) { - lj_needsplit(J); - } -#if LJ_TARGET_X86 - /* 64 bit args must not end up in registers for fastcall/thiscall. */ -#if LJ_ABI_WIN - if (!ctype_isfp(d->info)) { - /* Sigh, the Windows/x86 ABI allows reordering across 64 bit args. */ - if (tref_typerange(tr, IRT_I64, IRT_U64)) { - if (ngpr) { - arg0 = &args[n]; args[n++] = TREF_NIL; ngpr--; - if (ngpr) { - arg1 = &args[n]; args[n++] = TREF_NIL; ngpr--; - } - } - } else { - if (arg0) { *arg0 = tr; arg0 = NULL; n--; continue; } - if (arg1) { *arg1 = tr; arg1 = NULL; n--; continue; } - if (ngpr) ngpr--; - } - } -#else - if (!ctype_isfp(d->info) && ngpr) { - if (tref_typerange(tr, IRT_I64, IRT_U64)) { - /* No reordering for other x86 ABIs. Simply add alignment args. */ - do { args[n++] = TREF_NIL; } while (--ngpr); - } else { - ngpr--; - } - } -#endif -#endif - args[n] = tr; - } - tr = args[0]; - for (i = 1; i < n; i++) - tr = emitir(IRT(IR_CARG, IRT_NIL), tr, args[i]); - return tr; -} - -/* Create a snapshot for the caller, simulating a 'false' return value. */ -static void crec_snap_caller(jit_State *J) -{ - lua_State *L = J->L; - TValue *base = L->base, *top = L->top; - const BCIns *pc = J->pc; - TRef ftr = J->base[-1]; - ptrdiff_t delta; - if (!frame_islua(base-1) || J->framedepth <= 0) - lj_trace_err(J, LJ_TRERR_NYICALL); - J->pc = frame_pc(base-1); delta = 1+bc_a(J->pc[-1]); - L->top = base; L->base = base - delta; - J->base[-1] = TREF_FALSE; - J->base -= delta; J->baseslot -= (BCReg)delta; - J->maxslot = (BCReg)delta; J->framedepth--; - lj_snap_add(J); - L->base = base; L->top = top; - J->framedepth++; J->maxslot = 1; - J->base += delta; J->baseslot += (BCReg)delta; - J->base[-1] = ftr; J->pc = pc; -} - -/* Record function call. */ -static int crec_call(jit_State *J, RecordFFData *rd, GCcdata *cd) -{ - CTState *cts = ctype_ctsG(J2G(J)); - CType *ct = ctype_raw(cts, cd->ctypeid); - IRType tp = IRT_PTR; - if (ctype_isptr(ct->info)) { - tp = (LJ_64 && ct->size == 8) ? IRT_P64 : IRT_P32; - ct = ctype_rawchild(cts, ct); - } - if (ctype_isfunc(ct->info)) { - TRef func = emitir(IRT(IR_FLOAD, tp), J->base[0], IRFL_CDATA_PTR); - CType *ctr = ctype_rawchild(cts, ct); - IRType t = crec_ct2irt(cts, ctr); - TRef tr; - TValue tv; - /* Check for blacklisted C functions that might call a callback. */ - setlightudV(&tv, - cdata_getptr(cdataptr(cd), (LJ_64 && tp == IRT_P64) ? 8 : 4)); - if (tvistrue(lj_tab_get(J->L, cts->miscmap, &tv))) - lj_trace_err(J, LJ_TRERR_BLACKL); - if (ctype_isvoid(ctr->info)) { - t = IRT_NIL; - rd->nres = 0; - } else if (!(ctype_isnum(ctr->info) || ctype_isptr(ctr->info) || - ctype_isenum(ctr->info)) || t == IRT_CDATA) { - lj_trace_err(J, LJ_TRERR_NYICALL); - } - if ((ct->info & CTF_VARARG) -#if LJ_TARGET_X86 - || ctype_cconv(ct->info) != CTCC_CDECL -#endif - ) - func = emitir(IRT(IR_CARG, IRT_NIL), func, - lj_ir_kint(J, ctype_typeid(cts, ct))); - tr = emitir(IRT(IR_CALLXS, t), crec_call_args(J, rd, cts, ct), func); - if (ctype_isbool(ctr->info)) { - if (frame_islua(J->L->base-1) && bc_b(frame_pc(J->L->base-1)[-1]) == 1) { - /* Don't check result if ignored. */ - tr = TREF_NIL; - } else { - crec_snap_caller(J); -#if LJ_TARGET_X86ORX64 - /* Note: only the x86/x64 backend supports U8 and only for EQ(tr, 0). */ - lj_ir_set(J, IRTG(IR_NE, IRT_U8), tr, lj_ir_kint(J, 0)); -#else - lj_ir_set(J, IRTGI(IR_NE), tr, lj_ir_kint(J, 0)); -#endif - J->postproc = LJ_POST_FIXGUARDSNAP; - tr = TREF_TRUE; - } - } else if (t == IRT_PTR || (LJ_64 && t == IRT_P32) || - t == IRT_I64 || t == IRT_U64 || ctype_isenum(ctr->info)) { - TRef trid = lj_ir_kint(J, ctype_cid(ct->info)); - tr = emitir(IRTG(IR_CNEWI, IRT_CDATA), trid, tr); - if (t == IRT_I64 || t == IRT_U64) lj_needsplit(J); - } else if (t == IRT_FLOAT || t == IRT_U32) { - tr = emitconv(tr, IRT_NUM, t, 0); - } else if (t == IRT_I8 || t == IRT_I16) { - tr = emitconv(tr, IRT_INT, t, IRCONV_SEXT); - } else if (t == IRT_U8 || t == IRT_U16) { - tr = emitconv(tr, IRT_INT, t, 0); - } - J->base[0] = tr; - J->needsnap = 1; - return 1; - } - return 0; -} - -void LJ_FASTCALL recff_cdata_call(jit_State *J, RecordFFData *rd) -{ - CTState *cts = ctype_ctsG(J2G(J)); - GCcdata *cd = argv2cdata(J, J->base[0], &rd->argv[0]); - CTypeID id = cd->ctypeid; - CType *ct; - cTValue *tv; - MMS mm = MM_call; - if (id == CTID_CTYPEID) { - id = crec_constructor(J, cd, J->base[0]); - mm = MM_new; - } else if (crec_call(J, rd, cd)) { - return; - } - /* Record ctype __call/__new metamethod. */ - ct = ctype_raw(cts, id); - tv = lj_ctype_meta(cts, ctype_isptr(ct->info) ? ctype_cid(ct->info) : id, mm); - if (tv) { - if (tvisfunc(tv)) { - J->base[-1] = lj_ir_kfunc(J, funcV(tv)) | TREF_FRAME; - rd->nres = -1; /* Pending tailcall. */ - return; - } - } else if (mm == MM_new) { - crec_alloc(J, rd, id); - return; - } - /* No metamethod or NYI: non-function metamethods. */ - lj_trace_err(J, LJ_TRERR_BADTYPE); -} - -static TRef crec_arith_int64(jit_State *J, TRef *sp, CType **s, MMS mm) -{ - if (sp[0] && sp[1] && ctype_isnum(s[0]->info) && ctype_isnum(s[1]->info)) { - IRType dt; - CTypeID id; - TRef tr; - MSize i; - IROp op; - lj_needsplit(J); - if (((s[0]->info & CTF_UNSIGNED) && s[0]->size == 8) || - ((s[1]->info & CTF_UNSIGNED) && s[1]->size == 8)) { - dt = IRT_U64; id = CTID_UINT64; - } else { - dt = IRT_I64; id = CTID_INT64; - if (mm < MM_add && - !((s[0]->info | s[1]->info) & CTF_FP) && - s[0]->size == 4 && s[1]->size == 4) { /* Try to narrow comparison. */ - if (!((s[0]->info ^ s[1]->info) & CTF_UNSIGNED) || - (tref_isk(sp[1]) && IR(tref_ref(sp[1]))->i >= 0)) { - dt = (s[0]->info & CTF_UNSIGNED) ? IRT_U32 : IRT_INT; - goto comp; - } else if (tref_isk(sp[0]) && IR(tref_ref(sp[0]))->i >= 0) { - dt = (s[1]->info & CTF_UNSIGNED) ? IRT_U32 : IRT_INT; - goto comp; - } - } - } - for (i = 0; i < 2; i++) { - IRType st = tref_type(sp[i]); - if (st == IRT_NUM || st == IRT_FLOAT) - sp[i] = emitconv(sp[i], dt, st, IRCONV_TRUNC|IRCONV_ANY); - else if (!(st == IRT_I64 || st == IRT_U64)) - sp[i] = emitconv(sp[i], dt, IRT_INT, - (s[i]->info & CTF_UNSIGNED) ? 0 : IRCONV_SEXT); - } - if (mm < MM_add) { - comp: - /* Assume true comparison. Fixup and emit pending guard later. */ - if (mm == MM_eq) { - op = IR_EQ; - } else { - op = mm == MM_lt ? IR_LT : IR_LE; - if (dt == IRT_U32 || dt == IRT_U64) - op += (IR_ULT-IR_LT); - } - lj_ir_set(J, IRTG(op, dt), sp[0], sp[1]); - J->postproc = LJ_POST_FIXGUARD; - return TREF_TRUE; - } else { - tr = emitir(IRT(mm+(int)IR_ADD-(int)MM_add, dt), sp[0], sp[1]); - } - return emitir(IRTG(IR_CNEWI, IRT_CDATA), lj_ir_kint(J, id), tr); - } - return 0; -} - -static TRef crec_arith_ptr(jit_State *J, TRef *sp, CType **s, MMS mm) -{ - CTState *cts = ctype_ctsG(J2G(J)); - CType *ctp = s[0]; - if (!(sp[0] && sp[1])) return 0; - if (ctype_isptr(ctp->info) || ctype_isrefarray(ctp->info)) { - if ((mm == MM_sub || mm == MM_eq || mm == MM_lt || mm == MM_le) && - (ctype_isptr(s[1]->info) || ctype_isrefarray(s[1]->info))) { - if (mm == MM_sub) { /* Pointer difference. */ - TRef tr; - CTSize sz = lj_ctype_size(cts, ctype_cid(ctp->info)); - if (sz == 0 || (sz & (sz-1)) != 0) - return 0; /* NYI: integer division. */ - tr = emitir(IRT(IR_SUB, IRT_INTP), sp[0], sp[1]); - tr = emitir(IRT(IR_BSAR, IRT_INTP), tr, lj_ir_kint(J, lj_fls(sz))); -#if LJ_64 - tr = emitconv(tr, IRT_NUM, IRT_INTP, 0); -#endif - return tr; - } else { /* Pointer comparison (unsigned). */ - /* Assume true comparison. Fixup and emit pending guard later. */ - IROp op = mm == MM_eq ? IR_EQ : mm == MM_lt ? IR_ULT : IR_ULE; - lj_ir_set(J, IRTG(op, IRT_PTR), sp[0], sp[1]); - J->postproc = LJ_POST_FIXGUARD; - return TREF_TRUE; - } - } - if (!((mm == MM_add || mm == MM_sub) && ctype_isnum(s[1]->info))) - return 0; - } else if (mm == MM_add && ctype_isnum(ctp->info) && - (ctype_isptr(s[1]->info) || ctype_isrefarray(s[1]->info))) { - TRef tr = sp[0]; sp[0] = sp[1]; sp[1] = tr; /* Swap pointer and index. */ - ctp = s[1]; - } else { - return 0; - } - { - TRef tr = sp[1]; - IRType t = tref_type(tr); - CTSize sz = lj_ctype_size(cts, ctype_cid(ctp->info)); - CTypeID id; -#if LJ_64 - if (t == IRT_NUM || t == IRT_FLOAT) - tr = emitconv(tr, IRT_INTP, t, IRCONV_TRUNC|IRCONV_ANY); - else if (!(t == IRT_I64 || t == IRT_U64)) - tr = emitconv(tr, IRT_INTP, IRT_INT, - ((t - IRT_I8) & 1) ? 0 : IRCONV_SEXT); -#else - if (!tref_typerange(sp[1], IRT_I8, IRT_U32)) { - tr = emitconv(tr, IRT_INTP, t, - (t == IRT_NUM || t == IRT_FLOAT) ? - IRCONV_TRUNC|IRCONV_ANY : 0); - } -#endif - tr = emitir(IRT(IR_MUL, IRT_INTP), tr, lj_ir_kintp(J, sz)); - tr = emitir(IRT(mm+(int)IR_ADD-(int)MM_add, IRT_PTR), sp[0], tr); - id = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|ctype_cid(ctp->info)), - CTSIZE_PTR); - return emitir(IRTG(IR_CNEWI, IRT_CDATA), lj_ir_kint(J, id), tr); - } -} - -/* Record ctype arithmetic metamethods. */ -static TRef crec_arith_meta(jit_State *J, TRef *sp, CType **s, CTState *cts, - RecordFFData *rd) -{ - cTValue *tv = NULL; - if (J->base[0]) { - if (tviscdata(&rd->argv[0])) { - CTypeID id = argv2cdata(J, J->base[0], &rd->argv[0])->ctypeid; - CType *ct = ctype_raw(cts, id); - if (ctype_isptr(ct->info)) id = ctype_cid(ct->info); - tv = lj_ctype_meta(cts, id, (MMS)rd->data); - } - if (!tv && J->base[1] && tviscdata(&rd->argv[1])) { - CTypeID id = argv2cdata(J, J->base[1], &rd->argv[1])->ctypeid; - CType *ct = ctype_raw(cts, id); - if (ctype_isptr(ct->info)) id = ctype_cid(ct->info); - tv = lj_ctype_meta(cts, id, (MMS)rd->data); - } - } - if (tv) { - if (tvisfunc(tv)) { - J->base[-1] = lj_ir_kfunc(J, funcV(tv)) | TREF_FRAME; - rd->nres = -1; /* Pending tailcall. */ - return 0; - } /* NYI: non-function metamethods. */ - } else if ((MMS)rd->data == MM_eq) { /* Fallback cdata pointer comparison. */ - if (sp[0] && sp[1] && ctype_isnum(s[0]->info) == ctype_isnum(s[1]->info)) { - /* Assume true comparison. Fixup and emit pending guard later. */ - lj_ir_set(J, IRTG(IR_EQ, IRT_PTR), sp[0], sp[1]); - J->postproc = LJ_POST_FIXGUARD; - return TREF_TRUE; - } else { - return TREF_FALSE; - } - } - lj_trace_err(J, LJ_TRERR_BADTYPE); - return 0; -} - -void LJ_FASTCALL recff_cdata_arith(jit_State *J, RecordFFData *rd) -{ - CTState *cts = ctype_ctsG(J2G(J)); - TRef sp[2]; - CType *s[2]; - MSize i; - for (i = 0; i < 2; i++) { - TRef tr = J->base[i]; - CType *ct = ctype_get(cts, CTID_DOUBLE); - if (!tr) { - lj_trace_err(J, LJ_TRERR_BADTYPE); - } else if (tref_iscdata(tr)) { - CTypeID id = argv2cdata(J, tr, &rd->argv[i])->ctypeid; - IRType t; - ct = ctype_raw(cts, id); - t = crec_ct2irt(cts, ct); - if (ctype_isptr(ct->info)) { /* Resolve pointer or reference. */ - tr = emitir(IRT(IR_FLOAD, t), tr, IRFL_CDATA_PTR); - if (ctype_isref(ct->info)) { - ct = ctype_rawchild(cts, ct); - t = crec_ct2irt(cts, ct); - } - } else if (t == IRT_I64 || t == IRT_U64) { - tr = emitir(IRT(IR_FLOAD, t), tr, IRFL_CDATA_INT64); - lj_needsplit(J); - goto ok; - } else if (t == IRT_INT || t == IRT_U32) { - tr = emitir(IRT(IR_FLOAD, t), tr, IRFL_CDATA_INT); - if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); - goto ok; - } else if (ctype_isfunc(ct->info)) { - tr = emitir(IRT(IR_FLOAD, IRT_PTR), tr, IRFL_CDATA_PTR); - ct = ctype_get(cts, - lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|id), CTSIZE_PTR)); - goto ok; - } else { - tr = emitir(IRT(IR_ADD, IRT_PTR), tr, lj_ir_kintp(J, sizeof(GCcdata))); - } - if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); - if (ctype_isnum(ct->info)) { - if (t == IRT_CDATA) { - tr = 0; - } else { - if (t == IRT_I64 || t == IRT_U64) lj_needsplit(J); - tr = emitir(IRT(IR_XLOAD, t), tr, 0); - } - } - } else if (tref_isnil(tr)) { - tr = lj_ir_kptr(J, NULL); - ct = ctype_get(cts, CTID_P_VOID); - } else if (tref_isinteger(tr)) { - ct = ctype_get(cts, CTID_INT32); - } else if (tref_isstr(tr)) { - TRef tr2 = J->base[1-i]; - CTypeID id = argv2cdata(J, tr2, &rd->argv[1-i])->ctypeid; - ct = ctype_raw(cts, id); - if (ctype_isenum(ct->info)) { /* Match string against enum constant. */ - GCstr *str = strV(&rd->argv[i]); - CTSize ofs; - CType *cct = lj_ctype_getfield(cts, ct, str, &ofs); - if (cct && ctype_isconstval(cct->info)) { - /* Specialize to the name of the enum constant. */ - emitir(IRTG(IR_EQ, IRT_STR), tr, lj_ir_kstr(J, str)); - ct = ctype_child(cts, cct); - tr = lj_ir_kint(J, (int32_t)ofs); - } else { /* Interpreter will throw or return false. */ - ct = ctype_get(cts, CTID_P_VOID); - } - } else if (ctype_isptr(ct->info)) { - tr = emitir(IRT(IR_ADD, IRT_PTR), tr, lj_ir_kintp(J, sizeof(GCstr))); - } else { - ct = ctype_get(cts, CTID_P_VOID); - } - } else if (!tref_isnum(tr)) { - tr = 0; - ct = ctype_get(cts, CTID_P_VOID); - } - ok: - s[i] = ct; - sp[i] = tr; - } - { - TRef tr; - if (!(tr = crec_arith_int64(J, sp, s, (MMS)rd->data)) && - !(tr = crec_arith_ptr(J, sp, s, (MMS)rd->data)) && - !(tr = crec_arith_meta(J, sp, s, cts, rd))) - return; - J->base[0] = tr; - /* Fixup cdata comparisons, too. Avoids some cdata escapes. */ - if (J->postproc == LJ_POST_FIXGUARD && frame_iscont(J->L->base-1) && - !irt_isguard(J->guardemit)) { - const BCIns *pc = frame_contpc(J->L->base-1) - 1; - if (bc_op(*pc) <= BC_ISNEP) { - setframe_pc(&J2G(J)->tmptv, pc); - J2G(J)->tmptv.u32.lo = ((tref_istrue(tr) ^ bc_op(*pc)) & 1); - J->postproc = LJ_POST_FIXCOMP; - } - } - } -} - -/* -- C library namespace metamethods ------------------------------------- */ - -void LJ_FASTCALL recff_clib_index(jit_State *J, RecordFFData *rd) -{ - CTState *cts = ctype_ctsG(J2G(J)); - if (tref_isudata(J->base[0]) && tref_isstr(J->base[1]) && - udataV(&rd->argv[0])->udtype == UDTYPE_FFI_CLIB) { - CLibrary *cl = (CLibrary *)uddata(udataV(&rd->argv[0])); - GCstr *name = strV(&rd->argv[1]); - CType *ct; - CTypeID id = lj_ctype_getname(cts, &ct, name, CLNS_INDEX); - cTValue *tv = lj_tab_getstr(cl->cache, name); - rd->nres = rd->data; - if (id && tv && !tvisnil(tv)) { - /* Specialize to the symbol name and make the result a constant. */ - emitir(IRTG(IR_EQ, IRT_STR), J->base[1], lj_ir_kstr(J, name)); - if (ctype_isconstval(ct->info)) { - if (ct->size >= 0x80000000u && - (ctype_child(cts, ct)->info & CTF_UNSIGNED)) - J->base[0] = lj_ir_knum(J, (lua_Number)(uint32_t)ct->size); - else - J->base[0] = lj_ir_kint(J, (int32_t)ct->size); - } else if (ctype_isextern(ct->info)) { - CTypeID sid = ctype_cid(ct->info); - void *sp = *(void **)cdataptr(cdataV(tv)); - TRef ptr; - ct = ctype_raw(cts, sid); - if (LJ_64 && !checkptr32(sp)) - ptr = lj_ir_kintp(J, (uintptr_t)sp); - else - ptr = lj_ir_kptr(J, sp); - if (rd->data) { - J->base[0] = crec_tv_ct(J, ct, sid, ptr); - } else { - J->needsnap = 1; - crec_ct_tv(J, ct, ptr, J->base[2], &rd->argv[2]); - } - } else { - J->base[0] = lj_ir_kgc(J, obj2gco(cdataV(tv)), IRT_CDATA); - } - } else { - lj_trace_err(J, LJ_TRERR_NOCACHE); - } - } /* else: interpreter will throw. */ -} - -/* -- FFI library functions ----------------------------------------------- */ - -static TRef crec_toint(jit_State *J, CTState *cts, TRef sp, TValue *sval) -{ - return crec_ct_tv(J, ctype_get(cts, CTID_INT32), 0, sp, sval); -} - -void LJ_FASTCALL recff_ffi_new(jit_State *J, RecordFFData *rd) -{ - crec_alloc(J, rd, argv2ctype(J, J->base[0], &rd->argv[0])); -} - -void LJ_FASTCALL recff_ffi_errno(jit_State *J, RecordFFData *rd) -{ - UNUSED(rd); - if (J->base[0]) - lj_trace_err(J, LJ_TRERR_NYICALL); - J->base[0] = lj_ir_call(J, IRCALL_lj_vm_errno); -} - -void LJ_FASTCALL recff_ffi_string(jit_State *J, RecordFFData *rd) -{ - CTState *cts = ctype_ctsG(J2G(J)); - TRef tr = J->base[0]; - if (tr) { - TRef trlen = J->base[1]; - if (!tref_isnil(trlen)) { - trlen = crec_toint(J, cts, trlen, &rd->argv[1]); - tr = crec_ct_tv(J, ctype_get(cts, CTID_P_CVOID), 0, tr, &rd->argv[0]); - } else { - tr = crec_ct_tv(J, ctype_get(cts, CTID_P_CCHAR), 0, tr, &rd->argv[0]); - trlen = lj_ir_call(J, IRCALL_strlen, tr); - } - J->base[0] = emitir(IRT(IR_XSNEW, IRT_STR), tr, trlen); - } /* else: interpreter will throw. */ -} - -void LJ_FASTCALL recff_ffi_copy(jit_State *J, RecordFFData *rd) -{ - CTState *cts = ctype_ctsG(J2G(J)); - TRef trdst = J->base[0], trsrc = J->base[1], trlen = J->base[2]; - if (trdst && trsrc && (trlen || tref_isstr(trsrc))) { - trdst = crec_ct_tv(J, ctype_get(cts, CTID_P_VOID), 0, trdst, &rd->argv[0]); - trsrc = crec_ct_tv(J, ctype_get(cts, CTID_P_CVOID), 0, trsrc, &rd->argv[1]); - if (trlen) { - trlen = crec_toint(J, cts, trlen, &rd->argv[2]); - } else { - trlen = emitir(IRTI(IR_FLOAD), J->base[1], IRFL_STR_LEN); - trlen = emitir(IRTI(IR_ADD), trlen, lj_ir_kint(J, 1)); - } - rd->nres = 0; - crec_copy(J, trdst, trsrc, trlen, NULL); - } /* else: interpreter will throw. */ -} - -void LJ_FASTCALL recff_ffi_fill(jit_State *J, RecordFFData *rd) -{ - CTState *cts = ctype_ctsG(J2G(J)); - TRef trdst = J->base[0], trlen = J->base[1], trfill = J->base[2]; - if (trdst && trlen) { - CTSize step = 1; - if (tviscdata(&rd->argv[0])) { /* Get alignment of original destination. */ - CTSize sz; - CType *ct = ctype_raw(cts, cdataV(&rd->argv[0])->ctypeid); - if (ctype_isptr(ct->info)) - ct = ctype_rawchild(cts, ct); - step = (1u<argv[0]); - trlen = crec_toint(J, cts, trlen, &rd->argv[1]); - if (trfill) - trfill = crec_toint(J, cts, trfill, &rd->argv[2]); - else - trfill = lj_ir_kint(J, 0); - rd->nres = 0; - crec_fill(J, trdst, trlen, trfill, step); - } /* else: interpreter will throw. */ -} - -void LJ_FASTCALL recff_ffi_typeof(jit_State *J, RecordFFData *rd) -{ - if (tref_iscdata(J->base[0])) { - TRef trid = lj_ir_kint(J, argv2ctype(J, J->base[0], &rd->argv[0])); - J->base[0] = emitir(IRTG(IR_CNEWI, IRT_CDATA), - lj_ir_kint(J, CTID_CTYPEID), trid); - } else { - setfuncV(J->L, &J->errinfo, J->fn); - lj_trace_err_info(J, LJ_TRERR_NYIFFU); - } -} - -void LJ_FASTCALL recff_ffi_istype(jit_State *J, RecordFFData *rd) -{ - argv2ctype(J, J->base[0], &rd->argv[0]); - if (tref_iscdata(J->base[1])) { - argv2ctype(J, J->base[1], &rd->argv[1]); - J->postproc = LJ_POST_FIXBOOL; - J->base[0] = TREF_TRUE; - } else { - J->base[0] = TREF_FALSE; - } -} - -void LJ_FASTCALL recff_ffi_abi(jit_State *J, RecordFFData *rd) -{ - if (tref_isstr(J->base[0])) { - /* Specialize to the ABI string to make the boolean result a constant. */ - emitir(IRTG(IR_EQ, IRT_STR), J->base[0], lj_ir_kstr(J, strV(&rd->argv[0]))); - J->postproc = LJ_POST_FIXBOOL; - J->base[0] = TREF_TRUE; - } else { - lj_trace_err(J, LJ_TRERR_BADTYPE); - } -} - -/* Record ffi.sizeof(), ffi.alignof(), ffi.offsetof(). */ -void LJ_FASTCALL recff_ffi_xof(jit_State *J, RecordFFData *rd) -{ - CTypeID id = argv2ctype(J, J->base[0], &rd->argv[0]); - if (rd->data == FF_ffi_sizeof) { - CType *ct = lj_ctype_rawref(ctype_ctsG(J2G(J)), id); - if (ctype_isvltype(ct->info)) - lj_trace_err(J, LJ_TRERR_BADTYPE); - } else if (rd->data == FF_ffi_offsetof) { /* Specialize to the field name. */ - if (!tref_isstr(J->base[1])) - lj_trace_err(J, LJ_TRERR_BADTYPE); - emitir(IRTG(IR_EQ, IRT_STR), J->base[1], lj_ir_kstr(J, strV(&rd->argv[1]))); - rd->nres = 3; /* Just in case. */ - } - J->postproc = LJ_POST_FIXCONST; - J->base[0] = J->base[1] = J->base[2] = TREF_NIL; -} - -void LJ_FASTCALL recff_ffi_gc(jit_State *J, RecordFFData *rd) -{ - argv2cdata(J, J->base[0], &rd->argv[0]); - crec_finalizer(J, J->base[0], &rd->argv[1]); -} - -/* -- Miscellaneous library functions ------------------------------------- */ - -void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd) -{ - CTState *cts = ctype_ctsG(J2G(J)); - CType *d, *ct = lj_ctype_rawref(cts, cdataV(&rd->argv[0])->ctypeid); - if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); - if (ctype_isnum(ct->info) || ctype_iscomplex(ct->info)) { - if (ctype_isinteger_or_bool(ct->info) && ct->size <= 4 && - !(ct->size == 4 && (ct->info & CTF_UNSIGNED))) - d = ctype_get(cts, CTID_INT32); - else - d = ctype_get(cts, CTID_DOUBLE); - J->base[0] = crec_ct_tv(J, d, 0, J->base[0], &rd->argv[0]); - } else { - J->base[0] = TREF_NIL; - } -} - -#undef IR -#undef emitir -#undef emitconv - -#endif diff --git a/subprojects/luajit/src/lj_crecord.h b/subprojects/luajit/src/lj_crecord.h deleted file mode 100644 index 8e0afd18c..000000000 --- a/subprojects/luajit/src/lj_crecord.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -** Trace recorder for C data operations. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_CRECORD_H -#define _LJ_CRECORD_H - -#include "lj_obj.h" -#include "lj_jit.h" -#include "lj_ffrecord.h" - -#if LJ_HASJIT && LJ_HASFFI -LJ_FUNC void LJ_FASTCALL recff_cdata_index(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_cdata_call(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_cdata_arith(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_clib_index(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_ffi_new(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_ffi_errno(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_ffi_string(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_ffi_copy(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_ffi_fill(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_ffi_typeof(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_ffi_istype(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_ffi_abi(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_ffi_xof(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL recff_ffi_gc(jit_State *J, RecordFFData *rd); -LJ_FUNC void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd); -#endif - -#endif diff --git a/subprojects/luajit/src/lj_ctype.c b/subprojects/luajit/src/lj_ctype.c deleted file mode 100644 index 9417500cb..000000000 --- a/subprojects/luajit/src/lj_ctype.c +++ /dev/null @@ -1,634 +0,0 @@ -/* -** C type management. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include "lj_obj.h" - -#if LJ_HASFFI - -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_ctype.h" -#include "lj_ccallback.h" - -/* -- C type definitions -------------------------------------------------- */ - -/* Predefined typedefs. */ -#define CTTDDEF(_) \ - /* Vararg handling. */ \ - _("va_list", P_VOID) \ - _("__builtin_va_list", P_VOID) \ - _("__gnuc_va_list", P_VOID) \ - /* From stddef.h. */ \ - _("ptrdiff_t", INT_PSZ) \ - _("size_t", UINT_PSZ) \ - _("wchar_t", WCHAR) \ - /* Subset of stdint.h. */ \ - _("int8_t", INT8) \ - _("int16_t", INT16) \ - _("int32_t", INT32) \ - _("int64_t", INT64) \ - _("uint8_t", UINT8) \ - _("uint16_t", UINT16) \ - _("uint32_t", UINT32) \ - _("uint64_t", UINT64) \ - _("intptr_t", INT_PSZ) \ - _("uintptr_t", UINT_PSZ) \ - /* End of typedef list. */ - -/* Keywords (only the ones we actually care for). */ -#define CTKWDEF(_) \ - /* Type specifiers. */ \ - _("void", -1, CTOK_VOID) \ - _("_Bool", 0, CTOK_BOOL) \ - _("bool", 1, CTOK_BOOL) \ - _("char", 1, CTOK_CHAR) \ - _("int", 4, CTOK_INT) \ - _("__int8", 1, CTOK_INT) \ - _("__int16", 2, CTOK_INT) \ - _("__int32", 4, CTOK_INT) \ - _("__int64", 8, CTOK_INT) \ - _("float", 4, CTOK_FP) \ - _("double", 8, CTOK_FP) \ - _("long", 0, CTOK_LONG) \ - _("short", 0, CTOK_SHORT) \ - _("_Complex", 0, CTOK_COMPLEX) \ - _("complex", 0, CTOK_COMPLEX) \ - _("__complex", 0, CTOK_COMPLEX) \ - _("__complex__", 0, CTOK_COMPLEX) \ - _("signed", 0, CTOK_SIGNED) \ - _("__signed", 0, CTOK_SIGNED) \ - _("__signed__", 0, CTOK_SIGNED) \ - _("unsigned", 0, CTOK_UNSIGNED) \ - /* Type qualifiers. */ \ - _("const", 0, CTOK_CONST) \ - _("__const", 0, CTOK_CONST) \ - _("__const__", 0, CTOK_CONST) \ - _("volatile", 0, CTOK_VOLATILE) \ - _("__volatile", 0, CTOK_VOLATILE) \ - _("__volatile__", 0, CTOK_VOLATILE) \ - _("restrict", 0, CTOK_RESTRICT) \ - _("__restrict", 0, CTOK_RESTRICT) \ - _("__restrict__", 0, CTOK_RESTRICT) \ - _("inline", 0, CTOK_INLINE) \ - _("__inline", 0, CTOK_INLINE) \ - _("__inline__", 0, CTOK_INLINE) \ - /* Storage class specifiers. */ \ - _("typedef", 0, CTOK_TYPEDEF) \ - _("extern", 0, CTOK_EXTERN) \ - _("static", 0, CTOK_STATIC) \ - _("auto", 0, CTOK_AUTO) \ - _("register", 0, CTOK_REGISTER) \ - /* GCC Attributes. */ \ - _("__extension__", 0, CTOK_EXTENSION) \ - _("__attribute", 0, CTOK_ATTRIBUTE) \ - _("__attribute__", 0, CTOK_ATTRIBUTE) \ - _("asm", 0, CTOK_ASM) \ - _("__asm", 0, CTOK_ASM) \ - _("__asm__", 0, CTOK_ASM) \ - /* MSVC Attributes. */ \ - _("__declspec", 0, CTOK_DECLSPEC) \ - _("__cdecl", CTCC_CDECL, CTOK_CCDECL) \ - _("__thiscall", CTCC_THISCALL, CTOK_CCDECL) \ - _("__fastcall", CTCC_FASTCALL, CTOK_CCDECL) \ - _("__stdcall", CTCC_STDCALL, CTOK_CCDECL) \ - _("__ptr32", 4, CTOK_PTRSZ) \ - _("__ptr64", 8, CTOK_PTRSZ) \ - /* Other type specifiers. */ \ - _("struct", 0, CTOK_STRUCT) \ - _("union", 0, CTOK_UNION) \ - _("enum", 0, CTOK_ENUM) \ - /* Operators. */ \ - _("sizeof", 0, CTOK_SIZEOF) \ - _("__alignof", 0, CTOK_ALIGNOF) \ - _("__alignof__", 0, CTOK_ALIGNOF) \ - /* End of keyword list. */ - -/* Type info for predefined types. Size merged in. */ -static CTInfo lj_ctype_typeinfo[] = { -#define CTTYINFODEF(id, sz, ct, info) CTINFO((ct),(((sz)&0x3fu)<<10)+(info)), -#define CTTDINFODEF(name, id) CTINFO(CT_TYPEDEF, CTID_##id), -#define CTKWINFODEF(name, sz, kw) CTINFO(CT_KW,(((sz)&0x3fu)<<10)+(kw)), -CTTYDEF(CTTYINFODEF) -CTTDDEF(CTTDINFODEF) -CTKWDEF(CTKWINFODEF) -#undef CTTYINFODEF -#undef CTTDINFODEF -#undef CTKWINFODEF - 0 -}; - -/* Predefined type names collected in a single string. */ -static const char * const lj_ctype_typenames = -#define CTTDNAMEDEF(name, id) name "\0" -#define CTKWNAMEDEF(name, sz, cds) name "\0" -CTTDDEF(CTTDNAMEDEF) -CTKWDEF(CTKWNAMEDEF) -#undef CTTDNAMEDEF -#undef CTKWNAMEDEF -; - -#define CTTYPEINFO_NUM (sizeof(lj_ctype_typeinfo)/sizeof(CTInfo)-1) -#ifdef LUAJIT_CTYPE_CHECK_ANCHOR -#define CTTYPETAB_MIN CTTYPEINFO_NUM -#else -#define CTTYPETAB_MIN 128 -#endif - -/* -- C type interning ---------------------------------------------------- */ - -#define ct_hashtype(info, size) (hashrot(info, size) & CTHASH_MASK) -#define ct_hashname(name) \ - (hashrot(u32ptr(name), u32ptr(name) + HASH_BIAS) & CTHASH_MASK) - -/* Create new type element. */ -CTypeID lj_ctype_new(CTState *cts, CType **ctp) -{ - CTypeID id = cts->top; - CType *ct; - lua_assert(cts->L); - if (LJ_UNLIKELY(id >= cts->sizetab)) { - if (id >= CTID_MAX) lj_err_msg(cts->L, LJ_ERR_TABOV); -#ifdef LUAJIT_CTYPE_CHECK_ANCHOR - ct = lj_mem_newvec(cts->L, id+1, CType); - memcpy(ct, cts->tab, id*sizeof(CType)); - memset(cts->tab, 0, id*sizeof(CType)); - lj_mem_freevec(cts->g, cts->tab, cts->sizetab, CType); - cts->tab = ct; - cts->sizetab = id+1; -#else - lj_mem_growvec(cts->L, cts->tab, cts->sizetab, CTID_MAX, CType); -#endif - } - cts->top = id+1; - *ctp = ct = &cts->tab[id]; - ct->info = 0; - ct->size = 0; - ct->sib = 0; - ct->next = 0; - setgcrefnull(ct->name); - return id; -} - -/* Intern a type element. */ -CTypeID lj_ctype_intern(CTState *cts, CTInfo info, CTSize size) -{ - uint32_t h = ct_hashtype(info, size); - CTypeID id = cts->hash[h]; - lua_assert(cts->L); - while (id) { - CType *ct = ctype_get(cts, id); - if (ct->info == info && ct->size == size) - return id; - id = ct->next; - } - id = cts->top; - if (LJ_UNLIKELY(id >= cts->sizetab)) { - if (id >= CTID_MAX) lj_err_msg(cts->L, LJ_ERR_TABOV); - lj_mem_growvec(cts->L, cts->tab, cts->sizetab, CTID_MAX, CType); - } - cts->top = id+1; - cts->tab[id].info = info; - cts->tab[id].size = size; - cts->tab[id].sib = 0; - cts->tab[id].next = cts->hash[h]; - setgcrefnull(cts->tab[id].name); - cts->hash[h] = (CTypeID1)id; - return id; -} - -/* Add type element to hash table. */ -static void ctype_addtype(CTState *cts, CType *ct, CTypeID id) -{ - uint32_t h = ct_hashtype(ct->info, ct->size); - ct->next = cts->hash[h]; - cts->hash[h] = (CTypeID1)id; -} - -/* Add named element to hash table. */ -void lj_ctype_addname(CTState *cts, CType *ct, CTypeID id) -{ - uint32_t h = ct_hashname(gcref(ct->name)); - ct->next = cts->hash[h]; - cts->hash[h] = (CTypeID1)id; -} - -/* Get a C type by name, matching the type mask. */ -CTypeID lj_ctype_getname(CTState *cts, CType **ctp, GCstr *name, uint32_t tmask) -{ - CTypeID id = cts->hash[ct_hashname(name)]; - while (id) { - CType *ct = ctype_get(cts, id); - if (gcref(ct->name) == obj2gco(name) && - ((tmask >> ctype_type(ct->info)) & 1)) { - *ctp = ct; - return id; - } - id = ct->next; - } - *ctp = &cts->tab[0]; /* Simplify caller logic. ctype_get() would assert. */ - return 0; -} - -/* Get a struct/union/enum/function field by name. */ -CType *lj_ctype_getfieldq(CTState *cts, CType *ct, GCstr *name, CTSize *ofs, - CTInfo *qual) -{ - while (ct->sib) { - ct = ctype_get(cts, ct->sib); - if (gcref(ct->name) == obj2gco(name)) { - *ofs = ct->size; - return ct; - } - if (ctype_isxattrib(ct->info, CTA_SUBTYPE)) { - CType *fct, *cct = ctype_child(cts, ct); - CTInfo q = 0; - while (ctype_isattrib(cct->info)) { - if (ctype_attrib(cct->info) == CTA_QUAL) q |= cct->size; - cct = ctype_child(cts, cct); - } - fct = lj_ctype_getfieldq(cts, cct, name, ofs, qual); - if (fct) { - if (qual) *qual |= q; - *ofs += ct->size; - return fct; - } - } - } - return NULL; /* Not found. */ -} - -/* -- C type information -------------------------------------------------- */ - -/* Follow references and get raw type for a C type ID. */ -CType *lj_ctype_rawref(CTState *cts, CTypeID id) -{ - CType *ct = ctype_get(cts, id); - while (ctype_isattrib(ct->info) || ctype_isref(ct->info)) - ct = ctype_child(cts, ct); - return ct; -} - -/* Get size for a C type ID. Does NOT support VLA/VLS. */ -CTSize lj_ctype_size(CTState *cts, CTypeID id) -{ - CType *ct = ctype_raw(cts, id); - return ctype_hassize(ct->info) ? ct->size : CTSIZE_INVALID; -} - -/* Get size for a variable-length C type. Does NOT support other C types. */ -CTSize lj_ctype_vlsize(CTState *cts, CType *ct, CTSize nelem) -{ - uint64_t xsz = 0; - if (ctype_isstruct(ct->info)) { - CTypeID arrid = 0, fid = ct->sib; - xsz = ct->size; /* Add the struct size. */ - while (fid) { - CType *ctf = ctype_get(cts, fid); - if (ctype_type(ctf->info) == CT_FIELD) - arrid = ctype_cid(ctf->info); /* Remember last field of VLS. */ - fid = ctf->sib; - } - ct = ctype_raw(cts, arrid); - } - lua_assert(ctype_isvlarray(ct->info)); /* Must be a VLA. */ - ct = ctype_rawchild(cts, ct); /* Get array element. */ - lua_assert(ctype_hassize(ct->info)); - /* Calculate actual size of VLA and check for overflow. */ - xsz += (uint64_t)ct->size * nelem; - return xsz < 0x80000000u ? (CTSize)xsz : CTSIZE_INVALID; -} - -/* Get type, qualifiers, size and alignment for a C type ID. */ -CTInfo lj_ctype_info(CTState *cts, CTypeID id, CTSize *szp) -{ - CTInfo qual = 0; - CType *ct = ctype_get(cts, id); - for (;;) { - CTInfo info = ct->info; - if (ctype_isenum(info)) { - /* Follow child. Need to look at its attributes, too. */ - } else if (ctype_isattrib(info)) { - if (ctype_isxattrib(info, CTA_QUAL)) - qual |= ct->size; - else if (ctype_isxattrib(info, CTA_ALIGN) && !(qual & CTFP_ALIGNED)) - qual |= CTFP_ALIGNED + CTALIGN(ct->size); - } else { - if (!(qual & CTFP_ALIGNED)) qual |= (info & CTF_ALIGN); - qual |= (info & ~(CTF_ALIGN|CTMASK_CID)); - lua_assert(ctype_hassize(info) || ctype_isfunc(info)); - *szp = ctype_isfunc(info) ? CTSIZE_INVALID : ct->size; - break; - } - ct = ctype_get(cts, ctype_cid(info)); - } - return qual; -} - -/* Get ctype metamethod. */ -cTValue *lj_ctype_meta(CTState *cts, CTypeID id, MMS mm) -{ - CType *ct = ctype_get(cts, id); - cTValue *tv; - while (ctype_isattrib(ct->info) || ctype_isref(ct->info)) { - id = ctype_cid(ct->info); - ct = ctype_get(cts, id); - } - if (ctype_isptr(ct->info) && - ctype_isfunc(ctype_get(cts, ctype_cid(ct->info))->info)) - tv = lj_tab_getstr(cts->miscmap, &cts->g->strempty); - else - tv = lj_tab_getinth(cts->miscmap, -(int32_t)id); - if (tv && tvistab(tv) && - (tv = lj_tab_getstr(tabV(tv), mmname_str(cts->g, mm))) && !tvisnil(tv)) - return tv; - return NULL; -} - -/* -- C type representation ----------------------------------------------- */ - -/* Fixed max. length of a C type representation. */ -#define CTREPR_MAX 512 - -typedef struct CTRepr { - char *pb, *pe; - CTState *cts; - lua_State *L; - int needsp; - int ok; - char buf[CTREPR_MAX]; -} CTRepr; - -/* Prepend string. */ -static void ctype_prepstr(CTRepr *ctr, const char *str, MSize len) -{ - char *p = ctr->pb; - if (ctr->buf + len+1 > p) { ctr->ok = 0; return; } - if (ctr->needsp) *--p = ' '; - ctr->needsp = 1; - p -= len; - while (len-- > 0) p[len] = str[len]; - ctr->pb = p; -} - -#define ctype_preplit(ctr, str) ctype_prepstr((ctr), "" str, sizeof(str)-1) - -/* Prepend char. */ -static void ctype_prepc(CTRepr *ctr, int c) -{ - if (ctr->buf >= ctr->pb) { ctr->ok = 0; return; } - *--ctr->pb = c; -} - -/* Prepend number. */ -static void ctype_prepnum(CTRepr *ctr, uint32_t n) -{ - char *p = ctr->pb; - if (ctr->buf + 10+1 > p) { ctr->ok = 0; return; } - do { *--p = (char)('0' + n % 10); } while (n /= 10); - ctr->pb = p; - ctr->needsp = 0; -} - -/* Append char. */ -static void ctype_appc(CTRepr *ctr, int c) -{ - if (ctr->pe >= ctr->buf + CTREPR_MAX) { ctr->ok = 0; return; } - *ctr->pe++ = c; -} - -/* Append number. */ -static void ctype_appnum(CTRepr *ctr, uint32_t n) -{ - char buf[10]; - char *p = buf+sizeof(buf); - char *q = ctr->pe; - if (q > ctr->buf + CTREPR_MAX - 10) { ctr->ok = 0; return; } - do { *--p = (char)('0' + n % 10); } while (n /= 10); - do { *q++ = *p++; } while (p < buf+sizeof(buf)); - ctr->pe = q; -} - -/* Prepend qualifiers. */ -static void ctype_prepqual(CTRepr *ctr, CTInfo info) -{ - if ((info & CTF_VOLATILE)) ctype_preplit(ctr, "volatile"); - if ((info & CTF_CONST)) ctype_preplit(ctr, "const"); -} - -/* Prepend named type. */ -static void ctype_preptype(CTRepr *ctr, CType *ct, CTInfo qual, const char *t) -{ - if (gcref(ct->name)) { - GCstr *str = gco2str(gcref(ct->name)); - ctype_prepstr(ctr, strdata(str), str->len); - } else { - if (ctr->needsp) ctype_prepc(ctr, ' '); - ctype_prepnum(ctr, ctype_typeid(ctr->cts, ct)); - ctr->needsp = 1; - } - ctype_prepstr(ctr, t, (MSize)strlen(t)); - ctype_prepqual(ctr, qual); -} - -static void ctype_repr(CTRepr *ctr, CTypeID id) -{ - CType *ct = ctype_get(ctr->cts, id); - CTInfo qual = 0; - int ptrto = 0; - for (;;) { - CTInfo info = ct->info; - CTSize size = ct->size; - switch (ctype_type(info)) { - case CT_NUM: - if ((info & CTF_BOOL)) { - ctype_preplit(ctr, "bool"); - } else if ((info & CTF_FP)) { - if (size == sizeof(double)) ctype_preplit(ctr, "double"); - else if (size == sizeof(float)) ctype_preplit(ctr, "float"); - else ctype_preplit(ctr, "long double"); - } else if (size == 1) { - if (!((info ^ CTF_UCHAR) & CTF_UNSIGNED)) ctype_preplit(ctr, "char"); - else if (CTF_UCHAR) ctype_preplit(ctr, "signed char"); - else ctype_preplit(ctr, "unsigned char"); - } else if (size < 8) { - if (size == 4) ctype_preplit(ctr, "int"); - else ctype_preplit(ctr, "short"); - if ((info & CTF_UNSIGNED)) ctype_preplit(ctr, "unsigned"); - } else { - ctype_preplit(ctr, "_t"); - ctype_prepnum(ctr, size*8); - ctype_preplit(ctr, "int"); - if ((info & CTF_UNSIGNED)) ctype_prepc(ctr, 'u'); - } - ctype_prepqual(ctr, (qual|info)); - return; - case CT_VOID: - ctype_preplit(ctr, "void"); - ctype_prepqual(ctr, (qual|info)); - return; - case CT_STRUCT: - ctype_preptype(ctr, ct, qual, (info & CTF_UNION) ? "union" : "struct"); - return; - case CT_ENUM: - if (id == CTID_CTYPEID) { - ctype_preplit(ctr, "ctype"); - return; - } - ctype_preptype(ctr, ct, qual, "enum"); - return; - case CT_ATTRIB: - if (ctype_attrib(info) == CTA_QUAL) qual |= size; - break; - case CT_PTR: - if ((info & CTF_REF)) { - ctype_prepc(ctr, '&'); - } else { - ctype_prepqual(ctr, (qual|info)); - if (LJ_64 && size == 4) ctype_preplit(ctr, "__ptr32"); - ctype_prepc(ctr, '*'); - } - qual = 0; - ptrto = 1; - ctr->needsp = 1; - break; - case CT_ARRAY: - if (ctype_isrefarray(info)) { - ctr->needsp = 1; - if (ptrto) { ptrto = 0; ctype_prepc(ctr, '('); ctype_appc(ctr, ')'); } - ctype_appc(ctr, '['); - if (size != CTSIZE_INVALID) { - CTSize csize = ctype_child(ctr->cts, ct)->size; - ctype_appnum(ctr, csize ? size/csize : 0); - } else if ((info & CTF_VLA)) { - ctype_appc(ctr, '?'); - } - ctype_appc(ctr, ']'); - } else if ((info & CTF_COMPLEX)) { - if (size == 2*sizeof(float)) ctype_preplit(ctr, "float"); - ctype_preplit(ctr, "complex"); - return; - } else { - ctype_preplit(ctr, ")))"); - ctype_prepnum(ctr, size); - ctype_preplit(ctr, "__attribute__((vector_size("); - } - break; - case CT_FUNC: - ctr->needsp = 1; - if (ptrto) { ptrto = 0; ctype_prepc(ctr, '('); ctype_appc(ctr, ')'); } - ctype_appc(ctr, '('); - ctype_appc(ctr, ')'); - break; - default: - lua_assert(0); - break; - } - ct = ctype_get(ctr->cts, ctype_cid(info)); - } -} - -/* Return a printable representation of a C type. */ -GCstr *lj_ctype_repr(lua_State *L, CTypeID id, GCstr *name) -{ - global_State *g = G(L); - CTRepr ctr; - ctr.pb = ctr.pe = &ctr.buf[CTREPR_MAX/2]; - ctr.cts = ctype_ctsG(g); - ctr.L = L; - ctr.ok = 1; - ctr.needsp = 0; - if (name) ctype_prepstr(&ctr, strdata(name), name->len); - ctype_repr(&ctr, id); - if (LJ_UNLIKELY(!ctr.ok)) return lj_str_newlit(L, "?"); - return lj_str_new(L, ctr.pb, ctr.pe - ctr.pb); -} - -/* Convert int64_t/uint64_t to string with 'LL' or 'ULL' suffix. */ -GCstr *lj_ctype_repr_int64(lua_State *L, uint64_t n, int isunsigned) -{ - char buf[1+20+3]; - char *p = buf+sizeof(buf); - int sign = 0; - *--p = 'L'; *--p = 'L'; - if (isunsigned) { - *--p = 'U'; - } else if ((int64_t)n < 0) { - n = (uint64_t)-(int64_t)n; - sign = 1; - } - do { *--p = (char)('0' + n % 10); } while (n /= 10); - if (sign) *--p = '-'; - return lj_str_new(L, p, (size_t)(buf+sizeof(buf)-p)); -} - -/* Convert complex to string with 'i' or 'I' suffix. */ -GCstr *lj_ctype_repr_complex(lua_State *L, void *sp, CTSize size) -{ - char buf[2*LJ_STR_NUMBUF+2+1]; - TValue re, im; - size_t len; - if (size == 2*sizeof(double)) { - re.n = *(double *)sp; im.n = ((double *)sp)[1]; - } else { - re.n = (double)*(float *)sp; im.n = (double)((float *)sp)[1]; - } - len = lj_str_bufnum(buf, &re); - if (!(im.u32.hi & 0x80000000u) || im.n != im.n) buf[len++] = '+'; - len += lj_str_bufnum(buf+len, &im); - buf[len] = buf[len-1] >= 'a' ? 'I' : 'i'; - return lj_str_new(L, buf, len+1); -} - -/* -- C type state -------------------------------------------------------- */ - -/* Initialize C type table and state. */ -CTState *lj_ctype_init(lua_State *L) -{ - CTState *cts = lj_mem_newt(L, sizeof(CTState), CTState); - CType *ct = lj_mem_newvec(L, CTTYPETAB_MIN, CType); - const char *name = lj_ctype_typenames; - CTypeID id; - memset(cts, 0, sizeof(CTState)); - cts->tab = ct; - cts->sizetab = CTTYPETAB_MIN; - cts->top = CTTYPEINFO_NUM; - cts->L = NULL; - cts->g = G(L); - for (id = 0; id < CTTYPEINFO_NUM; id++, ct++) { - CTInfo info = lj_ctype_typeinfo[id]; - ct->size = (CTSize)((int32_t)(info << 16) >> 26); - ct->info = info & 0xffff03ffu; - ct->sib = 0; - if (ctype_type(info) == CT_KW || ctype_istypedef(info)) { - size_t len = strlen(name); - GCstr *str = lj_str_new(L, name, len); - ctype_setname(ct, str); - name += len+1; - lj_ctype_addname(cts, ct, id); - } else { - setgcrefnull(ct->name); - ct->next = 0; - if (!ctype_isenum(info)) ctype_addtype(cts, ct, id); - } - } - setmref(G(L)->ctype_state, cts); - return cts; -} - -/* Free C type table and state. */ -void lj_ctype_freestate(global_State *g) -{ - CTState *cts = ctype_ctsG(g); - if (cts) { - lj_ccallback_mcode_free(cts); - lj_mem_freevec(g, cts->tab, cts->sizetab, CType); - lj_mem_freevec(g, cts->cb.cbid, cts->cb.sizeid, CTypeID1); - lj_mem_freet(g, cts); - } -} - -#endif diff --git a/subprojects/luajit/src/lj_ctype.h b/subprojects/luajit/src/lj_ctype.h deleted file mode 100644 index 2aefd3b6e..000000000 --- a/subprojects/luajit/src/lj_ctype.h +++ /dev/null @@ -1,461 +0,0 @@ -/* -** C type management. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_CTYPE_H -#define _LJ_CTYPE_H - -#include "lj_obj.h" -#include "lj_gc.h" - -#if LJ_HASFFI - -/* -- C type definitions -------------------------------------------------- */ - -/* C type numbers. Highest 4 bits of C type info. ORDER CT. */ -enum { - /* Externally visible types. */ - CT_NUM, /* Integer or floating-point numbers. */ - CT_STRUCT, /* Struct or union. */ - CT_PTR, /* Pointer or reference. */ - CT_ARRAY, /* Array or complex type. */ - CT_MAYCONVERT = CT_ARRAY, - CT_VOID, /* Void type. */ - CT_ENUM, /* Enumeration. */ - CT_HASSIZE = CT_ENUM, /* Last type where ct->size holds the actual size. */ - CT_FUNC, /* Function. */ - CT_TYPEDEF, /* Typedef. */ - CT_ATTRIB, /* Miscellaneous attributes. */ - /* Internal element types. */ - CT_FIELD, /* Struct/union field or function parameter. */ - CT_BITFIELD, /* Struct/union bitfield. */ - CT_CONSTVAL, /* Constant value. */ - CT_EXTERN, /* External reference. */ - CT_KW /* Keyword. */ -}; - -LJ_STATIC_ASSERT(((int)CT_PTR & (int)CT_ARRAY) == CT_PTR); -LJ_STATIC_ASSERT(((int)CT_STRUCT & (int)CT_ARRAY) == CT_STRUCT); - -/* -** ---------- info ------------ -** |type flags... A cid | size | sib | next | name | -** +----------------------------+--------+-------+-------+-------+-- -** |NUM BFcvUL.. A | size | | type | | -** |STRUCT ..cvU..V A | size | field | name? | name? | -** |PTR ..cvR... A cid | size | | type | | -** |ARRAY VCcv...V A cid | size | | type | | -** |VOID ..cv.... A | size | | type | | -** |ENUM A cid | size | const | name? | name? | -** |FUNC ....VS.. cc cid | nargs | field | name? | name? | -** |TYPEDEF cid | | | name | name | -** |ATTRIB attrnum cid | attr | sib? | type? | | -** |FIELD cid | offset | field | | name? | -** |BITFIELD B.cvU csz bsz pos | offset | field | | name? | -** |CONSTVAL c cid | value | const | name | name | -** |EXTERN cid | | sib? | name | name | -** |KW tok | size | | name | name | -** +----------------------------+--------+-------+-------+-------+-- -** ^^ ^^--- bits used for C type conversion dispatch -*/ - -/* C type info flags. TFFArrrr */ -#define CTF_BOOL 0x08000000u /* Boolean: NUM, BITFIELD. */ -#define CTF_FP 0x04000000u /* Floating-point: NUM. */ -#define CTF_CONST 0x02000000u /* Const qualifier. */ -#define CTF_VOLATILE 0x01000000u /* Volatile qualifier. */ -#define CTF_UNSIGNED 0x00800000u /* Unsigned: NUM, BITFIELD. */ -#define CTF_LONG 0x00400000u /* Long: NUM. */ -#define CTF_VLA 0x00100000u /* Variable-length: ARRAY, STRUCT. */ -#define CTF_REF 0x00800000u /* Reference: PTR. */ -#define CTF_VECTOR 0x08000000u /* Vector: ARRAY. */ -#define CTF_COMPLEX 0x04000000u /* Complex: ARRAY. */ -#define CTF_UNION 0x00800000u /* Union: STRUCT. */ -#define CTF_VARARG 0x00800000u /* Vararg: FUNC. */ -#define CTF_SSEREGPARM 0x00400000u /* SSE register parameters: FUNC. */ - -#define CTF_QUAL (CTF_CONST|CTF_VOLATILE) -#define CTF_ALIGN (CTMASK_ALIGN< 0 ? CTF_UNSIGNED : 0) - -/* Flags used in parser. .F.Ammvf cp->attr */ -#define CTFP_ALIGNED 0x00000001u /* cp->attr + ALIGN */ -#define CTFP_PACKED 0x00000002u /* cp->attr */ -/* ...C...f cp->fattr */ -#define CTFP_CCONV 0x00000001u /* cp->fattr + CCONV/[SSE]REGPARM */ - -/* C type info bitfields. */ -#define CTMASK_CID 0x0000ffffu /* Max. 65536 type IDs. */ -#define CTMASK_NUM 0xf0000000u /* Max. 16 type numbers. */ -#define CTSHIFT_NUM 28 -#define CTMASK_ALIGN 15 /* Max. alignment is 2^15. */ -#define CTSHIFT_ALIGN 16 -#define CTMASK_ATTRIB 255 /* Max. 256 attributes. */ -#define CTSHIFT_ATTRIB 16 -#define CTMASK_CCONV 3 /* Max. 4 calling conventions. */ -#define CTSHIFT_CCONV 16 -#define CTMASK_REGPARM 3 /* Max. 0-3 regparms. */ -#define CTSHIFT_REGPARM 18 -/* Bitfields only used in parser. */ -#define CTMASK_VSIZEP 15 /* Max. vector size is 2^15. */ -#define CTSHIFT_VSIZEP 4 -#define CTMASK_MSIZEP 255 /* Max. type size (via mode) is 128. */ -#define CTSHIFT_MSIZEP 8 - -/* Info bits for BITFIELD. Max. size of bitfield is 64 bits. */ -#define CTBSZ_MAX 32 /* Max. size of bitfield is 32 bit. */ -#define CTBSZ_FIELD 127 /* Temp. marker for regular field. */ -#define CTMASK_BITPOS 127 -#define CTMASK_BITBSZ 127 -#define CTMASK_BITCSZ 127 -#define CTSHIFT_BITPOS 0 -#define CTSHIFT_BITBSZ 8 -#define CTSHIFT_BITCSZ 16 - -#define CTF_INSERT(info, field, val) \ - info = (info & ~(CTMASK_##field<> CTSHIFT_NUM) -#define ctype_cid(info) ((CTypeID)((info) & CTMASK_CID)) -#define ctype_align(info) (((info) >> CTSHIFT_ALIGN) & CTMASK_ALIGN) -#define ctype_attrib(info) (((info) >> CTSHIFT_ATTRIB) & CTMASK_ATTRIB) -#define ctype_bitpos(info) (((info) >> CTSHIFT_BITPOS) & CTMASK_BITPOS) -#define ctype_bitbsz(info) (((info) >> CTSHIFT_BITBSZ) & CTMASK_BITBSZ) -#define ctype_bitcsz(info) (((info) >> CTSHIFT_BITCSZ) & CTMASK_BITCSZ) -#define ctype_vsizeP(info) (((info) >> CTSHIFT_VSIZEP) & CTMASK_VSIZEP) -#define ctype_msizeP(info) (((info) >> CTSHIFT_MSIZEP) & CTMASK_MSIZEP) -#define ctype_cconv(info) (((info) >> CTSHIFT_CCONV) & CTMASK_CCONV) - -/* Simple type checks. */ -#define ctype_isnum(info) (ctype_type((info)) == CT_NUM) -#define ctype_isvoid(info) (ctype_type((info)) == CT_VOID) -#define ctype_isptr(info) (ctype_type((info)) == CT_PTR) -#define ctype_isarray(info) (ctype_type((info)) == CT_ARRAY) -#define ctype_isstruct(info) (ctype_type((info)) == CT_STRUCT) -#define ctype_isfunc(info) (ctype_type((info)) == CT_FUNC) -#define ctype_isenum(info) (ctype_type((info)) == CT_ENUM) -#define ctype_istypedef(info) (ctype_type((info)) == CT_TYPEDEF) -#define ctype_isattrib(info) (ctype_type((info)) == CT_ATTRIB) -#define ctype_isfield(info) (ctype_type((info)) == CT_FIELD) -#define ctype_isbitfield(info) (ctype_type((info)) == CT_BITFIELD) -#define ctype_isconstval(info) (ctype_type((info)) == CT_CONSTVAL) -#define ctype_isextern(info) (ctype_type((info)) == CT_EXTERN) -#define ctype_hassize(info) (ctype_type((info)) <= CT_HASSIZE) - -/* Combined type and flag checks. */ -#define ctype_isinteger(info) \ - (((info) & (CTMASK_NUM|CTF_BOOL|CTF_FP)) == CTINFO(CT_NUM, 0)) -#define ctype_isinteger_or_bool(info) \ - (((info) & (CTMASK_NUM|CTF_FP)) == CTINFO(CT_NUM, 0)) -#define ctype_isbool(info) \ - (((info) & (CTMASK_NUM|CTF_BOOL)) == CTINFO(CT_NUM, CTF_BOOL)) -#define ctype_isfp(info) \ - (((info) & (CTMASK_NUM|CTF_FP)) == CTINFO(CT_NUM, CTF_FP)) - -#define ctype_ispointer(info) \ - ((ctype_type(info) >> 1) == (CT_PTR >> 1)) /* Pointer or array. */ -#define ctype_isref(info) \ - (((info) & (CTMASK_NUM|CTF_REF)) == CTINFO(CT_PTR, CTF_REF)) - -#define ctype_isrefarray(info) \ - (((info) & (CTMASK_NUM|CTF_VECTOR|CTF_COMPLEX)) == CTINFO(CT_ARRAY, 0)) -#define ctype_isvector(info) \ - (((info) & (CTMASK_NUM|CTF_VECTOR)) == CTINFO(CT_ARRAY, CTF_VECTOR)) -#define ctype_iscomplex(info) \ - (((info) & (CTMASK_NUM|CTF_COMPLEX)) == CTINFO(CT_ARRAY, CTF_COMPLEX)) - -#define ctype_isvltype(info) \ - (((info) & ((CTMASK_NUM|CTF_VLA) - (2u<") _(STRING, "") \ - _(INTEGER, "") _(EOF, "") \ - _(OROR, "||") _(ANDAND, "&&") _(EQ, "==") _(NE, "!=") \ - _(LE, "<=") _(GE, ">=") _(SHL, "<<") _(SHR, ">>") _(DEREF, "->") - -/* Simple declaration specifiers. */ -#define CDSDEF(_) \ - _(VOID) _(BOOL) _(CHAR) _(INT) _(FP) \ - _(LONG) _(LONGLONG) _(SHORT) _(COMPLEX) _(SIGNED) _(UNSIGNED) \ - _(CONST) _(VOLATILE) _(RESTRICT) _(INLINE) \ - _(TYPEDEF) _(EXTERN) _(STATIC) _(AUTO) _(REGISTER) - -/* C keywords. */ -#define CKWDEF(_) \ - CDSDEF(_) _(EXTENSION) _(ASM) _(ATTRIBUTE) \ - _(DECLSPEC) _(CCDECL) _(PTRSZ) \ - _(STRUCT) _(UNION) _(ENUM) \ - _(SIZEOF) _(ALIGNOF) - -/* C token numbers. */ -enum { - CTOK_OFS = 255, -#define CTOKNUM(name, sym) CTOK_##name, -#define CKWNUM(name) CTOK_##name, -CTOKDEF(CTOKNUM) -CKWDEF(CKWNUM) -#undef CTOKNUM -#undef CKWNUM - CTOK_FIRSTDECL = CTOK_VOID, - CTOK_FIRSTSCL = CTOK_TYPEDEF, - CTOK_LASTDECLFLAG = CTOK_REGISTER, - CTOK_LASTDECL = CTOK_ENUM -}; - -/* Declaration specifier flags. */ -enum { -#define CDSFLAG(name) CDF_##name = (1u << (CTOK_##name - CTOK_FIRSTDECL)), -CDSDEF(CDSFLAG) -#undef CDSFLAG - CDF__END -}; - -#define CDF_SCL (CDF_TYPEDEF|CDF_EXTERN|CDF_STATIC|CDF_AUTO|CDF_REGISTER) - -/* -- C type management --------------------------------------------------- */ - -#define ctype_ctsG(g) (mref((g)->ctype_state, CTState)) - -/* Get C type state. */ -static LJ_AINLINE CTState *ctype_cts(lua_State *L) -{ - CTState *cts = ctype_ctsG(G(L)); - cts->L = L; /* Save L for errors and allocations. */ - return cts; -} - -/* Save and restore state of C type table. */ -#define LJ_CTYPE_SAVE(cts) CTState savects_ = *(cts) -#define LJ_CTYPE_RESTORE(cts) \ - ((cts)->top = savects_.top, \ - memcpy((cts)->hash, savects_.hash, sizeof(savects_.hash))) - -/* Check C type ID for validity when assertions are enabled. */ -static LJ_AINLINE CTypeID ctype_check(CTState *cts, CTypeID id) -{ - lua_assert(id > 0 && id < cts->top); UNUSED(cts); - return id; -} - -/* Get C type for C type ID. */ -static LJ_AINLINE CType *ctype_get(CTState *cts, CTypeID id) -{ - return &cts->tab[ctype_check(cts, id)]; -} - -/* Get C type ID for a C type. */ -#define ctype_typeid(cts, ct) ((CTypeID)((ct) - (cts)->tab)) - -/* Get child C type. */ -static LJ_AINLINE CType *ctype_child(CTState *cts, CType *ct) -{ - lua_assert(!(ctype_isvoid(ct->info) || ctype_isstruct(ct->info) || - ctype_isbitfield(ct->info))); /* These don't have children. */ - return ctype_get(cts, ctype_cid(ct->info)); -} - -/* Get raw type for a C type ID. */ -static LJ_AINLINE CType *ctype_raw(CTState *cts, CTypeID id) -{ - CType *ct = ctype_get(cts, id); - while (ctype_isattrib(ct->info)) ct = ctype_child(cts, ct); - return ct; -} - -/* Get raw type of the child of a C type. */ -static LJ_AINLINE CType *ctype_rawchild(CTState *cts, CType *ct) -{ - do { ct = ctype_child(cts, ct); } while (ctype_isattrib(ct->info)); - return ct; -} - -/* Set the name of a C type table element. */ -static LJ_AINLINE void ctype_setname(CType *ct, GCstr *s) -{ - /* NOBARRIER: mark string as fixed -- the C type table is never collected. */ - fixstring(s); - setgcref(ct->name, obj2gco(s)); -} - -LJ_FUNC CTypeID lj_ctype_new(CTState *cts, CType **ctp); -LJ_FUNC CTypeID lj_ctype_intern(CTState *cts, CTInfo info, CTSize size); -LJ_FUNC void lj_ctype_addname(CTState *cts, CType *ct, CTypeID id); -LJ_FUNC CTypeID lj_ctype_getname(CTState *cts, CType **ctp, GCstr *name, - uint32_t tmask); -LJ_FUNC CType *lj_ctype_getfieldq(CTState *cts, CType *ct, GCstr *name, - CTSize *ofs, CTInfo *qual); -#define lj_ctype_getfield(cts, ct, name, ofs) \ - lj_ctype_getfieldq((cts), (ct), (name), (ofs), NULL) -LJ_FUNC CType *lj_ctype_rawref(CTState *cts, CTypeID id); -LJ_FUNC CTSize lj_ctype_size(CTState *cts, CTypeID id); -LJ_FUNC CTSize lj_ctype_vlsize(CTState *cts, CType *ct, CTSize nelem); -LJ_FUNC CTInfo lj_ctype_info(CTState *cts, CTypeID id, CTSize *szp); -LJ_FUNC cTValue *lj_ctype_meta(CTState *cts, CTypeID id, MMS mm); -LJ_FUNC GCstr *lj_ctype_repr(lua_State *L, CTypeID id, GCstr *name); -LJ_FUNC GCstr *lj_ctype_repr_int64(lua_State *L, uint64_t n, int isunsigned); -LJ_FUNC GCstr *lj_ctype_repr_complex(lua_State *L, void *sp, CTSize size); -LJ_FUNC CTState *lj_ctype_init(lua_State *L); -LJ_FUNC void lj_ctype_freestate(global_State *g); - -#endif - -#endif diff --git a/subprojects/luajit/src/lj_debug.c b/subprojects/luajit/src/lj_debug.c deleted file mode 100644 index a684302c1..000000000 --- a/subprojects/luajit/src/lj_debug.c +++ /dev/null @@ -1,605 +0,0 @@ -/* -** Debugging and introspection. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_debug_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_err.h" -#include "lj_debug.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_state.h" -#include "lj_frame.h" -#include "lj_bc.h" -#include "lj_vm.h" -#if LJ_HASJIT -#include "lj_jit.h" -#endif - -/* -- Frames -------------------------------------------------------------- */ - -/* Get frame corresponding to a level. */ -cTValue *lj_debug_frame(lua_State *L, int level, int *size) -{ - cTValue *frame, *nextframe, *bot = tvref(L->stack); - /* Traverse frames backwards. */ - for (nextframe = frame = L->base-1; frame > bot; ) { - if (frame_gc(frame) == obj2gco(L)) - level++; /* Skip dummy frames. See lj_meta_call(). */ - if (level-- == 0) { - *size = (int)(nextframe - frame); - return frame; /* Level found. */ - } - nextframe = frame; - if (frame_islua(frame)) { - frame = frame_prevl(frame); - } else { - if (frame_isvarg(frame)) - level++; /* Skip vararg pseudo-frame. */ - frame = frame_prevd(frame); - } - } - *size = level; - return NULL; /* Level not found. */ -} - -/* Invalid bytecode position. */ -#define NO_BCPOS (~(BCPos)0) - -/* Return bytecode position for function/frame or NO_BCPOS. */ -static BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe) -{ - const BCIns *ins; - GCproto *pt; - BCPos pos; - lua_assert(fn->c.gct == ~LJ_TFUNC || fn->c.gct == ~LJ_TTHREAD); - if (!isluafunc(fn)) { /* Cannot derive a PC for non-Lua functions. */ - return NO_BCPOS; - } else if (nextframe == NULL) { /* Lua function on top. */ - void *cf = cframe_raw(L->cframe); - if (cf == NULL || (char *)cframe_pc(cf) == (char *)cframe_L(cf)) - return NO_BCPOS; - ins = cframe_pc(cf); /* Only happens during error/hook handling. */ - } else { - if (frame_islua(nextframe)) { - ins = frame_pc(nextframe); - } else if (frame_iscont(nextframe)) { - ins = frame_contpc(nextframe); - } else { - /* Lua function below errfunc/gc/hook: find cframe to get the PC. */ - void *cf = cframe_raw(L->cframe); - TValue *f = L->base-1; - for (;;) { - if (cf == NULL) - return NO_BCPOS; - while (cframe_nres(cf) < 0) { - if (f >= restorestack(L, -cframe_nres(cf))) - break; - cf = cframe_raw(cframe_prev(cf)); - if (cf == NULL) - return NO_BCPOS; - } - if (f < nextframe) - break; - if (frame_islua(f)) { - f = frame_prevl(f); - } else { - if (frame_isc(f) || (LJ_HASFFI && frame_iscont(f) && - (f-1)->u32.lo == LJ_CONT_FFI_CALLBACK)) - cf = cframe_raw(cframe_prev(cf)); - f = frame_prevd(f); - } - } - ins = cframe_pc(cf); - } - } - pt = funcproto(fn); - pos = proto_bcpos(pt, ins) - 1; -#if LJ_HASJIT - if (pos > pt->sizebc) { /* Undo the effects of lj_trace_exit for JLOOP. */ - GCtrace *T = (GCtrace *)((char *)(ins-1) - offsetof(GCtrace, startins)); - lua_assert(bc_isret(bc_op(ins[-1]))); - pos = proto_bcpos(pt, mref(T->startpc, const BCIns)); - } -#endif - return pos; -} - -/* -- Line numbers -------------------------------------------------------- */ - -/* Get line number for a bytecode position. */ -BCLine LJ_FASTCALL lj_debug_line(GCproto *pt, BCPos pc) -{ - const void *lineinfo = proto_lineinfo(pt); - if (pc <= pt->sizebc && lineinfo) { - BCLine first = pt->firstline; - if (pc == pt->sizebc) return first + pt->numline; - if (pc-- == 0) return first; - if (pt->numline < 256) - return first + (BCLine)((const uint8_t *)lineinfo)[pc]; - else if (pt->numline < 65536) - return first + (BCLine)((const uint16_t *)lineinfo)[pc]; - else - return first + (BCLine)((const uint32_t *)lineinfo)[pc]; - } - return 0; -} - -/* Get line number for function/frame. */ -static BCLine debug_frameline(lua_State *L, GCfunc *fn, cTValue *nextframe) -{ - BCPos pc = debug_framepc(L, fn, nextframe); - if (pc != NO_BCPOS) { - GCproto *pt = funcproto(fn); - lua_assert(pc <= pt->sizebc); - return lj_debug_line(pt, pc); - } - return -1; -} - -/* -- Variable names ------------------------------------------------------ */ - -/* Read ULEB128 value. */ -static uint32_t debug_read_uleb128(const uint8_t **pp) -{ - const uint8_t *p = *pp; - uint32_t v = *p++; - if (LJ_UNLIKELY(v >= 0x80)) { - int sh = 0; - v &= 0x7f; - do { v |= ((*p & 0x7f) << (sh += 7)); } while (*p++ >= 0x80); - } - *pp = p; - return v; -} - -/* Get name of a local variable from slot number and PC. */ -static const char *debug_varname(const GCproto *pt, BCPos pc, BCReg slot) -{ - const uint8_t *p = proto_varinfo(pt); - if (p) { - BCPos lastpc = 0; - for (;;) { - const char *name = (const char *)p; - uint32_t vn = *p++; - BCPos startpc, endpc; - if (vn < VARNAME__MAX) { - if (vn == VARNAME_END) break; /* End of varinfo. */ - } else { - while (*p++) ; /* Skip over variable name string. */ - } - lastpc = startpc = lastpc + debug_read_uleb128(&p); - if (startpc > pc) break; - endpc = startpc + debug_read_uleb128(&p); - if (pc < endpc && slot-- == 0) { - if (vn < VARNAME__MAX) { -#define VARNAMESTR(name, str) str "\0" - name = VARNAMEDEF(VARNAMESTR); -#undef VARNAMESTR - if (--vn) while (*name++ || --vn) ; - } - return name; - } - } - } - return NULL; -} - -/* Get name of local variable from 1-based slot number and function/frame. */ -static TValue *debug_localname(lua_State *L, const lua_Debug *ar, - const char **name, BCReg slot1) -{ - uint32_t offset = (uint32_t)ar->i_ci & 0xffff; - uint32_t size = (uint32_t)ar->i_ci >> 16; - TValue *frame = tvref(L->stack) + offset; - TValue *nextframe = size ? frame + size : NULL; - GCfunc *fn = frame_func(frame); - BCPos pc = debug_framepc(L, fn, nextframe); - if (!nextframe) nextframe = L->top; - if ((int)slot1 < 0) { /* Negative slot number is for varargs. */ - if (pc != NO_BCPOS) { - GCproto *pt = funcproto(fn); - if ((pt->flags & PROTO_VARARG)) { - slot1 = pt->numparams + (BCReg)(-(int)slot1); - if (frame_isvarg(frame)) { /* Vararg frame has been set up? (pc!=0) */ - nextframe = frame; - frame = frame_prevd(frame); - } - if (frame + slot1 < nextframe) { - *name = "(*vararg)"; - return frame+slot1; - } - } - } - return NULL; - } - if (pc != NO_BCPOS && - (*name = debug_varname(funcproto(fn), pc, slot1-1)) != NULL) - ; - else if (slot1 > 0 && frame + slot1 < nextframe) - *name = "(*temporary)"; - return frame+slot1; -} - -/* Get name of upvalue. */ -const char *lj_debug_uvname(GCproto *pt, uint32_t idx) -{ - const uint8_t *p = proto_uvinfo(pt); - lua_assert(idx < pt->sizeuv); - if (!p) return ""; - if (idx) while (*p++ || --idx) ; - return (const char *)p; -} - -/* Get name and value of upvalue. */ -const char *lj_debug_uvnamev(cTValue *o, uint32_t idx, TValue **tvp) -{ - if (tvisfunc(o)) { - GCfunc *fn = funcV(o); - if (isluafunc(fn)) { - GCproto *pt = funcproto(fn); - if (idx < pt->sizeuv) { - *tvp = uvval(&gcref(fn->l.uvptr[idx])->uv); - return lj_debug_uvname(pt, idx); - } - } else { - if (idx < fn->c.nupvalues) { - *tvp = &fn->c.upvalue[idx]; - return ""; - } - } - } - return NULL; -} - -/* Deduce name of an object from slot number and PC. */ -const char *lj_debug_slotname(GCproto *pt, const BCIns *ip, BCReg slot, - const char **name) -{ - const char *lname; -restart: - lname = debug_varname(pt, proto_bcpos(pt, ip), slot); - if (lname != NULL) { *name = lname; return "local"; } - while (--ip > proto_bc(pt)) { - BCIns ins = *ip; - BCOp op = bc_op(ins); - BCReg ra = bc_a(ins); - if (bcmode_a(op) == BCMbase) { - if (slot >= ra && (op != BC_KNIL || slot <= bc_d(ins))) - return NULL; - } else if (bcmode_a(op) == BCMdst && ra == slot) { - switch (bc_op(ins)) { - case BC_MOV: - if (ra == slot) { slot = bc_d(ins); goto restart; } - break; - case BC_GGET: - *name = strdata(gco2str(proto_kgc(pt, ~(ptrdiff_t)bc_d(ins)))); - return "global"; - case BC_TGETS: - *name = strdata(gco2str(proto_kgc(pt, ~(ptrdiff_t)bc_c(ins)))); - if (ip > proto_bc(pt)) { - BCIns insp = ip[-1]; - if (bc_op(insp) == BC_MOV && bc_a(insp) == ra+1 && - bc_d(insp) == bc_b(ins)) - return "method"; - } - return "field"; - case BC_UGET: - *name = lj_debug_uvname(pt, bc_d(ins)); - return "upvalue"; - default: - return NULL; - } - } - } - return NULL; -} - -/* Deduce function name from caller of a frame. */ -const char *lj_debug_funcname(lua_State *L, TValue *frame, const char **name) -{ - TValue *pframe; - GCfunc *fn; - BCPos pc; - if (frame <= tvref(L->stack)) - return NULL; - if (frame_isvarg(frame)) - frame = frame_prevd(frame); - pframe = frame_prev(frame); - fn = frame_func(pframe); - pc = debug_framepc(L, fn, frame); - if (pc != NO_BCPOS) { - GCproto *pt = funcproto(fn); - const BCIns *ip = &proto_bc(pt)[check_exp(pc < pt->sizebc, pc)]; - MMS mm = bcmode_mm(bc_op(*ip)); - if (mm == MM_call) { - BCReg slot = bc_a(*ip); - if (bc_op(*ip) == BC_ITERC) slot -= 3; - return lj_debug_slotname(pt, ip, slot, name); - } else if (mm != MM__MAX) { - *name = strdata(mmname_str(G(L), mm)); - return "metamethod"; - } - } - return NULL; -} - -/* -- Source code locations ----------------------------------------------- */ - -/* Generate shortened source name. */ -void lj_debug_shortname(char *out, GCstr *str) -{ - const char *src = strdata(str); - if (*src == '=') { - strncpy(out, src+1, LUA_IDSIZE); /* Remove first char. */ - out[LUA_IDSIZE-1] = '\0'; /* Ensures null termination. */ - } else if (*src == '@') { /* Output "source", or "...source". */ - size_t len = str->len-1; - src++; /* Skip the `@' */ - if (len >= LUA_IDSIZE) { - src += len-(LUA_IDSIZE-4); /* Get last part of file name. */ - *out++ = '.'; *out++ = '.'; *out++ = '.'; - } - strcpy(out, src); - } else { /* Output [string "string"]. */ - size_t len; /* Length, up to first control char. */ - for (len = 0; len < LUA_IDSIZE-12; len++) - if (((const unsigned char *)src)[len] < ' ') break; - strcpy(out, "[string \""); out += 9; - if (src[len] != '\0') { /* Must truncate? */ - if (len > LUA_IDSIZE-15) len = LUA_IDSIZE-15; - strncpy(out, src, len); out += len; - strcpy(out, "..."); out += 3; - } else { - strcpy(out, src); out += len; - } - strcpy(out, "\"]"); - } -} - -/* Add current location of a frame to error message. */ -void lj_debug_addloc(lua_State *L, const char *msg, - cTValue *frame, cTValue *nextframe) -{ - if (frame) { - GCfunc *fn = frame_func(frame); - if (isluafunc(fn)) { - BCLine line = debug_frameline(L, fn, nextframe); - if (line >= 0) { - char buf[LUA_IDSIZE]; - lj_debug_shortname(buf, proto_chunkname(funcproto(fn))); - lj_str_pushf(L, "%s:%d: %s", buf, line, msg); - return; - } - } - } - lj_str_pushf(L, "%s", msg); -} - -/* Push location string for a bytecode position to Lua stack. */ -void lj_debug_pushloc(lua_State *L, GCproto *pt, BCPos pc) -{ - GCstr *name = proto_chunkname(pt); - const char *s = strdata(name); - MSize i, len = name->len; - BCLine line = lj_debug_line(pt, pc); - if (*s == '@') { - s++; len--; - for (i = len; i > 0; i--) - if (s[i] == '/' || s[i] == '\\') { - s += i+1; - break; - } - lj_str_pushf(L, "%s:%d", s, line); - } else if (len > 40) { - lj_str_pushf(L, "%p:%d", pt, line); - } else if (*s == '=') { - lj_str_pushf(L, "%s:%d", s+1, line); - } else { - lj_str_pushf(L, "\"%s\":%d", s, line); - } -} - -/* -- Public debug API ---------------------------------------------------- */ - -/* lua_getupvalue() and lua_setupvalue() are in lj_api.c. */ - -LUA_API const char *lua_getlocal(lua_State *L, const lua_Debug *ar, int n) -{ - const char *name = NULL; - if (ar) { - TValue *o = debug_localname(L, ar, &name, (BCReg)n); - if (name) { - copyTV(L, L->top, o); - incr_top(L); - } - } else if (tvisfunc(L->top-1) && isluafunc(funcV(L->top-1))) { - name = debug_varname(funcproto(funcV(L->top-1)), 0, (BCReg)n-1); - } - return name; -} - -LUA_API const char *lua_setlocal(lua_State *L, const lua_Debug *ar, int n) -{ - const char *name = NULL; - TValue *o = debug_localname(L, ar, &name, (BCReg)n); - if (name) - copyTV(L, o, L->top-1); - L->top--; - return name; -} - -int lj_debug_getinfo(lua_State *L, const char *what, lj_Debug *ar, int ext) -{ - int opt_f = 0, opt_L = 0; - TValue *frame = NULL; - TValue *nextframe = NULL; - GCfunc *fn; - if (*what == '>') { - TValue *func = L->top - 1; - api_check(L, tvisfunc(func)); - fn = funcV(func); - L->top--; - what++; - } else { - uint32_t offset = (uint32_t)ar->i_ci & 0xffff; - uint32_t size = (uint32_t)ar->i_ci >> 16; - lua_assert(offset != 0); - frame = tvref(L->stack) + offset; - if (size) nextframe = frame + size; - lua_assert(frame <= tvref(L->maxstack) && - (!nextframe || nextframe <= tvref(L->maxstack))); - fn = frame_func(frame); - lua_assert(fn->c.gct == ~LJ_TFUNC); - } - for (; *what; what++) { - if (*what == 'S') { - if (isluafunc(fn)) { - GCproto *pt = funcproto(fn); - BCLine firstline = pt->firstline; - GCstr *name = proto_chunkname(pt); - ar->source = strdata(name); - lj_debug_shortname(ar->short_src, name); - ar->linedefined = (int)firstline; - ar->lastlinedefined = (int)(firstline + pt->numline); - ar->what = (firstline || !pt->numline) ? "Lua" : "main"; - } else { - ar->source = "=[C]"; - ar->short_src[0] = '['; - ar->short_src[1] = 'C'; - ar->short_src[2] = ']'; - ar->short_src[3] = '\0'; - ar->linedefined = -1; - ar->lastlinedefined = -1; - ar->what = "C"; - } - } else if (*what == 'l') { - ar->currentline = frame ? debug_frameline(L, fn, nextframe) : -1; - } else if (*what == 'u') { - ar->nups = fn->c.nupvalues; - if (ext) { - if (isluafunc(fn)) { - GCproto *pt = funcproto(fn); - ar->nparams = pt->numparams; - ar->isvararg = !!(pt->flags & PROTO_VARARG); - } else { - ar->nparams = 0; - ar->isvararg = 1; - } - } - } else if (*what == 'n') { - ar->namewhat = frame ? lj_debug_funcname(L, frame, &ar->name) : NULL; - if (ar->namewhat == NULL) { - ar->namewhat = ""; - ar->name = NULL; - } - } else if (*what == 'f') { - opt_f = 1; - } else if (*what == 'L') { - opt_L = 1; - } else { - return 0; /* Bad option. */ - } - } - if (opt_f) { - setfuncV(L, L->top, fn); - incr_top(L); - } - if (opt_L) { - if (isluafunc(fn)) { - GCtab *t = lj_tab_new(L, 0, 0); - GCproto *pt = funcproto(fn); - const void *lineinfo = proto_lineinfo(pt); - if (lineinfo) { - BCLine first = pt->firstline; - int sz = pt->numline < 256 ? 1 : pt->numline < 65536 ? 2 : 4; - MSize i, szl = pt->sizebc-1; - for (i = 0; i < szl; i++) { - BCLine line = first + - (sz == 1 ? (BCLine)((const uint8_t *)lineinfo)[i] : - sz == 2 ? (BCLine)((const uint16_t *)lineinfo)[i] : - (BCLine)((const uint32_t *)lineinfo)[i]); - setboolV(lj_tab_setint(L, t, line), 1); - } - } - settabV(L, L->top, t); - } else { - setnilV(L->top); - } - incr_top(L); - } - return 1; /* Ok. */ -} - -LUA_API int lua_getinfo(lua_State *L, const char *what, lua_Debug *ar) -{ - return lj_debug_getinfo(L, what, (lj_Debug *)ar, 0); -} - -LUA_API int lua_getstack(lua_State *L, int level, lua_Debug *ar) -{ - int size; - cTValue *frame = lj_debug_frame(L, level, &size); - if (frame) { - ar->i_ci = (size << 16) + (int)(frame - tvref(L->stack)); - return 1; - } else { - ar->i_ci = level - size; - return 0; - } -} - -/* Number of frames for the leading and trailing part of a traceback. */ -#define TRACEBACK_LEVELS1 12 -#define TRACEBACK_LEVELS2 10 - -LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, const char *msg, - int level) -{ - int top = (int)(L->top - L->base); - int lim = TRACEBACK_LEVELS1; - lua_Debug ar; - if (msg) lua_pushfstring(L, "%s\n", msg); - lua_pushliteral(L, "stack traceback:"); - while (lua_getstack(L1, level++, &ar)) { - GCfunc *fn; - if (level > lim) { - if (!lua_getstack(L1, level + TRACEBACK_LEVELS2, &ar)) { - level--; - } else { - lua_pushliteral(L, "\n\t..."); - lua_getstack(L1, -10, &ar); - level = ar.i_ci - TRACEBACK_LEVELS2; - } - lim = 2147483647; - continue; - } - lua_getinfo(L1, "Snlf", &ar); - fn = funcV(L1->top-1); L1->top--; - if (isffunc(fn) && !*ar.namewhat) - lua_pushfstring(L, "\n\t[builtin#%d]:", fn->c.ffid); - else - lua_pushfstring(L, "\n\t%s:", ar.short_src); - if (ar.currentline > 0) - lua_pushfstring(L, "%d:", ar.currentline); - if (*ar.namewhat) { - lua_pushfstring(L, " in function " LUA_QS, ar.name); - } else { - if (*ar.what == 'm') { - lua_pushliteral(L, " in main chunk"); - } else if (*ar.what == 'C') { - lua_pushfstring(L, " at %p", fn->c.f); - } else { - lua_pushfstring(L, " in function <%s:%d>", - ar.short_src, ar.linedefined); - } - } - if ((int)(L->top - L->base) - top >= 15) - lua_concat(L, (int)(L->top - L->base) - top); - } - lua_concat(L, (int)(L->top - L->base) - top); -} - diff --git a/subprojects/luajit/src/lj_debug.h b/subprojects/luajit/src/lj_debug.h deleted file mode 100644 index d10d0da2c..000000000 --- a/subprojects/luajit/src/lj_debug.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -** Debugging and introspection. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_DEBUG_H -#define _LJ_DEBUG_H - -#include "lj_obj.h" - -typedef struct lj_Debug { - /* Common fields. Must be in the same order as in lua.h. */ - int event; - const char *name; - const char *namewhat; - const char *what; - const char *source; - int currentline; - int nups; - int linedefined; - int lastlinedefined; - char short_src[LUA_IDSIZE]; - int i_ci; - /* Extended fields. Only valid if lj_debug_getinfo() is called with ext = 1.*/ - int nparams; - int isvararg; -} lj_Debug; - -LJ_FUNC cTValue *lj_debug_frame(lua_State *L, int level, int *size); -LJ_FUNC BCLine LJ_FASTCALL lj_debug_line(GCproto *pt, BCPos pc); -LJ_FUNC const char *lj_debug_uvname(GCproto *pt, uint32_t idx); -LJ_FUNC const char *lj_debug_uvnamev(cTValue *o, uint32_t idx, TValue **tvp); -LJ_FUNC const char *lj_debug_slotname(GCproto *pt, const BCIns *pc, - BCReg slot, const char **name); -LJ_FUNC const char *lj_debug_funcname(lua_State *L, TValue *frame, - const char **name); -LJ_FUNC void lj_debug_shortname(char *out, GCstr *str); -LJ_FUNC void lj_debug_addloc(lua_State *L, const char *msg, - cTValue *frame, cTValue *nextframe); -LJ_FUNC void lj_debug_pushloc(lua_State *L, GCproto *pt, BCPos pc); -LJ_FUNC int lj_debug_getinfo(lua_State *L, const char *what, lj_Debug *ar, - int ext); - -/* Fixed internal variable names. */ -#define VARNAMEDEF(_) \ - _(FOR_IDX, "(for index)") \ - _(FOR_STOP, "(for limit)") \ - _(FOR_STEP, "(for step)") \ - _(FOR_GEN, "(for generator)") \ - _(FOR_STATE, "(for state)") \ - _(FOR_CTL, "(for control)") - -enum { - VARNAME_END, -#define VARNAMEENUM(name, str) VARNAME_##name, - VARNAMEDEF(VARNAMEENUM) -#undef VARNAMEENUM - VARNAME__MAX -}; - -#endif diff --git a/subprojects/luajit/src/lj_def.h b/subprojects/luajit/src/lj_def.h deleted file mode 100644 index 21cc59a4f..000000000 --- a/subprojects/luajit/src/lj_def.h +++ /dev/null @@ -1,353 +0,0 @@ -/* -** LuaJIT common internal definitions. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_DEF_H -#define _LJ_DEF_H - -#include "lua.h" - -#if defined(_MSC_VER) -/* MSVC is stuck in the last century and doesn't have C99's stdint.h. */ -typedef __int8 int8_t; -typedef __int16 int16_t; -typedef __int32 int32_t; -typedef __int64 int64_t; -typedef unsigned __int8 uint8_t; -typedef unsigned __int16 uint16_t; -typedef unsigned __int32 uint32_t; -typedef unsigned __int64 uint64_t; -#ifdef _WIN64 -typedef __int64 intptr_t; -typedef unsigned __int64 uintptr_t; -#else -typedef __int32 intptr_t; -typedef unsigned __int32 uintptr_t; -#endif -#elif defined(__symbian__) -/* Cough. */ -typedef signed char int8_t; -typedef short int int16_t; -typedef int int32_t; -typedef long long int64_t; -typedef unsigned char uint8_t; -typedef unsigned short int uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; -typedef int intptr_t; -typedef unsigned int uintptr_t; -#else -#include -#endif - -/* Needed everywhere. */ -#include -#include - -/* Various VM limits. */ -#define LJ_MAX_MEM 0x7fffff00 /* Max. total memory allocation. */ -#define LJ_MAX_ALLOC LJ_MAX_MEM /* Max. individual allocation length. */ -#define LJ_MAX_STR LJ_MAX_MEM /* Max. string length. */ -#define LJ_MAX_UDATA LJ_MAX_MEM /* Max. userdata length. */ - -#define LJ_MAX_STRTAB (1<<26) /* Max. string table size. */ -#define LJ_MAX_HBITS 26 /* Max. hash bits. */ -#define LJ_MAX_ABITS 28 /* Max. bits of array key. */ -#define LJ_MAX_ASIZE ((1<<(LJ_MAX_ABITS-1))+1) /* Max. array part size. */ -#define LJ_MAX_COLOSIZE 16 /* Max. elems for colocated array. */ - -#define LJ_MAX_LINE LJ_MAX_MEM /* Max. source code line number. */ -#define LJ_MAX_XLEVEL 200 /* Max. syntactic nesting level. */ -#define LJ_MAX_BCINS (1<<26) /* Max. # of bytecode instructions. */ -#define LJ_MAX_SLOTS 250 /* Max. # of slots in a Lua func. */ -#define LJ_MAX_LOCVAR 200 /* Max. # of local variables. */ -#define LJ_MAX_UPVAL 60 /* Max. # of upvalues. */ - -#define LJ_MAX_IDXCHAIN 100 /* __index/__newindex chain limit. */ -#define LJ_STACK_EXTRA 5 /* Extra stack space (metamethods). */ - -#define LJ_NUM_CBPAGE 1 /* Number of FFI callback pages. */ - -/* Minimum table/buffer sizes. */ -#define LJ_MIN_GLOBAL 6 /* Min. global table size (hbits). */ -#define LJ_MIN_REGISTRY 2 /* Min. registry size (hbits). */ -#define LJ_MIN_STRTAB 256 /* Min. string table size (pow2). */ -#define LJ_MIN_SBUF 32 /* Min. string buffer length. */ -#define LJ_MIN_VECSZ 8 /* Min. size for growable vectors. */ -#define LJ_MIN_IRSZ 32 /* Min. size for growable IR. */ -#define LJ_MIN_K64SZ 16 /* Min. size for chained K64Array. */ - -/* JIT compiler limits. */ -#define LJ_MAX_JSLOTS 250 /* Max. # of stack slots for a trace. */ -#define LJ_MAX_PHI 64 /* Max. # of PHIs for a loop. */ -#define LJ_MAX_EXITSTUBGR 16 /* Max. # of exit stub groups. */ - -/* Various macros. */ -#ifndef UNUSED -#define UNUSED(x) ((void)(x)) /* to avoid warnings */ -#endif - -#define U64x(hi, lo) (((uint64_t)0x##hi << 32) + (uint64_t)0x##lo) -#define i32ptr(p) ((int32_t)(intptr_t)(void *)(p)) -#define u32ptr(p) ((uint32_t)(intptr_t)(void *)(p)) - -#define checki8(x) ((x) == (int32_t)(int8_t)(x)) -#define checku8(x) ((x) == (int32_t)(uint8_t)(x)) -#define checki16(x) ((x) == (int32_t)(int16_t)(x)) -#define checku16(x) ((x) == (int32_t)(uint16_t)(x)) -#define checki32(x) ((x) == (int32_t)(x)) -#define checku32(x) ((x) == (uint32_t)(x)) -#define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x)) - -/* Every half-decent C compiler transforms this into a rotate instruction. */ -#define lj_rol(x, n) (((x)<<(n)) | ((x)>>(-(int)(n)&(8*sizeof(x)-1)))) -#define lj_ror(x, n) (((x)<<(-(int)(n)&(8*sizeof(x)-1))) | ((x)>>(n))) - -/* A really naive Bloom filter. But sufficient for our needs. */ -typedef uintptr_t BloomFilter; -#define BLOOM_MASK (8*sizeof(BloomFilter) - 1) -#define bloombit(x) ((uintptr_t)1 << ((x) & BLOOM_MASK)) -#define bloomset(b, x) ((b) |= bloombit((x))) -#define bloomtest(b, x) ((b) & bloombit((x))) - -#if defined(__GNUC__) || defined(__psp2__) - -#define LJ_NORET __attribute__((noreturn)) -#define LJ_ALIGN(n) __attribute__((aligned(n))) -#define LJ_INLINE inline -#define LJ_AINLINE inline __attribute__((always_inline)) -#define LJ_NOINLINE __attribute__((noinline)) - -#if defined(__ELF__) || defined(__MACH__) || defined(__psp2__) -#if !((defined(__sun__) && defined(__svr4__)) || defined(__CELLOS_LV2__)) -#define LJ_NOAPI extern __attribute__((visibility("hidden"))) -#endif -#endif - -/* Note: it's only beneficial to use fastcall on x86 and then only for up to -** two non-FP args. The amalgamated compile covers all LJ_FUNC cases. Only -** indirect calls and related tail-called C functions are marked as fastcall. -*/ -#if defined(__i386__) -#define LJ_FASTCALL __attribute__((fastcall)) -#endif - -#define LJ_LIKELY(x) __builtin_expect(!!(x), 1) -#define LJ_UNLIKELY(x) __builtin_expect(!!(x), 0) - -#define lj_ffs(x) ((uint32_t)__builtin_ctz(x)) -/* Don't ask ... */ -#if defined(__INTEL_COMPILER) && (defined(__i386__) || defined(__x86_64__)) -static LJ_AINLINE uint32_t lj_fls(uint32_t x) -{ - uint32_t r; __asm__("bsrl %1, %0" : "=r" (r) : "rm" (x) : "cc"); return r; -} -#else -#define lj_fls(x) ((uint32_t)(__builtin_clz(x)^31)) -#endif - -#if defined(__arm__) -static LJ_AINLINE uint32_t lj_bswap(uint32_t x) -{ -#if defined(__psp2__) - return __builtin_rev(x); -#else - uint32_t r; -#if __ARM_ARCH_6__ || __ARM_ARCH_6J__ || __ARM_ARCH_6T2__ || __ARM_ARCH_6Z__ ||\ - __ARM_ARCH_6ZK__ || __ARM_ARCH_7__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ - __asm__("rev %0, %1" : "=r" (r) : "r" (x)); - return r; -#else -#ifdef __thumb__ - r = x ^ lj_ror(x, 16); -#else - __asm__("eor %0, %1, %1, ror #16" : "=r" (r) : "r" (x)); -#endif - return ((r & 0xff00ffffu) >> 8) ^ lj_ror(x, 8); -#endif -#endif -} - -static LJ_AINLINE uint64_t lj_bswap64(uint64_t x) -{ - return ((uint64_t)lj_bswap((uint32_t)x)<<32) | lj_bswap((uint32_t)(x>>32)); -} -#elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) -static LJ_AINLINE uint32_t lj_bswap(uint32_t x) -{ - return (uint32_t)__builtin_bswap32((int32_t)x); -} - -static LJ_AINLINE uint64_t lj_bswap64(uint64_t x) -{ - return (uint64_t)__builtin_bswap64((int64_t)x); -} -#elif defined(__i386__) || defined(__x86_64__) -static LJ_AINLINE uint32_t lj_bswap(uint32_t x) -{ - uint32_t r; __asm__("bswap %0" : "=r" (r) : "0" (x)); return r; -} - -#if defined(__i386__) -static LJ_AINLINE uint64_t lj_bswap64(uint64_t x) -{ - return ((uint64_t)lj_bswap((uint32_t)x)<<32) | lj_bswap((uint32_t)(x>>32)); -} -#else -static LJ_AINLINE uint64_t lj_bswap64(uint64_t x) -{ - uint64_t r; __asm__("bswap %0" : "=r" (r) : "0" (x)); return r; -} -#endif -#else -static LJ_AINLINE uint32_t lj_bswap(uint32_t x) -{ - return (x << 24) | ((x & 0xff00) << 8) | ((x >> 8) & 0xff00) | (x >> 24); -} - -static LJ_AINLINE uint64_t lj_bswap64(uint64_t x) -{ - return (uint64_t)lj_bswap((uint32_t)(x >> 32)) | - ((uint64_t)lj_bswap((uint32_t)x) << 32); -} -#endif - -typedef union __attribute__((packed)) Unaligned16 { - uint16_t u; - uint8_t b[2]; -} Unaligned16; - -typedef union __attribute__((packed)) Unaligned32 { - uint32_t u; - uint8_t b[4]; -} Unaligned32; - -/* Unaligned load of uint16_t. */ -static LJ_AINLINE uint16_t lj_getu16(const void *p) -{ - return ((const Unaligned16 *)p)->u; -} - -/* Unaligned load of uint32_t. */ -static LJ_AINLINE uint32_t lj_getu32(const void *p) -{ - return ((const Unaligned32 *)p)->u; -} - -#elif defined(_MSC_VER) - -#define LJ_NORET __declspec(noreturn) -#define LJ_ALIGN(n) __declspec(align(n)) -#define LJ_INLINE __inline -#define LJ_AINLINE __forceinline -#define LJ_NOINLINE __declspec(noinline) -#if defined(_M_IX86) -#define LJ_FASTCALL __fastcall -#endif - -#ifdef _M_PPC -unsigned int _CountLeadingZeros(long); -#pragma intrinsic(_CountLeadingZeros) -static LJ_AINLINE uint32_t lj_fls(uint32_t x) -{ - return _CountLeadingZeros(x) ^ 31; -} -#else -unsigned char _BitScanForward(uint32_t *, unsigned long); -unsigned char _BitScanReverse(uint32_t *, unsigned long); -#pragma intrinsic(_BitScanForward) -#pragma intrinsic(_BitScanReverse) - -static LJ_AINLINE uint32_t lj_ffs(uint32_t x) -{ - uint32_t r; _BitScanForward(&r, x); return r; -} - -static LJ_AINLINE uint32_t lj_fls(uint32_t x) -{ - uint32_t r; _BitScanReverse(&r, x); return r; -} -#endif - -unsigned long _byteswap_ulong(unsigned long); -uint64_t _byteswap_uint64(uint64_t); -#define lj_bswap(x) (_byteswap_ulong((x))) -#define lj_bswap64(x) (_byteswap_uint64((x))) - -#if defined(_M_PPC) && defined(LUAJIT_NO_UNALIGNED) -/* -** Replacement for unaligned loads on Xbox 360. Disabled by default since it's -** usually more costly than the occasional stall when crossing a cache-line. -*/ -static LJ_AINLINE uint16_t lj_getu16(const void *v) -{ - const uint8_t *p = (const uint8_t *)v; - return (uint16_t)((p[0]<<8) | p[1]); -} -static LJ_AINLINE uint32_t lj_getu32(const void *v) -{ - const uint8_t *p = (const uint8_t *)v; - return (uint32_t)((p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3]); -} -#else -/* Unaligned loads are generally ok on x86/x64. */ -#define lj_getu16(p) (*(uint16_t *)(p)) -#define lj_getu32(p) (*(uint32_t *)(p)) -#endif - -#else -#error "missing defines for your compiler" -#endif - -/* Optional defines. */ -#ifndef LJ_FASTCALL -#define LJ_FASTCALL -#endif -#ifndef LJ_NORET -#define LJ_NORET -#endif -#ifndef LJ_NOAPI -#define LJ_NOAPI extern -#endif -#ifndef LJ_LIKELY -#define LJ_LIKELY(x) (x) -#define LJ_UNLIKELY(x) (x) -#endif - -/* Attributes for internal functions. */ -#define LJ_DATA LJ_NOAPI -#define LJ_DATADEF -#define LJ_ASMF LJ_NOAPI -#define LJ_FUNCA LJ_NOAPI -#if defined(ljamalg_c) -#define LJ_FUNC static -#else -#define LJ_FUNC LJ_NOAPI -#endif -#define LJ_FUNC_NORET LJ_FUNC LJ_NORET -#define LJ_FUNCA_NORET LJ_FUNCA LJ_NORET -#define LJ_ASMF_NORET LJ_ASMF LJ_NORET - -/* Runtime assertions. */ -#ifdef lua_assert -#define check_exp(c, e) (lua_assert(c), (e)) -#define api_check(l, e) lua_assert(e) -#else -#define lua_assert(c) ((void)0) -#define check_exp(c, e) (e) -#define api_check luai_apicheck -#endif - -/* Static assertions. */ -#define LJ_ASSERT_NAME2(name, line) name ## line -#define LJ_ASSERT_NAME(line) LJ_ASSERT_NAME2(lj_assert_, line) -#ifdef __COUNTER__ -#define LJ_STATIC_ASSERT(cond) \ - extern void LJ_ASSERT_NAME(__COUNTER__)(int STATIC_ASSERTION_FAILED[(cond)?1:-1]) -#else -#define LJ_STATIC_ASSERT(cond) \ - extern void LJ_ASSERT_NAME(__LINE__)(int STATIC_ASSERTION_FAILED[(cond)?1:-1]) -#endif - -#endif diff --git a/subprojects/luajit/src/lj_dispatch.c b/subprojects/luajit/src/lj_dispatch.c deleted file mode 100644 index 627379a2a..000000000 --- a/subprojects/luajit/src/lj_dispatch.c +++ /dev/null @@ -1,494 +0,0 @@ -/* -** Instruction dispatch handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_dispatch_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_err.h" -#include "lj_func.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_meta.h" -#include "lj_debug.h" -#include "lj_state.h" -#include "lj_frame.h" -#include "lj_bc.h" -#include "lj_ff.h" -#if LJ_HASJIT -#include "lj_jit.h" -#endif -#if LJ_HASFFI -#include "lj_ccallback.h" -#endif -#include "lj_trace.h" -#include "lj_dispatch.h" -#include "lj_vm.h" -#include "luajit.h" - -/* Bump GG_NUM_ASMFF in lj_dispatch.h as needed. Ugly. */ -LJ_STATIC_ASSERT(GG_NUM_ASMFF == FF_NUM_ASMFUNC); - -/* -- Dispatch table management ------------------------------------------- */ - -#if LJ_TARGET_MIPS -#include -LJ_FUNCA_NORET void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L, - lua_State *co); - -#define GOTFUNC(name) (ASMFunction)name, -static const ASMFunction dispatch_got[] = { - GOTDEF(GOTFUNC) -}; -#undef GOTFUNC -#endif - -/* Initialize instruction dispatch table and hot counters. */ -void lj_dispatch_init(GG_State *GG) -{ - uint32_t i; - ASMFunction *disp = GG->dispatch; - for (i = 0; i < GG_LEN_SDISP; i++) - disp[GG_LEN_DDISP+i] = disp[i] = makeasmfunc(lj_bc_ofs[i]); - for (i = GG_LEN_SDISP; i < GG_LEN_DDISP; i++) - disp[i] = makeasmfunc(lj_bc_ofs[i]); - /* The JIT engine is off by default. luaopen_jit() turns it on. */ - disp[BC_FORL] = disp[BC_IFORL]; - disp[BC_ITERL] = disp[BC_IITERL]; - disp[BC_LOOP] = disp[BC_ILOOP]; - disp[BC_FUNCF] = disp[BC_IFUNCF]; - disp[BC_FUNCV] = disp[BC_IFUNCV]; - GG->g.bc_cfunc_ext = GG->g.bc_cfunc_int = BCINS_AD(BC_FUNCC, LUA_MINSTACK, 0); - for (i = 0; i < GG_NUM_ASMFF; i++) - GG->bcff[i] = BCINS_AD(BC__MAX+i, 0, 0); -#if LJ_TARGET_MIPS - memcpy(GG->got, dispatch_got, LJ_GOT__MAX*4); -#endif -} - -#if LJ_HASJIT -/* Initialize hotcount table. */ -void lj_dispatch_init_hotcount(global_State *g) -{ - int32_t hotloop = G2J(g)->param[JIT_P_hotloop]; - HotCount start = (HotCount)(hotloop*HOTCOUNT_LOOP - 1); - HotCount *hotcount = G2GG(g)->hotcount; - uint32_t i; - for (i = 0; i < HOTCOUNT_SIZE; i++) - hotcount[i] = start; -} -#endif - -/* Internal dispatch mode bits. */ -#define DISPMODE_JIT 0x01 /* JIT compiler on. */ -#define DISPMODE_REC 0x02 /* Recording active. */ -#define DISPMODE_INS 0x04 /* Override instruction dispatch. */ -#define DISPMODE_CALL 0x08 /* Override call dispatch. */ -#define DISPMODE_RET 0x10 /* Override return dispatch. */ - -/* Update dispatch table depending on various flags. */ -void lj_dispatch_update(global_State *g) -{ - uint8_t oldmode = g->dispatchmode; - uint8_t mode = 0; -#if LJ_HASJIT - mode |= (G2J(g)->flags & JIT_F_ON) ? DISPMODE_JIT : 0; - mode |= G2J(g)->state != LJ_TRACE_IDLE ? - (DISPMODE_REC|DISPMODE_INS|DISPMODE_CALL) : 0; -#endif - mode |= (g->hookmask & (LUA_MASKLINE|LUA_MASKCOUNT)) ? DISPMODE_INS : 0; - mode |= (g->hookmask & LUA_MASKCALL) ? DISPMODE_CALL : 0; - mode |= (g->hookmask & LUA_MASKRET) ? DISPMODE_RET : 0; - if (oldmode != mode) { /* Mode changed? */ - ASMFunction *disp = G2GG(g)->dispatch; - ASMFunction f_forl, f_iterl, f_loop, f_funcf, f_funcv; - g->dispatchmode = mode; - - /* Hotcount if JIT is on, but not while recording. */ - if ((mode & (DISPMODE_JIT|DISPMODE_REC)) == DISPMODE_JIT) { - f_forl = makeasmfunc(lj_bc_ofs[BC_FORL]); - f_iterl = makeasmfunc(lj_bc_ofs[BC_ITERL]); - f_loop = makeasmfunc(lj_bc_ofs[BC_LOOP]); - f_funcf = makeasmfunc(lj_bc_ofs[BC_FUNCF]); - f_funcv = makeasmfunc(lj_bc_ofs[BC_FUNCV]); - } else { /* Otherwise use the non-hotcounting instructions. */ - f_forl = disp[GG_LEN_DDISP+BC_IFORL]; - f_iterl = disp[GG_LEN_DDISP+BC_IITERL]; - f_loop = disp[GG_LEN_DDISP+BC_ILOOP]; - f_funcf = makeasmfunc(lj_bc_ofs[BC_IFUNCF]); - f_funcv = makeasmfunc(lj_bc_ofs[BC_IFUNCV]); - } - /* Init static counting instruction dispatch first (may be copied below). */ - disp[GG_LEN_DDISP+BC_FORL] = f_forl; - disp[GG_LEN_DDISP+BC_ITERL] = f_iterl; - disp[GG_LEN_DDISP+BC_LOOP] = f_loop; - - /* Set dynamic instruction dispatch. */ - if ((oldmode ^ mode) & (DISPMODE_REC|DISPMODE_INS)) { - /* Need to update the whole table. */ - if (!(mode & (DISPMODE_REC|DISPMODE_INS))) { /* No ins dispatch? */ - /* Copy static dispatch table to dynamic dispatch table. */ - memcpy(&disp[0], &disp[GG_LEN_DDISP], GG_LEN_SDISP*sizeof(ASMFunction)); - /* Overwrite with dynamic return dispatch. */ - if ((mode & DISPMODE_RET)) { - disp[BC_RETM] = lj_vm_rethook; - disp[BC_RET] = lj_vm_rethook; - disp[BC_RET0] = lj_vm_rethook; - disp[BC_RET1] = lj_vm_rethook; - } - } else { - /* The recording dispatch also checks for hooks. */ - ASMFunction f = (mode & DISPMODE_REC) ? lj_vm_record : lj_vm_inshook; - uint32_t i; - for (i = 0; i < GG_LEN_SDISP; i++) - disp[i] = f; - } - } else if (!(mode & (DISPMODE_REC|DISPMODE_INS))) { - /* Otherwise set dynamic counting ins. */ - disp[BC_FORL] = f_forl; - disp[BC_ITERL] = f_iterl; - disp[BC_LOOP] = f_loop; - /* Set dynamic return dispatch. */ - if ((mode & DISPMODE_RET)) { - disp[BC_RETM] = lj_vm_rethook; - disp[BC_RET] = lj_vm_rethook; - disp[BC_RET0] = lj_vm_rethook; - disp[BC_RET1] = lj_vm_rethook; - } else { - disp[BC_RETM] = disp[GG_LEN_DDISP+BC_RETM]; - disp[BC_RET] = disp[GG_LEN_DDISP+BC_RET]; - disp[BC_RET0] = disp[GG_LEN_DDISP+BC_RET0]; - disp[BC_RET1] = disp[GG_LEN_DDISP+BC_RET1]; - } - } - - /* Set dynamic call dispatch. */ - if ((oldmode ^ mode) & DISPMODE_CALL) { /* Update the whole table? */ - uint32_t i; - if ((mode & DISPMODE_CALL) == 0) { /* No call hooks? */ - for (i = GG_LEN_SDISP; i < GG_LEN_DDISP; i++) - disp[i] = makeasmfunc(lj_bc_ofs[i]); - } else { - for (i = GG_LEN_SDISP; i < GG_LEN_DDISP; i++) - disp[i] = lj_vm_callhook; - } - } - if (!(mode & DISPMODE_CALL)) { /* Overwrite dynamic counting ins. */ - disp[BC_FUNCF] = f_funcf; - disp[BC_FUNCV] = f_funcv; - } - -#if LJ_HASJIT - /* Reset hotcounts for JIT off to on transition. */ - if ((mode & DISPMODE_JIT) && !(oldmode & DISPMODE_JIT)) - lj_dispatch_init_hotcount(g); -#endif - } -} - -/* -- JIT mode setting ---------------------------------------------------- */ - -#if LJ_HASJIT -/* Set JIT mode for a single prototype. */ -static void setptmode(global_State *g, GCproto *pt, int mode) -{ - if ((mode & LUAJIT_MODE_ON)) { /* (Re-)enable JIT compilation. */ - pt->flags &= ~PROTO_NOJIT; - lj_trace_reenableproto(pt); /* Unpatch all ILOOP etc. bytecodes. */ - } else { /* Flush and/or disable JIT compilation. */ - if (!(mode & LUAJIT_MODE_FLUSH)) - pt->flags |= PROTO_NOJIT; - lj_trace_flushproto(g, pt); /* Flush all traces of prototype. */ - } -} - -/* Recursively set the JIT mode for all children of a prototype. */ -static void setptmode_all(global_State *g, GCproto *pt, int mode) -{ - ptrdiff_t i; - if (!(pt->flags & PROTO_CHILD)) return; - for (i = -(ptrdiff_t)pt->sizekgc; i < 0; i++) { - GCobj *o = proto_kgc(pt, i); - if (o->gch.gct == ~LJ_TPROTO) { - setptmode(g, gco2pt(o), mode); - setptmode_all(g, gco2pt(o), mode); - } - } -} -#endif - -/* Public API function: control the JIT engine. */ -int luaJIT_setmode(lua_State *L, int idx, int mode) -{ - global_State *g = G(L); - int mm = mode & LUAJIT_MODE_MASK; - lj_trace_abort(g); /* Abort recording on any state change. */ - /* Avoid pulling the rug from under our own feet. */ - if ((g->hookmask & HOOK_GC)) - lj_err_caller(L, LJ_ERR_NOGCMM); - switch (mm) { -#if LJ_HASJIT - case LUAJIT_MODE_ENGINE: - if ((mode & LUAJIT_MODE_FLUSH)) { - lj_trace_flushall(L); - } else { - if (!(mode & LUAJIT_MODE_ON)) - G2J(g)->flags &= ~(uint32_t)JIT_F_ON; -#if LJ_TARGET_X86ORX64 - else if ((G2J(g)->flags & JIT_F_SSE2)) - G2J(g)->flags |= (uint32_t)JIT_F_ON; - else - return 0; /* Don't turn on JIT compiler without SSE2 support. */ -#else - else - G2J(g)->flags |= (uint32_t)JIT_F_ON; -#endif - lj_dispatch_update(g); - } - break; - case LUAJIT_MODE_FUNC: - case LUAJIT_MODE_ALLFUNC: - case LUAJIT_MODE_ALLSUBFUNC: { - cTValue *tv = idx == 0 ? frame_prev(L->base-1) : - idx > 0 ? L->base + (idx-1) : L->top + idx; - GCproto *pt; - if ((idx == 0 || tvisfunc(tv)) && isluafunc(&gcval(tv)->fn)) - pt = funcproto(&gcval(tv)->fn); /* Cannot use funcV() for frame slot. */ - else if (tvisproto(tv)) - pt = protoV(tv); - else - return 0; /* Failed. */ - if (mm != LUAJIT_MODE_ALLSUBFUNC) - setptmode(g, pt, mode); - if (mm != LUAJIT_MODE_FUNC) - setptmode_all(g, pt, mode); - break; - } - case LUAJIT_MODE_TRACE: - if (!(mode & LUAJIT_MODE_FLUSH)) - return 0; /* Failed. */ - lj_trace_flush(G2J(g), idx); - break; -#else - case LUAJIT_MODE_ENGINE: - case LUAJIT_MODE_FUNC: - case LUAJIT_MODE_ALLFUNC: - case LUAJIT_MODE_ALLSUBFUNC: - UNUSED(idx); - if ((mode & LUAJIT_MODE_ON)) - return 0; /* Failed. */ - break; -#endif - case LUAJIT_MODE_WRAPCFUNC: - if ((mode & LUAJIT_MODE_ON)) { - if (idx != 0) { - cTValue *tv = idx > 0 ? L->base + (idx-1) : L->top + idx; - if (tvislightud(tv)) - g->wrapf = (lua_CFunction)lightudV(tv); - else - return 0; /* Failed. */ - } else { - return 0; /* Failed. */ - } - g->bc_cfunc_ext = BCINS_AD(BC_FUNCCW, 0, 0); - } else { - g->bc_cfunc_ext = BCINS_AD(BC_FUNCC, 0, 0); - } - break; - default: - return 0; /* Failed. */ - } - return 1; /* OK. */ -} - -/* Enforce (dynamic) linker error for version mismatches. See luajit.c. */ -LUA_API void LUAJIT_VERSION_SYM(void) -{ -} - -/* -- Hooks --------------------------------------------------------------- */ - -/* This function can be called asynchronously (e.g. during a signal). */ -LUA_API int lua_sethook(lua_State *L, lua_Hook func, int mask, int count) -{ - global_State *g = G(L); - mask &= HOOK_EVENTMASK; - if (func == NULL || mask == 0) { mask = 0; func = NULL; } /* Consistency. */ - g->hookf = func; - g->hookcount = g->hookcstart = (int32_t)count; - g->hookmask = (uint8_t)((g->hookmask & ~HOOK_EVENTMASK) | mask); - lj_trace_abort(g); /* Abort recording on any hook change. */ - lj_dispatch_update(g); - return 1; -} - -LUA_API lua_Hook lua_gethook(lua_State *L) -{ - return G(L)->hookf; -} - -LUA_API int lua_gethookmask(lua_State *L) -{ - return G(L)->hookmask & HOOK_EVENTMASK; -} - -LUA_API int lua_gethookcount(lua_State *L) -{ - return (int)G(L)->hookcstart; -} - -/* Call a hook. */ -static void callhook(lua_State *L, int event, BCLine line) -{ - global_State *g = G(L); - lua_Hook hookf = g->hookf; - if (hookf && !hook_active(g)) { - lua_Debug ar; - lj_trace_abort(g); /* Abort recording on any hook call. */ - ar.event = event; - ar.currentline = line; - /* Top frame, nextframe = NULL. */ - ar.i_ci = (int)((L->base-1) - tvref(L->stack)); - lj_state_checkstack(L, 1+LUA_MINSTACK); - hook_enter(g); - hookf(L, &ar); - lua_assert(hook_active(g)); - hook_leave(g); - } -} - -/* -- Dispatch callbacks -------------------------------------------------- */ - -/* Calculate number of used stack slots in the current frame. */ -static BCReg cur_topslot(GCproto *pt, const BCIns *pc, uint32_t nres) -{ - BCIns ins = pc[-1]; - if (bc_op(ins) == BC_UCLO) - ins = pc[bc_j(ins)]; - switch (bc_op(ins)) { - case BC_CALLM: case BC_CALLMT: return bc_a(ins) + bc_c(ins) + nres-1+1; - case BC_RETM: return bc_a(ins) + bc_d(ins) + nres-1; - case BC_TSETM: return bc_a(ins) + nres-1; - default: return pt->framesize; - } -} - -/* Instruction dispatch. Used by instr/line/return hooks or when recording. */ -void LJ_FASTCALL lj_dispatch_ins(lua_State *L, const BCIns *pc) -{ - ERRNO_SAVE - GCfunc *fn = curr_func(L); - GCproto *pt = funcproto(fn); - void *cf = cframe_raw(L->cframe); - const BCIns *oldpc = cframe_pc(cf); - global_State *g = G(L); - BCReg slots; - setcframe_pc(cf, pc); - slots = cur_topslot(pt, pc, cframe_multres_n(cf)); - L->top = L->base + slots; /* Fix top. */ -#if LJ_HASJIT - { - jit_State *J = G2J(g); - if (J->state != LJ_TRACE_IDLE) { -#ifdef LUA_USE_ASSERT - ptrdiff_t delta = L->top - L->base; -#endif - J->L = L; - lj_trace_ins(J, pc-1); /* The interpreter bytecode PC is offset by 1. */ - lua_assert(L->top - L->base == delta); - } - } -#endif - if ((g->hookmask & LUA_MASKCOUNT) && g->hookcount == 0) { - g->hookcount = g->hookcstart; - callhook(L, LUA_HOOKCOUNT, -1); - L->top = L->base + slots; /* Fix top again. */ - } - if ((g->hookmask & LUA_MASKLINE)) { - BCPos npc = proto_bcpos(pt, pc) - 1; - BCPos opc = proto_bcpos(pt, oldpc) - 1; - BCLine line = lj_debug_line(pt, npc); - if (pc <= oldpc || opc >= pt->sizebc || line != lj_debug_line(pt, opc)) { - callhook(L, LUA_HOOKLINE, line); - L->top = L->base + slots; /* Fix top again. */ - } - } - if ((g->hookmask & LUA_MASKRET) && bc_isret(bc_op(pc[-1]))) - callhook(L, LUA_HOOKRET, -1); - ERRNO_RESTORE -} - -/* Initialize call. Ensure stack space and return # of missing parameters. */ -static int call_init(lua_State *L, GCfunc *fn) -{ - if (isluafunc(fn)) { - GCproto *pt = funcproto(fn); - int numparams = pt->numparams; - int gotparams = (int)(L->top - L->base); - int need = pt->framesize; - if ((pt->flags & PROTO_VARARG)) need += 1+gotparams; - lj_state_checkstack(L, (MSize)need); - numparams -= gotparams; - return numparams >= 0 ? numparams : 0; - } else { - lj_state_checkstack(L, LUA_MINSTACK); - return 0; - } -} - -/* Call dispatch. Used by call hooks, hot calls or when recording. */ -ASMFunction LJ_FASTCALL lj_dispatch_call(lua_State *L, const BCIns *pc) -{ - ERRNO_SAVE - GCfunc *fn = curr_func(L); - BCOp op; - global_State *g = G(L); -#if LJ_HASJIT - jit_State *J = G2J(g); -#endif - int missing = call_init(L, fn); -#if LJ_HASJIT - J->L = L; - if ((uintptr_t)pc & 1) { /* Marker for hot call. */ -#ifdef LUA_USE_ASSERT - ptrdiff_t delta = L->top - L->base; -#endif - pc = (const BCIns *)((uintptr_t)pc & ~(uintptr_t)1); - lj_trace_hot(J, pc); - lua_assert(L->top - L->base == delta); - goto out; - } else if (J->state != LJ_TRACE_IDLE && - !(g->hookmask & (HOOK_GC|HOOK_VMEVENT))) { -#ifdef LUA_USE_ASSERT - ptrdiff_t delta = L->top - L->base; -#endif - /* Record the FUNC* bytecodes, too. */ - lj_trace_ins(J, pc-1); /* The interpreter bytecode PC is offset by 1. */ - lua_assert(L->top - L->base == delta); - } -#endif - if ((g->hookmask & LUA_MASKCALL)) { - int i; - for (i = 0; i < missing; i++) /* Add missing parameters. */ - setnilV(L->top++); - callhook(L, LUA_HOOKCALL, -1); - /* Preserve modifications of missing parameters by lua_setlocal(). */ - while (missing-- > 0 && tvisnil(L->top - 1)) - L->top--; - } -#if LJ_HASJIT -out: -#endif - op = bc_op(pc[-1]); /* Get FUNC* op. */ -#if LJ_HASJIT - /* Use the non-hotcounting variants if JIT is off or while recording. */ - if ((!(J->flags & JIT_F_ON) || J->state != LJ_TRACE_IDLE) && - (op == BC_FUNCF || op == BC_FUNCV)) - op = (BCOp)((int)op+(int)BC_IFUNCF-(int)BC_FUNCF); -#endif - ERRNO_RESTORE - return makeasmfunc(lj_bc_ofs[op]); /* Return static dispatch target. */ -} - diff --git a/subprojects/luajit/src/lj_dispatch.h b/subprojects/luajit/src/lj_dispatch.h deleted file mode 100644 index e46a0eee7..000000000 --- a/subprojects/luajit/src/lj_dispatch.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -** Instruction dispatch handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_DISPATCH_H -#define _LJ_DISPATCH_H - -#include "lj_obj.h" -#include "lj_bc.h" -#if LJ_HASJIT -#include "lj_jit.h" -#endif - -#if LJ_TARGET_MIPS -/* Need our own global offset table for the dreaded MIPS calling conventions. */ -#if LJ_HASJIT -#define JITGOTDEF(_) _(lj_trace_exit) _(lj_trace_hot) -#else -#define JITGOTDEF(_) -#endif -#if LJ_HASFFI -#define FFIGOTDEF(_) \ - _(lj_meta_equal_cd) _(lj_ccallback_enter) _(lj_ccallback_leave) -#else -#define FFIGOTDEF(_) -#endif -#define GOTDEF(_) \ - _(floor) _(ceil) _(trunc) _(log) _(log10) _(exp) _(sin) _(cos) _(tan) \ - _(asin) _(acos) _(atan) _(sinh) _(cosh) _(tanh) _(frexp) _(modf) _(atan2) \ - _(pow) _(fmod) _(ldexp) \ - _(lj_dispatch_call) _(lj_dispatch_ins) _(lj_err_throw) \ - _(lj_ffh_coroutine_wrap_err) _(lj_func_closeuv) _(lj_func_newL_gc) \ - _(lj_gc_barrieruv) _(lj_gc_step) _(lj_gc_step_fixtop) _(lj_meta_arith) \ - _(lj_meta_call) _(lj_meta_cat) _(lj_meta_comp) _(lj_meta_equal) \ - _(lj_meta_for) _(lj_meta_len) _(lj_meta_tget) _(lj_meta_tset) \ - _(lj_state_growstack) _(lj_str_fromnum) _(lj_str_fromnumber) _(lj_str_new) \ - _(lj_tab_dup) _(lj_tab_get) _(lj_tab_getinth) _(lj_tab_len) _(lj_tab_new) \ - _(lj_tab_newkey) _(lj_tab_next) _(lj_tab_reasize) \ - JITGOTDEF(_) FFIGOTDEF(_) - -enum { -#define GOTENUM(name) LJ_GOT_##name, -GOTDEF(GOTENUM) -#undef GOTENUM - LJ_GOT__MAX -}; -#endif - -/* Type of hot counter. Must match the code in the assembler VM. */ -/* 16 bits are sufficient. Only 0.0015% overhead with maximum slot penalty. */ -typedef uint16_t HotCount; - -/* Number of hot counter hash table entries (must be a power of two). */ -#define HOTCOUNT_SIZE 64 -#define HOTCOUNT_PCMASK ((HOTCOUNT_SIZE-1)*sizeof(HotCount)) - -/* Hotcount decrements. */ -#define HOTCOUNT_LOOP 2 -#define HOTCOUNT_CALL 1 - -/* This solves a circular dependency problem -- bump as needed. Sigh. */ -#define GG_NUM_ASMFF 62 - -#define GG_LEN_DDISP (BC__MAX + GG_NUM_ASMFF) -#define GG_LEN_SDISP BC_FUNCF -#define GG_LEN_DISP (GG_LEN_DDISP + GG_LEN_SDISP) - -/* Global state, main thread and extra fields are allocated together. */ -typedef struct GG_State { - lua_State L; /* Main thread. */ - global_State g; /* Global state. */ -#if LJ_TARGET_MIPS - ASMFunction got[LJ_GOT__MAX]; /* Global offset table. */ -#endif -#if LJ_HASJIT - jit_State J; /* JIT state. */ - HotCount hotcount[HOTCOUNT_SIZE]; /* Hot counters. */ -#endif - ASMFunction dispatch[GG_LEN_DISP]; /* Instruction dispatch tables. */ - BCIns bcff[GG_NUM_ASMFF]; /* Bytecode for ASM fast functions. */ -} GG_State; - -#define GG_OFS(field) ((int)offsetof(GG_State, field)) -#define G2GG(gl) ((GG_State *)((char *)(gl) - GG_OFS(g))) -#define J2GG(j) ((GG_State *)((char *)(j) - GG_OFS(J))) -#define L2GG(L) (G2GG(G(L))) -#define J2G(J) (&J2GG(J)->g) -#define G2J(gl) (&G2GG(gl)->J) -#define L2J(L) (&L2GG(L)->J) -#define GG_G2DISP (GG_OFS(dispatch) - GG_OFS(g)) -#define GG_DISP2G (GG_OFS(g) - GG_OFS(dispatch)) -#define GG_DISP2J (GG_OFS(J) - GG_OFS(dispatch)) -#define GG_DISP2HOT (GG_OFS(hotcount) - GG_OFS(dispatch)) -#define GG_DISP2STATIC (GG_LEN_DDISP*(int)sizeof(ASMFunction)) - -#define hotcount_get(gg, pc) \ - (gg)->hotcount[(u32ptr(pc)>>2) & (HOTCOUNT_SIZE-1)] -#define hotcount_set(gg, pc, val) \ - (hotcount_get((gg), (pc)) = (HotCount)(val)) - -/* Dispatch table management. */ -LJ_FUNC void lj_dispatch_init(GG_State *GG); -#if LJ_HASJIT -LJ_FUNC void lj_dispatch_init_hotcount(global_State *g); -#endif -LJ_FUNC void lj_dispatch_update(global_State *g); - -/* Instruction dispatch callback for hooks or when recording. */ -LJ_FUNCA void LJ_FASTCALL lj_dispatch_ins(lua_State *L, const BCIns *pc); -LJ_FUNCA ASMFunction LJ_FASTCALL lj_dispatch_call(lua_State *L, const BCIns*pc); -LJ_FUNCA void LJ_FASTCALL lj_dispatch_return(lua_State *L, const BCIns *pc); - -#if LJ_HASFFI && !defined(_BUILDVM_H) -/* Save/restore errno and GetLastError() around hooks, exits and recording. */ -#include -#if LJ_TARGET_WINDOWS -#define WIN32_LEAN_AND_MEAN -#include -#define ERRNO_SAVE int olderr = errno; DWORD oldwerr = GetLastError(); -#define ERRNO_RESTORE errno = olderr; SetLastError(oldwerr); -#else -#define ERRNO_SAVE int olderr = errno; -#define ERRNO_RESTORE errno = olderr; -#endif -#else -#define ERRNO_SAVE -#define ERRNO_RESTORE -#endif - -#endif diff --git a/subprojects/luajit/src/lj_emit_arm.h b/subprojects/luajit/src/lj_emit_arm.h deleted file mode 100644 index 285c98de0..000000000 --- a/subprojects/luajit/src/lj_emit_arm.h +++ /dev/null @@ -1,356 +0,0 @@ -/* -** ARM instruction emitter. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -/* -- Constant encoding --------------------------------------------------- */ - -static uint8_t emit_invai[16] = { - /* AND */ (ARMI_AND^ARMI_BIC) >> 21, - /* EOR */ 0, - /* SUB */ (ARMI_SUB^ARMI_ADD) >> 21, - /* RSB */ 0, - /* ADD */ (ARMI_ADD^ARMI_SUB) >> 21, - /* ADC */ (ARMI_ADC^ARMI_SBC) >> 21, - /* SBC */ (ARMI_SBC^ARMI_ADC) >> 21, - /* RSC */ 0, - /* TST */ 0, - /* TEQ */ 0, - /* CMP */ (ARMI_CMP^ARMI_CMN) >> 21, - /* CMN */ (ARMI_CMN^ARMI_CMP) >> 21, - /* ORR */ 0, - /* MOV */ (ARMI_MOV^ARMI_MVN) >> 21, - /* BIC */ (ARMI_BIC^ARMI_AND) >> 21, - /* MVN */ (ARMI_MVN^ARMI_MOV) >> 21 -}; - -/* Encode constant in K12 format for data processing instructions. */ -static uint32_t emit_isk12(ARMIns ai, int32_t n) -{ - uint32_t invai, i, m = (uint32_t)n; - /* K12: unsigned 8 bit value, rotated in steps of two bits. */ - for (i = 0; i < 4096; i += 256, m = lj_rol(m, 2)) - if (m <= 255) return ARMI_K12|m|i; - /* Otherwise try negation/complement with the inverse instruction. */ - invai = emit_invai[((ai >> 21) & 15)]; - if (!invai) return 0; /* Failed. No inverse instruction. */ - m = ~(uint32_t)n; - if (invai == ((ARMI_SUB^ARMI_ADD) >> 21) || - invai == (ARMI_CMP^ARMI_CMN) >> 21) m++; - for (i = 0; i < 4096; i += 256, m = lj_rol(m, 2)) - if (m <= 255) return ARMI_K12|(invai<<21)|m|i; - return 0; /* Failed. */ -} - -/* -- Emit basic instructions --------------------------------------------- */ - -static void emit_dnm(ASMState *as, ARMIns ai, Reg rd, Reg rn, Reg rm) -{ - *--as->mcp = ai | ARMF_D(rd) | ARMF_N(rn) | ARMF_M(rm); -} - -static void emit_dm(ASMState *as, ARMIns ai, Reg rd, Reg rm) -{ - *--as->mcp = ai | ARMF_D(rd) | ARMF_M(rm); -} - -static void emit_dn(ASMState *as, ARMIns ai, Reg rd, Reg rn) -{ - *--as->mcp = ai | ARMF_D(rd) | ARMF_N(rn); -} - -static void emit_nm(ASMState *as, ARMIns ai, Reg rn, Reg rm) -{ - *--as->mcp = ai | ARMF_N(rn) | ARMF_M(rm); -} - -static void emit_d(ASMState *as, ARMIns ai, Reg rd) -{ - *--as->mcp = ai | ARMF_D(rd); -} - -static void emit_n(ASMState *as, ARMIns ai, Reg rn) -{ - *--as->mcp = ai | ARMF_N(rn); -} - -static void emit_m(ASMState *as, ARMIns ai, Reg rm) -{ - *--as->mcp = ai | ARMF_M(rm); -} - -static void emit_lsox(ASMState *as, ARMIns ai, Reg rd, Reg rn, int32_t ofs) -{ - lua_assert(ofs >= -255 && ofs <= 255); - if (ofs < 0) ofs = -ofs; else ai |= ARMI_LS_U; - *--as->mcp = ai | ARMI_LS_P | ARMI_LSX_I | ARMF_D(rd) | ARMF_N(rn) | - ((ofs & 0xf0) << 4) | (ofs & 0x0f); -} - -static void emit_lso(ASMState *as, ARMIns ai, Reg rd, Reg rn, int32_t ofs) -{ - lua_assert(ofs >= -4095 && ofs <= 4095); - /* Combine LDR/STR pairs to LDRD/STRD. */ - if (*as->mcp == (ai|ARMI_LS_P|ARMI_LS_U|ARMF_D(rd^1)|ARMF_N(rn)|(ofs^4)) && - (ai & ~(ARMI_LDR^ARMI_STR)) == ARMI_STR && rd != rn && - (uint32_t)ofs <= 252 && !(ofs & 3) && !((rd ^ (ofs >>2)) & 1) && - as->mcp != as->mcloop) { - as->mcp++; - emit_lsox(as, ai == ARMI_LDR ? ARMI_LDRD : ARMI_STRD, rd&~1, rn, ofs&~4); - return; - } - if (ofs < 0) ofs = -ofs; else ai |= ARMI_LS_U; - *--as->mcp = ai | ARMI_LS_P | ARMF_D(rd) | ARMF_N(rn) | ofs; -} - -#if !LJ_SOFTFP -static void emit_vlso(ASMState *as, ARMIns ai, Reg rd, Reg rn, int32_t ofs) -{ - lua_assert(ofs >= -1020 && ofs <= 1020 && (ofs&3) == 0); - if (ofs < 0) ofs = -ofs; else ai |= ARMI_LS_U; - *--as->mcp = ai | ARMI_LS_P | ARMF_D(rd & 15) | ARMF_N(rn) | (ofs >> 2); -} -#endif - -/* -- Emit loads/stores --------------------------------------------------- */ - -/* Prefer spills of BASE/L. */ -#define emit_canremat(ref) ((ref) < ASMREF_L) - -/* Try to find a one step delta relative to another constant. */ -static int emit_kdelta1(ASMState *as, Reg d, int32_t i) -{ - RegSet work = ~as->freeset & RSET_GPR; - while (work) { - Reg r = rset_picktop(work); - IRRef ref = regcost_ref(as->cost[r]); - lua_assert(r != d); - if (emit_canremat(ref)) { - int32_t delta = i - (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i); - uint32_t k = emit_isk12(ARMI_ADD, delta); - if (k) { - if (k == ARMI_K12) - emit_dm(as, ARMI_MOV, d, r); - else - emit_dn(as, ARMI_ADD^k, d, r); - return 1; - } - } - rset_clear(work, r); - } - return 0; /* Failed. */ -} - -/* Try to find a two step delta relative to another constant. */ -static int emit_kdelta2(ASMState *as, Reg d, int32_t i) -{ - RegSet work = ~as->freeset & RSET_GPR; - while (work) { - Reg r = rset_picktop(work); - IRRef ref = regcost_ref(as->cost[r]); - lua_assert(r != d); - if (emit_canremat(ref)) { - int32_t other = ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i; - if (other) { - int32_t delta = i - other; - uint32_t sh, inv = 0, k2, k; - if (delta < 0) { delta = -delta; inv = ARMI_ADD^ARMI_SUB; } - sh = lj_ffs(delta) & ~1; - k2 = emit_isk12(0, delta & (255 << sh)); - k = emit_isk12(0, delta & ~(255 << sh)); - if (k) { - emit_dn(as, ARMI_ADD^k2^inv, d, d); - emit_dn(as, ARMI_ADD^k^inv, d, r); - return 1; - } - } - } - rset_clear(work, r); - } - return 0; /* Failed. */ -} - -/* Load a 32 bit constant into a GPR. */ -static void emit_loadi(ASMState *as, Reg r, int32_t i) -{ - uint32_t k = emit_isk12(ARMI_MOV, i); - lua_assert(rset_test(as->freeset, r) || r == RID_TMP); - if (k) { - /* Standard K12 constant. */ - emit_d(as, ARMI_MOV^k, r); - } else if ((as->flags & JIT_F_ARMV6T2) && (uint32_t)i < 0x00010000u) { - /* 16 bit loword constant for ARMv6T2. */ - emit_d(as, ARMI_MOVW|(i & 0x0fff)|((i & 0xf000)<<4), r); - } else if (emit_kdelta1(as, r, i)) { - /* One step delta relative to another constant. */ - } else if ((as->flags & JIT_F_ARMV6T2)) { - /* 32 bit hiword/loword constant for ARMv6T2. */ - emit_d(as, ARMI_MOVT|((i>>16) & 0x0fff)|(((i>>16) & 0xf000)<<4), r); - emit_d(as, ARMI_MOVW|(i & 0x0fff)|((i & 0xf000)<<4), r); - } else if (emit_kdelta2(as, r, i)) { - /* Two step delta relative to another constant. */ - } else { - /* Otherwise construct the constant with up to 4 instructions. */ - /* NYI: use mvn+bic, use pc-relative loads. */ - for (;;) { - uint32_t sh = lj_ffs(i) & ~1; - int32_t m = i & (255 << sh); - i &= ~(255 << sh); - if (i == 0) { - emit_d(as, ARMI_MOV ^ emit_isk12(0, m), r); - break; - } - emit_dn(as, ARMI_ORR ^ emit_isk12(0, m), r, r); - } - } -} - -#define emit_loada(as, r, addr) emit_loadi(as, (r), i32ptr((addr))) - -static Reg ra_allock(ASMState *as, int32_t k, RegSet allow); - -/* Get/set from constant pointer. */ -static void emit_lsptr(ASMState *as, ARMIns ai, Reg r, void *p) -{ - int32_t i = i32ptr(p); - emit_lso(as, ai, r, ra_allock(as, (i & ~4095), rset_exclude(RSET_GPR, r)), - (i & 4095)); -} - -#if !LJ_SOFTFP -/* Load a number constant into an FPR. */ -static void emit_loadn(ASMState *as, Reg r, cTValue *tv) -{ - int32_t i; - if ((as->flags & JIT_F_VFPV3) && !tv->u32.lo) { - uint32_t hi = tv->u32.hi; - uint32_t b = ((hi >> 22) & 0x1ff); - if (!(hi & 0xffff) && (b == 0x100 || b == 0x0ff)) { - *--as->mcp = ARMI_VMOVI_D | ARMF_D(r & 15) | - ((tv->u32.hi >> 12) & 0x00080000) | - ((tv->u32.hi >> 4) & 0x00070000) | - ((tv->u32.hi >> 16) & 0x0000000f); - return; - } - } - i = i32ptr(tv); - emit_vlso(as, ARMI_VLDR_D, r, - ra_allock(as, (i & ~1020), RSET_GPR), (i & 1020)); -} -#endif - -/* Get/set global_State fields. */ -#define emit_getgl(as, r, field) \ - emit_lsptr(as, ARMI_LDR, (r), (void *)&J2G(as->J)->field) -#define emit_setgl(as, r, field) \ - emit_lsptr(as, ARMI_STR, (r), (void *)&J2G(as->J)->field) - -/* Trace number is determined from pc of exit instruction. */ -#define emit_setvmstate(as, i) UNUSED(i) - -/* -- Emit control-flow instructions -------------------------------------- */ - -/* Label for internal jumps. */ -typedef MCode *MCLabel; - -/* Return label pointing to current PC. */ -#define emit_label(as) ((as)->mcp) - -static void emit_branch(ASMState *as, ARMIns ai, MCode *target) -{ - MCode *p = as->mcp; - ptrdiff_t delta = (target - p) - 1; - lua_assert(((delta + 0x00800000) >> 24) == 0); - *--p = ai | ((uint32_t)delta & 0x00ffffffu); - as->mcp = p; -} - -#define emit_jmp(as, target) emit_branch(as, ARMI_B, (target)) - -static void emit_call(ASMState *as, void *target) -{ - MCode *p = --as->mcp; - ptrdiff_t delta = ((char *)target - (char *)p) - 8; - if ((((delta>>2) + 0x00800000) >> 24) == 0) { - if ((delta & 1)) - *p = ARMI_BLX | ((uint32_t)(delta>>2) & 0x00ffffffu) | ((delta&2) << 23); - else - *p = ARMI_BL | ((uint32_t)(delta>>2) & 0x00ffffffu); - } else { /* Target out of range: need indirect call. But don't use R0-R3. */ - Reg r = ra_allock(as, i32ptr(target), RSET_RANGE(RID_R4, RID_R12+1)); - *p = ARMI_BLXr | ARMF_M(r); - } -} - -/* -- Emit generic operations --------------------------------------------- */ - -/* Generic move between two regs. */ -static void emit_movrr(ASMState *as, IRIns *ir, Reg dst, Reg src) -{ -#if LJ_SOFTFP - lua_assert(!irt_isnum(ir->t)); UNUSED(ir); -#else - if (dst >= RID_MAX_GPR) { - emit_dm(as, irt_isnum(ir->t) ? ARMI_VMOV_D : ARMI_VMOV_S, - (dst & 15), (src & 15)); - return; - } -#endif - if (as->mcp != as->mcloop) { /* Swap early registers for loads/stores. */ - MCode ins = *as->mcp, swp = (src^dst); - if ((ins & 0x0c000000) == 0x04000000 && (ins & 0x02000010) != 0x02000010) { - if (!((ins ^ (dst << 16)) & 0x000f0000)) - *as->mcp = ins ^ (swp << 16); /* Swap N in load/store. */ - if (!(ins & 0x00100000) && !((ins ^ (dst << 12)) & 0x0000f000)) - *as->mcp = ins ^ (swp << 12); /* Swap D in store. */ - } - } - emit_dm(as, ARMI_MOV, dst, src); -} - -/* Generic load of register from stack slot. */ -static void emit_spload(ASMState *as, IRIns *ir, Reg r, int32_t ofs) -{ -#if LJ_SOFTFP - lua_assert(!irt_isnum(ir->t)); UNUSED(ir); -#else - if (r >= RID_MAX_GPR) - emit_vlso(as, irt_isnum(ir->t) ? ARMI_VLDR_D : ARMI_VLDR_S, r, RID_SP, ofs); - else -#endif - emit_lso(as, ARMI_LDR, r, RID_SP, ofs); -} - -/* Generic store of register to stack slot. */ -static void emit_spstore(ASMState *as, IRIns *ir, Reg r, int32_t ofs) -{ -#if LJ_SOFTFP - lua_assert(!irt_isnum(ir->t)); UNUSED(ir); -#else - if (r >= RID_MAX_GPR) - emit_vlso(as, irt_isnum(ir->t) ? ARMI_VSTR_D : ARMI_VSTR_S, r, RID_SP, ofs); - else -#endif - emit_lso(as, ARMI_STR, r, RID_SP, ofs); -} - -/* Emit an arithmetic/logic operation with a constant operand. */ -static void emit_opk(ASMState *as, ARMIns ai, Reg dest, Reg src, - int32_t i, RegSet allow) -{ - uint32_t k = emit_isk12(ai, i); - if (k) - emit_dn(as, ai^k, dest, src); - else - emit_dnm(as, ai, dest, src, ra_allock(as, i, allow)); -} - -/* Add offset to pointer. */ -static void emit_addptr(ASMState *as, Reg r, int32_t ofs) -{ - if (ofs) - emit_opk(as, ARMI_ADD, r, r, ofs, rset_exclude(RSET_GPR, r)); -} - -#define emit_spsub(as, ofs) emit_addptr(as, RID_SP, -(ofs)) - diff --git a/subprojects/luajit/src/lj_emit_mips.h b/subprojects/luajit/src/lj_emit_mips.h deleted file mode 100644 index ed62608a4..000000000 --- a/subprojects/luajit/src/lj_emit_mips.h +++ /dev/null @@ -1,211 +0,0 @@ -/* -** MIPS instruction emitter. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -/* -- Emit basic instructions --------------------------------------------- */ - -static void emit_dst(ASMState *as, MIPSIns mi, Reg rd, Reg rs, Reg rt) -{ - *--as->mcp = mi | MIPSF_D(rd) | MIPSF_S(rs) | MIPSF_T(rt); -} - -static void emit_dta(ASMState *as, MIPSIns mi, Reg rd, Reg rt, uint32_t a) -{ - *--as->mcp = mi | MIPSF_D(rd) | MIPSF_T(rt) | MIPSF_A(a); -} - -#define emit_ds(as, mi, rd, rs) emit_dst(as, (mi), (rd), (rs), 0) -#define emit_tg(as, mi, rt, rg) emit_dst(as, (mi), (rg)&31, 0, (rt)) - -static void emit_tsi(ASMState *as, MIPSIns mi, Reg rt, Reg rs, int32_t i) -{ - *--as->mcp = mi | MIPSF_T(rt) | MIPSF_S(rs) | (i & 0xffff); -} - -#define emit_ti(as, mi, rt, i) emit_tsi(as, (mi), (rt), 0, (i)) -#define emit_hsi(as, mi, rh, rs, i) emit_tsi(as, (mi), (rh) & 31, (rs), (i)) - -static void emit_fgh(ASMState *as, MIPSIns mi, Reg rf, Reg rg, Reg rh) -{ - *--as->mcp = mi | MIPSF_F(rf&31) | MIPSF_G(rg&31) | MIPSF_H(rh&31); -} - -#define emit_fg(as, mi, rf, rg) emit_fgh(as, (mi), (rf), (rg), 0) - -static void emit_rotr(ASMState *as, Reg dest, Reg src, Reg tmp, uint32_t shift) -{ - if ((as->flags & JIT_F_MIPS32R2)) { - emit_dta(as, MIPSI_ROTR, dest, src, shift); - } else { - emit_dst(as, MIPSI_OR, dest, dest, tmp); - emit_dta(as, MIPSI_SLL, dest, src, (-shift)&31); - emit_dta(as, MIPSI_SRL, tmp, src, shift); - } -} - -/* -- Emit loads/stores --------------------------------------------------- */ - -/* Prefer rematerialization of BASE/L from global_State over spills. */ -#define emit_canremat(ref) ((ref) <= REF_BASE) - -/* Try to find a one step delta relative to another constant. */ -static int emit_kdelta1(ASMState *as, Reg t, int32_t i) -{ - RegSet work = ~as->freeset & RSET_GPR; - while (work) { - Reg r = rset_picktop(work); - IRRef ref = regcost_ref(as->cost[r]); - lua_assert(r != t); - if (ref < ASMREF_L) { - int32_t delta = i - (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i); - if (checki16(delta)) { - emit_tsi(as, MIPSI_ADDIU, t, r, delta); - return 1; - } - } - rset_clear(work, r); - } - return 0; /* Failed. */ -} - -/* Load a 32 bit constant into a GPR. */ -static void emit_loadi(ASMState *as, Reg r, int32_t i) -{ - if (checki16(i)) { - emit_ti(as, MIPSI_LI, r, i); - } else { - if ((i & 0xffff)) { - int32_t jgl = i32ptr(J2G(as->J)); - if ((uint32_t)(i-jgl) < 65536) { - emit_tsi(as, MIPSI_ADDIU, r, RID_JGL, i-jgl-32768); - return; - } else if (emit_kdelta1(as, r, i)) { - return; - } else if ((i >> 16) == 0) { - emit_tsi(as, MIPSI_ORI, r, RID_ZERO, i); - return; - } - emit_tsi(as, MIPSI_ORI, r, r, i); - } - emit_ti(as, MIPSI_LUI, r, (i >> 16)); - } -} - -#define emit_loada(as, r, addr) emit_loadi(as, (r), i32ptr((addr))) - -static Reg ra_allock(ASMState *as, int32_t k, RegSet allow); -static void ra_allockreg(ASMState *as, int32_t k, Reg r); - -/* Get/set from constant pointer. */ -static void emit_lsptr(ASMState *as, MIPSIns mi, Reg r, void *p, RegSet allow) -{ - int32_t jgl = i32ptr(J2G(as->J)); - int32_t i = i32ptr(p); - Reg base; - if ((uint32_t)(i-jgl) < 65536) { - i = i-jgl-32768; - base = RID_JGL; - } else { - base = ra_allock(as, i-(int16_t)i, allow); - } - emit_tsi(as, mi, r, base, i); -} - -#define emit_loadn(as, r, tv) \ - emit_lsptr(as, MIPSI_LDC1, ((r) & 31), (void *)(tv), RSET_GPR) - -/* Get/set global_State fields. */ -static void emit_lsglptr(ASMState *as, MIPSIns mi, Reg r, int32_t ofs) -{ - emit_tsi(as, mi, r, RID_JGL, ofs-32768); -} - -#define emit_getgl(as, r, field) \ - emit_lsglptr(as, MIPSI_LW, (r), (int32_t)offsetof(global_State, field)) -#define emit_setgl(as, r, field) \ - emit_lsglptr(as, MIPSI_SW, (r), (int32_t)offsetof(global_State, field)) - -/* Trace number is determined from per-trace exit stubs. */ -#define emit_setvmstate(as, i) UNUSED(i) - -/* -- Emit control-flow instructions -------------------------------------- */ - -/* Label for internal jumps. */ -typedef MCode *MCLabel; - -/* Return label pointing to current PC. */ -#define emit_label(as) ((as)->mcp) - -static void emit_branch(ASMState *as, MIPSIns mi, Reg rs, Reg rt, MCode *target) -{ - MCode *p = as->mcp; - ptrdiff_t delta = target - p; - lua_assert(((delta + 0x8000) >> 16) == 0); - *--p = mi | MIPSF_S(rs) | MIPSF_T(rt) | ((uint32_t)delta & 0xffffu); - as->mcp = p; -} - -static void emit_jmp(ASMState *as, MCode *target) -{ - *--as->mcp = MIPSI_NOP; - emit_branch(as, MIPSI_B, RID_ZERO, RID_ZERO, (target)); -} - -static void emit_call(ASMState *as, void *target) -{ - MCode *p = as->mcp; - *--p = MIPSI_NOP; - if ((((uintptr_t)target ^ (uintptr_t)p) >> 28) == 0) - *--p = MIPSI_JAL | (((uintptr_t)target >>2) & 0x03ffffffu); - else /* Target out of range: need indirect call. */ - *--p = MIPSI_JALR | MIPSF_S(RID_CFUNCADDR); - as->mcp = p; - ra_allockreg(as, i32ptr(target), RID_CFUNCADDR); -} - -/* -- Emit generic operations --------------------------------------------- */ - -#define emit_move(as, dst, src) \ - emit_ds(as, MIPSI_MOVE, (dst), (src)) - -/* Generic move between two regs. */ -static void emit_movrr(ASMState *as, IRIns *ir, Reg dst, Reg src) -{ - if (dst < RID_MAX_GPR) - emit_move(as, dst, src); - else - emit_fg(as, irt_isnum(ir->t) ? MIPSI_MOV_D : MIPSI_MOV_S, dst, src); -} - -/* Generic load of register from stack slot. */ -static void emit_spload(ASMState *as, IRIns *ir, Reg r, int32_t ofs) -{ - if (r < RID_MAX_GPR) - emit_tsi(as, MIPSI_LW, r, RID_SP, ofs); - else - emit_tsi(as, irt_isnum(ir->t) ? MIPSI_LDC1 : MIPSI_LWC1, - (r & 31), RID_SP, ofs); -} - -/* Generic store of register to stack slot. */ -static void emit_spstore(ASMState *as, IRIns *ir, Reg r, int32_t ofs) -{ - if (r < RID_MAX_GPR) - emit_tsi(as, MIPSI_SW, r, RID_SP, ofs); - else - emit_tsi(as, irt_isnum(ir->t) ? MIPSI_SDC1 : MIPSI_SWC1, - (r&31), RID_SP, ofs); -} - -/* Add offset to pointer. */ -static void emit_addptr(ASMState *as, Reg r, int32_t ofs) -{ - if (ofs) { - lua_assert(checki16(ofs)); - emit_tsi(as, MIPSI_ADDIU, r, r, ofs); - } -} - -#define emit_spsub(as, ofs) emit_addptr(as, RID_SP, -(ofs)) - diff --git a/subprojects/luajit/src/lj_emit_ppc.h b/subprojects/luajit/src/lj_emit_ppc.h deleted file mode 100644 index 14099302c..000000000 --- a/subprojects/luajit/src/lj_emit_ppc.h +++ /dev/null @@ -1,238 +0,0 @@ -/* -** PPC instruction emitter. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -/* -- Emit basic instructions --------------------------------------------- */ - -static void emit_tab(ASMState *as, PPCIns pi, Reg rt, Reg ra, Reg rb) -{ - *--as->mcp = pi | PPCF_T(rt) | PPCF_A(ra) | PPCF_B(rb); -} - -#define emit_asb(as, pi, ra, rs, rb) emit_tab(as, (pi), (rs), (ra), (rb)) -#define emit_as(as, pi, ra, rs) emit_tab(as, (pi), (rs), (ra), 0) -#define emit_ab(as, pi, ra, rb) emit_tab(as, (pi), 0, (ra), (rb)) - -static void emit_tai(ASMState *as, PPCIns pi, Reg rt, Reg ra, int32_t i) -{ - *--as->mcp = pi | PPCF_T(rt) | PPCF_A(ra) | (i & 0xffff); -} - -#define emit_ti(as, pi, rt, i) emit_tai(as, (pi), (rt), 0, (i)) -#define emit_ai(as, pi, ra, i) emit_tai(as, (pi), 0, (ra), (i)) -#define emit_asi(as, pi, ra, rs, i) emit_tai(as, (pi), (rs), (ra), (i)) - -#define emit_fab(as, pi, rf, ra, rb) \ - emit_tab(as, (pi), (rf)&31, (ra)&31, (rb)&31) -#define emit_fb(as, pi, rf, rb) emit_tab(as, (pi), (rf)&31, 0, (rb)&31) -#define emit_fac(as, pi, rf, ra, rc) \ - emit_tab(as, (pi) | PPCF_C((rc) & 31), (rf)&31, (ra)&31, 0) -#define emit_facb(as, pi, rf, ra, rc, rb) \ - emit_tab(as, (pi) | PPCF_C((rc) & 31), (rf)&31, (ra)&31, (rb)&31) -#define emit_fai(as, pi, rf, ra, i) emit_tai(as, (pi), (rf)&31, (ra), (i)) - -static void emit_rot(ASMState *as, PPCIns pi, Reg ra, Reg rs, - int32_t n, int32_t b, int32_t e) -{ - *--as->mcp = pi | PPCF_T(rs) | PPCF_A(ra) | PPCF_B(n) | - PPCF_MB(b) | PPCF_ME(e); -} - -static void emit_slwi(ASMState *as, Reg ra, Reg rs, int32_t n) -{ - lua_assert(n >= 0 && n < 32); - emit_rot(as, PPCI_RLWINM, ra, rs, n, 0, 31-n); -} - -static void emit_rotlwi(ASMState *as, Reg ra, Reg rs, int32_t n) -{ - lua_assert(n >= 0 && n < 32); - emit_rot(as, PPCI_RLWINM, ra, rs, n, 0, 31); -} - -/* -- Emit loads/stores --------------------------------------------------- */ - -/* Prefer rematerialization of BASE/L from global_State over spills. */ -#define emit_canremat(ref) ((ref) <= REF_BASE) - -/* Try to find a one step delta relative to another constant. */ -static int emit_kdelta1(ASMState *as, Reg t, int32_t i) -{ - RegSet work = ~as->freeset & RSET_GPR; - while (work) { - Reg r = rset_picktop(work); - IRRef ref = regcost_ref(as->cost[r]); - lua_assert(r != t); - if (ref < ASMREF_L) { - int32_t delta = i - (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i); - if (checki16(delta)) { - emit_tai(as, PPCI_ADDI, t, r, delta); - return 1; - } - } - rset_clear(work, r); - } - return 0; /* Failed. */ -} - -/* Load a 32 bit constant into a GPR. */ -static void emit_loadi(ASMState *as, Reg r, int32_t i) -{ - if (checki16(i)) { - emit_ti(as, PPCI_LI, r, i); - } else { - if ((i & 0xffff)) { - int32_t jgl = i32ptr(J2G(as->J)); - if ((uint32_t)(i-jgl) < 65536) { - emit_tai(as, PPCI_ADDI, r, RID_JGL, i-jgl-32768); - return; - } else if (emit_kdelta1(as, r, i)) { - return; - } - emit_asi(as, PPCI_ORI, r, r, i); - } - emit_ti(as, PPCI_LIS, r, (i >> 16)); - } -} - -#define emit_loada(as, r, addr) emit_loadi(as, (r), i32ptr((addr))) - -static Reg ra_allock(ASMState *as, int32_t k, RegSet allow); - -/* Get/set from constant pointer. */ -static void emit_lsptr(ASMState *as, PPCIns pi, Reg r, void *p, RegSet allow) -{ - int32_t jgl = i32ptr(J2G(as->J)); - int32_t i = i32ptr(p); - Reg base; - if ((uint32_t)(i-jgl) < 65536) { - i = i-jgl-32768; - base = RID_JGL; - } else { - base = ra_allock(as, i-(int16_t)i, allow); - } - emit_tai(as, pi, r, base, i); -} - -#define emit_loadn(as, r, tv) \ - emit_lsptr(as, PPCI_LFD, ((r) & 31), (void *)(tv), RSET_GPR) - -/* Get/set global_State fields. */ -static void emit_lsglptr(ASMState *as, PPCIns pi, Reg r, int32_t ofs) -{ - emit_tai(as, pi, r, RID_JGL, ofs-32768); -} - -#define emit_getgl(as, r, field) \ - emit_lsglptr(as, PPCI_LWZ, (r), (int32_t)offsetof(global_State, field)) -#define emit_setgl(as, r, field) \ - emit_lsglptr(as, PPCI_STW, (r), (int32_t)offsetof(global_State, field)) - -/* Trace number is determined from per-trace exit stubs. */ -#define emit_setvmstate(as, i) UNUSED(i) - -/* -- Emit control-flow instructions -------------------------------------- */ - -/* Label for internal jumps. */ -typedef MCode *MCLabel; - -/* Return label pointing to current PC. */ -#define emit_label(as) ((as)->mcp) - -static void emit_condbranch(ASMState *as, PPCIns pi, PPCCC cc, MCode *target) -{ - MCode *p = --as->mcp; - ptrdiff_t delta = (char *)target - (char *)p; - lua_assert(((delta + 0x8000) >> 16) == 0); - pi ^= (delta & 0x8000) * (PPCF_Y/0x8000); - *p = pi | PPCF_CC(cc) | ((uint32_t)delta & 0xffffu); -} - -static void emit_jmp(ASMState *as, MCode *target) -{ - MCode *p = --as->mcp; - ptrdiff_t delta = (char *)target - (char *)p; - *p = PPCI_B | (delta & 0x03fffffcu); -} - -static void emit_call(ASMState *as, void *target) -{ - MCode *p = --as->mcp; - ptrdiff_t delta = (char *)target - (char *)p; - if ((((delta>>2) + 0x00800000) >> 24) == 0) { - *p = PPCI_BL | (delta & 0x03fffffcu); - } else { /* Target out of range: need indirect call. Don't use arg reg. */ - RegSet allow = RSET_GPR & ~RSET_RANGE(RID_R0, REGARG_LASTGPR+1); - Reg r = ra_allock(as, i32ptr(target), allow); - *p = PPCI_BCTRL; - p[-1] = PPCI_MTCTR | PPCF_T(r); - as->mcp = p-1; - } -} - -/* -- Emit generic operations --------------------------------------------- */ - -#define emit_mr(as, dst, src) \ - emit_asb(as, PPCI_MR, (dst), (src), (src)) - -/* Generic move between two regs. */ -static void emit_movrr(ASMState *as, IRIns *ir, Reg dst, Reg src) -{ - UNUSED(ir); - if (dst < RID_MAX_GPR) - emit_mr(as, dst, src); - else - emit_fb(as, PPCI_FMR, dst, src); -} - -/* Generic load of register from stack slot. */ -static void emit_spload(ASMState *as, IRIns *ir, Reg r, int32_t ofs) -{ - if (r < RID_MAX_GPR) - emit_tai(as, PPCI_LWZ, r, RID_SP, ofs); - else - emit_fai(as, irt_isnum(ir->t) ? PPCI_LFD : PPCI_LFS, r, RID_SP, ofs); -} - -/* Generic store of register to stack slot. */ -static void emit_spstore(ASMState *as, IRIns *ir, Reg r, int32_t ofs) -{ - if (r < RID_MAX_GPR) - emit_tai(as, PPCI_STW, r, RID_SP, ofs); - else - emit_fai(as, irt_isnum(ir->t) ? PPCI_STFD : PPCI_STFS, r, RID_SP, ofs); -} - -/* Emit a compare (for equality) with a constant operand. */ -static void emit_cmpi(ASMState *as, Reg r, int32_t k) -{ - if (checki16(k)) { - emit_ai(as, PPCI_CMPWI, r, k); - } else if (checku16(k)) { - emit_ai(as, PPCI_CMPLWI, r, k); - } else { - emit_ai(as, PPCI_CMPLWI, RID_TMP, k); - emit_asi(as, PPCI_XORIS, RID_TMP, r, (k >> 16)); - } -} - -/* Add offset to pointer. */ -static void emit_addptr(ASMState *as, Reg r, int32_t ofs) -{ - if (ofs) { - emit_tai(as, PPCI_ADDI, r, r, ofs); - if (!checki16(ofs)) - emit_tai(as, PPCI_ADDIS, r, r, (ofs + 32768) >> 16); - } -} - -static void emit_spsub(ASMState *as, int32_t ofs) -{ - if (ofs) { - emit_tai(as, PPCI_STWU, RID_TMP, RID_SP, -ofs); - emit_tai(as, PPCI_ADDI, RID_TMP, RID_SP, - CFRAME_SIZE + (as->parent ? as->parent->spadjust : 0)); - } -} - diff --git a/subprojects/luajit/src/lj_emit_x86.h b/subprojects/luajit/src/lj_emit_x86.h deleted file mode 100644 index bcceb93e7..000000000 --- a/subprojects/luajit/src/lj_emit_x86.h +++ /dev/null @@ -1,466 +0,0 @@ -/* -** x86/x64 instruction emitter. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -/* -- Emit basic instructions --------------------------------------------- */ - -#define MODRM(mode, r1, r2) ((MCode)((mode)+(((r1)&7)<<3)+((r2)&7))) - -#if LJ_64 -#define REXRB(p, rr, rb) \ - { MCode rex = 0x40 + (((rr)>>1)&4) + (((rb)>>3)&1); \ - if (rex != 0x40) *--(p) = rex; } -#define FORCE_REX 0x200 -#define REX_64 (FORCE_REX|0x080000) -#else -#define REXRB(p, rr, rb) ((void)0) -#define FORCE_REX 0 -#define REX_64 0 -#endif - -#define emit_i8(as, i) (*--as->mcp = (MCode)(i)) -#define emit_i32(as, i) (*(int32_t *)(as->mcp-4) = (i), as->mcp -= 4) -#define emit_u32(as, u) (*(uint32_t *)(as->mcp-4) = (u), as->mcp -= 4) - -#define emit_x87op(as, xo) \ - (*(uint16_t *)(as->mcp-2) = (uint16_t)(xo), as->mcp -= 2) - -/* op */ -static LJ_AINLINE MCode *emit_op(x86Op xo, Reg rr, Reg rb, Reg rx, - MCode *p, int delta) -{ - int n = (int8_t)xo; -#if defined(__GNUC__) - if (__builtin_constant_p(xo) && n == -2) - p[delta-2] = (MCode)(xo >> 24); - else if (__builtin_constant_p(xo) && n == -3) - *(uint16_t *)(p+delta-3) = (uint16_t)(xo >> 16); - else -#endif - *(uint32_t *)(p+delta-5) = (uint32_t)xo; - p += n + delta; -#if LJ_64 - { - uint32_t rex = 0x40 + ((rr>>1)&(4+(FORCE_REX>>1)))+((rx>>2)&2)+((rb>>3)&1); - if (rex != 0x40) { - rex |= (rr >> 16); - if (n == -4) { *p = (MCode)rex; rex = (MCode)(xo >> 8); } - else if ((xo & 0xffffff) == 0x6600fd) { *p = (MCode)rex; rex = 0x66; } - *--p = (MCode)rex; - } - } -#else - UNUSED(rr); UNUSED(rb); UNUSED(rx); -#endif - return p; -} - -/* op + modrm */ -#define emit_opm(xo, mode, rr, rb, p, delta) \ - (p[(delta)-1] = MODRM((mode), (rr), (rb)), \ - emit_op((xo), (rr), (rb), 0, (p), (delta))) - -/* op + modrm + sib */ -#define emit_opmx(xo, mode, scale, rr, rb, rx, p) \ - (p[-1] = MODRM((scale), (rx), (rb)), \ - p[-2] = MODRM((mode), (rr), RID_ESP), \ - emit_op((xo), (rr), (rb), (rx), (p), -1)) - -/* op r1, r2 */ -static void emit_rr(ASMState *as, x86Op xo, Reg r1, Reg r2) -{ - MCode *p = as->mcp; - as->mcp = emit_opm(xo, XM_REG, r1, r2, p, 0); -} - -#if LJ_64 && defined(LUA_USE_ASSERT) -/* [addr] is sign-extended in x64 and must be in lower 2G (not 4G). */ -static int32_t ptr2addr(const void *p) -{ - lua_assert((uintptr_t)p < (uintptr_t)0x80000000); - return i32ptr(p); -} -#else -#define ptr2addr(p) (i32ptr((p))) -#endif - -/* op r, [addr] */ -static void emit_rma(ASMState *as, x86Op xo, Reg rr, const void *addr) -{ - MCode *p = as->mcp; - *(int32_t *)(p-4) = ptr2addr(addr); -#if LJ_64 - p[-5] = MODRM(XM_SCALE1, RID_ESP, RID_EBP); - as->mcp = emit_opm(xo, XM_OFS0, rr, RID_ESP, p, -5); -#else - as->mcp = emit_opm(xo, XM_OFS0, rr, RID_EBP, p, -4); -#endif -} - -/* op r, [base+ofs] */ -static void emit_rmro(ASMState *as, x86Op xo, Reg rr, Reg rb, int32_t ofs) -{ - MCode *p = as->mcp; - x86Mode mode; - if (ra_hasreg(rb)) { - if (ofs == 0 && (rb&7) != RID_EBP) { - mode = XM_OFS0; - } else if (checki8(ofs)) { - *--p = (MCode)ofs; - mode = XM_OFS8; - } else { - p -= 4; - *(int32_t *)p = ofs; - mode = XM_OFS32; - } - if ((rb&7) == RID_ESP) - *--p = MODRM(XM_SCALE1, RID_ESP, RID_ESP); - } else { - *(int32_t *)(p-4) = ofs; -#if LJ_64 - p[-5] = MODRM(XM_SCALE1, RID_ESP, RID_EBP); - p -= 5; - rb = RID_ESP; -#else - p -= 4; - rb = RID_EBP; -#endif - mode = XM_OFS0; - } - as->mcp = emit_opm(xo, mode, rr, rb, p, 0); -} - -/* op r, [base+idx*scale+ofs] */ -static void emit_rmrxo(ASMState *as, x86Op xo, Reg rr, Reg rb, Reg rx, - x86Mode scale, int32_t ofs) -{ - MCode *p = as->mcp; - x86Mode mode; - if (ofs == 0 && (rb&7) != RID_EBP) { - mode = XM_OFS0; - } else if (checki8(ofs)) { - mode = XM_OFS8; - *--p = (MCode)ofs; - } else { - mode = XM_OFS32; - p -= 4; - *(int32_t *)p = ofs; - } - as->mcp = emit_opmx(xo, mode, scale, rr, rb, rx, p); -} - -/* op r, i */ -static void emit_gri(ASMState *as, x86Group xg, Reg rb, int32_t i) -{ - MCode *p = as->mcp; - x86Op xo; - if (checki8(i)) { - *--p = (MCode)i; - xo = XG_TOXOi8(xg); - } else { - p -= 4; - *(int32_t *)p = i; - xo = XG_TOXOi(xg); - } - as->mcp = emit_opm(xo, XM_REG, (Reg)(xg & 7) | (rb & REX_64), rb, p, 0); -} - -/* op [base+ofs], i */ -static void emit_gmroi(ASMState *as, x86Group xg, Reg rb, int32_t ofs, - int32_t i) -{ - x86Op xo; - if (checki8(i)) { - emit_i8(as, i); - xo = XG_TOXOi8(xg); - } else { - emit_i32(as, i); - xo = XG_TOXOi(xg); - } - emit_rmro(as, xo, (Reg)(xg & 7), rb, ofs); -} - -#define emit_shifti(as, xg, r, i) \ - (emit_i8(as, (i)), emit_rr(as, XO_SHIFTi, (Reg)(xg), (r))) - -/* op r, rm/mrm */ -static void emit_mrm(ASMState *as, x86Op xo, Reg rr, Reg rb) -{ - MCode *p = as->mcp; - x86Mode mode = XM_REG; - if (rb == RID_MRM) { - rb = as->mrm.base; - if (rb == RID_NONE) { - rb = RID_EBP; - mode = XM_OFS0; - p -= 4; - *(int32_t *)p = as->mrm.ofs; - if (as->mrm.idx != RID_NONE) - goto mrmidx; -#if LJ_64 - *--p = MODRM(XM_SCALE1, RID_ESP, RID_EBP); - rb = RID_ESP; -#endif - } else { - if (as->mrm.ofs == 0 && (rb&7) != RID_EBP) { - mode = XM_OFS0; - } else if (checki8(as->mrm.ofs)) { - *--p = (MCode)as->mrm.ofs; - mode = XM_OFS8; - } else { - p -= 4; - *(int32_t *)p = as->mrm.ofs; - mode = XM_OFS32; - } - if (as->mrm.idx != RID_NONE) { - mrmidx: - as->mcp = emit_opmx(xo, mode, as->mrm.scale, rr, rb, as->mrm.idx, p); - return; - } - if ((rb&7) == RID_ESP) - *--p = MODRM(XM_SCALE1, RID_ESP, RID_ESP); - } - } - as->mcp = emit_opm(xo, mode, rr, rb, p, 0); -} - -/* op rm/mrm, i */ -static void emit_gmrmi(ASMState *as, x86Group xg, Reg rb, int32_t i) -{ - x86Op xo; - if (checki8(i)) { - emit_i8(as, i); - xo = XG_TOXOi8(xg); - } else { - emit_i32(as, i); - xo = XG_TOXOi(xg); - } - emit_mrm(as, xo, (Reg)(xg & 7) | (rb & REX_64), (rb & ~REX_64)); -} - -/* -- Emit loads/stores --------------------------------------------------- */ - -/* Instruction selection for XMM moves. */ -#define XMM_MOVRR(as) ((as->flags & JIT_F_SPLIT_XMM) ? XO_MOVSD : XO_MOVAPS) -#define XMM_MOVRM(as) ((as->flags & JIT_F_SPLIT_XMM) ? XO_MOVLPD : XO_MOVSD) - -/* mov [base+ofs], i */ -static void emit_movmroi(ASMState *as, Reg base, int32_t ofs, int32_t i) -{ - emit_i32(as, i); - emit_rmro(as, XO_MOVmi, 0, base, ofs); -} - -/* mov [base+ofs], r */ -#define emit_movtomro(as, r, base, ofs) \ - emit_rmro(as, XO_MOVto, (r), (base), (ofs)) - -/* Get/set global_State fields. */ -#define emit_opgl(as, xo, r, field) \ - emit_rma(as, (xo), (r), (void *)&J2G(as->J)->field) -#define emit_getgl(as, r, field) emit_opgl(as, XO_MOV, (r), field) -#define emit_setgl(as, r, field) emit_opgl(as, XO_MOVto, (r), field) - -#define emit_setvmstate(as, i) \ - (emit_i32(as, i), emit_opgl(as, XO_MOVmi, 0, vmstate)) - -/* mov r, i / xor r, r */ -static void emit_loadi(ASMState *as, Reg r, int32_t i) -{ - /* XOR r,r is shorter, but modifies the flags. This is bad for HIOP. */ - if (i == 0 && !(LJ_32 && (IR(as->curins)->o == IR_HIOP || - (as->curins+1 < as->T->nins && - IR(as->curins+1)->o == IR_HIOP)))) { - emit_rr(as, XO_ARITH(XOg_XOR), r, r); - } else { - MCode *p = as->mcp; - *(int32_t *)(p-4) = i; - p[-5] = (MCode)(XI_MOVri+(r&7)); - p -= 5; - REXRB(p, 0, r); - as->mcp = p; - } -} - -/* mov r, addr */ -#define emit_loada(as, r, addr) \ - emit_loadi(as, (r), ptr2addr((addr))) - -#if LJ_64 -/* mov r, imm64 or shorter 32 bit extended load. */ -static void emit_loadu64(ASMState *as, Reg r, uint64_t u64) -{ - if (checku32(u64)) { /* 32 bit load clears upper 32 bits. */ - emit_loadi(as, r, (int32_t)u64); - } else if (checki32((int64_t)u64)) { /* Sign-extended 32 bit load. */ - MCode *p = as->mcp; - *(int32_t *)(p-4) = (int32_t)u64; - as->mcp = emit_opm(XO_MOVmi, XM_REG, REX_64, r, p, -4); - } else { /* Full-size 64 bit load. */ - MCode *p = as->mcp; - *(uint64_t *)(p-8) = u64; - p[-9] = (MCode)(XI_MOVri+(r&7)); - p[-10] = 0x48 + ((r>>3)&1); - p -= 10; - as->mcp = p; - } -} -#endif - -/* movsd r, [&tv->n] / xorps r, r */ -static void emit_loadn(ASMState *as, Reg r, cTValue *tv) -{ - if (tvispzero(tv)) /* Use xor only for +0. */ - emit_rr(as, XO_XORPS, r, r); - else - emit_rma(as, XMM_MOVRM(as), r, &tv->n); -} - -/* -- Emit control-flow instructions -------------------------------------- */ - -/* Label for short jumps. */ -typedef MCode *MCLabel; - -#if LJ_32 && LJ_HASFFI -/* jmp short target */ -static void emit_sjmp(ASMState *as, MCLabel target) -{ - MCode *p = as->mcp; - ptrdiff_t delta = target - p; - lua_assert(delta == (int8_t)delta); - p[-1] = (MCode)(int8_t)delta; - p[-2] = XI_JMPs; - as->mcp = p - 2; -} -#endif - -/* jcc short target */ -static void emit_sjcc(ASMState *as, int cc, MCLabel target) -{ - MCode *p = as->mcp; - ptrdiff_t delta = target - p; - lua_assert(delta == (int8_t)delta); - p[-1] = (MCode)(int8_t)delta; - p[-2] = (MCode)(XI_JCCs+(cc&15)); - as->mcp = p - 2; -} - -/* jcc short (pending target) */ -static MCLabel emit_sjcc_label(ASMState *as, int cc) -{ - MCode *p = as->mcp; - p[-1] = 0; - p[-2] = (MCode)(XI_JCCs+(cc&15)); - as->mcp = p - 2; - return p; -} - -/* Fixup jcc short target. */ -static void emit_sfixup(ASMState *as, MCLabel source) -{ - source[-1] = (MCode)(as->mcp-source); -} - -/* Return label pointing to current PC. */ -#define emit_label(as) ((as)->mcp) - -/* Compute relative 32 bit offset for jump and call instructions. */ -static LJ_AINLINE int32_t jmprel(MCode *p, MCode *target) -{ - ptrdiff_t delta = target - p; - lua_assert(delta == (int32_t)delta); - return (int32_t)delta; -} - -/* jcc target */ -static void emit_jcc(ASMState *as, int cc, MCode *target) -{ - MCode *p = as->mcp; - *(int32_t *)(p-4) = jmprel(p, target); - p[-5] = (MCode)(XI_JCCn+(cc&15)); - p[-6] = 0x0f; - as->mcp = p - 6; -} - -/* jmp target */ -static void emit_jmp(ASMState *as, MCode *target) -{ - MCode *p = as->mcp; - *(int32_t *)(p-4) = jmprel(p, target); - p[-5] = XI_JMP; - as->mcp = p - 5; -} - -/* call target */ -static void emit_call_(ASMState *as, MCode *target) -{ - MCode *p = as->mcp; -#if LJ_64 - if (target-p != (int32_t)(target-p)) { - /* Assumes RID_RET is never an argument to calls and always clobbered. */ - emit_rr(as, XO_GROUP5, XOg_CALL, RID_RET); - emit_loadu64(as, RID_RET, (uint64_t)target); - return; - } -#endif - *(int32_t *)(p-4) = jmprel(p, target); - p[-5] = XI_CALL; - as->mcp = p - 5; -} - -#define emit_call(as, f) emit_call_(as, (MCode *)(void *)(f)) - -/* -- Emit generic operations --------------------------------------------- */ - -/* Use 64 bit operations to handle 64 bit IR types. */ -#if LJ_64 -#define REX_64IR(ir, r) ((r) + (irt_is64((ir)->t) ? REX_64 : 0)) -#else -#define REX_64IR(ir, r) (r) -#endif - -/* Generic move between two regs. */ -static void emit_movrr(ASMState *as, IRIns *ir, Reg dst, Reg src) -{ - UNUSED(ir); - if (dst < RID_MAX_GPR) - emit_rr(as, XO_MOV, REX_64IR(ir, dst), src); - else - emit_rr(as, XMM_MOVRR(as), dst, src); -} - -/* Generic load of register from stack slot. */ -static void emit_spload(ASMState *as, IRIns *ir, Reg r, int32_t ofs) -{ - if (r < RID_MAX_GPR) - emit_rmro(as, XO_MOV, REX_64IR(ir, r), RID_ESP, ofs); - else - emit_rmro(as, irt_isnum(ir->t) ? XMM_MOVRM(as) : XO_MOVSS, r, RID_ESP, ofs); -} - -/* Generic store of register to stack slot. */ -static void emit_spstore(ASMState *as, IRIns *ir, Reg r, int32_t ofs) -{ - if (r < RID_MAX_GPR) - emit_rmro(as, XO_MOVto, REX_64IR(ir, r), RID_ESP, ofs); - else - emit_rmro(as, irt_isnum(ir->t) ? XO_MOVSDto : XO_MOVSSto, r, RID_ESP, ofs); -} - -/* Add offset to pointer. */ -static void emit_addptr(ASMState *as, Reg r, int32_t ofs) -{ - if (ofs) { - if ((as->flags & JIT_F_LEA_AGU)) - emit_rmro(as, XO_LEA, r, r, ofs); - else - emit_gri(as, XG_ARITHi(XOg_ADD), r, ofs); - } -} - -#define emit_spsub(as, ofs) emit_addptr(as, RID_ESP|REX_64, -(ofs)) - -/* Prefer rematerialization of BASE/L from global_State over spills. */ -#define emit_canremat(ref) ((ref) <= REF_BASE) - diff --git a/subprojects/luajit/src/lj_err.c b/subprojects/luajit/src/lj_err.c deleted file mode 100644 index 54f42c374..000000000 --- a/subprojects/luajit/src/lj_err.c +++ /dev/null @@ -1,802 +0,0 @@ -/* -** Error handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_err_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_err.h" -#include "lj_debug.h" -#include "lj_str.h" -#include "lj_func.h" -#include "lj_state.h" -#include "lj_frame.h" -#include "lj_ff.h" -#include "lj_trace.h" -#include "lj_vm.h" - -/* -** LuaJIT can either use internal or external frame unwinding: -** -** - Internal frame unwinding (INT) is free-standing and doesn't require -** any OS or library support. -** -** - External frame unwinding (EXT) uses the system-provided unwind handler. -** -** Pros and Cons: -** -** - EXT requires unwind tables for *all* functions on the C stack between -** the pcall/catch and the error/throw. This is the default on x64, -** but needs to be manually enabled on x86/PPC for non-C++ code. -** -** - INT is faster when actually throwing errors (but this happens rarely). -** Setting up error handlers is zero-cost in any case. -** -** - EXT provides full interoperability with C++ exceptions. You can throw -** Lua errors or C++ exceptions through a mix of Lua frames and C++ frames. -** C++ destructors are called as needed. C++ exceptions caught by pcall -** are converted to the string "C++ exception". Lua errors can be caught -** with catch (...) in C++. -** -** - INT has only limited support for automatically catching C++ exceptions -** on POSIX systems using DWARF2 stack unwinding. Other systems may use -** the wrapper function feature. Lua errors thrown through C++ frames -** cannot be caught by C++ code and C++ destructors are not run. -** -** EXT is the default on x64 systems, INT is the default on all other systems. -** -** EXT can be manually enabled on POSIX systems using GCC and DWARF2 stack -** unwinding with -DLUAJIT_UNWIND_EXTERNAL. *All* C code must be compiled -** with -funwind-tables (or -fexceptions). This includes LuaJIT itself (set -** TARGET_CFLAGS), all of your C/Lua binding code, all loadable C modules -** and all C libraries that have callbacks which may be used to call back -** into Lua. C++ code must *not* be compiled with -fno-exceptions. -** -** EXT cannot be enabled on WIN32 since system exceptions use code-driven SEH. -** EXT is mandatory on WIN64 since the calling convention has an abundance -** of callee-saved registers (rbx, rbp, rsi, rdi, r12-r15, xmm6-xmm15). -** The POSIX/x64 interpreter only saves r12/r13 for INT (e.g. PS4). -*/ - -#if defined(__GNUC__) && (LJ_TARGET_X64 || defined(LUAJIT_UNWIND_EXTERNAL)) && !LJ_NO_UNWIND -#define LJ_UNWIND_EXT 1 -#elif LJ_TARGET_X64 && LJ_TARGET_WINDOWS -#define LJ_UNWIND_EXT 1 -#endif - -/* -- Error messages ------------------------------------------------------ */ - -/* Error message strings. */ -LJ_DATADEF const char *lj_err_allmsg = -#define ERRDEF(name, msg) msg "\0" -#include "lj_errmsg.h" -; - -/* -- Internal frame unwinding -------------------------------------------- */ - -/* Unwind Lua stack and move error message to new top. */ -LJ_NOINLINE static void unwindstack(lua_State *L, TValue *top) -{ - lj_func_closeuv(L, top); - if (top < L->top-1) { - copyTV(L, top, L->top-1); - L->top = top+1; - } - lj_state_relimitstack(L); -} - -/* Unwind until stop frame. Optionally cleanup frames. */ -static void *err_unwind(lua_State *L, void *stopcf, int errcode) -{ - TValue *frame = L->base-1; - void *cf = L->cframe; - while (cf) { - int32_t nres = cframe_nres(cframe_raw(cf)); - if (nres < 0) { /* C frame without Lua frame? */ - TValue *top = restorestack(L, -nres); - if (frame < top) { /* Frame reached? */ - if (errcode) { - L->cframe = cframe_prev(cf); - L->base = frame+1; - unwindstack(L, top); - } - return cf; - } - } - if (frame <= tvref(L->stack)) - break; - switch (frame_typep(frame)) { - case FRAME_LUA: /* Lua frame. */ - case FRAME_LUAP: - frame = frame_prevl(frame); - break; - case FRAME_C: /* C frame. */ -#if LJ_HASFFI - unwind_c: -#endif -#if LJ_UNWIND_EXT - if (errcode) { - L->cframe = cframe_prev(cf); - L->base = frame_prevd(frame) + 1; - unwindstack(L, frame); - } else if (cf != stopcf) { - cf = cframe_prev(cf); - frame = frame_prevd(frame); - break; - } - return NULL; /* Continue unwinding. */ -#else - UNUSED(stopcf); - cf = cframe_prev(cf); - frame = frame_prevd(frame); - break; -#endif - case FRAME_CP: /* Protected C frame. */ - if (cframe_canyield(cf)) { /* Resume? */ - if (errcode) { - hook_leave(G(L)); /* Assumes nobody uses coroutines inside hooks. */ - L->cframe = NULL; - L->status = (uint8_t)errcode; - } - return cf; - } - if (errcode) { - L->cframe = cframe_prev(cf); - L->base = frame_prevd(frame) + 1; - unwindstack(L, frame); - } - return cf; - case FRAME_CONT: /* Continuation frame. */ -#if LJ_HASFFI - if ((frame-1)->u32.lo == LJ_CONT_FFI_CALLBACK) - goto unwind_c; -#endif - case FRAME_VARG: /* Vararg frame. */ - frame = frame_prevd(frame); - break; - case FRAME_PCALL: /* FF pcall() frame. */ - case FRAME_PCALLH: /* FF pcall() frame inside hook. */ - if (errcode) { - if (errcode == LUA_YIELD) { - frame = frame_prevd(frame); - break; - } - if (frame_typep(frame) == FRAME_PCALL) - hook_leave(G(L)); - L->cframe = cf; - L->base = frame_prevd(frame) + 1; - unwindstack(L, L->base); - } - return (void *)((intptr_t)cf | CFRAME_UNWIND_FF); - } - } - /* No C frame. */ - if (errcode) { - L->cframe = NULL; - L->base = tvref(L->stack)+1; - unwindstack(L, L->base); - if (G(L)->panic) - G(L)->panic(L); - exit(EXIT_FAILURE); - } - return L; /* Anything non-NULL will do. */ -} - -/* -- External frame unwinding -------------------------------------------- */ - -#if defined(__GNUC__) && !LJ_NO_UNWIND && !LJ_ABI_WIN - -/* -** We have to use our own definitions instead of the mandatory (!) unwind.h, -** since various OS, distros and compilers mess up the header installation. -*/ - -typedef struct _Unwind_Exception -{ - uint64_t exclass; - void (*excleanup)(int, struct _Unwind_Exception *); - uintptr_t p1, p2; -} __attribute__((__aligned__)) _Unwind_Exception; - -typedef struct _Unwind_Context _Unwind_Context; - -#define _URC_OK 0 -#define _URC_FATAL_PHASE1_ERROR 3 -#define _URC_HANDLER_FOUND 6 -#define _URC_INSTALL_CONTEXT 7 -#define _URC_CONTINUE_UNWIND 8 -#define _URC_FAILURE 9 - -#if !LJ_TARGET_ARM - -extern uintptr_t _Unwind_GetCFA(_Unwind_Context *); -extern void _Unwind_SetGR(_Unwind_Context *, int, uintptr_t); -extern void _Unwind_SetIP(_Unwind_Context *, uintptr_t); -extern void _Unwind_DeleteException(_Unwind_Exception *); -extern int _Unwind_RaiseException(_Unwind_Exception *); - -#define _UA_SEARCH_PHASE 1 -#define _UA_CLEANUP_PHASE 2 -#define _UA_HANDLER_FRAME 4 -#define _UA_FORCE_UNWIND 8 - -#define LJ_UEXCLASS 0x4c55414a49543200ULL /* LUAJIT2\0 */ -#define LJ_UEXCLASS_MAKE(c) (LJ_UEXCLASS | (uint64_t)(c)) -#define LJ_UEXCLASS_CHECK(cl) (((cl) ^ LJ_UEXCLASS) <= 0xff) -#define LJ_UEXCLASS_ERRCODE(cl) ((int)((cl) & 0xff)) - -/* DWARF2 personality handler referenced from interpreter .eh_frame. */ -LJ_FUNCA int lj_err_unwind_dwarf(int version, int actions, - uint64_t uexclass, _Unwind_Exception *uex, _Unwind_Context *ctx) -{ - void *cf; - lua_State *L; - if (version != 1) - return _URC_FATAL_PHASE1_ERROR; - UNUSED(uexclass); - cf = (void *)_Unwind_GetCFA(ctx); - L = cframe_L(cf); - if ((actions & _UA_SEARCH_PHASE)) { -#if LJ_UNWIND_EXT - if (err_unwind(L, cf, 0) == NULL) - return _URC_CONTINUE_UNWIND; -#endif - if (!LJ_UEXCLASS_CHECK(uexclass)) { - setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP)); - } - return _URC_HANDLER_FOUND; - } - if ((actions & _UA_CLEANUP_PHASE)) { - int errcode; - if (LJ_UEXCLASS_CHECK(uexclass)) { - errcode = LJ_UEXCLASS_ERRCODE(uexclass); - } else { - if ((actions & _UA_HANDLER_FRAME)) - _Unwind_DeleteException(uex); - errcode = LUA_ERRRUN; - } -#if LJ_UNWIND_EXT - cf = err_unwind(L, cf, errcode); - if ((actions & _UA_FORCE_UNWIND)) { - return _URC_CONTINUE_UNWIND; - } else if (cf) { - _Unwind_SetGR(ctx, LJ_TARGET_EHRETREG, errcode); - _Unwind_SetIP(ctx, (uintptr_t)(cframe_unwind_ff(cf) ? - lj_vm_unwind_ff_eh : - lj_vm_unwind_c_eh)); - return _URC_INSTALL_CONTEXT; - } -#if LJ_TARGET_X86ORX64 - else if ((actions & _UA_HANDLER_FRAME)) { - /* Workaround for ancient libgcc bug. Still present in RHEL 5.5. :-/ - ** Real fix: http://gcc.gnu.org/viewcvs/trunk/gcc/unwind-dw2.c?r1=121165&r2=124837&pathrev=153877&diff_format=h - */ - _Unwind_SetGR(ctx, LJ_TARGET_EHRETREG, errcode); - _Unwind_SetIP(ctx, (uintptr_t)lj_vm_unwind_rethrow); - return _URC_INSTALL_CONTEXT; - } -#endif -#else - /* This is not the proper way to escape from the unwinder. We get away with - ** it on non-x64 because the interpreter restores all callee-saved regs. - */ - lj_err_throw(L, errcode); -#endif - } - return _URC_CONTINUE_UNWIND; -} - -#if LJ_UNWIND_EXT -#if LJ_TARGET_OSX || defined(__OpenBSD__) -/* Sorry, no thread safety for OSX. Complain to Apple, not me. */ -static _Unwind_Exception static_uex; -#else -static __thread _Unwind_Exception static_uex; -#endif - -/* Raise DWARF2 exception. */ -static void err_raise_ext(int errcode) -{ - static_uex.exclass = LJ_UEXCLASS_MAKE(errcode); - static_uex.excleanup = NULL; - _Unwind_RaiseException(&static_uex); -} -#endif - -#else - -extern void _Unwind_DeleteException(void *); -extern int __gnu_unwind_frame (void *, _Unwind_Context *); -extern int _Unwind_VRS_Set(_Unwind_Context *, int, uint32_t, int, void *); -extern int _Unwind_VRS_Get(_Unwind_Context *, int, uint32_t, int, void *); - -static inline uint32_t _Unwind_GetGR(_Unwind_Context *ctx, int r) -{ - uint32_t v; - _Unwind_VRS_Get(ctx, 0, r, 0, &v); - return v; -} - -static inline void _Unwind_SetGR(_Unwind_Context *ctx, int r, uint32_t v) -{ - _Unwind_VRS_Set(ctx, 0, r, 0, &v); -} - -#define _US_VIRTUAL_UNWIND_FRAME 0 -#define _US_UNWIND_FRAME_STARTING 1 -#define _US_ACTION_MASK 3 -#define _US_FORCE_UNWIND 8 - -/* ARM unwinder personality handler referenced from interpreter .ARM.extab. */ -LJ_FUNCA int lj_err_unwind_arm(int state, void *ucb, _Unwind_Context *ctx) -{ - void *cf = (void *)_Unwind_GetGR(ctx, 13); - lua_State *L = cframe_L(cf); - if ((state & _US_ACTION_MASK) == _US_VIRTUAL_UNWIND_FRAME) { - setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP)); - return _URC_HANDLER_FOUND; - } - if ((state&(_US_ACTION_MASK|_US_FORCE_UNWIND)) == _US_UNWIND_FRAME_STARTING) { - _Unwind_DeleteException(ucb); - _Unwind_SetGR(ctx, 15, (uint32_t)(void *)lj_err_throw); - _Unwind_SetGR(ctx, 0, (uint32_t)L); - _Unwind_SetGR(ctx, 1, (uint32_t)LUA_ERRRUN); - return _URC_INSTALL_CONTEXT; - } - if (__gnu_unwind_frame(ucb, ctx) != _URC_OK) - return _URC_FAILURE; - return _URC_CONTINUE_UNWIND; -} - -#endif - -#elif LJ_TARGET_X64 && LJ_ABI_WIN - -/* -** Someone in Redmond owes me several days of my life. A lot of this is -** undocumented or just plain wrong on MSDN. Some of it can be gathered -** from 3rd party docs or must be found by trial-and-error. They really -** don't want you to write your own language-specific exception handler -** or to interact gracefully with MSVC. :-( -** -** Apparently MSVC doesn't call C++ destructors for foreign exceptions -** unless you compile your C++ code with /EHa. Unfortunately this means -** catch (...) also catches things like access violations. The use of -** _set_se_translator doesn't really help, because it requires /EHa, too. -*/ - -#define WIN32_LEAN_AND_MEAN -#include - -/* Taken from: http://www.nynaeve.net/?p=99 */ -typedef struct UndocumentedDispatcherContext { - ULONG64 ControlPc; - ULONG64 ImageBase; - PRUNTIME_FUNCTION FunctionEntry; - ULONG64 EstablisherFrame; - ULONG64 TargetIp; - PCONTEXT ContextRecord; - void (*LanguageHandler)(void); - PVOID HandlerData; - PUNWIND_HISTORY_TABLE HistoryTable; - ULONG ScopeIndex; - ULONG Fill0; -} UndocumentedDispatcherContext; - -/* Another wild guess. */ -extern void __DestructExceptionObject(EXCEPTION_RECORD *rec, int nothrow); - -#ifdef MINGW_SDK_INIT -/* Workaround for broken MinGW64 declaration. */ -VOID RtlUnwindEx_FIXED(PVOID,PVOID,PVOID,PVOID,PVOID,PVOID) asm("RtlUnwindEx"); -#define RtlUnwindEx RtlUnwindEx_FIXED -#endif - -#define LJ_MSVC_EXCODE ((DWORD)0xe06d7363) -#define LJ_GCC_EXCODE ((DWORD)0x20474343) - -#define LJ_EXCODE ((DWORD)0xe24c4a00) -#define LJ_EXCODE_MAKE(c) (LJ_EXCODE | (DWORD)(c)) -#define LJ_EXCODE_CHECK(cl) (((cl) ^ LJ_EXCODE) <= 0xff) -#define LJ_EXCODE_ERRCODE(cl) ((int)((cl) & 0xff)) - -/* Win64 exception handler for interpreter frame. */ -LJ_FUNCA EXCEPTION_DISPOSITION lj_err_unwind_win64(EXCEPTION_RECORD *rec, - void *cf, CONTEXT *ctx, UndocumentedDispatcherContext *dispatch) -{ - lua_State *L = cframe_L(cf); - int errcode = LJ_EXCODE_CHECK(rec->ExceptionCode) ? - LJ_EXCODE_ERRCODE(rec->ExceptionCode) : LUA_ERRRUN; - if ((rec->ExceptionFlags & 6)) { /* EH_UNWINDING|EH_EXIT_UNWIND */ - /* Unwind internal frames. */ - err_unwind(L, cf, errcode); - } else { - void *cf2 = err_unwind(L, cf, 0); - if (cf2) { /* We catch it, so start unwinding the upper frames. */ - if (rec->ExceptionCode == LJ_MSVC_EXCODE || - rec->ExceptionCode == LJ_GCC_EXCODE) { -#if LJ_TARGET_WINDOWS - __DestructExceptionObject(rec, 1); -#endif - setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP)); - } else if (!LJ_EXCODE_CHECK(rec->ExceptionCode)) { - /* Don't catch access violations etc. */ - return ExceptionContinueSearch; - } - /* Unwind the stack and call all handlers for all lower C frames - ** (including ourselves) again with EH_UNWINDING set. Then set - ** rsp = cf, rax = errcode and jump to the specified target. - */ - RtlUnwindEx(cf, (void *)((cframe_unwind_ff(cf2) && errcode != LUA_YIELD) ? - lj_vm_unwind_ff_eh : - lj_vm_unwind_c_eh), - rec, (void *)(uintptr_t)errcode, ctx, dispatch->HistoryTable); - /* RtlUnwindEx should never return. */ - } - } - return ExceptionContinueSearch; -} - -/* Raise Windows exception. */ -static void err_raise_ext(int errcode) -{ - RaiseException(LJ_EXCODE_MAKE(errcode), 1 /* EH_NONCONTINUABLE */, 0, NULL); -} - -#endif - -/* -- Error handling ------------------------------------------------------ */ - -/* Throw error. Find catch frame, unwind stack and continue. */ -LJ_NOINLINE void LJ_FASTCALL lj_err_throw(lua_State *L, int errcode) -{ - global_State *g = G(L); - lj_trace_abort(g); - setgcrefnull(g->jit_L); - L->status = 0; -#if LJ_UNWIND_EXT - err_raise_ext(errcode); - /* - ** A return from this function signals a corrupt C stack that cannot be - ** unwound. We have no choice but to call the panic function and exit. - ** - ** Usually this is caused by a C function without unwind information. - ** This should never happen on x64, but may happen if you've manually - ** enabled LUAJIT_UNWIND_EXTERNAL and forgot to recompile *every* - ** non-C++ file with -funwind-tables. - */ - if (G(L)->panic) - G(L)->panic(L); -#else - { - void *cf = err_unwind(L, NULL, errcode); - if (cframe_unwind_ff(cf)) - lj_vm_unwind_ff(cframe_raw(cf)); - else - lj_vm_unwind_c(cframe_raw(cf), errcode); - } -#endif - exit(EXIT_FAILURE); -} - -/* Return string object for error message. */ -LJ_NOINLINE GCstr *lj_err_str(lua_State *L, ErrMsg em) -{ - return lj_str_newz(L, err2msg(em)); -} - -/* Out-of-memory error. */ -LJ_NOINLINE void lj_err_mem(lua_State *L) -{ - if (L->status == LUA_ERRERR+1) /* Don't touch the stack during lua_open. */ - lj_vm_unwind_c(L->cframe, LUA_ERRMEM); - setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRMEM)); - lj_err_throw(L, LUA_ERRMEM); -} - -/* Find error function for runtime errors. Requires an extra stack traversal. */ -static ptrdiff_t finderrfunc(lua_State *L) -{ - cTValue *frame = L->base-1, *bot = tvref(L->stack); - void *cf = L->cframe; - while (frame > bot && cf) { - while (cframe_nres(cframe_raw(cf)) < 0) { /* cframe without frame? */ - if (frame >= restorestack(L, -cframe_nres(cf))) - break; - if (cframe_errfunc(cf) >= 0) /* Error handler not inherited (-1)? */ - return cframe_errfunc(cf); - cf = cframe_prev(cf); /* Else unwind cframe and continue searching. */ - if (cf == NULL) - return 0; - } - switch (frame_typep(frame)) { - case FRAME_LUA: - case FRAME_LUAP: - frame = frame_prevl(frame); - break; - case FRAME_C: - cf = cframe_prev(cf); - /* fallthrough */ - case FRAME_VARG: - frame = frame_prevd(frame); - break; - case FRAME_CONT: -#if LJ_HASFFI - if ((frame-1)->u32.lo == LJ_CONT_FFI_CALLBACK) - cf = cframe_prev(cf); -#endif - frame = frame_prevd(frame); - break; - case FRAME_CP: - if (cframe_canyield(cf)) return 0; - if (cframe_errfunc(cf) >= 0) - return cframe_errfunc(cf); - frame = frame_prevd(frame); - break; - case FRAME_PCALL: - case FRAME_PCALLH: - if (frame_ftsz(frame) >= (ptrdiff_t)(2*sizeof(TValue))) /* xpcall? */ - return savestack(L, frame-1); /* Point to xpcall's errorfunc. */ - return 0; - default: - lua_assert(0); - return 0; - } - } - return 0; -} - -/* Runtime error. */ -LJ_NOINLINE void lj_err_run(lua_State *L) -{ - ptrdiff_t ef = finderrfunc(L); - if (ef) { - TValue *errfunc = restorestack(L, ef); - TValue *top = L->top; - lj_trace_abort(G(L)); - if (!tvisfunc(errfunc) || L->status == LUA_ERRERR) { - setstrV(L, top-1, lj_err_str(L, LJ_ERR_ERRERR)); - lj_err_throw(L, LUA_ERRERR); - } - L->status = LUA_ERRERR; - copyTV(L, top, top-1); - copyTV(L, top-1, errfunc); - L->top = top+1; - lj_vm_call(L, top, 1+1); /* Stack: |errfunc|msg| -> |msg| */ - } - lj_err_throw(L, LUA_ERRRUN); -} - -/* Formatted runtime error message. */ -LJ_NORET LJ_NOINLINE static void err_msgv(lua_State *L, ErrMsg em, ...) -{ - const char *msg; - va_list argp; - va_start(argp, em); - if (curr_funcisL(L)) L->top = curr_topL(L); - msg = lj_str_pushvf(L, err2msg(em), argp); - va_end(argp); - lj_debug_addloc(L, msg, L->base-1, NULL); - lj_err_run(L); -} - -/* Non-vararg variant for better calling conventions. */ -LJ_NOINLINE void lj_err_msg(lua_State *L, ErrMsg em) -{ - err_msgv(L, em); -} - -/* Lexer error. */ -LJ_NOINLINE void lj_err_lex(lua_State *L, GCstr *src, const char *tok, - BCLine line, ErrMsg em, va_list argp) -{ - char buff[LUA_IDSIZE]; - const char *msg; - lj_debug_shortname(buff, src); - msg = lj_str_pushvf(L, err2msg(em), argp); - msg = lj_str_pushf(L, "%s:%d: %s", buff, line, msg); - if (tok) - lj_str_pushf(L, err2msg(LJ_ERR_XNEAR), msg, tok); - lj_err_throw(L, LUA_ERRSYNTAX); -} - -/* Typecheck error for operands. */ -LJ_NOINLINE void lj_err_optype(lua_State *L, cTValue *o, ErrMsg opm) -{ - const char *tname = lj_typename(o); - const char *opname = err2msg(opm); - if (curr_funcisL(L)) { - GCproto *pt = curr_proto(L); - const BCIns *pc = cframe_Lpc(L) - 1; - const char *oname = NULL; - const char *kind = lj_debug_slotname(pt, pc, (BCReg)(o-L->base), &oname); - if (kind) - err_msgv(L, LJ_ERR_BADOPRT, opname, kind, oname, tname); - } - err_msgv(L, LJ_ERR_BADOPRV, opname, tname); -} - -/* Typecheck error for ordered comparisons. */ -LJ_NOINLINE void lj_err_comp(lua_State *L, cTValue *o1, cTValue *o2) -{ - const char *t1 = lj_typename(o1); - const char *t2 = lj_typename(o2); - err_msgv(L, t1 == t2 ? LJ_ERR_BADCMPV : LJ_ERR_BADCMPT, t1, t2); - /* This assumes the two "boolean" entries are commoned by the C compiler. */ -} - -/* Typecheck error for __call. */ -LJ_NOINLINE void lj_err_optype_call(lua_State *L, TValue *o) -{ - /* Gross hack if lua_[p]call or pcall/xpcall fail for a non-callable object: - ** L->base still points to the caller. So add a dummy frame with L instead - ** of a function. See lua_getstack(). - */ - const BCIns *pc = cframe_Lpc(L); - if (((ptrdiff_t)pc & FRAME_TYPE) != FRAME_LUA) { - const char *tname = lj_typename(o); - setframe_pc(o, pc); - setframe_gc(o, obj2gco(L)); - L->top = L->base = o+1; - err_msgv(L, LJ_ERR_BADCALL, tname); - } - lj_err_optype(L, o, LJ_ERR_OPCALL); -} - -/* Error in context of caller. */ -LJ_NOINLINE void lj_err_callermsg(lua_State *L, const char *msg) -{ - TValue *frame = L->base-1; - TValue *pframe = NULL; - if (frame_islua(frame)) { - pframe = frame_prevl(frame); - } else if (frame_iscont(frame)) { -#if LJ_HASFFI - if ((frame-1)->u32.lo == LJ_CONT_FFI_CALLBACK) { - pframe = frame; - frame = NULL; - } else -#endif - { - pframe = frame_prevd(frame); -#if LJ_HASFFI - /* Remove frame for FFI metamethods. */ - if (frame_func(frame)->c.ffid >= FF_ffi_meta___index && - frame_func(frame)->c.ffid <= FF_ffi_meta___tostring) { - L->base = pframe+1; - L->top = frame; - setcframe_pc(cframe_raw(L->cframe), frame_contpc(frame)); - } -#endif - } - } - lj_debug_addloc(L, msg, pframe, frame); - lj_err_run(L); -} - -/* Formatted error in context of caller. */ -LJ_NOINLINE void lj_err_callerv(lua_State *L, ErrMsg em, ...) -{ - const char *msg; - va_list argp; - va_start(argp, em); - msg = lj_str_pushvf(L, err2msg(em), argp); - va_end(argp); - lj_err_callermsg(L, msg); -} - -/* Error in context of caller. */ -LJ_NOINLINE void lj_err_caller(lua_State *L, ErrMsg em) -{ - lj_err_callermsg(L, err2msg(em)); -} - -/* Argument error message. */ -LJ_NORET LJ_NOINLINE static void err_argmsg(lua_State *L, int narg, - const char *msg) -{ - const char *fname = "?"; - const char *ftype = lj_debug_funcname(L, L->base - 1, &fname); - if (narg < 0 && narg > LUA_REGISTRYINDEX) - narg = (int)(L->top - L->base) + narg + 1; - if (ftype && ftype[3] == 'h' && --narg == 0) /* Check for "method". */ - msg = lj_str_pushf(L, err2msg(LJ_ERR_BADSELF), fname, msg); - else - msg = lj_str_pushf(L, err2msg(LJ_ERR_BADARG), narg, fname, msg); - lj_err_callermsg(L, msg); -} - -/* Formatted argument error. */ -LJ_NOINLINE void lj_err_argv(lua_State *L, int narg, ErrMsg em, ...) -{ - const char *msg; - va_list argp; - va_start(argp, em); - msg = lj_str_pushvf(L, err2msg(em), argp); - va_end(argp); - err_argmsg(L, narg, msg); -} - -/* Argument error. */ -LJ_NOINLINE void lj_err_arg(lua_State *L, int narg, ErrMsg em) -{ - err_argmsg(L, narg, err2msg(em)); -} - -/* Typecheck error for arguments. */ -LJ_NOINLINE void lj_err_argtype(lua_State *L, int narg, const char *xname) -{ - const char *tname, *msg; - if (narg <= LUA_REGISTRYINDEX) { - if (narg >= LUA_GLOBALSINDEX) { - tname = lj_obj_itypename[~LJ_TTAB]; - } else { - GCfunc *fn = curr_func(L); - int idx = LUA_GLOBALSINDEX - narg; - if (idx <= fn->c.nupvalues) - tname = lj_typename(&fn->c.upvalue[idx-1]); - else - tname = lj_obj_typename[0]; - } - } else { - TValue *o = narg < 0 ? L->top + narg : L->base + narg-1; - tname = o < L->top ? lj_typename(o) : lj_obj_typename[0]; - } - msg = lj_str_pushf(L, err2msg(LJ_ERR_BADTYPE), xname, tname); - err_argmsg(L, narg, msg); -} - -/* Typecheck error for arguments. */ -LJ_NOINLINE void lj_err_argt(lua_State *L, int narg, int tt) -{ - lj_err_argtype(L, narg, lj_obj_typename[tt+1]); -} - -/* -- Public error handling API ------------------------------------------- */ - -LUA_API lua_CFunction lua_atpanic(lua_State *L, lua_CFunction panicf) -{ - lua_CFunction old = G(L)->panic; - G(L)->panic = panicf; - return old; -} - -/* Forwarders for the public API (C calling convention and no LJ_NORET). */ -LUA_API int lua_error(lua_State *L) -{ - lj_err_run(L); - return 0; /* unreachable */ -} - -LUALIB_API int luaL_argerror(lua_State *L, int narg, const char *msg) -{ - err_argmsg(L, narg, msg); - return 0; /* unreachable */ -} - -LUALIB_API int luaL_typerror(lua_State *L, int narg, const char *xname) -{ - lj_err_argtype(L, narg, xname); - return 0; /* unreachable */ -} - -LUALIB_API void luaL_where(lua_State *L, int level) -{ - int size; - cTValue *frame = lj_debug_frame(L, level, &size); - lj_debug_addloc(L, "", frame, size ? frame+size : NULL); -} - -LUALIB_API int luaL_error(lua_State *L, const char *fmt, ...) -{ - const char *msg; - va_list argp; - va_start(argp, fmt); - msg = lj_str_pushvf(L, fmt, argp); - va_end(argp); - lj_err_callermsg(L, msg); - return 0; /* unreachable */ -} - diff --git a/subprojects/luajit/src/lj_err.h b/subprojects/luajit/src/lj_err.h deleted file mode 100644 index cba5fb714..000000000 --- a/subprojects/luajit/src/lj_err.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -** Error handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_ERR_H -#define _LJ_ERR_H - -#include - -#include "lj_obj.h" - -typedef enum { -#define ERRDEF(name, msg) \ - LJ_ERR_##name, LJ_ERR_##name##_ = LJ_ERR_##name + sizeof(msg)-1, -#include "lj_errmsg.h" - LJ_ERR__MAX -} ErrMsg; - -LJ_DATA const char *lj_err_allmsg; -#define err2msg(em) (lj_err_allmsg+(int)(em)) - -LJ_FUNC GCstr *lj_err_str(lua_State *L, ErrMsg em); -LJ_FUNCA_NORET void LJ_FASTCALL lj_err_throw(lua_State *L, int errcode); -LJ_FUNC_NORET void lj_err_mem(lua_State *L); -LJ_FUNC_NORET void lj_err_run(lua_State *L); -LJ_FUNC_NORET void lj_err_msg(lua_State *L, ErrMsg em); -LJ_FUNC_NORET void lj_err_lex(lua_State *L, GCstr *src, const char *tok, - BCLine line, ErrMsg em, va_list argp); -LJ_FUNC_NORET void lj_err_optype(lua_State *L, cTValue *o, ErrMsg opm); -LJ_FUNC_NORET void lj_err_comp(lua_State *L, cTValue *o1, cTValue *o2); -LJ_FUNC_NORET void lj_err_optype_call(lua_State *L, TValue *o); -LJ_FUNC_NORET void lj_err_callermsg(lua_State *L, const char *msg); -LJ_FUNC_NORET void lj_err_callerv(lua_State *L, ErrMsg em, ...); -LJ_FUNC_NORET void lj_err_caller(lua_State *L, ErrMsg em); -LJ_FUNC_NORET void lj_err_arg(lua_State *L, int narg, ErrMsg em); -LJ_FUNC_NORET void lj_err_argv(lua_State *L, int narg, ErrMsg em, ...); -LJ_FUNC_NORET void lj_err_argtype(lua_State *L, int narg, const char *xname); -LJ_FUNC_NORET void lj_err_argt(lua_State *L, int narg, int tt); - -#endif diff --git a/subprojects/luajit/src/lj_errmsg.h b/subprojects/luajit/src/lj_errmsg.h deleted file mode 100644 index ac552f40c..000000000 --- a/subprojects/luajit/src/lj_errmsg.h +++ /dev/null @@ -1,193 +0,0 @@ -/* -** VM error messages. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -/* This file may be included multiple times with different ERRDEF macros. */ - -/* Basic error handling. */ -ERRDEF(ERRMEM, "not enough memory") -ERRDEF(ERRERR, "error in error handling") -ERRDEF(ERRCPP, "C++ exception") - -/* Allocations. */ -ERRDEF(STROV, "string length overflow") -ERRDEF(UDATAOV, "userdata length overflow") -ERRDEF(STKOV, "stack overflow") -ERRDEF(STKOVM, "stack overflow (%s)") -ERRDEF(TABOV, "table overflow") - -/* Table indexing. */ -ERRDEF(NANIDX, "table index is NaN") -ERRDEF(NILIDX, "table index is nil") -ERRDEF(NEXTIDX, "invalid key to " LUA_QL("next")) - -/* Metamethod resolving. */ -ERRDEF(BADCALL, "attempt to call a %s value") -ERRDEF(BADOPRT, "attempt to %s %s " LUA_QS " (a %s value)") -ERRDEF(BADOPRV, "attempt to %s a %s value") -ERRDEF(BADCMPT, "attempt to compare %s with %s") -ERRDEF(BADCMPV, "attempt to compare two %s values") -ERRDEF(GETLOOP, "loop in gettable") -ERRDEF(SETLOOP, "loop in settable") -ERRDEF(OPCALL, "call") -ERRDEF(OPINDEX, "index") -ERRDEF(OPARITH, "perform arithmetic on") -ERRDEF(OPCAT, "concatenate") -ERRDEF(OPLEN, "get length of") - -/* Type checks. */ -ERRDEF(BADSELF, "calling " LUA_QS " on bad self (%s)") -ERRDEF(BADARG, "bad argument #%d to " LUA_QS " (%s)") -ERRDEF(BADTYPE, "%s expected, got %s") -ERRDEF(BADVAL, "invalid value") -ERRDEF(NOVAL, "value expected") -ERRDEF(NOCORO, "coroutine expected") -ERRDEF(NOTABN, "nil or table expected") -ERRDEF(NOLFUNC, "Lua function expected") -ERRDEF(NOFUNCL, "function or level expected") -ERRDEF(NOSFT, "string/function/table expected") -ERRDEF(NOPROXY, "boolean or proxy expected") -ERRDEF(FORINIT, LUA_QL("for") " initial value must be a number") -ERRDEF(FORLIM, LUA_QL("for") " limit must be a number") -ERRDEF(FORSTEP, LUA_QL("for") " step must be a number") - -/* C API checks. */ -ERRDEF(NOENV, "no calling environment") -ERRDEF(CYIELD, "attempt to yield across C-call boundary") -ERRDEF(BADLU, "bad light userdata pointer") -ERRDEF(NOGCMM, "bad action while in __gc metamethod") -#if LJ_TARGET_WINDOWS -ERRDEF(BADFPU, "bad FPU precision (use D3DCREATE_FPU_PRESERVE with DirectX)") -#endif - -/* Standard library function errors. */ -ERRDEF(ASSERT, "assertion failed!") -ERRDEF(PROTMT, "cannot change a protected metatable") -ERRDEF(UNPACK, "too many results to unpack") -ERRDEF(RDRSTR, "reader function must return a string") -ERRDEF(PRTOSTR, LUA_QL("tostring") " must return a string to " LUA_QL("print")) -ERRDEF(IDXRNG, "index out of range") -ERRDEF(BASERNG, "base out of range") -ERRDEF(LVLRNG, "level out of range") -ERRDEF(INVLVL, "invalid level") -ERRDEF(INVOPT, "invalid option") -ERRDEF(INVOPTM, "invalid option " LUA_QS) -ERRDEF(INVFMT, "invalid format") -ERRDEF(SETFENV, LUA_QL("setfenv") " cannot change environment of given object") -ERRDEF(CORUN, "cannot resume running coroutine") -ERRDEF(CODEAD, "cannot resume dead coroutine") -ERRDEF(COSUSP, "cannot resume non-suspended coroutine") -ERRDEF(TABINS, "wrong number of arguments to " LUA_QL("insert")) -ERRDEF(TABCAT, "invalid value (%s) at index %d in table for " LUA_QL("concat")) -ERRDEF(TABSORT, "invalid order function for sorting") -ERRDEF(IOCLFL, "attempt to use a closed file") -ERRDEF(IOSTDCL, "standard file is closed") -ERRDEF(OSUNIQF, "unable to generate a unique filename") -ERRDEF(OSDATEF, "field " LUA_QS " missing in date table") -ERRDEF(STRDUMP, "unable to dump given function") -ERRDEF(STRSLC, "string slice too long") -ERRDEF(STRPATB, "missing " LUA_QL("[") " after " LUA_QL("%f") " in pattern") -ERRDEF(STRPATC, "invalid pattern capture") -ERRDEF(STRPATE, "malformed pattern (ends with " LUA_QL("%") ")") -ERRDEF(STRPATM, "malformed pattern (missing " LUA_QL("]") ")") -ERRDEF(STRPATU, "unbalanced pattern") -ERRDEF(STRPATX, "pattern too complex") -ERRDEF(STRCAPI, "invalid capture index") -ERRDEF(STRCAPN, "too many captures") -ERRDEF(STRCAPU, "unfinished capture") -ERRDEF(STRFMTO, "invalid option " LUA_QL("%%%c") " to " LUA_QL("format")) -ERRDEF(STRFMTR, "invalid format (repeated flags)") -ERRDEF(STRFMTW, "invalid format (width or precision too long)") -ERRDEF(STRGSRV, "invalid replacement value (a %s)") -ERRDEF(BADMODN, "name conflict for module " LUA_QS) -#if LJ_HASJIT -ERRDEF(JITPROT, "runtime code generation failed, restricted kernel?") -#if LJ_TARGET_X86ORX64 -ERRDEF(NOJIT, "JIT compiler disabled, CPU does not support SSE2") -#else -ERRDEF(NOJIT, "JIT compiler disabled") -#endif -#elif defined(LJ_ARCH_NOJIT) -ERRDEF(NOJIT, "no JIT compiler for this architecture (yet)") -#else -ERRDEF(NOJIT, "JIT compiler permanently disabled by build option") -#endif -ERRDEF(JITOPT, "unknown or malformed optimization flag " LUA_QS) - -/* Lexer/parser errors. */ -ERRDEF(XMODE, "attempt to load chunk with wrong mode") -ERRDEF(XNEAR, "%s near " LUA_QS) -ERRDEF(XELEM, "lexical element too long") -ERRDEF(XLINES, "chunk has too many lines") -ERRDEF(XLEVELS, "chunk has too many syntax levels") -ERRDEF(XNUMBER, "malformed number") -ERRDEF(XLSTR, "unfinished long string") -ERRDEF(XLCOM, "unfinished long comment") -ERRDEF(XSTR, "unfinished string") -ERRDEF(XESC, "invalid escape sequence") -ERRDEF(XLDELIM, "invalid long string delimiter") -ERRDEF(XTOKEN, LUA_QS " expected") -ERRDEF(XJUMP, "control structure too long") -ERRDEF(XSLOTS, "function or expression too complex") -ERRDEF(XLIMC, "chunk has more than %d local variables") -ERRDEF(XLIMM, "main function has more than %d %s") -ERRDEF(XLIMF, "function at line %d has more than %d %s") -ERRDEF(XMATCH, LUA_QS " expected (to close " LUA_QS " at line %d)") -ERRDEF(XFIXUP, "function too long for return fixup") -ERRDEF(XPARAM, " or " LUA_QL("...") " expected") -#if !LJ_52 -ERRDEF(XAMBIG, "ambiguous syntax (function call x new statement)") -#endif -ERRDEF(XFUNARG, "function arguments expected") -ERRDEF(XSYMBOL, "unexpected symbol") -ERRDEF(XDOTS, "cannot use " LUA_QL("...") " outside a vararg function") -ERRDEF(XSYNTAX, "syntax error") -ERRDEF(XFOR, LUA_QL("=") " or " LUA_QL("in") " expected") -ERRDEF(XBREAK, "no loop to break") -ERRDEF(XLUNDEF, "undefined label " LUA_QS) -ERRDEF(XLDUP, "duplicate label " LUA_QS) -ERRDEF(XGSCOPE, " jumps into the scope of local " LUA_QS) - -/* Bytecode reader errors. */ -ERRDEF(BCFMT, "cannot load incompatible bytecode") -ERRDEF(BCBAD, "cannot load malformed bytecode") - -#if LJ_HASFFI -/* FFI errors. */ -ERRDEF(FFI_INVTYPE, "invalid C type") -ERRDEF(FFI_INVSIZE, "size of C type is unknown or too large") -ERRDEF(FFI_BADSCL, "bad storage class") -ERRDEF(FFI_DECLSPEC, "declaration specifier expected") -ERRDEF(FFI_BADTAG, "undeclared or implicit tag " LUA_QS) -ERRDEF(FFI_REDEF, "attempt to redefine " LUA_QS) -ERRDEF(FFI_NUMPARAM, "wrong number of type parameters") -ERRDEF(FFI_INITOV, "too many initializers for " LUA_QS) -ERRDEF(FFI_BADCONV, "cannot convert " LUA_QS " to " LUA_QS) -ERRDEF(FFI_BADLEN, "attempt to get length of " LUA_QS) -ERRDEF(FFI_BADCONCAT, "attempt to concatenate " LUA_QS " and " LUA_QS) -ERRDEF(FFI_BADARITH, "attempt to perform arithmetic on " LUA_QS " and " LUA_QS) -ERRDEF(FFI_BADCOMP, "attempt to compare " LUA_QS " with " LUA_QS) -ERRDEF(FFI_BADCALL, LUA_QS " is not callable") -ERRDEF(FFI_NUMARG, "wrong number of arguments for function call") -ERRDEF(FFI_BADMEMBER, LUA_QS " has no member named " LUA_QS) -ERRDEF(FFI_BADIDX, LUA_QS " cannot be indexed") -ERRDEF(FFI_BADIDXW, LUA_QS " cannot be indexed with " LUA_QS) -ERRDEF(FFI_BADMM, LUA_QS " has no " LUA_QS " metamethod") -ERRDEF(FFI_WRCONST, "attempt to write to constant location") -ERRDEF(FFI_NODECL, "missing declaration for symbol " LUA_QS) -ERRDEF(FFI_BADCBACK, "bad callback") -#if LJ_OS_NOJIT -ERRDEF(FFI_CBACKOV, "no support for callbacks on this OS") -#else -ERRDEF(FFI_CBACKOV, "too many callbacks") -#endif -ERRDEF(FFI_NYIPACKBIT, "NYI: packed bit fields") -ERRDEF(FFI_NYICALL, "NYI: cannot call this C function (yet)") -#endif - -#undef ERRDEF - -/* Detecting unused error messages: - awk -F, '/^ERRDEF/ { gsub(/ERRDEF./, ""); printf "grep -q LJ_ERR_%s *.[ch] || echo %s\n", $1, $1}' lj_errmsg.h | sh -*/ diff --git a/subprojects/luajit/src/lj_ff.h b/subprojects/luajit/src/lj_ff.h deleted file mode 100644 index 31d65a00d..000000000 --- a/subprojects/luajit/src/lj_ff.h +++ /dev/null @@ -1,18 +0,0 @@ -/* -** Fast function IDs. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_FF_H -#define _LJ_FF_H - -/* Fast function ID. */ -typedef enum { - FF_LUA_ = FF_LUA, /* Lua function (must be 0). */ - FF_C_ = FF_C, /* Regular C function (must be 1). */ -#define FFDEF(name) FF_##name, -#include "lj_ffdef.h" - FF__MAX -} FastFunc; - -#endif diff --git a/subprojects/luajit/src/lj_ffrecord.c b/subprojects/luajit/src/lj_ffrecord.c deleted file mode 100644 index da09dca5f..000000000 --- a/subprojects/luajit/src/lj_ffrecord.c +++ /dev/null @@ -1,887 +0,0 @@ -/* -** Fast function call recorder. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_ffrecord_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_frame.h" -#include "lj_bc.h" -#include "lj_ff.h" -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_ircall.h" -#include "lj_iropt.h" -#include "lj_trace.h" -#include "lj_record.h" -#include "lj_ffrecord.h" -#include "lj_crecord.h" -#include "lj_dispatch.h" -#include "lj_vm.h" -#include "lj_strscan.h" - -/* Some local macros to save typing. Undef'd at the end. */ -#define IR(ref) (&J->cur.ir[(ref)]) - -/* Pass IR on to next optimization in chain (FOLD). */ -#define emitir(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J)) - -/* -- Fast function recording handlers ------------------------------------ */ - -/* Conventions for fast function call handlers: -** -** The argument slots start at J->base[0]. All of them are guaranteed to be -** valid and type-specialized references. J->base[J->maxslot] is set to 0 -** as a sentinel. The runtime argument values start at rd->argv[0]. -** -** In general fast functions should check for presence of all of their -** arguments and for the correct argument types. Some simplifications -** are allowed if the interpreter throws instead. But even if recording -** is aborted, the generated IR must be consistent (no zero-refs). -** -** The number of results in rd->nres is set to 1. Handlers that return -** a different number of results need to override it. A negative value -** prevents return processing (e.g. for pending calls). -** -** Results need to be stored starting at J->base[0]. Return processing -** moves them to the right slots later. -** -** The per-ffid auxiliary data is the value of the 2nd part of the -** LJLIB_REC() annotation. This allows handling similar functionality -** in a common handler. -*/ - -/* Type of handler to record a fast function. */ -typedef void (LJ_FASTCALL *RecordFunc)(jit_State *J, RecordFFData *rd); - -/* Get runtime value of int argument. */ -static int32_t argv2int(jit_State *J, TValue *o) -{ - if (!lj_strscan_numberobj(o)) - lj_trace_err(J, LJ_TRERR_BADTYPE); - return tvisint(o) ? intV(o) : lj_num2int(numV(o)); -} - -/* Get runtime value of string argument. */ -static GCstr *argv2str(jit_State *J, TValue *o) -{ - if (LJ_LIKELY(tvisstr(o))) { - return strV(o); - } else { - GCstr *s; - if (!tvisnumber(o)) - lj_trace_err(J, LJ_TRERR_BADTYPE); - if (tvisint(o)) - s = lj_str_fromint(J->L, intV(o)); - else - s = lj_str_fromnum(J->L, &o->n); - setstrV(J->L, o, s); - return s; - } -} - -/* Return number of results wanted by caller. */ -static ptrdiff_t results_wanted(jit_State *J) -{ - TValue *frame = J->L->base-1; - if (frame_islua(frame)) - return (ptrdiff_t)bc_b(frame_pc(frame)[-1]) - 1; - else - return -1; -} - -/* Throw error for unsupported variant of fast function. */ -LJ_NORET static void recff_nyiu(jit_State *J) -{ - setfuncV(J->L, &J->errinfo, J->fn); - lj_trace_err_info(J, LJ_TRERR_NYIFFU); -} - -/* Fallback handler for all fast functions that are not recorded (yet). */ -static void LJ_FASTCALL recff_nyi(jit_State *J, RecordFFData *rd) -{ - setfuncV(J->L, &J->errinfo, J->fn); - lj_trace_err_info(J, LJ_TRERR_NYIFF); - UNUSED(rd); -} - -/* C functions can have arbitrary side-effects and are not recorded (yet). */ -static void LJ_FASTCALL recff_c(jit_State *J, RecordFFData *rd) -{ - setfuncV(J->L, &J->errinfo, J->fn); - lj_trace_err_info(J, LJ_TRERR_NYICF); - UNUSED(rd); -} - -/* -- Base library fast functions ----------------------------------------- */ - -static void LJ_FASTCALL recff_assert(jit_State *J, RecordFFData *rd) -{ - /* Arguments already specialized. The interpreter throws for nil/false. */ - rd->nres = J->maxslot; /* Pass through all arguments. */ -} - -static void LJ_FASTCALL recff_type(jit_State *J, RecordFFData *rd) -{ - /* Arguments already specialized. Result is a constant string. Neat, huh? */ - uint32_t t; - if (tvisnumber(&rd->argv[0])) - t = ~LJ_TNUMX; - else if (LJ_64 && tvislightud(&rd->argv[0])) - t = ~LJ_TLIGHTUD; - else - t = ~itype(&rd->argv[0]); - J->base[0] = lj_ir_kstr(J, strV(&J->fn->c.upvalue[t])); - UNUSED(rd); -} - -static void LJ_FASTCALL recff_getmetatable(jit_State *J, RecordFFData *rd) -{ - TRef tr = J->base[0]; - if (tr) { - RecordIndex ix; - ix.tab = tr; - copyTV(J->L, &ix.tabv, &rd->argv[0]); - if (lj_record_mm_lookup(J, &ix, MM_metatable)) - J->base[0] = ix.mobj; - else - J->base[0] = ix.mt; - } /* else: Interpreter will throw. */ -} - -static void LJ_FASTCALL recff_setmetatable(jit_State *J, RecordFFData *rd) -{ - TRef tr = J->base[0]; - TRef mt = J->base[1]; - if (tref_istab(tr) && (tref_istab(mt) || (mt && tref_isnil(mt)))) { - TRef fref, mtref; - RecordIndex ix; - ix.tab = tr; - copyTV(J->L, &ix.tabv, &rd->argv[0]); - lj_record_mm_lookup(J, &ix, MM_metatable); /* Guard for no __metatable. */ - fref = emitir(IRT(IR_FREF, IRT_P32), tr, IRFL_TAB_META); - mtref = tref_isnil(mt) ? lj_ir_knull(J, IRT_TAB) : mt; - emitir(IRT(IR_FSTORE, IRT_TAB), fref, mtref); - if (!tref_isnil(mt)) - emitir(IRT(IR_TBAR, IRT_TAB), tr, 0); - J->base[0] = tr; - J->needsnap = 1; - } /* else: Interpreter will throw. */ -} - -static void LJ_FASTCALL recff_rawget(jit_State *J, RecordFFData *rd) -{ - RecordIndex ix; - ix.tab = J->base[0]; ix.key = J->base[1]; - if (tref_istab(ix.tab) && ix.key) { - ix.val = 0; ix.idxchain = 0; - settabV(J->L, &ix.tabv, tabV(&rd->argv[0])); - copyTV(J->L, &ix.keyv, &rd->argv[1]); - J->base[0] = lj_record_idx(J, &ix); - } /* else: Interpreter will throw. */ -} - -static void LJ_FASTCALL recff_rawset(jit_State *J, RecordFFData *rd) -{ - RecordIndex ix; - ix.tab = J->base[0]; ix.key = J->base[1]; ix.val = J->base[2]; - if (tref_istab(ix.tab) && ix.key && ix.val) { - ix.idxchain = 0; - settabV(J->L, &ix.tabv, tabV(&rd->argv[0])); - copyTV(J->L, &ix.keyv, &rd->argv[1]); - copyTV(J->L, &ix.valv, &rd->argv[2]); - lj_record_idx(J, &ix); - /* Pass through table at J->base[0] as result. */ - } /* else: Interpreter will throw. */ -} - -static void LJ_FASTCALL recff_rawequal(jit_State *J, RecordFFData *rd) -{ - TRef tra = J->base[0]; - TRef trb = J->base[1]; - if (tra && trb) { - int diff = lj_record_objcmp(J, tra, trb, &rd->argv[0], &rd->argv[1]); - J->base[0] = diff ? TREF_FALSE : TREF_TRUE; - } /* else: Interpreter will throw. */ -} - -#if LJ_52 -static void LJ_FASTCALL recff_rawlen(jit_State *J, RecordFFData *rd) -{ - TRef tr = J->base[0]; - if (tref_isstr(tr)) - J->base[0] = emitir(IRTI(IR_FLOAD), tr, IRFL_STR_LEN); - else if (tref_istab(tr)) - J->base[0] = lj_ir_call(J, IRCALL_lj_tab_len, tr); - /* else: Interpreter will throw. */ - UNUSED(rd); -} -#endif - -/* Determine mode of select() call. */ -int32_t lj_ffrecord_select_mode(jit_State *J, TRef tr, TValue *tv) -{ - if (tref_isstr(tr) && *strVdata(tv) == '#') { /* select('#', ...) */ - if (strV(tv)->len == 1) { - emitir(IRTG(IR_EQ, IRT_STR), tr, lj_ir_kstr(J, strV(tv))); - } else { - TRef trptr = emitir(IRT(IR_STRREF, IRT_P32), tr, lj_ir_kint(J, 0)); - TRef trchar = emitir(IRT(IR_XLOAD, IRT_U8), trptr, IRXLOAD_READONLY); - emitir(IRTG(IR_EQ, IRT_INT), trchar, lj_ir_kint(J, '#')); - } - return 0; - } else { /* select(n, ...) */ - int32_t start = argv2int(J, tv); - if (start == 0) lj_trace_err(J, LJ_TRERR_BADTYPE); /* A bit misleading. */ - return start; - } -} - -static void LJ_FASTCALL recff_select(jit_State *J, RecordFFData *rd) -{ - TRef tr = J->base[0]; - if (tr) { - ptrdiff_t start = lj_ffrecord_select_mode(J, tr, &rd->argv[0]); - if (start == 0) { /* select('#', ...) */ - J->base[0] = lj_ir_kint(J, J->maxslot - 1); - } else if (tref_isk(tr)) { /* select(k, ...) */ - ptrdiff_t n = (ptrdiff_t)J->maxslot; - if (start < 0) start += n; - else if (start > n) start = n; - rd->nres = n - start; - if (start >= 1) { - ptrdiff_t i; - for (i = 0; i < n - start; i++) - J->base[i] = J->base[start+i]; - } /* else: Interpreter will throw. */ - } else { - recff_nyiu(J); - } - } /* else: Interpreter will throw. */ -} - -static void LJ_FASTCALL recff_tonumber(jit_State *J, RecordFFData *rd) -{ - TRef tr = J->base[0]; - TRef base = J->base[1]; - if (tr && !tref_isnil(base)) { - base = lj_opt_narrow_toint(J, base); - if (!tref_isk(base) || IR(tref_ref(base))->i != 10) - recff_nyiu(J); - } - if (tref_isnumber_str(tr)) { - if (tref_isstr(tr)) { - TValue tmp; - if (!lj_strscan_num(strV(&rd->argv[0]), &tmp)) - recff_nyiu(J); /* Would need an inverted STRTO for this case. */ - tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0); - } -#if LJ_HASFFI - } else if (tref_iscdata(tr)) { - lj_crecord_tonumber(J, rd); - return; -#endif - } else { - tr = TREF_NIL; - } - J->base[0] = tr; - UNUSED(rd); -} - -static TValue *recff_metacall_cp(lua_State *L, lua_CFunction dummy, void *ud) -{ - jit_State *J = (jit_State *)ud; - lj_record_tailcall(J, 0, 1); - UNUSED(L); UNUSED(dummy); - return NULL; -} - -static int recff_metacall(jit_State *J, RecordFFData *rd, MMS mm) -{ - RecordIndex ix; - ix.tab = J->base[0]; - copyTV(J->L, &ix.tabv, &rd->argv[0]); - if (lj_record_mm_lookup(J, &ix, mm)) { /* Has metamethod? */ - int errcode; - TValue argv0; - /* Temporarily insert metamethod below object. */ - J->base[1] = J->base[0]; - J->base[0] = ix.mobj; - copyTV(J->L, &argv0, &rd->argv[0]); - copyTV(J->L, &rd->argv[1], &rd->argv[0]); - copyTV(J->L, &rd->argv[0], &ix.mobjv); - /* Need to protect lj_record_tailcall because it may throw. */ - errcode = lj_vm_cpcall(J->L, NULL, J, recff_metacall_cp); - /* Always undo Lua stack changes to avoid confusing the interpreter. */ - copyTV(J->L, &rd->argv[0], &argv0); - if (errcode) - lj_err_throw(J->L, errcode); /* Propagate errors. */ - rd->nres = -1; /* Pending call. */ - return 1; /* Tailcalled to metamethod. */ - } - return 0; -} - -static void LJ_FASTCALL recff_tostring(jit_State *J, RecordFFData *rd) -{ - TRef tr = J->base[0]; - if (tref_isstr(tr)) { - /* Ignore __tostring in the string base metatable. */ - /* Pass on result in J->base[0]. */ - } else if (!recff_metacall(J, rd, MM_tostring)) { - if (tref_isnumber(tr)) { - J->base[0] = emitir(IRT(IR_TOSTR, IRT_STR), tr, 0); - } else if (tref_ispri(tr)) { - J->base[0] = lj_ir_kstr(J, strV(&J->fn->c.upvalue[tref_type(tr)])); - } else { - recff_nyiu(J); - } - } -} - -static void LJ_FASTCALL recff_ipairs_aux(jit_State *J, RecordFFData *rd) -{ - RecordIndex ix; - ix.tab = J->base[0]; - if (tref_istab(ix.tab)) { - if (!tvisnumber(&rd->argv[1])) /* No support for string coercion. */ - lj_trace_err(J, LJ_TRERR_BADTYPE); - setintV(&ix.keyv, numberVint(&rd->argv[1])+1); - settabV(J->L, &ix.tabv, tabV(&rd->argv[0])); - ix.val = 0; ix.idxchain = 0; - ix.key = lj_opt_narrow_toint(J, J->base[1]); - J->base[0] = ix.key = emitir(IRTI(IR_ADD), ix.key, lj_ir_kint(J, 1)); - J->base[1] = lj_record_idx(J, &ix); - rd->nres = tref_isnil(J->base[1]) ? 0 : 2; - } /* else: Interpreter will throw. */ -} - -static void LJ_FASTCALL recff_ipairs(jit_State *J, RecordFFData *rd) -{ - TRef tr = J->base[0]; - if (!((LJ_52 || (LJ_HASFFI && tref_iscdata(tr))) && - recff_metacall(J, rd, MM_ipairs))) { - if (tref_istab(tr)) { - J->base[0] = lj_ir_kfunc(J, funcV(&J->fn->c.upvalue[0])); - J->base[1] = tr; - J->base[2] = lj_ir_kint(J, 0); - rd->nres = 3; - } /* else: Interpreter will throw. */ - } -} - -static void LJ_FASTCALL recff_pcall(jit_State *J, RecordFFData *rd) -{ - if (J->maxslot >= 1) { - lj_record_call(J, 0, J->maxslot - 1); - rd->nres = -1; /* Pending call. */ - } /* else: Interpreter will throw. */ -} - -static TValue *recff_xpcall_cp(lua_State *L, lua_CFunction dummy, void *ud) -{ - jit_State *J = (jit_State *)ud; - lj_record_call(J, 1, J->maxslot - 2); - UNUSED(L); UNUSED(dummy); - return NULL; -} - -static void LJ_FASTCALL recff_xpcall(jit_State *J, RecordFFData *rd) -{ - if (J->maxslot >= 2) { - TValue argv0, argv1; - TRef tmp; - int errcode; - /* Swap function and traceback. */ - tmp = J->base[0]; J->base[0] = J->base[1]; J->base[1] = tmp; - copyTV(J->L, &argv0, &rd->argv[0]); - copyTV(J->L, &argv1, &rd->argv[1]); - copyTV(J->L, &rd->argv[0], &argv1); - copyTV(J->L, &rd->argv[1], &argv0); - /* Need to protect lj_record_call because it may throw. */ - errcode = lj_vm_cpcall(J->L, NULL, J, recff_xpcall_cp); - /* Always undo Lua stack swap to avoid confusing the interpreter. */ - copyTV(J->L, &rd->argv[0], &argv0); - copyTV(J->L, &rd->argv[1], &argv1); - if (errcode) - lj_err_throw(J->L, errcode); /* Propagate errors. */ - rd->nres = -1; /* Pending call. */ - } /* else: Interpreter will throw. */ -} - -/* -- Math library fast functions ----------------------------------------- */ - -static void LJ_FASTCALL recff_math_abs(jit_State *J, RecordFFData *rd) -{ - TRef tr = lj_ir_tonum(J, J->base[0]); - J->base[0] = emitir(IRTN(IR_ABS), tr, lj_ir_knum_abs(J)); - UNUSED(rd); -} - -/* Record rounding functions math.floor and math.ceil. */ -static void LJ_FASTCALL recff_math_round(jit_State *J, RecordFFData *rd) -{ - TRef tr = J->base[0]; - if (!tref_isinteger(tr)) { /* Pass through integers unmodified. */ - tr = emitir(IRTN(IR_FPMATH), lj_ir_tonum(J, tr), rd->data); - /* Result is integral (or NaN/Inf), but may not fit an int32_t. */ - if (LJ_DUALNUM) { /* Try to narrow using a guarded conversion to int. */ - lua_Number n = lj_vm_foldfpm(numberVnum(&rd->argv[0]), rd->data); - if (n == (lua_Number)lj_num2int(n)) - tr = emitir(IRTGI(IR_CONV), tr, IRCONV_INT_NUM|IRCONV_CHECK); - } - J->base[0] = tr; - } -} - -/* Record unary math.* functions, mapped to IR_FPMATH opcode. */ -static void LJ_FASTCALL recff_math_unary(jit_State *J, RecordFFData *rd) -{ - J->base[0] = emitir(IRTN(IR_FPMATH), lj_ir_tonum(J, J->base[0]), rd->data); -} - -/* Record math.log. */ -static void LJ_FASTCALL recff_math_log(jit_State *J, RecordFFData *rd) -{ - TRef tr = lj_ir_tonum(J, J->base[0]); - if (J->base[1]) { -#ifdef LUAJIT_NO_LOG2 - uint32_t fpm = IRFPM_LOG; -#else - uint32_t fpm = IRFPM_LOG2; -#endif - TRef trb = lj_ir_tonum(J, J->base[1]); - tr = emitir(IRTN(IR_FPMATH), tr, fpm); - trb = emitir(IRTN(IR_FPMATH), trb, fpm); - trb = emitir(IRTN(IR_DIV), lj_ir_knum_one(J), trb); - tr = emitir(IRTN(IR_MUL), tr, trb); - } else { - tr = emitir(IRTN(IR_FPMATH), tr, IRFPM_LOG); - } - J->base[0] = tr; - UNUSED(rd); -} - -/* Record math.atan2. */ -static void LJ_FASTCALL recff_math_atan2(jit_State *J, RecordFFData *rd) -{ - TRef tr = lj_ir_tonum(J, J->base[0]); - TRef tr2 = lj_ir_tonum(J, J->base[1]); - J->base[0] = emitir(IRTN(IR_ATAN2), tr, tr2); - UNUSED(rd); -} - -/* Record math.ldexp. */ -static void LJ_FASTCALL recff_math_ldexp(jit_State *J, RecordFFData *rd) -{ - TRef tr = lj_ir_tonum(J, J->base[0]); -#if LJ_TARGET_X86ORX64 - TRef tr2 = lj_ir_tonum(J, J->base[1]); -#else - TRef tr2 = lj_opt_narrow_toint(J, J->base[1]); -#endif - J->base[0] = emitir(IRTN(IR_LDEXP), tr, tr2); - UNUSED(rd); -} - -/* Record math.asin, math.acos, math.atan. */ -static void LJ_FASTCALL recff_math_atrig(jit_State *J, RecordFFData *rd) -{ - TRef y = lj_ir_tonum(J, J->base[0]); - TRef x = lj_ir_knum_one(J); - uint32_t ffid = rd->data; - if (ffid != FF_math_atan) { - TRef tmp = emitir(IRTN(IR_MUL), y, y); - tmp = emitir(IRTN(IR_SUB), x, tmp); - tmp = emitir(IRTN(IR_FPMATH), tmp, IRFPM_SQRT); - if (ffid == FF_math_asin) { x = tmp; } else { x = y; y = tmp; } - } - J->base[0] = emitir(IRTN(IR_ATAN2), y, x); -} - -static void LJ_FASTCALL recff_math_htrig(jit_State *J, RecordFFData *rd) -{ - TRef tr = lj_ir_tonum(J, J->base[0]); - J->base[0] = emitir(IRTN(IR_CALLN), tr, rd->data); -} - -static void LJ_FASTCALL recff_math_modf(jit_State *J, RecordFFData *rd) -{ - TRef tr = J->base[0]; - if (tref_isinteger(tr)) { - J->base[0] = tr; - J->base[1] = lj_ir_kint(J, 0); - } else { - TRef trt; - tr = lj_ir_tonum(J, tr); - trt = emitir(IRTN(IR_FPMATH), tr, IRFPM_TRUNC); - J->base[0] = trt; - J->base[1] = emitir(IRTN(IR_SUB), tr, trt); - } - rd->nres = 2; -} - -static void LJ_FASTCALL recff_math_degrad(jit_State *J, RecordFFData *rd) -{ - TRef tr = lj_ir_tonum(J, J->base[0]); - TRef trm = lj_ir_knum(J, numV(&J->fn->c.upvalue[0])); - J->base[0] = emitir(IRTN(IR_MUL), tr, trm); - UNUSED(rd); -} - -static void LJ_FASTCALL recff_math_pow(jit_State *J, RecordFFData *rd) -{ - J->base[0] = lj_opt_narrow_pow(J, J->base[0], J->base[1], - &rd->argv[0], &rd->argv[1]); - UNUSED(rd); -} - -static void LJ_FASTCALL recff_math_minmax(jit_State *J, RecordFFData *rd) -{ - TRef tr = lj_ir_tonumber(J, J->base[0]); - uint32_t op = rd->data; - BCReg i; - for (i = 1; J->base[i] != 0; i++) { - TRef tr2 = lj_ir_tonumber(J, J->base[i]); - IRType t = IRT_INT; - if (!(tref_isinteger(tr) && tref_isinteger(tr2))) { - if (tref_isinteger(tr)) tr = emitir(IRTN(IR_CONV), tr, IRCONV_NUM_INT); - if (tref_isinteger(tr2)) tr2 = emitir(IRTN(IR_CONV), tr2, IRCONV_NUM_INT); - t = IRT_NUM; - } - tr = emitir(IRT(op, t), tr, tr2); - } - J->base[0] = tr; -} - -static void LJ_FASTCALL recff_math_random(jit_State *J, RecordFFData *rd) -{ - GCudata *ud = udataV(&J->fn->c.upvalue[0]); - TRef tr, one; - lj_ir_kgc(J, obj2gco(ud), IRT_UDATA); /* Prevent collection. */ - tr = lj_ir_call(J, IRCALL_lj_math_random_step, lj_ir_kptr(J, uddata(ud))); - one = lj_ir_knum_one(J); - tr = emitir(IRTN(IR_SUB), tr, one); - if (J->base[0]) { - TRef tr1 = lj_ir_tonum(J, J->base[0]); - if (J->base[1]) { /* d = floor(d*(r2-r1+1.0)) + r1 */ - TRef tr2 = lj_ir_tonum(J, J->base[1]); - tr2 = emitir(IRTN(IR_SUB), tr2, tr1); - tr2 = emitir(IRTN(IR_ADD), tr2, one); - tr = emitir(IRTN(IR_MUL), tr, tr2); - tr = emitir(IRTN(IR_FPMATH), tr, IRFPM_FLOOR); - tr = emitir(IRTN(IR_ADD), tr, tr1); - } else { /* d = floor(d*r1) + 1.0 */ - tr = emitir(IRTN(IR_MUL), tr, tr1); - tr = emitir(IRTN(IR_FPMATH), tr, IRFPM_FLOOR); - tr = emitir(IRTN(IR_ADD), tr, one); - } - } - J->base[0] = tr; - UNUSED(rd); -} - -/* -- Bit library fast functions ------------------------------------------ */ - -/* Record unary bit.tobit, bit.bnot, bit.bswap. */ -static void LJ_FASTCALL recff_bit_unary(jit_State *J, RecordFFData *rd) -{ - TRef tr = lj_opt_narrow_tobit(J, J->base[0]); - J->base[0] = (rd->data == IR_TOBIT) ? tr : emitir(IRTI(rd->data), tr, 0); -} - -/* Record N-ary bit.band, bit.bor, bit.bxor. */ -static void LJ_FASTCALL recff_bit_nary(jit_State *J, RecordFFData *rd) -{ - TRef tr = lj_opt_narrow_tobit(J, J->base[0]); - uint32_t op = rd->data; - BCReg i; - for (i = 1; J->base[i] != 0; i++) - tr = emitir(IRTI(op), tr, lj_opt_narrow_tobit(J, J->base[i])); - J->base[0] = tr; -} - -/* Record bit shifts. */ -static void LJ_FASTCALL recff_bit_shift(jit_State *J, RecordFFData *rd) -{ - TRef tr = lj_opt_narrow_tobit(J, J->base[0]); - TRef tsh = lj_opt_narrow_tobit(J, J->base[1]); - IROp op = (IROp)rd->data; - if (!(op < IR_BROL ? LJ_TARGET_MASKSHIFT : LJ_TARGET_MASKROT) && - !tref_isk(tsh)) - tsh = emitir(IRTI(IR_BAND), tsh, lj_ir_kint(J, 31)); -#ifdef LJ_TARGET_UNIFYROT - if (op == (LJ_TARGET_UNIFYROT == 1 ? IR_BROR : IR_BROL)) { - op = LJ_TARGET_UNIFYROT == 1 ? IR_BROL : IR_BROR; - tsh = emitir(IRTI(IR_NEG), tsh, tsh); - } -#endif - J->base[0] = emitir(IRTI(op), tr, tsh); -} - -/* -- String library fast functions --------------------------------------- */ - -static void LJ_FASTCALL recff_string_len(jit_State *J, RecordFFData *rd) -{ - J->base[0] = emitir(IRTI(IR_FLOAD), lj_ir_tostr(J, J->base[0]), IRFL_STR_LEN); - UNUSED(rd); -} - -/* Handle string.byte (rd->data = 0) and string.sub (rd->data = 1). */ -static void LJ_FASTCALL recff_string_range(jit_State *J, RecordFFData *rd) -{ - TRef trstr = lj_ir_tostr(J, J->base[0]); - TRef trlen = emitir(IRTI(IR_FLOAD), trstr, IRFL_STR_LEN); - TRef tr0 = lj_ir_kint(J, 0); - TRef trstart, trend; - GCstr *str = argv2str(J, &rd->argv[0]); - int32_t start, end; - if (rd->data) { /* string.sub(str, start [,end]) */ - start = argv2int(J, &rd->argv[1]); - trstart = lj_opt_narrow_toint(J, J->base[1]); - trend = J->base[2]; - if (tref_isnil(trend)) { - trend = lj_ir_kint(J, -1); - end = -1; - } else { - trend = lj_opt_narrow_toint(J, trend); - end = argv2int(J, &rd->argv[2]); - } - } else { /* string.byte(str, [,start [,end]]) */ - if (tref_isnil(J->base[1])) { - start = 1; - trstart = lj_ir_kint(J, 1); - } else { - start = argv2int(J, &rd->argv[1]); - trstart = lj_opt_narrow_toint(J, J->base[1]); - } - if (J->base[1] && !tref_isnil(J->base[2])) { - trend = lj_opt_narrow_toint(J, J->base[2]); - end = argv2int(J, &rd->argv[2]); - } else { - trend = trstart; - end = start; - } - } - if (end < 0) { - emitir(IRTGI(IR_LT), trend, tr0); - trend = emitir(IRTI(IR_ADD), emitir(IRTI(IR_ADD), trlen, trend), - lj_ir_kint(J, 1)); - end = end+(int32_t)str->len+1; - } else if ((MSize)end <= str->len) { - emitir(IRTGI(IR_ULE), trend, trlen); - } else { - emitir(IRTGI(IR_GT), trend, trlen); - end = (int32_t)str->len; - trend = trlen; - } - if (start < 0) { - emitir(IRTGI(IR_LT), trstart, tr0); - trstart = emitir(IRTI(IR_ADD), trlen, trstart); - start = start+(int32_t)str->len; - emitir(start < 0 ? IRTGI(IR_LT) : IRTGI(IR_GE), trstart, tr0); - if (start < 0) { - trstart = tr0; - start = 0; - } - } else { - if (start == 0) { - emitir(IRTGI(IR_EQ), trstart, tr0); - trstart = tr0; - } else { - trstart = emitir(IRTI(IR_ADD), trstart, lj_ir_kint(J, -1)); - emitir(IRTGI(IR_GE), trstart, tr0); - start--; - } - } - if (rd->data) { /* Return string.sub result. */ - if (end - start >= 0) { - /* Also handle empty range here, to avoid extra traces. */ - TRef trptr, trslen = emitir(IRTI(IR_SUB), trend, trstart); - emitir(IRTGI(IR_GE), trslen, tr0); - trptr = emitir(IRT(IR_STRREF, IRT_P32), trstr, trstart); - J->base[0] = emitir(IRT(IR_SNEW, IRT_STR), trptr, trslen); - } else { /* Range underflow: return empty string. */ - emitir(IRTGI(IR_LT), trend, trstart); - J->base[0] = lj_ir_kstr(J, lj_str_new(J->L, strdata(str), 0)); - } - } else { /* Return string.byte result(s). */ - ptrdiff_t i, len = end - start; - if (len > 0) { - TRef trslen = emitir(IRTI(IR_SUB), trend, trstart); - emitir(IRTGI(IR_EQ), trslen, lj_ir_kint(J, (int32_t)len)); - if (J->baseslot + len > LJ_MAX_JSLOTS) - lj_trace_err_info(J, LJ_TRERR_STACKOV); - rd->nres = len; - for (i = 0; i < len; i++) { - TRef tmp = emitir(IRTI(IR_ADD), trstart, lj_ir_kint(J, (int32_t)i)); - tmp = emitir(IRT(IR_STRREF, IRT_P32), trstr, tmp); - J->base[i] = emitir(IRT(IR_XLOAD, IRT_U8), tmp, IRXLOAD_READONLY); - } - } else { /* Empty range or range underflow: return no results. */ - emitir(IRTGI(IR_LE), trend, trstart); - rd->nres = 0; - } - } -} - -/* -- Table library fast functions ---------------------------------------- */ - -static void LJ_FASTCALL recff_table_getn(jit_State *J, RecordFFData *rd) -{ - if (tref_istab(J->base[0])) - J->base[0] = lj_ir_call(J, IRCALL_lj_tab_len, J->base[0]); - /* else: Interpreter will throw. */ - UNUSED(rd); -} - -static void LJ_FASTCALL recff_table_remove(jit_State *J, RecordFFData *rd) -{ - TRef tab = J->base[0]; - rd->nres = 0; - if (tref_istab(tab)) { - if (tref_isnil(J->base[1])) { /* Simple pop: t[#t] = nil */ - TRef trlen = lj_ir_call(J, IRCALL_lj_tab_len, tab); - GCtab *t = tabV(&rd->argv[0]); - MSize len = lj_tab_len(t); - emitir(IRTGI(len ? IR_NE : IR_EQ), trlen, lj_ir_kint(J, 0)); - if (len) { - RecordIndex ix; - ix.tab = tab; - ix.key = trlen; - settabV(J->L, &ix.tabv, t); - setintV(&ix.keyv, len); - ix.idxchain = 0; - if (results_wanted(J) != 0) { /* Specialize load only if needed. */ - ix.val = 0; - J->base[0] = lj_record_idx(J, &ix); /* Load previous value. */ - rd->nres = 1; - /* Assumes ix.key/ix.tab is not modified for raw lj_record_idx(). */ - } - ix.val = TREF_NIL; - lj_record_idx(J, &ix); /* Remove value. */ - } - } else { /* Complex case: remove in the middle. */ - recff_nyiu(J); - } - } /* else: Interpreter will throw. */ -} - -static void LJ_FASTCALL recff_table_insert(jit_State *J, RecordFFData *rd) -{ - RecordIndex ix; - ix.tab = J->base[0]; - ix.val = J->base[1]; - rd->nres = 0; - if (tref_istab(ix.tab) && ix.val) { - if (!J->base[2]) { /* Simple push: t[#t+1] = v */ - TRef trlen = lj_ir_call(J, IRCALL_lj_tab_len, ix.tab); - GCtab *t = tabV(&rd->argv[0]); - ix.key = emitir(IRTI(IR_ADD), trlen, lj_ir_kint(J, 1)); - settabV(J->L, &ix.tabv, t); - setintV(&ix.keyv, lj_tab_len(t) + 1); - ix.idxchain = 0; - lj_record_idx(J, &ix); /* Set new value. */ - } else { /* Complex case: insert in the middle. */ - recff_nyiu(J); - } - } /* else: Interpreter will throw. */ -} - -/* -- I/O library fast functions ------------------------------------------ */ - -/* Get FILE* for I/O function. Any I/O error aborts recording, so there's -** no need to encode the alternate cases for any of the guards. -*/ -static TRef recff_io_fp(jit_State *J, TRef *udp, int32_t id) -{ - TRef tr, ud, fp; - if (id) { /* io.func() */ - tr = lj_ir_kptr(J, &J2G(J)->gcroot[id]); - ud = emitir(IRT(IR_XLOAD, IRT_UDATA), tr, 0); - } else { /* fp:method() */ - ud = J->base[0]; - if (!tref_isudata(ud)) - lj_trace_err(J, LJ_TRERR_BADTYPE); - tr = emitir(IRT(IR_FLOAD, IRT_U8), ud, IRFL_UDATA_UDTYPE); - emitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, UDTYPE_IO_FILE)); - } - *udp = ud; - fp = emitir(IRT(IR_FLOAD, IRT_PTR), ud, IRFL_UDATA_FILE); - emitir(IRTG(IR_NE, IRT_PTR), fp, lj_ir_knull(J, IRT_PTR)); - return fp; -} - -static void LJ_FASTCALL recff_io_write(jit_State *J, RecordFFData *rd) -{ - TRef ud, fp = recff_io_fp(J, &ud, rd->data); - TRef zero = lj_ir_kint(J, 0); - TRef one = lj_ir_kint(J, 1); - ptrdiff_t i = rd->data == 0 ? 1 : 0; - for (; J->base[i]; i++) { - TRef str = lj_ir_tostr(J, J->base[i]); - TRef buf = emitir(IRT(IR_STRREF, IRT_P32), str, zero); - TRef len = emitir(IRTI(IR_FLOAD), str, IRFL_STR_LEN); - if (tref_isk(len) && IR(tref_ref(len))->i == 1) { - TRef tr = emitir(IRT(IR_XLOAD, IRT_U8), buf, IRXLOAD_READONLY); - tr = lj_ir_call(J, IRCALL_fputc, tr, fp); - if (results_wanted(J) != 0) /* Check result only if not ignored. */ - emitir(IRTGI(IR_NE), tr, lj_ir_kint(J, -1)); - } else { - TRef tr = lj_ir_call(J, IRCALL_fwrite, buf, one, len, fp); - if (results_wanted(J) != 0) /* Check result only if not ignored. */ - emitir(IRTGI(IR_EQ), tr, len); - } - } - J->base[0] = LJ_52 ? ud : TREF_TRUE; -} - -static void LJ_FASTCALL recff_io_flush(jit_State *J, RecordFFData *rd) -{ - TRef ud, fp = recff_io_fp(J, &ud, rd->data); - TRef tr = lj_ir_call(J, IRCALL_fflush, fp); - if (results_wanted(J) != 0) /* Check result only if not ignored. */ - emitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, 0)); - J->base[0] = TREF_TRUE; -} - -/* -- Record calls to fast functions -------------------------------------- */ - -#include "lj_recdef.h" - -static uint32_t recdef_lookup(GCfunc *fn) -{ - if (fn->c.ffid < sizeof(recff_idmap)/sizeof(recff_idmap[0])) - return recff_idmap[fn->c.ffid]; - else - return 0; -} - -/* Record entry to a fast function or C function. */ -void lj_ffrecord_func(jit_State *J) -{ - RecordFFData rd; - uint32_t m = recdef_lookup(J->fn); - rd.data = m & 0xff; - rd.nres = 1; /* Default is one result. */ - rd.argv = J->L->base; - J->base[J->maxslot] = 0; /* Mark end of arguments. */ - (recff_func[m >> 8])(J, &rd); /* Call recff_* handler. */ - if (rd.nres >= 0) { - if (J->postproc == LJ_POST_NONE) J->postproc = LJ_POST_FFRETRY; - lj_record_ret(J, 0, rd.nres); - } -} - -#undef IR -#undef emitir - -#endif diff --git a/subprojects/luajit/src/lj_ffrecord.h b/subprojects/luajit/src/lj_ffrecord.h deleted file mode 100644 index 3b407450d..000000000 --- a/subprojects/luajit/src/lj_ffrecord.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -** Fast function call recorder. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_FFRECORD_H -#define _LJ_FFRECORD_H - -#include "lj_obj.h" -#include "lj_jit.h" - -#if LJ_HASJIT -/* Data used by handlers to record a fast function. */ -typedef struct RecordFFData { - TValue *argv; /* Runtime argument values. */ - ptrdiff_t nres; /* Number of returned results (defaults to 1). */ - uint32_t data; /* Per-ffid auxiliary data (opcode, literal etc.). */ -} RecordFFData; - -LJ_FUNC int32_t lj_ffrecord_select_mode(jit_State *J, TRef tr, TValue *tv); -LJ_FUNC void lj_ffrecord_func(jit_State *J); -#endif - -#endif diff --git a/subprojects/luajit/src/lj_frame.h b/subprojects/luajit/src/lj_frame.h deleted file mode 100644 index eb5df3079..000000000 --- a/subprojects/luajit/src/lj_frame.h +++ /dev/null @@ -1,187 +0,0 @@ -/* -** Stack frames. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_FRAME_H -#define _LJ_FRAME_H - -#include "lj_obj.h" -#include "lj_bc.h" - -/* -- Lua stack frame ----------------------------------------------------- */ - -/* Frame type markers in callee function slot (callee base-1). */ -enum { - FRAME_LUA, FRAME_C, FRAME_CONT, FRAME_VARG, - FRAME_LUAP, FRAME_CP, FRAME_PCALL, FRAME_PCALLH -}; -#define FRAME_TYPE 3 -#define FRAME_P 4 -#define FRAME_TYPEP (FRAME_TYPE|FRAME_P) - -/* Macros to access and modify Lua frames. */ -#define frame_gc(f) (gcref((f)->fr.func)) -#define frame_func(f) (&frame_gc(f)->fn) -#define frame_ftsz(f) ((f)->fr.tp.ftsz) - -#define frame_type(f) (frame_ftsz(f) & FRAME_TYPE) -#define frame_typep(f) (frame_ftsz(f) & FRAME_TYPEP) -#define frame_islua(f) (frame_type(f) == FRAME_LUA) -#define frame_isc(f) (frame_type(f) == FRAME_C) -#define frame_iscont(f) (frame_typep(f) == FRAME_CONT) -#define frame_isvarg(f) (frame_typep(f) == FRAME_VARG) -#define frame_ispcall(f) ((frame_ftsz(f) & 6) == FRAME_PCALL) - -#define frame_pc(f) (mref((f)->fr.tp.pcr, const BCIns)) -#define frame_contpc(f) (frame_pc((f)-1)) -#if LJ_64 -#define frame_contf(f) \ - ((ASMFunction)(void *)((intptr_t)lj_vm_asm_begin + \ - (intptr_t)(int32_t)((f)-1)->u32.lo)) -#else -#define frame_contf(f) ((ASMFunction)gcrefp(((f)-1)->gcr, void)) -#endif -#define frame_delta(f) (frame_ftsz(f) >> 3) -#define frame_sized(f) (frame_ftsz(f) & ~FRAME_TYPEP) - -#define frame_prevl(f) ((f) - (1+bc_a(frame_pc(f)[-1]))) -#define frame_prevd(f) ((TValue *)((char *)(f) - frame_sized(f))) -#define frame_prev(f) (frame_islua(f)?frame_prevl(f):frame_prevd(f)) -/* Note: this macro does not skip over FRAME_VARG. */ - -#define setframe_pc(f, pc) (setmref((f)->fr.tp.pcr, (pc))) -#define setframe_ftsz(f, sz) ((f)->fr.tp.ftsz = (sz)) -#define setframe_gc(f, p) (setgcref((f)->fr.func, (p))) - -/* -- C stack frame ------------------------------------------------------- */ - -/* Macros to access and modify the C stack frame chain. */ - -/* These definitions must match with the arch-specific *.dasc files. */ -#if LJ_TARGET_X86 -#define CFRAME_OFS_ERRF (15*4) -#define CFRAME_OFS_NRES (14*4) -#define CFRAME_OFS_PREV (13*4) -#define CFRAME_OFS_L (12*4) -#define CFRAME_OFS_PC (6*4) -#define CFRAME_OFS_MULTRES (5*4) -#define CFRAME_SIZE (12*4) -#define CFRAME_SHIFT_MULTRES 0 -#elif LJ_TARGET_X64 -#if LJ_ABI_WIN -#define CFRAME_OFS_PREV (13*8) -#define CFRAME_OFS_PC (25*4) -#define CFRAME_OFS_L (24*4) -#define CFRAME_OFS_ERRF (23*4) -#define CFRAME_OFS_NRES (22*4) -#define CFRAME_OFS_MULTRES (21*4) -#define CFRAME_SIZE (10*8) -#define CFRAME_SIZE_JIT (CFRAME_SIZE + 9*16 + 4*8) -#define CFRAME_SHIFT_MULTRES 0 -#else -#define CFRAME_OFS_PREV (4*8) -#define CFRAME_OFS_PC (7*4) -#define CFRAME_OFS_L (6*4) -#define CFRAME_OFS_ERRF (5*4) -#define CFRAME_OFS_NRES (4*4) -#define CFRAME_OFS_MULTRES (1*4) -#if LJ_NO_UNWIND -#define CFRAME_SIZE (12*8) -#else -#define CFRAME_SIZE (10*8) -#endif -#define CFRAME_SIZE_JIT (CFRAME_SIZE + 16) -#define CFRAME_SHIFT_MULTRES 0 -#endif -#elif LJ_TARGET_ARM -#define CFRAME_OFS_ERRF 24 -#define CFRAME_OFS_NRES 20 -#define CFRAME_OFS_PREV 16 -#define CFRAME_OFS_L 12 -#define CFRAME_OFS_PC 8 -#define CFRAME_OFS_MULTRES 4 -#if LJ_ARCH_HASFPU -#define CFRAME_SIZE 128 -#else -#define CFRAME_SIZE 64 -#endif -#define CFRAME_SHIFT_MULTRES 3 -#elif LJ_TARGET_PPC -#if LJ_TARGET_XBOX360 -#define CFRAME_OFS_ERRF 424 -#define CFRAME_OFS_NRES 420 -#define CFRAME_OFS_PREV 400 -#define CFRAME_OFS_L 416 -#define CFRAME_OFS_PC 412 -#define CFRAME_OFS_MULTRES 408 -#define CFRAME_SIZE 384 -#define CFRAME_SHIFT_MULTRES 3 -#elif LJ_ARCH_PPC64 -#define CFRAME_OFS_ERRF 472 -#define CFRAME_OFS_NRES 468 -#define CFRAME_OFS_PREV 448 -#define CFRAME_OFS_L 464 -#define CFRAME_OFS_PC 460 -#define CFRAME_OFS_MULTRES 456 -#define CFRAME_SIZE 400 -#define CFRAME_SHIFT_MULTRES 3 -#else -#define CFRAME_OFS_ERRF 48 -#define CFRAME_OFS_NRES 44 -#define CFRAME_OFS_PREV 40 -#define CFRAME_OFS_L 36 -#define CFRAME_OFS_PC 32 -#define CFRAME_OFS_MULTRES 28 -#define CFRAME_SIZE 272 -#define CFRAME_SHIFT_MULTRES 3 -#endif -#elif LJ_TARGET_PPCSPE -#define CFRAME_OFS_ERRF 28 -#define CFRAME_OFS_NRES 24 -#define CFRAME_OFS_PREV 20 -#define CFRAME_OFS_L 16 -#define CFRAME_OFS_PC 12 -#define CFRAME_OFS_MULTRES 8 -#define CFRAME_SIZE 184 -#define CFRAME_SHIFT_MULTRES 3 -#elif LJ_TARGET_MIPS -#define CFRAME_OFS_ERRF 124 -#define CFRAME_OFS_NRES 120 -#define CFRAME_OFS_PREV 116 -#define CFRAME_OFS_L 112 -#define CFRAME_OFS_PC 20 -#define CFRAME_OFS_MULTRES 16 -#define CFRAME_SIZE 112 -#define CFRAME_SHIFT_MULTRES 3 -#else -#error "Missing CFRAME_* definitions for this architecture" -#endif - -#ifndef CFRAME_SIZE_JIT -#define CFRAME_SIZE_JIT CFRAME_SIZE -#endif - -#define CFRAME_RESUME 1 -#define CFRAME_UNWIND_FF 2 /* Only used in unwinder. */ -#define CFRAME_RAWMASK (~(intptr_t)(CFRAME_RESUME|CFRAME_UNWIND_FF)) - -#define cframe_errfunc(cf) (*(int32_t *)(((char *)(cf))+CFRAME_OFS_ERRF)) -#define cframe_nres(cf) (*(int32_t *)(((char *)(cf))+CFRAME_OFS_NRES)) -#define cframe_prev(cf) (*(void **)(((char *)(cf))+CFRAME_OFS_PREV)) -#define cframe_multres(cf) (*(uint32_t *)(((char *)(cf))+CFRAME_OFS_MULTRES)) -#define cframe_multres_n(cf) (cframe_multres((cf)) >> CFRAME_SHIFT_MULTRES) -#define cframe_L(cf) \ - (&gcref(*(GCRef *)(((char *)(cf))+CFRAME_OFS_L))->th) -#define cframe_pc(cf) \ - (mref(*(MRef *)(((char *)(cf))+CFRAME_OFS_PC), const BCIns)) -#define setcframe_L(cf, L) \ - (setmref(*(MRef *)(((char *)(cf))+CFRAME_OFS_L), (L))) -#define setcframe_pc(cf, pc) \ - (setmref(*(MRef *)(((char *)(cf))+CFRAME_OFS_PC), (pc))) -#define cframe_canyield(cf) ((intptr_t)(cf) & CFRAME_RESUME) -#define cframe_unwind_ff(cf) ((intptr_t)(cf) & CFRAME_UNWIND_FF) -#define cframe_raw(cf) ((void *)((intptr_t)(cf) & CFRAME_RAWMASK)) -#define cframe_Lpc(L) cframe_pc(cframe_raw(L->cframe)) - -#endif diff --git a/subprojects/luajit/src/lj_func.c b/subprojects/luajit/src/lj_func.c deleted file mode 100644 index 639dad876..000000000 --- a/subprojects/luajit/src/lj_func.c +++ /dev/null @@ -1,187 +0,0 @@ -/* -** Function handling (prototypes, functions and upvalues). -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#define lj_func_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_func.h" -#include "lj_trace.h" -#include "lj_vm.h" - -/* -- Prototypes ---------------------------------------------------------- */ - -void LJ_FASTCALL lj_func_freeproto(global_State *g, GCproto *pt) -{ - lj_mem_free(g, pt, pt->sizept); -} - -/* -- Upvalues ------------------------------------------------------------ */ - -static void unlinkuv(GCupval *uv) -{ - lua_assert(uvprev(uvnext(uv)) == uv && uvnext(uvprev(uv)) == uv); - setgcrefr(uvnext(uv)->prev, uv->prev); - setgcrefr(uvprev(uv)->next, uv->next); -} - -/* Find existing open upvalue for a stack slot or create a new one. */ -static GCupval *func_finduv(lua_State *L, TValue *slot) -{ - global_State *g = G(L); - GCRef *pp = &L->openupval; - GCupval *p; - GCupval *uv; - /* Search the sorted list of open upvalues. */ - while (gcref(*pp) != NULL && uvval((p = gco2uv(gcref(*pp)))) >= slot) { - lua_assert(!p->closed && uvval(p) != &p->tv); - if (uvval(p) == slot) { /* Found open upvalue pointing to same slot? */ - if (isdead(g, obj2gco(p))) /* Resurrect it, if it's dead. */ - flipwhite(obj2gco(p)); - return p; - } - pp = &p->nextgc; - } - /* No matching upvalue found. Create a new one. */ - uv = lj_mem_newt(L, sizeof(GCupval), GCupval); - newwhite(g, uv); - uv->gct = ~LJ_TUPVAL; - uv->closed = 0; /* Still open. */ - setmref(uv->v, slot); /* Pointing to the stack slot. */ - /* NOBARRIER: The GCupval is new (marked white) and open. */ - setgcrefr(uv->nextgc, *pp); /* Insert into sorted list of open upvalues. */ - setgcref(*pp, obj2gco(uv)); - setgcref(uv->prev, obj2gco(&g->uvhead)); /* Insert into GC list, too. */ - setgcrefr(uv->next, g->uvhead.next); - setgcref(uvnext(uv)->prev, obj2gco(uv)); - setgcref(g->uvhead.next, obj2gco(uv)); - lua_assert(uvprev(uvnext(uv)) == uv && uvnext(uvprev(uv)) == uv); - return uv; -} - -/* Create an empty and closed upvalue. */ -static GCupval *func_emptyuv(lua_State *L) -{ - GCupval *uv = (GCupval *)lj_mem_newgco(L, sizeof(GCupval)); - uv->gct = ~LJ_TUPVAL; - uv->closed = 1; - setnilV(&uv->tv); - setmref(uv->v, &uv->tv); - return uv; -} - -/* Close all open upvalues pointing to some stack level or above. */ -void LJ_FASTCALL lj_func_closeuv(lua_State *L, TValue *level) -{ - GCupval *uv; - global_State *g = G(L); - while (gcref(L->openupval) != NULL && - uvval((uv = gco2uv(gcref(L->openupval)))) >= level) { - GCobj *o = obj2gco(uv); - lua_assert(!isblack(o) && !uv->closed && uvval(uv) != &uv->tv); - setgcrefr(L->openupval, uv->nextgc); /* No longer in open list. */ - if (isdead(g, o)) { - lj_func_freeuv(g, uv); - } else { - unlinkuv(uv); - lj_gc_closeuv(g, uv); - } - } -} - -void LJ_FASTCALL lj_func_freeuv(global_State *g, GCupval *uv) -{ - if (!uv->closed) - unlinkuv(uv); - lj_mem_freet(g, uv); -} - -/* -- Functions (closures) ------------------------------------------------ */ - -GCfunc *lj_func_newC(lua_State *L, MSize nelems, GCtab *env) -{ - GCfunc *fn = (GCfunc *)lj_mem_newgco(L, sizeCfunc(nelems)); - fn->c.gct = ~LJ_TFUNC; - fn->c.ffid = FF_C; - fn->c.nupvalues = (uint8_t)nelems; - /* NOBARRIER: The GCfunc is new (marked white). */ - setmref(fn->c.pc, &G(L)->bc_cfunc_ext); - setgcref(fn->c.env, obj2gco(env)); - return fn; -} - -static GCfunc *func_newL(lua_State *L, GCproto *pt, GCtab *env) -{ - uint32_t count; - GCfunc *fn = (GCfunc *)lj_mem_newgco(L, sizeLfunc((MSize)pt->sizeuv)); - fn->l.gct = ~LJ_TFUNC; - fn->l.ffid = FF_LUA; - fn->l.nupvalues = 0; /* Set to zero until upvalues are initialized. */ - /* NOBARRIER: Really a setgcref. But the GCfunc is new (marked white). */ - setmref(fn->l.pc, proto_bc(pt)); - setgcref(fn->l.env, obj2gco(env)); - /* Saturating 3 bit counter (0..7) for created closures. */ - count = (uint32_t)pt->flags + PROTO_CLCOUNT; - pt->flags = (uint8_t)(count - ((count >> PROTO_CLC_BITS) & PROTO_CLCOUNT)); - return fn; -} - -/* Create a new Lua function with empty upvalues. */ -GCfunc *lj_func_newL_empty(lua_State *L, GCproto *pt, GCtab *env) -{ - GCfunc *fn = func_newL(L, pt, env); - MSize i, nuv = pt->sizeuv; - /* NOBARRIER: The GCfunc is new (marked white). */ - for (i = 0; i < nuv; i++) { - GCupval *uv = func_emptyuv(L); - int32_t v = proto_uv(pt)[i]; - uv->immutable = ((v / PROTO_UV_IMMUTABLE) & 1); - uv->dhash = (uint32_t)(uintptr_t)pt ^ (v << 24); - setgcref(fn->l.uvptr[i], obj2gco(uv)); - } - fn->l.nupvalues = (uint8_t)nuv; - return fn; -} - -/* Do a GC check and create a new Lua function with inherited upvalues. */ -GCfunc *lj_func_newL_gc(lua_State *L, GCproto *pt, GCfuncL *parent) -{ - GCfunc *fn; - GCRef *puv; - MSize i, nuv; - TValue *base; - lj_gc_check_fixtop(L); - fn = func_newL(L, pt, tabref(parent->env)); - /* NOBARRIER: The GCfunc is new (marked white). */ - puv = parent->uvptr; - nuv = pt->sizeuv; - base = L->base; - for (i = 0; i < nuv; i++) { - uint32_t v = proto_uv(pt)[i]; - GCupval *uv; - if ((v & PROTO_UV_LOCAL)) { - uv = func_finduv(L, base + (v & 0xff)); - uv->immutable = ((v / PROTO_UV_IMMUTABLE) & 1); - uv->dhash = (uint32_t)(uintptr_t)mref(parent->pc, char) ^ (v << 24); - } else { - uv = &gcref(puv[v])->uv; - } - setgcref(fn->l.uvptr[i], obj2gco(uv)); - } - fn->l.nupvalues = (uint8_t)nuv; - return fn; -} - -void LJ_FASTCALL lj_func_free(global_State *g, GCfunc *fn) -{ - MSize size = isluafunc(fn) ? sizeLfunc((MSize)fn->l.nupvalues) : - sizeCfunc((MSize)fn->c.nupvalues); - lj_mem_free(g, fn, size); -} - diff --git a/subprojects/luajit/src/lj_func.h b/subprojects/luajit/src/lj_func.h deleted file mode 100644 index 901751b98..000000000 --- a/subprojects/luajit/src/lj_func.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -** Function handling (prototypes, functions and upvalues). -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_FUNC_H -#define _LJ_FUNC_H - -#include "lj_obj.h" - -/* Prototypes. */ -LJ_FUNC void LJ_FASTCALL lj_func_freeproto(global_State *g, GCproto *pt); - -/* Upvalues. */ -LJ_FUNCA void LJ_FASTCALL lj_func_closeuv(lua_State *L, TValue *level); -LJ_FUNC void LJ_FASTCALL lj_func_freeuv(global_State *g, GCupval *uv); - -/* Functions (closures). */ -LJ_FUNC GCfunc *lj_func_newC(lua_State *L, MSize nelems, GCtab *env); -LJ_FUNC GCfunc *lj_func_newL_empty(lua_State *L, GCproto *pt, GCtab *env); -LJ_FUNCA GCfunc *lj_func_newL_gc(lua_State *L, GCproto *pt, GCfuncL *parent); -LJ_FUNC void LJ_FASTCALL lj_func_free(global_State *g, GCfunc *c); - -#endif diff --git a/subprojects/luajit/src/lj_gc.c b/subprojects/luajit/src/lj_gc.c deleted file mode 100644 index a5d32ea35..000000000 --- a/subprojects/luajit/src/lj_gc.c +++ /dev/null @@ -1,856 +0,0 @@ -/* -** Garbage collector. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#define lj_gc_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_func.h" -#include "lj_udata.h" -#include "lj_meta.h" -#include "lj_state.h" -#include "lj_frame.h" -#if LJ_HASFFI -#include "lj_ctype.h" -#include "lj_cdata.h" -#endif -#include "lj_trace.h" -#include "lj_vm.h" - -#define GCSTEPSIZE 1024u -#define GCSWEEPMAX 40 -#define GCSWEEPCOST 10 -#define GCFINALIZECOST 100 - -/* Macros to set GCobj colors and flags. */ -#define white2gray(x) ((x)->gch.marked &= (uint8_t)~LJ_GC_WHITES) -#define gray2black(x) ((x)->gch.marked |= LJ_GC_BLACK) -#define isfinalized(u) ((u)->marked & LJ_GC_FINALIZED) - -/* -- Mark phase ---------------------------------------------------------- */ - -/* Mark a TValue (if needed). */ -#define gc_marktv(g, tv) \ - { lua_assert(!tvisgcv(tv) || (~itype(tv) == gcval(tv)->gch.gct)); \ - if (tviswhite(tv)) gc_mark(g, gcV(tv)); } - -/* Mark a GCobj (if needed). */ -#define gc_markobj(g, o) \ - { if (iswhite(obj2gco(o))) gc_mark(g, obj2gco(o)); } - -/* Mark a string object. */ -#define gc_mark_str(s) ((s)->marked &= (uint8_t)~LJ_GC_WHITES) - -/* Mark a white GCobj. */ -static void gc_mark(global_State *g, GCobj *o) -{ - int gct = o->gch.gct; - lua_assert(iswhite(o) && !isdead(g, o)); - white2gray(o); - if (LJ_UNLIKELY(gct == ~LJ_TUDATA)) { - GCtab *mt = tabref(gco2ud(o)->metatable); - gray2black(o); /* Userdata are never gray. */ - if (mt) gc_markobj(g, mt); - gc_markobj(g, tabref(gco2ud(o)->env)); - } else if (LJ_UNLIKELY(gct == ~LJ_TUPVAL)) { - GCupval *uv = gco2uv(o); - gc_marktv(g, uvval(uv)); - if (uv->closed) - gray2black(o); /* Closed upvalues are never gray. */ - } else if (gct != ~LJ_TSTR && gct != ~LJ_TCDATA) { - lua_assert(gct == ~LJ_TFUNC || gct == ~LJ_TTAB || - gct == ~LJ_TTHREAD || gct == ~LJ_TPROTO); - setgcrefr(o->gch.gclist, g->gc.gray); - setgcref(g->gc.gray, o); - } -} - -/* Mark GC roots. */ -static void gc_mark_gcroot(global_State *g) -{ - ptrdiff_t i; - for (i = 0; i < GCROOT_MAX; i++) - if (gcref(g->gcroot[i]) != NULL) - gc_markobj(g, gcref(g->gcroot[i])); -} - -/* Start a GC cycle and mark the root set. */ -static void gc_mark_start(global_State *g) -{ - setgcrefnull(g->gc.gray); - setgcrefnull(g->gc.grayagain); - setgcrefnull(g->gc.weak); - gc_markobj(g, mainthread(g)); - gc_markobj(g, tabref(mainthread(g)->env)); - gc_marktv(g, &g->registrytv); - gc_mark_gcroot(g); - g->gc.state = GCSpropagate; -} - -/* Mark open upvalues. */ -static void gc_mark_uv(global_State *g) -{ - GCupval *uv; - for (uv = uvnext(&g->uvhead); uv != &g->uvhead; uv = uvnext(uv)) { - lua_assert(uvprev(uvnext(uv)) == uv && uvnext(uvprev(uv)) == uv); - if (isgray(obj2gco(uv))) - gc_marktv(g, uvval(uv)); - } -} - -/* Mark userdata in mmudata list. */ -static void gc_mark_mmudata(global_State *g) -{ - GCobj *root = gcref(g->gc.mmudata); - GCobj *u = root; - if (u) { - do { - u = gcnext(u); - makewhite(g, u); /* Could be from previous GC. */ - gc_mark(g, u); - } while (u != root); - } -} - -/* Separate userdata objects to be finalized to mmudata list. */ -size_t lj_gc_separateudata(global_State *g, int all) -{ - size_t m = 0; - GCRef *p = &mainthread(g)->nextgc; - GCobj *o; - while ((o = gcref(*p)) != NULL) { - if (!(iswhite(o) || all) || isfinalized(gco2ud(o))) { - p = &o->gch.nextgc; /* Nothing to do. */ - } else if (!lj_meta_fastg(g, tabref(gco2ud(o)->metatable), MM_gc)) { - markfinalized(o); /* Done, as there's no __gc metamethod. */ - p = &o->gch.nextgc; - } else { /* Otherwise move userdata to be finalized to mmudata list. */ - m += sizeudata(gco2ud(o)); - markfinalized(o); - *p = o->gch.nextgc; - if (gcref(g->gc.mmudata)) { /* Link to end of mmudata list. */ - GCobj *root = gcref(g->gc.mmudata); - setgcrefr(o->gch.nextgc, root->gch.nextgc); - setgcref(root->gch.nextgc, o); - setgcref(g->gc.mmudata, o); - } else { /* Create circular list. */ - setgcref(o->gch.nextgc, o); - setgcref(g->gc.mmudata, o); - } - } - } - return m; -} - -/* -- Propagation phase --------------------------------------------------- */ - -/* Traverse a table. */ -static int gc_traverse_tab(global_State *g, GCtab *t) -{ - int weak = 0; - cTValue *mode; - GCtab *mt = tabref(t->metatable); - if (mt) - gc_markobj(g, mt); - mode = lj_meta_fastg(g, mt, MM_mode); - if (mode && tvisstr(mode)) { /* Valid __mode field? */ - const char *modestr = strVdata(mode); - int c; - while ((c = *modestr++)) { - if (c == 'k') weak |= LJ_GC_WEAKKEY; - else if (c == 'v') weak |= LJ_GC_WEAKVAL; - } - if (weak) { /* Weak tables are cleared in the atomic phase. */ -#if LJ_HASFFI - CTState *cts = ctype_ctsG(g); - if (cts && cts->finalizer == t) { - weak = (int)(~0u & ~LJ_GC_WEAKVAL); - } else -#endif - { - t->marked = (uint8_t)((t->marked & ~LJ_GC_WEAK) | weak); - setgcrefr(t->gclist, g->gc.weak); - setgcref(g->gc.weak, obj2gco(t)); - } - } - } - if (weak == LJ_GC_WEAK) /* Nothing to mark if both keys/values are weak. */ - return 1; - if (!(weak & LJ_GC_WEAKVAL)) { /* Mark array part. */ - MSize i, asize = t->asize; - for (i = 0; i < asize; i++) - gc_marktv(g, arrayslot(t, i)); - } - if (t->hmask > 0) { /* Mark hash part. */ - Node *node = noderef(t->node); - MSize i, hmask = t->hmask; - for (i = 0; i <= hmask; i++) { - Node *n = &node[i]; - if (!tvisnil(&n->val)) { /* Mark non-empty slot. */ - lua_assert(!tvisnil(&n->key)); - if (!(weak & LJ_GC_WEAKKEY)) gc_marktv(g, &n->key); - if (!(weak & LJ_GC_WEAKVAL)) gc_marktv(g, &n->val); - } - } - } - return weak; -} - -/* Traverse a function. */ -static void gc_traverse_func(global_State *g, GCfunc *fn) -{ - gc_markobj(g, tabref(fn->c.env)); - if (isluafunc(fn)) { - uint32_t i; - lua_assert(fn->l.nupvalues <= funcproto(fn)->sizeuv); - gc_markobj(g, funcproto(fn)); - for (i = 0; i < fn->l.nupvalues; i++) /* Mark Lua function upvalues. */ - gc_markobj(g, &gcref(fn->l.uvptr[i])->uv); - } else { - uint32_t i; - for (i = 0; i < fn->c.nupvalues; i++) /* Mark C function upvalues. */ - gc_marktv(g, &fn->c.upvalue[i]); - } -} - -#if LJ_HASJIT -/* Mark a trace. */ -static void gc_marktrace(global_State *g, TraceNo traceno) -{ - GCobj *o = obj2gco(traceref(G2J(g), traceno)); - lua_assert(traceno != G2J(g)->cur.traceno); - if (iswhite(o)) { - white2gray(o); - setgcrefr(o->gch.gclist, g->gc.gray); - setgcref(g->gc.gray, o); - } -} - -/* Traverse a trace. */ -static void gc_traverse_trace(global_State *g, GCtrace *T) -{ - IRRef ref; - if (T->traceno == 0) return; - for (ref = T->nk; ref < REF_TRUE; ref++) { - IRIns *ir = &T->ir[ref]; - if (ir->o == IR_KGC) - gc_markobj(g, ir_kgc(ir)); - } - if (T->link) gc_marktrace(g, T->link); - if (T->nextroot) gc_marktrace(g, T->nextroot); - if (T->nextside) gc_marktrace(g, T->nextside); - gc_markobj(g, gcref(T->startpt)); -} - -/* The current trace is a GC root while not anchored in the prototype (yet). */ -#define gc_traverse_curtrace(g) gc_traverse_trace(g, &G2J(g)->cur) -#else -#define gc_traverse_curtrace(g) UNUSED(g) -#endif - -/* Traverse a prototype. */ -static void gc_traverse_proto(global_State *g, GCproto *pt) -{ - ptrdiff_t i; - gc_mark_str(proto_chunkname(pt)); - for (i = -(ptrdiff_t)pt->sizekgc; i < 0; i++) /* Mark collectable consts. */ - gc_markobj(g, proto_kgc(pt, i)); -#if LJ_HASJIT - if (pt->trace) gc_marktrace(g, pt->trace); -#endif -} - -/* Traverse the frame structure of a stack. */ -static MSize gc_traverse_frames(global_State *g, lua_State *th) -{ - TValue *frame, *top = th->top-1, *bot = tvref(th->stack); - /* Note: extra vararg frame not skipped, marks function twice (harmless). */ - for (frame = th->base-1; frame > bot; frame = frame_prev(frame)) { - GCfunc *fn = frame_func(frame); - TValue *ftop = frame; - if (isluafunc(fn)) ftop += funcproto(fn)->framesize; - if (ftop > top) top = ftop; - gc_markobj(g, fn); /* Need to mark hidden function (or L). */ - } - top++; /* Correct bias of -1 (frame == base-1). */ - if (top > tvref(th->maxstack)) top = tvref(th->maxstack); - return (MSize)(top - bot); /* Return minimum needed stack size. */ -} - -/* Traverse a thread object. */ -static void gc_traverse_thread(global_State *g, lua_State *th) -{ - TValue *o, *top = th->top; - for (o = tvref(th->stack)+1; o < top; o++) - gc_marktv(g, o); - if (g->gc.state == GCSatomic) { - top = tvref(th->stack) + th->stacksize; - for (; o < top; o++) /* Clear unmarked slots. */ - setnilV(o); - } - gc_markobj(g, tabref(th->env)); - lj_state_shrinkstack(th, gc_traverse_frames(g, th)); -} - -/* Propagate one gray object. Traverse it and turn it black. */ -static size_t propagatemark(global_State *g) -{ - GCobj *o = gcref(g->gc.gray); - int gct = o->gch.gct; - lua_assert(isgray(o)); - gray2black(o); - setgcrefr(g->gc.gray, o->gch.gclist); /* Remove from gray list. */ - if (LJ_LIKELY(gct == ~LJ_TTAB)) { - GCtab *t = gco2tab(o); - if (gc_traverse_tab(g, t) > 0) - black2gray(o); /* Keep weak tables gray. */ - return sizeof(GCtab) + sizeof(TValue) * t->asize + - (t->hmask ? sizeof(Node) * (t->hmask + 1) : 0); - } else if (LJ_LIKELY(gct == ~LJ_TFUNC)) { - GCfunc *fn = gco2func(o); - gc_traverse_func(g, fn); - return isluafunc(fn) ? sizeLfunc((MSize)fn->l.nupvalues) : - sizeCfunc((MSize)fn->c.nupvalues); - } else if (LJ_LIKELY(gct == ~LJ_TPROTO)) { - GCproto *pt = gco2pt(o); - gc_traverse_proto(g, pt); - return pt->sizept; - } else if (LJ_LIKELY(gct == ~LJ_TTHREAD)) { - lua_State *th = gco2th(o); - setgcrefr(th->gclist, g->gc.grayagain); - setgcref(g->gc.grayagain, o); - black2gray(o); /* Threads are never black. */ - gc_traverse_thread(g, th); - return sizeof(lua_State) + sizeof(TValue) * th->stacksize; - } else { -#if LJ_HASJIT - GCtrace *T = gco2trace(o); - gc_traverse_trace(g, T); - return ((sizeof(GCtrace)+7)&~7) + (T->nins-T->nk)*sizeof(IRIns) + - T->nsnap*sizeof(SnapShot) + T->nsnapmap*sizeof(SnapEntry); -#else - lua_assert(0); - return 0; -#endif - } -} - -/* Propagate all gray objects. */ -static size_t gc_propagate_gray(global_State *g) -{ - size_t m = 0; - while (gcref(g->gc.gray) != NULL) - m += propagatemark(g); - return m; -} - -/* -- Sweep phase --------------------------------------------------------- */ - -/* Try to shrink some common data structures. */ -static void gc_shrink(global_State *g, lua_State *L) -{ - if (g->strnum <= (g->strmask >> 2) && g->strmask > LJ_MIN_STRTAB*2-1) - lj_str_resize(L, g->strmask >> 1); /* Shrink string table. */ - if (g->tmpbuf.sz > LJ_MIN_SBUF*2) - lj_str_resizebuf(L, &g->tmpbuf, g->tmpbuf.sz >> 1); /* Shrink temp buf. */ -} - -/* Type of GC free functions. */ -typedef void (LJ_FASTCALL *GCFreeFunc)(global_State *g, GCobj *o); - -/* GC free functions for LJ_TSTR .. LJ_TUDATA. ORDER LJ_T */ -static const GCFreeFunc gc_freefunc[] = { - (GCFreeFunc)lj_str_free, - (GCFreeFunc)lj_func_freeuv, - (GCFreeFunc)lj_state_free, - (GCFreeFunc)lj_func_freeproto, - (GCFreeFunc)lj_func_free, -#if LJ_HASJIT - (GCFreeFunc)lj_trace_free, -#else - (GCFreeFunc)0, -#endif -#if LJ_HASFFI - (GCFreeFunc)lj_cdata_free, -#else - (GCFreeFunc)0, -#endif - (GCFreeFunc)lj_tab_free, - (GCFreeFunc)lj_udata_free -}; - -/* Full sweep of a GC list. */ -#define gc_fullsweep(g, p) gc_sweep(g, (p), LJ_MAX_MEM) - -/* Partial sweep of a GC list. */ -static GCRef *gc_sweep(global_State *g, GCRef *p, uint32_t lim) -{ - /* Mask with other white and LJ_GC_FIXED. Or LJ_GC_SFIXED on shutdown. */ - int ow = otherwhite(g); - GCobj *o; - while ((o = gcref(*p)) != NULL && lim-- > 0) { - if (o->gch.gct == ~LJ_TTHREAD) /* Need to sweep open upvalues, too. */ - gc_fullsweep(g, &gco2th(o)->openupval); - if (((o->gch.marked ^ LJ_GC_WHITES) & ow)) { /* Black or current white? */ - lua_assert(!isdead(g, o) || (o->gch.marked & LJ_GC_FIXED)); - makewhite(g, o); /* Value is alive, change to the current white. */ - p = &o->gch.nextgc; - } else { /* Otherwise value is dead, free it. */ - lua_assert(isdead(g, o) || ow == LJ_GC_SFIXED); - setgcrefr(*p, o->gch.nextgc); - if (o == gcref(g->gc.root)) - setgcrefr(g->gc.root, o->gch.nextgc); /* Adjust list anchor. */ - gc_freefunc[o->gch.gct - ~LJ_TSTR](g, o); - } - } - return p; -} - -/* Check whether we can clear a key or a value slot from a table. */ -static int gc_mayclear(cTValue *o, int val) -{ - if (tvisgcv(o)) { /* Only collectable objects can be weak references. */ - if (tvisstr(o)) { /* But strings cannot be used as weak references. */ - gc_mark_str(strV(o)); /* And need to be marked. */ - return 0; - } - if (iswhite(gcV(o))) - return 1; /* Object is about to be collected. */ - if (tvisudata(o) && val && isfinalized(udataV(o))) - return 1; /* Finalized userdata is dropped only from values. */ - } - return 0; /* Cannot clear. */ -} - -/* Clear collected entries from weak tables. */ -static void gc_clearweak(GCobj *o) -{ - while (o) { - GCtab *t = gco2tab(o); - lua_assert((t->marked & LJ_GC_WEAK)); - if ((t->marked & LJ_GC_WEAKVAL)) { - MSize i, asize = t->asize; - for (i = 0; i < asize; i++) { - /* Clear array slot when value is about to be collected. */ - TValue *tv = arrayslot(t, i); - if (gc_mayclear(tv, 1)) - setnilV(tv); - } - } - if (t->hmask > 0) { - Node *node = noderef(t->node); - MSize i, hmask = t->hmask; - for (i = 0; i <= hmask; i++) { - Node *n = &node[i]; - /* Clear hash slot when key or value is about to be collected. */ - if (!tvisnil(&n->val) && (gc_mayclear(&n->key, 0) || - gc_mayclear(&n->val, 1))) - setnilV(&n->val); - } - } - o = gcref(t->gclist); - } -} - -/* Call a userdata or cdata finalizer. */ -static void gc_call_finalizer(global_State *g, lua_State *L, - cTValue *mo, GCobj *o) -{ - /* Save and restore lots of state around the __gc callback. */ - uint8_t oldh = hook_save(g); - MSize oldt = g->gc.threshold; - int errcode; - TValue *top; - lj_trace_abort(g); - top = L->top; - L->top = top+2; - hook_entergc(g); /* Disable hooks and new traces during __gc. */ - g->gc.threshold = LJ_MAX_MEM; /* Prevent GC steps. */ - copyTV(L, top, mo); - setgcV(L, top+1, o, ~o->gch.gct); - errcode = lj_vm_pcall(L, top+1, 1+0, -1); /* Stack: |mo|o| -> | */ - hook_restore(g, oldh); - g->gc.threshold = oldt; /* Restore GC threshold. */ - if (errcode) - lj_err_throw(L, errcode); /* Propagate errors. */ -} - -/* Finalize one userdata or cdata object from the mmudata list. */ -static void gc_finalize(lua_State *L) -{ - global_State *g = G(L); - GCobj *o = gcnext(gcref(g->gc.mmudata)); - cTValue *mo; - lua_assert(gcref(g->jit_L) == NULL); /* Must not be called on trace. */ - /* Unchain from list of userdata to be finalized. */ - if (o == gcref(g->gc.mmudata)) - setgcrefnull(g->gc.mmudata); - else - setgcrefr(gcref(g->gc.mmudata)->gch.nextgc, o->gch.nextgc); -#if LJ_HASFFI - if (o->gch.gct == ~LJ_TCDATA) { - TValue tmp, *tv; - /* Add cdata back to the GC list and make it white. */ - setgcrefr(o->gch.nextgc, g->gc.root); - setgcref(g->gc.root, o); - makewhite(g, o); - o->gch.marked &= (uint8_t)~LJ_GC_CDATA_FIN; - /* Resolve finalizer. */ - setcdataV(L, &tmp, gco2cd(o)); - tv = lj_tab_set(L, ctype_ctsG(g)->finalizer, &tmp); - if (!tvisnil(tv)) { - g->gc.nocdatafin = 0; - copyTV(L, &tmp, tv); - setnilV(tv); /* Clear entry in finalizer table. */ - gc_call_finalizer(g, L, &tmp, o); - } - return; - } -#endif - /* Add userdata back to the main userdata list and make it white. */ - setgcrefr(o->gch.nextgc, mainthread(g)->nextgc); - setgcref(mainthread(g)->nextgc, o); - makewhite(g, o); - /* Resolve the __gc metamethod. */ - mo = lj_meta_fastg(g, tabref(gco2ud(o)->metatable), MM_gc); - if (mo) - gc_call_finalizer(g, L, mo, o); -} - -/* Finalize all userdata objects from mmudata list. */ -void lj_gc_finalize_udata(lua_State *L) -{ - while (gcref(G(L)->gc.mmudata) != NULL) - gc_finalize(L); -} - -#if LJ_HASFFI -/* Finalize all cdata objects from finalizer table. */ -void lj_gc_finalize_cdata(lua_State *L) -{ - global_State *g = G(L); - CTState *cts = ctype_ctsG(g); - if (cts) { - GCtab *t = cts->finalizer; - Node *node = noderef(t->node); - ptrdiff_t i; - setgcrefnull(t->metatable); /* Mark finalizer table as disabled. */ - for (i = (ptrdiff_t)t->hmask; i >= 0; i--) - if (!tvisnil(&node[i].val) && tviscdata(&node[i].key)) { - GCobj *o = gcV(&node[i].key); - TValue tmp; - makewhite(g, o); - o->gch.marked &= (uint8_t)~LJ_GC_CDATA_FIN; - copyTV(L, &tmp, &node[i].val); - setnilV(&node[i].val); - gc_call_finalizer(g, L, &tmp, o); - } - } -} -#endif - -/* Free all remaining GC objects. */ -void lj_gc_freeall(global_State *g) -{ - MSize i, strmask; - /* Free everything, except super-fixed objects (the main thread). */ - g->gc.currentwhite = LJ_GC_WHITES | LJ_GC_SFIXED; - gc_fullsweep(g, &g->gc.root); - strmask = g->strmask; - for (i = 0; i <= strmask; i++) /* Free all string hash chains. */ - gc_fullsweep(g, &g->strhash[i]); -} - -/* -- Collector ----------------------------------------------------------- */ - -/* Atomic part of the GC cycle, transitioning from mark to sweep phase. */ -static void atomic(global_State *g, lua_State *L) -{ - size_t udsize; - - gc_mark_uv(g); /* Need to remark open upvalues (the thread may be dead). */ - gc_propagate_gray(g); /* Propagate any left-overs. */ - - setgcrefr(g->gc.gray, g->gc.weak); /* Empty the list of weak tables. */ - setgcrefnull(g->gc.weak); - lua_assert(!iswhite(obj2gco(mainthread(g)))); - gc_markobj(g, L); /* Mark running thread. */ - gc_traverse_curtrace(g); /* Traverse current trace. */ - gc_mark_gcroot(g); /* Mark GC roots (again). */ - gc_propagate_gray(g); /* Propagate all of the above. */ - - setgcrefr(g->gc.gray, g->gc.grayagain); /* Empty the 2nd chance list. */ - setgcrefnull(g->gc.grayagain); - gc_propagate_gray(g); /* Propagate it. */ - - udsize = lj_gc_separateudata(g, 0); /* Separate userdata to be finalized. */ - gc_mark_mmudata(g); /* Mark them. */ - udsize += gc_propagate_gray(g); /* And propagate the marks. */ - - /* All marking done, clear weak tables. */ - gc_clearweak(gcref(g->gc.weak)); - - /* Prepare for sweep phase. */ - g->gc.currentwhite = (uint8_t)otherwhite(g); /* Flip current white. */ - g->strempty.marked = g->gc.currentwhite; - setmref(g->gc.sweep, &g->gc.root); - g->gc.estimate = g->gc.total - (MSize)udsize; /* Initial estimate. */ -} - -/* GC state machine. Returns a cost estimate for each step performed. */ -static size_t gc_onestep(lua_State *L) -{ - global_State *g = G(L); - switch (g->gc.state) { - case GCSpause: - gc_mark_start(g); /* Start a new GC cycle by marking all GC roots. */ - return 0; - case GCSpropagate: - if (gcref(g->gc.gray) != NULL) - return propagatemark(g); /* Propagate one gray object. */ - g->gc.state = GCSatomic; /* End of mark phase. */ - return 0; - case GCSatomic: - if (gcref(g->jit_L)) /* Don't run atomic phase on trace. */ - return LJ_MAX_MEM; - atomic(g, L); - g->gc.state = GCSsweepstring; /* Start of sweep phase. */ - g->gc.sweepstr = 0; - return 0; - case GCSsweepstring: { - MSize old = g->gc.total; - gc_fullsweep(g, &g->strhash[g->gc.sweepstr++]); /* Sweep one chain. */ - if (g->gc.sweepstr > g->strmask) - g->gc.state = GCSsweep; /* All string hash chains sweeped. */ - lua_assert(old >= g->gc.total); - g->gc.estimate -= old - g->gc.total; - return GCSWEEPCOST; - } - case GCSsweep: { - MSize old = g->gc.total; - setmref(g->gc.sweep, gc_sweep(g, mref(g->gc.sweep, GCRef), GCSWEEPMAX)); - lua_assert(old >= g->gc.total); - g->gc.estimate -= old - g->gc.total; - if (gcref(*mref(g->gc.sweep, GCRef)) == NULL) { - gc_shrink(g, L); - if (gcref(g->gc.mmudata)) { /* Need any finalizations? */ - g->gc.state = GCSfinalize; -#if LJ_HASFFI - g->gc.nocdatafin = 1; -#endif - } else { /* Otherwise skip this phase to help the JIT. */ - g->gc.state = GCSpause; /* End of GC cycle. */ - g->gc.debt = 0; - } - } - return GCSWEEPMAX*GCSWEEPCOST; - } - case GCSfinalize: - if (gcref(g->gc.mmudata) != NULL) { - if (gcref(g->jit_L)) /* Don't call finalizers on trace. */ - return LJ_MAX_MEM; - gc_finalize(L); /* Finalize one userdata object. */ - if (g->gc.estimate > GCFINALIZECOST) - g->gc.estimate -= GCFINALIZECOST; - return GCFINALIZECOST; - } -#if LJ_HASFFI - if (!g->gc.nocdatafin) lj_tab_rehash(L, ctype_ctsG(g)->finalizer); -#endif - g->gc.state = GCSpause; /* End of GC cycle. */ - g->gc.debt = 0; - return 0; - default: - lua_assert(0); - return 0; - } -} - -/* Perform a limited amount of incremental GC steps. */ -int LJ_FASTCALL lj_gc_step(lua_State *L) -{ - global_State *g = G(L); - MSize lim; - int32_t ostate = g->vmstate; - setvmstate(g, GC); - lim = (GCSTEPSIZE/100) * g->gc.stepmul; - if (lim == 0) - lim = LJ_MAX_MEM; - if (g->gc.total > g->gc.threshold) - g->gc.debt += g->gc.total - g->gc.threshold; - do { - lim -= (MSize)gc_onestep(L); - if (g->gc.state == GCSpause) { - g->gc.threshold = (g->gc.estimate/100) * g->gc.pause; - g->vmstate = ostate; - return 1; /* Finished a GC cycle. */ - } - } while ((int32_t)lim > 0); - if (g->gc.debt < GCSTEPSIZE) { - g->gc.threshold = g->gc.total + GCSTEPSIZE; - g->vmstate = ostate; - return -1; - } else { - g->gc.debt -= GCSTEPSIZE; - g->gc.threshold = g->gc.total; - g->vmstate = ostate; - return 0; - } -} - -/* Ditto, but fix the stack top first. */ -void LJ_FASTCALL lj_gc_step_fixtop(lua_State *L) -{ - if (curr_funcisL(L)) L->top = curr_topL(L); - lj_gc_step(L); -} - -#if LJ_HASJIT -/* Perform multiple GC steps. Called from JIT-compiled code. */ -int LJ_FASTCALL lj_gc_step_jit(global_State *g, MSize steps) -{ - lua_State *L = gco2th(gcref(g->jit_L)); - L->base = mref(G(L)->jit_base, TValue); - L->top = curr_topL(L); - while (steps-- > 0 && lj_gc_step(L) == 0) - ; - /* Return 1 to force a trace exit. */ - return (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize); -} -#endif - -/* Perform a full GC cycle. */ -void lj_gc_fullgc(lua_State *L) -{ - global_State *g = G(L); - int32_t ostate = g->vmstate; - setvmstate(g, GC); - if (g->gc.state <= GCSatomic) { /* Caught somewhere in the middle. */ - setmref(g->gc.sweep, &g->gc.root); /* Sweep everything (preserving it). */ - setgcrefnull(g->gc.gray); /* Reset lists from partial propagation. */ - setgcrefnull(g->gc.grayagain); - setgcrefnull(g->gc.weak); - g->gc.state = GCSsweepstring; /* Fast forward to the sweep phase. */ - g->gc.sweepstr = 0; - } - while (g->gc.state == GCSsweepstring || g->gc.state == GCSsweep) - gc_onestep(L); /* Finish sweep. */ - lua_assert(g->gc.state == GCSfinalize || g->gc.state == GCSpause); - /* Now perform a full GC. */ - g->gc.state = GCSpause; - do { gc_onestep(L); } while (g->gc.state != GCSpause); - g->gc.threshold = (g->gc.estimate/100) * g->gc.pause; - g->vmstate = ostate; -} - -/* -- Write barriers ------------------------------------------------------ */ - -/* Move the GC propagation frontier forward. */ -void lj_gc_barrierf(global_State *g, GCobj *o, GCobj *v) -{ - lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); - lua_assert(g->gc.state != GCSfinalize && g->gc.state != GCSpause); - lua_assert(o->gch.gct != ~LJ_TTAB); - /* Preserve invariant during propagation. Otherwise it doesn't matter. */ - if (g->gc.state == GCSpropagate || g->gc.state == GCSatomic) - gc_mark(g, v); /* Move frontier forward. */ - else - makewhite(g, o); /* Make it white to avoid the following barrier. */ -} - -/* Specialized barrier for closed upvalue. Pass &uv->tv. */ -void LJ_FASTCALL lj_gc_barrieruv(global_State *g, TValue *tv) -{ -#define TV2MARKED(x) \ - (*((uint8_t *)(x) - offsetof(GCupval, tv) + offsetof(GCupval, marked))) - if (g->gc.state == GCSpropagate || g->gc.state == GCSatomic) - gc_mark(g, gcV(tv)); - else - TV2MARKED(tv) = (TV2MARKED(tv) & (uint8_t)~LJ_GC_COLORS) | curwhite(g); -#undef TV2MARKED -} - -/* Close upvalue. Also needs a write barrier. */ -void lj_gc_closeuv(global_State *g, GCupval *uv) -{ - GCobj *o = obj2gco(uv); - /* Copy stack slot to upvalue itself and point to the copy. */ - copyTV(mainthread(g), &uv->tv, uvval(uv)); - setmref(uv->v, &uv->tv); - uv->closed = 1; - setgcrefr(o->gch.nextgc, g->gc.root); - setgcref(g->gc.root, o); - if (isgray(o)) { /* A closed upvalue is never gray, so fix this. */ - if (g->gc.state == GCSpropagate || g->gc.state == GCSatomic) { - gray2black(o); /* Make it black and preserve invariant. */ - if (tviswhite(&uv->tv)) - lj_gc_barrierf(g, o, gcV(&uv->tv)); - } else { - makewhite(g, o); /* Make it white, i.e. sweep the upvalue. */ - lua_assert(g->gc.state != GCSfinalize && g->gc.state != GCSpause); - } - } -} - -#if LJ_HASJIT -/* Mark a trace if it's saved during the propagation phase. */ -void lj_gc_barriertrace(global_State *g, uint32_t traceno) -{ - if (g->gc.state == GCSpropagate || g->gc.state == GCSatomic) - gc_marktrace(g, traceno); -} -#endif - -/* -- Allocator ----------------------------------------------------------- */ - -/* Call pluggable memory allocator to allocate or resize a fragment. */ -void *lj_mem_realloc(lua_State *L, void *p, MSize osz, MSize nsz) -{ - global_State *g = G(L); - lua_assert((osz == 0) == (p == NULL)); - p = g->allocf(g->allocd, p, osz, nsz); - if (p == NULL && nsz > 0) - lj_err_mem(L); - lua_assert((nsz == 0) == (p == NULL)); - lua_assert(checkptr32(p)); - g->gc.total = (g->gc.total - osz) + nsz; - return p; -} - -/* Allocate new GC object and link it to the root set. */ -void * LJ_FASTCALL lj_mem_newgco(lua_State *L, MSize size) -{ - global_State *g = G(L); - GCobj *o = (GCobj *)g->allocf(g->allocd, NULL, 0, size); - if (o == NULL) - lj_err_mem(L); - lua_assert(checkptr32(o)); - g->gc.total += size; - setgcrefr(o->gch.nextgc, g->gc.root); - setgcref(g->gc.root, o); - newwhite(g, o); - return o; -} - -/* Resize growable vector. */ -void *lj_mem_grow(lua_State *L, void *p, MSize *szp, MSize lim, MSize esz) -{ - MSize sz = (*szp) << 1; - if (sz < LJ_MIN_VECSZ) - sz = LJ_MIN_VECSZ; - if (sz > lim) - sz = lim; - p = lj_mem_realloc(L, p, (*szp)*esz, sz*esz); - *szp = sz; - return p; -} - diff --git a/subprojects/luajit/src/lj_gc.h b/subprojects/luajit/src/lj_gc.h deleted file mode 100644 index 57ac7147b..000000000 --- a/subprojects/luajit/src/lj_gc.h +++ /dev/null @@ -1,134 +0,0 @@ -/* -** Garbage collector. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_GC_H -#define _LJ_GC_H - -#include "lj_obj.h" - -/* Garbage collector states. Order matters. */ -enum { - GCSpause, GCSpropagate, GCSatomic, GCSsweepstring, GCSsweep, GCSfinalize -}; - -/* Bitmasks for marked field of GCobj. */ -#define LJ_GC_WHITE0 0x01 -#define LJ_GC_WHITE1 0x02 -#define LJ_GC_BLACK 0x04 -#define LJ_GC_FINALIZED 0x08 -#define LJ_GC_WEAKKEY 0x08 -#define LJ_GC_WEAKVAL 0x10 -#define LJ_GC_CDATA_FIN 0x10 -#define LJ_GC_FIXED 0x20 -#define LJ_GC_SFIXED 0x40 - -#define LJ_GC_WHITES (LJ_GC_WHITE0 | LJ_GC_WHITE1) -#define LJ_GC_COLORS (LJ_GC_WHITES | LJ_GC_BLACK) -#define LJ_GC_WEAK (LJ_GC_WEAKKEY | LJ_GC_WEAKVAL) - -/* Macros to test and set GCobj colors. */ -#define iswhite(x) ((x)->gch.marked & LJ_GC_WHITES) -#define isblack(x) ((x)->gch.marked & LJ_GC_BLACK) -#define isgray(x) (!((x)->gch.marked & (LJ_GC_BLACK|LJ_GC_WHITES))) -#define tviswhite(x) (tvisgcv(x) && iswhite(gcV(x))) -#define otherwhite(g) (g->gc.currentwhite ^ LJ_GC_WHITES) -#define isdead(g, v) ((v)->gch.marked & otherwhite(g) & LJ_GC_WHITES) - -#define curwhite(g) ((g)->gc.currentwhite & LJ_GC_WHITES) -#define newwhite(g, x) (obj2gco(x)->gch.marked = (uint8_t)curwhite(g)) -#define makewhite(g, x) \ - ((x)->gch.marked = ((x)->gch.marked & (uint8_t)~LJ_GC_COLORS) | curwhite(g)) -#define flipwhite(x) ((x)->gch.marked ^= LJ_GC_WHITES) -#define black2gray(x) ((x)->gch.marked &= (uint8_t)~LJ_GC_BLACK) -#define fixstring(s) ((s)->marked |= LJ_GC_FIXED) -#define markfinalized(x) ((x)->gch.marked |= LJ_GC_FINALIZED) - -/* Collector. */ -LJ_FUNC size_t lj_gc_separateudata(global_State *g, int all); -LJ_FUNC void lj_gc_finalize_udata(lua_State *L); -#if LJ_HASFFI -LJ_FUNC void lj_gc_finalize_cdata(lua_State *L); -#else -#define lj_gc_finalize_cdata(L) UNUSED(L) -#endif -LJ_FUNC void lj_gc_freeall(global_State *g); -LJ_FUNCA int LJ_FASTCALL lj_gc_step(lua_State *L); -LJ_FUNCA void LJ_FASTCALL lj_gc_step_fixtop(lua_State *L); -#if LJ_HASJIT -LJ_FUNC int LJ_FASTCALL lj_gc_step_jit(global_State *g, MSize steps); -#endif -LJ_FUNC void lj_gc_fullgc(lua_State *L); - -/* GC check: drive collector forward if the GC threshold has been reached. */ -#define lj_gc_check(L) \ - { if (LJ_UNLIKELY(G(L)->gc.total >= G(L)->gc.threshold)) \ - lj_gc_step(L); } -#define lj_gc_check_fixtop(L) \ - { if (LJ_UNLIKELY(G(L)->gc.total >= G(L)->gc.threshold)) \ - lj_gc_step_fixtop(L); } - -/* Write barriers. */ -LJ_FUNC void lj_gc_barrierf(global_State *g, GCobj *o, GCobj *v); -LJ_FUNCA void LJ_FASTCALL lj_gc_barrieruv(global_State *g, TValue *tv); -LJ_FUNC void lj_gc_closeuv(global_State *g, GCupval *uv); -#if LJ_HASJIT -LJ_FUNC void lj_gc_barriertrace(global_State *g, uint32_t traceno); -#endif - -/* Move the GC propagation frontier back for tables (make it gray again). */ -static LJ_AINLINE void lj_gc_barrierback(global_State *g, GCtab *t) -{ - GCobj *o = obj2gco(t); - lua_assert(isblack(o) && !isdead(g, o)); - lua_assert(g->gc.state != GCSfinalize && g->gc.state != GCSpause); - black2gray(o); - setgcrefr(t->gclist, g->gc.grayagain); - setgcref(g->gc.grayagain, o); -} - -/* Barrier for stores to table objects. TValue and GCobj variant. */ -#define lj_gc_anybarriert(L, t) \ - { if (LJ_UNLIKELY(isblack(obj2gco(t)))) lj_gc_barrierback(G(L), (t)); } -#define lj_gc_barriert(L, t, tv) \ - { if (tviswhite(tv) && isblack(obj2gco(t))) \ - lj_gc_barrierback(G(L), (t)); } -#define lj_gc_objbarriert(L, t, o) \ - { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) \ - lj_gc_barrierback(G(L), (t)); } - -/* Barrier for stores to any other object. TValue and GCobj variant. */ -#define lj_gc_barrier(L, p, tv) \ - { if (tviswhite(tv) && isblack(obj2gco(p))) \ - lj_gc_barrierf(G(L), obj2gco(p), gcV(tv)); } -#define lj_gc_objbarrier(L, p, o) \ - { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \ - lj_gc_barrierf(G(L), obj2gco(p), obj2gco(o)); } - -/* Allocator. */ -LJ_FUNC void *lj_mem_realloc(lua_State *L, void *p, MSize osz, MSize nsz); -LJ_FUNC void * LJ_FASTCALL lj_mem_newgco(lua_State *L, MSize size); -LJ_FUNC void *lj_mem_grow(lua_State *L, void *p, - MSize *szp, MSize lim, MSize esz); - -#define lj_mem_new(L, s) lj_mem_realloc(L, NULL, 0, (s)) - -static LJ_AINLINE void lj_mem_free(global_State *g, void *p, size_t osize) -{ - g->gc.total -= (MSize)osize; - g->allocf(g->allocd, p, osize, 0); -} - -#define lj_mem_newvec(L, n, t) ((t *)lj_mem_new(L, (MSize)((n)*sizeof(t)))) -#define lj_mem_reallocvec(L, p, on, n, t) \ - ((p) = (t *)lj_mem_realloc(L, p, (on)*sizeof(t), (MSize)((n)*sizeof(t)))) -#define lj_mem_growvec(L, p, n, m, t) \ - ((p) = (t *)lj_mem_grow(L, (p), &(n), (m), (MSize)sizeof(t))) -#define lj_mem_freevec(g, p, n, t) lj_mem_free(g, (p), (n)*sizeof(t)) - -#define lj_mem_newobj(L, t) ((t *)lj_mem_newgco(L, sizeof(t))) -#define lj_mem_newt(L, s, t) ((t *)lj_mem_new(L, (s))) -#define lj_mem_freet(g, p) lj_mem_free(g, (p), sizeof(*(p))) - -#endif diff --git a/subprojects/luajit/src/lj_gdbjit.c b/subprojects/luajit/src/lj_gdbjit.c deleted file mode 100644 index eeb017bb8..000000000 --- a/subprojects/luajit/src/lj_gdbjit.c +++ /dev/null @@ -1,795 +0,0 @@ -/* -** Client for the GDB JIT API. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_gdbjit_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_debug.h" -#include "lj_frame.h" -#include "lj_jit.h" -#include "lj_dispatch.h" - -/* This is not compiled in by default. -** Enable with -DLUAJIT_USE_GDBJIT in the Makefile and recompile everything. -*/ -#ifdef LUAJIT_USE_GDBJIT - -/* The GDB JIT API allows JIT compilers to pass debug information about -** JIT-compiled code back to GDB. You need at least GDB 7.0 or higher -** to see it in action. -** -** This is a passive API, so it works even when not running under GDB -** or when attaching to an already running process. Alas, this implies -** enabling it always has a non-negligible overhead -- do not use in -** release mode! -** -** The LuaJIT GDB JIT client is rather minimal at the moment. It gives -** each trace a symbol name and adds a source location and frame unwind -** information. Obviously LuaJIT itself and any embedding C application -** should be compiled with debug symbols, too (see the Makefile). -** -** Traces are named TRACE_1, TRACE_2, ... these correspond to the trace -** numbers from -jv or -jdump. Use "break TRACE_1" or "tbreak TRACE_1" etc. -** to set breakpoints on specific traces (even ahead of their creation). -** -** The source location for each trace allows listing the corresponding -** source lines with the GDB command "list" (but only if the Lua source -** has been loaded from a file). Currently this is always set to the -** location where the trace has been started. -** -** Frame unwind information can be inspected with the GDB command -** "info frame". This also allows proper backtraces across JIT-compiled -** code with the GDB command "bt". -** -** You probably want to add the following settings to a .gdbinit file -** (or add them to ~/.gdbinit): -** set disassembly-flavor intel -** set breakpoint pending on -** -** Here's a sample GDB session: -** ------------------------------------------------------------------------ - -$ cat >x.lua -for outer=1,100 do - for inner=1,100 do end -end -^D - -$ luajit -jv x.lua -[TRACE 1 x.lua:2] -[TRACE 2 (1/3) x.lua:1 -> 1] - -$ gdb --quiet --args luajit x.lua -(gdb) tbreak TRACE_1 -Function "TRACE_1" not defined. -Temporary breakpoint 1 (TRACE_1) pending. -(gdb) run -Starting program: luajit x.lua - -Temporary breakpoint 1, TRACE_1 () at x.lua:2 -2 for inner=1,100 do end -(gdb) list -1 for outer=1,100 do -2 for inner=1,100 do end -3 end -(gdb) bt -#0 TRACE_1 () at x.lua:2 -#1 0x08053690 in lua_pcall [...] -[...] -#7 0x0806ff90 in main [...] -(gdb) disass TRACE_1 -Dump of assembler code for function TRACE_1: -0xf7fd9fba : mov DWORD PTR ds:0xf7e0e2a0,0x1 -0xf7fd9fc4 : movsd xmm7,QWORD PTR [edx+0x20] -[...] -0xf7fd9ff8 : jmp 0xf7fd2014 -End of assembler dump. -(gdb) tbreak TRACE_2 -Function "TRACE_2" not defined. -Temporary breakpoint 2 (TRACE_2) pending. -(gdb) cont -Continuing. - -Temporary breakpoint 2, TRACE_2 () at x.lua:1 -1 for outer=1,100 do -(gdb) info frame -Stack level 0, frame at 0xffffd7c0: - eip = 0xf7fd9f60 in TRACE_2 (x.lua:1); saved eip 0x8053690 - called by frame at 0xffffd7e0 - source language unknown. - Arglist at 0xffffd78c, args: - Locals at 0xffffd78c, Previous frame's sp is 0xffffd7c0 - Saved registers: - ebx at 0xffffd7ac, ebp at 0xffffd7b8, esi at 0xffffd7b0, edi at 0xffffd7b4, - eip at 0xffffd7bc -(gdb) - -** ------------------------------------------------------------------------ -*/ - -/* -- GDB JIT API --------------------------------------------------------- */ - -/* GDB JIT actions. */ -enum { - GDBJIT_NOACTION = 0, - GDBJIT_REGISTER, - GDBJIT_UNREGISTER -}; - -/* GDB JIT entry. */ -typedef struct GDBJITentry { - struct GDBJITentry *next_entry; - struct GDBJITentry *prev_entry; - const char *symfile_addr; - uint64_t symfile_size; -} GDBJITentry; - -/* GDB JIT descriptor. */ -typedef struct GDBJITdesc { - uint32_t version; - uint32_t action_flag; - GDBJITentry *relevant_entry; - GDBJITentry *first_entry; -} GDBJITdesc; - -GDBJITdesc __jit_debug_descriptor = { - 1, GDBJIT_NOACTION, NULL, NULL -}; - -/* GDB sets a breakpoint at this function. */ -void LJ_NOINLINE __jit_debug_register_code() -{ - __asm__ __volatile__(""); -}; - -/* -- In-memory ELF object definitions ------------------------------------ */ - -/* ELF definitions. */ -typedef struct ELFheader { - uint8_t emagic[4]; - uint8_t eclass; - uint8_t eendian; - uint8_t eversion; - uint8_t eosabi; - uint8_t eabiversion; - uint8_t epad[7]; - uint16_t type; - uint16_t machine; - uint32_t version; - uintptr_t entry; - uintptr_t phofs; - uintptr_t shofs; - uint32_t flags; - uint16_t ehsize; - uint16_t phentsize; - uint16_t phnum; - uint16_t shentsize; - uint16_t shnum; - uint16_t shstridx; -} ELFheader; - -typedef struct ELFsectheader { - uint32_t name; - uint32_t type; - uintptr_t flags; - uintptr_t addr; - uintptr_t ofs; - uintptr_t size; - uint32_t link; - uint32_t info; - uintptr_t align; - uintptr_t entsize; -} ELFsectheader; - -#define ELFSECT_IDX_ABS 0xfff1 - -enum { - ELFSECT_TYPE_PROGBITS = 1, - ELFSECT_TYPE_SYMTAB = 2, - ELFSECT_TYPE_STRTAB = 3, - ELFSECT_TYPE_NOBITS = 8 -}; - -#define ELFSECT_FLAGS_WRITE 1 -#define ELFSECT_FLAGS_ALLOC 2 -#define ELFSECT_FLAGS_EXEC 4 - -typedef struct ELFsymbol { -#if LJ_64 - uint32_t name; - uint8_t info; - uint8_t other; - uint16_t sectidx; - uintptr_t value; - uint64_t size; -#else - uint32_t name; - uintptr_t value; - uint32_t size; - uint8_t info; - uint8_t other; - uint16_t sectidx; -#endif -} ELFsymbol; - -enum { - ELFSYM_TYPE_FUNC = 2, - ELFSYM_TYPE_FILE = 4, - ELFSYM_BIND_LOCAL = 0 << 4, - ELFSYM_BIND_GLOBAL = 1 << 4, -}; - -/* DWARF definitions. */ -#define DW_CIE_VERSION 1 - -enum { - DW_CFA_nop = 0x0, - DW_CFA_offset_extended = 0x5, - DW_CFA_def_cfa = 0xc, - DW_CFA_def_cfa_offset = 0xe, - DW_CFA_offset_extended_sf = 0x11, - DW_CFA_advance_loc = 0x40, - DW_CFA_offset = 0x80 -}; - -enum { - DW_EH_PE_udata4 = 3, - DW_EH_PE_textrel = 0x20 -}; - -enum { - DW_TAG_compile_unit = 0x11 -}; - -enum { - DW_children_no = 0, - DW_children_yes = 1 -}; - -enum { - DW_AT_name = 0x03, - DW_AT_stmt_list = 0x10, - DW_AT_low_pc = 0x11, - DW_AT_high_pc = 0x12 -}; - -enum { - DW_FORM_addr = 0x01, - DW_FORM_data4 = 0x06, - DW_FORM_string = 0x08 -}; - -enum { - DW_LNS_extended_op = 0, - DW_LNS_copy = 1, - DW_LNS_advance_pc = 2, - DW_LNS_advance_line = 3 -}; - -enum { - DW_LNE_end_sequence = 1, - DW_LNE_set_address = 2 -}; - -enum { -#if LJ_TARGET_X86 - DW_REG_AX, DW_REG_CX, DW_REG_DX, DW_REG_BX, - DW_REG_SP, DW_REG_BP, DW_REG_SI, DW_REG_DI, - DW_REG_RA, -#elif LJ_TARGET_X64 - /* Yes, the order is strange, but correct. */ - DW_REG_AX, DW_REG_DX, DW_REG_CX, DW_REG_BX, - DW_REG_SI, DW_REG_DI, DW_REG_BP, DW_REG_SP, - DW_REG_8, DW_REG_9, DW_REG_10, DW_REG_11, - DW_REG_12, DW_REG_13, DW_REG_14, DW_REG_15, - DW_REG_RA, -#elif LJ_TARGET_ARM - DW_REG_SP = 13, - DW_REG_RA = 14, -#elif LJ_TARGET_PPC - DW_REG_SP = 1, - DW_REG_RA = 65, - DW_REG_CR = 70, -#elif LJ_TARGET_MIPS - DW_REG_SP = 29, - DW_REG_RA = 31, -#else -#error "Unsupported target architecture" -#endif -}; - -/* Minimal list of sections for the in-memory ELF object. */ -enum { - GDBJIT_SECT_NULL, - GDBJIT_SECT_text, - GDBJIT_SECT_eh_frame, - GDBJIT_SECT_shstrtab, - GDBJIT_SECT_strtab, - GDBJIT_SECT_symtab, - GDBJIT_SECT_debug_info, - GDBJIT_SECT_debug_abbrev, - GDBJIT_SECT_debug_line, - GDBJIT_SECT__MAX -}; - -enum { - GDBJIT_SYM_UNDEF, - GDBJIT_SYM_FILE, - GDBJIT_SYM_FUNC, - GDBJIT_SYM__MAX -}; - -/* In-memory ELF object. */ -typedef struct GDBJITobj { - ELFheader hdr; /* ELF header. */ - ELFsectheader sect[GDBJIT_SECT__MAX]; /* ELF sections. */ - ELFsymbol sym[GDBJIT_SYM__MAX]; /* ELF symbol table. */ - uint8_t space[4096]; /* Space for various section data. */ -} GDBJITobj; - -/* Combined structure for GDB JIT entry and ELF object. */ -typedef struct GDBJITentryobj { - GDBJITentry entry; - size_t sz; - GDBJITobj obj; -} GDBJITentryobj; - -/* Template for in-memory ELF header. */ -static const ELFheader elfhdr_template = { - .emagic = { 0x7f, 'E', 'L', 'F' }, - .eclass = LJ_64 ? 2 : 1, - .eendian = LJ_ENDIAN_SELECT(1, 2), - .eversion = 1, -#if LJ_TARGET_LINUX - .eosabi = 0, /* Nope, it's not 3. */ -#elif defined(__FreeBSD__) - .eosabi = 9, -#elif defined(__NetBSD__) - .eosabi = 2, -#elif defined(__OpenBSD__) - .eosabi = 12, -#elif defined(__DragonFly__) - .eosabi = 0, -#elif (defined(__sun__) && defined(__svr4__)) - .eosabi = 6, -#else - .eosabi = 0, -#endif - .eabiversion = 0, - .epad = { 0, 0, 0, 0, 0, 0, 0 }, - .type = 1, -#if LJ_TARGET_X86 - .machine = 3, -#elif LJ_TARGET_X64 - .machine = 62, -#elif LJ_TARGET_ARM - .machine = 40, -#elif LJ_TARGET_PPC - .machine = 20, -#elif LJ_TARGET_MIPS - .machine = 8, -#else -#error "Unsupported target architecture" -#endif - .version = 1, - .entry = 0, - .phofs = 0, - .shofs = offsetof(GDBJITobj, sect), - .flags = 0, - .ehsize = sizeof(ELFheader), - .phentsize = 0, - .phnum = 0, - .shentsize = sizeof(ELFsectheader), - .shnum = GDBJIT_SECT__MAX, - .shstridx = GDBJIT_SECT_shstrtab -}; - -/* -- In-memory ELF object generation ------------------------------------- */ - -/* Context for generating the ELF object for the GDB JIT API. */ -typedef struct GDBJITctx { - uint8_t *p; /* Pointer to next address in obj.space. */ - uint8_t *startp; /* Pointer to start address in obj.space. */ - GCtrace *T; /* Generate symbols for this trace. */ - uintptr_t mcaddr; /* Machine code address. */ - MSize szmcode; /* Size of machine code. */ - MSize spadjp; /* Stack adjustment for parent trace or interpreter. */ - MSize spadj; /* Stack adjustment for trace itself. */ - BCLine lineno; /* Starting line number. */ - const char *filename; /* Starting file name. */ - size_t objsize; /* Final size of ELF object. */ - GDBJITobj obj; /* In-memory ELF object. */ -} GDBJITctx; - -/* Add a zero-terminated string. */ -static uint32_t gdbjit_strz(GDBJITctx *ctx, const char *str) -{ - uint8_t *p = ctx->p; - uint32_t ofs = (uint32_t)(p - ctx->startp); - do { - *p++ = (uint8_t)*str; - } while (*str++); - ctx->p = p; - return ofs; -} - -/* Append a decimal number. */ -static void gdbjit_catnum(GDBJITctx *ctx, uint32_t n) -{ - if (n >= 10) { uint32_t m = n / 10; n = n % 10; gdbjit_catnum(ctx, m); } - *ctx->p++ = '0' + n; -} - -/* Add a ULEB128 value. */ -static void gdbjit_uleb128(GDBJITctx *ctx, uint32_t v) -{ - uint8_t *p = ctx->p; - for (; v >= 0x80; v >>= 7) - *p++ = (uint8_t)((v & 0x7f) | 0x80); - *p++ = (uint8_t)v; - ctx->p = p; -} - -/* Add a SLEB128 value. */ -static void gdbjit_sleb128(GDBJITctx *ctx, int32_t v) -{ - uint8_t *p = ctx->p; - for (; (uint32_t)(v+0x40) >= 0x80; v >>= 7) - *p++ = (uint8_t)((v & 0x7f) | 0x80); - *p++ = (uint8_t)(v & 0x7f); - ctx->p = p; -} - -/* Shortcuts to generate DWARF structures. */ -#define DB(x) (*p++ = (x)) -#define DI8(x) (*(int8_t *)p = (x), p++) -#define DU16(x) (*(uint16_t *)p = (x), p += 2) -#define DU32(x) (*(uint32_t *)p = (x), p += 4) -#define DADDR(x) (*(uintptr_t *)p = (x), p += sizeof(uintptr_t)) -#define DUV(x) (ctx->p = p, gdbjit_uleb128(ctx, (x)), p = ctx->p) -#define DSV(x) (ctx->p = p, gdbjit_sleb128(ctx, (x)), p = ctx->p) -#define DSTR(str) (ctx->p = p, gdbjit_strz(ctx, (str)), p = ctx->p) -#define DALIGNNOP(s) while ((uintptr_t)p & ((s)-1)) *p++ = DW_CFA_nop -#define DSECT(name, stmt) \ - { uint32_t *szp_##name = (uint32_t *)p; p += 4; stmt \ - *szp_##name = (uint32_t)((p-(uint8_t *)szp_##name)-4); } \ - -/* Initialize ELF section headers. */ -static void LJ_FASTCALL gdbjit_secthdr(GDBJITctx *ctx) -{ - ELFsectheader *sect; - - *ctx->p++ = '\0'; /* Empty string at start of string table. */ - -#define SECTDEF(id, tp, al) \ - sect = &ctx->obj.sect[GDBJIT_SECT_##id]; \ - sect->name = gdbjit_strz(ctx, "." #id); \ - sect->type = ELFSECT_TYPE_##tp; \ - sect->align = (al) - - SECTDEF(text, NOBITS, 16); - sect->flags = ELFSECT_FLAGS_ALLOC|ELFSECT_FLAGS_EXEC; - sect->addr = ctx->mcaddr; - sect->ofs = 0; - sect->size = ctx->szmcode; - - SECTDEF(eh_frame, PROGBITS, sizeof(uintptr_t)); - sect->flags = ELFSECT_FLAGS_ALLOC; - - SECTDEF(shstrtab, STRTAB, 1); - SECTDEF(strtab, STRTAB, 1); - - SECTDEF(symtab, SYMTAB, sizeof(uintptr_t)); - sect->ofs = offsetof(GDBJITobj, sym); - sect->size = sizeof(ctx->obj.sym); - sect->link = GDBJIT_SECT_strtab; - sect->entsize = sizeof(ELFsymbol); - sect->info = GDBJIT_SYM_FUNC; - - SECTDEF(debug_info, PROGBITS, 1); - SECTDEF(debug_abbrev, PROGBITS, 1); - SECTDEF(debug_line, PROGBITS, 1); - -#undef SECTDEF -} - -/* Initialize symbol table. */ -static void LJ_FASTCALL gdbjit_symtab(GDBJITctx *ctx) -{ - ELFsymbol *sym; - - *ctx->p++ = '\0'; /* Empty string at start of string table. */ - - sym = &ctx->obj.sym[GDBJIT_SYM_FILE]; - sym->name = gdbjit_strz(ctx, "JIT mcode"); - sym->sectidx = ELFSECT_IDX_ABS; - sym->info = ELFSYM_TYPE_FILE|ELFSYM_BIND_LOCAL; - - sym = &ctx->obj.sym[GDBJIT_SYM_FUNC]; - sym->name = gdbjit_strz(ctx, "TRACE_"); ctx->p--; - gdbjit_catnum(ctx, ctx->T->traceno); *ctx->p++ = '\0'; - sym->sectidx = GDBJIT_SECT_text; - sym->value = 0; - sym->size = ctx->szmcode; - sym->info = ELFSYM_TYPE_FUNC|ELFSYM_BIND_GLOBAL; -} - -/* Initialize .eh_frame section. */ -static void LJ_FASTCALL gdbjit_ehframe(GDBJITctx *ctx) -{ - uint8_t *p = ctx->p; - uint8_t *framep = p; - - /* Emit DWARF EH CIE. */ - DSECT(CIE, - DU32(0); /* Offset to CIE itself. */ - DB(DW_CIE_VERSION); - DSTR("zR"); /* Augmentation. */ - DUV(1); /* Code alignment factor. */ - DSV(-(int32_t)sizeof(uintptr_t)); /* Data alignment factor. */ - DB(DW_REG_RA); /* Return address register. */ - DB(1); DB(DW_EH_PE_textrel|DW_EH_PE_udata4); /* Augmentation data. */ - DB(DW_CFA_def_cfa); DUV(DW_REG_SP); DUV(sizeof(uintptr_t)); -#if LJ_TARGET_PPC - DB(DW_CFA_offset_extended_sf); DB(DW_REG_RA); DSV(-1); -#else - DB(DW_CFA_offset|DW_REG_RA); DUV(1); -#endif - DALIGNNOP(sizeof(uintptr_t)); - ) - - /* Emit DWARF EH FDE. */ - DSECT(FDE, - DU32((uint32_t)(p-framep)); /* Offset to CIE. */ - DU32(0); /* Machine code offset relative to .text. */ - DU32(ctx->szmcode); /* Machine code length. */ - DB(0); /* Augmentation data. */ - /* Registers saved in CFRAME. */ -#if LJ_TARGET_X86 - DB(DW_CFA_offset|DW_REG_BP); DUV(2); - DB(DW_CFA_offset|DW_REG_DI); DUV(3); - DB(DW_CFA_offset|DW_REG_SI); DUV(4); - DB(DW_CFA_offset|DW_REG_BX); DUV(5); -#elif LJ_TARGET_X64 - DB(DW_CFA_offset|DW_REG_BP); DUV(2); - DB(DW_CFA_offset|DW_REG_BX); DUV(3); - DB(DW_CFA_offset|DW_REG_15); DUV(4); - DB(DW_CFA_offset|DW_REG_14); DUV(5); - /* Extra registers saved for JIT-compiled code. */ - DB(DW_CFA_offset|DW_REG_13); DUV(9); - DB(DW_CFA_offset|DW_REG_12); DUV(10); -#elif LJ_TARGET_ARM - { - int i; - for (i = 11; i >= 4; i--) { DB(DW_CFA_offset|i); DUV(2+(11-i)); } - } -#elif LJ_TARGET_PPC - { - int i; - DB(DW_CFA_offset_extended); DB(DW_REG_CR); DUV(55); - for (i = 14; i <= 31; i++) { - DB(DW_CFA_offset|i); DUV(37+(31-i)); - DB(DW_CFA_offset|32|i); DUV(2+2*(31-i)); - } - } -#elif LJ_TARGET_MIPS - { - int i; - DB(DW_CFA_offset|30); DUV(2); - for (i = 23; i >= 16; i--) { DB(DW_CFA_offset|i); DUV(26-i); } - for (i = 30; i >= 20; i -= 2) { DB(DW_CFA_offset|32|i); DUV(42-i); } - } -#else -#error "Unsupported target architecture" -#endif - if (ctx->spadjp != ctx->spadj) { /* Parent/interpreter stack frame size. */ - DB(DW_CFA_def_cfa_offset); DUV(ctx->spadjp); - DB(DW_CFA_advance_loc|1); /* Only an approximation. */ - } - DB(DW_CFA_def_cfa_offset); DUV(ctx->spadj); /* Trace stack frame size. */ - DALIGNNOP(sizeof(uintptr_t)); - ) - - ctx->p = p; -} - -/* Initialize .debug_info section. */ -static void LJ_FASTCALL gdbjit_debuginfo(GDBJITctx *ctx) -{ - uint8_t *p = ctx->p; - - DSECT(info, - DU16(2); /* DWARF version. */ - DU32(0); /* Abbrev offset. */ - DB(sizeof(uintptr_t)); /* Pointer size. */ - - DUV(1); /* Abbrev #1: DW_TAG_compile_unit. */ - DSTR(ctx->filename); /* DW_AT_name. */ - DADDR(ctx->mcaddr); /* DW_AT_low_pc. */ - DADDR(ctx->mcaddr + ctx->szmcode); /* DW_AT_high_pc. */ - DU32(0); /* DW_AT_stmt_list. */ - ) - - ctx->p = p; -} - -/* Initialize .debug_abbrev section. */ -static void LJ_FASTCALL gdbjit_debugabbrev(GDBJITctx *ctx) -{ - uint8_t *p = ctx->p; - - /* Abbrev #1: DW_TAG_compile_unit. */ - DUV(1); DUV(DW_TAG_compile_unit); - DB(DW_children_no); - DUV(DW_AT_name); DUV(DW_FORM_string); - DUV(DW_AT_low_pc); DUV(DW_FORM_addr); - DUV(DW_AT_high_pc); DUV(DW_FORM_addr); - DUV(DW_AT_stmt_list); DUV(DW_FORM_data4); - DB(0); DB(0); - - ctx->p = p; -} - -#define DLNE(op, s) (DB(DW_LNS_extended_op), DUV(1+(s)), DB((op))) - -/* Initialize .debug_line section. */ -static void LJ_FASTCALL gdbjit_debugline(GDBJITctx *ctx) -{ - uint8_t *p = ctx->p; - - DSECT(line, - DU16(2); /* DWARF version. */ - DSECT(header, - DB(1); /* Minimum instruction length. */ - DB(1); /* is_stmt. */ - DI8(0); /* Line base for special opcodes. */ - DB(2); /* Line range for special opcodes. */ - DB(3+1); /* Opcode base at DW_LNS_advance_line+1. */ - DB(0); DB(1); DB(1); /* Standard opcode lengths. */ - /* Directory table. */ - DB(0); - /* File name table. */ - DSTR(ctx->filename); DUV(0); DUV(0); DUV(0); - DB(0); - ) - - DLNE(DW_LNE_set_address, sizeof(uintptr_t)); DADDR(ctx->mcaddr); - if (ctx->lineno) { - DB(DW_LNS_advance_line); DSV(ctx->lineno-1); - } - DB(DW_LNS_copy); - DB(DW_LNS_advance_pc); DUV(ctx->szmcode); - DLNE(DW_LNE_end_sequence, 0); - ) - - ctx->p = p; -} - -#undef DLNE - -/* Undef shortcuts. */ -#undef DB -#undef DI8 -#undef DU16 -#undef DU32 -#undef DADDR -#undef DUV -#undef DSV -#undef DSTR -#undef DALIGNNOP -#undef DSECT - -/* Type of a section initializer callback. */ -typedef void (LJ_FASTCALL *GDBJITinitf)(GDBJITctx *ctx); - -/* Call section initializer and set the section offset and size. */ -static void gdbjit_initsect(GDBJITctx *ctx, int sect, GDBJITinitf initf) -{ - ctx->startp = ctx->p; - ctx->obj.sect[sect].ofs = (uintptr_t)((char *)ctx->p - (char *)&ctx->obj); - initf(ctx); - ctx->obj.sect[sect].size = (uintptr_t)(ctx->p - ctx->startp); -} - -#define SECTALIGN(p, a) \ - ((p) = (uint8_t *)(((uintptr_t)(p) + ((a)-1)) & ~(uintptr_t)((a)-1))) - -/* Build in-memory ELF object. */ -static void gdbjit_buildobj(GDBJITctx *ctx) -{ - GDBJITobj *obj = &ctx->obj; - /* Fill in ELF header and clear structures. */ - memcpy(&obj->hdr, &elfhdr_template, sizeof(ELFheader)); - memset(&obj->sect, 0, sizeof(ELFsectheader)*GDBJIT_SECT__MAX); - memset(&obj->sym, 0, sizeof(ELFsymbol)*GDBJIT_SYM__MAX); - /* Initialize sections. */ - ctx->p = obj->space; - gdbjit_initsect(ctx, GDBJIT_SECT_shstrtab, gdbjit_secthdr); - gdbjit_initsect(ctx, GDBJIT_SECT_strtab, gdbjit_symtab); - gdbjit_initsect(ctx, GDBJIT_SECT_debug_info, gdbjit_debuginfo); - gdbjit_initsect(ctx, GDBJIT_SECT_debug_abbrev, gdbjit_debugabbrev); - gdbjit_initsect(ctx, GDBJIT_SECT_debug_line, gdbjit_debugline); - SECTALIGN(ctx->p, sizeof(uintptr_t)); - gdbjit_initsect(ctx, GDBJIT_SECT_eh_frame, gdbjit_ehframe); - ctx->objsize = (size_t)((char *)ctx->p - (char *)obj); - lua_assert(ctx->objsize < sizeof(GDBJITobj)); -} - -#undef SECTALIGN - -/* -- Interface to GDB JIT API -------------------------------------------- */ - -/* Add new entry to GDB JIT symbol chain. */ -static void gdbjit_newentry(lua_State *L, GDBJITctx *ctx) -{ - /* Allocate memory for GDB JIT entry and ELF object. */ - MSize sz = (MSize)(sizeof(GDBJITentryobj) - sizeof(GDBJITobj) + ctx->objsize); - GDBJITentryobj *eo = lj_mem_newt(L, sz, GDBJITentryobj); - memcpy(&eo->obj, &ctx->obj, ctx->objsize); /* Copy ELF object. */ - eo->sz = sz; - ctx->T->gdbjit_entry = (void *)eo; - /* Link new entry to chain and register it. */ - eo->entry.prev_entry = NULL; - eo->entry.next_entry = __jit_debug_descriptor.first_entry; - if (eo->entry.next_entry) - eo->entry.next_entry->prev_entry = &eo->entry; - eo->entry.symfile_addr = (const char *)&eo->obj; - eo->entry.symfile_size = ctx->objsize; - __jit_debug_descriptor.first_entry = &eo->entry; - __jit_debug_descriptor.relevant_entry = &eo->entry; - __jit_debug_descriptor.action_flag = GDBJIT_REGISTER; - __jit_debug_register_code(); -} - -/* Add debug info for newly compiled trace and notify GDB. */ -void lj_gdbjit_addtrace(jit_State *J, GCtrace *T) -{ - GDBJITctx ctx; - GCproto *pt = &gcref(T->startpt)->pt; - TraceNo parent = T->ir[REF_BASE].op1; - const BCIns *startpc = mref(T->startpc, const BCIns); - ctx.T = T; - ctx.mcaddr = (uintptr_t)T->mcode; - ctx.szmcode = T->szmcode; - ctx.spadjp = CFRAME_SIZE_JIT + - (MSize)(parent ? traceref(J, parent)->spadjust : 0); - ctx.spadj = CFRAME_SIZE_JIT + T->spadjust; - lua_assert(startpc >= proto_bc(pt) && startpc < proto_bc(pt) + pt->sizebc); - ctx.lineno = lj_debug_line(pt, proto_bcpos(pt, startpc)); - ctx.filename = proto_chunknamestr(pt); - if (*ctx.filename == '@' || *ctx.filename == '=') - ctx.filename++; - else - ctx.filename = "(string)"; - gdbjit_buildobj(&ctx); - gdbjit_newentry(J->L, &ctx); -} - -/* Delete debug info for trace and notify GDB. */ -void lj_gdbjit_deltrace(jit_State *J, GCtrace *T) -{ - GDBJITentryobj *eo = (GDBJITentryobj *)T->gdbjit_entry; - if (eo) { - if (eo->entry.prev_entry) - eo->entry.prev_entry->next_entry = eo->entry.next_entry; - else - __jit_debug_descriptor.first_entry = eo->entry.next_entry; - if (eo->entry.next_entry) - eo->entry.next_entry->prev_entry = eo->entry.prev_entry; - __jit_debug_descriptor.relevant_entry = &eo->entry; - __jit_debug_descriptor.action_flag = GDBJIT_UNREGISTER; - __jit_debug_register_code(); - lj_mem_free(J2G(J), eo, eo->sz); - } -} - -#endif -#endif diff --git a/subprojects/luajit/src/lj_gdbjit.h b/subprojects/luajit/src/lj_gdbjit.h deleted file mode 100644 index bbaa1568c..000000000 --- a/subprojects/luajit/src/lj_gdbjit.h +++ /dev/null @@ -1,22 +0,0 @@ -/* -** Client for the GDB JIT API. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_GDBJIT_H -#define _LJ_GDBJIT_H - -#include "lj_obj.h" -#include "lj_jit.h" - -#if LJ_HASJIT && defined(LUAJIT_USE_GDBJIT) - -LJ_FUNC void lj_gdbjit_addtrace(jit_State *J, GCtrace *T); -LJ_FUNC void lj_gdbjit_deltrace(jit_State *J, GCtrace *T); - -#else -#define lj_gdbjit_addtrace(J, T) UNUSED(T) -#define lj_gdbjit_deltrace(J, T) UNUSED(T) -#endif - -#endif diff --git a/subprojects/luajit/src/lj_ir.c b/subprojects/luajit/src/lj_ir.c deleted file mode 100644 index 1e4860df6..000000000 --- a/subprojects/luajit/src/lj_ir.c +++ /dev/null @@ -1,501 +0,0 @@ -/* -** SSA IR (Intermediate Representation) emitter. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_ir_c -#define LUA_CORE - -/* For pointers to libc/libm functions. */ -#include -#include - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_gc.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_ircall.h" -#include "lj_iropt.h" -#include "lj_trace.h" -#if LJ_HASFFI -#include "lj_ctype.h" -#include "lj_cdata.h" -#include "lj_carith.h" -#endif -#include "lj_vm.h" -#include "lj_strscan.h" -#include "lj_lib.h" - -/* Some local macros to save typing. Undef'd at the end. */ -#define IR(ref) (&J->cur.ir[(ref)]) -#define fins (&J->fold.ins) - -/* Pass IR on to next optimization in chain (FOLD). */ -#define emitir(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J)) - -/* -- IR tables ----------------------------------------------------------- */ - -/* IR instruction modes. */ -LJ_DATADEF const uint8_t lj_ir_mode[IR__MAX+1] = { -IRDEF(IRMODE) - 0 -}; - -/* IR type sizes. */ -LJ_DATADEF const uint8_t lj_ir_type_size[IRT__MAX+1] = { -#define IRTSIZE(name, size) size, -IRTDEF(IRTSIZE) -#undef IRTSIZE - 0 -}; - -/* C call info for CALL* instructions. */ -LJ_DATADEF const CCallInfo lj_ir_callinfo[] = { -#define IRCALLCI(cond, name, nargs, kind, type, flags) \ - { (ASMFunction)IRCALLCOND_##cond(name), \ - (nargs)|(CCI_CALL_##kind)|(IRT_##type<irbuf + J->irbotlim; - MSize szins = J->irtoplim - J->irbotlim; - if (szins) { - baseir = (IRIns *)lj_mem_realloc(J->L, baseir, szins*sizeof(IRIns), - 2*szins*sizeof(IRIns)); - J->irtoplim = J->irbotlim + 2*szins; - } else { - baseir = (IRIns *)lj_mem_realloc(J->L, NULL, 0, LJ_MIN_IRSZ*sizeof(IRIns)); - J->irbotlim = REF_BASE - LJ_MIN_IRSZ/4; - J->irtoplim = J->irbotlim + LJ_MIN_IRSZ; - } - J->cur.ir = J->irbuf = baseir - J->irbotlim; -} - -/* Grow IR buffer at the bottom or shift it up. */ -static void lj_ir_growbot(jit_State *J) -{ - IRIns *baseir = J->irbuf + J->irbotlim; - MSize szins = J->irtoplim - J->irbotlim; - lua_assert(szins != 0); - lua_assert(J->cur.nk == J->irbotlim); - if (J->cur.nins + (szins >> 1) < J->irtoplim) { - /* More than half of the buffer is free on top: shift up by a quarter. */ - MSize ofs = szins >> 2; - memmove(baseir + ofs, baseir, (J->cur.nins - J->irbotlim)*sizeof(IRIns)); - J->irbotlim -= ofs; - J->irtoplim -= ofs; - J->cur.ir = J->irbuf = baseir - J->irbotlim; - } else { - /* Double the buffer size, but split the growth amongst top/bottom. */ - IRIns *newbase = lj_mem_newt(J->L, 2*szins*sizeof(IRIns), IRIns); - MSize ofs = szins >= 256 ? 128 : (szins >> 1); /* Limit bottom growth. */ - memcpy(newbase + ofs, baseir, (J->cur.nins - J->irbotlim)*sizeof(IRIns)); - lj_mem_free(G(J->L), baseir, szins*sizeof(IRIns)); - J->irbotlim -= ofs; - J->irtoplim = J->irbotlim + 2*szins; - J->cur.ir = J->irbuf = newbase - J->irbotlim; - } -} - -/* Emit IR without any optimizations. */ -TRef LJ_FASTCALL lj_ir_emit(jit_State *J) -{ - IRRef ref = lj_ir_nextins(J); - IRIns *ir = IR(ref); - IROp op = fins->o; - ir->prev = J->chain[op]; - J->chain[op] = (IRRef1)ref; - ir->o = op; - ir->op1 = fins->op1; - ir->op2 = fins->op2; - J->guardemit.irt |= fins->t.irt; - return TREF(ref, irt_t((ir->t = fins->t))); -} - -/* Emit call to a C function. */ -TRef lj_ir_call(jit_State *J, IRCallID id, ...) -{ - const CCallInfo *ci = &lj_ir_callinfo[id]; - uint32_t n = CCI_NARGS(ci); - TRef tr = TREF_NIL; - va_list argp; - va_start(argp, id); - if ((ci->flags & CCI_L)) n--; - if (n > 0) - tr = va_arg(argp, IRRef); - while (n-- > 1) - tr = emitir(IRT(IR_CARG, IRT_NIL), tr, va_arg(argp, IRRef)); - va_end(argp); - if (CCI_OP(ci) == IR_CALLS) - J->needsnap = 1; /* Need snapshot after call with side effect. */ - return emitir(CCI_OPTYPE(ci), tr, id); -} - -/* -- Interning of constants ---------------------------------------------- */ - -/* -** IR instructions for constants are kept between J->cur.nk >= ref < REF_BIAS. -** They are chained like all other instructions, but grow downwards. -** The are interned (like strings in the VM) to facilitate reference -** comparisons. The same constant must get the same reference. -*/ - -/* Get ref of next IR constant and optionally grow IR. -** Note: this may invalidate all IRIns *! -*/ -static LJ_AINLINE IRRef ir_nextk(jit_State *J) -{ - IRRef ref = J->cur.nk; - if (LJ_UNLIKELY(ref <= J->irbotlim)) lj_ir_growbot(J); - J->cur.nk = --ref; - return ref; -} - -/* Intern int32_t constant. */ -TRef LJ_FASTCALL lj_ir_kint(jit_State *J, int32_t k) -{ - IRIns *ir, *cir = J->cur.ir; - IRRef ref; - for (ref = J->chain[IR_KINT]; ref; ref = cir[ref].prev) - if (cir[ref].i == k) - goto found; - ref = ir_nextk(J); - ir = IR(ref); - ir->i = k; - ir->t.irt = IRT_INT; - ir->o = IR_KINT; - ir->prev = J->chain[IR_KINT]; - J->chain[IR_KINT] = (IRRef1)ref; -found: - return TREF(ref, IRT_INT); -} - -/* The MRef inside the KNUM/KINT64 IR instructions holds the address of the -** 64 bit constant. The constants themselves are stored in a chained array -** and shared across traces. -** -** Rationale for choosing this data structure: -** - The address of the constants is embedded in the generated machine code -** and must never move. A resizable array or hash table wouldn't work. -** - Most apps need very few non-32 bit integer constants (less than a dozen). -** - Linear search is hard to beat in terms of speed and low complexity. -*/ -typedef struct K64Array { - MRef next; /* Pointer to next list. */ - MSize numk; /* Number of used elements in this array. */ - TValue k[LJ_MIN_K64SZ]; /* Array of constants. */ -} K64Array; - -/* Free all chained arrays. */ -void lj_ir_k64_freeall(jit_State *J) -{ - K64Array *k; - for (k = mref(J->k64, K64Array); k; ) { - K64Array *next = mref(k->next, K64Array); - lj_mem_free(J2G(J), k, sizeof(K64Array)); - k = next; - } -} - -/* Find 64 bit constant in chained array or add it. */ -cTValue *lj_ir_k64_find(jit_State *J, uint64_t u64) -{ - K64Array *k, *kp = NULL; - TValue *ntv; - MSize idx; - /* Search for the constant in the whole chain of arrays. */ - for (k = mref(J->k64, K64Array); k; k = mref(k->next, K64Array)) { - kp = k; /* Remember previous element in list. */ - for (idx = 0; idx < k->numk; idx++) { /* Search one array. */ - TValue *tv = &k->k[idx]; - if (tv->u64 == u64) /* Needed for +-0/NaN/absmask. */ - return tv; - } - } - /* Constant was not found, need to add it. */ - if (!(kp && kp->numk < LJ_MIN_K64SZ)) { /* Allocate a new array. */ - K64Array *kn = lj_mem_newt(J->L, sizeof(K64Array), K64Array); - setmref(kn->next, NULL); - kn->numk = 0; - if (kp) - setmref(kp->next, kn); /* Chain to the end of the list. */ - else - setmref(J->k64, kn); /* Link first array. */ - kp = kn; - } - ntv = &kp->k[kp->numk++]; /* Add to current array. */ - ntv->u64 = u64; - return ntv; -} - -/* Intern 64 bit constant, given by its address. */ -TRef lj_ir_k64(jit_State *J, IROp op, cTValue *tv) -{ - IRIns *ir, *cir = J->cur.ir; - IRRef ref; - IRType t = op == IR_KNUM ? IRT_NUM : IRT_I64; - for (ref = J->chain[op]; ref; ref = cir[ref].prev) - if (ir_k64(&cir[ref]) == tv) - goto found; - ref = ir_nextk(J); - ir = IR(ref); - lua_assert(checkptr32(tv)); - setmref(ir->ptr, tv); - ir->t.irt = t; - ir->o = op; - ir->prev = J->chain[op]; - J->chain[op] = (IRRef1)ref; -found: - return TREF(ref, t); -} - -/* Intern FP constant, given by its 64 bit pattern. */ -TRef lj_ir_knum_u64(jit_State *J, uint64_t u64) -{ - return lj_ir_k64(J, IR_KNUM, lj_ir_k64_find(J, u64)); -} - -/* Intern 64 bit integer constant. */ -TRef lj_ir_kint64(jit_State *J, uint64_t u64) -{ - return lj_ir_k64(J, IR_KINT64, lj_ir_k64_find(J, u64)); -} - -/* Check whether a number is int and return it. -0 is NOT considered an int. */ -static int numistrueint(lua_Number n, int32_t *kp) -{ - int32_t k = lj_num2int(n); - if (n == (lua_Number)k) { - if (kp) *kp = k; - if (k == 0) { /* Special check for -0. */ - TValue tv; - setnumV(&tv, n); - if (tv.u32.hi != 0) - return 0; - } - return 1; - } - return 0; -} - -/* Intern number as int32_t constant if possible, otherwise as FP constant. */ -TRef lj_ir_knumint(jit_State *J, lua_Number n) -{ - int32_t k; - if (numistrueint(n, &k)) - return lj_ir_kint(J, k); - else - return lj_ir_knum(J, n); -} - -/* Intern GC object "constant". */ -TRef lj_ir_kgc(jit_State *J, GCobj *o, IRType t) -{ - IRIns *ir, *cir = J->cur.ir; - IRRef ref; - lua_assert(!isdead(J2G(J), o)); - for (ref = J->chain[IR_KGC]; ref; ref = cir[ref].prev) - if (ir_kgc(&cir[ref]) == o) - goto found; - ref = ir_nextk(J); - ir = IR(ref); - /* NOBARRIER: Current trace is a GC root. */ - setgcref(ir->gcr, o); - ir->t.irt = (uint8_t)t; - ir->o = IR_KGC; - ir->prev = J->chain[IR_KGC]; - J->chain[IR_KGC] = (IRRef1)ref; -found: - return TREF(ref, t); -} - -/* Intern 32 bit pointer constant. */ -TRef lj_ir_kptr_(jit_State *J, IROp op, void *ptr) -{ - IRIns *ir, *cir = J->cur.ir; - IRRef ref; - lua_assert((void *)(intptr_t)i32ptr(ptr) == ptr); - for (ref = J->chain[op]; ref; ref = cir[ref].prev) - if (mref(cir[ref].ptr, void) == ptr) - goto found; - ref = ir_nextk(J); - ir = IR(ref); - setmref(ir->ptr, ptr); - ir->t.irt = IRT_P32; - ir->o = op; - ir->prev = J->chain[op]; - J->chain[op] = (IRRef1)ref; -found: - return TREF(ref, IRT_P32); -} - -/* Intern typed NULL constant. */ -TRef lj_ir_knull(jit_State *J, IRType t) -{ - IRIns *ir, *cir = J->cur.ir; - IRRef ref; - for (ref = J->chain[IR_KNULL]; ref; ref = cir[ref].prev) - if (irt_t(cir[ref].t) == t) - goto found; - ref = ir_nextk(J); - ir = IR(ref); - ir->i = 0; - ir->t.irt = (uint8_t)t; - ir->o = IR_KNULL; - ir->prev = J->chain[IR_KNULL]; - J->chain[IR_KNULL] = (IRRef1)ref; -found: - return TREF(ref, t); -} - -/* Intern key slot. */ -TRef lj_ir_kslot(jit_State *J, TRef key, IRRef slot) -{ - IRIns *ir, *cir = J->cur.ir; - IRRef2 op12 = IRREF2((IRRef1)key, (IRRef1)slot); - IRRef ref; - /* Const part is not touched by CSE/DCE, so 0-65535 is ok for IRMlit here. */ - lua_assert(tref_isk(key) && slot == (IRRef)(IRRef1)slot); - for (ref = J->chain[IR_KSLOT]; ref; ref = cir[ref].prev) - if (cir[ref].op12 == op12) - goto found; - ref = ir_nextk(J); - ir = IR(ref); - ir->op12 = op12; - ir->t.irt = IRT_P32; - ir->o = IR_KSLOT; - ir->prev = J->chain[IR_KSLOT]; - J->chain[IR_KSLOT] = (IRRef1)ref; -found: - return TREF(ref, IRT_P32); -} - -/* -- Access to IR constants ---------------------------------------------- */ - -/* Copy value of IR constant. */ -void lj_ir_kvalue(lua_State *L, TValue *tv, const IRIns *ir) -{ - UNUSED(L); - lua_assert(ir->o != IR_KSLOT); /* Common mistake. */ - switch (ir->o) { - case IR_KPRI: setitype(tv, irt_toitype(ir->t)); break; - case IR_KINT: setintV(tv, ir->i); break; - case IR_KGC: setgcV(L, tv, ir_kgc(ir), irt_toitype(ir->t)); break; - case IR_KPTR: case IR_KKPTR: case IR_KNULL: - setlightudV(tv, mref(ir->ptr, void)); - break; - case IR_KNUM: setnumV(tv, ir_knum(ir)->n); break; -#if LJ_HASFFI - case IR_KINT64: { - GCcdata *cd = lj_cdata_new_(L, CTID_INT64, 8); - *(uint64_t *)cdataptr(cd) = ir_kint64(ir)->u64; - setcdataV(L, tv, cd); - break; - } -#endif - default: lua_assert(0); break; - } -} - -/* -- Convert IR operand types -------------------------------------------- */ - -/* Convert from string to number. */ -TRef LJ_FASTCALL lj_ir_tonumber(jit_State *J, TRef tr) -{ - if (!tref_isnumber(tr)) { - if (tref_isstr(tr)) - tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0); - else - lj_trace_err(J, LJ_TRERR_BADTYPE); - } - return tr; -} - -/* Convert from integer or string to number. */ -TRef LJ_FASTCALL lj_ir_tonum(jit_State *J, TRef tr) -{ - if (!tref_isnum(tr)) { - if (tref_isinteger(tr)) - tr = emitir(IRTN(IR_CONV), tr, IRCONV_NUM_INT); - else if (tref_isstr(tr)) - tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0); - else - lj_trace_err(J, LJ_TRERR_BADTYPE); - } - return tr; -} - -/* Convert from integer or number to string. */ -TRef LJ_FASTCALL lj_ir_tostr(jit_State *J, TRef tr) -{ - if (!tref_isstr(tr)) { - if (!tref_isnumber(tr)) - lj_trace_err(J, LJ_TRERR_BADTYPE); - tr = emitir(IRT(IR_TOSTR, IRT_STR), tr, 0); - } - return tr; -} - -/* -- Miscellaneous IR ops ------------------------------------------------ */ - -/* Evaluate numeric comparison. */ -int lj_ir_numcmp(lua_Number a, lua_Number b, IROp op) -{ - switch (op) { - case IR_EQ: return (a == b); - case IR_NE: return (a != b); - case IR_LT: return (a < b); - case IR_GE: return (a >= b); - case IR_LE: return (a <= b); - case IR_GT: return (a > b); - case IR_ULT: return !(a >= b); - case IR_UGE: return !(a < b); - case IR_ULE: return !(a > b); - case IR_UGT: return !(a <= b); - default: lua_assert(0); return 0; - } -} - -/* Evaluate string comparison. */ -int lj_ir_strcmp(GCstr *a, GCstr *b, IROp op) -{ - int res = lj_str_cmp(a, b); - switch (op) { - case IR_LT: return (res < 0); - case IR_GE: return (res >= 0); - case IR_LE: return (res <= 0); - case IR_GT: return (res > 0); - default: lua_assert(0); return 0; - } -} - -/* Rollback IR to previous state. */ -void lj_ir_rollback(jit_State *J, IRRef ref) -{ - IRRef nins = J->cur.nins; - while (nins > ref) { - IRIns *ir; - nins--; - ir = IR(nins); - J->chain[ir->o] = ir->prev; - } - J->cur.nins = nins; -} - -#undef IR -#undef fins -#undef emitir - -#endif diff --git a/subprojects/luajit/src/lj_ir.h b/subprojects/luajit/src/lj_ir.h deleted file mode 100644 index ded3e0eb6..000000000 --- a/subprojects/luajit/src/lj_ir.h +++ /dev/null @@ -1,551 +0,0 @@ -/* -** SSA IR (Intermediate Representation) format. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_IR_H -#define _LJ_IR_H - -#include "lj_obj.h" - -/* -- IR instructions ----------------------------------------------------- */ - -/* IR instruction definition. Order matters, see below. ORDER IR */ -#define IRDEF(_) \ - /* Guarded assertions. */ \ - /* Must be properly aligned to flip opposites (^1) and (un)ordered (^4). */ \ - _(LT, N , ref, ref) \ - _(GE, N , ref, ref) \ - _(LE, N , ref, ref) \ - _(GT, N , ref, ref) \ - \ - _(ULT, N , ref, ref) \ - _(UGE, N , ref, ref) \ - _(ULE, N , ref, ref) \ - _(UGT, N , ref, ref) \ - \ - _(EQ, C , ref, ref) \ - _(NE, C , ref, ref) \ - \ - _(ABC, N , ref, ref) \ - _(RETF, S , ref, ref) \ - \ - /* Miscellaneous ops. */ \ - _(NOP, N , ___, ___) \ - _(BASE, N , lit, lit) \ - _(PVAL, N , lit, ___) \ - _(GCSTEP, S , ___, ___) \ - _(HIOP, S , ref, ref) \ - _(LOOP, S , ___, ___) \ - _(USE, S , ref, ___) \ - _(PHI, S , ref, ref) \ - _(RENAME, S , ref, lit) \ - \ - /* Constants. */ \ - _(KPRI, N , ___, ___) \ - _(KINT, N , cst, ___) \ - _(KGC, N , cst, ___) \ - _(KPTR, N , cst, ___) \ - _(KKPTR, N , cst, ___) \ - _(KNULL, N , cst, ___) \ - _(KNUM, N , cst, ___) \ - _(KINT64, N , cst, ___) \ - _(KSLOT, N , ref, lit) \ - \ - /* Bit ops. */ \ - _(BNOT, N , ref, ___) \ - _(BSWAP, N , ref, ___) \ - _(BAND, C , ref, ref) \ - _(BOR, C , ref, ref) \ - _(BXOR, C , ref, ref) \ - _(BSHL, N , ref, ref) \ - _(BSHR, N , ref, ref) \ - _(BSAR, N , ref, ref) \ - _(BROL, N , ref, ref) \ - _(BROR, N , ref, ref) \ - \ - /* Arithmetic ops. ORDER ARITH */ \ - _(ADD, C , ref, ref) \ - _(SUB, N , ref, ref) \ - _(MUL, C , ref, ref) \ - _(DIV, N , ref, ref) \ - _(MOD, N , ref, ref) \ - _(POW, N , ref, ref) \ - _(NEG, N , ref, ref) \ - \ - _(ABS, N , ref, ref) \ - _(ATAN2, N , ref, ref) \ - _(LDEXP, N , ref, ref) \ - _(MIN, C , ref, ref) \ - _(MAX, C , ref, ref) \ - _(FPMATH, N , ref, lit) \ - \ - /* Overflow-checking arithmetic ops. */ \ - _(ADDOV, CW, ref, ref) \ - _(SUBOV, NW, ref, ref) \ - _(MULOV, CW, ref, ref) \ - \ - /* Memory ops. A = array, H = hash, U = upvalue, F = field, S = stack. */ \ - \ - /* Memory references. */ \ - _(AREF, R , ref, ref) \ - _(HREFK, R , ref, ref) \ - _(HREF, L , ref, ref) \ - _(NEWREF, S , ref, ref) \ - _(UREFO, LW, ref, lit) \ - _(UREFC, LW, ref, lit) \ - _(FREF, R , ref, lit) \ - _(STRREF, N , ref, ref) \ - \ - /* Loads and Stores. These must be in the same order. */ \ - _(ALOAD, L , ref, ___) \ - _(HLOAD, L , ref, ___) \ - _(ULOAD, L , ref, ___) \ - _(FLOAD, L , ref, lit) \ - _(XLOAD, L , ref, lit) \ - _(SLOAD, L , lit, lit) \ - _(VLOAD, L , ref, ___) \ - \ - _(ASTORE, S , ref, ref) \ - _(HSTORE, S , ref, ref) \ - _(USTORE, S , ref, ref) \ - _(FSTORE, S , ref, ref) \ - _(XSTORE, S , ref, ref) \ - \ - /* Allocations. */ \ - _(SNEW, N , ref, ref) /* CSE is ok, not marked as A. */ \ - _(XSNEW, A , ref, ref) \ - _(TNEW, AW, lit, lit) \ - _(TDUP, AW, ref, ___) \ - _(CNEW, AW, ref, ref) \ - _(CNEWI, NW, ref, ref) /* CSE is ok, not marked as A. */ \ - \ - /* Barriers. */ \ - _(TBAR, S , ref, ___) \ - _(OBAR, S , ref, ref) \ - _(XBAR, S , ___, ___) \ - \ - /* Type conversions. */ \ - _(CONV, NW, ref, lit) \ - _(TOBIT, N , ref, ref) \ - _(TOSTR, N , ref, ___) \ - _(STRTO, N , ref, ___) \ - \ - /* Calls. */ \ - _(CALLN, N , ref, lit) \ - _(CALLL, L , ref, lit) \ - _(CALLS, S , ref, lit) \ - _(CALLXS, S , ref, ref) \ - _(CARG, N , ref, ref) \ - \ - /* End of list. */ - -/* IR opcodes (max. 256). */ -typedef enum { -#define IRENUM(name, m, m1, m2) IR_##name, -IRDEF(IRENUM) -#undef IRENUM - IR__MAX -} IROp; - -/* Stored opcode. */ -typedef uint8_t IROp1; - -LJ_STATIC_ASSERT(((int)IR_EQ^1) == (int)IR_NE); -LJ_STATIC_ASSERT(((int)IR_LT^1) == (int)IR_GE); -LJ_STATIC_ASSERT(((int)IR_LE^1) == (int)IR_GT); -LJ_STATIC_ASSERT(((int)IR_LT^3) == (int)IR_GT); -LJ_STATIC_ASSERT(((int)IR_LT^4) == (int)IR_ULT); - -/* Delta between xLOAD and xSTORE. */ -#define IRDELTA_L2S ((int)IR_ASTORE - (int)IR_ALOAD) - -LJ_STATIC_ASSERT((int)IR_HLOAD + IRDELTA_L2S == (int)IR_HSTORE); -LJ_STATIC_ASSERT((int)IR_ULOAD + IRDELTA_L2S == (int)IR_USTORE); -LJ_STATIC_ASSERT((int)IR_FLOAD + IRDELTA_L2S == (int)IR_FSTORE); -LJ_STATIC_ASSERT((int)IR_XLOAD + IRDELTA_L2S == (int)IR_XSTORE); - -/* -- Named IR literals --------------------------------------------------- */ - -/* FPMATH sub-functions. ORDER FPM. */ -#define IRFPMDEF(_) \ - _(FLOOR) _(CEIL) _(TRUNC) /* Must be first and in this order. */ \ - _(SQRT) _(EXP) _(EXP2) _(LOG) _(LOG2) _(LOG10) \ - _(SIN) _(COS) _(TAN) \ - _(OTHER) - -typedef enum { -#define FPMENUM(name) IRFPM_##name, -IRFPMDEF(FPMENUM) -#undef FPMENUM - IRFPM__MAX -} IRFPMathOp; - -/* FLOAD fields. */ -#define IRFLDEF(_) \ - _(STR_LEN, offsetof(GCstr, len)) \ - _(FUNC_ENV, offsetof(GCfunc, l.env)) \ - _(FUNC_PC, offsetof(GCfunc, l.pc)) \ - _(TAB_META, offsetof(GCtab, metatable)) \ - _(TAB_ARRAY, offsetof(GCtab, array)) \ - _(TAB_NODE, offsetof(GCtab, node)) \ - _(TAB_ASIZE, offsetof(GCtab, asize)) \ - _(TAB_HMASK, offsetof(GCtab, hmask)) \ - _(TAB_NOMM, offsetof(GCtab, nomm)) \ - _(UDATA_META, offsetof(GCudata, metatable)) \ - _(UDATA_UDTYPE, offsetof(GCudata, udtype)) \ - _(UDATA_FILE, sizeof(GCudata)) \ - _(CDATA_CTYPEID, offsetof(GCcdata, ctypeid)) \ - _(CDATA_PTR, sizeof(GCcdata)) \ - _(CDATA_INT, sizeof(GCcdata)) \ - _(CDATA_INT64, sizeof(GCcdata)) \ - _(CDATA_INT64_4, sizeof(GCcdata) + 4) - -typedef enum { -#define FLENUM(name, ofs) IRFL_##name, -IRFLDEF(FLENUM) -#undef FLENUM - IRFL__MAX -} IRFieldID; - -/* SLOAD mode bits, stored in op2. */ -#define IRSLOAD_PARENT 0x01 /* Coalesce with parent trace. */ -#define IRSLOAD_FRAME 0x02 /* Load hiword of frame. */ -#define IRSLOAD_TYPECHECK 0x04 /* Needs type check. */ -#define IRSLOAD_CONVERT 0x08 /* Number to integer conversion. */ -#define IRSLOAD_READONLY 0x10 /* Read-only, omit slot store. */ -#define IRSLOAD_INHERIT 0x20 /* Inherited by exits/side traces. */ - -/* XLOAD mode, stored in op2. */ -#define IRXLOAD_READONLY 1 /* Load from read-only data. */ -#define IRXLOAD_VOLATILE 2 /* Load from volatile data. */ -#define IRXLOAD_UNALIGNED 4 /* Unaligned load. */ - -/* CONV mode, stored in op2. */ -#define IRCONV_SRCMASK 0x001f /* Source IRType. */ -#define IRCONV_DSTMASK 0x03e0 /* Dest. IRType (also in ir->t). */ -#define IRCONV_DSH 5 -#define IRCONV_NUM_INT ((IRT_NUM<>2)&3)) -#define irm_iscomm(m) ((m) & IRM_C) -#define irm_kind(m) ((m) & IRM_S) - -#define IRMODE(name, m, m1, m2) (((IRM##m1)|((IRM##m2)<<2)|(IRM_##m))^IRM_W), - -LJ_DATA const uint8_t lj_ir_mode[IR__MAX+1]; - -/* -- IR instruction types ------------------------------------------------ */ - -/* Map of itypes to non-negative numbers. ORDER LJ_T. -** LJ_TUPVAL/LJ_TTRACE never appear in a TValue. Use these itypes for -** IRT_P32 and IRT_P64, which never escape the IR. -** The various integers are only used in the IR and can only escape to -** a TValue after implicit or explicit conversion. Their types must be -** contiguous and next to IRT_NUM (see the typerange macros below). -*/ -#define IRTDEF(_) \ - _(NIL, 4) _(FALSE, 4) _(TRUE, 4) _(LIGHTUD, LJ_64 ? 8 : 4) _(STR, 4) \ - _(P32, 4) _(THREAD, 4) _(PROTO, 4) _(FUNC, 4) _(P64, 8) _(CDATA, 4) \ - _(TAB, 4) _(UDATA, 4) \ - _(FLOAT, 4) _(NUM, 8) _(I8, 1) _(U8, 1) _(I16, 2) _(U16, 2) \ - _(INT, 4) _(U32, 4) _(I64, 8) _(U64, 8) \ - _(SOFTFP, 4) /* There is room for 9 more types. */ - -/* IR result type and flags (8 bit). */ -typedef enum { -#define IRTENUM(name, size) IRT_##name, -IRTDEF(IRTENUM) -#undef IRTENUM - IRT__MAX, - - /* Native pointer type and the corresponding integer type. */ - IRT_PTR = LJ_64 ? IRT_P64 : IRT_P32, - IRT_INTP = LJ_64 ? IRT_I64 : IRT_INT, - IRT_UINTP = LJ_64 ? IRT_U64 : IRT_U32, - - /* Additional flags. */ - IRT_MARK = 0x20, /* Marker for misc. purposes. */ - IRT_ISPHI = 0x40, /* Instruction is left or right PHI operand. */ - IRT_GUARD = 0x80, /* Instruction is a guard. */ - - /* Masks. */ - IRT_TYPE = 0x1f, - IRT_T = 0xff -} IRType; - -#define irtype_ispri(irt) ((uint32_t)(irt) <= IRT_TRUE) - -/* Stored IRType. */ -typedef struct IRType1 { uint8_t irt; } IRType1; - -#define IRT(o, t) ((uint32_t)(((o)<<8) | (t))) -#define IRTI(o) (IRT((o), IRT_INT)) -#define IRTN(o) (IRT((o), IRT_NUM)) -#define IRTG(o, t) (IRT((o), IRT_GUARD|(t))) -#define IRTGI(o) (IRT((o), IRT_GUARD|IRT_INT)) - -#define irt_t(t) ((IRType)(t).irt) -#define irt_type(t) ((IRType)((t).irt & IRT_TYPE)) -#define irt_sametype(t1, t2) ((((t1).irt ^ (t2).irt) & IRT_TYPE) == 0) -#define irt_typerange(t, first, last) \ - ((uint32_t)((t).irt & IRT_TYPE) - (uint32_t)(first) <= (uint32_t)(last-first)) - -#define irt_isnil(t) (irt_type(t) == IRT_NIL) -#define irt_ispri(t) ((uint32_t)irt_type(t) <= IRT_TRUE) -#define irt_islightud(t) (irt_type(t) == IRT_LIGHTUD) -#define irt_isstr(t) (irt_type(t) == IRT_STR) -#define irt_istab(t) (irt_type(t) == IRT_TAB) -#define irt_iscdata(t) (irt_type(t) == IRT_CDATA) -#define irt_isfloat(t) (irt_type(t) == IRT_FLOAT) -#define irt_isnum(t) (irt_type(t) == IRT_NUM) -#define irt_isint(t) (irt_type(t) == IRT_INT) -#define irt_isi8(t) (irt_type(t) == IRT_I8) -#define irt_isu8(t) (irt_type(t) == IRT_U8) -#define irt_isi16(t) (irt_type(t) == IRT_I16) -#define irt_isu16(t) (irt_type(t) == IRT_U16) -#define irt_isu32(t) (irt_type(t) == IRT_U32) -#define irt_isi64(t) (irt_type(t) == IRT_I64) -#define irt_isu64(t) (irt_type(t) == IRT_U64) - -#define irt_isfp(t) (irt_isnum(t) || irt_isfloat(t)) -#define irt_isinteger(t) (irt_typerange((t), IRT_I8, IRT_INT)) -#define irt_isgcv(t) (irt_typerange((t), IRT_STR, IRT_UDATA)) -#define irt_isaddr(t) (irt_typerange((t), IRT_LIGHTUD, IRT_UDATA)) -#define irt_isint64(t) (irt_typerange((t), IRT_I64, IRT_U64)) - -#if LJ_64 -#define IRT_IS64 \ - ((1u<> irt_type(t)) & 1) -#define irt_is64orfp(t) (((IRT_IS64|(1u<>irt_type(t)) & 1) - -#define irt_size(t) (lj_ir_type_size[irt_t((t))]) - -LJ_DATA const uint8_t lj_ir_type_size[]; - -static LJ_AINLINE IRType itype2irt(const TValue *tv) -{ - if (tvisint(tv)) - return IRT_INT; - else if (tvisnum(tv)) - return IRT_NUM; -#if LJ_64 - else if (tvislightud(tv)) - return IRT_LIGHTUD; -#endif - else - return (IRType)~itype(tv); -} - -static LJ_AINLINE uint32_t irt_toitype_(IRType t) -{ - lua_assert(!LJ_64 || t != IRT_LIGHTUD); - if (LJ_DUALNUM && t > IRT_NUM) { - return LJ_TISNUM; - } else { - lua_assert(t <= IRT_NUM); - return ~(uint32_t)t; - } -} - -#define irt_toitype(t) irt_toitype_(irt_type((t))) - -#define irt_isguard(t) ((t).irt & IRT_GUARD) -#define irt_ismarked(t) ((t).irt & IRT_MARK) -#define irt_setmark(t) ((t).irt |= IRT_MARK) -#define irt_clearmark(t) ((t).irt &= ~IRT_MARK) -#define irt_isphi(t) ((t).irt & IRT_ISPHI) -#define irt_setphi(t) ((t).irt |= IRT_ISPHI) -#define irt_clearphi(t) ((t).irt &= ~IRT_ISPHI) - -/* Stored combined IR opcode and type. */ -typedef uint16_t IROpT; - -/* -- IR references ------------------------------------------------------- */ - -/* IR references. */ -typedef uint16_t IRRef1; /* One stored reference. */ -typedef uint32_t IRRef2; /* Two stored references. */ -typedef uint32_t IRRef; /* Used to pass around references. */ - -/* Fixed references. */ -enum { - REF_BIAS = 0x8000, - REF_TRUE = REF_BIAS-3, - REF_FALSE = REF_BIAS-2, - REF_NIL = REF_BIAS-1, /* \--- Constants grow downwards. */ - REF_BASE = REF_BIAS, /* /--- IR grows upwards. */ - REF_FIRST = REF_BIAS+1, - REF_DROP = 0xffff -}; - -/* Note: IRMlit operands must be < REF_BIAS, too! -** This allows for fast and uniform manipulation of all operands -** without looking up the operand mode in lj_ir_mode: -** - CSE calculates the maximum reference of two operands. -** This must work with mixed reference/literal operands, too. -** - DCE marking only checks for operand >= REF_BIAS. -** - LOOP needs to substitute reference operands. -** Constant references and literals must not be modified. -*/ - -#define IRREF2(lo, hi) ((IRRef2)(lo) | ((IRRef2)(hi) << 16)) - -#define irref_isk(ref) ((ref) < REF_BIAS) - -/* Tagged IR references (32 bit). -** -** +-------+-------+---------------+ -** | irt | flags | ref | -** +-------+-------+---------------+ -** -** The tag holds a copy of the IRType and speeds up IR type checks. -*/ -typedef uint32_t TRef; - -#define TREF_REFMASK 0x0000ffff -#define TREF_FRAME 0x00010000 -#define TREF_CONT 0x00020000 - -#define TREF(ref, t) ((TRef)((ref) + ((t)<<24))) - -#define tref_ref(tr) ((IRRef1)(tr)) -#define tref_t(tr) ((IRType)((tr)>>24)) -#define tref_type(tr) ((IRType)(((tr)>>24) & IRT_TYPE)) -#define tref_typerange(tr, first, last) \ - ((((tr)>>24) & IRT_TYPE) - (TRef)(first) <= (TRef)(last-first)) - -#define tref_istype(tr, t) (((tr) & (IRT_TYPE<<24)) == ((t)<<24)) -#define tref_isnil(tr) (tref_istype((tr), IRT_NIL)) -#define tref_isfalse(tr) (tref_istype((tr), IRT_FALSE)) -#define tref_istrue(tr) (tref_istype((tr), IRT_TRUE)) -#define tref_isstr(tr) (tref_istype((tr), IRT_STR)) -#define tref_isfunc(tr) (tref_istype((tr), IRT_FUNC)) -#define tref_iscdata(tr) (tref_istype((tr), IRT_CDATA)) -#define tref_istab(tr) (tref_istype((tr), IRT_TAB)) -#define tref_isudata(tr) (tref_istype((tr), IRT_UDATA)) -#define tref_isnum(tr) (tref_istype((tr), IRT_NUM)) -#define tref_isint(tr) (tref_istype((tr), IRT_INT)) - -#define tref_isbool(tr) (tref_typerange((tr), IRT_FALSE, IRT_TRUE)) -#define tref_ispri(tr) (tref_typerange((tr), IRT_NIL, IRT_TRUE)) -#define tref_istruecond(tr) (!tref_typerange((tr), IRT_NIL, IRT_FALSE)) -#define tref_isinteger(tr) (tref_typerange((tr), IRT_I8, IRT_INT)) -#define tref_isnumber(tr) (tref_typerange((tr), IRT_NUM, IRT_INT)) -#define tref_isnumber_str(tr) (tref_isnumber((tr)) || tref_isstr((tr))) -#define tref_isgcv(tr) (tref_typerange((tr), IRT_STR, IRT_UDATA)) - -#define tref_isk(tr) (irref_isk(tref_ref((tr)))) -#define tref_isk2(tr1, tr2) (irref_isk(tref_ref((tr1) | (tr2)))) - -#define TREF_PRI(t) (TREF(REF_NIL-(t), (t))) -#define TREF_NIL (TREF_PRI(IRT_NIL)) -#define TREF_FALSE (TREF_PRI(IRT_FALSE)) -#define TREF_TRUE (TREF_PRI(IRT_TRUE)) - -/* -- IR format ----------------------------------------------------------- */ - -/* IR instruction format (64 bit). -** -** 16 16 8 8 8 8 -** +-------+-------+---+---+---+---+ -** | op1 | op2 | t | o | r | s | -** +-------+-------+---+---+---+---+ -** | op12/i/gco | ot | prev | (alternative fields in union) -** +---------------+-------+-------+ -** 32 16 16 -** -** prev is only valid prior to register allocation and then reused for r + s. -*/ - -typedef union IRIns { - struct { - LJ_ENDIAN_LOHI( - IRRef1 op1; /* IR operand 1. */ - , IRRef1 op2; /* IR operand 2. */ - ) - IROpT ot; /* IR opcode and type (overlaps t and o). */ - IRRef1 prev; /* Previous ins in same chain (overlaps r and s). */ - }; - struct { - IRRef2 op12; /* IR operand 1 and 2 (overlaps op1 and op2). */ - LJ_ENDIAN_LOHI( - IRType1 t; /* IR type. */ - , IROp1 o; /* IR opcode. */ - ) - LJ_ENDIAN_LOHI( - uint8_t r; /* Register allocation (overlaps prev). */ - , uint8_t s; /* Spill slot allocation (overlaps prev). */ - ) - }; - int32_t i; /* 32 bit signed integer literal (overlaps op12). */ - GCRef gcr; /* GCobj constant (overlaps op12). */ - MRef ptr; /* Pointer constant (overlaps op12). */ -} IRIns; - -#define ir_kgc(ir) check_exp((ir)->o == IR_KGC, gcref((ir)->gcr)) -#define ir_kstr(ir) (gco2str(ir_kgc((ir)))) -#define ir_ktab(ir) (gco2tab(ir_kgc((ir)))) -#define ir_kfunc(ir) (gco2func(ir_kgc((ir)))) -#define ir_kcdata(ir) (gco2cd(ir_kgc((ir)))) -#define ir_knum(ir) check_exp((ir)->o == IR_KNUM, mref((ir)->ptr, cTValue)) -#define ir_kint64(ir) check_exp((ir)->o == IR_KINT64, mref((ir)->ptr,cTValue)) -#define ir_k64(ir) \ - check_exp((ir)->o == IR_KNUM || (ir)->o == IR_KINT64, mref((ir)->ptr,cTValue)) -#define ir_kptr(ir) \ - check_exp((ir)->o == IR_KPTR || (ir)->o == IR_KKPTR, mref((ir)->ptr, void)) - -/* A store or any other op with a non-weak guard has a side-effect. */ -static LJ_AINLINE int ir_sideeff(IRIns *ir) -{ - return (((ir->t.irt | ~IRT_GUARD) & lj_ir_mode[ir->o]) >= IRM_S); -} - -LJ_STATIC_ASSERT((int)IRT_GUARD == (int)IRM_W); - -#endif diff --git a/subprojects/luajit/src/lj_ircall.h b/subprojects/luajit/src/lj_ircall.h deleted file mode 100644 index 44afde3ae..000000000 --- a/subprojects/luajit/src/lj_ircall.h +++ /dev/null @@ -1,271 +0,0 @@ -/* -** IR CALL* instruction definitions. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_IRCALL_H -#define _LJ_IRCALL_H - -#include "lj_obj.h" -#include "lj_ir.h" -#include "lj_jit.h" - -/* C call info for CALL* instructions. */ -typedef struct CCallInfo { - ASMFunction func; /* Function pointer. */ - uint32_t flags; /* Number of arguments and flags. */ -} CCallInfo; - -#define CCI_NARGS(ci) ((ci)->flags & 0xff) /* Extract # of args. */ -#define CCI_NARGS_MAX 32 /* Max. # of args. */ - -#define CCI_OTSHIFT 16 -#define CCI_OPTYPE(ci) ((ci)->flags >> CCI_OTSHIFT) /* Get op/type. */ -#define CCI_OPSHIFT 24 -#define CCI_OP(ci) ((ci)->flags >> CCI_OPSHIFT) /* Get op. */ - -#define CCI_CALL_N (IR_CALLN << CCI_OPSHIFT) -#define CCI_CALL_L (IR_CALLL << CCI_OPSHIFT) -#define CCI_CALL_S (IR_CALLS << CCI_OPSHIFT) -#define CCI_CALL_FN (CCI_CALL_N|CCI_CC_FASTCALL) -#define CCI_CALL_FL (CCI_CALL_L|CCI_CC_FASTCALL) -#define CCI_CALL_FS (CCI_CALL_S|CCI_CC_FASTCALL) - -/* C call info flags. */ -#define CCI_L 0x0100 /* Implicit L arg. */ -#define CCI_CASTU64 0x0200 /* Cast u64 result to number. */ -#define CCI_NOFPRCLOBBER 0x0400 /* Does not clobber any FPRs. */ -#define CCI_VARARG 0x0800 /* Vararg function. */ - -#define CCI_CC_MASK 0x3000 /* Calling convention mask. */ -#define CCI_CC_SHIFT 12 -/* ORDER CC */ -#define CCI_CC_CDECL 0x0000 /* Default cdecl calling convention. */ -#define CCI_CC_THISCALL 0x1000 /* Thiscall calling convention. */ -#define CCI_CC_FASTCALL 0x2000 /* Fastcall calling convention. */ -#define CCI_CC_STDCALL 0x3000 /* Stdcall calling convention. */ - -/* Helpers for conditional function definitions. */ -#define IRCALLCOND_ANY(x) x - -#if LJ_TARGET_X86ORX64 -#define IRCALLCOND_FPMATH(x) NULL -#else -#define IRCALLCOND_FPMATH(x) x -#endif - -#if LJ_SOFTFP -#define IRCALLCOND_SOFTFP(x) x -#if LJ_HASFFI -#define IRCALLCOND_SOFTFP_FFI(x) x -#else -#define IRCALLCOND_SOFTFP_FFI(x) NULL -#endif -#else -#define IRCALLCOND_SOFTFP(x) NULL -#define IRCALLCOND_SOFTFP_FFI(x) NULL -#endif - -#define LJ_NEED_FP64 (LJ_TARGET_ARM || LJ_TARGET_PPC || LJ_TARGET_MIPS) - -#if LJ_HASFFI && (LJ_SOFTFP || LJ_NEED_FP64) -#define IRCALLCOND_FP64_FFI(x) x -#else -#define IRCALLCOND_FP64_FFI(x) NULL -#endif - -#if LJ_HASFFI -#define IRCALLCOND_FFI(x) x -#if LJ_32 -#define IRCALLCOND_FFI32(x) x -#else -#define IRCALLCOND_FFI32(x) NULL -#endif -#else -#define IRCALLCOND_FFI(x) NULL -#define IRCALLCOND_FFI32(x) NULL -#endif - -#if LJ_SOFTFP -#define ARG1_FP 2 /* Treat as 2 32 bit arguments. */ -#else -#define ARG1_FP 1 -#endif - -#if LJ_32 -#define ARG2_64 4 /* Treat as 4 32 bit arguments. */ -#else -#define ARG2_64 2 -#endif - -/* Function definitions for CALL* instructions. */ -#define IRCALLDEF(_) \ - _(ANY, lj_str_cmp, 2, FN, INT, CCI_NOFPRCLOBBER) \ - _(ANY, lj_str_new, 3, S, STR, CCI_L) \ - _(ANY, lj_strscan_num, 2, FN, INT, 0) \ - _(ANY, lj_str_fromint, 2, FN, STR, CCI_L) \ - _(ANY, lj_str_fromnum, 2, FN, STR, CCI_L) \ - _(ANY, lj_tab_new1, 2, FS, TAB, CCI_L) \ - _(ANY, lj_tab_dup, 2, FS, TAB, CCI_L) \ - _(ANY, lj_tab_newkey, 3, S, P32, CCI_L) \ - _(ANY, lj_tab_len, 1, FL, INT, 0) \ - _(ANY, lj_gc_step_jit, 2, FS, NIL, CCI_L) \ - _(ANY, lj_gc_barrieruv, 2, FS, NIL, 0) \ - _(ANY, lj_mem_newgco, 2, FS, P32, CCI_L) \ - _(ANY, lj_math_random_step, 1, FS, NUM, CCI_CASTU64) \ - _(ANY, lj_vm_modi, 2, FN, INT, 0) \ - _(ANY, sinh, ARG1_FP, N, NUM, 0) \ - _(ANY, cosh, ARG1_FP, N, NUM, 0) \ - _(ANY, tanh, ARG1_FP, N, NUM, 0) \ - _(ANY, fputc, 2, S, INT, 0) \ - _(ANY, fwrite, 4, S, INT, 0) \ - _(ANY, fflush, 1, S, INT, 0) \ - /* ORDER FPM */ \ - _(FPMATH, lj_vm_floor, ARG1_FP, N, NUM, 0) \ - _(FPMATH, lj_vm_ceil, ARG1_FP, N, NUM, 0) \ - _(FPMATH, lj_vm_trunc, ARG1_FP, N, NUM, 0) \ - _(FPMATH, sqrt, ARG1_FP, N, NUM, 0) \ - _(FPMATH, exp, ARG1_FP, N, NUM, 0) \ - _(FPMATH, lj_vm_exp2, ARG1_FP, N, NUM, 0) \ - _(FPMATH, log, ARG1_FP, N, NUM, 0) \ - _(FPMATH, lj_vm_log2, ARG1_FP, N, NUM, 0) \ - _(FPMATH, log10, ARG1_FP, N, NUM, 0) \ - _(FPMATH, sin, ARG1_FP, N, NUM, 0) \ - _(FPMATH, cos, ARG1_FP, N, NUM, 0) \ - _(FPMATH, tan, ARG1_FP, N, NUM, 0) \ - _(FPMATH, lj_vm_powi, ARG1_FP+1, N, NUM, 0) \ - _(FPMATH, pow, ARG1_FP*2, N, NUM, 0) \ - _(FPMATH, atan2, ARG1_FP*2, N, NUM, 0) \ - _(FPMATH, ldexp, ARG1_FP+1, N, NUM, 0) \ - _(SOFTFP, lj_vm_tobit, 2, N, INT, 0) \ - _(SOFTFP, softfp_add, 4, N, NUM, 0) \ - _(SOFTFP, softfp_sub, 4, N, NUM, 0) \ - _(SOFTFP, softfp_mul, 4, N, NUM, 0) \ - _(SOFTFP, softfp_div, 4, N, NUM, 0) \ - _(SOFTFP, softfp_cmp, 4, N, NIL, 0) \ - _(SOFTFP, softfp_i2d, 1, N, NUM, 0) \ - _(SOFTFP, softfp_d2i, 2, N, INT, 0) \ - _(SOFTFP_FFI, softfp_ui2d, 1, N, NUM, 0) \ - _(SOFTFP_FFI, softfp_f2d, 1, N, NUM, 0) \ - _(SOFTFP_FFI, softfp_d2ui, 2, N, INT, 0) \ - _(SOFTFP_FFI, softfp_d2f, 2, N, FLOAT, 0) \ - _(SOFTFP_FFI, softfp_i2f, 1, N, FLOAT, 0) \ - _(SOFTFP_FFI, softfp_ui2f, 1, N, FLOAT, 0) \ - _(SOFTFP_FFI, softfp_f2i, 1, N, INT, 0) \ - _(SOFTFP_FFI, softfp_f2ui, 1, N, INT, 0) \ - _(FP64_FFI, fp64_l2d, 2, N, NUM, 0) \ - _(FP64_FFI, fp64_ul2d, 2, N, NUM, 0) \ - _(FP64_FFI, fp64_l2f, 2, N, FLOAT, 0) \ - _(FP64_FFI, fp64_ul2f, 2, N, FLOAT, 0) \ - _(FP64_FFI, fp64_d2l, ARG1_FP, N, I64, 0) \ - _(FP64_FFI, fp64_d2ul, ARG1_FP, N, U64, 0) \ - _(FP64_FFI, fp64_f2l, 1, N, I64, 0) \ - _(FP64_FFI, fp64_f2ul, 1, N, U64, 0) \ - _(FFI, lj_carith_divi64, ARG2_64, N, I64, CCI_NOFPRCLOBBER) \ - _(FFI, lj_carith_divu64, ARG2_64, N, U64, CCI_NOFPRCLOBBER) \ - _(FFI, lj_carith_modi64, ARG2_64, N, I64, CCI_NOFPRCLOBBER) \ - _(FFI, lj_carith_modu64, ARG2_64, N, U64, CCI_NOFPRCLOBBER) \ - _(FFI, lj_carith_powi64, ARG2_64, N, I64, CCI_NOFPRCLOBBER) \ - _(FFI, lj_carith_powu64, ARG2_64, N, U64, CCI_NOFPRCLOBBER) \ - _(FFI, lj_cdata_setfin, 2, FN, P32, CCI_L) \ - _(FFI, strlen, 1, L, INTP, 0) \ - _(FFI, memcpy, 3, S, PTR, 0) \ - _(FFI, memset, 3, S, PTR, 0) \ - _(FFI, lj_vm_errno, 0, S, INT, CCI_NOFPRCLOBBER) \ - _(FFI32, lj_carith_mul64, ARG2_64, N, I64, CCI_NOFPRCLOBBER) - \ - /* End of list. */ - -typedef enum { -#define IRCALLENUM(cond, name, nargs, kind, type, flags) IRCALL_##name, -IRCALLDEF(IRCALLENUM) -#undef IRCALLENUM - IRCALL__MAX -} IRCallID; - -LJ_FUNC TRef lj_ir_call(jit_State *J, IRCallID id, ...); - -LJ_DATA const CCallInfo lj_ir_callinfo[IRCALL__MAX+1]; - -/* Soft-float declarations. */ -#if LJ_SOFTFP -#if LJ_TARGET_ARM -#define softfp_add __aeabi_dadd -#define softfp_sub __aeabi_dsub -#define softfp_mul __aeabi_dmul -#define softfp_div __aeabi_ddiv -#define softfp_cmp __aeabi_cdcmple -#define softfp_i2d __aeabi_i2d -#define softfp_d2i __aeabi_d2iz -#define softfp_ui2d __aeabi_ui2d -#define softfp_f2d __aeabi_f2d -#define softfp_d2ui __aeabi_d2uiz -#define softfp_d2f __aeabi_d2f -#define softfp_i2f __aeabi_i2f -#define softfp_ui2f __aeabi_ui2f -#define softfp_f2i __aeabi_f2iz -#define softfp_f2ui __aeabi_f2uiz -#define fp64_l2d __aeabi_l2d -#define fp64_ul2d __aeabi_ul2d -#define fp64_l2f __aeabi_l2f -#define fp64_ul2f __aeabi_ul2f -#if LJ_TARGET_IOS -#define fp64_d2l __fixdfdi -#define fp64_d2ul __fixunsdfdi -#define fp64_f2l __fixsfdi -#define fp64_f2ul __fixunssfdi -#else -#define fp64_d2l __aeabi_d2lz -#define fp64_d2ul __aeabi_d2ulz -#define fp64_f2l __aeabi_f2lz -#define fp64_f2ul __aeabi_f2ulz -#endif -#else -#error "Missing soft-float definitions for target architecture" -#endif -extern double softfp_add(double a, double b); -extern double softfp_sub(double a, double b); -extern double softfp_mul(double a, double b); -extern double softfp_div(double a, double b); -extern void softfp_cmp(double a, double b); -extern double softfp_i2d(int32_t a); -extern int32_t softfp_d2i(double a); -#if LJ_HASFFI -extern double softfp_ui2d(uint32_t a); -extern double softfp_f2d(float a); -extern uint32_t softfp_d2ui(double a); -extern float softfp_d2f(double a); -extern float softfp_i2f(int32_t a); -extern float softfp_ui2f(uint32_t a); -extern int32_t softfp_f2i(float a); -extern uint32_t softfp_f2ui(float a); -#endif -#endif - -#if LJ_HASFFI && LJ_NEED_FP64 && !(LJ_TARGET_ARM && LJ_SOFTFP) -#ifdef __GNUC__ -#define fp64_l2d __floatdidf -#define fp64_ul2d __floatundidf -#define fp64_l2f __floatdisf -#define fp64_ul2f __floatundisf -#define fp64_d2l __fixdfdi -#define fp64_d2ul __fixunsdfdi -#define fp64_f2l __fixsfdi -#define fp64_f2ul __fixunssfdi -#else -#error "Missing fp64 helper definitions for this compiler" -#endif -#endif - -#if LJ_HASFFI && (LJ_SOFTFP || LJ_NEED_FP64) -extern double fp64_l2d(int64_t a); -extern double fp64_ul2d(uint64_t a); -extern float fp64_l2f(int64_t a); -extern float fp64_ul2f(uint64_t a); -extern int64_t fp64_d2l(double a); -extern uint64_t fp64_d2ul(double a); -extern int64_t fp64_f2l(float a); -extern uint64_t fp64_f2ul(float a); -#endif - -#endif diff --git a/subprojects/luajit/src/lj_iropt.h b/subprojects/luajit/src/lj_iropt.h deleted file mode 100644 index b5081e069..000000000 --- a/subprojects/luajit/src/lj_iropt.h +++ /dev/null @@ -1,161 +0,0 @@ -/* -** Common header for IR emitter and optimizations. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_IROPT_H -#define _LJ_IROPT_H - -#include - -#include "lj_obj.h" -#include "lj_jit.h" - -#if LJ_HASJIT -/* IR emitter. */ -LJ_FUNC void LJ_FASTCALL lj_ir_growtop(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_ir_emit(jit_State *J); - -/* Save current IR in J->fold.ins, but do not emit it (yet). */ -static LJ_AINLINE void lj_ir_set_(jit_State *J, uint16_t ot, IRRef1 a, IRRef1 b) -{ - J->fold.ins.ot = ot; J->fold.ins.op1 = a; J->fold.ins.op2 = b; -} - -#define lj_ir_set(J, ot, a, b) \ - lj_ir_set_(J, (uint16_t)(ot), (IRRef1)(a), (IRRef1)(b)) - -/* Get ref of next IR instruction and optionally grow IR. -** Note: this may invalidate all IRIns*! -*/ -static LJ_AINLINE IRRef lj_ir_nextins(jit_State *J) -{ - IRRef ref = J->cur.nins; - if (LJ_UNLIKELY(ref >= J->irtoplim)) lj_ir_growtop(J); - J->cur.nins = ref + 1; - return ref; -} - -/* Interning of constants. */ -LJ_FUNC TRef LJ_FASTCALL lj_ir_kint(jit_State *J, int32_t k); -LJ_FUNC void lj_ir_k64_freeall(jit_State *J); -LJ_FUNC TRef lj_ir_k64(jit_State *J, IROp op, cTValue *tv); -LJ_FUNC cTValue *lj_ir_k64_find(jit_State *J, uint64_t u64); -LJ_FUNC TRef lj_ir_knum_u64(jit_State *J, uint64_t u64); -LJ_FUNC TRef lj_ir_knumint(jit_State *J, lua_Number n); -LJ_FUNC TRef lj_ir_kint64(jit_State *J, uint64_t u64); -LJ_FUNC TRef lj_ir_kgc(jit_State *J, GCobj *o, IRType t); -LJ_FUNC TRef lj_ir_kptr_(jit_State *J, IROp op, void *ptr); -LJ_FUNC TRef lj_ir_knull(jit_State *J, IRType t); -LJ_FUNC TRef lj_ir_kslot(jit_State *J, TRef key, IRRef slot); - -#if LJ_64 -#define lj_ir_kintp(J, k) lj_ir_kint64(J, (uint64_t)(k)) -#else -#define lj_ir_kintp(J, k) lj_ir_kint(J, (int32_t)(k)) -#endif - -static LJ_AINLINE TRef lj_ir_knum(jit_State *J, lua_Number n) -{ - TValue tv; - tv.n = n; - return lj_ir_knum_u64(J, tv.u64); -} - -#define lj_ir_kstr(J, str) lj_ir_kgc(J, obj2gco((str)), IRT_STR) -#define lj_ir_ktab(J, tab) lj_ir_kgc(J, obj2gco((tab)), IRT_TAB) -#define lj_ir_kfunc(J, func) lj_ir_kgc(J, obj2gco((func)), IRT_FUNC) -#define lj_ir_kptr(J, ptr) lj_ir_kptr_(J, IR_KPTR, (ptr)) -#define lj_ir_kkptr(J, ptr) lj_ir_kptr_(J, IR_KKPTR, (ptr)) - -/* Special FP constants. */ -#define lj_ir_knum_zero(J) lj_ir_knum_u64(J, U64x(00000000,00000000)) -#define lj_ir_knum_one(J) lj_ir_knum_u64(J, U64x(3ff00000,00000000)) -#define lj_ir_knum_tobit(J) lj_ir_knum_u64(J, U64x(43380000,00000000)) - -/* Special 128 bit SIMD constants. */ -#define lj_ir_knum_abs(J) lj_ir_k64(J, IR_KNUM, LJ_KSIMD(J, LJ_KSIMD_ABS)) -#define lj_ir_knum_neg(J) lj_ir_k64(J, IR_KNUM, LJ_KSIMD(J, LJ_KSIMD_NEG)) - -/* Access to constants. */ -LJ_FUNC void lj_ir_kvalue(lua_State *L, TValue *tv, const IRIns *ir); - -/* Convert IR operand types. */ -LJ_FUNC TRef LJ_FASTCALL lj_ir_tonumber(jit_State *J, TRef tr); -LJ_FUNC TRef LJ_FASTCALL lj_ir_tonum(jit_State *J, TRef tr); -LJ_FUNC TRef LJ_FASTCALL lj_ir_tostr(jit_State *J, TRef tr); - -/* Miscellaneous IR ops. */ -LJ_FUNC int lj_ir_numcmp(lua_Number a, lua_Number b, IROp op); -LJ_FUNC int lj_ir_strcmp(GCstr *a, GCstr *b, IROp op); -LJ_FUNC void lj_ir_rollback(jit_State *J, IRRef ref); - -/* Emit IR instructions with on-the-fly optimizations. */ -LJ_FUNC TRef LJ_FASTCALL lj_opt_fold(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_opt_cse(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_opt_cselim(jit_State *J, IRRef lim); - -/* Special return values for the fold functions. */ -enum { - NEXTFOLD, /* Couldn't fold, pass on. */ - RETRYFOLD, /* Retry fold with modified fins. */ - KINTFOLD, /* Return ref for int constant in fins->i. */ - FAILFOLD, /* Guard would always fail. */ - DROPFOLD, /* Guard eliminated. */ - MAX_FOLD -}; - -#define INTFOLD(k) ((J->fold.ins.i = (k)), (TRef)KINTFOLD) -#define INT64FOLD(k) (lj_ir_kint64(J, (k))) -#define CONDFOLD(cond) ((TRef)FAILFOLD + (TRef)(cond)) -#define LEFTFOLD (J->fold.ins.op1) -#define RIGHTFOLD (J->fold.ins.op2) -#define CSEFOLD (lj_opt_cse(J)) -#define EMITFOLD (lj_ir_emit(J)) - -/* Load/store forwarding. */ -LJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_aload(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_hload(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_uload(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_fload(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_xload(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_tab_len(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_hrefk(jit_State *J); -LJ_FUNC int LJ_FASTCALL lj_opt_fwd_href_nokey(jit_State *J); -LJ_FUNC int LJ_FASTCALL lj_opt_fwd_tptr(jit_State *J, IRRef lim); -LJ_FUNC int lj_opt_fwd_wasnonnil(jit_State *J, IROpT loadop, IRRef xref); - -/* Dead-store elimination. */ -LJ_FUNC TRef LJ_FASTCALL lj_opt_dse_ahstore(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_opt_dse_ustore(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_opt_dse_fstore(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_opt_dse_xstore(jit_State *J); - -/* Narrowing. */ -LJ_FUNC TRef LJ_FASTCALL lj_opt_narrow_convert(jit_State *J); -LJ_FUNC TRef LJ_FASTCALL lj_opt_narrow_index(jit_State *J, TRef key); -LJ_FUNC TRef LJ_FASTCALL lj_opt_narrow_toint(jit_State *J, TRef tr); -LJ_FUNC TRef LJ_FASTCALL lj_opt_narrow_tobit(jit_State *J, TRef tr); -#if LJ_HASFFI -LJ_FUNC TRef LJ_FASTCALL lj_opt_narrow_cindex(jit_State *J, TRef key); -#endif -LJ_FUNC TRef lj_opt_narrow_arith(jit_State *J, TRef rb, TRef rc, - TValue *vb, TValue *vc, IROp op); -LJ_FUNC TRef lj_opt_narrow_unm(jit_State *J, TRef rc, TValue *vc); -LJ_FUNC TRef lj_opt_narrow_mod(jit_State *J, TRef rb, TRef rc, TValue *vb, TValue *vc); -LJ_FUNC TRef lj_opt_narrow_pow(jit_State *J, TRef rb, TRef rc, TValue *vb, TValue *vc); -LJ_FUNC IRType lj_opt_narrow_forl(jit_State *J, cTValue *forbase); - -/* Optimization passes. */ -LJ_FUNC void lj_opt_dce(jit_State *J); -LJ_FUNC int lj_opt_loop(jit_State *J); -#if LJ_SOFTFP || (LJ_32 && LJ_HASFFI) -LJ_FUNC void lj_opt_split(jit_State *J); -#else -#define lj_opt_split(J) UNUSED(J) -#endif -LJ_FUNC void lj_opt_sink(jit_State *J); - -#endif - -#endif diff --git a/subprojects/luajit/src/lj_jit.h b/subprojects/luajit/src/lj_jit.h deleted file mode 100644 index a2e8fd922..000000000 --- a/subprojects/luajit/src/lj_jit.h +++ /dev/null @@ -1,417 +0,0 @@ -/* -** Common definitions for the JIT compiler. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_JIT_H -#define _LJ_JIT_H - -#include "lj_obj.h" -#include "lj_ir.h" - -/* JIT engine flags. */ -#define JIT_F_ON 0x00000001 - -/* CPU-specific JIT engine flags. */ -#if LJ_TARGET_X86ORX64 -#define JIT_F_CMOV 0x00000010 -#define JIT_F_SSE2 0x00000020 -#define JIT_F_SSE3 0x00000040 -#define JIT_F_SSE4_1 0x00000080 -#define JIT_F_P4 0x00000100 -#define JIT_F_PREFER_IMUL 0x00000200 -#define JIT_F_SPLIT_XMM 0x00000400 -#define JIT_F_LEA_AGU 0x00000800 - -/* Names for the CPU-specific flags. Must match the order above. */ -#define JIT_F_CPU_FIRST JIT_F_CMOV -#define JIT_F_CPUSTRING "\4CMOV\4SSE2\4SSE3\6SSE4.1\2P4\3AMD\2K8\4ATOM" -#elif LJ_TARGET_ARM -#define JIT_F_ARMV6_ 0x00000010 -#define JIT_F_ARMV6T2_ 0x00000020 -#define JIT_F_ARMV7 0x00000040 -#define JIT_F_VFPV2 0x00000080 -#define JIT_F_VFPV3 0x00000100 - -#define JIT_F_ARMV6 (JIT_F_ARMV6_|JIT_F_ARMV6T2_|JIT_F_ARMV7) -#define JIT_F_ARMV6T2 (JIT_F_ARMV6T2_|JIT_F_ARMV7) -#define JIT_F_VFP (JIT_F_VFPV2|JIT_F_VFPV3) - -/* Names for the CPU-specific flags. Must match the order above. */ -#define JIT_F_CPU_FIRST JIT_F_ARMV6_ -#define JIT_F_CPUSTRING "\5ARMv6\7ARMv6T2\5ARMv7\5VFPv2\5VFPv3" -#elif LJ_TARGET_PPC -#define JIT_F_SQRT 0x00000010 -#define JIT_F_ROUND 0x00000020 - -/* Names for the CPU-specific flags. Must match the order above. */ -#define JIT_F_CPU_FIRST JIT_F_SQRT -#define JIT_F_CPUSTRING "\4SQRT\5ROUND" -#elif LJ_TARGET_MIPS -#define JIT_F_MIPS32R2 0x00000010 - -/* Names for the CPU-specific flags. Must match the order above. */ -#define JIT_F_CPU_FIRST JIT_F_MIPS32R2 -#define JIT_F_CPUSTRING "\010MIPS32R2" -#else -#define JIT_F_CPU_FIRST 0 -#define JIT_F_CPUSTRING "" -#endif - -/* Optimization flags. */ -#define JIT_F_OPT_MASK 0x0fff0000 - -#define JIT_F_OPT_FOLD 0x00010000 -#define JIT_F_OPT_CSE 0x00020000 -#define JIT_F_OPT_DCE 0x00040000 -#define JIT_F_OPT_FWD 0x00080000 -#define JIT_F_OPT_DSE 0x00100000 -#define JIT_F_OPT_NARROW 0x00200000 -#define JIT_F_OPT_LOOP 0x00400000 -#define JIT_F_OPT_ABC 0x00800000 -#define JIT_F_OPT_SINK 0x01000000 -#define JIT_F_OPT_FUSE 0x02000000 - -/* Optimizations names for -O. Must match the order above. */ -#define JIT_F_OPT_FIRST JIT_F_OPT_FOLD -#define JIT_F_OPTSTRING \ - "\4fold\3cse\3dce\3fwd\3dse\6narrow\4loop\3abc\4sink\4fuse" - -/* Optimization levels set a fixed combination of flags. */ -#define JIT_F_OPT_0 0 -#define JIT_F_OPT_1 (JIT_F_OPT_FOLD|JIT_F_OPT_CSE|JIT_F_OPT_DCE) -#define JIT_F_OPT_2 (JIT_F_OPT_1|JIT_F_OPT_NARROW|JIT_F_OPT_LOOP) -#define JIT_F_OPT_3 (JIT_F_OPT_2|\ - JIT_F_OPT_FWD|JIT_F_OPT_DSE|JIT_F_OPT_ABC|JIT_F_OPT_SINK|JIT_F_OPT_FUSE) -#define JIT_F_OPT_DEFAULT JIT_F_OPT_3 - -#if LJ_TARGET_WINDOWS || LJ_64 -/* See: http://blogs.msdn.com/oldnewthing/archive/2003/10/08/55239.aspx */ -#define JIT_P_sizemcode_DEFAULT 64 -#else -/* Could go as low as 4K, but the mmap() overhead would be rather high. */ -#define JIT_P_sizemcode_DEFAULT 32 -#endif - -/* Optimization parameters and their defaults. Length is a char in octal! */ -#define JIT_PARAMDEF(_) \ - _(\010, maxtrace, 1000) /* Max. # of traces in cache. */ \ - _(\011, maxrecord, 4000) /* Max. # of recorded IR instructions. */ \ - _(\012, maxirconst, 500) /* Max. # of IR constants of a trace. */ \ - _(\007, maxside, 100) /* Max. # of side traces of a root trace. */ \ - _(\007, maxsnap, 500) /* Max. # of snapshots for a trace. */ \ - \ - _(\007, hotloop, 56) /* # of iter. to detect a hot loop/call. */ \ - _(\007, hotexit, 10) /* # of taken exits to start a side trace. */ \ - _(\007, tryside, 4) /* # of attempts to compile a side trace. */ \ - \ - _(\012, instunroll, 4) /* Max. unroll for instable loops. */ \ - _(\012, loopunroll, 15) /* Max. unroll for loop ops in side traces. */ \ - _(\012, callunroll, 3) /* Max. unroll for recursive calls. */ \ - _(\011, recunroll, 2) /* Min. unroll for true recursion. */ \ - \ - /* Size of each machine code area (in KBytes). */ \ - _(\011, sizemcode, JIT_P_sizemcode_DEFAULT) \ - /* Max. total size of all machine code areas (in KBytes). */ \ - _(\010, maxmcode, 512) \ - /* End of list. */ - -enum { -#define JIT_PARAMENUM(len, name, value) JIT_P_##name, -JIT_PARAMDEF(JIT_PARAMENUM) -#undef JIT_PARAMENUM - JIT_P__MAX -}; - -#define JIT_PARAMSTR(len, name, value) #len #name -#define JIT_P_STRING JIT_PARAMDEF(JIT_PARAMSTR) - -/* Trace compiler state. */ -typedef enum { - LJ_TRACE_IDLE, /* Trace compiler idle. */ - LJ_TRACE_ACTIVE = 0x10, - LJ_TRACE_RECORD, /* Bytecode recording active. */ - LJ_TRACE_START, /* New trace started. */ - LJ_TRACE_END, /* End of trace. */ - LJ_TRACE_ASM, /* Assemble trace. */ - LJ_TRACE_ERR /* Trace aborted with error. */ -} TraceState; - -/* Post-processing action. */ -typedef enum { - LJ_POST_NONE, /* No action. */ - LJ_POST_FIXCOMP, /* Fixup comparison and emit pending guard. */ - LJ_POST_FIXGUARD, /* Fixup and emit pending guard. */ - LJ_POST_FIXGUARDSNAP, /* Fixup and emit pending guard and snapshot. */ - LJ_POST_FIXBOOL, /* Fixup boolean result. */ - LJ_POST_FIXCONST, /* Fixup constant results. */ - LJ_POST_FFRETRY /* Suppress recording of retried fast functions. */ -} PostProc; - -/* Machine code type. */ -#if LJ_TARGET_X86ORX64 -typedef uint8_t MCode; -#else -typedef uint32_t MCode; -#endif - -/* Stack snapshot header. */ -typedef struct SnapShot { - uint16_t mapofs; /* Offset into snapshot map. */ - IRRef1 ref; /* First IR ref for this snapshot. */ - uint8_t nslots; /* Number of valid slots. */ - uint8_t topslot; /* Maximum frame extent. */ - uint8_t nent; /* Number of compressed entries. */ - uint8_t count; /* Count of taken exits for this snapshot. */ -} SnapShot; - -#define SNAPCOUNT_DONE 255 /* Already compiled and linked a side trace. */ - -/* Compressed snapshot entry. */ -typedef uint32_t SnapEntry; - -#define SNAP_FRAME 0x010000 /* Frame slot. */ -#define SNAP_CONT 0x020000 /* Continuation slot. */ -#define SNAP_NORESTORE 0x040000 /* No need to restore slot. */ -#define SNAP_SOFTFPNUM 0x080000 /* Soft-float number. */ -LJ_STATIC_ASSERT(SNAP_FRAME == TREF_FRAME); -LJ_STATIC_ASSERT(SNAP_CONT == TREF_CONT); - -#define SNAP(slot, flags, ref) (((SnapEntry)(slot) << 24) + (flags) + (ref)) -#define SNAP_TR(slot, tr) \ - (((SnapEntry)(slot) << 24) + ((tr) & (TREF_CONT|TREF_FRAME|TREF_REFMASK))) -#define SNAP_MKPC(pc) ((SnapEntry)u32ptr(pc)) -#define SNAP_MKFTSZ(ftsz) ((SnapEntry)(ftsz)) -#define snap_ref(sn) ((sn) & 0xffff) -#define snap_slot(sn) ((BCReg)((sn) >> 24)) -#define snap_isframe(sn) ((sn) & SNAP_FRAME) -#define snap_pc(sn) ((const BCIns *)(uintptr_t)(sn)) -#define snap_setref(sn, ref) (((sn) & (0xffff0000&~SNAP_NORESTORE)) | (ref)) - -/* Snapshot and exit numbers. */ -typedef uint32_t SnapNo; -typedef uint32_t ExitNo; - -/* Trace number. */ -typedef uint32_t TraceNo; /* Used to pass around trace numbers. */ -typedef uint16_t TraceNo1; /* Stored trace number. */ - -/* Type of link. ORDER LJ_TRLINK */ -typedef enum { - LJ_TRLINK_NONE, /* Incomplete trace. No link, yet. */ - LJ_TRLINK_ROOT, /* Link to other root trace. */ - LJ_TRLINK_LOOP, /* Loop to same trace. */ - LJ_TRLINK_TAILREC, /* Tail-recursion. */ - LJ_TRLINK_UPREC, /* Up-recursion. */ - LJ_TRLINK_DOWNREC, /* Down-recursion. */ - LJ_TRLINK_INTERP, /* Fallback to interpreter. */ - LJ_TRLINK_RETURN /* Return to interpreter. */ -} TraceLink; - -/* Trace object. */ -typedef struct GCtrace { - GCHeader; - uint8_t topslot; /* Top stack slot already checked to be allocated. */ - uint8_t linktype; /* Type of link. */ - IRRef nins; /* Next IR instruction. Biased with REF_BIAS. */ - GCRef gclist; - IRIns *ir; /* IR instructions/constants. Biased with REF_BIAS. */ - IRRef nk; /* Lowest IR constant. Biased with REF_BIAS. */ - uint16_t nsnap; /* Number of snapshots. */ - uint16_t nsnapmap; /* Number of snapshot map elements. */ - SnapShot *snap; /* Snapshot array. */ - SnapEntry *snapmap; /* Snapshot map. */ - GCRef startpt; /* Starting prototype. */ - MRef startpc; /* Bytecode PC of starting instruction. */ - BCIns startins; /* Original bytecode of starting instruction. */ - MSize szmcode; /* Size of machine code. */ - MCode *mcode; /* Start of machine code. */ - MSize mcloop; /* Offset of loop start in machine code. */ - uint16_t nchild; /* Number of child traces (root trace only). */ - uint16_t spadjust; /* Stack pointer adjustment (offset in bytes). */ - TraceNo1 traceno; /* Trace number. */ - TraceNo1 link; /* Linked trace (or self for loops). */ - TraceNo1 root; /* Root trace of side trace (or 0 for root traces). */ - TraceNo1 nextroot; /* Next root trace for same prototype. */ - TraceNo1 nextside; /* Next side trace of same root trace. */ - uint8_t sinktags; /* Trace has SINK tags. */ - uint8_t unused1; -#ifdef LUAJIT_USE_GDBJIT - void *gdbjit_entry; /* GDB JIT entry. */ -#endif -} GCtrace; - -#define gco2trace(o) check_exp((o)->gch.gct == ~LJ_TTRACE, (GCtrace *)(o)) -#define traceref(J, n) \ - check_exp((n)>0 && (MSize)(n)sizetrace, (GCtrace *)gcref(J->trace[(n)])) - -LJ_STATIC_ASSERT(offsetof(GChead, gclist) == offsetof(GCtrace, gclist)); - -static LJ_AINLINE MSize snap_nextofs(GCtrace *T, SnapShot *snap) -{ - if (snap+1 == &T->snap[T->nsnap]) - return T->nsnapmap; - else - return (snap+1)->mapofs; -} - -/* Round-robin penalty cache for bytecodes leading to aborted traces. */ -typedef struct HotPenalty { - MRef pc; /* Starting bytecode PC. */ - uint16_t val; /* Penalty value, i.e. hotcount start. */ - uint16_t reason; /* Abort reason (really TraceErr). */ -} HotPenalty; - -#define PENALTY_SLOTS 64 /* Penalty cache slot. Must be a power of 2. */ -#define PENALTY_MIN (36*2) /* Minimum penalty value. */ -#define PENALTY_MAX 60000 /* Maximum penalty value. */ -#define PENALTY_RNDBITS 4 /* # of random bits to add to penalty value. */ - -/* Round-robin backpropagation cache for narrowing conversions. */ -typedef struct BPropEntry { - IRRef1 key; /* Key: original reference. */ - IRRef1 val; /* Value: reference after conversion. */ - IRRef mode; /* Mode for this entry (currently IRCONV_*). */ -} BPropEntry; - -/* Number of slots for the backpropagation cache. Must be a power of 2. */ -#define BPROP_SLOTS 16 - -/* Scalar evolution analysis cache. */ -typedef struct ScEvEntry { - MRef pc; /* Bytecode PC of FORI. */ - IRRef1 idx; /* Index reference. */ - IRRef1 start; /* Constant start reference. */ - IRRef1 stop; /* Constant stop reference. */ - IRRef1 step; /* Constant step reference. */ - IRType1 t; /* Scalar type. */ - uint8_t dir; /* Direction. 1: +, 0: -. */ -} ScEvEntry; - -/* 128 bit SIMD constants. */ -enum { - LJ_KSIMD_ABS, - LJ_KSIMD_NEG, - LJ_KSIMD__MAX -}; - -/* Get 16 byte aligned pointer to SIMD constant. */ -#define LJ_KSIMD(J, n) \ - ((TValue *)(((intptr_t)&J->ksimd[2*(n)] + 15) & ~(intptr_t)15)) - -/* Set/reset flag to activate the SPLIT pass for the current trace. */ -#if LJ_SOFTFP || (LJ_32 && LJ_HASFFI) -#define lj_needsplit(J) (J->needsplit = 1) -#define lj_resetsplit(J) (J->needsplit = 0) -#else -#define lj_needsplit(J) UNUSED(J) -#define lj_resetsplit(J) UNUSED(J) -#endif - -/* Fold state is used to fold instructions on-the-fly. */ -typedef struct FoldState { - IRIns ins; /* Currently emitted instruction. */ - IRIns left; /* Instruction referenced by left operand. */ - IRIns right; /* Instruction referenced by right operand. */ -} FoldState; - -/* JIT compiler state. */ -typedef struct jit_State { - GCtrace cur; /* Current trace. */ - - lua_State *L; /* Current Lua state. */ - const BCIns *pc; /* Current PC. */ - GCfunc *fn; /* Current function. */ - GCproto *pt; /* Current prototype. */ - TRef *base; /* Current frame base, points into J->slots. */ - - uint32_t flags; /* JIT engine flags. */ - BCReg maxslot; /* Relative to baseslot. */ - BCReg baseslot; /* Current frame base, offset into J->slots. */ - - uint8_t mergesnap; /* Allowed to merge with next snapshot. */ - uint8_t needsnap; /* Need snapshot before recording next bytecode. */ - IRType1 guardemit; /* Accumulated IRT_GUARD for emitted instructions. */ - uint8_t bcskip; /* Number of bytecode instructions to skip. */ - - FoldState fold; /* Fold state. */ - - const BCIns *bc_min; /* Start of allowed bytecode range for root trace. */ - MSize bc_extent; /* Extent of the range. */ - - TraceState state; /* Trace compiler state. */ - - int32_t instunroll; /* Unroll counter for instable loops. */ - int32_t loopunroll; /* Unroll counter for loop ops in side traces. */ - int32_t tailcalled; /* Number of successive tailcalls. */ - int32_t framedepth; /* Current frame depth. */ - int32_t retdepth; /* Return frame depth (count of RETF). */ - - MRef k64; /* Pointer to chained array of 64 bit constants. */ - TValue ksimd[LJ_KSIMD__MAX*2+1]; /* 16 byte aligned SIMD constants. */ - - IRIns *irbuf; /* Temp. IR instruction buffer. Biased with REF_BIAS. */ - IRRef irtoplim; /* Upper limit of instuction buffer (biased). */ - IRRef irbotlim; /* Lower limit of instuction buffer (biased). */ - IRRef loopref; /* Last loop reference or ref of final LOOP (or 0). */ - - MSize sizesnap; /* Size of temp. snapshot buffer. */ - SnapShot *snapbuf; /* Temp. snapshot buffer. */ - SnapEntry *snapmapbuf; /* Temp. snapshot map buffer. */ - MSize sizesnapmap; /* Size of temp. snapshot map buffer. */ - - PostProc postproc; /* Required post-processing after execution. */ -#if LJ_SOFTFP || (LJ_32 && LJ_HASFFI) - int needsplit; /* Need SPLIT pass. */ -#endif - - GCRef *trace; /* Array of traces. */ - TraceNo freetrace; /* Start of scan for next free trace. */ - MSize sizetrace; /* Size of trace array. */ - - IRRef1 chain[IR__MAX]; /* IR instruction skip-list chain anchors. */ - TRef slot[LJ_MAX_JSLOTS+LJ_STACK_EXTRA]; /* Stack slot map. */ - - int32_t param[JIT_P__MAX]; /* JIT engine parameters. */ - - MCode *exitstubgroup[LJ_MAX_EXITSTUBGR]; /* Exit stub group addresses. */ - - HotPenalty penalty[PENALTY_SLOTS]; /* Penalty slots. */ - uint32_t penaltyslot; /* Round-robin index into penalty slots. */ - uint32_t prngstate; /* PRNG state. */ - - BPropEntry bpropcache[BPROP_SLOTS]; /* Backpropagation cache slots. */ - uint32_t bpropslot; /* Round-robin index into bpropcache slots. */ - - ScEvEntry scev; /* Scalar evolution analysis cache slots. */ - - const BCIns *startpc; /* Bytecode PC of starting instruction. */ - TraceNo parent; /* Parent of current side trace (0 for root traces). */ - ExitNo exitno; /* Exit number in parent of current side trace. */ - - BCIns *patchpc; /* PC for pending re-patch. */ - BCIns patchins; /* Instruction for pending re-patch. */ - - int mcprot; /* Protection of current mcode area. */ - MCode *mcarea; /* Base of current mcode area. */ - MCode *mctop; /* Top of current mcode area. */ - MCode *mcbot; /* Bottom of current mcode area. */ - size_t szmcarea; /* Size of current mcode area. */ - size_t szallmcarea; /* Total size of all allocated mcode areas. */ - - TValue errinfo; /* Additional info element for trace errors. */ -} -#if LJ_TARGET_ARM -LJ_ALIGN(16) /* For DISPATCH-relative addresses in assembler part. */ -#endif -jit_State; - -/* Trivial PRNG e.g. used for penalty randomization. */ -static LJ_AINLINE uint32_t LJ_PRNG_BITS(jit_State *J, int bits) -{ - /* Yes, this LCG is very weak, but that doesn't matter for our use case. */ - J->prngstate = J->prngstate * 1103515245 + 12345; - return J->prngstate >> (32-bits); -} - -#endif diff --git a/subprojects/luajit/src/lj_lex.c b/subprojects/luajit/src/lj_lex.c deleted file mode 100644 index 366031680..000000000 --- a/subprojects/luajit/src/lj_lex.c +++ /dev/null @@ -1,482 +0,0 @@ -/* -** Lexical analyzer. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#define lj_lex_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#if LJ_HASFFI -#include "lj_tab.h" -#include "lj_ctype.h" -#include "lj_cdata.h" -#include "lualib.h" -#endif -#include "lj_state.h" -#include "lj_lex.h" -#include "lj_parse.h" -#include "lj_char.h" -#include "lj_strscan.h" - -/* Lua lexer token names. */ -static const char *const tokennames[] = { -#define TKSTR1(name) #name, -#define TKSTR2(name, sym) #sym, -TKDEF(TKSTR1, TKSTR2) -#undef TKSTR1 -#undef TKSTR2 - NULL -}; - -/* -- Buffer handling ----------------------------------------------------- */ - -#define char2int(c) ((int)(uint8_t)(c)) -#define next(ls) \ - (ls->current = (ls->n--) > 0 ? char2int(*ls->p++) : fillbuf(ls)) -#define save_and_next(ls) (save(ls, ls->current), next(ls)) -#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r') -#define END_OF_STREAM (-1) - -static int fillbuf(LexState *ls) -{ - size_t sz; - const char *buf = ls->rfunc(ls->L, ls->rdata, &sz); - if (buf == NULL || sz == 0) return END_OF_STREAM; - ls->n = (MSize)sz - 1; - ls->p = buf; - return char2int(*(ls->p++)); -} - -static LJ_NOINLINE void save_grow(LexState *ls, int c) -{ - MSize newsize; - if (ls->sb.sz >= LJ_MAX_STR/2) - lj_lex_error(ls, 0, LJ_ERR_XELEM); - newsize = ls->sb.sz * 2; - lj_str_resizebuf(ls->L, &ls->sb, newsize); - ls->sb.buf[ls->sb.n++] = (char)c; -} - -static LJ_AINLINE void save(LexState *ls, int c) -{ - if (LJ_UNLIKELY(ls->sb.n + 1 > ls->sb.sz)) - save_grow(ls, c); - else - ls->sb.buf[ls->sb.n++] = (char)c; -} - -static void inclinenumber(LexState *ls) -{ - int old = ls->current; - lua_assert(currIsNewline(ls)); - next(ls); /* skip `\n' or `\r' */ - if (currIsNewline(ls) && ls->current != old) - next(ls); /* skip `\n\r' or `\r\n' */ - if (++ls->linenumber >= LJ_MAX_LINE) - lj_lex_error(ls, ls->token, LJ_ERR_XLINES); -} - -/* -- Scanner for terminals ----------------------------------------------- */ - -/* Parse a number literal. */ -static void lex_number(LexState *ls, TValue *tv) -{ - StrScanFmt fmt; - int c, xp = 'e'; - lua_assert(lj_char_isdigit(ls->current)); - if ((c = ls->current) == '0') { - save_and_next(ls); - if ((ls->current | 0x20) == 'x') xp = 'p'; - } - while (lj_char_isident(ls->current) || ls->current == '.' || - ((ls->current == '-' || ls->current == '+') && (c | 0x20) == xp)) { - c = ls->current; - save_and_next(ls); - } - save(ls, '\0'); - fmt = lj_strscan_scan((const uint8_t *)ls->sb.buf, tv, - (LJ_DUALNUM ? STRSCAN_OPT_TOINT : STRSCAN_OPT_TONUM) | - (LJ_HASFFI ? (STRSCAN_OPT_LL|STRSCAN_OPT_IMAG) : 0)); - if (LJ_DUALNUM && fmt == STRSCAN_INT) { - setitype(tv, LJ_TISNUM); - } else if (fmt == STRSCAN_NUM) { - /* Already in correct format. */ -#if LJ_HASFFI - } else if (fmt != STRSCAN_ERROR) { - lua_State *L = ls->L; - GCcdata *cd; - lua_assert(fmt == STRSCAN_I64 || fmt == STRSCAN_U64 || fmt == STRSCAN_IMAG); - if (!ctype_ctsG(G(L))) { - ptrdiff_t oldtop = savestack(L, L->top); - luaopen_ffi(L); /* Load FFI library on-demand. */ - L->top = restorestack(L, oldtop); - } - if (fmt == STRSCAN_IMAG) { - cd = lj_cdata_new_(L, CTID_COMPLEX_DOUBLE, 2*sizeof(double)); - ((double *)cdataptr(cd))[0] = 0; - ((double *)cdataptr(cd))[1] = numV(tv); - } else { - cd = lj_cdata_new_(L, fmt==STRSCAN_I64 ? CTID_INT64 : CTID_UINT64, 8); - *(uint64_t *)cdataptr(cd) = tv->u64; - } - lj_parse_keepcdata(ls, tv, cd); -#endif - } else { - lua_assert(fmt == STRSCAN_ERROR); - lj_lex_error(ls, TK_number, LJ_ERR_XNUMBER); - } -} - -static int skip_sep(LexState *ls) -{ - int count = 0; - int s = ls->current; - lua_assert(s == '[' || s == ']'); - save_and_next(ls); - while (ls->current == '=') { - save_and_next(ls); - count++; - } - return (ls->current == s) ? count : (-count) - 1; -} - -static void read_long_string(LexState *ls, TValue *tv, int sep) -{ - save_and_next(ls); /* skip 2nd `[' */ - if (currIsNewline(ls)) /* string starts with a newline? */ - inclinenumber(ls); /* skip it */ - for (;;) { - switch (ls->current) { - case END_OF_STREAM: - lj_lex_error(ls, TK_eof, tv ? LJ_ERR_XLSTR : LJ_ERR_XLCOM); - break; - case ']': - if (skip_sep(ls) == sep) { - save_and_next(ls); /* skip 2nd `]' */ - goto endloop; - } - break; - case '\n': - case '\r': - save(ls, '\n'); - inclinenumber(ls); - if (!tv) lj_str_resetbuf(&ls->sb); /* avoid wasting space */ - break; - default: - if (tv) save_and_next(ls); - else next(ls); - break; - } - } endloop: - if (tv) { - GCstr *str = lj_parse_keepstr(ls, ls->sb.buf + (2 + (MSize)sep), - ls->sb.n - 2*(2 + (MSize)sep)); - setstrV(ls->L, tv, str); - } -} - -static void read_string(LexState *ls, int delim, TValue *tv) -{ - save_and_next(ls); - while (ls->current != delim) { - switch (ls->current) { - case END_OF_STREAM: - lj_lex_error(ls, TK_eof, LJ_ERR_XSTR); - continue; - case '\n': - case '\r': - lj_lex_error(ls, TK_string, LJ_ERR_XSTR); - continue; - case '\\': { - int c = next(ls); /* Skip the '\\'. */ - switch (c) { - case 'a': c = '\a'; break; - case 'b': c = '\b'; break; - case 'f': c = '\f'; break; - case 'n': c = '\n'; break; - case 'r': c = '\r'; break; - case 't': c = '\t'; break; - case 'v': c = '\v'; break; - case 'x': /* Hexadecimal escape '\xXX'. */ - c = (next(ls) & 15u) << 4; - if (!lj_char_isdigit(ls->current)) { - if (!lj_char_isxdigit(ls->current)) goto err_xesc; - c += 9 << 4; - } - c += (next(ls) & 15u); - if (!lj_char_isdigit(ls->current)) { - if (!lj_char_isxdigit(ls->current)) goto err_xesc; - c += 9; - } - break; - case 'z': /* Skip whitespace. */ - next(ls); - while (lj_char_isspace(ls->current)) - if (currIsNewline(ls)) inclinenumber(ls); else next(ls); - continue; - case '\n': case '\r': save(ls, '\n'); inclinenumber(ls); continue; - case '\\': case '\"': case '\'': break; - case END_OF_STREAM: continue; - default: - if (!lj_char_isdigit(c)) - goto err_xesc; - c -= '0'; /* Decimal escape '\ddd'. */ - if (lj_char_isdigit(next(ls))) { - c = c*10 + (ls->current - '0'); - if (lj_char_isdigit(next(ls))) { - c = c*10 + (ls->current - '0'); - if (c > 255) { - err_xesc: - lj_lex_error(ls, TK_string, LJ_ERR_XESC); - } - next(ls); - } - } - save(ls, c); - continue; - } - save(ls, c); - next(ls); - continue; - } - default: - save_and_next(ls); - break; - } - } - save_and_next(ls); /* skip delimiter */ - setstrV(ls->L, tv, lj_parse_keepstr(ls, ls->sb.buf + 1, ls->sb.n - 2)); -} - -/* -- Main lexical scanner ------------------------------------------------ */ - -static int llex(LexState *ls, TValue *tv) -{ - lj_str_resetbuf(&ls->sb); - for (;;) { - if (lj_char_isident(ls->current)) { - GCstr *s; - if (lj_char_isdigit(ls->current)) { /* Numeric literal. */ - lex_number(ls, tv); - return TK_number; - } - /* Identifier or reserved word. */ - do { - save_and_next(ls); - } while (lj_char_isident(ls->current)); - s = lj_parse_keepstr(ls, ls->sb.buf, ls->sb.n); - setstrV(ls->L, tv, s); - if (s->reserved > 0) /* Reserved word? */ - return TK_OFS + s->reserved; - return TK_name; - } - switch (ls->current) { - case '\n': - case '\r': - inclinenumber(ls); - continue; - case ' ': - case '\t': - case '\v': - case '\f': - next(ls); - continue; - case '-': - next(ls); - if (ls->current != '-') return '-'; - /* else is a comment */ - next(ls); - if (ls->current == '[') { - int sep = skip_sep(ls); - lj_str_resetbuf(&ls->sb); /* `skip_sep' may dirty the buffer */ - if (sep >= 0) { - read_long_string(ls, NULL, sep); /* long comment */ - lj_str_resetbuf(&ls->sb); - continue; - } - } - /* else short comment */ - while (!currIsNewline(ls) && ls->current != END_OF_STREAM) - next(ls); - continue; - case '[': { - int sep = skip_sep(ls); - if (sep >= 0) { - read_long_string(ls, tv, sep); - return TK_string; - } else if (sep == -1) { - return '['; - } else { - lj_lex_error(ls, TK_string, LJ_ERR_XLDELIM); - continue; - } - } - case '=': - next(ls); - if (ls->current != '=') return '='; else { next(ls); return TK_eq; } - case '<': - next(ls); - if (ls->current != '=') return '<'; else { next(ls); return TK_le; } - case '>': - next(ls); - if (ls->current != '=') return '>'; else { next(ls); return TK_ge; } - case '~': - next(ls); - if (ls->current != '=') return '~'; else { next(ls); return TK_ne; } - case ':': - next(ls); - if (ls->current != ':') return ':'; else { next(ls); return TK_label; } - case '"': - case '\'': - read_string(ls, ls->current, tv); - return TK_string; - case '.': - save_and_next(ls); - if (ls->current == '.') { - next(ls); - if (ls->current == '.') { - next(ls); - return TK_dots; /* ... */ - } - return TK_concat; /* .. */ - } else if (!lj_char_isdigit(ls->current)) { - return '.'; - } else { - lex_number(ls, tv); - return TK_number; - } - case END_OF_STREAM: - return TK_eof; - default: { - int c = ls->current; - next(ls); - return c; /* Single-char tokens (+ - / ...). */ - } - } - } -} - -/* -- Lexer API ----------------------------------------------------------- */ - -/* Setup lexer state. */ -int lj_lex_setup(lua_State *L, LexState *ls) -{ - int header = 0; - ls->L = L; - ls->fs = NULL; - ls->n = 0; - ls->p = NULL; - ls->vstack = NULL; - ls->sizevstack = 0; - ls->vtop = 0; - ls->bcstack = NULL; - ls->sizebcstack = 0; - ls->token = 0; - ls->lookahead = TK_eof; /* No look-ahead token. */ - ls->linenumber = 1; - ls->lastline = 1; - lj_str_resizebuf(ls->L, &ls->sb, LJ_MIN_SBUF); - next(ls); /* Read-ahead first char. */ - if (ls->current == 0xef && ls->n >= 2 && char2int(ls->p[0]) == 0xbb && - char2int(ls->p[1]) == 0xbf) { /* Skip UTF-8 BOM (if buffered). */ - ls->n -= 2; - ls->p += 2; - next(ls); - header = 1; - } - if (ls->current == '#') { /* Skip POSIX #! header line. */ - do { - next(ls); - if (ls->current == END_OF_STREAM) return 0; - } while (!currIsNewline(ls)); - inclinenumber(ls); - header = 1; - } - if (ls->current == LUA_SIGNATURE[0]) { /* Bytecode dump. */ - if (header) { - /* - ** Loading bytecode with an extra header is disabled for security - ** reasons. This may circumvent the usual check for bytecode vs. - ** Lua code by looking at the first char. Since this is a potential - ** security violation no attempt is made to echo the chunkname either. - */ - setstrV(L, L->top++, lj_err_str(L, LJ_ERR_BCBAD)); - lj_err_throw(L, LUA_ERRSYNTAX); - } - return 1; - } - return 0; -} - -/* Cleanup lexer state. */ -void lj_lex_cleanup(lua_State *L, LexState *ls) -{ - global_State *g = G(L); - lj_mem_freevec(g, ls->bcstack, ls->sizebcstack, BCInsLine); - lj_mem_freevec(g, ls->vstack, ls->sizevstack, VarInfo); - lj_str_freebuf(g, &ls->sb); -} - -void lj_lex_next(LexState *ls) -{ - ls->lastline = ls->linenumber; - if (LJ_LIKELY(ls->lookahead == TK_eof)) { /* No lookahead token? */ - ls->token = llex(ls, &ls->tokenval); /* Get next token. */ - } else { /* Otherwise return lookahead token. */ - ls->token = ls->lookahead; - ls->lookahead = TK_eof; - ls->tokenval = ls->lookaheadval; - } -} - -LexToken lj_lex_lookahead(LexState *ls) -{ - lua_assert(ls->lookahead == TK_eof); - ls->lookahead = llex(ls, &ls->lookaheadval); - return ls->lookahead; -} - -const char *lj_lex_token2str(LexState *ls, LexToken token) -{ - if (token > TK_OFS) - return tokennames[token-TK_OFS-1]; - else if (!lj_char_iscntrl(token)) - return lj_str_pushf(ls->L, "%c", token); - else - return lj_str_pushf(ls->L, "char(%d)", token); -} - -void lj_lex_error(LexState *ls, LexToken token, ErrMsg em, ...) -{ - const char *tok; - va_list argp; - if (token == 0) { - tok = NULL; - } else if (token == TK_name || token == TK_string || token == TK_number) { - save(ls, '\0'); - tok = ls->sb.buf; - } else { - tok = lj_lex_token2str(ls, token); - } - va_start(argp, em); - lj_err_lex(ls->L, ls->chunkname, tok, ls->linenumber, em, argp); - va_end(argp); -} - -void lj_lex_init(lua_State *L) -{ - uint32_t i; - for (i = 0; i < TK_RESERVED; i++) { - GCstr *s = lj_str_newz(L, tokennames[i]); - fixstring(s); /* Reserved words are never collected. */ - s->reserved = (uint8_t)(i+1); - } -} - diff --git a/subprojects/luajit/src/lj_lex.h b/subprojects/luajit/src/lj_lex.h deleted file mode 100644 index 41c03f934..000000000 --- a/subprojects/luajit/src/lj_lex.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -** Lexical analyzer. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_LEX_H -#define _LJ_LEX_H - -#include - -#include "lj_obj.h" -#include "lj_err.h" - -/* Lua lexer tokens. */ -#define TKDEF(_, __) \ - _(and) _(break) _(do) _(else) _(elseif) _(end) _(false) \ - _(for) _(function) _(goto) _(if) _(in) _(local) _(nil) _(not) _(or) \ - _(repeat) _(return) _(then) _(true) _(until) _(while) \ - __(concat, ..) __(dots, ...) __(eq, ==) __(ge, >=) __(le, <=) __(ne, ~=) \ - __(label, ::) __(number, ) __(name, ) __(string, ) \ - __(eof, ) - -enum { - TK_OFS = 256, -#define TKENUM1(name) TK_##name, -#define TKENUM2(name, sym) TK_##name, -TKDEF(TKENUM1, TKENUM2) -#undef TKENUM1 -#undef TKENUM2 - TK_RESERVED = TK_while - TK_OFS -}; - -typedef int LexToken; - -/* Combined bytecode ins/line. Only used during bytecode generation. */ -typedef struct BCInsLine { - BCIns ins; /* Bytecode instruction. */ - BCLine line; /* Line number for this bytecode. */ -} BCInsLine; - -/* Info for local variables. Only used during bytecode generation. */ -typedef struct VarInfo { - GCRef name; /* Local variable name or goto/label name. */ - BCPos startpc; /* First point where the local variable is active. */ - BCPos endpc; /* First point where the local variable is dead. */ - uint8_t slot; /* Variable slot. */ - uint8_t info; /* Variable/goto/label info. */ -} VarInfo; - -/* Lua lexer state. */ -typedef struct LexState { - struct FuncState *fs; /* Current FuncState. Defined in lj_parse.c. */ - struct lua_State *L; /* Lua state. */ - TValue tokenval; /* Current token value. */ - TValue lookaheadval; /* Lookahead token value. */ - int current; /* Current character (charint). */ - LexToken token; /* Current token. */ - LexToken lookahead; /* Lookahead token. */ - MSize n; /* Bytes left in input buffer. */ - const char *p; /* Current position in input buffer. */ - SBuf sb; /* String buffer for tokens. */ - lua_Reader rfunc; /* Reader callback. */ - void *rdata; /* Reader callback data. */ - BCLine linenumber; /* Input line counter. */ - BCLine lastline; /* Line of last token. */ - GCstr *chunkname; /* Current chunk name (interned string). */ - const char *chunkarg; /* Chunk name argument. */ - const char *mode; /* Allow loading bytecode (b) and/or source text (t). */ - VarInfo *vstack; /* Stack for names and extents of local variables. */ - MSize sizevstack; /* Size of variable stack. */ - MSize vtop; /* Top of variable stack. */ - BCInsLine *bcstack; /* Stack for bytecode instructions/line numbers. */ - MSize sizebcstack; /* Size of bytecode stack. */ - uint32_t level; /* Syntactical nesting level. */ -} LexState; - -LJ_FUNC int lj_lex_setup(lua_State *L, LexState *ls); -LJ_FUNC void lj_lex_cleanup(lua_State *L, LexState *ls); -LJ_FUNC void lj_lex_next(LexState *ls); -LJ_FUNC LexToken lj_lex_lookahead(LexState *ls); -LJ_FUNC const char *lj_lex_token2str(LexState *ls, LexToken token); -LJ_FUNC_NORET void lj_lex_error(LexState *ls, LexToken token, ErrMsg em, ...); -LJ_FUNC void lj_lex_init(lua_State *L); - -#endif diff --git a/subprojects/luajit/src/lj_lib.c b/subprojects/luajit/src/lj_lib.c deleted file mode 100644 index a1bb6a2a9..000000000 --- a/subprojects/luajit/src/lj_lib.c +++ /dev/null @@ -1,258 +0,0 @@ -/* -** Library function support. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_lib_c -#define LUA_CORE - -#include "lauxlib.h" - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_func.h" -#include "lj_bc.h" -#include "lj_dispatch.h" -#include "lj_vm.h" -#include "lj_strscan.h" -#include "lj_lib.h" - -/* -- Library initialization ---------------------------------------------- */ - -static GCtab *lib_create_table(lua_State *L, const char *libname, int hsize) -{ - if (libname) { - luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 16); - lua_getfield(L, -1, libname); - if (!tvistab(L->top-1)) { - L->top--; - if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, hsize) != NULL) - lj_err_callerv(L, LJ_ERR_BADMODN, libname); - settabV(L, L->top, tabV(L->top-1)); - L->top++; - lua_setfield(L, -3, libname); /* _LOADED[libname] = new table */ - } - L->top--; - settabV(L, L->top-1, tabV(L->top)); - } else { - lua_createtable(L, 0, hsize); - } - return tabV(L->top-1); -} - -void lj_lib_register(lua_State *L, const char *libname, - const uint8_t *p, const lua_CFunction *cf) -{ - GCtab *env = tabref(L->env); - GCfunc *ofn = NULL; - int ffid = *p++; - BCIns *bcff = &L2GG(L)->bcff[*p++]; - GCtab *tab = lib_create_table(L, libname, *p++); - ptrdiff_t tpos = L->top - L->base; - - /* Avoid barriers further down. */ - lj_gc_anybarriert(L, tab); - tab->nomm = 0; - - for (;;) { - uint32_t tag = *p++; - MSize len = tag & LIBINIT_LENMASK; - tag &= LIBINIT_TAGMASK; - if (tag != LIBINIT_STRING) { - const char *name; - MSize nuv = (MSize)(L->top - L->base - tpos); - GCfunc *fn = lj_func_newC(L, nuv, env); - if (nuv) { - L->top = L->base + tpos; - memcpy(fn->c.upvalue, L->top, sizeof(TValue)*nuv); - } - fn->c.ffid = (uint8_t)(ffid++); - name = (const char *)p; - p += len; - if (tag == LIBINIT_CF) - setmref(fn->c.pc, &G(L)->bc_cfunc_int); - else - setmref(fn->c.pc, bcff++); - if (tag == LIBINIT_ASM_) - fn->c.f = ofn->c.f; /* Copy handler from previous function. */ - else - fn->c.f = *cf++; /* Get cf or handler from C function table. */ - if (len) { - /* NOBARRIER: See above for common barrier. */ - setfuncV(L, lj_tab_setstr(L, tab, lj_str_new(L, name, len)), fn); - } - ofn = fn; - } else { - switch (tag | len) { - case LIBINIT_SET: - L->top -= 2; - if (tvisstr(L->top+1) && strV(L->top+1)->len == 0) - env = tabV(L->top); - else /* NOBARRIER: See above for common barrier. */ - copyTV(L, lj_tab_set(L, tab, L->top+1), L->top); - break; - case LIBINIT_NUMBER: - memcpy(&L->top->n, p, sizeof(double)); - L->top++; - p += sizeof(double); - break; - case LIBINIT_COPY: - copyTV(L, L->top, L->top - *p++); - L->top++; - break; - case LIBINIT_LASTCL: - setfuncV(L, L->top++, ofn); - break; - case LIBINIT_FFID: - ffid++; - break; - case LIBINIT_END: - return; - default: - setstrV(L, L->top++, lj_str_new(L, (const char *)p, len)); - p += len; - break; - } - } - } -} - -/* -- Type checks --------------------------------------------------------- */ - -TValue *lj_lib_checkany(lua_State *L, int narg) -{ - TValue *o = L->base + narg-1; - if (o >= L->top) - lj_err_arg(L, narg, LJ_ERR_NOVAL); - return o; -} - -GCstr *lj_lib_checkstr(lua_State *L, int narg) -{ - TValue *o = L->base + narg-1; - if (o < L->top) { - if (LJ_LIKELY(tvisstr(o))) { - return strV(o); - } else if (tvisnumber(o)) { - GCstr *s = lj_str_fromnumber(L, o); - setstrV(L, o, s); - return s; - } - } - lj_err_argt(L, narg, LUA_TSTRING); - return NULL; /* unreachable */ -} - -GCstr *lj_lib_optstr(lua_State *L, int narg) -{ - TValue *o = L->base + narg-1; - return (o < L->top && !tvisnil(o)) ? lj_lib_checkstr(L, narg) : NULL; -} - -#if LJ_DUALNUM -void lj_lib_checknumber(lua_State *L, int narg) -{ - TValue *o = L->base + narg-1; - if (!(o < L->top && lj_strscan_numberobj(o))) - lj_err_argt(L, narg, LUA_TNUMBER); -} -#endif - -lua_Number lj_lib_checknum(lua_State *L, int narg) -{ - TValue *o = L->base + narg-1; - if (!(o < L->top && - (tvisnumber(o) || (tvisstr(o) && lj_strscan_num(strV(o), o))))) - lj_err_argt(L, narg, LUA_TNUMBER); - if (LJ_UNLIKELY(tvisint(o))) { - lua_Number n = (lua_Number)intV(o); - setnumV(o, n); - return n; - } else { - return numV(o); - } -} - -int32_t lj_lib_checkint(lua_State *L, int narg) -{ - TValue *o = L->base + narg-1; - if (!(o < L->top && lj_strscan_numberobj(o))) - lj_err_argt(L, narg, LUA_TNUMBER); - if (LJ_LIKELY(tvisint(o))) { - return intV(o); - } else { - int32_t i = lj_num2int(numV(o)); - if (LJ_DUALNUM) setintV(o, i); - return i; - } -} - -int32_t lj_lib_optint(lua_State *L, int narg, int32_t def) -{ - TValue *o = L->base + narg-1; - return (o < L->top && !tvisnil(o)) ? lj_lib_checkint(L, narg) : def; -} - -int32_t lj_lib_checkbit(lua_State *L, int narg) -{ - TValue *o = L->base + narg-1; - if (!(o < L->top && lj_strscan_numberobj(o))) - lj_err_argt(L, narg, LUA_TNUMBER); - if (LJ_LIKELY(tvisint(o))) { - return intV(o); - } else { - int32_t i = lj_num2bit(numV(o)); - if (LJ_DUALNUM) setintV(o, i); - return i; - } -} - -GCfunc *lj_lib_checkfunc(lua_State *L, int narg) -{ - TValue *o = L->base + narg-1; - if (!(o < L->top && tvisfunc(o))) - lj_err_argt(L, narg, LUA_TFUNCTION); - return funcV(o); -} - -GCtab *lj_lib_checktab(lua_State *L, int narg) -{ - TValue *o = L->base + narg-1; - if (!(o < L->top && tvistab(o))) - lj_err_argt(L, narg, LUA_TTABLE); - return tabV(o); -} - -GCtab *lj_lib_checktabornil(lua_State *L, int narg) -{ - TValue *o = L->base + narg-1; - if (o < L->top) { - if (tvistab(o)) - return tabV(o); - else if (tvisnil(o)) - return NULL; - } - lj_err_arg(L, narg, LJ_ERR_NOTABN); - return NULL; /* unreachable */ -} - -int lj_lib_checkopt(lua_State *L, int narg, int def, const char *lst) -{ - GCstr *s = def >= 0 ? lj_lib_optstr(L, narg) : lj_lib_checkstr(L, narg); - if (s) { - const char *opt = strdata(s); - MSize len = s->len; - int i; - for (i = 0; *(const uint8_t *)lst; i++) { - if (*(const uint8_t *)lst == len && memcmp(opt, lst+1, len) == 0) - return i; - lst += 1+*(const uint8_t *)lst; - } - lj_err_argv(L, narg, LJ_ERR_INVOPTM, opt); - } - return def; -} - diff --git a/subprojects/luajit/src/lj_lib.h b/subprojects/luajit/src/lj_lib.h deleted file mode 100644 index aa8740766..000000000 --- a/subprojects/luajit/src/lj_lib.h +++ /dev/null @@ -1,112 +0,0 @@ -/* -** Library function support. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_LIB_H -#define _LJ_LIB_H - -#include "lj_obj.h" - -/* -** A fallback handler is called by the assembler VM if the fast path fails: -** -** - too few arguments: unrecoverable. -** - wrong argument type: recoverable, if coercion succeeds. -** - bad argument value: unrecoverable. -** - stack overflow: recoverable, if stack reallocation succeeds. -** - extra handling: recoverable. -** -** The unrecoverable cases throw an error with lj_err_arg(), lj_err_argtype(), -** lj_err_caller() or lj_err_callermsg(). -** The recoverable cases return 0 or the number of results + 1. -** The assembler VM retries the fast path only if 0 is returned. -** This time the fallback must not be called again or it gets stuck in a loop. -*/ - -/* Return values from fallback handler. */ -#define FFH_RETRY 0 -#define FFH_UNREACHABLE FFH_RETRY -#define FFH_RES(n) ((n)+1) -#define FFH_TAILCALL (-1) - -LJ_FUNC TValue *lj_lib_checkany(lua_State *L, int narg); -LJ_FUNC GCstr *lj_lib_checkstr(lua_State *L, int narg); -LJ_FUNC GCstr *lj_lib_optstr(lua_State *L, int narg); -#if LJ_DUALNUM -LJ_FUNC void lj_lib_checknumber(lua_State *L, int narg); -#else -#define lj_lib_checknumber(L, narg) lj_lib_checknum((L), (narg)) -#endif -LJ_FUNC lua_Number lj_lib_checknum(lua_State *L, int narg); -LJ_FUNC int32_t lj_lib_checkint(lua_State *L, int narg); -LJ_FUNC int32_t lj_lib_optint(lua_State *L, int narg, int32_t def); -LJ_FUNC int32_t lj_lib_checkbit(lua_State *L, int narg); -LJ_FUNC GCfunc *lj_lib_checkfunc(lua_State *L, int narg); -LJ_FUNC GCtab *lj_lib_checktab(lua_State *L, int narg); -LJ_FUNC GCtab *lj_lib_checktabornil(lua_State *L, int narg); -LJ_FUNC int lj_lib_checkopt(lua_State *L, int narg, int def, const char *lst); - -/* Avoid including lj_frame.h. */ -#define lj_lib_upvalue(L, n) \ - (&gcref((L->base-1)->fr.func)->fn.c.upvalue[(n)-1]) - -#if LJ_TARGET_WINDOWS -#define lj_lib_checkfpu(L) \ - do { setnumV(L->top++, (lua_Number)1437217655); \ - if (lua_tointeger(L, -1) != 1437217655) lj_err_caller(L, LJ_ERR_BADFPU); \ - L->top--; } while (0) -#else -#define lj_lib_checkfpu(L) UNUSED(L) -#endif - -/* Push internal function on the stack. */ -static LJ_AINLINE void lj_lib_pushcc(lua_State *L, lua_CFunction f, - int id, int n) -{ - GCfunc *fn; - lua_pushcclosure(L, f, n); - fn = funcV(L->top-1); - fn->c.ffid = (uint8_t)id; - setmref(fn->c.pc, &G(L)->bc_cfunc_int); -} - -#define lj_lib_pushcf(L, fn, id) (lj_lib_pushcc(L, (fn), (id), 0)) - -/* Library function declarations. Scanned by buildvm. */ -#define LJLIB_CF(name) static int lj_cf_##name(lua_State *L) -#define LJLIB_ASM(name) static int lj_ffh_##name(lua_State *L) -#define LJLIB_ASM_(name) -#define LJLIB_SET(name) -#define LJLIB_PUSH(arg) -#define LJLIB_REC(handler) -#define LJLIB_NOREGUV -#define LJLIB_NOREG - -#define LJ_LIB_REG(L, regname, name) \ - lj_lib_register(L, regname, lj_lib_init_##name, lj_lib_cf_##name) - -LJ_FUNC void lj_lib_register(lua_State *L, const char *libname, - const uint8_t *init, const lua_CFunction *cf); - -/* Library init data tags. */ -#define LIBINIT_LENMASK 0x3f -#define LIBINIT_TAGMASK 0xc0 -#define LIBINIT_CF 0x00 -#define LIBINIT_ASM 0x40 -#define LIBINIT_ASM_ 0x80 -#define LIBINIT_STRING 0xc0 -#define LIBINIT_MAXSTR 0x39 -#define LIBINIT_SET 0xfa -#define LIBINIT_NUMBER 0xfb -#define LIBINIT_COPY 0xfc -#define LIBINIT_LASTCL 0xfd -#define LIBINIT_FFID 0xfe -#define LIBINIT_END 0xff - -/* Exported library functions. */ - -typedef struct RandomState RandomState; -LJ_FUNC uint64_t LJ_FASTCALL lj_math_random_step(RandomState *rs); - -#endif diff --git a/subprojects/luajit/src/lj_load.c b/subprojects/luajit/src/lj_load.c deleted file mode 100644 index 20be8ebe3..000000000 --- a/subprojects/luajit/src/lj_load.c +++ /dev/null @@ -1,168 +0,0 @@ -/* -** Load and dump code. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include -#include - -#define lj_load_c -#define LUA_CORE - -#include "lua.h" -#include "lauxlib.h" - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_func.h" -#include "lj_frame.h" -#include "lj_vm.h" -#include "lj_lex.h" -#include "lj_bcdump.h" -#include "lj_parse.h" - -/* -- Load Lua source code and bytecode ----------------------------------- */ - -static TValue *cpparser(lua_State *L, lua_CFunction dummy, void *ud) -{ - LexState *ls = (LexState *)ud; - GCproto *pt; - GCfunc *fn; - int bc; - UNUSED(dummy); - cframe_errfunc(L->cframe) = -1; /* Inherit error function. */ - bc = lj_lex_setup(L, ls); - if (ls->mode && !strchr(ls->mode, bc ? 'b' : 't')) { - setstrV(L, L->top++, lj_err_str(L, LJ_ERR_XMODE)); - lj_err_throw(L, LUA_ERRSYNTAX); - } - pt = bc ? lj_bcread(ls) : lj_parse(ls); - fn = lj_func_newL_empty(L, pt, tabref(L->env)); - /* Don't combine above/below into one statement. */ - setfuncV(L, L->top++, fn); - return NULL; -} - -LUA_API int lua_loadx(lua_State *L, lua_Reader reader, void *data, - const char *chunkname, const char *mode) -{ - LexState ls; - int status; - ls.rfunc = reader; - ls.rdata = data; - ls.chunkarg = chunkname ? chunkname : "?"; - ls.mode = mode; - lj_str_initbuf(&ls.sb); - status = lj_vm_cpcall(L, NULL, &ls, cpparser); - lj_lex_cleanup(L, &ls); - lj_gc_check(L); - return status; -} - -LUA_API int lua_load(lua_State *L, lua_Reader reader, void *data, - const char *chunkname) -{ - return lua_loadx(L, reader, data, chunkname, NULL); -} - -typedef struct FileReaderCtx { - FILE *fp; - char buf[LUAL_BUFFERSIZE]; -} FileReaderCtx; - -static const char *reader_file(lua_State *L, void *ud, size_t *size) -{ - FileReaderCtx *ctx = (FileReaderCtx *)ud; - UNUSED(L); - if (feof(ctx->fp)) return NULL; - *size = fread(ctx->buf, 1, sizeof(ctx->buf), ctx->fp); - return *size > 0 ? ctx->buf : NULL; -} - -LUALIB_API int luaL_loadfilex(lua_State *L, const char *filename, - const char *mode) -{ - FileReaderCtx ctx; - int status; - const char *chunkname; - if (filename) { - ctx.fp = fopen(filename, "rb"); - if (ctx.fp == NULL) { - lua_pushfstring(L, "cannot open %s: %s", filename, strerror(errno)); - return LUA_ERRFILE; - } - chunkname = lua_pushfstring(L, "@%s", filename); - } else { - ctx.fp = stdin; - chunkname = "=stdin"; - } - status = lua_loadx(L, reader_file, &ctx, chunkname, mode); - if (ferror(ctx.fp)) { - L->top -= filename ? 2 : 1; - lua_pushfstring(L, "cannot read %s: %s", chunkname+1, strerror(errno)); - if (filename) - fclose(ctx.fp); - return LUA_ERRFILE; - } - if (filename) { - L->top--; - copyTV(L, L->top-1, L->top); - fclose(ctx.fp); - } - return status; -} - -LUALIB_API int luaL_loadfile(lua_State *L, const char *filename) -{ - return luaL_loadfilex(L, filename, NULL); -} - -typedef struct StringReaderCtx { - const char *str; - size_t size; -} StringReaderCtx; - -static const char *reader_string(lua_State *L, void *ud, size_t *size) -{ - StringReaderCtx *ctx = (StringReaderCtx *)ud; - UNUSED(L); - if (ctx->size == 0) return NULL; - *size = ctx->size; - ctx->size = 0; - return ctx->str; -} - -LUALIB_API int luaL_loadbufferx(lua_State *L, const char *buf, size_t size, - const char *name, const char *mode) -{ - StringReaderCtx ctx; - ctx.str = buf; - ctx.size = size; - return lua_loadx(L, reader_string, &ctx, name, mode); -} - -LUALIB_API int luaL_loadbuffer(lua_State *L, const char *buf, size_t size, - const char *name) -{ - return luaL_loadbufferx(L, buf, size, name, NULL); -} - -LUALIB_API int luaL_loadstring(lua_State *L, const char *s) -{ - return luaL_loadbuffer(L, s, strlen(s), s); -} - -/* -- Dump bytecode ------------------------------------------------------- */ - -LUA_API int lua_dump(lua_State *L, lua_Writer writer, void *data) -{ - cTValue *o = L->top-1; - api_check(L, L->top > L->base); - if (tvisfunc(o) && isluafunc(funcV(o))) - return lj_bcwrite(L, funcproto(funcV(o)), writer, data, 0); - else - return 1; -} - diff --git a/subprojects/luajit/src/lj_mcode.c b/subprojects/luajit/src/lj_mcode.c deleted file mode 100644 index f0a1f6996..000000000 --- a/subprojects/luajit/src/lj_mcode.c +++ /dev/null @@ -1,387 +0,0 @@ -/* -** Machine code management. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_mcode_c -#define LUA_CORE - -#include "lj_obj.h" -#if LJ_HASJIT -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_jit.h" -#include "lj_mcode.h" -#include "lj_trace.h" -#include "lj_dispatch.h" -#endif -#if LJ_HASJIT || LJ_HASFFI -#include "lj_vm.h" -#endif - -/* -- OS-specific functions ----------------------------------------------- */ - -#if LJ_HASJIT || LJ_HASFFI - -/* Define this if you want to run LuaJIT with Valgrind. */ -#ifdef LUAJIT_USE_VALGRIND -#include -#endif - -#if LJ_TARGET_IOS -void sys_icache_invalidate(void *start, size_t len); -#endif - -/* Synchronize data/instruction cache. */ -void lj_mcode_sync(void *start, void *end) -{ -#ifdef LUAJIT_USE_VALGRIND - VALGRIND_DISCARD_TRANSLATIONS(start, (char *)end-(char *)start); -#endif -#if LJ_TARGET_X86ORX64 - UNUSED(start); UNUSED(end); -#elif LJ_TARGET_IOS - sys_icache_invalidate(start, (char *)end-(char *)start); -#elif LJ_TARGET_PPC - lj_vm_cachesync(start, end); -#elif defined(__GNUC__) - __clear_cache(start, end); -#else -#error "Missing builtin to flush instruction cache" -#endif -} - -#endif - -#if LJ_HASJIT - -#if LJ_TARGET_WINDOWS - -#define WIN32_LEAN_AND_MEAN -#include - -#define MCPROT_RW PAGE_READWRITE -#define MCPROT_RX PAGE_EXECUTE_READ -#define MCPROT_RWX PAGE_EXECUTE_READWRITE - -static void *mcode_alloc_at(jit_State *J, uintptr_t hint, size_t sz, DWORD prot) -{ - void *p = VirtualAlloc((void *)hint, sz, - MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, prot); - if (!p && !hint) - lj_trace_err(J, LJ_TRERR_MCODEAL); - return p; -} - -static void mcode_free(jit_State *J, void *p, size_t sz) -{ - UNUSED(J); UNUSED(sz); - VirtualFree(p, 0, MEM_RELEASE); -} - -static int mcode_setprot(void *p, size_t sz, DWORD prot) -{ - DWORD oprot; - return !VirtualProtect(p, sz, prot, &oprot); -} - -#elif LJ_TARGET_POSIX - -#include - -#ifndef MAP_ANONYMOUS -#define MAP_ANONYMOUS MAP_ANON -#endif - -#define MCPROT_RW (PROT_READ|PROT_WRITE) -#define MCPROT_RX (PROT_READ|PROT_EXEC) -#define MCPROT_RWX (PROT_READ|PROT_WRITE|PROT_EXEC) - -static void *mcode_alloc_at(jit_State *J, uintptr_t hint, size_t sz, int prot) -{ - void *p = mmap((void *)hint, sz, prot, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); - if (p == MAP_FAILED) { - if (!hint) lj_trace_err(J, LJ_TRERR_MCODEAL); - p = NULL; - } - return p; -} - -static void mcode_free(jit_State *J, void *p, size_t sz) -{ - UNUSED(J); - munmap(p, sz); -} - -static int mcode_setprot(void *p, size_t sz, int prot) -{ - return mprotect(p, sz, prot); -} - -#elif LJ_64 - -#error "Missing OS support for explicit placement of executable memory" - -#else - -/* Fallback allocator. This will fail if memory is not executable by default. */ -#define LUAJIT_UNPROTECT_MCODE -#define MCPROT_RW 0 -#define MCPROT_RX 0 -#define MCPROT_RWX 0 - -static void *mcode_alloc_at(jit_State *J, uintptr_t hint, size_t sz, int prot) -{ - UNUSED(hint); UNUSED(prot); - return lj_mem_new(J->L, sz); -} - -static void mcode_free(jit_State *J, void *p, size_t sz) -{ - lj_mem_free(J2G(J), p, sz); -} - -#endif - -/* -- MCode area protection ----------------------------------------------- */ - -/* Define this ONLY if page protection twiddling becomes a bottleneck. */ -#ifdef LUAJIT_UNPROTECT_MCODE - -/* It's generally considered to be a potential security risk to have -** pages with simultaneous write *and* execute access in a process. -** -** Do not even think about using this mode for server processes or -** apps handling untrusted external data (such as a browser). -** -** The security risk is not in LuaJIT itself -- but if an adversary finds -** any *other* flaw in your C application logic, then any RWX memory page -** simplifies writing an exploit considerably. -*/ -#define MCPROT_GEN MCPROT_RWX -#define MCPROT_RUN MCPROT_RWX - -static void mcode_protect(jit_State *J, int prot) -{ - UNUSED(J); UNUSED(prot); -} - -#else - -/* This is the default behaviour and much safer: -** -** Most of the time the memory pages holding machine code are executable, -** but NONE of them is writable. -** -** The current memory area is marked read-write (but NOT executable) only -** during the short time window while the assembler generates machine code. -*/ -#define MCPROT_GEN MCPROT_RW -#define MCPROT_RUN MCPROT_RX - -/* Protection twiddling failed. Probably due to kernel security. */ -static LJ_NOINLINE void mcode_protfail(jit_State *J) -{ - lua_CFunction panic = J2G(J)->panic; - if (panic) { - lua_State *L = J->L; - setstrV(L, L->top++, lj_err_str(L, LJ_ERR_JITPROT)); - panic(L); - } -} - -/* Change protection of MCode area. */ -static void mcode_protect(jit_State *J, int prot) -{ - if (J->mcprot != prot) { - if (LJ_UNLIKELY(mcode_setprot(J->mcarea, J->szmcarea, prot))) - mcode_protfail(J); - J->mcprot = prot; - } -} - -#endif - -/* -- MCode area allocation ----------------------------------------------- */ - -#if LJ_64 -#define mcode_validptr(p) (p) -#else -#define mcode_validptr(p) ((p) && (uintptr_t)(p) < 0xffff0000) -#endif - -#ifdef LJ_TARGET_JUMPRANGE - -/* Get memory within relative jump distance of our code in 64 bit mode. */ -static void *mcode_alloc(jit_State *J, size_t sz) -{ - /* Target an address in the static assembler code (64K aligned). - ** Try addresses within a distance of target-range/2+1MB..target+range/2-1MB. - ** Use half the jump range so every address in the range can reach any other. - */ -#if LJ_TARGET_MIPS - /* Use the middle of the 256MB-aligned region. */ - uintptr_t target = ((uintptr_t)(void *)lj_vm_exit_handler & 0xf0000000u) + - 0x08000000u; -#else - uintptr_t target = (uintptr_t)(void *)lj_vm_exit_handler & ~(uintptr_t)0xffff; -#endif - const uintptr_t range = (1u << (LJ_TARGET_JUMPRANGE-1)) - (1u << 21); - /* First try a contiguous area below the last one. */ - uintptr_t hint = J->mcarea ? (uintptr_t)J->mcarea - sz : 0; - int i; - /* Limit probing iterations, depending on the available pool size. */ - for (i = 0; i < LJ_TARGET_JUMPRANGE; i++) { - if (mcode_validptr(hint)) { - void *p = mcode_alloc_at(J, hint, sz, MCPROT_GEN); - - if (mcode_validptr(p) && - ((uintptr_t)p + sz - target < range || target - (uintptr_t)p < range)) - return p; - if (p) mcode_free(J, p, sz); /* Free badly placed area. */ - } - /* Next try probing 64K-aligned pseudo-random addresses. */ - do { - hint = LJ_PRNG_BITS(J, LJ_TARGET_JUMPRANGE-16) << 16; - } while (!(hint + sz < range+range)); - hint = target + hint - range; - } - lj_trace_err(J, LJ_TRERR_MCODEAL); /* Give up. OS probably ignores hints? */ - return NULL; -} - -#else - -/* All memory addresses are reachable by relative jumps. */ -static void *mcode_alloc(jit_State *J, size_t sz) -{ -#ifdef __OpenBSD__ - /* Allow better executable memory allocation for OpenBSD W^X mode. */ - void *p = mcode_alloc_at(J, 0, sz, MCPROT_RUN); - if (p && mcode_setprot(p, sz, MCPROT_GEN)) { - mcode_free(J, p, sz); - return NULL; - } - return p; -#else - return mcode_alloc_at(J, 0, sz, MCPROT_GEN); -#endif -} - -#endif - -/* -- MCode area management ----------------------------------------------- */ - -/* Linked list of MCode areas. */ -typedef struct MCLink { - MCode *next; /* Next area. */ - size_t size; /* Size of current area. */ -} MCLink; - -/* Allocate a new MCode area. */ -static void mcode_allocarea(jit_State *J) -{ - MCode *oldarea = J->mcarea; - size_t sz = (size_t)J->param[JIT_P_sizemcode] << 10; - sz = (sz + LJ_PAGESIZE-1) & ~(size_t)(LJ_PAGESIZE - 1); - J->mcarea = (MCode *)mcode_alloc(J, sz); - J->szmcarea = sz; - J->mcprot = MCPROT_GEN; - J->mctop = (MCode *)((char *)J->mcarea + J->szmcarea); - J->mcbot = (MCode *)((char *)J->mcarea + sizeof(MCLink)); - ((MCLink *)J->mcarea)->next = oldarea; - ((MCLink *)J->mcarea)->size = sz; - J->szallmcarea += sz; -} - -/* Free all MCode areas. */ -void lj_mcode_free(jit_State *J) -{ - MCode *mc = J->mcarea; - J->mcarea = NULL; - J->szallmcarea = 0; - while (mc) { - MCode *next = ((MCLink *)mc)->next; - mcode_free(J, mc, ((MCLink *)mc)->size); - mc = next; - } -} - -/* -- MCode transactions -------------------------------------------------- */ - -/* Reserve the remainder of the current MCode area. */ -MCode *lj_mcode_reserve(jit_State *J, MCode **lim) -{ - if (!J->mcarea) - mcode_allocarea(J); - else - mcode_protect(J, MCPROT_GEN); - *lim = J->mcbot; - return J->mctop; -} - -/* Commit the top part of the current MCode area. */ -void lj_mcode_commit(jit_State *J, MCode *top) -{ - J->mctop = top; - mcode_protect(J, MCPROT_RUN); -} - -/* Abort the reservation. */ -void lj_mcode_abort(jit_State *J) -{ - if (J->mcarea) - mcode_protect(J, MCPROT_RUN); -} - -/* Set/reset protection to allow patching of MCode areas. */ -MCode *lj_mcode_patch(jit_State *J, MCode *ptr, int finish) -{ -#ifdef LUAJIT_UNPROTECT_MCODE - UNUSED(J); UNUSED(ptr); UNUSED(finish); - return NULL; -#else - if (finish) { - if (J->mcarea == ptr) - mcode_protect(J, MCPROT_RUN); - else if (LJ_UNLIKELY(mcode_setprot(ptr, ((MCLink *)ptr)->size, MCPROT_RUN))) - mcode_protfail(J); - return NULL; - } else { - MCode *mc = J->mcarea; - /* Try current area first to use the protection cache. */ - if (ptr >= mc && ptr < (MCode *)((char *)mc + J->szmcarea)) { - mcode_protect(J, MCPROT_GEN); - return mc; - } - /* Otherwise search through the list of MCode areas. */ - for (;;) { - mc = ((MCLink *)mc)->next; - lua_assert(mc != NULL); - if (ptr >= mc && ptr < (MCode *)((char *)mc + ((MCLink *)mc)->size)) { - if (LJ_UNLIKELY(mcode_setprot(mc, ((MCLink *)mc)->size, MCPROT_GEN))) - mcode_protfail(J); - return mc; - } - } - } -#endif -} - -/* Limit of MCode reservation reached. */ -void lj_mcode_limiterr(jit_State *J, size_t need) -{ - size_t sizemcode, maxmcode; - lj_mcode_abort(J); - sizemcode = (size_t)J->param[JIT_P_sizemcode] << 10; - sizemcode = (sizemcode + LJ_PAGESIZE-1) & ~(size_t)(LJ_PAGESIZE - 1); - maxmcode = (size_t)J->param[JIT_P_maxmcode] << 10; - if ((size_t)need > sizemcode) - lj_trace_err(J, LJ_TRERR_MCODEOV); /* Too long for any area. */ - if (J->szallmcarea + sizemcode > maxmcode) - lj_trace_err(J, LJ_TRERR_MCODEAL); - mcode_allocarea(J); - lj_trace_err(J, LJ_TRERR_MCODELM); /* Retry with new area. */ -} - -#endif diff --git a/subprojects/luajit/src/lj_mcode.h b/subprojects/luajit/src/lj_mcode.h deleted file mode 100644 index f0847e931..000000000 --- a/subprojects/luajit/src/lj_mcode.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -** Machine code management. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_MCODE_H -#define _LJ_MCODE_H - -#include "lj_obj.h" - -#if LJ_HASJIT || LJ_HASFFI -LJ_FUNC void lj_mcode_sync(void *start, void *end); -#endif - -#if LJ_HASJIT - -#include "lj_jit.h" - -LJ_FUNC void lj_mcode_free(jit_State *J); -LJ_FUNC MCode *lj_mcode_reserve(jit_State *J, MCode **lim); -LJ_FUNC void lj_mcode_commit(jit_State *J, MCode *m); -LJ_FUNC void lj_mcode_abort(jit_State *J); -LJ_FUNC MCode *lj_mcode_patch(jit_State *J, MCode *ptr, int finish); -LJ_FUNC_NORET void lj_mcode_limiterr(jit_State *J, size_t need); - -#define lj_mcode_commitbot(J, m) (J->mcbot = (m)) - -#endif - -#endif diff --git a/subprojects/luajit/src/lj_meta.c b/subprojects/luajit/src/lj_meta.c deleted file mode 100644 index 10e349842..000000000 --- a/subprojects/luajit/src/lj_meta.c +++ /dev/null @@ -1,466 +0,0 @@ -/* -** Metamethod handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#define lj_meta_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_meta.h" -#include "lj_frame.h" -#include "lj_bc.h" -#include "lj_vm.h" -#include "lj_strscan.h" - -/* -- Metamethod handling ------------------------------------------------- */ - -/* String interning of metamethod names for fast indexing. */ -void lj_meta_init(lua_State *L) -{ -#define MMNAME(name) "__" #name - const char *metanames = MMDEF(MMNAME); -#undef MMNAME - global_State *g = G(L); - const char *p, *q; - uint32_t mm; - for (mm = 0, p = metanames; *p; mm++, p = q) { - GCstr *s; - for (q = p+2; *q && *q != '_'; q++) ; - s = lj_str_new(L, p, (size_t)(q-p)); - /* NOBARRIER: g->gcroot[] is a GC root. */ - setgcref(g->gcroot[GCROOT_MMNAME+mm], obj2gco(s)); - } -} - -/* Negative caching of a few fast metamethods. See the lj_meta_fast() macro. */ -cTValue *lj_meta_cache(GCtab *mt, MMS mm, GCstr *name) -{ - cTValue *mo = lj_tab_getstr(mt, name); - lua_assert(mm <= MM_FAST); - if (!mo || tvisnil(mo)) { /* No metamethod? */ - mt->nomm |= (uint8_t)(1u<metatable); - else if (tvisudata(o)) - mt = tabref(udataV(o)->metatable); - else - mt = tabref(basemt_obj(G(L), o)); - if (mt) { - cTValue *mo = lj_tab_getstr(mt, mmname_str(G(L), mm)); - if (mo) - return mo; - } - return niltv(L); -} - -#if LJ_HASFFI -/* Tailcall from C function. */ -int lj_meta_tailcall(lua_State *L, cTValue *tv) -{ - TValue *base = L->base; - TValue *top = L->top; - const BCIns *pc = frame_pc(base-1); /* Preserve old PC from frame. */ - copyTV(L, base-1, tv); /* Replace frame with new object. */ - top->u32.lo = LJ_CONT_TAILCALL; - setframe_pc(top, pc); - setframe_gc(top+1, obj2gco(L)); /* Dummy frame object. */ - setframe_ftsz(top+1, (int)((char *)(top+2) - (char *)base) + FRAME_CONT); - L->base = L->top = top+2; - /* - ** before: [old_mo|PC] [... ...] - ** ^base ^top - ** after: [new_mo|itype] [... ...] [NULL|PC] [dummy|delta] - ** ^base/top - ** tailcall: [new_mo|PC] [... ...] - ** ^base ^top - */ - return 0; -} -#endif - -/* Setup call to metamethod to be run by Assembler VM. */ -static TValue *mmcall(lua_State *L, ASMFunction cont, cTValue *mo, - cTValue *a, cTValue *b) -{ - /* - ** |-- framesize -> top top+1 top+2 top+3 - ** before: [func slots ...] - ** mm setup: [func slots ...] [cont|?] [mo|tmtype] [a] [b] - ** in asm: [func slots ...] [cont|PC] [mo|delta] [a] [b] - ** ^-- func base ^-- mm base - ** after mm: [func slots ...] [result] - ** ^-- copy to base[PC_RA] --/ for lj_cont_ra - ** istruecond + branch for lj_cont_cond* - ** ignore for lj_cont_nop - ** next PC: [func slots ...] - */ - TValue *top = L->top; - if (curr_funcisL(L)) top = curr_topL(L); - setcont(top, cont); /* Assembler VM stores PC in upper word. */ - copyTV(L, top+1, mo); /* Store metamethod and two arguments. */ - copyTV(L, top+2, a); - copyTV(L, top+3, b); - return top+2; /* Return new base. */ -} - -/* -- C helpers for some instructions, called from assembler VM ----------- */ - -/* Helper for TGET*. __index chain and metamethod. */ -cTValue *lj_meta_tget(lua_State *L, cTValue *o, cTValue *k) -{ - int loop; - for (loop = 0; loop < LJ_MAX_IDXCHAIN; loop++) { - cTValue *mo; - if (LJ_LIKELY(tvistab(o))) { - GCtab *t = tabV(o); - cTValue *tv = lj_tab_get(L, t, k); - if (!tvisnil(tv) || - !(mo = lj_meta_fast(L, tabref(t->metatable), MM_index))) - return tv; - } else if (tvisnil(mo = lj_meta_lookup(L, o, MM_index))) { - lj_err_optype(L, o, LJ_ERR_OPINDEX); - return NULL; /* unreachable */ - } - if (tvisfunc(mo)) { - L->top = mmcall(L, lj_cont_ra, mo, o, k); - return NULL; /* Trigger metamethod call. */ - } - o = mo; - } - lj_err_msg(L, LJ_ERR_GETLOOP); - return NULL; /* unreachable */ -} - -/* Helper for TSET*. __newindex chain and metamethod. */ -TValue *lj_meta_tset(lua_State *L, cTValue *o, cTValue *k) -{ - TValue tmp; - int loop; - for (loop = 0; loop < LJ_MAX_IDXCHAIN; loop++) { - cTValue *mo; - if (LJ_LIKELY(tvistab(o))) { - GCtab *t = tabV(o); - cTValue *tv = lj_tab_get(L, t, k); - if (LJ_LIKELY(!tvisnil(tv))) { - t->nomm = 0; /* Invalidate negative metamethod cache. */ - lj_gc_anybarriert(L, t); - return (TValue *)tv; - } else if (!(mo = lj_meta_fast(L, tabref(t->metatable), MM_newindex))) { - t->nomm = 0; /* Invalidate negative metamethod cache. */ - lj_gc_anybarriert(L, t); - if (tv != niltv(L)) - return (TValue *)tv; - if (tvisnil(k)) lj_err_msg(L, LJ_ERR_NILIDX); - else if (tvisint(k)) { setnumV(&tmp, (lua_Number)intV(k)); k = &tmp; } - else if (tvisnum(k) && tvisnan(k)) lj_err_msg(L, LJ_ERR_NANIDX); - return lj_tab_newkey(L, t, k); - } - } else if (tvisnil(mo = lj_meta_lookup(L, o, MM_newindex))) { - lj_err_optype(L, o, LJ_ERR_OPINDEX); - return NULL; /* unreachable */ - } - if (tvisfunc(mo)) { - L->top = mmcall(L, lj_cont_nop, mo, o, k); - /* L->top+2 = v filled in by caller. */ - return NULL; /* Trigger metamethod call. */ - } - copyTV(L, &tmp, mo); - o = &tmp; - } - lj_err_msg(L, LJ_ERR_SETLOOP); - return NULL; /* unreachable */ -} - -static cTValue *str2num(cTValue *o, TValue *n) -{ - if (tvisnum(o)) - return o; - else if (tvisint(o)) - return (setnumV(n, (lua_Number)intV(o)), n); - else if (tvisstr(o) && lj_strscan_num(strV(o), n)) - return n; - else - return NULL; -} - -/* Helper for arithmetic instructions. Coercion, metamethod. */ -TValue *lj_meta_arith(lua_State *L, TValue *ra, cTValue *rb, cTValue *rc, - BCReg op) -{ - MMS mm = bcmode_mm(op); - TValue tempb, tempc; - cTValue *b, *c; - if ((b = str2num(rb, &tempb)) != NULL && - (c = str2num(rc, &tempc)) != NULL) { /* Try coercion first. */ - setnumV(ra, lj_vm_foldarith(numV(b), numV(c), (int)mm-MM_add)); - return NULL; - } else { - cTValue *mo = lj_meta_lookup(L, rb, mm); - if (tvisnil(mo)) { - mo = lj_meta_lookup(L, rc, mm); - if (tvisnil(mo)) { - if (str2num(rb, &tempb) == NULL) rc = rb; - lj_err_optype(L, rc, LJ_ERR_OPARITH); - return NULL; /* unreachable */ - } - } - return mmcall(L, lj_cont_ra, mo, rb, rc); - } -} - -/* In-place coercion of a number to a string. */ -static LJ_AINLINE int tostring(lua_State *L, TValue *o) -{ - if (tvisstr(o)) { - return 1; - } else if (tvisnumber(o)) { - setstrV(L, o, lj_str_fromnumber(L, o)); - return 1; - } else { - return 0; - } -} - -/* Helper for CAT. Coercion, iterative concat, __concat metamethod. */ -TValue *lj_meta_cat(lua_State *L, TValue *top, int left) -{ - int fromc = 0; - if (left < 0) { left = -left; fromc = 1; } - do { - int n = 1; - if (!(tvisstr(top-1) || tvisnumber(top-1)) || !tostring(L, top)) { - cTValue *mo = lj_meta_lookup(L, top-1, MM_concat); - if (tvisnil(mo)) { - mo = lj_meta_lookup(L, top, MM_concat); - if (tvisnil(mo)) { - if (tvisstr(top-1) || tvisnumber(top-1)) top++; - lj_err_optype(L, top-1, LJ_ERR_OPCAT); - return NULL; /* unreachable */ - } - } - /* One of the top two elements is not a string, call __cat metamethod: - ** - ** before: [...][CAT stack .........................] - ** top-1 top top+1 top+2 - ** pick two: [...][CAT stack ...] [o1] [o2] - ** setup mm: [...][CAT stack ...] [cont|?] [mo|tmtype] [o1] [o2] - ** in asm: [...][CAT stack ...] [cont|PC] [mo|delta] [o1] [o2] - ** ^-- func base ^-- mm base - ** after mm: [...][CAT stack ...] <--push-- [result] - ** next step: [...][CAT stack .............] - */ - copyTV(L, top+2, top); /* Careful with the order of stack copies! */ - copyTV(L, top+1, top-1); - copyTV(L, top, mo); - setcont(top-1, lj_cont_cat); - return top+1; /* Trigger metamethod call. */ - } else if (strV(top)->len == 0) { /* Shortcut. */ - (void)tostring(L, top-1); - } else { - /* Pick as many strings as possible from the top and concatenate them: - ** - ** before: [...][CAT stack ...........................] - ** pick str: [...][CAT stack ...] [...... strings ......] - ** concat: [...][CAT stack ...] [result] - ** next step: [...][CAT stack ............] - */ - MSize tlen = strV(top)->len; - char *buffer; - int i; - for (n = 1; n <= left && tostring(L, top-n); n++) { - MSize len = strV(top-n)->len; - if (len >= LJ_MAX_STR - tlen) - lj_err_msg(L, LJ_ERR_STROV); - tlen += len; - } - buffer = lj_str_needbuf(L, &G(L)->tmpbuf, tlen); - n--; - tlen = 0; - for (i = n; i >= 0; i--) { - MSize len = strV(top-i)->len; - memcpy(buffer + tlen, strVdata(top-i), len); - tlen += len; - } - setstrV(L, top-n, lj_str_new(L, buffer, tlen)); - } - left -= n; - top -= n; - } while (left >= 1); - if (LJ_UNLIKELY(G(L)->gc.total >= G(L)->gc.threshold)) { - if (!fromc) L->top = curr_topL(L); - lj_gc_step(L); - } - return NULL; -} - -/* Helper for LEN. __len metamethod. */ -TValue * LJ_FASTCALL lj_meta_len(lua_State *L, cTValue *o) -{ - cTValue *mo = lj_meta_lookup(L, o, MM_len); - if (tvisnil(mo)) { - if (LJ_52 && tvistab(o)) - tabref(tabV(o)->metatable)->nomm |= (uint8_t)(1u<gch.metatable), MM_eq); - if (mo) { - TValue *top; - uint32_t it; - if (tabref(o1->gch.metatable) != tabref(o2->gch.metatable)) { - cTValue *mo2 = lj_meta_fast(L, tabref(o2->gch.metatable), MM_eq); - if (mo2 == NULL || !lj_obj_equal(mo, mo2)) - return (TValue *)(intptr_t)ne; - } - top = curr_top(L); - setcont(top, ne ? lj_cont_condf : lj_cont_condt); - copyTV(L, top+1, mo); - it = ~(uint32_t)o1->gch.gct; - setgcV(L, top+2, o1, it); - setgcV(L, top+3, o2, it); - return top+2; /* Trigger metamethod call. */ - } - return (TValue *)(intptr_t)ne; -} - -#if LJ_HASFFI -TValue * LJ_FASTCALL lj_meta_equal_cd(lua_State *L, BCIns ins) -{ - ASMFunction cont = (bc_op(ins) & 1) ? lj_cont_condf : lj_cont_condt; - int op = (int)bc_op(ins) & ~1; - TValue tv; - cTValue *mo, *o2, *o1 = &L->base[bc_a(ins)]; - cTValue *o1mm = o1; - if (op == BC_ISEQV) { - o2 = &L->base[bc_d(ins)]; - if (!tviscdata(o1mm)) o1mm = o2; - } else if (op == BC_ISEQS) { - setstrV(L, &tv, gco2str(proto_kgc(curr_proto(L), ~(ptrdiff_t)bc_d(ins)))); - o2 = &tv; - } else if (op == BC_ISEQN) { - o2 = &mref(curr_proto(L)->k, cTValue)[bc_d(ins)]; - } else { - lua_assert(op == BC_ISEQP); - setitype(&tv, ~bc_d(ins)); - o2 = &tv; - } - mo = lj_meta_lookup(L, o1mm, MM_eq); - if (LJ_LIKELY(!tvisnil(mo))) - return mmcall(L, cont, mo, o1, o2); - else - return (TValue *)(intptr_t)(bc_op(ins) & 1); -} -#endif - -/* Helper for ordered comparisons. String compare, __lt/__le metamethods. */ -TValue *lj_meta_comp(lua_State *L, cTValue *o1, cTValue *o2, int op) -{ - if (LJ_HASFFI && (tviscdata(o1) || tviscdata(o2))) { - ASMFunction cont = (op & 1) ? lj_cont_condf : lj_cont_condt; - MMS mm = (op & 2) ? MM_le : MM_lt; - cTValue *mo = lj_meta_lookup(L, tviscdata(o1) ? o1 : o2, mm); - if (LJ_UNLIKELY(tvisnil(mo))) goto err; - return mmcall(L, cont, mo, o1, o2); - } else if (LJ_52 || itype(o1) == itype(o2)) { - /* Never called with two numbers. */ - if (tvisstr(o1) && tvisstr(o2)) { - int32_t res = lj_str_cmp(strV(o1), strV(o2)); - return (TValue *)(intptr_t)(((op&2) ? res <= 0 : res < 0) ^ (op&1)); - } else { - trymt: - while (1) { - ASMFunction cont = (op & 1) ? lj_cont_condf : lj_cont_condt; - MMS mm = (op & 2) ? MM_le : MM_lt; - cTValue *mo = lj_meta_lookup(L, o1, mm); -#if LJ_52 - if (tvisnil(mo) && tvisnil((mo = lj_meta_lookup(L, o2, mm)))) -#else - cTValue *mo2 = lj_meta_lookup(L, o2, mm); - if (tvisnil(mo) || !lj_obj_equal(mo, mo2)) -#endif - { - if (op & 2) { /* MM_le not found: retry with MM_lt. */ - cTValue *ot = o1; o1 = o2; o2 = ot; /* Swap operands. */ - op ^= 3; /* Use LT and flip condition. */ - continue; - } - goto err; - } - return mmcall(L, cont, mo, o1, o2); - } - } - } else if (tvisbool(o1) && tvisbool(o2)) { - goto trymt; - } else { - err: - lj_err_comp(L, o1, o2); - return NULL; - } -} - -/* Helper for calls. __call metamethod. */ -void lj_meta_call(lua_State *L, TValue *func, TValue *top) -{ - cTValue *mo = lj_meta_lookup(L, func, MM_call); - TValue *p; - if (!tvisfunc(mo)) - lj_err_optype_call(L, func); - for (p = top; p > func; p--) copyTV(L, p, p-1); - copyTV(L, func, mo); -} - -/* Helper for FORI. Coercion. */ -void LJ_FASTCALL lj_meta_for(lua_State *L, TValue *o) -{ - if (!lj_strscan_numberobj(o)) lj_err_msg(L, LJ_ERR_FORINIT); - if (!lj_strscan_numberobj(o+1)) lj_err_msg(L, LJ_ERR_FORLIM); - if (!lj_strscan_numberobj(o+2)) lj_err_msg(L, LJ_ERR_FORSTEP); - if (LJ_DUALNUM) { - /* Ensure all slots are integers or all slots are numbers. */ - int32_t k[3]; - int nint = 0; - ptrdiff_t i; - for (i = 0; i <= 2; i++) { - if (tvisint(o+i)) { - k[i] = intV(o+i); nint++; - } else { - k[i] = lj_num2int(numV(o+i)); nint += ((lua_Number)k[i] == numV(o+i)); - } - } - if (nint == 3) { /* Narrow to integers. */ - setintV(o, k[0]); - setintV(o+1, k[1]); - setintV(o+2, k[2]); - } else if (nint != 0) { /* Widen to numbers. */ - if (tvisint(o)) setnumV(o, (lua_Number)intV(o)); - if (tvisint(o+1)) setnumV(o+1, (lua_Number)intV(o+1)); - if (tvisint(o+2)) setnumV(o+2, (lua_Number)intV(o+2)); - } - } -} - diff --git a/subprojects/luajit/src/lj_meta.h b/subprojects/luajit/src/lj_meta.h deleted file mode 100644 index e061d99eb..000000000 --- a/subprojects/luajit/src/lj_meta.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -** Metamethod handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_META_H -#define _LJ_META_H - -#include "lj_obj.h" - -/* Metamethod handling */ -LJ_FUNC void lj_meta_init(lua_State *L); -LJ_FUNC cTValue *lj_meta_cache(GCtab *mt, MMS mm, GCstr *name); -LJ_FUNC cTValue *lj_meta_lookup(lua_State *L, cTValue *o, MMS mm); -#if LJ_HASFFI -LJ_FUNC int lj_meta_tailcall(lua_State *L, cTValue *tv); -#endif - -#define lj_meta_fastg(g, mt, mm) \ - ((mt) == NULL ? NULL : ((mt)->nomm & (1u<<(mm))) ? NULL : \ - lj_meta_cache(mt, mm, mmname_str(g, mm))) -#define lj_meta_fast(L, mt, mm) lj_meta_fastg(G(L), mt, mm) - -/* C helpers for some instructions, called from assembler VM. */ -LJ_FUNCA cTValue *lj_meta_tget(lua_State *L, cTValue *o, cTValue *k); -LJ_FUNCA TValue *lj_meta_tset(lua_State *L, cTValue *o, cTValue *k); -LJ_FUNCA TValue *lj_meta_arith(lua_State *L, TValue *ra, cTValue *rb, - cTValue *rc, BCReg op); -LJ_FUNCA TValue *lj_meta_cat(lua_State *L, TValue *top, int left); -LJ_FUNCA TValue * LJ_FASTCALL lj_meta_len(lua_State *L, cTValue *o); -LJ_FUNCA TValue *lj_meta_equal(lua_State *L, GCobj *o1, GCobj *o2, int ne); -LJ_FUNCA TValue * LJ_FASTCALL lj_meta_equal_cd(lua_State *L, BCIns ins); -LJ_FUNCA TValue *lj_meta_comp(lua_State *L, cTValue *o1, cTValue *o2, int op); -LJ_FUNCA void lj_meta_call(lua_State *L, TValue *func, TValue *top); -LJ_FUNCA void LJ_FASTCALL lj_meta_for(lua_State *L, TValue *o); - -#endif diff --git a/subprojects/luajit/src/lj_obj.c b/subprojects/luajit/src/lj_obj.c deleted file mode 100644 index 4779d26df..000000000 --- a/subprojects/luajit/src/lj_obj.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -** Miscellaneous object handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_obj_c -#define LUA_CORE - -#include "lj_obj.h" - -/* Object type names. */ -LJ_DATADEF const char *const lj_obj_typename[] = { /* ORDER LUA_T */ - "no value", "nil", "boolean", "userdata", "number", "string", - "table", "function", "userdata", "thread", "proto", "cdata" -}; - -LJ_DATADEF const char *const lj_obj_itypename[] = { /* ORDER LJ_T */ - "nil", "boolean", "boolean", "userdata", "string", "upval", "thread", - "proto", "function", "trace", "cdata", "table", "userdata", "number" -}; - -/* Compare two objects without calling metamethods. */ -int lj_obj_equal(cTValue *o1, cTValue *o2) -{ - if (itype(o1) == itype(o2)) { - if (tvispri(o1)) - return 1; - if (!tvisnum(o1)) - return gcrefeq(o1->gcr, o2->gcr); - } else if (!tvisnumber(o1) || !tvisnumber(o2)) { - return 0; - } - return numberVnum(o1) == numberVnum(o2); -} - diff --git a/subprojects/luajit/src/lj_obj.h b/subprojects/luajit/src/lj_obj.h deleted file mode 100644 index e70b00322..000000000 --- a/subprojects/luajit/src/lj_obj.h +++ /dev/null @@ -1,856 +0,0 @@ -/* -** LuaJIT VM tags, values and objects. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#ifndef _LJ_OBJ_H -#define _LJ_OBJ_H - -#include "lua.h" -#include "lj_def.h" -#include "lj_arch.h" - -/* -- Memory references (32 bit address space) ---------------------------- */ - -/* Memory size. */ -typedef uint32_t MSize; - -/* Memory reference */ -typedef struct MRef { - uint32_t ptr32; /* Pseudo 32 bit pointer. */ -} MRef; - -#define mref(r, t) ((t *)(void *)(uintptr_t)(r).ptr32) - -#define setmref(r, p) ((r).ptr32 = (uint32_t)(uintptr_t)(void *)(p)) -#define setmrefr(r, v) ((r).ptr32 = (v).ptr32) - -/* -- GC object references (32 bit address space) ------------------------- */ - -/* GCobj reference */ -typedef struct GCRef { - uint32_t gcptr32; /* Pseudo 32 bit pointer. */ -} GCRef; - -/* Common GC header for all collectable objects. */ -#define GCHeader GCRef nextgc; uint8_t marked; uint8_t gct -/* This occupies 6 bytes, so use the next 2 bytes for non-32 bit fields. */ - -#define gcref(r) ((GCobj *)(uintptr_t)(r).gcptr32) -#define gcrefp(r, t) ((t *)(void *)(uintptr_t)(r).gcptr32) -#define gcrefu(r) ((r).gcptr32) -#define gcrefi(r) ((int32_t)(r).gcptr32) -#define gcrefeq(r1, r2) ((r1).gcptr32 == (r2).gcptr32) -#define gcnext(gc) (gcref((gc)->gch.nextgc)) - -#define setgcref(r, gc) ((r).gcptr32 = (uint32_t)(uintptr_t)&(gc)->gch) -#define setgcrefi(r, i) ((r).gcptr32 = (uint32_t)(i)) -#define setgcrefp(r, p) ((r).gcptr32 = (uint32_t)(uintptr_t)(p)) -#define setgcrefnull(r) ((r).gcptr32 = 0) -#define setgcrefr(r, v) ((r).gcptr32 = (v).gcptr32) - -/* IMPORTANT NOTE: -** -** All uses of the setgcref* macros MUST be accompanied with a write barrier. -** -** This is to ensure the integrity of the incremental GC. The invariant -** to preserve is that a black object never points to a white object. -** I.e. never store a white object into a field of a black object. -** -** It's ok to LEAVE OUT the write barrier ONLY in the following cases: -** - The source is not a GC object (NULL). -** - The target is a GC root. I.e. everything in global_State. -** - The target is a lua_State field (threads are never black). -** - The target is a stack slot, see setgcV et al. -** - The target is an open upvalue, i.e. pointing to a stack slot. -** - The target is a newly created object (i.e. marked white). But make -** sure nothing invokes the GC inbetween. -** - The target and the source are the same object (self-reference). -** - The target already contains the object (e.g. moving elements around). -** -** The most common case is a store to a stack slot. All other cases where -** a barrier has been omitted are annotated with a NOBARRIER comment. -** -** The same logic applies for stores to table slots (array part or hash -** part). ALL uses of lj_tab_set* require a barrier for the stored value -** *and* the stored key, based on the above rules. In practice this means -** a barrier is needed if *either* of the key or value are a GC object. -** -** It's ok to LEAVE OUT the write barrier in the following special cases: -** - The stored value is nil. The key doesn't matter because it's either -** not resurrected or lj_tab_newkey() will take care of the key barrier. -** - The key doesn't matter if the *previously* stored value is guaranteed -** to be non-nil (because the key is kept alive in the table). -** - The key doesn't matter if it's guaranteed not to be part of the table, -** since lj_tab_newkey() takes care of the key barrier. This applies -** trivially to new tables, but watch out for resurrected keys. Storing -** a nil value leaves the key in the table! -** -** In case of doubt use lj_gc_anybarriert() as it's rather cheap. It's used -** by the interpreter for all table stores. -** -** Note: In contrast to Lua's GC, LuaJIT's GC does *not* specially mark -** dead keys in tables. The reference is left in, but it's guaranteed to -** be never dereferenced as long as the value is nil. It's ok if the key is -** freed or if any object subsequently gets the same address. -** -** Not destroying dead keys helps to keep key hash slots stable. This avoids -** specialization back-off for HREFK when a value flips between nil and -** non-nil and the GC gets in the way. It also allows safely hoisting -** HREF/HREFK across GC steps. Dead keys are only removed if a table is -** resized (i.e. by NEWREF) and xREF must not be CSEd across a resize. -** -** The trade-off is that a write barrier for tables must take the key into -** account, too. Implicitly resurrecting the key by storing a non-nil value -** may invalidate the incremental GC invariant. -*/ - -/* -- Common type definitions --------------------------------------------- */ - -/* Types for handling bytecodes. Need this here, details in lj_bc.h. */ -typedef uint32_t BCIns; /* Bytecode instruction. */ -typedef uint32_t BCPos; /* Bytecode position. */ -typedef uint32_t BCReg; /* Bytecode register. */ -typedef int32_t BCLine; /* Bytecode line number. */ - -/* Internal assembler functions. Never call these directly from C. */ -typedef void (*ASMFunction)(void); - -/* Resizable string buffer. Need this here, details in lj_str.h. */ -typedef struct SBuf { - char *buf; /* String buffer base. */ - MSize n; /* String buffer length. */ - MSize sz; /* String buffer size. */ -} SBuf; - -/* -- Tags and values ----------------------------------------------------- */ - -/* Frame link. */ -typedef union { - int32_t ftsz; /* Frame type and size of previous frame. */ - MRef pcr; /* Overlaps PC for Lua frames. */ -} FrameLink; - -/* Tagged value. */ -typedef LJ_ALIGN(8) union TValue { - uint64_t u64; /* 64 bit pattern overlaps number. */ - lua_Number n; /* Number object overlaps split tag/value object. */ - struct { - LJ_ENDIAN_LOHI( - union { - GCRef gcr; /* GCobj reference (if any). */ - int32_t i; /* Integer value. */ - }; - , uint32_t it; /* Internal object tag. Must overlap MSW of number. */ - ) - }; - struct { - LJ_ENDIAN_LOHI( - GCRef func; /* Function for next frame (or dummy L). */ - , FrameLink tp; /* Link to previous frame. */ - ) - } fr; - struct { - LJ_ENDIAN_LOHI( - uint32_t lo; /* Lower 32 bits of number. */ - , uint32_t hi; /* Upper 32 bits of number. */ - ) - } u32; -} TValue; - -typedef const TValue cTValue; - -#define tvref(r) (mref(r, TValue)) - -/* More external and GCobj tags for internal objects. */ -#define LAST_TT LUA_TTHREAD -#define LUA_TPROTO (LAST_TT+1) -#define LUA_TCDATA (LAST_TT+2) - -/* Internal object tags. -** -** Internal tags overlap the MSW of a number object (must be a double). -** Interpreted as a double these are special NaNs. The FPU only generates -** one type of NaN (0xfff8_0000_0000_0000). So MSWs > 0xfff80000 are available -** for use as internal tags. Small negative numbers are used to shorten the -** encoding of type comparisons (reg/mem against sign-ext. 8 bit immediate). -** -** ---MSW---.---LSW--- -** primitive types | itype | | -** lightuserdata | itype | void * | (32 bit platforms) -** lightuserdata |ffff| void * | (64 bit platforms, 47 bit pointers) -** GC objects | itype | GCRef | -** int (LJ_DUALNUM)| itype | int | -** number -------double------ -** -** ORDER LJ_T -** Primitive types nil/false/true must be first, lightuserdata next. -** GC objects are at the end, table/userdata must be lowest. -** Also check lj_ir.h for similar ordering constraints. -*/ -#define LJ_TNIL (~0u) -#define LJ_TFALSE (~1u) -#define LJ_TTRUE (~2u) -#define LJ_TLIGHTUD (~3u) -#define LJ_TSTR (~4u) -#define LJ_TUPVAL (~5u) -#define LJ_TTHREAD (~6u) -#define LJ_TPROTO (~7u) -#define LJ_TFUNC (~8u) -#define LJ_TTRACE (~9u) -#define LJ_TCDATA (~10u) -#define LJ_TTAB (~11u) -#define LJ_TUDATA (~12u) -/* This is just the canonical number type used in some places. */ -#define LJ_TNUMX (~13u) - -/* Integers have itype == LJ_TISNUM doubles have itype < LJ_TISNUM */ -#if LJ_64 -#define LJ_TISNUM 0xfffeffffu -#else -#define LJ_TISNUM LJ_TNUMX -#endif -#define LJ_TISTRUECOND LJ_TFALSE -#define LJ_TISPRI LJ_TTRUE -#define LJ_TISGCV (LJ_TSTR+1) -#define LJ_TISTABUD LJ_TTAB - -/* -- String object ------------------------------------------------------- */ - -/* String object header. String payload follows. */ -typedef struct GCstr { - GCHeader; - uint8_t reserved; /* Used by lexer for fast lookup of reserved words. */ - uint8_t unused; - MSize hash; /* Hash of string. */ - MSize len; /* Size of string. */ -} GCstr; - -#define strref(r) (&gcref((r))->str) -#define strdata(s) ((const char *)((s)+1)) -#define strdatawr(s) ((char *)((s)+1)) -#define strVdata(o) strdata(strV(o)) -#define sizestring(s) (sizeof(struct GCstr)+(s)->len+1) - -/* -- Userdata object ----------------------------------------------------- */ - -/* Userdata object. Payload follows. */ -typedef struct GCudata { - GCHeader; - uint8_t udtype; /* Userdata type. */ - uint8_t unused2; - GCRef env; /* Should be at same offset in GCfunc. */ - MSize len; /* Size of payload. */ - GCRef metatable; /* Must be at same offset in GCtab. */ - uint32_t align1; /* To force 8 byte alignment of the payload. */ -} GCudata; - -/* Userdata types. */ -enum { - UDTYPE_USERDATA, /* Regular userdata. */ - UDTYPE_IO_FILE, /* I/O library FILE. */ - UDTYPE_FFI_CLIB, /* FFI C library namespace. */ - UDTYPE__MAX -}; - -#define uddata(u) ((void *)((u)+1)) -#define sizeudata(u) (sizeof(struct GCudata)+(u)->len) - -/* -- C data object ------------------------------------------------------- */ - -/* C data object. Payload follows. */ -typedef struct GCcdata { - GCHeader; - uint16_t ctypeid; /* C type ID. */ -} GCcdata; - -/* Prepended to variable-sized or realigned C data objects. */ -typedef struct GCcdataVar { - uint16_t offset; /* Offset to allocated memory (relative to GCcdata). */ - uint16_t extra; /* Extra space allocated (incl. GCcdata + GCcdatav). */ - MSize len; /* Size of payload. */ -} GCcdataVar; - -#define cdataptr(cd) ((void *)((cd)+1)) -#define cdataisv(cd) ((cd)->marked & 0x80) -#define cdatav(cd) ((GCcdataVar *)((char *)(cd) - sizeof(GCcdataVar))) -#define cdatavlen(cd) check_exp(cdataisv(cd), cdatav(cd)->len) -#define sizecdatav(cd) (cdatavlen(cd) + cdatav(cd)->extra) -#define memcdatav(cd) ((void *)((char *)(cd) - cdatav(cd)->offset)) - -/* -- Prototype object ---------------------------------------------------- */ - -#define SCALE_NUM_GCO ((int32_t)sizeof(lua_Number)/sizeof(GCRef)) -#define round_nkgc(n) (((n) + SCALE_NUM_GCO-1) & ~(SCALE_NUM_GCO-1)) - -typedef struct GCproto { - GCHeader; - uint8_t numparams; /* Number of parameters. */ - uint8_t framesize; /* Fixed frame size. */ - MSize sizebc; /* Number of bytecode instructions. */ - GCRef gclist; - MRef k; /* Split constant array (points to the middle). */ - MRef uv; /* Upvalue list. local slot|0x8000 or parent uv idx. */ - MSize sizekgc; /* Number of collectable constants. */ - MSize sizekn; /* Number of lua_Number constants. */ - MSize sizept; /* Total size including colocated arrays. */ - uint8_t sizeuv; /* Number of upvalues. */ - uint8_t flags; /* Miscellaneous flags (see below). */ - uint16_t trace; /* Anchor for chain of root traces. */ - /* ------ The following fields are for debugging/tracebacks only ------ */ - GCRef chunkname; /* Name of the chunk this function was defined in. */ - BCLine firstline; /* First line of the function definition. */ - BCLine numline; /* Number of lines for the function definition. */ - MRef lineinfo; /* Compressed map from bytecode ins. to source line. */ - MRef uvinfo; /* Upvalue names. */ - MRef varinfo; /* Names and compressed extents of local variables. */ -} GCproto; - -/* Flags for prototype. */ -#define PROTO_CHILD 0x01 /* Has child prototypes. */ -#define PROTO_VARARG 0x02 /* Vararg function. */ -#define PROTO_FFI 0x04 /* Uses BC_KCDATA for FFI datatypes. */ -#define PROTO_NOJIT 0x08 /* JIT disabled for this function. */ -#define PROTO_ILOOP 0x10 /* Patched bytecode with ILOOP etc. */ -/* Only used during parsing. */ -#define PROTO_HAS_RETURN 0x20 /* Already emitted a return. */ -#define PROTO_FIXUP_RETURN 0x40 /* Need to fixup emitted returns. */ -/* Top bits used for counting created closures. */ -#define PROTO_CLCOUNT 0x20 /* Base of saturating 3 bit counter. */ -#define PROTO_CLC_BITS 3 -#define PROTO_CLC_POLY (3*PROTO_CLCOUNT) /* Polymorphic threshold. */ - -#define PROTO_UV_LOCAL 0x8000 /* Upvalue for local slot. */ -#define PROTO_UV_IMMUTABLE 0x4000 /* Immutable upvalue. */ - -#define proto_kgc(pt, idx) \ - check_exp((uintptr_t)(intptr_t)(idx) >= (uintptr_t)-(intptr_t)(pt)->sizekgc, \ - gcref(mref((pt)->k, GCRef)[(idx)])) -#define proto_knumtv(pt, idx) \ - check_exp((uintptr_t)(idx) < (pt)->sizekn, &mref((pt)->k, TValue)[(idx)]) -#define proto_bc(pt) ((BCIns *)((char *)(pt) + sizeof(GCproto))) -#define proto_bcpos(pt, pc) ((BCPos)((pc) - proto_bc(pt))) -#define proto_uv(pt) (mref((pt)->uv, uint16_t)) - -#define proto_chunkname(pt) (strref((pt)->chunkname)) -#define proto_chunknamestr(pt) (strdata(proto_chunkname((pt)))) -#define proto_lineinfo(pt) (mref((pt)->lineinfo, const void)) -#define proto_uvinfo(pt) (mref((pt)->uvinfo, const uint8_t)) -#define proto_varinfo(pt) (mref((pt)->varinfo, const uint8_t)) - -/* -- Upvalue object ------------------------------------------------------ */ - -typedef struct GCupval { - GCHeader; - uint8_t closed; /* Set if closed (i.e. uv->v == &uv->u.value). */ - uint8_t immutable; /* Immutable value. */ - union { - TValue tv; /* If closed: the value itself. */ - struct { /* If open: double linked list, anchored at thread. */ - GCRef prev; - GCRef next; - }; - }; - MRef v; /* Points to stack slot (open) or above (closed). */ - uint32_t dhash; /* Disambiguation hash: dh1 != dh2 => cannot alias. */ -} GCupval; - -#define uvprev(uv_) (&gcref((uv_)->prev)->uv) -#define uvnext(uv_) (&gcref((uv_)->next)->uv) -#define uvval(uv_) (mref((uv_)->v, TValue)) - -/* -- Function object (closures) ------------------------------------------ */ - -/* Common header for functions. env should be at same offset in GCudata. */ -#define GCfuncHeader \ - GCHeader; uint8_t ffid; uint8_t nupvalues; \ - GCRef env; GCRef gclist; MRef pc - -typedef struct GCfuncC { - GCfuncHeader; - lua_CFunction f; /* C function to be called. */ - TValue upvalue[1]; /* Array of upvalues (TValue). */ -} GCfuncC; - -typedef struct GCfuncL { - GCfuncHeader; - GCRef uvptr[1]; /* Array of _pointers_ to upvalue objects (GCupval). */ -} GCfuncL; - -typedef union GCfunc { - GCfuncC c; - GCfuncL l; -} GCfunc; - -#define FF_LUA 0 -#define FF_C 1 -#define isluafunc(fn) ((fn)->c.ffid == FF_LUA) -#define iscfunc(fn) ((fn)->c.ffid == FF_C) -#define isffunc(fn) ((fn)->c.ffid > FF_C) -#define funcproto(fn) \ - check_exp(isluafunc(fn), (GCproto *)(mref((fn)->l.pc, char)-sizeof(GCproto))) -#define sizeCfunc(n) (sizeof(GCfuncC)-sizeof(TValue)+sizeof(TValue)*(n)) -#define sizeLfunc(n) (sizeof(GCfuncL)-sizeof(GCRef)+sizeof(GCRef)*(n)) - -/* -- Table object -------------------------------------------------------- */ - -/* Hash node. */ -typedef struct Node { - TValue val; /* Value object. Must be first field. */ - TValue key; /* Key object. */ - MRef next; /* Hash chain. */ - MRef freetop; /* Top of free elements (stored in t->node[0]). */ -} Node; - -LJ_STATIC_ASSERT(offsetof(Node, val) == 0); - -typedef struct GCtab { - GCHeader; - uint8_t nomm; /* Negative cache for fast metamethods. */ - int8_t colo; /* Array colocation. */ - MRef array; /* Array part. */ - GCRef gclist; - GCRef metatable; /* Must be at same offset in GCudata. */ - MRef node; /* Hash part. */ - uint32_t asize; /* Size of array part (keys [0, asize-1]). */ - uint32_t hmask; /* Hash part mask (size of hash part - 1). */ -} GCtab; - -#define sizetabcolo(n) ((n)*sizeof(TValue) + sizeof(GCtab)) -#define tabref(r) (&gcref((r))->tab) -#define noderef(r) (mref((r), Node)) -#define nextnode(n) (mref((n)->next, Node)) - -/* -- State objects ------------------------------------------------------- */ - -/* VM states. */ -enum { - LJ_VMST_INTERP, /* Interpreter. */ - LJ_VMST_C, /* C function. */ - LJ_VMST_GC, /* Garbage collector. */ - LJ_VMST_EXIT, /* Trace exit handler. */ - LJ_VMST_RECORD, /* Trace recorder. */ - LJ_VMST_OPT, /* Optimizer. */ - LJ_VMST_ASM, /* Assembler. */ - LJ_VMST__MAX -}; - -#define setvmstate(g, st) ((g)->vmstate = ~LJ_VMST_##st) - -/* Metamethods. ORDER MM */ -#ifdef LJ_HASFFI -#define MMDEF_FFI(_) _(new) -#else -#define MMDEF_FFI(_) -#endif - -#if LJ_52 || LJ_HASFFI -#define MMDEF_PAIRS(_) _(pairs) _(ipairs) -#else -#define MMDEF_PAIRS(_) -#define MM_pairs 255 -#define MM_ipairs 255 -#endif - -#define MMDEF(_) \ - _(index) _(newindex) _(gc) _(mode) _(eq) _(len) \ - /* Only the above (fast) metamethods are negative cached (max. 8). */ \ - _(lt) _(le) _(concat) _(call) \ - /* The following must be in ORDER ARITH. */ \ - _(add) _(sub) _(mul) _(div) _(mod) _(pow) _(unm) \ - /* The following are used in the standard libraries. */ \ - _(metatable) _(tostring) MMDEF_FFI(_) MMDEF_PAIRS(_) - -typedef enum { -#define MMENUM(name) MM_##name, -MMDEF(MMENUM) -#undef MMENUM - MM__MAX, - MM____ = MM__MAX, - MM_FAST = MM_len -} MMS; - -/* GC root IDs. */ -typedef enum { - GCROOT_MMNAME, /* Metamethod names. */ - GCROOT_MMNAME_LAST = GCROOT_MMNAME + MM__MAX-1, - GCROOT_BASEMT, /* Metatables for base types. */ - GCROOT_BASEMT_NUM = GCROOT_BASEMT + ~LJ_TNUMX, - GCROOT_IO_INPUT, /* Userdata for default I/O input file. */ - GCROOT_IO_OUTPUT, /* Userdata for default I/O output file. */ - GCROOT_MAX -} GCRootID; - -#define basemt_it(g, it) ((g)->gcroot[GCROOT_BASEMT+~(it)]) -#define basemt_obj(g, o) ((g)->gcroot[GCROOT_BASEMT+itypemap(o)]) -#define mmname_str(g, mm) (strref((g)->gcroot[GCROOT_MMNAME+(mm)])) - -typedef struct GCState { - MSize total; /* Memory currently allocated. */ - MSize threshold; /* Memory threshold. */ - uint8_t currentwhite; /* Current white color. */ - uint8_t state; /* GC state. */ - uint8_t nocdatafin; /* No cdata finalizer called. */ - uint8_t unused2; - MSize sweepstr; /* Sweep position in string table. */ - GCRef root; /* List of all collectable objects. */ - MRef sweep; /* Sweep position in root list. */ - GCRef gray; /* List of gray objects. */ - GCRef grayagain; /* List of objects for atomic traversal. */ - GCRef weak; /* List of weak tables (to be cleared). */ - GCRef mmudata; /* List of userdata (to be finalized). */ - MSize stepmul; /* Incremental GC step granularity. */ - MSize debt; /* Debt (how much GC is behind schedule). */ - MSize estimate; /* Estimate of memory actually in use. */ - MSize pause; /* Pause between successive GC cycles. */ -} GCState; - -/* Global state, shared by all threads of a Lua universe. */ -typedef struct global_State { - GCRef *strhash; /* String hash table (hash chain anchors). */ - MSize strmask; /* String hash mask (size of hash table - 1). */ - MSize strnum; /* Number of strings in hash table. */ - lua_Alloc allocf; /* Memory allocator. */ - void *allocd; /* Memory allocator data. */ - GCState gc; /* Garbage collector. */ - SBuf tmpbuf; /* Temporary buffer for string concatenation. */ - Node nilnode; /* Fallback 1-element hash part (nil key and value). */ - GCstr strempty; /* Empty string. */ - uint8_t stremptyz; /* Zero terminator of empty string. */ - uint8_t hookmask; /* Hook mask. */ - uint8_t dispatchmode; /* Dispatch mode. */ - uint8_t vmevmask; /* VM event mask. */ - GCRef mainthref; /* Link to main thread. */ - TValue registrytv; /* Anchor for registry. */ - TValue tmptv, tmptv2; /* Temporary TValues. */ - GCupval uvhead; /* Head of double-linked list of all open upvalues. */ - int32_t hookcount; /* Instruction hook countdown. */ - int32_t hookcstart; /* Start count for instruction hook counter. */ - lua_Hook hookf; /* Hook function. */ - lua_CFunction wrapf; /* Wrapper for C function calls. */ - lua_CFunction panic; /* Called as a last resort for errors. */ - volatile int32_t vmstate; /* VM state or current JIT code trace number. */ - BCIns bc_cfunc_int; /* Bytecode for internal C function calls. */ - BCIns bc_cfunc_ext; /* Bytecode for external C function calls. */ - GCRef jit_L; /* Current JIT code lua_State or NULL. */ - MRef jit_base; /* Current JIT code L->base. */ - MRef ctype_state; /* Pointer to C type state. */ - GCRef gcroot[GCROOT_MAX]; /* GC roots. */ -} global_State; - -#define mainthread(g) (&gcref(g->mainthref)->th) -#define niltv(L) \ - check_exp(tvisnil(&G(L)->nilnode.val), &G(L)->nilnode.val) -#define niltvg(g) \ - check_exp(tvisnil(&(g)->nilnode.val), &(g)->nilnode.val) - -/* Hook management. Hook event masks are defined in lua.h. */ -#define HOOK_EVENTMASK 0x0f -#define HOOK_ACTIVE 0x10 -#define HOOK_ACTIVE_SHIFT 4 -#define HOOK_VMEVENT 0x20 -#define HOOK_GC 0x40 -#define hook_active(g) ((g)->hookmask & HOOK_ACTIVE) -#define hook_enter(g) ((g)->hookmask |= HOOK_ACTIVE) -#define hook_entergc(g) ((g)->hookmask |= (HOOK_ACTIVE|HOOK_GC)) -#define hook_vmevent(g) ((g)->hookmask |= (HOOK_ACTIVE|HOOK_VMEVENT)) -#define hook_leave(g) ((g)->hookmask &= ~HOOK_ACTIVE) -#define hook_save(g) ((g)->hookmask & ~HOOK_EVENTMASK) -#define hook_restore(g, h) \ - ((g)->hookmask = ((g)->hookmask & HOOK_EVENTMASK) | (h)) - -/* Per-thread state object. */ -struct lua_State { - GCHeader; - uint8_t dummy_ffid; /* Fake FF_C for curr_funcisL() on dummy frames. */ - uint8_t status; /* Thread status. */ - MRef glref; /* Link to global state. */ - GCRef gclist; /* GC chain. */ - TValue *base; /* Base of currently executing function. */ - TValue *top; /* First free slot in the stack. */ - MRef maxstack; /* Last free slot in the stack. */ - MRef stack; /* Stack base. */ - GCRef openupval; /* List of open upvalues in the stack. */ - GCRef env; /* Thread environment (table of globals). */ - void *cframe; /* End of C stack frame chain. */ - MSize stacksize; /* True stack size (incl. LJ_STACK_EXTRA). */ -}; - -#define G(L) (mref(L->glref, global_State)) -#define registry(L) (&G(L)->registrytv) - -/* Macros to access the currently executing (Lua) function. */ -#define curr_func(L) (&gcref((L->base-1)->fr.func)->fn) -#define curr_funcisL(L) (isluafunc(curr_func(L))) -#define curr_proto(L) (funcproto(curr_func(L))) -#define curr_topL(L) (L->base + curr_proto(L)->framesize) -#define curr_top(L) (curr_funcisL(L) ? curr_topL(L) : L->top) - -/* -- GC object definition and conversions -------------------------------- */ - -/* GC header for generic access to common fields of GC objects. */ -typedef struct GChead { - GCHeader; - uint8_t unused1; - uint8_t unused2; - GCRef env; - GCRef gclist; - GCRef metatable; -} GChead; - -/* The env field SHOULD be at the same offset for all GC objects. */ -LJ_STATIC_ASSERT(offsetof(GChead, env) == offsetof(GCfuncL, env)); -LJ_STATIC_ASSERT(offsetof(GChead, env) == offsetof(GCudata, env)); - -/* The metatable field MUST be at the same offset for all GC objects. */ -LJ_STATIC_ASSERT(offsetof(GChead, metatable) == offsetof(GCtab, metatable)); -LJ_STATIC_ASSERT(offsetof(GChead, metatable) == offsetof(GCudata, metatable)); - -/* The gclist field MUST be at the same offset for all GC objects. */ -LJ_STATIC_ASSERT(offsetof(GChead, gclist) == offsetof(lua_State, gclist)); -LJ_STATIC_ASSERT(offsetof(GChead, gclist) == offsetof(GCproto, gclist)); -LJ_STATIC_ASSERT(offsetof(GChead, gclist) == offsetof(GCfuncL, gclist)); -LJ_STATIC_ASSERT(offsetof(GChead, gclist) == offsetof(GCtab, gclist)); - -typedef union GCobj { - GChead gch; - GCstr str; - GCupval uv; - lua_State th; - GCproto pt; - GCfunc fn; - GCcdata cd; - GCtab tab; - GCudata ud; -} GCobj; - -/* Macros to convert a GCobj pointer into a specific value. */ -#define gco2str(o) check_exp((o)->gch.gct == ~LJ_TSTR, &(o)->str) -#define gco2uv(o) check_exp((o)->gch.gct == ~LJ_TUPVAL, &(o)->uv) -#define gco2th(o) check_exp((o)->gch.gct == ~LJ_TTHREAD, &(o)->th) -#define gco2pt(o) check_exp((o)->gch.gct == ~LJ_TPROTO, &(o)->pt) -#define gco2func(o) check_exp((o)->gch.gct == ~LJ_TFUNC, &(o)->fn) -#define gco2cd(o) check_exp((o)->gch.gct == ~LJ_TCDATA, &(o)->cd) -#define gco2tab(o) check_exp((o)->gch.gct == ~LJ_TTAB, &(o)->tab) -#define gco2ud(o) check_exp((o)->gch.gct == ~LJ_TUDATA, &(o)->ud) - -/* Macro to convert any collectable object into a GCobj pointer. */ -#define obj2gco(v) ((GCobj *)(v)) - -/* -- TValue getters/setters ---------------------------------------------- */ - -#ifdef LUA_USE_ASSERT -#include "lj_gc.h" -#endif - -/* Macros to test types. */ -#define itype(o) ((o)->it) -#define tvisnil(o) (itype(o) == LJ_TNIL) -#define tvisfalse(o) (itype(o) == LJ_TFALSE) -#define tvistrue(o) (itype(o) == LJ_TTRUE) -#define tvisbool(o) (tvisfalse(o) || tvistrue(o)) -#if LJ_64 -#define tvislightud(o) (((int32_t)itype(o) >> 15) == -2) -#else -#define tvislightud(o) (itype(o) == LJ_TLIGHTUD) -#endif -#define tvisstr(o) (itype(o) == LJ_TSTR) -#define tvisfunc(o) (itype(o) == LJ_TFUNC) -#define tvisthread(o) (itype(o) == LJ_TTHREAD) -#define tvisproto(o) (itype(o) == LJ_TPROTO) -#define tviscdata(o) (itype(o) == LJ_TCDATA) -#define tvistab(o) (itype(o) == LJ_TTAB) -#define tvisudata(o) (itype(o) == LJ_TUDATA) -#define tvisnumber(o) (itype(o) <= LJ_TISNUM) -#define tvisint(o) (LJ_DUALNUM && itype(o) == LJ_TISNUM) -#define tvisnum(o) (itype(o) < LJ_TISNUM) - -#define tvistruecond(o) (itype(o) < LJ_TISTRUECOND) -#define tvispri(o) (itype(o) >= LJ_TISPRI) -#define tvistabud(o) (itype(o) <= LJ_TISTABUD) /* && !tvisnum() */ -#define tvisgcv(o) ((itype(o) - LJ_TISGCV) > (LJ_TNUMX - LJ_TISGCV)) - -/* Special macros to test numbers for NaN, +0, -0, +1 and raw equality. */ -#define tvisnan(o) ((o)->n != (o)->n) -#if LJ_64 -#define tviszero(o) (((o)->u64 << 1) == 0) -#else -#define tviszero(o) (((o)->u32.lo | ((o)->u32.hi << 1)) == 0) -#endif -#define tvispzero(o) ((o)->u64 == 0) -#define tvismzero(o) ((o)->u64 == U64x(80000000,00000000)) -#define tvispone(o) ((o)->u64 == U64x(3ff00000,00000000)) -#define rawnumequal(o1, o2) ((o1)->u64 == (o2)->u64) - -/* Macros to convert type ids. */ -#if LJ_64 -#define itypemap(o) \ - (tvisnumber(o) ? ~LJ_TNUMX : tvislightud(o) ? ~LJ_TLIGHTUD : ~itype(o)) -#else -#define itypemap(o) (tvisnumber(o) ? ~LJ_TNUMX : ~itype(o)) -#endif - -/* Macros to get tagged values. */ -#define gcval(o) (gcref((o)->gcr)) -#define boolV(o) check_exp(tvisbool(o), (LJ_TFALSE - (o)->it)) -#if LJ_64 -#define lightudV(o) \ - check_exp(tvislightud(o), (void *)((o)->u64 & U64x(00007fff,ffffffff))) -#else -#define lightudV(o) check_exp(tvislightud(o), gcrefp((o)->gcr, void)) -#endif -#define gcV(o) check_exp(tvisgcv(o), gcval(o)) -#define strV(o) check_exp(tvisstr(o), &gcval(o)->str) -#define funcV(o) check_exp(tvisfunc(o), &gcval(o)->fn) -#define threadV(o) check_exp(tvisthread(o), &gcval(o)->th) -#define protoV(o) check_exp(tvisproto(o), &gcval(o)->pt) -#define cdataV(o) check_exp(tviscdata(o), &gcval(o)->cd) -#define tabV(o) check_exp(tvistab(o), &gcval(o)->tab) -#define udataV(o) check_exp(tvisudata(o), &gcval(o)->ud) -#define numV(o) check_exp(tvisnum(o), (o)->n) -#define intV(o) check_exp(tvisint(o), (int32_t)(o)->i) - -/* Macros to set tagged values. */ -#define setitype(o, i) ((o)->it = (i)) -#define setnilV(o) ((o)->it = LJ_TNIL) -#define setboolV(o, x) ((o)->it = LJ_TFALSE-(uint32_t)(x)) - -static LJ_AINLINE void setlightudV(TValue *o, void *p) -{ -#if LJ_64 - o->u64 = (uint64_t)p | (((uint64_t)0xffff) << 48); -#else - setgcrefp(o->gcr, p); setitype(o, LJ_TLIGHTUD); -#endif -} - -#if LJ_64 -#define checklightudptr(L, p) \ - (((uint64_t)(p) >> 47) ? (lj_err_msg(L, LJ_ERR_BADLU), NULL) : (p)) -#define setcont(o, f) \ - ((o)->u64 = (uint64_t)(void *)(f) - (uint64_t)lj_vm_asm_begin) -#else -#define checklightudptr(L, p) (p) -#define setcont(o, f) setlightudV((o), (void *)(f)) -#endif - -#define tvchecklive(L, o) \ - UNUSED(L), lua_assert(!tvisgcv(o) || \ - ((~itype(o) == gcval(o)->gch.gct) && !isdead(G(L), gcval(o)))) - -static LJ_AINLINE void setgcV(lua_State *L, TValue *o, GCobj *v, uint32_t itype) -{ - setgcref(o->gcr, v); setitype(o, itype); tvchecklive(L, o); -} - -#define define_setV(name, type, tag) \ -static LJ_AINLINE void name(lua_State *L, TValue *o, type *v) \ -{ \ - setgcV(L, o, obj2gco(v), tag); \ -} -define_setV(setstrV, GCstr, LJ_TSTR) -define_setV(setthreadV, lua_State, LJ_TTHREAD) -define_setV(setprotoV, GCproto, LJ_TPROTO) -define_setV(setfuncV, GCfunc, LJ_TFUNC) -define_setV(setcdataV, GCcdata, LJ_TCDATA) -define_setV(settabV, GCtab, LJ_TTAB) -define_setV(setudataV, GCudata, LJ_TUDATA) - -#define setnumV(o, x) ((o)->n = (x)) -#define setnanV(o) ((o)->u64 = U64x(fff80000,00000000)) -#define setpinfV(o) ((o)->u64 = U64x(7ff00000,00000000)) -#define setminfV(o) ((o)->u64 = U64x(fff00000,00000000)) - -static LJ_AINLINE void setintV(TValue *o, int32_t i) -{ -#if LJ_DUALNUM - o->i = (uint32_t)i; setitype(o, LJ_TISNUM); -#else - o->n = (lua_Number)i; -#endif -} - -static LJ_AINLINE void setint64V(TValue *o, int64_t i) -{ - if (LJ_DUALNUM && LJ_LIKELY(i == (int64_t)(int32_t)i)) - setintV(o, (int32_t)i); - else - setnumV(o, (lua_Number)i); -} - -#if LJ_64 -#define setintptrV(o, i) setint64V((o), (i)) -#else -#define setintptrV(o, i) setintV((o), (i)) -#endif - -/* Copy tagged values. */ -static LJ_AINLINE void copyTV(lua_State *L, TValue *o1, const TValue *o2) -{ - *o1 = *o2; tvchecklive(L, o1); -} - -/* -- Number to integer conversion ---------------------------------------- */ - -#if LJ_SOFTFP -LJ_ASMF int32_t lj_vm_tobit(double x); -#endif - -static LJ_AINLINE int32_t lj_num2bit(lua_Number n) -{ -#if LJ_SOFTFP - return lj_vm_tobit(n); -#else - TValue o; - o.n = n + 6755399441055744.0; /* 2^52 + 2^51 */ - return (int32_t)o.u32.lo; -#endif -} - -#if LJ_TARGET_X86 && !defined(__SSE2__) -#define lj_num2int(n) lj_num2bit((n)) -#else -#define lj_num2int(n) ((int32_t)(n)) -#endif - -static LJ_AINLINE uint64_t lj_num2u64(lua_Number n) -{ -#ifdef _MSC_VER - if (n >= 9223372036854775808.0) /* They think it's a feature. */ - return (uint64_t)(int64_t)(n - 18446744073709551616.0); - else -#endif - return (uint64_t)n; -} - -static LJ_AINLINE int32_t numberVint(cTValue *o) -{ - if (LJ_LIKELY(tvisint(o))) - return intV(o); - else - return lj_num2int(numV(o)); -} - -static LJ_AINLINE lua_Number numberVnum(cTValue *o) -{ - if (LJ_UNLIKELY(tvisint(o))) - return (lua_Number)intV(o); - else - return numV(o); -} - -/* -- Miscellaneous object handling --------------------------------------- */ - -/* Names and maps for internal and external object tags. */ -LJ_DATA const char *const lj_obj_typename[1+LUA_TCDATA+1]; -LJ_DATA const char *const lj_obj_itypename[~LJ_TNUMX+1]; - -#define lj_typename(o) (lj_obj_itypename[itypemap(o)]) - -/* Compare two objects without calling metamethods. */ -LJ_FUNC int lj_obj_equal(cTValue *o1, cTValue *o2); - -#endif diff --git a/subprojects/luajit/src/lj_opt_dce.c b/subprojects/luajit/src/lj_opt_dce.c deleted file mode 100644 index 2417f3242..000000000 --- a/subprojects/luajit/src/lj_opt_dce.c +++ /dev/null @@ -1,78 +0,0 @@ -/* -** DCE: Dead Code Elimination. Pre-LOOP only -- ASM already performs DCE. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_opt_dce_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_iropt.h" - -/* Some local macros to save typing. Undef'd at the end. */ -#define IR(ref) (&J->cur.ir[(ref)]) - -/* Scan through all snapshots and mark all referenced instructions. */ -static void dce_marksnap(jit_State *J) -{ - SnapNo i, nsnap = J->cur.nsnap; - for (i = 0; i < nsnap; i++) { - SnapShot *snap = &J->cur.snap[i]; - SnapEntry *map = &J->cur.snapmap[snap->mapofs]; - MSize n, nent = snap->nent; - for (n = 0; n < nent; n++) { - IRRef ref = snap_ref(map[n]); - if (ref >= REF_FIRST) - irt_setmark(IR(ref)->t); - } - } -} - -/* Backwards propagate marks. Replace unused instructions with NOPs. */ -static void dce_propagate(jit_State *J) -{ - IRRef1 *pchain[IR__MAX]; - IRRef ins; - uint32_t i; - for (i = 0; i < IR__MAX; i++) pchain[i] = &J->chain[i]; - for (ins = J->cur.nins-1; ins >= REF_FIRST; ins--) { - IRIns *ir = IR(ins); - if (irt_ismarked(ir->t)) { - irt_clearmark(ir->t); - pchain[ir->o] = &ir->prev; - } else if (!ir_sideeff(ir)) { - *pchain[ir->o] = ir->prev; /* Reroute original instruction chain. */ - ir->t.irt = IRT_NIL; - ir->o = IR_NOP; /* Replace instruction with NOP. */ - ir->op1 = ir->op2 = 0; - ir->prev = 0; - continue; - } - if (ir->op1 >= REF_FIRST) irt_setmark(IR(ir->op1)->t); - if (ir->op2 >= REF_FIRST) irt_setmark(IR(ir->op2)->t); - } -} - -/* Dead Code Elimination. -** -** First backpropagate marks for all used instructions. Then replace -** the unused ones with a NOP. Note that compressing the IR to eliminate -** the NOPs does not pay off. -*/ -void lj_opt_dce(jit_State *J) -{ - if ((J->flags & JIT_F_OPT_DCE)) { - dce_marksnap(J); - dce_propagate(J); - memset(J->bpropcache, 0, sizeof(J->bpropcache)); /* Invalidate cache. */ - } -} - -#undef IR - -#endif diff --git a/subprojects/luajit/src/lj_opt_fold.c b/subprojects/luajit/src/lj_opt_fold.c deleted file mode 100644 index 3d0e35a6f..000000000 --- a/subprojects/luajit/src/lj_opt_fold.c +++ /dev/null @@ -1,2304 +0,0 @@ -/* -** FOLD: Constant Folding, Algebraic Simplifications and Reassociation. -** ABCelim: Array Bounds Check Elimination. -** CSE: Common-Subexpression Elimination. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_opt_fold_c -#define LUA_CORE - -#include - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_iropt.h" -#include "lj_trace.h" -#if LJ_HASFFI -#include "lj_ctype.h" -#endif -#include "lj_carith.h" -#include "lj_vm.h" -#include "lj_strscan.h" - -/* Here's a short description how the FOLD engine processes instructions: -** -** The FOLD engine receives a single instruction stored in fins (J->fold.ins). -** The instruction and its operands are used to select matching fold rules. -** These are applied iteratively until a fixed point is reached. -** -** The 8 bit opcode of the instruction itself plus the opcodes of the -** two instructions referenced by its operands form a 24 bit key -** 'ins left right' (unused operands -> 0, literals -> lowest 8 bits). -** -** This key is used for partial matching against the fold rules. The -** left/right operand fields of the key are successively masked with -** the 'any' wildcard, from most specific to least specific: -** -** ins left right -** ins any right -** ins left any -** ins any any -** -** The masked key is used to lookup a matching fold rule in a semi-perfect -** hash table. If a matching rule is found, the related fold function is run. -** Multiple rules can share the same fold function. A fold rule may return -** one of several special values: -** -** - NEXTFOLD means no folding was applied, because an additional test -** inside the fold function failed. Matching continues against less -** specific fold rules. Finally the instruction is passed on to CSE. -** -** - RETRYFOLD means the instruction was modified in-place. Folding is -** retried as if this instruction had just been received. -** -** All other return values are terminal actions -- no further folding is -** applied: -** -** - INTFOLD(i) returns a reference to the integer constant i. -** -** - LEFTFOLD and RIGHTFOLD return the left/right operand reference -** without emitting an instruction. -** -** - CSEFOLD and EMITFOLD pass the instruction directly to CSE or emit -** it without passing through any further optimizations. -** -** - FAILFOLD, DROPFOLD and CONDFOLD only apply to instructions which have -** no result (e.g. guarded assertions): FAILFOLD means the guard would -** always fail, i.e. the current trace is pointless. DROPFOLD means -** the guard is always true and has been eliminated. CONDFOLD is a -** shortcut for FAILFOLD + cond (i.e. drop if true, otherwise fail). -** -** - Any other return value is interpreted as an IRRef or TRef. This -** can be a reference to an existing or a newly created instruction. -** Only the least-significant 16 bits (IRRef1) are used to form a TRef -** which is finally returned to the caller. -** -** The FOLD engine receives instructions both from the trace recorder and -** substituted instructions from LOOP unrolling. This means all types -** of instructions may end up here, even though the recorder bypasses -** FOLD in some cases. Thus all loads, stores and allocations must have -** an any/any rule to avoid being passed on to CSE. -** -** Carefully read the following requirements before adding or modifying -** any fold rules: -** -** Requirement #1: All fold rules must preserve their destination type. -** -** Consistently use INTFOLD() (KINT result) or lj_ir_knum() (KNUM result). -** Never use lj_ir_knumint() which can have either a KINT or KNUM result. -** -** Requirement #2: Fold rules should not create *new* instructions which -** reference operands *across* PHIs. -** -** E.g. a RETRYFOLD with 'fins->op1 = fleft->op1' is invalid if the -** left operand is a PHI. Then fleft->op1 would point across the PHI -** frontier to an invariant instruction. Adding a PHI for this instruction -** would be counterproductive. The solution is to add a barrier which -** prevents folding across PHIs, i.e. 'PHIBARRIER(fleft)' in this case. -** The only exception is for recurrences with high latencies like -** repeated int->num->int conversions. -** -** One could relax this condition a bit if the referenced instruction is -** a PHI, too. But this often leads to worse code due to excessive -** register shuffling. -** -** Note: returning *existing* instructions (e.g. LEFTFOLD) is ok, though. -** Even returning fleft->op1 would be ok, because a new PHI will added, -** if needed. But again, this leads to excessive register shuffling and -** should be avoided. -** -** Requirement #3: The set of all fold rules must be monotonic to guarantee -** termination. -** -** The goal is optimization, so one primarily wants to add strength-reducing -** rules. This means eliminating an instruction or replacing an instruction -** with one or more simpler instructions. Don't add fold rules which point -** into the other direction. -** -** Some rules (like commutativity) do not directly reduce the strength of -** an instruction, but enable other fold rules (e.g. by moving constants -** to the right operand). These rules must be made unidirectional to avoid -** cycles. -** -** Rule of thumb: the trace recorder expands the IR and FOLD shrinks it. -*/ - -/* Some local macros to save typing. Undef'd at the end. */ -#define IR(ref) (&J->cur.ir[(ref)]) -#define fins (&J->fold.ins) -#define fleft (&J->fold.left) -#define fright (&J->fold.right) -#define knumleft (ir_knum(fleft)->n) -#define knumright (ir_knum(fright)->n) - -/* Pass IR on to next optimization in chain (FOLD). */ -#define emitir(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J)) - -/* Fold function type. Fastcall on x86 significantly reduces their size. */ -typedef IRRef (LJ_FASTCALL *FoldFunc)(jit_State *J); - -/* Macros for the fold specs, so buildvm can recognize them. */ -#define LJFOLD(x) -#define LJFOLDX(x) -#define LJFOLDF(name) static TRef LJ_FASTCALL fold_##name(jit_State *J) -/* Note: They must be at the start of a line or buildvm ignores them! */ - -/* Barrier to prevent using operands across PHIs. */ -#define PHIBARRIER(ir) if (irt_isphi((ir)->t)) return NEXTFOLD - -/* Barrier to prevent folding across a GC step. -** GC steps can only happen at the head of a trace and at LOOP. -** And the GC is only driven forward if there is at least one allocation. -*/ -#define gcstep_barrier(J, ref) \ - ((ref) < J->chain[IR_LOOP] && \ - (J->chain[IR_SNEW] || J->chain[IR_XSNEW] || \ - J->chain[IR_TNEW] || J->chain[IR_TDUP] || \ - J->chain[IR_CNEW] || J->chain[IR_CNEWI] || J->chain[IR_TOSTR])) - -/* -- Constant folding for FP numbers ------------------------------------- */ - -LJFOLD(ADD KNUM KNUM) -LJFOLD(SUB KNUM KNUM) -LJFOLD(MUL KNUM KNUM) -LJFOLD(DIV KNUM KNUM) -LJFOLD(NEG KNUM KNUM) -LJFOLD(ABS KNUM KNUM) -LJFOLD(ATAN2 KNUM KNUM) -LJFOLD(LDEXP KNUM KNUM) -LJFOLD(MIN KNUM KNUM) -LJFOLD(MAX KNUM KNUM) -LJFOLDF(kfold_numarith) -{ - lua_Number a = knumleft; - lua_Number b = knumright; - lua_Number y = lj_vm_foldarith(a, b, fins->o - IR_ADD); - return lj_ir_knum(J, y); -} - -LJFOLD(LDEXP KNUM KINT) -LJFOLDF(kfold_ldexp) -{ -#if LJ_TARGET_X86ORX64 - UNUSED(J); - return NEXTFOLD; -#else - return lj_ir_knum(J, ldexp(knumleft, fright->i)); -#endif -} - -LJFOLD(FPMATH KNUM any) -LJFOLDF(kfold_fpmath) -{ - lua_Number a = knumleft; - lua_Number y = lj_vm_foldfpm(a, fins->op2); - return lj_ir_knum(J, y); -} - -LJFOLD(POW KNUM KINT) -LJFOLDF(kfold_numpow) -{ - lua_Number a = knumleft; - lua_Number b = (lua_Number)fright->i; - lua_Number y = lj_vm_foldarith(a, b, IR_POW - IR_ADD); - return lj_ir_knum(J, y); -} - -/* Must not use kfold_kref for numbers (could be NaN). */ -LJFOLD(EQ KNUM KNUM) -LJFOLD(NE KNUM KNUM) -LJFOLD(LT KNUM KNUM) -LJFOLD(GE KNUM KNUM) -LJFOLD(LE KNUM KNUM) -LJFOLD(GT KNUM KNUM) -LJFOLD(ULT KNUM KNUM) -LJFOLD(UGE KNUM KNUM) -LJFOLD(ULE KNUM KNUM) -LJFOLD(UGT KNUM KNUM) -LJFOLDF(kfold_numcomp) -{ - return CONDFOLD(lj_ir_numcmp(knumleft, knumright, (IROp)fins->o)); -} - -/* -- Constant folding for 32 bit integers -------------------------------- */ - -static int32_t kfold_intop(int32_t k1, int32_t k2, IROp op) -{ - switch (op) { - case IR_ADD: k1 += k2; break; - case IR_SUB: k1 -= k2; break; - case IR_MUL: k1 *= k2; break; - case IR_MOD: k1 = lj_vm_modi(k1, k2); break; - case IR_NEG: k1 = -k1; break; - case IR_BAND: k1 &= k2; break; - case IR_BOR: k1 |= k2; break; - case IR_BXOR: k1 ^= k2; break; - case IR_BSHL: k1 <<= (k2 & 31); break; - case IR_BSHR: k1 = (int32_t)((uint32_t)k1 >> (k2 & 31)); break; - case IR_BSAR: k1 >>= (k2 & 31); break; - case IR_BROL: k1 = (int32_t)lj_rol((uint32_t)k1, (k2 & 31)); break; - case IR_BROR: k1 = (int32_t)lj_ror((uint32_t)k1, (k2 & 31)); break; - case IR_MIN: k1 = k1 < k2 ? k1 : k2; break; - case IR_MAX: k1 = k1 > k2 ? k1 : k2; break; - default: lua_assert(0); break; - } - return k1; -} - -LJFOLD(ADD KINT KINT) -LJFOLD(SUB KINT KINT) -LJFOLD(MUL KINT KINT) -LJFOLD(MOD KINT KINT) -LJFOLD(NEG KINT KINT) -LJFOLD(BAND KINT KINT) -LJFOLD(BOR KINT KINT) -LJFOLD(BXOR KINT KINT) -LJFOLD(BSHL KINT KINT) -LJFOLD(BSHR KINT KINT) -LJFOLD(BSAR KINT KINT) -LJFOLD(BROL KINT KINT) -LJFOLD(BROR KINT KINT) -LJFOLD(MIN KINT KINT) -LJFOLD(MAX KINT KINT) -LJFOLDF(kfold_intarith) -{ - return INTFOLD(kfold_intop(fleft->i, fright->i, (IROp)fins->o)); -} - -LJFOLD(ADDOV KINT KINT) -LJFOLD(SUBOV KINT KINT) -LJFOLD(MULOV KINT KINT) -LJFOLDF(kfold_intovarith) -{ - lua_Number n = lj_vm_foldarith((lua_Number)fleft->i, (lua_Number)fright->i, - fins->o - IR_ADDOV); - int32_t k = lj_num2int(n); - if (n != (lua_Number)k) - return FAILFOLD; - return INTFOLD(k); -} - -LJFOLD(BNOT KINT) -LJFOLDF(kfold_bnot) -{ - return INTFOLD(~fleft->i); -} - -LJFOLD(BSWAP KINT) -LJFOLDF(kfold_bswap) -{ - return INTFOLD((int32_t)lj_bswap((uint32_t)fleft->i)); -} - -LJFOLD(LT KINT KINT) -LJFOLD(GE KINT KINT) -LJFOLD(LE KINT KINT) -LJFOLD(GT KINT KINT) -LJFOLD(ULT KINT KINT) -LJFOLD(UGE KINT KINT) -LJFOLD(ULE KINT KINT) -LJFOLD(UGT KINT KINT) -LJFOLD(ABC KINT KINT) -LJFOLDF(kfold_intcomp) -{ - int32_t a = fleft->i, b = fright->i; - switch ((IROp)fins->o) { - case IR_LT: return CONDFOLD(a < b); - case IR_GE: return CONDFOLD(a >= b); - case IR_LE: return CONDFOLD(a <= b); - case IR_GT: return CONDFOLD(a > b); - case IR_ULT: return CONDFOLD((uint32_t)a < (uint32_t)b); - case IR_UGE: return CONDFOLD((uint32_t)a >= (uint32_t)b); - case IR_ULE: return CONDFOLD((uint32_t)a <= (uint32_t)b); - case IR_ABC: - case IR_UGT: return CONDFOLD((uint32_t)a > (uint32_t)b); - default: lua_assert(0); return FAILFOLD; - } -} - -LJFOLD(UGE any KINT) -LJFOLDF(kfold_intcomp0) -{ - if (fright->i == 0) - return DROPFOLD; - return NEXTFOLD; -} - -/* -- Constant folding for 64 bit integers -------------------------------- */ - -static uint64_t kfold_int64arith(uint64_t k1, uint64_t k2, IROp op) -{ - switch (op) { -#if LJ_64 || LJ_HASFFI - case IR_ADD: k1 += k2; break; - case IR_SUB: k1 -= k2; break; -#endif -#if LJ_HASFFI - case IR_MUL: k1 *= k2; break; - case IR_BAND: k1 &= k2; break; - case IR_BOR: k1 |= k2; break; - case IR_BXOR: k1 ^= k2; break; -#endif - default: UNUSED(k2); lua_assert(0); break; - } - return k1; -} - -LJFOLD(ADD KINT64 KINT64) -LJFOLD(SUB KINT64 KINT64) -LJFOLD(MUL KINT64 KINT64) -LJFOLD(BAND KINT64 KINT64) -LJFOLD(BOR KINT64 KINT64) -LJFOLD(BXOR KINT64 KINT64) -LJFOLDF(kfold_int64arith) -{ - return INT64FOLD(kfold_int64arith(ir_k64(fleft)->u64, - ir_k64(fright)->u64, (IROp)fins->o)); -} - -LJFOLD(DIV KINT64 KINT64) -LJFOLD(MOD KINT64 KINT64) -LJFOLD(POW KINT64 KINT64) -LJFOLDF(kfold_int64arith2) -{ -#if LJ_HASFFI - uint64_t k1 = ir_k64(fleft)->u64, k2 = ir_k64(fright)->u64; - if (irt_isi64(fins->t)) { - k1 = fins->o == IR_DIV ? lj_carith_divi64((int64_t)k1, (int64_t)k2) : - fins->o == IR_MOD ? lj_carith_modi64((int64_t)k1, (int64_t)k2) : - lj_carith_powi64((int64_t)k1, (int64_t)k2); - } else { - k1 = fins->o == IR_DIV ? lj_carith_divu64(k1, k2) : - fins->o == IR_MOD ? lj_carith_modu64(k1, k2) : - lj_carith_powu64(k1, k2); - } - return INT64FOLD(k1); -#else - UNUSED(J); lua_assert(0); return FAILFOLD; -#endif -} - -LJFOLD(BSHL KINT64 KINT) -LJFOLD(BSHR KINT64 KINT) -LJFOLD(BSAR KINT64 KINT) -LJFOLD(BROL KINT64 KINT) -LJFOLD(BROR KINT64 KINT) -LJFOLDF(kfold_int64shift) -{ -#if LJ_HASFFI || LJ_64 - uint64_t k = ir_k64(fleft)->u64; - int32_t sh = (fright->i & 63); - switch ((IROp)fins->o) { - case IR_BSHL: k <<= sh; break; -#if LJ_HASFFI - case IR_BSHR: k >>= sh; break; - case IR_BSAR: k = (uint64_t)((int64_t)k >> sh); break; - case IR_BROL: k = lj_rol(k, sh); break; - case IR_BROR: k = lj_ror(k, sh); break; -#endif - default: lua_assert(0); break; - } - return INT64FOLD(k); -#else - UNUSED(J); lua_assert(0); return FAILFOLD; -#endif -} - -LJFOLD(BNOT KINT64) -LJFOLDF(kfold_bnot64) -{ -#if LJ_HASFFI - return INT64FOLD(~ir_k64(fleft)->u64); -#else - UNUSED(J); lua_assert(0); return FAILFOLD; -#endif -} - -LJFOLD(BSWAP KINT64) -LJFOLDF(kfold_bswap64) -{ -#if LJ_HASFFI - return INT64FOLD(lj_bswap64(ir_k64(fleft)->u64)); -#else - UNUSED(J); lua_assert(0); return FAILFOLD; -#endif -} - -LJFOLD(LT KINT64 KINT64) -LJFOLD(GE KINT64 KINT64) -LJFOLD(LE KINT64 KINT64) -LJFOLD(GT KINT64 KINT64) -LJFOLD(ULT KINT64 KINT64) -LJFOLD(UGE KINT64 KINT64) -LJFOLD(ULE KINT64 KINT64) -LJFOLD(UGT KINT64 KINT64) -LJFOLDF(kfold_int64comp) -{ -#if LJ_HASFFI - uint64_t a = ir_k64(fleft)->u64, b = ir_k64(fright)->u64; - switch ((IROp)fins->o) { - case IR_LT: return CONDFOLD((int64_t)a < (int64_t)b); - case IR_GE: return CONDFOLD((int64_t)a >= (int64_t)b); - case IR_LE: return CONDFOLD((int64_t)a <= (int64_t)b); - case IR_GT: return CONDFOLD((int64_t)a > (int64_t)b); - case IR_ULT: return CONDFOLD(a < b); - case IR_UGE: return CONDFOLD(a >= b); - case IR_ULE: return CONDFOLD(a <= b); - case IR_UGT: return CONDFOLD(a > b); - default: lua_assert(0); return FAILFOLD; - } -#else - UNUSED(J); lua_assert(0); return FAILFOLD; -#endif -} - -LJFOLD(UGE any KINT64) -LJFOLDF(kfold_int64comp0) -{ -#if LJ_HASFFI - if (ir_k64(fright)->u64 == 0) - return DROPFOLD; - return NEXTFOLD; -#else - UNUSED(J); lua_assert(0); return FAILFOLD; -#endif -} - -/* -- Constant folding for strings ---------------------------------------- */ - -LJFOLD(SNEW KKPTR KINT) -LJFOLDF(kfold_snew_kptr) -{ - GCstr *s = lj_str_new(J->L, (const char *)ir_kptr(fleft), (size_t)fright->i); - return lj_ir_kstr(J, s); -} - -LJFOLD(SNEW any KINT) -LJFOLDF(kfold_snew_empty) -{ - if (fright->i == 0) - return lj_ir_kstr(J, &J2G(J)->strempty); - return NEXTFOLD; -} - -LJFOLD(STRREF KGC KINT) -LJFOLDF(kfold_strref) -{ - GCstr *str = ir_kstr(fleft); - lua_assert((MSize)fright->i <= str->len); - return lj_ir_kkptr(J, (char *)strdata(str) + fright->i); -} - -LJFOLD(STRREF SNEW any) -LJFOLDF(kfold_strref_snew) -{ - PHIBARRIER(fleft); - if (irref_isk(fins->op2) && fright->i == 0) { - return fleft->op1; /* strref(snew(ptr, len), 0) ==> ptr */ - } else { - /* Reassociate: strref(snew(strref(str, a), len), b) ==> strref(str, a+b) */ - IRIns *ir = IR(fleft->op1); - if (ir->o == IR_STRREF) { - IRRef1 str = ir->op1; /* IRIns * is not valid across emitir. */ - PHIBARRIER(ir); - fins->op2 = emitir(IRTI(IR_ADD), ir->op2, fins->op2); /* Clobbers fins! */ - fins->op1 = str; - fins->ot = IRT(IR_STRREF, IRT_P32); - return RETRYFOLD; - } - } - return NEXTFOLD; -} - -LJFOLD(CALLN CARG IRCALL_lj_str_cmp) -LJFOLDF(kfold_strcmp) -{ - if (irref_isk(fleft->op1) && irref_isk(fleft->op2)) { - GCstr *a = ir_kstr(IR(fleft->op1)); - GCstr *b = ir_kstr(IR(fleft->op2)); - return INTFOLD(lj_str_cmp(a, b)); - } - return NEXTFOLD; -} - -/* -- Constant folding of pointer arithmetic ------------------------------ */ - -LJFOLD(ADD KGC KINT) -LJFOLD(ADD KGC KINT64) -LJFOLDF(kfold_add_kgc) -{ - GCobj *o = ir_kgc(fleft); -#if LJ_64 - ptrdiff_t ofs = (ptrdiff_t)ir_kint64(fright)->u64; -#else - ptrdiff_t ofs = fright->i; -#endif -#if LJ_HASFFI - if (irt_iscdata(fleft->t)) { - CType *ct = ctype_raw(ctype_ctsG(J2G(J)), gco2cd(o)->ctypeid); - if (ctype_isnum(ct->info) || ctype_isenum(ct->info) || - ctype_isptr(ct->info) || ctype_isfunc(ct->info) || - ctype_iscomplex(ct->info) || ctype_isvector(ct->info)) - return lj_ir_kkptr(J, (char *)o + ofs); - } -#endif - return lj_ir_kptr(J, (char *)o + ofs); -} - -LJFOLD(ADD KPTR KINT) -LJFOLD(ADD KPTR KINT64) -LJFOLD(ADD KKPTR KINT) -LJFOLD(ADD KKPTR KINT64) -LJFOLDF(kfold_add_kptr) -{ - void *p = ir_kptr(fleft); -#if LJ_64 - ptrdiff_t ofs = (ptrdiff_t)ir_kint64(fright)->u64; -#else - ptrdiff_t ofs = fright->i; -#endif - return lj_ir_kptr_(J, fleft->o, (char *)p + ofs); -} - -LJFOLD(ADD any KGC) -LJFOLD(ADD any KPTR) -LJFOLD(ADD any KKPTR) -LJFOLDF(kfold_add_kright) -{ - if (fleft->o == IR_KINT || fleft->o == IR_KINT64) { - IRRef1 tmp = fins->op1; fins->op1 = fins->op2; fins->op2 = tmp; - return RETRYFOLD; - } - return NEXTFOLD; -} - -/* -- Constant folding of conversions ------------------------------------- */ - -LJFOLD(TOBIT KNUM KNUM) -LJFOLDF(kfold_tobit) -{ - return INTFOLD(lj_num2bit(knumleft)); -} - -LJFOLD(CONV KINT IRCONV_NUM_INT) -LJFOLDF(kfold_conv_kint_num) -{ - return lj_ir_knum(J, (lua_Number)fleft->i); -} - -LJFOLD(CONV KINT IRCONV_NUM_U32) -LJFOLDF(kfold_conv_kintu32_num) -{ - return lj_ir_knum(J, (lua_Number)(uint32_t)fleft->i); -} - -LJFOLD(CONV KINT IRCONV_INT_I8) -LJFOLD(CONV KINT IRCONV_INT_U8) -LJFOLD(CONV KINT IRCONV_INT_I16) -LJFOLD(CONV KINT IRCONV_INT_U16) -LJFOLDF(kfold_conv_kint_ext) -{ - int32_t k = fleft->i; - if ((fins->op2 & IRCONV_SRCMASK) == IRT_I8) k = (int8_t)k; - else if ((fins->op2 & IRCONV_SRCMASK) == IRT_U8) k = (uint8_t)k; - else if ((fins->op2 & IRCONV_SRCMASK) == IRT_I16) k = (int16_t)k; - else k = (uint16_t)k; - return INTFOLD(k); -} - -LJFOLD(CONV KINT IRCONV_I64_INT) -LJFOLD(CONV KINT IRCONV_U64_INT) -LJFOLD(CONV KINT IRCONV_I64_U32) -LJFOLD(CONV KINT IRCONV_U64_U32) -LJFOLDF(kfold_conv_kint_i64) -{ - if ((fins->op2 & IRCONV_SEXT)) - return INT64FOLD((uint64_t)(int64_t)fleft->i); - else - return INT64FOLD((uint64_t)(int64_t)(uint32_t)fleft->i); -} - -LJFOLD(CONV KINT64 IRCONV_NUM_I64) -LJFOLDF(kfold_conv_kint64_num_i64) -{ - return lj_ir_knum(J, (lua_Number)(int64_t)ir_kint64(fleft)->u64); -} - -LJFOLD(CONV KINT64 IRCONV_NUM_U64) -LJFOLDF(kfold_conv_kint64_num_u64) -{ - return lj_ir_knum(J, (lua_Number)ir_kint64(fleft)->u64); -} - -LJFOLD(CONV KINT64 IRCONV_INT_I64) -LJFOLD(CONV KINT64 IRCONV_U32_I64) -LJFOLDF(kfold_conv_kint64_int_i64) -{ - return INTFOLD((int32_t)ir_kint64(fleft)->u64); -} - -LJFOLD(CONV KNUM IRCONV_INT_NUM) -LJFOLDF(kfold_conv_knum_int_num) -{ - lua_Number n = knumleft; - if (!(fins->op2 & IRCONV_TRUNC)) { - int32_t k = lj_num2int(n); - if (irt_isguard(fins->t) && n != (lua_Number)k) { - /* We're about to create a guard which always fails, like CONV +1.5. - ** Some pathological loops cause this during LICM, e.g.: - ** local x,k,t = 0,1.5,{1,[1.5]=2} - ** for i=1,200 do x = x+ t[k]; k = k == 1 and 1.5 or 1 end - ** assert(x == 300) - */ - return FAILFOLD; - } - return INTFOLD(k); - } else { - return INTFOLD((int32_t)n); - } -} - -LJFOLD(CONV KNUM IRCONV_U32_NUM) -LJFOLDF(kfold_conv_knum_u32_num) -{ - lua_assert((fins->op2 & IRCONV_TRUNC)); -#ifdef _MSC_VER - { /* Workaround for MSVC bug. */ - volatile uint32_t u = (uint32_t)knumleft; - return INTFOLD((int32_t)u); - } -#else - return INTFOLD((int32_t)(uint32_t)knumleft); -#endif -} - -LJFOLD(CONV KNUM IRCONV_I64_NUM) -LJFOLDF(kfold_conv_knum_i64_num) -{ - lua_assert((fins->op2 & IRCONV_TRUNC)); - return INT64FOLD((uint64_t)(int64_t)knumleft); -} - -LJFOLD(CONV KNUM IRCONV_U64_NUM) -LJFOLDF(kfold_conv_knum_u64_num) -{ - lua_assert((fins->op2 & IRCONV_TRUNC)); - return INT64FOLD(lj_num2u64(knumleft)); -} - -LJFOLD(TOSTR KNUM) -LJFOLDF(kfold_tostr_knum) -{ - return lj_ir_kstr(J, lj_str_fromnum(J->L, &knumleft)); -} - -LJFOLD(TOSTR KINT) -LJFOLDF(kfold_tostr_kint) -{ - return lj_ir_kstr(J, lj_str_fromint(J->L, fleft->i)); -} - -LJFOLD(STRTO KGC) -LJFOLDF(kfold_strto) -{ - TValue n; - if (lj_strscan_num(ir_kstr(fleft), &n)) - return lj_ir_knum(J, numV(&n)); - return FAILFOLD; -} - -/* -- Constant folding of equality checks --------------------------------- */ - -/* Don't constant-fold away FLOAD checks against KNULL. */ -LJFOLD(EQ FLOAD KNULL) -LJFOLD(NE FLOAD KNULL) -LJFOLDX(lj_opt_cse) - -/* But fold all other KNULL compares, since only KNULL is equal to KNULL. */ -LJFOLD(EQ any KNULL) -LJFOLD(NE any KNULL) -LJFOLD(EQ KNULL any) -LJFOLD(NE KNULL any) -LJFOLD(EQ KINT KINT) /* Constants are unique, so same refs <==> same value. */ -LJFOLD(NE KINT KINT) -LJFOLD(EQ KINT64 KINT64) -LJFOLD(NE KINT64 KINT64) -LJFOLD(EQ KGC KGC) -LJFOLD(NE KGC KGC) -LJFOLDF(kfold_kref) -{ - return CONDFOLD((fins->op1 == fins->op2) ^ (fins->o == IR_NE)); -} - -/* -- Algebraic shortcuts ------------------------------------------------- */ - -LJFOLD(FPMATH FPMATH IRFPM_FLOOR) -LJFOLD(FPMATH FPMATH IRFPM_CEIL) -LJFOLD(FPMATH FPMATH IRFPM_TRUNC) -LJFOLDF(shortcut_round) -{ - IRFPMathOp op = (IRFPMathOp)fleft->op2; - if (op == IRFPM_FLOOR || op == IRFPM_CEIL || op == IRFPM_TRUNC) - return LEFTFOLD; /* round(round_left(x)) = round_left(x) */ - return NEXTFOLD; -} - -LJFOLD(ABS ABS KNUM) -LJFOLDF(shortcut_left) -{ - return LEFTFOLD; /* f(g(x)) ==> g(x) */ -} - -LJFOLD(ABS NEG KNUM) -LJFOLDF(shortcut_dropleft) -{ - PHIBARRIER(fleft); - fins->op1 = fleft->op1; /* abs(neg(x)) ==> abs(x) */ - return RETRYFOLD; -} - -/* Note: no safe shortcuts with STRTO and TOSTR ("1e2" ==> +100 ==> "100"). */ -LJFOLD(NEG NEG any) -LJFOLD(BNOT BNOT) -LJFOLD(BSWAP BSWAP) -LJFOLDF(shortcut_leftleft) -{ - PHIBARRIER(fleft); /* See above. Fold would be ok, but not beneficial. */ - return fleft->op1; /* f(g(x)) ==> x */ -} - -/* -- FP algebraic simplifications ---------------------------------------- */ - -/* FP arithmetic is tricky -- there's not much to simplify. -** Please note the following common pitfalls before sending "improvements": -** x+0 ==> x is INVALID for x=-0 -** 0-x ==> -x is INVALID for x=+0 -** x*0 ==> 0 is INVALID for x=-0, x=+-Inf or x=NaN -*/ - -LJFOLD(ADD NEG any) -LJFOLDF(simplify_numadd_negx) -{ - PHIBARRIER(fleft); - fins->o = IR_SUB; /* (-a) + b ==> b - a */ - fins->op1 = fins->op2; - fins->op2 = fleft->op1; - return RETRYFOLD; -} - -LJFOLD(ADD any NEG) -LJFOLDF(simplify_numadd_xneg) -{ - PHIBARRIER(fright); - fins->o = IR_SUB; /* a + (-b) ==> a - b */ - fins->op2 = fright->op1; - return RETRYFOLD; -} - -LJFOLD(SUB any KNUM) -LJFOLDF(simplify_numsub_k) -{ - lua_Number n = knumright; - if (n == 0.0) /* x - (+-0) ==> x */ - return LEFTFOLD; - return NEXTFOLD; -} - -LJFOLD(SUB NEG KNUM) -LJFOLDF(simplify_numsub_negk) -{ - PHIBARRIER(fleft); - fins->op2 = fleft->op1; /* (-x) - k ==> (-k) - x */ - fins->op1 = (IRRef1)lj_ir_knum(J, -knumright); - return RETRYFOLD; -} - -LJFOLD(SUB any NEG) -LJFOLDF(simplify_numsub_xneg) -{ - PHIBARRIER(fright); - fins->o = IR_ADD; /* a - (-b) ==> a + b */ - fins->op2 = fright->op1; - return RETRYFOLD; -} - -LJFOLD(MUL any KNUM) -LJFOLD(DIV any KNUM) -LJFOLDF(simplify_nummuldiv_k) -{ - lua_Number n = knumright; - if (n == 1.0) { /* x o 1 ==> x */ - return LEFTFOLD; - } else if (n == -1.0) { /* x o -1 ==> -x */ - fins->o = IR_NEG; - fins->op2 = (IRRef1)lj_ir_knum_neg(J); - return RETRYFOLD; - } else if (fins->o == IR_MUL && n == 2.0) { /* x * 2 ==> x + x */ - fins->o = IR_ADD; - fins->op2 = fins->op1; - return RETRYFOLD; - } else if (fins->o == IR_DIV) { /* x / 2^k ==> x * 2^-k */ - uint64_t u = ir_knum(fright)->u64; - uint32_t ex = ((uint32_t)(u >> 52) & 0x7ff); - if ((u & U64x(000fffff,ffffffff)) == 0 && ex - 1 < 0x7fd) { - u = (u & ((uint64_t)1 << 63)) | ((uint64_t)(0x7fe - ex) << 52); - fins->o = IR_MUL; /* Multiply by exact reciprocal. */ - fins->op2 = lj_ir_knum_u64(J, u); - return RETRYFOLD; - } - } - return NEXTFOLD; -} - -LJFOLD(MUL NEG KNUM) -LJFOLD(DIV NEG KNUM) -LJFOLDF(simplify_nummuldiv_negk) -{ - PHIBARRIER(fleft); - fins->op1 = fleft->op1; /* (-a) o k ==> a o (-k) */ - fins->op2 = (IRRef1)lj_ir_knum(J, -knumright); - return RETRYFOLD; -} - -LJFOLD(MUL NEG NEG) -LJFOLD(DIV NEG NEG) -LJFOLDF(simplify_nummuldiv_negneg) -{ - PHIBARRIER(fleft); - PHIBARRIER(fright); - fins->op1 = fleft->op1; /* (-a) o (-b) ==> a o b */ - fins->op2 = fright->op1; - return RETRYFOLD; -} - -LJFOLD(POW any KINT) -LJFOLDF(simplify_numpow_xk) -{ - int32_t k = fright->i; - TRef ref = fins->op1; - if (k == 0) /* x ^ 0 ==> 1 */ - return lj_ir_knum_one(J); /* Result must be a number, not an int. */ - if (k == 1) /* x ^ 1 ==> x */ - return LEFTFOLD; - if ((uint32_t)(k+65536) > 2*65536u) /* Limit code explosion. */ - return NEXTFOLD; - if (k < 0) { /* x ^ (-k) ==> (1/x) ^ k. */ - ref = emitir(IRTN(IR_DIV), lj_ir_knum_one(J), ref); - k = -k; - } - /* Unroll x^k for 1 <= k <= 65536. */ - for (; (k & 1) == 0; k >>= 1) /* Handle leading zeros. */ - ref = emitir(IRTN(IR_MUL), ref, ref); - if ((k >>= 1) != 0) { /* Handle trailing bits. */ - TRef tmp = emitir(IRTN(IR_MUL), ref, ref); - for (; k != 1; k >>= 1) { - if (k & 1) - ref = emitir(IRTN(IR_MUL), ref, tmp); - tmp = emitir(IRTN(IR_MUL), tmp, tmp); - } - ref = emitir(IRTN(IR_MUL), ref, tmp); - } - return ref; -} - -LJFOLD(POW KNUM any) -LJFOLDF(simplify_numpow_kx) -{ - lua_Number n = knumleft; - if (n == 2.0) { /* 2.0 ^ i ==> ldexp(1.0, tonum(i)) */ - fins->o = IR_CONV; -#if LJ_TARGET_X86ORX64 - fins->op1 = fins->op2; - fins->op2 = IRCONV_NUM_INT; - fins->op2 = (IRRef1)lj_opt_fold(J); -#endif - fins->op1 = (IRRef1)lj_ir_knum_one(J); - fins->o = IR_LDEXP; - return RETRYFOLD; - } - return NEXTFOLD; -} - -/* -- Simplify conversions ------------------------------------------------ */ - -LJFOLD(CONV CONV IRCONV_NUM_INT) /* _NUM */ -LJFOLDF(shortcut_conv_num_int) -{ - PHIBARRIER(fleft); - /* Only safe with a guarded conversion to int. */ - if ((fleft->op2 & IRCONV_SRCMASK) == IRT_NUM && irt_isguard(fleft->t)) - return fleft->op1; /* f(g(x)) ==> x */ - return NEXTFOLD; -} - -LJFOLD(CONV CONV IRCONV_INT_NUM) /* _INT */ -LJFOLD(CONV CONV IRCONV_U32_NUM) /* _U32*/ -LJFOLDF(simplify_conv_int_num) -{ - /* Fold even across PHI to avoid expensive num->int conversions in loop. */ - if ((fleft->op2 & IRCONV_SRCMASK) == - ((fins->op2 & IRCONV_DSTMASK) >> IRCONV_DSH)) - return fleft->op1; - return NEXTFOLD; -} - -LJFOLD(CONV CONV IRCONV_I64_NUM) /* _INT or _U32 */ -LJFOLD(CONV CONV IRCONV_U64_NUM) /* _INT or _U32 */ -LJFOLDF(simplify_conv_i64_num) -{ - PHIBARRIER(fleft); - if ((fleft->op2 & IRCONV_SRCMASK) == IRT_INT) { - /* Reduce to a sign-extension. */ - fins->op1 = fleft->op1; - fins->op2 = ((IRT_I64<<5)|IRT_INT|IRCONV_SEXT); - return RETRYFOLD; - } else if ((fleft->op2 & IRCONV_SRCMASK) == IRT_U32) { -#if LJ_TARGET_X64 - return fleft->op1; -#else - /* Reduce to a zero-extension. */ - fins->op1 = fleft->op1; - fins->op2 = (IRT_I64<<5)|IRT_U32; - return RETRYFOLD; -#endif - } - return NEXTFOLD; -} - -LJFOLD(CONV CONV IRCONV_INT_I64) /* _INT or _U32 */ -LJFOLD(CONV CONV IRCONV_INT_U64) /* _INT or _U32 */ -LJFOLD(CONV CONV IRCONV_U32_I64) /* _INT or _U32 */ -LJFOLD(CONV CONV IRCONV_U32_U64) /* _INT or _U32 */ -LJFOLDF(simplify_conv_int_i64) -{ - int src; - PHIBARRIER(fleft); - src = (fleft->op2 & IRCONV_SRCMASK); - if (src == IRT_INT || src == IRT_U32) { - if (src == ((fins->op2 & IRCONV_DSTMASK) >> IRCONV_DSH)) { - return fleft->op1; - } else { - fins->op2 = ((fins->op2 & IRCONV_DSTMASK) | src); - fins->op1 = fleft->op1; - return RETRYFOLD; - } - } - return NEXTFOLD; -} - -LJFOLD(CONV CONV IRCONV_FLOAT_NUM) /* _FLOAT */ -LJFOLDF(simplify_conv_flt_num) -{ - PHIBARRIER(fleft); - if ((fleft->op2 & IRCONV_SRCMASK) == IRT_FLOAT) - return fleft->op1; - return NEXTFOLD; -} - -/* Shortcut TOBIT + IRT_NUM <- IRT_INT/IRT_U32 conversion. */ -LJFOLD(TOBIT CONV KNUM) -LJFOLDF(simplify_tobit_conv) -{ - /* Fold even across PHI to avoid expensive num->int conversions in loop. */ - if ((fleft->op2 & IRCONV_SRCMASK) == IRT_INT) { - lua_assert(irt_isnum(fleft->t)); - return fleft->op1; - } else if ((fleft->op2 & IRCONV_SRCMASK) == IRT_U32) { - lua_assert(irt_isnum(fleft->t)); - fins->o = IR_CONV; - fins->op1 = fleft->op1; - fins->op2 = (IRT_INT<<5)|IRT_U32; - return RETRYFOLD; - } - return NEXTFOLD; -} - -/* Shortcut floor/ceil/round + IRT_NUM <- IRT_INT/IRT_U32 conversion. */ -LJFOLD(FPMATH CONV IRFPM_FLOOR) -LJFOLD(FPMATH CONV IRFPM_CEIL) -LJFOLD(FPMATH CONV IRFPM_TRUNC) -LJFOLDF(simplify_floor_conv) -{ - if ((fleft->op2 & IRCONV_SRCMASK) == IRT_INT || - (fleft->op2 & IRCONV_SRCMASK) == IRT_U32) - return LEFTFOLD; - return NEXTFOLD; -} - -/* Strength reduction of widening. */ -LJFOLD(CONV any IRCONV_I64_INT) -LJFOLD(CONV any IRCONV_U64_INT) -LJFOLDF(simplify_conv_sext) -{ - IRRef ref = fins->op1; - int64_t ofs = 0; - if (!(fins->op2 & IRCONV_SEXT)) - return NEXTFOLD; - PHIBARRIER(fleft); - if (fleft->o == IR_XLOAD && (irt_isu8(fleft->t) || irt_isu16(fleft->t))) - goto ok_reduce; - if (fleft->o == IR_ADD && irref_isk(fleft->op2)) { - ofs = (int64_t)IR(fleft->op2)->i; - ref = fleft->op1; - } - /* Use scalar evolution analysis results to strength-reduce sign-extension. */ - if (ref == J->scev.idx) { - IRRef lo = J->scev.dir ? J->scev.start : J->scev.stop; - lua_assert(irt_isint(J->scev.t)); - if (lo && IR(lo)->i + ofs >= 0) { - ok_reduce: -#if LJ_TARGET_X64 - /* Eliminate widening. All 32 bit ops do an implicit zero-extension. */ - return LEFTFOLD; -#else - /* Reduce to a (cheaper) zero-extension. */ - fins->op2 &= ~IRCONV_SEXT; - return RETRYFOLD; -#endif - } - } - return NEXTFOLD; -} - -/* Strength reduction of narrowing. */ -LJFOLD(CONV ADD IRCONV_INT_I64) -LJFOLD(CONV SUB IRCONV_INT_I64) -LJFOLD(CONV MUL IRCONV_INT_I64) -LJFOLD(CONV ADD IRCONV_INT_U64) -LJFOLD(CONV SUB IRCONV_INT_U64) -LJFOLD(CONV MUL IRCONV_INT_U64) -LJFOLD(CONV ADD IRCONV_U32_I64) -LJFOLD(CONV SUB IRCONV_U32_I64) -LJFOLD(CONV MUL IRCONV_U32_I64) -LJFOLD(CONV ADD IRCONV_U32_U64) -LJFOLD(CONV SUB IRCONV_U32_U64) -LJFOLD(CONV MUL IRCONV_U32_U64) -LJFOLDF(simplify_conv_narrow) -{ - IROp op = (IROp)fleft->o; - IRType t = irt_type(fins->t); - IRRef op1 = fleft->op1, op2 = fleft->op2, mode = fins->op2; - PHIBARRIER(fleft); - op1 = emitir(IRTI(IR_CONV), op1, mode); - op2 = emitir(IRTI(IR_CONV), op2, mode); - fins->ot = IRT(op, t); - fins->op1 = op1; - fins->op2 = op2; - return RETRYFOLD; -} - -/* Special CSE rule for CONV. */ -LJFOLD(CONV any any) -LJFOLDF(cse_conv) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_CSE)) { - IRRef op1 = fins->op1, op2 = (fins->op2 & IRCONV_MODEMASK); - uint8_t guard = irt_isguard(fins->t); - IRRef ref = J->chain[IR_CONV]; - while (ref > op1) { - IRIns *ir = IR(ref); - /* Commoning with stronger checks is ok. */ - if (ir->op1 == op1 && (ir->op2 & IRCONV_MODEMASK) == op2 && - irt_isguard(ir->t) >= guard) - return ref; - ref = ir->prev; - } - } - return EMITFOLD; /* No fallthrough to regular CSE. */ -} - -/* FP conversion narrowing. */ -LJFOLD(TOBIT ADD KNUM) -LJFOLD(TOBIT SUB KNUM) -LJFOLD(CONV ADD IRCONV_INT_NUM) -LJFOLD(CONV SUB IRCONV_INT_NUM) -LJFOLD(CONV ADD IRCONV_I64_NUM) -LJFOLD(CONV SUB IRCONV_I64_NUM) -LJFOLDF(narrow_convert) -{ - PHIBARRIER(fleft); - /* Narrowing ignores PHIs and repeating it inside the loop is not useful. */ - if (J->chain[IR_LOOP]) - return NEXTFOLD; - lua_assert(fins->o != IR_CONV || (fins->op2&IRCONV_CONVMASK) != IRCONV_TOBIT); - return lj_opt_narrow_convert(J); -} - -/* -- Integer algebraic simplifications ----------------------------------- */ - -LJFOLD(ADD any KINT) -LJFOLD(ADDOV any KINT) -LJFOLD(SUBOV any KINT) -LJFOLDF(simplify_intadd_k) -{ - if (fright->i == 0) /* i o 0 ==> i */ - return LEFTFOLD; - return NEXTFOLD; -} - -LJFOLD(MULOV any KINT) -LJFOLDF(simplify_intmul_k) -{ - if (fright->i == 0) /* i * 0 ==> 0 */ - return RIGHTFOLD; - if (fright->i == 1) /* i * 1 ==> i */ - return LEFTFOLD; - if (fright->i == 2) { /* i * 2 ==> i + i */ - fins->o = IR_ADDOV; - fins->op2 = fins->op1; - return RETRYFOLD; - } - return NEXTFOLD; -} - -LJFOLD(SUB any KINT) -LJFOLDF(simplify_intsub_k) -{ - if (fright->i == 0) /* i - 0 ==> i */ - return LEFTFOLD; - fins->o = IR_ADD; /* i - k ==> i + (-k) */ - fins->op2 = (IRRef1)lj_ir_kint(J, -fright->i); /* Overflow for -2^31 ok. */ - return RETRYFOLD; -} - -LJFOLD(SUB KINT any) -LJFOLD(SUB KINT64 any) -LJFOLDF(simplify_intsub_kleft) -{ - if (fleft->o == IR_KINT ? (fleft->i == 0) : (ir_kint64(fleft)->u64 == 0)) { - fins->o = IR_NEG; /* 0 - i ==> -i */ - fins->op1 = fins->op2; - return RETRYFOLD; - } - return NEXTFOLD; -} - -LJFOLD(ADD any KINT64) -LJFOLDF(simplify_intadd_k64) -{ - if (ir_kint64(fright)->u64 == 0) /* i + 0 ==> i */ - return LEFTFOLD; - return NEXTFOLD; -} - -LJFOLD(SUB any KINT64) -LJFOLDF(simplify_intsub_k64) -{ - uint64_t k = ir_kint64(fright)->u64; - if (k == 0) /* i - 0 ==> i */ - return LEFTFOLD; - fins->o = IR_ADD; /* i - k ==> i + (-k) */ - fins->op2 = (IRRef1)lj_ir_kint64(J, (uint64_t)-(int64_t)k); - return RETRYFOLD; -} - -static TRef simplify_intmul_k(jit_State *J, int32_t k) -{ - /* Note: many more simplifications are possible, e.g. 2^k1 +- 2^k2. - ** But this is mainly intended for simple address arithmetic. - ** Also it's easier for the backend to optimize the original multiplies. - */ - if (k == 1) { /* i * 1 ==> i */ - return LEFTFOLD; - } else if ((k & (k-1)) == 0) { /* i * 2^k ==> i << k */ - fins->o = IR_BSHL; - fins->op2 = lj_ir_kint(J, lj_fls((uint32_t)k)); - return RETRYFOLD; - } - return NEXTFOLD; -} - -LJFOLD(MUL any KINT) -LJFOLDF(simplify_intmul_k32) -{ - if (fright->i == 0) /* i * 0 ==> 0 */ - return INTFOLD(0); - else if (fright->i > 0) - return simplify_intmul_k(J, fright->i); - return NEXTFOLD; -} - -LJFOLD(MUL any KINT64) -LJFOLDF(simplify_intmul_k64) -{ - if (ir_kint64(fright)->u64 == 0) /* i * 0 ==> 0 */ - return INT64FOLD(0); -#if LJ_64 - /* NYI: SPLIT for BSHL and 32 bit backend support. */ - else if (ir_kint64(fright)->u64 < 0x80000000u) - return simplify_intmul_k(J, (int32_t)ir_kint64(fright)->u64); -#endif - return NEXTFOLD; -} - -LJFOLD(MOD any KINT) -LJFOLDF(simplify_intmod_k) -{ - int32_t k = fright->i; - lua_assert(k != 0); - if (k > 0 && (k & (k-1)) == 0) { /* i % (2^k) ==> i & (2^k-1) */ - fins->o = IR_BAND; - fins->op2 = lj_ir_kint(J, k-1); - return RETRYFOLD; - } - return NEXTFOLD; -} - -LJFOLD(MOD KINT any) -LJFOLDF(simplify_intmod_kleft) -{ - if (fleft->i == 0) - return INTFOLD(0); - return NEXTFOLD; -} - -LJFOLD(SUB any any) -LJFOLD(SUBOV any any) -LJFOLDF(simplify_intsub) -{ - if (fins->op1 == fins->op2 && !irt_isnum(fins->t)) /* i - i ==> 0 */ - return irt_is64(fins->t) ? INT64FOLD(0) : INTFOLD(0); - return NEXTFOLD; -} - -LJFOLD(SUB ADD any) -LJFOLDF(simplify_intsubadd_leftcancel) -{ - if (!irt_isnum(fins->t)) { - PHIBARRIER(fleft); - if (fins->op2 == fleft->op1) /* (i + j) - i ==> j */ - return fleft->op2; - if (fins->op2 == fleft->op2) /* (i + j) - j ==> i */ - return fleft->op1; - } - return NEXTFOLD; -} - -LJFOLD(SUB SUB any) -LJFOLDF(simplify_intsubsub_leftcancel) -{ - if (!irt_isnum(fins->t)) { - PHIBARRIER(fleft); - if (fins->op2 == fleft->op1) { /* (i - j) - i ==> 0 - j */ - fins->op1 = (IRRef1)lj_ir_kint(J, 0); - fins->op2 = fleft->op2; - return RETRYFOLD; - } - } - return NEXTFOLD; -} - -LJFOLD(SUB any SUB) -LJFOLDF(simplify_intsubsub_rightcancel) -{ - if (!irt_isnum(fins->t)) { - PHIBARRIER(fright); - if (fins->op1 == fright->op1) /* i - (i - j) ==> j */ - return fright->op2; - } - return NEXTFOLD; -} - -LJFOLD(SUB any ADD) -LJFOLDF(simplify_intsubadd_rightcancel) -{ - if (!irt_isnum(fins->t)) { - PHIBARRIER(fright); - if (fins->op1 == fright->op1) { /* i - (i + j) ==> 0 - j */ - fins->op2 = fright->op2; - fins->op1 = (IRRef1)lj_ir_kint(J, 0); - return RETRYFOLD; - } - if (fins->op1 == fright->op2) { /* i - (j + i) ==> 0 - j */ - fins->op2 = fright->op1; - fins->op1 = (IRRef1)lj_ir_kint(J, 0); - return RETRYFOLD; - } - } - return NEXTFOLD; -} - -LJFOLD(SUB ADD ADD) -LJFOLDF(simplify_intsubaddadd_cancel) -{ - if (!irt_isnum(fins->t)) { - PHIBARRIER(fleft); - PHIBARRIER(fright); - if (fleft->op1 == fright->op1) { /* (i + j1) - (i + j2) ==> j1 - j2 */ - fins->op1 = fleft->op2; - fins->op2 = fright->op2; - return RETRYFOLD; - } - if (fleft->op1 == fright->op2) { /* (i + j1) - (j2 + i) ==> j1 - j2 */ - fins->op1 = fleft->op2; - fins->op2 = fright->op1; - return RETRYFOLD; - } - if (fleft->op2 == fright->op1) { /* (j1 + i) - (i + j2) ==> j1 - j2 */ - fins->op1 = fleft->op1; - fins->op2 = fright->op2; - return RETRYFOLD; - } - if (fleft->op2 == fright->op2) { /* (j1 + i) - (j2 + i) ==> j1 - j2 */ - fins->op1 = fleft->op1; - fins->op2 = fright->op1; - return RETRYFOLD; - } - } - return NEXTFOLD; -} - -LJFOLD(BAND any KINT) -LJFOLD(BAND any KINT64) -LJFOLDF(simplify_band_k) -{ - int64_t k = fright->o == IR_KINT ? (int64_t)fright->i : - (int64_t)ir_k64(fright)->u64; - if (k == 0) /* i & 0 ==> 0 */ - return RIGHTFOLD; - if (k == -1) /* i & -1 ==> i */ - return LEFTFOLD; - return NEXTFOLD; -} - -LJFOLD(BOR any KINT) -LJFOLD(BOR any KINT64) -LJFOLDF(simplify_bor_k) -{ - int64_t k = fright->o == IR_KINT ? (int64_t)fright->i : - (int64_t)ir_k64(fright)->u64; - if (k == 0) /* i | 0 ==> i */ - return LEFTFOLD; - if (k == -1) /* i | -1 ==> -1 */ - return RIGHTFOLD; - return NEXTFOLD; -} - -LJFOLD(BXOR any KINT) -LJFOLD(BXOR any KINT64) -LJFOLDF(simplify_bxor_k) -{ - int64_t k = fright->o == IR_KINT ? (int64_t)fright->i : - (int64_t)ir_k64(fright)->u64; - if (k == 0) /* i xor 0 ==> i */ - return LEFTFOLD; - if (k == -1) { /* i xor -1 ==> ~i */ - fins->o = IR_BNOT; - fins->op2 = 0; - return RETRYFOLD; - } - return NEXTFOLD; -} - -LJFOLD(BSHL any KINT) -LJFOLD(BSHR any KINT) -LJFOLD(BSAR any KINT) -LJFOLD(BROL any KINT) -LJFOLD(BROR any KINT) -LJFOLDF(simplify_shift_ik) -{ - int32_t mask = irt_is64(fins->t) ? 63 : 31; - int32_t k = (fright->i & mask); - if (k == 0) /* i o 0 ==> i */ - return LEFTFOLD; - if (k == 1 && fins->o == IR_BSHL) { /* i << 1 ==> i + i */ - fins->o = IR_ADD; - fins->op2 = fins->op1; - return RETRYFOLD; - } - if (k != fright->i) { /* i o k ==> i o (k & mask) */ - fins->op2 = (IRRef1)lj_ir_kint(J, k); - return RETRYFOLD; - } -#ifndef LJ_TARGET_UNIFYROT - if (fins->o == IR_BROR) { /* bror(i, k) ==> brol(i, (-k)&mask) */ - fins->o = IR_BROL; - fins->op2 = (IRRef1)lj_ir_kint(J, (-k)&mask); - return RETRYFOLD; - } -#endif - return NEXTFOLD; -} - -LJFOLD(BSHL any BAND) -LJFOLD(BSHR any BAND) -LJFOLD(BSAR any BAND) -LJFOLD(BROL any BAND) -LJFOLD(BROR any BAND) -LJFOLDF(simplify_shift_andk) -{ - IRIns *irk = IR(fright->op2); - PHIBARRIER(fright); - if ((fins->o < IR_BROL ? LJ_TARGET_MASKSHIFT : LJ_TARGET_MASKROT) && - irk->o == IR_KINT) { /* i o (j & mask) ==> i o j */ - int32_t mask = irt_is64(fins->t) ? 63 : 31; - int32_t k = irk->i & mask; - if (k == mask) { - fins->op2 = fright->op1; - return RETRYFOLD; - } - } - return NEXTFOLD; -} - -LJFOLD(BSHL KINT any) -LJFOLD(BSHR KINT any) -LJFOLD(BSHL KINT64 any) -LJFOLD(BSHR KINT64 any) -LJFOLDF(simplify_shift1_ki) -{ - int64_t k = fleft->o == IR_KINT ? (int64_t)fleft->i : - (int64_t)ir_k64(fleft)->u64; - if (k == 0) /* 0 o i ==> 0 */ - return LEFTFOLD; - return NEXTFOLD; -} - -LJFOLD(BSAR KINT any) -LJFOLD(BROL KINT any) -LJFOLD(BROR KINT any) -LJFOLD(BSAR KINT64 any) -LJFOLD(BROL KINT64 any) -LJFOLD(BROR KINT64 any) -LJFOLDF(simplify_shift2_ki) -{ - int64_t k = fleft->o == IR_KINT ? (int64_t)fleft->i : - (int64_t)ir_k64(fleft)->u64; - if (k == 0 || k == -1) /* 0 o i ==> 0; -1 o i ==> -1 */ - return LEFTFOLD; - return NEXTFOLD; -} - -LJFOLD(BSHL BAND KINT) -LJFOLD(BSHR BAND KINT) -LJFOLD(BROL BAND KINT) -LJFOLD(BROR BAND KINT) -LJFOLDF(simplify_shiftk_andk) -{ - IRIns *irk = IR(fleft->op2); - PHIBARRIER(fleft); - if (irk->o == IR_KINT) { /* (i & k1) o k2 ==> (i o k2) & (k1 o k2) */ - int32_t k = kfold_intop(irk->i, fright->i, (IROp)fins->o); - fins->op1 = fleft->op1; - fins->op1 = (IRRef1)lj_opt_fold(J); - fins->op2 = (IRRef1)lj_ir_kint(J, k); - fins->ot = IRTI(IR_BAND); - return RETRYFOLD; - } - return NEXTFOLD; -} - -LJFOLD(BAND BSHL KINT) -LJFOLD(BAND BSHR KINT) -LJFOLDF(simplify_andk_shiftk) -{ - IRIns *irk = IR(fleft->op2); - if (irk->o == IR_KINT && - kfold_intop(-1, irk->i, (IROp)fleft->o) == fright->i) - return LEFTFOLD; /* (i o k1) & k2 ==> i, if (-1 o k1) == k2 */ - return NEXTFOLD; -} - -/* -- Reassociation ------------------------------------------------------- */ - -LJFOLD(ADD ADD KINT) -LJFOLD(MUL MUL KINT) -LJFOLD(BAND BAND KINT) -LJFOLD(BOR BOR KINT) -LJFOLD(BXOR BXOR KINT) -LJFOLDF(reassoc_intarith_k) -{ - IRIns *irk = IR(fleft->op2); - if (irk->o == IR_KINT) { - int32_t k = kfold_intop(irk->i, fright->i, (IROp)fins->o); - if (k == irk->i) /* (i o k1) o k2 ==> i o k1, if (k1 o k2) == k1. */ - return LEFTFOLD; - PHIBARRIER(fleft); - fins->op1 = fleft->op1; - fins->op2 = (IRRef1)lj_ir_kint(J, k); - return RETRYFOLD; /* (i o k1) o k2 ==> i o (k1 o k2) */ - } - return NEXTFOLD; -} - -LJFOLD(ADD ADD KINT64) -LJFOLD(MUL MUL KINT64) -LJFOLD(BAND BAND KINT64) -LJFOLD(BOR BOR KINT64) -LJFOLD(BXOR BXOR KINT64) -LJFOLDF(reassoc_intarith_k64) -{ -#if LJ_HASFFI || LJ_64 - IRIns *irk = IR(fleft->op2); - if (irk->o == IR_KINT64) { - uint64_t k = kfold_int64arith(ir_k64(irk)->u64, - ir_k64(fright)->u64, (IROp)fins->o); - PHIBARRIER(fleft); - fins->op1 = fleft->op1; - fins->op2 = (IRRef1)lj_ir_kint64(J, k); - return RETRYFOLD; /* (i o k1) o k2 ==> i o (k1 o k2) */ - } - return NEXTFOLD; -#else - UNUSED(J); lua_assert(0); return FAILFOLD; -#endif -} - -LJFOLD(MIN MIN any) -LJFOLD(MAX MAX any) -LJFOLD(BAND BAND any) -LJFOLD(BOR BOR any) -LJFOLDF(reassoc_dup) -{ - if (fins->op2 == fleft->op1 || fins->op2 == fleft->op2) - return LEFTFOLD; /* (a o b) o a ==> a o b; (a o b) o b ==> a o b */ - return NEXTFOLD; -} - -LJFOLD(BXOR BXOR any) -LJFOLDF(reassoc_bxor) -{ - PHIBARRIER(fleft); - if (fins->op2 == fleft->op1) /* (a xor b) xor a ==> b */ - return fleft->op2; - if (fins->op2 == fleft->op2) /* (a xor b) xor b ==> a */ - return fleft->op1; - return NEXTFOLD; -} - -LJFOLD(BSHL BSHL KINT) -LJFOLD(BSHR BSHR KINT) -LJFOLD(BSAR BSAR KINT) -LJFOLD(BROL BROL KINT) -LJFOLD(BROR BROR KINT) -LJFOLDF(reassoc_shift) -{ - IRIns *irk = IR(fleft->op2); - PHIBARRIER(fleft); /* The (shift any KINT) rule covers k2 == 0 and more. */ - if (irk->o == IR_KINT) { /* (i o k1) o k2 ==> i o (k1 + k2) */ - int32_t mask = irt_is64(fins->t) ? 63 : 31; - int32_t k = (irk->i & mask) + (fright->i & mask); - if (k > mask) { /* Combined shift too wide? */ - if (fins->o == IR_BSHL || fins->o == IR_BSHR) - return mask == 31 ? INTFOLD(0) : INT64FOLD(0); - else if (fins->o == IR_BSAR) - k = mask; - else - k &= mask; - } - fins->op1 = fleft->op1; - fins->op2 = (IRRef1)lj_ir_kint(J, k); - return RETRYFOLD; - } - return NEXTFOLD; -} - -LJFOLD(MIN MIN KNUM) -LJFOLD(MAX MAX KNUM) -LJFOLD(MIN MIN KINT) -LJFOLD(MAX MAX KINT) -LJFOLDF(reassoc_minmax_k) -{ - IRIns *irk = IR(fleft->op2); - if (irk->o == IR_KNUM) { - lua_Number a = ir_knum(irk)->n; - lua_Number y = lj_vm_foldarith(a, knumright, fins->o - IR_ADD); - if (a == y) /* (x o k1) o k2 ==> x o k1, if (k1 o k2) == k1. */ - return LEFTFOLD; - PHIBARRIER(fleft); - fins->op1 = fleft->op1; - fins->op2 = (IRRef1)lj_ir_knum(J, y); - return RETRYFOLD; /* (x o k1) o k2 ==> x o (k1 o k2) */ - } else if (irk->o == IR_KINT) { - int32_t a = irk->i; - int32_t y = kfold_intop(a, fright->i, fins->o); - if (a == y) /* (x o k1) o k2 ==> x o k1, if (k1 o k2) == k1. */ - return LEFTFOLD; - PHIBARRIER(fleft); - fins->op1 = fleft->op1; - fins->op2 = (IRRef1)lj_ir_kint(J, y); - return RETRYFOLD; /* (x o k1) o k2 ==> x o (k1 o k2) */ - } - return NEXTFOLD; -} - -LJFOLD(MIN MAX any) -LJFOLD(MAX MIN any) -LJFOLDF(reassoc_minmax_left) -{ - if (fins->op2 == fleft->op1 || fins->op2 == fleft->op2) - return RIGHTFOLD; /* (b o1 a) o2 b ==> b; (a o1 b) o2 b ==> b */ - return NEXTFOLD; -} - -LJFOLD(MIN any MAX) -LJFOLD(MAX any MIN) -LJFOLDF(reassoc_minmax_right) -{ - if (fins->op1 == fright->op1 || fins->op1 == fright->op2) - return LEFTFOLD; /* a o2 (a o1 b) ==> a; a o2 (b o1 a) ==> a */ - return NEXTFOLD; -} - -/* -- Array bounds check elimination -------------------------------------- */ - -/* Eliminate ABC across PHIs to handle t[i-1] forwarding case. -** ABC(asize, (i+k)+(-k)) ==> ABC(asize, i), but only if it already exists. -** Could be generalized to (i+k1)+k2 ==> i+(k1+k2), but needs better disambig. -*/ -LJFOLD(ABC any ADD) -LJFOLDF(abc_fwd) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_ABC)) { - if (irref_isk(fright->op2)) { - IRIns *add2 = IR(fright->op1); - if (add2->o == IR_ADD && irref_isk(add2->op2) && - IR(fright->op2)->i == -IR(add2->op2)->i) { - IRRef ref = J->chain[IR_ABC]; - IRRef lim = add2->op1; - if (fins->op1 > lim) lim = fins->op1; - while (ref > lim) { - IRIns *ir = IR(ref); - if (ir->op1 == fins->op1 && ir->op2 == add2->op1) - return DROPFOLD; - ref = ir->prev; - } - } - } - } - return NEXTFOLD; -} - -/* Eliminate ABC for constants. -** ABC(asize, k1), ABC(asize k2) ==> ABC(asize, max(k1, k2)) -** Drop second ABC if k2 is lower. Otherwise patch first ABC with k2. -*/ -LJFOLD(ABC any KINT) -LJFOLDF(abc_k) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_ABC)) { - IRRef ref = J->chain[IR_ABC]; - IRRef asize = fins->op1; - while (ref > asize) { - IRIns *ir = IR(ref); - if (ir->op1 == asize && irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - if (fright->i > k) - ir->op2 = fins->op2; - return DROPFOLD; - } - ref = ir->prev; - } - return EMITFOLD; /* Already performed CSE. */ - } - return NEXTFOLD; -} - -/* Eliminate invariant ABC inside loop. */ -LJFOLD(ABC any any) -LJFOLDF(abc_invar) -{ - /* Invariant ABC marked as PTR. Drop if op1 is invariant, too. */ - if (!irt_isint(fins->t) && fins->op1 < J->chain[IR_LOOP] && - !irt_isphi(IR(fins->op1)->t)) - return DROPFOLD; - return NEXTFOLD; -} - -/* -- Commutativity ------------------------------------------------------- */ - -/* The refs of commutative ops are canonicalized. Lower refs go to the right. -** Rationale behind this: -** - It (also) moves constants to the right. -** - It reduces the number of FOLD rules (e.g. (BOR any KINT) suffices). -** - It helps CSE to find more matches. -** - The assembler generates better code with constants at the right. -*/ - -LJFOLD(ADD any any) -LJFOLD(MUL any any) -LJFOLD(ADDOV any any) -LJFOLD(MULOV any any) -LJFOLDF(comm_swap) -{ - if (fins->op1 < fins->op2) { /* Move lower ref to the right. */ - IRRef1 tmp = fins->op1; - fins->op1 = fins->op2; - fins->op2 = tmp; - return RETRYFOLD; - } - return NEXTFOLD; -} - -LJFOLD(EQ any any) -LJFOLD(NE any any) -LJFOLDF(comm_equal) -{ - /* For non-numbers only: x == x ==> drop; x ~= x ==> fail */ - if (fins->op1 == fins->op2 && !irt_isnum(fins->t)) - return CONDFOLD(fins->o == IR_EQ); - return fold_comm_swap(J); -} - -LJFOLD(LT any any) -LJFOLD(GE any any) -LJFOLD(LE any any) -LJFOLD(GT any any) -LJFOLD(ULT any any) -LJFOLD(UGE any any) -LJFOLD(ULE any any) -LJFOLD(UGT any any) -LJFOLDF(comm_comp) -{ - /* For non-numbers only: x <=> x ==> drop; x <> x ==> fail */ - if (fins->op1 == fins->op2 && !irt_isnum(fins->t)) - return CONDFOLD((fins->o ^ (fins->o >> 1)) & 1); - if (fins->op1 < fins->op2) { /* Move lower ref to the right. */ - IRRef1 tmp = fins->op1; - fins->op1 = fins->op2; - fins->op2 = tmp; - fins->o ^= 3; /* GT <-> LT, GE <-> LE, does not affect U */ - return RETRYFOLD; - } - return NEXTFOLD; -} - -LJFOLD(BAND any any) -LJFOLD(BOR any any) -LJFOLD(MIN any any) -LJFOLD(MAX any any) -LJFOLDF(comm_dup) -{ - if (fins->op1 == fins->op2) /* x o x ==> x */ - return LEFTFOLD; - return fold_comm_swap(J); -} - -LJFOLD(BXOR any any) -LJFOLDF(comm_bxor) -{ - if (fins->op1 == fins->op2) /* i xor i ==> 0 */ - return irt_is64(fins->t) ? INT64FOLD(0) : INTFOLD(0); - return fold_comm_swap(J); -} - -/* -- Simplification of compound expressions ------------------------------ */ - -static TRef kfold_xload(jit_State *J, IRIns *ir, const void *p) -{ - int32_t k; - switch (irt_type(ir->t)) { - case IRT_NUM: return lj_ir_knum_u64(J, *(uint64_t *)p); - case IRT_I8: k = (int32_t)*(int8_t *)p; break; - case IRT_U8: k = (int32_t)*(uint8_t *)p; break; - case IRT_I16: k = (int32_t)(int16_t)lj_getu16(p); break; - case IRT_U16: k = (int32_t)(uint16_t)lj_getu16(p); break; - case IRT_INT: case IRT_U32: k = (int32_t)lj_getu32(p); break; - case IRT_I64: case IRT_U64: return lj_ir_kint64(J, *(uint64_t *)p); - default: return 0; - } - return lj_ir_kint(J, k); -} - -/* Turn: string.sub(str, a, b) == kstr -** into: string.byte(str, a) == string.byte(kstr, 1) etc. -** Note: this creates unaligned XLOADs on x86/x64. -*/ -LJFOLD(EQ SNEW KGC) -LJFOLD(NE SNEW KGC) -LJFOLDF(merge_eqne_snew_kgc) -{ - GCstr *kstr = ir_kstr(fright); - int32_t len = (int32_t)kstr->len; - lua_assert(irt_isstr(fins->t)); - -#if LJ_TARGET_UNALIGNED -#define FOLD_SNEW_MAX_LEN 4 /* Handle string lengths 0, 1, 2, 3, 4. */ -#define FOLD_SNEW_TYPE8 IRT_I8 /* Creates shorter immediates. */ -#else -#define FOLD_SNEW_MAX_LEN 1 /* Handle string lengths 0 or 1. */ -#define FOLD_SNEW_TYPE8 IRT_U8 /* Prefer unsigned loads. */ -#endif - - PHIBARRIER(fleft); - if (len <= FOLD_SNEW_MAX_LEN) { - IROp op = (IROp)fins->o; - IRRef strref = fleft->op1; - if (IR(strref)->o != IR_STRREF) - return NEXTFOLD; - if (op == IR_EQ) { - emitir(IRTGI(IR_EQ), fleft->op2, lj_ir_kint(J, len)); - /* Caveat: fins/fleft/fright is no longer valid after emitir. */ - } else { - /* NE is not expanded since this would need an OR of two conds. */ - if (!irref_isk(fleft->op2)) /* Only handle the constant length case. */ - return NEXTFOLD; - if (IR(fleft->op2)->i != len) - return DROPFOLD; - } - if (len > 0) { - /* A 4 byte load for length 3 is ok -- all strings have an extra NUL. */ - uint16_t ot = (uint16_t)(len == 1 ? IRT(IR_XLOAD, FOLD_SNEW_TYPE8) : - len == 2 ? IRT(IR_XLOAD, IRT_U16) : - IRTI(IR_XLOAD)); - TRef tmp = emitir(ot, strref, - IRXLOAD_READONLY | (len > 1 ? IRXLOAD_UNALIGNED : 0)); - TRef val = kfold_xload(J, IR(tref_ref(tmp)), strdata(kstr)); - if (len == 3) - tmp = emitir(IRTI(IR_BAND), tmp, - lj_ir_kint(J, LJ_ENDIAN_SELECT(0x00ffffff, 0xffffff00))); - fins->op1 = (IRRef1)tmp; - fins->op2 = (IRRef1)val; - fins->ot = (IROpT)IRTGI(op); - return RETRYFOLD; - } else { - return DROPFOLD; - } - } - return NEXTFOLD; -} - -/* -- Loads --------------------------------------------------------------- */ - -/* Loads cannot be folded or passed on to CSE in general. -** Alias analysis is needed to check for forwarding opportunities. -** -** Caveat: *all* loads must be listed here or they end up at CSE! -*/ - -LJFOLD(ALOAD any) -LJFOLDX(lj_opt_fwd_aload) - -/* From HREF fwd (see below). Must eliminate, not supported by fwd/backend. */ -LJFOLD(HLOAD KKPTR) -LJFOLDF(kfold_hload_kkptr) -{ - UNUSED(J); - lua_assert(ir_kptr(fleft) == niltvg(J2G(J))); - return TREF_NIL; -} - -LJFOLD(HLOAD any) -LJFOLDX(lj_opt_fwd_hload) - -LJFOLD(ULOAD any) -LJFOLDX(lj_opt_fwd_uload) - -LJFOLD(CALLL any IRCALL_lj_tab_len) -LJFOLDX(lj_opt_fwd_tab_len) - -/* Upvalue refs are really loads, but there are no corresponding stores. -** So CSE is ok for them, except for UREFO across a GC step (see below). -** If the referenced function is const, its upvalue addresses are const, too. -** This can be used to improve CSE by looking for the same address, -** even if the upvalues originate from a different function. -*/ -LJFOLD(UREFO KGC any) -LJFOLD(UREFC KGC any) -LJFOLDF(cse_uref) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_CSE)) { - IRRef ref = J->chain[fins->o]; - GCfunc *fn = ir_kfunc(fleft); - GCupval *uv = gco2uv(gcref(fn->l.uvptr[(fins->op2 >> 8)])); - while (ref > 0) { - IRIns *ir = IR(ref); - if (irref_isk(ir->op1)) { - GCfunc *fn2 = ir_kfunc(IR(ir->op1)); - if (gco2uv(gcref(fn2->l.uvptr[(ir->op2 >> 8)])) == uv) { - if (fins->o == IR_UREFO && gcstep_barrier(J, ref)) - break; - return ref; - } - } - ref = ir->prev; - } - } - return EMITFOLD; -} - -LJFOLD(HREFK any any) -LJFOLDX(lj_opt_fwd_hrefk) - -LJFOLD(HREF TNEW any) -LJFOLDF(fwd_href_tnew) -{ - if (lj_opt_fwd_href_nokey(J)) - return lj_ir_kkptr(J, niltvg(J2G(J))); - return NEXTFOLD; -} - -LJFOLD(HREF TDUP KPRI) -LJFOLD(HREF TDUP KGC) -LJFOLD(HREF TDUP KNUM) -LJFOLDF(fwd_href_tdup) -{ - TValue keyv; - lj_ir_kvalue(J->L, &keyv, fright); - if (lj_tab_get(J->L, ir_ktab(IR(fleft->op1)), &keyv) == niltvg(J2G(J)) && - lj_opt_fwd_href_nokey(J)) - return lj_ir_kkptr(J, niltvg(J2G(J))); - return NEXTFOLD; -} - -/* We can safely FOLD/CSE array/hash refs and field loads, since there -** are no corresponding stores. But we need to check for any NEWREF with -** an aliased table, as it may invalidate all of the pointers and fields. -** Only HREF needs the NEWREF check -- AREF and HREFK already depend on -** FLOADs. And NEWREF itself is treated like a store (see below). -*/ -LJFOLD(FLOAD TNEW IRFL_TAB_ASIZE) -LJFOLDF(fload_tab_tnew_asize) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD) && lj_opt_fwd_tptr(J, fins->op1)) - return INTFOLD(fleft->op1); - return NEXTFOLD; -} - -LJFOLD(FLOAD TNEW IRFL_TAB_HMASK) -LJFOLDF(fload_tab_tnew_hmask) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD) && lj_opt_fwd_tptr(J, fins->op1)) - return INTFOLD((1 << fleft->op2)-1); - return NEXTFOLD; -} - -LJFOLD(FLOAD TDUP IRFL_TAB_ASIZE) -LJFOLDF(fload_tab_tdup_asize) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD) && lj_opt_fwd_tptr(J, fins->op1)) - return INTFOLD((int32_t)ir_ktab(IR(fleft->op1))->asize); - return NEXTFOLD; -} - -LJFOLD(FLOAD TDUP IRFL_TAB_HMASK) -LJFOLDF(fload_tab_tdup_hmask) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD) && lj_opt_fwd_tptr(J, fins->op1)) - return INTFOLD((int32_t)ir_ktab(IR(fleft->op1))->hmask); - return NEXTFOLD; -} - -LJFOLD(HREF any any) -LJFOLD(FLOAD any IRFL_TAB_ARRAY) -LJFOLD(FLOAD any IRFL_TAB_NODE) -LJFOLD(FLOAD any IRFL_TAB_ASIZE) -LJFOLD(FLOAD any IRFL_TAB_HMASK) -LJFOLDF(fload_tab_ah) -{ - TRef tr = lj_opt_cse(J); - return lj_opt_fwd_tptr(J, tref_ref(tr)) ? tr : EMITFOLD; -} - -/* Strings are immutable, so we can safely FOLD/CSE the related FLOAD. */ -LJFOLD(FLOAD KGC IRFL_STR_LEN) -LJFOLDF(fload_str_len_kgc) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) - return INTFOLD((int32_t)ir_kstr(fleft)->len); - return NEXTFOLD; -} - -LJFOLD(FLOAD SNEW IRFL_STR_LEN) -LJFOLDF(fload_str_len_snew) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) { - PHIBARRIER(fleft); - return fleft->op2; - } - return NEXTFOLD; -} - -/* The C type ID of cdata objects is immutable. */ -LJFOLD(FLOAD KGC IRFL_CDATA_CTYPEID) -LJFOLDF(fload_cdata_typeid_kgc) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) - return INTFOLD((int32_t)ir_kcdata(fleft)->ctypeid); - return NEXTFOLD; -} - -/* Get the contents of immutable cdata objects. */ -LJFOLD(FLOAD KGC IRFL_CDATA_PTR) -LJFOLD(FLOAD KGC IRFL_CDATA_INT) -LJFOLD(FLOAD KGC IRFL_CDATA_INT64) -LJFOLDF(fload_cdata_int64_kgc) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) { - void *p = cdataptr(ir_kcdata(fleft)); - if (irt_is64(fins->t)) - return INT64FOLD(*(uint64_t *)p); - else - return INTFOLD(*(int32_t *)p); - } - return NEXTFOLD; -} - -LJFOLD(FLOAD CNEW IRFL_CDATA_CTYPEID) -LJFOLD(FLOAD CNEWI IRFL_CDATA_CTYPEID) -LJFOLDF(fload_cdata_typeid_cnew) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) - return fleft->op1; /* No PHI barrier needed. CNEW/CNEWI op1 is const. */ - return NEXTFOLD; -} - -/* Pointer, int and int64 cdata objects are immutable. */ -LJFOLD(FLOAD CNEWI IRFL_CDATA_PTR) -LJFOLD(FLOAD CNEWI IRFL_CDATA_INT) -LJFOLD(FLOAD CNEWI IRFL_CDATA_INT64) -LJFOLDF(fload_cdata_ptr_int64_cnew) -{ - if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) - return fleft->op2; /* Fold even across PHI to avoid allocations. */ - return NEXTFOLD; -} - -LJFOLD(FLOAD any IRFL_STR_LEN) -LJFOLD(FLOAD any IRFL_CDATA_CTYPEID) -LJFOLD(FLOAD any IRFL_CDATA_PTR) -LJFOLD(FLOAD any IRFL_CDATA_INT) -LJFOLD(FLOAD any IRFL_CDATA_INT64) -LJFOLD(VLOAD any any) /* Vararg loads have no corresponding stores. */ -LJFOLDX(lj_opt_cse) - -/* All other field loads need alias analysis. */ -LJFOLD(FLOAD any any) -LJFOLDX(lj_opt_fwd_fload) - -/* This is for LOOP only. Recording handles SLOADs internally. */ -LJFOLD(SLOAD any any) -LJFOLDF(fwd_sload) -{ - if ((fins->op2 & IRSLOAD_FRAME)) { - TRef tr = lj_opt_cse(J); - return tref_ref(tr) < J->chain[IR_RETF] ? EMITFOLD : tr; - } else { - lua_assert(J->slot[fins->op1] != 0); - return J->slot[fins->op1]; - } -} - -/* Only fold for KKPTR. The pointer _and_ the contents must be const. */ -LJFOLD(XLOAD KKPTR any) -LJFOLDF(xload_kptr) -{ - TRef tr = kfold_xload(J, fins, ir_kptr(fleft)); - return tr ? tr : NEXTFOLD; -} - -LJFOLD(XLOAD any any) -LJFOLDX(lj_opt_fwd_xload) - -/* -- Write barriers ------------------------------------------------------ */ - -/* Write barriers are amenable to CSE, but not across any incremental -** GC steps. -** -** The same logic applies to open upvalue references, because a stack -** may be resized during a GC step (not the current stack, but maybe that -** of a coroutine). -*/ -LJFOLD(TBAR any) -LJFOLD(OBAR any any) -LJFOLD(UREFO any any) -LJFOLDF(barrier_tab) -{ - TRef tr = lj_opt_cse(J); - if (gcstep_barrier(J, tref_ref(tr))) /* CSE across GC step? */ - return EMITFOLD; /* Raw emit. Assumes fins is left intact by CSE. */ - return tr; -} - -LJFOLD(TBAR TNEW) -LJFOLD(TBAR TDUP) -LJFOLDF(barrier_tnew_tdup) -{ - /* New tables are always white and never need a barrier. */ - if (fins->op1 < J->chain[IR_LOOP]) /* Except across a GC step. */ - return NEXTFOLD; - return DROPFOLD; -} - -/* -- Stores and allocations ---------------------------------------------- */ - -/* Stores and allocations cannot be folded or passed on to CSE in general. -** But some stores can be eliminated with dead-store elimination (DSE). -** -** Caveat: *all* stores and allocs must be listed here or they end up at CSE! -*/ - -LJFOLD(ASTORE any any) -LJFOLD(HSTORE any any) -LJFOLDX(lj_opt_dse_ahstore) - -LJFOLD(USTORE any any) -LJFOLDX(lj_opt_dse_ustore) - -LJFOLD(FSTORE any any) -LJFOLDX(lj_opt_dse_fstore) - -LJFOLD(XSTORE any any) -LJFOLDX(lj_opt_dse_xstore) - -LJFOLD(NEWREF any any) /* Treated like a store. */ -LJFOLD(CALLS any any) -LJFOLD(CALLL any any) /* Safeguard fallback. */ -LJFOLD(CALLXS any any) -LJFOLD(XBAR) -LJFOLD(RETF any any) /* Modifies BASE. */ -LJFOLD(TNEW any any) -LJFOLD(TDUP any) -LJFOLD(CNEW any any) -LJFOLD(XSNEW any any) -LJFOLDX(lj_ir_emit) - -/* ------------------------------------------------------------------------ */ - -/* Every entry in the generated hash table is a 32 bit pattern: -** -** xxxxxxxx iiiiiii lllllll rrrrrrrrrr -** -** xxxxxxxx = 8 bit index into fold function table -** iiiiiii = 7 bit folded instruction opcode -** lllllll = 7 bit left instruction opcode -** rrrrrrrrrr = 8 bit right instruction opcode or 10 bits from literal field -*/ - -#include "lj_folddef.h" - -/* ------------------------------------------------------------------------ */ - -/* Fold IR instruction. */ -TRef LJ_FASTCALL lj_opt_fold(jit_State *J) -{ - uint32_t key, any; - IRRef ref; - - if (LJ_UNLIKELY((J->flags & JIT_F_OPT_MASK) != JIT_F_OPT_DEFAULT)) { - lua_assert(((JIT_F_OPT_FOLD|JIT_F_OPT_FWD|JIT_F_OPT_CSE|JIT_F_OPT_DSE) | - JIT_F_OPT_DEFAULT) == JIT_F_OPT_DEFAULT); - /* Folding disabled? Chain to CSE, but not for loads/stores/allocs. */ - if (!(J->flags & JIT_F_OPT_FOLD) && irm_kind(lj_ir_mode[fins->o]) == IRM_N) - return lj_opt_cse(J); - - /* No FOLD, forwarding or CSE? Emit raw IR for loads, except for SLOAD. */ - if ((J->flags & (JIT_F_OPT_FOLD|JIT_F_OPT_FWD|JIT_F_OPT_CSE)) != - (JIT_F_OPT_FOLD|JIT_F_OPT_FWD|JIT_F_OPT_CSE) && - irm_kind(lj_ir_mode[fins->o]) == IRM_L && fins->o != IR_SLOAD) - return lj_ir_emit(J); - - /* No FOLD or DSE? Emit raw IR for stores. */ - if ((J->flags & (JIT_F_OPT_FOLD|JIT_F_OPT_DSE)) != - (JIT_F_OPT_FOLD|JIT_F_OPT_DSE) && - irm_kind(lj_ir_mode[fins->o]) == IRM_S) - return lj_ir_emit(J); - } - - /* Fold engine start/retry point. */ -retry: - /* Construct key from opcode and operand opcodes (unless literal/none). */ - key = ((uint32_t)fins->o << 17); - if (fins->op1 >= J->cur.nk) { - key += (uint32_t)IR(fins->op1)->o << 10; - *fleft = *IR(fins->op1); - } - if (fins->op2 >= J->cur.nk) { - key += (uint32_t)IR(fins->op2)->o; - *fright = *IR(fins->op2); - } else { - key += (fins->op2 & 0x3ffu); /* Literal mask. Must include IRCONV_*MASK. */ - } - - /* Check for a match in order from most specific to least specific. */ - any = 0; - for (;;) { - uint32_t k = key | (any & 0x1ffff); - uint32_t h = fold_hashkey(k); - uint32_t fh = fold_hash[h]; /* Lookup key in semi-perfect hash table. */ - if ((fh & 0xffffff) == k || (fh = fold_hash[h+1], (fh & 0xffffff) == k)) { - ref = (IRRef)tref_ref(fold_func[fh >> 24](J)); - if (ref != NEXTFOLD) - break; - } - if (any == 0xfffff) /* Exhausted folding. Pass on to CSE. */ - return lj_opt_cse(J); - any = (any | (any >> 10)) ^ 0xffc00; - } - - /* Return value processing, ordered by frequency. */ - if (LJ_LIKELY(ref >= MAX_FOLD)) - return TREF(ref, irt_t(IR(ref)->t)); - if (ref == RETRYFOLD) - goto retry; - if (ref == KINTFOLD) - return lj_ir_kint(J, fins->i); - if (ref == FAILFOLD) - lj_trace_err(J, LJ_TRERR_GFAIL); - lua_assert(ref == DROPFOLD); - return REF_DROP; -} - -/* -- Common-Subexpression Elimination ------------------------------------ */ - -/* CSE an IR instruction. This is very fast due to the skip-list chains. */ -TRef LJ_FASTCALL lj_opt_cse(jit_State *J) -{ - /* Avoid narrow to wide store-to-load forwarding stall */ - IRRef2 op12 = (IRRef2)fins->op1 + ((IRRef2)fins->op2 << 16); - IROp op = fins->o; - if (LJ_LIKELY(J->flags & JIT_F_OPT_CSE)) { - /* Limited search for same operands in per-opcode chain. */ - IRRef ref = J->chain[op]; - IRRef lim = fins->op1; - if (fins->op2 > lim) lim = fins->op2; /* Relies on lit < REF_BIAS. */ - while (ref > lim) { - if (IR(ref)->op12 == op12) - return TREF(ref, irt_t(IR(ref)->t)); /* Common subexpression found. */ - ref = IR(ref)->prev; - } - } - /* Otherwise emit IR (inlined for speed). */ - { - IRRef ref = lj_ir_nextins(J); - IRIns *ir = IR(ref); - ir->prev = J->chain[op]; - ir->op12 = op12; - J->chain[op] = (IRRef1)ref; - ir->o = fins->o; - J->guardemit.irt |= fins->t.irt; - return TREF(ref, irt_t((ir->t = fins->t))); - } -} - -/* CSE with explicit search limit. */ -TRef LJ_FASTCALL lj_opt_cselim(jit_State *J, IRRef lim) -{ - IRRef ref = J->chain[fins->o]; - IRRef2 op12 = (IRRef2)fins->op1 + ((IRRef2)fins->op2 << 16); - while (ref > lim) { - if (IR(ref)->op12 == op12) - return ref; - ref = IR(ref)->prev; - } - return lj_ir_emit(J); -} - -/* ------------------------------------------------------------------------ */ - -#undef IR -#undef fins -#undef fleft -#undef fright -#undef knumleft -#undef knumright -#undef emitir - -#endif diff --git a/subprojects/luajit/src/lj_opt_loop.c b/subprojects/luajit/src/lj_opt_loop.c deleted file mode 100644 index 36317b346..000000000 --- a/subprojects/luajit/src/lj_opt_loop.c +++ /dev/null @@ -1,436 +0,0 @@ -/* -** LOOP: Loop Optimizations. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_opt_loop_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_err.h" -#include "lj_str.h" -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_iropt.h" -#include "lj_trace.h" -#include "lj_snap.h" -#include "lj_vm.h" - -/* Loop optimization: -** -** Traditional Loop-Invariant Code Motion (LICM) splits the instructions -** of a loop into invariant and variant instructions. The invariant -** instructions are hoisted out of the loop and only the variant -** instructions remain inside the loop body. -** -** Unfortunately LICM is mostly useless for compiling dynamic languages. -** The IR has many guards and most of the subsequent instructions are -** control-dependent on them. The first non-hoistable guard would -** effectively prevent hoisting of all subsequent instructions. -** -** That's why we use a special form of unrolling using copy-substitution, -** combined with redundancy elimination: -** -** The recorded instruction stream is re-emitted to the compiler pipeline -** with substituted operands. The substitution table is filled with the -** refs returned by re-emitting each instruction. This can be done -** on-the-fly, because the IR is in strict SSA form, where every ref is -** defined before its use. -** -** This aproach generates two code sections, separated by the LOOP -** instruction: -** -** 1. The recorded instructions form a kind of pre-roll for the loop. It -** contains a mix of invariant and variant instructions and performs -** exactly one loop iteration (but not necessarily the 1st iteration). -** -** 2. The loop body contains only the variant instructions and performs -** all remaining loop iterations. -** -** On first sight that looks like a waste of space, because the variant -** instructions are present twice. But the key insight is that the -** pre-roll honors the control-dependencies for *both* the pre-roll itself -** *and* the loop body! -** -** It also means one doesn't have to explicitly model control-dependencies -** (which, BTW, wouldn't help LICM much). And it's much easier to -** integrate sparse snapshotting with this approach. -** -** One of the nicest aspects of this approach is that all of the -** optimizations of the compiler pipeline (FOLD, CSE, FWD, etc.) can be -** reused with only minor restrictions (e.g. one should not fold -** instructions across loop-carried dependencies). -** -** But in general all optimizations can be applied which only need to look -** backwards into the generated instruction stream. At any point in time -** during the copy-substitution process this contains both a static loop -** iteration (the pre-roll) and a dynamic one (from the to-be-copied -** instruction up to the end of the partial loop body). -** -** Since control-dependencies are implicitly kept, CSE also applies to all -** kinds of guards. The major advantage is that all invariant guards can -** be hoisted, too. -** -** Load/store forwarding works across loop iterations, too. This is -** important if loop-carried dependencies are kept in upvalues or tables. -** E.g. 'self.idx = self.idx + 1' deep down in some OO-style method may -** become a forwarded loop-recurrence after inlining. -** -** Since the IR is in SSA form, loop-carried dependencies have to be -** modeled with PHI instructions. The potential candidates for PHIs are -** collected on-the-fly during copy-substitution. After eliminating the -** redundant ones, PHI instructions are emitted *below* the loop body. -** -** Note that this departure from traditional SSA form doesn't change the -** semantics of the PHI instructions themselves. But it greatly simplifies -** on-the-fly generation of the IR and the machine code. -*/ - -/* Some local macros to save typing. Undef'd at the end. */ -#define IR(ref) (&J->cur.ir[(ref)]) - -/* Pass IR on to next optimization in chain (FOLD). */ -#define emitir(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J)) - -/* Emit raw IR without passing through optimizations. */ -#define emitir_raw(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_ir_emit(J)) - -/* -- PHI elimination ----------------------------------------------------- */ - -/* Emit or eliminate collected PHIs. */ -static void loop_emit_phi(jit_State *J, IRRef1 *subst, IRRef1 *phi, IRRef nphi, - SnapNo onsnap) -{ - int passx = 0; - IRRef i, j, nslots; - IRRef invar = J->chain[IR_LOOP]; - /* Pass #1: mark redundant and potentially redundant PHIs. */ - for (i = 0, j = 0; i < nphi; i++) { - IRRef lref = phi[i]; - IRRef rref = subst[lref]; - if (lref == rref || rref == REF_DROP) { /* Invariants are redundant. */ - irt_clearphi(IR(lref)->t); - } else { - phi[j++] = (IRRef1)lref; - if (!(IR(rref)->op1 == lref || IR(rref)->op2 == lref)) { - /* Quick check for simple recurrences failed, need pass2. */ - irt_setmark(IR(lref)->t); - passx = 1; - } - } - } - nphi = j; - /* Pass #2: traverse variant part and clear marks of non-redundant PHIs. */ - if (passx) { - SnapNo s; - for (i = J->cur.nins-1; i > invar; i--) { - IRIns *ir = IR(i); - if (!irref_isk(ir->op2)) irt_clearmark(IR(ir->op2)->t); - if (!irref_isk(ir->op1)) { - irt_clearmark(IR(ir->op1)->t); - if (ir->op1 < invar && - ir->o >= IR_CALLN && ir->o <= IR_CARG) { /* ORDER IR */ - ir = IR(ir->op1); - while (ir->o == IR_CARG) { - if (!irref_isk(ir->op2)) irt_clearmark(IR(ir->op2)->t); - if (irref_isk(ir->op1)) break; - ir = IR(ir->op1); - irt_clearmark(ir->t); - } - } - } - } - for (s = J->cur.nsnap-1; s >= onsnap; s--) { - SnapShot *snap = &J->cur.snap[s]; - SnapEntry *map = &J->cur.snapmap[snap->mapofs]; - MSize n, nent = snap->nent; - for (n = 0; n < nent; n++) { - IRRef ref = snap_ref(map[n]); - if (!irref_isk(ref)) irt_clearmark(IR(ref)->t); - } - } - } - /* Pass #3: add PHIs for variant slots without a corresponding SLOAD. */ - nslots = J->baseslot+J->maxslot; - for (i = 1; i < nslots; i++) { - IRRef ref = tref_ref(J->slot[i]); - while (!irref_isk(ref) && ref != subst[ref]) { - IRIns *ir = IR(ref); - irt_clearmark(ir->t); /* Unmark potential uses, too. */ - if (irt_isphi(ir->t) || irt_ispri(ir->t)) - break; - irt_setphi(ir->t); - if (nphi >= LJ_MAX_PHI) - lj_trace_err(J, LJ_TRERR_PHIOV); - phi[nphi++] = (IRRef1)ref; - ref = subst[ref]; - if (ref > invar) - break; - } - } - /* Pass #4: propagate non-redundant PHIs. */ - while (passx) { - passx = 0; - for (i = 0; i < nphi; i++) { - IRRef lref = phi[i]; - IRIns *ir = IR(lref); - if (!irt_ismarked(ir->t)) { /* Propagate only from unmarked PHIs. */ - IRIns *irr = IR(subst[lref]); - if (irt_ismarked(irr->t)) { /* Right ref points to other PHI? */ - irt_clearmark(irr->t); /* Mark that PHI as non-redundant. */ - passx = 1; /* Retry. */ - } - } - } - } - /* Pass #5: emit PHI instructions or eliminate PHIs. */ - for (i = 0; i < nphi; i++) { - IRRef lref = phi[i]; - IRIns *ir = IR(lref); - if (!irt_ismarked(ir->t)) { /* Emit PHI if not marked. */ - IRRef rref = subst[lref]; - if (rref > invar) - irt_setphi(IR(rref)->t); - emitir_raw(IRT(IR_PHI, irt_type(ir->t)), lref, rref); - } else { /* Otherwise eliminate PHI. */ - irt_clearmark(ir->t); - irt_clearphi(ir->t); - } - } -} - -/* -- Loop unrolling using copy-substitution ------------------------------ */ - -/* Copy-substitute snapshot. */ -static void loop_subst_snap(jit_State *J, SnapShot *osnap, - SnapEntry *loopmap, IRRef1 *subst) -{ - SnapEntry *nmap, *omap = &J->cur.snapmap[osnap->mapofs]; - SnapEntry *nextmap = &J->cur.snapmap[snap_nextofs(&J->cur, osnap)]; - MSize nmapofs; - MSize on, ln, nn, onent = osnap->nent; - BCReg nslots = osnap->nslots; - SnapShot *snap = &J->cur.snap[J->cur.nsnap]; - if (irt_isguard(J->guardemit)) { /* Guard inbetween? */ - nmapofs = J->cur.nsnapmap; - J->cur.nsnap++; /* Add new snapshot. */ - } else { /* Otherwise overwrite previous snapshot. */ - snap--; - nmapofs = snap->mapofs; - } - J->guardemit.irt = 0; - /* Setup new snapshot. */ - snap->mapofs = (uint16_t)nmapofs; - snap->ref = (IRRef1)J->cur.nins; - snap->nslots = nslots; - snap->topslot = osnap->topslot; - snap->count = 0; - nmap = &J->cur.snapmap[nmapofs]; - /* Substitute snapshot slots. */ - on = ln = nn = 0; - while (on < onent) { - SnapEntry osn = omap[on], lsn = loopmap[ln]; - if (snap_slot(lsn) < snap_slot(osn)) { /* Copy slot from loop map. */ - nmap[nn++] = lsn; - ln++; - } else { /* Copy substituted slot from snapshot map. */ - if (snap_slot(lsn) == snap_slot(osn)) ln++; /* Shadowed loop slot. */ - if (!irref_isk(snap_ref(osn))) - osn = snap_setref(osn, subst[snap_ref(osn)]); - nmap[nn++] = osn; - on++; - } - } - while (snap_slot(loopmap[ln]) < nslots) /* Copy remaining loop slots. */ - nmap[nn++] = loopmap[ln++]; - snap->nent = (uint8_t)nn; - omap += onent; - nmap += nn; - while (omap < nextmap) /* Copy PC + frame links. */ - *nmap++ = *omap++; - J->cur.nsnapmap = (uint16_t)(nmap - J->cur.snapmap); -} - -/* Unroll loop. */ -static void loop_unroll(jit_State *J) -{ - IRRef1 phi[LJ_MAX_PHI]; - uint32_t nphi = 0; - IRRef1 *subst; - SnapNo onsnap; - SnapShot *osnap, *loopsnap; - SnapEntry *loopmap, *psentinel; - IRRef ins, invar; - - /* Use temp buffer for substitution table. - ** Only non-constant refs in [REF_BIAS,invar) are valid indexes. - ** Caveat: don't call into the VM or run the GC or the buffer may be gone. - */ - invar = J->cur.nins; - subst = (IRRef1 *)lj_str_needbuf(J->L, &G(J->L)->tmpbuf, - (invar-REF_BIAS)*sizeof(IRRef1)) - REF_BIAS; - subst[REF_BASE] = REF_BASE; - - /* LOOP separates the pre-roll from the loop body. */ - emitir_raw(IRTG(IR_LOOP, IRT_NIL), 0, 0); - - /* Grow snapshot buffer and map for copy-substituted snapshots. - ** Need up to twice the number of snapshots minus #0 and loop snapshot. - ** Need up to twice the number of entries plus fallback substitutions - ** from the loop snapshot entries for each new snapshot. - ** Caveat: both calls may reallocate J->cur.snap and J->cur.snapmap! - */ - onsnap = J->cur.nsnap; - lj_snap_grow_buf(J, 2*onsnap-2); - lj_snap_grow_map(J, J->cur.nsnapmap*2+(onsnap-2)*J->cur.snap[onsnap-1].nent); - - /* The loop snapshot is used for fallback substitutions. */ - loopsnap = &J->cur.snap[onsnap-1]; - loopmap = &J->cur.snapmap[loopsnap->mapofs]; - /* The PC of snapshot #0 and the loop snapshot must match. */ - psentinel = &loopmap[loopsnap->nent]; - lua_assert(*psentinel == J->cur.snapmap[J->cur.snap[0].nent]); - *psentinel = SNAP(255, 0, 0); /* Replace PC with temporary sentinel. */ - - /* Start substitution with snapshot #1 (#0 is empty for root traces). */ - osnap = &J->cur.snap[1]; - - /* Copy and substitute all recorded instructions and snapshots. */ - for (ins = REF_FIRST; ins < invar; ins++) { - IRIns *ir; - IRRef op1, op2; - - if (ins >= osnap->ref) /* Instruction belongs to next snapshot? */ - loop_subst_snap(J, osnap++, loopmap, subst); /* Copy-substitute it. */ - - /* Substitute instruction operands. */ - ir = IR(ins); - op1 = ir->op1; - if (!irref_isk(op1)) op1 = subst[op1]; - op2 = ir->op2; - if (!irref_isk(op2)) op2 = subst[op2]; - if (irm_kind(lj_ir_mode[ir->o]) == IRM_N && - op1 == ir->op1 && op2 == ir->op2) { /* Regular invariant ins? */ - subst[ins] = (IRRef1)ins; /* Shortcut. */ - } else { - /* Re-emit substituted instruction to the FOLD/CSE/etc. pipeline. */ - IRType1 t = ir->t; /* Get this first, since emitir may invalidate ir. */ - IRRef ref = tref_ref(emitir(ir->ot & ~IRT_ISPHI, op1, op2)); - subst[ins] = (IRRef1)ref; - if (ref != ins) { - IRIns *irr = IR(ref); - if (ref < invar) { /* Loop-carried dependency? */ - /* Potential PHI? */ - if (!irref_isk(ref) && !irt_isphi(irr->t) && !irt_ispri(irr->t)) { - irt_setphi(irr->t); - if (nphi >= LJ_MAX_PHI) - lj_trace_err(J, LJ_TRERR_PHIOV); - phi[nphi++] = (IRRef1)ref; - } - /* Check all loop-carried dependencies for type instability. */ - if (!irt_sametype(t, irr->t)) { - if (irt_isinteger(t) && irt_isinteger(irr->t)) - continue; - else if (irt_isnum(t) && irt_isinteger(irr->t)) /* Fix int->num. */ - ref = tref_ref(emitir(IRTN(IR_CONV), ref, IRCONV_NUM_INT)); - else if (irt_isnum(irr->t) && irt_isinteger(t)) /* Fix num->int. */ - ref = tref_ref(emitir(IRTGI(IR_CONV), ref, - IRCONV_INT_NUM|IRCONV_CHECK)); - else - lj_trace_err(J, LJ_TRERR_TYPEINS); - subst[ins] = (IRRef1)ref; - irr = IR(ref); - goto phiconv; - } - } else if (ref != REF_DROP && irr->o == IR_CONV && - ref > invar && irr->op1 < invar) { - /* May need an extra PHI for a CONV. */ - ref = irr->op1; - irr = IR(ref); - phiconv: - if (ref < invar && !irref_isk(ref) && !irt_isphi(irr->t)) { - irt_setphi(irr->t); - if (nphi >= LJ_MAX_PHI) - lj_trace_err(J, LJ_TRERR_PHIOV); - phi[nphi++] = (IRRef1)ref; - } - } - } - } - } - if (!irt_isguard(J->guardemit)) /* Drop redundant snapshot. */ - J->cur.nsnapmap = (uint16_t)J->cur.snap[--J->cur.nsnap].mapofs; - lua_assert(J->cur.nsnapmap <= J->sizesnapmap); - *psentinel = J->cur.snapmap[J->cur.snap[0].nent]; /* Restore PC. */ - - loop_emit_phi(J, subst, phi, nphi, onsnap); -} - -/* Undo any partial changes made by the loop optimization. */ -static void loop_undo(jit_State *J, IRRef ins, SnapNo nsnap, MSize nsnapmap) -{ - ptrdiff_t i; - SnapShot *snap = &J->cur.snap[nsnap-1]; - SnapEntry *map = J->cur.snapmap; - map[snap->mapofs + snap->nent] = map[J->cur.snap[0].nent]; /* Restore PC. */ - J->cur.nsnapmap = (uint16_t)nsnapmap; - J->cur.nsnap = nsnap; - J->guardemit.irt = 0; - lj_ir_rollback(J, ins); - for (i = 0; i < BPROP_SLOTS; i++) { /* Remove backprop. cache entries. */ - BPropEntry *bp = &J->bpropcache[i]; - if (bp->val >= ins) - bp->key = 0; - } - for (ins--; ins >= REF_FIRST; ins--) { /* Remove flags. */ - IRIns *ir = IR(ins); - irt_clearphi(ir->t); - irt_clearmark(ir->t); - } -} - -/* Protected callback for loop optimization. */ -static TValue *cploop_opt(lua_State *L, lua_CFunction dummy, void *ud) -{ - UNUSED(L); UNUSED(dummy); - loop_unroll((jit_State *)ud); - return NULL; -} - -/* Loop optimization. */ -int lj_opt_loop(jit_State *J) -{ - IRRef nins = J->cur.nins; - SnapNo nsnap = J->cur.nsnap; - MSize nsnapmap = J->cur.nsnapmap; - int errcode = lj_vm_cpcall(J->L, NULL, J, cploop_opt); - if (LJ_UNLIKELY(errcode)) { - lua_State *L = J->L; - if (errcode == LUA_ERRRUN && tvisnumber(L->top-1)) { /* Trace error? */ - int32_t e = numberVint(L->top-1); - switch ((TraceError)e) { - case LJ_TRERR_TYPEINS: /* Type instability. */ - case LJ_TRERR_GFAIL: /* Guard would always fail. */ - /* Unrolling via recording fixes many cases, e.g. a flipped boolean. */ - if (--J->instunroll < 0) /* But do not unroll forever. */ - break; - L->top--; /* Remove error object. */ - loop_undo(J, nins, nsnap, nsnapmap); - return 1; /* Loop optimization failed, continue recording. */ - default: - break; - } - } - lj_err_throw(L, errcode); /* Propagate all other errors. */ - } - return 0; /* Loop optimization is ok. */ -} - -#undef IR -#undef emitir -#undef emitir_raw - -#endif diff --git a/subprojects/luajit/src/lj_opt_mem.c b/subprojects/luajit/src/lj_opt_mem.c deleted file mode 100644 index 9f7140562..000000000 --- a/subprojects/luajit/src/lj_opt_mem.c +++ /dev/null @@ -1,916 +0,0 @@ -/* -** Memory access optimizations. -** AA: Alias Analysis using high-level semantic disambiguation. -** FWD: Load Forwarding (L2L) + Store Forwarding (S2L). -** DSE: Dead-Store Elimination. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_opt_mem_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_tab.h" -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_iropt.h" - -/* Some local macros to save typing. Undef'd at the end. */ -#define IR(ref) (&J->cur.ir[(ref)]) -#define fins (&J->fold.ins) -#define fleft (&J->fold.left) -#define fright (&J->fold.right) - -/* -** Caveat #1: return value is not always a TRef -- only use with tref_ref(). -** Caveat #2: FWD relies on active CSE for xREF operands -- see lj_opt_fold(). -*/ - -/* Return values from alias analysis. */ -typedef enum { - ALIAS_NO, /* The two refs CANNOT alias (exact). */ - ALIAS_MAY, /* The two refs MAY alias (inexact). */ - ALIAS_MUST /* The two refs MUST alias (exact). */ -} AliasRet; - -/* -- ALOAD/HLOAD forwarding and ASTORE/HSTORE elimination ---------------- */ - -/* Simplified escape analysis: check for intervening stores. */ -static AliasRet aa_escape(jit_State *J, IRIns *ir, IRIns *stop) -{ - IRRef ref = (IRRef)(ir - J->cur.ir); /* The ref that might be stored. */ - for (ir++; ir < stop; ir++) - if (ir->op2 == ref && - (ir->o == IR_ASTORE || ir->o == IR_HSTORE || - ir->o == IR_USTORE || ir->o == IR_FSTORE)) - return ALIAS_MAY; /* Reference was stored and might alias. */ - return ALIAS_NO; /* Reference was not stored. */ -} - -/* Alias analysis for two different table references. */ -static AliasRet aa_table(jit_State *J, IRRef ta, IRRef tb) -{ - IRIns *taba = IR(ta), *tabb = IR(tb); - int newa, newb; - lua_assert(ta != tb); - lua_assert(irt_istab(taba->t) && irt_istab(tabb->t)); - /* Disambiguate new allocations. */ - newa = (taba->o == IR_TNEW || taba->o == IR_TDUP); - newb = (tabb->o == IR_TNEW || tabb->o == IR_TDUP); - if (newa && newb) - return ALIAS_NO; /* Two different allocations never alias. */ - if (newb) { /* At least one allocation? */ - IRIns *tmp = taba; taba = tabb; tabb = tmp; - } else if (!newa) { - return ALIAS_MAY; /* Anything else: we just don't know. */ - } - return aa_escape(J, taba, tabb); -} - -/* Alias analysis for array and hash access using key-based disambiguation. */ -static AliasRet aa_ahref(jit_State *J, IRIns *refa, IRIns *refb) -{ - IRRef ka = refa->op2; - IRRef kb = refb->op2; - IRIns *keya, *keyb; - IRRef ta, tb; - if (refa == refb) - return ALIAS_MUST; /* Shortcut for same refs. */ - keya = IR(ka); - if (keya->o == IR_KSLOT) { ka = keya->op1; keya = IR(ka); } - keyb = IR(kb); - if (keyb->o == IR_KSLOT) { kb = keyb->op1; keyb = IR(kb); } - ta = (refa->o==IR_HREFK || refa->o==IR_AREF) ? IR(refa->op1)->op1 : refa->op1; - tb = (refb->o==IR_HREFK || refb->o==IR_AREF) ? IR(refb->op1)->op1 : refb->op1; - if (ka == kb) { - /* Same key. Check for same table with different ref (NEWREF vs. HREF). */ - if (ta == tb) - return ALIAS_MUST; /* Same key, same table. */ - else - return aa_table(J, ta, tb); /* Same key, possibly different table. */ - } - if (irref_isk(ka) && irref_isk(kb)) - return ALIAS_NO; /* Different constant keys. */ - if (refa->o == IR_AREF) { - /* Disambiguate array references based on index arithmetic. */ - int32_t ofsa = 0, ofsb = 0; - IRRef basea = ka, baseb = kb; - lua_assert(refb->o == IR_AREF); - /* Gather base and offset from t[base] or t[base+-ofs]. */ - if (keya->o == IR_ADD && irref_isk(keya->op2)) { - basea = keya->op1; - ofsa = IR(keya->op2)->i; - if (basea == kb && ofsa != 0) - return ALIAS_NO; /* t[base+-ofs] vs. t[base]. */ - } - if (keyb->o == IR_ADD && irref_isk(keyb->op2)) { - baseb = keyb->op1; - ofsb = IR(keyb->op2)->i; - if (ka == baseb && ofsb != 0) - return ALIAS_NO; /* t[base] vs. t[base+-ofs]. */ - } - if (basea == baseb && ofsa != ofsb) - return ALIAS_NO; /* t[base+-o1] vs. t[base+-o2] and o1 != o2. */ - } else { - /* Disambiguate hash references based on the type of their keys. */ - lua_assert((refa->o==IR_HREF || refa->o==IR_HREFK || refa->o==IR_NEWREF) && - (refb->o==IR_HREF || refb->o==IR_HREFK || refb->o==IR_NEWREF)); - if (!irt_sametype(keya->t, keyb->t)) - return ALIAS_NO; /* Different key types. */ - } - if (ta == tb) - return ALIAS_MAY; /* Same table, cannot disambiguate keys. */ - else - return aa_table(J, ta, tb); /* Try to disambiguate tables. */ -} - -/* Array and hash load forwarding. */ -static TRef fwd_ahload(jit_State *J, IRRef xref) -{ - IRIns *xr = IR(xref); - IRRef lim = xref; /* Search limit. */ - IRRef ref; - - /* Search for conflicting stores. */ - ref = J->chain[fins->o+IRDELTA_L2S]; - while (ref > xref) { - IRIns *store = IR(ref); - switch (aa_ahref(J, xr, IR(store->op1))) { - case ALIAS_NO: break; /* Continue searching. */ - case ALIAS_MAY: lim = ref; goto cselim; /* Limit search for load. */ - case ALIAS_MUST: return store->op2; /* Store forwarding. */ - } - ref = store->prev; - } - - /* No conflicting store (yet): const-fold loads from allocations. */ - { - IRIns *ir = (xr->o == IR_HREFK || xr->o == IR_AREF) ? IR(xr->op1) : xr; - IRRef tab = ir->op1; - ir = IR(tab); - if (ir->o == IR_TNEW || (ir->o == IR_TDUP && irref_isk(xr->op2))) { - /* A NEWREF with a number key may end up pointing to the array part. - ** But it's referenced from HSTORE and not found in the ASTORE chain. - ** For now simply consider this a conflict without forwarding anything. - */ - if (xr->o == IR_AREF) { - IRRef ref2 = J->chain[IR_NEWREF]; - while (ref2 > tab) { - IRIns *newref = IR(ref2); - if (irt_isnum(IR(newref->op2)->t)) - goto cselim; - ref2 = newref->prev; - } - } - /* NEWREF inhibits CSE for HREF, and dependent FLOADs from HREFK/AREF. - ** But the above search for conflicting stores was limited by xref. - ** So continue searching, limited by the TNEW/TDUP. Store forwarding - ** is ok, too. A conflict does NOT limit the search for a matching load. - */ - while (ref > tab) { - IRIns *store = IR(ref); - switch (aa_ahref(J, xr, IR(store->op1))) { - case ALIAS_NO: break; /* Continue searching. */ - case ALIAS_MAY: goto cselim; /* Conflicting store. */ - case ALIAS_MUST: return store->op2; /* Store forwarding. */ - } - ref = store->prev; - } - lua_assert(ir->o != IR_TNEW || irt_isnil(fins->t)); - if (irt_ispri(fins->t)) { - return TREF_PRI(irt_type(fins->t)); - } else if (irt_isnum(fins->t) || (LJ_DUALNUM && irt_isint(fins->t)) || - irt_isstr(fins->t)) { - TValue keyv; - cTValue *tv; - IRIns *key = IR(xr->op2); - if (key->o == IR_KSLOT) key = IR(key->op1); - lj_ir_kvalue(J->L, &keyv, key); - tv = lj_tab_get(J->L, ir_ktab(IR(ir->op1)), &keyv); - lua_assert(itype2irt(tv) == irt_type(fins->t)); - if (irt_isnum(fins->t)) - return lj_ir_knum_u64(J, tv->u64); - else if (LJ_DUALNUM && irt_isint(fins->t)) - return lj_ir_kint(J, intV(tv)); - else - return lj_ir_kstr(J, strV(tv)); - } - /* Othwerwise: don't intern as a constant. */ - } - } - -cselim: - /* Try to find a matching load. Below the conflicting store, if any. */ - ref = J->chain[fins->o]; - while (ref > lim) { - IRIns *load = IR(ref); - if (load->op1 == xref) - return ref; /* Load forwarding. */ - ref = load->prev; - } - return 0; /* Conflict or no match. */ -} - -/* Reassociate ALOAD across PHIs to handle t[i-1] forwarding case. */ -static TRef fwd_aload_reassoc(jit_State *J) -{ - IRIns *irx = IR(fins->op1); - IRIns *key = IR(irx->op2); - if (key->o == IR_ADD && irref_isk(key->op2)) { - IRIns *add2 = IR(key->op1); - if (add2->o == IR_ADD && irref_isk(add2->op2) && - IR(key->op2)->i == -IR(add2->op2)->i) { - IRRef ref = J->chain[IR_AREF]; - IRRef lim = add2->op1; - if (irx->op1 > lim) lim = irx->op1; - while (ref > lim) { - IRIns *ir = IR(ref); - if (ir->op1 == irx->op1 && ir->op2 == add2->op1) - return fwd_ahload(J, ref); - ref = ir->prev; - } - } - } - return 0; -} - -/* ALOAD forwarding. */ -TRef LJ_FASTCALL lj_opt_fwd_aload(jit_State *J) -{ - IRRef ref; - if ((ref = fwd_ahload(J, fins->op1)) || - (ref = fwd_aload_reassoc(J))) - return ref; - return EMITFOLD; -} - -/* HLOAD forwarding. */ -TRef LJ_FASTCALL lj_opt_fwd_hload(jit_State *J) -{ - IRRef ref = fwd_ahload(J, fins->op1); - if (ref) - return ref; - return EMITFOLD; -} - -/* HREFK forwarding. */ -TRef LJ_FASTCALL lj_opt_fwd_hrefk(jit_State *J) -{ - IRRef tab = fleft->op1; - IRRef ref = J->chain[IR_NEWREF]; - while (ref > tab) { - IRIns *newref = IR(ref); - if (tab == newref->op1) { - if (fright->op1 == newref->op2) - return ref; /* Forward from NEWREF. */ - else - goto docse; - } else if (aa_table(J, tab, newref->op1) != ALIAS_NO) { - goto docse; - } - ref = newref->prev; - } - /* No conflicting NEWREF: key location unchanged for HREFK of TDUP. */ - if (IR(tab)->o == IR_TDUP) - fins->t.irt &= ~IRT_GUARD; /* Drop HREFK guard. */ -docse: - return CSEFOLD; -} - -/* Check whether HREF of TNEW/TDUP can be folded to niltv. */ -int LJ_FASTCALL lj_opt_fwd_href_nokey(jit_State *J) -{ - IRRef lim = fins->op1; /* Search limit. */ - IRRef ref; - - /* The key for an ASTORE may end up in the hash part after a NEWREF. */ - if (irt_isnum(fright->t) && J->chain[IR_NEWREF] > lim) { - ref = J->chain[IR_ASTORE]; - while (ref > lim) { - if (ref < J->chain[IR_NEWREF]) - return 0; /* Conflict. */ - ref = IR(ref)->prev; - } - } - - /* Search for conflicting stores. */ - ref = J->chain[IR_HSTORE]; - while (ref > lim) { - IRIns *store = IR(ref); - if (aa_ahref(J, fins, IR(store->op1)) != ALIAS_NO) - return 0; /* Conflict. */ - ref = store->prev; - } - - return 1; /* No conflict. Can fold to niltv. */ -} - -/* Check whether there's no aliasing NEWREF for the left operand. */ -int LJ_FASTCALL lj_opt_fwd_tptr(jit_State *J, IRRef lim) -{ - IRRef ta = fins->op1; - IRRef ref = J->chain[IR_NEWREF]; - while (ref > lim) { - IRIns *newref = IR(ref); - if (ta == newref->op1 || aa_table(J, ta, newref->op1) != ALIAS_NO) - return 0; /* Conflict. */ - ref = newref->prev; - } - return 1; /* No conflict. Can safely FOLD/CSE. */ -} - -/* ASTORE/HSTORE elimination. */ -TRef LJ_FASTCALL lj_opt_dse_ahstore(jit_State *J) -{ - IRRef xref = fins->op1; /* xREF reference. */ - IRRef val = fins->op2; /* Stored value reference. */ - IRIns *xr = IR(xref); - IRRef1 *refp = &J->chain[fins->o]; - IRRef ref = *refp; - while (ref > xref) { /* Search for redundant or conflicting stores. */ - IRIns *store = IR(ref); - switch (aa_ahref(J, xr, IR(store->op1))) { - case ALIAS_NO: - break; /* Continue searching. */ - case ALIAS_MAY: /* Store to MAYBE the same location. */ - if (store->op2 != val) /* Conflict if the value is different. */ - goto doemit; - break; /* Otherwise continue searching. */ - case ALIAS_MUST: /* Store to the same location. */ - if (store->op2 == val) /* Same value: drop the new store. */ - return DROPFOLD; - /* Different value: try to eliminate the redundant store. */ - if (ref > J->chain[IR_LOOP]) { /* Quick check to avoid crossing LOOP. */ - IRIns *ir; - /* Check for any intervening guards (includes conflicting loads). */ - for (ir = IR(J->cur.nins-1); ir > store; ir--) - if (irt_isguard(ir->t) || ir->o == IR_CALLL) - goto doemit; /* No elimination possible. */ - /* Remove redundant store from chain and replace with NOP. */ - *refp = store->prev; - store->o = IR_NOP; - store->t.irt = IRT_NIL; - store->op1 = store->op2 = 0; - store->prev = 0; - /* Now emit the new store instead. */ - } - goto doemit; - } - ref = *(refp = &store->prev); - } -doemit: - return EMITFOLD; /* Otherwise we have a conflict or simply no match. */ -} - -/* -- ULOAD forwarding ---------------------------------------------------- */ - -/* The current alias analysis for upvalues is very simplistic. It only -** disambiguates between the unique upvalues of the same function. -** This is good enough for now, since most upvalues are read-only. -** -** A more precise analysis would be feasible with the help of the parser: -** generate a unique key for every upvalue, even across all prototypes. -** Lacking a realistic use-case, it's unclear whether this is beneficial. -*/ -static AliasRet aa_uref(IRIns *refa, IRIns *refb) -{ - if (refa->o != refb->o) - return ALIAS_NO; /* Different UREFx type. */ - if (refa->op1 == refb->op1) { /* Same function. */ - if (refa->op2 == refb->op2) - return ALIAS_MUST; /* Same function, same upvalue idx. */ - else - return ALIAS_NO; /* Same function, different upvalue idx. */ - } else { /* Different functions, check disambiguation hash values. */ - if (((refa->op2 ^ refb->op2) & 0xff)) - return ALIAS_NO; /* Upvalues with different hash values cannot alias. */ - else - return ALIAS_MAY; /* No conclusion can be drawn for same hash value. */ - } -} - -/* ULOAD forwarding. */ -TRef LJ_FASTCALL lj_opt_fwd_uload(jit_State *J) -{ - IRRef uref = fins->op1; - IRRef lim = REF_BASE; /* Search limit. */ - IRIns *xr = IR(uref); - IRRef ref; - - /* Search for conflicting stores. */ - ref = J->chain[IR_USTORE]; - while (ref > lim) { - IRIns *store = IR(ref); - switch (aa_uref(xr, IR(store->op1))) { - case ALIAS_NO: break; /* Continue searching. */ - case ALIAS_MAY: lim = ref; goto cselim; /* Limit search for load. */ - case ALIAS_MUST: return store->op2; /* Store forwarding. */ - } - ref = store->prev; - } - -cselim: - /* Try to find a matching load. Below the conflicting store, if any. */ - - ref = J->chain[IR_ULOAD]; - while (ref > lim) { - IRIns *ir = IR(ref); - if (ir->op1 == uref || - (IR(ir->op1)->op12 == IR(uref)->op12 && IR(ir->op1)->o == IR(uref)->o)) - return ref; /* Match for identical or equal UREFx (non-CSEable UREFO). */ - ref = ir->prev; - } - return lj_ir_emit(J); -} - -/* USTORE elimination. */ -TRef LJ_FASTCALL lj_opt_dse_ustore(jit_State *J) -{ - IRRef xref = fins->op1; /* xREF reference. */ - IRRef val = fins->op2; /* Stored value reference. */ - IRIns *xr = IR(xref); - IRRef1 *refp = &J->chain[IR_USTORE]; - IRRef ref = *refp; - while (ref > xref) { /* Search for redundant or conflicting stores. */ - IRIns *store = IR(ref); - switch (aa_uref(xr, IR(store->op1))) { - case ALIAS_NO: - break; /* Continue searching. */ - case ALIAS_MAY: /* Store to MAYBE the same location. */ - if (store->op2 != val) /* Conflict if the value is different. */ - goto doemit; - break; /* Otherwise continue searching. */ - case ALIAS_MUST: /* Store to the same location. */ - if (store->op2 == val) /* Same value: drop the new store. */ - return DROPFOLD; - /* Different value: try to eliminate the redundant store. */ - if (ref > J->chain[IR_LOOP]) { /* Quick check to avoid crossing LOOP. */ - IRIns *ir; - /* Check for any intervening guards (includes conflicting loads). */ - for (ir = IR(J->cur.nins-1); ir > store; ir--) - if (irt_isguard(ir->t)) - goto doemit; /* No elimination possible. */ - /* Remove redundant store from chain and replace with NOP. */ - *refp = store->prev; - store->o = IR_NOP; - store->t.irt = IRT_NIL; - store->op1 = store->op2 = 0; - store->prev = 0; - if (ref+1 < J->cur.nins && - store[1].o == IR_OBAR && store[1].op1 == xref) { - IRRef1 *bp = &J->chain[IR_OBAR]; - IRIns *obar; - for (obar = IR(*bp); *bp > ref+1; obar = IR(*bp)) - bp = &obar->prev; - /* Remove OBAR, too. */ - *bp = obar->prev; - obar->o = IR_NOP; - obar->t.irt = IRT_NIL; - obar->op1 = obar->op2 = 0; - obar->prev = 0; - } - /* Now emit the new store instead. */ - } - goto doemit; - } - ref = *(refp = &store->prev); - } -doemit: - return EMITFOLD; /* Otherwise we have a conflict or simply no match. */ -} - -/* -- FLOAD forwarding and FSTORE elimination ----------------------------- */ - -/* Alias analysis for field access. -** Field loads are cheap and field stores are rare. -** Simple disambiguation based on field types is good enough. -*/ -static AliasRet aa_fref(jit_State *J, IRIns *refa, IRIns *refb) -{ - if (refa->op2 != refb->op2) - return ALIAS_NO; /* Different fields. */ - if (refa->op1 == refb->op1) - return ALIAS_MUST; /* Same field, same object. */ - else if (refa->op2 >= IRFL_TAB_META && refa->op2 <= IRFL_TAB_NOMM) - return aa_table(J, refa->op1, refb->op1); /* Disambiguate tables. */ - else - return ALIAS_MAY; /* Same field, possibly different object. */ -} - -/* Only the loads for mutable fields end up here (see FOLD). */ -TRef LJ_FASTCALL lj_opt_fwd_fload(jit_State *J) -{ - IRRef oref = fins->op1; /* Object reference. */ - IRRef fid = fins->op2; /* Field ID. */ - IRRef lim = oref; /* Search limit. */ - IRRef ref; - - /* Search for conflicting stores. */ - ref = J->chain[IR_FSTORE]; - while (ref > oref) { - IRIns *store = IR(ref); - switch (aa_fref(J, fins, IR(store->op1))) { - case ALIAS_NO: break; /* Continue searching. */ - case ALIAS_MAY: lim = ref; goto cselim; /* Limit search for load. */ - case ALIAS_MUST: return store->op2; /* Store forwarding. */ - } - ref = store->prev; - } - - /* No conflicting store: const-fold field loads from allocations. */ - if (fid == IRFL_TAB_META) { - IRIns *ir = IR(oref); - if (ir->o == IR_TNEW || ir->o == IR_TDUP) - return lj_ir_knull(J, IRT_TAB); - } - -cselim: - /* Try to find a matching load. Below the conflicting store, if any. */ - return lj_opt_cselim(J, lim); -} - -/* FSTORE elimination. */ -TRef LJ_FASTCALL lj_opt_dse_fstore(jit_State *J) -{ - IRRef fref = fins->op1; /* FREF reference. */ - IRRef val = fins->op2; /* Stored value reference. */ - IRIns *xr = IR(fref); - IRRef1 *refp = &J->chain[IR_FSTORE]; - IRRef ref = *refp; - while (ref > fref) { /* Search for redundant or conflicting stores. */ - IRIns *store = IR(ref); - switch (aa_fref(J, xr, IR(store->op1))) { - case ALIAS_NO: - break; /* Continue searching. */ - case ALIAS_MAY: - if (store->op2 != val) /* Conflict if the value is different. */ - goto doemit; - break; /* Otherwise continue searching. */ - case ALIAS_MUST: - if (store->op2 == val) /* Same value: drop the new store. */ - return DROPFOLD; - /* Different value: try to eliminate the redundant store. */ - if (ref > J->chain[IR_LOOP]) { /* Quick check to avoid crossing LOOP. */ - IRIns *ir; - /* Check for any intervening guards or conflicting loads. */ - for (ir = IR(J->cur.nins-1); ir > store; ir--) - if (irt_isguard(ir->t) || (ir->o == IR_FLOAD && ir->op2 == xr->op2)) - goto doemit; /* No elimination possible. */ - /* Remove redundant store from chain and replace with NOP. */ - *refp = store->prev; - store->o = IR_NOP; - store->t.irt = IRT_NIL; - store->op1 = store->op2 = 0; - store->prev = 0; - /* Now emit the new store instead. */ - } - goto doemit; - } - ref = *(refp = &store->prev); - } -doemit: - return EMITFOLD; /* Otherwise we have a conflict or simply no match. */ -} - -/* -- XLOAD forwarding and XSTORE elimination ----------------------------- */ - -/* Find cdata allocation for a reference (if any). */ -static IRIns *aa_findcnew(jit_State *J, IRIns *ir) -{ - while (ir->o == IR_ADD) { - if (!irref_isk(ir->op1)) { - IRIns *ir1 = aa_findcnew(J, IR(ir->op1)); /* Left-recursion. */ - if (ir1) return ir1; - } - if (irref_isk(ir->op2)) return NULL; - ir = IR(ir->op2); /* Flatten right-recursion. */ - } - return ir->o == IR_CNEW ? ir : NULL; -} - -/* Alias analysis for two cdata allocations. */ -static AliasRet aa_cnew(jit_State *J, IRIns *refa, IRIns *refb) -{ - IRIns *cnewa = aa_findcnew(J, refa); - IRIns *cnewb = aa_findcnew(J, refb); - if (cnewa == cnewb) - return ALIAS_MAY; /* Same allocation or neither is an allocation. */ - if (cnewa && cnewb) - return ALIAS_NO; /* Two different allocations never alias. */ - if (cnewb) { cnewa = cnewb; refb = refa; } - return aa_escape(J, cnewa, refb); -} - -/* Alias analysis for XLOAD/XSTORE. */ -static AliasRet aa_xref(jit_State *J, IRIns *refa, IRIns *xa, IRIns *xb) -{ - ptrdiff_t ofsa = 0, ofsb = 0; - IRIns *refb = IR(xb->op1); - IRIns *basea = refa, *baseb = refb; - if (refa == refb && irt_sametype(xa->t, xb->t)) - return ALIAS_MUST; /* Shortcut for same refs with identical type. */ - /* Offset-based disambiguation. */ - if (refa->o == IR_ADD && irref_isk(refa->op2)) { - IRIns *irk = IR(refa->op2); - basea = IR(refa->op1); - ofsa = (LJ_64 && irk->o == IR_KINT64) ? (ptrdiff_t)ir_k64(irk)->u64 : - (ptrdiff_t)irk->i; - } - if (refb->o == IR_ADD && irref_isk(refb->op2)) { - IRIns *irk = IR(refb->op2); - baseb = IR(refb->op1); - ofsb = (LJ_64 && irk->o == IR_KINT64) ? (ptrdiff_t)ir_k64(irk)->u64 : - (ptrdiff_t)irk->i; - } - /* Treat constified pointers like base vs. base+offset. */ - if (basea->o == IR_KPTR && baseb->o == IR_KPTR) { - ofsb += (char *)ir_kptr(baseb) - (char *)ir_kptr(basea); - baseb = basea; - } - /* This implements (very) strict aliasing rules. - ** Different types do NOT alias, except for differences in signedness. - ** Type punning through unions is allowed (but forces a reload). - */ - if (basea == baseb) { - ptrdiff_t sza = irt_size(xa->t), szb = irt_size(xb->t); - if (ofsa == ofsb) { - if (sza == szb && irt_isfp(xa->t) == irt_isfp(xb->t)) - return ALIAS_MUST; /* Same-sized, same-kind. May need to convert. */ - } else if (ofsa + sza <= ofsb || ofsb + szb <= ofsa) { - return ALIAS_NO; /* Non-overlapping base+-o1 vs. base+-o2. */ - } - /* NYI: extract, extend or reinterpret bits (int <-> fp). */ - return ALIAS_MAY; /* Overlapping or type punning: force reload. */ - } - if (!irt_sametype(xa->t, xb->t) && - !(irt_typerange(xa->t, IRT_I8, IRT_U64) && - ((xa->t.irt - IRT_I8) ^ (xb->t.irt - IRT_I8)) == 1)) - return ALIAS_NO; - /* NYI: structural disambiguation. */ - return aa_cnew(J, basea, baseb); /* Try to disambiguate allocations. */ -} - -/* Return CSEd reference or 0. Caveat: swaps lower ref to the right! */ -static IRRef reassoc_trycse(jit_State *J, IROp op, IRRef op1, IRRef op2) -{ - IRRef ref = J->chain[op]; - IRRef lim = op1; - if (op2 > lim) { lim = op2; op2 = op1; op1 = lim; } - while (ref > lim) { - IRIns *ir = IR(ref); - if (ir->op1 == op1 && ir->op2 == op2) - return ref; - ref = ir->prev; - } - return 0; -} - -/* Reassociate index references. */ -static IRRef reassoc_xref(jit_State *J, IRIns *ir) -{ - ptrdiff_t ofs = 0; - if (ir->o == IR_ADD && irref_isk(ir->op2)) { /* Get constant offset. */ - IRIns *irk = IR(ir->op2); - ofs = (LJ_64 && irk->o == IR_KINT64) ? (ptrdiff_t)ir_k64(irk)->u64 : - (ptrdiff_t)irk->i; - ir = IR(ir->op1); - } - if (ir->o == IR_ADD) { /* Add of base + index. */ - /* Index ref > base ref for loop-carried dependences. Only check op1. */ - IRIns *ir2, *ir1 = IR(ir->op1); - int32_t shift = 0; - IRRef idxref; - /* Determine index shifts. Don't bother with IR_MUL here. */ - if (ir1->o == IR_BSHL && irref_isk(ir1->op2)) - shift = IR(ir1->op2)->i; - else if (ir1->o == IR_ADD && ir1->op1 == ir1->op2) - shift = 1; - else - ir1 = ir; - ir2 = IR(ir1->op1); - /* A non-reassociated add. Must be a loop-carried dependence. */ - if (ir2->o == IR_ADD && irt_isint(ir2->t) && irref_isk(ir2->op2)) - ofs += (ptrdiff_t)IR(ir2->op2)->i << shift; - else - return 0; - idxref = ir2->op1; - /* Try to CSE the reassociated chain. Give up if not found. */ - if (ir1 != ir && - !(idxref = reassoc_trycse(J, ir1->o, idxref, - ir1->o == IR_BSHL ? ir1->op2 : idxref))) - return 0; - if (!(idxref = reassoc_trycse(J, IR_ADD, idxref, ir->op2))) - return 0; - if (ofs != 0) { - IRRef refk = tref_ref(lj_ir_kintp(J, ofs)); - if (!(idxref = reassoc_trycse(J, IR_ADD, idxref, refk))) - return 0; - } - return idxref; /* Success, found a reassociated index reference. Phew. */ - } - return 0; /* Failure. */ -} - -/* XLOAD forwarding. */ -TRef LJ_FASTCALL lj_opt_fwd_xload(jit_State *J) -{ - IRRef xref = fins->op1; - IRIns *xr = IR(xref); - IRRef lim = xref; /* Search limit. */ - IRRef ref; - - if ((fins->op2 & IRXLOAD_READONLY)) - goto cselim; - if ((fins->op2 & IRXLOAD_VOLATILE)) - goto doemit; - - /* Search for conflicting stores. */ - ref = J->chain[IR_XSTORE]; -retry: - if (J->chain[IR_CALLXS] > lim) lim = J->chain[IR_CALLXS]; - if (J->chain[IR_XBAR] > lim) lim = J->chain[IR_XBAR]; - while (ref > lim) { - IRIns *store = IR(ref); - switch (aa_xref(J, xr, fins, store)) { - case ALIAS_NO: break; /* Continue searching. */ - case ALIAS_MAY: lim = ref; goto cselim; /* Limit search for load. */ - case ALIAS_MUST: - /* Emit conversion if the loaded type doesn't match the forwarded type. */ - if (!irt_sametype(fins->t, IR(store->op2)->t)) { - IRType dt = irt_type(fins->t), st = irt_type(IR(store->op2)->t); - if (dt == IRT_I8 || dt == IRT_I16) { /* Trunc + sign-extend. */ - st = dt | IRCONV_SEXT; - dt = IRT_INT; - } else if (dt == IRT_U8 || dt == IRT_U16) { /* Trunc + zero-extend. */ - st = dt; - dt = IRT_INT; - } - fins->ot = IRT(IR_CONV, dt); - fins->op1 = store->op2; - fins->op2 = (dt<<5)|st; - return RETRYFOLD; - } - return store->op2; /* Store forwarding. */ - } - ref = store->prev; - } - -cselim: - /* Try to find a matching load. Below the conflicting store, if any. */ - ref = J->chain[IR_XLOAD]; - while (ref > lim) { - /* CSE for XLOAD depends on the type, but not on the IRXLOAD_* flags. */ - if (IR(ref)->op1 == xref && irt_sametype(IR(ref)->t, fins->t)) - return ref; - ref = IR(ref)->prev; - } - - /* Reassociate XLOAD across PHIs to handle a[i-1] forwarding case. */ - if (!(fins->op2 & IRXLOAD_READONLY) && J->chain[IR_LOOP] && - xref == fins->op1 && (xref = reassoc_xref(J, xr)) != 0) { - ref = J->chain[IR_XSTORE]; - while (ref > lim) /* Skip stores that have already been checked. */ - ref = IR(ref)->prev; - lim = xref; - xr = IR(xref); - goto retry; /* Retry with the reassociated reference. */ - } -doemit: - return EMITFOLD; -} - -/* XSTORE elimination. */ -TRef LJ_FASTCALL lj_opt_dse_xstore(jit_State *J) -{ - IRRef xref = fins->op1; - IRIns *xr = IR(xref); - IRRef lim = xref; /* Search limit. */ - IRRef val = fins->op2; /* Stored value reference. */ - IRRef1 *refp = &J->chain[IR_XSTORE]; - IRRef ref = *refp; - if (J->chain[IR_CALLXS] > lim) lim = J->chain[IR_CALLXS]; - if (J->chain[IR_XBAR] > lim) lim = J->chain[IR_XBAR]; - if (J->chain[IR_XSNEW] > lim) lim = J->chain[IR_XSNEW]; - while (ref > lim) { /* Search for redundant or conflicting stores. */ - IRIns *store = IR(ref); - switch (aa_xref(J, xr, fins, store)) { - case ALIAS_NO: - break; /* Continue searching. */ - case ALIAS_MAY: - if (store->op2 != val) /* Conflict if the value is different. */ - goto doemit; - break; /* Otherwise continue searching. */ - case ALIAS_MUST: - if (store->op2 == val) /* Same value: drop the new store. */ - return DROPFOLD; - /* Different value: try to eliminate the redundant store. */ - if (ref > J->chain[IR_LOOP]) { /* Quick check to avoid crossing LOOP. */ - IRIns *ir; - /* Check for any intervening guards or any XLOADs (no AA performed). */ - for (ir = IR(J->cur.nins-1); ir > store; ir--) - if (irt_isguard(ir->t) || ir->o == IR_XLOAD) - goto doemit; /* No elimination possible. */ - /* Remove redundant store from chain and replace with NOP. */ - *refp = store->prev; - store->o = IR_NOP; - store->t.irt = IRT_NIL; - store->op1 = store->op2 = 0; - store->prev = 0; - /* Now emit the new store instead. */ - } - goto doemit; - } - ref = *(refp = &store->prev); - } -doemit: - return EMITFOLD; /* Otherwise we have a conflict or simply no match. */ -} - -/* -- Forwarding of lj_tab_len -------------------------------------------- */ - -/* This is rather simplistic right now, but better than nothing. */ -TRef LJ_FASTCALL lj_opt_fwd_tab_len(jit_State *J) -{ - IRRef tab = fins->op1; /* Table reference. */ - IRRef lim = tab; /* Search limit. */ - IRRef ref; - - /* Any ASTORE is a conflict and limits the search. */ - if (J->chain[IR_ASTORE] > lim) lim = J->chain[IR_ASTORE]; - - /* Search for conflicting HSTORE with numeric key. */ - ref = J->chain[IR_HSTORE]; - while (ref > lim) { - IRIns *store = IR(ref); - IRIns *href = IR(store->op1); - IRIns *key = IR(href->op2); - if (irt_isnum(key->o == IR_KSLOT ? IR(key->op1)->t : key->t)) { - lim = ref; /* Conflicting store found, limits search for TLEN. */ - break; - } - ref = store->prev; - } - - /* Try to find a matching load. Below the conflicting store, if any. */ - return lj_opt_cselim(J, lim); -} - -/* -- ASTORE/HSTORE previous type analysis -------------------------------- */ - -/* Check whether the previous value for a table store is non-nil. -** This can be derived either from a previous store or from a previous -** load (because all loads from tables perform a type check). -** -** The result of the analysis can be used to avoid the metatable check -** and the guard against HREF returning niltv. Both of these are cheap, -** so let's not spend too much effort on the analysis. -** -** A result of 1 is exact: previous value CANNOT be nil. -** A result of 0 is inexact: previous value MAY be nil. -*/ -int lj_opt_fwd_wasnonnil(jit_State *J, IROpT loadop, IRRef xref) -{ - /* First check stores. */ - IRRef ref = J->chain[loadop+IRDELTA_L2S]; - while (ref > xref) { - IRIns *store = IR(ref); - if (store->op1 == xref) { /* Same xREF. */ - /* A nil store MAY alias, but a non-nil store MUST alias. */ - return !irt_isnil(store->t); - } else if (irt_isnil(store->t)) { /* Must check any nil store. */ - IRRef skref = IR(store->op1)->op2; - IRRef xkref = IR(xref)->op2; - /* Same key type MAY alias. Need ALOAD check due to multiple int types. */ - if (loadop == IR_ALOAD || irt_sametype(IR(skref)->t, IR(xkref)->t)) { - if (skref == xkref || !irref_isk(skref) || !irref_isk(xkref)) - return 0; /* A nil store with same const key or var key MAY alias. */ - /* Different const keys CANNOT alias. */ - } /* Different key types CANNOT alias. */ - } /* Other non-nil stores MAY alias. */ - ref = store->prev; - } - - /* Check loads since nothing could be derived from stores. */ - ref = J->chain[loadop]; - while (ref > xref) { - IRIns *load = IR(ref); - if (load->op1 == xref) { /* Same xREF. */ - /* A nil load MAY alias, but a non-nil load MUST alias. */ - return !irt_isnil(load->t); - } /* Other non-nil loads MAY alias. */ - ref = load->prev; - } - return 0; /* Nothing derived at all, previous value MAY be nil. */ -} - -/* ------------------------------------------------------------------------ */ - -#undef IR -#undef fins -#undef fleft -#undef fright - -#endif diff --git a/subprojects/luajit/src/lj_opt_narrow.c b/subprojects/luajit/src/lj_opt_narrow.c deleted file mode 100644 index 73365953b..000000000 --- a/subprojects/luajit/src/lj_opt_narrow.c +++ /dev/null @@ -1,654 +0,0 @@ -/* -** NARROW: Narrowing of numbers to integers (double to int32_t). -** STRIPOV: Stripping of overflow checks. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_opt_narrow_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_bc.h" -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_iropt.h" -#include "lj_trace.h" -#include "lj_vm.h" -#include "lj_strscan.h" - -/* Rationale for narrowing optimizations: -** -** Lua has only a single number type and this is a FP double by default. -** Narrowing doubles to integers does not pay off for the interpreter on a -** current-generation x86/x64 machine. Most FP operations need the same -** amount of execution resources as their integer counterparts, except -** with slightly longer latencies. Longer latencies are a non-issue for -** the interpreter, since they are usually hidden by other overhead. -** -** The total CPU execution bandwidth is the sum of the bandwidth of the FP -** and the integer units, because they execute in parallel. The FP units -** have an equal or higher bandwidth than the integer units. Not using -** them means losing execution bandwidth. Moving work away from them to -** the already quite busy integer units is a losing proposition. -** -** The situation for JIT-compiled code is a bit different: the higher code -** density makes the extra latencies much more visible. Tight loops expose -** the latencies for updating the induction variables. Array indexing -** requires narrowing conversions with high latencies and additional -** guards (to check that the index is really an integer). And many common -** optimizations only work on integers. -** -** One solution would be speculative, eager narrowing of all number loads. -** This causes many problems, like losing -0 or the need to resolve type -** mismatches between traces. It also effectively forces the integer type -** to have overflow-checking semantics. This impedes many basic -** optimizations and requires adding overflow checks to all integer -** arithmetic operations (whereas FP arithmetics can do without). -** -** Always replacing an FP op with an integer op plus an overflow check is -** counter-productive on a current-generation super-scalar CPU. Although -** the overflow check branches are highly predictable, they will clog the -** execution port for the branch unit and tie up reorder buffers. This is -** turning a pure data-flow dependency into a different data-flow -** dependency (with slightly lower latency) *plus* a control dependency. -** In general, you don't want to do this since latencies due to data-flow -** dependencies can be well hidden by out-of-order execution. -** -** A better solution is to keep all numbers as FP values and only narrow -** when it's beneficial to do so. LuaJIT uses predictive narrowing for -** induction variables and demand-driven narrowing for index expressions, -** integer arguments and bit operations. Additionally it can eliminate or -** hoist most of the resulting overflow checks. Regular arithmetic -** computations are never narrowed to integers. -** -** The integer type in the IR has convenient wrap-around semantics and -** ignores overflow. Extra operations have been added for -** overflow-checking arithmetic (ADDOV/SUBOV) instead of an extra type. -** Apart from reducing overall complexity of the compiler, this also -** nicely solves the problem where you want to apply algebraic -** simplifications to ADD, but not to ADDOV. And the x86/x64 assembler can -** use lea instead of an add for integer ADD, but not for ADDOV (lea does -** not affect the flags, but it helps to avoid register moves). -** -** -** All of the above has to be reconsidered for architectures with slow FP -** operations or without a hardware FPU. The dual-number mode of LuaJIT -** addresses this issue. Arithmetic operations are performed on integers -** as far as possible and overflow checks are added as needed. -** -** This implies that narrowing for integer arguments and bit operations -** should also strip overflow checks, e.g. replace ADDOV with ADD. The -** original overflow guards are weak and can be eliminated by DCE, if -** there's no other use. -** -** A slight twist is that it's usually beneficial to use overflow-checked -** integer arithmetics if all inputs are already integers. This is the only -** change that affects the single-number mode, too. -*/ - -/* Some local macros to save typing. Undef'd at the end. */ -#define IR(ref) (&J->cur.ir[(ref)]) -#define fins (&J->fold.ins) - -/* Pass IR on to next optimization in chain (FOLD). */ -#define emitir(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J)) - -#define emitir_raw(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_ir_emit(J)) - -/* -- Elimination of narrowing type conversions --------------------------- */ - -/* Narrowing of index expressions and bit operations is demand-driven. The -** trace recorder emits a narrowing type conversion (CONV.int.num or TOBIT) -** in all of these cases (e.g. array indexing or string indexing). FOLD -** already takes care of eliminating simple redundant conversions like -** CONV.int.num(CONV.num.int(x)) ==> x. -** -** But the surrounding code is FP-heavy and arithmetic operations are -** performed on FP numbers (for the single-number mode). Consider a common -** example such as 'x=t[i+1]', with 'i' already an integer (due to induction -** variable narrowing). The index expression would be recorded as -** CONV.int.num(ADD(CONV.num.int(i), 1)) -** which is clearly suboptimal. -** -** One can do better by recursively backpropagating the narrowing type -** conversion across FP arithmetic operations. This turns FP ops into -** their corresponding integer counterparts. Depending on the semantics of -** the conversion they also need to check for overflow. Currently only ADD -** and SUB are supported. -** -** The above example can be rewritten as -** ADDOV(CONV.int.num(CONV.num.int(i)), 1) -** and then into ADDOV(i, 1) after folding of the conversions. The original -** FP ops remain in the IR and are eliminated by DCE since all references to -** them are gone. -** -** [In dual-number mode the trace recorder already emits ADDOV etc., but -** this can be further reduced. See below.] -** -** Special care has to be taken to avoid narrowing across an operation -** which is potentially operating on non-integral operands. One obvious -** case is when an expression contains a non-integral constant, but ends -** up as an integer index at runtime (like t[x+1.5] with x=0.5). -** -** Operations with two non-constant operands illustrate a similar problem -** (like t[a+b] with a=1.5 and b=2.5). Backpropagation has to stop there, -** unless it can be proven that either operand is integral (e.g. by CSEing -** a previous conversion). As a not-so-obvious corollary this logic also -** applies for a whole expression tree (e.g. t[(a+1)+(b+1)]). -** -** Correctness of the transformation is guaranteed by avoiding to expand -** the tree by adding more conversions than the one we would need to emit -** if not backpropagating. TOBIT employs a more optimistic rule, because -** the conversion has special semantics, designed to make the life of the -** compiler writer easier. ;-) -** -** Using on-the-fly backpropagation of an expression tree doesn't work -** because it's unknown whether the transform is correct until the end. -** This either requires IR rollback and cache invalidation for every -** subtree or a two-pass algorithm. The former didn't work out too well, -** so the code now combines a recursive collector with a stack-based -** emitter. -** -** [A recursive backpropagation algorithm with backtracking, employing -** skip-list lookup and round-robin caching, emitting stack operations -** on-the-fly for a stack-based interpreter -- and all of that in a meager -** kilobyte? Yep, compilers are a great treasure chest. Throw away your -** textbooks and read the codebase of a compiler today!] -** -** There's another optimization opportunity for array indexing: it's -** always accompanied by an array bounds-check. The outermost overflow -** check may be delegated to the ABC operation. This works because ABC is -** an unsigned comparison and wrap-around due to overflow creates negative -** numbers. -** -** But this optimization is only valid for constants that cannot overflow -** an int32_t into the range of valid array indexes [0..2^27+1). A check -** for +-2^30 is safe since -2^31 - 2^30 wraps to 2^30 and 2^31-1 + 2^30 -** wraps to -2^30-1. -** -** It's also good enough in practice, since e.g. t[i+1] or t[i-10] are -** quite common. So the above example finally ends up as ADD(i, 1)! -** -** Later on, the assembler is able to fuse the whole array reference and -** the ADD into the memory operands of loads and other instructions. This -** is why LuaJIT is able to generate very pretty (and fast) machine code -** for array indexing. And that, my dear, concludes another story about -** one of the hidden secrets of LuaJIT ... -*/ - -/* Maximum backpropagation depth and maximum stack size. */ -#define NARROW_MAX_BACKPROP 100 -#define NARROW_MAX_STACK 256 - -/* The stack machine has a 32 bit instruction format: [IROpT | IRRef1] -** The lower 16 bits hold a reference (or 0). The upper 16 bits hold -** the IR opcode + type or one of the following special opcodes: -*/ -enum { - NARROW_REF, /* Push ref. */ - NARROW_CONV, /* Push conversion of ref. */ - NARROW_SEXT, /* Push sign-extension of ref. */ - NARROW_INT /* Push KINT ref. The next code holds an int32_t. */ -}; - -typedef uint32_t NarrowIns; - -#define NARROWINS(op, ref) (((op) << 16) + (ref)) -#define narrow_op(ins) ((IROpT)((ins) >> 16)) -#define narrow_ref(ins) ((IRRef1)(ins)) - -/* Context used for narrowing of type conversions. */ -typedef struct NarrowConv { - jit_State *J; /* JIT compiler state. */ - NarrowIns *sp; /* Current stack pointer. */ - NarrowIns *maxsp; /* Maximum stack pointer minus redzone. */ - IRRef mode; /* Conversion mode (IRCONV_*). */ - IRType t; /* Destination type: IRT_INT or IRT_I64. */ - NarrowIns stack[NARROW_MAX_STACK]; /* Stack holding stack-machine code. */ -} NarrowConv; - -/* Lookup a reference in the backpropagation cache. */ -static BPropEntry *narrow_bpc_get(jit_State *J, IRRef1 key, IRRef mode) -{ - ptrdiff_t i; - for (i = 0; i < BPROP_SLOTS; i++) { - BPropEntry *bp = &J->bpropcache[i]; - /* Stronger checks are ok, too. */ - if (bp->key == key && bp->mode >= mode && - ((bp->mode ^ mode) & IRCONV_MODEMASK) == 0) - return bp; - } - return NULL; -} - -/* Add an entry to the backpropagation cache. */ -static void narrow_bpc_set(jit_State *J, IRRef1 key, IRRef1 val, IRRef mode) -{ - uint32_t slot = J->bpropslot; - BPropEntry *bp = &J->bpropcache[slot]; - J->bpropslot = (slot + 1) & (BPROP_SLOTS-1); - bp->key = key; - bp->val = val; - bp->mode = mode; -} - -/* Backpropagate overflow stripping. */ -static void narrow_stripov_backprop(NarrowConv *nc, IRRef ref, int depth) -{ - jit_State *J = nc->J; - IRIns *ir = IR(ref); - if (ir->o == IR_ADDOV || ir->o == IR_SUBOV || - (ir->o == IR_MULOV && (nc->mode & IRCONV_CONVMASK) == IRCONV_ANY)) { - BPropEntry *bp = narrow_bpc_get(nc->J, ref, IRCONV_TOBIT); - if (bp) { - ref = bp->val; - } else if (++depth < NARROW_MAX_BACKPROP && nc->sp < nc->maxsp) { - NarrowIns *savesp = nc->sp; - narrow_stripov_backprop(nc, ir->op1, depth); - if (nc->sp < nc->maxsp) { - narrow_stripov_backprop(nc, ir->op2, depth); - if (nc->sp < nc->maxsp) { - *nc->sp++ = NARROWINS(IRT(ir->o - IR_ADDOV + IR_ADD, IRT_INT), ref); - return; - } - } - nc->sp = savesp; /* Path too deep, need to backtrack. */ - } - } - *nc->sp++ = NARROWINS(NARROW_REF, ref); -} - -/* Backpropagate narrowing conversion. Return number of needed conversions. */ -static int narrow_conv_backprop(NarrowConv *nc, IRRef ref, int depth) -{ - jit_State *J = nc->J; - IRIns *ir = IR(ref); - IRRef cref; - - if (nc->sp >= nc->maxsp) return 10; /* Path too deep. */ - - /* Check the easy cases first. */ - if (ir->o == IR_CONV && (ir->op2 & IRCONV_SRCMASK) == IRT_INT) { - if ((nc->mode & IRCONV_CONVMASK) <= IRCONV_ANY) - narrow_stripov_backprop(nc, ir->op1, depth+1); - else - *nc->sp++ = NARROWINS(NARROW_REF, ir->op1); /* Undo conversion. */ - if (nc->t == IRT_I64) - *nc->sp++ = NARROWINS(NARROW_SEXT, 0); /* Sign-extend integer. */ - return 0; - } else if (ir->o == IR_KNUM) { /* Narrow FP constant. */ - lua_Number n = ir_knum(ir)->n; - if ((nc->mode & IRCONV_CONVMASK) == IRCONV_TOBIT) { - /* Allows a wider range of constants. */ - int64_t k64 = (int64_t)n; - if (n == (lua_Number)k64) { /* Only if const doesn't lose precision. */ - *nc->sp++ = NARROWINS(NARROW_INT, 0); - *nc->sp++ = (NarrowIns)k64; /* But always truncate to 32 bits. */ - return 0; - } - } else { - int32_t k = lj_num2int(n); - /* Only if constant is a small integer. */ - if (checki16(k) && n == (lua_Number)k) { - *nc->sp++ = NARROWINS(NARROW_INT, 0); - *nc->sp++ = (NarrowIns)k; - return 0; - } - } - return 10; /* Never narrow other FP constants (this is rare). */ - } - - /* Try to CSE the conversion. Stronger checks are ok, too. */ - cref = J->chain[fins->o]; - while (cref > ref) { - IRIns *cr = IR(cref); - if (cr->op1 == ref && - (fins->o == IR_TOBIT || - ((cr->op2 & IRCONV_MODEMASK) == (nc->mode & IRCONV_MODEMASK) && - irt_isguard(cr->t) >= irt_isguard(fins->t)))) { - *nc->sp++ = NARROWINS(NARROW_REF, cref); - return 0; /* Already there, no additional conversion needed. */ - } - cref = cr->prev; - } - - /* Backpropagate across ADD/SUB. */ - if (ir->o == IR_ADD || ir->o == IR_SUB) { - /* Try cache lookup first. */ - IRRef mode = nc->mode; - BPropEntry *bp; - /* Inner conversions need a stronger check. */ - if ((mode & IRCONV_CONVMASK) == IRCONV_INDEX && depth > 0) - mode += IRCONV_CHECK-IRCONV_INDEX; - bp = narrow_bpc_get(nc->J, (IRRef1)ref, mode); - if (bp) { - *nc->sp++ = NARROWINS(NARROW_REF, bp->val); - return 0; - } else if (nc->t == IRT_I64) { - /* Try sign-extending from an existing (checked) conversion to int. */ - mode = (IRT_INT<<5)|IRT_NUM|IRCONV_INDEX; - bp = narrow_bpc_get(nc->J, (IRRef1)ref, mode); - if (bp) { - *nc->sp++ = NARROWINS(NARROW_REF, bp->val); - *nc->sp++ = NARROWINS(NARROW_SEXT, 0); - return 0; - } - } - if (++depth < NARROW_MAX_BACKPROP && nc->sp < nc->maxsp) { - NarrowIns *savesp = nc->sp; - int count = narrow_conv_backprop(nc, ir->op1, depth); - count += narrow_conv_backprop(nc, ir->op2, depth); - if (count <= 1) { /* Limit total number of conversions. */ - *nc->sp++ = NARROWINS(IRT(ir->o, nc->t), ref); - return count; - } - nc->sp = savesp; /* Too many conversions, need to backtrack. */ - } - } - - /* Otherwise add a conversion. */ - *nc->sp++ = NARROWINS(NARROW_CONV, ref); - return 1; -} - -/* Emit the conversions collected during backpropagation. */ -static IRRef narrow_conv_emit(jit_State *J, NarrowConv *nc) -{ - /* The fins fields must be saved now -- emitir() overwrites them. */ - IROpT guardot = irt_isguard(fins->t) ? IRTG(IR_ADDOV-IR_ADD, 0) : 0; - IROpT convot = fins->ot; - IRRef1 convop2 = fins->op2; - NarrowIns *next = nc->stack; /* List of instructions from backpropagation. */ - NarrowIns *last = nc->sp; - NarrowIns *sp = nc->stack; /* Recycle the stack to store operands. */ - while (next < last) { /* Simple stack machine to process the ins. list. */ - NarrowIns ref = *next++; - IROpT op = narrow_op(ref); - if (op == NARROW_REF) { - *sp++ = ref; - } else if (op == NARROW_CONV) { - *sp++ = emitir_raw(convot, ref, convop2); /* Raw emit avoids a loop. */ - } else if (op == NARROW_SEXT) { - lua_assert(sp >= nc->stack+1); - sp[-1] = emitir(IRT(IR_CONV, IRT_I64), sp[-1], - (IRT_I64<<5)|IRT_INT|IRCONV_SEXT); - } else if (op == NARROW_INT) { - lua_assert(next < last); - *sp++ = nc->t == IRT_I64 ? - lj_ir_kint64(J, (int64_t)(int32_t)*next++) : - lj_ir_kint(J, *next++); - } else { /* Regular IROpT. Pops two operands and pushes one result. */ - IRRef mode = nc->mode; - lua_assert(sp >= nc->stack+2); - sp--; - /* Omit some overflow checks for array indexing. See comments above. */ - if ((mode & IRCONV_CONVMASK) == IRCONV_INDEX) { - if (next == last && irref_isk(narrow_ref(sp[0])) && - (uint32_t)IR(narrow_ref(sp[0]))->i + 0x40000000u < 0x80000000u) - guardot = 0; - else /* Otherwise cache a stronger check. */ - mode += IRCONV_CHECK-IRCONV_INDEX; - } - sp[-1] = emitir(op+guardot, sp[-1], sp[0]); - /* Add to cache. */ - if (narrow_ref(ref)) - narrow_bpc_set(J, narrow_ref(ref), narrow_ref(sp[-1]), mode); - } - } - lua_assert(sp == nc->stack+1); - return nc->stack[0]; -} - -/* Narrow a type conversion of an arithmetic operation. */ -TRef LJ_FASTCALL lj_opt_narrow_convert(jit_State *J) -{ - if ((J->flags & JIT_F_OPT_NARROW)) { - NarrowConv nc; - nc.J = J; - nc.sp = nc.stack; - nc.maxsp = &nc.stack[NARROW_MAX_STACK-4]; - nc.t = irt_type(fins->t); - if (fins->o == IR_TOBIT) { - nc.mode = IRCONV_TOBIT; /* Used only in the backpropagation cache. */ - } else { - nc.mode = fins->op2; - } - if (narrow_conv_backprop(&nc, fins->op1, 0) <= 1) - return narrow_conv_emit(J, &nc); - } - return NEXTFOLD; -} - -/* -- Narrowing of implicit conversions ----------------------------------- */ - -/* Recursively strip overflow checks. */ -static TRef narrow_stripov(jit_State *J, TRef tr, int lastop, IRRef mode) -{ - IRRef ref = tref_ref(tr); - IRIns *ir = IR(ref); - int op = ir->o; - if (op >= IR_ADDOV && op <= lastop) { - BPropEntry *bp = narrow_bpc_get(J, ref, mode); - if (bp) { - return TREF(bp->val, irt_t(IR(bp->val)->t)); - } else { - IRRef op1 = ir->op1, op2 = ir->op2; /* The IR may be reallocated. */ - op1 = narrow_stripov(J, op1, lastop, mode); - op2 = narrow_stripov(J, op2, lastop, mode); - tr = emitir(IRT(op - IR_ADDOV + IR_ADD, - ((mode & IRCONV_DSTMASK) >> IRCONV_DSH)), op1, op2); - narrow_bpc_set(J, ref, tref_ref(tr), mode); - } - } else if (LJ_64 && (mode & IRCONV_SEXT) && !irt_is64(ir->t)) { - tr = emitir(IRT(IR_CONV, IRT_INTP), tr, mode); - } - return tr; -} - -/* Narrow array index. */ -TRef LJ_FASTCALL lj_opt_narrow_index(jit_State *J, TRef tr) -{ - IRIns *ir; - lua_assert(tref_isnumber(tr)); - if (tref_isnum(tr)) /* Conversion may be narrowed, too. See above. */ - return emitir(IRTGI(IR_CONV), tr, IRCONV_INT_NUM|IRCONV_INDEX); - /* Omit some overflow checks for array indexing. See comments above. */ - ir = IR(tref_ref(tr)); - if ((ir->o == IR_ADDOV || ir->o == IR_SUBOV) && irref_isk(ir->op2) && - (uint32_t)IR(ir->op2)->i + 0x40000000u < 0x80000000u) - return emitir(IRTI(ir->o - IR_ADDOV + IR_ADD), ir->op1, ir->op2); - return tr; -} - -/* Narrow conversion to integer operand (overflow undefined). */ -TRef LJ_FASTCALL lj_opt_narrow_toint(jit_State *J, TRef tr) -{ - if (tref_isstr(tr)) - tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0); - if (tref_isnum(tr)) /* Conversion may be narrowed, too. See above. */ - return emitir(IRTI(IR_CONV), tr, IRCONV_INT_NUM|IRCONV_ANY); - if (!tref_isinteger(tr)) - lj_trace_err(J, LJ_TRERR_BADTYPE); - /* - ** Undefined overflow semantics allow stripping of ADDOV, SUBOV and MULOV. - ** Use IRCONV_TOBIT for the cache entries, since the semantics are the same. - */ - return narrow_stripov(J, tr, IR_MULOV, (IRT_INT<<5)|IRT_INT|IRCONV_TOBIT); -} - -/* Narrow conversion to bitop operand (overflow wrapped). */ -TRef LJ_FASTCALL lj_opt_narrow_tobit(jit_State *J, TRef tr) -{ - if (tref_isstr(tr)) - tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0); - if (tref_isnum(tr)) /* Conversion may be narrowed, too. See above. */ - return emitir(IRTI(IR_TOBIT), tr, lj_ir_knum_tobit(J)); - if (!tref_isinteger(tr)) - lj_trace_err(J, LJ_TRERR_BADTYPE); - /* - ** Wrapped overflow semantics allow stripping of ADDOV and SUBOV. - ** MULOV cannot be stripped due to precision widening. - */ - return narrow_stripov(J, tr, IR_SUBOV, (IRT_INT<<5)|IRT_INT|IRCONV_TOBIT); -} - -#if LJ_HASFFI -/* Narrow C array index (overflow undefined). */ -TRef LJ_FASTCALL lj_opt_narrow_cindex(jit_State *J, TRef tr) -{ - lua_assert(tref_isnumber(tr)); - if (tref_isnum(tr)) - return emitir(IRT(IR_CONV, IRT_INTP), tr, (IRT_INTP<<5)|IRT_NUM|IRCONV_ANY); - /* Undefined overflow semantics allow stripping of ADDOV, SUBOV and MULOV. */ - return narrow_stripov(J, tr, IR_MULOV, - LJ_64 ? ((IRT_INTP<<5)|IRT_INT|IRCONV_SEXT) : - ((IRT_INTP<<5)|IRT_INT|IRCONV_TOBIT)); -} -#endif - -/* -- Narrowing of arithmetic operators ----------------------------------- */ - -/* Check whether a number fits into an int32_t (-0 is ok, too). */ -static int numisint(lua_Number n) -{ - return (n == (lua_Number)lj_num2int(n)); -} - -/* Convert string to number. Error out for non-numeric string values. */ -static TRef conv_str_tonum(jit_State *J, TRef tr, TValue *o) -{ - if (tref_isstr(tr)) { - tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0); - /* Would need an inverted STRTO for this rare and useless case. */ - if (!lj_strscan_num(strV(o), o)) /* Convert in-place. Value used below. */ - lj_trace_err(J, LJ_TRERR_BADTYPE); /* Punt if non-numeric. */ - } - return tr; -} - -/* Narrowing of arithmetic operations. */ -TRef lj_opt_narrow_arith(jit_State *J, TRef rb, TRef rc, - TValue *vb, TValue *vc, IROp op) -{ - rb = conv_str_tonum(J, rb, vb); - rc = conv_str_tonum(J, rc, vc); - /* Must not narrow MUL in non-DUALNUM variant, because it loses -0. */ - if ((op >= IR_ADD && op <= (LJ_DUALNUM ? IR_MUL : IR_SUB)) && - tref_isinteger(rb) && tref_isinteger(rc) && - numisint(lj_vm_foldarith(numberVnum(vb), numberVnum(vc), - (int)op - (int)IR_ADD))) - return emitir(IRTGI((int)op - (int)IR_ADD + (int)IR_ADDOV), rb, rc); - if (!tref_isnum(rb)) rb = emitir(IRTN(IR_CONV), rb, IRCONV_NUM_INT); - if (!tref_isnum(rc)) rc = emitir(IRTN(IR_CONV), rc, IRCONV_NUM_INT); - return emitir(IRTN(op), rb, rc); -} - -/* Narrowing of unary minus operator. */ -TRef lj_opt_narrow_unm(jit_State *J, TRef rc, TValue *vc) -{ - rc = conv_str_tonum(J, rc, vc); - if (tref_isinteger(rc)) { - if ((uint32_t)numberVint(vc) != 0x80000000u) - return emitir(IRTGI(IR_SUBOV), lj_ir_kint(J, 0), rc); - rc = emitir(IRTN(IR_CONV), rc, IRCONV_NUM_INT); - } - return emitir(IRTN(IR_NEG), rc, lj_ir_knum_neg(J)); -} - -/* Narrowing of modulo operator. */ -TRef lj_opt_narrow_mod(jit_State *J, TRef rb, TRef rc, TValue *vb, TValue *vc) -{ - TRef tmp; - rb = conv_str_tonum(J, rb, vb); - rc = conv_str_tonum(J, rc, vc); - if ((LJ_DUALNUM || (J->flags & JIT_F_OPT_NARROW)) && - tref_isinteger(rb) && tref_isinteger(rc) && - (tvisint(vc) ? intV(vc) != 0 : !tviszero(vc))) { - emitir(IRTGI(IR_NE), rc, lj_ir_kint(J, 0)); - return emitir(IRTI(IR_MOD), rb, rc); - } - /* b % c ==> b - floor(b/c)*c */ - rb = lj_ir_tonum(J, rb); - rc = lj_ir_tonum(J, rc); - tmp = emitir(IRTN(IR_DIV), rb, rc); - tmp = emitir(IRTN(IR_FPMATH), tmp, IRFPM_FLOOR); - tmp = emitir(IRTN(IR_MUL), tmp, rc); - return emitir(IRTN(IR_SUB), rb, tmp); -} - -/* Narrowing of power operator or math.pow. */ -TRef lj_opt_narrow_pow(jit_State *J, TRef rb, TRef rc, TValue *vb, TValue *vc) -{ - rb = conv_str_tonum(J, rb, vb); - rb = lj_ir_tonum(J, rb); /* Left arg is always treated as an FP number. */ - rc = conv_str_tonum(J, rc, vc); - /* Narrowing must be unconditional to preserve (-x)^i semantics. */ - if (tvisint(vc) || numisint(numV(vc))) { - int checkrange = 0; - /* Split pow is faster for bigger exponents. But do this only for (+k)^i. */ - if (tref_isk(rb) && (int32_t)ir_knum(IR(tref_ref(rb)))->u32.hi >= 0) { - int32_t k = numberVint(vc); - if (!(k >= -65536 && k <= 65536)) goto split_pow; - checkrange = 1; - } - if (!tref_isinteger(rc)) { - /* Guarded conversion to integer! */ - rc = emitir(IRTGI(IR_CONV), rc, IRCONV_INT_NUM|IRCONV_CHECK); - } - if (checkrange && !tref_isk(rc)) { /* Range guard: -65536 <= i <= 65536 */ - TRef tmp = emitir(IRTI(IR_ADD), rc, lj_ir_kint(J, 65536)); - emitir(IRTGI(IR_ULE), tmp, lj_ir_kint(J, 2*65536)); - } - return emitir(IRTN(IR_POW), rb, rc); - } -split_pow: - /* FOLD covers most cases, but some are easier to do here. */ - if (tref_isk(rb) && tvispone(ir_knum(IR(tref_ref(rb))))) - return rb; /* 1 ^ x ==> 1 */ - rc = lj_ir_tonum(J, rc); - if (tref_isk(rc) && ir_knum(IR(tref_ref(rc)))->n == 0.5) - return emitir(IRTN(IR_FPMATH), rb, IRFPM_SQRT); /* x ^ 0.5 ==> sqrt(x) */ - /* Split up b^c into exp2(c*log2(b)). Assembler may rejoin later. */ - rb = emitir(IRTN(IR_FPMATH), rb, IRFPM_LOG2); - rc = emitir(IRTN(IR_MUL), rb, rc); - return emitir(IRTN(IR_FPMATH), rc, IRFPM_EXP2); -} - -/* -- Predictive narrowing of induction variables ------------------------- */ - -/* Narrow a single runtime value. */ -static int narrow_forl(jit_State *J, cTValue *o) -{ - if (tvisint(o)) return 1; - if (LJ_DUALNUM || (J->flags & JIT_F_OPT_NARROW)) return numisint(numV(o)); - return 0; -} - -/* Narrow the FORL index type by looking at the runtime values. */ -IRType lj_opt_narrow_forl(jit_State *J, cTValue *tv) -{ - lua_assert(tvisnumber(&tv[FORL_IDX]) && - tvisnumber(&tv[FORL_STOP]) && - tvisnumber(&tv[FORL_STEP])); - /* Narrow only if the runtime values of start/stop/step are all integers. */ - if (narrow_forl(J, &tv[FORL_IDX]) && - narrow_forl(J, &tv[FORL_STOP]) && - narrow_forl(J, &tv[FORL_STEP])) { - /* And if the loop index can't possibly overflow. */ - lua_Number step = numberVnum(&tv[FORL_STEP]); - lua_Number sum = numberVnum(&tv[FORL_STOP]) + step; - if (0 <= step ? (sum <= 2147483647.0) : (sum >= -2147483648.0)) - return IRT_INT; - } - return IRT_NUM; -} - -#undef IR -#undef fins -#undef emitir -#undef emitir_raw - -#endif diff --git a/subprojects/luajit/src/lj_opt_sink.c b/subprojects/luajit/src/lj_opt_sink.c deleted file mode 100644 index 6a00d04c8..000000000 --- a/subprojects/luajit/src/lj_opt_sink.c +++ /dev/null @@ -1,244 +0,0 @@ -/* -** SINK: Allocation Sinking and Store Sinking. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_opt_sink_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_iropt.h" -#include "lj_target.h" - -/* Some local macros to save typing. Undef'd at the end. */ -#define IR(ref) (&J->cur.ir[(ref)]) - -/* Check whether the store ref points to an eligible allocation. */ -static IRIns *sink_checkalloc(jit_State *J, IRIns *irs) -{ - IRIns *ir = IR(irs->op1); - if (!irref_isk(ir->op2)) - return NULL; /* Non-constant key. */ - if (ir->o == IR_HREFK || ir->o == IR_AREF) - ir = IR(ir->op1); - else if (!(ir->o == IR_HREF || ir->o == IR_NEWREF || - ir->o == IR_FREF || ir->o == IR_ADD)) - return NULL; /* Unhandled reference type (for XSTORE). */ - ir = IR(ir->op1); - if (!(ir->o == IR_TNEW || ir->o == IR_TDUP || ir->o == IR_CNEW)) - return NULL; /* Not an allocation. */ - return ir; /* Return allocation. */ -} - -/* Recursively check whether a value depends on a PHI. */ -static int sink_phidep(jit_State *J, IRRef ref) -{ - IRIns *ir = IR(ref); - if (irt_isphi(ir->t)) return 1; - if (ir->op1 >= REF_FIRST && sink_phidep(J, ir->op1)) return 1; - if (ir->op2 >= REF_FIRST && sink_phidep(J, ir->op2)) return 1; - return 0; -} - -/* Check whether a value is a sinkable PHI or loop-invariant. */ -static int sink_checkphi(jit_State *J, IRIns *ira, IRRef ref) -{ - if (ref >= REF_FIRST) { - IRIns *ir = IR(ref); - if (irt_isphi(ir->t) || (ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT && - irt_isphi(IR(ir->op1)->t))) { - ira->prev++; - return 1; /* Sinkable PHI. */ - } - /* Otherwise the value must be loop-invariant. */ - return ref < J->loopref && !sink_phidep(J, ref); - } - return 1; /* Constant (non-PHI). */ -} - -/* Mark non-sinkable allocations using single-pass backward propagation. -** -** Roots for the marking process are: -** - Some PHIs or snapshots (see below). -** - Non-PHI, non-constant values stored to PHI allocations. -** - All guards. -** - Any remaining loads not eliminated by store-to-load forwarding. -** - Stores with non-constant keys. -** - All stored values. -*/ -static void sink_mark_ins(jit_State *J) -{ - IRIns *ir, *irlast = IR(J->cur.nins-1); - for (ir = irlast ; ; ir--) { - switch (ir->o) { - case IR_BASE: - return; /* Finished. */ - case IR_CALLL: /* IRCALL_lj_tab_len */ - case IR_ALOAD: case IR_HLOAD: case IR_XLOAD: case IR_TBAR: - irt_setmark(IR(ir->op1)->t); /* Mark ref for remaining loads. */ - break; - case IR_FLOAD: - if (irt_ismarked(ir->t) || ir->op2 == IRFL_TAB_META) - irt_setmark(IR(ir->op1)->t); /* Mark table for remaining loads. */ - break; - case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: { - IRIns *ira = sink_checkalloc(J, ir); - if (!ira || (irt_isphi(ira->t) && !sink_checkphi(J, ira, ir->op2))) - irt_setmark(IR(ir->op1)->t); /* Mark ineligible ref. */ - irt_setmark(IR(ir->op2)->t); /* Mark stored value. */ - break; - } -#if LJ_HASFFI - case IR_CNEWI: - if (irt_isphi(ir->t) && - (!sink_checkphi(J, ir, ir->op2) || - (LJ_32 && ir+1 < irlast && (ir+1)->o == IR_HIOP && - !sink_checkphi(J, ir, (ir+1)->op2)))) - irt_setmark(ir->t); /* Mark ineligible allocation. */ - /* fallthrough */ -#endif - case IR_USTORE: - irt_setmark(IR(ir->op2)->t); /* Mark stored value. */ - break; -#if LJ_HASFFI - case IR_CALLXS: -#endif - case IR_CALLS: - irt_setmark(IR(ir->op1)->t); /* Mark (potentially) stored values. */ - break; - case IR_PHI: { - IRIns *irl = IR(ir->op1), *irr = IR(ir->op2); - irl->prev = irr->prev = 0; /* Clear PHI value counts. */ - if (irl->o == irr->o && - (irl->o == IR_TNEW || irl->o == IR_TDUP || - (LJ_HASFFI && (irl->o == IR_CNEW || irl->o == IR_CNEWI)))) - break; - irt_setmark(irl->t); - irt_setmark(irr->t); - break; - } - default: - if (irt_ismarked(ir->t) || irt_isguard(ir->t)) { /* Propagate mark. */ - if (ir->op1 >= REF_FIRST) irt_setmark(IR(ir->op1)->t); - if (ir->op2 >= REF_FIRST) irt_setmark(IR(ir->op2)->t); - } - break; - } - } -} - -/* Mark all instructions referenced by a snapshot. */ -static void sink_mark_snap(jit_State *J, SnapShot *snap) -{ - SnapEntry *map = &J->cur.snapmap[snap->mapofs]; - MSize n, nent = snap->nent; - for (n = 0; n < nent; n++) { - IRRef ref = snap_ref(map[n]); - if (!irref_isk(ref)) - irt_setmark(IR(ref)->t); - } -} - -/* Iteratively remark PHI refs with differing marks or PHI value counts. */ -static void sink_remark_phi(jit_State *J) -{ - IRIns *ir; - int remark; - do { - remark = 0; - for (ir = IR(J->cur.nins-1); ir->o == IR_PHI; ir--) { - IRIns *irl = IR(ir->op1), *irr = IR(ir->op2); - if (!((irl->t.irt ^ irr->t.irt) & IRT_MARK) && irl->prev == irr->prev) - continue; - remark |= (~(irl->t.irt & irr->t.irt) & IRT_MARK); - irt_setmark(IR(ir->op1)->t); - irt_setmark(IR(ir->op2)->t); - } - } while (remark); -} - -/* Sweep instructions and tag sunken allocations and stores. */ -static void sink_sweep_ins(jit_State *J) -{ - IRIns *ir, *irfirst = IR(J->cur.nk); - for (ir = IR(J->cur.nins-1) ; ir >= irfirst; ir--) { - switch (ir->o) { - case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: { - IRIns *ira = sink_checkalloc(J, ir); - if (ira && !irt_ismarked(ira->t)) { - int delta = (int)(ir - ira); - ir->prev = REGSP(RID_SINK, delta > 255 ? 255 : delta); - } else { - ir->prev = REGSP_INIT; - } - break; - } - case IR_NEWREF: - if (!irt_ismarked(IR(ir->op1)->t)) { - ir->prev = REGSP(RID_SINK, 0); - } else { - irt_clearmark(ir->t); - ir->prev = REGSP_INIT; - } - break; -#if LJ_HASFFI - case IR_CNEW: case IR_CNEWI: -#endif - case IR_TNEW: case IR_TDUP: - if (!irt_ismarked(ir->t)) { - ir->t.irt &= ~IRT_GUARD; - ir->prev = REGSP(RID_SINK, 0); - J->cur.sinktags = 1; /* Signal present SINK tags to assembler. */ - } else { - irt_clearmark(ir->t); - ir->prev = REGSP_INIT; - } - break; - case IR_PHI: { - IRIns *ira = IR(ir->op2); - if (!irt_ismarked(ira->t) && - (ira->o == IR_TNEW || ira->o == IR_TDUP || - (LJ_HASFFI && (ira->o == IR_CNEW || ira->o == IR_CNEWI)))) { - ir->prev = REGSP(RID_SINK, 0); - } else { - ir->prev = REGSP_INIT; - } - break; - } - default: - irt_clearmark(ir->t); - ir->prev = REGSP_INIT; - break; - } - } -} - -/* Allocation sinking and store sinking. -** -** 1. Mark all non-sinkable allocations. -** 2. Then sink all remaining allocations and the related stores. -*/ -void lj_opt_sink(jit_State *J) -{ - const uint32_t need = (JIT_F_OPT_SINK|JIT_F_OPT_FWD| - JIT_F_OPT_DCE|JIT_F_OPT_CSE|JIT_F_OPT_FOLD); - if ((J->flags & need) == need && - (J->chain[IR_TNEW] || J->chain[IR_TDUP] || - (LJ_HASFFI && (J->chain[IR_CNEW] || J->chain[IR_CNEWI])))) { - if (!J->loopref) - sink_mark_snap(J, &J->cur.snap[J->cur.nsnap-1]); - sink_mark_ins(J); - if (J->loopref) - sink_remark_phi(J); - sink_sweep_ins(J); - } -} - -#undef IR - -#endif diff --git a/subprojects/luajit/src/lj_opt_split.c b/subprojects/luajit/src/lj_opt_split.c deleted file mode 100644 index 8d7cd4c25..000000000 --- a/subprojects/luajit/src/lj_opt_split.c +++ /dev/null @@ -1,732 +0,0 @@ -/* -** SPLIT: Split 64 bit IR instructions into 32 bit IR instructions. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_opt_split_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT && (LJ_SOFTFP || (LJ_32 && LJ_HASFFI)) - -#include "lj_err.h" -#include "lj_str.h" -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_ircall.h" -#include "lj_iropt.h" -#include "lj_vm.h" - -/* SPLIT pass: -** -** This pass splits up 64 bit IR instructions into multiple 32 bit IR -** instructions. It's only active for soft-float targets or for 32 bit CPUs -** which lack native 64 bit integer operations (the FFI is currently the -** only emitter for 64 bit integer instructions). -** -** Splitting the IR in a separate pass keeps each 32 bit IR assembler -** backend simple. Only a small amount of extra functionality needs to be -** implemented. This is much easier than adding support for allocating -** register pairs to each backend (believe me, I tried). A few simple, but -** important optimizations can be performed by the SPLIT pass, which would -** be tedious to do in the backend. -** -** The basic idea is to replace each 64 bit IR instruction with its 32 bit -** equivalent plus an extra HIOP instruction. The splitted IR is not passed -** through FOLD or any other optimizations, so each HIOP is guaranteed to -** immediately follow it's counterpart. The actual functionality of HIOP is -** inferred from the previous instruction. -** -** The operands of HIOP hold the hiword input references. The output of HIOP -** is the hiword output reference, which is also used to hold the hiword -** register or spill slot information. The register allocator treats this -** instruction independently of any other instruction, which improves code -** quality compared to using fixed register pairs. -** -** It's easier to split up some instructions into two regular 32 bit -** instructions. E.g. XLOAD is split up into two XLOADs with two different -** addresses. Obviously 64 bit constants need to be split up into two 32 bit -** constants, too. Some hiword instructions can be entirely omitted, e.g. -** when zero-extending a 32 bit value to 64 bits. 64 bit arguments for calls -** are split up into two 32 bit arguments each. -** -** On soft-float targets, floating-point instructions are directly converted -** to soft-float calls by the SPLIT pass (except for comparisons and MIN/MAX). -** HIOP for number results has the type IRT_SOFTFP ("sfp" in -jdump). -** -** Here's the IR and x64 machine code for 'x.b = x.a + 1' for a struct with -** two int64_t fields: -** -** 0100 p32 ADD base +8 -** 0101 i64 XLOAD 0100 -** 0102 i64 ADD 0101 +1 -** 0103 p32 ADD base +16 -** 0104 i64 XSTORE 0103 0102 -** -** mov rax, [esi+0x8] -** add rax, +0x01 -** mov [esi+0x10], rax -** -** Here's the transformed IR and the x86 machine code after the SPLIT pass: -** -** 0100 p32 ADD base +8 -** 0101 int XLOAD 0100 -** 0102 p32 ADD base +12 -** 0103 int XLOAD 0102 -** 0104 int ADD 0101 +1 -** 0105 int HIOP 0103 +0 -** 0106 p32 ADD base +16 -** 0107 int XSTORE 0106 0104 -** 0108 int HIOP 0106 0105 -** -** mov eax, [esi+0x8] -** mov ecx, [esi+0xc] -** add eax, +0x01 -** adc ecx, +0x00 -** mov [esi+0x10], eax -** mov [esi+0x14], ecx -** -** You may notice the reassociated hiword address computation, which is -** later fused into the mov operands by the assembler. -*/ - -/* Some local macros to save typing. Undef'd at the end. */ -#define IR(ref) (&J->cur.ir[(ref)]) - -/* Directly emit the transformed IR without updating chains etc. */ -static IRRef split_emit(jit_State *J, uint16_t ot, IRRef1 op1, IRRef1 op2) -{ - IRRef nref = lj_ir_nextins(J); - IRIns *ir = IR(nref); - ir->ot = ot; - ir->op1 = op1; - ir->op2 = op2; - return nref; -} - -#if LJ_SOFTFP -/* Emit a (checked) number to integer conversion. */ -static IRRef split_num2int(jit_State *J, IRRef lo, IRRef hi, int check) -{ - IRRef tmp, res; -#if LJ_LE - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), lo, hi); -#else - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), hi, lo); -#endif - res = split_emit(J, IRTI(IR_CALLN), tmp, IRCALL_softfp_d2i); - if (check) { - tmp = split_emit(J, IRTI(IR_CALLN), res, IRCALL_softfp_i2d); - split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), tmp, tmp); - split_emit(J, IRTGI(IR_EQ), tmp, lo); - split_emit(J, IRTG(IR_HIOP, IRT_SOFTFP), tmp+1, hi); - } - return res; -} - -/* Emit a CALLN with one split 64 bit argument. */ -static IRRef split_call_l(jit_State *J, IRRef1 *hisubst, IRIns *oir, - IRIns *ir, IRCallID id) -{ - IRRef tmp, op1 = ir->op1; - J->cur.nins--; -#if LJ_LE - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), oir[op1].prev, hisubst[op1]); -#else - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), hisubst[op1], oir[op1].prev); -#endif - ir->prev = tmp = split_emit(J, IRTI(IR_CALLN), tmp, id); - return split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), tmp, tmp); -} - -/* Emit a CALLN with one split 64 bit argument and a 32 bit argument. */ -static IRRef split_call_li(jit_State *J, IRRef1 *hisubst, IRIns *oir, - IRIns *ir, IRCallID id) -{ - IRRef tmp, op1 = ir->op1, op2 = ir->op2; - J->cur.nins--; -#if LJ_LE - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), oir[op1].prev, hisubst[op1]); -#else - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), hisubst[op1], oir[op1].prev); -#endif - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, oir[op2].prev); - ir->prev = tmp = split_emit(J, IRTI(IR_CALLN), tmp, id); - return split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), tmp, tmp); -} -#endif - -/* Emit a CALLN with two split 64 bit arguments. */ -static IRRef split_call_ll(jit_State *J, IRRef1 *hisubst, IRIns *oir, - IRIns *ir, IRCallID id) -{ - IRRef tmp, op1 = ir->op1, op2 = ir->op2; - J->cur.nins--; -#if LJ_LE - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), oir[op1].prev, hisubst[op1]); - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, oir[op2].prev); - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, hisubst[op2]); -#else - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), hisubst[op1], oir[op1].prev); - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, hisubst[op2]); - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, oir[op2].prev); -#endif - ir->prev = tmp = split_emit(J, IRTI(IR_CALLN), tmp, id); - return split_emit(J, - IRT(IR_HIOP, (LJ_SOFTFP && irt_isnum(ir->t)) ? IRT_SOFTFP : IRT_INT), - tmp, tmp); -} - -/* Get a pointer to the other 32 bit word (LE: hiword, BE: loword). */ -static IRRef split_ptr(jit_State *J, IRIns *oir, IRRef ref) -{ - IRRef nref = oir[ref].prev; - IRIns *ir = IR(nref); - int32_t ofs = 4; - if (ir->o == IR_KPTR) - return lj_ir_kptr(J, (char *)ir_kptr(ir) + ofs); - if (ir->o == IR_ADD && irref_isk(ir->op2) && !irt_isphi(oir[ref].t)) { - /* Reassociate address. */ - ofs += IR(ir->op2)->i; - nref = ir->op1; - if (ofs == 0) return nref; - } - return split_emit(J, IRTI(IR_ADD), nref, lj_ir_kint(J, ofs)); -} - -/* Substitute references of a snapshot. */ -static void split_subst_snap(jit_State *J, SnapShot *snap, IRIns *oir) -{ - SnapEntry *map = &J->cur.snapmap[snap->mapofs]; - MSize n, nent = snap->nent; - for (n = 0; n < nent; n++) { - SnapEntry sn = map[n]; - IRIns *ir = &oir[snap_ref(sn)]; - if (!(LJ_SOFTFP && (sn & SNAP_SOFTFPNUM) && irref_isk(snap_ref(sn)))) - map[n] = ((sn & 0xffff0000) | ir->prev); - } -} - -/* Transform the old IR to the new IR. */ -static void split_ir(jit_State *J) -{ - IRRef nins = J->cur.nins, nk = J->cur.nk; - MSize irlen = nins - nk; - MSize need = (irlen+1)*(sizeof(IRIns) + sizeof(IRRef1)); - IRIns *oir = (IRIns *)lj_str_needbuf(J->L, &G(J->L)->tmpbuf, need); - IRRef1 *hisubst; - IRRef ref, snref; - SnapShot *snap; - - /* Copy old IR to buffer. */ - memcpy(oir, IR(nk), irlen*sizeof(IRIns)); - /* Bias hiword substitution table and old IR. Loword kept in field prev. */ - hisubst = (IRRef1 *)&oir[irlen] - nk; - oir -= nk; - - /* Remove all IR instructions, but retain IR constants. */ - J->cur.nins = REF_FIRST; - J->loopref = 0; - - /* Process constants and fixed references. */ - for (ref = nk; ref <= REF_BASE; ref++) { - IRIns *ir = &oir[ref]; - if ((LJ_SOFTFP && ir->o == IR_KNUM) || ir->o == IR_KINT64) { - /* Split up 64 bit constant. */ - TValue tv = *ir_k64(ir); - ir->prev = lj_ir_kint(J, (int32_t)tv.u32.lo); - hisubst[ref] = lj_ir_kint(J, (int32_t)tv.u32.hi); - } else { - ir->prev = ref; /* Identity substitution for loword. */ - hisubst[ref] = 0; - } - } - - /* Process old IR instructions. */ - snap = J->cur.snap; - snref = snap->ref; - for (ref = REF_FIRST; ref < nins; ref++) { - IRIns *ir = &oir[ref]; - IRRef nref = lj_ir_nextins(J); - IRIns *nir = IR(nref); - IRRef hi = 0; - - if (ref >= snref) { - snap->ref = nref; - split_subst_snap(J, snap++, oir); - snref = snap < &J->cur.snap[J->cur.nsnap] ? snap->ref : ~(IRRef)0; - } - - /* Copy-substitute old instruction to new instruction. */ - nir->op1 = ir->op1 < nk ? ir->op1 : oir[ir->op1].prev; - nir->op2 = ir->op2 < nk ? ir->op2 : oir[ir->op2].prev; - ir->prev = nref; /* Loword substitution. */ - nir->o = ir->o; - nir->t.irt = ir->t.irt & ~(IRT_MARK|IRT_ISPHI); - hisubst[ref] = 0; - - /* Split 64 bit instructions. */ -#if LJ_SOFTFP - if (irt_isnum(ir->t)) { - nir->t.irt = IRT_INT | (nir->t.irt & IRT_GUARD); /* Turn into INT op. */ - /* Note: hi ref = lo ref + 1! Required for SNAP_SOFTFPNUM logic. */ - switch (ir->o) { - case IR_ADD: - hi = split_call_ll(J, hisubst, oir, ir, IRCALL_softfp_add); - break; - case IR_SUB: - hi = split_call_ll(J, hisubst, oir, ir, IRCALL_softfp_sub); - break; - case IR_MUL: - hi = split_call_ll(J, hisubst, oir, ir, IRCALL_softfp_mul); - break; - case IR_DIV: - hi = split_call_ll(J, hisubst, oir, ir, IRCALL_softfp_div); - break; - case IR_POW: - hi = split_call_li(J, hisubst, oir, ir, IRCALL_lj_vm_powi); - break; - case IR_FPMATH: - /* Try to rejoin pow from EXP2, MUL and LOG2. */ - if (nir->op2 == IRFPM_EXP2 && nir->op1 > J->loopref) { - IRIns *irp = IR(nir->op1); - if (irp->o == IR_CALLN && irp->op2 == IRCALL_softfp_mul) { - IRIns *irm4 = IR(irp->op1); - IRIns *irm3 = IR(irm4->op1); - IRIns *irm12 = IR(irm3->op1); - IRIns *irl1 = IR(irm12->op1); - if (irm12->op1 > J->loopref && irl1->o == IR_CALLN && - irl1->op2 == IRCALL_lj_vm_log2) { - IRRef tmp = irl1->op1; /* Recycle first two args from LOG2. */ - IRRef arg3 = irm3->op2, arg4 = irm4->op2; - J->cur.nins--; - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, arg3); - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, arg4); - ir->prev = tmp = split_emit(J, IRTI(IR_CALLN), tmp, IRCALL_pow); - hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), tmp, tmp); - break; - } - } - } - hi = split_call_l(J, hisubst, oir, ir, IRCALL_lj_vm_floor + ir->op2); - break; - case IR_ATAN2: - hi = split_call_ll(J, hisubst, oir, ir, IRCALL_atan2); - break; - case IR_LDEXP: - hi = split_call_li(J, hisubst, oir, ir, IRCALL_ldexp); - break; - case IR_NEG: case IR_ABS: - nir->o = IR_CONV; /* Pass through loword. */ - nir->op2 = (IRT_INT << 5) | IRT_INT; - hi = split_emit(J, IRT(ir->o == IR_NEG ? IR_BXOR : IR_BAND, IRT_SOFTFP), - hisubst[ir->op1], hisubst[ir->op2]); - break; - case IR_SLOAD: - if ((nir->op2 & IRSLOAD_CONVERT)) { /* Convert from int to number. */ - nir->op2 &= ~IRSLOAD_CONVERT; - ir->prev = nref = split_emit(J, IRTI(IR_CALLN), nref, - IRCALL_softfp_i2d); - hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref); - break; - } - /* fallthrough */ - case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD: - case IR_STRTO: - hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref); - break; - case IR_XLOAD: { - IRIns inslo = *nir; /* Save/undo the emit of the lo XLOAD. */ - J->cur.nins--; - hi = split_ptr(J, oir, ir->op1); /* Insert the hiref ADD. */ - nref = lj_ir_nextins(J); - nir = IR(nref); - *nir = inslo; /* Re-emit lo XLOAD immediately before hi XLOAD. */ - hi = split_emit(J, IRT(IR_XLOAD, IRT_SOFTFP), hi, ir->op2); -#if LJ_LE - ir->prev = nref; -#else - ir->prev = hi; hi = nref; -#endif - break; - } - case IR_ASTORE: case IR_HSTORE: case IR_USTORE: case IR_XSTORE: - split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nir->op1, hisubst[ir->op2]); - break; - case IR_CONV: { /* Conversion to number. Others handled below. */ - IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK); - UNUSED(st); -#if LJ_32 && LJ_HASFFI - if (st == IRT_I64 || st == IRT_U64) { - hi = split_call_l(J, hisubst, oir, ir, - st == IRT_I64 ? IRCALL_fp64_l2d : IRCALL_fp64_ul2d); - break; - } -#endif - lua_assert(st == IRT_INT || - (LJ_32 && LJ_HASFFI && (st == IRT_U32 || st == IRT_FLOAT))); - nir->o = IR_CALLN; -#if LJ_32 && LJ_HASFFI - nir->op2 = st == IRT_INT ? IRCALL_softfp_i2d : - st == IRT_FLOAT ? IRCALL_softfp_f2d : - IRCALL_softfp_ui2d; -#else - nir->op2 = IRCALL_softfp_i2d; -#endif - hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref); - break; - } - case IR_CALLN: - case IR_CALLL: - case IR_CALLS: - case IR_CALLXS: - goto split_call; - case IR_PHI: - if (nir->op1 == nir->op2) - J->cur.nins--; /* Drop useless PHIs. */ - if (hisubst[ir->op1] != hisubst[ir->op2]) - split_emit(J, IRT(IR_PHI, IRT_SOFTFP), - hisubst[ir->op1], hisubst[ir->op2]); - break; - case IR_HIOP: - J->cur.nins--; /* Drop joining HIOP. */ - ir->prev = nir->op1; - hi = nir->op2; - break; - default: - lua_assert(ir->o <= IR_NE || ir->o == IR_MIN || ir->o == IR_MAX); - hi = split_emit(J, IRTG(IR_HIOP, IRT_SOFTFP), - hisubst[ir->op1], hisubst[ir->op2]); - break; - } - } else -#endif -#if LJ_32 && LJ_HASFFI - if (irt_isint64(ir->t)) { - IRRef hiref = hisubst[ir->op1]; - nir->t.irt = IRT_INT | (nir->t.irt & IRT_GUARD); /* Turn into INT op. */ - switch (ir->o) { - case IR_ADD: - case IR_SUB: - /* Use plain op for hiword if loword cannot produce a carry/borrow. */ - if (irref_isk(nir->op2) && IR(nir->op2)->i == 0) { - ir->prev = nir->op1; /* Pass through loword. */ - nir->op1 = hiref; nir->op2 = hisubst[ir->op2]; - hi = nref; - break; - } - /* fallthrough */ - case IR_NEG: - hi = split_emit(J, IRTI(IR_HIOP), hiref, hisubst[ir->op2]); - break; - case IR_MUL: - hi = split_call_ll(J, hisubst, oir, ir, IRCALL_lj_carith_mul64); - break; - case IR_DIV: - hi = split_call_ll(J, hisubst, oir, ir, - irt_isi64(ir->t) ? IRCALL_lj_carith_divi64 : - IRCALL_lj_carith_divu64); - break; - case IR_MOD: - hi = split_call_ll(J, hisubst, oir, ir, - irt_isi64(ir->t) ? IRCALL_lj_carith_modi64 : - IRCALL_lj_carith_modu64); - break; - case IR_POW: - hi = split_call_ll(J, hisubst, oir, ir, - irt_isi64(ir->t) ? IRCALL_lj_carith_powi64 : - IRCALL_lj_carith_powu64); - break; - case IR_FLOAD: - lua_assert(ir->op2 == IRFL_CDATA_INT64); - hi = split_emit(J, IRTI(IR_FLOAD), nir->op1, IRFL_CDATA_INT64_4); -#if LJ_BE - ir->prev = hi; hi = nref; -#endif - break; - case IR_XLOAD: - hi = split_emit(J, IRTI(IR_XLOAD), split_ptr(J, oir, ir->op1), ir->op2); -#if LJ_BE - ir->prev = hi; hi = nref; -#endif - break; - case IR_XSTORE: - split_emit(J, IRTI(IR_HIOP), nir->op1, hisubst[ir->op2]); - break; - case IR_CONV: { /* Conversion to 64 bit integer. Others handled below. */ - IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK); -#if LJ_SOFTFP - if (st == IRT_NUM) { /* NUM to 64 bit int conv. */ - hi = split_call_l(J, hisubst, oir, ir, - irt_isi64(ir->t) ? IRCALL_fp64_d2l : IRCALL_fp64_d2ul); - } else if (st == IRT_FLOAT) { /* FLOAT to 64 bit int conv. */ - nir->o = IR_CALLN; - nir->op2 = irt_isi64(ir->t) ? IRCALL_fp64_f2l : IRCALL_fp64_f2ul; - hi = split_emit(J, IRTI(IR_HIOP), nref, nref); - } -#else - if (st == IRT_NUM || st == IRT_FLOAT) { /* FP to 64 bit int conv. */ - hi = split_emit(J, IRTI(IR_HIOP), nir->op1, nref); - } -#endif - else if (st == IRT_I64 || st == IRT_U64) { /* 64/64 bit cast. */ - /* Drop cast, since assembler doesn't care. But fwd both parts. */ - hi = hiref; - goto fwdlo; - } else if ((ir->op2 & IRCONV_SEXT)) { /* Sign-extend to 64 bit. */ - IRRef k31 = lj_ir_kint(J, 31); - nir = IR(nref); /* May have been reallocated. */ - ir->prev = nir->op1; /* Pass through loword. */ - nir->o = IR_BSAR; /* hi = bsar(lo, 31). */ - nir->op2 = k31; - hi = nref; - } else { /* Zero-extend to 64 bit. */ - hi = lj_ir_kint(J, 0); - goto fwdlo; - } - break; - } - case IR_CALLXS: - goto split_call; - case IR_PHI: { - IRRef hiref2; - if ((irref_isk(nir->op1) && irref_isk(nir->op2)) || - nir->op1 == nir->op2) - J->cur.nins--; /* Drop useless PHIs. */ - hiref2 = hisubst[ir->op2]; - if (!((irref_isk(hiref) && irref_isk(hiref2)) || hiref == hiref2)) - split_emit(J, IRTI(IR_PHI), hiref, hiref2); - break; - } - case IR_HIOP: - J->cur.nins--; /* Drop joining HIOP. */ - ir->prev = nir->op1; - hi = nir->op2; - break; - default: - lua_assert(ir->o <= IR_NE); /* Comparisons. */ - split_emit(J, IRTGI(IR_HIOP), hiref, hisubst[ir->op2]); - break; - } - } else -#endif -#if LJ_SOFTFP - if (ir->o == IR_SLOAD) { - if ((nir->op2 & IRSLOAD_CONVERT)) { /* Convert from number to int. */ - nir->op2 &= ~IRSLOAD_CONVERT; - if (!(nir->op2 & IRSLOAD_TYPECHECK)) - nir->t.irt = IRT_INT; /* Drop guard. */ - split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref); - ir->prev = split_num2int(J, nref, nref+1, irt_isguard(ir->t)); - } - } else if (ir->o == IR_TOBIT) { - IRRef tmp, op1 = ir->op1; - J->cur.nins--; -#if LJ_LE - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), oir[op1].prev, hisubst[op1]); -#else - tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), hisubst[op1], oir[op1].prev); -#endif - ir->prev = split_emit(J, IRTI(IR_CALLN), tmp, IRCALL_lj_vm_tobit); - } else if (ir->o == IR_TOSTR) { - if (hisubst[ir->op1]) { - if (irref_isk(ir->op1)) - nir->op1 = ir->op1; - else - split_emit(J, IRT(IR_HIOP, IRT_NIL), hisubst[ir->op1], nref); - } - } else if (ir->o == IR_HREF || ir->o == IR_NEWREF) { - if (irref_isk(ir->op2) && hisubst[ir->op2]) - nir->op2 = ir->op2; - } else -#endif - if (ir->o == IR_CONV) { /* See above, too. */ - IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK); -#if LJ_32 && LJ_HASFFI - if (st == IRT_I64 || st == IRT_U64) { /* Conversion from 64 bit int. */ -#if LJ_SOFTFP - if (irt_isfloat(ir->t)) { - split_call_l(J, hisubst, oir, ir, - st == IRT_I64 ? IRCALL_fp64_l2f : IRCALL_fp64_ul2f); - J->cur.nins--; /* Drop unused HIOP. */ - } -#else - if (irt_isfp(ir->t)) { /* 64 bit integer to FP conversion. */ - ir->prev = split_emit(J, IRT(IR_HIOP, irt_type(ir->t)), - hisubst[ir->op1], nref); - } -#endif - else { /* Truncate to lower 32 bits. */ - fwdlo: - ir->prev = nir->op1; /* Forward loword. */ - /* Replace with NOP to avoid messing up the snapshot logic. */ - nir->ot = IRT(IR_NOP, IRT_NIL); - nir->op1 = nir->op2 = 0; - } - } -#endif -#if LJ_SOFTFP && LJ_32 && LJ_HASFFI - else if (irt_isfloat(ir->t)) { - if (st == IRT_NUM) { - split_call_l(J, hisubst, oir, ir, IRCALL_softfp_d2f); - J->cur.nins--; /* Drop unused HIOP. */ - } else { - nir->o = IR_CALLN; - nir->op2 = st == IRT_INT ? IRCALL_softfp_i2f : IRCALL_softfp_ui2f; - } - } else if (st == IRT_FLOAT) { - nir->o = IR_CALLN; - nir->op2 = irt_isint(ir->t) ? IRCALL_softfp_f2i : IRCALL_softfp_f2ui; - } else -#endif -#if LJ_SOFTFP - if (st == IRT_NUM || (LJ_32 && LJ_HASFFI && st == IRT_FLOAT)) { - if (irt_isguard(ir->t)) { - lua_assert(st == IRT_NUM && irt_isint(ir->t)); - J->cur.nins--; - ir->prev = split_num2int(J, nir->op1, hisubst[ir->op1], 1); - } else { - split_call_l(J, hisubst, oir, ir, -#if LJ_32 && LJ_HASFFI - st == IRT_NUM ? - (irt_isint(ir->t) ? IRCALL_softfp_d2i : IRCALL_softfp_d2ui) : - (irt_isint(ir->t) ? IRCALL_softfp_f2i : IRCALL_softfp_f2ui) -#else - IRCALL_softfp_d2i -#endif - ); - J->cur.nins--; /* Drop unused HIOP. */ - } - } -#endif - } else if (ir->o == IR_CALLXS) { - IRRef hiref; - split_call: - hiref = hisubst[ir->op1]; - if (hiref) { - IROpT ot = nir->ot; - IRRef op2 = nir->op2; - nir->ot = IRT(IR_CARG, IRT_NIL); -#if LJ_LE - nir->op2 = hiref; -#else - nir->op2 = nir->op1; nir->op1 = hiref; -#endif - ir->prev = nref = split_emit(J, ot, nref, op2); - } - if (LJ_SOFTFP ? irt_is64(ir->t) : irt_isint64(ir->t)) - hi = split_emit(J, - IRT(IR_HIOP, (LJ_SOFTFP && irt_isnum(ir->t)) ? IRT_SOFTFP : IRT_INT), - nref, nref); - } else if (ir->o == IR_CARG) { - IRRef hiref = hisubst[ir->op1]; - if (hiref) { - IRRef op2 = nir->op2; -#if LJ_LE - nir->op2 = hiref; -#else - nir->op2 = nir->op1; nir->op1 = hiref; -#endif - ir->prev = nref = split_emit(J, IRT(IR_CARG, IRT_NIL), nref, op2); - nir = IR(nref); - } - hiref = hisubst[ir->op2]; - if (hiref) { -#if !LJ_TARGET_X86 - int carg = 0; - IRIns *cir; - for (cir = IR(nir->op1); cir->o == IR_CARG; cir = IR(cir->op1)) - carg++; - if ((carg & 1) == 0) { /* Align 64 bit arguments. */ - IRRef op2 = nir->op2; - nir->op2 = REF_NIL; - nref = split_emit(J, IRT(IR_CARG, IRT_NIL), nref, op2); - nir = IR(nref); - } -#endif -#if LJ_BE - { IRRef tmp = nir->op2; nir->op2 = hiref; hiref = tmp; } -#endif - ir->prev = split_emit(J, IRT(IR_CARG, IRT_NIL), nref, hiref); - } - } else if (ir->o == IR_CNEWI) { - if (hisubst[ir->op2]) - split_emit(J, IRT(IR_HIOP, IRT_NIL), nref, hisubst[ir->op2]); - } else if (ir->o == IR_LOOP) { - J->loopref = nref; /* Needed by assembler. */ - } - hisubst[ref] = hi; /* Store hiword substitution. */ - } - if (snref == nins) { /* Substitution for last snapshot. */ - snap->ref = J->cur.nins; - split_subst_snap(J, snap, oir); - } - - /* Add PHI marks. */ - for (ref = J->cur.nins-1; ref >= REF_FIRST; ref--) { - IRIns *ir = IR(ref); - if (ir->o != IR_PHI) break; - if (!irref_isk(ir->op1)) irt_setphi(IR(ir->op1)->t); - if (ir->op2 > J->loopref) irt_setphi(IR(ir->op2)->t); - } -} - -/* Protected callback for split pass. */ -static TValue *cpsplit(lua_State *L, lua_CFunction dummy, void *ud) -{ - jit_State *J = (jit_State *)ud; - split_ir(J); - UNUSED(L); UNUSED(dummy); - return NULL; -} - -#if defined(LUA_USE_ASSERT) || LJ_SOFTFP -/* Slow, but sure way to check whether a SPLIT pass is needed. */ -static int split_needsplit(jit_State *J) -{ - IRIns *ir, *irend; - IRRef ref; - for (ir = IR(REF_FIRST), irend = IR(J->cur.nins); ir < irend; ir++) - if (LJ_SOFTFP ? irt_is64orfp(ir->t) : irt_isint64(ir->t)) - return 1; - if (LJ_SOFTFP) { - for (ref = J->chain[IR_SLOAD]; ref; ref = IR(ref)->prev) - if ((IR(ref)->op2 & IRSLOAD_CONVERT)) - return 1; - if (J->chain[IR_TOBIT]) - return 1; - } - for (ref = J->chain[IR_CONV]; ref; ref = IR(ref)->prev) { - IRType st = (IR(ref)->op2 & IRCONV_SRCMASK); - if ((LJ_SOFTFP && (st == IRT_NUM || st == IRT_FLOAT)) || - st == IRT_I64 || st == IRT_U64) - return 1; - } - return 0; /* Nope. */ -} -#endif - -/* SPLIT pass. */ -void lj_opt_split(jit_State *J) -{ -#if LJ_SOFTFP - if (!J->needsplit) - J->needsplit = split_needsplit(J); -#else - lua_assert(J->needsplit >= split_needsplit(J)); /* Verify flag. */ -#endif - if (J->needsplit) { - int errcode = lj_vm_cpcall(J->L, NULL, J, cpsplit); - if (errcode) { - /* Completely reset the trace to avoid inconsistent dump on abort. */ - J->cur.nins = J->cur.nk = REF_BASE; - J->cur.nsnap = 0; - lj_err_throw(J->L, errcode); /* Propagate errors. */ - } - } -} - -#undef IR - -#endif diff --git a/subprojects/luajit/src/lj_parse.c b/subprojects/luajit/src/lj_parse.c deleted file mode 100644 index 9e5976f71..000000000 --- a/subprojects/luajit/src/lj_parse.c +++ /dev/null @@ -1,2756 +0,0 @@ -/* -** Lua parser (source code -> bytecode). -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#define lj_parse_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_debug.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_func.h" -#include "lj_state.h" -#include "lj_bc.h" -#if LJ_HASFFI -#include "lj_ctype.h" -#endif -#include "lj_lex.h" -#include "lj_parse.h" -#include "lj_vm.h" -#include "lj_vmevent.h" - -/* -- Parser structures and definitions ----------------------------------- */ - -/* Expression kinds. */ -typedef enum { - /* Constant expressions must be first and in this order: */ - VKNIL, - VKFALSE, - VKTRUE, - VKSTR, /* sval = string value */ - VKNUM, /* nval = number value */ - VKLAST = VKNUM, - VKCDATA, /* nval = cdata value, not treated as a constant expression */ - /* Non-constant expressions follow: */ - VLOCAL, /* info = local register, aux = vstack index */ - VUPVAL, /* info = upvalue index, aux = vstack index */ - VGLOBAL, /* sval = string value */ - VINDEXED, /* info = table register, aux = index reg/byte/string const */ - VJMP, /* info = instruction PC */ - VRELOCABLE, /* info = instruction PC */ - VNONRELOC, /* info = result register */ - VCALL, /* info = instruction PC, aux = base */ - VVOID -} ExpKind; - -/* Expression descriptor. */ -typedef struct ExpDesc { - union { - struct { - uint32_t info; /* Primary info. */ - uint32_t aux; /* Secondary info. */ - } s; - TValue nval; /* Number value. */ - GCstr *sval; /* String value. */ - } u; - ExpKind k; - BCPos t; /* True condition jump list. */ - BCPos f; /* False condition jump list. */ -} ExpDesc; - -/* Macros for expressions. */ -#define expr_hasjump(e) ((e)->t != (e)->f) - -#define expr_isk(e) ((e)->k <= VKLAST) -#define expr_isk_nojump(e) (expr_isk(e) && !expr_hasjump(e)) -#define expr_isnumk(e) ((e)->k == VKNUM) -#define expr_isnumk_nojump(e) (expr_isnumk(e) && !expr_hasjump(e)) -#define expr_isstrk(e) ((e)->k == VKSTR) - -#define expr_numtv(e) check_exp(expr_isnumk((e)), &(e)->u.nval) -#define expr_numberV(e) numberVnum(expr_numtv((e))) - -/* Initialize expression. */ -static LJ_AINLINE void expr_init(ExpDesc *e, ExpKind k, uint32_t info) -{ - e->k = k; - e->u.s.info = info; - e->f = e->t = NO_JMP; -} - -/* Check number constant for +-0. */ -static int expr_numiszero(ExpDesc *e) -{ - TValue *o = expr_numtv(e); - return tvisint(o) ? (intV(o) == 0) : tviszero(o); -} - -/* Per-function linked list of scope blocks. */ -typedef struct FuncScope { - struct FuncScope *prev; /* Link to outer scope. */ - MSize vstart; /* Start of block-local variables. */ - uint8_t nactvar; /* Number of active vars outside the scope. */ - uint8_t flags; /* Scope flags. */ -} FuncScope; - -#define FSCOPE_LOOP 0x01 /* Scope is a (breakable) loop. */ -#define FSCOPE_BREAK 0x02 /* Break used in scope. */ -#define FSCOPE_GOLA 0x04 /* Goto or label used in scope. */ -#define FSCOPE_UPVAL 0x08 /* Upvalue in scope. */ -#define FSCOPE_NOCLOSE 0x10 /* Do not close upvalues. */ - -#define NAME_BREAK ((GCstr *)(uintptr_t)1) - -/* Index into variable stack. */ -typedef uint16_t VarIndex; -#define LJ_MAX_VSTACK (65536 - LJ_MAX_UPVAL) - -/* Variable/goto/label info. */ -#define VSTACK_VAR_RW 0x01 /* R/W variable. */ -#define VSTACK_GOTO 0x02 /* Pending goto. */ -#define VSTACK_LABEL 0x04 /* Label. */ - -/* Per-function state. */ -typedef struct FuncState { - GCtab *kt; /* Hash table for constants. */ - LexState *ls; /* Lexer state. */ - lua_State *L; /* Lua state. */ - FuncScope *bl; /* Current scope. */ - struct FuncState *prev; /* Enclosing function. */ - BCPos pc; /* Next bytecode position. */ - BCPos lasttarget; /* Bytecode position of last jump target. */ - BCPos jpc; /* Pending jump list to next bytecode. */ - BCReg freereg; /* First free register. */ - BCReg nactvar; /* Number of active local variables. */ - BCReg nkn, nkgc; /* Number of lua_Number/GCobj constants */ - BCLine linedefined; /* First line of the function definition. */ - BCInsLine *bcbase; /* Base of bytecode stack. */ - BCPos bclim; /* Limit of bytecode stack. */ - MSize vbase; /* Base of variable stack for this function. */ - uint8_t flags; /* Prototype flags. */ - uint8_t numparams; /* Number of parameters. */ - uint8_t framesize; /* Fixed frame size. */ - uint8_t nuv; /* Number of upvalues */ - VarIndex varmap[LJ_MAX_LOCVAR]; /* Map from register to variable idx. */ - VarIndex uvmap[LJ_MAX_UPVAL]; /* Map from upvalue to variable idx. */ - VarIndex uvtmp[LJ_MAX_UPVAL]; /* Temporary upvalue map. */ -} FuncState; - -/* Binary and unary operators. ORDER OPR */ -typedef enum BinOpr { - OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW, /* ORDER ARITH */ - OPR_CONCAT, - OPR_NE, OPR_EQ, - OPR_LT, OPR_GE, OPR_LE, OPR_GT, - OPR_AND, OPR_OR, - OPR_NOBINOPR -} BinOpr; - -LJ_STATIC_ASSERT((int)BC_ISGE-(int)BC_ISLT == (int)OPR_GE-(int)OPR_LT); -LJ_STATIC_ASSERT((int)BC_ISLE-(int)BC_ISLT == (int)OPR_LE-(int)OPR_LT); -LJ_STATIC_ASSERT((int)BC_ISGT-(int)BC_ISLT == (int)OPR_GT-(int)OPR_LT); -LJ_STATIC_ASSERT((int)BC_SUBVV-(int)BC_ADDVV == (int)OPR_SUB-(int)OPR_ADD); -LJ_STATIC_ASSERT((int)BC_MULVV-(int)BC_ADDVV == (int)OPR_MUL-(int)OPR_ADD); -LJ_STATIC_ASSERT((int)BC_DIVVV-(int)BC_ADDVV == (int)OPR_DIV-(int)OPR_ADD); -LJ_STATIC_ASSERT((int)BC_MODVV-(int)BC_ADDVV == (int)OPR_MOD-(int)OPR_ADD); - -/* -- Error handling ------------------------------------------------------ */ - -LJ_NORET LJ_NOINLINE static void err_syntax(LexState *ls, ErrMsg em) -{ - lj_lex_error(ls, ls->token, em); -} - -LJ_NORET LJ_NOINLINE static void err_token(LexState *ls, LexToken token) -{ - lj_lex_error(ls, ls->token, LJ_ERR_XTOKEN, lj_lex_token2str(ls, token)); -} - -LJ_NORET static void err_limit(FuncState *fs, uint32_t limit, const char *what) -{ - if (fs->linedefined == 0) - lj_lex_error(fs->ls, 0, LJ_ERR_XLIMM, limit, what); - else - lj_lex_error(fs->ls, 0, LJ_ERR_XLIMF, fs->linedefined, limit, what); -} - -#define checklimit(fs, v, l, m) if ((v) >= (l)) err_limit(fs, l, m) -#define checklimitgt(fs, v, l, m) if ((v) > (l)) err_limit(fs, l, m) -#define checkcond(ls, c, em) { if (!(c)) err_syntax(ls, em); } - -/* -- Management of constants --------------------------------------------- */ - -/* Return bytecode encoding for primitive constant. */ -#define const_pri(e) check_exp((e)->k <= VKTRUE, (e)->k) - -#define tvhaskslot(o) ((o)->u32.hi == 0) -#define tvkslot(o) ((o)->u32.lo) - -/* Add a number constant. */ -static BCReg const_num(FuncState *fs, ExpDesc *e) -{ - lua_State *L = fs->L; - TValue *o; - lua_assert(expr_isnumk(e)); - o = lj_tab_set(L, fs->kt, &e->u.nval); - if (tvhaskslot(o)) - return tvkslot(o); - o->u64 = fs->nkn; - return fs->nkn++; -} - -/* Add a GC object constant. */ -static BCReg const_gc(FuncState *fs, GCobj *gc, uint32_t itype) -{ - lua_State *L = fs->L; - TValue key, *o; - setgcV(L, &key, gc, itype); - /* NOBARRIER: the key is new or kept alive. */ - o = lj_tab_set(L, fs->kt, &key); - if (tvhaskslot(o)) - return tvkslot(o); - o->u64 = fs->nkgc; - return fs->nkgc++; -} - -/* Add a string constant. */ -static BCReg const_str(FuncState *fs, ExpDesc *e) -{ - lua_assert(expr_isstrk(e) || e->k == VGLOBAL); - return const_gc(fs, obj2gco(e->u.sval), LJ_TSTR); -} - -/* Anchor string constant to avoid GC. */ -GCstr *lj_parse_keepstr(LexState *ls, const char *str, size_t len) -{ - /* NOBARRIER: the key is new or kept alive. */ - lua_State *L = ls->L; - GCstr *s = lj_str_new(L, str, len); - TValue *tv = lj_tab_setstr(L, ls->fs->kt, s); - if (tvisnil(tv)) setboolV(tv, 1); - lj_gc_check(L); - return s; -} - -#if LJ_HASFFI -/* Anchor cdata to avoid GC. */ -void lj_parse_keepcdata(LexState *ls, TValue *tv, GCcdata *cd) -{ - /* NOBARRIER: the key is new or kept alive. */ - lua_State *L = ls->L; - setcdataV(L, tv, cd); - setboolV(lj_tab_set(L, ls->fs->kt, tv), 1); -} -#endif - -/* -- Jump list handling -------------------------------------------------- */ - -/* Get next element in jump list. */ -static BCPos jmp_next(FuncState *fs, BCPos pc) -{ - ptrdiff_t delta = bc_j(fs->bcbase[pc].ins); - if ((BCPos)delta == NO_JMP) - return NO_JMP; - else - return (BCPos)(((ptrdiff_t)pc+1)+delta); -} - -/* Check if any of the instructions on the jump list produce no value. */ -static int jmp_novalue(FuncState *fs, BCPos list) -{ - for (; list != NO_JMP; list = jmp_next(fs, list)) { - BCIns p = fs->bcbase[list >= 1 ? list-1 : list].ins; - if (!(bc_op(p) == BC_ISTC || bc_op(p) == BC_ISFC || bc_a(p) == NO_REG)) - return 1; - } - return 0; -} - -/* Patch register of test instructions. */ -static int jmp_patchtestreg(FuncState *fs, BCPos pc, BCReg reg) -{ - BCInsLine *ilp = &fs->bcbase[pc >= 1 ? pc-1 : pc]; - BCOp op = bc_op(ilp->ins); - if (op == BC_ISTC || op == BC_ISFC) { - if (reg != NO_REG && reg != bc_d(ilp->ins)) { - setbc_a(&ilp->ins, reg); - } else { /* Nothing to store or already in the right register. */ - setbc_op(&ilp->ins, op+(BC_IST-BC_ISTC)); - setbc_a(&ilp->ins, 0); - } - } else if (bc_a(ilp->ins) == NO_REG) { - if (reg == NO_REG) { - ilp->ins = BCINS_AJ(BC_JMP, bc_a(fs->bcbase[pc].ins), 0); - } else { - setbc_a(&ilp->ins, reg); - if (reg >= bc_a(ilp[1].ins)) - setbc_a(&ilp[1].ins, reg+1); - } - } else { - return 0; /* Cannot patch other instructions. */ - } - return 1; -} - -/* Drop values for all instructions on jump list. */ -static void jmp_dropval(FuncState *fs, BCPos list) -{ - for (; list != NO_JMP; list = jmp_next(fs, list)) - jmp_patchtestreg(fs, list, NO_REG); -} - -/* Patch jump instruction to target. */ -static void jmp_patchins(FuncState *fs, BCPos pc, BCPos dest) -{ - BCIns *jmp = &fs->bcbase[pc].ins; - BCPos offset = dest-(pc+1)+BCBIAS_J; - lua_assert(dest != NO_JMP); - if (offset > BCMAX_D) - err_syntax(fs->ls, LJ_ERR_XJUMP); - setbc_d(jmp, offset); -} - -/* Append to jump list. */ -static void jmp_append(FuncState *fs, BCPos *l1, BCPos l2) -{ - if (l2 == NO_JMP) { - return; - } else if (*l1 == NO_JMP) { - *l1 = l2; - } else { - BCPos list = *l1; - BCPos next; - while ((next = jmp_next(fs, list)) != NO_JMP) /* Find last element. */ - list = next; - jmp_patchins(fs, list, l2); - } -} - -/* Patch jump list and preserve produced values. */ -static void jmp_patchval(FuncState *fs, BCPos list, BCPos vtarget, - BCReg reg, BCPos dtarget) -{ - while (list != NO_JMP) { - BCPos next = jmp_next(fs, list); - if (jmp_patchtestreg(fs, list, reg)) - jmp_patchins(fs, list, vtarget); /* Jump to target with value. */ - else - jmp_patchins(fs, list, dtarget); /* Jump to default target. */ - list = next; - } -} - -/* Jump to following instruction. Append to list of pending jumps. */ -static void jmp_tohere(FuncState *fs, BCPos list) -{ - fs->lasttarget = fs->pc; - jmp_append(fs, &fs->jpc, list); -} - -/* Patch jump list to target. */ -static void jmp_patch(FuncState *fs, BCPos list, BCPos target) -{ - if (target == fs->pc) { - jmp_tohere(fs, list); - } else { - lua_assert(target < fs->pc); - jmp_patchval(fs, list, target, NO_REG, target); - } -} - -/* -- Bytecode register allocator ----------------------------------------- */ - -/* Bump frame size. */ -static void bcreg_bump(FuncState *fs, BCReg n) -{ - BCReg sz = fs->freereg + n; - if (sz > fs->framesize) { - if (sz >= LJ_MAX_SLOTS) - err_syntax(fs->ls, LJ_ERR_XSLOTS); - fs->framesize = (uint8_t)sz; - } -} - -/* Reserve registers. */ -static void bcreg_reserve(FuncState *fs, BCReg n) -{ - bcreg_bump(fs, n); - fs->freereg += n; -} - -/* Free register. */ -static void bcreg_free(FuncState *fs, BCReg reg) -{ - if (reg >= fs->nactvar) { - fs->freereg--; - lua_assert(reg == fs->freereg); - } -} - -/* Free register for expression. */ -static void expr_free(FuncState *fs, ExpDesc *e) -{ - if (e->k == VNONRELOC) - bcreg_free(fs, e->u.s.info); -} - -/* -- Bytecode emitter ---------------------------------------------------- */ - -/* Emit bytecode instruction. */ -static BCPos bcemit_INS(FuncState *fs, BCIns ins) -{ - BCPos pc = fs->pc; - LexState *ls = fs->ls; - jmp_patchval(fs, fs->jpc, pc, NO_REG, pc); - fs->jpc = NO_JMP; - if (LJ_UNLIKELY(pc >= fs->bclim)) { - ptrdiff_t base = fs->bcbase - ls->bcstack; - checklimit(fs, ls->sizebcstack, LJ_MAX_BCINS, "bytecode instructions"); - lj_mem_growvec(fs->L, ls->bcstack, ls->sizebcstack, LJ_MAX_BCINS,BCInsLine); - fs->bclim = (BCPos)(ls->sizebcstack - base); - fs->bcbase = ls->bcstack + base; - } - fs->bcbase[pc].ins = ins; - fs->bcbase[pc].line = ls->lastline; - fs->pc = pc+1; - return pc; -} - -#define bcemit_ABC(fs, o, a, b, c) bcemit_INS(fs, BCINS_ABC(o, a, b, c)) -#define bcemit_AD(fs, o, a, d) bcemit_INS(fs, BCINS_AD(o, a, d)) -#define bcemit_AJ(fs, o, a, j) bcemit_INS(fs, BCINS_AJ(o, a, j)) - -#define bcptr(fs, e) (&(fs)->bcbase[(e)->u.s.info].ins) - -/* -- Bytecode emitter for expressions ------------------------------------ */ - -/* Discharge non-constant expression to any register. */ -static void expr_discharge(FuncState *fs, ExpDesc *e) -{ - BCIns ins; - if (e->k == VUPVAL) { - ins = BCINS_AD(BC_UGET, 0, e->u.s.info); - } else if (e->k == VGLOBAL) { - ins = BCINS_AD(BC_GGET, 0, const_str(fs, e)); - } else if (e->k == VINDEXED) { - BCReg rc = e->u.s.aux; - if ((int32_t)rc < 0) { - ins = BCINS_ABC(BC_TGETS, 0, e->u.s.info, ~rc); - } else if (rc > BCMAX_C) { - ins = BCINS_ABC(BC_TGETB, 0, e->u.s.info, rc-(BCMAX_C+1)); - } else { - bcreg_free(fs, rc); - ins = BCINS_ABC(BC_TGETV, 0, e->u.s.info, rc); - } - bcreg_free(fs, e->u.s.info); - } else if (e->k == VCALL) { - e->u.s.info = e->u.s.aux; - e->k = VNONRELOC; - return; - } else if (e->k == VLOCAL) { - e->k = VNONRELOC; - return; - } else { - return; - } - e->u.s.info = bcemit_INS(fs, ins); - e->k = VRELOCABLE; -} - -/* Emit bytecode to set a range of registers to nil. */ -static void bcemit_nil(FuncState *fs, BCReg from, BCReg n) -{ - if (fs->pc > fs->lasttarget) { /* No jumps to current position? */ - BCIns *ip = &fs->bcbase[fs->pc-1].ins; - BCReg pto, pfrom = bc_a(*ip); - switch (bc_op(*ip)) { /* Try to merge with the previous instruction. */ - case BC_KPRI: - if (bc_d(*ip) != ~LJ_TNIL) break; - if (from == pfrom) { - if (n == 1) return; - } else if (from == pfrom+1) { - from = pfrom; - n++; - } else { - break; - } - *ip = BCINS_AD(BC_KNIL, from, from+n-1); /* Replace KPRI. */ - return; - case BC_KNIL: - pto = bc_d(*ip); - if (pfrom <= from && from <= pto+1) { /* Can we connect both ranges? */ - if (from+n-1 > pto) - setbc_d(ip, from+n-1); /* Patch previous instruction range. */ - return; - } - break; - default: - break; - } - } - /* Emit new instruction or replace old instruction. */ - bcemit_INS(fs, n == 1 ? BCINS_AD(BC_KPRI, from, VKNIL) : - BCINS_AD(BC_KNIL, from, from+n-1)); -} - -/* Discharge an expression to a specific register. Ignore branches. */ -static void expr_toreg_nobranch(FuncState *fs, ExpDesc *e, BCReg reg) -{ - BCIns ins; - expr_discharge(fs, e); - if (e->k == VKSTR) { - ins = BCINS_AD(BC_KSTR, reg, const_str(fs, e)); - } else if (e->k == VKNUM) { -#if LJ_DUALNUM - cTValue *tv = expr_numtv(e); - if (tvisint(tv) && checki16(intV(tv))) - ins = BCINS_AD(BC_KSHORT, reg, (BCReg)(uint16_t)intV(tv)); - else -#else - lua_Number n = expr_numberV(e); - int32_t k = lj_num2int(n); - if (checki16(k) && n == (lua_Number)k) - ins = BCINS_AD(BC_KSHORT, reg, (BCReg)(uint16_t)k); - else -#endif - ins = BCINS_AD(BC_KNUM, reg, const_num(fs, e)); -#if LJ_HASFFI - } else if (e->k == VKCDATA) { - fs->flags |= PROTO_FFI; - ins = BCINS_AD(BC_KCDATA, reg, - const_gc(fs, obj2gco(cdataV(&e->u.nval)), LJ_TCDATA)); -#endif - } else if (e->k == VRELOCABLE) { - setbc_a(bcptr(fs, e), reg); - goto noins; - } else if (e->k == VNONRELOC) { - if (reg == e->u.s.info) - goto noins; - ins = BCINS_AD(BC_MOV, reg, e->u.s.info); - } else if (e->k == VKNIL) { - bcemit_nil(fs, reg, 1); - goto noins; - } else if (e->k <= VKTRUE) { - ins = BCINS_AD(BC_KPRI, reg, const_pri(e)); - } else { - lua_assert(e->k == VVOID || e->k == VJMP); - return; - } - bcemit_INS(fs, ins); -noins: - e->u.s.info = reg; - e->k = VNONRELOC; -} - -/* Forward declaration. */ -static BCPos bcemit_jmp(FuncState *fs); - -/* Discharge an expression to a specific register. */ -static void expr_toreg(FuncState *fs, ExpDesc *e, BCReg reg) -{ - expr_toreg_nobranch(fs, e, reg); - if (e->k == VJMP) - jmp_append(fs, &e->t, e->u.s.info); /* Add it to the true jump list. */ - if (expr_hasjump(e)) { /* Discharge expression with branches. */ - BCPos jend, jfalse = NO_JMP, jtrue = NO_JMP; - if (jmp_novalue(fs, e->t) || jmp_novalue(fs, e->f)) { - BCPos jval = (e->k == VJMP) ? NO_JMP : bcemit_jmp(fs); - jfalse = bcemit_AD(fs, BC_KPRI, reg, VKFALSE); - bcemit_AJ(fs, BC_JMP, fs->freereg, 1); - jtrue = bcemit_AD(fs, BC_KPRI, reg, VKTRUE); - jmp_tohere(fs, jval); - } - jend = fs->pc; - fs->lasttarget = jend; - jmp_patchval(fs, e->f, jend, reg, jfalse); - jmp_patchval(fs, e->t, jend, reg, jtrue); - } - e->f = e->t = NO_JMP; - e->u.s.info = reg; - e->k = VNONRELOC; -} - -/* Discharge an expression to the next free register. */ -static void expr_tonextreg(FuncState *fs, ExpDesc *e) -{ - expr_discharge(fs, e); - expr_free(fs, e); - bcreg_reserve(fs, 1); - expr_toreg(fs, e, fs->freereg - 1); -} - -/* Discharge an expression to any register. */ -static BCReg expr_toanyreg(FuncState *fs, ExpDesc *e) -{ - expr_discharge(fs, e); - if (e->k == VNONRELOC) { - if (!expr_hasjump(e)) return e->u.s.info; /* Already in a register. */ - if (e->u.s.info >= fs->nactvar) { - expr_toreg(fs, e, e->u.s.info); /* Discharge to temp. register. */ - return e->u.s.info; - } - } - expr_tonextreg(fs, e); /* Discharge to next register. */ - return e->u.s.info; -} - -/* Partially discharge expression to a value. */ -static void expr_toval(FuncState *fs, ExpDesc *e) -{ - if (expr_hasjump(e)) - expr_toanyreg(fs, e); - else - expr_discharge(fs, e); -} - -/* Emit store for LHS expression. */ -static void bcemit_store(FuncState *fs, ExpDesc *var, ExpDesc *e) -{ - BCIns ins; - if (var->k == VLOCAL) { - fs->ls->vstack[var->u.s.aux].info |= VSTACK_VAR_RW; - expr_free(fs, e); - expr_toreg(fs, e, var->u.s.info); - return; - } else if (var->k == VUPVAL) { - fs->ls->vstack[var->u.s.aux].info |= VSTACK_VAR_RW; - expr_toval(fs, e); - if (e->k <= VKTRUE) - ins = BCINS_AD(BC_USETP, var->u.s.info, const_pri(e)); - else if (e->k == VKSTR) - ins = BCINS_AD(BC_USETS, var->u.s.info, const_str(fs, e)); - else if (e->k == VKNUM) - ins = BCINS_AD(BC_USETN, var->u.s.info, const_num(fs, e)); - else - ins = BCINS_AD(BC_USETV, var->u.s.info, expr_toanyreg(fs, e)); - } else if (var->k == VGLOBAL) { - BCReg ra = expr_toanyreg(fs, e); - ins = BCINS_AD(BC_GSET, ra, const_str(fs, var)); - } else { - BCReg ra, rc; - lua_assert(var->k == VINDEXED); - ra = expr_toanyreg(fs, e); - rc = var->u.s.aux; - if ((int32_t)rc < 0) { - ins = BCINS_ABC(BC_TSETS, ra, var->u.s.info, ~rc); - } else if (rc > BCMAX_C) { - ins = BCINS_ABC(BC_TSETB, ra, var->u.s.info, rc-(BCMAX_C+1)); - } else { - /* Free late alloced key reg to avoid assert on free of value reg. */ - /* This can only happen when called from expr_table(). */ - lua_assert(e->k != VNONRELOC || ra < fs->nactvar || - rc < ra || (bcreg_free(fs, rc),1)); - ins = BCINS_ABC(BC_TSETV, ra, var->u.s.info, rc); - } - } - bcemit_INS(fs, ins); - expr_free(fs, e); -} - -/* Emit method lookup expression. */ -static void bcemit_method(FuncState *fs, ExpDesc *e, ExpDesc *key) -{ - BCReg idx, func, obj = expr_toanyreg(fs, e); - expr_free(fs, e); - func = fs->freereg; - bcemit_AD(fs, BC_MOV, func+1, obj); /* Copy object to first argument. */ - lua_assert(expr_isstrk(key)); - idx = const_str(fs, key); - if (idx <= BCMAX_C) { - bcreg_reserve(fs, 2); - bcemit_ABC(fs, BC_TGETS, func, obj, idx); - } else { - bcreg_reserve(fs, 3); - bcemit_AD(fs, BC_KSTR, func+2, idx); - bcemit_ABC(fs, BC_TGETV, func, obj, func+2); - fs->freereg--; - } - e->u.s.info = func; - e->k = VNONRELOC; -} - -/* -- Bytecode emitter for branches --------------------------------------- */ - -/* Emit unconditional branch. */ -static BCPos bcemit_jmp(FuncState *fs) -{ - BCPos jpc = fs->jpc; - BCPos j = fs->pc - 1; - BCIns *ip = &fs->bcbase[j].ins; - fs->jpc = NO_JMP; - if ((int32_t)j >= (int32_t)fs->lasttarget && bc_op(*ip) == BC_UCLO) { - setbc_j(ip, NO_JMP); - fs->lasttarget = j+1; - } else { - j = bcemit_AJ(fs, BC_JMP, fs->freereg, NO_JMP); - } - jmp_append(fs, &j, jpc); - return j; -} - -/* Invert branch condition of bytecode instruction. */ -static void invertcond(FuncState *fs, ExpDesc *e) -{ - BCIns *ip = &fs->bcbase[e->u.s.info - 1].ins; - setbc_op(ip, bc_op(*ip)^1); -} - -/* Emit conditional branch. */ -static BCPos bcemit_branch(FuncState *fs, ExpDesc *e, int cond) -{ - BCPos pc; - if (e->k == VRELOCABLE) { - BCIns *ip = bcptr(fs, e); - if (bc_op(*ip) == BC_NOT) { - *ip = BCINS_AD(cond ? BC_ISF : BC_IST, 0, bc_d(*ip)); - return bcemit_jmp(fs); - } - } - if (e->k != VNONRELOC) { - bcreg_reserve(fs, 1); - expr_toreg_nobranch(fs, e, fs->freereg-1); - } - bcemit_AD(fs, cond ? BC_ISTC : BC_ISFC, NO_REG, e->u.s.info); - pc = bcemit_jmp(fs); - expr_free(fs, e); - return pc; -} - -/* Emit branch on true condition. */ -static void bcemit_branch_t(FuncState *fs, ExpDesc *e) -{ - BCPos pc; - expr_discharge(fs, e); - if (e->k == VKSTR || e->k == VKNUM || e->k == VKTRUE) - pc = NO_JMP; /* Never jump. */ - else if (e->k == VJMP) - invertcond(fs, e), pc = e->u.s.info; - else if (e->k == VKFALSE || e->k == VKNIL) - expr_toreg_nobranch(fs, e, NO_REG), pc = bcemit_jmp(fs); - else - pc = bcemit_branch(fs, e, 0); - jmp_append(fs, &e->f, pc); - jmp_tohere(fs, e->t); - e->t = NO_JMP; -} - -/* Emit branch on false condition. */ -static void bcemit_branch_f(FuncState *fs, ExpDesc *e) -{ - BCPos pc; - expr_discharge(fs, e); - if (e->k == VKNIL || e->k == VKFALSE) - pc = NO_JMP; /* Never jump. */ - else if (e->k == VJMP) - pc = e->u.s.info; - else if (e->k == VKSTR || e->k == VKNUM || e->k == VKTRUE) - expr_toreg_nobranch(fs, e, NO_REG), pc = bcemit_jmp(fs); - else - pc = bcemit_branch(fs, e, 1); - jmp_append(fs, &e->t, pc); - jmp_tohere(fs, e->f); - e->f = NO_JMP; -} - -/* -- Bytecode emitter for operators -------------------------------------- */ - -/* Try constant-folding of arithmetic operators. */ -static int foldarith(BinOpr opr, ExpDesc *e1, ExpDesc *e2) -{ - TValue o; - lua_Number n; - if (!expr_isnumk_nojump(e1) || !expr_isnumk_nojump(e2)) return 0; - n = lj_vm_foldarith(expr_numberV(e1), expr_numberV(e2), (int)opr-OPR_ADD); - setnumV(&o, n); - if (tvisnan(&o) || tvismzero(&o)) return 0; /* Avoid NaN and -0 as consts. */ - if (LJ_DUALNUM) { - int32_t k = lj_num2int(n); - if ((lua_Number)k == n) { - setintV(&e1->u.nval, k); - return 1; - } - } - setnumV(&e1->u.nval, n); - return 1; -} - -/* Emit arithmetic operator. */ -static void bcemit_arith(FuncState *fs, BinOpr opr, ExpDesc *e1, ExpDesc *e2) -{ - BCReg rb, rc, t; - uint32_t op; - if (foldarith(opr, e1, e2)) - return; - if (opr == OPR_POW) { - op = BC_POW; - rc = expr_toanyreg(fs, e2); - rb = expr_toanyreg(fs, e1); - } else { - op = opr-OPR_ADD+BC_ADDVV; - /* Must discharge 2nd operand first since VINDEXED might free regs. */ - expr_toval(fs, e2); - if (expr_isnumk(e2) && (rc = const_num(fs, e2)) <= BCMAX_C) - op -= BC_ADDVV-BC_ADDVN; - else - rc = expr_toanyreg(fs, e2); - /* 1st operand discharged by bcemit_binop_left, but need KNUM/KSHORT. */ - lua_assert(expr_isnumk(e1) || e1->k == VNONRELOC); - expr_toval(fs, e1); - /* Avoid two consts to satisfy bytecode constraints. */ - if (expr_isnumk(e1) && !expr_isnumk(e2) && - (t = const_num(fs, e1)) <= BCMAX_B) { - rb = rc; rc = t; op -= BC_ADDVV-BC_ADDNV; - } else { - rb = expr_toanyreg(fs, e1); - } - } - /* Using expr_free might cause asserts if the order is wrong. */ - if (e1->k == VNONRELOC && e1->u.s.info >= fs->nactvar) fs->freereg--; - if (e2->k == VNONRELOC && e2->u.s.info >= fs->nactvar) fs->freereg--; - e1->u.s.info = bcemit_ABC(fs, op, 0, rb, rc); - e1->k = VRELOCABLE; -} - -/* Emit comparison operator. */ -static void bcemit_comp(FuncState *fs, BinOpr opr, ExpDesc *e1, ExpDesc *e2) -{ - ExpDesc *eret = e1; - BCIns ins; - expr_toval(fs, e1); - if (opr == OPR_EQ || opr == OPR_NE) { - BCOp op = opr == OPR_EQ ? BC_ISEQV : BC_ISNEV; - BCReg ra; - if (expr_isk(e1)) { e1 = e2; e2 = eret; } /* Need constant in 2nd arg. */ - ra = expr_toanyreg(fs, e1); /* First arg must be in a reg. */ - expr_toval(fs, e2); - switch (e2->k) { - case VKNIL: case VKFALSE: case VKTRUE: - ins = BCINS_AD(op+(BC_ISEQP-BC_ISEQV), ra, const_pri(e2)); - break; - case VKSTR: - ins = BCINS_AD(op+(BC_ISEQS-BC_ISEQV), ra, const_str(fs, e2)); - break; - case VKNUM: - ins = BCINS_AD(op+(BC_ISEQN-BC_ISEQV), ra, const_num(fs, e2)); - break; - default: - ins = BCINS_AD(op, ra, expr_toanyreg(fs, e2)); - break; - } - } else { - uint32_t op = opr-OPR_LT+BC_ISLT; - BCReg ra, rd; - if ((op-BC_ISLT) & 1) { /* GT -> LT, GE -> LE */ - e1 = e2; e2 = eret; /* Swap operands. */ - op = ((op-BC_ISLT)^3)+BC_ISLT; - expr_toval(fs, e1); - } - rd = expr_toanyreg(fs, e2); - ra = expr_toanyreg(fs, e1); - ins = BCINS_AD(op, ra, rd); - } - /* Using expr_free might cause asserts if the order is wrong. */ - if (e1->k == VNONRELOC && e1->u.s.info >= fs->nactvar) fs->freereg--; - if (e2->k == VNONRELOC && e2->u.s.info >= fs->nactvar) fs->freereg--; - bcemit_INS(fs, ins); - eret->u.s.info = bcemit_jmp(fs); - eret->k = VJMP; -} - -/* Fixup left side of binary operator. */ -static void bcemit_binop_left(FuncState *fs, BinOpr op, ExpDesc *e) -{ - if (op == OPR_AND) { - bcemit_branch_t(fs, e); - } else if (op == OPR_OR) { - bcemit_branch_f(fs, e); - } else if (op == OPR_CONCAT) { - expr_tonextreg(fs, e); - } else if (op == OPR_EQ || op == OPR_NE) { - if (!expr_isk_nojump(e)) expr_toanyreg(fs, e); - } else { - if (!expr_isnumk_nojump(e)) expr_toanyreg(fs, e); - } -} - -/* Emit binary operator. */ -static void bcemit_binop(FuncState *fs, BinOpr op, ExpDesc *e1, ExpDesc *e2) -{ - if (op <= OPR_POW) { - bcemit_arith(fs, op, e1, e2); - } else if (op == OPR_AND) { - lua_assert(e1->t == NO_JMP); /* List must be closed. */ - expr_discharge(fs, e2); - jmp_append(fs, &e2->f, e1->f); - *e1 = *e2; - } else if (op == OPR_OR) { - lua_assert(e1->f == NO_JMP); /* List must be closed. */ - expr_discharge(fs, e2); - jmp_append(fs, &e2->t, e1->t); - *e1 = *e2; - } else if (op == OPR_CONCAT) { - expr_toval(fs, e2); - if (e2->k == VRELOCABLE && bc_op(*bcptr(fs, e2)) == BC_CAT) { - lua_assert(e1->u.s.info == bc_b(*bcptr(fs, e2))-1); - expr_free(fs, e1); - setbc_b(bcptr(fs, e2), e1->u.s.info); - e1->u.s.info = e2->u.s.info; - } else { - expr_tonextreg(fs, e2); - expr_free(fs, e2); - expr_free(fs, e1); - e1->u.s.info = bcemit_ABC(fs, BC_CAT, 0, e1->u.s.info, e2->u.s.info); - } - e1->k = VRELOCABLE; - } else { - lua_assert(op == OPR_NE || op == OPR_EQ || - op == OPR_LT || op == OPR_GE || op == OPR_LE || op == OPR_GT); - bcemit_comp(fs, op, e1, e2); - } -} - -/* Emit unary operator. */ -static void bcemit_unop(FuncState *fs, BCOp op, ExpDesc *e) -{ - if (op == BC_NOT) { - /* Swap true and false lists. */ - { BCPos temp = e->f; e->f = e->t; e->t = temp; } - jmp_dropval(fs, e->f); - jmp_dropval(fs, e->t); - expr_discharge(fs, e); - if (e->k == VKNIL || e->k == VKFALSE) { - e->k = VKTRUE; - return; - } else if (expr_isk(e) || (LJ_HASFFI && e->k == VKCDATA)) { - e->k = VKFALSE; - return; - } else if (e->k == VJMP) { - invertcond(fs, e); - return; - } else if (e->k == VRELOCABLE) { - bcreg_reserve(fs, 1); - setbc_a(bcptr(fs, e), fs->freereg-1); - e->u.s.info = fs->freereg-1; - e->k = VNONRELOC; - } else { - lua_assert(e->k == VNONRELOC); - } - } else { - lua_assert(op == BC_UNM || op == BC_LEN); - if (op == BC_UNM && !expr_hasjump(e)) { /* Constant-fold negations. */ -#if LJ_HASFFI - if (e->k == VKCDATA) { /* Fold in-place since cdata is not interned. */ - GCcdata *cd = cdataV(&e->u.nval); - int64_t *p = (int64_t *)cdataptr(cd); - if (cd->ctypeid == CTID_COMPLEX_DOUBLE) - p[1] ^= (int64_t)U64x(80000000,00000000); - else - *p = -*p; - return; - } else -#endif - if (expr_isnumk(e) && !expr_numiszero(e)) { /* Avoid folding to -0. */ - TValue *o = expr_numtv(e); - if (tvisint(o)) { - int32_t k = intV(o); - if (k == -k) - setnumV(o, -(lua_Number)k); - else - setintV(o, -k); - return; - } else { - o->u64 ^= U64x(80000000,00000000); - return; - } - } - } - expr_toanyreg(fs, e); - } - expr_free(fs, e); - e->u.s.info = bcemit_AD(fs, op, 0, e->u.s.info); - e->k = VRELOCABLE; -} - -/* -- Lexer support ------------------------------------------------------- */ - -/* Check and consume optional token. */ -static int lex_opt(LexState *ls, LexToken tok) -{ - if (ls->token == tok) { - lj_lex_next(ls); - return 1; - } - return 0; -} - -/* Check and consume token. */ -static void lex_check(LexState *ls, LexToken tok) -{ - if (ls->token != tok) - err_token(ls, tok); - lj_lex_next(ls); -} - -/* Check for matching token. */ -static void lex_match(LexState *ls, LexToken what, LexToken who, BCLine line) -{ - if (!lex_opt(ls, what)) { - if (line == ls->linenumber) { - err_token(ls, what); - } else { - const char *swhat = lj_lex_token2str(ls, what); - const char *swho = lj_lex_token2str(ls, who); - lj_lex_error(ls, ls->token, LJ_ERR_XMATCH, swhat, swho, line); - } - } -} - -/* Check for string token. */ -static GCstr *lex_str(LexState *ls) -{ - GCstr *s; - if (ls->token != TK_name && (LJ_52 || ls->token != TK_goto)) - err_token(ls, TK_name); - s = strV(&ls->tokenval); - lj_lex_next(ls); - return s; -} - -/* -- Variable handling --------------------------------------------------- */ - -#define var_get(ls, fs, i) ((ls)->vstack[(fs)->varmap[(i)]]) - -/* Define a new local variable. */ -static void var_new(LexState *ls, BCReg n, GCstr *name) -{ - FuncState *fs = ls->fs; - MSize vtop = ls->vtop; - checklimit(fs, fs->nactvar+n, LJ_MAX_LOCVAR, "local variables"); - if (LJ_UNLIKELY(vtop >= ls->sizevstack)) { - if (ls->sizevstack >= LJ_MAX_VSTACK) - lj_lex_error(ls, 0, LJ_ERR_XLIMC, LJ_MAX_VSTACK); - lj_mem_growvec(ls->L, ls->vstack, ls->sizevstack, LJ_MAX_VSTACK, VarInfo); - } - lua_assert((uintptr_t)name < VARNAME__MAX || - lj_tab_getstr(fs->kt, name) != NULL); - /* NOBARRIER: name is anchored in fs->kt and ls->vstack is not a GCobj. */ - setgcref(ls->vstack[vtop].name, obj2gco(name)); - fs->varmap[fs->nactvar+n] = (uint16_t)vtop; - ls->vtop = vtop+1; -} - -#define var_new_lit(ls, n, v) \ - var_new(ls, (n), lj_parse_keepstr(ls, "" v, sizeof(v)-1)) - -#define var_new_fixed(ls, n, vn) \ - var_new(ls, (n), (GCstr *)(uintptr_t)(vn)) - -/* Add local variables. */ -static void var_add(LexState *ls, BCReg nvars) -{ - FuncState *fs = ls->fs; - BCReg nactvar = fs->nactvar; - while (nvars--) { - VarInfo *v = &var_get(ls, fs, nactvar); - v->startpc = fs->pc; - v->slot = nactvar++; - v->info = 0; - } - fs->nactvar = nactvar; -} - -/* Remove local variables. */ -static void var_remove(LexState *ls, BCReg tolevel) -{ - FuncState *fs = ls->fs; - while (fs->nactvar > tolevel) - var_get(ls, fs, --fs->nactvar).endpc = fs->pc; -} - -/* Lookup local variable name. */ -static BCReg var_lookup_local(FuncState *fs, GCstr *n) -{ - int i; - for (i = fs->nactvar-1; i >= 0; i--) { - if (n == strref(var_get(fs->ls, fs, i).name)) - return (BCReg)i; - } - return (BCReg)-1; /* Not found. */ -} - -/* Lookup or add upvalue index. */ -static MSize var_lookup_uv(FuncState *fs, MSize vidx, ExpDesc *e) -{ - MSize i, n = fs->nuv; - for (i = 0; i < n; i++) - if (fs->uvmap[i] == vidx) - return i; /* Already exists. */ - /* Otherwise create a new one. */ - checklimit(fs, fs->nuv, LJ_MAX_UPVAL, "upvalues"); - lua_assert(e->k == VLOCAL || e->k == VUPVAL); - fs->uvmap[n] = (uint16_t)vidx; - fs->uvtmp[n] = (uint16_t)(e->k == VLOCAL ? vidx : LJ_MAX_VSTACK+e->u.s.info); - fs->nuv = n+1; - return n; -} - -/* Forward declaration. */ -static void fscope_uvmark(FuncState *fs, BCReg level); - -/* Recursively lookup variables in enclosing functions. */ -static MSize var_lookup_(FuncState *fs, GCstr *name, ExpDesc *e, int first) -{ - if (fs) { - BCReg reg = var_lookup_local(fs, name); - if ((int32_t)reg >= 0) { /* Local in this function? */ - expr_init(e, VLOCAL, reg); - if (!first) - fscope_uvmark(fs, reg); /* Scope now has an upvalue. */ - return (MSize)(e->u.s.aux = (uint32_t)fs->varmap[reg]); - } else { - MSize vidx = var_lookup_(fs->prev, name, e, 0); /* Var in outer func? */ - if ((int32_t)vidx >= 0) { /* Yes, make it an upvalue here. */ - e->u.s.info = (uint8_t)var_lookup_uv(fs, vidx, e); - e->k = VUPVAL; - return vidx; - } - } - } else { /* Not found in any function, must be a global. */ - expr_init(e, VGLOBAL, 0); - e->u.sval = name; - } - return (MSize)-1; /* Global. */ -} - -/* Lookup variable name. */ -#define var_lookup(ls, e) \ - var_lookup_((ls)->fs, lex_str(ls), (e), 1) - -/* -- Goto an label handling ---------------------------------------------- */ - -/* Add a new goto or label. */ -static MSize gola_new(LexState *ls, GCstr *name, uint8_t info, BCPos pc) -{ - FuncState *fs = ls->fs; - MSize vtop = ls->vtop; - if (LJ_UNLIKELY(vtop >= ls->sizevstack)) { - if (ls->sizevstack >= LJ_MAX_VSTACK) - lj_lex_error(ls, 0, LJ_ERR_XLIMC, LJ_MAX_VSTACK); - lj_mem_growvec(ls->L, ls->vstack, ls->sizevstack, LJ_MAX_VSTACK, VarInfo); - } - lua_assert(name == NAME_BREAK || lj_tab_getstr(fs->kt, name) != NULL); - /* NOBARRIER: name is anchored in fs->kt and ls->vstack is not a GCobj. */ - setgcref(ls->vstack[vtop].name, obj2gco(name)); - ls->vstack[vtop].startpc = pc; - ls->vstack[vtop].slot = (uint8_t)fs->nactvar; - ls->vstack[vtop].info = info; - ls->vtop = vtop+1; - return vtop; -} - -#define gola_isgoto(v) ((v)->info & VSTACK_GOTO) -#define gola_islabel(v) ((v)->info & VSTACK_LABEL) -#define gola_isgotolabel(v) ((v)->info & (VSTACK_GOTO|VSTACK_LABEL)) - -/* Patch goto to jump to label. */ -static void gola_patch(LexState *ls, VarInfo *vg, VarInfo *vl) -{ - FuncState *fs = ls->fs; - BCPos pc = vg->startpc; - setgcrefnull(vg->name); /* Invalidate pending goto. */ - setbc_a(&fs->bcbase[pc].ins, vl->slot); - jmp_patch(fs, pc, vl->startpc); -} - -/* Patch goto to close upvalues. */ -static void gola_close(LexState *ls, VarInfo *vg) -{ - FuncState *fs = ls->fs; - BCPos pc = vg->startpc; - BCIns *ip = &fs->bcbase[pc].ins; - lua_assert(gola_isgoto(vg)); - lua_assert(bc_op(*ip) == BC_JMP || bc_op(*ip) == BC_UCLO); - setbc_a(ip, vg->slot); - if (bc_op(*ip) == BC_JMP) { - BCPos next = jmp_next(fs, pc); - if (next != NO_JMP) jmp_patch(fs, next, pc); /* Jump to UCLO. */ - setbc_op(ip, BC_UCLO); /* Turn into UCLO. */ - setbc_j(ip, NO_JMP); - } -} - -/* Resolve pending forward gotos for label. */ -static void gola_resolve(LexState *ls, FuncScope *bl, MSize idx) -{ - VarInfo *vg = ls->vstack + bl->vstart; - VarInfo *vl = ls->vstack + idx; - for (; vg < vl; vg++) - if (gcrefeq(vg->name, vl->name) && gola_isgoto(vg)) { - if (vg->slot < vl->slot) { - GCstr *name = strref(var_get(ls, ls->fs, vg->slot).name); - lua_assert((uintptr_t)name >= VARNAME__MAX); - ls->linenumber = ls->fs->bcbase[vg->startpc].line; - lua_assert(strref(vg->name) != NAME_BREAK); - lj_lex_error(ls, 0, LJ_ERR_XGSCOPE, - strdata(strref(vg->name)), strdata(name)); - } - gola_patch(ls, vg, vl); - } -} - -/* Fixup remaining gotos and labels for scope. */ -static void gola_fixup(LexState *ls, FuncScope *bl) -{ - VarInfo *v = ls->vstack + bl->vstart; - VarInfo *ve = ls->vstack + ls->vtop; - for (; v < ve; v++) { - GCstr *name = strref(v->name); - if (name != NULL) { /* Only consider remaining valid gotos/labels. */ - if (gola_islabel(v)) { - VarInfo *vg; - setgcrefnull(v->name); /* Invalidate label that goes out of scope. */ - for (vg = v+1; vg < ve; vg++) /* Resolve pending backward gotos. */ - if (strref(vg->name) == name && gola_isgoto(vg)) { - if ((bl->flags&FSCOPE_UPVAL) && vg->slot > v->slot) - gola_close(ls, vg); - gola_patch(ls, vg, v); - } - } else if (gola_isgoto(v)) { - if (bl->prev) { /* Propagate goto or break to outer scope. */ - bl->prev->flags |= name == NAME_BREAK ? FSCOPE_BREAK : FSCOPE_GOLA; - v->slot = bl->nactvar; - if ((bl->flags & FSCOPE_UPVAL)) - gola_close(ls, v); - } else { /* No outer scope: undefined goto label or no loop. */ - ls->linenumber = ls->fs->bcbase[v->startpc].line; - if (name == NAME_BREAK) - lj_lex_error(ls, 0, LJ_ERR_XBREAK); - else - lj_lex_error(ls, 0, LJ_ERR_XLUNDEF, strdata(name)); - } - } - } - } -} - -/* Find existing label. */ -static VarInfo *gola_findlabel(LexState *ls, GCstr *name) -{ - VarInfo *v = ls->vstack + ls->fs->bl->vstart; - VarInfo *ve = ls->vstack + ls->vtop; - for (; v < ve; v++) - if (strref(v->name) == name && gola_islabel(v)) - return v; - return NULL; -} - -/* -- Scope handling ------------------------------------------------------ */ - -/* Begin a scope. */ -static void fscope_begin(FuncState *fs, FuncScope *bl, int flags) -{ - bl->nactvar = (uint8_t)fs->nactvar; - bl->flags = flags; - bl->vstart = fs->ls->vtop; - bl->prev = fs->bl; - fs->bl = bl; - lua_assert(fs->freereg == fs->nactvar); -} - -/* End a scope. */ -static void fscope_end(FuncState *fs) -{ - FuncScope *bl = fs->bl; - LexState *ls = fs->ls; - fs->bl = bl->prev; - var_remove(ls, bl->nactvar); - fs->freereg = fs->nactvar; - lua_assert(bl->nactvar == fs->nactvar); - if ((bl->flags & (FSCOPE_UPVAL|FSCOPE_NOCLOSE)) == FSCOPE_UPVAL) - bcemit_AJ(fs, BC_UCLO, bl->nactvar, 0); - if ((bl->flags & FSCOPE_BREAK)) { - if ((bl->flags & FSCOPE_LOOP)) { - MSize idx = gola_new(ls, NAME_BREAK, VSTACK_LABEL, fs->pc); - ls->vtop = idx; /* Drop break label immediately. */ - gola_resolve(ls, bl, idx); - } else { /* Need the fixup step to propagate the breaks. */ - gola_fixup(ls, bl); - return; - } - } - if ((bl->flags & FSCOPE_GOLA)) { - gola_fixup(ls, bl); - } -} - -/* Mark scope as having an upvalue. */ -static void fscope_uvmark(FuncState *fs, BCReg level) -{ - FuncScope *bl; - for (bl = fs->bl; bl && bl->nactvar > level; bl = bl->prev) - ; - if (bl) - bl->flags |= FSCOPE_UPVAL; -} - -/* -- Function state management ------------------------------------------- */ - -/* Fixup bytecode for prototype. */ -static void fs_fixup_bc(FuncState *fs, GCproto *pt, BCIns *bc, MSize n) -{ - BCInsLine *base = fs->bcbase; - MSize i; - pt->sizebc = n; - bc[0] = BCINS_AD((fs->flags & PROTO_VARARG) ? BC_FUNCV : BC_FUNCF, - fs->framesize, 0); - for (i = 1; i < n; i++) - bc[i] = base[i].ins; -} - -/* Fixup upvalues for child prototype, step #2. */ -static void fs_fixup_uv2(FuncState *fs, GCproto *pt) -{ - VarInfo *vstack = fs->ls->vstack; - uint16_t *uv = proto_uv(pt); - MSize i, n = pt->sizeuv; - for (i = 0; i < n; i++) { - VarIndex vidx = uv[i]; - if (vidx >= LJ_MAX_VSTACK) - uv[i] = vidx - LJ_MAX_VSTACK; - else if ((vstack[vidx].info & VSTACK_VAR_RW)) - uv[i] = vstack[vidx].slot | PROTO_UV_LOCAL; - else - uv[i] = vstack[vidx].slot | PROTO_UV_LOCAL | PROTO_UV_IMMUTABLE; - } -} - -/* Fixup constants for prototype. */ -static void fs_fixup_k(FuncState *fs, GCproto *pt, void *kptr) -{ - GCtab *kt; - TValue *array; - Node *node; - MSize i, hmask; - checklimitgt(fs, fs->nkn, BCMAX_D+1, "constants"); - checklimitgt(fs, fs->nkgc, BCMAX_D+1, "constants"); - setmref(pt->k, kptr); - pt->sizekn = fs->nkn; - pt->sizekgc = fs->nkgc; - kt = fs->kt; - array = tvref(kt->array); - for (i = 0; i < kt->asize; i++) - if (tvhaskslot(&array[i])) { - TValue *tv = &((TValue *)kptr)[tvkslot(&array[i])]; - if (LJ_DUALNUM) - setintV(tv, (int32_t)i); - else - setnumV(tv, (lua_Number)i); - } - node = noderef(kt->node); - hmask = kt->hmask; - for (i = 0; i <= hmask; i++) { - Node *n = &node[i]; - if (tvhaskslot(&n->val)) { - ptrdiff_t kidx = (ptrdiff_t)tvkslot(&n->val); - lua_assert(!tvisint(&n->key)); - if (tvisnum(&n->key)) { - TValue *tv = &((TValue *)kptr)[kidx]; - if (LJ_DUALNUM) { - lua_Number nn = numV(&n->key); - int32_t k = lj_num2int(nn); - lua_assert(!tvismzero(&n->key)); - if ((lua_Number)k == nn) - setintV(tv, k); - else - *tv = n->key; - } else { - *tv = n->key; - } - } else { - GCobj *o = gcV(&n->key); - setgcref(((GCRef *)kptr)[~kidx], o); - lj_gc_objbarrier(fs->L, pt, o); - if (tvisproto(&n->key)) - fs_fixup_uv2(fs, gco2pt(o)); - } - } - } -} - -/* Fixup upvalues for prototype, step #1. */ -static void fs_fixup_uv1(FuncState *fs, GCproto *pt, uint16_t *uv) -{ - setmref(pt->uv, uv); - pt->sizeuv = fs->nuv; - memcpy(uv, fs->uvtmp, fs->nuv*sizeof(VarIndex)); -} - -#ifndef LUAJIT_DISABLE_DEBUGINFO -/* Prepare lineinfo for prototype. */ -static size_t fs_prep_line(FuncState *fs, BCLine numline) -{ - return (fs->pc-1) << (numline < 256 ? 0 : numline < 65536 ? 1 : 2); -} - -/* Fixup lineinfo for prototype. */ -static void fs_fixup_line(FuncState *fs, GCproto *pt, - void *lineinfo, BCLine numline) -{ - BCInsLine *base = fs->bcbase + 1; - BCLine first = fs->linedefined; - MSize i = 0, n = fs->pc-1; - pt->firstline = fs->linedefined; - pt->numline = numline; - setmref(pt->lineinfo, lineinfo); - if (LJ_LIKELY(numline < 256)) { - uint8_t *li = (uint8_t *)lineinfo; - do { - BCLine delta = base[i].line - first; - lua_assert(delta >= 0 && delta < 256); - li[i] = (uint8_t)delta; - } while (++i < n); - } else if (LJ_LIKELY(numline < 65536)) { - uint16_t *li = (uint16_t *)lineinfo; - do { - BCLine delta = base[i].line - first; - lua_assert(delta >= 0 && delta < 65536); - li[i] = (uint16_t)delta; - } while (++i < n); - } else { - uint32_t *li = (uint32_t *)lineinfo; - do { - BCLine delta = base[i].line - first; - lua_assert(delta >= 0); - li[i] = (uint32_t)delta; - } while (++i < n); - } -} - -/* Resize buffer if needed. */ -static LJ_NOINLINE void fs_buf_resize(LexState *ls, MSize len) -{ - MSize sz = ls->sb.sz * 2; - while (ls->sb.n + len > sz) sz = sz * 2; - lj_str_resizebuf(ls->L, &ls->sb, sz); -} - -static LJ_AINLINE void fs_buf_need(LexState *ls, MSize len) -{ - if (LJ_UNLIKELY(ls->sb.n + len > ls->sb.sz)) - fs_buf_resize(ls, len); -} - -/* Add string to buffer. */ -static void fs_buf_str(LexState *ls, const char *str, MSize len) -{ - char *p = ls->sb.buf + ls->sb.n; - MSize i; - ls->sb.n += len; - for (i = 0; i < len; i++) p[i] = str[i]; -} - -/* Add ULEB128 value to buffer. */ -static void fs_buf_uleb128(LexState *ls, uint32_t v) -{ - MSize n = ls->sb.n; - uint8_t *p = (uint8_t *)ls->sb.buf; - for (; v >= 0x80; v >>= 7) - p[n++] = (uint8_t)((v & 0x7f) | 0x80); - p[n++] = (uint8_t)v; - ls->sb.n = n; -} - -/* Prepare variable info for prototype. */ -static size_t fs_prep_var(LexState *ls, FuncState *fs, size_t *ofsvar) -{ - VarInfo *vs =ls->vstack, *ve; - MSize i, n; - BCPos lastpc; - lj_str_resetbuf(&ls->sb); /* Copy to temp. string buffer. */ - /* Store upvalue names. */ - for (i = 0, n = fs->nuv; i < n; i++) { - GCstr *s = strref(vs[fs->uvmap[i]].name); - MSize len = s->len+1; - fs_buf_need(ls, len); - fs_buf_str(ls, strdata(s), len); - } - *ofsvar = ls->sb.n; - lastpc = 0; - /* Store local variable names and compressed ranges. */ - for (ve = vs + ls->vtop, vs += fs->vbase; vs < ve; vs++) { - if (!gola_isgotolabel(vs)) { - GCstr *s = strref(vs->name); - BCPos startpc; - if ((uintptr_t)s < VARNAME__MAX) { - fs_buf_need(ls, 1 + 2*5); - ls->sb.buf[ls->sb.n++] = (uint8_t)(uintptr_t)s; - } else { - MSize len = s->len+1; - fs_buf_need(ls, len + 2*5); - fs_buf_str(ls, strdata(s), len); - } - startpc = vs->startpc; - fs_buf_uleb128(ls, startpc-lastpc); - fs_buf_uleb128(ls, vs->endpc-startpc); - lastpc = startpc; - } - } - fs_buf_need(ls, 1); - ls->sb.buf[ls->sb.n++] = '\0'; /* Terminator for varinfo. */ - return ls->sb.n; -} - -/* Fixup variable info for prototype. */ -static void fs_fixup_var(LexState *ls, GCproto *pt, uint8_t *p, size_t ofsvar) -{ - setmref(pt->uvinfo, p); - setmref(pt->varinfo, (char *)p + ofsvar); - memcpy(p, ls->sb.buf, ls->sb.n); /* Copy from temp. string buffer. */ -} -#else - -/* Initialize with empty debug info, if disabled. */ -#define fs_prep_line(fs, numline) (UNUSED(numline), 0) -#define fs_fixup_line(fs, pt, li, numline) \ - pt->firstline = pt->numline = 0, setmref((pt)->lineinfo, NULL) -#define fs_prep_var(ls, fs, ofsvar) (UNUSED(ofsvar), 0) -#define fs_fixup_var(ls, pt, p, ofsvar) \ - setmref((pt)->uvinfo, NULL), setmref((pt)->varinfo, NULL) - -#endif - -/* Check if bytecode op returns. */ -static int bcopisret(BCOp op) -{ - switch (op) { - case BC_CALLMT: case BC_CALLT: - case BC_RETM: case BC_RET: case BC_RET0: case BC_RET1: - return 1; - default: - return 0; - } -} - -/* Fixup return instruction for prototype. */ -static void fs_fixup_ret(FuncState *fs) -{ - BCPos lastpc = fs->pc; - if (lastpc <= fs->lasttarget || !bcopisret(bc_op(fs->bcbase[lastpc-1].ins))) { - if ((fs->bl->flags & FSCOPE_UPVAL)) - bcemit_AJ(fs, BC_UCLO, 0, 0); - bcemit_AD(fs, BC_RET0, 0, 1); /* Need final return. */ - } - fs->bl->flags |= FSCOPE_NOCLOSE; /* Handled above. */ - fscope_end(fs); - lua_assert(fs->bl == NULL); - /* May need to fixup returns encoded before first function was created. */ - if (fs->flags & PROTO_FIXUP_RETURN) { - BCPos pc; - for (pc = 1; pc < lastpc; pc++) { - BCIns ins = fs->bcbase[pc].ins; - BCPos offset; - switch (bc_op(ins)) { - case BC_CALLMT: case BC_CALLT: - case BC_RETM: case BC_RET: case BC_RET0: case BC_RET1: - offset = bcemit_INS(fs, ins); /* Copy original instruction. */ - fs->bcbase[offset].line = fs->bcbase[pc].line; - offset = offset-(pc+1)+BCBIAS_J; - if (offset > BCMAX_D) - err_syntax(fs->ls, LJ_ERR_XFIXUP); - /* Replace with UCLO plus branch. */ - fs->bcbase[pc].ins = BCINS_AD(BC_UCLO, 0, offset); - break; - case BC_UCLO: - return; /* We're done. */ - default: - break; - } - } - } -} - -/* Finish a FuncState and return the new prototype. */ -static GCproto *fs_finish(LexState *ls, BCLine line) -{ - lua_State *L = ls->L; - FuncState *fs = ls->fs; - BCLine numline = line - fs->linedefined; - size_t sizept, ofsk, ofsuv, ofsli, ofsdbg, ofsvar; - GCproto *pt; - - /* Apply final fixups. */ - fs_fixup_ret(fs); - - /* Calculate total size of prototype including all colocated arrays. */ - sizept = sizeof(GCproto) + fs->pc*sizeof(BCIns) + fs->nkgc*sizeof(GCRef); - sizept = (sizept + sizeof(TValue)-1) & ~(sizeof(TValue)-1); - ofsk = sizept; sizept += fs->nkn*sizeof(TValue); - ofsuv = sizept; sizept += ((fs->nuv+1)&~1)*2; - ofsli = sizept; sizept += fs_prep_line(fs, numline); - ofsdbg = sizept; sizept += fs_prep_var(ls, fs, &ofsvar); - - /* Allocate prototype and initialize its fields. */ - pt = (GCproto *)lj_mem_newgco(L, (MSize)sizept); - pt->gct = ~LJ_TPROTO; - pt->sizept = (MSize)sizept; - pt->trace = 0; - pt->flags = (uint8_t)(fs->flags & ~(PROTO_HAS_RETURN|PROTO_FIXUP_RETURN)); - pt->numparams = fs->numparams; - pt->framesize = fs->framesize; - setgcref(pt->chunkname, obj2gco(ls->chunkname)); - - /* Close potentially uninitialized gap between bc and kgc. */ - *(uint32_t *)((char *)pt + ofsk - sizeof(GCRef)*(fs->nkgc+1)) = 0; - fs_fixup_bc(fs, pt, (BCIns *)((char *)pt + sizeof(GCproto)), fs->pc); - fs_fixup_k(fs, pt, (void *)((char *)pt + ofsk)); - fs_fixup_uv1(fs, pt, (uint16_t *)((char *)pt + ofsuv)); - fs_fixup_line(fs, pt, (void *)((char *)pt + ofsli), numline); - fs_fixup_var(ls, pt, (uint8_t *)((char *)pt + ofsdbg), ofsvar); - - lj_vmevent_send(L, BC, - setprotoV(L, L->top++, pt); - ); - - L->top--; /* Pop table of constants. */ - ls->vtop = fs->vbase; /* Reset variable stack. */ - ls->fs = fs->prev; - lua_assert(ls->fs != NULL || ls->token == TK_eof); - return pt; -} - -/* Initialize a new FuncState. */ -static void fs_init(LexState *ls, FuncState *fs) -{ - lua_State *L = ls->L; - fs->prev = ls->fs; ls->fs = fs; /* Append to list. */ - fs->ls = ls; - fs->vbase = ls->vtop; - fs->L = L; - fs->pc = 0; - fs->lasttarget = 0; - fs->jpc = NO_JMP; - fs->freereg = 0; - fs->nkgc = 0; - fs->nkn = 0; - fs->nactvar = 0; - fs->nuv = 0; - fs->bl = NULL; - fs->flags = 0; - fs->framesize = 1; /* Minimum frame size. */ - fs->kt = lj_tab_new(L, 0, 0); - /* Anchor table of constants in stack to avoid being collected. */ - settabV(L, L->top, fs->kt); - incr_top(L); -} - -/* -- Expressions --------------------------------------------------------- */ - -/* Forward declaration. */ -static void expr(LexState *ls, ExpDesc *v); - -/* Return string expression. */ -static void expr_str(LexState *ls, ExpDesc *e) -{ - expr_init(e, VKSTR, 0); - e->u.sval = lex_str(ls); -} - -/* Return index expression. */ -static void expr_index(FuncState *fs, ExpDesc *t, ExpDesc *e) -{ - /* Already called: expr_toval(fs, e). */ - t->k = VINDEXED; - if (expr_isnumk(e)) { -#if LJ_DUALNUM - if (tvisint(expr_numtv(e))) { - int32_t k = intV(expr_numtv(e)); - if (checku8(k)) { - t->u.s.aux = BCMAX_C+1+(uint32_t)k; /* 256..511: const byte key */ - return; - } - } -#else - lua_Number n = expr_numberV(e); - int32_t k = lj_num2int(n); - if (checku8(k) && n == (lua_Number)k) { - t->u.s.aux = BCMAX_C+1+(uint32_t)k; /* 256..511: const byte key */ - return; - } -#endif - } else if (expr_isstrk(e)) { - BCReg idx = const_str(fs, e); - if (idx <= BCMAX_C) { - t->u.s.aux = ~idx; /* -256..-1: const string key */ - return; - } - } - t->u.s.aux = expr_toanyreg(fs, e); /* 0..255: register */ -} - -/* Parse index expression with named field. */ -static void expr_field(LexState *ls, ExpDesc *v) -{ - FuncState *fs = ls->fs; - ExpDesc key; - expr_toanyreg(fs, v); - lj_lex_next(ls); /* Skip dot or colon. */ - expr_str(ls, &key); - expr_index(fs, v, &key); -} - -/* Parse index expression with brackets. */ -static void expr_bracket(LexState *ls, ExpDesc *v) -{ - lj_lex_next(ls); /* Skip '['. */ - expr(ls, v); - expr_toval(ls->fs, v); - lex_check(ls, ']'); -} - -/* Get value of constant expression. */ -static void expr_kvalue(TValue *v, ExpDesc *e) -{ - if (e->k <= VKTRUE) { - setitype(v, ~(uint32_t)e->k); - } else if (e->k == VKSTR) { - setgcref(v->gcr, obj2gco(e->u.sval)); - setitype(v, LJ_TSTR); - } else { - lua_assert(tvisnumber(expr_numtv(e))); - *v = *expr_numtv(e); - } -} - -/* Parse table constructor expression. */ -static void expr_table(LexState *ls, ExpDesc *e) -{ - FuncState *fs = ls->fs; - BCLine line = ls->linenumber; - GCtab *t = NULL; - int vcall = 0, needarr = 0, fixt = 0; - uint32_t narr = 1; /* First array index. */ - uint32_t nhash = 0; /* Number of hash entries. */ - BCReg freg = fs->freereg; - BCPos pc = bcemit_AD(fs, BC_TNEW, freg, 0); - expr_init(e, VNONRELOC, freg); - bcreg_reserve(fs, 1); - freg++; - lex_check(ls, '{'); - while (ls->token != '}') { - ExpDesc key, val; - vcall = 0; - if (ls->token == '[') { - expr_bracket(ls, &key); /* Already calls expr_toval. */ - if (!expr_isk(&key)) expr_index(fs, e, &key); - if (expr_isnumk(&key) && expr_numiszero(&key)) needarr = 1; else nhash++; - lex_check(ls, '='); - } else if ((ls->token == TK_name || (!LJ_52 && ls->token == TK_goto)) && - lj_lex_lookahead(ls) == '=') { - expr_str(ls, &key); - lex_check(ls, '='); - nhash++; - } else { - expr_init(&key, VKNUM, 0); - setintV(&key.u.nval, (int)narr); - narr++; - needarr = vcall = 1; - } - expr(ls, &val); - if (expr_isk(&key) && key.k != VKNIL && - (key.k == VKSTR || expr_isk_nojump(&val))) { - TValue k, *v; - if (!t) { /* Create template table on demand. */ - BCReg kidx; - t = lj_tab_new(fs->L, needarr ? narr : 0, hsize2hbits(nhash)); - kidx = const_gc(fs, obj2gco(t), LJ_TTAB); - fs->bcbase[pc].ins = BCINS_AD(BC_TDUP, freg-1, kidx); - } - vcall = 0; - expr_kvalue(&k, &key); - v = lj_tab_set(fs->L, t, &k); - lj_gc_anybarriert(fs->L, t); - if (expr_isk_nojump(&val)) { /* Add const key/value to template table. */ - expr_kvalue(v, &val); - } else { /* Otherwise create dummy string key (avoids lj_tab_newkey). */ - settabV(fs->L, v, t); /* Preserve key with table itself as value. */ - fixt = 1; /* Fix this later, after all resizes. */ - goto nonconst; - } - } else { - nonconst: - if (val.k != VCALL) { expr_toanyreg(fs, &val); vcall = 0; } - if (expr_isk(&key)) expr_index(fs, e, &key); - bcemit_store(fs, e, &val); - } - fs->freereg = freg; - if (!lex_opt(ls, ',') && !lex_opt(ls, ';')) break; - } - lex_match(ls, '}', '{', line); - if (vcall) { - BCInsLine *ilp = &fs->bcbase[fs->pc-1]; - ExpDesc en; - lua_assert(bc_a(ilp->ins) == freg && - bc_op(ilp->ins) == (narr > 256 ? BC_TSETV : BC_TSETB)); - expr_init(&en, VKNUM, 0); - en.u.nval.u32.lo = narr-1; - en.u.nval.u32.hi = 0x43300000; /* Biased integer to avoid denormals. */ - if (narr > 256) { fs->pc--; ilp--; } - ilp->ins = BCINS_AD(BC_TSETM, freg, const_num(fs, &en)); - setbc_b(&ilp[-1].ins, 0); - } - if (pc == fs->pc-1) { /* Make expr relocable if possible. */ - e->u.s.info = pc; - fs->freereg--; - e->k = VRELOCABLE; - } else { - e->k = VNONRELOC; /* May have been changed by expr_index. */ - } - if (!t) { /* Construct TNEW RD: hhhhhaaaaaaaaaaa. */ - BCIns *ip = &fs->bcbase[pc].ins; - if (!needarr) narr = 0; - else if (narr < 3) narr = 3; - else if (narr > 0x7ff) narr = 0x7ff; - setbc_d(ip, narr|(hsize2hbits(nhash)<<11)); - } else { - if (needarr && t->asize < narr) - lj_tab_reasize(fs->L, t, narr-1); - if (fixt) { /* Fix value for dummy keys in template table. */ - Node *node = noderef(t->node); - uint32_t i, hmask = t->hmask; - for (i = 0; i <= hmask; i++) { - Node *n = &node[i]; - if (tvistab(&n->val)) { - lua_assert(tabV(&n->val) == t); - setnilV(&n->val); /* Turn value into nil. */ - } - } - } - lj_gc_check(fs->L); - } -} - -/* Parse function parameters. */ -static BCReg parse_params(LexState *ls, int needself) -{ - FuncState *fs = ls->fs; - BCReg nparams = 0; - lex_check(ls, '('); - if (needself) - var_new_lit(ls, nparams++, "self"); - if (ls->token != ')') { - do { - if (ls->token == TK_name || (!LJ_52 && ls->token == TK_goto)) { - var_new(ls, nparams++, lex_str(ls)); - } else if (ls->token == TK_dots) { - lj_lex_next(ls); - fs->flags |= PROTO_VARARG; - break; - } else { - err_syntax(ls, LJ_ERR_XPARAM); - } - } while (lex_opt(ls, ',')); - } - var_add(ls, nparams); - lua_assert(fs->nactvar == nparams); - bcreg_reserve(fs, nparams); - lex_check(ls, ')'); - return nparams; -} - -/* Forward declaration. */ -static void parse_chunk(LexState *ls); - -/* Parse body of a function. */ -static void parse_body(LexState *ls, ExpDesc *e, int needself, BCLine line) -{ - FuncState fs, *pfs = ls->fs; - FuncScope bl; - GCproto *pt; - ptrdiff_t oldbase = pfs->bcbase - ls->bcstack; - fs_init(ls, &fs); - fscope_begin(&fs, &bl, 0); - fs.linedefined = line; - fs.numparams = (uint8_t)parse_params(ls, needself); - fs.bcbase = pfs->bcbase + pfs->pc; - fs.bclim = pfs->bclim - pfs->pc; - bcemit_AD(&fs, BC_FUNCF, 0, 0); /* Placeholder. */ - parse_chunk(ls); - if (ls->token != TK_end) lex_match(ls, TK_end, TK_function, line); - pt = fs_finish(ls, (ls->lastline = ls->linenumber)); - pfs->bcbase = ls->bcstack + oldbase; /* May have been reallocated. */ - pfs->bclim = (BCPos)(ls->sizebcstack - oldbase); - /* Store new prototype in the constant array of the parent. */ - expr_init(e, VRELOCABLE, - bcemit_AD(pfs, BC_FNEW, 0, const_gc(pfs, obj2gco(pt), LJ_TPROTO))); -#if LJ_HASFFI - pfs->flags |= (fs.flags & PROTO_FFI); -#endif - if (!(pfs->flags & PROTO_CHILD)) { - if (pfs->flags & PROTO_HAS_RETURN) - pfs->flags |= PROTO_FIXUP_RETURN; - pfs->flags |= PROTO_CHILD; - } - lj_lex_next(ls); -} - -/* Parse expression list. Last expression is left open. */ -static BCReg expr_list(LexState *ls, ExpDesc *v) -{ - BCReg n = 1; - expr(ls, v); - while (lex_opt(ls, ',')) { - expr_tonextreg(ls->fs, v); - expr(ls, v); - n++; - } - return n; -} - -/* Parse function argument list. */ -static void parse_args(LexState *ls, ExpDesc *e) -{ - FuncState *fs = ls->fs; - ExpDesc args; - BCIns ins; - BCReg base; - BCLine line = ls->linenumber; - if (ls->token == '(') { -#if !LJ_52 - if (line != ls->lastline) - err_syntax(ls, LJ_ERR_XAMBIG); -#endif - lj_lex_next(ls); - if (ls->token == ')') { /* f(). */ - args.k = VVOID; - } else { - expr_list(ls, &args); - if (args.k == VCALL) /* f(a, b, g()) or f(a, b, ...). */ - setbc_b(bcptr(fs, &args), 0); /* Pass on multiple results. */ - } - lex_match(ls, ')', '(', line); - } else if (ls->token == '{') { - expr_table(ls, &args); - } else if (ls->token == TK_string) { - expr_init(&args, VKSTR, 0); - args.u.sval = strV(&ls->tokenval); - lj_lex_next(ls); - } else { - err_syntax(ls, LJ_ERR_XFUNARG); - return; /* Silence compiler. */ - } - lua_assert(e->k == VNONRELOC); - base = e->u.s.info; /* Base register for call. */ - if (args.k == VCALL) { - ins = BCINS_ABC(BC_CALLM, base, 2, args.u.s.aux - base - 1); - } else { - if (args.k != VVOID) - expr_tonextreg(fs, &args); - ins = BCINS_ABC(BC_CALL, base, 2, fs->freereg - base); - } - expr_init(e, VCALL, bcemit_INS(fs, ins)); - e->u.s.aux = base; - fs->bcbase[fs->pc - 1].line = line; - fs->freereg = base+1; /* Leave one result by default. */ -} - -/* Parse primary expression. */ -static void expr_primary(LexState *ls, ExpDesc *v) -{ - FuncState *fs = ls->fs; - /* Parse prefix expression. */ - if (ls->token == '(') { - BCLine line = ls->linenumber; - lj_lex_next(ls); - expr(ls, v); - lex_match(ls, ')', '(', line); - expr_discharge(ls->fs, v); - } else if (ls->token == TK_name || (!LJ_52 && ls->token == TK_goto)) { - var_lookup(ls, v); - } else { - err_syntax(ls, LJ_ERR_XSYMBOL); - } - for (;;) { /* Parse multiple expression suffixes. */ - if (ls->token == '.') { - expr_field(ls, v); - } else if (ls->token == '[') { - ExpDesc key; - expr_toanyreg(fs, v); - expr_bracket(ls, &key); - expr_index(fs, v, &key); - } else if (ls->token == ':') { - ExpDesc key; - lj_lex_next(ls); - expr_str(ls, &key); - bcemit_method(fs, v, &key); - parse_args(ls, v); - } else if (ls->token == '(' || ls->token == TK_string || ls->token == '{') { - expr_tonextreg(fs, v); - parse_args(ls, v); - } else { - break; - } - } -} - -/* Parse simple expression. */ -static void expr_simple(LexState *ls, ExpDesc *v) -{ - switch (ls->token) { - case TK_number: - expr_init(v, (LJ_HASFFI && tviscdata(&ls->tokenval)) ? VKCDATA : VKNUM, 0); - copyTV(ls->L, &v->u.nval, &ls->tokenval); - break; - case TK_string: - expr_init(v, VKSTR, 0); - v->u.sval = strV(&ls->tokenval); - break; - case TK_nil: - expr_init(v, VKNIL, 0); - break; - case TK_true: - expr_init(v, VKTRUE, 0); - break; - case TK_false: - expr_init(v, VKFALSE, 0); - break; - case TK_dots: { /* Vararg. */ - FuncState *fs = ls->fs; - BCReg base; - checkcond(ls, fs->flags & PROTO_VARARG, LJ_ERR_XDOTS); - bcreg_reserve(fs, 1); - base = fs->freereg-1; - expr_init(v, VCALL, bcemit_ABC(fs, BC_VARG, base, 2, fs->numparams)); - v->u.s.aux = base; - break; - } - case '{': /* Table constructor. */ - expr_table(ls, v); - return; - case TK_function: - lj_lex_next(ls); - parse_body(ls, v, 0, ls->linenumber); - return; - default: - expr_primary(ls, v); - return; - } - lj_lex_next(ls); -} - -/* Manage syntactic levels to avoid blowing up the stack. */ -static void synlevel_begin(LexState *ls) -{ - if (++ls->level >= LJ_MAX_XLEVEL) - lj_lex_error(ls, 0, LJ_ERR_XLEVELS); -} - -#define synlevel_end(ls) ((ls)->level--) - -/* Convert token to binary operator. */ -static BinOpr token2binop(LexToken tok) -{ - switch (tok) { - case '+': return OPR_ADD; - case '-': return OPR_SUB; - case '*': return OPR_MUL; - case '/': return OPR_DIV; - case '%': return OPR_MOD; - case '^': return OPR_POW; - case TK_concat: return OPR_CONCAT; - case TK_ne: return OPR_NE; - case TK_eq: return OPR_EQ; - case '<': return OPR_LT; - case TK_le: return OPR_LE; - case '>': return OPR_GT; - case TK_ge: return OPR_GE; - case TK_and: return OPR_AND; - case TK_or: return OPR_OR; - default: return OPR_NOBINOPR; - } -} - -/* Priorities for each binary operator. ORDER OPR. */ -static const struct { - uint8_t left; /* Left priority. */ - uint8_t right; /* Right priority. */ -} priority[] = { - {6,6}, {6,6}, {7,7}, {7,7}, {7,7}, /* ADD SUB MUL DIV MOD */ - {10,9}, {5,4}, /* POW CONCAT (right associative) */ - {3,3}, {3,3}, /* EQ NE */ - {3,3}, {3,3}, {3,3}, {3,3}, /* LT GE GT LE */ - {2,2}, {1,1} /* AND OR */ -}; - -#define UNARY_PRIORITY 8 /* Priority for unary operators. */ - -/* Forward declaration. */ -static BinOpr expr_binop(LexState *ls, ExpDesc *v, uint32_t limit); - -/* Parse unary expression. */ -static void expr_unop(LexState *ls, ExpDesc *v) -{ - BCOp op; - if (ls->token == TK_not) { - op = BC_NOT; - } else if (ls->token == '-') { - op = BC_UNM; - } else if (ls->token == '#') { - op = BC_LEN; - } else { - expr_simple(ls, v); - return; - } - lj_lex_next(ls); - expr_binop(ls, v, UNARY_PRIORITY); - bcemit_unop(ls->fs, op, v); -} - -/* Parse binary expressions with priority higher than the limit. */ -static BinOpr expr_binop(LexState *ls, ExpDesc *v, uint32_t limit) -{ - BinOpr op; - synlevel_begin(ls); - expr_unop(ls, v); - op = token2binop(ls->token); - while (op != OPR_NOBINOPR && priority[op].left > limit) { - ExpDesc v2; - BinOpr nextop; - lj_lex_next(ls); - bcemit_binop_left(ls->fs, op, v); - /* Parse binary expression with higher priority. */ - nextop = expr_binop(ls, &v2, priority[op].right); - bcemit_binop(ls->fs, op, v, &v2); - op = nextop; - } - synlevel_end(ls); - return op; /* Return unconsumed binary operator (if any). */ -} - -/* Parse expression. */ -static void expr(LexState *ls, ExpDesc *v) -{ - expr_binop(ls, v, 0); /* Priority 0: parse whole expression. */ -} - -/* Assign expression to the next register. */ -static void expr_next(LexState *ls) -{ - ExpDesc e; - expr(ls, &e); - expr_tonextreg(ls->fs, &e); -} - -/* Parse conditional expression. */ -static BCPos expr_cond(LexState *ls) -{ - ExpDesc v; - expr(ls, &v); - if (v.k == VKNIL) v.k = VKFALSE; - bcemit_branch_t(ls->fs, &v); - return v.f; -} - -/* -- Assignments --------------------------------------------------------- */ - -/* List of LHS variables. */ -typedef struct LHSVarList { - ExpDesc v; /* LHS variable. */ - struct LHSVarList *prev; /* Link to previous LHS variable. */ -} LHSVarList; - -/* Eliminate write-after-read hazards for local variable assignment. */ -static void assign_hazard(LexState *ls, LHSVarList *lh, const ExpDesc *v) -{ - FuncState *fs = ls->fs; - BCReg reg = v->u.s.info; /* Check against this variable. */ - BCReg tmp = fs->freereg; /* Rename to this temp. register (if needed). */ - int hazard = 0; - for (; lh; lh = lh->prev) { - if (lh->v.k == VINDEXED) { - if (lh->v.u.s.info == reg) { /* t[i], t = 1, 2 */ - hazard = 1; - lh->v.u.s.info = tmp; - } - if (lh->v.u.s.aux == reg) { /* t[i], i = 1, 2 */ - hazard = 1; - lh->v.u.s.aux = tmp; - } - } - } - if (hazard) { - bcemit_AD(fs, BC_MOV, tmp, reg); /* Rename conflicting variable. */ - bcreg_reserve(fs, 1); - } -} - -/* Adjust LHS/RHS of an assignment. */ -static void assign_adjust(LexState *ls, BCReg nvars, BCReg nexps, ExpDesc *e) -{ - FuncState *fs = ls->fs; - int32_t extra = (int32_t)nvars - (int32_t)nexps; - if (e->k == VCALL) { - extra++; /* Compensate for the VCALL itself. */ - if (extra < 0) extra = 0; - setbc_b(bcptr(fs, e), extra+1); /* Fixup call results. */ - if (extra > 1) bcreg_reserve(fs, (BCReg)extra-1); - } else { - if (e->k != VVOID) - expr_tonextreg(fs, e); /* Close last expression. */ - if (extra > 0) { /* Leftover LHS are set to nil. */ - BCReg reg = fs->freereg; - bcreg_reserve(fs, (BCReg)extra); - bcemit_nil(fs, reg, (BCReg)extra); - } - } - if (nexps > nvars) - ls->fs->freereg -= nexps - nvars; /* Drop leftover regs. */ -} - -/* Recursively parse assignment statement. */ -static void parse_assignment(LexState *ls, LHSVarList *lh, BCReg nvars) -{ - ExpDesc e; - checkcond(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED, LJ_ERR_XSYNTAX); - if (lex_opt(ls, ',')) { /* Collect LHS list and recurse upwards. */ - LHSVarList vl; - vl.prev = lh; - expr_primary(ls, &vl.v); - if (vl.v.k == VLOCAL) - assign_hazard(ls, lh, &vl.v); - checklimit(ls->fs, ls->level + nvars, LJ_MAX_XLEVEL, "variable names"); - parse_assignment(ls, &vl, nvars+1); - } else { /* Parse RHS. */ - BCReg nexps; - lex_check(ls, '='); - nexps = expr_list(ls, &e); - if (nexps == nvars) { - if (e.k == VCALL) { - if (bc_op(*bcptr(ls->fs, &e)) == BC_VARG) { /* Vararg assignment. */ - ls->fs->freereg--; - e.k = VRELOCABLE; - } else { /* Multiple call results. */ - e.u.s.info = e.u.s.aux; /* Base of call is not relocatable. */ - e.k = VNONRELOC; - } - } - bcemit_store(ls->fs, &lh->v, &e); - return; - } - assign_adjust(ls, nvars, nexps, &e); - } - /* Assign RHS to LHS and recurse downwards. */ - expr_init(&e, VNONRELOC, ls->fs->freereg-1); - bcemit_store(ls->fs, &lh->v, &e); -} - -/* Parse call statement or assignment. */ -static void parse_call_assign(LexState *ls) -{ - FuncState *fs = ls->fs; - LHSVarList vl; - expr_primary(ls, &vl.v); - if (vl.v.k == VCALL) { /* Function call statement. */ - setbc_b(bcptr(fs, &vl.v), 1); /* No results. */ - } else { /* Start of an assignment. */ - vl.prev = NULL; - parse_assignment(ls, &vl, 1); - } -} - -/* Parse 'local' statement. */ -static void parse_local(LexState *ls) -{ - if (lex_opt(ls, TK_function)) { /* Local function declaration. */ - ExpDesc v, b; - FuncState *fs = ls->fs; - var_new(ls, 0, lex_str(ls)); - expr_init(&v, VLOCAL, fs->freereg); - v.u.s.aux = fs->varmap[fs->freereg]; - bcreg_reserve(fs, 1); - var_add(ls, 1); - parse_body(ls, &b, 0, ls->linenumber); - /* bcemit_store(fs, &v, &b) without setting VSTACK_VAR_RW. */ - expr_free(fs, &b); - expr_toreg(fs, &b, v.u.s.info); - /* The upvalue is in scope, but the local is only valid after the store. */ - var_get(ls, fs, fs->nactvar - 1).startpc = fs->pc; - } else { /* Local variable declaration. */ - ExpDesc e; - BCReg nexps, nvars = 0; - do { /* Collect LHS. */ - var_new(ls, nvars++, lex_str(ls)); - } while (lex_opt(ls, ',')); - if (lex_opt(ls, '=')) { /* Optional RHS. */ - nexps = expr_list(ls, &e); - } else { /* Or implicitly set to nil. */ - e.k = VVOID; - nexps = 0; - } - assign_adjust(ls, nvars, nexps, &e); - var_add(ls, nvars); - } -} - -/* Parse 'function' statement. */ -static void parse_func(LexState *ls, BCLine line) -{ - FuncState *fs; - ExpDesc v, b; - int needself = 0; - lj_lex_next(ls); /* Skip 'function'. */ - /* Parse function name. */ - var_lookup(ls, &v); - while (ls->token == '.') /* Multiple dot-separated fields. */ - expr_field(ls, &v); - if (ls->token == ':') { /* Optional colon to signify method call. */ - needself = 1; - expr_field(ls, &v); - } - parse_body(ls, &b, needself, line); - fs = ls->fs; - bcemit_store(fs, &v, &b); - fs->bcbase[fs->pc - 1].line = line; /* Set line for the store. */ -} - -/* -- Control transfer statements ----------------------------------------- */ - -/* Check for end of block. */ -static int endofblock(LexToken token) -{ - switch (token) { - case TK_else: case TK_elseif: case TK_end: case TK_until: case TK_eof: - return 1; - default: - return 0; - } -} - -/* Parse 'return' statement. */ -static void parse_return(LexState *ls) -{ - BCIns ins; - FuncState *fs = ls->fs; - lj_lex_next(ls); /* Skip 'return'. */ - fs->flags |= PROTO_HAS_RETURN; - if (endofblock(ls->token) || ls->token == ';') { /* Bare return. */ - ins = BCINS_AD(BC_RET0, 0, 1); - } else { /* Return with one or more values. */ - ExpDesc e; /* Receives the _last_ expression in the list. */ - BCReg nret = expr_list(ls, &e); - if (nret == 1) { /* Return one result. */ - if (e.k == VCALL) { /* Check for tail call. */ - BCIns *ip = bcptr(fs, &e); - /* It doesn't pay off to add BC_VARGT just for 'return ...'. */ - if (bc_op(*ip) == BC_VARG) goto notailcall; - fs->pc--; - ins = BCINS_AD(bc_op(*ip)-BC_CALL+BC_CALLT, bc_a(*ip), bc_c(*ip)); - } else { /* Can return the result from any register. */ - ins = BCINS_AD(BC_RET1, expr_toanyreg(fs, &e), 2); - } - } else { - if (e.k == VCALL) { /* Append all results from a call. */ - notailcall: - setbc_b(bcptr(fs, &e), 0); - ins = BCINS_AD(BC_RETM, fs->nactvar, e.u.s.aux - fs->nactvar); - } else { - expr_tonextreg(fs, &e); /* Force contiguous registers. */ - ins = BCINS_AD(BC_RET, fs->nactvar, nret+1); - } - } - } - if (fs->flags & PROTO_CHILD) - bcemit_AJ(fs, BC_UCLO, 0, 0); /* May need to close upvalues first. */ - bcemit_INS(fs, ins); -} - -/* Parse 'break' statement. */ -static void parse_break(LexState *ls) -{ - ls->fs->bl->flags |= FSCOPE_BREAK; - gola_new(ls, NAME_BREAK, VSTACK_GOTO, bcemit_jmp(ls->fs)); -} - -/* Parse 'goto' statement. */ -static void parse_goto(LexState *ls) -{ - FuncState *fs = ls->fs; - GCstr *name = lex_str(ls); - VarInfo *vl = gola_findlabel(ls, name); - if (vl) /* Treat backwards goto within same scope like a loop. */ - bcemit_AJ(fs, BC_LOOP, vl->slot, -1); /* No BC range check. */ - fs->bl->flags |= FSCOPE_GOLA; - gola_new(ls, name, VSTACK_GOTO, bcemit_jmp(fs)); -} - -/* Parse label. */ -static void parse_label(LexState *ls) -{ - FuncState *fs = ls->fs; - GCstr *name; - MSize idx; - fs->lasttarget = fs->pc; - fs->bl->flags |= FSCOPE_GOLA; - lj_lex_next(ls); /* Skip '::'. */ - name = lex_str(ls); - if (gola_findlabel(ls, name)) - lj_lex_error(ls, 0, LJ_ERR_XLDUP, strdata(name)); - idx = gola_new(ls, name, VSTACK_LABEL, fs->pc); - lex_check(ls, TK_label); - /* Recursively parse trailing statements: labels and ';' (Lua 5.2 only). */ - for (;;) { - if (ls->token == TK_label) { - synlevel_begin(ls); - parse_label(ls); - synlevel_end(ls); - } else if (LJ_52 && ls->token == ';') { - lj_lex_next(ls); - } else { - break; - } - } - /* Trailing label is considered to be outside of scope. */ - if (endofblock(ls->token) && ls->token != TK_until) - ls->vstack[idx].slot = fs->bl->nactvar; - gola_resolve(ls, fs->bl, idx); -} - -/* -- Blocks, loops and conditional statements ---------------------------- */ - -/* Parse a block. */ -static void parse_block(LexState *ls) -{ - FuncState *fs = ls->fs; - FuncScope bl; - fscope_begin(fs, &bl, 0); - parse_chunk(ls); - fscope_end(fs); -} - -/* Parse 'while' statement. */ -static void parse_while(LexState *ls, BCLine line) -{ - FuncState *fs = ls->fs; - BCPos start, loop, condexit; - FuncScope bl; - lj_lex_next(ls); /* Skip 'while'. */ - start = fs->lasttarget = fs->pc; - condexit = expr_cond(ls); - fscope_begin(fs, &bl, FSCOPE_LOOP); - lex_check(ls, TK_do); - loop = bcemit_AD(fs, BC_LOOP, fs->nactvar, 0); - parse_block(ls); - jmp_patch(fs, bcemit_jmp(fs), start); - lex_match(ls, TK_end, TK_while, line); - fscope_end(fs); - jmp_tohere(fs, condexit); - jmp_patchins(fs, loop, fs->pc); -} - -/* Parse 'repeat' statement. */ -static void parse_repeat(LexState *ls, BCLine line) -{ - FuncState *fs = ls->fs; - BCPos loop = fs->lasttarget = fs->pc; - BCPos condexit; - FuncScope bl1, bl2; - fscope_begin(fs, &bl1, FSCOPE_LOOP); /* Breakable loop scope. */ - fscope_begin(fs, &bl2, 0); /* Inner scope. */ - lj_lex_next(ls); /* Skip 'repeat'. */ - bcemit_AD(fs, BC_LOOP, fs->nactvar, 0); - parse_chunk(ls); - lex_match(ls, TK_until, TK_repeat, line); - condexit = expr_cond(ls); /* Parse condition (still inside inner scope). */ - if (!(bl2.flags & FSCOPE_UPVAL)) { /* No upvalues? Just end inner scope. */ - fscope_end(fs); - } else { /* Otherwise generate: cond: UCLO+JMP out, !cond: UCLO+JMP loop. */ - parse_break(ls); /* Break from loop and close upvalues. */ - jmp_tohere(fs, condexit); - fscope_end(fs); /* End inner scope and close upvalues. */ - condexit = bcemit_jmp(fs); - } - jmp_patch(fs, condexit, loop); /* Jump backwards if !cond. */ - jmp_patchins(fs, loop, fs->pc); - fscope_end(fs); /* End loop scope. */ -} - -/* Parse numeric 'for'. */ -static void parse_for_num(LexState *ls, GCstr *varname, BCLine line) -{ - FuncState *fs = ls->fs; - BCReg base = fs->freereg; - FuncScope bl; - BCPos loop, loopend; - /* Hidden control variables. */ - var_new_fixed(ls, FORL_IDX, VARNAME_FOR_IDX); - var_new_fixed(ls, FORL_STOP, VARNAME_FOR_STOP); - var_new_fixed(ls, FORL_STEP, VARNAME_FOR_STEP); - /* Visible copy of index variable. */ - var_new(ls, FORL_EXT, varname); - lex_check(ls, '='); - expr_next(ls); - lex_check(ls, ','); - expr_next(ls); - if (lex_opt(ls, ',')) { - expr_next(ls); - } else { - bcemit_AD(fs, BC_KSHORT, fs->freereg, 1); /* Default step is 1. */ - bcreg_reserve(fs, 1); - } - var_add(ls, 3); /* Hidden control variables. */ - lex_check(ls, TK_do); - loop = bcemit_AJ(fs, BC_FORI, base, NO_JMP); - fscope_begin(fs, &bl, 0); /* Scope for visible variables. */ - var_add(ls, 1); - bcreg_reserve(fs, 1); - parse_block(ls); - fscope_end(fs); - /* Perform loop inversion. Loop control instructions are at the end. */ - loopend = bcemit_AJ(fs, BC_FORL, base, NO_JMP); - fs->bcbase[loopend].line = line; /* Fix line for control ins. */ - jmp_patchins(fs, loopend, loop+1); - jmp_patchins(fs, loop, fs->pc); -} - -/* Try to predict whether the iterator is next() and specialize the bytecode. -** Detecting next() and pairs() by name is simplistic, but quite effective. -** The interpreter backs off if the check for the closure fails at runtime. -*/ -static int predict_next(LexState *ls, FuncState *fs, BCPos pc) -{ - BCIns ins = fs->bcbase[pc].ins; - GCstr *name; - cTValue *o; - switch (bc_op(ins)) { - case BC_MOV: - name = gco2str(gcref(var_get(ls, fs, bc_d(ins)).name)); - break; - case BC_UGET: - name = gco2str(gcref(ls->vstack[fs->uvmap[bc_d(ins)]].name)); - break; - case BC_GGET: - /* There's no inverse index (yet), so lookup the strings. */ - o = lj_tab_getstr(fs->kt, lj_str_newlit(ls->L, "pairs")); - if (o && tvhaskslot(o) && tvkslot(o) == bc_d(ins)) - return 1; - o = lj_tab_getstr(fs->kt, lj_str_newlit(ls->L, "next")); - if (o && tvhaskslot(o) && tvkslot(o) == bc_d(ins)) - return 1; - return 0; - default: - return 0; - } - return (name->len == 5 && !strcmp(strdata(name), "pairs")) || - (name->len == 4 && !strcmp(strdata(name), "next")); -} - -/* Parse 'for' iterator. */ -static void parse_for_iter(LexState *ls, GCstr *indexname) -{ - FuncState *fs = ls->fs; - ExpDesc e; - BCReg nvars = 0; - BCLine line; - BCReg base = fs->freereg + 3; - BCPos loop, loopend, exprpc = fs->pc; - FuncScope bl; - int isnext; - /* Hidden control variables. */ - var_new_fixed(ls, nvars++, VARNAME_FOR_GEN); - var_new_fixed(ls, nvars++, VARNAME_FOR_STATE); - var_new_fixed(ls, nvars++, VARNAME_FOR_CTL); - /* Visible variables returned from iterator. */ - var_new(ls, nvars++, indexname); - while (lex_opt(ls, ',')) - var_new(ls, nvars++, lex_str(ls)); - lex_check(ls, TK_in); - line = ls->linenumber; - assign_adjust(ls, 3, expr_list(ls, &e), &e); - bcreg_bump(fs, 3); /* The iterator needs another 3 slots (func + 2 args). */ - isnext = (nvars <= 5 && predict_next(ls, fs, exprpc)); - var_add(ls, 3); /* Hidden control variables. */ - lex_check(ls, TK_do); - loop = bcemit_AJ(fs, isnext ? BC_ISNEXT : BC_JMP, base, NO_JMP); - fscope_begin(fs, &bl, 0); /* Scope for visible variables. */ - var_add(ls, nvars-3); - bcreg_reserve(fs, nvars-3); - parse_block(ls); - fscope_end(fs); - /* Perform loop inversion. Loop control instructions are at the end. */ - jmp_patchins(fs, loop, fs->pc); - bcemit_ABC(fs, isnext ? BC_ITERN : BC_ITERC, base, nvars-3+1, 2+1); - loopend = bcemit_AJ(fs, BC_ITERL, base, NO_JMP); - fs->bcbase[loopend-1].line = line; /* Fix line for control ins. */ - fs->bcbase[loopend].line = line; - jmp_patchins(fs, loopend, loop+1); -} - -/* Parse 'for' statement. */ -static void parse_for(LexState *ls, BCLine line) -{ - FuncState *fs = ls->fs; - GCstr *varname; - FuncScope bl; - fscope_begin(fs, &bl, FSCOPE_LOOP); - lj_lex_next(ls); /* Skip 'for'. */ - varname = lex_str(ls); /* Get first variable name. */ - if (ls->token == '=') - parse_for_num(ls, varname, line); - else if (ls->token == ',' || ls->token == TK_in) - parse_for_iter(ls, varname); - else - err_syntax(ls, LJ_ERR_XFOR); - lex_match(ls, TK_end, TK_for, line); - fscope_end(fs); /* Resolve break list. */ -} - -/* Parse condition and 'then' block. */ -static BCPos parse_then(LexState *ls) -{ - BCPos condexit; - lj_lex_next(ls); /* Skip 'if' or 'elseif'. */ - condexit = expr_cond(ls); - lex_check(ls, TK_then); - parse_block(ls); - return condexit; -} - -/* Parse 'if' statement. */ -static void parse_if(LexState *ls, BCLine line) -{ - FuncState *fs = ls->fs; - BCPos flist; - BCPos escapelist = NO_JMP; - flist = parse_then(ls); - while (ls->token == TK_elseif) { /* Parse multiple 'elseif' blocks. */ - jmp_append(fs, &escapelist, bcemit_jmp(fs)); - jmp_tohere(fs, flist); - flist = parse_then(ls); - } - if (ls->token == TK_else) { /* Parse optional 'else' block. */ - jmp_append(fs, &escapelist, bcemit_jmp(fs)); - jmp_tohere(fs, flist); - lj_lex_next(ls); /* Skip 'else'. */ - parse_block(ls); - } else { - jmp_append(fs, &escapelist, flist); - } - jmp_tohere(fs, escapelist); - lex_match(ls, TK_end, TK_if, line); -} - -/* -- Parse statements ---------------------------------------------------- */ - -/* Parse a statement. Returns 1 if it must be the last one in a chunk. */ -static int parse_stmt(LexState *ls) -{ - BCLine line = ls->linenumber; - switch (ls->token) { - case TK_if: - parse_if(ls, line); - break; - case TK_while: - parse_while(ls, line); - break; - case TK_do: - lj_lex_next(ls); - parse_block(ls); - lex_match(ls, TK_end, TK_do, line); - break; - case TK_for: - parse_for(ls, line); - break; - case TK_repeat: - parse_repeat(ls, line); - break; - case TK_function: - parse_func(ls, line); - break; - case TK_local: - lj_lex_next(ls); - parse_local(ls); - break; - case TK_return: - parse_return(ls); - return 1; /* Must be last. */ - case TK_break: - lj_lex_next(ls); - parse_break(ls); - return !LJ_52; /* Must be last in Lua 5.1. */ -#if LJ_52 - case ';': - lj_lex_next(ls); - break; -#endif - case TK_label: - parse_label(ls); - break; - case TK_goto: - if (LJ_52 || lj_lex_lookahead(ls) == TK_name) { - lj_lex_next(ls); - parse_goto(ls); - break; - } /* else: fallthrough */ - default: - parse_call_assign(ls); - break; - } - return 0; -} - -/* A chunk is a list of statements optionally separated by semicolons. */ -static void parse_chunk(LexState *ls) -{ - int islast = 0; - synlevel_begin(ls); - while (!islast && !endofblock(ls->token)) { - islast = parse_stmt(ls); - lex_opt(ls, ';'); - lua_assert(ls->fs->framesize >= ls->fs->freereg && - ls->fs->freereg >= ls->fs->nactvar); - ls->fs->freereg = ls->fs->nactvar; /* Free registers after each stmt. */ - } - synlevel_end(ls); -} - -/* Entry point of bytecode parser. */ -GCproto *lj_parse(LexState *ls) -{ - FuncState fs; - FuncScope bl; - GCproto *pt; - lua_State *L = ls->L; -#ifdef LUAJIT_DISABLE_DEBUGINFO - ls->chunkname = lj_str_newlit(L, "="); -#else - ls->chunkname = lj_str_newz(L, ls->chunkarg); -#endif - setstrV(L, L->top, ls->chunkname); /* Anchor chunkname string. */ - incr_top(L); - ls->level = 0; - fs_init(ls, &fs); - fs.linedefined = 0; - fs.numparams = 0; - fs.bcbase = NULL; - fs.bclim = 0; - fs.flags |= PROTO_VARARG; /* Main chunk is always a vararg func. */ - fscope_begin(&fs, &bl, 0); - bcemit_AD(&fs, BC_FUNCV, 0, 0); /* Placeholder. */ - lj_lex_next(ls); /* Read-ahead first token. */ - parse_chunk(ls); - if (ls->token != TK_eof) - err_token(ls, TK_eof); - pt = fs_finish(ls, ls->linenumber); - L->top--; /* Drop chunkname. */ - lua_assert(fs.prev == NULL); - lua_assert(ls->fs == NULL); - lua_assert(pt->sizeuv == 0); - return pt; -} - diff --git a/subprojects/luajit/src/lj_parse.h b/subprojects/luajit/src/lj_parse.h deleted file mode 100644 index ceeab6994..000000000 --- a/subprojects/luajit/src/lj_parse.h +++ /dev/null @@ -1,18 +0,0 @@ -/* -** Lua parser (source code -> bytecode). -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_PARSE_H -#define _LJ_PARSE_H - -#include "lj_obj.h" -#include "lj_lex.h" - -LJ_FUNC GCproto *lj_parse(LexState *ls); -LJ_FUNC GCstr *lj_parse_keepstr(LexState *ls, const char *str, size_t l); -#if LJ_HASFFI -LJ_FUNC void lj_parse_keepcdata(LexState *ls, TValue *tv, GCcdata *cd); -#endif - -#endif diff --git a/subprojects/luajit/src/lj_record.c b/subprojects/luajit/src/lj_record.c deleted file mode 100644 index 7b5727648..000000000 --- a/subprojects/luajit/src/lj_record.c +++ /dev/null @@ -1,2261 +0,0 @@ -/* -** Trace recorder (bytecode -> SSA IR). -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_record_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_meta.h" -#include "lj_frame.h" -#if LJ_HASFFI -#include "lj_ctype.h" -#endif -#include "lj_bc.h" -#include "lj_ff.h" -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_ircall.h" -#include "lj_iropt.h" -#include "lj_trace.h" -#include "lj_record.h" -#include "lj_ffrecord.h" -#include "lj_snap.h" -#include "lj_dispatch.h" -#include "lj_vm.h" - -/* Some local macros to save typing. Undef'd at the end. */ -#define IR(ref) (&J->cur.ir[(ref)]) - -/* Pass IR on to next optimization in chain (FOLD). */ -#define emitir(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J)) - -/* Emit raw IR without passing through optimizations. */ -#define emitir_raw(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_ir_emit(J)) - -/* -- Sanity checks ------------------------------------------------------- */ - -#ifdef LUA_USE_ASSERT -/* Sanity check the whole IR -- sloooow. */ -static void rec_check_ir(jit_State *J) -{ - IRRef i, nins = J->cur.nins, nk = J->cur.nk; - lua_assert(nk <= REF_BIAS && nins >= REF_BIAS && nins < 65536); - for (i = nins-1; i >= nk; i--) { - IRIns *ir = IR(i); - uint32_t mode = lj_ir_mode[ir->o]; - IRRef op1 = ir->op1; - IRRef op2 = ir->op2; - switch (irm_op1(mode)) { - case IRMnone: lua_assert(op1 == 0); break; - case IRMref: lua_assert(op1 >= nk); - lua_assert(i >= REF_BIAS ? op1 < i : op1 > i); break; - case IRMlit: break; - case IRMcst: lua_assert(i < REF_BIAS); continue; - } - switch (irm_op2(mode)) { - case IRMnone: lua_assert(op2 == 0); break; - case IRMref: lua_assert(op2 >= nk); - lua_assert(i >= REF_BIAS ? op2 < i : op2 > i); break; - case IRMlit: break; - case IRMcst: lua_assert(0); break; - } - if (ir->prev) { - lua_assert(ir->prev >= nk); - lua_assert(i >= REF_BIAS ? ir->prev < i : ir->prev > i); - lua_assert(ir->o == IR_NOP || IR(ir->prev)->o == ir->o); - } - } -} - -/* Compare stack slots and frames of the recorder and the VM. */ -static void rec_check_slots(jit_State *J) -{ - BCReg s, nslots = J->baseslot + J->maxslot; - int32_t depth = 0; - cTValue *base = J->L->base - J->baseslot; - lua_assert(J->baseslot >= 1 && J->baseslot < LJ_MAX_JSLOTS); - lua_assert(J->baseslot == 1 || (J->slot[J->baseslot-1] & TREF_FRAME)); - lua_assert(nslots < LJ_MAX_JSLOTS); - for (s = 0; s < nslots; s++) { - TRef tr = J->slot[s]; - if (tr) { - cTValue *tv = &base[s]; - IRRef ref = tref_ref(tr); - IRIns *ir; - lua_assert(ref >= J->cur.nk && ref < J->cur.nins); - ir = IR(ref); - lua_assert(irt_t(ir->t) == tref_t(tr)); - if (s == 0) { - lua_assert(tref_isfunc(tr)); - } else if ((tr & TREF_FRAME)) { - GCfunc *fn = gco2func(frame_gc(tv)); - BCReg delta = (BCReg)(tv - frame_prev(tv)); - lua_assert(tref_isfunc(tr)); - if (tref_isk(tr)) lua_assert(fn == ir_kfunc(ir)); - lua_assert(s > delta ? (J->slot[s-delta] & TREF_FRAME) : (s == delta)); - depth++; - } else if ((tr & TREF_CONT)) { - lua_assert(ir_kptr(ir) == gcrefp(tv->gcr, void)); - lua_assert((J->slot[s+1] & TREF_FRAME)); - depth++; - } else { - if (tvisnumber(tv)) - lua_assert(tref_isnumber(tr)); /* Could be IRT_INT etc., too. */ - else - lua_assert(itype2irt(tv) == tref_type(tr)); - if (tref_isk(tr)) { /* Compare constants. */ - TValue tvk; - lj_ir_kvalue(J->L, &tvk, ir); - if (!(tvisnum(&tvk) && tvisnan(&tvk))) - lua_assert(lj_obj_equal(tv, &tvk)); - else - lua_assert(tvisnum(tv) && tvisnan(tv)); - } - } - } - } - lua_assert(J->framedepth == depth); -} -#endif - -/* -- Type handling and specialization ------------------------------------ */ - -/* Note: these functions return tagged references (TRef). */ - -/* Specialize a slot to a specific type. Note: slot can be negative! */ -static TRef sloadt(jit_State *J, int32_t slot, IRType t, int mode) -{ - /* Caller may set IRT_GUARD in t. */ - TRef ref = emitir_raw(IRT(IR_SLOAD, t), (int32_t)J->baseslot+slot, mode); - J->base[slot] = ref; - return ref; -} - -/* Specialize a slot to the runtime type. Note: slot can be negative! */ -static TRef sload(jit_State *J, int32_t slot) -{ - IRType t = itype2irt(&J->L->base[slot]); - TRef ref = emitir_raw(IRTG(IR_SLOAD, t), (int32_t)J->baseslot+slot, - IRSLOAD_TYPECHECK); - if (irtype_ispri(t)) ref = TREF_PRI(t); /* Canonicalize primitive refs. */ - J->base[slot] = ref; - return ref; -} - -/* Get TRef from slot. Load slot and specialize if not done already. */ -#define getslot(J, s) (J->base[(s)] ? J->base[(s)] : sload(J, (int32_t)(s))) - -/* Get TRef for current function. */ -static TRef getcurrf(jit_State *J) -{ - if (J->base[-1]) - return J->base[-1]; - lua_assert(J->baseslot == 1); - return sloadt(J, -1, IRT_FUNC, IRSLOAD_READONLY); -} - -/* Compare for raw object equality. -** Returns 0 if the objects are the same. -** Returns 1 if they are different, but the same type. -** Returns 2 for two different types. -** Comparisons between primitives always return 1 -- no caller cares about it. -*/ -int lj_record_objcmp(jit_State *J, TRef a, TRef b, cTValue *av, cTValue *bv) -{ - int diff = !lj_obj_equal(av, bv); - if (!tref_isk2(a, b)) { /* Shortcut, also handles primitives. */ - IRType ta = tref_isinteger(a) ? IRT_INT : tref_type(a); - IRType tb = tref_isinteger(b) ? IRT_INT : tref_type(b); - if (ta != tb) { - /* Widen mixed number/int comparisons to number/number comparison. */ - if (ta == IRT_INT && tb == IRT_NUM) { - a = emitir(IRTN(IR_CONV), a, IRCONV_NUM_INT); - ta = IRT_NUM; - } else if (ta == IRT_NUM && tb == IRT_INT) { - b = emitir(IRTN(IR_CONV), b, IRCONV_NUM_INT); - } else { - return 2; /* Two different types are never equal. */ - } - } - emitir(IRTG(diff ? IR_NE : IR_EQ, ta), a, b); - } - return diff; -} - -/* Constify a value. Returns 0 for non-representable object types. */ -TRef lj_record_constify(jit_State *J, cTValue *o) -{ - if (tvisgcv(o)) - return lj_ir_kgc(J, gcV(o), itype2irt(o)); - else if (tvisint(o)) - return lj_ir_kint(J, intV(o)); - else if (tvisnum(o)) - return lj_ir_knumint(J, numV(o)); - else if (tvisbool(o)) - return TREF_PRI(itype2irt(o)); - else - return 0; /* Can't represent lightuserdata (pointless). */ -} - -/* -- Record loop ops ----------------------------------------------------- */ - -/* Loop event. */ -typedef enum { - LOOPEV_LEAVE, /* Loop is left or not entered. */ - LOOPEV_ENTERLO, /* Loop is entered with a low iteration count left. */ - LOOPEV_ENTER /* Loop is entered. */ -} LoopEvent; - -/* Canonicalize slots: convert integers to numbers. */ -static void canonicalize_slots(jit_State *J) -{ - BCReg s; - if (LJ_DUALNUM) return; - for (s = J->baseslot+J->maxslot-1; s >= 1; s--) { - TRef tr = J->slot[s]; - if (tref_isinteger(tr)) { - IRIns *ir = IR(tref_ref(tr)); - if (!(ir->o == IR_SLOAD && (ir->op2 & IRSLOAD_READONLY))) - J->slot[s] = emitir(IRTN(IR_CONV), tr, IRCONV_NUM_INT); - } - } -} - -/* Stop recording. */ -static void rec_stop(jit_State *J, TraceLink linktype, TraceNo lnk) -{ - lj_trace_end(J); - J->cur.linktype = (uint8_t)linktype; - J->cur.link = (uint16_t)lnk; - /* Looping back at the same stack level? */ - if (lnk == J->cur.traceno && J->framedepth + J->retdepth == 0) { - if ((J->flags & JIT_F_OPT_LOOP)) /* Shall we try to create a loop? */ - goto nocanon; /* Do not canonicalize or we lose the narrowing. */ - if (J->cur.root) /* Otherwise ensure we always link to the root trace. */ - J->cur.link = J->cur.root; - } - canonicalize_slots(J); -nocanon: - /* Note: all loop ops must set J->pc to the following instruction! */ - lj_snap_add(J); /* Add loop snapshot. */ - J->needsnap = 0; - J->mergesnap = 1; /* In case recording continues. */ -} - -/* Search bytecode backwards for a int/num constant slot initializer. */ -static TRef find_kinit(jit_State *J, const BCIns *endpc, BCReg slot, IRType t) -{ - /* This algorithm is rather simplistic and assumes quite a bit about - ** how the bytecode is generated. It works fine for FORI initializers, - ** but it won't necessarily work in other cases (e.g. iterator arguments). - ** It doesn't do anything fancy, either (like backpropagating MOVs). - */ - const BCIns *pc, *startpc = proto_bc(J->pt); - for (pc = endpc-1; pc > startpc; pc--) { - BCIns ins = *pc; - BCOp op = bc_op(ins); - /* First try to find the last instruction that stores to this slot. */ - if (bcmode_a(op) == BCMbase && bc_a(ins) <= slot) { - return 0; /* Multiple results, e.g. from a CALL or KNIL. */ - } else if (bcmode_a(op) == BCMdst && bc_a(ins) == slot) { - if (op == BC_KSHORT || op == BC_KNUM) { /* Found const. initializer. */ - /* Now try to verify there's no forward jump across it. */ - const BCIns *kpc = pc; - for (; pc > startpc; pc--) - if (bc_op(*pc) == BC_JMP) { - const BCIns *target = pc+bc_j(*pc)+1; - if (target > kpc && target <= endpc) - return 0; /* Conditional assignment. */ - } - if (op == BC_KSHORT) { - int32_t k = (int32_t)(int16_t)bc_d(ins); - return t == IRT_INT ? lj_ir_kint(J, k) : lj_ir_knum(J, (lua_Number)k); - } else { - cTValue *tv = proto_knumtv(J->pt, bc_d(ins)); - if (t == IRT_INT) { - int32_t k = numberVint(tv); - if (tvisint(tv) || numV(tv) == (lua_Number)k) /* -0 is ok here. */ - return lj_ir_kint(J, k); - return 0; /* Type mismatch. */ - } else { - return lj_ir_knum(J, numberVnum(tv)); - } - } - } - return 0; /* Non-constant initializer. */ - } - } - return 0; /* No assignment to this slot found? */ -} - -/* Load and optionally convert a FORI argument from a slot. */ -static TRef fori_load(jit_State *J, BCReg slot, IRType t, int mode) -{ - int conv = (tvisint(&J->L->base[slot]) != (t==IRT_INT)) ? IRSLOAD_CONVERT : 0; - return sloadt(J, (int32_t)slot, - t + (((mode & IRSLOAD_TYPECHECK) || - (conv && t == IRT_INT && !(mode >> 16))) ? - IRT_GUARD : 0), - mode + conv); -} - -/* Peek before FORI to find a const initializer. Otherwise load from slot. */ -static TRef fori_arg(jit_State *J, const BCIns *fori, BCReg slot, - IRType t, int mode) -{ - TRef tr = J->base[slot]; - if (!tr) { - tr = find_kinit(J, fori, slot, t); - if (!tr) - tr = fori_load(J, slot, t, mode); - } - return tr; -} - -/* Return the direction of the FOR loop iterator. -** It's important to exactly reproduce the semantics of the interpreter. -*/ -static int rec_for_direction(cTValue *o) -{ - return (tvisint(o) ? intV(o) : (int32_t)o->u32.hi) >= 0; -} - -/* Simulate the runtime behavior of the FOR loop iterator. */ -static LoopEvent rec_for_iter(IROp *op, cTValue *o, int isforl) -{ - lua_Number stopv = numberVnum(&o[FORL_STOP]); - lua_Number idxv = numberVnum(&o[FORL_IDX]); - lua_Number stepv = numberVnum(&o[FORL_STEP]); - if (isforl) - idxv += stepv; - if (rec_for_direction(&o[FORL_STEP])) { - if (idxv <= stopv) { - *op = IR_LE; - return idxv + 2*stepv > stopv ? LOOPEV_ENTERLO : LOOPEV_ENTER; - } - *op = IR_GT; return LOOPEV_LEAVE; - } else { - if (stopv <= idxv) { - *op = IR_GE; - return idxv + 2*stepv < stopv ? LOOPEV_ENTERLO : LOOPEV_ENTER; - } - *op = IR_LT; return LOOPEV_LEAVE; - } -} - -/* Record checks for FOR loop overflow and step direction. */ -static void rec_for_check(jit_State *J, IRType t, int dir, - TRef stop, TRef step, int init) -{ - if (!tref_isk(step)) { - /* Non-constant step: need a guard for the direction. */ - TRef zero = (t == IRT_INT) ? lj_ir_kint(J, 0) : lj_ir_knum_zero(J); - emitir(IRTG(dir ? IR_GE : IR_LT, t), step, zero); - /* Add hoistable overflow checks for a narrowed FORL index. */ - if (init && t == IRT_INT) { - if (tref_isk(stop)) { - /* Constant stop: optimize check away or to a range check for step. */ - int32_t k = IR(tref_ref(stop))->i; - if (dir) { - if (k > 0) - emitir(IRTGI(IR_LE), step, lj_ir_kint(J, (int32_t)0x7fffffff-k)); - } else { - if (k < 0) - emitir(IRTGI(IR_GE), step, lj_ir_kint(J, (int32_t)0x80000000-k)); - } - } else { - /* Stop+step variable: need full overflow check. */ - TRef tr = emitir(IRTGI(IR_ADDOV), step, stop); - emitir(IRTI(IR_USE), tr, 0); /* ADDOV is weak. Avoid dead result. */ - } - } - } else if (init && t == IRT_INT && !tref_isk(stop)) { - /* Constant step: optimize overflow check to a range check for stop. */ - int32_t k = IR(tref_ref(step))->i; - k = (int32_t)(dir ? 0x7fffffff : 0x80000000) - k; - emitir(IRTGI(dir ? IR_LE : IR_GE), stop, lj_ir_kint(J, k)); - } -} - -/* Record a FORL instruction. */ -static void rec_for_loop(jit_State *J, const BCIns *fori, ScEvEntry *scev, - int init) -{ - BCReg ra = bc_a(*fori); - cTValue *tv = &J->L->base[ra]; - TRef idx = J->base[ra+FORL_IDX]; - IRType t = idx ? tref_type(idx) : - (init || LJ_DUALNUM) ? lj_opt_narrow_forl(J, tv) : IRT_NUM; - int mode = IRSLOAD_INHERIT + - ((!LJ_DUALNUM || tvisint(tv) == (t == IRT_INT)) ? IRSLOAD_READONLY : 0); - TRef stop = fori_arg(J, fori, ra+FORL_STOP, t, mode); - TRef step = fori_arg(J, fori, ra+FORL_STEP, t, mode); - int tc, dir = rec_for_direction(&tv[FORL_STEP]); - lua_assert(bc_op(*fori) == BC_FORI || bc_op(*fori) == BC_JFORI); - scev->t.irt = t; - scev->dir = dir; - scev->stop = tref_ref(stop); - scev->step = tref_ref(step); - rec_for_check(J, t, dir, stop, step, init); - scev->start = tref_ref(find_kinit(J, fori, ra+FORL_IDX, IRT_INT)); - tc = (LJ_DUALNUM && - !(scev->start && irref_isk(scev->stop) && irref_isk(scev->step) && - tvisint(&tv[FORL_IDX]) == (t == IRT_INT))) ? - IRSLOAD_TYPECHECK : 0; - if (tc) { - J->base[ra+FORL_STOP] = stop; - J->base[ra+FORL_STEP] = step; - } - if (!idx) - idx = fori_load(J, ra+FORL_IDX, t, - IRSLOAD_INHERIT + tc + (J->scev.start << 16)); - if (!init) - J->base[ra+FORL_IDX] = idx = emitir(IRT(IR_ADD, t), idx, step); - J->base[ra+FORL_EXT] = idx; - scev->idx = tref_ref(idx); - setmref(scev->pc, fori); - J->maxslot = ra+FORL_EXT+1; -} - -/* Record FORL/JFORL or FORI/JFORI. */ -static LoopEvent rec_for(jit_State *J, const BCIns *fori, int isforl) -{ - BCReg ra = bc_a(*fori); - TValue *tv = &J->L->base[ra]; - TRef *tr = &J->base[ra]; - IROp op; - LoopEvent ev; - TRef stop; - IRType t; - if (isforl) { /* Handle FORL/JFORL opcodes. */ - TRef idx = tr[FORL_IDX]; - if (mref(J->scev.pc, const BCIns) == fori && tref_ref(idx) == J->scev.idx) { - t = J->scev.t.irt; - stop = J->scev.stop; - idx = emitir(IRT(IR_ADD, t), idx, J->scev.step); - tr[FORL_EXT] = tr[FORL_IDX] = idx; - } else { - ScEvEntry scev; - rec_for_loop(J, fori, &scev, 0); - t = scev.t.irt; - stop = scev.stop; - } - } else { /* Handle FORI/JFORI opcodes. */ - BCReg i; - lj_meta_for(J->L, tv); - t = (LJ_DUALNUM || tref_isint(tr[FORL_IDX])) ? lj_opt_narrow_forl(J, tv) : - IRT_NUM; - for (i = FORL_IDX; i <= FORL_STEP; i++) { - if (!tr[i]) sload(J, ra+i); - lua_assert(tref_isnumber_str(tr[i])); - if (tref_isstr(tr[i])) - tr[i] = emitir(IRTG(IR_STRTO, IRT_NUM), tr[i], 0); - if (t == IRT_INT) { - if (!tref_isinteger(tr[i])) - tr[i] = emitir(IRTGI(IR_CONV), tr[i], IRCONV_INT_NUM|IRCONV_CHECK); - } else { - if (!tref_isnum(tr[i])) - tr[i] = emitir(IRTN(IR_CONV), tr[i], IRCONV_NUM_INT); - } - } - tr[FORL_EXT] = tr[FORL_IDX]; - stop = tr[FORL_STOP]; - rec_for_check(J, t, rec_for_direction(&tv[FORL_STEP]), - stop, tr[FORL_STEP], 1); - } - - ev = rec_for_iter(&op, tv, isforl); - if (ev == LOOPEV_LEAVE) { - J->maxslot = ra+FORL_EXT+1; - J->pc = fori+1; - } else { - J->maxslot = ra; - J->pc = fori+bc_j(*fori)+1; - } - lj_snap_add(J); - - emitir(IRTG(op, t), tr[FORL_IDX], stop); - - if (ev == LOOPEV_LEAVE) { - J->maxslot = ra; - J->pc = fori+bc_j(*fori)+1; - } else { - J->maxslot = ra+FORL_EXT+1; - J->pc = fori+1; - } - J->needsnap = 1; - return ev; -} - -/* Record ITERL/JITERL. */ -static LoopEvent rec_iterl(jit_State *J, const BCIns iterins) -{ - BCReg ra = bc_a(iterins); - lua_assert(J->base[ra] != 0); - if (!tref_isnil(J->base[ra])) { /* Looping back? */ - J->base[ra-1] = J->base[ra]; /* Copy result of ITERC to control var. */ - J->maxslot = ra-1+bc_b(J->pc[-1]); - J->pc += bc_j(iterins)+1; - return LOOPEV_ENTER; - } else { - J->maxslot = ra-3; - J->pc++; - return LOOPEV_LEAVE; - } -} - -/* Record LOOP/JLOOP. Now, that was easy. */ -static LoopEvent rec_loop(jit_State *J, BCReg ra) -{ - if (ra < J->maxslot) J->maxslot = ra; - J->pc++; - return LOOPEV_ENTER; -} - -/* Check if a loop repeatedly failed to trace because it didn't loop back. */ -static int innerloopleft(jit_State *J, const BCIns *pc) -{ - ptrdiff_t i; - for (i = 0; i < PENALTY_SLOTS; i++) - if (mref(J->penalty[i].pc, const BCIns) == pc) { - if ((J->penalty[i].reason == LJ_TRERR_LLEAVE || - J->penalty[i].reason == LJ_TRERR_LINNER) && - J->penalty[i].val >= 2*PENALTY_MIN) - return 1; - break; - } - return 0; -} - -/* Handle the case when an interpreted loop op is hit. */ -static void rec_loop_interp(jit_State *J, const BCIns *pc, LoopEvent ev) -{ - if (J->parent == 0) { - if (pc == J->startpc && J->framedepth + J->retdepth == 0) { - /* Same loop? */ - if (ev == LOOPEV_LEAVE) /* Must loop back to form a root trace. */ - lj_trace_err(J, LJ_TRERR_LLEAVE); - rec_stop(J, LJ_TRLINK_LOOP, J->cur.traceno); /* Looping root trace. */ - } else if (ev != LOOPEV_LEAVE) { /* Entering inner loop? */ - /* It's usually better to abort here and wait until the inner loop - ** is traced. But if the inner loop repeatedly didn't loop back, - ** this indicates a low trip count. In this case try unrolling - ** an inner loop even in a root trace. But it's better to be a bit - ** more conservative here and only do it for very short loops. - */ - if (bc_j(*pc) != -1 && !innerloopleft(J, pc)) - lj_trace_err(J, LJ_TRERR_LINNER); /* Root trace hit an inner loop. */ - if ((ev != LOOPEV_ENTERLO && - J->loopref && J->cur.nins - J->loopref > 24) || --J->loopunroll < 0) - lj_trace_err(J, LJ_TRERR_LUNROLL); /* Limit loop unrolling. */ - J->loopref = J->cur.nins; - } - } else if (ev != LOOPEV_LEAVE) { /* Side trace enters an inner loop. */ - J->loopref = J->cur.nins; - if (--J->loopunroll < 0) - lj_trace_err(J, LJ_TRERR_LUNROLL); /* Limit loop unrolling. */ - } /* Side trace continues across a loop that's left or not entered. */ -} - -/* Handle the case when an already compiled loop op is hit. */ -static void rec_loop_jit(jit_State *J, TraceNo lnk, LoopEvent ev) -{ - if (J->parent == 0) { /* Root trace hit an inner loop. */ - /* Better let the inner loop spawn a side trace back here. */ - lj_trace_err(J, LJ_TRERR_LINNER); - } else if (ev != LOOPEV_LEAVE) { /* Side trace enters a compiled loop. */ - J->instunroll = 0; /* Cannot continue across a compiled loop op. */ - if (J->pc == J->startpc && J->framedepth + J->retdepth == 0) - rec_stop(J, LJ_TRLINK_LOOP, J->cur.traceno); /* Form an extra loop. */ - else - rec_stop(J, LJ_TRLINK_ROOT, lnk); /* Link to the loop. */ - } /* Side trace continues across a loop that's left or not entered. */ -} - -/* -- Record calls and returns -------------------------------------------- */ - -/* Specialize to the runtime value of the called function or its prototype. */ -static TRef rec_call_specialize(jit_State *J, GCfunc *fn, TRef tr) -{ - TRef kfunc; - if (isluafunc(fn)) { - GCproto *pt = funcproto(fn); - /* Too many closures created? Probably not a monomorphic function. */ - if (pt->flags >= PROTO_CLC_POLY) { /* Specialize to prototype instead. */ - TRef trpt = emitir(IRT(IR_FLOAD, IRT_P32), tr, IRFL_FUNC_PC); - emitir(IRTG(IR_EQ, IRT_P32), trpt, lj_ir_kptr(J, proto_bc(pt))); - (void)lj_ir_kgc(J, obj2gco(pt), IRT_PROTO); /* Prevent GC of proto. */ - return tr; - } - } - /* Otherwise specialize to the function (closure) value itself. */ - kfunc = lj_ir_kfunc(J, fn); - emitir(IRTG(IR_EQ, IRT_FUNC), tr, kfunc); - return kfunc; -} - -/* Record call setup. */ -static void rec_call_setup(jit_State *J, BCReg func, ptrdiff_t nargs) -{ - RecordIndex ix; - TValue *functv = &J->L->base[func]; - TRef *fbase = &J->base[func]; - ptrdiff_t i; - for (i = 0; i <= nargs; i++) - (void)getslot(J, func+i); /* Ensure func and all args have a reference. */ - if (!tref_isfunc(fbase[0])) { /* Resolve __call metamethod. */ - ix.tab = fbase[0]; - copyTV(J->L, &ix.tabv, functv); - if (!lj_record_mm_lookup(J, &ix, MM_call) || !tref_isfunc(ix.mobj)) - lj_trace_err(J, LJ_TRERR_NOMM); - for (i = ++nargs; i > 0; i--) /* Shift arguments up. */ - fbase[i] = fbase[i-1]; - fbase[0] = ix.mobj; /* Replace function. */ - functv = &ix.mobjv; - } - fbase[0] = TREF_FRAME | rec_call_specialize(J, funcV(functv), fbase[0]); - J->maxslot = (BCReg)nargs; -} - -/* Record call. */ -void lj_record_call(jit_State *J, BCReg func, ptrdiff_t nargs) -{ - rec_call_setup(J, func, nargs); - /* Bump frame. */ - J->framedepth++; - J->base += func+1; - J->baseslot += func+1; -} - -/* Record tail call. */ -void lj_record_tailcall(jit_State *J, BCReg func, ptrdiff_t nargs) -{ - rec_call_setup(J, func, nargs); - if (frame_isvarg(J->L->base - 1)) { - BCReg cbase = (BCReg)frame_delta(J->L->base - 1); - if (--J->framedepth < 0) - lj_trace_err(J, LJ_TRERR_NYIRETL); - J->baseslot -= (BCReg)cbase; - J->base -= cbase; - func += cbase; - } - /* Move func + args down. */ - memmove(&J->base[-1], &J->base[func], sizeof(TRef)*(J->maxslot+1)); - /* Note: the new TREF_FRAME is now at J->base[-1] (even for slot #0). */ - /* Tailcalls can form a loop, so count towards the loop unroll limit. */ - if (++J->tailcalled > J->loopunroll) - lj_trace_err(J, LJ_TRERR_LUNROLL); -} - -/* Check unroll limits for down-recursion. */ -static int check_downrec_unroll(jit_State *J, GCproto *pt) -{ - IRRef ptref; - for (ptref = J->chain[IR_KGC]; ptref; ptref = IR(ptref)->prev) - if (ir_kgc(IR(ptref)) == obj2gco(pt)) { - int count = 0; - IRRef ref; - for (ref = J->chain[IR_RETF]; ref; ref = IR(ref)->prev) - if (IR(ref)->op1 == ptref) - count++; - if (count) { - if (J->pc == J->startpc) { - if (count + J->tailcalled > J->param[JIT_P_recunroll]) - return 1; - } else { - lj_trace_err(J, LJ_TRERR_DOWNREC); - } - } - } - return 0; -} - -/* Record return. */ -void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults) -{ - TValue *frame = J->L->base - 1; - ptrdiff_t i; - for (i = 0; i < gotresults; i++) - (void)getslot(J, rbase+i); /* Ensure all results have a reference. */ - while (frame_ispcall(frame)) { /* Immediately resolve pcall() returns. */ - BCReg cbase = (BCReg)frame_delta(frame); - if (--J->framedepth <= 0) - lj_trace_err(J, LJ_TRERR_NYIRETL); - lua_assert(J->baseslot > 1); - gotresults++; - rbase += cbase; - J->baseslot -= (BCReg)cbase; - J->base -= cbase; - J->base[--rbase] = TREF_TRUE; /* Prepend true to results. */ - frame = frame_prevd(frame); - } - /* Return to lower frame via interpreter for unhandled cases. */ - if (J->framedepth == 0 && J->pt && bc_isret(bc_op(*J->pc)) && - (!frame_islua(frame) || - (J->parent == 0 && !bc_isret(bc_op(J->cur.startins))))) { - /* NYI: specialize to frame type and return directly, not via RET*. */ - for (i = 0; i < (ptrdiff_t)rbase; i++) - J->base[i] = 0; /* Purge dead slots. */ - J->maxslot = rbase + (BCReg)gotresults; - rec_stop(J, LJ_TRLINK_RETURN, 0); /* Return to interpreter. */ - return; - } - if (frame_isvarg(frame)) { - BCReg cbase = (BCReg)frame_delta(frame); - if (--J->framedepth < 0) /* NYI: return of vararg func to lower frame. */ - lj_trace_err(J, LJ_TRERR_NYIRETL); - lua_assert(J->baseslot > 1); - rbase += cbase; - J->baseslot -= (BCReg)cbase; - J->base -= cbase; - frame = frame_prevd(frame); - } - if (frame_islua(frame)) { /* Return to Lua frame. */ - BCIns callins = *(frame_pc(frame)-1); - ptrdiff_t nresults = bc_b(callins) ? (ptrdiff_t)bc_b(callins)-1 :gotresults; - BCReg cbase = bc_a(callins); - GCproto *pt = funcproto(frame_func(frame - (cbase+1))); - if ((pt->flags & PROTO_NOJIT)) - lj_trace_err(J, LJ_TRERR_CJITOFF); - if (J->framedepth == 0 && J->pt && frame == J->L->base - 1) { - if (check_downrec_unroll(J, pt)) { - J->maxslot = (BCReg)(rbase + gotresults); - lj_snap_purge(J); - rec_stop(J, LJ_TRLINK_DOWNREC, J->cur.traceno); /* Down-recursion. */ - return; - } - lj_snap_add(J); - } - for (i = 0; i < nresults; i++) /* Adjust results. */ - J->base[i-1] = i < gotresults ? J->base[rbase+i] : TREF_NIL; - J->maxslot = cbase+(BCReg)nresults; - if (J->framedepth > 0) { /* Return to a frame that is part of the trace. */ - J->framedepth--; - lua_assert(J->baseslot > cbase+1); - J->baseslot -= cbase+1; - J->base -= cbase+1; - } else if (J->parent == 0 && !bc_isret(bc_op(J->cur.startins))) { - /* Return to lower frame would leave the loop in a root trace. */ - lj_trace_err(J, LJ_TRERR_LLEAVE); - } else if (J->needsnap) { /* Tailcalled to ff with side-effects. */ - lj_trace_err(J, LJ_TRERR_NYIRETL); /* No way to insert snapshot here. */ - } else { /* Return to lower frame. Guard for the target we return to. */ - TRef trpt = lj_ir_kgc(J, obj2gco(pt), IRT_PROTO); - TRef trpc = lj_ir_kptr(J, (void *)frame_pc(frame)); - emitir(IRTG(IR_RETF, IRT_P32), trpt, trpc); - J->retdepth++; - J->needsnap = 1; - lua_assert(J->baseslot == 1); - /* Shift result slots up and clear the slots of the new frame below. */ - memmove(J->base + cbase, J->base-1, sizeof(TRef)*nresults); - memset(J->base-1, 0, sizeof(TRef)*(cbase+1)); - } - } else if (frame_iscont(frame)) { /* Return to continuation frame. */ - ASMFunction cont = frame_contf(frame); - BCReg cbase = (BCReg)frame_delta(frame); - if ((J->framedepth -= 2) < 0) - lj_trace_err(J, LJ_TRERR_NYIRETL); - J->baseslot -= (BCReg)cbase; - J->base -= cbase; - J->maxslot = cbase-2; - if (cont == lj_cont_ra) { - /* Copy result to destination slot. */ - BCReg dst = bc_a(*(frame_contpc(frame)-1)); - J->base[dst] = gotresults ? J->base[cbase+rbase] : TREF_NIL; - if (dst >= J->maxslot) J->maxslot = dst+1; - } else if (cont == lj_cont_nop) { - /* Nothing to do here. */ - } else if (cont == lj_cont_cat) { - lua_assert(0); - } else { - /* Result type already specialized. */ - lua_assert(cont == lj_cont_condf || cont == lj_cont_condt); - } - } else { - lj_trace_err(J, LJ_TRERR_NYIRETL); /* NYI: handle return to C frame. */ - } - lua_assert(J->baseslot >= 1); -} - -/* -- Metamethod handling ------------------------------------------------- */ - -/* Prepare to record call to metamethod. */ -static BCReg rec_mm_prep(jit_State *J, ASMFunction cont) -{ - BCReg s, top = curr_proto(J->L)->framesize; - TRef trcont; - setcont(&J->L->base[top], cont); -#if LJ_64 - trcont = lj_ir_kptr(J, (void *)((int64_t)cont - (int64_t)lj_vm_asm_begin)); -#else - trcont = lj_ir_kptr(J, (void *)cont); -#endif - J->base[top] = trcont | TREF_CONT; - J->framedepth++; - for (s = J->maxslot; s < top; s++) - J->base[s] = 0; /* Clear frame gap to avoid resurrecting previous refs. */ - return top+1; -} - -/* Record metamethod lookup. */ -int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm) -{ - RecordIndex mix; - GCtab *mt; - if (tref_istab(ix->tab)) { - mt = tabref(tabV(&ix->tabv)->metatable); - mix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), ix->tab, IRFL_TAB_META); - } else if (tref_isudata(ix->tab)) { - int udtype = udataV(&ix->tabv)->udtype; - mt = tabref(udataV(&ix->tabv)->metatable); - /* The metatables of special userdata objects are treated as immutable. */ - if (udtype != UDTYPE_USERDATA) { - cTValue *mo; - if (LJ_HASFFI && udtype == UDTYPE_FFI_CLIB) { - /* Specialize to the C library namespace object. */ - emitir(IRTG(IR_EQ, IRT_P32), ix->tab, lj_ir_kptr(J, udataV(&ix->tabv))); - } else { - /* Specialize to the type of userdata. */ - TRef tr = emitir(IRT(IR_FLOAD, IRT_U8), ix->tab, IRFL_UDATA_UDTYPE); - emitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, udtype)); - } - immutable_mt: - mo = lj_tab_getstr(mt, mmname_str(J2G(J), mm)); - if (!mo || tvisnil(mo)) - return 0; /* No metamethod. */ - /* Treat metamethod or index table as immutable, too. */ - if (!(tvisfunc(mo) || tvistab(mo))) - lj_trace_err(J, LJ_TRERR_BADTYPE); - copyTV(J->L, &ix->mobjv, mo); - ix->mobj = lj_ir_kgc(J, gcV(mo), tvisfunc(mo) ? IRT_FUNC : IRT_TAB); - ix->mtv = mt; - ix->mt = TREF_NIL; /* Dummy value for comparison semantics. */ - return 1; /* Got metamethod or index table. */ - } - mix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), ix->tab, IRFL_UDATA_META); - } else { - /* Specialize to base metatable. Must flush mcode in lua_setmetatable(). */ - mt = tabref(basemt_obj(J2G(J), &ix->tabv)); - if (mt == NULL) { - ix->mt = TREF_NIL; - return 0; /* No metamethod. */ - } - /* The cdata metatable is treated as immutable. */ - if (LJ_HASFFI && tref_iscdata(ix->tab)) goto immutable_mt; - ix->mt = mix.tab = lj_ir_ktab(J, mt); - goto nocheck; - } - ix->mt = mt ? mix.tab : TREF_NIL; - emitir(IRTG(mt ? IR_NE : IR_EQ, IRT_TAB), mix.tab, lj_ir_knull(J, IRT_TAB)); -nocheck: - if (mt) { - GCstr *mmstr = mmname_str(J2G(J), mm); - cTValue *mo = lj_tab_getstr(mt, mmstr); - if (mo && !tvisnil(mo)) - copyTV(J->L, &ix->mobjv, mo); - ix->mtv = mt; - settabV(J->L, &mix.tabv, mt); - setstrV(J->L, &mix.keyv, mmstr); - mix.key = lj_ir_kstr(J, mmstr); - mix.val = 0; - mix.idxchain = 0; - ix->mobj = lj_record_idx(J, &mix); - return !tref_isnil(ix->mobj); /* 1 if metamethod found, 0 if not. */ - } - return 0; /* No metamethod. */ -} - -/* Record call to arithmetic metamethod. */ -static TRef rec_mm_arith(jit_State *J, RecordIndex *ix, MMS mm) -{ - /* Set up metamethod call first to save ix->tab and ix->tabv. */ - BCReg func = rec_mm_prep(J, lj_cont_ra); - TRef *base = J->base + func; - TValue *basev = J->L->base + func; - base[1] = ix->tab; base[2] = ix->key; - copyTV(J->L, basev+1, &ix->tabv); - copyTV(J->L, basev+2, &ix->keyv); - if (!lj_record_mm_lookup(J, ix, mm)) { /* Lookup mm on 1st operand. */ - if (mm != MM_unm) { - ix->tab = ix->key; - copyTV(J->L, &ix->tabv, &ix->keyv); - if (lj_record_mm_lookup(J, ix, mm)) /* Lookup mm on 2nd operand. */ - goto ok; - } - lj_trace_err(J, LJ_TRERR_NOMM); - } -ok: - base[0] = ix->mobj; - copyTV(J->L, basev+0, &ix->mobjv); - lj_record_call(J, func, 2); - return 0; /* No result yet. */ -} - -/* Record call to __len metamethod. */ -static TRef rec_mm_len(jit_State *J, TRef tr, TValue *tv) -{ - RecordIndex ix; - ix.tab = tr; - copyTV(J->L, &ix.tabv, tv); - if (lj_record_mm_lookup(J, &ix, MM_len)) { - BCReg func = rec_mm_prep(J, lj_cont_ra); - TRef *base = J->base + func; - TValue *basev = J->L->base + func; - base[0] = ix.mobj; copyTV(J->L, basev+0, &ix.mobjv); - base[1] = tr; copyTV(J->L, basev+1, tv); -#if LJ_52 - base[2] = tr; copyTV(J->L, basev+2, tv); -#else - base[2] = TREF_NIL; setnilV(basev+2); -#endif - lj_record_call(J, func, 2); - } else { - if (LJ_52 && tref_istab(tr)) - return lj_ir_call(J, IRCALL_lj_tab_len, tr); - lj_trace_err(J, LJ_TRERR_NOMM); - } - return 0; /* No result yet. */ -} - -/* Call a comparison metamethod. */ -static void rec_mm_callcomp(jit_State *J, RecordIndex *ix, int op) -{ - BCReg func = rec_mm_prep(J, (op&1) ? lj_cont_condf : lj_cont_condt); - TRef *base = J->base + func; - TValue *tv = J->L->base + func; - base[0] = ix->mobj; base[1] = ix->val; base[2] = ix->key; - copyTV(J->L, tv+0, &ix->mobjv); - copyTV(J->L, tv+1, &ix->valv); - copyTV(J->L, tv+2, &ix->keyv); - lj_record_call(J, func, 2); -} - -/* Record call to equality comparison metamethod (for tab and udata only). */ -static void rec_mm_equal(jit_State *J, RecordIndex *ix, int op) -{ - ix->tab = ix->val; - copyTV(J->L, &ix->tabv, &ix->valv); - if (lj_record_mm_lookup(J, ix, MM_eq)) { /* Lookup mm on 1st operand. */ - cTValue *bv; - TRef mo1 = ix->mobj; - TValue mo1v; - copyTV(J->L, &mo1v, &ix->mobjv); - /* Avoid the 2nd lookup and the objcmp if the metatables are equal. */ - bv = &ix->keyv; - if (tvistab(bv) && tabref(tabV(bv)->metatable) == ix->mtv) { - TRef mt2 = emitir(IRT(IR_FLOAD, IRT_TAB), ix->key, IRFL_TAB_META); - emitir(IRTG(IR_EQ, IRT_TAB), mt2, ix->mt); - } else if (tvisudata(bv) && tabref(udataV(bv)->metatable) == ix->mtv) { - TRef mt2 = emitir(IRT(IR_FLOAD, IRT_TAB), ix->key, IRFL_UDATA_META); - emitir(IRTG(IR_EQ, IRT_TAB), mt2, ix->mt); - } else { /* Lookup metamethod on 2nd operand and compare both. */ - ix->tab = ix->key; - copyTV(J->L, &ix->tabv, bv); - if (!lj_record_mm_lookup(J, ix, MM_eq) || - lj_record_objcmp(J, mo1, ix->mobj, &mo1v, &ix->mobjv)) - return; - } - rec_mm_callcomp(J, ix, op); - } -} - -/* Record call to ordered comparison metamethods (for arbitrary objects). */ -static void rec_mm_comp(jit_State *J, RecordIndex *ix, int op) -{ - ix->tab = ix->val; - copyTV(J->L, &ix->tabv, &ix->valv); - while (1) { - MMS mm = (op & 2) ? MM_le : MM_lt; /* Try __le + __lt or only __lt. */ -#if LJ_52 - if (!lj_record_mm_lookup(J, ix, mm)) { /* Lookup mm on 1st operand. */ - ix->tab = ix->key; - copyTV(J->L, &ix->tabv, &ix->keyv); - if (!lj_record_mm_lookup(J, ix, mm)) /* Lookup mm on 2nd operand. */ - goto nomatch; - } - rec_mm_callcomp(J, ix, op); - return; -#else - if (lj_record_mm_lookup(J, ix, mm)) { /* Lookup mm on 1st operand. */ - cTValue *bv; - TRef mo1 = ix->mobj; - TValue mo1v; - copyTV(J->L, &mo1v, &ix->mobjv); - /* Avoid the 2nd lookup and the objcmp if the metatables are equal. */ - bv = &ix->keyv; - if (tvistab(bv) && tabref(tabV(bv)->metatable) == ix->mtv) { - TRef mt2 = emitir(IRT(IR_FLOAD, IRT_TAB), ix->key, IRFL_TAB_META); - emitir(IRTG(IR_EQ, IRT_TAB), mt2, ix->mt); - } else if (tvisudata(bv) && tabref(udataV(bv)->metatable) == ix->mtv) { - TRef mt2 = emitir(IRT(IR_FLOAD, IRT_TAB), ix->key, IRFL_UDATA_META); - emitir(IRTG(IR_EQ, IRT_TAB), mt2, ix->mt); - } else { /* Lookup metamethod on 2nd operand and compare both. */ - ix->tab = ix->key; - copyTV(J->L, &ix->tabv, bv); - if (!lj_record_mm_lookup(J, ix, mm) || - lj_record_objcmp(J, mo1, ix->mobj, &mo1v, &ix->mobjv)) - goto nomatch; - } - rec_mm_callcomp(J, ix, op); - return; - } -#endif - nomatch: - /* Lookup failed. Retry with __lt and swapped operands. */ - if (!(op & 2)) break; /* Already at __lt. Interpreter will throw. */ - ix->tab = ix->key; ix->key = ix->val; ix->val = ix->tab; - copyTV(J->L, &ix->tabv, &ix->keyv); - copyTV(J->L, &ix->keyv, &ix->valv); - copyTV(J->L, &ix->valv, &ix->tabv); - op ^= 3; - } -} - -#if LJ_HASFFI -/* Setup call to cdata comparison metamethod. */ -static void rec_mm_comp_cdata(jit_State *J, RecordIndex *ix, int op, MMS mm) -{ - lj_snap_add(J); - if (tref_iscdata(ix->val)) { - ix->tab = ix->val; - copyTV(J->L, &ix->tabv, &ix->valv); - } else { - lua_assert(tref_iscdata(ix->key)); - ix->tab = ix->key; - copyTV(J->L, &ix->tabv, &ix->keyv); - } - lj_record_mm_lookup(J, ix, mm); - rec_mm_callcomp(J, ix, op); -} -#endif - -/* -- Indexed access ------------------------------------------------------ */ - -/* Record bounds-check. */ -static void rec_idx_abc(jit_State *J, TRef asizeref, TRef ikey, uint32_t asize) -{ - /* Try to emit invariant bounds checks. */ - if ((J->flags & (JIT_F_OPT_LOOP|JIT_F_OPT_ABC)) == - (JIT_F_OPT_LOOP|JIT_F_OPT_ABC)) { - IRRef ref = tref_ref(ikey); - IRIns *ir = IR(ref); - int32_t ofs = 0; - IRRef ofsref = 0; - /* Handle constant offsets. */ - if (ir->o == IR_ADD && irref_isk(ir->op2)) { - ofsref = ir->op2; - ofs = IR(ofsref)->i; - ref = ir->op1; - ir = IR(ref); - } - /* Got scalar evolution analysis results for this reference? */ - if (ref == J->scev.idx) { - int32_t stop; - lua_assert(irt_isint(J->scev.t) && ir->o == IR_SLOAD); - stop = numberVint(&(J->L->base - J->baseslot)[ir->op1 + FORL_STOP]); - /* Runtime value for stop of loop is within bounds? */ - if ((uint64_t)stop + ofs < (uint64_t)asize) { - /* Emit invariant bounds check for stop. */ - emitir(IRTG(IR_ABC, IRT_P32), asizeref, ofs == 0 ? J->scev.stop : - emitir(IRTI(IR_ADD), J->scev.stop, ofsref)); - /* Emit invariant bounds check for start, if not const or negative. */ - if (!(J->scev.dir && J->scev.start && - (int64_t)IR(J->scev.start)->i + ofs >= 0)) - emitir(IRTG(IR_ABC, IRT_P32), asizeref, ikey); - return; - } - } - } - emitir(IRTGI(IR_ABC), asizeref, ikey); /* Emit regular bounds check. */ -} - -/* Record indexed key lookup. */ -static TRef rec_idx_key(jit_State *J, RecordIndex *ix) -{ - TRef key; - GCtab *t = tabV(&ix->tabv); - ix->oldv = lj_tab_get(J->L, t, &ix->keyv); /* Lookup previous value. */ - - /* Integer keys are looked up in the array part first. */ - key = ix->key; - if (tref_isnumber(key)) { - int32_t k = numberVint(&ix->keyv); - if (!tvisint(&ix->keyv) && numV(&ix->keyv) != (lua_Number)k) - k = LJ_MAX_ASIZE; - if ((MSize)k < LJ_MAX_ASIZE) { /* Potential array key? */ - TRef ikey = lj_opt_narrow_index(J, key); - TRef asizeref = emitir(IRTI(IR_FLOAD), ix->tab, IRFL_TAB_ASIZE); - if ((MSize)k < t->asize) { /* Currently an array key? */ - TRef arrayref; - rec_idx_abc(J, asizeref, ikey, t->asize); - arrayref = emitir(IRT(IR_FLOAD, IRT_P32), ix->tab, IRFL_TAB_ARRAY); - return emitir(IRT(IR_AREF, IRT_P32), arrayref, ikey); - } else { /* Currently not in array (may be an array extension)? */ - emitir(IRTGI(IR_ULE), asizeref, ikey); /* Inv. bounds check. */ - if (k == 0 && tref_isk(key)) - key = lj_ir_knum_zero(J); /* Canonicalize 0 or +-0.0 to +0.0. */ - /* And continue with the hash lookup. */ - } - } else if (!tref_isk(key)) { - /* We can rule out const numbers which failed the integerness test - ** above. But all other numbers are potential array keys. - */ - if (t->asize == 0) { /* True sparse tables have an empty array part. */ - /* Guard that the array part stays empty. */ - TRef tmp = emitir(IRTI(IR_FLOAD), ix->tab, IRFL_TAB_ASIZE); - emitir(IRTGI(IR_EQ), tmp, lj_ir_kint(J, 0)); - } else { - lj_trace_err(J, LJ_TRERR_NYITMIX); - } - } - } - - /* Otherwise the key is located in the hash part. */ - if (t->hmask == 0) { /* Shortcut for empty hash part. */ - /* Guard that the hash part stays empty. */ - TRef tmp = emitir(IRTI(IR_FLOAD), ix->tab, IRFL_TAB_HMASK); - emitir(IRTGI(IR_EQ), tmp, lj_ir_kint(J, 0)); - return lj_ir_kkptr(J, niltvg(J2G(J))); - } - if (tref_isinteger(key)) /* Hash keys are based on numbers, not ints. */ - key = emitir(IRTN(IR_CONV), key, IRCONV_NUM_INT); - if (tref_isk(key)) { - /* Optimize lookup of constant hash keys. */ - MSize hslot = (MSize)((char *)ix->oldv - (char *)&noderef(t->node)[0].val); - if (t->hmask > 0 && hslot <= t->hmask*(MSize)sizeof(Node) && - hslot <= 65535*(MSize)sizeof(Node)) { - TRef node, kslot; - TRef hm = emitir(IRTI(IR_FLOAD), ix->tab, IRFL_TAB_HMASK); - emitir(IRTGI(IR_EQ), hm, lj_ir_kint(J, (int32_t)t->hmask)); - node = emitir(IRT(IR_FLOAD, IRT_P32), ix->tab, IRFL_TAB_NODE); - kslot = lj_ir_kslot(J, key, hslot / sizeof(Node)); - return emitir(IRTG(IR_HREFK, IRT_P32), node, kslot); - } - } - /* Fall back to a regular hash lookup. */ - return emitir(IRT(IR_HREF, IRT_P32), ix->tab, key); -} - -/* Determine whether a key is NOT one of the fast metamethod names. */ -static int nommstr(jit_State *J, TRef key) -{ - if (tref_isstr(key)) { - if (tref_isk(key)) { - GCstr *str = ir_kstr(IR(tref_ref(key))); - uint32_t mm; - for (mm = 0; mm <= MM_FAST; mm++) - if (mmname_str(J2G(J), mm) == str) - return 0; /* MUST be one the fast metamethod names. */ - } else { - return 0; /* Variable string key MAY be a metamethod name. */ - } - } - return 1; /* CANNOT be a metamethod name. */ -} - -/* Record indexed load/store. */ -TRef lj_record_idx(jit_State *J, RecordIndex *ix) -{ - TRef xref; - IROp xrefop, loadop; - cTValue *oldv; - - while (!tref_istab(ix->tab)) { /* Handle non-table lookup. */ - /* Never call raw lj_record_idx() on non-table. */ - lua_assert(ix->idxchain != 0); - if (!lj_record_mm_lookup(J, ix, ix->val ? MM_newindex : MM_index)) - lj_trace_err(J, LJ_TRERR_NOMM); - handlemm: - if (tref_isfunc(ix->mobj)) { /* Handle metamethod call. */ - BCReg func = rec_mm_prep(J, ix->val ? lj_cont_nop : lj_cont_ra); - TRef *base = J->base + func; - TValue *tv = J->L->base + func; - base[0] = ix->mobj; base[1] = ix->tab; base[2] = ix->key; - setfuncV(J->L, tv+0, funcV(&ix->mobjv)); - copyTV(J->L, tv+1, &ix->tabv); - copyTV(J->L, tv+2, &ix->keyv); - if (ix->val) { - base[3] = ix->val; - copyTV(J->L, tv+3, &ix->valv); - lj_record_call(J, func, 3); /* mobj(tab, key, val) */ - return 0; - } else { - lj_record_call(J, func, 2); /* res = mobj(tab, key) */ - return 0; /* No result yet. */ - } - } - /* Otherwise retry lookup with metaobject. */ - ix->tab = ix->mobj; - copyTV(J->L, &ix->tabv, &ix->mobjv); - if (--ix->idxchain == 0) - lj_trace_err(J, LJ_TRERR_IDXLOOP); - } - - /* First catch nil and NaN keys for tables. */ - if (tvisnil(&ix->keyv) || (tvisnum(&ix->keyv) && tvisnan(&ix->keyv))) { - if (ix->val) /* Better fail early. */ - lj_trace_err(J, LJ_TRERR_STORENN); - if (tref_isk(ix->key)) { - if (ix->idxchain && lj_record_mm_lookup(J, ix, MM_index)) - goto handlemm; - return TREF_NIL; - } - } - - /* Record the key lookup. */ - xref = rec_idx_key(J, ix); - xrefop = IR(tref_ref(xref))->o; - loadop = xrefop == IR_AREF ? IR_ALOAD : IR_HLOAD; - /* The lj_meta_tset() inconsistency is gone, but better play safe. */ - oldv = xrefop == IR_KKPTR ? (cTValue *)ir_kptr(IR(tref_ref(xref))) : ix->oldv; - - if (ix->val == 0) { /* Indexed load */ - IRType t = itype2irt(oldv); - TRef res; - if (oldv == niltvg(J2G(J))) { - emitir(IRTG(IR_EQ, IRT_P32), xref, lj_ir_kkptr(J, niltvg(J2G(J)))); - res = TREF_NIL; - } else { - res = emitir(IRTG(loadop, t), xref, 0); - } - if (t == IRT_NIL && ix->idxchain && lj_record_mm_lookup(J, ix, MM_index)) - goto handlemm; - if (irtype_ispri(t)) res = TREF_PRI(t); /* Canonicalize primitives. */ - return res; - } else { /* Indexed store. */ - GCtab *mt = tabref(tabV(&ix->tabv)->metatable); - int keybarrier = tref_isgcv(ix->key) && !tref_isnil(ix->val); - if (tvisnil(oldv)) { /* Previous value was nil? */ - /* Need to duplicate the hasmm check for the early guards. */ - int hasmm = 0; - if (ix->idxchain && mt) { - cTValue *mo = lj_tab_getstr(mt, mmname_str(J2G(J), MM_newindex)); - hasmm = mo && !tvisnil(mo); - } - if (hasmm) - emitir(IRTG(loadop, IRT_NIL), xref, 0); /* Guard for nil value. */ - else if (xrefop == IR_HREF) - emitir(IRTG(oldv == niltvg(J2G(J)) ? IR_EQ : IR_NE, IRT_P32), - xref, lj_ir_kkptr(J, niltvg(J2G(J)))); - if (ix->idxchain && lj_record_mm_lookup(J, ix, MM_newindex)) { - lua_assert(hasmm); - goto handlemm; - } - lua_assert(!hasmm); - if (oldv == niltvg(J2G(J))) { /* Need to insert a new key. */ - TRef key = ix->key; - if (tref_isinteger(key)) /* NEWREF needs a TValue as a key. */ - key = emitir(IRTN(IR_CONV), key, IRCONV_NUM_INT); - xref = emitir(IRT(IR_NEWREF, IRT_P32), ix->tab, key); - keybarrier = 0; /* NEWREF already takes care of the key barrier. */ - } - } else if (!lj_opt_fwd_wasnonnil(J, loadop, tref_ref(xref))) { - /* Cannot derive that the previous value was non-nil, must do checks. */ - if (xrefop == IR_HREF) /* Guard against store to niltv. */ - emitir(IRTG(IR_NE, IRT_P32), xref, lj_ir_kkptr(J, niltvg(J2G(J)))); - if (ix->idxchain) { /* Metamethod lookup required? */ - /* A check for NULL metatable is cheaper (hoistable) than a load. */ - if (!mt) { - TRef mtref = emitir(IRT(IR_FLOAD, IRT_TAB), ix->tab, IRFL_TAB_META); - emitir(IRTG(IR_EQ, IRT_TAB), mtref, lj_ir_knull(J, IRT_TAB)); - } else { - IRType t = itype2irt(oldv); - emitir(IRTG(loadop, t), xref, 0); /* Guard for non-nil value. */ - } - } - } else { - keybarrier = 0; /* Previous non-nil value kept the key alive. */ - } - /* Convert int to number before storing. */ - if (!LJ_DUALNUM && tref_isinteger(ix->val)) - ix->val = emitir(IRTN(IR_CONV), ix->val, IRCONV_NUM_INT); - emitir(IRT(loadop+IRDELTA_L2S, tref_type(ix->val)), xref, ix->val); - if (keybarrier || tref_isgcv(ix->val)) - emitir(IRT(IR_TBAR, IRT_NIL), ix->tab, 0); - /* Invalidate neg. metamethod cache for stores with certain string keys. */ - if (!nommstr(J, ix->key)) { - TRef fref = emitir(IRT(IR_FREF, IRT_P32), ix->tab, IRFL_TAB_NOMM); - emitir(IRT(IR_FSTORE, IRT_U8), fref, lj_ir_kint(J, 0)); - } - J->needsnap = 1; - return 0; - } -} - -/* -- Upvalue access ------------------------------------------------------ */ - -/* Check whether upvalue is immutable and ok to constify. */ -static int rec_upvalue_constify(jit_State *J, GCupval *uvp) -{ - if (uvp->immutable) { - cTValue *o = uvval(uvp); - /* Don't constify objects that may retain large amounts of memory. */ -#if LJ_HASFFI - if (tviscdata(o)) { - GCcdata *cd = cdataV(o); - if (!cdataisv(cd) && !(cd->marked & LJ_GC_CDATA_FIN)) { - CType *ct = ctype_raw(ctype_ctsG(J2G(J)), cd->ctypeid); - if (!ctype_hassize(ct->info) || ct->size <= 16) - return 1; - } - return 0; - } -#else - UNUSED(J); -#endif - if (!(tvistab(o) || tvisudata(o) || tvisthread(o))) - return 1; - } - return 0; -} - -/* Record upvalue load/store. */ -static TRef rec_upvalue(jit_State *J, uint32_t uv, TRef val) -{ - GCupval *uvp = &gcref(J->fn->l.uvptr[uv])->uv; - TRef fn = getcurrf(J); - IRRef uref; - int needbarrier = 0; - if (rec_upvalue_constify(J, uvp)) { /* Try to constify immutable upvalue. */ - TRef tr, kfunc; - lua_assert(val == 0); - if (!tref_isk(fn)) { /* Late specialization of current function. */ - if (J->pt->flags >= PROTO_CLC_POLY) - goto noconstify; - kfunc = lj_ir_kfunc(J, J->fn); - emitir(IRTG(IR_EQ, IRT_FUNC), fn, kfunc); - J->base[-1] = TREF_FRAME | kfunc; - fn = kfunc; - } - tr = lj_record_constify(J, uvval(uvp)); - if (tr) - return tr; - } -noconstify: - /* Note: this effectively limits LJ_MAX_UPVAL to 127. */ - uv = (uv << 8) | (hashrot(uvp->dhash, uvp->dhash + HASH_BIAS) & 0xff); - if (!uvp->closed) { - uref = tref_ref(emitir(IRTG(IR_UREFO, IRT_P32), fn, uv)); - /* In current stack? */ - if (uvval(uvp) >= tvref(J->L->stack) && - uvval(uvp) < tvref(J->L->maxstack)) { - int32_t slot = (int32_t)(uvval(uvp) - (J->L->base - J->baseslot)); - if (slot >= 0) { /* Aliases an SSA slot? */ - emitir(IRTG(IR_EQ, IRT_P32), - REF_BASE, - emitir(IRT(IR_ADD, IRT_P32), uref, - lj_ir_kint(J, (slot - 1) * -8))); - slot -= (int32_t)J->baseslot; /* Note: slot number may be negative! */ - if (val == 0) { - return getslot(J, slot); - } else { - J->base[slot] = val; - if (slot >= (int32_t)J->maxslot) J->maxslot = (BCReg)(slot+1); - return 0; - } - } - } - emitir(IRTG(IR_UGT, IRT_P32), - emitir(IRT(IR_SUB, IRT_P32), uref, REF_BASE), - lj_ir_kint(J, (J->baseslot + J->maxslot) * 8)); - } else { - needbarrier = 1; - uref = tref_ref(emitir(IRTG(IR_UREFC, IRT_P32), fn, uv)); - } - if (val == 0) { /* Upvalue load */ - IRType t = itype2irt(uvval(uvp)); - TRef res = emitir(IRTG(IR_ULOAD, t), uref, 0); - if (irtype_ispri(t)) res = TREF_PRI(t); /* Canonicalize primitive refs. */ - return res; - } else { /* Upvalue store. */ - /* Convert int to number before storing. */ - if (!LJ_DUALNUM && tref_isinteger(val)) - val = emitir(IRTN(IR_CONV), val, IRCONV_NUM_INT); - emitir(IRT(IR_USTORE, tref_type(val)), uref, val); - if (needbarrier && tref_isgcv(val)) - emitir(IRT(IR_OBAR, IRT_NIL), uref, val); - J->needsnap = 1; - return 0; - } -} - -/* -- Record calls to Lua functions --------------------------------------- */ - -/* Check unroll limits for calls. */ -static void check_call_unroll(jit_State *J, TraceNo lnk) -{ - cTValue *frame = J->L->base - 1; - void *pc = mref(frame_func(frame)->l.pc, void); - int32_t depth = J->framedepth; - int32_t count = 0; - if ((J->pt->flags & PROTO_VARARG)) depth--; /* Vararg frame still missing. */ - for (; depth > 0; depth--) { /* Count frames with same prototype. */ - if (frame_iscont(frame)) depth--; - frame = frame_prev(frame); - if (mref(frame_func(frame)->l.pc, void) == pc) - count++; - } - if (J->pc == J->startpc) { - if (count + J->tailcalled > J->param[JIT_P_recunroll]) { - J->pc++; - if (J->framedepth + J->retdepth == 0) - rec_stop(J, LJ_TRLINK_TAILREC, J->cur.traceno); /* Tail-recursion. */ - else - rec_stop(J, LJ_TRLINK_UPREC, J->cur.traceno); /* Up-recursion. */ - } - } else { - if (count > J->param[JIT_P_callunroll]) { - if (lnk) { /* Possible tail- or up-recursion. */ - lj_trace_flush(J, lnk); /* Flush trace that only returns. */ - /* Set a small, pseudo-random hotcount for a quick retry of JFUNC*. */ - hotcount_set(J2GG(J), J->pc+1, LJ_PRNG_BITS(J, 4)); - } - lj_trace_err(J, LJ_TRERR_CUNROLL); - } - } -} - -/* Record Lua function setup. */ -static void rec_func_setup(jit_State *J) -{ - GCproto *pt = J->pt; - BCReg s, numparams = pt->numparams; - if ((pt->flags & PROTO_NOJIT)) - lj_trace_err(J, LJ_TRERR_CJITOFF); - if (J->baseslot + pt->framesize >= LJ_MAX_JSLOTS) - lj_trace_err(J, LJ_TRERR_STACKOV); - /* Fill up missing parameters with nil. */ - for (s = J->maxslot; s < numparams; s++) - J->base[s] = TREF_NIL; - /* The remaining slots should never be read before they are written. */ - J->maxslot = numparams; -} - -/* Record Lua vararg function setup. */ -static void rec_func_vararg(jit_State *J) -{ - GCproto *pt = J->pt; - BCReg s, fixargs, vframe = J->maxslot+1; - lua_assert((pt->flags & PROTO_VARARG)); - if (J->baseslot + vframe + pt->framesize >= LJ_MAX_JSLOTS) - lj_trace_err(J, LJ_TRERR_STACKOV); - J->base[vframe-1] = J->base[-1]; /* Copy function up. */ - /* Copy fixarg slots up and set their original slots to nil. */ - fixargs = pt->numparams < J->maxslot ? pt->numparams : J->maxslot; - for (s = 0; s < fixargs; s++) { - J->base[vframe+s] = J->base[s]; - J->base[s] = TREF_NIL; - } - J->maxslot = fixargs; - J->framedepth++; - J->base += vframe; - J->baseslot += vframe; -} - -/* Record entry to a Lua function. */ -static void rec_func_lua(jit_State *J) -{ - rec_func_setup(J); - check_call_unroll(J, 0); -} - -/* Record entry to an already compiled function. */ -static void rec_func_jit(jit_State *J, TraceNo lnk) -{ - GCtrace *T; - rec_func_setup(J); - T = traceref(J, lnk); - if (T->linktype == LJ_TRLINK_RETURN) { /* Trace returns to interpreter? */ - check_call_unroll(J, lnk); - /* Temporarily unpatch JFUNC* to continue recording across function. */ - J->patchins = *J->pc; - J->patchpc = (BCIns *)J->pc; - *J->patchpc = T->startins; - return; - } - J->instunroll = 0; /* Cannot continue across a compiled function. */ - if (J->pc == J->startpc && J->framedepth + J->retdepth == 0) - rec_stop(J, LJ_TRLINK_TAILREC, J->cur.traceno); /* Extra tail-recursion. */ - else - rec_stop(J, LJ_TRLINK_ROOT, lnk); /* Link to the function. */ -} - -/* -- Vararg handling ----------------------------------------------------- */ - -/* Detect y = select(x, ...) idiom. */ -static int select_detect(jit_State *J) -{ - BCIns ins = J->pc[1]; - if (bc_op(ins) == BC_CALLM && bc_b(ins) == 2 && bc_c(ins) == 1) { - cTValue *func = &J->L->base[bc_a(ins)]; - if (tvisfunc(func) && funcV(func)->c.ffid == FF_select) { - TRef kfunc = lj_ir_kfunc(J, funcV(func)); - emitir(IRTG(IR_EQ, IRT_FUNC), getslot(J, bc_a(ins)), kfunc); - return 1; - } - } - return 0; -} - -/* Record vararg instruction. */ -static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults) -{ - int32_t numparams = J->pt->numparams; - ptrdiff_t nvararg = frame_delta(J->L->base-1) - numparams - 1; - lua_assert(frame_isvarg(J->L->base-1)); - if (J->framedepth > 0) { /* Simple case: varargs defined on-trace. */ - ptrdiff_t i; - if (nvararg < 0) nvararg = 0; - if (nresults == -1) { - nresults = nvararg; - J->maxslot = dst + (BCReg)nvararg; - } else if (dst + nresults > J->maxslot) { - J->maxslot = dst + (BCReg)nresults; - } - for (i = 0; i < nresults; i++) - J->base[dst+i] = i < nvararg ? getslot(J, i - nvararg - 1) : TREF_NIL; - } else { /* Unknown number of varargs passed to trace. */ - TRef fr = emitir(IRTI(IR_SLOAD), 0, IRSLOAD_READONLY|IRSLOAD_FRAME); - int32_t frofs = 8*(1+numparams)+FRAME_VARG; - if (nresults >= 0) { /* Known fixed number of results. */ - ptrdiff_t i; - if (nvararg > 0) { - ptrdiff_t nload = nvararg >= nresults ? nresults : nvararg; - TRef vbase; - if (nvararg >= nresults) - emitir(IRTGI(IR_GE), fr, lj_ir_kint(J, frofs+8*(int32_t)nresults)); - else - emitir(IRTGI(IR_EQ), fr, lj_ir_kint(J, frame_ftsz(J->L->base-1))); - vbase = emitir(IRTI(IR_SUB), REF_BASE, fr); - vbase = emitir(IRT(IR_ADD, IRT_P32), vbase, lj_ir_kint(J, frofs-8)); - for (i = 0; i < nload; i++) { - IRType t = itype2irt(&J->L->base[i-1-nvararg]); - TRef aref = emitir(IRT(IR_AREF, IRT_P32), - vbase, lj_ir_kint(J, (int32_t)i)); - TRef tr = emitir(IRTG(IR_VLOAD, t), aref, 0); - if (irtype_ispri(t)) tr = TREF_PRI(t); /* Canonicalize primitives. */ - J->base[dst+i] = tr; - } - } else { - emitir(IRTGI(IR_LE), fr, lj_ir_kint(J, frofs)); - nvararg = 0; - } - for (i = nvararg; i < nresults; i++) - J->base[dst+i] = TREF_NIL; - if (dst + (BCReg)nresults > J->maxslot) - J->maxslot = dst + (BCReg)nresults; - } else if (select_detect(J)) { /* y = select(x, ...) */ - TRef tridx = J->base[dst-1]; - TRef tr = TREF_NIL; - ptrdiff_t idx = lj_ffrecord_select_mode(J, tridx, &J->L->base[dst-1]); - if (idx < 0) goto nyivarg; - if (idx != 0 && !tref_isinteger(tridx)) - tridx = emitir(IRTGI(IR_CONV), tridx, IRCONV_INT_NUM|IRCONV_INDEX); - if (idx != 0 && tref_isk(tridx)) { - emitir(IRTGI(idx <= nvararg ? IR_GE : IR_LT), - fr, lj_ir_kint(J, frofs+8*(int32_t)idx)); - frofs -= 8; /* Bias for 1-based index. */ - } else if (idx <= nvararg) { /* Compute size. */ - TRef tmp = emitir(IRTI(IR_ADD), fr, lj_ir_kint(J, -frofs)); - if (numparams) - emitir(IRTGI(IR_GE), tmp, lj_ir_kint(J, 0)); - tr = emitir(IRTI(IR_BSHR), tmp, lj_ir_kint(J, 3)); - if (idx != 0) { - tridx = emitir(IRTI(IR_ADD), tridx, lj_ir_kint(J, -1)); - rec_idx_abc(J, tr, tridx, (uint32_t)nvararg); - } - } else { - TRef tmp = lj_ir_kint(J, frofs); - if (idx != 0) { - TRef tmp2 = emitir(IRTI(IR_BSHL), tridx, lj_ir_kint(J, 3)); - tmp = emitir(IRTI(IR_ADD), tmp2, tmp); - } else { - tr = lj_ir_kint(J, 0); - } - emitir(IRTGI(IR_LT), fr, tmp); - } - if (idx != 0 && idx <= nvararg) { - IRType t; - TRef aref, vbase = emitir(IRTI(IR_SUB), REF_BASE, fr); - vbase = emitir(IRT(IR_ADD, IRT_P32), vbase, lj_ir_kint(J, frofs-8)); - t = itype2irt(&J->L->base[idx-2-nvararg]); - aref = emitir(IRT(IR_AREF, IRT_P32), vbase, tridx); - tr = emitir(IRTG(IR_VLOAD, t), aref, 0); - if (irtype_ispri(t)) tr = TREF_PRI(t); /* Canonicalize primitives. */ - } - J->base[dst-2] = tr; - J->maxslot = dst-1; - J->bcskip = 2; /* Skip CALLM + select. */ - } else { - nyivarg: - setintV(&J->errinfo, BC_VARG); - lj_trace_err_info(J, LJ_TRERR_NYIBC); - } - } -} - -/* -- Record allocations -------------------------------------------------- */ - -static TRef rec_tnew(jit_State *J, uint32_t ah) -{ - uint32_t asize = ah & 0x7ff; - uint32_t hbits = ah >> 11; - if (asize == 0x7ff) asize = 0x801; - return emitir(IRTG(IR_TNEW, IRT_TAB), asize, hbits); -} - -/* -- Record bytecode ops ------------------------------------------------- */ - -/* Prepare for comparison. */ -static void rec_comp_prep(jit_State *J) -{ - /* Prevent merging with snapshot #0 (GC exit) since we fixup the PC. */ - if (J->cur.nsnap == 1 && J->cur.snap[0].ref == J->cur.nins) - emitir_raw(IRT(IR_NOP, IRT_NIL), 0, 0); - lj_snap_add(J); -} - -/* Fixup comparison. */ -static void rec_comp_fixup(jit_State *J, const BCIns *pc, int cond) -{ - BCIns jmpins = pc[1]; - const BCIns *npc = pc + 2 + (cond ? bc_j(jmpins) : 0); - SnapShot *snap = &J->cur.snap[J->cur.nsnap-1]; - /* Set PC to opposite target to avoid re-recording the comp. in side trace. */ - J->cur.snapmap[snap->mapofs + snap->nent] = SNAP_MKPC(npc); - J->needsnap = 1; - if (bc_a(jmpins) < J->maxslot) J->maxslot = bc_a(jmpins); - lj_snap_shrink(J); /* Shrink last snapshot if possible. */ -} - -/* Record the next bytecode instruction (_before_ it's executed). */ -void lj_record_ins(jit_State *J) -{ - cTValue *lbase; - RecordIndex ix; - const BCIns *pc; - BCIns ins; - BCOp op; - TRef ra, rb, rc; - - /* Perform post-processing action before recording the next instruction. */ - if (LJ_UNLIKELY(J->postproc != LJ_POST_NONE)) { - switch (J->postproc) { - case LJ_POST_FIXCOMP: /* Fixup comparison. */ - pc = frame_pc(&J2G(J)->tmptv); - rec_comp_fixup(J, pc, (!tvistruecond(&J2G(J)->tmptv2) ^ (bc_op(*pc)&1))); - /* fallthrough */ - case LJ_POST_FIXGUARD: /* Fixup and emit pending guard. */ - case LJ_POST_FIXGUARDSNAP: /* Fixup and emit pending guard and snapshot. */ - if (!tvistruecond(&J2G(J)->tmptv2)) { - J->fold.ins.o ^= 1; /* Flip guard to opposite. */ - if (J->postproc == LJ_POST_FIXGUARDSNAP) { - SnapShot *snap = &J->cur.snap[J->cur.nsnap-1]; - J->cur.snapmap[snap->mapofs+snap->nent-1]--; /* False -> true. */ - } - } - lj_opt_fold(J); /* Emit pending guard. */ - /* fallthrough */ - case LJ_POST_FIXBOOL: - if (!tvistruecond(&J2G(J)->tmptv2)) { - BCReg s; - TValue *tv = J->L->base; - for (s = 0; s < J->maxslot; s++) /* Fixup stack slot (if any). */ - if (J->base[s] == TREF_TRUE && tvisfalse(&tv[s])) { - J->base[s] = TREF_FALSE; - break; - } - } - break; - case LJ_POST_FIXCONST: - { - BCReg s; - TValue *tv = J->L->base; - for (s = 0; s < J->maxslot; s++) /* Constify stack slots (if any). */ - if (J->base[s] == TREF_NIL && !tvisnil(&tv[s])) - J->base[s] = lj_record_constify(J, &tv[s]); - } - break; - case LJ_POST_FFRETRY: /* Suppress recording of retried fast function. */ - if (bc_op(*J->pc) >= BC__MAX) - return; - break; - default: lua_assert(0); break; - } - J->postproc = LJ_POST_NONE; - } - - /* Need snapshot before recording next bytecode (e.g. after a store). */ - if (J->needsnap) { - J->needsnap = 0; - lj_snap_purge(J); - lj_snap_add(J); - J->mergesnap = 1; - } - - /* Skip some bytecodes. */ - if (LJ_UNLIKELY(J->bcskip > 0)) { - J->bcskip--; - return; - } - - /* Record only closed loops for root traces. */ - pc = J->pc; - if (J->framedepth == 0 && - (MSize)((char *)pc - (char *)J->bc_min) >= J->bc_extent) - lj_trace_err(J, LJ_TRERR_LLEAVE); - -#ifdef LUA_USE_ASSERT - rec_check_slots(J); - rec_check_ir(J); -#endif - - /* Keep a copy of the runtime values of var/num/str operands. */ -#define rav (&ix.valv) -#define rbv (&ix.tabv) -#define rcv (&ix.keyv) - - lbase = J->L->base; - ins = *pc; - op = bc_op(ins); - ra = bc_a(ins); - ix.val = 0; - switch (bcmode_a(op)) { - case BCMvar: - copyTV(J->L, rav, &lbase[ra]); ix.val = ra = getslot(J, ra); break; - default: break; /* Handled later. */ - } - rb = bc_b(ins); - rc = bc_c(ins); - switch (bcmode_b(op)) { - case BCMnone: rb = 0; rc = bc_d(ins); break; /* Upgrade rc to 'rd'. */ - case BCMvar: - copyTV(J->L, rbv, &lbase[rb]); ix.tab = rb = getslot(J, rb); break; - default: break; /* Handled later. */ - } - switch (bcmode_c(op)) { - case BCMvar: - copyTV(J->L, rcv, &lbase[rc]); ix.key = rc = getslot(J, rc); break; - case BCMpri: setitype(rcv, ~rc); ix.key = rc = TREF_PRI(IRT_NIL+rc); break; - case BCMnum: { cTValue *tv = proto_knumtv(J->pt, rc); - copyTV(J->L, rcv, tv); ix.key = rc = tvisint(tv) ? lj_ir_kint(J, intV(tv)) : - lj_ir_knumint(J, numV(tv)); } break; - case BCMstr: { GCstr *s = gco2str(proto_kgc(J->pt, ~(ptrdiff_t)rc)); - setstrV(J->L, rcv, s); ix.key = rc = lj_ir_kstr(J, s); } break; - default: break; /* Handled later. */ - } - - switch (op) { - - /* -- Comparison ops ---------------------------------------------------- */ - - case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: -#if LJ_HASFFI - if (tref_iscdata(ra) || tref_iscdata(rc)) { - rec_mm_comp_cdata(J, &ix, op, ((int)op & 2) ? MM_le : MM_lt); - break; - } -#endif - /* Emit nothing for two numeric or string consts. */ - if (!(tref_isk2(ra,rc) && tref_isnumber_str(ra) && tref_isnumber_str(rc))) { - IRType ta = tref_isinteger(ra) ? IRT_INT : tref_type(ra); - IRType tc = tref_isinteger(rc) ? IRT_INT : tref_type(rc); - int irop; - if (ta != tc) { - /* Widen mixed number/int comparisons to number/number comparison. */ - if (ta == IRT_INT && tc == IRT_NUM) { - ra = emitir(IRTN(IR_CONV), ra, IRCONV_NUM_INT); - ta = IRT_NUM; - } else if (ta == IRT_NUM && tc == IRT_INT) { - rc = emitir(IRTN(IR_CONV), rc, IRCONV_NUM_INT); - } else if (LJ_52) { - ta = IRT_NIL; /* Force metamethod for different types. */ - } else if (!((ta == IRT_FALSE || ta == IRT_TRUE) && - (tc == IRT_FALSE || tc == IRT_TRUE))) { - break; /* Interpreter will throw for two different types. */ - } - } - rec_comp_prep(J); - irop = (int)op - (int)BC_ISLT + (int)IR_LT; - if (ta == IRT_NUM) { - if ((irop & 1)) irop ^= 4; /* ISGE/ISGT are unordered. */ - if (!lj_ir_numcmp(numberVnum(rav), numberVnum(rcv), (IROp)irop)) - irop ^= 5; - } else if (ta == IRT_INT) { - if (!lj_ir_numcmp(numberVnum(rav), numberVnum(rcv), (IROp)irop)) - irop ^= 1; - } else if (ta == IRT_STR) { - if (!lj_ir_strcmp(strV(rav), strV(rcv), (IROp)irop)) irop ^= 1; - ra = lj_ir_call(J, IRCALL_lj_str_cmp, ra, rc); - rc = lj_ir_kint(J, 0); - ta = IRT_INT; - } else { - rec_mm_comp(J, &ix, (int)op); - break; - } - emitir(IRTG(irop, ta), ra, rc); - rec_comp_fixup(J, J->pc, ((int)op ^ irop) & 1); - } - break; - - case BC_ISEQV: case BC_ISNEV: - case BC_ISEQS: case BC_ISNES: - case BC_ISEQN: case BC_ISNEN: - case BC_ISEQP: case BC_ISNEP: -#if LJ_HASFFI - if (tref_iscdata(ra) || tref_iscdata(rc)) { - rec_mm_comp_cdata(J, &ix, op, MM_eq); - break; - } -#endif - /* Emit nothing for two non-table, non-udata consts. */ - if (!(tref_isk2(ra, rc) && !(tref_istab(ra) || tref_isudata(ra)))) { - int diff; - rec_comp_prep(J); - diff = lj_record_objcmp(J, ra, rc, rav, rcv); - if (diff == 2 || !(tref_istab(ra) || tref_isudata(ra))) - rec_comp_fixup(J, J->pc, ((int)op & 1) == !diff); - else if (diff == 1) /* Only check __eq if different, but same type. */ - rec_mm_equal(J, &ix, (int)op); - } - break; - - /* -- Unary test and copy ops ------------------------------------------- */ - - case BC_ISTC: case BC_ISFC: - if ((op & 1) == tref_istruecond(rc)) - rc = 0; /* Don't store if condition is not true. */ - /* fallthrough */ - case BC_IST: case BC_ISF: /* Type specialization suffices. */ - if (bc_a(pc[1]) < J->maxslot) - J->maxslot = bc_a(pc[1]); /* Shrink used slots. */ - break; - - /* -- Unary ops --------------------------------------------------------- */ - - case BC_NOT: - /* Type specialization already forces const result. */ - rc = tref_istruecond(rc) ? TREF_FALSE : TREF_TRUE; - break; - - case BC_LEN: - if (tref_isstr(rc)) - rc = emitir(IRTI(IR_FLOAD), rc, IRFL_STR_LEN); - else if (!LJ_52 && tref_istab(rc)) - rc = lj_ir_call(J, IRCALL_lj_tab_len, rc); - else - rc = rec_mm_len(J, rc, rcv); - break; - - /* -- Arithmetic ops ---------------------------------------------------- */ - - case BC_UNM: - if (tref_isnumber_str(rc)) { - rc = lj_opt_narrow_unm(J, rc, rcv); - } else { - ix.tab = rc; - copyTV(J->L, &ix.tabv, rcv); - rc = rec_mm_arith(J, &ix, MM_unm); - } - break; - - case BC_ADDNV: case BC_SUBNV: case BC_MULNV: case BC_DIVNV: case BC_MODNV: - /* Swap rb/rc and rbv/rcv. rav is temp. */ - ix.tab = rc; ix.key = rc = rb; rb = ix.tab; - copyTV(J->L, rav, rbv); - copyTV(J->L, rbv, rcv); - copyTV(J->L, rcv, rav); - if (op == BC_MODNV) - goto recmod; - /* fallthrough */ - case BC_ADDVN: case BC_SUBVN: case BC_MULVN: case BC_DIVVN: - case BC_ADDVV: case BC_SUBVV: case BC_MULVV: case BC_DIVVV: { - MMS mm = bcmode_mm(op); - if (tref_isnumber_str(rb) && tref_isnumber_str(rc)) - rc = lj_opt_narrow_arith(J, rb, rc, rbv, rcv, - (int)mm - (int)MM_add + (int)IR_ADD); - else - rc = rec_mm_arith(J, &ix, mm); - break; - } - - case BC_MODVN: case BC_MODVV: - recmod: - if (tref_isnumber_str(rb) && tref_isnumber_str(rc)) - rc = lj_opt_narrow_mod(J, rb, rc, rbv, rcv); - else - rc = rec_mm_arith(J, &ix, MM_mod); - break; - - case BC_POW: - if (tref_isnumber_str(rb) && tref_isnumber_str(rc)) - rc = lj_opt_narrow_pow(J, rb, rc, rbv, rcv); - else - rc = rec_mm_arith(J, &ix, MM_pow); - break; - - /* -- Constant and move ops --------------------------------------------- */ - - case BC_MOV: - /* Clear gap of method call to avoid resurrecting previous refs. */ - if (ra > J->maxslot) J->base[ra-1] = 0; - break; - case BC_KSTR: case BC_KNUM: case BC_KPRI: - break; - case BC_KSHORT: - rc = lj_ir_kint(J, (int32_t)(int16_t)rc); - break; - case BC_KNIL: - while (ra <= rc) - J->base[ra++] = TREF_NIL; - if (rc >= J->maxslot) J->maxslot = rc+1; - break; -#if LJ_HASFFI - case BC_KCDATA: - rc = lj_ir_kgc(J, proto_kgc(J->pt, ~(ptrdiff_t)rc), IRT_CDATA); - break; -#endif - - /* -- Upvalue and function ops ------------------------------------------ */ - - case BC_UGET: - rc = rec_upvalue(J, rc, 0); - break; - case BC_USETV: case BC_USETS: case BC_USETN: case BC_USETP: - rec_upvalue(J, ra, rc); - break; - - /* -- Table ops --------------------------------------------------------- */ - - case BC_GGET: case BC_GSET: - settabV(J->L, &ix.tabv, tabref(J->fn->l.env)); - ix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), getcurrf(J), IRFL_FUNC_ENV); - ix.idxchain = LJ_MAX_IDXCHAIN; - rc = lj_record_idx(J, &ix); - break; - - case BC_TGETB: case BC_TSETB: - setintV(&ix.keyv, (int32_t)rc); - ix.key = lj_ir_kint(J, (int32_t)rc); - /* fallthrough */ - case BC_TGETV: case BC_TGETS: case BC_TSETV: case BC_TSETS: - ix.idxchain = LJ_MAX_IDXCHAIN; - rc = lj_record_idx(J, &ix); - break; - - case BC_TNEW: - rc = rec_tnew(J, rc); - break; - case BC_TDUP: - rc = emitir(IRTG(IR_TDUP, IRT_TAB), - lj_ir_ktab(J, gco2tab(proto_kgc(J->pt, ~(ptrdiff_t)rc))), 0); - break; - - /* -- Calls and vararg handling ----------------------------------------- */ - - case BC_ITERC: - J->base[ra] = getslot(J, ra-3); - J->base[ra+1] = getslot(J, ra-2); - J->base[ra+2] = getslot(J, ra-1); - { /* Do the actual copy now because lj_record_call needs the values. */ - TValue *b = &J->L->base[ra]; - copyTV(J->L, b, b-3); - copyTV(J->L, b+1, b-2); - copyTV(J->L, b+2, b-1); - } - lj_record_call(J, ra, (ptrdiff_t)rc-1); - break; - - /* L->top is set to L->base+ra+rc+NARGS-1+1. See lj_dispatch_ins(). */ - case BC_CALLM: - rc = (BCReg)(J->L->top - J->L->base) - ra; - /* fallthrough */ - case BC_CALL: - lj_record_call(J, ra, (ptrdiff_t)rc-1); - break; - - case BC_CALLMT: - rc = (BCReg)(J->L->top - J->L->base) - ra; - /* fallthrough */ - case BC_CALLT: - lj_record_tailcall(J, ra, (ptrdiff_t)rc-1); - break; - - case BC_VARG: - rec_varg(J, ra, (ptrdiff_t)rb-1); - break; - - /* -- Returns ----------------------------------------------------------- */ - - case BC_RETM: - /* L->top is set to L->base+ra+rc+NRESULTS-1, see lj_dispatch_ins(). */ - rc = (BCReg)(J->L->top - J->L->base) - ra + 1; - /* fallthrough */ - case BC_RET: case BC_RET0: case BC_RET1: - lj_record_ret(J, ra, (ptrdiff_t)rc-1); - break; - - /* -- Loops and branches ------------------------------------------------ */ - - case BC_FORI: - if (rec_for(J, pc, 0) != LOOPEV_LEAVE) - J->loopref = J->cur.nins; - break; - case BC_JFORI: - lua_assert(bc_op(pc[(ptrdiff_t)rc-BCBIAS_J]) == BC_JFORL); - if (rec_for(J, pc, 0) != LOOPEV_LEAVE) /* Link to existing loop. */ - rec_stop(J, LJ_TRLINK_ROOT, bc_d(pc[(ptrdiff_t)rc-BCBIAS_J])); - /* Continue tracing if the loop is not entered. */ - break; - - case BC_FORL: - rec_loop_interp(J, pc, rec_for(J, pc+((ptrdiff_t)rc-BCBIAS_J), 1)); - break; - case BC_ITERL: - rec_loop_interp(J, pc, rec_iterl(J, *pc)); - break; - case BC_LOOP: - rec_loop_interp(J, pc, rec_loop(J, ra)); - break; - - case BC_JFORL: - rec_loop_jit(J, rc, rec_for(J, pc+bc_j(traceref(J, rc)->startins), 1)); - break; - case BC_JITERL: - rec_loop_jit(J, rc, rec_iterl(J, traceref(J, rc)->startins)); - break; - case BC_JLOOP: - rec_loop_jit(J, rc, rec_loop(J, ra)); - break; - - case BC_IFORL: - case BC_IITERL: - case BC_ILOOP: - case BC_IFUNCF: - case BC_IFUNCV: - lj_trace_err(J, LJ_TRERR_BLACKL); - break; - - case BC_JMP: - if (ra < J->maxslot) - J->maxslot = ra; /* Shrink used slots. */ - break; - - /* -- Function headers -------------------------------------------------- */ - - case BC_FUNCF: - rec_func_lua(J); - break; - case BC_JFUNCF: - rec_func_jit(J, rc); - break; - - case BC_FUNCV: - rec_func_vararg(J); - rec_func_lua(J); - break; - case BC_JFUNCV: - lua_assert(0); /* Cannot happen. No hotcall counting for varag funcs. */ - break; - - case BC_FUNCC: - case BC_FUNCCW: - lj_ffrecord_func(J); - break; - - default: - if (op >= BC__MAX) { - lj_ffrecord_func(J); - break; - } - /* fallthrough */ - case BC_ITERN: - case BC_ISNEXT: - case BC_CAT: - case BC_UCLO: - case BC_FNEW: - case BC_TSETM: - setintV(&J->errinfo, (int32_t)op); - lj_trace_err_info(J, LJ_TRERR_NYIBC); - break; - } - - /* rc == 0 if we have no result yet, e.g. pending __index metamethod call. */ - if (bcmode_a(op) == BCMdst && rc) { - J->base[ra] = rc; - if (ra >= J->maxslot) J->maxslot = ra+1; - } - -#undef rav -#undef rbv -#undef rcv - - /* Limit the number of recorded IR instructions. */ - if (J->cur.nins > REF_FIRST+(IRRef)J->param[JIT_P_maxrecord]) - lj_trace_err(J, LJ_TRERR_TRACEOV); -} - -/* -- Recording setup ----------------------------------------------------- */ - -/* Setup recording for a root trace started by a hot loop. */ -static const BCIns *rec_setup_root(jit_State *J) -{ - /* Determine the next PC and the bytecode range for the loop. */ - const BCIns *pcj, *pc = J->pc; - BCIns ins = *pc; - BCReg ra = bc_a(ins); - switch (bc_op(ins)) { - case BC_FORL: - J->bc_extent = (MSize)(-bc_j(ins))*sizeof(BCIns); - pc += 1+bc_j(ins); - J->bc_min = pc; - break; - case BC_ITERL: - lua_assert(bc_op(pc[-1]) == BC_ITERC); - J->maxslot = ra + bc_b(pc[-1]) - 1; - J->bc_extent = (MSize)(-bc_j(ins))*sizeof(BCIns); - pc += 1+bc_j(ins); - lua_assert(bc_op(pc[-1]) == BC_JMP); - J->bc_min = pc; - break; - case BC_LOOP: - /* Only check BC range for real loops, but not for "repeat until true". */ - pcj = pc + bc_j(ins); - ins = *pcj; - if (bc_op(ins) == BC_JMP && bc_j(ins) < 0) { - J->bc_min = pcj+1 + bc_j(ins); - J->bc_extent = (MSize)(-bc_j(ins))*sizeof(BCIns); - } - J->maxslot = ra; - pc++; - break; - case BC_RET: - case BC_RET0: - case BC_RET1: - /* No bytecode range check for down-recursive root traces. */ - J->maxslot = ra + bc_d(ins) - 1; - break; - case BC_FUNCF: - /* No bytecode range check for root traces started by a hot call. */ - J->maxslot = J->pt->numparams; - pc++; - break; - default: - lua_assert(0); - break; - } - return pc; -} - -/* Setup for recording a new trace. */ -void lj_record_setup(jit_State *J) -{ - uint32_t i; - - /* Initialize state related to current trace. */ - memset(J->slot, 0, sizeof(J->slot)); - memset(J->chain, 0, sizeof(J->chain)); - memset(J->bpropcache, 0, sizeof(J->bpropcache)); - J->scev.idx = REF_NIL; - setmref(J->scev.pc, NULL); - - J->baseslot = 1; /* Invoking function is at base[-1]. */ - J->base = J->slot + J->baseslot; - J->maxslot = 0; - J->framedepth = 0; - J->retdepth = 0; - - J->instunroll = J->param[JIT_P_instunroll]; - J->loopunroll = J->param[JIT_P_loopunroll]; - J->tailcalled = 0; - J->loopref = 0; - - J->bc_min = NULL; /* Means no limit. */ - J->bc_extent = ~(MSize)0; - - /* Emit instructions for fixed references. Also triggers initial IR alloc. */ - emitir_raw(IRT(IR_BASE, IRT_P32), J->parent, J->exitno); - for (i = 0; i <= 2; i++) { - IRIns *ir = IR(REF_NIL-i); - ir->i = 0; - ir->t.irt = (uint8_t)(IRT_NIL+i); - ir->o = IR_KPRI; - ir->prev = 0; - } - J->cur.nk = REF_TRUE; - - J->startpc = J->pc; - setmref(J->cur.startpc, J->pc); - if (J->parent) { /* Side trace. */ - GCtrace *T = traceref(J, J->parent); - TraceNo root = T->root ? T->root : J->parent; - J->cur.root = (uint16_t)root; - J->cur.startins = BCINS_AD(BC_JMP, 0, 0); - /* Check whether we could at least potentially form an extra loop. */ - if (J->exitno == 0 && T->snap[0].nent == 0) { - /* We can narrow a FORL for some side traces, too. */ - if (J->pc > proto_bc(J->pt) && bc_op(J->pc[-1]) == BC_JFORI && - bc_d(J->pc[bc_j(J->pc[-1])-1]) == root) { - lj_snap_add(J); - rec_for_loop(J, J->pc-1, &J->scev, 1); - goto sidecheck; - } - } else { - J->startpc = NULL; /* Prevent forming an extra loop. */ - } - lj_snap_replay(J, T); - sidecheck: - if (traceref(J, J->cur.root)->nchild >= J->param[JIT_P_maxside] || - T->snap[J->exitno].count >= J->param[JIT_P_hotexit] + - J->param[JIT_P_tryside]) { - rec_stop(J, LJ_TRLINK_INTERP, 0); - } - } else { /* Root trace. */ - J->cur.root = 0; - J->cur.startins = *J->pc; - J->pc = rec_setup_root(J); - /* Note: the loop instruction itself is recorded at the end and not - ** at the start! So snapshot #0 needs to point to the *next* instruction. - */ - lj_snap_add(J); - if (bc_op(J->cur.startins) == BC_FORL) - rec_for_loop(J, J->pc-1, &J->scev, 1); - if (1 + J->pt->framesize >= LJ_MAX_JSLOTS) - lj_trace_err(J, LJ_TRERR_STACKOV); - } -#ifdef LUAJIT_ENABLE_CHECKHOOK - /* Regularly check for instruction/line hooks from compiled code and - ** exit to the interpreter if the hooks are set. - ** - ** This is a compile-time option and disabled by default, since the - ** hook checks may be quite expensive in tight loops. - ** - ** Note this is only useful if hooks are *not* set most of the time. - ** Use this only if you want to *asynchronously* interrupt the execution. - ** - ** You can set the instruction hook via lua_sethook() with a count of 1 - ** from a signal handler or another native thread. Please have a look - ** at the first few functions in luajit.c for an example (Ctrl-C handler). - */ - { - TRef tr = emitir(IRT(IR_XLOAD, IRT_U8), - lj_ir_kptr(J, &J2G(J)->hookmask), IRXLOAD_VOLATILE); - tr = emitir(IRTI(IR_BAND), tr, lj_ir_kint(J, (LUA_MASKLINE|LUA_MASKCOUNT))); - emitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, 0)); - } -#endif -} - -#undef IR -#undef emitir_raw -#undef emitir - -#endif diff --git a/subprojects/luajit/src/lj_record.h b/subprojects/luajit/src/lj_record.h deleted file mode 100644 index 2bbbde5be..000000000 --- a/subprojects/luajit/src/lj_record.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -** Trace recorder (bytecode -> SSA IR). -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_RECORD_H -#define _LJ_RECORD_H - -#include "lj_obj.h" -#include "lj_jit.h" - -#if LJ_HASJIT -/* Context for recording an indexed load/store. */ -typedef struct RecordIndex { - TValue tabv; /* Runtime value of table (or indexed object). */ - TValue keyv; /* Runtime value of key. */ - TValue valv; /* Runtime value of stored value. */ - TValue mobjv; /* Runtime value of metamethod object. */ - GCtab *mtv; /* Runtime value of metatable object. */ - cTValue *oldv; /* Runtime value of previously stored value. */ - TRef tab; /* Table (or indexed object) reference. */ - TRef key; /* Key reference. */ - TRef val; /* Value reference for a store or 0 for a load. */ - TRef mt; /* Metatable reference. */ - TRef mobj; /* Metamethod object reference. */ - int idxchain; /* Index indirections left or 0 for raw lookup. */ -} RecordIndex; - -LJ_FUNC int lj_record_objcmp(jit_State *J, TRef a, TRef b, - cTValue *av, cTValue *bv); -LJ_FUNC TRef lj_record_constify(jit_State *J, cTValue *o); - -LJ_FUNC void lj_record_call(jit_State *J, BCReg func, ptrdiff_t nargs); -LJ_FUNC void lj_record_tailcall(jit_State *J, BCReg func, ptrdiff_t nargs); -LJ_FUNC void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults); - -LJ_FUNC int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm); -LJ_FUNC TRef lj_record_idx(jit_State *J, RecordIndex *ix); - -LJ_FUNC void lj_record_ins(jit_State *J); -LJ_FUNC void lj_record_setup(jit_State *J); -#endif - -#endif diff --git a/subprojects/luajit/src/lj_snap.c b/subprojects/luajit/src/lj_snap.c deleted file mode 100644 index e891f7a9b..000000000 --- a/subprojects/luajit/src/lj_snap.c +++ /dev/null @@ -1,862 +0,0 @@ -/* -** Snapshot handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_snap_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_gc.h" -#include "lj_tab.h" -#include "lj_state.h" -#include "lj_frame.h" -#include "lj_bc.h" -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_iropt.h" -#include "lj_trace.h" -#include "lj_snap.h" -#include "lj_target.h" -#if LJ_HASFFI -#include "lj_ctype.h" -#include "lj_cdata.h" -#endif - -/* Pass IR on to next optimization in chain (FOLD). */ -#define emitir(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J)) - -/* Emit raw IR without passing through optimizations. */ -#define emitir_raw(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_ir_emit(J)) - -/* -- Snapshot buffer allocation ------------------------------------------ */ - -/* Grow snapshot buffer. */ -void lj_snap_grow_buf_(jit_State *J, MSize need) -{ - MSize maxsnap = (MSize)J->param[JIT_P_maxsnap]; - if (need > maxsnap) - lj_trace_err(J, LJ_TRERR_SNAPOV); - lj_mem_growvec(J->L, J->snapbuf, J->sizesnap, maxsnap, SnapShot); - J->cur.snap = J->snapbuf; -} - -/* Grow snapshot map buffer. */ -void lj_snap_grow_map_(jit_State *J, MSize need) -{ - if (need < 2*J->sizesnapmap) - need = 2*J->sizesnapmap; - else if (need < 64) - need = 64; - J->snapmapbuf = (SnapEntry *)lj_mem_realloc(J->L, J->snapmapbuf, - J->sizesnapmap*sizeof(SnapEntry), need*sizeof(SnapEntry)); - J->cur.snapmap = J->snapmapbuf; - J->sizesnapmap = need; -} - -/* -- Snapshot generation ------------------------------------------------- */ - -/* Add all modified slots to the snapshot. */ -static MSize snapshot_slots(jit_State *J, SnapEntry *map, BCReg nslots) -{ - IRRef retf = J->chain[IR_RETF]; /* Limits SLOAD restore elimination. */ - BCReg s; - MSize n = 0; - for (s = 0; s < nslots; s++) { - TRef tr = J->slot[s]; - IRRef ref = tref_ref(tr); - if (ref) { - SnapEntry sn = SNAP_TR(s, tr); - IRIns *ir = &J->cur.ir[ref]; - if (!(sn & (SNAP_CONT|SNAP_FRAME)) && - ir->o == IR_SLOAD && ir->op1 == s && ref > retf) { - /* No need to snapshot unmodified non-inherited slots. */ - if (!(ir->op2 & IRSLOAD_INHERIT)) - continue; - /* No need to restore readonly slots and unmodified non-parent slots. */ - if (!(LJ_DUALNUM && (ir->op2 & IRSLOAD_CONVERT)) && - (ir->op2 & (IRSLOAD_READONLY|IRSLOAD_PARENT)) != IRSLOAD_PARENT) - sn |= SNAP_NORESTORE; - } - if (LJ_SOFTFP && irt_isnum(ir->t)) - sn |= SNAP_SOFTFPNUM; - map[n++] = sn; - } - } - return n; -} - -/* Add frame links at the end of the snapshot. */ -static BCReg snapshot_framelinks(jit_State *J, SnapEntry *map) -{ - cTValue *frame = J->L->base - 1; - cTValue *lim = J->L->base - J->baseslot; - cTValue *ftop = frame + funcproto(frame_func(frame))->framesize; - MSize f = 0; - map[f++] = SNAP_MKPC(J->pc); /* The current PC is always the first entry. */ - while (frame > lim) { /* Backwards traversal of all frames above base. */ - if (frame_islua(frame)) { - map[f++] = SNAP_MKPC(frame_pc(frame)); - frame = frame_prevl(frame); - } else if (frame_iscont(frame)) { - map[f++] = SNAP_MKFTSZ(frame_ftsz(frame)); - map[f++] = SNAP_MKPC(frame_contpc(frame)); - frame = frame_prevd(frame); - } else { - lua_assert(!frame_isc(frame)); - map[f++] = SNAP_MKFTSZ(frame_ftsz(frame)); - frame = frame_prevd(frame); - continue; - } - if (frame + funcproto(frame_func(frame))->framesize > ftop) - ftop = frame + funcproto(frame_func(frame))->framesize; - } - lua_assert(f == (MSize)(1 + J->framedepth)); - return (BCReg)(ftop - lim); -} - -/* Take a snapshot of the current stack. */ -static void snapshot_stack(jit_State *J, SnapShot *snap, MSize nsnapmap) -{ - BCReg nslots = J->baseslot + J->maxslot; - MSize nent; - SnapEntry *p; - /* Conservative estimate. */ - lj_snap_grow_map(J, nsnapmap + nslots + (MSize)J->framedepth+1); - p = &J->cur.snapmap[nsnapmap]; - nent = snapshot_slots(J, p, nslots); - snap->topslot = (uint8_t)snapshot_framelinks(J, p + nent); - snap->mapofs = (uint16_t)nsnapmap; - snap->ref = (IRRef1)J->cur.nins; - snap->nent = (uint8_t)nent; - snap->nslots = (uint8_t)nslots; - snap->count = 0; - J->cur.nsnapmap = (uint16_t)(nsnapmap + nent + 1 + J->framedepth); -} - -/* Add or merge a snapshot. */ -void lj_snap_add(jit_State *J) -{ - MSize nsnap = J->cur.nsnap; - MSize nsnapmap = J->cur.nsnapmap; - /* Merge if no ins. inbetween or if requested and no guard inbetween. */ - if (J->mergesnap ? !irt_isguard(J->guardemit) : - (nsnap > 0 && J->cur.snap[nsnap-1].ref == J->cur.nins)) { - if (nsnap == 1) { /* But preserve snap #0 PC. */ - emitir_raw(IRT(IR_NOP, IRT_NIL), 0, 0); - goto nomerge; - } - nsnapmap = J->cur.snap[--nsnap].mapofs; - } else { - nomerge: - lj_snap_grow_buf(J, nsnap+1); - J->cur.nsnap = (uint16_t)(nsnap+1); - } - J->mergesnap = 0; - J->guardemit.irt = 0; - snapshot_stack(J, &J->cur.snap[nsnap], nsnapmap); -} - -/* -- Snapshot modification ----------------------------------------------- */ - -#define SNAP_USEDEF_SLOTS (LJ_MAX_JSLOTS+LJ_STACK_EXTRA) - -/* Find unused slots with reaching-definitions bytecode data-flow analysis. */ -static BCReg snap_usedef(jit_State *J, uint8_t *udf, - const BCIns *pc, BCReg maxslot) -{ - BCReg s; - GCobj *o; - - if (maxslot == 0) return 0; -#ifdef LUAJIT_USE_VALGRIND - /* Avoid errors for harmless reads beyond maxslot. */ - memset(udf, 1, SNAP_USEDEF_SLOTS); -#else - memset(udf, 1, maxslot); -#endif - - /* Treat open upvalues as used. */ - o = gcref(J->L->openupval); - while (o) { - if (uvval(gco2uv(o)) < J->L->base) break; - udf[uvval(gco2uv(o)) - J->L->base] = 0; - o = gcref(o->gch.nextgc); - } - -#define USE_SLOT(s) udf[(s)] &= ~1 -#define DEF_SLOT(s) udf[(s)] *= 3 - - /* Scan through following bytecode and check for uses/defs. */ - lua_assert(pc >= proto_bc(J->pt) && pc < proto_bc(J->pt) + J->pt->sizebc); - for (;;) { - BCIns ins = *pc++; - BCOp op = bc_op(ins); - switch (bcmode_b(op)) { - case BCMvar: USE_SLOT(bc_b(ins)); break; - default: break; - } - switch (bcmode_c(op)) { - case BCMvar: USE_SLOT(bc_c(ins)); break; - case BCMrbase: - lua_assert(op == BC_CAT); - for (s = bc_b(ins); s <= bc_c(ins); s++) USE_SLOT(s); - for (; s < maxslot; s++) DEF_SLOT(s); - break; - case BCMjump: - handle_jump: { - BCReg minslot = bc_a(ins); - if (op >= BC_FORI && op <= BC_JFORL) minslot += FORL_EXT; - else if (op >= BC_ITERL && op <= BC_JITERL) minslot += bc_b(pc[-2])-1; - else if (op == BC_UCLO) { pc += bc_j(ins); break; } - for (s = minslot; s < maxslot; s++) DEF_SLOT(s); - return minslot < maxslot ? minslot : maxslot; - } - case BCMlit: - if (op == BC_JFORL || op == BC_JITERL || op == BC_JLOOP) { - goto handle_jump; - } else if (bc_isret(op)) { - BCReg top = op == BC_RETM ? maxslot : (bc_a(ins) + bc_d(ins)-1); - for (s = 0; s < bc_a(ins); s++) DEF_SLOT(s); - for (; s < top; s++) USE_SLOT(s); - for (; s < maxslot; s++) DEF_SLOT(s); - return 0; - } - break; - case BCMfunc: return maxslot; /* NYI: will abort, anyway. */ - default: break; - } - switch (bcmode_a(op)) { - case BCMvar: USE_SLOT(bc_a(ins)); break; - case BCMdst: - if (!(op == BC_ISTC || op == BC_ISFC)) DEF_SLOT(bc_a(ins)); - break; - case BCMbase: - if (op >= BC_CALLM && op <= BC_VARG) { - BCReg top = (op == BC_CALLM || op == BC_CALLMT || bc_c(ins) == 0) ? - maxslot : (bc_a(ins) + bc_c(ins)); - s = bc_a(ins) - ((op == BC_ITERC || op == BC_ITERN) ? 3 : 0); - for (; s < top; s++) USE_SLOT(s); - for (; s < maxslot; s++) DEF_SLOT(s); - if (op == BC_CALLT || op == BC_CALLMT) { - for (s = 0; s < bc_a(ins); s++) DEF_SLOT(s); - return 0; - } - } else if (op == BC_KNIL) { - for (s = bc_a(ins); s <= bc_d(ins); s++) DEF_SLOT(s); - } else if (op == BC_TSETM) { - for (s = bc_a(ins)-1; s < maxslot; s++) USE_SLOT(s); - } - break; - default: break; - } - lua_assert(pc >= proto_bc(J->pt) && pc < proto_bc(J->pt) + J->pt->sizebc); - } - -#undef USE_SLOT -#undef DEF_SLOT - - return 0; /* unreachable */ -} - -/* Purge dead slots before the next snapshot. */ -void lj_snap_purge(jit_State *J) -{ - uint8_t udf[SNAP_USEDEF_SLOTS]; - BCReg maxslot = J->maxslot; - BCReg s = snap_usedef(J, udf, J->pc, maxslot); - for (; s < maxslot; s++) - if (udf[s] != 0) - J->base[s] = 0; /* Purge dead slots. */ -} - -/* Shrink last snapshot. */ -void lj_snap_shrink(jit_State *J) -{ - SnapShot *snap = &J->cur.snap[J->cur.nsnap-1]; - SnapEntry *map = &J->cur.snapmap[snap->mapofs]; - MSize n, m, nlim, nent = snap->nent; - uint8_t udf[SNAP_USEDEF_SLOTS]; - BCReg maxslot = J->maxslot; - BCReg minslot = snap_usedef(J, udf, snap_pc(map[nent]), maxslot); - BCReg baseslot = J->baseslot; - maxslot += baseslot; - minslot += baseslot; - snap->nslots = (uint8_t)maxslot; - for (n = m = 0; n < nent; n++) { /* Remove unused slots from snapshot. */ - BCReg s = snap_slot(map[n]); - if (s < minslot || (s < maxslot && udf[s-baseslot] == 0)) - map[m++] = map[n]; /* Only copy used slots. */ - } - snap->nent = (uint8_t)m; - nlim = J->cur.nsnapmap - snap->mapofs - 1; - while (n <= nlim) map[m++] = map[n++]; /* Move PC + frame links down. */ - J->cur.nsnapmap = (uint16_t)(snap->mapofs + m); /* Free up space in map. */ -} - -/* -- Snapshot access ----------------------------------------------------- */ - -/* Initialize a Bloom Filter with all renamed refs. -** There are very few renames (often none), so the filter has -** very few bits set. This makes it suitable for negative filtering. -*/ -static BloomFilter snap_renamefilter(GCtrace *T, SnapNo lim) -{ - BloomFilter rfilt = 0; - IRIns *ir; - for (ir = &T->ir[T->nins-1]; ir->o == IR_RENAME; ir--) - if (ir->op2 <= lim) - bloomset(rfilt, ir->op1); - return rfilt; -} - -/* Process matching renames to find the original RegSP. */ -static RegSP snap_renameref(GCtrace *T, SnapNo lim, IRRef ref, RegSP rs) -{ - IRIns *ir; - for (ir = &T->ir[T->nins-1]; ir->o == IR_RENAME; ir--) - if (ir->op1 == ref && ir->op2 <= lim) - rs = ir->prev; - return rs; -} - -/* Copy RegSP from parent snapshot to the parent links of the IR. */ -IRIns *lj_snap_regspmap(GCtrace *T, SnapNo snapno, IRIns *ir) -{ - SnapShot *snap = &T->snap[snapno]; - SnapEntry *map = &T->snapmap[snap->mapofs]; - BloomFilter rfilt = snap_renamefilter(T, snapno); - MSize n = 0; - IRRef ref = 0; - for ( ; ; ir++) { - uint32_t rs; - if (ir->o == IR_SLOAD) { - if (!(ir->op2 & IRSLOAD_PARENT)) break; - for ( ; ; n++) { - lua_assert(n < snap->nent); - if (snap_slot(map[n]) == ir->op1) { - ref = snap_ref(map[n++]); - break; - } - } - } else if (LJ_SOFTFP && ir->o == IR_HIOP) { - ref++; - } else if (ir->o == IR_PVAL) { - ref = ir->op1 + REF_BIAS; - } else { - break; - } - rs = T->ir[ref].prev; - if (bloomtest(rfilt, ref)) - rs = snap_renameref(T, snapno, ref, rs); - ir->prev = (uint16_t)rs; - lua_assert(regsp_used(rs)); - } - return ir; -} - -/* -- Snapshot replay ----------------------------------------------------- */ - -/* Replay constant from parent trace. */ -static TRef snap_replay_const(jit_State *J, IRIns *ir) -{ - /* Only have to deal with constants that can occur in stack slots. */ - switch ((IROp)ir->o) { - case IR_KPRI: return TREF_PRI(irt_type(ir->t)); - case IR_KINT: return lj_ir_kint(J, ir->i); - case IR_KGC: return lj_ir_kgc(J, ir_kgc(ir), irt_t(ir->t)); - case IR_KNUM: return lj_ir_k64(J, IR_KNUM, ir_knum(ir)); - case IR_KINT64: return lj_ir_k64(J, IR_KINT64, ir_kint64(ir)); - case IR_KPTR: return lj_ir_kptr(J, ir_kptr(ir)); /* Continuation. */ - default: lua_assert(0); return TREF_NIL; break; - } -} - -/* De-duplicate parent reference. */ -static TRef snap_dedup(jit_State *J, SnapEntry *map, MSize nmax, IRRef ref) -{ - MSize j; - for (j = 0; j < nmax; j++) - if (snap_ref(map[j]) == ref) - return J->slot[snap_slot(map[j])] & ~(SNAP_CONT|SNAP_FRAME); - return 0; -} - -/* Emit parent reference with de-duplication. */ -static TRef snap_pref(jit_State *J, GCtrace *T, SnapEntry *map, MSize nmax, - BloomFilter seen, IRRef ref) -{ - IRIns *ir = &T->ir[ref]; - TRef tr; - if (irref_isk(ref)) - tr = snap_replay_const(J, ir); - else if (!regsp_used(ir->prev)) - tr = 0; - else if (!bloomtest(seen, ref) || (tr = snap_dedup(J, map, nmax, ref)) == 0) - tr = emitir(IRT(IR_PVAL, irt_type(ir->t)), ref - REF_BIAS, 0); - return tr; -} - -/* Check whether a sunk store corresponds to an allocation. Slow path. */ -static int snap_sunk_store2(GCtrace *T, IRIns *ira, IRIns *irs) -{ - if (irs->o == IR_ASTORE || irs->o == IR_HSTORE || - irs->o == IR_FSTORE || irs->o == IR_XSTORE) { - IRIns *irk = &T->ir[irs->op1]; - if (irk->o == IR_AREF || irk->o == IR_HREFK) - irk = &T->ir[irk->op1]; - return (&T->ir[irk->op1] == ira); - } - return 0; -} - -/* Check whether a sunk store corresponds to an allocation. Fast path. */ -static LJ_AINLINE int snap_sunk_store(GCtrace *T, IRIns *ira, IRIns *irs) -{ - if (irs->s != 255) - return (ira + irs->s == irs); /* Fast check. */ - return snap_sunk_store2(T, ira, irs); -} - -/* Replay snapshot state to setup side trace. */ -void lj_snap_replay(jit_State *J, GCtrace *T) -{ - SnapShot *snap = &T->snap[J->exitno]; - SnapEntry *map = &T->snapmap[snap->mapofs]; - MSize n, nent = snap->nent; - BloomFilter seen = 0; - int pass23 = 0; - J->framedepth = 0; - /* Emit IR for slots inherited from parent snapshot. */ - for (n = 0; n < nent; n++) { - SnapEntry sn = map[n]; - BCReg s = snap_slot(sn); - IRRef ref = snap_ref(sn); - IRIns *ir = &T->ir[ref]; - TRef tr; - /* The bloom filter avoids O(nent^2) overhead for de-duping slots. */ - if (bloomtest(seen, ref) && (tr = snap_dedup(J, map, n, ref)) != 0) - goto setslot; - bloomset(seen, ref); - if (irref_isk(ref)) { - tr = snap_replay_const(J, ir); - } else if (!regsp_used(ir->prev)) { - pass23 = 1; - lua_assert(s != 0); - tr = s; - } else { - IRType t = irt_type(ir->t); - uint32_t mode = IRSLOAD_INHERIT|IRSLOAD_PARENT; - if (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM)) t = IRT_NUM; - if (ir->o == IR_SLOAD) mode |= (ir->op2 & IRSLOAD_READONLY); - tr = emitir_raw(IRT(IR_SLOAD, t), s, mode); - } - setslot: - J->slot[s] = tr | (sn&(SNAP_CONT|SNAP_FRAME)); /* Same as TREF_* flags. */ - J->framedepth += ((sn & (SNAP_CONT|SNAP_FRAME)) && s); - if ((sn & SNAP_FRAME)) - J->baseslot = s+1; - } - if (pass23) { - IRIns *irlast = &T->ir[snap->ref]; - pass23 = 0; - /* Emit dependent PVALs. */ - for (n = 0; n < nent; n++) { - SnapEntry sn = map[n]; - IRRef refp = snap_ref(sn); - IRIns *ir = &T->ir[refp]; - if (regsp_reg(ir->r) == RID_SUNK) { - if (J->slot[snap_slot(sn)] != snap_slot(sn)) continue; - pass23 = 1; - lua_assert(ir->o == IR_TNEW || ir->o == IR_TDUP || - ir->o == IR_CNEW || ir->o == IR_CNEWI); - if (ir->op1 >= T->nk) snap_pref(J, T, map, nent, seen, ir->op1); - if (ir->op2 >= T->nk) snap_pref(J, T, map, nent, seen, ir->op2); - if (LJ_HASFFI && ir->o == IR_CNEWI) { - if (LJ_32 && refp+1 < T->nins && (ir+1)->o == IR_HIOP) - snap_pref(J, T, map, nent, seen, (ir+1)->op2); - } else { - IRIns *irs; - for (irs = ir+1; irs < irlast; irs++) - if (irs->r == RID_SINK && snap_sunk_store(T, ir, irs)) { - if (snap_pref(J, T, map, nent, seen, irs->op2) == 0) - snap_pref(J, T, map, nent, seen, T->ir[irs->op2].op1); - else if ((LJ_SOFTFP || (LJ_32 && LJ_HASFFI)) && - irs+1 < irlast && (irs+1)->o == IR_HIOP) - snap_pref(J, T, map, nent, seen, (irs+1)->op2); - } - } - } else if (!irref_isk(refp) && !regsp_used(ir->prev)) { - lua_assert(ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT); - J->slot[snap_slot(sn)] = snap_pref(J, T, map, nent, seen, ir->op1); - } - } - /* Replay sunk instructions. */ - for (n = 0; pass23 && n < nent; n++) { - SnapEntry sn = map[n]; - IRRef refp = snap_ref(sn); - IRIns *ir = &T->ir[refp]; - if (regsp_reg(ir->r) == RID_SUNK) { - TRef op1, op2; - if (J->slot[snap_slot(sn)] != snap_slot(sn)) { /* De-dup allocs. */ - J->slot[snap_slot(sn)] = J->slot[J->slot[snap_slot(sn)]]; - continue; - } - op1 = ir->op1; - if (op1 >= T->nk) op1 = snap_pref(J, T, map, nent, seen, op1); - op2 = ir->op2; - if (op2 >= T->nk) op2 = snap_pref(J, T, map, nent, seen, op2); - if (LJ_HASFFI && ir->o == IR_CNEWI) { - if (LJ_32 && refp+1 < T->nins && (ir+1)->o == IR_HIOP) { - lj_needsplit(J); /* Emit joining HIOP. */ - op2 = emitir_raw(IRT(IR_HIOP, IRT_I64), op2, - snap_pref(J, T, map, nent, seen, (ir+1)->op2)); - } - J->slot[snap_slot(sn)] = emitir(ir->ot & ~(IRT_MARK|IRT_ISPHI), op1, op2); - } else { - IRIns *irs; - TRef tr = emitir(ir->ot, op1, op2); - J->slot[snap_slot(sn)] = tr; - for (irs = ir+1; irs < irlast; irs++) - if (irs->r == RID_SINK && snap_sunk_store(T, ir, irs)) { - IRIns *irr = &T->ir[irs->op1]; - TRef val, key = irr->op2, tmp = tr; - if (irr->o != IR_FREF) { - IRIns *irk = &T->ir[key]; - if (irr->o == IR_HREFK) - key = lj_ir_kslot(J, snap_replay_const(J, &T->ir[irk->op1]), - irk->op2); - else - key = snap_replay_const(J, irk); - if (irr->o == IR_HREFK || irr->o == IR_AREF) { - IRIns *irf = &T->ir[irr->op1]; - tmp = emitir(irf->ot, tmp, irf->op2); - } - } - tmp = emitir(irr->ot, tmp, key); - val = snap_pref(J, T, map, nent, seen, irs->op2); - if (val == 0) { - IRIns *irc = &T->ir[irs->op2]; - lua_assert(irc->o == IR_CONV && irc->op2 == IRCONV_NUM_INT); - val = snap_pref(J, T, map, nent, seen, irc->op1); - val = emitir(IRTN(IR_CONV), val, IRCONV_NUM_INT); - } else if ((LJ_SOFTFP || (LJ_32 && LJ_HASFFI)) && - irs+1 < irlast && (irs+1)->o == IR_HIOP) { - IRType t = IRT_I64; - if (LJ_SOFTFP && irt_type((irs+1)->t) == IRT_SOFTFP) - t = IRT_NUM; - lj_needsplit(J); - if (irref_isk(irs->op2) && irref_isk((irs+1)->op2)) { - uint64_t k = (uint32_t)T->ir[irs->op2].i + - ((uint64_t)T->ir[(irs+1)->op2].i << 32); - val = lj_ir_k64(J, t == IRT_I64 ? IR_KINT64 : IR_KNUM, - lj_ir_k64_find(J, k)); - } else { - val = emitir_raw(IRT(IR_HIOP, t), val, - snap_pref(J, T, map, nent, seen, (irs+1)->op2)); - } - tmp = emitir(IRT(irs->o, t), tmp, val); - continue; - } - tmp = emitir(irs->ot, tmp, val); - } else if (LJ_HASFFI && irs->o == IR_XBAR && ir->o == IR_CNEW) { - emitir(IRT(IR_XBAR, IRT_NIL), 0, 0); - } - } - } - } - } - J->base = J->slot + J->baseslot; - J->maxslot = snap->nslots - J->baseslot; - lj_snap_add(J); - if (pass23) /* Need explicit GC step _after_ initial snapshot. */ - emitir_raw(IRTG(IR_GCSTEP, IRT_NIL), 0, 0); -} - -/* -- Snapshot restore ---------------------------------------------------- */ - -static void snap_unsink(jit_State *J, GCtrace *T, ExitState *ex, - SnapNo snapno, BloomFilter rfilt, - IRIns *ir, TValue *o); - -/* Restore a value from the trace exit state. */ -static void snap_restoreval(jit_State *J, GCtrace *T, ExitState *ex, - SnapNo snapno, BloomFilter rfilt, - IRRef ref, TValue *o) -{ - IRIns *ir = &T->ir[ref]; - IRType1 t = ir->t; - RegSP rs = ir->prev; - if (irref_isk(ref)) { /* Restore constant slot. */ - lj_ir_kvalue(J->L, o, ir); - return; - } - if (LJ_UNLIKELY(bloomtest(rfilt, ref))) - rs = snap_renameref(T, snapno, ref, rs); - if (ra_hasspill(regsp_spill(rs))) { /* Restore from spill slot. */ - int32_t *sps = &ex->spill[regsp_spill(rs)]; - if (irt_isinteger(t)) { - setintV(o, *sps); -#if !LJ_SOFTFP - } else if (irt_isnum(t)) { - o->u64 = *(uint64_t *)sps; -#endif - } else if (LJ_64 && irt_islightud(t)) { - /* 64 bit lightuserdata which may escape already has the tag bits. */ - o->u64 = *(uint64_t *)sps; - } else { - lua_assert(!irt_ispri(t)); /* PRI refs never have a spill slot. */ - setgcrefi(o->gcr, *sps); - setitype(o, irt_toitype(t)); - } - } else { /* Restore from register. */ - Reg r = regsp_reg(rs); - if (ra_noreg(r)) { - lua_assert(ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT); - snap_restoreval(J, T, ex, snapno, rfilt, ir->op1, o); - if (LJ_DUALNUM) setnumV(o, (lua_Number)intV(o)); - return; - } else if (irt_isinteger(t)) { - setintV(o, (int32_t)ex->gpr[r-RID_MIN_GPR]); -#if !LJ_SOFTFP - } else if (irt_isnum(t)) { - setnumV(o, ex->fpr[r-RID_MIN_FPR]); -#endif - } else if (LJ_64 && irt_islightud(t)) { - /* 64 bit lightuserdata which may escape already has the tag bits. */ - o->u64 = ex->gpr[r-RID_MIN_GPR]; - } else { - if (!irt_ispri(t)) - setgcrefi(o->gcr, ex->gpr[r-RID_MIN_GPR]); - setitype(o, irt_toitype(t)); - } - } -} - -#if LJ_HASFFI -/* Restore raw data from the trace exit state. */ -static void snap_restoredata(GCtrace *T, ExitState *ex, - SnapNo snapno, BloomFilter rfilt, - IRRef ref, void *dst, CTSize sz) -{ - IRIns *ir = &T->ir[ref]; - RegSP rs = ir->prev; - int32_t *src; - uint64_t tmp; - if (irref_isk(ref)) { - if (ir->o == IR_KNUM || ir->o == IR_KINT64) { - src = mref(ir->ptr, int32_t); - } else if (sz == 8) { - tmp = (uint64_t)(uint32_t)ir->i; - src = (int32_t *)&tmp; - } else { - src = &ir->i; - } - } else { - if (LJ_UNLIKELY(bloomtest(rfilt, ref))) - rs = snap_renameref(T, snapno, ref, rs); - if (ra_hasspill(regsp_spill(rs))) { - src = &ex->spill[regsp_spill(rs)]; - if (sz == 8 && !irt_is64(ir->t)) { - tmp = (uint64_t)(uint32_t)*src; - src = (int32_t *)&tmp; - } - } else { - Reg r = regsp_reg(rs); - if (ra_noreg(r)) { - /* Note: this assumes CNEWI is never used for SOFTFP split numbers. */ - lua_assert(sz == 8 && ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT); - snap_restoredata(T, ex, snapno, rfilt, ir->op1, dst, 4); - *(lua_Number *)dst = (lua_Number)*(int32_t *)dst; - return; - } - src = (int32_t *)&ex->gpr[r-RID_MIN_GPR]; -#if !LJ_SOFTFP - if (r >= RID_MAX_GPR) { - src = (int32_t *)&ex->fpr[r-RID_MIN_FPR]; -#if LJ_TARGET_PPC - if (sz == 4) { /* PPC FPRs are always doubles. */ - *(float *)dst = (float)*(double *)src; - return; - } -#else - if (LJ_BE && sz == 4) src++; -#endif - } -#endif - } - } - lua_assert(sz == 1 || sz == 2 || sz == 4 || sz == 8); - if (sz == 4) *(int32_t *)dst = *src; - else if (sz == 8) *(int64_t *)dst = *(int64_t *)src; - else if (sz == 1) *(int8_t *)dst = (int8_t)*src; - else *(int16_t *)dst = (int16_t)*src; -} -#endif - -/* Unsink allocation from the trace exit state. Unsink sunk stores. */ -static void snap_unsink(jit_State *J, GCtrace *T, ExitState *ex, - SnapNo snapno, BloomFilter rfilt, - IRIns *ir, TValue *o) -{ - lua_assert(ir->o == IR_TNEW || ir->o == IR_TDUP || - ir->o == IR_CNEW || ir->o == IR_CNEWI); -#if LJ_HASFFI - if (ir->o == IR_CNEW || ir->o == IR_CNEWI) { - CTState *cts = ctype_cts(J->L); - CTypeID id = (CTypeID)T->ir[ir->op1].i; - CTSize sz = lj_ctype_size(cts, id); - GCcdata *cd = lj_cdata_new(cts, id, sz); - setcdataV(J->L, o, cd); - if (ir->o == IR_CNEWI) { - uint8_t *p = (uint8_t *)cdataptr(cd); - lua_assert(sz == 4 || sz == 8); - if (LJ_32 && sz == 8 && ir+1 < T->ir + T->nins && (ir+1)->o == IR_HIOP) { - snap_restoredata(T, ex, snapno, rfilt, (ir+1)->op2, LJ_LE?p+4:p, 4); - if (LJ_BE) p += 4; - sz = 4; - } - snap_restoredata(T, ex, snapno, rfilt, ir->op2, p, sz); - } else { - IRIns *irs, *irlast = &T->ir[T->snap[snapno].ref]; - for (irs = ir+1; irs < irlast; irs++) - if (irs->r == RID_SINK && snap_sunk_store(T, ir, irs)) { - IRIns *iro = &T->ir[T->ir[irs->op1].op2]; - uint8_t *p = (uint8_t *)cd; - CTSize szs; - lua_assert(irs->o == IR_XSTORE && T->ir[irs->op1].o == IR_ADD); - lua_assert(iro->o == IR_KINT || iro->o == IR_KINT64); - if (irt_is64(irs->t)) szs = 8; - else if (irt_isi8(irs->t) || irt_isu8(irs->t)) szs = 1; - else if (irt_isi16(irs->t) || irt_isu16(irs->t)) szs = 2; - else szs = 4; - if (LJ_64 && iro->o == IR_KINT64) - p += (int64_t)ir_k64(iro)->u64; - else - p += iro->i; - lua_assert(p >= (uint8_t *)cdataptr(cd) && - p + szs <= (uint8_t *)cdataptr(cd) + sz); - if (LJ_32 && irs+1 < T->ir + T->nins && (irs+1)->o == IR_HIOP) { - lua_assert(szs == 4); - snap_restoredata(T, ex, snapno, rfilt, (irs+1)->op2, LJ_LE?p+4:p,4); - if (LJ_BE) p += 4; - } - snap_restoredata(T, ex, snapno, rfilt, irs->op2, p, szs); - } - } - } else -#endif - { - IRIns *irs, *irlast; - GCtab *t = ir->o == IR_TNEW ? lj_tab_new(J->L, ir->op1, ir->op2) : - lj_tab_dup(J->L, ir_ktab(&T->ir[ir->op1])); - settabV(J->L, o, t); - irlast = &T->ir[T->snap[snapno].ref]; - for (irs = ir+1; irs < irlast; irs++) - if (irs->r == RID_SINK && snap_sunk_store(T, ir, irs)) { - IRIns *irk = &T->ir[irs->op1]; - TValue tmp, *val; - lua_assert(irs->o == IR_ASTORE || irs->o == IR_HSTORE || - irs->o == IR_FSTORE); - if (irk->o == IR_FREF) { - lua_assert(irk->op2 == IRFL_TAB_META); - snap_restoreval(J, T, ex, snapno, rfilt, irs->op2, &tmp); - /* NOBARRIER: The table is new (marked white). */ - setgcref(t->metatable, obj2gco(tabV(&tmp))); - } else { - irk = &T->ir[irk->op2]; - if (irk->o == IR_KSLOT) irk = &T->ir[irk->op1]; - lj_ir_kvalue(J->L, &tmp, irk); - val = lj_tab_set(J->L, t, &tmp); - /* NOBARRIER: The table is new (marked white). */ - snap_restoreval(J, T, ex, snapno, rfilt, irs->op2, val); - if (LJ_SOFTFP && irs+1 < T->ir + T->nins && (irs+1)->o == IR_HIOP) { - snap_restoreval(J, T, ex, snapno, rfilt, (irs+1)->op2, &tmp); - val->u32.hi = tmp.u32.lo; - } - } - } - } -} - -/* Restore interpreter state from exit state with the help of a snapshot. */ -const BCIns *lj_snap_restore(jit_State *J, void *exptr) -{ - ExitState *ex = (ExitState *)exptr; - SnapNo snapno = J->exitno; /* For now, snapno == exitno. */ - GCtrace *T = traceref(J, J->parent); - SnapShot *snap = &T->snap[snapno]; - MSize n, nent = snap->nent; - SnapEntry *map = &T->snapmap[snap->mapofs]; - SnapEntry *flinks = &T->snapmap[snap_nextofs(T, snap)-1]; - int32_t ftsz0; - TValue *frame; - BloomFilter rfilt = snap_renamefilter(T, snapno); - const BCIns *pc = snap_pc(map[nent]); - lua_State *L = J->L; - - /* Set interpreter PC to the next PC to get correct error messages. */ - setcframe_pc(cframe_raw(L->cframe), pc+1); - - /* Make sure the stack is big enough for the slots from the snapshot. */ - if (LJ_UNLIKELY(L->base + snap->topslot >= tvref(L->maxstack))) { - L->top = curr_topL(L); - lj_state_growstack(L, snap->topslot - curr_proto(L)->framesize); - } - - /* Fill stack slots with data from the registers and spill slots. */ - frame = L->base-1; - ftsz0 = frame_ftsz(frame); /* Preserve link to previous frame in slot #0. */ - for (n = 0; n < nent; n++) { - SnapEntry sn = map[n]; - if (!(sn & SNAP_NORESTORE)) { - TValue *o = &frame[snap_slot(sn)]; - IRRef ref = snap_ref(sn); - IRIns *ir = &T->ir[ref]; - if (ir->r == RID_SUNK) { - MSize j; - for (j = 0; j < n; j++) - if (snap_ref(map[j]) == ref) { /* De-duplicate sunk allocations. */ - copyTV(L, o, &frame[snap_slot(map[j])]); - goto dupslot; - } - snap_unsink(J, T, ex, snapno, rfilt, ir, o); - dupslot: - continue; - } - snap_restoreval(J, T, ex, snapno, rfilt, ref, o); - if (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM) && tvisint(o)) { - TValue tmp; - snap_restoreval(J, T, ex, snapno, rfilt, ref+1, &tmp); - o->u32.hi = tmp.u32.lo; - } else if ((sn & (SNAP_CONT|SNAP_FRAME))) { - /* Overwrite tag with frame link. */ - o->fr.tp.ftsz = snap_slot(sn) != 0 ? (int32_t)*flinks-- : ftsz0; - L->base = o+1; - } - } - } - lua_assert(map + nent == flinks); - - /* Compute current stack top. */ - switch (bc_op(*pc)) { - default: - if (bc_op(*pc) < BC_FUNCF) { - L->top = curr_topL(L); - break; - } - /* fallthrough */ - case BC_CALLM: case BC_CALLMT: case BC_RETM: case BC_TSETM: - L->top = frame + snap->nslots; - break; - } - return pc; -} - -#undef emitir_raw -#undef emitir - -#endif diff --git a/subprojects/luajit/src/lj_snap.h b/subprojects/luajit/src/lj_snap.h deleted file mode 100644 index 2c9ae3d64..000000000 --- a/subprojects/luajit/src/lj_snap.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -** Snapshot handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_SNAP_H -#define _LJ_SNAP_H - -#include "lj_obj.h" -#include "lj_jit.h" - -#if LJ_HASJIT -LJ_FUNC void lj_snap_add(jit_State *J); -LJ_FUNC void lj_snap_purge(jit_State *J); -LJ_FUNC void lj_snap_shrink(jit_State *J); -LJ_FUNC IRIns *lj_snap_regspmap(GCtrace *T, SnapNo snapno, IRIns *ir); -LJ_FUNC void lj_snap_replay(jit_State *J, GCtrace *T); -LJ_FUNC const BCIns *lj_snap_restore(jit_State *J, void *exptr); -LJ_FUNC void lj_snap_grow_buf_(jit_State *J, MSize need); -LJ_FUNC void lj_snap_grow_map_(jit_State *J, MSize need); - -static LJ_AINLINE void lj_snap_grow_buf(jit_State *J, MSize need) -{ - if (LJ_UNLIKELY(need > J->sizesnap)) lj_snap_grow_buf_(J, need); -} - -static LJ_AINLINE void lj_snap_grow_map(jit_State *J, MSize need) -{ - if (LJ_UNLIKELY(need > J->sizesnapmap)) lj_snap_grow_map_(J, need); -} - -#endif - -#endif diff --git a/subprojects/luajit/src/lj_state.c b/subprojects/luajit/src/lj_state.c deleted file mode 100644 index f89135198..000000000 --- a/subprojects/luajit/src/lj_state.c +++ /dev/null @@ -1,287 +0,0 @@ -/* -** State and stack handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#define lj_state_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_func.h" -#include "lj_meta.h" -#include "lj_state.h" -#include "lj_frame.h" -#if LJ_HASFFI -#include "lj_ctype.h" -#endif -#include "lj_trace.h" -#include "lj_dispatch.h" -#include "lj_vm.h" -#include "lj_lex.h" -#include "lj_alloc.h" - -/* -- Stack handling ------------------------------------------------------ */ - -/* Stack sizes. */ -#define LJ_STACK_MIN LUA_MINSTACK /* Min. stack size. */ -#define LJ_STACK_MAX LUAI_MAXSTACK /* Max. stack size. */ -#define LJ_STACK_START (2*LJ_STACK_MIN) /* Starting stack size. */ -#define LJ_STACK_MAXEX (LJ_STACK_MAX + 1 + LJ_STACK_EXTRA) - -/* Explanation of LJ_STACK_EXTRA: -** -** Calls to metamethods store their arguments beyond the current top -** without checking for the stack limit. This avoids stack resizes which -** would invalidate passed TValue pointers. The stack check is performed -** later by the function header. This can safely resize the stack or raise -** an error. Thus we need some extra slots beyond the current stack limit. -** -** Most metamethods need 4 slots above top (cont, mobj, arg1, arg2) plus -** one extra slot if mobj is not a function. Only lj_meta_tset needs 5 -** slots above top, but then mobj is always a function. So we can get by -** with 5 extra slots. -*/ - -/* Resize stack slots and adjust pointers in state. */ -static void resizestack(lua_State *L, MSize n) -{ - TValue *st, *oldst = tvref(L->stack); - ptrdiff_t delta; - MSize oldsize = L->stacksize; - MSize realsize = n + 1 + LJ_STACK_EXTRA; - GCobj *up; - lua_assert((MSize)(tvref(L->maxstack)-oldst)==L->stacksize-LJ_STACK_EXTRA-1); - st = (TValue *)lj_mem_realloc(L, tvref(L->stack), - (MSize)(L->stacksize*sizeof(TValue)), - (MSize)(realsize*sizeof(TValue))); - setmref(L->stack, st); - delta = (char *)st - (char *)oldst; - setmref(L->maxstack, st + n); - while (oldsize < realsize) /* Clear new slots. */ - setnilV(st + oldsize++); - L->stacksize = realsize; - L->base = (TValue *)((char *)L->base + delta); - L->top = (TValue *)((char *)L->top + delta); - for (up = gcref(L->openupval); up != NULL; up = gcnext(up)) - setmref(gco2uv(up)->v, (TValue *)((char *)uvval(gco2uv(up)) + delta)); - if (obj2gco(L) == gcref(G(L)->jit_L)) - setmref(G(L)->jit_base, mref(G(L)->jit_base, char) + delta); -} - -/* Relimit stack after error, in case the limit was overdrawn. */ -void lj_state_relimitstack(lua_State *L) -{ - if (L->stacksize > LJ_STACK_MAXEX && L->top-tvref(L->stack) < LJ_STACK_MAX-1) - resizestack(L, LJ_STACK_MAX); -} - -/* Try to shrink the stack (called from GC). */ -void lj_state_shrinkstack(lua_State *L, MSize used) -{ - if (L->stacksize > LJ_STACK_MAXEX) - return; /* Avoid stack shrinking while handling stack overflow. */ - if (4*used < L->stacksize && - 2*(LJ_STACK_START+LJ_STACK_EXTRA) < L->stacksize && - obj2gco(L) != gcref(G(L)->jit_L)) /* Don't shrink stack of live trace. */ - resizestack(L, L->stacksize >> 1); -} - -/* Try to grow stack. */ -void LJ_FASTCALL lj_state_growstack(lua_State *L, MSize need) -{ - MSize n; - if (L->stacksize > LJ_STACK_MAXEX) /* Overflow while handling overflow? */ - lj_err_throw(L, LUA_ERRERR); - n = L->stacksize + need; - if (n > LJ_STACK_MAX) { - n += 2*LUA_MINSTACK; - } else if (n < 2*L->stacksize) { - n = 2*L->stacksize; - if (n >= LJ_STACK_MAX) - n = LJ_STACK_MAX; - } - resizestack(L, n); - if (L->stacksize > LJ_STACK_MAXEX) - lj_err_msg(L, LJ_ERR_STKOV); -} - -void LJ_FASTCALL lj_state_growstack1(lua_State *L) -{ - lj_state_growstack(L, 1); -} - -/* Allocate basic stack for new state. */ -static void stack_init(lua_State *L1, lua_State *L) -{ - TValue *stend, *st = lj_mem_newvec(L, LJ_STACK_START+LJ_STACK_EXTRA, TValue); - setmref(L1->stack, st); - L1->stacksize = LJ_STACK_START + LJ_STACK_EXTRA; - stend = st + L1->stacksize; - setmref(L1->maxstack, stend - LJ_STACK_EXTRA - 1); - L1->base = L1->top = st+1; - setthreadV(L1, st, L1); /* Needed for curr_funcisL() on empty stack. */ - while (st < stend) /* Clear new slots. */ - setnilV(st++); -} - -/* -- State handling ------------------------------------------------------ */ - -/* Open parts that may cause memory-allocation errors. */ -static TValue *cpluaopen(lua_State *L, lua_CFunction dummy, void *ud) -{ - global_State *g = G(L); - UNUSED(dummy); - UNUSED(ud); - stack_init(L, L); - /* NOBARRIER: State initialization, all objects are white. */ - setgcref(L->env, obj2gco(lj_tab_new(L, 0, LJ_MIN_GLOBAL))); - settabV(L, registry(L), lj_tab_new(L, 0, LJ_MIN_REGISTRY)); - lj_str_resize(L, LJ_MIN_STRTAB-1); - lj_meta_init(L); - lj_lex_init(L); - fixstring(lj_err_str(L, LJ_ERR_ERRMEM)); /* Preallocate memory error msg. */ - g->gc.threshold = 4*g->gc.total; - lj_trace_initstate(g); - return NULL; -} - -static void close_state(lua_State *L) -{ - global_State *g = G(L); - lj_func_closeuv(L, tvref(L->stack)); - lj_gc_freeall(g); - lua_assert(gcref(g->gc.root) == obj2gco(L)); - lua_assert(g->strnum == 0); - lj_trace_freestate(g); -#if LJ_HASFFI - lj_ctype_freestate(g); -#endif - lj_mem_freevec(g, g->strhash, g->strmask+1, GCRef); - lj_str_freebuf(g, &g->tmpbuf); - lj_mem_freevec(g, tvref(L->stack), L->stacksize, TValue); - lua_assert(g->gc.total == sizeof(GG_State)); -#ifndef LUAJIT_USE_SYSMALLOC - if (g->allocf == lj_alloc_f) - lj_alloc_destroy(g->allocd); - else -#endif - g->allocf(g->allocd, G2GG(g), sizeof(GG_State), 0); -} - -#if LJ_64 && !(defined(LUAJIT_USE_VALGRIND) && defined(LUAJIT_USE_SYSMALLOC)) -lua_State *lj_state_newstate(lua_Alloc f, void *ud) -#else -LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud) -#endif -{ - GG_State *GG = (GG_State *)f(ud, NULL, 0, sizeof(GG_State)); - lua_State *L = &GG->L; - global_State *g = &GG->g; - if (GG == NULL || !checkptr32(GG)) return NULL; - memset(GG, 0, sizeof(GG_State)); - L->gct = ~LJ_TTHREAD; - L->marked = LJ_GC_WHITE0 | LJ_GC_FIXED | LJ_GC_SFIXED; /* Prevent free. */ - L->dummy_ffid = FF_C; - setmref(L->glref, g); - g->gc.currentwhite = LJ_GC_WHITE0 | LJ_GC_FIXED; - g->strempty.marked = LJ_GC_WHITE0; - g->strempty.gct = ~LJ_TSTR; - g->allocf = f; - g->allocd = ud; - setgcref(g->mainthref, obj2gco(L)); - setgcref(g->uvhead.prev, obj2gco(&g->uvhead)); - setgcref(g->uvhead.next, obj2gco(&g->uvhead)); - g->strmask = ~(MSize)0; - setnilV(registry(L)); - setnilV(&g->nilnode.val); - setnilV(&g->nilnode.key); - setmref(g->nilnode.freetop, &g->nilnode); - lj_str_initbuf(&g->tmpbuf); - g->gc.state = GCSpause; - setgcref(g->gc.root, obj2gco(L)); - setmref(g->gc.sweep, &g->gc.root); - g->gc.total = sizeof(GG_State); - g->gc.pause = LUAI_GCPAUSE; - g->gc.stepmul = LUAI_GCMUL; - lj_dispatch_init((GG_State *)L); - L->status = LUA_ERRERR+1; /* Avoid touching the stack upon memory error. */ - if (lj_vm_cpcall(L, NULL, NULL, cpluaopen) != 0) { - /* Memory allocation error: free partial state. */ - close_state(L); - return NULL; - } - L->status = 0; - return L; -} - -static TValue *cpfinalize(lua_State *L, lua_CFunction dummy, void *ud) -{ - UNUSED(dummy); - UNUSED(ud); - lj_gc_finalize_cdata(L); - lj_gc_finalize_udata(L); - /* Frame pop omitted. */ - return NULL; -} - -LUA_API void lua_close(lua_State *L) -{ - global_State *g = G(L); - int i; - L = mainthread(g); /* Only the main thread can be closed. */ - lj_func_closeuv(L, tvref(L->stack)); - lj_gc_separateudata(g, 1); /* Separate udata which have GC metamethods. */ -#if LJ_HASJIT - G2J(g)->flags &= ~JIT_F_ON; - G2J(g)->state = LJ_TRACE_IDLE; - lj_dispatch_update(g); -#endif - for (i = 0;;) { - hook_enter(g); - L->status = 0; - L->cframe = NULL; - L->base = L->top = tvref(L->stack) + 1; - if (lj_vm_cpcall(L, NULL, NULL, cpfinalize) == 0) { - if (++i >= 10) break; - lj_gc_separateudata(g, 1); /* Separate udata again. */ - if (gcref(g->gc.mmudata) == NULL) /* Until nothing is left to do. */ - break; - } - } - close_state(L); -} - -lua_State *lj_state_new(lua_State *L) -{ - lua_State *L1 = lj_mem_newobj(L, lua_State); - L1->gct = ~LJ_TTHREAD; - L1->dummy_ffid = FF_C; - L1->status = 0; - L1->stacksize = 0; - setmref(L1->stack, NULL); - L1->cframe = NULL; - /* NOBARRIER: The lua_State is new (marked white). */ - setgcrefnull(L1->openupval); - setmrefr(L1->glref, L->glref); - setgcrefr(L1->env, L->env); - stack_init(L1, L); /* init stack */ - lua_assert(iswhite(obj2gco(L1))); - return L1; -} - -void LJ_FASTCALL lj_state_free(global_State *g, lua_State *L) -{ - lua_assert(L != mainthread(g)); - lj_func_closeuv(L, tvref(L->stack)); - lua_assert(gcref(L->openupval) == NULL); - lj_mem_freevec(g, tvref(L->stack), L->stacksize, TValue); - lj_mem_freet(g, L); -} - diff --git a/subprojects/luajit/src/lj_state.h b/subprojects/luajit/src/lj_state.h deleted file mode 100644 index d5b476b2f..000000000 --- a/subprojects/luajit/src/lj_state.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -** State and stack handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_STATE_H -#define _LJ_STATE_H - -#include "lj_obj.h" - -#define incr_top(L) \ - (++L->top >= tvref(L->maxstack) && (lj_state_growstack1(L), 0)) - -#define savestack(L, p) ((char *)(p) - mref(L->stack, char)) -#define restorestack(L, n) ((TValue *)(mref(L->stack, char) + (n))) - -LJ_FUNC void lj_state_relimitstack(lua_State *L); -LJ_FUNC void lj_state_shrinkstack(lua_State *L, MSize used); -LJ_FUNCA void LJ_FASTCALL lj_state_growstack(lua_State *L, MSize need); -LJ_FUNC void LJ_FASTCALL lj_state_growstack1(lua_State *L); - -static LJ_AINLINE void lj_state_checkstack(lua_State *L, MSize need) -{ - if ((mref(L->maxstack, char) - (char *)L->top) <= - (ptrdiff_t)need*(ptrdiff_t)sizeof(TValue)) - lj_state_growstack(L, need); -} - -LJ_FUNC lua_State *lj_state_new(lua_State *L); -LJ_FUNC void LJ_FASTCALL lj_state_free(global_State *g, lua_State *L); -#if LJ_64 -LJ_FUNC lua_State *lj_state_newstate(lua_Alloc f, void *ud); -#endif - -#endif diff --git a/subprojects/luajit/src/lj_str.c b/subprojects/luajit/src/lj_str.c deleted file mode 100644 index aae6ec5b5..000000000 --- a/subprojects/luajit/src/lj_str.c +++ /dev/null @@ -1,339 +0,0 @@ -/* -** String handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#include - -#define lj_str_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_str.h" -#include "lj_state.h" -#include "lj_char.h" - -/* -- String interning ---------------------------------------------------- */ - -/* Ordered compare of strings. Assumes string data is 4-byte aligned. */ -int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b) -{ - MSize i, n = a->len > b->len ? b->len : a->len; - for (i = 0; i < n; i += 4) { - /* Note: innocuous access up to end of string + 3. */ - uint32_t va = *(const uint32_t *)(strdata(a)+i); - uint32_t vb = *(const uint32_t *)(strdata(b)+i); - if (va != vb) { -#if LJ_LE - va = lj_bswap(va); vb = lj_bswap(vb); -#endif - i -= n; - if ((int32_t)i >= -3) { - va >>= 32+(i<<3); vb >>= 32+(i<<3); - if (va == vb) break; - } - return va < vb ? -1 : 1; - } - } - return (int32_t)(a->len - b->len); -} - -/* Fast string data comparison. Caveat: unaligned access to 1st string! */ -static LJ_AINLINE int str_fastcmp(const char *a, const char *b, MSize len) -{ - MSize i = 0; - lua_assert(len > 0); - lua_assert((((uintptr_t)a+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4); - do { /* Note: innocuous access up to end of string + 3. */ - uint32_t v = lj_getu32(a+i) ^ *(const uint32_t *)(b+i); - if (v) { - i -= len; -#if LJ_LE - return (int32_t)i >= -3 ? (v << (32+(i<<3))) : 1; -#else - return (int32_t)i >= -3 ? (v >> (32+(i<<3))) : 1; -#endif - } - i += 4; - } while (i < len); - return 0; -} - -/* Resize the string hash table (grow and shrink). */ -void lj_str_resize(lua_State *L, MSize newmask) -{ - global_State *g = G(L); - GCRef *newhash; - MSize i; - if (g->gc.state == GCSsweepstring || newmask >= LJ_MAX_STRTAB-1) - return; /* No resizing during GC traversal or if already too big. */ - newhash = lj_mem_newvec(L, newmask+1, GCRef); - memset(newhash, 0, (newmask+1)*sizeof(GCRef)); - for (i = g->strmask; i != ~(MSize)0; i--) { /* Rehash old table. */ - GCobj *p = gcref(g->strhash[i]); - while (p) { /* Follow each hash chain and reinsert all strings. */ - MSize h = gco2str(p)->hash & newmask; - GCobj *next = gcnext(p); - /* NOBARRIER: The string table is a GC root. */ - setgcrefr(p->gch.nextgc, newhash[h]); - setgcref(newhash[h], p); - p = next; - } - } - lj_mem_freevec(g, g->strhash, g->strmask+1, GCRef); - g->strmask = newmask; - g->strhash = newhash; -} - -/* Intern a string and return string object. */ -GCstr *lj_str_new(lua_State *L, const char *str, size_t lenx) -{ - global_State *g; - GCstr *s; - GCobj *o; - MSize len = (MSize)lenx; - MSize a, b, h = len; - if (lenx >= LJ_MAX_STR) - lj_err_msg(L, LJ_ERR_STROV); - g = G(L); - /* Compute string hash. Constants taken from lookup3 hash by Bob Jenkins. */ - if (len >= 4) { /* Caveat: unaligned access! */ - a = lj_getu32(str); - h ^= lj_getu32(str+len-4); - b = lj_getu32(str+(len>>1)-2); - h ^= b; h -= lj_rol(b, 14); - b += lj_getu32(str+(len>>2)-1); - } else if (len > 0) { - a = *(const uint8_t *)str; - h ^= *(const uint8_t *)(str+len-1); - b = *(const uint8_t *)(str+(len>>1)); - h ^= b; h -= lj_rol(b, 14); - } else { - return &g->strempty; - } - a ^= h; a -= lj_rol(h, 11); - b ^= a; b -= lj_rol(a, 25); - h ^= b; h -= lj_rol(b, 16); - /* Check if the string has already been interned. */ - o = gcref(g->strhash[h & g->strmask]); - if (LJ_LIKELY((((uintptr_t)str+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4)) { - while (o != NULL) { - GCstr *sx = gco2str(o); - if (sx->len == len && str_fastcmp(str, strdata(sx), len) == 0) { - /* Resurrect if dead. Can only happen with fixstring() (keywords). */ - if (isdead(g, o)) flipwhite(o); - return sx; /* Return existing string. */ - } - o = gcnext(o); - } - } else { /* Slow path: end of string is too close to a page boundary. */ - while (o != NULL) { - GCstr *sx = gco2str(o); - if (sx->len == len && memcmp(str, strdata(sx), len) == 0) { - /* Resurrect if dead. Can only happen with fixstring() (keywords). */ - if (isdead(g, o)) flipwhite(o); - return sx; /* Return existing string. */ - } - o = gcnext(o); - } - } - /* Nope, create a new string. */ - s = lj_mem_newt(L, sizeof(GCstr)+len+1, GCstr); - newwhite(g, s); - s->gct = ~LJ_TSTR; - s->len = len; - s->hash = h; - s->reserved = 0; - memcpy(strdatawr(s), str, len); - strdatawr(s)[len] = '\0'; /* Zero-terminate string. */ - /* Add it to string hash table. */ - h &= g->strmask; - s->nextgc = g->strhash[h]; - /* NOBARRIER: The string table is a GC root. */ - setgcref(g->strhash[h], obj2gco(s)); - if (g->strnum++ > g->strmask) /* Allow a 100% load factor. */ - lj_str_resize(L, (g->strmask<<1)+1); /* Grow string table. */ - return s; /* Return newly interned string. */ -} - -void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s) -{ - g->strnum--; - lj_mem_free(g, s, sizestring(s)); -} - -/* -- Type conversions ---------------------------------------------------- */ - -/* Print number to buffer. Canonicalizes non-finite values. */ -size_t LJ_FASTCALL lj_str_bufnum(char *s, cTValue *o) -{ - if (LJ_LIKELY((o->u32.hi << 1) < 0xffe00000)) { /* Finite? */ - lua_Number n = o->n; -#if __BIONIC__ - if (tvismzero(o)) { s[0] = '-'; s[1] = '0'; return 2; } -#endif - return (size_t)lua_number2str(s, n); - } else if (((o->u32.hi & 0x000fffff) | o->u32.lo) != 0) { - s[0] = 'n'; s[1] = 'a'; s[2] = 'n'; return 3; - } else if ((o->u32.hi & 0x80000000) == 0) { - s[0] = 'i'; s[1] = 'n'; s[2] = 'f'; return 3; - } else { - s[0] = '-'; s[1] = 'i'; s[2] = 'n'; s[3] = 'f'; return 4; - } -} - -/* Print integer to buffer. Returns pointer to start. */ -char * LJ_FASTCALL lj_str_bufint(char *p, int32_t k) -{ - uint32_t u = (uint32_t)(k < 0 ? -k : k); - p += 1+10; - do { *--p = (char)('0' + u % 10); } while (u /= 10); - if (k < 0) *--p = '-'; - return p; -} - -/* Convert number to string. */ -GCstr * LJ_FASTCALL lj_str_fromnum(lua_State *L, const lua_Number *np) -{ - char buf[LJ_STR_NUMBUF]; - size_t len = lj_str_bufnum(buf, (TValue *)np); - return lj_str_new(L, buf, len); -} - -/* Convert integer to string. */ -GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k) -{ - char s[1+10]; - char *p = lj_str_bufint(s, k); - return lj_str_new(L, p, (size_t)(s+sizeof(s)-p)); -} - -GCstr * LJ_FASTCALL lj_str_fromnumber(lua_State *L, cTValue *o) -{ - return tvisint(o) ? lj_str_fromint(L, intV(o)) : lj_str_fromnum(L, &o->n); -} - -/* -- String formatting --------------------------------------------------- */ - -static void addstr(lua_State *L, SBuf *sb, const char *str, MSize len) -{ - char *p; - MSize i; - if (sb->n + len > sb->sz) { - MSize sz = sb->sz * 2; - while (sb->n + len > sz) sz = sz * 2; - lj_str_resizebuf(L, sb, sz); - } - p = sb->buf + sb->n; - sb->n += len; - for (i = 0; i < len; i++) p[i] = str[i]; -} - -static void addchar(lua_State *L, SBuf *sb, int c) -{ - if (sb->n + 1 > sb->sz) { - MSize sz = sb->sz * 2; - lj_str_resizebuf(L, sb, sz); - } - sb->buf[sb->n++] = (char)c; -} - -/* Push formatted message as a string object to Lua stack. va_list variant. */ -const char *lj_str_pushvf(lua_State *L, const char *fmt, va_list argp) -{ - SBuf *sb = &G(L)->tmpbuf; - lj_str_needbuf(L, sb, (MSize)strlen(fmt)); - lj_str_resetbuf(sb); - for (;;) { - const char *e = strchr(fmt, '%'); - if (e == NULL) break; - addstr(L, sb, fmt, (MSize)(e-fmt)); - /* This function only handles %s, %c, %d, %f and %p formats. */ - switch (e[1]) { - case 's': { - const char *s = va_arg(argp, char *); - if (s == NULL) s = "(null)"; - addstr(L, sb, s, (MSize)strlen(s)); - break; - } - case 'c': - addchar(L, sb, va_arg(argp, int)); - break; - case 'd': { - char buf[LJ_STR_INTBUF]; - char *p = lj_str_bufint(buf, va_arg(argp, int32_t)); - addstr(L, sb, p, (MSize)(buf+LJ_STR_INTBUF-p)); - break; - } - case 'f': { - char buf[LJ_STR_NUMBUF]; - TValue tv; - MSize len; - tv.n = (lua_Number)(va_arg(argp, LUAI_UACNUMBER)); - len = (MSize)lj_str_bufnum(buf, &tv); - addstr(L, sb, buf, len); - break; - } - case 'p': { -#define FMTP_CHARS (2*sizeof(ptrdiff_t)) - char buf[2+FMTP_CHARS]; - ptrdiff_t p = (ptrdiff_t)(va_arg(argp, void *)); - ptrdiff_t i, lasti = 2+FMTP_CHARS; - if (p == 0) { - addstr(L, sb, "NULL", 4); - break; - } -#if LJ_64 - /* Shorten output for 64 bit pointers. */ - lasti = 2+2*4+((p >> 32) ? 2+2*(lj_fls((uint32_t)(p >> 32))>>3) : 0); -#endif - buf[0] = '0'; - buf[1] = 'x'; - for (i = lasti-1; i >= 2; i--, p >>= 4) - buf[i] = "0123456789abcdef"[(p & 15)]; - addstr(L, sb, buf, (MSize)lasti); - break; - } - case '%': - addchar(L, sb, '%'); - break; - default: - addchar(L, sb, '%'); - addchar(L, sb, e[1]); - break; - } - fmt = e+2; - } - addstr(L, sb, fmt, (MSize)strlen(fmt)); - setstrV(L, L->top, lj_str_new(L, sb->buf, sb->n)); - incr_top(L); - return strVdata(L->top - 1); -} - -/* Push formatted message as a string object to Lua stack. Vararg variant. */ -const char *lj_str_pushf(lua_State *L, const char *fmt, ...) -{ - const char *msg; - va_list argp; - va_start(argp, fmt); - msg = lj_str_pushvf(L, fmt, argp); - va_end(argp); - return msg; -} - -/* -- Buffer handling ----------------------------------------------------- */ - -char *lj_str_needbuf(lua_State *L, SBuf *sb, MSize sz) -{ - if (sz > sb->sz) { - if (sz < LJ_MIN_SBUF) sz = LJ_MIN_SBUF; - lj_str_resizebuf(L, sb, sz); - } - return sb->buf; -} - diff --git a/subprojects/luajit/src/lj_str.h b/subprojects/luajit/src/lj_str.h deleted file mode 100644 index be04a975d..000000000 --- a/subprojects/luajit/src/lj_str.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -** String handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_STR_H -#define _LJ_STR_H - -#include - -#include "lj_obj.h" - -/* String interning. */ -LJ_FUNC int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b); -LJ_FUNC void lj_str_resize(lua_State *L, MSize newmask); -LJ_FUNCA GCstr *lj_str_new(lua_State *L, const char *str, size_t len); -LJ_FUNC void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s); - -#define lj_str_newz(L, s) (lj_str_new(L, s, strlen(s))) -#define lj_str_newlit(L, s) (lj_str_new(L, "" s, sizeof(s)-1)) - -/* Type conversions. */ -LJ_FUNC size_t LJ_FASTCALL lj_str_bufnum(char *s, cTValue *o); -LJ_FUNC char * LJ_FASTCALL lj_str_bufint(char *p, int32_t k); -LJ_FUNCA GCstr * LJ_FASTCALL lj_str_fromnum(lua_State *L, const lua_Number *np); -LJ_FUNC GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k); -LJ_FUNCA GCstr * LJ_FASTCALL lj_str_fromnumber(lua_State *L, cTValue *o); - -#define LJ_STR_INTBUF (1+10) -#define LJ_STR_NUMBUF LUAI_MAXNUMBER2STR - -/* String formatting. */ -LJ_FUNC const char *lj_str_pushvf(lua_State *L, const char *fmt, va_list argp); -LJ_FUNC const char *lj_str_pushf(lua_State *L, const char *fmt, ...) -#if defined(__GNUC__) - __attribute__ ((format (printf, 2, 3))) -#endif - ; - -/* Resizable string buffers. Struct definition in lj_obj.h. */ -LJ_FUNC char *lj_str_needbuf(lua_State *L, SBuf *sb, MSize sz); - -#define lj_str_initbuf(sb) ((sb)->buf = NULL, (sb)->sz = 0) -#define lj_str_resetbuf(sb) ((sb)->n = 0) -#define lj_str_resizebuf(L, sb, size) \ - ((sb)->buf = (char *)lj_mem_realloc(L, (sb)->buf, (sb)->sz, (size)), \ - (sb)->sz = (size)) -#define lj_str_freebuf(g, sb) lj_mem_free(g, (void *)(sb)->buf, (sb)->sz) - -#endif diff --git a/subprojects/luajit/src/lj_strscan.c b/subprojects/luajit/src/lj_strscan.c deleted file mode 100644 index f1e34a3df..000000000 --- a/subprojects/luajit/src/lj_strscan.c +++ /dev/null @@ -1,498 +0,0 @@ -/* -** String scanning. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include - -#define lj_strscan_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_char.h" -#include "lj_strscan.h" - -/* -- Scanning numbers ---------------------------------------------------- */ - -/* -** Rationale for the builtin string to number conversion library: -** -** It removes a dependency on libc's strtod(), which is a true portability -** nightmare. Mainly due to the plethora of supported OS and toolchain -** combinations. Sadly, the various implementations -** a) are often buggy, incomplete (no hex floats) and/or imprecise, -** b) sometimes crash or hang on certain inputs, -** c) return non-standard NaNs that need to be filtered out, and -** d) fail if the locale-specific decimal separator is not a dot, -** which can only be fixed with atrocious workarounds. -** -** Also, most of the strtod() implementations are hopelessly bloated, -** which is not just an I-cache hog, but a problem for static linkage -** on embedded systems, too. -** -** OTOH the builtin conversion function is very compact. Even though it -** does a lot more, like parsing long longs, octal or imaginary numbers -** and returning the result in different formats: -** a) It needs less than 3 KB (!) of machine code (on x64 with -Os), -** b) it doesn't perform any dynamic allocation and, -** c) it needs only around 600 bytes of stack space. -** -** The builtin function is faster than strtod() for typical inputs, e.g. -** "123", "1.5" or "1e6". Arguably, it's slower for very large exponents, -** which are not very common (this could be fixed, if needed). -** -** And most importantly, the builtin function is equally precise on all -** platforms. It correctly converts and rounds any input to a double. -** If this is not the case, please send a bug report -- but PLEASE verify -** that the implementation you're comparing to is not the culprit! -** -** The implementation quickly pre-scans the entire string first and -** handles simple integers on-the-fly. Otherwise, it dispatches to the -** base-specific parser. Hex and octal is straightforward. -** -** Decimal to binary conversion uses a fixed-length circular buffer in -** base 100. Some simple cases are handled directly. For other cases, the -** number in the buffer is up-scaled or down-scaled until the integer part -** is in the proper range. Then the integer part is rounded and converted -** to a double which is finally rescaled to the result. Denormals need -** special treatment to prevent incorrect 'double rounding'. -*/ - -/* Definitions for circular decimal digit buffer (base 100 = 2 digits/byte). */ -#define STRSCAN_DIG 1024 -#define STRSCAN_MAXDIG 800 /* 772 + extra are sufficient. */ -#define STRSCAN_DDIG (STRSCAN_DIG/2) -#define STRSCAN_DMASK (STRSCAN_DDIG-1) - -/* Helpers for circular buffer. */ -#define DNEXT(a) (((a)+1) & STRSCAN_DMASK) -#define DPREV(a) (((a)-1) & STRSCAN_DMASK) -#define DLEN(lo, hi) ((int32_t)(((lo)-(hi)) & STRSCAN_DMASK)) - -#define casecmp(c, k) (((c) | 0x20) == k) - -/* Final conversion to double. */ -static void strscan_double(uint64_t x, TValue *o, int32_t ex2, int32_t neg) -{ - double n; - - /* Avoid double rounding for denormals. */ - if (LJ_UNLIKELY(ex2 <= -1075 && x != 0)) { - /* NYI: all of this generates way too much code on 32 bit CPUs. */ -#if defined(__GNUC__) && LJ_64 - int32_t b = (int32_t)(__builtin_clzll(x)^63); -#else - int32_t b = (x>>32) ? 32+(int32_t)lj_fls((uint32_t)(x>>32)) : - (int32_t)lj_fls((uint32_t)x); -#endif - if ((int32_t)b + ex2 <= -1023 && (int32_t)b + ex2 >= -1075) { - uint64_t rb = (uint64_t)1 << (-1075-ex2); - if ((x & rb) && ((x & (rb+rb+rb-1)))) x += rb+rb; - x = (x & ~(rb+rb-1)); - } - } - - /* Convert to double using a signed int64_t conversion, then rescale. */ - lua_assert((int64_t)x >= 0); - n = (double)(int64_t)x; - if (neg) n = -n; - if (ex2) n = ldexp(n, ex2); - o->n = n; -} - -/* Parse hexadecimal number. */ -static StrScanFmt strscan_hex(const uint8_t *p, TValue *o, - StrScanFmt fmt, uint32_t opt, - int32_t ex2, int32_t neg, uint32_t dig) -{ - uint64_t x = 0; - uint32_t i; - - /* Scan hex digits. */ - for (i = dig > 16 ? 16 : dig ; i; i--, p++) { - uint32_t d = (*p != '.' ? *p : *++p); if (d > '9') d += 9; - x = (x << 4) + (d & 15); - } - - /* Summarize rounding-effect of excess digits. */ - for (i = 16; i < dig; i++, p++) - x |= ((*p != '.' ? *p : *++p) != '0'), ex2 += 4; - - /* Format-specific handling. */ - switch (fmt) { - case STRSCAN_INT: - if (!(opt & STRSCAN_OPT_TONUM) && x < 0x80000000u+neg) { - o->i = neg ? -(int32_t)x : (int32_t)x; - return STRSCAN_INT; /* Fast path for 32 bit integers. */ - } - if (!(opt & STRSCAN_OPT_C)) { fmt = STRSCAN_NUM; break; } - /* fallthrough */ - case STRSCAN_U32: - if (dig > 8) return STRSCAN_ERROR; - o->i = neg ? -(int32_t)x : (int32_t)x; - return STRSCAN_U32; - case STRSCAN_I64: - case STRSCAN_U64: - if (dig > 16) return STRSCAN_ERROR; - o->u64 = neg ? (uint64_t)-(int64_t)x : x; - return fmt; - default: - break; - } - - /* Reduce range then convert to double. */ - if ((x & U64x(c0000000,0000000))) { x = (x >> 2) | (x & 3); ex2 += 2; } - strscan_double(x, o, ex2, neg); - return fmt; -} - -/* Parse octal number. */ -static StrScanFmt strscan_oct(const uint8_t *p, TValue *o, - StrScanFmt fmt, int32_t neg, uint32_t dig) -{ - uint64_t x = 0; - - /* Scan octal digits. */ - if (dig > 22 || (dig == 22 && *p > '1')) return STRSCAN_ERROR; - while (dig-- > 0) { - if (!(*p >= '0' && *p <= '7')) return STRSCAN_ERROR; - x = (x << 3) + (*p++ & 7); - } - - /* Format-specific handling. */ - switch (fmt) { - case STRSCAN_INT: - if (x >= 0x80000000u+neg) fmt = STRSCAN_U32; - /* fallthrough */ - case STRSCAN_U32: - if ((x >> 32)) return STRSCAN_ERROR; - o->i = neg ? -(int32_t)x : (int32_t)x; - break; - default: - case STRSCAN_I64: - case STRSCAN_U64: - o->u64 = neg ? (uint64_t)-(int64_t)x : x; - break; - } - return fmt; -} - -/* Parse decimal number. */ -static StrScanFmt strscan_dec(const uint8_t *p, TValue *o, - StrScanFmt fmt, uint32_t opt, - int32_t ex10, int32_t neg, uint32_t dig) -{ - uint8_t xi[STRSCAN_DDIG], *xip = xi; - - if (dig) { - uint32_t i = dig; - if (i > STRSCAN_MAXDIG) { - ex10 += (int32_t)(i - STRSCAN_MAXDIG); - i = STRSCAN_MAXDIG; - } - /* Scan unaligned leading digit. */ - if (((ex10^i) & 1)) - *xip++ = ((*p != '.' ? *p : *++p) & 15), i--, p++; - /* Scan aligned double-digits. */ - for ( ; i > 1; i -= 2) { - uint32_t d = 10 * ((*p != '.' ? *p : *++p) & 15); p++; - *xip++ = d + ((*p != '.' ? *p : *++p) & 15); p++; - } - /* Scan and realign trailing digit. */ - if (i) *xip++ = 10 * ((*p != '.' ? *p : *++p) & 15), ex10--, dig++, p++; - - /* Summarize rounding-effect of excess digits. */ - if (dig > STRSCAN_MAXDIG) { - do { - if ((*p != '.' ? *p : *++p) != '0') { xip[-1] |= 1; break; } - p++; - } while (--dig > STRSCAN_MAXDIG); - dig = STRSCAN_MAXDIG; - } else { /* Simplify exponent. */ - while (ex10 > 0 && dig <= 18) *xip++ = 0, ex10 -= 2, dig += 2; - } - } else { /* Only got zeros. */ - ex10 = 0; - xi[0] = 0; - } - - /* Fast path for numbers in integer format (but handles e.g. 1e6, too). */ - if (dig <= 20 && ex10 == 0) { - uint8_t *xis; - uint64_t x = xi[0]; - double n; - for (xis = xi+1; xis < xip; xis++) x = x * 100 + *xis; - if (!(dig == 20 && (xi[0] > 18 || (int64_t)x >= 0))) { /* No overflow? */ - /* Format-specific handling. */ - switch (fmt) { - case STRSCAN_INT: - if (!(opt & STRSCAN_OPT_TONUM) && x < 0x80000000u+neg) { - o->i = neg ? -(int32_t)x : (int32_t)x; - return STRSCAN_INT; /* Fast path for 32 bit integers. */ - } - if (!(opt & STRSCAN_OPT_C)) { fmt = STRSCAN_NUM; goto plainnumber; } - /* fallthrough */ - case STRSCAN_U32: - if ((x >> 32) != 0) return STRSCAN_ERROR; - o->i = neg ? -(int32_t)x : (int32_t)x; - return STRSCAN_U32; - case STRSCAN_I64: - case STRSCAN_U64: - o->u64 = neg ? (uint64_t)-(int64_t)x : x; - return fmt; - default: - plainnumber: /* Fast path for plain numbers < 2^63. */ - if ((int64_t)x < 0) break; - n = (double)(int64_t)x; - if (neg) n = -n; - o->n = n; - return fmt; - } - } - } - - /* Slow non-integer path. */ - if (fmt == STRSCAN_INT) { - if ((opt & STRSCAN_OPT_C)) return STRSCAN_ERROR; - fmt = STRSCAN_NUM; - } else if (fmt > STRSCAN_INT) { - return STRSCAN_ERROR; - } - { - uint32_t hi = 0, lo = (uint32_t)(xip-xi); - int32_t ex2 = 0, idig = (int32_t)lo + (ex10 >> 1); - - lua_assert(lo > 0 && (ex10 & 1) == 0); - - /* Handle simple overflow/underflow. */ - if (idig > 310/2) { if (neg) setminfV(o); else setpinfV(o); return fmt; } - else if (idig < -326/2) { o->n = neg ? -0.0 : 0.0; return fmt; } - - /* Scale up until we have at least 17 or 18 integer part digits. */ - while (idig < 9 && idig < DLEN(lo, hi)) { - uint32_t i, cy = 0; - ex2 -= 6; - for (i = DPREV(lo); ; i = DPREV(i)) { - uint32_t d = (xi[i] << 6) + cy; - cy = (((d >> 2) * 5243) >> 17); d = d - cy * 100; /* Div/mod 100. */ - xi[i] = (uint8_t)d; - if (i == hi) break; - if (d == 0 && i == DPREV(lo)) lo = i; - } - if (cy) { - hi = DPREV(hi); - if (xi[DPREV(lo)] == 0) lo = DPREV(lo); - else if (hi == lo) { lo = DPREV(lo); xi[DPREV(lo)] |= xi[lo]; } - xi[hi] = (uint8_t)cy; idig++; - } - } - - /* Scale down until no more than 17 or 18 integer part digits remain. */ - while (idig > 9) { - uint32_t i = hi, cy = 0; - ex2 += 6; - do { - cy += xi[i]; - xi[i] = (cy >> 6); - cy = 100 * (cy & 0x3f); - if (xi[i] == 0 && i == hi) hi = DNEXT(hi), idig--; - i = DNEXT(i); - } while (i != lo); - while (cy) { - if (hi == lo) { xi[DPREV(lo)] |= 1; break; } - xi[lo] = (cy >> 6); lo = DNEXT(lo); - cy = 100 * (cy & 0x3f); - } - } - - /* Collect integer part digits and convert to rescaled double. */ - { - uint64_t x = xi[hi]; - uint32_t i; - for (i = DNEXT(hi); --idig > 0 && i != lo; i = DNEXT(i)) - x = x * 100 + xi[i]; - if (i == lo) { - while (--idig >= 0) x = x * 100; - } else { /* Gather round bit from remaining digits. */ - x <<= 1; ex2--; - do { - if (xi[i]) { x |= 1; break; } - i = DNEXT(i); - } while (i != lo); - } - strscan_double(x, o, ex2, neg); - } - } - return fmt; -} - -/* Scan string containing a number. Returns format. Returns value in o. */ -StrScanFmt lj_strscan_scan(const uint8_t *p, TValue *o, uint32_t opt) -{ - int32_t neg = 0; - - /* Remove leading space, parse sign and non-numbers. */ - if (LJ_UNLIKELY(!lj_char_isdigit(*p))) { - while (lj_char_isspace(*p)) p++; - if (*p == '+' || *p == '-') neg = (*p++ == '-'); - if (LJ_UNLIKELY(*p >= 'A')) { /* Parse "inf", "infinity" or "nan". */ - TValue tmp; - setnanV(&tmp); - if (casecmp(p[0],'i') && casecmp(p[1],'n') && casecmp(p[2],'f')) { - if (neg) setminfV(&tmp); else setpinfV(&tmp); - p += 3; - if (casecmp(p[0],'i') && casecmp(p[1],'n') && casecmp(p[2],'i') && - casecmp(p[3],'t') && casecmp(p[4],'y')) p += 5; - } else if (casecmp(p[0],'n') && casecmp(p[1],'a') && casecmp(p[2],'n')) { - p += 3; - } - while (lj_char_isspace(*p)) p++; - if (*p) return STRSCAN_ERROR; - o->u64 = tmp.u64; - return STRSCAN_NUM; - } - } - - /* Parse regular number. */ - { - StrScanFmt fmt = STRSCAN_INT; - int cmask = LJ_CHAR_DIGIT; - int base = (opt & STRSCAN_OPT_C) && *p == '0' ? 0 : 10; - const uint8_t *sp, *dp = NULL; - uint32_t dig = 0, hasdig = 0, x = 0; - int32_t ex = 0; - - /* Determine base and skip leading zeros. */ - if (LJ_UNLIKELY(*p <= '0')) { - if (*p == '0' && casecmp(p[1], 'x')) - base = 16, cmask = LJ_CHAR_XDIGIT, p += 2; - for ( ; ; p++) { - if (*p == '0') { - hasdig = 1; - } else if (*p == '.') { - if (dp) return STRSCAN_ERROR; - dp = p; - } else { - break; - } - } - } - - /* Preliminary digit and decimal point scan. */ - for (sp = p; ; p++) { - if (LJ_LIKELY(lj_char_isa(*p, cmask))) { - x = x * 10 + (*p & 15); /* For fast path below. */ - dig++; - } else if (*p == '.') { - if (dp) return STRSCAN_ERROR; - dp = p; - } else { - break; - } - } - if (!(hasdig | dig)) return STRSCAN_ERROR; - - /* Handle decimal point. */ - if (dp) { - fmt = STRSCAN_NUM; - if (dig) { - ex = (int32_t)(dp-(p-1)); dp = p-1; - while (ex < 0 && *dp-- == '0') ex++, dig--; /* Skip trailing zeros. */ - if (base == 16) ex *= 4; - } - } - - /* Parse exponent. */ - if (casecmp(*p, (uint32_t)(base == 16 ? 'p' : 'e'))) { - uint32_t xx; - int negx = 0; - fmt = STRSCAN_NUM; p++; - if (*p == '+' || *p == '-') negx = (*p++ == '-'); - if (!lj_char_isdigit(*p)) return STRSCAN_ERROR; - xx = (*p++ & 15); - while (lj_char_isdigit(*p)) { - if (xx < 65536) xx = xx * 10 + (*p & 15); - p++; - } - ex += negx ? -(int32_t)xx : (int32_t)xx; - } - - /* Parse suffix. */ - if (*p) { - /* I (IMAG), U (U32), LL (I64), ULL/LLU (U64), L (long), UL/LU (ulong). */ - /* NYI: f (float). Not needed until cp_number() handles non-integers. */ - if (casecmp(*p, 'i')) { - if (!(opt & STRSCAN_OPT_IMAG)) return STRSCAN_ERROR; - p++; fmt = STRSCAN_IMAG; - } else if (fmt == STRSCAN_INT) { - if (casecmp(*p, 'u')) p++, fmt = STRSCAN_U32; - if (casecmp(*p, 'l')) { - p++; - if (casecmp(*p, 'l')) p++, fmt += STRSCAN_I64 - STRSCAN_INT; - else if (!(opt & STRSCAN_OPT_C)) return STRSCAN_ERROR; - else if (sizeof(long) == 8) fmt += STRSCAN_I64 - STRSCAN_INT; - } - if (casecmp(*p, 'u') && (fmt == STRSCAN_INT || fmt == STRSCAN_I64)) - p++, fmt += STRSCAN_U32 - STRSCAN_INT; - if ((fmt == STRSCAN_U32 && !(opt & STRSCAN_OPT_C)) || - (fmt >= STRSCAN_I64 && !(opt & STRSCAN_OPT_LL))) - return STRSCAN_ERROR; - } - while (lj_char_isspace(*p)) p++; - if (*p) return STRSCAN_ERROR; - } - - /* Fast path for decimal 32 bit integers. */ - if (fmt == STRSCAN_INT && base == 10 && - (dig < 10 || (dig == 10 && *sp <= '2' && x < 0x80000000u+neg))) { - int32_t y = neg ? -(int32_t)x : (int32_t)x; - if ((opt & STRSCAN_OPT_TONUM)) { - o->n = (double)y; - return STRSCAN_NUM; - } else { - o->i = y; - return STRSCAN_INT; - } - } - - /* Dispatch to base-specific parser. */ - if (base == 0 && !(fmt == STRSCAN_NUM || fmt == STRSCAN_IMAG)) - return strscan_oct(sp, o, fmt, neg, dig); - if (base == 16) - fmt = strscan_hex(sp, o, fmt, opt, ex, neg, dig); - else - fmt = strscan_dec(sp, o, fmt, opt, ex, neg, dig); - - /* Try to convert number to integer, if requested. */ - if (fmt == STRSCAN_NUM && (opt & STRSCAN_OPT_TOINT)) { - double n = o->n; - int32_t i = lj_num2int(n); - if (n == (lua_Number)i) { o->i = i; return STRSCAN_INT; } - } - return fmt; - } -} - -int LJ_FASTCALL lj_strscan_num(GCstr *str, TValue *o) -{ - StrScanFmt fmt = lj_strscan_scan((const uint8_t *)strdata(str), o, - STRSCAN_OPT_TONUM); - lua_assert(fmt == STRSCAN_ERROR || fmt == STRSCAN_NUM); - return (fmt != STRSCAN_ERROR); -} - -#if LJ_DUALNUM -int LJ_FASTCALL lj_strscan_number(GCstr *str, TValue *o) -{ - StrScanFmt fmt = lj_strscan_scan((const uint8_t *)strdata(str), o, - STRSCAN_OPT_TOINT); - lua_assert(fmt == STRSCAN_ERROR || fmt == STRSCAN_NUM || fmt == STRSCAN_INT); - if (fmt == STRSCAN_INT) setitype(o, LJ_TISNUM); - return (fmt != STRSCAN_ERROR); -} -#endif - -#undef DNEXT -#undef DPREV -#undef DLEN - diff --git a/subprojects/luajit/src/lj_strscan.h b/subprojects/luajit/src/lj_strscan.h deleted file mode 100644 index 6fb0dda08..000000000 --- a/subprojects/luajit/src/lj_strscan.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -** String scanning. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_STRSCAN_H -#define _LJ_STRSCAN_H - -#include "lj_obj.h" - -/* Options for accepted/returned formats. */ -#define STRSCAN_OPT_TOINT 0x01 /* Convert to int32_t, if possible. */ -#define STRSCAN_OPT_TONUM 0x02 /* Always convert to double. */ -#define STRSCAN_OPT_IMAG 0x04 -#define STRSCAN_OPT_LL 0x08 -#define STRSCAN_OPT_C 0x10 - -/* Returned format. */ -typedef enum { - STRSCAN_ERROR, - STRSCAN_NUM, STRSCAN_IMAG, - STRSCAN_INT, STRSCAN_U32, STRSCAN_I64, STRSCAN_U64, -} StrScanFmt; - -LJ_FUNC StrScanFmt lj_strscan_scan(const uint8_t *p, TValue *o, uint32_t opt); -LJ_FUNC int LJ_FASTCALL lj_strscan_num(GCstr *str, TValue *o); -#if LJ_DUALNUM -LJ_FUNC int LJ_FASTCALL lj_strscan_number(GCstr *str, TValue *o); -#else -#define lj_strscan_number(s, o) lj_strscan_num((s), (o)) -#endif - -/* Check for number or convert string to number/int in-place (!). */ -static LJ_AINLINE int lj_strscan_numberobj(TValue *o) -{ - return tvisnumber(o) || (tvisstr(o) && lj_strscan_number(strV(o), o)); -} - -#endif diff --git a/subprojects/luajit/src/lj_tab.c b/subprojects/luajit/src/lj_tab.c deleted file mode 100644 index 50f447e88..000000000 --- a/subprojects/luajit/src/lj_tab.c +++ /dev/null @@ -1,631 +0,0 @@ -/* -** Table handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#define lj_tab_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_tab.h" - -/* -- Object hashing ------------------------------------------------------ */ - -/* Hash values are masked with the table hash mask and used as an index. */ -static LJ_AINLINE Node *hashmask(const GCtab *t, uint32_t hash) -{ - Node *n = noderef(t->node); - return &n[hash & t->hmask]; -} - -/* String hashes are precomputed when they are interned. */ -#define hashstr(t, s) hashmask(t, (s)->hash) - -#define hashlohi(t, lo, hi) hashmask((t), hashrot((lo), (hi))) -#define hashnum(t, o) hashlohi((t), (o)->u32.lo, ((o)->u32.hi << 1)) -#define hashptr(t, p) hashlohi((t), u32ptr(p), u32ptr(p) + HASH_BIAS) -#define hashgcref(t, r) hashlohi((t), gcrefu(r), gcrefu(r) + HASH_BIAS) - -/* Hash an arbitrary key and return its anchor position in the hash table. */ -static Node *hashkey(const GCtab *t, cTValue *key) -{ - lua_assert(!tvisint(key)); - if (tvisstr(key)) - return hashstr(t, strV(key)); - else if (tvisnum(key)) - return hashnum(t, key); - else if (tvisbool(key)) - return hashmask(t, boolV(key)); - else - return hashgcref(t, key->gcr); - /* Only hash 32 bits of lightuserdata on a 64 bit CPU. Good enough? */ -} - -/* -- Table creation and destruction -------------------------------------- */ - -/* Create new hash part for table. */ -static LJ_AINLINE void newhpart(lua_State *L, GCtab *t, uint32_t hbits) -{ - uint32_t hsize; - Node *node; - lua_assert(hbits != 0); - if (hbits > LJ_MAX_HBITS) - lj_err_msg(L, LJ_ERR_TABOV); - hsize = 1u << hbits; - node = lj_mem_newvec(L, hsize, Node); - setmref(node->freetop, &node[hsize]); - setmref(t->node, node); - t->hmask = hsize-1; -} - -/* -** Q: Why all of these copies of t->hmask, t->node etc. to local variables? -** A: Because alias analysis for C is _really_ tough. -** Even state-of-the-art C compilers won't produce good code without this. -*/ - -/* Clear hash part of table. */ -static LJ_AINLINE void clearhpart(GCtab *t) -{ - uint32_t i, hmask = t->hmask; - Node *node = noderef(t->node); - lua_assert(t->hmask != 0); - for (i = 0; i <= hmask; i++) { - Node *n = &node[i]; - setmref(n->next, NULL); - setnilV(&n->key); - setnilV(&n->val); - } -} - -/* Clear array part of table. */ -static LJ_AINLINE void clearapart(GCtab *t) -{ - uint32_t i, asize = t->asize; - TValue *array = tvref(t->array); - for (i = 0; i < asize; i++) - setnilV(&array[i]); -} - -/* Create a new table. Note: the slots are not initialized (yet). */ -static GCtab *newtab(lua_State *L, uint32_t asize, uint32_t hbits) -{ - GCtab *t; - /* First try to colocate the array part. */ - if (LJ_MAX_COLOSIZE != 0 && asize > 0 && asize <= LJ_MAX_COLOSIZE) { - lua_assert((sizeof(GCtab) & 7) == 0); - t = (GCtab *)lj_mem_newgco(L, sizetabcolo(asize)); - t->gct = ~LJ_TTAB; - t->nomm = (uint8_t)~0; - t->colo = (int8_t)asize; - setmref(t->array, (TValue *)((char *)t + sizeof(GCtab))); - setgcrefnull(t->metatable); - t->asize = asize; - t->hmask = 0; - setmref(t->node, &G(L)->nilnode); - } else { /* Otherwise separately allocate the array part. */ - t = lj_mem_newobj(L, GCtab); - t->gct = ~LJ_TTAB; - t->nomm = (uint8_t)~0; - t->colo = 0; - setmref(t->array, NULL); - setgcrefnull(t->metatable); - t->asize = 0; /* In case the array allocation fails. */ - t->hmask = 0; - setmref(t->node, &G(L)->nilnode); - if (asize > 0) { - if (asize > LJ_MAX_ASIZE) - lj_err_msg(L, LJ_ERR_TABOV); - setmref(t->array, lj_mem_newvec(L, asize, TValue)); - t->asize = asize; - } - } - if (hbits) - newhpart(L, t, hbits); - return t; -} - -/* Create a new table. -** -** IMPORTANT NOTE: The API differs from lua_createtable()! -** -** The array size is non-inclusive. E.g. asize=128 creates array slots -** for 0..127, but not for 128. If you need slots 1..128, pass asize=129 -** (slot 0 is wasted in this case). -** -** The hash size is given in hash bits. hbits=0 means no hash part. -** hbits=1 creates 2 hash slots, hbits=2 creates 4 hash slots and so on. -*/ -GCtab *lj_tab_new(lua_State *L, uint32_t asize, uint32_t hbits) -{ - GCtab *t = newtab(L, asize, hbits); - clearapart(t); - if (t->hmask > 0) clearhpart(t); - return t; -} - -#if LJ_HASJIT -GCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize) -{ - GCtab *t = newtab(L, ahsize & 0xffffff, ahsize >> 24); - clearapart(t); - if (t->hmask > 0) clearhpart(t); - return t; -} -#endif - -/* Duplicate a table. */ -GCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt) -{ - GCtab *t; - uint32_t asize, hmask; - t = newtab(L, kt->asize, kt->hmask > 0 ? lj_fls(kt->hmask)+1 : 0); - lua_assert(kt->asize == t->asize && kt->hmask == t->hmask); - t->nomm = 0; /* Keys with metamethod names may be present. */ - asize = kt->asize; - if (asize > 0) { - TValue *array = tvref(t->array); - TValue *karray = tvref(kt->array); - if (asize < 64) { /* An inlined loop beats memcpy for < 512 bytes. */ - uint32_t i; - for (i = 0; i < asize; i++) - copyTV(L, &array[i], &karray[i]); - } else { - memcpy(array, karray, asize*sizeof(TValue)); - } - } - hmask = kt->hmask; - if (hmask > 0) { - uint32_t i; - Node *node = noderef(t->node); - Node *knode = noderef(kt->node); - ptrdiff_t d = (char *)node - (char *)knode; - setmref(node->freetop, (Node *)((char *)noderef(knode->freetop) + d)); - for (i = 0; i <= hmask; i++) { - Node *kn = &knode[i]; - Node *n = &node[i]; - Node *next = nextnode(kn); - /* Don't use copyTV here, since it asserts on a copy of a dead key. */ - n->val = kn->val; n->key = kn->key; - setmref(n->next, next == NULL? next : (Node *)((char *)next + d)); - } - } - return t; -} - -/* Free a table. */ -void LJ_FASTCALL lj_tab_free(global_State *g, GCtab *t) -{ - if (t->hmask > 0) - lj_mem_freevec(g, noderef(t->node), t->hmask+1, Node); - if (t->asize > 0 && LJ_MAX_COLOSIZE != 0 && t->colo <= 0) - lj_mem_freevec(g, tvref(t->array), t->asize, TValue); - if (LJ_MAX_COLOSIZE != 0 && t->colo) - lj_mem_free(g, t, sizetabcolo((uint32_t)t->colo & 0x7f)); - else - lj_mem_freet(g, t); -} - -/* -- Table resizing ------------------------------------------------------ */ - -/* Resize a table to fit the new array/hash part sizes. */ -static void resizetab(lua_State *L, GCtab *t, uint32_t asize, uint32_t hbits) -{ - Node *oldnode = noderef(t->node); - uint32_t oldasize = t->asize; - uint32_t oldhmask = t->hmask; - if (asize > oldasize) { /* Array part grows? */ - TValue *array; - uint32_t i; - if (asize > LJ_MAX_ASIZE) - lj_err_msg(L, LJ_ERR_TABOV); - if (LJ_MAX_COLOSIZE != 0 && t->colo > 0) { - /* A colocated array must be separated and copied. */ - TValue *oarray = tvref(t->array); - array = lj_mem_newvec(L, asize, TValue); - t->colo = (int8_t)(t->colo | 0x80); /* Mark as separated (colo < 0). */ - for (i = 0; i < oldasize; i++) - copyTV(L, &array[i], &oarray[i]); - } else { - array = (TValue *)lj_mem_realloc(L, tvref(t->array), - oldasize*sizeof(TValue), asize*sizeof(TValue)); - } - setmref(t->array, array); - t->asize = asize; - for (i = oldasize; i < asize; i++) /* Clear newly allocated slots. */ - setnilV(&array[i]); - } - /* Create new (empty) hash part. */ - if (hbits) { - newhpart(L, t, hbits); - clearhpart(t); - } else { - global_State *g = G(L); - setmref(t->node, &g->nilnode); - t->hmask = 0; - } - if (asize < oldasize) { /* Array part shrinks? */ - TValue *array = tvref(t->array); - uint32_t i; - t->asize = asize; /* Note: This 'shrinks' even colocated arrays. */ - for (i = asize; i < oldasize; i++) /* Reinsert old array values. */ - if (!tvisnil(&array[i])) - copyTV(L, lj_tab_setinth(L, t, (int32_t)i), &array[i]); - /* Physically shrink only separated arrays. */ - if (LJ_MAX_COLOSIZE != 0 && t->colo <= 0) - setmref(t->array, lj_mem_realloc(L, array, - oldasize*sizeof(TValue), asize*sizeof(TValue))); - } - if (oldhmask > 0) { /* Reinsert pairs from old hash part. */ - global_State *g; - uint32_t i; - for (i = 0; i <= oldhmask; i++) { - Node *n = &oldnode[i]; - if (!tvisnil(&n->val)) - copyTV(L, lj_tab_set(L, t, &n->key), &n->val); - } - g = G(L); - lj_mem_freevec(g, oldnode, oldhmask+1, Node); - } -} - -static uint32_t countint(cTValue *key, uint32_t *bins) -{ - lua_assert(!tvisint(key)); - if (tvisnum(key)) { - lua_Number nk = numV(key); - int32_t k = lj_num2int(nk); - if ((uint32_t)k < LJ_MAX_ASIZE && nk == (lua_Number)k) { - bins[(k > 2 ? lj_fls((uint32_t)(k-1)) : 0)]++; - return 1; - } - } - return 0; -} - -static uint32_t countarray(const GCtab *t, uint32_t *bins) -{ - uint32_t na, b, i; - if (t->asize == 0) return 0; - for (na = i = b = 0; b < LJ_MAX_ABITS; b++) { - uint32_t n, top = 2u << b; - TValue *array; - if (top >= t->asize) { - top = t->asize-1; - if (i > top) - break; - } - array = tvref(t->array); - for (n = 0; i <= top; i++) - if (!tvisnil(&array[i])) - n++; - bins[b] += n; - na += n; - } - return na; -} - -static uint32_t counthash(const GCtab *t, uint32_t *bins, uint32_t *narray) -{ - uint32_t total, na, i, hmask = t->hmask; - Node *node = noderef(t->node); - for (total = na = 0, i = 0; i <= hmask; i++) { - Node *n = &node[i]; - if (!tvisnil(&n->val)) { - na += countint(&n->key, bins); - total++; - } - } - *narray += na; - return total; -} - -static uint32_t bestasize(uint32_t bins[], uint32_t *narray) -{ - uint32_t b, sum, na = 0, sz = 0, nn = *narray; - for (b = 0, sum = 0; 2*nn > (1u< 0 && 2*(sum += bins[b]) > (1u<hmask > 0 ? lj_fls(t->hmask)+1 : 0); -} - -/* -- Table getters ------------------------------------------------------- */ - -cTValue * LJ_FASTCALL lj_tab_getinth(GCtab *t, int32_t key) -{ - TValue k; - Node *n; - k.n = (lua_Number)key; - n = hashnum(t, &k); - do { - if (tvisnum(&n->key) && n->key.n == k.n) - return &n->val; - } while ((n = nextnode(n))); - return NULL; -} - -cTValue *lj_tab_getstr(GCtab *t, GCstr *key) -{ - Node *n = hashstr(t, key); - do { - if (tvisstr(&n->key) && strV(&n->key) == key) - return &n->val; - } while ((n = nextnode(n))); - return NULL; -} - -cTValue *lj_tab_get(lua_State *L, GCtab *t, cTValue *key) -{ - if (tvisstr(key)) { - cTValue *tv = lj_tab_getstr(t, strV(key)); - if (tv) - return tv; - } else if (tvisint(key)) { - cTValue *tv = lj_tab_getint(t, intV(key)); - if (tv) - return tv; - } else if (tvisnum(key)) { - lua_Number nk = numV(key); - int32_t k = lj_num2int(nk); - if (nk == (lua_Number)k) { - cTValue *tv = lj_tab_getint(t, k); - if (tv) - return tv; - } else { - goto genlookup; /* Else use the generic lookup. */ - } - } else if (!tvisnil(key)) { - Node *n; - genlookup: - n = hashkey(t, key); - do { - if (lj_obj_equal(&n->key, key)) - return &n->val; - } while ((n = nextnode(n))); - } - return niltv(L); -} - -/* -- Table setters ------------------------------------------------------- */ - -/* Insert new key. Use Brent's variation to optimize the chain length. */ -TValue *lj_tab_newkey(lua_State *L, GCtab *t, cTValue *key) -{ - Node *n = hashkey(t, key); - if (!tvisnil(&n->val) || t->hmask == 0) { - Node *nodebase = noderef(t->node); - Node *collide, *freenode = noderef(nodebase->freetop); - lua_assert(freenode >= nodebase && freenode <= nodebase+t->hmask+1); - do { - if (freenode == nodebase) { /* No free node found? */ - rehashtab(L, t, key); /* Rehash table. */ - return lj_tab_set(L, t, key); /* Retry key insertion. */ - } - } while (!tvisnil(&(--freenode)->key)); - setmref(nodebase->freetop, freenode); - lua_assert(freenode != &G(L)->nilnode); - collide = hashkey(t, &n->key); - if (collide != n) { /* Colliding node not the main node? */ - while (noderef(collide->next) != n) /* Find predecessor. */ - collide = nextnode(collide); - setmref(collide->next, freenode); /* Relink chain. */ - /* Copy colliding node into free node and free main node. */ - freenode->val = n->val; - freenode->key = n->key; - freenode->next = n->next; - setmref(n->next, NULL); - setnilV(&n->val); - /* Rechain pseudo-resurrected string keys with colliding hashes. */ - while (nextnode(freenode)) { - Node *nn = nextnode(freenode); - if (tvisstr(&nn->key) && !tvisnil(&nn->val) && - hashstr(t, strV(&nn->key)) == n) { - freenode->next = nn->next; - nn->next = n->next; - setmref(n->next, nn); - } else { - freenode = nn; - } - } - } else { /* Otherwise use free node. */ - setmrefr(freenode->next, n->next); /* Insert into chain. */ - setmref(n->next, freenode); - n = freenode; - } - } - n->key.u64 = key->u64; - if (LJ_UNLIKELY(tvismzero(&n->key))) - n->key.u64 = 0; - lj_gc_anybarriert(L, t); - lua_assert(tvisnil(&n->val)); - return &n->val; -} - -TValue *lj_tab_setinth(lua_State *L, GCtab *t, int32_t key) -{ - TValue k; - Node *n; - k.n = (lua_Number)key; - n = hashnum(t, &k); - do { - if (tvisnum(&n->key) && n->key.n == k.n) - return &n->val; - } while ((n = nextnode(n))); - return lj_tab_newkey(L, t, &k); -} - -TValue *lj_tab_setstr(lua_State *L, GCtab *t, GCstr *key) -{ - TValue k; - Node *n = hashstr(t, key); - do { - if (tvisstr(&n->key) && strV(&n->key) == key) - return &n->val; - } while ((n = nextnode(n))); - setstrV(L, &k, key); - return lj_tab_newkey(L, t, &k); -} - -TValue *lj_tab_set(lua_State *L, GCtab *t, cTValue *key) -{ - Node *n; - t->nomm = 0; /* Invalidate negative metamethod cache. */ - if (tvisstr(key)) { - return lj_tab_setstr(L, t, strV(key)); - } else if (tvisint(key)) { - return lj_tab_setint(L, t, intV(key)); - } else if (tvisnum(key)) { - lua_Number nk = numV(key); - int32_t k = lj_num2int(nk); - if (nk == (lua_Number)k) - return lj_tab_setint(L, t, k); - if (tvisnan(key)) - lj_err_msg(L, LJ_ERR_NANIDX); - /* Else use the generic lookup. */ - } else if (tvisnil(key)) { - lj_err_msg(L, LJ_ERR_NILIDX); - } - n = hashkey(t, key); - do { - if (lj_obj_equal(&n->key, key)) - return &n->val; - } while ((n = nextnode(n))); - return lj_tab_newkey(L, t, key); -} - -/* -- Table traversal ----------------------------------------------------- */ - -/* Get the traversal index of a key. */ -static uint32_t keyindex(lua_State *L, GCtab *t, cTValue *key) -{ - TValue tmp; - if (tvisint(key)) { - int32_t k = intV(key); - if ((uint32_t)k < t->asize) - return (uint32_t)k; /* Array key indexes: [0..t->asize-1] */ - setnumV(&tmp, (lua_Number)k); - key = &tmp; - } else if (tvisnum(key)) { - lua_Number nk = numV(key); - int32_t k = lj_num2int(nk); - if ((uint32_t)k < t->asize && nk == (lua_Number)k) - return (uint32_t)k; /* Array key indexes: [0..t->asize-1] */ - } - if (!tvisnil(key)) { - Node *n = hashkey(t, key); - do { - if (lj_obj_equal(&n->key, key)) - return t->asize + (uint32_t)(n - noderef(t->node)); - /* Hash key indexes: [t->asize..t->asize+t->nmask] */ - } while ((n = nextnode(n))); - if (key->u32.hi == 0xfffe7fff) /* ITERN was despecialized while running. */ - return key->u32.lo - 1; - lj_err_msg(L, LJ_ERR_NEXTIDX); - return 0; /* unreachable */ - } - return ~0u; /* A nil key starts the traversal. */ -} - -/* Advance to the next step in a table traversal. */ -int lj_tab_next(lua_State *L, GCtab *t, TValue *key) -{ - uint32_t i = keyindex(L, t, key); /* Find predecessor key index. */ - for (i++; i < t->asize; i++) /* First traverse the array keys. */ - if (!tvisnil(arrayslot(t, i))) { - setintV(key, i); - copyTV(L, key+1, arrayslot(t, i)); - return 1; - } - for (i -= t->asize; i <= t->hmask; i++) { /* Then traverse the hash keys. */ - Node *n = &noderef(t->node)[i]; - if (!tvisnil(&n->val)) { - copyTV(L, key, &n->key); - copyTV(L, key+1, &n->val); - return 1; - } - } - return 0; /* End of traversal. */ -} - -/* -- Table length calculation -------------------------------------------- */ - -static MSize unbound_search(GCtab *t, MSize j) -{ - cTValue *tv; - MSize i = j; /* i is zero or a present index */ - j++; - /* find `i' and `j' such that i is present and j is not */ - while ((tv = lj_tab_getint(t, (int32_t)j)) && !tvisnil(tv)) { - i = j; - j *= 2; - if (j > (MSize)(INT_MAX-2)) { /* overflow? */ - /* table was built with bad purposes: resort to linear search */ - i = 1; - while ((tv = lj_tab_getint(t, (int32_t)i)) && !tvisnil(tv)) i++; - return i - 1; - } - } - /* now do a binary search between them */ - while (j - i > 1) { - MSize m = (i+j)/2; - cTValue *tvb = lj_tab_getint(t, (int32_t)m); - if (tvb && !tvisnil(tvb)) i = m; else j = m; - } - return i; -} - -/* -** Try to find a boundary in table `t'. A `boundary' is an integer index -** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil). -*/ -MSize LJ_FASTCALL lj_tab_len(GCtab *t) -{ - MSize j = (MSize)t->asize; - if (j > 1 && tvisnil(arrayslot(t, j-1))) { - MSize i = 1; - while (j - i > 1) { - MSize m = (i+j)/2; - if (tvisnil(arrayslot(t, m-1))) j = m; else i = m; - } - return i-1; - } - if (j) j--; - if (t->hmask <= 0) - return j; - return unbound_search(t, j); -} - diff --git a/subprojects/luajit/src/lj_tab.h b/subprojects/luajit/src/lj_tab.h deleted file mode 100644 index 36ce7cdd5..000000000 --- a/subprojects/luajit/src/lj_tab.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -** Table handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_TAB_H -#define _LJ_TAB_H - -#include "lj_obj.h" - -/* Hash constants. Tuned using a brute force search. */ -#define HASH_BIAS (-0x04c11db7) -#define HASH_ROT1 14 -#define HASH_ROT2 5 -#define HASH_ROT3 13 - -/* Scramble the bits of numbers and pointers. */ -static LJ_AINLINE uint32_t hashrot(uint32_t lo, uint32_t hi) -{ -#if LJ_TARGET_X86ORX64 - /* Prefer variant that compiles well for a 2-operand CPU. */ - lo ^= hi; hi = lj_rol(hi, HASH_ROT1); - lo -= hi; hi = lj_rol(hi, HASH_ROT2); - hi ^= lo; hi -= lj_rol(lo, HASH_ROT3); -#else - lo ^= hi; - lo = lo - lj_rol(hi, HASH_ROT1); - hi = lo ^ lj_rol(hi, HASH_ROT1 + HASH_ROT2); - hi = hi - lj_rol(lo, HASH_ROT3); -#endif - return hi; -} - -#define hsize2hbits(s) ((s) ? ((s)==1 ? 1 : 1+lj_fls((uint32_t)((s)-1))) : 0) - -LJ_FUNCA GCtab *lj_tab_new(lua_State *L, uint32_t asize, uint32_t hbits); -#if LJ_HASJIT -LJ_FUNC GCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize); -#endif -LJ_FUNCA GCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt); -LJ_FUNC void LJ_FASTCALL lj_tab_free(global_State *g, GCtab *t); -#if LJ_HASFFI -LJ_FUNC void lj_tab_rehash(lua_State *L, GCtab *t); -#endif -LJ_FUNCA void lj_tab_reasize(lua_State *L, GCtab *t, uint32_t nasize); - -/* Caveat: all getters except lj_tab_get() can return NULL! */ - -LJ_FUNCA cTValue * LJ_FASTCALL lj_tab_getinth(GCtab *t, int32_t key); -LJ_FUNC cTValue *lj_tab_getstr(GCtab *t, GCstr *key); -LJ_FUNCA cTValue *lj_tab_get(lua_State *L, GCtab *t, cTValue *key); - -/* Caveat: all setters require a write barrier for the stored value. */ - -LJ_FUNCA TValue *lj_tab_newkey(lua_State *L, GCtab *t, cTValue *key); -LJ_FUNC TValue *lj_tab_setinth(lua_State *L, GCtab *t, int32_t key); -LJ_FUNC TValue *lj_tab_setstr(lua_State *L, GCtab *t, GCstr *key); -LJ_FUNC TValue *lj_tab_set(lua_State *L, GCtab *t, cTValue *key); - -#define inarray(t, key) ((MSize)(key) < (MSize)(t)->asize) -#define arrayslot(t, i) (&tvref((t)->array)[(i)]) -#define lj_tab_getint(t, key) \ - (inarray((t), (key)) ? arrayslot((t), (key)) : lj_tab_getinth((t), (key))) -#define lj_tab_setint(L, t, key) \ - (inarray((t), (key)) ? arrayslot((t), (key)) : lj_tab_setinth(L, (t), (key))) - -LJ_FUNCA int lj_tab_next(lua_State *L, GCtab *t, TValue *key); -LJ_FUNCA MSize LJ_FASTCALL lj_tab_len(GCtab *t); - -#endif diff --git a/subprojects/luajit/src/lj_target.h b/subprojects/luajit/src/lj_target.h deleted file mode 100644 index 53bfa6bf9..000000000 --- a/subprojects/luajit/src/lj_target.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -** Definitions for target CPU. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_TARGET_H -#define _LJ_TARGET_H - -#include "lj_def.h" -#include "lj_arch.h" - -/* -- Registers and spill slots ------------------------------------------- */ - -/* Register type (uint8_t in ir->r). */ -typedef uint32_t Reg; - -/* The hi-bit is NOT set for an allocated register. This means the value -** can be directly used without masking. The hi-bit is set for a register -** allocation hint or for RID_INIT, RID_SINK or RID_SUNK. -*/ -#define RID_NONE 0x80 -#define RID_MASK 0x7f -#define RID_INIT (RID_NONE|RID_MASK) -#define RID_SINK (RID_INIT-1) -#define RID_SUNK (RID_INIT-2) - -#define ra_noreg(r) ((r) & RID_NONE) -#define ra_hasreg(r) (!((r) & RID_NONE)) - -/* The ra_hashint() macro assumes a previous test for ra_noreg(). */ -#define ra_hashint(r) ((r) < RID_SUNK) -#define ra_gethint(r) ((Reg)((r) & RID_MASK)) -#define ra_sethint(rr, r) rr = (uint8_t)((r)|RID_NONE) -#define ra_samehint(r1, r2) (ra_gethint((r1)^(r2)) == 0) - -/* Spill slot 0 means no spill slot has been allocated. */ -#define SPS_NONE 0 - -#define ra_hasspill(s) ((s) != SPS_NONE) - -/* Combined register and spill slot (uint16_t in ir->prev). */ -typedef uint32_t RegSP; - -#define REGSP(r, s) ((r) + ((s) << 8)) -#define REGSP_HINT(r) ((r)|RID_NONE) -#define REGSP_INIT REGSP(RID_INIT, 0) - -#define regsp_reg(rs) ((rs) & 255) -#define regsp_spill(rs) ((rs) >> 8) -#define regsp_used(rs) \ - (((rs) & ~REGSP(RID_MASK, 0)) != REGSP(RID_NONE, 0)) - -/* -- Register sets ------------------------------------------------------- */ - -/* Bitset for registers. 32 registers suffice for most architectures. -** Note that one set holds bits for both GPRs and FPRs. -*/ -#if LJ_TARGET_PPC || LJ_TARGET_MIPS -typedef uint64_t RegSet; -#else -typedef uint32_t RegSet; -#endif - -#define RID2RSET(r) (((RegSet)1) << (r)) -#define RSET_EMPTY ((RegSet)0) -#define RSET_RANGE(lo, hi) ((RID2RSET((hi)-(lo))-1) << (lo)) - -#define rset_test(rs, r) ((int)((rs) >> (r)) & 1) -#define rset_set(rs, r) (rs |= RID2RSET(r)) -#define rset_clear(rs, r) (rs &= ~RID2RSET(r)) -#define rset_exclude(rs, r) (rs & ~RID2RSET(r)) -#if LJ_TARGET_PPC || LJ_TARGET_MIPS -#define rset_picktop(rs) ((Reg)(__builtin_clzll(rs)^63)) -#define rset_pickbot(rs) ((Reg)__builtin_ctzll(rs)) -#else -#define rset_picktop(rs) ((Reg)lj_fls(rs)) -#define rset_pickbot(rs) ((Reg)lj_ffs(rs)) -#endif - -/* -- Register allocation cost -------------------------------------------- */ - -/* The register allocation heuristic keeps track of the cost for allocating -** a specific register: -** -** A free register (obviously) has a cost of 0 and a 1-bit in the free mask. -** -** An already allocated register has the (non-zero) IR reference in the lowest -** bits and the result of a blended cost-model in the higher bits. -** -** The allocator first checks the free mask for a hit. Otherwise an (unrolled) -** linear search for the minimum cost is used. The search doesn't need to -** keep track of the position of the minimum, which makes it very fast. -** The lowest bits of the minimum cost show the desired IR reference whose -** register is the one to evict. -** -** Without the cost-model this degenerates to the standard heuristics for -** (reverse) linear-scan register allocation. Since code generation is done -** in reverse, a live interval extends from the last use to the first def. -** For an SSA IR the IR reference is the first (and only) def and thus -** trivially marks the end of the interval. The LSRA heuristics says to pick -** the register whose live interval has the furthest extent, i.e. the lowest -** IR reference in our case. -** -** A cost-model should take into account other factors, like spill-cost and -** restore- or rematerialization-cost, which depend on the kind of instruction. -** E.g. constants have zero spill costs, variant instructions have higher -** costs than invariants and PHIs should preferably never be spilled. -** -** Here's a first cut at simple, but effective blended cost-model for R-LSRA: -** - Due to careful design of the IR, constants already have lower IR -** references than invariants and invariants have lower IR references -** than variants. -** - The cost in the upper 16 bits is the sum of the IR reference and a -** weighted score. The score currently only takes into account whether -** the IRT_ISPHI bit is set in the instruction type. -** - The PHI weight is the minimum distance (in IR instructions) a PHI -** reference has to be further apart from a non-PHI reference to be spilled. -** - It should be a power of two (for speed) and must be between 2 and 32768. -** Good values for the PHI weight seem to be between 40 and 150. -** - Further study is required. -*/ -#define REGCOST_PHI_WEIGHT 64 - -/* Cost for allocating a specific register. */ -typedef uint32_t RegCost; - -/* Note: assumes 16 bit IRRef1. */ -#define REGCOST(cost, ref) ((RegCost)(ref) + ((RegCost)(cost) << 16)) -#define regcost_ref(rc) ((IRRef1)(rc)) - -#define REGCOST_T(t) \ - ((RegCost)((t)&IRT_ISPHI) * (((RegCost)(REGCOST_PHI_WEIGHT)<<16)/IRT_ISPHI)) -#define REGCOST_REF_T(ref, t) (REGCOST((ref), (ref)) + REGCOST_T((t))) - -/* -- Target-specific definitions ----------------------------------------- */ - -#if LJ_TARGET_X86ORX64 -#include "lj_target_x86.h" -#elif LJ_TARGET_ARM -#include "lj_target_arm.h" -#elif LJ_TARGET_PPC -#include "lj_target_ppc.h" -#elif LJ_TARGET_MIPS -#include "lj_target_mips.h" -#else -#error "Missing include for target CPU" -#endif - -#ifdef EXITSTUBS_PER_GROUP -/* Return the address of an exit stub. */ -static LJ_AINLINE char *exitstub_addr_(char **group, uint32_t exitno) -{ - lua_assert(group[exitno / EXITSTUBS_PER_GROUP] != NULL); - return (char *)group[exitno / EXITSTUBS_PER_GROUP] + - EXITSTUB_SPACING*(exitno % EXITSTUBS_PER_GROUP); -} -/* Avoid dependence on lj_jit.h if only including lj_target.h. */ -#define exitstub_addr(J, exitno) \ - ((MCode *)exitstub_addr_((char **)((J)->exitstubgroup), (exitno))) -#endif - -#endif diff --git a/subprojects/luajit/src/lj_target_arm.h b/subprojects/luajit/src/lj_target_arm.h deleted file mode 100644 index d02cbf861..000000000 --- a/subprojects/luajit/src/lj_target_arm.h +++ /dev/null @@ -1,274 +0,0 @@ -/* -** Definitions for ARM CPUs. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_TARGET_ARM_H -#define _LJ_TARGET_ARM_H - -/* -- Registers IDs ------------------------------------------------------- */ - -#define GPRDEF(_) \ - _(R0) _(R1) _(R2) _(R3) _(R4) _(R5) _(R6) _(R7) \ - _(R8) _(R9) _(R10) _(R11) _(R12) _(SP) _(LR) _(PC) -#if LJ_SOFTFP -#define FPRDEF(_) -#else -#define FPRDEF(_) \ - _(D0) _(D1) _(D2) _(D3) _(D4) _(D5) _(D6) _(D7) \ - _(D8) _(D9) _(D10) _(D11) _(D12) _(D13) _(D14) _(D15) -#endif -#define VRIDDEF(_) - -#define RIDENUM(name) RID_##name, - -enum { - GPRDEF(RIDENUM) /* General-purpose registers (GPRs). */ - FPRDEF(RIDENUM) /* Floating-point registers (FPRs). */ - RID_MAX, - RID_TMP = RID_LR, - - /* Calling conventions. */ - RID_RET = RID_R0, - RID_RETLO = RID_R0, - RID_RETHI = RID_R1, -#if LJ_SOFTFP - RID_FPRET = RID_R0, -#else - RID_FPRET = RID_D0, -#endif - - /* These definitions must match with the *.dasc file(s): */ - RID_BASE = RID_R9, /* Interpreter BASE. */ - RID_LPC = RID_R6, /* Interpreter PC. */ - RID_DISPATCH = RID_R7, /* Interpreter DISPATCH table. */ - RID_LREG = RID_R8, /* Interpreter L. */ - - /* Register ranges [min, max) and number of registers. */ - RID_MIN_GPR = RID_R0, - RID_MAX_GPR = RID_PC+1, - RID_MIN_FPR = RID_MAX_GPR, -#if LJ_SOFTFP - RID_MAX_FPR = RID_MIN_FPR, -#else - RID_MAX_FPR = RID_D15+1, -#endif - RID_NUM_GPR = RID_MAX_GPR - RID_MIN_GPR, - RID_NUM_FPR = RID_MAX_FPR - RID_MIN_FPR -}; - -#define RID_NUM_KREF RID_NUM_GPR -#define RID_MIN_KREF RID_R0 - -/* -- Register sets ------------------------------------------------------- */ - -/* Make use of all registers, except sp, lr and pc. */ -#define RSET_GPR (RSET_RANGE(RID_MIN_GPR, RID_R12+1)) -#define RSET_GPREVEN \ - (RID2RSET(RID_R0)|RID2RSET(RID_R2)|RID2RSET(RID_R4)|RID2RSET(RID_R6)| \ - RID2RSET(RID_R8)|RID2RSET(RID_R10)) -#define RSET_GPRODD \ - (RID2RSET(RID_R1)|RID2RSET(RID_R3)|RID2RSET(RID_R5)|RID2RSET(RID_R7)| \ - RID2RSET(RID_R9)|RID2RSET(RID_R11)) -#if LJ_SOFTFP -#define RSET_FPR 0 -#else -#define RSET_FPR (RSET_RANGE(RID_MIN_FPR, RID_MAX_FPR)) -#endif -#define RSET_ALL (RSET_GPR|RSET_FPR) -#define RSET_INIT RSET_ALL - -/* ABI-specific register sets. lr is an implicit scratch register. */ -#define RSET_SCRATCH_GPR_ (RSET_RANGE(RID_R0, RID_R3+1)|RID2RSET(RID_R12)) -#ifdef __APPLE__ -#define RSET_SCRATCH_GPR (RSET_SCRATCH_GPR_|RID2RSET(RID_R9)) -#else -#define RSET_SCRATCH_GPR RSET_SCRATCH_GPR_ -#endif -#if LJ_SOFTFP -#define RSET_SCRATCH_FPR 0 -#else -#define RSET_SCRATCH_FPR (RSET_RANGE(RID_D0, RID_D7+1)) -#endif -#define RSET_SCRATCH (RSET_SCRATCH_GPR|RSET_SCRATCH_FPR) -#define REGARG_FIRSTGPR RID_R0 -#define REGARG_LASTGPR RID_R3 -#define REGARG_NUMGPR 4 -#if LJ_ABI_SOFTFP -#define REGARG_FIRSTFPR 0 -#define REGARG_LASTFPR 0 -#define REGARG_NUMFPR 0 -#else -#define REGARG_FIRSTFPR RID_D0 -#define REGARG_LASTFPR RID_D7 -#define REGARG_NUMFPR 8 -#endif - -/* -- Spill slots --------------------------------------------------------- */ - -/* Spill slots are 32 bit wide. An even/odd pair is used for FPRs. -** -** SPS_FIXED: Available fixed spill slots in interpreter frame. -** This definition must match with the *.dasc file(s). -** -** SPS_FIRST: First spill slot for general use. Reserve min. two 32 bit slots. -*/ -#define SPS_FIXED 2 -#define SPS_FIRST 2 - -#define SPOFS_TMP 0 - -#define sps_scale(slot) (4 * (int32_t)(slot)) -#define sps_align(slot) (((slot) - SPS_FIXED + 1) & ~1) - -/* -- Exit state ---------------------------------------------------------- */ - -/* This definition must match with the *.dasc file(s). */ -typedef struct { -#if !LJ_SOFTFP - lua_Number fpr[RID_NUM_FPR]; /* Floating-point registers. */ -#endif - int32_t gpr[RID_NUM_GPR]; /* General-purpose registers. */ - int32_t spill[256]; /* Spill slots. */ -} ExitState; - -/* PC after instruction that caused an exit. Used to find the trace number. */ -#define EXITSTATE_PCREG RID_PC -/* Highest exit + 1 indicates stack check. */ -#define EXITSTATE_CHECKEXIT 1 - -#define EXITSTUB_SPACING 4 -#define EXITSTUBS_PER_GROUP 32 - -/* -- Instructions -------------------------------------------------------- */ - -/* Instruction fields. */ -#define ARMF_CC(ai, cc) (((ai) ^ ARMI_CCAL) | ((cc) << 28)) -#define ARMF_N(r) ((r) << 16) -#define ARMF_D(r) ((r) << 12) -#define ARMF_S(r) ((r) << 8) -#define ARMF_M(r) (r) -#define ARMF_SH(sh, n) (((sh) << 5) | ((n) << 7)) -#define ARMF_RSH(sh, r) (0x10 | ((sh) << 5) | ARMF_S(r)) - -typedef enum ARMIns { - ARMI_CCAL = 0xe0000000, - ARMI_S = 0x000100000, - ARMI_K12 = 0x02000000, - ARMI_KNEG = 0x00200000, - ARMI_LS_W = 0x00200000, - ARMI_LS_U = 0x00800000, - ARMI_LS_P = 0x01000000, - ARMI_LS_R = 0x02000000, - ARMI_LSX_I = 0x00400000, - - ARMI_AND = 0xe0000000, - ARMI_EOR = 0xe0200000, - ARMI_SUB = 0xe0400000, - ARMI_RSB = 0xe0600000, - ARMI_ADD = 0xe0800000, - ARMI_ADC = 0xe0a00000, - ARMI_SBC = 0xe0c00000, - ARMI_RSC = 0xe0e00000, - ARMI_TST = 0xe1100000, - ARMI_TEQ = 0xe1300000, - ARMI_CMP = 0xe1500000, - ARMI_CMN = 0xe1700000, - ARMI_ORR = 0xe1800000, - ARMI_MOV = 0xe1a00000, - ARMI_BIC = 0xe1c00000, - ARMI_MVN = 0xe1e00000, - - ARMI_NOP = 0xe1a00000, - - ARMI_MUL = 0xe0000090, - ARMI_SMULL = 0xe0c00090, - - ARMI_LDR = 0xe4100000, - ARMI_LDRB = 0xe4500000, - ARMI_LDRH = 0xe01000b0, - ARMI_LDRSB = 0xe01000d0, - ARMI_LDRSH = 0xe01000f0, - ARMI_LDRD = 0xe00000d0, - ARMI_STR = 0xe4000000, - ARMI_STRB = 0xe4400000, - ARMI_STRH = 0xe00000b0, - ARMI_STRD = 0xe00000f0, - ARMI_PUSH = 0xe92d0000, - - ARMI_B = 0xea000000, - ARMI_BL = 0xeb000000, - ARMI_BLX = 0xfa000000, - ARMI_BLXr = 0xe12fff30, - - /* ARMv6 */ - ARMI_REV = 0xe6bf0f30, - ARMI_SXTB = 0xe6af0070, - ARMI_SXTH = 0xe6bf0070, - ARMI_UXTB = 0xe6ef0070, - ARMI_UXTH = 0xe6ff0070, - - /* ARMv6T2 */ - ARMI_MOVW = 0xe3000000, - ARMI_MOVT = 0xe3400000, - - /* VFP */ - ARMI_VMOV_D = 0xeeb00b40, - ARMI_VMOV_S = 0xeeb00a40, - ARMI_VMOVI_D = 0xeeb00b00, - - ARMI_VMOV_R_S = 0xee100a10, - ARMI_VMOV_S_R = 0xee000a10, - ARMI_VMOV_RR_D = 0xec500b10, - ARMI_VMOV_D_RR = 0xec400b10, - - ARMI_VADD_D = 0xee300b00, - ARMI_VSUB_D = 0xee300b40, - ARMI_VMUL_D = 0xee200b00, - ARMI_VMLA_D = 0xee000b00, - ARMI_VMLS_D = 0xee000b40, - ARMI_VNMLS_D = 0xee100b00, - ARMI_VDIV_D = 0xee800b00, - - ARMI_VABS_D = 0xeeb00bc0, - ARMI_VNEG_D = 0xeeb10b40, - ARMI_VSQRT_D = 0xeeb10bc0, - - ARMI_VCMP_D = 0xeeb40b40, - ARMI_VCMPZ_D = 0xeeb50b40, - - ARMI_VMRS = 0xeef1fa10, - - ARMI_VCVT_S32_F32 = 0xeebd0ac0, - ARMI_VCVT_S32_F64 = 0xeebd0bc0, - ARMI_VCVT_U32_F32 = 0xeebc0ac0, - ARMI_VCVT_U32_F64 = 0xeebc0bc0, - ARMI_VCVTR_S32_F32 = 0xeebd0a40, - ARMI_VCVTR_S32_F64 = 0xeebd0b40, - ARMI_VCVTR_U32_F32 = 0xeebc0a40, - ARMI_VCVTR_U32_F64 = 0xeebc0b40, - ARMI_VCVT_F32_S32 = 0xeeb80ac0, - ARMI_VCVT_F64_S32 = 0xeeb80bc0, - ARMI_VCVT_F32_U32 = 0xeeb80a40, - ARMI_VCVT_F64_U32 = 0xeeb80b40, - ARMI_VCVT_F32_F64 = 0xeeb70bc0, - ARMI_VCVT_F64_F32 = 0xeeb70ac0, - - ARMI_VLDR_S = 0xed100a00, - ARMI_VLDR_D = 0xed100b00, - ARMI_VSTR_S = 0xed000a00, - ARMI_VSTR_D = 0xed000b00, -} ARMIns; - -typedef enum ARMShift { - ARMSH_LSL, ARMSH_LSR, ARMSH_ASR, ARMSH_ROR -} ARMShift; - -/* ARM condition codes. */ -typedef enum ARMCC { - CC_EQ, CC_NE, CC_CS, CC_CC, CC_MI, CC_PL, CC_VS, CC_VC, - CC_HI, CC_LS, CC_GE, CC_LT, CC_GT, CC_LE, CC_AL, - CC_HS = CC_CS, CC_LO = CC_CC -} ARMCC; - -#endif diff --git a/subprojects/luajit/src/lj_target_mips.h b/subprojects/luajit/src/lj_target_mips.h deleted file mode 100644 index bed174b8e..000000000 --- a/subprojects/luajit/src/lj_target_mips.h +++ /dev/null @@ -1,258 +0,0 @@ -/* -** Definitions for MIPS CPUs. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_TARGET_MIPS_H -#define _LJ_TARGET_MIPS_H - -/* -- Registers IDs ------------------------------------------------------- */ - -#define GPRDEF(_) \ - _(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) _(SYS1) _(SYS2) _(R28) _(SP) _(R30) _(RA) -#define FPRDEF(_) \ - _(F0) _(F1) _(F2) _(F3) _(F4) _(F5) _(F6) _(F7) \ - _(F8) _(F9) _(F10) _(F11) _(F12) _(F13) _(F14) _(F15) \ - _(F16) _(F17) _(F18) _(F19) _(F20) _(F21) _(F22) _(F23) \ - _(F24) _(F25) _(F26) _(F27) _(F28) _(F29) _(F30) _(F31) -#define VRIDDEF(_) - -#define RIDENUM(name) RID_##name, - -enum { - GPRDEF(RIDENUM) /* General-purpose registers (GPRs). */ - FPRDEF(RIDENUM) /* Floating-point registers (FPRs). */ - RID_MAX, - RID_ZERO = RID_R0, - RID_TMP = RID_RA, - RID_GP = RID_R28, - - /* Calling conventions. */ - RID_RET = RID_R2, -#if LJ_LE - RID_RETHI = RID_R3, - RID_RETLO = RID_R2, -#else - RID_RETHI = RID_R2, - RID_RETLO = RID_R3, -#endif - RID_FPRET = RID_F0, - RID_CFUNCADDR = RID_R25, - - /* These definitions must match with the *.dasc file(s): */ - RID_BASE = RID_R16, /* Interpreter BASE. */ - RID_LPC = RID_R18, /* Interpreter PC. */ - RID_DISPATCH = RID_R19, /* Interpreter DISPATCH table. */ - RID_LREG = RID_R20, /* Interpreter L. */ - RID_JGL = RID_R30, /* On-trace: global_State + 32768. */ - - /* Register ranges [min, max) and number of registers. */ - RID_MIN_GPR = RID_R0, - RID_MAX_GPR = RID_RA+1, - RID_MIN_FPR = RID_F0, - RID_MAX_FPR = RID_F31+1, - RID_NUM_GPR = RID_MAX_GPR - RID_MIN_GPR, - RID_NUM_FPR = RID_MAX_FPR - RID_MIN_FPR /* Only even regs are used. */ -}; - -#define RID_NUM_KREF RID_NUM_GPR -#define RID_MIN_KREF RID_R0 - -/* -- Register sets ------------------------------------------------------- */ - -/* Make use of all registers, except ZERO, TMP, SP, SYS1, SYS2, JGL and GP. */ -#define RSET_FIXED \ - (RID2RSET(RID_ZERO)|RID2RSET(RID_TMP)|RID2RSET(RID_SP)|\ - RID2RSET(RID_SYS1)|RID2RSET(RID_SYS2)|RID2RSET(RID_JGL)|RID2RSET(RID_GP)) -#define RSET_GPR (RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR) - RSET_FIXED) -#define RSET_FPR \ - (RID2RSET(RID_F0)|RID2RSET(RID_F2)|RID2RSET(RID_F4)|RID2RSET(RID_F6)|\ - RID2RSET(RID_F8)|RID2RSET(RID_F10)|RID2RSET(RID_F12)|RID2RSET(RID_F14)|\ - RID2RSET(RID_F16)|RID2RSET(RID_F18)|RID2RSET(RID_F20)|RID2RSET(RID_F22)|\ - RID2RSET(RID_F24)|RID2RSET(RID_F26)|RID2RSET(RID_F28)|RID2RSET(RID_F30)) -#define RSET_ALL (RSET_GPR|RSET_FPR) -#define RSET_INIT RSET_ALL - -#define RSET_SCRATCH_GPR \ - (RSET_RANGE(RID_R1, RID_R15+1)|\ - RID2RSET(RID_R24)|RID2RSET(RID_R25)) -#define RSET_SCRATCH_FPR \ - (RID2RSET(RID_F0)|RID2RSET(RID_F2)|RID2RSET(RID_F4)|RID2RSET(RID_F6)|\ - RID2RSET(RID_F8)|RID2RSET(RID_F10)|RID2RSET(RID_F12)|RID2RSET(RID_F14)|\ - RID2RSET(RID_F16)|RID2RSET(RID_F18)) -#define RSET_SCRATCH (RSET_SCRATCH_GPR|RSET_SCRATCH_FPR) -#define REGARG_FIRSTGPR RID_R4 -#define REGARG_LASTGPR RID_R7 -#define REGARG_NUMGPR 4 -#define REGARG_FIRSTFPR RID_F12 -#define REGARG_LASTFPR RID_F14 -#define REGARG_NUMFPR 2 - -/* -- Spill slots --------------------------------------------------------- */ - -/* Spill slots are 32 bit wide. An even/odd pair is used for FPRs. -** -** SPS_FIXED: Available fixed spill slots in interpreter frame. -** This definition must match with the *.dasc file(s). -** -** SPS_FIRST: First spill slot for general use. -*/ -#define SPS_FIXED 5 -#define SPS_FIRST 4 - -#define SPOFS_TMP 0 - -#define sps_scale(slot) (4 * (int32_t)(slot)) -#define sps_align(slot) (((slot) - SPS_FIXED + 1) & ~1) - -/* -- Exit state ---------------------------------------------------------- */ - -/* This definition must match with the *.dasc file(s). */ -typedef struct { - lua_Number fpr[RID_NUM_FPR]; /* Floating-point registers. */ - int32_t gpr[RID_NUM_GPR]; /* General-purpose registers. */ - int32_t spill[256]; /* Spill slots. */ -} ExitState; - -/* Highest exit + 1 indicates stack check. */ -#define EXITSTATE_CHECKEXIT 1 - -/* Return the address of a per-trace exit stub. */ -static LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p) -{ - while (*p == 0x00000000) p++; /* Skip MIPSI_NOP. */ - return p; -} -/* Avoid dependence on lj_jit.h if only including lj_target.h. */ -#define exitstub_trace_addr(T, exitno) \ - exitstub_trace_addr_((MCode *)((char *)(T)->mcode + (T)->szmcode)) - -/* -- Instructions -------------------------------------------------------- */ - -/* Instruction fields. */ -#define MIPSF_S(r) ((r) << 21) -#define MIPSF_T(r) ((r) << 16) -#define MIPSF_D(r) ((r) << 11) -#define MIPSF_R(r) ((r) << 21) -#define MIPSF_H(r) ((r) << 16) -#define MIPSF_G(r) ((r) << 11) -#define MIPSF_F(r) ((r) << 6) -#define MIPSF_A(n) ((n) << 6) -#define MIPSF_M(n) ((n) << 11) - -typedef enum MIPSIns { - /* Integer instructions. */ - MIPSI_MOVE = 0x00000021, - MIPSI_NOP = 0x00000000, - - MIPSI_LI = 0x24000000, - MIPSI_LU = 0x34000000, - MIPSI_LUI = 0x3c000000, - - MIPSI_ADDIU = 0x24000000, - MIPSI_ANDI = 0x30000000, - MIPSI_ORI = 0x34000000, - MIPSI_XORI = 0x38000000, - MIPSI_SLTI = 0x28000000, - MIPSI_SLTIU = 0x2c000000, - - MIPSI_ADDU = 0x00000021, - MIPSI_SUBU = 0x00000023, - MIPSI_MUL = 0x70000002, - MIPSI_AND = 0x00000024, - MIPSI_OR = 0x00000025, - MIPSI_XOR = 0x00000026, - MIPSI_NOR = 0x00000027, - MIPSI_SLT = 0x0000002a, - MIPSI_SLTU = 0x0000002b, - MIPSI_MOVZ = 0x0000000a, - MIPSI_MOVN = 0x0000000b, - - MIPSI_SLL = 0x00000000, - MIPSI_SRL = 0x00000002, - MIPSI_SRA = 0x00000003, - MIPSI_ROTR = 0x00200002, /* MIPS32R2 */ - MIPSI_SLLV = 0x00000004, - MIPSI_SRLV = 0x00000006, - MIPSI_SRAV = 0x00000007, - MIPSI_ROTRV = 0x00000046, /* MIPS32R2 */ - - MIPSI_SEB = 0x7c000420, /* MIPS32R2 */ - MIPSI_SEH = 0x7c000620, /* MIPS32R2 */ - MIPSI_WSBH = 0x7c0000a0, /* MIPS32R2 */ - - MIPSI_B = 0x10000000, - MIPSI_J = 0x08000000, - MIPSI_JAL = 0x0c000000, - MIPSI_JR = 0x00000008, - MIPSI_JALR = 0x0000f809, - - MIPSI_BEQ = 0x10000000, - MIPSI_BNE = 0x14000000, - MIPSI_BLEZ = 0x18000000, - MIPSI_BGTZ = 0x1c000000, - MIPSI_BLTZ = 0x04000000, - MIPSI_BGEZ = 0x04010000, - - /* Load/store instructions. */ - MIPSI_LW = 0x8c000000, - MIPSI_SW = 0xac000000, - MIPSI_LB = 0x80000000, - MIPSI_SB = 0xa0000000, - MIPSI_LH = 0x84000000, - MIPSI_SH = 0xa4000000, - MIPSI_LBU = 0x90000000, - MIPSI_LHU = 0x94000000, - MIPSI_LWC1 = 0xc4000000, - MIPSI_SWC1 = 0xe4000000, - MIPSI_LDC1 = 0xd4000000, - MIPSI_SDC1 = 0xf4000000, - - /* FP instructions. */ - MIPSI_MOV_S = 0x46000006, - MIPSI_MOV_D = 0x46200006, - MIPSI_MOVT_D = 0x46210011, - MIPSI_MOVF_D = 0x46200011, - - MIPSI_ABS_D = 0x46200005, - MIPSI_NEG_D = 0x46200007, - - MIPSI_ADD_D = 0x46200000, - MIPSI_SUB_D = 0x46200001, - MIPSI_MUL_D = 0x46200002, - MIPSI_DIV_D = 0x46200003, - MIPSI_SQRT_D = 0x46200004, - - MIPSI_ADD_S = 0x46000000, - MIPSI_SUB_S = 0x46000001, - - MIPSI_CVT_D_S = 0x46000021, - MIPSI_CVT_W_S = 0x46000024, - MIPSI_CVT_S_D = 0x46200020, - MIPSI_CVT_W_D = 0x46200024, - MIPSI_CVT_S_W = 0x46800020, - MIPSI_CVT_D_W = 0x46800021, - - MIPSI_TRUNC_W_S = 0x4600000d, - MIPSI_TRUNC_W_D = 0x4620000d, - MIPSI_FLOOR_W_S = 0x4600000f, - MIPSI_FLOOR_W_D = 0x4620000f, - - MIPSI_MFC1 = 0x44000000, - MIPSI_MTC1 = 0x44800000, - - MIPSI_BC1F = 0x45000000, - MIPSI_BC1T = 0x45010000, - - MIPSI_C_EQ_D = 0x46200032, - MIPSI_C_OLT_D = 0x46200034, - MIPSI_C_ULT_D = 0x46200035, - MIPSI_C_OLE_D = 0x46200036, - MIPSI_C_ULE_D = 0x46200037, - -} MIPSIns; - -#endif diff --git a/subprojects/luajit/src/lj_target_ppc.h b/subprojects/luajit/src/lj_target_ppc.h deleted file mode 100644 index e57e27dfd..000000000 --- a/subprojects/luajit/src/lj_target_ppc.h +++ /dev/null @@ -1,280 +0,0 @@ -/* -** Definitions for PPC CPUs. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_TARGET_PPC_H -#define _LJ_TARGET_PPC_H - -/* -- Registers IDs ------------------------------------------------------- */ - -#define GPRDEF(_) \ - _(R0) _(SP) _(SYS1) _(R3) _(R4) _(R5) _(R6) _(R7) \ - _(R8) _(R9) _(R10) _(R11) _(R12) _(SYS2) _(R14) _(R15) \ - _(R16) _(R17) _(R18) _(R19) _(R20) _(R21) _(R22) _(R23) \ - _(R24) _(R25) _(R26) _(R27) _(R28) _(R29) _(R30) _(R31) -#define FPRDEF(_) \ - _(F0) _(F1) _(F2) _(F3) _(F4) _(F5) _(F6) _(F7) \ - _(F8) _(F9) _(F10) _(F11) _(F12) _(F13) _(F14) _(F15) \ - _(F16) _(F17) _(F18) _(F19) _(F20) _(F21) _(F22) _(F23) \ - _(F24) _(F25) _(F26) _(F27) _(F28) _(F29) _(F30) _(F31) -#define VRIDDEF(_) - -#define RIDENUM(name) RID_##name, - -enum { - GPRDEF(RIDENUM) /* General-purpose registers (GPRs). */ - FPRDEF(RIDENUM) /* Floating-point registers (FPRs). */ - RID_MAX, - RID_TMP = RID_R0, - - /* Calling conventions. */ - RID_RET = RID_R3, - RID_RETHI = RID_R3, - RID_RETLO = RID_R4, - RID_FPRET = RID_F1, - - /* These definitions must match with the *.dasc file(s): */ - RID_BASE = RID_R14, /* Interpreter BASE. */ - RID_LPC = RID_R16, /* Interpreter PC. */ - RID_DISPATCH = RID_R17, /* Interpreter DISPATCH table. */ - RID_LREG = RID_R18, /* Interpreter L. */ - RID_JGL = RID_R31, /* On-trace: global_State + 32768. */ - - /* Register ranges [min, max) and number of registers. */ - RID_MIN_GPR = RID_R0, - RID_MAX_GPR = RID_R31+1, - RID_MIN_FPR = RID_F0, - RID_MAX_FPR = RID_F31+1, - RID_NUM_GPR = RID_MAX_GPR - RID_MIN_GPR, - RID_NUM_FPR = RID_MAX_FPR - RID_MIN_FPR -}; - -#define RID_NUM_KREF RID_NUM_GPR -#define RID_MIN_KREF RID_R0 - -/* -- Register sets ------------------------------------------------------- */ - -/* Make use of all registers, except TMP, SP, SYS1, SYS2 and JGL. */ -#define RSET_FIXED \ - (RID2RSET(RID_TMP)|RID2RSET(RID_SP)|RID2RSET(RID_SYS1)|\ - RID2RSET(RID_SYS2)|RID2RSET(RID_JGL)) -#define RSET_GPR (RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR) - RSET_FIXED) -#define RSET_FPR RSET_RANGE(RID_MIN_FPR, RID_MAX_FPR) -#define RSET_ALL (RSET_GPR|RSET_FPR) -#define RSET_INIT RSET_ALL - -#define RSET_SCRATCH_GPR (RSET_RANGE(RID_R3, RID_R12+1)) -#define RSET_SCRATCH_FPR (RSET_RANGE(RID_F0, RID_F13+1)) -#define RSET_SCRATCH (RSET_SCRATCH_GPR|RSET_SCRATCH_FPR) -#define REGARG_FIRSTGPR RID_R3 -#define REGARG_LASTGPR RID_R10 -#define REGARG_NUMGPR 8 -#define REGARG_FIRSTFPR RID_F1 -#define REGARG_LASTFPR RID_F8 -#define REGARG_NUMFPR 8 - -/* -- Spill slots --------------------------------------------------------- */ - -/* Spill slots are 32 bit wide. An even/odd pair is used for FPRs. -** -** SPS_FIXED: Available fixed spill slots in interpreter frame. -** This definition must match with the *.dasc file(s). -** -** SPS_FIRST: First spill slot for general use. -** [sp+12] tmplo word \ -** [sp+ 8] tmphi word / tmp dword, parameter area for callee -** [sp+ 4] tmpw, LR of callee -** [sp+ 0] stack chain -*/ -#define SPS_FIXED 7 -#define SPS_FIRST 4 - -/* Stack offsets for temporary slots. Used for FP<->int conversions etc. */ -#define SPOFS_TMPW 4 -#define SPOFS_TMP 8 -#define SPOFS_TMPHI 8 -#define SPOFS_TMPLO 12 - -#define sps_scale(slot) (4 * (int32_t)(slot)) -#define sps_align(slot) (((slot) - SPS_FIXED + 3) & ~3) - -/* -- Exit state ---------------------------------------------------------- */ - -/* This definition must match with the *.dasc file(s). */ -typedef struct { - lua_Number fpr[RID_NUM_FPR]; /* Floating-point registers. */ - int32_t gpr[RID_NUM_GPR]; /* General-purpose registers. */ - int32_t spill[256]; /* Spill slots. */ -} ExitState; - -/* Highest exit + 1 indicates stack check. */ -#define EXITSTATE_CHECKEXIT 1 - -/* Return the address of a per-trace exit stub. */ -static LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p, uint32_t exitno) -{ - while (*p == 0x60000000) p++; /* Skip PPCI_NOP. */ - return p + 3 + exitno; -} -/* Avoid dependence on lj_jit.h if only including lj_target.h. */ -#define exitstub_trace_addr(T, exitno) \ - exitstub_trace_addr_((MCode *)((char *)(T)->mcode + (T)->szmcode), (exitno)) - -/* -- Instructions -------------------------------------------------------- */ - -/* Instruction fields. */ -#define PPCF_CC(cc) ((((cc) & 3) << 16) | (((cc) & 4) << 22)) -#define PPCF_T(r) ((r) << 21) -#define PPCF_A(r) ((r) << 16) -#define PPCF_B(r) ((r) << 11) -#define PPCF_C(r) ((r) << 6) -#define PPCF_MB(n) ((n) << 6) -#define PPCF_ME(n) ((n) << 1) -#define PPCF_Y 0x00200000 -#define PPCF_DOT 0x00000001 - -typedef enum PPCIns { - /* Integer instructions. */ - PPCI_MR = 0x7c000378, - PPCI_NOP = 0x60000000, - - PPCI_LI = 0x38000000, - PPCI_LIS = 0x3c000000, - - PPCI_ADD = 0x7c000214, - PPCI_ADDC = 0x7c000014, - PPCI_ADDO = 0x7c000614, - PPCI_ADDE = 0x7c000114, - PPCI_ADDZE = 0x7c000194, - PPCI_ADDME = 0x7c0001d4, - PPCI_ADDI = 0x38000000, - PPCI_ADDIS = 0x3c000000, - PPCI_ADDIC = 0x30000000, - PPCI_ADDICDOT = 0x34000000, - - PPCI_SUBF = 0x7c000050, - PPCI_SUBFC = 0x7c000010, - PPCI_SUBFO = 0x7c000450, - PPCI_SUBFE = 0x7c000110, - PPCI_SUBFZE = 0x7c000190, - PPCI_SUBFME = 0x7c0001d0, - PPCI_SUBFIC = 0x20000000, - - PPCI_NEG = 0x7c0000d0, - - PPCI_AND = 0x7c000038, - PPCI_ANDC = 0x7c000078, - PPCI_NAND = 0x7c0003b8, - PPCI_ANDIDOT = 0x70000000, - PPCI_ANDISDOT = 0x74000000, - - PPCI_OR = 0x7c000378, - PPCI_NOR = 0x7c0000f8, - PPCI_ORI = 0x60000000, - PPCI_ORIS = 0x64000000, - - PPCI_XOR = 0x7c000278, - PPCI_EQV = 0x7c000238, - PPCI_XORI = 0x68000000, - PPCI_XORIS = 0x6c000000, - - PPCI_CMPW = 0x7c000000, - PPCI_CMPLW = 0x7c000040, - PPCI_CMPWI = 0x2c000000, - PPCI_CMPLWI = 0x28000000, - - PPCI_MULLW = 0x7c0001d6, - PPCI_MULLI = 0x1c000000, - PPCI_MULLWO = 0x7c0005d6, - - PPCI_EXTSB = 0x7c000774, - PPCI_EXTSH = 0x7c000734, - - PPCI_SLW = 0x7c000030, - PPCI_SRW = 0x7c000430, - PPCI_SRAW = 0x7c000630, - PPCI_SRAWI = 0x7c000670, - - PPCI_RLWNM = 0x5c000000, - PPCI_RLWINM = 0x54000000, - PPCI_RLWIMI = 0x50000000, - - PPCI_B = 0x48000000, - PPCI_BL = 0x48000001, - PPCI_BC = 0x40800000, - PPCI_BCL = 0x40800001, - PPCI_BCTR = 0x4e800420, - PPCI_BCTRL = 0x4e800421, - - PPCI_CRANDC = 0x4c000102, - PPCI_CRXOR = 0x4c000182, - PPCI_CRAND = 0x4c000202, - PPCI_CREQV = 0x4c000242, - PPCI_CRORC = 0x4c000342, - PPCI_CROR = 0x4c000382, - - PPCI_MFLR = 0x7c0802a6, - PPCI_MTCTR = 0x7c0903a6, - - PPCI_MCRXR = 0x7c000400, - - /* Load/store instructions. */ - PPCI_LWZ = 0x80000000, - PPCI_LBZ = 0x88000000, - PPCI_STW = 0x90000000, - PPCI_STB = 0x98000000, - PPCI_LHZ = 0xa0000000, - PPCI_LHA = 0xa8000000, - PPCI_STH = 0xb0000000, - - PPCI_STWU = 0x94000000, - - PPCI_LFS = 0xc0000000, - PPCI_LFD = 0xc8000000, - PPCI_STFS = 0xd0000000, - PPCI_STFD = 0xd8000000, - - PPCI_LWZX = 0x7c00002e, - PPCI_LBZX = 0x7c0000ae, - PPCI_STWX = 0x7c00012e, - PPCI_STBX = 0x7c0001ae, - PPCI_LHZX = 0x7c00022e, - PPCI_LHAX = 0x7c0002ae, - PPCI_STHX = 0x7c00032e, - - PPCI_LWBRX = 0x7c00042c, - PPCI_STWBRX = 0x7c00052c, - - PPCI_LFSX = 0x7c00042e, - PPCI_LFDX = 0x7c0004ae, - PPCI_STFSX = 0x7c00052e, - PPCI_STFDX = 0x7c0005ae, - - /* FP instructions. */ - PPCI_FMR = 0xfc000090, - PPCI_FNEG = 0xfc000050, - PPCI_FABS = 0xfc000210, - - PPCI_FRSP = 0xfc000018, - PPCI_FCTIWZ = 0xfc00001e, - - PPCI_FADD = 0xfc00002a, - PPCI_FSUB = 0xfc000028, - PPCI_FMUL = 0xfc000032, - PPCI_FDIV = 0xfc000024, - PPCI_FSQRT = 0xfc00002c, - - PPCI_FMADD = 0xfc00003a, - PPCI_FMSUB = 0xfc000038, - PPCI_FNMSUB = 0xfc00003c, - - PPCI_FCMPU = 0xfc000000, - PPCI_FSEL = 0xfc00002e, -} PPCIns; - -typedef enum PPCCC { - CC_GE, CC_LE, CC_NE, CC_NS, CC_LT, CC_GT, CC_EQ, CC_SO -} PPCCC; - -#endif diff --git a/subprojects/luajit/src/lj_target_x86.h b/subprojects/luajit/src/lj_target_x86.h deleted file mode 100644 index 4426cc8ce..000000000 --- a/subprojects/luajit/src/lj_target_x86.h +++ /dev/null @@ -1,342 +0,0 @@ -/* -** Definitions for x86 and x64 CPUs. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_TARGET_X86_H -#define _LJ_TARGET_X86_H - -/* -- Registers IDs ------------------------------------------------------- */ - -#if LJ_64 -#define GPRDEF(_) \ - _(EAX) _(ECX) _(EDX) _(EBX) _(ESP) _(EBP) _(ESI) _(EDI) \ - _(R8D) _(R9D) _(R10D) _(R11D) _(R12D) _(R13D) _(R14D) _(R15D) -#define FPRDEF(_) \ - _(XMM0) _(XMM1) _(XMM2) _(XMM3) _(XMM4) _(XMM5) _(XMM6) _(XMM7) \ - _(XMM8) _(XMM9) _(XMM10) _(XMM11) _(XMM12) _(XMM13) _(XMM14) _(XMM15) -#else -#define GPRDEF(_) \ - _(EAX) _(ECX) _(EDX) _(EBX) _(ESP) _(EBP) _(ESI) _(EDI) -#define FPRDEF(_) \ - _(XMM0) _(XMM1) _(XMM2) _(XMM3) _(XMM4) _(XMM5) _(XMM6) _(XMM7) -#endif -#define VRIDDEF(_) \ - _(MRM) - -#define RIDENUM(name) RID_##name, - -enum { - GPRDEF(RIDENUM) /* General-purpose registers (GPRs). */ - FPRDEF(RIDENUM) /* Floating-point registers (FPRs). */ - RID_MAX, - RID_MRM = RID_MAX, /* Pseudo-id for ModRM operand. */ - - /* Calling conventions. */ - RID_RET = RID_EAX, -#if LJ_64 - RID_FPRET = RID_XMM0, -#else - RID_RETLO = RID_EAX, - RID_RETHI = RID_EDX, -#endif - - /* These definitions must match with the *.dasc file(s): */ - RID_BASE = RID_EDX, /* Interpreter BASE. */ -#if LJ_64 && !LJ_ABI_WIN - RID_LPC = RID_EBX, /* Interpreter PC. */ - RID_DISPATCH = RID_R14D, /* Interpreter DISPATCH table. */ -#else - RID_LPC = RID_ESI, /* Interpreter PC. */ - RID_DISPATCH = RID_EBX, /* Interpreter DISPATCH table. */ -#endif - - /* Register ranges [min, max) and number of registers. */ - RID_MIN_GPR = RID_EAX, - RID_MIN_FPR = RID_XMM0, - RID_MAX_GPR = RID_MIN_FPR, - RID_MAX_FPR = RID_MAX, - RID_NUM_GPR = RID_MAX_GPR - RID_MIN_GPR, - RID_NUM_FPR = RID_MAX_FPR - RID_MIN_FPR, -}; - -/* -- Register sets ------------------------------------------------------- */ - -/* Make use of all registers, except the stack pointer. */ -#define RSET_GPR (RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR)-RID2RSET(RID_ESP)) -#define RSET_FPR (RSET_RANGE(RID_MIN_FPR, RID_MAX_FPR)) -#define RSET_ALL (RSET_GPR|RSET_FPR) -#define RSET_INIT RSET_ALL - -#if LJ_64 -/* Note: this requires the use of FORCE_REX! */ -#define RSET_GPR8 RSET_GPR -#else -#define RSET_GPR8 (RSET_RANGE(RID_EAX, RID_EBX+1)) -#endif - -/* ABI-specific register sets. */ -#define RSET_ACD (RID2RSET(RID_EAX)|RID2RSET(RID_ECX)|RID2RSET(RID_EDX)) -#if LJ_64 -#if LJ_ABI_WIN -/* Windows x64 ABI. */ -#define RSET_SCRATCH \ - (RSET_ACD|RSET_RANGE(RID_R8D, RID_R11D+1)|RSET_RANGE(RID_XMM0, RID_XMM5+1)) -#define REGARG_GPRS \ - (RID_ECX|((RID_EDX|((RID_R8D|(RID_R9D<<5))<<5))<<5)) -#define REGARG_NUMGPR 4 -#define REGARG_NUMFPR 4 -#define REGARG_FIRSTFPR RID_XMM0 -#define REGARG_LASTFPR RID_XMM3 -#define STACKARG_OFS (4*8) -#else -/* The rest of the civilized x64 world has a common ABI. */ -#define RSET_SCRATCH \ - (RSET_ACD|RSET_RANGE(RID_ESI, RID_R11D+1)|RSET_FPR) -#define REGARG_GPRS \ - (RID_EDI|((RID_ESI|((RID_EDX|((RID_ECX|((RID_R8D|(RID_R9D \ - <<5))<<5))<<5))<<5))<<5)) -#define REGARG_NUMGPR 6 -#define REGARG_NUMFPR 8 -#define REGARG_FIRSTFPR RID_XMM0 -#define REGARG_LASTFPR RID_XMM7 -#define STACKARG_OFS 0 -#endif -#else -/* Common x86 ABI. */ -#define RSET_SCRATCH (RSET_ACD|RSET_FPR) -#define REGARG_GPRS (RID_ECX|(RID_EDX<<5)) /* Fastcall only. */ -#define REGARG_NUMGPR 2 /* Fastcall only. */ -#define REGARG_NUMFPR 0 -#define STACKARG_OFS 0 -#endif - -#if LJ_64 -/* Prefer the low 8 regs of each type to reduce REX prefixes. */ -#undef rset_picktop -#define rset_picktop(rs) (lj_fls(lj_bswap(rs)) ^ 0x18) -#endif - -/* -- Spill slots --------------------------------------------------------- */ - -/* Spill slots are 32 bit wide. An even/odd pair is used for FPRs. -** -** SPS_FIXED: Available fixed spill slots in interpreter frame. -** This definition must match with the *.dasc file(s). -** -** SPS_FIRST: First spill slot for general use. Reserve min. two 32 bit slots. -*/ -#if LJ_64 -#if LJ_ABI_WIN -#define SPS_FIXED (4*2) -#define SPS_FIRST (4*2) /* Don't use callee register save area. */ -#else -#define SPS_FIXED 4 -#define SPS_FIRST 2 -#endif -#else -#define SPS_FIXED 6 -#define SPS_FIRST 2 -#endif - -#define SPOFS_TMP 0 - -#define sps_scale(slot) (4 * (int32_t)(slot)) -#define sps_align(slot) (((slot) - SPS_FIXED + 3) & ~3) - -/* -- Exit state ---------------------------------------------------------- */ - -/* This definition must match with the *.dasc file(s). */ -typedef struct { - lua_Number fpr[RID_NUM_FPR]; /* Floating-point registers. */ - intptr_t gpr[RID_NUM_GPR]; /* General-purpose registers. */ - int32_t spill[256]; /* Spill slots. */ -} ExitState; - -/* Limited by the range of a short fwd jump (127): (2+2)*(32-1)-2 = 122. */ -#define EXITSTUB_SPACING (2+2) -#define EXITSTUBS_PER_GROUP 32 - -/* -- x86 ModRM operand encoding ------------------------------------------ */ - -typedef enum { - XM_OFS0 = 0x00, XM_OFS8 = 0x40, XM_OFS32 = 0x80, XM_REG = 0xc0, - XM_SCALE1 = 0x00, XM_SCALE2 = 0x40, XM_SCALE4 = 0x80, XM_SCALE8 = 0xc0, - XM_MASK = 0xc0 -} x86Mode; - -/* Structure to hold variable ModRM operand. */ -typedef struct { - int32_t ofs; /* Offset. */ - uint8_t base; /* Base register or RID_NONE. */ - uint8_t idx; /* Index register or RID_NONE. */ - uint8_t scale; /* Index scale (XM_SCALE1 .. XM_SCALE8). */ -} x86ModRM; - -/* -- Opcodes ------------------------------------------------------------- */ - -/* Macros to construct variable-length x86 opcodes. -(len+1) is in LSB. */ -#define XO_(o) ((uint32_t)(0x0000fe + (0x##o<<24))) -#define XO_FPU(a,b) ((uint32_t)(0x00fd + (0x##a<<16)+(0x##b<<24))) -#define XO_0f(o) ((uint32_t)(0x0f00fd + (0x##o<<24))) -#define XO_66(o) ((uint32_t)(0x6600fd + (0x##o<<24))) -#define XO_660f(o) ((uint32_t)(0x0f66fc + (0x##o<<24))) -#define XO_f20f(o) ((uint32_t)(0x0ff2fc + (0x##o<<24))) -#define XO_f30f(o) ((uint32_t)(0x0ff3fc + (0x##o<<24))) - -/* This list of x86 opcodes is not intended to be complete. Opcodes are only -** included when needed. Take a look at DynASM or jit.dis_x86 to see the -** whole mess. -*/ -typedef enum { - /* Fixed length opcodes. XI_* prefix. */ - XI_NOP = 0x90, - XI_XCHGa = 0x90, - XI_CALL = 0xe8, - XI_JMP = 0xe9, - XI_JMPs = 0xeb, - XI_PUSH = 0x50, /* Really 50+r. */ - XI_JCCs = 0x70, /* Really 7x. */ - XI_JCCn = 0x80, /* Really 0f8x. */ - XI_LEA = 0x8d, - XI_MOVrib = 0xb0, /* Really b0+r. */ - XI_MOVri = 0xb8, /* Really b8+r. */ - XI_ARITHib = 0x80, - XI_ARITHi = 0x81, - XI_ARITHi8 = 0x83, - XI_PUSHi8 = 0x6a, - XI_TESTb = 0x84, - XI_TEST = 0x85, - XI_MOVmi = 0xc7, - XI_GROUP5 = 0xff, - - /* Note: little-endian byte-order! */ - XI_FLDZ = 0xeed9, - XI_FLD1 = 0xe8d9, - XI_FLDLG2 = 0xecd9, - XI_FLDLN2 = 0xedd9, - XI_FDUP = 0xc0d9, /* Really fld st0. */ - XI_FPOP = 0xd8dd, /* Really fstp st0. */ - XI_FPOP1 = 0xd9dd, /* Really fstp st1. */ - XI_FRNDINT = 0xfcd9, - XI_FSIN = 0xfed9, - XI_FCOS = 0xffd9, - XI_FPTAN = 0xf2d9, - XI_FPATAN = 0xf3d9, - XI_FSCALE = 0xfdd9, - XI_FYL2X = 0xf1d9, - - /* Variable-length opcodes. XO_* prefix. */ - XO_MOV = XO_(8b), - XO_MOVto = XO_(89), - XO_MOVtow = XO_66(89), - XO_MOVtob = XO_(88), - XO_MOVmi = XO_(c7), - XO_MOVmib = XO_(c6), - XO_LEA = XO_(8d), - XO_ARITHib = XO_(80), - XO_ARITHi = XO_(81), - XO_ARITHi8 = XO_(83), - XO_ARITHiw8 = XO_66(83), - XO_SHIFTi = XO_(c1), - XO_SHIFT1 = XO_(d1), - XO_SHIFTcl = XO_(d3), - XO_IMUL = XO_0f(af), - XO_IMULi = XO_(69), - XO_IMULi8 = XO_(6b), - XO_CMP = XO_(3b), - XO_TESTb = XO_(84), - XO_TEST = XO_(85), - XO_GROUP3b = XO_(f6), - XO_GROUP3 = XO_(f7), - XO_GROUP5b = XO_(fe), - XO_GROUP5 = XO_(ff), - XO_MOVZXb = XO_0f(b6), - XO_MOVZXw = XO_0f(b7), - XO_MOVSXb = XO_0f(be), - XO_MOVSXw = XO_0f(bf), - XO_MOVSXd = XO_(63), - XO_BSWAP = XO_0f(c8), - XO_CMOV = XO_0f(40), - - XO_MOVSD = XO_f20f(10), - XO_MOVSDto = XO_f20f(11), - XO_MOVSS = XO_f30f(10), - XO_MOVSSto = XO_f30f(11), - XO_MOVLPD = XO_660f(12), - XO_MOVAPS = XO_0f(28), - XO_XORPS = XO_0f(57), - XO_ANDPS = XO_0f(54), - XO_ADDSD = XO_f20f(58), - XO_SUBSD = XO_f20f(5c), - XO_MULSD = XO_f20f(59), - XO_DIVSD = XO_f20f(5e), - XO_SQRTSD = XO_f20f(51), - XO_MINSD = XO_f20f(5d), - XO_MAXSD = XO_f20f(5f), - XO_ROUNDSD = 0x0b3a0ffc, /* Really 66 0f 3a 0b. See asm_fpmath. */ - XO_UCOMISD = XO_660f(2e), - XO_CVTSI2SD = XO_f20f(2a), - XO_CVTSD2SI = XO_f20f(2d), - XO_CVTTSD2SI= XO_f20f(2c), - XO_CVTSI2SS = XO_f30f(2a), - XO_CVTSS2SI = XO_f30f(2d), - XO_CVTTSS2SI= XO_f30f(2c), - XO_CVTSS2SD = XO_f30f(5a), - XO_CVTSD2SS = XO_f20f(5a), - XO_ADDSS = XO_f30f(58), - XO_MOVD = XO_660f(6e), - XO_MOVDto = XO_660f(7e), - - XO_FLDd = XO_(d9), XOg_FLDd = 0, - XO_FLDq = XO_(dd), XOg_FLDq = 0, - XO_FILDd = XO_(db), XOg_FILDd = 0, - XO_FILDq = XO_(df), XOg_FILDq = 5, - XO_FSTPd = XO_(d9), XOg_FSTPd = 3, - XO_FSTPq = XO_(dd), XOg_FSTPq = 3, - XO_FISTPq = XO_(df), XOg_FISTPq = 7, - XO_FISTTPq = XO_(dd), XOg_FISTTPq = 1, - XO_FADDq = XO_(dc), XOg_FADDq = 0, - XO_FLDCW = XO_(d9), XOg_FLDCW = 5, - XO_FNSTCW = XO_(d9), XOg_FNSTCW = 7 -} x86Op; - -/* x86 opcode groups. */ -typedef uint32_t x86Group; - -#define XG_(i8, i, g) ((x86Group)(((i8) << 16) + ((i) << 8) + (g))) -#define XG_ARITHi(g) XG_(XI_ARITHi8, XI_ARITHi, g) -#define XG_TOXOi(xg) ((x86Op)(0x000000fe + (((xg)<<16) & 0xff000000))) -#define XG_TOXOi8(xg) ((x86Op)(0x000000fe + (((xg)<<8) & 0xff000000))) - -#define XO_ARITH(a) ((x86Op)(0x030000fe + ((a)<<27))) -#define XO_ARITHw(a) ((x86Op)(0x036600fd + ((a)<<27))) - -typedef enum { - XOg_ADD, XOg_OR, XOg_ADC, XOg_SBB, XOg_AND, XOg_SUB, XOg_XOR, XOg_CMP, - XOg_X_IMUL -} x86Arith; - -typedef enum { - XOg_ROL, XOg_ROR, XOg_RCL, XOg_RCR, XOg_SHL, XOg_SHR, XOg_SAL, XOg_SAR -} x86Shift; - -typedef enum { - XOg_TEST, XOg_TEST_, XOg_NOT, XOg_NEG, XOg_MUL, XOg_IMUL, XOg_DIV, XOg_IDIV -} x86Group3; - -typedef enum { - XOg_INC, XOg_DEC, XOg_CALL, XOg_CALLfar, XOg_JMP, XOg_JMPfar, XOg_PUSH -} x86Group5; - -/* x86 condition codes. */ -typedef enum { - CC_O, CC_NO, CC_B, CC_NB, CC_E, CC_NE, CC_BE, CC_NBE, - CC_S, CC_NS, CC_P, CC_NP, CC_L, CC_NL, CC_LE, CC_NLE, - CC_C = CC_B, CC_NAE = CC_C, CC_NC = CC_NB, CC_AE = CC_NB, - CC_Z = CC_E, CC_NZ = CC_NE, CC_NA = CC_BE, CC_A = CC_NBE, - CC_PE = CC_P, CC_PO = CC_NP, CC_NGE = CC_L, CC_GE = CC_NL, - CC_NG = CC_LE, CC_G = CC_NLE -} x86CC; - -#endif diff --git a/subprojects/luajit/src/lj_trace.c b/subprojects/luajit/src/lj_trace.c deleted file mode 100644 index 6f8dc1a48..000000000 --- a/subprojects/luajit/src/lj_trace.c +++ /dev/null @@ -1,824 +0,0 @@ -/* -** Trace management. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_trace_c -#define LUA_CORE - -#include "lj_obj.h" - -#if LJ_HASJIT - -#include "lj_gc.h" -#include "lj_err.h" -#include "lj_debug.h" -#include "lj_str.h" -#include "lj_frame.h" -#include "lj_state.h" -#include "lj_bc.h" -#include "lj_ir.h" -#include "lj_jit.h" -#include "lj_iropt.h" -#include "lj_mcode.h" -#include "lj_trace.h" -#include "lj_snap.h" -#include "lj_gdbjit.h" -#include "lj_record.h" -#include "lj_asm.h" -#include "lj_dispatch.h" -#include "lj_vm.h" -#include "lj_vmevent.h" -#include "lj_target.h" - -/* -- Error handling ------------------------------------------------------ */ - -/* Synchronous abort with error message. */ -void lj_trace_err(jit_State *J, TraceError e) -{ - setnilV(&J->errinfo); /* No error info. */ - setintV(J->L->top++, (int32_t)e); - lj_err_throw(J->L, LUA_ERRRUN); -} - -/* Synchronous abort with error message and error info. */ -void lj_trace_err_info(jit_State *J, TraceError e) -{ - setintV(J->L->top++, (int32_t)e); - lj_err_throw(J->L, LUA_ERRRUN); -} - -/* -- Trace management ---------------------------------------------------- */ - -/* The current trace is first assembled in J->cur. The variable length -** arrays point to shared, growable buffers (J->irbuf etc.). When trace -** recording ends successfully, the current trace and its data structures -** are copied to a new (compact) GCtrace object. -*/ - -/* Find a free trace number. */ -static TraceNo trace_findfree(jit_State *J) -{ - MSize osz, lim; - if (J->freetrace == 0) - J->freetrace = 1; - for (; J->freetrace < J->sizetrace; J->freetrace++) - if (traceref(J, J->freetrace) == NULL) - return J->freetrace++; - /* Need to grow trace array. */ - lim = (MSize)J->param[JIT_P_maxtrace] + 1; - if (lim < 2) lim = 2; else if (lim > 65535) lim = 65535; - osz = J->sizetrace; - if (osz >= lim) - return 0; /* Too many traces. */ - lj_mem_growvec(J->L, J->trace, J->sizetrace, lim, GCRef); - for (; osz < J->sizetrace; osz++) - setgcrefnull(J->trace[osz]); - return J->freetrace; -} - -#define TRACE_APPENDVEC(field, szfield, tp) \ - T->field = (tp *)p; \ - memcpy(p, J->cur.field, J->cur.szfield*sizeof(tp)); \ - p += J->cur.szfield*sizeof(tp); - -#ifdef LUAJIT_USE_PERFTOOLS -/* -** Create symbol table of JIT-compiled code. For use with Linux perf tools. -** Example usage: -** perf record -f -e cycles luajit test.lua -** perf report -s symbol -** rm perf.data /tmp/perf-*.map -*/ -#include -#include - -static void perftools_addtrace(GCtrace *T) -{ - static FILE *fp; - GCproto *pt = &gcref(T->startpt)->pt; - const BCIns *startpc = mref(T->startpc, const BCIns); - const char *name = proto_chunknamestr(pt); - BCLine lineno; - if (name[0] == '@' || name[0] == '=') - name++; - else - name = "(string)"; - lua_assert(startpc >= proto_bc(pt) && startpc < proto_bc(pt) + pt->sizebc); - lineno = lj_debug_line(pt, proto_bcpos(pt, startpc)); - if (!fp) { - char fname[40]; - sprintf(fname, "/tmp/perf-%d.map", getpid()); - if (!(fp = fopen(fname, "w"))) return; - setlinebuf(fp); - } - fprintf(fp, "%lx %x TRACE_%d::%s:%u\n", - (long)T->mcode, T->szmcode, T->traceno, name, lineno); -} -#endif - -/* Allocate space for copy of trace. */ -static GCtrace *trace_save_alloc(jit_State *J) -{ - size_t sztr = ((sizeof(GCtrace)+7)&~7); - size_t szins = (J->cur.nins-J->cur.nk)*sizeof(IRIns); - size_t sz = sztr + szins + - J->cur.nsnap*sizeof(SnapShot) + - J->cur.nsnapmap*sizeof(SnapEntry); - return lj_mem_newt(J->L, (MSize)sz, GCtrace); -} - -/* Save current trace by copying and compacting it. */ -static void trace_save(jit_State *J, GCtrace *T) -{ - size_t sztr = ((sizeof(GCtrace)+7)&~7); - size_t szins = (J->cur.nins-J->cur.nk)*sizeof(IRIns); - char *p = (char *)T + sztr; - memcpy(T, &J->cur, sizeof(GCtrace)); - setgcrefr(T->nextgc, J2G(J)->gc.root); - setgcrefp(J2G(J)->gc.root, T); - newwhite(J2G(J), T); - T->gct = ~LJ_TTRACE; - T->ir = (IRIns *)p - J->cur.nk; - memcpy(p, J->cur.ir+J->cur.nk, szins); - p += szins; - TRACE_APPENDVEC(snap, nsnap, SnapShot) - TRACE_APPENDVEC(snapmap, nsnapmap, SnapEntry) - J->cur.traceno = 0; - setgcrefp(J->trace[T->traceno], T); - lj_gc_barriertrace(J2G(J), T->traceno); - lj_gdbjit_addtrace(J, T); -#ifdef LUAJIT_USE_PERFTOOLS - perftools_addtrace(T); -#endif -} - -void LJ_FASTCALL lj_trace_free(global_State *g, GCtrace *T) -{ - jit_State *J = G2J(g); - if (T->traceno) { - lj_gdbjit_deltrace(J, T); - if (T->traceno < J->freetrace) - J->freetrace = T->traceno; - setgcrefnull(J->trace[T->traceno]); - } - lj_mem_free(g, T, - ((sizeof(GCtrace)+7)&~7) + (T->nins-T->nk)*sizeof(IRIns) + - T->nsnap*sizeof(SnapShot) + T->nsnapmap*sizeof(SnapEntry)); -} - -/* Re-enable compiling a prototype by unpatching any modified bytecode. */ -void lj_trace_reenableproto(GCproto *pt) -{ - if ((pt->flags & PROTO_ILOOP)) { - BCIns *bc = proto_bc(pt); - BCPos i, sizebc = pt->sizebc;; - pt->flags &= ~PROTO_ILOOP; - if (bc_op(bc[0]) == BC_IFUNCF) - setbc_op(&bc[0], BC_FUNCF); - for (i = 1; i < sizebc; i++) { - BCOp op = bc_op(bc[i]); - if (op == BC_IFORL || op == BC_IITERL || op == BC_ILOOP) - setbc_op(&bc[i], (int)op+(int)BC_LOOP-(int)BC_ILOOP); - } - } -} - -/* Unpatch the bytecode modified by a root trace. */ -static void trace_unpatch(jit_State *J, GCtrace *T) -{ - BCOp op = bc_op(T->startins); - BCIns *pc = mref(T->startpc, BCIns); - UNUSED(J); - if (op == BC_JMP) - return; /* No need to unpatch branches in parent traces (yet). */ - switch (bc_op(*pc)) { - case BC_JFORL: - lua_assert(traceref(J, bc_d(*pc)) == T); - *pc = T->startins; - pc += bc_j(T->startins); - lua_assert(bc_op(*pc) == BC_JFORI); - setbc_op(pc, BC_FORI); - break; - case BC_JITERL: - case BC_JLOOP: - lua_assert(op == BC_ITERL || op == BC_LOOP || bc_isret(op)); - *pc = T->startins; - break; - case BC_JMP: - lua_assert(op == BC_ITERL); - pc += bc_j(*pc)+2; - if (bc_op(*pc) == BC_JITERL) { - lua_assert(traceref(J, bc_d(*pc)) == T); - *pc = T->startins; - } - break; - case BC_JFUNCF: - lua_assert(op == BC_FUNCF); - *pc = T->startins; - break; - default: /* Already unpatched. */ - break; - } -} - -/* Flush a root trace. */ -static void trace_flushroot(jit_State *J, GCtrace *T) -{ - GCproto *pt = &gcref(T->startpt)->pt; - lua_assert(T->root == 0 && pt != NULL); - /* First unpatch any modified bytecode. */ - trace_unpatch(J, T); - /* Unlink root trace from chain anchored in prototype. */ - if (pt->trace == T->traceno) { /* Trace is first in chain. Easy. */ - pt->trace = T->nextroot; - } else if (pt->trace) { /* Otherwise search in chain of root traces. */ - GCtrace *T2 = traceref(J, pt->trace); - if (T2) { - for (; T2->nextroot; T2 = traceref(J, T2->nextroot)) - if (T2->nextroot == T->traceno) { - T2->nextroot = T->nextroot; /* Unlink from chain. */ - break; - } - } - } -} - -/* Flush a trace. Only root traces are considered. */ -void lj_trace_flush(jit_State *J, TraceNo traceno) -{ - if (traceno > 0 && traceno < J->sizetrace) { - GCtrace *T = traceref(J, traceno); - if (T && T->root == 0) - trace_flushroot(J, T); - } -} - -/* Flush all traces associated with a prototype. */ -void lj_trace_flushproto(global_State *g, GCproto *pt) -{ - while (pt->trace != 0) - trace_flushroot(G2J(g), traceref(G2J(g), pt->trace)); -} - -/* Flush all traces. */ -int lj_trace_flushall(lua_State *L) -{ - jit_State *J = L2J(L); - ptrdiff_t i; - if ((J2G(J)->hookmask & HOOK_GC)) - return 1; - for (i = (ptrdiff_t)J->sizetrace-1; i > 0; i--) { - GCtrace *T = traceref(J, i); - if (T) { - if (T->root == 0) - trace_flushroot(J, T); - lj_gdbjit_deltrace(J, T); - T->traceno = 0; - setgcrefnull(J->trace[i]); - } - } - J->cur.traceno = 0; - J->freetrace = 0; - /* Clear penalty cache. */ - memset(J->penalty, 0, sizeof(J->penalty)); - /* Free the whole machine code and invalidate all exit stub groups. */ - lj_mcode_free(J); - memset(J->exitstubgroup, 0, sizeof(J->exitstubgroup)); - lj_vmevent_send(L, TRACE, - setstrV(L, L->top++, lj_str_newlit(L, "flush")); - ); - return 0; -} - -/* Initialize JIT compiler state. */ -void lj_trace_initstate(global_State *g) -{ - jit_State *J = G2J(g); - TValue *tv; - /* Initialize SIMD constants. */ - tv = LJ_KSIMD(J, LJ_KSIMD_ABS); - tv[0].u64 = U64x(7fffffff,ffffffff); - tv[1].u64 = U64x(7fffffff,ffffffff); - tv = LJ_KSIMD(J, LJ_KSIMD_NEG); - tv[0].u64 = U64x(80000000,00000000); - tv[1].u64 = U64x(80000000,00000000); -} - -/* Free everything associated with the JIT compiler state. */ -void lj_trace_freestate(global_State *g) -{ - jit_State *J = G2J(g); -#ifdef LUA_USE_ASSERT - { /* This assumes all traces have already been freed. */ - ptrdiff_t i; - for (i = 1; i < (ptrdiff_t)J->sizetrace; i++) - lua_assert(i == (ptrdiff_t)J->cur.traceno || traceref(J, i) == NULL); - } -#endif - lj_mcode_free(J); - lj_ir_k64_freeall(J); - lj_mem_freevec(g, J->snapmapbuf, J->sizesnapmap, SnapEntry); - lj_mem_freevec(g, J->snapbuf, J->sizesnap, SnapShot); - lj_mem_freevec(g, J->irbuf + J->irbotlim, J->irtoplim - J->irbotlim, IRIns); - lj_mem_freevec(g, J->trace, J->sizetrace, GCRef); -} - -/* -- Penalties and blacklisting ------------------------------------------ */ - -/* Blacklist a bytecode instruction. */ -static void blacklist_pc(GCproto *pt, BCIns *pc) -{ - setbc_op(pc, (int)bc_op(*pc)+(int)BC_ILOOP-(int)BC_LOOP); - pt->flags |= PROTO_ILOOP; -} - -/* Penalize a bytecode instruction. */ -static void penalty_pc(jit_State *J, GCproto *pt, BCIns *pc, TraceError e) -{ - uint32_t i, val = PENALTY_MIN; - for (i = 0; i < PENALTY_SLOTS; i++) - if (mref(J->penalty[i].pc, const BCIns) == pc) { /* Cache slot found? */ - /* First try to bump its hotcount several times. */ - val = ((uint32_t)J->penalty[i].val << 1) + - LJ_PRNG_BITS(J, PENALTY_RNDBITS); - if (val > PENALTY_MAX) { - blacklist_pc(pt, pc); /* Blacklist it, if that didn't help. */ - return; - } - goto setpenalty; - } - /* Assign a new penalty cache slot. */ - i = J->penaltyslot; - J->penaltyslot = (J->penaltyslot + 1) & (PENALTY_SLOTS-1); - setmref(J->penalty[i].pc, pc); -setpenalty: - J->penalty[i].val = (uint16_t)val; - J->penalty[i].reason = e; - hotcount_set(J2GG(J), pc+1, val); -} - -/* -- Trace compiler state machine ---------------------------------------- */ - -/* Start tracing. */ -static void trace_start(jit_State *J) -{ - lua_State *L; - TraceNo traceno; - - if ((J->pt->flags & PROTO_NOJIT)) { /* JIT disabled for this proto? */ - if (J->parent == 0) { - /* Lazy bytecode patching to disable hotcount events. */ - lua_assert(bc_op(*J->pc) == BC_FORL || bc_op(*J->pc) == BC_ITERL || - bc_op(*J->pc) == BC_LOOP || bc_op(*J->pc) == BC_FUNCF); - setbc_op(J->pc, (int)bc_op(*J->pc)+(int)BC_ILOOP-(int)BC_LOOP); - J->pt->flags |= PROTO_ILOOP; - } - J->state = LJ_TRACE_IDLE; /* Silently ignored. */ - return; - } - - /* Get a new trace number. */ - traceno = trace_findfree(J); - if (LJ_UNLIKELY(traceno == 0)) { /* No free trace? */ - lua_assert((J2G(J)->hookmask & HOOK_GC) == 0); - lj_trace_flushall(J->L); - J->state = LJ_TRACE_IDLE; /* Silently ignored. */ - return; - } - setgcrefp(J->trace[traceno], &J->cur); - - /* Setup enough of the current trace to be able to send the vmevent. */ - memset(&J->cur, 0, sizeof(GCtrace)); - J->cur.traceno = traceno; - J->cur.nins = J->cur.nk = REF_BASE; - J->cur.ir = J->irbuf; - J->cur.snap = J->snapbuf; - J->cur.snapmap = J->snapmapbuf; - J->mergesnap = 0; - J->needsnap = 0; - J->bcskip = 0; - J->guardemit.irt = 0; - J->postproc = LJ_POST_NONE; - lj_resetsplit(J); - setgcref(J->cur.startpt, obj2gco(J->pt)); - - L = J->L; - lj_vmevent_send(L, TRACE, - setstrV(L, L->top++, lj_str_newlit(L, "start")); - setintV(L->top++, traceno); - setfuncV(L, L->top++, J->fn); - setintV(L->top++, proto_bcpos(J->pt, J->pc)); - if (J->parent) { - setintV(L->top++, J->parent); - setintV(L->top++, J->exitno); - } - ); - lj_record_setup(J); -} - -/* Stop tracing. */ -static void trace_stop(jit_State *J) -{ - BCIns *pc = mref(J->cur.startpc, BCIns); - BCOp op = bc_op(J->cur.startins); - GCproto *pt = &gcref(J->cur.startpt)->pt; - TraceNo traceno = J->cur.traceno; - GCtrace *T = trace_save_alloc(J); /* Do this first. May throw OOM. */ - lua_State *L; - - switch (op) { - case BC_FORL: - setbc_op(pc+bc_j(J->cur.startins), BC_JFORI); /* Patch FORI, too. */ - /* fallthrough */ - case BC_LOOP: - case BC_ITERL: - case BC_FUNCF: - /* Patch bytecode of starting instruction in root trace. */ - setbc_op(pc, (int)op+(int)BC_JLOOP-(int)BC_LOOP); - setbc_d(pc, traceno); - addroot: - /* Add to root trace chain in prototype. */ - J->cur.nextroot = pt->trace; - pt->trace = (TraceNo1)traceno; - break; - case BC_RET: - case BC_RET0: - case BC_RET1: - *pc = BCINS_AD(BC_JLOOP, J->cur.snap[0].nslots, traceno); - goto addroot; - case BC_JMP: - /* Patch exit branch in parent to side trace entry. */ - lua_assert(J->parent != 0 && J->cur.root != 0); - lj_asm_patchexit(J, traceref(J, J->parent), J->exitno, J->cur.mcode); - /* Avoid compiling a side trace twice (stack resizing uses parent exit). */ - traceref(J, J->parent)->snap[J->exitno].count = SNAPCOUNT_DONE; - /* Add to side trace chain in root trace. */ - { - GCtrace *root = traceref(J, J->cur.root); - root->nchild++; - J->cur.nextside = root->nextside; - root->nextside = (TraceNo1)traceno; - } - break; - default: - lua_assert(0); - break; - } - - /* Commit new mcode only after all patching is done. */ - lj_mcode_commit(J, J->cur.mcode); - J->postproc = LJ_POST_NONE; - trace_save(J, T); - - L = J->L; - lj_vmevent_send(L, TRACE, - setstrV(L, L->top++, lj_str_newlit(L, "stop")); - setintV(L->top++, traceno); - ); -} - -/* Start a new root trace for down-recursion. */ -static int trace_downrec(jit_State *J) -{ - /* Restart recording at the return instruction. */ - lua_assert(J->pt != NULL); - lua_assert(bc_isret(bc_op(*J->pc))); - if (bc_op(*J->pc) == BC_RETM) - return 0; /* NYI: down-recursion with RETM. */ - J->parent = 0; - J->exitno = 0; - J->state = LJ_TRACE_RECORD; - trace_start(J); - return 1; -} - -/* Abort tracing. */ -static int trace_abort(jit_State *J) -{ - lua_State *L = J->L; - TraceError e = LJ_TRERR_RECERR; - TraceNo traceno; - - J->postproc = LJ_POST_NONE; - lj_mcode_abort(J); - if (tvisnumber(L->top-1)) - e = (TraceError)numberVint(L->top-1); - if (e == LJ_TRERR_MCODELM) { - L->top--; /* Remove error object */ - J->state = LJ_TRACE_ASM; - return 1; /* Retry ASM with new MCode area. */ - } - /* Penalize or blacklist starting bytecode instruction. */ - if (J->parent == 0 && !bc_isret(bc_op(J->cur.startins))) - penalty_pc(J, &gcref(J->cur.startpt)->pt, mref(J->cur.startpc, BCIns), e); - - /* Is there anything to abort? */ - traceno = J->cur.traceno; - if (traceno) { - ptrdiff_t errobj = savestack(L, L->top-1); /* Stack may be resized. */ - J->cur.link = 0; - J->cur.linktype = LJ_TRLINK_NONE; - lj_vmevent_send(L, TRACE, - TValue *frame; - const BCIns *pc; - GCfunc *fn; - setstrV(L, L->top++, lj_str_newlit(L, "abort")); - setintV(L->top++, traceno); - /* Find original Lua function call to generate a better error message. */ - frame = J->L->base-1; - pc = J->pc; - while (!isluafunc(frame_func(frame))) { - pc = (frame_iscont(frame) ? frame_contpc(frame) : frame_pc(frame)) - 1; - frame = frame_prev(frame); - } - fn = frame_func(frame); - setfuncV(L, L->top++, fn); - setintV(L->top++, proto_bcpos(funcproto(fn), pc)); - copyTV(L, L->top++, restorestack(L, errobj)); - copyTV(L, L->top++, &J->errinfo); - ); - /* Drop aborted trace after the vmevent (which may still access it). */ - setgcrefnull(J->trace[traceno]); - if (traceno < J->freetrace) - J->freetrace = traceno; - J->cur.traceno = 0; - } - L->top--; /* Remove error object */ - if (e == LJ_TRERR_DOWNREC) - return trace_downrec(J); - else if (e == LJ_TRERR_MCODEAL) - lj_trace_flushall(L); - return 0; -} - -/* Perform pending re-patch of a bytecode instruction. */ -static LJ_AINLINE void trace_pendpatch(jit_State *J, int force) -{ - if (LJ_UNLIKELY(J->patchpc)) { - if (force || J->bcskip == 0) { - *J->patchpc = J->patchins; - J->patchpc = NULL; - } else { - J->bcskip = 0; - } - } -} - -/* State machine for the trace compiler. Protected callback. */ -static TValue *trace_state(lua_State *L, lua_CFunction dummy, void *ud) -{ - jit_State *J = (jit_State *)ud; - UNUSED(dummy); - do { - retry: - switch (J->state) { - case LJ_TRACE_START: - J->state = LJ_TRACE_RECORD; /* trace_start() may change state. */ - trace_start(J); - lj_dispatch_update(J2G(J)); - break; - - case LJ_TRACE_RECORD: - trace_pendpatch(J, 0); - setvmstate(J2G(J), RECORD); - lj_vmevent_send_(L, RECORD, - /* Save/restore tmptv state for trace recorder. */ - TValue savetv = J2G(J)->tmptv; - TValue savetv2 = J2G(J)->tmptv2; - setintV(L->top++, J->cur.traceno); - setfuncV(L, L->top++, J->fn); - setintV(L->top++, J->pt ? (int32_t)proto_bcpos(J->pt, J->pc) : -1); - setintV(L->top++, J->framedepth); - , - J2G(J)->tmptv = savetv; - J2G(J)->tmptv2 = savetv2; - ); - lj_record_ins(J); - break; - - case LJ_TRACE_END: - trace_pendpatch(J, 1); - J->loopref = 0; - if ((J->flags & JIT_F_OPT_LOOP) && - J->cur.link == J->cur.traceno && J->framedepth + J->retdepth == 0) { - setvmstate(J2G(J), OPT); - lj_opt_dce(J); - if (lj_opt_loop(J)) { /* Loop optimization failed? */ - J->cur.link = 0; - J->cur.linktype = LJ_TRLINK_NONE; - J->loopref = J->cur.nins; - J->state = LJ_TRACE_RECORD; /* Try to continue recording. */ - break; - } - J->loopref = J->chain[IR_LOOP]; /* Needed by assembler. */ - } - lj_opt_split(J); - lj_opt_sink(J); - if (!J->loopref) J->cur.snap[J->cur.nsnap-1].count = SNAPCOUNT_DONE; - J->state = LJ_TRACE_ASM; - break; - - case LJ_TRACE_ASM: - setvmstate(J2G(J), ASM); - lj_asm_trace(J, &J->cur); - trace_stop(J); - setvmstate(J2G(J), INTERP); - J->state = LJ_TRACE_IDLE; - lj_dispatch_update(J2G(J)); - return NULL; - - default: /* Trace aborted asynchronously. */ - setintV(L->top++, (int32_t)LJ_TRERR_RECERR); - /* fallthrough */ - case LJ_TRACE_ERR: - trace_pendpatch(J, 1); - if (trace_abort(J)) - goto retry; - setvmstate(J2G(J), INTERP); - J->state = LJ_TRACE_IDLE; - lj_dispatch_update(J2G(J)); - return NULL; - } - } while (J->state > LJ_TRACE_RECORD); - return NULL; -} - -/* -- Event handling ------------------------------------------------------ */ - -/* A bytecode instruction is about to be executed. Record it. */ -void lj_trace_ins(jit_State *J, const BCIns *pc) -{ - /* Note: J->L must already be set. pc is the true bytecode PC here. */ - J->pc = pc; - J->fn = curr_func(J->L); - J->pt = isluafunc(J->fn) ? funcproto(J->fn) : NULL; - while (lj_vm_cpcall(J->L, NULL, (void *)J, trace_state) != 0) - J->state = LJ_TRACE_ERR; -} - -/* A hotcount triggered. Start recording a root trace. */ -void LJ_FASTCALL lj_trace_hot(jit_State *J, const BCIns *pc) -{ - /* Note: pc is the interpreter bytecode PC here. It's offset by 1. */ - ERRNO_SAVE - /* Reset hotcount. */ - hotcount_set(J2GG(J), pc, J->param[JIT_P_hotloop]*HOTCOUNT_LOOP); - /* Only start a new trace if not recording or inside __gc call or vmevent. */ - if (J->state == LJ_TRACE_IDLE && - !(J2G(J)->hookmask & (HOOK_GC|HOOK_VMEVENT))) { - J->parent = 0; /* Root trace. */ - J->exitno = 0; - J->state = LJ_TRACE_START; - lj_trace_ins(J, pc-1); - } - ERRNO_RESTORE -} - -/* Check for a hot side exit. If yes, start recording a side trace. */ -static void trace_hotside(jit_State *J, const BCIns *pc) -{ - SnapShot *snap = &traceref(J, J->parent)->snap[J->exitno]; - if (!(J2G(J)->hookmask & (HOOK_GC|HOOK_VMEVENT)) && - snap->count != SNAPCOUNT_DONE && - ++snap->count >= J->param[JIT_P_hotexit]) { - lua_assert(J->state == LJ_TRACE_IDLE); - /* J->parent is non-zero for a side trace. */ - J->state = LJ_TRACE_START; - lj_trace_ins(J, pc); - } -} - -/* Tiny struct to pass data to protected call. */ -typedef struct ExitDataCP { - jit_State *J; - void *exptr; /* Pointer to exit state. */ - const BCIns *pc; /* Restart interpreter at this PC. */ -} ExitDataCP; - -/* Need to protect lj_snap_restore because it may throw. */ -static TValue *trace_exit_cp(lua_State *L, lua_CFunction dummy, void *ud) -{ - ExitDataCP *exd = (ExitDataCP *)ud; - cframe_errfunc(L->cframe) = -1; /* Inherit error function. */ - exd->pc = lj_snap_restore(exd->J, exd->exptr); - UNUSED(dummy); - return NULL; -} - -#ifndef LUAJIT_DISABLE_VMEVENT -/* Push all registers from exit state. */ -static void trace_exit_regs(lua_State *L, ExitState *ex) -{ - int32_t i; - setintV(L->top++, RID_NUM_GPR); - setintV(L->top++, RID_NUM_FPR); - for (i = 0; i < RID_NUM_GPR; i++) { - if (sizeof(ex->gpr[i]) == sizeof(int32_t)) - setintV(L->top++, (int32_t)ex->gpr[i]); - else - setnumV(L->top++, (lua_Number)ex->gpr[i]); - } -#if !LJ_SOFTFP - for (i = 0; i < RID_NUM_FPR; i++) { - setnumV(L->top, ex->fpr[i]); - if (LJ_UNLIKELY(tvisnan(L->top))) - setnanV(L->top); - L->top++; - } -#endif -} -#endif - -#ifdef EXITSTATE_PCREG -/* Determine trace number from pc of exit instruction. */ -static TraceNo trace_exit_find(jit_State *J, MCode *pc) -{ - TraceNo traceno; - for (traceno = 1; traceno < J->sizetrace; traceno++) { - GCtrace *T = traceref(J, traceno); - if (T && pc >= T->mcode && pc < (MCode *)((char *)T->mcode + T->szmcode)) - return traceno; - } - lua_assert(0); - return 0; -} -#endif - -/* A trace exited. Restore interpreter state. */ -int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr) -{ - ERRNO_SAVE - lua_State *L = J->L; - ExitState *ex = (ExitState *)exptr; - ExitDataCP exd; - int errcode; - const BCIns *pc; - void *cf; - GCtrace *T; -#ifdef EXITSTATE_PCREG - J->parent = trace_exit_find(J, (MCode *)(intptr_t)ex->gpr[EXITSTATE_PCREG]); -#endif - T = traceref(J, J->parent); UNUSED(T); -#ifdef EXITSTATE_CHECKEXIT - if (J->exitno == T->nsnap) { /* Treat stack check like a parent exit. */ - lua_assert(T->root != 0); - J->exitno = T->ir[REF_BASE].op2; - J->parent = T->ir[REF_BASE].op1; - T = traceref(J, J->parent); - } -#endif - lua_assert(T != NULL && J->exitno < T->nsnap); - exd.J = J; - exd.exptr = exptr; - errcode = lj_vm_cpcall(L, NULL, &exd, trace_exit_cp); - if (errcode) - return -errcode; /* Return negated error code. */ - - lj_vmevent_send(L, TEXIT, - lj_state_checkstack(L, 4+RID_NUM_GPR+RID_NUM_FPR+LUA_MINSTACK); - setintV(L->top++, J->parent); - setintV(L->top++, J->exitno); - trace_exit_regs(L, ex); - ); - - pc = exd.pc; - cf = cframe_raw(L->cframe); - setcframe_pc(cf, pc); - if (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize) { - if (!(G(L)->hookmask & HOOK_GC)) - lj_gc_step(L); /* Exited because of GC: drive GC forward. */ - } else { - trace_hotside(J, pc); - } - if (bc_op(*pc) == BC_JLOOP) { - BCIns *retpc = &traceref(J, bc_d(*pc))->startins; - if (bc_isret(bc_op(*retpc))) { - if (J->state == LJ_TRACE_RECORD) { - J->patchins = *pc; - J->patchpc = (BCIns *)pc; - *J->patchpc = *retpc; - J->bcskip = 1; - } else { - pc = retpc; - setcframe_pc(cf, pc); - } - } - } - /* Return MULTRES or 0. */ - ERRNO_RESTORE - switch (bc_op(*pc)) { - case BC_CALLM: case BC_CALLMT: - return (int)((BCReg)(L->top - L->base) - bc_a(*pc) - bc_c(*pc)); - case BC_RETM: - return (int)((BCReg)(L->top - L->base) + 1 - bc_a(*pc) - bc_d(*pc)); - case BC_TSETM: - return (int)((BCReg)(L->top - L->base) + 1 - bc_a(*pc)); - default: - if (bc_op(*pc) >= BC_FUNCF) - return (int)((BCReg)(L->top - L->base) + 1); - return 0; - } -} - -#endif diff --git a/subprojects/luajit/src/lj_trace.h b/subprojects/luajit/src/lj_trace.h deleted file mode 100644 index edc7af0d2..000000000 --- a/subprojects/luajit/src/lj_trace.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -** Trace management. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_TRACE_H -#define _LJ_TRACE_H - -#include "lj_obj.h" - -#if LJ_HASJIT -#include "lj_jit.h" -#include "lj_dispatch.h" - -/* Trace errors. */ -typedef enum { -#define TREDEF(name, msg) LJ_TRERR_##name, -#include "lj_traceerr.h" - LJ_TRERR__MAX -} TraceError; - -LJ_FUNC_NORET void lj_trace_err(jit_State *J, TraceError e); -LJ_FUNC_NORET void lj_trace_err_info(jit_State *J, TraceError e); - -/* Trace management. */ -LJ_FUNC void LJ_FASTCALL lj_trace_free(global_State *g, GCtrace *T); -LJ_FUNC void lj_trace_reenableproto(GCproto *pt); -LJ_FUNC void lj_trace_flushproto(global_State *g, GCproto *pt); -LJ_FUNC void lj_trace_flush(jit_State *J, TraceNo traceno); -LJ_FUNC int lj_trace_flushall(lua_State *L); -LJ_FUNC void lj_trace_initstate(global_State *g); -LJ_FUNC void lj_trace_freestate(global_State *g); - -/* Event handling. */ -LJ_FUNC void lj_trace_ins(jit_State *J, const BCIns *pc); -LJ_FUNCA void LJ_FASTCALL lj_trace_hot(jit_State *J, const BCIns *pc); -LJ_FUNCA int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr); - -/* Signal asynchronous abort of trace or end of trace. */ -#define lj_trace_abort(g) (G2J(g)->state &= ~LJ_TRACE_ACTIVE) -#define lj_trace_end(J) (J->state = LJ_TRACE_END) - -#else - -#define lj_trace_flushall(L) (UNUSED(L), 0) -#define lj_trace_initstate(g) UNUSED(g) -#define lj_trace_freestate(g) UNUSED(g) -#define lj_trace_abort(g) UNUSED(g) -#define lj_trace_end(J) UNUSED(J) - -#endif - -#endif diff --git a/subprojects/luajit/src/lj_traceerr.h b/subprojects/luajit/src/lj_traceerr.h deleted file mode 100644 index f920e5edb..000000000 --- a/subprojects/luajit/src/lj_traceerr.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -** Trace compiler error messages. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -/* This file may be included multiple times with different TREDEF macros. */ - -/* Recording. */ -TREDEF(RECERR, "error thrown or hook called during recording") -TREDEF(TRACEOV, "trace too long") -TREDEF(STACKOV, "trace too deep") -TREDEF(SNAPOV, "too many snapshots") -TREDEF(BLACKL, "blacklisted") -TREDEF(NYIBC, "NYI: bytecode %d") - -/* Recording loop ops. */ -TREDEF(LLEAVE, "leaving loop in root trace") -TREDEF(LINNER, "inner loop in root trace") -TREDEF(LUNROLL, "loop unroll limit reached") - -/* Recording calls/returns. */ -TREDEF(BADTYPE, "bad argument type") -TREDEF(CJITOFF, "JIT compilation disabled for function") -TREDEF(CUNROLL, "call unroll limit reached") -TREDEF(DOWNREC, "down-recursion, restarting") -TREDEF(NYICF, "NYI: C function %s") -TREDEF(NYIFF, "NYI: FastFunc %s") -TREDEF(NYIFFU, "NYI: unsupported variant of FastFunc %s") -TREDEF(NYIRETL, "NYI: return to lower frame") - -/* Recording indexed load/store. */ -TREDEF(STORENN, "store with nil or NaN key") -TREDEF(NOMM, "missing metamethod") -TREDEF(IDXLOOP, "looping index lookup") -TREDEF(NYITMIX, "NYI: mixed sparse/dense table") - -/* Recording C data operations. */ -TREDEF(NOCACHE, "symbol not in cache") -TREDEF(NYICONV, "NYI: unsupported C type conversion") -TREDEF(NYICALL, "NYI: unsupported C function type") - -/* Optimizations. */ -TREDEF(GFAIL, "guard would always fail") -TREDEF(PHIOV, "too many PHIs") -TREDEF(TYPEINS, "persistent type instability") - -/* Assembler. */ -TREDEF(MCODEAL, "failed to allocate mcode memory") -TREDEF(MCODEOV, "machine code too long") -TREDEF(MCODELM, "hit mcode limit (retrying)") -TREDEF(SPILLOV, "too many spill slots") -TREDEF(BADRA, "inconsistent register allocation") -TREDEF(NYIIR, "NYI: cannot assemble IR instruction %d") -TREDEF(NYIPHI, "NYI: PHI shuffling too complex") -TREDEF(NYICOAL, "NYI: register coalescing too complex") - -#undef TREDEF - -/* Detecting unused error messages: - awk -F, '/^TREDEF/ { gsub(/TREDEF./, ""); printf "grep -q LJ_TRERR_%s *.[ch] || echo %s\n", $1, $1}' lj_traceerr.h | sh -*/ diff --git a/subprojects/luajit/src/lj_udata.c b/subprojects/luajit/src/lj_udata.c deleted file mode 100644 index bd0321b83..000000000 --- a/subprojects/luajit/src/lj_udata.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -** Userdata handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_udata_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_gc.h" -#include "lj_udata.h" - -GCudata *lj_udata_new(lua_State *L, MSize sz, GCtab *env) -{ - GCudata *ud = lj_mem_newt(L, sizeof(GCudata) + sz, GCudata); - global_State *g = G(L); - newwhite(g, ud); /* Not finalized. */ - ud->gct = ~LJ_TUDATA; - ud->udtype = UDTYPE_USERDATA; - ud->len = sz; - /* NOBARRIER: The GCudata is new (marked white). */ - setgcrefnull(ud->metatable); - setgcref(ud->env, obj2gco(env)); - /* Chain to userdata list (after main thread). */ - setgcrefr(ud->nextgc, mainthread(g)->nextgc); - setgcref(mainthread(g)->nextgc, obj2gco(ud)); - return ud; -} - -void LJ_FASTCALL lj_udata_free(global_State *g, GCudata *ud) -{ - lj_mem_free(g, ud, sizeudata(ud)); -} - diff --git a/subprojects/luajit/src/lj_udata.h b/subprojects/luajit/src/lj_udata.h deleted file mode 100644 index f271a42d3..000000000 --- a/subprojects/luajit/src/lj_udata.h +++ /dev/null @@ -1,14 +0,0 @@ -/* -** Userdata handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_UDATA_H -#define _LJ_UDATA_H - -#include "lj_obj.h" - -LJ_FUNC GCudata *lj_udata_new(lua_State *L, MSize sz, GCtab *env); -LJ_FUNC void LJ_FASTCALL lj_udata_free(global_State *g, GCudata *ud); - -#endif diff --git a/subprojects/luajit/src/lj_vm.h b/subprojects/luajit/src/lj_vm.h deleted file mode 100644 index 3ffa76bf7..000000000 --- a/subprojects/luajit/src/lj_vm.h +++ /dev/null @@ -1,116 +0,0 @@ -/* -** Assembler VM interface definitions. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_VM_H -#define _LJ_VM_H - -#include "lj_obj.h" - -/* Entry points for ASM parts of VM. */ -LJ_ASMF void lj_vm_call(lua_State *L, TValue *base, int nres1); -LJ_ASMF int lj_vm_pcall(lua_State *L, TValue *base, int nres1, ptrdiff_t ef); -typedef TValue *(*lua_CPFunction)(lua_State *L, lua_CFunction func, void *ud); -LJ_ASMF int lj_vm_cpcall(lua_State *L, lua_CFunction func, void *ud, - lua_CPFunction cp); -LJ_ASMF int lj_vm_resume(lua_State *L, TValue *base, int nres1, ptrdiff_t ef); -LJ_ASMF_NORET void LJ_FASTCALL lj_vm_unwind_c(void *cframe, int errcode); -LJ_ASMF_NORET void LJ_FASTCALL lj_vm_unwind_ff(void *cframe); -LJ_ASMF void lj_vm_unwind_c_eh(void); -LJ_ASMF void lj_vm_unwind_ff_eh(void); -#if LJ_TARGET_X86ORX64 -LJ_ASMF void lj_vm_unwind_rethrow(void); -#endif - -/* Miscellaneous functions. */ -#if LJ_TARGET_X86ORX64 -LJ_ASMF int lj_vm_cpuid(uint32_t f, uint32_t res[4]); -#endif -#if LJ_TARGET_PPC -void lj_vm_cachesync(void *start, void *end); -#endif -LJ_ASMF double lj_vm_foldarith(double x, double y, int op); -#if LJ_HASJIT -LJ_ASMF double lj_vm_foldfpm(double x, int op); -#endif -#if !LJ_ARCH_HASFPU -/* Declared in lj_obj.h: LJ_ASMF int32_t lj_vm_tobit(double x); */ -#endif - -/* Dispatch targets for recording and hooks. */ -LJ_ASMF void lj_vm_record(void); -LJ_ASMF void lj_vm_inshook(void); -LJ_ASMF void lj_vm_rethook(void); -LJ_ASMF void lj_vm_callhook(void); - -/* Trace exit handling. */ -LJ_ASMF void lj_vm_exit_handler(void); -LJ_ASMF void lj_vm_exit_interp(void); - -/* Internal math helper functions. */ -#if LJ_TARGET_X86ORX64 || LJ_TARGET_PPC -#define lj_vm_floor floor -#define lj_vm_ceil ceil -#else -LJ_ASMF double lj_vm_floor(double); -LJ_ASMF double lj_vm_ceil(double); -#if LJ_TARGET_ARM -LJ_ASMF double lj_vm_floor_sf(double); -LJ_ASMF double lj_vm_ceil_sf(double); -#endif -#endif -#if defined(LUAJIT_NO_LOG2) || LJ_TARGET_X86ORX64 -LJ_ASMF double lj_vm_log2(double); -#else -#define lj_vm_log2 log2 -#endif - -#if LJ_HASJIT -#if LJ_TARGET_X86ORX64 -LJ_ASMF void lj_vm_floor_sse(void); -LJ_ASMF void lj_vm_ceil_sse(void); -LJ_ASMF void lj_vm_trunc_sse(void); -LJ_ASMF void lj_vm_exp_x87(void); -LJ_ASMF void lj_vm_exp2_x87(void); -LJ_ASMF void lj_vm_pow_sse(void); -LJ_ASMF void lj_vm_powi_sse(void); -#else -#if LJ_TARGET_PPC -#define lj_vm_trunc trunc -#else -LJ_ASMF double lj_vm_trunc(double); -#if LJ_TARGET_ARM -LJ_ASMF double lj_vm_trunc_sf(double); -#endif -#endif -LJ_ASMF double lj_vm_powi(double, int32_t); -#ifdef LUAJIT_NO_EXP2 -LJ_ASMF double lj_vm_exp2(double); -#else -#define lj_vm_exp2 exp2 -#endif -#endif -LJ_ASMF int32_t LJ_FASTCALL lj_vm_modi(int32_t, int32_t); -#if LJ_HASFFI -LJ_ASMF int lj_vm_errno(void); -#endif -#endif - -/* Continuations for metamethods. */ -LJ_ASMF void lj_cont_cat(void); /* Continue with concatenation. */ -LJ_ASMF void lj_cont_ra(void); /* Store result in RA from instruction. */ -LJ_ASMF void lj_cont_nop(void); /* Do nothing, just continue execution. */ -LJ_ASMF void lj_cont_condt(void); /* Branch if result is true. */ -LJ_ASMF void lj_cont_condf(void); /* Branch if result is false. */ -LJ_ASMF void lj_cont_hook(void); /* Continue from hook yield. */ - -enum { LJ_CONT_TAILCALL, LJ_CONT_FFI_CALLBACK }; /* Special continuations. */ - -/* Start of the ASM code. */ -LJ_ASMF char lj_vm_asm_begin[]; - -/* Bytecode offsets are relative to lj_vm_asm_begin. */ -#define makeasmfunc(ofs) ((ASMFunction)(lj_vm_asm_begin + (ofs))) - -#endif diff --git a/subprojects/luajit/src/lj_vmevent.c b/subprojects/luajit/src/lj_vmevent.c deleted file mode 100644 index 7b6d7bf34..000000000 --- a/subprojects/luajit/src/lj_vmevent.c +++ /dev/null @@ -1,57 +0,0 @@ -/* -** VM event handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#include - -#define lj_vmevent_c -#define LUA_CORE - -#include "lj_obj.h" -#include "lj_str.h" -#include "lj_tab.h" -#include "lj_state.h" -#include "lj_dispatch.h" -#include "lj_vm.h" -#include "lj_vmevent.h" - -ptrdiff_t lj_vmevent_prepare(lua_State *L, VMEvent ev) -{ - global_State *g = G(L); - GCstr *s = lj_str_newlit(L, LJ_VMEVENTS_REGKEY); - cTValue *tv = lj_tab_getstr(tabV(registry(L)), s); - if (tvistab(tv)) { - int hash = VMEVENT_HASH(ev); - tv = lj_tab_getint(tabV(tv), hash); - if (tv && tvisfunc(tv)) { - lj_state_checkstack(L, LUA_MINSTACK); - setfuncV(L, L->top++, funcV(tv)); - return savestack(L, L->top); - } - } - g->vmevmask &= ~VMEVENT_MASK(ev); /* No handler: cache this fact. */ - return 0; -} - -void lj_vmevent_call(lua_State *L, ptrdiff_t argbase) -{ - global_State *g = G(L); - uint8_t oldmask = g->vmevmask; - uint8_t oldh = hook_save(g); - int status; - g->vmevmask = 0; /* Disable all events. */ - hook_vmevent(g); - status = lj_vm_pcall(L, restorestack(L, argbase), 0+1, 0); - if (LJ_UNLIKELY(status)) { - /* Really shouldn't use stderr here, but where else to complain? */ - L->top--; - fputs("VM handler failed: ", stderr); - fputs(tvisstr(L->top) ? strVdata(L->top) : "?", stderr); - fputc('\n', stderr); - } - hook_restore(g, oldh); - if (g->vmevmask != VMEVENT_NOCACHE) - g->vmevmask = oldmask; /* Restore event mask, but not if not modified. */ -} - diff --git a/subprojects/luajit/src/lj_vmevent.h b/subprojects/luajit/src/lj_vmevent.h deleted file mode 100644 index 050fb4dd2..000000000 --- a/subprojects/luajit/src/lj_vmevent.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -** VM event handling. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LJ_VMEVENT_H -#define _LJ_VMEVENT_H - -#include "lj_obj.h" - -/* Registry key for VM event handler table. */ -#define LJ_VMEVENTS_REGKEY "_VMEVENTS" -#define LJ_VMEVENTS_HSIZE 4 - -#define VMEVENT_MASK(ev) ((uint8_t)1 << ((int)(ev) & 7)) -#define VMEVENT_HASH(ev) ((int)(ev) & ~7) -#define VMEVENT_HASHIDX(h) ((int)(h) << 3) -#define VMEVENT_NOCACHE 255 - -#define VMEVENT_DEF(name, hash) \ - LJ_VMEVENT_##name##_, \ - LJ_VMEVENT_##name = ((LJ_VMEVENT_##name##_) & 7)|((hash) << 3) - -/* VM event IDs. */ -typedef enum { - VMEVENT_DEF(BC, 0x00003883), - VMEVENT_DEF(TRACE, 0xb2d91467), - VMEVENT_DEF(RECORD, 0x9284bf4f), - VMEVENT_DEF(TEXIT, 0xb29df2b0), - LJ_VMEVENT__MAX -} VMEvent; - -#ifdef LUAJIT_DISABLE_VMEVENT -#define lj_vmevent_send(L, ev, args) UNUSED(L) -#define lj_vmevent_send_(L, ev, args, post) UNUSED(L) -#else -#define lj_vmevent_send(L, ev, args) \ - if (G(L)->vmevmask & VMEVENT_MASK(LJ_VMEVENT_##ev)) { \ - ptrdiff_t argbase = lj_vmevent_prepare(L, LJ_VMEVENT_##ev); \ - if (argbase) { \ - args \ - lj_vmevent_call(L, argbase); \ - } \ - } -#define lj_vmevent_send_(L, ev, args, post) \ - if (G(L)->vmevmask & VMEVENT_MASK(LJ_VMEVENT_##ev)) { \ - ptrdiff_t argbase = lj_vmevent_prepare(L, LJ_VMEVENT_##ev); \ - if (argbase) { \ - args \ - lj_vmevent_call(L, argbase); \ - post \ - } \ - } - -LJ_FUNC ptrdiff_t lj_vmevent_prepare(lua_State *L, VMEvent ev); -LJ_FUNC void lj_vmevent_call(lua_State *L, ptrdiff_t argbase); -#endif - -#endif diff --git a/subprojects/luajit/src/lj_vmmath.c b/subprojects/luajit/src/lj_vmmath.c deleted file mode 100644 index 73fc667f6..000000000 --- a/subprojects/luajit/src/lj_vmmath.c +++ /dev/null @@ -1,140 +0,0 @@ -/* -** Math helper functions for assembler VM. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#define lj_vmmath_c -#define LUA_CORE - -#include -#include - -#include "lj_obj.h" -#include "lj_ir.h" -#include "lj_vm.h" - -/* -- Helper functions for generated machine code ------------------------- */ - -#if LJ_TARGET_X86ORX64 -/* Wrapper functions to avoid linker issues on OSX. */ -LJ_FUNCA double lj_vm_sinh(double x) { return sinh(x); } -LJ_FUNCA double lj_vm_cosh(double x) { return cosh(x); } -LJ_FUNCA double lj_vm_tanh(double x) { return tanh(x); } -#endif - -#if !LJ_TARGET_X86ORX64 -double lj_vm_foldarith(double x, double y, int op) -{ - switch (op) { - case IR_ADD - IR_ADD: return x+y; break; - case IR_SUB - IR_ADD: return x-y; break; - case IR_MUL - IR_ADD: return x*y; break; - case IR_DIV - IR_ADD: return x/y; break; - case IR_MOD - IR_ADD: return x-lj_vm_floor(x/y)*y; break; - case IR_POW - IR_ADD: return pow(x, y); break; - case IR_NEG - IR_ADD: return -x; break; - case IR_ABS - IR_ADD: return fabs(x); break; -#if LJ_HASJIT - case IR_ATAN2 - IR_ADD: return atan2(x, y); break; - case IR_LDEXP - IR_ADD: return ldexp(x, (int)y); break; - case IR_MIN - IR_ADD: return x > y ? y : x; break; - case IR_MAX - IR_ADD: return x < y ? y : x; break; -#endif - default: return x; - } -} -#endif - -#if LJ_HASJIT - -#ifdef LUAJIT_NO_LOG2 -double lj_vm_log2(double a) -{ - return log(a) * 1.4426950408889634074; -} -#endif - -#ifdef LUAJIT_NO_EXP2 -double lj_vm_exp2(double a) -{ - return exp(a * 0.6931471805599453); -} -#endif - -#if !(LJ_TARGET_ARM || LJ_TARGET_PPC) -int32_t LJ_FASTCALL lj_vm_modi(int32_t a, int32_t b) -{ - uint32_t y, ua, ub; - lua_assert(b != 0); /* This must be checked before using this function. */ - ua = a < 0 ? (uint32_t)-a : (uint32_t)a; - ub = b < 0 ? (uint32_t)-b : (uint32_t)b; - y = ua % ub; - if (y != 0 && (a^b) < 0) y = y - ub; - if (((int32_t)y^b) < 0) y = (uint32_t)-(int32_t)y; - return (int32_t)y; -} -#endif - -#if !LJ_TARGET_X86ORX64 -/* Unsigned x^k. */ -static double lj_vm_powui(double x, uint32_t k) -{ - double y; - lua_assert(k != 0); - for (; (k & 1) == 0; k >>= 1) x *= x; - y = x; - if ((k >>= 1) != 0) { - for (;;) { - x *= x; - if (k == 1) break; - if (k & 1) y *= x; - k >>= 1; - } - y *= x; - } - return y; -} - -/* Signed x^k. */ -double lj_vm_powi(double x, int32_t k) -{ - if (k > 1) - return lj_vm_powui(x, (uint32_t)k); - else if (k == 1) - return x; - else if (k == 0) - return 1.0; - else - return 1.0 / lj_vm_powui(x, (uint32_t)-k); -} - -/* Computes fpm(x) for extended math functions. */ -double lj_vm_foldfpm(double x, int fpm) -{ - switch (fpm) { - case IRFPM_FLOOR: return lj_vm_floor(x); - case IRFPM_CEIL: return lj_vm_ceil(x); - case IRFPM_TRUNC: return lj_vm_trunc(x); - case IRFPM_SQRT: return sqrt(x); - case IRFPM_EXP: return exp(x); - case IRFPM_EXP2: return lj_vm_exp2(x); - case IRFPM_LOG: return log(x); - case IRFPM_LOG2: return lj_vm_log2(x); - case IRFPM_LOG10: return log10(x); - case IRFPM_SIN: return sin(x); - case IRFPM_COS: return cos(x); - case IRFPM_TAN: return tan(x); - default: lua_assert(0); - } - return 0; -} -#endif - -#if LJ_HASFFI -int lj_vm_errno(void) -{ - return errno; -} -#endif - -#endif diff --git a/subprojects/luajit/src/ljamalg.c b/subprojects/luajit/src/ljamalg.c deleted file mode 100644 index 654fe82f2..000000000 --- a/subprojects/luajit/src/ljamalg.c +++ /dev/null @@ -1,93 +0,0 @@ -/* -** LuaJIT core and libraries amalgamation. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -/* -+--------------------------------------------------------------------------+ -| WARNING: Compiling the amalgamation needs a lot of virtual memory | -| (around 300 MB with GCC 4.x)! If you don't have enough physical memory | -| your machine will start swapping to disk and the compile will not finish | -| within a reasonable amount of time. | -| So either compile on a bigger machine or use the non-amalgamated build. | -+--------------------------------------------------------------------------+ -*/ - -#define ljamalg_c -#define LUA_CORE - -/* To get the mremap prototype. Must be defined before any system includes. */ -#if defined(__linux__) && !defined(_GNU_SOURCE) -#define _GNU_SOURCE -#endif - -#ifndef WINVER -#define WINVER 0x0501 -#endif - -#include "lua.h" -#include "lauxlib.h" - -#include "lj_gc.c" -#include "lj_err.c" -#include "lj_char.c" -#include "lj_bc.c" -#include "lj_obj.c" -#include "lj_str.c" -#include "lj_tab.c" -#include "lj_func.c" -#include "lj_udata.c" -#include "lj_meta.c" -#include "lj_debug.c" -#include "lj_state.c" -#include "lj_dispatch.c" -#include "lj_vmevent.c" -#include "lj_vmmath.c" -#include "lj_strscan.c" -#include "lj_api.c" -#include "lj_lex.c" -#include "lj_parse.c" -#include "lj_bcread.c" -#include "lj_bcwrite.c" -#include "lj_load.c" -#include "lj_ctype.c" -#include "lj_cdata.c" -#include "lj_cconv.c" -#include "lj_ccall.c" -#include "lj_ccallback.c" -#include "lj_carith.c" -#include "lj_clib.c" -#include "lj_cparse.c" -#include "lj_lib.c" -#include "lj_ir.c" -#include "lj_opt_mem.c" -#include "lj_opt_fold.c" -#include "lj_opt_narrow.c" -#include "lj_opt_dce.c" -#include "lj_opt_loop.c" -#include "lj_opt_split.c" -#include "lj_opt_sink.c" -#include "lj_mcode.c" -#include "lj_snap.c" -#include "lj_record.c" -#include "lj_crecord.c" -#include "lj_ffrecord.c" -#include "lj_asm.c" -#include "lj_trace.c" -#include "lj_gdbjit.c" -#include "lj_alloc.c" - -#include "lib_aux.c" -#include "lib_base.c" -#include "lib_math.c" -#include "lib_string.c" -#include "lib_table.c" -#include "lib_io.c" -#include "lib_os.c" -#include "lib_package.c" -#include "lib_debug.c" -#include "lib_bit.c" -#include "lib_jit.c" -#include "lib_ffi.c" -#include "lib_init.c" - diff --git a/subprojects/luajit/src/lua.h b/subprojects/luajit/src/lua.h deleted file mode 100644 index c83fd3bbe..000000000 --- a/subprojects/luajit/src/lua.h +++ /dev/null @@ -1,393 +0,0 @@ -/* -** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $ -** Lua - An Extensible Extension Language -** Lua.org, PUC-Rio, Brazil (http://www.lua.org) -** See Copyright Notice at the end of this file -*/ - - -#ifndef lua_h -#define lua_h - -#include -#include - - -#include "luaconf.h" - - -#define LUA_VERSION "Lua 5.1" -#define LUA_RELEASE "Lua 5.1.4" -#define LUA_VERSION_NUM 501 -#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio" -#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" - - -/* mark for precompiled code (`Lua') */ -#define LUA_SIGNATURE "\033Lua" - -/* option for multiple returns in `lua_pcall' and `lua_call' */ -#define LUA_MULTRET (-1) - - -/* -** pseudo-indices -*/ -#define LUA_REGISTRYINDEX (-10000) -#define LUA_ENVIRONINDEX (-10001) -#define LUA_GLOBALSINDEX (-10002) -#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i)) - - -/* thread status; 0 is OK */ -#define LUA_YIELD 1 -#define LUA_ERRRUN 2 -#define LUA_ERRSYNTAX 3 -#define LUA_ERRMEM 4 -#define LUA_ERRERR 5 - - -typedef struct lua_State lua_State; - -typedef int (*lua_CFunction) (lua_State *L); - - -/* -** functions that read/write blocks when loading/dumping Lua chunks -*/ -typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz); - -typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud); - - -/* -** prototype for memory-allocation functions -*/ -typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); - - -/* -** basic types -*/ -#define LUA_TNONE (-1) - -#define LUA_TNIL 0 -#define LUA_TBOOLEAN 1 -#define LUA_TLIGHTUSERDATA 2 -#define LUA_TNUMBER 3 -#define LUA_TSTRING 4 -#define LUA_TTABLE 5 -#define LUA_TFUNCTION 6 -#define LUA_TUSERDATA 7 -#define LUA_TTHREAD 8 - - - -/* minimum Lua stack available to a C function */ -#define LUA_MINSTACK 20 - - -/* -** generic extra include file -*/ -#if defined(LUA_USER_H) -#include LUA_USER_H -#endif - - -/* type of numbers in Lua */ -typedef LUA_NUMBER lua_Number; - - -/* type for integer functions */ -typedef LUA_INTEGER lua_Integer; - - - -/* -** state manipulation -*/ -LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); -LUA_API void (lua_close) (lua_State *L); -LUA_API lua_State *(lua_newthread) (lua_State *L); - -LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); - - -/* -** basic stack manipulation -*/ -LUA_API int (lua_gettop) (lua_State *L); -LUA_API void (lua_settop) (lua_State *L, int idx); -LUA_API void (lua_pushvalue) (lua_State *L, int idx); -LUA_API void (lua_remove) (lua_State *L, int idx); -LUA_API void (lua_insert) (lua_State *L, int idx); -LUA_API void (lua_replace) (lua_State *L, int idx); -LUA_API int (lua_checkstack) (lua_State *L, int sz); - -LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n); - - -/* -** access functions (stack -> C) -*/ - -LUA_API int (lua_isnumber) (lua_State *L, int idx); -LUA_API int (lua_isstring) (lua_State *L, int idx); -LUA_API int (lua_iscfunction) (lua_State *L, int idx); -LUA_API int (lua_isuserdata) (lua_State *L, int idx); -LUA_API int (lua_type) (lua_State *L, int idx); -LUA_API const char *(lua_typename) (lua_State *L, int tp); - -LUA_API int (lua_equal) (lua_State *L, int idx1, int idx2); -LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2); -LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2); - -LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx); -LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx); -LUA_API int (lua_toboolean) (lua_State *L, int idx); -LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); -LUA_API size_t (lua_objlen) (lua_State *L, int idx); -LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); -LUA_API void *(lua_touserdata) (lua_State *L, int idx); -LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); -LUA_API const void *(lua_topointer) (lua_State *L, int idx); - - -/* -** push functions (C -> stack) -*/ -LUA_API void (lua_pushnil) (lua_State *L); -LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n); -LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n); -LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l); -LUA_API void (lua_pushstring) (lua_State *L, const char *s); -LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt, - va_list argp); -LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...); -LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n); -LUA_API void (lua_pushboolean) (lua_State *L, int b); -LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p); -LUA_API int (lua_pushthread) (lua_State *L); - - -/* -** get functions (Lua -> stack) -*/ -LUA_API void (lua_gettable) (lua_State *L, int idx); -LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k); -LUA_API void (lua_rawget) (lua_State *L, int idx); -LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n); -LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); -LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); -LUA_API int (lua_getmetatable) (lua_State *L, int objindex); -LUA_API void (lua_getfenv) (lua_State *L, int idx); - - -/* -** set functions (stack -> Lua) -*/ -LUA_API void (lua_settable) (lua_State *L, int idx); -LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); -LUA_API void (lua_rawset) (lua_State *L, int idx); -LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); -LUA_API int (lua_setmetatable) (lua_State *L, int objindex); -LUA_API int (lua_setfenv) (lua_State *L, int idx); - - -/* -** `load' and `call' functions (load and run Lua code) -*/ -LUA_API void (lua_call) (lua_State *L, int nargs, int nresults); -LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc); -LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud); -LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt, - const char *chunkname); - -LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data); - - -/* -** coroutine functions -*/ -LUA_API int (lua_yield) (lua_State *L, int nresults); -LUA_API int (lua_resume) (lua_State *L, int narg); -LUA_API int (lua_status) (lua_State *L); - -/* -** garbage-collection function and options -*/ - -#define LUA_GCSTOP 0 -#define LUA_GCRESTART 1 -#define LUA_GCCOLLECT 2 -#define LUA_GCCOUNT 3 -#define LUA_GCCOUNTB 4 -#define LUA_GCSTEP 5 -#define LUA_GCSETPAUSE 6 -#define LUA_GCSETSTEPMUL 7 - -LUA_API int (lua_gc) (lua_State *L, int what, int data); - - -/* -** miscellaneous functions -*/ - -LUA_API int (lua_error) (lua_State *L); - -LUA_API int (lua_next) (lua_State *L, int idx); - -LUA_API void (lua_concat) (lua_State *L, int n); - -LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); -LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); - - - -/* -** =============================================================== -** some useful macros -** =============================================================== -*/ - -#define lua_pop(L,n) lua_settop(L, -(n)-1) - -#define lua_newtable(L) lua_createtable(L, 0, 0) - -#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) - -#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) - -#define lua_strlen(L,i) lua_objlen(L, (i)) - -#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION) -#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE) -#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA) -#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL) -#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN) -#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD) -#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE) -#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0) - -#define lua_pushliteral(L, s) \ - lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1) - -#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s)) -#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s)) - -#define lua_tostring(L,i) lua_tolstring(L, (i), NULL) - - - -/* -** compatibility macros and functions -*/ - -#define lua_open() luaL_newstate() - -#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX) - -#define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0) - -#define lua_Chunkreader lua_Reader -#define lua_Chunkwriter lua_Writer - - -/* hack */ -LUA_API void lua_setlevel (lua_State *from, lua_State *to); - - -/* -** {====================================================================== -** Debug API -** ======================================================================= -*/ - - -/* -** Event codes -*/ -#define LUA_HOOKCALL 0 -#define LUA_HOOKRET 1 -#define LUA_HOOKLINE 2 -#define LUA_HOOKCOUNT 3 -#define LUA_HOOKTAILRET 4 - - -/* -** Event masks -*/ -#define LUA_MASKCALL (1 << LUA_HOOKCALL) -#define LUA_MASKRET (1 << LUA_HOOKRET) -#define LUA_MASKLINE (1 << LUA_HOOKLINE) -#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT) - -typedef struct lua_Debug lua_Debug; /* activation record */ - - -/* Functions to be called by the debuger in specific events */ -typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); - - -LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar); -LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); -LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); -LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); -LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n); -LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n); -LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count); -LUA_API lua_Hook lua_gethook (lua_State *L); -LUA_API int lua_gethookmask (lua_State *L); -LUA_API int lua_gethookcount (lua_State *L); - -/* From Lua 5.2. */ -LUA_API void *lua_upvalueid (lua_State *L, int idx, int n); -LUA_API void lua_upvaluejoin (lua_State *L, int idx1, int n1, int idx2, int n2); -LUA_API int lua_loadx (lua_State *L, lua_Reader reader, void *dt, - const char *chunkname, const char *mode); - - -struct lua_Debug { - int event; - const char *name; /* (n) */ - const char *namewhat; /* (n) `global', `local', `field', `method' */ - const char *what; /* (S) `Lua', `C', `main', `tail' */ - const char *source; /* (S) */ - int currentline; /* (l) */ - int nups; /* (u) number of upvalues */ - int linedefined; /* (S) */ - int lastlinedefined; /* (S) */ - char short_src[LUA_IDSIZE]; /* (S) */ - /* private part */ - int i_ci; /* active function */ -}; - -/* }====================================================================== */ - - -/****************************************************************************** -* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved. -* -* 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -******************************************************************************/ - - -#endif diff --git a/subprojects/luajit/src/lua.hpp b/subprojects/luajit/src/lua.hpp deleted file mode 100644 index 07e9002dc..000000000 --- a/subprojects/luajit/src/lua.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// C++ wrapper for LuaJIT header files. - -extern "C" { -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" -#include "luajit.h" -} - diff --git a/subprojects/luajit/src/luaconf.h b/subprojects/luajit/src/luaconf.h deleted file mode 100644 index b33e91b77..000000000 --- a/subprojects/luajit/src/luaconf.h +++ /dev/null @@ -1,156 +0,0 @@ -/* -** Configuration header. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef luaconf_h -#define luaconf_h - -#ifndef WINVER -#define WINVER 0x0501 -#endif -#include -#include - -/* Default path for loading Lua and C modules with require(). */ -#if defined(_WIN32) -/* -** In Windows, any exclamation mark ('!') in the path is replaced by the -** path of the directory of the executable file of the current process. -*/ -#define LUA_LDIR "!\\lua\\" -#define LUA_CDIR "!\\" -#define LUA_PATH_DEFAULT \ - ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" -#define LUA_CPATH_DEFAULT \ - ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" -#else -/* -** Note to distribution maintainers: do NOT patch the following lines! -** Please read ../doc/install.html#distro and pass PREFIX=/usr instead. -*/ -#ifndef LUA_MULTILIB -#define LUA_MULTILIB "lib" -#endif -#ifndef LUA_LMULTILIB -#define LUA_LMULTILIB "lib" -#endif -#define LUA_LROOT "/usr/local" -#define LUA_LUADIR "/lua/5.1/" -#define LUA_LJDIR "/luajit-2.0.5/" - -#ifdef LUA_ROOT -#define LUA_JROOT LUA_ROOT -#define LUA_RLDIR LUA_ROOT "/share" LUA_LUADIR -#define LUA_RCDIR LUA_ROOT "/" LUA_MULTILIB LUA_LUADIR -#define LUA_RLPATH ";" LUA_RLDIR "?.lua;" LUA_RLDIR "?/init.lua" -#define LUA_RCPATH ";" LUA_RCDIR "?.so" -#else -#define LUA_JROOT LUA_LROOT -#define LUA_RLPATH -#define LUA_RCPATH -#endif - -#define LUA_JPATH ";" LUA_JROOT "/share" LUA_LJDIR "?.lua" -#define LUA_LLDIR LUA_LROOT "/share" LUA_LUADIR -#define LUA_LCDIR LUA_LROOT "/" LUA_LMULTILIB LUA_LUADIR -#define LUA_LLPATH ";" LUA_LLDIR "?.lua;" LUA_LLDIR "?/init.lua" -#define LUA_LCPATH1 ";" LUA_LCDIR "?.so" -#define LUA_LCPATH2 ";" LUA_LCDIR "loadall.so" - -#define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH -#define LUA_CPATH_DEFAULT "./?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2 -#endif - -/* Environment variable names for path overrides and initialization code. */ -#define LUA_PATH "LUA_PATH" -#define LUA_CPATH "LUA_CPATH" -#define LUA_INIT "LUA_INIT" - -/* Special file system characters. */ -#if defined(_WIN32) -#define LUA_DIRSEP "\\" -#else -#define LUA_DIRSEP "/" -#endif -#define LUA_PATHSEP ";" -#define LUA_PATH_MARK "?" -#define LUA_EXECDIR "!" -#define LUA_IGMARK "-" -#define LUA_PATH_CONFIG \ - LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" \ - LUA_EXECDIR "\n" LUA_IGMARK - -/* Quoting in error messages. */ -#define LUA_QL(x) "'" x "'" -#define LUA_QS LUA_QL("%s") - -/* Various tunables. */ -#define LUAI_MAXSTACK 65500 /* Max. # of stack slots for a thread (<64K). */ -#define LUAI_MAXCSTACK 8000 /* Max. # of stack slots for a C func (<10K). */ -#define LUAI_GCPAUSE 200 /* Pause GC until memory is at 200%. */ -#define LUAI_GCMUL 200 /* Run GC at 200% of allocation speed. */ -#define LUA_MAXCAPTURES 32 /* Max. pattern captures. */ - -/* Compatibility with older library function names. */ -#define LUA_COMPAT_MOD /* OLD: math.mod, NEW: math.fmod */ -#define LUA_COMPAT_GFIND /* OLD: string.gfind, NEW: string.gmatch */ - -/* Configuration for the frontend (the luajit executable). */ -#if defined(luajit_c) -#define LUA_PROGNAME "luajit" /* Fallback frontend name. */ -#define LUA_PROMPT "> " /* Interactive prompt. */ -#define LUA_PROMPT2 ">> " /* Continuation prompt. */ -#define LUA_MAXINPUT 512 /* Max. input line length. */ -#endif - -/* Note: changing the following defines breaks the Lua 5.1 ABI. */ -#define LUA_INTEGER ptrdiff_t -#define LUA_IDSIZE 60 /* Size of lua_Debug.short_src. */ -/* -** Size of lauxlib and io.* on-stack buffers. Weird workaround to avoid using -** unreasonable amounts of stack space, but still retain ABI compatibility. -** Blame Lua for depending on BUFSIZ in the ABI, blame **** for wrecking it. -*/ -#define LUAL_BUFFERSIZE (BUFSIZ > 16384 ? 8192 : BUFSIZ) - -/* The following defines are here only for compatibility with luaconf.h -** from the standard Lua distribution. They must not be changed for LuaJIT. -*/ -#define LUA_NUMBER_DOUBLE -#define LUA_NUMBER double -#define LUAI_UACNUMBER double -#define LUA_NUMBER_SCAN "%lf" -#define LUA_NUMBER_FMT "%.14g" -#define lua_number2str(s, n) sprintf((s), LUA_NUMBER_FMT, (n)) -#define LUAI_MAXNUMBER2STR 32 -#define LUA_INTFRMLEN "l" -#define LUA_INTFRM_T long - -/* Linkage of public API functions. */ -#if defined(LUA_BUILD_AS_DLL) -#if defined(LUA_CORE) || defined(LUA_LIB) -#define LUA_API __declspec(dllexport) -#else -#define LUA_API __declspec(dllimport) -#endif -#else -#define LUA_API extern -#endif - -#define LUALIB_API LUA_API - -/* Support for internal assertions. */ -#if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK) -#include -#endif -#ifdef LUA_USE_ASSERT -#define lua_assert(x) assert(x) -#endif -#ifdef LUA_USE_APICHECK -#define luai_apicheck(L, o) { (void)L; assert(o); } -#else -#define luai_apicheck(L, o) { (void)L; } -#endif - -#endif diff --git a/subprojects/luajit/src/luajit.c b/subprojects/luajit/src/luajit.c deleted file mode 100644 index 9e15b26d6..000000000 --- a/subprojects/luajit/src/luajit.c +++ /dev/null @@ -1,571 +0,0 @@ -/* -** LuaJIT frontend. Runs commands, scripts, read-eval-print (REPL) etc. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -** -** Major portions taken verbatim or adapted from the Lua interpreter. -** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h -*/ - -#include -#include -#include - -#define luajit_c - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" -#include "luajit.h" - -#include "lj_arch.h" - -#if LJ_TARGET_POSIX -#include -#define lua_stdin_is_tty() isatty(0) -#elif LJ_TARGET_WINDOWS -#include -#ifdef __BORLANDC__ -#define lua_stdin_is_tty() isatty(_fileno(stdin)) -#else -#define lua_stdin_is_tty() _isatty(_fileno(stdin)) -#endif -#else -#define lua_stdin_is_tty() 1 -#endif - -#if !LJ_TARGET_CONSOLE -#include -#endif - -static lua_State *globalL = NULL; -static const char *progname = LUA_PROGNAME; - -#if !LJ_TARGET_CONSOLE -static void lstop(lua_State *L, lua_Debug *ar) -{ - (void)ar; /* unused arg. */ - lua_sethook(L, NULL, 0, 0); - /* Avoid luaL_error -- a C hook doesn't add an extra frame. */ - luaL_where(L, 0); - lua_pushfstring(L, "%sinterrupted!", lua_tostring(L, -1)); - lua_error(L); -} - -static void laction(int i) -{ - signal(i, SIG_DFL); /* if another SIGINT happens before lstop, - terminate process (default action) */ - lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1); -} -#endif - -static void print_usage(void) -{ - fprintf(stderr, - "usage: %s [options]... [script [args]...].\n" - "Available options are:\n" - " -e chunk Execute string " LUA_QL("chunk") ".\n" - " -l name Require library " LUA_QL("name") ".\n" - " -b ... Save or list bytecode.\n" - " -j cmd Perform LuaJIT control command.\n" - " -O[opt] Control LuaJIT optimizations.\n" - " -i Enter interactive mode after executing " LUA_QL("script") ".\n" - " -v Show version information.\n" - " -E Ignore environment variables.\n" - " -- Stop handling options.\n" - " - Execute stdin and stop handling options.\n" - , - progname); - fflush(stderr); -} - -static void l_message(const char *pname, const char *msg) -{ - if (pname) fprintf(stderr, "%s: ", pname); - fprintf(stderr, "%s\n", msg); - fflush(stderr); -} - -static int report(lua_State *L, int status) -{ - if (status && !lua_isnil(L, -1)) { - const char *msg = lua_tostring(L, -1); - if (msg == NULL) msg = "(error object is not a string)"; - l_message(progname, msg); - lua_pop(L, 1); - } - return status; -} - -static int traceback(lua_State *L) -{ - if (!lua_isstring(L, 1)) { /* Non-string error object? Try metamethod. */ - if (lua_isnoneornil(L, 1) || - !luaL_callmeta(L, 1, "__tostring") || - !lua_isstring(L, -1)) - return 1; /* Return non-string error object. */ - lua_remove(L, 1); /* Replace object by result of __tostring metamethod. */ - } - luaL_traceback(L, L, lua_tostring(L, 1), 1); - return 1; -} - -static int docall(lua_State *L, int narg, int clear) -{ - int status; - int base = lua_gettop(L) - narg; /* function index */ - lua_pushcfunction(L, traceback); /* push traceback function */ - lua_insert(L, base); /* put it under chunk and args */ -#if !LJ_TARGET_CONSOLE - signal(SIGINT, laction); -#endif - status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); -#if !LJ_TARGET_CONSOLE - signal(SIGINT, SIG_DFL); -#endif - lua_remove(L, base); /* remove traceback function */ - /* force a complete garbage collection in case of errors */ - if (status != 0) lua_gc(L, LUA_GCCOLLECT, 0); - return status; -} - -static void print_version(void) -{ - fputs(LUAJIT_VERSION " -- " LUAJIT_COPYRIGHT ". " LUAJIT_URL "\n", stdout); -} - -static void print_jit_status(lua_State *L) -{ - int n; - const char *s; - lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); - lua_getfield(L, -1, "jit"); /* Get jit.* module table. */ - lua_remove(L, -2); - lua_getfield(L, -1, "status"); - lua_remove(L, -2); - n = lua_gettop(L); - lua_call(L, 0, LUA_MULTRET); - fputs(lua_toboolean(L, n) ? "JIT: ON" : "JIT: OFF", stdout); - for (n++; (s = lua_tostring(L, n)); n++) { - putc(' ', stdout); - fputs(s, stdout); - } - putc('\n', stdout); -} - -static int getargs(lua_State *L, char **argv, int n) -{ - int narg; - int i; - int argc = 0; - while (argv[argc]) argc++; /* count total number of arguments */ - narg = argc - (n + 1); /* number of arguments to the script */ - luaL_checkstack(L, narg + 3, "too many arguments to script"); - for (i = n+1; i < argc; i++) - lua_pushstring(L, argv[i]); - lua_createtable(L, narg, n + 1); - for (i = 0; i < argc; i++) { - lua_pushstring(L, argv[i]); - lua_rawseti(L, -2, i - n); - } - return narg; -} - -static int dofile(lua_State *L, const char *name) -{ - int status = luaL_loadfile(L, name) || docall(L, 0, 1); - return report(L, status); -} - -static int dostring(lua_State *L, const char *s, const char *name) -{ - int status = luaL_loadbuffer(L, s, strlen(s), name) || docall(L, 0, 1); - return report(L, status); -} - -static int dolibrary(lua_State *L, const char *name) -{ - lua_getglobal(L, "require"); - lua_pushstring(L, name); - return report(L, docall(L, 1, 1)); -} - -static void write_prompt(lua_State *L, int firstline) -{ - const char *p; - lua_getfield(L, LUA_GLOBALSINDEX, firstline ? "_PROMPT" : "_PROMPT2"); - p = lua_tostring(L, -1); - if (p == NULL) p = firstline ? LUA_PROMPT : LUA_PROMPT2; - fputs(p, stdout); - fflush(stdout); - lua_pop(L, 1); /* remove global */ -} - -static int incomplete(lua_State *L, int status) -{ - if (status == LUA_ERRSYNTAX) { - size_t lmsg; - const char *msg = lua_tolstring(L, -1, &lmsg); - const char *tp = msg + lmsg - (sizeof(LUA_QL("")) - 1); - if (strstr(msg, LUA_QL("")) == tp) { - lua_pop(L, 1); - return 1; - } - } - return 0; /* else... */ -} - -static int pushline(lua_State *L, int firstline) -{ - char buf[LUA_MAXINPUT]; - write_prompt(L, firstline); - if (fgets(buf, LUA_MAXINPUT, stdin)) { - size_t len = strlen(buf); - if (len > 0 && buf[len-1] == '\n') - buf[len-1] = '\0'; - if (firstline && buf[0] == '=') - lua_pushfstring(L, "return %s", buf+1); - else - lua_pushstring(L, buf); - return 1; - } - return 0; -} - -static int loadline(lua_State *L) -{ - int status; - lua_settop(L, 0); - if (!pushline(L, 1)) - return -1; /* no input */ - for (;;) { /* repeat until gets a complete line */ - status = luaL_loadbuffer(L, lua_tostring(L, 1), lua_strlen(L, 1), "=stdin"); - if (!incomplete(L, status)) break; /* cannot try to add lines? */ - if (!pushline(L, 0)) /* no more input? */ - return -1; - lua_pushliteral(L, "\n"); /* add a new line... */ - lua_insert(L, -2); /* ...between the two lines */ - lua_concat(L, 3); /* join them */ - } - lua_remove(L, 1); /* remove line */ - return status; -} - -static void dotty(lua_State *L) -{ - int status; - const char *oldprogname = progname; - progname = NULL; - while ((status = loadline(L)) != -1) { - if (status == 0) status = docall(L, 0, 0); - report(L, status); - if (status == 0 && lua_gettop(L) > 0) { /* any result to print? */ - lua_getglobal(L, "print"); - lua_insert(L, 1); - if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != 0) - l_message(progname, - lua_pushfstring(L, "error calling " LUA_QL("print") " (%s)", - lua_tostring(L, -1))); - } - } - lua_settop(L, 0); /* clear stack */ - fputs("\n", stdout); - fflush(stdout); - progname = oldprogname; -} - -static int handle_script(lua_State *L, char **argv, int n) -{ - int status; - const char *fname; - int narg = getargs(L, argv, n); /* collect arguments */ - lua_setglobal(L, "arg"); - fname = argv[n]; - if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0) - fname = NULL; /* stdin */ - status = luaL_loadfile(L, fname); - lua_insert(L, -(narg+1)); - if (status == 0) - status = docall(L, narg, 0); - else - lua_pop(L, narg); - return report(L, status); -} - -/* Load add-on module. */ -static int loadjitmodule(lua_State *L) -{ - lua_getglobal(L, "require"); - lua_pushliteral(L, "jit."); - lua_pushvalue(L, -3); - lua_concat(L, 2); - if (lua_pcall(L, 1, 1, 0)) { - const char *msg = lua_tostring(L, -1); - if (msg && !strncmp(msg, "module ", 7)) - goto nomodule; - return report(L, 1); - } - lua_getfield(L, -1, "start"); - if (lua_isnil(L, -1)) { - nomodule: - l_message(progname, - "unknown luaJIT command or jit.* modules not installed"); - return 1; - } - lua_remove(L, -2); /* Drop module table. */ - return 0; -} - -/* Run command with options. */ -static int runcmdopt(lua_State *L, const char *opt) -{ - int narg = 0; - if (opt && *opt) { - for (;;) { /* Split arguments. */ - const char *p = strchr(opt, ','); - narg++; - if (!p) break; - if (p == opt) - lua_pushnil(L); - else - lua_pushlstring(L, opt, (size_t)(p - opt)); - opt = p + 1; - } - if (*opt) - lua_pushstring(L, opt); - else - lua_pushnil(L); - } - return report(L, lua_pcall(L, narg, 0, 0)); -} - -/* JIT engine control command: try jit library first or load add-on module. */ -static int dojitcmd(lua_State *L, const char *cmd) -{ - const char *opt = strchr(cmd, '='); - lua_pushlstring(L, cmd, opt ? (size_t)(opt - cmd) : strlen(cmd)); - lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); - lua_getfield(L, -1, "jit"); /* Get jit.* module table. */ - lua_remove(L, -2); - lua_pushvalue(L, -2); - lua_gettable(L, -2); /* Lookup library function. */ - if (!lua_isfunction(L, -1)) { - lua_pop(L, 2); /* Drop non-function and jit.* table, keep module name. */ - if (loadjitmodule(L)) - return 1; - } else { - lua_remove(L, -2); /* Drop jit.* table. */ - } - lua_remove(L, -2); /* Drop module name. */ - return runcmdopt(L, opt ? opt+1 : opt); -} - -/* Optimization flags. */ -static int dojitopt(lua_State *L, const char *opt) -{ - lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); - lua_getfield(L, -1, "jit.opt"); /* Get jit.opt.* module table. */ - lua_remove(L, -2); - lua_getfield(L, -1, "start"); - lua_remove(L, -2); - return runcmdopt(L, opt); -} - -/* Save or list bytecode. */ -static int dobytecode(lua_State *L, char **argv) -{ - int narg = 0; - lua_pushliteral(L, "bcsave"); - if (loadjitmodule(L)) - return 1; - if (argv[0][2]) { - narg++; - argv[0][1] = '-'; - lua_pushstring(L, argv[0]+1); - } - for (argv++; *argv != NULL; narg++, argv++) - lua_pushstring(L, *argv); - return report(L, lua_pcall(L, narg, 0, 0)); -} - -/* check that argument has no extra characters at the end */ -#define notail(x) {if ((x)[2] != '\0') return -1;} - -#define FLAGS_INTERACTIVE 1 -#define FLAGS_VERSION 2 -#define FLAGS_EXEC 4 -#define FLAGS_OPTION 8 -#define FLAGS_NOENV 16 - -static int collectargs(char **argv, int *flags) -{ - int i; - for (i = 1; argv[i] != NULL; i++) { - if (argv[i][0] != '-') /* Not an option? */ - return i; - switch (argv[i][1]) { /* Check option. */ - case '-': - notail(argv[i]); - return (argv[i+1] != NULL ? i+1 : 0); - case '\0': - return i; - case 'i': - notail(argv[i]); - *flags |= FLAGS_INTERACTIVE; - /* fallthrough */ - case 'v': - notail(argv[i]); - *flags |= FLAGS_VERSION; - break; - case 'e': - *flags |= FLAGS_EXEC; - case 'j': /* LuaJIT extension */ - case 'l': - *flags |= FLAGS_OPTION; - if (argv[i][2] == '\0') { - i++; - if (argv[i] == NULL) return -1; - } - break; - case 'O': break; /* LuaJIT extension */ - case 'b': /* LuaJIT extension */ - if (*flags) return -1; - *flags |= FLAGS_EXEC; - return 0; - case 'E': - *flags |= FLAGS_NOENV; - break; - default: return -1; /* invalid option */ - } - } - return 0; -} - -static int runargs(lua_State *L, char **argv, int n) -{ - int i; - for (i = 1; i < n; i++) { - if (argv[i] == NULL) continue; - lua_assert(argv[i][0] == '-'); - switch (argv[i][1]) { /* option */ - case 'e': { - const char *chunk = argv[i] + 2; - if (*chunk == '\0') chunk = argv[++i]; - lua_assert(chunk != NULL); - if (dostring(L, chunk, "=(command line)") != 0) - return 1; - break; - } - case 'l': { - const char *filename = argv[i] + 2; - if (*filename == '\0') filename = argv[++i]; - lua_assert(filename != NULL); - if (dolibrary(L, filename)) - return 1; /* stop if file fails */ - break; - } - case 'j': { /* LuaJIT extension */ - const char *cmd = argv[i] + 2; - if (*cmd == '\0') cmd = argv[++i]; - lua_assert(cmd != NULL); - if (dojitcmd(L, cmd)) - return 1; - break; - } - case 'O': /* LuaJIT extension */ - if (dojitopt(L, argv[i] + 2)) - return 1; - break; - case 'b': /* LuaJIT extension */ - return dobytecode(L, argv+i); - default: break; - } - } - return 0; -} - -static int handle_luainit(lua_State *L) -{ -#if LJ_TARGET_CONSOLE - const char *init = NULL; -#else - const char *init = getenv(LUA_INIT); -#endif - if (init == NULL) - return 0; /* status OK */ - else if (init[0] == '@') - return dofile(L, init+1); - else - return dostring(L, init, "=" LUA_INIT); -} - -static struct Smain { - char **argv; - int argc; - int status; -} smain; - -static int pmain(lua_State *L) -{ - struct Smain *s = &smain; - char **argv = s->argv; - int script; - int flags = 0; - globalL = L; - if (argv[0] && argv[0][0]) progname = argv[0]; - LUAJIT_VERSION_SYM(); /* linker-enforced version check */ - script = collectargs(argv, &flags); - if (script < 0) { /* invalid args? */ - print_usage(); - s->status = 1; - return 0; - } - if ((flags & FLAGS_NOENV)) { - lua_pushboolean(L, 1); - lua_setfield(L, LUA_REGISTRYINDEX, "LUA_NOENV"); - } - lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */ - luaL_openlibs(L); /* open libraries */ - lua_gc(L, LUA_GCRESTART, -1); - if (!(flags & FLAGS_NOENV)) { - s->status = handle_luainit(L); - if (s->status != 0) return 0; - } - if ((flags & FLAGS_VERSION)) print_version(); - s->status = runargs(L, argv, (script > 0) ? script : s->argc); - if (s->status != 0) return 0; - if (script) { - s->status = handle_script(L, argv, script); - if (s->status != 0) return 0; - } - if ((flags & FLAGS_INTERACTIVE)) { - print_jit_status(L); - dotty(L); - } else if (script == 0 && !(flags & (FLAGS_EXEC|FLAGS_VERSION))) { - if (lua_stdin_is_tty()) { - print_version(); - print_jit_status(L); - dotty(L); - } else { - dofile(L, NULL); /* executes stdin as a file */ - } - } - return 0; -} - -int main(int argc, char **argv) -{ - int status; - lua_State *L = lua_open(); /* create state */ - if (L == NULL) { - l_message(argv[0], "cannot create state: not enough memory"); - return EXIT_FAILURE; - } - smain.argc = argc; - smain.argv = argv; - status = lua_cpcall(L, pmain, NULL); - report(L, status); - lua_close(L); - return (status || smain.status) ? EXIT_FAILURE : EXIT_SUCCESS; -} - diff --git a/subprojects/luajit/src/luajit.h b/subprojects/luajit/src/luajit.h deleted file mode 100644 index c5ff3acb4..000000000 --- a/subprojects/luajit/src/luajit.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -** LuaJIT -- a Just-In-Time Compiler for Lua. http://luajit.org/ -** -** Copyright (C) 2005-2017 Mike Pall. All rights reserved. -** -** 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -** -** [ MIT license: http://www.opensource.org/licenses/mit-license.php ] -*/ - -#ifndef _LUAJIT_H -#define _LUAJIT_H - -#include "lua.h" - -#define LUAJIT_VERSION "LuaJIT 2.0.5" -#define LUAJIT_VERSION_NUM 20005 /* Version 2.0.5 = 02.00.05. */ -#define LUAJIT_VERSION_SYM luaJIT_version_2_0_5 -#define LUAJIT_COPYRIGHT "Copyright (C) 2005-2017 Mike Pall" -#define LUAJIT_URL "http://luajit.org/" - -/* Modes for luaJIT_setmode. */ -#define LUAJIT_MODE_MASK 0x00ff - -enum { - LUAJIT_MODE_ENGINE, /* Set mode for whole JIT engine. */ - LUAJIT_MODE_DEBUG, /* Set debug mode (idx = level). */ - - LUAJIT_MODE_FUNC, /* Change mode for a function. */ - LUAJIT_MODE_ALLFUNC, /* Recurse into subroutine protos. */ - LUAJIT_MODE_ALLSUBFUNC, /* Change only the subroutines. */ - - LUAJIT_MODE_TRACE, /* Flush a compiled trace. */ - - LUAJIT_MODE_WRAPCFUNC = 0x10, /* Set wrapper mode for C function calls. */ - - LUAJIT_MODE_MAX -}; - -/* Flags or'ed in to the mode. */ -#define LUAJIT_MODE_OFF 0x0000 /* Turn feature off. */ -#define LUAJIT_MODE_ON 0x0100 /* Turn feature on. */ -#define LUAJIT_MODE_FLUSH 0x0200 /* Flush JIT-compiled code. */ - -/* LuaJIT public C API. */ - -/* Control the JIT engine. */ -LUA_API int luaJIT_setmode(lua_State *L, int idx, int mode); - -/* Enforce (dynamic) linker error for version mismatches. Call from main. */ -LUA_API void LUAJIT_VERSION_SYM(void); - -#endif diff --git a/subprojects/luajit/src/lualib.h b/subprojects/luajit/src/lualib.h deleted file mode 100644 index bfc130a1a..000000000 --- a/subprojects/luajit/src/lualib.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -** Standard library header. -** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -*/ - -#ifndef _LUALIB_H -#define _LUALIB_H - -#include "lua.h" - -#define LUA_FILEHANDLE "FILE*" - -#define LUA_COLIBNAME "coroutine" -#define LUA_MATHLIBNAME "math" -#define LUA_STRLIBNAME "string" -#define LUA_TABLIBNAME "table" -#define LUA_IOLIBNAME "io" -#define LUA_OSLIBNAME "os" -#define LUA_LOADLIBNAME "package" -#define LUA_DBLIBNAME "debug" -#define LUA_BITLIBNAME "bit" -#define LUA_JITLIBNAME "jit" -#define LUA_FFILIBNAME "ffi" - -LUALIB_API int luaopen_base(lua_State *L); -LUALIB_API int luaopen_math(lua_State *L); -LUALIB_API int luaopen_string(lua_State *L); -LUALIB_API int luaopen_table(lua_State *L); -LUALIB_API int luaopen_io(lua_State *L); -LUALIB_API int luaopen_os(lua_State *L); -LUALIB_API int luaopen_package(lua_State *L); -LUALIB_API int luaopen_debug(lua_State *L); -LUALIB_API int luaopen_bit(lua_State *L); -LUALIB_API int luaopen_jit(lua_State *L); -LUALIB_API int luaopen_ffi(lua_State *L); - -LUALIB_API void luaL_openlibs(lua_State *L); - -#ifndef lua_assert -#define lua_assert(x) ((void)0) -#endif - -#endif diff --git a/subprojects/luajit/src/vm_arm.dasc b/subprojects/luajit/src/vm_arm.dasc deleted file mode 100644 index be5540ce4..000000000 --- a/subprojects/luajit/src/vm_arm.dasc +++ /dev/null @@ -1,4486 +0,0 @@ -|// Low-level VM code for ARM CPUs. -|// Bytecode interpreter, fast functions and helper functions. -|// Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -| -|.arch arm -|.section code_op, code_sub -| -|.actionlist build_actionlist -|.globals GLOB_ -|.globalnames globnames -|.externnames extnames -| -|// Note: The ragged indentation of the instructions is intentional. -|// The starting columns indicate data dependencies. -| -|//----------------------------------------------------------------------- -| -|// Fixed register assignments for the interpreter. -| -|// The following must be C callee-save. -|.define MASKR8, r4 // 255*8 constant for fast bytecode decoding. -|.define KBASE, r5 // Constants of current Lua function. -|.define PC, r6 // Next PC. -|.define DISPATCH, r7 // Opcode dispatch table. -|.define LREG, r8 // Register holding lua_State (also in SAVE_L). -| -|// C callee-save in EABI, but often refetched. Temporary in iOS 3.0+. -|.define BASE, r9 // Base of current Lua stack frame. -| -|// The following temporaries are not saved across C calls, except for RA/RC. -|.define RA, r10 // Callee-save. -|.define RC, r11 // Callee-save. -|.define RB, r12 -|.define OP, r12 // Overlaps RB, must not be lr. -|.define INS, lr -| -|// Calling conventions. Also used as temporaries. -|.define CARG1, r0 -|.define CARG2, r1 -|.define CARG3, r2 -|.define CARG4, r3 -|.define CARG12, r0 // For 1st soft-fp double. -|.define CARG34, r2 // For 2nd soft-fp double. -| -|.define CRET1, r0 -|.define CRET2, r1 -| -|// Stack layout while in interpreter. Must match with lj_frame.h. -|.define SAVE_R4, [sp, #28] -|.define CFRAME_SPACE, #28 -|.define SAVE_ERRF, [sp, #24] -|.define SAVE_NRES, [sp, #20] -|.define SAVE_CFRAME, [sp, #16] -|.define SAVE_L, [sp, #12] -|.define SAVE_PC, [sp, #8] -|.define SAVE_MULTRES, [sp, #4] -|.define ARG5, [sp] -| -|.define TMPDhi, [sp, #4] -|.define TMPDlo, [sp] -|.define TMPD, [sp] -|.define TMPDp, sp -| -|.if FPU -|.macro saveregs -| push {r5, r6, r7, r8, r9, r10, r11, lr} -| vpush {d8-d15} -| sub sp, sp, CFRAME_SPACE+4 -| str r4, SAVE_R4 -|.endmacro -|.macro restoreregs_ret -| ldr r4, SAVE_R4 -| add sp, sp, CFRAME_SPACE+4 -| vpop {d8-d15} -| pop {r5, r6, r7, r8, r9, r10, r11, pc} -|.endmacro -|.else -|.macro saveregs -| push {r4, r5, r6, r7, r8, r9, r10, r11, lr} -| sub sp, sp, CFRAME_SPACE -|.endmacro -|.macro restoreregs_ret -| add sp, sp, CFRAME_SPACE -| pop {r4, r5, r6, r7, r8, r9, r10, r11, pc} -|.endmacro -|.endif -| -|// Type definitions. Some of these are only used for documentation. -|.type L, lua_State, LREG -|.type GL, global_State -|.type TVALUE, TValue -|.type GCOBJ, GCobj -|.type STR, GCstr -|.type TAB, GCtab -|.type LFUNC, GCfuncL -|.type CFUNC, GCfuncC -|.type PROTO, GCproto -|.type UPVAL, GCupval -|.type NODE, Node -|.type NARGS8, int -|.type TRACE, GCtrace -| -|//----------------------------------------------------------------------- -| -|// Trap for not-yet-implemented parts. -|.macro NYI; ud; .endmacro -| -|//----------------------------------------------------------------------- -| -|// Access to frame relative to BASE. -|.define FRAME_FUNC, #-8 -|.define FRAME_PC, #-4 -| -|.macro decode_RA8, dst, ins; and dst, MASKR8, ins, lsr #5; .endmacro -|.macro decode_RB8, dst, ins; and dst, MASKR8, ins, lsr #21; .endmacro -|.macro decode_RC8, dst, ins; and dst, MASKR8, ins, lsr #13; .endmacro -|.macro decode_RD, dst, ins; lsr dst, ins, #16; .endmacro -|.macro decode_OP, dst, ins; and dst, ins, #255; .endmacro -| -|// Instruction fetch. -|.macro ins_NEXT1 -| ldrb OP, [PC] -|.endmacro -|.macro ins_NEXT2 -| ldr INS, [PC], #4 -|.endmacro -|// Instruction decode+dispatch. -|.macro ins_NEXT3 -| ldr OP, [DISPATCH, OP, lsl #2] -| decode_RA8 RA, INS -| decode_RD RC, INS -| bx OP -|.endmacro -|.macro ins_NEXT -| ins_NEXT1 -| ins_NEXT2 -| ins_NEXT3 -|.endmacro -| -|// Instruction footer. -|.if 1 -| // Replicated dispatch. Less unpredictable branches, but higher I-Cache use. -| .define ins_next, ins_NEXT -| .define ins_next_, ins_NEXT -| .define ins_next1, ins_NEXT1 -| .define ins_next2, ins_NEXT2 -| .define ins_next3, ins_NEXT3 -|.else -| // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch. -| // Affects only certain kinds of benchmarks (and only with -j off). -| .macro ins_next -| b ->ins_next -| .endmacro -| .macro ins_next1 -| .endmacro -| .macro ins_next2 -| .endmacro -| .macro ins_next3 -| b ->ins_next -| .endmacro -| .macro ins_next_ -| ->ins_next: -| ins_NEXT -| .endmacro -|.endif -| -|// Avoid register name substitution for field name. -#define field_pc pc -| -|// Call decode and dispatch. -|.macro ins_callt -| // BASE = new base, CARG3 = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC -| ldr PC, LFUNC:CARG3->field_pc -| ldrb OP, [PC] // STALL: load PC. early PC. -| ldr INS, [PC], #4 -| ldr OP, [DISPATCH, OP, lsl #2] // STALL: load OP. early OP. -| decode_RA8 RA, INS -| add RA, RA, BASE -| bx OP -|.endmacro -| -|.macro ins_call -| // BASE = new base, CARG3 = LFUNC/CFUNC, RC = nargs*8, PC = caller PC -| str PC, [BASE, FRAME_PC] -| ins_callt // STALL: locked PC. -|.endmacro -| -|//----------------------------------------------------------------------- -| -|// Macros to test operand types. -|.macro checktp, reg, tp; cmn reg, #-tp; .endmacro -|.macro checktpeq, reg, tp; cmneq reg, #-tp; .endmacro -|.macro checktpne, reg, tp; cmnne reg, #-tp; .endmacro -|.macro checkstr, reg, target; checktp reg, LJ_TSTR; bne target; .endmacro -|.macro checktab, reg, target; checktp reg, LJ_TTAB; bne target; .endmacro -|.macro checkfunc, reg, target; checktp reg, LJ_TFUNC; bne target; .endmacro -| -|// Assumes DISPATCH is relative to GL. -#define DISPATCH_GL(field) (GG_DISP2G + (int)offsetof(global_State, field)) -#define DISPATCH_J(field) (GG_DISP2J + (int)offsetof(jit_State, field)) -| -#define PC2PROTO(field) ((int)offsetof(GCproto, field)-(int)sizeof(GCproto)) -| -|.macro hotcheck, delta -| lsr CARG1, PC, #1 -| and CARG1, CARG1, #126 -| sub CARG1, CARG1, #-GG_DISP2HOT -| ldrh CARG2, [DISPATCH, CARG1] -| subs CARG2, CARG2, #delta -| strh CARG2, [DISPATCH, CARG1] -|.endmacro -| -|.macro hotloop -| hotcheck HOTCOUNT_LOOP -| blo ->vm_hotloop -|.endmacro -| -|.macro hotcall -| hotcheck HOTCOUNT_CALL -| blo ->vm_hotcall -|.endmacro -| -|// Set current VM state. -|.macro mv_vmstate, reg, st; mvn reg, #LJ_VMST_..st; .endmacro -|.macro st_vmstate, reg; str reg, [DISPATCH, #DISPATCH_GL(vmstate)]; .endmacro -| -|// Move table write barrier back. Overwrites mark and tmp. -|.macro barrierback, tab, mark, tmp -| ldr tmp, [DISPATCH, #DISPATCH_GL(gc.grayagain)] -| bic mark, mark, #LJ_GC_BLACK // black2gray(tab) -| str tab, [DISPATCH, #DISPATCH_GL(gc.grayagain)] -| strb mark, tab->marked -| str tmp, tab->gclist -|.endmacro -| -|.macro .IOS, a, b -|.if IOS -| a, b -|.endif -|.endmacro -| -|//----------------------------------------------------------------------- - -#if !LJ_DUALNUM -#error "Only dual-number mode supported for ARM target" -#endif - -/* Generate subroutines used by opcodes and other parts of the VM. */ -/* The .code_sub section should be last to help static branch prediction. */ -static void build_subroutines(BuildCtx *ctx) -{ - |.code_sub - | - |//----------------------------------------------------------------------- - |//-- Return handling ---------------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_returnp: - | // See vm_return. Also: RB = previous base. - | tst PC, #FRAME_P - | beq ->cont_dispatch - | - | // Return from pcall or xpcall fast func. - | ldr PC, [RB, FRAME_PC] // Fetch PC of previous frame. - | mvn CARG2, #~LJ_TTRUE - | mov BASE, RB - | // Prepending may overwrite the pcall frame, so do it at the end. - | str CARG2, [RA, FRAME_PC] // Prepend true to results. - | sub RA, RA, #8 - | - |->vm_returnc: - | adds RC, RC, #8 // RC = (nresults+1)*8. - | mov CRET1, #LUA_YIELD - | beq ->vm_unwind_c_eh - | str RC, SAVE_MULTRES - | ands CARG1, PC, #FRAME_TYPE - | beq ->BC_RET_Z // Handle regular return to Lua. - | - |->vm_return: - | // BASE = base, RA = resultptr, RC/MULTRES = (nresults+1)*8, PC = return - | // CARG1 = PC & FRAME_TYPE - | bic RB, PC, #FRAME_TYPEP - | cmp CARG1, #FRAME_C - | sub RB, BASE, RB // RB = previous base. - | bne ->vm_returnp - | - | str RB, L->base - | ldr KBASE, SAVE_NRES - | mv_vmstate CARG4, C - | sub BASE, BASE, #8 - | subs CARG3, RC, #8 - | lsl KBASE, KBASE, #3 // KBASE = (nresults_wanted+1)*8 - | st_vmstate CARG4 - | beq >2 - |1: - | subs CARG3, CARG3, #8 - | ldrd CARG12, [RA], #8 - | strd CARG12, [BASE], #8 - | bne <1 - |2: - | cmp KBASE, RC // More/less results wanted? - | bne >6 - |3: - | str BASE, L->top // Store new top. - | - |->vm_leave_cp: - | ldr RC, SAVE_CFRAME // Restore previous C frame. - | mov CRET1, #0 // Ok return status for vm_pcall. - | str RC, L->cframe - | - |->vm_leave_unw: - | restoreregs_ret - | - |6: - | blt >7 // Less results wanted? - | // More results wanted. Check stack size and fill up results with nil. - | ldr CARG3, L->maxstack - | mvn CARG2, #~LJ_TNIL - | cmp BASE, CARG3 - | bhs >8 - | str CARG2, [BASE, #4] - | add RC, RC, #8 - | add BASE, BASE, #8 - | b <2 - | - |7: // Less results wanted. - | sub CARG1, RC, KBASE - | cmp KBASE, #0 // LUA_MULTRET+1 case? - | subne BASE, BASE, CARG1 // Either keep top or shrink it. - | b <3 - | - |8: // Corner case: need to grow stack for filling up results. - | // This can happen if: - | // - A C function grows the stack (a lot). - | // - The GC shrinks the stack in between. - | // - A return back from a lua_call() with (high) nresults adjustment. - | str BASE, L->top // Save current top held in BASE (yes). - | lsr CARG2, KBASE, #3 - | mov CARG1, L - | bl extern lj_state_growstack // (lua_State *L, int n) - | ldr BASE, L->top // Need the (realloced) L->top in BASE. - | b <2 - | - |->vm_unwind_c: // Unwind C stack, return from vm_pcall. - | // (void *cframe, int errcode) - | mov sp, CARG1 - | mov CRET1, CARG2 - |->vm_unwind_c_eh: // Landing pad for external unwinder. - | ldr L, SAVE_L - | mv_vmstate CARG4, C - | ldr GL:CARG3, L->glref - | str CARG4, GL:CARG3->vmstate - | b ->vm_leave_unw - | - |->vm_unwind_ff: // Unwind C stack, return from ff pcall. - | // (void *cframe) - | bic CARG1, CARG1, #~CFRAME_RAWMASK // Use two steps: bic sp is deprecated. - | mov sp, CARG1 - |->vm_unwind_ff_eh: // Landing pad for external unwinder. - | ldr L, SAVE_L - | mov MASKR8, #255 - | mov RC, #16 // 2 results: false + error message. - | lsl MASKR8, MASKR8, #3 // MASKR8 = 255*8. - | ldr BASE, L->base - | ldr DISPATCH, L->glref // Setup pointer to dispatch table. - | mvn CARG1, #~LJ_TFALSE - | sub RA, BASE, #8 // Results start at BASE-8. - | ldr PC, [BASE, FRAME_PC] // Fetch PC of previous frame. - | add DISPATCH, DISPATCH, #GG_G2DISP - | mv_vmstate CARG2, INTERP - | str CARG1, [BASE, #-4] // Prepend false to error message. - | st_vmstate CARG2 - | b ->vm_returnc - | - |//----------------------------------------------------------------------- - |//-- Grow stack for calls ----------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_growstack_c: // Grow stack for C function. - | // CARG1 = L - | mov CARG2, #LUA_MINSTACK - | b >2 - | - |->vm_growstack_l: // Grow stack for Lua function. - | // BASE = new base, RA = BASE+framesize*8, RC = nargs*8, PC = first PC - | add RC, BASE, RC - | sub RA, RA, BASE - | mov CARG1, L - | str BASE, L->base - | add PC, PC, #4 // Must point after first instruction. - | str RC, L->top - | lsr CARG2, RA, #3 - |2: - | // L->base = new base, L->top = top - | str PC, SAVE_PC - | bl extern lj_state_growstack // (lua_State *L, int n) - | ldr BASE, L->base - | ldr RC, L->top - | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] - | sub NARGS8:RC, RC, BASE - | // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC - | ins_callt // Just retry the call. - | - |//----------------------------------------------------------------------- - |//-- Entry points into the assembler VM --------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_resume: // Setup C frame and resume thread. - | // (lua_State *L, TValue *base, int nres1 = 0, ptrdiff_t ef = 0) - | saveregs - | mov L, CARG1 - | ldr DISPATCH, L:CARG1->glref // Setup pointer to dispatch table. - | mov BASE, CARG2 - | add DISPATCH, DISPATCH, #GG_G2DISP - | str L, SAVE_L - | mov PC, #FRAME_CP - | str CARG3, SAVE_NRES - | add CARG2, sp, #CFRAME_RESUME - | ldrb CARG1, L->status - | str CARG3, SAVE_ERRF - | str CARG2, L->cframe - | str CARG3, SAVE_CFRAME - | cmp CARG1, #0 - | str L, SAVE_PC // Any value outside of bytecode is ok. - | beq >3 - | - | // Resume after yield (like a return). - | mov RA, BASE - | ldr BASE, L->base - | ldr CARG1, L->top - | mov MASKR8, #255 - | strb CARG3, L->status - | sub RC, CARG1, BASE - | ldr PC, [BASE, FRAME_PC] - | lsl MASKR8, MASKR8, #3 // MASKR8 = 255*8. - | mv_vmstate CARG2, INTERP - | add RC, RC, #8 - | ands CARG1, PC, #FRAME_TYPE - | st_vmstate CARG2 - | str RC, SAVE_MULTRES - | beq ->BC_RET_Z - | b ->vm_return - | - |->vm_pcall: // Setup protected C frame and enter VM. - | // (lua_State *L, TValue *base, int nres1, ptrdiff_t ef) - | saveregs - | mov PC, #FRAME_CP - | str CARG4, SAVE_ERRF - | b >1 - | - |->vm_call: // Setup C frame and enter VM. - | // (lua_State *L, TValue *base, int nres1) - | saveregs - | mov PC, #FRAME_C - | - |1: // Entry point for vm_pcall above (PC = ftype). - | ldr RC, L:CARG1->cframe - | str CARG3, SAVE_NRES - | mov L, CARG1 - | str CARG1, SAVE_L - | mov BASE, CARG2 - | str sp, L->cframe // Add our C frame to cframe chain. - | ldr DISPATCH, L->glref // Setup pointer to dispatch table. - | str CARG1, SAVE_PC // Any value outside of bytecode is ok. - | str RC, SAVE_CFRAME - | add DISPATCH, DISPATCH, #GG_G2DISP - | - |3: // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype). - | ldr RB, L->base // RB = old base (for vmeta_call). - | ldr CARG1, L->top - | mov MASKR8, #255 - | add PC, PC, BASE - | lsl MASKR8, MASKR8, #3 // MASKR8 = 255*8. - | sub PC, PC, RB // PC = frame delta + frame type - | mv_vmstate CARG2, INTERP - | sub NARGS8:RC, CARG1, BASE - | st_vmstate CARG2 - | - |->vm_call_dispatch: - | // RB = old base, BASE = new base, RC = nargs*8, PC = caller PC - | ldrd CARG34, [BASE, FRAME_FUNC] - | checkfunc CARG4, ->vmeta_call - | - |->vm_call_dispatch_f: - | ins_call - | // BASE = new base, CARG3 = func, RC = nargs*8, PC = caller PC - | - |->vm_cpcall: // Setup protected C frame, call C. - | // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp) - | saveregs - | mov L, CARG1 - | ldr RA, L:CARG1->stack - | str CARG1, SAVE_L - | ldr RB, L->top - | str CARG1, SAVE_PC // Any value outside of bytecode is ok. - | ldr RC, L->cframe - | sub RA, RA, RB // Compute -savestack(L, L->top). - | str sp, L->cframe // Add our C frame to cframe chain. - | mov RB, #0 - | str RA, SAVE_NRES // Neg. delta means cframe w/o frame. - | str RB, SAVE_ERRF // No error function. - | str RC, SAVE_CFRAME - | blx CARG4 // (lua_State *L, lua_CFunction func, void *ud) - | ldr DISPATCH, L->glref // Setup pointer to dispatch table. - | movs BASE, CRET1 - | mov PC, #FRAME_CP - | add DISPATCH, DISPATCH, #GG_G2DISP - | bne <3 // Else continue with the call. - | b ->vm_leave_cp // No base? Just remove C frame. - | - |//----------------------------------------------------------------------- - |//-- Metamethod handling ------------------------------------------------ - |//----------------------------------------------------------------------- - | - |//-- Continuation dispatch ---------------------------------------------- - | - |->cont_dispatch: - | // BASE = meta base, RA = resultptr, RC = (nresults+1)*8 - | ldr LFUNC:CARG3, [RB, FRAME_FUNC] - | ldr CARG1, [BASE, #-16] // Get continuation. - | mov CARG4, BASE - | mov BASE, RB // Restore caller BASE. - |.if FFI - | cmp CARG1, #1 - |.endif - | ldr PC, [CARG4, #-12] // Restore PC from [cont|PC]. - | ldr CARG3, LFUNC:CARG3->field_pc - | mvn INS, #~LJ_TNIL - | add CARG2, RA, RC - | str INS, [CARG2, #-4] // Ensure one valid arg. - |.if FFI - | bls >1 - |.endif - | ldr KBASE, [CARG3, #PC2PROTO(k)] - | // BASE = base, RA = resultptr, CARG4 = meta base - | bx CARG1 - | - |.if FFI - |1: - | beq ->cont_ffi_callback // cont = 1: return from FFI callback. - | // cont = 0: tailcall from C function. - | sub CARG4, CARG4, #16 - | sub RC, CARG4, BASE - | b ->vm_call_tail - |.endif - | - |->cont_cat: // RA = resultptr, CARG4 = meta base - | ldr INS, [PC, #-4] - | sub CARG2, CARG4, #16 - | ldrd CARG34, [RA] - | str BASE, L->base - | decode_RB8 RC, INS - | decode_RA8 RA, INS - | add CARG1, BASE, RC - | subs CARG1, CARG2, CARG1 - | strdne CARG34, [CARG2] - | movne CARG3, CARG1 - | bne ->BC_CAT_Z - | strd CARG34, [BASE, RA] - | b ->cont_nop - | - |//-- Table indexing metamethods ----------------------------------------- - | - |->vmeta_tgets1: - | add CARG2, BASE, RB - | b >2 - | - |->vmeta_tgets: - | sub CARG2, DISPATCH, #-DISPATCH_GL(tmptv) - | mvn CARG4, #~LJ_TTAB - | str TAB:RB, [CARG2] - | str CARG4, [CARG2, #4] - |2: - | mvn CARG4, #~LJ_TSTR - | str STR:RC, TMPDlo - | str CARG4, TMPDhi - | mov CARG3, TMPDp - | b >1 - | - |->vmeta_tgetb: // RC = index - | decode_RB8 RB, INS - | str RC, TMPDlo - | mvn CARG4, #~LJ_TISNUM - | add CARG2, BASE, RB - | str CARG4, TMPDhi - | mov CARG3, TMPDp - | b >1 - | - |->vmeta_tgetv: - | add CARG2, BASE, RB - | add CARG3, BASE, RC - |1: - | str BASE, L->base - | mov CARG1, L - | str PC, SAVE_PC - | bl extern lj_meta_tget // (lua_State *L, TValue *o, TValue *k) - | // Returns TValue * (finished) or NULL (metamethod). - | .IOS ldr BASE, L->base - | cmp CRET1, #0 - | beq >3 - | ldrd CARG34, [CRET1] - | ins_next1 - | ins_next2 - | strd CARG34, [BASE, RA] - | ins_next3 - | - |3: // Call __index metamethod. - | // BASE = base, L->top = new base, stack = cont/func/t/k - | rsb CARG1, BASE, #FRAME_CONT - | ldr BASE, L->top - | mov NARGS8:RC, #16 // 2 args for func(t, k). - | str PC, [BASE, #-12] // [cont|PC] - | add PC, CARG1, BASE - | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] // Guaranteed to be a function here. - | b ->vm_call_dispatch_f - | - |//----------------------------------------------------------------------- - | - |->vmeta_tsets1: - | add CARG2, BASE, RB - | b >2 - | - |->vmeta_tsets: - | sub CARG2, DISPATCH, #-DISPATCH_GL(tmptv) - | mvn CARG4, #~LJ_TTAB - | str TAB:RB, [CARG2] - | str CARG4, [CARG2, #4] - |2: - | mvn CARG4, #~LJ_TSTR - | str STR:RC, TMPDlo - | str CARG4, TMPDhi - | mov CARG3, TMPDp - | b >1 - | - |->vmeta_tsetb: // RC = index - | decode_RB8 RB, INS - | str RC, TMPDlo - | mvn CARG4, #~LJ_TISNUM - | add CARG2, BASE, RB - | str CARG4, TMPDhi - | mov CARG3, TMPDp - | b >1 - | - |->vmeta_tsetv: - | add CARG2, BASE, RB - | add CARG3, BASE, RC - |1: - | str BASE, L->base - | mov CARG1, L - | str PC, SAVE_PC - | bl extern lj_meta_tset // (lua_State *L, TValue *o, TValue *k) - | // Returns TValue * (finished) or NULL (metamethod). - | .IOS ldr BASE, L->base - | cmp CRET1, #0 - | ldrd CARG34, [BASE, RA] - | beq >3 - | ins_next1 - | // NOBARRIER: lj_meta_tset ensures the table is not black. - | strd CARG34, [CRET1] - | ins_next2 - | ins_next3 - | - |3: // Call __newindex metamethod. - | // BASE = base, L->top = new base, stack = cont/func/t/k/(v) - | rsb CARG1, BASE, #FRAME_CONT - | ldr BASE, L->top - | mov NARGS8:RC, #24 // 3 args for func(t, k, v). - | strd CARG34, [BASE, #16] // Copy value to third argument. - | str PC, [BASE, #-12] // [cont|PC] - | add PC, CARG1, BASE - | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] // Guaranteed to be a function here. - | b ->vm_call_dispatch_f - | - |//-- Comparison metamethods --------------------------------------------- - | - |->vmeta_comp: - | mov CARG1, L - | sub PC, PC, #4 - | mov CARG2, RA - | str BASE, L->base - | mov CARG3, RC - | str PC, SAVE_PC - | decode_OP CARG4, INS - | bl extern lj_meta_comp // (lua_State *L, TValue *o1, *o2, int op) - | // Returns 0/1 or TValue * (metamethod). - |3: - | .IOS ldr BASE, L->base - | cmp CRET1, #1 - | bhi ->vmeta_binop - |4: - | ldrh RB, [PC, #2] - | add PC, PC, #4 - | add RB, PC, RB, lsl #2 - | subhs PC, RB, #0x20000 - |->cont_nop: - | ins_next - | - |->cont_ra: // RA = resultptr - | ldr INS, [PC, #-4] - | ldrd CARG12, [RA] - | decode_RA8 CARG3, INS - | strd CARG12, [BASE, CARG3] - | b ->cont_nop - | - |->cont_condt: // RA = resultptr - | ldr CARG2, [RA, #4] - | mvn CARG1, #~LJ_TTRUE - | cmp CARG1, CARG2 // Branch if result is true. - | b <4 - | - |->cont_condf: // RA = resultptr - | ldr CARG2, [RA, #4] - | checktp CARG2, LJ_TFALSE // Branch if result is false. - | b <4 - | - |->vmeta_equal: - | // CARG2, CARG3, CARG4 are already set by BC_ISEQV/BC_ISNEV. - | sub PC, PC, #4 - | str BASE, L->base - | mov CARG1, L - | str PC, SAVE_PC - | bl extern lj_meta_equal // (lua_State *L, GCobj *o1, *o2, int ne) - | // Returns 0/1 or TValue * (metamethod). - | b <3 - | - |->vmeta_equal_cd: - |.if FFI - | sub PC, PC, #4 - | str BASE, L->base - | mov CARG1, L - | mov CARG2, INS - | str PC, SAVE_PC - | bl extern lj_meta_equal_cd // (lua_State *L, BCIns op) - | // Returns 0/1 or TValue * (metamethod). - | b <3 - |.endif - | - |//-- Arithmetic metamethods --------------------------------------------- - | - |->vmeta_arith_vn: - | decode_RB8 RB, INS - | decode_RC8 RC, INS - | add CARG3, BASE, RB - | add CARG4, KBASE, RC - | b >1 - | - |->vmeta_arith_nv: - | decode_RB8 RB, INS - | decode_RC8 RC, INS - | add CARG4, BASE, RB - | add CARG3, KBASE, RC - | b >1 - | - |->vmeta_unm: - | ldr INS, [PC, #-8] - | sub PC, PC, #4 - | add CARG3, BASE, RC - | add CARG4, BASE, RC - | b >1 - | - |->vmeta_arith_vv: - | decode_RB8 RB, INS - | decode_RC8 RC, INS - | add CARG3, BASE, RB - | add CARG4, BASE, RC - |1: - | decode_OP OP, INS - | add CARG2, BASE, RA - | str BASE, L->base - | mov CARG1, L - | str PC, SAVE_PC - | str OP, ARG5 - | bl extern lj_meta_arith // (lua_State *L, TValue *ra,*rb,*rc, BCReg op) - | // Returns NULL (finished) or TValue * (metamethod). - | .IOS ldr BASE, L->base - | cmp CRET1, #0 - | beq ->cont_nop - | - | // Call metamethod for binary op. - |->vmeta_binop: - | // BASE = old base, CRET1 = new base, stack = cont/func/o1/o2 - | sub CARG2, CRET1, BASE - | str PC, [CRET1, #-12] // [cont|PC] - | add PC, CARG2, #FRAME_CONT - | mov BASE, CRET1 - | mov NARGS8:RC, #16 // 2 args for func(o1, o2). - | b ->vm_call_dispatch - | - |->vmeta_len: - | add CARG2, BASE, RC - | str BASE, L->base - | mov CARG1, L - | str PC, SAVE_PC - | bl extern lj_meta_len // (lua_State *L, TValue *o) - | // Returns NULL (retry) or TValue * (metamethod base). - | .IOS ldr BASE, L->base -#if LJ_52 - | cmp CRET1, #0 - | bne ->vmeta_binop // Binop call for compatibility. - | ldr TAB:CARG1, [BASE, RC] - | b ->BC_LEN_Z -#else - | b ->vmeta_binop // Binop call for compatibility. -#endif - | - |//-- Call metamethod ---------------------------------------------------- - | - |->vmeta_call: // Resolve and call __call metamethod. - | // RB = old base, BASE = new base, RC = nargs*8 - | mov CARG1, L - | str RB, L->base // This is the callers base! - | sub CARG2, BASE, #8 - | str PC, SAVE_PC - | add CARG3, BASE, NARGS8:RC - | .IOS mov RA, BASE - | bl extern lj_meta_call // (lua_State *L, TValue *func, TValue *top) - | .IOS mov BASE, RA - | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] // Guaranteed to be a function here. - | add NARGS8:RC, NARGS8:RC, #8 // Got one more argument now. - | ins_call - | - |->vmeta_callt: // Resolve __call for BC_CALLT. - | // BASE = old base, RA = new base, RC = nargs*8 - | mov CARG1, L - | str BASE, L->base - | sub CARG2, RA, #8 - | str PC, SAVE_PC - | add CARG3, RA, NARGS8:RC - | bl extern lj_meta_call // (lua_State *L, TValue *func, TValue *top) - | .IOS ldr BASE, L->base - | ldr LFUNC:CARG3, [RA, FRAME_FUNC] // Guaranteed to be a function here. - | ldr PC, [BASE, FRAME_PC] - | add NARGS8:RC, NARGS8:RC, #8 // Got one more argument now. - | b ->BC_CALLT2_Z - | - |//-- Argument coercion for 'for' statement ------------------------------ - | - |->vmeta_for: - | mov CARG1, L - | str BASE, L->base - | mov CARG2, RA - | str PC, SAVE_PC - | bl extern lj_meta_for // (lua_State *L, TValue *base) - | .IOS ldr BASE, L->base - |.if JIT - | ldrb OP, [PC, #-4] - |.endif - | ldr INS, [PC, #-4] - |.if JIT - | cmp OP, #BC_JFORI - |.endif - | decode_RA8 RA, INS - | decode_RD RC, INS - |.if JIT - | beq =>BC_JFORI - |.endif - | b =>BC_FORI - | - |//----------------------------------------------------------------------- - |//-- Fast functions ----------------------------------------------------- - |//----------------------------------------------------------------------- - | - |.macro .ffunc, name - |->ff_ .. name: - |.endmacro - | - |.macro .ffunc_1, name - |->ff_ .. name: - | ldrd CARG12, [BASE] - | cmp NARGS8:RC, #8 - | blo ->fff_fallback - |.endmacro - | - |.macro .ffunc_2, name - |->ff_ .. name: - | ldrd CARG12, [BASE] - | ldrd CARG34, [BASE, #8] - | cmp NARGS8:RC, #16 - | blo ->fff_fallback - |.endmacro - | - |.macro .ffunc_n, name - | .ffunc_1 name - | checktp CARG2, LJ_TISNUM - | bhs ->fff_fallback - |.endmacro - | - |.macro .ffunc_nn, name - | .ffunc_2 name - | checktp CARG2, LJ_TISNUM - | cmnlo CARG4, #-LJ_TISNUM - | bhs ->fff_fallback - |.endmacro - | - |.macro .ffunc_d, name - | .ffunc name - | ldr CARG2, [BASE, #4] - | cmp NARGS8:RC, #8 - | vldr d0, [BASE] - | blo ->fff_fallback - | checktp CARG2, LJ_TISNUM - | bhs ->fff_fallback - |.endmacro - | - |.macro .ffunc_dd, name - | .ffunc name - | ldr CARG2, [BASE, #4] - | ldr CARG4, [BASE, #12] - | cmp NARGS8:RC, #16 - | vldr d0, [BASE] - | vldr d1, [BASE, #8] - | blo ->fff_fallback - | checktp CARG2, LJ_TISNUM - | cmnlo CARG4, #-LJ_TISNUM - | bhs ->fff_fallback - |.endmacro - | - |// Inlined GC threshold check. Caveat: uses CARG1 and CARG2. - |.macro ffgccheck - | ldr CARG1, [DISPATCH, #DISPATCH_GL(gc.total)] - | ldr CARG2, [DISPATCH, #DISPATCH_GL(gc.threshold)] - | cmp CARG1, CARG2 - | blge ->fff_gcstep - |.endmacro - | - |//-- Base library: checks ----------------------------------------------- - | - |.ffunc_1 assert - | checktp CARG2, LJ_TTRUE - | bhi ->fff_fallback - | ldr PC, [BASE, FRAME_PC] - | strd CARG12, [BASE, #-8] - | mov RB, BASE - | subs RA, NARGS8:RC, #8 - | add RC, NARGS8:RC, #8 // Compute (nresults+1)*8. - | beq ->fff_res // Done if exactly 1 argument. - |1: - | ldrd CARG12, [RB, #8] - | subs RA, RA, #8 - | strd CARG12, [RB], #8 - | bne <1 - | b ->fff_res - | - |.ffunc type - | ldr CARG2, [BASE, #4] - | cmp NARGS8:RC, #8 - | blo ->fff_fallback - | checktp CARG2, LJ_TISNUM - | mvnlo CARG2, #~LJ_TISNUM - | rsb CARG4, CARG2, #(int)(offsetof(GCfuncC, upvalue)>>3)-1 - | lsl CARG4, CARG4, #3 - | ldrd CARG12, [CFUNC:CARG3, CARG4] - | b ->fff_restv - | - |//-- Base library: getters and setters --------------------------------- - | - |.ffunc_1 getmetatable - | checktp CARG2, LJ_TTAB - | cmnne CARG2, #-LJ_TUDATA - | bne >6 - |1: // Field metatable must be at same offset for GCtab and GCudata! - | ldr TAB:RB, TAB:CARG1->metatable - |2: - | mvn CARG2, #~LJ_TNIL - | ldr STR:RC, [DISPATCH, #DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])] - | cmp TAB:RB, #0 - | beq ->fff_restv - | ldr CARG3, TAB:RB->hmask - | ldr CARG4, STR:RC->hash - | ldr NODE:INS, TAB:RB->node - | and CARG3, CARG3, CARG4 // idx = str->hash & tab->hmask - | add CARG3, CARG3, CARG3, lsl #1 - | add NODE:INS, NODE:INS, CARG3, lsl #3 // node = tab->node + idx*3*8 - |3: // Rearranged logic, because we expect _not_ to find the key. - | ldrd CARG34, NODE:INS->key // STALL: early NODE:INS. - | ldrd CARG12, NODE:INS->val - | ldr NODE:INS, NODE:INS->next - | checktp CARG4, LJ_TSTR - | cmpeq CARG3, STR:RC - | beq >5 - | cmp NODE:INS, #0 - | bne <3 - |4: - | mov CARG1, RB // Use metatable as default result. - | mvn CARG2, #~LJ_TTAB - | b ->fff_restv - |5: - | checktp CARG2, LJ_TNIL - | bne ->fff_restv - | b <4 - | - |6: - | checktp CARG2, LJ_TISNUM - | mvnhs CARG2, CARG2 - | movlo CARG2, #~LJ_TISNUM - | add CARG4, DISPATCH, CARG2, lsl #2 - | ldr TAB:RB, [CARG4, #DISPATCH_GL(gcroot[GCROOT_BASEMT])] - | b <2 - | - |.ffunc_2 setmetatable - | // Fast path: no mt for table yet and not clearing the mt. - | checktp CARG2, LJ_TTAB - | ldreq TAB:RB, TAB:CARG1->metatable - | checktpeq CARG4, LJ_TTAB - | ldrbeq CARG4, TAB:CARG1->marked - | cmpeq TAB:RB, #0 - | bne ->fff_fallback - | tst CARG4, #LJ_GC_BLACK // isblack(table) - | str TAB:CARG3, TAB:CARG1->metatable - | beq ->fff_restv - | barrierback TAB:CARG1, CARG4, CARG3 - | b ->fff_restv - | - |.ffunc rawget - | ldrd CARG34, [BASE] - | cmp NARGS8:RC, #16 - | blo ->fff_fallback - | mov CARG2, CARG3 - | checktab CARG4, ->fff_fallback - | mov CARG1, L - | add CARG3, BASE, #8 - | .IOS mov RA, BASE - | bl extern lj_tab_get // (lua_State *L, GCtab *t, cTValue *key) - | // Returns cTValue *. - | .IOS mov BASE, RA - | ldrd CARG12, [CRET1] - | b ->fff_restv - | - |//-- Base library: conversions ------------------------------------------ - | - |.ffunc tonumber - | // Only handles the number case inline (without a base argument). - | ldrd CARG12, [BASE] - | cmp NARGS8:RC, #8 - | bne ->fff_fallback - | checktp CARG2, LJ_TISNUM - | bls ->fff_restv - | b ->fff_fallback - | - |.ffunc_1 tostring - | // Only handles the string or number case inline. - | checktp CARG2, LJ_TSTR - | // A __tostring method in the string base metatable is ignored. - | beq ->fff_restv - | // Handle numbers inline, unless a number base metatable is present. - | ldr CARG4, [DISPATCH, #DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])] - | str BASE, L->base - | checktp CARG2, LJ_TISNUM - | cmpls CARG4, #0 - | str PC, SAVE_PC // Redundant (but a defined value). - | bhi ->fff_fallback - | ffgccheck - | mov CARG1, L - | mov CARG2, BASE - | bl extern lj_str_fromnumber // (lua_State *L, cTValue *o) - | // Returns GCstr *. - | ldr BASE, L->base - | mvn CARG2, #~LJ_TSTR - | b ->fff_restv - | - |//-- Base library: iterators ------------------------------------------- - | - |.ffunc_1 next - | mvn CARG4, #~LJ_TNIL - | checktab CARG2, ->fff_fallback - | strd CARG34, [BASE, NARGS8:RC] // Set missing 2nd arg to nil. - | ldr PC, [BASE, FRAME_PC] - | mov CARG2, CARG1 - | str BASE, L->base // Add frame since C call can throw. - | mov CARG1, L - | str BASE, L->top // Dummy frame length is ok. - | add CARG3, BASE, #8 - | str PC, SAVE_PC - | bl extern lj_tab_next // (lua_State *L, GCtab *t, TValue *key) - | // Returns 0 at end of traversal. - | .IOS ldr BASE, L->base - | cmp CRET1, #0 - | mvneq CRET2, #~LJ_TNIL - | beq ->fff_restv // End of traversal: return nil. - | ldrd CARG12, [BASE, #8] // Copy key and value to results. - | ldrd CARG34, [BASE, #16] - | mov RC, #(2+1)*8 - | strd CARG12, [BASE, #-8] - | strd CARG34, [BASE] - | b ->fff_res - | - |.ffunc_1 pairs - | checktab CARG2, ->fff_fallback -#if LJ_52 - | ldr TAB:RB, TAB:CARG1->metatable -#endif - | ldrd CFUNC:CARG34, CFUNC:CARG3->upvalue[0] - | ldr PC, [BASE, FRAME_PC] -#if LJ_52 - | cmp TAB:RB, #0 - | bne ->fff_fallback -#endif - | mvn CARG2, #~LJ_TNIL - | mov RC, #(3+1)*8 - | strd CFUNC:CARG34, [BASE, #-8] - | str CARG2, [BASE, #12] - | b ->fff_res - | - |.ffunc_2 ipairs_aux - | checktp CARG2, LJ_TTAB - | checktpeq CARG4, LJ_TISNUM - | bne ->fff_fallback - | ldr RB, TAB:CARG1->asize - | ldr RC, TAB:CARG1->array - | add CARG3, CARG3, #1 - | ldr PC, [BASE, FRAME_PC] - | cmp CARG3, RB - | add RC, RC, CARG3, lsl #3 - | strd CARG34, [BASE, #-8] - | ldrdlo CARG12, [RC] - | mov RC, #(0+1)*8 - | bhs >2 // Not in array part? - |1: - | checktp CARG2, LJ_TNIL - | movne RC, #(2+1)*8 - | strdne CARG12, [BASE] - | b ->fff_res - |2: // Check for empty hash part first. Otherwise call C function. - | ldr RB, TAB:CARG1->hmask - | mov CARG2, CARG3 - | cmp RB, #0 - | beq ->fff_res - | .IOS mov RA, BASE - | bl extern lj_tab_getinth // (GCtab *t, int32_t key) - | // Returns cTValue * or NULL. - | .IOS mov BASE, RA - | cmp CRET1, #0 - | beq ->fff_res - | ldrd CARG12, [CRET1] - | b <1 - | - |.ffunc_1 ipairs - | checktab CARG2, ->fff_fallback -#if LJ_52 - | ldr TAB:RB, TAB:CARG1->metatable -#endif - | ldrd CFUNC:CARG34, CFUNC:CARG3->upvalue[0] - | ldr PC, [BASE, FRAME_PC] -#if LJ_52 - | cmp TAB:RB, #0 - | bne ->fff_fallback -#endif - | mov CARG1, #0 - | mvn CARG2, #~LJ_TISNUM - | mov RC, #(3+1)*8 - | strd CFUNC:CARG34, [BASE, #-8] - | strd CARG12, [BASE, #8] - | b ->fff_res - | - |//-- Base library: catch errors ---------------------------------------- - | - |.ffunc pcall - | ldrb RA, [DISPATCH, #DISPATCH_GL(hookmask)] - | cmp NARGS8:RC, #8 - | blo ->fff_fallback - | tst RA, #HOOK_ACTIVE // Remember active hook before pcall. - | mov RB, BASE - | add BASE, BASE, #8 - | moveq PC, #8+FRAME_PCALL - | movne PC, #8+FRAME_PCALLH - | sub NARGS8:RC, NARGS8:RC, #8 - | b ->vm_call_dispatch - | - |.ffunc_2 xpcall - | ldrb RA, [DISPATCH, #DISPATCH_GL(hookmask)] - | checkfunc CARG4, ->fff_fallback // Traceback must be a function. - | mov RB, BASE - | strd CARG12, [BASE, #8] // Swap function and traceback. - | strd CARG34, [BASE] - | tst RA, #HOOK_ACTIVE // Remember active hook before pcall. - | add BASE, BASE, #16 - | moveq PC, #16+FRAME_PCALL - | movne PC, #16+FRAME_PCALLH - | sub NARGS8:RC, NARGS8:RC, #16 - | b ->vm_call_dispatch - | - |//-- Coroutine library -------------------------------------------------- - | - |.macro coroutine_resume_wrap, resume - |.if resume - |.ffunc_1 coroutine_resume - | checktp CARG2, LJ_TTHREAD - | bne ->fff_fallback - |.else - |.ffunc coroutine_wrap_aux - | ldr L:CARG1, CFUNC:CARG3->upvalue[0].gcr - |.endif - | ldr PC, [BASE, FRAME_PC] - | str BASE, L->base - | ldr CARG2, L:CARG1->top - | ldrb RA, L:CARG1->status - | ldr RB, L:CARG1->base - | add CARG3, CARG2, NARGS8:RC - | add CARG4, CARG2, RA - | str PC, SAVE_PC - | cmp CARG4, RB - | beq ->fff_fallback - | ldr CARG4, L:CARG1->maxstack - | ldr RB, L:CARG1->cframe - | cmp RA, #LUA_YIELD - | cmpls CARG3, CARG4 - | cmpls RB, #0 - | bhi ->fff_fallback - |1: - |.if resume - | sub CARG3, CARG3, #8 // Keep resumed thread in stack for GC. - | add BASE, BASE, #8 - | sub NARGS8:RC, NARGS8:RC, #8 - |.endif - | str CARG3, L:CARG1->top - | str BASE, L->top - |2: // Move args to coroutine. - | ldrd CARG34, [BASE, RB] - | cmp RB, NARGS8:RC - | strdne CARG34, [CARG2, RB] - | add RB, RB, #8 - | bne <2 - | - | mov CARG3, #0 - | mov L:RA, L:CARG1 - | mov CARG4, #0 - | bl ->vm_resume // (lua_State *L, TValue *base, 0, 0) - | // Returns thread status. - |4: - | ldr CARG3, L:RA->base - | mv_vmstate CARG2, INTERP - | ldr CARG4, L:RA->top - | st_vmstate CARG2 - | cmp CRET1, #LUA_YIELD - | ldr BASE, L->base - | bhi >8 - | subs RC, CARG4, CARG3 - | ldr CARG1, L->maxstack - | add CARG2, BASE, RC - | beq >6 // No results? - | cmp CARG2, CARG1 - | mov RB, #0 - | bhi >9 // Need to grow stack? - | - | sub CARG4, RC, #8 - | str CARG3, L:RA->top // Clear coroutine stack. - |5: // Move results from coroutine. - | ldrd CARG12, [CARG3, RB] - | cmp RB, CARG4 - | strd CARG12, [BASE, RB] - | add RB, RB, #8 - | bne <5 - |6: - |.if resume - | mvn CARG3, #~LJ_TTRUE - | add RC, RC, #16 - |7: - | str CARG3, [BASE, #-4] // Prepend true/false to results. - | sub RA, BASE, #8 - |.else - | mov RA, BASE - | add RC, RC, #8 - |.endif - | ands CARG1, PC, #FRAME_TYPE - | str PC, SAVE_PC - | str RC, SAVE_MULTRES - | beq ->BC_RET_Z - | b ->vm_return - | - |8: // Coroutine returned with error (at co->top-1). - |.if resume - | ldrd CARG12, [CARG4, #-8]! - | mvn CARG3, #~LJ_TFALSE - | mov RC, #(2+1)*8 - | str CARG4, L:RA->top // Remove error from coroutine stack. - | strd CARG12, [BASE] // Copy error message. - | b <7 - |.else - | mov CARG1, L - | mov CARG2, L:RA - | bl extern lj_ffh_coroutine_wrap_err // (lua_State *L, lua_State *co) - | // Never returns. - |.endif - | - |9: // Handle stack expansion on return from yield. - | mov CARG1, L - | lsr CARG2, RC, #3 - | bl extern lj_state_growstack // (lua_State *L, int n) - | mov CRET1, #0 - | b <4 - |.endmacro - | - | coroutine_resume_wrap 1 // coroutine.resume - | coroutine_resume_wrap 0 // coroutine.wrap - | - |.ffunc coroutine_yield - | ldr CARG1, L->cframe - | add CARG2, BASE, NARGS8:RC - | str BASE, L->base - | tst CARG1, #CFRAME_RESUME - | str CARG2, L->top - | mov CRET1, #LUA_YIELD - | mov CARG3, #0 - | beq ->fff_fallback - | str CARG3, L->cframe - | strb CRET1, L->status - | b ->vm_leave_unw - | - |//-- Math library ------------------------------------------------------- - | - |.macro math_round, func - | .ffunc_1 math_ .. func - | checktp CARG2, LJ_TISNUM - | beq ->fff_restv - | bhi ->fff_fallback - | // Round FP value and normalize result. - | lsl CARG3, CARG2, #1 - | adds RB, CARG3, #0x00200000 - | bpl >2 // |x| < 1? - | mvn CARG4, #0x3e0 - | subs RB, CARG4, RB, asr #21 - | lsl CARG4, CARG2, #11 - | lsl CARG3, CARG1, #11 - | orr CARG4, CARG4, #0x80000000 - | rsb INS, RB, #32 - | orr CARG4, CARG4, CARG1, lsr #21 - | bls >3 // |x| >= 2^31? - | orr CARG3, CARG3, CARG4, lsl INS - | lsr CARG1, CARG4, RB - |.if "func" == "floor" - | tst CARG3, CARG2, asr #31 - | addne CARG1, CARG1, #1 - |.else - | bics CARG3, CARG3, CARG2, asr #31 - | addsne CARG1, CARG1, #1 - | ldrdvs CARG12, >9 - | bvs ->fff_restv - |.endif - | cmp CARG2, #0 - | rsblt CARG1, CARG1, #0 - |1: - | mvn CARG2, #~LJ_TISNUM - | b ->fff_restv - | - |2: // |x| < 1 - | bcs ->fff_restv // |x| is not finite. - | orr CARG3, CARG3, CARG1 // ztest = abs(hi) | lo - |.if "func" == "floor" - | tst CARG3, CARG2, asr #31 // return (ztest & sign) == 0 ? 0 : -1 - | moveq CARG1, #0 - | mvnne CARG1, #0 - |.else - | bics CARG3, CARG3, CARG2, asr #31 // return (ztest & ~sign) == 0 ? 0 : 1 - | moveq CARG1, #0 - | movne CARG1, #1 - |.endif - | mvn CARG2, #~LJ_TISNUM - | b ->fff_restv - | - |3: // |x| >= 2^31. Check for x == -(2^31). - | cmpeq CARG4, #0x80000000 - |.if "func" == "floor" - | cmpeq CARG3, #0 - |.endif - | bne >4 - | cmp CARG2, #0 - | movmi CARG1, #0x80000000 - | bmi <1 - |4: - | bl ->vm_..func.._sf - | b ->fff_restv - |.endmacro - | - | math_round floor - | math_round ceil - | - |.align 8 - |9: - | .long 0x00000000, 0x41e00000 // 2^31. - | - |.ffunc_1 math_abs - | checktp CARG2, LJ_TISNUM - | bhi ->fff_fallback - | bicne CARG2, CARG2, #0x80000000 - | bne ->fff_restv - | cmp CARG1, #0 - | rsbslt CARG1, CARG1, #0 - | ldrdvs CARG12, <9 - | // Fallthrough. - | - |->fff_restv: - | // CARG12 = TValue result. - | ldr PC, [BASE, FRAME_PC] - | strd CARG12, [BASE, #-8] - |->fff_res1: - | // PC = return. - | mov RC, #(1+1)*8 - |->fff_res: - | // RC = (nresults+1)*8, PC = return. - | ands CARG1, PC, #FRAME_TYPE - | ldreq INS, [PC, #-4] - | str RC, SAVE_MULTRES - | sub RA, BASE, #8 - | bne ->vm_return - | decode_RB8 RB, INS - |5: - | cmp RB, RC // More results expected? - | bhi >6 - | decode_RA8 CARG1, INS - | ins_next1 - | ins_next2 - | // Adjust BASE. KBASE is assumed to be set for the calling frame. - | sub BASE, RA, CARG1 - | ins_next3 - | - |6: // Fill up results with nil. - | add CARG2, RA, RC - | mvn CARG1, #~LJ_TNIL - | add RC, RC, #8 - | str CARG1, [CARG2, #-4] - | b <5 - | - |.macro math_extern, func - |.if HFABI - | .ffunc_d math_ .. func - |.else - | .ffunc_n math_ .. func - |.endif - | .IOS mov RA, BASE - | bl extern func - | .IOS mov BASE, RA - |.if HFABI - | b ->fff_resd - |.else - | b ->fff_restv - |.endif - |.endmacro - | - |.macro math_extern2, func - |.if HFABI - | .ffunc_dd math_ .. func - |.else - | .ffunc_nn math_ .. func - |.endif - | .IOS mov RA, BASE - | bl extern func - | .IOS mov BASE, RA - |.if HFABI - | b ->fff_resd - |.else - | b ->fff_restv - |.endif - |.endmacro - | - |.if FPU - | .ffunc_d math_sqrt - | vsqrt.f64 d0, d0 - |->fff_resd: - | ldr PC, [BASE, FRAME_PC] - | vstr d0, [BASE, #-8] - | b ->fff_res1 - |.else - | math_extern sqrt - |.endif - | - |.ffunc math_log - |.if HFABI - | ldr CARG2, [BASE, #4] - | cmp NARGS8:RC, #8 // Need exactly 1 argument. - | vldr d0, [BASE] - | bne ->fff_fallback - |.else - | ldrd CARG12, [BASE] - | cmp NARGS8:RC, #8 // Need exactly 1 argument. - | bne ->fff_fallback - |.endif - | checktp CARG2, LJ_TISNUM - | bhs ->fff_fallback - | .IOS mov RA, BASE - | bl extern log - | .IOS mov BASE, RA - |.if HFABI - | b ->fff_resd - |.else - | b ->fff_restv - |.endif - | - | math_extern log10 - | math_extern exp - | math_extern sin - | math_extern cos - | math_extern tan - | math_extern asin - | math_extern acos - | math_extern atan - | math_extern sinh - | math_extern cosh - | math_extern tanh - | math_extern2 pow - | math_extern2 atan2 - | math_extern2 fmod - | - |->ff_math_deg: - |.if FPU - | .ffunc_d math_rad - | vldr d1, CFUNC:CARG3->upvalue[0] - | vmul.f64 d0, d0, d1 - | b ->fff_resd - |.else - | .ffunc_n math_rad - | ldrd CARG34, CFUNC:CARG3->upvalue[0] - | bl extern __aeabi_dmul - | b ->fff_restv - |.endif - | - |.if HFABI - | .ffunc math_ldexp - | ldr CARG4, [BASE, #4] - | ldrd CARG12, [BASE, #8] - | cmp NARGS8:RC, #16 - | blo ->fff_fallback - | vldr d0, [BASE] - | checktp CARG4, LJ_TISNUM - | bhs ->fff_fallback - | checktp CARG2, LJ_TISNUM - | bne ->fff_fallback - | .IOS mov RA, BASE - | bl extern ldexp // (double x, int exp) - | .IOS mov BASE, RA - | b ->fff_resd - |.else - |.ffunc_2 math_ldexp - | checktp CARG2, LJ_TISNUM - | bhs ->fff_fallback - | checktp CARG4, LJ_TISNUM - | bne ->fff_fallback - | .IOS mov RA, BASE - | bl extern ldexp // (double x, int exp) - | .IOS mov BASE, RA - | b ->fff_restv - |.endif - | - |.if HFABI - |.ffunc_d math_frexp - | mov CARG1, sp - | .IOS mov RA, BASE - | bl extern frexp - | .IOS mov BASE, RA - | ldr CARG3, [sp] - | mvn CARG4, #~LJ_TISNUM - | ldr PC, [BASE, FRAME_PC] - | vstr d0, [BASE, #-8] - | mov RC, #(2+1)*8 - | strd CARG34, [BASE] - | b ->fff_res - |.else - |.ffunc_n math_frexp - | mov CARG3, sp - | .IOS mov RA, BASE - | bl extern frexp - | .IOS mov BASE, RA - | ldr CARG3, [sp] - | mvn CARG4, #~LJ_TISNUM - | ldr PC, [BASE, FRAME_PC] - | strd CARG12, [BASE, #-8] - | mov RC, #(2+1)*8 - | strd CARG34, [BASE] - | b ->fff_res - |.endif - | - |.if HFABI - |.ffunc_d math_modf - | sub CARG1, BASE, #8 - | ldr PC, [BASE, FRAME_PC] - | .IOS mov RA, BASE - | bl extern modf - | .IOS mov BASE, RA - | mov RC, #(2+1)*8 - | vstr d0, [BASE] - | b ->fff_res - |.else - |.ffunc_n math_modf - | sub CARG3, BASE, #8 - | ldr PC, [BASE, FRAME_PC] - | .IOS mov RA, BASE - | bl extern modf - | .IOS mov BASE, RA - | mov RC, #(2+1)*8 - | strd CARG12, [BASE] - | b ->fff_res - |.endif - | - |.macro math_minmax, name, cond, fcond - |.if FPU - | .ffunc_1 name - | add RB, BASE, RC - | checktp CARG2, LJ_TISNUM - | add RA, BASE, #8 - | bne >4 - |1: // Handle integers. - | ldrd CARG34, [RA] - | cmp RA, RB - | bhs ->fff_restv - | checktp CARG4, LJ_TISNUM - | bne >3 - | cmp CARG1, CARG3 - | add RA, RA, #8 - | mov..cond CARG1, CARG3 - | b <1 - |3: // Convert intermediate result to number and continue below. - | vmov s4, CARG1 - | bhi ->fff_fallback - | vldr d1, [RA] - | vcvt.f64.s32 d0, s4 - | b >6 - | - |4: - | vldr d0, [BASE] - | bhi ->fff_fallback - |5: // Handle numbers. - | ldrd CARG34, [RA] - | vldr d1, [RA] - | cmp RA, RB - | bhs ->fff_resd - | checktp CARG4, LJ_TISNUM - | bhs >7 - |6: - | vcmp.f64 d0, d1 - | vmrs - | add RA, RA, #8 - | vmov..fcond.f64 d0, d1 - | b <5 - |7: // Convert integer to number and continue above. - | vmov s4, CARG3 - | bhi ->fff_fallback - | vcvt.f64.s32 d1, s4 - | b <6 - | - |.else - | - | .ffunc_1 name - | checktp CARG2, LJ_TISNUM - | mov RA, #8 - | bne >4 - |1: // Handle integers. - | ldrd CARG34, [BASE, RA] - | cmp RA, RC - | bhs ->fff_restv - | checktp CARG4, LJ_TISNUM - | bne >3 - | cmp CARG1, CARG3 - | add RA, RA, #8 - | mov..cond CARG1, CARG3 - | b <1 - |3: // Convert intermediate result to number and continue below. - | bhi ->fff_fallback - | bl extern __aeabi_i2d - | ldrd CARG34, [BASE, RA] - | b >6 - | - |4: - | bhi ->fff_fallback - |5: // Handle numbers. - | ldrd CARG34, [BASE, RA] - | cmp RA, RC - | bhs ->fff_restv - | checktp CARG4, LJ_TISNUM - | bhs >7 - |6: - | bl extern __aeabi_cdcmple - | add RA, RA, #8 - | mov..fcond CARG1, CARG3 - | mov..fcond CARG2, CARG4 - | b <5 - |7: // Convert integer to number and continue above. - | bhi ->fff_fallback - | strd CARG12, TMPD - | mov CARG1, CARG3 - | bl extern __aeabi_i2d - | ldrd CARG34, TMPD - | b <6 - |.endif - |.endmacro - | - | math_minmax math_min, gt, hi - | math_minmax math_max, lt, lo - | - |//-- String library ----------------------------------------------------- - | - |.ffunc_1 string_len - | checkstr CARG2, ->fff_fallback - | ldr CARG1, STR:CARG1->len - | mvn CARG2, #~LJ_TISNUM - | b ->fff_restv - | - |.ffunc string_byte // Only handle the 1-arg case here. - | ldrd CARG12, [BASE] - | ldr PC, [BASE, FRAME_PC] - | cmp NARGS8:RC, #8 - | checktpeq CARG2, LJ_TSTR // Need exactly 1 argument. - | bne ->fff_fallback - | ldr CARG3, STR:CARG1->len - | ldrb CARG1, STR:CARG1[1] // Access is always ok (NUL at end). - | mvn CARG2, #~LJ_TISNUM - | cmp CARG3, #0 - | moveq RC, #(0+1)*8 - | movne RC, #(1+1)*8 - | strd CARG12, [BASE, #-8] - | b ->fff_res - | - |.ffunc string_char // Only handle the 1-arg case here. - | ffgccheck - | ldrd CARG12, [BASE] - | ldr PC, [BASE, FRAME_PC] - | cmp NARGS8:RC, #8 // Need exactly 1 argument. - | checktpeq CARG2, LJ_TISNUM - | bicseq CARG4, CARG1, #255 - | mov CARG3, #1 - | bne ->fff_fallback - | str CARG1, TMPD - | mov CARG2, TMPDp // Points to stack. Little-endian. - |->fff_newstr: - | // CARG2 = str, CARG3 = len. - | str BASE, L->base - | mov CARG1, L - | str PC, SAVE_PC - | bl extern lj_str_new // (lua_State *L, char *str, size_t l) - | // Returns GCstr *. - | ldr BASE, L->base - | mvn CARG2, #~LJ_TSTR - | b ->fff_restv - | - |.ffunc string_sub - | ffgccheck - | ldrd CARG12, [BASE] - | ldrd CARG34, [BASE, #16] - | cmp NARGS8:RC, #16 - | mvn RB, #0 - | beq >1 - | blo ->fff_fallback - | checktp CARG4, LJ_TISNUM - | mov RB, CARG3 - | bne ->fff_fallback - |1: - | ldrd CARG34, [BASE, #8] - | checktp CARG2, LJ_TSTR - | ldreq CARG2, STR:CARG1->len - | checktpeq CARG4, LJ_TISNUM - | bne ->fff_fallback - | // CARG1 = str, CARG2 = str->len, CARG3 = start, RB = end - | add CARG4, CARG2, #1 - | cmp CARG3, #0 // if (start < 0) start += len+1 - | addlt CARG3, CARG3, CARG4 - | cmp CARG3, #1 // if (start < 1) start = 1 - | movlt CARG3, #1 - | cmp RB, #0 // if (end < 0) end += len+1 - | addlt RB, RB, CARG4 - | bic RB, RB, RB, asr #31 // if (end < 0) end = 0 - | cmp RB, CARG2 // if (end > len) end = len - | add CARG1, STR:CARG1, #sizeof(GCstr)-1 - | movgt RB, CARG2 - | add CARG2, CARG1, CARG3 - | subs CARG3, RB, CARG3 // len = end - start - | add CARG3, CARG3, #1 // len += 1 - | bge ->fff_newstr - |->fff_emptystr: - | sub STR:CARG1, DISPATCH, #-DISPATCH_GL(strempty) - | mvn CARG2, #~LJ_TSTR - | b ->fff_restv - | - |.ffunc string_rep // Only handle the 1-char case inline. - | ffgccheck - | ldrd CARG12, [BASE] - | ldrd CARG34, [BASE, #8] - | cmp NARGS8:RC, #16 - | bne ->fff_fallback // Exactly 2 arguments - | checktp CARG2, LJ_TSTR - | checktpeq CARG4, LJ_TISNUM - | bne ->fff_fallback - | subs CARG4, CARG3, #1 - | ldr CARG2, STR:CARG1->len - | blt ->fff_emptystr // Count <= 0? - | cmp CARG2, #1 - | blo ->fff_emptystr // Zero-length string? - | bne ->fff_fallback // Fallback for > 1-char strings. - | ldr RB, [DISPATCH, #DISPATCH_GL(tmpbuf.sz)] - | ldr CARG2, [DISPATCH, #DISPATCH_GL(tmpbuf.buf)] - | ldr CARG1, STR:CARG1[1] - | cmp RB, CARG3 - | blo ->fff_fallback - |1: // Fill buffer with char. - | strb CARG1, [CARG2, CARG4] - | subs CARG4, CARG4, #1 - | bge <1 - | b ->fff_newstr - | - |.ffunc string_reverse - | ffgccheck - | ldrd CARG12, [BASE] - | cmp NARGS8:RC, #8 - | blo ->fff_fallback - | checkstr CARG2, ->fff_fallback - | ldr CARG3, STR:CARG1->len - | ldr RB, [DISPATCH, #DISPATCH_GL(tmpbuf.sz)] - | ldr CARG2, [DISPATCH, #DISPATCH_GL(tmpbuf.buf)] - | mov CARG4, CARG3 - | add CARG1, STR:CARG1, #sizeof(GCstr) - | cmp RB, CARG3 - | blo ->fff_fallback - |1: // Reverse string copy. - | ldrb RB, [CARG1], #1 - | subs CARG4, CARG4, #1 - | blt ->fff_newstr - | strb RB, [CARG2, CARG4] - | b <1 - | - |.macro ffstring_case, name, lo - | .ffunc name - | ffgccheck - | ldrd CARG12, [BASE] - | cmp NARGS8:RC, #8 - | blo ->fff_fallback - | checkstr CARG2, ->fff_fallback - | ldr CARG3, STR:CARG1->len - | ldr RB, [DISPATCH, #DISPATCH_GL(tmpbuf.sz)] - | ldr CARG2, [DISPATCH, #DISPATCH_GL(tmpbuf.buf)] - | mov CARG4, #0 - | add CARG1, STR:CARG1, #sizeof(GCstr) - | cmp RB, CARG3 - | blo ->fff_fallback - |1: // ASCII case conversion. - | ldrb RB, [CARG1, CARG4] - | cmp CARG4, CARG3 - | bhs ->fff_newstr - | sub RC, RB, #lo - | cmp RC, #26 - | eorlo RB, RB, #0x20 - | strb RB, [CARG2, CARG4] - | add CARG4, CARG4, #1 - | b <1 - |.endmacro - | - |ffstring_case string_lower, 65 - |ffstring_case string_upper, 97 - | - |//-- Table library ------------------------------------------------------ - | - |.ffunc_1 table_getn - | checktab CARG2, ->fff_fallback - | .IOS mov RA, BASE - | bl extern lj_tab_len // (GCtab *t) - | // Returns uint32_t (but less than 2^31). - | .IOS mov BASE, RA - | mvn CARG2, #~LJ_TISNUM - | b ->fff_restv - | - |//-- Bit library -------------------------------------------------------- - | - |// FP number to bit conversion for soft-float. Clobbers r0-r3. - |->vm_tobit_fb: - | bhi ->fff_fallback - |->vm_tobit: - | lsl RB, CARG2, #1 - | adds RB, RB, #0x00200000 - | movpl CARG1, #0 // |x| < 1? - | bxpl lr - | mvn CARG4, #0x3e0 - | subs RB, CARG4, RB, asr #21 - | bmi >1 // |x| >= 2^32? - | lsl CARG4, CARG2, #11 - | orr CARG4, CARG4, #0x80000000 - | orr CARG4, CARG4, CARG1, lsr #21 - | cmp CARG2, #0 - | lsr CARG1, CARG4, RB - | rsblt CARG1, CARG1, #0 - | bx lr - |1: - | add RB, RB, #21 - | lsr CARG4, CARG1, RB - | rsb RB, RB, #20 - | lsl CARG1, CARG2, #12 - | cmp CARG2, #0 - | orr CARG1, CARG4, CARG1, lsl RB - | rsblt CARG1, CARG1, #0 - | bx lr - | - |.macro .ffunc_bit, name - | .ffunc_1 bit_..name - | checktp CARG2, LJ_TISNUM - | blne ->vm_tobit_fb - |.endmacro - | - |.ffunc_bit tobit - | mvn CARG2, #~LJ_TISNUM - | b ->fff_restv - | - |.macro .ffunc_bit_op, name, ins - | .ffunc_bit name - | mov CARG3, CARG1 - | mov RA, #8 - |1: - | ldrd CARG12, [BASE, RA] - | cmp RA, NARGS8:RC - | add RA, RA, #8 - | bge >2 - | checktp CARG2, LJ_TISNUM - | blne ->vm_tobit_fb - | ins CARG3, CARG3, CARG1 - | b <1 - |.endmacro - | - |.ffunc_bit_op band, and - |.ffunc_bit_op bor, orr - |.ffunc_bit_op bxor, eor - | - |2: - | mvn CARG4, #~LJ_TISNUM - | ldr PC, [BASE, FRAME_PC] - | strd CARG34, [BASE, #-8] - | b ->fff_res1 - | - |.ffunc_bit bswap - | eor CARG3, CARG1, CARG1, ror #16 - | bic CARG3, CARG3, #0x00ff0000 - | ror CARG1, CARG1, #8 - | mvn CARG2, #~LJ_TISNUM - | eor CARG1, CARG1, CARG3, lsr #8 - | b ->fff_restv - | - |.ffunc_bit bnot - | mvn CARG1, CARG1 - | mvn CARG2, #~LJ_TISNUM - | b ->fff_restv - | - |.macro .ffunc_bit_sh, name, ins, shmod - | .ffunc bit_..name - | ldrd CARG12, [BASE, #8] - | cmp NARGS8:RC, #16 - | blo ->fff_fallback - | checktp CARG2, LJ_TISNUM - | blne ->vm_tobit_fb - |.if shmod == 0 - | and RA, CARG1, #31 - |.else - | rsb RA, CARG1, #0 - |.endif - | ldrd CARG12, [BASE] - | checktp CARG2, LJ_TISNUM - | blne ->vm_tobit_fb - | ins CARG1, CARG1, RA - | mvn CARG2, #~LJ_TISNUM - | b ->fff_restv - |.endmacro - | - |.ffunc_bit_sh lshift, lsl, 0 - |.ffunc_bit_sh rshift, lsr, 0 - |.ffunc_bit_sh arshift, asr, 0 - |.ffunc_bit_sh rol, ror, 1 - |.ffunc_bit_sh ror, ror, 0 - | - |//----------------------------------------------------------------------- - | - |->fff_fallback: // Call fast function fallback handler. - | // BASE = new base, RC = nargs*8 - | ldr CARG3, [BASE, FRAME_FUNC] - | ldr CARG2, L->maxstack - | add CARG1, BASE, NARGS8:RC - | ldr PC, [BASE, FRAME_PC] // Fallback may overwrite PC. - | str CARG1, L->top - | ldr CARG3, CFUNC:CARG3->f - | str BASE, L->base - | add CARG1, CARG1, #8*LUA_MINSTACK - | str PC, SAVE_PC // Redundant (but a defined value). - | cmp CARG1, CARG2 - | mov CARG1, L - | bhi >5 // Need to grow stack. - | blx CARG3 // (lua_State *L) - | // Either throws an error, or recovers and returns -1, 0 or nresults+1. - | ldr BASE, L->base - | cmp CRET1, #0 - | lsl RC, CRET1, #3 - | sub RA, BASE, #8 - | bgt ->fff_res // Returned nresults+1? - |1: // Returned 0 or -1: retry fast path. - | ldr CARG1, L->top - | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] - | sub NARGS8:RC, CARG1, BASE - | bne ->vm_call_tail // Returned -1? - | ins_callt // Returned 0: retry fast path. - | - |// Reconstruct previous base for vmeta_call during tailcall. - |->vm_call_tail: - | ands CARG1, PC, #FRAME_TYPE - | bic CARG2, PC, #FRAME_TYPEP - | ldreq INS, [PC, #-4] - | andeq CARG2, MASKR8, INS, lsr #5 // Conditional decode_RA8. - | addeq CARG2, CARG2, #8 - | sub RB, BASE, CARG2 - | b ->vm_call_dispatch // Resolve again for tailcall. - | - |5: // Grow stack for fallback handler. - | mov CARG2, #LUA_MINSTACK - | bl extern lj_state_growstack // (lua_State *L, int n) - | ldr BASE, L->base - | cmp CARG1, CARG1 // Set zero-flag to force retry. - | b <1 - | - |->fff_gcstep: // Call GC step function. - | // BASE = new base, RC = nargs*8 - | mov RA, lr - | str BASE, L->base - | add CARG2, BASE, NARGS8:RC - | str PC, SAVE_PC // Redundant (but a defined value). - | str CARG2, L->top - | mov CARG1, L - | bl extern lj_gc_step // (lua_State *L) - | ldr BASE, L->base - | mov lr, RA // Help return address predictor. - | ldr CFUNC:CARG3, [BASE, FRAME_FUNC] - | bx lr - | - |//----------------------------------------------------------------------- - |//-- Special dispatch targets ------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_record: // Dispatch target for recording phase. - |.if JIT - | ldrb CARG1, [DISPATCH, #DISPATCH_GL(hookmask)] - | tst CARG1, #HOOK_VMEVENT // No recording while in vmevent. - | bne >5 - | // Decrement the hookcount for consistency, but always do the call. - | ldr CARG2, [DISPATCH, #DISPATCH_GL(hookcount)] - | tst CARG1, #HOOK_ACTIVE - | bne >1 - | sub CARG2, CARG2, #1 - | tst CARG1, #LUA_MASKLINE|LUA_MASKCOUNT - | strne CARG2, [DISPATCH, #DISPATCH_GL(hookcount)] - | b >1 - |.endif - | - |->vm_rethook: // Dispatch target for return hooks. - | ldrb CARG1, [DISPATCH, #DISPATCH_GL(hookmask)] - | tst CARG1, #HOOK_ACTIVE // Hook already active? - | beq >1 - |5: // Re-dispatch to static ins. - | decode_OP OP, INS - | add OP, DISPATCH, OP, lsl #2 - | ldr pc, [OP, #GG_DISP2STATIC] - | - |->vm_inshook: // Dispatch target for instr/line hooks. - | ldrb CARG1, [DISPATCH, #DISPATCH_GL(hookmask)] - | ldr CARG2, [DISPATCH, #DISPATCH_GL(hookcount)] - | tst CARG1, #HOOK_ACTIVE // Hook already active? - | bne <5 - | tst CARG1, #LUA_MASKLINE|LUA_MASKCOUNT - | beq <5 - | subs CARG2, CARG2, #1 - | str CARG2, [DISPATCH, #DISPATCH_GL(hookcount)] - | beq >1 - | tst CARG1, #LUA_MASKLINE - | beq <5 - |1: - | mov CARG1, L - | str BASE, L->base - | mov CARG2, PC - | // SAVE_PC must hold the _previous_ PC. The callee updates it with PC. - | bl extern lj_dispatch_ins // (lua_State *L, const BCIns *pc) - |3: - | ldr BASE, L->base - |4: // Re-dispatch to static ins. - | ldrb OP, [PC, #-4] - | ldr INS, [PC, #-4] - | add OP, DISPATCH, OP, lsl #2 - | ldr OP, [OP, #GG_DISP2STATIC] - | decode_RA8 RA, INS - | decode_RD RC, INS - | bx OP - | - |->cont_hook: // Continue from hook yield. - | ldr CARG1, [CARG4, #-24] - | add PC, PC, #4 - | str CARG1, SAVE_MULTRES // Restore MULTRES for *M ins. - | b <4 - | - |->vm_hotloop: // Hot loop counter underflow. - |.if JIT - | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] // Same as curr_topL(L). - | sub CARG1, DISPATCH, #-GG_DISP2J - | str PC, SAVE_PC - | ldr CARG3, LFUNC:CARG3->field_pc - | mov CARG2, PC - | str L, [DISPATCH, #DISPATCH_J(L)] - | ldrb CARG3, [CARG3, #PC2PROTO(framesize)] - | str BASE, L->base - | add CARG3, BASE, CARG3, lsl #3 - | str CARG3, L->top - | bl extern lj_trace_hot // (jit_State *J, const BCIns *pc) - | b <3 - |.endif - | - |->vm_callhook: // Dispatch target for call hooks. - | mov CARG2, PC - |.if JIT - | b >1 - |.endif - | - |->vm_hotcall: // Hot call counter underflow. - |.if JIT - | orr CARG2, PC, #1 - |1: - |.endif - | add CARG4, BASE, RC - | str PC, SAVE_PC - | mov CARG1, L - | str BASE, L->base - | sub RA, RA, BASE - | str CARG4, L->top - | bl extern lj_dispatch_call // (lua_State *L, const BCIns *pc) - | // Returns ASMFunction. - | ldr BASE, L->base - | ldr CARG4, L->top - | mov CARG2, #0 - | add RA, BASE, RA - | sub NARGS8:RC, CARG4, BASE - | str CARG2, SAVE_PC // Invalidate for subsequent line hook. - | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] - | ldr INS, [PC, #-4] - | bx CRET1 - | - |//----------------------------------------------------------------------- - |//-- Trace exit handler ------------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_exit_handler: - |.if JIT - | sub sp, sp, #12 - | push {r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12} - | ldr CARG1, [sp, #64] // Load original value of lr. - | ldr DISPATCH, [lr] // Load DISPATCH. - | add CARG3, sp, #64 // Recompute original value of sp. - | mv_vmstate CARG4, EXIT - | str CARG3, [sp, #52] // Store sp in RID_SP - | st_vmstate CARG4 - | ldr CARG2, [CARG1, #-4]! // Get exit instruction. - | str CARG1, [sp, #56] // Store exit pc in RID_LR and RID_PC. - | str CARG1, [sp, #60] - |.if FPU - | vpush {d0-d15} - |.endif - | lsl CARG2, CARG2, #8 - | add CARG1, CARG1, CARG2, asr #6 - | ldr CARG2, [lr, #4] // Load exit stub group offset. - | sub CARG1, CARG1, lr - | ldr L, [DISPATCH, #DISPATCH_GL(jit_L)] - | add CARG1, CARG2, CARG1, lsr #2 // Compute exit number. - | ldr BASE, [DISPATCH, #DISPATCH_GL(jit_base)] - | str CARG1, [DISPATCH, #DISPATCH_J(exitno)] - | mov CARG4, #0 - | str L, [DISPATCH, #DISPATCH_J(L)] - | str BASE, L->base - | str CARG4, [DISPATCH, #DISPATCH_GL(jit_L)] - | sub CARG1, DISPATCH, #-GG_DISP2J - | mov CARG2, sp - | bl extern lj_trace_exit // (jit_State *J, ExitState *ex) - | // Returns MULTRES (unscaled) or negated error code. - | ldr CARG2, L->cframe - | ldr BASE, L->base - | bic CARG2, CARG2, #~CFRAME_RAWMASK // Use two steps: bic sp is deprecated. - | mov sp, CARG2 - | ldr PC, SAVE_PC // Get SAVE_PC. - | str L, SAVE_L // Set SAVE_L (on-trace resume/yield). - | b >1 - |.endif - |->vm_exit_interp: - | // CARG1 = MULTRES or negated error code, BASE, PC and DISPATCH set. - |.if JIT - | ldr L, SAVE_L - |1: - | cmp CARG1, #0 - | blt >3 // Check for error from exit. - | lsl RC, CARG1, #3 - | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] - | str RC, SAVE_MULTRES - | mov CARG3, #0 - | ldr CARG2, LFUNC:CARG2->field_pc - | str CARG3, [DISPATCH, #DISPATCH_GL(jit_L)] - | mv_vmstate CARG4, INTERP - | ldr KBASE, [CARG2, #PC2PROTO(k)] - | // Modified copy of ins_next which handles function header dispatch, too. - | ldrb OP, [PC] - | mov MASKR8, #255 - | ldr INS, [PC], #4 - | lsl MASKR8, MASKR8, #3 // MASKR8 = 255*8. - | st_vmstate CARG4 - | cmp OP, #BC_FUNCF // Function header? - | ldr OP, [DISPATCH, OP, lsl #2] - | decode_RA8 RA, INS - | lsrlo RC, INS, #16 // No: Decode operands A*8 and D. - | subhs RC, RC, #8 - | addhs RA, RA, BASE // Yes: RA = BASE+framesize*8, RC = nargs*8 - | bx OP - | - |3: // Rethrow error from the right C frame. - | rsb CARG2, CARG1, #0 - | mov CARG1, L - | bl extern lj_err_throw // (lua_State *L, int errcode) - |.endif - | - |//----------------------------------------------------------------------- - |//-- Math helper functions ---------------------------------------------- - |//----------------------------------------------------------------------- - | - |// FP value rounding. Called from JIT code. - |// - |// double lj_vm_floor/ceil/trunc(double x); - |.macro vm_round, func, hf - |.if hf == 1 - | vmov CARG1, CARG2, d0 - |.endif - | lsl CARG3, CARG2, #1 - | adds RB, CARG3, #0x00200000 - | bpl >2 // |x| < 1? - | mvn CARG4, #0x3cc - | subs RB, CARG4, RB, asr #21 // 2^0: RB = 51, 2^51: RB = 0. - | bxlo lr // |x| >= 2^52: done. - | mvn CARG4, #1 - | bic CARG3, CARG1, CARG4, lsl RB // ztest = lo & ~lomask - | and CARG1, CARG1, CARG4, lsl RB // lo &= lomask - | subs RB, RB, #32 - | bicpl CARG4, CARG2, CARG4, lsl RB // |x| <= 2^20: ztest |= hi & ~himask - | orrpl CARG3, CARG3, CARG4 - | mvnpl CARG4, #1 - | andpl CARG2, CARG2, CARG4, lsl RB // |x| <= 2^20: hi &= himask - |.if "func" == "floor" - | tst CARG3, CARG2, asr #31 // iszero = ((ztest & signmask) == 0) - |.else - | bics CARG3, CARG3, CARG2, asr #31 // iszero = ((ztest & ~signmask) == 0) - |.endif - |.if hf == 1 - | vmoveq d0, CARG1, CARG2 - |.endif - | bxeq lr // iszero: done. - | mvn CARG4, #1 - | cmp RB, #0 - | lslpl CARG3, CARG4, RB - | mvnmi CARG3, #0 - | add RB, RB, #32 - | subs CARG1, CARG1, CARG4, lsl RB // lo = lo-lomask - | sbc CARG2, CARG2, CARG3 // hi = hi-himask+carry - |.if hf == 1 - | vmov d0, CARG1, CARG2 - |.endif - | bx lr - | - |2: // |x| < 1: - | bxcs lr // |x| is not finite. - | orr CARG3, CARG3, CARG1 // ztest = (2*hi) | lo - |.if "func" == "floor" - | tst CARG3, CARG2, asr #31 // iszero = ((ztest & signmask) == 0) - |.else - | bics CARG3, CARG3, CARG2, asr #31 // iszero = ((ztest & ~signmask) == 0) - |.endif - | mov CARG1, #0 // lo = 0 - | and CARG2, CARG2, #0x80000000 - | ldrne CARG4, <9 // hi = sign(x) | (iszero ? 0.0 : 1.0) - | orrne CARG2, CARG2, CARG4 - |.if hf == 1 - | vmov d0, CARG1, CARG2 - |.endif - | bx lr - |.endmacro - | - |9: - | .long 0x3ff00000 // hiword(+1.0) - | - |->vm_floor: - |.if HFABI - | vm_round floor, 1 - |.endif - |->vm_floor_sf: - | vm_round floor, 0 - | - |->vm_ceil: - |.if HFABI - | vm_round ceil, 1 - |.endif - |->vm_ceil_sf: - | vm_round ceil, 0 - | - |.macro vm_trunc, hf - |.if JIT - |.if hf == 1 - | vmov CARG1, CARG2, d0 - |.endif - | lsl CARG3, CARG2, #1 - | adds RB, CARG3, #0x00200000 - | andpl CARG2, CARG2, #0x80000000 // |x| < 1? hi = sign(x), lo = 0. - | movpl CARG1, #0 - |.if hf == 1 - | vmovpl d0, CARG1, CARG2 - |.endif - | bxpl lr - | mvn CARG4, #0x3cc - | subs RB, CARG4, RB, asr #21 // 2^0: RB = 51, 2^51: RB = 0. - | bxlo lr // |x| >= 2^52: already done. - | mvn CARG4, #1 - | and CARG1, CARG1, CARG4, lsl RB // lo &= lomask - | subs RB, RB, #32 - | andpl CARG2, CARG2, CARG4, lsl RB // |x| <= 2^20: hi &= himask - |.if hf == 1 - | vmov d0, CARG1, CARG2 - |.endif - | bx lr - |.endif - |.endmacro - | - |->vm_trunc: - |.if HFABI - | vm_trunc 1 - |.endif - |->vm_trunc_sf: - | vm_trunc 0 - | - | // double lj_vm_mod(double dividend, double divisor); - |->vm_mod: - |.if FPU - | // Special calling convention. Also, RC (r11) is not preserved. - | vdiv.f64 d0, d6, d7 - | mov RC, lr - | vmov CARG1, CARG2, d0 - | bl ->vm_floor_sf - | vmov d0, CARG1, CARG2 - | vmul.f64 d0, d0, d7 - | mov lr, RC - | vsub.f64 d6, d6, d0 - | bx lr - |.else - | push {r0, r1, r2, r3, r4, lr} - | bl extern __aeabi_ddiv - | bl ->vm_floor_sf - | ldrd CARG34, [sp, #8] - | bl extern __aeabi_dmul - | ldrd CARG34, [sp] - | eor CARG2, CARG2, #0x80000000 - | bl extern __aeabi_dadd - | add sp, sp, #20 - | pop {pc} - |.endif - | - | // int lj_vm_modi(int dividend, int divisor); - |->vm_modi: - | ands RB, CARG1, #0x80000000 - | rsbmi CARG1, CARG1, #0 // a = |dividend| - | eor RB, RB, CARG2, asr #1 // Keep signdiff and sign(divisor). - | cmp CARG2, #0 - | rsbmi CARG2, CARG2, #0 // b = |divisor| - | subs CARG4, CARG2, #1 - | cmpne CARG1, CARG2 - | moveq CARG1, #0 // if (b == 1 || a == b) a = 0 - | tsthi CARG2, CARG4 - | andeq CARG1, CARG1, CARG4 // else if ((b & (b-1)) == 0) a &= b-1 - | bls >1 - | // Use repeated subtraction to get the remainder. - | clz CARG3, CARG1 - | clz CARG4, CARG2 - | sub CARG4, CARG4, CARG3 - | rsbs CARG3, CARG4, #31 // entry = (31-(clz(b)-clz(a)))*8 - | addne pc, pc, CARG3, lsl #3 // Duff's device. - | nop - { - int i; - for (i = 31; i >= 0; i--) { - | cmp CARG1, CARG2, lsl #i - | subhs CARG1, CARG1, CARG2, lsl #i - } - } - |1: - | cmp CARG1, #0 - | cmpne RB, #0 - | submi CARG1, CARG1, CARG2 // if (y != 0 && signdiff) y = y - b - | eors CARG2, CARG1, RB, lsl #1 - | rsbmi CARG1, CARG1, #0 // if (sign(divisor) != sign(y)) y = -y - | bx lr - | - |//----------------------------------------------------------------------- - |//-- Miscellaneous functions -------------------------------------------- - |//----------------------------------------------------------------------- - | - |//----------------------------------------------------------------------- - |//-- FFI helper functions ----------------------------------------------- - |//----------------------------------------------------------------------- - | - |// Handler for callback functions. - |// Saveregs already performed. Callback slot number in [sp], g in r12. - |->vm_ffi_callback: - |.if FFI - |.type CTSTATE, CTState, PC - | ldr CTSTATE, GL:r12->ctype_state - | add DISPATCH, r12, #GG_G2DISP - |.if FPU - | str r4, SAVE_R4 - | add r4, sp, CFRAME_SPACE+4+8*8 - | vstmdb r4!, {d8-d15} - |.endif - |.if HFABI - | add r12, CTSTATE, #offsetof(CTState, cb.fpr[8]) - |.endif - | strd CARG34, CTSTATE->cb.gpr[2] - | strd CARG12, CTSTATE->cb.gpr[0] - |.if HFABI - | vstmdb r12!, {d0-d7} - |.endif - | ldr CARG4, [sp] - | add CARG3, sp, #CFRAME_SIZE - | mov CARG1, CTSTATE - | lsr CARG4, CARG4, #3 - | str CARG3, CTSTATE->cb.stack - | mov CARG2, sp - | str CARG4, CTSTATE->cb.slot - | str CTSTATE, SAVE_PC // Any value outside of bytecode is ok. - | bl extern lj_ccallback_enter // (CTState *cts, void *cf) - | // Returns lua_State *. - | ldr BASE, L:CRET1->base - | mv_vmstate CARG2, INTERP - | ldr RC, L:CRET1->top - | mov MASKR8, #255 - | ldr LFUNC:CARG3, [BASE, FRAME_FUNC] - | mov L, CRET1 - | sub RC, RC, BASE - | lsl MASKR8, MASKR8, #3 // MASKR8 = 255*8. - | st_vmstate CARG2 - | ins_callt - |.endif - | - |->cont_ffi_callback: // Return from FFI callback. - |.if FFI - | ldr CTSTATE, [DISPATCH, #DISPATCH_GL(ctype_state)] - | str BASE, L->base - | str CARG4, L->top - | str L, CTSTATE->L - | mov CARG1, CTSTATE - | mov CARG2, RA - | bl extern lj_ccallback_leave // (CTState *cts, TValue *o) - | ldrd CARG12, CTSTATE->cb.gpr[0] - |.if HFABI - | vldr d0, CTSTATE->cb.fpr[0] - |.endif - | b ->vm_leave_unw - |.endif - | - |->vm_ffi_call: // Call C function via FFI. - | // Caveat: needs special frame unwinding, see below. - |.if FFI - | .type CCSTATE, CCallState, r4 - | push {CCSTATE, r5, r11, lr} - | mov CCSTATE, CARG1 - | ldr CARG1, CCSTATE:CARG1->spadj - | ldrb CARG2, CCSTATE->nsp - | add CARG3, CCSTATE, #offsetof(CCallState, stack) - |.if HFABI - | add RB, CCSTATE, #offsetof(CCallState, fpr[0]) - |.endif - | mov r11, sp - | sub sp, sp, CARG1 // Readjust stack. - | subs CARG2, CARG2, #1 - |.if HFABI - | vldm RB, {d0-d7} - |.endif - | ldr RB, CCSTATE->func - | bmi >2 - |1: // Copy stack slots. - | ldr CARG4, [CARG3, CARG2, lsl #2] - | str CARG4, [sp, CARG2, lsl #2] - | subs CARG2, CARG2, #1 - | bpl <1 - |2: - | ldrd CARG12, CCSTATE->gpr[0] - | ldrd CARG34, CCSTATE->gpr[2] - | blx RB - | mov sp, r11 - |.if HFABI - | add r12, CCSTATE, #offsetof(CCallState, fpr[4]) - |.endif - | strd CRET1, CCSTATE->gpr[0] - |.if HFABI - | vstmdb r12!, {d0-d3} - |.endif - | pop {CCSTATE, r5, r11, pc} - |.endif - |// Note: vm_ffi_call must be the last function in this object file! - | - |//----------------------------------------------------------------------- -} - -/* Generate the code for a single instruction. */ -static void build_ins(BuildCtx *ctx, BCOp op, int defop) -{ - int vk = 0; - |=>defop: - - switch (op) { - - /* -- Comparison ops ---------------------------------------------------- */ - - /* Remember: all ops branch for a true comparison, fall through otherwise. */ - - case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: - | // RA = src1*8, RC = src2, JMP with RC = target - | lsl RC, RC, #3 - | ldrd CARG12, [RA, BASE]! - | ldrh RB, [PC, #2] - | ldrd CARG34, [RC, BASE]! - | add PC, PC, #4 - | add RB, PC, RB, lsl #2 - | checktp CARG2, LJ_TISNUM - | bne >3 - | checktp CARG4, LJ_TISNUM - | bne >4 - | cmp CARG1, CARG3 - if (op == BC_ISLT) { - | sublt PC, RB, #0x20000 - } else if (op == BC_ISGE) { - | subge PC, RB, #0x20000 - } else if (op == BC_ISLE) { - | suble PC, RB, #0x20000 - } else { - | subgt PC, RB, #0x20000 - } - |1: - | ins_next - | - |3: // CARG12 is not an integer. - |.if FPU - | vldr d0, [RA] - | bhi ->vmeta_comp - | // d0 is a number. - | checktp CARG4, LJ_TISNUM - | vldr d1, [RC] - | blo >5 - | bhi ->vmeta_comp - | // d0 is a number, CARG3 is an integer. - | vmov s4, CARG3 - | vcvt.f64.s32 d1, s4 - | b >5 - |4: // CARG1 is an integer, CARG34 is not an integer. - | vldr d1, [RC] - | bhi ->vmeta_comp - | // CARG1 is an integer, d1 is a number. - | vmov s4, CARG1 - | vcvt.f64.s32 d0, s4 - |5: // d0 and d1 are numbers. - | vcmp.f64 d0, d1 - | vmrs - | // To preserve NaN semantics GE/GT branch on unordered, but LT/LE don't. - if (op == BC_ISLT) { - | sublo PC, RB, #0x20000 - } else if (op == BC_ISGE) { - | subhs PC, RB, #0x20000 - } else if (op == BC_ISLE) { - | subls PC, RB, #0x20000 - } else { - | subhi PC, RB, #0x20000 - } - | b <1 - |.else - | bhi ->vmeta_comp - | // CARG12 is a number. - | checktp CARG4, LJ_TISNUM - | movlo RA, RB // Save RB. - | blo >5 - | bhi ->vmeta_comp - | // CARG12 is a number, CARG3 is an integer. - | mov CARG1, CARG3 - | mov RC, RA - | mov RA, RB // Save RB. - | bl extern __aeabi_i2d - | mov CARG3, CARG1 - | mov CARG4, CARG2 - | ldrd CARG12, [RC] // Restore first operand. - | b >5 - |4: // CARG1 is an integer, CARG34 is not an integer. - | bhi ->vmeta_comp - | // CARG1 is an integer, CARG34 is a number. - | mov RA, RB // Save RB. - | bl extern __aeabi_i2d - | ldrd CARG34, [RC] // Restore second operand. - |5: // CARG12 and CARG34 are numbers. - | bl extern __aeabi_cdcmple - | // To preserve NaN semantics GE/GT branch on unordered, but LT/LE don't. - if (op == BC_ISLT) { - | sublo PC, RA, #0x20000 - } else if (op == BC_ISGE) { - | subhs PC, RA, #0x20000 - } else if (op == BC_ISLE) { - | subls PC, RA, #0x20000 - } else { - | subhi PC, RA, #0x20000 - } - | b <1 - |.endif - break; - - case BC_ISEQV: case BC_ISNEV: - vk = op == BC_ISEQV; - | // RA = src1*8, RC = src2, JMP with RC = target - | lsl RC, RC, #3 - | ldrd CARG12, [RA, BASE]! - | ldrh RB, [PC, #2] - | ldrd CARG34, [RC, BASE]! - | add PC, PC, #4 - | add RB, PC, RB, lsl #2 - | checktp CARG2, LJ_TISNUM - | cmnls CARG4, #-LJ_TISNUM - if (vk) { - | bls ->BC_ISEQN_Z - } else { - | bls ->BC_ISNEN_Z - } - | // Either or both types are not numbers. - |.if FFI - | checktp CARG2, LJ_TCDATA - | checktpne CARG4, LJ_TCDATA - | beq ->vmeta_equal_cd - |.endif - | cmp CARG2, CARG4 // Compare types. - | bne >2 // Not the same type? - | checktp CARG2, LJ_TISPRI - | bhs >1 // Same type and primitive type? - | - | // Same types and not a primitive type. Compare GCobj or pvalue. - | cmp CARG1, CARG3 - if (vk) { - | bne >3 // Different GCobjs or pvalues? - |1: // Branch if same. - | sub PC, RB, #0x20000 - |2: // Different. - | ins_next - |3: - | checktp CARG2, LJ_TISTABUD - | bhi <2 // Different objects and not table/ud? - } else { - | beq >1 // Same GCobjs or pvalues? - | checktp CARG2, LJ_TISTABUD - | bhi >2 // Different objects and not table/ud? - } - | // Different tables or userdatas. Need to check __eq metamethod. - | // Field metatable must be at same offset for GCtab and GCudata! - | ldr TAB:RA, TAB:CARG1->metatable - | cmp TAB:RA, #0 - if (vk) { - | beq <2 // No metatable? - } else { - | beq >2 // No metatable? - } - | ldrb RA, TAB:RA->nomm - | mov CARG4, #1-vk // ne = 0 or 1. - | mov CARG2, CARG1 - | tst RA, #1<vmeta_equal // 'no __eq' flag not set? - if (vk) { - | b <2 - } else { - |2: // Branch if different. - | sub PC, RB, #0x20000 - |1: // Same. - | ins_next - } - break; - - case BC_ISEQS: case BC_ISNES: - vk = op == BC_ISEQS; - | // RA = src*8, RC = str_const (~), JMP with RC = target - | mvn RC, RC - | ldrd CARG12, [BASE, RA] - | ldrh RB, [PC, #2] - | ldr STR:CARG3, [KBASE, RC, lsl #2] - | add PC, PC, #4 - | add RB, PC, RB, lsl #2 - | checktp CARG2, LJ_TSTR - |.if FFI - | bne >7 - | cmp CARG1, CARG3 - |.else - | cmpeq CARG1, CARG3 - |.endif - if (vk) { - | subeq PC, RB, #0x20000 - |1: - } else { - |1: - | subne PC, RB, #0x20000 - } - | ins_next - | - |.if FFI - |7: - | checktp CARG2, LJ_TCDATA - | bne <1 - | b ->vmeta_equal_cd - |.endif - break; - - case BC_ISEQN: case BC_ISNEN: - vk = op == BC_ISEQN; - | // RA = src*8, RC = num_const (~), JMP with RC = target - | lsl RC, RC, #3 - | ldrd CARG12, [RA, BASE]! - | ldrh RB, [PC, #2] - | ldrd CARG34, [RC, KBASE]! - | add PC, PC, #4 - | add RB, PC, RB, lsl #2 - if (vk) { - |->BC_ISEQN_Z: - } else { - |->BC_ISNEN_Z: - } - | checktp CARG2, LJ_TISNUM - | bne >3 - | checktp CARG4, LJ_TISNUM - | bne >4 - | cmp CARG1, CARG3 - if (vk) { - | subeq PC, RB, #0x20000 - |1: - } else { - |1: - | subne PC, RB, #0x20000 - } - |2: - | ins_next - | - |3: // CARG12 is not an integer. - |.if FFI - | bhi >7 - |.else - if (!vk) { - | subhi PC, RB, #0x20000 - } - | bhi <2 - |.endif - |.if FPU - | checktp CARG4, LJ_TISNUM - | vmov s4, CARG3 - | vldr d0, [RA] - | vldrlo d1, [RC] - | vcvths.f64.s32 d1, s4 - | b >5 - |4: // CARG1 is an integer, d1 is a number. - | vmov s4, CARG1 - | vldr d1, [RC] - | vcvt.f64.s32 d0, s4 - |5: // d0 and d1 are numbers. - | vcmp.f64 d0, d1 - | vmrs - if (vk) { - | subeq PC, RB, #0x20000 - } else { - | subne PC, RB, #0x20000 - } - | b <2 - |.else - | // CARG12 is a number. - | checktp CARG4, LJ_TISNUM - | movlo RA, RB // Save RB. - | blo >5 - | // CARG12 is a number, CARG3 is an integer. - | mov CARG1, CARG3 - | mov RC, RA - |4: // CARG1 is an integer, CARG34 is a number. - | mov RA, RB // Save RB. - | bl extern __aeabi_i2d - | ldrd CARG34, [RC] // Restore other operand. - |5: // CARG12 and CARG34 are numbers. - | bl extern __aeabi_cdcmpeq - if (vk) { - | subeq PC, RA, #0x20000 - } else { - | subne PC, RA, #0x20000 - } - | b <2 - |.endif - | - |.if FFI - |7: - | checktp CARG2, LJ_TCDATA - | bne <1 - | b ->vmeta_equal_cd - |.endif - break; - - case BC_ISEQP: case BC_ISNEP: - vk = op == BC_ISEQP; - | // RA = src*8, RC = primitive_type (~), JMP with RC = target - | ldrd CARG12, [BASE, RA] - | ldrh RB, [PC, #2] - | add PC, PC, #4 - | mvn RC, RC - | add RB, PC, RB, lsl #2 - |.if FFI - | checktp CARG2, LJ_TCDATA - | beq ->vmeta_equal_cd - |.endif - | cmp CARG2, RC - if (vk) { - | subeq PC, RB, #0x20000 - } else { - | subne PC, RB, #0x20000 - } - | ins_next - break; - - /* -- Unary test and copy ops ------------------------------------------- */ - - case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: - | // RA = dst*8 or unused, RC = src, JMP with RC = target - | add RC, BASE, RC, lsl #3 - | ldrh RB, [PC, #2] - | ldrd CARG12, [RC] - | add PC, PC, #4 - | add RB, PC, RB, lsl #2 - | checktp CARG2, LJ_TTRUE - if (op == BC_ISTC || op == BC_IST) { - | subls PC, RB, #0x20000 - if (op == BC_ISTC) { - | strdls CARG12, [BASE, RA] - } - } else { - | subhi PC, RB, #0x20000 - if (op == BC_ISFC) { - | strdhi CARG12, [BASE, RA] - } - } - | ins_next - break; - - /* -- Unary ops --------------------------------------------------------- */ - - case BC_MOV: - | // RA = dst*8, RC = src - | lsl RC, RC, #3 - | ins_next1 - | ldrd CARG12, [BASE, RC] - | ins_next2 - | strd CARG12, [BASE, RA] - | ins_next3 - break; - case BC_NOT: - | // RA = dst*8, RC = src - | add RC, BASE, RC, lsl #3 - | ins_next1 - | ldr CARG1, [RC, #4] - | add RA, BASE, RA - | ins_next2 - | checktp CARG1, LJ_TTRUE - | mvnls CARG2, #~LJ_TFALSE - | mvnhi CARG2, #~LJ_TTRUE - | str CARG2, [RA, #4] - | ins_next3 - break; - case BC_UNM: - | // RA = dst*8, RC = src - | lsl RC, RC, #3 - | ldrd CARG12, [BASE, RC] - | ins_next1 - | ins_next2 - | checktp CARG2, LJ_TISNUM - | bhi ->vmeta_unm - | eorne CARG2, CARG2, #0x80000000 - | bne >5 - | rsbseq CARG1, CARG1, #0 - | ldrdvs CARG12, >9 - |5: - | strd CARG12, [BASE, RA] - | ins_next3 - | - |.align 8 - |9: - | .long 0x00000000, 0x41e00000 // 2^31. - break; - case BC_LEN: - | // RA = dst*8, RC = src - | lsl RC, RC, #3 - | ldrd CARG12, [BASE, RC] - | checkstr CARG2, >2 - | ldr CARG1, STR:CARG1->len - |1: - | mvn CARG2, #~LJ_TISNUM - | ins_next1 - | ins_next2 - | strd CARG12, [BASE, RA] - | ins_next3 - |2: - | checktab CARG2, ->vmeta_len -#if LJ_52 - | ldr TAB:CARG3, TAB:CARG1->metatable - | cmp TAB:CARG3, #0 - | bne >9 - |3: -#endif - |->BC_LEN_Z: - | .IOS mov RC, BASE - | bl extern lj_tab_len // (GCtab *t) - | // Returns uint32_t (but less than 2^31). - | .IOS mov BASE, RC - | b <1 -#if LJ_52 - |9: - | ldrb CARG4, TAB:CARG3->nomm - | tst CARG4, #1<vmeta_len -#endif - break; - - /* -- Binary ops -------------------------------------------------------- */ - - |.macro ins_arithcheck, cond, ncond, target - ||if (vk == 1) { - | cmn CARG4, #-LJ_TISNUM - | cmn..cond CARG2, #-LJ_TISNUM - ||} else { - | cmn CARG2, #-LJ_TISNUM - | cmn..cond CARG4, #-LJ_TISNUM - ||} - | b..ncond target - |.endmacro - |.macro ins_arithcheck_int, target - | ins_arithcheck eq, ne, target - |.endmacro - |.macro ins_arithcheck_num, target - | ins_arithcheck lo, hs, target - |.endmacro - | - |.macro ins_arithpre - | decode_RB8 RB, INS - | decode_RC8 RC, INS - | // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8 - ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); - ||switch (vk) { - ||case 0: - | .if FPU - | ldrd CARG12, [RB, BASE]! - | ldrd CARG34, [RC, KBASE]! - | .else - | ldrd CARG12, [BASE, RB] - | ldrd CARG34, [KBASE, RC] - | .endif - || break; - ||case 1: - | .if FPU - | ldrd CARG34, [RB, BASE]! - | ldrd CARG12, [RC, KBASE]! - | .else - | ldrd CARG34, [BASE, RB] - | ldrd CARG12, [KBASE, RC] - | .endif - || break; - ||default: - | .if FPU - | ldrd CARG12, [RB, BASE]! - | ldrd CARG34, [RC, BASE]! - | .else - | ldrd CARG12, [BASE, RB] - | ldrd CARG34, [BASE, RC] - | .endif - || break; - ||} - |.endmacro - | - |.macro ins_arithpre_fpu, reg1, reg2 - |.if FPU - ||if (vk == 1) { - | vldr reg2, [RB] - | vldr reg1, [RC] - ||} else { - | vldr reg1, [RB] - | vldr reg2, [RC] - ||} - |.endif - |.endmacro - | - |.macro ins_arithpost_fpu, reg - | ins_next1 - | add RA, BASE, RA - | ins_next2 - | vstr reg, [RA] - | ins_next3 - |.endmacro - | - |.macro ins_arithfallback, ins - ||switch (vk) { - ||case 0: - | ins ->vmeta_arith_vn - || break; - ||case 1: - | ins ->vmeta_arith_nv - || break; - ||default: - | ins ->vmeta_arith_vv - || break; - ||} - |.endmacro - | - |.macro ins_arithdn, intins, fpins, fpcall - | ins_arithpre - |.if "intins" ~= "vm_modi" and not FPU - | ins_next1 - |.endif - | ins_arithcheck_int >5 - |.if "intins" == "smull" - | smull CARG1, RC, CARG3, CARG1 - | cmp RC, CARG1, asr #31 - | ins_arithfallback bne - |.elif "intins" == "vm_modi" - | movs CARG2, CARG3 - | ins_arithfallback beq - | bl ->vm_modi - | mvn CARG2, #~LJ_TISNUM - |.else - | intins CARG1, CARG1, CARG3 - | ins_arithfallback bvs - |.endif - |4: - |.if "intins" == "vm_modi" or FPU - | ins_next1 - |.endif - | ins_next2 - | strd CARG12, [BASE, RA] - | ins_next3 - |5: // FP variant. - | ins_arithpre_fpu d6, d7 - | ins_arithfallback ins_arithcheck_num - |.if FPU - |.if "intins" == "vm_modi" - | bl fpcall - |.else - | fpins d6, d6, d7 - |.endif - | ins_arithpost_fpu d6 - |.else - | bl fpcall - |.if "intins" ~= "vm_modi" - | ins_next1 - |.endif - | b <4 - |.endif - |.endmacro - | - |.macro ins_arithfp, fpins, fpcall - | ins_arithpre - |.if "fpins" ~= "extern" or HFABI - | ins_arithpre_fpu d0, d1 - |.endif - | ins_arithfallback ins_arithcheck_num - |.if "fpins" == "extern" - | .IOS mov RC, BASE - | bl fpcall - | .IOS mov BASE, RC - |.elif FPU - | fpins d0, d0, d1 - |.else - | bl fpcall - |.endif - |.if ("fpins" ~= "extern" or HFABI) and FPU - | ins_arithpost_fpu d0 - |.else - | ins_next1 - | ins_next2 - | strd CARG12, [BASE, RA] - | ins_next3 - |.endif - |.endmacro - - case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: - | ins_arithdn adds, vadd.f64, extern __aeabi_dadd - break; - case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: - | ins_arithdn subs, vsub.f64, extern __aeabi_dsub - break; - case BC_MULVN: case BC_MULNV: case BC_MULVV: - | ins_arithdn smull, vmul.f64, extern __aeabi_dmul - break; - case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: - | ins_arithfp vdiv.f64, extern __aeabi_ddiv - break; - case BC_MODVN: case BC_MODNV: case BC_MODVV: - | ins_arithdn vm_modi, vm_mod, ->vm_mod - break; - case BC_POW: - | // NYI: (partial) integer arithmetic. - | ins_arithfp extern, extern pow - break; - - case BC_CAT: - | decode_RB8 RC, INS - | decode_RC8 RB, INS - | // RA = dst*8, RC = src_start*8, RB = src_end*8 (note: RB/RC swapped!) - | sub CARG3, RB, RC - | str BASE, L->base - | add CARG2, BASE, RB - |->BC_CAT_Z: - | // RA = dst*8, RC = src_start*8, CARG2 = top-1 - | mov CARG1, L - | str PC, SAVE_PC - | lsr CARG3, CARG3, #3 - | bl extern lj_meta_cat // (lua_State *L, TValue *top, int left) - | // Returns NULL (finished) or TValue * (metamethod). - | ldr BASE, L->base - | cmp CRET1, #0 - | bne ->vmeta_binop - | ldrd CARG34, [BASE, RC] - | ins_next1 - | ins_next2 - | strd CARG34, [BASE, RA] // Copy result to RA. - | ins_next3 - break; - - /* -- Constant ops ------------------------------------------------------ */ - - case BC_KSTR: - | // RA = dst*8, RC = str_const (~) - | mvn RC, RC - | ins_next1 - | ldr CARG1, [KBASE, RC, lsl #2] - | mvn CARG2, #~LJ_TSTR - | ins_next2 - | strd CARG12, [BASE, RA] - | ins_next3 - break; - case BC_KCDATA: - |.if FFI - | // RA = dst*8, RC = cdata_const (~) - | mvn RC, RC - | ins_next1 - | ldr CARG1, [KBASE, RC, lsl #2] - | mvn CARG2, #~LJ_TCDATA - | ins_next2 - | strd CARG12, [BASE, RA] - | ins_next3 - |.endif - break; - case BC_KSHORT: - | // RA = dst*8, (RC = int16_literal) - | mov CARG1, INS, asr #16 // Refetch sign-extended reg. - | mvn CARG2, #~LJ_TISNUM - | ins_next1 - | ins_next2 - | strd CARG12, [BASE, RA] - | ins_next3 - break; - case BC_KNUM: - | // RA = dst*8, RC = num_const - | lsl RC, RC, #3 - | ins_next1 - | ldrd CARG12, [KBASE, RC] - | ins_next2 - | strd CARG12, [BASE, RA] - | ins_next3 - break; - case BC_KPRI: - | // RA = dst*8, RC = primitive_type (~) - | add RA, BASE, RA - | mvn RC, RC - | ins_next1 - | ins_next2 - | str RC, [RA, #4] - | ins_next3 - break; - case BC_KNIL: - | // RA = base*8, RC = end - | add RA, BASE, RA - | add RC, BASE, RC, lsl #3 - | mvn CARG1, #~LJ_TNIL - | str CARG1, [RA, #4] - | add RA, RA, #8 - |1: - | str CARG1, [RA, #4] - | cmp RA, RC - | add RA, RA, #8 - | blt <1 - | ins_next_ - break; - - /* -- Upvalue and function ops ------------------------------------------ */ - - case BC_UGET: - | // RA = dst*8, RC = uvnum - | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] - | lsl RC, RC, #2 - | add RC, RC, #offsetof(GCfuncL, uvptr) - | ldr UPVAL:CARG2, [LFUNC:CARG2, RC] - | ldr CARG2, UPVAL:CARG2->v - | ldrd CARG34, [CARG2] - | ins_next1 - | ins_next2 - | strd CARG34, [BASE, RA] - | ins_next3 - break; - case BC_USETV: - | // RA = uvnum*8, RC = src - | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] - | lsr RA, RA, #1 - | add RA, RA, #offsetof(GCfuncL, uvptr) - | lsl RC, RC, #3 - | ldr UPVAL:CARG2, [LFUNC:CARG2, RA] - | ldrd CARG34, [BASE, RC] - | ldrb RB, UPVAL:CARG2->marked - | ldrb RC, UPVAL:CARG2->closed - | ldr CARG2, UPVAL:CARG2->v - | tst RB, #LJ_GC_BLACK // isblack(uv) - | add RB, CARG4, #-LJ_TISGCV - | cmpne RC, #0 - | strd CARG34, [CARG2] - | bne >2 // Upvalue is closed and black? - |1: - | ins_next - | - |2: // Check if new value is collectable. - | cmn RB, #-(LJ_TNUMX - LJ_TISGCV) - | ldrbhi RC, GCOBJ:CARG3->gch.marked - | bls <1 // tvisgcv(v) - | sub CARG1, DISPATCH, #-GG_DISP2G - | tst RC, #LJ_GC_WHITES - | // Crossed a write barrier. Move the barrier forward. - |.if IOS - | beq <1 - | mov RC, BASE - | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) - | mov BASE, RC - |.else - | blne extern lj_gc_barrieruv // (global_State *g, TValue *tv) - |.endif - | b <1 - break; - case BC_USETS: - | // RA = uvnum*8, RC = str_const (~) - | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] - | lsr RA, RA, #1 - | add RA, RA, #offsetof(GCfuncL, uvptr) - | mvn RC, RC - | ldr UPVAL:CARG2, [LFUNC:CARG2, RA] - | ldr STR:CARG3, [KBASE, RC, lsl #2] - | ldrb RB, UPVAL:CARG2->marked - | ldrb RC, UPVAL:CARG2->closed - | ldr CARG2, UPVAL:CARG2->v - | mvn CARG4, #~LJ_TSTR - | tst RB, #LJ_GC_BLACK // isblack(uv) - | ldrb RB, STR:CARG3->marked - | strd CARG34, [CARG2] - | bne >2 - |1: - | ins_next - | - |2: // Check if string is white and ensure upvalue is closed. - | tst RB, #LJ_GC_WHITES // iswhite(str) - | cmpne RC, #0 - | sub CARG1, DISPATCH, #-GG_DISP2G - | // Crossed a write barrier. Move the barrier forward. - |.if IOS - | beq <1 - | mov RC, BASE - | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) - | mov BASE, RC - |.else - | blne extern lj_gc_barrieruv // (global_State *g, TValue *tv) - |.endif - | b <1 - break; - case BC_USETN: - | // RA = uvnum*8, RC = num_const - | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] - | lsr RA, RA, #1 - | add RA, RA, #offsetof(GCfuncL, uvptr) - | lsl RC, RC, #3 - | ldr UPVAL:CARG2, [LFUNC:CARG2, RA] - | ldrd CARG34, [KBASE, RC] - | ldr CARG2, UPVAL:CARG2->v - | ins_next1 - | ins_next2 - | strd CARG34, [CARG2] - | ins_next3 - break; - case BC_USETP: - | // RA = uvnum*8, RC = primitive_type (~) - | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] - | lsr RA, RA, #1 - | add RA, RA, #offsetof(GCfuncL, uvptr) - | ldr UPVAL:CARG2, [LFUNC:CARG2, RA] - | mvn RC, RC - | ldr CARG2, UPVAL:CARG2->v - | ins_next1 - | ins_next2 - | str RC, [CARG2, #4] - | ins_next3 - break; - - case BC_UCLO: - | // RA = level*8, RC = target - | ldr CARG3, L->openupval - | add RC, PC, RC, lsl #2 - | str BASE, L->base - | cmp CARG3, #0 - | sub PC, RC, #0x20000 - | beq >1 - | mov CARG1, L - | add CARG2, BASE, RA - | bl extern lj_func_closeuv // (lua_State *L, TValue *level) - | ldr BASE, L->base - |1: - | ins_next - break; - - case BC_FNEW: - | // RA = dst*8, RC = proto_const (~) (holding function prototype) - | mvn RC, RC - | str BASE, L->base - | ldr CARG2, [KBASE, RC, lsl #2] - | str PC, SAVE_PC - | ldr CARG3, [BASE, FRAME_FUNC] - | mov CARG1, L - | // (lua_State *L, GCproto *pt, GCfuncL *parent) - | bl extern lj_func_newL_gc - | // Returns GCfuncL *. - | ldr BASE, L->base - | mvn CARG2, #~LJ_TFUNC - | ins_next1 - | ins_next2 - | strd CARG12, [BASE, RA] - | ins_next3 - break; - - /* -- Table ops --------------------------------------------------------- */ - - case BC_TNEW: - case BC_TDUP: - | // RA = dst*8, RC = (hbits|asize) | tab_const (~) - if (op == BC_TDUP) { - | mvn RC, RC - } - | ldr CARG3, [DISPATCH, #DISPATCH_GL(gc.total)] - | ldr CARG4, [DISPATCH, #DISPATCH_GL(gc.threshold)] - | str BASE, L->base - | str PC, SAVE_PC - | cmp CARG3, CARG4 - | mov CARG1, L - | bhs >5 - |1: - if (op == BC_TNEW) { - | lsl CARG2, RC, #21 - | lsr CARG3, RC, #11 - | asr RC, CARG2, #21 - | lsr CARG2, CARG2, #21 - | cmn RC, #1 - | addeq CARG2, CARG2, #2 - | bl extern lj_tab_new // (lua_State *L, int32_t asize, uint32_t hbits) - | // Returns GCtab *. - } else { - | ldr CARG2, [KBASE, RC, lsl #2] - | bl extern lj_tab_dup // (lua_State *L, Table *kt) - | // Returns GCtab *. - } - | ldr BASE, L->base - | mvn CARG2, #~LJ_TTAB - | ins_next1 - | ins_next2 - | strd CARG12, [BASE, RA] - | ins_next3 - |5: - | bl extern lj_gc_step_fixtop // (lua_State *L) - | mov CARG1, L - | b <1 - break; - - case BC_GGET: - | // RA = dst*8, RC = str_const (~) - case BC_GSET: - | // RA = dst*8, RC = str_const (~) - | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] - | mvn RC, RC - | ldr TAB:CARG1, LFUNC:CARG2->env - | ldr STR:RC, [KBASE, RC, lsl #2] - if (op == BC_GGET) { - | b ->BC_TGETS_Z - } else { - | b ->BC_TSETS_Z - } - break; - - case BC_TGETV: - | decode_RB8 RB, INS - | decode_RC8 RC, INS - | // RA = dst*8, RB = table*8, RC = key*8 - | ldrd TAB:CARG12, [BASE, RB] - | ldrd CARG34, [BASE, RC] - | checktab CARG2, ->vmeta_tgetv // STALL: load CARG12. - | checktp CARG4, LJ_TISNUM // Integer key? - | ldreq CARG4, TAB:CARG1->array - | ldreq CARG2, TAB:CARG1->asize - | bne >9 - | - | add CARG4, CARG4, CARG3, lsl #3 - | cmp CARG3, CARG2 // In array part? - | ldrdlo CARG34, [CARG4] - | bhs ->vmeta_tgetv - | ins_next1 // Overwrites RB! - | checktp CARG4, LJ_TNIL - | beq >5 - |1: - | ins_next2 - | strd CARG34, [BASE, RA] - | ins_next3 - | - |5: // Check for __index if table value is nil. - | ldr TAB:CARG2, TAB:CARG1->metatable - | cmp TAB:CARG2, #0 - | beq <1 // No metatable: done. - | ldrb CARG2, TAB:CARG2->nomm - | tst CARG2, #1<vmeta_tgetv - | - |9: - | checktp CARG4, LJ_TSTR // String key? - | moveq STR:RC, CARG3 - | beq ->BC_TGETS_Z - | b ->vmeta_tgetv - break; - case BC_TGETS: - | decode_RB8 RB, INS - | and RC, RC, #255 - | // RA = dst*8, RB = table*8, RC = str_const (~) - | ldrd CARG12, [BASE, RB] - | mvn RC, RC - | ldr STR:RC, [KBASE, RC, lsl #2] // STALL: early RC. - | checktab CARG2, ->vmeta_tgets1 - |->BC_TGETS_Z: - | // (TAB:RB =) TAB:CARG1 = GCtab *, STR:RC = GCstr *, RA = dst*8 - | ldr CARG3, TAB:CARG1->hmask - | ldr CARG4, STR:RC->hash - | ldr NODE:INS, TAB:CARG1->node - | mov TAB:RB, TAB:CARG1 - | and CARG3, CARG3, CARG4 // idx = str->hash & tab->hmask - | add CARG3, CARG3, CARG3, lsl #1 - | add NODE:INS, NODE:INS, CARG3, lsl #3 // node = tab->node + idx*3*8 - |1: - | ldrd CARG12, NODE:INS->key // STALL: early NODE:INS. - | ldrd CARG34, NODE:INS->val - | ldr NODE:INS, NODE:INS->next - | checktp CARG2, LJ_TSTR - | cmpeq CARG1, STR:RC - | bne >4 - | checktp CARG4, LJ_TNIL - | beq >5 - |3: - | ins_next1 - | ins_next2 - | strd CARG34, [BASE, RA] - | ins_next3 - | - |4: // Follow hash chain. - | cmp NODE:INS, #0 - | bne <1 - | // End of hash chain: key not found, nil result. - | - |5: // Check for __index if table value is nil. - | ldr TAB:CARG1, TAB:RB->metatable - | mov CARG3, #0 // Optional clear of undef. value (during load stall). - | mvn CARG4, #~LJ_TNIL - | cmp TAB:CARG1, #0 - | beq <3 // No metatable: done. - | ldrb CARG2, TAB:CARG1->nomm - | tst CARG2, #1<vmeta_tgets - break; - case BC_TGETB: - | decode_RB8 RB, INS - | and RC, RC, #255 - | // RA = dst*8, RB = table*8, RC = index - | ldrd CARG12, [BASE, RB] - | checktab CARG2, ->vmeta_tgetb // STALL: load CARG12. - | ldr CARG3, TAB:CARG1->asize - | ldr CARG4, TAB:CARG1->array - | lsl CARG2, RC, #3 - | cmp RC, CARG3 - | ldrdlo CARG34, [CARG4, CARG2] - | bhs ->vmeta_tgetb - | ins_next1 // Overwrites RB! - | checktp CARG4, LJ_TNIL - | beq >5 - |1: - | ins_next2 - | strd CARG34, [BASE, RA] - | ins_next3 - | - |5: // Check for __index if table value is nil. - | ldr TAB:CARG2, TAB:CARG1->metatable - | cmp TAB:CARG2, #0 - | beq <1 // No metatable: done. - | ldrb CARG2, TAB:CARG2->nomm - | tst CARG2, #1<vmeta_tgetb - break; - - case BC_TSETV: - | decode_RB8 RB, INS - | decode_RC8 RC, INS - | // RA = src*8, RB = table*8, RC = key*8 - | ldrd TAB:CARG12, [BASE, RB] - | ldrd CARG34, [BASE, RC] - | checktab CARG2, ->vmeta_tsetv // STALL: load CARG12. - | checktp CARG4, LJ_TISNUM // Integer key? - | ldreq CARG2, TAB:CARG1->array - | ldreq CARG4, TAB:CARG1->asize - | bne >9 - | - | add CARG2, CARG2, CARG3, lsl #3 - | cmp CARG3, CARG4 // In array part? - | ldrlo INS, [CARG2, #4] - | bhs ->vmeta_tsetv - | ins_next1 // Overwrites RB! - | checktp INS, LJ_TNIL - | ldrb INS, TAB:CARG1->marked - | ldrd CARG34, [BASE, RA] - | beq >5 - |1: - | tst INS, #LJ_GC_BLACK // isblack(table) - | strd CARG34, [CARG2] - | bne >7 - |2: - | ins_next2 - | ins_next3 - | - |5: // Check for __newindex if previous value is nil. - | ldr TAB:RA, TAB:CARG1->metatable - | cmp TAB:RA, #0 - | beq <1 // No metatable: done. - | ldrb RA, TAB:RA->nomm - | tst RA, #1<vmeta_tsetv - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:CARG1, INS, CARG3 - | b <2 - | - |9: - | checktp CARG4, LJ_TSTR // String key? - | moveq STR:RC, CARG3 - | beq ->BC_TSETS_Z - | b ->vmeta_tsetv - break; - case BC_TSETS: - | decode_RB8 RB, INS - | and RC, RC, #255 - | // RA = src*8, RB = table*8, RC = str_const (~) - | ldrd CARG12, [BASE, RB] - | mvn RC, RC - | ldr STR:RC, [KBASE, RC, lsl #2] // STALL: early RC. - | checktab CARG2, ->vmeta_tsets1 - |->BC_TSETS_Z: - | // (TAB:RB =) TAB:CARG1 = GCtab *, STR:RC = GCstr *, RA = dst*8 - | ldr CARG3, TAB:CARG1->hmask - | ldr CARG4, STR:RC->hash - | ldr NODE:INS, TAB:CARG1->node - | mov TAB:RB, TAB:CARG1 - | and CARG3, CARG3, CARG4 // idx = str->hash & tab->hmask - | add CARG3, CARG3, CARG3, lsl #1 - | mov CARG4, #0 - | add NODE:INS, NODE:INS, CARG3, lsl #3 // node = tab->node + idx*3*8 - | strb CARG4, TAB:RB->nomm // Clear metamethod cache. - |1: - | ldrd CARG12, NODE:INS->key - | ldr CARG4, NODE:INS->val.it - | ldr NODE:CARG3, NODE:INS->next - | checktp CARG2, LJ_TSTR - | cmpeq CARG1, STR:RC - | bne >5 - | ldrb CARG2, TAB:RB->marked - | checktp CARG4, LJ_TNIL // Key found, but nil value? - | ldrd CARG34, [BASE, RA] - | beq >4 - |2: - | tst CARG2, #LJ_GC_BLACK // isblack(table) - | strd CARG34, NODE:INS->val - | bne >7 - |3: - | ins_next - | - |4: // Check for __newindex if previous value is nil. - | ldr TAB:CARG1, TAB:RB->metatable - | cmp TAB:CARG1, #0 - | beq <2 // No metatable: done. - | ldrb CARG1, TAB:CARG1->nomm - | tst CARG1, #1<vmeta_tsets - | - |5: // Follow hash chain. - | movs NODE:INS, NODE:CARG3 - | bne <1 - | // End of hash chain: key not found, add a new one. - | - | // But check for __newindex first. - | ldr TAB:CARG1, TAB:RB->metatable - | mov CARG3, TMPDp - | str PC, SAVE_PC - | cmp TAB:CARG1, #0 // No metatable: continue. - | str BASE, L->base - | ldrbne CARG2, TAB:CARG1->nomm - | mov CARG1, L - | beq >6 - | tst CARG2, #1<vmeta_tsets // 'no __newindex' flag NOT set: check. - |6: - | mvn CARG4, #~LJ_TSTR - | str STR:RC, TMPDlo - | mov CARG2, TAB:RB - | str CARG4, TMPDhi - | bl extern lj_tab_newkey // (lua_State *L, GCtab *t, TValue *k) - | // Returns TValue *. - | ldr BASE, L->base - | ldrd CARG34, [BASE, RA] - | strd CARG34, [CRET1] - | b <3 // No 2nd write barrier needed. - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, CARG2, CARG3 - | b <3 - break; - case BC_TSETB: - | decode_RB8 RB, INS - | and RC, RC, #255 - | // RA = src*8, RB = table*8, RC = index - | ldrd CARG12, [BASE, RB] - | checktab CARG2, ->vmeta_tsetb // STALL: load CARG12. - | ldr CARG3, TAB:CARG1->asize - | ldr RB, TAB:CARG1->array - | lsl CARG2, RC, #3 - | cmp RC, CARG3 - | ldrdlo CARG34, [CARG2, RB]! - | bhs ->vmeta_tsetb - | ins_next1 // Overwrites RB! - | checktp CARG4, LJ_TNIL - | ldrb INS, TAB:CARG1->marked - | ldrd CARG34, [BASE, RA] - | beq >5 - |1: - | tst INS, #LJ_GC_BLACK // isblack(table) - | strd CARG34, [CARG2] - | bne >7 - |2: - | ins_next2 - | ins_next3 - | - |5: // Check for __newindex if previous value is nil. - | ldr TAB:RA, TAB:CARG1->metatable - | cmp TAB:RA, #0 - | beq <1 // No metatable: done. - | ldrb RA, TAB:RA->nomm - | tst RA, #1<vmeta_tsetb - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:CARG1, INS, CARG3 - | b <2 - break; - - case BC_TSETM: - | // RA = base*8 (table at base-1), RC = num_const (start index) - | add RA, BASE, RA - |1: - | ldr RB, SAVE_MULTRES - | ldr TAB:CARG2, [RA, #-8] // Guaranteed to be a table. - | ldr CARG1, [KBASE, RC, lsl #3] // Integer constant is in lo-word. - | subs RB, RB, #8 - | ldr CARG4, TAB:CARG2->asize - | beq >4 // Nothing to copy? - | add CARG3, CARG1, RB, lsr #3 - | cmp CARG3, CARG4 - | ldr CARG4, TAB:CARG2->array - | add RB, RA, RB - | bhi >5 - | add INS, CARG4, CARG1, lsl #3 - | ldrb CARG1, TAB:CARG2->marked - |3: // Copy result slots to table. - | ldrd CARG34, [RA], #8 - | strd CARG34, [INS], #8 - | cmp RA, RB - | blo <3 - | tst CARG1, #LJ_GC_BLACK // isblack(table) - | bne >7 - |4: - | ins_next - | - |5: // Need to resize array part. - | str BASE, L->base - | mov CARG1, L - | str PC, SAVE_PC - | bl extern lj_tab_reasize // (lua_State *L, GCtab *t, int nasize) - | // Must not reallocate the stack. - | .IOS ldr BASE, L->base - | b <1 - | - |7: // Possible table write barrier for any value. Skip valiswhite check. - | barrierback TAB:CARG2, CARG1, CARG3 - | b <4 - break; - - /* -- Calls and vararg handling ----------------------------------------- */ - - case BC_CALLM: - | // RA = base*8, (RB = nresults+1,) RC = extra_nargs - | ldr CARG1, SAVE_MULTRES - | decode_RC8 NARGS8:RC, INS - | add NARGS8:RC, NARGS8:RC, CARG1 - | b ->BC_CALL_Z - break; - case BC_CALL: - | decode_RC8 NARGS8:RC, INS - | // RA = base*8, (RB = nresults+1,) RC = (nargs+1)*8 - |->BC_CALL_Z: - | mov RB, BASE // Save old BASE for vmeta_call. - | ldrd CARG34, [BASE, RA]! - | sub NARGS8:RC, NARGS8:RC, #8 - | add BASE, BASE, #8 - | checkfunc CARG4, ->vmeta_call - | ins_call - break; - - case BC_CALLMT: - | // RA = base*8, (RB = 0,) RC = extra_nargs - | ldr CARG1, SAVE_MULTRES - | add NARGS8:RC, CARG1, RC, lsl #3 - | b ->BC_CALLT1_Z - break; - case BC_CALLT: - | lsl NARGS8:RC, RC, #3 - | // RA = base*8, (RB = 0,) RC = (nargs+1)*8 - |->BC_CALLT1_Z: - | ldrd LFUNC:CARG34, [RA, BASE]! - | sub NARGS8:RC, NARGS8:RC, #8 - | add RA, RA, #8 - | checkfunc CARG4, ->vmeta_callt - | ldr PC, [BASE, FRAME_PC] - |->BC_CALLT2_Z: - | mov RB, #0 - | ldrb CARG4, LFUNC:CARG3->ffid - | tst PC, #FRAME_TYPE - | bne >7 - |1: - | str LFUNC:CARG3, [BASE, FRAME_FUNC] // Copy function down, but keep PC. - | cmp NARGS8:RC, #0 - | beq >3 - |2: - | ldrd CARG12, [RA, RB] - | add INS, RB, #8 - | cmp INS, NARGS8:RC - | strd CARG12, [BASE, RB] - | mov RB, INS - | bne <2 - |3: - | cmp CARG4, #1 // (> FF_C) Calling a fast function? - | bhi >5 - |4: - | ins_callt - | - |5: // Tailcall to a fast function with a Lua frame below. - | ldr INS, [PC, #-4] - | decode_RA8 RA, INS - | sub CARG1, BASE, RA - | ldr LFUNC:CARG1, [CARG1, #-16] - | ldr CARG1, LFUNC:CARG1->field_pc - | ldr KBASE, [CARG1, #PC2PROTO(k)] - | b <4 - | - |7: // Tailcall from a vararg function. - | eor PC, PC, #FRAME_VARG - | tst PC, #FRAME_TYPEP // Vararg frame below? - | movne CARG4, #0 // Clear ffid if no Lua function below. - | bne <1 - | sub BASE, BASE, PC - | ldr PC, [BASE, FRAME_PC] - | tst PC, #FRAME_TYPE - | movne CARG4, #0 // Clear ffid if no Lua function below. - | b <1 - break; - - case BC_ITERC: - | // RA = base*8, (RB = nresults+1, RC = nargs+1 (2+1)) - | add RA, BASE, RA - | mov RB, BASE // Save old BASE for vmeta_call. - | ldrd CARG34, [RA, #-16] - | ldrd CARG12, [RA, #-8] - | add BASE, RA, #8 - | strd CARG34, [RA, #8] // Copy state. - | strd CARG12, [RA, #16] // Copy control var. - | // STALL: locked CARG34. - | ldrd LFUNC:CARG34, [RA, #-24] - | mov NARGS8:RC, #16 // Iterators get 2 arguments. - | // STALL: load CARG34. - | strd LFUNC:CARG34, [RA] // Copy callable. - | checkfunc CARG4, ->vmeta_call - | ins_call - break; - - case BC_ITERN: - | // RA = base*8, (RB = nresults+1, RC = nargs+1 (2+1)) - |.if JIT - | // NYI: add hotloop, record BC_ITERN. - |.endif - | add RA, BASE, RA - | ldr TAB:RB, [RA, #-16] - | ldr CARG1, [RA, #-8] // Get index from control var. - | ldr INS, TAB:RB->asize - | ldr CARG2, TAB:RB->array - | add PC, PC, #4 - |1: // Traverse array part. - | subs RC, CARG1, INS - | add CARG3, CARG2, CARG1, lsl #3 - | bhs >5 // Index points after array part? - | ldrd CARG34, [CARG3] - | checktp CARG4, LJ_TNIL - | addeq CARG1, CARG1, #1 // Skip holes in array part. - | beq <1 - | ldrh RC, [PC, #-2] - | mvn CARG2, #~LJ_TISNUM - | strd CARG34, [RA, #8] - | add RC, PC, RC, lsl #2 - | add RB, CARG1, #1 - | strd CARG12, [RA] - | sub PC, RC, #0x20000 - | str RB, [RA, #-8] // Update control var. - |3: - | ins_next - | - |5: // Traverse hash part. - | ldr CARG4, TAB:RB->hmask - | ldr NODE:RB, TAB:RB->node - |6: - | add CARG1, RC, RC, lsl #1 - | cmp RC, CARG4 // End of iteration? Branch to ITERL+1. - | add NODE:CARG3, NODE:RB, CARG1, lsl #3 // node = tab->node + idx*3*8 - | bhi <3 - | ldrd CARG12, NODE:CARG3->val - | checktp CARG2, LJ_TNIL - | add RC, RC, #1 - | beq <6 // Skip holes in hash part. - | ldrh RB, [PC, #-2] - | add RC, RC, INS - | ldrd CARG34, NODE:CARG3->key - | str RC, [RA, #-8] // Update control var. - | strd CARG12, [RA, #8] - | add RC, PC, RB, lsl #2 - | sub PC, RC, #0x20000 - | strd CARG34, [RA] - | b <3 - break; - - case BC_ISNEXT: - | // RA = base*8, RC = target (points to ITERN) - | add RA, BASE, RA - | add RC, PC, RC, lsl #2 - | ldrd CFUNC:CARG12, [RA, #-24] - | ldr CARG3, [RA, #-12] - | ldr CARG4, [RA, #-4] - | checktp CARG2, LJ_TFUNC - | ldrbeq CARG1, CFUNC:CARG1->ffid - | checktpeq CARG3, LJ_TTAB - | checktpeq CARG4, LJ_TNIL - | cmpeq CARG1, #FF_next_N - | subeq PC, RC, #0x20000 - | bne >5 - | ins_next1 - | ins_next2 - | mov CARG1, #0 - | mvn CARG2, #0x00018000 - | strd CARG1, [RA, #-8] // Initialize control var. - |1: - | ins_next3 - |5: // Despecialize bytecode if any of the checks fail. - | mov CARG1, #BC_JMP - | mov OP, #BC_ITERC - | strb CARG1, [PC, #-4] - | sub PC, RC, #0x20000 - | strb OP, [PC] // Subsumes ins_next1. - | ins_next2 - | b <1 - break; - - case BC_VARG: - | decode_RB8 RB, INS - | decode_RC8 RC, INS - | // RA = base*8, RB = (nresults+1)*8, RC = numparams*8 - | ldr CARG1, [BASE, FRAME_PC] - | add RC, BASE, RC - | add RA, BASE, RA - | add RC, RC, #FRAME_VARG - | add CARG4, RA, RB - | sub CARG3, BASE, #8 // CARG3 = vtop - | sub RC, RC, CARG1 // RC = vbase - | // Note: RC may now be even _above_ BASE if nargs was < numparams. - | cmp RB, #0 - | sub CARG1, CARG3, RC - | beq >5 // Copy all varargs? - | sub CARG4, CARG4, #16 - |1: // Copy vararg slots to destination slots. - | cmp RC, CARG3 - | ldrdlo CARG12, [RC], #8 - | mvnhs CARG2, #~LJ_TNIL - | cmp RA, CARG4 - | strd CARG12, [RA], #8 - | blo <1 - |2: - | ins_next - | - |5: // Copy all varargs. - | ldr CARG4, L->maxstack - | cmp CARG1, #0 - | movle RB, #8 // MULTRES = (0+1)*8 - | addgt RB, CARG1, #8 - | add CARG2, RA, CARG1 - | str RB, SAVE_MULTRES - | ble <2 - | cmp CARG2, CARG4 - | bhi >7 - |6: - | ldrd CARG12, [RC], #8 - | strd CARG12, [RA], #8 - | cmp RC, CARG3 - | blo <6 - | b <2 - | - |7: // Grow stack for varargs. - | lsr CARG2, CARG1, #3 - | str RA, L->top - | mov CARG1, L - | str BASE, L->base - | sub RC, RC, BASE // Need delta, because BASE may change. - | str PC, SAVE_PC - | sub RA, RA, BASE - | bl extern lj_state_growstack // (lua_State *L, int n) - | ldr BASE, L->base - | add RA, BASE, RA - | add RC, BASE, RC - | sub CARG3, BASE, #8 - | b <6 - break; - - /* -- Returns ----------------------------------------------------------- */ - - case BC_RETM: - | // RA = results*8, RC = extra results - | ldr CARG1, SAVE_MULTRES - | ldr PC, [BASE, FRAME_PC] - | add RA, BASE, RA - | add RC, CARG1, RC, lsl #3 - | b ->BC_RETM_Z - break; - - case BC_RET: - | // RA = results*8, RC = nresults+1 - | ldr PC, [BASE, FRAME_PC] - | lsl RC, RC, #3 - | add RA, BASE, RA - |->BC_RETM_Z: - | str RC, SAVE_MULTRES - |1: - | ands CARG1, PC, #FRAME_TYPE - | eor CARG2, PC, #FRAME_VARG - | bne ->BC_RETV2_Z - | - |->BC_RET_Z: - | // BASE = base, RA = resultptr, RC = (nresults+1)*8, PC = return - | ldr INS, [PC, #-4] - | subs CARG4, RC, #8 - | sub CARG3, BASE, #8 - | beq >3 - |2: - | ldrd CARG12, [RA], #8 - | add BASE, BASE, #8 - | subs CARG4, CARG4, #8 - | strd CARG12, [BASE, #-16] - | bne <2 - |3: - | decode_RA8 RA, INS - | sub CARG4, CARG3, RA - | decode_RB8 RB, INS - | ldr LFUNC:CARG1, [CARG4, FRAME_FUNC] - |5: - | cmp RB, RC // More results expected? - | bhi >6 - | mov BASE, CARG4 - | ldr CARG2, LFUNC:CARG1->field_pc - | ins_next1 - | ins_next2 - | ldr KBASE, [CARG2, #PC2PROTO(k)] - | ins_next3 - | - |6: // Fill up results with nil. - | mvn CARG2, #~LJ_TNIL - | add BASE, BASE, #8 - | add RC, RC, #8 - | str CARG2, [BASE, #-12] - | b <5 - | - |->BC_RETV1_Z: // Non-standard return case. - | add RA, BASE, RA - |->BC_RETV2_Z: - | tst CARG2, #FRAME_TYPEP - | bne ->vm_return - | // Return from vararg function: relocate BASE down. - | sub BASE, BASE, CARG2 - | ldr PC, [BASE, FRAME_PC] - | b <1 - break; - - case BC_RET0: case BC_RET1: - | // RA = results*8, RC = nresults+1 - | ldr PC, [BASE, FRAME_PC] - | lsl RC, RC, #3 - | str RC, SAVE_MULTRES - | ands CARG1, PC, #FRAME_TYPE - | eor CARG2, PC, #FRAME_VARG - | ldreq INS, [PC, #-4] - | bne ->BC_RETV1_Z - if (op == BC_RET1) { - | ldrd CARG12, [BASE, RA] - } - | sub CARG4, BASE, #8 - | decode_RA8 RA, INS - if (op == BC_RET1) { - | strd CARG12, [CARG4] - } - | sub BASE, CARG4, RA - | decode_RB8 RB, INS - | ldr LFUNC:CARG1, [BASE, FRAME_FUNC] - |5: - | cmp RB, RC - | bhi >6 - | ldr CARG2, LFUNC:CARG1->field_pc - | ins_next1 - | ins_next2 - | ldr KBASE, [CARG2, #PC2PROTO(k)] - | ins_next3 - | - |6: // Fill up results with nil. - | sub CARG2, CARG4, #4 - | mvn CARG3, #~LJ_TNIL - | str CARG3, [CARG2, RC] - | add RC, RC, #8 - | b <5 - break; - - /* -- Loops and branches ------------------------------------------------ */ - - |.define FOR_IDX, [RA]; .define FOR_TIDX, [RA, #4] - |.define FOR_STOP, [RA, #8]; .define FOR_TSTOP, [RA, #12] - |.define FOR_STEP, [RA, #16]; .define FOR_TSTEP, [RA, #20] - |.define FOR_EXT, [RA, #24]; .define FOR_TEXT, [RA, #28] - - case BC_FORL: - |.if JIT - | hotloop - |.endif - | // Fall through. Assumes BC_IFORL follows. - break; - - case BC_JFORI: - case BC_JFORL: -#if !LJ_HASJIT - break; -#endif - case BC_FORI: - case BC_IFORL: - | // RA = base*8, RC = target (after end of loop or start of loop) - vk = (op == BC_IFORL || op == BC_JFORL); - | ldrd CARG12, [RA, BASE]! - if (op != BC_JFORL) { - | add RC, PC, RC, lsl #2 - } - if (!vk) { - | ldrd CARG34, FOR_STOP - | checktp CARG2, LJ_TISNUM - | ldr RB, FOR_TSTEP - | bne >5 - | checktp CARG4, LJ_TISNUM - | ldr CARG4, FOR_STEP - | checktpeq RB, LJ_TISNUM - | bne ->vmeta_for - | cmp CARG4, #0 - | blt >4 - | cmp CARG1, CARG3 - } else { - | ldrd CARG34, FOR_STEP - | checktp CARG2, LJ_TISNUM - | bne >5 - | adds CARG1, CARG1, CARG3 - | ldr CARG4, FOR_STOP - if (op == BC_IFORL) { - | addvs RC, PC, #0x20000 // Overflow: prevent branch. - } else { - | bvs >2 // Overflow: do not enter mcode. - } - | cmp CARG3, #0 - | blt >4 - | cmp CARG1, CARG4 - } - |1: - if (op == BC_FORI) { - | subgt PC, RC, #0x20000 - } else if (op == BC_JFORI) { - | sub PC, RC, #0x20000 - | ldrhle RC, [PC, #-2] - } else if (op == BC_IFORL) { - | suble PC, RC, #0x20000 - } - if (vk) { - | strd CARG12, FOR_IDX - } - |2: - | ins_next1 - | ins_next2 - | strd CARG12, FOR_EXT - if (op == BC_JFORI || op == BC_JFORL) { - | ble =>BC_JLOOP - } - |3: - | ins_next3 - | - |4: // Invert check for negative step. - if (!vk) { - | cmp CARG3, CARG1 - } else { - | cmp CARG4, CARG1 - } - | b <1 - | - |5: // FP loop. - if (!vk) { - | cmnlo CARG4, #-LJ_TISNUM - | cmnlo RB, #-LJ_TISNUM - | bhs ->vmeta_for - |.if FPU - | vldr d0, FOR_IDX - | vldr d1, FOR_STOP - | cmp RB, #0 - | vstr d0, FOR_EXT - |.else - | cmp RB, #0 - | strd CARG12, FOR_EXT - | blt >8 - |.endif - } else { - |.if FPU - | vldr d0, FOR_IDX - | vldr d2, FOR_STEP - | vldr d1, FOR_STOP - | cmp CARG4, #0 - | vadd.f64 d0, d0, d2 - |.else - | cmp CARG4, #0 - | blt >8 - | bl extern __aeabi_dadd - | strd CARG12, FOR_IDX - | ldrd CARG34, FOR_STOP - | strd CARG12, FOR_EXT - |.endif - } - |6: - |.if FPU - | vcmpge.f64 d0, d1 - | vcmplt.f64 d1, d0 - | vmrs - |.else - | bl extern __aeabi_cdcmple - |.endif - if (vk) { - |.if FPU - | vstr d0, FOR_IDX - | vstr d0, FOR_EXT - |.endif - } - if (op == BC_FORI) { - | subhi PC, RC, #0x20000 - } else if (op == BC_JFORI) { - | sub PC, RC, #0x20000 - | ldrhls RC, [PC, #-2] - | bls =>BC_JLOOP - } else if (op == BC_IFORL) { - | subls PC, RC, #0x20000 - } else { - | bls =>BC_JLOOP - } - | ins_next1 - | ins_next2 - | b <3 - | - |.if not FPU - |8: // Invert check for negative step. - if (vk) { - | bl extern __aeabi_dadd - | strd CARG12, FOR_IDX - | strd CARG12, FOR_EXT - } - | mov CARG3, CARG1 - | mov CARG4, CARG2 - | ldrd CARG12, FOR_STOP - | b <6 - |.endif - break; - - case BC_ITERL: - |.if JIT - | hotloop - |.endif - | // Fall through. Assumes BC_IITERL follows. - break; - - case BC_JITERL: -#if !LJ_HASJIT - break; -#endif - case BC_IITERL: - | // RA = base*8, RC = target - | ldrd CARG12, [RA, BASE]! - if (op == BC_JITERL) { - | cmn CARG2, #-LJ_TNIL // Stop if iterator returned nil. - | strdne CARG12, [RA, #-8] - | bne =>BC_JLOOP - } else { - | add RC, PC, RC, lsl #2 - | // STALL: load CARG12. - | cmn CARG2, #-LJ_TNIL // Stop if iterator returned nil. - | subne PC, RC, #0x20000 // Otherwise save control var + branch. - | strdne CARG12, [RA, #-8] - } - | ins_next - break; - - case BC_LOOP: - | // RA = base*8, RC = target (loop extent) - | // Note: RA/RC is only used by trace recorder to determine scope/extent - | // This opcode does NOT jump, it's only purpose is to detect a hot loop. - |.if JIT - | hotloop - |.endif - | // Fall through. Assumes BC_ILOOP follows. - break; - - case BC_ILOOP: - | // RA = base*8, RC = target (loop extent) - | ins_next - break; - - case BC_JLOOP: - |.if JIT - | // RA = base (ignored), RC = traceno - | ldr CARG1, [DISPATCH, #DISPATCH_J(trace)] - | mov CARG2, #0 // Traces on ARM don't store the trace number, so use 0. - | ldr TRACE:RC, [CARG1, RC, lsl #2] - | st_vmstate CARG2 - | ldr RA, TRACE:RC->mcode - | str BASE, [DISPATCH, #DISPATCH_GL(jit_base)] - | str L, [DISPATCH, #DISPATCH_GL(jit_L)] - | bx RA - |.endif - break; - - case BC_JMP: - | // RA = base*8 (only used by trace recorder), RC = target - | add RC, PC, RC, lsl #2 - | sub PC, RC, #0x20000 - | ins_next - break; - - /* -- Function headers -------------------------------------------------- */ - - case BC_FUNCF: - |.if JIT - | hotcall - |.endif - case BC_FUNCV: /* NYI: compiled vararg functions. */ - | // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow. - break; - - case BC_JFUNCF: -#if !LJ_HASJIT - break; -#endif - case BC_IFUNCF: - | // BASE = new base, RA = BASE+framesize*8, CARG3 = LFUNC, RC = nargs*8 - | ldr CARG1, L->maxstack - | ldrb CARG2, [PC, #-4+PC2PROTO(numparams)] - | ldr KBASE, [PC, #-4+PC2PROTO(k)] - | cmp RA, CARG1 - | bhi ->vm_growstack_l - if (op != BC_JFUNCF) { - | ins_next1 - | ins_next2 - } - |2: - | cmp NARGS8:RC, CARG2, lsl #3 // Check for missing parameters. - | mvn CARG4, #~LJ_TNIL - | blo >3 - if (op == BC_JFUNCF) { - | decode_RD RC, INS - | b =>BC_JLOOP - } else { - | ins_next3 - } - | - |3: // Clear missing parameters. - | strd CARG34, [BASE, NARGS8:RC] - | add NARGS8:RC, NARGS8:RC, #8 - | b <2 - break; - - case BC_JFUNCV: -#if !LJ_HASJIT - break; -#endif - | NYI // NYI: compiled vararg functions - break; /* NYI: compiled vararg functions. */ - - case BC_IFUNCV: - | // BASE = new base, RA = BASE+framesize*8, CARG3 = LFUNC, RC = nargs*8 - | ldr CARG1, L->maxstack - | add CARG4, BASE, RC - | add RA, RA, RC - | str LFUNC:CARG3, [CARG4] // Store copy of LFUNC. - | add CARG2, RC, #8+FRAME_VARG - | ldr KBASE, [PC, #-4+PC2PROTO(k)] - | cmp RA, CARG1 - | str CARG2, [CARG4, #4] // Store delta + FRAME_VARG. - | bhs ->vm_growstack_l - | ldrb RB, [PC, #-4+PC2PROTO(numparams)] - | mov RA, BASE - | mov RC, CARG4 - | cmp RB, #0 - | add BASE, CARG4, #8 - | beq >3 - | mvn CARG3, #~LJ_TNIL - |1: - | cmp RA, RC // Less args than parameters? - | ldrdlo CARG12, [RA], #8 - | movhs CARG2, CARG3 - | strlo CARG3, [RA, #-4] // Clear old fixarg slot (help the GC). - |2: - | subs RB, RB, #1 - | strd CARG12, [CARG4, #8]! - | bne <1 - |3: - | ins_next - break; - - case BC_FUNCC: - case BC_FUNCCW: - | // BASE = new base, RA = BASE+framesize*8, CARG3 = CFUNC, RC = nargs*8 - if (op == BC_FUNCC) { - | ldr CARG4, CFUNC:CARG3->f - } else { - | ldr CARG4, [DISPATCH, #DISPATCH_GL(wrapf)] - } - | add CARG2, RA, NARGS8:RC - | ldr CARG1, L->maxstack - | add RC, BASE, NARGS8:RC - | str BASE, L->base - | cmp CARG2, CARG1 - | str RC, L->top - if (op == BC_FUNCCW) { - | ldr CARG2, CFUNC:CARG3->f - } - | mv_vmstate CARG3, C - | mov CARG1, L - | bhi ->vm_growstack_c // Need to grow stack. - | st_vmstate CARG3 - | blx CARG4 // (lua_State *L [, lua_CFunction f]) - | // Returns nresults. - | ldr BASE, L->base - | mv_vmstate CARG3, INTERP - | ldr CRET2, L->top - | lsl RC, CRET1, #3 - | st_vmstate CARG3 - | ldr PC, [BASE, FRAME_PC] - | sub RA, CRET2, RC // RA = L->top - nresults*8 - | b ->vm_returnc - break; - - /* ---------------------------------------------------------------------- */ - - default: - fprintf(stderr, "Error: undefined opcode BC_%s\n", bc_names[op]); - exit(2); - break; - } -} - -static int build_backend(BuildCtx *ctx) -{ - int op; - - dasm_growpc(Dst, BC__MAX); - - build_subroutines(ctx); - - |.code_op - for (op = 0; op < BC__MAX; op++) - build_ins(ctx, (BCOp)op, op); - - return BC__MAX; -} - -/* Emit pseudo frame-info for all assembler functions. */ -static void emit_asm_debug(BuildCtx *ctx) -{ - int fcofs = (int)((uint8_t *)ctx->glob[GLOB_vm_ffi_call] - ctx->code); - int i; - switch (ctx->mode) { - case BUILD_elfasm: - fprintf(ctx->fp, "\t.section .debug_frame,\"\",%%progbits\n"); - fprintf(ctx->fp, - ".Lframe0:\n" - "\t.long .LECIE0-.LSCIE0\n" - ".LSCIE0:\n" - "\t.long 0xffffffff\n" - "\t.byte 0x1\n" - "\t.string \"\"\n" - "\t.uleb128 0x1\n" - "\t.sleb128 -4\n" - "\t.byte 0xe\n" /* Return address is in lr. */ - "\t.byte 0xc\n\t.uleb128 0xd\n\t.uleb128 0\n" /* def_cfa sp */ - "\t.align 2\n" - ".LECIE0:\n\n"); - fprintf(ctx->fp, - ".LSFDE0:\n" - "\t.long .LEFDE0-.LASFDE0\n" - ".LASFDE0:\n" - "\t.long .Lframe0\n" - "\t.long .Lbegin\n" - "\t.long %d\n" - "\t.byte 0xe\n\t.uleb128 %d\n" /* def_cfa_offset */ - "\t.byte 0x8e\n\t.uleb128 1\n", /* offset lr */ - fcofs, CFRAME_SIZE); - for (i = 11; i >= (LJ_ARCH_HASFPU ? 5 : 4); i--) /* offset r4-r11 */ - fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+i, 2+(11-i)); -#if LJ_ARCH_HASFPU - for (i = 15; i >= 8; i--) /* offset d8-d15 */ - fprintf(ctx->fp, "\t.byte 5\n\t.uleb128 %d, %d\n", - 64+2*i, 10+2*(15-i)); - fprintf(ctx->fp, "\t.byte 0x84\n\t.uleb128 %d\n", 25); /* offset r4 */ -#endif - fprintf(ctx->fp, - "\t.align 2\n" - ".LEFDE0:\n\n"); -#if LJ_HASFFI - fprintf(ctx->fp, - ".LSFDE1:\n" - "\t.long .LEFDE1-.LASFDE1\n" - ".LASFDE1:\n" - "\t.long .Lframe0\n" - "\t.long lj_vm_ffi_call\n" - "\t.long %d\n" - "\t.byte 0xe\n\t.uleb128 16\n" /* def_cfa_offset */ - "\t.byte 0x8e\n\t.uleb128 1\n" /* offset lr */ - "\t.byte 0x8b\n\t.uleb128 2\n" /* offset r11 */ - "\t.byte 0x85\n\t.uleb128 3\n" /* offset r5 */ - "\t.byte 0x84\n\t.uleb128 4\n" /* offset r4 */ - "\t.byte 0xd\n\t.uleb128 0xb\n" /* def_cfa_register r11 */ - "\t.align 2\n" - ".LEFDE1:\n\n", (int)ctx->codesz - fcofs); -#endif - break; - default: - break; - } -} - diff --git a/subprojects/luajit/src/vm_mips.dasc b/subprojects/luajit/src/vm_mips.dasc deleted file mode 100644 index 3f9c98c1a..000000000 --- a/subprojects/luajit/src/vm_mips.dasc +++ /dev/null @@ -1,4248 +0,0 @@ -|// Low-level VM code for MIPS CPUs. -|// Bytecode interpreter, fast functions and helper functions. -|// Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -| -|.arch mips -|.section code_op, code_sub -| -|.actionlist build_actionlist -|.globals GLOB_ -|.globalnames globnames -|.externnames extnames -| -|// Note: The ragged indentation of the instructions is intentional. -|// The starting columns indicate data dependencies. -| -|//----------------------------------------------------------------------- -| -|// Fixed register assignments for the interpreter. -|// Don't use: r0 = 0, r26/r27 = reserved, r28 = gp, r29 = sp, r31 = ra -| -|// The following must be C callee-save (but BASE is often refetched). -|.define BASE, r16 // Base of current Lua stack frame. -|.define KBASE, r17 // Constants of current Lua function. -|.define PC, r18 // Next PC. -|.define DISPATCH, r19 // Opcode dispatch table. -|.define LREG, r20 // Register holding lua_State (also in SAVE_L). -|.define MULTRES, r21 // Size of multi-result: (nresults+1)*8. -|// NYI: r22 currently unused. -| -|.define JGL, r30 // On-trace: global_State + 32768. -| -|// Constants for type-comparisons, stores and conversions. C callee-save. -|.define TISNIL, r30 -|.define TOBIT, f30 // 2^52 + 2^51. -| -|// The following temporaries are not saved across C calls, except for RA. -|.define RA, r23 // Callee-save. -|.define RB, r8 -|.define RC, r9 -|.define RD, r10 -|.define INS, r11 -| -|.define AT, r1 // Assembler temporary. -|.define TMP0, r12 -|.define TMP1, r13 -|.define TMP2, r14 -|.define TMP3, r15 -| -|// Calling conventions. -|.define CFUNCADDR, r25 -|.define CARG1, r4 -|.define CARG2, r5 -|.define CARG3, r6 -|.define CARG4, r7 -| -|.define CRET1, r2 -|.define CRET2, r3 -| -|.define FARG1, f12 -|.define FARG2, f14 -| -|.define FRET1, f0 -|.define FRET2, f2 -| -|// Stack layout while in interpreter. Must match with lj_frame.h. -|.define CFRAME_SPACE, 112 // Delta for sp. -| -|.define SAVE_ERRF, 124(sp) // 32 bit C frame info. -|.define SAVE_NRES, 120(sp) -|.define SAVE_CFRAME, 116(sp) -|.define SAVE_L, 112(sp) -|//----- 8 byte aligned, ^^^^ 16 byte register save area, owned by interpreter. -|.define SAVE_GPR_, 72 // .. 72+10*4: 32 bit GPR saves. -|.define SAVE_FPR_, 24 // .. 24+6*8: 64 bit FPR saves. -|.define SAVE_PC, 20(sp) -|.define ARG5, 16(sp) -|.define CSAVE_4, 12(sp) -|.define CSAVE_3, 8(sp) -|.define CSAVE_2, 4(sp) -|.define CSAVE_1, 0(sp) -|//----- 8 byte aligned, ^^^^ 16 byte register save area, owned by callee. -| -|.define ARG5_OFS, 16 -|.define SAVE_MULTRES, ARG5 -| -|.macro saveregs -| addiu sp, sp, -CFRAME_SPACE -| sw ra, SAVE_GPR_+9*4(sp) -| sw r30, SAVE_GPR_+8*4(sp) -| sdc1 f30, SAVE_FPR_+5*8(sp) -| sw r23, SAVE_GPR_+7*4(sp) -| sw r22, SAVE_GPR_+6*4(sp) -| sdc1 f28, SAVE_FPR_+4*8(sp) -| sw r21, SAVE_GPR_+5*4(sp) -| sw r20, SAVE_GPR_+4*4(sp) -| sdc1 f26, SAVE_FPR_+3*8(sp) -| sw r19, SAVE_GPR_+3*4(sp) -| sw r18, SAVE_GPR_+2*4(sp) -| sdc1 f24, SAVE_FPR_+2*8(sp) -| sw r17, SAVE_GPR_+1*4(sp) -| sw r16, SAVE_GPR_+0*4(sp) -| sdc1 f22, SAVE_FPR_+1*8(sp) -| sdc1 f20, SAVE_FPR_+0*8(sp) -|.endmacro -| -|.macro restoreregs_ret -| lw ra, SAVE_GPR_+9*4(sp) -| lw r30, SAVE_GPR_+8*4(sp) -| ldc1 f30, SAVE_FPR_+5*8(sp) -| lw r23, SAVE_GPR_+7*4(sp) -| lw r22, SAVE_GPR_+6*4(sp) -| ldc1 f28, SAVE_FPR_+4*8(sp) -| lw r21, SAVE_GPR_+5*4(sp) -| lw r20, SAVE_GPR_+4*4(sp) -| ldc1 f26, SAVE_FPR_+3*8(sp) -| lw r19, SAVE_GPR_+3*4(sp) -| lw r18, SAVE_GPR_+2*4(sp) -| ldc1 f24, SAVE_FPR_+2*8(sp) -| lw r17, SAVE_GPR_+1*4(sp) -| lw r16, SAVE_GPR_+0*4(sp) -| ldc1 f22, SAVE_FPR_+1*8(sp) -| ldc1 f20, SAVE_FPR_+0*8(sp) -| jr ra -| addiu sp, sp, CFRAME_SPACE -|.endmacro -| -|// Type definitions. Some of these are only used for documentation. -|.type L, lua_State, LREG -|.type GL, global_State -|.type TVALUE, TValue -|.type GCOBJ, GCobj -|.type STR, GCstr -|.type TAB, GCtab -|.type LFUNC, GCfuncL -|.type CFUNC, GCfuncC -|.type PROTO, GCproto -|.type UPVAL, GCupval -|.type NODE, Node -|.type NARGS8, int -|.type TRACE, GCtrace -| -|//----------------------------------------------------------------------- -| -|// Trap for not-yet-implemented parts. -|.macro NYI; .long 0xf0f0f0f0; .endmacro -| -|// Macros to mark delay slots. -|.macro ., a; a; .endmacro -|.macro ., a,b; a,b; .endmacro -|.macro ., a,b,c; a,b,c; .endmacro -| -|//----------------------------------------------------------------------- -| -|// Endian-specific defines. -|.define FRAME_PC, LJ_ENDIAN_SELECT(-4,-8) -|.define FRAME_FUNC, LJ_ENDIAN_SELECT(-8,-4) -|.define HI, LJ_ENDIAN_SELECT(4,0) -|.define LO, LJ_ENDIAN_SELECT(0,4) -|.define OFS_RD, LJ_ENDIAN_SELECT(2,0) -|.define OFS_RA, LJ_ENDIAN_SELECT(1,2) -|.define OFS_OP, LJ_ENDIAN_SELECT(0,3) -| -|// Instruction decode. -|.macro decode_OP1, dst, ins; andi dst, ins, 0xff; .endmacro -|.macro decode_OP4a, dst, ins; andi dst, ins, 0xff; .endmacro -|.macro decode_OP4b, dst; sll dst, dst, 2; .endmacro -|.macro decode_RC4a, dst, ins; srl dst, ins, 14; .endmacro -|.macro decode_RC4b, dst; andi dst, dst, 0x3fc; .endmacro -|.macro decode_RD4b, dst; sll dst, dst, 2; .endmacro -|.macro decode_RA8a, dst, ins; srl dst, ins, 5; .endmacro -|.macro decode_RA8b, dst; andi dst, dst, 0x7f8; .endmacro -|.macro decode_RB8a, dst, ins; srl dst, ins, 21; .endmacro -|.macro decode_RB8b, dst; andi dst, dst, 0x7f8; .endmacro -|.macro decode_RD8a, dst, ins; srl dst, ins, 16; .endmacro -|.macro decode_RD8b, dst; sll dst, dst, 3; .endmacro -|.macro decode_RDtoRC8, dst, src; andi dst, src, 0x7f8; .endmacro -| -|// Instruction fetch. -|.macro ins_NEXT1 -| lw INS, 0(PC) -| addiu PC, PC, 4 -|.endmacro -|// Instruction decode+dispatch. -|.macro ins_NEXT2 -| decode_OP4a TMP1, INS -| decode_OP4b TMP1 -| addu TMP0, DISPATCH, TMP1 -| decode_RD8a RD, INS -| lw AT, 0(TMP0) -| decode_RA8a RA, INS -| decode_RD8b RD -| jr AT -| decode_RA8b RA -|.endmacro -|.macro ins_NEXT -| ins_NEXT1 -| ins_NEXT2 -|.endmacro -| -|// Instruction footer. -|.if 1 -| // Replicated dispatch. Less unpredictable branches, but higher I-Cache use. -| .define ins_next, ins_NEXT -| .define ins_next_, ins_NEXT -| .define ins_next1, ins_NEXT1 -| .define ins_next2, ins_NEXT2 -|.else -| // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch. -| // Affects only certain kinds of benchmarks (and only with -j off). -| .macro ins_next -| b ->ins_next -| .endmacro -| .macro ins_next1 -| .endmacro -| .macro ins_next2 -| b ->ins_next -| .endmacro -| .macro ins_next_ -| ->ins_next: -| ins_NEXT -| .endmacro -|.endif -| -|// Call decode and dispatch. -|.macro ins_callt -| // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC -| lw PC, LFUNC:RB->pc -| lw INS, 0(PC) -| addiu PC, PC, 4 -| decode_OP4a TMP1, INS -| decode_RA8a RA, INS -| decode_OP4b TMP1 -| decode_RA8b RA -| addu TMP0, DISPATCH, TMP1 -| lw TMP0, 0(TMP0) -| jr TMP0 -| addu RA, RA, BASE -|.endmacro -| -|.macro ins_call -| // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, PC = caller PC -| sw PC, FRAME_PC(BASE) -| ins_callt -|.endmacro -| -|//----------------------------------------------------------------------- -| -|.macro branch_RD -| srl TMP0, RD, 1 -| lui AT, (-(BCBIAS_J*4 >> 16) & 65535) -| addu TMP0, TMP0, AT -| addu PC, PC, TMP0 -|.endmacro -| -|// Assumes DISPATCH is relative to GL. -#define DISPATCH_GL(field) (GG_DISP2G + (int)offsetof(global_State, field)) -#define DISPATCH_J(field) (GG_DISP2J + (int)offsetof(jit_State, field)) -#define GG_DISP2GOT (GG_OFS(got) - GG_OFS(dispatch)) -#define DISPATCH_GOT(name) (GG_DISP2GOT + 4*LJ_GOT_##name) -| -#define PC2PROTO(field) ((int)offsetof(GCproto, field)-(int)sizeof(GCproto)) -| -|.macro load_got, func -| lw CFUNCADDR, DISPATCH_GOT(func)(DISPATCH) -|.endmacro -|// Much faster. Sadly, there's no easy way to force the required code layout. -|// .macro call_intern, func; bal extern func; .endmacro -|.macro call_intern, func; jalr CFUNCADDR; .endmacro -|.macro call_extern; jalr CFUNCADDR; .endmacro -|.macro jmp_extern; jr CFUNCADDR; .endmacro -| -|.macro hotcheck, delta, target -| srl TMP1, PC, 1 -| andi TMP1, TMP1, 126 -| addu TMP1, TMP1, DISPATCH -| lhu TMP2, GG_DISP2HOT(TMP1) -| addiu TMP2, TMP2, -delta -| bltz TMP2, target -|. sh TMP2, GG_DISP2HOT(TMP1) -|.endmacro -| -|.macro hotloop -| hotcheck HOTCOUNT_LOOP, ->vm_hotloop -|.endmacro -| -|.macro hotcall -| hotcheck HOTCOUNT_CALL, ->vm_hotcall -|.endmacro -| -|// Set current VM state. Uses TMP0. -|.macro li_vmstate, st; li TMP0, ~LJ_VMST_..st; .endmacro -|.macro st_vmstate; sw TMP0, DISPATCH_GL(vmstate)(DISPATCH); .endmacro -| -|// Move table write barrier back. Overwrites mark and tmp. -|.macro barrierback, tab, mark, tmp, target -| lw tmp, DISPATCH_GL(gc.grayagain)(DISPATCH) -| andi mark, mark, ~LJ_GC_BLACK & 255 // black2gray(tab) -| sw tab, DISPATCH_GL(gc.grayagain)(DISPATCH) -| sb mark, tab->marked -| b target -|. sw tmp, tab->gclist -|.endmacro -| -|//----------------------------------------------------------------------- - -/* Generate subroutines used by opcodes and other parts of the VM. */ -/* The .code_sub section should be last to help static branch prediction. */ -static void build_subroutines(BuildCtx *ctx) -{ - |.code_sub - | - |//----------------------------------------------------------------------- - |//-- Return handling ---------------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_returnp: - | // See vm_return. Also: TMP2 = previous base. - | andi AT, PC, FRAME_P - | beqz AT, ->cont_dispatch - |. li TMP1, LJ_TTRUE - | - | // Return from pcall or xpcall fast func. - | lw PC, FRAME_PC(TMP2) // Fetch PC of previous frame. - | move BASE, TMP2 // Restore caller base. - | // Prepending may overwrite the pcall frame, so do it at the end. - | sw TMP1, FRAME_PC(RA) // Prepend true to results. - | addiu RA, RA, -8 - | - |->vm_returnc: - | addiu RD, RD, 8 // RD = (nresults+1)*8. - | andi TMP0, PC, FRAME_TYPE - | beqz RD, ->vm_unwind_c_eh - |. li CRET1, LUA_YIELD - | beqz TMP0, ->BC_RET_Z // Handle regular return to Lua. - |. move MULTRES, RD - | - |->vm_return: - | // BASE = base, RA = resultptr, RD/MULTRES = (nresults+1)*8, PC = return - | // TMP0 = PC & FRAME_TYPE - | li TMP2, -8 - | xori AT, TMP0, FRAME_C - | and TMP2, PC, TMP2 - | bnez AT, ->vm_returnp - | subu TMP2, BASE, TMP2 // TMP2 = previous base. - | - | addiu TMP1, RD, -8 - | sw TMP2, L->base - | li_vmstate C - | lw TMP2, SAVE_NRES - | addiu BASE, BASE, -8 - | st_vmstate - | beqz TMP1, >2 - |. sll TMP2, TMP2, 3 - |1: - | addiu TMP1, TMP1, -8 - | ldc1 f0, 0(RA) - | addiu RA, RA, 8 - | sdc1 f0, 0(BASE) - | bnez TMP1, <1 - |. addiu BASE, BASE, 8 - | - |2: - | bne TMP2, RD, >6 - |3: - |. sw BASE, L->top // Store new top. - | - |->vm_leave_cp: - | lw TMP0, SAVE_CFRAME // Restore previous C frame. - | move CRET1, r0 // Ok return status for vm_pcall. - | sw TMP0, L->cframe - | - |->vm_leave_unw: - | restoreregs_ret - | - |6: - | lw TMP1, L->maxstack - | slt AT, TMP2, RD - | bnez AT, >7 // Less results wanted? - | // More results wanted. Check stack size and fill up results with nil. - |. slt AT, BASE, TMP1 - | beqz AT, >8 - |. nop - | sw TISNIL, HI(BASE) - | addiu RD, RD, 8 - | b <2 - |. addiu BASE, BASE, 8 - | - |7: // Less results wanted. - | subu TMP0, RD, TMP2 - | subu TMP0, BASE, TMP0 // Either keep top or shrink it. - | b <3 - |. movn BASE, TMP0, TMP2 // LUA_MULTRET+1 case? - | - |8: // Corner case: need to grow stack for filling up results. - | // This can happen if: - | // - A C function grows the stack (a lot). - | // - The GC shrinks the stack in between. - | // - A return back from a lua_call() with (high) nresults adjustment. - | load_got lj_state_growstack - | move MULTRES, RD - | srl CARG2, TMP2, 3 - | call_intern lj_state_growstack // (lua_State *L, int n) - |. move CARG1, L - | lw TMP2, SAVE_NRES - | lw BASE, L->top // Need the (realloced) L->top in BASE. - | move RD, MULTRES - | b <2 - |. sll TMP2, TMP2, 3 - | - |->vm_unwind_c: // Unwind C stack, return from vm_pcall. - | // (void *cframe, int errcode) - | move sp, CARG1 - | move CRET1, CARG2 - |->vm_unwind_c_eh: // Landing pad for external unwinder. - | lw L, SAVE_L - | li TMP0, ~LJ_VMST_C - | lw GL:TMP1, L->glref - | b ->vm_leave_unw - |. sw TMP0, GL:TMP1->vmstate - | - |->vm_unwind_ff: // Unwind C stack, return from ff pcall. - | // (void *cframe) - | li AT, -4 - | and sp, CARG1, AT - |->vm_unwind_ff_eh: // Landing pad for external unwinder. - | lw L, SAVE_L - | lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). - | li TISNIL, LJ_TNIL - | lw BASE, L->base - | lw DISPATCH, L->glref // Setup pointer to dispatch table. - | mtc1 TMP3, TOBIT - | li TMP1, LJ_TFALSE - | li_vmstate INTERP - | lw PC, FRAME_PC(BASE) // Fetch PC of previous frame. - | cvt.d.s TOBIT, TOBIT - | addiu RA, BASE, -8 // Results start at BASE-8. - | addiu DISPATCH, DISPATCH, GG_G2DISP - | sw TMP1, HI(RA) // Prepend false to error message. - | st_vmstate - | b ->vm_returnc - |. li RD, 16 // 2 results: false + error message. - | - |//----------------------------------------------------------------------- - |//-- Grow stack for calls ----------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_growstack_c: // Grow stack for C function. - | b >2 - |. li CARG2, LUA_MINSTACK - | - |->vm_growstack_l: // Grow stack for Lua function. - | // BASE = new base, RA = BASE+framesize*8, RC = nargs*8, PC = first PC - | addu RC, BASE, RC - | subu RA, RA, BASE - | sw BASE, L->base - | addiu PC, PC, 4 // Must point after first instruction. - | sw RC, L->top - | srl CARG2, RA, 3 - |2: - | // L->base = new base, L->top = top - | load_got lj_state_growstack - | sw PC, SAVE_PC - | call_intern lj_state_growstack // (lua_State *L, int n) - |. move CARG1, L - | lw BASE, L->base - | lw RC, L->top - | lw LFUNC:RB, FRAME_FUNC(BASE) - | subu RC, RC, BASE - | // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC - | ins_callt // Just retry the call. - | - |//----------------------------------------------------------------------- - |//-- Entry points into the assembler VM --------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_resume: // Setup C frame and resume thread. - | // (lua_State *L, TValue *base, int nres1 = 0, ptrdiff_t ef = 0) - | saveregs - | move L, CARG1 - | lw DISPATCH, L->glref // Setup pointer to dispatch table. - | move BASE, CARG2 - | lbu TMP1, L->status - | sw L, SAVE_L - | li PC, FRAME_CP - | addiu TMP0, sp, CFRAME_RESUME - | addiu DISPATCH, DISPATCH, GG_G2DISP - | sw r0, SAVE_NRES - | sw r0, SAVE_ERRF - | sw TMP0, L->cframe - | sw r0, SAVE_CFRAME - | beqz TMP1, >3 - |. sw CARG1, SAVE_PC // Any value outside of bytecode is ok. - | - | // Resume after yield (like a return). - | move RA, BASE - | lw BASE, L->base - | lw TMP1, L->top - | lw PC, FRAME_PC(BASE) - | lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). - | subu RD, TMP1, BASE - | mtc1 TMP3, TOBIT - | sb r0, L->status - | cvt.d.s TOBIT, TOBIT - | li_vmstate INTERP - | addiu RD, RD, 8 - | st_vmstate - | move MULTRES, RD - | andi TMP0, PC, FRAME_TYPE - | beqz TMP0, ->BC_RET_Z - |. li TISNIL, LJ_TNIL - | b ->vm_return - |. nop - | - |->vm_pcall: // Setup protected C frame and enter VM. - | // (lua_State *L, TValue *base, int nres1, ptrdiff_t ef) - | saveregs - | sw CARG4, SAVE_ERRF - | b >1 - |. li PC, FRAME_CP - | - |->vm_call: // Setup C frame and enter VM. - | // (lua_State *L, TValue *base, int nres1) - | saveregs - | li PC, FRAME_C - | - |1: // Entry point for vm_pcall above (PC = ftype). - | lw TMP1, L:CARG1->cframe - | sw CARG3, SAVE_NRES - | move L, CARG1 - | sw CARG1, SAVE_L - | move BASE, CARG2 - | sw sp, L->cframe // Add our C frame to cframe chain. - | lw DISPATCH, L->glref // Setup pointer to dispatch table. - | sw CARG1, SAVE_PC // Any value outside of bytecode is ok. - | sw TMP1, SAVE_CFRAME - | addiu DISPATCH, DISPATCH, GG_G2DISP - | - |3: // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype). - | lw TMP2, L->base // TMP2 = old base (used in vmeta_call). - | lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). - | lw TMP1, L->top - | mtc1 TMP3, TOBIT - | addu PC, PC, BASE - | subu NARGS8:RC, TMP1, BASE - | subu PC, PC, TMP2 // PC = frame delta + frame type - | cvt.d.s TOBIT, TOBIT - | li_vmstate INTERP - | li TISNIL, LJ_TNIL - | st_vmstate - | - |->vm_call_dispatch: - | // TMP2 = old base, BASE = new base, RC = nargs*8, PC = caller PC - | lw TMP0, FRAME_PC(BASE) - | li AT, LJ_TFUNC - | bne TMP0, AT, ->vmeta_call - |. lw LFUNC:RB, FRAME_FUNC(BASE) - | - |->vm_call_dispatch_f: - | ins_call - | // BASE = new base, RB = func, RC = nargs*8, PC = caller PC - | - |->vm_cpcall: // Setup protected C frame, call C. - | // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp) - | saveregs - | move L, CARG1 - | lw TMP0, L:CARG1->stack - | sw CARG1, SAVE_L - | lw TMP1, L->top - | sw CARG1, SAVE_PC // Any value outside of bytecode is ok. - | subu TMP0, TMP0, TMP1 // Compute -savestack(L, L->top). - | lw TMP1, L->cframe - | sw sp, L->cframe // Add our C frame to cframe chain. - | sw TMP0, SAVE_NRES // Neg. delta means cframe w/o frame. - | sw r0, SAVE_ERRF // No error function. - | move CFUNCADDR, CARG4 - | jalr CARG4 // (lua_State *L, lua_CFunction func, void *ud) - |. sw TMP1, SAVE_CFRAME - | move BASE, CRET1 - | lw DISPATCH, L->glref // Setup pointer to dispatch table. - | li PC, FRAME_CP - | bnez CRET1, <3 // Else continue with the call. - |. addiu DISPATCH, DISPATCH, GG_G2DISP - | b ->vm_leave_cp // No base? Just remove C frame. - |. nop - | - |//----------------------------------------------------------------------- - |//-- Metamethod handling ------------------------------------------------ - |//----------------------------------------------------------------------- - | - |// The lj_meta_* functions (except for lj_meta_cat) don't reallocate the - |// stack, so BASE doesn't need to be reloaded across these calls. - | - |//-- Continuation dispatch ---------------------------------------------- - | - |->cont_dispatch: - | // BASE = meta base, RA = resultptr, RD = (nresults+1)*8 - | lw TMP0, -16+LO(BASE) // Continuation. - | move RB, BASE - | move BASE, TMP2 // Restore caller BASE. - | lw LFUNC:TMP1, FRAME_FUNC(TMP2) - |.if FFI - | sltiu AT, TMP0, 2 - |.endif - | lw PC, -16+HI(RB) // Restore PC from [cont|PC]. - | addu TMP2, RA, RD - | lw TMP1, LFUNC:TMP1->pc - |.if FFI - | bnez AT, >1 - |.endif - |. sw TISNIL, -8+HI(TMP2) // Ensure one valid arg. - | // BASE = base, RA = resultptr, RB = meta base - | jr TMP0 // Jump to continuation. - |. lw KBASE, PC2PROTO(k)(TMP1) - | - |.if FFI - |1: - | bnez TMP0, ->cont_ffi_callback // cont = 1: return from FFI callback. - | // cont = 0: tailcall from C function. - |. addiu TMP1, RB, -16 - | b ->vm_call_tail - |. subu RC, TMP1, BASE - |.endif - | - |->cont_cat: // RA = resultptr, RB = meta base - | lw INS, -4(PC) - | addiu CARG2, RB, -16 - | ldc1 f0, 0(RA) - | decode_RB8a MULTRES, INS - | decode_RA8a RA, INS - | decode_RB8b MULTRES - | decode_RA8b RA - | addu TMP1, BASE, MULTRES - | sw BASE, L->base - | subu CARG3, CARG2, TMP1 - | bne TMP1, CARG2, ->BC_CAT_Z - |. sdc1 f0, 0(CARG2) - | addu RA, BASE, RA - | b ->cont_nop - |. sdc1 f0, 0(RA) - | - |//-- Table indexing metamethods ----------------------------------------- - | - |->vmeta_tgets1: - | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv) - | li TMP0, LJ_TSTR - | sw STR:RC, LO(CARG3) - | b >1 - |. sw TMP0, HI(CARG3) - | - |->vmeta_tgets: - | addiu CARG2, DISPATCH, DISPATCH_GL(tmptv) - | li TMP0, LJ_TTAB - | sw TAB:RB, LO(CARG2) - | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv2) - | sw TMP0, HI(CARG2) - | li TMP1, LJ_TSTR - | sw STR:RC, LO(CARG3) - | b >1 - |. sw TMP1, HI(CARG3) - | - |->vmeta_tgetb: // TMP0 = index - | mtc1 TMP0, f0 - | cvt.d.w f0, f0 - | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv) - | sdc1 f0, 0(CARG3) - | - |->vmeta_tgetv: - |1: - | load_got lj_meta_tget - | sw BASE, L->base - | sw PC, SAVE_PC - | call_intern lj_meta_tget // (lua_State *L, TValue *o, TValue *k) - |. move CARG1, L - | // Returns TValue * (finished) or NULL (metamethod). - | beqz CRET1, >3 - |. addiu TMP1, BASE, -FRAME_CONT - | ldc1 f0, 0(CRET1) - | ins_next1 - | sdc1 f0, 0(RA) - | ins_next2 - | - |3: // Call __index metamethod. - | // BASE = base, L->top = new base, stack = cont/func/t/k - | lw BASE, L->top - | sw PC, -16+HI(BASE) // [cont|PC] - | subu PC, BASE, TMP1 - | lw LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here. - | b ->vm_call_dispatch_f - |. li NARGS8:RC, 16 // 2 args for func(t, k). - | - |//----------------------------------------------------------------------- - | - |->vmeta_tsets1: - | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv) - | li TMP0, LJ_TSTR - | sw STR:RC, LO(CARG3) - | b >1 - |. sw TMP0, HI(CARG3) - | - |->vmeta_tsets: - | addiu CARG2, DISPATCH, DISPATCH_GL(tmptv) - | li TMP0, LJ_TTAB - | sw TAB:RB, LO(CARG2) - | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv2) - | sw TMP0, HI(CARG2) - | li TMP1, LJ_TSTR - | sw STR:RC, LO(CARG3) - | b >1 - |. sw TMP1, HI(CARG3) - | - |->vmeta_tsetb: // TMP0 = index - | mtc1 TMP0, f0 - | cvt.d.w f0, f0 - | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv) - | sdc1 f0, 0(CARG3) - | - |->vmeta_tsetv: - |1: - | load_got lj_meta_tset - | sw BASE, L->base - | sw PC, SAVE_PC - | call_intern lj_meta_tset // (lua_State *L, TValue *o, TValue *k) - |. move CARG1, L - | // Returns TValue * (finished) or NULL (metamethod). - | beqz CRET1, >3 - |. ldc1 f0, 0(RA) - | // NOBARRIER: lj_meta_tset ensures the table is not black. - | ins_next1 - | sdc1 f0, 0(CRET1) - | ins_next2 - | - |3: // Call __newindex metamethod. - | // BASE = base, L->top = new base, stack = cont/func/t/k/(v) - | addiu TMP1, BASE, -FRAME_CONT - | lw BASE, L->top - | sw PC, -16+HI(BASE) // [cont|PC] - | subu PC, BASE, TMP1 - | lw LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here. - | sdc1 f0, 16(BASE) // Copy value to third argument. - | b ->vm_call_dispatch_f - |. li NARGS8:RC, 24 // 3 args for func(t, k, v) - | - |//-- Comparison metamethods --------------------------------------------- - | - |->vmeta_comp: - | // CARG2, CARG3 are already set by BC_ISLT/BC_ISGE/BC_ISLE/BC_ISGT. - | load_got lj_meta_comp - | addiu PC, PC, -4 - | sw BASE, L->base - | sw PC, SAVE_PC - | decode_OP1 CARG4, INS - | call_intern lj_meta_comp // (lua_State *L, TValue *o1, *o2, int op) - |. move CARG1, L - | // Returns 0/1 or TValue * (metamethod). - |3: - | sltiu AT, CRET1, 2 - | beqz AT, ->vmeta_binop - | negu TMP2, CRET1 - |4: - | lhu RD, OFS_RD(PC) - | addiu PC, PC, 4 - | lui TMP1, (-(BCBIAS_J*4 >> 16) & 65535) - | sll RD, RD, 2 - | addu RD, RD, TMP1 - | and RD, RD, TMP2 - | addu PC, PC, RD - |->cont_nop: - | ins_next - | - |->cont_ra: // RA = resultptr - | lbu TMP1, -4+OFS_RA(PC) - | ldc1 f0, 0(RA) - | sll TMP1, TMP1, 3 - | addu TMP1, BASE, TMP1 - | b ->cont_nop - |. sdc1 f0, 0(TMP1) - | - |->cont_condt: // RA = resultptr - | lw TMP0, HI(RA) - | sltiu AT, TMP0, LJ_TISTRUECOND - | b <4 - |. negu TMP2, AT // Branch if result is true. - | - |->cont_condf: // RA = resultptr - | lw TMP0, HI(RA) - | sltiu AT, TMP0, LJ_TISTRUECOND - | b <4 - |. addiu TMP2, AT, -1 // Branch if result is false. - | - |->vmeta_equal: - | // CARG2, CARG3, CARG4 are already set by BC_ISEQV/BC_ISNEV. - | load_got lj_meta_equal - | addiu PC, PC, -4 - | sw BASE, L->base - | sw PC, SAVE_PC - | call_intern lj_meta_equal // (lua_State *L, GCobj *o1, *o2, int ne) - |. move CARG1, L - | // Returns 0/1 or TValue * (metamethod). - | b <3 - |. nop - | - |->vmeta_equal_cd: - |.if FFI - | load_got lj_meta_equal_cd - | move CARG2, INS - | addiu PC, PC, -4 - | sw BASE, L->base - | sw PC, SAVE_PC - | call_intern lj_meta_equal_cd // (lua_State *L, BCIns op) - |. move CARG1, L - | // Returns 0/1 or TValue * (metamethod). - | b <3 - |. nop - |.endif - | - |//-- Arithmetic metamethods --------------------------------------------- - | - |->vmeta_unm: - | move CARG4, CARG3 - | - |->vmeta_arith: - | load_got lj_meta_arith - | decode_OP1 TMP0, INS - | sw BASE, L->base - | sw PC, SAVE_PC - | move CARG2, RA - | sw TMP0, ARG5 - | call_intern lj_meta_arith // (lua_State *L, TValue *ra,*rb,*rc, BCReg op) - |. move CARG1, L - | // Returns NULL (finished) or TValue * (metamethod). - | beqz CRET1, ->cont_nop - |. nop - | - | // Call metamethod for binary op. - |->vmeta_binop: - | // BASE = old base, CRET1 = new base, stack = cont/func/o1/o2 - | subu TMP1, CRET1, BASE - | sw PC, -16+HI(CRET1) // [cont|PC] - | move TMP2, BASE - | addiu PC, TMP1, FRAME_CONT - | move BASE, CRET1 - | b ->vm_call_dispatch - |. li NARGS8:RC, 16 // 2 args for func(o1, o2). - | - |->vmeta_len: - | // CARG2 already set by BC_LEN. -#if LJ_52 - | move MULTRES, CARG1 -#endif - | load_got lj_meta_len - | sw BASE, L->base - | sw PC, SAVE_PC - | call_intern lj_meta_len // (lua_State *L, TValue *o) - |. move CARG1, L - | // Returns NULL (retry) or TValue * (metamethod base). -#if LJ_52 - | bnez CRET1, ->vmeta_binop // Binop call for compatibility. - |. nop - | b ->BC_LEN_Z - |. move CARG1, MULTRES -#else - | b ->vmeta_binop // Binop call for compatibility. - |. nop -#endif - | - |//-- Call metamethod ---------------------------------------------------- - | - |->vmeta_call: // Resolve and call __call metamethod. - | // TMP2 = old base, BASE = new base, RC = nargs*8 - | load_got lj_meta_call - | sw TMP2, L->base // This is the callers base! - | addiu CARG2, BASE, -8 - | sw PC, SAVE_PC - | addu CARG3, BASE, RC - | move MULTRES, NARGS8:RC - | call_intern lj_meta_call // (lua_State *L, TValue *func, TValue *top) - |. move CARG1, L - | lw LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here. - | addiu NARGS8:RC, MULTRES, 8 // Got one more argument now. - | ins_call - | - |->vmeta_callt: // Resolve __call for BC_CALLT. - | // BASE = old base, RA = new base, RC = nargs*8 - | load_got lj_meta_call - | sw BASE, L->base - | addiu CARG2, RA, -8 - | sw PC, SAVE_PC - | addu CARG3, RA, RC - | move MULTRES, NARGS8:RC - | call_intern lj_meta_call // (lua_State *L, TValue *func, TValue *top) - |. move CARG1, L - | lw TMP1, FRAME_PC(BASE) - | lw LFUNC:RB, FRAME_FUNC(RA) // Guaranteed to be a function here. - | b ->BC_CALLT_Z - |. addiu NARGS8:RC, MULTRES, 8 // Got one more argument now. - | - |//-- Argument coercion for 'for' statement ------------------------------ - | - |->vmeta_for: - | load_got lj_meta_for - | sw BASE, L->base - | move CARG2, RA - | sw PC, SAVE_PC - | move MULTRES, INS - | call_intern lj_meta_for // (lua_State *L, TValue *base) - |. move CARG1, L - |.if JIT - | decode_OP1 TMP0, MULTRES - | li AT, BC_JFORI - |.endif - | decode_RA8a RA, MULTRES - | decode_RD8a RD, MULTRES - | decode_RA8b RA - |.if JIT - | beq TMP0, AT, =>BC_JFORI - |. decode_RD8b RD - | b =>BC_FORI - |. nop - |.else - | b =>BC_FORI - |. decode_RD8b RD - |.endif - | - |//----------------------------------------------------------------------- - |//-- Fast functions ----------------------------------------------------- - |//----------------------------------------------------------------------- - | - |.macro .ffunc, name - |->ff_ .. name: - |.endmacro - | - |.macro .ffunc_1, name - |->ff_ .. name: - | beqz NARGS8:RC, ->fff_fallback - |. lw CARG3, HI(BASE) - | lw CARG1, LO(BASE) - |.endmacro - | - |.macro .ffunc_2, name - |->ff_ .. name: - | sltiu AT, NARGS8:RC, 16 - | lw CARG3, HI(BASE) - | bnez AT, ->fff_fallback - |. lw CARG4, 8+HI(BASE) - | lw CARG1, LO(BASE) - | lw CARG2, 8+LO(BASE) - |.endmacro - | - |.macro .ffunc_n, name // Caveat: has delay slot! - |->ff_ .. name: - | lw CARG3, HI(BASE) - | beqz NARGS8:RC, ->fff_fallback - |. ldc1 FARG1, 0(BASE) - | sltiu AT, CARG3, LJ_TISNUM - | beqz AT, ->fff_fallback - |.endmacro - | - |.macro .ffunc_nn, name // Caveat: has delay slot! - |->ff_ .. name: - | sltiu AT, NARGS8:RC, 16 - | lw CARG3, HI(BASE) - | bnez AT, ->fff_fallback - |. lw CARG4, 8+HI(BASE) - | ldc1 FARG1, 0(BASE) - | ldc1 FARG2, 8(BASE) - | sltiu TMP0, CARG3, LJ_TISNUM - | sltiu TMP1, CARG4, LJ_TISNUM - | and TMP0, TMP0, TMP1 - | beqz TMP0, ->fff_fallback - |.endmacro - | - |// Inlined GC threshold check. Caveat: uses TMP0 and TMP1 and has delay slot! - |.macro ffgccheck - | lw TMP0, DISPATCH_GL(gc.total)(DISPATCH) - | lw TMP1, DISPATCH_GL(gc.threshold)(DISPATCH) - | subu AT, TMP0, TMP1 - | bgezal AT, ->fff_gcstep - |.endmacro - | - |//-- Base library: checks ----------------------------------------------- - | - |.ffunc_1 assert - | sltiu AT, CARG3, LJ_TISTRUECOND - | beqz AT, ->fff_fallback - |. addiu RA, BASE, -8 - | lw PC, FRAME_PC(BASE) - | addiu RD, NARGS8:RC, 8 // Compute (nresults+1)*8. - | addu TMP2, RA, NARGS8:RC - | sw CARG3, HI(RA) - | addiu TMP1, BASE, 8 - | beq BASE, TMP2, ->fff_res // Done if exactly 1 argument. - |. sw CARG1, LO(RA) - |1: - | ldc1 f0, 0(TMP1) - | sdc1 f0, -8(TMP1) - | bne TMP1, TMP2, <1 - |. addiu TMP1, TMP1, 8 - | b ->fff_res - |. nop - | - |.ffunc type - | lw CARG3, HI(BASE) - | li TMP1, LJ_TISNUM - | beqz NARGS8:RC, ->fff_fallback - |. sltiu TMP0, CARG3, LJ_TISNUM - | movz TMP1, CARG3, TMP0 - | not TMP1, TMP1 - | sll TMP1, TMP1, 3 - | addu TMP1, CFUNC:RB, TMP1 - | b ->fff_resn - |. ldc1 FRET1, CFUNC:TMP1->upvalue - | - |//-- Base library: getters and setters --------------------------------- - | - |.ffunc_1 getmetatable - | li AT, LJ_TTAB - | bne CARG3, AT, >6 - |. li AT, LJ_TUDATA - |1: // Field metatable must be at same offset for GCtab and GCudata! - | lw TAB:CARG1, TAB:CARG1->metatable - |2: - | lw STR:RC, DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])(DISPATCH) - | beqz TAB:CARG1, ->fff_restv - |. li CARG3, LJ_TNIL - | lw TMP0, TAB:CARG1->hmask - | li CARG3, LJ_TTAB // Use metatable as default result. - | lw TMP1, STR:RC->hash - | lw NODE:TMP2, TAB:CARG1->node - | and TMP1, TMP1, TMP0 // idx = str->hash & tab->hmask - | sll TMP0, TMP1, 5 - | sll TMP1, TMP1, 3 - | subu TMP1, TMP0, TMP1 - | addu NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8) - | li AT, LJ_TSTR - |3: // Rearranged logic, because we expect _not_ to find the key. - | lw CARG4, offsetof(Node, key)+HI(NODE:TMP2) - | lw TMP0, offsetof(Node, key)+LO(NODE:TMP2) - | lw NODE:TMP3, NODE:TMP2->next - | bne CARG4, AT, >4 - |. lw CARG2, offsetof(Node, val)+HI(NODE:TMP2) - | beq TMP0, STR:RC, >5 - |. lw TMP1, offsetof(Node, val)+LO(NODE:TMP2) - |4: - | beqz NODE:TMP3, ->fff_restv // Not found, keep default result. - |. move NODE:TMP2, NODE:TMP3 - | b <3 - |. nop - |5: - | beq CARG2, TISNIL, ->fff_restv // Ditto for nil value. - |. nop - | move CARG3, CARG2 // Return value of mt.__metatable. - | b ->fff_restv - |. move CARG1, TMP1 - | - |6: - | beq CARG3, AT, <1 - |. sltiu TMP0, CARG3, LJ_TISNUM - | li TMP1, LJ_TISNUM - | movz TMP1, CARG3, TMP0 - | not TMP1, TMP1 - | sll TMP1, TMP1, 2 - | addu TMP1, DISPATCH, TMP1 - | b <2 - |. lw TAB:CARG1, DISPATCH_GL(gcroot[GCROOT_BASEMT])(TMP1) - | - |.ffunc_2 setmetatable - | // Fast path: no mt for table yet and not clearing the mt. - | li AT, LJ_TTAB - | bne CARG3, AT, ->fff_fallback - |. addiu CARG4, CARG4, -LJ_TTAB - | lw TAB:TMP1, TAB:CARG1->metatable - | lbu TMP3, TAB:CARG1->marked - | or AT, CARG4, TAB:TMP1 - | bnez AT, ->fff_fallback - |. andi AT, TMP3, LJ_GC_BLACK // isblack(table) - | beqz AT, ->fff_restv - |. sw TAB:CARG2, TAB:CARG1->metatable - | barrierback TAB:CARG1, TMP3, TMP0, ->fff_restv - | - |.ffunc rawget - | lw CARG4, HI(BASE) - | sltiu AT, NARGS8:RC, 16 - | lw TAB:CARG2, LO(BASE) - | load_got lj_tab_get - | addiu CARG4, CARG4, -LJ_TTAB - | or AT, AT, CARG4 - | bnez AT, ->fff_fallback - | addiu CARG3, BASE, 8 - | call_intern lj_tab_get // (lua_State *L, GCtab *t, cTValue *key) - |. move CARG1, L - | // Returns cTValue *. - | b ->fff_resn - |. ldc1 FRET1, 0(CRET1) - | - |//-- Base library: conversions ------------------------------------------ - | - |.ffunc tonumber - | // Only handles the number case inline (without a base argument). - | lw CARG1, HI(BASE) - | xori AT, NARGS8:RC, 8 - | sltiu CARG1, CARG1, LJ_TISNUM - | movn CARG1, r0, AT - | beqz CARG1, ->fff_fallback // Exactly one number argument. - |. ldc1 FRET1, 0(BASE) - | b ->fff_resn - |. nop - | - |.ffunc_1 tostring - | // Only handles the string or number case inline. - | li AT, LJ_TSTR - | // A __tostring method in the string base metatable is ignored. - | beq CARG3, AT, ->fff_restv // String key? - | // Handle numbers inline, unless a number base metatable is present. - |. lw TMP1, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])(DISPATCH) - | sltiu TMP0, CARG3, LJ_TISNUM - | sltiu TMP1, TMP1, 1 - | and TMP0, TMP0, TMP1 - | beqz TMP0, ->fff_fallback - |. sw BASE, L->base // Add frame since C call can throw. - | ffgccheck - |. sw PC, SAVE_PC // Redundant (but a defined value). - | load_got lj_str_fromnum - | move CARG1, L - | call_intern lj_str_fromnum // (lua_State *L, lua_Number *np) - |. move CARG2, BASE - | // Returns GCstr *. - | li CARG3, LJ_TSTR - | b ->fff_restv - |. move CARG1, CRET1 - | - |//-- Base library: iterators ------------------------------------------- - | - |.ffunc next - | lw CARG1, HI(BASE) - | lw TAB:CARG2, LO(BASE) - | beqz NARGS8:RC, ->fff_fallback - |. addu TMP2, BASE, NARGS8:RC - | li AT, LJ_TTAB - | sw TISNIL, HI(TMP2) // Set missing 2nd arg to nil. - | bne CARG1, AT, ->fff_fallback - |. lw PC, FRAME_PC(BASE) - | load_got lj_tab_next - | sw BASE, L->base // Add frame since C call can throw. - | sw BASE, L->top // Dummy frame length is ok. - | addiu CARG3, BASE, 8 - | sw PC, SAVE_PC - | call_intern lj_tab_next // (lua_State *L, GCtab *t, TValue *key) - |. move CARG1, L - | // Returns 0 at end of traversal. - | beqz CRET1, ->fff_restv // End of traversal: return nil. - |. li CARG3, LJ_TNIL - | ldc1 f0, 8(BASE) // Copy key and value to results. - | addiu RA, BASE, -8 - | ldc1 f2, 16(BASE) - | li RD, (2+1)*8 - | sdc1 f0, 0(RA) - | b ->fff_res - |. sdc1 f2, 8(RA) - | - |.ffunc_1 pairs - | li AT, LJ_TTAB - | bne CARG3, AT, ->fff_fallback - |. lw PC, FRAME_PC(BASE) -#if LJ_52 - | lw TAB:TMP2, TAB:CARG1->metatable - | ldc1 f0, CFUNC:RB->upvalue[0] - | bnez TAB:TMP2, ->fff_fallback -#else - | ldc1 f0, CFUNC:RB->upvalue[0] -#endif - |. addiu RA, BASE, -8 - | sw TISNIL, 8+HI(BASE) - | li RD, (3+1)*8 - | b ->fff_res - |. sdc1 f0, 0(RA) - | - |.ffunc ipairs_aux - | sltiu AT, NARGS8:RC, 16 - | lw CARG3, HI(BASE) - | lw TAB:CARG1, LO(BASE) - | lw CARG4, 8+HI(BASE) - | bnez AT, ->fff_fallback - |. ldc1 FARG2, 8(BASE) - | addiu CARG3, CARG3, -LJ_TTAB - | sltiu AT, CARG4, LJ_TISNUM - | li TMP0, 1 - | movn AT, r0, CARG3 - | mtc1 TMP0, FARG1 - | beqz AT, ->fff_fallback - |. lw PC, FRAME_PC(BASE) - | cvt.w.d FRET1, FARG2 - | cvt.d.w FARG1, FARG1 - | lw TMP0, TAB:CARG1->asize - | lw TMP1, TAB:CARG1->array - | mfc1 TMP2, FRET1 - | addiu RA, BASE, -8 - | add.d FARG2, FARG2, FARG1 - | addiu TMP2, TMP2, 1 - | sltu AT, TMP2, TMP0 - | sll TMP3, TMP2, 3 - | addu TMP3, TMP1, TMP3 - | beqz AT, >2 // Not in array part? - |. sdc1 FARG2, 0(RA) - | lw TMP2, HI(TMP3) - | ldc1 f0, 0(TMP3) - |1: - | beq TMP2, TISNIL, ->fff_res // End of iteration, return 0 results. - |. li RD, (0+1)*8 - | li RD, (2+1)*8 - | b ->fff_res - |. sdc1 f0, 8(RA) - |2: // Check for empty hash part first. Otherwise call C function. - | lw TMP0, TAB:CARG1->hmask - | load_got lj_tab_getinth - | beqz TMP0, ->fff_res - |. li RD, (0+1)*8 - | call_intern lj_tab_getinth // (GCtab *t, int32_t key) - |. move CARG2, TMP2 - | // Returns cTValue * or NULL. - | beqz CRET1, ->fff_res - |. li RD, (0+1)*8 - | lw TMP2, HI(CRET1) - | b <1 - |. ldc1 f0, 0(CRET1) - | - |.ffunc_1 ipairs - | li AT, LJ_TTAB - | bne CARG3, AT, ->fff_fallback - |. lw PC, FRAME_PC(BASE) -#if LJ_52 - | lw TAB:TMP2, TAB:CARG1->metatable - | ldc1 f0, CFUNC:RB->upvalue[0] - | bnez TAB:TMP2, ->fff_fallback -#else - | ldc1 f0, CFUNC:RB->upvalue[0] -#endif - |. addiu RA, BASE, -8 - | sw r0, 8+HI(BASE) - | sw r0, 8+LO(BASE) - | li RD, (3+1)*8 - | b ->fff_res - |. sdc1 f0, 0(RA) - | - |//-- Base library: catch errors ---------------------------------------- - | - |.ffunc pcall - | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH) - | beqz NARGS8:RC, ->fff_fallback - | move TMP2, BASE - | addiu BASE, BASE, 8 - | // Remember active hook before pcall. - | srl TMP3, TMP3, HOOK_ACTIVE_SHIFT - | andi TMP3, TMP3, 1 - | addiu PC, TMP3, 8+FRAME_PCALL - | b ->vm_call_dispatch - |. addiu NARGS8:RC, NARGS8:RC, -8 - | - |.ffunc xpcall - | sltiu AT, NARGS8:RC, 16 - | lw CARG4, 8+HI(BASE) - | bnez AT, ->fff_fallback - |. ldc1 FARG2, 8(BASE) - | ldc1 FARG1, 0(BASE) - | lbu TMP1, DISPATCH_GL(hookmask)(DISPATCH) - | li AT, LJ_TFUNC - | move TMP2, BASE - | bne CARG4, AT, ->fff_fallback // Traceback must be a function. - | addiu BASE, BASE, 16 - | // Remember active hook before pcall. - | srl TMP3, TMP3, HOOK_ACTIVE_SHIFT - | sdc1 FARG2, 0(TMP2) // Swap function and traceback. - | andi TMP3, TMP3, 1 - | sdc1 FARG1, 8(TMP2) - | addiu PC, TMP3, 16+FRAME_PCALL - | b ->vm_call_dispatch - |. addiu NARGS8:RC, NARGS8:RC, -16 - | - |//-- Coroutine library -------------------------------------------------- - | - |.macro coroutine_resume_wrap, resume - |.if resume - |.ffunc_1 coroutine_resume - | li AT, LJ_TTHREAD - | bne CARG3, AT, ->fff_fallback - |.else - |.ffunc coroutine_wrap_aux - | lw L:CARG1, CFUNC:RB->upvalue[0].gcr - |.endif - | lbu TMP0, L:CARG1->status - | lw TMP1, L:CARG1->cframe - | lw CARG2, L:CARG1->top - | lw TMP2, L:CARG1->base - | addiu TMP3, TMP0, -LUA_YIELD - | bgtz TMP3, ->fff_fallback // st > LUA_YIELD? - |. xor TMP2, TMP2, CARG2 - | bnez TMP1, ->fff_fallback // cframe != 0? - |. or AT, TMP2, TMP0 - | lw TMP0, L:CARG1->maxstack - | beqz AT, ->fff_fallback // base == top && st == 0? - |. lw PC, FRAME_PC(BASE) - | addu TMP2, CARG2, NARGS8:RC - | sltu AT, TMP0, TMP2 - | bnez AT, ->fff_fallback // Stack overflow? - |. sw PC, SAVE_PC - | sw BASE, L->base - |1: - |.if resume - | addiu BASE, BASE, 8 // Keep resumed thread in stack for GC. - | addiu NARGS8:RC, NARGS8:RC, -8 - | addiu TMP2, TMP2, -8 - |.endif - | sw TMP2, L:CARG1->top - | addu TMP1, BASE, NARGS8:RC - | move CARG3, CARG2 - | sw BASE, L->top - |2: // Move args to coroutine. - | ldc1 f0, 0(BASE) - | sltu AT, BASE, TMP1 - | beqz AT, >3 - |. addiu BASE, BASE, 8 - | sdc1 f0, 0(CARG3) - | b <2 - |. addiu CARG3, CARG3, 8 - |3: - | bal ->vm_resume // (lua_State *L, TValue *base, 0, 0) - |. move L:RA, L:CARG1 - | // Returns thread status. - |4: - | lw TMP2, L:RA->base - | sltiu AT, CRET1, LUA_YIELD+1 - | lw TMP3, L:RA->top - | li_vmstate INTERP - | lw BASE, L->base - | st_vmstate - | beqz AT, >8 - |. subu RD, TMP3, TMP2 - | lw TMP0, L->maxstack - | beqz RD, >6 // No results? - |. addu TMP1, BASE, RD - | sltu AT, TMP0, TMP1 - | bnez AT, >9 // Need to grow stack? - |. addu TMP3, TMP2, RD - | sw TMP2, L:RA->top // Clear coroutine stack. - | move TMP1, BASE - |5: // Move results from coroutine. - | ldc1 f0, 0(TMP2) - | addiu TMP2, TMP2, 8 - | sltu AT, TMP2, TMP3 - | sdc1 f0, 0(TMP1) - | bnez AT, <5 - |. addiu TMP1, TMP1, 8 - |6: - | andi TMP0, PC, FRAME_TYPE - |.if resume - | li TMP1, LJ_TTRUE - | addiu RA, BASE, -8 - | sw TMP1, -8+HI(BASE) // Prepend true to results. - | addiu RD, RD, 16 - |.else - | move RA, BASE - | addiu RD, RD, 8 - |.endif - |7: - | sw PC, SAVE_PC - | beqz TMP0, ->BC_RET_Z - |. move MULTRES, RD - | b ->vm_return - |. nop - | - |8: // Coroutine returned with error (at co->top-1). - |.if resume - | addiu TMP3, TMP3, -8 - | li TMP1, LJ_TFALSE - | ldc1 f0, 0(TMP3) - | sw TMP3, L:RA->top // Remove error from coroutine stack. - | li RD, (2+1)*8 - | sw TMP1, -8+HI(BASE) // Prepend false to results. - | addiu RA, BASE, -8 - | sdc1 f0, 0(BASE) // Copy error message. - | b <7 - |. andi TMP0, PC, FRAME_TYPE - |.else - | load_got lj_ffh_coroutine_wrap_err - | move CARG2, L:RA - | call_intern lj_ffh_coroutine_wrap_err // (lua_State *L, lua_State *co) - |. move CARG1, L - |.endif - | - |9: // Handle stack expansion on return from yield. - | load_got lj_state_growstack - | srl CARG2, RD, 3 - | call_intern lj_state_growstack // (lua_State *L, int n) - |. move CARG1, L - | b <4 - |. li CRET1, 0 - |.endmacro - | - | coroutine_resume_wrap 1 // coroutine.resume - | coroutine_resume_wrap 0 // coroutine.wrap - | - |.ffunc coroutine_yield - | lw TMP0, L->cframe - | addu TMP1, BASE, NARGS8:RC - | sw BASE, L->base - | andi TMP0, TMP0, CFRAME_RESUME - | sw TMP1, L->top - | beqz TMP0, ->fff_fallback - |. li CRET1, LUA_YIELD - | sw r0, L->cframe - | b ->vm_leave_unw - |. sb CRET1, L->status - | - |//-- Math library ------------------------------------------------------- - | - |.ffunc_n math_abs - |. abs.d FRET1, FARG1 - |->fff_resn: - | lw PC, FRAME_PC(BASE) - | addiu RA, BASE, -8 - | b ->fff_res1 - |. sdc1 FRET1, -8(BASE) - | - |->fff_restv: - | // CARG3/CARG1 = TValue result. - | lw PC, FRAME_PC(BASE) - | sw CARG3, -8+HI(BASE) - | addiu RA, BASE, -8 - | sw CARG1, -8+LO(BASE) - |->fff_res1: - | // RA = results, PC = return. - | li RD, (1+1)*8 - |->fff_res: - | // RA = results, RD = (nresults+1)*8, PC = return. - | andi TMP0, PC, FRAME_TYPE - | bnez TMP0, ->vm_return - |. move MULTRES, RD - | lw INS, -4(PC) - | decode_RB8a RB, INS - | decode_RB8b RB - |5: - | sltu AT, RD, RB - | bnez AT, >6 // More results expected? - |. decode_RA8a TMP0, INS - | decode_RA8b TMP0 - | ins_next1 - | // Adjust BASE. KBASE is assumed to be set for the calling frame. - | subu BASE, RA, TMP0 - | ins_next2 - | - |6: // Fill up results with nil. - | addu TMP1, RA, RD - | addiu RD, RD, 8 - | b <5 - |. sw TISNIL, -8+HI(TMP1) - | - |.macro math_extern, func - |->ff_math_ .. func: - | lw CARG3, HI(BASE) - | beqz NARGS8:RC, ->fff_fallback - |. load_got func - | sltiu AT, CARG3, LJ_TISNUM - | beqz AT, ->fff_fallback - |. nop - | call_extern - |. ldc1 FARG1, 0(BASE) - | b ->fff_resn - |. nop - |.endmacro - | - |.macro math_extern2, func - | .ffunc_nn math_ .. func - |. load_got func - | call_extern - |. nop - | b ->fff_resn - |. nop - |.endmacro - | - |.macro math_round, func - | .ffunc_n math_ .. func - |. nop - | bal ->vm_ .. func - |. nop - | b ->fff_resn - |. nop - |.endmacro - | - | math_round floor - | math_round ceil - | - |.ffunc math_log - | lw CARG3, HI(BASE) - | li AT, 8 - | bne NARGS8:RC, AT, ->fff_fallback // Exactly 1 argument. - |. load_got log - | sltiu AT, CARG3, LJ_TISNUM - | beqz AT, ->fff_fallback - |. nop - | call_extern - |. ldc1 FARG1, 0(BASE) - | b ->fff_resn - |. nop - | - | math_extern log10 - | math_extern exp - | math_extern sin - | math_extern cos - | math_extern tan - | math_extern asin - | math_extern acos - | math_extern atan - | math_extern sinh - | math_extern cosh - | math_extern tanh - | math_extern2 pow - | math_extern2 atan2 - | math_extern2 fmod - | - |.ffunc_n math_sqrt - |. sqrt.d FRET1, FARG1 - | b ->fff_resn - |. nop - | - |->ff_math_deg: - |.ffunc_n math_rad - |. ldc1 FARG2, CFUNC:RB->upvalue[0] - | b ->fff_resn - |. mul.d FRET1, FARG1, FARG2 - | - |.ffunc_nn math_ldexp - | cvt.w.d FARG2, FARG2 - | load_got ldexp - | mfc1 CARG3, FARG2 - | call_extern - |. nop - | b ->fff_resn - |. nop - | - |.ffunc_n math_frexp - | load_got frexp - | lw PC, FRAME_PC(BASE) - | call_extern - |. addiu CARG3, DISPATCH, DISPATCH_GL(tmptv) - | lw TMP1, DISPATCH_GL(tmptv)(DISPATCH) - | addiu RA, BASE, -8 - | mtc1 TMP1, FARG2 - | sdc1 FRET1, 0(RA) - | cvt.d.w FARG2, FARG2 - | sdc1 FARG2, 8(RA) - | b ->fff_res - |. li RD, (2+1)*8 - | - |.ffunc_n math_modf - | load_got modf - | lw PC, FRAME_PC(BASE) - | call_extern - |. addiu CARG3, BASE, -8 - | addiu RA, BASE, -8 - | sdc1 FRET1, 0(BASE) - | b ->fff_res - |. li RD, (2+1)*8 - | - |.macro math_minmax, name, ismax - |->ff_ .. name: - | lw CARG3, HI(BASE) - | beqz NARGS8:RC, ->fff_fallback - |. ldc1 FRET1, 0(BASE) - | sltiu AT, CARG3, LJ_TISNUM - | beqz AT, ->fff_fallback - |. addu TMP2, BASE, NARGS8:RC - | addiu TMP1, BASE, 8 - | beq TMP1, TMP2, ->fff_resn - |1: - |. lw CARG3, HI(TMP1) - | ldc1 FARG1, 0(TMP1) - | addiu TMP1, TMP1, 8 - | sltiu AT, CARG3, LJ_TISNUM - | beqz AT, ->fff_fallback - |.if ismax - |. c.olt.d FARG1, FRET1 - |.else - |. c.olt.d FRET1, FARG1 - |.endif - | bne TMP1, TMP2, <1 - |. movf.d FRET1, FARG1 - | b ->fff_resn - |. nop - |.endmacro - | - | math_minmax math_min, 0 - | math_minmax math_max, 1 - | - |//-- String library ----------------------------------------------------- - | - |.ffunc_1 string_len - | li AT, LJ_TSTR - | bne CARG3, AT, ->fff_fallback - |. nop - | b ->fff_resi - |. lw CRET1, STR:CARG1->len - | - |.ffunc string_byte // Only handle the 1-arg case here. - | lw CARG3, HI(BASE) - | lw STR:CARG1, LO(BASE) - | xori AT, NARGS8:RC, 8 - | addiu CARG3, CARG3, -LJ_TSTR - | or AT, AT, CARG3 - | bnez AT, ->fff_fallback // Need exactly 1 string argument. - |. nop - | lw TMP0, STR:CARG1->len - | lbu TMP1, STR:CARG1[1] // Access is always ok (NUL at end). - | addiu RA, BASE, -8 - | sltu RD, r0, TMP0 - | mtc1 TMP1, f0 - | addiu RD, RD, 1 - | cvt.d.w f0, f0 - | lw PC, FRAME_PC(BASE) - | sll RD, RD, 3 // RD = ((str->len != 0)+1)*8 - | b ->fff_res - |. sdc1 f0, 0(RA) - | - |.ffunc string_char // Only handle the 1-arg case here. - | ffgccheck - |. nop - | lw CARG3, HI(BASE) - | ldc1 FARG1, 0(BASE) - | li AT, 8 - | bne NARGS8:RC, AT, ->fff_fallback // Exactly 1 argument. - |. sltiu AT, CARG3, LJ_TISNUM - | beqz AT, ->fff_fallback - |. li CARG3, 1 - | cvt.w.d FARG1, FARG1 - | addiu CARG2, sp, ARG5_OFS - | sltiu AT, TMP0, 256 - | mfc1 TMP0, FARG1 - | beqz AT, ->fff_fallback - |. sw TMP0, ARG5 - |->fff_newstr: - | load_got lj_str_new - | sw BASE, L->base - | sw PC, SAVE_PC - | call_intern lj_str_new // (lua_State *L, char *str, size_t l) - |. move CARG1, L - | // Returns GCstr *. - | lw BASE, L->base - | move CARG1, CRET1 - | b ->fff_restv - |. li CARG3, LJ_TSTR - | - |.ffunc string_sub - | ffgccheck - |. nop - | addiu AT, NARGS8:RC, -16 - | lw CARG3, 16+HI(BASE) - | ldc1 f0, 16(BASE) - | lw TMP0, HI(BASE) - | lw STR:CARG1, LO(BASE) - | bltz AT, ->fff_fallback - | lw CARG2, 8+HI(BASE) - | ldc1 f2, 8(BASE) - | beqz AT, >1 - |. li CARG4, -1 - | cvt.w.d f0, f0 - | sltiu AT, CARG3, LJ_TISNUM - | beqz AT, ->fff_fallback - |. mfc1 CARG4, f0 - |1: - | sltiu AT, CARG2, LJ_TISNUM - | beqz AT, ->fff_fallback - |. li AT, LJ_TSTR - | cvt.w.d f2, f2 - | bne TMP0, AT, ->fff_fallback - |. lw CARG2, STR:CARG1->len - | mfc1 CARG3, f2 - | // STR:CARG1 = str, CARG2 = str->len, CARG3 = start, CARG4 = end - | slt AT, CARG4, r0 - | addiu TMP0, CARG2, 1 - | addu TMP1, CARG4, TMP0 - | slt TMP3, CARG3, r0 - | movn CARG4, TMP1, AT // if (end < 0) end += len+1 - | addu TMP1, CARG3, TMP0 - | movn CARG3, TMP1, TMP3 // if (start < 0) start += len+1 - | li TMP2, 1 - | slt AT, CARG4, r0 - | slt TMP3, r0, CARG3 - | movn CARG4, r0, AT // if (end < 0) end = 0 - | movz CARG3, TMP2, TMP3 // if (start < 1) start = 1 - | slt AT, CARG2, CARG4 - | movn CARG4, CARG2, AT // if (end > len) end = len - | addu CARG2, STR:CARG1, CARG3 - | subu CARG3, CARG4, CARG3 // len = end - start - | addiu CARG2, CARG2, sizeof(GCstr)-1 - | bgez CARG3, ->fff_newstr - |. addiu CARG3, CARG3, 1 // len++ - |->fff_emptystr: // Return empty string. - | addiu STR:CARG1, DISPATCH, DISPATCH_GL(strempty) - | b ->fff_restv - |. li CARG3, LJ_TSTR - | - |.ffunc string_rep // Only handle the 1-char case inline. - | ffgccheck - |. nop - | lw TMP0, HI(BASE) - | addiu AT, NARGS8:RC, -16 // Exactly 2 arguments. - | lw CARG4, 8+HI(BASE) - | lw STR:CARG1, LO(BASE) - | addiu TMP0, TMP0, -LJ_TSTR - | ldc1 f0, 8(BASE) - | or AT, AT, TMP0 - | bnez AT, ->fff_fallback - |. sltiu AT, CARG4, LJ_TISNUM - | cvt.w.d f0, f0 - | beqz AT, ->fff_fallback - |. lw TMP0, STR:CARG1->len - | mfc1 CARG3, f0 - | lw TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH) - | li AT, 1 - | blez CARG3, ->fff_emptystr // Count <= 0? - |. sltu AT, AT, TMP0 - | beqz TMP0, ->fff_emptystr // Zero length string? - |. sltu TMP0, TMP1, CARG3 - | or AT, AT, TMP0 - | lw CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH) - | bnez AT, ->fff_fallback // Fallback for > 1-char strings. - |. lbu TMP0, STR:CARG1[1] - | addu TMP2, CARG2, CARG3 - |1: // Fill buffer with char. Yes, this is suboptimal code (do you care?). - | addiu TMP2, TMP2, -1 - | sltu AT, CARG2, TMP2 - | bnez AT, <1 - |. sb TMP0, 0(TMP2) - | b ->fff_newstr - |. nop - | - |.ffunc string_reverse - | ffgccheck - |. nop - | lw CARG3, HI(BASE) - | lw STR:CARG1, LO(BASE) - | beqz NARGS8:RC, ->fff_fallback - |. li AT, LJ_TSTR - | bne CARG3, AT, ->fff_fallback - |. lw TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH) - | lw CARG3, STR:CARG1->len - | addiu CARG1, STR:CARG1, #STR - | lw CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH) - | sltu AT, TMP1, CARG3 - | bnez AT, ->fff_fallback - |. addu TMP3, CARG1, CARG3 - | addu CARG4, CARG2, CARG3 - |1: // Reverse string copy. - | lbu TMP1, 0(CARG1) - | sltu AT, CARG1, TMP3 - | beqz AT, ->fff_newstr - |. addiu CARG1, CARG1, 1 - | addiu CARG4, CARG4, -1 - | b <1 - | sb TMP1, 0(CARG4) - | - |.macro ffstring_case, name, lo - | .ffunc name - | ffgccheck - |. nop - | lw CARG3, HI(BASE) - | lw STR:CARG1, LO(BASE) - | beqz NARGS8:RC, ->fff_fallback - |. li AT, LJ_TSTR - | bne CARG3, AT, ->fff_fallback - |. lw TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH) - | lw CARG3, STR:CARG1->len - | addiu CARG1, STR:CARG1, #STR - | lw CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH) - | sltu AT, TMP1, CARG3 - | bnez AT, ->fff_fallback - |. addu TMP3, CARG1, CARG3 - | move CARG4, CARG2 - |1: // ASCII case conversion. - | lbu TMP1, 0(CARG1) - | sltu AT, CARG1, TMP3 - | beqz AT, ->fff_newstr - |. addiu TMP0, TMP1, -lo - | xori TMP2, TMP1, 0x20 - | sltiu AT, TMP0, 26 - | movn TMP1, TMP2, AT - | addiu CARG1, CARG1, 1 - | sb TMP1, 0(CARG4) - | b <1 - |. addiu CARG4, CARG4, 1 - |.endmacro - | - |ffstring_case string_lower, 65 - |ffstring_case string_upper, 97 - | - |//-- Table library ------------------------------------------------------ - | - |.ffunc_1 table_getn - | li AT, LJ_TTAB - | bne CARG3, AT, ->fff_fallback - |. load_got lj_tab_len - | call_intern lj_tab_len // (GCtab *t) - |. nop - | // Returns uint32_t (but less than 2^31). - | b ->fff_resi - |. nop - | - |//-- Bit library -------------------------------------------------------- - | - |.macro .ffunc_bit, name - | .ffunc_n bit_..name - |. add.d FARG1, FARG1, TOBIT - | mfc1 CRET1, FARG1 - |.endmacro - | - |.macro .ffunc_bit_op, name, ins - | .ffunc_bit name - | addiu TMP1, BASE, 8 - | addu TMP2, BASE, NARGS8:RC - |1: - | lw CARG4, HI(TMP1) - | beq TMP1, TMP2, ->fff_resi - |. ldc1 FARG1, 0(TMP1) - | sltiu AT, CARG4, LJ_TISNUM - | beqz AT, ->fff_fallback - | add.d FARG1, FARG1, TOBIT - | mfc1 CARG2, FARG1 - | ins CRET1, CRET1, CARG2 - | b <1 - |. addiu TMP1, TMP1, 8 - |.endmacro - | - |.ffunc_bit_op band, and - |.ffunc_bit_op bor, or - |.ffunc_bit_op bxor, xor - | - |.ffunc_bit bswap - | srl TMP0, CRET1, 24 - | srl TMP2, CRET1, 8 - | sll TMP1, CRET1, 24 - | andi TMP2, TMP2, 0xff00 - | or TMP0, TMP0, TMP1 - | andi CRET1, CRET1, 0xff00 - | or TMP0, TMP0, TMP2 - | sll CRET1, CRET1, 8 - | b ->fff_resi - |. or CRET1, TMP0, CRET1 - | - |.ffunc_bit bnot - | b ->fff_resi - |. not CRET1, CRET1 - | - |.macro .ffunc_bit_sh, name, ins, shmod - | .ffunc_nn bit_..name - |. add.d FARG1, FARG1, TOBIT - | add.d FARG2, FARG2, TOBIT - | mfc1 CARG1, FARG1 - | mfc1 CARG2, FARG2 - |.if shmod == 1 - | li AT, 32 - | subu TMP0, AT, CARG2 - | sllv CARG2, CARG1, CARG2 - | srlv CARG1, CARG1, TMP0 - |.elif shmod == 2 - | li AT, 32 - | subu TMP0, AT, CARG2 - | srlv CARG2, CARG1, CARG2 - | sllv CARG1, CARG1, TMP0 - |.endif - | b ->fff_resi - |. ins CRET1, CARG1, CARG2 - |.endmacro - | - |.ffunc_bit_sh lshift, sllv, 0 - |.ffunc_bit_sh rshift, srlv, 0 - |.ffunc_bit_sh arshift, srav, 0 - |// Can't use rotrv, since it's only in MIPS32R2. - |.ffunc_bit_sh rol, or, 1 - |.ffunc_bit_sh ror, or, 2 - | - |.ffunc_bit tobit - |->fff_resi: - | mtc1 CRET1, FRET1 - | b ->fff_resn - |. cvt.d.w FRET1, FRET1 - | - |//----------------------------------------------------------------------- - | - |->fff_fallback: // Call fast function fallback handler. - | // BASE = new base, RB = CFUNC, RC = nargs*8 - | lw TMP3, CFUNC:RB->f - | addu TMP1, BASE, NARGS8:RC - | lw PC, FRAME_PC(BASE) // Fallback may overwrite PC. - | addiu TMP0, TMP1, 8*LUA_MINSTACK - | lw TMP2, L->maxstack - | sw PC, SAVE_PC // Redundant (but a defined value). - | sltu AT, TMP2, TMP0 - | sw BASE, L->base - | sw TMP1, L->top - | bnez AT, >5 // Need to grow stack. - |. move CFUNCADDR, TMP3 - | jalr TMP3 // (lua_State *L) - |. move CARG1, L - | // Either throws an error, or recovers and returns -1, 0 or nresults+1. - | lw BASE, L->base - | sll RD, CRET1, 3 - | bgtz CRET1, ->fff_res // Returned nresults+1? - |. addiu RA, BASE, -8 - |1: // Returned 0 or -1: retry fast path. - | lw TMP0, L->top - | lw LFUNC:RB, FRAME_FUNC(BASE) - | bnez CRET1, ->vm_call_tail // Returned -1? - |. subu NARGS8:RC, TMP0, BASE - | ins_callt // Returned 0: retry fast path. - | - |// Reconstruct previous base for vmeta_call during tailcall. - |->vm_call_tail: - | andi TMP0, PC, FRAME_TYPE - | li AT, -4 - | bnez TMP0, >3 - |. and TMP1, PC, AT - | lbu TMP1, OFS_RA(PC) - | sll TMP1, TMP1, 3 - | addiu TMP1, TMP1, 8 - |3: - | b ->vm_call_dispatch // Resolve again for tailcall. - |. subu TMP2, BASE, TMP1 - | - |5: // Grow stack for fallback handler. - | load_got lj_state_growstack - | li CARG2, LUA_MINSTACK - | call_intern lj_state_growstack // (lua_State *L, int n) - |. move CARG1, L - | lw BASE, L->base - | b <1 - |. li CRET1, 0 // Force retry. - | - |->fff_gcstep: // Call GC step function. - | // BASE = new base, RC = nargs*8 - | move MULTRES, ra - | load_got lj_gc_step - | sw BASE, L->base - | addu TMP0, BASE, NARGS8:RC - | sw PC, SAVE_PC // Redundant (but a defined value). - | sw TMP0, L->top - | call_intern lj_gc_step // (lua_State *L) - |. move CARG1, L - | lw BASE, L->base - | move ra, MULTRES - | lw TMP0, L->top - | lw CFUNC:RB, FRAME_FUNC(BASE) - | jr ra - |. subu NARGS8:RC, TMP0, BASE - | - |//----------------------------------------------------------------------- - |//-- Special dispatch targets ------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_record: // Dispatch target for recording phase. - |.if JIT - | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH) - | andi AT, TMP3, HOOK_VMEVENT // No recording while in vmevent. - | bnez AT, >5 - | // Decrement the hookcount for consistency, but always do the call. - |. lw TMP2, DISPATCH_GL(hookcount)(DISPATCH) - | andi AT, TMP3, HOOK_ACTIVE - | bnez AT, >1 - |. addiu TMP2, TMP2, -1 - | andi AT, TMP3, LUA_MASKLINE|LUA_MASKCOUNT - | beqz AT, >1 - |. nop - | b >1 - |. sw TMP2, DISPATCH_GL(hookcount)(DISPATCH) - |.endif - | - |->vm_rethook: // Dispatch target for return hooks. - | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH) - | andi AT, TMP3, HOOK_ACTIVE // Hook already active? - | beqz AT, >1 - |5: // Re-dispatch to static ins. - |. lw AT, GG_DISP2STATIC(TMP0) // Assumes TMP0 holds DISPATCH+OP*4. - | jr AT - |. nop - | - |->vm_inshook: // Dispatch target for instr/line hooks. - | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH) - | lw TMP2, DISPATCH_GL(hookcount)(DISPATCH) - | andi AT, TMP3, HOOK_ACTIVE // Hook already active? - | bnez AT, <5 - |. andi AT, TMP3, LUA_MASKLINE|LUA_MASKCOUNT - | beqz AT, <5 - |. addiu TMP2, TMP2, -1 - | beqz TMP2, >1 - |. sw TMP2, DISPATCH_GL(hookcount)(DISPATCH) - | andi AT, TMP3, LUA_MASKLINE - | beqz AT, <5 - |1: - |. load_got lj_dispatch_ins - | sw MULTRES, SAVE_MULTRES - | move CARG2, PC - | sw BASE, L->base - | // SAVE_PC must hold the _previous_ PC. The callee updates it with PC. - | call_intern lj_dispatch_ins // (lua_State *L, const BCIns *pc) - |. move CARG1, L - |3: - | lw BASE, L->base - |4: // Re-dispatch to static ins. - | lw INS, -4(PC) - | decode_OP4a TMP1, INS - | decode_OP4b TMP1 - | addu TMP0, DISPATCH, TMP1 - | decode_RD8a RD, INS - | lw AT, GG_DISP2STATIC(TMP0) - | decode_RA8a RA, INS - | decode_RD8b RD - | jr AT - | decode_RA8b RA - | - |->cont_hook: // Continue from hook yield. - | addiu PC, PC, 4 - | b <4 - |. lw MULTRES, -24+LO(RB) // Restore MULTRES for *M ins. - | - |->vm_hotloop: // Hot loop counter underflow. - |.if JIT - | lw LFUNC:TMP1, FRAME_FUNC(BASE) - | addiu CARG1, DISPATCH, GG_DISP2J - | sw PC, SAVE_PC - | lw TMP1, LFUNC:TMP1->pc - | move CARG2, PC - | sw L, DISPATCH_J(L)(DISPATCH) - | lbu TMP1, PC2PROTO(framesize)(TMP1) - | load_got lj_trace_hot - | sw BASE, L->base - | sll TMP1, TMP1, 3 - | addu TMP1, BASE, TMP1 - | call_intern lj_trace_hot // (jit_State *J, const BCIns *pc) - |. sw TMP1, L->top - | b <3 - |. nop - |.endif - | - |->vm_callhook: // Dispatch target for call hooks. - |.if JIT - | b >1 - |.endif - |. move CARG2, PC - | - |->vm_hotcall: // Hot call counter underflow. - |.if JIT - | ori CARG2, PC, 1 - |1: - |.endif - | load_got lj_dispatch_call - | addu TMP0, BASE, RC - | sw PC, SAVE_PC - | sw BASE, L->base - | subu RA, RA, BASE - | sw TMP0, L->top - | call_intern lj_dispatch_call // (lua_State *L, const BCIns *pc) - |. move CARG1, L - | // Returns ASMFunction. - | lw BASE, L->base - | lw TMP0, L->top - | sw r0, SAVE_PC // Invalidate for subsequent line hook. - | subu NARGS8:RC, TMP0, BASE - | addu RA, BASE, RA - | lw LFUNC:RB, FRAME_FUNC(BASE) - | jr CRET1 - |. lw INS, -4(PC) - | - |//----------------------------------------------------------------------- - |//-- Trace exit handler ------------------------------------------------- - |//----------------------------------------------------------------------- - | - |.macro savex_, a, b - | sdc1 f..a, 16+a*8(sp) - | sw r..a, 16+32*8+a*4(sp) - | sw r..b, 16+32*8+b*4(sp) - |.endmacro - | - |->vm_exit_handler: - |.if JIT - | addiu sp, sp, -(16+32*8+32*4) - | savex_ 0, 1 - | savex_ 2, 3 - | savex_ 4, 5 - | savex_ 6, 7 - | savex_ 8, 9 - | savex_ 10, 11 - | savex_ 12, 13 - | savex_ 14, 15 - | savex_ 16, 17 - | savex_ 18, 19 - | savex_ 20, 21 - | savex_ 22, 23 - | savex_ 24, 25 - | savex_ 26, 27 - | sdc1 f28, 16+28*8(sp) - | sw r28, 16+32*8+28*4(sp) - | sdc1 f30, 16+30*8(sp) - | sw r30, 16+32*8+30*4(sp) - | sw r0, 16+32*8+31*4(sp) // Clear RID_TMP. - | li_vmstate EXIT - | addiu TMP2, sp, 16+32*8+32*4 // Recompute original value of sp. - | addiu DISPATCH, JGL, -GG_DISP2G-32768 - | lw TMP1, 0(TMP2) // Load exit number. - | st_vmstate - | sw TMP2, 16+32*8+29*4(sp) // Store sp in RID_SP. - | lw L, DISPATCH_GL(jit_L)(DISPATCH) - | lw BASE, DISPATCH_GL(jit_base)(DISPATCH) - | load_got lj_trace_exit - | sw L, DISPATCH_J(L)(DISPATCH) - | sw ra, DISPATCH_J(parent)(DISPATCH) // Store trace number. - | sw TMP1, DISPATCH_J(exitno)(DISPATCH) // Store exit number. - | addiu CARG1, DISPATCH, GG_DISP2J - | sw BASE, L->base - | call_intern lj_trace_exit // (jit_State *J, ExitState *ex) - |. addiu CARG2, sp, 16 - | // Returns MULTRES (unscaled) or negated error code. - | lw TMP1, L->cframe - | li AT, -4 - | lw BASE, L->base - | and sp, TMP1, AT - | lw PC, SAVE_PC // Get SAVE_PC. - | b >1 - |. sw L, SAVE_L // Set SAVE_L (on-trace resume/yield). - |.endif - |->vm_exit_interp: - |.if JIT - | // CRET1 = MULTRES or negated error code, BASE, PC and JGL set. - | lw L, SAVE_L - | addiu DISPATCH, JGL, -GG_DISP2G-32768 - |1: - | bltz CRET1, >3 // Check for error from exit. - |. lw LFUNC:TMP1, FRAME_FUNC(BASE) - | lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). - | sll MULTRES, CRET1, 3 - | li TISNIL, LJ_TNIL - | sw MULTRES, SAVE_MULTRES - | mtc1 TMP3, TOBIT - | lw TMP1, LFUNC:TMP1->pc - | sw r0, DISPATCH_GL(jit_L)(DISPATCH) - | lw KBASE, PC2PROTO(k)(TMP1) - | cvt.d.s TOBIT, TOBIT - | // Modified copy of ins_next which handles function header dispatch, too. - | lw INS, 0(PC) - | addiu PC, PC, 4 - | // Assumes TISNIL == ~LJ_VMST_INTERP == -1 - | sw TISNIL, DISPATCH_GL(vmstate)(DISPATCH) - | decode_OP4a TMP1, INS - | decode_OP4b TMP1 - | sltiu TMP2, TMP1, BC_FUNCF*4 // Function header? - | addu TMP0, DISPATCH, TMP1 - | decode_RD8a RD, INS - | lw AT, 0(TMP0) - | decode_RA8a RA, INS - | beqz TMP2, >2 - |. decode_RA8b RA - | jr AT - |. decode_RD8b RD - |2: - | addiu RC, MULTRES, -8 - | jr AT - |. addu RA, RA, BASE - | - |3: // Rethrow error from the right C frame. - | load_got lj_err_throw - | negu CARG2, CRET1 - | call_intern lj_err_throw // (lua_State *L, int errcode) - |. move CARG1, L - |.endif - | - |//----------------------------------------------------------------------- - |//-- Math helper functions ---------------------------------------------- - |//----------------------------------------------------------------------- - | - |// Modifies AT, TMP0, FRET1, FRET2, f4. Keeps all others incl. FARG1. - |.macro vm_round, func - | lui TMP0, 0x4330 // Hiword of 2^52 (double). - | mtc1 r0, f4 - | mtc1 TMP0, f5 - | abs.d FRET2, FARG1 // |x| - | mfc1 AT, f13 - | c.olt.d 0, FRET2, f4 - | add.d FRET1, FRET2, f4 // (|x| + 2^52) - 2^52 - | bc1f 0, >1 // Truncate only if |x| < 2^52. - |. sub.d FRET1, FRET1, f4 - | slt AT, AT, r0 - |.if "func" == "ceil" - | lui TMP0, 0xbff0 // Hiword of -1 (double). Preserves -0. - |.else - | lui TMP0, 0x3ff0 // Hiword of +1 (double). - |.endif - |.if "func" == "trunc" - | mtc1 TMP0, f5 - | c.olt.d 0, FRET2, FRET1 // |x| < result? - | sub.d FRET2, FRET1, f4 - | movt.d FRET1, FRET2, 0 // If yes, subtract +1. - | neg.d FRET2, FRET1 - | jr ra - |. movn.d FRET1, FRET2, AT // Merge sign bit back in. - |.else - | neg.d FRET2, FRET1 - | mtc1 TMP0, f5 - | movn.d FRET1, FRET2, AT // Merge sign bit back in. - |.if "func" == "ceil" - | c.olt.d 0, FRET1, FARG1 // x > result? - |.else - | c.olt.d 0, FARG1, FRET1 // x < result? - |.endif - | sub.d FRET2, FRET1, f4 // If yes, subtract +-1. - | jr ra - |. movt.d FRET1, FRET2, 0 - |.endif - |1: - | jr ra - |. mov.d FRET1, FARG1 - |.endmacro - | - |->vm_floor: - | vm_round floor - |->vm_ceil: - | vm_round ceil - |->vm_trunc: - |.if JIT - | vm_round trunc - |.endif - | - |//----------------------------------------------------------------------- - |//-- Miscellaneous functions -------------------------------------------- - |//----------------------------------------------------------------------- - | - |//----------------------------------------------------------------------- - |//-- FFI helper functions ----------------------------------------------- - |//----------------------------------------------------------------------- - | - |// Handler for callback functions. Callback slot number in r1, g in r2. - |->vm_ffi_callback: - |.if FFI - |.type CTSTATE, CTState, PC - | saveregs - | lw CTSTATE, GL:r2->ctype_state - | addiu DISPATCH, r2, GG_G2DISP - | load_got lj_ccallback_enter - | sw r1, CTSTATE->cb.slot - | sw CARG1, CTSTATE->cb.gpr[0] - | sw CARG2, CTSTATE->cb.gpr[1] - | sdc1 FARG1, CTSTATE->cb.fpr[0] - | sw CARG3, CTSTATE->cb.gpr[2] - | sw CARG4, CTSTATE->cb.gpr[3] - | sdc1 FARG2, CTSTATE->cb.fpr[1] - | addiu TMP0, sp, CFRAME_SPACE+16 - | sw TMP0, CTSTATE->cb.stack - | sw r0, SAVE_PC // Any value outside of bytecode is ok. - | move CARG2, sp - | call_intern lj_ccallback_enter // (CTState *cts, void *cf) - |. move CARG1, CTSTATE - | // Returns lua_State *. - | lw BASE, L:CRET1->base - | lw RC, L:CRET1->top - | move L, CRET1 - | lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). - | lw LFUNC:RB, FRAME_FUNC(BASE) - | mtc1 TMP3, TOBIT - | li_vmstate INTERP - | li TISNIL, LJ_TNIL - | subu RC, RC, BASE - | st_vmstate - | cvt.d.s TOBIT, TOBIT - | ins_callt - |.endif - | - |->cont_ffi_callback: // Return from FFI callback. - |.if FFI - | load_got lj_ccallback_leave - | lw CTSTATE, DISPATCH_GL(ctype_state)(DISPATCH) - | sw BASE, L->base - | sw RB, L->top - | sw L, CTSTATE->L - | move CARG2, RA - | call_intern lj_ccallback_leave // (CTState *cts, TValue *o) - |. move CARG1, CTSTATE - | lw CRET1, CTSTATE->cb.gpr[0] - | ldc1 FRET1, CTSTATE->cb.fpr[0] - | lw CRET2, CTSTATE->cb.gpr[1] - | b ->vm_leave_unw - |. ldc1 FRET2, CTSTATE->cb.fpr[1] - |.endif - | - |->vm_ffi_call: // Call C function via FFI. - | // Caveat: needs special frame unwinding, see below. - |.if FFI - | .type CCSTATE, CCallState, CARG1 - | lw TMP1, CCSTATE->spadj - | lbu CARG2, CCSTATE->nsp - | move TMP2, sp - | subu sp, sp, TMP1 - | sw ra, -4(TMP2) - | sll CARG2, CARG2, 2 - | sw r16, -8(TMP2) - | sw CCSTATE, -12(TMP2) - | move r16, TMP2 - | addiu TMP1, CCSTATE, offsetof(CCallState, stack) - | addiu TMP2, sp, 16 - | beqz CARG2, >2 - |. addu TMP3, TMP1, CARG2 - |1: - | lw TMP0, 0(TMP1) - | addiu TMP1, TMP1, 4 - | sltu AT, TMP1, TMP3 - | sw TMP0, 0(TMP2) - | bnez AT, <1 - |. addiu TMP2, TMP2, 4 - |2: - | lw CFUNCADDR, CCSTATE->func - | lw CARG2, CCSTATE->gpr[1] - | lw CARG3, CCSTATE->gpr[2] - | lw CARG4, CCSTATE->gpr[3] - | ldc1 FARG1, CCSTATE->fpr[0] - | ldc1 FARG2, CCSTATE->fpr[1] - | jalr CFUNCADDR - |. lw CARG1, CCSTATE->gpr[0] // Do this last, since CCSTATE is CARG1. - | lw CCSTATE:TMP1, -12(r16) - | lw TMP2, -8(r16) - | lw ra, -4(r16) - | sw CRET1, CCSTATE:TMP1->gpr[0] - | sw CRET2, CCSTATE:TMP1->gpr[1] - | sdc1 FRET1, CCSTATE:TMP1->fpr[0] - | sdc1 FRET2, CCSTATE:TMP1->fpr[1] - | move sp, r16 - | jr ra - |. move r16, TMP2 - |.endif - |// Note: vm_ffi_call must be the last function in this object file! - | - |//----------------------------------------------------------------------- -} - -/* Generate the code for a single instruction. */ -static void build_ins(BuildCtx *ctx, BCOp op, int defop) -{ - int vk = 0; - |=>defop: - - switch (op) { - - /* -- Comparison ops ---------------------------------------------------- */ - - /* Remember: all ops branch for a true comparison, fall through otherwise. */ - - case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: - | // RA = src1*8, RD = src2*8, JMP with RD = target - | addu CARG2, BASE, RA - | addu CARG3, BASE, RD - | lw TMP0, HI(CARG2) - | lw TMP1, HI(CARG3) - | ldc1 f0, 0(CARG2) - | ldc1 f2, 0(CARG3) - | sltiu TMP0, TMP0, LJ_TISNUM - | sltiu TMP1, TMP1, LJ_TISNUM - | lhu TMP2, OFS_RD(PC) - | and TMP0, TMP0, TMP1 - | addiu PC, PC, 4 - | beqz TMP0, ->vmeta_comp - |. lui TMP1, (-(BCBIAS_J*4 >> 16) & 65535) - | decode_RD4b TMP2 - | addu TMP2, TMP2, TMP1 - if (op == BC_ISLT || op == BC_ISGE) { - | c.olt.d f0, f2 - } else { - | c.ole.d f0, f2 - } - if (op == BC_ISLT || op == BC_ISLE) { - | movf TMP2, r0 - } else { - | movt TMP2, r0 - } - | addu PC, PC, TMP2 - |1: - | ins_next - break; - - case BC_ISEQV: case BC_ISNEV: - vk = op == BC_ISEQV; - | // RA = src1*8, RD = src2*8, JMP with RD = target - | addu RA, BASE, RA - | addiu PC, PC, 4 - | lw TMP0, HI(RA) - | ldc1 f0, 0(RA) - | addu RD, BASE, RD - | lhu TMP2, -4+OFS_RD(PC) - | lw TMP1, HI(RD) - | ldc1 f2, 0(RD) - | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) - | sltiu AT, TMP0, LJ_TISNUM - | sltiu CARG1, TMP1, LJ_TISNUM - | decode_RD4b TMP2 - | and AT, AT, CARG1 - | beqz AT, >5 - |. addu TMP2, TMP2, TMP3 - | c.eq.d f0, f2 - if (vk) { - | movf TMP2, r0 - } else { - | movt TMP2, r0 - } - |1: - | addu PC, PC, TMP2 - | ins_next - |5: // Either or both types are not numbers. - | lw CARG2, LO(RA) - | lw CARG3, LO(RD) - |.if FFI - | li TMP3, LJ_TCDATA - | beq TMP0, TMP3, ->vmeta_equal_cd - |.endif - |. sltiu AT, TMP0, LJ_TISPRI // Not a primitive? - |.if FFI - | beq TMP1, TMP3, ->vmeta_equal_cd - |.endif - |. xor TMP3, CARG2, CARG3 // Same tv? - | xor TMP1, TMP1, TMP0 // Same type? - | sltiu CARG1, TMP0, LJ_TISTABUD+1 // Table or userdata? - | movz TMP3, r0, AT // Ignore tv if primitive. - | movn CARG1, r0, TMP1 // Tab/ud and same type? - | or AT, TMP1, TMP3 // Same type && (pri||same tv). - | movz CARG1, r0, AT - | beqz CARG1, <1 // Done if not tab/ud or not same type or same tv. - if (vk) { - |. movn TMP2, r0, AT - } else { - |. movz TMP2, r0, AT - } - | // Different tables or userdatas. Need to check __eq metamethod. - | // Field metatable must be at same offset for GCtab and GCudata! - | lw TAB:TMP1, TAB:CARG2->metatable - | beqz TAB:TMP1, <1 // No metatable? - |. nop - | lbu TMP1, TAB:TMP1->nomm - | andi TMP1, TMP1, 1<vmeta_equal // Handle __eq metamethod. - |. li CARG4, 1-vk // ne = 0 or 1. - break; - - case BC_ISEQS: case BC_ISNES: - vk = op == BC_ISEQS; - | // RA = src*8, RD = str_const*8 (~), JMP with RD = target - | addu RA, BASE, RA - | addiu PC, PC, 4 - | lw TMP0, HI(RA) - | srl RD, RD, 1 - | lw STR:TMP3, LO(RA) - | subu RD, KBASE, RD - | lhu TMP2, -4+OFS_RD(PC) - |.if FFI - | li AT, LJ_TCDATA - | beq TMP0, AT, ->vmeta_equal_cd - |.endif - |. lw STR:TMP1, -4(RD) // KBASE-4-str_const*4 - | addiu TMP0, TMP0, -LJ_TSTR - | decode_RD4b TMP2 - | xor TMP1, STR:TMP1, STR:TMP3 - | or TMP0, TMP0, TMP1 - | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) - | addu TMP2, TMP2, TMP3 - if (vk) { - | movn TMP2, r0, TMP0 - } else { - | movz TMP2, r0, TMP0 - } - | addu PC, PC, TMP2 - | ins_next - break; - - case BC_ISEQN: case BC_ISNEN: - vk = op == BC_ISEQN; - | // RA = src*8, RD = num_const*8, JMP with RD = target - | addu RA, BASE, RA - | addiu PC, PC, 4 - | lw TMP0, HI(RA) - | ldc1 f0, 0(RA) - | addu RD, KBASE, RD - | lhu TMP2, -4+OFS_RD(PC) - | ldc1 f2, 0(RD) - | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) - | sltiu AT, TMP0, LJ_TISNUM - | decode_RD4b TMP2 - |.if FFI - | beqz AT, >5 - |.else - | beqz AT, >1 - |.endif - |. addu TMP2, TMP2, TMP3 - | c.eq.d f0, f2 - if (vk) { - | movf TMP2, r0 - | addu PC, PC, TMP2 - |1: - } else { - | movt TMP2, r0 - |1: - | addu PC, PC, TMP2 - } - | ins_next - |.if FFI - |5: - | li AT, LJ_TCDATA - | beq TMP0, AT, ->vmeta_equal_cd - |. nop - | b <1 - |. nop - |.endif - break; - - case BC_ISEQP: case BC_ISNEP: - vk = op == BC_ISEQP; - | // RA = src*8, RD = primitive_type*8 (~), JMP with RD = target - | addu RA, BASE, RA - | srl TMP1, RD, 3 - | lw TMP0, HI(RA) - | lhu TMP2, OFS_RD(PC) - | not TMP1, TMP1 - | addiu PC, PC, 4 - |.if FFI - | li AT, LJ_TCDATA - | beq TMP0, AT, ->vmeta_equal_cd - |.endif - |. xor TMP0, TMP0, TMP1 - | decode_RD4b TMP2 - | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) - | addu TMP2, TMP2, TMP3 - if (vk) { - | movn TMP2, r0, TMP0 - } else { - | movz TMP2, r0, TMP0 - } - | addu PC, PC, TMP2 - | ins_next - break; - - /* -- Unary test and copy ops ------------------------------------------- */ - - case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: - | // RA = dst*8 or unused, RD = src*8, JMP with RD = target - | addu RD, BASE, RD - | lhu TMP2, OFS_RD(PC) - | lw TMP0, HI(RD) - | addiu PC, PC, 4 - if (op == BC_IST || op == BC_ISF) { - | sltiu TMP0, TMP0, LJ_TISTRUECOND - | decode_RD4b TMP2 - | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) - | addu TMP2, TMP2, TMP3 - if (op == BC_IST) { - | movz TMP2, r0, TMP0 - } else { - | movn TMP2, r0, TMP0 - } - | addu PC, PC, TMP2 - } else { - | sltiu TMP0, TMP0, LJ_TISTRUECOND - | ldc1 f0, 0(RD) - if (op == BC_ISTC) { - | beqz TMP0, >1 - } else { - | bnez TMP0, >1 - } - |. addu RA, BASE, RA - | decode_RD4b TMP2 - | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) - | addu TMP2, TMP2, TMP3 - | sdc1 f0, 0(RA) - | addu PC, PC, TMP2 - |1: - } - | ins_next - break; - - /* -- Unary ops --------------------------------------------------------- */ - - case BC_MOV: - | // RA = dst*8, RD = src*8 - | addu RD, BASE, RD - | addu RA, BASE, RA - | ldc1 f0, 0(RD) - | ins_next1 - | sdc1 f0, 0(RA) - | ins_next2 - break; - case BC_NOT: - | // RA = dst*8, RD = src*8 - | addu RD, BASE, RD - | addu RA, BASE, RA - | lw TMP0, HI(RD) - | li TMP1, LJ_TFALSE - | sltiu TMP0, TMP0, LJ_TISTRUECOND - | addiu TMP1, TMP0, LJ_TTRUE - | ins_next1 - | sw TMP1, HI(RA) - | ins_next2 - break; - case BC_UNM: - | // RA = dst*8, RD = src*8 - | addu CARG3, BASE, RD - | addu RA, BASE, RA - | lw TMP0, HI(CARG3) - | ldc1 f0, 0(CARG3) - | sltiu AT, TMP0, LJ_TISNUM - | beqz AT, ->vmeta_unm - |. neg.d f0, f0 - | ins_next1 - | sdc1 f0, 0(RA) - | ins_next2 - break; - case BC_LEN: - | // RA = dst*8, RD = src*8 - | addu CARG2, BASE, RD - | addu RA, BASE, RA - | lw TMP0, HI(CARG2) - | lw CARG1, LO(CARG2) - | li AT, LJ_TSTR - | bne TMP0, AT, >2 - |. li AT, LJ_TTAB - | lw CRET1, STR:CARG1->len - |1: - | mtc1 CRET1, f0 - | cvt.d.w f0, f0 - | ins_next1 - | sdc1 f0, 0(RA) - | ins_next2 - |2: - | bne TMP0, AT, ->vmeta_len - |. nop -#if LJ_52 - | lw TAB:TMP2, TAB:CARG1->metatable - | bnez TAB:TMP2, >9 - |. nop - |3: -#endif - |->BC_LEN_Z: - | load_got lj_tab_len - | call_intern lj_tab_len // (GCtab *t) - |. nop - | // Returns uint32_t (but less than 2^31). - | b <1 - |. nop -#if LJ_52 - |9: - | lbu TMP0, TAB:TMP2->nomm - | andi TMP0, TMP0, 1<vmeta_len - |. nop -#endif - break; - - /* -- Binary ops -------------------------------------------------------- */ - - |.macro ins_arithpre - ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); - | decode_RB8a RB, INS - | decode_RB8b RB - | decode_RDtoRC8 RC, RD - | // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8 - ||switch (vk) { - ||case 0: - | addu CARG3, BASE, RB - | addu CARG4, KBASE, RC - | lw TMP1, HI(CARG3) - | ldc1 f20, 0(CARG3) - | ldc1 f22, 0(CARG4) - | sltiu AT, TMP1, LJ_TISNUM - || break; - ||case 1: - | addu CARG4, BASE, RB - | addu CARG3, KBASE, RC - | lw TMP1, HI(CARG4) - | ldc1 f22, 0(CARG4) - | ldc1 f20, 0(CARG3) - | sltiu AT, TMP1, LJ_TISNUM - || break; - ||default: - | addu CARG3, BASE, RB - | addu CARG4, BASE, RC - | lw TMP1, HI(CARG3) - | lw TMP2, HI(CARG4) - | ldc1 f20, 0(CARG3) - | ldc1 f22, 0(CARG4) - | sltiu AT, TMP1, LJ_TISNUM - | sltiu TMP0, TMP2, LJ_TISNUM - | and AT, AT, TMP0 - || break; - ||} - | beqz AT, ->vmeta_arith - |. addu RA, BASE, RA - |.endmacro - | - |.macro fpmod, a, b, c - |->BC_MODVN_Z: - | bal ->vm_floor // floor(b/c) - |. div.d FARG1, b, c - | mul.d a, FRET1, c - | sub.d a, b, a // b - floor(b/c)*c - |.endmacro - | - |.macro ins_arith, ins - | ins_arithpre - |.if "ins" == "fpmod_" - | b ->BC_MODVN_Z // Avoid 3 copies. It's slow anyway. - |. nop - |.else - | ins f0, f20, f22 - | ins_next1 - | sdc1 f0, 0(RA) - | ins_next2 - |.endif - |.endmacro - - case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: - | ins_arith add.d - break; - case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: - | ins_arith sub.d - break; - case BC_MULVN: case BC_MULNV: case BC_MULVV: - | ins_arith mul.d - break; - case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: - | ins_arith div.d - break; - case BC_MODVN: - | ins_arith fpmod - break; - case BC_MODNV: case BC_MODVV: - | ins_arith fpmod_ - break; - case BC_POW: - | decode_RB8a RB, INS - | decode_RB8b RB - | decode_RDtoRC8 RC, RD - | addu CARG3, BASE, RB - | addu CARG4, BASE, RC - | lw TMP1, HI(CARG3) - | lw TMP2, HI(CARG4) - | ldc1 FARG1, 0(CARG3) - | ldc1 FARG2, 0(CARG4) - | sltiu AT, TMP1, LJ_TISNUM - | sltiu TMP0, TMP2, LJ_TISNUM - | and AT, AT, TMP0 - | load_got pow - | beqz AT, ->vmeta_arith - |. addu RA, BASE, RA - | call_extern - |. nop - | ins_next1 - | sdc1 FRET1, 0(RA) - | ins_next2 - break; - - case BC_CAT: - | // RA = dst*8, RB = src_start*8, RC = src_end*8 - | decode_RB8a RB, INS - | decode_RB8b RB - | decode_RDtoRC8 RC, RD - | subu CARG3, RC, RB - | sw BASE, L->base - | addu CARG2, BASE, RC - | move MULTRES, RB - |->BC_CAT_Z: - | load_got lj_meta_cat - | srl CARG3, CARG3, 3 - | sw PC, SAVE_PC - | call_intern lj_meta_cat // (lua_State *L, TValue *top, int left) - |. move CARG1, L - | // Returns NULL (finished) or TValue * (metamethod). - | bnez CRET1, ->vmeta_binop - |. lw BASE, L->base - | addu RB, BASE, MULTRES - | ldc1 f0, 0(RB) - | addu RA, BASE, RA - | ins_next1 - | sdc1 f0, 0(RA) // Copy result from RB to RA. - | ins_next2 - break; - - /* -- Constant ops ------------------------------------------------------ */ - - case BC_KSTR: - | // RA = dst*8, RD = str_const*8 (~) - | srl TMP1, RD, 1 - | subu TMP1, KBASE, TMP1 - | ins_next1 - | lw TMP0, -4(TMP1) // KBASE-4-str_const*4 - | addu RA, BASE, RA - | li TMP2, LJ_TSTR - | sw TMP0, LO(RA) - | sw TMP2, HI(RA) - | ins_next2 - break; - case BC_KCDATA: - |.if FFI - | // RA = dst*8, RD = cdata_const*8 (~) - | srl TMP1, RD, 1 - | subu TMP1, KBASE, TMP1 - | ins_next1 - | lw TMP0, -4(TMP1) // KBASE-4-cdata_const*4 - | addu RA, BASE, RA - | li TMP2, LJ_TCDATA - | sw TMP0, LO(RA) - | sw TMP2, HI(RA) - | ins_next2 - |.endif - break; - case BC_KSHORT: - | // RA = dst*8, RD = int16_literal*8 - | sra RD, INS, 16 - | mtc1 RD, f0 - | addu RA, BASE, RA - | cvt.d.w f0, f0 - | ins_next1 - | sdc1 f0, 0(RA) - | ins_next2 - break; - case BC_KNUM: - | // RA = dst*8, RD = num_const*8 - | addu RD, KBASE, RD - | addu RA, BASE, RA - | ldc1 f0, 0(RD) - | ins_next1 - | sdc1 f0, 0(RA) - | ins_next2 - break; - case BC_KPRI: - | // RA = dst*8, RD = primitive_type*8 (~) - | srl TMP1, RD, 3 - | addu RA, BASE, RA - | not TMP0, TMP1 - | ins_next1 - | sw TMP0, HI(RA) - | ins_next2 - break; - case BC_KNIL: - | // RA = base*8, RD = end*8 - | addu RA, BASE, RA - | sw TISNIL, HI(RA) - | addiu RA, RA, 8 - | addu RD, BASE, RD - |1: - | sw TISNIL, HI(RA) - | slt AT, RA, RD - | bnez AT, <1 - |. addiu RA, RA, 8 - | ins_next_ - break; - - /* -- Upvalue and function ops ------------------------------------------ */ - - case BC_UGET: - | // RA = dst*8, RD = uvnum*8 - | lw LFUNC:RB, FRAME_FUNC(BASE) - | srl RD, RD, 1 - | addu RD, RD, LFUNC:RB - | lw UPVAL:RB, LFUNC:RD->uvptr - | ins_next1 - | lw TMP1, UPVAL:RB->v - | ldc1 f0, 0(TMP1) - | addu RA, BASE, RA - | sdc1 f0, 0(RA) - | ins_next2 - break; - case BC_USETV: - | // RA = uvnum*8, RD = src*8 - | lw LFUNC:RB, FRAME_FUNC(BASE) - | srl RA, RA, 1 - | addu RD, BASE, RD - | addu RA, RA, LFUNC:RB - | ldc1 f0, 0(RD) - | lw UPVAL:RB, LFUNC:RA->uvptr - | lbu TMP3, UPVAL:RB->marked - | lw CARG2, UPVAL:RB->v - | andi TMP3, TMP3, LJ_GC_BLACK // isblack(uv) - | lbu TMP0, UPVAL:RB->closed - | lw TMP2, HI(RD) - | sdc1 f0, 0(CARG2) - | li AT, LJ_GC_BLACK|1 - | or TMP3, TMP3, TMP0 - | beq TMP3, AT, >2 // Upvalue is closed and black? - |. addiu TMP2, TMP2, -(LJ_TNUMX+1) - |1: - | ins_next - | - |2: // Check if new value is collectable. - | sltiu AT, TMP2, LJ_TISGCV - (LJ_TNUMX+1) - | beqz AT, <1 // tvisgcv(v) - |. lw TMP1, LO(RD) - | lbu TMP3, GCOBJ:TMP1->gch.marked - | andi TMP3, TMP3, LJ_GC_WHITES // iswhite(v) - | beqz TMP3, <1 - |. load_got lj_gc_barrieruv - | // Crossed a write barrier. Move the barrier forward. - | call_intern lj_gc_barrieruv // (global_State *g, TValue *tv) - |. addiu CARG1, DISPATCH, GG_DISP2G - | b <1 - |. nop - break; - case BC_USETS: - | // RA = uvnum*8, RD = str_const*8 (~) - | lw LFUNC:RB, FRAME_FUNC(BASE) - | srl RA, RA, 1 - | srl TMP1, RD, 1 - | addu RA, RA, LFUNC:RB - | subu TMP1, KBASE, TMP1 - | lw UPVAL:RB, LFUNC:RA->uvptr - | lw STR:TMP1, -4(TMP1) // KBASE-4-str_const*4 - | lbu TMP2, UPVAL:RB->marked - | lw CARG2, UPVAL:RB->v - | lbu TMP3, STR:TMP1->marked - | andi AT, TMP2, LJ_GC_BLACK // isblack(uv) - | lbu TMP2, UPVAL:RB->closed - | li TMP0, LJ_TSTR - | sw STR:TMP1, LO(CARG2) - | bnez AT, >2 - |. sw TMP0, HI(CARG2) - |1: - | ins_next - | - |2: // Check if string is white and ensure upvalue is closed. - | beqz TMP2, <1 - |. andi AT, TMP3, LJ_GC_WHITES // iswhite(str) - | beqz AT, <1 - |. load_got lj_gc_barrieruv - | // Crossed a write barrier. Move the barrier forward. - | call_intern lj_gc_barrieruv // (global_State *g, TValue *tv) - |. addiu CARG1, DISPATCH, GG_DISP2G - | b <1 - |. nop - break; - case BC_USETN: - | // RA = uvnum*8, RD = num_const*8 - | lw LFUNC:RB, FRAME_FUNC(BASE) - | srl RA, RA, 1 - | addu RD, KBASE, RD - | addu RA, RA, LFUNC:RB - | ldc1 f0, 0(RD) - | lw UPVAL:RB, LFUNC:RA->uvptr - | ins_next1 - | lw TMP1, UPVAL:RB->v - | sdc1 f0, 0(TMP1) - | ins_next2 - break; - case BC_USETP: - | // RA = uvnum*8, RD = primitive_type*8 (~) - | lw LFUNC:RB, FRAME_FUNC(BASE) - | srl RA, RA, 1 - | srl TMP0, RD, 3 - | addu RA, RA, LFUNC:RB - | not TMP0, TMP0 - | lw UPVAL:RB, LFUNC:RA->uvptr - | ins_next1 - | lw TMP1, UPVAL:RB->v - | sw TMP0, HI(TMP1) - | ins_next2 - break; - - case BC_UCLO: - | // RA = level*8, RD = target - | lw TMP2, L->openupval - | branch_RD // Do this first since RD is not saved. - | load_got lj_func_closeuv - | sw BASE, L->base - | beqz TMP2, >1 - |. move CARG1, L - | call_intern lj_func_closeuv // (lua_State *L, TValue *level) - |. addu CARG2, BASE, RA - | lw BASE, L->base - |1: - | ins_next - break; - - case BC_FNEW: - | // RA = dst*8, RD = proto_const*8 (~) (holding function prototype) - | srl TMP1, RD, 1 - | load_got lj_func_newL_gc - | subu TMP1, KBASE, TMP1 - | lw CARG3, FRAME_FUNC(BASE) - | lw CARG2, -4(TMP1) // KBASE-4-tab_const*4 - | sw BASE, L->base - | sw PC, SAVE_PC - | // (lua_State *L, GCproto *pt, GCfuncL *parent) - | call_intern lj_func_newL_gc - |. move CARG1, L - | // Returns GCfuncL *. - | lw BASE, L->base - | li TMP0, LJ_TFUNC - | ins_next1 - | addu RA, BASE, RA - | sw TMP0, HI(RA) - | sw LFUNC:CRET1, LO(RA) - | ins_next2 - break; - - /* -- Table ops --------------------------------------------------------- */ - - case BC_TNEW: - case BC_TDUP: - | // RA = dst*8, RD = (hbits|asize)*8 | tab_const*8 (~) - | lw TMP0, DISPATCH_GL(gc.total)(DISPATCH) - | lw TMP1, DISPATCH_GL(gc.threshold)(DISPATCH) - | sw BASE, L->base - | sw PC, SAVE_PC - | sltu AT, TMP0, TMP1 - | beqz AT, >5 - |1: - if (op == BC_TNEW) { - | load_got lj_tab_new - | srl CARG2, RD, 3 - | andi CARG2, CARG2, 0x7ff - | li TMP0, 0x801 - | addiu AT, CARG2, -0x7ff - | srl CARG3, RD, 14 - | movz CARG2, TMP0, AT - | // (lua_State *L, int32_t asize, uint32_t hbits) - | call_intern lj_tab_new - |. move CARG1, L - | // Returns Table *. - } else { - | load_got lj_tab_dup - | srl TMP1, RD, 1 - | subu TMP1, KBASE, TMP1 - | move CARG1, L - | call_intern lj_tab_dup // (lua_State *L, Table *kt) - |. lw CARG2, -4(TMP1) // KBASE-4-str_const*4 - | // Returns Table *. - } - | lw BASE, L->base - | ins_next1 - | addu RA, BASE, RA - | li TMP0, LJ_TTAB - | sw TAB:CRET1, LO(RA) - | sw TMP0, HI(RA) - | ins_next2 - |5: - | load_got lj_gc_step_fixtop - | move MULTRES, RD - | call_intern lj_gc_step_fixtop // (lua_State *L) - |. move CARG1, L - | b <1 - |. move RD, MULTRES - break; - - case BC_GGET: - | // RA = dst*8, RD = str_const*8 (~) - case BC_GSET: - | // RA = src*8, RD = str_const*8 (~) - | lw LFUNC:TMP2, FRAME_FUNC(BASE) - | srl TMP1, RD, 1 - | subu TMP1, KBASE, TMP1 - | lw TAB:RB, LFUNC:TMP2->env - | lw STR:RC, -4(TMP1) // KBASE-4-str_const*4 - if (op == BC_GGET) { - | b ->BC_TGETS_Z - } else { - | b ->BC_TSETS_Z - } - |. addu RA, BASE, RA - break; - - case BC_TGETV: - | // RA = dst*8, RB = table*8, RC = key*8 - | decode_RB8a RB, INS - | decode_RB8b RB - | decode_RDtoRC8 RC, RD - | addu CARG2, BASE, RB - | addu CARG3, BASE, RC - | lw TMP1, HI(CARG2) - | lw TMP2, HI(CARG3) - | lw TAB:RB, LO(CARG2) - | li AT, LJ_TTAB - | ldc1 f0, 0(CARG3) - | bne TMP1, AT, ->vmeta_tgetv - |. addu RA, BASE, RA - | sltiu AT, TMP2, LJ_TISNUM - | beqz AT, >5 - |. li AT, LJ_TSTR - | - | // Convert number key to integer, check for integerness and range. - | cvt.w.d f2, f0 - | lw TMP0, TAB:RB->asize - | mfc1 TMP2, f2 - | cvt.d.w f4, f2 - | lw TMP1, TAB:RB->array - | c.eq.d f0, f4 - | sltu AT, TMP2, TMP0 - | movf AT, r0 - | sll TMP2, TMP2, 3 - | beqz AT, ->vmeta_tgetv // Integer key and in array part? - |. addu TMP2, TMP1, TMP2 - | lw TMP0, HI(TMP2) - | beq TMP0, TISNIL, >2 - |. ldc1 f0, 0(TMP2) - |1: - | ins_next1 - | sdc1 f0, 0(RA) - | ins_next2 - | - |2: // Check for __index if table value is nil. - | lw TAB:TMP2, TAB:RB->metatable - | beqz TAB:TMP2, <1 // No metatable: done. - |. nop - | lbu TMP0, TAB:TMP2->nomm - | andi TMP0, TMP0, 1<vmeta_tgetv - |. nop - | - |5: - | bne TMP2, AT, ->vmeta_tgetv - |. lw STR:RC, LO(CARG3) - | b ->BC_TGETS_Z // String key? - |. nop - break; - case BC_TGETS: - | // RA = dst*8, RB = table*8, RC = str_const*4 (~) - | decode_RB8a RB, INS - | decode_RB8b RB - | addu CARG2, BASE, RB - | decode_RC4a RC, INS - | lw TMP0, HI(CARG2) - | decode_RC4b RC - | li AT, LJ_TTAB - | lw TAB:RB, LO(CARG2) - | subu CARG3, KBASE, RC - | lw STR:RC, -4(CARG3) // KBASE-4-str_const*4 - | bne TMP0, AT, ->vmeta_tgets1 - |. addu RA, BASE, RA - |->BC_TGETS_Z: - | // TAB:RB = GCtab *, STR:RC = GCstr *, RA = dst*8 - | lw TMP0, TAB:RB->hmask - | lw TMP1, STR:RC->hash - | lw NODE:TMP2, TAB:RB->node - | and TMP1, TMP1, TMP0 // idx = str->hash & tab->hmask - | sll TMP0, TMP1, 5 - | sll TMP1, TMP1, 3 - | subu TMP1, TMP0, TMP1 - | addu NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8) - |1: - | lw CARG1, offsetof(Node, key)+HI(NODE:TMP2) - | lw TMP0, offsetof(Node, key)+LO(NODE:TMP2) - | lw NODE:TMP1, NODE:TMP2->next - | lw CARG2, offsetof(Node, val)+HI(NODE:TMP2) - | addiu CARG1, CARG1, -LJ_TSTR - | xor TMP0, TMP0, STR:RC - | or AT, CARG1, TMP0 - | bnez AT, >4 - |. lw TAB:TMP3, TAB:RB->metatable - | beq CARG2, TISNIL, >5 // Key found, but nil value? - |. lw CARG1, offsetof(Node, val)+LO(NODE:TMP2) - |3: - | ins_next1 - | sw CARG2, HI(RA) - | sw CARG1, LO(RA) - | ins_next2 - | - |4: // Follow hash chain. - | bnez NODE:TMP1, <1 - |. move NODE:TMP2, NODE:TMP1 - | // End of hash chain: key not found, nil result. - | - |5: // Check for __index if table value is nil. - | beqz TAB:TMP3, <3 // No metatable: done. - |. li CARG2, LJ_TNIL - | lbu TMP0, TAB:TMP3->nomm - | andi TMP0, TMP0, 1<vmeta_tgets - |. nop - break; - case BC_TGETB: - | // RA = dst*8, RB = table*8, RC = index*8 - | decode_RB8a RB, INS - | decode_RB8b RB - | addu CARG2, BASE, RB - | decode_RDtoRC8 RC, RD - | lw CARG1, HI(CARG2) - | li AT, LJ_TTAB - | lw TAB:RB, LO(CARG2) - | addu RA, BASE, RA - | bne CARG1, AT, ->vmeta_tgetb - |. srl TMP0, RC, 3 - | lw TMP1, TAB:RB->asize - | lw TMP2, TAB:RB->array - | sltu AT, TMP0, TMP1 - | beqz AT, ->vmeta_tgetb - |. addu RC, TMP2, RC - | lw TMP1, HI(RC) - | beq TMP1, TISNIL, >5 - |. ldc1 f0, 0(RC) - |1: - | ins_next1 - | sdc1 f0, 0(RA) - | ins_next2 - | - |5: // Check for __index if table value is nil. - | lw TAB:TMP2, TAB:RB->metatable - | beqz TAB:TMP2, <1 // No metatable: done. - |. nop - | lbu TMP1, TAB:TMP2->nomm - | andi TMP1, TMP1, 1<vmeta_tgetb // Caveat: preserve TMP0! - |. nop - break; - - case BC_TSETV: - | // RA = src*8, RB = table*8, RC = key*8 - | decode_RB8a RB, INS - | decode_RB8b RB - | decode_RDtoRC8 RC, RD - | addu CARG2, BASE, RB - | addu CARG3, BASE, RC - | lw TMP1, HI(CARG2) - | lw TMP2, HI(CARG3) - | lw TAB:RB, LO(CARG2) - | li AT, LJ_TTAB - | ldc1 f0, 0(CARG3) - | bne TMP1, AT, ->vmeta_tsetv - |. addu RA, BASE, RA - | sltiu AT, TMP2, LJ_TISNUM - | beqz AT, >5 - |. li AT, LJ_TSTR - | - | // Convert number key to integer, check for integerness and range. - | cvt.w.d f2, f0 - | lw TMP0, TAB:RB->asize - | mfc1 TMP2, f2 - | cvt.d.w f4, f2 - | lw TMP1, TAB:RB->array - | c.eq.d f0, f4 - | sltu AT, TMP2, TMP0 - | movf AT, r0 - | sll TMP2, TMP2, 3 - | beqz AT, ->vmeta_tsetv // Integer key and in array part? - |. addu TMP1, TMP1, TMP2 - | lbu TMP3, TAB:RB->marked - | lw TMP0, HI(TMP1) - | beq TMP0, TISNIL, >3 - |. ldc1 f0, 0(RA) - |1: - | andi AT, TMP3, LJ_GC_BLACK // isblack(table) - | bnez AT, >7 - |. sdc1 f0, 0(TMP1) - |2: - | ins_next - | - |3: // Check for __newindex if previous value is nil. - | lw TAB:TMP2, TAB:RB->metatable - | beqz TAB:TMP2, <1 // No metatable: done. - |. nop - | lbu TMP2, TAB:TMP2->nomm - | andi TMP2, TMP2, 1<vmeta_tsetv - |. nop - | - |5: - | bne TMP2, AT, ->vmeta_tsetv - |. lw STR:RC, LO(CARG3) - | b ->BC_TSETS_Z // String key? - |. nop - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, TMP3, TMP0, <2 - break; - case BC_TSETS: - | // RA = src*8, RB = table*8, RC = str_const*8 (~) - | decode_RB8a RB, INS - | decode_RB8b RB - | addu CARG2, BASE, RB - | decode_RC4a RC, INS - | lw TMP0, HI(CARG2) - | decode_RC4b RC - | li AT, LJ_TTAB - | subu CARG3, KBASE, RC - | lw TAB:RB, LO(CARG2) - | lw STR:RC, -4(CARG3) // KBASE-4-str_const*4 - | bne TMP0, AT, ->vmeta_tsets1 - |. addu RA, BASE, RA - |->BC_TSETS_Z: - | // TAB:RB = GCtab *, STR:RC = GCstr *, RA = BASE+src*8 - | lw TMP0, TAB:RB->hmask - | lw TMP1, STR:RC->hash - | lw NODE:TMP2, TAB:RB->node - | sb r0, TAB:RB->nomm // Clear metamethod cache. - | and TMP1, TMP1, TMP0 // idx = str->hash & tab->hmask - | sll TMP0, TMP1, 5 - | sll TMP1, TMP1, 3 - | subu TMP1, TMP0, TMP1 - | addu NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8) - | ldc1 f20, 0(RA) - |1: - | lw CARG1, offsetof(Node, key)+HI(NODE:TMP2) - | lw TMP0, offsetof(Node, key)+LO(NODE:TMP2) - | li AT, LJ_TSTR - | lw NODE:TMP1, NODE:TMP2->next - | bne CARG1, AT, >5 - |. lw CARG2, offsetof(Node, val)+HI(NODE:TMP2) - | bne TMP0, STR:RC, >5 - |. lbu TMP3, TAB:RB->marked - | beq CARG2, TISNIL, >4 // Key found, but nil value? - |. lw TAB:TMP0, TAB:RB->metatable - |2: - | andi AT, TMP3, LJ_GC_BLACK // isblack(table) - | bnez AT, >7 - |. sdc1 f20, NODE:TMP2->val - |3: - | ins_next - | - |4: // Check for __newindex if previous value is nil. - | beqz TAB:TMP0, <2 // No metatable: done. - |. nop - | lbu TMP0, TAB:TMP0->nomm - | andi TMP0, TMP0, 1<vmeta_tsets - |. nop - | - |5: // Follow hash chain. - | bnez NODE:TMP1, <1 - |. move NODE:TMP2, NODE:TMP1 - | // End of hash chain: key not found, add a new one - | - | // But check for __newindex first. - | lw TAB:TMP2, TAB:RB->metatable - | beqz TAB:TMP2, >6 // No metatable: continue. - |. addiu CARG3, DISPATCH, DISPATCH_GL(tmptv) - | lbu TMP0, TAB:TMP2->nomm - | andi TMP0, TMP0, 1<vmeta_tsets // 'no __newindex' flag NOT set: check. - |. li AT, LJ_TSTR - |6: - | load_got lj_tab_newkey - | sw STR:RC, LO(CARG3) - | sw AT, HI(CARG3) - | sw BASE, L->base - | move CARG2, TAB:RB - | sw PC, SAVE_PC - | call_intern lj_tab_newkey // (lua_State *L, GCtab *t, TValue *k - |. move CARG1, L - | // Returns TValue *. - | lw BASE, L->base - | b <3 // No 2nd write barrier needed. - |. sdc1 f20, 0(CRET1) - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, TMP3, TMP0, <3 - break; - case BC_TSETB: - | // RA = src*8, RB = table*8, RC = index*8 - | decode_RB8a RB, INS - | decode_RB8b RB - | addu CARG2, BASE, RB - | decode_RDtoRC8 RC, RD - | lw CARG1, HI(CARG2) - | li AT, LJ_TTAB - | lw TAB:RB, LO(CARG2) - | addu RA, BASE, RA - | bne CARG1, AT, ->vmeta_tsetb - |. srl TMP0, RC, 3 - | lw TMP1, TAB:RB->asize - | lw TMP2, TAB:RB->array - | sltu AT, TMP0, TMP1 - | beqz AT, ->vmeta_tsetb - |. addu RC, TMP2, RC - | lw TMP1, HI(RC) - | lbu TMP3, TAB:RB->marked - | beq TMP1, TISNIL, >5 - |. ldc1 f0, 0(RA) - |1: - | andi AT, TMP3, LJ_GC_BLACK // isblack(table) - | bnez AT, >7 - |. sdc1 f0, 0(RC) - |2: - | ins_next - | - |5: // Check for __newindex if previous value is nil. - | lw TAB:TMP2, TAB:RB->metatable - | beqz TAB:TMP2, <1 // No metatable: done. - |. nop - | lbu TMP1, TAB:TMP2->nomm - | andi TMP1, TMP1, 1<vmeta_tsetb // Caveat: preserve TMP0! - |. nop - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, TMP3, TMP0, <2 - break; - - case BC_TSETM: - | // RA = base*8 (table at base-1), RD = num_const*8 (start index) - | addu RA, BASE, RA - |1: - | addu TMP3, KBASE, RD - | lw TAB:CARG2, -8+LO(RA) // Guaranteed to be a table. - | addiu TMP0, MULTRES, -8 - | lw TMP3, LO(TMP3) // Integer constant is in lo-word. - | beqz TMP0, >4 // Nothing to copy? - |. srl CARG3, TMP0, 3 - | addu CARG3, CARG3, TMP3 - | lw TMP2, TAB:CARG2->asize - | sll TMP1, TMP3, 3 - | lbu TMP3, TAB:CARG2->marked - | lw CARG1, TAB:CARG2->array - | sltu AT, TMP2, CARG3 - | bnez AT, >5 - |. addu TMP2, RA, TMP0 - | addu TMP1, TMP1, CARG1 - | andi TMP0, TMP3, LJ_GC_BLACK // isblack(table) - |3: // Copy result slots to table. - | ldc1 f0, 0(RA) - | addiu RA, RA, 8 - | sltu AT, RA, TMP2 - | sdc1 f0, 0(TMP1) - | bnez AT, <3 - |. addiu TMP1, TMP1, 8 - | bnez TMP0, >7 - |. nop - |4: - | ins_next - | - |5: // Need to resize array part. - | load_got lj_tab_reasize - | sw BASE, L->base - | sw PC, SAVE_PC - | move BASE, RD - | call_intern lj_tab_reasize // (lua_State *L, GCtab *t, int nasize) - |. move CARG1, L - | // Must not reallocate the stack. - | move RD, BASE - | b <1 - |. lw BASE, L->base // Reload BASE for lack of a saved register. - | - |7: // Possible table write barrier for any value. Skip valiswhite check. - | barrierback TAB:CARG2, TMP3, TMP0, <4 - break; - - /* -- Calls and vararg handling ----------------------------------------- */ - - case BC_CALLM: - | // RA = base*8, (RB = (nresults+1)*8,) RC = extra_nargs*8 - | decode_RDtoRC8 NARGS8:RC, RD - | b ->BC_CALL_Z - |. addu NARGS8:RC, NARGS8:RC, MULTRES - break; - case BC_CALL: - | // RA = base*8, (RB = (nresults+1)*8,) RC = (nargs+1)*8 - | decode_RDtoRC8 NARGS8:RC, RD - |->BC_CALL_Z: - | move TMP2, BASE - | addu BASE, BASE, RA - | li AT, LJ_TFUNC - | lw TMP0, HI(BASE) - | lw LFUNC:RB, LO(BASE) - | addiu BASE, BASE, 8 - | bne TMP0, AT, ->vmeta_call - |. addiu NARGS8:RC, NARGS8:RC, -8 - | ins_call - break; - - case BC_CALLMT: - | // RA = base*8, (RB = 0,) RC = extra_nargs*8 - | addu NARGS8:RD, NARGS8:RD, MULTRES // BC_CALLT gets RC from RD. - | // Fall through. Assumes BC_CALLT follows. - break; - case BC_CALLT: - | // RA = base*8, (RB = 0,) RC = (nargs+1)*8 - | addu RA, BASE, RA - | li AT, LJ_TFUNC - | lw TMP0, HI(RA) - | lw LFUNC:RB, LO(RA) - | move NARGS8:RC, RD - | lw TMP1, FRAME_PC(BASE) - | addiu RA, RA, 8 - | bne TMP0, AT, ->vmeta_callt - |. addiu NARGS8:RC, NARGS8:RC, -8 - |->BC_CALLT_Z: - | andi TMP0, TMP1, FRAME_TYPE // Caveat: preserve TMP0 until the 'or'. - | lbu TMP3, LFUNC:RB->ffid - | bnez TMP0, >7 - |. xori TMP2, TMP1, FRAME_VARG - |1: - | sw LFUNC:RB, FRAME_FUNC(BASE) // Copy function down, but keep PC. - | sltiu AT, TMP3, 2 // (> FF_C) Calling a fast function? - | move TMP2, BASE - | beqz NARGS8:RC, >3 - |. move TMP3, NARGS8:RC - |2: - | ldc1 f0, 0(RA) - | addiu RA, RA, 8 - | addiu TMP3, TMP3, -8 - | sdc1 f0, 0(TMP2) - | bnez TMP3, <2 - |. addiu TMP2, TMP2, 8 - |3: - | or TMP0, TMP0, AT - | beqz TMP0, >5 - |. nop - |4: - | ins_callt - | - |5: // Tailcall to a fast function with a Lua frame below. - | lw INS, -4(TMP1) - | decode_RA8a RA, INS - | decode_RA8b RA - | subu TMP1, BASE, RA - | lw LFUNC:TMP1, -8+FRAME_FUNC(TMP1) - | lw TMP1, LFUNC:TMP1->pc - | b <4 - |. lw KBASE, PC2PROTO(k)(TMP1) // Need to prepare KBASE. - | - |7: // Tailcall from a vararg function. - | andi AT, TMP2, FRAME_TYPEP - | bnez AT, <1 // Vararg frame below? - |. subu TMP2, BASE, TMP2 // Relocate BASE down. - | move BASE, TMP2 - | lw TMP1, FRAME_PC(TMP2) - | b <1 - |. andi TMP0, TMP1, FRAME_TYPE - break; - - case BC_ITERC: - | // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 ((2+1)*8)) - | move TMP2, BASE - | addu BASE, BASE, RA - | li AT, LJ_TFUNC - | lw TMP1, -24+HI(BASE) - | lw LFUNC:RB, -24+LO(BASE) - | ldc1 f2, -8(BASE) - | ldc1 f0, -16(BASE) - | sw TMP1, HI(BASE) // Copy callable. - | sw LFUNC:RB, LO(BASE) - | sdc1 f2, 16(BASE) // Copy control var. - | sdc1 f0, 8(BASE) // Copy state. - | addiu BASE, BASE, 8 - | bne TMP1, AT, ->vmeta_call - |. li NARGS8:RC, 16 // Iterators get 2 arguments. - | ins_call - break; - - case BC_ITERN: - | // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 (2+1)*8) - |.if JIT - | // NYI: add hotloop, record BC_ITERN. - |.endif - | addu RA, BASE, RA - | lw TAB:RB, -16+LO(RA) - | lw RC, -8+LO(RA) // Get index from control var. - | lw TMP0, TAB:RB->asize - | lw TMP1, TAB:RB->array - | addiu PC, PC, 4 - |1: // Traverse array part. - | sltu AT, RC, TMP0 - | beqz AT, >5 // Index points after array part? - |. sll TMP3, RC, 3 - | addu TMP3, TMP1, TMP3 - | lw TMP2, HI(TMP3) - | ldc1 f0, 0(TMP3) - | mtc1 RC, f2 - | lhu RD, -4+OFS_RD(PC) - | beq TMP2, TISNIL, <1 // Skip holes in array part. - |. addiu RC, RC, 1 - | cvt.d.w f2, f2 - | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) - | sdc1 f0, 8(RA) - | decode_RD4b RD - | addu RD, RD, TMP3 - | sw RC, -8+LO(RA) // Update control var. - | addu PC, PC, RD - | sdc1 f2, 0(RA) - |3: - | ins_next - | - |5: // Traverse hash part. - | lw TMP1, TAB:RB->hmask - | subu RC, RC, TMP0 - | lw TMP2, TAB:RB->node - |6: - | sltu AT, TMP1, RC // End of iteration? Branch to ITERL+1. - | bnez AT, <3 - |. sll TMP3, RC, 5 - | sll RB, RC, 3 - | subu TMP3, TMP3, RB - | addu NODE:TMP3, TMP3, TMP2 - | lw RB, HI(NODE:TMP3) - | ldc1 f0, 0(NODE:TMP3) - | lhu RD, -4+OFS_RD(PC) - | beq RB, TISNIL, <6 // Skip holes in hash part. - |. addiu RC, RC, 1 - | ldc1 f2, NODE:TMP3->key - | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) - | sdc1 f0, 8(RA) - | addu RC, RC, TMP0 - | decode_RD4b RD - | addu RD, RD, TMP3 - | sdc1 f2, 0(RA) - | addu PC, PC, RD - | b <3 - |. sw RC, -8+LO(RA) // Update control var. - break; - - case BC_ISNEXT: - | // RA = base*8, RD = target (points to ITERN) - | addu RA, BASE, RA - | srl TMP0, RD, 1 - | lw CARG1, -24+HI(RA) - | lw CFUNC:CARG2, -24+LO(RA) - | addu TMP0, PC, TMP0 - | lw CARG3, -16+HI(RA) - | lw CARG4, -8+HI(RA) - | li AT, LJ_TFUNC - | bne CARG1, AT, >5 - |. lui TMP2, (-(BCBIAS_J*4 >> 16) & 65535) - | lbu CARG2, CFUNC:CARG2->ffid - | addiu CARG3, CARG3, -LJ_TTAB - | addiu CARG4, CARG4, -LJ_TNIL - | or CARG3, CARG3, CARG4 - | addiu CARG2, CARG2, -FF_next_N - | or CARG2, CARG2, CARG3 - | bnez CARG2, >5 - |. lui TMP1, 0xfffe - | addu PC, TMP0, TMP2 - | ori TMP1, TMP1, 0x7fff - | sw r0, -8+LO(RA) // Initialize control var. - | sw TMP1, -8+HI(RA) - |1: - | ins_next - |5: // Despecialize bytecode if any of the checks fail. - | li TMP3, BC_JMP - | li TMP1, BC_ITERC - | sb TMP3, -4+OFS_OP(PC) - | addu PC, TMP0, TMP2 - | b <1 - |. sb TMP1, OFS_OP(PC) - break; - - case BC_VARG: - | // RA = base*8, RB = (nresults+1)*8, RC = numparams*8 - | lw TMP0, FRAME_PC(BASE) - | decode_RDtoRC8 RC, RD - | decode_RB8a RB, INS - | addu RC, BASE, RC - | decode_RB8b RB - | addu RA, BASE, RA - | addiu RC, RC, FRAME_VARG - | addu TMP2, RA, RB - | addiu TMP3, BASE, -8 // TMP3 = vtop - | subu RC, RC, TMP0 // RC = vbase - | // Note: RC may now be even _above_ BASE if nargs was < numparams. - | beqz RB, >5 // Copy all varargs? - |. subu TMP1, TMP3, RC - | addiu TMP2, TMP2, -16 - |1: // Copy vararg slots to destination slots. - | lw CARG1, HI(RC) - | sltu AT, RC, TMP3 - | lw CARG2, LO(RC) - | addiu RC, RC, 8 - | movz CARG1, TISNIL, AT - | sw CARG1, HI(RA) - | sw CARG2, LO(RA) - | sltu AT, RA, TMP2 - | bnez AT, <1 - |. addiu RA, RA, 8 - |3: - | ins_next - | - |5: // Copy all varargs. - | lw TMP0, L->maxstack - | blez TMP1, <3 // No vararg slots? - |. li MULTRES, 8 // MULTRES = (0+1)*8 - | addu TMP2, RA, TMP1 - | sltu AT, TMP0, TMP2 - | bnez AT, >7 - |. addiu MULTRES, TMP1, 8 - |6: - | ldc1 f0, 0(RC) - | addiu RC, RC, 8 - | sdc1 f0, 0(RA) - | sltu AT, RC, TMP3 - | bnez AT, <6 // More vararg slots? - |. addiu RA, RA, 8 - | b <3 - |. nop - | - |7: // Grow stack for varargs. - | load_got lj_state_growstack - | sw RA, L->top - | subu RA, RA, BASE - | sw BASE, L->base - | subu BASE, RC, BASE // Need delta, because BASE may change. - | sw PC, SAVE_PC - | srl CARG2, TMP1, 3 - | call_intern lj_state_growstack // (lua_State *L, int n) - |. move CARG1, L - | move RC, BASE - | lw BASE, L->base - | addu RA, BASE, RA - | addu RC, BASE, RC - | b <6 - |. addiu TMP3, BASE, -8 - break; - - /* -- Returns ----------------------------------------------------------- */ - - case BC_RETM: - | // RA = results*8, RD = extra_nresults*8 - | addu RD, RD, MULTRES // MULTRES >= 8, so RD >= 8. - | // Fall through. Assumes BC_RET follows. - break; - - case BC_RET: - | // RA = results*8, RD = (nresults+1)*8 - | lw PC, FRAME_PC(BASE) - | addu RA, BASE, RA - | move MULTRES, RD - |1: - | andi TMP0, PC, FRAME_TYPE - | bnez TMP0, ->BC_RETV_Z - |. xori TMP1, PC, FRAME_VARG - | - |->BC_RET_Z: - | // BASE = base, RA = resultptr, RD = (nresults+1)*8, PC = return - | lw INS, -4(PC) - | addiu TMP2, BASE, -8 - | addiu RC, RD, -8 - | decode_RA8a TMP0, INS - | decode_RB8a RB, INS - | decode_RA8b TMP0 - | decode_RB8b RB - | addu TMP3, TMP2, RB - | beqz RC, >3 - |. subu BASE, TMP2, TMP0 - |2: - | ldc1 f0, 0(RA) - | addiu RA, RA, 8 - | addiu RC, RC, -8 - | sdc1 f0, 0(TMP2) - | bnez RC, <2 - |. addiu TMP2, TMP2, 8 - |3: - | addiu TMP3, TMP3, -8 - |5: - | sltu AT, TMP2, TMP3 - | bnez AT, >6 - |. lw LFUNC:TMP1, FRAME_FUNC(BASE) - | ins_next1 - | lw TMP1, LFUNC:TMP1->pc - | lw KBASE, PC2PROTO(k)(TMP1) - | ins_next2 - | - |6: // Fill up results with nil. - | sw TISNIL, HI(TMP2) - | b <5 - |. addiu TMP2, TMP2, 8 - | - |->BC_RETV_Z: // Non-standard return case. - | andi TMP2, TMP1, FRAME_TYPEP - | bnez TMP2, ->vm_return - |. nop - | // Return from vararg function: relocate BASE down. - | subu BASE, BASE, TMP1 - | b <1 - |. lw PC, FRAME_PC(BASE) - break; - - case BC_RET0: case BC_RET1: - | // RA = results*8, RD = (nresults+1)*8 - | lw PC, FRAME_PC(BASE) - | addu RA, BASE, RA - | move MULTRES, RD - | andi TMP0, PC, FRAME_TYPE - | bnez TMP0, ->BC_RETV_Z - |. xori TMP1, PC, FRAME_VARG - | - | lw INS, -4(PC) - | addiu TMP2, BASE, -8 - if (op == BC_RET1) { - | ldc1 f0, 0(RA) - } - | decode_RB8a RB, INS - | decode_RA8a RA, INS - | decode_RB8b RB - | decode_RA8b RA - if (op == BC_RET1) { - | sdc1 f0, 0(TMP2) - } - | subu BASE, TMP2, RA - |5: - | sltu AT, RD, RB - | bnez AT, >6 - |. lw LFUNC:TMP1, FRAME_FUNC(BASE) - | ins_next1 - | lw TMP1, LFUNC:TMP1->pc - | lw KBASE, PC2PROTO(k)(TMP1) - | ins_next2 - | - |6: // Fill up results with nil. - | addiu TMP2, TMP2, 8 - | addiu RD, RD, 8 - | b <5 - if (op == BC_RET1) { - |. sw TISNIL, HI(TMP2) - } else { - |. sw TISNIL, -8+HI(TMP2) - } - break; - - /* -- Loops and branches ------------------------------------------------ */ - - case BC_FORL: - |.if JIT - | hotloop - |.endif - | // Fall through. Assumes BC_IFORL follows. - break; - - case BC_JFORI: - case BC_JFORL: -#if !LJ_HASJIT - break; -#endif - case BC_FORI: - case BC_IFORL: - | // RA = base*8, RD = target (after end of loop or start of loop) - vk = (op == BC_IFORL || op == BC_JFORL); - | addu RA, BASE, RA - if (vk) { - | ldc1 f0, FORL_IDX*8(RA) - | ldc1 f4, FORL_STEP*8(RA) - | ldc1 f2, FORL_STOP*8(RA) - | lw TMP3, FORL_STEP*8+HI(RA) - | add.d f0, f0, f4 - | sdc1 f0, FORL_IDX*8(RA) - } else { - | lw TMP1, FORL_IDX*8+HI(RA) - | lw TMP3, FORL_STEP*8+HI(RA) - | lw TMP2, FORL_STOP*8+HI(RA) - | sltiu TMP1, TMP1, LJ_TISNUM - | sltiu TMP0, TMP3, LJ_TISNUM - | sltiu TMP2, TMP2, LJ_TISNUM - | and TMP1, TMP1, TMP0 - | and TMP1, TMP1, TMP2 - | ldc1 f0, FORL_IDX*8(RA) - | beqz TMP1, ->vmeta_for - |. ldc1 f2, FORL_STOP*8(RA) - } - if (op != BC_JFORL) { - | srl RD, RD, 1 - | lui TMP0, (-(BCBIAS_J*4 >> 16) & 65535) - } - | c.le.d 0, f0, f2 - | c.le.d 1, f2, f0 - | sdc1 f0, FORL_EXT*8(RA) - if (op == BC_JFORI) { - | li TMP1, 1 - | li TMP2, 1 - | addu TMP0, RD, TMP0 - | slt TMP3, TMP3, r0 - | movf TMP1, r0, 0 - | addu PC, PC, TMP0 - | movf TMP2, r0, 1 - | lhu RD, -4+OFS_RD(PC) - | movn TMP1, TMP2, TMP3 - | bnez TMP1, =>BC_JLOOP - |. decode_RD8b RD - } else if (op == BC_JFORL) { - | li TMP1, 1 - | li TMP2, 1 - | slt TMP3, TMP3, r0 - | movf TMP1, r0, 0 - | movf TMP2, r0, 1 - | movn TMP1, TMP2, TMP3 - | bnez TMP1, =>BC_JLOOP - |. nop - } else { - | addu TMP1, RD, TMP0 - | slt TMP3, TMP3, r0 - | move TMP2, TMP1 - if (op == BC_FORI) { - | movt TMP1, r0, 0 - | movt TMP2, r0, 1 - } else { - | movf TMP1, r0, 0 - | movf TMP2, r0, 1 - } - | movn TMP1, TMP2, TMP3 - | addu PC, PC, TMP1 - } - | ins_next - break; - - case BC_ITERL: - |.if JIT - | hotloop - |.endif - | // Fall through. Assumes BC_IITERL follows. - break; - - case BC_JITERL: -#if !LJ_HASJIT - break; -#endif - case BC_IITERL: - | // RA = base*8, RD = target - | addu RA, BASE, RA - | lw TMP1, HI(RA) - | beq TMP1, TISNIL, >1 // Stop if iterator returned nil. - |. lw TMP2, LO(RA) - if (op == BC_JITERL) { - | sw TMP1, -8+HI(RA) - | b =>BC_JLOOP - |. sw TMP2, -8+LO(RA) - } else { - | branch_RD // Otherwise save control var + branch. - | sw TMP1, -8+HI(RA) - | sw TMP2, -8+LO(RA) - } - |1: - | ins_next - break; - - case BC_LOOP: - | // RA = base*8, RD = target (loop extent) - | // Note: RA/RD is only used by trace recorder to determine scope/extent - | // This opcode does NOT jump, it's only purpose is to detect a hot loop. - |.if JIT - | hotloop - |.endif - | // Fall through. Assumes BC_ILOOP follows. - break; - - case BC_ILOOP: - | // RA = base*8, RD = target (loop extent) - | ins_next - break; - - case BC_JLOOP: - |.if JIT - | // RA = base*8 (ignored), RD = traceno*8 - | lw TMP1, DISPATCH_J(trace)(DISPATCH) - | srl RD, RD, 1 - | li AT, 0 - | addu TMP1, TMP1, RD - | // Traces on MIPS don't store the trace number, so use 0. - | sw AT, DISPATCH_GL(vmstate)(DISPATCH) - | lw TRACE:TMP2, 0(TMP1) - | sw BASE, DISPATCH_GL(jit_base)(DISPATCH) - | sw L, DISPATCH_GL(jit_L)(DISPATCH) - | lw TMP2, TRACE:TMP2->mcode - | jr TMP2 - |. addiu JGL, DISPATCH, GG_DISP2G+32768 - |.endif - break; - - case BC_JMP: - | // RA = base*8 (only used by trace recorder), RD = target - | branch_RD - | ins_next - break; - - /* -- Function headers -------------------------------------------------- */ - - case BC_FUNCF: - |.if JIT - | hotcall - |.endif - case BC_FUNCV: /* NYI: compiled vararg functions. */ - | // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow. - break; - - case BC_JFUNCF: -#if !LJ_HASJIT - break; -#endif - case BC_IFUNCF: - | // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8 - | lw TMP2, L->maxstack - | lbu TMP1, -4+PC2PROTO(numparams)(PC) - | lw KBASE, -4+PC2PROTO(k)(PC) - | sltu AT, TMP2, RA - | bnez AT, ->vm_growstack_l - |. sll TMP1, TMP1, 3 - if (op != BC_JFUNCF) { - | ins_next1 - } - |2: - | sltu AT, NARGS8:RC, TMP1 // Check for missing parameters. - | bnez AT, >3 - |. addu AT, BASE, NARGS8:RC - if (op == BC_JFUNCF) { - | decode_RD8a RD, INS - | b =>BC_JLOOP - |. decode_RD8b RD - } else { - | ins_next2 - } - | - |3: // Clear missing parameters. - | sw TISNIL, HI(AT) - | b <2 - |. addiu NARGS8:RC, NARGS8:RC, 8 - break; - - case BC_JFUNCV: -#if !LJ_HASJIT - break; -#endif - | NYI // NYI: compiled vararg functions - break; /* NYI: compiled vararg functions. */ - - case BC_IFUNCV: - | // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8 - | addu TMP1, BASE, RC - | lw TMP2, L->maxstack - | addu TMP0, RA, RC - | sw LFUNC:RB, LO(TMP1) // Store copy of LFUNC. - | addiu TMP3, RC, 8+FRAME_VARG - | sltu AT, TMP0, TMP2 - | lw KBASE, -4+PC2PROTO(k)(PC) - | beqz AT, ->vm_growstack_l - |. sw TMP3, HI(TMP1) // Store delta + FRAME_VARG. - | lbu TMP2, -4+PC2PROTO(numparams)(PC) - | move RA, BASE - | move RC, TMP1 - | ins_next1 - | beqz TMP2, >3 - |. addiu BASE, TMP1, 8 - |1: - | lw TMP0, HI(RA) - | lw TMP3, LO(RA) - | sltu AT, RA, RC // Less args than parameters? - | move CARG1, TMP0 - | movz TMP0, TISNIL, AT // Clear missing parameters. - | movn CARG1, TISNIL, AT // Clear old fixarg slot (help the GC). - | sw TMP3, 8+LO(TMP1) - | addiu TMP2, TMP2, -1 - | sw TMP0, 8+HI(TMP1) - | addiu TMP1, TMP1, 8 - | sw CARG1, HI(RA) - | bnez TMP2, <1 - |. addiu RA, RA, 8 - |3: - | ins_next2 - break; - - case BC_FUNCC: - case BC_FUNCCW: - | // BASE = new base, RA = BASE+framesize*8, RB = CFUNC, RC = nargs*8 - if (op == BC_FUNCC) { - | lw CFUNCADDR, CFUNC:RB->f - } else { - | lw CFUNCADDR, DISPATCH_GL(wrapf)(DISPATCH) - } - | addu TMP1, RA, NARGS8:RC - | lw TMP2, L->maxstack - | addu RC, BASE, NARGS8:RC - | sw BASE, L->base - | sltu AT, TMP2, TMP1 - | sw RC, L->top - | li_vmstate C - if (op == BC_FUNCCW) { - | lw CARG2, CFUNC:RB->f - } - | bnez AT, ->vm_growstack_c // Need to grow stack. - |. move CARG1, L - | jalr CFUNCADDR // (lua_State *L [, lua_CFunction f]) - |. st_vmstate - | // Returns nresults. - | lw BASE, L->base - | sll RD, CRET1, 3 - | lw TMP1, L->top - | li_vmstate INTERP - | lw PC, FRAME_PC(BASE) // Fetch PC of caller. - | subu RA, TMP1, RD // RA = L->top - nresults*8 - | b ->vm_returnc - |. st_vmstate - break; - - /* ---------------------------------------------------------------------- */ - - default: - fprintf(stderr, "Error: undefined opcode BC_%s\n", bc_names[op]); - exit(2); - break; - } -} - -static int build_backend(BuildCtx *ctx) -{ - int op; - - dasm_growpc(Dst, BC__MAX); - - build_subroutines(ctx); - - |.code_op - for (op = 0; op < BC__MAX; op++) - build_ins(ctx, (BCOp)op, op); - - return BC__MAX; -} - -/* Emit pseudo frame-info for all assembler functions. */ -static void emit_asm_debug(BuildCtx *ctx) -{ - int fcofs = (int)((uint8_t *)ctx->glob[GLOB_vm_ffi_call] - ctx->code); - int i; - switch (ctx->mode) { - case BUILD_elfasm: - fprintf(ctx->fp, "\t.section .debug_frame,\"\",@progbits\n"); - fprintf(ctx->fp, - ".Lframe0:\n" - "\t.4byte .LECIE0-.LSCIE0\n" - ".LSCIE0:\n" - "\t.4byte 0xffffffff\n" - "\t.byte 0x1\n" - "\t.string \"\"\n" - "\t.uleb128 0x1\n" - "\t.sleb128 -4\n" - "\t.byte 31\n" - "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 0\n" - "\t.align 2\n" - ".LECIE0:\n\n"); - fprintf(ctx->fp, - ".LSFDE0:\n" - "\t.4byte .LEFDE0-.LASFDE0\n" - ".LASFDE0:\n" - "\t.4byte .Lframe0\n" - "\t.4byte .Lbegin\n" - "\t.4byte %d\n" - "\t.byte 0xe\n\t.uleb128 %d\n" - "\t.byte 0x9f\n\t.sleb128 1\n" - "\t.byte 0x9e\n\t.sleb128 2\n", - fcofs, CFRAME_SIZE); - for (i = 23; i >= 16; i--) - fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+i, 26-i); - for (i = 30; i >= 20; i -= 2) - fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+32+i, 42-i); - fprintf(ctx->fp, - "\t.align 2\n" - ".LEFDE0:\n\n"); -#if LJ_HASFFI - fprintf(ctx->fp, - ".LSFDE1:\n" - "\t.4byte .LEFDE1-.LASFDE1\n" - ".LASFDE1:\n" - "\t.4byte .Lframe0\n" - "\t.4byte lj_vm_ffi_call\n" - "\t.4byte %d\n" - "\t.byte 0x9f\n\t.uleb128 1\n" - "\t.byte 0x90\n\t.uleb128 2\n" - "\t.byte 0xd\n\t.uleb128 0x10\n" - "\t.align 2\n" - ".LEFDE1:\n\n", (int)ctx->codesz - fcofs); -#endif -#if !LJ_NO_UNWIND - fprintf(ctx->fp, "\t.section .eh_frame,\"aw\",@progbits\n"); - fprintf(ctx->fp, - "\t.globl lj_err_unwind_dwarf\n" - ".Lframe1:\n" - "\t.4byte .LECIE1-.LSCIE1\n" - ".LSCIE1:\n" - "\t.4byte 0\n" - "\t.byte 0x1\n" - "\t.string \"zPR\"\n" - "\t.uleb128 0x1\n" - "\t.sleb128 -4\n" - "\t.byte 31\n" - "\t.uleb128 6\n" /* augmentation length */ - "\t.byte 0\n" - "\t.4byte lj_err_unwind_dwarf\n" - "\t.byte 0\n" - "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 0\n" - "\t.align 2\n" - ".LECIE1:\n\n"); - fprintf(ctx->fp, - ".LSFDE2:\n" - "\t.4byte .LEFDE2-.LASFDE2\n" - ".LASFDE2:\n" - "\t.4byte .LASFDE2-.Lframe1\n" - "\t.4byte .Lbegin\n" - "\t.4byte %d\n" - "\t.uleb128 0\n" /* augmentation length */ - "\t.byte 0xe\n\t.uleb128 %d\n" - "\t.byte 0x9f\n\t.sleb128 1\n" - "\t.byte 0x9e\n\t.sleb128 2\n", - fcofs, CFRAME_SIZE); - for (i = 23; i >= 16; i--) - fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+i, 26-i); - for (i = 30; i >= 20; i -= 2) - fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+32+i, 42-i); - fprintf(ctx->fp, - "\t.align 2\n" - ".LEFDE2:\n\n"); -#if LJ_HASFFI - fprintf(ctx->fp, - ".Lframe2:\n" - "\t.4byte .LECIE2-.LSCIE2\n" - ".LSCIE2:\n" - "\t.4byte 0\n" - "\t.byte 0x1\n" - "\t.string \"zR\"\n" - "\t.uleb128 0x1\n" - "\t.sleb128 -4\n" - "\t.byte 31\n" - "\t.uleb128 1\n" /* augmentation length */ - "\t.byte 0\n" - "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 0\n" - "\t.align 2\n" - ".LECIE2:\n\n"); - fprintf(ctx->fp, - ".LSFDE3:\n" - "\t.4byte .LEFDE3-.LASFDE3\n" - ".LASFDE3:\n" - "\t.4byte .LASFDE3-.Lframe2\n" - "\t.4byte lj_vm_ffi_call\n" - "\t.4byte %d\n" - "\t.uleb128 0\n" /* augmentation length */ - "\t.byte 0x9f\n\t.uleb128 1\n" - "\t.byte 0x90\n\t.uleb128 2\n" - "\t.byte 0xd\n\t.uleb128 0x10\n" - "\t.align 2\n" - ".LEFDE3:\n\n", (int)ctx->codesz - fcofs); -#endif -#endif - break; - default: - break; - } -} - diff --git a/subprojects/luajit/src/vm_ppc.dasc b/subprojects/luajit/src/vm_ppc.dasc deleted file mode 100644 index 91f50037d..000000000 --- a/subprojects/luajit/src/vm_ppc.dasc +++ /dev/null @@ -1,5160 +0,0 @@ -|// Low-level VM code for PowerPC CPUs. -|// Bytecode interpreter, fast functions and helper functions. -|// Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -| -|.arch ppc -|.section code_op, code_sub -| -|.actionlist build_actionlist -|.globals GLOB_ -|.globalnames globnames -|.externnames extnames -| -|// Note: The ragged indentation of the instructions is intentional. -|// The starting columns indicate data dependencies. -| -|//----------------------------------------------------------------------- -| -|// DynASM defines used by the PPC port: -|// -|// P64 64 bit pointers (only for GPR64 testing). -|// Note: a full PPC64 _LP64 port is not planned. -|// GPR64 64 bit registers (but possibly 32 bit pointers, e.g. PS3). -|// Affects reg saves, stack layout, carry/overflow/dot flags etc. -|// FRAME32 Use 32 bit frame layout, even with GPR64 (Xbox 360). -|// TOC Need table of contents (64 bit or 32 bit variant, e.g. PS3). -|// Function pointers are really a struct: code, TOC, env (optional). -|// TOCENV Function pointers have an environment pointer, too (not on PS3). -|// PPE Power Processor Element of Cell (PS3) or Xenon (Xbox 360). -|// Must avoid (slow) micro-coded instructions. -| -|.if P64 -|.define TOC, 1 -|.define TOCENV, 1 -|.macro lpx, a, b, c; ldx a, b, c; .endmacro -|.macro lp, a, b; ld a, b; .endmacro -|.macro stp, a, b; std a, b; .endmacro -|.define decode_OPP, decode_OP8 -|.if FFI -|// Missing: Calling conventions, 64 bit regs, TOC. -|.error lib_ffi not yet implemented for PPC64 -|.endif -|.else -|.macro lpx, a, b, c; lwzx a, b, c; .endmacro -|.macro lp, a, b; lwz a, b; .endmacro -|.macro stp, a, b; stw a, b; .endmacro -|.define decode_OPP, decode_OP4 -|.endif -| -|// Convenience macros for TOC handling. -|.if TOC -|// Linker needs a TOC patch area for every external call relocation. -|.macro blex, target; bl extern target@plt; nop; .endmacro -|.macro .toc, a, b; a, b; .endmacro -|.if P64 -|.define TOC_OFS, 8 -|.define ENV_OFS, 16 -|.else -|.define TOC_OFS, 4 -|.define ENV_OFS, 8 -|.endif -|.else // No TOC. -|.macro blex, target; bl extern target@plt; .endmacro -|.macro .toc, a, b; .endmacro -|.endif -|.macro .tocenv, a, b; .if TOCENV; a, b; .endif; .endmacro -| -|.macro .gpr64, a, b; .if GPR64; a, b; .endif; .endmacro -| -|.macro andix., y, a, i -|.if PPE -| rlwinm y, a, 0, 31-lj_fls(i), 31-lj_ffs(i) -| cmpwi y, 0 -|.else -| andi. y, a, i -|.endif -|.endmacro -| -|.macro clrso, reg -|.if PPE -| li reg, 0 -| mtxer reg -|.else -| mcrxr cr0 -|.endif -|.endmacro -| -|.macro checkov, reg, noov -|.if PPE -| mfxer reg -| add reg, reg, reg -| cmpwi reg, 0 -| li reg, 0 -| mtxer reg -| bgey noov -|.else -| mcrxr cr0 -| bley noov -|.endif -|.endmacro -| -|//----------------------------------------------------------------------- -| -|// Fixed register assignments for the interpreter. -|// Don't use: r1 = sp, r2 and r13 = reserved (TOC, TLS or SDATA) -| -|// The following must be C callee-save (but BASE is often refetched). -|.define BASE, r14 // Base of current Lua stack frame. -|.define KBASE, r15 // Constants of current Lua function. -|.define PC, r16 // Next PC. -|.define DISPATCH, r17 // Opcode dispatch table. -|.define LREG, r18 // Register holding lua_State (also in SAVE_L). -|.define MULTRES, r19 // Size of multi-result: (nresults+1)*8. -|.define JGL, r31 // On-trace: global_State + 32768. -| -|// Constants for type-comparisons, stores and conversions. C callee-save. -|.define TISNUM, r22 -|.define TISNIL, r23 -|.define ZERO, r24 -|.define TOBIT, f30 // 2^52 + 2^51. -|.define TONUM, f31 // 2^52 + 2^51 + 2^31. -| -|// The following temporaries are not saved across C calls, except for RA. -|.define RA, r20 // Callee-save. -|.define RB, r10 -|.define RC, r11 -|.define RD, r12 -|.define INS, r7 // Overlaps CARG5. -| -|.define TMP0, r0 -|.define TMP1, r8 -|.define TMP2, r9 -|.define TMP3, r6 // Overlaps CARG4. -| -|// Saved temporaries. -|.define SAVE0, r21 -| -|// Calling conventions. -|.define CARG1, r3 -|.define CARG2, r4 -|.define CARG3, r5 -|.define CARG4, r6 // Overlaps TMP3. -|.define CARG5, r7 // Overlaps INS. -| -|.define FARG1, f1 -|.define FARG2, f2 -| -|.define CRET1, r3 -|.define CRET2, r4 -| -|.define TOCREG, r2 // TOC register (only used by C code). -|.define ENVREG, r11 // Environment pointer (nested C functions). -| -|// Stack layout while in interpreter. Must match with lj_frame.h. -|.if GPR64 -|.if FRAME32 -| -|// 456(sp) // \ 32/64 bit C frame info -|.define TONUM_LO, 452(sp) // | -|.define TONUM_HI, 448(sp) // | -|.define TMPD_LO, 444(sp) // | -|.define TMPD_HI, 440(sp) // | -|.define SAVE_CR, 432(sp) // | 64 bit CR save. -|.define SAVE_ERRF, 424(sp) // > Parameter save area. -|.define SAVE_NRES, 420(sp) // | -|.define SAVE_L, 416(sp) // | -|.define SAVE_PC, 412(sp) // | -|.define SAVE_MULTRES, 408(sp) // | -|.define SAVE_CFRAME, 400(sp) // / 64 bit C frame chain. -|// 392(sp) // Reserved. -|.define CFRAME_SPACE, 384 // Delta for sp. -|// Back chain for sp: 384(sp) <-- sp entering interpreter -|.define SAVE_LR, 376(sp) // 32 bit LR stored in hi-part. -|.define SAVE_GPR_, 232 // .. 232+18*8: 64 bit GPR saves. -|.define SAVE_FPR_, 88 // .. 88+18*8: 64 bit FPR saves. -|// 80(sp) // Needed for 16 byte stack frame alignment. -|// 16(sp) // Callee parameter save area (ABI mandated). -|// 8(sp) // Reserved -|// Back chain for sp: 0(sp) <-- sp while in interpreter -|// 32 bit sp stored in hi-part of 0(sp). -| -|.define TMPD_BLO, 447(sp) -|.define TMPD, TMPD_HI -|.define TONUM_D, TONUM_HI -| -|.else -| -|// 508(sp) // \ 32 bit C frame info. -|.define SAVE_ERRF, 472(sp) // | -|.define SAVE_NRES, 468(sp) // | -|.define SAVE_L, 464(sp) // > Parameter save area. -|.define SAVE_PC, 460(sp) // | -|.define SAVE_MULTRES, 456(sp) // | -|.define SAVE_CFRAME, 448(sp) // / 64 bit C frame chain. -|.define SAVE_LR, 416(sp) -|.define CFRAME_SPACE, 400 // Delta for sp. -|// Back chain for sp: 400(sp) <-- sp entering interpreter -|.define SAVE_FPR_, 256 // .. 256+18*8: 64 bit FPR saves. -|.define SAVE_GPR_, 112 // .. 112+18*8: 64 bit GPR saves. -|// 48(sp) // Callee parameter save area (ABI mandated). -|.define SAVE_TOC, 40(sp) // TOC save area. -|.define TMPD_LO, 36(sp) // \ Link editor temp (ABI mandated). -|.define TMPD_HI, 32(sp) // / -|.define TONUM_LO, 28(sp) // \ Compiler temp (ABI mandated). -|.define TONUM_HI, 24(sp) // / -|// Next frame lr: 16(sp) -|.define SAVE_CR, 8(sp) // 64 bit CR save. -|// Back chain for sp: 0(sp) <-- sp while in interpreter -| -|.define TMPD_BLO, 39(sp) -|.define TMPD, TMPD_HI -|.define TONUM_D, TONUM_HI -| -|.endif -|.else -| -|.define SAVE_LR, 276(sp) -|.define CFRAME_SPACE, 272 // Delta for sp. -|// Back chain for sp: 272(sp) <-- sp entering interpreter -|.define SAVE_FPR_, 128 // .. 128+18*8: 64 bit FPR saves. -|.define SAVE_GPR_, 56 // .. 56+18*4: 32 bit GPR saves. -|.define SAVE_CR, 52(sp) // 32 bit CR save. -|.define SAVE_ERRF, 48(sp) // 32 bit C frame info. -|.define SAVE_NRES, 44(sp) -|.define SAVE_CFRAME, 40(sp) -|.define SAVE_L, 36(sp) -|.define SAVE_PC, 32(sp) -|.define SAVE_MULTRES, 28(sp) -|.define UNUSED1, 24(sp) -|.define TMPD_LO, 20(sp) -|.define TMPD_HI, 16(sp) -|.define TONUM_LO, 12(sp) -|.define TONUM_HI, 8(sp) -|// Next frame lr: 4(sp) -|// Back chain for sp: 0(sp) <-- sp while in interpreter -| -|.define TMPD_BLO, 23(sp) -|.define TMPD, TMPD_HI -|.define TONUM_D, TONUM_HI -| -|.endif -| -|.macro save_, reg -|.if GPR64 -| std r..reg, SAVE_GPR_+(reg-14)*8(sp) -|.else -| stw r..reg, SAVE_GPR_+(reg-14)*4(sp) -|.endif -| stfd f..reg, SAVE_FPR_+(reg-14)*8(sp) -|.endmacro -|.macro rest_, reg -|.if GPR64 -| ld r..reg, SAVE_GPR_+(reg-14)*8(sp) -|.else -| lwz r..reg, SAVE_GPR_+(reg-14)*4(sp) -|.endif -| lfd f..reg, SAVE_FPR_+(reg-14)*8(sp) -|.endmacro -| -|.macro saveregs -|.if GPR64 and not FRAME32 -| stdu sp, -CFRAME_SPACE(sp) -|.else -| stwu sp, -CFRAME_SPACE(sp) -|.endif -| save_ 14; save_ 15; save_ 16 -| mflr r0 -| save_ 17; save_ 18; save_ 19; save_ 20; save_ 21; save_ 22 -|.if GPR64 and not FRAME32 -| std r0, SAVE_LR -|.else -| stw r0, SAVE_LR -|.endif -| save_ 23; save_ 24; save_ 25 -| mfcr r0 -| save_ 26; save_ 27; save_ 28; save_ 29; save_ 30; save_ 31 -|.if GPR64 -| std r0, SAVE_CR -|.else -| stw r0, SAVE_CR -|.endif -| .toc std TOCREG, SAVE_TOC -|.endmacro -| -|.macro restoreregs -|.if GPR64 and not FRAME32 -| ld r0, SAVE_LR -|.else -| lwz r0, SAVE_LR -|.endif -|.if GPR64 -| ld r12, SAVE_CR -|.else -| lwz r12, SAVE_CR -|.endif -| rest_ 14; rest_ 15; rest_ 16; rest_ 17; rest_ 18; rest_ 19 -| mtlr r0; -|.if PPE; mtocrf 0x20, r12; .else; mtcrf 0x38, r12; .endif -| rest_ 20; rest_ 21; rest_ 22; rest_ 23; rest_ 24; rest_ 25 -|.if PPE; mtocrf 0x10, r12; .endif -| rest_ 26; rest_ 27; rest_ 28; rest_ 29; rest_ 30; rest_ 31 -|.if PPE; mtocrf 0x08, r12; .endif -| addi sp, sp, CFRAME_SPACE -|.endmacro -| -|// Type definitions. Some of these are only used for documentation. -|.type L, lua_State, LREG -|.type GL, global_State -|.type TVALUE, TValue -|.type GCOBJ, GCobj -|.type STR, GCstr -|.type TAB, GCtab -|.type LFUNC, GCfuncL -|.type CFUNC, GCfuncC -|.type PROTO, GCproto -|.type UPVAL, GCupval -|.type NODE, Node -|.type NARGS8, int -|.type TRACE, GCtrace -| -|//----------------------------------------------------------------------- -| -|// These basic macros should really be part of DynASM. -|.macro srwi, rx, ry, n; rlwinm rx, ry, 32-n, n, 31; .endmacro -|.macro slwi, rx, ry, n; rlwinm rx, ry, n, 0, 31-n; .endmacro -|.macro rotlwi, rx, ry, n; rlwinm rx, ry, n, 0, 31; .endmacro -|.macro rotlw, rx, ry, rn; rlwnm rx, ry, rn, 0, 31; .endmacro -|.macro subi, rx, ry, i; addi rx, ry, -i; .endmacro -| -|// Trap for not-yet-implemented parts. -|.macro NYI; tw 4, sp, sp; .endmacro -| -|// int/FP conversions. -|.macro tonum_i, freg, reg -| xoris reg, reg, 0x8000 -| stw reg, TONUM_LO -| lfd freg, TONUM_D -| fsub freg, freg, TONUM -|.endmacro -| -|.macro tonum_u, freg, reg -| stw reg, TONUM_LO -| lfd freg, TONUM_D -| fsub freg, freg, TOBIT -|.endmacro -| -|.macro toint, reg, freg, tmpfreg -| fctiwz tmpfreg, freg -| stfd tmpfreg, TMPD -| lwz reg, TMPD_LO -|.endmacro -| -|.macro toint, reg, freg -| toint reg, freg, freg -|.endmacro -| -|//----------------------------------------------------------------------- -| -|// Access to frame relative to BASE. -|.define FRAME_PC, -8 -|.define FRAME_FUNC, -4 -| -|// Instruction decode. -|.macro decode_OP4, dst, ins; rlwinm dst, ins, 2, 22, 29; .endmacro -|.macro decode_OP8, dst, ins; rlwinm dst, ins, 3, 21, 28; .endmacro -|.macro decode_RA8, dst, ins; rlwinm dst, ins, 27, 21, 28; .endmacro -|.macro decode_RB8, dst, ins; rlwinm dst, ins, 11, 21, 28; .endmacro -|.macro decode_RC8, dst, ins; rlwinm dst, ins, 19, 21, 28; .endmacro -|.macro decode_RD8, dst, ins; rlwinm dst, ins, 19, 13, 28; .endmacro -| -|.macro decode_OP1, dst, ins; rlwinm dst, ins, 0, 24, 31; .endmacro -|.macro decode_RD4, dst, ins; rlwinm dst, ins, 18, 14, 29; .endmacro -| -|// Instruction fetch. -|.macro ins_NEXT1 -| lwz INS, 0(PC) -| addi PC, PC, 4 -|.endmacro -|// Instruction decode+dispatch. Note: optimized for e300! -|.macro ins_NEXT2 -| decode_OPP TMP1, INS -| lpx TMP0, DISPATCH, TMP1 -| mtctr TMP0 -| decode_RB8 RB, INS -| decode_RD8 RD, INS -| decode_RA8 RA, INS -| decode_RC8 RC, INS -| bctr -|.endmacro -|.macro ins_NEXT -| ins_NEXT1 -| ins_NEXT2 -|.endmacro -| -|// Instruction footer. -|.if 1 -| // Replicated dispatch. Less unpredictable branches, but higher I-Cache use. -| .define ins_next, ins_NEXT -| .define ins_next_, ins_NEXT -| .define ins_next1, ins_NEXT1 -| .define ins_next2, ins_NEXT2 -|.else -| // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch. -| // Affects only certain kinds of benchmarks (and only with -j off). -| .macro ins_next -| b ->ins_next -| .endmacro -| .macro ins_next1 -| .endmacro -| .macro ins_next2 -| b ->ins_next -| .endmacro -| .macro ins_next_ -| ->ins_next: -| ins_NEXT -| .endmacro -|.endif -| -|// Call decode and dispatch. -|.macro ins_callt -| // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC -| lwz PC, LFUNC:RB->pc -| lwz INS, 0(PC) -| addi PC, PC, 4 -| decode_OPP TMP1, INS -| decode_RA8 RA, INS -| lpx TMP0, DISPATCH, TMP1 -| add RA, RA, BASE -| mtctr TMP0 -| bctr -|.endmacro -| -|.macro ins_call -| // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, PC = caller PC -| stw PC, FRAME_PC(BASE) -| ins_callt -|.endmacro -| -|//----------------------------------------------------------------------- -| -|// Macros to test operand types. -|.macro checknum, reg; cmplw reg, TISNUM; .endmacro -|.macro checknum, cr, reg; cmplw cr, reg, TISNUM; .endmacro -|.macro checkstr, reg; cmpwi reg, LJ_TSTR; .endmacro -|.macro checktab, reg; cmpwi reg, LJ_TTAB; .endmacro -|.macro checkfunc, reg; cmpwi reg, LJ_TFUNC; .endmacro -|.macro checknil, reg; cmpwi reg, LJ_TNIL; .endmacro -| -|.macro branch_RD -| srwi TMP0, RD, 1 -| addis PC, PC, -(BCBIAS_J*4 >> 16) -| add PC, PC, TMP0 -|.endmacro -| -|// Assumes DISPATCH is relative to GL. -#define DISPATCH_GL(field) (GG_DISP2G + (int)offsetof(global_State, field)) -#define DISPATCH_J(field) (GG_DISP2J + (int)offsetof(jit_State, field)) -| -#define PC2PROTO(field) ((int)offsetof(GCproto, field)-(int)sizeof(GCproto)) -| -|.macro hotcheck, delta, target -| rlwinm TMP1, PC, 31, 25, 30 -| addi TMP1, TMP1, GG_DISP2HOT -| lhzx TMP2, DISPATCH, TMP1 -| addic. TMP2, TMP2, -delta -| sthx TMP2, DISPATCH, TMP1 -| blt target -|.endmacro -| -|.macro hotloop -| hotcheck HOTCOUNT_LOOP, ->vm_hotloop -|.endmacro -| -|.macro hotcall -| hotcheck HOTCOUNT_CALL, ->vm_hotcall -|.endmacro -| -|// Set current VM state. Uses TMP0. -|.macro li_vmstate, st; li TMP0, ~LJ_VMST_..st; .endmacro -|.macro st_vmstate; stw TMP0, DISPATCH_GL(vmstate)(DISPATCH); .endmacro -| -|// Move table write barrier back. Overwrites mark and tmp. -|.macro barrierback, tab, mark, tmp -| lwz tmp, DISPATCH_GL(gc.grayagain)(DISPATCH) -| // Assumes LJ_GC_BLACK is 0x04. -| rlwinm mark, mark, 0, 30, 28 // black2gray(tab) -| stw tab, DISPATCH_GL(gc.grayagain)(DISPATCH) -| stb mark, tab->marked -| stw tmp, tab->gclist -|.endmacro -| -|//----------------------------------------------------------------------- - -/* Generate subroutines used by opcodes and other parts of the VM. */ -/* The .code_sub section should be last to help static branch prediction. */ -static void build_subroutines(BuildCtx *ctx) -{ - |.code_sub - | - |//----------------------------------------------------------------------- - |//-- Return handling ---------------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_returnp: - | // See vm_return. Also: TMP2 = previous base. - | andix. TMP0, PC, FRAME_P - | li TMP1, LJ_TTRUE - | beq ->cont_dispatch - | - | // Return from pcall or xpcall fast func. - | lwz PC, FRAME_PC(TMP2) // Fetch PC of previous frame. - | mr BASE, TMP2 // Restore caller base. - | // Prepending may overwrite the pcall frame, so do it at the end. - | stwu TMP1, FRAME_PC(RA) // Prepend true to results. - | - |->vm_returnc: - | addi RD, RD, 8 // RD = (nresults+1)*8. - | andix. TMP0, PC, FRAME_TYPE - | cmpwi cr1, RD, 0 - | li CRET1, LUA_YIELD - | beq cr1, ->vm_unwind_c_eh - | mr MULTRES, RD - | beq ->BC_RET_Z // Handle regular return to Lua. - | - |->vm_return: - | // BASE = base, RA = resultptr, RD/MULTRES = (nresults+1)*8, PC = return - | // TMP0 = PC & FRAME_TYPE - | cmpwi TMP0, FRAME_C - | rlwinm TMP2, PC, 0, 0, 28 - | li_vmstate C - | sub TMP2, BASE, TMP2 // TMP2 = previous base. - | bney ->vm_returnp - | - | addic. TMP1, RD, -8 - | stp TMP2, L->base - | lwz TMP2, SAVE_NRES - | subi BASE, BASE, 8 - | st_vmstate - | slwi TMP2, TMP2, 3 - | beq >2 - |1: - | addic. TMP1, TMP1, -8 - | lfd f0, 0(RA) - | addi RA, RA, 8 - | stfd f0, 0(BASE) - | addi BASE, BASE, 8 - | bney <1 - | - |2: - | cmpw TMP2, RD // More/less results wanted? - | bne >6 - |3: - | stp BASE, L->top // Store new top. - | - |->vm_leave_cp: - | lp TMP0, SAVE_CFRAME // Restore previous C frame. - | li CRET1, 0 // Ok return status for vm_pcall. - | stp TMP0, L->cframe - | - |->vm_leave_unw: - | restoreregs - | blr - | - |6: - | ble >7 // Less results wanted? - | // More results wanted. Check stack size and fill up results with nil. - | lwz TMP1, L->maxstack - | cmplw BASE, TMP1 - | bge >8 - | stw TISNIL, 0(BASE) - | addi RD, RD, 8 - | addi BASE, BASE, 8 - | b <2 - | - |7: // Less results wanted. - | subfic TMP3, TMP2, 0 // LUA_MULTRET+1 case? - | sub TMP0, RD, TMP2 - | subfe TMP1, TMP1, TMP1 // TMP1 = TMP2 == 0 ? 0 : -1 - | and TMP0, TMP0, TMP1 - | sub BASE, BASE, TMP0 // Either keep top or shrink it. - | b <3 - | - |8: // Corner case: need to grow stack for filling up results. - | // This can happen if: - | // - A C function grows the stack (a lot). - | // - The GC shrinks the stack in between. - | // - A return back from a lua_call() with (high) nresults adjustment. - | stp BASE, L->top // Save current top held in BASE (yes). - | mr SAVE0, RD - | srwi CARG2, TMP2, 3 - | mr CARG1, L - | bl extern lj_state_growstack // (lua_State *L, int n) - | lwz TMP2, SAVE_NRES - | mr RD, SAVE0 - | slwi TMP2, TMP2, 3 - | lp BASE, L->top // Need the (realloced) L->top in BASE. - | b <2 - | - |->vm_unwind_c: // Unwind C stack, return from vm_pcall. - | // (void *cframe, int errcode) - | mr sp, CARG1 - | mr CRET1, CARG2 - |->vm_unwind_c_eh: // Landing pad for external unwinder. - | lwz L, SAVE_L - | .toc ld TOCREG, SAVE_TOC - | li TMP0, ~LJ_VMST_C - | lwz GL:TMP1, L->glref - | stw TMP0, GL:TMP1->vmstate - | b ->vm_leave_unw - | - |->vm_unwind_ff: // Unwind C stack, return from ff pcall. - | // (void *cframe) - |.if GPR64 - | rldicr sp, CARG1, 0, 61 - |.else - | rlwinm sp, CARG1, 0, 0, 29 - |.endif - |->vm_unwind_ff_eh: // Landing pad for external unwinder. - | lwz L, SAVE_L - | .toc ld TOCREG, SAVE_TOC - | li TISNUM, LJ_TISNUM // Setup type comparison constants. - | lp BASE, L->base - | lus TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). - | lwz DISPATCH, L->glref // Setup pointer to dispatch table. - | li ZERO, 0 - | stw TMP3, TMPD - | li TMP1, LJ_TFALSE - | ori TMP3, TMP3, 0x0004 // TONUM = 2^52 + 2^51 + 2^31 (float). - | li TISNIL, LJ_TNIL - | li_vmstate INTERP - | lfs TOBIT, TMPD - | lwz PC, FRAME_PC(BASE) // Fetch PC of previous frame. - | la RA, -8(BASE) // Results start at BASE-8. - | stw TMP3, TMPD - | addi DISPATCH, DISPATCH, GG_G2DISP - | stw TMP1, 0(RA) // Prepend false to error message. - | li RD, 16 // 2 results: false + error message. - | st_vmstate - | lfs TONUM, TMPD - | b ->vm_returnc - | - |//----------------------------------------------------------------------- - |//-- Grow stack for calls ----------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_growstack_c: // Grow stack for C function. - | li CARG2, LUA_MINSTACK - | b >2 - | - |->vm_growstack_l: // Grow stack for Lua function. - | // BASE = new base, RA = BASE+framesize*8, RC = nargs*8, PC = first PC - | add RC, BASE, RC - | sub RA, RA, BASE - | stp BASE, L->base - | addi PC, PC, 4 // Must point after first instruction. - | stp RC, L->top - | srwi CARG2, RA, 3 - |2: - | // L->base = new base, L->top = top - | stw PC, SAVE_PC - | mr CARG1, L - | bl extern lj_state_growstack // (lua_State *L, int n) - | lp BASE, L->base - | lp RC, L->top - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | sub RC, RC, BASE - | // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC - | ins_callt // Just retry the call. - | - |//----------------------------------------------------------------------- - |//-- Entry points into the assembler VM --------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_resume: // Setup C frame and resume thread. - | // (lua_State *L, TValue *base, int nres1 = 0, ptrdiff_t ef = 0) - | saveregs - | mr L, CARG1 - | lwz DISPATCH, L->glref // Setup pointer to dispatch table. - | mr BASE, CARG2 - | lbz TMP1, L->status - | stw L, SAVE_L - | li PC, FRAME_CP - | addi TMP0, sp, CFRAME_RESUME - | addi DISPATCH, DISPATCH, GG_G2DISP - | stw CARG3, SAVE_NRES - | cmplwi TMP1, 0 - | stw CARG3, SAVE_ERRF - | stp TMP0, L->cframe - | stp CARG3, SAVE_CFRAME - | stw CARG1, SAVE_PC // Any value outside of bytecode is ok. - | beq >3 - | - | // Resume after yield (like a return). - | mr RA, BASE - | lp BASE, L->base - | li TISNUM, LJ_TISNUM // Setup type comparison constants. - | lp TMP1, L->top - | lwz PC, FRAME_PC(BASE) - | lus TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). - | stb CARG3, L->status - | stw TMP3, TMPD - | ori TMP3, TMP3, 0x0004 // TONUM = 2^52 + 2^51 + 2^31 (float). - | lfs TOBIT, TMPD - | sub RD, TMP1, BASE - | stw TMP3, TMPD - | lus TMP0, 0x4338 // Hiword of 2^52 + 2^51 (double) - | addi RD, RD, 8 - | stw TMP0, TONUM_HI - | li_vmstate INTERP - | li ZERO, 0 - | st_vmstate - | andix. TMP0, PC, FRAME_TYPE - | mr MULTRES, RD - | lfs TONUM, TMPD - | li TISNIL, LJ_TNIL - | beq ->BC_RET_Z - | b ->vm_return - | - |->vm_pcall: // Setup protected C frame and enter VM. - | // (lua_State *L, TValue *base, int nres1, ptrdiff_t ef) - | saveregs - | li PC, FRAME_CP - | stw CARG4, SAVE_ERRF - | b >1 - | - |->vm_call: // Setup C frame and enter VM. - | // (lua_State *L, TValue *base, int nres1) - | saveregs - | li PC, FRAME_C - | - |1: // Entry point for vm_pcall above (PC = ftype). - | lp TMP1, L:CARG1->cframe - | stw CARG3, SAVE_NRES - | mr L, CARG1 - | stw CARG1, SAVE_L - | mr BASE, CARG2 - | stp sp, L->cframe // Add our C frame to cframe chain. - | lwz DISPATCH, L->glref // Setup pointer to dispatch table. - | stw CARG1, SAVE_PC // Any value outside of bytecode is ok. - | stp TMP1, SAVE_CFRAME - | addi DISPATCH, DISPATCH, GG_G2DISP - | - |3: // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype). - | lp TMP2, L->base // TMP2 = old base (used in vmeta_call). - | li TISNUM, LJ_TISNUM // Setup type comparison constants. - | lp TMP1, L->top - | lus TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). - | add PC, PC, BASE - | stw TMP3, TMPD - | li ZERO, 0 - | ori TMP3, TMP3, 0x0004 // TONUM = 2^52 + 2^51 + 2^31 (float). - | lfs TOBIT, TMPD - | sub PC, PC, TMP2 // PC = frame delta + frame type - | stw TMP3, TMPD - | lus TMP0, 0x4338 // Hiword of 2^52 + 2^51 (double) - | sub NARGS8:RC, TMP1, BASE - | stw TMP0, TONUM_HI - | li_vmstate INTERP - | lfs TONUM, TMPD - | li TISNIL, LJ_TNIL - | st_vmstate - | - |->vm_call_dispatch: - | // TMP2 = old base, BASE = new base, RC = nargs*8, PC = caller PC - | lwz TMP0, FRAME_PC(BASE) - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | checkfunc TMP0; bne ->vmeta_call - | - |->vm_call_dispatch_f: - | ins_call - | // BASE = new base, RB = func, RC = nargs*8, PC = caller PC - | - |->vm_cpcall: // Setup protected C frame, call C. - | // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp) - | saveregs - | mr L, CARG1 - | lwz TMP0, L:CARG1->stack - | stw CARG1, SAVE_L - | lp TMP1, L->top - | stw CARG1, SAVE_PC // Any value outside of bytecode is ok. - | sub TMP0, TMP0, TMP1 // Compute -savestack(L, L->top). - | lp TMP1, L->cframe - | stp sp, L->cframe // Add our C frame to cframe chain. - | .toc lp CARG4, 0(CARG4) - | li TMP2, 0 - | stw TMP0, SAVE_NRES // Neg. delta means cframe w/o frame. - | stw TMP2, SAVE_ERRF // No error function. - | stp TMP1, SAVE_CFRAME - | mtctr CARG4 - | bctrl // (lua_State *L, lua_CFunction func, void *ud) - |.if PPE - | mr BASE, CRET1 - | cmpwi CRET1, 0 - |.else - | mr. BASE, CRET1 - |.endif - | lwz DISPATCH, L->glref // Setup pointer to dispatch table. - | li PC, FRAME_CP - | addi DISPATCH, DISPATCH, GG_G2DISP - | bne <3 // Else continue with the call. - | b ->vm_leave_cp // No base? Just remove C frame. - | - |//----------------------------------------------------------------------- - |//-- Metamethod handling ------------------------------------------------ - |//----------------------------------------------------------------------- - | - |// The lj_meta_* functions (except for lj_meta_cat) don't reallocate the - |// stack, so BASE doesn't need to be reloaded across these calls. - | - |//-- Continuation dispatch ---------------------------------------------- - | - |->cont_dispatch: - | // BASE = meta base, RA = resultptr, RD = (nresults+1)*8 - | lwz TMP0, -12(BASE) // Continuation. - | mr RB, BASE - | mr BASE, TMP2 // Restore caller BASE. - | lwz LFUNC:TMP1, FRAME_FUNC(TMP2) - |.if FFI - | cmplwi TMP0, 1 - |.endif - | lwz PC, -16(RB) // Restore PC from [cont|PC]. - | subi TMP2, RD, 8 - | lwz TMP1, LFUNC:TMP1->pc - | stwx TISNIL, RA, TMP2 // Ensure one valid arg. - |.if FFI - | ble >1 - |.endif - | lwz KBASE, PC2PROTO(k)(TMP1) - | // BASE = base, RA = resultptr, RB = meta base - | mtctr TMP0 - | bctr // Jump to continuation. - | - |.if FFI - |1: - | beq ->cont_ffi_callback // cont = 1: return from FFI callback. - | // cont = 0: tailcall from C function. - | subi TMP1, RB, 16 - | sub RC, TMP1, BASE - | b ->vm_call_tail - |.endif - | - |->cont_cat: // RA = resultptr, RB = meta base - | lwz INS, -4(PC) - | subi CARG2, RB, 16 - | decode_RB8 SAVE0, INS - | lfd f0, 0(RA) - | add TMP1, BASE, SAVE0 - | stp BASE, L->base - | cmplw TMP1, CARG2 - | sub CARG3, CARG2, TMP1 - | decode_RA8 RA, INS - | stfd f0, 0(CARG2) - | bney ->BC_CAT_Z - | stfdx f0, BASE, RA - | b ->cont_nop - | - |//-- Table indexing metamethods ----------------------------------------- - | - |->vmeta_tgets1: - | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) - | li TMP0, LJ_TSTR - | decode_RB8 RB, INS - | stw STR:RC, 4(CARG3) - | add CARG2, BASE, RB - | stw TMP0, 0(CARG3) - | b >1 - | - |->vmeta_tgets: - | la CARG2, DISPATCH_GL(tmptv)(DISPATCH) - | li TMP0, LJ_TTAB - | stw TAB:RB, 4(CARG2) - | la CARG3, DISPATCH_GL(tmptv2)(DISPATCH) - | stw TMP0, 0(CARG2) - | li TMP1, LJ_TSTR - | stw STR:RC, 4(CARG3) - | stw TMP1, 0(CARG3) - | b >1 - | - |->vmeta_tgetb: // TMP0 = index - |.if not DUALNUM - | tonum_u f0, TMP0 - |.endif - | decode_RB8 RB, INS - | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) - | add CARG2, BASE, RB - |.if DUALNUM - | stw TISNUM, 0(CARG3) - | stw TMP0, 4(CARG3) - |.else - | stfd f0, 0(CARG3) - |.endif - | b >1 - | - |->vmeta_tgetv: - | decode_RB8 RB, INS - | decode_RC8 RC, INS - | add CARG2, BASE, RB - | add CARG3, BASE, RC - |1: - | stp BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | bl extern lj_meta_tget // (lua_State *L, TValue *o, TValue *k) - | // Returns TValue * (finished) or NULL (metamethod). - | cmplwi CRET1, 0 - | beq >3 - | lfd f0, 0(CRET1) - | ins_next1 - | stfdx f0, BASE, RA - | ins_next2 - | - |3: // Call __index metamethod. - | // BASE = base, L->top = new base, stack = cont/func/t/k - | subfic TMP1, BASE, FRAME_CONT - | lp BASE, L->top - | stw PC, -16(BASE) // [cont|PC] - | add PC, TMP1, BASE - | lwz LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here. - | li NARGS8:RC, 16 // 2 args for func(t, k). - | b ->vm_call_dispatch_f - | - |//----------------------------------------------------------------------- - | - |->vmeta_tsets1: - | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) - | li TMP0, LJ_TSTR - | decode_RB8 RB, INS - | stw STR:RC, 4(CARG3) - | add CARG2, BASE, RB - | stw TMP0, 0(CARG3) - | b >1 - | - |->vmeta_tsets: - | la CARG2, DISPATCH_GL(tmptv)(DISPATCH) - | li TMP0, LJ_TTAB - | stw TAB:RB, 4(CARG2) - | la CARG3, DISPATCH_GL(tmptv2)(DISPATCH) - | stw TMP0, 0(CARG2) - | li TMP1, LJ_TSTR - | stw STR:RC, 4(CARG3) - | stw TMP1, 0(CARG3) - | b >1 - | - |->vmeta_tsetb: // TMP0 = index - |.if not DUALNUM - | tonum_u f0, TMP0 - |.endif - | decode_RB8 RB, INS - | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) - | add CARG2, BASE, RB - |.if DUALNUM - | stw TISNUM, 0(CARG3) - | stw TMP0, 4(CARG3) - |.else - | stfd f0, 0(CARG3) - |.endif - | b >1 - | - |->vmeta_tsetv: - | decode_RB8 RB, INS - | decode_RC8 RC, INS - | add CARG2, BASE, RB - | add CARG3, BASE, RC - |1: - | stp BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | bl extern lj_meta_tset // (lua_State *L, TValue *o, TValue *k) - | // Returns TValue * (finished) or NULL (metamethod). - | cmplwi CRET1, 0 - | lfdx f0, BASE, RA - | beq >3 - | // NOBARRIER: lj_meta_tset ensures the table is not black. - | ins_next1 - | stfd f0, 0(CRET1) - | ins_next2 - | - |3: // Call __newindex metamethod. - | // BASE = base, L->top = new base, stack = cont/func/t/k/(v) - | subfic TMP1, BASE, FRAME_CONT - | lp BASE, L->top - | stw PC, -16(BASE) // [cont|PC] - | add PC, TMP1, BASE - | lwz LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here. - | li NARGS8:RC, 24 // 3 args for func(t, k, v) - | stfd f0, 16(BASE) // Copy value to third argument. - | b ->vm_call_dispatch_f - | - |//-- Comparison metamethods --------------------------------------------- - | - |->vmeta_comp: - | mr CARG1, L - | subi PC, PC, 4 - |.if DUALNUM - | mr CARG2, RA - |.else - | add CARG2, BASE, RA - |.endif - | stw PC, SAVE_PC - |.if DUALNUM - | mr CARG3, RD - |.else - | add CARG3, BASE, RD - |.endif - | stp BASE, L->base - | decode_OP1 CARG4, INS - | bl extern lj_meta_comp // (lua_State *L, TValue *o1, *o2, int op) - | // Returns 0/1 or TValue * (metamethod). - |3: - | cmplwi CRET1, 1 - | bgt ->vmeta_binop - | subfic CRET1, CRET1, 0 - |4: - | lwz INS, 0(PC) - | addi PC, PC, 4 - | decode_RD4 TMP2, INS - | addis TMP2, TMP2, -(BCBIAS_J*4 >> 16) - | and TMP2, TMP2, CRET1 - | add PC, PC, TMP2 - |->cont_nop: - | ins_next - | - |->cont_ra: // RA = resultptr - | lwz INS, -4(PC) - | lfd f0, 0(RA) - | decode_RA8 TMP1, INS - | stfdx f0, BASE, TMP1 - | b ->cont_nop - | - |->cont_condt: // RA = resultptr - | lwz TMP0, 0(RA) - | .gpr64 extsw TMP0, TMP0 - | subfic TMP0, TMP0, LJ_TTRUE // Branch if result is true. - | subfe CRET1, CRET1, CRET1 - | not CRET1, CRET1 - | b <4 - | - |->cont_condf: // RA = resultptr - | lwz TMP0, 0(RA) - | .gpr64 extsw TMP0, TMP0 - | subfic TMP0, TMP0, LJ_TTRUE // Branch if result is false. - | subfe CRET1, CRET1, CRET1 - | b <4 - | - |->vmeta_equal: - | // CARG2, CARG3, CARG4 are already set by BC_ISEQV/BC_ISNEV. - | subi PC, PC, 4 - | stp BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | bl extern lj_meta_equal // (lua_State *L, GCobj *o1, *o2, int ne) - | // Returns 0/1 or TValue * (metamethod). - | b <3 - | - |->vmeta_equal_cd: - |.if FFI - | mr CARG2, INS - | subi PC, PC, 4 - | stp BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | bl extern lj_meta_equal_cd // (lua_State *L, BCIns op) - | // Returns 0/1 or TValue * (metamethod). - | b <3 - |.endif - | - |//-- Arithmetic metamethods --------------------------------------------- - | - |->vmeta_arith_nv: - | add CARG3, KBASE, RC - | add CARG4, BASE, RB - | b >1 - |->vmeta_arith_nv2: - |.if DUALNUM - | mr CARG3, RC - | mr CARG4, RB - | b >1 - |.endif - | - |->vmeta_unm: - | mr CARG3, RD - | mr CARG4, RD - | b >1 - | - |->vmeta_arith_vn: - | add CARG3, BASE, RB - | add CARG4, KBASE, RC - | b >1 - | - |->vmeta_arith_vv: - | add CARG3, BASE, RB - | add CARG4, BASE, RC - |.if DUALNUM - | b >1 - |.endif - |->vmeta_arith_vn2: - |->vmeta_arith_vv2: - |.if DUALNUM - | mr CARG3, RB - | mr CARG4, RC - |.endif - |1: - | add CARG2, BASE, RA - | stp BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | decode_OP1 CARG5, INS // Caveat: CARG5 overlaps INS. - | bl extern lj_meta_arith // (lua_State *L, TValue *ra,*rb,*rc, BCReg op) - | // Returns NULL (finished) or TValue * (metamethod). - | cmplwi CRET1, 0 - | beq ->cont_nop - | - | // Call metamethod for binary op. - |->vmeta_binop: - | // BASE = old base, CRET1 = new base, stack = cont/func/o1/o2 - | sub TMP1, CRET1, BASE - | stw PC, -16(CRET1) // [cont|PC] - | mr TMP2, BASE - | addi PC, TMP1, FRAME_CONT - | mr BASE, CRET1 - | li NARGS8:RC, 16 // 2 args for func(o1, o2). - | b ->vm_call_dispatch - | - |->vmeta_len: -#if LJ_52 - | mr SAVE0, CARG1 -#endif - | mr CARG2, RD - | stp BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | bl extern lj_meta_len // (lua_State *L, TValue *o) - | // Returns NULL (retry) or TValue * (metamethod base). -#if LJ_52 - | cmplwi CRET1, 0 - | bne ->vmeta_binop // Binop call for compatibility. - | mr CARG1, SAVE0 - | b ->BC_LEN_Z -#else - | b ->vmeta_binop // Binop call for compatibility. -#endif - | - |//-- Call metamethod ---------------------------------------------------- - | - |->vmeta_call: // Resolve and call __call metamethod. - | // TMP2 = old base, BASE = new base, RC = nargs*8 - | mr CARG1, L - | stp TMP2, L->base // This is the callers base! - | subi CARG2, BASE, 8 - | stw PC, SAVE_PC - | add CARG3, BASE, RC - | mr SAVE0, NARGS8:RC - | bl extern lj_meta_call // (lua_State *L, TValue *func, TValue *top) - | lwz LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here. - | addi NARGS8:RC, SAVE0, 8 // Got one more argument now. - | ins_call - | - |->vmeta_callt: // Resolve __call for BC_CALLT. - | // BASE = old base, RA = new base, RC = nargs*8 - | mr CARG1, L - | stp BASE, L->base - | subi CARG2, RA, 8 - | stw PC, SAVE_PC - | add CARG3, RA, RC - | mr SAVE0, NARGS8:RC - | bl extern lj_meta_call // (lua_State *L, TValue *func, TValue *top) - | lwz TMP1, FRAME_PC(BASE) - | addi NARGS8:RC, SAVE0, 8 // Got one more argument now. - | lwz LFUNC:RB, FRAME_FUNC(RA) // Guaranteed to be a function here. - | b ->BC_CALLT_Z - | - |//-- Argument coercion for 'for' statement ------------------------------ - | - |->vmeta_for: - | mr CARG1, L - | stp BASE, L->base - | mr CARG2, RA - | stw PC, SAVE_PC - | mr SAVE0, INS - | bl extern lj_meta_for // (lua_State *L, TValue *base) - |.if JIT - | decode_OP1 TMP0, SAVE0 - |.endif - | decode_RA8 RA, SAVE0 - |.if JIT - | cmpwi TMP0, BC_JFORI - |.endif - | decode_RD8 RD, SAVE0 - |.if JIT - | beqy =>BC_JFORI - |.endif - | b =>BC_FORI - | - |//----------------------------------------------------------------------- - |//-- Fast functions ----------------------------------------------------- - |//----------------------------------------------------------------------- - | - |.macro .ffunc, name - |->ff_ .. name: - |.endmacro - | - |.macro .ffunc_1, name - |->ff_ .. name: - | cmplwi NARGS8:RC, 8 - | lwz CARG3, 0(BASE) - | lwz CARG1, 4(BASE) - | blt ->fff_fallback - |.endmacro - | - |.macro .ffunc_2, name - |->ff_ .. name: - | cmplwi NARGS8:RC, 16 - | lwz CARG3, 0(BASE) - | lwz CARG4, 8(BASE) - | lwz CARG1, 4(BASE) - | lwz CARG2, 12(BASE) - | blt ->fff_fallback - |.endmacro - | - |.macro .ffunc_n, name - |->ff_ .. name: - | cmplwi NARGS8:RC, 8 - | lwz CARG3, 0(BASE) - | lfd FARG1, 0(BASE) - | blt ->fff_fallback - | checknum CARG3; bge ->fff_fallback - |.endmacro - | - |.macro .ffunc_nn, name - |->ff_ .. name: - | cmplwi NARGS8:RC, 16 - | lwz CARG3, 0(BASE) - | lfd FARG1, 0(BASE) - | lwz CARG4, 8(BASE) - | lfd FARG2, 8(BASE) - | blt ->fff_fallback - | checknum CARG3; bge ->fff_fallback - | checknum CARG4; bge ->fff_fallback - |.endmacro - | - |// Inlined GC threshold check. Caveat: uses TMP0 and TMP1. - |.macro ffgccheck - | lwz TMP0, DISPATCH_GL(gc.total)(DISPATCH) - | lwz TMP1, DISPATCH_GL(gc.threshold)(DISPATCH) - | cmplw TMP0, TMP1 - | bgel ->fff_gcstep - |.endmacro - | - |//-- Base library: checks ----------------------------------------------- - | - |.ffunc_1 assert - | li TMP1, LJ_TFALSE - | la RA, -8(BASE) - | cmplw cr1, CARG3, TMP1 - | lwz PC, FRAME_PC(BASE) - | bge cr1, ->fff_fallback - | stw CARG3, 0(RA) - | addi RD, NARGS8:RC, 8 // Compute (nresults+1)*8. - | stw CARG1, 4(RA) - | beq ->fff_res // Done if exactly 1 argument. - | li TMP1, 8 - | subi RC, RC, 8 - |1: - | cmplw TMP1, RC - | lfdx f0, BASE, TMP1 - | stfdx f0, RA, TMP1 - | addi TMP1, TMP1, 8 - | bney <1 - | b ->fff_res - | - |.ffunc type - | cmplwi NARGS8:RC, 8 - | lwz CARG1, 0(BASE) - | blt ->fff_fallback - | .gpr64 extsw CARG1, CARG1 - | subfc TMP0, TISNUM, CARG1 - | subfe TMP2, CARG1, CARG1 - | orc TMP1, TMP2, TMP0 - | addi TMP1, TMP1, ~LJ_TISNUM+1 - | slwi TMP1, TMP1, 3 - | la TMP2, CFUNC:RB->upvalue - | lfdx FARG1, TMP2, TMP1 - | b ->fff_resn - | - |//-- Base library: getters and setters --------------------------------- - | - |.ffunc_1 getmetatable - | checktab CARG3; bne >6 - |1: // Field metatable must be at same offset for GCtab and GCudata! - | lwz TAB:CARG1, TAB:CARG1->metatable - |2: - | li CARG3, LJ_TNIL - | cmplwi TAB:CARG1, 0 - | lwz STR:RC, DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])(DISPATCH) - | beq ->fff_restv - | lwz TMP0, TAB:CARG1->hmask - | li CARG3, LJ_TTAB // Use metatable as default result. - | lwz TMP1, STR:RC->hash - | lwz NODE:TMP2, TAB:CARG1->node - | and TMP1, TMP1, TMP0 // idx = str->hash & tab->hmask - | slwi TMP0, TMP1, 5 - | slwi TMP1, TMP1, 3 - | sub TMP1, TMP0, TMP1 - | add NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8) - |3: // Rearranged logic, because we expect _not_ to find the key. - | lwz CARG4, NODE:TMP2->key - | lwz TMP0, 4+offsetof(Node, key)(NODE:TMP2) - | lwz CARG2, NODE:TMP2->val - | lwz TMP1, 4+offsetof(Node, val)(NODE:TMP2) - | checkstr CARG4; bne >4 - | cmpw TMP0, STR:RC; beq >5 - |4: - | lwz NODE:TMP2, NODE:TMP2->next - | cmplwi NODE:TMP2, 0 - | beq ->fff_restv // Not found, keep default result. - | b <3 - |5: - | checknil CARG2 - | beq ->fff_restv // Ditto for nil value. - | mr CARG3, CARG2 // Return value of mt.__metatable. - | mr CARG1, TMP1 - | b ->fff_restv - | - |6: - | cmpwi CARG3, LJ_TUDATA; beq <1 - | .gpr64 extsw CARG3, CARG3 - | subfc TMP0, TISNUM, CARG3 - | subfe TMP2, CARG3, CARG3 - | orc TMP1, TMP2, TMP0 - | addi TMP1, TMP1, ~LJ_TISNUM+1 - | slwi TMP1, TMP1, 2 - | la TMP2, DISPATCH_GL(gcroot[GCROOT_BASEMT])(DISPATCH) - | lwzx TAB:CARG1, TMP2, TMP1 - | b <2 - | - |.ffunc_2 setmetatable - | // Fast path: no mt for table yet and not clearing the mt. - | checktab CARG3; bne ->fff_fallback - | lwz TAB:TMP1, TAB:CARG1->metatable - | checktab CARG4; bne ->fff_fallback - | cmplwi TAB:TMP1, 0 - | lbz TMP3, TAB:CARG1->marked - | bne ->fff_fallback - | andix. TMP0, TMP3, LJ_GC_BLACK // isblack(table) - | stw TAB:CARG2, TAB:CARG1->metatable - | beq ->fff_restv - | barrierback TAB:CARG1, TMP3, TMP0 - | b ->fff_restv - | - |.ffunc rawget - | cmplwi NARGS8:RC, 16 - | lwz CARG4, 0(BASE) - | lwz TAB:CARG2, 4(BASE) - | blt ->fff_fallback - | checktab CARG4; bne ->fff_fallback - | la CARG3, 8(BASE) - | mr CARG1, L - | bl extern lj_tab_get // (lua_State *L, GCtab *t, cTValue *key) - | // Returns cTValue *. - | lfd FARG1, 0(CRET1) - | b ->fff_resn - | - |//-- Base library: conversions ------------------------------------------ - | - |.ffunc tonumber - | // Only handles the number case inline (without a base argument). - | cmplwi NARGS8:RC, 8 - | lwz CARG1, 0(BASE) - | lfd FARG1, 0(BASE) - | bne ->fff_fallback // Exactly one argument. - | checknum CARG1; bgt ->fff_fallback - | b ->fff_resn - | - |.ffunc_1 tostring - | // Only handles the string or number case inline. - | checkstr CARG3 - | // A __tostring method in the string base metatable is ignored. - | beq ->fff_restv // String key? - | // Handle numbers inline, unless a number base metatable is present. - | lwz TMP0, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])(DISPATCH) - | checknum CARG3 - | cmplwi cr1, TMP0, 0 - | stp BASE, L->base // Add frame since C call can throw. - | crorc 4*cr0+eq, 4*cr0+gt, 4*cr1+eq - | stw PC, SAVE_PC // Redundant (but a defined value). - | beq ->fff_fallback - | ffgccheck - | mr CARG1, L - | mr CARG2, BASE - |.if DUALNUM - | bl extern lj_str_fromnumber // (lua_State *L, cTValue *o) - |.else - | bl extern lj_str_fromnum // (lua_State *L, lua_Number *np) - |.endif - | // Returns GCstr *. - | li CARG3, LJ_TSTR - | b ->fff_restv - | - |//-- Base library: iterators ------------------------------------------- - | - |.ffunc next - | cmplwi NARGS8:RC, 8 - | lwz CARG1, 0(BASE) - | lwz TAB:CARG2, 4(BASE) - | blt ->fff_fallback - | stwx TISNIL, BASE, NARGS8:RC // Set missing 2nd arg to nil. - | checktab CARG1 - | lwz PC, FRAME_PC(BASE) - | bne ->fff_fallback - | stp BASE, L->base // Add frame since C call can throw. - | mr CARG1, L - | stp BASE, L->top // Dummy frame length is ok. - | la CARG3, 8(BASE) - | stw PC, SAVE_PC - | bl extern lj_tab_next // (lua_State *L, GCtab *t, TValue *key) - | // Returns 0 at end of traversal. - | cmplwi CRET1, 0 - | li CARG3, LJ_TNIL - | beq ->fff_restv // End of traversal: return nil. - | lfd f0, 8(BASE) // Copy key and value to results. - | la RA, -8(BASE) - | lfd f1, 16(BASE) - | stfd f0, 0(RA) - | li RD, (2+1)*8 - | stfd f1, 8(RA) - | b ->fff_res - | - |.ffunc_1 pairs - | checktab CARG3 - | lwz PC, FRAME_PC(BASE) - | bne ->fff_fallback -#if LJ_52 - | lwz TAB:TMP2, TAB:CARG1->metatable - | lfd f0, CFUNC:RB->upvalue[0] - | cmplwi TAB:TMP2, 0 - | la RA, -8(BASE) - | bne ->fff_fallback -#else - | lfd f0, CFUNC:RB->upvalue[0] - | la RA, -8(BASE) -#endif - | stw TISNIL, 8(BASE) - | li RD, (3+1)*8 - | stfd f0, 0(RA) - | b ->fff_res - | - |.ffunc ipairs_aux - | cmplwi NARGS8:RC, 16 - | lwz CARG3, 0(BASE) - | lwz TAB:CARG1, 4(BASE) - | lwz CARG4, 8(BASE) - |.if DUALNUM - | lwz TMP2, 12(BASE) - |.else - | lfd FARG2, 8(BASE) - |.endif - | blt ->fff_fallback - | checktab CARG3 - | checknum cr1, CARG4 - | lwz PC, FRAME_PC(BASE) - |.if DUALNUM - | bne ->fff_fallback - | bne cr1, ->fff_fallback - |.else - | lus TMP0, 0x3ff0 - | stw ZERO, TMPD_LO - | bne ->fff_fallback - | stw TMP0, TMPD_HI - | bge cr1, ->fff_fallback - | lfd FARG1, TMPD - | toint TMP2, FARG2, f0 - |.endif - | lwz TMP0, TAB:CARG1->asize - | lwz TMP1, TAB:CARG1->array - |.if not DUALNUM - | fadd FARG2, FARG2, FARG1 - |.endif - | addi TMP2, TMP2, 1 - | la RA, -8(BASE) - | cmplw TMP0, TMP2 - |.if DUALNUM - | stw TISNUM, 0(RA) - | slwi TMP3, TMP2, 3 - | stw TMP2, 4(RA) - |.else - | slwi TMP3, TMP2, 3 - | stfd FARG2, 0(RA) - |.endif - | ble >2 // Not in array part? - | lwzx TMP2, TMP1, TMP3 - | lfdx f0, TMP1, TMP3 - |1: - | checknil TMP2 - | li RD, (0+1)*8 - | beq ->fff_res // End of iteration, return 0 results. - | li RD, (2+1)*8 - | stfd f0, 8(RA) - | b ->fff_res - |2: // Check for empty hash part first. Otherwise call C function. - | lwz TMP0, TAB:CARG1->hmask - | cmplwi TMP0, 0 - | li RD, (0+1)*8 - | beq ->fff_res - | mr CARG2, TMP2 - | bl extern lj_tab_getinth // (GCtab *t, int32_t key) - | // Returns cTValue * or NULL. - | cmplwi CRET1, 0 - | li RD, (0+1)*8 - | beq ->fff_res - | lwz TMP2, 0(CRET1) - | lfd f0, 0(CRET1) - | b <1 - | - |.ffunc_1 ipairs - | checktab CARG3 - | lwz PC, FRAME_PC(BASE) - | bne ->fff_fallback -#if LJ_52 - | lwz TAB:TMP2, TAB:CARG1->metatable - | lfd f0, CFUNC:RB->upvalue[0] - | cmplwi TAB:TMP2, 0 - | la RA, -8(BASE) - | bne ->fff_fallback -#else - | lfd f0, CFUNC:RB->upvalue[0] - | la RA, -8(BASE) -#endif - |.if DUALNUM - | stw TISNUM, 8(BASE) - |.else - | stw ZERO, 8(BASE) - |.endif - | stw ZERO, 12(BASE) - | li RD, (3+1)*8 - | stfd f0, 0(RA) - | b ->fff_res - | - |//-- Base library: catch errors ---------------------------------------- - | - |.ffunc pcall - | cmplwi NARGS8:RC, 8 - | lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH) - | blt ->fff_fallback - | mr TMP2, BASE - | la BASE, 8(BASE) - | // Remember active hook before pcall. - | rlwinm TMP3, TMP3, 32-HOOK_ACTIVE_SHIFT, 31, 31 - | subi NARGS8:RC, NARGS8:RC, 8 - | addi PC, TMP3, 8+FRAME_PCALL - | b ->vm_call_dispatch - | - |.ffunc xpcall - | cmplwi NARGS8:RC, 16 - | lwz CARG4, 8(BASE) - | lfd FARG2, 8(BASE) - | lfd FARG1, 0(BASE) - | blt ->fff_fallback - | lbz TMP1, DISPATCH_GL(hookmask)(DISPATCH) - | mr TMP2, BASE - | checkfunc CARG4; bne ->fff_fallback // Traceback must be a function. - | la BASE, 16(BASE) - | // Remember active hook before pcall. - | rlwinm TMP1, TMP1, 32-HOOK_ACTIVE_SHIFT, 31, 31 - | stfd FARG2, 0(TMP2) // Swap function and traceback. - | subi NARGS8:RC, NARGS8:RC, 16 - | stfd FARG1, 8(TMP2) - | addi PC, TMP1, 16+FRAME_PCALL - | b ->vm_call_dispatch - | - |//-- Coroutine library -------------------------------------------------- - | - |.macro coroutine_resume_wrap, resume - |.if resume - |.ffunc_1 coroutine_resume - | cmpwi CARG3, LJ_TTHREAD; bne ->fff_fallback - |.else - |.ffunc coroutine_wrap_aux - | lwz L:CARG1, CFUNC:RB->upvalue[0].gcr - |.endif - | lbz TMP0, L:CARG1->status - | lp TMP1, L:CARG1->cframe - | lp CARG2, L:CARG1->top - | cmplwi cr0, TMP0, LUA_YIELD - | lp TMP2, L:CARG1->base - | cmplwi cr1, TMP1, 0 - | lwz TMP0, L:CARG1->maxstack - | cmplw cr7, CARG2, TMP2 - | lwz PC, FRAME_PC(BASE) - | crorc 4*cr6+lt, 4*cr0+gt, 4*cr1+eq // st>LUA_YIELD || cframe!=0 - | add TMP2, CARG2, NARGS8:RC - | crandc 4*cr6+gt, 4*cr7+eq, 4*cr0+eq // base==top && st!=LUA_YIELD - | cmplw cr1, TMP2, TMP0 - | cror 4*cr6+lt, 4*cr6+lt, 4*cr6+gt - | stw PC, SAVE_PC - | cror 4*cr6+lt, 4*cr6+lt, 4*cr1+gt // cond1 || cond2 || stackov - | stp BASE, L->base - | blt cr6, ->fff_fallback - |1: - |.if resume - | addi BASE, BASE, 8 // Keep resumed thread in stack for GC. - | subi NARGS8:RC, NARGS8:RC, 8 - | subi TMP2, TMP2, 8 - |.endif - | stp TMP2, L:CARG1->top - | li TMP1, 0 - | stp BASE, L->top - |2: // Move args to coroutine. - | cmpw TMP1, NARGS8:RC - | lfdx f0, BASE, TMP1 - | beq >3 - | stfdx f0, CARG2, TMP1 - | addi TMP1, TMP1, 8 - | b <2 - |3: - | li CARG3, 0 - | mr L:SAVE0, L:CARG1 - | li CARG4, 0 - | bl ->vm_resume // (lua_State *L, TValue *base, 0, 0) - | // Returns thread status. - |4: - | lp TMP2, L:SAVE0->base - | cmplwi CRET1, LUA_YIELD - | lp TMP3, L:SAVE0->top - | li_vmstate INTERP - | lp BASE, L->base - | st_vmstate - | bgt >8 - | sub RD, TMP3, TMP2 - | lwz TMP0, L->maxstack - | cmplwi RD, 0 - | add TMP1, BASE, RD - | beq >6 // No results? - | cmplw TMP1, TMP0 - | li TMP1, 0 - | bgt >9 // Need to grow stack? - | - | subi TMP3, RD, 8 - | stp TMP2, L:SAVE0->top // Clear coroutine stack. - |5: // Move results from coroutine. - | cmplw TMP1, TMP3 - | lfdx f0, TMP2, TMP1 - | stfdx f0, BASE, TMP1 - | addi TMP1, TMP1, 8 - | bne <5 - |6: - | andix. TMP0, PC, FRAME_TYPE - |.if resume - | li TMP1, LJ_TTRUE - | la RA, -8(BASE) - | stw TMP1, -8(BASE) // Prepend true to results. - | addi RD, RD, 16 - |.else - | mr RA, BASE - | addi RD, RD, 8 - |.endif - |7: - | stw PC, SAVE_PC - | mr MULTRES, RD - | beq ->BC_RET_Z - | b ->vm_return - | - |8: // Coroutine returned with error (at co->top-1). - |.if resume - | andix. TMP0, PC, FRAME_TYPE - | la TMP3, -8(TMP3) - | li TMP1, LJ_TFALSE - | lfd f0, 0(TMP3) - | stp TMP3, L:SAVE0->top // Remove error from coroutine stack. - | li RD, (2+1)*8 - | stw TMP1, -8(BASE) // Prepend false to results. - | la RA, -8(BASE) - | stfd f0, 0(BASE) // Copy error message. - | b <7 - |.else - | mr CARG1, L - | mr CARG2, L:SAVE0 - | bl extern lj_ffh_coroutine_wrap_err // (lua_State *L, lua_State *co) - |.endif - | - |9: // Handle stack expansion on return from yield. - | mr CARG1, L - | srwi CARG2, RD, 3 - | bl extern lj_state_growstack // (lua_State *L, int n) - | li CRET1, 0 - | b <4 - |.endmacro - | - | coroutine_resume_wrap 1 // coroutine.resume - | coroutine_resume_wrap 0 // coroutine.wrap - | - |.ffunc coroutine_yield - | lp TMP0, L->cframe - | add TMP1, BASE, NARGS8:RC - | stp BASE, L->base - | andix. TMP0, TMP0, CFRAME_RESUME - | stp TMP1, L->top - | li CRET1, LUA_YIELD - | beq ->fff_fallback - | stp ZERO, L->cframe - | stb CRET1, L->status - | b ->vm_leave_unw - | - |//-- Math library ------------------------------------------------------- - | - |.ffunc_1 math_abs - | checknum CARG3 - |.if DUALNUM - | bne >2 - | srawi TMP1, CARG1, 31 - | xor TMP2, TMP1, CARG1 - |.if GPR64 - | lus TMP0, 0x8000 - | sub CARG1, TMP2, TMP1 - | cmplw CARG1, TMP0 - | beq >1 - |.else - | sub. CARG1, TMP2, TMP1 - | blt >1 - |.endif - |->fff_resi: - | lwz PC, FRAME_PC(BASE) - | la RA, -8(BASE) - | stw TISNUM, -8(BASE) - | stw CRET1, -4(BASE) - | b ->fff_res1 - |1: - | lus CARG3, 0x41e0 // 2^31. - | li CARG1, 0 - | b ->fff_restv - |2: - |.endif - | bge ->fff_fallback - | rlwinm CARG3, CARG3, 0, 1, 31 - | // Fallthrough. - | - |->fff_restv: - | // CARG3/CARG1 = TValue result. - | lwz PC, FRAME_PC(BASE) - | stw CARG3, -8(BASE) - | la RA, -8(BASE) - | stw CARG1, -4(BASE) - |->fff_res1: - | // RA = results, PC = return. - | li RD, (1+1)*8 - |->fff_res: - | // RA = results, RD = (nresults+1)*8, PC = return. - | andix. TMP0, PC, FRAME_TYPE - | mr MULTRES, RD - | bney ->vm_return - | lwz INS, -4(PC) - | decode_RB8 RB, INS - |5: - | cmplw RB, RD // More results expected? - | decode_RA8 TMP0, INS - | bgt >6 - | ins_next1 - | // Adjust BASE. KBASE is assumed to be set for the calling frame. - | sub BASE, RA, TMP0 - | ins_next2 - | - |6: // Fill up results with nil. - | subi TMP1, RD, 8 - | addi RD, RD, 8 - | stwx TISNIL, RA, TMP1 - | b <5 - | - |.macro math_extern, func - | .ffunc_n math_ .. func - | blex func - | b ->fff_resn - |.endmacro - | - |.macro math_extern2, func - | .ffunc_nn math_ .. func - | blex func - | b ->fff_resn - |.endmacro - | - |.macro math_round, func - | .ffunc_1 math_ .. func - | checknum CARG3; beqy ->fff_restv - | rlwinm TMP2, CARG3, 12, 21, 31 - | bge ->fff_fallback - | addic. TMP2, TMP2, -1023 // exp = exponent(x) - 1023 - | cmplwi cr1, TMP2, 31 // 0 <= exp < 31? - | subfic TMP0, TMP2, 31 - | blt >3 - | slwi TMP1, CARG3, 11 - | srwi TMP3, CARG1, 21 - | oris TMP1, TMP1, 0x8000 - | addi TMP2, TMP2, 1 - | or TMP1, TMP1, TMP3 - | slwi CARG2, CARG1, 11 - | bge cr1, >4 - | slw TMP3, TMP1, TMP2 - | srw RD, TMP1, TMP0 - | or TMP3, TMP3, CARG2 - | srawi TMP2, CARG3, 31 - |.if "func" == "floor" - | and TMP1, TMP3, TMP2 - | addic TMP0, TMP1, -1 - | subfe TMP1, TMP0, TMP1 - | add CARG1, RD, TMP1 - | xor CARG1, CARG1, TMP2 - | sub CARG1, CARG1, TMP2 - | b ->fff_resi - |.else - | andc TMP1, TMP3, TMP2 - | addic TMP0, TMP1, -1 - | subfe TMP1, TMP0, TMP1 - | add CARG1, RD, TMP1 - | cmpw CARG1, RD - | xor CARG1, CARG1, TMP2 - | sub CARG1, CARG1, TMP2 - | bge ->fff_resi - | // Overflow to 2^31. - | lus CARG3, 0x41e0 // 2^31. - | li CARG1, 0 - | b ->fff_restv - |.endif - |3: // |x| < 1 - | slwi TMP2, CARG3, 1 - | srawi TMP1, CARG3, 31 - | or TMP2, CARG1, TMP2 // ztest = (hi+hi) | lo - |.if "func" == "floor" - | and TMP1, TMP2, TMP1 // (ztest & sign) == 0 ? 0 : -1 - | subfic TMP2, TMP1, 0 - | subfe CARG1, CARG1, CARG1 - |.else - | andc TMP1, TMP2, TMP1 // (ztest & ~sign) == 0 ? 0 : 1 - | addic TMP2, TMP1, -1 - | subfe CARG1, TMP2, TMP1 - |.endif - | b ->fff_resi - |4: // exp >= 31. Check for -(2^31). - | xoris TMP1, TMP1, 0x8000 - | srawi TMP2, CARG3, 31 - |.if "func" == "floor" - | or TMP1, TMP1, CARG2 - |.endif - |.if PPE - | orc TMP1, TMP1, TMP2 - | cmpwi TMP1, 0 - |.else - | orc. TMP1, TMP1, TMP2 - |.endif - | crand 4*cr0+eq, 4*cr0+eq, 4*cr1+eq - | lus CARG1, 0x8000 // -(2^31). - | beqy ->fff_resi - |5: - | lfd FARG1, 0(BASE) - | blex func - | b ->fff_resn - |.endmacro - | - |.if DUALNUM - | math_round floor - | math_round ceil - |.else - | // NYI: use internal implementation. - | math_extern floor - | math_extern ceil - |.endif - | - |.if SQRT - |.ffunc_n math_sqrt - | fsqrt FARG1, FARG1 - | b ->fff_resn - |.else - | math_extern sqrt - |.endif - | - |.ffunc math_log - | cmplwi NARGS8:RC, 8 - | lwz CARG3, 0(BASE) - | lfd FARG1, 0(BASE) - | bne ->fff_fallback // Need exactly 1 argument. - | checknum CARG3; bge ->fff_fallback - | blex log - | b ->fff_resn - | - | math_extern log10 - | math_extern exp - | math_extern sin - | math_extern cos - | math_extern tan - | math_extern asin - | math_extern acos - | math_extern atan - | math_extern sinh - | math_extern cosh - | math_extern tanh - | math_extern2 pow - | math_extern2 atan2 - | math_extern2 fmod - | - |->ff_math_deg: - |.ffunc_n math_rad - | lfd FARG2, CFUNC:RB->upvalue[0] - | fmul FARG1, FARG1, FARG2 - | b ->fff_resn - | - |.if DUALNUM - |.ffunc math_ldexp - | cmplwi NARGS8:RC, 16 - | lwz CARG3, 0(BASE) - | lfd FARG1, 0(BASE) - | lwz CARG4, 8(BASE) - |.if GPR64 - | lwz CARG2, 12(BASE) - |.else - | lwz CARG1, 12(BASE) - |.endif - | blt ->fff_fallback - | checknum CARG3; bge ->fff_fallback - | checknum CARG4; bne ->fff_fallback - |.else - |.ffunc_nn math_ldexp - |.if GPR64 - | toint CARG2, FARG2 - |.else - | toint CARG1, FARG2 - |.endif - |.endif - | blex ldexp - | b ->fff_resn - | - |.ffunc_n math_frexp - |.if GPR64 - | la CARG2, DISPATCH_GL(tmptv)(DISPATCH) - |.else - | la CARG1, DISPATCH_GL(tmptv)(DISPATCH) - |.endif - | lwz PC, FRAME_PC(BASE) - | blex frexp - | lwz TMP1, DISPATCH_GL(tmptv)(DISPATCH) - | la RA, -8(BASE) - |.if not DUALNUM - | tonum_i FARG2, TMP1 - |.endif - | stfd FARG1, 0(RA) - | li RD, (2+1)*8 - |.if DUALNUM - | stw TISNUM, 8(RA) - | stw TMP1, 12(RA) - |.else - | stfd FARG2, 8(RA) - |.endif - | b ->fff_res - | - |.ffunc_n math_modf - |.if GPR64 - | la CARG2, -8(BASE) - |.else - | la CARG1, -8(BASE) - |.endif - | lwz PC, FRAME_PC(BASE) - | blex modf - | la RA, -8(BASE) - | stfd FARG1, 0(BASE) - | li RD, (2+1)*8 - | b ->fff_res - | - |.macro math_minmax, name, ismax - |.if DUALNUM - | .ffunc_1 name - | checknum CARG3 - | addi TMP1, BASE, 8 - | add TMP2, BASE, NARGS8:RC - | bne >4 - |1: // Handle integers. - | lwz CARG4, 0(TMP1) - | cmplw cr1, TMP1, TMP2 - | lwz CARG2, 4(TMP1) - | bge cr1, ->fff_resi - | checknum CARG4 - | xoris TMP0, CARG1, 0x8000 - | xoris TMP3, CARG2, 0x8000 - | bne >3 - | subfc TMP3, TMP3, TMP0 - | subfe TMP0, TMP0, TMP0 - |.if ismax - | andc TMP3, TMP3, TMP0 - |.else - | and TMP3, TMP3, TMP0 - |.endif - | add CARG1, TMP3, CARG2 - |.if GPR64 - | rldicl CARG1, CARG1, 0, 32 - |.endif - | addi TMP1, TMP1, 8 - | b <1 - |3: - | bge ->fff_fallback - | // Convert intermediate result to number and continue below. - | tonum_i FARG1, CARG1 - | lfd FARG2, 0(TMP1) - | b >6 - |4: - | lfd FARG1, 0(BASE) - | bge ->fff_fallback - |5: // Handle numbers. - | lwz CARG4, 0(TMP1) - | cmplw cr1, TMP1, TMP2 - | lfd FARG2, 0(TMP1) - | bge cr1, ->fff_resn - | checknum CARG4; bge >7 - |6: - | fsub f0, FARG1, FARG2 - | addi TMP1, TMP1, 8 - |.if ismax - | fsel FARG1, f0, FARG1, FARG2 - |.else - | fsel FARG1, f0, FARG2, FARG1 - |.endif - | b <5 - |7: // Convert integer to number and continue above. - | lwz CARG2, 4(TMP1) - | bne ->fff_fallback - | tonum_i FARG2, CARG2 - | b <6 - |.else - | .ffunc_n name - | li TMP1, 8 - |1: - | lwzx CARG2, BASE, TMP1 - | lfdx FARG2, BASE, TMP1 - | cmplw cr1, TMP1, NARGS8:RC - | checknum CARG2 - | bge cr1, ->fff_resn - | bge ->fff_fallback - | fsub f0, FARG1, FARG2 - | addi TMP1, TMP1, 8 - |.if ismax - | fsel FARG1, f0, FARG1, FARG2 - |.else - | fsel FARG1, f0, FARG2, FARG1 - |.endif - | b <1 - |.endif - |.endmacro - | - | math_minmax math_min, 0 - | math_minmax math_max, 1 - | - |//-- String library ----------------------------------------------------- - | - |.ffunc_1 string_len - | checkstr CARG3; bne ->fff_fallback - | lwz CRET1, STR:CARG1->len - | b ->fff_resi - | - |.ffunc string_byte // Only handle the 1-arg case here. - | cmplwi NARGS8:RC, 8 - | lwz CARG3, 0(BASE) - | lwz STR:CARG1, 4(BASE) - | bne ->fff_fallback // Need exactly 1 argument. - | checkstr CARG3 - | bne ->fff_fallback - | lwz TMP0, STR:CARG1->len - |.if DUALNUM - | lbz CARG1, STR:CARG1[1] // Access is always ok (NUL at end). - | li RD, (0+1)*8 - | lwz PC, FRAME_PC(BASE) - | cmplwi TMP0, 0 - | la RA, -8(BASE) - | beqy ->fff_res - | b ->fff_resi - |.else - | lbz TMP1, STR:CARG1[1] // Access is always ok (NUL at end). - | addic TMP3, TMP0, -1 // RD = ((str->len != 0)+1)*8 - | subfe RD, TMP3, TMP0 - | stw TMP1, TONUM_LO // Inlined tonum_u f0, TMP1. - | addi RD, RD, 1 - | lfd f0, TONUM_D - | la RA, -8(BASE) - | lwz PC, FRAME_PC(BASE) - | fsub f0, f0, TOBIT - | slwi RD, RD, 3 - | stfd f0, 0(RA) - | b ->fff_res - |.endif - | - |.ffunc string_char // Only handle the 1-arg case here. - | ffgccheck - | cmplwi NARGS8:RC, 8 - | lwz CARG3, 0(BASE) - |.if DUALNUM - | lwz TMP0, 4(BASE) - | bne ->fff_fallback // Exactly 1 argument. - | checknum CARG3; bne ->fff_fallback - | la CARG2, 7(BASE) - |.else - | lfd FARG1, 0(BASE) - | bne ->fff_fallback // Exactly 1 argument. - | checknum CARG3; bge ->fff_fallback - | toint TMP0, FARG1 - | la CARG2, TMPD_BLO - |.endif - | li CARG3, 1 - | cmplwi TMP0, 255; bgt ->fff_fallback - |->fff_newstr: - | mr CARG1, L - | stp BASE, L->base - | stw PC, SAVE_PC - | bl extern lj_str_new // (lua_State *L, char *str, size_t l) - | // Returns GCstr *. - | lp BASE, L->base - | li CARG3, LJ_TSTR - | b ->fff_restv - | - |.ffunc string_sub - | ffgccheck - | cmplwi NARGS8:RC, 16 - | lwz CARG3, 16(BASE) - |.if not DUALNUM - | lfd f0, 16(BASE) - |.endif - | lwz TMP0, 0(BASE) - | lwz STR:CARG1, 4(BASE) - | blt ->fff_fallback - | lwz CARG2, 8(BASE) - |.if DUALNUM - | lwz TMP1, 12(BASE) - |.else - | lfd f1, 8(BASE) - |.endif - | li TMP2, -1 - | beq >1 - |.if DUALNUM - | checknum CARG3 - | lwz TMP2, 20(BASE) - | bne ->fff_fallback - |1: - | checknum CARG2; bne ->fff_fallback - |.else - | checknum CARG3; bge ->fff_fallback - | toint TMP2, f0 - |1: - | checknum CARG2; bge ->fff_fallback - |.endif - | checkstr TMP0; bne ->fff_fallback - |.if not DUALNUM - | toint TMP1, f1 - |.endif - | lwz TMP0, STR:CARG1->len - | cmplw TMP0, TMP2 // len < end? (unsigned compare) - | addi TMP3, TMP2, 1 - | blt >5 - |2: - | cmpwi TMP1, 0 // start <= 0? - | add TMP3, TMP1, TMP0 - | ble >7 - |3: - | sub CARG3, TMP2, TMP1 - | addi CARG2, STR:CARG1, #STR-1 - | srawi TMP0, CARG3, 31 - | addi CARG3, CARG3, 1 - | add CARG2, CARG2, TMP1 - | andc CARG3, CARG3, TMP0 - |.if GPR64 - | rldicl CARG2, CARG2, 0, 32 - | rldicl CARG3, CARG3, 0, 32 - |.endif - | b ->fff_newstr - | - |5: // Negative end or overflow. - | cmpw TMP0, TMP2 // len >= end? (signed compare) - | add TMP2, TMP0, TMP3 // Negative end: end = end+len+1. - | bge <2 - | mr TMP2, TMP0 // Overflow: end = len. - | b <2 - | - |7: // Negative start or underflow. - | .gpr64 extsw TMP1, TMP1 - | addic CARG3, TMP1, -1 - | subfe CARG3, CARG3, CARG3 - | srawi CARG2, TMP3, 31 // Note: modifies carry. - | andc TMP3, TMP3, CARG3 - | andc TMP1, TMP3, CARG2 - | addi TMP1, TMP1, 1 // start = 1 + (start ? start+len : 0) - | b <3 - | - |.ffunc string_rep // Only handle the 1-char case inline. - | ffgccheck - | cmplwi NARGS8:RC, 16 - | lwz TMP0, 0(BASE) - | lwz STR:CARG1, 4(BASE) - | lwz CARG4, 8(BASE) - |.if DUALNUM - | lwz CARG3, 12(BASE) - |.else - | lfd FARG2, 8(BASE) - |.endif - | bne ->fff_fallback // Exactly 2 arguments. - | checkstr TMP0; bne ->fff_fallback - |.if DUALNUM - | checknum CARG4; bne ->fff_fallback - |.else - | checknum CARG4; bge ->fff_fallback - | toint CARG3, FARG2 - |.endif - | lwz TMP0, STR:CARG1->len - | cmpwi CARG3, 0 - | lwz TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH) - | ble >2 // Count <= 0? (or non-int) - | cmplwi TMP0, 1 - | subi TMP2, CARG3, 1 - | blt >2 // Zero length string? - | cmplw cr1, TMP1, CARG3 - | bne ->fff_fallback // Fallback for > 1-char strings. - | lbz TMP0, STR:CARG1[1] - | lp CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH) - | blt cr1, ->fff_fallback - |1: // Fill buffer with char. Yes, this is suboptimal code (do you care?). - | cmplwi TMP2, 0 - | stbx TMP0, CARG2, TMP2 - | subi TMP2, TMP2, 1 - | bne <1 - | b ->fff_newstr - |2: // Return empty string. - | la STR:CARG1, DISPATCH_GL(strempty)(DISPATCH) - | li CARG3, LJ_TSTR - | b ->fff_restv - | - |.ffunc string_reverse - | ffgccheck - | cmplwi NARGS8:RC, 8 - | lwz CARG3, 0(BASE) - | lwz STR:CARG1, 4(BASE) - | blt ->fff_fallback - | checkstr CARG3 - | lwz TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH) - | bne ->fff_fallback - | lwz CARG3, STR:CARG1->len - | la CARG1, #STR(STR:CARG1) - | lp CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH) - | li TMP2, 0 - | cmplw TMP1, CARG3 - | subi TMP3, CARG3, 1 - | blt ->fff_fallback - |1: // Reverse string copy. - | cmpwi TMP3, 0 - | lbzx TMP1, CARG1, TMP2 - | blty ->fff_newstr - | stbx TMP1, CARG2, TMP3 - | subi TMP3, TMP3, 1 - | addi TMP2, TMP2, 1 - | b <1 - | - |.macro ffstring_case, name, lo - | .ffunc name - | ffgccheck - | cmplwi NARGS8:RC, 8 - | lwz CARG3, 0(BASE) - | lwz STR:CARG1, 4(BASE) - | blt ->fff_fallback - | checkstr CARG3 - | lwz TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH) - | bne ->fff_fallback - | lwz CARG3, STR:CARG1->len - | la CARG1, #STR(STR:CARG1) - | lp CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH) - | cmplw TMP1, CARG3 - | li TMP2, 0 - | blt ->fff_fallback - |1: // ASCII case conversion. - | cmplw TMP2, CARG3 - | lbzx TMP1, CARG1, TMP2 - | bgey ->fff_newstr - | subi TMP0, TMP1, lo - | xori TMP3, TMP1, 0x20 - | addic TMP0, TMP0, -26 - | subfe TMP3, TMP3, TMP3 - | rlwinm TMP3, TMP3, 0, 26, 26 // x &= 0x20. - | xor TMP1, TMP1, TMP3 - | stbx TMP1, CARG2, TMP2 - | addi TMP2, TMP2, 1 - | b <1 - |.endmacro - | - |ffstring_case string_lower, 65 - |ffstring_case string_upper, 97 - | - |//-- Table library ------------------------------------------------------ - | - |.ffunc_1 table_getn - | checktab CARG3; bne ->fff_fallback - | bl extern lj_tab_len // (GCtab *t) - | // Returns uint32_t (but less than 2^31). - | b ->fff_resi - | - |//-- Bit library -------------------------------------------------------- - | - |.macro .ffunc_bit, name - |.if DUALNUM - | .ffunc_1 bit_..name - | checknum CARG3; bnel ->fff_tobit_fb - |.else - | .ffunc_n bit_..name - | fadd FARG1, FARG1, TOBIT - | stfd FARG1, TMPD - | lwz CARG1, TMPD_LO - |.endif - |.endmacro - | - |.macro .ffunc_bit_op, name, ins - | .ffunc_bit name - | addi TMP1, BASE, 8 - | add TMP2, BASE, NARGS8:RC - |1: - | lwz CARG4, 0(TMP1) - | cmplw cr1, TMP1, TMP2 - |.if DUALNUM - | lwz CARG2, 4(TMP1) - |.else - | lfd FARG1, 0(TMP1) - |.endif - | bgey cr1, ->fff_resi - | checknum CARG4 - |.if DUALNUM - | bnel ->fff_bitop_fb - |.else - | fadd FARG1, FARG1, TOBIT - | bge ->fff_fallback - | stfd FARG1, TMPD - | lwz CARG2, TMPD_LO - |.endif - | ins CARG1, CARG1, CARG2 - | addi TMP1, TMP1, 8 - | b <1 - |.endmacro - | - |.ffunc_bit_op band, and - |.ffunc_bit_op bor, or - |.ffunc_bit_op bxor, xor - | - |.ffunc_bit bswap - | rotlwi TMP0, CARG1, 8 - | rlwimi TMP0, CARG1, 24, 0, 7 - | rlwimi TMP0, CARG1, 24, 16, 23 - | mr CRET1, TMP0 - | b ->fff_resi - | - |.ffunc_bit bnot - | not CRET1, CARG1 - | b ->fff_resi - | - |.macro .ffunc_bit_sh, name, ins, shmod - |.if DUALNUM - | .ffunc_2 bit_..name - | checknum CARG3; bnel ->fff_tobit_fb - | // Note: no inline conversion from number for 2nd argument! - | checknum CARG4; bne ->fff_fallback - |.else - | .ffunc_nn bit_..name - | fadd FARG1, FARG1, TOBIT - | fadd FARG2, FARG2, TOBIT - | stfd FARG1, TMPD - | lwz CARG1, TMPD_LO - | stfd FARG2, TMPD - | lwz CARG2, TMPD_LO - |.endif - |.if shmod == 1 - | rlwinm CARG2, CARG2, 0, 27, 31 - |.elif shmod == 2 - | neg CARG2, CARG2 - |.endif - | ins CRET1, CARG1, CARG2 - | b ->fff_resi - |.endmacro - | - |.ffunc_bit_sh lshift, slw, 1 - |.ffunc_bit_sh rshift, srw, 1 - |.ffunc_bit_sh arshift, sraw, 1 - |.ffunc_bit_sh rol, rotlw, 0 - |.ffunc_bit_sh ror, rotlw, 2 - | - |.ffunc_bit tobit - |.if DUALNUM - | b ->fff_resi - |.else - |->fff_resi: - | tonum_i FARG1, CRET1 - |.endif - |->fff_resn: - | lwz PC, FRAME_PC(BASE) - | la RA, -8(BASE) - | stfd FARG1, -8(BASE) - | b ->fff_res1 - | - |// Fallback FP number to bit conversion. - |->fff_tobit_fb: - |.if DUALNUM - | lfd FARG1, 0(BASE) - | bgt ->fff_fallback - | fadd FARG1, FARG1, TOBIT - | stfd FARG1, TMPD - | lwz CARG1, TMPD_LO - | blr - |.endif - |->fff_bitop_fb: - |.if DUALNUM - | lfd FARG1, 0(TMP1) - | bgt ->fff_fallback - | fadd FARG1, FARG1, TOBIT - | stfd FARG1, TMPD - | lwz CARG2, TMPD_LO - | blr - |.endif - | - |//----------------------------------------------------------------------- - | - |->fff_fallback: // Call fast function fallback handler. - | // BASE = new base, RB = CFUNC, RC = nargs*8 - | lp TMP3, CFUNC:RB->f - | add TMP1, BASE, NARGS8:RC - | lwz PC, FRAME_PC(BASE) // Fallback may overwrite PC. - | addi TMP0, TMP1, 8*LUA_MINSTACK - | lwz TMP2, L->maxstack - | stw PC, SAVE_PC // Redundant (but a defined value). - | .toc lp TMP3, 0(TMP3) - | cmplw TMP0, TMP2 - | stp BASE, L->base - | stp TMP1, L->top - | mr CARG1, L - | bgt >5 // Need to grow stack. - | mtctr TMP3 - | bctrl // (lua_State *L) - | // Either throws an error, or recovers and returns -1, 0 or nresults+1. - | lp BASE, L->base - | cmpwi CRET1, 0 - | slwi RD, CRET1, 3 - | la RA, -8(BASE) - | bgt ->fff_res // Returned nresults+1? - |1: // Returned 0 or -1: retry fast path. - | lp TMP0, L->top - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | sub NARGS8:RC, TMP0, BASE - | bne ->vm_call_tail // Returned -1? - | ins_callt // Returned 0: retry fast path. - | - |// Reconstruct previous base for vmeta_call during tailcall. - |->vm_call_tail: - | andix. TMP0, PC, FRAME_TYPE - | rlwinm TMP1, PC, 0, 0, 28 - | bne >3 - | lwz INS, -4(PC) - | decode_RA8 TMP1, INS - | addi TMP1, TMP1, 8 - |3: - | sub TMP2, BASE, TMP1 - | b ->vm_call_dispatch // Resolve again for tailcall. - | - |5: // Grow stack for fallback handler. - | li CARG2, LUA_MINSTACK - | bl extern lj_state_growstack // (lua_State *L, int n) - | lp BASE, L->base - | cmpw TMP0, TMP0 // Set 4*cr0+eq to force retry. - | b <1 - | - |->fff_gcstep: // Call GC step function. - | // BASE = new base, RC = nargs*8 - | mflr SAVE0 - | stp BASE, L->base - | add TMP0, BASE, NARGS8:RC - | stw PC, SAVE_PC // Redundant (but a defined value). - | stp TMP0, L->top - | mr CARG1, L - | bl extern lj_gc_step // (lua_State *L) - | lp BASE, L->base - | mtlr SAVE0 - | lp TMP0, L->top - | sub NARGS8:RC, TMP0, BASE - | lwz CFUNC:RB, FRAME_FUNC(BASE) - | blr - | - |//----------------------------------------------------------------------- - |//-- Special dispatch targets ------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_record: // Dispatch target for recording phase. - |.if JIT - | lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH) - | andix. TMP0, TMP3, HOOK_VMEVENT // No recording while in vmevent. - | bne >5 - | // Decrement the hookcount for consistency, but always do the call. - | lwz TMP2, DISPATCH_GL(hookcount)(DISPATCH) - | andix. TMP0, TMP3, HOOK_ACTIVE - | bne >1 - | subi TMP2, TMP2, 1 - | andi. TMP0, TMP3, LUA_MASKLINE|LUA_MASKCOUNT - | beqy >1 - | stw TMP2, DISPATCH_GL(hookcount)(DISPATCH) - | b >1 - |.endif - | - |->vm_rethook: // Dispatch target for return hooks. - | lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH) - | andix. TMP0, TMP3, HOOK_ACTIVE // Hook already active? - | beq >1 - |5: // Re-dispatch to static ins. - | addi TMP1, TMP1, GG_DISP2STATIC // Assumes decode_OPP TMP1, INS. - | lpx TMP0, DISPATCH, TMP1 - | mtctr TMP0 - | bctr - | - |->vm_inshook: // Dispatch target for instr/line hooks. - | lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH) - | lwz TMP2, DISPATCH_GL(hookcount)(DISPATCH) - | andix. TMP0, TMP3, HOOK_ACTIVE // Hook already active? - | rlwinm TMP0, TMP3, 31-LUA_HOOKLINE, 31, 0 - | bne <5 - | - | cmpwi cr1, TMP0, 0 - | addic. TMP2, TMP2, -1 - | beq cr1, <5 - | stw TMP2, DISPATCH_GL(hookcount)(DISPATCH) - | beq >1 - | bge cr1, <5 - |1: - | mr CARG1, L - | stw MULTRES, SAVE_MULTRES - | mr CARG2, PC - | stp BASE, L->base - | // SAVE_PC must hold the _previous_ PC. The callee updates it with PC. - | bl extern lj_dispatch_ins // (lua_State *L, const BCIns *pc) - |3: - | lp BASE, L->base - |4: // Re-dispatch to static ins. - | lwz INS, -4(PC) - | decode_OPP TMP1, INS - | decode_RB8 RB, INS - | addi TMP1, TMP1, GG_DISP2STATIC - | decode_RD8 RD, INS - | lpx TMP0, DISPATCH, TMP1 - | decode_RA8 RA, INS - | decode_RC8 RC, INS - | mtctr TMP0 - | bctr - | - |->cont_hook: // Continue from hook yield. - | addi PC, PC, 4 - | lwz MULTRES, -20(RB) // Restore MULTRES for *M ins. - | b <4 - | - |->vm_hotloop: // Hot loop counter underflow. - |.if JIT - | lwz LFUNC:TMP1, FRAME_FUNC(BASE) - | addi CARG1, DISPATCH, GG_DISP2J - | stw PC, SAVE_PC - | lwz TMP1, LFUNC:TMP1->pc - | mr CARG2, PC - | stw L, DISPATCH_J(L)(DISPATCH) - | lbz TMP1, PC2PROTO(framesize)(TMP1) - | stp BASE, L->base - | slwi TMP1, TMP1, 3 - | add TMP1, BASE, TMP1 - | stp TMP1, L->top - | bl extern lj_trace_hot // (jit_State *J, const BCIns *pc) - | b <3 - |.endif - | - |->vm_callhook: // Dispatch target for call hooks. - | mr CARG2, PC - |.if JIT - | b >1 - |.endif - | - |->vm_hotcall: // Hot call counter underflow. - |.if JIT - | ori CARG2, PC, 1 - |1: - |.endif - | add TMP0, BASE, RC - | stw PC, SAVE_PC - | mr CARG1, L - | stp BASE, L->base - | sub RA, RA, BASE - | stp TMP0, L->top - | bl extern lj_dispatch_call // (lua_State *L, const BCIns *pc) - | // Returns ASMFunction. - | lp BASE, L->base - | lp TMP0, L->top - | stw ZERO, SAVE_PC // Invalidate for subsequent line hook. - | sub NARGS8:RC, TMP0, BASE - | add RA, BASE, RA - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | lwz INS, -4(PC) - | mtctr CRET1 - | bctr - | - |//----------------------------------------------------------------------- - |//-- Trace exit handler ------------------------------------------------- - |//----------------------------------------------------------------------- - | - |.macro savex_, a, b, c, d - | stfd f..a, 16+a*8(sp) - | stfd f..b, 16+b*8(sp) - | stfd f..c, 16+c*8(sp) - | stfd f..d, 16+d*8(sp) - |.endmacro - | - |->vm_exit_handler: - |.if JIT - | addi sp, sp, -(16+32*8+32*4) - | stmw r2, 16+32*8+2*4(sp) - | addi DISPATCH, JGL, -GG_DISP2G-32768 - | li CARG2, ~LJ_VMST_EXIT - | lwz CARG1, 16+32*8+32*4(sp) // Get stack chain. - | stw CARG2, DISPATCH_GL(vmstate)(DISPATCH) - | savex_ 0,1,2,3 - | stw CARG1, 0(sp) // Store extended stack chain. - | clrso TMP1 - | savex_ 4,5,6,7 - | addi CARG2, sp, 16+32*8+32*4 // Recompute original value of sp. - | savex_ 8,9,10,11 - | stw CARG2, 16+32*8+1*4(sp) // Store sp in RID_SP. - | savex_ 12,13,14,15 - | mflr CARG3 - | li TMP1, 0 - | savex_ 16,17,18,19 - | stw TMP1, 16+32*8+0*4(sp) // Clear RID_TMP. - | savex_ 20,21,22,23 - | lhz CARG4, 2(CARG3) // Load trace number. - | savex_ 24,25,26,27 - | lwz L, DISPATCH_GL(jit_L)(DISPATCH) - | savex_ 28,29,30,31 - | sub CARG3, TMP0, CARG3 // Compute exit number. - | lp BASE, DISPATCH_GL(jit_base)(DISPATCH) - | srwi CARG3, CARG3, 2 - | stw L, DISPATCH_J(L)(DISPATCH) - | subi CARG3, CARG3, 2 - | stw TMP1, DISPATCH_GL(jit_L)(DISPATCH) - | stw CARG4, DISPATCH_J(parent)(DISPATCH) - | stp BASE, L->base - | addi CARG1, DISPATCH, GG_DISP2J - | stw CARG3, DISPATCH_J(exitno)(DISPATCH) - | addi CARG2, sp, 16 - | bl extern lj_trace_exit // (jit_State *J, ExitState *ex) - | // Returns MULTRES (unscaled) or negated error code. - | lp TMP1, L->cframe - | lwz TMP2, 0(sp) - | lp BASE, L->base - |.if GPR64 - | rldicr sp, TMP1, 0, 61 - |.else - | rlwinm sp, TMP1, 0, 0, 29 - |.endif - | lwz PC, SAVE_PC // Get SAVE_PC. - | stw TMP2, 0(sp) - | stw L, SAVE_L // Set SAVE_L (on-trace resume/yield). - | b >1 - |.endif - |->vm_exit_interp: - |.if JIT - | // CARG1 = MULTRES or negated error code, BASE, PC and JGL set. - | lwz L, SAVE_L - | addi DISPATCH, JGL, -GG_DISP2G-32768 - |1: - | cmpwi CARG1, 0 - | blt >3 // Check for error from exit. - | lwz LFUNC:TMP1, FRAME_FUNC(BASE) - | slwi MULTRES, CARG1, 3 - | li TMP2, 0 - | stw MULTRES, SAVE_MULTRES - | lwz TMP1, LFUNC:TMP1->pc - | stw TMP2, DISPATCH_GL(jit_L)(DISPATCH) - | lwz KBASE, PC2PROTO(k)(TMP1) - | // Setup type comparison constants. - | li TISNUM, LJ_TISNUM - | lus TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). - | stw TMP3, TMPD - | li ZERO, 0 - | ori TMP3, TMP3, 0x0004 // TONUM = 2^52 + 2^51 + 2^31 (float). - | lfs TOBIT, TMPD - | stw TMP3, TMPD - | lus TMP0, 0x4338 // Hiword of 2^52 + 2^51 (double) - | li TISNIL, LJ_TNIL - | stw TMP0, TONUM_HI - | lfs TONUM, TMPD - | // Modified copy of ins_next which handles function header dispatch, too. - | lwz INS, 0(PC) - | addi PC, PC, 4 - | // Assumes TISNIL == ~LJ_VMST_INTERP == -1. - | stw TISNIL, DISPATCH_GL(vmstate)(DISPATCH) - | decode_OPP TMP1, INS - | decode_RA8 RA, INS - | lpx TMP0, DISPATCH, TMP1 - | mtctr TMP0 - | cmplwi TMP1, BC_FUNCF*4 // Function header? - | bge >2 - | decode_RB8 RB, INS - | decode_RD8 RD, INS - | decode_RC8 RC, INS - | bctr - |2: - | subi RC, MULTRES, 8 - | add RA, RA, BASE - | bctr - | - |3: // Rethrow error from the right C frame. - | neg CARG2, CARG1 - | mr CARG1, L - | bl extern lj_err_throw // (lua_State *L, int errcode) - |.endif - | - |//----------------------------------------------------------------------- - |//-- Math helper functions ---------------------------------------------- - |//----------------------------------------------------------------------- - | - |// NYI: Use internal implementations of floor, ceil, trunc. - | - |->vm_modi: - | divwo. TMP0, CARG1, CARG2 - | bso >1 - |.if GPR64 - | xor CARG3, CARG1, CARG2 - | cmpwi CARG3, 0 - |.else - | xor. CARG3, CARG1, CARG2 - |.endif - | mullw TMP0, TMP0, CARG2 - | sub CARG1, CARG1, TMP0 - | bgelr - | cmpwi CARG1, 0; beqlr - | add CARG1, CARG1, CARG2 - | blr - |1: - | cmpwi CARG2, 0 - | li CARG1, 0 - | beqlr - | clrso TMP0 // Clear SO for -2147483648 % -1 and return 0. - | blr - | - |//----------------------------------------------------------------------- - |//-- Miscellaneous functions -------------------------------------------- - |//----------------------------------------------------------------------- - | - |// void lj_vm_cachesync(void *start, void *end) - |// Flush D-Cache and invalidate I-Cache. Assumes 32 byte cache line size. - |// This is a good lower bound, except for very ancient PPC models. - |->vm_cachesync: - |.if JIT or FFI - | // Compute start of first cache line and number of cache lines. - | rlwinm CARG1, CARG1, 0, 0, 26 - | sub CARG2, CARG2, CARG1 - | addi CARG2, CARG2, 31 - | rlwinm. CARG2, CARG2, 27, 5, 31 - | beqlr - | mtctr CARG2 - | mr CARG3, CARG1 - |1: // Flush D-Cache. - | dcbst r0, CARG1 - | addi CARG1, CARG1, 32 - | bdnz <1 - | sync - | mtctr CARG2 - |1: // Invalidate I-Cache. - | icbi r0, CARG3 - | addi CARG3, CARG3, 32 - | bdnz <1 - | isync - | blr - |.endif - | - |//----------------------------------------------------------------------- - |//-- FFI helper functions ----------------------------------------------- - |//----------------------------------------------------------------------- - | - |// Handler for callback functions. Callback slot number in r11, g in r12. - |->vm_ffi_callback: - |.if FFI - |.type CTSTATE, CTState, PC - | saveregs - | lwz CTSTATE, GL:r12->ctype_state - | addi DISPATCH, r12, GG_G2DISP - | stw r11, CTSTATE->cb.slot - | stw r3, CTSTATE->cb.gpr[0] - | stfd f1, CTSTATE->cb.fpr[0] - | stw r4, CTSTATE->cb.gpr[1] - | stfd f2, CTSTATE->cb.fpr[1] - | stw r5, CTSTATE->cb.gpr[2] - | stfd f3, CTSTATE->cb.fpr[2] - | stw r6, CTSTATE->cb.gpr[3] - | stfd f4, CTSTATE->cb.fpr[3] - | stw r7, CTSTATE->cb.gpr[4] - | stfd f5, CTSTATE->cb.fpr[4] - | stw r8, CTSTATE->cb.gpr[5] - | stfd f6, CTSTATE->cb.fpr[5] - | stw r9, CTSTATE->cb.gpr[6] - | stfd f7, CTSTATE->cb.fpr[6] - | stw r10, CTSTATE->cb.gpr[7] - | stfd f8, CTSTATE->cb.fpr[7] - | addi TMP0, sp, CFRAME_SPACE+8 - | stw TMP0, CTSTATE->cb.stack - | mr CARG1, CTSTATE - | stw CTSTATE, SAVE_PC // Any value outside of bytecode is ok. - | mr CARG2, sp - | bl extern lj_ccallback_enter // (CTState *cts, void *cf) - | // Returns lua_State *. - | lp BASE, L:CRET1->base - | li TISNUM, LJ_TISNUM // Setup type comparison constants. - | lp RC, L:CRET1->top - | lus TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). - | li ZERO, 0 - | mr L, CRET1 - | stw TMP3, TMPD - | lus TMP0, 0x4338 // Hiword of 2^52 + 2^51 (double) - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | ori TMP3, TMP3, 0x0004 // TONUM = 2^52 + 2^51 + 2^31 (float). - | stw TMP0, TONUM_HI - | li TISNIL, LJ_TNIL - | li_vmstate INTERP - | lfs TOBIT, TMPD - | stw TMP3, TMPD - | sub RC, RC, BASE - | st_vmstate - | lfs TONUM, TMPD - | ins_callt - |.endif - | - |->cont_ffi_callback: // Return from FFI callback. - |.if FFI - | lwz CTSTATE, DISPATCH_GL(ctype_state)(DISPATCH) - | stp BASE, L->base - | stp RB, L->top - | stp L, CTSTATE->L - | mr CARG1, CTSTATE - | mr CARG2, RA - | bl extern lj_ccallback_leave // (CTState *cts, TValue *o) - | lwz CRET1, CTSTATE->cb.gpr[0] - | lfd FARG1, CTSTATE->cb.fpr[0] - | lwz CRET2, CTSTATE->cb.gpr[1] - | b ->vm_leave_unw - |.endif - | - |->vm_ffi_call: // Call C function via FFI. - | // Caveat: needs special frame unwinding, see below. - |.if FFI - | .type CCSTATE, CCallState, CARG1 - | lwz TMP1, CCSTATE->spadj - | mflr TMP0 - | lbz CARG2, CCSTATE->nsp - | lbz CARG3, CCSTATE->nfpr - | neg TMP1, TMP1 - | stw TMP0, 4(sp) - | cmpwi cr1, CARG3, 0 - | mr TMP2, sp - | addic. CARG2, CARG2, -1 - | stwux sp, sp, TMP1 - | crnot 4*cr1+eq, 4*cr1+eq // For vararg calls. - | stw r14, -4(TMP2) - | stw CCSTATE, -8(TMP2) - | mr r14, TMP2 - | la TMP1, CCSTATE->stack - | slwi CARG2, CARG2, 2 - | blty >2 - | la TMP2, 8(sp) - |1: - | lwzx TMP0, TMP1, CARG2 - | stwx TMP0, TMP2, CARG2 - | addic. CARG2, CARG2, -4 - | bge <1 - |2: - | bney cr1, >3 - | lfd f1, CCSTATE->fpr[0] - | lfd f2, CCSTATE->fpr[1] - | lfd f3, CCSTATE->fpr[2] - | lfd f4, CCSTATE->fpr[3] - | lfd f5, CCSTATE->fpr[4] - | lfd f6, CCSTATE->fpr[5] - | lfd f7, CCSTATE->fpr[6] - | lfd f8, CCSTATE->fpr[7] - |3: - | lp TMP0, CCSTATE->func - | lwz CARG2, CCSTATE->gpr[1] - | lwz CARG3, CCSTATE->gpr[2] - | lwz CARG4, CCSTATE->gpr[3] - | lwz CARG5, CCSTATE->gpr[4] - | mtctr TMP0 - | lwz r8, CCSTATE->gpr[5] - | lwz r9, CCSTATE->gpr[6] - | lwz r10, CCSTATE->gpr[7] - | lwz CARG1, CCSTATE->gpr[0] // Do this last, since CCSTATE is CARG1. - | bctrl - | lwz CCSTATE:TMP1, -8(r14) - | lwz TMP2, -4(r14) - | lwz TMP0, 4(r14) - | stw CARG1, CCSTATE:TMP1->gpr[0] - | stfd FARG1, CCSTATE:TMP1->fpr[0] - | stw CARG2, CCSTATE:TMP1->gpr[1] - | mtlr TMP0 - | stw CARG3, CCSTATE:TMP1->gpr[2] - | mr sp, r14 - | stw CARG4, CCSTATE:TMP1->gpr[3] - | mr r14, TMP2 - | blr - |.endif - |// Note: vm_ffi_call must be the last function in this object file! - | - |//----------------------------------------------------------------------- -} - -/* Generate the code for a single instruction. */ -static void build_ins(BuildCtx *ctx, BCOp op, int defop) -{ - int vk = 0; - |=>defop: - - switch (op) { - - /* -- Comparison ops ---------------------------------------------------- */ - - /* Remember: all ops branch for a true comparison, fall through otherwise. */ - - case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: - | // RA = src1*8, RD = src2*8, JMP with RD = target - |.if DUALNUM - | lwzux TMP0, RA, BASE - | addi PC, PC, 4 - | lwz CARG2, 4(RA) - | lwzux TMP1, RD, BASE - | lwz TMP2, -4(PC) - | checknum cr0, TMP0 - | lwz CARG3, 4(RD) - | decode_RD4 TMP2, TMP2 - | checknum cr1, TMP1 - | addis TMP2, TMP2, -(BCBIAS_J*4 >> 16) - | bne cr0, >7 - | bne cr1, >8 - | cmpw CARG2, CARG3 - if (op == BC_ISLT) { - | bge >2 - } else if (op == BC_ISGE) { - | blt >2 - } else if (op == BC_ISLE) { - | bgt >2 - } else { - | ble >2 - } - |1: - | add PC, PC, TMP2 - |2: - | ins_next - | - |7: // RA is not an integer. - | bgt cr0, ->vmeta_comp - | // RA is a number. - | lfd f0, 0(RA) - | bgt cr1, ->vmeta_comp - | blt cr1, >4 - | // RA is a number, RD is an integer. - | tonum_i f1, CARG3 - | b >5 - | - |8: // RA is an integer, RD is not an integer. - | bgt cr1, ->vmeta_comp - | // RA is an integer, RD is a number. - | tonum_i f0, CARG2 - |4: - | lfd f1, 0(RD) - |5: - | fcmpu cr0, f0, f1 - if (op == BC_ISLT) { - | bge <2 - } else if (op == BC_ISGE) { - | blt <2 - } else if (op == BC_ISLE) { - | cror 4*cr0+lt, 4*cr0+lt, 4*cr0+eq - | bge <2 - } else { - | cror 4*cr0+lt, 4*cr0+lt, 4*cr0+eq - | blt <2 - } - | b <1 - |.else - | lwzx TMP0, BASE, RA - | addi PC, PC, 4 - | lfdx f0, BASE, RA - | lwzx TMP1, BASE, RD - | checknum cr0, TMP0 - | lwz TMP2, -4(PC) - | lfdx f1, BASE, RD - | checknum cr1, TMP1 - | decode_RD4 TMP2, TMP2 - | bge cr0, ->vmeta_comp - | addis TMP2, TMP2, -(BCBIAS_J*4 >> 16) - | bge cr1, ->vmeta_comp - | fcmpu cr0, f0, f1 - if (op == BC_ISLT) { - | bge >1 - } else if (op == BC_ISGE) { - | blt >1 - } else if (op == BC_ISLE) { - | cror 4*cr0+lt, 4*cr0+lt, 4*cr0+eq - | bge >1 - } else { - | cror 4*cr0+lt, 4*cr0+lt, 4*cr0+eq - | blt >1 - } - | add PC, PC, TMP2 - |1: - | ins_next - |.endif - break; - - case BC_ISEQV: case BC_ISNEV: - vk = op == BC_ISEQV; - | // RA = src1*8, RD = src2*8, JMP with RD = target - |.if DUALNUM - | lwzux TMP0, RA, BASE - | addi PC, PC, 4 - | lwz CARG2, 4(RA) - | lwzux TMP1, RD, BASE - | checknum cr0, TMP0 - | lwz TMP2, -4(PC) - | checknum cr1, TMP1 - | decode_RD4 TMP2, TMP2 - | lwz CARG3, 4(RD) - | cror 4*cr7+gt, 4*cr0+gt, 4*cr1+gt - | addis TMP2, TMP2, -(BCBIAS_J*4 >> 16) - if (vk) { - | ble cr7, ->BC_ISEQN_Z - } else { - | ble cr7, ->BC_ISNEN_Z - } - |.else - | lwzux TMP0, RA, BASE - | lwz TMP2, 0(PC) - | lfd f0, 0(RA) - | addi PC, PC, 4 - | lwzux TMP1, RD, BASE - | checknum cr0, TMP0 - | decode_RD4 TMP2, TMP2 - | lfd f1, 0(RD) - | checknum cr1, TMP1 - | addis TMP2, TMP2, -(BCBIAS_J*4 >> 16) - | bge cr0, >5 - | bge cr1, >5 - | fcmpu cr0, f0, f1 - if (vk) { - | bne >1 - | add PC, PC, TMP2 - } else { - | beq >1 - | add PC, PC, TMP2 - } - |1: - | ins_next - |.endif - |5: // Either or both types are not numbers. - |.if not DUALNUM - | lwz CARG2, 4(RA) - | lwz CARG3, 4(RD) - |.endif - |.if FFI - | cmpwi cr7, TMP0, LJ_TCDATA - | cmpwi cr5, TMP1, LJ_TCDATA - |.endif - | not TMP3, TMP0 - | cmplw TMP0, TMP1 - | cmplwi cr1, TMP3, ~LJ_TISPRI // Primitive? - |.if FFI - | cror 4*cr7+eq, 4*cr7+eq, 4*cr5+eq - |.endif - | cmplwi cr6, TMP3, ~LJ_TISTABUD // Table or userdata? - |.if FFI - | beq cr7, ->vmeta_equal_cd - |.endif - | cmplw cr5, CARG2, CARG3 - | crandc 4*cr0+gt, 4*cr0+eq, 4*cr1+gt // 2: Same type and primitive. - | crorc 4*cr0+lt, 4*cr5+eq, 4*cr0+eq // 1: Same tv or different type. - | crand 4*cr0+eq, 4*cr0+eq, 4*cr5+eq // 0: Same type and same tv. - | mr SAVE0, PC - | cror 4*cr0+eq, 4*cr0+eq, 4*cr0+gt // 0 or 2. - | cror 4*cr0+lt, 4*cr0+lt, 4*cr0+gt // 1 or 2. - if (vk) { - | bne cr0, >6 - | add PC, PC, TMP2 - |6: - } else { - | beq cr0, >6 - | add PC, PC, TMP2 - |6: - } - |.if DUALNUM - | bge cr0, >2 // Done if 1 or 2. - |1: - | ins_next - |2: - |.else - | blt cr0, <1 // Done if 1 or 2. - |.endif - | blt cr6, <1 // Done if not tab/ud. - | - | // Different tables or userdatas. Need to check __eq metamethod. - | // Field metatable must be at same offset for GCtab and GCudata! - | lwz TAB:TMP2, TAB:CARG2->metatable - | li CARG4, 1-vk // ne = 0 or 1. - | cmplwi TAB:TMP2, 0 - | beq <1 // No metatable? - | lbz TMP2, TAB:TMP2->nomm - | andix. TMP2, TMP2, 1<vmeta_equal // Handle __eq metamethod. - break; - - case BC_ISEQS: case BC_ISNES: - vk = op == BC_ISEQS; - | // RA = src*8, RD = str_const*8 (~), JMP with RD = target - | lwzux TMP0, RA, BASE - | srwi RD, RD, 1 - | lwz STR:TMP3, 4(RA) - | lwz TMP2, 0(PC) - | subfic RD, RD, -4 - | addi PC, PC, 4 - |.if FFI - | cmpwi TMP0, LJ_TCDATA - |.endif - | lwzx STR:TMP1, KBASE, RD // KBASE-4-str_const*4 - | .gpr64 extsw TMP0, TMP0 - | subfic TMP0, TMP0, LJ_TSTR - |.if FFI - | beq ->vmeta_equal_cd - |.endif - | sub TMP1, STR:TMP1, STR:TMP3 - | or TMP0, TMP0, TMP1 - | decode_RD4 TMP2, TMP2 - | subfic TMP0, TMP0, 0 - | addis TMP2, TMP2, -(BCBIAS_J*4 >> 16) - | subfe TMP1, TMP1, TMP1 - if (vk) { - | andc TMP2, TMP2, TMP1 - } else { - | and TMP2, TMP2, TMP1 - } - | add PC, PC, TMP2 - | ins_next - break; - - case BC_ISEQN: case BC_ISNEN: - vk = op == BC_ISEQN; - | // RA = src*8, RD = num_const*8, JMP with RD = target - |.if DUALNUM - | lwzux TMP0, RA, BASE - | addi PC, PC, 4 - | lwz CARG2, 4(RA) - | lwzux TMP1, RD, KBASE - | checknum cr0, TMP0 - | lwz TMP2, -4(PC) - | checknum cr1, TMP1 - | decode_RD4 TMP2, TMP2 - | lwz CARG3, 4(RD) - | addis TMP2, TMP2, -(BCBIAS_J*4 >> 16) - if (vk) { - |->BC_ISEQN_Z: - } else { - |->BC_ISNEN_Z: - } - | bne cr0, >7 - | bne cr1, >8 - | cmpw CARG2, CARG3 - |4: - |.else - if (vk) { - |->BC_ISEQN_Z: // Dummy label. - } else { - |->BC_ISNEN_Z: // Dummy label. - } - | lwzx TMP0, BASE, RA - | addi PC, PC, 4 - | lfdx f0, BASE, RA - | lwz TMP2, -4(PC) - | lfdx f1, KBASE, RD - | decode_RD4 TMP2, TMP2 - | checknum TMP0 - | addis TMP2, TMP2, -(BCBIAS_J*4 >> 16) - | bge >3 - | fcmpu cr0, f0, f1 - |.endif - if (vk) { - | bne >1 - | add PC, PC, TMP2 - |1: - |.if not FFI - |3: - |.endif - } else { - | beq >2 - |1: - |.if not FFI - |3: - |.endif - | add PC, PC, TMP2 - |2: - } - | ins_next - |.if FFI - |3: - | cmpwi TMP0, LJ_TCDATA - | beq ->vmeta_equal_cd - | b <1 - |.endif - |.if DUALNUM - |7: // RA is not an integer. - | bge cr0, <3 - | // RA is a number. - | lfd f0, 0(RA) - | blt cr1, >1 - | // RA is a number, RD is an integer. - | tonum_i f1, CARG3 - | b >2 - | - |8: // RA is an integer, RD is a number. - | tonum_i f0, CARG2 - |1: - | lfd f1, 0(RD) - |2: - | fcmpu cr0, f0, f1 - | b <4 - |.endif - break; - - case BC_ISEQP: case BC_ISNEP: - vk = op == BC_ISEQP; - | // RA = src*8, RD = primitive_type*8 (~), JMP with RD = target - | lwzx TMP0, BASE, RA - | srwi TMP1, RD, 3 - | lwz TMP2, 0(PC) - | not TMP1, TMP1 - | addi PC, PC, 4 - |.if FFI - | cmpwi TMP0, LJ_TCDATA - |.endif - | sub TMP0, TMP0, TMP1 - |.if FFI - | beq ->vmeta_equal_cd - |.endif - | decode_RD4 TMP2, TMP2 - | .gpr64 extsw TMP0, TMP0 - | addic TMP0, TMP0, -1 - | addis TMP2, TMP2, -(BCBIAS_J*4 >> 16) - | subfe TMP1, TMP1, TMP1 - if (vk) { - | and TMP2, TMP2, TMP1 - } else { - | andc TMP2, TMP2, TMP1 - } - | add PC, PC, TMP2 - | ins_next - break; - - /* -- Unary test and copy ops ------------------------------------------- */ - - case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: - | // RA = dst*8 or unused, RD = src*8, JMP with RD = target - | lwzx TMP0, BASE, RD - | lwz INS, 0(PC) - | addi PC, PC, 4 - if (op == BC_IST || op == BC_ISF) { - | .gpr64 extsw TMP0, TMP0 - | subfic TMP0, TMP0, LJ_TTRUE - | decode_RD4 TMP2, INS - | subfe TMP1, TMP1, TMP1 - | addis TMP2, TMP2, -(BCBIAS_J*4 >> 16) - if (op == BC_IST) { - | andc TMP2, TMP2, TMP1 - } else { - | and TMP2, TMP2, TMP1 - } - | add PC, PC, TMP2 - } else { - | li TMP1, LJ_TFALSE - | lfdx f0, BASE, RD - | cmplw TMP0, TMP1 - if (op == BC_ISTC) { - | bge >1 - } else { - | blt >1 - } - | addis PC, PC, -(BCBIAS_J*4 >> 16) - | decode_RD4 TMP2, INS - | stfdx f0, BASE, RA - | add PC, PC, TMP2 - |1: - } - | ins_next - break; - - /* -- Unary ops --------------------------------------------------------- */ - - case BC_MOV: - | // RA = dst*8, RD = src*8 - | ins_next1 - | lfdx f0, BASE, RD - | stfdx f0, BASE, RA - | ins_next2 - break; - case BC_NOT: - | // RA = dst*8, RD = src*8 - | ins_next1 - | lwzx TMP0, BASE, RD - | .gpr64 extsw TMP0, TMP0 - | subfic TMP1, TMP0, LJ_TTRUE - | adde TMP0, TMP0, TMP1 - | stwx TMP0, BASE, RA - | ins_next2 - break; - case BC_UNM: - | // RA = dst*8, RD = src*8 - | lwzux TMP1, RD, BASE - | lwz TMP0, 4(RD) - | checknum TMP1 - |.if DUALNUM - | bne >5 - |.if GPR64 - | lus TMP2, 0x8000 - | neg TMP0, TMP0 - | cmplw TMP0, TMP2 - | beq >4 - |.else - | nego. TMP0, TMP0 - | bso >4 - |1: - |.endif - | ins_next1 - | stwux TISNUM, RA, BASE - | stw TMP0, 4(RA) - |3: - | ins_next2 - |4: - |.if not GPR64 - | // Potential overflow. - | checkov TMP1, <1 // Ignore unrelated overflow. - |.endif - | lus TMP1, 0x41e0 // 2^31. - | li TMP0, 0 - | b >7 - |.endif - |5: - | bge ->vmeta_unm - | xoris TMP1, TMP1, 0x8000 - |7: - | ins_next1 - | stwux TMP1, RA, BASE - | stw TMP0, 4(RA) - |.if DUALNUM - | b <3 - |.else - | ins_next2 - |.endif - break; - case BC_LEN: - | // RA = dst*8, RD = src*8 - | lwzux TMP0, RD, BASE - | lwz CARG1, 4(RD) - | checkstr TMP0; bne >2 - | lwz CRET1, STR:CARG1->len - |1: - |.if DUALNUM - | ins_next1 - | stwux TISNUM, RA, BASE - | stw CRET1, 4(RA) - |.else - | tonum_u f0, CRET1 // Result is a non-negative integer. - | ins_next1 - | stfdx f0, BASE, RA - |.endif - | ins_next2 - |2: - | checktab TMP0; bne ->vmeta_len -#if LJ_52 - | lwz TAB:TMP2, TAB:CARG1->metatable - | cmplwi TAB:TMP2, 0 - | bne >9 - |3: -#endif - |->BC_LEN_Z: - | bl extern lj_tab_len // (GCtab *t) - | // Returns uint32_t (but less than 2^31). - | b <1 -#if LJ_52 - |9: - | lbz TMP0, TAB:TMP2->nomm - | andix. TMP0, TMP0, 1<vmeta_len -#endif - break; - - /* -- Binary ops -------------------------------------------------------- */ - - |.macro ins_arithpre - | // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8 - ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); - ||switch (vk) { - ||case 0: - | lwzx TMP1, BASE, RB - | .if DUALNUM - | lwzx TMP2, KBASE, RC - | .endif - | lfdx f14, BASE, RB - | lfdx f15, KBASE, RC - | .if DUALNUM - | checknum cr0, TMP1 - | checknum cr1, TMP2 - | crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt - | bge ->vmeta_arith_vn - | .else - | checknum TMP1; bge ->vmeta_arith_vn - | .endif - || break; - ||case 1: - | lwzx TMP1, BASE, RB - | .if DUALNUM - | lwzx TMP2, KBASE, RC - | .endif - | lfdx f15, BASE, RB - | lfdx f14, KBASE, RC - | .if DUALNUM - | checknum cr0, TMP1 - | checknum cr1, TMP2 - | crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt - | bge ->vmeta_arith_nv - | .else - | checknum TMP1; bge ->vmeta_arith_nv - | .endif - || break; - ||default: - | lwzx TMP1, BASE, RB - | lwzx TMP2, BASE, RC - | lfdx f14, BASE, RB - | lfdx f15, BASE, RC - | checknum cr0, TMP1 - | checknum cr1, TMP2 - | crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt - | bge ->vmeta_arith_vv - || break; - ||} - |.endmacro - | - |.macro ins_arithfallback, ins - ||switch (vk) { - ||case 0: - | ins ->vmeta_arith_vn2 - || break; - ||case 1: - | ins ->vmeta_arith_nv2 - || break; - ||default: - | ins ->vmeta_arith_vv2 - || break; - ||} - |.endmacro - | - |.macro intmod, a, b, c - | bl ->vm_modi - |.endmacro - | - |.macro fpmod, a, b, c - |->BC_MODVN_Z: - | fdiv FARG1, b, c - | // NYI: Use internal implementation of floor. - | blex floor // floor(b/c) - | fmul a, FARG1, c - | fsub a, b, a // b - floor(b/c)*c - |.endmacro - | - |.macro ins_arithfp, fpins - | ins_arithpre - |.if "fpins" == "fpmod_" - | b ->BC_MODVN_Z // Avoid 3 copies. It's slow anyway. - |.else - | fpins f0, f14, f15 - | ins_next1 - | stfdx f0, BASE, RA - | ins_next2 - |.endif - |.endmacro - | - |.macro ins_arithdn, intins, fpins - | // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8 - ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); - ||switch (vk) { - ||case 0: - | lwzux TMP1, RB, BASE - | lwzux TMP2, RC, KBASE - | lwz CARG1, 4(RB) - | checknum cr0, TMP1 - | lwz CARG2, 4(RC) - || break; - ||case 1: - | lwzux TMP1, RB, BASE - | lwzux TMP2, RC, KBASE - | lwz CARG2, 4(RB) - | checknum cr0, TMP1 - | lwz CARG1, 4(RC) - || break; - ||default: - | lwzux TMP1, RB, BASE - | lwzux TMP2, RC, BASE - | lwz CARG1, 4(RB) - | checknum cr0, TMP1 - | lwz CARG2, 4(RC) - || break; - ||} - | checknum cr1, TMP2 - | bne >5 - | bne cr1, >5 - | intins CARG1, CARG1, CARG2 - | bso >4 - |1: - | ins_next1 - | stwux TISNUM, RA, BASE - | stw CARG1, 4(RA) - |2: - | ins_next2 - |4: // Overflow. - | checkov TMP0, <1 // Ignore unrelated overflow. - | ins_arithfallback b - |5: // FP variant. - ||if (vk == 1) { - | lfd f15, 0(RB) - | crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt - | lfd f14, 0(RC) - ||} else { - | lfd f14, 0(RB) - | crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt - | lfd f15, 0(RC) - ||} - | ins_arithfallback bge - |.if "fpins" == "fpmod_" - | b ->BC_MODVN_Z // Avoid 3 copies. It's slow anyway. - |.else - | fpins f0, f14, f15 - | ins_next1 - | stfdx f0, BASE, RA - | b <2 - |.endif - |.endmacro - | - |.macro ins_arith, intins, fpins - |.if DUALNUM - | ins_arithdn intins, fpins - |.else - | ins_arithfp fpins - |.endif - |.endmacro - - case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: - |.if GPR64 - |.macro addo32., y, a, b - | // Need to check overflow for (a<<32) + (b<<32). - | rldicr TMP0, a, 32, 31 - | rldicr TMP3, b, 32, 31 - | addo. TMP0, TMP0, TMP3 - | add y, a, b - |.endmacro - | ins_arith addo32., fadd - |.else - | ins_arith addo., fadd - |.endif - break; - case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: - |.if GPR64 - |.macro subo32., y, a, b - | // Need to check overflow for (a<<32) - (b<<32). - | rldicr TMP0, a, 32, 31 - | rldicr TMP3, b, 32, 31 - | subo. TMP0, TMP0, TMP3 - | sub y, a, b - |.endmacro - | ins_arith subo32., fsub - |.else - | ins_arith subo., fsub - |.endif - break; - case BC_MULVN: case BC_MULNV: case BC_MULVV: - | ins_arith mullwo., fmul - break; - case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: - | ins_arithfp fdiv - break; - case BC_MODVN: - | ins_arith intmod, fpmod - break; - case BC_MODNV: case BC_MODVV: - | ins_arith intmod, fpmod_ - break; - case BC_POW: - | // NYI: (partial) integer arithmetic. - | lwzx TMP1, BASE, RB - | lfdx FARG1, BASE, RB - | lwzx TMP2, BASE, RC - | lfdx FARG2, BASE, RC - | checknum cr0, TMP1 - | checknum cr1, TMP2 - | crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt - | bge ->vmeta_arith_vv - | blex pow - | ins_next1 - | stfdx FARG1, BASE, RA - | ins_next2 - break; - - case BC_CAT: - | // RA = dst*8, RB = src_start*8, RC = src_end*8 - | sub CARG3, RC, RB - | stp BASE, L->base - | add CARG2, BASE, RC - | mr SAVE0, RB - |->BC_CAT_Z: - | stw PC, SAVE_PC - | mr CARG1, L - | srwi CARG3, CARG3, 3 - | bl extern lj_meta_cat // (lua_State *L, TValue *top, int left) - | // Returns NULL (finished) or TValue * (metamethod). - | cmplwi CRET1, 0 - | lp BASE, L->base - | bne ->vmeta_binop - | ins_next1 - | lfdx f0, BASE, SAVE0 // Copy result from RB to RA. - | stfdx f0, BASE, RA - | ins_next2 - break; - - /* -- Constant ops ------------------------------------------------------ */ - - case BC_KSTR: - | // RA = dst*8, RD = str_const*8 (~) - | srwi TMP1, RD, 1 - | subfic TMP1, TMP1, -4 - | ins_next1 - | lwzx TMP0, KBASE, TMP1 // KBASE-4-str_const*4 - | li TMP2, LJ_TSTR - | stwux TMP2, RA, BASE - | stw TMP0, 4(RA) - | ins_next2 - break; - case BC_KCDATA: - |.if FFI - | // RA = dst*8, RD = cdata_const*8 (~) - | srwi TMP1, RD, 1 - | subfic TMP1, TMP1, -4 - | ins_next1 - | lwzx TMP0, KBASE, TMP1 // KBASE-4-cdata_const*4 - | li TMP2, LJ_TCDATA - | stwux TMP2, RA, BASE - | stw TMP0, 4(RA) - | ins_next2 - |.endif - break; - case BC_KSHORT: - | // RA = dst*8, RD = int16_literal*8 - |.if DUALNUM - | slwi RD, RD, 13 - | srawi RD, RD, 16 - | ins_next1 - | stwux TISNUM, RA, BASE - | stw RD, 4(RA) - | ins_next2 - |.else - | // The soft-float approach is faster. - | slwi RD, RD, 13 - | srawi TMP1, RD, 31 - | xor TMP2, TMP1, RD - | sub TMP2, TMP2, TMP1 // TMP2 = abs(x) - | cntlzw TMP3, TMP2 - | subfic TMP1, TMP3, 0x40d // TMP1 = exponent-1 - | slw TMP2, TMP2, TMP3 // TMP2 = left aligned mantissa - | subfic TMP3, RD, 0 - | slwi TMP1, TMP1, 20 - | rlwimi RD, TMP2, 21, 1, 31 // hi = sign(x) | (mantissa>>11) - | subfe TMP0, TMP0, TMP0 - | add RD, RD, TMP1 // hi = hi + exponent-1 - | and RD, RD, TMP0 // hi = x == 0 ? 0 : hi - | ins_next1 - | stwux RD, RA, BASE - | stw ZERO, 4(RA) - | ins_next2 - |.endif - break; - case BC_KNUM: - | // RA = dst*8, RD = num_const*8 - | ins_next1 - | lfdx f0, KBASE, RD - | stfdx f0, BASE, RA - | ins_next2 - break; - case BC_KPRI: - | // RA = dst*8, RD = primitive_type*8 (~) - | srwi TMP1, RD, 3 - | not TMP0, TMP1 - | ins_next1 - | stwx TMP0, BASE, RA - | ins_next2 - break; - case BC_KNIL: - | // RA = base*8, RD = end*8 - | stwx TISNIL, BASE, RA - | addi RA, RA, 8 - |1: - | stwx TISNIL, BASE, RA - | cmpw RA, RD - | addi RA, RA, 8 - | blt <1 - | ins_next_ - break; - - /* -- Upvalue and function ops ------------------------------------------ */ - - case BC_UGET: - | // RA = dst*8, RD = uvnum*8 - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | srwi RD, RD, 1 - | addi RD, RD, offsetof(GCfuncL, uvptr) - | lwzx UPVAL:RB, LFUNC:RB, RD - | ins_next1 - | lwz TMP1, UPVAL:RB->v - | lfd f0, 0(TMP1) - | stfdx f0, BASE, RA - | ins_next2 - break; - case BC_USETV: - | // RA = uvnum*8, RD = src*8 - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | srwi RA, RA, 1 - | addi RA, RA, offsetof(GCfuncL, uvptr) - | lfdux f0, RD, BASE - | lwzx UPVAL:RB, LFUNC:RB, RA - | lbz TMP3, UPVAL:RB->marked - | lwz CARG2, UPVAL:RB->v - | andix. TMP3, TMP3, LJ_GC_BLACK // isblack(uv) - | lbz TMP0, UPVAL:RB->closed - | lwz TMP2, 0(RD) - | stfd f0, 0(CARG2) - | cmplwi cr1, TMP0, 0 - | lwz TMP1, 4(RD) - | cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq - | subi TMP2, TMP2, (LJ_TNUMX+1) - | bne >2 // Upvalue is closed and black? - |1: - | ins_next - | - |2: // Check if new value is collectable. - | cmplwi TMP2, LJ_TISGCV - (LJ_TNUMX+1) - | bge <1 // tvisgcv(v) - | lbz TMP3, GCOBJ:TMP1->gch.marked - | andix. TMP3, TMP3, LJ_GC_WHITES // iswhite(v) - | la CARG1, GG_DISP2G(DISPATCH) - | // Crossed a write barrier. Move the barrier forward. - | beq <1 - | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) - | b <1 - break; - case BC_USETS: - | // RA = uvnum*8, RD = str_const*8 (~) - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | srwi TMP1, RD, 1 - | srwi RA, RA, 1 - | subfic TMP1, TMP1, -4 - | addi RA, RA, offsetof(GCfuncL, uvptr) - | lwzx STR:TMP1, KBASE, TMP1 // KBASE-4-str_const*4 - | lwzx UPVAL:RB, LFUNC:RB, RA - | lbz TMP3, UPVAL:RB->marked - | lwz CARG2, UPVAL:RB->v - | andix. TMP3, TMP3, LJ_GC_BLACK // isblack(uv) - | lbz TMP3, STR:TMP1->marked - | lbz TMP2, UPVAL:RB->closed - | li TMP0, LJ_TSTR - | stw STR:TMP1, 4(CARG2) - | stw TMP0, 0(CARG2) - | bne >2 - |1: - | ins_next - | - |2: // Check if string is white and ensure upvalue is closed. - | andix. TMP3, TMP3, LJ_GC_WHITES // iswhite(str) - | cmplwi cr1, TMP2, 0 - | cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq - | la CARG1, GG_DISP2G(DISPATCH) - | // Crossed a write barrier. Move the barrier forward. - | beq <1 - | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) - | b <1 - break; - case BC_USETN: - | // RA = uvnum*8, RD = num_const*8 - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | srwi RA, RA, 1 - | addi RA, RA, offsetof(GCfuncL, uvptr) - | lfdx f0, KBASE, RD - | lwzx UPVAL:RB, LFUNC:RB, RA - | ins_next1 - | lwz TMP1, UPVAL:RB->v - | stfd f0, 0(TMP1) - | ins_next2 - break; - case BC_USETP: - | // RA = uvnum*8, RD = primitive_type*8 (~) - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | srwi RA, RA, 1 - | srwi TMP0, RD, 3 - | addi RA, RA, offsetof(GCfuncL, uvptr) - | not TMP0, TMP0 - | lwzx UPVAL:RB, LFUNC:RB, RA - | ins_next1 - | lwz TMP1, UPVAL:RB->v - | stw TMP0, 0(TMP1) - | ins_next2 - break; - - case BC_UCLO: - | // RA = level*8, RD = target - | lwz TMP1, L->openupval - | branch_RD // Do this first since RD is not saved. - | stp BASE, L->base - | cmplwi TMP1, 0 - | mr CARG1, L - | beq >1 - | add CARG2, BASE, RA - | bl extern lj_func_closeuv // (lua_State *L, TValue *level) - | lp BASE, L->base - |1: - | ins_next - break; - - case BC_FNEW: - | // RA = dst*8, RD = proto_const*8 (~) (holding function prototype) - | srwi TMP1, RD, 1 - | stp BASE, L->base - | subfic TMP1, TMP1, -4 - | stw PC, SAVE_PC - | lwzx CARG2, KBASE, TMP1 // KBASE-4-tab_const*4 - | mr CARG1, L - | lwz CARG3, FRAME_FUNC(BASE) - | // (lua_State *L, GCproto *pt, GCfuncL *parent) - | bl extern lj_func_newL_gc - | // Returns GCfuncL *. - | lp BASE, L->base - | li TMP0, LJ_TFUNC - | stwux TMP0, RA, BASE - | stw LFUNC:CRET1, 4(RA) - | ins_next - break; - - /* -- Table ops --------------------------------------------------------- */ - - case BC_TNEW: - case BC_TDUP: - | // RA = dst*8, RD = (hbits|asize)*8 | tab_const*8 (~) - | lwz TMP0, DISPATCH_GL(gc.total)(DISPATCH) - | mr CARG1, L - | lwz TMP1, DISPATCH_GL(gc.threshold)(DISPATCH) - | stp BASE, L->base - | cmplw TMP0, TMP1 - | stw PC, SAVE_PC - | bge >5 - |1: - if (op == BC_TNEW) { - | rlwinm CARG2, RD, 29, 21, 31 - | rlwinm CARG3, RD, 18, 27, 31 - | cmpwi CARG2, 0x7ff; beq >3 - |2: - | bl extern lj_tab_new // (lua_State *L, int32_t asize, uint32_t hbits) - | // Returns Table *. - } else { - | srwi TMP1, RD, 1 - | subfic TMP1, TMP1, -4 - | lwzx CARG2, KBASE, TMP1 // KBASE-4-tab_const*4 - | bl extern lj_tab_dup // (lua_State *L, Table *kt) - | // Returns Table *. - } - | lp BASE, L->base - | li TMP0, LJ_TTAB - | stwux TMP0, RA, BASE - | stw TAB:CRET1, 4(RA) - | ins_next - if (op == BC_TNEW) { - |3: - | li CARG2, 0x801 - | b <2 - } - |5: - | mr SAVE0, RD - | bl extern lj_gc_step_fixtop // (lua_State *L) - | mr RD, SAVE0 - | mr CARG1, L - | b <1 - break; - - case BC_GGET: - | // RA = dst*8, RD = str_const*8 (~) - case BC_GSET: - | // RA = src*8, RD = str_const*8 (~) - | lwz LFUNC:TMP2, FRAME_FUNC(BASE) - | srwi TMP1, RD, 1 - | lwz TAB:RB, LFUNC:TMP2->env - | subfic TMP1, TMP1, -4 - | lwzx STR:RC, KBASE, TMP1 // KBASE-4-str_const*4 - if (op == BC_GGET) { - | b ->BC_TGETS_Z - } else { - | b ->BC_TSETS_Z - } - break; - - case BC_TGETV: - | // RA = dst*8, RB = table*8, RC = key*8 - | lwzux CARG1, RB, BASE - | lwzux CARG2, RC, BASE - | lwz TAB:RB, 4(RB) - |.if DUALNUM - | lwz RC, 4(RC) - |.else - | lfd f0, 0(RC) - |.endif - | checktab CARG1 - | checknum cr1, CARG2 - | bne ->vmeta_tgetv - |.if DUALNUM - | lwz TMP0, TAB:RB->asize - | bne cr1, >5 - | lwz TMP1, TAB:RB->array - | cmplw TMP0, RC - | slwi TMP2, RC, 3 - |.else - | bge cr1, >5 - | // Convert number key to integer, check for integerness and range. - | fctiwz f1, f0 - | fadd f2, f0, TOBIT - | stfd f1, TMPD - | lwz TMP0, TAB:RB->asize - | fsub f2, f2, TOBIT - | lwz TMP2, TMPD_LO - | lwz TMP1, TAB:RB->array - | fcmpu cr1, f0, f2 - | cmplw cr0, TMP0, TMP2 - | crand 4*cr0+gt, 4*cr0+gt, 4*cr1+eq - | slwi TMP2, TMP2, 3 - |.endif - | ble ->vmeta_tgetv // Integer key and in array part? - | lwzx TMP0, TMP1, TMP2 - | lfdx f14, TMP1, TMP2 - | checknil TMP0; beq >2 - |1: - | ins_next1 - | stfdx f14, BASE, RA - | ins_next2 - | - |2: // Check for __index if table value is nil. - | lwz TAB:TMP2, TAB:RB->metatable - | cmplwi TAB:TMP2, 0 - | beq <1 // No metatable: done. - | lbz TMP0, TAB:TMP2->nomm - | andix. TMP0, TMP0, 1<vmeta_tgetv - | - |5: - | checkstr CARG2; bne ->vmeta_tgetv - |.if not DUALNUM - | lwz STR:RC, 4(RC) - |.endif - | b ->BC_TGETS_Z // String key? - break; - case BC_TGETS: - | // RA = dst*8, RB = table*8, RC = str_const*8 (~) - | lwzux CARG1, RB, BASE - | srwi TMP1, RC, 1 - | lwz TAB:RB, 4(RB) - | subfic TMP1, TMP1, -4 - | checktab CARG1 - | lwzx STR:RC, KBASE, TMP1 // KBASE-4-str_const*4 - | bne ->vmeta_tgets1 - |->BC_TGETS_Z: - | // TAB:RB = GCtab *, STR:RC = GCstr *, RA = dst*8 - | lwz TMP0, TAB:RB->hmask - | lwz TMP1, STR:RC->hash - | lwz NODE:TMP2, TAB:RB->node - | and TMP1, TMP1, TMP0 // idx = str->hash & tab->hmask - | slwi TMP0, TMP1, 5 - | slwi TMP1, TMP1, 3 - | sub TMP1, TMP0, TMP1 - | add NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8) - |1: - | lwz CARG1, NODE:TMP2->key - | lwz TMP0, 4+offsetof(Node, key)(NODE:TMP2) - | lwz CARG2, NODE:TMP2->val - | lwz TMP1, 4+offsetof(Node, val)(NODE:TMP2) - | checkstr CARG1; bne >4 - | cmpw TMP0, STR:RC; bne >4 - | checknil CARG2; beq >5 // Key found, but nil value? - |3: - | stwux CARG2, RA, BASE - | stw TMP1, 4(RA) - | ins_next - | - |4: // Follow hash chain. - | lwz NODE:TMP2, NODE:TMP2->next - | cmplwi NODE:TMP2, 0 - | bne <1 - | // End of hash chain: key not found, nil result. - | li CARG2, LJ_TNIL - | - |5: // Check for __index if table value is nil. - | lwz TAB:TMP2, TAB:RB->metatable - | cmplwi TAB:TMP2, 0 - | beq <3 // No metatable: done. - | lbz TMP0, TAB:TMP2->nomm - | andix. TMP0, TMP0, 1<vmeta_tgets - break; - case BC_TGETB: - | // RA = dst*8, RB = table*8, RC = index*8 - | lwzux CARG1, RB, BASE - | srwi TMP0, RC, 3 - | lwz TAB:RB, 4(RB) - | checktab CARG1; bne ->vmeta_tgetb - | lwz TMP1, TAB:RB->asize - | lwz TMP2, TAB:RB->array - | cmplw TMP0, TMP1; bge ->vmeta_tgetb - | lwzx TMP1, TMP2, RC - | lfdx f0, TMP2, RC - | checknil TMP1; beq >5 - |1: - | ins_next1 - | stfdx f0, BASE, RA - | ins_next2 - | - |5: // Check for __index if table value is nil. - | lwz TAB:TMP2, TAB:RB->metatable - | cmplwi TAB:TMP2, 0 - | beq <1 // No metatable: done. - | lbz TMP2, TAB:TMP2->nomm - | andix. TMP2, TMP2, 1<vmeta_tgetb // Caveat: preserve TMP0! - break; - - case BC_TSETV: - | // RA = src*8, RB = table*8, RC = key*8 - | lwzux CARG1, RB, BASE - | lwzux CARG2, RC, BASE - | lwz TAB:RB, 4(RB) - |.if DUALNUM - | lwz RC, 4(RC) - |.else - | lfd f0, 0(RC) - |.endif - | checktab CARG1 - | checknum cr1, CARG2 - | bne ->vmeta_tsetv - |.if DUALNUM - | lwz TMP0, TAB:RB->asize - | bne cr1, >5 - | lwz TMP1, TAB:RB->array - | cmplw TMP0, RC - | slwi TMP0, RC, 3 - |.else - | bge cr1, >5 - | // Convert number key to integer, check for integerness and range. - | fctiwz f1, f0 - | fadd f2, f0, TOBIT - | stfd f1, TMPD - | lwz TMP0, TAB:RB->asize - | fsub f2, f2, TOBIT - | lwz TMP2, TMPD_LO - | lwz TMP1, TAB:RB->array - | fcmpu cr1, f0, f2 - | cmplw cr0, TMP0, TMP2 - | crand 4*cr0+gt, 4*cr0+gt, 4*cr1+eq - | slwi TMP0, TMP2, 3 - |.endif - | ble ->vmeta_tsetv // Integer key and in array part? - | lwzx TMP2, TMP1, TMP0 - | lbz TMP3, TAB:RB->marked - | lfdx f14, BASE, RA - | checknil TMP2; beq >3 - |1: - | andix. TMP2, TMP3, LJ_GC_BLACK // isblack(table) - | stfdx f14, TMP1, TMP0 - | bne >7 - |2: - | ins_next - | - |3: // Check for __newindex if previous value is nil. - | lwz TAB:TMP2, TAB:RB->metatable - | cmplwi TAB:TMP2, 0 - | beq <1 // No metatable: done. - | lbz TMP2, TAB:TMP2->nomm - | andix. TMP2, TMP2, 1<vmeta_tsetv - | - |5: - | checkstr CARG2; bne ->vmeta_tsetv - |.if not DUALNUM - | lwz STR:RC, 4(RC) - |.endif - | b ->BC_TSETS_Z // String key? - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, TMP3, TMP0 - | b <2 - break; - case BC_TSETS: - | // RA = src*8, RB = table*8, RC = str_const*8 (~) - | lwzux CARG1, RB, BASE - | srwi TMP1, RC, 1 - | lwz TAB:RB, 4(RB) - | subfic TMP1, TMP1, -4 - | checktab CARG1 - | lwzx STR:RC, KBASE, TMP1 // KBASE-4-str_const*4 - | bne ->vmeta_tsets1 - |->BC_TSETS_Z: - | // TAB:RB = GCtab *, STR:RC = GCstr *, RA = src*8 - | lwz TMP0, TAB:RB->hmask - | lwz TMP1, STR:RC->hash - | lwz NODE:TMP2, TAB:RB->node - | stb ZERO, TAB:RB->nomm // Clear metamethod cache. - | and TMP1, TMP1, TMP0 // idx = str->hash & tab->hmask - | lfdx f14, BASE, RA - | slwi TMP0, TMP1, 5 - | slwi TMP1, TMP1, 3 - | sub TMP1, TMP0, TMP1 - | lbz TMP3, TAB:RB->marked - | add NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8) - |1: - | lwz CARG1, NODE:TMP2->key - | lwz TMP0, 4+offsetof(Node, key)(NODE:TMP2) - | lwz CARG2, NODE:TMP2->val - | lwz NODE:TMP1, NODE:TMP2->next - | checkstr CARG1; bne >5 - | cmpw TMP0, STR:RC; bne >5 - | checknil CARG2; beq >4 // Key found, but nil value? - |2: - | andix. TMP0, TMP3, LJ_GC_BLACK // isblack(table) - | stfd f14, NODE:TMP2->val - | bne >7 - |3: - | ins_next - | - |4: // Check for __newindex if previous value is nil. - | lwz TAB:TMP1, TAB:RB->metatable - | cmplwi TAB:TMP1, 0 - | beq <2 // No metatable: done. - | lbz TMP0, TAB:TMP1->nomm - | andix. TMP0, TMP0, 1<vmeta_tsets - | - |5: // Follow hash chain. - | cmplwi NODE:TMP1, 0 - | mr NODE:TMP2, NODE:TMP1 - | bne <1 - | // End of hash chain: key not found, add a new one. - | - | // But check for __newindex first. - | lwz TAB:TMP1, TAB:RB->metatable - | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) - | stw PC, SAVE_PC - | mr CARG1, L - | cmplwi TAB:TMP1, 0 - | stp BASE, L->base - | beq >6 // No metatable: continue. - | lbz TMP0, TAB:TMP1->nomm - | andix. TMP0, TMP0, 1<vmeta_tsets // 'no __newindex' flag NOT set: check. - |6: - | li TMP0, LJ_TSTR - | stw STR:RC, 4(CARG3) - | mr CARG2, TAB:RB - | stw TMP0, 0(CARG3) - | bl extern lj_tab_newkey // (lua_State *L, GCtab *t, TValue *k) - | // Returns TValue *. - | lp BASE, L->base - | stfd f14, 0(CRET1) - | b <3 // No 2nd write barrier needed. - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, TMP3, TMP0 - | b <3 - break; - case BC_TSETB: - | // RA = src*8, RB = table*8, RC = index*8 - | lwzux CARG1, RB, BASE - | srwi TMP0, RC, 3 - | lwz TAB:RB, 4(RB) - | checktab CARG1; bne ->vmeta_tsetb - | lwz TMP1, TAB:RB->asize - | lwz TMP2, TAB:RB->array - | lbz TMP3, TAB:RB->marked - | cmplw TMP0, TMP1 - | lfdx f14, BASE, RA - | bge ->vmeta_tsetb - | lwzx TMP1, TMP2, RC - | checknil TMP1; beq >5 - |1: - | andix. TMP0, TMP3, LJ_GC_BLACK // isblack(table) - | stfdx f14, TMP2, RC - | bne >7 - |2: - | ins_next - | - |5: // Check for __newindex if previous value is nil. - | lwz TAB:TMP1, TAB:RB->metatable - | cmplwi TAB:TMP1, 0 - | beq <1 // No metatable: done. - | lbz TMP1, TAB:TMP1->nomm - | andix. TMP1, TMP1, 1<vmeta_tsetb // Caveat: preserve TMP0! - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, TMP3, TMP0 - | b <2 - break; - - case BC_TSETM: - | // RA = base*8 (table at base-1), RD = num_const*8 (start index) - | add RA, BASE, RA - |1: - | add TMP3, KBASE, RD - | lwz TAB:CARG2, -4(RA) // Guaranteed to be a table. - | addic. TMP0, MULTRES, -8 - | lwz TMP3, 4(TMP3) // Integer constant is in lo-word. - | srwi CARG3, TMP0, 3 - | beq >4 // Nothing to copy? - | add CARG3, CARG3, TMP3 - | lwz TMP2, TAB:CARG2->asize - | slwi TMP1, TMP3, 3 - | lbz TMP3, TAB:CARG2->marked - | cmplw CARG3, TMP2 - | add TMP2, RA, TMP0 - | lwz TMP0, TAB:CARG2->array - | bgt >5 - | add TMP1, TMP1, TMP0 - | andix. TMP0, TMP3, LJ_GC_BLACK // isblack(table) - |3: // Copy result slots to table. - | lfd f0, 0(RA) - | addi RA, RA, 8 - | cmpw cr1, RA, TMP2 - | stfd f0, 0(TMP1) - | addi TMP1, TMP1, 8 - | blt cr1, <3 - | bne >7 - |4: - | ins_next - | - |5: // Need to resize array part. - | stp BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | mr SAVE0, RD - | bl extern lj_tab_reasize // (lua_State *L, GCtab *t, int nasize) - | // Must not reallocate the stack. - | mr RD, SAVE0 - | b <1 - | - |7: // Possible table write barrier for any value. Skip valiswhite check. - | barrierback TAB:CARG2, TMP3, TMP0 - | b <4 - break; - - /* -- Calls and vararg handling ----------------------------------------- */ - - case BC_CALLM: - | // RA = base*8, (RB = (nresults+1)*8,) RC = extra_nargs*8 - | add NARGS8:RC, NARGS8:RC, MULTRES - | // Fall through. Assumes BC_CALL follows. - break; - case BC_CALL: - | // RA = base*8, (RB = (nresults+1)*8,) RC = (nargs+1)*8 - | mr TMP2, BASE - | lwzux TMP0, BASE, RA - | lwz LFUNC:RB, 4(BASE) - | subi NARGS8:RC, NARGS8:RC, 8 - | addi BASE, BASE, 8 - | checkfunc TMP0; bne ->vmeta_call - | ins_call - break; - - case BC_CALLMT: - | // RA = base*8, (RB = 0,) RC = extra_nargs*8 - | add NARGS8:RC, NARGS8:RC, MULTRES - | // Fall through. Assumes BC_CALLT follows. - break; - case BC_CALLT: - | // RA = base*8, (RB = 0,) RC = (nargs+1)*8 - | lwzux TMP0, RA, BASE - | lwz LFUNC:RB, 4(RA) - | subi NARGS8:RC, NARGS8:RC, 8 - | lwz TMP1, FRAME_PC(BASE) - | checkfunc TMP0 - | addi RA, RA, 8 - | bne ->vmeta_callt - |->BC_CALLT_Z: - | andix. TMP0, TMP1, FRAME_TYPE // Caveat: preserve cr0 until the crand. - | lbz TMP3, LFUNC:RB->ffid - | xori TMP2, TMP1, FRAME_VARG - | cmplwi cr1, NARGS8:RC, 0 - | bne >7 - |1: - | stw LFUNC:RB, FRAME_FUNC(BASE) // Copy function down, but keep PC. - | li TMP2, 0 - | cmplwi cr7, TMP3, 1 // (> FF_C) Calling a fast function? - | beq cr1, >3 - |2: - | addi TMP3, TMP2, 8 - | lfdx f0, RA, TMP2 - | cmplw cr1, TMP3, NARGS8:RC - | stfdx f0, BASE, TMP2 - | mr TMP2, TMP3 - | bne cr1, <2 - |3: - | crand 4*cr0+eq, 4*cr0+eq, 4*cr7+gt - | beq >5 - |4: - | ins_callt - | - |5: // Tailcall to a fast function with a Lua frame below. - | lwz INS, -4(TMP1) - | decode_RA8 RA, INS - | sub TMP1, BASE, RA - | lwz LFUNC:TMP1, FRAME_FUNC-8(TMP1) - | lwz TMP1, LFUNC:TMP1->pc - | lwz KBASE, PC2PROTO(k)(TMP1) // Need to prepare KBASE. - | b <4 - | - |7: // Tailcall from a vararg function. - | andix. TMP0, TMP2, FRAME_TYPEP - | bne <1 // Vararg frame below? - | sub BASE, BASE, TMP2 // Relocate BASE down. - | lwz TMP1, FRAME_PC(BASE) - | andix. TMP0, TMP1, FRAME_TYPE - | b <1 - break; - - case BC_ITERC: - | // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 ((2+1)*8)) - | mr TMP2, BASE - | add BASE, BASE, RA - | lwz TMP1, -24(BASE) - | lwz LFUNC:RB, -20(BASE) - | lfd f1, -8(BASE) - | lfd f0, -16(BASE) - | stw TMP1, 0(BASE) // Copy callable. - | stw LFUNC:RB, 4(BASE) - | checkfunc TMP1 - | stfd f1, 16(BASE) // Copy control var. - | li NARGS8:RC, 16 // Iterators get 2 arguments. - | stfdu f0, 8(BASE) // Copy state. - | bne ->vmeta_call - | ins_call - break; - - case BC_ITERN: - | // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 (2+1)*8) - |.if JIT - | // NYI: add hotloop, record BC_ITERN. - |.endif - | add RA, BASE, RA - | lwz TAB:RB, -12(RA) - | lwz RC, -4(RA) // Get index from control var. - | lwz TMP0, TAB:RB->asize - | lwz TMP1, TAB:RB->array - | addi PC, PC, 4 - |1: // Traverse array part. - | cmplw RC, TMP0 - | slwi TMP3, RC, 3 - | bge >5 // Index points after array part? - | lwzx TMP2, TMP1, TMP3 - | lfdx f0, TMP1, TMP3 - | checknil TMP2 - | lwz INS, -4(PC) - | beq >4 - |.if DUALNUM - | stw RC, 4(RA) - | stw TISNUM, 0(RA) - |.else - | tonum_u f1, RC - |.endif - | addi RC, RC, 1 - | addis TMP3, PC, -(BCBIAS_J*4 >> 16) - | stfd f0, 8(RA) - | decode_RD4 TMP1, INS - | stw RC, -4(RA) // Update control var. - | add PC, TMP1, TMP3 - |.if not DUALNUM - | stfd f1, 0(RA) - |.endif - |3: - | ins_next - | - |4: // Skip holes in array part. - | addi RC, RC, 1 - | b <1 - | - |5: // Traverse hash part. - | lwz TMP1, TAB:RB->hmask - | sub RC, RC, TMP0 - | lwz TMP2, TAB:RB->node - |6: - | cmplw RC, TMP1 // End of iteration? Branch to ITERL+1. - | slwi TMP3, RC, 5 - | bgty <3 - | slwi RB, RC, 3 - | sub TMP3, TMP3, RB - | lwzx RB, TMP2, TMP3 - | lfdx f0, TMP2, TMP3 - | add NODE:TMP3, TMP2, TMP3 - | checknil RB - | lwz INS, -4(PC) - | beq >7 - | lfd f1, NODE:TMP3->key - | addis TMP2, PC, -(BCBIAS_J*4 >> 16) - | stfd f0, 8(RA) - | add RC, RC, TMP0 - | decode_RD4 TMP1, INS - | stfd f1, 0(RA) - | addi RC, RC, 1 - | add PC, TMP1, TMP2 - | stw RC, -4(RA) // Update control var. - | b <3 - | - |7: // Skip holes in hash part. - | addi RC, RC, 1 - | b <6 - break; - - case BC_ISNEXT: - | // RA = base*8, RD = target (points to ITERN) - | add RA, BASE, RA - | lwz TMP0, -24(RA) - | lwz CFUNC:TMP1, -20(RA) - | lwz TMP2, -16(RA) - | lwz TMP3, -8(RA) - | cmpwi cr0, TMP2, LJ_TTAB - | cmpwi cr1, TMP0, LJ_TFUNC - | cmpwi cr6, TMP3, LJ_TNIL - | bne cr1, >5 - | lbz TMP1, CFUNC:TMP1->ffid - | crand 4*cr0+eq, 4*cr0+eq, 4*cr6+eq - | cmpwi cr7, TMP1, FF_next_N - | srwi TMP0, RD, 1 - | crand 4*cr0+eq, 4*cr0+eq, 4*cr7+eq - | add TMP3, PC, TMP0 - | bne cr0, >5 - | lus TMP1, 0xfffe - | ori TMP1, TMP1, 0x7fff - | stw ZERO, -4(RA) // Initialize control var. - | stw TMP1, -8(RA) - | addis PC, TMP3, -(BCBIAS_J*4 >> 16) - |1: - | ins_next - |5: // Despecialize bytecode if any of the checks fail. - | li TMP0, BC_JMP - | li TMP1, BC_ITERC - | stb TMP0, -1(PC) - | addis PC, TMP3, -(BCBIAS_J*4 >> 16) - | stb TMP1, 3(PC) - | b <1 - break; - - case BC_VARG: - | // RA = base*8, RB = (nresults+1)*8, RC = numparams*8 - | lwz TMP0, FRAME_PC(BASE) - | add RC, BASE, RC - | add RA, BASE, RA - | addi RC, RC, FRAME_VARG - | add TMP2, RA, RB - | subi TMP3, BASE, 8 // TMP3 = vtop - | sub RC, RC, TMP0 // RC = vbase - | // Note: RC may now be even _above_ BASE if nargs was < numparams. - | cmplwi cr1, RB, 0 - |.if PPE - | sub TMP1, TMP3, RC - | cmpwi TMP1, 0 - |.else - | sub. TMP1, TMP3, RC - |.endif - | beq cr1, >5 // Copy all varargs? - | subi TMP2, TMP2, 16 - | ble >2 // No vararg slots? - |1: // Copy vararg slots to destination slots. - | lfd f0, 0(RC) - | addi RC, RC, 8 - | stfd f0, 0(RA) - | cmplw RA, TMP2 - | cmplw cr1, RC, TMP3 - | bge >3 // All destination slots filled? - | addi RA, RA, 8 - | blt cr1, <1 // More vararg slots? - |2: // Fill up remainder with nil. - | stw TISNIL, 0(RA) - | cmplw RA, TMP2 - | addi RA, RA, 8 - | blt <2 - |3: - | ins_next - | - |5: // Copy all varargs. - | lwz TMP0, L->maxstack - | li MULTRES, 8 // MULTRES = (0+1)*8 - | bley <3 // No vararg slots? - | add TMP2, RA, TMP1 - | cmplw TMP2, TMP0 - | addi MULTRES, TMP1, 8 - | bgt >7 - |6: - | lfd f0, 0(RC) - | addi RC, RC, 8 - | stfd f0, 0(RA) - | cmplw RC, TMP3 - | addi RA, RA, 8 - | blt <6 // More vararg slots? - | b <3 - | - |7: // Grow stack for varargs. - | mr CARG1, L - | stp RA, L->top - | sub SAVE0, RC, BASE // Need delta, because BASE may change. - | stp BASE, L->base - | sub RA, RA, BASE - | stw PC, SAVE_PC - | srwi CARG2, TMP1, 3 - | bl extern lj_state_growstack // (lua_State *L, int n) - | lp BASE, L->base - | add RA, BASE, RA - | add RC, BASE, SAVE0 - | subi TMP3, BASE, 8 - | b <6 - break; - - /* -- Returns ----------------------------------------------------------- */ - - case BC_RETM: - | // RA = results*8, RD = extra_nresults*8 - | add RD, RD, MULTRES // MULTRES >= 8, so RD >= 8. - | // Fall through. Assumes BC_RET follows. - break; - - case BC_RET: - | // RA = results*8, RD = (nresults+1)*8 - | lwz PC, FRAME_PC(BASE) - | add RA, BASE, RA - | mr MULTRES, RD - |1: - | andix. TMP0, PC, FRAME_TYPE - | xori TMP1, PC, FRAME_VARG - | bne ->BC_RETV_Z - | - |->BC_RET_Z: - | // BASE = base, RA = resultptr, RD = (nresults+1)*8, PC = return - | lwz INS, -4(PC) - | cmpwi RD, 8 - | subi TMP2, BASE, 8 - | subi RC, RD, 8 - | decode_RB8 RB, INS - | beq >3 - | li TMP1, 0 - |2: - | addi TMP3, TMP1, 8 - | lfdx f0, RA, TMP1 - | cmpw TMP3, RC - | stfdx f0, TMP2, TMP1 - | beq >3 - | addi TMP1, TMP3, 8 - | lfdx f1, RA, TMP3 - | cmpw TMP1, RC - | stfdx f1, TMP2, TMP3 - | bne <2 - |3: - |5: - | cmplw RB, RD - | decode_RA8 RA, INS - | bgt >6 - | sub BASE, TMP2, RA - | lwz LFUNC:TMP1, FRAME_FUNC(BASE) - | ins_next1 - | lwz TMP1, LFUNC:TMP1->pc - | lwz KBASE, PC2PROTO(k)(TMP1) - | ins_next2 - | - |6: // Fill up results with nil. - | subi TMP1, RD, 8 - | addi RD, RD, 8 - | stwx TISNIL, TMP2, TMP1 - | b <5 - | - |->BC_RETV_Z: // Non-standard return case. - | andix. TMP2, TMP1, FRAME_TYPEP - | bne ->vm_return - | // Return from vararg function: relocate BASE down. - | sub BASE, BASE, TMP1 - | lwz PC, FRAME_PC(BASE) - | b <1 - break; - - case BC_RET0: case BC_RET1: - | // RA = results*8, RD = (nresults+1)*8 - | lwz PC, FRAME_PC(BASE) - | add RA, BASE, RA - | mr MULTRES, RD - | andix. TMP0, PC, FRAME_TYPE - | xori TMP1, PC, FRAME_VARG - | bney ->BC_RETV_Z - | - | lwz INS, -4(PC) - | subi TMP2, BASE, 8 - | decode_RB8 RB, INS - if (op == BC_RET1) { - | lfd f0, 0(RA) - | stfd f0, 0(TMP2) - } - |5: - | cmplw RB, RD - | decode_RA8 RA, INS - | bgt >6 - | sub BASE, TMP2, RA - | lwz LFUNC:TMP1, FRAME_FUNC(BASE) - | ins_next1 - | lwz TMP1, LFUNC:TMP1->pc - | lwz KBASE, PC2PROTO(k)(TMP1) - | ins_next2 - | - |6: // Fill up results with nil. - | subi TMP1, RD, 8 - | addi RD, RD, 8 - | stwx TISNIL, TMP2, TMP1 - | b <5 - break; - - /* -- Loops and branches ------------------------------------------------ */ - - case BC_FORL: - |.if JIT - | hotloop - |.endif - | // Fall through. Assumes BC_IFORL follows. - break; - - case BC_JFORI: - case BC_JFORL: -#if !LJ_HASJIT - break; -#endif - case BC_FORI: - case BC_IFORL: - | // RA = base*8, RD = target (after end of loop or start of loop) - vk = (op == BC_IFORL || op == BC_JFORL); - |.if DUALNUM - | // Integer loop. - | lwzux TMP1, RA, BASE - | lwz CARG1, FORL_IDX*8+4(RA) - | cmplw cr0, TMP1, TISNUM - if (vk) { - | lwz CARG3, FORL_STEP*8+4(RA) - | bne >9 - |.if GPR64 - | // Need to check overflow for (a<<32) + (b<<32). - | rldicr TMP0, CARG1, 32, 31 - | rldicr TMP2, CARG3, 32, 31 - | add CARG1, CARG1, CARG3 - | addo. TMP0, TMP0, TMP2 - |.else - | addo. CARG1, CARG1, CARG3 - |.endif - | cmpwi cr6, CARG3, 0 - | lwz CARG2, FORL_STOP*8+4(RA) - | bso >6 - |4: - | stw CARG1, FORL_IDX*8+4(RA) - } else { - | lwz TMP3, FORL_STEP*8(RA) - | lwz CARG3, FORL_STEP*8+4(RA) - | lwz TMP2, FORL_STOP*8(RA) - | lwz CARG2, FORL_STOP*8+4(RA) - | cmplw cr7, TMP3, TISNUM - | cmplw cr1, TMP2, TISNUM - | crand 4*cr0+eq, 4*cr0+eq, 4*cr7+eq - | crand 4*cr0+eq, 4*cr0+eq, 4*cr1+eq - | cmpwi cr6, CARG3, 0 - | bne >9 - } - | blt cr6, >5 - | cmpw CARG1, CARG2 - |1: - | stw TISNUM, FORL_EXT*8(RA) - if (op != BC_JFORL) { - | srwi RD, RD, 1 - } - | stw CARG1, FORL_EXT*8+4(RA) - if (op != BC_JFORL) { - | add RD, PC, RD - } - if (op == BC_FORI) { - | bgt >3 // See FP loop below. - } else if (op == BC_JFORI) { - | addis PC, RD, -(BCBIAS_J*4 >> 16) - | bley >7 - } else if (op == BC_IFORL) { - | bgt >2 - | addis PC, RD, -(BCBIAS_J*4 >> 16) - } else { - | bley =>BC_JLOOP - } - |2: - | ins_next - |5: // Invert check for negative step. - | cmpw CARG2, CARG1 - | b <1 - if (vk) { - |6: // Potential overflow. - | checkov TMP0, <4 // Ignore unrelated overflow. - | b <2 - } - |.endif - if (vk) { - |.if DUALNUM - |9: // FP loop. - | lfd f1, FORL_IDX*8(RA) - |.else - | lfdux f1, RA, BASE - |.endif - | lfd f3, FORL_STEP*8(RA) - | lfd f2, FORL_STOP*8(RA) - | lwz TMP3, FORL_STEP*8(RA) - | fadd f1, f1, f3 - | stfd f1, FORL_IDX*8(RA) - } else { - |.if DUALNUM - |9: // FP loop. - |.else - | lwzux TMP1, RA, BASE - | lwz TMP3, FORL_STEP*8(RA) - | lwz TMP2, FORL_STOP*8(RA) - | cmplw cr0, TMP1, TISNUM - | cmplw cr7, TMP3, TISNUM - | cmplw cr1, TMP2, TISNUM - |.endif - | lfd f1, FORL_IDX*8(RA) - | crand 4*cr0+lt, 4*cr0+lt, 4*cr7+lt - | crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt - | lfd f2, FORL_STOP*8(RA) - | bge ->vmeta_for - } - | cmpwi cr6, TMP3, 0 - if (op != BC_JFORL) { - | srwi RD, RD, 1 - } - | stfd f1, FORL_EXT*8(RA) - if (op != BC_JFORL) { - | add RD, PC, RD - } - | fcmpu cr0, f1, f2 - if (op == BC_JFORI) { - | addis PC, RD, -(BCBIAS_J*4 >> 16) - } - | blt cr6, >5 - if (op == BC_FORI) { - | bgt >3 - } else if (op == BC_IFORL) { - |.if DUALNUM - | bgty <2 - |.else - | bgt >2 - |.endif - |1: - | addis PC, RD, -(BCBIAS_J*4 >> 16) - } else if (op == BC_JFORI) { - | bley >7 - } else { - | bley =>BC_JLOOP - } - |.if DUALNUM - | b <2 - |.else - |2: - | ins_next - |.endif - |5: // Negative step. - if (op == BC_FORI) { - | bge <2 - |3: // Used by integer loop, too. - | addis PC, RD, -(BCBIAS_J*4 >> 16) - } else if (op == BC_IFORL) { - | bgey <1 - } else if (op == BC_JFORI) { - | bgey >7 - } else { - | bgey =>BC_JLOOP - } - | b <2 - if (op == BC_JFORI) { - |7: - | lwz INS, -4(PC) - | decode_RD8 RD, INS - | b =>BC_JLOOP - } - break; - - case BC_ITERL: - |.if JIT - | hotloop - |.endif - | // Fall through. Assumes BC_IITERL follows. - break; - - case BC_JITERL: -#if !LJ_HASJIT - break; -#endif - case BC_IITERL: - | // RA = base*8, RD = target - | lwzux TMP1, RA, BASE - | lwz TMP2, 4(RA) - | checknil TMP1; beq >1 // Stop if iterator returned nil. - if (op == BC_JITERL) { - | stw TMP1, -8(RA) - | stw TMP2, -4(RA) - | b =>BC_JLOOP - } else { - | branch_RD // Otherwise save control var + branch. - | stw TMP1, -8(RA) - | stw TMP2, -4(RA) - } - |1: - | ins_next - break; - - case BC_LOOP: - | // RA = base*8, RD = target (loop extent) - | // Note: RA/RD is only used by trace recorder to determine scope/extent - | // This opcode does NOT jump, it's only purpose is to detect a hot loop. - |.if JIT - | hotloop - |.endif - | // Fall through. Assumes BC_ILOOP follows. - break; - - case BC_ILOOP: - | // RA = base*8, RD = target (loop extent) - | ins_next - break; - - case BC_JLOOP: - |.if JIT - | // RA = base*8 (ignored), RD = traceno*8 - | lwz TMP1, DISPATCH_J(trace)(DISPATCH) - | srwi RD, RD, 1 - | // Traces on PPC don't store the trace number, so use 0. - | stw ZERO, DISPATCH_GL(vmstate)(DISPATCH) - | lwzx TRACE:TMP2, TMP1, RD - | clrso TMP1 - | lp TMP2, TRACE:TMP2->mcode - | stw BASE, DISPATCH_GL(jit_base)(DISPATCH) - | mtctr TMP2 - | stw L, DISPATCH_GL(jit_L)(DISPATCH) - | addi JGL, DISPATCH, GG_DISP2G+32768 - | bctr - |.endif - break; - - case BC_JMP: - | // RA = base*8 (only used by trace recorder), RD = target - | branch_RD - | ins_next - break; - - /* -- Function headers -------------------------------------------------- */ - - case BC_FUNCF: - |.if JIT - | hotcall - |.endif - case BC_FUNCV: /* NYI: compiled vararg functions. */ - | // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow. - break; - - case BC_JFUNCF: -#if !LJ_HASJIT - break; -#endif - case BC_IFUNCF: - | // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8 - | lwz TMP2, L->maxstack - | lbz TMP1, -4+PC2PROTO(numparams)(PC) - | lwz KBASE, -4+PC2PROTO(k)(PC) - | cmplw RA, TMP2 - | slwi TMP1, TMP1, 3 - | bgt ->vm_growstack_l - if (op != BC_JFUNCF) { - | ins_next1 - } - |2: - | cmplw NARGS8:RC, TMP1 // Check for missing parameters. - | blt >3 - if (op == BC_JFUNCF) { - | decode_RD8 RD, INS - | b =>BC_JLOOP - } else { - | ins_next2 - } - | - |3: // Clear missing parameters. - | stwx TISNIL, BASE, NARGS8:RC - | addi NARGS8:RC, NARGS8:RC, 8 - | b <2 - break; - - case BC_JFUNCV: -#if !LJ_HASJIT - break; -#endif - | NYI // NYI: compiled vararg functions - break; /* NYI: compiled vararg functions. */ - - case BC_IFUNCV: - | // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8 - | lwz TMP2, L->maxstack - | add TMP1, BASE, RC - | add TMP0, RA, RC - | stw LFUNC:RB, 4(TMP1) // Store copy of LFUNC. - | addi TMP3, RC, 8+FRAME_VARG - | lwz KBASE, -4+PC2PROTO(k)(PC) - | cmplw TMP0, TMP2 - | stw TMP3, 0(TMP1) // Store delta + FRAME_VARG. - | bge ->vm_growstack_l - | lbz TMP2, -4+PC2PROTO(numparams)(PC) - | mr RA, BASE - | mr RC, TMP1 - | ins_next1 - | cmpwi TMP2, 0 - | addi BASE, TMP1, 8 - | beq >3 - |1: - | cmplw RA, RC // Less args than parameters? - | lwz TMP0, 0(RA) - | lwz TMP3, 4(RA) - | bge >4 - | stw TISNIL, 0(RA) // Clear old fixarg slot (help the GC). - | addi RA, RA, 8 - |2: - | addic. TMP2, TMP2, -1 - | stw TMP0, 8(TMP1) - | stw TMP3, 12(TMP1) - | addi TMP1, TMP1, 8 - | bne <1 - |3: - | ins_next2 - | - |4: // Clear missing parameters. - | li TMP0, LJ_TNIL - | b <2 - break; - - case BC_FUNCC: - case BC_FUNCCW: - | // BASE = new base, RA = BASE+framesize*8, RB = CFUNC, RC = nargs*8 - if (op == BC_FUNCC) { - | lp RD, CFUNC:RB->f - } else { - | lp RD, DISPATCH_GL(wrapf)(DISPATCH) - } - | add TMP1, RA, NARGS8:RC - | lwz TMP2, L->maxstack - | .toc lp TMP3, 0(RD) - | add RC, BASE, NARGS8:RC - | stp BASE, L->base - | cmplw TMP1, TMP2 - | stp RC, L->top - | li_vmstate C - |.if TOC - | mtctr TMP3 - |.else - | mtctr RD - |.endif - if (op == BC_FUNCCW) { - | lp CARG2, CFUNC:RB->f - } - | mr CARG1, L - | bgt ->vm_growstack_c // Need to grow stack. - | .toc lp TOCREG, TOC_OFS(RD) - | .tocenv lp ENVREG, ENV_OFS(RD) - | st_vmstate - | bctrl // (lua_State *L [, lua_CFunction f]) - | // Returns nresults. - | lp BASE, L->base - | .toc ld TOCREG, SAVE_TOC - | slwi RD, CRET1, 3 - | lp TMP1, L->top - | li_vmstate INTERP - | lwz PC, FRAME_PC(BASE) // Fetch PC of caller. - | sub RA, TMP1, RD // RA = L->top - nresults*8 - | st_vmstate - | b ->vm_returnc - break; - - /* ---------------------------------------------------------------------- */ - - default: - fprintf(stderr, "Error: undefined opcode BC_%s\n", bc_names[op]); - exit(2); - break; - } -} - -static int build_backend(BuildCtx *ctx) -{ - int op; - - dasm_growpc(Dst, BC__MAX); - - build_subroutines(ctx); - - |.code_op - for (op = 0; op < BC__MAX; op++) - build_ins(ctx, (BCOp)op, op); - - return BC__MAX; -} - -/* Emit pseudo frame-info for all assembler functions. */ -static void emit_asm_debug(BuildCtx *ctx) -{ - int fcofs = (int)((uint8_t *)ctx->glob[GLOB_vm_ffi_call] - ctx->code); - int i; - switch (ctx->mode) { - case BUILD_elfasm: - fprintf(ctx->fp, "\t.section .debug_frame,\"\",@progbits\n"); - fprintf(ctx->fp, - ".Lframe0:\n" - "\t.long .LECIE0-.LSCIE0\n" - ".LSCIE0:\n" - "\t.long 0xffffffff\n" - "\t.byte 0x1\n" - "\t.string \"\"\n" - "\t.uleb128 0x1\n" - "\t.sleb128 -4\n" - "\t.byte 65\n" - "\t.byte 0xc\n\t.uleb128 1\n\t.uleb128 0\n" - "\t.align 2\n" - ".LECIE0:\n\n"); - fprintf(ctx->fp, - ".LSFDE0:\n" - "\t.long .LEFDE0-.LASFDE0\n" - ".LASFDE0:\n" - "\t.long .Lframe0\n" - "\t.long .Lbegin\n" - "\t.long %d\n" - "\t.byte 0xe\n\t.uleb128 %d\n" - "\t.byte 0x11\n\t.uleb128 65\n\t.sleb128 -1\n" - "\t.byte 0x5\n\t.uleb128 70\n\t.uleb128 55\n", - fcofs, CFRAME_SIZE); - for (i = 14; i <= 31; i++) - fprintf(ctx->fp, - "\t.byte %d\n\t.uleb128 %d\n" - "\t.byte %d\n\t.uleb128 %d\n", - 0x80+i, 37+(31-i), 0x80+32+i, 2+2*(31-i)); - fprintf(ctx->fp, - "\t.align 2\n" - ".LEFDE0:\n\n"); -#if LJ_HASFFI - fprintf(ctx->fp, - ".LSFDE1:\n" - "\t.long .LEFDE1-.LASFDE1\n" - ".LASFDE1:\n" - "\t.long .Lframe0\n" -#if LJ_TARGET_PS3 - "\t.long .lj_vm_ffi_call\n" -#else - "\t.long lj_vm_ffi_call\n" -#endif - "\t.long %d\n" - "\t.byte 0x11\n\t.uleb128 65\n\t.sleb128 -1\n" - "\t.byte 0x8e\n\t.uleb128 2\n" - "\t.byte 0xd\n\t.uleb128 0xe\n" - "\t.align 2\n" - ".LEFDE1:\n\n", (int)ctx->codesz - fcofs); -#endif -#if !LJ_NO_UNWIND - fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@progbits\n"); - fprintf(ctx->fp, - ".Lframe1:\n" - "\t.long .LECIE1-.LSCIE1\n" - ".LSCIE1:\n" - "\t.long 0\n" - "\t.byte 0x1\n" - "\t.string \"zPR\"\n" - "\t.uleb128 0x1\n" - "\t.sleb128 -4\n" - "\t.byte 65\n" - "\t.uleb128 6\n" /* augmentation length */ - "\t.byte 0x1b\n" /* pcrel|sdata4 */ - "\t.long lj_err_unwind_dwarf-.\n" - "\t.byte 0x1b\n" /* pcrel|sdata4 */ - "\t.byte 0xc\n\t.uleb128 1\n\t.uleb128 0\n" - "\t.align 2\n" - ".LECIE1:\n\n"); - fprintf(ctx->fp, - ".LSFDE2:\n" - "\t.long .LEFDE2-.LASFDE2\n" - ".LASFDE2:\n" - "\t.long .LASFDE2-.Lframe1\n" - "\t.long .Lbegin-.\n" - "\t.long %d\n" - "\t.uleb128 0\n" /* augmentation length */ - "\t.byte 0xe\n\t.uleb128 %d\n" - "\t.byte 0x11\n\t.uleb128 65\n\t.sleb128 -1\n" - "\t.byte 0x5\n\t.uleb128 70\n\t.uleb128 55\n", - fcofs, CFRAME_SIZE); - for (i = 14; i <= 31; i++) - fprintf(ctx->fp, - "\t.byte %d\n\t.uleb128 %d\n" - "\t.byte %d\n\t.uleb128 %d\n", - 0x80+i, 37+(31-i), 0x80+32+i, 2+2*(31-i)); - fprintf(ctx->fp, - "\t.align 2\n" - ".LEFDE2:\n\n"); -#if LJ_HASFFI - fprintf(ctx->fp, - ".Lframe2:\n" - "\t.long .LECIE2-.LSCIE2\n" - ".LSCIE2:\n" - "\t.long 0\n" - "\t.byte 0x1\n" - "\t.string \"zR\"\n" - "\t.uleb128 0x1\n" - "\t.sleb128 -4\n" - "\t.byte 65\n" - "\t.uleb128 1\n" /* augmentation length */ - "\t.byte 0x1b\n" /* pcrel|sdata4 */ - "\t.byte 0xc\n\t.uleb128 1\n\t.uleb128 0\n" - "\t.align 2\n" - ".LECIE2:\n\n"); - fprintf(ctx->fp, - ".LSFDE3:\n" - "\t.long .LEFDE3-.LASFDE3\n" - ".LASFDE3:\n" - "\t.long .LASFDE3-.Lframe2\n" - "\t.long lj_vm_ffi_call-.\n" - "\t.long %d\n" - "\t.uleb128 0\n" /* augmentation length */ - "\t.byte 0x11\n\t.uleb128 65\n\t.sleb128 -1\n" - "\t.byte 0x8e\n\t.uleb128 2\n" - "\t.byte 0xd\n\t.uleb128 0xe\n" - "\t.align 2\n" - ".LEFDE3:\n\n", (int)ctx->codesz - fcofs); -#endif -#endif - break; - default: - break; - } -} - diff --git a/subprojects/luajit/src/vm_ppcspe.dasc b/subprojects/luajit/src/vm_ppcspe.dasc deleted file mode 100644 index 2a57a41f3..000000000 --- a/subprojects/luajit/src/vm_ppcspe.dasc +++ /dev/null @@ -1,3691 +0,0 @@ -|// Low-level VM code for PowerPC/e500 CPUs. -|// Bytecode interpreter, fast functions and helper functions. -|// Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -| -|.arch ppc -|.section code_op, code_sub -| -|.actionlist build_actionlist -|.globals GLOB_ -|.globalnames globnames -|.externnames extnames -| -|// Note: The ragged indentation of the instructions is intentional. -|// The starting columns indicate data dependencies. -| -|//----------------------------------------------------------------------- -| -|// Fixed register assignments for the interpreter. -|// Don't use: r1 = sp, r2 and r13 = reserved and/or small data area ptr -| -|// The following must be C callee-save (but BASE is often refetched). -|.define BASE, r14 // Base of current Lua stack frame. -|.define KBASE, r15 // Constants of current Lua function. -|.define PC, r16 // Next PC. -|.define DISPATCH, r17 // Opcode dispatch table. -|.define LREG, r18 // Register holding lua_State (also in SAVE_L). -|.define MULTRES, r19 // Size of multi-result: (nresults+1)*8. -| -|// Constants for vectorized type-comparisons (hi+low GPR). C callee-save. -|.define TISNUM, r22 -|.define TISSTR, r23 -|.define TISTAB, r24 -|.define TISFUNC, r25 -|.define TISNIL, r26 -|.define TOBIT, r27 -|.define ZERO, TOBIT // Zero in lo word. -| -|// The following temporaries are not saved across C calls, except for RA. -|.define RA, r20 // Callee-save. -|.define RB, r10 -|.define RC, r11 -|.define RD, r12 -|.define INS, r7 // Overlaps CARG5. -| -|.define TMP0, r0 -|.define TMP1, r8 -|.define TMP2, r9 -|.define TMP3, r6 // Overlaps CARG4. -| -|// Saved temporaries. -|.define SAVE0, r21 -| -|// Calling conventions. -|.define CARG1, r3 -|.define CARG2, r4 -|.define CARG3, r5 -|.define CARG4, r6 // Overlaps TMP3. -|.define CARG5, r7 // Overlaps INS. -| -|.define CRET1, r3 -|.define CRET2, r4 -| -|// Stack layout while in interpreter. Must match with lj_frame.h. -|.define SAVE_LR, 188(sp) -|.define CFRAME_SPACE, 184 // Delta for sp. -|// Back chain for sp: 184(sp) <-- sp entering interpreter -|.define SAVE_r31, 176(sp) // 64 bit register saves. -|.define SAVE_r30, 168(sp) -|.define SAVE_r29, 160(sp) -|.define SAVE_r28, 152(sp) -|.define SAVE_r27, 144(sp) -|.define SAVE_r26, 136(sp) -|.define SAVE_r25, 128(sp) -|.define SAVE_r24, 120(sp) -|.define SAVE_r23, 112(sp) -|.define SAVE_r22, 104(sp) -|.define SAVE_r21, 96(sp) -|.define SAVE_r20, 88(sp) -|.define SAVE_r19, 80(sp) -|.define SAVE_r18, 72(sp) -|.define SAVE_r17, 64(sp) -|.define SAVE_r16, 56(sp) -|.define SAVE_r15, 48(sp) -|.define SAVE_r14, 40(sp) -|.define SAVE_CR, 36(sp) -|.define UNUSED1, 32(sp) -|.define SAVE_ERRF, 28(sp) // 32 bit C frame info. -|.define SAVE_NRES, 24(sp) -|.define SAVE_CFRAME, 20(sp) -|.define SAVE_L, 16(sp) -|.define SAVE_PC, 12(sp) -|.define SAVE_MULTRES, 8(sp) -|// Next frame lr: 4(sp) -|// Back chain for sp: 0(sp) <-- sp while in interpreter -| -|.macro save_, reg; evstdd reg, SAVE_..reg; .endmacro -|.macro rest_, reg; evldd reg, SAVE_..reg; .endmacro -| -|.macro saveregs -| stwu sp, -CFRAME_SPACE(sp) -| save_ r14; save_ r15; save_ r16; save_ r17; save_ r18; save_ r19 -| mflr r0; mfcr r12 -| save_ r20; save_ r21; save_ r22; save_ r23; save_ r24; save_ r25 -| stw r0, SAVE_LR; stw r12, SAVE_CR -| save_ r26; save_ r27; save_ r28; save_ r29; save_ r30; save_ r31 -|.endmacro -| -|.macro restoreregs -| lwz r0, SAVE_LR; lwz r12, SAVE_CR -| rest_ r14; rest_ r15; rest_ r16; rest_ r17; rest_ r18; rest_ r19 -| mtlr r0; mtcrf 0x38, r12 -| rest_ r20; rest_ r21; rest_ r22; rest_ r23; rest_ r24; rest_ r25 -| rest_ r26; rest_ r27; rest_ r28; rest_ r29; rest_ r30; rest_ r31 -| addi sp, sp, CFRAME_SPACE -|.endmacro -| -|// Type definitions. Some of these are only used for documentation. -|.type L, lua_State, LREG -|.type GL, global_State -|.type TVALUE, TValue -|.type GCOBJ, GCobj -|.type STR, GCstr -|.type TAB, GCtab -|.type LFUNC, GCfuncL -|.type CFUNC, GCfuncC -|.type PROTO, GCproto -|.type UPVAL, GCupval -|.type NODE, Node -|.type NARGS8, int -|.type TRACE, GCtrace -| -|//----------------------------------------------------------------------- -| -|// These basic macros should really be part of DynASM. -|.macro srwi, rx, ry, n; rlwinm rx, ry, 32-n, n, 31; .endmacro -|.macro slwi, rx, ry, n; rlwinm rx, ry, n, 0, 31-n; .endmacro -|.macro rotlwi, rx, ry, n; rlwinm rx, ry, n, 0, 31; .endmacro -|.macro rotlw, rx, ry, rn; rlwnm rx, ry, rn, 0, 31; .endmacro -|.macro subi, rx, ry, i; addi rx, ry, -i; .endmacro -| -|// Trap for not-yet-implemented parts. -|.macro NYI; tw 4, sp, sp; .endmacro -| -|//----------------------------------------------------------------------- -| -|// Access to frame relative to BASE. -|.define FRAME_PC, -8 -|.define FRAME_FUNC, -4 -| -|// Instruction decode. -|.macro decode_OP4, dst, ins; rlwinm dst, ins, 2, 22, 29; .endmacro -|.macro decode_RA8, dst, ins; rlwinm dst, ins, 27, 21, 28; .endmacro -|.macro decode_RB8, dst, ins; rlwinm dst, ins, 11, 21, 28; .endmacro -|.macro decode_RC8, dst, ins; rlwinm dst, ins, 19, 21, 28; .endmacro -|.macro decode_RD8, dst, ins; rlwinm dst, ins, 19, 13, 28; .endmacro -| -|.macro decode_OP1, dst, ins; rlwinm dst, ins, 0, 24, 31; .endmacro -|.macro decode_RD4, dst, ins; rlwinm dst, ins, 18, 14, 29; .endmacro -| -|// Instruction fetch. -|.macro ins_NEXT1 -| lwz INS, 0(PC) -| addi PC, PC, 4 -|.endmacro -|// Instruction decode+dispatch. -|.macro ins_NEXT2 -| decode_OP4 TMP1, INS -| decode_RB8 RB, INS -| decode_RD8 RD, INS -| lwzx TMP0, DISPATCH, TMP1 -| decode_RA8 RA, INS -| decode_RC8 RC, INS -| mtctr TMP0 -| bctr -|.endmacro -|.macro ins_NEXT -| ins_NEXT1 -| ins_NEXT2 -|.endmacro -| -|// Instruction footer. -|.if 1 -| // Replicated dispatch. Less unpredictable branches, but higher I-Cache use. -| .define ins_next, ins_NEXT -| .define ins_next_, ins_NEXT -| .define ins_next1, ins_NEXT1 -| .define ins_next2, ins_NEXT2 -|.else -| // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch. -| // Affects only certain kinds of benchmarks (and only with -j off). -| .macro ins_next -| b ->ins_next -| .endmacro -| .macro ins_next1 -| .endmacro -| .macro ins_next2 -| b ->ins_next -| .endmacro -| .macro ins_next_ -| ->ins_next: -| ins_NEXT -| .endmacro -|.endif -| -|// Call decode and dispatch. -|.macro ins_callt -| // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC -| lwz PC, LFUNC:RB->pc -| lwz INS, 0(PC) -| addi PC, PC, 4 -| decode_OP4 TMP1, INS -| decode_RA8 RA, INS -| lwzx TMP0, DISPATCH, TMP1 -| add RA, RA, BASE -| mtctr TMP0 -| bctr -|.endmacro -| -|.macro ins_call -| // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, PC = caller PC -| stw PC, FRAME_PC(BASE) -| ins_callt -|.endmacro -| -|//----------------------------------------------------------------------- -| -|// Macros to test operand types. -|.macro checknum, reg; evcmpltu reg, TISNUM; .endmacro -|.macro checkstr, reg; evcmpeq reg, TISSTR; .endmacro -|.macro checktab, reg; evcmpeq reg, TISTAB; .endmacro -|.macro checkfunc, reg; evcmpeq reg, TISFUNC; .endmacro -|.macro checknil, reg; evcmpeq reg, TISNIL; .endmacro -|.macro checkok, label; blt label; .endmacro -|.macro checkfail, label; bge label; .endmacro -|.macro checkanyfail, label; bns label; .endmacro -|.macro checkallok, label; bso label; .endmacro -| -|.macro branch_RD -| srwi TMP0, RD, 1 -| add PC, PC, TMP0 -| addis PC, PC, -(BCBIAS_J*4 >> 16) -|.endmacro -| -|// Assumes DISPATCH is relative to GL. -#define DISPATCH_GL(field) (GG_DISP2G + (int)offsetof(global_State, field)) -#define DISPATCH_J(field) (GG_DISP2J + (int)offsetof(jit_State, field)) -| -#define PC2PROTO(field) ((int)offsetof(GCproto, field)-(int)sizeof(GCproto)) -| -|.macro hotloop -| NYI -|.endmacro -| -|.macro hotcall -| NYI -|.endmacro -| -|// Set current VM state. Uses TMP0. -|.macro li_vmstate, st; li TMP0, ~LJ_VMST_..st; .endmacro -|.macro st_vmstate; stw TMP0, DISPATCH_GL(vmstate)(DISPATCH); .endmacro -| -|// Move table write barrier back. Overwrites mark and tmp. -|.macro barrierback, tab, mark, tmp -| lwz tmp, DISPATCH_GL(gc.grayagain)(DISPATCH) -| // Assumes LJ_GC_BLACK is 0x04. -| rlwinm mark, mark, 0, 30, 28 // black2gray(tab) -| stw tab, DISPATCH_GL(gc.grayagain)(DISPATCH) -| stb mark, tab->marked -| stw tmp, tab->gclist -|.endmacro -| -|//----------------------------------------------------------------------- - -/* Generate subroutines used by opcodes and other parts of the VM. */ -/* The .code_sub section should be last to help static branch prediction. */ -static void build_subroutines(BuildCtx *ctx) -{ - |.code_sub - | - |//----------------------------------------------------------------------- - |//-- Return handling ---------------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_returnp: - | // See vm_return. Also: TMP2 = previous base. - | andi. TMP0, PC, FRAME_P - | evsplati TMP1, LJ_TTRUE - | beq ->cont_dispatch - | - | // Return from pcall or xpcall fast func. - | lwz PC, FRAME_PC(TMP2) // Fetch PC of previous frame. - | mr BASE, TMP2 // Restore caller base. - | // Prepending may overwrite the pcall frame, so do it at the end. - | stwu TMP1, FRAME_PC(RA) // Prepend true to results. - | - |->vm_returnc: - | addi RD, RD, 8 // RD = (nresults+1)*8. - | andi. TMP0, PC, FRAME_TYPE - | cmpwi cr1, RD, 0 - | li CRET1, LUA_YIELD - | beq cr1, ->vm_unwind_c_eh - | mr MULTRES, RD - | beq ->BC_RET_Z // Handle regular return to Lua. - | - |->vm_return: - | // BASE = base, RA = resultptr, RD/MULTRES = (nresults+1)*8, PC = return - | // TMP0 = PC & FRAME_TYPE - | cmpwi TMP0, FRAME_C - | rlwinm TMP2, PC, 0, 0, 28 - | li_vmstate C - | sub TMP2, BASE, TMP2 // TMP2 = previous base. - | bne ->vm_returnp - | - | addic. TMP1, RD, -8 - | stw TMP2, L->base - | lwz TMP2, SAVE_NRES - | subi BASE, BASE, 8 - | st_vmstate - | slwi TMP2, TMP2, 3 - | beq >2 - |1: - | addic. TMP1, TMP1, -8 - | evldd TMP0, 0(RA) - | addi RA, RA, 8 - | evstdd TMP0, 0(BASE) - | addi BASE, BASE, 8 - | bne <1 - | - |2: - | cmpw TMP2, RD // More/less results wanted? - | bne >6 - |3: - | stw BASE, L->top // Store new top. - | - |->vm_leave_cp: - | lwz TMP0, SAVE_CFRAME // Restore previous C frame. - | li CRET1, 0 // Ok return status for vm_pcall. - | stw TMP0, L->cframe - | - |->vm_leave_unw: - | restoreregs - | blr - | - |6: - | ble >7 // Less results wanted? - | // More results wanted. Check stack size and fill up results with nil. - | lwz TMP1, L->maxstack - | cmplw BASE, TMP1 - | bge >8 - | evstdd TISNIL, 0(BASE) - | addi RD, RD, 8 - | addi BASE, BASE, 8 - | b <2 - | - |7: // Less results wanted. - | sub TMP0, RD, TMP2 - | cmpwi TMP2, 0 // LUA_MULTRET+1 case? - | sub TMP0, BASE, TMP0 // Subtract the difference. - | iseleq BASE, BASE, TMP0 // Either keep top or shrink it. - | b <3 - | - |8: // Corner case: need to grow stack for filling up results. - | // This can happen if: - | // - A C function grows the stack (a lot). - | // - The GC shrinks the stack in between. - | // - A return back from a lua_call() with (high) nresults adjustment. - | stw BASE, L->top // Save current top held in BASE (yes). - | mr SAVE0, RD - | mr CARG2, TMP2 - | mr CARG1, L - | bl extern lj_state_growstack // (lua_State *L, int n) - | lwz TMP2, SAVE_NRES - | mr RD, SAVE0 - | slwi TMP2, TMP2, 3 - | lwz BASE, L->top // Need the (realloced) L->top in BASE. - | b <2 - | - |->vm_unwind_c: // Unwind C stack, return from vm_pcall. - | // (void *cframe, int errcode) - | mr sp, CARG1 - | mr CRET1, CARG2 - |->vm_unwind_c_eh: // Landing pad for external unwinder. - | lwz L, SAVE_L - | li TMP0, ~LJ_VMST_C - | lwz GL:TMP1, L->glref - | stw TMP0, GL:TMP1->vmstate - | b ->vm_leave_unw - | - |->vm_unwind_ff: // Unwind C stack, return from ff pcall. - | // (void *cframe) - | rlwinm sp, CARG1, 0, 0, 29 - |->vm_unwind_ff_eh: // Landing pad for external unwinder. - | lwz L, SAVE_L - | evsplati TISNUM, LJ_TISNUM+1 // Setup type comparison constants. - | evsplati TISFUNC, LJ_TFUNC - | lus TOBIT, 0x4338 - | evsplati TISTAB, LJ_TTAB - | li TMP0, 0 - | lwz BASE, L->base - | evmergelo TOBIT, TOBIT, TMP0 - | lwz DISPATCH, L->glref // Setup pointer to dispatch table. - | evsplati TISSTR, LJ_TSTR - | li TMP1, LJ_TFALSE - | evsplati TISNIL, LJ_TNIL - | li_vmstate INTERP - | lwz PC, FRAME_PC(BASE) // Fetch PC of previous frame. - | la RA, -8(BASE) // Results start at BASE-8. - | addi DISPATCH, DISPATCH, GG_G2DISP - | stw TMP1, 0(RA) // Prepend false to error message. - | li RD, 16 // 2 results: false + error message. - | st_vmstate - | b ->vm_returnc - | - |//----------------------------------------------------------------------- - |//-- Grow stack for calls ----------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_growstack_c: // Grow stack for C function. - | li CARG2, LUA_MINSTACK - | b >2 - | - |->vm_growstack_l: // Grow stack for Lua function. - | // BASE = new base, RA = BASE+framesize*8, RC = nargs*8, PC = first PC - | add RC, BASE, RC - | sub RA, RA, BASE - | stw BASE, L->base - | addi PC, PC, 4 // Must point after first instruction. - | stw RC, L->top - | srwi CARG2, RA, 3 - |2: - | // L->base = new base, L->top = top - | stw PC, SAVE_PC - | mr CARG1, L - | bl extern lj_state_growstack // (lua_State *L, int n) - | lwz BASE, L->base - | lwz RC, L->top - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | sub RC, RC, BASE - | // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC - | ins_callt // Just retry the call. - | - |//----------------------------------------------------------------------- - |//-- Entry points into the assembler VM --------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_resume: // Setup C frame and resume thread. - | // (lua_State *L, TValue *base, int nres1 = 0, ptrdiff_t ef = 0) - | saveregs - | mr L, CARG1 - | lwz DISPATCH, L->glref // Setup pointer to dispatch table. - | mr BASE, CARG2 - | lbz TMP1, L->status - | stw L, SAVE_L - | li PC, FRAME_CP - | addi TMP0, sp, CFRAME_RESUME - | addi DISPATCH, DISPATCH, GG_G2DISP - | stw CARG3, SAVE_NRES - | cmplwi TMP1, 0 - | stw CARG3, SAVE_ERRF - | stw TMP0, L->cframe - | stw CARG3, SAVE_CFRAME - | stw CARG1, SAVE_PC // Any value outside of bytecode is ok. - | beq >3 - | - | // Resume after yield (like a return). - | mr RA, BASE - | lwz BASE, L->base - | evsplati TISNUM, LJ_TISNUM+1 // Setup type comparison constants. - | lwz TMP1, L->top - | evsplati TISFUNC, LJ_TFUNC - | lus TOBIT, 0x4338 - | evsplati TISTAB, LJ_TTAB - | lwz PC, FRAME_PC(BASE) - | li TMP2, 0 - | evsplati TISSTR, LJ_TSTR - | sub RD, TMP1, BASE - | evmergelo TOBIT, TOBIT, TMP2 - | stb CARG3, L->status - | andi. TMP0, PC, FRAME_TYPE - | li_vmstate INTERP - | addi RD, RD, 8 - | evsplati TISNIL, LJ_TNIL - | mr MULTRES, RD - | st_vmstate - | beq ->BC_RET_Z - | b ->vm_return - | - |->vm_pcall: // Setup protected C frame and enter VM. - | // (lua_State *L, TValue *base, int nres1, ptrdiff_t ef) - | saveregs - | li PC, FRAME_CP - | stw CARG4, SAVE_ERRF - | b >1 - | - |->vm_call: // Setup C frame and enter VM. - | // (lua_State *L, TValue *base, int nres1) - | saveregs - | li PC, FRAME_C - | - |1: // Entry point for vm_pcall above (PC = ftype). - | lwz TMP1, L:CARG1->cframe - | stw CARG3, SAVE_NRES - | mr L, CARG1 - | stw CARG1, SAVE_L - | mr BASE, CARG2 - | stw sp, L->cframe // Add our C frame to cframe chain. - | lwz DISPATCH, L->glref // Setup pointer to dispatch table. - | stw CARG1, SAVE_PC // Any value outside of bytecode is ok. - | stw TMP1, SAVE_CFRAME - | addi DISPATCH, DISPATCH, GG_G2DISP - | - |3: // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype). - | lwz TMP2, L->base // TMP2 = old base (used in vmeta_call). - | evsplati TISNUM, LJ_TISNUM+1 // Setup type comparison constants. - | lwz TMP1, L->top - | evsplati TISFUNC, LJ_TFUNC - | add PC, PC, BASE - | evsplati TISTAB, LJ_TTAB - | lus TOBIT, 0x4338 - | li TMP0, 0 - | sub PC, PC, TMP2 // PC = frame delta + frame type - | evsplati TISSTR, LJ_TSTR - | sub NARGS8:RC, TMP1, BASE - | evmergelo TOBIT, TOBIT, TMP0 - | li_vmstate INTERP - | evsplati TISNIL, LJ_TNIL - | st_vmstate - | - |->vm_call_dispatch: - | // TMP2 = old base, BASE = new base, RC = nargs*8, PC = caller PC - | li TMP0, -8 - | evlddx LFUNC:RB, BASE, TMP0 - | checkfunc LFUNC:RB - | checkfail ->vmeta_call - | - |->vm_call_dispatch_f: - | ins_call - | // BASE = new base, RB = func, RC = nargs*8, PC = caller PC - | - |->vm_cpcall: // Setup protected C frame, call C. - | // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp) - | saveregs - | mr L, CARG1 - | lwz TMP0, L:CARG1->stack - | stw CARG1, SAVE_L - | lwz TMP1, L->top - | stw CARG1, SAVE_PC // Any value outside of bytecode is ok. - | sub TMP0, TMP0, TMP1 // Compute -savestack(L, L->top). - | lwz TMP1, L->cframe - | stw sp, L->cframe // Add our C frame to cframe chain. - | li TMP2, 0 - | stw TMP0, SAVE_NRES // Neg. delta means cframe w/o frame. - | stw TMP2, SAVE_ERRF // No error function. - | stw TMP1, SAVE_CFRAME - | mtctr CARG4 - | bctrl // (lua_State *L, lua_CFunction func, void *ud) - | mr. BASE, CRET1 - | lwz DISPATCH, L->glref // Setup pointer to dispatch table. - | li PC, FRAME_CP - | addi DISPATCH, DISPATCH, GG_G2DISP - | bne <3 // Else continue with the call. - | b ->vm_leave_cp // No base? Just remove C frame. - | - |//----------------------------------------------------------------------- - |//-- Metamethod handling ------------------------------------------------ - |//----------------------------------------------------------------------- - | - |// The lj_meta_* functions (except for lj_meta_cat) don't reallocate the - |// stack, so BASE doesn't need to be reloaded across these calls. - | - |//-- Continuation dispatch ---------------------------------------------- - | - |->cont_dispatch: - | // BASE = meta base, RA = resultptr, RD = (nresults+1)*8 - | lwz TMP0, -12(BASE) // Continuation. - | mr RB, BASE - | mr BASE, TMP2 // Restore caller BASE. - | lwz LFUNC:TMP1, FRAME_FUNC(TMP2) - | cmplwi TMP0, 0 - | lwz PC, -16(RB) // Restore PC from [cont|PC]. - | beq >1 - | subi TMP2, RD, 8 - | lwz TMP1, LFUNC:TMP1->pc - | evstddx TISNIL, RA, TMP2 // Ensure one valid arg. - | lwz KBASE, PC2PROTO(k)(TMP1) - | // BASE = base, RA = resultptr, RB = meta base - | mtctr TMP0 - | bctr // Jump to continuation. - | - |1: // Tail call from C function. - | subi TMP1, RB, 16 - | sub RC, TMP1, BASE - | b ->vm_call_tail - | - |->cont_cat: // RA = resultptr, RB = meta base - | lwz INS, -4(PC) - | subi CARG2, RB, 16 - | decode_RB8 SAVE0, INS - | evldd TMP0, 0(RA) - | add TMP1, BASE, SAVE0 - | stw BASE, L->base - | cmplw TMP1, CARG2 - | sub CARG3, CARG2, TMP1 - | decode_RA8 RA, INS - | evstdd TMP0, 0(CARG2) - | bne ->BC_CAT_Z - | evstddx TMP0, BASE, RA - | b ->cont_nop - | - |//-- Table indexing metamethods ----------------------------------------- - | - |->vmeta_tgets1: - | evmergelo STR:RC, TISSTR, STR:RC - | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) - | decode_RB8 RB, INS - | evstdd STR:RC, 0(CARG3) - | add CARG2, BASE, RB - | b >1 - | - |->vmeta_tgets: - | evmergelo TAB:RB, TISTAB, TAB:RB - | la CARG2, DISPATCH_GL(tmptv)(DISPATCH) - | evmergelo STR:RC, TISSTR, STR:RC - | evstdd TAB:RB, 0(CARG2) - | la CARG3, DISPATCH_GL(tmptv2)(DISPATCH) - | evstdd STR:RC, 0(CARG3) - | b >1 - | - |->vmeta_tgetb: // TMP0 = index - | efdcfsi TMP0, TMP0 - | decode_RB8 RB, INS - | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) - | add CARG2, BASE, RB - | evstdd TMP0, 0(CARG3) - | b >1 - | - |->vmeta_tgetv: - | decode_RB8 RB, INS - | decode_RC8 RC, INS - | add CARG2, BASE, RB - | add CARG3, BASE, RC - |1: - | stw BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | bl extern lj_meta_tget // (lua_State *L, TValue *o, TValue *k) - | // Returns TValue * (finished) or NULL (metamethod). - | cmplwi CRET1, 0 - | beq >3 - | evldd TMP0, 0(CRET1) - | evstddx TMP0, BASE, RA - | ins_next - | - |3: // Call __index metamethod. - | // BASE = base, L->top = new base, stack = cont/func/t/k - | subfic TMP1, BASE, FRAME_CONT - | lwz BASE, L->top - | stw PC, -16(BASE) // [cont|PC] - | add PC, TMP1, BASE - | lwz LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here. - | li NARGS8:RC, 16 // 2 args for func(t, k). - | b ->vm_call_dispatch_f - | - |//----------------------------------------------------------------------- - | - |->vmeta_tsets1: - | evmergelo STR:RC, TISSTR, STR:RC - | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) - | decode_RB8 RB, INS - | evstdd STR:RC, 0(CARG3) - | add CARG2, BASE, RB - | b >1 - | - |->vmeta_tsets: - | evmergelo TAB:RB, TISTAB, TAB:RB - | la CARG2, DISPATCH_GL(tmptv)(DISPATCH) - | evmergelo STR:RC, TISSTR, STR:RC - | evstdd TAB:RB, 0(CARG2) - | la CARG3, DISPATCH_GL(tmptv2)(DISPATCH) - | evstdd STR:RC, 0(CARG3) - | b >1 - | - |->vmeta_tsetb: // TMP0 = index - | efdcfsi TMP0, TMP0 - | decode_RB8 RB, INS - | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) - | add CARG2, BASE, RB - | evstdd TMP0, 0(CARG3) - | b >1 - | - |->vmeta_tsetv: - | decode_RB8 RB, INS - | decode_RC8 RC, INS - | add CARG2, BASE, RB - | add CARG3, BASE, RC - |1: - | stw BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | bl extern lj_meta_tset // (lua_State *L, TValue *o, TValue *k) - | // Returns TValue * (finished) or NULL (metamethod). - | cmplwi CRET1, 0 - | evlddx TMP0, BASE, RA - | beq >3 - | // NOBARRIER: lj_meta_tset ensures the table is not black. - | evstdd TMP0, 0(CRET1) - | ins_next - | - |3: // Call __newindex metamethod. - | // BASE = base, L->top = new base, stack = cont/func/t/k/(v) - | subfic TMP1, BASE, FRAME_CONT - | lwz BASE, L->top - | stw PC, -16(BASE) // [cont|PC] - | add PC, TMP1, BASE - | lwz LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here. - | li NARGS8:RC, 24 // 3 args for func(t, k, v) - | evstdd TMP0, 16(BASE) // Copy value to third argument. - | b ->vm_call_dispatch_f - | - |//-- Comparison metamethods --------------------------------------------- - | - |->vmeta_comp: - | mr CARG1, L - | subi PC, PC, 4 - | add CARG2, BASE, RA - | stw PC, SAVE_PC - | add CARG3, BASE, RD - | stw BASE, L->base - | decode_OP1 CARG4, INS - | bl extern lj_meta_comp // (lua_State *L, TValue *o1, *o2, int op) - | // Returns 0/1 or TValue * (metamethod). - |3: - | cmplwi CRET1, 1 - | bgt ->vmeta_binop - |4: - | lwz INS, 0(PC) - | addi PC, PC, 4 - | decode_RD4 TMP2, INS - | addis TMP3, PC, -(BCBIAS_J*4 >> 16) - | add TMP2, TMP2, TMP3 - | isellt PC, PC, TMP2 - |->cont_nop: - | ins_next - | - |->cont_ra: // RA = resultptr - | lwz INS, -4(PC) - | evldd TMP0, 0(RA) - | decode_RA8 TMP1, INS - | evstddx TMP0, BASE, TMP1 - | b ->cont_nop - | - |->cont_condt: // RA = resultptr - | lwz TMP0, 0(RA) - | li TMP1, LJ_TTRUE - | cmplw TMP1, TMP0 // Branch if result is true. - | b <4 - | - |->cont_condf: // RA = resultptr - | lwz TMP0, 0(RA) - | li TMP1, LJ_TFALSE - | cmplw TMP0, TMP1 // Branch if result is false. - | b <4 - | - |->vmeta_equal: - | // CARG2, CARG3, CARG4 are already set by BC_ISEQV/BC_ISNEV. - | subi PC, PC, 4 - | stw BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | bl extern lj_meta_equal // (lua_State *L, GCobj *o1, *o2, int ne) - | // Returns 0/1 or TValue * (metamethod). - | b <3 - | - |//-- Arithmetic metamethods --------------------------------------------- - | - |->vmeta_arith_vn: - | add CARG3, BASE, RB - | add CARG4, KBASE, RC - | b >1 - | - |->vmeta_arith_nv: - | add CARG3, KBASE, RC - | add CARG4, BASE, RB - | b >1 - | - |->vmeta_unm: - | add CARG3, BASE, RD - | mr CARG4, CARG3 - | b >1 - | - |->vmeta_arith_vv: - | add CARG3, BASE, RB - | add CARG4, BASE, RC - |1: - | add CARG2, BASE, RA - | stw BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | decode_OP1 CARG5, INS // Caveat: CARG5 overlaps INS. - | bl extern lj_meta_arith // (lua_State *L, TValue *ra,*rb,*rc, BCReg op) - | // Returns NULL (finished) or TValue * (metamethod). - | cmplwi CRET1, 0 - | beq ->cont_nop - | - | // Call metamethod for binary op. - |->vmeta_binop: - | // BASE = old base, CRET1 = new base, stack = cont/func/o1/o2 - | sub TMP1, CRET1, BASE - | stw PC, -16(CRET1) // [cont|PC] - | mr TMP2, BASE - | addi PC, TMP1, FRAME_CONT - | mr BASE, CRET1 - | li NARGS8:RC, 16 // 2 args for func(o1, o2). - | b ->vm_call_dispatch - | - |->vmeta_len: -#if LJ_52 - | mr SAVE0, CARG1 -#endif - | add CARG2, BASE, RD - | stw BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | bl extern lj_meta_len // (lua_State *L, TValue *o) - | // Returns NULL (retry) or TValue * (metamethod base). -#if LJ_52 - | cmplwi CRET1, 0 - | bne ->vmeta_binop // Binop call for compatibility. - | mr CARG1, SAVE0 - | b ->BC_LEN_Z -#else - | b ->vmeta_binop // Binop call for compatibility. -#endif - | - |//-- Call metamethod ---------------------------------------------------- - | - |->vmeta_call: // Resolve and call __call metamethod. - | // TMP2 = old base, BASE = new base, RC = nargs*8 - | mr CARG1, L - | stw TMP2, L->base // This is the callers base! - | subi CARG2, BASE, 8 - | stw PC, SAVE_PC - | add CARG3, BASE, RC - | mr SAVE0, NARGS8:RC - | bl extern lj_meta_call // (lua_State *L, TValue *func, TValue *top) - | lwz LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here. - | addi NARGS8:RC, SAVE0, 8 // Got one more argument now. - | ins_call - | - |->vmeta_callt: // Resolve __call for BC_CALLT. - | // BASE = old base, RA = new base, RC = nargs*8 - | mr CARG1, L - | stw BASE, L->base - | subi CARG2, RA, 8 - | stw PC, SAVE_PC - | add CARG3, RA, RC - | mr SAVE0, NARGS8:RC - | bl extern lj_meta_call // (lua_State *L, TValue *func, TValue *top) - | lwz TMP1, FRAME_PC(BASE) - | addi NARGS8:RC, SAVE0, 8 // Got one more argument now. - | lwz LFUNC:RB, FRAME_FUNC(RA) // Guaranteed to be a function here. - | b ->BC_CALLT_Z - | - |//-- Argument coercion for 'for' statement ------------------------------ - | - |->vmeta_for: - | mr CARG1, L - | stw BASE, L->base - | mr CARG2, RA - | stw PC, SAVE_PC - | mr SAVE0, INS - | bl extern lj_meta_for // (lua_State *L, TValue *base) - |.if JIT - | decode_OP1 TMP0, SAVE0 - |.endif - | decode_RA8 RA, SAVE0 - |.if JIT - | cmpwi TMP0, BC_JFORI - |.endif - | decode_RD8 RD, SAVE0 - |.if JIT - | beq =>BC_JFORI - |.endif - | b =>BC_FORI - | - |//----------------------------------------------------------------------- - |//-- Fast functions ----------------------------------------------------- - |//----------------------------------------------------------------------- - | - |.macro .ffunc, name - |->ff_ .. name: - |.endmacro - | - |.macro .ffunc_1, name - |->ff_ .. name: - | cmplwi NARGS8:RC, 8 - | evldd CARG1, 0(BASE) - | blt ->fff_fallback - |.endmacro - | - |.macro .ffunc_2, name - |->ff_ .. name: - | cmplwi NARGS8:RC, 16 - | evldd CARG1, 0(BASE) - | evldd CARG2, 8(BASE) - | blt ->fff_fallback - |.endmacro - | - |.macro .ffunc_n, name - | .ffunc_1 name - | checknum CARG1 - | checkfail ->fff_fallback - |.endmacro - | - |.macro .ffunc_nn, name - | .ffunc_2 name - | evmergehi TMP0, CARG1, CARG2 - | checknum TMP0 - | checkanyfail ->fff_fallback - |.endmacro - | - |// Inlined GC threshold check. Caveat: uses TMP0 and TMP1. - |.macro ffgccheck - | lwz TMP0, DISPATCH_GL(gc.total)(DISPATCH) - | lwz TMP1, DISPATCH_GL(gc.threshold)(DISPATCH) - | cmplw TMP0, TMP1 - | bgel ->fff_gcstep - |.endmacro - | - |//-- Base library: checks ----------------------------------------------- - | - |.ffunc assert - | cmplwi NARGS8:RC, 8 - | evldd TMP0, 0(BASE) - | blt ->fff_fallback - | evaddw TMP1, TISNIL, TISNIL // Synthesize LJ_TFALSE. - | la RA, -8(BASE) - | evcmpltu cr1, TMP0, TMP1 - | lwz PC, FRAME_PC(BASE) - | bge cr1, ->fff_fallback - | evstdd TMP0, 0(RA) - | addi RD, NARGS8:RC, 8 // Compute (nresults+1)*8. - | beq ->fff_res // Done if exactly 1 argument. - | li TMP1, 8 - | subi RC, RC, 8 - |1: - | cmplw TMP1, RC - | evlddx TMP0, BASE, TMP1 - | evstddx TMP0, RA, TMP1 - | addi TMP1, TMP1, 8 - | bne <1 - | b ->fff_res - | - |.ffunc type - | cmplwi NARGS8:RC, 8 - | lwz CARG1, 0(BASE) - | blt ->fff_fallback - | li TMP2, ~LJ_TNUMX - | cmplw CARG1, TISNUM - | not TMP1, CARG1 - | isellt TMP1, TMP2, TMP1 - | slwi TMP1, TMP1, 3 - | la TMP2, CFUNC:RB->upvalue - | evlddx STR:CRET1, TMP2, TMP1 - | b ->fff_restv - | - |//-- Base library: getters and setters --------------------------------- - | - |.ffunc_1 getmetatable - | checktab CARG1 - | evmergehi TMP1, CARG1, CARG1 - | checkfail >6 - |1: // Field metatable must be at same offset for GCtab and GCudata! - | lwz TAB:RB, TAB:CARG1->metatable - |2: - | evmr CRET1, TISNIL - | cmplwi TAB:RB, 0 - | lwz STR:RC, DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])(DISPATCH) - | beq ->fff_restv - | lwz TMP0, TAB:RB->hmask - | evmergelo CRET1, TISTAB, TAB:RB // Use metatable as default result. - | lwz TMP1, STR:RC->hash - | lwz NODE:TMP2, TAB:RB->node - | evmergelo STR:RC, TISSTR, STR:RC - | and TMP1, TMP1, TMP0 // idx = str->hash & tab->hmask - | slwi TMP0, TMP1, 5 - | slwi TMP1, TMP1, 3 - | sub TMP1, TMP0, TMP1 - | add NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8) - |3: // Rearranged logic, because we expect _not_ to find the key. - | evldd TMP0, NODE:TMP2->key - | evldd TMP1, NODE:TMP2->val - | evcmpeq TMP0, STR:RC - | lwz NODE:TMP2, NODE:TMP2->next - | checkallok >5 - | cmplwi NODE:TMP2, 0 - | beq ->fff_restv // Not found, keep default result. - | b <3 - |5: - | checknil TMP1 - | checkok ->fff_restv // Ditto for nil value. - | evmr CRET1, TMP1 // Return value of mt.__metatable. - | b ->fff_restv - | - |6: - | cmpwi TMP1, LJ_TUDATA - | not TMP1, TMP1 - | beq <1 - | checknum CARG1 - | slwi TMP1, TMP1, 2 - | li TMP2, 4*~LJ_TNUMX - | isellt TMP1, TMP2, TMP1 - | la TMP2, DISPATCH_GL(gcroot[GCROOT_BASEMT])(DISPATCH) - | lwzx TAB:RB, TMP2, TMP1 - | b <2 - | - |.ffunc_2 setmetatable - | // Fast path: no mt for table yet and not clearing the mt. - | evmergehi TMP0, TAB:CARG1, TAB:CARG2 - | checktab TMP0 - | checkanyfail ->fff_fallback - | lwz TAB:TMP1, TAB:CARG1->metatable - | cmplwi TAB:TMP1, 0 - | lbz TMP3, TAB:CARG1->marked - | bne ->fff_fallback - | andi. TMP0, TMP3, LJ_GC_BLACK // isblack(table) - | stw TAB:CARG2, TAB:CARG1->metatable - | beq ->fff_restv - | barrierback TAB:CARG1, TMP3, TMP0 - | b ->fff_restv - | - |.ffunc rawget - | cmplwi NARGS8:RC, 16 - | evldd CARG2, 0(BASE) - | blt ->fff_fallback - | checktab CARG2 - | la CARG3, 8(BASE) - | checkfail ->fff_fallback - | mr CARG1, L - | bl extern lj_tab_get // (lua_State *L, GCtab *t, cTValue *key) - | // Returns cTValue *. - | evldd CRET1, 0(CRET1) - | b ->fff_restv - | - |//-- Base library: conversions ------------------------------------------ - | - |.ffunc tonumber - | // Only handles the number case inline (without a base argument). - | cmplwi NARGS8:RC, 8 - | evldd CARG1, 0(BASE) - | bne ->fff_fallback // Exactly one argument. - | checknum CARG1 - | checkok ->fff_restv - | b ->fff_fallback - | - |.ffunc_1 tostring - | // Only handles the string or number case inline. - | checkstr CARG1 - | // A __tostring method in the string base metatable is ignored. - | checkok ->fff_restv // String key? - | // Handle numbers inline, unless a number base metatable is present. - | lwz TMP0, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])(DISPATCH) - | checknum CARG1 - | cmplwi cr1, TMP0, 0 - | stw BASE, L->base // Add frame since C call can throw. - | crand 4*cr0+eq, 4*cr0+lt, 4*cr1+eq - | stw PC, SAVE_PC // Redundant (but a defined value). - | bne ->fff_fallback - | ffgccheck - | mr CARG1, L - | mr CARG2, BASE - | bl extern lj_str_fromnum // (lua_State *L, lua_Number *np) - | // Returns GCstr *. - | evmergelo STR:CRET1, TISSTR, STR:CRET1 - | b ->fff_restv - | - |//-- Base library: iterators ------------------------------------------- - | - |.ffunc next - | cmplwi NARGS8:RC, 8 - | evldd CARG2, 0(BASE) - | blt ->fff_fallback - | evstddx TISNIL, BASE, NARGS8:RC // Set missing 2nd arg to nil. - | checktab TAB:CARG2 - | lwz PC, FRAME_PC(BASE) - | checkfail ->fff_fallback - | stw BASE, L->base // Add frame since C call can throw. - | mr CARG1, L - | stw BASE, L->top // Dummy frame length is ok. - | la CARG3, 8(BASE) - | stw PC, SAVE_PC - | bl extern lj_tab_next // (lua_State *L, GCtab *t, TValue *key) - | // Returns 0 at end of traversal. - | cmplwi CRET1, 0 - | evmr CRET1, TISNIL - | beq ->fff_restv // End of traversal: return nil. - | evldd TMP0, 8(BASE) // Copy key and value to results. - | la RA, -8(BASE) - | evldd TMP1, 16(BASE) - | evstdd TMP0, 0(RA) - | li RD, (2+1)*8 - | evstdd TMP1, 8(RA) - | b ->fff_res - | - |.ffunc_1 pairs - | checktab TAB:CARG1 - | lwz PC, FRAME_PC(BASE) - | checkfail ->fff_fallback -#if LJ_52 - | lwz TAB:TMP2, TAB:CARG1->metatable - | evldd CFUNC:TMP0, CFUNC:RB->upvalue[0] - | cmplwi TAB:TMP2, 0 - | la RA, -8(BASE) - | bne ->fff_fallback -#else - | evldd CFUNC:TMP0, CFUNC:RB->upvalue[0] - | la RA, -8(BASE) -#endif - | evstdd TISNIL, 8(BASE) - | li RD, (3+1)*8 - | evstdd CFUNC:TMP0, 0(RA) - | b ->fff_res - | - |.ffunc_2 ipairs_aux - | checktab TAB:CARG1 - | lwz PC, FRAME_PC(BASE) - | checkfail ->fff_fallback - | checknum CARG2 - | lus TMP3, 0x3ff0 - | checkfail ->fff_fallback - | efdctsi TMP2, CARG2 - | lwz TMP0, TAB:CARG1->asize - | evmergelo TMP3, TMP3, ZERO - | lwz TMP1, TAB:CARG1->array - | efdadd CARG2, CARG2, TMP3 - | addi TMP2, TMP2, 1 - | la RA, -8(BASE) - | cmplw TMP0, TMP2 - | slwi TMP3, TMP2, 3 - | evstdd CARG2, 0(RA) - | ble >2 // Not in array part? - | evlddx TMP1, TMP1, TMP3 - |1: - | checknil TMP1 - | li RD, (0+1)*8 - | checkok ->fff_res // End of iteration, return 0 results. - | li RD, (2+1)*8 - | evstdd TMP1, 8(RA) - | b ->fff_res - |2: // Check for empty hash part first. Otherwise call C function. - | lwz TMP0, TAB:CARG1->hmask - | cmplwi TMP0, 0 - | li RD, (0+1)*8 - | beq ->fff_res - | mr CARG2, TMP2 - | bl extern lj_tab_getinth // (GCtab *t, int32_t key) - | // Returns cTValue * or NULL. - | cmplwi CRET1, 0 - | li RD, (0+1)*8 - | beq ->fff_res - | evldd TMP1, 0(CRET1) - | b <1 - | - |.ffunc_1 ipairs - | checktab TAB:CARG1 - | lwz PC, FRAME_PC(BASE) - | checkfail ->fff_fallback -#if LJ_52 - | lwz TAB:TMP2, TAB:CARG1->metatable - | evldd CFUNC:TMP0, CFUNC:RB->upvalue[0] - | cmplwi TAB:TMP2, 0 - | la RA, -8(BASE) - | bne ->fff_fallback -#else - | evldd CFUNC:TMP0, CFUNC:RB->upvalue[0] - | la RA, -8(BASE) -#endif - | evsplati TMP1, 0 - | li RD, (3+1)*8 - | evstdd TMP1, 8(BASE) - | evstdd CFUNC:TMP0, 0(RA) - | b ->fff_res - | - |//-- Base library: catch errors ---------------------------------------- - | - |.ffunc pcall - | cmplwi NARGS8:RC, 8 - | lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH) - | blt ->fff_fallback - | mr TMP2, BASE - | la BASE, 8(BASE) - | // Remember active hook before pcall. - | rlwinm TMP3, TMP3, 32-HOOK_ACTIVE_SHIFT, 31, 31 - | subi NARGS8:RC, NARGS8:RC, 8 - | addi PC, TMP3, 8+FRAME_PCALL - | b ->vm_call_dispatch - | - |.ffunc_2 xpcall - | lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH) - | mr TMP2, BASE - | checkfunc CARG2 // Traceback must be a function. - | checkfail ->fff_fallback - | la BASE, 16(BASE) - | // Remember active hook before pcall. - | rlwinm TMP3, TMP3, 32-HOOK_ACTIVE_SHIFT, 31, 31 - | evstdd CARG2, 0(TMP2) // Swap function and traceback. - | subi NARGS8:RC, NARGS8:RC, 16 - | evstdd CARG1, 8(TMP2) - | addi PC, TMP3, 16+FRAME_PCALL - | b ->vm_call_dispatch - | - |//-- Coroutine library -------------------------------------------------- - | - |.macro coroutine_resume_wrap, resume - |.if resume - |.ffunc_1 coroutine_resume - | evmergehi TMP0, L:CARG1, L:CARG1 - |.else - |.ffunc coroutine_wrap_aux - | lwz L:CARG1, CFUNC:RB->upvalue[0].gcr - |.endif - |.if resume - | cmpwi TMP0, LJ_TTHREAD - | bne ->fff_fallback - |.endif - | lbz TMP0, L:CARG1->status - | lwz TMP1, L:CARG1->cframe - | lwz CARG2, L:CARG1->top - | cmplwi cr0, TMP0, LUA_YIELD - | lwz TMP2, L:CARG1->base - | cmplwi cr1, TMP1, 0 - | lwz TMP0, L:CARG1->maxstack - | cmplw cr7, CARG2, TMP2 - | lwz PC, FRAME_PC(BASE) - | crorc 4*cr6+lt, 4*cr0+gt, 4*cr1+eq // st>LUA_YIELD || cframe!=0 - | add TMP2, CARG2, NARGS8:RC - | crandc 4*cr6+gt, 4*cr7+eq, 4*cr0+eq // base==top && st!=LUA_YIELD - | cmplw cr1, TMP2, TMP0 - | cror 4*cr6+lt, 4*cr6+lt, 4*cr6+gt - | stw PC, SAVE_PC - | cror 4*cr6+lt, 4*cr6+lt, 4*cr1+gt // cond1 || cond2 || stackov - | stw BASE, L->base - | blt cr6, ->fff_fallback - |1: - |.if resume - | addi BASE, BASE, 8 // Keep resumed thread in stack for GC. - | subi NARGS8:RC, NARGS8:RC, 8 - | subi TMP2, TMP2, 8 - |.endif - | stw TMP2, L:CARG1->top - | li TMP1, 0 - | stw BASE, L->top - |2: // Move args to coroutine. - | cmpw TMP1, NARGS8:RC - | evlddx TMP0, BASE, TMP1 - | beq >3 - | evstddx TMP0, CARG2, TMP1 - | addi TMP1, TMP1, 8 - | b <2 - |3: - | li CARG3, 0 - | mr L:SAVE0, L:CARG1 - | li CARG4, 0 - | bl ->vm_resume // (lua_State *L, TValue *base, 0, 0) - | // Returns thread status. - |4: - | lwz TMP2, L:SAVE0->base - | cmplwi CRET1, LUA_YIELD - | lwz TMP3, L:SAVE0->top - | li_vmstate INTERP - | lwz BASE, L->base - | st_vmstate - | bgt >8 - | sub RD, TMP3, TMP2 - | lwz TMP0, L->maxstack - | cmplwi RD, 0 - | add TMP1, BASE, RD - | beq >6 // No results? - | cmplw TMP1, TMP0 - | li TMP1, 0 - | bgt >9 // Need to grow stack? - | - | subi TMP3, RD, 8 - | stw TMP2, L:SAVE0->top // Clear coroutine stack. - |5: // Move results from coroutine. - | cmplw TMP1, TMP3 - | evlddx TMP0, TMP2, TMP1 - | evstddx TMP0, BASE, TMP1 - | addi TMP1, TMP1, 8 - | bne <5 - |6: - | andi. TMP0, PC, FRAME_TYPE - |.if resume - | li TMP1, LJ_TTRUE - | la RA, -8(BASE) - | stw TMP1, -8(BASE) // Prepend true to results. - | addi RD, RD, 16 - |.else - | mr RA, BASE - | addi RD, RD, 8 - |.endif - |7: - | stw PC, SAVE_PC - | mr MULTRES, RD - | beq ->BC_RET_Z - | b ->vm_return - | - |8: // Coroutine returned with error (at co->top-1). - |.if resume - | andi. TMP0, PC, FRAME_TYPE - | la TMP3, -8(TMP3) - | li TMP1, LJ_TFALSE - | evldd TMP0, 0(TMP3) - | stw TMP3, L:SAVE0->top // Remove error from coroutine stack. - | li RD, (2+1)*8 - | stw TMP1, -8(BASE) // Prepend false to results. - | la RA, -8(BASE) - | evstdd TMP0, 0(BASE) // Copy error message. - | b <7 - |.else - | mr CARG1, L - | mr CARG2, L:SAVE0 - | bl extern lj_ffh_coroutine_wrap_err // (lua_State *L, lua_State *co) - |.endif - | - |9: // Handle stack expansion on return from yield. - | mr CARG1, L - | srwi CARG2, RD, 3 - | bl extern lj_state_growstack // (lua_State *L, int n) - | li CRET1, 0 - | b <4 - |.endmacro - | - | coroutine_resume_wrap 1 // coroutine.resume - | coroutine_resume_wrap 0 // coroutine.wrap - | - |.ffunc coroutine_yield - | lwz TMP0, L->cframe - | add TMP1, BASE, NARGS8:RC - | stw BASE, L->base - | andi. TMP0, TMP0, CFRAME_RESUME - | stw TMP1, L->top - | li CRET1, LUA_YIELD - | beq ->fff_fallback - | stw ZERO, L->cframe - | stb CRET1, L->status - | b ->vm_leave_unw - | - |//-- Math library ------------------------------------------------------- - | - |.ffunc_n math_abs - | efdabs CRET1, CARG1 - | // Fallthrough. - | - |->fff_restv: - | // CRET1 = TValue result. - | lwz PC, FRAME_PC(BASE) - | la RA, -8(BASE) - | evstdd CRET1, 0(RA) - |->fff_res1: - | // RA = results, PC = return. - | li RD, (1+1)*8 - |->fff_res: - | // RA = results, RD = (nresults+1)*8, PC = return. - | andi. TMP0, PC, FRAME_TYPE - | mr MULTRES, RD - | bne ->vm_return - | lwz INS, -4(PC) - | decode_RB8 RB, INS - |5: - | cmplw RB, RD // More results expected? - | decode_RA8 TMP0, INS - | bgt >6 - | ins_next1 - | // Adjust BASE. KBASE is assumed to be set for the calling frame. - | sub BASE, RA, TMP0 - | ins_next2 - | - |6: // Fill up results with nil. - | subi TMP1, RD, 8 - | addi RD, RD, 8 - | evstddx TISNIL, RA, TMP1 - | b <5 - | - |.macro math_extern, func - | .ffunc math_ .. func - | cmplwi NARGS8:RC, 8 - | evldd CARG2, 0(BASE) - | blt ->fff_fallback - | checknum CARG2 - | evmergehi CARG1, CARG2, CARG2 - | checkfail ->fff_fallback - | bl extern func@plt - | evmergelo CRET1, CRET1, CRET2 - | b ->fff_restv - |.endmacro - | - |.macro math_extern2, func - | .ffunc math_ .. func - | cmplwi NARGS8:RC, 16 - | evldd CARG2, 0(BASE) - | evldd CARG4, 8(BASE) - | blt ->fff_fallback - | evmergehi CARG1, CARG4, CARG2 - | checknum CARG1 - | evmergehi CARG3, CARG4, CARG4 - | checkanyfail ->fff_fallback - | bl extern func@plt - | evmergelo CRET1, CRET1, CRET2 - | b ->fff_restv - |.endmacro - | - |.macro math_round, func - | .ffunc math_ .. func - | cmplwi NARGS8:RC, 8 - | evldd CARG2, 0(BASE) - | blt ->fff_fallback - | checknum CARG2 - | evmergehi CARG1, CARG2, CARG2 - | checkfail ->fff_fallback - | lwz PC, FRAME_PC(BASE) - | bl ->vm_..func.._hilo; - | la RA, -8(BASE) - | evstdd CRET2, 0(RA) - | b ->fff_res1 - |.endmacro - | - | math_round floor - | math_round ceil - | - | math_extern sqrt - | - |.ffunc math_log - | cmplwi NARGS8:RC, 8 - | evldd CARG2, 0(BASE) - | bne ->fff_fallback // Need exactly 1 argument. - | checknum CARG2 - | evmergehi CARG1, CARG2, CARG2 - | checkfail ->fff_fallback - | bl extern log@plt - | evmergelo CRET1, CRET1, CRET2 - | b ->fff_restv - | - | math_extern log10 - | math_extern exp - | math_extern sin - | math_extern cos - | math_extern tan - | math_extern asin - | math_extern acos - | math_extern atan - | math_extern sinh - | math_extern cosh - | math_extern tanh - | math_extern2 pow - | math_extern2 atan2 - | math_extern2 fmod - | - |->ff_math_deg: - |.ffunc_n math_rad - | evldd CARG2, CFUNC:RB->upvalue[0] - | efdmul CRET1, CARG1, CARG2 - | b ->fff_restv - | - |.ffunc math_ldexp - | cmplwi NARGS8:RC, 16 - | evldd CARG2, 0(BASE) - | evldd CARG4, 8(BASE) - | blt ->fff_fallback - | evmergehi CARG1, CARG4, CARG2 - | checknum CARG1 - | checkanyfail ->fff_fallback - | efdctsi CARG3, CARG4 - | bl extern ldexp@plt - | evmergelo CRET1, CRET1, CRET2 - | b ->fff_restv - | - |.ffunc math_frexp - | cmplwi NARGS8:RC, 8 - | evldd CARG2, 0(BASE) - | blt ->fff_fallback - | checknum CARG2 - | evmergehi CARG1, CARG2, CARG2 - | checkfail ->fff_fallback - | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) - | lwz PC, FRAME_PC(BASE) - | bl extern frexp@plt - | lwz TMP1, DISPATCH_GL(tmptv)(DISPATCH) - | evmergelo CRET1, CRET1, CRET2 - | efdcfsi CRET2, TMP1 - | la RA, -8(BASE) - | evstdd CRET1, 0(RA) - | li RD, (2+1)*8 - | evstdd CRET2, 8(RA) - | b ->fff_res - | - |.ffunc math_modf - | cmplwi NARGS8:RC, 8 - | evldd CARG2, 0(BASE) - | blt ->fff_fallback - | checknum CARG2 - | evmergehi CARG1, CARG2, CARG2 - | checkfail ->fff_fallback - | la CARG3, -8(BASE) - | lwz PC, FRAME_PC(BASE) - | bl extern modf@plt - | evmergelo CRET1, CRET1, CRET2 - | la RA, -8(BASE) - | evstdd CRET1, 0(BASE) - | li RD, (2+1)*8 - | b ->fff_res - | - |.macro math_minmax, name, cmpop - | .ffunc_1 name - | checknum CARG1 - | li TMP1, 8 - | checkfail ->fff_fallback - |1: - | evlddx CARG2, BASE, TMP1 - | cmplw cr1, TMP1, NARGS8:RC - | checknum CARG2 - | bge cr1, ->fff_restv // Ok, since CRET1 = CARG1. - | checkfail ->fff_fallback - | cmpop CARG2, CARG1 - | addi TMP1, TMP1, 8 - | crmove 4*cr0+lt, 4*cr0+gt - | evsel CARG1, CARG2, CARG1 - | b <1 - |.endmacro - | - | math_minmax math_min, efdtstlt - | math_minmax math_max, efdtstgt - | - |//-- String library ----------------------------------------------------- - | - |.ffunc_1 string_len - | checkstr STR:CARG1 - | checkfail ->fff_fallback - | lwz TMP0, STR:CARG1->len - | efdcfsi CRET1, TMP0 - | b ->fff_restv - | - |.ffunc string_byte // Only handle the 1-arg case here. - | cmplwi NARGS8:RC, 8 - | evldd STR:CARG1, 0(BASE) - | bne ->fff_fallback // Need exactly 1 argument. - | checkstr STR:CARG1 - | la RA, -8(BASE) - | checkfail ->fff_fallback - | lwz TMP0, STR:CARG1->len - | li RD, (0+1)*8 - | lbz TMP1, STR:CARG1[1] // Access is always ok (NUL at end). - | li TMP2, (1+1)*8 - | cmplwi TMP0, 0 - | lwz PC, FRAME_PC(BASE) - | efdcfsi CRET1, TMP1 - | iseleq RD, RD, TMP2 - | evstdd CRET1, 0(RA) - | b ->fff_res - | - |.ffunc string_char // Only handle the 1-arg case here. - | ffgccheck - | cmplwi NARGS8:RC, 8 - | evldd CARG1, 0(BASE) - | bne ->fff_fallback // Exactly 1 argument. - | checknum CARG1 - | la CARG2, DISPATCH_GL(tmptv)(DISPATCH) - | checkfail ->fff_fallback - | efdctsiz TMP0, CARG1 - | li CARG3, 1 - | cmplwi TMP0, 255 - | stb TMP0, 0(CARG2) - | bgt ->fff_fallback - |->fff_newstr: - | mr CARG1, L - | stw BASE, L->base - | stw PC, SAVE_PC - | bl extern lj_str_new // (lua_State *L, char *str, size_t l) - | // Returns GCstr *. - | lwz BASE, L->base - | evmergelo STR:CRET1, TISSTR, STR:CRET1 - | b ->fff_restv - | - |.ffunc string_sub - | ffgccheck - | cmplwi NARGS8:RC, 16 - | evldd CARG3, 16(BASE) - | evldd STR:CARG1, 0(BASE) - | blt ->fff_fallback - | evldd CARG2, 8(BASE) - | li TMP2, -1 - | beq >1 - | checknum CARG3 - | checkfail ->fff_fallback - | efdctsiz TMP2, CARG3 - |1: - | checknum CARG2 - | checkfail ->fff_fallback - | checkstr STR:CARG1 - | efdctsiz TMP1, CARG2 - | checkfail ->fff_fallback - | lwz TMP0, STR:CARG1->len - | cmplw TMP0, TMP2 // len < end? (unsigned compare) - | add TMP3, TMP2, TMP0 - | blt >5 - |2: - | cmpwi TMP1, 0 // start <= 0? - | add TMP3, TMP1, TMP0 - | ble >7 - |3: - | sub. CARG3, TMP2, TMP1 - | addi CARG2, STR:CARG1, #STR-1 - | addi CARG3, CARG3, 1 - | add CARG2, CARG2, TMP1 - | isellt CARG3, r0, CARG3 - | b ->fff_newstr - | - |5: // Negative end or overflow. - | cmpw TMP0, TMP2 - | addi TMP3, TMP3, 1 - | iselgt TMP2, TMP3, TMP0 // end = end > len ? len : end+len+1 - | b <2 - | - |7: // Negative start or underflow. - | cmpwi cr1, TMP3, 0 - | iseleq TMP1, r0, TMP3 - | isel TMP1, r0, TMP1, 4*cr1+lt - | addi TMP1, TMP1, 1 // start = 1 + (start ? start+len : 0) - | b <3 - | - |.ffunc string_rep // Only handle the 1-char case inline. - | ffgccheck - | cmplwi NARGS8:RC, 16 - | evldd CARG1, 0(BASE) - | evldd CARG2, 8(BASE) - | bne ->fff_fallback // Exactly 2 arguments. - | checknum CARG2 - | checkfail ->fff_fallback - | checkstr STR:CARG1 - | efdctsiz CARG3, CARG2 - | checkfail ->fff_fallback - | lwz TMP0, STR:CARG1->len - | cmpwi CARG3, 0 - | lwz TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH) - | ble >2 // Count <= 0? (or non-int) - | cmplwi TMP0, 1 - | subi TMP2, CARG3, 1 - | blt >2 // Zero length string? - | cmplw cr1, TMP1, CARG3 - | bne ->fff_fallback // Fallback for > 1-char strings. - | lbz TMP0, STR:CARG1[1] - | lwz CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH) - | blt cr1, ->fff_fallback - |1: // Fill buffer with char. Yes, this is suboptimal code (do you care?). - | cmplwi TMP2, 0 - | stbx TMP0, CARG2, TMP2 - | subi TMP2, TMP2, 1 - | bne <1 - | b ->fff_newstr - |2: // Return empty string. - | la STR:CRET1, DISPATCH_GL(strempty)(DISPATCH) - | evmergelo CRET1, TISSTR, STR:CRET1 - | b ->fff_restv - | - |.ffunc string_reverse - | ffgccheck - | cmplwi NARGS8:RC, 8 - | evldd CARG1, 0(BASE) - | blt ->fff_fallback - | checkstr STR:CARG1 - | lwz TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH) - | checkfail ->fff_fallback - | lwz CARG3, STR:CARG1->len - | la CARG1, #STR(STR:CARG1) - | lwz CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH) - | li TMP2, 0 - | cmplw TMP1, CARG3 - | subi TMP3, CARG3, 1 - | blt ->fff_fallback - |1: // Reverse string copy. - | cmpwi TMP3, 0 - | lbzx TMP1, CARG1, TMP2 - | blt ->fff_newstr - | stbx TMP1, CARG2, TMP3 - | subi TMP3, TMP3, 1 - | addi TMP2, TMP2, 1 - | b <1 - | - |.macro ffstring_case, name, lo - | .ffunc name - | ffgccheck - | cmplwi NARGS8:RC, 8 - | evldd CARG1, 0(BASE) - | blt ->fff_fallback - | checkstr STR:CARG1 - | lwz TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH) - | checkfail ->fff_fallback - | lwz CARG3, STR:CARG1->len - | la CARG1, #STR(STR:CARG1) - | lwz CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH) - | cmplw TMP1, CARG3 - | li TMP2, 0 - | blt ->fff_fallback - |1: // ASCII case conversion. - | cmplw TMP2, CARG3 - | lbzx TMP1, CARG1, TMP2 - | bge ->fff_newstr - | subi TMP0, TMP1, lo - | xori TMP3, TMP1, 0x20 - | cmplwi TMP0, 26 - | isellt TMP1, TMP3, TMP1 - | stbx TMP1, CARG2, TMP2 - | addi TMP2, TMP2, 1 - | b <1 - |.endmacro - | - |ffstring_case string_lower, 65 - |ffstring_case string_upper, 97 - | - |//-- Table library ------------------------------------------------------ - | - |.ffunc_1 table_getn - | checktab CARG1 - | checkfail ->fff_fallback - | bl extern lj_tab_len // (GCtab *t) - | // Returns uint32_t (but less than 2^31). - | efdcfsi CRET1, CRET1 - | b ->fff_restv - | - |//-- Bit library -------------------------------------------------------- - | - |.macro .ffunc_bit, name - | .ffunc_n bit_..name - | efdadd CARG1, CARG1, TOBIT - |.endmacro - | - |.ffunc_bit tobit - |->fff_resbit: - | efdcfsi CRET1, CARG1 - | b ->fff_restv - | - |.macro .ffunc_bit_op, name, ins - | .ffunc_bit name - | li TMP1, 8 - |1: - | evlddx CARG2, BASE, TMP1 - | cmplw cr1, TMP1, NARGS8:RC - | checknum CARG2 - | bge cr1, ->fff_resbit - | checkfail ->fff_fallback - | efdadd CARG2, CARG2, TOBIT - | ins CARG1, CARG1, CARG2 - | addi TMP1, TMP1, 8 - | b <1 - |.endmacro - | - |.ffunc_bit_op band, and - |.ffunc_bit_op bor, or - |.ffunc_bit_op bxor, xor - | - |.ffunc_bit bswap - | rotlwi TMP0, CARG1, 8 - | rlwimi TMP0, CARG1, 24, 0, 7 - | rlwimi TMP0, CARG1, 24, 16, 23 - | efdcfsi CRET1, TMP0 - | b ->fff_restv - | - |.ffunc_bit bnot - | not TMP0, CARG1 - | efdcfsi CRET1, TMP0 - | b ->fff_restv - | - |.macro .ffunc_bit_sh, name, ins, shmod - | .ffunc_nn bit_..name - | efdadd CARG2, CARG2, TOBIT - | efdadd CARG1, CARG1, TOBIT - |.if shmod == 1 - | rlwinm CARG2, CARG2, 0, 27, 31 - |.elif shmod == 2 - | neg CARG2, CARG2 - |.endif - | ins TMP0, CARG1, CARG2 - | efdcfsi CRET1, TMP0 - | b ->fff_restv - |.endmacro - | - |.ffunc_bit_sh lshift, slw, 1 - |.ffunc_bit_sh rshift, srw, 1 - |.ffunc_bit_sh arshift, sraw, 1 - |.ffunc_bit_sh rol, rotlw, 0 - |.ffunc_bit_sh ror, rotlw, 2 - | - |//----------------------------------------------------------------------- - | - |->fff_fallback: // Call fast function fallback handler. - | // BASE = new base, RB = CFUNC, RC = nargs*8 - | lwz TMP3, CFUNC:RB->f - | add TMP1, BASE, NARGS8:RC - | lwz PC, FRAME_PC(BASE) // Fallback may overwrite PC. - | addi TMP0, TMP1, 8*LUA_MINSTACK - | lwz TMP2, L->maxstack - | stw PC, SAVE_PC // Redundant (but a defined value). - | cmplw TMP0, TMP2 - | stw BASE, L->base - | stw TMP1, L->top - | mr CARG1, L - | bgt >5 // Need to grow stack. - | mtctr TMP3 - | bctrl // (lua_State *L) - | // Either throws an error, or recovers and returns -1, 0 or nresults+1. - | lwz BASE, L->base - | cmpwi CRET1, 0 - | slwi RD, CRET1, 3 - | la RA, -8(BASE) - | bgt ->fff_res // Returned nresults+1? - |1: // Returned 0 or -1: retry fast path. - | lwz TMP0, L->top - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | sub NARGS8:RC, TMP0, BASE - | bne ->vm_call_tail // Returned -1? - | ins_callt // Returned 0: retry fast path. - | - |// Reconstruct previous base for vmeta_call during tailcall. - |->vm_call_tail: - | andi. TMP0, PC, FRAME_TYPE - | rlwinm TMP1, PC, 0, 0, 28 - | bne >3 - | lwz INS, -4(PC) - | decode_RA8 TMP1, INS - | addi TMP1, TMP1, 8 - |3: - | sub TMP2, BASE, TMP1 - | b ->vm_call_dispatch // Resolve again for tailcall. - | - |5: // Grow stack for fallback handler. - | li CARG2, LUA_MINSTACK - | bl extern lj_state_growstack // (lua_State *L, int n) - | lwz BASE, L->base - | cmpw TMP0, TMP0 // Set 4*cr0+eq to force retry. - | b <1 - | - |->fff_gcstep: // Call GC step function. - | // BASE = new base, RC = nargs*8 - | mflr SAVE0 - | stw BASE, L->base - | add TMP0, BASE, NARGS8:RC - | stw PC, SAVE_PC // Redundant (but a defined value). - | stw TMP0, L->top - | mr CARG1, L - | bl extern lj_gc_step // (lua_State *L) - | lwz BASE, L->base - | mtlr SAVE0 - | lwz TMP0, L->top - | sub NARGS8:RC, TMP0, BASE - | lwz CFUNC:RB, FRAME_FUNC(BASE) - | blr - | - |//----------------------------------------------------------------------- - |//-- Special dispatch targets ------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_record: // Dispatch target for recording phase. - |.if JIT - | NYI - |.endif - | - |->vm_rethook: // Dispatch target for return hooks. - | lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH) - | andi. TMP0, TMP3, HOOK_ACTIVE // Hook already active? - | beq >1 - |5: // Re-dispatch to static ins. - | addi TMP1, TMP1, GG_DISP2STATIC // Assumes decode_OP4 TMP1, INS. - | lwzx TMP0, DISPATCH, TMP1 - | mtctr TMP0 - | bctr - | - |->vm_inshook: // Dispatch target for instr/line hooks. - | lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH) - | lwz TMP2, DISPATCH_GL(hookcount)(DISPATCH) - | andi. TMP0, TMP3, HOOK_ACTIVE // Hook already active? - | rlwinm TMP0, TMP3, 31-LUA_HOOKLINE, 31, 0 - | bne <5 - | - | cmpwi cr1, TMP0, 0 - | addic. TMP2, TMP2, -1 - | beq cr1, <5 - | stw TMP2, DISPATCH_GL(hookcount)(DISPATCH) - | beq >1 - | bge cr1, <5 - |1: - | mr CARG1, L - | stw MULTRES, SAVE_MULTRES - | mr CARG2, PC - | stw BASE, L->base - | // SAVE_PC must hold the _previous_ PC. The callee updates it with PC. - | bl extern lj_dispatch_ins // (lua_State *L, const BCIns *pc) - |3: - | lwz BASE, L->base - |4: // Re-dispatch to static ins. - | lwz INS, -4(PC) - | decode_OP4 TMP1, INS - | decode_RB8 RB, INS - | addi TMP1, TMP1, GG_DISP2STATIC - | decode_RD8 RD, INS - | lwzx TMP0, DISPATCH, TMP1 - | decode_RA8 RA, INS - | decode_RC8 RC, INS - | mtctr TMP0 - | bctr - | - |->cont_hook: // Continue from hook yield. - | addi PC, PC, 4 - | lwz MULTRES, -20(RB) // Restore MULTRES for *M ins. - | b <4 - | - |->vm_hotloop: // Hot loop counter underflow. - |.if JIT - | NYI - |.endif - | - |->vm_callhook: // Dispatch target for call hooks. - | mr CARG2, PC - |.if JIT - | b >1 - |.endif - | - |->vm_hotcall: // Hot call counter underflow. - |.if JIT - | ori CARG2, PC, 1 - |1: - |.endif - | add TMP0, BASE, RC - | stw PC, SAVE_PC - | mr CARG1, L - | stw BASE, L->base - | sub RA, RA, BASE - | stw TMP0, L->top - | bl extern lj_dispatch_call // (lua_State *L, const BCIns *pc) - | // Returns ASMFunction. - | lwz BASE, L->base - | lwz TMP0, L->top - | stw ZERO, SAVE_PC // Invalidate for subsequent line hook. - | sub NARGS8:RC, TMP0, BASE - | add RA, BASE, RA - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | mtctr CRET1 - | bctr - | - |//----------------------------------------------------------------------- - |//-- Trace exit handler ------------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_exit_handler: - |.if JIT - | NYI - |.endif - |->vm_exit_interp: - |.if JIT - | NYI - |.endif - | - |//----------------------------------------------------------------------- - |//-- Math helper functions ---------------------------------------------- - |//----------------------------------------------------------------------- - | - |// FP value rounding. Called by math.floor/math.ceil fast functions - |// and from JIT code. - |// - |// This can be inlined if the CPU has the frin/friz/frip/frim instructions. - |// The alternative hard-float approaches have a deep dependency chain. - |// The resulting latency is at least 3x-7x the double-precision FP latency - |// (e500v2: 6cy, e600: 5cy, Cell: 10cy) or around 20-70 cycles. - |// - |// The soft-float approach is tedious, but much faster (e500v2: ~11cy/~6cy). - |// However it relies on a fast way to transfer the FP value to GPRs - |// (e500v2: 0cy for lo-word, 1cy for hi-word). - |// - |.macro vm_round, name, mode - | // Used temporaries: TMP0, TMP1, TMP2, TMP3. - |->name.._efd: // Input: CARG2, output: CRET2 - | evmergehi CARG1, CARG2, CARG2 - |->name.._hilo: - | // Input: CARG1 (hi), CARG2 (hi, lo), output: CRET2 - | rlwinm TMP2, CARG1, 12, 21, 31 - | addic. TMP2, TMP2, -1023 // exp = exponent(x) - 1023 - | li TMP1, -1 - | cmplwi cr1, TMP2, 51 // 0 <= exp <= 51? - | subfic TMP0, TMP2, 52 - | bgt cr1, >1 - | lus TMP3, 0xfff0 - | slw TMP0, TMP1, TMP0 // lomask = -1 << (52-exp) - | sraw TMP1, TMP3, TMP2 // himask = (int32_t)0xfff00000 >> exp - |.if mode == 2 // trunc(x): - | evmergelo TMP0, TMP1, TMP0 - | evand CRET2, CARG2, TMP0 // hi &= himask, lo &= lomask - |.else - | andc TMP2, CARG2, TMP0 - | andc TMP3, CARG1, TMP1 - | or TMP2, TMP2, TMP3 // ztest = (hi&~himask) | (lo&~lomask) - | srawi TMP3, CARG1, 31 // signmask = (int32_t)hi >> 31 - |.if mode == 0 // floor(x): - | and. TMP2, TMP2, TMP3 // iszero = ((ztest & signmask) == 0) - |.else // ceil(x): - | andc. TMP2, TMP2, TMP3 // iszero = ((ztest & ~signmask) == 0) - |.endif - | and CARG2, CARG2, TMP0 // lo &= lomask - | and CARG1, CARG1, TMP1 // hi &= himask - | subc TMP0, CARG2, TMP0 - | iseleq TMP0, CARG2, TMP0 // lo = iszero ? lo : lo-lomask - | sube TMP1, CARG1, TMP1 - | iseleq TMP1, CARG1, TMP1 // hi = iszero ? hi : hi-himask+carry - | evmergelo CRET2, TMP1, TMP0 - |.endif - | blr - |1: - | bgtlr // Already done if >=2^52, +-inf or nan. - |.if mode == 2 // trunc(x): - | rlwinm TMP1, CARG1, 0, 0, 0 // hi = sign(x) - | li TMP0, 0 - | evmergelo CRET2, TMP1, TMP0 - |.else - | rlwinm TMP2, CARG1, 0, 1, 31 - | srawi TMP0, CARG1, 31 // signmask = (int32_t)hi >> 31 - | or TMP2, TMP2, CARG2 // ztest = abs(hi) | lo - | lus TMP1, 0x3ff0 - |.if mode == 0 // floor(x): - | and. TMP2, TMP2, TMP0 // iszero = ((ztest & signmask) == 0) - |.else // ceil(x): - | andc. TMP2, TMP2, TMP0 // iszero = ((ztest & ~signmask) == 0) - |.endif - | li TMP0, 0 - | iseleq TMP1, r0, TMP1 - | rlwimi CARG1, TMP1, 0, 1, 31 // hi = sign(x) | (iszero ? 0.0 : 1.0) - | evmergelo CRET2, CARG1, TMP0 - |.endif - | blr - |.endmacro - | - |->vm_floor: - | mflr CARG3 - | evmergelo CARG2, CARG1, CARG2 - | bl ->vm_floor_hilo - | mtlr CARG3 - | evmergehi CRET1, CRET2, CRET2 - | blr - | - | vm_round vm_floor, 0 - | vm_round vm_ceil, 1 - |.if JIT - | vm_round vm_trunc, 2 - |.else - |->vm_trunc_efd: - |->vm_trunc_hilo: - |.endif - | - |//----------------------------------------------------------------------- - |//-- Miscellaneous functions -------------------------------------------- - |//----------------------------------------------------------------------- - | - |//----------------------------------------------------------------------- - |//-- FFI helper functions ----------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_ffi_call: - |.if FFI - | NYI - |.endif - | - |//----------------------------------------------------------------------- -} - -/* Generate the code for a single instruction. */ -static void build_ins(BuildCtx *ctx, BCOp op, int defop) -{ - int vk = 0; - |=>defop: - - switch (op) { - - /* -- Comparison ops ---------------------------------------------------- */ - - /* Remember: all ops branch for a true comparison, fall through otherwise. */ - - case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: - | // RA = src1*8, RD = src2*8, JMP with RD = target - | evlddx TMP0, BASE, RA - | addi PC, PC, 4 - | evlddx TMP1, BASE, RD - | addis TMP3, PC, -(BCBIAS_J*4 >> 16) - | lwz TMP2, -4(PC) - | evmergehi RB, TMP0, TMP1 - | decode_RD4 TMP2, TMP2 - | checknum RB - | add TMP2, TMP2, TMP3 - | checkanyfail ->vmeta_comp - | efdcmplt TMP0, TMP1 - if (op == BC_ISLE || op == BC_ISGT) { - | efdcmpeq cr1, TMP0, TMP1 - | cror 4*cr0+gt, 4*cr0+gt, 4*cr1+gt - } - if (op == BC_ISLT || op == BC_ISLE) { - | iselgt PC, TMP2, PC - } else { - | iselgt PC, PC, TMP2 - } - | ins_next - break; - - case BC_ISEQV: case BC_ISNEV: - vk = op == BC_ISEQV; - | // RA = src1*8, RD = src2*8, JMP with RD = target - | evlddx CARG2, BASE, RA - | addi PC, PC, 4 - | evlddx CARG3, BASE, RD - | addis TMP3, PC, -(BCBIAS_J*4 >> 16) - | lwz TMP2, -4(PC) - | evmergehi RB, CARG2, CARG3 - | decode_RD4 TMP2, TMP2 - | checknum RB - | add TMP2, TMP2, TMP3 - | checkanyfail >5 - | efdcmpeq CARG2, CARG3 - if (vk) { - | iselgt PC, TMP2, PC - } else { - | iselgt PC, PC, TMP2 - } - |1: - | ins_next - | - |5: // Either or both types are not numbers. - | evcmpeq CARG2, CARG3 - | not TMP3, RB - | cmplwi cr1, TMP3, ~LJ_TISPRI // Primitive? - | crorc 4*cr7+lt, 4*cr0+so, 4*cr0+lt // 1: Same tv or different type. - | cmplwi cr6, TMP3, ~LJ_TISTABUD // Table or userdata? - | crandc 4*cr7+gt, 4*cr0+lt, 4*cr1+gt // 2: Same type and primitive. - | mr SAVE0, PC - if (vk) { - | isel PC, TMP2, PC, 4*cr7+gt - } else { - | isel TMP2, PC, TMP2, 4*cr7+gt - } - | cror 4*cr7+lt, 4*cr7+lt, 4*cr7+gt // 1 or 2. - if (vk) { - | isel PC, TMP2, PC, 4*cr0+so - } else { - | isel PC, PC, TMP2, 4*cr0+so - } - | blt cr7, <1 // Done if 1 or 2. - | blt cr6, <1 // Done if not tab/ud. - | - | // Different tables or userdatas. Need to check __eq metamethod. - | // Field metatable must be at same offset for GCtab and GCudata! - | lwz TAB:TMP2, TAB:CARG2->metatable - | li CARG4, 1-vk // ne = 0 or 1. - | cmplwi TAB:TMP2, 0 - | beq <1 // No metatable? - | lbz TMP2, TAB:TMP2->nomm - | andi. TMP2, TMP2, 1<vmeta_equal // Handle __eq metamethod. - break; - - case BC_ISEQS: case BC_ISNES: - vk = op == BC_ISEQS; - | // RA = src*8, RD = str_const*8 (~), JMP with RD = target - | evlddx TMP0, BASE, RA - | srwi RD, RD, 1 - | lwz INS, 0(PC) - | subfic RD, RD, -4 - | addi PC, PC, 4 - | lwzx STR:TMP1, KBASE, RD // KBASE-4-str_const*4 - | addis TMP3, PC, -(BCBIAS_J*4 >> 16) - | decode_RD4 TMP2, INS - | evmergelo STR:TMP1, TISSTR, STR:TMP1 - | add TMP2, TMP2, TMP3 - | evcmpeq TMP0, STR:TMP1 - if (vk) { - | isel PC, TMP2, PC, 4*cr0+so - } else { - | isel PC, PC, TMP2, 4*cr0+so - } - | ins_next - break; - - case BC_ISEQN: case BC_ISNEN: - vk = op == BC_ISEQN; - | // RA = src*8, RD = num_const*8, JMP with RD = target - | evlddx TMP0, BASE, RA - | addi PC, PC, 4 - | evlddx TMP1, KBASE, RD - | addis TMP3, PC, -(BCBIAS_J*4 >> 16) - | lwz INS, -4(PC) - | checknum TMP0 - | checkfail >5 - | efdcmpeq TMP0, TMP1 - |1: - | decode_RD4 TMP2, INS - | add TMP2, TMP2, TMP3 - if (vk) { - | iselgt PC, TMP2, PC - |5: - } else { - | iselgt PC, PC, TMP2 - } - |3: - | ins_next - if (!vk) { - |5: - | decode_RD4 TMP2, INS - | add PC, TMP2, TMP3 - | b <3 - } - break; - - case BC_ISEQP: case BC_ISNEP: - vk = op == BC_ISEQP; - | // RA = src*8, RD = primitive_type*8 (~), JMP with RD = target - | lwzx TMP0, BASE, RA - | srwi TMP1, RD, 3 - | lwz INS, 0(PC) - | addi PC, PC, 4 - | not TMP1, TMP1 - | addis TMP3, PC, -(BCBIAS_J*4 >> 16) - | cmplw TMP0, TMP1 - | decode_RD4 TMP2, INS - | add TMP2, TMP2, TMP3 - if (vk) { - | iseleq PC, TMP2, PC - } else { - | iseleq PC, PC, TMP2 - } - | ins_next - break; - - /* -- Unary test and copy ops ------------------------------------------- */ - - case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: - | // RA = dst*8 or unused, RD = src*8, JMP with RD = target - | evlddx TMP0, BASE, RD - | evaddw TMP1, TISNIL, TISNIL // Synthesize LJ_TFALSE. - | lwz INS, 0(PC) - | evcmpltu TMP0, TMP1 - | addi PC, PC, 4 - if (op == BC_IST || op == BC_ISF) { - | addis TMP3, PC, -(BCBIAS_J*4 >> 16) - | decode_RD4 TMP2, INS - | add TMP2, TMP2, TMP3 - if (op == BC_IST) { - | isellt PC, TMP2, PC - } else { - | isellt PC, PC, TMP2 - } - } else { - if (op == BC_ISTC) { - | checkfail >1 - } else { - | checkok >1 - } - | addis PC, PC, -(BCBIAS_J*4 >> 16) - | decode_RD4 TMP2, INS - | evstddx TMP0, BASE, RA - | add PC, PC, TMP2 - |1: - } - | ins_next - break; - - /* -- Unary ops --------------------------------------------------------- */ - - case BC_MOV: - | // RA = dst*8, RD = src*8 - | ins_next1 - | evlddx TMP0, BASE, RD - | evstddx TMP0, BASE, RA - | ins_next2 - break; - case BC_NOT: - | // RA = dst*8, RD = src*8 - | ins_next1 - | lwzx TMP0, BASE, RD - | subfic TMP1, TMP0, LJ_TTRUE - | adde TMP0, TMP0, TMP1 - | stwx TMP0, BASE, RA - | ins_next2 - break; - case BC_UNM: - | // RA = dst*8, RD = src*8 - | evlddx TMP0, BASE, RD - | checknum TMP0 - | checkfail ->vmeta_unm - | efdneg TMP0, TMP0 - | ins_next1 - | evstddx TMP0, BASE, RA - | ins_next2 - break; - case BC_LEN: - | // RA = dst*8, RD = src*8 - | evlddx CARG1, BASE, RD - | checkstr CARG1 - | checkfail >2 - | lwz CRET1, STR:CARG1->len - |1: - | ins_next1 - | efdcfsi TMP0, CRET1 - | evstddx TMP0, BASE, RA - | ins_next2 - |2: - | checktab CARG1 - | checkfail ->vmeta_len -#if LJ_52 - | lwz TAB:TMP2, TAB:CARG1->metatable - | cmplwi TAB:TMP2, 0 - | bne >9 - |3: -#endif - |->BC_LEN_Z: - | bl extern lj_tab_len // (GCtab *t) - | // Returns uint32_t (but less than 2^31). - | b <1 -#if LJ_52 - |9: - | lbz TMP0, TAB:TMP2->nomm - | andi. TMP0, TMP0, 1<vmeta_len -#endif - break; - - /* -- Binary ops -------------------------------------------------------- */ - - |.macro ins_arithpre, t0, t1 - | // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8 - ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); - ||switch (vk) { - ||case 0: - | evlddx t0, BASE, RB - | checknum t0 - | evlddx t1, KBASE, RC - | checkfail ->vmeta_arith_vn - || break; - ||case 1: - | evlddx t1, BASE, RB - | checknum t1 - | evlddx t0, KBASE, RC - | checkfail ->vmeta_arith_nv - || break; - ||default: - | evlddx t0, BASE, RB - | evlddx t1, BASE, RC - | evmergehi TMP2, t0, t1 - | checknum TMP2 - | checkanyfail ->vmeta_arith_vv - || break; - ||} - |.endmacro - | - |.macro ins_arith, ins - | ins_arithpre TMP0, TMP1 - | ins_next1 - | ins TMP0, TMP0, TMP1 - | evstddx TMP0, BASE, RA - | ins_next2 - |.endmacro - - case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: - | ins_arith efdadd - break; - case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: - | ins_arith efdsub - break; - case BC_MULVN: case BC_MULNV: case BC_MULVV: - | ins_arith efdmul - break; - case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: - | ins_arith efddiv - break; - case BC_MODVN: - | ins_arithpre RD, SAVE0 - |->BC_MODVN_Z: - | efddiv CARG2, RD, SAVE0 - | bl ->vm_floor_efd // floor(b/c) - | efdmul TMP0, CRET2, SAVE0 - | ins_next1 - | efdsub TMP0, RD, TMP0 // b - floor(b/c)*c - | evstddx TMP0, BASE, RA - | ins_next2 - break; - case BC_MODNV: case BC_MODVV: - | ins_arithpre RD, SAVE0 - | b ->BC_MODVN_Z // Avoid 3 copies. It's slow anyway. - break; - case BC_POW: - | evlddx CARG2, BASE, RB - | evlddx CARG4, BASE, RC - | evmergehi CARG1, CARG4, CARG2 - | checknum CARG1 - | evmergehi CARG3, CARG4, CARG4 - | checkanyfail ->vmeta_arith_vv - | bl extern pow@plt - | evmergelo CRET2, CRET1, CRET2 - | evstddx CRET2, BASE, RA - | ins_next - break; - - case BC_CAT: - | // RA = dst*8, RB = src_start*8, RC = src_end*8 - | sub CARG3, RC, RB - | stw BASE, L->base - | add CARG2, BASE, RC - | mr SAVE0, RB - |->BC_CAT_Z: - | stw PC, SAVE_PC - | mr CARG1, L - | srwi CARG3, CARG3, 3 - | bl extern lj_meta_cat // (lua_State *L, TValue *top, int left) - | // Returns NULL (finished) or TValue * (metamethod). - | cmplwi CRET1, 0 - | lwz BASE, L->base - | bne ->vmeta_binop - | evlddx TMP0, BASE, SAVE0 // Copy result from RB to RA. - | evstddx TMP0, BASE, RA - | ins_next - break; - - /* -- Constant ops ------------------------------------------------------ */ - - case BC_KSTR: - | // RA = dst*8, RD = str_const*8 (~) - | ins_next1 - | srwi TMP1, RD, 1 - | subfic TMP1, TMP1, -4 - | lwzx TMP0, KBASE, TMP1 // KBASE-4-str_const*4 - | evmergelo TMP0, TISSTR, TMP0 - | evstddx TMP0, BASE, RA - | ins_next2 - break; - case BC_KCDATA: - |.if FFI - | // RA = dst*8, RD = cdata_const*8 (~) - | ins_next1 - | srwi TMP1, RD, 1 - | subfic TMP1, TMP1, -4 - | lwzx TMP0, KBASE, TMP1 // KBASE-4-cdata_const*4 - | li TMP2, LJ_TCDATA - | evmergelo TMP0, TMP2, TMP0 - | evstddx TMP0, BASE, RA - | ins_next2 - |.endif - break; - case BC_KSHORT: - | // RA = dst*8, RD = int16_literal*8 - | srwi TMP1, RD, 3 - | extsh TMP1, TMP1 - | ins_next1 - | efdcfsi TMP0, TMP1 - | evstddx TMP0, BASE, RA - | ins_next2 - break; - case BC_KNUM: - | // RA = dst*8, RD = num_const*8 - | evlddx TMP0, KBASE, RD - | ins_next1 - | evstddx TMP0, BASE, RA - | ins_next2 - break; - case BC_KPRI: - | // RA = dst*8, RD = primitive_type*8 (~) - | srwi TMP1, RD, 3 - | not TMP0, TMP1 - | ins_next1 - | stwx TMP0, BASE, RA - | ins_next2 - break; - case BC_KNIL: - | // RA = base*8, RD = end*8 - | evstddx TISNIL, BASE, RA - | addi RA, RA, 8 - |1: - | evstddx TISNIL, BASE, RA - | cmpw RA, RD - | addi RA, RA, 8 - | blt <1 - | ins_next_ - break; - - /* -- Upvalue and function ops ------------------------------------------ */ - - case BC_UGET: - | // RA = dst*8, RD = uvnum*8 - | ins_next1 - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | srwi RD, RD, 1 - | addi RD, RD, offsetof(GCfuncL, uvptr) - | lwzx UPVAL:RB, LFUNC:RB, RD - | lwz TMP1, UPVAL:RB->v - | evldd TMP0, 0(TMP1) - | evstddx TMP0, BASE, RA - | ins_next2 - break; - case BC_USETV: - | // RA = uvnum*8, RD = src*8 - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | srwi RA, RA, 1 - | addi RA, RA, offsetof(GCfuncL, uvptr) - | evlddx TMP1, BASE, RD - | lwzx UPVAL:RB, LFUNC:RB, RA - | lbz TMP3, UPVAL:RB->marked - | lwz CARG2, UPVAL:RB->v - | andi. TMP3, TMP3, LJ_GC_BLACK // isblack(uv) - | lbz TMP0, UPVAL:RB->closed - | evmergehi TMP2, TMP1, TMP1 - | evstdd TMP1, 0(CARG2) - | cmplwi cr1, TMP0, 0 - | cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq - | subi TMP2, TMP2, (LJ_TISNUM+1) - | bne >2 // Upvalue is closed and black? - |1: - | ins_next - | - |2: // Check if new value is collectable. - | cmplwi TMP2, LJ_TISGCV - (LJ_TISNUM+1) - | bge <1 // tvisgcv(v) - | lbz TMP3, GCOBJ:TMP1->gch.marked - | andi. TMP3, TMP3, LJ_GC_WHITES // iswhite(v) - | la CARG1, GG_DISP2G(DISPATCH) - | // Crossed a write barrier. Move the barrier forward. - | beq <1 - | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) - | b <1 - break; - case BC_USETS: - | // RA = uvnum*8, RD = str_const*8 (~) - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | srwi TMP1, RD, 1 - | srwi RA, RA, 1 - | subfic TMP1, TMP1, -4 - | addi RA, RA, offsetof(GCfuncL, uvptr) - | lwzx STR:TMP1, KBASE, TMP1 // KBASE-4-str_const*4 - | lwzx UPVAL:RB, LFUNC:RB, RA - | evmergelo STR:TMP1, TISSTR, STR:TMP1 - | lbz TMP3, UPVAL:RB->marked - | lwz CARG2, UPVAL:RB->v - | andi. TMP3, TMP3, LJ_GC_BLACK // isblack(uv) - | lbz TMP3, STR:TMP1->marked - | lbz TMP2, UPVAL:RB->closed - | evstdd STR:TMP1, 0(CARG2) - | bne >2 - |1: - | ins_next - | - |2: // Check if string is white and ensure upvalue is closed. - | andi. TMP3, TMP3, LJ_GC_WHITES // iswhite(str) - | cmplwi cr1, TMP2, 0 - | cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq - | la CARG1, GG_DISP2G(DISPATCH) - | // Crossed a write barrier. Move the barrier forward. - | beq <1 - | bl extern lj_gc_barrieruv // (global_State *g, TValue *tv) - | b <1 - break; - case BC_USETN: - | // RA = uvnum*8, RD = num_const*8 - | ins_next1 - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | srwi RA, RA, 1 - | addi RA, RA, offsetof(GCfuncL, uvptr) - | evlddx TMP0, KBASE, RD - | lwzx UPVAL:RB, LFUNC:RB, RA - | lwz TMP1, UPVAL:RB->v - | evstdd TMP0, 0(TMP1) - | ins_next2 - break; - case BC_USETP: - | // RA = uvnum*8, RD = primitive_type*8 (~) - | ins_next1 - | lwz LFUNC:RB, FRAME_FUNC(BASE) - | srwi RA, RA, 1 - | addi RA, RA, offsetof(GCfuncL, uvptr) - | srwi TMP0, RD, 3 - | lwzx UPVAL:RB, LFUNC:RB, RA - | not TMP0, TMP0 - | lwz TMP1, UPVAL:RB->v - | stw TMP0, 0(TMP1) - | ins_next2 - break; - - case BC_UCLO: - | // RA = level*8, RD = target - | lwz TMP1, L->openupval - | branch_RD // Do this first since RD is not saved. - | stw BASE, L->base - | cmplwi TMP1, 0 - | mr CARG1, L - | beq >1 - | add CARG2, BASE, RA - | bl extern lj_func_closeuv // (lua_State *L, TValue *level) - | lwz BASE, L->base - |1: - | ins_next - break; - - case BC_FNEW: - | // RA = dst*8, RD = proto_const*8 (~) (holding function prototype) - | srwi TMP1, RD, 1 - | stw BASE, L->base - | subfic TMP1, TMP1, -4 - | stw PC, SAVE_PC - | lwzx CARG2, KBASE, TMP1 // KBASE-4-tab_const*4 - | mr CARG1, L - | lwz CARG3, FRAME_FUNC(BASE) - | // (lua_State *L, GCproto *pt, GCfuncL *parent) - | bl extern lj_func_newL_gc - | // Returns GCfuncL *. - | lwz BASE, L->base - | evmergelo LFUNC:CRET1, TISFUNC, LFUNC:CRET1 - | evstddx LFUNC:CRET1, BASE, RA - | ins_next - break; - - /* -- Table ops --------------------------------------------------------- */ - - case BC_TNEW: - case BC_TDUP: - | // RA = dst*8, RD = (hbits|asize)*8 | tab_const*8 (~) - | lwz TMP0, DISPATCH_GL(gc.total)(DISPATCH) - | mr CARG1, L - | lwz TMP1, DISPATCH_GL(gc.threshold)(DISPATCH) - | stw BASE, L->base - | cmplw TMP0, TMP1 - | stw PC, SAVE_PC - | bge >5 - |1: - if (op == BC_TNEW) { - | rlwinm CARG2, RD, 29, 21, 31 - | rlwinm CARG3, RD, 18, 27, 31 - | cmpwi CARG2, 0x7ff - | li TMP1, 0x801 - | iseleq CARG2, TMP1, CARG2 - | bl extern lj_tab_new // (lua_State *L, int32_t asize, uint32_t hbits) - | // Returns Table *. - } else { - | srwi TMP1, RD, 1 - | subfic TMP1, TMP1, -4 - | lwzx CARG2, KBASE, TMP1 // KBASE-4-tab_const*4 - | bl extern lj_tab_dup // (lua_State *L, Table *kt) - | // Returns Table *. - } - | lwz BASE, L->base - | evmergelo TAB:CRET1, TISTAB, TAB:CRET1 - | evstddx TAB:CRET1, BASE, RA - | ins_next - |5: - | mr SAVE0, RD - | bl extern lj_gc_step_fixtop // (lua_State *L) - | mr RD, SAVE0 - | mr CARG1, L - | b <1 - break; - - case BC_GGET: - | // RA = dst*8, RD = str_const*8 (~) - case BC_GSET: - | // RA = src*8, RD = str_const*8 (~) - | lwz LFUNC:TMP2, FRAME_FUNC(BASE) - | srwi TMP1, RD, 1 - | lwz TAB:RB, LFUNC:TMP2->env - | subfic TMP1, TMP1, -4 - | lwzx STR:RC, KBASE, TMP1 // KBASE-4-str_const*4 - if (op == BC_GGET) { - | b ->BC_TGETS_Z - } else { - | b ->BC_TSETS_Z - } - break; - - case BC_TGETV: - | // RA = dst*8, RB = table*8, RC = key*8 - | evlddx TAB:RB, BASE, RB - | evlddx RC, BASE, RC - | checktab TAB:RB - | checkfail ->vmeta_tgetv - | checknum RC - | checkfail >5 - | // Convert number key to integer - | efdctsi TMP2, RC - | lwz TMP0, TAB:RB->asize - | efdcfsi TMP1, TMP2 - | cmplw cr0, TMP0, TMP2 - | efdcmpeq cr1, RC, TMP1 - | lwz TMP1, TAB:RB->array - | crand 4*cr0+gt, 4*cr0+gt, 4*cr1+gt - | slwi TMP2, TMP2, 3 - | ble ->vmeta_tgetv // Integer key and in array part? - | evlddx TMP1, TMP1, TMP2 - | checknil TMP1 - | checkok >2 - |1: - | evstddx TMP1, BASE, RA - | ins_next - | - |2: // Check for __index if table value is nil. - | lwz TAB:TMP2, TAB:RB->metatable - | cmplwi TAB:TMP2, 0 - | beq <1 // No metatable: done. - | lbz TMP0, TAB:TMP2->nomm - | andi. TMP0, TMP0, 1<vmeta_tgetv - | - |5: - | checkstr STR:RC // String key? - | checkok ->BC_TGETS_Z - | b ->vmeta_tgetv - break; - case BC_TGETS: - | // RA = dst*8, RB = table*8, RC = str_const*8 (~) - | evlddx TAB:RB, BASE, RB - | srwi TMP1, RC, 1 - | checktab TAB:RB - | subfic TMP1, TMP1, -4 - | lwzx STR:RC, KBASE, TMP1 // KBASE-4-str_const*4 - | checkfail ->vmeta_tgets1 - |->BC_TGETS_Z: - | // TAB:RB = GCtab *, STR:RC = GCstr *, RA = dst*8 - | lwz TMP0, TAB:RB->hmask - | lwz TMP1, STR:RC->hash - | lwz NODE:TMP2, TAB:RB->node - | evmergelo STR:RC, TISSTR, STR:RC - | and TMP1, TMP1, TMP0 // idx = str->hash & tab->hmask - | slwi TMP0, TMP1, 5 - | slwi TMP1, TMP1, 3 - | sub TMP1, TMP0, TMP1 - | add NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8) - |1: - | evldd TMP0, NODE:TMP2->key - | evldd TMP1, NODE:TMP2->val - | evcmpeq TMP0, STR:RC - | checkanyfail >4 - | checknil TMP1 - | checkok >5 // Key found, but nil value? - |3: - | evstddx TMP1, BASE, RA - | ins_next - | - |4: // Follow hash chain. - | lwz NODE:TMP2, NODE:TMP2->next - | cmplwi NODE:TMP2, 0 - | bne <1 - | // End of hash chain: key not found, nil result. - | evmr TMP1, TISNIL - | - |5: // Check for __index if table value is nil. - | lwz TAB:TMP2, TAB:RB->metatable - | cmplwi TAB:TMP2, 0 - | beq <3 // No metatable: done. - | lbz TMP0, TAB:TMP2->nomm - | andi. TMP0, TMP0, 1<vmeta_tgets - break; - case BC_TGETB: - | // RA = dst*8, RB = table*8, RC = index*8 - | evlddx TAB:RB, BASE, RB - | srwi TMP0, RC, 3 - | checktab TAB:RB - | checkfail ->vmeta_tgetb - | lwz TMP1, TAB:RB->asize - | lwz TMP2, TAB:RB->array - | cmplw TMP0, TMP1 - | bge ->vmeta_tgetb - | evlddx TMP1, TMP2, RC - | checknil TMP1 - | checkok >5 - |1: - | ins_next1 - | evstddx TMP1, BASE, RA - | ins_next2 - | - |5: // Check for __index if table value is nil. - | lwz TAB:TMP2, TAB:RB->metatable - | cmplwi TAB:TMP2, 0 - | beq <1 // No metatable: done. - | lbz TMP2, TAB:TMP2->nomm - | andi. TMP2, TMP2, 1<vmeta_tgetb // Caveat: preserve TMP0! - break; - - case BC_TSETV: - | // RA = src*8, RB = table*8, RC = key*8 - | evlddx TAB:RB, BASE, RB - | evlddx RC, BASE, RC - | checktab TAB:RB - | checkfail ->vmeta_tsetv - | checknum RC - | checkfail >5 - | // Convert number key to integer - | efdctsi TMP2, RC - | evlddx SAVE0, BASE, RA - | lwz TMP0, TAB:RB->asize - | efdcfsi TMP1, TMP2 - | cmplw cr0, TMP0, TMP2 - | efdcmpeq cr1, RC, TMP1 - | lwz TMP1, TAB:RB->array - | crand 4*cr0+gt, 4*cr0+gt, 4*cr1+gt - | slwi TMP0, TMP2, 3 - | ble ->vmeta_tsetv // Integer key and in array part? - | lbz TMP3, TAB:RB->marked - | evlddx TMP2, TMP1, TMP0 - | checknil TMP2 - | checkok >3 - |1: - | andi. TMP2, TMP3, LJ_GC_BLACK // isblack(table) - | evstddx SAVE0, TMP1, TMP0 - | bne >7 - |2: - | ins_next - | - |3: // Check for __newindex if previous value is nil. - | lwz TAB:TMP2, TAB:RB->metatable - | cmplwi TAB:TMP2, 0 - | beq <1 // No metatable: done. - | lbz TMP2, TAB:TMP2->nomm - | andi. TMP2, TMP2, 1<vmeta_tsetv - | - |5: - | checkstr STR:RC // String key? - | checkok ->BC_TSETS_Z - | b ->vmeta_tsetv - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, TMP3, TMP0 - | b <2 - break; - case BC_TSETS: - | // RA = src*8, RB = table*8, RC = str_const*8 (~) - | evlddx TAB:RB, BASE, RB - | srwi TMP1, RC, 1 - | checktab TAB:RB - | subfic TMP1, TMP1, -4 - | lwzx STR:RC, KBASE, TMP1 // KBASE-4-str_const*4 - | checkfail ->vmeta_tsets1 - |->BC_TSETS_Z: - | // TAB:RB = GCtab *, STR:RC = GCstr *, RA = src*8 - | lwz TMP0, TAB:RB->hmask - | lwz TMP1, STR:RC->hash - | lwz NODE:TMP2, TAB:RB->node - | evmergelo STR:RC, TISSTR, STR:RC - | stb ZERO, TAB:RB->nomm // Clear metamethod cache. - | and TMP1, TMP1, TMP0 // idx = str->hash & tab->hmask - | evlddx SAVE0, BASE, RA - | slwi TMP0, TMP1, 5 - | slwi TMP1, TMP1, 3 - | sub TMP1, TMP0, TMP1 - | lbz TMP3, TAB:RB->marked - | add NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8) - |1: - | evldd TMP0, NODE:TMP2->key - | evldd TMP1, NODE:TMP2->val - | evcmpeq TMP0, STR:RC - | checkanyfail >5 - | checknil TMP1 - | checkok >4 // Key found, but nil value? - |2: - | andi. TMP0, TMP3, LJ_GC_BLACK // isblack(table) - | evstdd SAVE0, NODE:TMP2->val - | bne >7 - |3: - | ins_next - | - |4: // Check for __newindex if previous value is nil. - | lwz TAB:TMP1, TAB:RB->metatable - | cmplwi TAB:TMP1, 0 - | beq <2 // No metatable: done. - | lbz TMP0, TAB:TMP1->nomm - | andi. TMP0, TMP0, 1<vmeta_tsets - | - |5: // Follow hash chain. - | lwz NODE:TMP2, NODE:TMP2->next - | cmplwi NODE:TMP2, 0 - | bne <1 - | // End of hash chain: key not found, add a new one. - | - | // But check for __newindex first. - | lwz TAB:TMP1, TAB:RB->metatable - | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) - | stw PC, SAVE_PC - | mr CARG1, L - | cmplwi TAB:TMP1, 0 - | stw BASE, L->base - | beq >6 // No metatable: continue. - | lbz TMP0, TAB:TMP1->nomm - | andi. TMP0, TMP0, 1<vmeta_tsets // 'no __newindex' flag NOT set: check. - |6: - | mr CARG2, TAB:RB - | evstdd STR:RC, 0(CARG3) - | bl extern lj_tab_newkey // (lua_State *L, GCtab *t, TValue *k) - | // Returns TValue *. - | lwz BASE, L->base - | evstdd SAVE0, 0(CRET1) - | b <3 // No 2nd write barrier needed. - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, TMP3, TMP0 - | b <3 - break; - case BC_TSETB: - | // RA = src*8, RB = table*8, RC = index*8 - | evlddx TAB:RB, BASE, RB - | srwi TMP0, RC, 3 - | checktab TAB:RB - | checkfail ->vmeta_tsetb - | lwz TMP1, TAB:RB->asize - | lwz TMP2, TAB:RB->array - | lbz TMP3, TAB:RB->marked - | cmplw TMP0, TMP1 - | evlddx SAVE0, BASE, RA - | bge ->vmeta_tsetb - | evlddx TMP1, TMP2, RC - | checknil TMP1 - | checkok >5 - |1: - | andi. TMP0, TMP3, LJ_GC_BLACK // isblack(table) - | evstddx SAVE0, TMP2, RC - | bne >7 - |2: - | ins_next - | - |5: // Check for __newindex if previous value is nil. - | lwz TAB:TMP1, TAB:RB->metatable - | cmplwi TAB:TMP1, 0 - | beq <1 // No metatable: done. - | lbz TMP1, TAB:TMP1->nomm - | andi. TMP1, TMP1, 1<vmeta_tsetb // Caveat: preserve TMP0! - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, TMP3, TMP0 - | b <2 - break; - - case BC_TSETM: - | // RA = base*8 (table at base-1), RD = num_const*8 (start index) - | add RA, BASE, RA - |1: - | add TMP3, KBASE, RD - | lwz TAB:CARG2, -4(RA) // Guaranteed to be a table. - | addic. TMP0, MULTRES, -8 - | lwz TMP3, 4(TMP3) // Integer constant is in lo-word. - | srwi CARG3, TMP0, 3 - | beq >4 // Nothing to copy? - | add CARG3, CARG3, TMP3 - | lwz TMP2, TAB:CARG2->asize - | slwi TMP1, TMP3, 3 - | lbz TMP3, TAB:CARG2->marked - | cmplw CARG3, TMP2 - | add TMP2, RA, TMP0 - | lwz TMP0, TAB:CARG2->array - | bgt >5 - | add TMP1, TMP1, TMP0 - | andi. TMP0, TMP3, LJ_GC_BLACK // isblack(table) - |3: // Copy result slots to table. - | evldd TMP0, 0(RA) - | addi RA, RA, 8 - | cmpw cr1, RA, TMP2 - | evstdd TMP0, 0(TMP1) - | addi TMP1, TMP1, 8 - | blt cr1, <3 - | bne >7 - |4: - | ins_next - | - |5: // Need to resize array part. - | stw BASE, L->base - | mr CARG1, L - | stw PC, SAVE_PC - | mr SAVE0, RD - | bl extern lj_tab_reasize // (lua_State *L, GCtab *t, int nasize) - | // Must not reallocate the stack. - | mr RD, SAVE0 - | b <1 - | - |7: // Possible table write barrier for any value. Skip valiswhite check. - | barrierback TAB:CARG2, TMP3, TMP0 - | b <4 - break; - - /* -- Calls and vararg handling ----------------------------------------- */ - - case BC_CALLM: - | // RA = base*8, (RB = (nresults+1)*8,) RC = extra_nargs*8 - | add NARGS8:RC, NARGS8:RC, MULTRES - | // Fall through. Assumes BC_CALL follows. - break; - case BC_CALL: - | // RA = base*8, (RB = (nresults+1)*8,) RC = (nargs+1)*8 - | evlddx LFUNC:RB, BASE, RA - | mr TMP2, BASE - | add BASE, BASE, RA - | subi NARGS8:RC, NARGS8:RC, 8 - | checkfunc LFUNC:RB - | addi BASE, BASE, 8 - | checkfail ->vmeta_call - | ins_call - break; - - case BC_CALLMT: - | // RA = base*8, (RB = 0,) RC = extra_nargs*8 - | add NARGS8:RC, NARGS8:RC, MULTRES - | // Fall through. Assumes BC_CALLT follows. - break; - case BC_CALLT: - | // RA = base*8, (RB = 0,) RC = (nargs+1)*8 - | evlddx LFUNC:RB, BASE, RA - | add RA, BASE, RA - | lwz TMP1, FRAME_PC(BASE) - | subi NARGS8:RC, NARGS8:RC, 8 - | checkfunc LFUNC:RB - | addi RA, RA, 8 - | checkfail ->vmeta_callt - |->BC_CALLT_Z: - | andi. TMP0, TMP1, FRAME_TYPE // Caveat: preserve cr0 until the crand. - | lbz TMP3, LFUNC:RB->ffid - | xori TMP2, TMP1, FRAME_VARG - | cmplwi cr1, NARGS8:RC, 0 - | bne >7 - |1: - | stw LFUNC:RB, FRAME_FUNC(BASE) // Copy function down, but keep PC. - | li TMP2, 0 - | cmplwi cr7, TMP3, 1 // (> FF_C) Calling a fast function? - | beq cr1, >3 - |2: - | addi TMP3, TMP2, 8 - | evlddx TMP0, RA, TMP2 - | cmplw cr1, TMP3, NARGS8:RC - | evstddx TMP0, BASE, TMP2 - | mr TMP2, TMP3 - | bne cr1, <2 - |3: - | crand 4*cr0+eq, 4*cr0+eq, 4*cr7+gt - | beq >5 - |4: - | ins_callt - | - |5: // Tailcall to a fast function with a Lua frame below. - | lwz INS, -4(TMP1) - | decode_RA8 RA, INS - | sub TMP1, BASE, RA - | lwz LFUNC:TMP1, FRAME_FUNC-8(TMP1) - | lwz TMP1, LFUNC:TMP1->pc - | lwz KBASE, PC2PROTO(k)(TMP1) // Need to prepare KBASE. - | b <4 - | - |7: // Tailcall from a vararg function. - | andi. TMP0, TMP2, FRAME_TYPEP - | bne <1 // Vararg frame below? - | sub BASE, BASE, TMP2 // Relocate BASE down. - | lwz TMP1, FRAME_PC(BASE) - | andi. TMP0, TMP1, FRAME_TYPE - | b <1 - break; - - case BC_ITERC: - | // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 ((2+1)*8)) - | subi RA, RA, 24 // evldd doesn't support neg. offsets. - | mr TMP2, BASE - | evlddx LFUNC:RB, BASE, RA - | add BASE, BASE, RA - | evldd TMP0, 8(BASE) - | evldd TMP1, 16(BASE) - | evstdd LFUNC:RB, 24(BASE) // Copy callable. - | checkfunc LFUNC:RB - | evstdd TMP0, 32(BASE) // Copy state. - | li NARGS8:RC, 16 // Iterators get 2 arguments. - | evstdd TMP1, 40(BASE) // Copy control var. - | addi BASE, BASE, 32 - | checkfail ->vmeta_call - | ins_call - break; - - case BC_ITERN: - | // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 (2+1)*8) - |.if JIT - | // NYI: add hotloop, record BC_ITERN. - |.endif - | add RA, BASE, RA - | lwz TAB:RB, -12(RA) - | lwz RC, -4(RA) // Get index from control var. - | lwz TMP0, TAB:RB->asize - | lwz TMP1, TAB:RB->array - | addi PC, PC, 4 - |1: // Traverse array part. - | cmplw RC, TMP0 - | slwi TMP3, RC, 3 - | bge >5 // Index points after array part? - | evlddx TMP2, TMP1, TMP3 - | checknil TMP2 - | lwz INS, -4(PC) - | checkok >4 - | efdcfsi TMP0, RC - | addi RC, RC, 1 - | addis TMP3, PC, -(BCBIAS_J*4 >> 16) - | evstdd TMP2, 8(RA) - | decode_RD4 TMP1, INS - | stw RC, -4(RA) // Update control var. - | add PC, TMP1, TMP3 - | evstdd TMP0, 0(RA) - |3: - | ins_next - | - |4: // Skip holes in array part. - | addi RC, RC, 1 - | b <1 - | - |5: // Traverse hash part. - | lwz TMP1, TAB:RB->hmask - | sub RC, RC, TMP0 - | lwz TMP2, TAB:RB->node - |6: - | cmplw RC, TMP1 // End of iteration? Branch to ITERL+1. - | slwi TMP3, RC, 5 - | bgt <3 - | slwi RB, RC, 3 - | sub TMP3, TMP3, RB - | evlddx RB, TMP2, TMP3 - | add NODE:TMP3, TMP2, TMP3 - | checknil RB - | lwz INS, -4(PC) - | checkok >7 - | evldd TMP3, NODE:TMP3->key - | addis TMP2, PC, -(BCBIAS_J*4 >> 16) - | evstdd RB, 8(RA) - | add RC, RC, TMP0 - | decode_RD4 TMP1, INS - | evstdd TMP3, 0(RA) - | addi RC, RC, 1 - | add PC, TMP1, TMP2 - | stw RC, -4(RA) // Update control var. - | b <3 - | - |7: // Skip holes in hash part. - | addi RC, RC, 1 - | b <6 - break; - - case BC_ISNEXT: - | // RA = base*8, RD = target (points to ITERN) - | add RA, BASE, RA - | li TMP2, -24 - | evlddx CFUNC:TMP1, RA, TMP2 - | lwz TMP2, -16(RA) - | lwz TMP3, -8(RA) - | evmergehi TMP0, CFUNC:TMP1, CFUNC:TMP1 - | cmpwi cr0, TMP2, LJ_TTAB - | cmpwi cr1, TMP0, LJ_TFUNC - | cmpwi cr6, TMP3, LJ_TNIL - | bne cr1, >5 - | lbz TMP1, CFUNC:TMP1->ffid - | crand 4*cr0+eq, 4*cr0+eq, 4*cr6+eq - | cmpwi cr7, TMP1, FF_next_N - | srwi TMP0, RD, 1 - | crand 4*cr0+eq, 4*cr0+eq, 4*cr7+eq - | add TMP3, PC, TMP0 - | bne cr0, >5 - | lus TMP1, 0xfffe - | ori TMP1, TMP1, 0x7fff - | stw ZERO, -4(RA) // Initialize control var. - | stw TMP1, -8(RA) - | addis PC, TMP3, -(BCBIAS_J*4 >> 16) - |1: - | ins_next - |5: // Despecialize bytecode if any of the checks fail. - | li TMP0, BC_JMP - | li TMP1, BC_ITERC - | stb TMP0, -1(PC) - | addis PC, TMP3, -(BCBIAS_J*4 >> 16) - | stb TMP1, 3(PC) - | b <1 - break; - - case BC_VARG: - | // RA = base*8, RB = (nresults+1)*8, RC = numparams*8 - | lwz TMP0, FRAME_PC(BASE) - | add RC, BASE, RC - | add RA, BASE, RA - | addi RC, RC, FRAME_VARG - | add TMP2, RA, RB - | subi TMP3, BASE, 8 // TMP3 = vtop - | sub RC, RC, TMP0 // RC = vbase - | // Note: RC may now be even _above_ BASE if nargs was < numparams. - | cmplwi cr1, RB, 0 - | sub. TMP1, TMP3, RC - | beq cr1, >5 // Copy all varargs? - | subi TMP2, TMP2, 16 - | ble >2 // No vararg slots? - |1: // Copy vararg slots to destination slots. - | evldd TMP0, 0(RC) - | addi RC, RC, 8 - | evstdd TMP0, 0(RA) - | cmplw RA, TMP2 - | cmplw cr1, RC, TMP3 - | bge >3 // All destination slots filled? - | addi RA, RA, 8 - | blt cr1, <1 // More vararg slots? - |2: // Fill up remainder with nil. - | evstdd TISNIL, 0(RA) - | cmplw RA, TMP2 - | addi RA, RA, 8 - | blt <2 - |3: - | ins_next - | - |5: // Copy all varargs. - | lwz TMP0, L->maxstack - | li MULTRES, 8 // MULTRES = (0+1)*8 - | ble <3 // No vararg slots? - | add TMP2, RA, TMP1 - | cmplw TMP2, TMP0 - | addi MULTRES, TMP1, 8 - | bgt >7 - |6: - | evldd TMP0, 0(RC) - | addi RC, RC, 8 - | evstdd TMP0, 0(RA) - | cmplw RC, TMP3 - | addi RA, RA, 8 - | blt <6 // More vararg slots? - | b <3 - | - |7: // Grow stack for varargs. - | mr CARG1, L - | stw RA, L->top - | sub SAVE0, RC, BASE // Need delta, because BASE may change. - | stw BASE, L->base - | sub RA, RA, BASE - | stw PC, SAVE_PC - | srwi CARG2, TMP1, 3 - | bl extern lj_state_growstack // (lua_State *L, int n) - | lwz BASE, L->base - | add RA, BASE, RA - | add RC, BASE, SAVE0 - | subi TMP3, BASE, 8 - | b <6 - break; - - /* -- Returns ----------------------------------------------------------- */ - - case BC_RETM: - | // RA = results*8, RD = extra_nresults*8 - | add RD, RD, MULTRES // MULTRES >= 8, so RD >= 8. - | // Fall through. Assumes BC_RET follows. - break; - - case BC_RET: - | // RA = results*8, RD = (nresults+1)*8 - | lwz PC, FRAME_PC(BASE) - | add RA, BASE, RA - | mr MULTRES, RD - |1: - | andi. TMP0, PC, FRAME_TYPE - | xori TMP1, PC, FRAME_VARG - | bne ->BC_RETV_Z - | - |->BC_RET_Z: - | // BASE = base, RA = resultptr, RD = (nresults+1)*8, PC = return - | lwz INS, -4(PC) - | cmpwi RD, 8 - | subi TMP2, BASE, 8 - | subi RC, RD, 8 - | decode_RB8 RB, INS - | beq >3 - | li TMP1, 0 - |2: - | addi TMP3, TMP1, 8 - | evlddx TMP0, RA, TMP1 - | cmpw TMP3, RC - | evstddx TMP0, TMP2, TMP1 - | beq >3 - | addi TMP1, TMP3, 8 - | evlddx TMP0, RA, TMP3 - | cmpw TMP1, RC - | evstddx TMP0, TMP2, TMP3 - | bne <2 - |3: - |5: - | cmplw RB, RD - | decode_RA8 RA, INS - | bgt >6 - | sub BASE, TMP2, RA - | lwz LFUNC:TMP1, FRAME_FUNC(BASE) - | ins_next1 - | lwz TMP1, LFUNC:TMP1->pc - | lwz KBASE, PC2PROTO(k)(TMP1) - | ins_next2 - | - |6: // Fill up results with nil. - | subi TMP1, RD, 8 - | addi RD, RD, 8 - | evstddx TISNIL, TMP2, TMP1 - | b <5 - | - |->BC_RETV_Z: // Non-standard return case. - | andi. TMP2, TMP1, FRAME_TYPEP - | bne ->vm_return - | // Return from vararg function: relocate BASE down. - | sub BASE, BASE, TMP1 - | lwz PC, FRAME_PC(BASE) - | b <1 - break; - - case BC_RET0: case BC_RET1: - | // RA = results*8, RD = (nresults+1)*8 - | lwz PC, FRAME_PC(BASE) - | add RA, BASE, RA - | mr MULTRES, RD - | andi. TMP0, PC, FRAME_TYPE - | xori TMP1, PC, FRAME_VARG - | bne ->BC_RETV_Z - | - | lwz INS, -4(PC) - | subi TMP2, BASE, 8 - | decode_RB8 RB, INS - if (op == BC_RET1) { - | evldd TMP0, 0(RA) - | evstdd TMP0, 0(TMP2) - } - |5: - | cmplw RB, RD - | decode_RA8 RA, INS - | bgt >6 - | sub BASE, TMP2, RA - | lwz LFUNC:TMP1, FRAME_FUNC(BASE) - | ins_next1 - | lwz TMP1, LFUNC:TMP1->pc - | lwz KBASE, PC2PROTO(k)(TMP1) - | ins_next2 - | - |6: // Fill up results with nil. - | subi TMP1, RD, 8 - | addi RD, RD, 8 - | evstddx TISNIL, TMP2, TMP1 - | b <5 - break; - - /* -- Loops and branches ------------------------------------------------ */ - - case BC_FORL: - |.if JIT - | hotloop - |.endif - | // Fall through. Assumes BC_IFORL follows. - break; - - case BC_JFORI: - case BC_JFORL: -#if !LJ_HASJIT - break; -#endif - case BC_FORI: - case BC_IFORL: - | // RA = base*8, RD = target (after end of loop or start of loop) - vk = (op == BC_IFORL || op == BC_JFORL); - | add RA, BASE, RA - | evldd TMP1, FORL_IDX*8(RA) - | evldd TMP3, FORL_STEP*8(RA) - | evldd TMP2, FORL_STOP*8(RA) - if (!vk) { - | evcmpgtu cr0, TMP1, TISNUM - | evcmpgtu cr7, TMP3, TISNUM - | evcmpgtu cr1, TMP2, TISNUM - | cror 4*cr0+lt, 4*cr0+lt, 4*cr7+lt - | cror 4*cr0+lt, 4*cr0+lt, 4*cr1+lt - | blt ->vmeta_for - } - if (vk) { - | efdadd TMP1, TMP1, TMP3 - | evstdd TMP1, FORL_IDX*8(RA) - } - | evcmpgts TMP3, TISNIL - | evstdd TMP1, FORL_EXT*8(RA) - | bge >2 - | efdcmpgt TMP1, TMP2 - |1: - if (op != BC_JFORL) { - | srwi RD, RD, 1 - | add RD, PC, RD - if (op == BC_JFORI) { - | addis PC, RD, -(BCBIAS_J*4 >> 16) - } else { - | addis RD, RD, -(BCBIAS_J*4 >> 16) - } - } - if (op == BC_FORI) { - | iselgt PC, RD, PC - } else if (op == BC_IFORL) { - | iselgt PC, PC, RD - } else { - | ble =>BC_JLOOP - } - | ins_next - |2: - | efdcmpgt TMP2, TMP1 - | b <1 - break; - - case BC_ITERL: - |.if JIT - | hotloop - |.endif - | // Fall through. Assumes BC_IITERL follows. - break; - - case BC_JITERL: -#if !LJ_HASJIT - break; -#endif - case BC_IITERL: - | // RA = base*8, RD = target - | evlddx TMP1, BASE, RA - | subi RA, RA, 8 - | checknil TMP1 - | checkok >1 // Stop if iterator returned nil. - if (op == BC_JITERL) { - | NYI - } else { - | branch_RD // Otherwise save control var + branch. - | evstddx TMP1, BASE, RA - } - |1: - | ins_next - break; - - case BC_LOOP: - | // RA = base*8, RD = target (loop extent) - | // Note: RA/RD is only used by trace recorder to determine scope/extent - | // This opcode does NOT jump, it's only purpose is to detect a hot loop. - |.if JIT - | hotloop - |.endif - | // Fall through. Assumes BC_ILOOP follows. - break; - - case BC_ILOOP: - | // RA = base*8, RD = target (loop extent) - | ins_next - break; - - case BC_JLOOP: - |.if JIT - | NYI - |.endif - break; - - case BC_JMP: - | // RA = base*8 (only used by trace recorder), RD = target - | branch_RD - | ins_next - break; - - /* -- Function headers -------------------------------------------------- */ - - case BC_FUNCF: - |.if JIT - | hotcall - |.endif - case BC_FUNCV: /* NYI: compiled vararg functions. */ - | // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow. - break; - - case BC_JFUNCF: -#if !LJ_HASJIT - break; -#endif - case BC_IFUNCF: - | // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8 - | lwz TMP2, L->maxstack - | lbz TMP1, -4+PC2PROTO(numparams)(PC) - | lwz KBASE, -4+PC2PROTO(k)(PC) - | cmplw RA, TMP2 - | slwi TMP1, TMP1, 3 - | bgt ->vm_growstack_l - | ins_next1 - |2: - | cmplw NARGS8:RC, TMP1 // Check for missing parameters. - | ble >3 - if (op == BC_JFUNCF) { - | NYI - } else { - | ins_next2 - } - | - |3: // Clear missing parameters. - | evstddx TISNIL, BASE, NARGS8:RC - | addi NARGS8:RC, NARGS8:RC, 8 - | b <2 - break; - - case BC_JFUNCV: -#if !LJ_HASJIT - break; -#endif - | NYI // NYI: compiled vararg functions - break; /* NYI: compiled vararg functions. */ - - case BC_IFUNCV: - | // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8 - | lwz TMP2, L->maxstack - | add TMP1, BASE, RC - | add TMP0, RA, RC - | stw LFUNC:RB, 4(TMP1) // Store copy of LFUNC. - | addi TMP3, RC, 8+FRAME_VARG - | lwz KBASE, -4+PC2PROTO(k)(PC) - | cmplw TMP0, TMP2 - | stw TMP3, 0(TMP1) // Store delta + FRAME_VARG. - | bge ->vm_growstack_l - | lbz TMP2, -4+PC2PROTO(numparams)(PC) - | mr RA, BASE - | mr RC, TMP1 - | ins_next1 - | cmpwi TMP2, 0 - | addi BASE, TMP1, 8 - | beq >3 - |1: - | cmplw RA, RC // Less args than parameters? - | evldd TMP0, 0(RA) - | bge >4 - | evstdd TISNIL, 0(RA) // Clear old fixarg slot (help the GC). - | addi RA, RA, 8 - |2: - | addic. TMP2, TMP2, -1 - | evstdd TMP0, 8(TMP1) - | addi TMP1, TMP1, 8 - | bne <1 - |3: - | ins_next2 - | - |4: // Clear missing parameters. - | evmr TMP0, TISNIL - | b <2 - break; - - case BC_FUNCC: - case BC_FUNCCW: - | // BASE = new base, RA = BASE+framesize*8, RB = CFUNC, RC = nargs*8 - if (op == BC_FUNCC) { - | lwz TMP3, CFUNC:RB->f - } else { - | lwz TMP3, DISPATCH_GL(wrapf)(DISPATCH) - } - | add TMP1, RA, NARGS8:RC - | lwz TMP2, L->maxstack - | add RC, BASE, NARGS8:RC - | stw BASE, L->base - | cmplw TMP1, TMP2 - | stw RC, L->top - | li_vmstate C - | mtctr TMP3 - if (op == BC_FUNCCW) { - | lwz CARG2, CFUNC:RB->f - } - | mr CARG1, L - | bgt ->vm_growstack_c // Need to grow stack. - | st_vmstate - | bctrl // (lua_State *L [, lua_CFunction f]) - | // Returns nresults. - | lwz TMP1, L->top - | slwi RD, CRET1, 3 - | lwz BASE, L->base - | li_vmstate INTERP - | lwz PC, FRAME_PC(BASE) // Fetch PC of caller. - | sub RA, TMP1, RD // RA = L->top - nresults*8 - | st_vmstate - | b ->vm_returnc - break; - - /* ---------------------------------------------------------------------- */ - - default: - fprintf(stderr, "Error: undefined opcode BC_%s\n", bc_names[op]); - exit(2); - break; - } -} - -static int build_backend(BuildCtx *ctx) -{ - int op; - - dasm_growpc(Dst, BC__MAX); - - build_subroutines(ctx); - - |.code_op - for (op = 0; op < BC__MAX; op++) - build_ins(ctx, (BCOp)op, op); - - return BC__MAX; -} - -/* Emit pseudo frame-info for all assembler functions. */ -static void emit_asm_debug(BuildCtx *ctx) -{ - int i; - switch (ctx->mode) { - case BUILD_elfasm: - fprintf(ctx->fp, "\t.section .debug_frame,\"\",@progbits\n"); - fprintf(ctx->fp, - ".Lframe0:\n" - "\t.long .LECIE0-.LSCIE0\n" - ".LSCIE0:\n" - "\t.long 0xffffffff\n" - "\t.byte 0x1\n" - "\t.string \"\"\n" - "\t.uleb128 0x1\n" - "\t.sleb128 -4\n" - "\t.byte 65\n" - "\t.byte 0xc\n\t.uleb128 1\n\t.uleb128 0\n" - "\t.align 2\n" - ".LECIE0:\n\n"); - fprintf(ctx->fp, - ".LSFDE0:\n" - "\t.long .LEFDE0-.LASFDE0\n" - ".LASFDE0:\n" - "\t.long .Lframe0\n" - "\t.long .Lbegin\n" - "\t.long %d\n" - "\t.byte 0xe\n\t.uleb128 %d\n" - "\t.byte 0x11\n\t.uleb128 65\n\t.sleb128 -1\n" - "\t.byte 0x5\n\t.uleb128 70\n\t.sleb128 37\n", - (int)ctx->codesz, CFRAME_SIZE); - for (i = 14; i <= 31; i++) - fprintf(ctx->fp, - "\t.byte %d\n\t.uleb128 %d\n" - "\t.byte 5\n\t.uleb128 %d\n\t.uleb128 %d\n", - 0x80+i, 1+2*(31-i), 1200+i, 2+2*(31-i)); - fprintf(ctx->fp, - "\t.align 2\n" - ".LEFDE0:\n\n"); - fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@progbits\n"); - fprintf(ctx->fp, - ".Lframe1:\n" - "\t.long .LECIE1-.LSCIE1\n" - ".LSCIE1:\n" - "\t.long 0\n" - "\t.byte 0x1\n" - "\t.string \"zPR\"\n" - "\t.uleb128 0x1\n" - "\t.sleb128 -4\n" - "\t.byte 65\n" - "\t.uleb128 6\n" /* augmentation length */ - "\t.byte 0x1b\n" /* pcrel|sdata4 */ - "\t.long lj_err_unwind_dwarf-.\n" - "\t.byte 0x1b\n" /* pcrel|sdata4 */ - "\t.byte 0xc\n\t.uleb128 1\n\t.uleb128 0\n" - "\t.align 2\n" - ".LECIE1:\n\n"); - fprintf(ctx->fp, - ".LSFDE1:\n" - "\t.long .LEFDE1-.LASFDE1\n" - ".LASFDE1:\n" - "\t.long .LASFDE1-.Lframe1\n" - "\t.long .Lbegin-.\n" - "\t.long %d\n" - "\t.uleb128 0\n" /* augmentation length */ - "\t.byte 0xe\n\t.uleb128 %d\n" - "\t.byte 0x11\n\t.uleb128 65\n\t.sleb128 -1\n" - "\t.byte 0x5\n\t.uleb128 70\n\t.sleb128 37\n", - (int)ctx->codesz, CFRAME_SIZE); - for (i = 14; i <= 31; i++) - fprintf(ctx->fp, - "\t.byte %d\n\t.uleb128 %d\n" - "\t.byte 5\n\t.uleb128 %d\n\t.uleb128 %d\n", - 0x80+i, 1+2*(31-i), 1200+i, 2+2*(31-i)); - fprintf(ctx->fp, - "\t.align 2\n" - ".LEFDE1:\n\n"); - break; - default: - break; - } -} - diff --git a/subprojects/luajit/src/vm_x86.dasc b/subprojects/luajit/src/vm_x86.dasc deleted file mode 100644 index 359ad4f4f..000000000 --- a/subprojects/luajit/src/vm_x86.dasc +++ /dev/null @@ -1,6401 +0,0 @@ -|// Low-level VM code for x86 CPUs. -|// Bytecode interpreter, fast functions and helper functions. -|// Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h -| -|.if P64 -|.arch x64 -|.else -|.arch x86 -|.endif -|.section code_op, code_sub -| -|.actionlist build_actionlist -|.globals GLOB_ -|.globalnames globnames -|.externnames extnames -| -|//----------------------------------------------------------------------- -| -|.if P64 -|.define X64, 1 -|.define SSE, 1 -|.if WIN -|.define X64WIN, 1 -|.endif -|.endif -| -|// Fixed register assignments for the interpreter. -|// This is very fragile and has many dependencies. Caveat emptor. -|.define BASE, edx // Not C callee-save, refetched anyway. -|.if not X64 -|.define KBASE, edi // Must be C callee-save. -|.define KBASEa, KBASE -|.define PC, esi // Must be C callee-save. -|.define PCa, PC -|.define DISPATCH, ebx // Must be C callee-save. -|.elif X64WIN -|.define KBASE, edi // Must be C callee-save. -|.define KBASEa, rdi -|.define PC, esi // Must be C callee-save. -|.define PCa, rsi -|.define DISPATCH, ebx // Must be C callee-save. -|.else -|.define KBASE, r15d // Must be C callee-save. -|.define KBASEa, r15 -|.define PC, ebx // Must be C callee-save. -|.define PCa, rbx -|.define DISPATCH, r14d // Must be C callee-save. -|.endif -| -|.define RA, ecx -|.define RAH, ch -|.define RAL, cl -|.define RB, ebp // Must be ebp (C callee-save). -|.define RC, eax // Must be eax. -|.define RCW, ax -|.define RCH, ah -|.define RCL, al -|.define OP, RB -|.define RD, RC -|.define RDW, RCW -|.define RDL, RCL -|.if X64 -|.define RAa, rcx -|.define RBa, rbp -|.define RCa, rax -|.define RDa, rax -|.else -|.define RAa, RA -|.define RBa, RB -|.define RCa, RC -|.define RDa, RD -|.endif -| -|.if not X64 -|.define FCARG1, ecx // x86 fastcall arguments. -|.define FCARG2, edx -|.elif X64WIN -|.define CARG1, rcx // x64/WIN64 C call arguments. -|.define CARG2, rdx -|.define CARG3, r8 -|.define CARG4, r9 -|.define CARG1d, ecx -|.define CARG2d, edx -|.define CARG3d, r8d -|.define CARG4d, r9d -|.define FCARG1, CARG1d // Upwards compatible to x86 fastcall. -|.define FCARG2, CARG2d -|.else -|.define CARG1, rdi // x64/POSIX C call arguments. -|.define CARG2, rsi -|.define CARG3, rdx -|.define CARG4, rcx -|.define CARG5, r8 -|.define CARG6, r9 -|.define CARG1d, edi -|.define CARG2d, esi -|.define CARG3d, edx -|.define CARG4d, ecx -|.define CARG5d, r8d -|.define CARG6d, r9d -|.define FCARG1, CARG1d // Simulate x86 fastcall. -|.define FCARG2, CARG2d -|.endif -| -|// Type definitions. Some of these are only used for documentation. -|.type L, lua_State -|.type GL, global_State -|.type TVALUE, TValue -|.type GCOBJ, GCobj -|.type STR, GCstr -|.type TAB, GCtab -|.type LFUNC, GCfuncL -|.type CFUNC, GCfuncC -|.type PROTO, GCproto -|.type UPVAL, GCupval -|.type NODE, Node -|.type NARGS, int -|.type TRACE, GCtrace -| -|// Stack layout while in interpreter. Must match with lj_frame.h. -|//----------------------------------------------------------------------- -|.if not X64 // x86 stack layout. -| -|.define CFRAME_SPACE, aword*7 // Delta for esp (see <--). -|.macro saveregs_ -| push edi; push esi; push ebx -| sub esp, CFRAME_SPACE -|.endmacro -|.macro saveregs -| push ebp; saveregs_ -|.endmacro -|.macro restoreregs -| add esp, CFRAME_SPACE -| pop ebx; pop esi; pop edi; pop ebp -|.endmacro -| -|.define SAVE_ERRF, aword [esp+aword*15] // vm_pcall/vm_cpcall only. -|.define SAVE_NRES, aword [esp+aword*14] -|.define SAVE_CFRAME, aword [esp+aword*13] -|.define SAVE_L, aword [esp+aword*12] -|//----- 16 byte aligned, ^^^ arguments from C caller -|.define SAVE_RET, aword [esp+aword*11] //<-- esp entering interpreter. -|.define SAVE_R4, aword [esp+aword*10] -|.define SAVE_R3, aword [esp+aword*9] -|.define SAVE_R2, aword [esp+aword*8] -|//----- 16 byte aligned -|.define SAVE_R1, aword [esp+aword*7] //<-- esp after register saves. -|.define SAVE_PC, aword [esp+aword*6] -|.define TMP2, aword [esp+aword*5] -|.define TMP1, aword [esp+aword*4] -|//----- 16 byte aligned -|.define ARG4, aword [esp+aword*3] -|.define ARG3, aword [esp+aword*2] -|.define ARG2, aword [esp+aword*1] -|.define ARG1, aword [esp] //<-- esp while in interpreter. -|//----- 16 byte aligned, ^^^ arguments for C callee -| -|// FPARGx overlaps ARGx and ARG(x+1) on x86. -|.define FPARG3, qword [esp+qword*1] -|.define FPARG1, qword [esp] -|// TMPQ overlaps TMP1/TMP2. ARG5/MULTRES overlap TMP1/TMP2 (and TMPQ). -|.define TMPQ, qword [esp+aword*4] -|.define TMP3, ARG4 -|.define ARG5, TMP1 -|.define TMPa, TMP1 -|.define MULTRES, TMP2 -| -|// Arguments for vm_call and vm_pcall. -|.define INARG_BASE, SAVE_CFRAME // Overwritten by SAVE_CFRAME! -| -|// Arguments for vm_cpcall. -|.define INARG_CP_CALL, SAVE_ERRF -|.define INARG_CP_UD, SAVE_NRES -|.define INARG_CP_FUNC, SAVE_CFRAME -| -|//----------------------------------------------------------------------- -|.elif X64WIN // x64/Windows stack layout -| -|.define CFRAME_SPACE, aword*5 // Delta for rsp (see <--). -|.macro saveregs_ -| push rdi; push rsi; push rbx -| sub rsp, CFRAME_SPACE -|.endmacro -|.macro saveregs -| push rbp; saveregs_ -|.endmacro -|.macro restoreregs -| add rsp, CFRAME_SPACE -| pop rbx; pop rsi; pop rdi; pop rbp -|.endmacro -| -|.define SAVE_CFRAME, aword [rsp+aword*13] -|.define SAVE_PC, dword [rsp+dword*25] -|.define SAVE_L, dword [rsp+dword*24] -|.define SAVE_ERRF, dword [rsp+dword*23] -|.define SAVE_NRES, dword [rsp+dword*22] -|.define TMP2, dword [rsp+dword*21] -|.define TMP1, dword [rsp+dword*20] -|//----- 16 byte aligned, ^^^ 32 byte register save area, owned by interpreter -|.define SAVE_RET, aword [rsp+aword*9] //<-- rsp entering interpreter. -|.define SAVE_R4, aword [rsp+aword*8] -|.define SAVE_R3, aword [rsp+aword*7] -|.define SAVE_R2, aword [rsp+aword*6] -|.define SAVE_R1, aword [rsp+aword*5] //<-- rsp after register saves. -|.define ARG5, aword [rsp+aword*4] -|.define CSAVE_4, aword [rsp+aword*3] -|.define CSAVE_3, aword [rsp+aword*2] -|.define CSAVE_2, aword [rsp+aword*1] -|.define CSAVE_1, aword [rsp] //<-- rsp while in interpreter. -|//----- 16 byte aligned, ^^^ 32 byte register save area, owned by callee -| -|// TMPQ overlaps TMP1/TMP2. MULTRES overlaps TMP2 (and TMPQ). -|.define TMPQ, qword [rsp+aword*10] -|.define MULTRES, TMP2 -|.define TMPa, ARG5 -|.define ARG5d, dword [rsp+aword*4] -|.define TMP3, ARG5d -| -|//----------------------------------------------------------------------- -|.else // x64/POSIX stack layout -| -|.define CFRAME_SPACE, aword*5 // Delta for rsp (see <--). -|.macro saveregs_ -| push rbx; push r15; push r14 -|.if NO_UNWIND -| push r13; push r12 -|.endif -| sub rsp, CFRAME_SPACE -|.endmacro -|.macro saveregs -| push rbp; saveregs_ -|.endmacro -|.macro restoreregs -| add rsp, CFRAME_SPACE -|.if NO_UNWIND -| pop r12; pop r13 -|.endif -| pop r14; pop r15; pop rbx; pop rbp -|.endmacro -| -|//----- 16 byte aligned, -|.if NO_UNWIND -|.define SAVE_RET, aword [rsp+aword*11] //<-- rsp entering interpreter. -|.define SAVE_R4, aword [rsp+aword*10] -|.define SAVE_R3, aword [rsp+aword*9] -|.define SAVE_R2, aword [rsp+aword*8] -|.define SAVE_R1, aword [rsp+aword*7] -|.define SAVE_RU2, aword [rsp+aword*6] -|.define SAVE_RU1, aword [rsp+aword*5] //<-- rsp after register saves. -|.else -|.define SAVE_RET, aword [rsp+aword*9] //<-- rsp entering interpreter. -|.define SAVE_R4, aword [rsp+aword*8] -|.define SAVE_R3, aword [rsp+aword*7] -|.define SAVE_R2, aword [rsp+aword*6] -|.define SAVE_R1, aword [rsp+aword*5] //<-- rsp after register saves. -|.endif -|.define SAVE_CFRAME, aword [rsp+aword*4] -|.define SAVE_PC, dword [rsp+dword*7] -|.define SAVE_L, dword [rsp+dword*6] -|.define SAVE_ERRF, dword [rsp+dword*5] -|.define SAVE_NRES, dword [rsp+dword*4] -|.define TMPa, aword [rsp+aword*1] -|.define TMP2, dword [rsp+dword*1] -|.define TMP1, dword [rsp] //<-- rsp while in interpreter. -|//----- 16 byte aligned -| -|// TMPQ overlaps TMP1/TMP2. MULTRES overlaps TMP2 (and TMPQ). -|.define TMPQ, qword [rsp] -|.define TMP3, dword [rsp+aword*1] -|.define MULTRES, TMP2 -| -|.endif -| -|//----------------------------------------------------------------------- -| -|// Instruction headers. -|.macro ins_A; .endmacro -|.macro ins_AD; .endmacro -|.macro ins_AJ; .endmacro -|.macro ins_ABC; movzx RB, RCH; movzx RC, RCL; .endmacro -|.macro ins_AB_; movzx RB, RCH; .endmacro -|.macro ins_A_C; movzx RC, RCL; .endmacro -|.macro ins_AND; not RDa; .endmacro -| -|// Instruction decode+dispatch. Carefully tuned (nope, lodsd is not faster). -|.macro ins_NEXT -| mov RC, [PC] -| movzx RA, RCH -| movzx OP, RCL -| add PC, 4 -| shr RC, 16 -|.if X64 -| jmp aword [DISPATCH+OP*8] -|.else -| jmp aword [DISPATCH+OP*4] -|.endif -|.endmacro -| -|// Instruction footer. -|.if 1 -| // Replicated dispatch. Less unpredictable branches, but higher I-Cache use. -| .define ins_next, ins_NEXT -| .define ins_next_, ins_NEXT -|.else -| // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch. -| // Affects only certain kinds of benchmarks (and only with -j off). -| // Around 10%-30% slower on Core2, a lot more slower on P4. -| .macro ins_next -| jmp ->ins_next -| .endmacro -| .macro ins_next_ -| ->ins_next: -| ins_NEXT -| .endmacro -|.endif -| -|// Call decode and dispatch. -|.macro ins_callt -| // BASE = new base, RB = LFUNC, RD = nargs+1, [BASE-4] = PC -| mov PC, LFUNC:RB->pc -| mov RA, [PC] -| movzx OP, RAL -| movzx RA, RAH -| add PC, 4 -|.if X64 -| jmp aword [DISPATCH+OP*8] -|.else -| jmp aword [DISPATCH+OP*4] -|.endif -|.endmacro -| -|.macro ins_call -| // BASE = new base, RB = LFUNC, RD = nargs+1 -| mov [BASE-4], PC -| ins_callt -|.endmacro -| -|//----------------------------------------------------------------------- -| -|// Macros to test operand types. -|.macro checktp, reg, tp; cmp dword [BASE+reg*8+4], tp; .endmacro -|.macro checknum, reg, target; checktp reg, LJ_TISNUM; jae target; .endmacro -|.macro checkint, reg, target; checktp reg, LJ_TISNUM; jne target; .endmacro -|.macro checkstr, reg, target; checktp reg, LJ_TSTR; jne target; .endmacro -|.macro checktab, reg, target; checktp reg, LJ_TTAB; jne target; .endmacro -| -|// These operands must be used with movzx. -|.define PC_OP, byte [PC-4] -|.define PC_RA, byte [PC-3] -|.define PC_RB, byte [PC-1] -|.define PC_RC, byte [PC-2] -|.define PC_RD, word [PC-2] -| -|.macro branchPC, reg -| lea PC, [PC+reg*4-BCBIAS_J*4] -|.endmacro -| -|// Assumes DISPATCH is relative to GL. -#define DISPATCH_GL(field) (GG_DISP2G + (int)offsetof(global_State, field)) -#define DISPATCH_J(field) (GG_DISP2J + (int)offsetof(jit_State, field)) -| -#define PC2PROTO(field) ((int)offsetof(GCproto, field)-(int)sizeof(GCproto)) -| -|// Decrement hashed hotcount and trigger trace recorder if zero. -|.macro hotloop, reg -| mov reg, PC -| shr reg, 1 -| and reg, HOTCOUNT_PCMASK -| sub word [DISPATCH+reg+GG_DISP2HOT], HOTCOUNT_LOOP -| jb ->vm_hotloop -|.endmacro -| -|.macro hotcall, reg -| mov reg, PC -| shr reg, 1 -| and reg, HOTCOUNT_PCMASK -| sub word [DISPATCH+reg+GG_DISP2HOT], HOTCOUNT_CALL -| jb ->vm_hotcall -|.endmacro -| -|// Set current VM state. -|.macro set_vmstate, st -| mov dword [DISPATCH+DISPATCH_GL(vmstate)], ~LJ_VMST_..st -|.endmacro -| -|// x87 compares. -|.macro fcomparepp // Compare and pop st0 >< st1. -| fucomip st1 -| fpop -|.endmacro -| -|.macro fdup; fld st0; .endmacro -|.macro fpop1; fstp st1; .endmacro -| -|// Synthesize SSE FP constants. -|.macro sseconst_abs, reg, tmp // Synthesize abs mask. -|.if X64 -| mov64 tmp, U64x(7fffffff,ffffffff); movd reg, tmp -|.else -| pxor reg, reg; pcmpeqd reg, reg; psrlq reg, 1 -|.endif -|.endmacro -| -|.macro sseconst_hi, reg, tmp, val // Synthesize hi-32 bit const. -|.if X64 -| mov64 tmp, U64x(val,00000000); movd reg, tmp -|.else -| mov tmp, 0x .. val; movd reg, tmp; pshufd reg, reg, 0x51 -|.endif -|.endmacro -| -|.macro sseconst_sign, reg, tmp // Synthesize sign mask. -| sseconst_hi reg, tmp, 80000000 -|.endmacro -|.macro sseconst_1, reg, tmp // Synthesize 1.0. -| sseconst_hi reg, tmp, 3ff00000 -|.endmacro -|.macro sseconst_m1, reg, tmp // Synthesize -1.0. -| sseconst_hi reg, tmp, bff00000 -|.endmacro -|.macro sseconst_2p52, reg, tmp // Synthesize 2^52. -| sseconst_hi reg, tmp, 43300000 -|.endmacro -|.macro sseconst_tobit, reg, tmp // Synthesize 2^52 + 2^51. -| sseconst_hi reg, tmp, 43380000 -|.endmacro -| -|// Move table write barrier back. Overwrites reg. -|.macro barrierback, tab, reg -| and byte tab->marked, (uint8_t)~LJ_GC_BLACK // black2gray(tab) -| mov reg, [DISPATCH+DISPATCH_GL(gc.grayagain)] -| mov [DISPATCH+DISPATCH_GL(gc.grayagain)], tab -| mov tab->gclist, reg -|.endmacro -| -|//----------------------------------------------------------------------- - -/* Generate subroutines used by opcodes and other parts of the VM. */ -/* The .code_sub section should be last to help static branch prediction. */ -static void build_subroutines(BuildCtx *ctx) -{ - |.code_sub - | - |//----------------------------------------------------------------------- - |//-- Return handling ---------------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_returnp: - | test PC, FRAME_P - | jz ->cont_dispatch - | - | // Return from pcall or xpcall fast func. - | and PC, -8 - | sub BASE, PC // Restore caller base. - | lea RAa, [RA+PC-8] // Rebase RA and prepend one result. - | mov PC, [BASE-4] // Fetch PC of previous frame. - | // Prepending may overwrite the pcall frame, so do it at the end. - | mov dword [BASE+RA+4], LJ_TTRUE // Prepend true to results. - | - |->vm_returnc: - | add RD, 1 // RD = nresults+1 - | jz ->vm_unwind_yield - | mov MULTRES, RD - | test PC, FRAME_TYPE - | jz ->BC_RET_Z // Handle regular return to Lua. - | - |->vm_return: - | // BASE = base, RA = resultofs, RD = nresults+1 (= MULTRES), PC = return - | xor PC, FRAME_C - | test PC, FRAME_TYPE - | jnz ->vm_returnp - | - | // Return to C. - | set_vmstate C - | and PC, -8 - | sub PC, BASE - | neg PC // Previous base = BASE - delta. - | - | sub RD, 1 - | jz >2 - |1: // Move results down. - |.if X64 - | mov RBa, [BASE+RA] - | mov [BASE-8], RBa - |.else - | mov RB, [BASE+RA] - | mov [BASE-8], RB - | mov RB, [BASE+RA+4] - | mov [BASE-4], RB - |.endif - | add BASE, 8 - | sub RD, 1 - | jnz <1 - |2: - | mov L:RB, SAVE_L - | mov L:RB->base, PC - |3: - | mov RD, MULTRES - | mov RA, SAVE_NRES // RA = wanted nresults+1 - |4: - | cmp RA, RD - | jne >6 // More/less results wanted? - |5: - | sub BASE, 8 - | mov L:RB->top, BASE - | - |->vm_leave_cp: - | mov RAa, SAVE_CFRAME // Restore previous C frame. - | mov L:RB->cframe, RAa - | xor eax, eax // Ok return status for vm_pcall. - | - |->vm_leave_unw: - | restoreregs - | ret - | - |6: - | jb >7 // Less results wanted? - | // More results wanted. Check stack size and fill up results with nil. - | cmp BASE, L:RB->maxstack - | ja >8 - | mov dword [BASE-4], LJ_TNIL - | add BASE, 8 - | add RD, 1 - | jmp <4 - | - |7: // Less results wanted. - | test RA, RA - | jz <5 // But check for LUA_MULTRET+1. - | sub RA, RD // Negative result! - | lea BASE, [BASE+RA*8] // Correct top. - | jmp <5 - | - |8: // Corner case: need to grow stack for filling up results. - | // This can happen if: - | // - A C function grows the stack (a lot). - | // - The GC shrinks the stack in between. - | // - A return back from a lua_call() with (high) nresults adjustment. - | mov L:RB->top, BASE // Save current top held in BASE (yes). - | mov MULTRES, RD // Need to fill only remainder with nil. - | mov FCARG2, RA - | mov FCARG1, L:RB - | call extern lj_state_growstack@8 // (lua_State *L, int n) - | mov BASE, L:RB->top // Need the (realloced) L->top in BASE. - | jmp <3 - | - |->vm_unwind_yield: - | mov al, LUA_YIELD - | jmp ->vm_unwind_c_eh - | - |->vm_unwind_c@8: // Unwind C stack, return from vm_pcall. - | // (void *cframe, int errcode) - |.if X64 - | mov eax, CARG2d // Error return status for vm_pcall. - | mov rsp, CARG1 - |.else - | mov eax, FCARG2 // Error return status for vm_pcall. - | mov esp, FCARG1 - |.endif - |->vm_unwind_c_eh: // Landing pad for external unwinder. - | mov L:RB, SAVE_L - | mov GL:RB, L:RB->glref - | mov dword GL:RB->vmstate, ~LJ_VMST_C - | jmp ->vm_leave_unw - | - |->vm_unwind_rethrow: - |.if X64 and not X64WIN - | mov FCARG1, SAVE_L - | mov FCARG2, eax - | restoreregs - | jmp extern lj_err_throw@8 // (lua_State *L, int errcode) - |.endif - | - |->vm_unwind_ff@4: // Unwind C stack, return from ff pcall. - | // (void *cframe) - |.if X64 - | and CARG1, CFRAME_RAWMASK - | mov rsp, CARG1 - |.else - | and FCARG1, CFRAME_RAWMASK - | mov esp, FCARG1 - |.endif - |->vm_unwind_ff_eh: // Landing pad for external unwinder. - | mov L:RB, SAVE_L - | mov RAa, -8 // Results start at BASE+RA = BASE-8. - | mov RD, 1+1 // Really 1+2 results, incr. later. - | mov BASE, L:RB->base - | mov DISPATCH, L:RB->glref // Setup pointer to dispatch table. - | add DISPATCH, GG_G2DISP - | mov PC, [BASE-4] // Fetch PC of previous frame. - | mov dword [BASE-4], LJ_TFALSE // Prepend false to error message. - | set_vmstate INTERP - | jmp ->vm_returnc // Increments RD/MULTRES and returns. - | - |//----------------------------------------------------------------------- - |//-- Grow stack for calls ----------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_growstack_c: // Grow stack for C function. - | mov FCARG2, LUA_MINSTACK - | jmp >2 - | - |->vm_growstack_v: // Grow stack for vararg Lua function. - | sub RD, 8 - | jmp >1 - | - |->vm_growstack_f: // Grow stack for fixarg Lua function. - | // BASE = new base, RD = nargs+1, RB = L, PC = first PC - | lea RD, [BASE+NARGS:RD*8-8] - |1: - | movzx RA, byte [PC-4+PC2PROTO(framesize)] - | add PC, 4 // Must point after first instruction. - | mov L:RB->base, BASE - | mov L:RB->top, RD - | mov SAVE_PC, PC - | mov FCARG2, RA - |2: - | // RB = L, L->base = new base, L->top = top - | mov FCARG1, L:RB - | call extern lj_state_growstack@8 // (lua_State *L, int n) - | mov BASE, L:RB->base - | mov RD, L:RB->top - | mov LFUNC:RB, [BASE-8] - | sub RD, BASE - | shr RD, 3 - | add NARGS:RD, 1 - | // BASE = new base, RB = LFUNC, RD = nargs+1 - | ins_callt // Just retry the call. - | - |//----------------------------------------------------------------------- - |//-- Entry points into the assembler VM --------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_resume: // Setup C frame and resume thread. - | // (lua_State *L, TValue *base, int nres1 = 0, ptrdiff_t ef = 0) - | saveregs - |.if X64 - | mov L:RB, CARG1d // Caveat: CARG1d may be RA. - | mov SAVE_L, CARG1d - | mov RA, CARG2d - |.else - | mov L:RB, SAVE_L - | mov RA, INARG_BASE // Caveat: overlaps SAVE_CFRAME! - |.endif - | mov PC, FRAME_CP - | xor RD, RD - | lea KBASEa, [esp+CFRAME_RESUME] - | mov DISPATCH, L:RB->glref // Setup pointer to dispatch table. - | add DISPATCH, GG_G2DISP - | mov L:RB->cframe, KBASEa - | mov SAVE_PC, RD // Any value outside of bytecode is ok. - | mov SAVE_CFRAME, RDa - |.if X64 - | mov SAVE_NRES, RD - | mov SAVE_ERRF, RD - |.endif - | cmp byte L:RB->status, RDL - | je >3 // Initial resume (like a call). - | - | // Resume after yield (like a return). - | set_vmstate INTERP - | mov byte L:RB->status, RDL - | mov BASE, L:RB->base - | mov RD, L:RB->top - | sub RD, RA - | shr RD, 3 - | add RD, 1 // RD = nresults+1 - | sub RA, BASE // RA = resultofs - | mov PC, [BASE-4] - | mov MULTRES, RD - | test PC, FRAME_TYPE - | jz ->BC_RET_Z - | jmp ->vm_return - | - |->vm_pcall: // Setup protected C frame and enter VM. - | // (lua_State *L, TValue *base, int nres1, ptrdiff_t ef) - | saveregs - | mov PC, FRAME_CP - |.if X64 - | mov SAVE_ERRF, CARG4d - |.endif - | jmp >1 - | - |->vm_call: // Setup C frame and enter VM. - | // (lua_State *L, TValue *base, int nres1) - | saveregs - | mov PC, FRAME_C - | - |1: // Entry point for vm_pcall above (PC = ftype). - |.if X64 - | mov SAVE_NRES, CARG3d - | mov L:RB, CARG1d // Caveat: CARG1d may be RA. - | mov SAVE_L, CARG1d - | mov RA, CARG2d - |.else - | mov L:RB, SAVE_L - | mov RA, INARG_BASE // Caveat: overlaps SAVE_CFRAME! - |.endif - | - | mov KBASEa, L:RB->cframe // Add our C frame to cframe chain. - | mov SAVE_CFRAME, KBASEa - | mov SAVE_PC, L:RB // Any value outside of bytecode is ok. - |.if X64 - | mov L:RB->cframe, rsp - |.else - | mov L:RB->cframe, esp - |.endif - | - |2: // Entry point for vm_cpcall below (RA = base, RB = L, PC = ftype). - | mov DISPATCH, L:RB->glref // Setup pointer to dispatch table. - | add DISPATCH, GG_G2DISP - | - |3: // Entry point for vm_resume above (RA = base, RB = L, PC = ftype). - | set_vmstate INTERP - | mov BASE, L:RB->base // BASE = old base (used in vmeta_call). - | add PC, RA - | sub PC, BASE // PC = frame delta + frame type - | - | mov RD, L:RB->top - | sub RD, RA - | shr NARGS:RD, 3 - | add NARGS:RD, 1 // RD = nargs+1 - | - |->vm_call_dispatch: - | mov LFUNC:RB, [RA-8] - | cmp dword [RA-4], LJ_TFUNC - | jne ->vmeta_call // Ensure KBASE defined and != BASE. - | - |->vm_call_dispatch_f: - | mov BASE, RA - | ins_call - | // BASE = new base, RB = func, RD = nargs+1, PC = caller PC - | - |->vm_cpcall: // Setup protected C frame, call C. - | // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp) - | saveregs - |.if X64 - | mov L:RB, CARG1d // Caveat: CARG1d may be RA. - | mov SAVE_L, CARG1d - |.else - | mov L:RB, SAVE_L - | // Caveat: INARG_CP_* and SAVE_CFRAME/SAVE_NRES/SAVE_ERRF overlap! - | mov RC, INARG_CP_UD // Get args before they are overwritten. - | mov RA, INARG_CP_FUNC - | mov BASE, INARG_CP_CALL - |.endif - | mov SAVE_PC, L:RB // Any value outside of bytecode is ok. - | - | mov KBASE, L:RB->stack // Compute -savestack(L, L->top). - | sub KBASE, L:RB->top - | mov SAVE_ERRF, 0 // No error function. - | mov SAVE_NRES, KBASE // Neg. delta means cframe w/o frame. - | // Handler may change cframe_nres(L->cframe) or cframe_errfunc(L->cframe). - | - |.if X64 - | mov KBASEa, L:RB->cframe // Add our C frame to cframe chain. - | mov SAVE_CFRAME, KBASEa - | mov L:RB->cframe, rsp - | - | call CARG4 // (lua_State *L, lua_CFunction func, void *ud) - |.else - | mov ARG3, RC // Have to copy args downwards. - | mov ARG2, RA - | mov ARG1, L:RB - | - | mov KBASE, L:RB->cframe // Add our C frame to cframe chain. - | mov SAVE_CFRAME, KBASE - | mov L:RB->cframe, esp - | - | call BASE // (lua_State *L, lua_CFunction func, void *ud) - |.endif - | // TValue * (new base) or NULL returned in eax (RC). - | test RC, RC - | jz ->vm_leave_cp // No base? Just remove C frame. - | mov RA, RC - | mov PC, FRAME_CP - | jmp <2 // Else continue with the call. - | - |//----------------------------------------------------------------------- - |//-- Metamethod handling ------------------------------------------------ - |//----------------------------------------------------------------------- - | - |//-- Continuation dispatch ---------------------------------------------- - | - |->cont_dispatch: - | // BASE = meta base, RA = resultofs, RD = nresults+1 (also in MULTRES) - | add RA, BASE - | and PC, -8 - | mov RB, BASE - | sub BASE, PC // Restore caller BASE. - | mov dword [RA+RD*8-4], LJ_TNIL // Ensure one valid arg. - | mov RC, RA // ... in [RC] - | mov PC, [RB-12] // Restore PC from [cont|PC]. - |.if X64 - | movsxd RAa, dword [RB-16] // May be negative on WIN64 with debug. - |.if FFI - | cmp RA, 1 - | jbe >1 - |.endif - | lea KBASEa, qword [=>0] - | add RAa, KBASEa - |.else - | mov RA, dword [RB-16] - |.if FFI - | cmp RA, 1 - | jbe >1 - |.endif - |.endif - | mov LFUNC:KBASE, [BASE-8] - | mov KBASE, LFUNC:KBASE->pc - | mov KBASE, [KBASE+PC2PROTO(k)] - | // BASE = base, RC = result, RB = meta base - | jmp RAa // Jump to continuation. - | - |.if FFI - |1: - | je ->cont_ffi_callback // cont = 1: return from FFI callback. - | // cont = 0: Tail call from C function. - | sub RB, BASE - | shr RB, 3 - | lea RD, [RB-1] - | jmp ->vm_call_tail - |.endif - | - |->cont_cat: // BASE = base, RC = result, RB = mbase - | movzx RA, PC_RB - | sub RB, 16 - | lea RA, [BASE+RA*8] - | sub RA, RB - | je ->cont_ra - | neg RA - | shr RA, 3 - |.if X64WIN - | mov CARG3d, RA - | mov L:CARG1d, SAVE_L - | mov L:CARG1d->base, BASE - | mov RCa, [RC] - | mov [RB], RCa - | mov CARG2d, RB - |.elif X64 - | mov L:CARG1d, SAVE_L - | mov L:CARG1d->base, BASE - | mov CARG3d, RA - | mov RAa, [RC] - | mov [RB], RAa - | mov CARG2d, RB - |.else - | mov ARG3, RA - | mov RA, [RC+4] - | mov RC, [RC] - | mov [RB+4], RA - | mov [RB], RC - | mov ARG2, RB - |.endif - | jmp ->BC_CAT_Z - | - |//-- Table indexing metamethods ----------------------------------------- - | - |->vmeta_tgets: - | mov TMP1, RC // RC = GCstr * - | mov TMP2, LJ_TSTR - | lea RCa, TMP1 // Store temp. TValue in TMP1/TMP2. - | cmp PC_OP, BC_GGET - | jne >1 - | lea RA, [DISPATCH+DISPATCH_GL(tmptv)] // Store fn->l.env in g->tmptv. - | mov [RA], TAB:RB // RB = GCtab * - | mov dword [RA+4], LJ_TTAB - | mov RB, RA - | jmp >2 - | - |->vmeta_tgetb: - | movzx RC, PC_RC - |.if DUALNUM - | mov TMP2, LJ_TISNUM - | mov TMP1, RC - |.elif SSE - | cvtsi2sd xmm0, RC - | movsd TMPQ, xmm0 - |.else - | mov ARG4, RC - | fild ARG4 - | fstp TMPQ - |.endif - | lea RCa, TMPQ // Store temp. TValue in TMPQ. - | jmp >1 - | - |->vmeta_tgetv: - | movzx RC, PC_RC // Reload TValue *k from RC. - | lea RC, [BASE+RC*8] - |1: - | movzx RB, PC_RB // Reload TValue *t from RB. - | lea RB, [BASE+RB*8] - |2: - |.if X64 - | mov L:CARG1d, SAVE_L - | mov L:CARG1d->base, BASE // Caveat: CARG2d/CARG3d may be BASE. - | mov CARG2d, RB - | mov CARG3, RCa // May be 64 bit ptr to stack. - | mov L:RB, L:CARG1d - |.else - | mov ARG2, RB - | mov L:RB, SAVE_L - | mov ARG3, RC - | mov ARG1, L:RB - | mov L:RB->base, BASE - |.endif - | mov SAVE_PC, PC - | call extern lj_meta_tget // (lua_State *L, TValue *o, TValue *k) - | // TValue * (finished) or NULL (metamethod) returned in eax (RC). - | mov BASE, L:RB->base - | test RC, RC - | jz >3 - |->cont_ra: // BASE = base, RC = result - | movzx RA, PC_RA - |.if X64 - | mov RBa, [RC] - | mov [BASE+RA*8], RBa - |.else - | mov RB, [RC+4] - | mov RC, [RC] - | mov [BASE+RA*8+4], RB - | mov [BASE+RA*8], RC - |.endif - | ins_next - | - |3: // Call __index metamethod. - | // BASE = base, L->top = new base, stack = cont/func/t/k - | mov RA, L:RB->top - | mov [RA-12], PC // [cont|PC] - | lea PC, [RA+FRAME_CONT] - | sub PC, BASE - | mov LFUNC:RB, [RA-8] // Guaranteed to be a function here. - | mov NARGS:RD, 2+1 // 2 args for func(t, k). - | jmp ->vm_call_dispatch_f - | - |//----------------------------------------------------------------------- - | - |->vmeta_tsets: - | mov TMP1, RC // RC = GCstr * - | mov TMP2, LJ_TSTR - | lea RCa, TMP1 // Store temp. TValue in TMP1/TMP2. - | cmp PC_OP, BC_GSET - | jne >1 - | lea RA, [DISPATCH+DISPATCH_GL(tmptv)] // Store fn->l.env in g->tmptv. - | mov [RA], TAB:RB // RB = GCtab * - | mov dword [RA+4], LJ_TTAB - | mov RB, RA - | jmp >2 - | - |->vmeta_tsetb: - | movzx RC, PC_RC - |.if DUALNUM - | mov TMP2, LJ_TISNUM - | mov TMP1, RC - |.elif SSE - | cvtsi2sd xmm0, RC - | movsd TMPQ, xmm0 - |.else - | mov ARG4, RC - | fild ARG4 - | fstp TMPQ - |.endif - | lea RCa, TMPQ // Store temp. TValue in TMPQ. - | jmp >1 - | - |->vmeta_tsetv: - | movzx RC, PC_RC // Reload TValue *k from RC. - | lea RC, [BASE+RC*8] - |1: - | movzx RB, PC_RB // Reload TValue *t from RB. - | lea RB, [BASE+RB*8] - |2: - |.if X64 - | mov L:CARG1d, SAVE_L - | mov L:CARG1d->base, BASE // Caveat: CARG2d/CARG3d may be BASE. - | mov CARG2d, RB - | mov CARG3, RCa // May be 64 bit ptr to stack. - | mov L:RB, L:CARG1d - |.else - | mov ARG2, RB - | mov L:RB, SAVE_L - | mov ARG3, RC - | mov ARG1, L:RB - | mov L:RB->base, BASE - |.endif - | mov SAVE_PC, PC - | call extern lj_meta_tset // (lua_State *L, TValue *o, TValue *k) - | // TValue * (finished) or NULL (metamethod) returned in eax (RC). - | mov BASE, L:RB->base - | test RC, RC - | jz >3 - | // NOBARRIER: lj_meta_tset ensures the table is not black. - | movzx RA, PC_RA - |.if X64 - | mov RBa, [BASE+RA*8] - | mov [RC], RBa - |.else - | mov RB, [BASE+RA*8+4] - | mov RA, [BASE+RA*8] - | mov [RC+4], RB - | mov [RC], RA - |.endif - |->cont_nop: // BASE = base, (RC = result) - | ins_next - | - |3: // Call __newindex metamethod. - | // BASE = base, L->top = new base, stack = cont/func/t/k/(v) - | mov RA, L:RB->top - | mov [RA-12], PC // [cont|PC] - | movzx RC, PC_RA - | // Copy value to third argument. - |.if X64 - | mov RBa, [BASE+RC*8] - | mov [RA+16], RBa - |.else - | mov RB, [BASE+RC*8+4] - | mov RC, [BASE+RC*8] - | mov [RA+20], RB - | mov [RA+16], RC - |.endif - | lea PC, [RA+FRAME_CONT] - | sub PC, BASE - | mov LFUNC:RB, [RA-8] // Guaranteed to be a function here. - | mov NARGS:RD, 3+1 // 3 args for func(t, k, v). - | jmp ->vm_call_dispatch_f - | - |//-- Comparison metamethods --------------------------------------------- - | - |->vmeta_comp: - |.if X64 - | mov L:RB, SAVE_L - | mov L:RB->base, BASE // Caveat: CARG2d/CARG3d == BASE. - |.if X64WIN - | lea CARG3d, [BASE+RD*8] - | lea CARG2d, [BASE+RA*8] - |.else - | lea CARG2d, [BASE+RA*8] - | lea CARG3d, [BASE+RD*8] - |.endif - | mov CARG1d, L:RB // Caveat: CARG1d/CARG4d == RA. - | movzx CARG4d, PC_OP - |.else - | movzx RB, PC_OP - | lea RD, [BASE+RD*8] - | lea RA, [BASE+RA*8] - | mov ARG4, RB - | mov L:RB, SAVE_L - | mov ARG3, RD - | mov ARG2, RA - | mov ARG1, L:RB - | mov L:RB->base, BASE - |.endif - | mov SAVE_PC, PC - | call extern lj_meta_comp // (lua_State *L, TValue *o1, *o2, int op) - | // 0/1 or TValue * (metamethod) returned in eax (RC). - |3: - | mov BASE, L:RB->base - | cmp RC, 1 - | ja ->vmeta_binop - |4: - | lea PC, [PC+4] - | jb >6 - |5: - | movzx RD, PC_RD - | branchPC RD - |6: - | ins_next - | - |->cont_condt: // BASE = base, RC = result - | add PC, 4 - | cmp dword [RC+4], LJ_TISTRUECOND // Branch if result is true. - | jb <5 - | jmp <6 - | - |->cont_condf: // BASE = base, RC = result - | cmp dword [RC+4], LJ_TISTRUECOND // Branch if result is false. - | jmp <4 - | - |->vmeta_equal: - | sub PC, 4 - |.if X64WIN - | mov CARG3d, RD - | mov CARG4d, RB - | mov L:RB, SAVE_L - | mov L:RB->base, BASE // Caveat: CARG2d == BASE. - | mov CARG2d, RA - | mov CARG1d, L:RB // Caveat: CARG1d == RA. - |.elif X64 - | mov CARG2d, RA - | mov CARG4d, RB // Caveat: CARG4d == RA. - | mov L:RB, SAVE_L - | mov L:RB->base, BASE // Caveat: CARG3d == BASE. - | mov CARG3d, RD - | mov CARG1d, L:RB - |.else - | mov ARG4, RB - | mov L:RB, SAVE_L - | mov ARG3, RD - | mov ARG2, RA - | mov ARG1, L:RB - | mov L:RB->base, BASE - |.endif - | mov SAVE_PC, PC - | call extern lj_meta_equal // (lua_State *L, GCobj *o1, *o2, int ne) - | // 0/1 or TValue * (metamethod) returned in eax (RC). - | jmp <3 - | - |->vmeta_equal_cd: - |.if FFI - | sub PC, 4 - | mov L:RB, SAVE_L - | mov L:RB->base, BASE - | mov FCARG1, L:RB - | mov FCARG2, dword [PC-4] - | mov SAVE_PC, PC - | call extern lj_meta_equal_cd@8 // (lua_State *L, BCIns ins) - | // 0/1 or TValue * (metamethod) returned in eax (RC). - | jmp <3 - |.endif - | - |//-- Arithmetic metamethods --------------------------------------------- - | - |->vmeta_arith_vno: - |.if DUALNUM - | movzx RB, PC_RB - |.endif - |->vmeta_arith_vn: - | lea RC, [KBASE+RC*8] - | jmp >1 - | - |->vmeta_arith_nvo: - |.if DUALNUM - | movzx RC, PC_RC - |.endif - |->vmeta_arith_nv: - | lea RC, [KBASE+RC*8] - | lea RB, [BASE+RB*8] - | xchg RB, RC - | jmp >2 - | - |->vmeta_unm: - | lea RC, [BASE+RD*8] - | mov RB, RC - | jmp >2 - | - |->vmeta_arith_vvo: - |.if DUALNUM - | movzx RB, PC_RB - |.endif - |->vmeta_arith_vv: - | lea RC, [BASE+RC*8] - |1: - | lea RB, [BASE+RB*8] - |2: - | lea RA, [BASE+RA*8] - |.if X64WIN - | mov CARG3d, RB - | mov CARG4d, RC - | movzx RC, PC_OP - | mov ARG5d, RC - | mov L:RB, SAVE_L - | mov L:RB->base, BASE // Caveat: CARG2d == BASE. - | mov CARG2d, RA - | mov CARG1d, L:RB // Caveat: CARG1d == RA. - |.elif X64 - | movzx CARG5d, PC_OP - | mov CARG2d, RA - | mov CARG4d, RC // Caveat: CARG4d == RA. - | mov L:CARG1d, SAVE_L - | mov L:CARG1d->base, BASE // Caveat: CARG3d == BASE. - | mov CARG3d, RB - | mov L:RB, L:CARG1d - |.else - | mov ARG3, RB - | mov L:RB, SAVE_L - | mov ARG4, RC - | movzx RC, PC_OP - | mov ARG2, RA - | mov ARG5, RC - | mov ARG1, L:RB - | mov L:RB->base, BASE - |.endif - | mov SAVE_PC, PC - | call extern lj_meta_arith // (lua_State *L, TValue *ra,*rb,*rc, BCReg op) - | // NULL (finished) or TValue * (metamethod) returned in eax (RC). - | mov BASE, L:RB->base - | test RC, RC - | jz ->cont_nop - | - | // Call metamethod for binary op. - |->vmeta_binop: - | // BASE = base, RC = new base, stack = cont/func/o1/o2 - | mov RA, RC - | sub RC, BASE - | mov [RA-12], PC // [cont|PC] - | lea PC, [RC+FRAME_CONT] - | mov NARGS:RD, 2+1 // 2 args for func(o1, o2). - | jmp ->vm_call_dispatch - | - |->vmeta_len: - | mov L:RB, SAVE_L - | mov L:RB->base, BASE - | lea FCARG2, [BASE+RD*8] // Caveat: FCARG2 == BASE - | mov L:FCARG1, L:RB - | mov SAVE_PC, PC - | call extern lj_meta_len@8 // (lua_State *L, TValue *o) - | // NULL (retry) or TValue * (metamethod) returned in eax (RC). - | mov BASE, L:RB->base -#if LJ_52 - | test RC, RC - | jne ->vmeta_binop // Binop call for compatibility. - | movzx RD, PC_RD - | mov TAB:FCARG1, [BASE+RD*8] - | jmp ->BC_LEN_Z -#else - | jmp ->vmeta_binop // Binop call for compatibility. -#endif - | - |//-- Call metamethod ---------------------------------------------------- - | - |->vmeta_call_ra: - | lea RA, [BASE+RA*8+8] - |->vmeta_call: // Resolve and call __call metamethod. - | // BASE = old base, RA = new base, RC = nargs+1, PC = return - | mov TMP2, RA // Save RA, RC for us. - | mov TMP1, NARGS:RD - | sub RA, 8 - |.if X64 - | mov L:RB, SAVE_L - | mov L:RB->base, BASE // Caveat: CARG2d/CARG3d may be BASE. - | mov CARG2d, RA - | lea CARG3d, [RA+NARGS:RD*8] - | mov CARG1d, L:RB // Caveat: CARG1d may be RA. - |.else - | lea RC, [RA+NARGS:RD*8] - | mov L:RB, SAVE_L - | mov ARG2, RA - | mov ARG3, RC - | mov ARG1, L:RB - | mov L:RB->base, BASE // This is the callers base! - |.endif - | mov SAVE_PC, PC - | call extern lj_meta_call // (lua_State *L, TValue *func, TValue *top) - | mov BASE, L:RB->base - | mov RA, TMP2 - | mov NARGS:RD, TMP1 - | mov LFUNC:RB, [RA-8] - | add NARGS:RD, 1 - | // This is fragile. L->base must not move, KBASE must always be defined. - | cmp KBASE, BASE // Continue with CALLT if flag set. - | je ->BC_CALLT_Z - | mov BASE, RA - | ins_call // Otherwise call resolved metamethod. - | - |//-- Argument coercion for 'for' statement ------------------------------ - | - |->vmeta_for: - | mov L:RB, SAVE_L - | mov L:RB->base, BASE - | mov FCARG2, RA // Caveat: FCARG2 == BASE - | mov L:FCARG1, L:RB // Caveat: FCARG1 == RA - | mov SAVE_PC, PC - | call extern lj_meta_for@8 // (lua_State *L, TValue *base) - | mov BASE, L:RB->base - | mov RC, [PC-4] - | movzx RA, RCH - | movzx OP, RCL - | shr RC, 16 - |.if X64 - | jmp aword [DISPATCH+OP*8+GG_DISP2STATIC] // Retry FORI or JFORI. - |.else - | jmp aword [DISPATCH+OP*4+GG_DISP2STATIC] // Retry FORI or JFORI. - |.endif - | - |//----------------------------------------------------------------------- - |//-- Fast functions ----------------------------------------------------- - |//----------------------------------------------------------------------- - | - |.macro .ffunc, name - |->ff_ .. name: - |.endmacro - | - |.macro .ffunc_1, name - |->ff_ .. name: - | cmp NARGS:RD, 1+1; jb ->fff_fallback - |.endmacro - | - |.macro .ffunc_2, name - |->ff_ .. name: - | cmp NARGS:RD, 2+1; jb ->fff_fallback - |.endmacro - | - |.macro .ffunc_n, name - | .ffunc_1 name - | cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback - | fld qword [BASE] - |.endmacro - | - |.macro .ffunc_n, name, op - | .ffunc_1 name - | cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback - | op - | fld qword [BASE] - |.endmacro - | - |.macro .ffunc_nsse, name, op - | .ffunc_1 name - | cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback - | op xmm0, qword [BASE] - |.endmacro - | - |.macro .ffunc_nsse, name - | .ffunc_nsse name, movsd - |.endmacro - | - |.macro .ffunc_nn, name - | .ffunc_2 name - | cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback - | cmp dword [BASE+12], LJ_TISNUM; jae ->fff_fallback - | fld qword [BASE] - | fld qword [BASE+8] - |.endmacro - | - |.macro .ffunc_nnsse, name - | .ffunc_2 name - | cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback - | cmp dword [BASE+12], LJ_TISNUM; jae ->fff_fallback - | movsd xmm0, qword [BASE] - | movsd xmm1, qword [BASE+8] - |.endmacro - | - |.macro .ffunc_nnr, name - | .ffunc_2 name - | cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback - | cmp dword [BASE+12], LJ_TISNUM; jae ->fff_fallback - | fld qword [BASE+8] - | fld qword [BASE] - |.endmacro - | - |// Inlined GC threshold check. Caveat: uses label 1. - |.macro ffgccheck - | mov RB, [DISPATCH+DISPATCH_GL(gc.total)] - | cmp RB, [DISPATCH+DISPATCH_GL(gc.threshold)] - | jb >1 - | call ->fff_gcstep - |1: - |.endmacro - | - |//-- Base library: checks ----------------------------------------------- - | - |.ffunc_1 assert - | mov RB, [BASE+4] - | cmp RB, LJ_TISTRUECOND; jae ->fff_fallback - | mov PC, [BASE-4] - | mov MULTRES, RD - | mov [BASE-4], RB - | mov RB, [BASE] - | mov [BASE-8], RB - | sub RD, 2 - | jz >2 - | mov RA, BASE - |1: - | add RA, 8 - |.if X64 - | mov RBa, [RA] - | mov [RA-8], RBa - |.else - | mov RB, [RA+4] - | mov [RA-4], RB - | mov RB, [RA] - | mov [RA-8], RB - |.endif - | sub RD, 1 - | jnz <1 - |2: - | mov RD, MULTRES - | jmp ->fff_res_ - | - |.ffunc_1 type - | mov RB, [BASE+4] - |.if X64 - | mov RA, RB - | sar RA, 15 - | cmp RA, -2 - | je >3 - |.endif - | mov RC, ~LJ_TNUMX - | not RB - | cmp RC, RB - | cmova RC, RB - |2: - | mov CFUNC:RB, [BASE-8] - | mov STR:RC, [CFUNC:RB+RC*8+((char *)(&((GCfuncC *)0)->upvalue))] - | mov PC, [BASE-4] - | mov dword [BASE-4], LJ_TSTR - | mov [BASE-8], STR:RC - | jmp ->fff_res1 - |.if X64 - |3: - | mov RC, ~LJ_TLIGHTUD - | jmp <2 - |.endif - | - |//-- Base library: getters and setters --------------------------------- - | - |.ffunc_1 getmetatable - | mov RB, [BASE+4] - | mov PC, [BASE-4] - | cmp RB, LJ_TTAB; jne >6 - |1: // Field metatable must be at same offset for GCtab and GCudata! - | mov TAB:RB, [BASE] - | mov TAB:RB, TAB:RB->metatable - |2: - | test TAB:RB, TAB:RB - | mov dword [BASE-4], LJ_TNIL - | jz ->fff_res1 - | mov STR:RC, [DISPATCH+DISPATCH_GL(gcroot)+4*(GCROOT_MMNAME+MM_metatable)] - | mov dword [BASE-4], LJ_TTAB // Store metatable as default result. - | mov [BASE-8], TAB:RB - | mov RA, TAB:RB->hmask - | and RA, STR:RC->hash - | imul RA, #NODE - | add NODE:RA, TAB:RB->node - |3: // Rearranged logic, because we expect _not_ to find the key. - | cmp dword NODE:RA->key.it, LJ_TSTR - | jne >4 - | cmp dword NODE:RA->key.gcr, STR:RC - | je >5 - |4: - | mov NODE:RA, NODE:RA->next - | test NODE:RA, NODE:RA - | jnz <3 - | jmp ->fff_res1 // Not found, keep default result. - |5: - | mov RB, [RA+4] - | cmp RB, LJ_TNIL; je ->fff_res1 // Ditto for nil value. - | mov RC, [RA] - | mov [BASE-4], RB // Return value of mt.__metatable. - | mov [BASE-8], RC - | jmp ->fff_res1 - | - |6: - | cmp RB, LJ_TUDATA; je <1 - |.if X64 - | cmp RB, LJ_TNUMX; ja >8 - | cmp RB, LJ_TISNUM; jbe >7 - | mov RB, LJ_TLIGHTUD - | jmp >8 - |7: - |.else - | cmp RB, LJ_TISNUM; ja >8 - |.endif - | mov RB, LJ_TNUMX - |8: - | not RB - | mov TAB:RB, [DISPATCH+RB*4+DISPATCH_GL(gcroot[GCROOT_BASEMT])] - | jmp <2 - | - |.ffunc_2 setmetatable - | cmp dword [BASE+4], LJ_TTAB; jne ->fff_fallback - | // Fast path: no mt for table yet and not clearing the mt. - | mov TAB:RB, [BASE] - | cmp dword TAB:RB->metatable, 0; jne ->fff_fallback - | cmp dword [BASE+12], LJ_TTAB; jne ->fff_fallback - | mov TAB:RC, [BASE+8] - | mov TAB:RB->metatable, TAB:RC - | mov PC, [BASE-4] - | mov dword [BASE-4], LJ_TTAB // Return original table. - | mov [BASE-8], TAB:RB - | test byte TAB:RB->marked, LJ_GC_BLACK // isblack(table) - | jz >1 - | // Possible write barrier. Table is black, but skip iswhite(mt) check. - | barrierback TAB:RB, RC - |1: - | jmp ->fff_res1 - | - |.ffunc_2 rawget - | cmp dword [BASE+4], LJ_TTAB; jne ->fff_fallback - |.if X64WIN - | mov RB, BASE // Save BASE. - | lea CARG3d, [BASE+8] - | mov CARG2d, [BASE] // Caveat: CARG2d == BASE. - | mov CARG1d, SAVE_L - |.elif X64 - | mov RB, BASE // Save BASE. - | mov CARG2d, [BASE] - | lea CARG3d, [BASE+8] // Caveat: CARG3d == BASE. - | mov CARG1d, SAVE_L - |.else - | mov TAB:RD, [BASE] - | mov L:RB, SAVE_L - | mov ARG2, TAB:RD - | mov ARG1, L:RB - | mov RB, BASE // Save BASE. - | add BASE, 8 - | mov ARG3, BASE - |.endif - | call extern lj_tab_get // (lua_State *L, GCtab *t, cTValue *key) - | // cTValue * returned in eax (RD). - | mov BASE, RB // Restore BASE. - | // Copy table slot. - |.if X64 - | mov RBa, [RD] - | mov PC, [BASE-4] - | mov [BASE-8], RBa - |.else - | mov RB, [RD] - | mov RD, [RD+4] - | mov PC, [BASE-4] - | mov [BASE-8], RB - | mov [BASE-4], RD - |.endif - | jmp ->fff_res1 - | - |//-- Base library: conversions ------------------------------------------ - | - |.ffunc tonumber - | // Only handles the number case inline (without a base argument). - | cmp NARGS:RD, 1+1; jne ->fff_fallback // Exactly one argument. - | cmp dword [BASE+4], LJ_TISNUM - |.if DUALNUM - | jne >1 - | mov RB, dword [BASE]; jmp ->fff_resi - |1: - | ja ->fff_fallback - |.else - | jae ->fff_fallback - |.endif - |.if SSE - | movsd xmm0, qword [BASE]; jmp ->fff_resxmm0 - |.else - | fld qword [BASE]; jmp ->fff_resn - |.endif - | - |.ffunc_1 tostring - | // Only handles the string or number case inline. - | mov PC, [BASE-4] - | cmp dword [BASE+4], LJ_TSTR; jne >3 - | // A __tostring method in the string base metatable is ignored. - | mov STR:RD, [BASE] - |2: - | mov dword [BASE-4], LJ_TSTR - | mov [BASE-8], STR:RD - | jmp ->fff_res1 - |3: // Handle numbers inline, unless a number base metatable is present. - | cmp dword [BASE+4], LJ_TISNUM; ja ->fff_fallback - | cmp dword [DISPATCH+DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])], 0 - | jne ->fff_fallback - | ffgccheck // Caveat: uses label 1. - | mov L:RB, SAVE_L - | mov L:RB->base, BASE // Add frame since C call can throw. - | mov SAVE_PC, PC // Redundant (but a defined value). - |.if X64 and not X64WIN - | mov FCARG2, BASE // Otherwise: FCARG2 == BASE - |.endif - | mov L:FCARG1, L:RB - |.if DUALNUM - | call extern lj_str_fromnumber@8 // (lua_State *L, cTValue *o) - |.else - | call extern lj_str_fromnum@8 // (lua_State *L, lua_Number *np) - |.endif - | // GCstr returned in eax (RD). - | mov BASE, L:RB->base - | jmp <2 - | - |//-- Base library: iterators ------------------------------------------- - | - |.ffunc_1 next - | je >2 // Missing 2nd arg? - |1: - | cmp dword [BASE+4], LJ_TTAB; jne ->fff_fallback - | mov L:RB, SAVE_L - | mov L:RB->base, BASE // Add frame since C call can throw. - | mov L:RB->top, BASE // Dummy frame length is ok. - | mov PC, [BASE-4] - |.if X64WIN - | lea CARG3d, [BASE+8] - | mov CARG2d, [BASE] // Caveat: CARG2d == BASE. - | mov CARG1d, L:RB - |.elif X64 - | mov CARG2d, [BASE] - | lea CARG3d, [BASE+8] // Caveat: CARG3d == BASE. - | mov CARG1d, L:RB - |.else - | mov TAB:RD, [BASE] - | mov ARG2, TAB:RD - | mov ARG1, L:RB - | add BASE, 8 - | mov ARG3, BASE - |.endif - | mov SAVE_PC, PC // Needed for ITERN fallback. - | call extern lj_tab_next // (lua_State *L, GCtab *t, TValue *key) - | // Flag returned in eax (RD). - | mov BASE, L:RB->base - | test RD, RD; jz >3 // End of traversal? - | // Copy key and value to results. - |.if X64 - | mov RBa, [BASE+8] - | mov RDa, [BASE+16] - | mov [BASE-8], RBa - | mov [BASE], RDa - |.else - | mov RB, [BASE+8] - | mov RD, [BASE+12] - | mov [BASE-8], RB - | mov [BASE-4], RD - | mov RB, [BASE+16] - | mov RD, [BASE+20] - | mov [BASE], RB - | mov [BASE+4], RD - |.endif - |->fff_res2: - | mov RD, 1+2 - | jmp ->fff_res - |2: // Set missing 2nd arg to nil. - | mov dword [BASE+12], LJ_TNIL - | jmp <1 - |3: // End of traversal: return nil. - | mov dword [BASE-4], LJ_TNIL - | jmp ->fff_res1 - | - |.ffunc_1 pairs - | mov TAB:RB, [BASE] - | cmp dword [BASE+4], LJ_TTAB; jne ->fff_fallback -#if LJ_52 - | cmp dword TAB:RB->metatable, 0; jne ->fff_fallback -#endif - | mov CFUNC:RB, [BASE-8] - | mov CFUNC:RD, CFUNC:RB->upvalue[0] - | mov PC, [BASE-4] - | mov dword [BASE-4], LJ_TFUNC - | mov [BASE-8], CFUNC:RD - | mov dword [BASE+12], LJ_TNIL - | mov RD, 1+3 - | jmp ->fff_res - | - |.ffunc_2 ipairs_aux - | cmp dword [BASE+4], LJ_TTAB; jne ->fff_fallback - | cmp dword [BASE+12], LJ_TISNUM - |.if DUALNUM - | jne ->fff_fallback - |.else - | jae ->fff_fallback - |.endif - | mov PC, [BASE-4] - |.if DUALNUM - | mov RD, dword [BASE+8] - | add RD, 1 - | mov dword [BASE-4], LJ_TISNUM - | mov dword [BASE-8], RD - |.elif SSE - | movsd xmm0, qword [BASE+8] - | sseconst_1 xmm1, RBa - | addsd xmm0, xmm1 - | cvtsd2si RD, xmm0 - | movsd qword [BASE-8], xmm0 - |.else - | fld qword [BASE+8] - | fld1 - | faddp st1 - | fist ARG1 - | fstp qword [BASE-8] - | mov RD, ARG1 - |.endif - | mov TAB:RB, [BASE] - | cmp RD, TAB:RB->asize; jae >2 // Not in array part? - | shl RD, 3 - | add RD, TAB:RB->array - |1: - | cmp dword [RD+4], LJ_TNIL; je ->fff_res0 - | // Copy array slot. - |.if X64 - | mov RBa, [RD] - | mov [BASE], RBa - |.else - | mov RB, [RD] - | mov RD, [RD+4] - | mov [BASE], RB - | mov [BASE+4], RD - |.endif - | jmp ->fff_res2 - |2: // Check for empty hash part first. Otherwise call C function. - | cmp dword TAB:RB->hmask, 0; je ->fff_res0 - | mov FCARG1, TAB:RB - | mov RB, BASE // Save BASE. - | mov FCARG2, RD // Caveat: FCARG2 == BASE - | call extern lj_tab_getinth@8 // (GCtab *t, int32_t key) - | // cTValue * or NULL returned in eax (RD). - | mov BASE, RB - | test RD, RD - | jnz <1 - |->fff_res0: - | mov RD, 1+0 - | jmp ->fff_res - | - |.ffunc_1 ipairs - | mov TAB:RB, [BASE] - | cmp dword [BASE+4], LJ_TTAB; jne ->fff_fallback -#if LJ_52 - | cmp dword TAB:RB->metatable, 0; jne ->fff_fallback -#endif - | mov CFUNC:RB, [BASE-8] - | mov CFUNC:RD, CFUNC:RB->upvalue[0] - | mov PC, [BASE-4] - | mov dword [BASE-4], LJ_TFUNC - | mov [BASE-8], CFUNC:RD - |.if DUALNUM - | mov dword [BASE+12], LJ_TISNUM - | mov dword [BASE+8], 0 - |.elif SSE - | xorps xmm0, xmm0 - | movsd qword [BASE+8], xmm0 - |.else - | fldz - | fstp qword [BASE+8] - |.endif - | mov RD, 1+3 - | jmp ->fff_res - | - |//-- Base library: catch errors ---------------------------------------- - | - |.ffunc_1 pcall - | lea RA, [BASE+8] - | sub NARGS:RD, 1 - | mov PC, 8+FRAME_PCALL - |1: - | movzx RB, byte [DISPATCH+DISPATCH_GL(hookmask)] - | shr RB, HOOK_ACTIVE_SHIFT - | and RB, 1 - | add PC, RB // Remember active hook before pcall. - | jmp ->vm_call_dispatch - | - |.ffunc_2 xpcall - | cmp dword [BASE+12], LJ_TFUNC; jne ->fff_fallback - | mov RB, [BASE+4] // Swap function and traceback. - | mov [BASE+12], RB - | mov dword [BASE+4], LJ_TFUNC - | mov LFUNC:RB, [BASE] - | mov PC, [BASE+8] - | mov [BASE+8], LFUNC:RB - | mov [BASE], PC - | lea RA, [BASE+16] - | sub NARGS:RD, 2 - | mov PC, 16+FRAME_PCALL - | jmp <1 - | - |//-- Coroutine library -------------------------------------------------- - | - |.macro coroutine_resume_wrap, resume - |.if resume - |.ffunc_1 coroutine_resume - | mov L:RB, [BASE] - |.else - |.ffunc coroutine_wrap_aux - | mov CFUNC:RB, [BASE-8] - | mov L:RB, CFUNC:RB->upvalue[0].gcr - |.endif - | mov PC, [BASE-4] - | mov SAVE_PC, PC - |.if X64 - | mov TMP1, L:RB - |.else - | mov ARG1, L:RB - |.endif - |.if resume - | cmp dword [BASE+4], LJ_TTHREAD; jne ->fff_fallback - |.endif - | cmp aword L:RB->cframe, 0; jne ->fff_fallback - | cmp byte L:RB->status, LUA_YIELD; ja ->fff_fallback - | mov RA, L:RB->top - | je >1 // Status != LUA_YIELD (i.e. 0)? - | cmp RA, L:RB->base // Check for presence of initial func. - | je ->fff_fallback - |1: - |.if resume - | lea PC, [RA+NARGS:RD*8-16] // Check stack space (-1-thread). - |.else - | lea PC, [RA+NARGS:RD*8-8] // Check stack space (-1). - |.endif - | cmp PC, L:RB->maxstack; ja ->fff_fallback - | mov L:RB->top, PC - | - | mov L:RB, SAVE_L - | mov L:RB->base, BASE - |.if resume - | add BASE, 8 // Keep resumed thread in stack for GC. - |.endif - | mov L:RB->top, BASE - |.if resume - | lea RB, [BASE+NARGS:RD*8-24] // RB = end of source for stack move. - |.else - | lea RB, [BASE+NARGS:RD*8-16] // RB = end of source for stack move. - |.endif - | sub RBa, PCa // Relative to PC. - | - | cmp PC, RA - | je >3 - |2: // Move args to coroutine. - |.if X64 - | mov RCa, [PC+RB] - | mov [PC-8], RCa - |.else - | mov RC, [PC+RB+4] - | mov [PC-4], RC - | mov RC, [PC+RB] - | mov [PC-8], RC - |.endif - | sub PC, 8 - | cmp PC, RA - | jne <2 - |3: - |.if X64 - | mov CARG2d, RA - | mov CARG1d, TMP1 - |.else - | mov ARG2, RA - | xor RA, RA - | mov ARG4, RA - | mov ARG3, RA - |.endif - | call ->vm_resume // (lua_State *L, TValue *base, 0, 0) - | set_vmstate INTERP - | - | mov L:RB, SAVE_L - |.if X64 - | mov L:PC, TMP1 - |.else - | mov L:PC, ARG1 // The callee doesn't modify SAVE_L. - |.endif - | mov BASE, L:RB->base - | cmp eax, LUA_YIELD - | ja >8 - |4: - | mov RA, L:PC->base - | mov KBASE, L:PC->top - | mov L:PC->top, RA // Clear coroutine stack. - | mov PC, KBASE - | sub PC, RA - | je >6 // No results? - | lea RD, [BASE+PC] - | shr PC, 3 - | cmp RD, L:RB->maxstack - | ja >9 // Need to grow stack? - | - | mov RB, BASE - | sub RBa, RAa - |5: // Move results from coroutine. - |.if X64 - | mov RDa, [RA] - | mov [RA+RB], RDa - |.else - | mov RD, [RA] - | mov [RA+RB], RD - | mov RD, [RA+4] - | mov [RA+RB+4], RD - |.endif - | add RA, 8 - | cmp RA, KBASE - | jne <5 - |6: - |.if resume - | lea RD, [PC+2] // nresults+1 = 1 + true + results. - | mov dword [BASE-4], LJ_TTRUE // Prepend true to results. - |.else - | lea RD, [PC+1] // nresults+1 = 1 + results. - |.endif - |7: - | mov PC, SAVE_PC - | mov MULTRES, RD - |.if resume - | mov RAa, -8 - |.else - | xor RA, RA - |.endif - | test PC, FRAME_TYPE - | jz ->BC_RET_Z - | jmp ->vm_return - | - |8: // Coroutine returned with error (at co->top-1). - |.if resume - | mov dword [BASE-4], LJ_TFALSE // Prepend false to results. - | mov RA, L:PC->top - | sub RA, 8 - | mov L:PC->top, RA // Clear error from coroutine stack. - | // Copy error message. - |.if X64 - | mov RDa, [RA] - | mov [BASE], RDa - |.else - | mov RD, [RA] - | mov [BASE], RD - | mov RD, [RA+4] - | mov [BASE+4], RD - |.endif - | mov RD, 1+2 // nresults+1 = 1 + false + error. - | jmp <7 - |.else - | mov FCARG2, L:PC - | mov FCARG1, L:RB - | call extern lj_ffh_coroutine_wrap_err@8 // (lua_State *L, lua_State *co) - | // Error function does not return. - |.endif - | - |9: // Handle stack expansion on return from yield. - |.if X64 - | mov L:RA, TMP1 - |.else - | mov L:RA, ARG1 // The callee doesn't modify SAVE_L. - |.endif - | mov L:RA->top, KBASE // Undo coroutine stack clearing. - | mov FCARG2, PC - | mov FCARG1, L:RB - | call extern lj_state_growstack@8 // (lua_State *L, int n) - |.if X64 - | mov L:PC, TMP1 - |.else - | mov L:PC, ARG1 - |.endif - | mov BASE, L:RB->base - | jmp <4 // Retry the stack move. - |.endmacro - | - | coroutine_resume_wrap 1 // coroutine.resume - | coroutine_resume_wrap 0 // coroutine.wrap - | - |.ffunc coroutine_yield - | mov L:RB, SAVE_L - | test aword L:RB->cframe, CFRAME_RESUME - | jz ->fff_fallback - | mov L:RB->base, BASE - | lea RD, [BASE+NARGS:RD*8-8] - | mov L:RB->top, RD - | xor RD, RD - | mov aword L:RB->cframe, RDa - | mov al, LUA_YIELD - | mov byte L:RB->status, al - | jmp ->vm_leave_unw - | - |//-- Math library ------------------------------------------------------- - | - |.if not DUALNUM - |->fff_resi: // Dummy. - |.endif - | - |.if SSE - |->fff_resn: - | mov PC, [BASE-4] - | fstp qword [BASE-8] - | jmp ->fff_res1 - |.endif - | - | .ffunc_1 math_abs - |.if DUALNUM - | cmp dword [BASE+4], LJ_TISNUM; jne >2 - | mov RB, dword [BASE] - | cmp RB, 0; jns ->fff_resi - | neg RB; js >1 - |->fff_resbit: - |->fff_resi: - | mov PC, [BASE-4] - | mov dword [BASE-4], LJ_TISNUM - | mov dword [BASE-8], RB - | jmp ->fff_res1 - |1: - | mov PC, [BASE-4] - | mov dword [BASE-4], 0x41e00000 // 2^31. - | mov dword [BASE-8], 0 - | jmp ->fff_res1 - |2: - | ja ->fff_fallback - |.else - | cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback - |.endif - | - |.if SSE - | movsd xmm0, qword [BASE] - | sseconst_abs xmm1, RDa - | andps xmm0, xmm1 - |->fff_resxmm0: - | mov PC, [BASE-4] - | movsd qword [BASE-8], xmm0 - | // fallthrough - |.else - | fld qword [BASE] - | fabs - | // fallthrough - |->fff_resxmm0: // Dummy. - |->fff_resn: - | mov PC, [BASE-4] - | fstp qword [BASE-8] - |.endif - | - |->fff_res1: - | mov RD, 1+1 - |->fff_res: - | mov MULTRES, RD - |->fff_res_: - | test PC, FRAME_TYPE - | jnz >7 - |5: - | cmp PC_RB, RDL // More results expected? - | ja >6 - | // Adjust BASE. KBASE is assumed to be set for the calling frame. - | movzx RA, PC_RA - | not RAa // Note: ~RA = -(RA+1) - | lea BASE, [BASE+RA*8] // base = base - (RA+1)*8 - | ins_next - | - |6: // Fill up results with nil. - | mov dword [BASE+RD*8-12], LJ_TNIL - | add RD, 1 - | jmp <5 - | - |7: // Non-standard return case. - | mov RAa, -8 // Results start at BASE+RA = BASE-8. - | jmp ->vm_return - | - |.macro math_round, func - | .ffunc math_ .. func - |.if DUALNUM - | cmp dword [BASE+4], LJ_TISNUM; jne >1 - | mov RB, dword [BASE]; jmp ->fff_resi - |1: - | ja ->fff_fallback - |.else - | cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback - |.endif - |.if SSE - | movsd xmm0, qword [BASE] - | call ->vm_ .. func - | .if DUALNUM - | cvtsd2si RB, xmm0 - | cmp RB, 0x80000000 - | jne ->fff_resi - | cvtsi2sd xmm1, RB - | ucomisd xmm0, xmm1 - | jp ->fff_resxmm0 - | je ->fff_resi - | .endif - | jmp ->fff_resxmm0 - |.else - | fld qword [BASE] - | call ->vm_ .. func - | .if DUALNUM - | fist ARG1 - | mov RB, ARG1 - | cmp RB, 0x80000000; jne >2 - | fdup - | fild ARG1 - | fcomparepp - | jp ->fff_resn - | jne ->fff_resn - |2: - | fpop - | jmp ->fff_resi - | .else - | jmp ->fff_resn - | .endif - |.endif - |.endmacro - | - | math_round floor - | math_round ceil - | - |.if SSE - |.ffunc_nsse math_sqrt, sqrtsd; jmp ->fff_resxmm0 - |.else - |.ffunc_n math_sqrt; fsqrt; jmp ->fff_resn - |.endif - | - |.ffunc math_log - | cmp NARGS:RD, 1+1; jne ->fff_fallback // Exactly one argument. - | cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback - | fldln2; fld qword [BASE]; fyl2x; jmp ->fff_resn - | - |.ffunc_n math_log10, fldlg2; fyl2x; jmp ->fff_resn - |.ffunc_n math_exp; call ->vm_exp_x87; jmp ->fff_resn - | - |.ffunc_n math_sin; fsin; jmp ->fff_resn - |.ffunc_n math_cos; fcos; jmp ->fff_resn - |.ffunc_n math_tan; fptan; fpop; jmp ->fff_resn - | - |.ffunc_n math_asin - | fdup; fmul st0; fld1; fsubrp st1; fsqrt; fpatan - | jmp ->fff_resn - |.ffunc_n math_acos - | fdup; fmul st0; fld1; fsubrp st1; fsqrt; fxch; fpatan - | jmp ->fff_resn - |.ffunc_n math_atan; fld1; fpatan; jmp ->fff_resn - | - |.macro math_extern, func - |.if SSE - | .ffunc_nsse math_ .. func - | .if not X64 - | movsd FPARG1, xmm0 - | .endif - |.else - | .ffunc_n math_ .. func - | fstp FPARG1 - |.endif - | mov RB, BASE - | call extern lj_vm_ .. func - | mov BASE, RB - | .if X64 - | jmp ->fff_resxmm0 - | .else - | jmp ->fff_resn - | .endif - |.endmacro - | - | math_extern sinh - | math_extern cosh - | math_extern tanh - | - |->ff_math_deg: - |.if SSE - |.ffunc_nsse math_rad - | mov CFUNC:RB, [BASE-8] - | mulsd xmm0, qword CFUNC:RB->upvalue[0] - | jmp ->fff_resxmm0 - |.else - |.ffunc_n math_rad - | mov CFUNC:RB, [BASE-8] - | fmul qword CFUNC:RB->upvalue[0] - | jmp ->fff_resn - |.endif - | - |.ffunc_nn math_atan2; fpatan; jmp ->fff_resn - |.ffunc_nnr math_ldexp; fscale; fpop1; jmp ->fff_resn - | - |.ffunc_1 math_frexp - | mov RB, [BASE+4] - | cmp RB, LJ_TISNUM; jae ->fff_fallback - | mov PC, [BASE-4] - | mov RC, [BASE] - | mov [BASE-4], RB; mov [BASE-8], RC - | shl RB, 1; cmp RB, 0xffe00000; jae >3 - | or RC, RB; jz >3 - | mov RC, 1022 - | cmp RB, 0x00200000; jb >4 - |1: - | shr RB, 21; sub RB, RC // Extract and unbias exponent. - |.if SSE - | cvtsi2sd xmm0, RB - |.else - | mov TMP1, RB; fild TMP1 - |.endif - | mov RB, [BASE-4] - | and RB, 0x800fffff // Mask off exponent. - | or RB, 0x3fe00000 // Put mantissa in range [0.5,1) or 0. - | mov [BASE-4], RB - |2: - |.if SSE - | movsd qword [BASE], xmm0 - |.else - | fstp qword [BASE] - |.endif - | mov RD, 1+2 - | jmp ->fff_res - |3: // Return +-0, +-Inf, NaN unmodified and an exponent of 0. - |.if SSE - | xorps xmm0, xmm0; jmp <2 - |.else - | fldz; jmp <2 - |.endif - |4: // Handle denormals by multiplying with 2^54 and adjusting the bias. - |.if SSE - | movsd xmm0, qword [BASE] - | sseconst_hi xmm1, RBa, 43500000 // 2^54. - | mulsd xmm0, xmm1 - | movsd qword [BASE-8], xmm0 - |.else - | fld qword [BASE] - | mov TMP1, 0x5a800000; fmul TMP1 // x = x*2^54 - | fstp qword [BASE-8] - |.endif - | mov RB, [BASE-4]; mov RC, 1076; shl RB, 1; jmp <1 - | - |.if SSE - |.ffunc_nsse math_modf - |.else - |.ffunc_n math_modf - |.endif - | mov RB, [BASE+4] - | mov PC, [BASE-4] - | shl RB, 1; cmp RB, 0xffe00000; je >4 // +-Inf? - |.if SSE - | movaps xmm4, xmm0 - | call ->vm_trunc - | subsd xmm4, xmm0 - |1: - | movsd qword [BASE-8], xmm0 - | movsd qword [BASE], xmm4 - |.else - | fdup - | call ->vm_trunc - | fsub st1, st0 - |1: - | fstp qword [BASE-8] - | fstp qword [BASE] - |.endif - | mov RC, [BASE-4]; mov RB, [BASE+4] - | xor RC, RB; js >3 // Need to adjust sign? - |2: - | mov RD, 1+2 - | jmp ->fff_res - |3: - | xor RB, 0x80000000; mov [BASE+4], RB // Flip sign of fraction. - | jmp <2 - |4: - |.if SSE - | xorps xmm4, xmm4; jmp <1 // Return +-Inf and +-0. - |.else - | fldz; fxch; jmp <1 // Return +-Inf and +-0. - |.endif - | - |.ffunc_nnr math_fmod - |1: ; fprem; fnstsw ax; and ax, 0x400; jnz <1 - | fpop1 - | jmp ->fff_resn - | - |.if SSE - |.ffunc_nnsse math_pow; call ->vm_pow; jmp ->fff_resxmm0 - |.else - |.ffunc_nn math_pow; call ->vm_pow; jmp ->fff_resn - |.endif - | - |.macro math_minmax, name, cmovop, fcmovop, sseop - | .ffunc name - | mov RA, 2 - | cmp dword [BASE+4], LJ_TISNUM - |.if DUALNUM - | jne >4 - | mov RB, dword [BASE] - |1: // Handle integers. - | cmp RA, RD; jae ->fff_resi - | cmp dword [BASE+RA*8-4], LJ_TISNUM; jne >3 - | cmp RB, dword [BASE+RA*8-8] - | cmovop RB, dword [BASE+RA*8-8] - | add RA, 1 - | jmp <1 - |3: - | ja ->fff_fallback - | // Convert intermediate result to number and continue below. - |.if SSE - | cvtsi2sd xmm0, RB - |.else - | mov TMP1, RB - | fild TMP1 - |.endif - | jmp >6 - |4: - | ja ->fff_fallback - |.else - | jae ->fff_fallback - |.endif - | - |.if SSE - | movsd xmm0, qword [BASE] - |5: // Handle numbers or integers. - | cmp RA, RD; jae ->fff_resxmm0 - | cmp dword [BASE+RA*8-4], LJ_TISNUM - |.if DUALNUM - | jb >6 - | ja ->fff_fallback - | cvtsi2sd xmm1, dword [BASE+RA*8-8] - | jmp >7 - |.else - | jae ->fff_fallback - |.endif - |6: - | movsd xmm1, qword [BASE+RA*8-8] - |7: - | sseop xmm0, xmm1 - | add RA, 1 - | jmp <5 - |.else - | fld qword [BASE] - |5: // Handle numbers or integers. - | cmp RA, RD; jae ->fff_resn - | cmp dword [BASE+RA*8-4], LJ_TISNUM - |.if DUALNUM - | jb >6 - | ja >9 - | fild dword [BASE+RA*8-8] - | jmp >7 - |.else - | jae >9 - |.endif - |6: - | fld qword [BASE+RA*8-8] - |7: - | fucomi st1; fcmovop st1; fpop1 - | add RA, 1 - | jmp <5 - |.endif - |.endmacro - | - | math_minmax math_min, cmovg, fcmovnbe, minsd - | math_minmax math_max, cmovl, fcmovbe, maxsd - |.if not SSE - |9: - | fpop; jmp ->fff_fallback - |.endif - | - |//-- String library ----------------------------------------------------- - | - |.ffunc_1 string_len - | cmp dword [BASE+4], LJ_TSTR; jne ->fff_fallback - | mov STR:RB, [BASE] - |.if DUALNUM - | mov RB, dword STR:RB->len; jmp ->fff_resi - |.elif SSE - | cvtsi2sd xmm0, dword STR:RB->len; jmp ->fff_resxmm0 - |.else - | fild dword STR:RB->len; jmp ->fff_resn - |.endif - | - |.ffunc string_byte // Only handle the 1-arg case here. - | cmp NARGS:RD, 1+1; jne ->fff_fallback - | cmp dword [BASE+4], LJ_TSTR; jne ->fff_fallback - | mov STR:RB, [BASE] - | mov PC, [BASE-4] - | cmp dword STR:RB->len, 1 - | jb ->fff_res0 // Return no results for empty string. - | movzx RB, byte STR:RB[1] - |.if DUALNUM - | jmp ->fff_resi - |.elif SSE - | cvtsi2sd xmm0, RB; jmp ->fff_resxmm0 - |.else - | mov TMP1, RB; fild TMP1; jmp ->fff_resn - |.endif - | - |.ffunc string_char // Only handle the 1-arg case here. - | ffgccheck - | cmp NARGS:RD, 1+1; jne ->fff_fallback // *Exactly* 1 arg. - | cmp dword [BASE+4], LJ_TISNUM - |.if DUALNUM - | jne ->fff_fallback - | mov RB, dword [BASE] - | cmp RB, 255; ja ->fff_fallback - | mov TMP2, RB - |.elif SSE - | jae ->fff_fallback - | cvttsd2si RB, qword [BASE] - | cmp RB, 255; ja ->fff_fallback - | mov TMP2, RB - |.else - | jae ->fff_fallback - | fld qword [BASE] - | fistp TMP2 - | cmp TMP2, 255; ja ->fff_fallback - |.endif - |.if X64 - | mov TMP3, 1 - |.else - | mov ARG3, 1 - |.endif - | lea RDa, TMP2 // Points to stack. Little-endian. - |->fff_newstr: - | mov L:RB, SAVE_L - | mov L:RB->base, BASE - |.if X64 - | mov CARG3d, TMP3 // Zero-extended to size_t. - | mov CARG2, RDa // May be 64 bit ptr to stack. - | mov CARG1d, L:RB - |.else - | mov ARG2, RD - | mov ARG1, L:RB - |.endif - | mov SAVE_PC, PC - | call extern lj_str_new // (lua_State *L, char *str, size_t l) - | // GCstr * returned in eax (RD). - | mov BASE, L:RB->base - | mov PC, [BASE-4] - | mov dword [BASE-4], LJ_TSTR - | mov [BASE-8], STR:RD - | jmp ->fff_res1 - | - |.ffunc string_sub - | ffgccheck - | mov TMP2, -1 - | cmp NARGS:RD, 1+2; jb ->fff_fallback - | jna >1 - | cmp dword [BASE+20], LJ_TISNUM - |.if DUALNUM - | jne ->fff_fallback - | mov RB, dword [BASE+16] - | mov TMP2, RB - |.elif SSE - | jae ->fff_fallback - | cvttsd2si RB, qword [BASE+16] - | mov TMP2, RB - |.else - | jae ->fff_fallback - | fld qword [BASE+16] - | fistp TMP2 - |.endif - |1: - | cmp dword [BASE+4], LJ_TSTR; jne ->fff_fallback - | cmp dword [BASE+12], LJ_TISNUM - |.if DUALNUM - | jne ->fff_fallback - |.else - | jae ->fff_fallback - |.endif - | mov STR:RB, [BASE] - | mov TMP3, STR:RB - | mov RB, STR:RB->len - |.if DUALNUM - | mov RA, dword [BASE+8] - |.elif SSE - | cvttsd2si RA, qword [BASE+8] - |.else - | fld qword [BASE+8] - | fistp ARG3 - | mov RA, ARG3 - |.endif - | mov RC, TMP2 - | cmp RB, RC // len < end? (unsigned compare) - | jb >5 - |2: - | test RA, RA // start <= 0? - | jle >7 - |3: - | mov STR:RB, TMP3 - | sub RC, RA // start > end? - | jl ->fff_emptystr - | lea RB, [STR:RB+RA+#STR-1] - | add RC, 1 - |4: - |.if X64 - | mov TMP3, RC - |.else - | mov ARG3, RC - |.endif - | mov RD, RB - | jmp ->fff_newstr - | - |5: // Negative end or overflow. - | jl >6 - | lea RC, [RC+RB+1] // end = end+(len+1) - | jmp <2 - |6: // Overflow. - | mov RC, RB // end = len - | jmp <2 - | - |7: // Negative start or underflow. - | je >8 - | add RA, RB // start = start+(len+1) - | add RA, 1 - | jg <3 // start > 0? - |8: // Underflow. - | mov RA, 1 // start = 1 - | jmp <3 - | - |->fff_emptystr: // Range underflow. - | xor RC, RC // Zero length. Any ptr in RB is ok. - | jmp <4 - | - |.ffunc string_rep // Only handle the 1-char case inline. - | ffgccheck - | cmp NARGS:RD, 2+1; jne ->fff_fallback // Exactly 2 arguments. - | cmp dword [BASE+4], LJ_TSTR; jne ->fff_fallback - | cmp dword [BASE+12], LJ_TISNUM - | mov STR:RB, [BASE] - |.if DUALNUM - | jne ->fff_fallback - | mov RC, dword [BASE+8] - |.elif SSE - | jae ->fff_fallback - | cvttsd2si RC, qword [BASE+8] - |.else - | jae ->fff_fallback - | fld qword [BASE+8] - | fistp TMP2 - | mov RC, TMP2 - |.endif - | test RC, RC - | jle ->fff_emptystr // Count <= 0? (or non-int) - | cmp dword STR:RB->len, 1 - | jb ->fff_emptystr // Zero length string? - | jne ->fff_fallback_2 // Fallback for > 1-char strings. - | cmp [DISPATCH+DISPATCH_GL(tmpbuf.sz)], RC; jb ->fff_fallback_2 - | movzx RA, byte STR:RB[1] - | mov RB, [DISPATCH+DISPATCH_GL(tmpbuf.buf)] - |.if X64 - | mov TMP3, RC - |.else - | mov ARG3, RC - |.endif - |1: // Fill buffer with char. Yes, this is suboptimal code (do you care?). - | mov [RB], RAL - | add RB, 1 - | sub RC, 1 - | jnz <1 - | mov RD, [DISPATCH+DISPATCH_GL(tmpbuf.buf)] - | jmp ->fff_newstr - | - |.ffunc_1 string_reverse - | ffgccheck - | cmp dword [BASE+4], LJ_TSTR; jne ->fff_fallback - | mov STR:RB, [BASE] - | mov RC, STR:RB->len - | test RC, RC - | jz ->fff_emptystr // Zero length string? - | cmp [DISPATCH+DISPATCH_GL(tmpbuf.sz)], RC; jb ->fff_fallback_1 - | add RB, #STR - | mov TMP2, PC // Need another temp register. - |.if X64 - | mov TMP3, RC - |.else - | mov ARG3, RC - |.endif - | mov PC, [DISPATCH+DISPATCH_GL(tmpbuf.buf)] - |1: - | movzx RA, byte [RB] - | add RB, 1 - | sub RC, 1 - | mov [PC+RC], RAL - | jnz <1 - | mov RD, PC - | mov PC, TMP2 - | jmp ->fff_newstr - | - |.macro ffstring_case, name, lo, hi - | .ffunc_1 name - | ffgccheck - | cmp dword [BASE+4], LJ_TSTR; jne ->fff_fallback - | mov STR:RB, [BASE] - | mov RC, STR:RB->len - | cmp [DISPATCH+DISPATCH_GL(tmpbuf.sz)], RC; jb ->fff_fallback_1 - | add RB, #STR - | mov TMP2, PC // Need another temp register. - |.if X64 - | mov TMP3, RC - |.else - | mov ARG3, RC - |.endif - | mov PC, [DISPATCH+DISPATCH_GL(tmpbuf.buf)] - | jmp >3 - |1: // ASCII case conversion. Yes, this is suboptimal code (do you care?). - | movzx RA, byte [RB+RC] - | cmp RA, lo - | jb >2 - | cmp RA, hi - | ja >2 - | xor RA, 0x20 - |2: - | mov [PC+RC], RAL - |3: - | sub RC, 1 - | jns <1 - | mov RD, PC - | mov PC, TMP2 - | jmp ->fff_newstr - |.endmacro - | - |ffstring_case string_lower, 0x41, 0x5a - |ffstring_case string_upper, 0x61, 0x7a - | - |//-- Table library ------------------------------------------------------ - | - |.ffunc_1 table_getn - | cmp dword [BASE+4], LJ_TTAB; jne ->fff_fallback - | mov RB, BASE // Save BASE. - | mov TAB:FCARG1, [BASE] - | call extern lj_tab_len@4 // LJ_FASTCALL (GCtab *t) - | // Length of table returned in eax (RD). - | mov BASE, RB // Restore BASE. - |.if DUALNUM - | mov RB, RD; jmp ->fff_resi - |.elif SSE - | cvtsi2sd xmm0, RD; jmp ->fff_resxmm0 - |.else - | mov ARG1, RD; fild ARG1; jmp ->fff_resn - |.endif - | - |//-- Bit library -------------------------------------------------------- - | - |.define TOBIT_BIAS, 0x59c00000 // 2^52 + 2^51 (float, not double!). - | - |.macro .ffunc_bit, name, kind, fdef - | fdef name - |.if kind == 2 - |.if SSE - | sseconst_tobit xmm1, RBa - |.else - | mov TMP1, TOBIT_BIAS - |.endif - |.endif - | cmp dword [BASE+4], LJ_TISNUM - |.if DUALNUM - | jne >1 - | mov RB, dword [BASE] - |.if kind > 0 - | jmp >2 - |.else - | jmp ->fff_resbit - |.endif - |1: - | ja ->fff_fallback - |.else - | jae ->fff_fallback - |.endif - |.if SSE - | movsd xmm0, qword [BASE] - |.if kind < 2 - | sseconst_tobit xmm1, RBa - |.endif - | addsd xmm0, xmm1 - | movd RB, xmm0 - |.else - | fld qword [BASE] - |.if kind < 2 - | mov TMP1, TOBIT_BIAS - |.endif - | fadd TMP1 - | fstp FPARG1 - |.if kind > 0 - | mov RB, ARG1 - |.endif - |.endif - |2: - |.endmacro - | - |.macro .ffunc_bit, name, kind - | .ffunc_bit name, kind, .ffunc_1 - |.endmacro - | - |.ffunc_bit bit_tobit, 0 - |.if DUALNUM or SSE - |.if not SSE - | mov RB, ARG1 - |.endif - | jmp ->fff_resbit - |.else - | fild ARG1 - | jmp ->fff_resn - |.endif - | - |.macro .ffunc_bit_op, name, ins - | .ffunc_bit name, 2 - | mov TMP2, NARGS:RD // Save for fallback. - | lea RD, [BASE+NARGS:RD*8-16] - |1: - | cmp RD, BASE - | jbe ->fff_resbit - | cmp dword [RD+4], LJ_TISNUM - |.if DUALNUM - | jne >2 - | ins RB, dword [RD] - | sub RD, 8 - | jmp <1 - |2: - | ja ->fff_fallback_bit_op - |.else - | jae ->fff_fallback_bit_op - |.endif - |.if SSE - | movsd xmm0, qword [RD] - | addsd xmm0, xmm1 - | movd RA, xmm0 - | ins RB, RA - |.else - | fld qword [RD] - | fadd TMP1 - | fstp FPARG1 - | ins RB, ARG1 - |.endif - | sub RD, 8 - | jmp <1 - |.endmacro - | - |.ffunc_bit_op bit_band, and - |.ffunc_bit_op bit_bor, or - |.ffunc_bit_op bit_bxor, xor - | - |.ffunc_bit bit_bswap, 1 - | bswap RB - | jmp ->fff_resbit - | - |.ffunc_bit bit_bnot, 1 - | not RB - |.if DUALNUM - | jmp ->fff_resbit - |.elif SSE - |->fff_resbit: - | cvtsi2sd xmm0, RB - | jmp ->fff_resxmm0 - |.else - |->fff_resbit: - | mov ARG1, RB - | fild ARG1 - | jmp ->fff_resn - |.endif - | - |->fff_fallback_bit_op: - | mov NARGS:RD, TMP2 // Restore for fallback - | jmp ->fff_fallback - | - |.macro .ffunc_bit_sh, name, ins - |.if DUALNUM - | .ffunc_bit name, 1, .ffunc_2 - | // Note: no inline conversion from number for 2nd argument! - | cmp dword [BASE+12], LJ_TISNUM; jne ->fff_fallback - | mov RA, dword [BASE+8] - |.elif SSE - | .ffunc_nnsse name - | sseconst_tobit xmm2, RBa - | addsd xmm0, xmm2 - | addsd xmm1, xmm2 - | movd RB, xmm0 - | movd RA, xmm1 - |.else - | .ffunc_nn name - | mov TMP1, TOBIT_BIAS - | fadd TMP1 - | fstp FPARG3 - | fadd TMP1 - | fstp FPARG1 - | mov RA, ARG3 - | mov RB, ARG1 - |.endif - | ins RB, cl // Assumes RA is ecx. - | jmp ->fff_resbit - |.endmacro - | - |.ffunc_bit_sh bit_lshift, shl - |.ffunc_bit_sh bit_rshift, shr - |.ffunc_bit_sh bit_arshift, sar - |.ffunc_bit_sh bit_rol, rol - |.ffunc_bit_sh bit_ror, ror - | - |//----------------------------------------------------------------------- - | - |->fff_fallback_2: - | mov NARGS:RD, 1+2 // Other args are ignored, anyway. - | jmp ->fff_fallback - |->fff_fallback_1: - | mov NARGS:RD, 1+1 // Other args are ignored, anyway. - |->fff_fallback: // Call fast function fallback handler. - | // BASE = new base, RD = nargs+1 - | mov L:RB, SAVE_L - | mov PC, [BASE-4] // Fallback may overwrite PC. - | mov SAVE_PC, PC // Redundant (but a defined value). - | mov L:RB->base, BASE - | lea RD, [BASE+NARGS:RD*8-8] - | lea RA, [RD+8*LUA_MINSTACK] // Ensure enough space for handler. - | mov L:RB->top, RD - | mov CFUNC:RD, [BASE-8] - | cmp RA, L:RB->maxstack - | ja >5 // Need to grow stack. - |.if X64 - | mov CARG1d, L:RB - |.else - | mov ARG1, L:RB - |.endif - | call aword CFUNC:RD->f // (lua_State *L) - | mov BASE, L:RB->base - | // Either throws an error, or recovers and returns -1, 0 or nresults+1. - | test RD, RD; jg ->fff_res // Returned nresults+1? - |1: - | mov RA, L:RB->top - | sub RA, BASE - | shr RA, 3 - | test RD, RD - | lea NARGS:RD, [RA+1] - | mov LFUNC:RB, [BASE-8] - | jne ->vm_call_tail // Returned -1? - | ins_callt // Returned 0: retry fast path. - | - |// Reconstruct previous base for vmeta_call during tailcall. - |->vm_call_tail: - | mov RA, BASE - | test PC, FRAME_TYPE - | jnz >3 - | movzx RB, PC_RA - | not RBa // Note: ~RB = -(RB+1) - | lea BASE, [BASE+RB*8] // base = base - (RB+1)*8 - | jmp ->vm_call_dispatch // Resolve again for tailcall. - |3: - | mov RB, PC - | and RB, -8 - | sub BASE, RB - | jmp ->vm_call_dispatch // Resolve again for tailcall. - | - |5: // Grow stack for fallback handler. - | mov FCARG2, LUA_MINSTACK - | mov FCARG1, L:RB - | call extern lj_state_growstack@8 // (lua_State *L, int n) - | mov BASE, L:RB->base - | xor RD, RD // Simulate a return 0. - | jmp <1 // Dumb retry (goes through ff first). - | - |->fff_gcstep: // Call GC step function. - | // BASE = new base, RD = nargs+1 - | pop RBa // Must keep stack at same level. - | mov TMPa, RBa // Save return address - | mov L:RB, SAVE_L - | mov SAVE_PC, PC // Redundant (but a defined value). - | mov L:RB->base, BASE - | lea RD, [BASE+NARGS:RD*8-8] - | mov FCARG1, L:RB - | mov L:RB->top, RD - | call extern lj_gc_step@4 // (lua_State *L) - | mov BASE, L:RB->base - | mov RD, L:RB->top - | sub RD, BASE - | shr RD, 3 - | add NARGS:RD, 1 - | mov RBa, TMPa - | push RBa // Restore return address. - | ret - | - |//----------------------------------------------------------------------- - |//-- Special dispatch targets ------------------------------------------- - |//----------------------------------------------------------------------- - | - |->vm_record: // Dispatch target for recording phase. - |.if JIT - | movzx RD, byte [DISPATCH+DISPATCH_GL(hookmask)] - | test RDL, HOOK_VMEVENT // No recording while in vmevent. - | jnz >5 - | // Decrement the hookcount for consistency, but always do the call. - | test RDL, HOOK_ACTIVE - | jnz >1 - | test RDL, LUA_MASKLINE|LUA_MASKCOUNT - | jz >1 - | dec dword [DISPATCH+DISPATCH_GL(hookcount)] - | jmp >1 - |.endif - | - |->vm_rethook: // Dispatch target for return hooks. - | movzx RD, byte [DISPATCH+DISPATCH_GL(hookmask)] - | test RDL, HOOK_ACTIVE // Hook already active? - | jnz >5 - | jmp >1 - | - |->vm_inshook: // Dispatch target for instr/line hooks. - | movzx RD, byte [DISPATCH+DISPATCH_GL(hookmask)] - | test RDL, HOOK_ACTIVE // Hook already active? - | jnz >5 - | - | test RDL, LUA_MASKLINE|LUA_MASKCOUNT - | jz >5 - | dec dword [DISPATCH+DISPATCH_GL(hookcount)] - | jz >1 - | test RDL, LUA_MASKLINE - | jz >5 - |1: - | mov L:RB, SAVE_L - | mov L:RB->base, BASE - | mov FCARG2, PC // Caveat: FCARG2 == BASE - | mov FCARG1, L:RB - | // SAVE_PC must hold the _previous_ PC. The callee updates it with PC. - | call extern lj_dispatch_ins@8 // (lua_State *L, BCIns *pc) - |3: - | mov BASE, L:RB->base - |4: - | movzx RA, PC_RA - |5: - | movzx OP, PC_OP - | movzx RD, PC_RD - |.if X64 - | jmp aword [DISPATCH+OP*8+GG_DISP2STATIC] // Re-dispatch to static ins. - |.else - | jmp aword [DISPATCH+OP*4+GG_DISP2STATIC] // Re-dispatch to static ins. - |.endif - | - |->cont_hook: // Continue from hook yield. - | add PC, 4 - | mov RA, [RB-24] - | mov MULTRES, RA // Restore MULTRES for *M ins. - | jmp <4 - | - |->vm_hotloop: // Hot loop counter underflow. - |.if JIT - | mov LFUNC:RB, [BASE-8] // Same as curr_topL(L). - | mov RB, LFUNC:RB->pc - | movzx RD, byte [RB+PC2PROTO(framesize)] - | lea RD, [BASE+RD*8] - | mov L:RB, SAVE_L - | mov L:RB->base, BASE - | mov L:RB->top, RD - | mov FCARG2, PC - | lea FCARG1, [DISPATCH+GG_DISP2J] - | mov aword [DISPATCH+DISPATCH_J(L)], L:RBa - | mov SAVE_PC, PC - | call extern lj_trace_hot@8 // (jit_State *J, const BCIns *pc) - | jmp <3 - |.endif - | - |->vm_callhook: // Dispatch target for call hooks. - | mov SAVE_PC, PC - |.if JIT - | jmp >1 - |.endif - | - |->vm_hotcall: // Hot call counter underflow. - |.if JIT - | mov SAVE_PC, PC - | or PC, 1 // Marker for hot call. - |1: - |.endif - | lea RD, [BASE+NARGS:RD*8-8] - | mov L:RB, SAVE_L - | mov L:RB->base, BASE - | mov L:RB->top, RD - | mov FCARG2, PC - | mov FCARG1, L:RB - | call extern lj_dispatch_call@8 // (lua_State *L, const BCIns *pc) - | // ASMFunction returned in eax/rax (RDa). - | mov SAVE_PC, 0 // Invalidate for subsequent line hook. - |.if JIT - | and PC, -2 - |.endif - | mov BASE, L:RB->base - | mov RAa, RDa - | mov RD, L:RB->top - | sub RD, BASE - | mov RBa, RAa - | movzx RA, PC_RA - | shr RD, 3 - | add NARGS:RD, 1 - | jmp RBa - | - |//----------------------------------------------------------------------- - |//-- Trace exit handler ------------------------------------------------- - |//----------------------------------------------------------------------- - | - |// Called from an exit stub with the exit number on the stack. - |// The 16 bit exit number is stored with two (sign-extended) push imm8. - |->vm_exit_handler: - |.if JIT - |.if X64 - | push r13; push r12 - | push r11; push r10; push r9; push r8 - | push rdi; push rsi; push rbp; lea rbp, [rsp+88]; push rbp - | push rbx; push rdx; push rcx; push rax - | movzx RC, byte [rbp-8] // Reconstruct exit number. - | mov RCH, byte [rbp-16] - | mov [rbp-8], r15; mov [rbp-16], r14 - |.else - | push ebp; lea ebp, [esp+12]; push ebp - | push ebx; push edx; push ecx; push eax - | movzx RC, byte [ebp-4] // Reconstruct exit number. - | mov RCH, byte [ebp-8] - | mov [ebp-4], edi; mov [ebp-8], esi - |.endif - | // Caveat: DISPATCH is ebx. - | mov DISPATCH, [ebp] - | mov RA, [DISPATCH+DISPATCH_GL(vmstate)] // Get trace number. - | set_vmstate EXIT - | mov [DISPATCH+DISPATCH_J(exitno)], RC - | mov [DISPATCH+DISPATCH_J(parent)], RA - |.if X64 - |.if X64WIN - | sub rsp, 16*8+4*8 // Room for SSE regs + save area. - |.else - | sub rsp, 16*8 // Room for SSE regs. - |.endif - | add rbp, -128 - | movsd qword [rbp-8], xmm15; movsd qword [rbp-16], xmm14 - | movsd qword [rbp-24], xmm13; movsd qword [rbp-32], xmm12 - | movsd qword [rbp-40], xmm11; movsd qword [rbp-48], xmm10 - | movsd qword [rbp-56], xmm9; movsd qword [rbp-64], xmm8 - | movsd qword [rbp-72], xmm7; movsd qword [rbp-80], xmm6 - | movsd qword [rbp-88], xmm5; movsd qword [rbp-96], xmm4 - | movsd qword [rbp-104], xmm3; movsd qword [rbp-112], xmm2 - | movsd qword [rbp-120], xmm1; movsd qword [rbp-128], xmm0 - |.else - | sub esp, 8*8+16 // Room for SSE regs + args. - | movsd qword [ebp-40], xmm7; movsd qword [ebp-48], xmm6 - | movsd qword [ebp-56], xmm5; movsd qword [ebp-64], xmm4 - | movsd qword [ebp-72], xmm3; movsd qword [ebp-80], xmm2 - | movsd qword [ebp-88], xmm1; movsd qword [ebp-96], xmm0 - |.endif - | // Caveat: RB is ebp. - | mov L:RB, [DISPATCH+DISPATCH_GL(jit_L)] - | mov BASE, [DISPATCH+DISPATCH_GL(jit_base)] - | mov aword [DISPATCH+DISPATCH_J(L)], L:RBa - | mov dword [DISPATCH+DISPATCH_GL(jit_L)], 0 - | mov L:RB->base, BASE - |.if X64WIN - | lea CARG2, [rsp+4*8] - |.elif X64 - | mov CARG2, rsp - |.else - | lea FCARG2, [esp+16] - |.endif - | lea FCARG1, [DISPATCH+GG_DISP2J] - | call extern lj_trace_exit@8 // (jit_State *J, ExitState *ex) - | // MULTRES or negated error code returned in eax (RD). - | mov RAa, L:RB->cframe - | and RAa, CFRAME_RAWMASK - |.if X64WIN - | // Reposition stack later. - |.elif X64 - | mov rsp, RAa // Reposition stack to C frame. - |.else - | mov esp, RAa // Reposition stack to C frame. - |.endif - | mov [RAa+CFRAME_OFS_L], L:RB // Set SAVE_L (on-trace resume/yield). - | mov BASE, L:RB->base - | mov PC, [RAa+CFRAME_OFS_PC] // Get SAVE_PC. - |.if X64 - | jmp >1 - |.endif - |.endif - |->vm_exit_interp: - | // RD = MULTRES or negated error code, BASE, PC and DISPATCH set. - |.if JIT - |.if X64 - | // Restore additional callee-save registers only used in compiled code. - |.if X64WIN - | lea RAa, [rsp+9*16+4*8] - |1: - | movdqa xmm15, [RAa-9*16] - | movdqa xmm14, [RAa-8*16] - | movdqa xmm13, [RAa-7*16] - | movdqa xmm12, [RAa-6*16] - | movdqa xmm11, [RAa-5*16] - | movdqa xmm10, [RAa-4*16] - | movdqa xmm9, [RAa-3*16] - | movdqa xmm8, [RAa-2*16] - | movdqa xmm7, [RAa-1*16] - | mov rsp, RAa // Reposition stack to C frame. - | movdqa xmm6, [RAa] - | mov r15, CSAVE_3 - | mov r14, CSAVE_4 - |.else - | add rsp, 16 // Reposition stack to C frame. - |1: - |.endif - | mov r13, TMPa - | mov r12, TMPQ - |.endif - | test RD, RD; js >3 // Check for error from exit. - | mov MULTRES, RD - | mov LFUNC:KBASE, [BASE-8] - | mov KBASE, LFUNC:KBASE->pc - | mov KBASE, [KBASE+PC2PROTO(k)] - | mov dword [DISPATCH+DISPATCH_GL(jit_L)], 0 - | set_vmstate INTERP - | // Modified copy of ins_next which handles function header dispatch, too. - | mov RC, [PC] - | movzx RA, RCH - | movzx OP, RCL - | add PC, 4 - | shr RC, 16 - | cmp OP, BC_FUNCF // Function header? - | jb >2 - | mov RC, MULTRES // RC/RD holds nres+1. - |2: - |.if X64 - | jmp aword [DISPATCH+OP*8] - |.else - | jmp aword [DISPATCH+OP*4] - |.endif - | - |3: // Rethrow error from the right C frame. - | neg RD - | mov FCARG1, L:RB - | mov FCARG2, RD - | call extern lj_err_throw@8 // (lua_State *L, int errcode) - |.endif - | - |//----------------------------------------------------------------------- - |//-- Math helper functions ---------------------------------------------- - |//----------------------------------------------------------------------- - | - |// FP value rounding. Called by math.floor/math.ceil fast functions - |// and from JIT code. - | - |// x87 variant: Arg/ret on x87 stack. No int/xmm registers modified. - |.macro vm_round_x87, mode1, mode2 - | fnstcw word [esp+4] // Caveat: overwrites ARG1 and ARG2. - | mov [esp+8], eax - | mov ax, mode1 - | or ax, [esp+4] - |.if mode2 ~= 0xffff - | and ax, mode2 - |.endif - | mov [esp+6], ax - | fldcw word [esp+6] - | frndint - | fldcw word [esp+4] - | mov eax, [esp+8] - | ret - |.endmacro - | - |// SSE variant: arg/ret is xmm0. xmm0-xmm3 and RD (eax) modified. - |.macro vm_round_sse, mode - | sseconst_abs xmm2, RDa - | sseconst_2p52 xmm3, RDa - | movaps xmm1, xmm0 - | andpd xmm1, xmm2 // |x| - | ucomisd xmm3, xmm1 // No truncation if 2^52 <= |x|. - | jbe >1 - | andnpd xmm2, xmm0 // Isolate sign bit. - |.if mode == 2 // trunc(x)? - | movaps xmm0, xmm1 - | addsd xmm1, xmm3 // (|x| + 2^52) - 2^52 - | subsd xmm1, xmm3 - | sseconst_1 xmm3, RDa - | cmpsd xmm0, xmm1, 1 // |x| < result? - | andpd xmm0, xmm3 - | subsd xmm1, xmm0 // If yes, subtract -1. - | orpd xmm1, xmm2 // Merge sign bit back in. - |.else - | addsd xmm1, xmm3 // (|x| + 2^52) - 2^52 - | subsd xmm1, xmm3 - | orpd xmm1, xmm2 // Merge sign bit back in. - | .if mode == 1 // ceil(x)? - | sseconst_m1 xmm2, RDa // Must subtract -1 to preserve -0. - | cmpsd xmm0, xmm1, 6 // x > result? - | .else // floor(x)? - | sseconst_1 xmm2, RDa - | cmpsd xmm0, xmm1, 1 // x < result? - | .endif - | andpd xmm0, xmm2 - | subsd xmm1, xmm0 // If yes, subtract +-1. - |.endif - | movaps xmm0, xmm1 - |1: - | ret - |.endmacro - | - |.macro vm_round, name, ssemode, mode1, mode2 - |->name: - |.if not SSE - | vm_round_x87 mode1, mode2 - |.endif - |->name .. _sse: - | vm_round_sse ssemode - |.endmacro - | - | vm_round vm_floor, 0, 0x0400, 0xf7ff - | vm_round vm_ceil, 1, 0x0800, 0xfbff - | vm_round vm_trunc, 2, 0x0c00, 0xffff - | - |// FP modulo x%y. Called by BC_MOD* and vm_arith. - |->vm_mod: - |.if SSE - |// Args in xmm0/xmm1, return value in xmm0. - |// Caveat: xmm0-xmm5 and RC (eax) modified! - | movaps xmm5, xmm0 - | divsd xmm0, xmm1 - | sseconst_abs xmm2, RDa - | sseconst_2p52 xmm3, RDa - | movaps xmm4, xmm0 - | andpd xmm4, xmm2 // |x/y| - | ucomisd xmm3, xmm4 // No truncation if 2^52 <= |x/y|. - | jbe >1 - | andnpd xmm2, xmm0 // Isolate sign bit. - | addsd xmm4, xmm3 // (|x/y| + 2^52) - 2^52 - | subsd xmm4, xmm3 - | orpd xmm4, xmm2 // Merge sign bit back in. - | sseconst_1 xmm2, RDa - | cmpsd xmm0, xmm4, 1 // x/y < result? - | andpd xmm0, xmm2 - | subsd xmm4, xmm0 // If yes, subtract 1.0. - | movaps xmm0, xmm5 - | mulsd xmm1, xmm4 - | subsd xmm0, xmm1 - | ret - |1: - | mulsd xmm1, xmm0 - | movaps xmm0, xmm5 - | subsd xmm0, xmm1 - | ret - |.else - |// Args/ret on x87 stack (y on top). No xmm registers modified. - |// Caveat: needs 3 slots on x87 stack! RC (eax) modified! - | fld st1 - | fdiv st1 - | fnstcw word [esp+4] - | mov ax, 0x0400 - | or ax, [esp+4] - | and ax, 0xf7ff - | mov [esp+6], ax - | fldcw word [esp+6] - | frndint - | fldcw word [esp+4] - | fmulp st1 - | fsubp st1 - | ret - |.endif - | - |// FP log2(x). Called by math.log(x, base). - |->vm_log2: - |.if X64WIN - | movsd qword [rsp+8], xmm0 // Use scratch area. - | fld1 - | fld qword [rsp+8] - | fyl2x - | fstp qword [rsp+8] - | movsd xmm0, qword [rsp+8] - |.elif X64 - | movsd qword [rsp-8], xmm0 // Use red zone. - | fld1 - | fld qword [rsp-8] - | fyl2x - | fstp qword [rsp-8] - | movsd xmm0, qword [rsp-8] - |.else - | fld1 - | fld qword [esp+4] - | fyl2x - |.endif - | ret - | - |// FP exponentiation e^x and 2^x. Called by math.exp fast function and - |// from JIT code. Arg/ret on x87 stack. No int/xmm regs modified. - |// Caveat: needs 3 slots on x87 stack! - |->vm_exp_x87: - | fldl2e; fmulp st1 // e^x ==> 2^(x*log2(e)) - |->vm_exp2_x87: - | .if X64WIN - | .define expscratch, dword [rsp+8] // Use scratch area. - | .elif X64 - | .define expscratch, dword [rsp-8] // Use red zone. - | .else - | .define expscratch, dword [esp+4] // Needs 4 byte scratch area. - | .endif - | fst expscratch // Caveat: overwrites ARG1. - | cmp expscratch, 0x7f800000; je >1 // Special case: e^+Inf = +Inf - | cmp expscratch, 0xff800000; je >2 // Special case: e^-Inf = 0 - |->vm_exp2raw: // Entry point for vm_pow. Without +-Inf check. - | fdup; frndint; fsub st1, st0; fxch // Split into frac/int part. - | f2xm1; fld1; faddp st1; fscale; fpop1 // ==> (2^frac-1 +1) << int - |1: - | ret - |2: - | fpop; fldz; ret - | - |// Generic power function x^y. Called by BC_POW, math.pow fast function, - |// and vm_arith. - |// Args/ret on x87 stack (y on top). RC (eax) modified. - |// Caveat: needs 3 slots on x87 stack! - |->vm_pow: - |.if not SSE - | fist dword [esp+4] // Store/reload int before comparison. - | fild dword [esp+4] // Integral exponent used in vm_powi. - | fucomip st1 - | jnz >8 // Branch for FP exponents. - | jp >9 // Branch for NaN exponent. - | fpop // Pop y and fallthrough to vm_powi. - | - |// FP/int power function x^i. Arg1/ret on x87 stack. - |// Arg2 (int) on C stack. RC (eax) modified. - |// Caveat: needs 2 slots on x87 stack! - | mov eax, [esp+4] - | cmp eax, 1; jle >6 // i<=1? - | // Now 1 < (unsigned)i <= 0x80000000. - |1: // Handle leading zeros. - | test eax, 1; jnz >2 - | fmul st0 - | shr eax, 1 - | jmp <1 - |2: - | shr eax, 1; jz >5 - | fdup - |3: // Handle trailing bits. - | fmul st0 - | shr eax, 1; jz >4 - | jnc <3 - | fmul st1, st0 - | jmp <3 - |4: - | fmulp st1 - |5: - | ret - |6: - | je <5 // x^1 ==> x - | jb >7 - | fld1; fdivrp st1 - | neg eax - | cmp eax, 1; je <5 // x^-1 ==> 1/x - | jmp <1 // x^-i ==> (1/x)^i - |7: - | fpop; fld1 // x^0 ==> 1 - | ret - | - |8: // FP/FP power function x^y. - | fst dword [esp+4] - | fxch - | fst dword [esp+8] - | mov eax, [esp+4]; shl eax, 1 - | cmp eax, 0xff000000; je >2 // x^+-Inf? - | mov eax, [esp+8]; shl eax, 1; je >4 // +-0^y? - | cmp eax, 0xff000000; je >4 // +-Inf^y? - | fyl2x - | jmp ->vm_exp2raw - | - |9: // Handle x^NaN. - | fld1 - | fucomip st2 - | je >1 // 1^NaN ==> 1 - | fxch // x^NaN ==> NaN - |1: - | fpop - | ret - | - |2: // Handle x^+-Inf. - | fabs - | fld1 - | fucomip st1 - | je >3 // +-1^+-Inf ==> 1 - | fpop; fabs; fldz; mov eax, 0; setc al - | ror eax, 1; xor eax, [esp+4]; jns >3 // |x|<>1, x^+-Inf ==> +Inf/0 - | fxch - |3: - | fpop1; fabs - | ret - | - |4: // Handle +-0^y or +-Inf^y. - | cmp dword [esp+4], 0; jge <3 // y >= 0, x^y ==> |x| - | fpop; fpop - | test eax, eax; jz >5 // y < 0, +-0^y ==> +Inf - | fldz // y < 0, +-Inf^y ==> 0 - | ret - |5: - | mov dword [esp+4], 0x7f800000 // Return +Inf. - | fld dword [esp+4] - | ret - |.endif - | - |// Args in xmm0/xmm1. Ret in xmm0. xmm0-xmm2 and RC (eax) modified. - |// Needs 16 byte scratch area for x86. Also called from JIT code. - |->vm_pow_sse: - | cvtsd2si eax, xmm1 - | cvtsi2sd xmm2, eax - | ucomisd xmm1, xmm2 - | jnz >8 // Branch for FP exponents. - | jp >9 // Branch for NaN exponent. - | // Fallthrough to vm_powi_sse. - | - |// Args in xmm0/eax. Ret in xmm0. xmm0-xmm1 and eax modified. - |->vm_powi_sse: - | cmp eax, 1; jle >6 // i<=1? - | // Now 1 < (unsigned)i <= 0x80000000. - |1: // Handle leading zeros. - | test eax, 1; jnz >2 - | mulsd xmm0, xmm0 - | shr eax, 1 - | jmp <1 - |2: - | shr eax, 1; jz >5 - | movaps xmm1, xmm0 - |3: // Handle trailing bits. - | mulsd xmm0, xmm0 - | shr eax, 1; jz >4 - | jnc <3 - | mulsd xmm1, xmm0 - | jmp <3 - |4: - | mulsd xmm0, xmm1 - |5: - | ret - |6: - | je <5 // x^1 ==> x - | jb >7 // x^0 ==> 1 - | neg eax - | call <1 - | sseconst_1 xmm1, RDa - | divsd xmm1, xmm0 - | movaps xmm0, xmm1 - | ret - |7: - | sseconst_1 xmm0, RDa - | ret - | - |8: // FP/FP power function x^y. - |.if X64 - | movd rax, xmm1; shl rax, 1 - | rol rax, 12; cmp rax, 0xffe; je >2 // x^+-Inf? - | movd rax, xmm0; shl rax, 1; je >4 // +-0^y? - | rol rax, 12; cmp rax, 0xffe; je >5 // +-Inf^y? - | .if X64WIN - | movsd qword [rsp+16], xmm1 // Use scratch area. - | movsd qword [rsp+8], xmm0 - | fld qword [rsp+16] - | fld qword [rsp+8] - | .else - | movsd qword [rsp-16], xmm1 // Use red zone. - | movsd qword [rsp-8], xmm0 - | fld qword [rsp-16] - | fld qword [rsp-8] - | .endif - |.else - | movsd qword [esp+12], xmm1 // Needs 16 byte scratch area. - | movsd qword [esp+4], xmm0 - | cmp dword [esp+12], 0; jne >1 - | mov eax, [esp+16]; shl eax, 1 - | cmp eax, 0xffe00000; je >2 // x^+-Inf? - |1: - | cmp dword [esp+4], 0; jne >1 - | mov eax, [esp+8]; shl eax, 1; je >4 // +-0^y? - | cmp eax, 0xffe00000; je >5 // +-Inf^y? - |1: - | fld qword [esp+12] - | fld qword [esp+4] - |.endif - | fyl2x // y*log2(x) - | fdup; frndint; fsub st1, st0; fxch // Split into frac/int part. - | f2xm1; fld1; faddp st1; fscale; fpop1 // ==> (2^frac-1 +1) << int - |.if X64WIN - | fstp qword [rsp+8] // Use scratch area. - | movsd xmm0, qword [rsp+8] - |.elif X64 - | fstp qword [rsp-8] // Use red zone. - | movsd xmm0, qword [rsp-8] - |.else - | fstp qword [esp+4] // Needs 8 byte scratch area. - | movsd xmm0, qword [esp+4] - |.endif - | ret - | - |9: // Handle x^NaN. - | sseconst_1 xmm2, RDa - | ucomisd xmm0, xmm2; je >1 // 1^NaN ==> 1 - | movaps xmm0, xmm1 // x^NaN ==> NaN - |1: - | ret - | - |2: // Handle x^+-Inf. - | sseconst_abs xmm2, RDa - | andpd xmm0, xmm2 // |x| - | sseconst_1 xmm2, RDa - | ucomisd xmm0, xmm2; je <1 // +-1^+-Inf ==> 1 - | movmskpd eax, xmm1 - | xorps xmm0, xmm0 - | mov ah, al; setc al; xor al, ah; jne <1 // |x|<>1, x^+-Inf ==> +Inf/0 - |3: - | sseconst_hi xmm0, RDa, 7ff00000 // +Inf - | ret - | - |4: // Handle +-0^y. - | movmskpd eax, xmm1; test eax, eax; jnz <3 // y < 0, +-0^y ==> +Inf - | xorps xmm0, xmm0 // y >= 0, +-0^y ==> 0 - | ret - | - |5: // Handle +-Inf^y. - | movmskpd eax, xmm1; test eax, eax; jz <3 // y >= 0, +-Inf^y ==> +Inf - | xorps xmm0, xmm0 // y < 0, +-Inf^y ==> 0 - | ret - | - |// Callable from C: double lj_vm_foldfpm(double x, int fpm) - |// Computes fpm(x) for extended math functions. ORDER FPM. - |->vm_foldfpm: - |.if JIT - |.if X64 - | .if X64WIN - | .define fpmop, CARG2d - | .else - | .define fpmop, CARG1d - | .endif - | cmp fpmop, 1; jb ->vm_floor; je ->vm_ceil - | cmp fpmop, 3; jb ->vm_trunc; ja >2 - | sqrtsd xmm0, xmm0; ret - |2: - | .if X64WIN - | movsd qword [rsp+8], xmm0 // Use scratch area. - | fld qword [rsp+8] - | .else - | movsd qword [rsp-8], xmm0 // Use red zone. - | fld qword [rsp-8] - | .endif - | cmp fpmop, 5; ja >2 - | .if X64WIN; pop rax; .endif - | je >1 - | call ->vm_exp_x87 - | .if X64WIN; push rax; .endif - | jmp >7 - |1: - | call ->vm_exp2_x87 - | .if X64WIN; push rax; .endif - | jmp >7 - |2: ; cmp fpmop, 7; je >1; ja >2 - | fldln2; fxch; fyl2x; jmp >7 - |1: ; fld1; fxch; fyl2x; jmp >7 - |2: ; cmp fpmop, 9; je >1; ja >2 - | fldlg2; fxch; fyl2x; jmp >7 - |1: ; fsin; jmp >7 - |2: ; cmp fpmop, 11; je >1; ja >9 - | fcos; jmp >7 - |1: ; fptan; fpop - |7: - | .if X64WIN - | fstp qword [rsp+8] // Use scratch area. - | movsd xmm0, qword [rsp+8] - | .else - | fstp qword [rsp-8] // Use red zone. - | movsd xmm0, qword [rsp-8] - | .endif - | ret - |.else // x86 calling convention. - | .define fpmop, eax - |.if SSE - | mov fpmop, [esp+12] - | movsd xmm0, qword [esp+4] - | cmp fpmop, 1; je >1; ja >2 - | call ->vm_floor; jmp >7 - |1: ; call ->vm_ceil; jmp >7 - |2: ; cmp fpmop, 3; je >1; ja >2 - | call ->vm_trunc; jmp >7 - |1: - | sqrtsd xmm0, xmm0 - |7: - | movsd qword [esp+4], xmm0 // Overwrite callee-owned args. - | fld qword [esp+4] - | ret - |2: ; fld qword [esp+4] - | cmp fpmop, 5; jb ->vm_exp_x87; je ->vm_exp2_x87 - |2: ; cmp fpmop, 7; je >1; ja >2 - | fldln2; fxch; fyl2x; ret - |1: ; fld1; fxch; fyl2x; ret - |2: ; cmp fpmop, 9; je >1; ja >2 - | fldlg2; fxch; fyl2x; ret - |1: ; fsin; ret - |2: ; cmp fpmop, 11; je >1; ja >9 - | fcos; ret - |1: ; fptan; fpop; ret - |.else - | mov fpmop, [esp+12] - | fld qword [esp+4] - | cmp fpmop, 1; jb ->vm_floor; je ->vm_ceil - | cmp fpmop, 3; jb ->vm_trunc; ja >2 - | fsqrt; ret - |2: ; cmp fpmop, 5; jb ->vm_exp_x87; je ->vm_exp2_x87 - | cmp fpmop, 7; je >1; ja >2 - | fldln2; fxch; fyl2x; ret - |1: ; fld1; fxch; fyl2x; ret - |2: ; cmp fpmop, 9; je >1; ja >2 - | fldlg2; fxch; fyl2x; ret - |1: ; fsin; ret - |2: ; cmp fpmop, 11; je >1; ja >9 - | fcos; ret - |1: ; fptan; fpop; ret - |.endif - |.endif - |9: ; int3 // Bad fpm. - |.endif - | - |// Callable from C: double lj_vm_foldarith(double x, double y, int op) - |// Compute x op y for basic arithmetic operators (+ - * / % ^ and unary -) - |// and basic math functions. ORDER ARITH - |->vm_foldarith: - |.if X64 - | - | .if X64WIN - | .define foldop, CARG3d - | .else - | .define foldop, CARG1d - | .endif - | cmp foldop, 1; je >1; ja >2 - | addsd xmm0, xmm1; ret - |1: ; subsd xmm0, xmm1; ret - |2: ; cmp foldop, 3; je >1; ja >2 - | mulsd xmm0, xmm1; ret - |1: ; divsd xmm0, xmm1; ret - |2: ; cmp foldop, 5; jb ->vm_mod; je ->vm_pow - | cmp foldop, 7; je >1; ja >2 - | sseconst_sign xmm1, RDa; xorps xmm0, xmm1; ret - |1: ; sseconst_abs xmm1, RDa; andps xmm0, xmm1; ret - |2: ; cmp foldop, 9; ja >2 - |.if X64WIN - | movsd qword [rsp+8], xmm0 // Use scratch area. - | movsd qword [rsp+16], xmm1 - | fld qword [rsp+8] - | fld qword [rsp+16] - |.else - | movsd qword [rsp-8], xmm0 // Use red zone. - | movsd qword [rsp-16], xmm1 - | fld qword [rsp-8] - | fld qword [rsp-16] - |.endif - | je >1 - | fpatan - |7: - |.if X64WIN - | fstp qword [rsp+8] // Use scratch area. - | movsd xmm0, qword [rsp+8] - |.else - | fstp qword [rsp-8] // Use red zone. - | movsd xmm0, qword [rsp-8] - |.endif - | ret - |1: ; fxch; fscale; fpop1; jmp <7 - |2: ; cmp foldop, 11; je >1; ja >9 - | minsd xmm0, xmm1; ret - |1: ; maxsd xmm0, xmm1; ret - |9: ; int3 // Bad op. - | - |.elif SSE // x86 calling convention with SSE ops. - | - | .define foldop, eax - | mov foldop, [esp+20] - | movsd xmm0, qword [esp+4] - | movsd xmm1, qword [esp+12] - | cmp foldop, 1; je >1; ja >2 - | addsd xmm0, xmm1 - |7: - | movsd qword [esp+4], xmm0 // Overwrite callee-owned args. - | fld qword [esp+4] - | ret - |1: ; subsd xmm0, xmm1; jmp <7 - |2: ; cmp foldop, 3; je >1; ja >2 - | mulsd xmm0, xmm1; jmp <7 - |1: ; divsd xmm0, xmm1; jmp <7 - |2: ; cmp foldop, 5 - | je >1; ja >2 - | call ->vm_mod; jmp <7 - |1: ; pop edx; call ->vm_pow; push edx; jmp <7 // Writes to scratch area. - |2: ; cmp foldop, 7; je >1; ja >2 - | sseconst_sign xmm1, RDa; xorps xmm0, xmm1; jmp <7 - |1: ; sseconst_abs xmm1, RDa; andps xmm0, xmm1; jmp <7 - |2: ; cmp foldop, 9; ja >2 - | fld qword [esp+4] // Reload from stack - | fld qword [esp+12] - | je >1 - | fpatan; ret - |1: ; fxch; fscale; fpop1; ret - |2: ; cmp foldop, 11; je >1; ja >9 - | minsd xmm0, xmm1; jmp <7 - |1: ; maxsd xmm0, xmm1; jmp <7 - |9: ; int3 // Bad op. - | - |.else // x86 calling convention with x87 ops. - | - | mov eax, [esp+20] - | fld qword [esp+4] - | fld qword [esp+12] - | cmp eax, 1; je >1; ja >2 - | faddp st1; ret - |1: ; fsubp st1; ret - |2: ; cmp eax, 3; je >1; ja >2 - | fmulp st1; ret - |1: ; fdivp st1; ret - |2: ; cmp eax, 5; jb ->vm_mod; je ->vm_pow - | cmp eax, 7; je >1; ja >2 - | fpop; fchs; ret - |1: ; fpop; fabs; ret - |2: ; cmp eax, 9; je >1; ja >2 - | fpatan; ret - |1: ; fxch; fscale; fpop1; ret - |2: ; cmp eax, 11; je >1; ja >9 - | fucomi st1; fcmovnbe st1; fpop1; ret - |1: ; fucomi st1; fcmovbe st1; fpop1; ret - |9: ; int3 // Bad op. - | - |.endif - | - |//----------------------------------------------------------------------- - |//-- Miscellaneous functions -------------------------------------------- - |//----------------------------------------------------------------------- - | - |// int lj_vm_cpuid(uint32_t f, uint32_t res[4]) - |->vm_cpuid: - |.if X64 - | mov eax, CARG1d - | .if X64WIN; push rsi; mov rsi, CARG2; .endif - | push rbx - | cpuid - | mov [rsi], eax - | mov [rsi+4], ebx - | mov [rsi+8], ecx - | mov [rsi+12], edx - | pop rbx - | .if X64WIN; pop rsi; .endif - | ret - |.else - | pushfd - | pop edx - | mov ecx, edx - | xor edx, 0x00200000 // Toggle ID bit in flags. - | push edx - | popfd - | pushfd - | pop edx - | xor eax, eax // Zero means no features supported. - | cmp ecx, edx - | jz >1 // No ID toggle means no CPUID support. - | mov eax, [esp+4] // Argument 1 is function number. - | push edi - | push ebx - | cpuid - | mov edi, [esp+16] // Argument 2 is result area. - | mov [edi], eax - | mov [edi+4], ebx - | mov [edi+8], ecx - | mov [edi+12], edx - | pop ebx - | pop edi - |1: - | ret - |.endif - | - |//----------------------------------------------------------------------- - |//-- Assertions --------------------------------------------------------- - |//----------------------------------------------------------------------- - | - |->assert_bad_for_arg_type: -#ifdef LUA_USE_ASSERT - | int3 -#endif - | int3 - | - |//----------------------------------------------------------------------- - |//-- FFI helper functions ----------------------------------------------- - |//----------------------------------------------------------------------- - | - |// Handler for callback functions. Callback slot number in ah/al. - |->vm_ffi_callback: - |.if FFI - |.type CTSTATE, CTState, PC - |.if not X64 - | sub esp, 16 // Leave room for SAVE_ERRF etc. - |.endif - | saveregs_ // ebp/rbp already saved. ebp now holds global_State *. - | lea DISPATCH, [ebp+GG_G2DISP] - | mov CTSTATE, GL:ebp->ctype_state - | movzx eax, ax - | mov CTSTATE->cb.slot, eax - |.if X64 - | mov CTSTATE->cb.gpr[0], CARG1 - | mov CTSTATE->cb.gpr[1], CARG2 - | mov CTSTATE->cb.gpr[2], CARG3 - | mov CTSTATE->cb.gpr[3], CARG4 - | movsd qword CTSTATE->cb.fpr[0], xmm0 - | movsd qword CTSTATE->cb.fpr[1], xmm1 - | movsd qword CTSTATE->cb.fpr[2], xmm2 - | movsd qword CTSTATE->cb.fpr[3], xmm3 - |.if X64WIN - | lea rax, [rsp+CFRAME_SIZE+4*8] - |.else - | lea rax, [rsp+CFRAME_SIZE] - | mov CTSTATE->cb.gpr[4], CARG5 - | mov CTSTATE->cb.gpr[5], CARG6 - | movsd qword CTSTATE->cb.fpr[4], xmm4 - | movsd qword CTSTATE->cb.fpr[5], xmm5 - | movsd qword CTSTATE->cb.fpr[6], xmm6 - | movsd qword CTSTATE->cb.fpr[7], xmm7 - |.endif - | mov CTSTATE->cb.stack, rax - | mov CARG2, rsp - |.else - | lea eax, [esp+CFRAME_SIZE+16] - | mov CTSTATE->cb.gpr[0], FCARG1 - | mov CTSTATE->cb.gpr[1], FCARG2 - | mov CTSTATE->cb.stack, eax - | mov FCARG1, [esp+CFRAME_SIZE+12] // Move around misplaced retaddr/ebp. - | mov FCARG2, [esp+CFRAME_SIZE+8] - | mov SAVE_RET, FCARG1 - | mov SAVE_R4, FCARG2 - | mov FCARG2, esp - |.endif - | mov SAVE_PC, CTSTATE // Any value outside of bytecode is ok. - | mov FCARG1, CTSTATE - | call extern lj_ccallback_enter@8 // (CTState *cts, void *cf) - | // lua_State * returned in eax (RD). - | set_vmstate INTERP - | mov BASE, L:RD->base - | mov RD, L:RD->top - | sub RD, BASE - | mov LFUNC:RB, [BASE-8] - | shr RD, 3 - | add RD, 1 - | ins_callt - |.endif - | - |->cont_ffi_callback: // Return from FFI callback. - |.if FFI - | mov L:RA, SAVE_L - | mov CTSTATE, [DISPATCH+DISPATCH_GL(ctype_state)] - | mov aword CTSTATE->L, L:RAa - | mov L:RA->base, BASE - | mov L:RA->top, RB - | mov FCARG1, CTSTATE - | mov FCARG2, RC - | call extern lj_ccallback_leave@8 // (CTState *cts, TValue *o) - |.if X64 - | mov rax, CTSTATE->cb.gpr[0] - | movsd xmm0, qword CTSTATE->cb.fpr[0] - | jmp ->vm_leave_unw - |.else - | mov L:RB, SAVE_L - | mov eax, CTSTATE->cb.gpr[0] - | mov edx, CTSTATE->cb.gpr[1] - | cmp dword CTSTATE->cb.gpr[2], 1 - | jb >7 - | je >6 - | fld qword CTSTATE->cb.fpr[0].d - | jmp >7 - |6: - | fld dword CTSTATE->cb.fpr[0].f - |7: - | mov ecx, L:RB->top - | movzx ecx, word [ecx+6] // Get stack adjustment and copy up. - | mov SAVE_L, ecx // Must be one slot above SAVE_RET - | restoreregs - | pop ecx // Move return addr from SAVE_RET. - | add esp, [esp] // Adjust stack. - | add esp, 16 - | push ecx - | ret - |.endif - |.endif - | - |->vm_ffi_call@4: // Call C function via FFI. - | // Caveat: needs special frame unwinding, see below. - |.if FFI - |.if X64 - | .type CCSTATE, CCallState, rbx - | push rbp; mov rbp, rsp; push rbx; mov CCSTATE, CARG1 - |.else - | .type CCSTATE, CCallState, ebx - | push ebp; mov ebp, esp; push ebx; mov CCSTATE, FCARG1 - |.endif - | - | // Readjust stack. - |.if X64 - | mov eax, CCSTATE->spadj - | sub rsp, rax - |.else - | sub esp, CCSTATE->spadj - |.if WIN - | mov CCSTATE->spadj, esp - |.endif - |.endif - | - | // Copy stack slots. - | movzx ecx, byte CCSTATE->nsp - | sub ecx, 1 - | js >2 - |1: - |.if X64 - | mov rax, [CCSTATE+rcx*8+offsetof(CCallState, stack)] - | mov [rsp+rcx*8+CCALL_SPS_EXTRA*8], rax - |.else - | mov eax, [CCSTATE+ecx*4+offsetof(CCallState, stack)] - | mov [esp+ecx*4], eax - |.endif - | sub ecx, 1 - | jns <1 - |2: - | - |.if X64 - | movzx eax, byte CCSTATE->nfpr - | mov CARG1, CCSTATE->gpr[0] - | mov CARG2, CCSTATE->gpr[1] - | mov CARG3, CCSTATE->gpr[2] - | mov CARG4, CCSTATE->gpr[3] - |.if not X64WIN - | mov CARG5, CCSTATE->gpr[4] - | mov CARG6, CCSTATE->gpr[5] - |.endif - | test eax, eax; jz >5 - | movaps xmm0, CCSTATE->fpr[0] - | movaps xmm1, CCSTATE->fpr[1] - | movaps xmm2, CCSTATE->fpr[2] - | movaps xmm3, CCSTATE->fpr[3] - |.if not X64WIN - | cmp eax, 4; jbe >5 - | movaps xmm4, CCSTATE->fpr[4] - | movaps xmm5, CCSTATE->fpr[5] - | movaps xmm6, CCSTATE->fpr[6] - | movaps xmm7, CCSTATE->fpr[7] - |.endif - |5: - |.else - | mov FCARG1, CCSTATE->gpr[0] - | mov FCARG2, CCSTATE->gpr[1] - |.endif - | - | call aword CCSTATE->func - | - |.if X64 - | mov CCSTATE->gpr[0], rax - | movaps CCSTATE->fpr[0], xmm0 - |.if not X64WIN - | mov CCSTATE->gpr[1], rdx - | movaps CCSTATE->fpr[1], xmm1 - |.endif - |.else - | mov CCSTATE->gpr[0], eax - | mov CCSTATE->gpr[1], edx - | cmp byte CCSTATE->resx87, 1 - | jb >7 - | je >6 - | fstp qword CCSTATE->fpr[0].d[0] - | jmp >7 - |6: - | fstp dword CCSTATE->fpr[0].f[0] - |7: - |.if WIN - | sub CCSTATE->spadj, esp - |.endif - |.endif - | - |.if X64 - | mov rbx, [rbp-8]; leave; ret - |.else - | mov ebx, [ebp-4]; leave; ret - |.endif - |.endif - |// Note: vm_ffi_call must be the last function in this object file! - | - |//----------------------------------------------------------------------- -} - -/* Generate the code for a single instruction. */ -static void build_ins(BuildCtx *ctx, BCOp op, int defop) -{ - int vk = 0; - |// Note: aligning all instructions does not pay off. - |=>defop: - - switch (op) { - - /* -- Comparison ops ---------------------------------------------------- */ - - /* Remember: all ops branch for a true comparison, fall through otherwise. */ - - |.macro jmp_comp, lt, ge, le, gt, target - ||switch (op) { - ||case BC_ISLT: - | lt target - ||break; - ||case BC_ISGE: - | ge target - ||break; - ||case BC_ISLE: - | le target - ||break; - ||case BC_ISGT: - | gt target - ||break; - ||default: break; /* Shut up GCC. */ - ||} - |.endmacro - - case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: - | // RA = src1, RD = src2, JMP with RD = target - | ins_AD - |.if DUALNUM - | checkint RA, >7 - | checkint RD, >8 - | mov RB, dword [BASE+RA*8] - | add PC, 4 - | cmp RB, dword [BASE+RD*8] - | jmp_comp jge, jl, jg, jle, >9 - |6: - | movzx RD, PC_RD - | branchPC RD - |9: - | ins_next - | - |7: // RA is not an integer. - | ja ->vmeta_comp - | // RA is a number. - | cmp dword [BASE+RD*8+4], LJ_TISNUM; jb >1; jne ->vmeta_comp - | // RA is a number, RD is an integer. - |.if SSE - | cvtsi2sd xmm0, dword [BASE+RD*8] - | jmp >2 - |.else - | fld qword [BASE+RA*8] - | fild dword [BASE+RD*8] - | jmp >3 - |.endif - | - |8: // RA is an integer, RD is not an integer. - | ja ->vmeta_comp - | // RA is an integer, RD is a number. - |.if SSE - | cvtsi2sd xmm1, dword [BASE+RA*8] - | movsd xmm0, qword [BASE+RD*8] - | add PC, 4 - | ucomisd xmm0, xmm1 - | jmp_comp jbe, ja, jb, jae, <9 - | jmp <6 - |.else - | fild dword [BASE+RA*8] - | jmp >2 - |.endif - |.else - | checknum RA, ->vmeta_comp - | checknum RD, ->vmeta_comp - |.endif - |.if SSE - |1: - | movsd xmm0, qword [BASE+RD*8] - |2: - | add PC, 4 - | ucomisd xmm0, qword [BASE+RA*8] - |3: - |.else - |1: - | fld qword [BASE+RA*8] // Reverse order, i.e like cmp D, A. - |2: - | fld qword [BASE+RD*8] - |3: - | add PC, 4 - | fcomparepp - |.endif - | // Unordered: all of ZF CF PF set, ordered: PF clear. - | // To preserve NaN semantics GE/GT branch on unordered, but LT/LE don't. - |.if DUALNUM - | jmp_comp jbe, ja, jb, jae, <9 - | jmp <6 - |.else - | jmp_comp jbe, ja, jb, jae, >1 - | movzx RD, PC_RD - | branchPC RD - |1: - | ins_next - |.endif - break; - - case BC_ISEQV: case BC_ISNEV: - vk = op == BC_ISEQV; - | ins_AD // RA = src1, RD = src2, JMP with RD = target - | mov RB, [BASE+RD*8+4] - | add PC, 4 - |.if DUALNUM - | cmp RB, LJ_TISNUM; jne >7 - | checkint RA, >8 - | mov RB, dword [BASE+RD*8] - | cmp RB, dword [BASE+RA*8] - if (vk) { - | jne >9 - } else { - | je >9 - } - | movzx RD, PC_RD - | branchPC RD - |9: - | ins_next - | - |7: // RD is not an integer. - | ja >5 - | // RD is a number. - | cmp dword [BASE+RA*8+4], LJ_TISNUM; jb >1; jne >5 - | // RD is a number, RA is an integer. - |.if SSE - | cvtsi2sd xmm0, dword [BASE+RA*8] - |.else - | fild dword [BASE+RA*8] - |.endif - | jmp >2 - | - |8: // RD is an integer, RA is not an integer. - | ja >5 - | // RD is an integer, RA is a number. - |.if SSE - | cvtsi2sd xmm0, dword [BASE+RD*8] - | ucomisd xmm0, qword [BASE+RA*8] - |.else - | fild dword [BASE+RD*8] - | fld qword [BASE+RA*8] - |.endif - | jmp >4 - | - |.else - | cmp RB, LJ_TISNUM; jae >5 - | checknum RA, >5 - |.endif - |.if SSE - |1: - | movsd xmm0, qword [BASE+RA*8] - |2: - | ucomisd xmm0, qword [BASE+RD*8] - |4: - |.else - |1: - | fld qword [BASE+RA*8] - |2: - | fld qword [BASE+RD*8] - |4: - | fcomparepp - |.endif - iseqne_fp: - if (vk) { - | jp >2 // Unordered means not equal. - | jne >2 - } else { - | jp >2 // Unordered means not equal. - | je >1 - } - iseqne_end: - if (vk) { - |1: // EQ: Branch to the target. - | movzx RD, PC_RD - | branchPC RD - |2: // NE: Fallthrough to next instruction. - |.if not FFI - |3: - |.endif - } else { - |.if not FFI - |3: - |.endif - |2: // NE: Branch to the target. - | movzx RD, PC_RD - | branchPC RD - |1: // EQ: Fallthrough to next instruction. - } - if (LJ_DUALNUM && (op == BC_ISEQV || op == BC_ISNEV || - op == BC_ISEQN || op == BC_ISNEN)) { - | jmp <9 - } else { - | ins_next - } - | - if (op == BC_ISEQV || op == BC_ISNEV) { - |5: // Either or both types are not numbers. - |.if FFI - | cmp RB, LJ_TCDATA; je ->vmeta_equal_cd - | checktp RA, LJ_TCDATA; je ->vmeta_equal_cd - |.endif - | checktp RA, RB // Compare types. - | jne <2 // Not the same type? - | cmp RB, LJ_TISPRI - | jae <1 // Same type and primitive type? - | - | // Same types and not a primitive type. Compare GCobj or pvalue. - | mov RA, [BASE+RA*8] - | mov RD, [BASE+RD*8] - | cmp RA, RD - | je <1 // Same GCobjs or pvalues? - | cmp RB, LJ_TISTABUD - | ja <2 // Different objects and not table/ud? - |.if X64 - | cmp RB, LJ_TUDATA // And not 64 bit lightuserdata. - | jb <2 - |.endif - | - | // Different tables or userdatas. Need to check __eq metamethod. - | // Field metatable must be at same offset for GCtab and GCudata! - | mov TAB:RB, TAB:RA->metatable - | test TAB:RB, TAB:RB - | jz <2 // No metatable? - | test byte TAB:RB->nomm, 1<vmeta_equal // Handle __eq metamethod. - } else { - |.if FFI - |3: - | cmp RB, LJ_TCDATA - if (LJ_DUALNUM && vk) { - | jne <9 - } else { - | jne <2 - } - | jmp ->vmeta_equal_cd - |.endif - } - break; - case BC_ISEQS: case BC_ISNES: - vk = op == BC_ISEQS; - | ins_AND // RA = src, RD = str const, JMP with RD = target - | mov RB, [BASE+RA*8+4] - | add PC, 4 - | cmp RB, LJ_TSTR; jne >3 - | mov RA, [BASE+RA*8] - | cmp RA, [KBASE+RD*4] - iseqne_test: - if (vk) { - | jne >2 - } else { - | je >1 - } - goto iseqne_end; - case BC_ISEQN: case BC_ISNEN: - vk = op == BC_ISEQN; - | ins_AD // RA = src, RD = num const, JMP with RD = target - | mov RB, [BASE+RA*8+4] - | add PC, 4 - |.if DUALNUM - | cmp RB, LJ_TISNUM; jne >7 - | cmp dword [KBASE+RD*8+4], LJ_TISNUM; jne >8 - | mov RB, dword [KBASE+RD*8] - | cmp RB, dword [BASE+RA*8] - if (vk) { - | jne >9 - } else { - | je >9 - } - | movzx RD, PC_RD - | branchPC RD - |9: - | ins_next - | - |7: // RA is not an integer. - | ja >3 - | // RA is a number. - | cmp dword [KBASE+RD*8+4], LJ_TISNUM; jb >1 - | // RA is a number, RD is an integer. - |.if SSE - | cvtsi2sd xmm0, dword [KBASE+RD*8] - |.else - | fild dword [KBASE+RD*8] - |.endif - | jmp >2 - | - |8: // RA is an integer, RD is a number. - |.if SSE - | cvtsi2sd xmm0, dword [BASE+RA*8] - | ucomisd xmm0, qword [KBASE+RD*8] - |.else - | fild dword [BASE+RA*8] - | fld qword [KBASE+RD*8] - |.endif - | jmp >4 - |.else - | cmp RB, LJ_TISNUM; jae >3 - |.endif - |.if SSE - |1: - | movsd xmm0, qword [KBASE+RD*8] - |2: - | ucomisd xmm0, qword [BASE+RA*8] - |4: - |.else - |1: - | fld qword [KBASE+RD*8] - |2: - | fld qword [BASE+RA*8] - |4: - | fcomparepp - |.endif - goto iseqne_fp; - case BC_ISEQP: case BC_ISNEP: - vk = op == BC_ISEQP; - | ins_AND // RA = src, RD = primitive type (~), JMP with RD = target - | mov RB, [BASE+RA*8+4] - | add PC, 4 - | cmp RB, RD - if (!LJ_HASFFI) goto iseqne_test; - if (vk) { - | jne >3 - | movzx RD, PC_RD - | branchPC RD - |2: - | ins_next - |3: - | cmp RB, LJ_TCDATA; jne <2 - | jmp ->vmeta_equal_cd - } else { - | je >2 - | cmp RB, LJ_TCDATA; je ->vmeta_equal_cd - | movzx RD, PC_RD - | branchPC RD - |2: - | ins_next - } - break; - - /* -- Unary test and copy ops ------------------------------------------- */ - - case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: - | ins_AD // RA = dst or unused, RD = src, JMP with RD = target - | mov RB, [BASE+RD*8+4] - | add PC, 4 - | cmp RB, LJ_TISTRUECOND - if (op == BC_IST || op == BC_ISTC) { - | jae >1 - } else { - | jb >1 - } - if (op == BC_ISTC || op == BC_ISFC) { - | mov [BASE+RA*8+4], RB - | mov RB, [BASE+RD*8] - | mov [BASE+RA*8], RB - } - | movzx RD, PC_RD - | branchPC RD - |1: // Fallthrough to the next instruction. - | ins_next - break; - - /* -- Unary ops --------------------------------------------------------- */ - - case BC_MOV: - | ins_AD // RA = dst, RD = src - |.if X64 - | mov RBa, [BASE+RD*8] - | mov [BASE+RA*8], RBa - |.else - | mov RB, [BASE+RD*8+4] - | mov RD, [BASE+RD*8] - | mov [BASE+RA*8+4], RB - | mov [BASE+RA*8], RD - |.endif - | ins_next_ - break; - case BC_NOT: - | ins_AD // RA = dst, RD = src - | xor RB, RB - | checktp RD, LJ_TISTRUECOND - | adc RB, LJ_TTRUE - | mov [BASE+RA*8+4], RB - | ins_next - break; - case BC_UNM: - | ins_AD // RA = dst, RD = src - |.if DUALNUM - | checkint RD, >5 - | mov RB, [BASE+RD*8] - | neg RB - | jo >4 - | mov dword [BASE+RA*8+4], LJ_TISNUM - | mov dword [BASE+RA*8], RB - |9: - | ins_next - |4: - | mov dword [BASE+RA*8+4], 0x41e00000 // 2^31. - | mov dword [BASE+RA*8], 0 - | jmp <9 - |5: - | ja ->vmeta_unm - |.else - | checknum RD, ->vmeta_unm - |.endif - |.if SSE - | movsd xmm0, qword [BASE+RD*8] - | sseconst_sign xmm1, RDa - | xorps xmm0, xmm1 - | movsd qword [BASE+RA*8], xmm0 - |.else - | fld qword [BASE+RD*8] - | fchs - | fstp qword [BASE+RA*8] - |.endif - |.if DUALNUM - | jmp <9 - |.else - | ins_next - |.endif - break; - case BC_LEN: - | ins_AD // RA = dst, RD = src - | checkstr RD, >2 - | mov STR:RD, [BASE+RD*8] - |.if DUALNUM - | mov RD, dword STR:RD->len - |1: - | mov dword [BASE+RA*8+4], LJ_TISNUM - | mov dword [BASE+RA*8], RD - |.elif SSE - | xorps xmm0, xmm0 - | cvtsi2sd xmm0, dword STR:RD->len - |1: - | movsd qword [BASE+RA*8], xmm0 - |.else - | fild dword STR:RD->len - |1: - | fstp qword [BASE+RA*8] - |.endif - | ins_next - |2: - | checktab RD, ->vmeta_len - | mov TAB:FCARG1, [BASE+RD*8] -#if LJ_52 - | mov TAB:RB, TAB:FCARG1->metatable - | cmp TAB:RB, 0 - | jnz >9 - |3: -#endif - |->BC_LEN_Z: - | mov RB, BASE // Save BASE. - | call extern lj_tab_len@4 // (GCtab *t) - | // Length of table returned in eax (RD). - |.if DUALNUM - | // Nothing to do. - |.elif SSE - | cvtsi2sd xmm0, RD - |.else - | mov ARG1, RD - | fild ARG1 - |.endif - | mov BASE, RB // Restore BASE. - | movzx RA, PC_RA - | jmp <1 -#if LJ_52 - |9: // Check for __len. - | test byte TAB:RB->nomm, 1<vmeta_len // 'no __len' flag NOT set: check. -#endif - break; - - /* -- Binary ops -------------------------------------------------------- */ - - |.macro ins_arithpre, x87ins, sseins, ssereg - | ins_ABC - ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); - ||switch (vk) { - ||case 0: - | checknum RB, ->vmeta_arith_vn - | .if DUALNUM - | cmp dword [KBASE+RC*8+4], LJ_TISNUM; jae ->vmeta_arith_vn - | .endif - | .if SSE - | movsd xmm0, qword [BASE+RB*8] - | sseins ssereg, qword [KBASE+RC*8] - | .else - | fld qword [BASE+RB*8] - | x87ins qword [KBASE+RC*8] - | .endif - || break; - ||case 1: - | checknum RB, ->vmeta_arith_nv - | .if DUALNUM - | cmp dword [KBASE+RC*8+4], LJ_TISNUM; jae ->vmeta_arith_nv - | .endif - | .if SSE - | movsd xmm0, qword [KBASE+RC*8] - | sseins ssereg, qword [BASE+RB*8] - | .else - | fld qword [KBASE+RC*8] - | x87ins qword [BASE+RB*8] - | .endif - || break; - ||default: - | checknum RB, ->vmeta_arith_vv - | checknum RC, ->vmeta_arith_vv - | .if SSE - | movsd xmm0, qword [BASE+RB*8] - | sseins ssereg, qword [BASE+RC*8] - | .else - | fld qword [BASE+RB*8] - | x87ins qword [BASE+RC*8] - | .endif - || break; - ||} - |.endmacro - | - |.macro ins_arithdn, intins - | ins_ABC - ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); - ||switch (vk) { - ||case 0: - | checkint RB, ->vmeta_arith_vn - | cmp dword [KBASE+RC*8+4], LJ_TISNUM; jne ->vmeta_arith_vn - | mov RB, [BASE+RB*8] - | intins RB, [KBASE+RC*8]; jo ->vmeta_arith_vno - || break; - ||case 1: - | checkint RB, ->vmeta_arith_nv - | cmp dword [KBASE+RC*8+4], LJ_TISNUM; jne ->vmeta_arith_nv - | mov RC, [KBASE+RC*8] - | intins RC, [BASE+RB*8]; jo ->vmeta_arith_nvo - || break; - ||default: - | checkint RB, ->vmeta_arith_vv - | checkint RC, ->vmeta_arith_vv - | mov RB, [BASE+RB*8] - | intins RB, [BASE+RC*8]; jo ->vmeta_arith_vvo - || break; - ||} - | mov dword [BASE+RA*8+4], LJ_TISNUM - ||if (vk == 1) { - | mov dword [BASE+RA*8], RC - ||} else { - | mov dword [BASE+RA*8], RB - ||} - | ins_next - |.endmacro - | - |.macro ins_arithpost - |.if SSE - | movsd qword [BASE+RA*8], xmm0 - |.else - | fstp qword [BASE+RA*8] - |.endif - |.endmacro - | - |.macro ins_arith, x87ins, sseins - | ins_arithpre x87ins, sseins, xmm0 - | ins_arithpost - | ins_next - |.endmacro - | - |.macro ins_arith, intins, x87ins, sseins - |.if DUALNUM - | ins_arithdn intins - |.else - | ins_arith, x87ins, sseins - |.endif - |.endmacro - - | // RA = dst, RB = src1 or num const, RC = src2 or num const - case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: - | ins_arith add, fadd, addsd - break; - case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: - | ins_arith sub, fsub, subsd - break; - case BC_MULVN: case BC_MULNV: case BC_MULVV: - | ins_arith imul, fmul, mulsd - break; - case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: - | ins_arith fdiv, divsd - break; - case BC_MODVN: - | ins_arithpre fld, movsd, xmm1 - |->BC_MODVN_Z: - | call ->vm_mod - | ins_arithpost - | ins_next - break; - case BC_MODNV: case BC_MODVV: - | ins_arithpre fld, movsd, xmm1 - | jmp ->BC_MODVN_Z // Avoid 3 copies. It's slow anyway. - break; - case BC_POW: - | ins_arithpre fld, movsd, xmm1 - | call ->vm_pow - | ins_arithpost - | ins_next - break; - - case BC_CAT: - | ins_ABC // RA = dst, RB = src_start, RC = src_end - |.if X64 - | mov L:CARG1d, SAVE_L - | mov L:CARG1d->base, BASE - | lea CARG2d, [BASE+RC*8] - | mov CARG3d, RC - | sub CARG3d, RB - |->BC_CAT_Z: - | mov L:RB, L:CARG1d - |.else - | lea RA, [BASE+RC*8] - | sub RC, RB - | mov ARG2, RA - | mov ARG3, RC - |->BC_CAT_Z: - | mov L:RB, SAVE_L - | mov ARG1, L:RB - | mov L:RB->base, BASE - |.endif - | mov SAVE_PC, PC - | call extern lj_meta_cat // (lua_State *L, TValue *top, int left) - | // NULL (finished) or TValue * (metamethod) returned in eax (RC). - | mov BASE, L:RB->base - | test RC, RC - | jnz ->vmeta_binop - | movzx RB, PC_RB // Copy result to Stk[RA] from Stk[RB]. - | movzx RA, PC_RA - |.if X64 - | mov RCa, [BASE+RB*8] - | mov [BASE+RA*8], RCa - |.else - | mov RC, [BASE+RB*8+4] - | mov RB, [BASE+RB*8] - | mov [BASE+RA*8+4], RC - | mov [BASE+RA*8], RB - |.endif - | ins_next - break; - - /* -- Constant ops ------------------------------------------------------ */ - - case BC_KSTR: - | ins_AND // RA = dst, RD = str const (~) - | mov RD, [KBASE+RD*4] - | mov dword [BASE+RA*8+4], LJ_TSTR - | mov [BASE+RA*8], RD - | ins_next - break; - case BC_KCDATA: - |.if FFI - | ins_AND // RA = dst, RD = cdata const (~) - | mov RD, [KBASE+RD*4] - | mov dword [BASE+RA*8+4], LJ_TCDATA - | mov [BASE+RA*8], RD - | ins_next - |.endif - break; - case BC_KSHORT: - | ins_AD // RA = dst, RD = signed int16 literal - |.if DUALNUM - | movsx RD, RDW - | mov dword [BASE+RA*8+4], LJ_TISNUM - | mov dword [BASE+RA*8], RD - |.elif SSE - | movsx RD, RDW // Sign-extend literal. - | cvtsi2sd xmm0, RD - | movsd qword [BASE+RA*8], xmm0 - |.else - | fild PC_RD // Refetch signed RD from instruction. - | fstp qword [BASE+RA*8] - |.endif - | ins_next - break; - case BC_KNUM: - | ins_AD // RA = dst, RD = num const - |.if SSE - | movsd xmm0, qword [KBASE+RD*8] - | movsd qword [BASE+RA*8], xmm0 - |.else - | fld qword [KBASE+RD*8] - | fstp qword [BASE+RA*8] - |.endif - | ins_next - break; - case BC_KPRI: - | ins_AND // RA = dst, RD = primitive type (~) - | mov [BASE+RA*8+4], RD - | ins_next - break; - case BC_KNIL: - | ins_AD // RA = dst_start, RD = dst_end - | lea RA, [BASE+RA*8+12] - | lea RD, [BASE+RD*8+4] - | mov RB, LJ_TNIL - | mov [RA-8], RB // Sets minimum 2 slots. - |1: - | mov [RA], RB - | add RA, 8 - | cmp RA, RD - | jbe <1 - | ins_next - break; - - /* -- Upvalue and function ops ------------------------------------------ */ - - case BC_UGET: - | ins_AD // RA = dst, RD = upvalue # - | mov LFUNC:RB, [BASE-8] - | mov UPVAL:RB, [LFUNC:RB+RD*4+offsetof(GCfuncL, uvptr)] - | mov RB, UPVAL:RB->v - |.if X64 - | mov RDa, [RB] - | mov [BASE+RA*8], RDa - |.else - | mov RD, [RB+4] - | mov RB, [RB] - | mov [BASE+RA*8+4], RD - | mov [BASE+RA*8], RB - |.endif - | ins_next - break; - case BC_USETV: -#define TV2MARKOFS \ - ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)) - | ins_AD // RA = upvalue #, RD = src - | mov LFUNC:RB, [BASE-8] - | mov UPVAL:RB, [LFUNC:RB+RA*4+offsetof(GCfuncL, uvptr)] - | cmp byte UPVAL:RB->closed, 0 - | mov RB, UPVAL:RB->v - | mov RA, [BASE+RD*8] - | mov RD, [BASE+RD*8+4] - | mov [RB], RA - | mov [RB+4], RD - | jz >1 - | // Check barrier for closed upvalue. - | test byte [RB+TV2MARKOFS], LJ_GC_BLACK // isblack(uv) - | jnz >2 - |1: - | ins_next - | - |2: // Upvalue is black. Check if new value is collectable and white. - | sub RD, LJ_TISGCV - | cmp RD, LJ_TNUMX - LJ_TISGCV // tvisgcv(v) - | jbe <1 - | test byte GCOBJ:RA->gch.marked, LJ_GC_WHITES // iswhite(v) - | jz <1 - | // Crossed a write barrier. Move the barrier forward. - |.if X64 and not X64WIN - | mov FCARG2, RB - | mov RB, BASE // Save BASE. - |.else - | xchg FCARG2, RB // Save BASE (FCARG2 == BASE). - |.endif - | lea GL:FCARG1, [DISPATCH+GG_DISP2G] - | call extern lj_gc_barrieruv@8 // (global_State *g, TValue *tv) - | mov BASE, RB // Restore BASE. - | jmp <1 - break; -#undef TV2MARKOFS - case BC_USETS: - | ins_AND // RA = upvalue #, RD = str const (~) - | mov LFUNC:RB, [BASE-8] - | mov UPVAL:RB, [LFUNC:RB+RA*4+offsetof(GCfuncL, uvptr)] - | mov GCOBJ:RA, [KBASE+RD*4] - | mov RD, UPVAL:RB->v - | mov [RD], GCOBJ:RA - | mov dword [RD+4], LJ_TSTR - | test byte UPVAL:RB->marked, LJ_GC_BLACK // isblack(uv) - | jnz >2 - |1: - | ins_next - | - |2: // Check if string is white and ensure upvalue is closed. - | test byte GCOBJ:RA->gch.marked, LJ_GC_WHITES // iswhite(str) - | jz <1 - | cmp byte UPVAL:RB->closed, 0 - | jz <1 - | // Crossed a write barrier. Move the barrier forward. - | mov RB, BASE // Save BASE (FCARG2 == BASE). - | mov FCARG2, RD - | lea GL:FCARG1, [DISPATCH+GG_DISP2G] - | call extern lj_gc_barrieruv@8 // (global_State *g, TValue *tv) - | mov BASE, RB // Restore BASE. - | jmp <1 - break; - case BC_USETN: - | ins_AD // RA = upvalue #, RD = num const - | mov LFUNC:RB, [BASE-8] - |.if SSE - | movsd xmm0, qword [KBASE+RD*8] - |.else - | fld qword [KBASE+RD*8] - |.endif - | mov UPVAL:RB, [LFUNC:RB+RA*4+offsetof(GCfuncL, uvptr)] - | mov RA, UPVAL:RB->v - |.if SSE - | movsd qword [RA], xmm0 - |.else - | fstp qword [RA] - |.endif - | ins_next - break; - case BC_USETP: - | ins_AND // RA = upvalue #, RD = primitive type (~) - | mov LFUNC:RB, [BASE-8] - | mov UPVAL:RB, [LFUNC:RB+RA*4+offsetof(GCfuncL, uvptr)] - | mov RA, UPVAL:RB->v - | mov [RA+4], RD - | ins_next - break; - case BC_UCLO: - | ins_AD // RA = level, RD = target - | branchPC RD // Do this first to free RD. - | mov L:RB, SAVE_L - | cmp dword L:RB->openupval, 0 - | je >1 - | mov L:RB->base, BASE - | lea FCARG2, [BASE+RA*8] // Caveat: FCARG2 == BASE - | mov L:FCARG1, L:RB // Caveat: FCARG1 == RA - | call extern lj_func_closeuv@8 // (lua_State *L, TValue *level) - | mov BASE, L:RB->base - |1: - | ins_next - break; - - case BC_FNEW: - | ins_AND // RA = dst, RD = proto const (~) (holding function prototype) - |.if X64 - | mov L:RB, SAVE_L - | mov L:RB->base, BASE // Caveat: CARG2d/CARG3d may be BASE. - | mov CARG3d, [BASE-8] - | mov CARG2d, [KBASE+RD*4] // Fetch GCproto *. - | mov CARG1d, L:RB - |.else - | mov LFUNC:RA, [BASE-8] - | mov PROTO:RD, [KBASE+RD*4] // Fetch GCproto *. - | mov L:RB, SAVE_L - | mov ARG3, LFUNC:RA - | mov ARG2, PROTO:RD - | mov ARG1, L:RB - | mov L:RB->base, BASE - |.endif - | mov SAVE_PC, PC - | // (lua_State *L, GCproto *pt, GCfuncL *parent) - | call extern lj_func_newL_gc - | // GCfuncL * returned in eax (RC). - | mov BASE, L:RB->base - | movzx RA, PC_RA - | mov [BASE+RA*8], LFUNC:RC - | mov dword [BASE+RA*8+4], LJ_TFUNC - | ins_next - break; - - /* -- Table ops --------------------------------------------------------- */ - - case BC_TNEW: - | ins_AD // RA = dst, RD = hbits|asize - | mov L:RB, SAVE_L - | mov L:RB->base, BASE - | mov RA, [DISPATCH+DISPATCH_GL(gc.total)] - | cmp RA, [DISPATCH+DISPATCH_GL(gc.threshold)] - | mov SAVE_PC, PC - | jae >5 - |1: - |.if X64 - | mov CARG3d, RD - | and RD, 0x7ff - | shr CARG3d, 11 - |.else - | mov RA, RD - | and RD, 0x7ff - | shr RA, 11 - | mov ARG3, RA - |.endif - | cmp RD, 0x7ff - | je >3 - |2: - |.if X64 - | mov L:CARG1d, L:RB - | mov CARG2d, RD - |.else - | mov ARG1, L:RB - | mov ARG2, RD - |.endif - | call extern lj_tab_new // (lua_State *L, int32_t asize, uint32_t hbits) - | // Table * returned in eax (RC). - | mov BASE, L:RB->base - | movzx RA, PC_RA - | mov [BASE+RA*8], TAB:RC - | mov dword [BASE+RA*8+4], LJ_TTAB - | ins_next - |3: // Turn 0x7ff into 0x801. - | mov RD, 0x801 - | jmp <2 - |5: - | mov L:FCARG1, L:RB - | call extern lj_gc_step_fixtop@4 // (lua_State *L) - | movzx RD, PC_RD - | jmp <1 - break; - case BC_TDUP: - | ins_AND // RA = dst, RD = table const (~) (holding template table) - | mov L:RB, SAVE_L - | mov RA, [DISPATCH+DISPATCH_GL(gc.total)] - | mov SAVE_PC, PC - | cmp RA, [DISPATCH+DISPATCH_GL(gc.threshold)] - | mov L:RB->base, BASE - | jae >3 - |2: - | mov TAB:FCARG2, [KBASE+RD*4] // Caveat: FCARG2 == BASE - | mov L:FCARG1, L:RB // Caveat: FCARG1 == RA - | call extern lj_tab_dup@8 // (lua_State *L, Table *kt) - | // Table * returned in eax (RC). - | mov BASE, L:RB->base - | movzx RA, PC_RA - | mov [BASE+RA*8], TAB:RC - | mov dword [BASE+RA*8+4], LJ_TTAB - | ins_next - |3: - | mov L:FCARG1, L:RB - | call extern lj_gc_step_fixtop@4 // (lua_State *L) - | movzx RD, PC_RD // Need to reload RD. - | not RDa - | jmp <2 - break; - - case BC_GGET: - | ins_AND // RA = dst, RD = str const (~) - | mov LFUNC:RB, [BASE-8] - | mov TAB:RB, LFUNC:RB->env - | mov STR:RC, [KBASE+RD*4] - | jmp ->BC_TGETS_Z - break; - case BC_GSET: - | ins_AND // RA = src, RD = str const (~) - | mov LFUNC:RB, [BASE-8] - | mov TAB:RB, LFUNC:RB->env - | mov STR:RC, [KBASE+RD*4] - | jmp ->BC_TSETS_Z - break; - - case BC_TGETV: - | ins_ABC // RA = dst, RB = table, RC = key - | checktab RB, ->vmeta_tgetv - | mov TAB:RB, [BASE+RB*8] - | - | // Integer key? - |.if DUALNUM - | checkint RC, >5 - | mov RC, dword [BASE+RC*8] - |.else - | // Convert number to int and back and compare. - | checknum RC, >5 - |.if SSE - | movsd xmm0, qword [BASE+RC*8] - | cvtsd2si RC, xmm0 - | cvtsi2sd xmm1, RC - | ucomisd xmm0, xmm1 - |.else - | fld qword [BASE+RC*8] - | fist ARG1 - | fild ARG1 - | fcomparepp - | mov RC, ARG1 - |.endif - | jne ->vmeta_tgetv // Generic numeric key? Use fallback. - |.endif - | cmp RC, TAB:RB->asize // Takes care of unordered, too. - | jae ->vmeta_tgetv // Not in array part? Use fallback. - | shl RC, 3 - | add RC, TAB:RB->array - | cmp dword [RC+4], LJ_TNIL // Avoid overwriting RB in fastpath. - | je >2 - | // Get array slot. - |.if X64 - | mov RBa, [RC] - | mov [BASE+RA*8], RBa - |.else - | mov RB, [RC] - | mov RC, [RC+4] - | mov [BASE+RA*8], RB - | mov [BASE+RA*8+4], RC - |.endif - |1: - | ins_next - | - |2: // Check for __index if table value is nil. - | cmp dword TAB:RB->metatable, 0 // Shouldn't overwrite RA for fastpath. - | jz >3 - | mov TAB:RA, TAB:RB->metatable - | test byte TAB:RA->nomm, 1<vmeta_tgetv // 'no __index' flag NOT set: check. - | movzx RA, PC_RA // Restore RA. - |3: - | mov dword [BASE+RA*8+4], LJ_TNIL - | jmp <1 - | - |5: // String key? - | checkstr RC, ->vmeta_tgetv - | mov STR:RC, [BASE+RC*8] - | jmp ->BC_TGETS_Z - break; - case BC_TGETS: - | ins_ABC // RA = dst, RB = table, RC = str const (~) - | not RCa - | mov STR:RC, [KBASE+RC*4] - | checktab RB, ->vmeta_tgets - | mov TAB:RB, [BASE+RB*8] - |->BC_TGETS_Z: // RB = GCtab *, RC = GCstr *, refetches PC_RA. - | mov RA, TAB:RB->hmask - | and RA, STR:RC->hash - | imul RA, #NODE - | add NODE:RA, TAB:RB->node - |1: - | cmp dword NODE:RA->key.it, LJ_TSTR - | jne >4 - | cmp dword NODE:RA->key.gcr, STR:RC - | jne >4 - | // Ok, key found. Assumes: offsetof(Node, val) == 0 - | cmp dword [RA+4], LJ_TNIL // Avoid overwriting RB in fastpath. - | je >5 // Key found, but nil value? - | movzx RC, PC_RA - | // Get node value. - |.if X64 - | mov RBa, [RA] - | mov [BASE+RC*8], RBa - |.else - | mov RB, [RA] - | mov RA, [RA+4] - | mov [BASE+RC*8], RB - | mov [BASE+RC*8+4], RA - |.endif - |2: - | ins_next - | - |3: - | movzx RC, PC_RA - | mov dword [BASE+RC*8+4], LJ_TNIL - | jmp <2 - | - |4: // Follow hash chain. - | mov NODE:RA, NODE:RA->next - | test NODE:RA, NODE:RA - | jnz <1 - | // End of hash chain: key not found, nil result. - | - |5: // Check for __index if table value is nil. - | mov TAB:RA, TAB:RB->metatable - | test TAB:RA, TAB:RA - | jz <3 // No metatable: done. - | test byte TAB:RA->nomm, 1<vmeta_tgets // Caveat: preserve STR:RC. - break; - case BC_TGETB: - | ins_ABC // RA = dst, RB = table, RC = byte literal - | checktab RB, ->vmeta_tgetb - | mov TAB:RB, [BASE+RB*8] - | cmp RC, TAB:RB->asize - | jae ->vmeta_tgetb - | shl RC, 3 - | add RC, TAB:RB->array - | cmp dword [RC+4], LJ_TNIL // Avoid overwriting RB in fastpath. - | je >2 - | // Get array slot. - |.if X64 - | mov RBa, [RC] - | mov [BASE+RA*8], RBa - |.else - | mov RB, [RC] - | mov RC, [RC+4] - | mov [BASE+RA*8], RB - | mov [BASE+RA*8+4], RC - |.endif - |1: - | ins_next - | - |2: // Check for __index if table value is nil. - | cmp dword TAB:RB->metatable, 0 // Shouldn't overwrite RA for fastpath. - | jz >3 - | mov TAB:RA, TAB:RB->metatable - | test byte TAB:RA->nomm, 1<vmeta_tgetb // 'no __index' flag NOT set: check. - | movzx RA, PC_RA // Restore RA. - |3: - | mov dword [BASE+RA*8+4], LJ_TNIL - | jmp <1 - break; - - case BC_TSETV: - | ins_ABC // RA = src, RB = table, RC = key - | checktab RB, ->vmeta_tsetv - | mov TAB:RB, [BASE+RB*8] - | - | // Integer key? - |.if DUALNUM - | checkint RC, >5 - | mov RC, dword [BASE+RC*8] - |.else - | // Convert number to int and back and compare. - | checknum RC, >5 - |.if SSE - | movsd xmm0, qword [BASE+RC*8] - | cvtsd2si RC, xmm0 - | cvtsi2sd xmm1, RC - | ucomisd xmm0, xmm1 - |.else - | fld qword [BASE+RC*8] - | fist ARG1 - | fild ARG1 - | fcomparepp - | mov RC, ARG1 - |.endif - | jne ->vmeta_tsetv // Generic numeric key? Use fallback. - |.endif - | cmp RC, TAB:RB->asize // Takes care of unordered, too. - | jae ->vmeta_tsetv - | shl RC, 3 - | add RC, TAB:RB->array - | cmp dword [RC+4], LJ_TNIL - | je >3 // Previous value is nil? - |1: - | test byte TAB:RB->marked, LJ_GC_BLACK // isblack(table) - | jnz >7 - |2: // Set array slot. - |.if X64 - | mov RBa, [BASE+RA*8] - | mov [RC], RBa - |.else - | mov RB, [BASE+RA*8+4] - | mov RA, [BASE+RA*8] - | mov [RC+4], RB - | mov [RC], RA - |.endif - | ins_next - | - |3: // Check for __newindex if previous value is nil. - | cmp dword TAB:RB->metatable, 0 // Shouldn't overwrite RA for fastpath. - | jz <1 - | mov TAB:RA, TAB:RB->metatable - | test byte TAB:RA->nomm, 1<vmeta_tsetv // 'no __newindex' flag NOT set: check. - | movzx RA, PC_RA // Restore RA. - | jmp <1 - | - |5: // String key? - | checkstr RC, ->vmeta_tsetv - | mov STR:RC, [BASE+RC*8] - | jmp ->BC_TSETS_Z - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, RA - | movzx RA, PC_RA // Restore RA. - | jmp <2 - break; - case BC_TSETS: - | ins_ABC // RA = src, RB = table, RC = str const (~) - | not RCa - | mov STR:RC, [KBASE+RC*4] - | checktab RB, ->vmeta_tsets - | mov TAB:RB, [BASE+RB*8] - |->BC_TSETS_Z: // RB = GCtab *, RC = GCstr *, refetches PC_RA. - | mov RA, TAB:RB->hmask - | and RA, STR:RC->hash - | imul RA, #NODE - | mov byte TAB:RB->nomm, 0 // Clear metamethod cache. - | add NODE:RA, TAB:RB->node - |1: - | cmp dword NODE:RA->key.it, LJ_TSTR - | jne >5 - | cmp dword NODE:RA->key.gcr, STR:RC - | jne >5 - | // Ok, key found. Assumes: offsetof(Node, val) == 0 - | cmp dword [RA+4], LJ_TNIL - | je >4 // Previous value is nil? - |2: - | test byte TAB:RB->marked, LJ_GC_BLACK // isblack(table) - | jnz >7 - |3: // Set node value. - | movzx RC, PC_RA - |.if X64 - | mov RBa, [BASE+RC*8] - | mov [RA], RBa - |.else - | mov RB, [BASE+RC*8+4] - | mov RC, [BASE+RC*8] - | mov [RA+4], RB - | mov [RA], RC - |.endif - | ins_next - | - |4: // Check for __newindex if previous value is nil. - | cmp dword TAB:RB->metatable, 0 // Shouldn't overwrite RA for fastpath. - | jz <2 - | mov TMP1, RA // Save RA. - | mov TAB:RA, TAB:RB->metatable - | test byte TAB:RA->nomm, 1<vmeta_tsets // 'no __newindex' flag NOT set: check. - | mov RA, TMP1 // Restore RA. - | jmp <2 - | - |5: // Follow hash chain. - | mov NODE:RA, NODE:RA->next - | test NODE:RA, NODE:RA - | jnz <1 - | // End of hash chain: key not found, add a new one. - | - | // But check for __newindex first. - | mov TAB:RA, TAB:RB->metatable - | test TAB:RA, TAB:RA - | jz >6 // No metatable: continue. - | test byte TAB:RA->nomm, 1<vmeta_tsets // 'no __newindex' flag NOT set: check. - |6: - | mov TMP1, STR:RC - | mov TMP2, LJ_TSTR - | mov TMP3, TAB:RB // Save TAB:RB for us. - |.if X64 - | mov L:CARG1d, SAVE_L - | mov L:CARG1d->base, BASE - | lea CARG3, TMP1 - | mov CARG2d, TAB:RB - | mov L:RB, L:CARG1d - |.else - | lea RC, TMP1 // Store temp. TValue in TMP1/TMP2. - | mov ARG2, TAB:RB - | mov L:RB, SAVE_L - | mov ARG3, RC - | mov ARG1, L:RB - | mov L:RB->base, BASE - |.endif - | mov SAVE_PC, PC - | call extern lj_tab_newkey // (lua_State *L, GCtab *t, TValue *k) - | // Handles write barrier for the new key. TValue * returned in eax (RC). - | mov BASE, L:RB->base - | mov TAB:RB, TMP3 // Need TAB:RB for barrier. - | mov RA, eax - | jmp <2 // Must check write barrier for value. - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, RC // Destroys STR:RC. - | jmp <3 - break; - case BC_TSETB: - | ins_ABC // RA = src, RB = table, RC = byte literal - | checktab RB, ->vmeta_tsetb - | mov TAB:RB, [BASE+RB*8] - | cmp RC, TAB:RB->asize - | jae ->vmeta_tsetb - | shl RC, 3 - | add RC, TAB:RB->array - | cmp dword [RC+4], LJ_TNIL - | je >3 // Previous value is nil? - |1: - | test byte TAB:RB->marked, LJ_GC_BLACK // isblack(table) - | jnz >7 - |2: // Set array slot. - |.if X64 - | mov RAa, [BASE+RA*8] - | mov [RC], RAa - |.else - | mov RB, [BASE+RA*8+4] - | mov RA, [BASE+RA*8] - | mov [RC+4], RB - | mov [RC], RA - |.endif - | ins_next - | - |3: // Check for __newindex if previous value is nil. - | cmp dword TAB:RB->metatable, 0 // Shouldn't overwrite RA for fastpath. - | jz <1 - | mov TAB:RA, TAB:RB->metatable - | test byte TAB:RA->nomm, 1<vmeta_tsetb // 'no __newindex' flag NOT set: check. - | movzx RA, PC_RA // Restore RA. - | jmp <1 - | - |7: // Possible table write barrier for the value. Skip valiswhite check. - | barrierback TAB:RB, RA - | movzx RA, PC_RA // Restore RA. - | jmp <2 - break; - - case BC_TSETM: - | ins_AD // RA = base (table at base-1), RD = num const (start index) - | mov TMP1, KBASE // Need one more free register. - | mov KBASE, dword [KBASE+RD*8] // Integer constant is in lo-word. - |1: - | lea RA, [BASE+RA*8] - | mov TAB:RB, [RA-8] // Guaranteed to be a table. - | test byte TAB:RB->marked, LJ_GC_BLACK // isblack(table) - | jnz >7 - |2: - | mov RD, MULTRES - | sub RD, 1 - | jz >4 // Nothing to copy? - | add RD, KBASE // Compute needed size. - | cmp RD, TAB:RB->asize - | ja >5 // Doesn't fit into array part? - | sub RD, KBASE - | shl KBASE, 3 - | add KBASE, TAB:RB->array - |3: // Copy result slots to table. - |.if X64 - | mov RBa, [RA] - | add RA, 8 - | mov [KBASE], RBa - |.else - | mov RB, [RA] - | mov [KBASE], RB - | mov RB, [RA+4] - | add RA, 8 - | mov [KBASE+4], RB - |.endif - | add KBASE, 8 - | sub RD, 1 - | jnz <3 - |4: - | mov KBASE, TMP1 - | ins_next - | - |5: // Need to resize array part. - |.if X64 - | mov L:CARG1d, SAVE_L - | mov L:CARG1d->base, BASE // Caveat: CARG2d/CARG3d may be BASE. - | mov CARG2d, TAB:RB - | mov CARG3d, RD - | mov L:RB, L:CARG1d - |.else - | mov ARG2, TAB:RB - | mov L:RB, SAVE_L - | mov L:RB->base, BASE - | mov ARG3, RD - | mov ARG1, L:RB - |.endif - | mov SAVE_PC, PC - | call extern lj_tab_reasize // (lua_State *L, GCtab *t, int nasize) - | mov BASE, L:RB->base - | movzx RA, PC_RA // Restore RA. - | jmp <1 // Retry. - | - |7: // Possible table write barrier for any value. Skip valiswhite check. - | barrierback TAB:RB, RD - | jmp <2 - break; - - /* -- Calls and vararg handling ----------------------------------------- */ - - case BC_CALL: case BC_CALLM: - | ins_A_C // RA = base, (RB = nresults+1,) RC = nargs+1 | extra_nargs - if (op == BC_CALLM) { - | add NARGS:RD, MULTRES - } - | cmp dword [BASE+RA*8+4], LJ_TFUNC - | mov LFUNC:RB, [BASE+RA*8] - | jne ->vmeta_call_ra - | lea BASE, [BASE+RA*8+8] - | ins_call - break; - - case BC_CALLMT: - | ins_AD // RA = base, RD = extra_nargs - | add NARGS:RD, MULTRES - | // Fall through. Assumes BC_CALLT follows and ins_AD is a no-op. - break; - case BC_CALLT: - | ins_AD // RA = base, RD = nargs+1 - | lea RA, [BASE+RA*8+8] - | mov KBASE, BASE // Use KBASE for move + vmeta_call hint. - | mov LFUNC:RB, [RA-8] - | cmp dword [RA-4], LJ_TFUNC - | jne ->vmeta_call - |->BC_CALLT_Z: - | mov PC, [BASE-4] - | test PC, FRAME_TYPE - | jnz >7 - |1: - | mov [BASE-8], LFUNC:RB // Copy function down, reloaded below. - | mov MULTRES, NARGS:RD - | sub NARGS:RD, 1 - | jz >3 - |2: // Move args down. - |.if X64 - | mov RBa, [RA] - | add RA, 8 - | mov [KBASE], RBa - |.else - | mov RB, [RA] - | mov [KBASE], RB - | mov RB, [RA+4] - | add RA, 8 - | mov [KBASE+4], RB - |.endif - | add KBASE, 8 - | sub NARGS:RD, 1 - | jnz <2 - | - | mov LFUNC:RB, [BASE-8] - |3: - | mov NARGS:RD, MULTRES - | cmp byte LFUNC:RB->ffid, 1 // (> FF_C) Calling a fast function? - | ja >5 - |4: - | ins_callt - | - |5: // Tailcall to a fast function. - | test PC, FRAME_TYPE // Lua frame below? - | jnz <4 - | movzx RA, PC_RA - | not RAa - | mov LFUNC:KBASE, [BASE+RA*8-8] // Need to prepare KBASE. - | mov KBASE, LFUNC:KBASE->pc - | mov KBASE, [KBASE+PC2PROTO(k)] - | jmp <4 - | - |7: // Tailcall from a vararg function. - | sub PC, FRAME_VARG - | test PC, FRAME_TYPEP - | jnz >8 // Vararg frame below? - | sub BASE, PC // Need to relocate BASE/KBASE down. - | mov KBASE, BASE - | mov PC, [BASE-4] - | jmp <1 - |8: - | add PC, FRAME_VARG - | jmp <1 - break; - - case BC_ITERC: - | ins_A // RA = base, (RB = nresults+1,) RC = nargs+1 (2+1) - | lea RA, [BASE+RA*8+8] // fb = base+1 - |.if X64 - | mov RBa, [RA-24] // Copy state. fb[0] = fb[-3]. - | mov RCa, [RA-16] // Copy control var. fb[1] = fb[-2]. - | mov [RA], RBa - | mov [RA+8], RCa - |.else - | mov RB, [RA-24] // Copy state. fb[0] = fb[-3]. - | mov RC, [RA-20] - | mov [RA], RB - | mov [RA+4], RC - | mov RB, [RA-16] // Copy control var. fb[1] = fb[-2]. - | mov RC, [RA-12] - | mov [RA+8], RB - | mov [RA+12], RC - |.endif - | mov LFUNC:RB, [RA-32] // Copy callable. fb[-1] = fb[-4] - | mov RC, [RA-28] - | mov [RA-8], LFUNC:RB - | mov [RA-4], RC - | cmp RC, LJ_TFUNC // Handle like a regular 2-arg call. - | mov NARGS:RD, 2+1 - | jne ->vmeta_call - | mov BASE, RA - | ins_call - break; - - case BC_ITERN: - | ins_A // RA = base, (RB = nresults+1, RC = nargs+1 (2+1)) - |.if JIT - | // NYI: add hotloop, record BC_ITERN. - |.endif - | mov TMP1, KBASE // Need two more free registers. - | mov TMP2, DISPATCH - | mov TAB:RB, [BASE+RA*8-16] - | mov RC, [BASE+RA*8-8] // Get index from control var. - | mov DISPATCH, TAB:RB->asize - | add PC, 4 - | mov KBASE, TAB:RB->array - |1: // Traverse array part. - | cmp RC, DISPATCH; jae >5 // Index points after array part? - | cmp dword [KBASE+RC*8+4], LJ_TNIL; je >4 - |.if DUALNUM - | mov dword [BASE+RA*8+4], LJ_TISNUM - | mov dword [BASE+RA*8], RC - |.elif SSE - | cvtsi2sd xmm0, RC - |.else - | fild dword [BASE+RA*8-8] - |.endif - | // Copy array slot to returned value. - |.if X64 - | mov RBa, [KBASE+RC*8] - | mov [BASE+RA*8+8], RBa - |.else - | mov RB, [KBASE+RC*8+4] - | mov [BASE+RA*8+12], RB - | mov RB, [KBASE+RC*8] - | mov [BASE+RA*8+8], RB - |.endif - | add RC, 1 - | // Return array index as a numeric key. - |.if DUALNUM - | // See above. - |.elif SSE - | movsd qword [BASE+RA*8], xmm0 - |.else - | fstp qword [BASE+RA*8] - |.endif - | mov [BASE+RA*8-8], RC // Update control var. - |2: - | movzx RD, PC_RD // Get target from ITERL. - | branchPC RD - |3: - | mov DISPATCH, TMP2 - | mov KBASE, TMP1 - | ins_next - | - |4: // Skip holes in array part. - | add RC, 1 - |.if not (DUALNUM or SSE) - | mov [BASE+RA*8-8], RC - |.endif - | jmp <1 - | - |5: // Traverse hash part. - | sub RC, DISPATCH - |6: - | cmp RC, TAB:RB->hmask; ja <3 // End of iteration? Branch to ITERL+1. - | imul KBASE, RC, #NODE - | add NODE:KBASE, TAB:RB->node - | cmp dword NODE:KBASE->val.it, LJ_TNIL; je >7 - | lea DISPATCH, [RC+DISPATCH+1] - | // Copy key and value from hash slot. - |.if X64 - | mov RBa, NODE:KBASE->key - | mov RCa, NODE:KBASE->val - | mov [BASE+RA*8], RBa - | mov [BASE+RA*8+8], RCa - |.else - | mov RB, NODE:KBASE->key.gcr - | mov RC, NODE:KBASE->key.it - | mov [BASE+RA*8], RB - | mov [BASE+RA*8+4], RC - | mov RB, NODE:KBASE->val.gcr - | mov RC, NODE:KBASE->val.it - | mov [BASE+RA*8+8], RB - | mov [BASE+RA*8+12], RC - |.endif - | mov [BASE+RA*8-8], DISPATCH - | jmp <2 - | - |7: // Skip holes in hash part. - | add RC, 1 - | jmp <6 - break; - - case BC_ISNEXT: - | ins_AD // RA = base, RD = target (points to ITERN) - | cmp dword [BASE+RA*8-20], LJ_TFUNC; jne >5 - | mov CFUNC:RB, [BASE+RA*8-24] - | cmp dword [BASE+RA*8-12], LJ_TTAB; jne >5 - | cmp dword [BASE+RA*8-4], LJ_TNIL; jne >5 - | cmp byte CFUNC:RB->ffid, FF_next_N; jne >5 - | branchPC RD - | mov dword [BASE+RA*8-8], 0 // Initialize control var. - | mov dword [BASE+RA*8-4], 0xfffe7fff - |1: - | ins_next - |5: // Despecialize bytecode if any of the checks fail. - | mov PC_OP, BC_JMP - | branchPC RD - | mov byte [PC], BC_ITERC - | jmp <1 - break; - - case BC_VARG: - | ins_ABC // RA = base, RB = nresults+1, RC = numparams - | mov TMP1, KBASE // Need one more free register. - | lea KBASE, [BASE+RC*8+(8+FRAME_VARG)] - | lea RA, [BASE+RA*8] - | sub KBASE, [BASE-4] - | // Note: KBASE may now be even _above_ BASE if nargs was < numparams. - | test RB, RB - | jz >5 // Copy all varargs? - | lea RB, [RA+RB*8-8] - | cmp KBASE, BASE // No vararg slots? - | jnb >2 - |1: // Copy vararg slots to destination slots. - |.if X64 - | mov RCa, [KBASE-8] - | add KBASE, 8 - | mov [RA], RCa - |.else - | mov RC, [KBASE-8] - | mov [RA], RC - | mov RC, [KBASE-4] - | add KBASE, 8 - | mov [RA+4], RC - |.endif - | add RA, 8 - | cmp RA, RB // All destination slots filled? - | jnb >3 - | cmp KBASE, BASE // No more vararg slots? - | jb <1 - |2: // Fill up remainder with nil. - | mov dword [RA+4], LJ_TNIL - | add RA, 8 - | cmp RA, RB - | jb <2 - |3: - | mov KBASE, TMP1 - | ins_next - | - |5: // Copy all varargs. - | mov MULTRES, 1 // MULTRES = 0+1 - | mov RC, BASE - | sub RC, KBASE - | jbe <3 // No vararg slots? - | mov RB, RC - | shr RB, 3 - | add RB, 1 - | mov MULTRES, RB // MULTRES = #varargs+1 - | mov L:RB, SAVE_L - | add RC, RA - | cmp RC, L:RB->maxstack - | ja >7 // Need to grow stack? - |6: // Copy all vararg slots. - |.if X64 - | mov RCa, [KBASE-8] - | add KBASE, 8 - | mov [RA], RCa - |.else - | mov RC, [KBASE-8] - | mov [RA], RC - | mov RC, [KBASE-4] - | add KBASE, 8 - | mov [RA+4], RC - |.endif - | add RA, 8 - | cmp KBASE, BASE // No more vararg slots? - | jb <6 - | jmp <3 - | - |7: // Grow stack for varargs. - | mov L:RB->base, BASE - | mov L:RB->top, RA - | mov SAVE_PC, PC - | sub KBASE, BASE // Need delta, because BASE may change. - | mov FCARG2, MULTRES - | sub FCARG2, 1 - | mov FCARG1, L:RB - | call extern lj_state_growstack@8 // (lua_State *L, int n) - | mov BASE, L:RB->base - | mov RA, L:RB->top - | add KBASE, BASE - | jmp <6 - break; - - /* -- Returns ----------------------------------------------------------- */ - - case BC_RETM: - | ins_AD // RA = results, RD = extra_nresults - | add RD, MULTRES // MULTRES >=1, so RD >=1. - | // Fall through. Assumes BC_RET follows and ins_AD is a no-op. - break; - - case BC_RET: case BC_RET0: case BC_RET1: - | ins_AD // RA = results, RD = nresults+1 - if (op != BC_RET0) { - | shl RA, 3 - } - |1: - | mov PC, [BASE-4] - | mov MULTRES, RD // Save nresults+1. - | test PC, FRAME_TYPE // Check frame type marker. - | jnz >7 // Not returning to a fixarg Lua func? - switch (op) { - case BC_RET: - |->BC_RET_Z: - | mov KBASE, BASE // Use KBASE for result move. - | sub RD, 1 - | jz >3 - |2: // Move results down. - |.if X64 - | mov RBa, [KBASE+RA] - | mov [KBASE-8], RBa - |.else - | mov RB, [KBASE+RA] - | mov [KBASE-8], RB - | mov RB, [KBASE+RA+4] - | mov [KBASE-4], RB - |.endif - | add KBASE, 8 - | sub RD, 1 - | jnz <2 - |3: - | mov RD, MULTRES // Note: MULTRES may be >255. - | movzx RB, PC_RB // So cannot compare with RDL! - |5: - | cmp RB, RD // More results expected? - | ja >6 - break; - case BC_RET1: - |.if X64 - | mov RBa, [BASE+RA] - | mov [BASE-8], RBa - |.else - | mov RB, [BASE+RA+4] - | mov [BASE-4], RB - | mov RB, [BASE+RA] - | mov [BASE-8], RB - |.endif - /* fallthrough */ - case BC_RET0: - |5: - | cmp PC_RB, RDL // More results expected? - | ja >6 - default: - break; - } - | movzx RA, PC_RA - | not RAa // Note: ~RA = -(RA+1) - | lea BASE, [BASE+RA*8] // base = base - (RA+1)*8 - | mov LFUNC:KBASE, [BASE-8] - | mov KBASE, LFUNC:KBASE->pc - | mov KBASE, [KBASE+PC2PROTO(k)] - | ins_next - | - |6: // Fill up results with nil. - if (op == BC_RET) { - | mov dword [KBASE-4], LJ_TNIL // Note: relies on shifted base. - | add KBASE, 8 - } else { - | mov dword [BASE+RD*8-12], LJ_TNIL - } - | add RD, 1 - | jmp <5 - | - |7: // Non-standard return case. - | lea RB, [PC-FRAME_VARG] - | test RB, FRAME_TYPEP - | jnz ->vm_return - | // Return from vararg function: relocate BASE down and RA up. - | sub BASE, RB - if (op != BC_RET0) { - | add RA, RB - } - | jmp <1 - break; - - /* -- Loops and branches ------------------------------------------------ */ - - |.define FOR_IDX, [RA]; .define FOR_TIDX, dword [RA+4] - |.define FOR_STOP, [RA+8]; .define FOR_TSTOP, dword [RA+12] - |.define FOR_STEP, [RA+16]; .define FOR_TSTEP, dword [RA+20] - |.define FOR_EXT, [RA+24]; .define FOR_TEXT, dword [RA+28] - - case BC_FORL: - |.if JIT - | hotloop RB - |.endif - | // Fall through. Assumes BC_IFORL follows and ins_AJ is a no-op. - break; - - case BC_JFORI: - case BC_JFORL: -#if !LJ_HASJIT - break; -#endif - case BC_FORI: - case BC_IFORL: - vk = (op == BC_IFORL || op == BC_JFORL); - | ins_AJ // RA = base, RD = target (after end of loop or start of loop) - | lea RA, [BASE+RA*8] - if (LJ_DUALNUM) { - | cmp FOR_TIDX, LJ_TISNUM; jne >9 - if (!vk) { - | cmp FOR_TSTOP, LJ_TISNUM; jne ->vmeta_for - | cmp FOR_TSTEP, LJ_TISNUM; jne ->vmeta_for - | mov RB, dword FOR_IDX - | cmp dword FOR_STEP, 0; jl >5 - } else { -#ifdef LUA_USE_ASSERT - | cmp FOR_TSTOP, LJ_TISNUM; jne ->assert_bad_for_arg_type - | cmp FOR_TSTEP, LJ_TISNUM; jne ->assert_bad_for_arg_type -#endif - | mov RB, dword FOR_STEP - | test RB, RB; js >5 - | add RB, dword FOR_IDX; jo >1 - | mov dword FOR_IDX, RB - } - | cmp RB, dword FOR_STOP - | mov FOR_TEXT, LJ_TISNUM - | mov dword FOR_EXT, RB - if (op == BC_FORI) { - | jle >7 - |1: - |6: - | branchPC RD - } else if (op == BC_JFORI) { - | branchPC RD - | movzx RD, PC_RD - | jle =>BC_JLOOP - |1: - |6: - } else if (op == BC_IFORL) { - | jg >7 - |6: - | branchPC RD - |1: - } else { - | jle =>BC_JLOOP - |1: - |6: - } - |7: - | ins_next - | - |5: // Invert check for negative step. - if (vk) { - | add RB, dword FOR_IDX; jo <1 - | mov dword FOR_IDX, RB - } - | cmp RB, dword FOR_STOP - | mov FOR_TEXT, LJ_TISNUM - | mov dword FOR_EXT, RB - if (op == BC_FORI) { - | jge <7 - } else if (op == BC_JFORI) { - | branchPC RD - | movzx RD, PC_RD - | jge =>BC_JLOOP - } else if (op == BC_IFORL) { - | jl <7 - } else { - | jge =>BC_JLOOP - } - | jmp <6 - |9: // Fallback to FP variant. - } else if (!vk) { - | cmp FOR_TIDX, LJ_TISNUM - } - if (!vk) { - | jae ->vmeta_for - | cmp FOR_TSTOP, LJ_TISNUM; jae ->vmeta_for - } else { -#ifdef LUA_USE_ASSERT - | cmp FOR_TSTOP, LJ_TISNUM; jae ->assert_bad_for_arg_type - | cmp FOR_TSTEP, LJ_TISNUM; jae ->assert_bad_for_arg_type -#endif - } - | mov RB, FOR_TSTEP // Load type/hiword of for step. - if (!vk) { - | cmp RB, LJ_TISNUM; jae ->vmeta_for - } - |.if SSE - | movsd xmm0, qword FOR_IDX - | movsd xmm1, qword FOR_STOP - if (vk) { - | addsd xmm0, qword FOR_STEP - | movsd qword FOR_IDX, xmm0 - | test RB, RB; js >3 - } else { - | jl >3 - } - | ucomisd xmm1, xmm0 - |1: - | movsd qword FOR_EXT, xmm0 - |.else - | fld qword FOR_STOP - | fld qword FOR_IDX - if (vk) { - | fadd qword FOR_STEP // nidx = idx + step - | fst qword FOR_IDX - | fst qword FOR_EXT - | test RB, RB; js >1 - } else { - | fst qword FOR_EXT - | jl >1 - } - | fxch // Swap lim/(n)idx if step non-negative. - |1: - | fcomparepp - |.endif - if (op == BC_FORI) { - |.if DUALNUM - | jnb <7 - |.else - | jnb >2 - | branchPC RD - |.endif - } else if (op == BC_JFORI) { - | branchPC RD - | movzx RD, PC_RD - | jnb =>BC_JLOOP - } else if (op == BC_IFORL) { - |.if DUALNUM - | jb <7 - |.else - | jb >2 - | branchPC RD - |.endif - } else { - | jnb =>BC_JLOOP - } - |.if DUALNUM - | jmp <6 - |.else - |2: - | ins_next - |.endif - |.if SSE - |3: // Invert comparison if step is negative. - | ucomisd xmm0, xmm1 - | jmp <1 - |.endif - break; - - case BC_ITERL: - |.if JIT - | hotloop RB - |.endif - | // Fall through. Assumes BC_IITERL follows and ins_AJ is a no-op. - break; - - case BC_JITERL: -#if !LJ_HASJIT - break; -#endif - case BC_IITERL: - | ins_AJ // RA = base, RD = target - | lea RA, [BASE+RA*8] - | mov RB, [RA+4] - | cmp RB, LJ_TNIL; je >1 // Stop if iterator returned nil. - if (op == BC_JITERL) { - | mov [RA-4], RB - | mov RB, [RA] - | mov [RA-8], RB - | jmp =>BC_JLOOP - } else { - | branchPC RD // Otherwise save control var + branch. - | mov RD, [RA] - | mov [RA-4], RB - | mov [RA-8], RD - } - |1: - | ins_next - break; - - case BC_LOOP: - | ins_A // RA = base, RD = target (loop extent) - | // Note: RA/RD is only used by trace recorder to determine scope/extent - | // This opcode does NOT jump, it's only purpose is to detect a hot loop. - |.if JIT - | hotloop RB - |.endif - | // Fall through. Assumes BC_ILOOP follows and ins_A is a no-op. - break; - - case BC_ILOOP: - | ins_A // RA = base, RD = target (loop extent) - | ins_next - break; - - case BC_JLOOP: - |.if JIT - | ins_AD // RA = base (ignored), RD = traceno - | mov RA, [DISPATCH+DISPATCH_J(trace)] - | mov TRACE:RD, [RA+RD*4] - | mov RDa, TRACE:RD->mcode - | mov L:RB, SAVE_L - | mov [DISPATCH+DISPATCH_GL(jit_base)], BASE - | mov [DISPATCH+DISPATCH_GL(jit_L)], L:RB - | // Save additional callee-save registers only used in compiled code. - |.if X64WIN - | mov TMPQ, r12 - | mov TMPa, r13 - | mov CSAVE_4, r14 - | mov CSAVE_3, r15 - | mov RAa, rsp - | sub rsp, 9*16+4*8 - | movdqa [RAa], xmm6 - | movdqa [RAa-1*16], xmm7 - | movdqa [RAa-2*16], xmm8 - | movdqa [RAa-3*16], xmm9 - | movdqa [RAa-4*16], xmm10 - | movdqa [RAa-5*16], xmm11 - | movdqa [RAa-6*16], xmm12 - | movdqa [RAa-7*16], xmm13 - | movdqa [RAa-8*16], xmm14 - | movdqa [RAa-9*16], xmm15 - |.elif X64 - | mov TMPQ, r12 - | mov TMPa, r13 - | sub rsp, 16 - |.endif - | jmp RDa - |.endif - break; - - case BC_JMP: - | ins_AJ // RA = unused, RD = target - | branchPC RD - | ins_next - break; - - /* -- Function headers -------------------------------------------------- */ - - /* - ** Reminder: A function may be called with func/args above L->maxstack, - ** i.e. occupying EXTRA_STACK slots. And vmeta_call may add one extra slot, - ** too. This means all FUNC* ops (including fast functions) must check - ** for stack overflow _before_ adding more slots! - */ - - case BC_FUNCF: - |.if JIT - | hotcall RB - |.endif - case BC_FUNCV: /* NYI: compiled vararg functions. */ - | // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow and ins_AD is a no-op. - break; - - case BC_JFUNCF: -#if !LJ_HASJIT - break; -#endif - case BC_IFUNCF: - | ins_AD // BASE = new base, RA = framesize, RD = nargs+1 - | mov KBASE, [PC-4+PC2PROTO(k)] - | mov L:RB, SAVE_L - | lea RA, [BASE+RA*8] // Top of frame. - | cmp RA, L:RB->maxstack - | ja ->vm_growstack_f - | movzx RA, byte [PC-4+PC2PROTO(numparams)] - | cmp NARGS:RD, RA // Check for missing parameters. - | jbe >3 - |2: - if (op == BC_JFUNCF) { - | movzx RD, PC_RD - | jmp =>BC_JLOOP - } else { - | ins_next - } - | - |3: // Clear missing parameters. - | mov dword [BASE+NARGS:RD*8-4], LJ_TNIL - | add NARGS:RD, 1 - | cmp NARGS:RD, RA - | jbe <3 - | jmp <2 - break; - - case BC_JFUNCV: -#if !LJ_HASJIT - break; -#endif - | int3 // NYI: compiled vararg functions - break; /* NYI: compiled vararg functions. */ - - case BC_IFUNCV: - | ins_AD // BASE = new base, RA = framesize, RD = nargs+1 - | lea RB, [NARGS:RD*8+FRAME_VARG] - | lea RD, [BASE+NARGS:RD*8] - | mov LFUNC:KBASE, [BASE-8] - | mov [RD-4], RB // Store delta + FRAME_VARG. - | mov [RD-8], LFUNC:KBASE // Store copy of LFUNC. - | mov L:RB, SAVE_L - | lea RA, [RD+RA*8] - | cmp RA, L:RB->maxstack - | ja ->vm_growstack_v // Need to grow stack. - | mov RA, BASE - | mov BASE, RD - | movzx RB, byte [PC-4+PC2PROTO(numparams)] - | test RB, RB - | jz >2 - |1: // Copy fixarg slots up to new frame. - | add RA, 8 - | cmp RA, BASE - | jnb >3 // Less args than parameters? - | mov KBASE, [RA-8] - | mov [RD], KBASE - | mov KBASE, [RA-4] - | mov [RD+4], KBASE - | add RD, 8 - | mov dword [RA-4], LJ_TNIL // Clear old fixarg slot (help the GC). - | sub RB, 1 - | jnz <1 - |2: - if (op == BC_JFUNCV) { - | movzx RD, PC_RD - | jmp =>BC_JLOOP - } else { - | mov KBASE, [PC-4+PC2PROTO(k)] - | ins_next - } - | - |3: // Clear missing parameters. - | mov dword [RD+4], LJ_TNIL - | add RD, 8 - | sub RB, 1 - | jnz <3 - | jmp <2 - break; - - case BC_FUNCC: - case BC_FUNCCW: - | ins_AD // BASE = new base, RA = ins RA|RD (unused), RD = nargs+1 - | mov CFUNC:RB, [BASE-8] - | mov KBASEa, CFUNC:RB->f - | mov L:RB, SAVE_L - | lea RD, [BASE+NARGS:RD*8-8] - | mov L:RB->base, BASE - | lea RA, [RD+8*LUA_MINSTACK] - | cmp RA, L:RB->maxstack - | mov L:RB->top, RD - if (op == BC_FUNCC) { - |.if X64 - | mov CARG1d, L:RB // Caveat: CARG1d may be RA. - |.else - | mov ARG1, L:RB - |.endif - } else { - |.if X64 - | mov CARG2, KBASEa - | mov CARG1d, L:RB // Caveat: CARG1d may be RA. - |.else - | mov ARG2, KBASEa - | mov ARG1, L:RB - |.endif - } - | ja ->vm_growstack_c // Need to grow stack. - | set_vmstate C - if (op == BC_FUNCC) { - | call KBASEa // (lua_State *L) - } else { - | // (lua_State *L, lua_CFunction f) - | call aword [DISPATCH+DISPATCH_GL(wrapf)] - } - | set_vmstate INTERP - | // nresults returned in eax (RD). - | mov BASE, L:RB->base - | lea RA, [BASE+RD*8] - | neg RA - | add RA, L:RB->top // RA = (L->top-(L->base+nresults))*8 - | mov PC, [BASE-4] // Fetch PC of caller. - | jmp ->vm_returnc - break; - - /* ---------------------------------------------------------------------- */ - - default: - fprintf(stderr, "Error: undefined opcode BC_%s\n", bc_names[op]); - exit(2); - break; - } -} - -static int build_backend(BuildCtx *ctx) -{ - int op; - dasm_growpc(Dst, BC__MAX); - build_subroutines(ctx); - |.code_op - for (op = 0; op < BC__MAX; op++) - build_ins(ctx, (BCOp)op, op); - return BC__MAX; -} - -/* Emit pseudo frame-info for all assembler functions. */ -static void emit_asm_debug(BuildCtx *ctx) -{ - int fcofs = (int)((uint8_t *)ctx->glob[GLOB_vm_ffi_call] - ctx->code); -#if LJ_64 -#define SZPTR "8" -#define BSZPTR "3" -#define REG_SP "0x7" -#define REG_RA "0x10" -#else -#define SZPTR "4" -#define BSZPTR "2" -#define REG_SP "0x4" -#define REG_RA "0x8" -#endif - switch (ctx->mode) { - case BUILD_elfasm: - fprintf(ctx->fp, "\t.section .debug_frame,\"\",@progbits\n"); - fprintf(ctx->fp, - ".Lframe0:\n" - "\t.long .LECIE0-.LSCIE0\n" - ".LSCIE0:\n" - "\t.long 0xffffffff\n" - "\t.byte 0x1\n" - "\t.string \"\"\n" - "\t.uleb128 0x1\n" - "\t.sleb128 -" SZPTR "\n" - "\t.byte " REG_RA "\n" - "\t.byte 0xc\n\t.uleb128 " REG_SP "\n\t.uleb128 " SZPTR "\n" - "\t.byte 0x80+" REG_RA "\n\t.uleb128 0x1\n" - "\t.align " SZPTR "\n" - ".LECIE0:\n\n"); - fprintf(ctx->fp, - ".LSFDE0:\n" - "\t.long .LEFDE0-.LASFDE0\n" - ".LASFDE0:\n" - "\t.long .Lframe0\n" -#if LJ_64 - "\t.quad .Lbegin\n" - "\t.quad %d\n" - "\t.byte 0xe\n\t.uleb128 %d\n" /* def_cfa_offset */ - "\t.byte 0x86\n\t.uleb128 0x2\n" /* offset rbp */ - "\t.byte 0x83\n\t.uleb128 0x3\n" /* offset rbx */ - "\t.byte 0x8f\n\t.uleb128 0x4\n" /* offset r15 */ - "\t.byte 0x8e\n\t.uleb128 0x5\n" /* offset r14 */ -#if LJ_NO_UNWIND - "\t.byte 0x8d\n\t.uleb128 0x6\n" /* offset r13 */ - "\t.byte 0x8c\n\t.uleb128 0x7\n" /* offset r12 */ -#endif -#else - "\t.long .Lbegin\n" - "\t.long %d\n" - "\t.byte 0xe\n\t.uleb128 %d\n" /* def_cfa_offset */ - "\t.byte 0x85\n\t.uleb128 0x2\n" /* offset ebp */ - "\t.byte 0x87\n\t.uleb128 0x3\n" /* offset edi */ - "\t.byte 0x86\n\t.uleb128 0x4\n" /* offset esi */ - "\t.byte 0x83\n\t.uleb128 0x5\n" /* offset ebx */ -#endif - "\t.align " SZPTR "\n" - ".LEFDE0:\n\n", fcofs, CFRAME_SIZE); -#if LJ_HASFFI - fprintf(ctx->fp, - ".LSFDE1:\n" - "\t.long .LEFDE1-.LASFDE1\n" - ".LASFDE1:\n" - "\t.long .Lframe0\n" -#if LJ_64 - "\t.quad lj_vm_ffi_call\n" - "\t.quad %d\n" - "\t.byte 0xe\n\t.uleb128 16\n" /* def_cfa_offset */ - "\t.byte 0x86\n\t.uleb128 0x2\n" /* offset rbp */ - "\t.byte 0xd\n\t.uleb128 0x6\n" /* def_cfa_register rbp */ - "\t.byte 0x83\n\t.uleb128 0x3\n" /* offset rbx */ -#else - "\t.long lj_vm_ffi_call\n" - "\t.long %d\n" - "\t.byte 0xe\n\t.uleb128 8\n" /* def_cfa_offset */ - "\t.byte 0x85\n\t.uleb128 0x2\n" /* offset ebp */ - "\t.byte 0xd\n\t.uleb128 0x5\n" /* def_cfa_register ebp */ - "\t.byte 0x83\n\t.uleb128 0x3\n" /* offset ebx */ -#endif - "\t.align " SZPTR "\n" - ".LEFDE1:\n\n", (int)ctx->codesz - fcofs); -#endif -#if !LJ_NO_UNWIND -#if (defined(__sun__) && defined(__svr4__)) -#if LJ_64 - fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@unwind\n"); -#else - fprintf(ctx->fp, "\t.section .eh_frame,\"aw\",@progbits\n"); -#endif -#else - fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@progbits\n"); -#endif - fprintf(ctx->fp, - ".Lframe1:\n" - "\t.long .LECIE1-.LSCIE1\n" - ".LSCIE1:\n" - "\t.long 0\n" - "\t.byte 0x1\n" - "\t.string \"zPR\"\n" - "\t.uleb128 0x1\n" - "\t.sleb128 -" SZPTR "\n" - "\t.byte " REG_RA "\n" - "\t.uleb128 6\n" /* augmentation length */ - "\t.byte 0x1b\n" /* pcrel|sdata4 */ - "\t.long lj_err_unwind_dwarf-.\n" - "\t.byte 0x1b\n" /* pcrel|sdata4 */ - "\t.byte 0xc\n\t.uleb128 " REG_SP "\n\t.uleb128 " SZPTR "\n" - "\t.byte 0x80+" REG_RA "\n\t.uleb128 0x1\n" - "\t.align " SZPTR "\n" - ".LECIE1:\n\n"); - fprintf(ctx->fp, - ".LSFDE2:\n" - "\t.long .LEFDE2-.LASFDE2\n" - ".LASFDE2:\n" - "\t.long .LASFDE2-.Lframe1\n" - "\t.long .Lbegin-.\n" - "\t.long %d\n" - "\t.uleb128 0\n" /* augmentation length */ - "\t.byte 0xe\n\t.uleb128 %d\n" /* def_cfa_offset */ -#if LJ_64 - "\t.byte 0x86\n\t.uleb128 0x2\n" /* offset rbp */ - "\t.byte 0x83\n\t.uleb128 0x3\n" /* offset rbx */ - "\t.byte 0x8f\n\t.uleb128 0x4\n" /* offset r15 */ - "\t.byte 0x8e\n\t.uleb128 0x5\n" /* offset r14 */ -#else - "\t.byte 0x85\n\t.uleb128 0x2\n" /* offset ebp */ - "\t.byte 0x87\n\t.uleb128 0x3\n" /* offset edi */ - "\t.byte 0x86\n\t.uleb128 0x4\n" /* offset esi */ - "\t.byte 0x83\n\t.uleb128 0x5\n" /* offset ebx */ -#endif - "\t.align " SZPTR "\n" - ".LEFDE2:\n\n", fcofs, CFRAME_SIZE); -#if LJ_HASFFI - fprintf(ctx->fp, - ".Lframe2:\n" - "\t.long .LECIE2-.LSCIE2\n" - ".LSCIE2:\n" - "\t.long 0\n" - "\t.byte 0x1\n" - "\t.string \"zR\"\n" - "\t.uleb128 0x1\n" - "\t.sleb128 -" SZPTR "\n" - "\t.byte " REG_RA "\n" - "\t.uleb128 1\n" /* augmentation length */ - "\t.byte 0x1b\n" /* pcrel|sdata4 */ - "\t.byte 0xc\n\t.uleb128 " REG_SP "\n\t.uleb128 " SZPTR "\n" - "\t.byte 0x80+" REG_RA "\n\t.uleb128 0x1\n" - "\t.align " SZPTR "\n" - ".LECIE2:\n\n"); - fprintf(ctx->fp, - ".LSFDE3:\n" - "\t.long .LEFDE3-.LASFDE3\n" - ".LASFDE3:\n" - "\t.long .LASFDE3-.Lframe2\n" - "\t.long lj_vm_ffi_call-.\n" - "\t.long %d\n" - "\t.uleb128 0\n" /* augmentation length */ -#if LJ_64 - "\t.byte 0xe\n\t.uleb128 16\n" /* def_cfa_offset */ - "\t.byte 0x86\n\t.uleb128 0x2\n" /* offset rbp */ - "\t.byte 0xd\n\t.uleb128 0x6\n" /* def_cfa_register rbp */ - "\t.byte 0x83\n\t.uleb128 0x3\n" /* offset rbx */ -#else - "\t.byte 0xe\n\t.uleb128 8\n" /* def_cfa_offset */ - "\t.byte 0x85\n\t.uleb128 0x2\n" /* offset ebp */ - "\t.byte 0xd\n\t.uleb128 0x5\n" /* def_cfa_register ebp */ - "\t.byte 0x83\n\t.uleb128 0x3\n" /* offset ebx */ -#endif - "\t.align " SZPTR "\n" - ".LEFDE3:\n\n", (int)ctx->codesz - fcofs); -#endif -#endif - break; -#if !LJ_NO_UNWIND - /* Mental note: never let Apple design an assembler. - ** Or a linker. Or a plastic case. But I digress. - */ - case BUILD_machasm: { -#if LJ_HASFFI - int fcsize = 0; -#endif - int i; - fprintf(ctx->fp, "\t.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support\n"); - fprintf(ctx->fp, - "EH_frame1:\n" - "\t.set L$set$x,LECIEX-LSCIEX\n" - "\t.long L$set$x\n" - "LSCIEX:\n" - "\t.long 0\n" - "\t.byte 0x1\n" - "\t.ascii \"zPR\\0\"\n" - "\t.byte 0x1\n" - "\t.byte 128-" SZPTR "\n" - "\t.byte " REG_RA "\n" - "\t.byte 6\n" /* augmentation length */ - "\t.byte 0x9b\n" /* indirect|pcrel|sdata4 */ -#if LJ_64 - "\t.long _lj_err_unwind_dwarf+4@GOTPCREL\n" - "\t.byte 0x1b\n" /* pcrel|sdata4 */ - "\t.byte 0xc\n\t.byte " REG_SP "\n\t.byte " SZPTR "\n" -#else - "\t.long L_lj_err_unwind_dwarf$non_lazy_ptr-.\n" - "\t.byte 0x1b\n" /* pcrel|sdata4 */ - "\t.byte 0xc\n\t.byte 0x5\n\t.byte 0x4\n" /* esp=5 on 32 bit MACH-O. */ -#endif - "\t.byte 0x80+" REG_RA "\n\t.byte 0x1\n" - "\t.align " BSZPTR "\n" - "LECIEX:\n\n"); - for (i = 0; i < ctx->nsym; i++) { - const char *name = ctx->sym[i].name; - int32_t size = ctx->sym[i+1].ofs - ctx->sym[i].ofs; - if (size == 0) continue; -#if LJ_HASFFI - if (!strcmp(name, "_lj_vm_ffi_call")) { fcsize = size; continue; } -#endif - fprintf(ctx->fp, - "%s.eh:\n" - "LSFDE%d:\n" - "\t.set L$set$%d,LEFDE%d-LASFDE%d\n" - "\t.long L$set$%d\n" - "LASFDE%d:\n" - "\t.long LASFDE%d-EH_frame1\n" - "\t.long %s-.\n" - "\t.long %d\n" - "\t.byte 0\n" /* augmentation length */ - "\t.byte 0xe\n\t.byte %d\n" /* def_cfa_offset */ -#if LJ_64 - "\t.byte 0x86\n\t.byte 0x2\n" /* offset rbp */ - "\t.byte 0x83\n\t.byte 0x3\n" /* offset rbx */ - "\t.byte 0x8f\n\t.byte 0x4\n" /* offset r15 */ - "\t.byte 0x8e\n\t.byte 0x5\n" /* offset r14 */ -#else - "\t.byte 0x84\n\t.byte 0x2\n" /* offset ebp (4 for MACH-O)*/ - "\t.byte 0x87\n\t.byte 0x3\n" /* offset edi */ - "\t.byte 0x86\n\t.byte 0x4\n" /* offset esi */ - "\t.byte 0x83\n\t.byte 0x5\n" /* offset ebx */ -#endif - "\t.align " BSZPTR "\n" - "LEFDE%d:\n\n", - name, i, i, i, i, i, i, i, name, size, CFRAME_SIZE, i); - } -#if LJ_HASFFI - if (fcsize) { - fprintf(ctx->fp, - "EH_frame2:\n" - "\t.set L$set$y,LECIEY-LSCIEY\n" - "\t.long L$set$y\n" - "LSCIEY:\n" - "\t.long 0\n" - "\t.byte 0x1\n" - "\t.ascii \"zR\\0\"\n" - "\t.byte 0x1\n" - "\t.byte 128-" SZPTR "\n" - "\t.byte " REG_RA "\n" - "\t.byte 1\n" /* augmentation length */ -#if LJ_64 - "\t.byte 0x1b\n" /* pcrel|sdata4 */ - "\t.byte 0xc\n\t.byte " REG_SP "\n\t.byte " SZPTR "\n" -#else - "\t.byte 0x1b\n" /* pcrel|sdata4 */ - "\t.byte 0xc\n\t.byte 0x5\n\t.byte 0x4\n" /* esp=5 on 32 bit MACH. */ -#endif - "\t.byte 0x80+" REG_RA "\n\t.byte 0x1\n" - "\t.align " BSZPTR "\n" - "LECIEY:\n\n"); - fprintf(ctx->fp, - "_lj_vm_ffi_call.eh:\n" - "LSFDEY:\n" - "\t.set L$set$yy,LEFDEY-LASFDEY\n" - "\t.long L$set$yy\n" - "LASFDEY:\n" - "\t.long LASFDEY-EH_frame2\n" - "\t.long _lj_vm_ffi_call-.\n" - "\t.long %d\n" - "\t.byte 0\n" /* augmentation length */ -#if LJ_64 - "\t.byte 0xe\n\t.byte 16\n" /* def_cfa_offset */ - "\t.byte 0x86\n\t.byte 0x2\n" /* offset rbp */ - "\t.byte 0xd\n\t.byte 0x6\n" /* def_cfa_register rbp */ - "\t.byte 0x83\n\t.byte 0x3\n" /* offset rbx */ -#else - "\t.byte 0xe\n\t.byte 8\n" /* def_cfa_offset */ - "\t.byte 0x84\n\t.byte 0x2\n" /* offset ebp (4 for MACH-O)*/ - "\t.byte 0xd\n\t.byte 0x4\n" /* def_cfa_register ebp */ - "\t.byte 0x83\n\t.byte 0x3\n" /* offset ebx */ -#endif - "\t.align " BSZPTR "\n" - "LEFDEY:\n\n", fcsize); - } -#endif -#if LJ_64 - fprintf(ctx->fp, "\t.subsections_via_symbols\n"); -#else - fprintf(ctx->fp, - "\t.non_lazy_symbol_pointer\n" - "L_lj_err_unwind_dwarf$non_lazy_ptr:\n" - ".indirect_symbol _lj_err_unwind_dwarf\n" - ".long 0\n"); -#endif - } - break; -#endif - default: /* Difficult for other modes. */ - break; - } -} - diff --git a/subprojects/luajit/meson.build b/subprojects/packagefiles/luajit/meson.build similarity index 85% rename from subprojects/luajit/meson.build rename to subprojects/packagefiles/luajit/meson.build index bc74a2935..d321d7fa5 100644 --- a/subprojects/luajit/meson.build +++ b/subprojects/packagefiles/luajit/meson.build @@ -1,4 +1,4 @@ -project('luajit', 'c', version: '2.0.4', license: 'MIT') +project('luajit', 'c', version: '2.1.0', license: 'MIT') cc = meson.get_compiler('c') @@ -33,9 +33,6 @@ else error('Unsupported platform') endif -incdir = include_directories('include') - subdir('src') -luajit_dep = declare_dependency(link_with: luajit_lib, - include_directories: incdir) +luajit_dep = declare_dependency(link_with: luajit_lib, include_directories: src_inc) diff --git a/subprojects/luajit/src/host/meson.build b/subprojects/packagefiles/luajit/src/host/meson.build similarity index 100% rename from subprojects/luajit/src/host/meson.build rename to subprojects/packagefiles/luajit/src/host/meson.build diff --git a/subprojects/luajit/src/meson.build b/subprojects/packagefiles/luajit/src/meson.build similarity index 94% rename from subprojects/luajit/src/meson.build rename to subprojects/packagefiles/luajit/src/meson.build index a2224c393..742128f60 100644 --- a/subprojects/luajit/src/meson.build +++ b/subprojects/packagefiles/luajit/src/meson.build @@ -18,9 +18,11 @@ ljcore_src = files( 'lj_alloc.c', 'lj_api.c', 'lj_asm.c', + 'lj_assert.c', 'lj_bc.c', 'lj_bcread.c', 'lj_bcwrite.c', + 'lj_buf.c', 'lj_carith.c', 'lj_ccall.c', 'lj_ccallback.c', @@ -53,10 +55,14 @@ ljcore_src = files( 'lj_opt_sink.c', 'lj_opt_split.c', 'lj_parse.c', + 'lj_prng.c', + 'lj_profile.c', 'lj_record.c', 'lj_snap.c', 'lj_state.c', 'lj_str.c', + 'lj_strfmt.c', + 'lj_strfmt_num.c', 'lj_strscan.c', 'lj_tab.c', 'lj_trace.c', diff --git a/subprojects/luajit/unicode-io.patch b/subprojects/packagefiles/luajit/unicode-io.patch similarity index 100% rename from subprojects/luajit/unicode-io.patch rename to subprojects/packagefiles/luajit/unicode-io.patch diff --git a/subprojects/luajit/unicode-os.patch b/subprojects/packagefiles/luajit/unicode-os.patch similarity index 100% rename from subprojects/luajit/unicode-os.patch rename to subprojects/packagefiles/luajit/unicode-os.patch From 84beba20cb5c7aaaa95241a255d4fd6b3aa9305c Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 30 Jan 2021 16:21:22 -0500 Subject: [PATCH 241/271] meson: fix luajit 64-bit builds Upstream defines ENDIAN_LE or ENDIAN_BE always, so assume little endian. x86_64 defaulting to x86 seems to just be a mistake --- subprojects/packagefiles/luajit/meson.build | 2 ++ subprojects/packagefiles/luajit/src/host/meson.build | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/packagefiles/luajit/meson.build b/subprojects/packagefiles/luajit/meson.build index d321d7fa5..d005ac853 100644 --- a/subprojects/packagefiles/luajit/meson.build +++ b/subprojects/packagefiles/luajit/meson.build @@ -10,6 +10,8 @@ system_deps = [ # compat flag is needed for both the buildvm code generator (compiled natively) and luajit itself add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', language: 'c', native: true) add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', language: 'c', native: false) +add_project_arguments('-DENDIAN_LE', language: 'c', native: true) +add_project_arguments('-DENDIAN_LE', language: 'c', native: false) if host_machine.system() == 'linux' add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_LINUX', language: 'c', native: true) readline_dep = cc.find_library('readline') diff --git a/subprojects/packagefiles/luajit/src/host/meson.build b/subprojects/packagefiles/luajit/src/host/meson.build index ce0a6e244..ff74a3c7a 100644 --- a/subprojects/packagefiles/luajit/src/host/meson.build +++ b/subprojects/packagefiles/luajit/src/host/meson.build @@ -3,7 +3,7 @@ minilua = executable('minilua', 'minilua.c', native: true) if host_machine.cpu_family() == 'x86_64' - dynasm_arch = 'x86' + dynasm_arch = 'x64' else dynasm_arch = host_machine.cpu_family() endif From b7f6ac42e487c69d60b7e75bda82ba078bcc88ab Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Sat, 27 Feb 2021 21:13:31 -0500 Subject: [PATCH 242/271] Add lua monkeypatch for Unicode support on Windows --- automation/include/unicode-monkeypatch.lua | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 automation/include/unicode-monkeypatch.lua diff --git a/automation/include/unicode-monkeypatch.lua b/automation/include/unicode-monkeypatch.lua new file mode 100644 index 000000000..0372fe3df --- /dev/null +++ b/automation/include/unicode-monkeypatch.lua @@ -0,0 +1,128 @@ +local fii = require("ffi") + +if ffi.os ~= "Windows" then + return +end + +-- Safety first! +do + if pcall(string.dump, io.open) then + error("io.open is already patched!") + end + + local function index(t, k) + return t[k] + end + + if pcall(index, ffi.C, "GetACP") == false then + ffi.cdef[[ + uint32_t __stdcall GetACP(); + ]] + end +end + +local CP_UTF8 = 65001 +local MB_ERR_INVALID_CHARS = 8 + +if ffi.C.GetACP() == CP_UTF8 then + -- "Use Unicode UTF-8 for worldwide language support" is ticked. + -- Don't bother patching it. + return +end + +ffi.cdef[[ +int32_t __stdcall MultiByteToWideChar( + uint32_t CodePage, + uint32_t dwFlags, + const char *lpMultiByteStr, + int32_t cbMultiByte, + wchar_t *lpWideCharStr, + int32_t cchWideChar +); +void *_wfreopen(wchar_t *path, wchar_t *mode, void *file); +int32_t _wrename(wchar_t *oldname, wchar_t *newname); +int32_t _wremove(wchar_t *path); +int32_t _wsystem(wchar_t *command); +char *strerror(int errnum); +]] + +local function widen(ch) + local size = ffi.C.MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, ch, #ch, nil, 0) + if size == 0 then + error(fname .. ": invalid character sequence") + end + + local buf = ffi.new("wchar_t[?]", size + 1) + if ffi.C.MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, ch, #ch, buf, size) == 0 then + error(fname .. ": char conversion error") + end + + return buf +end + +local function fileresult(stat, fname) + if stat == 0 then + return true + end + + local errno = ffi.errno + local msg = ffi.C.strerror(errno) + + if fname then + return nil, fname .. ": " .. msg, errno + end + return nil, msg, errno +end + +local function execresult(stat) + if stat == -1 then + return fileresult(0, nil) + + if stat == 0 then + return true, "exit", stat + end + return nil, "exit", stat +end + +local orig_open = io.open +local orig_rename = os.rename +local orig_remove = os.remove +local orig_execute = os.execute + +function io.open(fname, mode) + local wfname = widen(path) + local wmode = widen(mode) + + local file = assert(open("nul", "rb")) + if ffi.C._wfreopen(wfname, wmode, file) == nil then + local msg, errno = select(2, file:close()) + return nil, fname .. ": " .. msg, errno + end + + return file +end + +function os.rename(oldname, newname) + local woldname = widen(oldname) + local wnewname = widen(newname) + + local stat = ffi.C._wrename(woldname, wnewname) + return fileresult(stat, oldname) +end + +function os.remove(fname) + local wfname = widen(path) + + local stat = ffi.C._wremove(wfname) + return fileresult(stat, fname) +end + +function os.execute(command) + local wcommand = command + if command then + wcommand = widen(command) + return execresult(wcommand) + end + + return true +end From 4648e8cc5b86dd2d1ca8e2fec0a98994324ad2f7 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 27 Mar 2021 08:37:43 -0400 Subject: [PATCH 243/271] meson: add new luajit string buffer files --- subprojects/packagefiles/luajit/src/meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subprojects/packagefiles/luajit/src/meson.build b/subprojects/packagefiles/luajit/src/meson.build index 742128f60..b1aeb0ca1 100644 --- a/subprojects/packagefiles/luajit/src/meson.build +++ b/subprojects/packagefiles/luajit/src/meson.build @@ -1,6 +1,7 @@ ljlib_src = files( 'lib_base.c', 'lib_bit.c', + 'lib_buffer.c', 'lib_debug.c', 'lib_ffi.c', 'lib_io.c', @@ -58,6 +59,7 @@ ljcore_src = files( 'lj_prng.c', 'lj_profile.c', 'lj_record.c', + 'lj_serialize.c', 'lj_snap.c', 'lj_state.c', 'lj_str.c', From e929e4a75c50c6b5e3db6a03746e5b91bb47ad38 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 27 Mar 2021 10:21:52 -0400 Subject: [PATCH 244/271] meson: copy monkeypatch script --- automation/include/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/automation/include/meson.build b/automation/include/meson.build index 3c820ff03..baf83cfca 100644 --- a/automation/include/meson.build +++ b/automation/include/meson.build @@ -8,6 +8,7 @@ lua_files = files( 'moonscript.lua', 're.lua', 'unicode.lua', + 'unicode-monkeypatch.lua', 'utils-auto4.lua', 'utils.lua', ) From 8394f1adca8ac685910ebfa693e6bec43c84a8f2 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 27 Mar 2021 10:22:00 -0400 Subject: [PATCH 245/271] Monkeypatch script fixes --- automation/include/unicode-monkeypatch.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/automation/include/unicode-monkeypatch.lua b/automation/include/unicode-monkeypatch.lua index 0372fe3df..a5d74a8fa 100644 --- a/automation/include/unicode-monkeypatch.lua +++ b/automation/include/unicode-monkeypatch.lua @@ -1,4 +1,4 @@ -local fii = require("ffi") +local ffi = require("ffi") if ffi.os ~= "Windows" then return @@ -77,6 +77,7 @@ end local function execresult(stat) if stat == -1 then return fileresult(0, nil) + end if stat == 0 then return true, "exit", stat @@ -90,10 +91,13 @@ local orig_remove = os.remove local orig_execute = os.execute function io.open(fname, mode) - local wfname = widen(path) + local wfname = widen(fname) + if not mode then + mode = "r" + end local wmode = widen(mode) - local file = assert(open("nul", "rb")) + local file = assert(orig_open("nul", "rb")) if ffi.C._wfreopen(wfname, wmode, file) == nil then local msg, errno = select(2, file:close()) return nil, fname .. ": " .. msg, errno @@ -111,7 +115,7 @@ function os.rename(oldname, newname) end function os.remove(fname) - local wfname = widen(path) + local wfname = widen(fname) local stat = ffi.C._wremove(wfname) return fileresult(stat, fname) From 51494a07d933f78f6b602e816ffd0b5f9d18558c Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 27 Mar 2021 10:22:25 -0400 Subject: [PATCH 246/271] lua: run unicode-monkeypatch on Windows when loading scripts --- libaegisub/lua/script_reader.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libaegisub/lua/script_reader.cpp b/libaegisub/lua/script_reader.cpp index 7730697fa..6beb9813b 100644 --- a/libaegisub/lua/script_reader.cpp +++ b/libaegisub/lua/script_reader.cpp @@ -146,6 +146,14 @@ namespace agi { namespace lua { lua_rawseti(L, -2, 2); lua_pop(L, 2); // loaders, package +#ifdef _WIN32 + // Replace the default lua IO functions with our unicode compatibile ones + luaL_loadstring(L, "require('unicode-monkeypatch')"); + if (lua_pcall(L, 0, 0, 0)) { + return false; // leave error message + } +#endif + luaL_loadstring(L, "return require('moonscript').loadstring"); if (lua_pcall(L, 0, 1, 0)) { return false; // leave error message From 9d1b28f5a73f4d277f8fd2ecf8c927b3df942398 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 27 Mar 2021 10:25:48 -0400 Subject: [PATCH 247/271] Delete luajit patch files --- .../packagefiles/luajit/unicode-io.patch | 64 ------------------- .../packagefiles/luajit/unicode-os.patch | 28 -------- 2 files changed, 92 deletions(-) delete mode 100644 subprojects/packagefiles/luajit/unicode-io.patch delete mode 100644 subprojects/packagefiles/luajit/unicode-os.patch diff --git a/subprojects/packagefiles/luajit/unicode-io.patch b/subprojects/packagefiles/luajit/unicode-io.patch deleted file mode 100644 index 3d9873f59..000000000 --- a/subprojects/packagefiles/luajit/unicode-io.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff --git a/vendor/luajit/src/lib_io.c b/vendor/luajit/src/lib_io.c -index 9cdcfcfcb..6858e6455 100644 ---- a/vendor/luajit/src/lib_io.c -+++ b/vendor/luajit/src/lib_io.c -@@ -24,6 +24,16 @@ - #include "lj_ff.h" - #include "lj_lib.h" - -+#if LJ_TARGET_WINDOWS -+#define WIN32_LEAN_AND_MEAN -+#include -+ -+static int widen(const char *in, wchar_t *out) -+{ -+ return MultiByteToWideChar(CP_UTF8, 0, in, -1, out, MAX_PATH); -+} -+#endif -+ - /* Userdata payload for I/O file. */ - typedef struct IOFileUD { - FILE *fp; /* File handle. */ -@@ -82,7 +92,15 @@ static IOFileUD *io_file_open(lua_State *L, const char *mode) - { - const char *fname = strdata(lj_lib_checkstr(L, 1)); - IOFileUD *iof = io_file_new(L); -+#if LJ_TARGET_WINDOWS -+ wchar_t wfname[MAX_PATH]; -+ wchar_t wmode[MAX_PATH]; -+ if (!widen(fname, wfname) || !widen(mode, wmode)) -+ luaL_argerror(L, 1, lj_str_pushf(L, "%s: failed to convert path to utf-16", fname)); -+ iof->fp = _wfopen(wfname, wmode); -+#else - iof->fp = fopen(fname, mode); -+#endif - if (iof->fp == NULL) - luaL_argerror(L, 1, lj_str_pushf(L, "%s: %s", fname, strerror(errno))); - return iof; -@@ -407,7 +425,14 @@ LJLIB_CF(io_open) - GCstr *s = lj_lib_optstr(L, 2); - const char *mode = s ? strdata(s) : "r"; - IOFileUD *iof = io_file_new(L); -+#if LJ_TARGET_WINDOWS -+ wchar_t wfname[MAX_PATH]; -+ wchar_t wmode[MAX_PATH]; -+ if (widen(fname, wfname) && widen(mode, wmode)) -+ iof->fp = _wfopen(wfname, wmode); -+#else - iof->fp = fopen(fname, mode); -+#endif - return iof->fp != NULL ? 1 : luaL_fileresult(L, 0, fname); - } - -@@ -423,7 +448,10 @@ LJLIB_CF(io_popen) - fflush(NULL); - iof->fp = popen(fname, mode); - #else -- iof->fp = _popen(fname, mode); -+ wchar_t wfname[MAX_PATH]; -+ wchar_t wmode[MAX_PATH]; -+ if (widen(fname, wfname) && widen(mode, wmode)) -+ iof->fp = _wpopen(wfname, wmode); - #endif - return iof->fp != NULL ? 1 : luaL_fileresult(L, 0, fname); - #else diff --git a/subprojects/packagefiles/luajit/unicode-os.patch b/subprojects/packagefiles/luajit/unicode-os.patch deleted file mode 100644 index 5d69f7e9c..000000000 --- a/subprojects/packagefiles/luajit/unicode-os.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/vendor/luajit/src/lib_os.c b/vendor/luajit/src/lib_os.c -index 8c96b86c7..05b324950 100644 ---- a/vendor/luajit/src/lib_os.c -+++ b/vendor/luajit/src/lib_os.c -@@ -32,6 +32,23 @@ - - /* ------------------------------------------------------------------------ */ - -+#if LJ_TARGET_WINDOWS -+#define WIN32_LEAN_AND_MEAN -+#include -+ -+static wchar_t *widen_static(const char *narrow, int idx) -+{ -+ __declspec(thread) static wchar_t buffer[2][MAX_PATH]; -+ return MultiByteToWideChar(CP_UTF8, 0, narrow, -1, buffer[idx], MAX_PATH) ? buffer[idx] : L""; -+} -+ -+#define remove(x) _wremove(widen_static(x, 0)) -+#define system(x) _wsystem(widen_static(x, 0)) -+#define rename(x, y) _wrename(widen_static(x, 0), widen_static(y, 1)) -+#endif -+ -+/* ------------------------------------------------------------------------ */ -+ - #define LJLIB_MODULE_os - - LJLIB_CF(os_execute) From 7a27ee7823c4108e9d908288e4e976789c4b5c7d Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 27 Mar 2021 10:58:42 -0400 Subject: [PATCH 248/271] meson: add -DLUAJIT_UNWIND_EXTERNAL for MacOS/Linux --- subprojects/packagefiles/luajit/meson.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/packagefiles/luajit/meson.build b/subprojects/packagefiles/luajit/meson.build index d005ac853..526d1c675 100644 --- a/subprojects/packagefiles/luajit/meson.build +++ b/subprojects/packagefiles/luajit/meson.build @@ -8,17 +8,17 @@ system_deps = [ ] # compat flag is needed for both the buildvm code generator (compiled natively) and luajit itself -add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', language: 'c', native: true) -add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', language: 'c', native: false) -add_project_arguments('-DENDIAN_LE', language: 'c', native: true) -add_project_arguments('-DENDIAN_LE', language: 'c', native: false) +add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', '-DENDIAN_LE', language: 'c', native: true) +add_project_arguments('-DLUAJIT_ENABLE_LUA52COMPAT', '-DENDIAN_LE', language: 'c', native: false) if host_machine.system() == 'linux' add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_LINUX', language: 'c', native: true) + add_project_arguments('-DLUAJIT_UNWIND_EXTERNAL', language: 'c', native: false) readline_dep = cc.find_library('readline') ljvm_mode = 'elfasm' ljvm_bout = 'lj_vm.s' elif host_machine.system() == 'darwin' add_project_arguments('-DLUAJIT_OS=LUAJIT_OS_OSX', language: 'c', native: true) + add_project_arguments('-DLUAJIT_UNWIND_EXTERNAL', language: 'c', native: false) readline_dep = cc.find_library('readline') ljvm_mode = 'machasm' ljvm_bout = 'lj_vm.s' From 4b2cd7f17080021586ccd3dce04767f0c42c394a Mon Sep 17 00:00:00 2001 From: Myaamori Date: Fri, 5 Mar 2021 15:42:37 +0000 Subject: [PATCH 249/271] Convert OpenType weight to Fontconfig weight in font collector Fixes #108 --- src/font_file_lister_fontconfig.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/font_file_lister_fontconfig.cpp b/src/font_file_lister_fontconfig.cpp index 408d596ee..f822783db 100644 --- a/src/font_file_lister_fontconfig.cpp +++ b/src/font_file_lister_fontconfig.cpp @@ -63,8 +63,8 @@ CollectionResult FontConfigFontFileLister::GetFontPaths(std::string const& facen std::string family = facename[0] == '@' ? facename.substr(1) : facename; boost::to_lower(family); - int weight = bold == 0 ? 80 : - bold == 1 ? 200 : + int weight = bold == 0 ? 400 : + bold == 1 ? 700 : bold; int slant = italic ? 110 : 0; @@ -74,7 +74,7 @@ CollectionResult FontConfigFontFileLister::GetFontPaths(std::string const& facen FcPatternAddBool(pat, FC_OUTLINE, true); FcPatternAddInteger(pat, FC_SLANT, slant); - FcPatternAddInteger(pat, FC_WEIGHT, weight); + FcPatternAddInteger(pat, FC_WEIGHT, FcWeightFromOpenType(weight)); FcDefaultSubstitute(pat); if (!FcConfigSubstitute(config, pat, FcMatchPattern)) return ret; From 3dfc5538807928e4d730775c88b1a76c253ef1fa Mon Sep 17 00:00:00 2001 From: Myaamori Date: Fri, 5 Mar 2021 16:24:48 +0000 Subject: [PATCH 250/271] Fix faux bold logic in font collector for Fontconfig Based on libass's logic (a requested weight of over 150 more than the matching font). --- src/font_file_lister_fontconfig.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/font_file_lister_fontconfig.cpp b/src/font_file_lister_fontconfig.cpp index f822783db..a361dea73 100644 --- a/src/font_file_lister_fontconfig.cpp +++ b/src/font_file_lister_fontconfig.cpp @@ -109,11 +109,9 @@ CollectionResult FontConfigFontFileLister::GetFontPaths(std::string const& facen } } - if (weight > 80) { - int actual_weight = weight; - if (FcPatternGetInteger(match, FC_WEIGHT, 0, &actual_weight) == FcResultMatch) - ret.fake_bold = actual_weight <= 80; - } + int actual_weight = 0; + if (FcPatternGetInteger(match, FC_WEIGHT, 0, &actual_weight) == FcResultMatch) + ret.fake_bold = weight > FcWeightToOpenType(actual_weight) + 150; int actual_slant = slant; if (FcPatternGetInteger(match, FC_SLANT, 0, &actual_slant) == FcResultMatch) From 7def61d46fddf5bb3b7d7b601847ea3707425b9d Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 27 Mar 2021 14:55:52 -0400 Subject: [PATCH 251/271] Update README for Windows --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc71b0fc0..e1a83567a 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ All other dependencies are either stored in the repository or are included as su Building: 1. Clone Aegisub's repository: `git clone https://github.com/TypesettingTools/Aegisub.git` -2. From the Visual Studio "x64 Native Tools Command Prompt", generate the build directory: `meson build -Ddefault_library=static -Db_lto=true` -3. Build with `cd build` and `meson compile` +2. From the Visual Studio "x64 Native Tools Command Prompt", generate the build directory: `meson build -Ddefault_library=static` (if building for release, add `--buildtype=release`) +3. Build with `cd build` and `ninja` You should now have a binary: `aegisub.exe`. From 696a73284009af0a5c572398aceb705a426a9e25 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 27 Mar 2021 14:56:04 -0400 Subject: [PATCH 252/271] Add new unicode script to installer --- packages/win_installer/fragment_automation.iss | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/win_installer/fragment_automation.iss b/packages/win_installer/fragment_automation.iss index c754c4752..6843a3388 100644 --- a/packages/win_installer/fragment_automation.iss +++ b/packages/win_installer/fragment_automation.iss @@ -26,6 +26,7 @@ DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\lfs DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\moonscript.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\re.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\unicode.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main +DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\unicode-monkeypatch.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\utils.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main DestDir: {app}\automation\include; Source: {#SOURCE_ROOT}\automation\include\utils-auto4.lua; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: readonly; Components: main From b00f5dd58eb36cc87109ca3529ad52a789a8db03 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Fri, 9 Apr 2021 21:51:14 +0100 Subject: [PATCH 253/271] meson: add option to specify wxWidgets version --- meson.build | 2 +- meson_options.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 470eb81d4..17ca77b56 100644 --- a/meson.build +++ b/meson.build @@ -111,7 +111,7 @@ endif deps += dependency('zlib') -wx_minver = '>=3.0.0' +wx_minver = '>=' + get_option('wx_version') if host_machine.system() == 'darwin' wx_minver = '>=3.1.0' endif diff --git a/meson_options.txt b/meson_options.txt index 5212635fb..3bc0461cd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -16,6 +16,8 @@ option('csri', type: 'feature', description: 'CSRI support') option('system_luajit', type: 'boolean', value: false, description: 'Force using system luajit') option('local_boost', type: 'boolean', value: false, description: 'Force using locally compiled Boost') +option('wx_version', type: 'string', value: '3.0.0', description: 'The minimum wxWidgets version to use') + option('credit', type: 'string', value: '', description: 'Build credit shown in program title') option('enable_update_checker', type: 'boolean', value: false, description: 'Enable the update checker') From 0f95589d0accea9bd33e029e82bda089f32206f3 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Wed, 7 Apr 2021 17:03:37 +0100 Subject: [PATCH 254/271] meson: Fix Windows artifacts --- .github/workflows/ci.yml | 2 +- subprojects/freetype2.wrap | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 subprojects/freetype2.wrap diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d06e8e2c2..49c155393 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: os: windows-latest, msvc: true, buildtype: release, - args: '-Ddefault_library=static --force-fallback-for=zlib,harfbuzz' + args: '-Ddefault_library=static --force-fallback-for=zlib,harfbuzz,freetype2,fribidi,libpng -Dfreetype2:harfbuzz=disabled -Dharfbuzz:freetype=disabled -Dharfbuzz:cairo=disabled -Dharfbuzz:glib=disabled -Dharfbuzz:gobject=disabled' } #- { # name: Windows MinGW, diff --git a/subprojects/freetype2.wrap b/subprojects/freetype2.wrap deleted file mode 100644 index d9903f108..000000000 --- a/subprojects/freetype2.wrap +++ /dev/null @@ -1,8 +0,0 @@ -[wrap-git] -directory = freetype2 -url = https://git.savannah.gnu.org/git/freetype/freetype2.git -revision = master - -[provide] -freetype = freetype2_dep -freetype2 = freetype2_dep From c43e4fba3cb93407e149cc15be37e8ef54c970ce Mon Sep 17 00:00:00 2001 From: Myaamori Date: Wed, 7 Apr 2021 12:29:47 +0100 Subject: [PATCH 255/271] meson: add Hunspell port This moves the visibility logic (HUNSPELL_STATIC/BUILDING_LIBHUNSPELL) to the build system. Only relevant on Windows. --- meson.build | 2 +- src/spellchecker_hunspell.cpp | 1 - subprojects/hunspell.wrap | 9 + subprojects/hunspell/ABOUT-NLS | 1068 - subprojects/hunspell/AUTHORS | 5 - subprojects/hunspell/AUTHORS.myspell | 67 - subprojects/hunspell/BUGS | 5 - subprojects/hunspell/COPYING | 12 - subprojects/hunspell/COPYING.LGPL | 515 - subprojects/hunspell/COPYING.MPL | 470 - subprojects/hunspell/ChangeLog | 1930 -- subprojects/hunspell/ChangeLog.O | 524 - subprojects/hunspell/INSTALL | 229 - subprojects/hunspell/NEWS | 650 - subprojects/hunspell/README | 182 - subprojects/hunspell/README.myspell | 69 - subprojects/hunspell/THANKS | 136 - subprojects/hunspell/TODO | 4 - subprojects/hunspell/license.hunspell | 55 - subprojects/hunspell/license.myspell | 61 - subprojects/hunspell/src/hunspell/README | 21 - .../hunspell/src/hunspell/affentry.cxx | 1003 - .../hunspell/src/hunspell/affentry.hxx | 144 - .../hunspell/src/hunspell/affixmgr.cxx | 4538 ---- .../hunspell/src/hunspell/affixmgr.hxx | 252 - subprojects/hunspell/src/hunspell/atypes.hxx | 107 - .../hunspell/src/hunspell/baseaffix.hxx | 32 - subprojects/hunspell/src/hunspell/csutil.cxx | 5863 ----- subprojects/hunspell/src/hunspell/csutil.hxx | 223 - subprojects/hunspell/src/hunspell/dictmgr.cxx | 182 - subprojects/hunspell/src/hunspell/dictmgr.hxx | 39 - subprojects/hunspell/src/hunspell/filemgr.cxx | 53 - subprojects/hunspell/src/hunspell/filemgr.hxx | 28 - subprojects/hunspell/src/hunspell/hashmgr.cxx | 936 - subprojects/hunspell/src/hunspell/hashmgr.hxx | 69 - subprojects/hunspell/src/hunspell/htypes.hxx | 32 - .../hunspell/src/hunspell/hunspell.cxx | 2040 -- .../hunspell/src/hunspell/hunspell.dsp | 164 - subprojects/hunspell/src/hunspell/hunspell.h | 95 - .../hunspell/src/hunspell/hunspell.hxx | 184 - subprojects/hunspell/src/hunspell/hunvisapi.h | 18 - .../hunspell/src/hunspell/hunvisapi.h.in | 18 - subprojects/hunspell/src/hunspell/hunzip.cxx | 196 - subprojects/hunspell/src/hunspell/hunzip.hxx | 47 - subprojects/hunspell/src/hunspell/langnum.hxx | 38 - .../hunspell/src/hunspell/license.hunspell | 59 - .../hunspell/src/hunspell/license.myspell | 61 - subprojects/hunspell/src/hunspell/makefile.mk | 65 - subprojects/hunspell/src/hunspell/phonet.cxx | 293 - subprojects/hunspell/src/hunspell/phonet.hxx | 52 - subprojects/hunspell/src/hunspell/replist.cxx | 87 - subprojects/hunspell/src/hunspell/replist.hxx | 30 - .../hunspell/src/hunspell/suggestmgr.cxx | 2029 -- .../hunspell/src/hunspell/suggestmgr.hxx | 115 - .../hunspell/src/hunspell/utf_info.cxx | 19676 ---------------- subprojects/hunspell/src/hunspell/w_char.hxx | 21 - subprojects/hunspell/src/win_api/config.h | 208 - subprojects/packagefiles/hunspell/meson.build | 9 + .../hunspell/src/hunspell/meson.build | 23 + 59 files changed, 42 insertions(+), 45002 deletions(-) create mode 100644 subprojects/hunspell.wrap delete mode 100644 subprojects/hunspell/ABOUT-NLS delete mode 100644 subprojects/hunspell/AUTHORS delete mode 100644 subprojects/hunspell/AUTHORS.myspell delete mode 100644 subprojects/hunspell/BUGS delete mode 100644 subprojects/hunspell/COPYING delete mode 100644 subprojects/hunspell/COPYING.LGPL delete mode 100644 subprojects/hunspell/COPYING.MPL delete mode 100644 subprojects/hunspell/ChangeLog delete mode 100644 subprojects/hunspell/ChangeLog.O delete mode 100644 subprojects/hunspell/INSTALL delete mode 100644 subprojects/hunspell/NEWS delete mode 100644 subprojects/hunspell/README delete mode 100644 subprojects/hunspell/README.myspell delete mode 100644 subprojects/hunspell/THANKS delete mode 100644 subprojects/hunspell/TODO delete mode 100644 subprojects/hunspell/license.hunspell delete mode 100644 subprojects/hunspell/license.myspell delete mode 100644 subprojects/hunspell/src/hunspell/README delete mode 100644 subprojects/hunspell/src/hunspell/affentry.cxx delete mode 100644 subprojects/hunspell/src/hunspell/affentry.hxx delete mode 100644 subprojects/hunspell/src/hunspell/affixmgr.cxx delete mode 100644 subprojects/hunspell/src/hunspell/affixmgr.hxx delete mode 100644 subprojects/hunspell/src/hunspell/atypes.hxx delete mode 100644 subprojects/hunspell/src/hunspell/baseaffix.hxx delete mode 100644 subprojects/hunspell/src/hunspell/csutil.cxx delete mode 100644 subprojects/hunspell/src/hunspell/csutil.hxx delete mode 100644 subprojects/hunspell/src/hunspell/dictmgr.cxx delete mode 100644 subprojects/hunspell/src/hunspell/dictmgr.hxx delete mode 100644 subprojects/hunspell/src/hunspell/filemgr.cxx delete mode 100644 subprojects/hunspell/src/hunspell/filemgr.hxx delete mode 100644 subprojects/hunspell/src/hunspell/hashmgr.cxx delete mode 100644 subprojects/hunspell/src/hunspell/hashmgr.hxx delete mode 100644 subprojects/hunspell/src/hunspell/htypes.hxx delete mode 100644 subprojects/hunspell/src/hunspell/hunspell.cxx delete mode 100644 subprojects/hunspell/src/hunspell/hunspell.dsp delete mode 100644 subprojects/hunspell/src/hunspell/hunspell.h delete mode 100644 subprojects/hunspell/src/hunspell/hunspell.hxx delete mode 100644 subprojects/hunspell/src/hunspell/hunvisapi.h delete mode 100644 subprojects/hunspell/src/hunspell/hunvisapi.h.in delete mode 100644 subprojects/hunspell/src/hunspell/hunzip.cxx delete mode 100644 subprojects/hunspell/src/hunspell/hunzip.hxx delete mode 100644 subprojects/hunspell/src/hunspell/langnum.hxx delete mode 100644 subprojects/hunspell/src/hunspell/license.hunspell delete mode 100644 subprojects/hunspell/src/hunspell/license.myspell delete mode 100644 subprojects/hunspell/src/hunspell/makefile.mk delete mode 100644 subprojects/hunspell/src/hunspell/phonet.cxx delete mode 100644 subprojects/hunspell/src/hunspell/phonet.hxx delete mode 100644 subprojects/hunspell/src/hunspell/replist.cxx delete mode 100644 subprojects/hunspell/src/hunspell/replist.hxx delete mode 100644 subprojects/hunspell/src/hunspell/suggestmgr.cxx delete mode 100644 subprojects/hunspell/src/hunspell/suggestmgr.hxx delete mode 100644 subprojects/hunspell/src/hunspell/utf_info.cxx delete mode 100644 subprojects/hunspell/src/hunspell/w_char.hxx delete mode 100644 subprojects/hunspell/src/win_api/config.h create mode 100644 subprojects/packagefiles/hunspell/meson.build create mode 100644 subprojects/packagefiles/hunspell/src/hunspell/meson.build diff --git a/meson.build b/meson.build index 17ca77b56..54675d5c0 100644 --- a/meson.build +++ b/meson.build @@ -183,7 +183,7 @@ foreach dep: [ ['ffms2', '>=2.22', 'FFMS2', ['ffms2', 'ffms2_dep']], # other ['fftw3', '', 'FFTW3', []], - ['hunspell', '', 'Hunspell', []], # needs a proper port + ['hunspell', '', 'Hunspell', ['hunspell', 'hunspell_dep']], ['uchardet', '', 'uchardet', []], # needs a proper port ] dep_version = dep[1] != '' ? dep[1] : '>=0' diff --git a/src/spellchecker_hunspell.cpp b/src/spellchecker_hunspell.cpp index ddb6c4339..64c3d9284 100644 --- a/src/spellchecker_hunspell.cpp +++ b/src/spellchecker_hunspell.cpp @@ -29,7 +29,6 @@ #include -#define HUNSPELL_STATIC #undef near #include diff --git a/subprojects/hunspell.wrap b/subprojects/hunspell.wrap new file mode 100644 index 000000000..aad4741bd --- /dev/null +++ b/subprojects/hunspell.wrap @@ -0,0 +1,9 @@ +[wrap-file] +directory = hunspell-1.7.0 +source_url = https://github.com/hunspell/hunspell/files/2573619/hunspell-1.7.0.tar.gz +source_filename = hunspell-1.7.0.tar.gz +source_hash = 57be4e03ae9dd62c3471f667a0d81a14513e314d4d92081292b90435944ff951 +patch_directory = hunspell + +[provides] +hunspell = hunspell_dep diff --git a/subprojects/hunspell/ABOUT-NLS b/subprojects/hunspell/ABOUT-NLS deleted file mode 100644 index 83bc72ec2..000000000 --- a/subprojects/hunspell/ABOUT-NLS +++ /dev/null @@ -1,1068 +0,0 @@ -1 Notes on the Free Translation Project -*************************************** - -Free software is going international! The Free Translation Project is -a way to get maintainers of free software, translators, and users all -together, so that free software will gradually become able to speak many -languages. A few packages already provide translations for their -messages. - - If you found this `ABOUT-NLS' file inside a distribution, you may -assume that the distributed package does use GNU `gettext' internally, -itself available at your nearest GNU archive site. But you do _not_ -need to install GNU `gettext' prior to configuring, installing or using -this package with messages translated. - - Installers will find here some useful hints. These notes also -explain how users should proceed for getting the programs to use the -available translations. They tell how people wanting to contribute and -work on translations can contact the appropriate team. - - When reporting bugs in the `intl/' directory or bugs which may be -related to internationalization, you should tell about the version of -`gettext' which is used. The information can be found in the -`intl/VERSION' file, in internationalized packages. - -1.1 Quick configuration advice -============================== - -If you want to exploit the full power of internationalization, you -should configure it using - - ./configure --with-included-gettext - -to force usage of internationalizing routines provided within this -package, despite the existence of internationalizing capabilities in the -operating system where this package is being installed. So far, only -the `gettext' implementation in the GNU C library version 2 provides as -many features (such as locale alias, message inheritance, automatic -charset conversion or plural form handling) as the implementation here. -It is also not possible to offer this additional functionality on top -of a `catgets' implementation. Future versions of GNU `gettext' will -very likely convey even more functionality. So it might be a good idea -to change to GNU `gettext' as soon as possible. - - So you need _not_ provide this option if you are using GNU libc 2 or -you have installed a recent copy of the GNU gettext package with the -included `libintl'. - -1.2 INSTALL Matters -=================== - -Some packages are "localizable" when properly installed; the programs -they contain can be made to speak your own native language. Most such -packages use GNU `gettext'. Other packages have their own ways to -internationalization, predating GNU `gettext'. - - By default, this package will be installed to allow translation of -messages. It will automatically detect whether the system already -provides the GNU `gettext' functions. If not, the included GNU -`gettext' library will be used. This library is wholly contained -within this package, usually in the `intl/' subdirectory, so prior -installation of the GNU `gettext' package is _not_ required. -Installers may use special options at configuration time for changing -the default behaviour. The commands: - - ./configure --with-included-gettext - ./configure --disable-nls - -will, respectively, bypass any pre-existing `gettext' to use the -internationalizing routines provided within this package, or else, -_totally_ disable translation of messages. - - When you already have GNU `gettext' installed on your system and run -configure without an option for your new package, `configure' will -probably detect the previously built and installed `libintl.a' file and -will decide to use this. This might not be desirable. You should use -the more recent version of the GNU `gettext' library. I.e. if the file -`intl/VERSION' shows that the library which comes with this package is -more recent, you should use - - ./configure --with-included-gettext - -to prevent auto-detection. - - The configuration process will not test for the `catgets' function -and therefore it will not be used. The reason is that even an -emulation of `gettext' on top of `catgets' could not provide all the -extensions of the GNU `gettext' library. - - Internationalized packages usually have many `po/LL.po' files, where -LL gives an ISO 639 two-letter code identifying the language. Unless -translations have been forbidden at `configure' time by using the -`--disable-nls' switch, all available translations are installed -together with the package. However, the environment variable `LINGUAS' -may be set, prior to configuration, to limit the installed set. -`LINGUAS' should then contain a space separated list of two-letter -codes, stating which languages are allowed. - -1.3 Using This Package -====================== - -As a user, if your language has been installed for this package, you -only have to set the `LANG' environment variable to the appropriate -`LL_CC' combination. If you happen to have the `LC_ALL' or some other -`LC_xxx' environment variables set, you should unset them before -setting `LANG', otherwise the setting of `LANG' will not have the -desired effect. Here `LL' is an ISO 639 two-letter language code, and -`CC' is an ISO 3166 two-letter country code. For example, let's -suppose that you speak German and live in Germany. At the shell -prompt, merely execute `setenv LANG de_DE' (in `csh'), -`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). -This can be done from your `.login' or `.profile' file, once and for -all. - - You might think that the country code specification is redundant. -But in fact, some languages have dialects in different countries. For -example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The -country code serves to distinguish the dialects. - - The locale naming convention of `LL_CC', with `LL' denoting the -language and `CC' denoting the country, is the one use on systems based -on GNU libc. On other systems, some variations of this scheme are -used, such as `LL' or `LL_CC.ENCODING'. You can get the list of -locales supported by your system for your language by running the -command `locale -a | grep '^LL''. - - Not all programs have translations for all languages. By default, an -English message is shown in place of a nonexistent translation. If you -understand other languages, you can set up a priority list of languages. -This is done through a different environment variable, called -`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' -for the purpose of message handling, but you still need to have `LANG' -set to the primary language; this is required by other parts of the -system libraries. For example, some Swedish users who would rather -read translations in German than English for when Swedish is not -available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. - - Special advice for Norwegian users: The language code for Norwegian -bokma*l changed from `no' to `nb' recently (in 2003). During the -transition period, while some message catalogs for this language are -installed under `nb' and some older ones under `no', it's recommended -for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and -older translations are used. - - In the `LANGUAGE' environment variable, but not in the `LANG' -environment variable, `LL_CC' combinations can be abbreviated as `LL' -to denote the language's main dialect. For example, `de' is equivalent -to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' -(Portuguese as spoken in Portugal) in this context. - -1.4 Translating Teams -===================== - -For the Free Translation Project to be a success, we need interested -people who like their own language and write it well, and who are also -able to synergize with other translators speaking the same language. -Each translation team has its own mailing list. The up-to-date list of -teams can be found at the Free Translation Project's homepage, -`http://translationproject.org/', in the "Teams" area. - - If you'd like to volunteer to _work_ at translating messages, you -should become a member of the translating team for your own language. -The subscribing address is _not_ the same as the list itself, it has -`-request' appended. For example, speakers of Swedish can send a -message to `sv-request@li.org', having this message body: - - subscribe - - Keep in mind that team members are expected to participate -_actively_ in translations, or at solving translational difficulties, -rather than merely lurking around. If your team does not exist yet and -you want to start one, or if you are unsure about what to do or how to -get started, please write to `coordinator@translationproject.org' to -reach the coordinator for all translator teams. - - The English team is special. It works at improving and uniformizing -the terminology in use. Proven linguistic skills are praised more than -programming skills, here. - -1.5 Available Packages -====================== - -Languages are not equally supported in all packages. The following -matrix shows the current state of internationalization, as of November -2007. The matrix shows, in regard of each package, for which languages -PO files have been submitted to translation coordination, with a -translation percentage of at least 50%. - - Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo - +----------------------------------------------------+ - Compendium | [] [] [] [] | - a2ps | [] [] [] [] [] | - aegis | () | - ant-phone | () | - anubis | [] | - ap-utils | | - aspell | [] [] [] [] [] | - bash | [] | - bfd | | - bibshelf | [] | - binutils | | - bison | [] [] | - bison-runtime | [] | - bluez-pin | [] [] [] [] [] | - cflow | [] | - clisp | [] [] [] | - console-tools | [] [] | - coreutils | [] [] [] [] | - cpio | | - cpplib | [] [] [] | - cryptonit | [] | - dialog | | - diffutils | [] [] [] [] [] [] | - doodle | [] | - e2fsprogs | [] [] | - enscript | [] [] [] [] | - fetchmail | [] [] () [] [] | - findutils | [] | - findutils_stable | [] [] [] | - flex | [] [] [] | - fslint | | - gas | | - gawk | [] [] [] | - gcal | [] | - gcc | [] | - gettext-examples | [] [] [] [] [] | - gettext-runtime | [] [] [] [] [] | - gettext-tools | [] [] | - gip | [] | - gliv | [] [] | - glunarclock | [] | - gmult | [] [] | - gnubiff | () | - gnucash | [] [] () () [] | - gnuedu | | - gnulib | [] | - gnunet | | - gnunet-gtk | | - gnutls | [] | - gpe-aerial | [] [] | - gpe-beam | [] [] | - gpe-calendar | | - gpe-clock | [] [] | - gpe-conf | [] [] | - gpe-contacts | | - gpe-edit | [] | - gpe-filemanager | | - gpe-go | [] | - gpe-login | [] [] | - gpe-ownerinfo | [] [] | - gpe-package | | - gpe-sketchbook | [] [] | - gpe-su | [] [] | - gpe-taskmanager | [] [] | - gpe-timesheet | [] | - gpe-today | [] [] | - gpe-todo | | - gphoto2 | [] [] [] [] | - gprof | [] [] | - gpsdrive | | - gramadoir | [] [] | - grep | [] [] | - gretl | () | - gsasl | | - gss | | - gst-plugins-bad | [] [] | - gst-plugins-base | [] [] | - gst-plugins-good | [] [] [] | - gst-plugins-ugly | [] [] | - gstreamer | [] [] [] [] [] [] [] | - gtick | () | - gtkam | [] [] [] [] | - gtkorphan | [] [] | - gtkspell | [] [] [] [] | - gutenprint | [] | - hello | [] [] [] [] [] | - herrie | [] | - hylafax | | - idutils | [] [] | - indent | [] [] [] [] | - iso_15924 | | - iso_3166 | [] [] [] [] [] [] [] [] [] [] [] | - iso_3166_2 | | - iso_4217 | [] [] [] | - iso_639 | [] [] [] [] | - jpilot | [] | - jtag | | - jwhois | | - kbd | [] [] [] [] | - keytouch | [] [] | - keytouch-editor | [] | - keytouch-keyboa... | [] | - latrine | () | - ld | [] | - leafpad | [] [] [] [] [] | - libc | [] [] [] [] | - libexif | [] | - libextractor | [] | - libgpewidget | [] [] [] | - libgpg-error | [] | - libgphoto2 | [] [] | - libgphoto2_port | [] [] | - libgsasl | | - libiconv | [] [] | - libidn | [] [] [] | - lifelines | [] () | - lilypond | [] | - lingoteach | | - lprng | | - lynx | [] [] [] [] | - m4 | [] [] [] [] | - mailfromd | | - mailutils | [] | - make | [] [] | - man-db | [] [] [] | - minicom | [] [] [] | - nano | [] [] [] | - opcodes | [] | - parted | [] [] | - pilot-qof | | - popt | [] [] [] | - psmisc | [] | - pwdutils | | - qof | | - radius | [] | - recode | [] [] [] [] [] [] | - rpm | [] | - screem | | - scrollkeeper | [] [] [] [] [] [] [] [] | - sed | [] [] [] | - shared-mime-info | [] [] [] [] () [] [] [] | - sharutils | [] [] [] [] [] [] | - shishi | | - skencil | [] () | - solfege | | - soundtracker | [] [] | - sp | [] | - system-tools-ba... | [] [] [] [] [] [] [] [] [] | - tar | [] [] | - texinfo | [] [] [] | - tin | () () | - tuxpaint | [] [] [] [] [] [] | - unicode-han-tra... | | - unicode-transla... | | - util-linux | [] [] [] [] | - util-linux-ng | [] [] [] [] | - vorbis-tools | [] | - wastesedge | () | - wdiff | [] [] [] [] | - wget | [] [] [] | - xchat | [] [] [] [] [] [] [] | - xkeyboard-config | [] | - xpad | [] [] [] | - +----------------------------------------------------+ - af am ar az be bg bs ca cs cy da de el en en_GB eo - 6 0 2 1 8 26 2 40 48 2 56 88 15 1 15 18 - - es et eu fa fi fr ga gl gu he hi hr hu id is it - +--------------------------------------------------+ - Compendium | [] [] [] [] [] | - a2ps | [] [] [] () | - aegis | | - ant-phone | [] | - anubis | [] | - ap-utils | [] [] | - aspell | [] [] [] | - bash | [] | - bfd | [] [] | - bibshelf | [] [] [] | - binutils | [] [] [] | - bison | [] [] [] [] [] [] | - bison-runtime | [] [] [] [] [] | - bluez-pin | [] [] [] [] [] | - cflow | [] | - clisp | [] [] | - console-tools | | - coreutils | [] [] [] [] [] [] | - cpio | [] [] [] | - cpplib | [] [] | - cryptonit | [] | - dialog | [] [] [] | - diffutils | [] [] [] [] [] [] [] [] [] | - doodle | [] [] | - e2fsprogs | [] [] [] | - enscript | [] [] [] | - fetchmail | [] | - findutils | [] [] [] | - findutils_stable | [] [] [] [] | - flex | [] [] [] | - fslint | | - gas | [] [] | - gawk | [] [] [] [] () | - gcal | [] [] | - gcc | [] | - gettext-examples | [] [] [] [] [] [] [] | - gettext-runtime | [] [] [] [] [] [] | - gettext-tools | [] [] [] [] | - gip | [] [] [] [] | - gliv | () | - glunarclock | [] [] [] | - gmult | [] [] [] | - gnubiff | () () | - gnucash | () () () | - gnuedu | [] | - gnulib | [] [] [] | - gnunet | | - gnunet-gtk | | - gnutls | | - gpe-aerial | [] [] | - gpe-beam | [] [] | - gpe-calendar | | - gpe-clock | [] [] [] [] | - gpe-conf | [] | - gpe-contacts | [] [] | - gpe-edit | [] [] [] [] | - gpe-filemanager | [] | - gpe-go | [] [] [] | - gpe-login | [] [] [] | - gpe-ownerinfo | [] [] [] [] [] | - gpe-package | [] | - gpe-sketchbook | [] [] | - gpe-su | [] [] [] [] | - gpe-taskmanager | [] [] [] | - gpe-timesheet | [] [] [] [] | - gpe-today | [] [] [] [] | - gpe-todo | [] | - gphoto2 | [] [] [] [] [] | - gprof | [] [] [] [] [] | - gpsdrive | [] | - gramadoir | [] [] | - grep | [] [] [] | - gretl | [] [] [] () | - gsasl | [] [] | - gss | [] [] | - gst-plugins-bad | [] [] [] [] | - gst-plugins-base | [] [] [] [] | - gst-plugins-good | [] [] [] [] [] | - gst-plugins-ugly | [] [] [] [] | - gstreamer | [] [] [] | - gtick | [] [] [] | - gtkam | [] [] [] [] | - gtkorphan | [] [] | - gtkspell | [] [] [] [] [] [] [] | - gutenprint | [] | - hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | - herrie | [] | - hylafax | | - idutils | [] [] [] [] [] | - indent | [] [] [] [] [] [] [] [] [] [] | - iso_15924 | [] | - iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] | - iso_3166_2 | [] | - iso_4217 | [] [] [] [] [] [] | - iso_639 | [] [] [] [] [] [] | - jpilot | [] [] | - jtag | [] | - jwhois | [] [] [] [] [] | - kbd | [] [] | - keytouch | [] [] [] | - keytouch-editor | [] | - keytouch-keyboa... | [] [] | - latrine | [] [] | - ld | [] [] [] [] | - leafpad | [] [] [] [] [] [] | - libc | [] [] [] [] [] | - libexif | [] | - libextractor | [] | - libgpewidget | [] [] [] [] [] | - libgpg-error | [] | - libgphoto2 | [] [] [] | - libgphoto2_port | [] [] | - libgsasl | [] [] | - libiconv | [] [] [] | - libidn | [] [] | - lifelines | () | - lilypond | [] [] [] | - lingoteach | [] [] [] | - lprng | | - lynx | [] [] [] | - m4 | [] [] [] [] | - mailfromd | | - mailutils | [] [] | - make | [] [] [] [] [] [] [] [] | - man-db | [] | - minicom | [] [] [] [] | - nano | [] [] [] [] [] [] [] | - opcodes | [] [] [] [] | - parted | [] [] [] | - pilot-qof | | - popt | [] [] [] [] | - psmisc | [] [] | - pwdutils | | - qof | [] | - radius | [] [] | - recode | [] [] [] [] [] [] [] [] | - rpm | [] [] | - screem | | - scrollkeeper | [] [] [] | - sed | [] [] [] [] [] | - shared-mime-info | [] [] [] [] [] [] | - sharutils | [] [] [] [] [] [] [] [] | - shishi | [] | - skencil | [] [] | - solfege | [] | - soundtracker | [] [] [] | - sp | [] | - system-tools-ba... | [] [] [] [] [] [] [] [] [] | - tar | [] [] [] [] [] | - texinfo | [] [] [] | - tin | [] () | - tuxpaint | [] [] | - unicode-han-tra... | | - unicode-transla... | [] [] | - util-linux | [] [] [] [] [] [] [] | - util-linux-ng | [] [] [] [] [] [] [] | - vorbis-tools | | - wastesedge | () | - wdiff | [] [] [] [] [] [] [] [] | - wget | [] [] [] [] [] [] [] [] | - xchat | [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] [] | - xpad | [] [] [] | - +--------------------------------------------------+ - es et eu fa fi fr ga gl gu he hi hr hu id is it - 85 22 14 2 48 101 61 12 2 8 2 6 53 29 1 52 - - ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl nn - +--------------------------------------------------+ - Compendium | [] | - a2ps | () [] [] | - aegis | () | - ant-phone | [] | - anubis | [] [] [] | - ap-utils | [] | - aspell | [] [] | - bash | [] | - bfd | | - bibshelf | [] | - binutils | | - bison | [] [] [] | - bison-runtime | [] [] [] | - bluez-pin | [] [] [] | - cflow | | - clisp | [] | - console-tools | | - coreutils | [] | - cpio | [] | - cpplib | [] | - cryptonit | [] | - dialog | [] [] | - diffutils | [] [] [] | - doodle | | - e2fsprogs | [] | - enscript | [] | - fetchmail | [] [] | - findutils | [] | - findutils_stable | [] | - flex | [] [] | - fslint | | - gas | | - gawk | [] [] | - gcal | | - gcc | | - gettext-examples | [] [] [] | - gettext-runtime | [] [] [] | - gettext-tools | [] [] | - gip | [] [] | - gliv | [] | - glunarclock | [] [] | - gmult | [] [] [] | - gnubiff | | - gnucash | () () () | - gnuedu | | - gnulib | [] [] | - gnunet | | - gnunet-gtk | | - gnutls | [] | - gpe-aerial | [] | - gpe-beam | [] | - gpe-calendar | [] | - gpe-clock | [] [] [] | - gpe-conf | [] [] [] | - gpe-contacts | [] | - gpe-edit | [] [] [] | - gpe-filemanager | [] [] | - gpe-go | [] [] [] | - gpe-login | [] [] [] | - gpe-ownerinfo | [] [] | - gpe-package | [] [] | - gpe-sketchbook | [] [] | - gpe-su | [] [] [] | - gpe-taskmanager | [] [] [] [] | - gpe-timesheet | [] | - gpe-today | [] [] | - gpe-todo | [] | - gphoto2 | [] [] | - gprof | [] | - gpsdrive | [] | - gramadoir | () | - grep | [] [] | - gretl | | - gsasl | [] | - gss | | - gst-plugins-bad | [] | - gst-plugins-base | [] | - gst-plugins-good | [] | - gst-plugins-ugly | [] | - gstreamer | [] | - gtick | [] | - gtkam | [] [] | - gtkorphan | [] | - gtkspell | [] [] | - gutenprint | [] | - hello | [] [] [] [] [] [] [] | - herrie | [] | - hylafax | | - idutils | [] | - indent | [] [] | - iso_15924 | [] | - iso_3166 | [] [] [] [] [] [] [] [] | - iso_3166_2 | [] | - iso_4217 | [] [] [] | - iso_639 | [] [] [] [] | - jpilot | () () | - jtag | | - jwhois | [] | - kbd | [] | - keytouch | [] | - keytouch-editor | [] | - keytouch-keyboa... | | - latrine | [] | - ld | | - leafpad | [] [] | - libc | [] [] [] | - libexif | | - libextractor | | - libgpewidget | [] | - libgpg-error | | - libgphoto2 | [] | - libgphoto2_port | [] | - libgsasl | [] | - libiconv | [] | - libidn | [] [] | - lifelines | [] | - lilypond | [] | - lingoteach | [] | - lprng | | - lynx | [] [] | - m4 | [] [] | - mailfromd | | - mailutils | | - make | [] [] [] | - man-db | | - minicom | [] | - nano | [] [] [] | - opcodes | [] | - parted | [] [] | - pilot-qof | | - popt | [] [] [] | - psmisc | [] [] [] | - pwdutils | | - qof | | - radius | | - recode | [] | - rpm | [] [] | - screem | [] | - scrollkeeper | [] [] [] [] | - sed | [] [] | - shared-mime-info | [] [] [] [] [] [] [] | - sharutils | [] [] | - shishi | | - skencil | | - solfege | () () | - soundtracker | | - sp | () | - system-tools-ba... | [] [] [] [] | - tar | [] [] [] | - texinfo | [] [] | - tin | | - tuxpaint | () [] [] | - unicode-han-tra... | | - unicode-transla... | | - util-linux | [] [] | - util-linux-ng | [] [] | - vorbis-tools | | - wastesedge | [] | - wdiff | [] [] | - wget | [] [] | - xchat | [] [] [] [] | - xkeyboard-config | [] [] [] | - xpad | [] [] [] | - +--------------------------------------------------+ - ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl nn - 51 2 25 3 2 0 6 0 2 2 20 0 11 1 103 6 - - or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta - +--------------------------------------------------+ - Compendium | [] [] [] [] [] | - a2ps | () [] [] [] [] [] [] | - aegis | () () | - ant-phone | [] [] | - anubis | [] [] [] | - ap-utils | () | - aspell | [] [] [] | - bash | [] [] | - bfd | | - bibshelf | [] | - binutils | [] [] | - bison | [] [] [] [] [] | - bison-runtime | [] [] [] [] [] | - bluez-pin | [] [] [] [] [] [] [] [] [] | - cflow | [] | - clisp | [] | - console-tools | [] | - coreutils | [] [] [] [] | - cpio | [] [] [] | - cpplib | [] | - cryptonit | [] [] | - dialog | [] | - diffutils | [] [] [] [] [] [] | - doodle | [] [] | - e2fsprogs | [] [] | - enscript | [] [] [] [] [] | - fetchmail | [] [] [] | - findutils | [] [] [] | - findutils_stable | [] [] [] [] [] [] | - flex | [] [] [] [] [] | - fslint | [] | - gas | | - gawk | [] [] [] [] | - gcal | [] | - gcc | [] [] | - gettext-examples | [] [] [] [] [] [] [] [] | - gettext-runtime | [] [] [] [] [] [] [] [] | - gettext-tools | [] [] [] [] [] [] [] | - gip | [] [] [] [] | - gliv | [] [] [] [] [] [] | - glunarclock | [] [] [] [] [] [] | - gmult | [] [] [] [] | - gnubiff | () [] | - gnucash | () [] | - gnuedu | | - gnulib | [] [] [] | - gnunet | | - gnunet-gtk | [] | - gnutls | [] [] | - gpe-aerial | [] [] [] [] [] [] [] | - gpe-beam | [] [] [] [] [] [] [] | - gpe-calendar | [] [] [] [] | - gpe-clock | [] [] [] [] [] [] [] [] | - gpe-conf | [] [] [] [] [] [] [] | - gpe-contacts | [] [] [] [] [] | - gpe-edit | [] [] [] [] [] [] [] [] [] | - gpe-filemanager | [] [] | - gpe-go | [] [] [] [] [] [] [] [] | - gpe-login | [] [] [] [] [] [] [] [] | - gpe-ownerinfo | [] [] [] [] [] [] [] [] | - gpe-package | [] [] | - gpe-sketchbook | [] [] [] [] [] [] [] [] | - gpe-su | [] [] [] [] [] [] [] [] | - gpe-taskmanager | [] [] [] [] [] [] [] [] | - gpe-timesheet | [] [] [] [] [] [] [] [] | - gpe-today | [] [] [] [] [] [] [] [] | - gpe-todo | [] [] [] [] | - gphoto2 | [] [] [] [] [] [] | - gprof | [] [] [] | - gpsdrive | [] [] | - gramadoir | [] [] | - grep | [] [] [] [] | - gretl | [] [] [] | - gsasl | [] [] [] | - gss | [] [] [] [] | - gst-plugins-bad | [] [] [] | - gst-plugins-base | [] [] | - gst-plugins-good | [] [] | - gst-plugins-ugly | [] [] [] | - gstreamer | [] [] [] [] | - gtick | [] | - gtkam | [] [] [] [] [] | - gtkorphan | [] | - gtkspell | [] [] [] [] [] [] [] [] | - gutenprint | [] | - hello | [] [] [] [] [] [] [] [] | - herrie | [] [] [] | - hylafax | | - idutils | [] [] [] [] [] | - indent | [] [] [] [] [] [] [] | - iso_15924 | | - iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] | - iso_3166_2 | | - iso_4217 | [] [] [] [] [] [] [] | - iso_639 | [] [] [] [] [] [] [] | - jpilot | | - jtag | [] | - jwhois | [] [] [] [] | - kbd | [] [] [] | - keytouch | [] | - keytouch-editor | [] | - keytouch-keyboa... | [] | - latrine | | - ld | [] | - leafpad | [] [] [] [] [] [] | - libc | [] [] [] [] | - libexif | [] [] | - libextractor | [] [] | - libgpewidget | [] [] [] [] [] [] [] [] | - libgpg-error | [] [] [] | - libgphoto2 | [] | - libgphoto2_port | [] [] [] | - libgsasl | [] [] [] [] | - libiconv | [] [] [] | - libidn | [] [] () | - lifelines | [] [] | - lilypond | | - lingoteach | [] | - lprng | [] | - lynx | [] [] [] | - m4 | [] [] [] [] [] | - mailfromd | [] | - mailutils | [] [] [] | - make | [] [] [] [] | - man-db | [] [] [] [] | - minicom | [] [] [] [] [] | - nano | [] [] [] [] | - opcodes | [] [] | - parted | [] | - pilot-qof | | - popt | [] [] [] [] | - psmisc | [] [] | - pwdutils | [] [] | - qof | [] [] | - radius | [] [] | - recode | [] [] [] [] [] [] [] | - rpm | [] [] [] [] | - screem | | - scrollkeeper | [] [] [] [] [] [] [] | - sed | [] [] [] [] [] [] [] [] [] | - shared-mime-info | [] [] [] [] [] [] | - sharutils | [] [] [] [] | - shishi | [] | - skencil | [] [] [] | - solfege | [] | - soundtracker | [] [] | - sp | | - system-tools-ba... | [] [] [] [] [] [] [] [] [] | - tar | [] [] [] [] | - texinfo | [] [] [] [] | - tin | () | - tuxpaint | [] [] [] [] [] [] | - unicode-han-tra... | | - unicode-transla... | | - util-linux | [] [] [] [] | - util-linux-ng | [] [] [] [] | - vorbis-tools | [] | - wastesedge | | - wdiff | [] [] [] [] [] [] [] | - wget | [] [] [] [] | - xchat | [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] | - xpad | [] [] [] | - +--------------------------------------------------+ - or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta - 0 5 77 31 53 4 58 72 3 45 46 9 45 122 3 - - tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu - +---------------------------------------------------+ - Compendium | [] [] [] [] | 19 - a2ps | [] [] [] | 19 - aegis | [] | 1 - ant-phone | [] [] | 6 - anubis | [] [] [] | 11 - ap-utils | () [] | 4 - aspell | [] [] [] | 16 - bash | [] | 6 - bfd | | 2 - bibshelf | [] | 7 - binutils | [] [] [] [] | 9 - bison | [] [] [] [] | 20 - bison-runtime | [] [] [] [] | 18 - bluez-pin | [] [] [] [] [] [] | 28 - cflow | [] [] | 5 - clisp | | 9 - console-tools | [] [] | 5 - coreutils | [] [] [] | 18 - cpio | [] [] [] [] | 11 - cpplib | [] [] [] [] [] | 12 - cryptonit | [] | 6 - dialog | [] [] [] | 9 - diffutils | [] [] [] [] [] | 29 - doodle | [] | 6 - e2fsprogs | [] [] | 10 - enscript | [] [] [] | 16 - fetchmail | [] [] | 12 - findutils | [] [] [] | 11 - findutils_stable | [] [] [] [] | 18 - flex | [] [] | 15 - fslint | [] | 2 - gas | [] | 3 - gawk | [] [] [] | 16 - gcal | [] | 5 - gcc | [] [] [] | 7 - gettext-examples | [] [] [] [] [] [] | 29 - gettext-runtime | [] [] [] [] [] [] | 28 - gettext-tools | [] [] [] [] [] | 20 - gip | [] [] | 13 - gliv | [] [] | 11 - glunarclock | [] [] [] | 15 - gmult | [] [] [] [] | 16 - gnubiff | [] | 2 - gnucash | () [] | 5 - gnuedu | [] | 2 - gnulib | [] | 10 - gnunet | | 0 - gnunet-gtk | [] [] | 3 - gnutls | | 4 - gpe-aerial | [] [] | 14 - gpe-beam | [] [] | 14 - gpe-calendar | [] [] | 7 - gpe-clock | [] [] [] [] | 21 - gpe-conf | [] [] [] | 16 - gpe-contacts | [] [] | 10 - gpe-edit | [] [] [] [] [] | 22 - gpe-filemanager | [] [] | 7 - gpe-go | [] [] [] [] | 19 - gpe-login | [] [] [] [] [] | 21 - gpe-ownerinfo | [] [] [] [] | 21 - gpe-package | [] | 6 - gpe-sketchbook | [] [] | 16 - gpe-su | [] [] [] [] | 21 - gpe-taskmanager | [] [] [] [] | 21 - gpe-timesheet | [] [] [] [] | 18 - gpe-today | [] [] [] [] [] | 21 - gpe-todo | [] [] | 8 - gphoto2 | [] [] [] [] | 21 - gprof | [] [] | 13 - gpsdrive | [] | 5 - gramadoir | [] | 7 - grep | [] | 12 - gretl | | 6 - gsasl | [] [] [] | 9 - gss | [] | 7 - gst-plugins-bad | [] [] [] | 13 - gst-plugins-base | [] [] | 11 - gst-plugins-good | [] [] [] [] [] | 16 - gst-plugins-ugly | [] [] [] | 13 - gstreamer | [] [] [] | 18 - gtick | [] [] | 7 - gtkam | [] | 16 - gtkorphan | [] | 7 - gtkspell | [] [] [] [] [] [] | 27 - gutenprint | | 4 - hello | [] [] [] [] [] | 38 - herrie | [] [] | 8 - hylafax | | 0 - idutils | [] [] | 15 - indent | [] [] [] [] [] | 28 - iso_15924 | [] [] | 4 - iso_3166 | [] [] [] [] [] [] [] [] [] | 54 - iso_3166_2 | [] [] | 4 - iso_4217 | [] [] [] [] [] | 24 - iso_639 | [] [] [] [] [] | 26 - jpilot | [] [] [] [] | 7 - jtag | [] | 3 - jwhois | [] [] [] | 13 - kbd | [] [] [] | 13 - keytouch | [] | 8 - keytouch-editor | [] | 5 - keytouch-keyboa... | [] | 5 - latrine | [] [] | 5 - ld | [] [] [] [] | 10 - leafpad | [] [] [] [] [] | 24 - libc | [] [] [] | 19 - libexif | [] | 5 - libextractor | [] | 5 - libgpewidget | [] [] [] | 20 - libgpg-error | [] | 6 - libgphoto2 | [] [] | 9 - libgphoto2_port | [] [] [] | 11 - libgsasl | [] | 8 - libiconv | [] [] | 11 - libidn | [] [] | 11 - lifelines | | 4 - lilypond | [] | 6 - lingoteach | [] | 6 - lprng | [] | 2 - lynx | [] [] [] | 15 - m4 | [] [] [] | 18 - mailfromd | [] [] | 3 - mailutils | [] [] | 8 - make | [] [] [] | 20 - man-db | [] | 9 - minicom | [] | 14 - nano | [] [] [] | 20 - opcodes | [] [] | 10 - parted | [] [] [] | 11 - pilot-qof | [] | 1 - popt | [] [] [] [] | 18 - psmisc | [] [] | 10 - pwdutils | [] | 3 - qof | [] | 4 - radius | [] [] | 7 - recode | [] [] [] | 25 - rpm | [] [] [] [] | 13 - screem | [] | 2 - scrollkeeper | [] [] [] [] | 26 - sed | [] [] [] [] | 23 - shared-mime-info | [] [] [] | 29 - sharutils | [] [] [] | 23 - shishi | [] | 3 - skencil | [] | 7 - solfege | [] | 3 - soundtracker | [] [] | 9 - sp | [] | 3 - system-tools-ba... | [] [] [] [] [] [] [] | 38 - tar | [] [] [] | 17 - texinfo | [] [] [] | 15 - tin | | 1 - tuxpaint | [] [] [] | 19 - unicode-han-tra... | | 0 - unicode-transla... | | 2 - util-linux | [] [] [] | 20 - util-linux-ng | [] [] [] | 20 - vorbis-tools | [] [] | 4 - wastesedge | | 1 - wdiff | [] [] | 23 - wget | [] [] [] | 20 - xchat | [] [] [] [] | 29 - xkeyboard-config | [] [] [] | 14 - xpad | [] [] [] | 15 - +---------------------------------------------------+ - 76 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu - 163 domains 0 3 1 74 51 0 143 21 1 57 7 45 0 2036 - - Some counters in the preceding matrix are higher than the number of -visible blocks let us expect. This is because a few extra PO files are -used for implementing regional variants of languages, or language -dialects. - - For a PO file in the matrix above to be effective, the package to -which it applies should also have been internationalized and -distributed as such by its maintainer. There might be an observable -lag between the mere existence a PO file and its wide availability in a -distribution. - - If November 2007 seems to be old, you may fetch a more recent copy -of this `ABOUT-NLS' file on most GNU archive sites. The most -up-to-date matrix with full percentage details can be found at -`http://translationproject.org/extra/matrix.html'. - -1.6 Using `gettext' in new packages -=================================== - -If you are writing a freely available program and want to -internationalize it you are welcome to use GNU `gettext' in your -package. Of course you have to respect the GNU Library General Public -License which covers the use of the GNU `gettext' library. This means -in particular that even non-free programs can use `libintl' as a shared -library, whereas only free software can use `libintl' as a static -library or use modified versions of `libintl'. - - Once the sources are changed appropriately and the setup can handle -the use of `gettext' the only thing missing are the translations. The -Free Translation Project is also available for packages which are not -developed inside the GNU project. Therefore the information given above -applies also for every other Free Software Project. Contact -`coordinator@translationproject.org' to make the `.pot' files available -to the translation teams. - diff --git a/subprojects/hunspell/AUTHORS b/subprojects/hunspell/AUTHORS deleted file mode 100644 index f137fa26b..000000000 --- a/subprojects/hunspell/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -Author of Hunspell: -Németh László nemeth (at) numbertext.org - -Hunspell based on OpenOffice.org's Myspell. MySpell's author: -Kevin Hendricks kevin.hendricks (at) sympatico.ca diff --git a/subprojects/hunspell/AUTHORS.myspell b/subprojects/hunspell/AUTHORS.myspell deleted file mode 100644 index 36f8589e3..000000000 --- a/subprojects/hunspell/AUTHORS.myspell +++ /dev/null @@ -1,67 +0,0 @@ -Developer Credits: - -Special credit and thanks go to ispell's creator Geoff Kuenning. -Ispell affix compression code was used as the basis for the -affix code used in MySpell. Specifically Geoff's use of a -conds[] array that makes it easy to check if the conditions -required for a particular affix are present was very -ingenious! Kudos to Geoff. Very nicely done. -BTW: ispell is available under a BSD style license -from Geoff Kuennings ispell website: -http://www.cs.ucla.edu/ficus-members/geoff/ispell.html - - -Kevin Hendricks is the original -author and now maintainer of the MySpell codebase. Recent -additions include ngram support, and related character maps -to help improve and create suggestions for very poorly -spelled words. - -Please send any and all contributions or improvements -to him or to dev@lingucomponent.openoffice.org. - - -David Einstein (Deinst@world.std.com) developed an almost -complete rewrite of MySpell for use by the Mozilla project. -David and I are now working on parallel development tracks -to help our respective projects (Mozilla and OpenOffice.org) -and we will maintain full affix file and dictionary file -compatibility and work on merging our versions of MySpell -back into a single tree. David has been a significant help -in improving MySpell. - - -Németh László is the author of -the Hungarian dictionary and he developed and contributed -extensive changes to MySpell including ... - * code to support compound words in MySpell - * fixed numerous problems with encoding case conversion tables. - * designed/developed replacement tables to improve suggestions - * changed affix file parsing to trees to greatly speed loading - * removed the need for malloc/free pairs in suffix_check which - speeds up spell checking in suffix rich languages by 20% - -Davide Prina , Giuseppe Modugno -, Gianluca Turconi -all from the it_IT OpenOffice.org team performed an -extremely detailed code review of MySpell and generated -fixes for bugs, leaks, and speedup improvements. - -Simon Brouwer for fixes and enhancements -that have greatly improved MySpell auggestions - * n-gram suggestions for an initcap word have an init. cap. - * fix for too many n-gram suggestions from specialized dictionary, - * fix for long suggestions rather than close ones in case of - dictionaries with many compound words (kompuuter) - * optionally disabling split-word suggestions (controlled - by NOSPLITSUGS line in affix file) - - -Special Thanks to all others who have either contributed ideas or -testing for MySpell - - -Thanks, - -Kevin Hendricks -kevin.hendricks@sympatico.ca diff --git a/subprojects/hunspell/BUGS b/subprojects/hunspell/BUGS deleted file mode 100644 index 6a5468e0f..000000000 --- a/subprojects/hunspell/BUGS +++ /dev/null @@ -1,5 +0,0 @@ -* Interactive interface has some visualization problem with long lines - -* Experimental -U, -u options don't support Unicode. - -* Compound handling is not thread safe in Hungarian specific code. diff --git a/subprojects/hunspell/COPYING b/subprojects/hunspell/COPYING deleted file mode 100644 index 5bede4f5c..000000000 --- a/subprojects/hunspell/COPYING +++ /dev/null @@ -1,12 +0,0 @@ -GPL 2.0/LGPL 2.1/MPL 1.1 tri-license - -The contents of this software may be used under the terms of -the GNU General Public License Version 2 or later (the "GPL"), or -the GNU Lesser General Public License Version 2.1 or later (the "LGPL", -see COPYING.LGPL) or (excepting the LGPLed GNU gettext library in the -intl/ directory) the Mozilla Public License Version 1.1 or later -(the "MPL", see COPYING.MPL). - -Software distributed under these licenses is distributed on an "AS IS" basis, -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the licences -for the specific language governing rights and limitations under the licenses. diff --git a/subprojects/hunspell/COPYING.LGPL b/subprojects/hunspell/COPYING.LGPL deleted file mode 100644 index c4792dd27..000000000 --- a/subprojects/hunspell/COPYING.LGPL +++ /dev/null @@ -1,515 +0,0 @@ - - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations -below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. -^L - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it -becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. -^L - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control -compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. -^L - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. -^L - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. -^L - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. -^L - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply, and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License -may add an explicit geographical distribution limitation excluding those -countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. -^L - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS -^L - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms -of the ordinary General Public License). - - To apply these terms, attach the following notices to the library. -It is safest to attach them to the start of each source file to most -effectively convey the exclusion of warranty; and each file should -have at least the "copyright" line and a pointer to where the full -notice is found. - - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper -mail. - -You should also get your employer (if you work as a programmer) or -your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James -Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/subprojects/hunspell/COPYING.MPL b/subprojects/hunspell/COPYING.MPL deleted file mode 100644 index 7714141d1..000000000 --- a/subprojects/hunspell/COPYING.MPL +++ /dev/null @@ -1,470 +0,0 @@ - MOZILLA PUBLIC LICENSE - Version 1.1 - - --------------- - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the - Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to - the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original - Code, prior Modifications used by a Contributor, and the Modifications - made by that particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the - combination of the Original Code and Modifications, in each case - including portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally - accepted in the software development community for the electronic - transfer of data. - - 1.5. "Executable" means Covered Code in any form other than Source - Code. - - 1.6. "Initial Developer" means the individual or entity identified - as the Initial Developer in the Source Code notice required by Exhibit - A. - - 1.7. "Larger Work" means a work which combines Covered Code or - portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum - extent possible, whether at the time of the initial grant or - subsequently acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the - substance or structure of either the Original Code or any previous - Modifications. When Covered Code is released as a series of files, a - Modification is: - A. Any addition to or deletion from the contents of a file - containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or - previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code - which is described in the Source Code notice required by Exhibit A as - Original Code, and which, at the time of its release under this - License is not already Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or - hereafter acquired, including without limitation, method, process, - and apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for - making modifications to it, including all modules it contains, plus - any associated interface definition files, scripts used to control - compilation and installation of an Executable, or source code - differential comparisons against either the Original Code or another - well known, available Covered Code of the Contributor's choice. The - Source Code can be in a compressed or archival form, provided the - appropriate decompression or de-archiving software is widely available - for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity - exercising rights under, and complying with all of the terms of, this - License or a future version of this License issued under Section 6.1. - For legal entities, "You" includes any entity which controls, is - controlled by, or is under common control with You. For purposes of - this definition, "control" means (a) the power, direct or indirect, - to cause the direction or management of such entity, whether by - contract or otherwise, or (b) ownership of more than fifty percent - (50%) of the outstanding shares or beneficial ownership of such - entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, - non-exclusive license, subject to third party intellectual property - claims: - (a) under intellectual property rights (other than patent or - trademark) Licensable by Initial Developer to use, reproduce, - modify, display, perform, sublicense and distribute the Original - Code (or portions thereof) with or without Modifications, and/or - as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or - selling of Original Code, to make, have made, use, practice, - sell, and offer for sale, and/or otherwise dispose of the - Original Code (or portions thereof). - - (c) the licenses granted in this Section 2.1(a) and (b) are - effective on the date Initial Developer first distributes - Original Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is - granted: 1) for code that You delete from the Original Code; 2) - separate from the Original Code; or 3) for infringements caused - by: i) the modification of the Original Code or ii) the - combination of the Original Code with other software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor - hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or - trademark) Licensable by Contributor, to use, reproduce, modify, - display, perform, sublicense and distribute the Modifications - created by such Contributor (or portions thereof) either on an - unmodified basis, with other Modifications, as Covered Code - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or - selling of Modifications made by that Contributor either alone - and/or in combination with its Contributor Version (or portions - of such combination), to make, use, sell, offer for sale, have - made, and/or otherwise dispose of: 1) Modifications made by that - Contributor (or portions thereof); and 2) the combination of - Modifications made by that Contributor with its Contributor - Version (or portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are - effective on the date Contributor first makes Commercial Use of - the Covered Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is - granted: 1) for any code that Contributor has deleted from the - Contributor Version; 2) separate from the Contributor Version; - 3) for infringements caused by: i) third party modifications of - Contributor Version or ii) the combination of Modifications made - by that Contributor with other software (except as part of the - Contributor Version) or other devices; or 4) under Patent Claims - infringed by Covered Code in the absence of Modifications made by - that Contributor. - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are - governed by the terms of this License, including without limitation - Section 2.2. The Source Code version of Covered Code may be - distributed only under the terms of this License or a future version - of this License released under Section 6.1, and You must include a - copy of this License with every copy of the Source Code You - distribute. You may not offer or impose any terms on any Source Code - version that alters or restricts the applicable version of this - License or the recipients' rights hereunder. However, You may include - an additional document offering the additional rights described in - Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be - made available in Source Code form under the terms of this License - either on the same media as an Executable version or via an accepted - Electronic Distribution Mechanism to anyone to whom you made an - Executable version available; and if made available via Electronic - Distribution Mechanism, must remain available for at least twelve (12) - months after the date it initially became available, or at least six - (6) months after a subsequent version of that particular Modification - has been made available to such recipients. You are responsible for - ensuring that the Source Code version remains available even if the - Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a - file documenting the changes You made to create that Covered Code and - the date of any change. You must include a prominent statement that - the Modification is derived, directly or indirectly, from Original - Code provided by the Initial Developer and including the name of the - Initial Developer in (a) the Source Code, and (b) in any notice in an - Executable version or related documentation in which You describe the - origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's - intellectual property rights is required to exercise the rights - granted by such Contributor under Sections 2.1 or 2.2, - Contributor must include a text file with the Source Code - distribution titled "LEGAL" which describes the claim and the - party making the claim in sufficient detail that a recipient will - know whom to contact. If Contributor obtains such knowledge after - the Modification is made available as described in Section 3.2, - Contributor shall promptly modify the LEGAL file in all copies - Contributor makes available thereafter and shall take other steps - (such as notifying appropriate mailing lists or newsgroups) - reasonably calculated to inform those who received the Covered - Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming - interface and Contributor has knowledge of patent licenses which - are reasonably necessary to implement that API, Contributor must - also include this information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to - Section 3.4(a) above, Contributor believes that Contributor's - Modifications are Contributor's original creation(s) and/or - Contributor has sufficient rights to grant the rights conveyed by - this License. - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source - Code. If it is not possible to put such notice in a particular Source - Code file due to its structure, then You must include such notice in a - location (such as a relevant directory) where a user would be likely - to look for such a notice. If You created one or more Modification(s) - You may add your name as a Contributor to the notice described in - Exhibit A. You must also duplicate this License in any documentation - for the Source Code where You describe recipients' rights or ownership - rights relating to Covered Code. You may choose to offer, and to - charge a fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Code. However, You - may do so only on Your own behalf, and not on behalf of the Initial - Developer or any Contributor. You must make it absolutely clear than - any such warranty, support, indemnity or liability obligation is - offered by You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred by the - Initial Developer or such Contributor as a result of warranty, - support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the - requirements of Section 3.1-3.5 have been met for that Covered Code, - and if You include a notice stating that the Source Code version of - the Covered Code is available under the terms of this License, - including a description of how and where You have fulfilled the - obligations of Section 3.2. The notice must be conspicuously included - in any notice in an Executable version, related documentation or - collateral in which You describe recipients' rights relating to the - Covered Code. You may distribute the Executable version of Covered - Code or ownership rights under a license of Your choice, which may - contain terms different from this License, provided that You are in - compliance with the terms of this License and that the license for the - Executable version does not attempt to limit or alter the recipient's - rights in the Source Code version from the rights set forth in this - License. If You distribute the Executable version under a different - license You must make it absolutely clear that any terms which differ - from this License are offered by You alone, not by the Initial - Developer or any Contributor. You hereby agree to indemnify the - Initial Developer and every Contributor for any liability incurred by - the Initial Developer or such Contributor as a result of any such - terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code - not governed by the terms of this License and distribute the Larger - Work as a single product. In such a case, You must make sure the - requirements of this License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this - License with respect to some or all of the Covered Code due to - statute, judicial order, or regulation then You must: (a) comply with - the terms of this License to the maximum extent possible; and (b) - describe the limitations and the code they affect. Such description - must be included in the LEGAL file described in Section 3.4 and must - be included with all distributions of the Source Code. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has - attached the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised - and/or new versions of the License from time to time. Each version - will be given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the - License, You may always continue to use it under the terms of that - version. You may also choose to use such Covered Code under the terms - of any subsequent version of the License published by Netscape. No one - other than Netscape has the right to modify the terms applicable to - Covered Code created under this License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may - only do in order to apply it to code which is not already Covered Code - governed by this License), You must (a) rename Your license so that - the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", - "MPL", "NPL" or any confusingly similar phrase do not appear in your - license (except to note that your license differs from this License) - and (b) otherwise make it clear that Your version of the license - contains terms which differ from the Mozilla Public License and - Netscape Public License. (Filling in the name of the Initial - Developer, Original Code or Contributor in the notice described in - Exhibit A shall not of themselves be deemed to be modifications of - this License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF - DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. - THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE - IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, - YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE - COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER - OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate - automatically if You fail to comply with terms herein and fail to cure - such breach within 30 days of becoming aware of the breach. All - sublicenses to the Covered Code which are properly granted shall - survive any termination of this License. Provisions which, by their - nature, must remain in effect beyond the termination of this License - shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement - claim (excluding declatory judgment actions) against Initial Developer - or a Contributor (the Initial Developer or Contributor against whom - You file such action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly - infringes any patent, then any and all rights granted by such - Participant to You under Sections 2.1 and/or 2.2 of this License - shall, upon 60 days notice from Participant terminate prospectively, - unless if within 60 days after receipt of notice You either: (i) - agree in writing to pay Participant a mutually agreeable reasonable - royalty for Your past and future use of Modifications made by such - Participant, or (ii) withdraw Your litigation claim with respect to - the Contributor Version against such Participant. If within 60 days - of notice, a reasonable royalty and payment arrangement are not - mutually agreed upon in writing by the parties or the litigation claim - is not withdrawn, the rights granted by Participant to You under - Sections 2.1 and/or 2.2 automatically terminate at the expiration of - the 60 day notice period specified above. - - (b) any software, hardware, or device, other than such Participant's - Contributor Version, directly or indirectly infringes any patent, then - any rights granted to You by such Participant under Sections 2.1(b) - and 2.2(b) are revoked effective as of the date You first made, used, - sold, distributed, or had made, Modifications made by that - Participant. - - 8.3. If You assert a patent infringement claim against Participant - alleging that such Participant's Contributor Version directly or - indirectly infringes any patent where such claim is resolved (such as - by license or settlement) prior to the initiation of patent - infringement litigation, then the reasonable value of the licenses - granted by such Participant under Sections 2.1 or 2.2 shall be taken - into account in determining the amount or value of any payment or - license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, - all end user license agreements (excluding distributors and resellers) - which have been validly granted by You or any distributor hereunder - prior to termination shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL - DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, - OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR - ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY - CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, - WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY - RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW - PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE - EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO - THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in - 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer - software" and "commercial computer software documentation," as such - terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 - C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), - all U.S. Government End Users acquire Covered Code with only those - rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. This License shall be governed by - California law provisions (except to the extent applicable law, if - any, provides otherwise), excluding its conflict-of-law provisions. - With respect to disputes in which at least one party is a citizen of, - or an entity chartered or registered to do business in the United - States of America, any litigation relating to this License shall be - subject to the jurisdiction of the Federal Courts of the Northern - District of California, with venue lying in Santa Clara County, - California, with the losing party responsible for costs, including - without limitation, court costs and reasonable attorneys' fees and - expenses. The application of the United Nations Convention on - Contracts for the International Sale of Goods is expressly excluded. - Any law or regulation which provides that the language of a contract - shall be construed against the drafter shall not apply to this - License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or indirectly, - out of its utilization of rights under this License and You agree to - work with Initial Developer and Contributors to distribute such - responsibility on an equitable basis. Nothing herein is intended or - shall be deemed to constitute any admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as - "Multiple-Licensed". "Multiple-Licensed" means that the Initial - Developer permits you to utilize portions of the Covered Code under - Your choice of the NPL or the alternative licenses, if any, specified - by the Initial Developer in the file described in Exhibit A. - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License - Version 1.1 (the "License"); you may not use this file except in - compliance with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - License for the specific language governing rights and limitations - under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. - Portions created by ______________________ are Copyright (C) ______ - _______________________. All Rights Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms - of the _____ license (the "[___] License"), in which case the - provisions of [______] License are applicable instead of those - above. If you wish to allow use of your version of this file only - under the terms of the [____] License and not to allow others to use - your version of this file under the MPL, indicate your decision by - deleting the provisions above and replace them with the notice and - other provisions required by the [___] License. If you do not delete - the provisions above, a recipient may use your version of this file - under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of - the notices in the Source Code files of the Original Code. You should - use the text of this Exhibit A rather than the text found in the - Original Code Source Code for Your Modifications.] - diff --git a/subprojects/hunspell/ChangeLog b/subprojects/hunspell/ChangeLog deleted file mode 100644 index 4b99a3f1b..000000000 --- a/subprojects/hunspell/ChangeLog +++ /dev/null @@ -1,1930 +0,0 @@ -2014-06-02 Németh László : - * escape spaces in paths of ODF files - -2014-05-28 Németh László : - * add long path/Unicode path support in WIN32 environment: - - hunspell#233 (reported by mahak gark) and LibreOffice fdo#48017 - * flat ODF support, eg.: - hunspell doc.fodt - cat doc.fodt | hunspell -l -O - * new options: - - -X (XML) input format - - -O (ODF or flat ODF) input format - - --check-apostrophe: check and force Unicode apostrophe usage - (ASCII or Unicode apostrophe has to be in the - WORDCHARS section of the affix file) - * fix ODF support: - - break 1-line XML of ODT documents at , too, - not only at (limiting tokenization problems, when - fgets stops within an XML tag) - - show ODF file path on the UI instead of the temporary file - * fix XML support: - - ', ", &, < and > in replacements converted to XML entities - - recognize &apos at tokenization, depending from WORDCHARS - - ' in tokens converted to ' before spell checking and - in the output of the pipe interface - * better apostrophe usage: - - WORDCHARS only with one of the Unicode or ASCII apostrophe - results extended word tokenization: both of them will be part of - the words (if they are inside: eg. word's, but not words'). - - convert Unicode apostrophes to ASCII ones for 8-bit dictionaries - (eg. English dictionaries), or for UTF-8 dictionaries only - with ASCII apostrophe supports (eg. French dictionaries). - * updated manual: - - hunspell.4 renamed to hunspell.5, see - hunspell#241 reported by Cristopher Yeleighton - - updated translations - - note about long/Unicode paths in WIN32 (hunspell.3) - -2014-04-25 Németh László : - * OpenDocument support, eg. - hunspell *.odt - hunspell -l *.odt - * always load default personal dictionary (fix - filtering bad words - reduce this word list - using - it as a personal dictionary workflow) - * fix parsing/URL recognition problem (bad tokens - with aposthrophes) - -2013-07-25 pchang9@cs.wisc.edu - * moz#897255 Wasted work in line_uniq - * moz#897780 Wasted work in SuggestMgr::twowords - -2013-07-25 Caolán McNamara : - * hunspell#167 layout problems with long lines - - based on the original fix by xorho - adapted to HEAD - * rhbz#925562 upgrade config.guess for aarch64 - -2013-07-24 pchang9@cs.wisc.edu - * moz#896301 Wasted work in SfxEntry::checkword - * moz#896844 Wasted work in AffixMgr::defcpd_check - -2013-06-13 Konstantin Khlebniko - * #49 HashMgr::add_word computes wrong size for struct hentry - -2013-06-13 Ville Skyttä - * #53 Man page syntax fixes - -2013-04-19 John Thomson - * win_api: add remove() of Hunspell API (hun#3606435) - -2013-04-19 Rouslan Solomokhin - * fix crash in suggestions for 99-character long words - by extending arrays of SuggestMgr::forgotchar_* - (hun#3595024, also http://crbug.com/130128), - thanks to also Paweł Hajdan to report the patch - -2013-04-01 Caolán McNamara : - * hunspell: -Werror=undef - -2013-03-13 Caolán McNamara : - * rhbz#918938 crash in interaction with danish thesaurus - -2012-09-18 Németh László : - * src/hunspell/affixmgr.*: - fix morphological analysis of - compound words (hun#3544994, reported by Dávid Nemeskey, fdo#55045) - -2012-06-29 Caolán McNamara : - * fix various coverity warnings - -2012-01-10 Ehsan Akhgari - * moz#710940 Firefox Crash [@ AffixMgr::parse_file(char const*, char - const*) ] - -2011-12-16 Jared Wein - * moz#710967 Incorrect argument passed to strncmp in - AffixMgr::parse_convtable - -2011-12-06 Caolán McNamara : - * rhbz#759647 fixed tempname of hunSPELL.bak collides with other users - when multiple edits in one dir - -2011-10-13 Caolán McNamara : - * moz#694002 crash in hunspell affixmgr on exit with bad .aff - * leak in hunspell affixmgr with bad .aff - -2011-09-19 Caolán McNamara : - * make libparsers.a not installed thanks to Tomáš Chvátal - -2011-06-23 Caolán McNamara : - * fix some windows compiler warnings - -2011-05-24 Németh László : - * src/hunspell/affixmgr.*: allow twofold suffixes in compounds - by extended version of Arno Teigseth's patch, see hun#3288562. - - new option for this feature: COMPOUNDMORESUFFIXES - -2011-02-16 Németh László : - * src/*/Makefile.am: fix library versioning, the probem reported by - Rene Engerhald and Simon Brouwer. - - * man/hunspell.4: new version based on the revised version of Ruud Baars - -2011-02-02 Németh László : - * suggestngr.cxx: fix ngram PHONE suggestion for input words with - diacritics using UTF-8 encoded dictionaries (add byte length to the - 8-bit phonet() argument instead of character length) - - * suggestmgr.cxx: fix missing csconv problem with UTF-8 encoding - dictionares, when the input contains non-BMP characters - - tests/utf8_nonbmp.sug: test file - - * suggestmgr.cxx: mixed and keyboard based character suggestions - don't forbid ngram suggestion search (optimized tests/suggestiontest) - - * affixmgr.cxx: fix hun#2999225: interfering compounding mechanisms, - tested on Dutch word list and reported by Ruud Baars - - * affixmgr.cxx: allomorph fix for hun#2970240 (Hungarian - compound "vadász+gép" was analyzed as vad+ász+gép, and rejected - by the ss->s rep rule (verb "vadássz"), but the analysis - didn't continue for the longer word parts (vadász+gép). - - * csutil.cxx: add lang code "az_AZ", "hu_HU", "tr_TR" for back - compatibility (fixing Azeri and Turkish casing conversion, also - Hungarian compound handling) - - * affixmgr.cxx: fix morphological analysis - -2011-01-26 Németh László : - * affixmgr.cxx: fix for moz#626195 (memcheck problem with FULLSTRIP). - - * affixmgr.*, suggestmgr.cxx: FORBIDWARN parameter (see manual) - -2011-01-24 Németh László : - * suffixmgr.cxx: fix bad suggestion of forbidden compound words, eg. - "termijndoel" with the Dutch dictionary. Reported by Ruud Baars. - - * latexparser.cxx: fix double apostrophe TeX quoation mark tokenization - (hun#3119776), reported by Wybodekker at SF.net. - - * tests/suggestiontest/*: multilanguage and single Hunspell version, see README - * tests/suggestiontest/prepare2: for make -f Makefile.orig single - -2011-01-22 Németh László : - * affixmgr.*, suggestmgr.*: new features - ONLYMAXDIFF: remove all bad ngram suggestions (default mode keeps one) - NONGRAMSUGGEST: similar to NOSUGGEST, but it forbids to use the word - in ngram based (more, than 1-character distance) suggestions. - -2011-01-21 Németh László : - * suggestmgr.*: limit wild suggestions (hun#2970237 by Ruud Baars) - - limited compound word suggestions - - improved and limited ngram based suggestions - * tests/*.sug: modified test files - - feature MAXCPDSUGS: - MAXCPDSUGS 0 : no compound suggestion, suggested by - Finn Gruwier Larsen in hunfeat#2836033 - MAXCPDSUGS n : max. ~n compound suggestions - - feature MAXDIFF: differency limit for ngram suggestions: 0-10 - eg. MAXDIFF 5: normal (default) limit - MAXDIFF 0: only one ngram suggestion - MAXDIFF 10: ~maxngramsugs ngram suggestions - - * affixmgr.*, hunspell.*: add flag FORCEUCASE (hun#2999228), force - capitalization of compound words, see Hunspell 4 manual), - suggested by Ruud Baars - test/forceucase.*: test files - - * affixmgr.*, hunspell.*: add flag WARN (hun#1808861), optional warning feature - for rare words, suggested by Ruud Baars - tests/warn: test files - * tools/hunspell.cxx: add option -r for optional filtering of rare words - - * affixmgr.cxx: fix hun#3161359 (gcc warnings) reported by Ryan VanderMeulen. - -2011-01-17 Németh László : - * suggestmgr.cxx: fix hun#3158994 and hun#3159027 (missing csconv table - using awkward 8bit capitalization of UTF-8 encoded dictionary words with PHONE - suggestion, reported by benjarobin and dicollecte at SF.net). - -2011-01-13 Németh László : - * affixmgr.cxx: ONLYINCOMPOUND fix for hun#2999224 (fogemorphene - was allowed in end position of compoundings). Reported by Ruud Baars. - * tests/onlyincompound2.*: test files - -2011-01-10 Ingo H. de Boer : - * win_api/{hunspell,libhunspell, testparser}.vcproj: updated project - files for the library and the executables. Compiling problem - also reported by Don Walker. - -2011-01-06 Németh László : - * affixmgr.cxx: fix freedesktop#32850 (program halt during Hungarian - spell checking of the word "6csillagocska6", reported by András Tímár) - - * tools/hunspell.cxx: add Mac OS X Hunspell dictionary paths, asked by - Vidar Gundersen in hunfeat#3142010 - -2011-01-05 Caolán McNamara : - * moz#620626 NS_UNICHARUTIL_CID doesn't support - case conversion - -2011-01-03 Németh László : - * NEWS and THANKS: update for release 1.2.13 - -2010-12-20 Németh László : - * affixmgr.cxx: hun#3140784 - -2010-12-16 Németh László : - * affixmgr.cxx: - - improved fix of hun#2970242 (supporting - zero affixes, reported by Ruud Baars - - tests/opentaal_cpdpat{,2}: test files - - - switching off default BREAK parameters by BREAK 0, - reported by Ruud Baars - - - hun#2999225: interfering compounding mechanisms, reported by Ruud Baars - -2010-12-11 Németh László : - * affixmgr.cxx: fix hun#2970242 (CHECKCOMPOUNDPATTERN only with flags), - the bug reported by Ruud Baars - * tests/2970242.*: test files - - * tests/2970240.*: test files for CHECKCOMPOUNDPATTERN fix (check all - boundaries in compound words, fixed by the previous CHECKCOMPOUNDREP - fix), the bug reported by Ruud Baars - - * win_api/Makefile.cygwin: update - -2010-12-09 Caolán McNamara : - * moz#617953 fix leak - -2010-11-08 Caolán McNamara : - * rhbz#650503 crash in arabic dictionary - -2010-11-05 Caolán McNamara : - * rhbz#648740 don't warn on empty flagvector - -2010-11-03 Caolán McNamara : - * logically we shouldn't need a csconv table in utf-8 mode - -2010-10-27 Németh László : - * hun#3000055 (requested by Ruud Baars) add REP boundary specifiation: - REP ^word$ xxxx - REP ^wordstarting xxxx - REP wordending$ xxxx - - * hun#3008434 (requested by Adrián Chaves Fernández) and - hun#3018929 (requested by Ruud Baars): REP with more than 2 words: - REP morethantwo more_than_two - - * suggestmgr.cxx: fix incomplete suggestion list for capitalized words, - eg. missing Machtstrijd->Machtsstrijd in the Dutch dictionary - (reported by Ruud Bars) - - * tests, man: related updates - -2010-10-12 Caolán McNamara : - * moz#603311 HashMgr::load_tables leaks dict when decode_flags fails - * fix mem leak found with new tests - * hun#3084340 allow underscores in html entity names - -2010-10-07 Németh László : - * affixmgr.cxx: - - hun#2970239 fix bad suggestion of forbidden compound words - - hun#2999224 fix keepcase feature on compound words (only partial - fix for COMPOUNDRULE based compounding) - - fix checkcompoundrep feature in compound words (check all boundaries, - not only the last one) - Problems reported by Ruud Baars. - - * tests/opentaal_forbiddenword[12]*, tests/opentaal_keepcase*: - new test files for the previous fixes - * tests/checkcompoundrep: extended test file. - -2010-09-05 Caolán McNamara : - * moz#583582 fix double buffer gcc fortify issue - -2010-08-13 Caolán McNamara : - * moz#586671 AffixMgr::parse_convtable leaks pattern/pattern2 if it - can't create both - * moz#586686 tidy up get_xml_list and friends - -2010-08-10 Caolán McNamara : - * hun#3022860 fix remove duplicate code - -2010-07-17 Caolán McNamara : - * remove ununsed get_default_enc and avoid potential misrecognition of - three letter language ids - * normalize encoding names before lookup - -2010-07-05 Caolán McNamara : - * hun#2286060 add Hangul syllables to unicode tables - -2010-06-26 Caolán McNamara : - * moz#571728 keep new[]/delete[] wrappers in sync for embedded in moz - case - -2010-06-13 Caolán McNamara : - * moz#571728 keep new[]/delete[] wrappers in sync for embedded in moz - case - -2010-06-02 Caolán McNamara : - * moz#569611 compile cleanly under win64 - -2010-05-22 Caolán McNamara : - * moz#525581 apply mozilla's current preferred get_current_cs impl - -2010-05-17 Németh László : - * affixmgr.cxx: fix bad limitation of parenthesized flags at - COMPOUNDRULEs. Windows crash reported by Ruud Baars and Simon Brouwer. - -2010-05-05 Caolán McNamara : - * rhbz#589326 malloc of int that should have been of char** - * hun#2997388 fix ironic misspellings - -2010-04-28 Caolán McNamara : - * moz#550942 get_xml_list doesn't handle failure from get_xml_par - -2010-04-27 Caolán McNamara : - * moz#465612 mozilla-specific code leaks - * moz#430900 phone is dereferenced before oom check - * moz#418348 ckey_utf alloc is used unchecked in SuggestMgr::badcharkey_utf - * CID#1487 pointer "rl" dereferenced before NULL check - * CID#1464 Returned without freeing storage "ptr" - * CID#1459 Avoid duplicate strchr - * CID#1443 Avoid any chance of dereferencing *slst - * CID#1442 Unsafe to have a null morph - * CID#1440 Avoid null filenames - * CID#1302 Dereferencing NULL value "apostrophe" - * CID#1441 Avoid deferencing null ppfx - -2010-04-16 Caolán McNamara : - * hun#2344123 fix U)ncap in utf-8 locale - * fix up hunspell text UI and lines wider than terminal - -2010-04-15 Caolán McNamara : - * hun#2613701 fix small leak in FileMgr::FileMgr - * fix small leak in tools/hunspell - * hun#2871300 avoid crash if def and words are NULL - * hun#2904479 fix length of hzip file - * hun#2986756 mingw build fix - * hun#2986756 fix double-free - * hun#2059896 fix crash in interactive mode without nls - * hun#2917914 add some extra words to the latexparser - * make some structs static - * C-api has duped symbol names - * regenerate gettext/intl with recent version - * hun#2796772 build a .dll under MinGW - * rhbz#502387 allow cross-compiling for MinGW target - * hun#2467643 update .vcproj files to include replist.?xx - * unify visiblity/dll_export support across platforms - * hun#2831289 sizeof(short) typo - * hun#2986756 add -u3 gcc style output - -2010-04-14 Caolán McNamara : - * hun#2813804 fix segfault on hu_HU stemming - -2010-04-13 Caolán McNamara : - * hun#2806689 fix ironic misspellings - * hun#2836240 add Italian translations - -2010-04-09 Caolán McNamara : - * fix titchy possible leak in command-line spellchecker - -2010-04-07 Caolán McNamara : - * hun#2973827 apply win64 patch - * hun#2005643 fix broken mystrdup - -2010-03-04 Caolán McNamara : - * ooo#107768 fix crash in long strings in spellml mode - * hun#1999737 add some malloc checks - * hun#1999769 drop old buffer on realloc failure - * hun#2005643 tidy string functions - * hun#2005643 micro-opt - * hun#2006077 free strings on failed dict parse - * hun#2110783 ispell-alike verbose mode implementation - -2010-03-03 Németh László : - * hunspell/(affixmgr, suggestmgr).cxx: add character sequence - support for MAP suggestion, using parenthesized character groups - in the syntax, eg. MAP ß(ss). - * man/hunspell.4, tests/map*: documentation and test files - -2010-02-25 Németh László : - * hunspell/hunspell.cxx: add recursion limit for BREAK (fix OOo Issue 106267) - - * hunspell/hunspell.cxx: fix crash in morphological analysis of - capitalized words with ending dashes - - * affixmgr.cxx: fix morphological analysis of long numbers combined with dash, - eg. 45-00000045 (reported by a@freeblog.hu). - -2010-02-23 Caolán McNamara : - * hun#2314461 improve ispell-alike mode - * hun#2784983 improve default language detection - * hun#2812045 fix some compiler warnings - * hun#2910695 survive missing HOME dir - * hun#2934195 fix suggestmgr crash - * hun#2921129 remove unused variables - * hun#2826164 make sure make check uses the in-tree libhunspell - * bump toolchain to support --disable-rpath - * hun#2843984 fix coverity warning - * hun#2843986 fix coverity warning - * hun#2077630 add iconv lib - * make gcc strict-aliasing warning free - * make cppcheck warning free - -2008-11-01 Németh László : - * replist.*, hunspell.cxx, affixmgr.cxx: new input and output - conversion support, see ICONV and OCONV keywords in the Hunspell(4) - manual page and the test examples. The input/output conversion - problem of syllabic languages reported by Daniel Yacob and - Shewangizaw Gulilat. - - tests/{iconv,oconv}.*: test examples - - * tools/wordforms: word generation script for dictionary developers - (Hunspell version of the unmunch program) - - * hunspell/hunspell.cxx: extended BREAK feature: ^ and $ mean in break - patterns the beginning and end of the word. - - tests/BREAK.*: modified examples. - - * hunspell/hunspell.cxx: set default break at hyphen characters. - The associated problem reported by S Page in Hunspell Bug 2174061. - See Mozilla Bug ID 355178 and OOo Issue 64400, too. - - tests/breakdefault.*: test data - The following definition is equivalent of the default word break: - - BREAK 3 - BREAK - - BREAK ^- - BREAK -$ - - * affixmgr.cxx: SIMPLIFIEDTRIPLE is a new affix file keyword to allow - simplified forms of the compound words with triple repeating letters. - It is useful for Swedish and Norwegian languages. - - * affixmgr.cxx: extend CHECKCOMPOUNDPATTERN to support - alternations of compound words for example by sandhi - feature of Indian and other languages. The problem reported - by Kiran Chittella associated with Telugu writing system - (see Telugu example in tests/checkcompoundpattern4.test). - The new optional field of CHECKCOMPOUNDPATTERN definition is the - replacement of the compound boundary defined by the previous fields: - CHECKCOMPOUNDPATTERN ff f ff - means ff|f compound boundary has been replaced by "ff", like in - the (prereform) German Schiffahrt (Schiff+fahrt). - - CHECKCOMPOUNDPATTERN supports also optional flag conditions now: - CHECKCOMPOUNDPATTERN ff/A f/B ff - means that the first word of the compound needs flag "A" and - the second word of the compound needs flag "B" to the operation. - - * tools/hunspell.cxx: add empty lines as separators to the output of - the stemming and morphological analysis. - - * affixmgr.cxx: fix condition checking algorithm. Bad suggestion - generation reported by Mehmet Akin in SF.net Bug 2124186 with help of - Eleonora Goldman. - - * affixmgr,cxx: fix COMPOUNDWORDMAX feature. The problem and its - code details reported by Göran Andersson under SF.net Bug ID 2138001. - - * csutil.cxx: fix bad conditional code for Mozilla compilation. - Patch by Serge Gautherie. The problem reported by Ryan VanderMeulen. - - * hunspell/hunspell.cxx: add missing ngram suggestion for HUHINITCAP - (capitalized mixed case) words. - - * w_char.hxx: use GCC conditions for GCC related code. Patch by - Ryan VanderMeulen. - - * affixmgr.cxx: check morphological description in morphgen() - (fix potential program fault by incomplete morphological - description of affix rules) - - * src/win_api: config.h: switch on warning messages on Windows - - * tools/affixcompress: extended help for -h (use LC_ALL=C sort - for input word list) - - * man/hunspell.4: updated manual: - - new and modified features (SIMPLIFIEDTRIPLE, ICONV, OCONV, - BREAK, CHECKCOMPOUNDPATTERN). - - note about costs of zero affixes, suggested by Olivier Ronez. - - * hunspell/hunspell.cxx: remove deprecated word breaking codes. - -2008-08-15 Németh László : - * affentry.cxx: add FULLSTRIP option. With FULLSTRIP, affix rules can - strip full words, not only one less characters. Suggested by - Davide Prina and other developers in OOo Issue 80145. - * tests/fullstrip.*: Test data based on Davide Prina's example. - * tools/unmunch.cxx: modified for FULLSTRIP. - - * affixmgr.cxx: COMPOUNDRULE now works with long and numerical flag - types by parenthesized flags. Syntax: (flag)*, (flag)(flag)?(flag)*. - * tests/compoundrule[78].*: tests with parenthesized COMPOUNDRULE - definitions. - - * suggestmgr.cxx: modified badchar*(), forgotchar*() and extrachar*() - 1-character distance suggestion algorithms: search a TRY character - in all position instead of all TRY characters in a character position - (it can give more readable suggestion order, also better suggestions - in the first positions, when TRY characters are sorted by frequency.) - For example, suggestions for "moze": - ooze, doze, Roze, maze, more etc. (Hunspell 1.2.6), - maze, more, mote, ooze, mole etc. (Hunspell 1.2.7). - - * suggestmgr.cxx: extended compound word checking for better COMPOUNDRULE - related suggestions, for example English ordinal numbers: 121323th -> - 121323rd (it needs also a th->rd REP definition). - - * phonet.cxx: cast unsigned char parameter of isdigit() and fix - isalpha by myisalpha() (potential problems in Windows environment). - Reported by Thomas Lange in OOo Issue 92736. - - * hunspell/csutil.*,hunspell/{affentry,affixmgr,hunspell,suggestmgr}.cxx: - fix potential buffer overloading under morphological analysis by the - new mystrcat() function. Reported by Molnár Andor (dolhpy at true - dot hu) in SF.net Bug 2026203. - - * affixmgr.cxx: add recursion limit to defcpd(). Fix OOo Issue 76067: - crash-like deceleration by checking hexadecimal numbers with long FFF - sequence (combinatory explosion by the en_US words "f" and "ff"). - Missing fix reported by Mathias Bauer. - - * affixmgr.cxx: fix the difference in the Unicode and non-Unicode - parts of cpdcase_check(). Bug report by Brett Wilson. - - * filemgr.*, affixmgr.cxx, csutil.*, hashmgr.*: warning messages now - contain line numbers (use --with-warnings configure option for - warning messages). - - * hunspell.cxx: analyze(): fix case conversion of stemming and - morphological analysis of UTF-8 encoded input. Reported by Ferenc Godó. - - * tools/hunspell.cxx: fix LaTeX Unicode support in filter mode. - Reported by Jan Seeger in SF.net Bug 2039990. - - * affixmgr.hxx: 0.5 or in 64 bit environment, 1 MB (virtual) memory - saving using only the requested size for sFlag and pFlag arrays. - Bug report by Brett Wilson. - - * affixmgr.cxx,tools/hunspell.cxx: get_version() returns with full - VERSION affix parameter instead of its first word. Fixes for - Hunspell's header. Some problems with Hunspell header reported in - SF.net Bug 2043080. - -2008-07-15 Németh László : - * affentry.cxx: fixes of the affix rule matching algorithm (affected - only the sk_SK dictionary from all OpenOffice.org dictionaries): - - fix dot pattern + accented letters matching (in non Unicode encoding) - - word-length conditions work again - * tests/condition.*: extended test for the fix. - - * hashmgr.cxx: load multiword expressions: spaces may be parts - of the dictionary words again (but spaces also work as morphological - field separators: word word2 -> "word word2", word po:noun -> "word"). - * man/hunspell.4: updated manual - - * tools/hunspell.cxx: add iconv character conversion support to - stemming and morphological analysis - - * tools/hunspell.cxx: add /usr/share/myspell/dicts search path for - Ubuntu support - -2008-07-09 Németh László : - * affentry.cxx: fixes of the affix rule matching algorithm: - - right ASCII character handling in bracket expression; - - fault-tolerant nextchar() for bad rules. - Problem with the en_GB dictionary and nextchar() with a detailed - code analysis reported by John Winters in SF.net Bug ID 2012753. - * tests/condition.*: extended test for the fix. - - * hunspell/hunspell.*, parsers/*, tools/hunspell.cxx: fix compiler - warnings (deprecated const-free char consts) - - * win_api/hunspelldll.*: add hunspell_free_list(), the problem - reported by Laurier Mercer. - -2008-06-30 Török László : - * tests/affixmgr.cxx: fix morphological analysis: strcat() on - an uninitialized char array in suffix_check_morph(). - -2008-06-18 Németh László : - * src/hunspell/affixmgr.cxx: fix GCC compiler warnings - (comparisons with string literal results in unspecified behaviour). - The problem reported by Ladislav Michnovič. - -2008-06-17 Németh László : - * src/hunspell/{hunspell.cxx,hunspell.h}: add free_list() to the C and - C++ interface to deallocate suggestion lists. The problem - reported by Laurie Mercer and Christophe Paris. - * csutil.cxx: fix freelist() to deallocate non-NULL list, when n = 0. - * tools/{analyze,example,chmorph,hunspell}.cxx: use free_list(). - - * tools/hunspell.cxx: fix only --with-readline compiling problem. - Reported by Volkov Peter in SF.net Bug 1995842. - - * man/hunspell.3,hunspell.hxx: fix analyze and generate examples in - the manual and comments (using char*** parameter instead of char**). - - * tools/example.cxx: fix suggestion example. - -2008-06-17 Németh László : - * affentry.cxx: fix the new affix rule matching algorithm of - Hunspell 1.2. Arabic dictionary problem reported by Khaled Hosny - in SF.net Bug ID 1975530. Mohamed Kebdani also sent a - prepared test data. - * tests/{1975530,condition*}: tests for the fix - -2008-06-13 Ingo H. de Boer : - * src/hunspell/{affixmgr.cxx,hunspell.cxx}: add missing type - cast to strstr() calls for VC8 compatibility. - -2008-06-13 Németh László : - * suggestmgr.cxx: add also part1-part2 suggestion with dash - for bad part1part2 word forms, suggested by Ruud Baars. - For example, now suggestion of "parttime": "part time" - and "part-time". - NOTE: this feature will work only when the TRY definition - contains "-" or the letter "a". - - * hunspell.cxx: new XML API in spell() and suggest() (see hunspell(3)). - - * src/hunspell/*: fixes for OpenOffice.org build environment. - - * man/{hunspell.3,hzip.1,hunzip.1}: add new manual pages for - Hunspell programming API and dictionary compression and - encryption utilities. - - * src/hunspell/*: handle failed mystrdup() calls and other potential - insufficient memory problems. The problem reported by Elio Voci - in OpenOffice.org Issue 90604 and others. - - * src/tools/affixmgr.cxx: restore original behaviour of get_wordchars - without conditional code. Problem reported by Ingo H. de Boer - in SF.net Bug 1763105. - - * win_api/hunspelldll.h: put_word() renamed to add() in the (old) - Windows DLL API bug reported in SF.net Bug 1943236. Also reported - by Bartkó Zoltán. - - * tools/hunspell.cxx: fix chench() for environments without - native language support (ENABLE_NLS 0 in config.h), - PHP system_exec() bug reported by Michel Weimerskirch in - SF.net Bug 1951087. - - * hunspell.cxx, affixmgr.cxx: remove "result" from the - (result && *result) conditions, when "result" is a static variable. - The problem and a possible solution reported by Ladislav Michnovič. - - * affixmgr.cxx: parse_affix(): print line instead of NULL in - the warning message, when affix class header is bad. - The problem reported by Ladislav Michnovič. - -2008-06-01 Christian Lohmaier - * configure.ac: patch to fix --with-readline, --with-ui logic. - Reported in the SF.net Bug 981395. - -2008-05-04: Volkov Peter - * configure.ac: fix LibTool 2.22 incompatibility by removing - unused LT_* macros. Report and patch in SF.net Bug 1957383. - The problem reported and fixed by Ladislav Michnovič, too. - -2008-04-23: Ladislav Michnovič - * hunspell.pc.in: fix wrongly set directories. - -2008-04-12 Németh László : - * src/tools/hunspell.cxx: - - Multilingual spell checking and special dictionary support with -d. - Multilingual spell checking suggested by Khaled Hosny (SF.net - Bug 1834280). Example for the new syntax: - - -d en_US,en_geo,en_med,de_DE,de_med - - en_US and de_DE are base dictionaries, and en_geo, en_med, de_med - are special dictionaries (dictionaries without affix file). - Special dictionaries are optional extension of the base dictionaries. - There is no explicit naming convention for special dictionaries, - only the ".dic" extension: dictionaries without affix file will - be an extension of the preceding base dictionary. First dictionary - in -d parameter must have an affix file (it must be a base - dictionary). - - - new options for debugging, morphological analysis and stemming: - -m: morphological analysis or flag debug mode (without affix - rule data it signs the flag of the affix rules) - -s: stemming mode - -D: show also available dictionaries and search path - (suggested by Aaron Digulla in SF.net Bug 1902133) - - - add missing refresh() to print bad words before the slower suggestion - search in UI (better user experience) - - - fix tabulator problems (reported by ugli-kid-joe AT sf DOT net) - - - fix different encoding of dic and input, and suggestions - - - add per mille sign to LANG hu_HU section. - - - rewrite program messages. Concatenating multiple printfs for - easier translation suggested by András Tímár and Gábor Kelemen. - - * src/hunspell/csutil.cxx: set static encds variable. Patch by - Rene Engerhald. SF.net Bug 1896207 and 1939988. - - * src/hunspell/w_char.hxx,csutil.hxx: reorganizing - w_char typedef and HENTRY_DATA, HENTRY_FIND consts - - * src/hunspell/hunzip.cxx: fopen(): using rb options instead of r (fix - for Windows) - - * src/tools/affixmgr.cxx: restore original behaviour of get_wordchars - in an #ifdef WINSHELL section. Problem reported by Ingo H. de Boer - in SF.net Bug 1763105. - - * src/tools/chmorph.cxx: remove the experimental modifications - - * src/tools/hzip.c: fopen(): using wb options instead of w (fix - for Windows) - - * src/tools/hunzip.cxx: add missing MOZILLA_CLIENT. Reported - by Ryan VanderMeulen. - - * man/*, man/hu/*: updated manual - - * man/hunspell.4: fix formatting problem (missing header) - - * tools/makealias: now works with the extra data fields. - - * phonet.cxx: use HASHSIZE const - - * tests/rep.aff: fix REP count - - * src/win_api/Makefile.cygwin, README: native Windows compilation - in Cygwin environment without cygwin1.dll dependency (see README - for compiling instructions). - -2008-04-08 Roland Smith : - * src/parsers/latexparser.cxx: fix PATTERN_LEN for AMD64 and - other platforms with different struct padding (SF.net Bug 1937995). - -2008-04-03 Kelemen Gábor : - * po/POTFILES.in: fix path of the source file - - * po/Makevars: add --from-code=UTF-8 gettext option - - * hunspell.cxx: add comments for shortkey translation - -2008-02-04 Flemming Frandsen - * src/hunspell.h: fix Windows DLL support - - this patch also reported by Zoltán Bartkó. - -2008-01-30 Mark McClain - * src/hunspell.cxx: stem(): fix function call side effect - for PPC platform (SF.net Bug 1882105). - -2008-01-30 Németh László : - * hunspell.cxx, csutil.cxx, hunspelldll.c: fix - SF.et Bug 1851246, patch also by Ingo H. de Boer. - - * hunspell.h: fix SF.net Bug 1856572 (C prototype problem), - patch by Mark de Does. - - * hunspell.pc.in: fix SF.net Bug 1857450 wrong prefix, reported - by Mark de Does. - - * hunspell.pc.in: reset numbering scheme: libhunspell-1.2. - Fix SF.net Bug 1857512 reported by Mark de Does, - also by Rene Engelhard. - - * csutil.cxx: patches for ARM platform, signed_chars.dpatch - by Rene Engelhard and arm_structure_alignment.dpatch by - Steinar H. Gunderson - - * hunzip.*, hzip.c: new hzip compression format - - * tools/affixcompressor: affix compressor utility (similar to - munch, but it generates affix table automatically), works - with million-words dictionaries of agglutinative languages. - - * README: fix problems reported by Pham Ngoc Khanh. - - * csutil.cxx, suggestmgr: Warning-free in OOo builds. - - * hashmgr.*, csutil.*: fix protected memory problems with - stored pointers on several not x86 platforms by - store_pointer(), get_stored_pointer(). - - * src/tools/hunspell.cxx: fix iconv support on Solaris platform. - - * tests/IJ.good: add missing test file - - * csutil.cxx: fix const char* related errors. Compiling bug - with Visual C++ reported by Ryan VanderMeulen and Ingo H. de Boer. - -2008-01-03 Caolan McNamara : - * csutil.cxx: SF.net Bug 1863239, notrailingcomma patch and - optimization of get_currect_cs(). - -2007-11-01 Németh László : - * hunspell/*: new feature: morphological generation, - also fix experimental morphological analysis and stemming. - - new API functions and improved API: - - analyze(word): (instead of morph()) morphological analysis - - stem(word): stemming - - stem(list): stemming based on the result of an analysis - - generate(word, word2): morphological generation - - generate(word, list): morphological generation - - add(word): add word to the run-time dictionary (renamed put_word()) - - add_with_affix(word, word2): (renamed put_word_pattern()): - add word to the run-time dictionary with affix flags of the - second parameter: all affixed forms of the user words will be - recognised by the spell checker. Especially useful for - agglutinative languages. - - remove(word): remove word from the run-time dictionary (not - implemented) - - see manual and hunspell/hunspell.hxx header and tests/morph.* - * tests/morph.*: test data, example for morphological analysis, - stemming and generation - - * tools/analyze, tools/chmorph: extended and new demo applications: - - analyze (originally hunmorph): analyses and stems input words, - generates word forms from input word pairs. - - chmorph: morphological transformation filter - - * configure.ac, hunspell/makefile.am: set library version number. - Bug reported by Rene Engelhard. - - * affentry.cxx, affixmgr.cxx: new pattern matching algorithm in - condition checking of affix rules instead of the Dömölki-algorithm: - - Unlimited condition length (instead of max. 8 characters). - - Less memory consumption, especially useful for affix rich languages: - 5,4 MB memory savings with hu_HU dictionary. - - Speed change depends from dictionaries and CPU caches: English spell - checking is 4% faster on Linux words with en_US dictionary, Hungarian - spell checking is 25% slower on most frequent words of Hungarian - Webcorpus. - - * tests/sug.*, sugutf.*: updated test data (use "a" and "lot" - dictionary items instead of "a lot".) - - * src/hunspell/hunspell.cxx: free(csconv) instead of delete csconv. - Report and patch by Sylvain Paschein in Mozilla Issue 398268. - - * suggestmgr.cxx, tools/hunspell.cxx: bad spelling of "misspelled". - Ubuntu Bug #134792, patch by Malcolm Parsons. - - * tests/base_utf.*: use Unicode apostrophe instead of 8-bit one. - - * hunspell.cxx, hashmgr.cxx: add(): use HashMgr::add() - -2007-10-25 Pavel Janík : - * hunspell/csutil.cxx: Fix type cast warnings on 64bit Linux in - printing of character positions in u8_u16(). OOo issue 82984. - -2007-09-05 Németh László : - * win_api/Hunspell.vproj, parsers/testparser.cxx,textparser.hxx: - warning fixes and removing unnecessary Windows project file. - Reported by Ingo H. de Boer. - - * hashmgr.*, {affixmgr,suggestmgr}.cxx: optimized data structure - for variable-count fields (only "ph" transliteration field in - this version, see next item). Also less memory consumption: - -13% (0.75 MB) with en_US dictionary, -6% (1 MB) with hu_HU. - - * suggestmgr.cxx: dictionary based phonetic suggestion for special - or foreign pronounciation (see also rule-based PHONE in manual). - Usage: tab separated field in dictionary lines, started with "ph:". - The field contains a phonetic transliteration of the word: - -Marseille ph:maarsayl - * tests/phone.*: test data for dictionary and rule based phonetic - suggestion. - - * hunspell.cxx: fix potential bad memory access in allcap word - capitalization in suggest() (bug of previous version). - - * hunspell.cxx, atypes.hxx: set correct limit for UTF-8 encoded - input words (256 byte). - - * suggestmgr.cxx: improved REP suggestions with spaces: it works - without dictionary modification. - OOo issue 80147, reported by Davide Prina. - * tests/rep.*: new test data: higher priority for "alot" -> "a lot", - and Italian suggestion "un'alunno" -> "un alunno". - - * affixmgr.cxx: fix Unicode ngram suggestions in expand_rootword(). - (Suggestions with bad affixes.) - Bug reported by Vitaly Piryatinksy . - * tests/ngram_utf_fix.*: test based on Vitaly Piryatinksy's data. - - * suggestmgr.cxx: fix twowords() for last UTF-8 multibyte character. - (conditional jump or move depended on uninitialised value). - -2007-08-29 Ingo H. de Boer : - * win_api/{hunspell,libhunspell, testparser}.vcproj: new project - files for the library and the executables. - - * Hunspell.rc, Hunspell.sln, config.h: updated versions. - Version number problem also reported by András Tímár. - -2007-08-27 Németh László : - * suggestmgr.hxx: put fixed version. Bug report by Ingo H. de Boer. - - * suggestmgr.cxx: remove variable-length local character array - reported by Ingo H. de Boer. - -2007-08-27 Németh László : - * suggestmgr.hxx: change bad time_t to clock_t in header, too. - Bug reports or patches by Ingo H. de Boer under SF.net - Bug ID 1781951, János Mohácsi and Gábor Zahemszky, András Tímár, - OMax3 at SF.net under SF.net Bug ID 1781592. - - * phonet.*: change variable-length local character array to - portable fixed size character array. Problem reported by - Ingo H. de Boer under SF.net Bug ID 1781951 and - Ryan VanderMeulen. - - * suggestmgr.cxx: remove debug message (also by - Ingo H. de Boer). - -2007-08-26 Ingo H. de Boer : - * win_api/Hunspell.vcproj: updated version (with phonet.*) - -2007-08-23 Németh László : - * phonet.{c,h}xx, suggestmgr.cxx: PHONE parameter: - pronounciation based suggestion using Björn Jacke's original Aspell - phonetic transcription algorithm (http://aspell.net), relicensed - under GPL/LGPL/MPL tri-license with the permission of the author. - Usage: see manual. - - * affixmgr,suggestmgr.cxx: add KEY parameter for keyboard and - input method error related suggestions. - Example: KEY qwertyuiop|asdfghjkl|zxcvbnm - - * man/hunspell.4: description about PHONE and KEY suggestion parameters. - - * suggestmgr.cxx: enhancements for better suggestions: - - Set ngram suggestions for badchar-type errors - and only two word and compound word suggestions, too. - - Separate not compound and compound word - suggestions for MAP suggestion, too. - - Double swap suggestions for short words. - For example: ahev -> have, hwihc -> which. - - Better time limits using clock() instead of time() - (tenths of a second resolution instead of second ones). - - leftcommonsubstring() weigth function. - - * htype.hxx, hashmgr.cxx: blen (byte length) and clen (character - length) fields instead of wlen - - * affixmgr.cxx: fix get_syllable() for bad Unicode inputs. - - * tests/suggestiontest/*: test environment for suggestions - -2007-08-07 Martijn Wargers: - * csutil.cxx: fix Mingw build error associated with ToUpper() call. - Report and patch in Mozilla Issue 391447. - -2007-08-07 Robert Longson: - * atypes.cxx: use empty inline function HUNSPELL_WARNING instead of - variadic macros to switch of Hunspell warnings. - Reported by Gavin Sharp in Mozilla Issue 391147. - -2007-08-05 Ginn Chen: - * hashmgr.cxx: Hunspell failed to compile on OpenSolaris (use stdio - instead of csdio). Report and patch in Mozilla Issue 391040. - -2007-07-25 Németh László : - * parsers/*.cxx: Hunspell executable recognises and accepts URLs, - e-mail addresses, directory paths, reported by Jeppe Bundsgaard. - * src/tools/hunspell.cxx: --check-url: new option of Hunspell program. - Use --check-url, if you want check URLs, e-mail addresses and paths. - - * parsers/textparser.cxx: strip colon at end of words for Finnish - and Swedish (colon may be in words in Finnish and Swedish). - Problem reported by Lars Aronsson. - * tests/colons_in_words.*: test data - - * tests/digits_in_words.*: example for using digits in words - (eg. 1-jährig, 112-jährig etc. in German), reported by Lars Aronsson. - - * hashmgr.cxx: Hunspell accepts allcaps forms of mixed case - words of personal dictionaries (+allcaps custom dictionary words with - allcaps affixes). - Sf.net Bug ID 1755272, reported by Ellis Miller. - - * hashmgr.cxx: fix small memory leaks with alias compressed - dictionaries (free flag vectors of affixed personal dictionary words - and flag vectors of hidden capitalized forms of mixed case and - allcaps words). - - * affixmgr.cxx: fix COMPOUNDRULE checking with affixed compounds. - Sf.net Bug ID 1706659, reported by Björn Jacke. Also fixing for - OOo Issue 76067 (crash-like deceleration for hexadecimal numbers - with long FFFFFF sequence using en_US dictionary). - - * tools/hunspell.cxx: add missing return to save_privdic(). - - * man/hunspell.4: add information about affixation of personal words: - "Personal dictionaries are simple word lists, but with optional - word patterns for affixation, separated by a slash: - - foo - Foo/Simpson - - In this example, "foo" and "Foo" are personal words, plus Foo - will be recognised with affixes of Simpson (Foo's etc.)." - -2007-07-18 Németh László : - * src/win_api/: add missing resource files, reported by Ingo H. de Boer. - -2007-07-16 Németh László : - * hunspell.cxx: fix dot removing from UTF-8 encoded words in cleanword2() - (Capitalised words with dots, as "Something." were not recognised - using Unicode encoded dictionaries.) - * tests/{base.*,base_utf.*}: extended and new test files for - dot removing and Unicode support. - - * tools/hunspell.cxx: fix Cygwin, OS X compatibility using platform - specifics iconv() header by ICONV_CONST macro of Autoconf. - Sf.net Bug ID 1746030, reported by Mike Tian-Jian Jiang. - Sf.net Bug ID 1753939, reported by Jean-Christophe Helary. - - * tools/hunspell.cxx: fix missing global path setting with -d option. - - * tests/test.sh: fix broken Valgrind checking (missing warnings - with VALGRIND=memcheck make check). - - * csutil.cxx: fix condition in u8_u16() to avoid invalid read - of not null-terminated character arrays (detected by Valgrind - in Hunspell executable: associated with 8-bit character table - conversion in tools/hunspell.cxx). - - * csutil.cxx: free_utf_tbl(): use utf_tbl_count-- instead of utf_tbl--. - Memory leak in Hunspell executable detected by Valgrind. - - * hashmgr.cxx: add missing free_utf_tbl(), memory leak in Hunspell - executable detected by Valgrind. - - * hashmgr.cxx: load_tables(): fix memory error in spec. capitalization. - Use sizeof(unsigned short) instead of bad sizeof(unsigned short*). - Invalid memory read detected by Valgrind. - - * hashmgr.cxx: add_word(): fix memory error in spec. capitalization. - Update also affix array length of capitalized homonyms. Invalid - memory read detected by Valgrind. - - * hunspell.cxx: suggest(): fix invalid memory write and leak. - Bad realloc() and missing free() detected by Valgrind associated - with suggestions for "something.The" type spelling errors. - - * {dictmgr,csutil,hashmgr,suggestmgr}.cxx: check memory allocation. - Sf.net Bug ID 1747507, based on the patch by Jose da Silva. - -2007-07-13 Ingo H. de Boer : - * atypes.cxx: fix Visual C compatibility: Using - "HUNSPELL_WARNING(a,b,...} {}" macro instead of empty "X(a,b...)". - - * hunspell.cxx: changes for Windows API. - * win_api/Hunspell.*: new resource files - * win_api/hunspelldll.*: set optional Hunspell and Borland spec. codes - Sf.net Bug ID 1753802, patch by Ingo H. de Boer. - See also Sf.net Bug ID 1751406, patch by Mike Tian-Jian Jiang. - -2007-07-09 Caolan McNamara : - * {hunspell,hashmgr,affentry}.cxx: fix warnings of Coverity program - analyzer. Sf.net Bug ID, 1750219. - -2007-07-06 Németh László : - * atypes.cxx: warning-free swallowing of conditional warning messages - and their parameters using empty HUNSPELL_WARNING(a,b...) macro. - * {affixmgr,atypes,csutil}.cxx: fix unused variable warnings - using WARNVAR macro for conditionally named variables. - * hashmgr.cxx: fix unused variable warning in add_word() by cond. name - * hunspell.cxx: fix shadowed declaration of captype var. in suggest() - -2006-06-29 Caolan McNamara : - * hunspell.cxx: patch to fix possible memory leak in analyze() of - experimental morphological analyzer code. Sf.net Bug ID 1745263. - -2007-06-29 Németh László : -improvements: - * src/hunspell/hunspell.cxx: check bad capitalisation of Dutch letter IJ. - - Sf.net Feature Request ID 1640985, reported by Frank Fesevur. - - Solution: FORBIDDENWORD for capitalised word forms (need - an improved Dutch dictionary with forbidden words: Ijs/*, etc.). - * tests/IJ.*: test data and example. - - * hashmgr.cxx, hunspell.cxx: check capitalization of special word forms - - words with mixed capitalisation: OpenOffice.org - OPENOFFICE.ORG - Sf.net Bug ID 1398550, reported by Dmitri Gabinski. - - allcap words and suffixes: UNICEF's - UNICEF'S - - prefixes with apostrophe and proper names: Sant'Elia - SANT'ELIA - For Catalan, French and Italian languages. - Reported by Davide Prina in OOo Issue 68568. - * tests/allcaps*: tests for OPENOFFICE.ORG, UNICEF'S capitalization. - * tests/i68568*: tests for SANT'ELIA capitalization. - - * hunspell/hunspell.cxx: suggestion for missing sentence spacing: - something.The -> something. The - - * tools/hunspell.cxx: multiple character encoding support - - -i option: custom input encoding - Sf.net Bug ID 1610866, reported by Thobias Schlemmer. - Sf.net Bug ID 1633413, reported by Dan Kenigsberg. - See also hunspell-1.1.5-encoding.patch of Fedora from Caolan Mc'Namara. - * tests/*.test: add input encodings - - * tools/hunspell.cxx: use locale data for default dictionary names. - Sf.net Bug ID 1731630, report and patch from Bernhard Rosenkraenzer, - See also hunspell-1.1.4-defaultdictfromlang.patch of Fedora Linux - from Caolan McNamara. - - * tools/hunspell.cxx: fix 8-bit tokenization (letters without - casing, like ß or Hebrew characters now are handled well) - - * tools/hunspell.cxx: dictionary search path - - DICPATH environmental variable - - -D option: show directory path of loaded dictionary - - automatic detection of OpenOffice.org directories - -fixes: - * affixmgr.cxx: fault-tolerant patch for REP and other affix - table data problems. Problem with Hunspell and en_GB dictionary - reported by Thomas Lange in OOo Issue 76098 and - Stephan Bergmann in OOo Issue 76100. - Sf.net Bug ID 1698240, reported by Ingo H. de Boer. - - * csutil.cxx: fix mkallcap_utf() for allcaps suggestion in UTF-8. - - * suggestmgr.cxx: fix bad movechar_utf() (missing strlen()). - - * hunspell.cxx: fix bad degree sign detection in Unicode - hu_HU environment. - - * hunspell/hunspell.cxx: free allocated memory of csconv in - ported Mozilla code. - - Mozilla Bugzilla Bug 383564, report and Mozilla MySpell patch - by Andrew Geul. Reported by Ryan VanderMeulen for Hunspell. - - * suggestmgr.cxx: fix minor difference in Unicode suggestion - (ngram suggestion of allcaps words in Unicode). - - * hashmgr.cxx: close file handle after errors. - Sf.net Bug ID 1736286, reported by John Nisly. - - * configure.ac: syntax error (shell variable with spaces). - Sf.net Bug ID 1731625, reported by Bernhard Rosenkraenzer. - - * hunspell.cxx: check_word(): fix bad usage of info pointer. - - * hashmgr.cxx: fix de_DE related bug (accept words with leading dash). - Sf.net Bug ID 1696134, reported by Björn Jacke. - - * suggestmgr.cxx, tests/1695964.*: fix NEEDAFFIX homonym suggestion. - Sf.net Bug ID 1695964, reported by Björn Jacke. - - * tests/1463589*: capitalized ngram suggestion test data for - Sf.net Bug ID 1463589, reported by Frederik Fouvry. - - * csutil.cxx, affixmgr.cxx: fix possible heap error with - multiple instances of utf_tbl. - Sf.net Bug ID 1693875, reported by Ingo H. de Boer. - - * affixmgr.cxx, suggestmgr.cxx, license.hunspell: convert to ASCII. - Locale dependent compiling problems. Sf.net Bug ID 1694379, reported - by Mike Tian-Jian Jiang. OOo Issue 78018 reported by Thomas Lange. - - * tests/test.sh: compatibility issues - - fix Valgrind support (check shared library instead of shell wrapper) - - remove deprecated "tail +2" syntax - - set 8-bit locale for testing (LC_ALL=C) - - * hunspell.hxx: remove license.* and config.h dependencies. - - hunspell-1.1.5-badheader.patch from Caolan McNamara - -2007-03-21 Németh László : - * tools/Makefile.am, munch.h, unmunch.h: add missing munch.h and unmunch.h - Reported by Björn Jacke and Khaled Hosny (sf.net Bug ID 1684144) - * hunspell/hunspell.cxx, hunspell.hxx: fix --with-ui compliling error (add get_csconv()) - Reported by Khaled Hosny (sf.net Bug ID 1685010) - -2007-03-19 Németh László : - * csutil.cxx, hunspell/hunspell.cxx: Unicode non BMP area (>65K character range) support - (except conditional patterns and strip characters of affix rules) - * tests/utf8_nonbmp*: test data - - * src/hunspell/*: add Mozilla patches from David Einstein - - run-time generated 8-bit character tables - - other Mozilla related changes (see Mozilla Bugzilla Bug 319778) - - * csutil.cxx, affixmgr.cxx, hashmgr.cxx: optimized version of IGNORE feature - - IGNORE works with affixes (except strip characters and affix conditions) - * tests/ignore*: test data with latin characters - * tests/ignoreutf*: Unicode test data with Arabic diacritics (Harakat) - - * src/hunspell/suggestmgr.cxx: new edit distance suggestion methods - - capitalization: nasa -> NASA - - long swap: permenant -> permanent - - long mov.: Ghandi -> Gandhi - - double two characters: vacacation -> vacation - * tests/sug.*: test data - - * src/hunspell/affixmgr.cxx: space in REP strings (alot -> a lot) - Note: Underline character signs the space in REP strings: REP alot a_lot, and - put the expression with space ("a lot") into the dic file (see tests/sug). - - * hashmgr.cxx, affixmgr.cxx: ignore Unicode byte order mark (BOM sequence) - * tests/utf8_bom*: test data - - * hunspell/*.cxx: OOo Issue 68903 - Make lingucomponent warning-free on wntmsci10 - - fix Hunspell related warning messages on Windows platform (except some assignment - within conditional expressions). Reported and started by Stephan Bergmann. - - * hunspell/affixmgr.cxx: fix OOo Issue 66683 - hunspell dmake debug=x fails - - Reported by Stephan Bergmann. - - * src/hunspell/hunspell.[ch]xx: thread safe API for Hunspell executable - (removing prev*() functions, new spell(word, info, root) function) - - * configure.ac, src/hunspell/*: HUNSPELL_EXPERIMENTAL code - --with-experimental configure option (conditional compiling of morphological analyser - and stemmer tools) - - * configure.ac, src/hunspell/*: conditional Hunspell warning messages - --with-warnings configure option - - * affixmgr.cxx: new, optimized parsing functions - - * affixmgr.cxx: fix homonym handling for German dictionary project, - reported by Björn Jacke (sf.net Bug ID 1592880). - * tests/1592880.*: test data by Björn Jacke - - * src/hunspell/affixmgr.cxx: fix CIRCUMFIX suggestion - Bug reported by Erdal Ronahi. - - * hunspell.cxx: reverse root word output (complex prefixes) - Bug reported by Munzir Taha. - - * tools/hunspell.cxx: fix Emacs compatibility, patch by marot at sf.net - - no % command in PIPE mode (SourceForge BugTracker 1595607) - - fix HUNSPELL_VERSION string - - * suggestmgr.[hc]xx: rename check() functions to checkword() (OOo Issue 68296) - adopt MySpell patch by Bryan Petty (tierra at ooo) for Hunspell source - - * csutil.cxx, munch.c, unmunch.c: adopt relevant parts of the MinGW patch - (OOo Issue 42504) by tonal at ooo - - * affigmgr.cxx: remove double candidate_check() call, reported by Bram Moolenaar - - * tests/test.sh: add LC_ALL="C" environment. Locale dependency of make check - reported by Gentoo project. - - * src/tools/hunspell.cxx: UTF-8 highlighting fix for console UI - (not solved: breaking long UTF-8 lines) - - * src/tools/unmunch.c: fix bad generation if strip is shorter than condition, - reported by Davide Prina - * src/tools/unmunch.h: increase 5000 -> 500000 - - * src/tools/hunspell.cxx: fix memory error in suggestion (uninitialized parameter), - Bug also reported by Björn Jacke in SourceForge Bug 1469957 - - * csutil.cxx, affixmgr.cxx: fix Caolan McNamara's patch for non OOo environment - -2006-11-11 Caolan McNamara : - * csutil.cxx, affixmgr.cxx: UTF-8 table patch (OOo Issue 71449) - Description: memory optimization (OOo doesn't use the large UTF-8 table). - - * Makefile.am: shared library patch (Sourceforge ID 1610756) - - * hunspell.h, hunspell.cxx: C API patch (Sourceforge ID 1616353) - - * hunspell.pc: pkgconfig patch (Sourceforge ID 1639128) - -2006-10-17 Ryan Jones : - * affixmgr.cxx: missing fclose(affixlst) calls - Reported by in OOo Issue 70408 - -2007-07-11 Taha Zerrouki : - * affixmgr.cxx, hunspell.cxx, hashmgr.cxx, csutil.cxx: IGNORE feature to remove - optional Arabic and other characters from input and dictionary words. - * src/hunspell/langnum.hxx: add Arabic language number, lang_ar=96 - * tests/ignore.*: test data - -2006-05-28 Miha Vrhovnik : - * src/win_api/*: C API for Windows DLLs - - also Delphi text editor example (see on Hunspell Sourceforge page) - -2006-05-18 Kevin F. Quinn : - * utf_info.cxx: struct -> static struct - Shared library patch also developed by Gentoo developers (Hanno Meyer-Thurow, - Diego Pettenò, Kevin F. Quinn) - -2006-02-02 Németh László : - * src/hunspell/hunspell.cxx: suggest(): replace "fooBar" -> "foo bar" suggestions - with "fooBar" ->"foo Bar" (missing spaces are typical OCR bugs). - Bug reported by stowrob at OOo in Issue 58202. - * src/hunspell/suggestmgr.cxx: twowords(): permit 1-character words. - (restore MySpell's original behavior). Here: "aNew" -> "a New". - * tests/i58202.*: test data - - * src/parsers/textparser.cxx: fix Unicode tokenization in is_wordchar() - (extra word characters (WORDCHARS) didn't work on big-endian platforms). - - * src/hunspell/{csutil,affixmgr}.cxx: inline isSubset(), isRevSubset(): - little speed optimalization for languages with rich morphology. - - * src/tools/hunspell.cxx: fix bad --with-ui and --with-readline compiling - when (N)curses is missing. Reported by Daniel Naber. - -2006-01-19 Tor Lillqvist - * src/hunspell/csutil.cxx: mystrsep(): fix locale-dependent isspace() tokenization - -2006-01-06 András Tímár - * src/hunspell/{hashmgr.hxx,hunspell.cxx}: fix Visual C++ compiling errors - -2006-01-05 Németh László : - * COPYING: set GPL/LGPL/MPL tri-license for Mozilla integration. - Rationale: Mozilla source code contains an old MySpell version - with GPL/LGPL/MPL tri-license. (MPL license is a copyleft license, similar - to the LGPL, but it acts on file level.) - * COPYING.LGPL: GNU Lesser General Public License 2.1 (LGPL) - * COPYING.MPL: Mozilla Public License 1.1 (MPL) - * license.hunspell, src/hunspell/license.hunspell: GPL/LGPL/MPL tri-license - - * src/hunspell/{affixmgr,hashmgr}.*: AF, AM alias definitions in affix file: - compression of flag sets and morphological descriptions (see manual, - and tests/alias* test files). - Rationale: Alias compression is also good for loading time and memory - efficiency, not only smaller resources. - * src/tools/makealias: alias compression utility - (usage: ./makealias file.dic file.aff) - * tests/alias{,2,3}: AF, AM tests - * man/hunspell.4: add AF, AM documentation - * src/hunspell/affentry.cxx, atypes.hxx: add new opts bits (aeALIASM, aeALIASF) - - * tools/hunspell, src/parser/*, src/hunspell/*: Hunspell program - tokenizes Unicode texts (only with UTF-8 encoded dictionaries). - Missing Unicode tokenization reported by Björn Jacke, Egmont Koblinger, - Jess Body and others. - Note: Curses interactive interface hasn't worked perfectly yet. - * tests/*.tests: remove -1 parameters of Hunspell - * tests/*.{good,wrong}: remove tabulators - - * src/hunspell/{hunspell,affixmgr}.cxx: BREAK option: break words at - specified break points and checking word parts separately (see manual). - Note: COMPOUNDRULE is better (or will be better) for handling dashes and - other compound joining characters or character strings. Use BREAK, if you - want check words with dashes or other joining characters and there is no time - or possibility to describe precise compound rules with COMPOUNDRULE. - * tests/break.*: BREAK example. - - * src/hunspell/{affixmgr,hunspell}.cxx: add CHECKSHARPS declaration instead - of LANG de_DE definitions to handle German sharp s in both spelling and - suggestion. - * src/hunspell/hunspell.cxx: With CHECKSHARPS, uppercase words are valid - with both lower sharp s (it's is optional for names in German legal texts) - and SS (MÜßIG, MÜSSIG). Missing lower sharp s form reported by Björn Jacke. - * src/hunspell/hunspell.cxx: KEEPCASE flag on a sharp s word has a special - meaning with CHECKSHARPS declaration: KEEPCASE permits capitalisation and SS upper - casing of a sharp s word (Müßig and MÜSSIG), but forbids the upper cased form - with lower sharp s character(s): *MÜßIG. - * tests/germancompounding*: add CHECKSHARPS, remove LANG - * tests/checksharps*: add CHECKSHARPS and KEEPCASE, remove LANG - - * src/hunspell/hunspell.cxx: improved suggestions: - - suggestions for pressed Caps Lock problems: macARONI -> macaroni - - suggestions for long shift problems: MAcaroni -> Macaroni, macaroni - - suggestions for KEEPCASE words: KG -> kg - * src/hunspell/csutil.cxx: fix mystrrep() function: - - suggestions for lower sharp s in uppercased words: MÜßIG -> MÜSSIG - * tests/checksharps{,utf}.sug: add tests for mystrrep() fix - - * src/hunspell/hashmgr.cxx: Now dictionary words can contain slashes - with the "\/" syntax. Problem reported by Frederik Fouvry. - - * src/hunspell/hunspell.cxx: fix bad duplicate filter in suggest(). - (Suggesting some capitalised compound words caused program crash - with Hungarian dictionary, OOo Issue 59055). - - * src/hunspell/affixmgr.cxx: fix bad defcpd_check() call in compound_check(). - (Overlapping new COMPOUNDRULE and old compounding methods caused program - crash at suggestion.) - - * src/hunspell/affixmgr.{cxx,hxx}: check affix flag duplication at affix classes. - Suggested by Daniel Naber. - - * src/hunspell/affentry.cxx: remove unused variable declarations (OOo i58338). - Compiler warnings reported by András Tímár and Martin Hollmichel. - - * src/hunspell/hunspell.cxx: morph(): not analyse bad mixed uppercased forms - (fix Arabic morphological analysis with Buckwalter's Arabic transliteration) - - * src/hunspell/affentry.{cxx,hxx}, atypes.hxx: little memory optimization - in affentry: - - using unsigned char fields instead of short (stripl, appndl, numconds) - - rename xpflg field to opts - - removing utf8 field, use aeUTF8 bit of opts field - - * configure.ac: set tests/maputf.test to XFAILED on ARM platform. - Fail reported by Rene Engelhard. - - * configure.ac: link Ncursesw library, if exists. - - * BUGS: add BUGS file - - * tests/complexprefixes2.*: test for morphological analysis with COMPLEXPREFIXES - - * src/hunspell/affixmgr.cxx: use "COMPOUNDRULE" instead of - "COMPOUND". The new name suggested by Bram Moolenaar. - * tests/compoundrule*: modified and renamed compound.* test files - - * man/hunspell.4: AF, AM, BREAK, CHECKSHARPS, COMPOUNDRULE, KEEPCASE. - - also new addition to the documentation: - Header of the dictionary file define approximate dictionary size: - ``A dictionary file (*.dic) contains a list of words, one per line. - The first line of the dictionaries (except personal dictionaries) - contains the _approximate_ word count (for optimal hash memory size).'' - Asked by Frederik Foudry. - - One-character replacements in REP definitions: ``It's very useful to - define replacements for the most typical one-character mistakes, too: - with REP you can add higher priority to a subset of the TRY suggestions - (suggestion list begins with the REP suggestions).'' - -2005-11-11 Németh László : - * src/hunspell/affixmgr.*: fix Unicode MAP errors (sorted only n-1 - characters instead of n ones in UTF-16 MAP character lists). - Bug reported by Rene Engelhard. - - * src/hunspell/affixmgr.*: fix infinite COMPOUND matching (default char - type is unsigned on PowerPC, s390 and ARM platforms and it will never - be negative). Bug reported by Rene Engelhard. - - * src/hunspell/{affixmgr,suggestmgr}.cxx: fix bad ONLYINCOMPOUND - word suggestions. - * tests/onlyincompound.sug: empty test file to check this fix. - Bug reported by Björn Jacke. - - * src/hunspell/affixmgr.cxx: fix backtracking in COMPOUND pattern matching. - * tests/compound6.*: test files to check this fix. - - * csutil.cxx: set bigger range types in flag_qsort() and flag_bsearch(). - - * affixmgr.hxx: set better type for cont_classes[] Boolean data (short -> char) - - * configure.ac, tests/automake.am: set platform specific XFAIL test - (flagutf8.test on ARM platform) - -2005-11-09 Németh László : -improvements: - * src/hunspell/affixmgr.*: new and improved affix file parameters: - - - COMPOUND definitions: compound patterns with regexp-like matching. - See manual and test files: tests/compound*.* - Suggested by Bram Moolenaar. - Also useful for simple word-level lexical scanning, for example - analysing numbers or words with numbers (OOo Issue #53643): - http://qa.openoffice.org/issues/show_bug.cgi?id=53643 - Examples: tests/compound{4,5}.*. - - - NOSUGGEST flag: words signed with NOSUGGEST flag are not suggested. - Proposed flag for vulgar and obscene words (OOo Issue #55498). - Example: tests/nosuggest.*. - Problem reported by bobharvey at OOo: - http://qa.openoffice.org/issues/show_bug.cgi?id=55498 - - - KEEPCASE flag: Forbid capitalized and uppercased forms of words - signed with KEEPCASE flags. Useful for special ortographies - (measurements and currency often keep their case in uppercased - texts) and other writing systems (eg. keeping lower case of IPA - characters). - - - CHECKCOMPOUNDCASE: Forbid upper case characters at word bound in compounds. - Examples: tests/checkcompoundcase* and tests/germancompounding.* - - - FLAG UTF-8: New flag type: Unicode character encoded with UTF-8. - Example: tests/flagutf8.*. - Rationale: Unicode character type can be more readable - (in a Unicode text editor) than `long' or `num' flag type. - -bug fixes: - * src/hunspell/hunspell.cxx: accept numbers and numbers with separators (i53643) - Bug reported by skelet at OOo: - http://qa.openoffice.org/issues/show_bug.cgi?id=53643 - - * src/hunspell/csutil.cxx: fix casing data in ISO 8859-13 character table. - - * src/hunspell/csutil.cxx: add ISO-8859-15 character encoding (i54980) - Rationale: ISO-8859-15 is the default encoding of the French OpenOffice.org - dictionary. ISO-8859-15 is a modified version of ISO-8859-1 - (latin-1) character encoding with French œ ligatures and euro - symbol. Problem reported by cbrunet at OOo in OOo Issue 54980: - http://qa.openoffice.org/issues/show_bug.cgi?id=54980 - - * src/hunspell/affixmgr.cxx: fix zero-byte malloc after a bad affix header. - Patch by Harri Pitkänen. - - * src/hunspell/suggestmgr.cxx: fix bad NEEDAFFIX word suggestion - in ngram suggestions. Reported by Daniel Naber and Friedel Wolff. - - * src/hunspell/hashmgr.cxx: fix bad white space checking in affix files. - src/hunspell/{csutil,affixmgr}.cxx: add other white space separators. - Problems with tabulators reported by Frederik Fouvry. - - * src/hunspell/*: replace system-dependent #include - parameters with quoted ones. Problem reported by Dafydd Jones. - - * src/hunspell/hunspell.cxx: fix missing morphological analysis of dot(s) - Reported by Trón Viktor. - -changes: - * src/hunspell/affixmgr.cxx: rename PSEUDOROOT to NEEDAFFIX. - Suggested by Bram Moolenaar. - - * src/hunspell/suggestmgr.hxx: Increase default maximum of - ngram suggestions (3->5). Suggested by Kevin Hendricks. - - * src/hunspell/htypes.hxx: Increase MAXDELEN for long affix flags. - - * src/hunspell/suggestmgr.cxx: modify (perhaps fix) Unicode map suggestion. - tests/maputf test fail on ARM platform reported by Rene Engelhard. - - * src/hunspell/{affentry.cxx,atypes.hxx}: remove [PREFIX] and - MISSING_DESCRIPTION messages from morphological analysis. - Problems reported by Trón Viktor. - - * tests/germancompounding.{aff,good}: Add "Computer-Arbeit" test word. - Suggested by Daniel Naber. - - * doc/man/hunspell.4: Proof-reading patch by Goldman Eleonóra. - - * doc/man/hunspell.4: Fix bad affix example (replace `move' with `work'). - Bug reported by Frederik Fouvry. - - * tests/*: new test files: - affixes.*: simple affix compression example from Hunspell 4 manual page - checkcompoundcase.*, checkcompoundcase2.*, checkcompoundcaseutf.* - compound.*, compound2.*, compound3.*, compound4.*, compound5.* - compoundflag.* (former compound.*) - flagutf8.*: test for FLAG UTF-8 - germancompounding.*: simplification with CHECKCOMPOUNDCASE. - germancompoundingold.* (former germancompounding.*) - i53643.*: check numbers with separators - i54980.*: ISO8859-15 test - keepcase.*: test for KEEPCASE - needaffix*.* (former pseudoroot*.* tests) - nosuggest.*: test for NOSUGGEST - -2005-09-19 Németh László : - * src/hunspell/suggestmgr.cxx: improved ngram suggestion: - - detect not neighboring swap characters (pernament -> permanent) - Rationale: ngram method has a significant error with not neighboring - swap characters, especially when swap is in the middle of the word. - - suggest uppercase forms (unesco -> UNESCO, siggraph's -> SIGGRAPH's) - - suggest only ngram swap character and uppercase form, if they exist. - Rationale: swap character and casing equivalence give mutch better - suggestions as any other (weighted) ngram suggestions. - - add uppercase suggestion (PERMENANT -> PERMANENT) - - * src/hunspell/*: complete comparison with MySpell 3.2 (in OOo beta 2): - - affixmgr.cxx: add missing numrep initialization - - hashmgr.cxx: add_word(): don't allocate temporary records - - hunspell.cxx: in suggest(): - - check capitalized words first (better sug. order for proper names), - - check pSMgr->suggest() return value - - set pSMgr->suggest() call to not optional in HUHCAP - - csutil.cxx: fix bad KOI8-U -> koi8r_tbl reference in enc_entry encds - - csutil.cxx: fix casing data in ISO 8859-2, Windows 1251 and KOI8-U - encoding tables. Bug reported by Dmitri Gabinski. - - * src/hunspell/affixmgr.*: improved compound word and other features - - generalize hu_HU specific compound word features with new affix file - parameters, suggested by Bram Moolenaar: - - CHECKCOMPOUNDDUP: forbid word duplication in compounds (eg. foo|foo) - - CHECKCOMPOUNDTRIPLE: forbid triple letters in compounds (eg. foo|obar) - - CHECKCOMPOUNDPATTERN: forbid patterns at word bounds in compounds - - CHECKCOMPOUNDREP: using REP replacement table, forbid presumably bad - compounds (useful for languages with unlimited number of compounds) - - ONLYINCOMPOUND flag works also with words (see tests/onlyincompound.*) - Suggested by Daniel Naber, Björn Jacke, Trón Viktor & Bram Moolenaar. - - PSEUDOROOT works also with prefixes and prefix + suffix combinations - (see tests/pseudoroot5.*). Suggested by Trón Viktor. - - man/hunspell.4: updated man page - - * src/hunspell/affixmgr.*: fix incomplete prefix handling with twofold - suffixes (delete unnecessary contclasses[] conditions in - prefix_check_twosfx() and prefix_check_twosfx_morph()). - Bug reported by Trón Viktor. - - * src/hunspell/affixmgr.*: complete also *_morph() functions with - conditions of new Hunspell features (circumfix, pseudoroot etc.). - - * src/hunspell/suggestmgr.cxx: - - fix missing suggestions for words with crossed prefix and suffix - - fix redundant non compound word checking - - fix losing suggestions problem. Bug reported by Dmitri Gabinski. - - * src/hunspell/dictmgr.*: - - add new dictionary manager for Hunspell UNO modul - Problems with eo_ANY Esperanto locale reported by Dmitri Gabinski. - - * src/hunspell/*: use precise constant sizes for 8-bit and 16-bit character - arrays with MAXWORDUTF8LEN and MAXSWUTF8L macros. - - * src/hunspell/affixmgr.cxx: fix bad MAXNGRAMSUGS parameter handling - - * src/hunspell/affixmgr.cxx, src/tools/{un}munch.*: fix GCC 4.0 warnings - on fgets(), reported by Dvornik László - - * po/hu.po: improved translation by Dvornik László - - * tests/test.sh: improved test environment - - add suggestion testing (see tests/*.sug) - - add memory debugging environment, based on the excellent Valgrind debugger. - Usage on Linux and experimental platforms of Valgrind: - VALGRIND=memcheck make check - - rename test_hunmorph to test.sh - - * tests/*: new tests: - - base.*: base example based on MySpell's checkme.lst. - - map{,utf}.*, rep{,utf}: MAP and REP suggestion examples - - tests on new CHECKCOMPOUND, ONLYINCOMPOUND and PSEUDOROOT features - - i54633.*: capitalized suggestion test for Issue 54633 from OOo's Issuezilla - - i35725.*: improved ngram suggestion test for Issue 35725 - -2005-08-26 Németh László : -improvements: - - * src/hunspell/suggestmgr.cxx: - Unicode support in related character map suggestion - - * src/hunspell/suggestmgr.cxx: Unicode support in ngram suggestion - - * src/hunspell/{suggestmgr,affixmgr,hunspell}.cxx: improve ngram suggestion. - Fix http://qa.openoffice.org/issues/show_bug.cgi?id=35725. See release - notes for examples. This problem reported by beccablain at OOo. - - ngram suggestions now are case insensitive (see `Permenant' bug in Issuezilla) - - weight ngram suggestions (with the longest common subsequent algorithm, - also considering lengths of bad word and suggestion, identical first - letters and almost completely identical character positions) - - set strict affix congruency in expand_rootword(). Now ngram suggestions - are good for languages with rich morphology and also better for English. - Rationale: affixed forms of the first ngram suggestion - very often suppress the second and subsequent root word suggestions. But - faults in affixes are more uncommon, and can be fix without suggestions. - We must prefer the more informative second and subsequent root word - suggestions instead of the suggestions for bad affixes. - - a better suggestion may not be substring of a less good suggestion - Rationale: Suggesting affixed forms of a root word is - unnecessary, when root word has got better weighted ngram value. - (Checking substrings is a good approximation for this refinement.) - - lesser ngram suggestions (default 3 maximum instead of 10) - Rationale: For users need a big extra effort to check a lot of bad ngram - suggestions, nine times out of ten unnecessarily. It is very - distracting, because ngram suggestions could be very different. - Usually Myspell and Hunspell suggest one or two suggestions with - the old suggestion algorithms (maximum is 15), with ngram algorithm - often gives maximum number suggestions. With strict affix congruency - and other refinements, the good suggestion there is usually among the - first three elements. - - new affix parameter: MAXNGRAMSUG - - * src/hunspell/*: support agglutinative languages with rich prefix - morphology or with right-to-left writing system (for example, Turkic - and Austronesian languages with (modified) Arabic scripts). - - new affix parameter: COMPLEXPREFIXES - Set twofold prefix stripping (but single suffix stripping) - * src/hunspell/affixmgr.cxx: - - speed up prefix loading with tree sorting algorithm. - * tests/complexprefixes.*, tests/complexprefixesutf.*: - Coptic example posted by Moheb Mekhaiel - - * src/hunspell/hashmgr.cxx: check size attribute in dic file - suggested by Daniel Naber - Rationale: With missing size attribute Hunspell allocates too small and - more slower hash memory, and Hunspell can lose first dictionary word. - - * src/hunspell/affixmgr.cxx: check stripping characters and condition - compatibility in affix rules (bugs detected in cs_CZ, es_ES, es_NEW, - es_MX, lt_LT, nn_NO, pt_PT, ro_RO and sk_SK dictionaries). See release - notes of Hunspell 1.0.9 in NEWS. - - * src/hunspell/affixmgr.cxx: check unnecessary fields in affix rules - (bugs detected in ro_RO and sv_SE dictionaries). See release notes. - - * src/hunspell/affixmgr.cxx: remove redundant condition checking - in affix rules with stripping characters (redundancy in OpenOffice.org - dictionaries reported by Eleonóra Goldman) - Rationale: this is a little optimization, but it was excellent for - detect the bad ngram affixation with bad or weak affix conditions. - - * tests/germancompounding.aff: improve compound definition - - use dash prefix instead of language specific tokenizer - Rationale: Using uniform approach is the right way to check and analyze - compound words. Language specific word breaking is deprecated, need - a sophisticated grammar checking for word-like word pairs - (for example in Hungarian there is a substandard, but accepted - syntax with dash for word pairs: cats, dogs -> kutyák-macskák (like - cats/dogs in English). - - * test Hunspell with 54 OpenOffice.org dictionaries: see release notes - -bug fixes: - - * src/hunspell/suggestmgr.*: add time limit to exponential - algorithm of the related character map suggestion - Rationale: a long word in agglutinative languages or a special pattern - (for example a horizontal rule) made of map characters can `crash' the - spell checker. - - * src/hunspell/affentry.cxx: add() functions: fix bad word generation - checking stripping characters (see similar bug in unmunch) - - * src/hunspell/affixmgr.cxx: parse_file(): fix unconditional getNext() - call for ~AffixMgr() when affix file is corrupt. - - * src/hunspell/affixmgr.*: AffixMgr(), parse_cpdsyllable(): fix missing - string duplications for ~AffixMgr() when affix file is corrupt. - - * src/hunspell/affixmgr.*: parse_affix(): fix fprintf() call when affix - file is corrupt. Bug reported by Daniel Naber. - - * suggestmgr.cxx: replace single usage of 'strdup' with 'mystrdup' - patch by Chris Halls (debian.org) - - * src/hunspell/makefile.mk: add makefile.mk for compiling in OpenOffice.org - See README in Hunspell UNO modul. - Problems with separated compiling reported by Rene Engelhard - - * src/hunspell/hunspell.cxx: fix pseudoroot support - - search a not pseudoroot homonym in check() - * tests/pseudoroot4.*: test this fix - - * src/tools/unmunch.c: fix bad word generation when conditions - are shorter or incompatible with stripping characters in affix rules - - * src/tools/unmunch.c: fix mychomp() for de_AT.dic and other dic files - without last new line character. - -other changes: - * src/hunspell/suggestmgr.*: erase ACCENT suggestion - Rationale: ACCENT suggestion was the same as Kevin Hendrick's map - suggestion algorithm, but with a less good interface in affix file. - - * src/hunspell/suggestmgr.*: combine cycle number limit - in badchar(), and forgotchar() with a time limit. - - * src/hunspell/affixmgr.*: remove NOMAPSUGS affix parameter - - * src/hunspell/{suggestmgr,hunspell}.*: strip periods from - suggestions (restore MySpell's original behaviour) - Rationale: OpenOffice.org has an automatic period handling mechanism - and suggestions look better without periods. - - new affix file parameter: SUGSWITHDOTS - Add period(s) to suggestions, if input word terminates in period(s). - (No need for OpenOffice.org dictionaries.) - - * tests/germancompounding.aff: improve bad german affix in affix example - (computeren->computern). Suggested by Daniel Naber. - - * src/tools/example.cxx: add Myspell's example - - * src/tools/munch.cxx: add Myspell's munch - - * man{,/hu}/hunspell.4: refresh manual pages - -2005-08-01 Németh László : - * add missing MySpell files and features: - - add MySpell license.readme, README and CONTRIBUTORS ({license,README,AUTHORS}.myspell) - - add MySpell unmunch program (src/tools/unmunch.c) - - add licenses to source (src/hunspell/license.{myspell,hunspell}) - - port MAP suggestion (with imperfect UTF-8 support) - - add NOSPLITSUGS affix parameter - - add NOMAPSUGS affix parameter - - * src/man/man.4: MAP, COMPOUNDPERMITFLAG, NOSPLITSUGS, NOMAPSUGS - - * src/hunspell/aff{entry,ixmgr}.cxx: - - improve compound word support - - new affix parameter: COMPOUNDPERMITFLAG (see manual) - * src/tests/compoundaffix{,2}.*: examples for COMPOUNDPERMITFLAG - * src/tests/germancompounding.*: new solution for German compounding - Problems with German compounding reported by Daniel Naber - - * src/hunspell/hunspell.cxx: fix German uppercase word spelling - with the spellsharps() recursive algorithm. - Default recursive depth is 5 (MAXSHARPS). - * src/tests/germansharps*: extended German sharp s tests - - * src/tools/hunspell.cxx: fix fatal memory bug in non-interactive - subshells without HOME environmental variable - Bug detected with PHP by András Izsók. - -2005-07-22 Németh László : - * src/hunspell/csutil.hxx: utf16_u8() - - fix 3-byte UTF-8 character conversion - -2005-07-21 Németh László : - * src/hunspell/csutil.hxx: hunspell_version() for OOo UNO modul - -2005-07-19 Németh László : - * renaming: - - src/morphbase -> src/hunspell - - src/hunspell, src/hunmorph -> src/tools - - src/huntokens -> src/parsers - - * src/tools/hunstem.cxx: add stemmer example - -2005-07-18 Németh László : - * configure.ac: --with-ui, --with-readline configure options - * src/hunspell/hunspell.cxx: fix conditional compiling - - * src/hunspell/hunspell.cxx: set HunSPELL.bak temporaly file - in the same dictionary with the checked file. - - * src/morphbase/morphbase.cxx: - - - handling German sharp s (ß) - - - fix (temporaly) analyize() - - * tests: a lot of new tests - - * po/, intl/, m4/: add gettext from GNU hello - - * po/hu.po: add Hungarian translation - - * doc/, man/: rename doc to man - -2005-07-04 Németh László : - * src/morphbase/hashmgr.cxx: set FLAG attributum instead of FLAG_NUM and FLAG_LONG - - * doc/hunspell.4: manual in English - -2005-06-30 Németh László : - * src/morphbase/csutil.cxx: add character tables from csutil.cxx of OOo 1.1.4 - - * src/morphbase/affentry.cxx: fix Unicode condition checking - - * tests/{,utf}compound.*: tests compounding - -2005-06-27 Németh László : - * src/morphbase/*: fix Unicode compound handling - -2005-06-23 Halácsy Péter: - * src/hunmorph/hunmorph.cxx: delete spelling error message and suggest_auto() call - -2005-06-21 Németh László : - * src/morphbase: Unicode support - * tests/utf8.*: SET UTF-8 test - - * src/morphbase: checking and fixing with Valgrind - Memory handling error reported by Ferenc Szidarovszky - -2005-05-26 Németh László : - * suggestmgr.cxx: fix stemming - * AUTHORS, COPYING, ChangeLog: set CC-LGPL free software license - -2004-05-25 Varga Dániel - * src/stemtool: new subproject - -2005-05-25 Halácsy Péter - * AUTHORS, COPYING: set CC Attribution license - -2004-05-23 Varga Dániel - * src: - modifications for compiling with Visual C++ - - * src/hunmorph/csutil.cxx: correcting header of flag_qsort(), - * src/hunmorph/*: correct csutil include - -2005-05-19 Németh László - * csutil.cxx: fix loop condition in lineuniq() - bug reported by Viktor Nagy (nagyv nyelvtud hu). - - * morphbase.cxx: handle PSEUDOROOT with zero affixes - bug reported by Viktor Nagy (nagyv nyelvtud hu). - * tests/zeroaffix.*: add zeroaffix tests - -2005-04-09 Németh László - * config.h.in: reset with autoheader - - * src/hunspell/hunspell.cxx: set version - -2005-04-06 Németh László - * tests: tests - - * src/morphbase: - New optional parameters in affix file: - - PSEUDOROOT: for forbidding root with not forbidden suffixed forms. - - COMPOUNDWORDMAX: max. words in compounds (default is no limit) - - COMPOUNDROOT: signs compounds in dictionary for handling special compound rules - - remove COMPOUNDWORD, ONLYROOT - -2005-03-21 Németh László - * src/morphbase/*: - - 2-byte flags, FLAG_NUM, FLAG_LONG - - CIRCUMFIX: signed suffixes and prefixes can only occur together - - ONLYINCOMPOUND for fogemorpheme (Swedish, Danish) or Flute-elements (German) - - COMPOUNDBEGIN: allow signed roots, and roots with signed suffix in begin of compounds - - COMPOUNDMIDDLE: like before, but middle of compounds - - COMPOUNDEND: like before, but end of compounds - - remove COMPOUNDFIRST, COMPOUNDLAST diff --git a/subprojects/hunspell/ChangeLog.O b/subprojects/hunspell/ChangeLog.O deleted file mode 100644 index a2c712d73..000000000 --- a/subprojects/hunspell/ChangeLog.O +++ /dev/null @@ -1,524 +0,0 @@ -Myspell has a lot of parallel development, that is not documented here. - -2005-01-11: Nmeth Lszl - * hunspell.cxx: - - interaktv javtsnl hinyz j sor karakterek ptlsa. - A hibt Gefferth Andrs s Khiraly jelezte. - * csutil.cxx: - - pontosvesszk trlse a GCC 3.4-es fordt ignyeinek megfelelen - A hibt Dvornik Lszl jelezte. - - i vltoz ismtelt deklarsnak trlse, ami helyenknt hibs - fordtst eredmnyez. - A hibt Ldoktor s Bencsth Boldizsr jelezte. - * OLVASS.EL: - - Windows alatti fordtsnl Langid.cxx mdostand. A hibt - Ldoktor jelezte. - -2004-12-15 Nmeth Lszl - * src/morphbase/*: - - handling K&R morphological encoding (remove plus signs from output) - - LEMMA_PRESENT: put only morphological description to output - - LANG parameter, langnum variable in source for writing language-dependent codes - - remove HU_KOTOHANGZO - - etc. - * doc/hunspell.4: - - adding some - -2004-09-29 Halcsy Pter - - * doc/ : bemsoltam a hunspell.1 hunspell.4 man oldalakat - * doc/hunspell.1: Kivettem a -s -m kapcsolkrl szl rszt - -2004-09-28 Halcsy Pter - - * src/hunspell/hunspell.cxx (indexing_interface): Ezt kiszedtem a - HunSpell-bol, mert nem ide valo. Ez egy kulon program lehet. - (main): a hunstem zemmdot is kidobtam, ez se ide val - (main): meg a hunmorph zemmdot is - - * src/morphbase/morphbase.cxx (MorphBase): tneveztem a MySpell - osztlyt MorphBase-re - (stems): tnevezten a suggest_stems metdust stem -re (mint to stem) - -2004-08-25 Nmeth Lszl - * src/hunbase/suggestmgr.cxx: tvezs visszalltsa, nem - mkdik mg az igektk hozztoldsa a thz, tovbb a - kivtelek kezelse (ehhez a 0.99.4-es sztr szksges mg). - * src/hunbase/myspell.cxx: -s vissza a tvezshez - * src/hunbase/atypes.hxx: HUNSTEM makr definilsa itt az - affixmgr.cxx feltteles kdjhoz - -2004-08-12 Halacsy Peter - * src/misc/lexfilter.cxx : uj program, ami a szotar szureshez hasznalhato - lecserelheti a mostani hunmorph, hunspell -G -1 funkciokat - - * src/hunbase/myspell.cxx (analyzer) : Uj metodust vettem fel, ami mar - karaktertombben adja vissza az elemzes eredmenyet - -2004-08-03 Halcsy Pter - - * src/hunspell/hunspell.cxx (HUNSPELL_VERSION): ttettem ide ennek definilst - -2004-07-31 Halcsy Pter - - * src/hunbase/suggestmgr.cxx (fixstems): A fixstems mirt itt van - s mirt gy hvjk. Ez mehetne egy kln osztlyba. - -2004-07-31 Halcsy Pter - - * src/huntoken/htmlparser.cxx: Egyebkent az include-ok kezelese - eleg zavaros. Peldaul itt minek a textparser.hxx includolasa? - - * src/huntoken/textparser.hxx (MAXLNLEN): thoztam ide a MAXLNLEN makrt - az atypes.hxx-bol, hogy a fuggoseget megszuntessem - - * src/hunbase/myspell.cxx (suggest): Kivettem azt a rszt, ami visszaadja a HUNSPELL_VERSION stringet - ha a VERSION_KEYWORD a bemeneti string. Csnya gnyolsnak tartottam - -2004-07-27 Halcsy Pter - - * src/hunbase/myspell.cxx (morph_with_correction): - - * src/hunbase/baseaffix.hxx (class AffEntry): Allandora felvettem a morphcode mezot (last htypes.hxx) - - * src/hunbase/affentry.hxx: Kivettem a hunmorph felteteleket (last htypes.hxx) - - * src/hunbase/htypes.hxx (struct hentry): Kivettem a HUNMORPH feltetelt a char* description korul. Ertem, - hogy hatekonyabb egy folosleges mutato nelkul, ha nincs morf info, de szerintem felesleges - - * src/hunbase/myspell.hxx: HUNSPELL_VERSION es VERSION_KEYWORD makrokat kivettem. Valamiert a - hunspellnek kell majd - - * src/hunbase/config.hxx (FLAG): config.hxx torolve, helyet atveszi a kozponti config.h; FLAG - definicioja az atypes.hxx-be ment - - * src/hunbase/atypes.hxx (FLAG): config.hxx megszuntetese erdekeben attettem ide a FLAG makro - definialasat, ami az EXT_CLASS-tol fugg - - config.hxx include kicserelve a configure altal kezelt config.h-ra - -2004-06-29: Nmeth Lszl - * affixmgr.cxx: - - csak utols tagknt megengedett szavak (compound3) toldalk - nlkli elfordulsnak engedlyezse (pl. macskapr) - - tbbszrsen sszetett szavak toldalkolt alakjainak morfolgiai - elemzse - * myspell.cxx: - - rvidtsek, szmok, ktjeles sszetett szavak s a - -e hatrozszt tartalmaz szavak morfolgiai elemzse - * suggestmgr.cxx: suggest_morph_for_spelling_error() optimalizlsa - (csak a felhasznlt egy javaslatot keresi meg, tbbet nem). - * csutil.cxx: kimenetben szerepl res sorok trlse - -2004-06-10: Nmeth Lszl - * suggestmgr.cxx: sszetett szavak elemzsnek korltozsa - - a tvezs mg nincs megvalstva a 0.9.9-es vltozatban - (helyette a Hunspell 0.9.7 hasznland a Magyar Ispell 0.99.4-es - vltozatval) - -2004-05-19: Nmeth Lszl - * 0.9.9f-alpha - - - morf. lers sztringkezelse jav. - - EXT_CLASS: config.cxx-ben - - nagybets alakok is elemezve (a hibt Tron Viktor jelezte) - - szebb kimenet - - rule119 trlve - - firstparser.cxx javtva - -2004-02-13: Nmeth Lszl - * 0.9.8a: - - MAXUSERWORD helyett USERWORD, nincs korlt - - description \t-vel dic fjlba - - homonimk kezelse - - aff formtumbvts - - konfixumok - - _morpho fggvnyek - - ketts szuffixum - - hunmorph - - lsd tests/hunmorph - -2004-01-29: Nmeth Lszl - * 0.9.7-sztaki: - - memriakezelsi hibk javtsa - -2003-12-17: Nmeth Lszl - * 0.9.7-es vltozat: - * affixmgr.cxx: - - suffix_check() javts (tmpword kivltsa isRevSubSet() - fggvnnyel - - betlts optimalizlsa, build_pfxlist() helyett: - - build_pfxtree() - - process_sfx_tree_to_list(), process_sfx_inorder() - - * csutil.cxx: - - isSubSet() gyorsabb vltozata - - isRevSubSet() - - * langid.cxx, hunp.cxx: - - nyelvfelismer osztly s program (l. man hunp) - * man/hunp.1: - - nyelvfelismer program lersa - - * firstparser.cxx: - - csak a tabultorjelet tartalmaz sorokbl a tabultorjel - eltti rszt adja vissza (l. man Hunspell, -1 kapcsol) - - * hunspell.cxx: - - -u, -U, -u2 kapcsolk: tipikus hibk kijelzse; - automatikus, illetve lektorlt javtsa. L. man hunspell. - - - -w kapcsol teljes sor vizsglathoz - - * hunspell.cxx: - - spell(): javts (Valgrind hibajelzs alapjn) - - * hunspell.cxx: sprintf()-ek el strlen() felttelvizsglat - - * suggestmgr.cxx: - - 0.99.4-es Hunspell sztrral bekerlt tvezsi hiba - javtsa (nem produktv ragozs, sszetett szbam szerepl - fneveknl lpett fel ez a problma). - - * OLVASS.EL: - - bvts - -2003-11-03: Nmeth Lszl - * SuggestMgr::permute_accent(): - - illeglis memriaolvassi hiba javtsa. - * example.cxx:: - - dupla free() a "" karakterlnc tvezse utn - - A hibkat Sarls Tams - fedezte fel a figyelemre mlt Valgrind nyomkvet - programmal (http://developer.kde.org/~sewardj/) - -2003-10-22: Bencsth Boldizsr - * affixmgr.[ch]xx, csutil.[ch]xx: Az eredeti - MySpell foltjainak alkalmazsa az OpenOffice.org 1.1 - kompatibilits rdekben. Itt karakterkezel - segdfggvnyek lettek thelyezve elrhetbb helyre. - - * dictmgr.[ch]xx: Itt etype paramter hozzadsa. - - * makefile.mk: Itt angol sztrak megjegyzsbe ttele. - -2003-10-04: Nmeth Lszl - * 0.9.6.3-as vltozat: - * myspell.cxx: suggest() fggvnyben hibs - memriafoglals javtsa. A hiba a pontra vgzd - helytelen szavakra adott javaslattevs sorn - jelentkezett. A hibs mkdst Khiraly - jelezte. - -2003-09-15: Nmeth Lszl - * 0.9.6.2-es vltozat: - * latexparser.cxx: TeX elemz javtsa: - - elemzsi hiba ({{}}}) - - verb+ +, \verb stb. kezelse - -2003-09-01: Nmeth Lszl - * 0.9.6-os vltozat: - - * affentry.cxx: check2 trlse, lehetsges - tvek trolsa - * suggestmgr.cxx, myspell.cxx: suggest_pos_stems() - az ismeretlen szavak nvszragjainak s - jeleinek levlasztsra. - - * affixmgr.cxx, suggestmgr.cxx: suggest_stems() - szlkezelshez mdostott s javtott fggvny - - * myspell.cxx: szmok tvezse (teszt: 5-nek) - - * myspell.cxx: egy karakter + sz javaslatok - trlse (pldul cpak->cpa k) - - * affixmgr.cxx, myspell.cxx, hunspell.cxx: sztr - verziszmnak kirsa - - * hunspell.cxx: \r karaktert tartalmaz sorok - helyes megjelentse - - * myspell.cxx, hunspell.cxx: rvidts vgi pontok - hozzadsa fggvnyknyvtr szinten - - * hunspell.cxx: pipe_interface(): standard bemenet - tvezsnl hinyz memriafelszabadts ptlsa - - * Makefile: install javtsa, tbb felttelvizsglat - deinstall szakasz - -2003-07-22: Nmeth Lszl - * 0.9.5-s vltozat - * suggestmgr.cxx: marhalevl->lelevl tvezs javtsa - * myspell.cxx: nagy kezdbets rvidtsek vizsglata (Bp., Btk.) - - pontot tartalmaz szmok helyesnek val elfogadsa, ha: - - az els pontot legalbb egy, - - de legfeljebb hrom szmjegy elzi meg, - - a pontok nem egyms mellett helyezkednek el, - - az utols pont utn legfeljebb kt szmjegy van. - Ezzel elfogadjuk az idpontokat (12.00-kor), a pontozsokat - (1.1.2-ben), de kizrjuk a szkz nlkli hibs dtummegadsokat - (2003.7.22.), valamint a tizedesvessz helyett ponttal rt - tizedestrteket (3.456, 4563.34). - - Javts a tiltott szavakra adott ktjeles javaslatoknl: - Straussal->Strauss-szal, s nem ,,Strauss szal''. - * hunspell.cxx: csak a -a kapcsol megadsval lnek a - csfelleti parancsok. Ezrt most mr nincsenek figyelmen - kvl hagyva pldul a ktjellel kezdd sorok, ha a -l - kapcsolval hibs szavakat keresnk egy llomnyban. - * man/hunspell.1: a -a kapcsol lersnak kiegsztse. - -2003-06-13: Nmeth Lszl - * 0.9.4-es vltozat - * bin/*: makedb, lookdb segdprogramok az indexelshez - * man/*: hunstem, makedb, lookdb - * hunspell.cxx: pipe_interface: nyomkvet kirs trlse - - LOG #ifdef-be - -2003-06-11: Nmeth Lszl - * 0.9.3-es vltozat - * suggestmgr.cxx: nagybets javaslat tulajdonneveknl - * hunspell.cxx: pipe_interface: hiba javtsa - -2003-06-05: Nmeth Lszl - * 0.9.2-es vltozat - * hunspell.cxx: -s kapcsol - * suggestmgr.cxx: suggest_stems() - Sztvek ellltsa - * example.cxx: plda a sztvek ellltsra - -2003-05-13: Nmeth Lszl - * 0.9.1-es vltozat - * hunspell.cxx: - - rl_escape(), stb.: a readline sorban ki lett kapcsolva - a fjlnv-kiegszts, s helyette a kt Escape lenyoms - megszaktja a szvegbevitelt. A Csere mveletnl is a - readline() hvs tallhat most mr. - - egy hibs sprintf() sor javtva lett - * Makefile.unix: - - belltsok elklntve az llomny elejn - - Makefile most mr szimblikus kts - * ooomagyarispellteszt.txt: tesztllomny - -2003-04-28: Nmeth Lszl - * affixmgr.cxx: - - y vg szavak kezelse: bvebb lers a - Magyar Ispell Changelog llomnyban. - - * *parser.cxx: - ISO-8859-1 HTML karakterentitsok kzl a betrtkek - (csak az ISO-8859-2-ben nem szereplk) felismerse - s kezelse. - -2003-04-21: Goldman Elenonra - * *.dll fggvnyknyvtr ellltsa Windows alatt: - - StdAfx.h - - libmyspell.def - - dlltest.cpp - -2003-04-16: Nmeth Lszl - * Hunspell.cxx, stb: a Mispell tnevezse Hunspell-l. - A nevet Kornai Andrs javasolta. - Knyvtrak: /usr/share/mispell -> /usr/share/myspell - (korbban is ez volt). - A /usr/share/hunmorph sztr a helye a specilis - morfolgiai informcikat tartalmaz Hunmorph (bvtett - Myspell sztrformtum) sztrllomnyoknak. - * Licenc: LGPL - * config.hxx: SZOSZABLYA_POSSIBLE_ROOTS - Ha a makrt bekapcsoljuk, akkor kirsra kerlnek - a lehetsges tvek is, az alkalmazott ragozsi szably - osztlynak betjelvel, illetve az alapszval egytt. - -2003-04-10: Nmeth Lszl : - * affixmgr.cxx: - - kthangzk helyes kezelse (hu_kotohangzo kapcsolval), - l. mg Magyar Ispell Changelog - -2003-03-24: Nmeth Lszl - * mispell.cxx: pipe_interface(): az adatfjl szrsnl fellp - memriaszivrgs megszntetse a kimaradt free(token) ptlsval - * affixmgr.cxx: prefix_check(): leg-, legesleg- confixum ellenrzs - - onlyroot kapcsol a csak tszt rint tiltshoz. L. Magyar Ispell - Az affixum llomnyban j kapcsolt adhatunk meg az - ONLYROOT paranccsal bevezetve. A kapcsol mdostja a tiltkapcsol - mkdst. L. man 4 mispell - * myspell.cxx: - - spell(): nagybets tulajdonnevek ellenrzse (pl. BALATON) - - onlyroot vizsglat forbiddenword mellett -> mangrove kezelse - -2003-03-17: Goldman Elenonra - * Windows port - * makefile.Windows: - -2003-03-04: Nmeth Lszl - * firstparser.[ch]xx: adatfjlok szrshez (l. -1 kapcsol) - * mispell.cxx: -L, -1, -G kapcsolk - * man/mispell.1: -L, -1, -G kapcsolk - -2003-03-03: Nmeth Lszl - * mispell.cxx: -l, -p, WORDLIST - * man/mispell.1: -l, -p, WORDLIST - -2003-02-26: Nmeth Lszl - * mispell.cxx: dialog_screen(): - TILTOTT! (FORBIDDEN!) megjelentse a tiltott szsszettelek - esetn. - * suggestmgr.cxx: - - check(): -, - kpzs igeneveket rint kd trlse - - check_forbidden(): a 6 sztagnl hosszabb, tiltott sztvekre - vonatkoz javaslatok nem ktjellel, hanem szkzzel elvlasztva - tartalmazzk a szavakat, ehhez szksges a check_forbidden(). - * man/*: j kziknyv oldal az llomnyok formtumrl (mispell(4)), - a mispell(1) bvtse. - * Makefile, mispell.mo: Br rpd javtsai - -2003-02-18: Nmeth Lszl - * mispell.cxx: interactive_interface() - - nem nyeli el a MAXLNLEN-t meghalad mret sorokban a MAXLNLEN - mret rszek hatrn lv karaktereket, s a nem jsor karakterre - vgzd llomnyok utols karaktert. (Hibt viszont mg mindig - jelez, ha a MAXLNLEN hatr feldarabol egy amgy helyes szt.) - A MAXLNLEN 8192 karakter jelenleg. - - readline fggvnyknyvtr hasznlata a bevitelnl - - tfelvtelnl egy lehetsges t ellltsa, s a beviteli - sorban val feltntetse. Az gy megjelen sz javthat. - - --help kapcsol - * Makefile: Javtsok az install szakaszban. - A hibkat Br rpd jelezte. - -2003-02-07: Nmeth Lszl - * mispell.cxx: put_dots_to_suggestions() - - realloc() cserje malloc()-ra ismeretlen eredet lefagys miatt. - - lehetsges az Ispellhez hasonlan a kapcsolkat kzzel megadni a - sajt sztrban a szavak utn egy perjelet kveten: pldul a - valamicsnyasz/w - sor megadsa utn a valamicsnyasz s toldalkolt vltozatai hibsak - lesznek az ellenrzs alatt. (Tovbbi kapcsolk lersrt lsd a - Magyar Ispell forrsban az aff/aff.fej llomnyt.) - * affixmgr.cxx: compound_check() - - repl_chars() hvsa a megfelel helyre lett tve, ezzel a - javaslattevs sebessge ktszeresre ntt. - - A dinamikus memriakezels lecserelse veremmemrira nem jrt - lnyeges sebessgnvekedssel, de a kzeljvben ezzel elkerlhet - az a memriaszivrgs, ami pldul itt a tiltott szavak kezelsnl - volt az elz vltozatban (javtva). - * affentry.cxx, affixmgr.cxx: szt-elllt kd megalapozsa: - get_possible_root() metdus az utols toldalk-levlaszts - eredmnyvel tr vissza. - -2003-02-05: Nmeth Lszl - * mispell.cxx: put_dots_to_suggestions(): amennyiben - a felismert sz pontra, vagy pontokra vgzdik, a - javaslatokat is bvti ezzel. - - @, valamint 1-nl tbb pontot magba foglal (de nem arra vgzd) - szavak ellenrzsnek tiltsa (e-mail, fjlnevek, mg nem opcionlis). - - Hossz sorok helyes megjelentse. - - Tabultorjelet tartalmaz sorok helyes megjelentse. - - Mozaikszavak tfelvtelnl ktjeles alak automatikus rgztse - Pl.: BKV//URH mellett BKV-//URH- is bekerl a sajt sztrba - (a ragozott mozaikszavak felismerse teht automatikus lesz, kivve a - nem trivilis -val/-vel toldalkos alakok, amit kln kell felvenni.) - - PuT trlse (helyette MySpell::put_word(), put_word_suffix(), - put_word_pattern() eljrsok a sajt sztr bvtsre) - - dupla szavak ellenrzsnek trlse a MySpell kdbl (thelyezs majd a - Mispell felletbe), hogy a MySpell meghvhat maradjon prhuzamosan - fut szlakbl. - -2002-12-30: Nmeth Lszl - * *parser.cxx, *parser.hxx: elemz osztlyok a rgi s csnya kd helyett - -2002-12-10: Nmeth Lszl - * myspell.cxx: 35-os, 20%-kal kezelse - * man/mispell.1: kziknyv - -2002-12-04: Noll Jnos - * spdaemon/: kiszolgl fellet, ld. README.spdaemon - -2002-12-04: Nmeth Lszl - * mispell.cxx: Emacs kompatibilitshoz hibk javtsa (pl. tbbszrs -d) - * mispell.cxx: CURSES makrval kikapcsolhat az interaktv fellet + locale - (Windows, Macintosh) - -2002-11-30: Nmeth Lszl - * affixmgr.cxx: get_checkdoublewords() - -2002-11-25: Nmeth Lszl - * affixmgr.cxx: mozgszably (hu_mov_rule) - * myspell.cxx: mozgszably - * affixmgr.cxx: kitljnekmacskt (affix is sszetettben, ha prefix) - -2002-11-08 Nmeth Lszl - * myspell.cxx: balatonnak->Balatonnak, balatoninak - -2002-11-07 Nmeth Lszl - * myspell: 0.6-os vltozat - -2002-10-31 Nmeth Lszl - * Egyszerbb nv: Magyar MySpell 0.5 utn -> MIspell 0.6 - * mispell.cxx: tbbnyelv interaktv fellet (ncurses, locale) - * Makefile: make install - -2002-09-22 Nmeth Lszl - * affixmgr.cxx: compound_check() macskaugom->macskaugrom, stb. javtsa - * affixmgr.cxx: compound_check() szismtls (pl. macskamacska) tiltsa - * myspell.cxx: szismtlds tiltsa (pl. kutya kutya) msodik rossz - * suggestmgr.cxx: macskarat->macska rat mellett ->macskairat - -2002-07-29 Nmeth Lszl - * mispell Windowsra, teszt Emacs-szel (vagy Emacs-csal) - * tiltott szavakat nem javasol, s sszetett szban sem fogad el - * fonev_morfo, fonev_morfo2 lsztvek elutastsa (hzakmacska) - * ktjeles szavak kezelse - * szmok kezelse, ktjeles alakjaikkal egytt, CHECKNUM kapcsol - -2002-07-17 Nmeth Lszl - * mispell.cxx: MySpell Ispell cs interfsz - -2002-07-04 Nmeth Lszl - * mispell.cxx: MySpell Ispell cs interfsz - * affxmgr.cxx: szszer kiszrse, - * j funkcik: - COMPOUNDFIRST: sz szerepelhet els tagknt a szszettelekben - COMPOUNDLAST: sz szerepelhet utols tagknt a szszettelekben - FORBIDDENWORD: tiltott szavak kapcsolja (ut, uta, stb.) - -2002-06-25 Nmeth Lszl - * myspell.cxx, suggestmgr.cxx: get_compound() char* helyett char - * affxmgr.cxx: check_repl() a helyesnek tn, de hibs sszetett - szavak kiszrsre (pl. tejles, szervz) - A szsszettel elfogadsa eltt mg megnzzk, hogy a sz - nem-e a cseretblzatban felvett hibt tartalmaz, - ha igen, akkor a sz hibsnak minsl, hiba helyes szsszettel. - * affxmgr.cxx, suggestmgr.xx: accent: kezetest. - Lers: README.accent - Tovbbi optimalizci: az kezet nlkli bet kezetes - vltozatai szmnak fggvnyben - -2002-06-05 Noll Jnos - * myspell.cxx, suggestmgr.cxx: mem. szivrgs javtsa - (a get_compound() felszabadts nlkl lett meghva). - A hiba a GNU mtrace segtsgvel lett detektlva. - -2002-06-03 Nmeth Lszl - * Licenc: GPL - * Lsd MYSPELL.HU - * compound_check: 6-3 szably, stb. - -MySpell: - -2002-xx-xx Kevin Hendricks - * REP: ismtlsek kiszrse a javaslatokbl - * COMPOUNDMIN - -2002-xx-xx Nmeth Lszl - * REP cseretblzat - * COMPOUND, szsszettelkpzs - -2002-xx-xx David Einstein - * optimalizlt MySpell algoritmus - -2001-xx-xx Kevin Hendricks - * Mkd ellenrz, Ispell toldalktmrtsi algoritmussal diff --git a/subprojects/hunspell/INSTALL b/subprojects/hunspell/INSTALL deleted file mode 100644 index 54caf7c19..000000000 --- a/subprojects/hunspell/INSTALL +++ /dev/null @@ -1,229 +0,0 @@ -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software -Foundation, Inc. - - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is -disabled by default to prevent problems with accidental use of stale -cache files.) - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the `--target=TYPE' option to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -will cause the specified gcc to be used as the C compiler (unless it is -overridden in the site shell script). - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of the options to `configure', and exit. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/subprojects/hunspell/NEWS b/subprojects/hunspell/NEWS deleted file mode 100644 index b874a047c..000000000 --- a/subprojects/hunspell/NEWS +++ /dev/null @@ -1,650 +0,0 @@ -2014-06-02: Hunspell 1.3.3 release: - - OpenDocument (ODF and Flat ODF) support (ODF needs unzip program) - - various bug fixes - -2011-02-02: Hunspell 1.3.2 release: - - fix library versioning - - improved manual - -2011-02-02: Hunspell 1.3.1 release: - - bug fixes - -2011-01-26: Hunspell 1.2.15/1.3 release: - - new features: MAXDIFF, ONLYMAXDIFF, MAXCPDSUGS, FORBIDWARN, see manual - - bug fixes - -2011-01-21: - - new features: FORCEUCASE and WARN, see manual - - new options: -r to filter potential mistakes (rare words - signed by flag WARN in the dictionary) - - limited and optimized suggestions - -2011-01-06: Hunspell 1.2.14 release: - - bug fix -2011-01-03: Hunspell 1.2.13 release: - - bug fixes - - improved compound handling and - other improvements supported by OpenTaal Foundation, Netherlands -2010-07-15: Hunspell 1.2.12 release -2010-05-06: Hunspell 1.2.11 release: - - Maintenance release bug fixes -2010-04-30: Hunspell 1.2.10 release: - - Maintenance release bug fixes -2010-03-03: Hunspell 1.2.9 release: - - Maintenance release bug fixes and warnings - - MAP support for composed characters or character sequences -2008-11-01: Hunspell 1.2.8 release: - - Default BREAK feature and better hyphenated word suggestion to accept - and fix (compound) words with hyphen characters by spell checker - instead of by work breaking code of OpenOffice.org. With this feature - it's possible to accept hyphenated compound words, such as "scot-free", - where "scot" is not a correct English word. - - - ICONV & OCONV: input and output conversion tables for optional character - handling or using special inner format. Example: - - # Accepting de facto replacements of the Romanian comma acuted letters - SET UTF-8 - ICONV 4 - ICONV ş ș - ICONV ţ ț - ICONV Ş Ș - ICONV Ţ Ț - - Typical usage of ICONV/OCONV is to manage an inner format for a segmental - writing system, like the Ethiopic script of the Amharic language. - - - Extended CHECKCOMPOUNDPATTERN to handle conpound word alternations, like - sandhi feature of Telugu and other writing systems. - - - SIMPLIFIEDTRIPLE compound word feature: allow simplified Swedish and - Norwegian compound word forms, like tillåta (till|låta) and - bussjåfør (buss|sjåfør) - - - wordforms: word generator script for dictionary developers (Hunspell - version of unmunch). - - - bug fixes - -2008-08-15: Hunspell 1.2.7 release: - - FULLSTRIP: new option for affix handling. With FULLSTRIP, affix rules can - strip full words, not only one less characters. - - COMPOUNDRULE works with all flag types. (COMPOUNDRULE is for pattern - matching. For example, en_US dictionary of OpenOffice.org uses COMPOUNDRULE - for ordinal number recognition: 1st, 2nd, 11th, 12th, 22nd, 112th, 1000122nd - etc.). - - optimized suggestions: - - modified 1-character distance suggestion algorithms: search a TRY character - in all position instead of all TRY characters in a character position - (it can give more readable suggestion order, also better suggestions - in the first positions, when TRY characters are sorted by frequency.) - For example, suggestions for "moze": - ooze, doze, Roze, maze, more etc. (Hunspell 1.2.6), - maze, more, mote, ooze, mole etc. (Hunspell 1.2.7). - - extended compound word checking for better COMPOUNDRULE related - suggestions, for example English ordinal numbers: 121323th -> 121323rd - (it needs also a th->rd REP definition). - - bug fixes - -2008-07-15: Hunspell 1.2.6 release: - - bug fix release (fix affix rule condition checking of sk_SK dictionary, - iconv support in stemming and morphological analysis of the Hunspell - utility, see also Changelog) - -2008-07-09: Hunspell 1.2.5 release: - - bug fix release (fix affix rule condition checking of en_GB dictionary, - also morphological analysis by dictionaries with two-level suffixes) - -2008-06-18: Hunspell 1.2.4-2 release: - - fix GCC compiler warnings - -2008-06-17: Hunspell 1.2.4 release: - - add free_list() for C, C++ interfaces to deallocate suggestion lists - - - bug fixes - -2008-06-17: Hunspell 1.2.3 release: - - extended XML interface to use morphological functions by standard - spell checking interface, spell() and suggest(). See hunspell.3 manual page. - - - default dash suggestions for compound words: newword-> new word and new-word - - - new manual pages: hunspell.3, hzip.1, hunzip.1. - - - bug fixes - -2008-04-12: Hunspell 1.2.2 release: - - extended dictionary (dic file) support to use multiple base and - special dictionaries. - - - new and improved options of command line hunspell: - -m: morphological analysis or flag debug mode (without affix - rule data it signs the flag of the affix rules) - -s: stemming mode - -D: list available dictionaries and search path - -d: support extra dictionaries by comma separated list. Example: - - hunspell -d en_US,en_med,de_DE,de_med,de_geo UNESCO.txt - - - forbidding in personal dictionary (with asterisk, / signs affixation) - - - optional compressed dictionary format "hzip" for aff and dic files - usage: - hzip example.aff example.dic - mv example.aff example.dic /tmp - hunspell -d example - hunzip example.aff.hz >example.aff - hunzip example.dic.hz >example.dic - - - new affix compression tool "affixcompress": compression tool for - large (millions of words) dictionaries. - - - support encrypted dictionaries for closed OpenOffice.org extensions or - other commercial programs - - - improved manual - - - bug fixes - -2007-11-01: Hunspell 1.2.1 release: - - new memory efficient condition checking algorithm for affix rules - - - new morphological functions: - - stem() for stemming - - analyze() for morphological analysis - - generate() for morphological generation - - - new demos: - - analyze: stemming, morphological analysis and generation - - chmorph: morphological conversion of texts - -2007-09-05: Hunspell 1.1.12 release: - - dictionary based phonetic suggestion for words with - special or foreign pronounciation or alternative (bad) transliteration - (see Changelog, tests/phone.* and manual). - - - improved data structure and memory optimization for dictionaries - with variable count fields - - - bug fixes for Unicode encoding dictionaries and ngram suggestions - - - improved REP suggestions with space: it works without dictionary - modification - - - updated and new project files for Windows API - -2007-08-27: Hunspell 1.1.11 release: - - portability fixes - -2007-08-23: Hunspell 1.1.10 release: - - pronounciation based suggestion using Bjrn Jacke's original Aspell - phonetic transcription algorithm (http://aspell.net), relicensed under - GPL/LGPL/MPL tri-license with the permission of the author - - - keyboard base suggestion by KEY (see manual) - - - better time limits for suggestion search - - - test environment for suggestion based on Wikipedia data - - - bug fixes for non standard Mozilla platforms etc. - -2007-07-25: Hunspell 1.1.9 release: - - better tokenization: - - for URLs, mail addresses and directory paths (default: skip these tokens) - - for colons in words (for Finnish and Swedish) - - - new examples: - - affixation of personal dictionary words - - digits in words - - - bug fixes (see ChangeLog) - -2007-07-16: Hunspell 1.1.8 release: - - better Mac OS X/Cygwin and Windows compatibility - - - fix Hunspell's Valgrind environment and memory handling errors - detected by Valgrind - - - other bug fixes (see ChangeLog) - -2007-07-06: Hunspell 1.1.7 release: - - fix warning messages of OpenOffice.org build - -2007-06-29: Hunspell 1.1.6 release: - - check capitalization of the following word forms - - words with mixed capitalisation: OpenOffice.org - OPENOFFICE.ORG - - allcap words and suffixes: UNICEF's - UNICEF'S - - prefixes with apostrophe and proper names: Sant'Elia - SANT'ELIA - - - suggestion for missing sentence spacing: something.The -> something. The - - - Hunspell executable: improved locale support - - -i option: custom input encoding - - use locale data for default dictionary names. - - tools/hunspell.cxx: fix 8-bit tokenization (letters without - casing, like ß or Hebrew characters now are handled well) - - dictionary search path (automatic detection of OpenOffice.org directories) - - DICPATH environmental variable - - -D option: show directory path of loaded dictionary - - - patches and bug fixes for Mozilla, OpenOffice.org. - -2007-03-19: Hunspell 1.1.5 release: - - optimizations: 10-100% speed up, smaller code size and memory footprint - (conditional experimental code and warning messages) - - - extended Unicode support: - - non BMP Unicode characters in dictionary words and affixes (except - affix rules and conditions) - - support BOM sequence in aff and dic files - - - IGNORE feature for Arabic diacritics and other optional characters - - - New edit distance suggestion methods: - - capitalisation: nasa -> NASA - - long swap: permenant -> permanent - - long move: Ghandi -> Gandhi, greatful -> grateful - - double two characters: vacacation -> vacation - - spaces in REP sug.: REP alot a_lot (NOTE: "a lot" must be a dictionary word) - - - patches and bug fixes for Mozilla, OpenOffice.org, Emacs, MinGW, Aqua, - German and Arabic language, etc. - -2006-02-01: Hunspell 1.1.4 release: - - Improved suggestion for typical OCR bugs (missing spaces between - capitalized words). For example: "aNew" -> "a New". - http://qa.openoffice.org/issues/show_bug.cgi?id=58202 - - - tokenization fixes (fix incomplete tokenization of input texts on big-endian - platforms, and locale-dependent tokenization of dictionary entries) - -2006-01-06: Hunspell 1.1.3.2 release: - - fix Visual C++ compiling errors - -2006-01-05: Hunspell 1.1.3 release: - - GPL/LGPL/MPL tri-license for Mozilla integration - - - Alias compression of flag sets and morphological descriptions. - (For example, 16 MB Arabic dic file can be compressed to 1 MB.) - - - Improved suggestion. - - - Improved, language independent German sharp s casing with CHECKSHARPS - declaration. - - - Unicode tokenization in Hunspell program. - - - Bug fixes (at new and old compound word handling methods), etc. - -2005-11-11: Hunspell 1.1.2 release: - - - Bug fixes (MAP Unicode, COMPOUND pattern matching, ONLYINCOMPOUND - suggestions) - - - Checked with 51 regression tests in Valgrind debugging environment, - and tested with 52 OOo dictionaries on i686-pc-linux platform. - -2005-11-09: Hunspell 1.1.1 release: - - - Compound word patterns for complex compound word handling and - simple word-level lexical scanning. Ideal for checking - Arabic and Roman numbers, ordinal numbers in English, affixed - numbers in agglutinative languages, etc. - http://qa.openoffice.org/issues/show_bug.cgi?id=53643 - - - Support ISO-8859-15 encoding for French (French oe ligatures are - missing from the latin-1 encoding). - http://qa.openoffice.org/issues/show_bug.cgi?id=54980 - - - Implemented a flag to forbid obscene word suggestion: - http://qa.openoffice.org/issues/show_bug.cgi?id=55498 - - - Checked with 50 regression tests in Valgrind debugging environment, - and tested with 52 OOo dictionaries. - - - other improvements and bug fixes (see ChangeLog) - -2005-09-19: Hunspell 1.1.0 release - -* complete comparison with MySpell 3.2 (from OpenOffice.org 2 beta) - -* improved ngram suggestion with swap character detection and - case insensitivity - ------- examples for ngram improvement (input word and suggestions) ----- - -1. pernament (instead of permanent) - -MySpell 3.2: tournaments, tournament, ornaments, ornament's, ornamenting, ornamented, - ornament, ornamentals, ornamental, ornamentally - -Hunspell 1.0.9: ornamental, ornament, tournament - -Hunspell 1.1.0: permanent - -Note: swap character detection - - -2. PERNAMENT (instead of PERMANENT) - -MySpell 3.2: - - -Hunspell 1.0.9: - - -Hunspell 1.1.0: PERMANENT - - -3. Unesco (instead of UNESCO) - -MySpell 3.2: Genesco, Ionesco, Genesco's, Ionesco's, Frescoing, Fresco's, - Frescoed, Fresco, Escorts, Escorting - -Hunspell 1.0.9: Genesco, Ionesco, Fresco - -Hunspell 1.1.0: UNESCO - - -4. siggraph's (instead of SIGGRAPH's) - -MySpell 3.2: serigraph's, photograph's, serigraphs, physiography's, - physiography, digraphs, serigraph, stratigraphy's, stratigraphy - epigraphs - -Hunspell 1.0.9: serigraph's, epigraph's, digraph's - -Hunspell 1.1.0: SIGGRAPH's - ---------------- end of examples -------------------- - -* improved testing environment with suggestion checking and memory debugging - - memory debugging of all tests with a simple command: - - VALGRIND=memcheck make check - -* lots of other improvements and bug fixes (see ChangeLog) - - -2005-08-26: Hunspell 1.0.9 release - -* improved related character map suggestion - -* improved ngram suggestion - ------- examples for ngram improvement (O=old, N = new ngram suggestions) -- - -1. Permenant (instead of Permanent) - -O: Endangerment, Ferment, Fermented, Deferment's, Empowerment, - Ferment's, Ferments, Fermenting, Countermen, Weathermen - -N: Permanent, Supermen, Preferment - -Note: Ngram suggestions was case sensitive. - -2. permenant (instead of permanent) - -O: supermen, newspapermen, empowerment, endangerment, preferments, - preferment, permanent, preferment's, permanently, impermanent - -N: permanent, supermen, preferment - -Note: new suggestions are also weighted with longest common subsequence, -first letter and common character positions - -3. pernemant (instead of permanent) - -O: pimpernel's, pimpernel, pimpernels, permanently, permanents, permanent, - supernatant, impermanent, semipermanent, impermanently - -N: permanent, supernatant, pimpernel - -Note: new method also prefers root word instead of not -relevant affixes ('s, s and ly) - - -4. pernament (instead of permanent) - -O: tournaments, tournament, ornaments, ornament's, ornamenting, ornamented, - ornament, ornamentals, ornamental, ornamentally - -N: ornamental, ornament, tournament - -Note: Both ngram methods misses here. - - -5. obvus (instad of obvious): - -O: obvious, Corvus, obverse, obviously, Jacobus, obtuser, obtuse, - obviates, obviate, Travus - -N: obvious, obtuse, obverse - -Note: new method also prefers common first letters. - - -6. unambigus (instead of unambiguous) - -O: unambiguous, unambiguity, unambiguously, ambiguously, ambiguous, - unambitious, ambiguities, ambiguousness - -N: unambiguous, unambiguity, unambitious - - - -7. consecvence (instead of consequence) - -O: consecutive, consecutively, consecutiveness, nonconsecutive, consequence, - consecutiveness's, convenience's, consistences, consistence - -N: consequence, consecutive, consecrates - - -An example in a language with rich morphology: - -8. Misisipiben (instead of Mississippiben [`in Mississippi' in Hungarian]): - -O: Misikdiben, Pisisediben, Misikiiben, Pisisekiben, Misikiben, - Misikidiben, Misikkiben, Misikikiben, Misikimiben, Mississippiiben - -N: Mississippiben, Mississippiiben, Misiiben - -Note: Suggesting not relevant affixes was the biggest fault in ngram - suggestion for languages with a lot of affixes. - ---------------- end of examples -------------------- - -* support twofold prefix cutting - -* lots of other improvements and bug fixes (see ChangeLog) - -* test Hunspell with 54 OpenOffice.org dictionaries: - -source: ftp://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries - -testing shell script: -------------------------------------------------------- -for i in `ls *zip | grep '^[a-z]*_[A-Z]*[.]'` -do - dic=`basename $i .zip` - mkdir $dic - echo unzip $dic - unzip -d $dic $i 2>/dev/null - cd $dic - echo unmunch and test $dic - unmunch $dic.dic $dic.aff 2>/dev/null | awk '{print$0"\t"}' | - hunspell -d $dic -l -1 >$dic.result 2>$dic.err || rm -f $dic.result - cd .. -done --------------------------------------------------------- - -test result (0 size is o.k.): - -$ for i in *_*/*.result; do wc -c $i; done -0 af_ZA/af_ZA.result -0 bg_BG/bg_BG.result -0 ca_ES/ca_ES.result -0 cy_GB/cy_GB.result -0 cs_CZ/cs_CZ.result -0 da_DK/da_DK.result -0 de_AT/de_AT.result -0 de_CH/de_CH.result -0 de_DE/de_DE.result -0 el_GR/el_GR.result -6 en_AU/en_AU.result -0 en_CA/en_CA.result -0 en_GB/en_GB.result -0 en_NZ/en_NZ.result -0 en_US/en_US.result -0 eo_EO/eo_EO.result -0 es_ES/es_ES.result -0 es_MX/es_MX.result -0 es_NEW/es_NEW.result -0 fo_FO/fo_FO.result -0 fr_FR/fr_FR.result -0 ga_IE/ga_IE.result -0 gd_GB/gd_GB.result -0 gl_ES/gl_ES.result -0 he_IL/he_IL.result -0 hr_HR/hr_HR.result -200694989 hu_HU/hu_HU.result -0 id_ID/id_ID.result -0 it_IT/it_IT.result -0 ku_TR/ku_TR.result -0 lt_LT/lt_LT.result -0 lv_LV/lv_LV.result -0 mg_MG/mg_MG.result -0 mi_NZ/mi_NZ.result -0 ms_MY/ms_MY.result -0 nb_NO/nb_NO.result -0 nl_NL/nl_NL.result -0 nn_NO/nn_NO.result -0 ny_MW/ny_MW.result -0 pl_PL/pl_PL.result -0 pt_BR/pt_BR.result -0 pt_PT/pt_PT.result -0 ro_RO/ro_RO.result -0 ru_RU/ru_RU.result -0 rw_RW/rw_RW.result -0 sk_SK/sk_SK.result -0 sl_SI/sl_SI.result -0 sv_SE/sv_SE.result -0 sw_KE/sw_KE.result -0 tet_ID/tet_ID.result -0 tl_PH/tl_PH.result -0 tn_ZA/tn_ZA.result -0 uk_UA/uk_UA.result -0 zu_ZA/zu_ZA.result - -In en_AU dictionary, there is an abbrevation with two dots (`eqn..'), but -`eqn.' is missing. Presumably it is a dictionary bug. Myspell also -haven't accepted it. - -Hungarian dictionary contains pseudoroots and forbidden words. -Unmunch haven't supported these features yet, and generates bad words, too. - -* check affix rules and OOo dictionaries. Detected bugs in cs_CZ, -es_ES, es_NEW, es_MX, lt_LT, nn_NO, pt_PT, ro_RO, sk_SK and sv_SE dictionaries). - -Details: --------------------------------------------------------- -cs_CZ -warning - incompatible stripping characters and condition: -SFX D us ech [^ighk]os -SFX D us y [^i]os -SFX Q os ech [^ghk]es -SFX M o ech [^ghkei]a -SFX J m ej m -SFX J m ejme m -SFX J m ejte m -SFX A ouit up oupit -SFX A ouit upme oupit -SFX A ouit upte oupit -SFX A nout l [aeiouyr][^aeiouyrl][^aeiouy -SFX A nout l [aeiouyr][^aeiouyrl][^aeiouy - -es_ES -warning - incompatible stripping characters and condition: -SFX W umar se [ae]husar -SFX W emir iis eir - -es_NEW -warning - incompatible stripping characters and condition: -SFX I unan nen unar - -es_MX -warning - incompatible stripping characters and condition: -SFX A a ote e -SFX W umar se [ae]husar -SFX W emir iis eir - -lt_LT -warning - incompatible stripping characters and condition: -SFX U ti siuosi tis -SFX U ti siuosi tis -SFX U ti siesi tis -SFX U ti siesi tis -SFX U ti sis tis -SFX U ti sis tis -SFX U ti sims tis -SFX U ti sims tis -SFX U ti sits tis -SFX U ti sits tis - -nn_NO -warning - incompatible stripping characters and condition: -SFX D ar rar [^fmk]er -SFX U re orde ere -SFX U re ort ere - -pt_PT -warning - incompatible stripping characters and condition: -SFX g os oas o -SFX g os oas o - -ro_RO -warning - bad field number: -SFX L 0 le [^cg] i -SFX L 0 i [cg] i -SFX U 0 i [^i] ii -warning - incompatible stripping characters and condition: -SFX P l i l [<- there is an unnecessary tabulator here) -SFX I a ii [gc] a -warning - bad field number: -SFX I a ii [gc] a -SFX I a ei [^cg] a - -sk_SK -warning - incompatible stripping characters and condition: -SFX T a ol kla -SFX T a olc kla -SFX T sa l sla -SFX T sa lc sla -SFX R c liem c -SFX R is tie mias -SFX R iez iem [^i]ez -SFX R iez ie [^i]ez -SFX R iez ie [^i]ez -SFX R iez eme [^i]ez -SFX R iez ete [^i]ez -SFX R iez [^i]ez -SFX R iez c [^i]ez -SFX R iez z [^i]ez -SFX R iez me [^i]ez -SFX R iez te [^i]ez - -sv_SE -warning - bad field number: -SFX C 0 net nets [^e]n --------------------------------------------------------- - -2005-08-01: Hunspell 1.0.8 release - -- improved compound word support -- fix German S handling -- port MySpell files and MAP feature - -2005-07-22: Hunspell 1.0.7 release - -2005-07-21: new home page: http://hunspell.sourceforge.net diff --git a/subprojects/hunspell/README b/subprojects/hunspell/README deleted file mode 100644 index 8289413f3..000000000 --- a/subprojects/hunspell/README +++ /dev/null @@ -1,182 +0,0 @@ -About Hunspell --------------- - -Hunspell is a spell checker and morphological analyzer library and program -designed for languages with rich morphology and complex word compounding or -character encoding. Hunspell interfaces: Ispell-like terminal interface -using Curses library, Ispell pipe interface, OpenOffice.org UNO module. - -Hunspell's code base comes from the OpenOffice.org MySpell -(http://lingucomponent.openoffice.org/MySpell-3.zip). See README.MYSPELL, -AUTHORS.MYSPELL and license.myspell files. -Hunspell is designed to eventually replace Myspell in OpenOffice.org. - -Main features of Hunspell spell checker and morphological analyzer: - -- Unicode support (affix rules work only with the first 65535 Unicode characters) - -- Morphological analysis (in custom item and arrangement style) and stemming - -- Max. 65535 affix classes and twofold affix stripping (for agglutinative - languages, like Azeri, Basque, Estonian, Finnish, Hungarian, Turkish, etc.) - -- Support complex compoundings (for example, Hungarian and German) - -- Support language specific features (for example, special casing of - Azeri and Turkish dotted i, or German sharp s) - -- Handle conditional affixes, circumfixes, fogemorphemes, - forbidden words, pseudoroots and homonyms. - -- Free software (LGPL, GPL, MPL tri-license) - -Compiling on Unix/Linux ------------------------ - -./configure -make -make install - -For dictionary development, use the --with-warnings option of configure. - -For interactive user interface of Hunspell executable, use the --with-ui option. - -The developer packages you need to compile Hunspell's interface: - -glibc-devel - -optional developer packages: - -ncurses (need for --with-ui), eg. libncursesw5 for UTF-8 -readline (for fancy input line editing, - configure parameter: --with-readline) -locale and gettext (but you can also use the - --with-included-gettext configure parameter) - -Hunspell distribution uses new Autoconf (2.59) and Automake (1.9). - -Compiling on Windows --------------------- - -1. Compiling with Windows SDK - -Download the free Windows SDK of Microsoft, open a command prompt -window and cd into hunspell/src/win_api. Use the following command -to compile hunspell: - -vcbuild - -2. Compiling in Cygwin environment - -Download and install Cygwin environment for Windows with the following -extra packages: - -make -gcc-g++ development package -mingw development package (for cygwin.dll free native Windows compilation) -ncurses, readline (for user interface) -iconv (character conversion) - -2.1. Cygwin1.dll dependent compiling - -Open a Cygwin shell, cd into the hunspell root directory: - -./configure -make -make install - -For dictionary development, use the --with-warnings option of configure. - -For interactive user interface of Hunspell executable, use the --with-ui option. - -readline configure parameter: --with-readline (for fancy input line editing) - -1.2. Cygwin1.dll free compiling - -Open a Cygwin shell, cd into the hunspell/src/win_api and - -make -f Makefile.cygwin - -Testing -------- - -Testing Hunspell (see tests in tests/ subdirectory): - -make check - -or with Valgrind debugger: - -make check -VALGRIND=[Valgrind_tool] make check - -For example: - -make check -VALGRIND=memcheck make check - -Documentation -------------- - -features and dictionary format: -man 5 hunspell - -man hunspell -hunspell -h -http://hunspell.sourceforge.net - -Usage ------ - -The src/tools dictionary contains ten executables after compiling -(or some of them are in the src/win_api): - -affixcompress: dictionary generation from large (millions of words) vocabularies - analyze: example of spell checking, stemming and morphological analysis - chmorph: example of automatic morphological generation and conversion - example: example of spell checking and suggestion - hunspell: main program for spell checking and others (see manual) - hunzip: decompressor of hzip format - hzip: compressor of hzip format -makealias: alias compression (Hunspell only, not back compatible with MySpell) - munch: dictionary generation from vocabularies (it needs an affix file, too). - unmunch: list all recognized words of a MySpell dictionary -wordforms: word generation (Hunspell version of unmunch) - -After compiling and installing (see INSTALL) you can -run the Hunspell spell checker (compiled with user interface) -with a Hunspell or Myspell dictionary: - -hunspell -d en_US text.txt - -or without interface: - -hunspell -hunspell -d en_UK -l - -Linking with Hunspell static library: -g++ -lhunspell example.cxx - -Dictionaries ------------- - -Myspell & Hunspell dictionaries: -http://extensions.libreoffice.org -http://cgit.freedesktop.org/libreoffice/dictionaries -http://extensions.openoffice.org -http://wiki.services.openoffice.org/wiki/Dictionaries - -Aspell dictionaries (need some conversion): -ftp://ftp.gnu.org/gnu/aspell/dict -Conversion steps: see relevant feature request at http://hunspell.sf.net. - -László Németh -nemeth at numbertext org diff --git a/subprojects/hunspell/README.myspell b/subprojects/hunspell/README.myspell deleted file mode 100644 index 25934eec0..000000000 --- a/subprojects/hunspell/README.myspell +++ /dev/null @@ -1,69 +0,0 @@ -MySpell is a simple spell checker that uses affix -compression and is modelled after the spell checker -ispell. - -MySpell was written to explore how affix compression -can be implemented. - -The Main features of MySpell are: - -1. written in C++ to make it easier to interface with - Pspell, OpenOffice, AbiWord, etc - -2. it is stateless, uses no static variables and - should be completely reentrant with almost no - ifdefs - -3. it tries to be as compatible with ispell to - the extent it can. It can read slightly modified - versions of munched ispell dictionaries (and it - comes with a munched english wordlist borrowed from - Kevin Atkinson's excellent Aspell. - -4. it uses a heavily modified aff file format that - can be derived from ispell aff files but uses - the iso-8859-X character sets only - -5. it is simple with *lots* of comments that - describes how the affixes are stored - and tested for (based on the approach used by - ispell). - -6. it supports improved suggestions with replacement - tables and ngram-scoring based mechanisms in addition - to the main suggestion mechanisms - -7. like ispell it has a BSD license (and no - advertising clause) - -But ... it has *no* support for adding words -to a personal dictionary, *no* support for converting -between various text encodings, and *no* command line -interface (it is purely meant to be a library). - -It can not (in any way) replace all of the functionality -of ispell or aspell/pspell. It is meant as a learning -tool for understanding affix compression and for -being used by front ends like OpenOffice, Abiword, etc. - -MySpell has been tested under Linux and Solaris -and has the world's simplest Makefile and no -configure support. - -It does come with a simple example program that -spell checks some words and returns suggestions. - -To build a static library and an example -program under Linux simply type: - -tar -zxvf myspell.tar.gz -cd myspell2 -make - -To run the example program: -./example ./en_US.aff ./en_US.dic checkme.lst - -Please play around with it and let me know -what you think. - -Please see the file CONTRIBUTORS for more info. diff --git a/subprojects/hunspell/THANKS b/subprojects/hunspell/THANKS deleted file mode 100644 index 761fa7743..000000000 --- a/subprojects/hunspell/THANKS +++ /dev/null @@ -1,136 +0,0 @@ -Many thanks to the following contributors and supporters: - -Mehmet Akin -Göran Andersson -Lars Aronsson -Ruud Baars -Bartkó Zoltán -Mathias Bauer -Bencsáth Boldizsár -Bíró Árpád -Ingo H. de Boer -Simon Brouwer -Jeppe Bundsgaard -Ginn Chen -Tomáš Chvátal -Aaron Digulla -Dmitri Gabinski -Dvornik László -David Einstein -Rene Engelhard -Frederik Fouvry -Flemming Frandsen -Serge Gautherie -Marek Gleń -Gavins at OOo -Gefferth András -Godó Ferenc -Goldman Eleonóra -Steinar H. Gunderson -Halácsy Péter -Chris Halls -Khaled Hosny -Izsók András -Björn Jacke -Mike Tian-Jian Jiang -Dafydd Jones -Ryan Jones -Jean-Christophe Helary -Kevin Hendricks -Martin Hollmichel -Pavel Janík -John Winters -Mohamed Kebdani -Kelemen Gábor -Shewangizaw Gulilat -Kéménczy Kálmán -Dan Kenigsberg -Pham Ngoc Khanh -Khiraly László -Koblinger Egmont -Kornai András -Tor Lillqvist -Christian Lohmaier -Robert Longson -Marot at SF dot net -Mark McClain -Caolan McNamara -Michael Meeks -Moheb Mekhaiel -Laurie Mercer -Ladislav Michnovič -Ellis Miller -Giuseppe Modugno -János Mohácsi -Bram Moolenaar -Daniel Naber -Nagy Viktor -John Nisly -Noll János -S Page -Christophe Paris -Malcolm Parsons -Sylvain Paschein -Volkov Peter -Bryan Petty -Harri Pitkänen -Davide Prina -Kevin F. Quinn -Erdal Ronahi -Olivier Ronez -Bernhard Rosenkraenzer -Sarlós Tamás -Thobias Schlemmer -Jan Seeger -Jose da Silva -Paulo Ney de Souza -Roland Smith -Munzir Taha -Timeless at bemail dot org -Tímár András -Tonal at OOo -Török László -Trón Viktor -Gianluca Turconi -Ryan VanderMeulen -Varga Dániel -Elio Voci -Miha Vrhovnik -Martijn Wargers -Michel Weimerskirch -Brett Wilson -Friedel Wolff -Daniel Yacob -Gábor Zahemszky -Taha Zerrouki -and others (see also AUTHORS.myspell) - -FSF.hu Foundation -http://www.fsf.hu - -LibreOffice community -http://www.libreoffice.org - -MOKK Research Centre -Budapest University of Technology and Economics -Sociology and Communications Department -http://www.mokk.bme.hu - -Hungarian Ministry of Informatics and Telecommunications - -IMEDIA Kft. -http://www.imedia.hu - -OpenOffice.org community -http://www.openoffice.org - -OpenTaal Foundation, Netherlands and -Dutch Language Union (Nederlandse Taalunie) -http://opentaal.org - -UHU-Linux Kft. - -Thanks, - -Németh László -nemeth at numbertext org diff --git a/subprojects/hunspell/TODO b/subprojects/hunspell/TODO deleted file mode 100644 index fb32e7ec8..000000000 --- a/subprojects/hunspell/TODO +++ /dev/null @@ -1,4 +0,0 @@ -* shared dictionaries for multi-user environment -* improve compound handling -* Unicode unmunch (munch) -* forbiddenword and pseudoword support in unmunch diff --git a/subprojects/hunspell/license.hunspell b/subprojects/hunspell/license.hunspell deleted file mode 100644 index 8f998bdc3..000000000 --- a/subprojects/hunspell/license.hunspell +++ /dev/null @@ -1,55 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Hunspell, based on MySpell. - * - * The Initial Developers of the Original Code are - * Kevin Hendricks (MySpell) and Németh László (Hunspell). - * Portions created by the Initial Developers are Copyright (C) 2002-2005 - * the Initial Developers. All Rights Reserved. - * - * Contributor(s): - * David Einstein - * Davide Prina - * Giuseppe Modugno - * Gianluca Turconi - * Simon Brouwer - * Noll János - * Bíró Árpád - * Goldman Eleonóra - * Sarlós Tamás - * Bencsáth Boldizsár - * Halácsy Péter - * Dvornik László - * Gefferth András - * Nagy Viktor - * Varga Dániel - * Chris Halls - * Rene Engelhard - * Bram Moolenaar - * Dafydd Jones - * Harri Pitkänen - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ diff --git a/subprojects/hunspell/license.myspell b/subprojects/hunspell/license.myspell deleted file mode 100644 index 2da533075..000000000 --- a/subprojects/hunspell/license.myspell +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2002 Kevin B. Hendricks, Stratford, Ontario, Canada - * And Contributors. 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. All modifications to the source code must be clearly marked as - * such. Binary redistributions based on modified source code - * must be clearly marked as modified versions in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY KEVIN B. HENDRICKS 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 - * KEVIN B. HENDRICKS 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. - * - * - * NOTE: A special thanks and credit goes to Geoff Kuenning - * the creator of ispell. MySpell's affix algorithms were - * based on those of ispell which should be noted is - * copyright Geoff Kuenning et.al. and now available - * under a BSD style license. For more information on ispell - * and affix compression in general, please see: - * http://www.cs.ucla.edu/ficus-members/geoff/ispell.html - * (the home page for ispell) - * - * An almost complete rewrite of MySpell for use by - * the Mozilla project has been developed by David Einstein - * (Deinst@world.std.com). David and I are now - * working on parallel development tracks to help - * our respective projects (Mozilla and OpenOffice.org - * and we will maintain full affix file and dictionary - * file compatibility and work on merging our versions - * of MySpell back into a single tree. David has been - * a significant help in improving MySpell. - * - * Special thanks also go to La'szlo' Ne'meth - * who is the author of the - * Hungarian dictionary and who developed and contributed - * the code to support compound words in MySpell - * and fixed numerous problems with the encoding - * case conversion tables. - * - */ diff --git a/subprojects/hunspell/src/hunspell/README b/subprojects/hunspell/src/hunspell/README deleted file mode 100644 index b45209628..000000000 --- a/subprojects/hunspell/src/hunspell/README +++ /dev/null @@ -1,21 +0,0 @@ -Hunspell spell checker and morphological analyser library - -Documentation, tests, examples: http://hunspell.sourceforge.net - -Author of Hunspell: -László Németh (nemethl (at) gyorsposta.hu) - -Hunspell based on OpenOffice.org's Myspell. MySpell's author: -Kevin Hendricks (kevin.hendricks (at) sympatico.ca) - -License: GPL 2.0/LGPL 2.1/MPL 1.1 tri-license - -The contents of this library may be used under the terms of -the GNU General Public License Version 2 or later (the "GPL"), or -the GNU Lesser General Public License Version 2.1 or later (the "LGPL", -see http://gnu.org/copyleft/lesser.html) or the Mozilla Public License -Version 1.1 or later (the "MPL", see http://mozilla.org/MPL/MPL-1.1.html). - -Software distributed under these licenses is distributed on an "AS IS" basis, -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the licences -for the specific language governing rights and limitations under the licenses. diff --git a/subprojects/hunspell/src/hunspell/affentry.cxx b/subprojects/hunspell/src/hunspell/affentry.cxx deleted file mode 100644 index 45c9ef58e..000000000 --- a/subprojects/hunspell/src/hunspell/affentry.cxx +++ /dev/null @@ -1,1003 +0,0 @@ -#include "license.hunspell" -#include "license.myspell" - -#include -#include -#include -#include - -#include "affentry.hxx" -#include "csutil.hxx" - -#define MAXTEMPWORDLEN (MAXWORDUTF8LEN + 4) - -PfxEntry::PfxEntry(AffixMgr* pmgr, affentry* dp) - // register affix manager - : pmyMgr(pmgr) - , next(NULL) - , nexteq(NULL) - , nextne(NULL) - , flgnxt(NULL) -{ - // set up its initial values - aflag = dp->aflag; // flag - strip = dp->strip; // string to strip - appnd = dp->appnd; // string to append - stripl = dp->stripl; // length of strip string - appndl = dp->appndl; // length of append string - numconds = dp->numconds; // length of the condition - opts = dp->opts; // cross product flag - // then copy over all of the conditions - if (opts & aeLONGCOND) { - memcpy(c.conds, dp->c.l.conds1, MAXCONDLEN_1); - c.l.conds2 = dp->c.l.conds2; - } else memcpy(c.conds, dp->c.conds, MAXCONDLEN); - morphcode = dp->morphcode; - contclass = dp->contclass; - contclasslen = dp->contclasslen; -} - - -PfxEntry::~PfxEntry() -{ - aflag = 0; - if (appnd) free(appnd); - if (strip) free(strip); - pmyMgr = NULL; - appnd = NULL; - strip = NULL; - if (opts & aeLONGCOND) free(c.l.conds2); - if (morphcode && !(opts & aeALIASM)) free(morphcode); - if (contclass && !(opts & aeALIASF)) free(contclass); -} - -// add prefix to this word assuming conditions hold -char * PfxEntry::add(const char * word, int len) -{ - char tword[MAXTEMPWORDLEN]; - - if ((len > stripl || (len == 0 && pmyMgr->get_fullstrip())) && - (len >= numconds) && test_condition(word) && - (!stripl || (strncmp(word, strip, stripl) == 0)) && - ((MAXTEMPWORDLEN) > (len + appndl - stripl))) { - /* we have a match so add prefix */ - char * pp = tword; - if (appndl) { - strncpy(tword, appnd, MAXTEMPWORDLEN-1); - tword[MAXTEMPWORDLEN-1] = '\0'; - pp += appndl; - } - strcpy(pp, (word + stripl)); - return mystrdup(tword); - } - return NULL; -} - -inline char * PfxEntry::nextchar(char * p) { - if (p) { - p++; - if (opts & aeLONGCOND) { - // jump to the 2nd part of the condition - if (p == c.conds + MAXCONDLEN_1) return c.l.conds2; - // end of the MAXCONDLEN length condition - } else if (p == c.conds + MAXCONDLEN) return NULL; - return *p ? p : NULL; - } - return NULL; -} - -inline int PfxEntry::test_condition(const char * st) -{ - const char * pos = NULL; // group with pos input position - bool neg = false; // complementer - bool ingroup = false; // character in the group - if (numconds == 0) return 1; - char * p = c.conds; - while (1) { - switch (*p) { - case '\0': return 1; - case '[': { - neg = false; - ingroup = false; - p = nextchar(p); - pos = st; break; - } - case '^': { p = nextchar(p); neg = true; break; } - case ']': { - if ((neg && ingroup) || (!neg && !ingroup)) return 0; - pos = NULL; - p = nextchar(p); - // skip the next character - if (!ingroup && *st) for (st++; (opts & aeUTF8) && (*st & 0xc0) == 0x80; st++); - if (*st == '\0' && p) return 0; // word <= condition - break; - } - case '.': - if (!pos) { // dots are not metacharacters in groups: [.] - p = nextchar(p); - // skip the next character - for (st++; (opts & aeUTF8) && (*st & 0xc0) == 0x80; st++); - if (*st == '\0' && p) return 0; // word <= condition - break; - } - /* FALLTHROUGH */ - default: { - if (*st == *p) { - st++; - p = nextchar(p); - if ((opts & aeUTF8) && (*(st - 1) & 0x80)) { // multibyte - while (p && (*p & 0xc0) == 0x80) { // character - if (*p != *st) { - if (!pos) return 0; - st = pos; - break; - } - p = nextchar(p); - st++; - } - if (pos && st != pos) { - ingroup = true; - while (p && *p != ']' && ((p = nextchar(p)) != NULL)); - } - } else if (pos) { - ingroup = true; - while (p && *p != ']' && ((p = nextchar(p)) != NULL)); - } - } else if (pos) { // group - p = nextchar(p); - } else return 0; - } - } - if (!p) return 1; - } -} - -// check if this prefix entry matches -struct hentry * PfxEntry::checkword(const char * word, int len, char in_compound, const FLAG needflag) -{ - int tmpl; // length of tmpword - struct hentry * he; // hash entry of root word or NULL - char tmpword[MAXTEMPWORDLEN]; - - // on entry prefix is 0 length or already matches the beginning of the word. - // So if the remaining root word has positive length - // and if there are enough chars in root word and added back strip chars - // to meet the number of characters conditions, then test it - - tmpl = len - appndl; - - if (tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) { - - // generate new root word by removing prefix and adding - // back any characters that would have been stripped - - if (stripl) { - strncpy(tmpword, strip, MAXTEMPWORDLEN-1); - tmpword[MAXTEMPWORDLEN-1] = '\0'; - } - strcpy ((tmpword + stripl), (word + appndl)); - - // now make sure all of the conditions on characters - // are met. Please see the appendix at the end of - // this file for more info on exactly what is being - // tested - - // if all conditions are met then check if resulting - // root word in the dictionary - - if (test_condition(tmpword)) { - tmpl += stripl; - if ((he = pmyMgr->lookup(tmpword)) != NULL) { - do { - if (TESTAFF(he->astr, aflag, he->alen) && - // forbid single prefixes with needaffix flag - ! TESTAFF(contclass, pmyMgr->get_needaffix(), contclasslen) && - // needflag - ((!needflag) || TESTAFF(he->astr, needflag, he->alen) || - (contclass && TESTAFF(contclass, needflag, contclasslen)))) - return he; - he = he->next_homonym; // check homonyms - } while (he); - } - - // prefix matched but no root word was found - // if aeXPRODUCT is allowed, try again but now - // ross checked combined with a suffix - - //if ((opts & aeXPRODUCT) && in_compound) { - if ((opts & aeXPRODUCT)) { - he = pmyMgr->suffix_check(tmpword, tmpl, aeXPRODUCT, this, NULL, - 0, NULL, FLAG_NULL, needflag, in_compound); - if (he) return he; - } - } - } - return NULL; -} - -// check if this prefix entry matches -struct hentry * PfxEntry::check_twosfx(const char * word, int len, - char in_compound, const FLAG needflag) -{ - int tmpl; // length of tmpword - struct hentry * he; // hash entry of root word or NULL - char tmpword[MAXTEMPWORDLEN]; - - // on entry prefix is 0 length or already matches the beginning of the word. - // So if the remaining root word has positive length - // and if there are enough chars in root word and added back strip chars - // to meet the number of characters conditions, then test it - - tmpl = len - appndl; - - if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && - (tmpl + stripl >= numconds)) { - - // generate new root word by removing prefix and adding - // back any characters that would have been stripped - - if (stripl) { - strncpy(tmpword, strip, MAXTEMPWORDLEN-1); - tmpword[MAXTEMPWORDLEN-1] = '\0'; - } - strcpy ((tmpword + stripl), (word + appndl)); - - // now make sure all of the conditions on characters - // are met. Please see the appendix at the end of - // this file for more info on exactly what is being - // tested - - // if all conditions are met then check if resulting - // root word in the dictionary - - if (test_condition(tmpword)) { - tmpl += stripl; - - // prefix matched but no root word was found - // if aeXPRODUCT is allowed, try again but now - // cross checked combined with a suffix - - if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) { - he = pmyMgr->suffix_check_twosfx(tmpword, tmpl, aeXPRODUCT, this, needflag); - if (he) return he; - } - } - } - return NULL; -} - -// check if this prefix entry matches -char * PfxEntry::check_twosfx_morph(const char * word, int len, - char in_compound, const FLAG needflag) -{ - int tmpl; // length of tmpword - char tmpword[MAXTEMPWORDLEN]; - - // on entry prefix is 0 length or already matches the beginning of the word. - // So if the remaining root word has positive length - // and if there are enough chars in root word and added back strip chars - // to meet the number of characters conditions, then test it - - tmpl = len - appndl; - - if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && - (tmpl + stripl >= numconds)) { - - // generate new root word by removing prefix and adding - // back any characters that would have been stripped - - if (stripl) { - strncpy(tmpword, strip, MAXTEMPWORDLEN-1); - tmpword[MAXTEMPWORDLEN-1] = '\0'; - } - strcpy ((tmpword + stripl), (word + appndl)); - - // now make sure all of the conditions on characters - // are met. Please see the appendix at the end of - // this file for more info on exactly what is being - // tested - - // if all conditions are met then check if resulting - // root word in the dictionary - - if (test_condition(tmpword)) { - tmpl += stripl; - - // prefix matched but no root word was found - // if aeXPRODUCT is allowed, try again but now - // ross checked combined with a suffix - - if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) { - return pmyMgr->suffix_check_twosfx_morph(tmpword, tmpl, - aeXPRODUCT, this, needflag); - } - } - } - return NULL; -} - -// check if this prefix entry matches -char * PfxEntry::check_morph(const char * word, int len, char in_compound, const FLAG needflag) -{ - int tmpl; // length of tmpword - struct hentry * he; // hash entry of root word or NULL - char tmpword[MAXTEMPWORDLEN]; - char result[MAXLNLEN]; - char * st; - - *result = '\0'; - - // on entry prefix is 0 length or already matches the beginning of the word. - // So if the remaining root word has positive length - // and if there are enough chars in root word and added back strip chars - // to meet the number of characters conditions, then test it - - tmpl = len - appndl; - - if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && - (tmpl + stripl >= numconds)) { - - // generate new root word by removing prefix and adding - // back any characters that would have been stripped - - if (stripl) { - strncpy(tmpword, strip, MAXTEMPWORDLEN-1); - tmpword[MAXTEMPWORDLEN-1] = '\0'; - } - strcpy ((tmpword + stripl), (word + appndl)); - - // now make sure all of the conditions on characters - // are met. Please see the appendix at the end of - // this file for more info on exactly what is being - // tested - - // if all conditions are met then check if resulting - // root word in the dictionary - - if (test_condition(tmpword)) { - tmpl += stripl; - if ((he = pmyMgr->lookup(tmpword)) != NULL) { - do { - if (TESTAFF(he->astr, aflag, he->alen) && - // forbid single prefixes with needaffix flag - ! TESTAFF(contclass, pmyMgr->get_needaffix(), contclasslen) && - // needflag - ((!needflag) || TESTAFF(he->astr, needflag, he->alen) || - (contclass && TESTAFF(contclass, needflag, contclasslen)))) { - if (morphcode) { - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, morphcode, MAXLNLEN); - } else mystrcat(result,getKey(), MAXLNLEN); - if (!HENTRY_FIND(he, MORPH_STEM)) { - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, MORPH_STEM, MAXLNLEN); - mystrcat(result, HENTRY_WORD(he), MAXLNLEN); - } - // store the pointer of the hash entry - if (HENTRY_DATA(he)) { - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, HENTRY_DATA2(he), MAXLNLEN); - } else { - // return with debug information - char * flag = pmyMgr->encode_flag(getFlag()); - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, MORPH_FLAG, MAXLNLEN); - mystrcat(result, flag, MAXLNLEN); - free(flag); - } - mystrcat(result, "\n", MAXLNLEN); - } - he = he->next_homonym; - } while (he); - } - - // prefix matched but no root word was found - // if aeXPRODUCT is allowed, try again but now - // ross checked combined with a suffix - - if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) { - st = pmyMgr->suffix_check_morph(tmpword, tmpl, aeXPRODUCT, this, - FLAG_NULL, needflag); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - } - } - } - - if (*result) return mystrdup(result); - return NULL; -} - -SfxEntry::SfxEntry(AffixMgr * pmgr, affentry* dp) - : pmyMgr(pmgr) // register affix manager - , next(NULL) - , nexteq(NULL) - , nextne(NULL) - , flgnxt(NULL) - , l_morph(NULL) - , r_morph(NULL) - , eq_morph(NULL) -{ - // set up its initial values - aflag = dp->aflag; // char flag - strip = dp->strip; // string to strip - appnd = dp->appnd; // string to append - stripl = dp->stripl; // length of strip string - appndl = dp->appndl; // length of append string - numconds = dp->numconds; // length of the condition - opts = dp->opts; // cross product flag - - // then copy over all of the conditions - if (opts & aeLONGCOND) { - memcpy(c.l.conds1, dp->c.l.conds1, MAXCONDLEN_1); - c.l.conds2 = dp->c.l.conds2; - } else memcpy(c.conds, dp->c.conds, MAXCONDLEN); - rappnd = myrevstrdup(appnd); - morphcode = dp->morphcode; - contclass = dp->contclass; - contclasslen = dp->contclasslen; -} - - -SfxEntry::~SfxEntry() -{ - aflag = 0; - if (appnd) free(appnd); - if (rappnd) free(rappnd); - if (strip) free(strip); - pmyMgr = NULL; - appnd = NULL; - strip = NULL; - if (opts & aeLONGCOND) free(c.l.conds2); - if (morphcode && !(opts & aeALIASM)) free(morphcode); - if (contclass && !(opts & aeALIASF)) free(contclass); -} - -// add suffix to this word assuming conditions hold -char * SfxEntry::add(const char * word, int len) -{ - char tword[MAXTEMPWORDLEN]; - - /* make sure all conditions match */ - if ((len > stripl || (len == 0 && pmyMgr->get_fullstrip())) && - (len >= numconds) && test_condition(word + len, word) && - (!stripl || (strcmp(word + len - stripl, strip) == 0)) && - ((MAXTEMPWORDLEN) > (len + appndl - stripl))) { - /* we have a match so add suffix */ - strncpy(tword, word, MAXTEMPWORDLEN-1); - tword[MAXTEMPWORDLEN-1] = '\0'; - if (appndl) { - strcpy(tword + len - stripl, appnd); - } else { - *(tword + len - stripl) = '\0'; - } - return mystrdup(tword); - } - return NULL; -} - -inline char * SfxEntry::nextchar(char * p) { - if (p) { - p++; - if (opts & aeLONGCOND) { - // jump to the 2nd part of the condition - if (p == c.l.conds1 + MAXCONDLEN_1) return c.l.conds2; - // end of the MAXCONDLEN length condition - } else if (p == c.conds + MAXCONDLEN) return NULL; - return *p ? p : NULL; - } - return NULL; -} - -inline int SfxEntry::test_condition(const char * st, const char * beg) -{ - const char * pos = NULL; // group with pos input position - bool neg = false; // complementer - bool ingroup = false; // character in the group - if (numconds == 0) return 1; - char * p = c.conds; - st--; - int i = 1; - while (1) { - switch (*p) { - case '\0': - return 1; - case '[': - p = nextchar(p); - pos = st; - break; - case '^': - p = nextchar(p); - neg = true; - break; - case ']': - if (!neg && !ingroup) - return 0; - i++; - // skip the next character - if (!ingroup) - { - for (; (opts & aeUTF8) && (st >= beg) && (*st & 0xc0) == 0x80; st--); - st--; - } - pos = NULL; - neg = false; - ingroup = false; - p = nextchar(p); - if (st < beg && p) - return 0; // word <= condition - break; - case '.': - if (!pos) - { - // dots are not metacharacters in groups: [.] - p = nextchar(p); - // skip the next character - for (st--; (opts & aeUTF8) && (st >= beg) && (*st & 0xc0) == 0x80; st--); - if (st < beg) { // word <= condition - if (p) return 0; else return 1; - } - if ((opts & aeUTF8) && (*st & 0x80)) { // head of the UTF-8 character - st--; - if (st < beg) { // word <= condition - if (p) return 0; else return 1; - } - } - break; - } - /* FALLTHROUGH */ - default: { - if (*st == *p) { - p = nextchar(p); - if ((opts & aeUTF8) && (*st & 0x80)) { - st--; - while (p && (st >= beg)) { - if (*p != *st) { - if (!pos) return 0; - st = pos; - break; - } - // first byte of the UTF-8 multibyte character - if ((*p & 0xc0) != 0x80) break; - p = nextchar(p); - st--; - } - if (pos && st != pos) { - if (neg) return 0; - else if (i == numconds) return 1; - ingroup = true; - while (p && *p != ']' && ((p = nextchar(p)) != NULL)); - st--; - } - if (p && *p != ']') p = nextchar(p); - } else if (pos) { - if (neg) return 0; - else if (i == numconds) return 1; - ingroup = true; - while (p && *p != ']' && ((p = nextchar(p)) != NULL)); -// if (p && *p != ']') p = nextchar(p); - st--; - } - if (!pos) { - i++; - st--; - } - if (st < beg && p && *p != ']') return 0; // word <= condition - } else if (pos) { // group - p = nextchar(p); - } else return 0; - } - } - if (!p) return 1; - } -} - -// see if this suffix is present in the word -struct hentry * SfxEntry::checkword(const char * word, int len, int optflags, - PfxEntry* ppfx, char ** wlst, int maxSug, int * ns, const FLAG cclass, const FLAG needflag, - const FLAG badflag) -{ - int tmpl; // length of tmpword - struct hentry * he; // hash entry pointer - unsigned char * cp; - char tmpword[MAXTEMPWORDLEN]; - PfxEntry* ep = ppfx; - - // if this suffix is being cross checked with a prefix - // but it does not support cross products skip it - - if (((optflags & aeXPRODUCT) != 0) && ((opts & aeXPRODUCT) == 0)) - return NULL; - - // upon entry suffix is 0 length or already matches the end of the word. - // So if the remaining root word has positive length - // and if there are enough chars in root word and added back strip chars - // to meet the number of characters conditions, then test it - - tmpl = len - appndl; - // the second condition is not enough for UTF-8 strings - // it checked in test_condition() - - if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && - (tmpl + stripl >= numconds)) { - - // generate new root word by removing suffix and adding - // back any characters that would have been stripped or - // or null terminating the shorter string - - strncpy (tmpword, word, MAXTEMPWORDLEN-1); - tmpword[MAXTEMPWORDLEN-1] = '\0'; - cp = (unsigned char *)(tmpword + tmpl); - if (stripl) { - strcpy ((char *)cp, strip); - tmpl += stripl; - cp = (unsigned char *)(tmpword + tmpl); - } else *cp = '\0'; - - // now make sure all of the conditions on characters - // are met. Please see the appendix at the end of - // this file for more info on exactly what is being - // tested - - // if all conditions are met then check if resulting - // root word in the dictionary - - if (test_condition((char *) cp, (char *) tmpword)) { - -#ifdef SZOSZABLYA_POSSIBLE_ROOTS - fprintf(stdout,"%s %s %c\n", word, tmpword, aflag); -#endif - if ((he = pmyMgr->lookup(tmpword)) != NULL) { - do { - // check conditional suffix (enabled by prefix) - if ((TESTAFF(he->astr, aflag, he->alen) || (ep && ep->getCont() && - TESTAFF(ep->getCont(), aflag, ep->getContLen()))) && - (((optflags & aeXPRODUCT) == 0) || - (ep && TESTAFF(he->astr, ep->getFlag(), he->alen)) || - // enabled by prefix - ((contclass) && (ep && TESTAFF(contclass, ep->getFlag(), contclasslen))) - ) && - // handle cont. class - ((!cclass) || - ((contclass) && TESTAFF(contclass, cclass, contclasslen)) - ) && - // check only in compound homonyms (bad flags) - (!badflag || !TESTAFF(he->astr, badflag, he->alen) - ) && - // handle required flag - ((!needflag) || - (TESTAFF(he->astr, needflag, he->alen) || - ((contclass) && TESTAFF(contclass, needflag, contclasslen))) - ) - ) return he; - he = he->next_homonym; // check homonyms - } while (he); - - // obsolote stemming code (used only by the - // experimental SuffixMgr:suggest_pos_stems) - // store resulting root in wlst - } else if (wlst && (*ns < maxSug)) { - int cwrd = 1; - for (int k=0; k < *ns; k++) - if (strcmp(tmpword, wlst[k]) == 0) { - cwrd = 0; - break; - } - if (cwrd) { - wlst[*ns] = mystrdup(tmpword); - if (wlst[*ns] == NULL) { - for (int j=0; j<*ns; j++) free(wlst[j]); - *ns = -1; - return NULL; - } - (*ns)++; - } - } - } - } - return NULL; -} - -// see if two-level suffix is present in the word -struct hentry * SfxEntry::check_twosfx(const char * word, int len, int optflags, - PfxEntry* ppfx, const FLAG needflag) -{ - int tmpl; // length of tmpword - struct hentry * he; // hash entry pointer - unsigned char * cp; - char tmpword[MAXTEMPWORDLEN]; - PfxEntry* ep = ppfx; - - - // if this suffix is being cross checked with a prefix - // but it does not support cross products skip it - - if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0) - return NULL; - - // upon entry suffix is 0 length or already matches the end of the word. - // So if the remaining root word has positive length - // and if there are enough chars in root word and added back strip chars - // to meet the number of characters conditions, then test it - - tmpl = len - appndl; - - if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && - (tmpl + stripl >= numconds)) { - - // generate new root word by removing suffix and adding - // back any characters that would have been stripped or - // or null terminating the shorter string - - strncpy(tmpword, word, MAXTEMPWORDLEN-1); - tmpword[MAXTEMPWORDLEN-1] = '\0'; - cp = (unsigned char *)(tmpword + tmpl); - if (stripl) { - strcpy ((char *)cp, strip); - tmpl += stripl; - cp = (unsigned char *)(tmpword + tmpl); - } else *cp = '\0'; - - // now make sure all of the conditions on characters - // are met. Please see the appendix at the end of - // this file for more info on exactly what is being - // tested - - // if all conditions are met then recall suffix_check - - if (test_condition((char *) cp, (char *) tmpword)) { - if (ppfx) { - // handle conditional suffix - if ((contclass) && TESTAFF(contclass, ep->getFlag(), contclasslen)) - he = pmyMgr->suffix_check(tmpword, tmpl, 0, NULL, NULL, 0, NULL, (FLAG) aflag, needflag); - else - he = pmyMgr->suffix_check(tmpword, tmpl, optflags, ppfx, NULL, 0, NULL, (FLAG) aflag, needflag); - } else { - he = pmyMgr->suffix_check(tmpword, tmpl, 0, NULL, NULL, 0, NULL, (FLAG) aflag, needflag); - } - if (he) return he; - } - } - return NULL; -} - -// see if two-level suffix is present in the word -char * SfxEntry::check_twosfx_morph(const char * word, int len, int optflags, - PfxEntry* ppfx, const FLAG needflag) -{ - int tmpl; // length of tmpword - unsigned char * cp; - char tmpword[MAXTEMPWORDLEN]; - PfxEntry* ep = ppfx; - char * st; - - char result[MAXLNLEN]; - - *result = '\0'; - - // if this suffix is being cross checked with a prefix - // but it does not support cross products skip it - - if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0) - return NULL; - - // upon entry suffix is 0 length or already matches the end of the word. - // So if the remaining root word has positive length - // and if there are enough chars in root word and added back strip chars - // to meet the number of characters conditions, then test it - - tmpl = len - appndl; - - if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && - (tmpl + stripl >= numconds)) { - - // generate new root word by removing suffix and adding - // back any characters that would have been stripped or - // or null terminating the shorter string - - strncpy(tmpword, word, MAXTEMPWORDLEN-1); - tmpword[MAXTEMPWORDLEN-1] = '\0'; - cp = (unsigned char *)(tmpword + tmpl); - if (stripl) { - strcpy ((char *)cp, strip); - tmpl += stripl; - cp = (unsigned char *)(tmpword + tmpl); - } else *cp = '\0'; - - // now make sure all of the conditions on characters - // are met. Please see the appendix at the end of - // this file for more info on exactly what is being - // tested - - // if all conditions are met then recall suffix_check - - if (test_condition((char *) cp, (char *) tmpword)) { - if (ppfx) { - // handle conditional suffix - if ((contclass) && TESTAFF(contclass, ep->getFlag(), contclasslen)) { - st = pmyMgr->suffix_check_morph(tmpword, tmpl, 0, NULL, aflag, needflag); - if (st) { - if (ppfx->getMorph()) { - mystrcat(result, ppfx->getMorph(), MAXLNLEN); - mystrcat(result, " ", MAXLNLEN); - } - mystrcat(result,st, MAXLNLEN); - free(st); - mychomp(result); - } - } else { - st = pmyMgr->suffix_check_morph(tmpword, tmpl, optflags, ppfx, aflag, needflag); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - mychomp(result); - } - } - } else { - st = pmyMgr->suffix_check_morph(tmpword, tmpl, 0, NULL, aflag, needflag); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - mychomp(result); - } - } - if (*result) return mystrdup(result); - } - } - return NULL; -} - -// get next homonym with same affix -struct hentry * SfxEntry::get_next_homonym(struct hentry * he, int optflags, PfxEntry* ppfx, - const FLAG cclass, const FLAG needflag) -{ - PfxEntry* ep = ppfx; - FLAG eFlag = ep ? ep->getFlag() : FLAG_NULL; - - while (he->next_homonym) { - he = he->next_homonym; - if ((TESTAFF(he->astr, aflag, he->alen) || (ep && ep->getCont() && TESTAFF(ep->getCont(), aflag, ep->getContLen()))) && - ((optflags & aeXPRODUCT) == 0 || - TESTAFF(he->astr, eFlag, he->alen) || - // handle conditional suffix - ((contclass) && TESTAFF(contclass, eFlag, contclasslen)) - ) && - // handle cont. class - ((!cclass) || - ((contclass) && TESTAFF(contclass, cclass, contclasslen)) - ) && - // handle required flag - ((!needflag) || - (TESTAFF(he->astr, needflag, he->alen) || - ((contclass) && TESTAFF(contclass, needflag, contclasslen))) - ) - ) return he; - } - return NULL; -} - - -#if 0 - -Appendix: Understanding Affix Code - - -An affix is either a prefix or a suffix attached to root words to make -other words. - -Basically a Prefix or a Suffix is set of AffEntry objects -which store information about the prefix or suffix along -with supporting routines to check if a word has a particular -prefix or suffix or a combination. - -The structure affentry is defined as follows: - -struct affentry -{ - unsigned short aflag; // ID used to represent the affix - char * strip; // string to strip before adding affix - char * appnd; // the affix string to add - unsigned char stripl; // length of the strip string - unsigned char appndl; // length of the affix string - char numconds; // the number of conditions that must be met - char opts; // flag: aeXPRODUCT- combine both prefix and suffix - char conds[SETSIZE]; // array which encodes the conditions to be met -}; - - -Here is a suffix borrowed from the en_US.aff file. This file -is whitespace delimited. - -SFX D Y 4 -SFX D 0 e d -SFX D y ied [^aeiou]y -SFX D 0 ed [^ey] -SFX D 0 ed [aeiou]y - -This information can be interpreted as follows: - -In the first line has 4 fields - -Field ------ -1 SFX - indicates this is a suffix -2 D - is the name of the character flag which represents this suffix -3 Y - indicates it can be combined with prefixes (cross product) -4 4 - indicates that sequence of 4 affentry structures are needed to - properly store the affix information - -The remaining lines describe the unique information for the 4 SfxEntry -objects that make up this affix. Each line can be interpreted -as follows: (note fields 1 and 2 are as a check against line 1 info) - -Field ------ -1 SFX - indicates this is a suffix -2 D - is the name of the character flag for this affix -3 y - the string of chars to strip off before adding affix - (a 0 here indicates the NULL string) -4 ied - the string of affix characters to add -5 [^aeiou]y - the conditions which must be met before the affix - can be applied - -Field 5 is interesting. Since this is a suffix, field 5 tells us that -there are 2 conditions that must be met. The first condition is that -the next to the last character in the word must *NOT* be any of the -following "a", "e", "i", "o" or "u". The second condition is that -the last character of the word must end in "y". - -So how can we encode this information concisely and be able to -test for both conditions in a fast manner? The answer is found -but studying the wonderful ispell code of Geoff Kuenning, et.al. -(now available under a normal BSD license). - -If we set up a conds array of 256 bytes indexed (0 to 255) and access it -using a character (cast to an unsigned char) of a string, we have 8 bits -of information we can store about that character. Specifically we -could use each bit to say if that character is allowed in any of the -last (or first for prefixes) 8 characters of the word. - -Basically, each character at one end of the word (up to the number -of conditions) is used to index into the conds array and the resulting -value found there says whether the that character is valid for a -specific character position in the word. - -For prefixes, it does this by setting bit 0 if that char is valid -in the first position, bit 1 if valid in the second position, and so on. - -If a bit is not set, then that char is not valid for that postion in the -word. - -If working with suffixes bit 0 is used for the character closest -to the front, bit 1 for the next character towards the end, ..., -with bit numconds-1 representing the last char at the end of the string. - -Note: since entries in the conds[] are 8 bits, only 8 conditions -(read that only 8 character positions) can be examined at one -end of a word (the beginning for prefixes and the end for suffixes. - -So to make this clearer, lets encode the conds array values for the -first two affentries for the suffix D described earlier. - - - For the first affentry: - numconds = 1 (only examine the last character) - - conds['e'] = (1 << 0) (the word must end in an E) - all others are all 0 - - For the second affentry: - numconds = 2 (only examine the last two characters) - - conds[X] = conds[X] | (1 << 0) (aeiou are not allowed) - where X is all characters *but* a, e, i, o, or u - - - conds['y'] = (1 << 1) (the last char must be a y) - all other bits for all other entries in the conds array are zero - - -#endif - diff --git a/subprojects/hunspell/src/hunspell/affentry.hxx b/subprojects/hunspell/src/hunspell/affentry.hxx deleted file mode 100644 index 923ee5ffe..000000000 --- a/subprojects/hunspell/src/hunspell/affentry.hxx +++ /dev/null @@ -1,144 +0,0 @@ -#ifndef _AFFIX_HXX_ -#define _AFFIX_HXX_ - -#include "hunvisapi.h" - -#include "atypes.hxx" -#include "baseaffix.hxx" -#include "affixmgr.hxx" - -/* A Prefix Entry */ - -class LIBHUNSPELL_DLL_EXPORTED PfxEntry : protected AffEntry -{ -private: - PfxEntry(const PfxEntry&); - PfxEntry& operator = (const PfxEntry&); -private: - AffixMgr* pmyMgr; - - PfxEntry * next; - PfxEntry * nexteq; - PfxEntry * nextne; - PfxEntry * flgnxt; - -public: - - PfxEntry(AffixMgr* pmgr, affentry* dp ); - ~PfxEntry(); - - inline bool allowCross() { return ((opts & aeXPRODUCT) != 0); } - struct hentry * checkword(const char * word, int len, char in_compound, - const FLAG needflag = FLAG_NULL); - - struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL); - - char * check_morph(const char * word, int len, char in_compound, - const FLAG needflag = FLAG_NULL); - - char * check_twosfx_morph(const char * word, int len, - char in_compound, const FLAG needflag = FLAG_NULL); - - inline FLAG getFlag() { return aflag; } - inline const char * getKey() { return appnd; } - char * add(const char * word, int len); - - inline short getKeyLen() { return appndl; } - - inline const char * getMorph() { return morphcode; } - - inline const unsigned short * getCont() { return contclass; } - inline short getContLen() { return contclasslen; } - - inline PfxEntry * getNext() { return next; } - inline PfxEntry * getNextNE() { return nextne; } - inline PfxEntry * getNextEQ() { return nexteq; } - inline PfxEntry * getFlgNxt() { return flgnxt; } - - inline void setNext(PfxEntry * ptr) { next = ptr; } - inline void setNextNE(PfxEntry * ptr) { nextne = ptr; } - inline void setNextEQ(PfxEntry * ptr) { nexteq = ptr; } - inline void setFlgNxt(PfxEntry * ptr) { flgnxt = ptr; } - - inline char * nextchar(char * p); - inline int test_condition(const char * st); -}; - - - - -/* A Suffix Entry */ - -class LIBHUNSPELL_DLL_EXPORTED SfxEntry : protected AffEntry -{ -private: - SfxEntry(const SfxEntry&); - SfxEntry& operator = (const SfxEntry&); -private: - AffixMgr* pmyMgr; - char * rappnd; - - SfxEntry * next; - SfxEntry * nexteq; - SfxEntry * nextne; - SfxEntry * flgnxt; - - SfxEntry * l_morph; - SfxEntry * r_morph; - SfxEntry * eq_morph; - -public: - - SfxEntry(AffixMgr* pmgr, affentry* dp ); - ~SfxEntry(); - - inline bool allowCross() { return ((opts & aeXPRODUCT) != 0); } - struct hentry * checkword(const char * word, int len, int optflags, - PfxEntry* ppfx, char ** wlst, int maxSug, int * ns, -// const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, char in_compound=IN_CPD_NOT); - const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, const FLAG badflag = 0); - - struct hentry * check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL); - - char * check_twosfx_morph(const char * word, int len, int optflags, - PfxEntry* ppfx, const FLAG needflag = FLAG_NULL); - struct hentry * get_next_homonym(struct hentry * he); - struct hentry * get_next_homonym(struct hentry * word, int optflags, PfxEntry* ppfx, - const FLAG cclass, const FLAG needflag); - - - inline FLAG getFlag() { return aflag; } - inline const char * getKey() { return rappnd; } - char * add(const char * word, int len); - - - inline const char * getMorph() { return morphcode; } - - inline const unsigned short * getCont() { return contclass; } - inline short getContLen() { return contclasslen; } - inline const char * getAffix() { return appnd; } - - inline short getKeyLen() { return appndl; } - - inline SfxEntry * getNext() { return next; } - inline SfxEntry * getNextNE() { return nextne; } - inline SfxEntry * getNextEQ() { return nexteq; } - - inline SfxEntry * getLM() { return l_morph; } - inline SfxEntry * getRM() { return r_morph; } - inline SfxEntry * getEQM() { return eq_morph; } - inline SfxEntry * getFlgNxt() { return flgnxt; } - - inline void setNext(SfxEntry * ptr) { next = ptr; } - inline void setNextNE(SfxEntry * ptr) { nextne = ptr; } - inline void setNextEQ(SfxEntry * ptr) { nexteq = ptr; } - inline void setFlgNxt(SfxEntry * ptr) { flgnxt = ptr; } - - inline char * nextchar(char * p); - inline int test_condition(const char * st, const char * begin); - -}; - -#endif - - diff --git a/subprojects/hunspell/src/hunspell/affixmgr.cxx b/subprojects/hunspell/src/hunspell/affixmgr.cxx deleted file mode 100644 index ee74ee47b..000000000 --- a/subprojects/hunspell/src/hunspell/affixmgr.cxx +++ /dev/null @@ -1,4538 +0,0 @@ -#include "license.hunspell" -#include "license.myspell" - -#include -#include -#include -#include - -#include - -#include "affixmgr.hxx" -#include "affentry.hxx" -#include "langnum.hxx" - -#include "csutil.hxx" - -AffixMgr::AffixMgr(const char * affpath, HashMgr** ptr, int * md, const char * key) -{ - // register hash manager and load affix data from aff file - pHMgr = ptr[0]; - alldic = ptr; - maxdic = md; - keystring = NULL; - trystring = NULL; - encoding=NULL; - csconv=NULL; - utf8 = 0; - complexprefixes = 0; - maptable = NULL; - nummap = 0; - breaktable = NULL; - numbreak = -1; - reptable = NULL; - numrep = 0; - iconvtable = NULL; - oconvtable = NULL; - checkcpdtable = NULL; - // allow simplified compound forms (see 3rd field of CHECKCOMPOUNDPATTERN) - simplifiedcpd = 0; - numcheckcpd = 0; - defcpdtable = NULL; - numdefcpd = 0; - phone = NULL; - compoundflag = FLAG_NULL; // permits word in compound forms - compoundbegin = FLAG_NULL; // may be first word in compound forms - compoundmiddle = FLAG_NULL; // may be middle word in compound forms - compoundend = FLAG_NULL; // may be last word in compound forms - compoundroot = FLAG_NULL; // compound word signing flag - compoundpermitflag = FLAG_NULL; // compound permitting flag for suffixed word - compoundforbidflag = FLAG_NULL; // compound fordidden flag for suffixed word - compoundmoresuffixes = 0; // allow more suffixes within compound words - checkcompounddup = 0; // forbid double words in compounds - checkcompoundrep = 0; // forbid bad compounds (may be non compound word with a REP substitution) - checkcompoundcase = 0; // forbid upper and lowercase combinations at word bounds - checkcompoundtriple = 0; // forbid compounds with triple letters - simplifiedtriple = 0; // allow simplified triple letters in compounds (Schiff+fahrt -> Schiffahrt) - forbiddenword = FORBIDDENWORD; // forbidden word signing flag - nosuggest = FLAG_NULL; // don't suggest words signed with NOSUGGEST flag - nongramsuggest = FLAG_NULL; - lang = NULL; // language - langnum = 0; // language code (see http://l10n.openoffice.org/languages.html) - needaffix = FLAG_NULL; // forbidden root, allowed only with suffixes - cpdwordmax = -1; // default: unlimited wordcount in compound words - cpdmin = -1; // undefined - cpdmaxsyllable = 0; // default: unlimited syllablecount in compound words - cpdvowels=NULL; // vowels (for calculating of Hungarian compounding limit, O(n) search! XXX) - cpdvowels_utf16=NULL; // vowels for UTF-8 encoding (bsearch instead of O(n) search) - cpdvowels_utf16_len=0; // vowels - pfxappnd=NULL; // previous prefix for counting the syllables of prefix BUG - sfxappnd=NULL; // previous suffix for counting a special syllables BUG - cpdsyllablenum=NULL; // syllable count incrementing flag - checknum=0; // checking numbers, and word with numbers - wordchars=NULL; // letters + spec. word characters - wordchars_utf16=NULL; // letters + spec. word characters - wordchars_utf16_len=0; // letters + spec. word characters - ignorechars=NULL; // letters + spec. word characters - ignorechars_utf16=NULL; // letters + spec. word characters - ignorechars_utf16_len=0; // letters + spec. word characters - version=NULL; // affix and dictionary file version string - havecontclass=0; // flags of possible continuing classes (double affix) - // LEMMA_PRESENT: not put root into the morphological output. Lemma presents - // in morhological description in dictionary file. It's often combined with PSEUDOROOT. - lemma_present = FLAG_NULL; - circumfix = FLAG_NULL; - onlyincompound = FLAG_NULL; - maxngramsugs = -1; // undefined - maxdiff = -1; // undefined - onlymaxdiff = 0; - maxcpdsugs = -1; // undefined - nosplitsugs = 0; - sugswithdots = 0; - keepcase = 0; - forceucase = 0; - warn = 0; - forbidwarn = 0; - checksharps = 0; - substandard = FLAG_NULL; - fullstrip = 0; - - sfx = NULL; - pfx = NULL; - - for (int i=0; i < SETSIZE; i++) { - pStart[i] = NULL; - sStart[i] = NULL; - pFlag[i] = NULL; - sFlag[i] = NULL; - } - - for (int j=0; j < CONTSIZE; j++) { - contclasses[j] = 0; - } - - if (parse_file(affpath, key)) { - HUNSPELL_WARNING(stderr, "Failure loading aff file %s\n",affpath); - } - - if (cpdmin == -1) cpdmin = MINCPDLEN; - -} - - -AffixMgr::~AffixMgr() -{ - // pass through linked prefix entries and clean up - for (int i=0; i < SETSIZE ;i++) { - pFlag[i] = NULL; - PfxEntry * ptr = pStart[i]; - PfxEntry * nptr = NULL; - while (ptr) { - nptr = ptr->getNext(); - delete(ptr); - ptr = nptr; - nptr = NULL; - } - } - - // pass through linked suffix entries and clean up - for (int j=0; j < SETSIZE ; j++) { - sFlag[j] = NULL; - SfxEntry * ptr = sStart[j]; - SfxEntry * nptr = NULL; - while (ptr) { - nptr = ptr->getNext(); - delete(ptr); - ptr = nptr; - nptr = NULL; - } - sStart[j] = NULL; - } - - if (keystring) free(keystring); - keystring=NULL; - if (trystring) free(trystring); - trystring=NULL; - if (encoding) free(encoding); - encoding=NULL; - if (maptable) { - for (int j=0; j < nummap; j++) { - for (int k=0; k < maptable[j].len; k++) { - if (maptable[j].set[k]) free(maptable[j].set[k]); - } - free(maptable[j].set); - maptable[j].set = NULL; - maptable[j].len = 0; - } - free(maptable); - maptable = NULL; - } - nummap = 0; - if (breaktable) { - for (int j=0; j < numbreak; j++) { - if (breaktable[j]) free(breaktable[j]); - breaktable[j] = NULL; - } - free(breaktable); - breaktable = NULL; - } - numbreak = 0; - if (reptable) { - for (int j=0; j < numrep; j++) { - free(reptable[j].pattern); - free(reptable[j].pattern2); - } - free(reptable); - reptable = NULL; - } - if (iconvtable) delete iconvtable; - if (oconvtable) delete oconvtable; - if (phone && phone->rules) { - for (int j=0; j < phone->num + 1; j++) { - free(phone->rules[j * 2]); - free(phone->rules[j * 2 + 1]); - } - free(phone->rules); - free(phone); - phone = NULL; - } - - if (defcpdtable) { - for (int j=0; j < numdefcpd; j++) { - free(defcpdtable[j].def); - defcpdtable[j].def = NULL; - } - free(defcpdtable); - defcpdtable = NULL; - } - numrep = 0; - if (checkcpdtable) { - for (int j=0; j < numcheckcpd; j++) { - free(checkcpdtable[j].pattern); - free(checkcpdtable[j].pattern2); - free(checkcpdtable[j].pattern3); - checkcpdtable[j].pattern = NULL; - checkcpdtable[j].pattern2 = NULL; - checkcpdtable[j].pattern3 = NULL; - } - free(checkcpdtable); - checkcpdtable = NULL; - } - numcheckcpd = 0; - FREE_FLAG(compoundflag); - FREE_FLAG(compoundbegin); - FREE_FLAG(compoundmiddle); - FREE_FLAG(compoundend); - FREE_FLAG(compoundpermitflag); - FREE_FLAG(compoundforbidflag); - FREE_FLAG(compoundroot); - FREE_FLAG(forbiddenword); - FREE_FLAG(nosuggest); - FREE_FLAG(nongramsuggest); - FREE_FLAG(needaffix); - FREE_FLAG(lemma_present); - FREE_FLAG(circumfix); - FREE_FLAG(onlyincompound); - - cpdwordmax = 0; - pHMgr = NULL; - cpdmin = 0; - cpdmaxsyllable = 0; - if (cpdvowels) free(cpdvowels); - if (cpdvowels_utf16) free(cpdvowels_utf16); - if (cpdsyllablenum) free(cpdsyllablenum); - free_utf_tbl(); - if (lang) free(lang); - if (wordchars) free(wordchars); - if (wordchars_utf16) free(wordchars_utf16); - if (ignorechars) free(ignorechars); - if (ignorechars_utf16) free(ignorechars_utf16); - if (version) free(version); - checknum=0; -#ifdef MOZILLA_CLIENT - delete [] csconv; -#endif -} - -void AffixMgr::finishFileMgr(FileMgr *afflst) -{ - delete afflst; - - // convert affix trees to sorted list - process_pfx_tree_to_list(); - process_sfx_tree_to_list(); -} - -// read in aff file and build up prefix and suffix entry objects -int AffixMgr::parse_file(const char * affpath, const char * key) -{ - char * line; // io buffers - char ft; // affix type - - // checking flag duplication - char dupflags[CONTSIZE]; - char dupflags_ini = 1; - - // first line indicator for removing byte order mark - int firstline = 1; - - // open the affix file - FileMgr * afflst = new FileMgr(affpath, key); - if (!afflst) { - HUNSPELL_WARNING(stderr, "error: could not open affix description file %s\n",affpath); - return 1; - } - - // step one is to parse the affix file building up the internal - // affix data structures - - // read in each line ignoring any that do not - // start with a known line type indicator - while ((line = afflst->getline()) != NULL) { - mychomp(line); - - /* remove byte order mark */ - if (firstline) { - firstline = 0; - // Affix file begins with byte order mark: possible incompatibility with old Hunspell versions - if (strncmp(line,"\xEF\xBB\xBF",3) == 0) { - memmove(line, line+3, strlen(line+3)+1); - } - } - - /* parse in the keyboard string */ - if (strncmp(line,"KEY",3) == 0) { - if (parse_string(line, &keystring, afflst->getlinenum())) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the try string */ - if (strncmp(line,"TRY",3) == 0) { - if (parse_string(line, &trystring, afflst->getlinenum())) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the name of the character set used by the .dict and .aff */ - if (strncmp(line,"SET",3) == 0) { - if (parse_string(line, &encoding, afflst->getlinenum())) { - finishFileMgr(afflst); - return 1; - } - if (strcmp(encoding, "UTF-8") == 0) { - utf8 = 1; -#ifndef OPENOFFICEORG -#ifndef MOZILLA_CLIENT - if (initialize_utf_tbl()) return 1; -#endif -#endif - } - } - - /* parse COMPLEXPREFIXES for agglutinative languages with right-to-left writing system */ - if (strncmp(line,"COMPLEXPREFIXES",15) == 0) - complexprefixes = 1; - - /* parse in the flag used by the controlled compound words */ - if (strncmp(line,"COMPOUNDFLAG",12) == 0) { - if (parse_flag(line, &compoundflag, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by compound words */ - if (strncmp(line,"COMPOUNDBEGIN",13) == 0) { - if (complexprefixes) { - if (parse_flag(line, &compoundend, afflst)) { - finishFileMgr(afflst); - return 1; - } - } else { - if (parse_flag(line, &compoundbegin, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - } - - /* parse in the flag used by compound words */ - if (strncmp(line,"COMPOUNDMIDDLE",14) == 0) { - if (parse_flag(line, &compoundmiddle, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - /* parse in the flag used by compound words */ - if (strncmp(line,"COMPOUNDEND",11) == 0) { - if (complexprefixes) { - if (parse_flag(line, &compoundbegin, afflst)) { - finishFileMgr(afflst); - return 1; - } - } else { - if (parse_flag(line, &compoundend, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - } - - /* parse in the data used by compound_check() method */ - if (strncmp(line,"COMPOUNDWORDMAX",15) == 0) { - if (parse_num(line, &cpdwordmax, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag sign compounds in dictionary */ - if (strncmp(line,"COMPOUNDROOT",12) == 0) { - if (parse_flag(line, &compoundroot, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by compound_check() method */ - if (strncmp(line,"COMPOUNDPERMITFLAG",18) == 0) { - if (parse_flag(line, &compoundpermitflag, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by compound_check() method */ - if (strncmp(line,"COMPOUNDFORBIDFLAG",18) == 0) { - if (parse_flag(line, &compoundforbidflag, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - if (strncmp(line,"COMPOUNDMORESUFFIXES",20) == 0) { - compoundmoresuffixes = 1; - } - - if (strncmp(line,"CHECKCOMPOUNDDUP",16) == 0) { - checkcompounddup = 1; - } - - if (strncmp(line,"CHECKCOMPOUNDREP",16) == 0) { - checkcompoundrep = 1; - } - - if (strncmp(line,"CHECKCOMPOUNDTRIPLE",19) == 0) { - checkcompoundtriple = 1; - } - - if (strncmp(line,"SIMPLIFIEDTRIPLE",16) == 0) { - simplifiedtriple = 1; - } - - if (strncmp(line,"CHECKCOMPOUNDCASE",17) == 0) { - checkcompoundcase = 1; - } - - if (strncmp(line,"NOSUGGEST",9) == 0) { - if (parse_flag(line, &nosuggest, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - if (strncmp(line,"NONGRAMSUGGEST",14) == 0) { - if (parse_flag(line, &nongramsuggest, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by forbidden words */ - if (strncmp(line,"FORBIDDENWORD",13) == 0) { - if (parse_flag(line, &forbiddenword, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by forbidden words */ - if (strncmp(line,"LEMMA_PRESENT",13) == 0) { - if (parse_flag(line, &lemma_present, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by circumfixes */ - if (strncmp(line,"CIRCUMFIX",9) == 0) { - if (parse_flag(line, &circumfix, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by fogemorphemes */ - if (strncmp(line,"ONLYINCOMPOUND",14) == 0) { - if (parse_flag(line, &onlyincompound, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by `needaffixs' */ - if (strncmp(line,"PSEUDOROOT",10) == 0) { - if (parse_flag(line, &needaffix, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by `needaffixs' */ - if (strncmp(line,"NEEDAFFIX",9) == 0) { - if (parse_flag(line, &needaffix, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the minimal length for words in compounds */ - if (strncmp(line,"COMPOUNDMIN",11) == 0) { - if (parse_num(line, &cpdmin, afflst)) { - finishFileMgr(afflst); - return 1; - } - if (cpdmin < 1) cpdmin = 1; - } - - /* parse in the max. words and syllables in compounds */ - if (strncmp(line,"COMPOUNDSYLLABLE",16) == 0) { - if (parse_cpdsyllable(line, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by compound_check() method */ - if (strncmp(line,"SYLLABLENUM",11) == 0) { - if (parse_string(line, &cpdsyllablenum, afflst->getlinenum())) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by the controlled compound words */ - if (strncmp(line,"CHECKNUM",8) == 0) { - checknum=1; - } - - /* parse in the extra word characters */ - if (strncmp(line,"WORDCHARS",9) == 0) { - if (parse_array(line, &wordchars, &wordchars_utf16, &wordchars_utf16_len, utf8, afflst->getlinenum())) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the ignored characters (for example, Arabic optional diacretics charachters */ - if (strncmp(line,"IGNORE",6) == 0) { - if (parse_array(line, &ignorechars, &ignorechars_utf16, &ignorechars_utf16_len, utf8, afflst->getlinenum())) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the typical fault correcting table */ - if (strncmp(line,"REP",3) == 0) { - if (parse_reptable(line, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the input conversion table */ - if (strncmp(line,"ICONV",5) == 0) { - if (parse_convtable(line, afflst, &iconvtable, "ICONV")) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the input conversion table */ - if (strncmp(line,"OCONV",5) == 0) { - if (parse_convtable(line, afflst, &oconvtable, "OCONV")) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the phonetic translation table */ - if (strncmp(line,"PHONE",5) == 0) { - if (parse_phonetable(line, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the checkcompoundpattern table */ - if (strncmp(line,"CHECKCOMPOUNDPATTERN",20) == 0) { - if (parse_checkcpdtable(line, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the defcompound table */ - if (strncmp(line,"COMPOUNDRULE",12) == 0) { - if (parse_defcpdtable(line, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the related character map table */ - if (strncmp(line,"MAP",3) == 0) { - if (parse_maptable(line, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the word breakpoints table */ - if (strncmp(line,"BREAK",5) == 0) { - if (parse_breaktable(line, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the language for language specific codes */ - if (strncmp(line,"LANG",4) == 0) { - if (parse_string(line, &lang, afflst->getlinenum())) { - finishFileMgr(afflst); - return 1; - } - langnum = get_lang_num(lang); - } - - if (strncmp(line,"VERSION",7) == 0) { - for(line = line + 7; *line == ' ' || *line == '\t'; line++); - version = mystrdup(line); - } - - if (strncmp(line,"MAXNGRAMSUGS",12) == 0) { - if (parse_num(line, &maxngramsugs, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - if (strncmp(line,"ONLYMAXDIFF", 11) == 0) - onlymaxdiff = 1; - - if (strncmp(line,"MAXDIFF",7) == 0) { - if (parse_num(line, &maxdiff, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - if (strncmp(line,"MAXCPDSUGS",10) == 0) { - if (parse_num(line, &maxcpdsugs, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - if (strncmp(line,"NOSPLITSUGS",11) == 0) { - nosplitsugs=1; - } - - if (strncmp(line,"FULLSTRIP",9) == 0) { - fullstrip=1; - } - - if (strncmp(line,"SUGSWITHDOTS",12) == 0) { - sugswithdots=1; - } - - /* parse in the flag used by forbidden words */ - if (strncmp(line,"KEEPCASE",8) == 0) { - if (parse_flag(line, &keepcase, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by `forceucase' */ - if (strncmp(line,"FORCEUCASE",10) == 0) { - if (parse_flag(line, &forceucase, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - /* parse in the flag used by `warn' */ - if (strncmp(line,"WARN",4) == 0) { - if (parse_flag(line, &warn, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - if (strncmp(line,"FORBIDWARN",10) == 0) { - forbidwarn=1; - } - - /* parse in the flag used by the affix generator */ - if (strncmp(line,"SUBSTANDARD",11) == 0) { - if (parse_flag(line, &substandard, afflst)) { - finishFileMgr(afflst); - return 1; - } - } - - if (strncmp(line,"CHECKSHARPS",11) == 0) { - checksharps=1; - } - - /* parse this affix: P - prefix, S - suffix */ - ft = ' '; - if (strncmp(line,"PFX",3) == 0) ft = complexprefixes ? 'S' : 'P'; - if (strncmp(line,"SFX",3) == 0) ft = complexprefixes ? 'P' : 'S'; - if (ft != ' ') { - if (dupflags_ini) { - memset(dupflags, 0, sizeof(dupflags)); - dupflags_ini = 0; - } - if (parse_affix(line, ft, afflst, dupflags)) { - finishFileMgr(afflst); - return 1; - } - } - } - - finishFileMgr(afflst); - // affix trees are sorted now - - // now we can speed up performance greatly taking advantage of the - // relationship between the affixes and the idea of "subsets". - - // View each prefix as a potential leading subset of another and view - // each suffix (reversed) as a potential trailing subset of another. - - // To illustrate this relationship if we know the prefix "ab" is found in the - // word to examine, only prefixes that "ab" is a leading subset of need be examined. - // Furthermore is "ab" is not present then none of the prefixes that "ab" is - // is a subset need be examined. - // The same argument goes for suffix string that are reversed. - - // Then to top this off why not examine the first char of the word to quickly - // limit the set of prefixes to examine (i.e. the prefixes to examine must - // be leading supersets of the first character of the word (if they exist) - - // To take advantage of this "subset" relationship, we need to add two links - // from entry. One to take next if the current prefix is found (call it nexteq) - // and one to take next if the current prefix is not found (call it nextne). - - // Since we have built ordered lists, all that remains is to properly initialize - // the nextne and nexteq pointers that relate them - - process_pfx_order(); - process_sfx_order(); - - /* get encoding for CHECKCOMPOUNDCASE */ - if (!utf8) { - char * enc = get_encoding(); - csconv = get_current_cs(enc); - free(enc); - enc = NULL; - - char expw[MAXLNLEN]; - if (wordchars) { - strcpy(expw, wordchars); - free(wordchars); - } else *expw = '\0'; - - for (int i = 0; i <= 255; i++) { - if ( (csconv[i].cupper != csconv[i].clower) && - (! strchr(expw, (char) i))) { - *(expw + strlen(expw) + 1) = '\0'; - *(expw + strlen(expw)) = (char) i; - } - } - - wordchars = mystrdup(expw); - } - - // default BREAK definition - if (numbreak == -1) { - breaktable = (char **) malloc(sizeof(char *) * 3); - if (!breaktable) return 1; - breaktable[0] = mystrdup("-"); - breaktable[1] = mystrdup("^-"); - breaktable[2] = mystrdup("-$"); - if (breaktable[0] && breaktable[1] && breaktable[2]) numbreak = 3; - } - return 0; -} - - -// we want to be able to quickly access prefix information -// both by prefix flag, and sorted by prefix string itself -// so we need to set up two indexes - -int AffixMgr::build_pfxtree(PfxEntry* pfxptr) -{ - PfxEntry * ptr; - PfxEntry * pptr; - PfxEntry * ep = pfxptr; - - // get the right starting points - const char * key = ep->getKey(); - const unsigned char flg = (unsigned char) (ep->getFlag() & 0x00FF); - - // first index by flag which must exist - ptr = pFlag[flg]; - ep->setFlgNxt(ptr); - pFlag[flg] = ep; - - - // handle the special case of null affix string - if (strlen(key) == 0) { - // always inset them at head of list at element 0 - ptr = pStart[0]; - ep->setNext(ptr); - pStart[0] = ep; - return 0; - } - - // now handle the normal case - ep->setNextEQ(NULL); - ep->setNextNE(NULL); - - unsigned char sp = *((const unsigned char *)key); - ptr = pStart[sp]; - - // handle the first insert - if (!ptr) { - pStart[sp] = ep; - return 0; - } - - - // otherwise use binary tree insertion so that a sorted - // list can easily be generated later - pptr = NULL; - for (;;) { - pptr = ptr; - if (strcmp(ep->getKey(), ptr->getKey() ) <= 0) { - ptr = ptr->getNextEQ(); - if (!ptr) { - pptr->setNextEQ(ep); - break; - } - } else { - ptr = ptr->getNextNE(); - if (!ptr) { - pptr->setNextNE(ep); - break; - } - } - } - return 0; -} - -// we want to be able to quickly access suffix information -// both by suffix flag, and sorted by the reverse of the -// suffix string itself; so we need to set up two indexes -int AffixMgr::build_sfxtree(SfxEntry* sfxptr) -{ - SfxEntry * ptr; - SfxEntry * pptr; - SfxEntry * ep = sfxptr; - - /* get the right starting point */ - const char * key = ep->getKey(); - const unsigned char flg = (unsigned char) (ep->getFlag() & 0x00FF); - - // first index by flag which must exist - ptr = sFlag[flg]; - ep->setFlgNxt(ptr); - sFlag[flg] = ep; - - // next index by affix string - - // handle the special case of null affix string - if (strlen(key) == 0) { - // always inset them at head of list at element 0 - ptr = sStart[0]; - ep->setNext(ptr); - sStart[0] = ep; - return 0; - } - - // now handle the normal case - ep->setNextEQ(NULL); - ep->setNextNE(NULL); - - unsigned char sp = *((const unsigned char *)key); - ptr = sStart[sp]; - - // handle the first insert - if (!ptr) { - sStart[sp] = ep; - return 0; - } - - // otherwise use binary tree insertion so that a sorted - // list can easily be generated later - pptr = NULL; - for (;;) { - pptr = ptr; - if (strcmp(ep->getKey(), ptr->getKey() ) <= 0) { - ptr = ptr->getNextEQ(); - if (!ptr) { - pptr->setNextEQ(ep); - break; - } - } else { - ptr = ptr->getNextNE(); - if (!ptr) { - pptr->setNextNE(ep); - break; - } - } - } - return 0; -} - -// convert from binary tree to sorted list -int AffixMgr::process_pfx_tree_to_list() -{ - for (int i=1; i< SETSIZE; i++) { - pStart[i] = process_pfx_in_order(pStart[i],NULL); - } - return 0; -} - - -PfxEntry* AffixMgr::process_pfx_in_order(PfxEntry* ptr, PfxEntry* nptr) -{ - if (ptr) { - nptr = process_pfx_in_order(ptr->getNextNE(), nptr); - ptr->setNext(nptr); - nptr = process_pfx_in_order(ptr->getNextEQ(), ptr); - } - return nptr; -} - - -// convert from binary tree to sorted list -int AffixMgr:: process_sfx_tree_to_list() -{ - for (int i=1; i< SETSIZE; i++) { - sStart[i] = process_sfx_in_order(sStart[i],NULL); - } - return 0; -} - -SfxEntry* AffixMgr::process_sfx_in_order(SfxEntry* ptr, SfxEntry* nptr) -{ - if (ptr) { - nptr = process_sfx_in_order(ptr->getNextNE(), nptr); - ptr->setNext(nptr); - nptr = process_sfx_in_order(ptr->getNextEQ(), ptr); - } - return nptr; -} - - -// reinitialize the PfxEntry links NextEQ and NextNE to speed searching -// using the idea of leading subsets this time -int AffixMgr::process_pfx_order() -{ - PfxEntry* ptr; - - // loop through each prefix list starting point - for (int i=1; i < SETSIZE; i++) { - - ptr = pStart[i]; - - // look through the remainder of the list - // and find next entry with affix that - // the current one is not a subset of - // mark that as destination for NextNE - // use next in list that you are a subset - // of as NextEQ - - for (; ptr != NULL; ptr = ptr->getNext()) { - - PfxEntry * nptr = ptr->getNext(); - for (; nptr != NULL; nptr = nptr->getNext()) { - if (! isSubset( ptr->getKey() , nptr->getKey() )) break; - } - ptr->setNextNE(nptr); - ptr->setNextEQ(NULL); - if ((ptr->getNext()) && isSubset(ptr->getKey() , (ptr->getNext())->getKey())) - ptr->setNextEQ(ptr->getNext()); - } - - // now clean up by adding smart search termination strings: - // if you are already a superset of the previous prefix - // but not a subset of the next, search can end here - // so set NextNE properly - - ptr = pStart[i]; - for (; ptr != NULL; ptr = ptr->getNext()) { - PfxEntry * nptr = ptr->getNext(); - PfxEntry * mptr = NULL; - for (; nptr != NULL; nptr = nptr->getNext()) { - if (! isSubset(ptr->getKey(),nptr->getKey())) break; - mptr = nptr; - } - if (mptr) mptr->setNextNE(NULL); - } - } - return 0; -} - -// initialize the SfxEntry links NextEQ and NextNE to speed searching -// using the idea of leading subsets this time -int AffixMgr::process_sfx_order() -{ - SfxEntry* ptr; - - // loop through each prefix list starting point - for (int i=1; i < SETSIZE; i++) { - - ptr = sStart[i]; - - // look through the remainder of the list - // and find next entry with affix that - // the current one is not a subset of - // mark that as destination for NextNE - // use next in list that you are a subset - // of as NextEQ - - for (; ptr != NULL; ptr = ptr->getNext()) { - SfxEntry * nptr = ptr->getNext(); - for (; nptr != NULL; nptr = nptr->getNext()) { - if (! isSubset(ptr->getKey(),nptr->getKey())) break; - } - ptr->setNextNE(nptr); - ptr->setNextEQ(NULL); - if ((ptr->getNext()) && isSubset(ptr->getKey(),(ptr->getNext())->getKey())) - ptr->setNextEQ(ptr->getNext()); - } - - - // now clean up by adding smart search termination strings: - // if you are already a superset of the previous suffix - // but not a subset of the next, search can end here - // so set NextNE properly - - ptr = sStart[i]; - for (; ptr != NULL; ptr = ptr->getNext()) { - SfxEntry * nptr = ptr->getNext(); - SfxEntry * mptr = NULL; - for (; nptr != NULL; nptr = nptr->getNext()) { - if (! isSubset(ptr->getKey(),nptr->getKey())) break; - mptr = nptr; - } - if (mptr) mptr->setNextNE(NULL); - } - } - return 0; -} - -// add flags to the result for dictionary debugging -void AffixMgr::debugflag(char * result, unsigned short flag) { - char * st = encode_flag(flag); - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, MORPH_FLAG, MAXLNLEN); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } -} - -// calculate the character length of the condition -int AffixMgr::condlen(char * st) -{ - int l = 0; - bool group = false; - for(; *st; st++) { - if (*st == '[') { - group = true; - l++; - } else if (*st == ']') group = false; - else if (!group && (!utf8 || - (!(*st & 0x80) || ((*st & 0xc0) == 0x80)))) l++; - } - return l; -} - -int AffixMgr::encodeit(affentry &entry, char * cs) -{ - if (strcmp(cs,".") != 0) { - entry.numconds = (char) condlen(cs); - strncpy(entry.c.conds, cs, MAXCONDLEN); - // long condition (end of conds padded by strncpy) - if (entry.c.conds[MAXCONDLEN - 1] && cs[MAXCONDLEN]) { - entry.opts += aeLONGCOND; - entry.c.l.conds2 = mystrdup(cs + MAXCONDLEN_1); - if (!entry.c.l.conds2) return 1; - } - } else { - entry.numconds = 0; - entry.c.conds[0] = '\0'; - } - return 0; -} - -// return 1 if s1 is a leading subset of s2 (dots are for infixes) -inline int AffixMgr::isSubset(const char * s1, const char * s2) - { - while (((*s1 == *s2) || (*s1 == '.')) && (*s1 != '\0')) { - s1++; - s2++; - } - return (*s1 == '\0'); - } - - -// check word for prefixes -struct hentry * AffixMgr::prefix_check(const char * word, int len, char in_compound, - const FLAG needflag) -{ - struct hentry * rv= NULL; - - pfx = NULL; - pfxappnd = NULL; - sfxappnd = NULL; - - // first handle the special case of 0 length prefixes - PfxEntry * pe = pStart[0]; - while (pe) { - if ( - // fogemorpheme - ((in_compound != IN_CPD_NOT) || !(pe->getCont() && - (TESTAFF(pe->getCont(), onlyincompound, pe->getContLen())))) && - // permit prefixes in compounds - ((in_compound != IN_CPD_END) || (pe->getCont() && - (TESTAFF(pe->getCont(), compoundpermitflag, pe->getContLen())))) - ) { - // check prefix - rv = pe->checkword(word, len, in_compound, needflag); - if (rv) { - pfx=pe; // BUG: pfx not stateless - return rv; - } - } - pe = pe->getNext(); - } - - // now handle the general case - unsigned char sp = *((const unsigned char *)word); - PfxEntry * pptr = pStart[sp]; - - while (pptr) { - if (isSubset(pptr->getKey(),word)) { - if ( - // fogemorpheme - ((in_compound != IN_CPD_NOT) || !(pptr->getCont() && - (TESTAFF(pptr->getCont(), onlyincompound, pptr->getContLen())))) && - // permit prefixes in compounds - ((in_compound != IN_CPD_END) || (pptr->getCont() && - (TESTAFF(pptr->getCont(), compoundpermitflag, pptr->getContLen())))) - ) { - // check prefix - rv = pptr->checkword(word, len, in_compound, needflag); - if (rv) { - pfx=pptr; // BUG: pfx not stateless - return rv; - } - } - pptr = pptr->getNextEQ(); - } else { - pptr = pptr->getNextNE(); - } - } - - return NULL; -} - -// check word for prefixes -struct hentry * AffixMgr::prefix_check_twosfx(const char * word, int len, - char in_compound, const FLAG needflag) -{ - struct hentry * rv= NULL; - - pfx = NULL; - sfxappnd = NULL; - - // first handle the special case of 0 length prefixes - PfxEntry * pe = pStart[0]; - - while (pe) { - rv = pe->check_twosfx(word, len, in_compound, needflag); - if (rv) return rv; - pe = pe->getNext(); - } - - // now handle the general case - unsigned char sp = *((const unsigned char *)word); - PfxEntry * pptr = pStart[sp]; - - while (pptr) { - if (isSubset(pptr->getKey(),word)) { - rv = pptr->check_twosfx(word, len, in_compound, needflag); - if (rv) { - pfx = pptr; - return rv; - } - pptr = pptr->getNextEQ(); - } else { - pptr = pptr->getNextNE(); - } - } - - return NULL; -} - -// check word for prefixes -char * AffixMgr::prefix_check_morph(const char * word, int len, char in_compound, - const FLAG needflag) -{ - char * st; - - char result[MAXLNLEN]; - result[0] = '\0'; - - pfx = NULL; - sfxappnd = NULL; - - // first handle the special case of 0 length prefixes - PfxEntry * pe = pStart[0]; - while (pe) { - st = pe->check_morph(word,len,in_compound, needflag); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - // if (rv) return rv; - pe = pe->getNext(); - } - - // now handle the general case - unsigned char sp = *((const unsigned char *)word); - PfxEntry * pptr = pStart[sp]; - - while (pptr) { - if (isSubset(pptr->getKey(),word)) { - st = pptr->check_morph(word,len,in_compound, needflag); - if (st) { - // fogemorpheme - if ((in_compound != IN_CPD_NOT) || !((pptr->getCont() && - (TESTAFF(pptr->getCont(), onlyincompound, pptr->getContLen()))))) { - mystrcat(result, st, MAXLNLEN); - pfx = pptr; - } - free(st); - } - pptr = pptr->getNextEQ(); - } else { - pptr = pptr->getNextNE(); - } - } - - if (*result) return mystrdup(result); - return NULL; -} - - -// check word for prefixes -char * AffixMgr::prefix_check_twosfx_morph(const char * word, int len, - char in_compound, const FLAG needflag) -{ - char * st; - - char result[MAXLNLEN]; - result[0] = '\0'; - - pfx = NULL; - sfxappnd = NULL; - - // first handle the special case of 0 length prefixes - PfxEntry * pe = pStart[0]; - while (pe) { - st = pe->check_twosfx_morph(word,len,in_compound, needflag); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - pe = pe->getNext(); - } - - // now handle the general case - unsigned char sp = *((const unsigned char *)word); - PfxEntry * pptr = pStart[sp]; - - while (pptr) { - if (isSubset(pptr->getKey(),word)) { - st = pptr->check_twosfx_morph(word, len, in_compound, needflag); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - pfx = pptr; - } - pptr = pptr->getNextEQ(); - } else { - pptr = pptr->getNextNE(); - } - } - - if (*result) return mystrdup(result); - return NULL; -} - -// Is word a non compound with a REP substitution (see checkcompoundrep)? -int AffixMgr::cpdrep_check(const char * word, int wl) -{ - char candidate[MAXLNLEN]; - const char * r; - int lenr, lenp; - - if ((wl < 2) || !numrep) return 0; - - for (int i=0; i < numrep; i++ ) { - r = word; - lenr = strlen(reptable[i].pattern2); - lenp = strlen(reptable[i].pattern); - // search every occurence of the pattern in the word - while ((r=strstr(r, reptable[i].pattern)) != NULL) { - strcpy(candidate, word); - if (r-word + lenr + strlen(r+lenp) >= MAXLNLEN) break; - strcpy(candidate+(r-word),reptable[i].pattern2); - strcpy(candidate+(r-word)+lenr, r+lenp); - if (candidate_check(candidate,strlen(candidate))) return 1; - r++; // search for the next letter - } - } - return 0; -} - -// forbid compoundings when there are special patterns at word bound -int AffixMgr::cpdpat_check(const char * word, int pos, hentry * r1, hentry * r2, const char /*affixed*/) -{ - int len; - for (int i = 0; i < numcheckcpd; i++) { - if (isSubset(checkcpdtable[i].pattern2, word + pos) && - (!r1 || !checkcpdtable[i].cond || - (r1->astr && TESTAFF(r1->astr, checkcpdtable[i].cond, r1->alen))) && - (!r2 || !checkcpdtable[i].cond2 || - (r2->astr && TESTAFF(r2->astr, checkcpdtable[i].cond2, r2->alen))) && - // zero length pattern => only TESTAFF - // zero pattern (0/flag) => unmodified stem (zero affixes allowed) - (!*(checkcpdtable[i].pattern) || ( - (*(checkcpdtable[i].pattern)=='0' && r1->blen <= pos && strncmp(word + pos - r1->blen, r1->word, r1->blen) == 0) || - (*(checkcpdtable[i].pattern)!='0' && ((len = strlen(checkcpdtable[i].pattern)) != 0) && - strncmp(word + pos - len, checkcpdtable[i].pattern, len) == 0)))) { - return 1; - } - } - return 0; -} - -// forbid compounding with neighbouring upper and lower case characters at word bounds -int AffixMgr::cpdcase_check(const char * word, int pos) -{ - if (utf8) { - w_char u, w; - const char * p; - u8_u16(&u, 1, word + pos); - for (p = word + pos - 1; (*p & 0xc0) == 0x80; p--); - u8_u16(&w, 1, p); - unsigned short a = (u.h << 8) + u.l; - unsigned short b = (w.h << 8) + w.l; - if (((unicodetoupper(a, langnum) == a) || (unicodetoupper(b, langnum) == b)) && - (a != '-') && (b != '-')) return 1; - } else { - unsigned char a = *(word + pos - 1); - unsigned char b = *(word + pos); - if ((csconv[a].ccase || csconv[b].ccase) && (a != '-') && (b != '-')) return 1; - } - return 0; -} - -// check compound patterns -int AffixMgr::defcpd_check(hentry *** words, short wnum, hentry * rv, hentry ** def, char all) -{ - signed short btpp[MAXWORDLEN]; // metacharacter (*, ?) positions for backtracking - signed short btwp[MAXWORDLEN]; // word positions for metacharacters - int btnum[MAXWORDLEN]; // number of matched characters in metacharacter positions - short bt = 0; - int i, j; - int ok; - int w = 0; - - if (!*words) { - w = 1; - *words = def; - } - - if (!*words) { - return 0; - } - - (*words)[wnum] = rv; - - // has the last word COMPOUNDRULE flag? - if (rv->alen == 0) { - (*words)[wnum] = NULL; - if (w) *words = NULL; - return 0; - } - ok = 0; - for (i = 0; i < numdefcpd; i++) { - for (j = 0; j < defcpdtable[i].len; j++) { - if (defcpdtable[i].def[j] != '*' && defcpdtable[i].def[j] != '?' && - TESTAFF(rv->astr, defcpdtable[i].def[j], rv->alen)) { - ok = 1; - break; - } - } - } - if (ok == 0) { - (*words)[wnum] = NULL; - if (w) *words = NULL; - return 0; - } - - for (i = 0; i < numdefcpd; i++) { - signed short pp = 0; // pattern position - signed short wp = 0; // "words" position - int ok2; - ok = 1; - ok2 = 1; - do { - while ((pp < defcpdtable[i].len) && (wp <= wnum)) { - if (((pp+1) < defcpdtable[i].len) && - ((defcpdtable[i].def[pp+1] == '*') || (defcpdtable[i].def[pp+1] == '?'))) { - int wend = (defcpdtable[i].def[pp+1] == '?') ? wp : wnum; - ok2 = 1; - pp+=2; - btpp[bt] = pp; - btwp[bt] = wp; - while (wp <= wend) { - if (!(*words)[wp]->alen || - !TESTAFF((*words)[wp]->astr, defcpdtable[i].def[pp-2], (*words)[wp]->alen)) { - ok2 = 0; - break; - } - wp++; - } - if (wp <= wnum) ok2 = 0; - btnum[bt] = wp - btwp[bt]; - if (btnum[bt] > 0) bt++; - if (ok2) break; - } else { - ok2 = 1; - if (!(*words)[wp] || !(*words)[wp]->alen || - !TESTAFF((*words)[wp]->astr, defcpdtable[i].def[pp], (*words)[wp]->alen)) { - ok = 0; - break; - } - pp++; - wp++; - if ((defcpdtable[i].len == pp) && !(wp > wnum)) ok = 0; - } - } - if (ok && ok2) { - int r = pp; - while ((defcpdtable[i].len > r) && ((r+1) < defcpdtable[i].len) && - ((defcpdtable[i].def[r+1] == '*') || (defcpdtable[i].def[r+1] == '?'))) r+=2; - if (defcpdtable[i].len <= r) return 1; - } - // backtrack - if (bt) do { - ok = 1; - btnum[bt - 1]--; - pp = btpp[bt - 1]; - wp = btwp[bt - 1] + (signed short) btnum[bt - 1]; - } while ((btnum[bt - 1] < 0) && --bt); - } while (bt); - - if (ok && ok2 && (!all || (defcpdtable[i].len <= pp))) return 1; - - // check zero ending - while (ok && ok2 && (defcpdtable[i].len > pp) && ((pp+1) < defcpdtable[i].len) && - ((defcpdtable[i].def[pp+1] == '*') || (defcpdtable[i].def[pp+1] == '?'))) pp+=2; - if (ok && ok2 && (defcpdtable[i].len <= pp)) return 1; - } - (*words)[wnum] = NULL; - if (w) *words = NULL; - return 0; -} - -inline int AffixMgr::candidate_check(const char * word, int len) -{ - struct hentry * rv=NULL; - - rv = lookup(word); - if (rv) return 1; - -// rv = prefix_check(word,len,1); -// if (rv) return 1; - - rv = affix_check(word,len); - if (rv) return 1; - return 0; -} - -// calculate number of syllable for compound-checking -short AffixMgr::get_syllable(const char * word, int wlen) -{ - if (cpdmaxsyllable==0) return 0; - - short num=0; - - if (!utf8) { - for (int i=0; i 0; i--) { - if (flag_bsearch((unsigned short *) cpdvowels_utf16, - ((unsigned short *) w)[i - 1], cpdvowels_utf16_len)) num++; - } - } - return num; -} - -void AffixMgr::setcminmax(int * cmin, int * cmax, const char * word, int len) { - if (utf8) { - int i; - for (*cmin = 0, i = 0; (i < cpdmin) && word[*cmin]; i++) { - for ((*cmin)++; (word[*cmin] & 0xc0) == 0x80; (*cmin)++); - } - for (*cmax = len, i = 0; (i < (cpdmin - 1)) && *cmax; i++) { - for ((*cmax)--; (word[*cmax] & 0xc0) == 0x80; (*cmax)--); - } - } else { - *cmin = cpdmin; - *cmax = len - cpdmin + 1; - } -} - - -// check if compound word is correctly spelled -// hu_mov_rule = spec. Hungarian rule (XXX) -struct hentry * AffixMgr::compound_check(const char * word, int len, - short wordnum, short numsyllable, short maxwordnum, short wnum, hentry ** words = NULL, - char hu_mov_rule = 0, char is_sug = 0, int * info = NULL) -{ - int i; - short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2; - struct hentry * rv = NULL; - struct hentry * rv_first; - struct hentry * rwords[MAXWORDLEN]; // buffer for COMPOUND pattern checking - char st [MAXWORDUTF8LEN + 4]; - char ch = '\0'; - int cmin; - int cmax; - int striple = 0; - int scpd = 0; - int soldi = 0; - int oldcmin = 0; - int oldcmax = 0; - int oldlen = 0; - int checkedstriple = 0; - int onlycpdrule; - char affixed = 0; - hentry ** oldwords = words; - - int checked_prefix; - - setcminmax(&cmin, &cmax, word, len); - - strcpy(st, word); - - for (i = cmin; i < cmax; i++) { - // go to end of the UTF-8 character - if (utf8) { - for (; (st[i] & 0xc0) == 0x80; i++); - if (i >= cmax) return NULL; - } - - words = oldwords; - onlycpdrule = (words) ? 1 : 0; - - do { // onlycpdrule loop - - oldnumsyllable = numsyllable; - oldwordnum = wordnum; - checked_prefix = 0; - - - do { // simplified checkcompoundpattern loop - - if (scpd > 0) { - for (; scpd <= numcheckcpd && (!checkcpdtable[scpd-1].pattern3 || - strncmp(word + i, checkcpdtable[scpd-1].pattern3, strlen(checkcpdtable[scpd-1].pattern3)) != 0); scpd++); - - if (scpd > numcheckcpd) break; // break simplified checkcompoundpattern loop - strcpy(st + i, checkcpdtable[scpd-1].pattern); - soldi = i; - i += strlen(checkcpdtable[scpd-1].pattern); - strcpy(st + i, checkcpdtable[scpd-1].pattern2); - strcpy(st + i + strlen(checkcpdtable[scpd-1].pattern2), word + soldi + strlen(checkcpdtable[scpd-1].pattern3)); - - oldlen = len; - len += strlen(checkcpdtable[scpd-1].pattern) + strlen(checkcpdtable[scpd-1].pattern2) - strlen(checkcpdtable[scpd-1].pattern3); - oldcmin = cmin; - oldcmax = cmax; - setcminmax(&cmin, &cmax, st, len); - - cmax = len - cpdmin + 1; - } - - ch = st[i]; - st[i] = '\0'; - - sfx = NULL; - pfx = NULL; - - // FIRST WORD - - affixed = 1; - rv = lookup(st); // perhaps without prefix - - // search homonym with compound flag - while ((rv) && !hu_mov_rule && - ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) || - !((compoundflag && !words && !onlycpdrule && TESTAFF(rv->astr, compoundflag, rv->alen)) || - (compoundbegin && !wordnum && !onlycpdrule && - TESTAFF(rv->astr, compoundbegin, rv->alen)) || - (compoundmiddle && wordnum && !words && !onlycpdrule && - TESTAFF(rv->astr, compoundmiddle, rv->alen)) || - (numdefcpd && onlycpdrule && - ((!words && !wordnum && defcpd_check(&words, wnum, rv, (hentry **) &rwords, 0)) || - (words && defcpd_check(&words, wnum, rv, (hentry **) &rwords, 0))))) || - (scpd != 0 && checkcpdtable[scpd-1].cond != FLAG_NULL && - !TESTAFF(rv->astr, checkcpdtable[scpd-1].cond, rv->alen))) - ) { - rv = rv->next_homonym; - } - - if (rv) affixed = 0; - - if (!rv) { - if (onlycpdrule) break; - if (compoundflag && - !(rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundflag))) { - if (((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, - FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || - (compoundmoresuffixes && (rv = suffix_check_twosfx(st, i, 0, NULL, compoundflag)))) && !hu_mov_rule && - sfx->getCont() && - ((compoundforbidflag && TESTAFF(sfx->getCont(), compoundforbidflag, - sfx->getContLen())) || (compoundend && - TESTAFF(sfx->getCont(), compoundend, - sfx->getContLen())))) { - rv = NULL; - } - } - - if (rv || - (((wordnum == 0) && compoundbegin && - ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || - (compoundmoresuffixes && (rv = suffix_check_twosfx(st, i, 0, NULL, compoundbegin))) || // twofold suffixes + compound - (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundbegin)))) || - ((wordnum > 0) && compoundmiddle && - ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || - (compoundmoresuffixes && (rv = suffix_check_twosfx(st, i, 0, NULL, compoundmiddle))) || // twofold suffixes + compound - (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundmiddle))))) - ) checked_prefix = 1; - // else check forbiddenwords and needaffix - } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) || - TESTAFF(rv->astr, needaffix, rv->alen) || - TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) || - (is_sug && nosuggest && TESTAFF(rv->astr, nosuggest, rv->alen)) - )) { - st[i] = ch; - //continue; - break; - } - - // check non_compound flag in suffix and prefix - if ((rv) && !hu_mov_rule && - ((pfx && pfx->getCont() && - TESTAFF(pfx->getCont(), compoundforbidflag, - pfx->getContLen())) || - (sfx && sfx->getCont() && - TESTAFF(sfx->getCont(), compoundforbidflag, - sfx->getContLen())))) { - rv = NULL; - } - - // check compoundend flag in suffix and prefix - if ((rv) && !checked_prefix && compoundend && !hu_mov_rule && - ((pfx && pfx->getCont() && - TESTAFF(pfx->getCont(), compoundend, - pfx->getContLen())) || - (sfx && sfx->getCont() && - TESTAFF(sfx->getCont(), compoundend, - sfx->getContLen())))) { - rv = NULL; - } - - // check compoundmiddle flag in suffix and prefix - if ((rv) && !checked_prefix && (wordnum==0) && compoundmiddle && !hu_mov_rule && - ((pfx && pfx->getCont() && - TESTAFF(pfx->getCont(), compoundmiddle, - pfx->getContLen())) || - (sfx && sfx->getCont() && - TESTAFF(sfx->getCont(), compoundmiddle, - sfx->getContLen())))) { - rv = NULL; - } - - // check forbiddenwords - if ((rv) && (rv->astr) && (TESTAFF(rv->astr, forbiddenword, rv->alen) || - TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) || - (is_sug && nosuggest && TESTAFF(rv->astr, nosuggest, rv->alen)))) { - return NULL; - } - - // increment word number, if the second root has a compoundroot flag - if ((rv) && compoundroot && - (TESTAFF(rv->astr, compoundroot, rv->alen))) { - wordnum++; - } - - // first word is acceptable in compound words? - if (((rv) && - ( checked_prefix || (words && words[wnum]) || - (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) || - ((oldwordnum == 0) && compoundbegin && TESTAFF(rv->astr, compoundbegin, rv->alen)) || - ((oldwordnum > 0) && compoundmiddle && TESTAFF(rv->astr, compoundmiddle, rv->alen))// || -// (numdefcpd && ) - -// LANG_hu section: spec. Hungarian rule - || ((langnum == LANG_hu) && hu_mov_rule && ( - TESTAFF(rv->astr, 'F', rv->alen) || // XXX hardwired Hungarian dictionary codes - TESTAFF(rv->astr, 'G', rv->alen) || - TESTAFF(rv->astr, 'H', rv->alen) - ) - ) -// END of LANG_hu section - ) && - ( - // test CHECKCOMPOUNDPATTERN conditions - scpd == 0 || checkcpdtable[scpd-1].cond == FLAG_NULL || - TESTAFF(rv->astr, checkcpdtable[scpd-1].cond, rv->alen) - ) - && ! (( checkcompoundtriple && scpd == 0 && !words && // test triple letters - (word[i-1]==word[i]) && ( - ((i>1) && (word[i-1]==word[i-2])) || - ((word[i-1]==word[i+1])) // may be word[i+1] == '\0' - ) - ) || - ( - checkcompoundcase && scpd == 0 && !words && cpdcase_check(word, i) - )) - ) -// LANG_hu section: spec. Hungarian rule - || ((!rv) && (langnum == LANG_hu) && hu_mov_rule && (rv = affix_check(st,i)) && - (sfx && sfx->getCont() && ( // XXX hardwired Hungarian dic. codes - TESTAFF(sfx->getCont(), (unsigned short) 'x', sfx->getContLen()) || - TESTAFF(sfx->getCont(), (unsigned short) '%', sfx->getContLen()) - ) - ) - ) - ) { // first word is ok condition - -// LANG_hu section: spec. Hungarian rule - if (langnum == LANG_hu) { - // calculate syllable number of the word - numsyllable += get_syllable(st, i); - // + 1 word, if syllable number of the prefix > 1 (hungarian convention) - if (pfx && (get_syllable(pfx->getKey(),strlen(pfx->getKey())) > 1)) wordnum++; - } -// END of LANG_hu section - - // NEXT WORD(S) - rv_first = rv; - st[i] = ch; - - do { // striple loop - - // check simplifiedtriple - if (simplifiedtriple) { - if (striple) { - checkedstriple = 1; - i--; // check "fahrt" instead of "ahrt" in "Schiffahrt" - } else if (i > 2 && *(word+i - 1) == *(word + i - 2)) striple = 1; - } - - rv = lookup((st+i)); // perhaps without prefix - - // search homonym with compound flag - while ((rv) && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) || - !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) || - (compoundend && !words && TESTAFF(rv->astr, compoundend, rv->alen)) || - (numdefcpd && words && defcpd_check(&words, wnum + 1, rv, NULL,1))) || - (scpd != 0 && checkcpdtable[scpd-1].cond2 != FLAG_NULL && - !TESTAFF(rv->astr, checkcpdtable[scpd-1].cond2, rv->alen)) - )) { - rv = rv->next_homonym; - } - - // check FORCEUCASE - if (rv && forceucase && (rv) && - (TESTAFF(rv->astr, forceucase, rv->alen)) && !(info && *info & SPELL_ORIGCAP)) rv = NULL; - - if (rv && words && words[wnum + 1]) return rv_first; - - oldnumsyllable2 = numsyllable; - oldwordnum2 = wordnum; - - -// LANG_hu section: spec. Hungarian rule, XXX hardwired dictionary code - if ((rv) && (langnum == LANG_hu) && (TESTAFF(rv->astr, 'I', rv->alen)) && !(TESTAFF(rv->astr, 'J', rv->alen))) { - numsyllable--; - } -// END of LANG_hu section - - // increment word number, if the second root has a compoundroot flag - if ((rv) && (compoundroot) && - (TESTAFF(rv->astr, compoundroot, rv->alen))) { - wordnum++; - } - - // check forbiddenwords - if ((rv) && (rv->astr) && (TESTAFF(rv->astr, forbiddenword, rv->alen) || - TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) || - (is_sug && nosuggest && TESTAFF(rv->astr, nosuggest, rv->alen)))) return NULL; - - // second word is acceptable, as a root? - // hungarian conventions: compounding is acceptable, - // when compound forms consist of 2 words, or if more, - // then the syllable number of root words must be 6, or lesser. - - if ((rv) && ( - (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) || - (compoundend && TESTAFF(rv->astr, compoundend, rv->alen)) - ) - && ( - ((cpdwordmax==-1) || (wordnum+1clen)<=cpdmaxsyllable)) - ) && - ( - // test CHECKCOMPOUNDPATTERN - !numcheckcpd || scpd != 0 || !cpdpat_check(word, i, rv_first, rv, 0) - ) && - ( - (!checkcompounddup || (rv != rv_first)) - ) - // test CHECKCOMPOUNDPATTERN conditions - && (scpd == 0 || checkcpdtable[scpd-1].cond2 == FLAG_NULL || - TESTAFF(rv->astr, checkcpdtable[scpd-1].cond2, rv->alen)) - ) - { - // forbid compound word, if it is a non compound word with typical fault - if (checkcompoundrep && cpdrep_check(word,len)) return NULL; - return rv_first; - } - - numsyllable = oldnumsyllable2; - wordnum = oldwordnum2; - - // perhaps second word has prefix or/and suffix - sfx = NULL; - sfxflag = FLAG_NULL; - rv = (compoundflag && !onlycpdrule) ? affix_check((word+i),strlen(word+i), compoundflag, IN_CPD_END) : NULL; - if (!rv && compoundend && !onlycpdrule) { - sfx = NULL; - pfx = NULL; - rv = affix_check((word+i),strlen(word+i), compoundend, IN_CPD_END); - } - - if (!rv && numdefcpd && words) { - rv = affix_check((word+i),strlen(word+i), 0, IN_CPD_END); - if (rv && defcpd_check(&words, wnum + 1, rv, NULL, 1)) return rv_first; - rv = NULL; - } - - // test CHECKCOMPOUNDPATTERN conditions (allowed forms) - if (rv && !(scpd == 0 || checkcpdtable[scpd-1].cond2 == FLAG_NULL || - TESTAFF(rv->astr, checkcpdtable[scpd-1].cond2, rv->alen))) rv = NULL; - - // test CHECKCOMPOUNDPATTERN conditions (forbidden compounds) - if (rv && numcheckcpd && scpd == 0 && cpdpat_check(word, i, rv_first, rv, affixed)) rv = NULL; - - // check non_compound flag in suffix and prefix - if ((rv) && - ((pfx && pfx->getCont() && - TESTAFF(pfx->getCont(), compoundforbidflag, - pfx->getContLen())) || - (sfx && sfx->getCont() && - TESTAFF(sfx->getCont(), compoundforbidflag, - sfx->getContLen())))) { - rv = NULL; - } - - // check FORCEUCASE - if (rv && forceucase && (rv) && - (TESTAFF(rv->astr, forceucase, rv->alen)) && !(info && *info & SPELL_ORIGCAP)) rv = NULL; - - // check forbiddenwords - if ((rv) && (rv->astr) && (TESTAFF(rv->astr, forbiddenword, rv->alen) || - TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) || - (is_sug && nosuggest && TESTAFF(rv->astr, nosuggest, rv->alen)))) return NULL; - - // pfxappnd = prefix of word+i, or NULL - // calculate syllable number of prefix. - // hungarian convention: when syllable number of prefix is more, - // than 1, the prefix+word counts as two words. - - if (langnum == LANG_hu) { - // calculate syllable number of the word - numsyllable += get_syllable(word + i, strlen(word + i)); - - // - affix syllable num. - // XXX only second suffix (inflections, not derivations) - if (sfxappnd) { - char * tmp = myrevstrdup(sfxappnd); - numsyllable -= get_syllable(tmp, strlen(tmp)); - free(tmp); - } - - // + 1 word, if syllable number of the prefix > 1 (hungarian convention) - if (pfx && (get_syllable(pfx->getKey(),strlen(pfx->getKey())) > 1)) wordnum++; - - // increment syllable num, if last word has a SYLLABLENUM flag - // and the suffix is beginning `s' - - if (cpdsyllablenum) { - switch (sfxflag) { - case 'c': { numsyllable+=2; break; } - case 'J': { numsyllable += 1; break; } - case 'I': { if (rv && TESTAFF(rv->astr, 'J', rv->alen)) numsyllable += 1; break; } - } - } - } - - // increment word number, if the second word has a compoundroot flag - if ((rv) && (compoundroot) && - (TESTAFF(rv->astr, compoundroot, rv->alen))) { - wordnum++; - } - - // second word is acceptable, as a word with prefix or/and suffix? - // hungarian conventions: compounding is acceptable, - // when compound forms consist 2 word, otherwise - // the syllable number of root words is 6, or lesser. - if ((rv) && - ( - ((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) || - ((cpdmaxsyllable != 0) && - (numsyllable <= cpdmaxsyllable)) - ) - && ( - (!checkcompounddup || (rv != rv_first)) - )) { - // forbid compound word, if it is a non compound word with typical fault - if (checkcompoundrep && cpdrep_check(word, len)) return NULL; - return rv_first; - } - - numsyllable = oldnumsyllable2; - wordnum = oldwordnum2; - - // perhaps second word is a compound word (recursive call) - if (wordnum < maxwordnum) { - rv = compound_check((st+i),strlen(st+i), wordnum+1, - numsyllable, maxwordnum, wnum + 1, words, 0, is_sug, info); - - if (rv && numcheckcpd && ((scpd == 0 && cpdpat_check(word, i, rv_first, rv, affixed)) || - (scpd != 0 && !cpdpat_check(word, i, rv_first, rv, affixed)))) rv = NULL; - } else { - rv=NULL; - } - if (rv) { - // forbid compound word, if it is a non compound word with typical fault - if (checkcompoundrep || forbiddenword) { - struct hentry * rv2 = NULL; - - if (checkcompoundrep && cpdrep_check(word, len)) return NULL; - - // check first part - if (strncmp(rv->word, word + i, rv->blen) == 0) { - char r = *(st + i + rv->blen); - *(st + i + rv->blen) = '\0'; - - if (checkcompoundrep && cpdrep_check(st, i + rv->blen)) { - *(st + i + rv->blen) = r; - continue; - } - - if (forbiddenword) { - rv2 = lookup(word); - if (!rv2) rv2 = affix_check(word, len); - if (rv2 && rv2->astr && TESTAFF(rv2->astr, forbiddenword, rv2->alen) && - (strncmp(rv2->word, st, i + rv->blen) == 0)) { - return NULL; - } - } - *(st + i + rv->blen) = r; - } - } - return rv_first; - } - } while (striple && !checkedstriple); // end of striple loop - - if (checkedstriple) { - i++; - checkedstriple = 0; - striple = 0; - } - - } // first word is ok condition - - if (soldi != 0) { - i = soldi; - soldi = 0; - len = oldlen; - cmin = oldcmin; - cmax = oldcmax; - } - scpd++; - - - } while (!onlycpdrule && simplifiedcpd && scpd <= numcheckcpd); // end of simplifiedcpd loop - - scpd = 0; - wordnum = oldwordnum; - numsyllable = oldnumsyllable; - - if (soldi != 0) { - i = soldi; - strcpy(st, word); // XXX add more optim. - soldi = 0; - } else st[i] = ch; - - } while (numdefcpd && oldwordnum == 0 && !onlycpdrule && (onlycpdrule = 1)); // end of onlycpd loop - - } - - return NULL; -} - -// check if compound word is correctly spelled -// hu_mov_rule = spec. Hungarian rule (XXX) -int AffixMgr::compound_check_morph(const char * word, int len, - short wordnum, short numsyllable, short maxwordnum, short wnum, hentry ** words, - char hu_mov_rule = 0, char ** result = NULL, char * partresult = NULL) -{ - int i; - short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2; - int ok = 0; - - struct hentry * rv = NULL; - struct hentry * rv_first; - struct hentry * rwords[MAXWORDLEN]; // buffer for COMPOUND pattern checking - char st [MAXWORDUTF8LEN + 4]; - char ch; - - int checked_prefix; - char presult[MAXLNLEN]; - - int cmin; - int cmax; - - int onlycpdrule; - char affixed = 0; - hentry ** oldwords = words; - - setcminmax(&cmin, &cmax, word, len); - - strcpy(st, word); - - for (i = cmin; i < cmax; i++) { - oldnumsyllable = numsyllable; - oldwordnum = wordnum; - checked_prefix = 0; - - // go to end of the UTF-8 character - if (utf8) { - for (; (st[i] & 0xc0) == 0x80; i++); - if (i >= cmax) return 0; - } - - words = oldwords; - onlycpdrule = (words) ? 1 : 0; - - do { // onlycpdrule loop - - oldnumsyllable = numsyllable; - oldwordnum = wordnum; - checked_prefix = 0; - - ch = st[i]; - st[i] = '\0'; - sfx = NULL; - - // FIRST WORD - - affixed = 1; - - *presult = '\0'; - if (partresult) mystrcat(presult, partresult, MAXLNLEN); - - rv = lookup(st); // perhaps without prefix - - // search homonym with compound flag - while ((rv) && !hu_mov_rule && - ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) || - !((compoundflag && !words && !onlycpdrule && TESTAFF(rv->astr, compoundflag, rv->alen)) || - (compoundbegin && !wordnum && !onlycpdrule && - TESTAFF(rv->astr, compoundbegin, rv->alen)) || - (compoundmiddle && wordnum && !words && !onlycpdrule && - TESTAFF(rv->astr, compoundmiddle, rv->alen)) || - (numdefcpd && onlycpdrule && - ((!words && !wordnum && defcpd_check(&words, wnum, rv, (hentry **) &rwords, 0)) || - (words && defcpd_check(&words, wnum, rv, (hentry **) &rwords, 0)))) - ))) { - rv = rv->next_homonym; - } - - if (rv) affixed = 0; - - if (rv) { - sprintf(presult + strlen(presult), "%c%s%s", MSEP_FLD, MORPH_PART, st); - if (!HENTRY_FIND(rv, MORPH_STEM)) { - sprintf(presult + strlen(presult), "%c%s%s", MSEP_FLD, MORPH_STEM, st); - } - // store the pointer of the hash entry -// sprintf(presult + strlen(presult), "%c%s%p", MSEP_FLD, MORPH_HENTRY, rv); - if (HENTRY_DATA(rv)) { - sprintf(presult + strlen(presult), "%c%s", MSEP_FLD, HENTRY_DATA2(rv)); - } - } - - if (!rv) { - if (onlycpdrule && strlen(*result) > MAXLNLEN/10) break; - if (compoundflag && - !(rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundflag))) { - if (((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, - FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || - (compoundmoresuffixes && (rv = suffix_check_twosfx(st, i, 0, NULL, compoundflag)))) && !hu_mov_rule && - sfx->getCont() && - ((compoundforbidflag && TESTAFF(sfx->getCont(), compoundforbidflag, - sfx->getContLen())) || (compoundend && - TESTAFF(sfx->getCont(), compoundend, - sfx->getContLen())))) { - rv = NULL; - } - } - - if (rv || - (((wordnum == 0) && compoundbegin && - ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || - (compoundmoresuffixes && (rv = suffix_check_twosfx(st, i, 0, NULL, compoundbegin))) || // twofold suffix+compound - (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundbegin)))) || - ((wordnum > 0) && compoundmiddle && - ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || - (compoundmoresuffixes && (rv = suffix_check_twosfx(st, i, 0, NULL, compoundmiddle))) || // twofold suffix+compound - (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundmiddle))))) - ) { - // char * p = prefix_check_morph(st, i, 0, compound); - char * p = NULL; - if (compoundflag) p = affix_check_morph(st, i, compoundflag); - if (!p || (*p == '\0')) { - if (p) free(p); - p = NULL; - if ((wordnum == 0) && compoundbegin) { - p = affix_check_morph(st, i, compoundbegin); - } else if ((wordnum > 0) && compoundmiddle) { - p = affix_check_morph(st, i, compoundmiddle); - } - } - if (p && (*p != '\0')) { - sprintf(presult + strlen(presult), "%c%s%s%s", MSEP_FLD, - MORPH_PART, st, line_uniq_app(&p, MSEP_REC)); - } - if (p) free(p); - checked_prefix = 1; - } - // else check forbiddenwords - } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) || - TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) || - TESTAFF(rv->astr, needaffix, rv->alen))) { - st[i] = ch; - continue; - } - - // check non_compound flag in suffix and prefix - if ((rv) && !hu_mov_rule && - ((pfx && pfx->getCont() && - TESTAFF(pfx->getCont(), compoundforbidflag, - pfx->getContLen())) || - (sfx && sfx->getCont() && - TESTAFF(sfx->getCont(), compoundforbidflag, - sfx->getContLen())))) { - continue; - } - - // check compoundend flag in suffix and prefix - if ((rv) && !checked_prefix && compoundend && !hu_mov_rule && - ((pfx && pfx->getCont() && - TESTAFF(pfx->getCont(), compoundend, - pfx->getContLen())) || - (sfx && sfx->getCont() && - TESTAFF(sfx->getCont(), compoundend, - sfx->getContLen())))) { - continue; - } - - // check compoundmiddle flag in suffix and prefix - if ((rv) && !checked_prefix && (wordnum==0) && compoundmiddle && !hu_mov_rule && - ((pfx && pfx->getCont() && - TESTAFF(pfx->getCont(), compoundmiddle, - pfx->getContLen())) || - (sfx && sfx->getCont() && - TESTAFF(sfx->getCont(), compoundmiddle, - sfx->getContLen())))) { - rv = NULL; - } - - // check forbiddenwords - if ((rv) && (rv->astr) && (TESTAFF(rv->astr, forbiddenword, rv->alen) - || TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen))) continue; - - // increment word number, if the second root has a compoundroot flag - if ((rv) && (compoundroot) && - (TESTAFF(rv->astr, compoundroot, rv->alen))) { - wordnum++; - } - - // first word is acceptable in compound words? - if (((rv) && - ( checked_prefix || (words && words[wnum]) || - (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) || - ((oldwordnum == 0) && compoundbegin && TESTAFF(rv->astr, compoundbegin, rv->alen)) || - ((oldwordnum > 0) && compoundmiddle && TESTAFF(rv->astr, compoundmiddle, rv->alen)) -// LANG_hu section: spec. Hungarian rule - || ((langnum == LANG_hu) && // hu_mov_rule - hu_mov_rule && ( - TESTAFF(rv->astr, 'F', rv->alen) || - TESTAFF(rv->astr, 'G', rv->alen) || - TESTAFF(rv->astr, 'H', rv->alen) - ) - ) -// END of LANG_hu section - ) - && ! (( checkcompoundtriple && !words && // test triple letters - (word[i-1]==word[i]) && ( - ((i>1) && (word[i-1]==word[i-2])) || - ((word[i-1]==word[i+1])) // may be word[i+1] == '\0' - ) - ) || - ( - // test CHECKCOMPOUNDPATTERN - numcheckcpd && !words && cpdpat_check(word, i, rv, NULL, affixed) - ) || - ( - checkcompoundcase && !words && cpdcase_check(word, i) - )) - ) -// LANG_hu section: spec. Hungarian rule - || ((!rv) && (langnum == LANG_hu) && hu_mov_rule && (rv = affix_check(st,i)) && - (sfx && sfx->getCont() && ( - TESTAFF(sfx->getCont(), (unsigned short) 'x', sfx->getContLen()) || - TESTAFF(sfx->getCont(), (unsigned short) '%', sfx->getContLen()) - ) - ) - ) -// END of LANG_hu section - ) { - -// LANG_hu section: spec. Hungarian rule - if (langnum == LANG_hu) { - // calculate syllable number of the word - numsyllable += get_syllable(st, i); - - // + 1 word, if syllable number of the prefix > 1 (hungarian convention) - if (pfx && (get_syllable(pfx->getKey(),strlen(pfx->getKey())) > 1)) wordnum++; - } -// END of LANG_hu section - - // NEXT WORD(S) - rv_first = rv; - rv = lookup((word+i)); // perhaps without prefix - - // search homonym with compound flag - while ((rv) && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) || - !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) || - (compoundend && !words && TESTAFF(rv->astr, compoundend, rv->alen)) || - (numdefcpd && words && defcpd_check(&words, wnum + 1, rv, NULL,1))))) { - rv = rv->next_homonym; - } - - if (rv && words && words[wnum + 1]) { - mystrcat(*result, presult, MAXLNLEN); - mystrcat(*result, " ", MAXLNLEN); - mystrcat(*result, MORPH_PART, MAXLNLEN); - mystrcat(*result, word+i, MAXLNLEN); - if (complexprefixes && HENTRY_DATA(rv)) mystrcat(*result, HENTRY_DATA2(rv), MAXLNLEN); - if (!HENTRY_FIND(rv, MORPH_STEM)) { - mystrcat(*result, " ", MAXLNLEN); - mystrcat(*result, MORPH_STEM, MAXLNLEN); - mystrcat(*result, HENTRY_WORD(rv), MAXLNLEN); - } - // store the pointer of the hash entry -// sprintf(*result + strlen(*result), " %s%p", MORPH_HENTRY, rv); - if (!complexprefixes && HENTRY_DATA(rv)) { - mystrcat(*result, " ", MAXLNLEN); - mystrcat(*result, HENTRY_DATA2(rv), MAXLNLEN); - } - mystrcat(*result, "\n", MAXLNLEN); - ok = 1; - return 0; - } - - oldnumsyllable2 = numsyllable; - oldwordnum2 = wordnum; - -// LANG_hu section: spec. Hungarian rule - if ((rv) && (langnum == LANG_hu) && (TESTAFF(rv->astr, 'I', rv->alen)) && !(TESTAFF(rv->astr, 'J', rv->alen))) { - numsyllable--; - } -// END of LANG_hu section - // increment word number, if the second root has a compoundroot flag - if ((rv) && (compoundroot) && - (TESTAFF(rv->astr, compoundroot, rv->alen))) { - wordnum++; - } - - // check forbiddenwords - if ((rv) && (rv->astr) && (TESTAFF(rv->astr, forbiddenword, rv->alen) || - TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen))) { - st[i] = ch; - continue; - } - - // second word is acceptable, as a root? - // hungarian conventions: compounding is acceptable, - // when compound forms consist of 2 words, or if more, - // then the syllable number of root words must be 6, or lesser. - if ((rv) && ( - (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) || - (compoundend && TESTAFF(rv->astr, compoundend, rv->alen)) - ) - && ( - ((cpdwordmax==-1) || (wordnum+1blen)<=cpdmaxsyllable)) - ) - && ( - (!checkcompounddup || (rv != rv_first)) - ) - ) - { - // bad compound word - mystrcat(*result, presult, MAXLNLEN); - mystrcat(*result, " ", MAXLNLEN); - mystrcat(*result, MORPH_PART, MAXLNLEN); - mystrcat(*result, word+i, MAXLNLEN); - - if (HENTRY_DATA(rv)) { - if (complexprefixes) mystrcat(*result, HENTRY_DATA2(rv), MAXLNLEN); - if (! HENTRY_FIND(rv, MORPH_STEM)) { - mystrcat(*result, " ", MAXLNLEN); - mystrcat(*result, MORPH_STEM, MAXLNLEN); - mystrcat(*result, HENTRY_WORD(rv), MAXLNLEN); - } - // store the pointer of the hash entry -// sprintf(*result + strlen(*result), " %s%p", MORPH_HENTRY, rv); - if (!complexprefixes) { - mystrcat(*result, " ", MAXLNLEN); - mystrcat(*result, HENTRY_DATA2(rv), MAXLNLEN); - } - } - mystrcat(*result, "\n", MAXLNLEN); - ok = 1; - } - - numsyllable = oldnumsyllable2 ; - wordnum = oldwordnum2; - - // perhaps second word has prefix or/and suffix - sfx = NULL; - sfxflag = FLAG_NULL; - - if (compoundflag && !onlycpdrule) rv = affix_check((word+i),strlen(word+i), compoundflag); else rv = NULL; - - if (!rv && compoundend && !onlycpdrule) { - sfx = NULL; - pfx = NULL; - rv = affix_check((word+i),strlen(word+i), compoundend); - } - - if (!rv && numdefcpd && words) { - rv = affix_check((word+i),strlen(word+i), 0, IN_CPD_END); - if (rv && words && defcpd_check(&words, wnum + 1, rv, NULL, 1)) { - char * m = NULL; - if (compoundflag) m = affix_check_morph((word+i),strlen(word+i), compoundflag); - if ((!m || *m == '\0') && compoundend) { - if (m) free(m); - m = affix_check_morph((word+i),strlen(word+i), compoundend); - } - mystrcat(*result, presult, MAXLNLEN); - if (m || (*m != '\0')) { - sprintf(*result + strlen(*result), "%c%s%s%s", MSEP_FLD, - MORPH_PART, word + i, line_uniq_app(&m, MSEP_REC)); - } - if (m) free(m); - mystrcat(*result, "\n", MAXLNLEN); - ok = 1; - } - } - - // check non_compound flag in suffix and prefix - if ((rv) && - ((pfx && pfx->getCont() && - TESTAFF(pfx->getCont(), compoundforbidflag, - pfx->getContLen())) || - (sfx && sfx->getCont() && - TESTAFF(sfx->getCont(), compoundforbidflag, - sfx->getContLen())))) { - rv = NULL; - } - - // check forbiddenwords - if ((rv) && (rv->astr) && (TESTAFF(rv->astr,forbiddenword,rv->alen) || - TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen)) - && (! TESTAFF(rv->astr, needaffix, rv->alen))) { - st[i] = ch; - continue; - } - - if (langnum == LANG_hu) { - // calculate syllable number of the word - numsyllable += get_syllable(word + i, strlen(word + i)); - - // - affix syllable num. - // XXX only second suffix (inflections, not derivations) - if (sfxappnd) { - char * tmp = myrevstrdup(sfxappnd); - numsyllable -= get_syllable(tmp, strlen(tmp)); - free(tmp); - } - - // + 1 word, if syllable number of the prefix > 1 (hungarian convention) - if (pfx && (get_syllable(pfx->getKey(),strlen(pfx->getKey())) > 1)) wordnum++; - - // increment syllable num, if last word has a SYLLABLENUM flag - // and the suffix is beginning `s' - - if (cpdsyllablenum) { - switch (sfxflag) { - case 'c': { numsyllable+=2; break; } - case 'J': { numsyllable += 1; break; } - case 'I': { if (rv && TESTAFF(rv->astr, 'J', rv->alen)) numsyllable += 1; break; } - } - } - } - - // increment word number, if the second word has a compoundroot flag - if ((rv) && (compoundroot) && - (TESTAFF(rv->astr, compoundroot, rv->alen))) { - wordnum++; - } - // second word is acceptable, as a word with prefix or/and suffix? - // hungarian conventions: compounding is acceptable, - // when compound forms consist 2 word, otherwise - // the syllable number of root words is 6, or lesser. - if ((rv) && - ( - ((cpdwordmax==-1) || (wordnum+1 0) && *s1 && (*s1 == *end_of_s2)) { - s1++; - end_of_s2--; - len--; - } - return (*s1 == '\0'); - } - */ - -inline int AffixMgr::isRevSubset(const char * s1, const char * end_of_s2, int len) - { - while ((len > 0) && (*s1 != '\0') && ((*s1 == *end_of_s2) || (*s1 == '.'))) { - s1++; - end_of_s2--; - len--; - } - return (*s1 == '\0'); - } - -// check word for suffixes - -struct hentry * AffixMgr::suffix_check (const char * word, int len, - int sfxopts, PfxEntry * ppfx, char ** wlst, int maxSug, int * ns, - const FLAG cclass, const FLAG needflag, char in_compound) -{ - struct hentry * rv = NULL; - PfxEntry* ep = ppfx; - - // first handle the special case of 0 length suffixes - SfxEntry * se = sStart[0]; - - while (se) { - if (!cclass || se->getCont()) { - // suffixes are not allowed in beginning of compounds - if ((((in_compound != IN_CPD_BEGIN)) || // && !cclass - // except when signed with compoundpermitflag flag - (se->getCont() && compoundpermitflag && - TESTAFF(se->getCont(),compoundpermitflag,se->getContLen()))) && (!circumfix || - // no circumfix flag in prefix and suffix - ((!ppfx || !(ep->getCont()) || !TESTAFF(ep->getCont(), - circumfix, ep->getContLen())) && - (!se->getCont() || !(TESTAFF(se->getCont(),circumfix,se->getContLen())))) || - // circumfix flag in prefix AND suffix - ((ppfx && (ep->getCont()) && TESTAFF(ep->getCont(), - circumfix, ep->getContLen())) && - (se->getCont() && (TESTAFF(se->getCont(),circumfix,se->getContLen()))))) && - // fogemorpheme - (in_compound || - !(se->getCont() && (TESTAFF(se->getCont(), onlyincompound, se->getContLen())))) && - // needaffix on prefix or first suffix - (cclass || - !(se->getCont() && TESTAFF(se->getCont(), needaffix, se->getContLen())) || - (ppfx && !((ep->getCont()) && - TESTAFF(ep->getCont(), needaffix, - ep->getContLen()))) - )) { - rv = se->checkword(word,len, sfxopts, ppfx, wlst, maxSug, ns, (FLAG) cclass, - needflag, (in_compound ? 0 : onlyincompound)); - if (rv) { - sfx=se; // BUG: sfx not stateless - return rv; - } - } - } - se = se->getNext(); - } - - // now handle the general case - if (len == 0) return NULL; // FULLSTRIP - unsigned char sp= *((const unsigned char *)(word + len - 1)); - SfxEntry * sptr = sStart[sp]; - - while (sptr) { - if (isRevSubset(sptr->getKey(), word + len - 1, len) - ) { - // suffixes are not allowed in beginning of compounds - if ((((in_compound != IN_CPD_BEGIN)) || // && !cclass - // except when signed with compoundpermitflag flag - (sptr->getCont() && compoundpermitflag && - TESTAFF(sptr->getCont(),compoundpermitflag,sptr->getContLen()))) && (!circumfix || - // no circumfix flag in prefix and suffix - ((!ppfx || !(ep->getCont()) || !TESTAFF(ep->getCont(), - circumfix, ep->getContLen())) && - (!sptr->getCont() || !(TESTAFF(sptr->getCont(),circumfix,sptr->getContLen())))) || - // circumfix flag in prefix AND suffix - ((ppfx && (ep->getCont()) && TESTAFF(ep->getCont(), - circumfix, ep->getContLen())) && - (sptr->getCont() && (TESTAFF(sptr->getCont(),circumfix,sptr->getContLen()))))) && - // fogemorpheme - (in_compound || - !((sptr->getCont() && (TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen()))))) && - // needaffix on prefix or first suffix - (cclass || - !(sptr->getCont() && TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) || - (ppfx && !((ep->getCont()) && - TESTAFF(ep->getCont(), needaffix, - ep->getContLen()))) - ) - ) if (in_compound != IN_CPD_END || ppfx || !(sptr->getCont() && TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen()))) { - rv = sptr->checkword(word,len, sfxopts, ppfx, wlst, - maxSug, ns, cclass, needflag, (in_compound ? 0 : onlyincompound)); - if (rv) { - sfx=sptr; // BUG: sfx not stateless - sfxflag = sptr->getFlag(); // BUG: sfxflag not stateless - if (!sptr->getCont()) sfxappnd=sptr->getKey(); // BUG: sfxappnd not stateless - return rv; - } - } - sptr = sptr->getNextEQ(); - } else { - sptr = sptr->getNextNE(); - } - } - - return NULL; -} - -// check word for two-level suffixes - -struct hentry * AffixMgr::suffix_check_twosfx(const char * word, int len, - int sfxopts, PfxEntry * ppfx, const FLAG needflag) -{ - struct hentry * rv = NULL; - - // first handle the special case of 0 length suffixes - SfxEntry * se = sStart[0]; - while (se) { - if (contclasses[se->getFlag()]) - { - rv = se->check_twosfx(word,len, sfxopts, ppfx, needflag); - if (rv) return rv; - } - se = se->getNext(); - } - - // now handle the general case - if (len == 0) return NULL; // FULLSTRIP - unsigned char sp = *((const unsigned char *)(word + len - 1)); - SfxEntry * sptr = sStart[sp]; - - while (sptr) { - if (isRevSubset(sptr->getKey(), word + len - 1, len)) { - if (contclasses[sptr->getFlag()]) - { - rv = sptr->check_twosfx(word,len, sfxopts, ppfx, needflag); - if (rv) { - sfxflag = sptr->getFlag(); // BUG: sfxflag not stateless - if (!sptr->getCont()) sfxappnd=sptr->getKey(); // BUG: sfxappnd not stateless - return rv; - } - } - sptr = sptr->getNextEQ(); - } else { - sptr = sptr->getNextNE(); - } - } - - return NULL; -} - -char * AffixMgr::suffix_check_twosfx_morph(const char * word, int len, - int sfxopts, PfxEntry * ppfx, const FLAG needflag) -{ - char result[MAXLNLEN]; - char result2[MAXLNLEN]; - char result3[MAXLNLEN]; - - char * st; - - result[0] = '\0'; - result2[0] = '\0'; - result3[0] = '\0'; - - // first handle the special case of 0 length suffixes - SfxEntry * se = sStart[0]; - while (se) { - if (contclasses[se->getFlag()]) - { - st = se->check_twosfx_morph(word,len, sfxopts, ppfx, needflag); - if (st) { - if (ppfx) { - if (ppfx->getMorph()) { - mystrcat(result, ppfx->getMorph(), MAXLNLEN); - mystrcat(result, " ", MAXLNLEN); - } else debugflag(result, ppfx->getFlag()); - } - mystrcat(result, st, MAXLNLEN); - free(st); - if (se->getMorph()) { - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, se->getMorph(), MAXLNLEN); - } else debugflag(result, se->getFlag()); - mystrcat(result, "\n", MAXLNLEN); - } - } - se = se->getNext(); - } - - // now handle the general case - if (len == 0) return NULL; // FULLSTRIP - unsigned char sp = *((const unsigned char *)(word + len - 1)); - SfxEntry * sptr = sStart[sp]; - - while (sptr) { - if (isRevSubset(sptr->getKey(), word + len - 1, len)) { - if (contclasses[sptr->getFlag()]) - { - st = sptr->check_twosfx_morph(word,len, sfxopts, ppfx, needflag); - if (st) { - sfxflag = sptr->getFlag(); // BUG: sfxflag not stateless - if (!sptr->getCont()) sfxappnd=sptr->getKey(); // BUG: sfxappnd not stateless - strcpy(result2, st); - free(st); - - result3[0] = '\0'; - - if (sptr->getMorph()) { - mystrcat(result3, " ", MAXLNLEN); - mystrcat(result3, sptr->getMorph(), MAXLNLEN); - } else debugflag(result3, sptr->getFlag()); - strlinecat(result2, result3); - mystrcat(result2, "\n", MAXLNLEN); - mystrcat(result, result2, MAXLNLEN); - } - } - sptr = sptr->getNextEQ(); - } else { - sptr = sptr->getNextNE(); - } - } - if (*result) return mystrdup(result); - return NULL; -} - -char * AffixMgr::suffix_check_morph(const char * word, int len, - int sfxopts, PfxEntry * ppfx, const FLAG cclass, const FLAG needflag, char in_compound) -{ - char result[MAXLNLEN]; - - struct hentry * rv = NULL; - - result[0] = '\0'; - - PfxEntry* ep = ppfx; - - // first handle the special case of 0 length suffixes - SfxEntry * se = sStart[0]; - while (se) { - if (!cclass || se->getCont()) { - // suffixes are not allowed in beginning of compounds - if (((((in_compound != IN_CPD_BEGIN)) || // && !cclass - // except when signed with compoundpermitflag flag - (se->getCont() && compoundpermitflag && - TESTAFF(se->getCont(),compoundpermitflag,se->getContLen()))) && (!circumfix || - // no circumfix flag in prefix and suffix - ((!ppfx || !(ep->getCont()) || !TESTAFF(ep->getCont(), - circumfix, ep->getContLen())) && - (!se->getCont() || !(TESTAFF(se->getCont(),circumfix,se->getContLen())))) || - // circumfix flag in prefix AND suffix - ((ppfx && (ep->getCont()) && TESTAFF(ep->getCont(), - circumfix, ep->getContLen())) && - (se->getCont() && (TESTAFF(se->getCont(),circumfix,se->getContLen()))))) && - // fogemorpheme - (in_compound || - !((se->getCont() && (TESTAFF(se->getCont(), onlyincompound, se->getContLen()))))) && - // needaffix on prefix or first suffix - (cclass || - !(se->getCont() && TESTAFF(se->getCont(), needaffix, se->getContLen())) || - (ppfx && !((ep->getCont()) && - TESTAFF(ep->getCont(), needaffix, - ep->getContLen()))) - ) - )) - rv = se->checkword(word, len, sfxopts, ppfx, NULL, 0, 0, cclass, needflag); - while (rv) { - if (ppfx) { - if (ppfx->getMorph()) { - mystrcat(result, ppfx->getMorph(), MAXLNLEN); - mystrcat(result, " ", MAXLNLEN); - } else debugflag(result, ppfx->getFlag()); - } - if (complexprefixes && HENTRY_DATA(rv)) mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); - if (! HENTRY_FIND(rv, MORPH_STEM)) { - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, MORPH_STEM, MAXLNLEN); - mystrcat(result, HENTRY_WORD(rv), MAXLNLEN); - } - // store the pointer of the hash entry -// sprintf(result + strlen(result), " %s%p", MORPH_HENTRY, rv); - - if (!complexprefixes && HENTRY_DATA(rv)) { - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); - } - if (se->getMorph()) { - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, se->getMorph(), MAXLNLEN); - } else debugflag(result, se->getFlag()); - mystrcat(result, "\n", MAXLNLEN); - rv = se->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag); - } - } - se = se->getNext(); - } - - // now handle the general case - if (len == 0) return NULL; // FULLSTRIP - unsigned char sp = *((const unsigned char *)(word + len - 1)); - SfxEntry * sptr = sStart[sp]; - - while (sptr) { - if (isRevSubset(sptr->getKey(), word + len - 1, len) - ) { - // suffixes are not allowed in beginning of compounds - if (((((in_compound != IN_CPD_BEGIN)) || // && !cclass - // except when signed with compoundpermitflag flag - (sptr->getCont() && compoundpermitflag && - TESTAFF(sptr->getCont(),compoundpermitflag,sptr->getContLen()))) && (!circumfix || - // no circumfix flag in prefix and suffix - ((!ppfx || !(ep->getCont()) || !TESTAFF(ep->getCont(), - circumfix, ep->getContLen())) && - (!sptr->getCont() || !(TESTAFF(sptr->getCont(),circumfix,sptr->getContLen())))) || - // circumfix flag in prefix AND suffix - ((ppfx && (ep->getCont()) && TESTAFF(ep->getCont(), - circumfix, ep->getContLen())) && - (sptr->getCont() && (TESTAFF(sptr->getCont(),circumfix,sptr->getContLen()))))) && - // fogemorpheme - (in_compound || - !((sptr->getCont() && (TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen()))))) && - // needaffix on first suffix - (cclass || !(sptr->getCont() && - TESTAFF(sptr->getCont(), needaffix, sptr->getContLen()))) - )) rv = sptr->checkword(word,len, sfxopts, ppfx, NULL, 0, 0, cclass, needflag); - while (rv) { - if (ppfx) { - if (ppfx->getMorph()) { - mystrcat(result, ppfx->getMorph(), MAXLNLEN); - mystrcat(result, " ", MAXLNLEN); - } else debugflag(result, ppfx->getFlag()); - } - if (complexprefixes && HENTRY_DATA(rv)) mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); - if (! HENTRY_FIND(rv, MORPH_STEM)) { - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, MORPH_STEM, MAXLNLEN); - mystrcat(result, HENTRY_WORD(rv), MAXLNLEN); - } - // store the pointer of the hash entry -// sprintf(result + strlen(result), " %s%p", MORPH_HENTRY, rv); - - if (!complexprefixes && HENTRY_DATA(rv)) { - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); - } - - if (sptr->getMorph()) { - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, sptr->getMorph(), MAXLNLEN); - } else debugflag(result, sptr->getFlag()); - mystrcat(result, "\n", MAXLNLEN); - rv = sptr->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag); - } - sptr = sptr->getNextEQ(); - } else { - sptr = sptr->getNextNE(); - } - } - - if (*result) return mystrdup(result); - return NULL; -} - -// check if word with affixes is correctly spelled -struct hentry * AffixMgr::affix_check (const char * word, int len, const FLAG needflag, char in_compound) -{ - struct hentry * rv= NULL; - - // check all prefixes (also crossed with suffixes if allowed) - rv = prefix_check(word, len, in_compound, needflag); - if (rv) return rv; - - // if still not found check all suffixes - rv = suffix_check(word, len, 0, NULL, NULL, 0, NULL, FLAG_NULL, needflag, in_compound); - - if (havecontclass) { - sfx = NULL; - pfx = NULL; - - if (rv) return rv; - // if still not found check all two-level suffixes - rv = suffix_check_twosfx(word, len, 0, NULL, needflag); - - if (rv) return rv; - // if still not found check all two-level suffixes - rv = prefix_check_twosfx(word, len, IN_CPD_NOT, needflag); - } - - return rv; -} - -// check if word with affixes is correctly spelled -char * AffixMgr::affix_check_morph(const char * word, int len, const FLAG needflag, char in_compound) -{ - char result[MAXLNLEN]; - char * st = NULL; - - *result = '\0'; - - // check all prefixes (also crossed with suffixes if allowed) - st = prefix_check_morph(word, len, in_compound); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - - // if still not found check all suffixes - st = suffix_check_morph(word, len, 0, NULL, '\0', needflag, in_compound); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - - if (havecontclass) { - sfx = NULL; - pfx = NULL; - // if still not found check all two-level suffixes - st = suffix_check_twosfx_morph(word, len, 0, NULL, needflag); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - - // if still not found check all two-level suffixes - st = prefix_check_twosfx_morph(word, len, IN_CPD_NOT, needflag); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - } - - return mystrdup(result); -} - -char * AffixMgr::morphgen(char * ts, int wl, const unsigned short * ap, - unsigned short al, char * morph, char * targetmorph, int level) -{ - // handle suffixes - char * stemmorph; - char * stemmorphcatpos; - char mymorph[MAXLNLEN]; - - if (!morph) return NULL; - - // check substandard flag - if (TESTAFF(ap, substandard, al)) return NULL; - - if (morphcmp(morph, targetmorph) == 0) return mystrdup(ts); - -// int targetcount = get_sfxcount(targetmorph); - - // use input suffix fields, if exist - if (strstr(morph, MORPH_INFL_SFX) || strstr(morph, MORPH_DERI_SFX)) { - stemmorph = mymorph; - strcpy(stemmorph, morph); - mystrcat(stemmorph, " ", MAXLNLEN); - stemmorphcatpos = stemmorph + strlen(stemmorph); - } else { - stemmorph = morph; - stemmorphcatpos = NULL; - } - - for (int i = 0; i < al; i++) { - const unsigned char c = (unsigned char) (ap[i] & 0x00FF); - SfxEntry * sptr = sFlag[c]; - while (sptr) { - if (sptr->getFlag() == ap[i] && sptr->getMorph() && ((sptr->getContLen() == 0) || - // don't generate forms with substandard affixes - !TESTAFF(sptr->getCont(), substandard, sptr->getContLen()))) { - - if (stemmorphcatpos) strcpy(stemmorphcatpos, sptr->getMorph()); - else stemmorph = (char *) sptr->getMorph(); - - int cmp = morphcmp(stemmorph, targetmorph); - - if (cmp == 0) { - char * newword = sptr->add(ts, wl); - if (newword) { - hentry * check = pHMgr->lookup(newword); // XXX extra dic - if (!check || !check->astr || - !(TESTAFF(check->astr, forbiddenword, check->alen) || - TESTAFF(check->astr, ONLYUPCASEFLAG, check->alen))) { - return newword; - } - free(newword); - } - } - - // recursive call for secondary suffixes - if ((level == 0) && (cmp == 1) && (sptr->getContLen() > 0) && -// (get_sfxcount(stemmorph) < targetcount) && - !TESTAFF(sptr->getCont(), substandard, sptr->getContLen())) { - char * newword = sptr->add(ts, wl); - if (newword) { - char * newword2 = morphgen(newword, strlen(newword), sptr->getCont(), - sptr->getContLen(), stemmorph, targetmorph, 1); - - if (newword2) { - free(newword); - return newword2; - } - free(newword); - newword = NULL; - } - } - } - sptr = sptr->getFlgNxt(); - } - } - return NULL; -} - - -int AffixMgr::expand_rootword(struct guessword * wlst, int maxn, const char * ts, - int wl, const unsigned short * ap, unsigned short al, char * bad, int badl, - char * phon) -{ - int nh=0; - // first add root word to list - if ((nh < maxn) && !(al && ((needaffix && TESTAFF(ap, needaffix, al)) || - (onlyincompound && TESTAFF(ap, onlyincompound, al))))) { - wlst[nh].word = mystrdup(ts); - if (!wlst[nh].word) return 0; - wlst[nh].allow = (1 == 0); - wlst[nh].orig = NULL; - nh++; - // add special phonetic version - if (phon && (nh < maxn)) { - wlst[nh].word = mystrdup(phon); - if (!wlst[nh].word) return nh - 1; - wlst[nh].allow = (1 == 0); - wlst[nh].orig = mystrdup(ts); - if (!wlst[nh].orig) return nh - 1; - nh++; - } - } - - // handle suffixes - for (int i = 0; i < al; i++) { - const unsigned char c = (unsigned char) (ap[i] & 0x00FF); - SfxEntry * sptr = sFlag[c]; - while (sptr) { - if ((sptr->getFlag() == ap[i]) && (!sptr->getKeyLen() || ((badl > sptr->getKeyLen()) && - (strcmp(sptr->getAffix(), bad + badl - sptr->getKeyLen()) == 0))) && - // check needaffix flag - !(sptr->getCont() && ((needaffix && - TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) || - (circumfix && - TESTAFF(sptr->getCont(), circumfix, sptr->getContLen())) || - (onlyincompound && - TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen())))) - ) { - char * newword = sptr->add(ts, wl); - if (newword) { - if (nh < maxn) { - wlst[nh].word = newword; - wlst[nh].allow = sptr->allowCross(); - wlst[nh].orig = NULL; - nh++; - // add special phonetic version - if (phon && (nh < maxn)) { - char st[MAXWORDUTF8LEN]; - strcpy(st, phon); - strcat(st, sptr->getKey()); - reverseword(st + strlen(phon)); - wlst[nh].word = mystrdup(st); - if (!wlst[nh].word) return nh - 1; - wlst[nh].allow = (1 == 0); - wlst[nh].orig = mystrdup(newword); - if (!wlst[nh].orig) return nh - 1; - nh++; - } - } else { - free(newword); - } - } - } - sptr = sptr->getFlgNxt(); - } - } - - int n = nh; - - // handle cross products of prefixes and suffixes - for (int j=1;jgetFlag() == ap[k]) && cptr->allowCross() && (!cptr->getKeyLen() || ((badl > cptr->getKeyLen()) && - (strncmp(cptr->getKey(), bad, cptr->getKeyLen()) == 0)))) { - int l1 = strlen(wlst[j].word); - char * newword = cptr->add(wlst[j].word, l1); - if (newword) { - if (nh < maxn) { - wlst[nh].word = newword; - wlst[nh].allow = cptr->allowCross(); - wlst[nh].orig = NULL; - nh++; - } else { - free(newword); - } - } - } - cptr = cptr->getFlgNxt(); - } - } - } - - - // now handle pure prefixes - for (int m = 0; m < al; m ++) { - const unsigned char c = (unsigned char) (ap[m] & 0x00FF); - PfxEntry * ptr = pFlag[c]; - while (ptr) { - if ((ptr->getFlag() == ap[m]) && (!ptr->getKeyLen() || ((badl > ptr->getKeyLen()) && - (strncmp(ptr->getKey(), bad, ptr->getKeyLen()) == 0))) && - // check needaffix flag - !(ptr->getCont() && ((needaffix && - TESTAFF(ptr->getCont(), needaffix, ptr->getContLen())) || - (circumfix && - TESTAFF(ptr->getCont(), circumfix, ptr->getContLen())) || - (onlyincompound && - TESTAFF(ptr->getCont(), onlyincompound, ptr->getContLen())))) - ) { - char * newword = ptr->add(ts, wl); - if (newword) { - if (nh < maxn) { - wlst[nh].word = newword; - wlst[nh].allow = ptr->allowCross(); - wlst[nh].orig = NULL; - nh++; - } else { - free(newword); - } - } - } - ptr = ptr->getFlgNxt(); - } - } - - return nh; -} - -// return length of replacing table -int AffixMgr::get_numrep() const -{ - return numrep; -} - -// return replacing table -struct replentry * AffixMgr::get_reptable() const -{ - if (! reptable ) return NULL; - return reptable; -} - -// return iconv table -RepList * AffixMgr::get_iconvtable() const -{ - if (! iconvtable ) return NULL; - return iconvtable; -} - -// return oconv table -RepList * AffixMgr::get_oconvtable() const -{ - if (! oconvtable ) return NULL; - return oconvtable; -} - -// return replacing table -struct phonetable * AffixMgr::get_phonetable() const -{ - if (! phone ) return NULL; - return phone; -} - -// return length of character map table -int AffixMgr::get_nummap() const -{ - return nummap; -} - -// return character map table -struct mapentry * AffixMgr::get_maptable() const -{ - if (! maptable ) return NULL; - return maptable; -} - -// return length of word break table -int AffixMgr::get_numbreak() const -{ - return numbreak; -} - -// return character map table -char ** AffixMgr::get_breaktable() const -{ - if (! breaktable ) return NULL; - return breaktable; -} - -// return text encoding of dictionary -char * AffixMgr::get_encoding() -{ - if (! encoding ) encoding = mystrdup(SPELL_ENCODING); - return mystrdup(encoding); -} - -// return text encoding of dictionary -int AffixMgr::get_langnum() const -{ - return langnum; -} - -// return double prefix option -int AffixMgr::get_complexprefixes() const -{ - return complexprefixes; -} - -// return FULLSTRIP option -int AffixMgr::get_fullstrip() const -{ - return fullstrip; -} - -FLAG AffixMgr::get_keepcase() const -{ - return keepcase; -} - -FLAG AffixMgr::get_forceucase() const -{ - return forceucase; -} - -FLAG AffixMgr::get_warn() const -{ - return warn; -} - -int AffixMgr::get_forbidwarn() const -{ - return forbidwarn; -} - -int AffixMgr::get_checksharps() const -{ - return checksharps; -} - -char * AffixMgr::encode_flag(unsigned short aflag) const -{ - return pHMgr->encode_flag(aflag); -} - - -// return the preferred ignore string for suggestions -char * AffixMgr::get_ignore() const -{ - if (!ignorechars) return NULL; - return ignorechars; -} - -// return the preferred ignore string for suggestions -unsigned short * AffixMgr::get_ignore_utf16(int * len) const -{ - *len = ignorechars_utf16_len; - return ignorechars_utf16; -} - -// return the keyboard string for suggestions -char * AffixMgr::get_key_string() -{ - if (! keystring ) keystring = mystrdup(SPELL_KEYSTRING); - return mystrdup(keystring); -} - -// return the preferred try string for suggestions -char * AffixMgr::get_try_string() const -{ - if (! trystring ) return NULL; - return mystrdup(trystring); -} - -// return the preferred try string for suggestions -const char * AffixMgr::get_wordchars() const -{ - return wordchars; -} - -unsigned short * AffixMgr::get_wordchars_utf16(int * len) const -{ - *len = wordchars_utf16_len; - return wordchars_utf16; -} - -// is there compounding? -int AffixMgr::get_compound() const -{ - return compoundflag || compoundbegin || numdefcpd; -} - -// return the compound words control flag -FLAG AffixMgr::get_compoundflag() const -{ - return compoundflag; -} - -// return the forbidden words control flag -FLAG AffixMgr::get_forbiddenword() const -{ - return forbiddenword; -} - -// return the forbidden words control flag -FLAG AffixMgr::get_nosuggest() const -{ - return nosuggest; -} - -// return the forbidden words control flag -FLAG AffixMgr::get_nongramsuggest() const -{ - return nongramsuggest; -} - -// return the forbidden words flag modify flag -FLAG AffixMgr::get_needaffix() const -{ - return needaffix; -} - -// return the onlyincompound flag -FLAG AffixMgr::get_onlyincompound() const -{ - return onlyincompound; -} - -// return the compound word signal flag -FLAG AffixMgr::get_compoundroot() const -{ - return compoundroot; -} - -// return the compound begin signal flag -FLAG AffixMgr::get_compoundbegin() const -{ - return compoundbegin; -} - -// return the value of checknum -int AffixMgr::get_checknum() const -{ - return checknum; -} - -// return the value of prefix -const char * AffixMgr::get_prefix() const -{ - if (pfx) return pfx->getKey(); - return NULL; -} - -// return the value of suffix -const char * AffixMgr::get_suffix() const -{ - return sfxappnd; -} - -// return the value of suffix -const char * AffixMgr::get_version() const -{ - return version; -} - -// return lemma_present flag -FLAG AffixMgr::get_lemma_present() const -{ - return lemma_present; -} - -// utility method to look up root words in hash table -struct hentry * AffixMgr::lookup(const char * word) -{ - int i; - struct hentry * he = NULL; - for (i = 0; i < *maxdic && !he; i++) { - he = (alldic[i])->lookup(word); - } - return he; -} - -// return the value of suffix -int AffixMgr::have_contclass() const -{ - return havecontclass; -} - -// return utf8 -int AffixMgr::get_utf8() const -{ - return utf8; -} - -int AffixMgr::get_maxngramsugs(void) const -{ - return maxngramsugs; -} - -int AffixMgr::get_maxcpdsugs(void) const -{ - return maxcpdsugs; -} - -int AffixMgr::get_maxdiff(void) const -{ - return maxdiff; -} - -int AffixMgr::get_onlymaxdiff(void) const -{ - return onlymaxdiff; -} - -// return nosplitsugs -int AffixMgr::get_nosplitsugs(void) const -{ - return nosplitsugs; -} - -// return sugswithdots -int AffixMgr::get_sugswithdots(void) const -{ - return sugswithdots; -} - -/* parse flag */ -int AffixMgr::parse_flag(char * line, unsigned short * out, FileMgr * af) { - char * s = NULL; - if (*out != FLAG_NULL && !(*out >= DEFAULTFLAGS)) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions of an affix file parameter\n", af->getlinenum()); - return 1; - } - if (parse_string(line, &s, af->getlinenum())) return 1; - *out = pHMgr->decode_flag(s); - free(s); - return 0; -} - -/* parse num */ -int AffixMgr::parse_num(char * line, int * out, FileMgr * af) { - char * s = NULL; - if (*out != -1) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions of an affix file parameter\n", af->getlinenum()); - return 1; - } - if (parse_string(line, &s, af->getlinenum())) return 1; - *out = atoi(s); - free(s); - return 0; -} - -/* parse in the max syllablecount of compound words and */ -int AffixMgr::parse_cpdsyllable(char * line, FileMgr * af) -{ - char * tp = line; - char * piece; - int i = 0; - int np = 0; - w_char w[MAXWORDLEN]; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { np++; break; } - case 1: { cpdmaxsyllable = atoi(piece); np++; break; } - case 2: { - if (!utf8) { - cpdvowels = mystrdup(piece); - } else { - int n = u8_u16(w, MAXWORDLEN, piece); - if (n > 0) { - flag_qsort((unsigned short *) w, 0, n); - cpdvowels_utf16 = (w_char *) malloc(n * sizeof(w_char)); - if (!cpdvowels_utf16) return 1; - memcpy(cpdvowels_utf16, w, n * sizeof(w_char)); - } - cpdvowels_utf16_len = n; - } - np++; - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (np < 2) { - HUNSPELL_WARNING(stderr, "error: line %d: missing compoundsyllable information\n", af->getlinenum()); - return 1; - } - if (np == 2) cpdvowels = mystrdup("aeiouAEIOU"); - return 0; -} - -/* parse in the typical fault correcting table */ -int AffixMgr::parse_reptable(char * line, FileMgr * af) -{ - if (numrep != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); - return 1; - } - char * tp = line; - char * piece; - int i = 0; - int np = 0; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { np++; break; } - case 1: { - numrep = atoi(piece); - if (numrep < 1) { - HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n", af->getlinenum()); - return 1; - } - reptable = (replentry *) malloc(numrep * sizeof(struct replentry)); - if (!reptable) return 1; - np++; - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (np != 2) { - HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); - return 1; - } - - /* now parse the numrep lines to read in the remainder of the table */ - char * nl; - for (int j=0; j < numrep; j++) { - if ((nl = af->getline()) == NULL) return 1; - mychomp(nl); - tp = nl; - i = 0; - reptable[j].pattern = NULL; - reptable[j].pattern2 = NULL; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { - if (strncmp(piece,"REP",3) != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - numrep = 0; - return 1; - } - break; - } - case 1: { - if (*piece == '^') reptable[j].start = true; else reptable[j].start = false; - reptable[j].pattern = mystrrep(mystrdup(piece + int(reptable[j].start)),"_"," "); - int lr = strlen(reptable[j].pattern) - 1; - if (reptable[j].pattern[lr] == '$') { - reptable[j].end = true; - reptable[j].pattern[lr] = '\0'; - } else reptable[j].end = false; - break; - } - case 2: { reptable[j].pattern2 = mystrrep(mystrdup(piece),"_"," "); break; } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if ((!(reptable[j].pattern)) || (!(reptable[j].pattern2))) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - numrep = 0; - return 1; - } - } - return 0; -} - -/* parse in the typical fault correcting table */ -int AffixMgr::parse_convtable(char * line, FileMgr * af, RepList ** rl, const char * keyword) -{ - if (*rl) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); - return 1; - } - char * tp = line; - char * piece; - int i = 0; - int np = 0; - int numrl = 0; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { np++; break; } - case 1: { - numrl = atoi(piece); - if (numrl < 1) { - HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n", af->getlinenum()); - return 1; - } - *rl = new RepList(numrl); - if (!*rl) return 1; - np++; - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (np != 2) { - HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); - return 1; - } - - /* now parse the num lines to read in the remainder of the table */ - char * nl; - for (int j=0; j < numrl; j++) { - if (!(nl = af->getline())) return 1; - mychomp(nl); - tp = nl; - i = 0; - char * pattern = NULL; - char * pattern2 = NULL; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { - if (strncmp(piece, keyword, strlen(keyword)) != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - delete *rl; - *rl = NULL; - return 1; - } - break; - } - case 1: { pattern = mystrrep(mystrdup(piece),"_"," "); break; } - case 2: { - pattern2 = mystrrep(mystrdup(piece),"_"," "); - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (!pattern || !pattern2) { - if (pattern) - free(pattern); - if (pattern2) - free(pattern2); - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - return 1; - } - (*rl)->add(pattern, pattern2); - } - return 0; -} - - -/* parse in the typical fault correcting table */ -int AffixMgr::parse_phonetable(char * line, FileMgr * af) -{ - if (phone) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); - return 1; - } - char * tp = line; - char * piece; - int i = 0; - int np = 0; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { np++; break; } - case 1: { - phone = (phonetable *) malloc(sizeof(struct phonetable)); - if (!phone) return 1; - phone->num = atoi(piece); - phone->rules = NULL; - phone->utf8 = (char) utf8; - if (phone->num < 1) { - HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); - return 1; - } - phone->rules = (char * *) malloc(2 * (phone->num + 1) * sizeof(char *)); - if (!phone->rules) { - free(phone); - phone = NULL; - return 1; - } - np++; - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (np != 2) { - HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); - return 1; - } - - /* now parse the phone->num lines to read in the remainder of the table */ - char * nl; - for (int j=0; j < phone->num; j++) { - if (!(nl = af->getline())) return 1; - mychomp(nl); - tp = nl; - i = 0; - phone->rules[j * 2] = NULL; - phone->rules[j * 2 + 1] = NULL; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { - if (strncmp(piece,"PHONE",5) != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - phone->num = 0; - return 1; - } - break; - } - case 1: { phone->rules[j * 2] = mystrrep(mystrdup(piece),"_",""); break; } - case 2: { phone->rules[j * 2 + 1] = mystrrep(mystrdup(piece),"_",""); break; } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if ((!(phone->rules[j * 2])) || (!(phone->rules[j * 2 + 1]))) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - phone->num = 0; - return 1; - } - } - phone->rules[phone->num * 2] = mystrdup(""); - phone->rules[phone->num * 2 + 1] = mystrdup(""); - init_phonet_hash(*phone); - return 0; -} - -/* parse in the checkcompoundpattern table */ -int AffixMgr::parse_checkcpdtable(char * line, FileMgr * af) -{ - if (numcheckcpd != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); - return 1; - } - char * tp = line; - char * piece; - int i = 0; - int np = 0; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { np++; break; } - case 1: { - numcheckcpd = atoi(piece); - if (numcheckcpd < 1) { - HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); - return 1; - } - checkcpdtable = (patentry *) malloc(numcheckcpd * sizeof(struct patentry)); - if (!checkcpdtable) return 1; - np++; - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (np != 2) { - HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); - return 1; - } - - /* now parse the numcheckcpd lines to read in the remainder of the table */ - char * nl; - for (int j=0; j < numcheckcpd; j++) { - if (!(nl = af->getline())) return 1; - mychomp(nl); - tp = nl; - i = 0; - checkcpdtable[j].pattern = NULL; - checkcpdtable[j].pattern2 = NULL; - checkcpdtable[j].pattern3 = NULL; - checkcpdtable[j].cond = FLAG_NULL; - checkcpdtable[j].cond2 = FLAG_NULL; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { - if (strncmp(piece,"CHECKCOMPOUNDPATTERN",20) != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - numcheckcpd = 0; - return 1; - } - break; - } - case 1: { - checkcpdtable[j].pattern = mystrdup(piece); - char * p = strchr(checkcpdtable[j].pattern, '/'); - if (p) { - *p = '\0'; - checkcpdtable[j].cond = pHMgr->decode_flag(p + 1); - } - break; } - case 2: { - checkcpdtable[j].pattern2 = mystrdup(piece); - char * p = strchr(checkcpdtable[j].pattern2, '/'); - if (p) { - *p = '\0'; - checkcpdtable[j].cond2 = pHMgr->decode_flag(p + 1); - } - break; - } - case 3: { checkcpdtable[j].pattern3 = mystrdup(piece); simplifiedcpd = 1; break; } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if ((!(checkcpdtable[j].pattern)) || (!(checkcpdtable[j].pattern2))) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - numcheckcpd = 0; - return 1; - } - } - return 0; -} - -/* parse in the compound rule table */ -int AffixMgr::parse_defcpdtable(char * line, FileMgr * af) -{ - if (numdefcpd != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); - return 1; - } - char * tp = line; - char * piece; - int i = 0; - int np = 0; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { np++; break; } - case 1: { - numdefcpd = atoi(piece); - if (numdefcpd < 1) { - HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); - return 1; - } - defcpdtable = (flagentry *) malloc(numdefcpd * sizeof(flagentry)); - if (!defcpdtable) return 1; - np++; - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (np != 2) { - HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); - return 1; - } - - /* now parse the numdefcpd lines to read in the remainder of the table */ - char * nl; - for (int j=0; j < numdefcpd; j++) { - if (!(nl = af->getline())) return 1; - mychomp(nl); - tp = nl; - i = 0; - defcpdtable[j].def = NULL; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { - if (strncmp(piece, "COMPOUNDRULE", 12) != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - numdefcpd = 0; - return 1; - } - break; - } - case 1: { // handle parenthesized flags - if (strchr(piece, '(')) { - defcpdtable[j].def = (FLAG *) malloc(strlen(piece) * sizeof(FLAG)); - defcpdtable[j].len = 0; - int end = 0; - FLAG * conv; - while (!end) { - char * par = piece + 1; - while (*par != '(' && *par != ')' && *par != '\0') par++; - if (*par == '\0') end = 1; else *par = '\0'; - if (*piece == '(') piece++; - if (*piece == '*' || *piece == '?') { - defcpdtable[j].def[defcpdtable[j].len++] = (FLAG) *piece; - } else if (*piece != '\0') { - int l = pHMgr->decode_flags(&conv, piece, af); - for (int k = 0; k < l; k++) defcpdtable[j].def[defcpdtable[j].len++] = conv[k]; - free(conv); - } - piece = par + 1; - } - } else { - defcpdtable[j].len = pHMgr->decode_flags(&(defcpdtable[j].def), piece, af); - } - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (!defcpdtable[j].len) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - numdefcpd = 0; - return 1; - } - } - return 0; -} - - -/* parse in the character map table */ -int AffixMgr::parse_maptable(char * line, FileMgr * af) -{ - if (nummap != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); - return 1; - } - char * tp = line; - char * piece; - int i = 0; - int np = 0; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { np++; break; } - case 1: { - nummap = atoi(piece); - if (nummap < 1) { - HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); - return 1; - } - maptable = (mapentry *) malloc(nummap * sizeof(struct mapentry)); - if (!maptable) return 1; - np++; - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (np != 2) { - HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); - return 1; - } - - /* now parse the nummap lines to read in the remainder of the table */ - char * nl; - for (int j=0; j < nummap; j++) { - if (!(nl = af->getline())) return 1; - mychomp(nl); - tp = nl; - i = 0; - maptable[j].set = NULL; - maptable[j].len = 0; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { - if (strncmp(piece,"MAP",3) != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - nummap = 0; - return 1; - } - break; - } - case 1: { - int setn = 0; - maptable[j].len = strlen(piece); - maptable[j].set = (char **) malloc(maptable[j].len * sizeof(char*)); - if (!maptable[j].set) return 1; - for (int k = 0; k < maptable[j].len; k++) { - int chl = 1; - int chb = k; - if (piece[k] == '(') { - char * parpos = strchr(piece + k, ')'); - if (parpos != NULL) { - chb = k + 1; - chl = (int)(parpos - piece) - k - 1; - k = k + chl + 1; - } - } else { - if (utf8 && (piece[k] & 0xc0) == 0xc0) { - for (k++; utf8 && (piece[k] & 0xc0) == 0x80; k++); - chl = k - chb; - k--; - } - } - maptable[j].set[setn] = (char *) malloc(chl + 1); - if (!maptable[j].set[setn]) return 1; - strncpy(maptable[j].set[setn], piece + chb, chl); - maptable[j].set[setn][chl] = '\0'; - setn++; - } - maptable[j].len = setn; - break; } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (!maptable[j].set || !maptable[j].len) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - nummap = 0; - return 1; - } - } - return 0; -} - -/* parse in the word breakpoint table */ -int AffixMgr::parse_breaktable(char * line, FileMgr * af) -{ - if (numbreak > -1) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); - return 1; - } - char * tp = line; - char * piece; - int i = 0; - int np = 0; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { np++; break; } - case 1: { - numbreak = atoi(piece); - if (numbreak < 0) { - HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); - return 1; - } - if (numbreak == 0) return 0; - breaktable = (char **) malloc(numbreak * sizeof(char *)); - if (!breaktable) return 1; - np++; - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (np != 2) { - HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); - return 1; - } - - /* now parse the numbreak lines to read in the remainder of the table */ - char * nl; - for (int j=0; j < numbreak; j++) { - if (!(nl = af->getline())) return 1; - mychomp(nl); - tp = nl; - i = 0; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { - if (strncmp(piece,"BREAK",5) != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - numbreak = 0; - return 1; - } - break; - } - case 1: { - breaktable[j] = mystrdup(piece); - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (!breaktable) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - numbreak = 0; - return 1; - } - } - return 0; -} - -void AffixMgr::reverse_condition(char * piece) { - int neg = 0; - for (char * k = piece + strlen(piece) - 1; k >= piece; k--) { - switch(*k) { - case '[': { - if (neg) *(k+1) = '['; else *k = ']'; - break; - } - case ']': { - *k = '['; - if (neg) *(k+1) = '^'; - neg = 0; - break; - } - case '^': { - if (*(k+1) == ']') neg = 1; else *(k+1) = *k; - break; - } - default: { - if (neg) *(k+1) = *k; - } - } - } -} - -int AffixMgr::parse_affix(char * line, const char at, FileMgr * af, char * dupflags) -{ - int numents = 0; // number of affentry structures to parse - - unsigned short aflag = 0; // affix char identifier - - char ff=0; - std::vector affentries; - - char * tp = line; - char * nl = line; - char * piece; - int i = 0; - - // checking lines with bad syntax -#ifdef DEBUG - int basefieldnum = 0; -#endif - - // split affix header line into pieces - - int np = 0; - - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - // piece 1 - is type of affix - case 0: { np++; break; } - - // piece 2 - is affix char - case 1: { - np++; - aflag = pHMgr->decode_flag(piece); - if (((at == 'S') && (dupflags[aflag] & dupSFX)) || - ((at == 'P') && (dupflags[aflag] & dupPFX))) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions of an affix flag\n", - af->getlinenum()); - // return 1; XXX permissive mode for bad dictionaries - } - dupflags[aflag] += (char) ((at == 'S') ? dupSFX : dupPFX); - break; - } - // piece 3 - is cross product indicator - case 2: { np++; if (*piece == 'Y') ff = aeXPRODUCT; break; } - - // piece 4 - is number of affentries - case 3: { - np++; - numents = atoi(piece); - if (numents == 0) { - char * err = pHMgr->encode_flag(aflag); - if (err) { - HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", - af->getlinenum()); - free(err); - } - return 1; - } - affentries.resize(numents); - affentries[0].opts = ff; - if (utf8) affentries[0].opts += aeUTF8; - if (pHMgr->is_aliasf()) affentries[0].opts += aeALIASF; - if (pHMgr->is_aliasm()) affentries[0].opts += aeALIASM; - affentries[0].aflag = aflag; - } - - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - // check to make sure we parsed enough pieces - if (np != 4) { - char * err = pHMgr->encode_flag(aflag); - if (err) { - HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); - free(err); - } - return 1; - } - - // now parse numents affentries for this affix - std::vector::iterator start = affentries.begin(); - std::vector::iterator end = affentries.end(); - for (std::vector::iterator entry = start; entry != end; ++entry) { - if ((nl = af->getline()) == NULL) return 1; - mychomp(nl); - tp = nl; - i = 0; - np = 0; - - // split line into pieces - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - // piece 1 - is type - case 0: { - np++; - if (entry != start) entry->opts = start->opts & - (char) (aeXPRODUCT + aeUTF8 + aeALIASF + aeALIASM); - break; - } - - // piece 2 - is affix char - case 1: { - np++; - if (pHMgr->decode_flag(piece) != aflag) { - char * err = pHMgr->encode_flag(aflag); - if (err) { - HUNSPELL_WARNING(stderr, "error: line %d: affix %s is corrupt\n", - af->getlinenum(), err); - free(err); - } - return 1; - } - - if (entry != start) entry->aflag = start->aflag; - break; - } - - // piece 3 - is string to strip or 0 for null - case 2: { - np++; - if (complexprefixes) { - if (utf8) reverseword_utf(piece); else reverseword(piece); - } - entry->strip = mystrdup(piece); - entry->stripl = (unsigned char) strlen(entry->strip); - if (strcmp(entry->strip,"0") == 0) { - free(entry->strip); - entry->strip=mystrdup(""); - entry->stripl = 0; - } - break; - } - - // piece 4 - is affix string or 0 for null - case 3: { - char * dash; - entry->morphcode = NULL; - entry->contclass = NULL; - entry->contclasslen = 0; - np++; - dash = strchr(piece, '/'); - if (dash) { - *dash = '\0'; - - if (ignorechars) { - if (utf8) { - remove_ignored_chars_utf(piece, ignorechars_utf16, ignorechars_utf16_len); - } else { - remove_ignored_chars(piece,ignorechars); - } - } - - if (complexprefixes) { - if (utf8) reverseword_utf(piece); else reverseword(piece); - } - entry->appnd = mystrdup(piece); - - if (pHMgr->is_aliasf()) { - int index = atoi(dash + 1); - entry->contclasslen = (unsigned short) pHMgr->get_aliasf(index, &(entry->contclass), af); - if (!entry->contclasslen) HUNSPELL_WARNING(stderr, "error: bad affix flag alias: \"%s\"\n", dash+1); - } else { - entry->contclasslen = (unsigned short) pHMgr->decode_flags(&(entry->contclass), dash + 1, af); - flag_qsort(entry->contclass, 0, entry->contclasslen); - } - *dash = '/'; - - havecontclass = 1; - for (unsigned short _i = 0; _i < entry->contclasslen; _i++) { - contclasses[(entry->contclass)[_i]] = 1; - } - } else { - if (ignorechars) { - if (utf8) { - remove_ignored_chars_utf(piece, ignorechars_utf16, ignorechars_utf16_len); - } else { - remove_ignored_chars(piece,ignorechars); - } - } - - if (complexprefixes) { - if (utf8) reverseword_utf(piece); else reverseword(piece); - } - entry->appnd = mystrdup(piece); - } - - entry->appndl = (unsigned char) strlen(entry->appnd); - if (strcmp(entry->appnd,"0") == 0) { - free(entry->appnd); - entry->appnd=mystrdup(""); - entry->appndl = 0; - } - break; - } - - // piece 5 - is the conditions descriptions - case 4: { - np++; - if (complexprefixes) { - if (utf8) reverseword_utf(piece); else reverseword(piece); - reverse_condition(piece); - } - if (entry->stripl && (strcmp(piece, ".") != 0) && - redundant_condition(at, entry->strip, entry->stripl, piece, af->getlinenum())) - strcpy(piece, "."); - if (at == 'S') { - reverseword(piece); - reverse_condition(piece); - } - if (encodeit(*entry, piece)) return 1; - break; - } - - case 5: { - np++; - if (pHMgr->is_aliasm()) { - int index = atoi(piece); - entry->morphcode = pHMgr->get_aliasm(index); - } else { - if (complexprefixes) { // XXX - fix me for morph. gen. - if (utf8) reverseword_utf(piece); else reverseword(piece); - } - // add the remaining of the line - if (*tp) { - *(tp - 1) = ' '; - tp = tp + strlen(tp); - } - entry->morphcode = mystrdup(piece); - if (!entry->morphcode) return 1; - } - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - // check to make sure we parsed enough pieces - if (np < 4) { - char * err = pHMgr->encode_flag(aflag); - if (err) { - HUNSPELL_WARNING(stderr, "error: line %d: affix %s is corrupt\n", - af->getlinenum(), err); - free(err); - } - return 1; - } - -#ifdef DEBUG - // detect unnecessary fields, excepting comments - if (basefieldnum) { - int fieldnum = !(entry->morphcode) ? 5 : ((*(entry->morphcode)=='#') ? 5 : 6); - if (fieldnum != basefieldnum) - HUNSPELL_WARNING(stderr, "warning: line %d: bad field number\n", af->getlinenum()); - } else { - basefieldnum = !(entry->morphcode) ? 5 : ((*(entry->morphcode)=='#') ? 5 : 6); - } -#endif - } - - // now create SfxEntry or PfxEntry objects and use links to - // build an ordered (sorted by affix string) list - for (std::vector::iterator entry = start; entry != end; ++entry) { - if (at == 'P') { - PfxEntry * pfxptr = new PfxEntry(this,&(*entry)); - build_pfxtree(pfxptr); - } else { - SfxEntry * sfxptr = new SfxEntry(this,&(*entry)); - build_sfxtree(sfxptr); - } - } - return 0; -} - -int AffixMgr::redundant_condition(char ft, char * strip, int stripl, const char * cond, int linenum) { - int condl = strlen(cond); - int i; - int j; - int neg; - int in; - if (ft == 'P') { // prefix - if (strncmp(strip, cond, condl) == 0) return 1; - if (utf8) { - } else { - for (i = 0, j = 0; (i < stripl) && (j < condl); i++, j++) { - if (cond[j] != '[') { - if (cond[j] != strip[i]) { - HUNSPELL_WARNING(stderr, "warning: line %d: incompatible stripping characters and condition\n", linenum); - return 0; - } - } else { - neg = (cond[j+1] == '^') ? 1 : 0; - in = 0; - do { - j++; - if (strip[i] == cond[j]) in = 1; - } while ((j < (condl - 1)) && (cond[j] != ']')); - if (j == (condl - 1) && (cond[j] != ']')) { - HUNSPELL_WARNING(stderr, "error: line %d: missing ] in condition:\n%s\n", linenum, cond); - return 0; - } - if ((!neg && !in) || (neg && in)) { - HUNSPELL_WARNING(stderr, "warning: line %d: incompatible stripping characters and condition\n", linenum); - return 0; - } - } - } - if (j >= condl) return 1; - } - } else { // suffix - if ((stripl >= condl) && strcmp(strip + stripl - condl, cond) == 0) return 1; - if (utf8) { - } else { - for (i = stripl - 1, j = condl - 1; (i >= 0) && (j >= 0); i--, j--) { - if (cond[j] != ']') { - if (cond[j] != strip[i]) { - HUNSPELL_WARNING(stderr, "warning: line %d: incompatible stripping characters and condition\n", linenum); - return 0; - } - } else { - in = 0; - do { - j--; - if (strip[i] == cond[j]) in = 1; - } while ((j > 0) && (cond[j] != '[')); - if ((j == 0) && (cond[j] != '[')) { - HUNSPELL_WARNING(stderr, "error: line: %d: missing ] in condition:\n%s\n", linenum, cond); - return 0; - } - neg = (cond[j+1] == '^') ? 1 : 0; - if ((!neg && !in) || (neg && in)) { - HUNSPELL_WARNING(stderr, "warning: line %d: incompatible stripping characters and condition\n", linenum); - return 0; - } - } - } - if (j < 0) return 1; - } - } - return 0; -} diff --git a/subprojects/hunspell/src/hunspell/affixmgr.hxx b/subprojects/hunspell/src/hunspell/affixmgr.hxx deleted file mode 100644 index 736816f04..000000000 --- a/subprojects/hunspell/src/hunspell/affixmgr.hxx +++ /dev/null @@ -1,252 +0,0 @@ -#ifndef _AFFIXMGR_HXX_ -#define _AFFIXMGR_HXX_ - -#include "hunvisapi.h" - -#include - -#include "atypes.hxx" -#include "baseaffix.hxx" -#include "hashmgr.hxx" -#include "phonet.hxx" -#include "replist.hxx" - -// check flag duplication -#define dupSFX (1 << 0) -#define dupPFX (1 << 1) - -class PfxEntry; -class SfxEntry; - -class LIBHUNSPELL_DLL_EXPORTED AffixMgr -{ - - PfxEntry * pStart[SETSIZE]; - SfxEntry * sStart[SETSIZE]; - PfxEntry * pFlag[SETSIZE]; - SfxEntry * sFlag[SETSIZE]; - HashMgr * pHMgr; - HashMgr ** alldic; - int * maxdic; - char * keystring; - char * trystring; - char * encoding; - struct cs_info * csconv; - int utf8; - int complexprefixes; - FLAG compoundflag; - FLAG compoundbegin; - FLAG compoundmiddle; - FLAG compoundend; - FLAG compoundroot; - FLAG compoundforbidflag; - FLAG compoundpermitflag; - int compoundmoresuffixes; - int checkcompounddup; - int checkcompoundrep; - int checkcompoundcase; - int checkcompoundtriple; - int simplifiedtriple; - FLAG forbiddenword; - FLAG nosuggest; - FLAG nongramsuggest; - FLAG needaffix; - int cpdmin; - int numrep; - replentry * reptable; - RepList * iconvtable; - RepList * oconvtable; - int nummap; - mapentry * maptable; - int numbreak; - char ** breaktable; - int numcheckcpd; - patentry * checkcpdtable; - int simplifiedcpd; - int numdefcpd; - flagentry * defcpdtable; - phonetable * phone; - int maxngramsugs; - int maxcpdsugs; - int maxdiff; - int onlymaxdiff; - int nosplitsugs; - int sugswithdots; - int cpdwordmax; - int cpdmaxsyllable; - char * cpdvowels; - w_char * cpdvowels_utf16; - int cpdvowels_utf16_len; - char * cpdsyllablenum; - const char * pfxappnd; // BUG: not stateless - const char * sfxappnd; // BUG: not stateless - FLAG sfxflag; // BUG: not stateless - char * derived; // BUG: not stateless - SfxEntry * sfx; // BUG: not stateless - PfxEntry * pfx; // BUG: not stateless - int checknum; - char * wordchars; - unsigned short * wordchars_utf16; - int wordchars_utf16_len; - char * ignorechars; - unsigned short * ignorechars_utf16; - int ignorechars_utf16_len; - char * version; - char * lang; - int langnum; - FLAG lemma_present; - FLAG circumfix; - FLAG onlyincompound; - FLAG keepcase; - FLAG forceucase; - FLAG warn; - int forbidwarn; - FLAG substandard; - int checksharps; - int fullstrip; - - int havecontclass; // boolean variable - char contclasses[CONTSIZE]; // flags of possible continuing classes (twofold affix) - -public: - - AffixMgr(const char * affpath, HashMgr** ptr, int * md, - const char * key = NULL); - ~AffixMgr(); - struct hentry * affix_check(const char * word, int len, - const unsigned short needflag = (unsigned short) 0, - char in_compound = IN_CPD_NOT); - struct hentry * prefix_check(const char * word, int len, - char in_compound, const FLAG needflag = FLAG_NULL); - inline int isSubset(const char * s1, const char * s2); - struct hentry * prefix_check_twosfx(const char * word, int len, - char in_compound, const FLAG needflag = FLAG_NULL); - inline int isRevSubset(const char * s1, const char * end_of_s2, int len); - struct hentry * suffix_check(const char * word, int len, int sfxopts, - PfxEntry* ppfx, char ** wlst, int maxSug, int * ns, - const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, - char in_compound = IN_CPD_NOT); - struct hentry * suffix_check_twosfx(const char * word, int len, - int sfxopts, PfxEntry* ppfx, const FLAG needflag = FLAG_NULL); - - char * affix_check_morph(const char * word, int len, - const FLAG needflag = FLAG_NULL, char in_compound = IN_CPD_NOT); - char * prefix_check_morph(const char * word, int len, - char in_compound, const FLAG needflag = FLAG_NULL); - char * suffix_check_morph (const char * word, int len, int sfxopts, - PfxEntry * ppfx, const FLAG cclass = FLAG_NULL, - const FLAG needflag = FLAG_NULL, char in_compound = IN_CPD_NOT); - - char * prefix_check_twosfx_morph(const char * word, int len, - char in_compound, const FLAG needflag = FLAG_NULL); - char * suffix_check_twosfx_morph(const char * word, int len, - int sfxopts, PfxEntry * ppfx, const FLAG needflag = FLAG_NULL); - - char * morphgen(char * ts, int wl, const unsigned short * ap, - unsigned short al, char * morph, char * targetmorph, int level); - - int expand_rootword(struct guessword * wlst, int maxn, const char * ts, - int wl, const unsigned short * ap, unsigned short al, char * bad, - int, char *); - - short get_syllable (const char * word, int wlen); - int cpdrep_check(const char * word, int len); - int cpdpat_check(const char * word, int len, hentry * r1, hentry * r2, - const char affixed); - int defcpd_check(hentry *** words, short wnum, hentry * rv, - hentry ** rwords, char all); - int cpdcase_check(const char * word, int len); - inline int candidate_check(const char * word, int len); - void setcminmax(int * cmin, int * cmax, const char * word, int len); - struct hentry * compound_check(const char * word, int len, short wordnum, - short numsyllable, short maxwordnum, short wnum, hentry ** words, - char hu_mov_rule, char is_sug, int * info); - - int compound_check_morph(const char * word, int len, short wordnum, - short numsyllable, short maxwordnum, short wnum, hentry ** words, - char hu_mov_rule, char ** result, char * partresult); - - struct hentry * lookup(const char * word); - int get_numrep() const; - struct replentry * get_reptable() const; - RepList * get_iconvtable() const; - RepList * get_oconvtable() const; - struct phonetable * get_phonetable() const; - int get_nummap() const; - struct mapentry * get_maptable() const; - int get_numbreak() const; - char ** get_breaktable() const; - char * get_encoding(); - int get_langnum() const; - char * get_key_string(); - char * get_try_string() const; - const char * get_wordchars() const; - unsigned short * get_wordchars_utf16(int * len) const; - char * get_ignore() const; - unsigned short * get_ignore_utf16(int * len) const; - int get_compound() const; - FLAG get_compoundflag() const; - FLAG get_compoundbegin() const; - FLAG get_forbiddenword() const; - FLAG get_nosuggest() const; - FLAG get_nongramsuggest() const; - FLAG get_needaffix() const; - FLAG get_onlyincompound() const; - FLAG get_compoundroot() const; - FLAG get_lemma_present() const; - int get_checknum() const; - const char * get_prefix() const; - const char * get_suffix() const; - const char * get_derived() const; - const char * get_version() const; - int have_contclass() const; - int get_utf8() const; - int get_complexprefixes() const; - char * get_suffixed(char ) const; - int get_maxngramsugs() const; - int get_maxcpdsugs() const; - int get_maxdiff() const; - int get_onlymaxdiff() const; - int get_nosplitsugs() const; - int get_sugswithdots(void) const; - FLAG get_keepcase(void) const; - FLAG get_forceucase(void) const; - FLAG get_warn(void) const; - int get_forbidwarn(void) const; - int get_checksharps(void) const; - char * encode_flag(unsigned short aflag) const; - int get_fullstrip() const; - -private: - int parse_file(const char * affpath, const char * key); - int parse_flag(char * line, unsigned short * out, FileMgr * af); - int parse_num(char * line, int * out, FileMgr * af); - int parse_cpdsyllable(char * line, FileMgr * af); - int parse_reptable(char * line, FileMgr * af); - int parse_convtable(char * line, FileMgr * af, RepList ** rl, const char * keyword); - int parse_phonetable(char * line, FileMgr * af); - int parse_maptable(char * line, FileMgr * af); - int parse_breaktable(char * line, FileMgr * af); - int parse_checkcpdtable(char * line, FileMgr * af); - int parse_defcpdtable(char * line, FileMgr * af); - int parse_affix(char * line, const char at, FileMgr * af, char * dupflags); - - void reverse_condition(char *); - void debugflag(char * result, unsigned short flag); - int condlen(char *); - int encodeit(affentry &entry, char * cs); - int build_pfxtree(PfxEntry* pfxptr); - int build_sfxtree(SfxEntry* sfxptr); - int process_pfx_order(); - int process_sfx_order(); - PfxEntry * process_pfx_in_order(PfxEntry * ptr, PfxEntry * nptr); - SfxEntry * process_sfx_in_order(SfxEntry * ptr, SfxEntry * nptr); - int process_pfx_tree_to_list(); - int process_sfx_tree_to_list(); - int redundant_condition(char, char * strip, int stripl, - const char * cond, int); - void finishFileMgr(FileMgr *afflst); -}; - -#endif - diff --git a/subprojects/hunspell/src/hunspell/atypes.hxx b/subprojects/hunspell/src/hunspell/atypes.hxx deleted file mode 100644 index 61c59d5ff..000000000 --- a/subprojects/hunspell/src/hunspell/atypes.hxx +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef _ATYPES_HXX_ -#define _ATYPES_HXX_ - -#ifndef HUNSPELL_WARNING -#include -#ifdef HUNSPELL_WARNING_ON -#define HUNSPELL_WARNING fprintf -#else -// empty inline function to switch off warnings (instead of the C99 standard variadic macros) -static inline void HUNSPELL_WARNING(FILE *, const char *, ...) {} -#endif -#endif - -// HUNSTEM def. -#define HUNSTEM - -#include "hashmgr.hxx" -#include "w_char.hxx" - -#define SETSIZE 256 -#define CONTSIZE 65536 -#define MAXWORDLEN 100 -#define MAXWORDUTF8LEN 256 - -// affentry options -#define aeXPRODUCT (1 << 0) -#define aeUTF8 (1 << 1) -#define aeALIASF (1 << 2) -#define aeALIASM (1 << 3) -#define aeLONGCOND (1 << 4) - -// compound options -#define IN_CPD_NOT 0 -#define IN_CPD_BEGIN 1 -#define IN_CPD_END 2 -#define IN_CPD_OTHER 3 - -// info options -#define SPELL_COMPOUND (1 << 0) -#define SPELL_FORBIDDEN (1 << 1) -#define SPELL_ALLCAP (1 << 2) -#define SPELL_NOCAP (1 << 3) -#define SPELL_INITCAP (1 << 4) -#define SPELL_ORIGCAP (1 << 5) -#define SPELL_WARN (1 << 6) - -#define MAXLNLEN 8192 - -#define MINCPDLEN 3 -#define MAXCOMPOUND 10 -#define MAXCONDLEN 20 -#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char *)) - -#define MAXACC 1000 - -#define FLAG unsigned short -#define FLAG_NULL 0x00 -#define FREE_FLAG(a) a = 0 - -#define TESTAFF( a, b , c ) (flag_bsearch((unsigned short *) a, (unsigned short) b, c)) - -struct affentry -{ - char * strip; - char * appnd; - unsigned char stripl; - unsigned char appndl; - char numconds; - char opts; - unsigned short aflag; - unsigned short * contclass; - short contclasslen; - union { - char conds[MAXCONDLEN]; - struct { - char conds1[MAXCONDLEN_1]; - char * conds2; - } l; - } c; - char * morphcode; -}; - -struct guessword { - char * word; - bool allow; - char * orig; -}; - -struct mapentry { - char ** set; - int len; -}; - -struct flagentry { - FLAG * def; - int len; -}; - -struct patentry { - char * pattern; - char * pattern2; - char * pattern3; - FLAG cond; - FLAG cond2; -}; - -#endif diff --git a/subprojects/hunspell/src/hunspell/baseaffix.hxx b/subprojects/hunspell/src/hunspell/baseaffix.hxx deleted file mode 100644 index f417acaa4..000000000 --- a/subprojects/hunspell/src/hunspell/baseaffix.hxx +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _BASEAFF_HXX_ -#define _BASEAFF_HXX_ - -#include "hunvisapi.h" - -class LIBHUNSPELL_DLL_EXPORTED AffEntry -{ -private: - AffEntry(const AffEntry&); - AffEntry& operator = (const AffEntry&); -protected: - AffEntry() {} - char * appnd; - char * strip; - unsigned char appndl; - unsigned char stripl; - char numconds; - char opts; - unsigned short aflag; - union { - char conds[MAXCONDLEN]; - struct { - char conds1[MAXCONDLEN_1]; - char * conds2; - } l; - } c; - char * morphcode; - unsigned short * contclass; - short contclasslen; -}; - -#endif diff --git a/subprojects/hunspell/src/hunspell/csutil.cxx b/subprojects/hunspell/src/hunspell/csutil.cxx deleted file mode 100644 index f877f2815..000000000 --- a/subprojects/hunspell/src/hunspell/csutil.cxx +++ /dev/null @@ -1,5863 +0,0 @@ -#include "license.hunspell" -#include "license.myspell" - -#include -#include -#include -#include - -#include "csutil.hxx" -#include "atypes.hxx" -#include "langnum.hxx" - -// Unicode character encoding information -struct unicode_info { - unsigned short c; - unsigned short cupper; - unsigned short clower; -}; - -#ifdef _WIN32 -#include -#include -#endif - -#ifdef OPENOFFICEORG -# include -#else -# ifndef MOZILLA_CLIENT -# include "utf_info.cxx" -# define UTF_LST_LEN (sizeof(utf_lst) / (sizeof(unicode_info))) -# endif -#endif - -#ifdef MOZILLA_CLIENT -#include "nsCOMPtr.h" -#include "nsServiceManagerUtils.h" -#include "nsIUnicodeEncoder.h" -#include "nsIUnicodeDecoder.h" -#include "nsUnicharUtils.h" -#include "nsICharsetConverterManager.h" - -static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID); -#endif - -struct unicode_info2 { - char cletter; - unsigned short cupper; - unsigned short clower; -}; - -static struct unicode_info2 * utf_tbl = NULL; -static int utf_tbl_count = 0; // utf_tbl can be used by multiple Hunspell instances - -FILE * myfopen(const char * path, const char * mode) { -#ifdef _WIN32 -#define WIN32_LONG_PATH_PREFIX "\\\\?\\" - if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) { - int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0); - wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t)); - MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len); - FILE * f = _wfopen(buff, (strcmp(mode, "r") == 0) ? L"r" : L"rb"); - free(buff); - return f; - } -#endif - return fopen(path, mode); -} - -/* only UTF-16 (BMP) implementation */ -char * u16_u8(char * dest, int size, const w_char * src, int srclen) { - signed char * u8 = (signed char *)dest; - signed char * u8_max = (signed char *)(u8 + size); - const w_char * u2 = src; - const w_char * u2_max = src + srclen; - while ((u2 < u2_max) && (u8 < u8_max)) { - if (u2->h) { // > 0xFF - // XXX 4-byte haven't implemented yet. - if (u2->h >= 0x08) { // >= 0x800 (3-byte UTF-8 character) - *u8 = 0xe0 + (u2->h >> 4); - u8++; - if (u8 < u8_max) { - *u8 = 0x80 + ((u2->h & 0xf) << 2) + (u2->l >> 6); - u8++; - if (u8 < u8_max) { - *u8 = 0x80 + (u2->l & 0x3f); - u8++; - } - } - } else { // < 0x800 (2-byte UTF-8 character) - *u8 = 0xc0 + (u2->h << 2) + (u2->l >> 6); - u8++; - if (u8 < u8_max) { - *u8 = 0x80 + (u2->l & 0x3f); - u8++; - } - } - } else { // <= 0xFF - if (u2->l & 0x80) { // >0x80 (2-byte UTF-8 character) - *u8 = 0xc0 + (u2->l >> 6); - u8++; - if (u8 < u8_max) { - *u8 = 0x80 + (u2->l & 0x3f); - u8++; - } - } else { // < 0x80 (1-byte UTF-8 character) - *u8 = u2->l; - u8++; - } - } - u2++; - } - *u8 = '\0'; - return dest; -} - - -/* only UTF-16 (BMP) implementation */ -int u8_u16(w_char * dest, int size, const char * src) { - const signed char * u8 = (const signed char *)src; - w_char * u2 = dest; - w_char * u2_max = u2 + size; - - while ((u2 < u2_max) && *u8) { - switch ((*u8) & 0xf0) { - case 0x00: - case 0x10: - case 0x20: - case 0x30: - case 0x40: - case 0x50: - case 0x60: - case 0x70: { - u2->h = 0; - u2->l = *u8; - break; - } - case 0x80: - case 0x90: - case 0xa0: - case 0xb0: { - HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Unexpected continuation bytes in %ld. character position\n%s\n", static_cast(u8 - (signed char *)src), src); - u2->h = 0xff; - u2->l = 0xfd; - break; - } - case 0xc0: - case 0xd0: { // 2-byte UTF-8 codes - if ((*(u8+1) & 0xc0) == 0x80) { - u2->h = (*u8 & 0x1f) >> 2; - u2->l = (*u8 << 6) + (*(u8+1) & 0x3f); - u8++; - } else { - HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Missing continuation byte in %ld. character position:\n%s\n", static_cast(u8 - (signed char *)src), src); - u2->h = 0xff; - u2->l = 0xfd; - } - break; - } - case 0xe0: { // 3-byte UTF-8 codes - if ((*(u8+1) & 0xc0) == 0x80) { - u2->h = ((*u8 & 0x0f) << 4) + ((*(u8+1) & 0x3f) >> 2); - u8++; - if ((*(u8+1) & 0xc0) == 0x80) { - u2->l = (*u8 << 6) + (*(u8+1) & 0x3f); - u8++; - } else { - HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Missing continuation byte in %ld. character position:\n%s\n", static_cast(u8 - (signed char *)src), src); - u2->h = 0xff; - u2->l = 0xfd; - } - } else { - HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Missing continuation byte in %ld. character position:\n%s\n", static_cast(u8 - (signed char *)src), src); - u2->h = 0xff; - u2->l = 0xfd; - } - break; - } - case 0xf0: { // 4 or more byte UTF-8 codes - HUNSPELL_WARNING(stderr, "This UTF-8 encoding can't convert to UTF-16:\n%s\n", src); - u2->h = 0xff; - u2->l = 0xfd; - return -1; - } - } - u8++; - u2++; - } - return (int)(u2 - dest); -} - -void flag_qsort(unsigned short flags[], int begin, int end) { - unsigned short reg; - if (end > begin) { - unsigned short pivot = flags[begin]; - int l = begin + 1; - int r = end; - while(l < r) { - if (flags[l] <= pivot) { - l++; - } else { - r--; - reg = flags[l]; - flags[l] = flags[r]; - flags[r] = reg; - } - } - l--; - reg = flags[begin]; - flags[begin] = flags[l]; - flags[l] = reg; - - flag_qsort(flags, begin, l); - flag_qsort(flags, r, end); - } - } - -int flag_bsearch(unsigned short flags[], unsigned short flag, int length) { - int mid; - int left = 0; - int right = length - 1; - while (left <= right) { - mid = (left + right) / 2; - if (flags[mid] == flag) return 1; - if (flag < flags[mid]) right = mid - 1; - else left = mid + 1; - } - return 0; -} - - // strip strings into token based on single char delimiter - // acts like strsep() but only uses a delim char and not - // a delim string - // default delimiter: white space characters - - char * mystrsep(char ** stringp, const char delim) - { - char * mp = *stringp; - if (*mp != '\0') { - char * dp; - if (delim) { - dp = strchr(mp, delim); - } else { - // don't use isspace() here, the string can be in some random charset - // that's way different than the locale's - for (dp = mp; (*dp && *dp != ' ' && *dp != '\t'); dp++); - if (!*dp) dp = NULL; - } - if (dp) { - *stringp = dp+1; - *dp = '\0'; - } else { - *stringp = mp + strlen(mp); - } - return mp; - } - return NULL; - } - - // replaces strdup with ansi version - char * mystrdup(const char * s) - { - char * d = NULL; - if (s) { - size_t sl = strlen(s)+1; - d = (char *) malloc(sl); - if (d) { - memcpy(d,s,sl); - } else { - HUNSPELL_WARNING(stderr, "Can't allocate memory.\n"); - } - } - return d; - } - - // strcat for limited length destination string - char * mystrcat(char * dest, const char * st, int max) { - int len; - int len2; - if (dest == NULL || st == NULL) return dest; - len = strlen(dest); - len2 = strlen(st); - if (len + len2 + 1 > max) return dest; - strcpy(dest + len, st); - return dest; - } - - // remove cross-platform text line end characters - void mychomp(char * s) - { - size_t k = strlen(s); - if ((k > 0) && ((*(s+k-1)=='\r') || (*(s+k-1)=='\n'))) *(s+k-1) = '\0'; - if ((k > 1) && (*(s+k-2) == '\r')) *(s+k-2) = '\0'; - } - - - // does an ansi strdup of the reverse of a string - char * myrevstrdup(const char * s) - { - char * d = NULL; - if (s) { - size_t sl = strlen(s); - d = (char *) malloc(sl+1); - if (d) { - const char * p = s + sl - 1; - char * q = d; - while (p >= s) *q++ = *p--; - *q = '\0'; - } else { - HUNSPELL_WARNING(stderr, "Can't allocate memory.\n"); - } - } - return d; - } - -// break text to lines -// return number of lines -int line_tok(const char * text, char *** lines, char breakchar) { - int linenum = 0; - if (!text) { - return linenum; - } - char * dup = mystrdup(text); - char * p = strchr(dup, breakchar); - while (p) { - linenum++; - *p = '\0'; - p++; - p = strchr(p, breakchar); - } - linenum++; - *lines = (char **) malloc(linenum * sizeof(char *)); - if (!(*lines)) { - free(dup); - return 0; - } - - p = dup; - int l = 0; - for (int i = 0; i < linenum; i++) { - if (*p != '\0') { - (*lines)[l] = mystrdup(p); - if (!(*lines)[l]) { - for (i = 0; i < l; i++) free((*lines)[i]); - free(dup); - return 0; - } - l++; - } - p += strlen(p) + 1; - } - free(dup); - if (!l) free(*lines); - return l; -} - -// uniq line in place -char * line_uniq(char * text, char breakchar) { - char ** lines; - int linenum = line_tok(text, &lines, breakchar); - int i; - strcpy(text, lines[0]); - for ( i = 1; i < linenum; i++ ) { - int dup = 0; - for (int j = 0; j < i; j++) { - if (strcmp(lines[i], lines[j]) == 0) { - dup = 1; - break; - } - } - if (!dup) { - if ((i > 1) || (*(lines[0]) != '\0')) { - sprintf(text + strlen(text), "%c", breakchar); - } - strcat(text, lines[i]); - } - } - for ( i = 0; i < linenum; i++ ) { - if (lines[i]) free(lines[i]); - } - if (lines) free(lines); - return text; -} - -// uniq and boundary for compound analysis: "1\n\2\n\1" -> " ( \1 | \2 ) " -char * line_uniq_app(char ** text, char breakchar) { - if (!strchr(*text, breakchar)) { - return *text; - } - - char ** lines; - int i; - int linenum = line_tok(*text, &lines, breakchar); - int dup = 0; - for (i = 0; i < linenum; i++) { - for (int j = 0; j < (i - 1); j++) { - if (strcmp(lines[i], lines[j]) == 0) { - *(lines[i]) = '\0'; - dup++; - break; - } - } - } - if ((linenum - dup) == 1) { - strcpy(*text, lines[0]); - freelist(&lines, linenum); - return *text; - } - char * newtext = (char *) malloc(strlen(*text) + 2 * linenum + 3 + 1); - if (newtext) { - free(*text); - *text = newtext; - } else { - freelist(&lines, linenum); - return *text; - } - strcpy(*text," ( "); - for (i = 0; i < linenum; i++) if (*(lines[i])) { - sprintf(*text + strlen(*text), "%s%s", lines[i], " | "); - } - (*text)[strlen(*text) - 2] = ')'; // " ) " - freelist(&lines, linenum); - return *text; -} - - // append s to ends of every lines in text - void strlinecat(char * dest, const char * s) - { - char * dup = mystrdup(dest); - char * source = dup; - int len = strlen(s); - if (dup) { - while (*source) { - if (*source == '\n') { - strncpy(dest, s, len); - dest += len; - } - *dest = *source; - source++; dest++; - } - strcpy(dest, s); - free(dup); - } - } - -// change \n to char c -char * tr(char * text, char oldc, char newc) { - char * p; - for (p = text; *p; p++) if (*p == oldc) *p = newc; - return text; -} - -// morphcmp(): compare MORPH_DERI_SFX, MORPH_INFL_SFX and MORPH_TERM_SFX fields -// in the first line of the inputs -// return 0, if inputs equal -// return 1, if inputs may equal with a secondary suffix -// otherwise return -1 -int morphcmp(const char * s, const char * t) -{ - int se = 0; - int te = 0; - const char * sl; - const char * tl; - const char * olds; - const char * oldt; - if (!s || !t) return 1; - olds = s; - sl = strchr(s, '\n'); - s = strstr(s, MORPH_DERI_SFX); - if (!s || (sl && sl < s)) s = strstr(olds, MORPH_INFL_SFX); - if (!s || (sl && sl < s)) { - s= strstr(olds, MORPH_TERM_SFX); - olds = NULL; - } - oldt = t; - tl = strchr(t, '\n'); - t = strstr(t, MORPH_DERI_SFX); - if (!t || (tl && tl < t)) t = strstr(oldt, MORPH_INFL_SFX); - if (!t || (tl && tl < t)) { - t = strstr(oldt, MORPH_TERM_SFX); - oldt = NULL; - } - while (s && t && (!sl || sl > s) && (!tl || tl > t)) { - s += MORPH_TAG_LEN; - t += MORPH_TAG_LEN; - se = 0; - te = 0; - while ((*s == *t) && !se && !te) { - s++; - t++; - switch(*s) { - case ' ': - case '\n': - case '\t': - case '\0': se = 1; - } - switch(*t) { - case ' ': - case '\n': - case '\t': - case '\0': te = 1; - } - } - if (!se || !te) { - // not terminal suffix difference - if (olds) return -1; - return 1; - } - olds = s; - s = strstr(s, MORPH_DERI_SFX); - if (!s || (sl && sl < s)) s = strstr(olds, MORPH_INFL_SFX); - if (!s || (sl && sl < s)) { - s = strstr(olds, MORPH_TERM_SFX); - olds = NULL; - } - oldt = t; - t = strstr(t, MORPH_DERI_SFX); - if (!t || (tl && tl < t)) t = strstr(oldt, MORPH_INFL_SFX); - if (!t || (tl && tl < t)) { - t = strstr(oldt, MORPH_TERM_SFX); - oldt = NULL; - } - } - if (!s && !t && se && te) return 0; - return 1; -} - -int get_sfxcount(const char * morph) -{ - if (!morph || !*morph) return 0; - int n = 0; - const char * old = morph; - morph = strstr(morph, MORPH_DERI_SFX); - if (!morph) morph = strstr(old, MORPH_INFL_SFX); - if (!morph) morph = strstr(old, MORPH_TERM_SFX); - while (morph) { - n++; - old = morph; - morph = strstr(morph + 1, MORPH_DERI_SFX); - if (!morph) morph = strstr(old + 1, MORPH_INFL_SFX); - if (!morph) morph = strstr(old + 1, MORPH_TERM_SFX); - } - return n; -} - - -int fieldlen(const char * r) -{ - int n = 0; - while (r && *r != ' ' && *r != '\t' && *r != '\0' && *r != '\n') { - r++; - n++; - } - return n; -} - -char * copy_field(char * dest, const char * morph, const char * var) -{ - if (!morph) return NULL; - const char * beg = strstr(morph, var); - if (beg) { - char * d = dest; - for (beg += MORPH_TAG_LEN; *beg != ' ' && *beg != '\t' && - *beg != '\n' && *beg != '\0'; d++, beg++) { - *d = *beg; - } - *d = '\0'; - return dest; - } - return NULL; -} - -char * mystrrep(char * word, const char * pat, const char * rep) { - char * pos = strstr(word, pat); - if (pos) { - int replen = strlen(rep); - int patlen = strlen(pat); - while (pos) { - if (replen < patlen) { - char * end = word + strlen(word); - char * next = pos + replen; - char * prev = pos + strlen(pat); - for (; prev < end; *next = *prev, prev++, next++); - *next = '\0'; - } else if (replen > patlen) { - char * end = pos + patlen; - char * next = word + strlen(word) + replen - patlen; - char * prev = next - replen + patlen; - for (; prev >= end; *next = *prev, prev--, next--); - } - strncpy(pos, rep, replen); - pos = strstr(word, pat); - } - } - return word; -} - - // reverse word - int reverseword(char * word) { - char r; - for (char * dest = word + strlen(word) - 1; word < dest; word++, dest--) { - r=*word; - *word = *dest; - *dest = r; - } - return 0; - } - - // reverse word (error: 1) - int reverseword_utf(char * word) { - w_char w[MAXWORDLEN]; - w_char * p; - w_char r; - int l = u8_u16(w, MAXWORDLEN, word); - if (l == -1) return 1; - p = w; - for (w_char * dest = w + l - 1; p < dest; p++, dest--) { - r=*p; - *p = *dest; - *dest = r; - } - u16_u8(word, MAXWORDUTF8LEN, w, l); - return 0; - } - - int uniqlist(char ** list, int n) { - int i; - if (n < 2) return n; - for (i = 0; i < n; i++) { - for (int j = 0; j < i; j++) { - if (list[j] && list[i] && (strcmp(list[j], list[i]) == 0)) { - free(list[i]); - list[i] = NULL; - break; - } - } - } - int m = 1; - for (i = 1; i < n; i++) if (list[i]) { - list[m] = list[i]; - m++; - } - return m; - } - - void freelist(char *** list, int n) { - if (list && *list && n > 0) { - for (int i = 0; i < n; i++) if ((*list)[i]) free((*list)[i]); - free(*list); - *list = NULL; - } - } - - // convert null terminated string to all caps - void mkallcap(char * p, const struct cs_info * csconv) - { - while (*p != '\0') { - *p = csconv[((unsigned char) *p)].cupper; - p++; - } - } - - // convert null terminated string to all little - void mkallsmall(char * p, const struct cs_info * csconv) - { - while (*p != '\0') { - *p = csconv[((unsigned char) *p)].clower; - p++; - } - } - -void mkallsmall_utf(w_char * u, int nc, int langnum) { - for (int i = 0; i < nc; i++) { - unsigned short idx = (u[i].h << 8) + u[i].l; - if (idx != unicodetolower(idx, langnum)) { - u[i].h = (unsigned char) (unicodetolower(idx, langnum) >> 8); - u[i].l = (unsigned char) (unicodetolower(idx, langnum) & 0x00FF); - } - } -} - -void mkallcap_utf(w_char * u, int nc, int langnum) { - for (int i = 0; i < nc; i++) { - unsigned short idx = (u[i].h << 8) + u[i].l; - if (idx != unicodetoupper(idx, langnum)) { - u[i].h = (unsigned char) (unicodetoupper(idx, langnum) >> 8); - u[i].l = (unsigned char) (unicodetoupper(idx, langnum) & 0x00FF); - } - } -} - - // convert null terminated string to have initial capital - void mkinitcap(char * p, const struct cs_info * csconv) - { - if (*p != '\0') *p = csconv[((unsigned char)*p)].cupper; - } - - // conversion function for protected memory - void store_pointer(char * dest, char * source) - { - memcpy(dest, &source, sizeof(char *)); - } - - // conversion function for protected memory - char * get_stored_pointer(const char * s) - { - char * p; - memcpy(&p, s, sizeof(char *)); - return p; - } - -#ifndef MOZILLA_CLIENT - // convert null terminated string to all caps using encoding - void enmkallcap(char * d, const char * p, const char * encoding) - - { - struct cs_info * csconv = get_current_cs(encoding); - while (*p != '\0') { - *d++ = csconv[((unsigned char) *p)].cupper; - p++; - } - *d = '\0'; - } - - // convert null terminated string to all little using encoding - void enmkallsmall(char * d, const char * p, const char * encoding) - { - struct cs_info * csconv = get_current_cs(encoding); - while (*p != '\0') { - *d++ = csconv[((unsigned char) *p)].clower; - p++; - } - *d = '\0'; - } - - // convert null terminated string to have initial capital using encoding - void enmkinitcap(char * d, const char * p, const char * encoding) - { - struct cs_info * csconv = get_current_cs(encoding); - memcpy(d,p,(strlen(p)+1)); - if (*p != '\0') *d= csconv[((unsigned char)*p)].cupper; - } - -// these are simple character mappings for the -// encodings supported -// supplying isupper, tolower, and toupper - -static struct cs_info iso1_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x00, 0xa1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x00, 0xa3, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x00, 0xa5, 0xa5 }, -{ 0x00, 0xa6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa8 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x00, 0xaa, 0xaa }, -{ 0x00, 0xab, 0xab }, -{ 0x00, 0xac, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x00, 0xaf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xb1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x00, 0xb3, 0xb3 }, -{ 0x00, 0xb4, 0xb4 }, -{ 0x00, 0xb5, 0xb5 }, -{ 0x00, 0xb6, 0xb6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xb8 }, -{ 0x00, 0xb9, 0xb9 }, -{ 0x00, 0xba, 0xba }, -{ 0x00, 0xbb, 0xbb }, -{ 0x00, 0xbc, 0xbc }, -{ 0x00, 0xbd, 0xbd }, -{ 0x00, 0xbe, 0xbe }, -{ 0x00, 0xbf, 0xbf }, -{ 0x01, 0xe0, 0xc0 }, -{ 0x01, 0xe1, 0xc1 }, -{ 0x01, 0xe2, 0xc2 }, -{ 0x01, 0xe3, 0xc3 }, -{ 0x01, 0xe4, 0xc4 }, -{ 0x01, 0xe5, 0xc5 }, -{ 0x01, 0xe6, 0xc6 }, -{ 0x01, 0xe7, 0xc7 }, -{ 0x01, 0xe8, 0xc8 }, -{ 0x01, 0xe9, 0xc9 }, -{ 0x01, 0xea, 0xca }, -{ 0x01, 0xeb, 0xcb }, -{ 0x01, 0xec, 0xcc }, -{ 0x01, 0xed, 0xcd }, -{ 0x01, 0xee, 0xce }, -{ 0x01, 0xef, 0xcf }, -{ 0x01, 0xf0, 0xd0 }, -{ 0x01, 0xf1, 0xd1 }, -{ 0x01, 0xf2, 0xd2 }, -{ 0x01, 0xf3, 0xd3 }, -{ 0x01, 0xf4, 0xd4 }, -{ 0x01, 0xf5, 0xd5 }, -{ 0x01, 0xf6, 0xd6 }, -{ 0x00, 0xd7, 0xd7 }, -{ 0x01, 0xf8, 0xd8 }, -{ 0x01, 0xf9, 0xd9 }, -{ 0x01, 0xfa, 0xda }, -{ 0x01, 0xfb, 0xdb }, -{ 0x01, 0xfc, 0xdc }, -{ 0x01, 0xfd, 0xdd }, -{ 0x01, 0xfe, 0xde }, -{ 0x00, 0xdf, 0xdf }, -{ 0x00, 0xe0, 0xc0 }, -{ 0x00, 0xe1, 0xc1 }, -{ 0x00, 0xe2, 0xc2 }, -{ 0x00, 0xe3, 0xc3 }, -{ 0x00, 0xe4, 0xc4 }, -{ 0x00, 0xe5, 0xc5 }, -{ 0x00, 0xe6, 0xc6 }, -{ 0x00, 0xe7, 0xc7 }, -{ 0x00, 0xe8, 0xc8 }, -{ 0x00, 0xe9, 0xc9 }, -{ 0x00, 0xea, 0xca }, -{ 0x00, 0xeb, 0xcb }, -{ 0x00, 0xec, 0xcc }, -{ 0x00, 0xed, 0xcd }, -{ 0x00, 0xee, 0xce }, -{ 0x00, 0xef, 0xcf }, -{ 0x00, 0xf0, 0xd0 }, -{ 0x00, 0xf1, 0xd1 }, -{ 0x00, 0xf2, 0xd2 }, -{ 0x00, 0xf3, 0xd3 }, -{ 0x00, 0xf4, 0xd4 }, -{ 0x00, 0xf5, 0xd5 }, -{ 0x00, 0xf6, 0xd6 }, -{ 0x00, 0xf7, 0xf7 }, -{ 0x00, 0xf8, 0xd8 }, -{ 0x00, 0xf9, 0xd9 }, -{ 0x00, 0xfa, 0xda }, -{ 0x00, 0xfb, 0xdb }, -{ 0x00, 0xfc, 0xdc }, -{ 0x00, 0xfd, 0xdd }, -{ 0x00, 0xfe, 0xde }, -{ 0x00, 0xff, 0xff } -}; - - -static struct cs_info iso2_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x01, 0xb1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x01, 0xb3, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x01, 0xb5, 0xa5 }, -{ 0x01, 0xb6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa8 }, -{ 0x01, 0xb9, 0xa9 }, -{ 0x01, 0xba, 0xaa }, -{ 0x01, 0xbb, 0xab }, -{ 0x01, 0xbc, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x01, 0xbe, 0xae }, -{ 0x01, 0xbf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xa1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x00, 0xb3, 0xa3 }, -{ 0x00, 0xb4, 0xb4 }, -{ 0x00, 0xb5, 0xa5 }, -{ 0x00, 0xb6, 0xa6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xb8 }, -{ 0x00, 0xb9, 0xa9 }, -{ 0x00, 0xba, 0xaa }, -{ 0x00, 0xbb, 0xab }, -{ 0x00, 0xbc, 0xac }, -{ 0x00, 0xbd, 0xbd }, -{ 0x00, 0xbe, 0xae }, -{ 0x00, 0xbf, 0xaf }, -{ 0x01, 0xe0, 0xc0 }, -{ 0x01, 0xe1, 0xc1 }, -{ 0x01, 0xe2, 0xc2 }, -{ 0x01, 0xe3, 0xc3 }, -{ 0x01, 0xe4, 0xc4 }, -{ 0x01, 0xe5, 0xc5 }, -{ 0x01, 0xe6, 0xc6 }, -{ 0x01, 0xe7, 0xc7 }, -{ 0x01, 0xe8, 0xc8 }, -{ 0x01, 0xe9, 0xc9 }, -{ 0x01, 0xea, 0xca }, -{ 0x01, 0xeb, 0xcb }, -{ 0x01, 0xec, 0xcc }, -{ 0x01, 0xed, 0xcd }, -{ 0x01, 0xee, 0xce }, -{ 0x01, 0xef, 0xcf }, -{ 0x01, 0xf0, 0xd0 }, -{ 0x01, 0xf1, 0xd1 }, -{ 0x01, 0xf2, 0xd2 }, -{ 0x01, 0xf3, 0xd3 }, -{ 0x01, 0xf4, 0xd4 }, -{ 0x01, 0xf5, 0xd5 }, -{ 0x01, 0xf6, 0xd6 }, -{ 0x00, 0xd7, 0xd7 }, -{ 0x01, 0xf8, 0xd8 }, -{ 0x01, 0xf9, 0xd9 }, -{ 0x01, 0xfa, 0xda }, -{ 0x01, 0xfb, 0xdb }, -{ 0x01, 0xfc, 0xdc }, -{ 0x01, 0xfd, 0xdd }, -{ 0x01, 0xfe, 0xde }, -{ 0x00, 0xdf, 0xdf }, -{ 0x00, 0xe0, 0xc0 }, -{ 0x00, 0xe1, 0xc1 }, -{ 0x00, 0xe2, 0xc2 }, -{ 0x00, 0xe3, 0xc3 }, -{ 0x00, 0xe4, 0xc4 }, -{ 0x00, 0xe5, 0xc5 }, -{ 0x00, 0xe6, 0xc6 }, -{ 0x00, 0xe7, 0xc7 }, -{ 0x00, 0xe8, 0xc8 }, -{ 0x00, 0xe9, 0xc9 }, -{ 0x00, 0xea, 0xca }, -{ 0x00, 0xeb, 0xcb }, -{ 0x00, 0xec, 0xcc }, -{ 0x00, 0xed, 0xcd }, -{ 0x00, 0xee, 0xce }, -{ 0x00, 0xef, 0xcf }, -{ 0x00, 0xf0, 0xd0 }, -{ 0x00, 0xf1, 0xd1 }, -{ 0x00, 0xf2, 0xd2 }, -{ 0x00, 0xf3, 0xd3 }, -{ 0x00, 0xf4, 0xd4 }, -{ 0x00, 0xf5, 0xd5 }, -{ 0x00, 0xf6, 0xd6 }, -{ 0x00, 0xf7, 0xf7 }, -{ 0x00, 0xf8, 0xd8 }, -{ 0x00, 0xf9, 0xd9 }, -{ 0x00, 0xfa, 0xda }, -{ 0x00, 0xfb, 0xdb }, -{ 0x00, 0xfc, 0xdc }, -{ 0x00, 0xfd, 0xdd }, -{ 0x00, 0xfe, 0xde }, -{ 0x00, 0xff, 0xff } -}; - - -static struct cs_info iso3_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x01, 0xb1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x00, 0xa3, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x00, 0xa5, 0xa5 }, -{ 0x01, 0xb6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa8 }, -{ 0x01, 0x69, 0xa9 }, -{ 0x01, 0xba, 0xaa }, -{ 0x01, 0xbb, 0xab }, -{ 0x01, 0xbc, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x01, 0xbf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xa1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x00, 0xb3, 0xb3 }, -{ 0x00, 0xb4, 0xb4 }, -{ 0x00, 0xb5, 0xb5 }, -{ 0x00, 0xb6, 0xa6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xb8 }, -{ 0x00, 0xb9, 0x49 }, -{ 0x00, 0xba, 0xaa }, -{ 0x00, 0xbb, 0xab }, -{ 0x00, 0xbc, 0xac }, -{ 0x00, 0xbd, 0xbd }, -{ 0x00, 0xbe, 0xbe }, -{ 0x00, 0xbf, 0xaf }, -{ 0x01, 0xe0, 0xc0 }, -{ 0x01, 0xe1, 0xc1 }, -{ 0x01, 0xe2, 0xc2 }, -{ 0x00, 0xc3, 0xc3 }, -{ 0x01, 0xe4, 0xc4 }, -{ 0x01, 0xe5, 0xc5 }, -{ 0x01, 0xe6, 0xc6 }, -{ 0x01, 0xe7, 0xc7 }, -{ 0x01, 0xe8, 0xc8 }, -{ 0x01, 0xe9, 0xc9 }, -{ 0x01, 0xea, 0xca }, -{ 0x01, 0xeb, 0xcb }, -{ 0x01, 0xec, 0xcc }, -{ 0x01, 0xed, 0xcd }, -{ 0x01, 0xee, 0xce }, -{ 0x01, 0xef, 0xcf }, -{ 0x00, 0xd0, 0xd0 }, -{ 0x01, 0xf1, 0xd1 }, -{ 0x01, 0xf2, 0xd2 }, -{ 0x01, 0xf3, 0xd3 }, -{ 0x01, 0xf4, 0xd4 }, -{ 0x01, 0xf5, 0xd5 }, -{ 0x01, 0xf6, 0xd6 }, -{ 0x00, 0xd7, 0xd7 }, -{ 0x01, 0xf8, 0xd8 }, -{ 0x01, 0xf9, 0xd9 }, -{ 0x01, 0xfa, 0xda }, -{ 0x01, 0xfb, 0xdb }, -{ 0x01, 0xfc, 0xdc }, -{ 0x01, 0xfd, 0xdd }, -{ 0x01, 0xfe, 0xde }, -{ 0x00, 0xdf, 0xdf }, -{ 0x00, 0xe0, 0xc0 }, -{ 0x00, 0xe1, 0xc1 }, -{ 0x00, 0xe2, 0xc2 }, -{ 0x00, 0xe3, 0xe3 }, -{ 0x00, 0xe4, 0xc4 }, -{ 0x00, 0xe5, 0xc5 }, -{ 0x00, 0xe6, 0xc6 }, -{ 0x00, 0xe7, 0xc7 }, -{ 0x00, 0xe8, 0xc8 }, -{ 0x00, 0xe9, 0xc9 }, -{ 0x00, 0xea, 0xca }, -{ 0x00, 0xeb, 0xcb }, -{ 0x00, 0xec, 0xcc }, -{ 0x00, 0xed, 0xcd }, -{ 0x00, 0xee, 0xce }, -{ 0x00, 0xef, 0xcf }, -{ 0x00, 0xf0, 0xf0 }, -{ 0x00, 0xf1, 0xd1 }, -{ 0x00, 0xf2, 0xd2 }, -{ 0x00, 0xf3, 0xd3 }, -{ 0x00, 0xf4, 0xd4 }, -{ 0x00, 0xf5, 0xd5 }, -{ 0x00, 0xf6, 0xd6 }, -{ 0x00, 0xf7, 0xf7 }, -{ 0x00, 0xf8, 0xd8 }, -{ 0x00, 0xf9, 0xd9 }, -{ 0x00, 0xfa, 0xda }, -{ 0x00, 0xfb, 0xdb }, -{ 0x00, 0xfc, 0xdc }, -{ 0x00, 0xfd, 0xdd }, -{ 0x00, 0xfe, 0xde }, -{ 0x00, 0xff, 0xff } -}; - -static struct cs_info iso4_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x01, 0xb1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x01, 0xb3, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x01, 0xb5, 0xa5 }, -{ 0x01, 0xb6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa8 }, -{ 0x01, 0xb9, 0xa9 }, -{ 0x01, 0xba, 0xaa }, -{ 0x01, 0xbb, 0xab }, -{ 0x01, 0xbc, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x01, 0xbe, 0xae }, -{ 0x00, 0xaf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xa1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x00, 0xb3, 0xa3 }, -{ 0x00, 0xb4, 0xb4 }, -{ 0x00, 0xb5, 0xa5 }, -{ 0x00, 0xb6, 0xa6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xb8 }, -{ 0x00, 0xb9, 0xa9 }, -{ 0x00, 0xba, 0xaa }, -{ 0x00, 0xbb, 0xab }, -{ 0x00, 0xbc, 0xac }, -{ 0x00, 0xbd, 0xbd }, -{ 0x00, 0xbe, 0xae }, -{ 0x00, 0xbf, 0xbf }, -{ 0x01, 0xe0, 0xc0 }, -{ 0x01, 0xe1, 0xc1 }, -{ 0x01, 0xe2, 0xc2 }, -{ 0x01, 0xe3, 0xc3 }, -{ 0x01, 0xe4, 0xc4 }, -{ 0x01, 0xe5, 0xc5 }, -{ 0x01, 0xe6, 0xc6 }, -{ 0x01, 0xe7, 0xc7 }, -{ 0x01, 0xe8, 0xc8 }, -{ 0x01, 0xe9, 0xc9 }, -{ 0x01, 0xea, 0xca }, -{ 0x01, 0xeb, 0xcb }, -{ 0x01, 0xec, 0xcc }, -{ 0x01, 0xed, 0xcd }, -{ 0x01, 0xee, 0xce }, -{ 0x01, 0xef, 0xcf }, -{ 0x01, 0xf0, 0xd0 }, -{ 0x01, 0xf1, 0xd1 }, -{ 0x01, 0xf2, 0xd2 }, -{ 0x01, 0xf3, 0xd3 }, -{ 0x01, 0xf4, 0xd4 }, -{ 0x01, 0xf5, 0xd5 }, -{ 0x01, 0xf6, 0xd6 }, -{ 0x00, 0xd7, 0xd7 }, -{ 0x01, 0xf8, 0xd8 }, -{ 0x01, 0xf9, 0xd9 }, -{ 0x01, 0xfa, 0xda }, -{ 0x01, 0xfb, 0xdb }, -{ 0x01, 0xfc, 0xdc }, -{ 0x01, 0xfd, 0xdd }, -{ 0x01, 0xfe, 0xde }, -{ 0x00, 0xdf, 0xdf }, -{ 0x00, 0xe0, 0xc0 }, -{ 0x00, 0xe1, 0xc1 }, -{ 0x00, 0xe2, 0xc2 }, -{ 0x00, 0xe3, 0xc3 }, -{ 0x00, 0xe4, 0xc4 }, -{ 0x00, 0xe5, 0xc5 }, -{ 0x00, 0xe6, 0xc6 }, -{ 0x00, 0xe7, 0xc7 }, -{ 0x00, 0xe8, 0xc8 }, -{ 0x00, 0xe9, 0xc9 }, -{ 0x00, 0xea, 0xca }, -{ 0x00, 0xeb, 0xcb }, -{ 0x00, 0xec, 0xcc }, -{ 0x00, 0xed, 0xcd }, -{ 0x00, 0xee, 0xce }, -{ 0x00, 0xef, 0xcf }, -{ 0x00, 0xf0, 0xd0 }, -{ 0x00, 0xf1, 0xd1 }, -{ 0x00, 0xf2, 0xd2 }, -{ 0x00, 0xf3, 0xd3 }, -{ 0x00, 0xf4, 0xd4 }, -{ 0x00, 0xf5, 0xd5 }, -{ 0x00, 0xf6, 0xd6 }, -{ 0x00, 0xf7, 0xf7 }, -{ 0x00, 0xf8, 0xd8 }, -{ 0x00, 0xf9, 0xd9 }, -{ 0x00, 0xfa, 0xda }, -{ 0x00, 0xfb, 0xdb }, -{ 0x00, 0xfc, 0xdc }, -{ 0x00, 0xfd, 0xdd }, -{ 0x00, 0xfe, 0xde }, -{ 0x00, 0xff, 0xff } -}; - -static struct cs_info iso5_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x01, 0xf1, 0xa1 }, -{ 0x01, 0xf2, 0xa2 }, -{ 0x01, 0xf3, 0xa3 }, -{ 0x01, 0xf4, 0xa4 }, -{ 0x01, 0xf5, 0xa5 }, -{ 0x01, 0xf6, 0xa6 }, -{ 0x01, 0xf7, 0xa7 }, -{ 0x01, 0xf8, 0xa8 }, -{ 0x01, 0xf9, 0xa9 }, -{ 0x01, 0xfa, 0xaa }, -{ 0x01, 0xfb, 0xab }, -{ 0x01, 0xfc, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x01, 0xfe, 0xae }, -{ 0x01, 0xff, 0xaf }, -{ 0x01, 0xd0, 0xb0 }, -{ 0x01, 0xd1, 0xb1 }, -{ 0x01, 0xd2, 0xb2 }, -{ 0x01, 0xd3, 0xb3 }, -{ 0x01, 0xd4, 0xb4 }, -{ 0x01, 0xd5, 0xb5 }, -{ 0x01, 0xd6, 0xb6 }, -{ 0x01, 0xd7, 0xb7 }, -{ 0x01, 0xd8, 0xb8 }, -{ 0x01, 0xd9, 0xb9 }, -{ 0x01, 0xda, 0xba }, -{ 0x01, 0xdb, 0xbb }, -{ 0x01, 0xdc, 0xbc }, -{ 0x01, 0xdd, 0xbd }, -{ 0x01, 0xde, 0xbe }, -{ 0x01, 0xdf, 0xbf }, -{ 0x01, 0xe0, 0xc0 }, -{ 0x01, 0xe1, 0xc1 }, -{ 0x01, 0xe2, 0xc2 }, -{ 0x01, 0xe3, 0xc3 }, -{ 0x01, 0xe4, 0xc4 }, -{ 0x01, 0xe5, 0xc5 }, -{ 0x01, 0xe6, 0xc6 }, -{ 0x01, 0xe7, 0xc7 }, -{ 0x01, 0xe8, 0xc8 }, -{ 0x01, 0xe9, 0xc9 }, -{ 0x01, 0xea, 0xca }, -{ 0x01, 0xeb, 0xcb }, -{ 0x01, 0xec, 0xcc }, -{ 0x01, 0xed, 0xcd }, -{ 0x01, 0xee, 0xce }, -{ 0x01, 0xef, 0xcf }, -{ 0x00, 0xd0, 0xb0 }, -{ 0x00, 0xd1, 0xb1 }, -{ 0x00, 0xd2, 0xb2 }, -{ 0x00, 0xd3, 0xb3 }, -{ 0x00, 0xd4, 0xb4 }, -{ 0x00, 0xd5, 0xb5 }, -{ 0x00, 0xd6, 0xb6 }, -{ 0x00, 0xd7, 0xb7 }, -{ 0x00, 0xd8, 0xb8 }, -{ 0x00, 0xd9, 0xb9 }, -{ 0x00, 0xda, 0xba }, -{ 0x00, 0xdb, 0xbb }, -{ 0x00, 0xdc, 0xbc }, -{ 0x00, 0xdd, 0xbd }, -{ 0x00, 0xde, 0xbe }, -{ 0x00, 0xdf, 0xbf }, -{ 0x00, 0xe0, 0xc0 }, -{ 0x00, 0xe1, 0xc1 }, -{ 0x00, 0xe2, 0xc2 }, -{ 0x00, 0xe3, 0xc3 }, -{ 0x00, 0xe4, 0xc4 }, -{ 0x00, 0xe5, 0xc5 }, -{ 0x00, 0xe6, 0xc6 }, -{ 0x00, 0xe7, 0xc7 }, -{ 0x00, 0xe8, 0xc8 }, -{ 0x00, 0xe9, 0xc9 }, -{ 0x00, 0xea, 0xca }, -{ 0x00, 0xeb, 0xcb }, -{ 0x00, 0xec, 0xcc }, -{ 0x00, 0xed, 0xcd }, -{ 0x00, 0xee, 0xce }, -{ 0x00, 0xef, 0xcf }, -{ 0x00, 0xf0, 0xf0 }, -{ 0x00, 0xf1, 0xa1 }, -{ 0x00, 0xf2, 0xa2 }, -{ 0x00, 0xf3, 0xa3 }, -{ 0x00, 0xf4, 0xa4 }, -{ 0x00, 0xf5, 0xa5 }, -{ 0x00, 0xf6, 0xa6 }, -{ 0x00, 0xf7, 0xa7 }, -{ 0x00, 0xf8, 0xa8 }, -{ 0x00, 0xf9, 0xa9 }, -{ 0x00, 0xfa, 0xaa }, -{ 0x00, 0xfb, 0xab }, -{ 0x00, 0xfc, 0xac }, -{ 0x00, 0xfd, 0xfd }, -{ 0x00, 0xfe, 0xae }, -{ 0x00, 0xff, 0xaf } -}; - -static struct cs_info iso6_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x00, 0xa1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x00, 0xa3, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x00, 0xa5, 0xa5 }, -{ 0x00, 0xa6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa8 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x00, 0xaa, 0xaa }, -{ 0x00, 0xab, 0xab }, -{ 0x00, 0xac, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x00, 0xaf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xb1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x00, 0xb3, 0xb3 }, -{ 0x00, 0xb4, 0xb4 }, -{ 0x00, 0xb5, 0xb5 }, -{ 0x00, 0xb6, 0xb6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xb8 }, -{ 0x00, 0xb9, 0xb9 }, -{ 0x00, 0xba, 0xba }, -{ 0x00, 0xbb, 0xbb }, -{ 0x00, 0xbc, 0xbc }, -{ 0x00, 0xbd, 0xbd }, -{ 0x00, 0xbe, 0xbe }, -{ 0x00, 0xbf, 0xbf }, -{ 0x00, 0xc0, 0xc0 }, -{ 0x00, 0xc1, 0xc1 }, -{ 0x00, 0xc2, 0xc2 }, -{ 0x00, 0xc3, 0xc3 }, -{ 0x00, 0xc4, 0xc4 }, -{ 0x00, 0xc5, 0xc5 }, -{ 0x00, 0xc6, 0xc6 }, -{ 0x00, 0xc7, 0xc7 }, -{ 0x00, 0xc8, 0xc8 }, -{ 0x00, 0xc9, 0xc9 }, -{ 0x00, 0xca, 0xca }, -{ 0x00, 0xcb, 0xcb }, -{ 0x00, 0xcc, 0xcc }, -{ 0x00, 0xcd, 0xcd }, -{ 0x00, 0xce, 0xce }, -{ 0x00, 0xcf, 0xcf }, -{ 0x00, 0xd0, 0xd0 }, -{ 0x00, 0xd1, 0xd1 }, -{ 0x00, 0xd2, 0xd2 }, -{ 0x00, 0xd3, 0xd3 }, -{ 0x00, 0xd4, 0xd4 }, -{ 0x00, 0xd5, 0xd5 }, -{ 0x00, 0xd6, 0xd6 }, -{ 0x00, 0xd7, 0xd7 }, -{ 0x00, 0xd8, 0xd8 }, -{ 0x00, 0xd9, 0xd9 }, -{ 0x00, 0xda, 0xda }, -{ 0x00, 0xdb, 0xdb }, -{ 0x00, 0xdc, 0xdc }, -{ 0x00, 0xdd, 0xdd }, -{ 0x00, 0xde, 0xde }, -{ 0x00, 0xdf, 0xdf }, -{ 0x00, 0xe0, 0xe0 }, -{ 0x00, 0xe1, 0xe1 }, -{ 0x00, 0xe2, 0xe2 }, -{ 0x00, 0xe3, 0xe3 }, -{ 0x00, 0xe4, 0xe4 }, -{ 0x00, 0xe5, 0xe5 }, -{ 0x00, 0xe6, 0xe6 }, -{ 0x00, 0xe7, 0xe7 }, -{ 0x00, 0xe8, 0xe8 }, -{ 0x00, 0xe9, 0xe9 }, -{ 0x00, 0xea, 0xea }, -{ 0x00, 0xeb, 0xeb }, -{ 0x00, 0xec, 0xec }, -{ 0x00, 0xed, 0xed }, -{ 0x00, 0xee, 0xee }, -{ 0x00, 0xef, 0xef }, -{ 0x00, 0xf0, 0xf0 }, -{ 0x00, 0xf1, 0xf1 }, -{ 0x00, 0xf2, 0xf2 }, -{ 0x00, 0xf3, 0xf3 }, -{ 0x00, 0xf4, 0xf4 }, -{ 0x00, 0xf5, 0xf5 }, -{ 0x00, 0xf6, 0xf6 }, -{ 0x00, 0xf7, 0xf7 }, -{ 0x00, 0xf8, 0xf8 }, -{ 0x00, 0xf9, 0xf9 }, -{ 0x00, 0xfa, 0xfa }, -{ 0x00, 0xfb, 0xfb }, -{ 0x00, 0xfc, 0xfc }, -{ 0x00, 0xfd, 0xfd }, -{ 0x00, 0xfe, 0xfe }, -{ 0x00, 0xff, 0xff } -}; - -static struct cs_info iso7_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x00, 0xa1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x00, 0xa3, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x00, 0xa5, 0xa5 }, -{ 0x00, 0xa6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa8 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x00, 0xaa, 0xaa }, -{ 0x00, 0xab, 0xab }, -{ 0x00, 0xac, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x00, 0xaf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xb1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x00, 0xb3, 0xb3 }, -{ 0x00, 0xb4, 0xb4 }, -{ 0x00, 0xb5, 0xb5 }, -{ 0x01, 0xdc, 0xb6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x01, 0xdd, 0xb8 }, -{ 0x01, 0xde, 0xb9 }, -{ 0x01, 0xdf, 0xba }, -{ 0x00, 0xbb, 0xbb }, -{ 0x01, 0xfc, 0xbc }, -{ 0x00, 0xbd, 0xbd }, -{ 0x01, 0xfd, 0xbe }, -{ 0x01, 0xfe, 0xbf }, -{ 0x00, 0xc0, 0xc0 }, -{ 0x01, 0xe1, 0xc1 }, -{ 0x01, 0xe2, 0xc2 }, -{ 0x01, 0xe3, 0xc3 }, -{ 0x01, 0xe4, 0xc4 }, -{ 0x01, 0xe5, 0xc5 }, -{ 0x01, 0xe6, 0xc6 }, -{ 0x01, 0xe7, 0xc7 }, -{ 0x01, 0xe8, 0xc8 }, -{ 0x01, 0xe9, 0xc9 }, -{ 0x01, 0xea, 0xca }, -{ 0x01, 0xeb, 0xcb }, -{ 0x01, 0xec, 0xcc }, -{ 0x01, 0xed, 0xcd }, -{ 0x01, 0xee, 0xce }, -{ 0x01, 0xef, 0xcf }, -{ 0x01, 0xf0, 0xd0 }, -{ 0x01, 0xf1, 0xd1 }, -{ 0x00, 0xd2, 0xd2 }, -{ 0x01, 0xf3, 0xd3 }, -{ 0x01, 0xf4, 0xd4 }, -{ 0x01, 0xf5, 0xd5 }, -{ 0x01, 0xf6, 0xd6 }, -{ 0x01, 0xf7, 0xd7 }, -{ 0x01, 0xf8, 0xd8 }, -{ 0x01, 0xf9, 0xd9 }, -{ 0x01, 0xfa, 0xda }, -{ 0x01, 0xfb, 0xdb }, -{ 0x00, 0xdc, 0xb6 }, -{ 0x00, 0xdd, 0xb8 }, -{ 0x00, 0xde, 0xb9 }, -{ 0x00, 0xdf, 0xba }, -{ 0x00, 0xe0, 0xe0 }, -{ 0x00, 0xe1, 0xc1 }, -{ 0x00, 0xe2, 0xc2 }, -{ 0x00, 0xe3, 0xc3 }, -{ 0x00, 0xe4, 0xc4 }, -{ 0x00, 0xe5, 0xc5 }, -{ 0x00, 0xe6, 0xc6 }, -{ 0x00, 0xe7, 0xc7 }, -{ 0x00, 0xe8, 0xc8 }, -{ 0x00, 0xe9, 0xc9 }, -{ 0x00, 0xea, 0xca }, -{ 0x00, 0xeb, 0xcb }, -{ 0x00, 0xec, 0xcc }, -{ 0x00, 0xed, 0xcd }, -{ 0x00, 0xee, 0xce }, -{ 0x00, 0xef, 0xcf }, -{ 0x00, 0xf0, 0xd0 }, -{ 0x00, 0xf1, 0xd1 }, -{ 0x00, 0xf2, 0xd3 }, -{ 0x00, 0xf3, 0xd3 }, -{ 0x00, 0xf4, 0xd4 }, -{ 0x00, 0xf5, 0xd5 }, -{ 0x00, 0xf6, 0xd6 }, -{ 0x00, 0xf7, 0xd7 }, -{ 0x00, 0xf8, 0xd8 }, -{ 0x00, 0xf9, 0xd9 }, -{ 0x00, 0xfa, 0xda }, -{ 0x00, 0xfb, 0xdb }, -{ 0x00, 0xfc, 0xbc }, -{ 0x00, 0xfd, 0xbe }, -{ 0x00, 0xfe, 0xbf }, -{ 0x00, 0xff, 0xff } -}; - -static struct cs_info iso8_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x00, 0xa1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x00, 0xa3, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x00, 0xa5, 0xa5 }, -{ 0x00, 0xa6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa8 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x00, 0xaa, 0xaa }, -{ 0x00, 0xab, 0xab }, -{ 0x00, 0xac, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x00, 0xaf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xb1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x00, 0xb3, 0xb3 }, -{ 0x00, 0xb4, 0xb4 }, -{ 0x00, 0xb5, 0xb5 }, -{ 0x00, 0xb6, 0xb6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xb8 }, -{ 0x00, 0xb9, 0xb9 }, -{ 0x00, 0xba, 0xba }, -{ 0x00, 0xbb, 0xbb }, -{ 0x00, 0xbc, 0xbc }, -{ 0x00, 0xbd, 0xbd }, -{ 0x00, 0xbe, 0xbe }, -{ 0x00, 0xbf, 0xbf }, -{ 0x00, 0xc0, 0xc0 }, -{ 0x00, 0xc1, 0xc1 }, -{ 0x00, 0xc2, 0xc2 }, -{ 0x00, 0xc3, 0xc3 }, -{ 0x00, 0xc4, 0xc4 }, -{ 0x00, 0xc5, 0xc5 }, -{ 0x00, 0xc6, 0xc6 }, -{ 0x00, 0xc7, 0xc7 }, -{ 0x00, 0xc8, 0xc8 }, -{ 0x00, 0xc9, 0xc9 }, -{ 0x00, 0xca, 0xca }, -{ 0x00, 0xcb, 0xcb }, -{ 0x00, 0xcc, 0xcc }, -{ 0x00, 0xcd, 0xcd }, -{ 0x00, 0xce, 0xce }, -{ 0x00, 0xcf, 0xcf }, -{ 0x00, 0xd0, 0xd0 }, -{ 0x00, 0xd1, 0xd1 }, -{ 0x00, 0xd2, 0xd2 }, -{ 0x00, 0xd3, 0xd3 }, -{ 0x00, 0xd4, 0xd4 }, -{ 0x00, 0xd5, 0xd5 }, -{ 0x00, 0xd6, 0xd6 }, -{ 0x00, 0xd7, 0xd7 }, -{ 0x00, 0xd8, 0xd8 }, -{ 0x00, 0xd9, 0xd9 }, -{ 0x00, 0xda, 0xda }, -{ 0x00, 0xdb, 0xdb }, -{ 0x00, 0xdc, 0xdc }, -{ 0x00, 0xdd, 0xdd }, -{ 0x00, 0xde, 0xde }, -{ 0x00, 0xdf, 0xdf }, -{ 0x00, 0xe0, 0xe0 }, -{ 0x00, 0xe1, 0xe1 }, -{ 0x00, 0xe2, 0xe2 }, -{ 0x00, 0xe3, 0xe3 }, -{ 0x00, 0xe4, 0xe4 }, -{ 0x00, 0xe5, 0xe5 }, -{ 0x00, 0xe6, 0xe6 }, -{ 0x00, 0xe7, 0xe7 }, -{ 0x00, 0xe8, 0xe8 }, -{ 0x00, 0xe9, 0xe9 }, -{ 0x00, 0xea, 0xea }, -{ 0x00, 0xeb, 0xeb }, -{ 0x00, 0xec, 0xec }, -{ 0x00, 0xed, 0xed }, -{ 0x00, 0xee, 0xee }, -{ 0x00, 0xef, 0xef }, -{ 0x00, 0xf0, 0xf0 }, -{ 0x00, 0xf1, 0xf1 }, -{ 0x00, 0xf2, 0xf2 }, -{ 0x00, 0xf3, 0xf3 }, -{ 0x00, 0xf4, 0xf4 }, -{ 0x00, 0xf5, 0xf5 }, -{ 0x00, 0xf6, 0xf6 }, -{ 0x00, 0xf7, 0xf7 }, -{ 0x00, 0xf8, 0xf8 }, -{ 0x00, 0xf9, 0xf9 }, -{ 0x00, 0xfa, 0xfa }, -{ 0x00, 0xfb, 0xfb }, -{ 0x00, 0xfc, 0xfc }, -{ 0x00, 0xfd, 0xfd }, -{ 0x00, 0xfe, 0xfe }, -{ 0x00, 0xff, 0xff } -}; - -static struct cs_info iso9_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0xfd, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0xdd }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x00, 0xa1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x00, 0xa3, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x00, 0xa5, 0xa5 }, -{ 0x00, 0xa6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa8 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x00, 0xaa, 0xaa }, -{ 0x00, 0xab, 0xab }, -{ 0x00, 0xac, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x00, 0xaf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xb1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x00, 0xb3, 0xb3 }, -{ 0x00, 0xb4, 0xb4 }, -{ 0x00, 0xb5, 0xb5 }, -{ 0x00, 0xb6, 0xb6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xb8 }, -{ 0x00, 0xb9, 0xb9 }, -{ 0x00, 0xba, 0xba }, -{ 0x00, 0xbb, 0xbb }, -{ 0x00, 0xbc, 0xbc }, -{ 0x00, 0xbd, 0xbd }, -{ 0x00, 0xbe, 0xbe }, -{ 0x00, 0xbf, 0xbf }, -{ 0x01, 0xe0, 0xc0 }, -{ 0x01, 0xe1, 0xc1 }, -{ 0x01, 0xe2, 0xc2 }, -{ 0x01, 0xe3, 0xc3 }, -{ 0x01, 0xe4, 0xc4 }, -{ 0x01, 0xe5, 0xc5 }, -{ 0x01, 0xe6, 0xc6 }, -{ 0x01, 0xe7, 0xc7 }, -{ 0x01, 0xe8, 0xc8 }, -{ 0x01, 0xe9, 0xc9 }, -{ 0x01, 0xea, 0xca }, -{ 0x01, 0xeb, 0xcb }, -{ 0x01, 0xec, 0xcc }, -{ 0x01, 0xed, 0xcd }, -{ 0x01, 0xee, 0xce }, -{ 0x01, 0xef, 0xcf }, -{ 0x01, 0xf0, 0xd0 }, -{ 0x01, 0xf1, 0xd1 }, -{ 0x01, 0xf2, 0xd2 }, -{ 0x01, 0xf3, 0xd3 }, -{ 0x01, 0xf4, 0xd4 }, -{ 0x01, 0xf5, 0xd5 }, -{ 0x01, 0xf6, 0xd6 }, -{ 0x00, 0xd7, 0xd7 }, -{ 0x01, 0xf8, 0xd8 }, -{ 0x01, 0xf9, 0xd9 }, -{ 0x01, 0xfa, 0xda }, -{ 0x01, 0xfb, 0xdb }, -{ 0x01, 0xfc, 0xdc }, -{ 0x01, 0x69, 0xdd }, -{ 0x01, 0xfe, 0xde }, -{ 0x00, 0xdf, 0xdf }, -{ 0x00, 0xe0, 0xc0 }, -{ 0x00, 0xe1, 0xc1 }, -{ 0x00, 0xe2, 0xc2 }, -{ 0x00, 0xe3, 0xc3 }, -{ 0x00, 0xe4, 0xc4 }, -{ 0x00, 0xe5, 0xc5 }, -{ 0x00, 0xe6, 0xc6 }, -{ 0x00, 0xe7, 0xc7 }, -{ 0x00, 0xe8, 0xc8 }, -{ 0x00, 0xe9, 0xc9 }, -{ 0x00, 0xea, 0xca }, -{ 0x00, 0xeb, 0xcb }, -{ 0x00, 0xec, 0xcc }, -{ 0x00, 0xed, 0xcd }, -{ 0x00, 0xee, 0xce }, -{ 0x00, 0xef, 0xcf }, -{ 0x00, 0xf0, 0xd0 }, -{ 0x00, 0xf1, 0xd1 }, -{ 0x00, 0xf2, 0xd2 }, -{ 0x00, 0xf3, 0xd3 }, -{ 0x00, 0xf4, 0xd4 }, -{ 0x00, 0xf5, 0xd5 }, -{ 0x00, 0xf6, 0xd6 }, -{ 0x00, 0xf7, 0xf7 }, -{ 0x00, 0xf8, 0xd8 }, -{ 0x00, 0xf9, 0xd9 }, -{ 0x00, 0xfa, 0xda }, -{ 0x00, 0xfb, 0xdb }, -{ 0x00, 0xfc, 0xdc }, -{ 0x00, 0xfd, 0x49 }, -{ 0x00, 0xfe, 0xde }, -{ 0x00, 0xff, 0xff } -}; - -static struct cs_info iso10_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x00, 0xa1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x00, 0xa3, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x00, 0xa5, 0xa5 }, -{ 0x00, 0xa6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa8 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x00, 0xaa, 0xaa }, -{ 0x00, 0xab, 0xab }, -{ 0x00, 0xac, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x00, 0xaf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xb1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x00, 0xb3, 0xb3 }, -{ 0x00, 0xb4, 0xb4 }, -{ 0x00, 0xb5, 0xb5 }, -{ 0x00, 0xb6, 0xb6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xb8 }, -{ 0x00, 0xb9, 0xb9 }, -{ 0x00, 0xba, 0xba }, -{ 0x00, 0xbb, 0xbb }, -{ 0x00, 0xbc, 0xbc }, -{ 0x00, 0xbd, 0xbd }, -{ 0x00, 0xbe, 0xbe }, -{ 0x00, 0xbf, 0xbf }, -{ 0x00, 0xc0, 0xc0 }, -{ 0x00, 0xc1, 0xc1 }, -{ 0x00, 0xc2, 0xc2 }, -{ 0x00, 0xc3, 0xc3 }, -{ 0x00, 0xc4, 0xc4 }, -{ 0x00, 0xc5, 0xc5 }, -{ 0x00, 0xc6, 0xc6 }, -{ 0x00, 0xc7, 0xc7 }, -{ 0x00, 0xc8, 0xc8 }, -{ 0x00, 0xc9, 0xc9 }, -{ 0x00, 0xca, 0xca }, -{ 0x00, 0xcb, 0xcb }, -{ 0x00, 0xcc, 0xcc }, -{ 0x00, 0xcd, 0xcd }, -{ 0x00, 0xce, 0xce }, -{ 0x00, 0xcf, 0xcf }, -{ 0x00, 0xd0, 0xd0 }, -{ 0x00, 0xd1, 0xd1 }, -{ 0x00, 0xd2, 0xd2 }, -{ 0x00, 0xd3, 0xd3 }, -{ 0x00, 0xd4, 0xd4 }, -{ 0x00, 0xd5, 0xd5 }, -{ 0x00, 0xd6, 0xd6 }, -{ 0x00, 0xd7, 0xd7 }, -{ 0x00, 0xd8, 0xd8 }, -{ 0x00, 0xd9, 0xd9 }, -{ 0x00, 0xda, 0xda }, -{ 0x00, 0xdb, 0xdb }, -{ 0x00, 0xdc, 0xdc }, -{ 0x00, 0xdd, 0xdd }, -{ 0x00, 0xde, 0xde }, -{ 0x00, 0xdf, 0xdf }, -{ 0x00, 0xe0, 0xe0 }, -{ 0x00, 0xe1, 0xe1 }, -{ 0x00, 0xe2, 0xe2 }, -{ 0x00, 0xe3, 0xe3 }, -{ 0x00, 0xe4, 0xe4 }, -{ 0x00, 0xe5, 0xe5 }, -{ 0x00, 0xe6, 0xe6 }, -{ 0x00, 0xe7, 0xe7 }, -{ 0x00, 0xe8, 0xe8 }, -{ 0x00, 0xe9, 0xe9 }, -{ 0x00, 0xea, 0xea }, -{ 0x00, 0xeb, 0xeb }, -{ 0x00, 0xec, 0xec }, -{ 0x00, 0xed, 0xed }, -{ 0x00, 0xee, 0xee }, -{ 0x00, 0xef, 0xef }, -{ 0x00, 0xf0, 0xf0 }, -{ 0x00, 0xf1, 0xf1 }, -{ 0x00, 0xf2, 0xf2 }, -{ 0x00, 0xf3, 0xf3 }, -{ 0x00, 0xf4, 0xf4 }, -{ 0x00, 0xf5, 0xf5 }, -{ 0x00, 0xf6, 0xf6 }, -{ 0x00, 0xf7, 0xf7 }, -{ 0x00, 0xf8, 0xf8 }, -{ 0x00, 0xf9, 0xf9 }, -{ 0x00, 0xfa, 0xfa }, -{ 0x00, 0xfb, 0xfb }, -{ 0x00, 0xfc, 0xfc }, -{ 0x00, 0xfd, 0xfd }, -{ 0x00, 0xfe, 0xfe }, -{ 0x00, 0xff, 0xff } -}; - -static struct cs_info koi8r_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x00, 0xa1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x00, 0xa3, 0xb3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x00, 0xa5, 0xa5 }, -{ 0x00, 0xa6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa8 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x00, 0xaa, 0xaa }, -{ 0x00, 0xab, 0xab }, -{ 0x00, 0xac, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x00, 0xaf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xb1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x01, 0xa3, 0xb3 }, -{ 0x00, 0xb4, 0xb4 }, -{ 0x00, 0xb5, 0xb5 }, -{ 0x00, 0xb6, 0xb6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xb8 }, -{ 0x00, 0xb9, 0xb9 }, -{ 0x00, 0xba, 0xba }, -{ 0x00, 0xbb, 0xbb }, -{ 0x00, 0xbc, 0xbc }, -{ 0x00, 0xbd, 0xbd }, -{ 0x00, 0xbe, 0xbe }, -{ 0x00, 0xbf, 0xbf }, -{ 0x00, 0xc0, 0xe0 }, -{ 0x00, 0xc1, 0xe1 }, -{ 0x00, 0xc2, 0xe2 }, -{ 0x00, 0xc3, 0xe3 }, -{ 0x00, 0xc4, 0xe4 }, -{ 0x00, 0xc5, 0xe5 }, -{ 0x00, 0xc6, 0xe6 }, -{ 0x00, 0xc7, 0xe7 }, -{ 0x00, 0xc8, 0xe8 }, -{ 0x00, 0xc9, 0xe9 }, -{ 0x00, 0xca, 0xea }, -{ 0x00, 0xcb, 0xeb }, -{ 0x00, 0xcc, 0xec }, -{ 0x00, 0xcd, 0xed }, -{ 0x00, 0xce, 0xee }, -{ 0x00, 0xcf, 0xef }, -{ 0x00, 0xd0, 0xf0 }, -{ 0x00, 0xd1, 0xf1 }, -{ 0x00, 0xd2, 0xf2 }, -{ 0x00, 0xd3, 0xf3 }, -{ 0x00, 0xd4, 0xf4 }, -{ 0x00, 0xd5, 0xf5 }, -{ 0x00, 0xd6, 0xf6 }, -{ 0x00, 0xd7, 0xf7 }, -{ 0x00, 0xd8, 0xf8 }, -{ 0x00, 0xd9, 0xf9 }, -{ 0x00, 0xda, 0xfa }, -{ 0x00, 0xdb, 0xfb }, -{ 0x00, 0xdc, 0xfc }, -{ 0x00, 0xdd, 0xfd }, -{ 0x00, 0xde, 0xfe }, -{ 0x00, 0xdf, 0xff }, -{ 0x01, 0xc0, 0xe0 }, -{ 0x01, 0xc1, 0xe1 }, -{ 0x01, 0xc2, 0xe2 }, -{ 0x01, 0xc3, 0xe3 }, -{ 0x01, 0xc4, 0xe4 }, -{ 0x01, 0xc5, 0xe5 }, -{ 0x01, 0xc6, 0xe6 }, -{ 0x01, 0xc7, 0xe7 }, -{ 0x01, 0xc8, 0xe8 }, -{ 0x01, 0xc9, 0xe9 }, -{ 0x01, 0xca, 0xea }, -{ 0x01, 0xcb, 0xeb }, -{ 0x01, 0xcc, 0xec }, -{ 0x01, 0xcd, 0xed }, -{ 0x01, 0xce, 0xee }, -{ 0x01, 0xcf, 0xef }, -{ 0x01, 0xd0, 0xf0 }, -{ 0x01, 0xd1, 0xf1 }, -{ 0x01, 0xd2, 0xf2 }, -{ 0x01, 0xd3, 0xf3 }, -{ 0x01, 0xd4, 0xf4 }, -{ 0x01, 0xd5, 0xf5 }, -{ 0x01, 0xd6, 0xf6 }, -{ 0x01, 0xd7, 0xf7 }, -{ 0x01, 0xd8, 0xf8 }, -{ 0x01, 0xd9, 0xf9 }, -{ 0x01, 0xda, 0xfa }, -{ 0x01, 0xdb, 0xfb }, -{ 0x01, 0xdc, 0xfc }, -{ 0x01, 0xdd, 0xfd }, -{ 0x01, 0xde, 0xfe }, -{ 0x01, 0xdf, 0xff } -}; - -static struct cs_info koi8u_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x00, 0xa1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x00, 0xa3, 0xb3 }, -{ 0x00, 0xa4, 0xb4 }, /* ie */ -{ 0x00, 0xa5, 0xa5 }, -{ 0x00, 0xa6, 0xb6 }, /* i */ -{ 0x00, 0xa7, 0xb7 }, /* ii */ -{ 0x00, 0xa8, 0xa8 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x00, 0xaa, 0xaa }, -{ 0x00, 0xab, 0xab }, -{ 0x00, 0xac, 0xac }, -{ 0x00, 0xad, 0xbd }, /* g'' */ -{ 0x00, 0xae, 0xae }, -{ 0x00, 0xaf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xb1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x01, 0xa3, 0xb3 }, -{ 0x00, 0xb4, 0xb4 }, /* IE */ -{ 0x00, 0xb5, 0xb5 }, -{ 0x00, 0xb6, 0xb6 }, /* I */ -{ 0x00, 0xb7, 0xb7 }, /* II */ -{ 0x00, 0xb8, 0xb8 }, -{ 0x00, 0xb9, 0xb9 }, -{ 0x00, 0xba, 0xba }, -{ 0x00, 0xbb, 0xbb }, -{ 0x00, 0xbc, 0xbc }, -{ 0x00, 0xbd, 0xbd }, -{ 0x00, 0xbe, 0xbe }, -{ 0x00, 0xbf, 0xbf }, -{ 0x00, 0xc0, 0xe0 }, -{ 0x00, 0xc1, 0xe1 }, -{ 0x00, 0xc2, 0xe2 }, -{ 0x00, 0xc3, 0xe3 }, -{ 0x00, 0xc4, 0xe4 }, -{ 0x00, 0xc5, 0xe5 }, -{ 0x00, 0xc6, 0xe6 }, -{ 0x00, 0xc7, 0xe7 }, -{ 0x00, 0xc8, 0xe8 }, -{ 0x00, 0xc9, 0xe9 }, -{ 0x00, 0xca, 0xea }, -{ 0x00, 0xcb, 0xeb }, -{ 0x00, 0xcc, 0xec }, -{ 0x00, 0xcd, 0xed }, -{ 0x00, 0xce, 0xee }, -{ 0x00, 0xcf, 0xef }, -{ 0x00, 0xd0, 0xf0 }, -{ 0x00, 0xd1, 0xf1 }, -{ 0x00, 0xd2, 0xf2 }, -{ 0x00, 0xd3, 0xf3 }, -{ 0x00, 0xd4, 0xf4 }, -{ 0x00, 0xd5, 0xf5 }, -{ 0x00, 0xd6, 0xf6 }, -{ 0x00, 0xd7, 0xf7 }, -{ 0x00, 0xd8, 0xf8 }, -{ 0x00, 0xd9, 0xf9 }, -{ 0x00, 0xda, 0xfa }, -{ 0x00, 0xdb, 0xfb }, -{ 0x00, 0xdc, 0xfc }, -{ 0x00, 0xdd, 0xfd }, -{ 0x00, 0xde, 0xfe }, -{ 0x00, 0xdf, 0xff }, -{ 0x01, 0xc0, 0xe0 }, -{ 0x01, 0xc1, 0xe1 }, -{ 0x01, 0xc2, 0xe2 }, -{ 0x01, 0xc3, 0xe3 }, -{ 0x01, 0xc4, 0xe4 }, -{ 0x01, 0xc5, 0xe5 }, -{ 0x01, 0xc6, 0xe6 }, -{ 0x01, 0xc7, 0xe7 }, -{ 0x01, 0xc8, 0xe8 }, -{ 0x01, 0xc9, 0xe9 }, -{ 0x01, 0xca, 0xea }, -{ 0x01, 0xcb, 0xeb }, -{ 0x01, 0xcc, 0xec }, -{ 0x01, 0xcd, 0xed }, -{ 0x01, 0xce, 0xee }, -{ 0x01, 0xcf, 0xef }, -{ 0x01, 0xd0, 0xf0 }, -{ 0x01, 0xd1, 0xf1 }, -{ 0x01, 0xd2, 0xf2 }, -{ 0x01, 0xd3, 0xf3 }, -{ 0x01, 0xd4, 0xf4 }, -{ 0x01, 0xd5, 0xf5 }, -{ 0x01, 0xd6, 0xf6 }, -{ 0x01, 0xd7, 0xf7 }, -{ 0x01, 0xd8, 0xf8 }, -{ 0x01, 0xd9, 0xf9 }, -{ 0x01, 0xda, 0xfa }, -{ 0x01, 0xdb, 0xfb }, -{ 0x01, 0xdc, 0xfc }, -{ 0x01, 0xdd, 0xfd }, -{ 0x01, 0xde, 0xfe }, -{ 0x01, 0xdf, 0xff } -}; - -static struct cs_info cp1251_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x01, 0x90, 0x80 }, -{ 0x01, 0x83, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x81 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x01, 0x9a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x01, 0x9c, 0x8c }, -{ 0x01, 0x9d, 0x8d }, -{ 0x01, 0x9e, 0x8e }, -{ 0x01, 0x9f, 0x8f }, -{ 0x00, 0x90, 0x80 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x8a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x8c }, -{ 0x00, 0x9d, 0x8d }, -{ 0x00, 0x9e, 0x8e }, -{ 0x00, 0x9f, 0x8f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x01, 0xa2, 0xa1 }, -{ 0x00, 0xa2, 0xa1 }, -{ 0x01, 0xbc, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x01, 0xb4, 0xa5 }, -{ 0x00, 0xa6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x01, 0xb8, 0xa8 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x01, 0xba, 0xaa }, -{ 0x00, 0xab, 0xab }, -{ 0x00, 0xac, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x01, 0xbf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xb1 }, -{ 0x01, 0xb3, 0xb2 }, -{ 0x00, 0xb3, 0xb2 }, -{ 0x00, 0xb4, 0xa5 }, -{ 0x00, 0xb5, 0xb5 }, -{ 0x00, 0xb6, 0xb6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xa8 }, -{ 0x00, 0xb9, 0xb9 }, -{ 0x00, 0xba, 0xaa }, -{ 0x00, 0xbb, 0xbb }, -{ 0x00, 0xbc, 0xa3 }, -{ 0x01, 0xbe, 0xbd }, -{ 0x00, 0xbe, 0xbd }, -{ 0x00, 0xbf, 0xaf }, -{ 0x01, 0xe0, 0xc0 }, -{ 0x01, 0xe1, 0xc1 }, -{ 0x01, 0xe2, 0xc2 }, -{ 0x01, 0xe3, 0xc3 }, -{ 0x01, 0xe4, 0xc4 }, -{ 0x01, 0xe5, 0xc5 }, -{ 0x01, 0xe6, 0xc6 }, -{ 0x01, 0xe7, 0xc7 }, -{ 0x01, 0xe8, 0xc8 }, -{ 0x01, 0xe9, 0xc9 }, -{ 0x01, 0xea, 0xca }, -{ 0x01, 0xeb, 0xcb }, -{ 0x01, 0xec, 0xcc }, -{ 0x01, 0xed, 0xcd }, -{ 0x01, 0xee, 0xce }, -{ 0x01, 0xef, 0xcf }, -{ 0x01, 0xf0, 0xd0 }, -{ 0x01, 0xf1, 0xd1 }, -{ 0x01, 0xf2, 0xd2 }, -{ 0x01, 0xf3, 0xd3 }, -{ 0x01, 0xf4, 0xd4 }, -{ 0x01, 0xf5, 0xd5 }, -{ 0x01, 0xf6, 0xd6 }, -{ 0x01, 0xf7, 0xd7 }, -{ 0x01, 0xf8, 0xd8 }, -{ 0x01, 0xf9, 0xd9 }, -{ 0x01, 0xfa, 0xda }, -{ 0x01, 0xfb, 0xdb }, -{ 0x01, 0xfc, 0xdc }, -{ 0x01, 0xfd, 0xdd }, -{ 0x01, 0xfe, 0xde }, -{ 0x01, 0xff, 0xdf }, -{ 0x00, 0xe0, 0xc0 }, -{ 0x00, 0xe1, 0xc1 }, -{ 0x00, 0xe2, 0xc2 }, -{ 0x00, 0xe3, 0xc3 }, -{ 0x00, 0xe4, 0xc4 }, -{ 0x00, 0xe5, 0xc5 }, -{ 0x00, 0xe6, 0xc6 }, -{ 0x00, 0xe7, 0xc7 }, -{ 0x00, 0xe8, 0xc8 }, -{ 0x00, 0xe9, 0xc9 }, -{ 0x00, 0xea, 0xca }, -{ 0x00, 0xeb, 0xcb }, -{ 0x00, 0xec, 0xcc }, -{ 0x00, 0xed, 0xcd }, -{ 0x00, 0xee, 0xce }, -{ 0x00, 0xef, 0xcf }, -{ 0x00, 0xf0, 0xd0 }, -{ 0x00, 0xf1, 0xd1 }, -{ 0x00, 0xf2, 0xd2 }, -{ 0x00, 0xf3, 0xd3 }, -{ 0x00, 0xf4, 0xd4 }, -{ 0x00, 0xf5, 0xd5 }, -{ 0x00, 0xf6, 0xd6 }, -{ 0x00, 0xf7, 0xd7 }, -{ 0x00, 0xf8, 0xd8 }, -{ 0x00, 0xf9, 0xd9 }, -{ 0x00, 0xfa, 0xda }, -{ 0x00, 0xfb, 0xdb }, -{ 0x00, 0xfc, 0xdc }, -{ 0x00, 0xfd, 0xdd }, -{ 0x00, 0xfe, 0xde }, -{ 0x00, 0xff, 0xdf } -}; - -static struct cs_info iso13_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0A, 0x0A }, -{ 0x00, 0x0B, 0x0B }, -{ 0x00, 0x0C, 0x0C }, -{ 0x00, 0x0D, 0x0D }, -{ 0x00, 0x0E, 0x0E }, -{ 0x00, 0x0F, 0x0F }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1A, 0x1A }, -{ 0x00, 0x1B, 0x1B }, -{ 0x00, 0x1C, 0x1C }, -{ 0x00, 0x1D, 0x1D }, -{ 0x00, 0x1E, 0x1E }, -{ 0x00, 0x1F, 0x1F }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2A, 0x2A }, -{ 0x00, 0x2B, 0x2B }, -{ 0x00, 0x2C, 0x2C }, -{ 0x00, 0x2D, 0x2D }, -{ 0x00, 0x2E, 0x2E }, -{ 0x00, 0x2F, 0x2F }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3A, 0x3A }, -{ 0x00, 0x3B, 0x3B }, -{ 0x00, 0x3C, 0x3C }, -{ 0x00, 0x3D, 0x3D }, -{ 0x00, 0x3E, 0x3E }, -{ 0x00, 0x3F, 0x3F }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6A, 0x4A }, -{ 0x01, 0x6B, 0x4B }, -{ 0x01, 0x6C, 0x4C }, -{ 0x01, 0x6D, 0x4D }, -{ 0x01, 0x6E, 0x4E }, -{ 0x01, 0x6F, 0x4F }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7A, 0x5A }, -{ 0x00, 0x5B, 0x5B }, -{ 0x00, 0x5C, 0x5C }, -{ 0x00, 0x5D, 0x5D }, -{ 0x00, 0x5E, 0x5E }, -{ 0x00, 0x5F, 0x5F }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6A, 0x4A }, -{ 0x00, 0x6B, 0x4B }, -{ 0x00, 0x6C, 0x4C }, -{ 0x00, 0x6D, 0x4D }, -{ 0x00, 0x6E, 0x4E }, -{ 0x00, 0x6F, 0x4F }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7A, 0x5A }, -{ 0x00, 0x7B, 0x7B }, -{ 0x00, 0x7C, 0x7C }, -{ 0x00, 0x7D, 0x7D }, -{ 0x00, 0x7E, 0x7E }, -{ 0x00, 0x7F, 0x7F }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8A, 0x8A }, -{ 0x00, 0x8B, 0x8B }, -{ 0x00, 0x8C, 0x8C }, -{ 0x00, 0x8D, 0x8D }, -{ 0x00, 0x8E, 0x8E }, -{ 0x00, 0x8F, 0x8F }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9A, 0x9A }, -{ 0x00, 0x9B, 0x9B }, -{ 0x00, 0x9C, 0x9C }, -{ 0x00, 0x9D, 0x9D }, -{ 0x00, 0x9E, 0x9E }, -{ 0x00, 0x9F, 0x9F }, -{ 0x00, 0xA0, 0xA0 }, -{ 0x00, 0xA1, 0xA1 }, -{ 0x00, 0xA2, 0xA2 }, -{ 0x00, 0xA3, 0xA3 }, -{ 0x00, 0xA4, 0xA4 }, -{ 0x00, 0xA5, 0xA5 }, -{ 0x00, 0xA6, 0xA6 }, -{ 0x00, 0xA7, 0xA7 }, -{ 0x01, 0xB8, 0xA8 }, -{ 0x00, 0xA9, 0xA9 }, -{ 0x01, 0xBA, 0xAA }, -{ 0x00, 0xAB, 0xAB }, -{ 0x00, 0xAC, 0xAC }, -{ 0x00, 0xAD, 0xAD }, -{ 0x00, 0xAE, 0xAE }, -{ 0x01, 0xBF, 0xAF }, -{ 0x00, 0xB0, 0xB0 }, -{ 0x00, 0xB1, 0xB1 }, -{ 0x00, 0xB2, 0xB2 }, -{ 0x00, 0xB3, 0xB3 }, -{ 0x00, 0xB4, 0xB4 }, -{ 0x00, 0xB5, 0xB5 }, -{ 0x00, 0xB6, 0xB6 }, -{ 0x00, 0xB7, 0xB7 }, -{ 0x00, 0xB8, 0xA8 }, -{ 0x00, 0xB9, 0xB9 }, -{ 0x00, 0xBA, 0xAA }, -{ 0x00, 0xBB, 0xBB }, -{ 0x00, 0xBC, 0xBC }, -{ 0x00, 0xBD, 0xBD }, -{ 0x00, 0xBE, 0xBE }, -{ 0x00, 0xBF, 0xAF }, -{ 0x01, 0xE0, 0xC0 }, -{ 0x01, 0xE1, 0xC1 }, -{ 0x01, 0xE2, 0xC2 }, -{ 0x01, 0xE3, 0xC3 }, -{ 0x01, 0xE4, 0xC4 }, -{ 0x01, 0xE5, 0xC5 }, -{ 0x01, 0xE6, 0xC6 }, -{ 0x01, 0xE7, 0xC7 }, -{ 0x01, 0xE8, 0xC8 }, -{ 0x01, 0xE9, 0xC9 }, -{ 0x01, 0xEA, 0xCA }, -{ 0x01, 0xEB, 0xCB }, -{ 0x01, 0xEC, 0xCC }, -{ 0x01, 0xED, 0xCD }, -{ 0x01, 0xEE, 0xCE }, -{ 0x01, 0xEF, 0xCF }, -{ 0x01, 0xF0, 0xD0 }, -{ 0x01, 0xF1, 0xD1 }, -{ 0x01, 0xF2, 0xD2 }, -{ 0x01, 0xF3, 0xD3 }, -{ 0x01, 0xF4, 0xD4 }, -{ 0x01, 0xF5, 0xD5 }, -{ 0x01, 0xF6, 0xD6 }, -{ 0x00, 0xD7, 0xD7 }, -{ 0x01, 0xF8, 0xD8 }, -{ 0x01, 0xF9, 0xD9 }, -{ 0x01, 0xFA, 0xDA }, -{ 0x01, 0xFB, 0xDB }, -{ 0x01, 0xFC, 0xDC }, -{ 0x01, 0xFD, 0xDD }, -{ 0x01, 0xFE, 0xDE }, -{ 0x00, 0xDF, 0xDF }, -{ 0x00, 0xE0, 0xC0 }, -{ 0x00, 0xE1, 0xC1 }, -{ 0x00, 0xE2, 0xC2 }, -{ 0x00, 0xE3, 0xC3 }, -{ 0x00, 0xE4, 0xC4 }, -{ 0x00, 0xE5, 0xC5 }, -{ 0x00, 0xE6, 0xC6 }, -{ 0x00, 0xE7, 0xC7 }, -{ 0x00, 0xE8, 0xC8 }, -{ 0x00, 0xE9, 0xC9 }, -{ 0x00, 0xEA, 0xCA }, -{ 0x00, 0xEB, 0xCB }, -{ 0x00, 0xEC, 0xCC }, -{ 0x00, 0xED, 0xCD }, -{ 0x00, 0xEE, 0xCE }, -{ 0x00, 0xEF, 0xCF }, -{ 0x00, 0xF0, 0xD0 }, -{ 0x00, 0xF1, 0xD1 }, -{ 0x00, 0xF2, 0xD2 }, -{ 0x00, 0xF3, 0xD3 }, -{ 0x00, 0xF4, 0xD4 }, -{ 0x00, 0xF5, 0xD5 }, -{ 0x00, 0xF6, 0xD6 }, -{ 0x00, 0xF7, 0xF7 }, -{ 0x00, 0xF8, 0xD8 }, -{ 0x00, 0xF9, 0xD9 }, -{ 0x00, 0xFA, 0xDA }, -{ 0x00, 0xFB, 0xDB }, -{ 0x00, 0xFC, 0xDC }, -{ 0x00, 0xFD, 0xDD }, -{ 0x00, 0xFE, 0xDE }, -{ 0x00, 0xFF, 0xFF } -}; - - -static struct cs_info iso14_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x01, 0xa2, 0xa1 }, -{ 0x00, 0xa2, 0xa1 }, -{ 0x00, 0xa3, 0xa3 }, -{ 0x01, 0xa5, 0xa4 }, -{ 0x00, 0xa5, 0xa4 }, -{ 0x01, 0xa6, 0xab }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x01, 0xb8, 0xa8 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x01, 0xba, 0xaa }, -{ 0x00, 0xab, 0xa6 }, -{ 0x01, 0xbc, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x01, 0xff, 0xaf }, -{ 0x01, 0xb1, 0xb0 }, -{ 0x00, 0xb1, 0xb0 }, -{ 0x01, 0xb3, 0xb2 }, -{ 0x00, 0xb3, 0xb2 }, -{ 0x01, 0xb5, 0xb4 }, -{ 0x00, 0xb5, 0xb4 }, -{ 0x00, 0xb6, 0xb6 }, -{ 0x01, 0xb9, 0xb7 }, -{ 0x00, 0xb8, 0xa8 }, -{ 0x00, 0xb9, 0xb6 }, -{ 0x00, 0xba, 0xaa }, -{ 0x01, 0xbf, 0xbb }, -{ 0x00, 0xbc, 0xac }, -{ 0x01, 0xbe, 0xbd }, -{ 0x00, 0xbe, 0xbd }, -{ 0x00, 0xbf, 0xbb }, -{ 0x01, 0xe0, 0xc0 }, -{ 0x01, 0xe1, 0xc1 }, -{ 0x01, 0xe2, 0xc2 }, -{ 0x01, 0xe3, 0xc3 }, -{ 0x01, 0xe4, 0xc4 }, -{ 0x01, 0xe5, 0xc5 }, -{ 0x01, 0xe6, 0xc6 }, -{ 0x01, 0xe7, 0xc7 }, -{ 0x01, 0xe8, 0xc8 }, -{ 0x01, 0xe9, 0xc9 }, -{ 0x01, 0xea, 0xca }, -{ 0x01, 0xeb, 0xcb }, -{ 0x01, 0xec, 0xcc }, -{ 0x01, 0xed, 0xcd }, -{ 0x01, 0xee, 0xce }, -{ 0x01, 0xef, 0xcf }, -{ 0x01, 0xf0, 0xd0 }, -{ 0x01, 0xf1, 0xd1 }, -{ 0x01, 0xf2, 0xd2 }, -{ 0x01, 0xf3, 0xd3 }, -{ 0x01, 0xf4, 0xd4 }, -{ 0x01, 0xf5, 0xd5 }, -{ 0x01, 0xf6, 0xd6 }, -{ 0x01, 0xf7, 0xd7 }, -{ 0x01, 0xf8, 0xd8 }, -{ 0x01, 0xf9, 0xd9 }, -{ 0x01, 0xfa, 0xda }, -{ 0x01, 0xfb, 0xdb }, -{ 0x01, 0xfc, 0xdc }, -{ 0x01, 0xfd, 0xdd }, -{ 0x01, 0xfe, 0xde }, -{ 0x00, 0xdf, 0xdf }, -{ 0x00, 0xe0, 0xc0 }, -{ 0x00, 0xe1, 0xc1 }, -{ 0x00, 0xe2, 0xc2 }, -{ 0x00, 0xe3, 0xc3 }, -{ 0x00, 0xe4, 0xc4 }, -{ 0x00, 0xe5, 0xc5 }, -{ 0x00, 0xe6, 0xc6 }, -{ 0x00, 0xe7, 0xc7 }, -{ 0x00, 0xe8, 0xc8 }, -{ 0x00, 0xe9, 0xc9 }, -{ 0x00, 0xea, 0xca }, -{ 0x00, 0xeb, 0xcb }, -{ 0x00, 0xec, 0xcc }, -{ 0x00, 0xed, 0xcd }, -{ 0x00, 0xee, 0xce }, -{ 0x00, 0xef, 0xcf }, -{ 0x00, 0xf0, 0xd0 }, -{ 0x00, 0xf1, 0xd1 }, -{ 0x00, 0xf2, 0xd2 }, -{ 0x00, 0xf3, 0xd3 }, -{ 0x00, 0xf4, 0xd4 }, -{ 0x00, 0xf5, 0xd5 }, -{ 0x00, 0xf6, 0xd6 }, -{ 0x00, 0xf7, 0xd7 }, -{ 0x00, 0xf8, 0xd8 }, -{ 0x00, 0xf9, 0xd9 }, -{ 0x00, 0xfa, 0xda }, -{ 0x00, 0xfb, 0xdb }, -{ 0x00, 0xfc, 0xdc }, -{ 0x00, 0xfd, 0xdd }, -{ 0x00, 0xfe, 0xde }, -{ 0x00, 0xff, 0xff } -}; - -static struct cs_info iso15_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x00, 0xa1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x00, 0xa3, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x00, 0xa5, 0xa5 }, -{ 0x01, 0xa8, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa6 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x00, 0xaa, 0xaa }, -{ 0x00, 0xab, 0xab }, -{ 0x00, 0xac, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x00, 0xaf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xb1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x00, 0xb3, 0xb3 }, -{ 0x01, 0xb8, 0xb4 }, -{ 0x00, 0xb5, 0xb5 }, -{ 0x00, 0xb6, 0xb6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xb4 }, -{ 0x00, 0xb9, 0xb9 }, -{ 0x00, 0xba, 0xba }, -{ 0x00, 0xbb, 0xbb }, -{ 0x01, 0xbd, 0xbc }, -{ 0x00, 0xbd, 0xbc }, -{ 0x01, 0xff, 0xbe }, -{ 0x00, 0xbf, 0xbf }, -{ 0x01, 0xe0, 0xc0 }, -{ 0x01, 0xe1, 0xc1 }, -{ 0x01, 0xe2, 0xc2 }, -{ 0x01, 0xe3, 0xc3 }, -{ 0x01, 0xe4, 0xc4 }, -{ 0x01, 0xe5, 0xc5 }, -{ 0x01, 0xe6, 0xc6 }, -{ 0x01, 0xe7, 0xc7 }, -{ 0x01, 0xe8, 0xc8 }, -{ 0x01, 0xe9, 0xc9 }, -{ 0x01, 0xea, 0xca }, -{ 0x01, 0xeb, 0xcb }, -{ 0x01, 0xec, 0xcc }, -{ 0x01, 0xed, 0xcd }, -{ 0x01, 0xee, 0xce }, -{ 0x01, 0xef, 0xcf }, -{ 0x01, 0xf0, 0xd0 }, -{ 0x01, 0xf1, 0xd1 }, -{ 0x01, 0xf2, 0xd2 }, -{ 0x01, 0xf3, 0xd3 }, -{ 0x01, 0xf4, 0xd4 }, -{ 0x01, 0xf5, 0xd5 }, -{ 0x01, 0xf6, 0xd6 }, -{ 0x00, 0xd7, 0xd7 }, -{ 0x01, 0xf8, 0xd8 }, -{ 0x01, 0xf9, 0xd9 }, -{ 0x01, 0xfa, 0xda }, -{ 0x01, 0xfb, 0xdb }, -{ 0x01, 0xfc, 0xdc }, -{ 0x01, 0xfd, 0xdd }, -{ 0x01, 0xfe, 0xde }, -{ 0x00, 0xdf, 0xdf }, -{ 0x00, 0xe0, 0xc0 }, -{ 0x00, 0xe1, 0xc1 }, -{ 0x00, 0xe2, 0xc2 }, -{ 0x00, 0xe3, 0xc3 }, -{ 0x00, 0xe4, 0xc4 }, -{ 0x00, 0xe5, 0xc5 }, -{ 0x00, 0xe6, 0xc6 }, -{ 0x00, 0xe7, 0xc7 }, -{ 0x00, 0xe8, 0xc8 }, -{ 0x00, 0xe9, 0xc9 }, -{ 0x00, 0xea, 0xca }, -{ 0x00, 0xeb, 0xcb }, -{ 0x00, 0xec, 0xcc }, -{ 0x00, 0xed, 0xcd }, -{ 0x00, 0xee, 0xce }, -{ 0x00, 0xef, 0xcf }, -{ 0x00, 0xf0, 0xd0 }, -{ 0x00, 0xf1, 0xd1 }, -{ 0x00, 0xf2, 0xd2 }, -{ 0x00, 0xf3, 0xd3 }, -{ 0x00, 0xf4, 0xd4 }, -{ 0x00, 0xf5, 0xd5 }, -{ 0x00, 0xf6, 0xd6 }, -{ 0x00, 0xf7, 0xf7 }, -{ 0x00, 0xf8, 0xd8 }, -{ 0x00, 0xf9, 0xd9 }, -{ 0x00, 0xfa, 0xda }, -{ 0x00, 0xfb, 0xdb }, -{ 0x00, 0xfc, 0xdc }, -{ 0x00, 0xfd, 0xdd }, -{ 0x00, 0xfe, 0xde }, -{ 0x00, 0xff, 0xbe } -}; - -static struct cs_info iscii_devanagari_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x00, 0xa1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x00, 0xa3, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x00, 0xa5, 0xa5 }, -{ 0x00, 0xa6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa8 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x00, 0xaa, 0xaa }, -{ 0x00, 0xab, 0xab }, -{ 0x00, 0xac, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x00, 0xaf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xb1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x00, 0xb3, 0xb3 }, -{ 0x00, 0xb4, 0xb4 }, -{ 0x00, 0xb5, 0xb5 }, -{ 0x00, 0xb6, 0xb6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xb8 }, -{ 0x00, 0xb9, 0xb9 }, -{ 0x00, 0xba, 0xba }, -{ 0x00, 0xbb, 0xbb }, -{ 0x00, 0xbc, 0xbc }, -{ 0x00, 0xbd, 0xbd }, -{ 0x00, 0xbe, 0xbe }, -{ 0x00, 0xbf, 0xbf }, -{ 0x00, 0xc0, 0xc0 }, -{ 0x00, 0xc1, 0xc1 }, -{ 0x00, 0xc2, 0xc2 }, -{ 0x00, 0xc3, 0xc3 }, -{ 0x00, 0xc4, 0xc4 }, -{ 0x00, 0xc5, 0xc5 }, -{ 0x00, 0xc6, 0xc6 }, -{ 0x00, 0xc7, 0xc7 }, -{ 0x00, 0xc8, 0xc8 }, -{ 0x00, 0xc9, 0xc9 }, -{ 0x00, 0xca, 0xca }, -{ 0x00, 0xcb, 0xcb }, -{ 0x00, 0xcc, 0xcc }, -{ 0x00, 0xcd, 0xcd }, -{ 0x00, 0xce, 0xce }, -{ 0x00, 0xcf, 0xcf }, -{ 0x00, 0xd0, 0xd0 }, -{ 0x00, 0xd1, 0xd1 }, -{ 0x00, 0xd2, 0xd2 }, -{ 0x00, 0xd3, 0xd3 }, -{ 0x00, 0xd4, 0xd4 }, -{ 0x00, 0xd5, 0xd5 }, -{ 0x00, 0xd6, 0xd6 }, -{ 0x00, 0xd7, 0xd7 }, -{ 0x00, 0xd8, 0xd8 }, -{ 0x00, 0xd9, 0xd9 }, -{ 0x00, 0xda, 0xda }, -{ 0x00, 0xdb, 0xdb }, -{ 0x00, 0xdc, 0xdc }, -{ 0x00, 0xdd, 0xdd }, -{ 0x00, 0xde, 0xde }, -{ 0x00, 0xdf, 0xdf }, -{ 0x00, 0xe0, 0xe0 }, -{ 0x00, 0xe1, 0xe1 }, -{ 0x00, 0xe2, 0xe2 }, -{ 0x00, 0xe3, 0xe3 }, -{ 0x00, 0xe4, 0xe4 }, -{ 0x00, 0xe5, 0xe5 }, -{ 0x00, 0xe6, 0xe6 }, -{ 0x00, 0xe7, 0xe7 }, -{ 0x00, 0xe8, 0xe8 }, -{ 0x00, 0xe9, 0xe9 }, -{ 0x00, 0xea, 0xea }, -{ 0x00, 0xeb, 0xeb }, -{ 0x00, 0xec, 0xec }, -{ 0x00, 0xed, 0xed }, -{ 0x00, 0xee, 0xee }, -{ 0x00, 0xef, 0xef }, -{ 0x00, 0xf0, 0xf0 }, -{ 0x00, 0xf1, 0xf1 }, -{ 0x00, 0xf2, 0xf2 }, -{ 0x00, 0xf3, 0xf3 }, -{ 0x00, 0xf4, 0xf4 }, -{ 0x00, 0xf5, 0xf5 }, -{ 0x00, 0xf6, 0xf6 }, -{ 0x00, 0xf7, 0xf7 }, -{ 0x00, 0xf8, 0xf8 }, -{ 0x00, 0xf9, 0xf9 }, -{ 0x00, 0xfa, 0xfa }, -{ 0x00, 0xfb, 0xfb }, -{ 0x00, 0xfc, 0xfc }, -{ 0x00, 0xfd, 0xfd }, -{ 0x00, 0xfe, 0xfe }, -{ 0x00, 0xff, 0xff } -}; - -static struct cs_info tis620_tbl[] = { -{ 0x00, 0x00, 0x00 }, -{ 0x00, 0x01, 0x01 }, -{ 0x00, 0x02, 0x02 }, -{ 0x00, 0x03, 0x03 }, -{ 0x00, 0x04, 0x04 }, -{ 0x00, 0x05, 0x05 }, -{ 0x00, 0x06, 0x06 }, -{ 0x00, 0x07, 0x07 }, -{ 0x00, 0x08, 0x08 }, -{ 0x00, 0x09, 0x09 }, -{ 0x00, 0x0a, 0x0a }, -{ 0x00, 0x0b, 0x0b }, -{ 0x00, 0x0c, 0x0c }, -{ 0x00, 0x0d, 0x0d }, -{ 0x00, 0x0e, 0x0e }, -{ 0x00, 0x0f, 0x0f }, -{ 0x00, 0x10, 0x10 }, -{ 0x00, 0x11, 0x11 }, -{ 0x00, 0x12, 0x12 }, -{ 0x00, 0x13, 0x13 }, -{ 0x00, 0x14, 0x14 }, -{ 0x00, 0x15, 0x15 }, -{ 0x00, 0x16, 0x16 }, -{ 0x00, 0x17, 0x17 }, -{ 0x00, 0x18, 0x18 }, -{ 0x00, 0x19, 0x19 }, -{ 0x00, 0x1a, 0x1a }, -{ 0x00, 0x1b, 0x1b }, -{ 0x00, 0x1c, 0x1c }, -{ 0x00, 0x1d, 0x1d }, -{ 0x00, 0x1e, 0x1e }, -{ 0x00, 0x1f, 0x1f }, -{ 0x00, 0x20, 0x20 }, -{ 0x00, 0x21, 0x21 }, -{ 0x00, 0x22, 0x22 }, -{ 0x00, 0x23, 0x23 }, -{ 0x00, 0x24, 0x24 }, -{ 0x00, 0x25, 0x25 }, -{ 0x00, 0x26, 0x26 }, -{ 0x00, 0x27, 0x27 }, -{ 0x00, 0x28, 0x28 }, -{ 0x00, 0x29, 0x29 }, -{ 0x00, 0x2a, 0x2a }, -{ 0x00, 0x2b, 0x2b }, -{ 0x00, 0x2c, 0x2c }, -{ 0x00, 0x2d, 0x2d }, -{ 0x00, 0x2e, 0x2e }, -{ 0x00, 0x2f, 0x2f }, -{ 0x00, 0x30, 0x30 }, -{ 0x00, 0x31, 0x31 }, -{ 0x00, 0x32, 0x32 }, -{ 0x00, 0x33, 0x33 }, -{ 0x00, 0x34, 0x34 }, -{ 0x00, 0x35, 0x35 }, -{ 0x00, 0x36, 0x36 }, -{ 0x00, 0x37, 0x37 }, -{ 0x00, 0x38, 0x38 }, -{ 0x00, 0x39, 0x39 }, -{ 0x00, 0x3a, 0x3a }, -{ 0x00, 0x3b, 0x3b }, -{ 0x00, 0x3c, 0x3c }, -{ 0x00, 0x3d, 0x3d }, -{ 0x00, 0x3e, 0x3e }, -{ 0x00, 0x3f, 0x3f }, -{ 0x00, 0x40, 0x40 }, -{ 0x01, 0x61, 0x41 }, -{ 0x01, 0x62, 0x42 }, -{ 0x01, 0x63, 0x43 }, -{ 0x01, 0x64, 0x44 }, -{ 0x01, 0x65, 0x45 }, -{ 0x01, 0x66, 0x46 }, -{ 0x01, 0x67, 0x47 }, -{ 0x01, 0x68, 0x48 }, -{ 0x01, 0x69, 0x49 }, -{ 0x01, 0x6a, 0x4a }, -{ 0x01, 0x6b, 0x4b }, -{ 0x01, 0x6c, 0x4c }, -{ 0x01, 0x6d, 0x4d }, -{ 0x01, 0x6e, 0x4e }, -{ 0x01, 0x6f, 0x4f }, -{ 0x01, 0x70, 0x50 }, -{ 0x01, 0x71, 0x51 }, -{ 0x01, 0x72, 0x52 }, -{ 0x01, 0x73, 0x53 }, -{ 0x01, 0x74, 0x54 }, -{ 0x01, 0x75, 0x55 }, -{ 0x01, 0x76, 0x56 }, -{ 0x01, 0x77, 0x57 }, -{ 0x01, 0x78, 0x58 }, -{ 0x01, 0x79, 0x59 }, -{ 0x01, 0x7a, 0x5a }, -{ 0x00, 0x5b, 0x5b }, -{ 0x00, 0x5c, 0x5c }, -{ 0x00, 0x5d, 0x5d }, -{ 0x00, 0x5e, 0x5e }, -{ 0x00, 0x5f, 0x5f }, -{ 0x00, 0x60, 0x60 }, -{ 0x00, 0x61, 0x41 }, -{ 0x00, 0x62, 0x42 }, -{ 0x00, 0x63, 0x43 }, -{ 0x00, 0x64, 0x44 }, -{ 0x00, 0x65, 0x45 }, -{ 0x00, 0x66, 0x46 }, -{ 0x00, 0x67, 0x47 }, -{ 0x00, 0x68, 0x48 }, -{ 0x00, 0x69, 0x49 }, -{ 0x00, 0x6a, 0x4a }, -{ 0x00, 0x6b, 0x4b }, -{ 0x00, 0x6c, 0x4c }, -{ 0x00, 0x6d, 0x4d }, -{ 0x00, 0x6e, 0x4e }, -{ 0x00, 0x6f, 0x4f }, -{ 0x00, 0x70, 0x50 }, -{ 0x00, 0x71, 0x51 }, -{ 0x00, 0x72, 0x52 }, -{ 0x00, 0x73, 0x53 }, -{ 0x00, 0x74, 0x54 }, -{ 0x00, 0x75, 0x55 }, -{ 0x00, 0x76, 0x56 }, -{ 0x00, 0x77, 0x57 }, -{ 0x00, 0x78, 0x58 }, -{ 0x00, 0x79, 0x59 }, -{ 0x00, 0x7a, 0x5a }, -{ 0x00, 0x7b, 0x7b }, -{ 0x00, 0x7c, 0x7c }, -{ 0x00, 0x7d, 0x7d }, -{ 0x00, 0x7e, 0x7e }, -{ 0x00, 0x7f, 0x7f }, -{ 0x00, 0x80, 0x80 }, -{ 0x00, 0x81, 0x81 }, -{ 0x00, 0x82, 0x82 }, -{ 0x00, 0x83, 0x83 }, -{ 0x00, 0x84, 0x84 }, -{ 0x00, 0x85, 0x85 }, -{ 0x00, 0x86, 0x86 }, -{ 0x00, 0x87, 0x87 }, -{ 0x00, 0x88, 0x88 }, -{ 0x00, 0x89, 0x89 }, -{ 0x00, 0x8a, 0x8a }, -{ 0x00, 0x8b, 0x8b }, -{ 0x00, 0x8c, 0x8c }, -{ 0x00, 0x8d, 0x8d }, -{ 0x00, 0x8e, 0x8e }, -{ 0x00, 0x8f, 0x8f }, -{ 0x00, 0x90, 0x90 }, -{ 0x00, 0x91, 0x91 }, -{ 0x00, 0x92, 0x92 }, -{ 0x00, 0x93, 0x93 }, -{ 0x00, 0x94, 0x94 }, -{ 0x00, 0x95, 0x95 }, -{ 0x00, 0x96, 0x96 }, -{ 0x00, 0x97, 0x97 }, -{ 0x00, 0x98, 0x98 }, -{ 0x00, 0x99, 0x99 }, -{ 0x00, 0x9a, 0x9a }, -{ 0x00, 0x9b, 0x9b }, -{ 0x00, 0x9c, 0x9c }, -{ 0x00, 0x9d, 0x9d }, -{ 0x00, 0x9e, 0x9e }, -{ 0x00, 0x9f, 0x9f }, -{ 0x00, 0xa0, 0xa0 }, -{ 0x00, 0xa1, 0xa1 }, -{ 0x00, 0xa2, 0xa2 }, -{ 0x00, 0xa3, 0xa3 }, -{ 0x00, 0xa4, 0xa4 }, -{ 0x00, 0xa5, 0xa5 }, -{ 0x00, 0xa6, 0xa6 }, -{ 0x00, 0xa7, 0xa7 }, -{ 0x00, 0xa8, 0xa8 }, -{ 0x00, 0xa9, 0xa9 }, -{ 0x00, 0xaa, 0xaa }, -{ 0x00, 0xab, 0xab }, -{ 0x00, 0xac, 0xac }, -{ 0x00, 0xad, 0xad }, -{ 0x00, 0xae, 0xae }, -{ 0x00, 0xaf, 0xaf }, -{ 0x00, 0xb0, 0xb0 }, -{ 0x00, 0xb1, 0xb1 }, -{ 0x00, 0xb2, 0xb2 }, -{ 0x00, 0xb3, 0xb3 }, -{ 0x00, 0xb4, 0xb4 }, -{ 0x00, 0xb5, 0xb5 }, -{ 0x00, 0xb6, 0xb6 }, -{ 0x00, 0xb7, 0xb7 }, -{ 0x00, 0xb8, 0xb8 }, -{ 0x00, 0xb9, 0xb9 }, -{ 0x00, 0xba, 0xba }, -{ 0x00, 0xbb, 0xbb }, -{ 0x00, 0xbc, 0xbc }, -{ 0x00, 0xbd, 0xbd }, -{ 0x00, 0xbe, 0xbe }, -{ 0x00, 0xbf, 0xbf }, -{ 0x00, 0xc0, 0xc0 }, -{ 0x00, 0xc1, 0xc1 }, -{ 0x00, 0xc2, 0xc2 }, -{ 0x00, 0xc3, 0xc3 }, -{ 0x00, 0xc4, 0xc4 }, -{ 0x00, 0xc5, 0xc5 }, -{ 0x00, 0xc6, 0xc6 }, -{ 0x00, 0xc7, 0xc7 }, -{ 0x00, 0xc8, 0xc8 }, -{ 0x00, 0xc9, 0xc9 }, -{ 0x00, 0xca, 0xca }, -{ 0x00, 0xcb, 0xcb }, -{ 0x00, 0xcc, 0xcc }, -{ 0x00, 0xcd, 0xcd }, -{ 0x00, 0xce, 0xce }, -{ 0x00, 0xcf, 0xcf }, -{ 0x00, 0xd0, 0xd0 }, -{ 0x00, 0xd1, 0xd1 }, -{ 0x00, 0xd2, 0xd2 }, -{ 0x00, 0xd3, 0xd3 }, -{ 0x00, 0xd4, 0xd4 }, -{ 0x00, 0xd5, 0xd5 }, -{ 0x00, 0xd6, 0xd6 }, -{ 0x00, 0xd7, 0xd7 }, -{ 0x00, 0xd8, 0xd8 }, -{ 0x00, 0xd9, 0xd9 }, -{ 0x00, 0xda, 0xda }, -{ 0x00, 0xdb, 0xdb }, -{ 0x00, 0xdc, 0xdc }, -{ 0x00, 0xdd, 0xdd }, -{ 0x00, 0xde, 0xde }, -{ 0x00, 0xdf, 0xdf }, -{ 0x00, 0xe0, 0xe0 }, -{ 0x00, 0xe1, 0xe1 }, -{ 0x00, 0xe2, 0xe2 }, -{ 0x00, 0xe3, 0xe3 }, -{ 0x00, 0xe4, 0xe4 }, -{ 0x00, 0xe5, 0xe5 }, -{ 0x00, 0xe6, 0xe6 }, -{ 0x00, 0xe7, 0xe7 }, -{ 0x00, 0xe8, 0xe8 }, -{ 0x00, 0xe9, 0xe9 }, -{ 0x00, 0xea, 0xea }, -{ 0x00, 0xeb, 0xeb }, -{ 0x00, 0xec, 0xec }, -{ 0x00, 0xed, 0xed }, -{ 0x00, 0xee, 0xee }, -{ 0x00, 0xef, 0xef }, -{ 0x00, 0xf0, 0xf0 }, -{ 0x00, 0xf1, 0xf1 }, -{ 0x00, 0xf2, 0xf2 }, -{ 0x00, 0xf3, 0xf3 }, -{ 0x00, 0xf4, 0xf4 }, -{ 0x00, 0xf5, 0xf5 }, -{ 0x00, 0xf6, 0xf6 }, -{ 0x00, 0xf7, 0xf7 }, -{ 0x00, 0xf8, 0xf8 }, -{ 0x00, 0xf9, 0xf9 }, -{ 0x00, 0xfa, 0xfa }, -{ 0x00, 0xfb, 0xfb }, -{ 0x00, 0xfc, 0xfc }, -{ 0x00, 0xfd, 0xfd }, -{ 0x00, 0xfe, 0xfe }, -{ 0x00, 0xff, 0xff } -}; - -struct enc_entry { - const char * enc_name; - struct cs_info * cs_table; -}; - -static struct enc_entry encds[] = { - {"iso88591",iso1_tbl}, //ISO-8859-1 - {"iso88592",iso2_tbl}, //ISO-8859-2 - {"iso88593",iso3_tbl}, //ISO-8859-3 - {"iso88594",iso4_tbl}, //ISO-8859-4 - {"iso88595",iso5_tbl}, //ISO-8859-5 - {"iso88596",iso6_tbl}, //ISO-8859-6 - {"iso88597",iso7_tbl}, //ISO-8859-7 - {"iso88598",iso8_tbl}, //ISO-8859-8 - {"iso88599",iso9_tbl}, //ISO-8859-9 - {"iso885910",iso10_tbl}, //ISO-8859-10 - {"tis620",tis620_tbl}, //TIS-620/ISO-8859-11 - {"tis6202533",tis620_tbl}, //TIS-620/ISO-8859-11 - {"iso885911",tis620_tbl}, //TIS-620/ISO-8859-11 - {"iso885913", iso13_tbl}, //ISO-8859-13 - {"iso885914", iso14_tbl}, //ISO-8859-14 - {"iso885915", iso15_tbl}, //ISO-8859-15 - {"koi8r",koi8r_tbl}, //KOI8-R - {"koi8u",koi8u_tbl}, //KOI8-U - {"cp1251",cp1251_tbl}, //CP-1251 - {"microsoftcp1251",cp1251_tbl}, //microsoft-cp1251 - {"xisciias", iscii_devanagari_tbl}, //x-iscii-as - {"isciidevanagari", iscii_devanagari_tbl} //ISCII-DEVANAGARI -}; - -/* map to lower case and remove non alphanumeric chars */ -static void toAsciiLowerAndRemoveNonAlphanumeric( const char* pName, char* pBuf ) -{ - while ( *pName ) - { - /* A-Z */ - if ( (*pName >= 0x41) && (*pName <= 0x5A) ) - { - *pBuf = (*pName)+0x20; /* toAsciiLower */ - pBuf++; - } - /* a-z, 0-9 */ - else if ( ((*pName >= 0x61) && (*pName <= 0x7A)) || - ((*pName >= 0x30) && (*pName <= 0x39)) ) - { - *pBuf = *pName; - pBuf++; - } - - pName++; - } - - *pBuf = '\0'; -} - -struct cs_info * get_current_cs(const char * es) { - char *normalized_encoding = new char[strlen(es)+1]; - toAsciiLowerAndRemoveNonAlphanumeric(es, normalized_encoding); - - struct cs_info * ccs = NULL; - int n = sizeof(encds) / sizeof(encds[0]); - for (int i = 0; i < n; i++) { - if (strcmp(normalized_encoding,encds[i].enc_name) == 0) { - ccs = encds[i].cs_table; - break; - } - } - - delete[] normalized_encoding; - - if (!ccs) { - HUNSPELL_WARNING(stderr, "error: unknown encoding %s: using %s as fallback\n", es, encds[0].enc_name); - ccs = encds[0].cs_table; - } - - return ccs; -} -#else -// XXX This function was rewritten for mozilla. Instead of storing the -// conversion tables static in this file, create them when needed -// with help the mozilla backend. -struct cs_info * get_current_cs(const char * es) { - struct cs_info *ccs = new cs_info[256]; - // Initialze the array with dummy data so that we wouldn't need - // to return null in case of failures. - for (int i = 0; i <= 0xff; ++i) { - ccs[i].ccase = false; - ccs[i].clower = i; - ccs[i].cupper = i; - } - - - nsCOMPtr encoder; - nsCOMPtr decoder; - - nsresult rv; - nsCOMPtr ccm = do_GetService(kCharsetConverterManagerCID, &rv); - if (NS_FAILED(rv)) - return ccs; - - rv = ccm->GetUnicodeEncoder(es, getter_AddRefs(encoder)); - if (NS_FAILED(rv)) - return ccs; - encoder->SetOutputErrorBehavior(encoder->kOnError_Signal, nsnull, '?'); - rv = ccm->GetUnicodeDecoder(es, getter_AddRefs(decoder)); - if (NS_FAILED(rv)) - return ccs; - decoder->SetInputErrorBehavior(decoder->kOnError_Signal); - - if (NS_FAILED(rv)) - return ccs; - - for (unsigned int i = 0; i <= 0xff; ++i) { - PRBool success = PR_FALSE; - // We want to find the upper/lowercase equivalents of each byte - // in this 1-byte character encoding. Call our encoding/decoding - // APIs separately for each byte since they may reject some of the - // bytes, and we want to handle errors separately for each byte. - char lower, upper; - do { - if (i == 0) - break; - const char source = char(i); - PRUnichar uni, uniCased; - PRInt32 charLength = 1, uniLength = 1; - - rv = decoder->Convert(&source, &charLength, &uni, &uniLength); - // Explicitly check NS_OK because we don't want to allow - // NS_OK_UDEC_MOREOUTPUT or NS_OK_UDEC_MOREINPUT. - if (rv != NS_OK || charLength != 1 || uniLength != 1) - break; - uniCased = ToLowerCase(uni); - rv = encoder->Convert(&uniCased, &uniLength, &lower, &charLength); - // Explicitly check NS_OK because we don't want to allow - // NS_OK_UDEC_MOREOUTPUT or NS_OK_UDEC_MOREINPUT. - if (rv != NS_OK || charLength != 1 || uniLength != 1) - break; - - uniCased = ToUpperCase(uni); - rv = encoder->Convert(&uniCased, &uniLength, &upper, &charLength); - // Explicitly check NS_OK because we don't want to allow - // NS_OK_UDEC_MOREOUTPUT or NS_OK_UDEC_MOREINPUT. - if (rv != NS_OK || charLength != 1 || uniLength != 1) - break; - - success = PR_TRUE; - } while (0); - - if (success) { - ccs[i].cupper = upper; - ccs[i].clower = lower; - } else { - ccs[i].cupper = i; - ccs[i].clower = i; - } - - if (ccs[i].clower != (unsigned char)i) - ccs[i].ccase = true; - else - ccs[i].ccase = false; - } - - return ccs; -} -#endif - -// primitive isalpha() replacement for tokenization -char * get_casechars(const char * enc) { - struct cs_info * csconv = get_current_cs(enc); - char expw[MAXLNLEN]; - char * p = expw; - for (int i = 0; i <= 255; i++) { - if ((csconv[i].cupper != csconv[i].clower)) { - *p = (char) i; - p++; - } - } - *p = '\0'; -#ifdef MOZILLA_CLIENT - delete [] csconv; -#endif - return mystrdup(expw); -} - -// language to encoding default map - -struct lang_map { - const char * lang; - int num; -}; - -static struct lang_map lang2enc[] = { -{"ar", LANG_ar}, -{"az", LANG_az}, -{"az_AZ", LANG_az}, // for back-compatibility -{"bg", LANG_bg}, -{"ca", LANG_ca}, -{"cs", LANG_cs}, -{"da", LANG_da}, -{"de", LANG_de}, -{"el", LANG_el}, -{"en", LANG_en}, -{"es", LANG_es}, -{"eu", LANG_eu}, -{"gl", LANG_gl}, -{"fr", LANG_fr}, -{"hr", LANG_hr}, -{"hu", LANG_hu}, -{"hu_HU", LANG_hu}, // for back-compatibility -{"it", LANG_it}, -{"la", LANG_la}, -{"lv", LANG_lv}, -{"nl", LANG_nl}, -{"pl", LANG_pl}, -{"pt", LANG_pt}, -{"sv", LANG_sv}, -{"tr", LANG_tr}, -{"tr_TR", LANG_tr}, // for back-compatibility -{"ru", LANG_ru}, -{"uk", LANG_uk} -}; - - -int get_lang_num(const char * lang) { - int n = sizeof(lang2enc) / sizeof(lang2enc[0]); - for (int i = 0; i < n; i++) { - if (strcmp(lang, lang2enc[i].lang) == 0) { - return lang2enc[i].num; - } - } - return LANG_xx; -} - -#ifndef OPENOFFICEORG -#ifndef MOZILLA_CLIENT -int initialize_utf_tbl() { - utf_tbl_count++; - if (utf_tbl) return 0; - utf_tbl = (unicode_info2 *) malloc(CONTSIZE * sizeof(unicode_info2)); - if (utf_tbl) { - size_t j; - for (j = 0; j < CONTSIZE; j++) { - utf_tbl[j].cletter = 0; - utf_tbl[j].clower = (unsigned short) j; - utf_tbl[j].cupper = (unsigned short) j; - } - for (j = 0; j < UTF_LST_LEN; j++) { - utf_tbl[utf_lst[j].c].cletter = 1; - utf_tbl[utf_lst[j].c].clower = utf_lst[j].clower; - utf_tbl[utf_lst[j].c].cupper = utf_lst[j].cupper; - } - } else return 1; - return 0; -} -#endif -#endif - -void free_utf_tbl() { - if (utf_tbl_count > 0) utf_tbl_count--; - if (utf_tbl && (utf_tbl_count == 0)) { - free(utf_tbl); - utf_tbl = NULL; - } -} - -unsigned short unicodetoupper(unsigned short c, int langnum) -{ - // In Azeri and Turkish, I and i dictinct letters: - // There are a dotless lower case i pair of upper `I', - // and an upper I with dot pair of lower `i'. - if (c == 0x0069 && ((langnum == LANG_az) || (langnum == LANG_tr))) - return 0x0130; -#ifdef OPENOFFICEORG - return static_cast(u_toupper(c)); -#else -#ifdef MOZILLA_CLIENT - return ToUpperCase((PRUnichar) c); -#else - return (utf_tbl) ? utf_tbl[c].cupper : c; -#endif -#endif -} - -unsigned short unicodetolower(unsigned short c, int langnum) -{ - // In Azeri and Turkish, I and i dictinct letters: - // There are a dotless lower case i pair of upper `I', - // and an upper I with dot pair of lower `i'. - if (c == 0x0049 && ((langnum == LANG_az) || (langnum == LANG_tr))) - return 0x0131; -#ifdef OPENOFFICEORG - return static_cast(u_tolower(c)); -#else -#ifdef MOZILLA_CLIENT - return ToLowerCase((PRUnichar) c); -#else - return (utf_tbl) ? utf_tbl[c].clower : c; -#endif -#endif -} - -int unicodeisalpha(unsigned short c) -{ -#ifdef OPENOFFICEORG - return u_isalpha(c); -#else - return (utf_tbl) ? utf_tbl[c].cletter : 0; -#endif -} - -/* get type of capitalization */ -int get_captype(char * word, int nl, cs_info * csconv) { - // now determine the capitalization type of the first nl letters - int ncap = 0; - int nneutral = 0; - int firstcap = 0; - if (csconv == NULL) return NOCAP; - for (char * q = word; *q != '\0'; q++) { - if (csconv[*((unsigned char *)q)].ccase) ncap++; - if (csconv[*((unsigned char *)q)].cupper == csconv[*((unsigned char *)q)].clower) nneutral++; - } - if (ncap) { - firstcap = csconv[*((unsigned char *) word)].ccase; - } - - // now finally set the captype - if (ncap == 0) { - return NOCAP; - } else if ((ncap == 1) && firstcap) { - return INITCAP; - } else if ((ncap == nl) || ((ncap + nneutral) == nl)) { - return ALLCAP; - } else if ((ncap > 1) && firstcap) { - return HUHINITCAP; - } - return HUHCAP; -} - -int get_captype_utf8(w_char * word, int nl, int langnum) { - // now determine the capitalization type of the first nl letters - int ncap = 0; - int nneutral = 0; - int firstcap = 0; - unsigned short idx; - // don't check too long words - if (nl >= MAXWORDLEN) return 0; - // big Unicode character (non BMP area) - if (nl == -1) return NOCAP; - for (int i = 0; i < nl; i++) { - idx = (word[i].h << 8) + word[i].l; - if (idx != unicodetolower(idx, langnum)) ncap++; - if (unicodetoupper(idx, langnum) == unicodetolower(idx, langnum)) nneutral++; - } - if (ncap) { - idx = (word[0].h << 8) + word[0].l; - firstcap = (idx != unicodetolower(idx, langnum)); - } - - // now finally set the captype - if (ncap == 0) { - return NOCAP; - } else if ((ncap == 1) && firstcap) { - return INITCAP; - } else if ((ncap == nl) || ((ncap + nneutral) == nl)) { - return ALLCAP; - } else if ((ncap > 1) && firstcap) { - return HUHINITCAP; - } - return HUHCAP; -} - - -// strip all ignored characters in the string -void remove_ignored_chars_utf(char * word, unsigned short ignored_chars[], int ignored_len) -{ - w_char w[MAXWORDLEN]; - w_char w2[MAXWORDLEN]; - int i; - int j; - int len = u8_u16(w, MAXWORDLEN, word); - for (i = 0, j = 0; i < len; i++) { - if (!flag_bsearch(ignored_chars, ((unsigned short *) w)[i], ignored_len)) { - w2[j] = w[i]; - j++; - } - } - if (j < i) u16_u8(word, MAXWORDUTF8LEN, w2, j); -} - -// strip all ignored characters in the string -void remove_ignored_chars(char * word, char * ignored_chars) -{ - for (char * p = word; *p != '\0'; p++) { - if (!strchr(ignored_chars, *p)) { - *word = *p; - word++; - } - } - *word = '\0'; -} - -int parse_string(char * line, char ** out, int ln) -{ - char * tp = line; - char * piece; - int i = 0; - int np = 0; - if (*out) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions\n", ln); - return 1; - } - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { np++; break; } - case 1: { - *out = mystrdup(piece); - if (!*out) return 1; - np++; - break; - } - default: break; - } - i++; - } - // free(piece); - piece = mystrsep(&tp, 0); - } - if (np != 2) { - HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", ln); - return 1; - } - return 0; -} - -int parse_array(char * line, char ** out, unsigned short ** out_utf16, - int * out_utf16_len, int utf8, int ln) { - if (parse_string(line, out, ln)) return 1; - if (utf8) { - w_char w[MAXWORDLEN]; - int n = u8_u16(w, MAXWORDLEN, *out); - if (n > 0) { - flag_qsort((unsigned short *) w, 0, n); - *out_utf16 = (unsigned short *) malloc(n * sizeof(unsigned short)); - if (!*out_utf16) return 1; - memcpy(*out_utf16, w, n * sizeof(unsigned short)); - } - *out_utf16_len = n; - } - return 0; -} diff --git a/subprojects/hunspell/src/hunspell/csutil.hxx b/subprojects/hunspell/src/hunspell/csutil.hxx deleted file mode 100644 index e034b53fd..000000000 --- a/subprojects/hunspell/src/hunspell/csutil.hxx +++ /dev/null @@ -1,223 +0,0 @@ -#ifndef __CSUTILHXX__ -#define __CSUTILHXX__ - -#include "hunvisapi.h" - -// First some base level utility routines - -#include -#include "w_char.hxx" -#include "htypes.hxx" - -#ifdef MOZILLA_CLIENT -#include "nscore.h" // for mozalloc headers -#endif - -// casing -#define NOCAP 0 -#define INITCAP 1 -#define ALLCAP 2 -#define HUHCAP 3 -#define HUHINITCAP 4 - -// default encoding and keystring -#define SPELL_ENCODING "ISO8859-1" -#define SPELL_KEYSTRING "qwertyuiop|asdfghjkl|zxcvbnm" - -// default morphological fields -#define MORPH_STEM "st:" -#define MORPH_ALLOMORPH "al:" -#define MORPH_POS "po:" -#define MORPH_DERI_PFX "dp:" -#define MORPH_INFL_PFX "ip:" -#define MORPH_TERM_PFX "tp:" -#define MORPH_DERI_SFX "ds:" -#define MORPH_INFL_SFX "is:" -#define MORPH_TERM_SFX "ts:" -#define MORPH_SURF_PFX "sp:" -#define MORPH_FREQ "fr:" -#define MORPH_PHON "ph:" -#define MORPH_HYPH "hy:" -#define MORPH_PART "pa:" -#define MORPH_FLAG "fl:" -#define MORPH_HENTRY "_H:" -#define MORPH_TAG_LEN strlen(MORPH_STEM) - -#define MSEP_FLD ' ' -#define MSEP_REC '\n' -#define MSEP_ALT '\v' - -// default flags -#define DEFAULTFLAGS 65510 -#define FORBIDDENWORD 65510 -#define ONLYUPCASEFLAG 65511 - -// fopen or optional _wfopen to fix long pathname problem of WIN32 -LIBHUNSPELL_DLL_EXPORTED FILE * myfopen(const char * path, const char * mode); - -// convert UTF-16 characters to UTF-8 -LIBHUNSPELL_DLL_EXPORTED char * u16_u8(char * dest, int size, const w_char * src, int srclen); - -// convert UTF-8 characters to UTF-16 -LIBHUNSPELL_DLL_EXPORTED int u8_u16(w_char * dest, int size, const char * src); - -// sort 2-byte vector -LIBHUNSPELL_DLL_EXPORTED void flag_qsort(unsigned short flags[], int begin, int end); - -// binary search in 2-byte vector -LIBHUNSPELL_DLL_EXPORTED int flag_bsearch(unsigned short flags[], unsigned short flag, int right); - -// remove end of line char(s) -LIBHUNSPELL_DLL_EXPORTED void mychomp(char * s); - -// duplicate string -LIBHUNSPELL_DLL_EXPORTED char * mystrdup(const char * s); - -// strcat for limited length destination string -LIBHUNSPELL_DLL_EXPORTED char * mystrcat(char * dest, const char * st, int max); - -// duplicate reverse of string -LIBHUNSPELL_DLL_EXPORTED char * myrevstrdup(const char * s); - -// parse into tokens with char delimiter -LIBHUNSPELL_DLL_EXPORTED char * mystrsep(char ** sptr, const char delim); -// parse into tokens with char delimiter -LIBHUNSPELL_DLL_EXPORTED char * mystrsep2(char ** sptr, const char delim); - -// parse into tokens with char delimiter -LIBHUNSPELL_DLL_EXPORTED char * mystrrep(char *, const char *, const char *); - -// append s to ends of every lines in text -LIBHUNSPELL_DLL_EXPORTED void strlinecat(char * lines, const char * s); - -// tokenize into lines with new line -LIBHUNSPELL_DLL_EXPORTED int line_tok(const char * text, char *** lines, char breakchar); - -// tokenize into lines with new line and uniq in place -LIBHUNSPELL_DLL_EXPORTED char * line_uniq(char * text, char breakchar); -LIBHUNSPELL_DLL_EXPORTED char * line_uniq_app(char ** text, char breakchar); - -// change oldchar to newchar in place -LIBHUNSPELL_DLL_EXPORTED char * tr(char * text, char oldc, char newc); - -// reverse word -LIBHUNSPELL_DLL_EXPORTED int reverseword(char *); - -// reverse word -LIBHUNSPELL_DLL_EXPORTED int reverseword_utf(char *); - -// remove duplicates -LIBHUNSPELL_DLL_EXPORTED int uniqlist(char ** list, int n); - -// free character array list -LIBHUNSPELL_DLL_EXPORTED void freelist(char *** list, int n); - -// character encoding information -struct cs_info { - unsigned char ccase; - unsigned char clower; - unsigned char cupper; -}; - -LIBHUNSPELL_DLL_EXPORTED int initialize_utf_tbl(); -LIBHUNSPELL_DLL_EXPORTED void free_utf_tbl(); -LIBHUNSPELL_DLL_EXPORTED unsigned short unicodetoupper(unsigned short c, int langnum); -LIBHUNSPELL_DLL_EXPORTED unsigned short unicodetolower(unsigned short c, int langnum); -LIBHUNSPELL_DLL_EXPORTED int unicodeisalpha(unsigned short c); - -LIBHUNSPELL_DLL_EXPORTED struct cs_info * get_current_cs(const char * es); - -// get language identifiers of language codes -LIBHUNSPELL_DLL_EXPORTED int get_lang_num(const char * lang); - -// get characters of the given 8bit encoding with lower- and uppercase forms -LIBHUNSPELL_DLL_EXPORTED char * get_casechars(const char * enc); - -// convert null terminated string to all caps using encoding -LIBHUNSPELL_DLL_EXPORTED void enmkallcap(char * d, const char * p, const char * encoding); - -// convert null terminated string to all little using encoding -LIBHUNSPELL_DLL_EXPORTED void enmkallsmall(char * d, const char * p, const char * encoding); - -// convert null terminated string to have initial capital using encoding -LIBHUNSPELL_DLL_EXPORTED void enmkinitcap(char * d, const char * p, const char * encoding); - -// convert null terminated string to all caps -LIBHUNSPELL_DLL_EXPORTED void mkallcap(char * p, const struct cs_info * csconv); - -// convert null terminated string to all little -LIBHUNSPELL_DLL_EXPORTED void mkallsmall(char * p, const struct cs_info * csconv); - -// convert null terminated string to have initial capital -LIBHUNSPELL_DLL_EXPORTED void mkinitcap(char * p, const struct cs_info * csconv); - -// convert first nc characters of UTF-8 string to little -LIBHUNSPELL_DLL_EXPORTED void mkallsmall_utf(w_char * u, int nc, int langnum); - -// convert first nc characters of UTF-8 string to capital -LIBHUNSPELL_DLL_EXPORTED void mkallcap_utf(w_char * u, int nc, int langnum); - -// get type of capitalization -LIBHUNSPELL_DLL_EXPORTED int get_captype(char * q, int nl, cs_info *); - -// get type of capitalization (UTF-8) -LIBHUNSPELL_DLL_EXPORTED int get_captype_utf8(w_char * q, int nl, int langnum); - -// strip all ignored characters in the string -LIBHUNSPELL_DLL_EXPORTED void remove_ignored_chars_utf(char * word, unsigned short ignored_chars[], int ignored_len); - -// strip all ignored characters in the string -LIBHUNSPELL_DLL_EXPORTED void remove_ignored_chars(char * word, char * ignored_chars); - -LIBHUNSPELL_DLL_EXPORTED int parse_string(char * line, char ** out, int ln); - -LIBHUNSPELL_DLL_EXPORTED int parse_array(char * line, char ** out, unsigned short ** out_utf16, - int * out_utf16_len, int utf8, int ln); - -LIBHUNSPELL_DLL_EXPORTED int fieldlen(const char * r); -LIBHUNSPELL_DLL_EXPORTED char * copy_field(char * dest, const char * morph, const char * var); - -LIBHUNSPELL_DLL_EXPORTED int morphcmp(const char * s, const char * t); - -LIBHUNSPELL_DLL_EXPORTED int get_sfxcount(const char * morph); - -// conversion function for protected memory -LIBHUNSPELL_DLL_EXPORTED void store_pointer(char * dest, char * source); - -// conversion function for protected memory -LIBHUNSPELL_DLL_EXPORTED char * get_stored_pointer(const char * s); - -// hash entry macros -LIBHUNSPELL_DLL_EXPORTED inline char* HENTRY_DATA(struct hentry *h) -{ - char *ret; - if (!h->var) - ret = NULL; - else if (h->var & H_OPT_ALIASM) - ret = get_stored_pointer(HENTRY_WORD(h) + h->blen + 1); - else - ret = HENTRY_WORD(h) + h->blen + 1; - return ret; -} - -// NULL-free version for warning-free OOo build -LIBHUNSPELL_DLL_EXPORTED inline const char* HENTRY_DATA2(const struct hentry *h) -{ - const char *ret; - if (!h->var) - ret = ""; - else if (h->var & H_OPT_ALIASM) - ret = get_stored_pointer(HENTRY_WORD(h) + h->blen + 1); - else - ret = HENTRY_WORD(h) + h->blen + 1; - return ret; -} - -LIBHUNSPELL_DLL_EXPORTED inline char* HENTRY_FIND(struct hentry *h, const char *p) -{ - return (HENTRY_DATA(h) ? strstr(HENTRY_DATA(h), p) : NULL); -} - -#define w_char_eq(a,b) (((a).l == (b).l) && ((a).h == (b).h)) - -#endif diff --git a/subprojects/hunspell/src/hunspell/dictmgr.cxx b/subprojects/hunspell/src/hunspell/dictmgr.cxx deleted file mode 100644 index a94429e59..000000000 --- a/subprojects/hunspell/src/hunspell/dictmgr.cxx +++ /dev/null @@ -1,182 +0,0 @@ - -#include -#include -#include -#include - -#include "dictmgr.hxx" -#include "csutil.hxx" - -DictMgr::DictMgr(const char * dictpath, const char * etype) : numdict(0) -{ - // load list of etype entries - pdentry = (dictentry *)malloc(MAXDICTIONARIES*sizeof(struct dictentry)); - if (pdentry) { - if (parse_file(dictpath, etype)) { - numdict = 0; - // no dictionary.lst found is okay - } - } -} - - -DictMgr::~DictMgr() -{ - dictentry * pdict = NULL; - if (pdentry) { - pdict = pdentry; - for (int i=0;ilang) { - free(pdict->lang); - pdict->lang = NULL; - } - if (pdict->region) { - free(pdict->region); - pdict->region=NULL; - } - if (pdict->filename) { - free(pdict->filename); - pdict->filename = NULL; - } - pdict++; - } - free(pdentry); - pdentry = NULL; - pdict = NULL; - } - numdict = 0; -} - - -// read in list of etype entries and build up structure to describe them -int DictMgr::parse_file(const char * dictpath, const char * etype) -{ - - int i; - char line[MAXDICTENTRYLEN+1]; - dictentry * pdict = pdentry; - - // open the dictionary list file - FILE * dictlst; - dictlst = myfopen(dictpath,"r"); - if (!dictlst) { - return 1; - } - - // step one is to parse the dictionary list building up the - // descriptive structures - - // read in each line ignoring any that dont start with etype - while (fgets(line,MAXDICTENTRYLEN,dictlst)) { - mychomp(line); - - /* parse in a dictionary entry */ - if (strncmp(line,etype,4) == 0) { - if (numdict < MAXDICTIONARIES) { - char * tp = line; - char * piece; - i = 0; - while ((piece=mystrsep(&tp,' '))) { - if (*piece != '\0') { - switch(i) { - case 0: break; - case 1: pdict->lang = mystrdup(piece); break; - case 2: if (strcmp (piece, "ANY") == 0) - pdict->region = mystrdup(""); - else - pdict->region = mystrdup(piece); - break; - case 3: pdict->filename = mystrdup(piece); break; - default: break; - } - i++; - } - free(piece); - } - if (i == 4) { - numdict++; - pdict++; - } else { - switch (i) { - case 3: - free(pdict->region); - pdict->region=NULL; - /* FALLTHROUGH */ - case 2: - free(pdict->lang); - pdict->lang=NULL; - default: - break; - } - fprintf(stderr,"dictionary list corruption in line \"%s\"\n",line); - fflush(stderr); - } - } - } - } - fclose(dictlst); - return 0; -} - -// return text encoding of dictionary -int DictMgr::get_list(dictentry ** ppentry) -{ - *ppentry = pdentry; - return numdict; -} - - - -// strip strings into token based on single char delimiter -// acts like strsep() but only uses a delim char and not -// a delim string - -char * DictMgr::mystrsep(char ** stringp, const char delim) -{ - char * rv = NULL; - char * mp = *stringp; - size_t n = strlen(mp); - if (n > 0) { - char * dp = (char *)memchr(mp,(int)((unsigned char)delim),n); - if (dp) { - *stringp = dp+1; - size_t nc = dp - mp; - rv = (char *) malloc(nc+1); - if (rv) { - memcpy(rv,mp,nc); - *(rv+nc) = '\0'; - } - } else { - rv = (char *) malloc(n+1); - if (rv) { - memcpy(rv, mp, n); - *(rv+n) = '\0'; - *stringp = mp + n; - } - } - } - return rv; -} - - -// replaces strdup with ansi version -char * DictMgr::mystrdup(const char * s) -{ - char * d = NULL; - if (s) { - int sl = strlen(s)+1; - d = (char *) malloc(sl); - if (d) memcpy(d,s,sl); - } - return d; -} - - -// remove cross-platform text line end characters -void DictMgr:: mychomp(char * s) -{ - int k = strlen(s); - if ((k > 0) && ((*(s+k-1)=='\r') || (*(s+k-1)=='\n'))) *(s+k-1) = '\0'; - if ((k > 1) && (*(s+k-2) == '\r')) *(s+k-2) = '\0'; -} - diff --git a/subprojects/hunspell/src/hunspell/dictmgr.hxx b/subprojects/hunspell/src/hunspell/dictmgr.hxx deleted file mode 100644 index 692ed964c..000000000 --- a/subprojects/hunspell/src/hunspell/dictmgr.hxx +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _DICTMGR_HXX_ -#define _DICTMGR_HXX_ - -#include "hunvisapi.h" - -#define MAXDICTIONARIES 100 -#define MAXDICTENTRYLEN 1024 - -struct dictentry { - char * filename; - char * lang; - char * region; -}; - - -class LIBHUNSPELL_DLL_EXPORTED DictMgr -{ -private: - DictMgr(const DictMgr&); - DictMgr& operator = (const DictMgr&); -private: - int numdict; - dictentry * pdentry; - -public: - - DictMgr(const char * dictpath, const char * etype); - ~DictMgr(); - int get_list(dictentry** ppentry); - -private: - int parse_file(const char * dictpath, const char * etype); - char * mystrsep(char ** stringp, const char delim); - char * mystrdup(const char * s); - void mychomp(char * s); - -}; - -#endif diff --git a/subprojects/hunspell/src/hunspell/filemgr.cxx b/subprojects/hunspell/src/hunspell/filemgr.cxx deleted file mode 100644 index e1fb80d92..000000000 --- a/subprojects/hunspell/src/hunspell/filemgr.cxx +++ /dev/null @@ -1,53 +0,0 @@ -#include "license.hunspell" -#include "license.myspell" - -#include -#include -#include - -#include "filemgr.hxx" -#include "csutil.hxx" - -int FileMgr::fail(const char * err, const char * par) { - fprintf(stderr, err, par); - return -1; -} - -FileMgr::FileMgr(const char * file, const char * key) - : hin(NULL) - , linenum(0) -{ - in[0] = '\0'; - - fin = myfopen(file, "r"); - if (!fin) { - // check hzipped file - char * st = (char *) malloc(strlen(file) + strlen(HZIP_EXTENSION) + 1); - if (st) { - strcpy(st, file); - strcat(st, HZIP_EXTENSION); - hin = new Hunzip(st, key); - free(st); - } - } - if (!fin && !hin) fail(MSG_OPEN, file); -} - -FileMgr::~FileMgr() -{ - if (fin) fclose(fin); - if (hin) delete hin; -} - -char * FileMgr::getline() { - const char * l; - linenum++; - if (fin) return fgets(in, BUFSIZE - 1, fin); - if (hin && ((l = hin->getline()) != NULL)) return strcpy(in, l); - linenum--; - return NULL; -} - -int FileMgr::getlinenum() { - return linenum; -} diff --git a/subprojects/hunspell/src/hunspell/filemgr.hxx b/subprojects/hunspell/src/hunspell/filemgr.hxx deleted file mode 100644 index 37b2ae9ea..000000000 --- a/subprojects/hunspell/src/hunspell/filemgr.hxx +++ /dev/null @@ -1,28 +0,0 @@ -/* file manager class - read lines of files [filename] OR [filename.hz] */ -#ifndef _FILEMGR_HXX_ -#define _FILEMGR_HXX_ - -#include "hunvisapi.h" - -#include "hunzip.hxx" -#include - -class LIBHUNSPELL_DLL_EXPORTED FileMgr -{ -private: - FileMgr(const FileMgr&); - FileMgr& operator = (const FileMgr&); -protected: - FILE * fin; - Hunzip * hin; - char in[BUFSIZE + 50]; // input buffer - int fail(const char * err, const char * par); - int linenum; - -public: - FileMgr(const char * filename, const char * key = NULL); - ~FileMgr(); - char * getline(); - int getlinenum(); -}; -#endif diff --git a/subprojects/hunspell/src/hunspell/hashmgr.cxx b/subprojects/hunspell/src/hunspell/hashmgr.cxx deleted file mode 100644 index 12adf420d..000000000 --- a/subprojects/hunspell/src/hunspell/hashmgr.cxx +++ /dev/null @@ -1,936 +0,0 @@ -#include "license.hunspell" -#include "license.myspell" - -#include -#include -#include -#include -#include - -#include "hashmgr.hxx" -#include "csutil.hxx" -#include "atypes.hxx" - -// build a hash table from a munched word list - -HashMgr::HashMgr(const char * tpath, const char * apath, const char * key) - : tablesize(0) - , tableptr(NULL) - , userword(0) - , flag_mode(FLAG_CHAR) - , complexprefixes(0) - , utf8(0) - , forbiddenword(FORBIDDENWORD) // forbidden word signing flag - , numaliasf(0) - , aliasf(NULL) - , aliasflen(0) - , numaliasm(0) - , aliasm(NULL) -{ - langnum = 0; - lang = NULL; - enc = NULL; - csconv = 0; - ignorechars = NULL; - ignorechars_utf16 = NULL; - ignorechars_utf16_len = 0; - load_config(apath, key); - int ec = load_tables(tpath, key); - if (ec) { - /* error condition - what should we do here */ - HUNSPELL_WARNING(stderr, "Hash Manager Error : %d\n",ec); - if (tableptr) { - free(tableptr); - tableptr = NULL; - } - tablesize = 0; - } -} - - -HashMgr::~HashMgr() -{ - if (tableptr) { - // now pass through hash table freeing up everything - // go through column by column of the table - for (int i=0; i < tablesize; i++) { - struct hentry * pt = tableptr[i]; - struct hentry * nt = NULL; - while(pt) { - nt = pt->next; - if (pt->astr && (!aliasf || TESTAFF(pt->astr, ONLYUPCASEFLAG, pt->alen))) free(pt->astr); - free(pt); - pt = nt; - } - } - free(tableptr); - } - tablesize = 0; - - if (aliasf) { - for (int j = 0; j < (numaliasf); j++) free(aliasf[j]); - free(aliasf); - aliasf = NULL; - if (aliasflen) { - free(aliasflen); - aliasflen = NULL; - } - } - if (aliasm) { - for (int j = 0; j < (numaliasm); j++) free(aliasm[j]); - free(aliasm); - aliasm = NULL; - } - -#ifndef OPENOFFICEORG -#ifndef MOZILLA_CLIENT - if (utf8) free_utf_tbl(); -#endif -#endif - - if (enc) free(enc); - if (lang) free(lang); - - if (ignorechars) free(ignorechars); - if (ignorechars_utf16) free(ignorechars_utf16); - -#ifdef MOZILLA_CLIENT - delete [] csconv; -#endif -} - -// lookup a root word in the hashtable - -struct hentry * HashMgr::lookup(const char *word) const -{ - struct hentry * dp; - if (tableptr) { - dp = tableptr[hash(word)]; - if (!dp) return NULL; - for ( ; dp != NULL; dp = dp->next) { - if (strcmp(word, dp->word) == 0) return dp; - } - } - return NULL; -} - -// add a word to the hash table (private) -int HashMgr::add_word(const char * word, int wbl, int wcl, unsigned short * aff, - int al, const char * desc, bool onlyupcase) -{ - bool upcasehomonym = false; - int descl = desc ? (aliasm ? sizeof(char *) : strlen(desc) + 1) : 0; - // variable-length hash record with word and optional fields - struct hentry* hp = - (struct hentry *) malloc (sizeof(struct hentry) + wbl + descl); - if (!hp) return 1; - char * hpw = hp->word; - strcpy(hpw, word); - if (ignorechars != NULL) { - if (utf8) { - remove_ignored_chars_utf(hpw, ignorechars_utf16, ignorechars_utf16_len); - } else { - remove_ignored_chars(hpw, ignorechars); - } - } - if (complexprefixes) { - if (utf8) reverseword_utf(hpw); else reverseword(hpw); - } - - int i = hash(hpw); - - hp->blen = (unsigned char) wbl; - hp->clen = (unsigned char) wcl; - hp->alen = (short) al; - hp->astr = aff; - hp->next = NULL; - hp->next_homonym = NULL; - - // store the description string or its pointer - if (desc) { - hp->var = H_OPT; - if (aliasm) { - hp->var += H_OPT_ALIASM; - store_pointer(hpw + wbl + 1, get_aliasm(atoi(desc))); - } else { - strcpy(hpw + wbl + 1, desc); - if (complexprefixes) { - if (utf8) reverseword_utf(HENTRY_DATA(hp)); - else reverseword(HENTRY_DATA(hp)); - } - } - if (strstr(HENTRY_DATA(hp), MORPH_PHON)) hp->var += H_OPT_PHON; - } else hp->var = 0; - - struct hentry * dp = tableptr[i]; - if (!dp) { - tableptr[i] = hp; - return 0; - } - while (dp->next != NULL) { - if ((!dp->next_homonym) && (strcmp(hp->word, dp->word) == 0)) { - // remove hidden onlyupcase homonym - if (!onlyupcase) { - if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) { - free(dp->astr); - dp->astr = hp->astr; - dp->alen = hp->alen; - free(hp); - return 0; - } else { - dp->next_homonym = hp; - } - } else { - upcasehomonym = true; - } - } - dp=dp->next; - } - if (strcmp(hp->word, dp->word) == 0) { - // remove hidden onlyupcase homonym - if (!onlyupcase) { - if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) { - free(dp->astr); - dp->astr = hp->astr; - dp->alen = hp->alen; - free(hp); - return 0; - } else { - dp->next_homonym = hp; - } - } else { - upcasehomonym = true; - } - } - if (!upcasehomonym) { - dp->next = hp; - } else { - // remove hidden onlyupcase homonym - if (hp->astr) free(hp->astr); - free(hp); - } - return 0; -} - -int HashMgr::add_hidden_capitalized_word(char * word, int wbl, int wcl, - unsigned short * flags, int flagslen, char * dp, int captype) -{ - if (flags == NULL) - flagslen = 0; - - // add inner capitalized forms to handle the following allcap forms: - // Mixed caps: OpenOffice.org -> OPENOFFICE.ORG - // Allcaps with suffixes: CIA's -> CIA'S - if (((captype == HUHCAP) || (captype == HUHINITCAP) || - ((captype == ALLCAP) && (flagslen != 0))) && - !((flagslen != 0) && TESTAFF(flags, forbiddenword, flagslen))) { - unsigned short * flags2 = (unsigned short *) malloc (sizeof(unsigned short) * (flagslen+1)); - if (!flags2) return 1; - if (flagslen) memcpy(flags2, flags, flagslen * sizeof(unsigned short)); - flags2[flagslen] = ONLYUPCASEFLAG; - if (utf8) { - char st[BUFSIZE]; - w_char w[BUFSIZE]; - int wlen = u8_u16(w, BUFSIZE, word); - mkallsmall_utf(w, wlen, langnum); - mkallcap_utf(w, 1, langnum); - u16_u8(st, BUFSIZE, w, wlen); - return add_word(st,wbl,wcl,flags2,flagslen+1,dp, true); - } else { - mkallsmall(word, csconv); - mkinitcap(word, csconv); - return add_word(word,wbl,wcl,flags2,flagslen+1,dp, true); - } - } - return 0; -} - -// detect captype and modify word length for UTF-8 encoding -int HashMgr::get_clen_and_captype(const char * word, int wbl, int * captype) { - int len; - if (utf8) { - w_char dest_utf[BUFSIZE]; - len = u8_u16(dest_utf, BUFSIZE, word); - *captype = get_captype_utf8(dest_utf, len, langnum); - } else { - len = wbl; - *captype = get_captype((char *) word, len, csconv); - } - return len; -} - -// remove word (personal dictionary function for standalone applications) -int HashMgr::remove(const char * word) -{ - struct hentry * dp = lookup(word); - while (dp) { - if (dp->alen == 0 || !TESTAFF(dp->astr, forbiddenword, dp->alen)) { - unsigned short * flags = - (unsigned short *) malloc(sizeof(short) * (dp->alen + 1)); - if (!flags) return 1; - for (int i = 0; i < dp->alen; i++) flags[i] = dp->astr[i]; - flags[dp->alen] = forbiddenword; - dp->astr = flags; - dp->alen++; - flag_qsort(flags, 0, dp->alen); - } - dp = dp->next_homonym; - } - return 0; -} - -/* remove forbidden flag to add a personal word to the hash */ -int HashMgr::remove_forbidden_flag(const char * word) { - struct hentry * dp = lookup(word); - if (!dp) return 1; - while (dp) { - if (dp->astr && TESTAFF(dp->astr, forbiddenword, dp->alen)) { - if (dp->alen == 1) dp->alen = 0; // XXX forbidden words of personal dic. - else { - unsigned short * flags2 = - (unsigned short *) malloc(sizeof(short) * (dp->alen - 1)); - if (!flags2) return 1; - int i, j = 0; - for (i = 0; i < dp->alen; i++) { - if (dp->astr[i] != forbiddenword) flags2[j++] = dp->astr[i]; - } - dp->alen--; - dp->astr = flags2; // XXX allowed forbidden words - } - } - dp = dp->next_homonym; - } - return 0; -} - -// add a custom dic. word to the hash table (public) -int HashMgr::add(const char * word) -{ - unsigned short * flags = NULL; - int al = 0; - if (remove_forbidden_flag(word)) { - int captype; - int wbl = strlen(word); - int wcl = get_clen_and_captype(word, wbl, &captype); - add_word(word, wbl, wcl, flags, al, NULL, false); - return add_hidden_capitalized_word((char *) word, wbl, wcl, flags, al, NULL, captype); - } - return 0; -} - -int HashMgr::add_with_affix(const char * word, const char * example) -{ - // detect captype and modify word length for UTF-8 encoding - struct hentry * dp = lookup(example); - remove_forbidden_flag(word); - if (dp && dp->astr) { - int captype; - int wbl = strlen(word); - int wcl = get_clen_and_captype(word, wbl, &captype); - if (aliasf) { - add_word(word, wbl, wcl, dp->astr, dp->alen, NULL, false); - } else { - unsigned short * flags = (unsigned short *) malloc (dp->alen * sizeof(short)); - if (flags) { - memcpy((void *) flags, (void *) dp->astr, dp->alen * sizeof(short)); - add_word(word, wbl, wcl, flags, dp->alen, NULL, false); - } else return 1; - } - return add_hidden_capitalized_word((char *) word, wbl, wcl, dp->astr, dp->alen, NULL, captype); - } - return 1; -} - -// walk the hash table entry by entry - null at end -// initialize: col=-1; hp = NULL; hp = walk_hashtable(&col, hp); -struct hentry * HashMgr::walk_hashtable(int &col, struct hentry * hp) const -{ - if (hp && hp->next != NULL) return hp->next; - for (col++; col < tablesize; col++) { - if (tableptr[col]) return tableptr[col]; - } - // null at end and reset to start - col = -1; - return NULL; -} - -// load a munched word list and build a hash table on the fly -int HashMgr::load_tables(const char * tpath, const char * key) -{ - int al; - char * ap; - char * dp; - char * dp2; - unsigned short * flags; - char * ts; - - // open dictionary file - FileMgr * dict = new FileMgr(tpath, key); - if (dict == NULL) return 1; - - // first read the first line of file to get hash table size */ - if ((ts = dict->getline()) == NULL) { - HUNSPELL_WARNING(stderr, "error: empty dic file %s\n", tpath); - delete dict; - return 2; - } - mychomp(ts); - - /* remove byte order mark */ - if (strncmp(ts,"\xEF\xBB\xBF",3) == 0) { - memmove(ts, ts+3, strlen(ts+3)+1); - // warning: dic file begins with byte order mark: possible incompatibility with old Hunspell versions - } - - tablesize = atoi(ts); - - int nExtra = 5 + USERWORD; - - if (tablesize <= 0 || (tablesize >= (std::numeric_limits::max() - 1 - nExtra) / int(sizeof(struct hentry *)))) { - HUNSPELL_WARNING(stderr, "error: line 1: missing or bad word count in the dic file\n"); - delete dict; - return 4; - } - tablesize += nExtra; - if ((tablesize % 2) == 0) tablesize++; - - // allocate the hash table - tableptr = (struct hentry **) calloc(tablesize, sizeof(struct hentry *)); - if (! tableptr) { - delete dict; - return 3; - } - - // loop through all words on much list and add to hash - // table and create word and affix strings - - while ((ts = dict->getline()) != NULL) { - mychomp(ts); - // split each line into word and morphological description - dp = ts; - while ((dp = strchr(dp, ':')) != NULL) { - if ((dp > ts + 3) && (*(dp - 3) == ' ' || *(dp - 3) == '\t')) { - for (dp -= 4; dp >= ts && (*dp == ' ' || *dp == '\t'); dp--); - if (dp < ts) { // missing word - dp = NULL; - } else { - *(dp + 1) = '\0'; - dp = dp + 2; - } - break; - } - dp++; - } - - // tabulator is the old morphological field separator - dp2 = strchr(ts, '\t'); - if (dp2 && (!dp || dp2 < dp)) { - *dp2 = '\0'; - dp = dp2 + 1; - } - - // split each line into word and affix char strings - // "\/" signs slash in words (not affix separator) - // "/" at beginning of the line is word character (not affix separator) - ap = strchr(ts,'/'); - while (ap) { - if (ap == ts) { - ap++; - continue; - } else if (*(ap - 1) != '\\') break; - // replace "\/" with "/" - for (char * sp = ap - 1; *sp; *sp = *(sp + 1), sp++); - ap = strchr(ap,'/'); - } - - if (ap) { - *ap = '\0'; - if (aliasf) { - int index = atoi(ap + 1); - al = get_aliasf(index, &flags, dict); - if (!al) { - HUNSPELL_WARNING(stderr, "error: line %d: bad flag vector alias\n", dict->getlinenum()); - *ap = '\0'; - } - } else { - al = decode_flags(&flags, ap + 1, dict); - if (al == -1) { - HUNSPELL_WARNING(stderr, "Can't allocate memory.\n"); - delete dict; - return 6; - } - flag_qsort(flags, 0, al); - } - } else { - al = 0; - ap = NULL; - flags = NULL; - } - - int captype; - int wbl = strlen(ts); - int wcl = get_clen_and_captype(ts, wbl, &captype); - // add the word and its index plus its capitalized form optionally - if (add_word(ts,wbl,wcl,flags,al,dp, false) || - add_hidden_capitalized_word(ts, wbl, wcl, flags, al, dp, captype)) { - delete dict; - return 5; - } - } - - delete dict; - return 0; -} - -// the hash function is a simple load and rotate -// algorithm borrowed - -int HashMgr::hash(const char * word) const -{ - long hv = 0; - for (int i=0; i < 4 && *word != 0; i++) - hv = (hv << 8) | (*word++); - while (*word != 0) { - ROTATE(hv,ROTATE_LEN); - hv ^= (*word++); - } - return (unsigned long) hv % tablesize; -} - -int HashMgr::decode_flags(unsigned short ** result, char * flags, FileMgr * af) { - int len; - if (*flags == '\0') { - *result = NULL; - return 0; - } - switch (flag_mode) { - case FLAG_LONG: { // two-character flags (1x2yZz -> 1x 2y Zz) - len = strlen(flags); - if (len%2 == 1) HUNSPELL_WARNING(stderr, "error: line %d: bad flagvector\n", af->getlinenum()); - len /= 2; - *result = (unsigned short *) malloc(len * sizeof(short)); - if (!*result) return -1; - for (int i = 0; i < len; i++) { - (*result)[i] = (((unsigned short) flags[i * 2]) << 8) + (unsigned short) flags[i * 2 + 1]; - } - break; - } - case FLAG_NUM: { // decimal numbers separated by comma (4521,23,233 -> 4521 23 233) - int i; - len = 1; - char * src = flags; - unsigned short * dest; - char * p; - for (p = flags; *p; p++) { - if (*p == ',') len++; - } - *result = (unsigned short *) malloc(len * sizeof(short)); - if (!*result) return -1; - dest = *result; - for (p = flags; *p; p++) { - if (*p == ',') { - i = atoi(src); - if (i >= DEFAULTFLAGS) HUNSPELL_WARNING(stderr, "error: line %d: flag id %d is too large (max: %d)\n", - af->getlinenum(), i, DEFAULTFLAGS - 1); - *dest = (unsigned short) i; - if (*dest == 0) HUNSPELL_WARNING(stderr, "error: line %d: 0 is wrong flag id\n", af->getlinenum()); - src = p + 1; - dest++; - } - } - i = atoi(src); - if (i >= DEFAULTFLAGS) HUNSPELL_WARNING(stderr, "error: line %d: flag id %d is too large (max: %d)\n", - af->getlinenum(), i, DEFAULTFLAGS - 1); - *dest = (unsigned short) i; - if (*dest == 0) HUNSPELL_WARNING(stderr, "error: line %d: 0 is wrong flag id\n", af->getlinenum()); - break; - } - case FLAG_UNI: { // UTF-8 characters - w_char w[BUFSIZE/2]; - len = u8_u16(w, BUFSIZE/2, flags); - *result = (unsigned short *) malloc(len * sizeof(short)); - if (!*result) return -1; - memcpy(*result, w, len * sizeof(short)); - break; - } - default: { // Ispell's one-character flags (erfg -> e r f g) - unsigned short * dest; - len = strlen(flags); - *result = (unsigned short *) malloc(len * sizeof(short)); - if (!*result) return -1; - dest = *result; - for (unsigned char * p = (unsigned char *) flags; *p; p++) { - *dest = (unsigned short) *p; - dest++; - } - } - } - return len; -} - -unsigned short HashMgr::decode_flag(const char * f) { - unsigned short s = 0; - int i; - switch (flag_mode) { - case FLAG_LONG: - s = ((unsigned short) f[0] << 8) + (unsigned short) f[1]; - break; - case FLAG_NUM: - i = atoi(f); - if (i >= DEFAULTFLAGS) HUNSPELL_WARNING(stderr, "error: flag id %d is too large (max: %d)\n", i, DEFAULTFLAGS - 1); - s = (unsigned short) i; - break; - case FLAG_UNI: - u8_u16((w_char *) &s, 1, f); - break; - default: - s = (unsigned short) *((unsigned char *)f); - } - if (s == 0) HUNSPELL_WARNING(stderr, "error: 0 is wrong flag id\n"); - return s; -} - -char * HashMgr::encode_flag(unsigned short f) { - unsigned char ch[10]; - if (f==0) return mystrdup("(NULL)"); - if (flag_mode == FLAG_LONG) { - ch[0] = (unsigned char) (f >> 8); - ch[1] = (unsigned char) (f - ((f >> 8) << 8)); - ch[2] = '\0'; - } else if (flag_mode == FLAG_NUM) { - sprintf((char *) ch, "%d", f); - } else if (flag_mode == FLAG_UNI) { - u16_u8((char *) &ch, 10, (w_char *) &f, 1); - } else { - ch[0] = (unsigned char) (f); - ch[1] = '\0'; - } - return mystrdup((char *) ch); -} - -// read in aff file and set flag mode -int HashMgr::load_config(const char * affpath, const char * key) -{ - char * line; // io buffers - int firstline = 1; - - // open the affix file - FileMgr * afflst = new FileMgr(affpath, key); - if (!afflst) { - HUNSPELL_WARNING(stderr, "Error - could not open affix description file %s\n",affpath); - return 1; - } - - // read in each line ignoring any that do not - // start with a known line type indicator - - while ((line = afflst->getline()) != NULL) { - mychomp(line); - - /* remove byte order mark */ - if (firstline) { - firstline = 0; - if (strncmp(line,"\xEF\xBB\xBF",3) == 0) memmove(line, line+3, strlen(line+3)+1); - } - - /* parse in the try string */ - if ((strncmp(line,"FLAG",4) == 0) && isspace(line[4])) { - if (flag_mode != FLAG_CHAR) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions of the FLAG affix file parameter\n", afflst->getlinenum()); - } - if (strstr(line, "long")) flag_mode = FLAG_LONG; - if (strstr(line, "num")) flag_mode = FLAG_NUM; - if (strstr(line, "UTF-8")) flag_mode = FLAG_UNI; - if (flag_mode == FLAG_CHAR) { - HUNSPELL_WARNING(stderr, "error: line %d: FLAG needs `num', `long' or `UTF-8' parameter\n", afflst->getlinenum()); - } - } - if (strncmp(line,"FORBIDDENWORD",13) == 0) { - char * st = NULL; - if (parse_string(line, &st, afflst->getlinenum())) { - delete afflst; - return 1; - } - forbiddenword = decode_flag(st); - free(st); - } - if (strncmp(line, "SET", 3) == 0) { - if (parse_string(line, &enc, afflst->getlinenum())) { - delete afflst; - return 1; - } - if (strcmp(enc, "UTF-8") == 0) { - utf8 = 1; -#ifndef OPENOFFICEORG -#ifndef MOZILLA_CLIENT - initialize_utf_tbl(); -#endif -#endif - } else csconv = get_current_cs(enc); - } - if (strncmp(line, "LANG", 4) == 0) { - if (parse_string(line, &lang, afflst->getlinenum())) { - delete afflst; - return 1; - } - langnum = get_lang_num(lang); - } - - /* parse in the ignored characters (for example, Arabic optional diacritics characters */ - if (strncmp(line,"IGNORE",6) == 0) { - if (parse_array(line, &ignorechars, &ignorechars_utf16, - &ignorechars_utf16_len, utf8, afflst->getlinenum())) { - delete afflst; - return 1; - } - } - - if ((strncmp(line,"AF",2) == 0) && isspace(line[2])) { - if (parse_aliasf(line, afflst)) { - delete afflst; - return 1; - } - } - - if ((strncmp(line,"AM",2) == 0) && isspace(line[2])) { - if (parse_aliasm(line, afflst)) { - delete afflst; - return 1; - } - } - - if (strncmp(line,"COMPLEXPREFIXES",15) == 0) complexprefixes = 1; - if (((strncmp(line,"SFX",3) == 0) || (strncmp(line,"PFX",3) == 0)) && isspace(line[3])) break; - } - if (csconv == NULL) csconv = get_current_cs(SPELL_ENCODING); - delete afflst; - return 0; -} - -/* parse in the ALIAS table */ -int HashMgr::parse_aliasf(char * line, FileMgr * af) -{ - if (numaliasf != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); - return 1; - } - char * tp = line; - char * piece; - int i = 0; - int np = 0; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { np++; break; } - case 1: { - numaliasf = atoi(piece); - if (numaliasf < 1) { - numaliasf = 0; - aliasf = NULL; - aliasflen = NULL; - HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); - return 1; - } - aliasf = (unsigned short **) malloc(numaliasf * sizeof(unsigned short *)); - aliasflen = (unsigned short *) malloc(numaliasf * sizeof(short)); - if (!aliasf || !aliasflen) { - numaliasf = 0; - if (aliasf) free(aliasf); - if (aliasflen) free(aliasflen); - aliasf = NULL; - aliasflen = NULL; - return 1; - } - np++; - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (np != 2) { - numaliasf = 0; - free(aliasf); - free(aliasflen); - aliasf = NULL; - aliasflen = NULL; - HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); - return 1; - } - - /* now parse the numaliasf lines to read in the remainder of the table */ - char * nl; - for (int j=0; j < numaliasf; j++) { - if ((nl = af->getline()) == NULL) return 1; - mychomp(nl); - tp = nl; - i = 0; - aliasf[j] = NULL; - aliasflen[j] = 0; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { - if (strncmp(piece,"AF",2) != 0) { - numaliasf = 0; - free(aliasf); - free(aliasflen); - aliasf = NULL; - aliasflen = NULL; - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - return 1; - } - break; - } - case 1: { - aliasflen[j] = (unsigned short) decode_flags(&(aliasf[j]), piece, af); - flag_qsort(aliasf[j], 0, aliasflen[j]); - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (!aliasf[j]) { - free(aliasf); - free(aliasflen); - aliasf = NULL; - aliasflen = NULL; - numaliasf = 0; - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - return 1; - } - } - return 0; -} - -int HashMgr::is_aliasf() { - return (aliasf != NULL); -} - -int HashMgr::get_aliasf(int index, unsigned short ** fvec, FileMgr * af) { - if ((index > 0) && (index <= numaliasf)) { - *fvec = aliasf[index - 1]; - return aliasflen[index - 1]; - } - HUNSPELL_WARNING(stderr, "error: line %d: bad flag alias index: %d\n", af->getlinenum(), index); - *fvec = NULL; - return 0; -} - -/* parse morph alias definitions */ -int HashMgr::parse_aliasm(char * line, FileMgr * af) -{ - if (numaliasm != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); - return 1; - } - char * tp = line; - char * piece; - int i = 0; - int np = 0; - piece = mystrsep(&tp, 0); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { np++; break; } - case 1: { - numaliasm = atoi(piece); - if (numaliasm < 1) { - HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); - return 1; - } - aliasm = (char **) malloc(numaliasm * sizeof(char *)); - if (!aliasm) { - numaliasm = 0; - return 1; - } - np++; - break; - } - default: break; - } - i++; - } - piece = mystrsep(&tp, 0); - } - if (np != 2) { - numaliasm = 0; - free(aliasm); - aliasm = NULL; - HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); - return 1; - } - - /* now parse the numaliasm lines to read in the remainder of the table */ - char * nl = line; - for (int j=0; j < numaliasm; j++) { - if ((nl = af->getline()) == NULL) return 1; - mychomp(nl); - tp = nl; - i = 0; - aliasm[j] = NULL; - piece = mystrsep(&tp, ' '); - while (piece) { - if (*piece != '\0') { - switch(i) { - case 0: { - if (strncmp(piece,"AM",2) != 0) { - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - numaliasm = 0; - free(aliasm); - aliasm = NULL; - return 1; - } - break; - } - case 1: { - // add the remaining of the line - if (*tp) { - *(tp - 1) = ' '; - tp = tp + strlen(tp); - } - if (complexprefixes) { - if (utf8) reverseword_utf(piece); - else reverseword(piece); - } - aliasm[j] = mystrdup(piece); - if (!aliasm[j]) { - numaliasm = 0; - free(aliasm); - aliasm = NULL; - return 1; - } - break; } - default: break; - } - i++; - } - piece = mystrsep(&tp, ' '); - } - if (!aliasm[j]) { - numaliasm = 0; - free(aliasm); - aliasm = NULL; - HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); - return 1; - } - } - return 0; -} - -int HashMgr::is_aliasm() { - return (aliasm != NULL); -} - -char * HashMgr::get_aliasm(int index) { - if ((index > 0) && (index <= numaliasm)) return aliasm[index - 1]; - HUNSPELL_WARNING(stderr, "error: bad morph. alias index: %d\n", index); - return NULL; -} diff --git a/subprojects/hunspell/src/hunspell/hashmgr.hxx b/subprojects/hunspell/src/hunspell/hashmgr.hxx deleted file mode 100644 index 341b08131..000000000 --- a/subprojects/hunspell/src/hunspell/hashmgr.hxx +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef _HASHMGR_HXX_ -#define _HASHMGR_HXX_ - -#include "hunvisapi.h" - -#include - -#include "htypes.hxx" -#include "filemgr.hxx" - -enum flag { FLAG_CHAR, FLAG_LONG, FLAG_NUM, FLAG_UNI }; - -class LIBHUNSPELL_DLL_EXPORTED HashMgr -{ - int tablesize; - struct hentry ** tableptr; - int userword; - flag flag_mode; - int complexprefixes; - int utf8; - unsigned short forbiddenword; - int langnum; - char * enc; - char * lang; - struct cs_info * csconv; - char * ignorechars; - unsigned short * ignorechars_utf16; - int ignorechars_utf16_len; - int numaliasf; // flag vector `compression' with aliases - unsigned short ** aliasf; - unsigned short * aliasflen; - int numaliasm; // morphological desciption `compression' with aliases - char ** aliasm; - - -public: - HashMgr(const char * tpath, const char * apath, const char * key = NULL); - ~HashMgr(); - - struct hentry * lookup(const char *) const; - int hash(const char *) const; - struct hentry * walk_hashtable(int & col, struct hentry * hp) const; - - int add(const char * word); - int add_with_affix(const char * word, const char * pattern); - int remove(const char * word); - int decode_flags(unsigned short ** result, char * flags, FileMgr * af); - unsigned short decode_flag(const char * flag); - char * encode_flag(unsigned short flag); - int is_aliasf(); - int get_aliasf(int index, unsigned short ** fvec, FileMgr * af); - int is_aliasm(); - char * get_aliasm(int index); - -private: - int get_clen_and_captype(const char * word, int wbl, int * captype); - int load_tables(const char * tpath, const char * key); - int add_word(const char * word, int wbl, int wcl, unsigned short * ap, - int al, const char * desc, bool onlyupcase); - int load_config(const char * affpath, const char * key); - int parse_aliasf(char * line, FileMgr * af); - int add_hidden_capitalized_word(char * word, int wbl, int wcl, - unsigned short * flags, int al, char * dp, int captype); - int parse_aliasm(char * line, FileMgr * af); - int remove_forbidden_flag(const char * word); - -}; - -#endif diff --git a/subprojects/hunspell/src/hunspell/htypes.hxx b/subprojects/hunspell/src/hunspell/htypes.hxx deleted file mode 100644 index 5b6c90966..000000000 --- a/subprojects/hunspell/src/hunspell/htypes.hxx +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _HTYPES_HXX_ -#define _HTYPES_HXX_ - -#define ROTATE_LEN 5 - -#define ROTATE(v,q) \ - (v) = ((v) << (q)) | (((v) >> (32 - q)) & ((1 << (q))-1)); - -// hentry options -#define H_OPT (1 << 0) -#define H_OPT_ALIASM (1 << 1) -#define H_OPT_PHON (1 << 2) - -// see also csutil.hxx -#define HENTRY_WORD(h) &(h->word[0]) - -// approx. number of user defined words -#define USERWORD 1000 - -struct hentry -{ - unsigned char blen; // word length in bytes - unsigned char clen; // word length in characters (different for UTF-8 enc.) - short alen; // length of affix flag vector - unsigned short * astr; // affix flag vector - struct hentry * next; // next word with same hash code - struct hentry * next_homonym; // next homonym word (with same hash code) - char var; // variable fields (only for special pronounciation yet) - char word[1]; // variable-length word (8-bit or UTF-8 encoding) -}; - -#endif diff --git a/subprojects/hunspell/src/hunspell/hunspell.cxx b/subprojects/hunspell/src/hunspell/hunspell.cxx deleted file mode 100644 index 7dbcd2f91..000000000 --- a/subprojects/hunspell/src/hunspell/hunspell.cxx +++ /dev/null @@ -1,2040 +0,0 @@ -#include "license.hunspell" -#include "license.myspell" - -#include -#include -#include - -#include "hunspell.hxx" -#include "hunspell.h" -#ifndef MOZILLA_CLIENT -# include "config.h" -#endif -#include "csutil.hxx" - -#include - -Hunspell::Hunspell(const char * affpath, const char * dpath, const char * key) -{ - encoding = NULL; - csconv = NULL; - utf8 = 0; - complexprefixes = 0; - affixpath = mystrdup(affpath); - maxdic = 0; - - /* first set up the hash manager */ - pHMgr[0] = new HashMgr(dpath, affpath, key); - if (pHMgr[0]) maxdic = 1; - - /* next set up the affix manager */ - /* it needs access to the hash manager lookup methods */ - pAMgr = new AffixMgr(affpath, pHMgr, &maxdic, key); - - /* get the preferred try string and the dictionary */ - /* encoding from the Affix Manager for that dictionary */ - char * try_string = pAMgr->get_try_string(); - encoding = pAMgr->get_encoding(); - langnum = pAMgr->get_langnum(); - utf8 = pAMgr->get_utf8(); - if (!utf8) - csconv = get_current_cs(encoding); - complexprefixes = pAMgr->get_complexprefixes(); - wordbreak = pAMgr->get_breaktable(); - - /* and finally set up the suggestion manager */ - pSMgr = new SuggestMgr(try_string, MAXSUGGESTION, pAMgr); - if (try_string) free(try_string); -} - -Hunspell::~Hunspell() -{ - if (pSMgr) delete pSMgr; - if (pAMgr) delete pAMgr; - for (int i = 0; i < maxdic; i++) delete pHMgr[i]; - maxdic = 0; - pSMgr = NULL; - pAMgr = NULL; -#ifdef MOZILLA_CLIENT - delete [] csconv; -#endif - csconv= NULL; - if (encoding) free(encoding); - encoding = NULL; - if (affixpath) free(affixpath); - affixpath = NULL; -} - -// load extra dictionaries -int Hunspell::add_dic(const char * dpath, const char * key) { - if (maxdic == MAXDIC || !affixpath) return 1; - pHMgr[maxdic] = new HashMgr(dpath, affixpath, key); - if (pHMgr[maxdic]) maxdic++; else return 1; - return 0; -} - -// make a copy of src at destination while removing all leading -// blanks and removing any trailing periods after recording -// their presence with the abbreviation flag -// also since already going through character by character, -// set the capitalization type -// return the length of the "cleaned" (and UTF-8 encoded) word - -int Hunspell::cleanword2(char * dest, const char * src, - w_char * dest_utf, int * nc, int * pcaptype, int * pabbrev) -{ - unsigned char * p = (unsigned char *) dest; - const unsigned char * q = (const unsigned char * ) src; - - // first skip over any leading blanks - while ((*q != '\0') && (*q == ' ')) q++; - - // now strip off any trailing periods (recording their presence) - *pabbrev = 0; - int nl = strlen((const char *)q); - while ((nl > 0) && (*(q+nl-1)=='.')) { - nl--; - (*pabbrev)++; - } - - // if no characters are left it can't be capitalized - if (nl <= 0) { - *pcaptype = NOCAP; - *p = '\0'; - return 0; - } - - strncpy(dest, (char *) q, nl); - *(dest + nl) = '\0'; - nl = strlen(dest); - if (utf8) { - *nc = u8_u16(dest_utf, MAXWORDLEN, dest); - // don't check too long words - if (*nc >= MAXWORDLEN) return 0; - if (*nc == -1) { // big Unicode character (non BMP area) - *pcaptype = NOCAP; - return nl; - } - *pcaptype = get_captype_utf8(dest_utf, *nc, langnum); - } else { - *pcaptype = get_captype(dest, nl, csconv); - *nc = nl; - } - return nl; -} - -int Hunspell::cleanword(char * dest, const char * src, - int * pcaptype, int * pabbrev) -{ - unsigned char * p = (unsigned char *) dest; - const unsigned char * q = (const unsigned char * ) src; - int firstcap = 0; - - // first skip over any leading blanks - while ((*q != '\0') && (*q == ' ')) q++; - - // now strip off any trailing periods (recording their presence) - *pabbrev = 0; - int nl = strlen((const char *)q); - while ((nl > 0) && (*(q+nl-1)=='.')) { - nl--; - (*pabbrev)++; - } - - // if no characters are left it can't be capitalized - if (nl <= 0) { - *pcaptype = NOCAP; - *p = '\0'; - return 0; - } - - // now determine the capitalization type of the first nl letters - int ncap = 0; - int nneutral = 0; - int nc = 0; - - if (!utf8) { - while (nl > 0) { - nc++; - if (csconv[(*q)].ccase) ncap++; - if (csconv[(*q)].cupper == csconv[(*q)].clower) nneutral++; - *p++ = *q++; - nl--; - } - // remember to terminate the destination string - *p = '\0'; - firstcap = csconv[(unsigned char)(*dest)].ccase; - } else { - unsigned short idx; - w_char t[MAXWORDLEN]; - nc = u8_u16(t, MAXWORDLEN, src); - for (int i = 0; i < nc; i++) { - idx = (t[i].h << 8) + t[i].l; - unsigned short low = unicodetolower(idx, langnum); - if (idx != low) ncap++; - if (unicodetoupper(idx, langnum) == low) nneutral++; - } - u16_u8(dest, MAXWORDUTF8LEN, t, nc); - if (ncap) { - idx = (t[0].h << 8) + t[0].l; - firstcap = (idx != unicodetolower(idx, langnum)); - } - } - - // now finally set the captype - if (ncap == 0) { - *pcaptype = NOCAP; - } else if ((ncap == 1) && firstcap) { - *pcaptype = INITCAP; - } else if ((ncap == nc) || ((ncap + nneutral) == nc)){ - *pcaptype = ALLCAP; - } else if ((ncap > 1) && firstcap) { - *pcaptype = HUHINITCAP; - } else { - *pcaptype = HUHCAP; - } - return strlen(dest); -} - -void Hunspell::mkallcap(char * p) -{ - if (utf8) { - w_char u[MAXWORDLEN]; - int nc = u8_u16(u, MAXWORDLEN, p); - unsigned short idx; - for (int i = 0; i < nc; i++) { - idx = (u[i].h << 8) + u[i].l; - if (idx != unicodetoupper(idx, langnum)) { - u[i].h = (unsigned char) (unicodetoupper(idx, langnum) >> 8); - u[i].l = (unsigned char) (unicodetoupper(idx, langnum) & 0x00FF); - } - } - u16_u8(p, MAXWORDUTF8LEN, u, nc); - } else { - while (*p != '\0') { - *p = csconv[((unsigned char) *p)].cupper; - p++; - } - } -} - -int Hunspell::mkallcap2(char * p, w_char * u, int nc) -{ - if (utf8) { - unsigned short idx; - for (int i = 0; i < nc; i++) { - idx = (u[i].h << 8) + u[i].l; - unsigned short up = unicodetoupper(idx, langnum); - if (idx != up) { - u[i].h = (unsigned char) (up >> 8); - u[i].l = (unsigned char) (up & 0x00FF); - } - } - u16_u8(p, MAXWORDUTF8LEN, u, nc); - return strlen(p); - } else { - while (*p != '\0') { - *p = csconv[((unsigned char) *p)].cupper; - p++; - } - } - return nc; -} - - -void Hunspell::mkallsmall(char * p) -{ - while (*p != '\0') { - *p = csconv[((unsigned char) *p)].clower; - p++; - } -} - -int Hunspell::mkallsmall2(char * p, w_char * u, int nc) -{ - if (utf8) { - unsigned short idx; - for (int i = 0; i < nc; i++) { - idx = (u[i].h << 8) + u[i].l; - unsigned short low = unicodetolower(idx, langnum); - if (idx != low) { - u[i].h = (unsigned char) (low >> 8); - u[i].l = (unsigned char) (low & 0x00FF); - } - } - u16_u8(p, MAXWORDUTF8LEN, u, nc); - return strlen(p); - } else { - while (*p != '\0') { - *p = csconv[((unsigned char) *p)].clower; - p++; - } - } - return nc; -} - -// convert UTF-8 sharp S codes to latin 1 -char * Hunspell::sharps_u8_l1(char * dest, char * source) { - char * p = dest; - *p = *source; - for (p++, source++; *(source - 1); p++, source++) { - *p = *source; - if (*source == '\x9F') *--p = '\xDF'; - } - return dest; -} - -// recursive search for right ss - sharp s permutations -hentry * Hunspell::spellsharps(char * base, char * pos, int n, - int repnum, char * tmp, int * info, char **root) { - pos = strstr(pos, "ss"); - if (pos && (n < MAXSHARPS)) { - *pos = '\xC3'; - *(pos + 1) = '\x9F'; - hentry * h = spellsharps(base, pos + 2, n + 1, repnum + 1, tmp, info, root); - if (h) return h; - *pos = 's'; - *(pos + 1) = 's'; - h = spellsharps(base, pos + 2, n + 1, repnum, tmp, info, root); - if (h) return h; - } else if (repnum > 0) { - if (utf8) return checkword(base, info, root); - return checkword(sharps_u8_l1(tmp, base), info, root); - } - return NULL; -} - -int Hunspell::is_keepcase(const hentry * rv) { - return pAMgr && rv->astr && pAMgr->get_keepcase() && - TESTAFF(rv->astr, pAMgr->get_keepcase(), rv->alen); -} - -/* insert a word to the beginning of the suggestion array and return ns */ -int Hunspell::insert_sug(char ***slst, char * word, int ns) { - char * dup = mystrdup(word); - if (!dup) return ns; - if (ns == MAXSUGGESTION) { - ns--; - free((*slst)[ns]); - } - for (int k = ns; k > 0; k--) (*slst)[k] = (*slst)[k - 1]; - (*slst)[0] = dup; - return ns + 1; -} - -int Hunspell::spell(const char * word, int * info, char ** root) -{ - struct hentry * rv=NULL; - // need larger vector. For example, Turkish capital letter I converted a - // 2-byte UTF-8 character (dotless i) by mkallsmall. - char cw[MAXWORDUTF8LEN]; - char wspace[MAXWORDUTF8LEN]; - w_char unicw[MAXWORDLEN]; - - int info2 = 0; - if (!info) info = &info2; else *info = 0; - - // Hunspell supports XML input of the simplified API (see manual) - if (strcmp(word, SPELL_XML) == 0) return 1; - int nc = strlen(word); - int wl2 = 0; - if (utf8) { - if (nc >= MAXWORDUTF8LEN) return 0; - } else { - if (nc >= MAXWORDLEN) return 0; - } - int captype = 0; - int abbv = 0; - int wl = 0; - - // input conversion - RepList * rl = (pAMgr) ? pAMgr->get_iconvtable() : NULL; - if (rl && rl->conv(word, wspace)) wl = cleanword2(cw, wspace, unicw, &nc, &captype, &abbv); - else wl = cleanword2(cw, word, unicw, &nc, &captype, &abbv); - - if (wl == 0 || maxdic == 0) return 1; - if (root) *root = NULL; - - // allow numbers with dots, dashes and commas (but forbid double separators: "..", "--" etc.) - enum { NBEGIN, NNUM, NSEP }; - int nstate = NBEGIN; - int i; - - for (i = 0; (i < wl); i++) { - if ((cw[i] <= '9') && (cw[i] >= '0')) { - nstate = NNUM; - } else if ((cw[i] == ',') || (cw[i] == '.') || (cw[i] == '-')) { - if ((nstate == NSEP) || (i == 0)) break; - nstate = NSEP; - } else break; - } - if ((i == wl) && (nstate == NNUM)) return 1; - - switch(captype) { - case HUHCAP: - /* FALLTHROUGH */ - case HUHINITCAP: - *info += SPELL_ORIGCAP; - /* FALLTHROUGH */ - case NOCAP: - rv = checkword(cw, info, root); - if ((abbv) && !(rv)) { - memcpy(wspace,cw,wl); - *(wspace+wl) = '.'; - *(wspace+wl+1) = '\0'; - rv = checkword(wspace, info, root); - } - break; - case ALLCAP: { - *info += SPELL_ORIGCAP; - rv = checkword(cw, info, root); - if (rv) break; - if (abbv) { - memcpy(wspace,cw,wl); - *(wspace+wl) = '.'; - *(wspace+wl+1) = '\0'; - rv = checkword(wspace, info, root); - if (rv) break; - } - // Spec. prefix handling for Catalan, French, Italian: - // prefixes separated by apostrophe (SANT'ELIA -> Sant'+Elia). - if (pAMgr && strchr(cw, '\'')) { - wl = mkallsmall2(cw, unicw, nc); - //There are no really sane circumstances where this could fail, - //but anyway... - if (char * apostrophe = strchr(cw, '\'')) { - if (utf8) { - w_char tmpword[MAXWORDLEN]; - *apostrophe = '\0'; - wl2 = u8_u16(tmpword, MAXWORDLEN, cw); - *apostrophe = '\''; - if (wl2 >= 0 && wl2 < nc) { - mkinitcap2(apostrophe + 1, unicw + wl2 + 1, nc - wl2 - 1); - rv = checkword(cw, info, root); - if (rv) break; - } - } else { - mkinitcap2(apostrophe + 1, unicw, nc); - rv = checkword(cw, info, root); - if (rv) break; - } - } - mkinitcap2(cw, unicw, nc); - rv = checkword(cw, info, root); - if (rv) break; - } - if (pAMgr && pAMgr->get_checksharps() && strstr(cw, "SS")) { - char tmpword[MAXWORDUTF8LEN]; - wl = mkallsmall2(cw, unicw, nc); - memcpy(wspace,cw,(wl+1)); - rv = spellsharps(wspace, wspace, 0, 0, tmpword, info, root); - if (!rv) { - wl2 = mkinitcap2(cw, unicw, nc); - rv = spellsharps(cw, cw, 0, 0, tmpword, info, root); - } - if ((abbv) && !(rv)) { - *(wspace+wl) = '.'; - *(wspace+wl+1) = '\0'; - rv = spellsharps(wspace, wspace, 0, 0, tmpword, info, root); - if (!rv) { - memcpy(wspace, cw, wl2); - *(wspace+wl2) = '.'; - *(wspace+wl2+1) = '\0'; - rv = spellsharps(wspace, wspace, 0, 0, tmpword, info, root); - } - } - if (rv) break; - } - } - case INITCAP: { - *info += SPELL_ORIGCAP; - wl = mkallsmall2(cw, unicw, nc); - memcpy(wspace,cw,(wl+1)); - wl2 = mkinitcap2(cw, unicw, nc); - if (captype == INITCAP) *info += SPELL_INITCAP; - rv = checkword(cw, info, root); - if (captype == INITCAP) *info -= SPELL_INITCAP; - // forbid bad capitalization - // (for example, ijs -> Ijs instead of IJs in Dutch) - // use explicit forms in dic: Ijs/F (F = FORBIDDENWORD flag) - if (*info & SPELL_FORBIDDEN) { - rv = NULL; - break; - } - if (rv && is_keepcase(rv) && (captype == ALLCAP)) rv = NULL; - if (rv) break; - - rv = checkword(wspace, info, root); - if (abbv && !rv) { - - *(wspace+wl) = '.'; - *(wspace+wl+1) = '\0'; - rv = checkword(wspace, info, root); - if (!rv) { - memcpy(wspace, cw, wl2); - *(wspace+wl2) = '.'; - *(wspace+wl2+1) = '\0'; - if (captype == INITCAP) *info += SPELL_INITCAP; - rv = checkword(wspace, info, root); - if (captype == INITCAP) *info -= SPELL_INITCAP; - if (rv && is_keepcase(rv) && (captype == ALLCAP)) rv = NULL; - break; - } - } - if (rv && is_keepcase(rv) && - ((captype == ALLCAP) || - // if CHECKSHARPS: KEEPCASE words with \xDF are allowed - // in INITCAP form, too. - !(pAMgr->get_checksharps() && - ((utf8 && strstr(wspace, "\xC3\x9F")) || - (!utf8 && strchr(wspace, '\xDF')))))) rv = NULL; - break; - } - } - - if (rv) { - if (pAMgr && pAMgr->get_warn() && rv->astr && - TESTAFF(rv->astr, pAMgr->get_warn(), rv->alen)) { - *info += SPELL_WARN; - if (pAMgr->get_forbidwarn()) return 0; - return HUNSPELL_OK_WARN; - } - return HUNSPELL_OK; - } - - // recursive breaking at break points - if (wordbreak) { - char * s; - char r; - int nbr = 0; - wl = strlen(cw); - int numbreak = pAMgr ? pAMgr->get_numbreak() : 0; - - // calculate break points for recursion limit - for (int j = 0; j < numbreak; j++) { - s = cw; - do { - s = (char *) strstr(s, wordbreak[j]); - if (s) { - nbr++; - s++; - } - } while (s); - } - if (nbr >= 10) return 0; - - // check boundary patterns (^begin and end$) - for (int j = 0; j < numbreak; j++) { - int plen = strlen(wordbreak[j]); - if (plen == 1 || plen > wl) continue; - if (wordbreak[j][0] == '^' && strncmp(cw, wordbreak[j] + 1, plen - 1) == 0 - && spell(cw + plen - 1)) return 1; - if (wordbreak[j][plen - 1] == '$' && - strncmp(cw + wl - plen + 1, wordbreak[j], plen - 1) == 0) { - r = cw[wl - plen + 1]; - cw[wl - plen + 1] = '\0'; - if (spell(cw)) return 1; - cw[wl - plen + 1] = r; - } - } - - // other patterns - for (int j = 0; j < numbreak; j++) { - int plen = strlen(wordbreak[j]); - s=(char *) strstr(cw, wordbreak[j]); - if (s && (s > cw) && (s < cw + wl - plen)) { - if (!spell(s + plen)) continue; - r = *s; - *s = '\0'; - // examine 2 sides of the break point - if (spell(cw)) return 1; - *s = r; - - // LANG_hu: spec. dash rule - if (langnum == LANG_hu && strcmp(wordbreak[j], "-") == 0) { - r = s[1]; - s[1] = '\0'; - if (spell(cw)) return 1; // check the first part with dash - s[1] = r; - } - // end of LANG speficic region - - } - } - } - - return 0; -} - -struct hentry * Hunspell::checkword(const char * w, int * info, char ** root) -{ - struct hentry * he = NULL; - int len, i; - char w2[MAXWORDUTF8LEN]; - const char * word; - - char * ignoredchars = pAMgr->get_ignore(); - if (ignoredchars != NULL) { - strcpy(w2, w); - if (utf8) { - int ignoredchars_utf16_len; - unsigned short * ignoredchars_utf16 = pAMgr->get_ignore_utf16(&ignoredchars_utf16_len); - remove_ignored_chars_utf(w2, ignoredchars_utf16, ignoredchars_utf16_len); - } else { - remove_ignored_chars(w2,ignoredchars); - } - word = w2; - } else word = w; - - len = strlen(word); - - if (!len) - return NULL; - - // word reversing wrapper for complex prefixes - if (complexprefixes) { - if (word != w2) { - strcpy(w2, word); - word = w2; - } - if (utf8) reverseword_utf(w2); else reverseword(w2); - } - - // look word in hash table - for (i = 0; (i < maxdic) && !he; i ++) { - he = (pHMgr[i])->lookup(word); - - // check forbidden and onlyincompound words - if ((he) && (he->astr) && (pAMgr) && TESTAFF(he->astr, pAMgr->get_forbiddenword(), he->alen)) { - if (info) *info += SPELL_FORBIDDEN; - // LANG_hu section: set dash information for suggestions - if (langnum == LANG_hu) { - if (pAMgr->get_compoundflag() && - TESTAFF(he->astr, pAMgr->get_compoundflag(), he->alen)) { - if (info) *info += SPELL_COMPOUND; - } - } - return NULL; - } - - // he = next not needaffix, onlyincompound homonym or onlyupcase word - while (he && (he->astr) && - ((pAMgr->get_needaffix() && TESTAFF(he->astr, pAMgr->get_needaffix(), he->alen)) || - (pAMgr->get_onlyincompound() && TESTAFF(he->astr, pAMgr->get_onlyincompound(), he->alen)) || - (info && (*info & SPELL_INITCAP) && TESTAFF(he->astr, ONLYUPCASEFLAG, he->alen)) - )) he = he->next_homonym; - } - - // check with affixes - if (!he && pAMgr) { - // try stripping off affixes */ - he = pAMgr->affix_check(word, len, 0); - - // check compound restriction and onlyupcase - if (he && he->astr && ( - (pAMgr->get_onlyincompound() && - TESTAFF(he->astr, pAMgr->get_onlyincompound(), he->alen)) || - (info && (*info & SPELL_INITCAP) && - TESTAFF(he->astr, ONLYUPCASEFLAG, he->alen)))) { - he = NULL; - } - - if (he) { - if ((he->astr) && (pAMgr) && TESTAFF(he->astr, pAMgr->get_forbiddenword(), he->alen)) { - if (info) *info += SPELL_FORBIDDEN; - return NULL; - } - if (root) { - *root = mystrdup(he->word); - if (*root && complexprefixes) { - if (utf8) reverseword_utf(*root); else reverseword(*root); - } - } - // try check compound word - } else if (pAMgr->get_compound()) { - he = pAMgr->compound_check(word, len, 0, 0, 100, 0, NULL, 0, 0, info); - // LANG_hu section: `moving rule' with last dash - if ((!he) && (langnum == LANG_hu) && (word[len-1] == '-')) { - char * dup = mystrdup(word); - if (!dup) return NULL; - dup[len-1] = '\0'; - he = pAMgr->compound_check(dup, len-1, -5, 0, 100, 0, NULL, 1, 0, info); - free(dup); - } - // end of LANG speficic region - if (he) { - if (root) { - *root = mystrdup(he->word); - if (*root && complexprefixes) { - if (utf8) reverseword_utf(*root); else reverseword(*root); - } - } - if (info) *info += SPELL_COMPOUND; - } - } - - } - - return he; -} - -int Hunspell::suggest(char*** slst, const char * word) -{ - int onlycmpdsug = 0; - char cw[MAXWORDUTF8LEN]; - char wspace[MAXWORDUTF8LEN]; - if (!pSMgr || maxdic == 0) return 0; - w_char unicw[MAXWORDLEN]; - *slst = NULL; - // process XML input of the simplified API (see manual) - if (strncmp(word, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) { - return spellml(slst, word); - } - int nc = strlen(word); - if (utf8) { - if (nc >= MAXWORDUTF8LEN) return 0; - } else { - if (nc >= MAXWORDLEN) return 0; - } - int captype = 0; - int abbv = 0; - int wl = 0; - - // input conversion - RepList * rl = (pAMgr) ? pAMgr->get_iconvtable() : NULL; - if (rl && rl->conv(word, wspace)) wl = cleanword2(cw, wspace, unicw, &nc, &captype, &abbv); - else wl = cleanword2(cw, word, unicw, &nc, &captype, &abbv); - - if (wl == 0) return 0; - int ns = 0; - int capwords = 0; - - // check capitalized form for FORCEUCASE - if (pAMgr && captype == NOCAP && pAMgr->get_forceucase()) { - int info = SPELL_ORIGCAP; - char ** wlst; - if (checkword(cw, &info, NULL)) { - if (*slst) { - wlst = *slst; - } else { - wlst = (char **) malloc(MAXSUGGESTION * sizeof(char *)); - if (wlst == NULL) return -1; - *slst = wlst; - for (int i = 0; i < MAXSUGGESTION; i++) { - wlst[i] = NULL; - } - } - wlst[0] = mystrdup(cw); - mkinitcap(wlst[0]); - return 1; - } - } - - switch(captype) { - case NOCAP: { - ns = pSMgr->suggest(slst, cw, ns, &onlycmpdsug); - break; - } - - case INITCAP: { - capwords = 1; - ns = pSMgr->suggest(slst, cw, ns, &onlycmpdsug); - if (ns == -1) break; - memcpy(wspace,cw,(wl+1)); - mkallsmall2(wspace, unicw, nc); - ns = pSMgr->suggest(slst, wspace, ns, &onlycmpdsug); - break; - } - case HUHINITCAP: - capwords = 1; - case HUHCAP: { - ns = pSMgr->suggest(slst, cw, ns, &onlycmpdsug); - if (ns != -1) { - int prevns; - // something.The -> something. The - char * dot = strchr(cw, '.'); - if (dot && (dot > cw)) { - int captype_; - if (utf8) - { - w_char w_[MAXWORDLEN]; - int wl_ = u8_u16(w_, MAXWORDLEN, dot + 1); - captype_ = get_captype_utf8(w_, wl_, langnum); - } else captype_ = get_captype(dot+1, strlen(dot+1), csconv); - if (captype_ == INITCAP) - { - char * st = mystrdup(cw); - if (st) - { - char *newst = (char *) realloc(st, wl + 2); - if (newst == NULL) - free(st); - st = newst; - } - if (st) - { - st[(dot - cw) + 1] = ' '; - strcpy(st + (dot - cw) + 2, dot + 1); - ns = insert_sug(slst, st, ns); - free(st); - } - } - } - if (captype == HUHINITCAP) { - // TheOpenOffice.org -> The OpenOffice.org - memcpy(wspace,cw,(wl+1)); - mkinitsmall2(wspace, unicw, nc); - ns = pSMgr->suggest(slst, wspace, ns, &onlycmpdsug); - } - memcpy(wspace,cw,(wl+1)); - mkallsmall2(wspace, unicw, nc); - if (spell(wspace)) ns = insert_sug(slst, wspace, ns); - prevns = ns; - ns = pSMgr->suggest(slst, wspace, ns, &onlycmpdsug); - if (captype == HUHINITCAP) { - mkinitcap2(wspace, unicw, nc); - if (spell(wspace)) ns = insert_sug(slst, wspace, ns); - ns = pSMgr->suggest(slst, wspace, ns, &onlycmpdsug); - } - // aNew -> "a New" (instead of "a new") - for (int j = prevns; j < ns; j++) { - char * space = strchr((*slst)[j],' '); - if (space) { - int slen = strlen(space + 1); - // different case after space (need capitalisation) - if ((slen < wl) && strcmp(cw + wl - slen, space + 1)) { - w_char w[MAXWORDLEN]; - int wc = 0; - char * r = (*slst)[j]; - if (utf8) wc = u8_u16(w, MAXWORDLEN, space + 1); - mkinitcap2(space + 1, w, wc); - // set as first suggestion - for (int k = j; k > 0; k--) (*slst)[k] = (*slst)[k - 1]; - (*slst)[0] = r; - } - } - } - } - break; - } - - case ALLCAP: { - memcpy(wspace, cw, (wl+1)); - mkallsmall2(wspace, unicw, nc); - ns = pSMgr->suggest(slst, wspace, ns, &onlycmpdsug); - if (ns == -1) break; - if (pAMgr && pAMgr->get_keepcase() && spell(wspace)) - ns = insert_sug(slst, wspace, ns); - mkinitcap2(wspace, unicw, nc); - ns = pSMgr->suggest(slst, wspace, ns, &onlycmpdsug); - for (int j=0; j < ns; j++) { - mkallcap((*slst)[j]); - if (pAMgr && pAMgr->get_checksharps()) { - char * pos; - if (utf8) { - pos = strstr((*slst)[j], "\xC3\x9F"); - while (pos) { - *pos = 'S'; - *(pos+1) = 'S'; - pos = strstr(pos+2, "\xC3\x9F"); - } - } else { - pos = strchr((*slst)[j], '\xDF'); - while (pos) { - (*slst)[j] = (char *) realloc((*slst)[j], strlen((*slst)[j]) + 2); - mystrrep((*slst)[j], "\xDF", "SS"); - pos = strchr((*slst)[j], '\xDF'); - } - } - } - } - break; - } - } - - // LANG_hu section: replace '-' with ' ' in Hungarian - if (langnum == LANG_hu) { - for (int j=0; j < ns; j++) { - char * pos = strchr((*slst)[j],'-'); - if (pos) { - int info; - char w[MAXWORDUTF8LEN]; - *pos = '\0'; - strcpy(w, (*slst)[j]); - strcat(w, pos + 1); - (void)spell(w, &info, NULL); - if ((info & SPELL_COMPOUND) && (info & SPELL_FORBIDDEN)) { - *pos = ' '; - } else *pos = '-'; - } - } - } - // END OF LANG_hu section - - // try ngram approach since found nothing or only compound words - if (pAMgr && (ns == 0 || onlycmpdsug) && (pAMgr->get_maxngramsugs() != 0) && (*slst)) { - switch(captype) { - case NOCAP: { - ns = pSMgr->ngsuggest(*slst, cw, ns, pHMgr, maxdic); - break; - } - case HUHINITCAP: - capwords = 1; - case HUHCAP: { - memcpy(wspace,cw,(wl+1)); - mkallsmall2(wspace, unicw, nc); - ns = pSMgr->ngsuggest(*slst, wspace, ns, pHMgr, maxdic); - break; - } - case INITCAP: { - capwords = 1; - memcpy(wspace,cw,(wl+1)); - mkallsmall2(wspace, unicw, nc); - ns = pSMgr->ngsuggest(*slst, wspace, ns, pHMgr, maxdic); - break; - } - case ALLCAP: { - memcpy(wspace,cw,(wl+1)); - mkallsmall2(wspace, unicw, nc); - int oldns = ns; - ns = pSMgr->ngsuggest(*slst, wspace, ns, pHMgr, maxdic); - for (int j = oldns; j < ns; j++) - mkallcap((*slst)[j]); - break; - } - } - } - - // try dash suggestion (Afo-American -> Afro-American) - if (char * pos = strchr(cw, '-')) { - char * ppos = cw; - int nodashsug = 1; - char ** nlst = NULL; - int nn = 0; - int last = 0; - if (*slst) { - for (int j = 0; j < ns && nodashsug == 1; j++) { - if (strchr((*slst)[j], '-')) nodashsug = 0; - } - } - while (nodashsug && !last) { - if (*pos == '\0') last = 1; else *pos = '\0'; - if (!spell(ppos)) { - nn = suggest(&nlst, ppos); - for (int j = nn - 1; j >= 0; j--) { - strncpy(wspace, cw, ppos - cw); - strcpy(wspace + (ppos - cw), nlst[j]); - if (!last) { - strcat(wspace, "-"); - strcat(wspace, pos + 1); - } - ns = insert_sug(slst, wspace, ns); - free(nlst[j]); - } - if (nlst != NULL) free(nlst); - nodashsug = 0; - } - if (!last) { - *pos = '-'; - ppos = pos + 1; - pos = strchr(ppos, '-'); - } - if (!pos) pos = cw + strlen(cw); - } - } - - // word reversing wrapper for complex prefixes - if (complexprefixes) { - for (int j = 0; j < ns; j++) { - if (utf8) reverseword_utf((*slst)[j]); else reverseword((*slst)[j]); - } - } - - // capitalize - if (capwords) for (int j=0; j < ns; j++) { - mkinitcap((*slst)[j]); - } - - // expand suggestions with dot(s) - if (abbv && pAMgr && pAMgr->get_sugswithdots()) { - for (int j = 0; j < ns; j++) { - (*slst)[j] = (char *) realloc((*slst)[j], strlen((*slst)[j]) + 1 + abbv); - strcat((*slst)[j], word + strlen(word) - abbv); - } - } - - // remove bad capitalized and forbidden forms - if (pAMgr && (pAMgr->get_keepcase() || pAMgr->get_forbiddenword())) { - switch (captype) { - case INITCAP: - case ALLCAP: { - int l = 0; - for (int j=0; j < ns; j++) { - if (!strchr((*slst)[j],' ') && !spell((*slst)[j])) { - char s[MAXSWUTF8L]; - w_char w[MAXSWL]; - int len; - if (utf8) { - len = u8_u16(w, MAXSWL, (*slst)[j]); - } else { - strcpy(s, (*slst)[j]); - len = strlen(s); - } - mkallsmall2(s, w, len); - free((*slst)[j]); - if (spell(s)) { - (*slst)[l] = mystrdup(s); - if ((*slst)[l]) l++; - } else { - mkinitcap2(s, w, len); - if (spell(s)) { - (*slst)[l] = mystrdup(s); - if ((*slst)[l]) l++; - } - } - } else { - (*slst)[l] = (*slst)[j]; - l++; - } - } - ns = l; - } - } - } - - // remove duplications - int l = 0; - for (int j = 0; j < ns; j++) { - (*slst)[l] = (*slst)[j]; - for (int k = 0; k < l; k++) { - if (strcmp((*slst)[k], (*slst)[j]) == 0) { - free((*slst)[j]); - l--; - break; - } - } - l++; - } - ns = l; - - // output conversion - rl = (pAMgr) ? pAMgr->get_oconvtable() : NULL; - for (int j = 0; rl && j < ns; j++) { - if (rl->conv((*slst)[j], wspace)) { - free((*slst)[j]); - (*slst)[j] = mystrdup(wspace); - } - } - - // if suggestions removed by nosuggest, onlyincompound parameters - if (l == 0 && *slst) { - free(*slst); - *slst = NULL; - } - return l; -} - -void Hunspell::free_list(char *** slst, int n) { - freelist(slst, n); -} - -char * Hunspell::get_dic_encoding() -{ - return encoding; -} - -#ifdef HUNSPELL_EXPERIMENTAL -// XXX need UTF-8 support -int Hunspell::suggest_auto(char*** slst, const char * word) -{ - char cw[MAXWORDUTF8LEN]; - char wspace[MAXWORDUTF8LEN]; - if (!pSMgr || maxdic == 0) return 0; - int wl = strlen(word); - if (utf8) { - if (wl >= MAXWORDUTF8LEN) return 0; - } else { - if (wl >= MAXWORDLEN) return 0; - } - int captype = 0; - int abbv = 0; - wl = cleanword(cw, word, &captype, &abbv); - if (wl == 0) return 0; - int ns = 0; - *slst = NULL; // HU, nsug in pSMgr->suggest - - switch(captype) { - case NOCAP: { - ns = pSMgr->suggest_auto(slst, cw, ns); - if (ns>0) break; - break; - } - - case INITCAP: { - memcpy(wspace,cw,(wl+1)); - mkallsmall(wspace); - ns = pSMgr->suggest_auto(slst, wspace, ns); - for (int j=0; j < ns; j++) - mkinitcap((*slst)[j]); - ns = pSMgr->suggest_auto(slst, cw, ns); - break; - - } - - case HUHINITCAP: - case HUHCAP: { - ns = pSMgr->suggest_auto(slst, cw, ns); - if (ns == 0) { - memcpy(wspace,cw,(wl+1)); - mkallsmall(wspace); - ns = pSMgr->suggest_auto(slst, wspace, ns); - } - break; - } - - case ALLCAP: { - memcpy(wspace,cw,(wl+1)); - mkallsmall(wspace); - ns = pSMgr->suggest_auto(slst, wspace, ns); - - mkinitcap(wspace); - ns = pSMgr->suggest_auto(slst, wspace, ns); - - for (int j=0; j < ns; j++) - mkallcap((*slst)[j]); - break; - } - } - - // word reversing wrapper for complex prefixes - if (complexprefixes) { - for (int j = 0; j < ns; j++) { - if (utf8) reverseword_utf((*slst)[j]); else reverseword((*slst)[j]); - } - } - - // expand suggestions with dot(s) - if (abbv && pAMgr && pAMgr->get_sugswithdots()) { - for (int j = 0; j < ns; j++) { - (*slst)[j] = (char *) realloc((*slst)[j], strlen((*slst)[j]) + 1 + abbv); - strcat((*slst)[j], word + strlen(word) - abbv); - } - } - - // LANG_hu section: replace '-' with ' ' in Hungarian - if (langnum == LANG_hu) { - for (int j=0; j < ns; j++) { - char * pos = strchr((*slst)[j],'-'); - if (pos) { - int info; - char w[MAXWORDUTF8LEN]; - *pos = '\0'; - strcpy(w, (*slst)[j]); - strcat(w, pos + 1); - spell(w, &info, NULL); - if ((info & SPELL_COMPOUND) && (info & SPELL_FORBIDDEN)) { - *pos = ' '; - } else *pos = '-'; - } - } - } - // END OF LANG_hu section - return ns; -} -#endif - -int Hunspell::stem(char*** slst, char ** desc, int n) -{ - char result[MAXLNLEN]; - char result2[MAXLNLEN]; - *slst = NULL; - if (n == 0) return 0; - *result2 = '\0'; - for (int i = 0; i < n; i++) { - *result = '\0'; - // add compound word parts (except the last one) - char * s = (char *) desc[i]; - char * part = strstr(s, MORPH_PART); - if (part) { - char * nextpart = strstr(part + 1, MORPH_PART); - while (nextpart) { - copy_field(result + strlen(result), part, MORPH_PART); - part = nextpart; - nextpart = strstr(part + 1, MORPH_PART); - } - s = part; - } - - char **pl; - char tok[MAXLNLEN]; - strcpy(tok, s); - char * alt = strstr(tok, " | "); - while (alt) { - alt[1] = MSEP_ALT; - alt = strstr(alt, " | "); - } - int pln = line_tok(tok, &pl, MSEP_ALT); - for (int k = 0; k < pln; k++) { - // add derivational suffixes - if (strstr(pl[k], MORPH_DERI_SFX)) { - // remove inflectional suffixes - char * is = strstr(pl[k], MORPH_INFL_SFX); - if (is) *is = '\0'; - char * sg = pSMgr->suggest_gen(&(pl[k]), 1, pl[k]); - if (sg) { - char ** gen; - int genl = line_tok(sg, &gen, MSEP_REC); - free(sg); - for (int j = 0; j < genl; j++) { - sprintf(result2 + strlen(result2), "%c%s%s", - MSEP_REC, result, gen[j]); - } - freelist(&gen, genl); - } - } else { - sprintf(result2 + strlen(result2), "%c%s", MSEP_REC, result); - if (strstr(pl[k], MORPH_SURF_PFX)) { - copy_field(result2 + strlen(result2), pl[k], MORPH_SURF_PFX); - } - copy_field(result2 + strlen(result2), pl[k], MORPH_STEM); - } - } - freelist(&pl, pln); - } - int sln = line_tok(result2, slst, MSEP_REC); - return uniqlist(*slst, sln); - -} - -int Hunspell::stem(char*** slst, const char * word) -{ - char ** pl; - int pln = analyze(&pl, word); - int pln2 = stem(slst, pl, pln); - freelist(&pl, pln); - return pln2; -} - -#ifdef HUNSPELL_EXPERIMENTAL -int Hunspell::suggest_pos_stems(char*** slst, const char * word) -{ - char cw[MAXWORDUTF8LEN]; - char wspace[MAXWORDUTF8LEN]; - if (! pSMgr || maxdic == 0) return 0; - int wl = strlen(word); - if (utf8) { - if (wl >= MAXWORDUTF8LEN) return 0; - } else { - if (wl >= MAXWORDLEN) return 0; - } - int captype = 0; - int abbv = 0; - wl = cleanword(cw, word, &captype, &abbv); - if (wl == 0) return 0; - - int ns = 0; // ns=0 = normalized input - - *slst = NULL; // HU, nsug in pSMgr->suggest - - switch(captype) { - case HUHCAP: - case NOCAP: { - ns = pSMgr->suggest_pos_stems(slst, cw, ns); - - if ((abbv) && (ns == 0)) { - memcpy(wspace,cw,wl); - *(wspace+wl) = '.'; - *(wspace+wl+1) = '\0'; - ns = pSMgr->suggest_pos_stems(slst, wspace, ns); - } - - break; - } - - case INITCAP: { - - ns = pSMgr->suggest_pos_stems(slst, cw, ns); - - if (ns == 0 || ((*slst)[0][0] == '#')) { - memcpy(wspace,cw,(wl+1)); - mkallsmall(wspace); - ns = pSMgr->suggest_pos_stems(slst, wspace, ns); - } - - break; - - } - - case ALLCAP: { - ns = pSMgr->suggest_pos_stems(slst, cw, ns); - if (ns != 0) break; - - memcpy(wspace,cw,(wl+1)); - mkallsmall(wspace); - ns = pSMgr->suggest_pos_stems(slst, wspace, ns); - - if (ns == 0) { - mkinitcap(wspace); - ns = pSMgr->suggest_pos_stems(slst, wspace, ns); - } - break; - } - } - - return ns; -} -#endif // END OF HUNSPELL_EXPERIMENTAL CODE - -const char * Hunspell::get_wordchars() -{ - return pAMgr->get_wordchars(); -} - -unsigned short * Hunspell::get_wordchars_utf16(int * len) -{ - return pAMgr->get_wordchars_utf16(len); -} - -void Hunspell::mkinitcap(char * p) -{ - if (!utf8) { - if (*p != '\0') *p = csconv[((unsigned char)*p)].cupper; - } else { - int len; - w_char u[MAXWORDLEN]; - len = u8_u16(u, MAXWORDLEN, p); - unsigned short i = unicodetoupper((u[0].h << 8) + u[0].l, langnum); - u[0].h = (unsigned char) (i >> 8); - u[0].l = (unsigned char) (i & 0x00FF); - u16_u8(p, MAXWORDUTF8LEN, u, len); - } -} - -int Hunspell::mkinitcap2(char * p, w_char * u, int nc) -{ - if (!utf8) { - if (*p != '\0') *p = csconv[((unsigned char)*p)].cupper; - } else if (nc > 0) { - unsigned short i = unicodetoupper((u[0].h << 8) + u[0].l, langnum); - u[0].h = (unsigned char) (i >> 8); - u[0].l = (unsigned char) (i & 0x00FF); - u16_u8(p, MAXWORDUTF8LEN, u, nc); - return strlen(p); - } - return nc; -} - -int Hunspell::mkinitsmall2(char * p, w_char * u, int nc) -{ - if (!utf8) { - if (*p != '\0') *p = csconv[((unsigned char)*p)].clower; - } else if (nc > 0) { - unsigned short i = unicodetolower((u[0].h << 8) + u[0].l, langnum); - u[0].h = (unsigned char) (i >> 8); - u[0].l = (unsigned char) (i & 0x00FF); - u16_u8(p, MAXWORDUTF8LEN, u, nc); - return strlen(p); - } - return nc; -} - -int Hunspell::add(const char * word) -{ - if (pHMgr[0]) return (pHMgr[0])->add(word); - return 0; -} - -int Hunspell::add_with_affix(const char * word, const char * example) -{ - if (pHMgr[0]) return (pHMgr[0])->add_with_affix(word, example); - return 0; -} - -int Hunspell::remove(const char * word) -{ - if (pHMgr[0]) return (pHMgr[0])->remove(word); - return 0; -} - -const char * Hunspell::get_version() -{ - return pAMgr->get_version(); -} - -struct cs_info * Hunspell::get_csconv() -{ - return csconv; -} - -void Hunspell::cat_result(char * result, char * st) -{ - if (st) { - if (*result) mystrcat(result, "\n", MAXLNLEN); - mystrcat(result, st, MAXLNLEN); - free(st); - } -} - -int Hunspell::analyze(char*** slst, const char * word) -{ - char cw[MAXWORDUTF8LEN]; - char wspace[MAXWORDUTF8LEN]; - w_char unicw[MAXWORDLEN]; - int wl2 = 0; - *slst = NULL; - if (! pSMgr || maxdic == 0) return 0; - int nc = strlen(word); - if (utf8) { - if (nc >= MAXWORDUTF8LEN) return 0; - } else { - if (nc >= MAXWORDLEN) return 0; - } - int captype = 0; - int abbv = 0; - int wl = 0; - - // input conversion - RepList * rl = (pAMgr) ? pAMgr->get_iconvtable() : NULL; - if (rl && rl->conv(word, wspace)) wl = cleanword2(cw, wspace, unicw, &nc, &captype, &abbv); - else wl = cleanword2(cw, word, unicw, &nc, &captype, &abbv); - - if (wl == 0) { - if (abbv) { - for (wl = 0; wl < abbv; wl++) cw[wl] = '.'; - cw[wl] = '\0'; - abbv = 0; - } else return 0; - } - - char result[MAXLNLEN]; - char * st = NULL; - - *result = '\0'; - - int n = 0; - int n2 = 0; - int n3 = 0; - - // test numbers - // LANG_hu section: set dash information for suggestions - if (langnum == LANG_hu) { - while ((n < wl) && - (((cw[n] <= '9') && (cw[n] >= '0')) || (((cw[n] == '.') || (cw[n] == ',')) && (n > 0)))) { - n++; - if ((cw[n] == '.') || (cw[n] == ',')) { - if (((n2 == 0) && (n > 3)) || - ((n2 > 0) && ((cw[n-1] == '.') || (cw[n-1] == ',')))) break; - n2++; - n3 = n; - } - } - - if ((n == wl) && (n3 > 0) && (n - n3 > 3)) return 0; - if ((n == wl) || ((n>0) && ((cw[n]=='%') || (cw[n]=='\xB0')) && checkword(cw+n, NULL, NULL))) { - mystrcat(result, cw, MAXLNLEN); - result[n - 1] = '\0'; - if (n == wl) cat_result(result, pSMgr->suggest_morph(cw + n - 1)); - else { - char sign = cw[n]; - cw[n] = '\0'; - cat_result(result, pSMgr->suggest_morph(cw + n - 1)); - mystrcat(result, "+", MAXLNLEN); // XXX SPEC. MORPHCODE - cw[n] = sign; - cat_result(result, pSMgr->suggest_morph(cw + n)); - } - return line_tok(result, slst, MSEP_REC); - } - } - // END OF LANG_hu section - - switch(captype) { - case HUHCAP: - case HUHINITCAP: - case NOCAP: { - cat_result(result, pSMgr->suggest_morph(cw)); - if (abbv) { - memcpy(wspace,cw,wl); - *(wspace+wl) = '.'; - *(wspace+wl+1) = '\0'; - cat_result(result, pSMgr->suggest_morph(wspace)); - } - break; - } - case INITCAP: { - wl = mkallsmall2(cw, unicw, nc); - memcpy(wspace,cw,(wl+1)); - wl2 = mkinitcap2(cw, unicw, nc); - cat_result(result, pSMgr->suggest_morph(wspace)); - cat_result(result, pSMgr->suggest_morph(cw)); - if (abbv) { - *(wspace+wl) = '.'; - *(wspace+wl+1) = '\0'; - cat_result(result, pSMgr->suggest_morph(wspace)); - - memcpy(wspace, cw, wl2); - *(wspace+wl2) = '.'; - *(wspace+wl2+1) = '\0'; - - cat_result(result, pSMgr->suggest_morph(wspace)); - } - break; - } - case ALLCAP: { - cat_result(result, pSMgr->suggest_morph(cw)); - if (abbv) { - memcpy(wspace,cw,wl); - *(wspace+wl) = '.'; - *(wspace+wl+1) = '\0'; - cat_result(result, pSMgr->suggest_morph(cw)); - } - wl = mkallsmall2(cw, unicw, nc); - memcpy(wspace,cw,(wl+1)); - wl2 = mkinitcap2(cw, unicw, nc); - - cat_result(result, pSMgr->suggest_morph(wspace)); - cat_result(result, pSMgr->suggest_morph(cw)); - if (abbv) { - *(wspace+wl) = '.'; - *(wspace+wl+1) = '\0'; - cat_result(result, pSMgr->suggest_morph(wspace)); - - memcpy(wspace, cw, wl2); - *(wspace+wl2) = '.'; - *(wspace+wl2+1) = '\0'; - - cat_result(result, pSMgr->suggest_morph(wspace)); - } - break; - } - } - - if (*result) { - // word reversing wrapper for complex prefixes - if (complexprefixes) { - if (utf8) reverseword_utf(result); else reverseword(result); - } - return line_tok(result, slst, MSEP_REC); - } - - // compound word with dash (HU) I18n - char * dash = NULL; - int nresult = 0; - // LANG_hu section: set dash information for suggestions - if (langnum == LANG_hu) dash = (char *) strchr(cw,'-'); - if ((langnum == LANG_hu) && dash) { - *dash='\0'; - // examine 2 sides of the dash - if (dash[1] == '\0') { // base word ending with dash - if (spell(cw)) { - char * p = pSMgr->suggest_morph(cw); - if (p) { - int ret = line_tok(p, slst, MSEP_REC); - free(p); - return ret; - } - - } - } else if ((dash[1] == 'e') && (dash[2] == '\0')) { // XXX (HU) -e hat. - if (spell(cw) && (spell("-e"))) { - st = pSMgr->suggest_morph(cw); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - mystrcat(result,"+", MAXLNLEN); // XXX spec. separator in MORPHCODE - st = pSMgr->suggest_morph("-e"); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - return line_tok(result, slst, MSEP_REC); - } - } else { - // first word ending with dash: word- XXX ??? - char r2 = *(dash + 1); - dash[0]='-'; - dash[1]='\0'; - nresult = spell(cw); - dash[1] = r2; - dash[0]='\0'; - if (nresult && spell(dash+1) && ((strlen(dash+1) > 1) || - ((dash[1] > '0') && (dash[1] < '9')))) { - st = pSMgr->suggest_morph(cw); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - mystrcat(result,"+", MAXLNLEN); // XXX spec. separator in MORPHCODE - } - st = pSMgr->suggest_morph(dash+1); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - return line_tok(result, slst, MSEP_REC); - } - } - // affixed number in correct word - if (nresult && (dash > cw) && (((*(dash-1)<='9') && - (*(dash-1)>='0')) || (*(dash-1)=='.'))) { - *dash='-'; - n = 1; - if (*(dash - n) == '.') n++; - // search first not a number character to left from dash - while (((dash - n)>=cw) && ((*(dash - n)=='0') || (n < 3)) && (n < 6)) { - n++; - } - if ((dash - n) < cw) n--; - // numbers: valami1000000-hoz - // examine 100000-hoz, 10000-hoz 1000-hoz, 10-hoz, - // 56-hoz, 6-hoz - for(; n >= 1; n--) { - if ((*(dash - n) >= '0') && (*(dash - n) <= '9') && checkword(dash - n, NULL, NULL)) { - mystrcat(result, cw, MAXLNLEN); - result[dash - cw - n] = '\0'; - st = pSMgr->suggest_morph(dash - n); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - return line_tok(result, slst, MSEP_REC); - } - } - } - } - return 0; -} - -int Hunspell::generate(char*** slst, const char * word, char ** pl, int pln) -{ - *slst = NULL; - if (!pSMgr || !pln) return 0; - char **pl2; - int pl2n = analyze(&pl2, word); - int captype = 0; - int abbv = 0; - char cw[MAXWORDUTF8LEN]; - cleanword(cw, word, &captype, &abbv); - char result[MAXLNLEN]; - *result = '\0'; - - for (int i = 0; i < pln; i++) { - cat_result(result, pSMgr->suggest_gen(pl2, pl2n, pl[i])); - } - freelist(&pl2, pl2n); - - if (*result) { - // allcap - if (captype == ALLCAP) mkallcap(result); - - // line split - int linenum = line_tok(result, slst, MSEP_REC); - - // capitalize - if (captype == INITCAP || captype == HUHINITCAP) { - for (int j=0; j < linenum; j++) mkinitcap((*slst)[j]); - } - - // temporary filtering of prefix related errors (eg. - // generate("undrinkable", "eats") --> "undrinkables" and "*undrinks") - - int r = 0; - for (int j=0; j < linenum; j++) { - if (!spell((*slst)[j])) { - free((*slst)[j]); - (*slst)[j] = NULL; - } else { - if (r < j) (*slst)[r] = (*slst)[j]; - r++; - } - } - if (r > 0) return r; - free(*slst); - *slst = NULL; - } - return 0; -} - -int Hunspell::generate(char*** slst, const char * word, const char * pattern) -{ - char **pl; - int pln = analyze(&pl, pattern); - int n = generate(slst, word, pl, pln); - freelist(&pl, pln); - return uniqlist(*slst, n); -} - -// minimal XML parser functions -int Hunspell::get_xml_par(char * dest, const char * par, int max) -{ - char * d = dest; - if (!par) return 0; - char end = *par; - char * dmax = dest + max; - if (end == '>') end = '<'; - else if (end != '\'' && end != '"') return 0; // bad XML - for (par++; d < dmax && *par != '\0' && *par != end; par++, d++) *d = *par; - *d = '\0'; - mystrrep(dest, "<", "<"); - mystrrep(dest, "&", "&"); - return (int)(d - dest); -} - -int Hunspell::get_langnum() const -{ - return langnum; -} - -int Hunspell::input_conv(const char * word, char * dest) -{ - RepList * rl = (pAMgr) ? pAMgr->get_iconvtable() : NULL; - return (rl && rl->conv(word, dest)); -} - - -// return the beginning of the element (attr == NULL) or the attribute -const char * Hunspell::get_xml_pos(const char * s, const char * attr) -{ - const char * end = strchr(s, '>'); - const char * p = s; - if (attr == NULL) return end; - do { - p = strstr(p, attr); - if (!p || p >= end) return 0; - } while (*(p-1) != ' ' && *(p-1) != '\n'); - return p + strlen(attr); -} - -int Hunspell::check_xml_par(const char * q, const char * attr, const char * value) { - char cw[MAXWORDUTF8LEN]; - if (get_xml_par(cw, get_xml_pos(q, attr), MAXWORDUTF8LEN - 1) && - strcmp(cw, value) == 0) return 1; - return 0; -} - -int Hunspell::get_xml_list(char ***slst, char * list, const char * tag) { - int n = 0; - char * p; - if (!list) return 0; - for (p = list; ((p = strstr(p, tag)) != NULL); p++) n++; - if (n == 0) return 0; - *slst = (char **) malloc(sizeof(char *) * n); - if (!*slst) return 0; - for (p = list, n = 0; ((p = strstr(p, tag)) != NULL); p++, n++) { - int l = strlen(p); - (*slst)[n] = (char *) malloc(l + 1); - if (!(*slst)[n]) return n; - if (!get_xml_par((*slst)[n], p + strlen(tag) - 1, l)) { - free((*slst)[n]); - break; - } - } - return n; -} - -namespace -{ - void myrep(std::string& str, const std::string& search, const std::string& replace) - { - size_t pos = 0; - while ((pos = str.find(search, pos)) != std::string::npos) - { - str.replace(pos, search.length(), replace); - pos += replace.length(); - } - } -} - -int Hunspell::spellml(char*** slst, const char * word) -{ - char *q, *q2; - char cw[MAXWORDUTF8LEN], cw2[MAXWORDUTF8LEN]; - q = (char *) strstr(word, "'); - if (!q2) return 0; // bad XML input - q2 = strstr(q2, "'), MAXWORDUTF8LEN - 10)) n = analyze(slst, cw); - if (n == 0) return 0; - // convert the result to ana1ana2 format - std::string r; - r.append(""); - for (int i = 0; i < n; i++) { - r.append(""); - - std::string entry((*slst)[i]); - free((*slst)[i]); - myrep(entry, "\t", " "); - myrep(entry, "&", "&"); - myrep(entry, "<", "<"); - r.append(entry); - - r.append(""); - } - r.append(""); - (*slst)[0] = mystrdup(r.c_str()); - return 1; - } else if (check_xml_par(q, "type=", "stem")) { - if (get_xml_par(cw, strchr(q2, '>'), MAXWORDUTF8LEN - 1)) return stem(slst, cw); - } else if (check_xml_par(q, "type=", "generate")) { - int n = get_xml_par(cw, strchr(q2, '>'), MAXWORDUTF8LEN - 1); - if (n == 0) return 0; - char * q3 = strstr(q2 + 1, "'), MAXWORDUTF8LEN - 1)) { - return generate(slst, cw, cw2); - } - } else { - if ((q2 = strstr(q2 + 1, "'), "")) != 0) { - int n2 = generate(slst, cw, slst2, n); - freelist(&slst2, n); - return uniqlist(*slst, n2); - } - freelist(&slst2, n); - } - } - } - return 0; -} - - -#ifdef HUNSPELL_EXPERIMENTAL -// XXX need UTF-8 support -char * Hunspell::morph_with_correction(const char * word) -{ - char cw[MAXWORDUTF8LEN]; - char wspace[MAXWORDUTF8LEN]; - if (! pSMgr || maxdic == 0) return NULL; - int wl = strlen(word); - if (utf8) { - if (wl >= MAXWORDUTF8LEN) return NULL; - } else { - if (wl >= MAXWORDLEN) return NULL; - } - int captype = 0; - int abbv = 0; - wl = cleanword(cw, word, &captype, &abbv); - if (wl == 0) return NULL; - - char result[MAXLNLEN]; - char * st = NULL; - - *result = '\0'; - - - switch(captype) { - case NOCAP: { - st = pSMgr->suggest_morph_for_spelling_error(cw); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - if (abbv) { - memcpy(wspace,cw,wl); - *(wspace+wl) = '.'; - *(wspace+wl+1) = '\0'; - st = pSMgr->suggest_morph_for_spelling_error(wspace); - if (st) { - if (*result) mystrcat(result, "\n", MAXLNLEN); - mystrcat(result, st, MAXLNLEN); - free(st); - } - } - break; - } - case INITCAP: { - memcpy(wspace,cw,(wl+1)); - mkallsmall(wspace); - st = pSMgr->suggest_morph_for_spelling_error(wspace); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - st = pSMgr->suggest_morph_for_spelling_error(cw); - if (st) { - if (*result) mystrcat(result, "\n", MAXLNLEN); - mystrcat(result, st, MAXLNLEN); - free(st); - } - if (abbv) { - memcpy(wspace,cw,wl); - *(wspace+wl) = '.'; - *(wspace+wl+1) = '\0'; - mkallsmall(wspace); - st = pSMgr->suggest_morph_for_spelling_error(wspace); - if (st) { - if (*result) mystrcat(result, "\n", MAXLNLEN); - mystrcat(result, st, MAXLNLEN); - free(st); - } - mkinitcap(wspace); - st = pSMgr->suggest_morph_for_spelling_error(wspace); - if (st) { - if (*result) mystrcat(result, "\n", MAXLNLEN); - mystrcat(result, st, MAXLNLEN); - free(st); - } - } - break; - } - case HUHCAP: { - st = pSMgr->suggest_morph_for_spelling_error(cw); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - memcpy(wspace,cw,(wl+1)); - mkallsmall(wspace); - st = pSMgr->suggest_morph_for_spelling_error(wspace); - if (st) { - if (*result) mystrcat(result, "\n", MAXLNLEN); - mystrcat(result, st, MAXLNLEN); - free(st); - } - break; - } - case ALLCAP: { - memcpy(wspace,cw,(wl+1)); - st = pSMgr->suggest_morph_for_spelling_error(wspace); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - mkallsmall(wspace); - st = pSMgr->suggest_morph_for_spelling_error(wspace); - if (st) { - if (*result) mystrcat(result, "\n", MAXLNLEN); - mystrcat(result, st, MAXLNLEN); - free(st); - } - mkinitcap(wspace); - st = pSMgr->suggest_morph_for_spelling_error(wspace); - if (st) { - if (*result) mystrcat(result, "\n", MAXLNLEN); - mystrcat(result, st, MAXLNLEN); - free(st); - } - if (abbv) { - memcpy(wspace,cw,(wl+1)); - *(wspace+wl) = '.'; - *(wspace+wl+1) = '\0'; - if (*result) mystrcat(result, "\n", MAXLNLEN); - st = pSMgr->suggest_morph_for_spelling_error(wspace); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - mkallsmall(wspace); - st = pSMgr->suggest_morph_for_spelling_error(wspace); - if (st) { - if (*result) mystrcat(result, "\n", MAXLNLEN); - mystrcat(result, st, MAXLNLEN); - free(st); - } - mkinitcap(wspace); - st = pSMgr->suggest_morph_for_spelling_error(wspace); - if (st) { - if (*result) mystrcat(result, "\n", MAXLNLEN); - mystrcat(result, st, MAXLNLEN); - free(st); - } - } - break; - } - } - - if (*result) return mystrdup(result); - return NULL; -} - -#endif // END OF HUNSPELL_EXPERIMENTAL CODE - -Hunhandle *Hunspell_create(const char * affpath, const char * dpath) -{ - return (Hunhandle*)(new Hunspell(affpath, dpath)); -} - -Hunhandle *Hunspell_create_key(const char * affpath, const char * dpath, - const char * key) -{ - return (Hunhandle*)(new Hunspell(affpath, dpath, key)); -} - -void Hunspell_destroy(Hunhandle *pHunspell) -{ - delete (Hunspell*)(pHunspell); -} - -int Hunspell_spell(Hunhandle *pHunspell, const char *word) -{ - return ((Hunspell*)pHunspell)->spell(word); -} - -char *Hunspell_get_dic_encoding(Hunhandle *pHunspell) -{ - return ((Hunspell*)pHunspell)->get_dic_encoding(); -} - -int Hunspell_suggest(Hunhandle *pHunspell, char*** slst, const char * word) -{ - return ((Hunspell*)pHunspell)->suggest(slst, word); -} - -int Hunspell_analyze(Hunhandle *pHunspell, char*** slst, const char * word) -{ - return ((Hunspell*)pHunspell)->analyze(slst, word); -} - -int Hunspell_stem(Hunhandle *pHunspell, char*** slst, const char * word) -{ - return ((Hunspell*)pHunspell)->stem(slst, word); -} - -int Hunspell_stem2(Hunhandle *pHunspell, char*** slst, char** desc, int n) -{ - return ((Hunspell*)pHunspell)->stem(slst, desc, n); -} - -int Hunspell_generate(Hunhandle *pHunspell, char*** slst, const char * word, - const char * word2) -{ - return ((Hunspell*)pHunspell)->generate(slst, word, word2); -} - -int Hunspell_generate2(Hunhandle *pHunspell, char*** slst, const char * word, - char** desc, int n) -{ - return ((Hunspell*)pHunspell)->generate(slst, word, desc, n); -} - - /* functions for run-time modification of the dictionary */ - - /* add word to the run-time dictionary */ - -int Hunspell_add(Hunhandle *pHunspell, const char * word) { - return ((Hunspell*)pHunspell)->add(word); -} - - /* add word to the run-time dictionary with affix flags of - * the example (a dictionary word): Hunspell will recognize - * affixed forms of the new word, too. - */ - -int Hunspell_add_with_affix(Hunhandle *pHunspell, const char * word, - const char * example) { - return ((Hunspell*)pHunspell)->add_with_affix(word, example); -} - - /* remove word from the run-time dictionary */ - -int Hunspell_remove(Hunhandle *pHunspell, const char * word) { - return ((Hunspell*)pHunspell)->remove(word); -} - -void Hunspell_free_list(Hunhandle *, char *** slst, int n) { - freelist(slst, n); -} diff --git a/subprojects/hunspell/src/hunspell/hunspell.dsp b/subprojects/hunspell/src/hunspell/hunspell.dsp deleted file mode 100644 index 05e072fba..000000000 --- a/subprojects/hunspell/src/hunspell/hunspell.dsp +++ /dev/null @@ -1,164 +0,0 @@ -# Microsoft Developer Studio Project File - Name="hunspell" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=hunspell - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "hunspell.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "hunspell.mak" CFG="hunspell - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "hunspell - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "hunspell - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "hunspell - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "W32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /D "W32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x40e /d "NDEBUG" -# ADD RSC /l 0x40e /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "hunspell - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "W32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "W32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x40e /d "_DEBUG" -# ADD RSC /l 0x40e /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "hunspell - Win32 Release" -# Name "hunspell - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\affentry.cxx -# End Source File -# Begin Source File - -SOURCE=.\affixmgr.cxx -# End Source File -# Begin Source File - -SOURCE=.\csutil.cxx -# End Source File -# Begin Source File - -SOURCE=.\dictmgr.cxx -# End Source File -# Begin Source File - -SOURCE=.\hashmgr.cxx -# End Source File -# Begin Source File - -SOURCE=.\hunspell.cxx -# End Source File -# Begin Source File - -SOURCE=.\suggestmgr.cxx -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\affentry.hxx -# End Source File -# Begin Source File - -SOURCE=.\affixmgr.hxx -# End Source File -# Begin Source File - -SOURCE=.\atypes.hxx -# End Source File -# Begin Source File - -SOURCE=.\baseaffix.hxx -# End Source File -# Begin Source File - -SOURCE=.\csutil.hxx -# End Source File -# Begin Source File - -SOURCE=.\dictmgr.hxx -# End Source File -# Begin Source File - -SOURCE=.\hashmgr.hxx -# End Source File -# Begin Source File - -SOURCE=.\htypes.hxx -# End Source File -# Begin Source File - -SOURCE=.\langnum.hxx -# End Source File -# Begin Source File - -SOURCE=.\hunspell.hxx -# End Source File -# Begin Source File - -SOURCE=.\suggestmgr.hxx -# End Source File -# End Group -# End Target -# End Project diff --git a/subprojects/hunspell/src/hunspell/hunspell.h b/subprojects/hunspell/src/hunspell/hunspell.h deleted file mode 100644 index 627968a3d..000000000 --- a/subprojects/hunspell/src/hunspell/hunspell.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef _MYSPELLMGR_H_ -#define _MYSPELLMGR_H_ - -#include "hunvisapi.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct Hunhandle Hunhandle; - -LIBHUNSPELL_DLL_EXPORTED Hunhandle *Hunspell_create(const char * affpath, const char * dpath); - -LIBHUNSPELL_DLL_EXPORTED Hunhandle *Hunspell_create_key(const char * affpath, const char * dpath, - const char * key); - -LIBHUNSPELL_DLL_EXPORTED void Hunspell_destroy(Hunhandle *pHunspell); - -/* spell(word) - spellcheck word - * output: 0 = bad word, not 0 = good word - */ -LIBHUNSPELL_DLL_EXPORTED int Hunspell_spell(Hunhandle *pHunspell, const char *); - -LIBHUNSPELL_DLL_EXPORTED char *Hunspell_get_dic_encoding(Hunhandle *pHunspell); - -/* suggest(suggestions, word) - search suggestions - * input: pointer to an array of strings pointer and the (bad) word - * array of strings pointer (here *slst) may not be initialized - * output: number of suggestions in string array, and suggestions in - * a newly allocated array of strings (*slts will be NULL when number - * of suggestion equals 0.) - */ -LIBHUNSPELL_DLL_EXPORTED int Hunspell_suggest(Hunhandle *pHunspell, char*** slst, const char * word); - - /* morphological functions */ - - /* analyze(result, word) - morphological analysis of the word */ - -LIBHUNSPELL_DLL_EXPORTED int Hunspell_analyze(Hunhandle *pHunspell, char*** slst, const char * word); - - /* stem(result, word) - stemmer function */ - -LIBHUNSPELL_DLL_EXPORTED int Hunspell_stem(Hunhandle *pHunspell, char*** slst, const char * word); - - /* stem(result, analysis, n) - get stems from a morph. analysis - * example: - * char ** result, result2; - * int n1 = Hunspell_analyze(result, "words"); - * int n2 = Hunspell_stem2(result2, result, n1); - */ - -LIBHUNSPELL_DLL_EXPORTED int Hunspell_stem2(Hunhandle *pHunspell, char*** slst, char** desc, int n); - - /* generate(result, word, word2) - morphological generation by example(s) */ - -LIBHUNSPELL_DLL_EXPORTED int Hunspell_generate(Hunhandle *pHunspell, char*** slst, const char * word, - const char * word2); - - /* generate(result, word, desc, n) - generation by morph. description(s) - * example: - * char ** result; - * char * affix = "is:plural"; // description depends from dictionaries, too - * int n = Hunspell_generate2(result, "word", &affix, 1); - * for (int i = 0; i < n; i++) printf("%s\n", result[i]); - */ - -LIBHUNSPELL_DLL_EXPORTED int Hunspell_generate2(Hunhandle *pHunspell, char*** slst, const char * word, - char** desc, int n); - - /* functions for run-time modification of the dictionary */ - - /* add word to the run-time dictionary */ - -LIBHUNSPELL_DLL_EXPORTED int Hunspell_add(Hunhandle *pHunspell, const char * word); - - /* add word to the run-time dictionary with affix flags of - * the example (a dictionary word): Hunspell will recognize - * affixed forms of the new word, too. - */ - -LIBHUNSPELL_DLL_EXPORTED int Hunspell_add_with_affix(Hunhandle *pHunspell, const char * word, const char * example); - - /* remove word from the run-time dictionary */ - -LIBHUNSPELL_DLL_EXPORTED int Hunspell_remove(Hunhandle *pHunspell, const char * word); - - /* free suggestion lists */ - -LIBHUNSPELL_DLL_EXPORTED void Hunspell_free_list(Hunhandle *pHunspell, char *** slst, int n); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/subprojects/hunspell/src/hunspell/hunspell.hxx b/subprojects/hunspell/src/hunspell/hunspell.hxx deleted file mode 100644 index 1c119fd05..000000000 --- a/subprojects/hunspell/src/hunspell/hunspell.hxx +++ /dev/null @@ -1,184 +0,0 @@ -#include "hunvisapi.h" - -#include "hashmgr.hxx" -#include "affixmgr.hxx" -#include "suggestmgr.hxx" -#include "langnum.hxx" - -#define SPELL_XML "" - -#define MAXDIC 20 -#define MAXSUGGESTION 15 -#define MAXSHARPS 5 - -#define HUNSPELL_OK (1 << 0) -#define HUNSPELL_OK_WARN (1 << 1) - -#ifndef _MYSPELLMGR_HXX_ -#define _MYSPELLMGR_HXX_ - -class LIBHUNSPELL_DLL_EXPORTED Hunspell -{ -private: - Hunspell(const Hunspell&); - Hunspell& operator = (const Hunspell&); -private: - AffixMgr* pAMgr; - HashMgr* pHMgr[MAXDIC]; - int maxdic; - SuggestMgr* pSMgr; - char * affixpath; - char * encoding; - struct cs_info * csconv; - int langnum; - int utf8; - int complexprefixes; - char** wordbreak; - -public: - - /* Hunspell(aff, dic) - constructor of Hunspell class - * input: path of affix file and dictionary file - * - * In WIN32 environment, use UTF-8 encoded paths started with the long path - * prefix \\\\?\\ to handle system-independent character encoding and very - * long path names (without the long path prefix Hunspell will use fopen() - * with system-dependent character encoding instead of _wfopen()). - */ - - Hunspell(const char * affpath, const char * dpath, const char * key = NULL); - ~Hunspell(); - - /* load extra dictionaries (only dic files) */ - int add_dic(const char * dpath, const char * key = NULL); - - /* spell(word) - spellcheck word - * output: 0 = bad word, not 0 = good word - * - * plus output: - * info: information bit array, fields: - * SPELL_COMPOUND = a compound word - * SPELL_FORBIDDEN = an explicit forbidden word - * root: root (stem), when input is a word with affix(es) - */ - - int spell(const char * word, int * info = NULL, char ** root = NULL); - - /* suggest(suggestions, word) - search suggestions - * input: pointer to an array of strings pointer and the (bad) word - * array of strings pointer (here *slst) may not be initialized - * output: number of suggestions in string array, and suggestions in - * a newly allocated array of strings (*slts will be NULL when number - * of suggestion equals 0.) - */ - - int suggest(char*** slst, const char * word); - - /* deallocate suggestion lists */ - - void free_list(char *** slst, int n); - - char * get_dic_encoding(); - - /* morphological functions */ - - /* analyze(result, word) - morphological analysis of the word */ - - int analyze(char*** slst, const char * word); - - /* stem(result, word) - stemmer function */ - - int stem(char*** slst, const char * word); - - /* stem(result, analysis, n) - get stems from a morph. analysis - * example: - * char ** result, result2; - * int n1 = analyze(&result, "words"); - * int n2 = stem(&result2, result, n1); - */ - - int stem(char*** slst, char ** morph, int n); - - /* generate(result, word, word2) - morphological generation by example(s) */ - - int generate(char*** slst, const char * word, const char * word2); - - /* generate(result, word, desc, n) - generation by morph. description(s) - * example: - * char ** result; - * char * affix = "is:plural"; // description depends from dictionaries, too - * int n = generate(&result, "word", &affix, 1); - * for (int i = 0; i < n; i++) printf("%s\n", result[i]); - */ - - int generate(char*** slst, const char * word, char ** desc, int n); - - /* functions for run-time modification of the dictionary */ - - /* add word to the run-time dictionary */ - - int add(const char * word); - - /* add word to the run-time dictionary with affix flags of - * the example (a dictionary word): Hunspell will recognize - * affixed forms of the new word, too. - */ - - int add_with_affix(const char * word, const char * example); - - /* remove word from the run-time dictionary */ - - int remove(const char * word); - - /* other */ - - /* get extra word characters definied in affix file for tokenization */ - const char * get_wordchars(); - unsigned short * get_wordchars_utf16(int * len); - - struct cs_info * get_csconv(); - const char * get_version(); - - int get_langnum() const; - - /* need for putdic */ - int input_conv(const char * word, char * dest); - - /* experimental and deprecated functions */ - -#ifdef HUNSPELL_EXPERIMENTAL - /* suffix is an affix flag string, similarly in dictionary files */ - int put_word_suffix(const char * word, const char * suffix); - char * morph_with_correction(const char * word); - - /* spec. suggestions */ - int suggest_auto(char*** slst, const char * word); - int suggest_pos_stems(char*** slst, const char * word); -#endif - -private: - int cleanword(char *, const char *, int * pcaptype, int * pabbrev); - int cleanword2(char *, const char *, w_char *, int * w_len, int * pcaptype, int * pabbrev); - void mkinitcap(char *); - int mkinitcap2(char * p, w_char * u, int nc); - int mkinitsmall2(char * p, w_char * u, int nc); - void mkallcap(char *); - int mkallcap2(char * p, w_char * u, int nc); - void mkallsmall(char *); - int mkallsmall2(char * p, w_char * u, int nc); - struct hentry * checkword(const char *, int * info, char **root); - char * sharps_u8_l1(char * dest, char * source); - hentry * spellsharps(char * base, char *, int, int, char * tmp, int * info, char **root); - int is_keepcase(const hentry * rv); - int insert_sug(char ***slst, char * word, int ns); - void cat_result(char * result, char * st); - char * stem_description(const char * desc); - int spellml(char*** slst, const char * word); - int get_xml_par(char * dest, const char * par, int maxl); - const char * get_xml_pos(const char * s, const char * attr); - int get_xml_list(char ***slst, char * list, const char * tag); - int check_xml_par(const char * q, const char * attr, const char * value); - -}; - -#endif diff --git a/subprojects/hunspell/src/hunspell/hunvisapi.h b/subprojects/hunspell/src/hunspell/hunvisapi.h deleted file mode 100644 index 503c20f66..000000000 --- a/subprojects/hunspell/src/hunspell/hunvisapi.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _HUNSPELL_VISIBILITY_H_ -#define _HUNSPELL_VISIBILITY_H_ - -#if defined(HUNSPELL_STATIC) -# define LIBHUNSPELL_DLL_EXPORTED -#elif defined(_MSC_VER) -# if defined(BUILDING_LIBHUNSPELL) -# define LIBHUNSPELL_DLL_EXPORTED __declspec(dllexport) -# else -# define LIBHUNSPELL_DLL_EXPORTED __declspec(dllimport) -# endif -#elif defined(BUILDING_LIBHUNSPELL) && 1 -# define LIBHUNSPELL_DLL_EXPORTED __attribute__((__visibility__("default"))) -#else -# define LIBHUNSPELL_DLL_EXPORTED -#endif - -#endif diff --git a/subprojects/hunspell/src/hunspell/hunvisapi.h.in b/subprojects/hunspell/src/hunspell/hunvisapi.h.in deleted file mode 100644 index abf025ae9..000000000 --- a/subprojects/hunspell/src/hunspell/hunvisapi.h.in +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _HUNSPELL_VISIBILITY_H_ -#define _HUNSPELL_VISIBILITY_H_ - -#if defined(HUNSPELL_STATIC) -# define LIBHUNSPELL_DLL_EXPORTED -#elif defined(_MSC_VER) -# if defined(BUILDING_LIBHUNSPELL) -# define LIBHUNSPELL_DLL_EXPORTED __declspec(dllexport) -# else -# define LIBHUNSPELL_DLL_EXPORTED __declspec(dllimport) -# endif -#elif defined(BUILDING_LIBHUNSPELL) && @HAVE_VISIBILITY@ -# define LIBHUNSPELL_DLL_EXPORTED __attribute__((__visibility__("default"))) -#else -# define LIBHUNSPELL_DLL_EXPORTED -#endif - -#endif diff --git a/subprojects/hunspell/src/hunspell/hunzip.cxx b/subprojects/hunspell/src/hunspell/hunzip.cxx deleted file mode 100644 index db5a881af..000000000 --- a/subprojects/hunspell/src/hunspell/hunzip.cxx +++ /dev/null @@ -1,196 +0,0 @@ -#include -#include -#include - -#include "hunzip.hxx" -#include "csutil.hxx" - -#define CODELEN 65536 -#define BASEBITREC 5000 - -#define UNCOMPRESSED '\002' -#define MAGIC "hz0" -#define MAGIC_ENCRYPT "hz1" -#define MAGICLEN (sizeof(MAGIC) - 1) - -int Hunzip::fail(const char * err, const char * par) { - fprintf(stderr, err, par); - return -1; -} - -Hunzip::Hunzip(const char * file, const char * key) - : fin(NULL) - , bufsiz(0) - , lastbit(0) - , inc(0) - , inbits(0) - , outc(0) - , dec(NULL) -{ - in[0] = out[0] = line[0] = '\0'; - filename = mystrdup(file); - if (getcode(key) == -1) bufsiz = -1; - else bufsiz = getbuf(); -} - -int Hunzip::getcode(const char * key) { - unsigned char c[2]; - int i, j, n, p; - int allocatedbit = BASEBITREC; - const char * enc = key; - - if (!filename) return -1; - - fin = myfopen(filename, "rb"); - if (!fin) return -1; - - // read magic number - if ((fread(in, 1, 3, fin) < MAGICLEN) - || !(strncmp(MAGIC, in, MAGICLEN) == 0 || - strncmp(MAGIC_ENCRYPT, in, MAGICLEN) == 0)) { - return fail(MSG_FORMAT, filename); - } - - // check encryption - if (strncmp(MAGIC_ENCRYPT, in, MAGICLEN) == 0) { - unsigned char cs; - if (!key) return fail(MSG_KEY, filename); - if (fread(&c, 1, 1, fin) < 1) return fail(MSG_FORMAT, filename); - for (cs = 0; *enc; enc++) cs ^= *enc; - if (cs != c[0]) return fail(MSG_KEY, filename); - enc = key; - } else key = NULL; - - // read record count - if (fread(&c, 1, 2, fin) < 2) return fail(MSG_FORMAT, filename); - - if (key) { - c[0] ^= *enc; - if (*(++enc) == '\0') enc = key; - c[1] ^= *enc; - } - - n = ((int) c[0] << 8) + c[1]; - dec = (struct bit *) malloc(BASEBITREC * sizeof(struct bit)); - if (!dec) return fail(MSG_MEMORY, filename); - dec[0].v[0] = 0; - dec[0].v[1] = 0; - - // read codes - for (i = 0; i < n; i++) { - unsigned char l; - if (fread(c, 1, 2, fin) < 2) return fail(MSG_FORMAT, filename); - if (key) { - if (*(++enc) == '\0') enc = key; - c[0] ^= *enc; - if (*(++enc) == '\0') enc = key; - c[1] ^= *enc; - } - if (fread(&l, 1, 1, fin) < 1) return fail(MSG_FORMAT, filename); - if (key) { - if (*(++enc) == '\0') enc = key; - l ^= *enc; - } - if (fread(in, 1, l/8+1, fin) < (size_t) l/8+1) return fail(MSG_FORMAT, filename); - if (key) for (j = 0; j <= l/8; j++) { - if (*(++enc) == '\0') enc = key; - in[j] ^= *enc; - } - p = 0; - for (j = 0; j < l; j++) { - int b = (in[j/8] & (1 << (7 - (j % 8)))) ? 1 : 0; - int oldp = p; - p = dec[p].v[b]; - if (p == 0) { - lastbit++; - if (lastbit == allocatedbit) { - allocatedbit += BASEBITREC; - dec = (struct bit *) realloc(dec, allocatedbit * sizeof(struct bit)); - } - dec[lastbit].v[0] = 0; - dec[lastbit].v[1] = 0; - dec[oldp].v[b] = lastbit; - p = lastbit; - } - } - dec[p].c[0] = c[0]; - dec[p].c[1] = c[1]; - } - return 0; -} - -Hunzip::~Hunzip() -{ - if (dec) free(dec); - if (fin) fclose(fin); - if (filename) free(filename); -} - -int Hunzip::getbuf() { - int p = 0; - int o = 0; - do { - if (inc == 0) inbits = fread(in, 1, BUFSIZE, fin) * 8; - for (; inc < inbits; inc++) { - int b = (in[inc / 8] & (1 << (7 - (inc % 8)))) ? 1 : 0; - int oldp = p; - p = dec[p].v[b]; - if (p == 0) { - if (oldp == lastbit) { - fclose(fin); - fin = NULL; - // add last odd byte - if (dec[lastbit].c[0]) out[o++] = dec[lastbit].c[1]; - return o; - } - out[o++] = dec[oldp].c[0]; - out[o++] = dec[oldp].c[1]; - if (o == BUFSIZE) return o; - p = dec[p].v[b]; - } - } - inc = 0; - } while (inbits == BUFSIZE * 8); - return fail(MSG_FORMAT, filename); -} - -const char * Hunzip::getline() { - char linebuf[BUFSIZE]; - int l = 0, eol = 0, left = 0, right = 0; - if (bufsiz == -1) return NULL; - while (l < bufsiz && !eol) { - linebuf[l++] = out[outc]; - switch (out[outc]) { - case '\t': break; - case 31: { // escape - if (++outc == bufsiz) { - bufsiz = getbuf(); - outc = 0; - } - linebuf[l - 1] = out[outc]; - break; - } - case ' ': break; - default: if (((unsigned char) out[outc]) < 47) { - if (out[outc] > 32) { - right = out[outc] - 31; - if (++outc == bufsiz) { - bufsiz = getbuf(); - outc = 0; - } - } - if (out[outc] == 30) left = 9; else left = out[outc]; - linebuf[l-1] = '\n'; - eol = 1; - } - } - if (++outc == bufsiz) { - outc = 0; - bufsiz = fin ? getbuf(): -1; - } - } - if (right) strcpy(linebuf + l - 1, line + strlen(line) - right - 1); - else linebuf[l] = '\0'; - strcpy(line + left, linebuf); - return line; -} diff --git a/subprojects/hunspell/src/hunspell/hunzip.hxx b/subprojects/hunspell/src/hunspell/hunzip.hxx deleted file mode 100644 index bd02fd8f1..000000000 --- a/subprojects/hunspell/src/hunspell/hunzip.hxx +++ /dev/null @@ -1,47 +0,0 @@ -/* hunzip: file decompression for sorted dictionaries with optional encryption, - * algorithm: prefix-suffix encoding and 16-bit Huffman encoding */ - -#ifndef _HUNZIP_HXX_ -#define _HUNZIP_HXX_ - -#include "hunvisapi.h" - -#include - -#define BUFSIZE 65536 -#define HZIP_EXTENSION ".hz" - -#define MSG_OPEN "error: %s: cannot open\n" -#define MSG_FORMAT "error: %s: not in hzip format\n" -#define MSG_MEMORY "error: %s: missing memory\n" -#define MSG_KEY "error: %s: missing or bad password\n" - -struct bit { - unsigned char c[2]; - int v[2]; -}; - -class LIBHUNSPELL_DLL_EXPORTED Hunzip -{ -private: - Hunzip(const Hunzip&); - Hunzip& operator = (const Hunzip&); -protected: - char * filename; - FILE * fin; - int bufsiz, lastbit, inc, inbits, outc; - struct bit * dec; // code table - char in[BUFSIZE]; // input buffer - char out[BUFSIZE + 1]; // Huffman-decoded buffer - char line[BUFSIZE + 50]; // decoded line - int getcode(const char * key); - int getbuf(); - int fail(const char * err, const char * par); - -public: - Hunzip(const char * filename, const char * key = NULL); - ~Hunzip(); - const char * getline(); -}; - -#endif diff --git a/subprojects/hunspell/src/hunspell/langnum.hxx b/subprojects/hunspell/src/hunspell/langnum.hxx deleted file mode 100644 index 1d140a701..000000000 --- a/subprojects/hunspell/src/hunspell/langnum.hxx +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _LANGNUM_HXX_ -#define _LANGNUM_HXX_ - -/* - language numbers for language specific codes - see http://l10n.openoffice.org/languages.html -*/ - -enum { -LANG_ar=96, -LANG_az=100, // custom number -LANG_bg=41, -LANG_ca=37, -LANG_cs=42, -LANG_da=45, -LANG_de=49, -LANG_el=30, -LANG_en=01, -LANG_es=34, -LANG_eu=10, -LANG_fr=02, -LANG_gl=38, -LANG_hr=78, -LANG_hu=36, -LANG_it=39, -LANG_la=99, // custom number -LANG_lv=101, // custom number -LANG_nl=31, -LANG_pl=48, -LANG_pt=03, -LANG_ru=07, -LANG_sv=50, -LANG_tr=90, -LANG_uk=80, -LANG_xx=999 -}; - -#endif diff --git a/subprojects/hunspell/src/hunspell/license.hunspell b/subprojects/hunspell/src/hunspell/license.hunspell deleted file mode 100644 index 490e440c7..000000000 --- a/subprojects/hunspell/src/hunspell/license.hunspell +++ /dev/null @@ -1,59 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Hunspell, based on MySpell. - * - * The Initial Developers of the Original Code are - * Kevin Hendricks (MySpell) and Laszlo Nemeth (Hunspell). - * Portions created by the Initial Developers are Copyright (C) 2002-2005 - * the Initial Developers. All Rights Reserved. - * - * Contributor(s): - * David Einstein - * Davide Prina - * Giuseppe Modugno - * Gianluca Turconi - * Simon Brouwer - * Noll Janos - * Biro Arpad - * Goldman Eleonora - * Sarlos Tamas - * Bencsath Boldizsar - * Halacsy Peter - * Dvornik Laszlo - * Gefferth Andras - * Nagy Viktor - * Varga Daniel - * Chris Halls - * Rene Engelhard - * Bram Moolenaar - * Dafydd Jones - * Harri Pitkanen - * Andras Timar - * Tor Lillqvist - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "config.h" diff --git a/subprojects/hunspell/src/hunspell/license.myspell b/subprojects/hunspell/src/hunspell/license.myspell deleted file mode 100644 index 2da533075..000000000 --- a/subprojects/hunspell/src/hunspell/license.myspell +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2002 Kevin B. Hendricks, Stratford, Ontario, Canada - * And Contributors. 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. All modifications to the source code must be clearly marked as - * such. Binary redistributions based on modified source code - * must be clearly marked as modified versions in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY KEVIN B. HENDRICKS 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 - * KEVIN B. HENDRICKS 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. - * - * - * NOTE: A special thanks and credit goes to Geoff Kuenning - * the creator of ispell. MySpell's affix algorithms were - * based on those of ispell which should be noted is - * copyright Geoff Kuenning et.al. and now available - * under a BSD style license. For more information on ispell - * and affix compression in general, please see: - * http://www.cs.ucla.edu/ficus-members/geoff/ispell.html - * (the home page for ispell) - * - * An almost complete rewrite of MySpell for use by - * the Mozilla project has been developed by David Einstein - * (Deinst@world.std.com). David and I are now - * working on parallel development tracks to help - * our respective projects (Mozilla and OpenOffice.org - * and we will maintain full affix file and dictionary - * file compatibility and work on merging our versions - * of MySpell back into a single tree. David has been - * a significant help in improving MySpell. - * - * Special thanks also go to La'szlo' Ne'meth - * who is the author of the - * Hungarian dictionary and who developed and contributed - * the code to support compound words in MySpell - * and fixed numerous problems with the encoding - * case conversion tables. - * - */ diff --git a/subprojects/hunspell/src/hunspell/makefile.mk b/subprojects/hunspell/src/hunspell/makefile.mk deleted file mode 100644 index ca8ce42a1..000000000 --- a/subprojects/hunspell/src/hunspell/makefile.mk +++ /dev/null @@ -1,65 +0,0 @@ -#************************************************************************* -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -#************************************************************************* - -PRJ = ../../../../../.. - -PRJNAME = hunspell -TARGET = hunspell -LIBTARGET=YES -EXTERNAL_WARNINGS_NOT_ERRORS := TRUE -UWINAPILIB= - -#----- Settings --------------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- - -CFLAGS+=-I..$/..$/ -CDEFS+=-DOPENOFFICEORG - -SLOFILES= \ - $(SLO)$/affentry.obj \ - $(SLO)$/affixmgr.obj \ - $(SLO)$/dictmgr.obj \ - $(SLO)$/csutil.obj \ - $(SLO)$/hashmgr.obj \ - $(SLO)$/suggestmgr.obj \ - $(SLO)$/phonet.obj \ - $(SLO)$/hunzip.obj \ - $(SLO)$/filemgr.obj \ - $(SLO)$/replist.obj \ - $(SLO)$/hunspell.obj - -LIB1TARGET= $(SLB)$/lib$(TARGET).lib -LIB1ARCHIV= $(LB)/lib$(TARGET).a -LIB1OBJFILES= $(SLOFILES) - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - diff --git a/subprojects/hunspell/src/hunspell/phonet.cxx b/subprojects/hunspell/src/hunspell/phonet.cxx deleted file mode 100644 index b33edeb02..000000000 --- a/subprojects/hunspell/src/hunspell/phonet.cxx +++ /dev/null @@ -1,293 +0,0 @@ -/* phonetic.c - generic replacement aglogithms for phonetic transformation - Copyright (C) 2000 Bjoern Jacke - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License version 2.1 as published by the Free Software Foundation; - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; If not, see - . - - Changelog: - - 2000-01-05 Bjoern Jacke - Initial Release insprired by the article about phonetic - transformations out of c't 25/1999 - - 2007-07-26 Bjoern Jacke - Released under MPL/GPL/LGPL tri-license for Hunspell - - 2007-08-23 Laszlo Nemeth - Porting from Aspell to Hunspell using C-like structs -*/ - -#include -#include -#include -#include - -#include "csutil.hxx" -#include "phonet.hxx" - -void init_phonet_hash(phonetable & parms) - { - int i, k; - - for (i = 0; i < HASHSIZE; i++) { - parms.hash[i] = -1; - } - - for (i = 0; parms.rules[i][0] != '\0'; i += 2) { - /** set hash value **/ - k = (unsigned char) parms.rules[i][0]; - - if (parms.hash[k] < 0) { - parms.hash[k] = i; - } - } - } - -// like strcpy but safe if the strings overlap -// but only if dest < src -static inline void strmove(char * dest, char * src) { - while (*src) - *dest++ = *src++; - *dest = '\0'; -} - -static int myisalpha(char ch) { - if ((unsigned char) ch < 128) return isalpha(ch); - return 1; -} - -/* phonetic transcription algorithm */ -/* see: http://aspell.net/man-html/Phonetic-Code.html */ -/* convert string to uppercase before this call */ -int phonet (const char * inword, char * target, - int len, - phonetable & parms) - { - /** Do phonetic transformation. **/ - /** "len" = length of "inword" incl. '\0'. **/ - - /** result: >= 0: length of "target" **/ - /** otherwise: error **/ - - int i,j,k=0,n,p,z; - int k0,n0,p0=-333,z0; - char c, c0; - const char * s; - typedef unsigned char uchar; - char word[MAXPHONETUTF8LEN + 1]; - if (len == -1) len = strlen(inword); - if (len > MAXPHONETUTF8LEN) return 0; - strncpy(word, inword, MAXPHONETUTF8LEN); - word[MAXPHONETUTF8LEN] = '\0'; - - /** check word **/ - i = j = z = 0; - while ((c = word[i]) != '\0') { - n = parms.hash[(uchar) c]; - z0 = 0; - - if (n >= 0) { - /** check all rules for the same letter **/ - while (parms.rules[n][0] == c) { - - /** check whole string **/ - k = 1; /** number of found letters **/ - p = 5; /** default priority **/ - s = parms.rules[n]; - s++; /** important for (see below) "*(s-1)" **/ - - while (*s != '\0' && word[i+k] == *s - && !isdigit ((unsigned char) *s) && strchr ("(-<^$", *s) == NULL) { - k++; - s++; - } - if (*s == '(') { - /** check letters in "(..)" **/ - if (myisalpha(word[i+k]) // ...could be implied? - && strchr(s+1, word[i+k]) != NULL) { - k++; - while (*s != ')') - s++; - s++; - } - } - p0 = (int) *s; - k0 = k; - while (*s == '-' && k > 1) { - k--; - s++; - } - if (*s == '<') - s++; - if (isdigit ((unsigned char) *s)) { - /** determine priority **/ - p = *s - '0'; - s++; - } - if (*s == '^' && *(s+1) == '^') - s++; - - if (*s == '\0' - || (*s == '^' - && (i == 0 || ! myisalpha(word[i-1])) - && (*(s+1) != '$' - || (! myisalpha(word[i+k0]) ))) - || (*s == '$' && i > 0 - && myisalpha(word[i-1]) - && (! myisalpha(word[i+k0]) ))) - { - /** search for followup rules, if: **/ - /** parms.followup and k > 1 and NO '-' in searchstring **/ - c0 = word[i+k-1]; - n0 = parms.hash[(uchar) c0]; - -// if (parms.followup && k > 1 && n0 >= 0 - if (k > 1 && n0 >= 0 - && p0 != (int) '-' && word[i+k] != '\0') { - /** test follow-up rule for "word[i+k]" **/ - while (parms.rules[n0][0] == c0) { - - /** check whole string **/ - k0 = k; - p0 = 5; - s = parms.rules[n0]; - s++; - while (*s != '\0' && word[i+k0] == *s - && ! isdigit((unsigned char) *s) && strchr("(-<^$",*s) == NULL) { - k0++; - s++; - } - if (*s == '(') { - /** check letters **/ - if (myisalpha(word[i+k0]) - && strchr (s+1, word[i+k0]) != NULL) { - k0++; - while (*s != ')' && *s != '\0') - s++; - if (*s == ')') - s++; - } - } - while (*s == '-') { - /** "k0" gets NOT reduced **/ - /** because "if (k0 == k)" **/ - s++; - } - if (*s == '<') - s++; - if (isdigit ((unsigned char) *s)) { - p0 = *s - '0'; - s++; - } - - if (*s == '\0' - /** *s == '^' cuts **/ - || (*s == '$' && ! myisalpha(word[i+k0]))) - { - if (k0 == k) { - /** this is just a piece of the string **/ - n0 += 2; - continue; - } - - if (p0 < p) { - /** priority too low **/ - n0 += 2; - continue; - } - /** rule fits; stop search **/ - break; - } - n0 += 2; - } /** End of "while (parms.rules[n0][0] == c0)" **/ - - if (p0 >= p && parms.rules[n0][0] == c0) { - n += 2; - continue; - } - } /** end of follow-up stuff **/ - - /** replace string **/ - s = parms.rules[n+1]; - p0 = (parms.rules[n][0] != '\0' - && strchr (parms.rules[n]+1,'<') != NULL) ? 1:0; - if (p0 == 1 && z == 0) { - /** rule with '<' is used **/ - if (j > 0 && *s != '\0' - && (target[j-1] == c || target[j-1] == *s)) { - j--; - } - z0 = 1; - z = 1; - k0 = 0; - while (*s != '\0' && word[i+k0] != '\0') { - word[i+k0] = *s; - k0++; - s++; - } - if (k > k0) - strmove (&word[0]+i+k0, &word[0]+i+k); - - /** new "actual letter" **/ - c = word[i]; - } - else { /** no '<' rule used **/ - i += k - 1; - z = 0; - while (*s != '\0' - && *(s+1) != '\0' && j < len) { - if (j == 0 || target[j-1] != *s) { - target[j] = *s; - j++; - } - s++; - } - /** new "actual letter" **/ - c = *s; - if (parms.rules[n][0] != '\0' - && strstr (parms.rules[n]+1, "^^") != NULL) { - if (c != '\0') { - target[j] = c; - j++; - } - strmove (&word[0], &word[0]+i+1); - i = 0; - z0 = 1; - } - } - break; - } /** end of follow-up stuff **/ - n += 2; - } /** end of while (parms.rules[n][0] == c) **/ - } /** end of if (n >= 0) **/ - if (z0 == 0) { -// if (k && (assert(p0!=-333),!p0) && j < len && c != '\0' -// && (!parms.collapse_result || j == 0 || target[j-1] != c)){ - if (k && !p0 && j < len && c != '\0' - && (1 || j == 0 || target[j-1] != c)){ - /** condense only double letters **/ - target[j] = c; - ///printf("\n setting \n"); - j++; - } - - i++; - z = 0; - k=0; - } - } /** end of while ((c = word[i]) != '\0') **/ - - target[j] = '\0'; - return (j); - - } /** end of function "phonet" **/ diff --git a/subprojects/hunspell/src/hunspell/phonet.hxx b/subprojects/hunspell/src/hunspell/phonet.hxx deleted file mode 100644 index f91d3b02b..000000000 --- a/subprojects/hunspell/src/hunspell/phonet.hxx +++ /dev/null @@ -1,52 +0,0 @@ -/* phonetic.c - generic replacement aglogithms for phonetic transformation - Copyright (C) 2000 Bjoern Jacke - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License version 2.1 as published by the Free Software Foundation; - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; If not, see - . - - Changelog: - - 2000-01-05 Bjoern Jacke - Initial Release insprired by the article about phonetic - transformations out of c't 25/1999 - - 2007-07-26 Bjoern Jacke - Released under MPL/GPL/LGPL tri-license for Hunspell - - 2007-08-23 Laszlo Nemeth - Porting from Aspell to Hunspell using C-like structs -*/ - -#ifndef __PHONETHXX__ -#define __PHONETHXX__ - -#define HASHSIZE 256 -#define MAXPHONETLEN 256 -#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4) - -#include "hunvisapi.h" - -struct phonetable { - char utf8; - cs_info * lang; - int num; - char * * rules; - int hash[HASHSIZE]; -}; - -LIBHUNSPELL_DLL_EXPORTED void init_phonet_hash(phonetable & parms); - -LIBHUNSPELL_DLL_EXPORTED int phonet (const char * inword, char * target, - int len, phonetable & phone); - -#endif diff --git a/subprojects/hunspell/src/hunspell/replist.cxx b/subprojects/hunspell/src/hunspell/replist.cxx deleted file mode 100644 index 080cd68ab..000000000 --- a/subprojects/hunspell/src/hunspell/replist.cxx +++ /dev/null @@ -1,87 +0,0 @@ -#include "license.hunspell" -#include "license.myspell" - -#include -#include -#include - -#include "replist.hxx" -#include "csutil.hxx" - -RepList::RepList(int n) { - dat = (replentry **) malloc(sizeof(replentry *) * n); - if (dat == 0) size = 0; else size = n; - pos = 0; -} - -RepList::~RepList() -{ - for (int i = 0; i < pos; i++) { - free(dat[i]->pattern); - free(dat[i]->pattern2); - free(dat[i]); - } - free(dat); -} - -int RepList::get_pos() { - return pos; -} - -replentry * RepList::item(int n) { - return dat[n]; -} - -int RepList::near(const char * word) { - int p1 = 0; - int p2 = pos; - while ((p2 - p1) > 1) { - int m = (p1 + p2) / 2; - int c = strcmp(word, dat[m]->pattern); - if (c <= 0) { - if (c < 0) p2 = m; else p1 = p2 = m; - } else p1 = m; - } - return p1; -} - -int RepList::match(const char * word, int n) { - if (strncmp(word, dat[n]->pattern, strlen(dat[n]->pattern)) == 0) return strlen(dat[n]->pattern); - return 0; -} - -int RepList::add(char * pat1, char * pat2) { - if (pos >= size || pat1 == NULL || pat2 == NULL) return 1; - replentry * r = (replentry *) malloc(sizeof(replentry)); - if (r == NULL) return 1; - r->pattern = mystrrep(pat1, "_", " "); - r->pattern2 = mystrrep(pat2, "_", " "); - r->start = false; - r->end = false; - dat[pos++] = r; - for (int i = pos - 1; i > 0; i--) { - r = dat[i]; - if (strcmp(r->pattern, dat[i - 1]->pattern) < 0) { - dat[i] = dat[i - 1]; - dat[i - 1] = r; - } else break; - } - return 0; -} - -int RepList::conv(const char * word, char * dest) { - int stl = 0; - int change = 0; - for (size_t i = 0; i < strlen(word); i++) { - int n = near(word + i); - int l = match(word + i, n); - if (l) { - strcpy(dest + stl, dat[n]->pattern2); - stl += strlen(dat[n]->pattern2); - i += l - 1; - change = 1; - } else dest[stl++] = word[i]; - } - dest[stl] = '\0'; - return change; -} diff --git a/subprojects/hunspell/src/hunspell/replist.hxx b/subprojects/hunspell/src/hunspell/replist.hxx deleted file mode 100644 index 2dbc0160b..000000000 --- a/subprojects/hunspell/src/hunspell/replist.hxx +++ /dev/null @@ -1,30 +0,0 @@ -/* string replacement list class */ -#ifndef _REPLIST_HXX_ -#define _REPLIST_HXX_ - -#include "hunvisapi.h" - -#include "w_char.hxx" - -class LIBHUNSPELL_DLL_EXPORTED RepList -{ -private: - RepList(const RepList&); - RepList& operator = (const RepList&); -protected: - replentry ** dat; - int size; - int pos; - -public: - RepList(int n); - ~RepList(); - - int get_pos(); - int add(char * pat1, char * pat2); - replentry * item(int n); - int near(const char * word); - int match(const char * word, int n); - int conv(const char * word, char * dest); -}; -#endif diff --git a/subprojects/hunspell/src/hunspell/suggestmgr.cxx b/subprojects/hunspell/src/hunspell/suggestmgr.cxx deleted file mode 100644 index f0e336c97..000000000 --- a/subprojects/hunspell/src/hunspell/suggestmgr.cxx +++ /dev/null @@ -1,2029 +0,0 @@ -#include "license.hunspell" -#include "license.myspell" - -#include -#include -#include -#include - -#include "suggestmgr.hxx" -#include "htypes.hxx" -#include "csutil.hxx" - -const w_char W_VLINE = { '\0', '|' }; - -SuggestMgr::SuggestMgr(const char * tryme, int maxn, - AffixMgr * aptr) -{ - - // register affix manager and check in string of chars to - // try when building candidate suggestions - pAMgr = aptr; - - csconv = NULL; - - ckeyl = 0; - ckey = NULL; - ckey_utf = NULL; - - ctryl = 0; - ctry = NULL; - ctry_utf = NULL; - - utf8 = 0; - langnum = 0; - complexprefixes = 0; - - maxSug = maxn; - nosplitsugs = 0; - maxngramsugs = MAXNGRAMSUGS; - maxcpdsugs = MAXCOMPOUNDSUGS; - - if (pAMgr) { - langnum = pAMgr->get_langnum(); - ckey = pAMgr->get_key_string(); - nosplitsugs = pAMgr->get_nosplitsugs(); - if (pAMgr->get_maxngramsugs() >= 0) - maxngramsugs = pAMgr->get_maxngramsugs(); - utf8 = pAMgr->get_utf8(); - if (pAMgr->get_maxcpdsugs() >= 0) - maxcpdsugs = pAMgr->get_maxcpdsugs(); - if (!utf8) - { - char * enc = pAMgr->get_encoding(); - csconv = get_current_cs(enc); - free(enc); - } - complexprefixes = pAMgr->get_complexprefixes(); - } - - if (ckey) { - if (utf8) { - w_char t[MAXSWL]; - ckeyl = u8_u16(t, MAXSWL, ckey); - ckey_utf = (w_char *) malloc(ckeyl * sizeof(w_char)); - if (ckey_utf) memcpy(ckey_utf, t, ckeyl * sizeof(w_char)); - else ckeyl = 0; - } else { - ckeyl = strlen(ckey); - } - } - - if (tryme) { - ctry = mystrdup(tryme); - if (ctry) ctryl = strlen(ctry); - if (ctry && utf8) { - w_char t[MAXSWL]; - ctryl = u8_u16(t, MAXSWL, tryme); - ctry_utf = (w_char *) malloc(ctryl * sizeof(w_char)); - if (ctry_utf) memcpy(ctry_utf, t, ctryl * sizeof(w_char)); - else ctryl = 0; - } - } -} - - -SuggestMgr::~SuggestMgr() -{ - pAMgr = NULL; - if (ckey) free(ckey); - ckey = NULL; - if (ckey_utf) free(ckey_utf); - ckey_utf = NULL; - ckeyl = 0; - if (ctry) free(ctry); - ctry = NULL; - if (ctry_utf) free(ctry_utf); - ctry_utf = NULL; - ctryl = 0; - maxSug = 0; -#ifdef MOZILLA_CLIENT - delete [] csconv; -#endif -} - -int SuggestMgr::testsug(char** wlst, const char * candidate, int wl, int ns, int cpdsuggest, - int * timer, clock_t * timelimit) { - int cwrd = 1; - if (ns == maxSug) return maxSug; - for (int k=0; k < ns; k++) { - if (strcmp(candidate,wlst[k]) == 0) { - cwrd = 0; - break; - } - } - if ((cwrd) && checkword(candidate, wl, cpdsuggest, timer, timelimit)) { - wlst[ns] = mystrdup(candidate); - if (wlst[ns] == NULL) { - for (int j=0; j 0) oldSug = nsug; - - // suggestions for an uppercase word (html -> HTML) - if ((nsug < maxSug) && (nsug > -1)) { - nsug = (utf8) ? capchars_utf(wlst, word_utf, wl, nsug, cpdsuggest) : - capchars(wlst, word, nsug, cpdsuggest); - } - - // perhaps we made a typical fault of spelling - if ((nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs))) { - nsug = replchars(wlst, word, nsug, cpdsuggest); - } - - // perhaps we made chose the wrong char from a related set - if ((nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs))) { - nsug = mapchars(wlst, word, nsug, cpdsuggest); - } - - // only suggest compound words when no other suggestion - if ((cpdsuggest == 0) && (nsug > nsugorig)) nocompoundtwowords=1; - - // did we swap the order of chars by mistake - if ((nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs))) { - nsug = (utf8) ? swapchar_utf(wlst, word_utf, wl, nsug, cpdsuggest) : - swapchar(wlst, word, nsug, cpdsuggest); - } - - // did we swap the order of non adjacent chars by mistake - if ((nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs))) { - nsug = (utf8) ? longswapchar_utf(wlst, word_utf, wl, nsug, cpdsuggest) : - longswapchar(wlst, word, nsug, cpdsuggest); - } - - // did we just hit the wrong key in place of a good char (case and keyboard) - if ((nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs))) { - nsug = (utf8) ? badcharkey_utf(wlst, word_utf, wl, nsug, cpdsuggest) : - badcharkey(wlst, word, nsug, cpdsuggest); - } - - // did we add a char that should not be there - if ((nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs))) { - nsug = (utf8) ? extrachar_utf(wlst, word_utf, wl, nsug, cpdsuggest) : - extrachar(wlst, word, nsug, cpdsuggest); - } - - - // did we forgot a char - if ((nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs))) { - nsug = (utf8) ? forgotchar_utf(wlst, word_utf, wl, nsug, cpdsuggest) : - forgotchar(wlst, word, nsug, cpdsuggest); - } - - // did we move a char - if ((nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs))) { - nsug = (utf8) ? movechar_utf(wlst, word_utf, wl, nsug, cpdsuggest) : - movechar(wlst, word, nsug, cpdsuggest); - } - - // did we just hit the wrong key in place of a good char - if ((nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs))) { - nsug = (utf8) ? badchar_utf(wlst, word_utf, wl, nsug, cpdsuggest) : - badchar(wlst, word, nsug, cpdsuggest); - } - - // did we double two characters - if ((nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs))) { - nsug = (utf8) ? doubletwochars_utf(wlst, word_utf, wl, nsug, cpdsuggest) : - doubletwochars(wlst, word, nsug, cpdsuggest); - } - - // perhaps we forgot to hit space and two words ran together - if (!nosplitsugs && (nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs))) { - nsug = twowords(wlst, word, nsug, cpdsuggest); - } - - } // repeating ``for'' statement compounding support - - if (nsug < 0) { - // we ran out of memory - we should free up as much as possible - for (int i = 0; i < maxSug; i++) - if (wlst[i] != NULL) free(wlst[i]); - free(wlst); - wlst = NULL; - } - - if (!nocompoundtwowords && (nsug > 0) && onlycompoundsug) *onlycompoundsug = 1; - - *slst = wlst; - return nsug; -} - -// generate suggestions for a word with typical mistake -// pass in address of array of char * pointers -#ifdef HUNSPELL_EXPERIMENTAL -int SuggestMgr::suggest_auto(char*** slst, const char * w, int nsug) -{ - int nocompoundtwowords = 0; - char ** wlst; - int oldSug; - - char w2[MAXWORDUTF8LEN]; - const char * word = w; - - // word reversing wrapper for complex prefixes - if (complexprefixes) { - strcpy(w2, w); - if (utf8) reverseword_utf(w2); else reverseword(w2); - word = w2; - } - - if (*slst) { - wlst = *slst; - } else { - wlst = (char **) malloc(maxSug * sizeof(char *)); - if (wlst == NULL) return -1; - } - - for (int cpdsuggest=0; (cpdsuggest<2) && (nocompoundtwowords==0); cpdsuggest++) { - - // limit compound suggestion - if (cpdsuggest > 0) oldSug = nsug; - - // perhaps we made a typical fault of spelling - if ((nsug < maxSug) && (nsug > -1)) - nsug = replchars(wlst, word, nsug, cpdsuggest); - - // perhaps we made chose the wrong char from a related set - if ((nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs))) - nsug = mapchars(wlst, word, nsug, cpdsuggest); - - if ((cpdsuggest==0) && (nsug>0)) nocompoundtwowords=1; - - // perhaps we forgot to hit space and two words ran together - - if ((nsug < maxSug) && (nsug > -1) && (!cpdsuggest || (nsug < oldSug + maxcpdsugs)) && check_forbidden(word, strlen(word))) { - nsug = twowords(wlst, word, nsug, cpdsuggest); - } - - } // repeating ``for'' statement compounding support - - if (nsug < 0) { - for (int i=0;i HTML) -int SuggestMgr::capchars_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) -{ - char candidate[MAXSWUTF8L]; - w_char candidate_utf[MAXSWL]; - memcpy(candidate_utf, word, wl * sizeof(w_char)); - mkallcap_utf(candidate_utf, wl, langnum); - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); - return testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); -} - -// suggestions for an uppercase word (html -> HTML) -int SuggestMgr::capchars(char** wlst, const char * word, int ns, int cpdsuggest) -{ - char candidate[MAXSWUTF8L]; - strcpy(candidate, word); - mkallcap(candidate, csconv); - return testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); -} - -// suggestions for when chose the wrong char out of a related set -int SuggestMgr::mapchars(char** wlst, const char * word, int ns, int cpdsuggest) -{ - char candidate[MAXSWUTF8L]; - clock_t timelimit; - int timer; - candidate[0] = '\0'; - - int wl = strlen(word); - if (wl < 2 || ! pAMgr) return ns; - - int nummap = pAMgr->get_nummap(); - struct mapentry* maptable = pAMgr->get_maptable(); - if (maptable==NULL) return ns; - - timelimit = clock(); - timer = MINTIMER; - return map_related(word, (char *) &candidate, 0, 0, wlst, cpdsuggest, ns, maptable, nummap, &timer, &timelimit); -} - -int SuggestMgr::map_related(const char * word, char * candidate, int wn, int cn, - char** wlst, int cpdsuggest, int ns, - const mapentry* maptable, int nummap, int * timer, clock_t * timelimit) -{ - if (*(word + wn) == '\0') { - int cwrd = 1; - *(candidate + cn) = '\0'; - int wl = strlen(candidate); - for (int m=0; m < ns; m++) { - if (strcmp(candidate, wlst[m]) == 0) { - cwrd = 0; - break; - } - } - if ((cwrd) && checkword(candidate, wl, cpdsuggest, timer, timelimit)) { - if (ns < maxSug) { - wlst[ns] = mystrdup(candidate); - if (wlst[ns] == NULL) return -1; - ns++; - } - } - return ns; - } - int in_map = 0; - for (int j = 0; j < nummap; j++) { - for (int k = 0; k < maptable[j].len; k++) { - int len = strlen(maptable[j].set[k]); - if (strncmp(maptable[j].set[k], word + wn, len) == 0) { - in_map = 1; - for (int l = 0; l < maptable[j].len; l++) { - strcpy(candidate + cn, maptable[j].set[l]); - ns = map_related(word, candidate, wn + len, strlen(candidate), wlst, - cpdsuggest, ns, maptable, nummap, timer, timelimit); - if (!(*timer)) return ns; - } - } - } - } - if (!in_map) { - *(candidate + cn) = *(word + wn); - ns = map_related(word, candidate, wn + 1, cn + 1, wlst, cpdsuggest, - ns, maptable, nummap, timer, timelimit); - } - return ns; -} - -// suggestions for a typical fault of spelling, that -// differs with more, than 1 letter from the right form. -int SuggestMgr::replchars(char** wlst, const char * word, int ns, int cpdsuggest) -{ - char candidate[MAXSWUTF8L]; - const char * r; - int lenr, lenp; - int wl = strlen(word); - if (wl < 2 || ! pAMgr) return ns; - int numrep = pAMgr->get_numrep(); - struct replentry* reptable = pAMgr->get_reptable(); - if (reptable==NULL) return ns; - for (int i=0; i < numrep; i++ ) { - r = word; - lenr = strlen(reptable[i].pattern2); - lenp = strlen(reptable[i].pattern); - // search every occurence of the pattern in the word - while ((r=strstr(r, reptable[i].pattern)) != NULL && (!reptable[i].end || strlen(r) == strlen(reptable[i].pattern)) && - (!reptable[i].start || r == word)) { - strcpy(candidate, word); - if (r-word + lenr + strlen(r+lenp) >= MAXSWUTF8L) break; - strcpy(candidate+(r-word),reptable[i].pattern2); - strcpy(candidate+(r-word)+lenr, r+lenp); - ns = testsug(wlst, candidate, wl-lenp+lenr, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - // check REP suggestions with space - char * sp = strchr(candidate, ' '); - if (sp) { - char * prev = candidate; - while (sp) { - *sp = '\0'; - if (checkword(prev, strlen(prev), 0, NULL, NULL)) { - int oldns = ns; - *sp = ' '; - ns = testsug(wlst, sp + 1, strlen(sp + 1), ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - if (oldns < ns) { - free(wlst[ns - 1]); - wlst[ns - 1] = mystrdup(candidate); - if (!wlst[ns - 1]) return -1; - } - } - *sp = ' '; - prev = sp + 1; - sp = strchr(prev, ' '); - } - } - r++; // search for the next letter - } - } - return ns; -} - -// perhaps we doubled two characters (pattern aba -> ababa, for example vacation -> vacacation) -int SuggestMgr::doubletwochars(char** wlst, const char * word, int ns, int cpdsuggest) -{ - char candidate[MAXSWUTF8L]; - int state=0; - int wl = strlen(word); - if (wl < 5 || ! pAMgr) return ns; - for (int i=2; i < wl; i++ ) { - if (word[i]==word[i-2]) { - state++; - if (state==3) { - strcpy(candidate,word); - strcpy(candidate+i-1,word+i+1); - ns = testsug(wlst, candidate, wl-2, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - state=0; - } - } else { - state=0; - } - } - return ns; -} - -// perhaps we doubled two characters (pattern aba -> ababa, for example vacation -> vacacation) -int SuggestMgr::doubletwochars_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) -{ - w_char candidate_utf[MAXSWL]; - char candidate[MAXSWUTF8L]; - int state=0; - if (wl < 5 || ! pAMgr) return ns; - for (int i=2; i < wl; i++) { - if (w_char_eq(word[i], word[i-2])) { - state++; - if (state==3) { - memcpy(candidate_utf, word, (i - 1) * sizeof(w_char)); - memcpy(candidate_utf+i-1, word+i+1, (wl-i-1) * sizeof(w_char)); - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl-2); - ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - state=0; - } - } else { - state=0; - } - } - return ns; -} - -// error is wrong char in place of correct one (case and keyboard related version) -int SuggestMgr::badcharkey(char ** wlst, const char * word, int ns, int cpdsuggest) -{ - char tmpc; - char candidate[MAXSWUTF8L]; - int wl = strlen(word); - strcpy(candidate, word); - // swap out each char one by one and try uppercase and neighbor - // keyboard chars in its place to see if that makes a good word - - for (int i=0; i < wl; i++) { - tmpc = candidate[i]; - // check with uppercase letters - candidate[i] = csconv[((unsigned char)tmpc)].cupper; - if (tmpc != candidate[i]) { - ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - candidate[i] = tmpc; - } - // check neighbor characters in keyboard string - if (!ckey) continue; - char * loc = strchr(ckey, tmpc); - while (loc) { - if ((loc > ckey) && (*(loc - 1) != '|')) { - candidate[i] = *(loc - 1); - ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - } - if ((*(loc + 1) != '|') && (*(loc + 1) != '\0')) { - candidate[i] = *(loc + 1); - ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - } - loc = strchr(loc + 1, tmpc); - } - candidate[i] = tmpc; - } - return ns; -} - -// error is wrong char in place of correct one (case and keyboard related version) -int SuggestMgr::badcharkey_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) -{ - w_char tmpc; - w_char candidate_utf[MAXSWL]; - char candidate[MAXSWUTF8L]; - memcpy(candidate_utf, word, wl * sizeof(w_char)); - // swap out each char one by one and try all the tryme - // chars in its place to see if that makes a good word - for (int i=0; i < wl; i++) { - tmpc = candidate_utf[i]; - // check with uppercase letters - mkallcap_utf(candidate_utf + i, 1, langnum); - if (!w_char_eq(tmpc, candidate_utf[i])) { - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); - ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - candidate_utf[i] = tmpc; - } - // check neighbor characters in keyboard string - if (!ckey) continue; - w_char * loc = ckey_utf; - while ((loc < (ckey_utf + ckeyl)) && !w_char_eq(*loc, tmpc)) loc++; - while (loc < (ckey_utf + ckeyl)) { - if ((loc > ckey_utf) && !w_char_eq(*(loc - 1), W_VLINE)) { - candidate_utf[i] = *(loc - 1); - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); - ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - } - if (((loc + 1) < (ckey_utf + ckeyl)) && !w_char_eq(*(loc + 1), W_VLINE)) { - candidate_utf[i] = *(loc + 1); - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); - ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - } - do { loc++; } while ((loc < (ckey_utf + ckeyl)) && !w_char_eq(*loc, tmpc)); - } - candidate_utf[i] = tmpc; - } - return ns; -} - -// error is wrong char in place of correct one -int SuggestMgr::badchar(char ** wlst, const char * word, int ns, int cpdsuggest) -{ - char tmpc; - char candidate[MAXSWUTF8L]; - clock_t timelimit = clock(); - int timer = MINTIMER; - int wl = strlen(word); - strcpy(candidate, word); - // swap out each char one by one and try all the tryme - // chars in its place to see if that makes a good word - for (int j=0; j < ctryl; j++) { - for (int i=wl-1; i >= 0; i--) { - tmpc = candidate[i]; - if (ctry[j] == tmpc) continue; - candidate[i] = ctry[j]; - ns = testsug(wlst, candidate, wl, ns, cpdsuggest, &timer, &timelimit); - if (ns == -1) return -1; - if (!timer) return ns; - candidate[i] = tmpc; - } - } - return ns; -} - -// error is wrong char in place of correct one -int SuggestMgr::badchar_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) -{ - w_char tmpc; - w_char candidate_utf[MAXSWL]; - char candidate[MAXSWUTF8L]; - clock_t timelimit = clock(); - int timer = MINTIMER; - memcpy(candidate_utf, word, wl * sizeof(w_char)); - // swap out each char one by one and try all the tryme - // chars in its place to see if that makes a good word - for (int j=0; j < ctryl; j++) { - for (int i=wl-1; i >= 0; i--) { - tmpc = candidate_utf[i]; - if (w_char_eq(tmpc, ctry_utf[j])) continue; - candidate_utf[i] = ctry_utf[j]; - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); - ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, &timer, &timelimit); - if (ns == -1) return -1; - if (!timer) return ns; - candidate_utf[i] = tmpc; - } - } - return ns; -} - -// error is word has an extra letter it does not need -int SuggestMgr::extrachar_utf(char** wlst, const w_char * word, int wl, int ns, int cpdsuggest) -{ - char candidate[MAXSWUTF8L]; - w_char candidate_utf[MAXSWL]; - w_char * p; - w_char tmpc = W_VLINE; // not used value, only for VCC warning message - if (wl < 2) return ns; - // try omitting one char of word at a time - memcpy(candidate_utf, word, wl * sizeof(w_char)); - for (p = candidate_utf + wl - 1; p >= candidate_utf; p--) { - w_char tmpc2 = *p; - if (p < candidate_utf + wl - 1) *p = tmpc; - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl - 1); - ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - tmpc = tmpc2; - } - return ns; -} - -// error is word has an extra letter it does not need -int SuggestMgr::extrachar(char** wlst, const char * word, int ns, int cpdsuggest) -{ - char tmpc = '\0'; - char candidate[MAXSWUTF8L]; - char * p; - int wl = strlen(word); - if (wl < 2) return ns; - // try omitting one char of word at a time - strcpy (candidate, word); - for (p = candidate + wl - 1; p >=candidate; p--) { - char tmpc2 = *p; - *p = tmpc; - ns = testsug(wlst, candidate, wl-1, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - tmpc = tmpc2; - } - return ns; -} - -// error is missing a letter it needs -int SuggestMgr::forgotchar(char ** wlst, const char * word, int ns, int cpdsuggest) -{ - char candidate[MAXSWUTF8L + 4]; - char * p; - clock_t timelimit = clock(); - int timer = MINTIMER; - int wl = strlen(word); - // try inserting a tryme character before every letter (and the null terminator) - for (int i = 0; i < ctryl; i++) { - strcpy(candidate, word); - for (p = candidate + wl; p >= candidate; p--) { - *(p+1) = *p; - *p = ctry[i]; - ns = testsug(wlst, candidate, wl+1, ns, cpdsuggest, &timer, &timelimit); - if (ns == -1) return -1; - if (!timer) return ns; - } - } - return ns; -} - -// error is missing a letter it needs -int SuggestMgr::forgotchar_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) -{ - w_char candidate_utf[MAXSWL + 1]; - char candidate[MAXSWUTF8L + 4]; - w_char * p; - clock_t timelimit = clock(); - int timer = MINTIMER; - // try inserting a tryme character at the end of the word and before every letter - for (int i = 0; i < ctryl; i++) { - memcpy (candidate_utf, word, wl * sizeof(w_char)); - for (p = candidate_utf + wl; p >= candidate_utf; p--) { - *(p + 1) = *p; - *p = ctry_utf[i]; - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl + 1); - ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, &timer, &timelimit); - if (ns == -1) return -1; - if (!timer) return ns; - } - } - return ns; -} - - -/* error is should have been two words */ -int SuggestMgr::twowords(char ** wlst, const char * word, int ns, int cpdsuggest) -{ - char candidate[MAXSWUTF8L]; - char * p; - int c1, c2; - int forbidden = 0; - int cwrd; - - int wl=strlen(word); - if (wl < 3) return ns; - - if (langnum == LANG_hu) forbidden = check_forbidden(word, wl); - - strcpy(candidate + 1, word); - // split the string into two pieces after every char - // if both pieces are good words make them a suggestion - for (p = candidate + 1; p[1] != '\0'; p++) { - p[-1] = *p; - // go to end of the UTF-8 character - while (utf8 && ((p[1] & 0xc0) == 0x80)) { - *p = p[1]; - p++; - } - if (utf8 && p[1] == '\0') break; // last UTF-8 character - *p = '\0'; - c1 = checkword(candidate,strlen(candidate), cpdsuggest, NULL, NULL); - if (c1) { - c2 = checkword((p+1),strlen(p+1), cpdsuggest, NULL, NULL); - if (c2) { - *p = ' '; - - // spec. Hungarian code (need a better compound word support) - if ((langnum == LANG_hu) && !forbidden && - // if 3 repeating letter, use - instead of space - (((p[-1] == p[1]) && (((p>candidate+1) && (p[-1] == p[-2])) || (p[-1] == p[2]))) || - // or multiple compounding, with more, than 6 syllables - ((c1 == 3) && (c2 >= 2)))) *p = '-'; - - cwrd = 1; - for (int k=0; k < ns; k++) { - if (strcmp(candidate,wlst[k]) == 0) { - cwrd = 0; - break; - } - } - if (ns < maxSug) { - if (cwrd) { - wlst[ns] = mystrdup(candidate); - if (wlst[ns] == NULL) return -1; - ns++; - } - } else return ns; - // add two word suggestion with dash, if TRY string contains - // "a" or "-" - // NOTE: cwrd doesn't modified for REP twoword sugg. - if (ctry && (strchr(ctry, 'a') || strchr(ctry, '-')) && - mystrlen(p + 1) > 1 && - mystrlen(candidate) - mystrlen(p) > 1) { - *p = '-'; - for (int k=0; k < ns; k++) { - if (strcmp(candidate,wlst[k]) == 0) { - cwrd = 0; - break; - } - } - if (ns < maxSug) { - if (cwrd) { - wlst[ns] = mystrdup(candidate); - if (wlst[ns] == NULL) return -1; - ns++; - } - } else return ns; - } - } - } - } - return ns; -} - - -// error is adjacent letter were swapped -int SuggestMgr::swapchar(char ** wlst, const char * word, int ns, int cpdsuggest) -{ - char candidate[MAXSWUTF8L]; - char * p; - char tmpc; - int wl=strlen(word); - // try swapping adjacent chars one by one - strcpy(candidate, word); - for (p = candidate; p[1] != 0; p++) { - tmpc = *p; - *p = p[1]; - p[1] = tmpc; - ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - p[1] = *p; - *p = tmpc; - } - // try double swaps for short words - // ahev -> have, owudl -> would - if (wl == 4 || wl == 5) { - candidate[0] = word[1]; - candidate[1] = word[0]; - candidate[2] = word[2]; - candidate[wl - 2] = word[wl - 1]; - candidate[wl - 1] = word[wl - 2]; - ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - if (wl == 5) { - candidate[0] = word[0]; - candidate[1] = word[2]; - candidate[2] = word[1]; - ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - } - } - return ns; -} - -// error is adjacent letter were swapped -int SuggestMgr::swapchar_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) -{ - w_char candidate_utf[MAXSWL]; - char candidate[MAXSWUTF8L]; - w_char * p; - w_char tmpc; - int len = 0; - // try swapping adjacent chars one by one - memcpy (candidate_utf, word, wl * sizeof(w_char)); - for (p = candidate_utf; p < (candidate_utf + wl - 1); p++) { - tmpc = *p; - *p = p[1]; - p[1] = tmpc; - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); - if (len == 0) len = strlen(candidate); - ns = testsug(wlst, candidate, len, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - p[1] = *p; - *p = tmpc; - } - // try double swaps for short words - // ahev -> have, owudl -> would, suodn -> sound - if (wl == 4 || wl == 5) { - candidate_utf[0] = word[1]; - candidate_utf[1] = word[0]; - candidate_utf[2] = word[2]; - candidate_utf[wl - 2] = word[wl - 1]; - candidate_utf[wl - 1] = word[wl - 2]; - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); - ns = testsug(wlst, candidate, len, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - if (wl == 5) { - candidate_utf[0] = word[0]; - candidate_utf[1] = word[2]; - candidate_utf[2] = word[1]; - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); - ns = testsug(wlst, candidate, len, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - } - } - return ns; -} - -// error is not adjacent letter were swapped -int SuggestMgr::longswapchar(char ** wlst, const char * word, int ns, int cpdsuggest) -{ - char candidate[MAXSWUTF8L]; - char * p; - char * q; - char tmpc; - int wl=strlen(word); - // try swapping not adjacent chars one by one - strcpy(candidate, word); - for (p = candidate; *p != 0; p++) { - for (q = candidate; *q != 0; q++) { - if (abs((int)(p-q)) > 1) { - tmpc = *p; - *p = *q; - *q = tmpc; - ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - *q = *p; - *p = tmpc; - } - } - } - return ns; -} - - -// error is adjacent letter were swapped -int SuggestMgr::longswapchar_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) -{ - w_char candidate_utf[MAXSWL]; - char candidate[MAXSWUTF8L]; - w_char * p; - w_char * q; - w_char tmpc; - // try swapping not adjacent chars - memcpy (candidate_utf, word, wl * sizeof(w_char)); - for (p = candidate_utf; p < (candidate_utf + wl); p++) { - for (q = candidate_utf; q < (candidate_utf + wl); q++) { - if (abs((int)(p-q)) > 1) { - tmpc = *p; - *p = *q; - *q = tmpc; - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); - ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - *q = *p; - *p = tmpc; - } - } - } - return ns; -} - -// error is a letter was moved -int SuggestMgr::movechar(char ** wlst, const char * word, int ns, int cpdsuggest) -{ - char candidate[MAXSWUTF8L]; - char * p; - char * q; - char tmpc; - - int wl=strlen(word); - // try moving a char - strcpy(candidate, word); - for (p = candidate; *p != 0; p++) { - for (q = p + 1; (*q != 0) && ((q - p) < 10); q++) { - tmpc = *(q-1); - *(q-1) = *q; - *q = tmpc; - if ((q-p) < 2) continue; // omit swap char - ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - } - strcpy(candidate, word); - } - for (p = candidate + wl - 1; p > candidate; p--) { - for (q = p - 1; (q >= candidate) && ((p - q) < 10); q--) { - tmpc = *(q+1); - *(q+1) = *q; - *q = tmpc; - if ((p-q) < 2) continue; // omit swap char - ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - } - strcpy(candidate, word); - } - return ns; -} - -// error is a letter was moved -int SuggestMgr::movechar_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) -{ - w_char candidate_utf[MAXSWL]; - char candidate[MAXSWUTF8L]; - w_char * p; - w_char * q; - w_char tmpc; - // try moving a char - memcpy (candidate_utf, word, wl * sizeof(w_char)); - for (p = candidate_utf; p < (candidate_utf + wl); p++) { - for (q = p + 1; (q < (candidate_utf + wl)) && ((q - p) < 10); q++) { - tmpc = *(q-1); - *(q-1) = *q; - *q = tmpc; - if ((q-p) < 2) continue; // omit swap char - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); - ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - } - memcpy (candidate_utf, word, wl * sizeof(w_char)); - } - for (p = candidate_utf + wl - 1; p > candidate_utf; p--) { - for (q = p - 1; (q >= candidate_utf) && ((p - q) < 10); q--) { - tmpc = *(q+1); - *(q+1) = *q; - *q = tmpc; - if ((p-q) < 2) continue; // omit swap char - u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); - ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); - if (ns == -1) return -1; - } - memcpy (candidate_utf, word, wl * sizeof(w_char)); - } - return ns; -} - -// generate a set of suggestions for very poorly spelled words -int SuggestMgr::ngsuggest(char** wlst, char * w, int ns, HashMgr** pHMgr, int md) -{ - - int i, j; - int lval; - int sc, scphon; - int lp, lpphon; - int nonbmp = 0; - - // exhaustively search through all root words - // keeping track of the MAX_ROOTS most similar root words - struct hentry * roots[MAX_ROOTS]; - char * rootsphon[MAX_ROOTS]; - int scores[MAX_ROOTS]; - int scoresphon[MAX_ROOTS]; - for (i = 0; i < MAX_ROOTS; i++) { - roots[i] = NULL; - scores[i] = -100 * i; - rootsphon[i] = NULL; - scoresphon[i] = -100 * i; - } - lp = MAX_ROOTS - 1; - lpphon = MAX_ROOTS - 1; - scphon = -20000; - int low = NGRAM_LOWERING; - - char w2[MAXWORDUTF8LEN]; - char f[MAXSWUTF8L]; - char * word = w; - - // word reversing wrapper for complex prefixes - if (complexprefixes) { - strcpy(w2, w); - if (utf8) reverseword_utf(w2); else reverseword(w2); - word = w2; - } - - char mw[MAXSWUTF8L]; - w_char u8[MAXSWL]; - int nc = strlen(word); - int n = (utf8) ? u8_u16(u8, MAXSWL, word) : nc; - - // set character based ngram suggestion for words with non-BMP Unicode characters - if (n == -1) { - utf8 = 0; // XXX not state-free - n = nc; - nonbmp = 1; - low = 0; - } - - struct hentry* hp = NULL; - int col = -1; - phonetable * ph = (pAMgr) ? pAMgr->get_phonetable() : NULL; - char target[MAXSWUTF8L]; - char candidate[MAXSWUTF8L]; - if (ph) { - if (utf8) { - w_char _w[MAXSWL]; - int _wl = u8_u16(_w, MAXSWL, word); - mkallcap_utf(_w, _wl, langnum); - u16_u8(candidate, MAXSWUTF8L, _w, _wl); - } else { - strcpy(candidate, word); - if (!nonbmp) mkallcap(candidate, csconv); - } - phonet(candidate, target, nc, *ph); // XXX phonet() is 8-bit (nc, not n) - } - - FLAG forbiddenword = pAMgr ? pAMgr->get_forbiddenword() : FLAG_NULL; - FLAG nosuggest = pAMgr ? pAMgr->get_nosuggest() : FLAG_NULL; - FLAG nongramsuggest = pAMgr ? pAMgr->get_nongramsuggest() : FLAG_NULL; - FLAG onlyincompound = pAMgr ? pAMgr->get_onlyincompound() : FLAG_NULL; - - for (i = 0; i < md; i++) { - while (0 != (hp = (pHMgr[i])->walk_hashtable(col, hp))) { - if ((hp->astr) && (pAMgr) && - (TESTAFF(hp->astr, forbiddenword, hp->alen) || - TESTAFF(hp->astr, ONLYUPCASEFLAG, hp->alen) || - TESTAFF(hp->astr, nosuggest, hp->alen) || - TESTAFF(hp->astr, nongramsuggest, hp->alen) || - TESTAFF(hp->astr, onlyincompound, hp->alen))) continue; - - sc = ngram(3, word, HENTRY_WORD(hp), NGRAM_LONGER_WORSE + low) + - leftcommonsubstring(word, HENTRY_WORD(hp)); - - // check special pronounciation - if ((hp->var & H_OPT_PHON) && copy_field(f, HENTRY_DATA(hp), MORPH_PHON)) { - int sc2 = ngram(3, word, f, NGRAM_LONGER_WORSE + low) + - + leftcommonsubstring(word, f); - if (sc2 > sc) sc = sc2; - } - - scphon = -20000; - if (ph && (sc > 2) && (abs(n - (int) hp->clen) <= 3)) { - char target2[MAXSWUTF8L]; - if (utf8) { - w_char _w[MAXSWL]; - int _wl = u8_u16(_w, MAXSWL, HENTRY_WORD(hp)); - mkallcap_utf(_w, _wl, langnum); - u16_u8(candidate, MAXSWUTF8L, _w, _wl); - } else { - strcpy(candidate, HENTRY_WORD(hp)); - mkallcap(candidate, csconv); - } - phonet(candidate, target2, -1, *ph); - scphon = 2 * ngram(3, target, target2, NGRAM_LONGER_WORSE); - } - - if (sc > scores[lp]) { - scores[lp] = sc; - roots[lp] = hp; - lval = sc; - for (j=0; j < MAX_ROOTS; j++) - if (scores[j] < lval) { - lp = j; - lval = scores[j]; - } - } - - - if (scphon > scoresphon[lpphon]) { - scoresphon[lpphon] = scphon; - rootsphon[lpphon] = HENTRY_WORD(hp); - lval = scphon; - for (j=0; j < MAX_ROOTS; j++) - if (scoresphon[j] < lval) { - lpphon = j; - lval = scoresphon[j]; - } - } - }} - - // find minimum threshold for a passable suggestion - // mangle original word three differnt ways - // and score them to generate a minimum acceptable score - int thresh = 0; - for (int sp = 1; sp < 4; sp++) { - if (utf8) { - for (int k=sp; k < n; k+=4) *((unsigned short *) u8 + k) = '*'; - u16_u8(mw, MAXSWUTF8L, u8, n); - thresh = thresh + ngram(n, word, mw, NGRAM_ANY_MISMATCH + low); - } else { - strcpy(mw, word); - for (int k=sp; k < n; k+=4) *(mw + k) = '*'; - thresh = thresh + ngram(n, word, mw, NGRAM_ANY_MISMATCH + low); - } - } - thresh = thresh / 3; - thresh--; - - // now expand affixes on each of these root words and - // and use length adjusted ngram scores to select - // possible suggestions - char * guess[MAX_GUESS]; - char * guessorig[MAX_GUESS]; - int gscore[MAX_GUESS]; - for(i=0;iexpand_rootword(glst, MAX_WORDS, HENTRY_WORD(rp), rp->blen, - rp->astr, rp->alen, word, nc, - ((rp->var & H_OPT_PHON) ? copy_field(f, HENTRY_DATA(rp), MORPH_PHON) : NULL)); - - for (int k = 0; k < nw ; k++) { - sc = ngram(n, word, glst[k].word, NGRAM_ANY_MISMATCH + low) + - leftcommonsubstring(word, glst[k].word); - - if (sc > thresh) { - if (sc > gscore[lp]) { - if (guess[lp]) { - free (guess[lp]); - if (guessorig[lp]) { - free(guessorig[lp]); - guessorig[lp] = NULL; - } - } - gscore[lp] = sc; - guess[lp] = glst[k].word; - guessorig[lp] = glst[k].orig; - lval = sc; - for (j=0; j < MAX_GUESS; j++) - if (gscore[j] < lval) { - lp = j; - lval = gscore[j]; - } - } else { - free(glst[k].word); - if (glst[k].orig) free(glst[k].orig); - } - } else { - free(glst[k].word); - if (glst[k].orig) free(glst[k].orig); - } - } - } - } - free(glst); - - // now we are done generating guesses - // sort in order of decreasing score - - - bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS); - if (ph) bubblesort(&rootsphon[0], NULL, &scoresphon[0], MAX_ROOTS); - - // weight suggestions with a similarity index, based on - // the longest common subsequent algorithm and resort - - int is_swap = 0; - int re = 0; - double fact = 1.0; - if (pAMgr) { - int maxd = pAMgr->get_maxdiff(); - if (maxd >= 0) fact = (10.0 - maxd)/5.0; - } - - for (i=0; i < MAX_GUESS; i++) { - if (guess[i]) { - // lowering guess[i] - char gl[MAXSWUTF8L]; - int len; - if (utf8) { - w_char _w[MAXSWL]; - len = u8_u16(_w, MAXSWL, guess[i]); - mkallsmall_utf(_w, len, langnum); - u16_u8(gl, MAXSWUTF8L, _w, len); - } else { - strcpy(gl, guess[i]); - if (!nonbmp) mkallsmall(gl, csconv); - len = strlen(guess[i]); - } - - int _lcs = lcslen(word, gl); - - // same characters with different casing - if ((n == len) && (n == _lcs)) { - gscore[i] += 2000; - break; - } - // using 2-gram instead of 3, and other weightening - - re = ngram(2, word, gl, NGRAM_ANY_MISMATCH + low + NGRAM_WEIGHTED) + - ngram(2, gl, word, NGRAM_ANY_MISMATCH + low + NGRAM_WEIGHTED); - - gscore[i] = - // length of longest common subsequent minus length difference - 2 * _lcs - abs((int) (n - len)) + - // weight length of the left common substring - leftcommonsubstring(word, gl) + - // weight equal character positions - (!nonbmp && commoncharacterpositions(word, gl, &is_swap) ? 1: 0) + - // swap character (not neighboring) - ((is_swap) ? 10 : 0) + - // ngram - ngram(4, word, gl, NGRAM_ANY_MISMATCH + low) + - // weighted ngrams - re + - // different limit for dictionaries with PHONE rules - (ph ? (re < len * fact ? -1000 : 0) : (re < (n + len)*fact? -1000 : 0)); - } - } - - bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS); - -// phonetic version - if (ph) for (i=0; i < MAX_ROOTS; i++) { - if (rootsphon[i]) { - // lowering rootphon[i] - char gl[MAXSWUTF8L]; - int len; - if (utf8) { - w_char _w[MAXSWL]; - len = u8_u16(_w, MAXSWL, rootsphon[i]); - mkallsmall_utf(_w, len, langnum); - u16_u8(gl, MAXSWUTF8L, _w, len); - } else { - strcpy(gl, rootsphon[i]); - if (!nonbmp) mkallsmall(gl, csconv); - len = strlen(rootsphon[i]); - } - - // heuristic weigthing of ngram scores - scoresphon[i] += 2 * lcslen(word, gl) - abs((int) (n - len)) + - // weight length of the left common substring - leftcommonsubstring(word, gl); - } - } - - if (ph) bubblesort(&rootsphon[0], NULL, &scoresphon[0], MAX_ROOTS); - - // copy over - int oldns = ns; - - int same = 0; - for (i=0; i < MAX_GUESS; i++) { - if (guess[i]) { - if ((ns < oldns + maxngramsugs) && (ns < maxSug) && (!same || (gscore[i] > 1000))) { - int unique = 1; - // leave only excellent suggestions, if exists - if (gscore[i] > 1000) same = 1; else if (gscore[i] < -100) { - same = 1; - // keep the best ngram suggestions, unless in ONLYMAXDIFF mode - if (ns > oldns || (pAMgr && pAMgr->get_onlymaxdiff())) { - free(guess[i]); - if (guessorig[i]) free(guessorig[i]); - continue; - } - } - for (j = 0; j < ns; j++) { - // don't suggest previous suggestions or a previous suggestion with prefixes or affixes - if ((!guessorig[i] && strstr(guess[i], wlst[j])) || - (guessorig[i] && strstr(guessorig[i], wlst[j])) || - // check forbidden words - !checkword(guess[i], strlen(guess[i]), 0, NULL, NULL)) { - unique = 0; - break; - } - } - if (unique) { - wlst[ns++] = guess[i]; - if (guessorig[i]) { - free(guess[i]); - wlst[ns-1] = guessorig[i]; - } - } else { - free(guess[i]); - if (guessorig[i]) free(guessorig[i]); - } - } else { - free(guess[i]); - if (guessorig[i]) free(guessorig[i]); - } - } - } - - oldns = ns; - if (ph) for (i=0; i < MAX_ROOTS; i++) { - if (rootsphon[i]) { - if ((ns < oldns + MAXPHONSUGS) && (ns < maxSug)) { - int unique = 1; - for (j = 0; j < ns; j++) { - // don't suggest previous suggestions or a previous suggestion with prefixes or affixes - if (strstr(rootsphon[i], wlst[j]) || - // check forbidden words - !checkword(rootsphon[i], strlen(rootsphon[i]), 0, NULL, NULL)) { - unique = 0; - break; - } - } - if (unique) { - wlst[ns++] = mystrdup(rootsphon[i]); - if (!wlst[ns - 1]) return ns - 1; - } - } - } - } - - if (nonbmp) utf8 = 1; - return ns; -} - - -// see if a candidate suggestion is spelled correctly -// needs to check both root words and words with affixes - -// obsolote MySpell-HU modifications: -// return value 2 and 3 marks compounding with hyphen (-) -// `3' marks roots without suffix -int SuggestMgr::checkword(const char * word, int len, int cpdsuggest, int * timer, clock_t * timelimit) -{ - struct hentry * rv=NULL; - struct hentry * rv2=NULL; - int nosuffix = 0; - - // check time limit - if (timer) { - (*timer)--; - if (!(*timer) && timelimit) { - if ((clock() - *timelimit) > TIMELIMIT) return 0; - *timer = MAXPLUSTIMER; - } - } - - if (pAMgr) { - if (cpdsuggest==1) { - if (pAMgr->get_compound()) { - rv = pAMgr->compound_check(word, len, 0, 0, 100, 0, NULL, 0, 1, 0); //EXT - if (rv && (!(rv2 = pAMgr->lookup(word)) || !rv2->astr || - !(TESTAFF(rv2->astr,pAMgr->get_forbiddenword(),rv2->alen) || - TESTAFF(rv2->astr,pAMgr->get_nosuggest(),rv2->alen)))) return 3; // XXX obsolote categorisation + only ICONV needs affix flag check? - } - return 0; - } - - rv = pAMgr->lookup(word); - - if (rv) { - if ((rv->astr) && (TESTAFF(rv->astr,pAMgr->get_forbiddenword(),rv->alen) - || TESTAFF(rv->astr,pAMgr->get_nosuggest(),rv->alen))) return 0; - while (rv) { - if (rv->astr && (TESTAFF(rv->astr,pAMgr->get_needaffix(),rv->alen) || - TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) || - TESTAFF(rv->astr,pAMgr->get_onlyincompound(),rv->alen))) { - rv = rv->next_homonym; - } else break; - } - } else rv = pAMgr->prefix_check(word, len, 0); // only prefix, and prefix + suffix XXX - - if (rv) { - nosuffix=1; - } else { - rv = pAMgr->suffix_check(word, len, 0, NULL, NULL, 0, NULL); // only suffix - } - - if (!rv && pAMgr->have_contclass()) { - rv = pAMgr->suffix_check_twosfx(word, len, 0, NULL, FLAG_NULL); - if (!rv) rv = pAMgr->prefix_check_twosfx(word, len, 1, FLAG_NULL); - } - - // check forbidden words - if ((rv) && (rv->astr) && (TESTAFF(rv->astr,pAMgr->get_forbiddenword(),rv->alen) || - TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) || - TESTAFF(rv->astr,pAMgr->get_nosuggest(),rv->alen) || - TESTAFF(rv->astr,pAMgr->get_onlyincompound(),rv->alen))) return 0; - - if (rv) { // XXX obsolote - if ((pAMgr->get_compoundflag()) && - TESTAFF(rv->astr, pAMgr->get_compoundflag(), rv->alen)) return 2 + nosuffix; - return 1; - } - } - return 0; -} - -int SuggestMgr::check_forbidden(const char * word, int len) -{ - struct hentry * rv = NULL; - - if (pAMgr) { - rv = pAMgr->lookup(word); - if (rv && rv->astr && (TESTAFF(rv->astr,pAMgr->get_needaffix(),rv->alen) || - TESTAFF(rv->astr,pAMgr->get_onlyincompound(),rv->alen))) rv = NULL; - if (!(pAMgr->prefix_check(word,len,1))) - rv = pAMgr->suffix_check(word,len, 0, NULL, NULL, 0, NULL); // prefix+suffix, suffix - // check forbidden words - if ((rv) && (rv->astr) && TESTAFF(rv->astr,pAMgr->get_forbiddenword(),rv->alen)) return 1; - } - return 0; -} - -#ifdef HUNSPELL_EXPERIMENTAL -// suggest possible stems -int SuggestMgr::suggest_pos_stems(char*** slst, const char * w, int nsug) -{ - char ** wlst; - - struct hentry * rv = NULL; - - char w2[MAXSWUTF8L]; - const char * word = w; - - // word reversing wrapper for complex prefixes - if (complexprefixes) { - strcpy(w2, w); - if (utf8) reverseword_utf(w2); else reverseword(w2); - word = w2; - } - - int wl = strlen(word); - - - if (*slst) { - wlst = *slst; - } else { - wlst = (char **) calloc(maxSug, sizeof(char *)); - if (wlst == NULL) return -1; - } - - rv = pAMgr->suffix_check(word, wl, 0, NULL, wlst, maxSug, &nsug); - - // delete dash from end of word - if (nsug > 0) { - for (int j=0; j < nsug; j++) { - if (wlst[j][strlen(wlst[j]) - 1] == '-') wlst[j][strlen(wlst[j]) - 1] = '\0'; - } - } - - *slst = wlst; - return nsug; -} -#endif // END OF HUNSPELL_EXPERIMENTAL CODE - - -char * SuggestMgr::suggest_morph(const char * w) -{ - char result[MAXLNLEN]; - char * r = (char *) result; - char * st; - - struct hentry * rv = NULL; - - *result = '\0'; - - if (! pAMgr) return NULL; - - char w2[MAXSWUTF8L]; - const char * word = w; - - // word reversing wrapper for complex prefixes - if (complexprefixes) { - strcpy(w2, w); - if (utf8) reverseword_utf(w2); else reverseword(w2); - word = w2; - } - - rv = pAMgr->lookup(word); - - while (rv) { - if ((!rv->astr) || !(TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) || - TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) || - TESTAFF(rv->astr,pAMgr->get_onlyincompound(),rv->alen))) { - if (!HENTRY_FIND(rv, MORPH_STEM)) { - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, MORPH_STEM, MAXLNLEN); - mystrcat(result, word, MAXLNLEN); - } - if (HENTRY_DATA(rv)) { - mystrcat(result, " ", MAXLNLEN); - mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); - } - mystrcat(result, "\n", MAXLNLEN); - } - rv = rv->next_homonym; - } - - st = pAMgr->affix_check_morph(word,strlen(word)); - if (st) { - mystrcat(result, st, MAXLNLEN); - free(st); - } - - if (pAMgr->get_compound() && (*result == '\0')) - pAMgr->compound_check_morph(word, strlen(word), - 0, 0, 100, 0,NULL, 0, &r, NULL); - - return (*result) ? mystrdup(line_uniq(result, MSEP_REC)) : NULL; -} - -#ifdef HUNSPELL_EXPERIMENTAL -char * SuggestMgr::suggest_morph_for_spelling_error(const char * word) -{ - char * p = NULL; - char ** wlst = (char **) calloc(maxSug, sizeof(char *)); - if (!**wlst) return NULL; - // we will use only the first suggestion - for (int i = 0; i < maxSug - 1; i++) wlst[i] = ""; - int ns = suggest(&wlst, word, maxSug - 1, NULL); - if (ns == maxSug) { - p = suggest_morph(wlst[maxSug - 1]); - free(wlst[maxSug - 1]); - } - if (wlst) free(wlst); - return p; -} -#endif // END OF HUNSPELL_EXPERIMENTAL CODE - -/* affixation */ -char * SuggestMgr::suggest_hentry_gen(hentry * rv, char * pattern) -{ - char result[MAXLNLEN]; - *result = '\0'; - int sfxcount = get_sfxcount(pattern); - - if (get_sfxcount(HENTRY_DATA(rv)) > sfxcount) return NULL; - - if (HENTRY_DATA(rv)) { - char * aff = pAMgr->morphgen(HENTRY_WORD(rv), rv->blen, rv->astr, rv->alen, - HENTRY_DATA(rv), pattern, 0); - if (aff) { - mystrcat(result, aff, MAXLNLEN); - mystrcat(result, "\n", MAXLNLEN); - free(aff); - } - } - - // check all allomorphs - char allomorph[MAXLNLEN]; - char * p = NULL; - if (HENTRY_DATA(rv)) p = (char *) strstr(HENTRY_DATA2(rv), MORPH_ALLOMORPH); - while (p) { - struct hentry * rv2 = NULL; - p += MORPH_TAG_LEN; - int plen = fieldlen(p); - strncpy(allomorph, p, plen); - allomorph[plen] = '\0'; - rv2 = pAMgr->lookup(allomorph); - while (rv2) { -// if (HENTRY_DATA(rv2) && get_sfxcount(HENTRY_DATA(rv2)) <= sfxcount) { - if (HENTRY_DATA(rv2)) { - char * st = (char *) strstr(HENTRY_DATA2(rv2), MORPH_STEM); - if (st && (strncmp(st + MORPH_TAG_LEN, - HENTRY_WORD(rv), fieldlen(st + MORPH_TAG_LEN)) == 0)) { - char * aff = pAMgr->morphgen(HENTRY_WORD(rv2), rv2->blen, rv2->astr, rv2->alen, - HENTRY_DATA(rv2), pattern, 0); - if (aff) { - mystrcat(result, aff, MAXLNLEN); - mystrcat(result, "\n", MAXLNLEN); - free(aff); - } - } - } - rv2 = rv2->next_homonym; - } - p = strstr(p + plen, MORPH_ALLOMORPH); - } - - return (*result) ? mystrdup(result) : NULL; -} - -char * SuggestMgr::suggest_gen(char ** desc, int n, char * pattern) { - char result[MAXLNLEN]; - char result2[MAXLNLEN]; - char newpattern[MAXLNLEN]; - *newpattern = '\0'; - if (n == 0) return 0; - *result2 = '\0'; - struct hentry * rv = NULL; - if (!pAMgr) return NULL; - -// search affixed forms with and without derivational suffixes - while(1) { - - for (int k = 0; k < n; k++) { - *result = '\0'; - // add compound word parts (except the last one) - char * s = (char *) desc[k]; - char * part = strstr(s, MORPH_PART); - if (part) { - char * nextpart = strstr(part + 1, MORPH_PART); - while (nextpart) { - copy_field(result + strlen(result), part, MORPH_PART); - part = nextpart; - nextpart = strstr(part + 1, MORPH_PART); - } - s = part; - } - - char **pl; - char tok[MAXLNLEN]; - strcpy(tok, s); - char * alt = strstr(tok, " | "); - while (alt) { - alt[1] = MSEP_ALT; - alt = strstr(alt, " | "); - } - int pln = line_tok(tok, &pl, MSEP_ALT); - for (int i = 0; i < pln; i++) { - // remove inflectional and terminal suffixes - char * is = strstr(pl[i], MORPH_INFL_SFX); - if (is) *is = '\0'; - char * ts = strstr(pl[i], MORPH_TERM_SFX); - while (ts) { - *ts = '_'; - ts = strstr(pl[i], MORPH_TERM_SFX); - } - char * st = strstr(s, MORPH_STEM); - if (st) { - copy_field(tok, st, MORPH_STEM); - rv = pAMgr->lookup(tok); - while (rv) { - char newpat[MAXLNLEN]; - strcpy(newpat, pl[i]); - strcat(newpat, pattern); - char * sg = suggest_hentry_gen(rv, newpat); - if (!sg) sg = suggest_hentry_gen(rv, pattern); - if (sg) { - char ** gen; - int genl = line_tok(sg, &gen, MSEP_REC); - free(sg); - sg = NULL; - for (int j = 0; j < genl; j++) { - if (strstr(pl[i], MORPH_SURF_PFX)) { - int r2l = strlen(result2); - result2[r2l] = MSEP_REC; - strcpy(result2 + r2l + 1, result); - copy_field(result2 + strlen(result2), pl[i], MORPH_SURF_PFX); - mystrcat(result2, gen[j], MAXLNLEN); - } else { - sprintf(result2 + strlen(result2), "%c%s%s", - MSEP_REC, result, gen[j]); - } - } - freelist(&gen, genl); - } - rv = rv->next_homonym; - } - } - } - freelist(&pl, pln); - } - - if (*result2 || !strstr(pattern, MORPH_DERI_SFX)) break; - strcpy(newpattern, pattern); - pattern = newpattern; - char * ds = strstr(pattern, MORPH_DERI_SFX); - while (ds) { - strncpy(ds, MORPH_TERM_SFX, MORPH_TAG_LEN); - ds = strstr(pattern, MORPH_DERI_SFX); - } - } - return (*result2 ? mystrdup(result2) : NULL); -} - - -// generate an n-gram score comparing s1 and s2 -int SuggestMgr::ngram(int n, char * s1, const char * s2, int opt) -{ - int nscore = 0; - int ns; - int l1; - int l2; - int test = 0; - - if (utf8) { - w_char su1[MAXSWL]; - w_char su2[MAXSWL]; - l1 = u8_u16(su1, MAXSWL, s1); - l2 = u8_u16(su2, MAXSWL, s2); - if ((l2 <= 0) || (l1 == -1)) return 0; - // lowering dictionary word - if (opt & NGRAM_LOWERING) mkallsmall_utf(su2, l2, langnum); - for (int j = 1; j <= n; j++) { - ns = 0; - for (int i = 0; i <= (l1-j); i++) { - int k = 0; - for (int l = 0; l <= (l2-j); l++) { - for (k = 0; k < j; k++) { - w_char * c1 = su1 + i + k; - w_char * c2 = su2 + l + k; - if ((c1->l != c2->l) || (c1->h != c2->h)) break; - } - if (k == j) { - ns++; - break; - } - } - if (k != j && opt & NGRAM_WEIGHTED) { - ns--; - test++; - if (i == 0 || i == l1-j) ns--; // side weight - } - } - nscore = nscore + ns; - if (ns < 2 && !(opt & NGRAM_WEIGHTED)) break; - } - } else { - l2 = strlen(s2); - if (l2 == 0) return 0; - l1 = strlen(s1); - char *t = mystrdup(s2); - if (opt & NGRAM_LOWERING) mkallsmall(t, csconv); - for (int j = 1; j <= n; j++) { - ns = 0; - for (int i = 0; i <= (l1-j); i++) { - char c = *(s1 + i + j); - *(s1 + i + j) = '\0'; - if (strstr(t,(s1+i))) { - ns++; - } else if (opt & NGRAM_WEIGHTED) { - ns--; -test++; - if (i == 0 || i == l1-j) ns--; // side weight - } - *(s1 + i + j ) = c; - } - nscore = nscore + ns; - if (ns < 2 && !(opt & NGRAM_WEIGHTED)) break; - } - free(t); - } - - ns = 0; - if (opt & NGRAM_LONGER_WORSE) ns = (l2-l1)-2; - if (opt & NGRAM_ANY_MISMATCH) ns = abs(l2-l1)-2; - ns = (nscore - ((ns > 0) ? ns : 0)); - return ns; -} - -// length of the left common substring of s1 and (decapitalised) s2 -int SuggestMgr::leftcommonsubstring(char * s1, const char * s2) { - if (utf8) { - w_char su1[MAXSWL]; - w_char su2[MAXSWL]; - su1[0].l = su2[0].l = su1[0].h = su2[0].h = 0; - // decapitalize dictionary word - if (complexprefixes) { - int l1 = u8_u16(su1, MAXSWL, s1); - int l2 = u8_u16(su2, MAXSWL, s2); - if (*((short *)su1+l1-1) == *((short *)su2+l2-1)) return 1; - } else { - int i; - u8_u16(su1, 1, s1); - u8_u16(su2, 1, s2); - unsigned short idx = (su2->h << 8) + su2->l; - unsigned short otheridx = (su1->h << 8) + su1->l; - if (otheridx != idx && - (otheridx != unicodetolower(idx, langnum))) return 0; - int l1 = u8_u16(su1, MAXSWL, s1); - int l2 = u8_u16(su2, MAXSWL, s2); - for(i = 1; (i < l1) && (i < l2) && - (su1[i].l == su2[i].l) && (su1[i].h == su2[i].h); i++); - return i; - } - } else { - if (complexprefixes) { - int l1 = strlen(s1); - int l2 = strlen(s2); - if (*(s2+l1-1) == *(s2+l2-1)) return 1; - } else { - char * olds = s1; - // decapitalise dictionary word - if ((*s1 != *s2) && (*s1 != csconv[((unsigned char)*s2)].clower)) return 0; - do { - s1++; s2++; - } while ((*s1 == *s2) && (*s1 != '\0')); - return (int)(s1 - olds); - } - } - return 0; -} - -int SuggestMgr::commoncharacterpositions(char * s1, const char * s2, int * is_swap) { - int num = 0; - int diff = 0; - int diffpos[2]; - *is_swap = 0; - if (utf8) { - w_char su1[MAXSWL]; - w_char su2[MAXSWL]; - int l1 = u8_u16(su1, MAXSWL, s1); - int l2 = u8_u16(su2, MAXSWL, s2); - - if (l1 <= 0 || l2 <= 0) - return 0; - - // decapitalize dictionary word - if (complexprefixes) { - mkallsmall_utf(su2+l2-1, 1, langnum); - } else { - mkallsmall_utf(su2, 1, langnum); - } - for (int i = 0; (i < l1) && (i < l2); i++) { - if (((short *) su1)[i] == ((short *) su2)[i]) { - num++; - } else { - if (diff < 2) diffpos[diff] = i; - diff++; - } - } - if ((diff == 2) && (l1 == l2) && - (((short *) su1)[diffpos[0]] == ((short *) su2)[diffpos[1]]) && - (((short *) su1)[diffpos[1]] == ((short *) su2)[diffpos[0]])) *is_swap = 1; - } else { - int i; - char t[MAXSWUTF8L]; - strcpy(t, s2); - // decapitalize dictionary word - if (complexprefixes) { - int l2 = strlen(t); - *(t+l2-1) = csconv[((unsigned char)*(t+l2-1))].clower; - } else { - mkallsmall(t, csconv); - } - for (i = 0; (*(s1+i) != 0) && (*(t+i) != 0); i++) { - if (*(s1+i) == *(t+i)) { - num++; - } else { - if (diff < 2) diffpos[diff] = i; - diff++; - } - } - if ((diff == 2) && (*(s1+i) == 0) && (*(t+i) == 0) && - (*(s1+diffpos[0]) == *(t+diffpos[1])) && - (*(s1+diffpos[1]) == *(t+diffpos[0]))) *is_swap = 1; - } - return num; -} - -int SuggestMgr::mystrlen(const char * word) { - if (utf8) { - w_char w[MAXSWL]; - return u8_u16(w, MAXSWL, word); - } else return strlen(word); -} - -// sort in decreasing order of score -void SuggestMgr::bubblesort(char** rword, char** rword2, int* rsc, int n ) -{ - int m = 1; - while (m < n) { - int j = m; - while (j > 0) { - if (rsc[j-1] < rsc[j]) { - int sctmp = rsc[j-1]; - char * wdtmp = rword[j-1]; - rsc[j-1] = rsc[j]; - rword[j-1] = rword[j]; - rsc[j] = sctmp; - rword[j] = wdtmp; - if (rword2) { - wdtmp = rword2[j-1]; - rword2[j-1] = rword2[j]; - rword2[j] = wdtmp; - } - j--; - } else break; - } - m++; - } - return; -} - -// longest common subsequence -void SuggestMgr::lcs(const char * s, const char * s2, int * l1, int * l2, char ** result) { - int n, m; - w_char su[MAXSWL]; - w_char su2[MAXSWL]; - char * b; - char * c; - int i; - int j; - if (utf8) { - m = u8_u16(su, MAXSWL, s); - n = u8_u16(su2, MAXSWL, s2); - } else { - m = strlen(s); - n = strlen(s2); - } - c = (char *) malloc((m + 1) * (n + 1)); - b = (char *) malloc((m + 1) * (n + 1)); - if (!c || !b) { - if (c) free(c); - if (b) free(b); - *result = NULL; - return; - } - for (i = 1; i <= m; i++) c[i*(n+1)] = 0; - for (j = 0; j <= n; j++) c[j] = 0; - for (i = 1; i <= m; i++) { - for (j = 1; j <= n; j++) { - if ( ((utf8) && (*((short *) su+i-1) == *((short *)su2+j-1))) - || ((!utf8) && ((*(s+i-1)) == (*(s2+j-1))))) { - c[i*(n+1) + j] = c[(i-1)*(n+1) + j-1]+1; - b[i*(n+1) + j] = LCS_UPLEFT; - } else if (c[(i-1)*(n+1) + j] >= c[i*(n+1) + j-1]) { - c[i*(n+1) + j] = c[(i-1)*(n+1) + j]; - b[i*(n+1) + j] = LCS_UP; - } else { - c[i*(n+1) + j] = c[i*(n+1) + j-1]; - b[i*(n+1) + j] = LCS_LEFT; - } - } - } - *result = b; - free(c); - *l1 = m; - *l2 = n; -} - -int SuggestMgr::lcslen(const char * s, const char* s2) { - int m; - int n; - int i; - int j; - char * result; - int len = 0; - lcs(s, s2, &m, &n, &result); - if (!result) return 0; - i = m; - j = n; - while ((i != 0) && (j != 0)) { - if (result[i*(n+1) + j] == LCS_UPLEFT) { - len++; - i--; - j--; - } else if (result[i*(n+1) + j] == LCS_UP) { - i--; - } else j--; - } - free(result); - return len; -} diff --git a/subprojects/hunspell/src/hunspell/suggestmgr.hxx b/subprojects/hunspell/src/hunspell/suggestmgr.hxx deleted file mode 100644 index 8456b5b3e..000000000 --- a/subprojects/hunspell/src/hunspell/suggestmgr.hxx +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef _SUGGESTMGR_HXX_ -#define _SUGGESTMGR_HXX_ - -#define MAXSWL 100 -#define MAXSWUTF8L (MAXSWL * 4) -#define MAX_ROOTS 100 -#define MAX_WORDS 100 -#define MAX_GUESS 200 -#define MAXNGRAMSUGS 4 -#define MAXPHONSUGS 2 -#define MAXCOMPOUNDSUGS 3 - -// timelimit: max ~1/4 sec (process time on Linux) for a time consuming function -#define TIMELIMIT (CLOCKS_PER_SEC >> 2) -#define MINTIMER 100 -#define MAXPLUSTIMER 100 - -#define NGRAM_LONGER_WORSE (1 << 0) -#define NGRAM_ANY_MISMATCH (1 << 1) -#define NGRAM_LOWERING (1 << 2) -#define NGRAM_WEIGHTED (1 << 3) - -#include "hunvisapi.h" - -#include "atypes.hxx" -#include "affixmgr.hxx" -#include "hashmgr.hxx" -#include "langnum.hxx" -#include - -enum { LCS_UP, LCS_LEFT, LCS_UPLEFT }; - -class LIBHUNSPELL_DLL_EXPORTED SuggestMgr -{ -private: - SuggestMgr(const SuggestMgr&); - SuggestMgr& operator = (const SuggestMgr&); -private: - char * ckey; - int ckeyl; - w_char * ckey_utf; - - char * ctry; - int ctryl; - w_char * ctry_utf; - - AffixMgr* pAMgr; - int maxSug; - struct cs_info * csconv; - int utf8; - int langnum; - int nosplitsugs; - int maxngramsugs; - int maxcpdsugs; - int complexprefixes; - - -public: - SuggestMgr(const char * tryme, int maxn, AffixMgr *aptr); - ~SuggestMgr(); - - int suggest(char*** slst, const char * word, int nsug, int * onlycmpdsug); - int ngsuggest(char ** wlst, char * word, int ns, HashMgr** pHMgr, int md); - int suggest_auto(char*** slst, const char * word, int nsug); - int suggest_stems(char*** slst, const char * word, int nsug); - int suggest_pos_stems(char*** slst, const char * word, int nsug); - - char * suggest_morph(const char * word); - char * suggest_gen(char ** pl, int pln, char * pattern); - char * suggest_morph_for_spelling_error(const char * word); - -private: - int testsug(char** wlst, const char * candidate, int wl, int ns, int cpdsuggest, - int * timer, clock_t * timelimit); - int checkword(const char *, int, int, int *, clock_t *); - int check_forbidden(const char *, int); - - int capchars(char **, const char *, int, int); - int replchars(char**, const char *, int, int); - int doubletwochars(char**, const char *, int, int); - int forgotchar(char **, const char *, int, int); - int swapchar(char **, const char *, int, int); - int longswapchar(char **, const char *, int, int); - int movechar(char **, const char *, int, int); - int extrachar(char **, const char *, int, int); - int badcharkey(char **, const char *, int, int); - int badchar(char **, const char *, int, int); - int twowords(char **, const char *, int, int); - int fixstems(char **, const char *, int); - - int capchars_utf(char **, const w_char *, int wl, int, int); - int doubletwochars_utf(char**, const w_char *, int wl, int, int); - int forgotchar_utf(char**, const w_char *, int wl, int, int); - int extrachar_utf(char**, const w_char *, int wl, int, int); - int badcharkey_utf(char **, const w_char *, int wl, int, int); - int badchar_utf(char **, const w_char *, int wl, int, int); - int swapchar_utf(char **, const w_char *, int wl, int, int); - int longswapchar_utf(char **, const w_char *, int, int, int); - int movechar_utf(char **, const w_char *, int, int, int); - - int mapchars(char**, const char *, int, int); - int map_related(const char *, char *, int, int, char ** wlst, int, int, const mapentry*, int, int *, clock_t *); - int ngram(int n, char * s1, const char * s2, int opt); - int mystrlen(const char * word); - int leftcommonsubstring(char * s1, const char * s2); - int commoncharacterpositions(char * s1, const char * s2, int * is_swap); - void bubblesort( char ** rwd, char ** rwd2, int * rsc, int n); - void lcs(const char * s, const char * s2, int * l1, int * l2, char ** result); - int lcslen(const char * s, const char* s2); - char * suggest_hentry_gen(hentry * rv, char * pattern); - -}; - -#endif - diff --git a/subprojects/hunspell/src/hunspell/utf_info.cxx b/subprojects/hunspell/src/hunspell/utf_info.cxx deleted file mode 100644 index 4a8e203cf..000000000 --- a/subprojects/hunspell/src/hunspell/utf_info.cxx +++ /dev/null @@ -1,19676 +0,0 @@ -#include "csutil.hxx" -/* fields: Unicode letter, toupper, tolower */ -static struct unicode_info utf_lst[] = { -{ 0x0041, 0x0041, 0x0061 }, -{ 0x0042, 0x0042, 0x0062 }, -{ 0x0043, 0x0043, 0x0063 }, -{ 0x0044, 0x0044, 0x0064 }, -{ 0x0045, 0x0045, 0x0065 }, -{ 0x0046, 0x0046, 0x0066 }, -{ 0x0047, 0x0047, 0x0067 }, -{ 0x0048, 0x0048, 0x0068 }, -{ 0x0049, 0x0049, 0x0069 }, -{ 0x004A, 0x004A, 0x006A }, -{ 0x004B, 0x004B, 0x006B }, -{ 0x004C, 0x004C, 0x006C }, -{ 0x004D, 0x004D, 0x006D }, -{ 0x004E, 0x004E, 0x006E }, -{ 0x004F, 0x004F, 0x006F }, -{ 0x0050, 0x0050, 0x0070 }, -{ 0x0051, 0x0051, 0x0071 }, -{ 0x0052, 0x0052, 0x0072 }, -{ 0x0053, 0x0053, 0x0073 }, -{ 0x0054, 0x0054, 0x0074 }, -{ 0x0055, 0x0055, 0x0075 }, -{ 0x0056, 0x0056, 0x0076 }, -{ 0x0057, 0x0057, 0x0077 }, -{ 0x0058, 0x0058, 0x0078 }, -{ 0x0059, 0x0059, 0x0079 }, -{ 0x005A, 0x005A, 0x007A }, -{ 0x0061, 0x0041, 0x0061 }, -{ 0x0062, 0x0042, 0x0062 }, -{ 0x0063, 0x0043, 0x0063 }, -{ 0x0064, 0x0044, 0x0064 }, -{ 0x0065, 0x0045, 0x0065 }, -{ 0x0066, 0x0046, 0x0066 }, -{ 0x0067, 0x0047, 0x0067 }, -{ 0x0068, 0x0048, 0x0068 }, -{ 0x0069, 0x0049, 0x0069 }, -{ 0x006A, 0x004A, 0x006A }, -{ 0x006B, 0x004B, 0x006B }, -{ 0x006C, 0x004C, 0x006C }, -{ 0x006D, 0x004D, 0x006D }, -{ 0x006E, 0x004E, 0x006E }, -{ 0x006F, 0x004F, 0x006F }, -{ 0x0070, 0x0050, 0x0070 }, -{ 0x0071, 0x0051, 0x0071 }, -{ 0x0072, 0x0052, 0x0072 }, -{ 0x0073, 0x0053, 0x0073 }, -{ 0x0074, 0x0054, 0x0074 }, -{ 0x0075, 0x0055, 0x0075 }, -{ 0x0076, 0x0056, 0x0076 }, -{ 0x0077, 0x0057, 0x0077 }, -{ 0x0078, 0x0058, 0x0078 }, -{ 0x0079, 0x0059, 0x0079 }, -{ 0x007A, 0x005A, 0x007A }, -{ 0x00AA, 0x00AA, 0x00AA }, -{ 0x00B5, 0x039C, 0x00B5 }, -{ 0x00BA, 0x00BA, 0x00BA }, -{ 0x00C0, 0x00C0, 0x00E0 }, -{ 0x00C1, 0x00C1, 0x00E1 }, -{ 0x00C2, 0x00C2, 0x00E2 }, -{ 0x00C3, 0x00C3, 0x00E3 }, -{ 0x00C4, 0x00C4, 0x00E4 }, -{ 0x00C5, 0x00C5, 0x00E5 }, -{ 0x00C6, 0x00C6, 0x00E6 }, -{ 0x00C7, 0x00C7, 0x00E7 }, -{ 0x00C8, 0x00C8, 0x00E8 }, -{ 0x00C9, 0x00C9, 0x00E9 }, -{ 0x00CA, 0x00CA, 0x00EA }, -{ 0x00CB, 0x00CB, 0x00EB }, -{ 0x00CC, 0x00CC, 0x00EC }, -{ 0x00CD, 0x00CD, 0x00ED }, -{ 0x00CE, 0x00CE, 0x00EE }, -{ 0x00CF, 0x00CF, 0x00EF }, -{ 0x00D0, 0x00D0, 0x00F0 }, -{ 0x00D1, 0x00D1, 0x00F1 }, -{ 0x00D2, 0x00D2, 0x00F2 }, -{ 0x00D3, 0x00D3, 0x00F3 }, -{ 0x00D4, 0x00D4, 0x00F4 }, -{ 0x00D5, 0x00D5, 0x00F5 }, -{ 0x00D6, 0x00D6, 0x00F6 }, -{ 0x00D8, 0x00D8, 0x00F8 }, -{ 0x00D9, 0x00D9, 0x00F9 }, -{ 0x00DA, 0x00DA, 0x00FA }, -{ 0x00DB, 0x00DB, 0x00FB }, -{ 0x00DC, 0x00DC, 0x00FC }, -{ 0x00DD, 0x00DD, 0x00FD }, -{ 0x00DE, 0x00DE, 0x00FE }, -{ 0x00DF, 0x00DF, 0x00DF }, -{ 0x00E0, 0x00C0, 0x00E0 }, -{ 0x00E1, 0x00C1, 0x00E1 }, -{ 0x00E2, 0x00C2, 0x00E2 }, -{ 0x00E3, 0x00C3, 0x00E3 }, -{ 0x00E4, 0x00C4, 0x00E4 }, -{ 0x00E5, 0x00C5, 0x00E5 }, -{ 0x00E6, 0x00C6, 0x00E6 }, -{ 0x00E7, 0x00C7, 0x00E7 }, -{ 0x00E8, 0x00C8, 0x00E8 }, -{ 0x00E9, 0x00C9, 0x00E9 }, -{ 0x00EA, 0x00CA, 0x00EA }, -{ 0x00EB, 0x00CB, 0x00EB }, -{ 0x00EC, 0x00CC, 0x00EC }, -{ 0x00ED, 0x00CD, 0x00ED }, -{ 0x00EE, 0x00CE, 0x00EE }, -{ 0x00EF, 0x00CF, 0x00EF }, -{ 0x00F0, 0x00D0, 0x00F0 }, -{ 0x00F1, 0x00D1, 0x00F1 }, -{ 0x00F2, 0x00D2, 0x00F2 }, -{ 0x00F3, 0x00D3, 0x00F3 }, -{ 0x00F4, 0x00D4, 0x00F4 }, -{ 0x00F5, 0x00D5, 0x00F5 }, -{ 0x00F6, 0x00D6, 0x00F6 }, -{ 0x00F8, 0x00D8, 0x00F8 }, -{ 0x00F9, 0x00D9, 0x00F9 }, -{ 0x00FA, 0x00DA, 0x00FA }, -{ 0x00FB, 0x00DB, 0x00FB }, -{ 0x00FC, 0x00DC, 0x00FC }, -{ 0x00FD, 0x00DD, 0x00FD }, -{ 0x00FE, 0x00DE, 0x00FE }, -{ 0x00FF, 0x0178, 0x00FF }, -{ 0x0100, 0x0100, 0x0101 }, -{ 0x0101, 0x0100, 0x0101 }, -{ 0x0102, 0x0102, 0x0103 }, -{ 0x0103, 0x0102, 0x0103 }, -{ 0x0104, 0x0104, 0x0105 }, -{ 0x0105, 0x0104, 0x0105 }, -{ 0x0106, 0x0106, 0x0107 }, -{ 0x0107, 0x0106, 0x0107 }, -{ 0x0108, 0x0108, 0x0109 }, -{ 0x0109, 0x0108, 0x0109 }, -{ 0x010A, 0x010A, 0x010B }, -{ 0x010B, 0x010A, 0x010B }, -{ 0x010C, 0x010C, 0x010D }, -{ 0x010D, 0x010C, 0x010D }, -{ 0x010E, 0x010E, 0x010F }, -{ 0x010F, 0x010E, 0x010F }, -{ 0x0110, 0x0110, 0x0111 }, -{ 0x0111, 0x0110, 0x0111 }, -{ 0x0112, 0x0112, 0x0113 }, -{ 0x0113, 0x0112, 0x0113 }, -{ 0x0114, 0x0114, 0x0115 }, -{ 0x0115, 0x0114, 0x0115 }, -{ 0x0116, 0x0116, 0x0117 }, -{ 0x0117, 0x0116, 0x0117 }, -{ 0x0118, 0x0118, 0x0119 }, -{ 0x0119, 0x0118, 0x0119 }, -{ 0x011A, 0x011A, 0x011B }, -{ 0x011B, 0x011A, 0x011B }, -{ 0x011C, 0x011C, 0x011D }, -{ 0x011D, 0x011C, 0x011D }, -{ 0x011E, 0x011E, 0x011F }, -{ 0x011F, 0x011E, 0x011F }, -{ 0x0120, 0x0120, 0x0121 }, -{ 0x0121, 0x0120, 0x0121 }, -{ 0x0122, 0x0122, 0x0123 }, -{ 0x0123, 0x0122, 0x0123 }, -{ 0x0124, 0x0124, 0x0125 }, -{ 0x0125, 0x0124, 0x0125 }, -{ 0x0126, 0x0126, 0x0127 }, -{ 0x0127, 0x0126, 0x0127 }, -{ 0x0128, 0x0128, 0x0129 }, -{ 0x0129, 0x0128, 0x0129 }, -{ 0x012A, 0x012A, 0x012B }, -{ 0x012B, 0x012A, 0x012B }, -{ 0x012C, 0x012C, 0x012D }, -{ 0x012D, 0x012C, 0x012D }, -{ 0x012E, 0x012E, 0x012F }, -{ 0x012F, 0x012E, 0x012F }, -{ 0x0130, 0x0130, 0x0069 }, -{ 0x0131, 0x0049, 0x0131 }, -{ 0x0132, 0x0132, 0x0133 }, -{ 0x0133, 0x0132, 0x0133 }, -{ 0x0134, 0x0134, 0x0135 }, -{ 0x0135, 0x0134, 0x0135 }, -{ 0x0136, 0x0136, 0x0137 }, -{ 0x0137, 0x0136, 0x0137 }, -{ 0x0138, 0x0138, 0x0138 }, -{ 0x0139, 0x0139, 0x013A }, -{ 0x013A, 0x0139, 0x013A }, -{ 0x013B, 0x013B, 0x013C }, -{ 0x013C, 0x013B, 0x013C }, -{ 0x013D, 0x013D, 0x013E }, -{ 0x013E, 0x013D, 0x013E }, -{ 0x013F, 0x013F, 0x0140 }, -{ 0x0140, 0x013F, 0x0140 }, -{ 0x0141, 0x0141, 0x0142 }, -{ 0x0142, 0x0141, 0x0142 }, -{ 0x0143, 0x0143, 0x0144 }, -{ 0x0144, 0x0143, 0x0144 }, -{ 0x0145, 0x0145, 0x0146 }, -{ 0x0146, 0x0145, 0x0146 }, -{ 0x0147, 0x0147, 0x0148 }, -{ 0x0148, 0x0147, 0x0148 }, -{ 0x0149, 0x0149, 0x0149 }, -{ 0x014A, 0x014A, 0x014B }, -{ 0x014B, 0x014A, 0x014B }, -{ 0x014C, 0x014C, 0x014D }, -{ 0x014D, 0x014C, 0x014D }, -{ 0x014E, 0x014E, 0x014F }, -{ 0x014F, 0x014E, 0x014F }, -{ 0x0150, 0x0150, 0x0151 }, -{ 0x0151, 0x0150, 0x0151 }, -{ 0x0152, 0x0152, 0x0153 }, -{ 0x0153, 0x0152, 0x0153 }, -{ 0x0154, 0x0154, 0x0155 }, -{ 0x0155, 0x0154, 0x0155 }, -{ 0x0156, 0x0156, 0x0157 }, -{ 0x0157, 0x0156, 0x0157 }, -{ 0x0158, 0x0158, 0x0159 }, -{ 0x0159, 0x0158, 0x0159 }, -{ 0x015A, 0x015A, 0x015B }, -{ 0x015B, 0x015A, 0x015B }, -{ 0x015C, 0x015C, 0x015D }, -{ 0x015D, 0x015C, 0x015D }, -{ 0x015E, 0x015E, 0x015F }, -{ 0x015F, 0x015E, 0x015F }, -{ 0x0160, 0x0160, 0x0161 }, -{ 0x0161, 0x0160, 0x0161 }, -{ 0x0162, 0x0162, 0x0163 }, -{ 0x0163, 0x0162, 0x0163 }, -{ 0x0164, 0x0164, 0x0165 }, -{ 0x0165, 0x0164, 0x0165 }, -{ 0x0166, 0x0166, 0x0167 }, -{ 0x0167, 0x0166, 0x0167 }, -{ 0x0168, 0x0168, 0x0169 }, -{ 0x0169, 0x0168, 0x0169 }, -{ 0x016A, 0x016A, 0x016B }, -{ 0x016B, 0x016A, 0x016B }, -{ 0x016C, 0x016C, 0x016D }, -{ 0x016D, 0x016C, 0x016D }, -{ 0x016E, 0x016E, 0x016F }, -{ 0x016F, 0x016E, 0x016F }, -{ 0x0170, 0x0170, 0x0171 }, -{ 0x0171, 0x0170, 0x0171 }, -{ 0x0172, 0x0172, 0x0173 }, -{ 0x0173, 0x0172, 0x0173 }, -{ 0x0174, 0x0174, 0x0175 }, -{ 0x0175, 0x0174, 0x0175 }, -{ 0x0176, 0x0176, 0x0177 }, -{ 0x0177, 0x0176, 0x0177 }, -{ 0x0178, 0x0178, 0x00FF }, -{ 0x0179, 0x0179, 0x017A }, -{ 0x017A, 0x0179, 0x017A }, -{ 0x017B, 0x017B, 0x017C }, -{ 0x017C, 0x017B, 0x017C }, -{ 0x017D, 0x017D, 0x017E }, -{ 0x017E, 0x017D, 0x017E }, -{ 0x017F, 0x0053, 0x017F }, -{ 0x0180, 0x0180, 0x0180 }, -{ 0x0181, 0x0181, 0x0253 }, -{ 0x0182, 0x0182, 0x0183 }, -{ 0x0183, 0x0182, 0x0183 }, -{ 0x0184, 0x0184, 0x0185 }, -{ 0x0185, 0x0184, 0x0185 }, -{ 0x0186, 0x0186, 0x0254 }, -{ 0x0187, 0x0187, 0x0188 }, -{ 0x0188, 0x0187, 0x0188 }, -{ 0x0189, 0x0189, 0x0256 }, -{ 0x018A, 0x018A, 0x0257 }, -{ 0x018B, 0x018B, 0x018C }, -{ 0x018C, 0x018B, 0x018C }, -{ 0x018D, 0x018D, 0x018D }, -{ 0x018E, 0x018E, 0x01DD }, -{ 0x018F, 0x018F, 0x0259 }, -{ 0x0190, 0x0190, 0x025B }, -{ 0x0191, 0x0191, 0x0192 }, -{ 0x0192, 0x0191, 0x0192 }, -{ 0x0193, 0x0193, 0x0260 }, -{ 0x0194, 0x0194, 0x0263 }, -{ 0x0195, 0x01F6, 0x0195 }, -{ 0x0196, 0x0196, 0x0269 }, -{ 0x0197, 0x0197, 0x0268 }, -{ 0x0198, 0x0198, 0x0199 }, -{ 0x0199, 0x0198, 0x0199 }, -{ 0x019A, 0x023D, 0x019A }, -{ 0x019B, 0x019B, 0x019B }, -{ 0x019C, 0x019C, 0x026F }, -{ 0x019D, 0x019D, 0x0272 }, -{ 0x019E, 0x0220, 0x019E }, -{ 0x019F, 0x019F, 0x0275 }, -{ 0x01A0, 0x01A0, 0x01A1 }, -{ 0x01A1, 0x01A0, 0x01A1 }, -{ 0x01A2, 0x01A2, 0x01A3 }, -{ 0x01A3, 0x01A2, 0x01A3 }, -{ 0x01A4, 0x01A4, 0x01A5 }, -{ 0x01A5, 0x01A4, 0x01A5 }, -{ 0x01A6, 0x01A6, 0x0280 }, -{ 0x01A7, 0x01A7, 0x01A8 }, -{ 0x01A8, 0x01A7, 0x01A8 }, -{ 0x01A9, 0x01A9, 0x0283 }, -{ 0x01AA, 0x01AA, 0x01AA }, -{ 0x01AB, 0x01AB, 0x01AB }, -{ 0x01AC, 0x01AC, 0x01AD }, -{ 0x01AD, 0x01AC, 0x01AD }, -{ 0x01AE, 0x01AE, 0x0288 }, -{ 0x01AF, 0x01AF, 0x01B0 }, -{ 0x01B0, 0x01AF, 0x01B0 }, -{ 0x01B1, 0x01B1, 0x028A }, -{ 0x01B2, 0x01B2, 0x028B }, -{ 0x01B3, 0x01B3, 0x01B4 }, -{ 0x01B4, 0x01B3, 0x01B4 }, -{ 0x01B5, 0x01B5, 0x01B6 }, -{ 0x01B6, 0x01B5, 0x01B6 }, -{ 0x01B7, 0x01B7, 0x0292 }, -{ 0x01B8, 0x01B8, 0x01B9 }, -{ 0x01B9, 0x01B8, 0x01B9 }, -{ 0x01BA, 0x01BA, 0x01BA }, -{ 0x01BB, 0x01BB, 0x01BB }, -{ 0x01BC, 0x01BC, 0x01BD }, -{ 0x01BD, 0x01BC, 0x01BD }, -{ 0x01BE, 0x01BE, 0x01BE }, -{ 0x01BF, 0x01F7, 0x01BF }, -{ 0x01C0, 0x01C0, 0x01C0 }, -{ 0x01C1, 0x01C1, 0x01C1 }, -{ 0x01C2, 0x01C2, 0x01C2 }, -{ 0x01C3, 0x01C3, 0x01C3 }, -{ 0x01C4, 0x01C4, 0x01C6 }, -{ 0x01C5, 0x01C4, 0x01C6 }, -{ 0x01C6, 0x01C4, 0x01C6 }, -{ 0x01C7, 0x01C7, 0x01C9 }, -{ 0x01C8, 0x01C7, 0x01C9 }, -{ 0x01C9, 0x01C7, 0x01C9 }, -{ 0x01CA, 0x01CA, 0x01CC }, -{ 0x01CB, 0x01CA, 0x01CC }, -{ 0x01CC, 0x01CA, 0x01CC }, -{ 0x01CD, 0x01CD, 0x01CE }, -{ 0x01CE, 0x01CD, 0x01CE }, -{ 0x01CF, 0x01CF, 0x01D0 }, -{ 0x01D0, 0x01CF, 0x01D0 }, -{ 0x01D1, 0x01D1, 0x01D2 }, -{ 0x01D2, 0x01D1, 0x01D2 }, -{ 0x01D3, 0x01D3, 0x01D4 }, -{ 0x01D4, 0x01D3, 0x01D4 }, -{ 0x01D5, 0x01D5, 0x01D6 }, -{ 0x01D6, 0x01D5, 0x01D6 }, -{ 0x01D7, 0x01D7, 0x01D8 }, -{ 0x01D8, 0x01D7, 0x01D8 }, -{ 0x01D9, 0x01D9, 0x01DA }, -{ 0x01DA, 0x01D9, 0x01DA }, -{ 0x01DB, 0x01DB, 0x01DC }, -{ 0x01DC, 0x01DB, 0x01DC }, -{ 0x01DD, 0x018E, 0x01DD }, -{ 0x01DE, 0x01DE, 0x01DF }, -{ 0x01DF, 0x01DE, 0x01DF }, -{ 0x01E0, 0x01E0, 0x01E1 }, -{ 0x01E1, 0x01E0, 0x01E1 }, -{ 0x01E2, 0x01E2, 0x01E3 }, -{ 0x01E3, 0x01E2, 0x01E3 }, -{ 0x01E4, 0x01E4, 0x01E5 }, -{ 0x01E5, 0x01E4, 0x01E5 }, -{ 0x01E6, 0x01E6, 0x01E7 }, -{ 0x01E7, 0x01E6, 0x01E7 }, -{ 0x01E8, 0x01E8, 0x01E9 }, -{ 0x01E9, 0x01E8, 0x01E9 }, -{ 0x01EA, 0x01EA, 0x01EB }, -{ 0x01EB, 0x01EA, 0x01EB }, -{ 0x01EC, 0x01EC, 0x01ED }, -{ 0x01ED, 0x01EC, 0x01ED }, -{ 0x01EE, 0x01EE, 0x01EF }, -{ 0x01EF, 0x01EE, 0x01EF }, -{ 0x01F0, 0x01F0, 0x01F0 }, -{ 0x01F1, 0x01F1, 0x01F3 }, -{ 0x01F2, 0x01F1, 0x01F3 }, -{ 0x01F3, 0x01F1, 0x01F3 }, -{ 0x01F4, 0x01F4, 0x01F5 }, -{ 0x01F5, 0x01F4, 0x01F5 }, -{ 0x01F6, 0x01F6, 0x0195 }, -{ 0x01F7, 0x01F7, 0x01BF }, -{ 0x01F8, 0x01F8, 0x01F9 }, -{ 0x01F9, 0x01F8, 0x01F9 }, -{ 0x01FA, 0x01FA, 0x01FB }, -{ 0x01FB, 0x01FA, 0x01FB }, -{ 0x01FC, 0x01FC, 0x01FD }, -{ 0x01FD, 0x01FC, 0x01FD }, -{ 0x01FE, 0x01FE, 0x01FF }, -{ 0x01FF, 0x01FE, 0x01FF }, -{ 0x0200, 0x0200, 0x0201 }, -{ 0x0201, 0x0200, 0x0201 }, -{ 0x0202, 0x0202, 0x0203 }, -{ 0x0203, 0x0202, 0x0203 }, -{ 0x0204, 0x0204, 0x0205 }, -{ 0x0205, 0x0204, 0x0205 }, -{ 0x0206, 0x0206, 0x0207 }, -{ 0x0207, 0x0206, 0x0207 }, -{ 0x0208, 0x0208, 0x0209 }, -{ 0x0209, 0x0208, 0x0209 }, -{ 0x020A, 0x020A, 0x020B }, -{ 0x020B, 0x020A, 0x020B }, -{ 0x020C, 0x020C, 0x020D }, -{ 0x020D, 0x020C, 0x020D }, -{ 0x020E, 0x020E, 0x020F }, -{ 0x020F, 0x020E, 0x020F }, -{ 0x0210, 0x0210, 0x0211 }, -{ 0x0211, 0x0210, 0x0211 }, -{ 0x0212, 0x0212, 0x0213 }, -{ 0x0213, 0x0212, 0x0213 }, -{ 0x0214, 0x0214, 0x0215 }, -{ 0x0215, 0x0214, 0x0215 }, -{ 0x0216, 0x0216, 0x0217 }, -{ 0x0217, 0x0216, 0x0217 }, -{ 0x0218, 0x0218, 0x0219 }, -{ 0x0219, 0x0218, 0x0219 }, -{ 0x021A, 0x021A, 0x021B }, -{ 0x021B, 0x021A, 0x021B }, -{ 0x021C, 0x021C, 0x021D }, -{ 0x021D, 0x021C, 0x021D }, -{ 0x021E, 0x021E, 0x021F }, -{ 0x021F, 0x021E, 0x021F }, -{ 0x0220, 0x0220, 0x019E }, -{ 0x0221, 0x0221, 0x0221 }, -{ 0x0222, 0x0222, 0x0223 }, -{ 0x0223, 0x0222, 0x0223 }, -{ 0x0224, 0x0224, 0x0225 }, -{ 0x0225, 0x0224, 0x0225 }, -{ 0x0226, 0x0226, 0x0227 }, -{ 0x0227, 0x0226, 0x0227 }, -{ 0x0228, 0x0228, 0x0229 }, -{ 0x0229, 0x0228, 0x0229 }, -{ 0x022A, 0x022A, 0x022B }, -{ 0x022B, 0x022A, 0x022B }, -{ 0x022C, 0x022C, 0x022D }, -{ 0x022D, 0x022C, 0x022D }, -{ 0x022E, 0x022E, 0x022F }, -{ 0x022F, 0x022E, 0x022F }, -{ 0x0230, 0x0230, 0x0231 }, -{ 0x0231, 0x0230, 0x0231 }, -{ 0x0232, 0x0232, 0x0233 }, -{ 0x0233, 0x0232, 0x0233 }, -{ 0x0234, 0x0234, 0x0234 }, -{ 0x0235, 0x0235, 0x0235 }, -{ 0x0236, 0x0236, 0x0236 }, -{ 0x0237, 0x0237, 0x0237 }, -{ 0x0238, 0x0238, 0x0238 }, -{ 0x0239, 0x0239, 0x0239 }, -{ 0x023A, 0x023A, 0x023A }, -{ 0x023B, 0x023B, 0x023C }, -{ 0x023C, 0x023B, 0x023C }, -{ 0x023D, 0x023D, 0x019A }, -{ 0x023E, 0x023E, 0x023E }, -{ 0x023F, 0x023F, 0x023F }, -{ 0x0240, 0x0240, 0x0240 }, -{ 0x0241, 0x0241, 0x0294 }, -{ 0x0250, 0x0250, 0x0250 }, -{ 0x0251, 0x0251, 0x0251 }, -{ 0x0252, 0x0252, 0x0252 }, -{ 0x0253, 0x0181, 0x0253 }, -{ 0x0254, 0x0186, 0x0254 }, -{ 0x0255, 0x0255, 0x0255 }, -{ 0x0256, 0x0189, 0x0256 }, -{ 0x0257, 0x018A, 0x0257 }, -{ 0x0258, 0x0258, 0x0258 }, -{ 0x0259, 0x018F, 0x0259 }, -{ 0x025A, 0x025A, 0x025A }, -{ 0x025B, 0x0190, 0x025B }, -{ 0x025C, 0x025C, 0x025C }, -{ 0x025D, 0x025D, 0x025D }, -{ 0x025E, 0x025E, 0x025E }, -{ 0x025F, 0x025F, 0x025F }, -{ 0x0260, 0x0193, 0x0260 }, -{ 0x0261, 0x0261, 0x0261 }, -{ 0x0262, 0x0262, 0x0262 }, -{ 0x0263, 0x0194, 0x0263 }, -{ 0x0264, 0x0264, 0x0264 }, -{ 0x0265, 0x0265, 0x0265 }, -{ 0x0266, 0x0266, 0x0266 }, -{ 0x0267, 0x0267, 0x0267 }, -{ 0x0268, 0x0197, 0x0268 }, -{ 0x0269, 0x0196, 0x0269 }, -{ 0x026A, 0x026A, 0x026A }, -{ 0x026B, 0x026B, 0x026B }, -{ 0x026C, 0x026C, 0x026C }, -{ 0x026D, 0x026D, 0x026D }, -{ 0x026E, 0x026E, 0x026E }, -{ 0x026F, 0x019C, 0x026F }, -{ 0x0270, 0x0270, 0x0270 }, -{ 0x0271, 0x0271, 0x0271 }, -{ 0x0272, 0x019D, 0x0272 }, -{ 0x0273, 0x0273, 0x0273 }, -{ 0x0274, 0x0274, 0x0274 }, -{ 0x0275, 0x019F, 0x0275 }, -{ 0x0276, 0x0276, 0x0276 }, -{ 0x0277, 0x0277, 0x0277 }, -{ 0x0278, 0x0278, 0x0278 }, -{ 0x0279, 0x0279, 0x0279 }, -{ 0x027A, 0x027A, 0x027A }, -{ 0x027B, 0x027B, 0x027B }, -{ 0x027C, 0x027C, 0x027C }, -{ 0x027D, 0x027D, 0x027D }, -{ 0x027E, 0x027E, 0x027E }, -{ 0x027F, 0x027F, 0x027F }, -{ 0x0280, 0x01A6, 0x0280 }, -{ 0x0281, 0x0281, 0x0281 }, -{ 0x0282, 0x0282, 0x0282 }, -{ 0x0283, 0x01A9, 0x0283 }, -{ 0x0284, 0x0284, 0x0284 }, -{ 0x0285, 0x0285, 0x0285 }, -{ 0x0286, 0x0286, 0x0286 }, -{ 0x0287, 0x0287, 0x0287 }, -{ 0x0288, 0x01AE, 0x0288 }, -{ 0x0289, 0x0289, 0x0289 }, -{ 0x028A, 0x01B1, 0x028A }, -{ 0x028B, 0x01B2, 0x028B }, -{ 0x028C, 0x028C, 0x028C }, -{ 0x028D, 0x028D, 0x028D }, -{ 0x028E, 0x028E, 0x028E }, -{ 0x028F, 0x028F, 0x028F }, -{ 0x0290, 0x0290, 0x0290 }, -{ 0x0291, 0x0291, 0x0291 }, -{ 0x0292, 0x01B7, 0x0292 }, -{ 0x0293, 0x0293, 0x0293 }, -{ 0x0294, 0x0241, 0x0294 }, -{ 0x0295, 0x0295, 0x0295 }, -{ 0x0296, 0x0296, 0x0296 }, -{ 0x0297, 0x0297, 0x0297 }, -{ 0x0298, 0x0298, 0x0298 }, -{ 0x0299, 0x0299, 0x0299 }, -{ 0x029A, 0x029A, 0x029A }, -{ 0x029B, 0x029B, 0x029B }, -{ 0x029C, 0x029C, 0x029C }, -{ 0x029D, 0x029D, 0x029D }, -{ 0x029E, 0x029E, 0x029E }, -{ 0x029F, 0x029F, 0x029F }, -{ 0x02A0, 0x02A0, 0x02A0 }, -{ 0x02A1, 0x02A1, 0x02A1 }, -{ 0x02A2, 0x02A2, 0x02A2 }, -{ 0x02A3, 0x02A3, 0x02A3 }, -{ 0x02A4, 0x02A4, 0x02A4 }, -{ 0x02A5, 0x02A5, 0x02A5 }, -{ 0x02A6, 0x02A6, 0x02A6 }, -{ 0x02A7, 0x02A7, 0x02A7 }, -{ 0x02A8, 0x02A8, 0x02A8 }, -{ 0x02A9, 0x02A9, 0x02A9 }, -{ 0x02AA, 0x02AA, 0x02AA }, -{ 0x02AB, 0x02AB, 0x02AB }, -{ 0x02AC, 0x02AC, 0x02AC }, -{ 0x02AD, 0x02AD, 0x02AD }, -{ 0x02AE, 0x02AE, 0x02AE }, -{ 0x02AF, 0x02AF, 0x02AF }, -{ 0x02B0, 0x02B0, 0x02B0 }, -{ 0x02B1, 0x02B1, 0x02B1 }, -{ 0x02B2, 0x02B2, 0x02B2 }, -{ 0x02B3, 0x02B3, 0x02B3 }, -{ 0x02B4, 0x02B4, 0x02B4 }, -{ 0x02B5, 0x02B5, 0x02B5 }, -{ 0x02B6, 0x02B6, 0x02B6 }, -{ 0x02B7, 0x02B7, 0x02B7 }, -{ 0x02B8, 0x02B8, 0x02B8 }, -{ 0x02B9, 0x02B9, 0x02B9 }, -{ 0x02BA, 0x02BA, 0x02BA }, -{ 0x02BB, 0x02BB, 0x02BB }, -{ 0x02BC, 0x02BC, 0x02BC }, -{ 0x02BD, 0x02BD, 0x02BD }, -{ 0x02BE, 0x02BE, 0x02BE }, -{ 0x02BF, 0x02BF, 0x02BF }, -{ 0x02C0, 0x02C0, 0x02C0 }, -{ 0x02C1, 0x02C1, 0x02C1 }, -{ 0x02C6, 0x02C6, 0x02C6 }, -{ 0x02C7, 0x02C7, 0x02C7 }, -{ 0x02C8, 0x02C8, 0x02C8 }, -{ 0x02C9, 0x02C9, 0x02C9 }, -{ 0x02CA, 0x02CA, 0x02CA }, -{ 0x02CB, 0x02CB, 0x02CB }, -{ 0x02CC, 0x02CC, 0x02CC }, -{ 0x02CD, 0x02CD, 0x02CD }, -{ 0x02CE, 0x02CE, 0x02CE }, -{ 0x02CF, 0x02CF, 0x02CF }, -{ 0x02D0, 0x02D0, 0x02D0 }, -{ 0x02D1, 0x02D1, 0x02D1 }, -{ 0x02E0, 0x02E0, 0x02E0 }, -{ 0x02E1, 0x02E1, 0x02E1 }, -{ 0x02E2, 0x02E2, 0x02E2 }, -{ 0x02E3, 0x02E3, 0x02E3 }, -{ 0x02E4, 0x02E4, 0x02E4 }, -{ 0x02EE, 0x02EE, 0x02EE }, -{ 0x0300, 0x0300, 0x0300 }, -{ 0x0301, 0x0301, 0x0301 }, -{ 0x0302, 0x0302, 0x0302 }, -{ 0x0303, 0x0303, 0x0303 }, -{ 0x0304, 0x0304, 0x0304 }, -{ 0x0305, 0x0305, 0x0305 }, -{ 0x0306, 0x0306, 0x0306 }, -{ 0x0307, 0x0307, 0x0307 }, -{ 0x0308, 0x0308, 0x0308 }, -{ 0x0309, 0x0309, 0x0309 }, -{ 0x030A, 0x030A, 0x030A }, -{ 0x030B, 0x030B, 0x030B }, -{ 0x030C, 0x030C, 0x030C }, -{ 0x030D, 0x030D, 0x030D }, -{ 0x030E, 0x030E, 0x030E }, -{ 0x030F, 0x030F, 0x030F }, -{ 0x0310, 0x0310, 0x0310 }, -{ 0x0311, 0x0311, 0x0311 }, -{ 0x0312, 0x0312, 0x0312 }, -{ 0x0313, 0x0313, 0x0313 }, -{ 0x0314, 0x0314, 0x0314 }, -{ 0x0315, 0x0315, 0x0315 }, -{ 0x0316, 0x0316, 0x0316 }, -{ 0x0317, 0x0317, 0x0317 }, -{ 0x0318, 0x0318, 0x0318 }, -{ 0x0319, 0x0319, 0x0319 }, -{ 0x031A, 0x031A, 0x031A }, -{ 0x031B, 0x031B, 0x031B }, -{ 0x031C, 0x031C, 0x031C }, -{ 0x031D, 0x031D, 0x031D }, -{ 0x031E, 0x031E, 0x031E }, -{ 0x031F, 0x031F, 0x031F }, -{ 0x0320, 0x0320, 0x0320 }, -{ 0x0321, 0x0321, 0x0321 }, -{ 0x0322, 0x0322, 0x0322 }, -{ 0x0323, 0x0323, 0x0323 }, -{ 0x0324, 0x0324, 0x0324 }, -{ 0x0325, 0x0325, 0x0325 }, -{ 0x0326, 0x0326, 0x0326 }, -{ 0x0327, 0x0327, 0x0327 }, -{ 0x0328, 0x0328, 0x0328 }, -{ 0x0329, 0x0329, 0x0329 }, -{ 0x032A, 0x032A, 0x032A }, -{ 0x032B, 0x032B, 0x032B }, -{ 0x032C, 0x032C, 0x032C }, -{ 0x032D, 0x032D, 0x032D }, -{ 0x032E, 0x032E, 0x032E }, -{ 0x032F, 0x032F, 0x032F }, -{ 0x0330, 0x0330, 0x0330 }, -{ 0x0331, 0x0331, 0x0331 }, -{ 0x0332, 0x0332, 0x0332 }, -{ 0x0333, 0x0333, 0x0333 }, -{ 0x0334, 0x0334, 0x0334 }, -{ 0x0335, 0x0335, 0x0335 }, -{ 0x0336, 0x0336, 0x0336 }, -{ 0x0337, 0x0337, 0x0337 }, -{ 0x0338, 0x0338, 0x0338 }, -{ 0x0339, 0x0339, 0x0339 }, -{ 0x033A, 0x033A, 0x033A }, -{ 0x033B, 0x033B, 0x033B }, -{ 0x033C, 0x033C, 0x033C }, -{ 0x033D, 0x033D, 0x033D }, -{ 0x033E, 0x033E, 0x033E }, -{ 0x033F, 0x033F, 0x033F }, -{ 0x0340, 0x0340, 0x0340 }, -{ 0x0341, 0x0341, 0x0341 }, -{ 0x0342, 0x0342, 0x0342 }, -{ 0x0343, 0x0343, 0x0343 }, -{ 0x0344, 0x0344, 0x0344 }, -{ 0x0345, 0x0399, 0x0345 }, -{ 0x0346, 0x0346, 0x0346 }, -{ 0x0347, 0x0347, 0x0347 }, -{ 0x0348, 0x0348, 0x0348 }, -{ 0x0349, 0x0349, 0x0349 }, -{ 0x034A, 0x034A, 0x034A }, -{ 0x034B, 0x034B, 0x034B }, -{ 0x034C, 0x034C, 0x034C }, -{ 0x034D, 0x034D, 0x034D }, -{ 0x034E, 0x034E, 0x034E }, -{ 0x034F, 0x034F, 0x034F }, -{ 0x0350, 0x0350, 0x0350 }, -{ 0x0351, 0x0351, 0x0351 }, -{ 0x0352, 0x0352, 0x0352 }, -{ 0x0353, 0x0353, 0x0353 }, -{ 0x0354, 0x0354, 0x0354 }, -{ 0x0355, 0x0355, 0x0355 }, -{ 0x0356, 0x0356, 0x0356 }, -{ 0x0357, 0x0357, 0x0357 }, -{ 0x0358, 0x0358, 0x0358 }, -{ 0x0359, 0x0359, 0x0359 }, -{ 0x035A, 0x035A, 0x035A }, -{ 0x035B, 0x035B, 0x035B }, -{ 0x035C, 0x035C, 0x035C }, -{ 0x035D, 0x035D, 0x035D }, -{ 0x035E, 0x035E, 0x035E }, -{ 0x035F, 0x035F, 0x035F }, -{ 0x0360, 0x0360, 0x0360 }, -{ 0x0361, 0x0361, 0x0361 }, -{ 0x0362, 0x0362, 0x0362 }, -{ 0x0363, 0x0363, 0x0363 }, -{ 0x0364, 0x0364, 0x0364 }, -{ 0x0365, 0x0365, 0x0365 }, -{ 0x0366, 0x0366, 0x0366 }, -{ 0x0367, 0x0367, 0x0367 }, -{ 0x0368, 0x0368, 0x0368 }, -{ 0x0369, 0x0369, 0x0369 }, -{ 0x036A, 0x036A, 0x036A }, -{ 0x036B, 0x036B, 0x036B }, -{ 0x036C, 0x036C, 0x036C }, -{ 0x036D, 0x036D, 0x036D }, -{ 0x036E, 0x036E, 0x036E }, -{ 0x036F, 0x036F, 0x036F }, -{ 0x037A, 0x037A, 0x037A }, -{ 0x0386, 0x0386, 0x03AC }, -{ 0x0388, 0x0388, 0x03AD }, -{ 0x0389, 0x0389, 0x03AE }, -{ 0x038A, 0x038A, 0x03AF }, -{ 0x038C, 0x038C, 0x03CC }, -{ 0x038E, 0x038E, 0x03CD }, -{ 0x038F, 0x038F, 0x03CE }, -{ 0x0390, 0x0390, 0x0390 }, -{ 0x0391, 0x0391, 0x03B1 }, -{ 0x0392, 0x0392, 0x03B2 }, -{ 0x0393, 0x0393, 0x03B3 }, -{ 0x0394, 0x0394, 0x03B4 }, -{ 0x0395, 0x0395, 0x03B5 }, -{ 0x0396, 0x0396, 0x03B6 }, -{ 0x0397, 0x0397, 0x03B7 }, -{ 0x0398, 0x0398, 0x03B8 }, -{ 0x0399, 0x0399, 0x03B9 }, -{ 0x039A, 0x039A, 0x03BA }, -{ 0x039B, 0x039B, 0x03BB }, -{ 0x039C, 0x039C, 0x03BC }, -{ 0x039D, 0x039D, 0x03BD }, -{ 0x039E, 0x039E, 0x03BE }, -{ 0x039F, 0x039F, 0x03BF }, -{ 0x03A0, 0x03A0, 0x03C0 }, -{ 0x03A1, 0x03A1, 0x03C1 }, -{ 0x03A3, 0x03A3, 0x03C3 }, -{ 0x03A4, 0x03A4, 0x03C4 }, -{ 0x03A5, 0x03A5, 0x03C5 }, -{ 0x03A6, 0x03A6, 0x03C6 }, -{ 0x03A7, 0x03A7, 0x03C7 }, -{ 0x03A8, 0x03A8, 0x03C8 }, -{ 0x03A9, 0x03A9, 0x03C9 }, -{ 0x03AA, 0x03AA, 0x03CA }, -{ 0x03AB, 0x03AB, 0x03CB }, -{ 0x03AC, 0x0386, 0x03AC }, -{ 0x03AD, 0x0388, 0x03AD }, -{ 0x03AE, 0x0389, 0x03AE }, -{ 0x03AF, 0x038A, 0x03AF }, -{ 0x03B0, 0x03B0, 0x03B0 }, -{ 0x03B1, 0x0391, 0x03B1 }, -{ 0x03B2, 0x0392, 0x03B2 }, -{ 0x03B3, 0x0393, 0x03B3 }, -{ 0x03B4, 0x0394, 0x03B4 }, -{ 0x03B5, 0x0395, 0x03B5 }, -{ 0x03B6, 0x0396, 0x03B6 }, -{ 0x03B7, 0x0397, 0x03B7 }, -{ 0x03B8, 0x0398, 0x03B8 }, -{ 0x03B9, 0x0399, 0x03B9 }, -{ 0x03BA, 0x039A, 0x03BA }, -{ 0x03BB, 0x039B, 0x03BB }, -{ 0x03BC, 0x039C, 0x03BC }, -{ 0x03BD, 0x039D, 0x03BD }, -{ 0x03BE, 0x039E, 0x03BE }, -{ 0x03BF, 0x039F, 0x03BF }, -{ 0x03C0, 0x03A0, 0x03C0 }, -{ 0x03C1, 0x03A1, 0x03C1 }, -{ 0x03C2, 0x03A3, 0x03C2 }, -{ 0x03C3, 0x03A3, 0x03C3 }, -{ 0x03C4, 0x03A4, 0x03C4 }, -{ 0x03C5, 0x03A5, 0x03C5 }, -{ 0x03C6, 0x03A6, 0x03C6 }, -{ 0x03C7, 0x03A7, 0x03C7 }, -{ 0x03C8, 0x03A8, 0x03C8 }, -{ 0x03C9, 0x03A9, 0x03C9 }, -{ 0x03CA, 0x03AA, 0x03CA }, -{ 0x03CB, 0x03AB, 0x03CB }, -{ 0x03CC, 0x038C, 0x03CC }, -{ 0x03CD, 0x038E, 0x03CD }, -{ 0x03CE, 0x038F, 0x03CE }, -{ 0x03D0, 0x0392, 0x03D0 }, -{ 0x03D1, 0x0398, 0x03D1 }, -{ 0x03D2, 0x03D2, 0x03D2 }, -{ 0x03D3, 0x03D3, 0x03D3 }, -{ 0x03D4, 0x03D4, 0x03D4 }, -{ 0x03D5, 0x03A6, 0x03D5 }, -{ 0x03D6, 0x03A0, 0x03D6 }, -{ 0x03D7, 0x03D7, 0x03D7 }, -{ 0x03D8, 0x03D8, 0x03D9 }, -{ 0x03D9, 0x03D8, 0x03D9 }, -{ 0x03DA, 0x03DA, 0x03DB }, -{ 0x03DB, 0x03DA, 0x03DB }, -{ 0x03DC, 0x03DC, 0x03DD }, -{ 0x03DD, 0x03DC, 0x03DD }, -{ 0x03DE, 0x03DE, 0x03DF }, -{ 0x03DF, 0x03DE, 0x03DF }, -{ 0x03E0, 0x03E0, 0x03E1 }, -{ 0x03E1, 0x03E0, 0x03E1 }, -{ 0x03E2, 0x03E2, 0x03E3 }, -{ 0x03E3, 0x03E2, 0x03E3 }, -{ 0x03E4, 0x03E4, 0x03E5 }, -{ 0x03E5, 0x03E4, 0x03E5 }, -{ 0x03E6, 0x03E6, 0x03E7 }, -{ 0x03E7, 0x03E6, 0x03E7 }, -{ 0x03E8, 0x03E8, 0x03E9 }, -{ 0x03E9, 0x03E8, 0x03E9 }, -{ 0x03EA, 0x03EA, 0x03EB }, -{ 0x03EB, 0x03EA, 0x03EB }, -{ 0x03EC, 0x03EC, 0x03ED }, -{ 0x03ED, 0x03EC, 0x03ED }, -{ 0x03EE, 0x03EE, 0x03EF }, -{ 0x03EF, 0x03EE, 0x03EF }, -{ 0x03F0, 0x039A, 0x03F0 }, -{ 0x03F1, 0x03A1, 0x03F1 }, -{ 0x03F2, 0x03F9, 0x03F2 }, -{ 0x03F3, 0x03F3, 0x03F3 }, -{ 0x03F4, 0x03F4, 0x03B8 }, -{ 0x03F5, 0x0395, 0x03F5 }, -{ 0x03F7, 0x03F7, 0x03F8 }, -{ 0x03F8, 0x03F7, 0x03F8 }, -{ 0x03F9, 0x03F9, 0x03F2 }, -{ 0x03FA, 0x03FA, 0x03FB }, -{ 0x03FB, 0x03FA, 0x03FB }, -{ 0x03FC, 0x03FC, 0x03FC }, -{ 0x03FD, 0x03FD, 0x03FD }, -{ 0x03FE, 0x03FE, 0x03FE }, -{ 0x03FF, 0x03FF, 0x03FF }, -{ 0x0400, 0x0400, 0x0450 }, -{ 0x0401, 0x0401, 0x0451 }, -{ 0x0402, 0x0402, 0x0452 }, -{ 0x0403, 0x0403, 0x0453 }, -{ 0x0404, 0x0404, 0x0454 }, -{ 0x0405, 0x0405, 0x0455 }, -{ 0x0406, 0x0406, 0x0456 }, -{ 0x0407, 0x0407, 0x0457 }, -{ 0x0408, 0x0408, 0x0458 }, -{ 0x0409, 0x0409, 0x0459 }, -{ 0x040A, 0x040A, 0x045A }, -{ 0x040B, 0x040B, 0x045B }, -{ 0x040C, 0x040C, 0x045C }, -{ 0x040D, 0x040D, 0x045D }, -{ 0x040E, 0x040E, 0x045E }, -{ 0x040F, 0x040F, 0x045F }, -{ 0x0410, 0x0410, 0x0430 }, -{ 0x0411, 0x0411, 0x0431 }, -{ 0x0412, 0x0412, 0x0432 }, -{ 0x0413, 0x0413, 0x0433 }, -{ 0x0414, 0x0414, 0x0434 }, -{ 0x0415, 0x0415, 0x0435 }, -{ 0x0416, 0x0416, 0x0436 }, -{ 0x0417, 0x0417, 0x0437 }, -{ 0x0418, 0x0418, 0x0438 }, -{ 0x0419, 0x0419, 0x0439 }, -{ 0x041A, 0x041A, 0x043A }, -{ 0x041B, 0x041B, 0x043B }, -{ 0x041C, 0x041C, 0x043C }, -{ 0x041D, 0x041D, 0x043D }, -{ 0x041E, 0x041E, 0x043E }, -{ 0x041F, 0x041F, 0x043F }, -{ 0x0420, 0x0420, 0x0440 }, -{ 0x0421, 0x0421, 0x0441 }, -{ 0x0422, 0x0422, 0x0442 }, -{ 0x0423, 0x0423, 0x0443 }, -{ 0x0424, 0x0424, 0x0444 }, -{ 0x0425, 0x0425, 0x0445 }, -{ 0x0426, 0x0426, 0x0446 }, -{ 0x0427, 0x0427, 0x0447 }, -{ 0x0428, 0x0428, 0x0448 }, -{ 0x0429, 0x0429, 0x0449 }, -{ 0x042A, 0x042A, 0x044A }, -{ 0x042B, 0x042B, 0x044B }, -{ 0x042C, 0x042C, 0x044C }, -{ 0x042D, 0x042D, 0x044D }, -{ 0x042E, 0x042E, 0x044E }, -{ 0x042F, 0x042F, 0x044F }, -{ 0x0430, 0x0410, 0x0430 }, -{ 0x0431, 0x0411, 0x0431 }, -{ 0x0432, 0x0412, 0x0432 }, -{ 0x0433, 0x0413, 0x0433 }, -{ 0x0434, 0x0414, 0x0434 }, -{ 0x0435, 0x0415, 0x0435 }, -{ 0x0436, 0x0416, 0x0436 }, -{ 0x0437, 0x0417, 0x0437 }, -{ 0x0438, 0x0418, 0x0438 }, -{ 0x0439, 0x0419, 0x0439 }, -{ 0x043A, 0x041A, 0x043A }, -{ 0x043B, 0x041B, 0x043B }, -{ 0x043C, 0x041C, 0x043C }, -{ 0x043D, 0x041D, 0x043D }, -{ 0x043E, 0x041E, 0x043E }, -{ 0x043F, 0x041F, 0x043F }, -{ 0x0440, 0x0420, 0x0440 }, -{ 0x0441, 0x0421, 0x0441 }, -{ 0x0442, 0x0422, 0x0442 }, -{ 0x0443, 0x0423, 0x0443 }, -{ 0x0444, 0x0424, 0x0444 }, -{ 0x0445, 0x0425, 0x0445 }, -{ 0x0446, 0x0426, 0x0446 }, -{ 0x0447, 0x0427, 0x0447 }, -{ 0x0448, 0x0428, 0x0448 }, -{ 0x0449, 0x0429, 0x0449 }, -{ 0x044A, 0x042A, 0x044A }, -{ 0x044B, 0x042B, 0x044B }, -{ 0x044C, 0x042C, 0x044C }, -{ 0x044D, 0x042D, 0x044D }, -{ 0x044E, 0x042E, 0x044E }, -{ 0x044F, 0x042F, 0x044F }, -{ 0x0450, 0x0400, 0x0450 }, -{ 0x0451, 0x0401, 0x0451 }, -{ 0x0452, 0x0402, 0x0452 }, -{ 0x0453, 0x0403, 0x0453 }, -{ 0x0454, 0x0404, 0x0454 }, -{ 0x0455, 0x0405, 0x0455 }, -{ 0x0456, 0x0406, 0x0456 }, -{ 0x0457, 0x0407, 0x0457 }, -{ 0x0458, 0x0408, 0x0458 }, -{ 0x0459, 0x0409, 0x0459 }, -{ 0x045A, 0x040A, 0x045A }, -{ 0x045B, 0x040B, 0x045B }, -{ 0x045C, 0x040C, 0x045C }, -{ 0x045D, 0x040D, 0x045D }, -{ 0x045E, 0x040E, 0x045E }, -{ 0x045F, 0x040F, 0x045F }, -{ 0x0460, 0x0460, 0x0461 }, -{ 0x0461, 0x0460, 0x0461 }, -{ 0x0462, 0x0462, 0x0463 }, -{ 0x0463, 0x0462, 0x0463 }, -{ 0x0464, 0x0464, 0x0465 }, -{ 0x0465, 0x0464, 0x0465 }, -{ 0x0466, 0x0466, 0x0467 }, -{ 0x0467, 0x0466, 0x0467 }, -{ 0x0468, 0x0468, 0x0469 }, -{ 0x0469, 0x0468, 0x0469 }, -{ 0x046A, 0x046A, 0x046B }, -{ 0x046B, 0x046A, 0x046B }, -{ 0x046C, 0x046C, 0x046D }, -{ 0x046D, 0x046C, 0x046D }, -{ 0x046E, 0x046E, 0x046F }, -{ 0x046F, 0x046E, 0x046F }, -{ 0x0470, 0x0470, 0x0471 }, -{ 0x0471, 0x0470, 0x0471 }, -{ 0x0472, 0x0472, 0x0473 }, -{ 0x0473, 0x0472, 0x0473 }, -{ 0x0474, 0x0474, 0x0475 }, -{ 0x0475, 0x0474, 0x0475 }, -{ 0x0476, 0x0476, 0x0477 }, -{ 0x0477, 0x0476, 0x0477 }, -{ 0x0478, 0x0478, 0x0479 }, -{ 0x0479, 0x0478, 0x0479 }, -{ 0x047A, 0x047A, 0x047B }, -{ 0x047B, 0x047A, 0x047B }, -{ 0x047C, 0x047C, 0x047D }, -{ 0x047D, 0x047C, 0x047D }, -{ 0x047E, 0x047E, 0x047F }, -{ 0x047F, 0x047E, 0x047F }, -{ 0x0480, 0x0480, 0x0481 }, -{ 0x0481, 0x0480, 0x0481 }, -{ 0x0483, 0x0483, 0x0483 }, -{ 0x0484, 0x0484, 0x0484 }, -{ 0x0485, 0x0485, 0x0485 }, -{ 0x0486, 0x0486, 0x0486 }, -{ 0x048A, 0x048A, 0x048B }, -{ 0x048B, 0x048A, 0x048B }, -{ 0x048C, 0x048C, 0x048D }, -{ 0x048D, 0x048C, 0x048D }, -{ 0x048E, 0x048E, 0x048F }, -{ 0x048F, 0x048E, 0x048F }, -{ 0x0490, 0x0490, 0x0491 }, -{ 0x0491, 0x0490, 0x0491 }, -{ 0x0492, 0x0492, 0x0493 }, -{ 0x0493, 0x0492, 0x0493 }, -{ 0x0494, 0x0494, 0x0495 }, -{ 0x0495, 0x0494, 0x0495 }, -{ 0x0496, 0x0496, 0x0497 }, -{ 0x0497, 0x0496, 0x0497 }, -{ 0x0498, 0x0498, 0x0499 }, -{ 0x0499, 0x0498, 0x0499 }, -{ 0x049A, 0x049A, 0x049B }, -{ 0x049B, 0x049A, 0x049B }, -{ 0x049C, 0x049C, 0x049D }, -{ 0x049D, 0x049C, 0x049D }, -{ 0x049E, 0x049E, 0x049F }, -{ 0x049F, 0x049E, 0x049F }, -{ 0x04A0, 0x04A0, 0x04A1 }, -{ 0x04A1, 0x04A0, 0x04A1 }, -{ 0x04A2, 0x04A2, 0x04A3 }, -{ 0x04A3, 0x04A2, 0x04A3 }, -{ 0x04A4, 0x04A4, 0x04A5 }, -{ 0x04A5, 0x04A4, 0x04A5 }, -{ 0x04A6, 0x04A6, 0x04A7 }, -{ 0x04A7, 0x04A6, 0x04A7 }, -{ 0x04A8, 0x04A8, 0x04A9 }, -{ 0x04A9, 0x04A8, 0x04A9 }, -{ 0x04AA, 0x04AA, 0x04AB }, -{ 0x04AB, 0x04AA, 0x04AB }, -{ 0x04AC, 0x04AC, 0x04AD }, -{ 0x04AD, 0x04AC, 0x04AD }, -{ 0x04AE, 0x04AE, 0x04AF }, -{ 0x04AF, 0x04AE, 0x04AF }, -{ 0x04B0, 0x04B0, 0x04B1 }, -{ 0x04B1, 0x04B0, 0x04B1 }, -{ 0x04B2, 0x04B2, 0x04B3 }, -{ 0x04B3, 0x04B2, 0x04B3 }, -{ 0x04B4, 0x04B4, 0x04B5 }, -{ 0x04B5, 0x04B4, 0x04B5 }, -{ 0x04B6, 0x04B6, 0x04B7 }, -{ 0x04B7, 0x04B6, 0x04B7 }, -{ 0x04B8, 0x04B8, 0x04B9 }, -{ 0x04B9, 0x04B8, 0x04B9 }, -{ 0x04BA, 0x04BA, 0x04BB }, -{ 0x04BB, 0x04BA, 0x04BB }, -{ 0x04BC, 0x04BC, 0x04BD }, -{ 0x04BD, 0x04BC, 0x04BD }, -{ 0x04BE, 0x04BE, 0x04BF }, -{ 0x04BF, 0x04BE, 0x04BF }, -{ 0x04C0, 0x04C0, 0x04C0 }, -{ 0x04C1, 0x04C1, 0x04C2 }, -{ 0x04C2, 0x04C1, 0x04C2 }, -{ 0x04C3, 0x04C3, 0x04C4 }, -{ 0x04C4, 0x04C3, 0x04C4 }, -{ 0x04C5, 0x04C5, 0x04C6 }, -{ 0x04C6, 0x04C5, 0x04C6 }, -{ 0x04C7, 0x04C7, 0x04C8 }, -{ 0x04C8, 0x04C7, 0x04C8 }, -{ 0x04C9, 0x04C9, 0x04CA }, -{ 0x04CA, 0x04C9, 0x04CA }, -{ 0x04CB, 0x04CB, 0x04CC }, -{ 0x04CC, 0x04CB, 0x04CC }, -{ 0x04CD, 0x04CD, 0x04CE }, -{ 0x04CE, 0x04CD, 0x04CE }, -{ 0x04D0, 0x04D0, 0x04D1 }, -{ 0x04D1, 0x04D0, 0x04D1 }, -{ 0x04D2, 0x04D2, 0x04D3 }, -{ 0x04D3, 0x04D2, 0x04D3 }, -{ 0x04D4, 0x04D4, 0x04D5 }, -{ 0x04D5, 0x04D4, 0x04D5 }, -{ 0x04D6, 0x04D6, 0x04D7 }, -{ 0x04D7, 0x04D6, 0x04D7 }, -{ 0x04D8, 0x04D8, 0x04D9 }, -{ 0x04D9, 0x04D8, 0x04D9 }, -{ 0x04DA, 0x04DA, 0x04DB }, -{ 0x04DB, 0x04DA, 0x04DB }, -{ 0x04DC, 0x04DC, 0x04DD }, -{ 0x04DD, 0x04DC, 0x04DD }, -{ 0x04DE, 0x04DE, 0x04DF }, -{ 0x04DF, 0x04DE, 0x04DF }, -{ 0x04E0, 0x04E0, 0x04E1 }, -{ 0x04E1, 0x04E0, 0x04E1 }, -{ 0x04E2, 0x04E2, 0x04E3 }, -{ 0x04E3, 0x04E2, 0x04E3 }, -{ 0x04E4, 0x04E4, 0x04E5 }, -{ 0x04E5, 0x04E4, 0x04E5 }, -{ 0x04E6, 0x04E6, 0x04E7 }, -{ 0x04E7, 0x04E6, 0x04E7 }, -{ 0x04E8, 0x04E8, 0x04E9 }, -{ 0x04E9, 0x04E8, 0x04E9 }, -{ 0x04EA, 0x04EA, 0x04EB }, -{ 0x04EB, 0x04EA, 0x04EB }, -{ 0x04EC, 0x04EC, 0x04ED }, -{ 0x04ED, 0x04EC, 0x04ED }, -{ 0x04EE, 0x04EE, 0x04EF }, -{ 0x04EF, 0x04EE, 0x04EF }, -{ 0x04F0, 0x04F0, 0x04F1 }, -{ 0x04F1, 0x04F0, 0x04F1 }, -{ 0x04F2, 0x04F2, 0x04F3 }, -{ 0x04F3, 0x04F2, 0x04F3 }, -{ 0x04F4, 0x04F4, 0x04F5 }, -{ 0x04F5, 0x04F4, 0x04F5 }, -{ 0x04F6, 0x04F6, 0x04F7 }, -{ 0x04F7, 0x04F6, 0x04F7 }, -{ 0x04F8, 0x04F8, 0x04F9 }, -{ 0x04F9, 0x04F8, 0x04F9 }, -{ 0x0500, 0x0500, 0x0501 }, -{ 0x0501, 0x0500, 0x0501 }, -{ 0x0502, 0x0502, 0x0503 }, -{ 0x0503, 0x0502, 0x0503 }, -{ 0x0504, 0x0504, 0x0505 }, -{ 0x0505, 0x0504, 0x0505 }, -{ 0x0506, 0x0506, 0x0507 }, -{ 0x0507, 0x0506, 0x0507 }, -{ 0x0508, 0x0508, 0x0509 }, -{ 0x0509, 0x0508, 0x0509 }, -{ 0x050A, 0x050A, 0x050B }, -{ 0x050B, 0x050A, 0x050B }, -{ 0x050C, 0x050C, 0x050D }, -{ 0x050D, 0x050C, 0x050D }, -{ 0x050E, 0x050E, 0x050F }, -{ 0x050F, 0x050E, 0x050F }, -{ 0x0531, 0x0531, 0x0561 }, -{ 0x0532, 0x0532, 0x0562 }, -{ 0x0533, 0x0533, 0x0563 }, -{ 0x0534, 0x0534, 0x0564 }, -{ 0x0535, 0x0535, 0x0565 }, -{ 0x0536, 0x0536, 0x0566 }, -{ 0x0537, 0x0537, 0x0567 }, -{ 0x0538, 0x0538, 0x0568 }, -{ 0x0539, 0x0539, 0x0569 }, -{ 0x053A, 0x053A, 0x056A }, -{ 0x053B, 0x053B, 0x056B }, -{ 0x053C, 0x053C, 0x056C }, -{ 0x053D, 0x053D, 0x056D }, -{ 0x053E, 0x053E, 0x056E }, -{ 0x053F, 0x053F, 0x056F }, -{ 0x0540, 0x0540, 0x0570 }, -{ 0x0541, 0x0541, 0x0571 }, -{ 0x0542, 0x0542, 0x0572 }, -{ 0x0543, 0x0543, 0x0573 }, -{ 0x0544, 0x0544, 0x0574 }, -{ 0x0545, 0x0545, 0x0575 }, -{ 0x0546, 0x0546, 0x0576 }, -{ 0x0547, 0x0547, 0x0577 }, -{ 0x0548, 0x0548, 0x0578 }, -{ 0x0549, 0x0549, 0x0579 }, -{ 0x054A, 0x054A, 0x057A }, -{ 0x054B, 0x054B, 0x057B }, -{ 0x054C, 0x054C, 0x057C }, -{ 0x054D, 0x054D, 0x057D }, -{ 0x054E, 0x054E, 0x057E }, -{ 0x054F, 0x054F, 0x057F }, -{ 0x0550, 0x0550, 0x0580 }, -{ 0x0551, 0x0551, 0x0581 }, -{ 0x0552, 0x0552, 0x0582 }, -{ 0x0553, 0x0553, 0x0583 }, -{ 0x0554, 0x0554, 0x0584 }, -{ 0x0555, 0x0555, 0x0585 }, -{ 0x0556, 0x0556, 0x0586 }, -{ 0x0559, 0x0559, 0x0559 }, -{ 0x0561, 0x0531, 0x0561 }, -{ 0x0562, 0x0532, 0x0562 }, -{ 0x0563, 0x0533, 0x0563 }, -{ 0x0564, 0x0534, 0x0564 }, -{ 0x0565, 0x0535, 0x0565 }, -{ 0x0566, 0x0536, 0x0566 }, -{ 0x0567, 0x0537, 0x0567 }, -{ 0x0568, 0x0538, 0x0568 }, -{ 0x0569, 0x0539, 0x0569 }, -{ 0x056A, 0x053A, 0x056A }, -{ 0x056B, 0x053B, 0x056B }, -{ 0x056C, 0x053C, 0x056C }, -{ 0x056D, 0x053D, 0x056D }, -{ 0x056E, 0x053E, 0x056E }, -{ 0x056F, 0x053F, 0x056F }, -{ 0x0570, 0x0540, 0x0570 }, -{ 0x0571, 0x0541, 0x0571 }, -{ 0x0572, 0x0542, 0x0572 }, -{ 0x0573, 0x0543, 0x0573 }, -{ 0x0574, 0x0544, 0x0574 }, -{ 0x0575, 0x0545, 0x0575 }, -{ 0x0576, 0x0546, 0x0576 }, -{ 0x0577, 0x0547, 0x0577 }, -{ 0x0578, 0x0548, 0x0578 }, -{ 0x0579, 0x0549, 0x0579 }, -{ 0x057A, 0x054A, 0x057A }, -{ 0x057B, 0x054B, 0x057B }, -{ 0x057C, 0x054C, 0x057C }, -{ 0x057D, 0x054D, 0x057D }, -{ 0x057E, 0x054E, 0x057E }, -{ 0x057F, 0x054F, 0x057F }, -{ 0x0580, 0x0550, 0x0580 }, -{ 0x0581, 0x0551, 0x0581 }, -{ 0x0582, 0x0552, 0x0582 }, -{ 0x0583, 0x0553, 0x0583 }, -{ 0x0584, 0x0554, 0x0584 }, -{ 0x0585, 0x0555, 0x0585 }, -{ 0x0586, 0x0556, 0x0586 }, -{ 0x0587, 0x0587, 0x0587 }, -{ 0x0591, 0x0591, 0x0591 }, -{ 0x0592, 0x0592, 0x0592 }, -{ 0x0593, 0x0593, 0x0593 }, -{ 0x0594, 0x0594, 0x0594 }, -{ 0x0595, 0x0595, 0x0595 }, -{ 0x0596, 0x0596, 0x0596 }, -{ 0x0597, 0x0597, 0x0597 }, -{ 0x0598, 0x0598, 0x0598 }, -{ 0x0599, 0x0599, 0x0599 }, -{ 0x059A, 0x059A, 0x059A }, -{ 0x059B, 0x059B, 0x059B }, -{ 0x059C, 0x059C, 0x059C }, -{ 0x059D, 0x059D, 0x059D }, -{ 0x059E, 0x059E, 0x059E }, -{ 0x059F, 0x059F, 0x059F }, -{ 0x05A0, 0x05A0, 0x05A0 }, -{ 0x05A1, 0x05A1, 0x05A1 }, -{ 0x05A2, 0x05A2, 0x05A2 }, -{ 0x05A3, 0x05A3, 0x05A3 }, -{ 0x05A4, 0x05A4, 0x05A4 }, -{ 0x05A5, 0x05A5, 0x05A5 }, -{ 0x05A6, 0x05A6, 0x05A6 }, -{ 0x05A7, 0x05A7, 0x05A7 }, -{ 0x05A8, 0x05A8, 0x05A8 }, -{ 0x05A9, 0x05A9, 0x05A9 }, -{ 0x05AA, 0x05AA, 0x05AA }, -{ 0x05AB, 0x05AB, 0x05AB }, -{ 0x05AC, 0x05AC, 0x05AC }, -{ 0x05AD, 0x05AD, 0x05AD }, -{ 0x05AE, 0x05AE, 0x05AE }, -{ 0x05AF, 0x05AF, 0x05AF }, -{ 0x05B0, 0x05B0, 0x05B0 }, -{ 0x05B1, 0x05B1, 0x05B1 }, -{ 0x05B2, 0x05B2, 0x05B2 }, -{ 0x05B3, 0x05B3, 0x05B3 }, -{ 0x05B4, 0x05B4, 0x05B4 }, -{ 0x05B5, 0x05B5, 0x05B5 }, -{ 0x05B6, 0x05B6, 0x05B6 }, -{ 0x05B7, 0x05B7, 0x05B7 }, -{ 0x05B8, 0x05B8, 0x05B8 }, -{ 0x05B9, 0x05B9, 0x05B9 }, -{ 0x05BB, 0x05BB, 0x05BB }, -{ 0x05BC, 0x05BC, 0x05BC }, -{ 0x05BD, 0x05BD, 0x05BD }, -{ 0x05BF, 0x05BF, 0x05BF }, -{ 0x05C1, 0x05C1, 0x05C1 }, -{ 0x05C2, 0x05C2, 0x05C2 }, -{ 0x05C4, 0x05C4, 0x05C4 }, -{ 0x05C5, 0x05C5, 0x05C5 }, -{ 0x05C7, 0x05C7, 0x05C7 }, -{ 0x05D0, 0x05D0, 0x05D0 }, -{ 0x05D1, 0x05D1, 0x05D1 }, -{ 0x05D2, 0x05D2, 0x05D2 }, -{ 0x05D3, 0x05D3, 0x05D3 }, -{ 0x05D4, 0x05D4, 0x05D4 }, -{ 0x05D5, 0x05D5, 0x05D5 }, -{ 0x05D6, 0x05D6, 0x05D6 }, -{ 0x05D7, 0x05D7, 0x05D7 }, -{ 0x05D8, 0x05D8, 0x05D8 }, -{ 0x05D9, 0x05D9, 0x05D9 }, -{ 0x05DA, 0x05DA, 0x05DA }, -{ 0x05DB, 0x05DB, 0x05DB }, -{ 0x05DC, 0x05DC, 0x05DC }, -{ 0x05DD, 0x05DD, 0x05DD }, -{ 0x05DE, 0x05DE, 0x05DE }, -{ 0x05DF, 0x05DF, 0x05DF }, -{ 0x05E0, 0x05E0, 0x05E0 }, -{ 0x05E1, 0x05E1, 0x05E1 }, -{ 0x05E2, 0x05E2, 0x05E2 }, -{ 0x05E3, 0x05E3, 0x05E3 }, -{ 0x05E4, 0x05E4, 0x05E4 }, -{ 0x05E5, 0x05E5, 0x05E5 }, -{ 0x05E6, 0x05E6, 0x05E6 }, -{ 0x05E7, 0x05E7, 0x05E7 }, -{ 0x05E8, 0x05E8, 0x05E8 }, -{ 0x05E9, 0x05E9, 0x05E9 }, -{ 0x05EA, 0x05EA, 0x05EA }, -{ 0x05F0, 0x05F0, 0x05F0 }, -{ 0x05F1, 0x05F1, 0x05F1 }, -{ 0x05F2, 0x05F2, 0x05F2 }, -{ 0x0610, 0x0610, 0x0610 }, -{ 0x0611, 0x0611, 0x0611 }, -{ 0x0612, 0x0612, 0x0612 }, -{ 0x0613, 0x0613, 0x0613 }, -{ 0x0614, 0x0614, 0x0614 }, -{ 0x0615, 0x0615, 0x0615 }, -{ 0x0621, 0x0621, 0x0621 }, -{ 0x0622, 0x0622, 0x0622 }, -{ 0x0623, 0x0623, 0x0623 }, -{ 0x0624, 0x0624, 0x0624 }, -{ 0x0625, 0x0625, 0x0625 }, -{ 0x0626, 0x0626, 0x0626 }, -{ 0x0627, 0x0627, 0x0627 }, -{ 0x0628, 0x0628, 0x0628 }, -{ 0x0629, 0x0629, 0x0629 }, -{ 0x062A, 0x062A, 0x062A }, -{ 0x062B, 0x062B, 0x062B }, -{ 0x062C, 0x062C, 0x062C }, -{ 0x062D, 0x062D, 0x062D }, -{ 0x062E, 0x062E, 0x062E }, -{ 0x062F, 0x062F, 0x062F }, -{ 0x0630, 0x0630, 0x0630 }, -{ 0x0631, 0x0631, 0x0631 }, -{ 0x0632, 0x0632, 0x0632 }, -{ 0x0633, 0x0633, 0x0633 }, -{ 0x0634, 0x0634, 0x0634 }, -{ 0x0635, 0x0635, 0x0635 }, -{ 0x0636, 0x0636, 0x0636 }, -{ 0x0637, 0x0637, 0x0637 }, -{ 0x0638, 0x0638, 0x0638 }, -{ 0x0639, 0x0639, 0x0639 }, -{ 0x063A, 0x063A, 0x063A }, -{ 0x0640, 0x0640, 0x0640 }, -{ 0x0641, 0x0641, 0x0641 }, -{ 0x0642, 0x0642, 0x0642 }, -{ 0x0643, 0x0643, 0x0643 }, -{ 0x0644, 0x0644, 0x0644 }, -{ 0x0645, 0x0645, 0x0645 }, -{ 0x0646, 0x0646, 0x0646 }, -{ 0x0647, 0x0647, 0x0647 }, -{ 0x0648, 0x0648, 0x0648 }, -{ 0x0649, 0x0649, 0x0649 }, -{ 0x064A, 0x064A, 0x064A }, -{ 0x064B, 0x064B, 0x064B }, -{ 0x064C, 0x064C, 0x064C }, -{ 0x064D, 0x064D, 0x064D }, -{ 0x064E, 0x064E, 0x064E }, -{ 0x064F, 0x064F, 0x064F }, -{ 0x0650, 0x0650, 0x0650 }, -{ 0x0651, 0x0651, 0x0651 }, -{ 0x0652, 0x0652, 0x0652 }, -{ 0x0653, 0x0653, 0x0653 }, -{ 0x0654, 0x0654, 0x0654 }, -{ 0x0655, 0x0655, 0x0655 }, -{ 0x0656, 0x0656, 0x0656 }, -{ 0x0657, 0x0657, 0x0657 }, -{ 0x0658, 0x0658, 0x0658 }, -{ 0x0659, 0x0659, 0x0659 }, -{ 0x065A, 0x065A, 0x065A }, -{ 0x065B, 0x065B, 0x065B }, -{ 0x065C, 0x065C, 0x065C }, -{ 0x065D, 0x065D, 0x065D }, -{ 0x065E, 0x065E, 0x065E }, -{ 0x066E, 0x066E, 0x066E }, -{ 0x066F, 0x066F, 0x066F }, -{ 0x0670, 0x0670, 0x0670 }, -{ 0x0671, 0x0671, 0x0671 }, -{ 0x0672, 0x0672, 0x0672 }, -{ 0x0673, 0x0673, 0x0673 }, -{ 0x0674, 0x0674, 0x0674 }, -{ 0x0675, 0x0675, 0x0675 }, -{ 0x0676, 0x0676, 0x0676 }, -{ 0x0677, 0x0677, 0x0677 }, -{ 0x0678, 0x0678, 0x0678 }, -{ 0x0679, 0x0679, 0x0679 }, -{ 0x067A, 0x067A, 0x067A }, -{ 0x067B, 0x067B, 0x067B }, -{ 0x067C, 0x067C, 0x067C }, -{ 0x067D, 0x067D, 0x067D }, -{ 0x067E, 0x067E, 0x067E }, -{ 0x067F, 0x067F, 0x067F }, -{ 0x0680, 0x0680, 0x0680 }, -{ 0x0681, 0x0681, 0x0681 }, -{ 0x0682, 0x0682, 0x0682 }, -{ 0x0683, 0x0683, 0x0683 }, -{ 0x0684, 0x0684, 0x0684 }, -{ 0x0685, 0x0685, 0x0685 }, -{ 0x0686, 0x0686, 0x0686 }, -{ 0x0687, 0x0687, 0x0687 }, -{ 0x0688, 0x0688, 0x0688 }, -{ 0x0689, 0x0689, 0x0689 }, -{ 0x068A, 0x068A, 0x068A }, -{ 0x068B, 0x068B, 0x068B }, -{ 0x068C, 0x068C, 0x068C }, -{ 0x068D, 0x068D, 0x068D }, -{ 0x068E, 0x068E, 0x068E }, -{ 0x068F, 0x068F, 0x068F }, -{ 0x0690, 0x0690, 0x0690 }, -{ 0x0691, 0x0691, 0x0691 }, -{ 0x0692, 0x0692, 0x0692 }, -{ 0x0693, 0x0693, 0x0693 }, -{ 0x0694, 0x0694, 0x0694 }, -{ 0x0695, 0x0695, 0x0695 }, -{ 0x0696, 0x0696, 0x0696 }, -{ 0x0697, 0x0697, 0x0697 }, -{ 0x0698, 0x0698, 0x0698 }, -{ 0x0699, 0x0699, 0x0699 }, -{ 0x069A, 0x069A, 0x069A }, -{ 0x069B, 0x069B, 0x069B }, -{ 0x069C, 0x069C, 0x069C }, -{ 0x069D, 0x069D, 0x069D }, -{ 0x069E, 0x069E, 0x069E }, -{ 0x069F, 0x069F, 0x069F }, -{ 0x06A0, 0x06A0, 0x06A0 }, -{ 0x06A1, 0x06A1, 0x06A1 }, -{ 0x06A2, 0x06A2, 0x06A2 }, -{ 0x06A3, 0x06A3, 0x06A3 }, -{ 0x06A4, 0x06A4, 0x06A4 }, -{ 0x06A5, 0x06A5, 0x06A5 }, -{ 0x06A6, 0x06A6, 0x06A6 }, -{ 0x06A7, 0x06A7, 0x06A7 }, -{ 0x06A8, 0x06A8, 0x06A8 }, -{ 0x06A9, 0x06A9, 0x06A9 }, -{ 0x06AA, 0x06AA, 0x06AA }, -{ 0x06AB, 0x06AB, 0x06AB }, -{ 0x06AC, 0x06AC, 0x06AC }, -{ 0x06AD, 0x06AD, 0x06AD }, -{ 0x06AE, 0x06AE, 0x06AE }, -{ 0x06AF, 0x06AF, 0x06AF }, -{ 0x06B0, 0x06B0, 0x06B0 }, -{ 0x06B1, 0x06B1, 0x06B1 }, -{ 0x06B2, 0x06B2, 0x06B2 }, -{ 0x06B3, 0x06B3, 0x06B3 }, -{ 0x06B4, 0x06B4, 0x06B4 }, -{ 0x06B5, 0x06B5, 0x06B5 }, -{ 0x06B6, 0x06B6, 0x06B6 }, -{ 0x06B7, 0x06B7, 0x06B7 }, -{ 0x06B8, 0x06B8, 0x06B8 }, -{ 0x06B9, 0x06B9, 0x06B9 }, -{ 0x06BA, 0x06BA, 0x06BA }, -{ 0x06BB, 0x06BB, 0x06BB }, -{ 0x06BC, 0x06BC, 0x06BC }, -{ 0x06BD, 0x06BD, 0x06BD }, -{ 0x06BE, 0x06BE, 0x06BE }, -{ 0x06BF, 0x06BF, 0x06BF }, -{ 0x06C0, 0x06C0, 0x06C0 }, -{ 0x06C1, 0x06C1, 0x06C1 }, -{ 0x06C2, 0x06C2, 0x06C2 }, -{ 0x06C3, 0x06C3, 0x06C3 }, -{ 0x06C4, 0x06C4, 0x06C4 }, -{ 0x06C5, 0x06C5, 0x06C5 }, -{ 0x06C6, 0x06C6, 0x06C6 }, -{ 0x06C7, 0x06C7, 0x06C7 }, -{ 0x06C8, 0x06C8, 0x06C8 }, -{ 0x06C9, 0x06C9, 0x06C9 }, -{ 0x06CA, 0x06CA, 0x06CA }, -{ 0x06CB, 0x06CB, 0x06CB }, -{ 0x06CC, 0x06CC, 0x06CC }, -{ 0x06CD, 0x06CD, 0x06CD }, -{ 0x06CE, 0x06CE, 0x06CE }, -{ 0x06CF, 0x06CF, 0x06CF }, -{ 0x06D0, 0x06D0, 0x06D0 }, -{ 0x06D1, 0x06D1, 0x06D1 }, -{ 0x06D2, 0x06D2, 0x06D2 }, -{ 0x06D3, 0x06D3, 0x06D3 }, -{ 0x06D5, 0x06D5, 0x06D5 }, -{ 0x06D6, 0x06D6, 0x06D6 }, -{ 0x06D7, 0x06D7, 0x06D7 }, -{ 0x06D8, 0x06D8, 0x06D8 }, -{ 0x06D9, 0x06D9, 0x06D9 }, -{ 0x06DA, 0x06DA, 0x06DA }, -{ 0x06DB, 0x06DB, 0x06DB }, -{ 0x06DC, 0x06DC, 0x06DC }, -{ 0x06DF, 0x06DF, 0x06DF }, -{ 0x06E0, 0x06E0, 0x06E0 }, -{ 0x06E1, 0x06E1, 0x06E1 }, -{ 0x06E2, 0x06E2, 0x06E2 }, -{ 0x06E3, 0x06E3, 0x06E3 }, -{ 0x06E4, 0x06E4, 0x06E4 }, -{ 0x06E5, 0x06E5, 0x06E5 }, -{ 0x06E6, 0x06E6, 0x06E6 }, -{ 0x06E7, 0x06E7, 0x06E7 }, -{ 0x06E8, 0x06E8, 0x06E8 }, -{ 0x06EA, 0x06EA, 0x06EA }, -{ 0x06EB, 0x06EB, 0x06EB }, -{ 0x06EC, 0x06EC, 0x06EC }, -{ 0x06ED, 0x06ED, 0x06ED }, -{ 0x06EE, 0x06EE, 0x06EE }, -{ 0x06EF, 0x06EF, 0x06EF }, -{ 0x06FA, 0x06FA, 0x06FA }, -{ 0x06FB, 0x06FB, 0x06FB }, -{ 0x06FC, 0x06FC, 0x06FC }, -{ 0x06FF, 0x06FF, 0x06FF }, -{ 0x0710, 0x0710, 0x0710 }, -{ 0x0711, 0x0711, 0x0711 }, -{ 0x0712, 0x0712, 0x0712 }, -{ 0x0713, 0x0713, 0x0713 }, -{ 0x0714, 0x0714, 0x0714 }, -{ 0x0715, 0x0715, 0x0715 }, -{ 0x0716, 0x0716, 0x0716 }, -{ 0x0717, 0x0717, 0x0717 }, -{ 0x0718, 0x0718, 0x0718 }, -{ 0x0719, 0x0719, 0x0719 }, -{ 0x071A, 0x071A, 0x071A }, -{ 0x071B, 0x071B, 0x071B }, -{ 0x071C, 0x071C, 0x071C }, -{ 0x071D, 0x071D, 0x071D }, -{ 0x071E, 0x071E, 0x071E }, -{ 0x071F, 0x071F, 0x071F }, -{ 0x0720, 0x0720, 0x0720 }, -{ 0x0721, 0x0721, 0x0721 }, -{ 0x0722, 0x0722, 0x0722 }, -{ 0x0723, 0x0723, 0x0723 }, -{ 0x0724, 0x0724, 0x0724 }, -{ 0x0725, 0x0725, 0x0725 }, -{ 0x0726, 0x0726, 0x0726 }, -{ 0x0727, 0x0727, 0x0727 }, -{ 0x0728, 0x0728, 0x0728 }, -{ 0x0729, 0x0729, 0x0729 }, -{ 0x072A, 0x072A, 0x072A }, -{ 0x072B, 0x072B, 0x072B }, -{ 0x072C, 0x072C, 0x072C }, -{ 0x072D, 0x072D, 0x072D }, -{ 0x072E, 0x072E, 0x072E }, -{ 0x072F, 0x072F, 0x072F }, -{ 0x0730, 0x0730, 0x0730 }, -{ 0x0731, 0x0731, 0x0731 }, -{ 0x0732, 0x0732, 0x0732 }, -{ 0x0733, 0x0733, 0x0733 }, -{ 0x0734, 0x0734, 0x0734 }, -{ 0x0735, 0x0735, 0x0735 }, -{ 0x0736, 0x0736, 0x0736 }, -{ 0x0737, 0x0737, 0x0737 }, -{ 0x0738, 0x0738, 0x0738 }, -{ 0x0739, 0x0739, 0x0739 }, -{ 0x073A, 0x073A, 0x073A }, -{ 0x073B, 0x073B, 0x073B }, -{ 0x073C, 0x073C, 0x073C }, -{ 0x073D, 0x073D, 0x073D }, -{ 0x073E, 0x073E, 0x073E }, -{ 0x073F, 0x073F, 0x073F }, -{ 0x0740, 0x0740, 0x0740 }, -{ 0x0741, 0x0741, 0x0741 }, -{ 0x0742, 0x0742, 0x0742 }, -{ 0x0743, 0x0743, 0x0743 }, -{ 0x0744, 0x0744, 0x0744 }, -{ 0x0745, 0x0745, 0x0745 }, -{ 0x0746, 0x0746, 0x0746 }, -{ 0x0747, 0x0747, 0x0747 }, -{ 0x0748, 0x0748, 0x0748 }, -{ 0x0749, 0x0749, 0x0749 }, -{ 0x074A, 0x074A, 0x074A }, -{ 0x074D, 0x074D, 0x074D }, -{ 0x074E, 0x074E, 0x074E }, -{ 0x074F, 0x074F, 0x074F }, -{ 0x0750, 0x0750, 0x0750 }, -{ 0x0751, 0x0751, 0x0751 }, -{ 0x0752, 0x0752, 0x0752 }, -{ 0x0753, 0x0753, 0x0753 }, -{ 0x0754, 0x0754, 0x0754 }, -{ 0x0755, 0x0755, 0x0755 }, -{ 0x0756, 0x0756, 0x0756 }, -{ 0x0757, 0x0757, 0x0757 }, -{ 0x0758, 0x0758, 0x0758 }, -{ 0x0759, 0x0759, 0x0759 }, -{ 0x075A, 0x075A, 0x075A }, -{ 0x075B, 0x075B, 0x075B }, -{ 0x075C, 0x075C, 0x075C }, -{ 0x075D, 0x075D, 0x075D }, -{ 0x075E, 0x075E, 0x075E }, -{ 0x075F, 0x075F, 0x075F }, -{ 0x0760, 0x0760, 0x0760 }, -{ 0x0761, 0x0761, 0x0761 }, -{ 0x0762, 0x0762, 0x0762 }, -{ 0x0763, 0x0763, 0x0763 }, -{ 0x0764, 0x0764, 0x0764 }, -{ 0x0765, 0x0765, 0x0765 }, -{ 0x0766, 0x0766, 0x0766 }, -{ 0x0767, 0x0767, 0x0767 }, -{ 0x0768, 0x0768, 0x0768 }, -{ 0x0769, 0x0769, 0x0769 }, -{ 0x076A, 0x076A, 0x076A }, -{ 0x076B, 0x076B, 0x076B }, -{ 0x076C, 0x076C, 0x076C }, -{ 0x076D, 0x076D, 0x076D }, -{ 0x0780, 0x0780, 0x0780 }, -{ 0x0781, 0x0781, 0x0781 }, -{ 0x0782, 0x0782, 0x0782 }, -{ 0x0783, 0x0783, 0x0783 }, -{ 0x0784, 0x0784, 0x0784 }, -{ 0x0785, 0x0785, 0x0785 }, -{ 0x0786, 0x0786, 0x0786 }, -{ 0x0787, 0x0787, 0x0787 }, -{ 0x0788, 0x0788, 0x0788 }, -{ 0x0789, 0x0789, 0x0789 }, -{ 0x078A, 0x078A, 0x078A }, -{ 0x078B, 0x078B, 0x078B }, -{ 0x078C, 0x078C, 0x078C }, -{ 0x078D, 0x078D, 0x078D }, -{ 0x078E, 0x078E, 0x078E }, -{ 0x078F, 0x078F, 0x078F }, -{ 0x0790, 0x0790, 0x0790 }, -{ 0x0791, 0x0791, 0x0791 }, -{ 0x0792, 0x0792, 0x0792 }, -{ 0x0793, 0x0793, 0x0793 }, -{ 0x0794, 0x0794, 0x0794 }, -{ 0x0795, 0x0795, 0x0795 }, -{ 0x0796, 0x0796, 0x0796 }, -{ 0x0797, 0x0797, 0x0797 }, -{ 0x0798, 0x0798, 0x0798 }, -{ 0x0799, 0x0799, 0x0799 }, -{ 0x079A, 0x079A, 0x079A }, -{ 0x079B, 0x079B, 0x079B }, -{ 0x079C, 0x079C, 0x079C }, -{ 0x079D, 0x079D, 0x079D }, -{ 0x079E, 0x079E, 0x079E }, -{ 0x079F, 0x079F, 0x079F }, -{ 0x07A0, 0x07A0, 0x07A0 }, -{ 0x07A1, 0x07A1, 0x07A1 }, -{ 0x07A2, 0x07A2, 0x07A2 }, -{ 0x07A3, 0x07A3, 0x07A3 }, -{ 0x07A4, 0x07A4, 0x07A4 }, -{ 0x07A5, 0x07A5, 0x07A5 }, -{ 0x07A6, 0x07A6, 0x07A6 }, -{ 0x07A7, 0x07A7, 0x07A7 }, -{ 0x07A8, 0x07A8, 0x07A8 }, -{ 0x07A9, 0x07A9, 0x07A9 }, -{ 0x07AA, 0x07AA, 0x07AA }, -{ 0x07AB, 0x07AB, 0x07AB }, -{ 0x07AC, 0x07AC, 0x07AC }, -{ 0x07AD, 0x07AD, 0x07AD }, -{ 0x07AE, 0x07AE, 0x07AE }, -{ 0x07AF, 0x07AF, 0x07AF }, -{ 0x07B0, 0x07B0, 0x07B0 }, -{ 0x07B1, 0x07B1, 0x07B1 }, -{ 0x0901, 0x0901, 0x0901 }, -{ 0x0902, 0x0902, 0x0902 }, -{ 0x0904, 0x0904, 0x0904 }, -{ 0x0905, 0x0905, 0x0905 }, -{ 0x0906, 0x0906, 0x0906 }, -{ 0x0907, 0x0907, 0x0907 }, -{ 0x0908, 0x0908, 0x0908 }, -{ 0x0909, 0x0909, 0x0909 }, -{ 0x090A, 0x090A, 0x090A }, -{ 0x090B, 0x090B, 0x090B }, -{ 0x090C, 0x090C, 0x090C }, -{ 0x090D, 0x090D, 0x090D }, -{ 0x090E, 0x090E, 0x090E }, -{ 0x090F, 0x090F, 0x090F }, -{ 0x0910, 0x0910, 0x0910 }, -{ 0x0911, 0x0911, 0x0911 }, -{ 0x0912, 0x0912, 0x0912 }, -{ 0x0913, 0x0913, 0x0913 }, -{ 0x0914, 0x0914, 0x0914 }, -{ 0x0915, 0x0915, 0x0915 }, -{ 0x0916, 0x0916, 0x0916 }, -{ 0x0917, 0x0917, 0x0917 }, -{ 0x0918, 0x0918, 0x0918 }, -{ 0x0919, 0x0919, 0x0919 }, -{ 0x091A, 0x091A, 0x091A }, -{ 0x091B, 0x091B, 0x091B }, -{ 0x091C, 0x091C, 0x091C }, -{ 0x091D, 0x091D, 0x091D }, -{ 0x091E, 0x091E, 0x091E }, -{ 0x091F, 0x091F, 0x091F }, -{ 0x0920, 0x0920, 0x0920 }, -{ 0x0921, 0x0921, 0x0921 }, -{ 0x0922, 0x0922, 0x0922 }, -{ 0x0923, 0x0923, 0x0923 }, -{ 0x0924, 0x0924, 0x0924 }, -{ 0x0925, 0x0925, 0x0925 }, -{ 0x0926, 0x0926, 0x0926 }, -{ 0x0927, 0x0927, 0x0927 }, -{ 0x0928, 0x0928, 0x0928 }, -{ 0x0929, 0x0929, 0x0929 }, -{ 0x092A, 0x092A, 0x092A }, -{ 0x092B, 0x092B, 0x092B }, -{ 0x092C, 0x092C, 0x092C }, -{ 0x092D, 0x092D, 0x092D }, -{ 0x092E, 0x092E, 0x092E }, -{ 0x092F, 0x092F, 0x092F }, -{ 0x0930, 0x0930, 0x0930 }, -{ 0x0931, 0x0931, 0x0931 }, -{ 0x0932, 0x0932, 0x0932 }, -{ 0x0933, 0x0933, 0x0933 }, -{ 0x0934, 0x0934, 0x0934 }, -{ 0x0935, 0x0935, 0x0935 }, -{ 0x0936, 0x0936, 0x0936 }, -{ 0x0937, 0x0937, 0x0937 }, -{ 0x0938, 0x0938, 0x0938 }, -{ 0x0939, 0x0939, 0x0939 }, -{ 0x093C, 0x093C, 0x093C }, -{ 0x093D, 0x093D, 0x093D }, -{ 0x0941, 0x0941, 0x0941 }, -{ 0x0942, 0x0942, 0x0942 }, -{ 0x0943, 0x0943, 0x0943 }, -{ 0x0944, 0x0944, 0x0944 }, -{ 0x0945, 0x0945, 0x0945 }, -{ 0x0946, 0x0946, 0x0946 }, -{ 0x0947, 0x0947, 0x0947 }, -{ 0x0948, 0x0948, 0x0948 }, -{ 0x094D, 0x094D, 0x094D }, -{ 0x0950, 0x0950, 0x0950 }, -{ 0x0951, 0x0951, 0x0951 }, -{ 0x0952, 0x0952, 0x0952 }, -{ 0x0953, 0x0953, 0x0953 }, -{ 0x0954, 0x0954, 0x0954 }, -{ 0x0958, 0x0958, 0x0958 }, -{ 0x0959, 0x0959, 0x0959 }, -{ 0x095A, 0x095A, 0x095A }, -{ 0x095B, 0x095B, 0x095B }, -{ 0x095C, 0x095C, 0x095C }, -{ 0x095D, 0x095D, 0x095D }, -{ 0x095E, 0x095E, 0x095E }, -{ 0x095F, 0x095F, 0x095F }, -{ 0x0960, 0x0960, 0x0960 }, -{ 0x0961, 0x0961, 0x0961 }, -{ 0x0962, 0x0962, 0x0962 }, -{ 0x0963, 0x0963, 0x0963 }, -{ 0x097D, 0x097D, 0x097D }, -{ 0x0981, 0x0981, 0x0981 }, -{ 0x0985, 0x0985, 0x0985 }, -{ 0x0986, 0x0986, 0x0986 }, -{ 0x0987, 0x0987, 0x0987 }, -{ 0x0988, 0x0988, 0x0988 }, -{ 0x0989, 0x0989, 0x0989 }, -{ 0x098A, 0x098A, 0x098A }, -{ 0x098B, 0x098B, 0x098B }, -{ 0x098C, 0x098C, 0x098C }, -{ 0x098F, 0x098F, 0x098F }, -{ 0x0990, 0x0990, 0x0990 }, -{ 0x0993, 0x0993, 0x0993 }, -{ 0x0994, 0x0994, 0x0994 }, -{ 0x0995, 0x0995, 0x0995 }, -{ 0x0996, 0x0996, 0x0996 }, -{ 0x0997, 0x0997, 0x0997 }, -{ 0x0998, 0x0998, 0x0998 }, -{ 0x0999, 0x0999, 0x0999 }, -{ 0x099A, 0x099A, 0x099A }, -{ 0x099B, 0x099B, 0x099B }, -{ 0x099C, 0x099C, 0x099C }, -{ 0x099D, 0x099D, 0x099D }, -{ 0x099E, 0x099E, 0x099E }, -{ 0x099F, 0x099F, 0x099F }, -{ 0x09A0, 0x09A0, 0x09A0 }, -{ 0x09A1, 0x09A1, 0x09A1 }, -{ 0x09A2, 0x09A2, 0x09A2 }, -{ 0x09A3, 0x09A3, 0x09A3 }, -{ 0x09A4, 0x09A4, 0x09A4 }, -{ 0x09A5, 0x09A5, 0x09A5 }, -{ 0x09A6, 0x09A6, 0x09A6 }, -{ 0x09A7, 0x09A7, 0x09A7 }, -{ 0x09A8, 0x09A8, 0x09A8 }, -{ 0x09AA, 0x09AA, 0x09AA }, -{ 0x09AB, 0x09AB, 0x09AB }, -{ 0x09AC, 0x09AC, 0x09AC }, -{ 0x09AD, 0x09AD, 0x09AD }, -{ 0x09AE, 0x09AE, 0x09AE }, -{ 0x09AF, 0x09AF, 0x09AF }, -{ 0x09B0, 0x09B0, 0x09B0 }, -{ 0x09B2, 0x09B2, 0x09B2 }, -{ 0x09B6, 0x09B6, 0x09B6 }, -{ 0x09B7, 0x09B7, 0x09B7 }, -{ 0x09B8, 0x09B8, 0x09B8 }, -{ 0x09B9, 0x09B9, 0x09B9 }, -{ 0x09BC, 0x09BC, 0x09BC }, -{ 0x09BD, 0x09BD, 0x09BD }, -{ 0x09C1, 0x09C1, 0x09C1 }, -{ 0x09C2, 0x09C2, 0x09C2 }, -{ 0x09C3, 0x09C3, 0x09C3 }, -{ 0x09C4, 0x09C4, 0x09C4 }, -{ 0x09CD, 0x09CD, 0x09CD }, -{ 0x09CE, 0x09CE, 0x09CE }, -{ 0x09DC, 0x09DC, 0x09DC }, -{ 0x09DD, 0x09DD, 0x09DD }, -{ 0x09DF, 0x09DF, 0x09DF }, -{ 0x09E0, 0x09E0, 0x09E0 }, -{ 0x09E1, 0x09E1, 0x09E1 }, -{ 0x09E2, 0x09E2, 0x09E2 }, -{ 0x09E3, 0x09E3, 0x09E3 }, -{ 0x09F0, 0x09F0, 0x09F0 }, -{ 0x09F1, 0x09F1, 0x09F1 }, -{ 0x0A01, 0x0A01, 0x0A01 }, -{ 0x0A02, 0x0A02, 0x0A02 }, -{ 0x0A05, 0x0A05, 0x0A05 }, -{ 0x0A06, 0x0A06, 0x0A06 }, -{ 0x0A07, 0x0A07, 0x0A07 }, -{ 0x0A08, 0x0A08, 0x0A08 }, -{ 0x0A09, 0x0A09, 0x0A09 }, -{ 0x0A0A, 0x0A0A, 0x0A0A }, -{ 0x0A0F, 0x0A0F, 0x0A0F }, -{ 0x0A10, 0x0A10, 0x0A10 }, -{ 0x0A13, 0x0A13, 0x0A13 }, -{ 0x0A14, 0x0A14, 0x0A14 }, -{ 0x0A15, 0x0A15, 0x0A15 }, -{ 0x0A16, 0x0A16, 0x0A16 }, -{ 0x0A17, 0x0A17, 0x0A17 }, -{ 0x0A18, 0x0A18, 0x0A18 }, -{ 0x0A19, 0x0A19, 0x0A19 }, -{ 0x0A1A, 0x0A1A, 0x0A1A }, -{ 0x0A1B, 0x0A1B, 0x0A1B }, -{ 0x0A1C, 0x0A1C, 0x0A1C }, -{ 0x0A1D, 0x0A1D, 0x0A1D }, -{ 0x0A1E, 0x0A1E, 0x0A1E }, -{ 0x0A1F, 0x0A1F, 0x0A1F }, -{ 0x0A20, 0x0A20, 0x0A20 }, -{ 0x0A21, 0x0A21, 0x0A21 }, -{ 0x0A22, 0x0A22, 0x0A22 }, -{ 0x0A23, 0x0A23, 0x0A23 }, -{ 0x0A24, 0x0A24, 0x0A24 }, -{ 0x0A25, 0x0A25, 0x0A25 }, -{ 0x0A26, 0x0A26, 0x0A26 }, -{ 0x0A27, 0x0A27, 0x0A27 }, -{ 0x0A28, 0x0A28, 0x0A28 }, -{ 0x0A2A, 0x0A2A, 0x0A2A }, -{ 0x0A2B, 0x0A2B, 0x0A2B }, -{ 0x0A2C, 0x0A2C, 0x0A2C }, -{ 0x0A2D, 0x0A2D, 0x0A2D }, -{ 0x0A2E, 0x0A2E, 0x0A2E }, -{ 0x0A2F, 0x0A2F, 0x0A2F }, -{ 0x0A30, 0x0A30, 0x0A30 }, -{ 0x0A32, 0x0A32, 0x0A32 }, -{ 0x0A33, 0x0A33, 0x0A33 }, -{ 0x0A35, 0x0A35, 0x0A35 }, -{ 0x0A36, 0x0A36, 0x0A36 }, -{ 0x0A38, 0x0A38, 0x0A38 }, -{ 0x0A39, 0x0A39, 0x0A39 }, -{ 0x0A3C, 0x0A3C, 0x0A3C }, -{ 0x0A41, 0x0A41, 0x0A41 }, -{ 0x0A42, 0x0A42, 0x0A42 }, -{ 0x0A47, 0x0A47, 0x0A47 }, -{ 0x0A48, 0x0A48, 0x0A48 }, -{ 0x0A4B, 0x0A4B, 0x0A4B }, -{ 0x0A4C, 0x0A4C, 0x0A4C }, -{ 0x0A4D, 0x0A4D, 0x0A4D }, -{ 0x0A59, 0x0A59, 0x0A59 }, -{ 0x0A5A, 0x0A5A, 0x0A5A }, -{ 0x0A5B, 0x0A5B, 0x0A5B }, -{ 0x0A5C, 0x0A5C, 0x0A5C }, -{ 0x0A5E, 0x0A5E, 0x0A5E }, -{ 0x0A70, 0x0A70, 0x0A70 }, -{ 0x0A71, 0x0A71, 0x0A71 }, -{ 0x0A72, 0x0A72, 0x0A72 }, -{ 0x0A73, 0x0A73, 0x0A73 }, -{ 0x0A74, 0x0A74, 0x0A74 }, -{ 0x0A81, 0x0A81, 0x0A81 }, -{ 0x0A82, 0x0A82, 0x0A82 }, -{ 0x0A85, 0x0A85, 0x0A85 }, -{ 0x0A86, 0x0A86, 0x0A86 }, -{ 0x0A87, 0x0A87, 0x0A87 }, -{ 0x0A88, 0x0A88, 0x0A88 }, -{ 0x0A89, 0x0A89, 0x0A89 }, -{ 0x0A8A, 0x0A8A, 0x0A8A }, -{ 0x0A8B, 0x0A8B, 0x0A8B }, -{ 0x0A8C, 0x0A8C, 0x0A8C }, -{ 0x0A8D, 0x0A8D, 0x0A8D }, -{ 0x0A8F, 0x0A8F, 0x0A8F }, -{ 0x0A90, 0x0A90, 0x0A90 }, -{ 0x0A91, 0x0A91, 0x0A91 }, -{ 0x0A93, 0x0A93, 0x0A93 }, -{ 0x0A94, 0x0A94, 0x0A94 }, -{ 0x0A95, 0x0A95, 0x0A95 }, -{ 0x0A96, 0x0A96, 0x0A96 }, -{ 0x0A97, 0x0A97, 0x0A97 }, -{ 0x0A98, 0x0A98, 0x0A98 }, -{ 0x0A99, 0x0A99, 0x0A99 }, -{ 0x0A9A, 0x0A9A, 0x0A9A }, -{ 0x0A9B, 0x0A9B, 0x0A9B }, -{ 0x0A9C, 0x0A9C, 0x0A9C }, -{ 0x0A9D, 0x0A9D, 0x0A9D }, -{ 0x0A9E, 0x0A9E, 0x0A9E }, -{ 0x0A9F, 0x0A9F, 0x0A9F }, -{ 0x0AA0, 0x0AA0, 0x0AA0 }, -{ 0x0AA1, 0x0AA1, 0x0AA1 }, -{ 0x0AA2, 0x0AA2, 0x0AA2 }, -{ 0x0AA3, 0x0AA3, 0x0AA3 }, -{ 0x0AA4, 0x0AA4, 0x0AA4 }, -{ 0x0AA5, 0x0AA5, 0x0AA5 }, -{ 0x0AA6, 0x0AA6, 0x0AA6 }, -{ 0x0AA7, 0x0AA7, 0x0AA7 }, -{ 0x0AA8, 0x0AA8, 0x0AA8 }, -{ 0x0AAA, 0x0AAA, 0x0AAA }, -{ 0x0AAB, 0x0AAB, 0x0AAB }, -{ 0x0AAC, 0x0AAC, 0x0AAC }, -{ 0x0AAD, 0x0AAD, 0x0AAD }, -{ 0x0AAE, 0x0AAE, 0x0AAE }, -{ 0x0AAF, 0x0AAF, 0x0AAF }, -{ 0x0AB0, 0x0AB0, 0x0AB0 }, -{ 0x0AB2, 0x0AB2, 0x0AB2 }, -{ 0x0AB3, 0x0AB3, 0x0AB3 }, -{ 0x0AB5, 0x0AB5, 0x0AB5 }, -{ 0x0AB6, 0x0AB6, 0x0AB6 }, -{ 0x0AB7, 0x0AB7, 0x0AB7 }, -{ 0x0AB8, 0x0AB8, 0x0AB8 }, -{ 0x0AB9, 0x0AB9, 0x0AB9 }, -{ 0x0ABC, 0x0ABC, 0x0ABC }, -{ 0x0ABD, 0x0ABD, 0x0ABD }, -{ 0x0AC1, 0x0AC1, 0x0AC1 }, -{ 0x0AC2, 0x0AC2, 0x0AC2 }, -{ 0x0AC3, 0x0AC3, 0x0AC3 }, -{ 0x0AC4, 0x0AC4, 0x0AC4 }, -{ 0x0AC5, 0x0AC5, 0x0AC5 }, -{ 0x0AC7, 0x0AC7, 0x0AC7 }, -{ 0x0AC8, 0x0AC8, 0x0AC8 }, -{ 0x0ACD, 0x0ACD, 0x0ACD }, -{ 0x0AD0, 0x0AD0, 0x0AD0 }, -{ 0x0AE0, 0x0AE0, 0x0AE0 }, -{ 0x0AE1, 0x0AE1, 0x0AE1 }, -{ 0x0AE2, 0x0AE2, 0x0AE2 }, -{ 0x0AE3, 0x0AE3, 0x0AE3 }, -{ 0x0B01, 0x0B01, 0x0B01 }, -{ 0x0B05, 0x0B05, 0x0B05 }, -{ 0x0B06, 0x0B06, 0x0B06 }, -{ 0x0B07, 0x0B07, 0x0B07 }, -{ 0x0B08, 0x0B08, 0x0B08 }, -{ 0x0B09, 0x0B09, 0x0B09 }, -{ 0x0B0A, 0x0B0A, 0x0B0A }, -{ 0x0B0B, 0x0B0B, 0x0B0B }, -{ 0x0B0C, 0x0B0C, 0x0B0C }, -{ 0x0B0F, 0x0B0F, 0x0B0F }, -{ 0x0B10, 0x0B10, 0x0B10 }, -{ 0x0B13, 0x0B13, 0x0B13 }, -{ 0x0B14, 0x0B14, 0x0B14 }, -{ 0x0B15, 0x0B15, 0x0B15 }, -{ 0x0B16, 0x0B16, 0x0B16 }, -{ 0x0B17, 0x0B17, 0x0B17 }, -{ 0x0B18, 0x0B18, 0x0B18 }, -{ 0x0B19, 0x0B19, 0x0B19 }, -{ 0x0B1A, 0x0B1A, 0x0B1A }, -{ 0x0B1B, 0x0B1B, 0x0B1B }, -{ 0x0B1C, 0x0B1C, 0x0B1C }, -{ 0x0B1D, 0x0B1D, 0x0B1D }, -{ 0x0B1E, 0x0B1E, 0x0B1E }, -{ 0x0B1F, 0x0B1F, 0x0B1F }, -{ 0x0B20, 0x0B20, 0x0B20 }, -{ 0x0B21, 0x0B21, 0x0B21 }, -{ 0x0B22, 0x0B22, 0x0B22 }, -{ 0x0B23, 0x0B23, 0x0B23 }, -{ 0x0B24, 0x0B24, 0x0B24 }, -{ 0x0B25, 0x0B25, 0x0B25 }, -{ 0x0B26, 0x0B26, 0x0B26 }, -{ 0x0B27, 0x0B27, 0x0B27 }, -{ 0x0B28, 0x0B28, 0x0B28 }, -{ 0x0B2A, 0x0B2A, 0x0B2A }, -{ 0x0B2B, 0x0B2B, 0x0B2B }, -{ 0x0B2C, 0x0B2C, 0x0B2C }, -{ 0x0B2D, 0x0B2D, 0x0B2D }, -{ 0x0B2E, 0x0B2E, 0x0B2E }, -{ 0x0B2F, 0x0B2F, 0x0B2F }, -{ 0x0B30, 0x0B30, 0x0B30 }, -{ 0x0B32, 0x0B32, 0x0B32 }, -{ 0x0B33, 0x0B33, 0x0B33 }, -{ 0x0B35, 0x0B35, 0x0B35 }, -{ 0x0B36, 0x0B36, 0x0B36 }, -{ 0x0B37, 0x0B37, 0x0B37 }, -{ 0x0B38, 0x0B38, 0x0B38 }, -{ 0x0B39, 0x0B39, 0x0B39 }, -{ 0x0B3C, 0x0B3C, 0x0B3C }, -{ 0x0B3D, 0x0B3D, 0x0B3D }, -{ 0x0B3F, 0x0B3F, 0x0B3F }, -{ 0x0B41, 0x0B41, 0x0B41 }, -{ 0x0B42, 0x0B42, 0x0B42 }, -{ 0x0B43, 0x0B43, 0x0B43 }, -{ 0x0B4D, 0x0B4D, 0x0B4D }, -{ 0x0B56, 0x0B56, 0x0B56 }, -{ 0x0B5C, 0x0B5C, 0x0B5C }, -{ 0x0B5D, 0x0B5D, 0x0B5D }, -{ 0x0B5F, 0x0B5F, 0x0B5F }, -{ 0x0B60, 0x0B60, 0x0B60 }, -{ 0x0B61, 0x0B61, 0x0B61 }, -{ 0x0B71, 0x0B71, 0x0B71 }, -{ 0x0B82, 0x0B82, 0x0B82 }, -{ 0x0B83, 0x0B83, 0x0B83 }, -{ 0x0B85, 0x0B85, 0x0B85 }, -{ 0x0B86, 0x0B86, 0x0B86 }, -{ 0x0B87, 0x0B87, 0x0B87 }, -{ 0x0B88, 0x0B88, 0x0B88 }, -{ 0x0B89, 0x0B89, 0x0B89 }, -{ 0x0B8A, 0x0B8A, 0x0B8A }, -{ 0x0B8E, 0x0B8E, 0x0B8E }, -{ 0x0B8F, 0x0B8F, 0x0B8F }, -{ 0x0B90, 0x0B90, 0x0B90 }, -{ 0x0B92, 0x0B92, 0x0B92 }, -{ 0x0B93, 0x0B93, 0x0B93 }, -{ 0x0B94, 0x0B94, 0x0B94 }, -{ 0x0B95, 0x0B95, 0x0B95 }, -{ 0x0B99, 0x0B99, 0x0B99 }, -{ 0x0B9A, 0x0B9A, 0x0B9A }, -{ 0x0B9C, 0x0B9C, 0x0B9C }, -{ 0x0B9E, 0x0B9E, 0x0B9E }, -{ 0x0B9F, 0x0B9F, 0x0B9F }, -{ 0x0BA3, 0x0BA3, 0x0BA3 }, -{ 0x0BA4, 0x0BA4, 0x0BA4 }, -{ 0x0BA8, 0x0BA8, 0x0BA8 }, -{ 0x0BA9, 0x0BA9, 0x0BA9 }, -{ 0x0BAA, 0x0BAA, 0x0BAA }, -{ 0x0BAE, 0x0BAE, 0x0BAE }, -{ 0x0BAF, 0x0BAF, 0x0BAF }, -{ 0x0BB0, 0x0BB0, 0x0BB0 }, -{ 0x0BB1, 0x0BB1, 0x0BB1 }, -{ 0x0BB2, 0x0BB2, 0x0BB2 }, -{ 0x0BB3, 0x0BB3, 0x0BB3 }, -{ 0x0BB4, 0x0BB4, 0x0BB4 }, -{ 0x0BB5, 0x0BB5, 0x0BB5 }, -{ 0x0BB6, 0x0BB6, 0x0BB6 }, -{ 0x0BB7, 0x0BB7, 0x0BB7 }, -{ 0x0BB8, 0x0BB8, 0x0BB8 }, -{ 0x0BB9, 0x0BB9, 0x0BB9 }, -{ 0x0BC0, 0x0BC0, 0x0BC0 }, -{ 0x0BCD, 0x0BCD, 0x0BCD }, -{ 0x0C05, 0x0C05, 0x0C05 }, -{ 0x0C06, 0x0C06, 0x0C06 }, -{ 0x0C07, 0x0C07, 0x0C07 }, -{ 0x0C08, 0x0C08, 0x0C08 }, -{ 0x0C09, 0x0C09, 0x0C09 }, -{ 0x0C0A, 0x0C0A, 0x0C0A }, -{ 0x0C0B, 0x0C0B, 0x0C0B }, -{ 0x0C0C, 0x0C0C, 0x0C0C }, -{ 0x0C0E, 0x0C0E, 0x0C0E }, -{ 0x0C0F, 0x0C0F, 0x0C0F }, -{ 0x0C10, 0x0C10, 0x0C10 }, -{ 0x0C12, 0x0C12, 0x0C12 }, -{ 0x0C13, 0x0C13, 0x0C13 }, -{ 0x0C14, 0x0C14, 0x0C14 }, -{ 0x0C15, 0x0C15, 0x0C15 }, -{ 0x0C16, 0x0C16, 0x0C16 }, -{ 0x0C17, 0x0C17, 0x0C17 }, -{ 0x0C18, 0x0C18, 0x0C18 }, -{ 0x0C19, 0x0C19, 0x0C19 }, -{ 0x0C1A, 0x0C1A, 0x0C1A }, -{ 0x0C1B, 0x0C1B, 0x0C1B }, -{ 0x0C1C, 0x0C1C, 0x0C1C }, -{ 0x0C1D, 0x0C1D, 0x0C1D }, -{ 0x0C1E, 0x0C1E, 0x0C1E }, -{ 0x0C1F, 0x0C1F, 0x0C1F }, -{ 0x0C20, 0x0C20, 0x0C20 }, -{ 0x0C21, 0x0C21, 0x0C21 }, -{ 0x0C22, 0x0C22, 0x0C22 }, -{ 0x0C23, 0x0C23, 0x0C23 }, -{ 0x0C24, 0x0C24, 0x0C24 }, -{ 0x0C25, 0x0C25, 0x0C25 }, -{ 0x0C26, 0x0C26, 0x0C26 }, -{ 0x0C27, 0x0C27, 0x0C27 }, -{ 0x0C28, 0x0C28, 0x0C28 }, -{ 0x0C2A, 0x0C2A, 0x0C2A }, -{ 0x0C2B, 0x0C2B, 0x0C2B }, -{ 0x0C2C, 0x0C2C, 0x0C2C }, -{ 0x0C2D, 0x0C2D, 0x0C2D }, -{ 0x0C2E, 0x0C2E, 0x0C2E }, -{ 0x0C2F, 0x0C2F, 0x0C2F }, -{ 0x0C30, 0x0C30, 0x0C30 }, -{ 0x0C31, 0x0C31, 0x0C31 }, -{ 0x0C32, 0x0C32, 0x0C32 }, -{ 0x0C33, 0x0C33, 0x0C33 }, -{ 0x0C35, 0x0C35, 0x0C35 }, -{ 0x0C36, 0x0C36, 0x0C36 }, -{ 0x0C37, 0x0C37, 0x0C37 }, -{ 0x0C38, 0x0C38, 0x0C38 }, -{ 0x0C39, 0x0C39, 0x0C39 }, -{ 0x0C3E, 0x0C3E, 0x0C3E }, -{ 0x0C3F, 0x0C3F, 0x0C3F }, -{ 0x0C40, 0x0C40, 0x0C40 }, -{ 0x0C46, 0x0C46, 0x0C46 }, -{ 0x0C47, 0x0C47, 0x0C47 }, -{ 0x0C48, 0x0C48, 0x0C48 }, -{ 0x0C4A, 0x0C4A, 0x0C4A }, -{ 0x0C4B, 0x0C4B, 0x0C4B }, -{ 0x0C4C, 0x0C4C, 0x0C4C }, -{ 0x0C4D, 0x0C4D, 0x0C4D }, -{ 0x0C55, 0x0C55, 0x0C55 }, -{ 0x0C56, 0x0C56, 0x0C56 }, -{ 0x0C60, 0x0C60, 0x0C60 }, -{ 0x0C61, 0x0C61, 0x0C61 }, -{ 0x0C85, 0x0C85, 0x0C85 }, -{ 0x0C86, 0x0C86, 0x0C86 }, -{ 0x0C87, 0x0C87, 0x0C87 }, -{ 0x0C88, 0x0C88, 0x0C88 }, -{ 0x0C89, 0x0C89, 0x0C89 }, -{ 0x0C8A, 0x0C8A, 0x0C8A }, -{ 0x0C8B, 0x0C8B, 0x0C8B }, -{ 0x0C8C, 0x0C8C, 0x0C8C }, -{ 0x0C8E, 0x0C8E, 0x0C8E }, -{ 0x0C8F, 0x0C8F, 0x0C8F }, -{ 0x0C90, 0x0C90, 0x0C90 }, -{ 0x0C92, 0x0C92, 0x0C92 }, -{ 0x0C93, 0x0C93, 0x0C93 }, -{ 0x0C94, 0x0C94, 0x0C94 }, -{ 0x0C95, 0x0C95, 0x0C95 }, -{ 0x0C96, 0x0C96, 0x0C96 }, -{ 0x0C97, 0x0C97, 0x0C97 }, -{ 0x0C98, 0x0C98, 0x0C98 }, -{ 0x0C99, 0x0C99, 0x0C99 }, -{ 0x0C9A, 0x0C9A, 0x0C9A }, -{ 0x0C9B, 0x0C9B, 0x0C9B }, -{ 0x0C9C, 0x0C9C, 0x0C9C }, -{ 0x0C9D, 0x0C9D, 0x0C9D }, -{ 0x0C9E, 0x0C9E, 0x0C9E }, -{ 0x0C9F, 0x0C9F, 0x0C9F }, -{ 0x0CA0, 0x0CA0, 0x0CA0 }, -{ 0x0CA1, 0x0CA1, 0x0CA1 }, -{ 0x0CA2, 0x0CA2, 0x0CA2 }, -{ 0x0CA3, 0x0CA3, 0x0CA3 }, -{ 0x0CA4, 0x0CA4, 0x0CA4 }, -{ 0x0CA5, 0x0CA5, 0x0CA5 }, -{ 0x0CA6, 0x0CA6, 0x0CA6 }, -{ 0x0CA7, 0x0CA7, 0x0CA7 }, -{ 0x0CA8, 0x0CA8, 0x0CA8 }, -{ 0x0CAA, 0x0CAA, 0x0CAA }, -{ 0x0CAB, 0x0CAB, 0x0CAB }, -{ 0x0CAC, 0x0CAC, 0x0CAC }, -{ 0x0CAD, 0x0CAD, 0x0CAD }, -{ 0x0CAE, 0x0CAE, 0x0CAE }, -{ 0x0CAF, 0x0CAF, 0x0CAF }, -{ 0x0CB0, 0x0CB0, 0x0CB0 }, -{ 0x0CB1, 0x0CB1, 0x0CB1 }, -{ 0x0CB2, 0x0CB2, 0x0CB2 }, -{ 0x0CB3, 0x0CB3, 0x0CB3 }, -{ 0x0CB5, 0x0CB5, 0x0CB5 }, -{ 0x0CB6, 0x0CB6, 0x0CB6 }, -{ 0x0CB7, 0x0CB7, 0x0CB7 }, -{ 0x0CB8, 0x0CB8, 0x0CB8 }, -{ 0x0CB9, 0x0CB9, 0x0CB9 }, -{ 0x0CBC, 0x0CBC, 0x0CBC }, -{ 0x0CBD, 0x0CBD, 0x0CBD }, -{ 0x0CBF, 0x0CBF, 0x0CBF }, -{ 0x0CC6, 0x0CC6, 0x0CC6 }, -{ 0x0CCC, 0x0CCC, 0x0CCC }, -{ 0x0CCD, 0x0CCD, 0x0CCD }, -{ 0x0CDE, 0x0CDE, 0x0CDE }, -{ 0x0CE0, 0x0CE0, 0x0CE0 }, -{ 0x0CE1, 0x0CE1, 0x0CE1 }, -{ 0x0D05, 0x0D05, 0x0D05 }, -{ 0x0D06, 0x0D06, 0x0D06 }, -{ 0x0D07, 0x0D07, 0x0D07 }, -{ 0x0D08, 0x0D08, 0x0D08 }, -{ 0x0D09, 0x0D09, 0x0D09 }, -{ 0x0D0A, 0x0D0A, 0x0D0A }, -{ 0x0D0B, 0x0D0B, 0x0D0B }, -{ 0x0D0C, 0x0D0C, 0x0D0C }, -{ 0x0D0E, 0x0D0E, 0x0D0E }, -{ 0x0D0F, 0x0D0F, 0x0D0F }, -{ 0x0D10, 0x0D10, 0x0D10 }, -{ 0x0D12, 0x0D12, 0x0D12 }, -{ 0x0D13, 0x0D13, 0x0D13 }, -{ 0x0D14, 0x0D14, 0x0D14 }, -{ 0x0D15, 0x0D15, 0x0D15 }, -{ 0x0D16, 0x0D16, 0x0D16 }, -{ 0x0D17, 0x0D17, 0x0D17 }, -{ 0x0D18, 0x0D18, 0x0D18 }, -{ 0x0D19, 0x0D19, 0x0D19 }, -{ 0x0D1A, 0x0D1A, 0x0D1A }, -{ 0x0D1B, 0x0D1B, 0x0D1B }, -{ 0x0D1C, 0x0D1C, 0x0D1C }, -{ 0x0D1D, 0x0D1D, 0x0D1D }, -{ 0x0D1E, 0x0D1E, 0x0D1E }, -{ 0x0D1F, 0x0D1F, 0x0D1F }, -{ 0x0D20, 0x0D20, 0x0D20 }, -{ 0x0D21, 0x0D21, 0x0D21 }, -{ 0x0D22, 0x0D22, 0x0D22 }, -{ 0x0D23, 0x0D23, 0x0D23 }, -{ 0x0D24, 0x0D24, 0x0D24 }, -{ 0x0D25, 0x0D25, 0x0D25 }, -{ 0x0D26, 0x0D26, 0x0D26 }, -{ 0x0D27, 0x0D27, 0x0D27 }, -{ 0x0D28, 0x0D28, 0x0D28 }, -{ 0x0D2A, 0x0D2A, 0x0D2A }, -{ 0x0D2B, 0x0D2B, 0x0D2B }, -{ 0x0D2C, 0x0D2C, 0x0D2C }, -{ 0x0D2D, 0x0D2D, 0x0D2D }, -{ 0x0D2E, 0x0D2E, 0x0D2E }, -{ 0x0D2F, 0x0D2F, 0x0D2F }, -{ 0x0D30, 0x0D30, 0x0D30 }, -{ 0x0D31, 0x0D31, 0x0D31 }, -{ 0x0D32, 0x0D32, 0x0D32 }, -{ 0x0D33, 0x0D33, 0x0D33 }, -{ 0x0D34, 0x0D34, 0x0D34 }, -{ 0x0D35, 0x0D35, 0x0D35 }, -{ 0x0D36, 0x0D36, 0x0D36 }, -{ 0x0D37, 0x0D37, 0x0D37 }, -{ 0x0D38, 0x0D38, 0x0D38 }, -{ 0x0D39, 0x0D39, 0x0D39 }, -{ 0x0D41, 0x0D41, 0x0D41 }, -{ 0x0D42, 0x0D42, 0x0D42 }, -{ 0x0D43, 0x0D43, 0x0D43 }, -{ 0x0D4D, 0x0D4D, 0x0D4D }, -{ 0x0D60, 0x0D60, 0x0D60 }, -{ 0x0D61, 0x0D61, 0x0D61 }, -{ 0x0D85, 0x0D85, 0x0D85 }, -{ 0x0D86, 0x0D86, 0x0D86 }, -{ 0x0D87, 0x0D87, 0x0D87 }, -{ 0x0D88, 0x0D88, 0x0D88 }, -{ 0x0D89, 0x0D89, 0x0D89 }, -{ 0x0D8A, 0x0D8A, 0x0D8A }, -{ 0x0D8B, 0x0D8B, 0x0D8B }, -{ 0x0D8C, 0x0D8C, 0x0D8C }, -{ 0x0D8D, 0x0D8D, 0x0D8D }, -{ 0x0D8E, 0x0D8E, 0x0D8E }, -{ 0x0D8F, 0x0D8F, 0x0D8F }, -{ 0x0D90, 0x0D90, 0x0D90 }, -{ 0x0D91, 0x0D91, 0x0D91 }, -{ 0x0D92, 0x0D92, 0x0D92 }, -{ 0x0D93, 0x0D93, 0x0D93 }, -{ 0x0D94, 0x0D94, 0x0D94 }, -{ 0x0D95, 0x0D95, 0x0D95 }, -{ 0x0D96, 0x0D96, 0x0D96 }, -{ 0x0D9A, 0x0D9A, 0x0D9A }, -{ 0x0D9B, 0x0D9B, 0x0D9B }, -{ 0x0D9C, 0x0D9C, 0x0D9C }, -{ 0x0D9D, 0x0D9D, 0x0D9D }, -{ 0x0D9E, 0x0D9E, 0x0D9E }, -{ 0x0D9F, 0x0D9F, 0x0D9F }, -{ 0x0DA0, 0x0DA0, 0x0DA0 }, -{ 0x0DA1, 0x0DA1, 0x0DA1 }, -{ 0x0DA2, 0x0DA2, 0x0DA2 }, -{ 0x0DA3, 0x0DA3, 0x0DA3 }, -{ 0x0DA4, 0x0DA4, 0x0DA4 }, -{ 0x0DA5, 0x0DA5, 0x0DA5 }, -{ 0x0DA6, 0x0DA6, 0x0DA6 }, -{ 0x0DA7, 0x0DA7, 0x0DA7 }, -{ 0x0DA8, 0x0DA8, 0x0DA8 }, -{ 0x0DA9, 0x0DA9, 0x0DA9 }, -{ 0x0DAA, 0x0DAA, 0x0DAA }, -{ 0x0DAB, 0x0DAB, 0x0DAB }, -{ 0x0DAC, 0x0DAC, 0x0DAC }, -{ 0x0DAD, 0x0DAD, 0x0DAD }, -{ 0x0DAE, 0x0DAE, 0x0DAE }, -{ 0x0DAF, 0x0DAF, 0x0DAF }, -{ 0x0DB0, 0x0DB0, 0x0DB0 }, -{ 0x0DB1, 0x0DB1, 0x0DB1 }, -{ 0x0DB3, 0x0DB3, 0x0DB3 }, -{ 0x0DB4, 0x0DB4, 0x0DB4 }, -{ 0x0DB5, 0x0DB5, 0x0DB5 }, -{ 0x0DB6, 0x0DB6, 0x0DB6 }, -{ 0x0DB7, 0x0DB7, 0x0DB7 }, -{ 0x0DB8, 0x0DB8, 0x0DB8 }, -{ 0x0DB9, 0x0DB9, 0x0DB9 }, -{ 0x0DBA, 0x0DBA, 0x0DBA }, -{ 0x0DBB, 0x0DBB, 0x0DBB }, -{ 0x0DBD, 0x0DBD, 0x0DBD }, -{ 0x0DC0, 0x0DC0, 0x0DC0 }, -{ 0x0DC1, 0x0DC1, 0x0DC1 }, -{ 0x0DC2, 0x0DC2, 0x0DC2 }, -{ 0x0DC3, 0x0DC3, 0x0DC3 }, -{ 0x0DC4, 0x0DC4, 0x0DC4 }, -{ 0x0DC5, 0x0DC5, 0x0DC5 }, -{ 0x0DC6, 0x0DC6, 0x0DC6 }, -{ 0x0DCA, 0x0DCA, 0x0DCA }, -{ 0x0DD2, 0x0DD2, 0x0DD2 }, -{ 0x0DD3, 0x0DD3, 0x0DD3 }, -{ 0x0DD4, 0x0DD4, 0x0DD4 }, -{ 0x0DD6, 0x0DD6, 0x0DD6 }, -{ 0x0E01, 0x0E01, 0x0E01 }, -{ 0x0E02, 0x0E02, 0x0E02 }, -{ 0x0E03, 0x0E03, 0x0E03 }, -{ 0x0E04, 0x0E04, 0x0E04 }, -{ 0x0E05, 0x0E05, 0x0E05 }, -{ 0x0E06, 0x0E06, 0x0E06 }, -{ 0x0E07, 0x0E07, 0x0E07 }, -{ 0x0E08, 0x0E08, 0x0E08 }, -{ 0x0E09, 0x0E09, 0x0E09 }, -{ 0x0E0A, 0x0E0A, 0x0E0A }, -{ 0x0E0B, 0x0E0B, 0x0E0B }, -{ 0x0E0C, 0x0E0C, 0x0E0C }, -{ 0x0E0D, 0x0E0D, 0x0E0D }, -{ 0x0E0E, 0x0E0E, 0x0E0E }, -{ 0x0E0F, 0x0E0F, 0x0E0F }, -{ 0x0E10, 0x0E10, 0x0E10 }, -{ 0x0E11, 0x0E11, 0x0E11 }, -{ 0x0E12, 0x0E12, 0x0E12 }, -{ 0x0E13, 0x0E13, 0x0E13 }, -{ 0x0E14, 0x0E14, 0x0E14 }, -{ 0x0E15, 0x0E15, 0x0E15 }, -{ 0x0E16, 0x0E16, 0x0E16 }, -{ 0x0E17, 0x0E17, 0x0E17 }, -{ 0x0E18, 0x0E18, 0x0E18 }, -{ 0x0E19, 0x0E19, 0x0E19 }, -{ 0x0E1A, 0x0E1A, 0x0E1A }, -{ 0x0E1B, 0x0E1B, 0x0E1B }, -{ 0x0E1C, 0x0E1C, 0x0E1C }, -{ 0x0E1D, 0x0E1D, 0x0E1D }, -{ 0x0E1E, 0x0E1E, 0x0E1E }, -{ 0x0E1F, 0x0E1F, 0x0E1F }, -{ 0x0E20, 0x0E20, 0x0E20 }, -{ 0x0E21, 0x0E21, 0x0E21 }, -{ 0x0E22, 0x0E22, 0x0E22 }, -{ 0x0E23, 0x0E23, 0x0E23 }, -{ 0x0E24, 0x0E24, 0x0E24 }, -{ 0x0E25, 0x0E25, 0x0E25 }, -{ 0x0E26, 0x0E26, 0x0E26 }, -{ 0x0E27, 0x0E27, 0x0E27 }, -{ 0x0E28, 0x0E28, 0x0E28 }, -{ 0x0E29, 0x0E29, 0x0E29 }, -{ 0x0E2A, 0x0E2A, 0x0E2A }, -{ 0x0E2B, 0x0E2B, 0x0E2B }, -{ 0x0E2C, 0x0E2C, 0x0E2C }, -{ 0x0E2D, 0x0E2D, 0x0E2D }, -{ 0x0E2E, 0x0E2E, 0x0E2E }, -{ 0x0E2F, 0x0E2F, 0x0E2F }, -{ 0x0E30, 0x0E30, 0x0E30 }, -{ 0x0E31, 0x0E31, 0x0E31 }, -{ 0x0E32, 0x0E32, 0x0E32 }, -{ 0x0E33, 0x0E33, 0x0E33 }, -{ 0x0E34, 0x0E34, 0x0E34 }, -{ 0x0E35, 0x0E35, 0x0E35 }, -{ 0x0E36, 0x0E36, 0x0E36 }, -{ 0x0E37, 0x0E37, 0x0E37 }, -{ 0x0E38, 0x0E38, 0x0E38 }, -{ 0x0E39, 0x0E39, 0x0E39 }, -{ 0x0E3A, 0x0E3A, 0x0E3A }, -{ 0x0E40, 0x0E40, 0x0E40 }, -{ 0x0E41, 0x0E41, 0x0E41 }, -{ 0x0E42, 0x0E42, 0x0E42 }, -{ 0x0E43, 0x0E43, 0x0E43 }, -{ 0x0E44, 0x0E44, 0x0E44 }, -{ 0x0E45, 0x0E45, 0x0E45 }, -{ 0x0E46, 0x0E46, 0x0E46 }, -{ 0x0E47, 0x0E47, 0x0E47 }, -{ 0x0E48, 0x0E48, 0x0E48 }, -{ 0x0E49, 0x0E49, 0x0E49 }, -{ 0x0E4A, 0x0E4A, 0x0E4A }, -{ 0x0E4B, 0x0E4B, 0x0E4B }, -{ 0x0E4C, 0x0E4C, 0x0E4C }, -{ 0x0E4D, 0x0E4D, 0x0E4D }, -{ 0x0E4E, 0x0E4E, 0x0E4E }, -{ 0x0E81, 0x0E81, 0x0E81 }, -{ 0x0E82, 0x0E82, 0x0E82 }, -{ 0x0E84, 0x0E84, 0x0E84 }, -{ 0x0E87, 0x0E87, 0x0E87 }, -{ 0x0E88, 0x0E88, 0x0E88 }, -{ 0x0E8A, 0x0E8A, 0x0E8A }, -{ 0x0E8D, 0x0E8D, 0x0E8D }, -{ 0x0E94, 0x0E94, 0x0E94 }, -{ 0x0E95, 0x0E95, 0x0E95 }, -{ 0x0E96, 0x0E96, 0x0E96 }, -{ 0x0E97, 0x0E97, 0x0E97 }, -{ 0x0E99, 0x0E99, 0x0E99 }, -{ 0x0E9A, 0x0E9A, 0x0E9A }, -{ 0x0E9B, 0x0E9B, 0x0E9B }, -{ 0x0E9C, 0x0E9C, 0x0E9C }, -{ 0x0E9D, 0x0E9D, 0x0E9D }, -{ 0x0E9E, 0x0E9E, 0x0E9E }, -{ 0x0E9F, 0x0E9F, 0x0E9F }, -{ 0x0EA1, 0x0EA1, 0x0EA1 }, -{ 0x0EA2, 0x0EA2, 0x0EA2 }, -{ 0x0EA3, 0x0EA3, 0x0EA3 }, -{ 0x0EA5, 0x0EA5, 0x0EA5 }, -{ 0x0EA7, 0x0EA7, 0x0EA7 }, -{ 0x0EAA, 0x0EAA, 0x0EAA }, -{ 0x0EAB, 0x0EAB, 0x0EAB }, -{ 0x0EAD, 0x0EAD, 0x0EAD }, -{ 0x0EAE, 0x0EAE, 0x0EAE }, -{ 0x0EAF, 0x0EAF, 0x0EAF }, -{ 0x0EB0, 0x0EB0, 0x0EB0 }, -{ 0x0EB1, 0x0EB1, 0x0EB1 }, -{ 0x0EB2, 0x0EB2, 0x0EB2 }, -{ 0x0EB3, 0x0EB3, 0x0EB3 }, -{ 0x0EB4, 0x0EB4, 0x0EB4 }, -{ 0x0EB5, 0x0EB5, 0x0EB5 }, -{ 0x0EB6, 0x0EB6, 0x0EB6 }, -{ 0x0EB7, 0x0EB7, 0x0EB7 }, -{ 0x0EB8, 0x0EB8, 0x0EB8 }, -{ 0x0EB9, 0x0EB9, 0x0EB9 }, -{ 0x0EBB, 0x0EBB, 0x0EBB }, -{ 0x0EBC, 0x0EBC, 0x0EBC }, -{ 0x0EBD, 0x0EBD, 0x0EBD }, -{ 0x0EC0, 0x0EC0, 0x0EC0 }, -{ 0x0EC1, 0x0EC1, 0x0EC1 }, -{ 0x0EC2, 0x0EC2, 0x0EC2 }, -{ 0x0EC3, 0x0EC3, 0x0EC3 }, -{ 0x0EC4, 0x0EC4, 0x0EC4 }, -{ 0x0EC6, 0x0EC6, 0x0EC6 }, -{ 0x0EC8, 0x0EC8, 0x0EC8 }, -{ 0x0EC9, 0x0EC9, 0x0EC9 }, -{ 0x0ECA, 0x0ECA, 0x0ECA }, -{ 0x0ECB, 0x0ECB, 0x0ECB }, -{ 0x0ECC, 0x0ECC, 0x0ECC }, -{ 0x0ECD, 0x0ECD, 0x0ECD }, -{ 0x0EDC, 0x0EDC, 0x0EDC }, -{ 0x0EDD, 0x0EDD, 0x0EDD }, -{ 0x0F00, 0x0F00, 0x0F00 }, -{ 0x0F18, 0x0F18, 0x0F18 }, -{ 0x0F19, 0x0F19, 0x0F19 }, -{ 0x0F35, 0x0F35, 0x0F35 }, -{ 0x0F37, 0x0F37, 0x0F37 }, -{ 0x0F39, 0x0F39, 0x0F39 }, -{ 0x0F40, 0x0F40, 0x0F40 }, -{ 0x0F41, 0x0F41, 0x0F41 }, -{ 0x0F42, 0x0F42, 0x0F42 }, -{ 0x0F43, 0x0F43, 0x0F43 }, -{ 0x0F44, 0x0F44, 0x0F44 }, -{ 0x0F45, 0x0F45, 0x0F45 }, -{ 0x0F46, 0x0F46, 0x0F46 }, -{ 0x0F47, 0x0F47, 0x0F47 }, -{ 0x0F49, 0x0F49, 0x0F49 }, -{ 0x0F4A, 0x0F4A, 0x0F4A }, -{ 0x0F4B, 0x0F4B, 0x0F4B }, -{ 0x0F4C, 0x0F4C, 0x0F4C }, -{ 0x0F4D, 0x0F4D, 0x0F4D }, -{ 0x0F4E, 0x0F4E, 0x0F4E }, -{ 0x0F4F, 0x0F4F, 0x0F4F }, -{ 0x0F50, 0x0F50, 0x0F50 }, -{ 0x0F51, 0x0F51, 0x0F51 }, -{ 0x0F52, 0x0F52, 0x0F52 }, -{ 0x0F53, 0x0F53, 0x0F53 }, -{ 0x0F54, 0x0F54, 0x0F54 }, -{ 0x0F55, 0x0F55, 0x0F55 }, -{ 0x0F56, 0x0F56, 0x0F56 }, -{ 0x0F57, 0x0F57, 0x0F57 }, -{ 0x0F58, 0x0F58, 0x0F58 }, -{ 0x0F59, 0x0F59, 0x0F59 }, -{ 0x0F5A, 0x0F5A, 0x0F5A }, -{ 0x0F5B, 0x0F5B, 0x0F5B }, -{ 0x0F5C, 0x0F5C, 0x0F5C }, -{ 0x0F5D, 0x0F5D, 0x0F5D }, -{ 0x0F5E, 0x0F5E, 0x0F5E }, -{ 0x0F5F, 0x0F5F, 0x0F5F }, -{ 0x0F60, 0x0F60, 0x0F60 }, -{ 0x0F61, 0x0F61, 0x0F61 }, -{ 0x0F62, 0x0F62, 0x0F62 }, -{ 0x0F63, 0x0F63, 0x0F63 }, -{ 0x0F64, 0x0F64, 0x0F64 }, -{ 0x0F65, 0x0F65, 0x0F65 }, -{ 0x0F66, 0x0F66, 0x0F66 }, -{ 0x0F67, 0x0F67, 0x0F67 }, -{ 0x0F68, 0x0F68, 0x0F68 }, -{ 0x0F69, 0x0F69, 0x0F69 }, -{ 0x0F6A, 0x0F6A, 0x0F6A }, -{ 0x0F71, 0x0F71, 0x0F71 }, -{ 0x0F72, 0x0F72, 0x0F72 }, -{ 0x0F73, 0x0F73, 0x0F73 }, -{ 0x0F74, 0x0F74, 0x0F74 }, -{ 0x0F75, 0x0F75, 0x0F75 }, -{ 0x0F76, 0x0F76, 0x0F76 }, -{ 0x0F77, 0x0F77, 0x0F77 }, -{ 0x0F78, 0x0F78, 0x0F78 }, -{ 0x0F79, 0x0F79, 0x0F79 }, -{ 0x0F7A, 0x0F7A, 0x0F7A }, -{ 0x0F7B, 0x0F7B, 0x0F7B }, -{ 0x0F7C, 0x0F7C, 0x0F7C }, -{ 0x0F7D, 0x0F7D, 0x0F7D }, -{ 0x0F7E, 0x0F7E, 0x0F7E }, -{ 0x0F80, 0x0F80, 0x0F80 }, -{ 0x0F81, 0x0F81, 0x0F81 }, -{ 0x0F82, 0x0F82, 0x0F82 }, -{ 0x0F83, 0x0F83, 0x0F83 }, -{ 0x0F84, 0x0F84, 0x0F84 }, -{ 0x0F86, 0x0F86, 0x0F86 }, -{ 0x0F87, 0x0F87, 0x0F87 }, -{ 0x0F88, 0x0F88, 0x0F88 }, -{ 0x0F89, 0x0F89, 0x0F89 }, -{ 0x0F8A, 0x0F8A, 0x0F8A }, -{ 0x0F8B, 0x0F8B, 0x0F8B }, -{ 0x0F90, 0x0F90, 0x0F90 }, -{ 0x0F91, 0x0F91, 0x0F91 }, -{ 0x0F92, 0x0F92, 0x0F92 }, -{ 0x0F93, 0x0F93, 0x0F93 }, -{ 0x0F94, 0x0F94, 0x0F94 }, -{ 0x0F95, 0x0F95, 0x0F95 }, -{ 0x0F96, 0x0F96, 0x0F96 }, -{ 0x0F97, 0x0F97, 0x0F97 }, -{ 0x0F99, 0x0F99, 0x0F99 }, -{ 0x0F9A, 0x0F9A, 0x0F9A }, -{ 0x0F9B, 0x0F9B, 0x0F9B }, -{ 0x0F9C, 0x0F9C, 0x0F9C }, -{ 0x0F9D, 0x0F9D, 0x0F9D }, -{ 0x0F9E, 0x0F9E, 0x0F9E }, -{ 0x0F9F, 0x0F9F, 0x0F9F }, -{ 0x0FA0, 0x0FA0, 0x0FA0 }, -{ 0x0FA1, 0x0FA1, 0x0FA1 }, -{ 0x0FA2, 0x0FA2, 0x0FA2 }, -{ 0x0FA3, 0x0FA3, 0x0FA3 }, -{ 0x0FA4, 0x0FA4, 0x0FA4 }, -{ 0x0FA5, 0x0FA5, 0x0FA5 }, -{ 0x0FA6, 0x0FA6, 0x0FA6 }, -{ 0x0FA7, 0x0FA7, 0x0FA7 }, -{ 0x0FA8, 0x0FA8, 0x0FA8 }, -{ 0x0FA9, 0x0FA9, 0x0FA9 }, -{ 0x0FAA, 0x0FAA, 0x0FAA }, -{ 0x0FAB, 0x0FAB, 0x0FAB }, -{ 0x0FAC, 0x0FAC, 0x0FAC }, -{ 0x0FAD, 0x0FAD, 0x0FAD }, -{ 0x0FAE, 0x0FAE, 0x0FAE }, -{ 0x0FAF, 0x0FAF, 0x0FAF }, -{ 0x0FB0, 0x0FB0, 0x0FB0 }, -{ 0x0FB1, 0x0FB1, 0x0FB1 }, -{ 0x0FB2, 0x0FB2, 0x0FB2 }, -{ 0x0FB3, 0x0FB3, 0x0FB3 }, -{ 0x0FB4, 0x0FB4, 0x0FB4 }, -{ 0x0FB5, 0x0FB5, 0x0FB5 }, -{ 0x0FB6, 0x0FB6, 0x0FB6 }, -{ 0x0FB7, 0x0FB7, 0x0FB7 }, -{ 0x0FB8, 0x0FB8, 0x0FB8 }, -{ 0x0FB9, 0x0FB9, 0x0FB9 }, -{ 0x0FBA, 0x0FBA, 0x0FBA }, -{ 0x0FBB, 0x0FBB, 0x0FBB }, -{ 0x0FBC, 0x0FBC, 0x0FBC }, -{ 0x0FC6, 0x0FC6, 0x0FC6 }, -{ 0x1000, 0x1000, 0x1000 }, -{ 0x1001, 0x1001, 0x1001 }, -{ 0x1002, 0x1002, 0x1002 }, -{ 0x1003, 0x1003, 0x1003 }, -{ 0x1004, 0x1004, 0x1004 }, -{ 0x1005, 0x1005, 0x1005 }, -{ 0x1006, 0x1006, 0x1006 }, -{ 0x1007, 0x1007, 0x1007 }, -{ 0x1008, 0x1008, 0x1008 }, -{ 0x1009, 0x1009, 0x1009 }, -{ 0x100A, 0x100A, 0x100A }, -{ 0x100B, 0x100B, 0x100B }, -{ 0x100C, 0x100C, 0x100C }, -{ 0x100D, 0x100D, 0x100D }, -{ 0x100E, 0x100E, 0x100E }, -{ 0x100F, 0x100F, 0x100F }, -{ 0x1010, 0x1010, 0x1010 }, -{ 0x1011, 0x1011, 0x1011 }, -{ 0x1012, 0x1012, 0x1012 }, -{ 0x1013, 0x1013, 0x1013 }, -{ 0x1014, 0x1014, 0x1014 }, -{ 0x1015, 0x1015, 0x1015 }, -{ 0x1016, 0x1016, 0x1016 }, -{ 0x1017, 0x1017, 0x1017 }, -{ 0x1018, 0x1018, 0x1018 }, -{ 0x1019, 0x1019, 0x1019 }, -{ 0x101A, 0x101A, 0x101A }, -{ 0x101B, 0x101B, 0x101B }, -{ 0x101C, 0x101C, 0x101C }, -{ 0x101D, 0x101D, 0x101D }, -{ 0x101E, 0x101E, 0x101E }, -{ 0x101F, 0x101F, 0x101F }, -{ 0x1020, 0x1020, 0x1020 }, -{ 0x1021, 0x1021, 0x1021 }, -{ 0x1023, 0x1023, 0x1023 }, -{ 0x1024, 0x1024, 0x1024 }, -{ 0x1025, 0x1025, 0x1025 }, -{ 0x1026, 0x1026, 0x1026 }, -{ 0x1027, 0x1027, 0x1027 }, -{ 0x1029, 0x1029, 0x1029 }, -{ 0x102A, 0x102A, 0x102A }, -{ 0x102D, 0x102D, 0x102D }, -{ 0x102E, 0x102E, 0x102E }, -{ 0x102F, 0x102F, 0x102F }, -{ 0x1030, 0x1030, 0x1030 }, -{ 0x1032, 0x1032, 0x1032 }, -{ 0x1036, 0x1036, 0x1036 }, -{ 0x1037, 0x1037, 0x1037 }, -{ 0x1039, 0x1039, 0x1039 }, -{ 0x1050, 0x1050, 0x1050 }, -{ 0x1051, 0x1051, 0x1051 }, -{ 0x1052, 0x1052, 0x1052 }, -{ 0x1053, 0x1053, 0x1053 }, -{ 0x1054, 0x1054, 0x1054 }, -{ 0x1055, 0x1055, 0x1055 }, -{ 0x1058, 0x1058, 0x1058 }, -{ 0x1059, 0x1059, 0x1059 }, -{ 0x10A0, 0x10A0, 0x2D00 }, -{ 0x10A1, 0x10A1, 0x2D01 }, -{ 0x10A2, 0x10A2, 0x2D02 }, -{ 0x10A3, 0x10A3, 0x2D03 }, -{ 0x10A4, 0x10A4, 0x2D04 }, -{ 0x10A5, 0x10A5, 0x2D05 }, -{ 0x10A6, 0x10A6, 0x2D06 }, -{ 0x10A7, 0x10A7, 0x2D07 }, -{ 0x10A8, 0x10A8, 0x2D08 }, -{ 0x10A9, 0x10A9, 0x2D09 }, -{ 0x10AA, 0x10AA, 0x2D0A }, -{ 0x10AB, 0x10AB, 0x2D0B }, -{ 0x10AC, 0x10AC, 0x2D0C }, -{ 0x10AD, 0x10AD, 0x2D0D }, -{ 0x10AE, 0x10AE, 0x2D0E }, -{ 0x10AF, 0x10AF, 0x2D0F }, -{ 0x10B0, 0x10B0, 0x2D10 }, -{ 0x10B1, 0x10B1, 0x2D11 }, -{ 0x10B2, 0x10B2, 0x2D12 }, -{ 0x10B3, 0x10B3, 0x2D13 }, -{ 0x10B4, 0x10B4, 0x2D14 }, -{ 0x10B5, 0x10B5, 0x2D15 }, -{ 0x10B6, 0x10B6, 0x2D16 }, -{ 0x10B7, 0x10B7, 0x2D17 }, -{ 0x10B8, 0x10B8, 0x2D18 }, -{ 0x10B9, 0x10B9, 0x2D19 }, -{ 0x10BA, 0x10BA, 0x2D1A }, -{ 0x10BB, 0x10BB, 0x2D1B }, -{ 0x10BC, 0x10BC, 0x2D1C }, -{ 0x10BD, 0x10BD, 0x2D1D }, -{ 0x10BE, 0x10BE, 0x2D1E }, -{ 0x10BF, 0x10BF, 0x2D1F }, -{ 0x10C0, 0x10C0, 0x2D20 }, -{ 0x10C1, 0x10C1, 0x2D21 }, -{ 0x10C2, 0x10C2, 0x2D22 }, -{ 0x10C3, 0x10C3, 0x2D23 }, -{ 0x10C4, 0x10C4, 0x2D24 }, -{ 0x10C5, 0x10C5, 0x2D25 }, -{ 0x10D0, 0x10D0, 0x10D0 }, -{ 0x10D1, 0x10D1, 0x10D1 }, -{ 0x10D2, 0x10D2, 0x10D2 }, -{ 0x10D3, 0x10D3, 0x10D3 }, -{ 0x10D4, 0x10D4, 0x10D4 }, -{ 0x10D5, 0x10D5, 0x10D5 }, -{ 0x10D6, 0x10D6, 0x10D6 }, -{ 0x10D7, 0x10D7, 0x10D7 }, -{ 0x10D8, 0x10D8, 0x10D8 }, -{ 0x10D9, 0x10D9, 0x10D9 }, -{ 0x10DA, 0x10DA, 0x10DA }, -{ 0x10DB, 0x10DB, 0x10DB }, -{ 0x10DC, 0x10DC, 0x10DC }, -{ 0x10DD, 0x10DD, 0x10DD }, -{ 0x10DE, 0x10DE, 0x10DE }, -{ 0x10DF, 0x10DF, 0x10DF }, -{ 0x10E0, 0x10E0, 0x10E0 }, -{ 0x10E1, 0x10E1, 0x10E1 }, -{ 0x10E2, 0x10E2, 0x10E2 }, -{ 0x10E3, 0x10E3, 0x10E3 }, -{ 0x10E4, 0x10E4, 0x10E4 }, -{ 0x10E5, 0x10E5, 0x10E5 }, -{ 0x10E6, 0x10E6, 0x10E6 }, -{ 0x10E7, 0x10E7, 0x10E7 }, -{ 0x10E8, 0x10E8, 0x10E8 }, -{ 0x10E9, 0x10E9, 0x10E9 }, -{ 0x10EA, 0x10EA, 0x10EA }, -{ 0x10EB, 0x10EB, 0x10EB }, -{ 0x10EC, 0x10EC, 0x10EC }, -{ 0x10ED, 0x10ED, 0x10ED }, -{ 0x10EE, 0x10EE, 0x10EE }, -{ 0x10EF, 0x10EF, 0x10EF }, -{ 0x10F0, 0x10F0, 0x10F0 }, -{ 0x10F1, 0x10F1, 0x10F1 }, -{ 0x10F2, 0x10F2, 0x10F2 }, -{ 0x10F3, 0x10F3, 0x10F3 }, -{ 0x10F4, 0x10F4, 0x10F4 }, -{ 0x10F5, 0x10F5, 0x10F5 }, -{ 0x10F6, 0x10F6, 0x10F6 }, -{ 0x10F7, 0x10F7, 0x10F7 }, -{ 0x10F8, 0x10F8, 0x10F8 }, -{ 0x10F9, 0x10F9, 0x10F9 }, -{ 0x10FA, 0x10FA, 0x10FA }, -{ 0x10FC, 0x10FC, 0x10FC }, -{ 0x1100, 0x1100, 0x1100 }, -{ 0x1101, 0x1101, 0x1101 }, -{ 0x1102, 0x1102, 0x1102 }, -{ 0x1103, 0x1103, 0x1103 }, -{ 0x1104, 0x1104, 0x1104 }, -{ 0x1105, 0x1105, 0x1105 }, -{ 0x1106, 0x1106, 0x1106 }, -{ 0x1107, 0x1107, 0x1107 }, -{ 0x1108, 0x1108, 0x1108 }, -{ 0x1109, 0x1109, 0x1109 }, -{ 0x110A, 0x110A, 0x110A }, -{ 0x110B, 0x110B, 0x110B }, -{ 0x110C, 0x110C, 0x110C }, -{ 0x110D, 0x110D, 0x110D }, -{ 0x110E, 0x110E, 0x110E }, -{ 0x110F, 0x110F, 0x110F }, -{ 0x1110, 0x1110, 0x1110 }, -{ 0x1111, 0x1111, 0x1111 }, -{ 0x1112, 0x1112, 0x1112 }, -{ 0x1113, 0x1113, 0x1113 }, -{ 0x1114, 0x1114, 0x1114 }, -{ 0x1115, 0x1115, 0x1115 }, -{ 0x1116, 0x1116, 0x1116 }, -{ 0x1117, 0x1117, 0x1117 }, -{ 0x1118, 0x1118, 0x1118 }, -{ 0x1119, 0x1119, 0x1119 }, -{ 0x111A, 0x111A, 0x111A }, -{ 0x111B, 0x111B, 0x111B }, -{ 0x111C, 0x111C, 0x111C }, -{ 0x111D, 0x111D, 0x111D }, -{ 0x111E, 0x111E, 0x111E }, -{ 0x111F, 0x111F, 0x111F }, -{ 0x1120, 0x1120, 0x1120 }, -{ 0x1121, 0x1121, 0x1121 }, -{ 0x1122, 0x1122, 0x1122 }, -{ 0x1123, 0x1123, 0x1123 }, -{ 0x1124, 0x1124, 0x1124 }, -{ 0x1125, 0x1125, 0x1125 }, -{ 0x1126, 0x1126, 0x1126 }, -{ 0x1127, 0x1127, 0x1127 }, -{ 0x1128, 0x1128, 0x1128 }, -{ 0x1129, 0x1129, 0x1129 }, -{ 0x112A, 0x112A, 0x112A }, -{ 0x112B, 0x112B, 0x112B }, -{ 0x112C, 0x112C, 0x112C }, -{ 0x112D, 0x112D, 0x112D }, -{ 0x112E, 0x112E, 0x112E }, -{ 0x112F, 0x112F, 0x112F }, -{ 0x1130, 0x1130, 0x1130 }, -{ 0x1131, 0x1131, 0x1131 }, -{ 0x1132, 0x1132, 0x1132 }, -{ 0x1133, 0x1133, 0x1133 }, -{ 0x1134, 0x1134, 0x1134 }, -{ 0x1135, 0x1135, 0x1135 }, -{ 0x1136, 0x1136, 0x1136 }, -{ 0x1137, 0x1137, 0x1137 }, -{ 0x1138, 0x1138, 0x1138 }, -{ 0x1139, 0x1139, 0x1139 }, -{ 0x113A, 0x113A, 0x113A }, -{ 0x113B, 0x113B, 0x113B }, -{ 0x113C, 0x113C, 0x113C }, -{ 0x113D, 0x113D, 0x113D }, -{ 0x113E, 0x113E, 0x113E }, -{ 0x113F, 0x113F, 0x113F }, -{ 0x1140, 0x1140, 0x1140 }, -{ 0x1141, 0x1141, 0x1141 }, -{ 0x1142, 0x1142, 0x1142 }, -{ 0x1143, 0x1143, 0x1143 }, -{ 0x1144, 0x1144, 0x1144 }, -{ 0x1145, 0x1145, 0x1145 }, -{ 0x1146, 0x1146, 0x1146 }, -{ 0x1147, 0x1147, 0x1147 }, -{ 0x1148, 0x1148, 0x1148 }, -{ 0x1149, 0x1149, 0x1149 }, -{ 0x114A, 0x114A, 0x114A }, -{ 0x114B, 0x114B, 0x114B }, -{ 0x114C, 0x114C, 0x114C }, -{ 0x114D, 0x114D, 0x114D }, -{ 0x114E, 0x114E, 0x114E }, -{ 0x114F, 0x114F, 0x114F }, -{ 0x1150, 0x1150, 0x1150 }, -{ 0x1151, 0x1151, 0x1151 }, -{ 0x1152, 0x1152, 0x1152 }, -{ 0x1153, 0x1153, 0x1153 }, -{ 0x1154, 0x1154, 0x1154 }, -{ 0x1155, 0x1155, 0x1155 }, -{ 0x1156, 0x1156, 0x1156 }, -{ 0x1157, 0x1157, 0x1157 }, -{ 0x1158, 0x1158, 0x1158 }, -{ 0x1159, 0x1159, 0x1159 }, -{ 0x115F, 0x115F, 0x115F }, -{ 0x1160, 0x1160, 0x1160 }, -{ 0x1161, 0x1161, 0x1161 }, -{ 0x1162, 0x1162, 0x1162 }, -{ 0x1163, 0x1163, 0x1163 }, -{ 0x1164, 0x1164, 0x1164 }, -{ 0x1165, 0x1165, 0x1165 }, -{ 0x1166, 0x1166, 0x1166 }, -{ 0x1167, 0x1167, 0x1167 }, -{ 0x1168, 0x1168, 0x1168 }, -{ 0x1169, 0x1169, 0x1169 }, -{ 0x116A, 0x116A, 0x116A }, -{ 0x116B, 0x116B, 0x116B }, -{ 0x116C, 0x116C, 0x116C }, -{ 0x116D, 0x116D, 0x116D }, -{ 0x116E, 0x116E, 0x116E }, -{ 0x116F, 0x116F, 0x116F }, -{ 0x1170, 0x1170, 0x1170 }, -{ 0x1171, 0x1171, 0x1171 }, -{ 0x1172, 0x1172, 0x1172 }, -{ 0x1173, 0x1173, 0x1173 }, -{ 0x1174, 0x1174, 0x1174 }, -{ 0x1175, 0x1175, 0x1175 }, -{ 0x1176, 0x1176, 0x1176 }, -{ 0x1177, 0x1177, 0x1177 }, -{ 0x1178, 0x1178, 0x1178 }, -{ 0x1179, 0x1179, 0x1179 }, -{ 0x117A, 0x117A, 0x117A }, -{ 0x117B, 0x117B, 0x117B }, -{ 0x117C, 0x117C, 0x117C }, -{ 0x117D, 0x117D, 0x117D }, -{ 0x117E, 0x117E, 0x117E }, -{ 0x117F, 0x117F, 0x117F }, -{ 0x1180, 0x1180, 0x1180 }, -{ 0x1181, 0x1181, 0x1181 }, -{ 0x1182, 0x1182, 0x1182 }, -{ 0x1183, 0x1183, 0x1183 }, -{ 0x1184, 0x1184, 0x1184 }, -{ 0x1185, 0x1185, 0x1185 }, -{ 0x1186, 0x1186, 0x1186 }, -{ 0x1187, 0x1187, 0x1187 }, -{ 0x1188, 0x1188, 0x1188 }, -{ 0x1189, 0x1189, 0x1189 }, -{ 0x118A, 0x118A, 0x118A }, -{ 0x118B, 0x118B, 0x118B }, -{ 0x118C, 0x118C, 0x118C }, -{ 0x118D, 0x118D, 0x118D }, -{ 0x118E, 0x118E, 0x118E }, -{ 0x118F, 0x118F, 0x118F }, -{ 0x1190, 0x1190, 0x1190 }, -{ 0x1191, 0x1191, 0x1191 }, -{ 0x1192, 0x1192, 0x1192 }, -{ 0x1193, 0x1193, 0x1193 }, -{ 0x1194, 0x1194, 0x1194 }, -{ 0x1195, 0x1195, 0x1195 }, -{ 0x1196, 0x1196, 0x1196 }, -{ 0x1197, 0x1197, 0x1197 }, -{ 0x1198, 0x1198, 0x1198 }, -{ 0x1199, 0x1199, 0x1199 }, -{ 0x119A, 0x119A, 0x119A }, -{ 0x119B, 0x119B, 0x119B }, -{ 0x119C, 0x119C, 0x119C }, -{ 0x119D, 0x119D, 0x119D }, -{ 0x119E, 0x119E, 0x119E }, -{ 0x119F, 0x119F, 0x119F }, -{ 0x11A0, 0x11A0, 0x11A0 }, -{ 0x11A1, 0x11A1, 0x11A1 }, -{ 0x11A2, 0x11A2, 0x11A2 }, -{ 0x11A8, 0x11A8, 0x11A8 }, -{ 0x11A9, 0x11A9, 0x11A9 }, -{ 0x11AA, 0x11AA, 0x11AA }, -{ 0x11AB, 0x11AB, 0x11AB }, -{ 0x11AC, 0x11AC, 0x11AC }, -{ 0x11AD, 0x11AD, 0x11AD }, -{ 0x11AE, 0x11AE, 0x11AE }, -{ 0x11AF, 0x11AF, 0x11AF }, -{ 0x11B0, 0x11B0, 0x11B0 }, -{ 0x11B1, 0x11B1, 0x11B1 }, -{ 0x11B2, 0x11B2, 0x11B2 }, -{ 0x11B3, 0x11B3, 0x11B3 }, -{ 0x11B4, 0x11B4, 0x11B4 }, -{ 0x11B5, 0x11B5, 0x11B5 }, -{ 0x11B6, 0x11B6, 0x11B6 }, -{ 0x11B7, 0x11B7, 0x11B7 }, -{ 0x11B8, 0x11B8, 0x11B8 }, -{ 0x11B9, 0x11B9, 0x11B9 }, -{ 0x11BA, 0x11BA, 0x11BA }, -{ 0x11BB, 0x11BB, 0x11BB }, -{ 0x11BC, 0x11BC, 0x11BC }, -{ 0x11BD, 0x11BD, 0x11BD }, -{ 0x11BE, 0x11BE, 0x11BE }, -{ 0x11BF, 0x11BF, 0x11BF }, -{ 0x11C0, 0x11C0, 0x11C0 }, -{ 0x11C1, 0x11C1, 0x11C1 }, -{ 0x11C2, 0x11C2, 0x11C2 }, -{ 0x11C3, 0x11C3, 0x11C3 }, -{ 0x11C4, 0x11C4, 0x11C4 }, -{ 0x11C5, 0x11C5, 0x11C5 }, -{ 0x11C6, 0x11C6, 0x11C6 }, -{ 0x11C7, 0x11C7, 0x11C7 }, -{ 0x11C8, 0x11C8, 0x11C8 }, -{ 0x11C9, 0x11C9, 0x11C9 }, -{ 0x11CA, 0x11CA, 0x11CA }, -{ 0x11CB, 0x11CB, 0x11CB }, -{ 0x11CC, 0x11CC, 0x11CC }, -{ 0x11CD, 0x11CD, 0x11CD }, -{ 0x11CE, 0x11CE, 0x11CE }, -{ 0x11CF, 0x11CF, 0x11CF }, -{ 0x11D0, 0x11D0, 0x11D0 }, -{ 0x11D1, 0x11D1, 0x11D1 }, -{ 0x11D2, 0x11D2, 0x11D2 }, -{ 0x11D3, 0x11D3, 0x11D3 }, -{ 0x11D4, 0x11D4, 0x11D4 }, -{ 0x11D5, 0x11D5, 0x11D5 }, -{ 0x11D6, 0x11D6, 0x11D6 }, -{ 0x11D7, 0x11D7, 0x11D7 }, -{ 0x11D8, 0x11D8, 0x11D8 }, -{ 0x11D9, 0x11D9, 0x11D9 }, -{ 0x11DA, 0x11DA, 0x11DA }, -{ 0x11DB, 0x11DB, 0x11DB }, -{ 0x11DC, 0x11DC, 0x11DC }, -{ 0x11DD, 0x11DD, 0x11DD }, -{ 0x11DE, 0x11DE, 0x11DE }, -{ 0x11DF, 0x11DF, 0x11DF }, -{ 0x11E0, 0x11E0, 0x11E0 }, -{ 0x11E1, 0x11E1, 0x11E1 }, -{ 0x11E2, 0x11E2, 0x11E2 }, -{ 0x11E3, 0x11E3, 0x11E3 }, -{ 0x11E4, 0x11E4, 0x11E4 }, -{ 0x11E5, 0x11E5, 0x11E5 }, -{ 0x11E6, 0x11E6, 0x11E6 }, -{ 0x11E7, 0x11E7, 0x11E7 }, -{ 0x11E8, 0x11E8, 0x11E8 }, -{ 0x11E9, 0x11E9, 0x11E9 }, -{ 0x11EA, 0x11EA, 0x11EA }, -{ 0x11EB, 0x11EB, 0x11EB }, -{ 0x11EC, 0x11EC, 0x11EC }, -{ 0x11ED, 0x11ED, 0x11ED }, -{ 0x11EE, 0x11EE, 0x11EE }, -{ 0x11EF, 0x11EF, 0x11EF }, -{ 0x11F0, 0x11F0, 0x11F0 }, -{ 0x11F1, 0x11F1, 0x11F1 }, -{ 0x11F2, 0x11F2, 0x11F2 }, -{ 0x11F3, 0x11F3, 0x11F3 }, -{ 0x11F4, 0x11F4, 0x11F4 }, -{ 0x11F5, 0x11F5, 0x11F5 }, -{ 0x11F6, 0x11F6, 0x11F6 }, -{ 0x11F7, 0x11F7, 0x11F7 }, -{ 0x11F8, 0x11F8, 0x11F8 }, -{ 0x11F9, 0x11F9, 0x11F9 }, -{ 0x1200, 0x1200, 0x1200 }, -{ 0x1201, 0x1201, 0x1201 }, -{ 0x1202, 0x1202, 0x1202 }, -{ 0x1203, 0x1203, 0x1203 }, -{ 0x1204, 0x1204, 0x1204 }, -{ 0x1205, 0x1205, 0x1205 }, -{ 0x1206, 0x1206, 0x1206 }, -{ 0x1207, 0x1207, 0x1207 }, -{ 0x1208, 0x1208, 0x1208 }, -{ 0x1209, 0x1209, 0x1209 }, -{ 0x120A, 0x120A, 0x120A }, -{ 0x120B, 0x120B, 0x120B }, -{ 0x120C, 0x120C, 0x120C }, -{ 0x120D, 0x120D, 0x120D }, -{ 0x120E, 0x120E, 0x120E }, -{ 0x120F, 0x120F, 0x120F }, -{ 0x1210, 0x1210, 0x1210 }, -{ 0x1211, 0x1211, 0x1211 }, -{ 0x1212, 0x1212, 0x1212 }, -{ 0x1213, 0x1213, 0x1213 }, -{ 0x1214, 0x1214, 0x1214 }, -{ 0x1215, 0x1215, 0x1215 }, -{ 0x1216, 0x1216, 0x1216 }, -{ 0x1217, 0x1217, 0x1217 }, -{ 0x1218, 0x1218, 0x1218 }, -{ 0x1219, 0x1219, 0x1219 }, -{ 0x121A, 0x121A, 0x121A }, -{ 0x121B, 0x121B, 0x121B }, -{ 0x121C, 0x121C, 0x121C }, -{ 0x121D, 0x121D, 0x121D }, -{ 0x121E, 0x121E, 0x121E }, -{ 0x121F, 0x121F, 0x121F }, -{ 0x1220, 0x1220, 0x1220 }, -{ 0x1221, 0x1221, 0x1221 }, -{ 0x1222, 0x1222, 0x1222 }, -{ 0x1223, 0x1223, 0x1223 }, -{ 0x1224, 0x1224, 0x1224 }, -{ 0x1225, 0x1225, 0x1225 }, -{ 0x1226, 0x1226, 0x1226 }, -{ 0x1227, 0x1227, 0x1227 }, -{ 0x1228, 0x1228, 0x1228 }, -{ 0x1229, 0x1229, 0x1229 }, -{ 0x122A, 0x122A, 0x122A }, -{ 0x122B, 0x122B, 0x122B }, -{ 0x122C, 0x122C, 0x122C }, -{ 0x122D, 0x122D, 0x122D }, -{ 0x122E, 0x122E, 0x122E }, -{ 0x122F, 0x122F, 0x122F }, -{ 0x1230, 0x1230, 0x1230 }, -{ 0x1231, 0x1231, 0x1231 }, -{ 0x1232, 0x1232, 0x1232 }, -{ 0x1233, 0x1233, 0x1233 }, -{ 0x1234, 0x1234, 0x1234 }, -{ 0x1235, 0x1235, 0x1235 }, -{ 0x1236, 0x1236, 0x1236 }, -{ 0x1237, 0x1237, 0x1237 }, -{ 0x1238, 0x1238, 0x1238 }, -{ 0x1239, 0x1239, 0x1239 }, -{ 0x123A, 0x123A, 0x123A }, -{ 0x123B, 0x123B, 0x123B }, -{ 0x123C, 0x123C, 0x123C }, -{ 0x123D, 0x123D, 0x123D }, -{ 0x123E, 0x123E, 0x123E }, -{ 0x123F, 0x123F, 0x123F }, -{ 0x1240, 0x1240, 0x1240 }, -{ 0x1241, 0x1241, 0x1241 }, -{ 0x1242, 0x1242, 0x1242 }, -{ 0x1243, 0x1243, 0x1243 }, -{ 0x1244, 0x1244, 0x1244 }, -{ 0x1245, 0x1245, 0x1245 }, -{ 0x1246, 0x1246, 0x1246 }, -{ 0x1247, 0x1247, 0x1247 }, -{ 0x1248, 0x1248, 0x1248 }, -{ 0x124A, 0x124A, 0x124A }, -{ 0x124B, 0x124B, 0x124B }, -{ 0x124C, 0x124C, 0x124C }, -{ 0x124D, 0x124D, 0x124D }, -{ 0x1250, 0x1250, 0x1250 }, -{ 0x1251, 0x1251, 0x1251 }, -{ 0x1252, 0x1252, 0x1252 }, -{ 0x1253, 0x1253, 0x1253 }, -{ 0x1254, 0x1254, 0x1254 }, -{ 0x1255, 0x1255, 0x1255 }, -{ 0x1256, 0x1256, 0x1256 }, -{ 0x1258, 0x1258, 0x1258 }, -{ 0x125A, 0x125A, 0x125A }, -{ 0x125B, 0x125B, 0x125B }, -{ 0x125C, 0x125C, 0x125C }, -{ 0x125D, 0x125D, 0x125D }, -{ 0x1260, 0x1260, 0x1260 }, -{ 0x1261, 0x1261, 0x1261 }, -{ 0x1262, 0x1262, 0x1262 }, -{ 0x1263, 0x1263, 0x1263 }, -{ 0x1264, 0x1264, 0x1264 }, -{ 0x1265, 0x1265, 0x1265 }, -{ 0x1266, 0x1266, 0x1266 }, -{ 0x1267, 0x1267, 0x1267 }, -{ 0x1268, 0x1268, 0x1268 }, -{ 0x1269, 0x1269, 0x1269 }, -{ 0x126A, 0x126A, 0x126A }, -{ 0x126B, 0x126B, 0x126B }, -{ 0x126C, 0x126C, 0x126C }, -{ 0x126D, 0x126D, 0x126D }, -{ 0x126E, 0x126E, 0x126E }, -{ 0x126F, 0x126F, 0x126F }, -{ 0x1270, 0x1270, 0x1270 }, -{ 0x1271, 0x1271, 0x1271 }, -{ 0x1272, 0x1272, 0x1272 }, -{ 0x1273, 0x1273, 0x1273 }, -{ 0x1274, 0x1274, 0x1274 }, -{ 0x1275, 0x1275, 0x1275 }, -{ 0x1276, 0x1276, 0x1276 }, -{ 0x1277, 0x1277, 0x1277 }, -{ 0x1278, 0x1278, 0x1278 }, -{ 0x1279, 0x1279, 0x1279 }, -{ 0x127A, 0x127A, 0x127A }, -{ 0x127B, 0x127B, 0x127B }, -{ 0x127C, 0x127C, 0x127C }, -{ 0x127D, 0x127D, 0x127D }, -{ 0x127E, 0x127E, 0x127E }, -{ 0x127F, 0x127F, 0x127F }, -{ 0x1280, 0x1280, 0x1280 }, -{ 0x1281, 0x1281, 0x1281 }, -{ 0x1282, 0x1282, 0x1282 }, -{ 0x1283, 0x1283, 0x1283 }, -{ 0x1284, 0x1284, 0x1284 }, -{ 0x1285, 0x1285, 0x1285 }, -{ 0x1286, 0x1286, 0x1286 }, -{ 0x1287, 0x1287, 0x1287 }, -{ 0x1288, 0x1288, 0x1288 }, -{ 0x128A, 0x128A, 0x128A }, -{ 0x128B, 0x128B, 0x128B }, -{ 0x128C, 0x128C, 0x128C }, -{ 0x128D, 0x128D, 0x128D }, -{ 0x1290, 0x1290, 0x1290 }, -{ 0x1291, 0x1291, 0x1291 }, -{ 0x1292, 0x1292, 0x1292 }, -{ 0x1293, 0x1293, 0x1293 }, -{ 0x1294, 0x1294, 0x1294 }, -{ 0x1295, 0x1295, 0x1295 }, -{ 0x1296, 0x1296, 0x1296 }, -{ 0x1297, 0x1297, 0x1297 }, -{ 0x1298, 0x1298, 0x1298 }, -{ 0x1299, 0x1299, 0x1299 }, -{ 0x129A, 0x129A, 0x129A }, -{ 0x129B, 0x129B, 0x129B }, -{ 0x129C, 0x129C, 0x129C }, -{ 0x129D, 0x129D, 0x129D }, -{ 0x129E, 0x129E, 0x129E }, -{ 0x129F, 0x129F, 0x129F }, -{ 0x12A0, 0x12A0, 0x12A0 }, -{ 0x12A1, 0x12A1, 0x12A1 }, -{ 0x12A2, 0x12A2, 0x12A2 }, -{ 0x12A3, 0x12A3, 0x12A3 }, -{ 0x12A4, 0x12A4, 0x12A4 }, -{ 0x12A5, 0x12A5, 0x12A5 }, -{ 0x12A6, 0x12A6, 0x12A6 }, -{ 0x12A7, 0x12A7, 0x12A7 }, -{ 0x12A8, 0x12A8, 0x12A8 }, -{ 0x12A9, 0x12A9, 0x12A9 }, -{ 0x12AA, 0x12AA, 0x12AA }, -{ 0x12AB, 0x12AB, 0x12AB }, -{ 0x12AC, 0x12AC, 0x12AC }, -{ 0x12AD, 0x12AD, 0x12AD }, -{ 0x12AE, 0x12AE, 0x12AE }, -{ 0x12AF, 0x12AF, 0x12AF }, -{ 0x12B0, 0x12B0, 0x12B0 }, -{ 0x12B2, 0x12B2, 0x12B2 }, -{ 0x12B3, 0x12B3, 0x12B3 }, -{ 0x12B4, 0x12B4, 0x12B4 }, -{ 0x12B5, 0x12B5, 0x12B5 }, -{ 0x12B8, 0x12B8, 0x12B8 }, -{ 0x12B9, 0x12B9, 0x12B9 }, -{ 0x12BA, 0x12BA, 0x12BA }, -{ 0x12BB, 0x12BB, 0x12BB }, -{ 0x12BC, 0x12BC, 0x12BC }, -{ 0x12BD, 0x12BD, 0x12BD }, -{ 0x12BE, 0x12BE, 0x12BE }, -{ 0x12C0, 0x12C0, 0x12C0 }, -{ 0x12C2, 0x12C2, 0x12C2 }, -{ 0x12C3, 0x12C3, 0x12C3 }, -{ 0x12C4, 0x12C4, 0x12C4 }, -{ 0x12C5, 0x12C5, 0x12C5 }, -{ 0x12C8, 0x12C8, 0x12C8 }, -{ 0x12C9, 0x12C9, 0x12C9 }, -{ 0x12CA, 0x12CA, 0x12CA }, -{ 0x12CB, 0x12CB, 0x12CB }, -{ 0x12CC, 0x12CC, 0x12CC }, -{ 0x12CD, 0x12CD, 0x12CD }, -{ 0x12CE, 0x12CE, 0x12CE }, -{ 0x12CF, 0x12CF, 0x12CF }, -{ 0x12D0, 0x12D0, 0x12D0 }, -{ 0x12D1, 0x12D1, 0x12D1 }, -{ 0x12D2, 0x12D2, 0x12D2 }, -{ 0x12D3, 0x12D3, 0x12D3 }, -{ 0x12D4, 0x12D4, 0x12D4 }, -{ 0x12D5, 0x12D5, 0x12D5 }, -{ 0x12D6, 0x12D6, 0x12D6 }, -{ 0x12D8, 0x12D8, 0x12D8 }, -{ 0x12D9, 0x12D9, 0x12D9 }, -{ 0x12DA, 0x12DA, 0x12DA }, -{ 0x12DB, 0x12DB, 0x12DB }, -{ 0x12DC, 0x12DC, 0x12DC }, -{ 0x12DD, 0x12DD, 0x12DD }, -{ 0x12DE, 0x12DE, 0x12DE }, -{ 0x12DF, 0x12DF, 0x12DF }, -{ 0x12E0, 0x12E0, 0x12E0 }, -{ 0x12E1, 0x12E1, 0x12E1 }, -{ 0x12E2, 0x12E2, 0x12E2 }, -{ 0x12E3, 0x12E3, 0x12E3 }, -{ 0x12E4, 0x12E4, 0x12E4 }, -{ 0x12E5, 0x12E5, 0x12E5 }, -{ 0x12E6, 0x12E6, 0x12E6 }, -{ 0x12E7, 0x12E7, 0x12E7 }, -{ 0x12E8, 0x12E8, 0x12E8 }, -{ 0x12E9, 0x12E9, 0x12E9 }, -{ 0x12EA, 0x12EA, 0x12EA }, -{ 0x12EB, 0x12EB, 0x12EB }, -{ 0x12EC, 0x12EC, 0x12EC }, -{ 0x12ED, 0x12ED, 0x12ED }, -{ 0x12EE, 0x12EE, 0x12EE }, -{ 0x12EF, 0x12EF, 0x12EF }, -{ 0x12F0, 0x12F0, 0x12F0 }, -{ 0x12F1, 0x12F1, 0x12F1 }, -{ 0x12F2, 0x12F2, 0x12F2 }, -{ 0x12F3, 0x12F3, 0x12F3 }, -{ 0x12F4, 0x12F4, 0x12F4 }, -{ 0x12F5, 0x12F5, 0x12F5 }, -{ 0x12F6, 0x12F6, 0x12F6 }, -{ 0x12F7, 0x12F7, 0x12F7 }, -{ 0x12F8, 0x12F8, 0x12F8 }, -{ 0x12F9, 0x12F9, 0x12F9 }, -{ 0x12FA, 0x12FA, 0x12FA }, -{ 0x12FB, 0x12FB, 0x12FB }, -{ 0x12FC, 0x12FC, 0x12FC }, -{ 0x12FD, 0x12FD, 0x12FD }, -{ 0x12FE, 0x12FE, 0x12FE }, -{ 0x12FF, 0x12FF, 0x12FF }, -{ 0x1300, 0x1300, 0x1300 }, -{ 0x1301, 0x1301, 0x1301 }, -{ 0x1302, 0x1302, 0x1302 }, -{ 0x1303, 0x1303, 0x1303 }, -{ 0x1304, 0x1304, 0x1304 }, -{ 0x1305, 0x1305, 0x1305 }, -{ 0x1306, 0x1306, 0x1306 }, -{ 0x1307, 0x1307, 0x1307 }, -{ 0x1308, 0x1308, 0x1308 }, -{ 0x1309, 0x1309, 0x1309 }, -{ 0x130A, 0x130A, 0x130A }, -{ 0x130B, 0x130B, 0x130B }, -{ 0x130C, 0x130C, 0x130C }, -{ 0x130D, 0x130D, 0x130D }, -{ 0x130E, 0x130E, 0x130E }, -{ 0x130F, 0x130F, 0x130F }, -{ 0x1310, 0x1310, 0x1310 }, -{ 0x1312, 0x1312, 0x1312 }, -{ 0x1313, 0x1313, 0x1313 }, -{ 0x1314, 0x1314, 0x1314 }, -{ 0x1315, 0x1315, 0x1315 }, -{ 0x1318, 0x1318, 0x1318 }, -{ 0x1319, 0x1319, 0x1319 }, -{ 0x131A, 0x131A, 0x131A }, -{ 0x131B, 0x131B, 0x131B }, -{ 0x131C, 0x131C, 0x131C }, -{ 0x131D, 0x131D, 0x131D }, -{ 0x131E, 0x131E, 0x131E }, -{ 0x131F, 0x131F, 0x131F }, -{ 0x1320, 0x1320, 0x1320 }, -{ 0x1321, 0x1321, 0x1321 }, -{ 0x1322, 0x1322, 0x1322 }, -{ 0x1323, 0x1323, 0x1323 }, -{ 0x1324, 0x1324, 0x1324 }, -{ 0x1325, 0x1325, 0x1325 }, -{ 0x1326, 0x1326, 0x1326 }, -{ 0x1327, 0x1327, 0x1327 }, -{ 0x1328, 0x1328, 0x1328 }, -{ 0x1329, 0x1329, 0x1329 }, -{ 0x132A, 0x132A, 0x132A }, -{ 0x132B, 0x132B, 0x132B }, -{ 0x132C, 0x132C, 0x132C }, -{ 0x132D, 0x132D, 0x132D }, -{ 0x132E, 0x132E, 0x132E }, -{ 0x132F, 0x132F, 0x132F }, -{ 0x1330, 0x1330, 0x1330 }, -{ 0x1331, 0x1331, 0x1331 }, -{ 0x1332, 0x1332, 0x1332 }, -{ 0x1333, 0x1333, 0x1333 }, -{ 0x1334, 0x1334, 0x1334 }, -{ 0x1335, 0x1335, 0x1335 }, -{ 0x1336, 0x1336, 0x1336 }, -{ 0x1337, 0x1337, 0x1337 }, -{ 0x1338, 0x1338, 0x1338 }, -{ 0x1339, 0x1339, 0x1339 }, -{ 0x133A, 0x133A, 0x133A }, -{ 0x133B, 0x133B, 0x133B }, -{ 0x133C, 0x133C, 0x133C }, -{ 0x133D, 0x133D, 0x133D }, -{ 0x133E, 0x133E, 0x133E }, -{ 0x133F, 0x133F, 0x133F }, -{ 0x1340, 0x1340, 0x1340 }, -{ 0x1341, 0x1341, 0x1341 }, -{ 0x1342, 0x1342, 0x1342 }, -{ 0x1343, 0x1343, 0x1343 }, -{ 0x1344, 0x1344, 0x1344 }, -{ 0x1345, 0x1345, 0x1345 }, -{ 0x1346, 0x1346, 0x1346 }, -{ 0x1347, 0x1347, 0x1347 }, -{ 0x1348, 0x1348, 0x1348 }, -{ 0x1349, 0x1349, 0x1349 }, -{ 0x134A, 0x134A, 0x134A }, -{ 0x134B, 0x134B, 0x134B }, -{ 0x134C, 0x134C, 0x134C }, -{ 0x134D, 0x134D, 0x134D }, -{ 0x134E, 0x134E, 0x134E }, -{ 0x134F, 0x134F, 0x134F }, -{ 0x1350, 0x1350, 0x1350 }, -{ 0x1351, 0x1351, 0x1351 }, -{ 0x1352, 0x1352, 0x1352 }, -{ 0x1353, 0x1353, 0x1353 }, -{ 0x1354, 0x1354, 0x1354 }, -{ 0x1355, 0x1355, 0x1355 }, -{ 0x1356, 0x1356, 0x1356 }, -{ 0x1357, 0x1357, 0x1357 }, -{ 0x1358, 0x1358, 0x1358 }, -{ 0x1359, 0x1359, 0x1359 }, -{ 0x135A, 0x135A, 0x135A }, -{ 0x135F, 0x135F, 0x135F }, -{ 0x1380, 0x1380, 0x1380 }, -{ 0x1381, 0x1381, 0x1381 }, -{ 0x1382, 0x1382, 0x1382 }, -{ 0x1383, 0x1383, 0x1383 }, -{ 0x1384, 0x1384, 0x1384 }, -{ 0x1385, 0x1385, 0x1385 }, -{ 0x1386, 0x1386, 0x1386 }, -{ 0x1387, 0x1387, 0x1387 }, -{ 0x1388, 0x1388, 0x1388 }, -{ 0x1389, 0x1389, 0x1389 }, -{ 0x138A, 0x138A, 0x138A }, -{ 0x138B, 0x138B, 0x138B }, -{ 0x138C, 0x138C, 0x138C }, -{ 0x138D, 0x138D, 0x138D }, -{ 0x138E, 0x138E, 0x138E }, -{ 0x138F, 0x138F, 0x138F }, -{ 0x13A0, 0x13A0, 0x13A0 }, -{ 0x13A1, 0x13A1, 0x13A1 }, -{ 0x13A2, 0x13A2, 0x13A2 }, -{ 0x13A3, 0x13A3, 0x13A3 }, -{ 0x13A4, 0x13A4, 0x13A4 }, -{ 0x13A5, 0x13A5, 0x13A5 }, -{ 0x13A6, 0x13A6, 0x13A6 }, -{ 0x13A7, 0x13A7, 0x13A7 }, -{ 0x13A8, 0x13A8, 0x13A8 }, -{ 0x13A9, 0x13A9, 0x13A9 }, -{ 0x13AA, 0x13AA, 0x13AA }, -{ 0x13AB, 0x13AB, 0x13AB }, -{ 0x13AC, 0x13AC, 0x13AC }, -{ 0x13AD, 0x13AD, 0x13AD }, -{ 0x13AE, 0x13AE, 0x13AE }, -{ 0x13AF, 0x13AF, 0x13AF }, -{ 0x13B0, 0x13B0, 0x13B0 }, -{ 0x13B1, 0x13B1, 0x13B1 }, -{ 0x13B2, 0x13B2, 0x13B2 }, -{ 0x13B3, 0x13B3, 0x13B3 }, -{ 0x13B4, 0x13B4, 0x13B4 }, -{ 0x13B5, 0x13B5, 0x13B5 }, -{ 0x13B6, 0x13B6, 0x13B6 }, -{ 0x13B7, 0x13B7, 0x13B7 }, -{ 0x13B8, 0x13B8, 0x13B8 }, -{ 0x13B9, 0x13B9, 0x13B9 }, -{ 0x13BA, 0x13BA, 0x13BA }, -{ 0x13BB, 0x13BB, 0x13BB }, -{ 0x13BC, 0x13BC, 0x13BC }, -{ 0x13BD, 0x13BD, 0x13BD }, -{ 0x13BE, 0x13BE, 0x13BE }, -{ 0x13BF, 0x13BF, 0x13BF }, -{ 0x13C0, 0x13C0, 0x13C0 }, -{ 0x13C1, 0x13C1, 0x13C1 }, -{ 0x13C2, 0x13C2, 0x13C2 }, -{ 0x13C3, 0x13C3, 0x13C3 }, -{ 0x13C4, 0x13C4, 0x13C4 }, -{ 0x13C5, 0x13C5, 0x13C5 }, -{ 0x13C6, 0x13C6, 0x13C6 }, -{ 0x13C7, 0x13C7, 0x13C7 }, -{ 0x13C8, 0x13C8, 0x13C8 }, -{ 0x13C9, 0x13C9, 0x13C9 }, -{ 0x13CA, 0x13CA, 0x13CA }, -{ 0x13CB, 0x13CB, 0x13CB }, -{ 0x13CC, 0x13CC, 0x13CC }, -{ 0x13CD, 0x13CD, 0x13CD }, -{ 0x13CE, 0x13CE, 0x13CE }, -{ 0x13CF, 0x13CF, 0x13CF }, -{ 0x13D0, 0x13D0, 0x13D0 }, -{ 0x13D1, 0x13D1, 0x13D1 }, -{ 0x13D2, 0x13D2, 0x13D2 }, -{ 0x13D3, 0x13D3, 0x13D3 }, -{ 0x13D4, 0x13D4, 0x13D4 }, -{ 0x13D5, 0x13D5, 0x13D5 }, -{ 0x13D6, 0x13D6, 0x13D6 }, -{ 0x13D7, 0x13D7, 0x13D7 }, -{ 0x13D8, 0x13D8, 0x13D8 }, -{ 0x13D9, 0x13D9, 0x13D9 }, -{ 0x13DA, 0x13DA, 0x13DA }, -{ 0x13DB, 0x13DB, 0x13DB }, -{ 0x13DC, 0x13DC, 0x13DC }, -{ 0x13DD, 0x13DD, 0x13DD }, -{ 0x13DE, 0x13DE, 0x13DE }, -{ 0x13DF, 0x13DF, 0x13DF }, -{ 0x13E0, 0x13E0, 0x13E0 }, -{ 0x13E1, 0x13E1, 0x13E1 }, -{ 0x13E2, 0x13E2, 0x13E2 }, -{ 0x13E3, 0x13E3, 0x13E3 }, -{ 0x13E4, 0x13E4, 0x13E4 }, -{ 0x13E5, 0x13E5, 0x13E5 }, -{ 0x13E6, 0x13E6, 0x13E6 }, -{ 0x13E7, 0x13E7, 0x13E7 }, -{ 0x13E8, 0x13E8, 0x13E8 }, -{ 0x13E9, 0x13E9, 0x13E9 }, -{ 0x13EA, 0x13EA, 0x13EA }, -{ 0x13EB, 0x13EB, 0x13EB }, -{ 0x13EC, 0x13EC, 0x13EC }, -{ 0x13ED, 0x13ED, 0x13ED }, -{ 0x13EE, 0x13EE, 0x13EE }, -{ 0x13EF, 0x13EF, 0x13EF }, -{ 0x13F0, 0x13F0, 0x13F0 }, -{ 0x13F1, 0x13F1, 0x13F1 }, -{ 0x13F2, 0x13F2, 0x13F2 }, -{ 0x13F3, 0x13F3, 0x13F3 }, -{ 0x13F4, 0x13F4, 0x13F4 }, -{ 0x1401, 0x1401, 0x1401 }, -{ 0x1402, 0x1402, 0x1402 }, -{ 0x1403, 0x1403, 0x1403 }, -{ 0x1404, 0x1404, 0x1404 }, -{ 0x1405, 0x1405, 0x1405 }, -{ 0x1406, 0x1406, 0x1406 }, -{ 0x1407, 0x1407, 0x1407 }, -{ 0x1408, 0x1408, 0x1408 }, -{ 0x1409, 0x1409, 0x1409 }, -{ 0x140A, 0x140A, 0x140A }, -{ 0x140B, 0x140B, 0x140B }, -{ 0x140C, 0x140C, 0x140C }, -{ 0x140D, 0x140D, 0x140D }, -{ 0x140E, 0x140E, 0x140E }, -{ 0x140F, 0x140F, 0x140F }, -{ 0x1410, 0x1410, 0x1410 }, -{ 0x1411, 0x1411, 0x1411 }, -{ 0x1412, 0x1412, 0x1412 }, -{ 0x1413, 0x1413, 0x1413 }, -{ 0x1414, 0x1414, 0x1414 }, -{ 0x1415, 0x1415, 0x1415 }, -{ 0x1416, 0x1416, 0x1416 }, -{ 0x1417, 0x1417, 0x1417 }, -{ 0x1418, 0x1418, 0x1418 }, -{ 0x1419, 0x1419, 0x1419 }, -{ 0x141A, 0x141A, 0x141A }, -{ 0x141B, 0x141B, 0x141B }, -{ 0x141C, 0x141C, 0x141C }, -{ 0x141D, 0x141D, 0x141D }, -{ 0x141E, 0x141E, 0x141E }, -{ 0x141F, 0x141F, 0x141F }, -{ 0x1420, 0x1420, 0x1420 }, -{ 0x1421, 0x1421, 0x1421 }, -{ 0x1422, 0x1422, 0x1422 }, -{ 0x1423, 0x1423, 0x1423 }, -{ 0x1424, 0x1424, 0x1424 }, -{ 0x1425, 0x1425, 0x1425 }, -{ 0x1426, 0x1426, 0x1426 }, -{ 0x1427, 0x1427, 0x1427 }, -{ 0x1428, 0x1428, 0x1428 }, -{ 0x1429, 0x1429, 0x1429 }, -{ 0x142A, 0x142A, 0x142A }, -{ 0x142B, 0x142B, 0x142B }, -{ 0x142C, 0x142C, 0x142C }, -{ 0x142D, 0x142D, 0x142D }, -{ 0x142E, 0x142E, 0x142E }, -{ 0x142F, 0x142F, 0x142F }, -{ 0x1430, 0x1430, 0x1430 }, -{ 0x1431, 0x1431, 0x1431 }, -{ 0x1432, 0x1432, 0x1432 }, -{ 0x1433, 0x1433, 0x1433 }, -{ 0x1434, 0x1434, 0x1434 }, -{ 0x1435, 0x1435, 0x1435 }, -{ 0x1436, 0x1436, 0x1436 }, -{ 0x1437, 0x1437, 0x1437 }, -{ 0x1438, 0x1438, 0x1438 }, -{ 0x1439, 0x1439, 0x1439 }, -{ 0x143A, 0x143A, 0x143A }, -{ 0x143B, 0x143B, 0x143B }, -{ 0x143C, 0x143C, 0x143C }, -{ 0x143D, 0x143D, 0x143D }, -{ 0x143E, 0x143E, 0x143E }, -{ 0x143F, 0x143F, 0x143F }, -{ 0x1440, 0x1440, 0x1440 }, -{ 0x1441, 0x1441, 0x1441 }, -{ 0x1442, 0x1442, 0x1442 }, -{ 0x1443, 0x1443, 0x1443 }, -{ 0x1444, 0x1444, 0x1444 }, -{ 0x1445, 0x1445, 0x1445 }, -{ 0x1446, 0x1446, 0x1446 }, -{ 0x1447, 0x1447, 0x1447 }, -{ 0x1448, 0x1448, 0x1448 }, -{ 0x1449, 0x1449, 0x1449 }, -{ 0x144A, 0x144A, 0x144A }, -{ 0x144B, 0x144B, 0x144B }, -{ 0x144C, 0x144C, 0x144C }, -{ 0x144D, 0x144D, 0x144D }, -{ 0x144E, 0x144E, 0x144E }, -{ 0x144F, 0x144F, 0x144F }, -{ 0x1450, 0x1450, 0x1450 }, -{ 0x1451, 0x1451, 0x1451 }, -{ 0x1452, 0x1452, 0x1452 }, -{ 0x1453, 0x1453, 0x1453 }, -{ 0x1454, 0x1454, 0x1454 }, -{ 0x1455, 0x1455, 0x1455 }, -{ 0x1456, 0x1456, 0x1456 }, -{ 0x1457, 0x1457, 0x1457 }, -{ 0x1458, 0x1458, 0x1458 }, -{ 0x1459, 0x1459, 0x1459 }, -{ 0x145A, 0x145A, 0x145A }, -{ 0x145B, 0x145B, 0x145B }, -{ 0x145C, 0x145C, 0x145C }, -{ 0x145D, 0x145D, 0x145D }, -{ 0x145E, 0x145E, 0x145E }, -{ 0x145F, 0x145F, 0x145F }, -{ 0x1460, 0x1460, 0x1460 }, -{ 0x1461, 0x1461, 0x1461 }, -{ 0x1462, 0x1462, 0x1462 }, -{ 0x1463, 0x1463, 0x1463 }, -{ 0x1464, 0x1464, 0x1464 }, -{ 0x1465, 0x1465, 0x1465 }, -{ 0x1466, 0x1466, 0x1466 }, -{ 0x1467, 0x1467, 0x1467 }, -{ 0x1468, 0x1468, 0x1468 }, -{ 0x1469, 0x1469, 0x1469 }, -{ 0x146A, 0x146A, 0x146A }, -{ 0x146B, 0x146B, 0x146B }, -{ 0x146C, 0x146C, 0x146C }, -{ 0x146D, 0x146D, 0x146D }, -{ 0x146E, 0x146E, 0x146E }, -{ 0x146F, 0x146F, 0x146F }, -{ 0x1470, 0x1470, 0x1470 }, -{ 0x1471, 0x1471, 0x1471 }, -{ 0x1472, 0x1472, 0x1472 }, -{ 0x1473, 0x1473, 0x1473 }, -{ 0x1474, 0x1474, 0x1474 }, -{ 0x1475, 0x1475, 0x1475 }, -{ 0x1476, 0x1476, 0x1476 }, -{ 0x1477, 0x1477, 0x1477 }, -{ 0x1478, 0x1478, 0x1478 }, -{ 0x1479, 0x1479, 0x1479 }, -{ 0x147A, 0x147A, 0x147A }, -{ 0x147B, 0x147B, 0x147B }, -{ 0x147C, 0x147C, 0x147C }, -{ 0x147D, 0x147D, 0x147D }, -{ 0x147E, 0x147E, 0x147E }, -{ 0x147F, 0x147F, 0x147F }, -{ 0x1480, 0x1480, 0x1480 }, -{ 0x1481, 0x1481, 0x1481 }, -{ 0x1482, 0x1482, 0x1482 }, -{ 0x1483, 0x1483, 0x1483 }, -{ 0x1484, 0x1484, 0x1484 }, -{ 0x1485, 0x1485, 0x1485 }, -{ 0x1486, 0x1486, 0x1486 }, -{ 0x1487, 0x1487, 0x1487 }, -{ 0x1488, 0x1488, 0x1488 }, -{ 0x1489, 0x1489, 0x1489 }, -{ 0x148A, 0x148A, 0x148A }, -{ 0x148B, 0x148B, 0x148B }, -{ 0x148C, 0x148C, 0x148C }, -{ 0x148D, 0x148D, 0x148D }, -{ 0x148E, 0x148E, 0x148E }, -{ 0x148F, 0x148F, 0x148F }, -{ 0x1490, 0x1490, 0x1490 }, -{ 0x1491, 0x1491, 0x1491 }, -{ 0x1492, 0x1492, 0x1492 }, -{ 0x1493, 0x1493, 0x1493 }, -{ 0x1494, 0x1494, 0x1494 }, -{ 0x1495, 0x1495, 0x1495 }, -{ 0x1496, 0x1496, 0x1496 }, -{ 0x1497, 0x1497, 0x1497 }, -{ 0x1498, 0x1498, 0x1498 }, -{ 0x1499, 0x1499, 0x1499 }, -{ 0x149A, 0x149A, 0x149A }, -{ 0x149B, 0x149B, 0x149B }, -{ 0x149C, 0x149C, 0x149C }, -{ 0x149D, 0x149D, 0x149D }, -{ 0x149E, 0x149E, 0x149E }, -{ 0x149F, 0x149F, 0x149F }, -{ 0x14A0, 0x14A0, 0x14A0 }, -{ 0x14A1, 0x14A1, 0x14A1 }, -{ 0x14A2, 0x14A2, 0x14A2 }, -{ 0x14A3, 0x14A3, 0x14A3 }, -{ 0x14A4, 0x14A4, 0x14A4 }, -{ 0x14A5, 0x14A5, 0x14A5 }, -{ 0x14A6, 0x14A6, 0x14A6 }, -{ 0x14A7, 0x14A7, 0x14A7 }, -{ 0x14A8, 0x14A8, 0x14A8 }, -{ 0x14A9, 0x14A9, 0x14A9 }, -{ 0x14AA, 0x14AA, 0x14AA }, -{ 0x14AB, 0x14AB, 0x14AB }, -{ 0x14AC, 0x14AC, 0x14AC }, -{ 0x14AD, 0x14AD, 0x14AD }, -{ 0x14AE, 0x14AE, 0x14AE }, -{ 0x14AF, 0x14AF, 0x14AF }, -{ 0x14B0, 0x14B0, 0x14B0 }, -{ 0x14B1, 0x14B1, 0x14B1 }, -{ 0x14B2, 0x14B2, 0x14B2 }, -{ 0x14B3, 0x14B3, 0x14B3 }, -{ 0x14B4, 0x14B4, 0x14B4 }, -{ 0x14B5, 0x14B5, 0x14B5 }, -{ 0x14B6, 0x14B6, 0x14B6 }, -{ 0x14B7, 0x14B7, 0x14B7 }, -{ 0x14B8, 0x14B8, 0x14B8 }, -{ 0x14B9, 0x14B9, 0x14B9 }, -{ 0x14BA, 0x14BA, 0x14BA }, -{ 0x14BB, 0x14BB, 0x14BB }, -{ 0x14BC, 0x14BC, 0x14BC }, -{ 0x14BD, 0x14BD, 0x14BD }, -{ 0x14BE, 0x14BE, 0x14BE }, -{ 0x14BF, 0x14BF, 0x14BF }, -{ 0x14C0, 0x14C0, 0x14C0 }, -{ 0x14C1, 0x14C1, 0x14C1 }, -{ 0x14C2, 0x14C2, 0x14C2 }, -{ 0x14C3, 0x14C3, 0x14C3 }, -{ 0x14C4, 0x14C4, 0x14C4 }, -{ 0x14C5, 0x14C5, 0x14C5 }, -{ 0x14C6, 0x14C6, 0x14C6 }, -{ 0x14C7, 0x14C7, 0x14C7 }, -{ 0x14C8, 0x14C8, 0x14C8 }, -{ 0x14C9, 0x14C9, 0x14C9 }, -{ 0x14CA, 0x14CA, 0x14CA }, -{ 0x14CB, 0x14CB, 0x14CB }, -{ 0x14CC, 0x14CC, 0x14CC }, -{ 0x14CD, 0x14CD, 0x14CD }, -{ 0x14CE, 0x14CE, 0x14CE }, -{ 0x14CF, 0x14CF, 0x14CF }, -{ 0x14D0, 0x14D0, 0x14D0 }, -{ 0x14D1, 0x14D1, 0x14D1 }, -{ 0x14D2, 0x14D2, 0x14D2 }, -{ 0x14D3, 0x14D3, 0x14D3 }, -{ 0x14D4, 0x14D4, 0x14D4 }, -{ 0x14D5, 0x14D5, 0x14D5 }, -{ 0x14D6, 0x14D6, 0x14D6 }, -{ 0x14D7, 0x14D7, 0x14D7 }, -{ 0x14D8, 0x14D8, 0x14D8 }, -{ 0x14D9, 0x14D9, 0x14D9 }, -{ 0x14DA, 0x14DA, 0x14DA }, -{ 0x14DB, 0x14DB, 0x14DB }, -{ 0x14DC, 0x14DC, 0x14DC }, -{ 0x14DD, 0x14DD, 0x14DD }, -{ 0x14DE, 0x14DE, 0x14DE }, -{ 0x14DF, 0x14DF, 0x14DF }, -{ 0x14E0, 0x14E0, 0x14E0 }, -{ 0x14E1, 0x14E1, 0x14E1 }, -{ 0x14E2, 0x14E2, 0x14E2 }, -{ 0x14E3, 0x14E3, 0x14E3 }, -{ 0x14E4, 0x14E4, 0x14E4 }, -{ 0x14E5, 0x14E5, 0x14E5 }, -{ 0x14E6, 0x14E6, 0x14E6 }, -{ 0x14E7, 0x14E7, 0x14E7 }, -{ 0x14E8, 0x14E8, 0x14E8 }, -{ 0x14E9, 0x14E9, 0x14E9 }, -{ 0x14EA, 0x14EA, 0x14EA }, -{ 0x14EB, 0x14EB, 0x14EB }, -{ 0x14EC, 0x14EC, 0x14EC }, -{ 0x14ED, 0x14ED, 0x14ED }, -{ 0x14EE, 0x14EE, 0x14EE }, -{ 0x14EF, 0x14EF, 0x14EF }, -{ 0x14F0, 0x14F0, 0x14F0 }, -{ 0x14F1, 0x14F1, 0x14F1 }, -{ 0x14F2, 0x14F2, 0x14F2 }, -{ 0x14F3, 0x14F3, 0x14F3 }, -{ 0x14F4, 0x14F4, 0x14F4 }, -{ 0x14F5, 0x14F5, 0x14F5 }, -{ 0x14F6, 0x14F6, 0x14F6 }, -{ 0x14F7, 0x14F7, 0x14F7 }, -{ 0x14F8, 0x14F8, 0x14F8 }, -{ 0x14F9, 0x14F9, 0x14F9 }, -{ 0x14FA, 0x14FA, 0x14FA }, -{ 0x14FB, 0x14FB, 0x14FB }, -{ 0x14FC, 0x14FC, 0x14FC }, -{ 0x14FD, 0x14FD, 0x14FD }, -{ 0x14FE, 0x14FE, 0x14FE }, -{ 0x14FF, 0x14FF, 0x14FF }, -{ 0x1500, 0x1500, 0x1500 }, -{ 0x1501, 0x1501, 0x1501 }, -{ 0x1502, 0x1502, 0x1502 }, -{ 0x1503, 0x1503, 0x1503 }, -{ 0x1504, 0x1504, 0x1504 }, -{ 0x1505, 0x1505, 0x1505 }, -{ 0x1506, 0x1506, 0x1506 }, -{ 0x1507, 0x1507, 0x1507 }, -{ 0x1508, 0x1508, 0x1508 }, -{ 0x1509, 0x1509, 0x1509 }, -{ 0x150A, 0x150A, 0x150A }, -{ 0x150B, 0x150B, 0x150B }, -{ 0x150C, 0x150C, 0x150C }, -{ 0x150D, 0x150D, 0x150D }, -{ 0x150E, 0x150E, 0x150E }, -{ 0x150F, 0x150F, 0x150F }, -{ 0x1510, 0x1510, 0x1510 }, -{ 0x1511, 0x1511, 0x1511 }, -{ 0x1512, 0x1512, 0x1512 }, -{ 0x1513, 0x1513, 0x1513 }, -{ 0x1514, 0x1514, 0x1514 }, -{ 0x1515, 0x1515, 0x1515 }, -{ 0x1516, 0x1516, 0x1516 }, -{ 0x1517, 0x1517, 0x1517 }, -{ 0x1518, 0x1518, 0x1518 }, -{ 0x1519, 0x1519, 0x1519 }, -{ 0x151A, 0x151A, 0x151A }, -{ 0x151B, 0x151B, 0x151B }, -{ 0x151C, 0x151C, 0x151C }, -{ 0x151D, 0x151D, 0x151D }, -{ 0x151E, 0x151E, 0x151E }, -{ 0x151F, 0x151F, 0x151F }, -{ 0x1520, 0x1520, 0x1520 }, -{ 0x1521, 0x1521, 0x1521 }, -{ 0x1522, 0x1522, 0x1522 }, -{ 0x1523, 0x1523, 0x1523 }, -{ 0x1524, 0x1524, 0x1524 }, -{ 0x1525, 0x1525, 0x1525 }, -{ 0x1526, 0x1526, 0x1526 }, -{ 0x1527, 0x1527, 0x1527 }, -{ 0x1528, 0x1528, 0x1528 }, -{ 0x1529, 0x1529, 0x1529 }, -{ 0x152A, 0x152A, 0x152A }, -{ 0x152B, 0x152B, 0x152B }, -{ 0x152C, 0x152C, 0x152C }, -{ 0x152D, 0x152D, 0x152D }, -{ 0x152E, 0x152E, 0x152E }, -{ 0x152F, 0x152F, 0x152F }, -{ 0x1530, 0x1530, 0x1530 }, -{ 0x1531, 0x1531, 0x1531 }, -{ 0x1532, 0x1532, 0x1532 }, -{ 0x1533, 0x1533, 0x1533 }, -{ 0x1534, 0x1534, 0x1534 }, -{ 0x1535, 0x1535, 0x1535 }, -{ 0x1536, 0x1536, 0x1536 }, -{ 0x1537, 0x1537, 0x1537 }, -{ 0x1538, 0x1538, 0x1538 }, -{ 0x1539, 0x1539, 0x1539 }, -{ 0x153A, 0x153A, 0x153A }, -{ 0x153B, 0x153B, 0x153B }, -{ 0x153C, 0x153C, 0x153C }, -{ 0x153D, 0x153D, 0x153D }, -{ 0x153E, 0x153E, 0x153E }, -{ 0x153F, 0x153F, 0x153F }, -{ 0x1540, 0x1540, 0x1540 }, -{ 0x1541, 0x1541, 0x1541 }, -{ 0x1542, 0x1542, 0x1542 }, -{ 0x1543, 0x1543, 0x1543 }, -{ 0x1544, 0x1544, 0x1544 }, -{ 0x1545, 0x1545, 0x1545 }, -{ 0x1546, 0x1546, 0x1546 }, -{ 0x1547, 0x1547, 0x1547 }, -{ 0x1548, 0x1548, 0x1548 }, -{ 0x1549, 0x1549, 0x1549 }, -{ 0x154A, 0x154A, 0x154A }, -{ 0x154B, 0x154B, 0x154B }, -{ 0x154C, 0x154C, 0x154C }, -{ 0x154D, 0x154D, 0x154D }, -{ 0x154E, 0x154E, 0x154E }, -{ 0x154F, 0x154F, 0x154F }, -{ 0x1550, 0x1550, 0x1550 }, -{ 0x1551, 0x1551, 0x1551 }, -{ 0x1552, 0x1552, 0x1552 }, -{ 0x1553, 0x1553, 0x1553 }, -{ 0x1554, 0x1554, 0x1554 }, -{ 0x1555, 0x1555, 0x1555 }, -{ 0x1556, 0x1556, 0x1556 }, -{ 0x1557, 0x1557, 0x1557 }, -{ 0x1558, 0x1558, 0x1558 }, -{ 0x1559, 0x1559, 0x1559 }, -{ 0x155A, 0x155A, 0x155A }, -{ 0x155B, 0x155B, 0x155B }, -{ 0x155C, 0x155C, 0x155C }, -{ 0x155D, 0x155D, 0x155D }, -{ 0x155E, 0x155E, 0x155E }, -{ 0x155F, 0x155F, 0x155F }, -{ 0x1560, 0x1560, 0x1560 }, -{ 0x1561, 0x1561, 0x1561 }, -{ 0x1562, 0x1562, 0x1562 }, -{ 0x1563, 0x1563, 0x1563 }, -{ 0x1564, 0x1564, 0x1564 }, -{ 0x1565, 0x1565, 0x1565 }, -{ 0x1566, 0x1566, 0x1566 }, -{ 0x1567, 0x1567, 0x1567 }, -{ 0x1568, 0x1568, 0x1568 }, -{ 0x1569, 0x1569, 0x1569 }, -{ 0x156A, 0x156A, 0x156A }, -{ 0x156B, 0x156B, 0x156B }, -{ 0x156C, 0x156C, 0x156C }, -{ 0x156D, 0x156D, 0x156D }, -{ 0x156E, 0x156E, 0x156E }, -{ 0x156F, 0x156F, 0x156F }, -{ 0x1570, 0x1570, 0x1570 }, -{ 0x1571, 0x1571, 0x1571 }, -{ 0x1572, 0x1572, 0x1572 }, -{ 0x1573, 0x1573, 0x1573 }, -{ 0x1574, 0x1574, 0x1574 }, -{ 0x1575, 0x1575, 0x1575 }, -{ 0x1576, 0x1576, 0x1576 }, -{ 0x1577, 0x1577, 0x1577 }, -{ 0x1578, 0x1578, 0x1578 }, -{ 0x1579, 0x1579, 0x1579 }, -{ 0x157A, 0x157A, 0x157A }, -{ 0x157B, 0x157B, 0x157B }, -{ 0x157C, 0x157C, 0x157C }, -{ 0x157D, 0x157D, 0x157D }, -{ 0x157E, 0x157E, 0x157E }, -{ 0x157F, 0x157F, 0x157F }, -{ 0x1580, 0x1580, 0x1580 }, -{ 0x1581, 0x1581, 0x1581 }, -{ 0x1582, 0x1582, 0x1582 }, -{ 0x1583, 0x1583, 0x1583 }, -{ 0x1584, 0x1584, 0x1584 }, -{ 0x1585, 0x1585, 0x1585 }, -{ 0x1586, 0x1586, 0x1586 }, -{ 0x1587, 0x1587, 0x1587 }, -{ 0x1588, 0x1588, 0x1588 }, -{ 0x1589, 0x1589, 0x1589 }, -{ 0x158A, 0x158A, 0x158A }, -{ 0x158B, 0x158B, 0x158B }, -{ 0x158C, 0x158C, 0x158C }, -{ 0x158D, 0x158D, 0x158D }, -{ 0x158E, 0x158E, 0x158E }, -{ 0x158F, 0x158F, 0x158F }, -{ 0x1590, 0x1590, 0x1590 }, -{ 0x1591, 0x1591, 0x1591 }, -{ 0x1592, 0x1592, 0x1592 }, -{ 0x1593, 0x1593, 0x1593 }, -{ 0x1594, 0x1594, 0x1594 }, -{ 0x1595, 0x1595, 0x1595 }, -{ 0x1596, 0x1596, 0x1596 }, -{ 0x1597, 0x1597, 0x1597 }, -{ 0x1598, 0x1598, 0x1598 }, -{ 0x1599, 0x1599, 0x1599 }, -{ 0x159A, 0x159A, 0x159A }, -{ 0x159B, 0x159B, 0x159B }, -{ 0x159C, 0x159C, 0x159C }, -{ 0x159D, 0x159D, 0x159D }, -{ 0x159E, 0x159E, 0x159E }, -{ 0x159F, 0x159F, 0x159F }, -{ 0x15A0, 0x15A0, 0x15A0 }, -{ 0x15A1, 0x15A1, 0x15A1 }, -{ 0x15A2, 0x15A2, 0x15A2 }, -{ 0x15A3, 0x15A3, 0x15A3 }, -{ 0x15A4, 0x15A4, 0x15A4 }, -{ 0x15A5, 0x15A5, 0x15A5 }, -{ 0x15A6, 0x15A6, 0x15A6 }, -{ 0x15A7, 0x15A7, 0x15A7 }, -{ 0x15A8, 0x15A8, 0x15A8 }, -{ 0x15A9, 0x15A9, 0x15A9 }, -{ 0x15AA, 0x15AA, 0x15AA }, -{ 0x15AB, 0x15AB, 0x15AB }, -{ 0x15AC, 0x15AC, 0x15AC }, -{ 0x15AD, 0x15AD, 0x15AD }, -{ 0x15AE, 0x15AE, 0x15AE }, -{ 0x15AF, 0x15AF, 0x15AF }, -{ 0x15B0, 0x15B0, 0x15B0 }, -{ 0x15B1, 0x15B1, 0x15B1 }, -{ 0x15B2, 0x15B2, 0x15B2 }, -{ 0x15B3, 0x15B3, 0x15B3 }, -{ 0x15B4, 0x15B4, 0x15B4 }, -{ 0x15B5, 0x15B5, 0x15B5 }, -{ 0x15B6, 0x15B6, 0x15B6 }, -{ 0x15B7, 0x15B7, 0x15B7 }, -{ 0x15B8, 0x15B8, 0x15B8 }, -{ 0x15B9, 0x15B9, 0x15B9 }, -{ 0x15BA, 0x15BA, 0x15BA }, -{ 0x15BB, 0x15BB, 0x15BB }, -{ 0x15BC, 0x15BC, 0x15BC }, -{ 0x15BD, 0x15BD, 0x15BD }, -{ 0x15BE, 0x15BE, 0x15BE }, -{ 0x15BF, 0x15BF, 0x15BF }, -{ 0x15C0, 0x15C0, 0x15C0 }, -{ 0x15C1, 0x15C1, 0x15C1 }, -{ 0x15C2, 0x15C2, 0x15C2 }, -{ 0x15C3, 0x15C3, 0x15C3 }, -{ 0x15C4, 0x15C4, 0x15C4 }, -{ 0x15C5, 0x15C5, 0x15C5 }, -{ 0x15C6, 0x15C6, 0x15C6 }, -{ 0x15C7, 0x15C7, 0x15C7 }, -{ 0x15C8, 0x15C8, 0x15C8 }, -{ 0x15C9, 0x15C9, 0x15C9 }, -{ 0x15CA, 0x15CA, 0x15CA }, -{ 0x15CB, 0x15CB, 0x15CB }, -{ 0x15CC, 0x15CC, 0x15CC }, -{ 0x15CD, 0x15CD, 0x15CD }, -{ 0x15CE, 0x15CE, 0x15CE }, -{ 0x15CF, 0x15CF, 0x15CF }, -{ 0x15D0, 0x15D0, 0x15D0 }, -{ 0x15D1, 0x15D1, 0x15D1 }, -{ 0x15D2, 0x15D2, 0x15D2 }, -{ 0x15D3, 0x15D3, 0x15D3 }, -{ 0x15D4, 0x15D4, 0x15D4 }, -{ 0x15D5, 0x15D5, 0x15D5 }, -{ 0x15D6, 0x15D6, 0x15D6 }, -{ 0x15D7, 0x15D7, 0x15D7 }, -{ 0x15D8, 0x15D8, 0x15D8 }, -{ 0x15D9, 0x15D9, 0x15D9 }, -{ 0x15DA, 0x15DA, 0x15DA }, -{ 0x15DB, 0x15DB, 0x15DB }, -{ 0x15DC, 0x15DC, 0x15DC }, -{ 0x15DD, 0x15DD, 0x15DD }, -{ 0x15DE, 0x15DE, 0x15DE }, -{ 0x15DF, 0x15DF, 0x15DF }, -{ 0x15E0, 0x15E0, 0x15E0 }, -{ 0x15E1, 0x15E1, 0x15E1 }, -{ 0x15E2, 0x15E2, 0x15E2 }, -{ 0x15E3, 0x15E3, 0x15E3 }, -{ 0x15E4, 0x15E4, 0x15E4 }, -{ 0x15E5, 0x15E5, 0x15E5 }, -{ 0x15E6, 0x15E6, 0x15E6 }, -{ 0x15E7, 0x15E7, 0x15E7 }, -{ 0x15E8, 0x15E8, 0x15E8 }, -{ 0x15E9, 0x15E9, 0x15E9 }, -{ 0x15EA, 0x15EA, 0x15EA }, -{ 0x15EB, 0x15EB, 0x15EB }, -{ 0x15EC, 0x15EC, 0x15EC }, -{ 0x15ED, 0x15ED, 0x15ED }, -{ 0x15EE, 0x15EE, 0x15EE }, -{ 0x15EF, 0x15EF, 0x15EF }, -{ 0x15F0, 0x15F0, 0x15F0 }, -{ 0x15F1, 0x15F1, 0x15F1 }, -{ 0x15F2, 0x15F2, 0x15F2 }, -{ 0x15F3, 0x15F3, 0x15F3 }, -{ 0x15F4, 0x15F4, 0x15F4 }, -{ 0x15F5, 0x15F5, 0x15F5 }, -{ 0x15F6, 0x15F6, 0x15F6 }, -{ 0x15F7, 0x15F7, 0x15F7 }, -{ 0x15F8, 0x15F8, 0x15F8 }, -{ 0x15F9, 0x15F9, 0x15F9 }, -{ 0x15FA, 0x15FA, 0x15FA }, -{ 0x15FB, 0x15FB, 0x15FB }, -{ 0x15FC, 0x15FC, 0x15FC }, -{ 0x15FD, 0x15FD, 0x15FD }, -{ 0x15FE, 0x15FE, 0x15FE }, -{ 0x15FF, 0x15FF, 0x15FF }, -{ 0x1600, 0x1600, 0x1600 }, -{ 0x1601, 0x1601, 0x1601 }, -{ 0x1602, 0x1602, 0x1602 }, -{ 0x1603, 0x1603, 0x1603 }, -{ 0x1604, 0x1604, 0x1604 }, -{ 0x1605, 0x1605, 0x1605 }, -{ 0x1606, 0x1606, 0x1606 }, -{ 0x1607, 0x1607, 0x1607 }, -{ 0x1608, 0x1608, 0x1608 }, -{ 0x1609, 0x1609, 0x1609 }, -{ 0x160A, 0x160A, 0x160A }, -{ 0x160B, 0x160B, 0x160B }, -{ 0x160C, 0x160C, 0x160C }, -{ 0x160D, 0x160D, 0x160D }, -{ 0x160E, 0x160E, 0x160E }, -{ 0x160F, 0x160F, 0x160F }, -{ 0x1610, 0x1610, 0x1610 }, -{ 0x1611, 0x1611, 0x1611 }, -{ 0x1612, 0x1612, 0x1612 }, -{ 0x1613, 0x1613, 0x1613 }, -{ 0x1614, 0x1614, 0x1614 }, -{ 0x1615, 0x1615, 0x1615 }, -{ 0x1616, 0x1616, 0x1616 }, -{ 0x1617, 0x1617, 0x1617 }, -{ 0x1618, 0x1618, 0x1618 }, -{ 0x1619, 0x1619, 0x1619 }, -{ 0x161A, 0x161A, 0x161A }, -{ 0x161B, 0x161B, 0x161B }, -{ 0x161C, 0x161C, 0x161C }, -{ 0x161D, 0x161D, 0x161D }, -{ 0x161E, 0x161E, 0x161E }, -{ 0x161F, 0x161F, 0x161F }, -{ 0x1620, 0x1620, 0x1620 }, -{ 0x1621, 0x1621, 0x1621 }, -{ 0x1622, 0x1622, 0x1622 }, -{ 0x1623, 0x1623, 0x1623 }, -{ 0x1624, 0x1624, 0x1624 }, -{ 0x1625, 0x1625, 0x1625 }, -{ 0x1626, 0x1626, 0x1626 }, -{ 0x1627, 0x1627, 0x1627 }, -{ 0x1628, 0x1628, 0x1628 }, -{ 0x1629, 0x1629, 0x1629 }, -{ 0x162A, 0x162A, 0x162A }, -{ 0x162B, 0x162B, 0x162B }, -{ 0x162C, 0x162C, 0x162C }, -{ 0x162D, 0x162D, 0x162D }, -{ 0x162E, 0x162E, 0x162E }, -{ 0x162F, 0x162F, 0x162F }, -{ 0x1630, 0x1630, 0x1630 }, -{ 0x1631, 0x1631, 0x1631 }, -{ 0x1632, 0x1632, 0x1632 }, -{ 0x1633, 0x1633, 0x1633 }, -{ 0x1634, 0x1634, 0x1634 }, -{ 0x1635, 0x1635, 0x1635 }, -{ 0x1636, 0x1636, 0x1636 }, -{ 0x1637, 0x1637, 0x1637 }, -{ 0x1638, 0x1638, 0x1638 }, -{ 0x1639, 0x1639, 0x1639 }, -{ 0x163A, 0x163A, 0x163A }, -{ 0x163B, 0x163B, 0x163B }, -{ 0x163C, 0x163C, 0x163C }, -{ 0x163D, 0x163D, 0x163D }, -{ 0x163E, 0x163E, 0x163E }, -{ 0x163F, 0x163F, 0x163F }, -{ 0x1640, 0x1640, 0x1640 }, -{ 0x1641, 0x1641, 0x1641 }, -{ 0x1642, 0x1642, 0x1642 }, -{ 0x1643, 0x1643, 0x1643 }, -{ 0x1644, 0x1644, 0x1644 }, -{ 0x1645, 0x1645, 0x1645 }, -{ 0x1646, 0x1646, 0x1646 }, -{ 0x1647, 0x1647, 0x1647 }, -{ 0x1648, 0x1648, 0x1648 }, -{ 0x1649, 0x1649, 0x1649 }, -{ 0x164A, 0x164A, 0x164A }, -{ 0x164B, 0x164B, 0x164B }, -{ 0x164C, 0x164C, 0x164C }, -{ 0x164D, 0x164D, 0x164D }, -{ 0x164E, 0x164E, 0x164E }, -{ 0x164F, 0x164F, 0x164F }, -{ 0x1650, 0x1650, 0x1650 }, -{ 0x1651, 0x1651, 0x1651 }, -{ 0x1652, 0x1652, 0x1652 }, -{ 0x1653, 0x1653, 0x1653 }, -{ 0x1654, 0x1654, 0x1654 }, -{ 0x1655, 0x1655, 0x1655 }, -{ 0x1656, 0x1656, 0x1656 }, -{ 0x1657, 0x1657, 0x1657 }, -{ 0x1658, 0x1658, 0x1658 }, -{ 0x1659, 0x1659, 0x1659 }, -{ 0x165A, 0x165A, 0x165A }, -{ 0x165B, 0x165B, 0x165B }, -{ 0x165C, 0x165C, 0x165C }, -{ 0x165D, 0x165D, 0x165D }, -{ 0x165E, 0x165E, 0x165E }, -{ 0x165F, 0x165F, 0x165F }, -{ 0x1660, 0x1660, 0x1660 }, -{ 0x1661, 0x1661, 0x1661 }, -{ 0x1662, 0x1662, 0x1662 }, -{ 0x1663, 0x1663, 0x1663 }, -{ 0x1664, 0x1664, 0x1664 }, -{ 0x1665, 0x1665, 0x1665 }, -{ 0x1666, 0x1666, 0x1666 }, -{ 0x1667, 0x1667, 0x1667 }, -{ 0x1668, 0x1668, 0x1668 }, -{ 0x1669, 0x1669, 0x1669 }, -{ 0x166A, 0x166A, 0x166A }, -{ 0x166B, 0x166B, 0x166B }, -{ 0x166C, 0x166C, 0x166C }, -{ 0x166F, 0x166F, 0x166F }, -{ 0x1670, 0x1670, 0x1670 }, -{ 0x1671, 0x1671, 0x1671 }, -{ 0x1672, 0x1672, 0x1672 }, -{ 0x1673, 0x1673, 0x1673 }, -{ 0x1674, 0x1674, 0x1674 }, -{ 0x1675, 0x1675, 0x1675 }, -{ 0x1676, 0x1676, 0x1676 }, -{ 0x1681, 0x1681, 0x1681 }, -{ 0x1682, 0x1682, 0x1682 }, -{ 0x1683, 0x1683, 0x1683 }, -{ 0x1684, 0x1684, 0x1684 }, -{ 0x1685, 0x1685, 0x1685 }, -{ 0x1686, 0x1686, 0x1686 }, -{ 0x1687, 0x1687, 0x1687 }, -{ 0x1688, 0x1688, 0x1688 }, -{ 0x1689, 0x1689, 0x1689 }, -{ 0x168A, 0x168A, 0x168A }, -{ 0x168B, 0x168B, 0x168B }, -{ 0x168C, 0x168C, 0x168C }, -{ 0x168D, 0x168D, 0x168D }, -{ 0x168E, 0x168E, 0x168E }, -{ 0x168F, 0x168F, 0x168F }, -{ 0x1690, 0x1690, 0x1690 }, -{ 0x1691, 0x1691, 0x1691 }, -{ 0x1692, 0x1692, 0x1692 }, -{ 0x1693, 0x1693, 0x1693 }, -{ 0x1694, 0x1694, 0x1694 }, -{ 0x1695, 0x1695, 0x1695 }, -{ 0x1696, 0x1696, 0x1696 }, -{ 0x1697, 0x1697, 0x1697 }, -{ 0x1698, 0x1698, 0x1698 }, -{ 0x1699, 0x1699, 0x1699 }, -{ 0x169A, 0x169A, 0x169A }, -{ 0x16A0, 0x16A0, 0x16A0 }, -{ 0x16A1, 0x16A1, 0x16A1 }, -{ 0x16A2, 0x16A2, 0x16A2 }, -{ 0x16A3, 0x16A3, 0x16A3 }, -{ 0x16A4, 0x16A4, 0x16A4 }, -{ 0x16A5, 0x16A5, 0x16A5 }, -{ 0x16A6, 0x16A6, 0x16A6 }, -{ 0x16A7, 0x16A7, 0x16A7 }, -{ 0x16A8, 0x16A8, 0x16A8 }, -{ 0x16A9, 0x16A9, 0x16A9 }, -{ 0x16AA, 0x16AA, 0x16AA }, -{ 0x16AB, 0x16AB, 0x16AB }, -{ 0x16AC, 0x16AC, 0x16AC }, -{ 0x16AD, 0x16AD, 0x16AD }, -{ 0x16AE, 0x16AE, 0x16AE }, -{ 0x16AF, 0x16AF, 0x16AF }, -{ 0x16B0, 0x16B0, 0x16B0 }, -{ 0x16B1, 0x16B1, 0x16B1 }, -{ 0x16B2, 0x16B2, 0x16B2 }, -{ 0x16B3, 0x16B3, 0x16B3 }, -{ 0x16B4, 0x16B4, 0x16B4 }, -{ 0x16B5, 0x16B5, 0x16B5 }, -{ 0x16B6, 0x16B6, 0x16B6 }, -{ 0x16B7, 0x16B7, 0x16B7 }, -{ 0x16B8, 0x16B8, 0x16B8 }, -{ 0x16B9, 0x16B9, 0x16B9 }, -{ 0x16BA, 0x16BA, 0x16BA }, -{ 0x16BB, 0x16BB, 0x16BB }, -{ 0x16BC, 0x16BC, 0x16BC }, -{ 0x16BD, 0x16BD, 0x16BD }, -{ 0x16BE, 0x16BE, 0x16BE }, -{ 0x16BF, 0x16BF, 0x16BF }, -{ 0x16C0, 0x16C0, 0x16C0 }, -{ 0x16C1, 0x16C1, 0x16C1 }, -{ 0x16C2, 0x16C2, 0x16C2 }, -{ 0x16C3, 0x16C3, 0x16C3 }, -{ 0x16C4, 0x16C4, 0x16C4 }, -{ 0x16C5, 0x16C5, 0x16C5 }, -{ 0x16C6, 0x16C6, 0x16C6 }, -{ 0x16C7, 0x16C7, 0x16C7 }, -{ 0x16C8, 0x16C8, 0x16C8 }, -{ 0x16C9, 0x16C9, 0x16C9 }, -{ 0x16CA, 0x16CA, 0x16CA }, -{ 0x16CB, 0x16CB, 0x16CB }, -{ 0x16CC, 0x16CC, 0x16CC }, -{ 0x16CD, 0x16CD, 0x16CD }, -{ 0x16CE, 0x16CE, 0x16CE }, -{ 0x16CF, 0x16CF, 0x16CF }, -{ 0x16D0, 0x16D0, 0x16D0 }, -{ 0x16D1, 0x16D1, 0x16D1 }, -{ 0x16D2, 0x16D2, 0x16D2 }, -{ 0x16D3, 0x16D3, 0x16D3 }, -{ 0x16D4, 0x16D4, 0x16D4 }, -{ 0x16D5, 0x16D5, 0x16D5 }, -{ 0x16D6, 0x16D6, 0x16D6 }, -{ 0x16D7, 0x16D7, 0x16D7 }, -{ 0x16D8, 0x16D8, 0x16D8 }, -{ 0x16D9, 0x16D9, 0x16D9 }, -{ 0x16DA, 0x16DA, 0x16DA }, -{ 0x16DB, 0x16DB, 0x16DB }, -{ 0x16DC, 0x16DC, 0x16DC }, -{ 0x16DD, 0x16DD, 0x16DD }, -{ 0x16DE, 0x16DE, 0x16DE }, -{ 0x16DF, 0x16DF, 0x16DF }, -{ 0x16E0, 0x16E0, 0x16E0 }, -{ 0x16E1, 0x16E1, 0x16E1 }, -{ 0x16E2, 0x16E2, 0x16E2 }, -{ 0x16E3, 0x16E3, 0x16E3 }, -{ 0x16E4, 0x16E4, 0x16E4 }, -{ 0x16E5, 0x16E5, 0x16E5 }, -{ 0x16E6, 0x16E6, 0x16E6 }, -{ 0x16E7, 0x16E7, 0x16E7 }, -{ 0x16E8, 0x16E8, 0x16E8 }, -{ 0x16E9, 0x16E9, 0x16E9 }, -{ 0x16EA, 0x16EA, 0x16EA }, -{ 0x1700, 0x1700, 0x1700 }, -{ 0x1701, 0x1701, 0x1701 }, -{ 0x1702, 0x1702, 0x1702 }, -{ 0x1703, 0x1703, 0x1703 }, -{ 0x1704, 0x1704, 0x1704 }, -{ 0x1705, 0x1705, 0x1705 }, -{ 0x1706, 0x1706, 0x1706 }, -{ 0x1707, 0x1707, 0x1707 }, -{ 0x1708, 0x1708, 0x1708 }, -{ 0x1709, 0x1709, 0x1709 }, -{ 0x170A, 0x170A, 0x170A }, -{ 0x170B, 0x170B, 0x170B }, -{ 0x170C, 0x170C, 0x170C }, -{ 0x170E, 0x170E, 0x170E }, -{ 0x170F, 0x170F, 0x170F }, -{ 0x1710, 0x1710, 0x1710 }, -{ 0x1711, 0x1711, 0x1711 }, -{ 0x1712, 0x1712, 0x1712 }, -{ 0x1713, 0x1713, 0x1713 }, -{ 0x1714, 0x1714, 0x1714 }, -{ 0x1720, 0x1720, 0x1720 }, -{ 0x1721, 0x1721, 0x1721 }, -{ 0x1722, 0x1722, 0x1722 }, -{ 0x1723, 0x1723, 0x1723 }, -{ 0x1724, 0x1724, 0x1724 }, -{ 0x1725, 0x1725, 0x1725 }, -{ 0x1726, 0x1726, 0x1726 }, -{ 0x1727, 0x1727, 0x1727 }, -{ 0x1728, 0x1728, 0x1728 }, -{ 0x1729, 0x1729, 0x1729 }, -{ 0x172A, 0x172A, 0x172A }, -{ 0x172B, 0x172B, 0x172B }, -{ 0x172C, 0x172C, 0x172C }, -{ 0x172D, 0x172D, 0x172D }, -{ 0x172E, 0x172E, 0x172E }, -{ 0x172F, 0x172F, 0x172F }, -{ 0x1730, 0x1730, 0x1730 }, -{ 0x1731, 0x1731, 0x1731 }, -{ 0x1732, 0x1732, 0x1732 }, -{ 0x1733, 0x1733, 0x1733 }, -{ 0x1734, 0x1734, 0x1734 }, -{ 0x1740, 0x1740, 0x1740 }, -{ 0x1741, 0x1741, 0x1741 }, -{ 0x1742, 0x1742, 0x1742 }, -{ 0x1743, 0x1743, 0x1743 }, -{ 0x1744, 0x1744, 0x1744 }, -{ 0x1745, 0x1745, 0x1745 }, -{ 0x1746, 0x1746, 0x1746 }, -{ 0x1747, 0x1747, 0x1747 }, -{ 0x1748, 0x1748, 0x1748 }, -{ 0x1749, 0x1749, 0x1749 }, -{ 0x174A, 0x174A, 0x174A }, -{ 0x174B, 0x174B, 0x174B }, -{ 0x174C, 0x174C, 0x174C }, -{ 0x174D, 0x174D, 0x174D }, -{ 0x174E, 0x174E, 0x174E }, -{ 0x174F, 0x174F, 0x174F }, -{ 0x1750, 0x1750, 0x1750 }, -{ 0x1751, 0x1751, 0x1751 }, -{ 0x1752, 0x1752, 0x1752 }, -{ 0x1753, 0x1753, 0x1753 }, -{ 0x1760, 0x1760, 0x1760 }, -{ 0x1761, 0x1761, 0x1761 }, -{ 0x1762, 0x1762, 0x1762 }, -{ 0x1763, 0x1763, 0x1763 }, -{ 0x1764, 0x1764, 0x1764 }, -{ 0x1765, 0x1765, 0x1765 }, -{ 0x1766, 0x1766, 0x1766 }, -{ 0x1767, 0x1767, 0x1767 }, -{ 0x1768, 0x1768, 0x1768 }, -{ 0x1769, 0x1769, 0x1769 }, -{ 0x176A, 0x176A, 0x176A }, -{ 0x176B, 0x176B, 0x176B }, -{ 0x176C, 0x176C, 0x176C }, -{ 0x176E, 0x176E, 0x176E }, -{ 0x176F, 0x176F, 0x176F }, -{ 0x1770, 0x1770, 0x1770 }, -{ 0x1772, 0x1772, 0x1772 }, -{ 0x1773, 0x1773, 0x1773 }, -{ 0x1780, 0x1780, 0x1780 }, -{ 0x1781, 0x1781, 0x1781 }, -{ 0x1782, 0x1782, 0x1782 }, -{ 0x1783, 0x1783, 0x1783 }, -{ 0x1784, 0x1784, 0x1784 }, -{ 0x1785, 0x1785, 0x1785 }, -{ 0x1786, 0x1786, 0x1786 }, -{ 0x1787, 0x1787, 0x1787 }, -{ 0x1788, 0x1788, 0x1788 }, -{ 0x1789, 0x1789, 0x1789 }, -{ 0x178A, 0x178A, 0x178A }, -{ 0x178B, 0x178B, 0x178B }, -{ 0x178C, 0x178C, 0x178C }, -{ 0x178D, 0x178D, 0x178D }, -{ 0x178E, 0x178E, 0x178E }, -{ 0x178F, 0x178F, 0x178F }, -{ 0x1790, 0x1790, 0x1790 }, -{ 0x1791, 0x1791, 0x1791 }, -{ 0x1792, 0x1792, 0x1792 }, -{ 0x1793, 0x1793, 0x1793 }, -{ 0x1794, 0x1794, 0x1794 }, -{ 0x1795, 0x1795, 0x1795 }, -{ 0x1796, 0x1796, 0x1796 }, -{ 0x1797, 0x1797, 0x1797 }, -{ 0x1798, 0x1798, 0x1798 }, -{ 0x1799, 0x1799, 0x1799 }, -{ 0x179A, 0x179A, 0x179A }, -{ 0x179B, 0x179B, 0x179B }, -{ 0x179C, 0x179C, 0x179C }, -{ 0x179D, 0x179D, 0x179D }, -{ 0x179E, 0x179E, 0x179E }, -{ 0x179F, 0x179F, 0x179F }, -{ 0x17A0, 0x17A0, 0x17A0 }, -{ 0x17A1, 0x17A1, 0x17A1 }, -{ 0x17A2, 0x17A2, 0x17A2 }, -{ 0x17A3, 0x17A3, 0x17A3 }, -{ 0x17A4, 0x17A4, 0x17A4 }, -{ 0x17A5, 0x17A5, 0x17A5 }, -{ 0x17A6, 0x17A6, 0x17A6 }, -{ 0x17A7, 0x17A7, 0x17A7 }, -{ 0x17A8, 0x17A8, 0x17A8 }, -{ 0x17A9, 0x17A9, 0x17A9 }, -{ 0x17AA, 0x17AA, 0x17AA }, -{ 0x17AB, 0x17AB, 0x17AB }, -{ 0x17AC, 0x17AC, 0x17AC }, -{ 0x17AD, 0x17AD, 0x17AD }, -{ 0x17AE, 0x17AE, 0x17AE }, -{ 0x17AF, 0x17AF, 0x17AF }, -{ 0x17B0, 0x17B0, 0x17B0 }, -{ 0x17B1, 0x17B1, 0x17B1 }, -{ 0x17B2, 0x17B2, 0x17B2 }, -{ 0x17B3, 0x17B3, 0x17B3 }, -{ 0x17B7, 0x17B7, 0x17B7 }, -{ 0x17B8, 0x17B8, 0x17B8 }, -{ 0x17B9, 0x17B9, 0x17B9 }, -{ 0x17BA, 0x17BA, 0x17BA }, -{ 0x17BB, 0x17BB, 0x17BB }, -{ 0x17BC, 0x17BC, 0x17BC }, -{ 0x17BD, 0x17BD, 0x17BD }, -{ 0x17C6, 0x17C6, 0x17C6 }, -{ 0x17C9, 0x17C9, 0x17C9 }, -{ 0x17CA, 0x17CA, 0x17CA }, -{ 0x17CB, 0x17CB, 0x17CB }, -{ 0x17CC, 0x17CC, 0x17CC }, -{ 0x17CD, 0x17CD, 0x17CD }, -{ 0x17CE, 0x17CE, 0x17CE }, -{ 0x17CF, 0x17CF, 0x17CF }, -{ 0x17D0, 0x17D0, 0x17D0 }, -{ 0x17D1, 0x17D1, 0x17D1 }, -{ 0x17D2, 0x17D2, 0x17D2 }, -{ 0x17D3, 0x17D3, 0x17D3 }, -{ 0x17D7, 0x17D7, 0x17D7 }, -{ 0x17DC, 0x17DC, 0x17DC }, -{ 0x17DD, 0x17DD, 0x17DD }, -{ 0x180B, 0x180B, 0x180B }, -{ 0x180C, 0x180C, 0x180C }, -{ 0x180D, 0x180D, 0x180D }, -{ 0x1820, 0x1820, 0x1820 }, -{ 0x1821, 0x1821, 0x1821 }, -{ 0x1822, 0x1822, 0x1822 }, -{ 0x1823, 0x1823, 0x1823 }, -{ 0x1824, 0x1824, 0x1824 }, -{ 0x1825, 0x1825, 0x1825 }, -{ 0x1826, 0x1826, 0x1826 }, -{ 0x1827, 0x1827, 0x1827 }, -{ 0x1828, 0x1828, 0x1828 }, -{ 0x1829, 0x1829, 0x1829 }, -{ 0x182A, 0x182A, 0x182A }, -{ 0x182B, 0x182B, 0x182B }, -{ 0x182C, 0x182C, 0x182C }, -{ 0x182D, 0x182D, 0x182D }, -{ 0x182E, 0x182E, 0x182E }, -{ 0x182F, 0x182F, 0x182F }, -{ 0x1830, 0x1830, 0x1830 }, -{ 0x1831, 0x1831, 0x1831 }, -{ 0x1832, 0x1832, 0x1832 }, -{ 0x1833, 0x1833, 0x1833 }, -{ 0x1834, 0x1834, 0x1834 }, -{ 0x1835, 0x1835, 0x1835 }, -{ 0x1836, 0x1836, 0x1836 }, -{ 0x1837, 0x1837, 0x1837 }, -{ 0x1838, 0x1838, 0x1838 }, -{ 0x1839, 0x1839, 0x1839 }, -{ 0x183A, 0x183A, 0x183A }, -{ 0x183B, 0x183B, 0x183B }, -{ 0x183C, 0x183C, 0x183C }, -{ 0x183D, 0x183D, 0x183D }, -{ 0x183E, 0x183E, 0x183E }, -{ 0x183F, 0x183F, 0x183F }, -{ 0x1840, 0x1840, 0x1840 }, -{ 0x1841, 0x1841, 0x1841 }, -{ 0x1842, 0x1842, 0x1842 }, -{ 0x1843, 0x1843, 0x1843 }, -{ 0x1844, 0x1844, 0x1844 }, -{ 0x1845, 0x1845, 0x1845 }, -{ 0x1846, 0x1846, 0x1846 }, -{ 0x1847, 0x1847, 0x1847 }, -{ 0x1848, 0x1848, 0x1848 }, -{ 0x1849, 0x1849, 0x1849 }, -{ 0x184A, 0x184A, 0x184A }, -{ 0x184B, 0x184B, 0x184B }, -{ 0x184C, 0x184C, 0x184C }, -{ 0x184D, 0x184D, 0x184D }, -{ 0x184E, 0x184E, 0x184E }, -{ 0x184F, 0x184F, 0x184F }, -{ 0x1850, 0x1850, 0x1850 }, -{ 0x1851, 0x1851, 0x1851 }, -{ 0x1852, 0x1852, 0x1852 }, -{ 0x1853, 0x1853, 0x1853 }, -{ 0x1854, 0x1854, 0x1854 }, -{ 0x1855, 0x1855, 0x1855 }, -{ 0x1856, 0x1856, 0x1856 }, -{ 0x1857, 0x1857, 0x1857 }, -{ 0x1858, 0x1858, 0x1858 }, -{ 0x1859, 0x1859, 0x1859 }, -{ 0x185A, 0x185A, 0x185A }, -{ 0x185B, 0x185B, 0x185B }, -{ 0x185C, 0x185C, 0x185C }, -{ 0x185D, 0x185D, 0x185D }, -{ 0x185E, 0x185E, 0x185E }, -{ 0x185F, 0x185F, 0x185F }, -{ 0x1860, 0x1860, 0x1860 }, -{ 0x1861, 0x1861, 0x1861 }, -{ 0x1862, 0x1862, 0x1862 }, -{ 0x1863, 0x1863, 0x1863 }, -{ 0x1864, 0x1864, 0x1864 }, -{ 0x1865, 0x1865, 0x1865 }, -{ 0x1866, 0x1866, 0x1866 }, -{ 0x1867, 0x1867, 0x1867 }, -{ 0x1868, 0x1868, 0x1868 }, -{ 0x1869, 0x1869, 0x1869 }, -{ 0x186A, 0x186A, 0x186A }, -{ 0x186B, 0x186B, 0x186B }, -{ 0x186C, 0x186C, 0x186C }, -{ 0x186D, 0x186D, 0x186D }, -{ 0x186E, 0x186E, 0x186E }, -{ 0x186F, 0x186F, 0x186F }, -{ 0x1870, 0x1870, 0x1870 }, -{ 0x1871, 0x1871, 0x1871 }, -{ 0x1872, 0x1872, 0x1872 }, -{ 0x1873, 0x1873, 0x1873 }, -{ 0x1874, 0x1874, 0x1874 }, -{ 0x1875, 0x1875, 0x1875 }, -{ 0x1876, 0x1876, 0x1876 }, -{ 0x1877, 0x1877, 0x1877 }, -{ 0x1880, 0x1880, 0x1880 }, -{ 0x1881, 0x1881, 0x1881 }, -{ 0x1882, 0x1882, 0x1882 }, -{ 0x1883, 0x1883, 0x1883 }, -{ 0x1884, 0x1884, 0x1884 }, -{ 0x1885, 0x1885, 0x1885 }, -{ 0x1886, 0x1886, 0x1886 }, -{ 0x1887, 0x1887, 0x1887 }, -{ 0x1888, 0x1888, 0x1888 }, -{ 0x1889, 0x1889, 0x1889 }, -{ 0x188A, 0x188A, 0x188A }, -{ 0x188B, 0x188B, 0x188B }, -{ 0x188C, 0x188C, 0x188C }, -{ 0x188D, 0x188D, 0x188D }, -{ 0x188E, 0x188E, 0x188E }, -{ 0x188F, 0x188F, 0x188F }, -{ 0x1890, 0x1890, 0x1890 }, -{ 0x1891, 0x1891, 0x1891 }, -{ 0x1892, 0x1892, 0x1892 }, -{ 0x1893, 0x1893, 0x1893 }, -{ 0x1894, 0x1894, 0x1894 }, -{ 0x1895, 0x1895, 0x1895 }, -{ 0x1896, 0x1896, 0x1896 }, -{ 0x1897, 0x1897, 0x1897 }, -{ 0x1898, 0x1898, 0x1898 }, -{ 0x1899, 0x1899, 0x1899 }, -{ 0x189A, 0x189A, 0x189A }, -{ 0x189B, 0x189B, 0x189B }, -{ 0x189C, 0x189C, 0x189C }, -{ 0x189D, 0x189D, 0x189D }, -{ 0x189E, 0x189E, 0x189E }, -{ 0x189F, 0x189F, 0x189F }, -{ 0x18A0, 0x18A0, 0x18A0 }, -{ 0x18A1, 0x18A1, 0x18A1 }, -{ 0x18A2, 0x18A2, 0x18A2 }, -{ 0x18A3, 0x18A3, 0x18A3 }, -{ 0x18A4, 0x18A4, 0x18A4 }, -{ 0x18A5, 0x18A5, 0x18A5 }, -{ 0x18A6, 0x18A6, 0x18A6 }, -{ 0x18A7, 0x18A7, 0x18A7 }, -{ 0x18A8, 0x18A8, 0x18A8 }, -{ 0x18A9, 0x18A9, 0x18A9 }, -{ 0x1900, 0x1900, 0x1900 }, -{ 0x1901, 0x1901, 0x1901 }, -{ 0x1902, 0x1902, 0x1902 }, -{ 0x1903, 0x1903, 0x1903 }, -{ 0x1904, 0x1904, 0x1904 }, -{ 0x1905, 0x1905, 0x1905 }, -{ 0x1906, 0x1906, 0x1906 }, -{ 0x1907, 0x1907, 0x1907 }, -{ 0x1908, 0x1908, 0x1908 }, -{ 0x1909, 0x1909, 0x1909 }, -{ 0x190A, 0x190A, 0x190A }, -{ 0x190B, 0x190B, 0x190B }, -{ 0x190C, 0x190C, 0x190C }, -{ 0x190D, 0x190D, 0x190D }, -{ 0x190E, 0x190E, 0x190E }, -{ 0x190F, 0x190F, 0x190F }, -{ 0x1910, 0x1910, 0x1910 }, -{ 0x1911, 0x1911, 0x1911 }, -{ 0x1912, 0x1912, 0x1912 }, -{ 0x1913, 0x1913, 0x1913 }, -{ 0x1914, 0x1914, 0x1914 }, -{ 0x1915, 0x1915, 0x1915 }, -{ 0x1916, 0x1916, 0x1916 }, -{ 0x1917, 0x1917, 0x1917 }, -{ 0x1918, 0x1918, 0x1918 }, -{ 0x1919, 0x1919, 0x1919 }, -{ 0x191A, 0x191A, 0x191A }, -{ 0x191B, 0x191B, 0x191B }, -{ 0x191C, 0x191C, 0x191C }, -{ 0x1920, 0x1920, 0x1920 }, -{ 0x1921, 0x1921, 0x1921 }, -{ 0x1922, 0x1922, 0x1922 }, -{ 0x1927, 0x1927, 0x1927 }, -{ 0x1928, 0x1928, 0x1928 }, -{ 0x1932, 0x1932, 0x1932 }, -{ 0x1939, 0x1939, 0x1939 }, -{ 0x193A, 0x193A, 0x193A }, -{ 0x193B, 0x193B, 0x193B }, -{ 0x1950, 0x1950, 0x1950 }, -{ 0x1951, 0x1951, 0x1951 }, -{ 0x1952, 0x1952, 0x1952 }, -{ 0x1953, 0x1953, 0x1953 }, -{ 0x1954, 0x1954, 0x1954 }, -{ 0x1955, 0x1955, 0x1955 }, -{ 0x1956, 0x1956, 0x1956 }, -{ 0x1957, 0x1957, 0x1957 }, -{ 0x1958, 0x1958, 0x1958 }, -{ 0x1959, 0x1959, 0x1959 }, -{ 0x195A, 0x195A, 0x195A }, -{ 0x195B, 0x195B, 0x195B }, -{ 0x195C, 0x195C, 0x195C }, -{ 0x195D, 0x195D, 0x195D }, -{ 0x195E, 0x195E, 0x195E }, -{ 0x195F, 0x195F, 0x195F }, -{ 0x1960, 0x1960, 0x1960 }, -{ 0x1961, 0x1961, 0x1961 }, -{ 0x1962, 0x1962, 0x1962 }, -{ 0x1963, 0x1963, 0x1963 }, -{ 0x1964, 0x1964, 0x1964 }, -{ 0x1965, 0x1965, 0x1965 }, -{ 0x1966, 0x1966, 0x1966 }, -{ 0x1967, 0x1967, 0x1967 }, -{ 0x1968, 0x1968, 0x1968 }, -{ 0x1969, 0x1969, 0x1969 }, -{ 0x196A, 0x196A, 0x196A }, -{ 0x196B, 0x196B, 0x196B }, -{ 0x196C, 0x196C, 0x196C }, -{ 0x196D, 0x196D, 0x196D }, -{ 0x1970, 0x1970, 0x1970 }, -{ 0x1971, 0x1971, 0x1971 }, -{ 0x1972, 0x1972, 0x1972 }, -{ 0x1973, 0x1973, 0x1973 }, -{ 0x1974, 0x1974, 0x1974 }, -{ 0x1980, 0x1980, 0x1980 }, -{ 0x1981, 0x1981, 0x1981 }, -{ 0x1982, 0x1982, 0x1982 }, -{ 0x1983, 0x1983, 0x1983 }, -{ 0x1984, 0x1984, 0x1984 }, -{ 0x1985, 0x1985, 0x1985 }, -{ 0x1986, 0x1986, 0x1986 }, -{ 0x1987, 0x1987, 0x1987 }, -{ 0x1988, 0x1988, 0x1988 }, -{ 0x1989, 0x1989, 0x1989 }, -{ 0x198A, 0x198A, 0x198A }, -{ 0x198B, 0x198B, 0x198B }, -{ 0x198C, 0x198C, 0x198C }, -{ 0x198D, 0x198D, 0x198D }, -{ 0x198E, 0x198E, 0x198E }, -{ 0x198F, 0x198F, 0x198F }, -{ 0x1990, 0x1990, 0x1990 }, -{ 0x1991, 0x1991, 0x1991 }, -{ 0x1992, 0x1992, 0x1992 }, -{ 0x1993, 0x1993, 0x1993 }, -{ 0x1994, 0x1994, 0x1994 }, -{ 0x1995, 0x1995, 0x1995 }, -{ 0x1996, 0x1996, 0x1996 }, -{ 0x1997, 0x1997, 0x1997 }, -{ 0x1998, 0x1998, 0x1998 }, -{ 0x1999, 0x1999, 0x1999 }, -{ 0x199A, 0x199A, 0x199A }, -{ 0x199B, 0x199B, 0x199B }, -{ 0x199C, 0x199C, 0x199C }, -{ 0x199D, 0x199D, 0x199D }, -{ 0x199E, 0x199E, 0x199E }, -{ 0x199F, 0x199F, 0x199F }, -{ 0x19A0, 0x19A0, 0x19A0 }, -{ 0x19A1, 0x19A1, 0x19A1 }, -{ 0x19A2, 0x19A2, 0x19A2 }, -{ 0x19A3, 0x19A3, 0x19A3 }, -{ 0x19A4, 0x19A4, 0x19A4 }, -{ 0x19A5, 0x19A5, 0x19A5 }, -{ 0x19A6, 0x19A6, 0x19A6 }, -{ 0x19A7, 0x19A7, 0x19A7 }, -{ 0x19A8, 0x19A8, 0x19A8 }, -{ 0x19A9, 0x19A9, 0x19A9 }, -{ 0x19C1, 0x19C1, 0x19C1 }, -{ 0x19C2, 0x19C2, 0x19C2 }, -{ 0x19C3, 0x19C3, 0x19C3 }, -{ 0x19C4, 0x19C4, 0x19C4 }, -{ 0x19C5, 0x19C5, 0x19C5 }, -{ 0x19C6, 0x19C6, 0x19C6 }, -{ 0x19C7, 0x19C7, 0x19C7 }, -{ 0x1A00, 0x1A00, 0x1A00 }, -{ 0x1A01, 0x1A01, 0x1A01 }, -{ 0x1A02, 0x1A02, 0x1A02 }, -{ 0x1A03, 0x1A03, 0x1A03 }, -{ 0x1A04, 0x1A04, 0x1A04 }, -{ 0x1A05, 0x1A05, 0x1A05 }, -{ 0x1A06, 0x1A06, 0x1A06 }, -{ 0x1A07, 0x1A07, 0x1A07 }, -{ 0x1A08, 0x1A08, 0x1A08 }, -{ 0x1A09, 0x1A09, 0x1A09 }, -{ 0x1A0A, 0x1A0A, 0x1A0A }, -{ 0x1A0B, 0x1A0B, 0x1A0B }, -{ 0x1A0C, 0x1A0C, 0x1A0C }, -{ 0x1A0D, 0x1A0D, 0x1A0D }, -{ 0x1A0E, 0x1A0E, 0x1A0E }, -{ 0x1A0F, 0x1A0F, 0x1A0F }, -{ 0x1A10, 0x1A10, 0x1A10 }, -{ 0x1A11, 0x1A11, 0x1A11 }, -{ 0x1A12, 0x1A12, 0x1A12 }, -{ 0x1A13, 0x1A13, 0x1A13 }, -{ 0x1A14, 0x1A14, 0x1A14 }, -{ 0x1A15, 0x1A15, 0x1A15 }, -{ 0x1A16, 0x1A16, 0x1A16 }, -{ 0x1A17, 0x1A17, 0x1A17 }, -{ 0x1A18, 0x1A18, 0x1A18 }, -{ 0x1D00, 0x1D00, 0x1D00 }, -{ 0x1D01, 0x1D01, 0x1D01 }, -{ 0x1D02, 0x1D02, 0x1D02 }, -{ 0x1D03, 0x1D03, 0x1D03 }, -{ 0x1D04, 0x1D04, 0x1D04 }, -{ 0x1D05, 0x1D05, 0x1D05 }, -{ 0x1D06, 0x1D06, 0x1D06 }, -{ 0x1D07, 0x1D07, 0x1D07 }, -{ 0x1D08, 0x1D08, 0x1D08 }, -{ 0x1D09, 0x1D09, 0x1D09 }, -{ 0x1D0A, 0x1D0A, 0x1D0A }, -{ 0x1D0B, 0x1D0B, 0x1D0B }, -{ 0x1D0C, 0x1D0C, 0x1D0C }, -{ 0x1D0D, 0x1D0D, 0x1D0D }, -{ 0x1D0E, 0x1D0E, 0x1D0E }, -{ 0x1D0F, 0x1D0F, 0x1D0F }, -{ 0x1D10, 0x1D10, 0x1D10 }, -{ 0x1D11, 0x1D11, 0x1D11 }, -{ 0x1D12, 0x1D12, 0x1D12 }, -{ 0x1D13, 0x1D13, 0x1D13 }, -{ 0x1D14, 0x1D14, 0x1D14 }, -{ 0x1D15, 0x1D15, 0x1D15 }, -{ 0x1D16, 0x1D16, 0x1D16 }, -{ 0x1D17, 0x1D17, 0x1D17 }, -{ 0x1D18, 0x1D18, 0x1D18 }, -{ 0x1D19, 0x1D19, 0x1D19 }, -{ 0x1D1A, 0x1D1A, 0x1D1A }, -{ 0x1D1B, 0x1D1B, 0x1D1B }, -{ 0x1D1C, 0x1D1C, 0x1D1C }, -{ 0x1D1D, 0x1D1D, 0x1D1D }, -{ 0x1D1E, 0x1D1E, 0x1D1E }, -{ 0x1D1F, 0x1D1F, 0x1D1F }, -{ 0x1D20, 0x1D20, 0x1D20 }, -{ 0x1D21, 0x1D21, 0x1D21 }, -{ 0x1D22, 0x1D22, 0x1D22 }, -{ 0x1D23, 0x1D23, 0x1D23 }, -{ 0x1D24, 0x1D24, 0x1D24 }, -{ 0x1D25, 0x1D25, 0x1D25 }, -{ 0x1D26, 0x1D26, 0x1D26 }, -{ 0x1D27, 0x1D27, 0x1D27 }, -{ 0x1D28, 0x1D28, 0x1D28 }, -{ 0x1D29, 0x1D29, 0x1D29 }, -{ 0x1D2A, 0x1D2A, 0x1D2A }, -{ 0x1D2B, 0x1D2B, 0x1D2B }, -{ 0x1D2C, 0x1D2C, 0x1D2C }, -{ 0x1D2D, 0x1D2D, 0x1D2D }, -{ 0x1D2E, 0x1D2E, 0x1D2E }, -{ 0x1D2F, 0x1D2F, 0x1D2F }, -{ 0x1D30, 0x1D30, 0x1D30 }, -{ 0x1D31, 0x1D31, 0x1D31 }, -{ 0x1D32, 0x1D32, 0x1D32 }, -{ 0x1D33, 0x1D33, 0x1D33 }, -{ 0x1D34, 0x1D34, 0x1D34 }, -{ 0x1D35, 0x1D35, 0x1D35 }, -{ 0x1D36, 0x1D36, 0x1D36 }, -{ 0x1D37, 0x1D37, 0x1D37 }, -{ 0x1D38, 0x1D38, 0x1D38 }, -{ 0x1D39, 0x1D39, 0x1D39 }, -{ 0x1D3A, 0x1D3A, 0x1D3A }, -{ 0x1D3B, 0x1D3B, 0x1D3B }, -{ 0x1D3C, 0x1D3C, 0x1D3C }, -{ 0x1D3D, 0x1D3D, 0x1D3D }, -{ 0x1D3E, 0x1D3E, 0x1D3E }, -{ 0x1D3F, 0x1D3F, 0x1D3F }, -{ 0x1D40, 0x1D40, 0x1D40 }, -{ 0x1D41, 0x1D41, 0x1D41 }, -{ 0x1D42, 0x1D42, 0x1D42 }, -{ 0x1D43, 0x1D43, 0x1D43 }, -{ 0x1D44, 0x1D44, 0x1D44 }, -{ 0x1D45, 0x1D45, 0x1D45 }, -{ 0x1D46, 0x1D46, 0x1D46 }, -{ 0x1D47, 0x1D47, 0x1D47 }, -{ 0x1D48, 0x1D48, 0x1D48 }, -{ 0x1D49, 0x1D49, 0x1D49 }, -{ 0x1D4A, 0x1D4A, 0x1D4A }, -{ 0x1D4B, 0x1D4B, 0x1D4B }, -{ 0x1D4C, 0x1D4C, 0x1D4C }, -{ 0x1D4D, 0x1D4D, 0x1D4D }, -{ 0x1D4E, 0x1D4E, 0x1D4E }, -{ 0x1D4F, 0x1D4F, 0x1D4F }, -{ 0x1D50, 0x1D50, 0x1D50 }, -{ 0x1D51, 0x1D51, 0x1D51 }, -{ 0x1D52, 0x1D52, 0x1D52 }, -{ 0x1D53, 0x1D53, 0x1D53 }, -{ 0x1D54, 0x1D54, 0x1D54 }, -{ 0x1D55, 0x1D55, 0x1D55 }, -{ 0x1D56, 0x1D56, 0x1D56 }, -{ 0x1D57, 0x1D57, 0x1D57 }, -{ 0x1D58, 0x1D58, 0x1D58 }, -{ 0x1D59, 0x1D59, 0x1D59 }, -{ 0x1D5A, 0x1D5A, 0x1D5A }, -{ 0x1D5B, 0x1D5B, 0x1D5B }, -{ 0x1D5C, 0x1D5C, 0x1D5C }, -{ 0x1D5D, 0x1D5D, 0x1D5D }, -{ 0x1D5E, 0x1D5E, 0x1D5E }, -{ 0x1D5F, 0x1D5F, 0x1D5F }, -{ 0x1D60, 0x1D60, 0x1D60 }, -{ 0x1D61, 0x1D61, 0x1D61 }, -{ 0x1D62, 0x1D62, 0x1D62 }, -{ 0x1D63, 0x1D63, 0x1D63 }, -{ 0x1D64, 0x1D64, 0x1D64 }, -{ 0x1D65, 0x1D65, 0x1D65 }, -{ 0x1D66, 0x1D66, 0x1D66 }, -{ 0x1D67, 0x1D67, 0x1D67 }, -{ 0x1D68, 0x1D68, 0x1D68 }, -{ 0x1D69, 0x1D69, 0x1D69 }, -{ 0x1D6A, 0x1D6A, 0x1D6A }, -{ 0x1D6B, 0x1D6B, 0x1D6B }, -{ 0x1D6C, 0x1D6C, 0x1D6C }, -{ 0x1D6D, 0x1D6D, 0x1D6D }, -{ 0x1D6E, 0x1D6E, 0x1D6E }, -{ 0x1D6F, 0x1D6F, 0x1D6F }, -{ 0x1D70, 0x1D70, 0x1D70 }, -{ 0x1D71, 0x1D71, 0x1D71 }, -{ 0x1D72, 0x1D72, 0x1D72 }, -{ 0x1D73, 0x1D73, 0x1D73 }, -{ 0x1D74, 0x1D74, 0x1D74 }, -{ 0x1D75, 0x1D75, 0x1D75 }, -{ 0x1D76, 0x1D76, 0x1D76 }, -{ 0x1D77, 0x1D77, 0x1D77 }, -{ 0x1D78, 0x1D78, 0x1D78 }, -{ 0x1D79, 0x1D79, 0x1D79 }, -{ 0x1D7A, 0x1D7A, 0x1D7A }, -{ 0x1D7B, 0x1D7B, 0x1D7B }, -{ 0x1D7C, 0x1D7C, 0x1D7C }, -{ 0x1D7D, 0x1D7D, 0x1D7D }, -{ 0x1D7E, 0x1D7E, 0x1D7E }, -{ 0x1D7F, 0x1D7F, 0x1D7F }, -{ 0x1D80, 0x1D80, 0x1D80 }, -{ 0x1D81, 0x1D81, 0x1D81 }, -{ 0x1D82, 0x1D82, 0x1D82 }, -{ 0x1D83, 0x1D83, 0x1D83 }, -{ 0x1D84, 0x1D84, 0x1D84 }, -{ 0x1D85, 0x1D85, 0x1D85 }, -{ 0x1D86, 0x1D86, 0x1D86 }, -{ 0x1D87, 0x1D87, 0x1D87 }, -{ 0x1D88, 0x1D88, 0x1D88 }, -{ 0x1D89, 0x1D89, 0x1D89 }, -{ 0x1D8A, 0x1D8A, 0x1D8A }, -{ 0x1D8B, 0x1D8B, 0x1D8B }, -{ 0x1D8C, 0x1D8C, 0x1D8C }, -{ 0x1D8D, 0x1D8D, 0x1D8D }, -{ 0x1D8E, 0x1D8E, 0x1D8E }, -{ 0x1D8F, 0x1D8F, 0x1D8F }, -{ 0x1D90, 0x1D90, 0x1D90 }, -{ 0x1D91, 0x1D91, 0x1D91 }, -{ 0x1D92, 0x1D92, 0x1D92 }, -{ 0x1D93, 0x1D93, 0x1D93 }, -{ 0x1D94, 0x1D94, 0x1D94 }, -{ 0x1D95, 0x1D95, 0x1D95 }, -{ 0x1D96, 0x1D96, 0x1D96 }, -{ 0x1D97, 0x1D97, 0x1D97 }, -{ 0x1D98, 0x1D98, 0x1D98 }, -{ 0x1D99, 0x1D99, 0x1D99 }, -{ 0x1D9A, 0x1D9A, 0x1D9A }, -{ 0x1D9B, 0x1D9B, 0x1D9B }, -{ 0x1D9C, 0x1D9C, 0x1D9C }, -{ 0x1D9D, 0x1D9D, 0x1D9D }, -{ 0x1D9E, 0x1D9E, 0x1D9E }, -{ 0x1D9F, 0x1D9F, 0x1D9F }, -{ 0x1DA0, 0x1DA0, 0x1DA0 }, -{ 0x1DA1, 0x1DA1, 0x1DA1 }, -{ 0x1DA2, 0x1DA2, 0x1DA2 }, -{ 0x1DA3, 0x1DA3, 0x1DA3 }, -{ 0x1DA4, 0x1DA4, 0x1DA4 }, -{ 0x1DA5, 0x1DA5, 0x1DA5 }, -{ 0x1DA6, 0x1DA6, 0x1DA6 }, -{ 0x1DA7, 0x1DA7, 0x1DA7 }, -{ 0x1DA8, 0x1DA8, 0x1DA8 }, -{ 0x1DA9, 0x1DA9, 0x1DA9 }, -{ 0x1DAA, 0x1DAA, 0x1DAA }, -{ 0x1DAB, 0x1DAB, 0x1DAB }, -{ 0x1DAC, 0x1DAC, 0x1DAC }, -{ 0x1DAD, 0x1DAD, 0x1DAD }, -{ 0x1DAE, 0x1DAE, 0x1DAE }, -{ 0x1DAF, 0x1DAF, 0x1DAF }, -{ 0x1DB0, 0x1DB0, 0x1DB0 }, -{ 0x1DB1, 0x1DB1, 0x1DB1 }, -{ 0x1DB2, 0x1DB2, 0x1DB2 }, -{ 0x1DB3, 0x1DB3, 0x1DB3 }, -{ 0x1DB4, 0x1DB4, 0x1DB4 }, -{ 0x1DB5, 0x1DB5, 0x1DB5 }, -{ 0x1DB6, 0x1DB6, 0x1DB6 }, -{ 0x1DB7, 0x1DB7, 0x1DB7 }, -{ 0x1DB8, 0x1DB8, 0x1DB8 }, -{ 0x1DB9, 0x1DB9, 0x1DB9 }, -{ 0x1DBA, 0x1DBA, 0x1DBA }, -{ 0x1DBB, 0x1DBB, 0x1DBB }, -{ 0x1DBC, 0x1DBC, 0x1DBC }, -{ 0x1DBD, 0x1DBD, 0x1DBD }, -{ 0x1DBE, 0x1DBE, 0x1DBE }, -{ 0x1DBF, 0x1DBF, 0x1DBF }, -{ 0x1DC0, 0x1DC0, 0x1DC0 }, -{ 0x1DC1, 0x1DC1, 0x1DC1 }, -{ 0x1DC2, 0x1DC2, 0x1DC2 }, -{ 0x1DC3, 0x1DC3, 0x1DC3 }, -{ 0x1E00, 0x1E00, 0x1E01 }, -{ 0x1E01, 0x1E00, 0x1E01 }, -{ 0x1E02, 0x1E02, 0x1E03 }, -{ 0x1E03, 0x1E02, 0x1E03 }, -{ 0x1E04, 0x1E04, 0x1E05 }, -{ 0x1E05, 0x1E04, 0x1E05 }, -{ 0x1E06, 0x1E06, 0x1E07 }, -{ 0x1E07, 0x1E06, 0x1E07 }, -{ 0x1E08, 0x1E08, 0x1E09 }, -{ 0x1E09, 0x1E08, 0x1E09 }, -{ 0x1E0A, 0x1E0A, 0x1E0B }, -{ 0x1E0B, 0x1E0A, 0x1E0B }, -{ 0x1E0C, 0x1E0C, 0x1E0D }, -{ 0x1E0D, 0x1E0C, 0x1E0D }, -{ 0x1E0E, 0x1E0E, 0x1E0F }, -{ 0x1E0F, 0x1E0E, 0x1E0F }, -{ 0x1E10, 0x1E10, 0x1E11 }, -{ 0x1E11, 0x1E10, 0x1E11 }, -{ 0x1E12, 0x1E12, 0x1E13 }, -{ 0x1E13, 0x1E12, 0x1E13 }, -{ 0x1E14, 0x1E14, 0x1E15 }, -{ 0x1E15, 0x1E14, 0x1E15 }, -{ 0x1E16, 0x1E16, 0x1E17 }, -{ 0x1E17, 0x1E16, 0x1E17 }, -{ 0x1E18, 0x1E18, 0x1E19 }, -{ 0x1E19, 0x1E18, 0x1E19 }, -{ 0x1E1A, 0x1E1A, 0x1E1B }, -{ 0x1E1B, 0x1E1A, 0x1E1B }, -{ 0x1E1C, 0x1E1C, 0x1E1D }, -{ 0x1E1D, 0x1E1C, 0x1E1D }, -{ 0x1E1E, 0x1E1E, 0x1E1F }, -{ 0x1E1F, 0x1E1E, 0x1E1F }, -{ 0x1E20, 0x1E20, 0x1E21 }, -{ 0x1E21, 0x1E20, 0x1E21 }, -{ 0x1E22, 0x1E22, 0x1E23 }, -{ 0x1E23, 0x1E22, 0x1E23 }, -{ 0x1E24, 0x1E24, 0x1E25 }, -{ 0x1E25, 0x1E24, 0x1E25 }, -{ 0x1E26, 0x1E26, 0x1E27 }, -{ 0x1E27, 0x1E26, 0x1E27 }, -{ 0x1E28, 0x1E28, 0x1E29 }, -{ 0x1E29, 0x1E28, 0x1E29 }, -{ 0x1E2A, 0x1E2A, 0x1E2B }, -{ 0x1E2B, 0x1E2A, 0x1E2B }, -{ 0x1E2C, 0x1E2C, 0x1E2D }, -{ 0x1E2D, 0x1E2C, 0x1E2D }, -{ 0x1E2E, 0x1E2E, 0x1E2F }, -{ 0x1E2F, 0x1E2E, 0x1E2F }, -{ 0x1E30, 0x1E30, 0x1E31 }, -{ 0x1E31, 0x1E30, 0x1E31 }, -{ 0x1E32, 0x1E32, 0x1E33 }, -{ 0x1E33, 0x1E32, 0x1E33 }, -{ 0x1E34, 0x1E34, 0x1E35 }, -{ 0x1E35, 0x1E34, 0x1E35 }, -{ 0x1E36, 0x1E36, 0x1E37 }, -{ 0x1E37, 0x1E36, 0x1E37 }, -{ 0x1E38, 0x1E38, 0x1E39 }, -{ 0x1E39, 0x1E38, 0x1E39 }, -{ 0x1E3A, 0x1E3A, 0x1E3B }, -{ 0x1E3B, 0x1E3A, 0x1E3B }, -{ 0x1E3C, 0x1E3C, 0x1E3D }, -{ 0x1E3D, 0x1E3C, 0x1E3D }, -{ 0x1E3E, 0x1E3E, 0x1E3F }, -{ 0x1E3F, 0x1E3E, 0x1E3F }, -{ 0x1E40, 0x1E40, 0x1E41 }, -{ 0x1E41, 0x1E40, 0x1E41 }, -{ 0x1E42, 0x1E42, 0x1E43 }, -{ 0x1E43, 0x1E42, 0x1E43 }, -{ 0x1E44, 0x1E44, 0x1E45 }, -{ 0x1E45, 0x1E44, 0x1E45 }, -{ 0x1E46, 0x1E46, 0x1E47 }, -{ 0x1E47, 0x1E46, 0x1E47 }, -{ 0x1E48, 0x1E48, 0x1E49 }, -{ 0x1E49, 0x1E48, 0x1E49 }, -{ 0x1E4A, 0x1E4A, 0x1E4B }, -{ 0x1E4B, 0x1E4A, 0x1E4B }, -{ 0x1E4C, 0x1E4C, 0x1E4D }, -{ 0x1E4D, 0x1E4C, 0x1E4D }, -{ 0x1E4E, 0x1E4E, 0x1E4F }, -{ 0x1E4F, 0x1E4E, 0x1E4F }, -{ 0x1E50, 0x1E50, 0x1E51 }, -{ 0x1E51, 0x1E50, 0x1E51 }, -{ 0x1E52, 0x1E52, 0x1E53 }, -{ 0x1E53, 0x1E52, 0x1E53 }, -{ 0x1E54, 0x1E54, 0x1E55 }, -{ 0x1E55, 0x1E54, 0x1E55 }, -{ 0x1E56, 0x1E56, 0x1E57 }, -{ 0x1E57, 0x1E56, 0x1E57 }, -{ 0x1E58, 0x1E58, 0x1E59 }, -{ 0x1E59, 0x1E58, 0x1E59 }, -{ 0x1E5A, 0x1E5A, 0x1E5B }, -{ 0x1E5B, 0x1E5A, 0x1E5B }, -{ 0x1E5C, 0x1E5C, 0x1E5D }, -{ 0x1E5D, 0x1E5C, 0x1E5D }, -{ 0x1E5E, 0x1E5E, 0x1E5F }, -{ 0x1E5F, 0x1E5E, 0x1E5F }, -{ 0x1E60, 0x1E60, 0x1E61 }, -{ 0x1E61, 0x1E60, 0x1E61 }, -{ 0x1E62, 0x1E62, 0x1E63 }, -{ 0x1E63, 0x1E62, 0x1E63 }, -{ 0x1E64, 0x1E64, 0x1E65 }, -{ 0x1E65, 0x1E64, 0x1E65 }, -{ 0x1E66, 0x1E66, 0x1E67 }, -{ 0x1E67, 0x1E66, 0x1E67 }, -{ 0x1E68, 0x1E68, 0x1E69 }, -{ 0x1E69, 0x1E68, 0x1E69 }, -{ 0x1E6A, 0x1E6A, 0x1E6B }, -{ 0x1E6B, 0x1E6A, 0x1E6B }, -{ 0x1E6C, 0x1E6C, 0x1E6D }, -{ 0x1E6D, 0x1E6C, 0x1E6D }, -{ 0x1E6E, 0x1E6E, 0x1E6F }, -{ 0x1E6F, 0x1E6E, 0x1E6F }, -{ 0x1E70, 0x1E70, 0x1E71 }, -{ 0x1E71, 0x1E70, 0x1E71 }, -{ 0x1E72, 0x1E72, 0x1E73 }, -{ 0x1E73, 0x1E72, 0x1E73 }, -{ 0x1E74, 0x1E74, 0x1E75 }, -{ 0x1E75, 0x1E74, 0x1E75 }, -{ 0x1E76, 0x1E76, 0x1E77 }, -{ 0x1E77, 0x1E76, 0x1E77 }, -{ 0x1E78, 0x1E78, 0x1E79 }, -{ 0x1E79, 0x1E78, 0x1E79 }, -{ 0x1E7A, 0x1E7A, 0x1E7B }, -{ 0x1E7B, 0x1E7A, 0x1E7B }, -{ 0x1E7C, 0x1E7C, 0x1E7D }, -{ 0x1E7D, 0x1E7C, 0x1E7D }, -{ 0x1E7E, 0x1E7E, 0x1E7F }, -{ 0x1E7F, 0x1E7E, 0x1E7F }, -{ 0x1E80, 0x1E80, 0x1E81 }, -{ 0x1E81, 0x1E80, 0x1E81 }, -{ 0x1E82, 0x1E82, 0x1E83 }, -{ 0x1E83, 0x1E82, 0x1E83 }, -{ 0x1E84, 0x1E84, 0x1E85 }, -{ 0x1E85, 0x1E84, 0x1E85 }, -{ 0x1E86, 0x1E86, 0x1E87 }, -{ 0x1E87, 0x1E86, 0x1E87 }, -{ 0x1E88, 0x1E88, 0x1E89 }, -{ 0x1E89, 0x1E88, 0x1E89 }, -{ 0x1E8A, 0x1E8A, 0x1E8B }, -{ 0x1E8B, 0x1E8A, 0x1E8B }, -{ 0x1E8C, 0x1E8C, 0x1E8D }, -{ 0x1E8D, 0x1E8C, 0x1E8D }, -{ 0x1E8E, 0x1E8E, 0x1E8F }, -{ 0x1E8F, 0x1E8E, 0x1E8F }, -{ 0x1E90, 0x1E90, 0x1E91 }, -{ 0x1E91, 0x1E90, 0x1E91 }, -{ 0x1E92, 0x1E92, 0x1E93 }, -{ 0x1E93, 0x1E92, 0x1E93 }, -{ 0x1E94, 0x1E94, 0x1E95 }, -{ 0x1E95, 0x1E94, 0x1E95 }, -{ 0x1E96, 0x1E96, 0x1E96 }, -{ 0x1E97, 0x1E97, 0x1E97 }, -{ 0x1E98, 0x1E98, 0x1E98 }, -{ 0x1E99, 0x1E99, 0x1E99 }, -{ 0x1E9A, 0x1E9A, 0x1E9A }, -{ 0x1E9B, 0x1E60, 0x1E9B }, -{ 0x1EA0, 0x1EA0, 0x1EA1 }, -{ 0x1EA1, 0x1EA0, 0x1EA1 }, -{ 0x1EA2, 0x1EA2, 0x1EA3 }, -{ 0x1EA3, 0x1EA2, 0x1EA3 }, -{ 0x1EA4, 0x1EA4, 0x1EA5 }, -{ 0x1EA5, 0x1EA4, 0x1EA5 }, -{ 0x1EA6, 0x1EA6, 0x1EA7 }, -{ 0x1EA7, 0x1EA6, 0x1EA7 }, -{ 0x1EA8, 0x1EA8, 0x1EA9 }, -{ 0x1EA9, 0x1EA8, 0x1EA9 }, -{ 0x1EAA, 0x1EAA, 0x1EAB }, -{ 0x1EAB, 0x1EAA, 0x1EAB }, -{ 0x1EAC, 0x1EAC, 0x1EAD }, -{ 0x1EAD, 0x1EAC, 0x1EAD }, -{ 0x1EAE, 0x1EAE, 0x1EAF }, -{ 0x1EAF, 0x1EAE, 0x1EAF }, -{ 0x1EB0, 0x1EB0, 0x1EB1 }, -{ 0x1EB1, 0x1EB0, 0x1EB1 }, -{ 0x1EB2, 0x1EB2, 0x1EB3 }, -{ 0x1EB3, 0x1EB2, 0x1EB3 }, -{ 0x1EB4, 0x1EB4, 0x1EB5 }, -{ 0x1EB5, 0x1EB4, 0x1EB5 }, -{ 0x1EB6, 0x1EB6, 0x1EB7 }, -{ 0x1EB7, 0x1EB6, 0x1EB7 }, -{ 0x1EB8, 0x1EB8, 0x1EB9 }, -{ 0x1EB9, 0x1EB8, 0x1EB9 }, -{ 0x1EBA, 0x1EBA, 0x1EBB }, -{ 0x1EBB, 0x1EBA, 0x1EBB }, -{ 0x1EBC, 0x1EBC, 0x1EBD }, -{ 0x1EBD, 0x1EBC, 0x1EBD }, -{ 0x1EBE, 0x1EBE, 0x1EBF }, -{ 0x1EBF, 0x1EBE, 0x1EBF }, -{ 0x1EC0, 0x1EC0, 0x1EC1 }, -{ 0x1EC1, 0x1EC0, 0x1EC1 }, -{ 0x1EC2, 0x1EC2, 0x1EC3 }, -{ 0x1EC3, 0x1EC2, 0x1EC3 }, -{ 0x1EC4, 0x1EC4, 0x1EC5 }, -{ 0x1EC5, 0x1EC4, 0x1EC5 }, -{ 0x1EC6, 0x1EC6, 0x1EC7 }, -{ 0x1EC7, 0x1EC6, 0x1EC7 }, -{ 0x1EC8, 0x1EC8, 0x1EC9 }, -{ 0x1EC9, 0x1EC8, 0x1EC9 }, -{ 0x1ECA, 0x1ECA, 0x1ECB }, -{ 0x1ECB, 0x1ECA, 0x1ECB }, -{ 0x1ECC, 0x1ECC, 0x1ECD }, -{ 0x1ECD, 0x1ECC, 0x1ECD }, -{ 0x1ECE, 0x1ECE, 0x1ECF }, -{ 0x1ECF, 0x1ECE, 0x1ECF }, -{ 0x1ED0, 0x1ED0, 0x1ED1 }, -{ 0x1ED1, 0x1ED0, 0x1ED1 }, -{ 0x1ED2, 0x1ED2, 0x1ED3 }, -{ 0x1ED3, 0x1ED2, 0x1ED3 }, -{ 0x1ED4, 0x1ED4, 0x1ED5 }, -{ 0x1ED5, 0x1ED4, 0x1ED5 }, -{ 0x1ED6, 0x1ED6, 0x1ED7 }, -{ 0x1ED7, 0x1ED6, 0x1ED7 }, -{ 0x1ED8, 0x1ED8, 0x1ED9 }, -{ 0x1ED9, 0x1ED8, 0x1ED9 }, -{ 0x1EDA, 0x1EDA, 0x1EDB }, -{ 0x1EDB, 0x1EDA, 0x1EDB }, -{ 0x1EDC, 0x1EDC, 0x1EDD }, -{ 0x1EDD, 0x1EDC, 0x1EDD }, -{ 0x1EDE, 0x1EDE, 0x1EDF }, -{ 0x1EDF, 0x1EDE, 0x1EDF }, -{ 0x1EE0, 0x1EE0, 0x1EE1 }, -{ 0x1EE1, 0x1EE0, 0x1EE1 }, -{ 0x1EE2, 0x1EE2, 0x1EE3 }, -{ 0x1EE3, 0x1EE2, 0x1EE3 }, -{ 0x1EE4, 0x1EE4, 0x1EE5 }, -{ 0x1EE5, 0x1EE4, 0x1EE5 }, -{ 0x1EE6, 0x1EE6, 0x1EE7 }, -{ 0x1EE7, 0x1EE6, 0x1EE7 }, -{ 0x1EE8, 0x1EE8, 0x1EE9 }, -{ 0x1EE9, 0x1EE8, 0x1EE9 }, -{ 0x1EEA, 0x1EEA, 0x1EEB }, -{ 0x1EEB, 0x1EEA, 0x1EEB }, -{ 0x1EEC, 0x1EEC, 0x1EED }, -{ 0x1EED, 0x1EEC, 0x1EED }, -{ 0x1EEE, 0x1EEE, 0x1EEF }, -{ 0x1EEF, 0x1EEE, 0x1EEF }, -{ 0x1EF0, 0x1EF0, 0x1EF1 }, -{ 0x1EF1, 0x1EF0, 0x1EF1 }, -{ 0x1EF2, 0x1EF2, 0x1EF3 }, -{ 0x1EF3, 0x1EF2, 0x1EF3 }, -{ 0x1EF4, 0x1EF4, 0x1EF5 }, -{ 0x1EF5, 0x1EF4, 0x1EF5 }, -{ 0x1EF6, 0x1EF6, 0x1EF7 }, -{ 0x1EF7, 0x1EF6, 0x1EF7 }, -{ 0x1EF8, 0x1EF8, 0x1EF9 }, -{ 0x1EF9, 0x1EF8, 0x1EF9 }, -{ 0x1F00, 0x1F08, 0x1F00 }, -{ 0x1F01, 0x1F09, 0x1F01 }, -{ 0x1F02, 0x1F0A, 0x1F02 }, -{ 0x1F03, 0x1F0B, 0x1F03 }, -{ 0x1F04, 0x1F0C, 0x1F04 }, -{ 0x1F05, 0x1F0D, 0x1F05 }, -{ 0x1F06, 0x1F0E, 0x1F06 }, -{ 0x1F07, 0x1F0F, 0x1F07 }, -{ 0x1F08, 0x1F08, 0x1F00 }, -{ 0x1F09, 0x1F09, 0x1F01 }, -{ 0x1F0A, 0x1F0A, 0x1F02 }, -{ 0x1F0B, 0x1F0B, 0x1F03 }, -{ 0x1F0C, 0x1F0C, 0x1F04 }, -{ 0x1F0D, 0x1F0D, 0x1F05 }, -{ 0x1F0E, 0x1F0E, 0x1F06 }, -{ 0x1F0F, 0x1F0F, 0x1F07 }, -{ 0x1F10, 0x1F18, 0x1F10 }, -{ 0x1F11, 0x1F19, 0x1F11 }, -{ 0x1F12, 0x1F1A, 0x1F12 }, -{ 0x1F13, 0x1F1B, 0x1F13 }, -{ 0x1F14, 0x1F1C, 0x1F14 }, -{ 0x1F15, 0x1F1D, 0x1F15 }, -{ 0x1F18, 0x1F18, 0x1F10 }, -{ 0x1F19, 0x1F19, 0x1F11 }, -{ 0x1F1A, 0x1F1A, 0x1F12 }, -{ 0x1F1B, 0x1F1B, 0x1F13 }, -{ 0x1F1C, 0x1F1C, 0x1F14 }, -{ 0x1F1D, 0x1F1D, 0x1F15 }, -{ 0x1F20, 0x1F28, 0x1F20 }, -{ 0x1F21, 0x1F29, 0x1F21 }, -{ 0x1F22, 0x1F2A, 0x1F22 }, -{ 0x1F23, 0x1F2B, 0x1F23 }, -{ 0x1F24, 0x1F2C, 0x1F24 }, -{ 0x1F25, 0x1F2D, 0x1F25 }, -{ 0x1F26, 0x1F2E, 0x1F26 }, -{ 0x1F27, 0x1F2F, 0x1F27 }, -{ 0x1F28, 0x1F28, 0x1F20 }, -{ 0x1F29, 0x1F29, 0x1F21 }, -{ 0x1F2A, 0x1F2A, 0x1F22 }, -{ 0x1F2B, 0x1F2B, 0x1F23 }, -{ 0x1F2C, 0x1F2C, 0x1F24 }, -{ 0x1F2D, 0x1F2D, 0x1F25 }, -{ 0x1F2E, 0x1F2E, 0x1F26 }, -{ 0x1F2F, 0x1F2F, 0x1F27 }, -{ 0x1F30, 0x1F38, 0x1F30 }, -{ 0x1F31, 0x1F39, 0x1F31 }, -{ 0x1F32, 0x1F3A, 0x1F32 }, -{ 0x1F33, 0x1F3B, 0x1F33 }, -{ 0x1F34, 0x1F3C, 0x1F34 }, -{ 0x1F35, 0x1F3D, 0x1F35 }, -{ 0x1F36, 0x1F3E, 0x1F36 }, -{ 0x1F37, 0x1F3F, 0x1F37 }, -{ 0x1F38, 0x1F38, 0x1F30 }, -{ 0x1F39, 0x1F39, 0x1F31 }, -{ 0x1F3A, 0x1F3A, 0x1F32 }, -{ 0x1F3B, 0x1F3B, 0x1F33 }, -{ 0x1F3C, 0x1F3C, 0x1F34 }, -{ 0x1F3D, 0x1F3D, 0x1F35 }, -{ 0x1F3E, 0x1F3E, 0x1F36 }, -{ 0x1F3F, 0x1F3F, 0x1F37 }, -{ 0x1F40, 0x1F48, 0x1F40 }, -{ 0x1F41, 0x1F49, 0x1F41 }, -{ 0x1F42, 0x1F4A, 0x1F42 }, -{ 0x1F43, 0x1F4B, 0x1F43 }, -{ 0x1F44, 0x1F4C, 0x1F44 }, -{ 0x1F45, 0x1F4D, 0x1F45 }, -{ 0x1F48, 0x1F48, 0x1F40 }, -{ 0x1F49, 0x1F49, 0x1F41 }, -{ 0x1F4A, 0x1F4A, 0x1F42 }, -{ 0x1F4B, 0x1F4B, 0x1F43 }, -{ 0x1F4C, 0x1F4C, 0x1F44 }, -{ 0x1F4D, 0x1F4D, 0x1F45 }, -{ 0x1F50, 0x1F50, 0x1F50 }, -{ 0x1F51, 0x1F59, 0x1F51 }, -{ 0x1F52, 0x1F52, 0x1F52 }, -{ 0x1F53, 0x1F5B, 0x1F53 }, -{ 0x1F54, 0x1F54, 0x1F54 }, -{ 0x1F55, 0x1F5D, 0x1F55 }, -{ 0x1F56, 0x1F56, 0x1F56 }, -{ 0x1F57, 0x1F5F, 0x1F57 }, -{ 0x1F59, 0x1F59, 0x1F51 }, -{ 0x1F5B, 0x1F5B, 0x1F53 }, -{ 0x1F5D, 0x1F5D, 0x1F55 }, -{ 0x1F5F, 0x1F5F, 0x1F57 }, -{ 0x1F60, 0x1F68, 0x1F60 }, -{ 0x1F61, 0x1F69, 0x1F61 }, -{ 0x1F62, 0x1F6A, 0x1F62 }, -{ 0x1F63, 0x1F6B, 0x1F63 }, -{ 0x1F64, 0x1F6C, 0x1F64 }, -{ 0x1F65, 0x1F6D, 0x1F65 }, -{ 0x1F66, 0x1F6E, 0x1F66 }, -{ 0x1F67, 0x1F6F, 0x1F67 }, -{ 0x1F68, 0x1F68, 0x1F60 }, -{ 0x1F69, 0x1F69, 0x1F61 }, -{ 0x1F6A, 0x1F6A, 0x1F62 }, -{ 0x1F6B, 0x1F6B, 0x1F63 }, -{ 0x1F6C, 0x1F6C, 0x1F64 }, -{ 0x1F6D, 0x1F6D, 0x1F65 }, -{ 0x1F6E, 0x1F6E, 0x1F66 }, -{ 0x1F6F, 0x1F6F, 0x1F67 }, -{ 0x1F70, 0x1FBA, 0x1F70 }, -{ 0x1F71, 0x1FBB, 0x1F71 }, -{ 0x1F72, 0x1FC8, 0x1F72 }, -{ 0x1F73, 0x1FC9, 0x1F73 }, -{ 0x1F74, 0x1FCA, 0x1F74 }, -{ 0x1F75, 0x1FCB, 0x1F75 }, -{ 0x1F76, 0x1FDA, 0x1F76 }, -{ 0x1F77, 0x1FDB, 0x1F77 }, -{ 0x1F78, 0x1FF8, 0x1F78 }, -{ 0x1F79, 0x1FF9, 0x1F79 }, -{ 0x1F7A, 0x1FEA, 0x1F7A }, -{ 0x1F7B, 0x1FEB, 0x1F7B }, -{ 0x1F7C, 0x1FFA, 0x1F7C }, -{ 0x1F7D, 0x1FFB, 0x1F7D }, -{ 0x1F80, 0x1F88, 0x1F80 }, -{ 0x1F81, 0x1F89, 0x1F81 }, -{ 0x1F82, 0x1F8A, 0x1F82 }, -{ 0x1F83, 0x1F8B, 0x1F83 }, -{ 0x1F84, 0x1F8C, 0x1F84 }, -{ 0x1F85, 0x1F8D, 0x1F85 }, -{ 0x1F86, 0x1F8E, 0x1F86 }, -{ 0x1F87, 0x1F8F, 0x1F87 }, -{ 0x1F88, 0x1F88, 0x1F80 }, -{ 0x1F89, 0x1F89, 0x1F81 }, -{ 0x1F8A, 0x1F8A, 0x1F82 }, -{ 0x1F8B, 0x1F8B, 0x1F83 }, -{ 0x1F8C, 0x1F8C, 0x1F84 }, -{ 0x1F8D, 0x1F8D, 0x1F85 }, -{ 0x1F8E, 0x1F8E, 0x1F86 }, -{ 0x1F8F, 0x1F8F, 0x1F87 }, -{ 0x1F90, 0x1F98, 0x1F90 }, -{ 0x1F91, 0x1F99, 0x1F91 }, -{ 0x1F92, 0x1F9A, 0x1F92 }, -{ 0x1F93, 0x1F9B, 0x1F93 }, -{ 0x1F94, 0x1F9C, 0x1F94 }, -{ 0x1F95, 0x1F9D, 0x1F95 }, -{ 0x1F96, 0x1F9E, 0x1F96 }, -{ 0x1F97, 0x1F9F, 0x1F97 }, -{ 0x1F98, 0x1F98, 0x1F90 }, -{ 0x1F99, 0x1F99, 0x1F91 }, -{ 0x1F9A, 0x1F9A, 0x1F92 }, -{ 0x1F9B, 0x1F9B, 0x1F93 }, -{ 0x1F9C, 0x1F9C, 0x1F94 }, -{ 0x1F9D, 0x1F9D, 0x1F95 }, -{ 0x1F9E, 0x1F9E, 0x1F96 }, -{ 0x1F9F, 0x1F9F, 0x1F97 }, -{ 0x1FA0, 0x1FA8, 0x1FA0 }, -{ 0x1FA1, 0x1FA9, 0x1FA1 }, -{ 0x1FA2, 0x1FAA, 0x1FA2 }, -{ 0x1FA3, 0x1FAB, 0x1FA3 }, -{ 0x1FA4, 0x1FAC, 0x1FA4 }, -{ 0x1FA5, 0x1FAD, 0x1FA5 }, -{ 0x1FA6, 0x1FAE, 0x1FA6 }, -{ 0x1FA7, 0x1FAF, 0x1FA7 }, -{ 0x1FA8, 0x1FA8, 0x1FA0 }, -{ 0x1FA9, 0x1FA9, 0x1FA1 }, -{ 0x1FAA, 0x1FAA, 0x1FA2 }, -{ 0x1FAB, 0x1FAB, 0x1FA3 }, -{ 0x1FAC, 0x1FAC, 0x1FA4 }, -{ 0x1FAD, 0x1FAD, 0x1FA5 }, -{ 0x1FAE, 0x1FAE, 0x1FA6 }, -{ 0x1FAF, 0x1FAF, 0x1FA7 }, -{ 0x1FB0, 0x1FB8, 0x1FB0 }, -{ 0x1FB1, 0x1FB9, 0x1FB1 }, -{ 0x1FB2, 0x1FB2, 0x1FB2 }, -{ 0x1FB3, 0x1FBC, 0x1FB3 }, -{ 0x1FB4, 0x1FB4, 0x1FB4 }, -{ 0x1FB6, 0x1FB6, 0x1FB6 }, -{ 0x1FB7, 0x1FB7, 0x1FB7 }, -{ 0x1FB8, 0x1FB8, 0x1FB0 }, -{ 0x1FB9, 0x1FB9, 0x1FB1 }, -{ 0x1FBA, 0x1FBA, 0x1F70 }, -{ 0x1FBB, 0x1FBB, 0x1F71 }, -{ 0x1FBC, 0x1FBC, 0x1FB3 }, -{ 0x1FBE, 0x0399, 0x1FBE }, -{ 0x1FC2, 0x1FC2, 0x1FC2 }, -{ 0x1FC3, 0x1FCC, 0x1FC3 }, -{ 0x1FC4, 0x1FC4, 0x1FC4 }, -{ 0x1FC6, 0x1FC6, 0x1FC6 }, -{ 0x1FC7, 0x1FC7, 0x1FC7 }, -{ 0x1FC8, 0x1FC8, 0x1F72 }, -{ 0x1FC9, 0x1FC9, 0x1F73 }, -{ 0x1FCA, 0x1FCA, 0x1F74 }, -{ 0x1FCB, 0x1FCB, 0x1F75 }, -{ 0x1FCC, 0x1FCC, 0x1FC3 }, -{ 0x1FD0, 0x1FD8, 0x1FD0 }, -{ 0x1FD1, 0x1FD9, 0x1FD1 }, -{ 0x1FD2, 0x1FD2, 0x1FD2 }, -{ 0x1FD3, 0x1FD3, 0x1FD3 }, -{ 0x1FD6, 0x1FD6, 0x1FD6 }, -{ 0x1FD7, 0x1FD7, 0x1FD7 }, -{ 0x1FD8, 0x1FD8, 0x1FD0 }, -{ 0x1FD9, 0x1FD9, 0x1FD1 }, -{ 0x1FDA, 0x1FDA, 0x1F76 }, -{ 0x1FDB, 0x1FDB, 0x1F77 }, -{ 0x1FE0, 0x1FE8, 0x1FE0 }, -{ 0x1FE1, 0x1FE9, 0x1FE1 }, -{ 0x1FE2, 0x1FE2, 0x1FE2 }, -{ 0x1FE3, 0x1FE3, 0x1FE3 }, -{ 0x1FE4, 0x1FE4, 0x1FE4 }, -{ 0x1FE5, 0x1FEC, 0x1FE5 }, -{ 0x1FE6, 0x1FE6, 0x1FE6 }, -{ 0x1FE7, 0x1FE7, 0x1FE7 }, -{ 0x1FE8, 0x1FE8, 0x1FE0 }, -{ 0x1FE9, 0x1FE9, 0x1FE1 }, -{ 0x1FEA, 0x1FEA, 0x1F7A }, -{ 0x1FEB, 0x1FEB, 0x1F7B }, -{ 0x1FEC, 0x1FEC, 0x1FE5 }, -{ 0x1FF2, 0x1FF2, 0x1FF2 }, -{ 0x1FF3, 0x1FFC, 0x1FF3 }, -{ 0x1FF4, 0x1FF4, 0x1FF4 }, -{ 0x1FF6, 0x1FF6, 0x1FF6 }, -{ 0x1FF7, 0x1FF7, 0x1FF7 }, -{ 0x1FF8, 0x1FF8, 0x1F78 }, -{ 0x1FF9, 0x1FF9, 0x1F79 }, -{ 0x1FFA, 0x1FFA, 0x1F7C }, -{ 0x1FFB, 0x1FFB, 0x1F7D }, -{ 0x1FFC, 0x1FFC, 0x1FF3 }, -{ 0x2071, 0x2071, 0x2071 }, -{ 0x207F, 0x207F, 0x207F }, -{ 0x2090, 0x2090, 0x2090 }, -{ 0x2091, 0x2091, 0x2091 }, -{ 0x2092, 0x2092, 0x2092 }, -{ 0x2093, 0x2093, 0x2093 }, -{ 0x2094, 0x2094, 0x2094 }, -{ 0x20D0, 0x20D0, 0x20D0 }, -{ 0x20D1, 0x20D1, 0x20D1 }, -{ 0x20D2, 0x20D2, 0x20D2 }, -{ 0x20D3, 0x20D3, 0x20D3 }, -{ 0x20D4, 0x20D4, 0x20D4 }, -{ 0x20D5, 0x20D5, 0x20D5 }, -{ 0x20D6, 0x20D6, 0x20D6 }, -{ 0x20D7, 0x20D7, 0x20D7 }, -{ 0x20D8, 0x20D8, 0x20D8 }, -{ 0x20D9, 0x20D9, 0x20D9 }, -{ 0x20DA, 0x20DA, 0x20DA }, -{ 0x20DB, 0x20DB, 0x20DB }, -{ 0x20DC, 0x20DC, 0x20DC }, -{ 0x20E1, 0x20E1, 0x20E1 }, -{ 0x20E5, 0x20E5, 0x20E5 }, -{ 0x20E6, 0x20E6, 0x20E6 }, -{ 0x20E7, 0x20E7, 0x20E7 }, -{ 0x20E8, 0x20E8, 0x20E8 }, -{ 0x20E9, 0x20E9, 0x20E9 }, -{ 0x20EA, 0x20EA, 0x20EA }, -{ 0x20EB, 0x20EB, 0x20EB }, -{ 0x2102, 0x2102, 0x2102 }, -{ 0x2107, 0x2107, 0x2107 }, -{ 0x210A, 0x210A, 0x210A }, -{ 0x210B, 0x210B, 0x210B }, -{ 0x210C, 0x210C, 0x210C }, -{ 0x210D, 0x210D, 0x210D }, -{ 0x210E, 0x210E, 0x210E }, -{ 0x210F, 0x210F, 0x210F }, -{ 0x2110, 0x2110, 0x2110 }, -{ 0x2111, 0x2111, 0x2111 }, -{ 0x2112, 0x2112, 0x2112 }, -{ 0x2113, 0x2113, 0x2113 }, -{ 0x2115, 0x2115, 0x2115 }, -{ 0x2119, 0x2119, 0x2119 }, -{ 0x211A, 0x211A, 0x211A }, -{ 0x211B, 0x211B, 0x211B }, -{ 0x211C, 0x211C, 0x211C }, -{ 0x211D, 0x211D, 0x211D }, -{ 0x2124, 0x2124, 0x2124 }, -{ 0x2126, 0x2126, 0x03C9 }, -{ 0x2128, 0x2128, 0x2128 }, -{ 0x212A, 0x212A, 0x006B }, -{ 0x212B, 0x212B, 0x00E5 }, -{ 0x212C, 0x212C, 0x212C }, -{ 0x212D, 0x212D, 0x212D }, -{ 0x212F, 0x212F, 0x212F }, -{ 0x2130, 0x2130, 0x2130 }, -{ 0x2131, 0x2131, 0x2131 }, -{ 0x2133, 0x2133, 0x2133 }, -{ 0x2134, 0x2134, 0x2134 }, -{ 0x2135, 0x2135, 0x2135 }, -{ 0x2136, 0x2136, 0x2136 }, -{ 0x2137, 0x2137, 0x2137 }, -{ 0x2138, 0x2138, 0x2138 }, -{ 0x2139, 0x2139, 0x2139 }, -{ 0x213C, 0x213C, 0x213C }, -{ 0x213D, 0x213D, 0x213D }, -{ 0x213E, 0x213E, 0x213E }, -{ 0x213F, 0x213F, 0x213F }, -{ 0x2145, 0x2145, 0x2145 }, -{ 0x2146, 0x2146, 0x2146 }, -{ 0x2147, 0x2147, 0x2147 }, -{ 0x2148, 0x2148, 0x2148 }, -{ 0x2149, 0x2149, 0x2149 }, -{ 0x2C00, 0x2C00, 0x2C30 }, -{ 0x2C01, 0x2C01, 0x2C31 }, -{ 0x2C02, 0x2C02, 0x2C32 }, -{ 0x2C03, 0x2C03, 0x2C33 }, -{ 0x2C04, 0x2C04, 0x2C34 }, -{ 0x2C05, 0x2C05, 0x2C35 }, -{ 0x2C06, 0x2C06, 0x2C36 }, -{ 0x2C07, 0x2C07, 0x2C37 }, -{ 0x2C08, 0x2C08, 0x2C38 }, -{ 0x2C09, 0x2C09, 0x2C39 }, -{ 0x2C0A, 0x2C0A, 0x2C3A }, -{ 0x2C0B, 0x2C0B, 0x2C3B }, -{ 0x2C0C, 0x2C0C, 0x2C3C }, -{ 0x2C0D, 0x2C0D, 0x2C3D }, -{ 0x2C0E, 0x2C0E, 0x2C3E }, -{ 0x2C0F, 0x2C0F, 0x2C3F }, -{ 0x2C10, 0x2C10, 0x2C40 }, -{ 0x2C11, 0x2C11, 0x2C41 }, -{ 0x2C12, 0x2C12, 0x2C42 }, -{ 0x2C13, 0x2C13, 0x2C43 }, -{ 0x2C14, 0x2C14, 0x2C44 }, -{ 0x2C15, 0x2C15, 0x2C45 }, -{ 0x2C16, 0x2C16, 0x2C46 }, -{ 0x2C17, 0x2C17, 0x2C47 }, -{ 0x2C18, 0x2C18, 0x2C48 }, -{ 0x2C19, 0x2C19, 0x2C49 }, -{ 0x2C1A, 0x2C1A, 0x2C4A }, -{ 0x2C1B, 0x2C1B, 0x2C4B }, -{ 0x2C1C, 0x2C1C, 0x2C4C }, -{ 0x2C1D, 0x2C1D, 0x2C4D }, -{ 0x2C1E, 0x2C1E, 0x2C4E }, -{ 0x2C1F, 0x2C1F, 0x2C4F }, -{ 0x2C20, 0x2C20, 0x2C50 }, -{ 0x2C21, 0x2C21, 0x2C51 }, -{ 0x2C22, 0x2C22, 0x2C52 }, -{ 0x2C23, 0x2C23, 0x2C53 }, -{ 0x2C24, 0x2C24, 0x2C54 }, -{ 0x2C25, 0x2C25, 0x2C55 }, -{ 0x2C26, 0x2C26, 0x2C56 }, -{ 0x2C27, 0x2C27, 0x2C57 }, -{ 0x2C28, 0x2C28, 0x2C58 }, -{ 0x2C29, 0x2C29, 0x2C59 }, -{ 0x2C2A, 0x2C2A, 0x2C5A }, -{ 0x2C2B, 0x2C2B, 0x2C5B }, -{ 0x2C2C, 0x2C2C, 0x2C5C }, -{ 0x2C2D, 0x2C2D, 0x2C5D }, -{ 0x2C2E, 0x2C2E, 0x2C5E }, -{ 0x2C30, 0x2C00, 0x2C30 }, -{ 0x2C31, 0x2C01, 0x2C31 }, -{ 0x2C32, 0x2C02, 0x2C32 }, -{ 0x2C33, 0x2C03, 0x2C33 }, -{ 0x2C34, 0x2C04, 0x2C34 }, -{ 0x2C35, 0x2C05, 0x2C35 }, -{ 0x2C36, 0x2C06, 0x2C36 }, -{ 0x2C37, 0x2C07, 0x2C37 }, -{ 0x2C38, 0x2C08, 0x2C38 }, -{ 0x2C39, 0x2C09, 0x2C39 }, -{ 0x2C3A, 0x2C0A, 0x2C3A }, -{ 0x2C3B, 0x2C0B, 0x2C3B }, -{ 0x2C3C, 0x2C0C, 0x2C3C }, -{ 0x2C3D, 0x2C0D, 0x2C3D }, -{ 0x2C3E, 0x2C0E, 0x2C3E }, -{ 0x2C3F, 0x2C0F, 0x2C3F }, -{ 0x2C40, 0x2C10, 0x2C40 }, -{ 0x2C41, 0x2C11, 0x2C41 }, -{ 0x2C42, 0x2C12, 0x2C42 }, -{ 0x2C43, 0x2C13, 0x2C43 }, -{ 0x2C44, 0x2C14, 0x2C44 }, -{ 0x2C45, 0x2C15, 0x2C45 }, -{ 0x2C46, 0x2C16, 0x2C46 }, -{ 0x2C47, 0x2C17, 0x2C47 }, -{ 0x2C48, 0x2C18, 0x2C48 }, -{ 0x2C49, 0x2C19, 0x2C49 }, -{ 0x2C4A, 0x2C1A, 0x2C4A }, -{ 0x2C4B, 0x2C1B, 0x2C4B }, -{ 0x2C4C, 0x2C1C, 0x2C4C }, -{ 0x2C4D, 0x2C1D, 0x2C4D }, -{ 0x2C4E, 0x2C1E, 0x2C4E }, -{ 0x2C4F, 0x2C1F, 0x2C4F }, -{ 0x2C50, 0x2C20, 0x2C50 }, -{ 0x2C51, 0x2C21, 0x2C51 }, -{ 0x2C52, 0x2C22, 0x2C52 }, -{ 0x2C53, 0x2C23, 0x2C53 }, -{ 0x2C54, 0x2C24, 0x2C54 }, -{ 0x2C55, 0x2C25, 0x2C55 }, -{ 0x2C56, 0x2C26, 0x2C56 }, -{ 0x2C57, 0x2C27, 0x2C57 }, -{ 0x2C58, 0x2C28, 0x2C58 }, -{ 0x2C59, 0x2C29, 0x2C59 }, -{ 0x2C5A, 0x2C2A, 0x2C5A }, -{ 0x2C5B, 0x2C2B, 0x2C5B }, -{ 0x2C5C, 0x2C2C, 0x2C5C }, -{ 0x2C5D, 0x2C2D, 0x2C5D }, -{ 0x2C5E, 0x2C2E, 0x2C5E }, -{ 0x2C80, 0x2C80, 0x2C81 }, -{ 0x2C81, 0x2C80, 0x2C81 }, -{ 0x2C82, 0x2C82, 0x2C83 }, -{ 0x2C83, 0x2C82, 0x2C83 }, -{ 0x2C84, 0x2C84, 0x2C85 }, -{ 0x2C85, 0x2C84, 0x2C85 }, -{ 0x2C86, 0x2C86, 0x2C87 }, -{ 0x2C87, 0x2C86, 0x2C87 }, -{ 0x2C88, 0x2C88, 0x2C89 }, -{ 0x2C89, 0x2C88, 0x2C89 }, -{ 0x2C8A, 0x2C8A, 0x2C8B }, -{ 0x2C8B, 0x2C8A, 0x2C8B }, -{ 0x2C8C, 0x2C8C, 0x2C8D }, -{ 0x2C8D, 0x2C8C, 0x2C8D }, -{ 0x2C8E, 0x2C8E, 0x2C8F }, -{ 0x2C8F, 0x2C8E, 0x2C8F }, -{ 0x2C90, 0x2C90, 0x2C91 }, -{ 0x2C91, 0x2C90, 0x2C91 }, -{ 0x2C92, 0x2C92, 0x2C93 }, -{ 0x2C93, 0x2C92, 0x2C93 }, -{ 0x2C94, 0x2C94, 0x2C95 }, -{ 0x2C95, 0x2C94, 0x2C95 }, -{ 0x2C96, 0x2C96, 0x2C97 }, -{ 0x2C97, 0x2C96, 0x2C97 }, -{ 0x2C98, 0x2C98, 0x2C99 }, -{ 0x2C99, 0x2C98, 0x2C99 }, -{ 0x2C9A, 0x2C9A, 0x2C9B }, -{ 0x2C9B, 0x2C9A, 0x2C9B }, -{ 0x2C9C, 0x2C9C, 0x2C9D }, -{ 0x2C9D, 0x2C9C, 0x2C9D }, -{ 0x2C9E, 0x2C9E, 0x2C9F }, -{ 0x2C9F, 0x2C9E, 0x2C9F }, -{ 0x2CA0, 0x2CA0, 0x2CA1 }, -{ 0x2CA1, 0x2CA0, 0x2CA1 }, -{ 0x2CA2, 0x2CA2, 0x2CA3 }, -{ 0x2CA3, 0x2CA2, 0x2CA3 }, -{ 0x2CA4, 0x2CA4, 0x2CA5 }, -{ 0x2CA5, 0x2CA4, 0x2CA5 }, -{ 0x2CA6, 0x2CA6, 0x2CA7 }, -{ 0x2CA7, 0x2CA6, 0x2CA7 }, -{ 0x2CA8, 0x2CA8, 0x2CA9 }, -{ 0x2CA9, 0x2CA8, 0x2CA9 }, -{ 0x2CAA, 0x2CAA, 0x2CAB }, -{ 0x2CAB, 0x2CAA, 0x2CAB }, -{ 0x2CAC, 0x2CAC, 0x2CAD }, -{ 0x2CAD, 0x2CAC, 0x2CAD }, -{ 0x2CAE, 0x2CAE, 0x2CAF }, -{ 0x2CAF, 0x2CAE, 0x2CAF }, -{ 0x2CB0, 0x2CB0, 0x2CB1 }, -{ 0x2CB1, 0x2CB0, 0x2CB1 }, -{ 0x2CB2, 0x2CB2, 0x2CB3 }, -{ 0x2CB3, 0x2CB2, 0x2CB3 }, -{ 0x2CB4, 0x2CB4, 0x2CB5 }, -{ 0x2CB5, 0x2CB4, 0x2CB5 }, -{ 0x2CB6, 0x2CB6, 0x2CB7 }, -{ 0x2CB7, 0x2CB6, 0x2CB7 }, -{ 0x2CB8, 0x2CB8, 0x2CB9 }, -{ 0x2CB9, 0x2CB8, 0x2CB9 }, -{ 0x2CBA, 0x2CBA, 0x2CBB }, -{ 0x2CBB, 0x2CBA, 0x2CBB }, -{ 0x2CBC, 0x2CBC, 0x2CBD }, -{ 0x2CBD, 0x2CBC, 0x2CBD }, -{ 0x2CBE, 0x2CBE, 0x2CBF }, -{ 0x2CBF, 0x2CBE, 0x2CBF }, -{ 0x2CC0, 0x2CC0, 0x2CC1 }, -{ 0x2CC1, 0x2CC0, 0x2CC1 }, -{ 0x2CC2, 0x2CC2, 0x2CC3 }, -{ 0x2CC3, 0x2CC2, 0x2CC3 }, -{ 0x2CC4, 0x2CC4, 0x2CC5 }, -{ 0x2CC5, 0x2CC4, 0x2CC5 }, -{ 0x2CC6, 0x2CC6, 0x2CC7 }, -{ 0x2CC7, 0x2CC6, 0x2CC7 }, -{ 0x2CC8, 0x2CC8, 0x2CC9 }, -{ 0x2CC9, 0x2CC8, 0x2CC9 }, -{ 0x2CCA, 0x2CCA, 0x2CCB }, -{ 0x2CCB, 0x2CCA, 0x2CCB }, -{ 0x2CCC, 0x2CCC, 0x2CCD }, -{ 0x2CCD, 0x2CCC, 0x2CCD }, -{ 0x2CCE, 0x2CCE, 0x2CCF }, -{ 0x2CCF, 0x2CCE, 0x2CCF }, -{ 0x2CD0, 0x2CD0, 0x2CD1 }, -{ 0x2CD1, 0x2CD0, 0x2CD1 }, -{ 0x2CD2, 0x2CD2, 0x2CD3 }, -{ 0x2CD3, 0x2CD2, 0x2CD3 }, -{ 0x2CD4, 0x2CD4, 0x2CD5 }, -{ 0x2CD5, 0x2CD4, 0x2CD5 }, -{ 0x2CD6, 0x2CD6, 0x2CD7 }, -{ 0x2CD7, 0x2CD6, 0x2CD7 }, -{ 0x2CD8, 0x2CD8, 0x2CD9 }, -{ 0x2CD9, 0x2CD8, 0x2CD9 }, -{ 0x2CDA, 0x2CDA, 0x2CDB }, -{ 0x2CDB, 0x2CDA, 0x2CDB }, -{ 0x2CDC, 0x2CDC, 0x2CDD }, -{ 0x2CDD, 0x2CDC, 0x2CDD }, -{ 0x2CDE, 0x2CDE, 0x2CDF }, -{ 0x2CDF, 0x2CDE, 0x2CDF }, -{ 0x2CE0, 0x2CE0, 0x2CE1 }, -{ 0x2CE1, 0x2CE0, 0x2CE1 }, -{ 0x2CE2, 0x2CE2, 0x2CE3 }, -{ 0x2CE3, 0x2CE2, 0x2CE3 }, -{ 0x2CE4, 0x2CE4, 0x2CE4 }, -{ 0x2D00, 0x10A0, 0x2D00 }, -{ 0x2D01, 0x10A1, 0x2D01 }, -{ 0x2D02, 0x10A2, 0x2D02 }, -{ 0x2D03, 0x10A3, 0x2D03 }, -{ 0x2D04, 0x10A4, 0x2D04 }, -{ 0x2D05, 0x10A5, 0x2D05 }, -{ 0x2D06, 0x10A6, 0x2D06 }, -{ 0x2D07, 0x10A7, 0x2D07 }, -{ 0x2D08, 0x10A8, 0x2D08 }, -{ 0x2D09, 0x10A9, 0x2D09 }, -{ 0x2D0A, 0x10AA, 0x2D0A }, -{ 0x2D0B, 0x10AB, 0x2D0B }, -{ 0x2D0C, 0x10AC, 0x2D0C }, -{ 0x2D0D, 0x10AD, 0x2D0D }, -{ 0x2D0E, 0x10AE, 0x2D0E }, -{ 0x2D0F, 0x10AF, 0x2D0F }, -{ 0x2D10, 0x10B0, 0x2D10 }, -{ 0x2D11, 0x10B1, 0x2D11 }, -{ 0x2D12, 0x10B2, 0x2D12 }, -{ 0x2D13, 0x10B3, 0x2D13 }, -{ 0x2D14, 0x10B4, 0x2D14 }, -{ 0x2D15, 0x10B5, 0x2D15 }, -{ 0x2D16, 0x10B6, 0x2D16 }, -{ 0x2D17, 0x10B7, 0x2D17 }, -{ 0x2D18, 0x10B8, 0x2D18 }, -{ 0x2D19, 0x10B9, 0x2D19 }, -{ 0x2D1A, 0x10BA, 0x2D1A }, -{ 0x2D1B, 0x10BB, 0x2D1B }, -{ 0x2D1C, 0x10BC, 0x2D1C }, -{ 0x2D1D, 0x10BD, 0x2D1D }, -{ 0x2D1E, 0x10BE, 0x2D1E }, -{ 0x2D1F, 0x10BF, 0x2D1F }, -{ 0x2D20, 0x10C0, 0x2D20 }, -{ 0x2D21, 0x10C1, 0x2D21 }, -{ 0x2D22, 0x10C2, 0x2D22 }, -{ 0x2D23, 0x10C3, 0x2D23 }, -{ 0x2D24, 0x10C4, 0x2D24 }, -{ 0x2D25, 0x10C5, 0x2D25 }, -{ 0x2D30, 0x2D30, 0x2D30 }, -{ 0x2D31, 0x2D31, 0x2D31 }, -{ 0x2D32, 0x2D32, 0x2D32 }, -{ 0x2D33, 0x2D33, 0x2D33 }, -{ 0x2D34, 0x2D34, 0x2D34 }, -{ 0x2D35, 0x2D35, 0x2D35 }, -{ 0x2D36, 0x2D36, 0x2D36 }, -{ 0x2D37, 0x2D37, 0x2D37 }, -{ 0x2D38, 0x2D38, 0x2D38 }, -{ 0x2D39, 0x2D39, 0x2D39 }, -{ 0x2D3A, 0x2D3A, 0x2D3A }, -{ 0x2D3B, 0x2D3B, 0x2D3B }, -{ 0x2D3C, 0x2D3C, 0x2D3C }, -{ 0x2D3D, 0x2D3D, 0x2D3D }, -{ 0x2D3E, 0x2D3E, 0x2D3E }, -{ 0x2D3F, 0x2D3F, 0x2D3F }, -{ 0x2D40, 0x2D40, 0x2D40 }, -{ 0x2D41, 0x2D41, 0x2D41 }, -{ 0x2D42, 0x2D42, 0x2D42 }, -{ 0x2D43, 0x2D43, 0x2D43 }, -{ 0x2D44, 0x2D44, 0x2D44 }, -{ 0x2D45, 0x2D45, 0x2D45 }, -{ 0x2D46, 0x2D46, 0x2D46 }, -{ 0x2D47, 0x2D47, 0x2D47 }, -{ 0x2D48, 0x2D48, 0x2D48 }, -{ 0x2D49, 0x2D49, 0x2D49 }, -{ 0x2D4A, 0x2D4A, 0x2D4A }, -{ 0x2D4B, 0x2D4B, 0x2D4B }, -{ 0x2D4C, 0x2D4C, 0x2D4C }, -{ 0x2D4D, 0x2D4D, 0x2D4D }, -{ 0x2D4E, 0x2D4E, 0x2D4E }, -{ 0x2D4F, 0x2D4F, 0x2D4F }, -{ 0x2D50, 0x2D50, 0x2D50 }, -{ 0x2D51, 0x2D51, 0x2D51 }, -{ 0x2D52, 0x2D52, 0x2D52 }, -{ 0x2D53, 0x2D53, 0x2D53 }, -{ 0x2D54, 0x2D54, 0x2D54 }, -{ 0x2D55, 0x2D55, 0x2D55 }, -{ 0x2D56, 0x2D56, 0x2D56 }, -{ 0x2D57, 0x2D57, 0x2D57 }, -{ 0x2D58, 0x2D58, 0x2D58 }, -{ 0x2D59, 0x2D59, 0x2D59 }, -{ 0x2D5A, 0x2D5A, 0x2D5A }, -{ 0x2D5B, 0x2D5B, 0x2D5B }, -{ 0x2D5C, 0x2D5C, 0x2D5C }, -{ 0x2D5D, 0x2D5D, 0x2D5D }, -{ 0x2D5E, 0x2D5E, 0x2D5E }, -{ 0x2D5F, 0x2D5F, 0x2D5F }, -{ 0x2D60, 0x2D60, 0x2D60 }, -{ 0x2D61, 0x2D61, 0x2D61 }, -{ 0x2D62, 0x2D62, 0x2D62 }, -{ 0x2D63, 0x2D63, 0x2D63 }, -{ 0x2D64, 0x2D64, 0x2D64 }, -{ 0x2D65, 0x2D65, 0x2D65 }, -{ 0x2D6F, 0x2D6F, 0x2D6F }, -{ 0x2D80, 0x2D80, 0x2D80 }, -{ 0x2D81, 0x2D81, 0x2D81 }, -{ 0x2D82, 0x2D82, 0x2D82 }, -{ 0x2D83, 0x2D83, 0x2D83 }, -{ 0x2D84, 0x2D84, 0x2D84 }, -{ 0x2D85, 0x2D85, 0x2D85 }, -{ 0x2D86, 0x2D86, 0x2D86 }, -{ 0x2D87, 0x2D87, 0x2D87 }, -{ 0x2D88, 0x2D88, 0x2D88 }, -{ 0x2D89, 0x2D89, 0x2D89 }, -{ 0x2D8A, 0x2D8A, 0x2D8A }, -{ 0x2D8B, 0x2D8B, 0x2D8B }, -{ 0x2D8C, 0x2D8C, 0x2D8C }, -{ 0x2D8D, 0x2D8D, 0x2D8D }, -{ 0x2D8E, 0x2D8E, 0x2D8E }, -{ 0x2D8F, 0x2D8F, 0x2D8F }, -{ 0x2D90, 0x2D90, 0x2D90 }, -{ 0x2D91, 0x2D91, 0x2D91 }, -{ 0x2D92, 0x2D92, 0x2D92 }, -{ 0x2D93, 0x2D93, 0x2D93 }, -{ 0x2D94, 0x2D94, 0x2D94 }, -{ 0x2D95, 0x2D95, 0x2D95 }, -{ 0x2D96, 0x2D96, 0x2D96 }, -{ 0x2DA0, 0x2DA0, 0x2DA0 }, -{ 0x2DA1, 0x2DA1, 0x2DA1 }, -{ 0x2DA2, 0x2DA2, 0x2DA2 }, -{ 0x2DA3, 0x2DA3, 0x2DA3 }, -{ 0x2DA4, 0x2DA4, 0x2DA4 }, -{ 0x2DA5, 0x2DA5, 0x2DA5 }, -{ 0x2DA6, 0x2DA6, 0x2DA6 }, -{ 0x2DA8, 0x2DA8, 0x2DA8 }, -{ 0x2DA9, 0x2DA9, 0x2DA9 }, -{ 0x2DAA, 0x2DAA, 0x2DAA }, -{ 0x2DAB, 0x2DAB, 0x2DAB }, -{ 0x2DAC, 0x2DAC, 0x2DAC }, -{ 0x2DAD, 0x2DAD, 0x2DAD }, -{ 0x2DAE, 0x2DAE, 0x2DAE }, -{ 0x2DB0, 0x2DB0, 0x2DB0 }, -{ 0x2DB1, 0x2DB1, 0x2DB1 }, -{ 0x2DB2, 0x2DB2, 0x2DB2 }, -{ 0x2DB3, 0x2DB3, 0x2DB3 }, -{ 0x2DB4, 0x2DB4, 0x2DB4 }, -{ 0x2DB5, 0x2DB5, 0x2DB5 }, -{ 0x2DB6, 0x2DB6, 0x2DB6 }, -{ 0x2DB8, 0x2DB8, 0x2DB8 }, -{ 0x2DB9, 0x2DB9, 0x2DB9 }, -{ 0x2DBA, 0x2DBA, 0x2DBA }, -{ 0x2DBB, 0x2DBB, 0x2DBB }, -{ 0x2DBC, 0x2DBC, 0x2DBC }, -{ 0x2DBD, 0x2DBD, 0x2DBD }, -{ 0x2DBE, 0x2DBE, 0x2DBE }, -{ 0x2DC0, 0x2DC0, 0x2DC0 }, -{ 0x2DC1, 0x2DC1, 0x2DC1 }, -{ 0x2DC2, 0x2DC2, 0x2DC2 }, -{ 0x2DC3, 0x2DC3, 0x2DC3 }, -{ 0x2DC4, 0x2DC4, 0x2DC4 }, -{ 0x2DC5, 0x2DC5, 0x2DC5 }, -{ 0x2DC6, 0x2DC6, 0x2DC6 }, -{ 0x2DC8, 0x2DC8, 0x2DC8 }, -{ 0x2DC9, 0x2DC9, 0x2DC9 }, -{ 0x2DCA, 0x2DCA, 0x2DCA }, -{ 0x2DCB, 0x2DCB, 0x2DCB }, -{ 0x2DCC, 0x2DCC, 0x2DCC }, -{ 0x2DCD, 0x2DCD, 0x2DCD }, -{ 0x2DCE, 0x2DCE, 0x2DCE }, -{ 0x2DD0, 0x2DD0, 0x2DD0 }, -{ 0x2DD1, 0x2DD1, 0x2DD1 }, -{ 0x2DD2, 0x2DD2, 0x2DD2 }, -{ 0x2DD3, 0x2DD3, 0x2DD3 }, -{ 0x2DD4, 0x2DD4, 0x2DD4 }, -{ 0x2DD5, 0x2DD5, 0x2DD5 }, -{ 0x2DD6, 0x2DD6, 0x2DD6 }, -{ 0x2DD8, 0x2DD8, 0x2DD8 }, -{ 0x2DD9, 0x2DD9, 0x2DD9 }, -{ 0x2DDA, 0x2DDA, 0x2DDA }, -{ 0x2DDB, 0x2DDB, 0x2DDB }, -{ 0x2DDC, 0x2DDC, 0x2DDC }, -{ 0x2DDD, 0x2DDD, 0x2DDD }, -{ 0x2DDE, 0x2DDE, 0x2DDE }, -{ 0x3005, 0x3005, 0x3005 }, -{ 0x3006, 0x3006, 0x3006 }, -{ 0x302A, 0x302A, 0x302A }, -{ 0x302B, 0x302B, 0x302B }, -{ 0x302C, 0x302C, 0x302C }, -{ 0x302D, 0x302D, 0x302D }, -{ 0x302E, 0x302E, 0x302E }, -{ 0x302F, 0x302F, 0x302F }, -{ 0x3031, 0x3031, 0x3031 }, -{ 0x3032, 0x3032, 0x3032 }, -{ 0x3033, 0x3033, 0x3033 }, -{ 0x3034, 0x3034, 0x3034 }, -{ 0x3035, 0x3035, 0x3035 }, -{ 0x303B, 0x303B, 0x303B }, -{ 0x303C, 0x303C, 0x303C }, -{ 0x3041, 0x3041, 0x3041 }, -{ 0x3042, 0x3042, 0x3042 }, -{ 0x3043, 0x3043, 0x3043 }, -{ 0x3044, 0x3044, 0x3044 }, -{ 0x3045, 0x3045, 0x3045 }, -{ 0x3046, 0x3046, 0x3046 }, -{ 0x3047, 0x3047, 0x3047 }, -{ 0x3048, 0x3048, 0x3048 }, -{ 0x3049, 0x3049, 0x3049 }, -{ 0x304A, 0x304A, 0x304A }, -{ 0x304B, 0x304B, 0x304B }, -{ 0x304C, 0x304C, 0x304C }, -{ 0x304D, 0x304D, 0x304D }, -{ 0x304E, 0x304E, 0x304E }, -{ 0x304F, 0x304F, 0x304F }, -{ 0x3050, 0x3050, 0x3050 }, -{ 0x3051, 0x3051, 0x3051 }, -{ 0x3052, 0x3052, 0x3052 }, -{ 0x3053, 0x3053, 0x3053 }, -{ 0x3054, 0x3054, 0x3054 }, -{ 0x3055, 0x3055, 0x3055 }, -{ 0x3056, 0x3056, 0x3056 }, -{ 0x3057, 0x3057, 0x3057 }, -{ 0x3058, 0x3058, 0x3058 }, -{ 0x3059, 0x3059, 0x3059 }, -{ 0x305A, 0x305A, 0x305A }, -{ 0x305B, 0x305B, 0x305B }, -{ 0x305C, 0x305C, 0x305C }, -{ 0x305D, 0x305D, 0x305D }, -{ 0x305E, 0x305E, 0x305E }, -{ 0x305F, 0x305F, 0x305F }, -{ 0x3060, 0x3060, 0x3060 }, -{ 0x3061, 0x3061, 0x3061 }, -{ 0x3062, 0x3062, 0x3062 }, -{ 0x3063, 0x3063, 0x3063 }, -{ 0x3064, 0x3064, 0x3064 }, -{ 0x3065, 0x3065, 0x3065 }, -{ 0x3066, 0x3066, 0x3066 }, -{ 0x3067, 0x3067, 0x3067 }, -{ 0x3068, 0x3068, 0x3068 }, -{ 0x3069, 0x3069, 0x3069 }, -{ 0x306A, 0x306A, 0x306A }, -{ 0x306B, 0x306B, 0x306B }, -{ 0x306C, 0x306C, 0x306C }, -{ 0x306D, 0x306D, 0x306D }, -{ 0x306E, 0x306E, 0x306E }, -{ 0x306F, 0x306F, 0x306F }, -{ 0x3070, 0x3070, 0x3070 }, -{ 0x3071, 0x3071, 0x3071 }, -{ 0x3072, 0x3072, 0x3072 }, -{ 0x3073, 0x3073, 0x3073 }, -{ 0x3074, 0x3074, 0x3074 }, -{ 0x3075, 0x3075, 0x3075 }, -{ 0x3076, 0x3076, 0x3076 }, -{ 0x3077, 0x3077, 0x3077 }, -{ 0x3078, 0x3078, 0x3078 }, -{ 0x3079, 0x3079, 0x3079 }, -{ 0x307A, 0x307A, 0x307A }, -{ 0x307B, 0x307B, 0x307B }, -{ 0x307C, 0x307C, 0x307C }, -{ 0x307D, 0x307D, 0x307D }, -{ 0x307E, 0x307E, 0x307E }, -{ 0x307F, 0x307F, 0x307F }, -{ 0x3080, 0x3080, 0x3080 }, -{ 0x3081, 0x3081, 0x3081 }, -{ 0x3082, 0x3082, 0x3082 }, -{ 0x3083, 0x3083, 0x3083 }, -{ 0x3084, 0x3084, 0x3084 }, -{ 0x3085, 0x3085, 0x3085 }, -{ 0x3086, 0x3086, 0x3086 }, -{ 0x3087, 0x3087, 0x3087 }, -{ 0x3088, 0x3088, 0x3088 }, -{ 0x3089, 0x3089, 0x3089 }, -{ 0x308A, 0x308A, 0x308A }, -{ 0x308B, 0x308B, 0x308B }, -{ 0x308C, 0x308C, 0x308C }, -{ 0x308D, 0x308D, 0x308D }, -{ 0x308E, 0x308E, 0x308E }, -{ 0x308F, 0x308F, 0x308F }, -{ 0x3090, 0x3090, 0x3090 }, -{ 0x3091, 0x3091, 0x3091 }, -{ 0x3092, 0x3092, 0x3092 }, -{ 0x3093, 0x3093, 0x3093 }, -{ 0x3094, 0x3094, 0x3094 }, -{ 0x3095, 0x3095, 0x3095 }, -{ 0x3096, 0x3096, 0x3096 }, -{ 0x3099, 0x3099, 0x3099 }, -{ 0x309A, 0x309A, 0x309A }, -{ 0x309D, 0x309D, 0x309D }, -{ 0x309E, 0x309E, 0x309E }, -{ 0x309F, 0x309F, 0x309F }, -{ 0x30A1, 0x30A1, 0x30A1 }, -{ 0x30A2, 0x30A2, 0x30A2 }, -{ 0x30A3, 0x30A3, 0x30A3 }, -{ 0x30A4, 0x30A4, 0x30A4 }, -{ 0x30A5, 0x30A5, 0x30A5 }, -{ 0x30A6, 0x30A6, 0x30A6 }, -{ 0x30A7, 0x30A7, 0x30A7 }, -{ 0x30A8, 0x30A8, 0x30A8 }, -{ 0x30A9, 0x30A9, 0x30A9 }, -{ 0x30AA, 0x30AA, 0x30AA }, -{ 0x30AB, 0x30AB, 0x30AB }, -{ 0x30AC, 0x30AC, 0x30AC }, -{ 0x30AD, 0x30AD, 0x30AD }, -{ 0x30AE, 0x30AE, 0x30AE }, -{ 0x30AF, 0x30AF, 0x30AF }, -{ 0x30B0, 0x30B0, 0x30B0 }, -{ 0x30B1, 0x30B1, 0x30B1 }, -{ 0x30B2, 0x30B2, 0x30B2 }, -{ 0x30B3, 0x30B3, 0x30B3 }, -{ 0x30B4, 0x30B4, 0x30B4 }, -{ 0x30B5, 0x30B5, 0x30B5 }, -{ 0x30B6, 0x30B6, 0x30B6 }, -{ 0x30B7, 0x30B7, 0x30B7 }, -{ 0x30B8, 0x30B8, 0x30B8 }, -{ 0x30B9, 0x30B9, 0x30B9 }, -{ 0x30BA, 0x30BA, 0x30BA }, -{ 0x30BB, 0x30BB, 0x30BB }, -{ 0x30BC, 0x30BC, 0x30BC }, -{ 0x30BD, 0x30BD, 0x30BD }, -{ 0x30BE, 0x30BE, 0x30BE }, -{ 0x30BF, 0x30BF, 0x30BF }, -{ 0x30C0, 0x30C0, 0x30C0 }, -{ 0x30C1, 0x30C1, 0x30C1 }, -{ 0x30C2, 0x30C2, 0x30C2 }, -{ 0x30C3, 0x30C3, 0x30C3 }, -{ 0x30C4, 0x30C4, 0x30C4 }, -{ 0x30C5, 0x30C5, 0x30C5 }, -{ 0x30C6, 0x30C6, 0x30C6 }, -{ 0x30C7, 0x30C7, 0x30C7 }, -{ 0x30C8, 0x30C8, 0x30C8 }, -{ 0x30C9, 0x30C9, 0x30C9 }, -{ 0x30CA, 0x30CA, 0x30CA }, -{ 0x30CB, 0x30CB, 0x30CB }, -{ 0x30CC, 0x30CC, 0x30CC }, -{ 0x30CD, 0x30CD, 0x30CD }, -{ 0x30CE, 0x30CE, 0x30CE }, -{ 0x30CF, 0x30CF, 0x30CF }, -{ 0x30D0, 0x30D0, 0x30D0 }, -{ 0x30D1, 0x30D1, 0x30D1 }, -{ 0x30D2, 0x30D2, 0x30D2 }, -{ 0x30D3, 0x30D3, 0x30D3 }, -{ 0x30D4, 0x30D4, 0x30D4 }, -{ 0x30D5, 0x30D5, 0x30D5 }, -{ 0x30D6, 0x30D6, 0x30D6 }, -{ 0x30D7, 0x30D7, 0x30D7 }, -{ 0x30D8, 0x30D8, 0x30D8 }, -{ 0x30D9, 0x30D9, 0x30D9 }, -{ 0x30DA, 0x30DA, 0x30DA }, -{ 0x30DB, 0x30DB, 0x30DB }, -{ 0x30DC, 0x30DC, 0x30DC }, -{ 0x30DD, 0x30DD, 0x30DD }, -{ 0x30DE, 0x30DE, 0x30DE }, -{ 0x30DF, 0x30DF, 0x30DF }, -{ 0x30E0, 0x30E0, 0x30E0 }, -{ 0x30E1, 0x30E1, 0x30E1 }, -{ 0x30E2, 0x30E2, 0x30E2 }, -{ 0x30E3, 0x30E3, 0x30E3 }, -{ 0x30E4, 0x30E4, 0x30E4 }, -{ 0x30E5, 0x30E5, 0x30E5 }, -{ 0x30E6, 0x30E6, 0x30E6 }, -{ 0x30E7, 0x30E7, 0x30E7 }, -{ 0x30E8, 0x30E8, 0x30E8 }, -{ 0x30E9, 0x30E9, 0x30E9 }, -{ 0x30EA, 0x30EA, 0x30EA }, -{ 0x30EB, 0x30EB, 0x30EB }, -{ 0x30EC, 0x30EC, 0x30EC }, -{ 0x30ED, 0x30ED, 0x30ED }, -{ 0x30EE, 0x30EE, 0x30EE }, -{ 0x30EF, 0x30EF, 0x30EF }, -{ 0x30F0, 0x30F0, 0x30F0 }, -{ 0x30F1, 0x30F1, 0x30F1 }, -{ 0x30F2, 0x30F2, 0x30F2 }, -{ 0x30F3, 0x30F3, 0x30F3 }, -{ 0x30F4, 0x30F4, 0x30F4 }, -{ 0x30F5, 0x30F5, 0x30F5 }, -{ 0x30F6, 0x30F6, 0x30F6 }, -{ 0x30F7, 0x30F7, 0x30F7 }, -{ 0x30F8, 0x30F8, 0x30F8 }, -{ 0x30F9, 0x30F9, 0x30F9 }, -{ 0x30FA, 0x30FA, 0x30FA }, -{ 0x30FC, 0x30FC, 0x30FC }, -{ 0x30FD, 0x30FD, 0x30FD }, -{ 0x30FE, 0x30FE, 0x30FE }, -{ 0x30FF, 0x30FF, 0x30FF }, -{ 0x3105, 0x3105, 0x3105 }, -{ 0x3106, 0x3106, 0x3106 }, -{ 0x3107, 0x3107, 0x3107 }, -{ 0x3108, 0x3108, 0x3108 }, -{ 0x3109, 0x3109, 0x3109 }, -{ 0x310A, 0x310A, 0x310A }, -{ 0x310B, 0x310B, 0x310B }, -{ 0x310C, 0x310C, 0x310C }, -{ 0x310D, 0x310D, 0x310D }, -{ 0x310E, 0x310E, 0x310E }, -{ 0x310F, 0x310F, 0x310F }, -{ 0x3110, 0x3110, 0x3110 }, -{ 0x3111, 0x3111, 0x3111 }, -{ 0x3112, 0x3112, 0x3112 }, -{ 0x3113, 0x3113, 0x3113 }, -{ 0x3114, 0x3114, 0x3114 }, -{ 0x3115, 0x3115, 0x3115 }, -{ 0x3116, 0x3116, 0x3116 }, -{ 0x3117, 0x3117, 0x3117 }, -{ 0x3118, 0x3118, 0x3118 }, -{ 0x3119, 0x3119, 0x3119 }, -{ 0x311A, 0x311A, 0x311A }, -{ 0x311B, 0x311B, 0x311B }, -{ 0x311C, 0x311C, 0x311C }, -{ 0x311D, 0x311D, 0x311D }, -{ 0x311E, 0x311E, 0x311E }, -{ 0x311F, 0x311F, 0x311F }, -{ 0x3120, 0x3120, 0x3120 }, -{ 0x3121, 0x3121, 0x3121 }, -{ 0x3122, 0x3122, 0x3122 }, -{ 0x3123, 0x3123, 0x3123 }, -{ 0x3124, 0x3124, 0x3124 }, -{ 0x3125, 0x3125, 0x3125 }, -{ 0x3126, 0x3126, 0x3126 }, -{ 0x3127, 0x3127, 0x3127 }, -{ 0x3128, 0x3128, 0x3128 }, -{ 0x3129, 0x3129, 0x3129 }, -{ 0x312A, 0x312A, 0x312A }, -{ 0x312B, 0x312B, 0x312B }, -{ 0x312C, 0x312C, 0x312C }, -{ 0x3131, 0x3131, 0x3131 }, -{ 0x3132, 0x3132, 0x3132 }, -{ 0x3133, 0x3133, 0x3133 }, -{ 0x3134, 0x3134, 0x3134 }, -{ 0x3135, 0x3135, 0x3135 }, -{ 0x3136, 0x3136, 0x3136 }, -{ 0x3137, 0x3137, 0x3137 }, -{ 0x3138, 0x3138, 0x3138 }, -{ 0x3139, 0x3139, 0x3139 }, -{ 0x313A, 0x313A, 0x313A }, -{ 0x313B, 0x313B, 0x313B }, -{ 0x313C, 0x313C, 0x313C }, -{ 0x313D, 0x313D, 0x313D }, -{ 0x313E, 0x313E, 0x313E }, -{ 0x313F, 0x313F, 0x313F }, -{ 0x3140, 0x3140, 0x3140 }, -{ 0x3141, 0x3141, 0x3141 }, -{ 0x3142, 0x3142, 0x3142 }, -{ 0x3143, 0x3143, 0x3143 }, -{ 0x3144, 0x3144, 0x3144 }, -{ 0x3145, 0x3145, 0x3145 }, -{ 0x3146, 0x3146, 0x3146 }, -{ 0x3147, 0x3147, 0x3147 }, -{ 0x3148, 0x3148, 0x3148 }, -{ 0x3149, 0x3149, 0x3149 }, -{ 0x314A, 0x314A, 0x314A }, -{ 0x314B, 0x314B, 0x314B }, -{ 0x314C, 0x314C, 0x314C }, -{ 0x314D, 0x314D, 0x314D }, -{ 0x314E, 0x314E, 0x314E }, -{ 0x314F, 0x314F, 0x314F }, -{ 0x3150, 0x3150, 0x3150 }, -{ 0x3151, 0x3151, 0x3151 }, -{ 0x3152, 0x3152, 0x3152 }, -{ 0x3153, 0x3153, 0x3153 }, -{ 0x3154, 0x3154, 0x3154 }, -{ 0x3155, 0x3155, 0x3155 }, -{ 0x3156, 0x3156, 0x3156 }, -{ 0x3157, 0x3157, 0x3157 }, -{ 0x3158, 0x3158, 0x3158 }, -{ 0x3159, 0x3159, 0x3159 }, -{ 0x315A, 0x315A, 0x315A }, -{ 0x315B, 0x315B, 0x315B }, -{ 0x315C, 0x315C, 0x315C }, -{ 0x315D, 0x315D, 0x315D }, -{ 0x315E, 0x315E, 0x315E }, -{ 0x315F, 0x315F, 0x315F }, -{ 0x3160, 0x3160, 0x3160 }, -{ 0x3161, 0x3161, 0x3161 }, -{ 0x3162, 0x3162, 0x3162 }, -{ 0x3163, 0x3163, 0x3163 }, -{ 0x3164, 0x3164, 0x3164 }, -{ 0x3165, 0x3165, 0x3165 }, -{ 0x3166, 0x3166, 0x3166 }, -{ 0x3167, 0x3167, 0x3167 }, -{ 0x3168, 0x3168, 0x3168 }, -{ 0x3169, 0x3169, 0x3169 }, -{ 0x316A, 0x316A, 0x316A }, -{ 0x316B, 0x316B, 0x316B }, -{ 0x316C, 0x316C, 0x316C }, -{ 0x316D, 0x316D, 0x316D }, -{ 0x316E, 0x316E, 0x316E }, -{ 0x316F, 0x316F, 0x316F }, -{ 0x3170, 0x3170, 0x3170 }, -{ 0x3171, 0x3171, 0x3171 }, -{ 0x3172, 0x3172, 0x3172 }, -{ 0x3173, 0x3173, 0x3173 }, -{ 0x3174, 0x3174, 0x3174 }, -{ 0x3175, 0x3175, 0x3175 }, -{ 0x3176, 0x3176, 0x3176 }, -{ 0x3177, 0x3177, 0x3177 }, -{ 0x3178, 0x3178, 0x3178 }, -{ 0x3179, 0x3179, 0x3179 }, -{ 0x317A, 0x317A, 0x317A }, -{ 0x317B, 0x317B, 0x317B }, -{ 0x317C, 0x317C, 0x317C }, -{ 0x317D, 0x317D, 0x317D }, -{ 0x317E, 0x317E, 0x317E }, -{ 0x317F, 0x317F, 0x317F }, -{ 0x3180, 0x3180, 0x3180 }, -{ 0x3181, 0x3181, 0x3181 }, -{ 0x3182, 0x3182, 0x3182 }, -{ 0x3183, 0x3183, 0x3183 }, -{ 0x3184, 0x3184, 0x3184 }, -{ 0x3185, 0x3185, 0x3185 }, -{ 0x3186, 0x3186, 0x3186 }, -{ 0x3187, 0x3187, 0x3187 }, -{ 0x3188, 0x3188, 0x3188 }, -{ 0x3189, 0x3189, 0x3189 }, -{ 0x318A, 0x318A, 0x318A }, -{ 0x318B, 0x318B, 0x318B }, -{ 0x318C, 0x318C, 0x318C }, -{ 0x318D, 0x318D, 0x318D }, -{ 0x318E, 0x318E, 0x318E }, -{ 0x31A0, 0x31A0, 0x31A0 }, -{ 0x31A1, 0x31A1, 0x31A1 }, -{ 0x31A2, 0x31A2, 0x31A2 }, -{ 0x31A3, 0x31A3, 0x31A3 }, -{ 0x31A4, 0x31A4, 0x31A4 }, -{ 0x31A5, 0x31A5, 0x31A5 }, -{ 0x31A6, 0x31A6, 0x31A6 }, -{ 0x31A7, 0x31A7, 0x31A7 }, -{ 0x31A8, 0x31A8, 0x31A8 }, -{ 0x31A9, 0x31A9, 0x31A9 }, -{ 0x31AA, 0x31AA, 0x31AA }, -{ 0x31AB, 0x31AB, 0x31AB }, -{ 0x31AC, 0x31AC, 0x31AC }, -{ 0x31AD, 0x31AD, 0x31AD }, -{ 0x31AE, 0x31AE, 0x31AE }, -{ 0x31AF, 0x31AF, 0x31AF }, -{ 0x31B0, 0x31B0, 0x31B0 }, -{ 0x31B1, 0x31B1, 0x31B1 }, -{ 0x31B2, 0x31B2, 0x31B2 }, -{ 0x31B3, 0x31B3, 0x31B3 }, -{ 0x31B4, 0x31B4, 0x31B4 }, -{ 0x31B5, 0x31B5, 0x31B5 }, -{ 0x31B6, 0x31B6, 0x31B6 }, -{ 0x31B7, 0x31B7, 0x31B7 }, -{ 0x31F0, 0x31F0, 0x31F0 }, -{ 0x31F1, 0x31F1, 0x31F1 }, -{ 0x31F2, 0x31F2, 0x31F2 }, -{ 0x31F3, 0x31F3, 0x31F3 }, -{ 0x31F4, 0x31F4, 0x31F4 }, -{ 0x31F5, 0x31F5, 0x31F5 }, -{ 0x31F6, 0x31F6, 0x31F6 }, -{ 0x31F7, 0x31F7, 0x31F7 }, -{ 0x31F8, 0x31F8, 0x31F8 }, -{ 0x31F9, 0x31F9, 0x31F9 }, -{ 0x31FA, 0x31FA, 0x31FA }, -{ 0x31FB, 0x31FB, 0x31FB }, -{ 0x31FC, 0x31FC, 0x31FC }, -{ 0x31FD, 0x31FD, 0x31FD }, -{ 0x31FE, 0x31FE, 0x31FE }, -{ 0x31FF, 0x31FF, 0x31FF }, -{ 0x3400, 0x3400, 0x3400 }, -{ 0x4DB5, 0x4DB5, 0x4DB5 }, -{ 0x4E00, 0x4E00, 0x4E00 }, -{ 0x9FBB, 0x9FBB, 0x9FBB }, -{ 0xA000, 0xA000, 0xA000 }, -{ 0xA001, 0xA001, 0xA001 }, -{ 0xA002, 0xA002, 0xA002 }, -{ 0xA003, 0xA003, 0xA003 }, -{ 0xA004, 0xA004, 0xA004 }, -{ 0xA005, 0xA005, 0xA005 }, -{ 0xA006, 0xA006, 0xA006 }, -{ 0xA007, 0xA007, 0xA007 }, -{ 0xA008, 0xA008, 0xA008 }, -{ 0xA009, 0xA009, 0xA009 }, -{ 0xA00A, 0xA00A, 0xA00A }, -{ 0xA00B, 0xA00B, 0xA00B }, -{ 0xA00C, 0xA00C, 0xA00C }, -{ 0xA00D, 0xA00D, 0xA00D }, -{ 0xA00E, 0xA00E, 0xA00E }, -{ 0xA00F, 0xA00F, 0xA00F }, -{ 0xA010, 0xA010, 0xA010 }, -{ 0xA011, 0xA011, 0xA011 }, -{ 0xA012, 0xA012, 0xA012 }, -{ 0xA013, 0xA013, 0xA013 }, -{ 0xA014, 0xA014, 0xA014 }, -{ 0xA015, 0xA015, 0xA015 }, -{ 0xA016, 0xA016, 0xA016 }, -{ 0xA017, 0xA017, 0xA017 }, -{ 0xA018, 0xA018, 0xA018 }, -{ 0xA019, 0xA019, 0xA019 }, -{ 0xA01A, 0xA01A, 0xA01A }, -{ 0xA01B, 0xA01B, 0xA01B }, -{ 0xA01C, 0xA01C, 0xA01C }, -{ 0xA01D, 0xA01D, 0xA01D }, -{ 0xA01E, 0xA01E, 0xA01E }, -{ 0xA01F, 0xA01F, 0xA01F }, -{ 0xA020, 0xA020, 0xA020 }, -{ 0xA021, 0xA021, 0xA021 }, -{ 0xA022, 0xA022, 0xA022 }, -{ 0xA023, 0xA023, 0xA023 }, -{ 0xA024, 0xA024, 0xA024 }, -{ 0xA025, 0xA025, 0xA025 }, -{ 0xA026, 0xA026, 0xA026 }, -{ 0xA027, 0xA027, 0xA027 }, -{ 0xA028, 0xA028, 0xA028 }, -{ 0xA029, 0xA029, 0xA029 }, -{ 0xA02A, 0xA02A, 0xA02A }, -{ 0xA02B, 0xA02B, 0xA02B }, -{ 0xA02C, 0xA02C, 0xA02C }, -{ 0xA02D, 0xA02D, 0xA02D }, -{ 0xA02E, 0xA02E, 0xA02E }, -{ 0xA02F, 0xA02F, 0xA02F }, -{ 0xA030, 0xA030, 0xA030 }, -{ 0xA031, 0xA031, 0xA031 }, -{ 0xA032, 0xA032, 0xA032 }, -{ 0xA033, 0xA033, 0xA033 }, -{ 0xA034, 0xA034, 0xA034 }, -{ 0xA035, 0xA035, 0xA035 }, -{ 0xA036, 0xA036, 0xA036 }, -{ 0xA037, 0xA037, 0xA037 }, -{ 0xA038, 0xA038, 0xA038 }, -{ 0xA039, 0xA039, 0xA039 }, -{ 0xA03A, 0xA03A, 0xA03A }, -{ 0xA03B, 0xA03B, 0xA03B }, -{ 0xA03C, 0xA03C, 0xA03C }, -{ 0xA03D, 0xA03D, 0xA03D }, -{ 0xA03E, 0xA03E, 0xA03E }, -{ 0xA03F, 0xA03F, 0xA03F }, -{ 0xA040, 0xA040, 0xA040 }, -{ 0xA041, 0xA041, 0xA041 }, -{ 0xA042, 0xA042, 0xA042 }, -{ 0xA043, 0xA043, 0xA043 }, -{ 0xA044, 0xA044, 0xA044 }, -{ 0xA045, 0xA045, 0xA045 }, -{ 0xA046, 0xA046, 0xA046 }, -{ 0xA047, 0xA047, 0xA047 }, -{ 0xA048, 0xA048, 0xA048 }, -{ 0xA049, 0xA049, 0xA049 }, -{ 0xA04A, 0xA04A, 0xA04A }, -{ 0xA04B, 0xA04B, 0xA04B }, -{ 0xA04C, 0xA04C, 0xA04C }, -{ 0xA04D, 0xA04D, 0xA04D }, -{ 0xA04E, 0xA04E, 0xA04E }, -{ 0xA04F, 0xA04F, 0xA04F }, -{ 0xA050, 0xA050, 0xA050 }, -{ 0xA051, 0xA051, 0xA051 }, -{ 0xA052, 0xA052, 0xA052 }, -{ 0xA053, 0xA053, 0xA053 }, -{ 0xA054, 0xA054, 0xA054 }, -{ 0xA055, 0xA055, 0xA055 }, -{ 0xA056, 0xA056, 0xA056 }, -{ 0xA057, 0xA057, 0xA057 }, -{ 0xA058, 0xA058, 0xA058 }, -{ 0xA059, 0xA059, 0xA059 }, -{ 0xA05A, 0xA05A, 0xA05A }, -{ 0xA05B, 0xA05B, 0xA05B }, -{ 0xA05C, 0xA05C, 0xA05C }, -{ 0xA05D, 0xA05D, 0xA05D }, -{ 0xA05E, 0xA05E, 0xA05E }, -{ 0xA05F, 0xA05F, 0xA05F }, -{ 0xA060, 0xA060, 0xA060 }, -{ 0xA061, 0xA061, 0xA061 }, -{ 0xA062, 0xA062, 0xA062 }, -{ 0xA063, 0xA063, 0xA063 }, -{ 0xA064, 0xA064, 0xA064 }, -{ 0xA065, 0xA065, 0xA065 }, -{ 0xA066, 0xA066, 0xA066 }, -{ 0xA067, 0xA067, 0xA067 }, -{ 0xA068, 0xA068, 0xA068 }, -{ 0xA069, 0xA069, 0xA069 }, -{ 0xA06A, 0xA06A, 0xA06A }, -{ 0xA06B, 0xA06B, 0xA06B }, -{ 0xA06C, 0xA06C, 0xA06C }, -{ 0xA06D, 0xA06D, 0xA06D }, -{ 0xA06E, 0xA06E, 0xA06E }, -{ 0xA06F, 0xA06F, 0xA06F }, -{ 0xA070, 0xA070, 0xA070 }, -{ 0xA071, 0xA071, 0xA071 }, -{ 0xA072, 0xA072, 0xA072 }, -{ 0xA073, 0xA073, 0xA073 }, -{ 0xA074, 0xA074, 0xA074 }, -{ 0xA075, 0xA075, 0xA075 }, -{ 0xA076, 0xA076, 0xA076 }, -{ 0xA077, 0xA077, 0xA077 }, -{ 0xA078, 0xA078, 0xA078 }, -{ 0xA079, 0xA079, 0xA079 }, -{ 0xA07A, 0xA07A, 0xA07A }, -{ 0xA07B, 0xA07B, 0xA07B }, -{ 0xA07C, 0xA07C, 0xA07C }, -{ 0xA07D, 0xA07D, 0xA07D }, -{ 0xA07E, 0xA07E, 0xA07E }, -{ 0xA07F, 0xA07F, 0xA07F }, -{ 0xA080, 0xA080, 0xA080 }, -{ 0xA081, 0xA081, 0xA081 }, -{ 0xA082, 0xA082, 0xA082 }, -{ 0xA083, 0xA083, 0xA083 }, -{ 0xA084, 0xA084, 0xA084 }, -{ 0xA085, 0xA085, 0xA085 }, -{ 0xA086, 0xA086, 0xA086 }, -{ 0xA087, 0xA087, 0xA087 }, -{ 0xA088, 0xA088, 0xA088 }, -{ 0xA089, 0xA089, 0xA089 }, -{ 0xA08A, 0xA08A, 0xA08A }, -{ 0xA08B, 0xA08B, 0xA08B }, -{ 0xA08C, 0xA08C, 0xA08C }, -{ 0xA08D, 0xA08D, 0xA08D }, -{ 0xA08E, 0xA08E, 0xA08E }, -{ 0xA08F, 0xA08F, 0xA08F }, -{ 0xA090, 0xA090, 0xA090 }, -{ 0xA091, 0xA091, 0xA091 }, -{ 0xA092, 0xA092, 0xA092 }, -{ 0xA093, 0xA093, 0xA093 }, -{ 0xA094, 0xA094, 0xA094 }, -{ 0xA095, 0xA095, 0xA095 }, -{ 0xA096, 0xA096, 0xA096 }, -{ 0xA097, 0xA097, 0xA097 }, -{ 0xA098, 0xA098, 0xA098 }, -{ 0xA099, 0xA099, 0xA099 }, -{ 0xA09A, 0xA09A, 0xA09A }, -{ 0xA09B, 0xA09B, 0xA09B }, -{ 0xA09C, 0xA09C, 0xA09C }, -{ 0xA09D, 0xA09D, 0xA09D }, -{ 0xA09E, 0xA09E, 0xA09E }, -{ 0xA09F, 0xA09F, 0xA09F }, -{ 0xA0A0, 0xA0A0, 0xA0A0 }, -{ 0xA0A1, 0xA0A1, 0xA0A1 }, -{ 0xA0A2, 0xA0A2, 0xA0A2 }, -{ 0xA0A3, 0xA0A3, 0xA0A3 }, -{ 0xA0A4, 0xA0A4, 0xA0A4 }, -{ 0xA0A5, 0xA0A5, 0xA0A5 }, -{ 0xA0A6, 0xA0A6, 0xA0A6 }, -{ 0xA0A7, 0xA0A7, 0xA0A7 }, -{ 0xA0A8, 0xA0A8, 0xA0A8 }, -{ 0xA0A9, 0xA0A9, 0xA0A9 }, -{ 0xA0AA, 0xA0AA, 0xA0AA }, -{ 0xA0AB, 0xA0AB, 0xA0AB }, -{ 0xA0AC, 0xA0AC, 0xA0AC }, -{ 0xA0AD, 0xA0AD, 0xA0AD }, -{ 0xA0AE, 0xA0AE, 0xA0AE }, -{ 0xA0AF, 0xA0AF, 0xA0AF }, -{ 0xA0B0, 0xA0B0, 0xA0B0 }, -{ 0xA0B1, 0xA0B1, 0xA0B1 }, -{ 0xA0B2, 0xA0B2, 0xA0B2 }, -{ 0xA0B3, 0xA0B3, 0xA0B3 }, -{ 0xA0B4, 0xA0B4, 0xA0B4 }, -{ 0xA0B5, 0xA0B5, 0xA0B5 }, -{ 0xA0B6, 0xA0B6, 0xA0B6 }, -{ 0xA0B7, 0xA0B7, 0xA0B7 }, -{ 0xA0B8, 0xA0B8, 0xA0B8 }, -{ 0xA0B9, 0xA0B9, 0xA0B9 }, -{ 0xA0BA, 0xA0BA, 0xA0BA }, -{ 0xA0BB, 0xA0BB, 0xA0BB }, -{ 0xA0BC, 0xA0BC, 0xA0BC }, -{ 0xA0BD, 0xA0BD, 0xA0BD }, -{ 0xA0BE, 0xA0BE, 0xA0BE }, -{ 0xA0BF, 0xA0BF, 0xA0BF }, -{ 0xA0C0, 0xA0C0, 0xA0C0 }, -{ 0xA0C1, 0xA0C1, 0xA0C1 }, -{ 0xA0C2, 0xA0C2, 0xA0C2 }, -{ 0xA0C3, 0xA0C3, 0xA0C3 }, -{ 0xA0C4, 0xA0C4, 0xA0C4 }, -{ 0xA0C5, 0xA0C5, 0xA0C5 }, -{ 0xA0C6, 0xA0C6, 0xA0C6 }, -{ 0xA0C7, 0xA0C7, 0xA0C7 }, -{ 0xA0C8, 0xA0C8, 0xA0C8 }, -{ 0xA0C9, 0xA0C9, 0xA0C9 }, -{ 0xA0CA, 0xA0CA, 0xA0CA }, -{ 0xA0CB, 0xA0CB, 0xA0CB }, -{ 0xA0CC, 0xA0CC, 0xA0CC }, -{ 0xA0CD, 0xA0CD, 0xA0CD }, -{ 0xA0CE, 0xA0CE, 0xA0CE }, -{ 0xA0CF, 0xA0CF, 0xA0CF }, -{ 0xA0D0, 0xA0D0, 0xA0D0 }, -{ 0xA0D1, 0xA0D1, 0xA0D1 }, -{ 0xA0D2, 0xA0D2, 0xA0D2 }, -{ 0xA0D3, 0xA0D3, 0xA0D3 }, -{ 0xA0D4, 0xA0D4, 0xA0D4 }, -{ 0xA0D5, 0xA0D5, 0xA0D5 }, -{ 0xA0D6, 0xA0D6, 0xA0D6 }, -{ 0xA0D7, 0xA0D7, 0xA0D7 }, -{ 0xA0D8, 0xA0D8, 0xA0D8 }, -{ 0xA0D9, 0xA0D9, 0xA0D9 }, -{ 0xA0DA, 0xA0DA, 0xA0DA }, -{ 0xA0DB, 0xA0DB, 0xA0DB }, -{ 0xA0DC, 0xA0DC, 0xA0DC }, -{ 0xA0DD, 0xA0DD, 0xA0DD }, -{ 0xA0DE, 0xA0DE, 0xA0DE }, -{ 0xA0DF, 0xA0DF, 0xA0DF }, -{ 0xA0E0, 0xA0E0, 0xA0E0 }, -{ 0xA0E1, 0xA0E1, 0xA0E1 }, -{ 0xA0E2, 0xA0E2, 0xA0E2 }, -{ 0xA0E3, 0xA0E3, 0xA0E3 }, -{ 0xA0E4, 0xA0E4, 0xA0E4 }, -{ 0xA0E5, 0xA0E5, 0xA0E5 }, -{ 0xA0E6, 0xA0E6, 0xA0E6 }, -{ 0xA0E7, 0xA0E7, 0xA0E7 }, -{ 0xA0E8, 0xA0E8, 0xA0E8 }, -{ 0xA0E9, 0xA0E9, 0xA0E9 }, -{ 0xA0EA, 0xA0EA, 0xA0EA }, -{ 0xA0EB, 0xA0EB, 0xA0EB }, -{ 0xA0EC, 0xA0EC, 0xA0EC }, -{ 0xA0ED, 0xA0ED, 0xA0ED }, -{ 0xA0EE, 0xA0EE, 0xA0EE }, -{ 0xA0EF, 0xA0EF, 0xA0EF }, -{ 0xA0F0, 0xA0F0, 0xA0F0 }, -{ 0xA0F1, 0xA0F1, 0xA0F1 }, -{ 0xA0F2, 0xA0F2, 0xA0F2 }, -{ 0xA0F3, 0xA0F3, 0xA0F3 }, -{ 0xA0F4, 0xA0F4, 0xA0F4 }, -{ 0xA0F5, 0xA0F5, 0xA0F5 }, -{ 0xA0F6, 0xA0F6, 0xA0F6 }, -{ 0xA0F7, 0xA0F7, 0xA0F7 }, -{ 0xA0F8, 0xA0F8, 0xA0F8 }, -{ 0xA0F9, 0xA0F9, 0xA0F9 }, -{ 0xA0FA, 0xA0FA, 0xA0FA }, -{ 0xA0FB, 0xA0FB, 0xA0FB }, -{ 0xA0FC, 0xA0FC, 0xA0FC }, -{ 0xA0FD, 0xA0FD, 0xA0FD }, -{ 0xA0FE, 0xA0FE, 0xA0FE }, -{ 0xA0FF, 0xA0FF, 0xA0FF }, -{ 0xA100, 0xA100, 0xA100 }, -{ 0xA101, 0xA101, 0xA101 }, -{ 0xA102, 0xA102, 0xA102 }, -{ 0xA103, 0xA103, 0xA103 }, -{ 0xA104, 0xA104, 0xA104 }, -{ 0xA105, 0xA105, 0xA105 }, -{ 0xA106, 0xA106, 0xA106 }, -{ 0xA107, 0xA107, 0xA107 }, -{ 0xA108, 0xA108, 0xA108 }, -{ 0xA109, 0xA109, 0xA109 }, -{ 0xA10A, 0xA10A, 0xA10A }, -{ 0xA10B, 0xA10B, 0xA10B }, -{ 0xA10C, 0xA10C, 0xA10C }, -{ 0xA10D, 0xA10D, 0xA10D }, -{ 0xA10E, 0xA10E, 0xA10E }, -{ 0xA10F, 0xA10F, 0xA10F }, -{ 0xA110, 0xA110, 0xA110 }, -{ 0xA111, 0xA111, 0xA111 }, -{ 0xA112, 0xA112, 0xA112 }, -{ 0xA113, 0xA113, 0xA113 }, -{ 0xA114, 0xA114, 0xA114 }, -{ 0xA115, 0xA115, 0xA115 }, -{ 0xA116, 0xA116, 0xA116 }, -{ 0xA117, 0xA117, 0xA117 }, -{ 0xA118, 0xA118, 0xA118 }, -{ 0xA119, 0xA119, 0xA119 }, -{ 0xA11A, 0xA11A, 0xA11A }, -{ 0xA11B, 0xA11B, 0xA11B }, -{ 0xA11C, 0xA11C, 0xA11C }, -{ 0xA11D, 0xA11D, 0xA11D }, -{ 0xA11E, 0xA11E, 0xA11E }, -{ 0xA11F, 0xA11F, 0xA11F }, -{ 0xA120, 0xA120, 0xA120 }, -{ 0xA121, 0xA121, 0xA121 }, -{ 0xA122, 0xA122, 0xA122 }, -{ 0xA123, 0xA123, 0xA123 }, -{ 0xA124, 0xA124, 0xA124 }, -{ 0xA125, 0xA125, 0xA125 }, -{ 0xA126, 0xA126, 0xA126 }, -{ 0xA127, 0xA127, 0xA127 }, -{ 0xA128, 0xA128, 0xA128 }, -{ 0xA129, 0xA129, 0xA129 }, -{ 0xA12A, 0xA12A, 0xA12A }, -{ 0xA12B, 0xA12B, 0xA12B }, -{ 0xA12C, 0xA12C, 0xA12C }, -{ 0xA12D, 0xA12D, 0xA12D }, -{ 0xA12E, 0xA12E, 0xA12E }, -{ 0xA12F, 0xA12F, 0xA12F }, -{ 0xA130, 0xA130, 0xA130 }, -{ 0xA131, 0xA131, 0xA131 }, -{ 0xA132, 0xA132, 0xA132 }, -{ 0xA133, 0xA133, 0xA133 }, -{ 0xA134, 0xA134, 0xA134 }, -{ 0xA135, 0xA135, 0xA135 }, -{ 0xA136, 0xA136, 0xA136 }, -{ 0xA137, 0xA137, 0xA137 }, -{ 0xA138, 0xA138, 0xA138 }, -{ 0xA139, 0xA139, 0xA139 }, -{ 0xA13A, 0xA13A, 0xA13A }, -{ 0xA13B, 0xA13B, 0xA13B }, -{ 0xA13C, 0xA13C, 0xA13C }, -{ 0xA13D, 0xA13D, 0xA13D }, -{ 0xA13E, 0xA13E, 0xA13E }, -{ 0xA13F, 0xA13F, 0xA13F }, -{ 0xA140, 0xA140, 0xA140 }, -{ 0xA141, 0xA141, 0xA141 }, -{ 0xA142, 0xA142, 0xA142 }, -{ 0xA143, 0xA143, 0xA143 }, -{ 0xA144, 0xA144, 0xA144 }, -{ 0xA145, 0xA145, 0xA145 }, -{ 0xA146, 0xA146, 0xA146 }, -{ 0xA147, 0xA147, 0xA147 }, -{ 0xA148, 0xA148, 0xA148 }, -{ 0xA149, 0xA149, 0xA149 }, -{ 0xA14A, 0xA14A, 0xA14A }, -{ 0xA14B, 0xA14B, 0xA14B }, -{ 0xA14C, 0xA14C, 0xA14C }, -{ 0xA14D, 0xA14D, 0xA14D }, -{ 0xA14E, 0xA14E, 0xA14E }, -{ 0xA14F, 0xA14F, 0xA14F }, -{ 0xA150, 0xA150, 0xA150 }, -{ 0xA151, 0xA151, 0xA151 }, -{ 0xA152, 0xA152, 0xA152 }, -{ 0xA153, 0xA153, 0xA153 }, -{ 0xA154, 0xA154, 0xA154 }, -{ 0xA155, 0xA155, 0xA155 }, -{ 0xA156, 0xA156, 0xA156 }, -{ 0xA157, 0xA157, 0xA157 }, -{ 0xA158, 0xA158, 0xA158 }, -{ 0xA159, 0xA159, 0xA159 }, -{ 0xA15A, 0xA15A, 0xA15A }, -{ 0xA15B, 0xA15B, 0xA15B }, -{ 0xA15C, 0xA15C, 0xA15C }, -{ 0xA15D, 0xA15D, 0xA15D }, -{ 0xA15E, 0xA15E, 0xA15E }, -{ 0xA15F, 0xA15F, 0xA15F }, -{ 0xA160, 0xA160, 0xA160 }, -{ 0xA161, 0xA161, 0xA161 }, -{ 0xA162, 0xA162, 0xA162 }, -{ 0xA163, 0xA163, 0xA163 }, -{ 0xA164, 0xA164, 0xA164 }, -{ 0xA165, 0xA165, 0xA165 }, -{ 0xA166, 0xA166, 0xA166 }, -{ 0xA167, 0xA167, 0xA167 }, -{ 0xA168, 0xA168, 0xA168 }, -{ 0xA169, 0xA169, 0xA169 }, -{ 0xA16A, 0xA16A, 0xA16A }, -{ 0xA16B, 0xA16B, 0xA16B }, -{ 0xA16C, 0xA16C, 0xA16C }, -{ 0xA16D, 0xA16D, 0xA16D }, -{ 0xA16E, 0xA16E, 0xA16E }, -{ 0xA16F, 0xA16F, 0xA16F }, -{ 0xA170, 0xA170, 0xA170 }, -{ 0xA171, 0xA171, 0xA171 }, -{ 0xA172, 0xA172, 0xA172 }, -{ 0xA173, 0xA173, 0xA173 }, -{ 0xA174, 0xA174, 0xA174 }, -{ 0xA175, 0xA175, 0xA175 }, -{ 0xA176, 0xA176, 0xA176 }, -{ 0xA177, 0xA177, 0xA177 }, -{ 0xA178, 0xA178, 0xA178 }, -{ 0xA179, 0xA179, 0xA179 }, -{ 0xA17A, 0xA17A, 0xA17A }, -{ 0xA17B, 0xA17B, 0xA17B }, -{ 0xA17C, 0xA17C, 0xA17C }, -{ 0xA17D, 0xA17D, 0xA17D }, -{ 0xA17E, 0xA17E, 0xA17E }, -{ 0xA17F, 0xA17F, 0xA17F }, -{ 0xA180, 0xA180, 0xA180 }, -{ 0xA181, 0xA181, 0xA181 }, -{ 0xA182, 0xA182, 0xA182 }, -{ 0xA183, 0xA183, 0xA183 }, -{ 0xA184, 0xA184, 0xA184 }, -{ 0xA185, 0xA185, 0xA185 }, -{ 0xA186, 0xA186, 0xA186 }, -{ 0xA187, 0xA187, 0xA187 }, -{ 0xA188, 0xA188, 0xA188 }, -{ 0xA189, 0xA189, 0xA189 }, -{ 0xA18A, 0xA18A, 0xA18A }, -{ 0xA18B, 0xA18B, 0xA18B }, -{ 0xA18C, 0xA18C, 0xA18C }, -{ 0xA18D, 0xA18D, 0xA18D }, -{ 0xA18E, 0xA18E, 0xA18E }, -{ 0xA18F, 0xA18F, 0xA18F }, -{ 0xA190, 0xA190, 0xA190 }, -{ 0xA191, 0xA191, 0xA191 }, -{ 0xA192, 0xA192, 0xA192 }, -{ 0xA193, 0xA193, 0xA193 }, -{ 0xA194, 0xA194, 0xA194 }, -{ 0xA195, 0xA195, 0xA195 }, -{ 0xA196, 0xA196, 0xA196 }, -{ 0xA197, 0xA197, 0xA197 }, -{ 0xA198, 0xA198, 0xA198 }, -{ 0xA199, 0xA199, 0xA199 }, -{ 0xA19A, 0xA19A, 0xA19A }, -{ 0xA19B, 0xA19B, 0xA19B }, -{ 0xA19C, 0xA19C, 0xA19C }, -{ 0xA19D, 0xA19D, 0xA19D }, -{ 0xA19E, 0xA19E, 0xA19E }, -{ 0xA19F, 0xA19F, 0xA19F }, -{ 0xA1A0, 0xA1A0, 0xA1A0 }, -{ 0xA1A1, 0xA1A1, 0xA1A1 }, -{ 0xA1A2, 0xA1A2, 0xA1A2 }, -{ 0xA1A3, 0xA1A3, 0xA1A3 }, -{ 0xA1A4, 0xA1A4, 0xA1A4 }, -{ 0xA1A5, 0xA1A5, 0xA1A5 }, -{ 0xA1A6, 0xA1A6, 0xA1A6 }, -{ 0xA1A7, 0xA1A7, 0xA1A7 }, -{ 0xA1A8, 0xA1A8, 0xA1A8 }, -{ 0xA1A9, 0xA1A9, 0xA1A9 }, -{ 0xA1AA, 0xA1AA, 0xA1AA }, -{ 0xA1AB, 0xA1AB, 0xA1AB }, -{ 0xA1AC, 0xA1AC, 0xA1AC }, -{ 0xA1AD, 0xA1AD, 0xA1AD }, -{ 0xA1AE, 0xA1AE, 0xA1AE }, -{ 0xA1AF, 0xA1AF, 0xA1AF }, -{ 0xA1B0, 0xA1B0, 0xA1B0 }, -{ 0xA1B1, 0xA1B1, 0xA1B1 }, -{ 0xA1B2, 0xA1B2, 0xA1B2 }, -{ 0xA1B3, 0xA1B3, 0xA1B3 }, -{ 0xA1B4, 0xA1B4, 0xA1B4 }, -{ 0xA1B5, 0xA1B5, 0xA1B5 }, -{ 0xA1B6, 0xA1B6, 0xA1B6 }, -{ 0xA1B7, 0xA1B7, 0xA1B7 }, -{ 0xA1B8, 0xA1B8, 0xA1B8 }, -{ 0xA1B9, 0xA1B9, 0xA1B9 }, -{ 0xA1BA, 0xA1BA, 0xA1BA }, -{ 0xA1BB, 0xA1BB, 0xA1BB }, -{ 0xA1BC, 0xA1BC, 0xA1BC }, -{ 0xA1BD, 0xA1BD, 0xA1BD }, -{ 0xA1BE, 0xA1BE, 0xA1BE }, -{ 0xA1BF, 0xA1BF, 0xA1BF }, -{ 0xA1C0, 0xA1C0, 0xA1C0 }, -{ 0xA1C1, 0xA1C1, 0xA1C1 }, -{ 0xA1C2, 0xA1C2, 0xA1C2 }, -{ 0xA1C3, 0xA1C3, 0xA1C3 }, -{ 0xA1C4, 0xA1C4, 0xA1C4 }, -{ 0xA1C5, 0xA1C5, 0xA1C5 }, -{ 0xA1C6, 0xA1C6, 0xA1C6 }, -{ 0xA1C7, 0xA1C7, 0xA1C7 }, -{ 0xA1C8, 0xA1C8, 0xA1C8 }, -{ 0xA1C9, 0xA1C9, 0xA1C9 }, -{ 0xA1CA, 0xA1CA, 0xA1CA }, -{ 0xA1CB, 0xA1CB, 0xA1CB }, -{ 0xA1CC, 0xA1CC, 0xA1CC }, -{ 0xA1CD, 0xA1CD, 0xA1CD }, -{ 0xA1CE, 0xA1CE, 0xA1CE }, -{ 0xA1CF, 0xA1CF, 0xA1CF }, -{ 0xA1D0, 0xA1D0, 0xA1D0 }, -{ 0xA1D1, 0xA1D1, 0xA1D1 }, -{ 0xA1D2, 0xA1D2, 0xA1D2 }, -{ 0xA1D3, 0xA1D3, 0xA1D3 }, -{ 0xA1D4, 0xA1D4, 0xA1D4 }, -{ 0xA1D5, 0xA1D5, 0xA1D5 }, -{ 0xA1D6, 0xA1D6, 0xA1D6 }, -{ 0xA1D7, 0xA1D7, 0xA1D7 }, -{ 0xA1D8, 0xA1D8, 0xA1D8 }, -{ 0xA1D9, 0xA1D9, 0xA1D9 }, -{ 0xA1DA, 0xA1DA, 0xA1DA }, -{ 0xA1DB, 0xA1DB, 0xA1DB }, -{ 0xA1DC, 0xA1DC, 0xA1DC }, -{ 0xA1DD, 0xA1DD, 0xA1DD }, -{ 0xA1DE, 0xA1DE, 0xA1DE }, -{ 0xA1DF, 0xA1DF, 0xA1DF }, -{ 0xA1E0, 0xA1E0, 0xA1E0 }, -{ 0xA1E1, 0xA1E1, 0xA1E1 }, -{ 0xA1E2, 0xA1E2, 0xA1E2 }, -{ 0xA1E3, 0xA1E3, 0xA1E3 }, -{ 0xA1E4, 0xA1E4, 0xA1E4 }, -{ 0xA1E5, 0xA1E5, 0xA1E5 }, -{ 0xA1E6, 0xA1E6, 0xA1E6 }, -{ 0xA1E7, 0xA1E7, 0xA1E7 }, -{ 0xA1E8, 0xA1E8, 0xA1E8 }, -{ 0xA1E9, 0xA1E9, 0xA1E9 }, -{ 0xA1EA, 0xA1EA, 0xA1EA }, -{ 0xA1EB, 0xA1EB, 0xA1EB }, -{ 0xA1EC, 0xA1EC, 0xA1EC }, -{ 0xA1ED, 0xA1ED, 0xA1ED }, -{ 0xA1EE, 0xA1EE, 0xA1EE }, -{ 0xA1EF, 0xA1EF, 0xA1EF }, -{ 0xA1F0, 0xA1F0, 0xA1F0 }, -{ 0xA1F1, 0xA1F1, 0xA1F1 }, -{ 0xA1F2, 0xA1F2, 0xA1F2 }, -{ 0xA1F3, 0xA1F3, 0xA1F3 }, -{ 0xA1F4, 0xA1F4, 0xA1F4 }, -{ 0xA1F5, 0xA1F5, 0xA1F5 }, -{ 0xA1F6, 0xA1F6, 0xA1F6 }, -{ 0xA1F7, 0xA1F7, 0xA1F7 }, -{ 0xA1F8, 0xA1F8, 0xA1F8 }, -{ 0xA1F9, 0xA1F9, 0xA1F9 }, -{ 0xA1FA, 0xA1FA, 0xA1FA }, -{ 0xA1FB, 0xA1FB, 0xA1FB }, -{ 0xA1FC, 0xA1FC, 0xA1FC }, -{ 0xA1FD, 0xA1FD, 0xA1FD }, -{ 0xA1FE, 0xA1FE, 0xA1FE }, -{ 0xA1FF, 0xA1FF, 0xA1FF }, -{ 0xA200, 0xA200, 0xA200 }, -{ 0xA201, 0xA201, 0xA201 }, -{ 0xA202, 0xA202, 0xA202 }, -{ 0xA203, 0xA203, 0xA203 }, -{ 0xA204, 0xA204, 0xA204 }, -{ 0xA205, 0xA205, 0xA205 }, -{ 0xA206, 0xA206, 0xA206 }, -{ 0xA207, 0xA207, 0xA207 }, -{ 0xA208, 0xA208, 0xA208 }, -{ 0xA209, 0xA209, 0xA209 }, -{ 0xA20A, 0xA20A, 0xA20A }, -{ 0xA20B, 0xA20B, 0xA20B }, -{ 0xA20C, 0xA20C, 0xA20C }, -{ 0xA20D, 0xA20D, 0xA20D }, -{ 0xA20E, 0xA20E, 0xA20E }, -{ 0xA20F, 0xA20F, 0xA20F }, -{ 0xA210, 0xA210, 0xA210 }, -{ 0xA211, 0xA211, 0xA211 }, -{ 0xA212, 0xA212, 0xA212 }, -{ 0xA213, 0xA213, 0xA213 }, -{ 0xA214, 0xA214, 0xA214 }, -{ 0xA215, 0xA215, 0xA215 }, -{ 0xA216, 0xA216, 0xA216 }, -{ 0xA217, 0xA217, 0xA217 }, -{ 0xA218, 0xA218, 0xA218 }, -{ 0xA219, 0xA219, 0xA219 }, -{ 0xA21A, 0xA21A, 0xA21A }, -{ 0xA21B, 0xA21B, 0xA21B }, -{ 0xA21C, 0xA21C, 0xA21C }, -{ 0xA21D, 0xA21D, 0xA21D }, -{ 0xA21E, 0xA21E, 0xA21E }, -{ 0xA21F, 0xA21F, 0xA21F }, -{ 0xA220, 0xA220, 0xA220 }, -{ 0xA221, 0xA221, 0xA221 }, -{ 0xA222, 0xA222, 0xA222 }, -{ 0xA223, 0xA223, 0xA223 }, -{ 0xA224, 0xA224, 0xA224 }, -{ 0xA225, 0xA225, 0xA225 }, -{ 0xA226, 0xA226, 0xA226 }, -{ 0xA227, 0xA227, 0xA227 }, -{ 0xA228, 0xA228, 0xA228 }, -{ 0xA229, 0xA229, 0xA229 }, -{ 0xA22A, 0xA22A, 0xA22A }, -{ 0xA22B, 0xA22B, 0xA22B }, -{ 0xA22C, 0xA22C, 0xA22C }, -{ 0xA22D, 0xA22D, 0xA22D }, -{ 0xA22E, 0xA22E, 0xA22E }, -{ 0xA22F, 0xA22F, 0xA22F }, -{ 0xA230, 0xA230, 0xA230 }, -{ 0xA231, 0xA231, 0xA231 }, -{ 0xA232, 0xA232, 0xA232 }, -{ 0xA233, 0xA233, 0xA233 }, -{ 0xA234, 0xA234, 0xA234 }, -{ 0xA235, 0xA235, 0xA235 }, -{ 0xA236, 0xA236, 0xA236 }, -{ 0xA237, 0xA237, 0xA237 }, -{ 0xA238, 0xA238, 0xA238 }, -{ 0xA239, 0xA239, 0xA239 }, -{ 0xA23A, 0xA23A, 0xA23A }, -{ 0xA23B, 0xA23B, 0xA23B }, -{ 0xA23C, 0xA23C, 0xA23C }, -{ 0xA23D, 0xA23D, 0xA23D }, -{ 0xA23E, 0xA23E, 0xA23E }, -{ 0xA23F, 0xA23F, 0xA23F }, -{ 0xA240, 0xA240, 0xA240 }, -{ 0xA241, 0xA241, 0xA241 }, -{ 0xA242, 0xA242, 0xA242 }, -{ 0xA243, 0xA243, 0xA243 }, -{ 0xA244, 0xA244, 0xA244 }, -{ 0xA245, 0xA245, 0xA245 }, -{ 0xA246, 0xA246, 0xA246 }, -{ 0xA247, 0xA247, 0xA247 }, -{ 0xA248, 0xA248, 0xA248 }, -{ 0xA249, 0xA249, 0xA249 }, -{ 0xA24A, 0xA24A, 0xA24A }, -{ 0xA24B, 0xA24B, 0xA24B }, -{ 0xA24C, 0xA24C, 0xA24C }, -{ 0xA24D, 0xA24D, 0xA24D }, -{ 0xA24E, 0xA24E, 0xA24E }, -{ 0xA24F, 0xA24F, 0xA24F }, -{ 0xA250, 0xA250, 0xA250 }, -{ 0xA251, 0xA251, 0xA251 }, -{ 0xA252, 0xA252, 0xA252 }, -{ 0xA253, 0xA253, 0xA253 }, -{ 0xA254, 0xA254, 0xA254 }, -{ 0xA255, 0xA255, 0xA255 }, -{ 0xA256, 0xA256, 0xA256 }, -{ 0xA257, 0xA257, 0xA257 }, -{ 0xA258, 0xA258, 0xA258 }, -{ 0xA259, 0xA259, 0xA259 }, -{ 0xA25A, 0xA25A, 0xA25A }, -{ 0xA25B, 0xA25B, 0xA25B }, -{ 0xA25C, 0xA25C, 0xA25C }, -{ 0xA25D, 0xA25D, 0xA25D }, -{ 0xA25E, 0xA25E, 0xA25E }, -{ 0xA25F, 0xA25F, 0xA25F }, -{ 0xA260, 0xA260, 0xA260 }, -{ 0xA261, 0xA261, 0xA261 }, -{ 0xA262, 0xA262, 0xA262 }, -{ 0xA263, 0xA263, 0xA263 }, -{ 0xA264, 0xA264, 0xA264 }, -{ 0xA265, 0xA265, 0xA265 }, -{ 0xA266, 0xA266, 0xA266 }, -{ 0xA267, 0xA267, 0xA267 }, -{ 0xA268, 0xA268, 0xA268 }, -{ 0xA269, 0xA269, 0xA269 }, -{ 0xA26A, 0xA26A, 0xA26A }, -{ 0xA26B, 0xA26B, 0xA26B }, -{ 0xA26C, 0xA26C, 0xA26C }, -{ 0xA26D, 0xA26D, 0xA26D }, -{ 0xA26E, 0xA26E, 0xA26E }, -{ 0xA26F, 0xA26F, 0xA26F }, -{ 0xA270, 0xA270, 0xA270 }, -{ 0xA271, 0xA271, 0xA271 }, -{ 0xA272, 0xA272, 0xA272 }, -{ 0xA273, 0xA273, 0xA273 }, -{ 0xA274, 0xA274, 0xA274 }, -{ 0xA275, 0xA275, 0xA275 }, -{ 0xA276, 0xA276, 0xA276 }, -{ 0xA277, 0xA277, 0xA277 }, -{ 0xA278, 0xA278, 0xA278 }, -{ 0xA279, 0xA279, 0xA279 }, -{ 0xA27A, 0xA27A, 0xA27A }, -{ 0xA27B, 0xA27B, 0xA27B }, -{ 0xA27C, 0xA27C, 0xA27C }, -{ 0xA27D, 0xA27D, 0xA27D }, -{ 0xA27E, 0xA27E, 0xA27E }, -{ 0xA27F, 0xA27F, 0xA27F }, -{ 0xA280, 0xA280, 0xA280 }, -{ 0xA281, 0xA281, 0xA281 }, -{ 0xA282, 0xA282, 0xA282 }, -{ 0xA283, 0xA283, 0xA283 }, -{ 0xA284, 0xA284, 0xA284 }, -{ 0xA285, 0xA285, 0xA285 }, -{ 0xA286, 0xA286, 0xA286 }, -{ 0xA287, 0xA287, 0xA287 }, -{ 0xA288, 0xA288, 0xA288 }, -{ 0xA289, 0xA289, 0xA289 }, -{ 0xA28A, 0xA28A, 0xA28A }, -{ 0xA28B, 0xA28B, 0xA28B }, -{ 0xA28C, 0xA28C, 0xA28C }, -{ 0xA28D, 0xA28D, 0xA28D }, -{ 0xA28E, 0xA28E, 0xA28E }, -{ 0xA28F, 0xA28F, 0xA28F }, -{ 0xA290, 0xA290, 0xA290 }, -{ 0xA291, 0xA291, 0xA291 }, -{ 0xA292, 0xA292, 0xA292 }, -{ 0xA293, 0xA293, 0xA293 }, -{ 0xA294, 0xA294, 0xA294 }, -{ 0xA295, 0xA295, 0xA295 }, -{ 0xA296, 0xA296, 0xA296 }, -{ 0xA297, 0xA297, 0xA297 }, -{ 0xA298, 0xA298, 0xA298 }, -{ 0xA299, 0xA299, 0xA299 }, -{ 0xA29A, 0xA29A, 0xA29A }, -{ 0xA29B, 0xA29B, 0xA29B }, -{ 0xA29C, 0xA29C, 0xA29C }, -{ 0xA29D, 0xA29D, 0xA29D }, -{ 0xA29E, 0xA29E, 0xA29E }, -{ 0xA29F, 0xA29F, 0xA29F }, -{ 0xA2A0, 0xA2A0, 0xA2A0 }, -{ 0xA2A1, 0xA2A1, 0xA2A1 }, -{ 0xA2A2, 0xA2A2, 0xA2A2 }, -{ 0xA2A3, 0xA2A3, 0xA2A3 }, -{ 0xA2A4, 0xA2A4, 0xA2A4 }, -{ 0xA2A5, 0xA2A5, 0xA2A5 }, -{ 0xA2A6, 0xA2A6, 0xA2A6 }, -{ 0xA2A7, 0xA2A7, 0xA2A7 }, -{ 0xA2A8, 0xA2A8, 0xA2A8 }, -{ 0xA2A9, 0xA2A9, 0xA2A9 }, -{ 0xA2AA, 0xA2AA, 0xA2AA }, -{ 0xA2AB, 0xA2AB, 0xA2AB }, -{ 0xA2AC, 0xA2AC, 0xA2AC }, -{ 0xA2AD, 0xA2AD, 0xA2AD }, -{ 0xA2AE, 0xA2AE, 0xA2AE }, -{ 0xA2AF, 0xA2AF, 0xA2AF }, -{ 0xA2B0, 0xA2B0, 0xA2B0 }, -{ 0xA2B1, 0xA2B1, 0xA2B1 }, -{ 0xA2B2, 0xA2B2, 0xA2B2 }, -{ 0xA2B3, 0xA2B3, 0xA2B3 }, -{ 0xA2B4, 0xA2B4, 0xA2B4 }, -{ 0xA2B5, 0xA2B5, 0xA2B5 }, -{ 0xA2B6, 0xA2B6, 0xA2B6 }, -{ 0xA2B7, 0xA2B7, 0xA2B7 }, -{ 0xA2B8, 0xA2B8, 0xA2B8 }, -{ 0xA2B9, 0xA2B9, 0xA2B9 }, -{ 0xA2BA, 0xA2BA, 0xA2BA }, -{ 0xA2BB, 0xA2BB, 0xA2BB }, -{ 0xA2BC, 0xA2BC, 0xA2BC }, -{ 0xA2BD, 0xA2BD, 0xA2BD }, -{ 0xA2BE, 0xA2BE, 0xA2BE }, -{ 0xA2BF, 0xA2BF, 0xA2BF }, -{ 0xA2C0, 0xA2C0, 0xA2C0 }, -{ 0xA2C1, 0xA2C1, 0xA2C1 }, -{ 0xA2C2, 0xA2C2, 0xA2C2 }, -{ 0xA2C3, 0xA2C3, 0xA2C3 }, -{ 0xA2C4, 0xA2C4, 0xA2C4 }, -{ 0xA2C5, 0xA2C5, 0xA2C5 }, -{ 0xA2C6, 0xA2C6, 0xA2C6 }, -{ 0xA2C7, 0xA2C7, 0xA2C7 }, -{ 0xA2C8, 0xA2C8, 0xA2C8 }, -{ 0xA2C9, 0xA2C9, 0xA2C9 }, -{ 0xA2CA, 0xA2CA, 0xA2CA }, -{ 0xA2CB, 0xA2CB, 0xA2CB }, -{ 0xA2CC, 0xA2CC, 0xA2CC }, -{ 0xA2CD, 0xA2CD, 0xA2CD }, -{ 0xA2CE, 0xA2CE, 0xA2CE }, -{ 0xA2CF, 0xA2CF, 0xA2CF }, -{ 0xA2D0, 0xA2D0, 0xA2D0 }, -{ 0xA2D1, 0xA2D1, 0xA2D1 }, -{ 0xA2D2, 0xA2D2, 0xA2D2 }, -{ 0xA2D3, 0xA2D3, 0xA2D3 }, -{ 0xA2D4, 0xA2D4, 0xA2D4 }, -{ 0xA2D5, 0xA2D5, 0xA2D5 }, -{ 0xA2D6, 0xA2D6, 0xA2D6 }, -{ 0xA2D7, 0xA2D7, 0xA2D7 }, -{ 0xA2D8, 0xA2D8, 0xA2D8 }, -{ 0xA2D9, 0xA2D9, 0xA2D9 }, -{ 0xA2DA, 0xA2DA, 0xA2DA }, -{ 0xA2DB, 0xA2DB, 0xA2DB }, -{ 0xA2DC, 0xA2DC, 0xA2DC }, -{ 0xA2DD, 0xA2DD, 0xA2DD }, -{ 0xA2DE, 0xA2DE, 0xA2DE }, -{ 0xA2DF, 0xA2DF, 0xA2DF }, -{ 0xA2E0, 0xA2E0, 0xA2E0 }, -{ 0xA2E1, 0xA2E1, 0xA2E1 }, -{ 0xA2E2, 0xA2E2, 0xA2E2 }, -{ 0xA2E3, 0xA2E3, 0xA2E3 }, -{ 0xA2E4, 0xA2E4, 0xA2E4 }, -{ 0xA2E5, 0xA2E5, 0xA2E5 }, -{ 0xA2E6, 0xA2E6, 0xA2E6 }, -{ 0xA2E7, 0xA2E7, 0xA2E7 }, -{ 0xA2E8, 0xA2E8, 0xA2E8 }, -{ 0xA2E9, 0xA2E9, 0xA2E9 }, -{ 0xA2EA, 0xA2EA, 0xA2EA }, -{ 0xA2EB, 0xA2EB, 0xA2EB }, -{ 0xA2EC, 0xA2EC, 0xA2EC }, -{ 0xA2ED, 0xA2ED, 0xA2ED }, -{ 0xA2EE, 0xA2EE, 0xA2EE }, -{ 0xA2EF, 0xA2EF, 0xA2EF }, -{ 0xA2F0, 0xA2F0, 0xA2F0 }, -{ 0xA2F1, 0xA2F1, 0xA2F1 }, -{ 0xA2F2, 0xA2F2, 0xA2F2 }, -{ 0xA2F3, 0xA2F3, 0xA2F3 }, -{ 0xA2F4, 0xA2F4, 0xA2F4 }, -{ 0xA2F5, 0xA2F5, 0xA2F5 }, -{ 0xA2F6, 0xA2F6, 0xA2F6 }, -{ 0xA2F7, 0xA2F7, 0xA2F7 }, -{ 0xA2F8, 0xA2F8, 0xA2F8 }, -{ 0xA2F9, 0xA2F9, 0xA2F9 }, -{ 0xA2FA, 0xA2FA, 0xA2FA }, -{ 0xA2FB, 0xA2FB, 0xA2FB }, -{ 0xA2FC, 0xA2FC, 0xA2FC }, -{ 0xA2FD, 0xA2FD, 0xA2FD }, -{ 0xA2FE, 0xA2FE, 0xA2FE }, -{ 0xA2FF, 0xA2FF, 0xA2FF }, -{ 0xA300, 0xA300, 0xA300 }, -{ 0xA301, 0xA301, 0xA301 }, -{ 0xA302, 0xA302, 0xA302 }, -{ 0xA303, 0xA303, 0xA303 }, -{ 0xA304, 0xA304, 0xA304 }, -{ 0xA305, 0xA305, 0xA305 }, -{ 0xA306, 0xA306, 0xA306 }, -{ 0xA307, 0xA307, 0xA307 }, -{ 0xA308, 0xA308, 0xA308 }, -{ 0xA309, 0xA309, 0xA309 }, -{ 0xA30A, 0xA30A, 0xA30A }, -{ 0xA30B, 0xA30B, 0xA30B }, -{ 0xA30C, 0xA30C, 0xA30C }, -{ 0xA30D, 0xA30D, 0xA30D }, -{ 0xA30E, 0xA30E, 0xA30E }, -{ 0xA30F, 0xA30F, 0xA30F }, -{ 0xA310, 0xA310, 0xA310 }, -{ 0xA311, 0xA311, 0xA311 }, -{ 0xA312, 0xA312, 0xA312 }, -{ 0xA313, 0xA313, 0xA313 }, -{ 0xA314, 0xA314, 0xA314 }, -{ 0xA315, 0xA315, 0xA315 }, -{ 0xA316, 0xA316, 0xA316 }, -{ 0xA317, 0xA317, 0xA317 }, -{ 0xA318, 0xA318, 0xA318 }, -{ 0xA319, 0xA319, 0xA319 }, -{ 0xA31A, 0xA31A, 0xA31A }, -{ 0xA31B, 0xA31B, 0xA31B }, -{ 0xA31C, 0xA31C, 0xA31C }, -{ 0xA31D, 0xA31D, 0xA31D }, -{ 0xA31E, 0xA31E, 0xA31E }, -{ 0xA31F, 0xA31F, 0xA31F }, -{ 0xA320, 0xA320, 0xA320 }, -{ 0xA321, 0xA321, 0xA321 }, -{ 0xA322, 0xA322, 0xA322 }, -{ 0xA323, 0xA323, 0xA323 }, -{ 0xA324, 0xA324, 0xA324 }, -{ 0xA325, 0xA325, 0xA325 }, -{ 0xA326, 0xA326, 0xA326 }, -{ 0xA327, 0xA327, 0xA327 }, -{ 0xA328, 0xA328, 0xA328 }, -{ 0xA329, 0xA329, 0xA329 }, -{ 0xA32A, 0xA32A, 0xA32A }, -{ 0xA32B, 0xA32B, 0xA32B }, -{ 0xA32C, 0xA32C, 0xA32C }, -{ 0xA32D, 0xA32D, 0xA32D }, -{ 0xA32E, 0xA32E, 0xA32E }, -{ 0xA32F, 0xA32F, 0xA32F }, -{ 0xA330, 0xA330, 0xA330 }, -{ 0xA331, 0xA331, 0xA331 }, -{ 0xA332, 0xA332, 0xA332 }, -{ 0xA333, 0xA333, 0xA333 }, -{ 0xA334, 0xA334, 0xA334 }, -{ 0xA335, 0xA335, 0xA335 }, -{ 0xA336, 0xA336, 0xA336 }, -{ 0xA337, 0xA337, 0xA337 }, -{ 0xA338, 0xA338, 0xA338 }, -{ 0xA339, 0xA339, 0xA339 }, -{ 0xA33A, 0xA33A, 0xA33A }, -{ 0xA33B, 0xA33B, 0xA33B }, -{ 0xA33C, 0xA33C, 0xA33C }, -{ 0xA33D, 0xA33D, 0xA33D }, -{ 0xA33E, 0xA33E, 0xA33E }, -{ 0xA33F, 0xA33F, 0xA33F }, -{ 0xA340, 0xA340, 0xA340 }, -{ 0xA341, 0xA341, 0xA341 }, -{ 0xA342, 0xA342, 0xA342 }, -{ 0xA343, 0xA343, 0xA343 }, -{ 0xA344, 0xA344, 0xA344 }, -{ 0xA345, 0xA345, 0xA345 }, -{ 0xA346, 0xA346, 0xA346 }, -{ 0xA347, 0xA347, 0xA347 }, -{ 0xA348, 0xA348, 0xA348 }, -{ 0xA349, 0xA349, 0xA349 }, -{ 0xA34A, 0xA34A, 0xA34A }, -{ 0xA34B, 0xA34B, 0xA34B }, -{ 0xA34C, 0xA34C, 0xA34C }, -{ 0xA34D, 0xA34D, 0xA34D }, -{ 0xA34E, 0xA34E, 0xA34E }, -{ 0xA34F, 0xA34F, 0xA34F }, -{ 0xA350, 0xA350, 0xA350 }, -{ 0xA351, 0xA351, 0xA351 }, -{ 0xA352, 0xA352, 0xA352 }, -{ 0xA353, 0xA353, 0xA353 }, -{ 0xA354, 0xA354, 0xA354 }, -{ 0xA355, 0xA355, 0xA355 }, -{ 0xA356, 0xA356, 0xA356 }, -{ 0xA357, 0xA357, 0xA357 }, -{ 0xA358, 0xA358, 0xA358 }, -{ 0xA359, 0xA359, 0xA359 }, -{ 0xA35A, 0xA35A, 0xA35A }, -{ 0xA35B, 0xA35B, 0xA35B }, -{ 0xA35C, 0xA35C, 0xA35C }, -{ 0xA35D, 0xA35D, 0xA35D }, -{ 0xA35E, 0xA35E, 0xA35E }, -{ 0xA35F, 0xA35F, 0xA35F }, -{ 0xA360, 0xA360, 0xA360 }, -{ 0xA361, 0xA361, 0xA361 }, -{ 0xA362, 0xA362, 0xA362 }, -{ 0xA363, 0xA363, 0xA363 }, -{ 0xA364, 0xA364, 0xA364 }, -{ 0xA365, 0xA365, 0xA365 }, -{ 0xA366, 0xA366, 0xA366 }, -{ 0xA367, 0xA367, 0xA367 }, -{ 0xA368, 0xA368, 0xA368 }, -{ 0xA369, 0xA369, 0xA369 }, -{ 0xA36A, 0xA36A, 0xA36A }, -{ 0xA36B, 0xA36B, 0xA36B }, -{ 0xA36C, 0xA36C, 0xA36C }, -{ 0xA36D, 0xA36D, 0xA36D }, -{ 0xA36E, 0xA36E, 0xA36E }, -{ 0xA36F, 0xA36F, 0xA36F }, -{ 0xA370, 0xA370, 0xA370 }, -{ 0xA371, 0xA371, 0xA371 }, -{ 0xA372, 0xA372, 0xA372 }, -{ 0xA373, 0xA373, 0xA373 }, -{ 0xA374, 0xA374, 0xA374 }, -{ 0xA375, 0xA375, 0xA375 }, -{ 0xA376, 0xA376, 0xA376 }, -{ 0xA377, 0xA377, 0xA377 }, -{ 0xA378, 0xA378, 0xA378 }, -{ 0xA379, 0xA379, 0xA379 }, -{ 0xA37A, 0xA37A, 0xA37A }, -{ 0xA37B, 0xA37B, 0xA37B }, -{ 0xA37C, 0xA37C, 0xA37C }, -{ 0xA37D, 0xA37D, 0xA37D }, -{ 0xA37E, 0xA37E, 0xA37E }, -{ 0xA37F, 0xA37F, 0xA37F }, -{ 0xA380, 0xA380, 0xA380 }, -{ 0xA381, 0xA381, 0xA381 }, -{ 0xA382, 0xA382, 0xA382 }, -{ 0xA383, 0xA383, 0xA383 }, -{ 0xA384, 0xA384, 0xA384 }, -{ 0xA385, 0xA385, 0xA385 }, -{ 0xA386, 0xA386, 0xA386 }, -{ 0xA387, 0xA387, 0xA387 }, -{ 0xA388, 0xA388, 0xA388 }, -{ 0xA389, 0xA389, 0xA389 }, -{ 0xA38A, 0xA38A, 0xA38A }, -{ 0xA38B, 0xA38B, 0xA38B }, -{ 0xA38C, 0xA38C, 0xA38C }, -{ 0xA38D, 0xA38D, 0xA38D }, -{ 0xA38E, 0xA38E, 0xA38E }, -{ 0xA38F, 0xA38F, 0xA38F }, -{ 0xA390, 0xA390, 0xA390 }, -{ 0xA391, 0xA391, 0xA391 }, -{ 0xA392, 0xA392, 0xA392 }, -{ 0xA393, 0xA393, 0xA393 }, -{ 0xA394, 0xA394, 0xA394 }, -{ 0xA395, 0xA395, 0xA395 }, -{ 0xA396, 0xA396, 0xA396 }, -{ 0xA397, 0xA397, 0xA397 }, -{ 0xA398, 0xA398, 0xA398 }, -{ 0xA399, 0xA399, 0xA399 }, -{ 0xA39A, 0xA39A, 0xA39A }, -{ 0xA39B, 0xA39B, 0xA39B }, -{ 0xA39C, 0xA39C, 0xA39C }, -{ 0xA39D, 0xA39D, 0xA39D }, -{ 0xA39E, 0xA39E, 0xA39E }, -{ 0xA39F, 0xA39F, 0xA39F }, -{ 0xA3A0, 0xA3A0, 0xA3A0 }, -{ 0xA3A1, 0xA3A1, 0xA3A1 }, -{ 0xA3A2, 0xA3A2, 0xA3A2 }, -{ 0xA3A3, 0xA3A3, 0xA3A3 }, -{ 0xA3A4, 0xA3A4, 0xA3A4 }, -{ 0xA3A5, 0xA3A5, 0xA3A5 }, -{ 0xA3A6, 0xA3A6, 0xA3A6 }, -{ 0xA3A7, 0xA3A7, 0xA3A7 }, -{ 0xA3A8, 0xA3A8, 0xA3A8 }, -{ 0xA3A9, 0xA3A9, 0xA3A9 }, -{ 0xA3AA, 0xA3AA, 0xA3AA }, -{ 0xA3AB, 0xA3AB, 0xA3AB }, -{ 0xA3AC, 0xA3AC, 0xA3AC }, -{ 0xA3AD, 0xA3AD, 0xA3AD }, -{ 0xA3AE, 0xA3AE, 0xA3AE }, -{ 0xA3AF, 0xA3AF, 0xA3AF }, -{ 0xA3B0, 0xA3B0, 0xA3B0 }, -{ 0xA3B1, 0xA3B1, 0xA3B1 }, -{ 0xA3B2, 0xA3B2, 0xA3B2 }, -{ 0xA3B3, 0xA3B3, 0xA3B3 }, -{ 0xA3B4, 0xA3B4, 0xA3B4 }, -{ 0xA3B5, 0xA3B5, 0xA3B5 }, -{ 0xA3B6, 0xA3B6, 0xA3B6 }, -{ 0xA3B7, 0xA3B7, 0xA3B7 }, -{ 0xA3B8, 0xA3B8, 0xA3B8 }, -{ 0xA3B9, 0xA3B9, 0xA3B9 }, -{ 0xA3BA, 0xA3BA, 0xA3BA }, -{ 0xA3BB, 0xA3BB, 0xA3BB }, -{ 0xA3BC, 0xA3BC, 0xA3BC }, -{ 0xA3BD, 0xA3BD, 0xA3BD }, -{ 0xA3BE, 0xA3BE, 0xA3BE }, -{ 0xA3BF, 0xA3BF, 0xA3BF }, -{ 0xA3C0, 0xA3C0, 0xA3C0 }, -{ 0xA3C1, 0xA3C1, 0xA3C1 }, -{ 0xA3C2, 0xA3C2, 0xA3C2 }, -{ 0xA3C3, 0xA3C3, 0xA3C3 }, -{ 0xA3C4, 0xA3C4, 0xA3C4 }, -{ 0xA3C5, 0xA3C5, 0xA3C5 }, -{ 0xA3C6, 0xA3C6, 0xA3C6 }, -{ 0xA3C7, 0xA3C7, 0xA3C7 }, -{ 0xA3C8, 0xA3C8, 0xA3C8 }, -{ 0xA3C9, 0xA3C9, 0xA3C9 }, -{ 0xA3CA, 0xA3CA, 0xA3CA }, -{ 0xA3CB, 0xA3CB, 0xA3CB }, -{ 0xA3CC, 0xA3CC, 0xA3CC }, -{ 0xA3CD, 0xA3CD, 0xA3CD }, -{ 0xA3CE, 0xA3CE, 0xA3CE }, -{ 0xA3CF, 0xA3CF, 0xA3CF }, -{ 0xA3D0, 0xA3D0, 0xA3D0 }, -{ 0xA3D1, 0xA3D1, 0xA3D1 }, -{ 0xA3D2, 0xA3D2, 0xA3D2 }, -{ 0xA3D3, 0xA3D3, 0xA3D3 }, -{ 0xA3D4, 0xA3D4, 0xA3D4 }, -{ 0xA3D5, 0xA3D5, 0xA3D5 }, -{ 0xA3D6, 0xA3D6, 0xA3D6 }, -{ 0xA3D7, 0xA3D7, 0xA3D7 }, -{ 0xA3D8, 0xA3D8, 0xA3D8 }, -{ 0xA3D9, 0xA3D9, 0xA3D9 }, -{ 0xA3DA, 0xA3DA, 0xA3DA }, -{ 0xA3DB, 0xA3DB, 0xA3DB }, -{ 0xA3DC, 0xA3DC, 0xA3DC }, -{ 0xA3DD, 0xA3DD, 0xA3DD }, -{ 0xA3DE, 0xA3DE, 0xA3DE }, -{ 0xA3DF, 0xA3DF, 0xA3DF }, -{ 0xA3E0, 0xA3E0, 0xA3E0 }, -{ 0xA3E1, 0xA3E1, 0xA3E1 }, -{ 0xA3E2, 0xA3E2, 0xA3E2 }, -{ 0xA3E3, 0xA3E3, 0xA3E3 }, -{ 0xA3E4, 0xA3E4, 0xA3E4 }, -{ 0xA3E5, 0xA3E5, 0xA3E5 }, -{ 0xA3E6, 0xA3E6, 0xA3E6 }, -{ 0xA3E7, 0xA3E7, 0xA3E7 }, -{ 0xA3E8, 0xA3E8, 0xA3E8 }, -{ 0xA3E9, 0xA3E9, 0xA3E9 }, -{ 0xA3EA, 0xA3EA, 0xA3EA }, -{ 0xA3EB, 0xA3EB, 0xA3EB }, -{ 0xA3EC, 0xA3EC, 0xA3EC }, -{ 0xA3ED, 0xA3ED, 0xA3ED }, -{ 0xA3EE, 0xA3EE, 0xA3EE }, -{ 0xA3EF, 0xA3EF, 0xA3EF }, -{ 0xA3F0, 0xA3F0, 0xA3F0 }, -{ 0xA3F1, 0xA3F1, 0xA3F1 }, -{ 0xA3F2, 0xA3F2, 0xA3F2 }, -{ 0xA3F3, 0xA3F3, 0xA3F3 }, -{ 0xA3F4, 0xA3F4, 0xA3F4 }, -{ 0xA3F5, 0xA3F5, 0xA3F5 }, -{ 0xA3F6, 0xA3F6, 0xA3F6 }, -{ 0xA3F7, 0xA3F7, 0xA3F7 }, -{ 0xA3F8, 0xA3F8, 0xA3F8 }, -{ 0xA3F9, 0xA3F9, 0xA3F9 }, -{ 0xA3FA, 0xA3FA, 0xA3FA }, -{ 0xA3FB, 0xA3FB, 0xA3FB }, -{ 0xA3FC, 0xA3FC, 0xA3FC }, -{ 0xA3FD, 0xA3FD, 0xA3FD }, -{ 0xA3FE, 0xA3FE, 0xA3FE }, -{ 0xA3FF, 0xA3FF, 0xA3FF }, -{ 0xA400, 0xA400, 0xA400 }, -{ 0xA401, 0xA401, 0xA401 }, -{ 0xA402, 0xA402, 0xA402 }, -{ 0xA403, 0xA403, 0xA403 }, -{ 0xA404, 0xA404, 0xA404 }, -{ 0xA405, 0xA405, 0xA405 }, -{ 0xA406, 0xA406, 0xA406 }, -{ 0xA407, 0xA407, 0xA407 }, -{ 0xA408, 0xA408, 0xA408 }, -{ 0xA409, 0xA409, 0xA409 }, -{ 0xA40A, 0xA40A, 0xA40A }, -{ 0xA40B, 0xA40B, 0xA40B }, -{ 0xA40C, 0xA40C, 0xA40C }, -{ 0xA40D, 0xA40D, 0xA40D }, -{ 0xA40E, 0xA40E, 0xA40E }, -{ 0xA40F, 0xA40F, 0xA40F }, -{ 0xA410, 0xA410, 0xA410 }, -{ 0xA411, 0xA411, 0xA411 }, -{ 0xA412, 0xA412, 0xA412 }, -{ 0xA413, 0xA413, 0xA413 }, -{ 0xA414, 0xA414, 0xA414 }, -{ 0xA415, 0xA415, 0xA415 }, -{ 0xA416, 0xA416, 0xA416 }, -{ 0xA417, 0xA417, 0xA417 }, -{ 0xA418, 0xA418, 0xA418 }, -{ 0xA419, 0xA419, 0xA419 }, -{ 0xA41A, 0xA41A, 0xA41A }, -{ 0xA41B, 0xA41B, 0xA41B }, -{ 0xA41C, 0xA41C, 0xA41C }, -{ 0xA41D, 0xA41D, 0xA41D }, -{ 0xA41E, 0xA41E, 0xA41E }, -{ 0xA41F, 0xA41F, 0xA41F }, -{ 0xA420, 0xA420, 0xA420 }, -{ 0xA421, 0xA421, 0xA421 }, -{ 0xA422, 0xA422, 0xA422 }, -{ 0xA423, 0xA423, 0xA423 }, -{ 0xA424, 0xA424, 0xA424 }, -{ 0xA425, 0xA425, 0xA425 }, -{ 0xA426, 0xA426, 0xA426 }, -{ 0xA427, 0xA427, 0xA427 }, -{ 0xA428, 0xA428, 0xA428 }, -{ 0xA429, 0xA429, 0xA429 }, -{ 0xA42A, 0xA42A, 0xA42A }, -{ 0xA42B, 0xA42B, 0xA42B }, -{ 0xA42C, 0xA42C, 0xA42C }, -{ 0xA42D, 0xA42D, 0xA42D }, -{ 0xA42E, 0xA42E, 0xA42E }, -{ 0xA42F, 0xA42F, 0xA42F }, -{ 0xA430, 0xA430, 0xA430 }, -{ 0xA431, 0xA431, 0xA431 }, -{ 0xA432, 0xA432, 0xA432 }, -{ 0xA433, 0xA433, 0xA433 }, -{ 0xA434, 0xA434, 0xA434 }, -{ 0xA435, 0xA435, 0xA435 }, -{ 0xA436, 0xA436, 0xA436 }, -{ 0xA437, 0xA437, 0xA437 }, -{ 0xA438, 0xA438, 0xA438 }, -{ 0xA439, 0xA439, 0xA439 }, -{ 0xA43A, 0xA43A, 0xA43A }, -{ 0xA43B, 0xA43B, 0xA43B }, -{ 0xA43C, 0xA43C, 0xA43C }, -{ 0xA43D, 0xA43D, 0xA43D }, -{ 0xA43E, 0xA43E, 0xA43E }, -{ 0xA43F, 0xA43F, 0xA43F }, -{ 0xA440, 0xA440, 0xA440 }, -{ 0xA441, 0xA441, 0xA441 }, -{ 0xA442, 0xA442, 0xA442 }, -{ 0xA443, 0xA443, 0xA443 }, -{ 0xA444, 0xA444, 0xA444 }, -{ 0xA445, 0xA445, 0xA445 }, -{ 0xA446, 0xA446, 0xA446 }, -{ 0xA447, 0xA447, 0xA447 }, -{ 0xA448, 0xA448, 0xA448 }, -{ 0xA449, 0xA449, 0xA449 }, -{ 0xA44A, 0xA44A, 0xA44A }, -{ 0xA44B, 0xA44B, 0xA44B }, -{ 0xA44C, 0xA44C, 0xA44C }, -{ 0xA44D, 0xA44D, 0xA44D }, -{ 0xA44E, 0xA44E, 0xA44E }, -{ 0xA44F, 0xA44F, 0xA44F }, -{ 0xA450, 0xA450, 0xA450 }, -{ 0xA451, 0xA451, 0xA451 }, -{ 0xA452, 0xA452, 0xA452 }, -{ 0xA453, 0xA453, 0xA453 }, -{ 0xA454, 0xA454, 0xA454 }, -{ 0xA455, 0xA455, 0xA455 }, -{ 0xA456, 0xA456, 0xA456 }, -{ 0xA457, 0xA457, 0xA457 }, -{ 0xA458, 0xA458, 0xA458 }, -{ 0xA459, 0xA459, 0xA459 }, -{ 0xA45A, 0xA45A, 0xA45A }, -{ 0xA45B, 0xA45B, 0xA45B }, -{ 0xA45C, 0xA45C, 0xA45C }, -{ 0xA45D, 0xA45D, 0xA45D }, -{ 0xA45E, 0xA45E, 0xA45E }, -{ 0xA45F, 0xA45F, 0xA45F }, -{ 0xA460, 0xA460, 0xA460 }, -{ 0xA461, 0xA461, 0xA461 }, -{ 0xA462, 0xA462, 0xA462 }, -{ 0xA463, 0xA463, 0xA463 }, -{ 0xA464, 0xA464, 0xA464 }, -{ 0xA465, 0xA465, 0xA465 }, -{ 0xA466, 0xA466, 0xA466 }, -{ 0xA467, 0xA467, 0xA467 }, -{ 0xA468, 0xA468, 0xA468 }, -{ 0xA469, 0xA469, 0xA469 }, -{ 0xA46A, 0xA46A, 0xA46A }, -{ 0xA46B, 0xA46B, 0xA46B }, -{ 0xA46C, 0xA46C, 0xA46C }, -{ 0xA46D, 0xA46D, 0xA46D }, -{ 0xA46E, 0xA46E, 0xA46E }, -{ 0xA46F, 0xA46F, 0xA46F }, -{ 0xA470, 0xA470, 0xA470 }, -{ 0xA471, 0xA471, 0xA471 }, -{ 0xA472, 0xA472, 0xA472 }, -{ 0xA473, 0xA473, 0xA473 }, -{ 0xA474, 0xA474, 0xA474 }, -{ 0xA475, 0xA475, 0xA475 }, -{ 0xA476, 0xA476, 0xA476 }, -{ 0xA477, 0xA477, 0xA477 }, -{ 0xA478, 0xA478, 0xA478 }, -{ 0xA479, 0xA479, 0xA479 }, -{ 0xA47A, 0xA47A, 0xA47A }, -{ 0xA47B, 0xA47B, 0xA47B }, -{ 0xA47C, 0xA47C, 0xA47C }, -{ 0xA47D, 0xA47D, 0xA47D }, -{ 0xA47E, 0xA47E, 0xA47E }, -{ 0xA47F, 0xA47F, 0xA47F }, -{ 0xA480, 0xA480, 0xA480 }, -{ 0xA481, 0xA481, 0xA481 }, -{ 0xA482, 0xA482, 0xA482 }, -{ 0xA483, 0xA483, 0xA483 }, -{ 0xA484, 0xA484, 0xA484 }, -{ 0xA485, 0xA485, 0xA485 }, -{ 0xA486, 0xA486, 0xA486 }, -{ 0xA487, 0xA487, 0xA487 }, -{ 0xA488, 0xA488, 0xA488 }, -{ 0xA489, 0xA489, 0xA489 }, -{ 0xA48A, 0xA48A, 0xA48A }, -{ 0xA48B, 0xA48B, 0xA48B }, -{ 0xA48C, 0xA48C, 0xA48C }, -{ 0xA800, 0xA800, 0xA800 }, -{ 0xA801, 0xA801, 0xA801 }, -{ 0xA803, 0xA803, 0xA803 }, -{ 0xA804, 0xA804, 0xA804 }, -{ 0xA805, 0xA805, 0xA805 }, -{ 0xA806, 0xA806, 0xA806 }, -{ 0xA807, 0xA807, 0xA807 }, -{ 0xA808, 0xA808, 0xA808 }, -{ 0xA809, 0xA809, 0xA809 }, -{ 0xA80A, 0xA80A, 0xA80A }, -{ 0xA80B, 0xA80B, 0xA80B }, -{ 0xA80C, 0xA80C, 0xA80C }, -{ 0xA80D, 0xA80D, 0xA80D }, -{ 0xA80E, 0xA80E, 0xA80E }, -{ 0xA80F, 0xA80F, 0xA80F }, -{ 0xA810, 0xA810, 0xA810 }, -{ 0xA811, 0xA811, 0xA811 }, -{ 0xA812, 0xA812, 0xA812 }, -{ 0xA813, 0xA813, 0xA813 }, -{ 0xA814, 0xA814, 0xA814 }, -{ 0xA815, 0xA815, 0xA815 }, -{ 0xA816, 0xA816, 0xA816 }, -{ 0xA817, 0xA817, 0xA817 }, -{ 0xA818, 0xA818, 0xA818 }, -{ 0xA819, 0xA819, 0xA819 }, -{ 0xA81A, 0xA81A, 0xA81A }, -{ 0xA81B, 0xA81B, 0xA81B }, -{ 0xA81C, 0xA81C, 0xA81C }, -{ 0xA81D, 0xA81D, 0xA81D }, -{ 0xA81E, 0xA81E, 0xA81E }, -{ 0xA81F, 0xA81F, 0xA81F }, -{ 0xA820, 0xA820, 0xA820 }, -{ 0xA821, 0xA821, 0xA821 }, -{ 0xA822, 0xA822, 0xA822 }, -{ 0xA825, 0xA825, 0xA825 }, -{ 0xA826, 0xA826, 0xA826 }, -{ 0xAC00, 0xAC00, 0xAC00 }, -{ 0xAC01, 0xAC01, 0xAC01 }, -{ 0xAC02, 0xAC02, 0xAC02 }, -{ 0xAC03, 0xAC03, 0xAC03 }, -{ 0xAC04, 0xAC04, 0xAC04 }, -{ 0xAC05, 0xAC05, 0xAC05 }, -{ 0xAC06, 0xAC06, 0xAC06 }, -{ 0xAC07, 0xAC07, 0xAC07 }, -{ 0xAC08, 0xAC08, 0xAC08 }, -{ 0xAC09, 0xAC09, 0xAC09 }, -{ 0xAC0A, 0xAC0A, 0xAC0A }, -{ 0xAC0B, 0xAC0B, 0xAC0B }, -{ 0xAC0C, 0xAC0C, 0xAC0C }, -{ 0xAC0D, 0xAC0D, 0xAC0D }, -{ 0xAC0E, 0xAC0E, 0xAC0E }, -{ 0xAC0F, 0xAC0F, 0xAC0F }, -{ 0xAC10, 0xAC10, 0xAC10 }, -{ 0xAC11, 0xAC11, 0xAC11 }, -{ 0xAC12, 0xAC12, 0xAC12 }, -{ 0xAC13, 0xAC13, 0xAC13 }, -{ 0xAC14, 0xAC14, 0xAC14 }, -{ 0xAC15, 0xAC15, 0xAC15 }, -{ 0xAC16, 0xAC16, 0xAC16 }, -{ 0xAC17, 0xAC17, 0xAC17 }, -{ 0xAC18, 0xAC18, 0xAC18 }, -{ 0xAC19, 0xAC19, 0xAC19 }, -{ 0xAC1A, 0xAC1A, 0xAC1A }, -{ 0xAC1B, 0xAC1B, 0xAC1B }, -{ 0xAC1C, 0xAC1C, 0xAC1C }, -{ 0xAC1D, 0xAC1D, 0xAC1D }, -{ 0xAC1E, 0xAC1E, 0xAC1E }, -{ 0xAC1F, 0xAC1F, 0xAC1F }, -{ 0xAC20, 0xAC20, 0xAC20 }, -{ 0xAC21, 0xAC21, 0xAC21 }, -{ 0xAC22, 0xAC22, 0xAC22 }, -{ 0xAC23, 0xAC23, 0xAC23 }, -{ 0xAC24, 0xAC24, 0xAC24 }, -{ 0xAC25, 0xAC25, 0xAC25 }, -{ 0xAC26, 0xAC26, 0xAC26 }, -{ 0xAC27, 0xAC27, 0xAC27 }, -{ 0xAC28, 0xAC28, 0xAC28 }, -{ 0xAC29, 0xAC29, 0xAC29 }, -{ 0xAC2A, 0xAC2A, 0xAC2A }, -{ 0xAC2B, 0xAC2B, 0xAC2B }, -{ 0xAC2C, 0xAC2C, 0xAC2C }, -{ 0xAC2D, 0xAC2D, 0xAC2D }, -{ 0xAC2E, 0xAC2E, 0xAC2E }, -{ 0xAC2F, 0xAC2F, 0xAC2F }, -{ 0xAC30, 0xAC30, 0xAC30 }, -{ 0xAC31, 0xAC31, 0xAC31 }, -{ 0xAC32, 0xAC32, 0xAC32 }, -{ 0xAC33, 0xAC33, 0xAC33 }, -{ 0xAC34, 0xAC34, 0xAC34 }, -{ 0xAC35, 0xAC35, 0xAC35 }, -{ 0xAC36, 0xAC36, 0xAC36 }, -{ 0xAC37, 0xAC37, 0xAC37 }, -{ 0xAC38, 0xAC38, 0xAC38 }, -{ 0xAC39, 0xAC39, 0xAC39 }, -{ 0xAC3A, 0xAC3A, 0xAC3A }, -{ 0xAC3B, 0xAC3B, 0xAC3B }, -{ 0xAC3C, 0xAC3C, 0xAC3C }, -{ 0xAC3D, 0xAC3D, 0xAC3D }, -{ 0xAC3E, 0xAC3E, 0xAC3E }, -{ 0xAC3F, 0xAC3F, 0xAC3F }, -{ 0xAC40, 0xAC40, 0xAC40 }, -{ 0xAC41, 0xAC41, 0xAC41 }, -{ 0xAC42, 0xAC42, 0xAC42 }, -{ 0xAC43, 0xAC43, 0xAC43 }, -{ 0xAC44, 0xAC44, 0xAC44 }, -{ 0xAC45, 0xAC45, 0xAC45 }, -{ 0xAC46, 0xAC46, 0xAC46 }, -{ 0xAC47, 0xAC47, 0xAC47 }, -{ 0xAC48, 0xAC48, 0xAC48 }, -{ 0xAC49, 0xAC49, 0xAC49 }, -{ 0xAC4A, 0xAC4A, 0xAC4A }, -{ 0xAC4B, 0xAC4B, 0xAC4B }, -{ 0xAC4C, 0xAC4C, 0xAC4C }, -{ 0xAC4D, 0xAC4D, 0xAC4D }, -{ 0xAC4E, 0xAC4E, 0xAC4E }, -{ 0xAC4F, 0xAC4F, 0xAC4F }, -{ 0xAC50, 0xAC50, 0xAC50 }, -{ 0xAC51, 0xAC51, 0xAC51 }, -{ 0xAC52, 0xAC52, 0xAC52 }, -{ 0xAC53, 0xAC53, 0xAC53 }, -{ 0xAC54, 0xAC54, 0xAC54 }, -{ 0xAC55, 0xAC55, 0xAC55 }, -{ 0xAC56, 0xAC56, 0xAC56 }, -{ 0xAC57, 0xAC57, 0xAC57 }, -{ 0xAC58, 0xAC58, 0xAC58 }, -{ 0xAC59, 0xAC59, 0xAC59 }, -{ 0xAC5A, 0xAC5A, 0xAC5A }, -{ 0xAC5B, 0xAC5B, 0xAC5B }, -{ 0xAC5C, 0xAC5C, 0xAC5C }, -{ 0xAC5D, 0xAC5D, 0xAC5D }, -{ 0xAC5E, 0xAC5E, 0xAC5E }, -{ 0xAC5F, 0xAC5F, 0xAC5F }, -{ 0xAC60, 0xAC60, 0xAC60 }, -{ 0xAC61, 0xAC61, 0xAC61 }, -{ 0xAC62, 0xAC62, 0xAC62 }, -{ 0xAC63, 0xAC63, 0xAC63 }, -{ 0xAC64, 0xAC64, 0xAC64 }, -{ 0xAC65, 0xAC65, 0xAC65 }, -{ 0xAC66, 0xAC66, 0xAC66 }, -{ 0xAC67, 0xAC67, 0xAC67 }, -{ 0xAC68, 0xAC68, 0xAC68 }, -{ 0xAC69, 0xAC69, 0xAC69 }, -{ 0xAC6A, 0xAC6A, 0xAC6A }, -{ 0xAC6B, 0xAC6B, 0xAC6B }, -{ 0xAC6C, 0xAC6C, 0xAC6C }, -{ 0xAC6D, 0xAC6D, 0xAC6D }, -{ 0xAC6E, 0xAC6E, 0xAC6E }, -{ 0xAC6F, 0xAC6F, 0xAC6F }, -{ 0xAC70, 0xAC70, 0xAC70 }, -{ 0xAC71, 0xAC71, 0xAC71 }, -{ 0xAC72, 0xAC72, 0xAC72 }, -{ 0xAC73, 0xAC73, 0xAC73 }, -{ 0xAC74, 0xAC74, 0xAC74 }, -{ 0xAC75, 0xAC75, 0xAC75 }, -{ 0xAC76, 0xAC76, 0xAC76 }, -{ 0xAC77, 0xAC77, 0xAC77 }, -{ 0xAC78, 0xAC78, 0xAC78 }, -{ 0xAC79, 0xAC79, 0xAC79 }, -{ 0xAC7A, 0xAC7A, 0xAC7A }, -{ 0xAC7B, 0xAC7B, 0xAC7B }, -{ 0xAC7C, 0xAC7C, 0xAC7C }, -{ 0xAC7D, 0xAC7D, 0xAC7D }, -{ 0xAC7E, 0xAC7E, 0xAC7E }, -{ 0xAC7F, 0xAC7F, 0xAC7F }, -{ 0xAC80, 0xAC80, 0xAC80 }, -{ 0xAC81, 0xAC81, 0xAC81 }, -{ 0xAC82, 0xAC82, 0xAC82 }, -{ 0xAC83, 0xAC83, 0xAC83 }, -{ 0xAC84, 0xAC84, 0xAC84 }, -{ 0xAC85, 0xAC85, 0xAC85 }, -{ 0xAC86, 0xAC86, 0xAC86 }, -{ 0xAC87, 0xAC87, 0xAC87 }, -{ 0xAC88, 0xAC88, 0xAC88 }, -{ 0xAC89, 0xAC89, 0xAC89 }, -{ 0xAC8A, 0xAC8A, 0xAC8A }, -{ 0xAC8B, 0xAC8B, 0xAC8B }, -{ 0xAC8C, 0xAC8C, 0xAC8C }, -{ 0xAC8D, 0xAC8D, 0xAC8D }, -{ 0xAC8E, 0xAC8E, 0xAC8E }, -{ 0xAC8F, 0xAC8F, 0xAC8F }, -{ 0xAC90, 0xAC90, 0xAC90 }, -{ 0xAC91, 0xAC91, 0xAC91 }, -{ 0xAC92, 0xAC92, 0xAC92 }, -{ 0xAC93, 0xAC93, 0xAC93 }, -{ 0xAC94, 0xAC94, 0xAC94 }, -{ 0xAC95, 0xAC95, 0xAC95 }, -{ 0xAC96, 0xAC96, 0xAC96 }, -{ 0xAC97, 0xAC97, 0xAC97 }, -{ 0xAC98, 0xAC98, 0xAC98 }, -{ 0xAC99, 0xAC99, 0xAC99 }, -{ 0xAC9A, 0xAC9A, 0xAC9A }, -{ 0xAC9B, 0xAC9B, 0xAC9B }, -{ 0xAC9C, 0xAC9C, 0xAC9C }, -{ 0xAC9D, 0xAC9D, 0xAC9D }, -{ 0xAC9E, 0xAC9E, 0xAC9E }, -{ 0xAC9F, 0xAC9F, 0xAC9F }, -{ 0xACA0, 0xACA0, 0xACA0 }, -{ 0xACA1, 0xACA1, 0xACA1 }, -{ 0xACA2, 0xACA2, 0xACA2 }, -{ 0xACA3, 0xACA3, 0xACA3 }, -{ 0xACA4, 0xACA4, 0xACA4 }, -{ 0xACA5, 0xACA5, 0xACA5 }, -{ 0xACA6, 0xACA6, 0xACA6 }, -{ 0xACA7, 0xACA7, 0xACA7 }, -{ 0xACA8, 0xACA8, 0xACA8 }, -{ 0xACA9, 0xACA9, 0xACA9 }, -{ 0xACAA, 0xACAA, 0xACAA }, -{ 0xACAB, 0xACAB, 0xACAB }, -{ 0xACAC, 0xACAC, 0xACAC }, -{ 0xACAD, 0xACAD, 0xACAD }, -{ 0xACAE, 0xACAE, 0xACAE }, -{ 0xACAF, 0xACAF, 0xACAF }, -{ 0xACB0, 0xACB0, 0xACB0 }, -{ 0xACB1, 0xACB1, 0xACB1 }, -{ 0xACB2, 0xACB2, 0xACB2 }, -{ 0xACB3, 0xACB3, 0xACB3 }, -{ 0xACB4, 0xACB4, 0xACB4 }, -{ 0xACB5, 0xACB5, 0xACB5 }, -{ 0xACB6, 0xACB6, 0xACB6 }, -{ 0xACB7, 0xACB7, 0xACB7 }, -{ 0xACB8, 0xACB8, 0xACB8 }, -{ 0xACB9, 0xACB9, 0xACB9 }, -{ 0xACBA, 0xACBA, 0xACBA }, -{ 0xACBB, 0xACBB, 0xACBB }, -{ 0xACBC, 0xACBC, 0xACBC }, -{ 0xACBD, 0xACBD, 0xACBD }, -{ 0xACBE, 0xACBE, 0xACBE }, -{ 0xACBF, 0xACBF, 0xACBF }, -{ 0xACC0, 0xACC0, 0xACC0 }, -{ 0xACC1, 0xACC1, 0xACC1 }, -{ 0xACC2, 0xACC2, 0xACC2 }, -{ 0xACC3, 0xACC3, 0xACC3 }, -{ 0xACC4, 0xACC4, 0xACC4 }, -{ 0xACC5, 0xACC5, 0xACC5 }, -{ 0xACC6, 0xACC6, 0xACC6 }, -{ 0xACC7, 0xACC7, 0xACC7 }, -{ 0xACC8, 0xACC8, 0xACC8 }, -{ 0xACC9, 0xACC9, 0xACC9 }, -{ 0xACCA, 0xACCA, 0xACCA }, -{ 0xACCB, 0xACCB, 0xACCB }, -{ 0xACCC, 0xACCC, 0xACCC }, -{ 0xACCD, 0xACCD, 0xACCD }, -{ 0xACCE, 0xACCE, 0xACCE }, -{ 0xACCF, 0xACCF, 0xACCF }, -{ 0xACD0, 0xACD0, 0xACD0 }, -{ 0xACD1, 0xACD1, 0xACD1 }, -{ 0xACD2, 0xACD2, 0xACD2 }, -{ 0xACD3, 0xACD3, 0xACD3 }, -{ 0xACD4, 0xACD4, 0xACD4 }, -{ 0xACD5, 0xACD5, 0xACD5 }, -{ 0xACD6, 0xACD6, 0xACD6 }, -{ 0xACD7, 0xACD7, 0xACD7 }, -{ 0xACD8, 0xACD8, 0xACD8 }, -{ 0xACD9, 0xACD9, 0xACD9 }, -{ 0xACDA, 0xACDA, 0xACDA }, -{ 0xACDB, 0xACDB, 0xACDB }, -{ 0xACDC, 0xACDC, 0xACDC }, -{ 0xACDD, 0xACDD, 0xACDD }, -{ 0xACDE, 0xACDE, 0xACDE }, -{ 0xACDF, 0xACDF, 0xACDF }, -{ 0xACE0, 0xACE0, 0xACE0 }, -{ 0xACE1, 0xACE1, 0xACE1 }, -{ 0xACE2, 0xACE2, 0xACE2 }, -{ 0xACE3, 0xACE3, 0xACE3 }, -{ 0xACE4, 0xACE4, 0xACE4 }, -{ 0xACE5, 0xACE5, 0xACE5 }, -{ 0xACE6, 0xACE6, 0xACE6 }, -{ 0xACE7, 0xACE7, 0xACE7 }, -{ 0xACE8, 0xACE8, 0xACE8 }, -{ 0xACE9, 0xACE9, 0xACE9 }, -{ 0xACEA, 0xACEA, 0xACEA }, -{ 0xACEB, 0xACEB, 0xACEB }, -{ 0xACEC, 0xACEC, 0xACEC }, -{ 0xACED, 0xACED, 0xACED }, -{ 0xACEE, 0xACEE, 0xACEE }, -{ 0xACEF, 0xACEF, 0xACEF }, -{ 0xACF0, 0xACF0, 0xACF0 }, -{ 0xACF1, 0xACF1, 0xACF1 }, -{ 0xACF2, 0xACF2, 0xACF2 }, -{ 0xACF3, 0xACF3, 0xACF3 }, -{ 0xACF4, 0xACF4, 0xACF4 }, -{ 0xACF5, 0xACF5, 0xACF5 }, -{ 0xACF6, 0xACF6, 0xACF6 }, -{ 0xACF7, 0xACF7, 0xACF7 }, -{ 0xACF8, 0xACF8, 0xACF8 }, -{ 0xACF9, 0xACF9, 0xACF9 }, -{ 0xACFA, 0xACFA, 0xACFA }, -{ 0xACFB, 0xACFB, 0xACFB }, -{ 0xACFC, 0xACFC, 0xACFC }, -{ 0xACFD, 0xACFD, 0xACFD }, -{ 0xACFE, 0xACFE, 0xACFE }, -{ 0xACFF, 0xACFF, 0xACFF }, -{ 0xAD00, 0xAD00, 0xAD00 }, -{ 0xAD01, 0xAD01, 0xAD01 }, -{ 0xAD02, 0xAD02, 0xAD02 }, -{ 0xAD03, 0xAD03, 0xAD03 }, -{ 0xAD04, 0xAD04, 0xAD04 }, -{ 0xAD05, 0xAD05, 0xAD05 }, -{ 0xAD06, 0xAD06, 0xAD06 }, -{ 0xAD07, 0xAD07, 0xAD07 }, -{ 0xAD08, 0xAD08, 0xAD08 }, -{ 0xAD09, 0xAD09, 0xAD09 }, -{ 0xAD0A, 0xAD0A, 0xAD0A }, -{ 0xAD0B, 0xAD0B, 0xAD0B }, -{ 0xAD0C, 0xAD0C, 0xAD0C }, -{ 0xAD0D, 0xAD0D, 0xAD0D }, -{ 0xAD0E, 0xAD0E, 0xAD0E }, -{ 0xAD0F, 0xAD0F, 0xAD0F }, -{ 0xAD10, 0xAD10, 0xAD10 }, -{ 0xAD11, 0xAD11, 0xAD11 }, -{ 0xAD12, 0xAD12, 0xAD12 }, -{ 0xAD13, 0xAD13, 0xAD13 }, -{ 0xAD14, 0xAD14, 0xAD14 }, -{ 0xAD15, 0xAD15, 0xAD15 }, -{ 0xAD16, 0xAD16, 0xAD16 }, -{ 0xAD17, 0xAD17, 0xAD17 }, -{ 0xAD18, 0xAD18, 0xAD18 }, -{ 0xAD19, 0xAD19, 0xAD19 }, -{ 0xAD1A, 0xAD1A, 0xAD1A }, -{ 0xAD1B, 0xAD1B, 0xAD1B }, -{ 0xAD1C, 0xAD1C, 0xAD1C }, -{ 0xAD1D, 0xAD1D, 0xAD1D }, -{ 0xAD1E, 0xAD1E, 0xAD1E }, -{ 0xAD1F, 0xAD1F, 0xAD1F }, -{ 0xAD20, 0xAD20, 0xAD20 }, -{ 0xAD21, 0xAD21, 0xAD21 }, -{ 0xAD22, 0xAD22, 0xAD22 }, -{ 0xAD23, 0xAD23, 0xAD23 }, -{ 0xAD24, 0xAD24, 0xAD24 }, -{ 0xAD25, 0xAD25, 0xAD25 }, -{ 0xAD26, 0xAD26, 0xAD26 }, -{ 0xAD27, 0xAD27, 0xAD27 }, -{ 0xAD28, 0xAD28, 0xAD28 }, -{ 0xAD29, 0xAD29, 0xAD29 }, -{ 0xAD2A, 0xAD2A, 0xAD2A }, -{ 0xAD2B, 0xAD2B, 0xAD2B }, -{ 0xAD2C, 0xAD2C, 0xAD2C }, -{ 0xAD2D, 0xAD2D, 0xAD2D }, -{ 0xAD2E, 0xAD2E, 0xAD2E }, -{ 0xAD2F, 0xAD2F, 0xAD2F }, -{ 0xAD30, 0xAD30, 0xAD30 }, -{ 0xAD31, 0xAD31, 0xAD31 }, -{ 0xAD32, 0xAD32, 0xAD32 }, -{ 0xAD33, 0xAD33, 0xAD33 }, -{ 0xAD34, 0xAD34, 0xAD34 }, -{ 0xAD35, 0xAD35, 0xAD35 }, -{ 0xAD36, 0xAD36, 0xAD36 }, -{ 0xAD37, 0xAD37, 0xAD37 }, -{ 0xAD38, 0xAD38, 0xAD38 }, -{ 0xAD39, 0xAD39, 0xAD39 }, -{ 0xAD3A, 0xAD3A, 0xAD3A }, -{ 0xAD3B, 0xAD3B, 0xAD3B }, -{ 0xAD3C, 0xAD3C, 0xAD3C }, -{ 0xAD3D, 0xAD3D, 0xAD3D }, -{ 0xAD3E, 0xAD3E, 0xAD3E }, -{ 0xAD3F, 0xAD3F, 0xAD3F }, -{ 0xAD40, 0xAD40, 0xAD40 }, -{ 0xAD41, 0xAD41, 0xAD41 }, -{ 0xAD42, 0xAD42, 0xAD42 }, -{ 0xAD43, 0xAD43, 0xAD43 }, -{ 0xAD44, 0xAD44, 0xAD44 }, -{ 0xAD45, 0xAD45, 0xAD45 }, -{ 0xAD46, 0xAD46, 0xAD46 }, -{ 0xAD47, 0xAD47, 0xAD47 }, -{ 0xAD48, 0xAD48, 0xAD48 }, -{ 0xAD49, 0xAD49, 0xAD49 }, -{ 0xAD4A, 0xAD4A, 0xAD4A }, -{ 0xAD4B, 0xAD4B, 0xAD4B }, -{ 0xAD4C, 0xAD4C, 0xAD4C }, -{ 0xAD4D, 0xAD4D, 0xAD4D }, -{ 0xAD4E, 0xAD4E, 0xAD4E }, -{ 0xAD4F, 0xAD4F, 0xAD4F }, -{ 0xAD50, 0xAD50, 0xAD50 }, -{ 0xAD51, 0xAD51, 0xAD51 }, -{ 0xAD52, 0xAD52, 0xAD52 }, -{ 0xAD53, 0xAD53, 0xAD53 }, -{ 0xAD54, 0xAD54, 0xAD54 }, -{ 0xAD55, 0xAD55, 0xAD55 }, -{ 0xAD56, 0xAD56, 0xAD56 }, -{ 0xAD57, 0xAD57, 0xAD57 }, -{ 0xAD58, 0xAD58, 0xAD58 }, -{ 0xAD59, 0xAD59, 0xAD59 }, -{ 0xAD5A, 0xAD5A, 0xAD5A }, -{ 0xAD5B, 0xAD5B, 0xAD5B }, -{ 0xAD5C, 0xAD5C, 0xAD5C }, -{ 0xAD5D, 0xAD5D, 0xAD5D }, -{ 0xAD5E, 0xAD5E, 0xAD5E }, -{ 0xAD5F, 0xAD5F, 0xAD5F }, -{ 0xAD60, 0xAD60, 0xAD60 }, -{ 0xAD61, 0xAD61, 0xAD61 }, -{ 0xAD62, 0xAD62, 0xAD62 }, -{ 0xAD63, 0xAD63, 0xAD63 }, -{ 0xAD64, 0xAD64, 0xAD64 }, -{ 0xAD65, 0xAD65, 0xAD65 }, -{ 0xAD66, 0xAD66, 0xAD66 }, -{ 0xAD67, 0xAD67, 0xAD67 }, -{ 0xAD68, 0xAD68, 0xAD68 }, -{ 0xAD69, 0xAD69, 0xAD69 }, -{ 0xAD6A, 0xAD6A, 0xAD6A }, -{ 0xAD6B, 0xAD6B, 0xAD6B }, -{ 0xAD6C, 0xAD6C, 0xAD6C }, -{ 0xAD6D, 0xAD6D, 0xAD6D }, -{ 0xAD6E, 0xAD6E, 0xAD6E }, -{ 0xAD6F, 0xAD6F, 0xAD6F }, -{ 0xAD70, 0xAD70, 0xAD70 }, -{ 0xAD71, 0xAD71, 0xAD71 }, -{ 0xAD72, 0xAD72, 0xAD72 }, -{ 0xAD73, 0xAD73, 0xAD73 }, -{ 0xAD74, 0xAD74, 0xAD74 }, -{ 0xAD75, 0xAD75, 0xAD75 }, -{ 0xAD76, 0xAD76, 0xAD76 }, -{ 0xAD77, 0xAD77, 0xAD77 }, -{ 0xAD78, 0xAD78, 0xAD78 }, -{ 0xAD79, 0xAD79, 0xAD79 }, -{ 0xAD7A, 0xAD7A, 0xAD7A }, -{ 0xAD7B, 0xAD7B, 0xAD7B }, -{ 0xAD7C, 0xAD7C, 0xAD7C }, -{ 0xAD7D, 0xAD7D, 0xAD7D }, -{ 0xAD7E, 0xAD7E, 0xAD7E }, -{ 0xAD7F, 0xAD7F, 0xAD7F }, -{ 0xAD80, 0xAD80, 0xAD80 }, -{ 0xAD81, 0xAD81, 0xAD81 }, -{ 0xAD82, 0xAD82, 0xAD82 }, -{ 0xAD83, 0xAD83, 0xAD83 }, -{ 0xAD84, 0xAD84, 0xAD84 }, -{ 0xAD85, 0xAD85, 0xAD85 }, -{ 0xAD86, 0xAD86, 0xAD86 }, -{ 0xAD87, 0xAD87, 0xAD87 }, -{ 0xAD88, 0xAD88, 0xAD88 }, -{ 0xAD89, 0xAD89, 0xAD89 }, -{ 0xAD8A, 0xAD8A, 0xAD8A }, -{ 0xAD8B, 0xAD8B, 0xAD8B }, -{ 0xAD8C, 0xAD8C, 0xAD8C }, -{ 0xAD8D, 0xAD8D, 0xAD8D }, -{ 0xAD8E, 0xAD8E, 0xAD8E }, -{ 0xAD8F, 0xAD8F, 0xAD8F }, -{ 0xAD90, 0xAD90, 0xAD90 }, -{ 0xAD91, 0xAD91, 0xAD91 }, -{ 0xAD92, 0xAD92, 0xAD92 }, -{ 0xAD93, 0xAD93, 0xAD93 }, -{ 0xAD94, 0xAD94, 0xAD94 }, -{ 0xAD95, 0xAD95, 0xAD95 }, -{ 0xAD96, 0xAD96, 0xAD96 }, -{ 0xAD97, 0xAD97, 0xAD97 }, -{ 0xAD98, 0xAD98, 0xAD98 }, -{ 0xAD99, 0xAD99, 0xAD99 }, -{ 0xAD9A, 0xAD9A, 0xAD9A }, -{ 0xAD9B, 0xAD9B, 0xAD9B }, -{ 0xAD9C, 0xAD9C, 0xAD9C }, -{ 0xAD9D, 0xAD9D, 0xAD9D }, -{ 0xAD9E, 0xAD9E, 0xAD9E }, -{ 0xAD9F, 0xAD9F, 0xAD9F }, -{ 0xADA0, 0xADA0, 0xADA0 }, -{ 0xADA1, 0xADA1, 0xADA1 }, -{ 0xADA2, 0xADA2, 0xADA2 }, -{ 0xADA3, 0xADA3, 0xADA3 }, -{ 0xADA4, 0xADA4, 0xADA4 }, -{ 0xADA5, 0xADA5, 0xADA5 }, -{ 0xADA6, 0xADA6, 0xADA6 }, -{ 0xADA7, 0xADA7, 0xADA7 }, -{ 0xADA8, 0xADA8, 0xADA8 }, -{ 0xADA9, 0xADA9, 0xADA9 }, -{ 0xADAA, 0xADAA, 0xADAA }, -{ 0xADAB, 0xADAB, 0xADAB }, -{ 0xADAC, 0xADAC, 0xADAC }, -{ 0xADAD, 0xADAD, 0xADAD }, -{ 0xADAE, 0xADAE, 0xADAE }, -{ 0xADAF, 0xADAF, 0xADAF }, -{ 0xADB0, 0xADB0, 0xADB0 }, -{ 0xADB1, 0xADB1, 0xADB1 }, -{ 0xADB2, 0xADB2, 0xADB2 }, -{ 0xADB3, 0xADB3, 0xADB3 }, -{ 0xADB4, 0xADB4, 0xADB4 }, -{ 0xADB5, 0xADB5, 0xADB5 }, -{ 0xADB6, 0xADB6, 0xADB6 }, -{ 0xADB7, 0xADB7, 0xADB7 }, -{ 0xADB8, 0xADB8, 0xADB8 }, -{ 0xADB9, 0xADB9, 0xADB9 }, -{ 0xADBA, 0xADBA, 0xADBA }, -{ 0xADBB, 0xADBB, 0xADBB }, -{ 0xADBC, 0xADBC, 0xADBC }, -{ 0xADBD, 0xADBD, 0xADBD }, -{ 0xADBE, 0xADBE, 0xADBE }, -{ 0xADBF, 0xADBF, 0xADBF }, -{ 0xADC0, 0xADC0, 0xADC0 }, -{ 0xADC1, 0xADC1, 0xADC1 }, -{ 0xADC2, 0xADC2, 0xADC2 }, -{ 0xADC3, 0xADC3, 0xADC3 }, -{ 0xADC4, 0xADC4, 0xADC4 }, -{ 0xADC5, 0xADC5, 0xADC5 }, -{ 0xADC6, 0xADC6, 0xADC6 }, -{ 0xADC7, 0xADC7, 0xADC7 }, -{ 0xADC8, 0xADC8, 0xADC8 }, -{ 0xADC9, 0xADC9, 0xADC9 }, -{ 0xADCA, 0xADCA, 0xADCA }, -{ 0xADCB, 0xADCB, 0xADCB }, -{ 0xADCC, 0xADCC, 0xADCC }, -{ 0xADCD, 0xADCD, 0xADCD }, -{ 0xADCE, 0xADCE, 0xADCE }, -{ 0xADCF, 0xADCF, 0xADCF }, -{ 0xADD0, 0xADD0, 0xADD0 }, -{ 0xADD1, 0xADD1, 0xADD1 }, -{ 0xADD2, 0xADD2, 0xADD2 }, -{ 0xADD3, 0xADD3, 0xADD3 }, -{ 0xADD4, 0xADD4, 0xADD4 }, -{ 0xADD5, 0xADD5, 0xADD5 }, -{ 0xADD6, 0xADD6, 0xADD6 }, -{ 0xADD7, 0xADD7, 0xADD7 }, -{ 0xADD8, 0xADD8, 0xADD8 }, -{ 0xADD9, 0xADD9, 0xADD9 }, -{ 0xADDA, 0xADDA, 0xADDA }, -{ 0xADDB, 0xADDB, 0xADDB }, -{ 0xADDC, 0xADDC, 0xADDC }, -{ 0xADDD, 0xADDD, 0xADDD }, -{ 0xADDE, 0xADDE, 0xADDE }, -{ 0xADDF, 0xADDF, 0xADDF }, -{ 0xADE0, 0xADE0, 0xADE0 }, -{ 0xADE1, 0xADE1, 0xADE1 }, -{ 0xADE2, 0xADE2, 0xADE2 }, -{ 0xADE3, 0xADE3, 0xADE3 }, -{ 0xADE4, 0xADE4, 0xADE4 }, -{ 0xADE5, 0xADE5, 0xADE5 }, -{ 0xADE6, 0xADE6, 0xADE6 }, -{ 0xADE7, 0xADE7, 0xADE7 }, -{ 0xADE8, 0xADE8, 0xADE8 }, -{ 0xADE9, 0xADE9, 0xADE9 }, -{ 0xADEA, 0xADEA, 0xADEA }, -{ 0xADEB, 0xADEB, 0xADEB }, -{ 0xADEC, 0xADEC, 0xADEC }, -{ 0xADED, 0xADED, 0xADED }, -{ 0xADEE, 0xADEE, 0xADEE }, -{ 0xADEF, 0xADEF, 0xADEF }, -{ 0xADF0, 0xADF0, 0xADF0 }, -{ 0xADF1, 0xADF1, 0xADF1 }, -{ 0xADF2, 0xADF2, 0xADF2 }, -{ 0xADF3, 0xADF3, 0xADF3 }, -{ 0xADF4, 0xADF4, 0xADF4 }, -{ 0xADF5, 0xADF5, 0xADF5 }, -{ 0xADF6, 0xADF6, 0xADF6 }, -{ 0xADF7, 0xADF7, 0xADF7 }, -{ 0xADF8, 0xADF8, 0xADF8 }, -{ 0xADF9, 0xADF9, 0xADF9 }, -{ 0xADFA, 0xADFA, 0xADFA }, -{ 0xADFB, 0xADFB, 0xADFB }, -{ 0xADFC, 0xADFC, 0xADFC }, -{ 0xADFD, 0xADFD, 0xADFD }, -{ 0xADFE, 0xADFE, 0xADFE }, -{ 0xADFF, 0xADFF, 0xADFF }, -{ 0xAE00, 0xAE00, 0xAE00 }, -{ 0xAE01, 0xAE01, 0xAE01 }, -{ 0xAE02, 0xAE02, 0xAE02 }, -{ 0xAE03, 0xAE03, 0xAE03 }, -{ 0xAE04, 0xAE04, 0xAE04 }, -{ 0xAE05, 0xAE05, 0xAE05 }, -{ 0xAE06, 0xAE06, 0xAE06 }, -{ 0xAE07, 0xAE07, 0xAE07 }, -{ 0xAE08, 0xAE08, 0xAE08 }, -{ 0xAE09, 0xAE09, 0xAE09 }, -{ 0xAE0A, 0xAE0A, 0xAE0A }, -{ 0xAE0B, 0xAE0B, 0xAE0B }, -{ 0xAE0C, 0xAE0C, 0xAE0C }, -{ 0xAE0D, 0xAE0D, 0xAE0D }, -{ 0xAE0E, 0xAE0E, 0xAE0E }, -{ 0xAE0F, 0xAE0F, 0xAE0F }, -{ 0xAE10, 0xAE10, 0xAE10 }, -{ 0xAE11, 0xAE11, 0xAE11 }, -{ 0xAE12, 0xAE12, 0xAE12 }, -{ 0xAE13, 0xAE13, 0xAE13 }, -{ 0xAE14, 0xAE14, 0xAE14 }, -{ 0xAE15, 0xAE15, 0xAE15 }, -{ 0xAE16, 0xAE16, 0xAE16 }, -{ 0xAE17, 0xAE17, 0xAE17 }, -{ 0xAE18, 0xAE18, 0xAE18 }, -{ 0xAE19, 0xAE19, 0xAE19 }, -{ 0xAE1A, 0xAE1A, 0xAE1A }, -{ 0xAE1B, 0xAE1B, 0xAE1B }, -{ 0xAE1C, 0xAE1C, 0xAE1C }, -{ 0xAE1D, 0xAE1D, 0xAE1D }, -{ 0xAE1E, 0xAE1E, 0xAE1E }, -{ 0xAE1F, 0xAE1F, 0xAE1F }, -{ 0xAE20, 0xAE20, 0xAE20 }, -{ 0xAE21, 0xAE21, 0xAE21 }, -{ 0xAE22, 0xAE22, 0xAE22 }, -{ 0xAE23, 0xAE23, 0xAE23 }, -{ 0xAE24, 0xAE24, 0xAE24 }, -{ 0xAE25, 0xAE25, 0xAE25 }, -{ 0xAE26, 0xAE26, 0xAE26 }, -{ 0xAE27, 0xAE27, 0xAE27 }, -{ 0xAE28, 0xAE28, 0xAE28 }, -{ 0xAE29, 0xAE29, 0xAE29 }, -{ 0xAE2A, 0xAE2A, 0xAE2A }, -{ 0xAE2B, 0xAE2B, 0xAE2B }, -{ 0xAE2C, 0xAE2C, 0xAE2C }, -{ 0xAE2D, 0xAE2D, 0xAE2D }, -{ 0xAE2E, 0xAE2E, 0xAE2E }, -{ 0xAE2F, 0xAE2F, 0xAE2F }, -{ 0xAE30, 0xAE30, 0xAE30 }, -{ 0xAE31, 0xAE31, 0xAE31 }, -{ 0xAE32, 0xAE32, 0xAE32 }, -{ 0xAE33, 0xAE33, 0xAE33 }, -{ 0xAE34, 0xAE34, 0xAE34 }, -{ 0xAE35, 0xAE35, 0xAE35 }, -{ 0xAE36, 0xAE36, 0xAE36 }, -{ 0xAE37, 0xAE37, 0xAE37 }, -{ 0xAE38, 0xAE38, 0xAE38 }, -{ 0xAE39, 0xAE39, 0xAE39 }, -{ 0xAE3A, 0xAE3A, 0xAE3A }, -{ 0xAE3B, 0xAE3B, 0xAE3B }, -{ 0xAE3C, 0xAE3C, 0xAE3C }, -{ 0xAE3D, 0xAE3D, 0xAE3D }, -{ 0xAE3E, 0xAE3E, 0xAE3E }, -{ 0xAE3F, 0xAE3F, 0xAE3F }, -{ 0xAE40, 0xAE40, 0xAE40 }, -{ 0xAE41, 0xAE41, 0xAE41 }, -{ 0xAE42, 0xAE42, 0xAE42 }, -{ 0xAE43, 0xAE43, 0xAE43 }, -{ 0xAE44, 0xAE44, 0xAE44 }, -{ 0xAE45, 0xAE45, 0xAE45 }, -{ 0xAE46, 0xAE46, 0xAE46 }, -{ 0xAE47, 0xAE47, 0xAE47 }, -{ 0xAE48, 0xAE48, 0xAE48 }, -{ 0xAE49, 0xAE49, 0xAE49 }, -{ 0xAE4A, 0xAE4A, 0xAE4A }, -{ 0xAE4B, 0xAE4B, 0xAE4B }, -{ 0xAE4C, 0xAE4C, 0xAE4C }, -{ 0xAE4D, 0xAE4D, 0xAE4D }, -{ 0xAE4E, 0xAE4E, 0xAE4E }, -{ 0xAE4F, 0xAE4F, 0xAE4F }, -{ 0xAE50, 0xAE50, 0xAE50 }, -{ 0xAE51, 0xAE51, 0xAE51 }, -{ 0xAE52, 0xAE52, 0xAE52 }, -{ 0xAE53, 0xAE53, 0xAE53 }, -{ 0xAE54, 0xAE54, 0xAE54 }, -{ 0xAE55, 0xAE55, 0xAE55 }, -{ 0xAE56, 0xAE56, 0xAE56 }, -{ 0xAE57, 0xAE57, 0xAE57 }, -{ 0xAE58, 0xAE58, 0xAE58 }, -{ 0xAE59, 0xAE59, 0xAE59 }, -{ 0xAE5A, 0xAE5A, 0xAE5A }, -{ 0xAE5B, 0xAE5B, 0xAE5B }, -{ 0xAE5C, 0xAE5C, 0xAE5C }, -{ 0xAE5D, 0xAE5D, 0xAE5D }, -{ 0xAE5E, 0xAE5E, 0xAE5E }, -{ 0xAE5F, 0xAE5F, 0xAE5F }, -{ 0xAE60, 0xAE60, 0xAE60 }, -{ 0xAE61, 0xAE61, 0xAE61 }, -{ 0xAE62, 0xAE62, 0xAE62 }, -{ 0xAE63, 0xAE63, 0xAE63 }, -{ 0xAE64, 0xAE64, 0xAE64 }, -{ 0xAE65, 0xAE65, 0xAE65 }, -{ 0xAE66, 0xAE66, 0xAE66 }, -{ 0xAE67, 0xAE67, 0xAE67 }, -{ 0xAE68, 0xAE68, 0xAE68 }, -{ 0xAE69, 0xAE69, 0xAE69 }, -{ 0xAE6A, 0xAE6A, 0xAE6A }, -{ 0xAE6B, 0xAE6B, 0xAE6B }, -{ 0xAE6C, 0xAE6C, 0xAE6C }, -{ 0xAE6D, 0xAE6D, 0xAE6D }, -{ 0xAE6E, 0xAE6E, 0xAE6E }, -{ 0xAE6F, 0xAE6F, 0xAE6F }, -{ 0xAE70, 0xAE70, 0xAE70 }, -{ 0xAE71, 0xAE71, 0xAE71 }, -{ 0xAE72, 0xAE72, 0xAE72 }, -{ 0xAE73, 0xAE73, 0xAE73 }, -{ 0xAE74, 0xAE74, 0xAE74 }, -{ 0xAE75, 0xAE75, 0xAE75 }, -{ 0xAE76, 0xAE76, 0xAE76 }, -{ 0xAE77, 0xAE77, 0xAE77 }, -{ 0xAE78, 0xAE78, 0xAE78 }, -{ 0xAE79, 0xAE79, 0xAE79 }, -{ 0xAE7A, 0xAE7A, 0xAE7A }, -{ 0xAE7B, 0xAE7B, 0xAE7B }, -{ 0xAE7C, 0xAE7C, 0xAE7C }, -{ 0xAE7D, 0xAE7D, 0xAE7D }, -{ 0xAE7E, 0xAE7E, 0xAE7E }, -{ 0xAE7F, 0xAE7F, 0xAE7F }, -{ 0xAE80, 0xAE80, 0xAE80 }, -{ 0xAE81, 0xAE81, 0xAE81 }, -{ 0xAE82, 0xAE82, 0xAE82 }, -{ 0xAE83, 0xAE83, 0xAE83 }, -{ 0xAE84, 0xAE84, 0xAE84 }, -{ 0xAE85, 0xAE85, 0xAE85 }, -{ 0xAE86, 0xAE86, 0xAE86 }, -{ 0xAE87, 0xAE87, 0xAE87 }, -{ 0xAE88, 0xAE88, 0xAE88 }, -{ 0xAE89, 0xAE89, 0xAE89 }, -{ 0xAE8A, 0xAE8A, 0xAE8A }, -{ 0xAE8B, 0xAE8B, 0xAE8B }, -{ 0xAE8C, 0xAE8C, 0xAE8C }, -{ 0xAE8D, 0xAE8D, 0xAE8D }, -{ 0xAE8E, 0xAE8E, 0xAE8E }, -{ 0xAE8F, 0xAE8F, 0xAE8F }, -{ 0xAE90, 0xAE90, 0xAE90 }, -{ 0xAE91, 0xAE91, 0xAE91 }, -{ 0xAE92, 0xAE92, 0xAE92 }, -{ 0xAE93, 0xAE93, 0xAE93 }, -{ 0xAE94, 0xAE94, 0xAE94 }, -{ 0xAE95, 0xAE95, 0xAE95 }, -{ 0xAE96, 0xAE96, 0xAE96 }, -{ 0xAE97, 0xAE97, 0xAE97 }, -{ 0xAE98, 0xAE98, 0xAE98 }, -{ 0xAE99, 0xAE99, 0xAE99 }, -{ 0xAE9A, 0xAE9A, 0xAE9A }, -{ 0xAE9B, 0xAE9B, 0xAE9B }, -{ 0xAE9C, 0xAE9C, 0xAE9C }, -{ 0xAE9D, 0xAE9D, 0xAE9D }, -{ 0xAE9E, 0xAE9E, 0xAE9E }, -{ 0xAE9F, 0xAE9F, 0xAE9F }, -{ 0xAEA0, 0xAEA0, 0xAEA0 }, -{ 0xAEA1, 0xAEA1, 0xAEA1 }, -{ 0xAEA2, 0xAEA2, 0xAEA2 }, -{ 0xAEA3, 0xAEA3, 0xAEA3 }, -{ 0xAEA4, 0xAEA4, 0xAEA4 }, -{ 0xAEA5, 0xAEA5, 0xAEA5 }, -{ 0xAEA6, 0xAEA6, 0xAEA6 }, -{ 0xAEA7, 0xAEA7, 0xAEA7 }, -{ 0xAEA8, 0xAEA8, 0xAEA8 }, -{ 0xAEA9, 0xAEA9, 0xAEA9 }, -{ 0xAEAA, 0xAEAA, 0xAEAA }, -{ 0xAEAB, 0xAEAB, 0xAEAB }, -{ 0xAEAC, 0xAEAC, 0xAEAC }, -{ 0xAEAD, 0xAEAD, 0xAEAD }, -{ 0xAEAE, 0xAEAE, 0xAEAE }, -{ 0xAEAF, 0xAEAF, 0xAEAF }, -{ 0xAEB0, 0xAEB0, 0xAEB0 }, -{ 0xAEB1, 0xAEB1, 0xAEB1 }, -{ 0xAEB2, 0xAEB2, 0xAEB2 }, -{ 0xAEB3, 0xAEB3, 0xAEB3 }, -{ 0xAEB4, 0xAEB4, 0xAEB4 }, -{ 0xAEB5, 0xAEB5, 0xAEB5 }, -{ 0xAEB6, 0xAEB6, 0xAEB6 }, -{ 0xAEB7, 0xAEB7, 0xAEB7 }, -{ 0xAEB8, 0xAEB8, 0xAEB8 }, -{ 0xAEB9, 0xAEB9, 0xAEB9 }, -{ 0xAEBA, 0xAEBA, 0xAEBA }, -{ 0xAEBB, 0xAEBB, 0xAEBB }, -{ 0xAEBC, 0xAEBC, 0xAEBC }, -{ 0xAEBD, 0xAEBD, 0xAEBD }, -{ 0xAEBE, 0xAEBE, 0xAEBE }, -{ 0xAEBF, 0xAEBF, 0xAEBF }, -{ 0xAEC0, 0xAEC0, 0xAEC0 }, -{ 0xAEC1, 0xAEC1, 0xAEC1 }, -{ 0xAEC2, 0xAEC2, 0xAEC2 }, -{ 0xAEC3, 0xAEC3, 0xAEC3 }, -{ 0xAEC4, 0xAEC4, 0xAEC4 }, -{ 0xAEC5, 0xAEC5, 0xAEC5 }, -{ 0xAEC6, 0xAEC6, 0xAEC6 }, -{ 0xAEC7, 0xAEC7, 0xAEC7 }, -{ 0xAEC8, 0xAEC8, 0xAEC8 }, -{ 0xAEC9, 0xAEC9, 0xAEC9 }, -{ 0xAECA, 0xAECA, 0xAECA }, -{ 0xAECB, 0xAECB, 0xAECB }, -{ 0xAECC, 0xAECC, 0xAECC }, -{ 0xAECD, 0xAECD, 0xAECD }, -{ 0xAECE, 0xAECE, 0xAECE }, -{ 0xAECF, 0xAECF, 0xAECF }, -{ 0xAED0, 0xAED0, 0xAED0 }, -{ 0xAED1, 0xAED1, 0xAED1 }, -{ 0xAED2, 0xAED2, 0xAED2 }, -{ 0xAED3, 0xAED3, 0xAED3 }, -{ 0xAED4, 0xAED4, 0xAED4 }, -{ 0xAED5, 0xAED5, 0xAED5 }, -{ 0xAED6, 0xAED6, 0xAED6 }, -{ 0xAED7, 0xAED7, 0xAED7 }, -{ 0xAED8, 0xAED8, 0xAED8 }, -{ 0xAED9, 0xAED9, 0xAED9 }, -{ 0xAEDA, 0xAEDA, 0xAEDA }, -{ 0xAEDB, 0xAEDB, 0xAEDB }, -{ 0xAEDC, 0xAEDC, 0xAEDC }, -{ 0xAEDD, 0xAEDD, 0xAEDD }, -{ 0xAEDE, 0xAEDE, 0xAEDE }, -{ 0xAEDF, 0xAEDF, 0xAEDF }, -{ 0xAEE0, 0xAEE0, 0xAEE0 }, -{ 0xAEE1, 0xAEE1, 0xAEE1 }, -{ 0xAEE2, 0xAEE2, 0xAEE2 }, -{ 0xAEE3, 0xAEE3, 0xAEE3 }, -{ 0xAEE4, 0xAEE4, 0xAEE4 }, -{ 0xAEE5, 0xAEE5, 0xAEE5 }, -{ 0xAEE6, 0xAEE6, 0xAEE6 }, -{ 0xAEE7, 0xAEE7, 0xAEE7 }, -{ 0xAEE8, 0xAEE8, 0xAEE8 }, -{ 0xAEE9, 0xAEE9, 0xAEE9 }, -{ 0xAEEA, 0xAEEA, 0xAEEA }, -{ 0xAEEB, 0xAEEB, 0xAEEB }, -{ 0xAEEC, 0xAEEC, 0xAEEC }, -{ 0xAEED, 0xAEED, 0xAEED }, -{ 0xAEEE, 0xAEEE, 0xAEEE }, -{ 0xAEEF, 0xAEEF, 0xAEEF }, -{ 0xAEF0, 0xAEF0, 0xAEF0 }, -{ 0xAEF1, 0xAEF1, 0xAEF1 }, -{ 0xAEF2, 0xAEF2, 0xAEF2 }, -{ 0xAEF3, 0xAEF3, 0xAEF3 }, -{ 0xAEF4, 0xAEF4, 0xAEF4 }, -{ 0xAEF5, 0xAEF5, 0xAEF5 }, -{ 0xAEF6, 0xAEF6, 0xAEF6 }, -{ 0xAEF7, 0xAEF7, 0xAEF7 }, -{ 0xAEF8, 0xAEF8, 0xAEF8 }, -{ 0xAEF9, 0xAEF9, 0xAEF9 }, -{ 0xAEFA, 0xAEFA, 0xAEFA }, -{ 0xAEFB, 0xAEFB, 0xAEFB }, -{ 0xAEFC, 0xAEFC, 0xAEFC }, -{ 0xAEFD, 0xAEFD, 0xAEFD }, -{ 0xAEFE, 0xAEFE, 0xAEFE }, -{ 0xAEFF, 0xAEFF, 0xAEFF }, -{ 0xAF00, 0xAF00, 0xAF00 }, -{ 0xAF01, 0xAF01, 0xAF01 }, -{ 0xAF02, 0xAF02, 0xAF02 }, -{ 0xAF03, 0xAF03, 0xAF03 }, -{ 0xAF04, 0xAF04, 0xAF04 }, -{ 0xAF05, 0xAF05, 0xAF05 }, -{ 0xAF06, 0xAF06, 0xAF06 }, -{ 0xAF07, 0xAF07, 0xAF07 }, -{ 0xAF08, 0xAF08, 0xAF08 }, -{ 0xAF09, 0xAF09, 0xAF09 }, -{ 0xAF0A, 0xAF0A, 0xAF0A }, -{ 0xAF0B, 0xAF0B, 0xAF0B }, -{ 0xAF0C, 0xAF0C, 0xAF0C }, -{ 0xAF0D, 0xAF0D, 0xAF0D }, -{ 0xAF0E, 0xAF0E, 0xAF0E }, -{ 0xAF0F, 0xAF0F, 0xAF0F }, -{ 0xAF10, 0xAF10, 0xAF10 }, -{ 0xAF11, 0xAF11, 0xAF11 }, -{ 0xAF12, 0xAF12, 0xAF12 }, -{ 0xAF13, 0xAF13, 0xAF13 }, -{ 0xAF14, 0xAF14, 0xAF14 }, -{ 0xAF15, 0xAF15, 0xAF15 }, -{ 0xAF16, 0xAF16, 0xAF16 }, -{ 0xAF17, 0xAF17, 0xAF17 }, -{ 0xAF18, 0xAF18, 0xAF18 }, -{ 0xAF19, 0xAF19, 0xAF19 }, -{ 0xAF1A, 0xAF1A, 0xAF1A }, -{ 0xAF1B, 0xAF1B, 0xAF1B }, -{ 0xAF1C, 0xAF1C, 0xAF1C }, -{ 0xAF1D, 0xAF1D, 0xAF1D }, -{ 0xAF1E, 0xAF1E, 0xAF1E }, -{ 0xAF1F, 0xAF1F, 0xAF1F }, -{ 0xAF20, 0xAF20, 0xAF20 }, -{ 0xAF21, 0xAF21, 0xAF21 }, -{ 0xAF22, 0xAF22, 0xAF22 }, -{ 0xAF23, 0xAF23, 0xAF23 }, -{ 0xAF24, 0xAF24, 0xAF24 }, -{ 0xAF25, 0xAF25, 0xAF25 }, -{ 0xAF26, 0xAF26, 0xAF26 }, -{ 0xAF27, 0xAF27, 0xAF27 }, -{ 0xAF28, 0xAF28, 0xAF28 }, -{ 0xAF29, 0xAF29, 0xAF29 }, -{ 0xAF2A, 0xAF2A, 0xAF2A }, -{ 0xAF2B, 0xAF2B, 0xAF2B }, -{ 0xAF2C, 0xAF2C, 0xAF2C }, -{ 0xAF2D, 0xAF2D, 0xAF2D }, -{ 0xAF2E, 0xAF2E, 0xAF2E }, -{ 0xAF2F, 0xAF2F, 0xAF2F }, -{ 0xAF30, 0xAF30, 0xAF30 }, -{ 0xAF31, 0xAF31, 0xAF31 }, -{ 0xAF32, 0xAF32, 0xAF32 }, -{ 0xAF33, 0xAF33, 0xAF33 }, -{ 0xAF34, 0xAF34, 0xAF34 }, -{ 0xAF35, 0xAF35, 0xAF35 }, -{ 0xAF36, 0xAF36, 0xAF36 }, -{ 0xAF37, 0xAF37, 0xAF37 }, -{ 0xAF38, 0xAF38, 0xAF38 }, -{ 0xAF39, 0xAF39, 0xAF39 }, -{ 0xAF3A, 0xAF3A, 0xAF3A }, -{ 0xAF3B, 0xAF3B, 0xAF3B }, -{ 0xAF3C, 0xAF3C, 0xAF3C }, -{ 0xAF3D, 0xAF3D, 0xAF3D }, -{ 0xAF3E, 0xAF3E, 0xAF3E }, -{ 0xAF3F, 0xAF3F, 0xAF3F }, -{ 0xAF40, 0xAF40, 0xAF40 }, -{ 0xAF41, 0xAF41, 0xAF41 }, -{ 0xAF42, 0xAF42, 0xAF42 }, -{ 0xAF43, 0xAF43, 0xAF43 }, -{ 0xAF44, 0xAF44, 0xAF44 }, -{ 0xAF45, 0xAF45, 0xAF45 }, -{ 0xAF46, 0xAF46, 0xAF46 }, -{ 0xAF47, 0xAF47, 0xAF47 }, -{ 0xAF48, 0xAF48, 0xAF48 }, -{ 0xAF49, 0xAF49, 0xAF49 }, -{ 0xAF4A, 0xAF4A, 0xAF4A }, -{ 0xAF4B, 0xAF4B, 0xAF4B }, -{ 0xAF4C, 0xAF4C, 0xAF4C }, -{ 0xAF4D, 0xAF4D, 0xAF4D }, -{ 0xAF4E, 0xAF4E, 0xAF4E }, -{ 0xAF4F, 0xAF4F, 0xAF4F }, -{ 0xAF50, 0xAF50, 0xAF50 }, -{ 0xAF51, 0xAF51, 0xAF51 }, -{ 0xAF52, 0xAF52, 0xAF52 }, -{ 0xAF53, 0xAF53, 0xAF53 }, -{ 0xAF54, 0xAF54, 0xAF54 }, -{ 0xAF55, 0xAF55, 0xAF55 }, -{ 0xAF56, 0xAF56, 0xAF56 }, -{ 0xAF57, 0xAF57, 0xAF57 }, -{ 0xAF58, 0xAF58, 0xAF58 }, -{ 0xAF59, 0xAF59, 0xAF59 }, -{ 0xAF5A, 0xAF5A, 0xAF5A }, -{ 0xAF5B, 0xAF5B, 0xAF5B }, -{ 0xAF5C, 0xAF5C, 0xAF5C }, -{ 0xAF5D, 0xAF5D, 0xAF5D }, -{ 0xAF5E, 0xAF5E, 0xAF5E }, -{ 0xAF5F, 0xAF5F, 0xAF5F }, -{ 0xAF60, 0xAF60, 0xAF60 }, -{ 0xAF61, 0xAF61, 0xAF61 }, -{ 0xAF62, 0xAF62, 0xAF62 }, -{ 0xAF63, 0xAF63, 0xAF63 }, -{ 0xAF64, 0xAF64, 0xAF64 }, -{ 0xAF65, 0xAF65, 0xAF65 }, -{ 0xAF66, 0xAF66, 0xAF66 }, -{ 0xAF67, 0xAF67, 0xAF67 }, -{ 0xAF68, 0xAF68, 0xAF68 }, -{ 0xAF69, 0xAF69, 0xAF69 }, -{ 0xAF6A, 0xAF6A, 0xAF6A }, -{ 0xAF6B, 0xAF6B, 0xAF6B }, -{ 0xAF6C, 0xAF6C, 0xAF6C }, -{ 0xAF6D, 0xAF6D, 0xAF6D }, -{ 0xAF6E, 0xAF6E, 0xAF6E }, -{ 0xAF6F, 0xAF6F, 0xAF6F }, -{ 0xAF70, 0xAF70, 0xAF70 }, -{ 0xAF71, 0xAF71, 0xAF71 }, -{ 0xAF72, 0xAF72, 0xAF72 }, -{ 0xAF73, 0xAF73, 0xAF73 }, -{ 0xAF74, 0xAF74, 0xAF74 }, -{ 0xAF75, 0xAF75, 0xAF75 }, -{ 0xAF76, 0xAF76, 0xAF76 }, -{ 0xAF77, 0xAF77, 0xAF77 }, -{ 0xAF78, 0xAF78, 0xAF78 }, -{ 0xAF79, 0xAF79, 0xAF79 }, -{ 0xAF7A, 0xAF7A, 0xAF7A }, -{ 0xAF7B, 0xAF7B, 0xAF7B }, -{ 0xAF7C, 0xAF7C, 0xAF7C }, -{ 0xAF7D, 0xAF7D, 0xAF7D }, -{ 0xAF7E, 0xAF7E, 0xAF7E }, -{ 0xAF7F, 0xAF7F, 0xAF7F }, -{ 0xAF80, 0xAF80, 0xAF80 }, -{ 0xAF81, 0xAF81, 0xAF81 }, -{ 0xAF82, 0xAF82, 0xAF82 }, -{ 0xAF83, 0xAF83, 0xAF83 }, -{ 0xAF84, 0xAF84, 0xAF84 }, -{ 0xAF85, 0xAF85, 0xAF85 }, -{ 0xAF86, 0xAF86, 0xAF86 }, -{ 0xAF87, 0xAF87, 0xAF87 }, -{ 0xAF88, 0xAF88, 0xAF88 }, -{ 0xAF89, 0xAF89, 0xAF89 }, -{ 0xAF8A, 0xAF8A, 0xAF8A }, -{ 0xAF8B, 0xAF8B, 0xAF8B }, -{ 0xAF8C, 0xAF8C, 0xAF8C }, -{ 0xAF8D, 0xAF8D, 0xAF8D }, -{ 0xAF8E, 0xAF8E, 0xAF8E }, -{ 0xAF8F, 0xAF8F, 0xAF8F }, -{ 0xAF90, 0xAF90, 0xAF90 }, -{ 0xAF91, 0xAF91, 0xAF91 }, -{ 0xAF92, 0xAF92, 0xAF92 }, -{ 0xAF93, 0xAF93, 0xAF93 }, -{ 0xAF94, 0xAF94, 0xAF94 }, -{ 0xAF95, 0xAF95, 0xAF95 }, -{ 0xAF96, 0xAF96, 0xAF96 }, -{ 0xAF97, 0xAF97, 0xAF97 }, -{ 0xAF98, 0xAF98, 0xAF98 }, -{ 0xAF99, 0xAF99, 0xAF99 }, -{ 0xAF9A, 0xAF9A, 0xAF9A }, -{ 0xAF9B, 0xAF9B, 0xAF9B }, -{ 0xAF9C, 0xAF9C, 0xAF9C }, -{ 0xAF9D, 0xAF9D, 0xAF9D }, -{ 0xAF9E, 0xAF9E, 0xAF9E }, -{ 0xAF9F, 0xAF9F, 0xAF9F }, -{ 0xAFA0, 0xAFA0, 0xAFA0 }, -{ 0xAFA1, 0xAFA1, 0xAFA1 }, -{ 0xAFA2, 0xAFA2, 0xAFA2 }, -{ 0xAFA3, 0xAFA3, 0xAFA3 }, -{ 0xAFA4, 0xAFA4, 0xAFA4 }, -{ 0xAFA5, 0xAFA5, 0xAFA5 }, -{ 0xAFA6, 0xAFA6, 0xAFA6 }, -{ 0xAFA7, 0xAFA7, 0xAFA7 }, -{ 0xAFA8, 0xAFA8, 0xAFA8 }, -{ 0xAFA9, 0xAFA9, 0xAFA9 }, -{ 0xAFAA, 0xAFAA, 0xAFAA }, -{ 0xAFAB, 0xAFAB, 0xAFAB }, -{ 0xAFAC, 0xAFAC, 0xAFAC }, -{ 0xAFAD, 0xAFAD, 0xAFAD }, -{ 0xAFAE, 0xAFAE, 0xAFAE }, -{ 0xAFAF, 0xAFAF, 0xAFAF }, -{ 0xAFB0, 0xAFB0, 0xAFB0 }, -{ 0xAFB1, 0xAFB1, 0xAFB1 }, -{ 0xAFB2, 0xAFB2, 0xAFB2 }, -{ 0xAFB3, 0xAFB3, 0xAFB3 }, -{ 0xAFB4, 0xAFB4, 0xAFB4 }, -{ 0xAFB5, 0xAFB5, 0xAFB5 }, -{ 0xAFB6, 0xAFB6, 0xAFB6 }, -{ 0xAFB7, 0xAFB7, 0xAFB7 }, -{ 0xAFB8, 0xAFB8, 0xAFB8 }, -{ 0xAFB9, 0xAFB9, 0xAFB9 }, -{ 0xAFBA, 0xAFBA, 0xAFBA }, -{ 0xAFBB, 0xAFBB, 0xAFBB }, -{ 0xAFBC, 0xAFBC, 0xAFBC }, -{ 0xAFBD, 0xAFBD, 0xAFBD }, -{ 0xAFBE, 0xAFBE, 0xAFBE }, -{ 0xAFBF, 0xAFBF, 0xAFBF }, -{ 0xAFC0, 0xAFC0, 0xAFC0 }, -{ 0xAFC1, 0xAFC1, 0xAFC1 }, -{ 0xAFC2, 0xAFC2, 0xAFC2 }, -{ 0xAFC3, 0xAFC3, 0xAFC3 }, -{ 0xAFC4, 0xAFC4, 0xAFC4 }, -{ 0xAFC5, 0xAFC5, 0xAFC5 }, -{ 0xAFC6, 0xAFC6, 0xAFC6 }, -{ 0xAFC7, 0xAFC7, 0xAFC7 }, -{ 0xAFC8, 0xAFC8, 0xAFC8 }, -{ 0xAFC9, 0xAFC9, 0xAFC9 }, -{ 0xAFCA, 0xAFCA, 0xAFCA }, -{ 0xAFCB, 0xAFCB, 0xAFCB }, -{ 0xAFCC, 0xAFCC, 0xAFCC }, -{ 0xAFCD, 0xAFCD, 0xAFCD }, -{ 0xAFCE, 0xAFCE, 0xAFCE }, -{ 0xAFCF, 0xAFCF, 0xAFCF }, -{ 0xAFD0, 0xAFD0, 0xAFD0 }, -{ 0xAFD1, 0xAFD1, 0xAFD1 }, -{ 0xAFD2, 0xAFD2, 0xAFD2 }, -{ 0xAFD3, 0xAFD3, 0xAFD3 }, -{ 0xAFD4, 0xAFD4, 0xAFD4 }, -{ 0xAFD5, 0xAFD5, 0xAFD5 }, -{ 0xAFD6, 0xAFD6, 0xAFD6 }, -{ 0xAFD7, 0xAFD7, 0xAFD7 }, -{ 0xAFD8, 0xAFD8, 0xAFD8 }, -{ 0xAFD9, 0xAFD9, 0xAFD9 }, -{ 0xAFDA, 0xAFDA, 0xAFDA }, -{ 0xAFDB, 0xAFDB, 0xAFDB }, -{ 0xAFDC, 0xAFDC, 0xAFDC }, -{ 0xAFDD, 0xAFDD, 0xAFDD }, -{ 0xAFDE, 0xAFDE, 0xAFDE }, -{ 0xAFDF, 0xAFDF, 0xAFDF }, -{ 0xAFE0, 0xAFE0, 0xAFE0 }, -{ 0xAFE1, 0xAFE1, 0xAFE1 }, -{ 0xAFE2, 0xAFE2, 0xAFE2 }, -{ 0xAFE3, 0xAFE3, 0xAFE3 }, -{ 0xAFE4, 0xAFE4, 0xAFE4 }, -{ 0xAFE5, 0xAFE5, 0xAFE5 }, -{ 0xAFE6, 0xAFE6, 0xAFE6 }, -{ 0xAFE7, 0xAFE7, 0xAFE7 }, -{ 0xAFE8, 0xAFE8, 0xAFE8 }, -{ 0xAFE9, 0xAFE9, 0xAFE9 }, -{ 0xAFEA, 0xAFEA, 0xAFEA }, -{ 0xAFEB, 0xAFEB, 0xAFEB }, -{ 0xAFEC, 0xAFEC, 0xAFEC }, -{ 0xAFED, 0xAFED, 0xAFED }, -{ 0xAFEE, 0xAFEE, 0xAFEE }, -{ 0xAFEF, 0xAFEF, 0xAFEF }, -{ 0xAFF0, 0xAFF0, 0xAFF0 }, -{ 0xAFF1, 0xAFF1, 0xAFF1 }, -{ 0xAFF2, 0xAFF2, 0xAFF2 }, -{ 0xAFF3, 0xAFF3, 0xAFF3 }, -{ 0xAFF4, 0xAFF4, 0xAFF4 }, -{ 0xAFF5, 0xAFF5, 0xAFF5 }, -{ 0xAFF6, 0xAFF6, 0xAFF6 }, -{ 0xAFF7, 0xAFF7, 0xAFF7 }, -{ 0xAFF8, 0xAFF8, 0xAFF8 }, -{ 0xAFF9, 0xAFF9, 0xAFF9 }, -{ 0xAFFA, 0xAFFA, 0xAFFA }, -{ 0xAFFB, 0xAFFB, 0xAFFB }, -{ 0xAFFC, 0xAFFC, 0xAFFC }, -{ 0xAFFD, 0xAFFD, 0xAFFD }, -{ 0xAFFE, 0xAFFE, 0xAFFE }, -{ 0xAFFF, 0xAFFF, 0xAFFF }, -{ 0xB000, 0xB000, 0xB000 }, -{ 0xB001, 0xB001, 0xB001 }, -{ 0xB002, 0xB002, 0xB002 }, -{ 0xB003, 0xB003, 0xB003 }, -{ 0xB004, 0xB004, 0xB004 }, -{ 0xB005, 0xB005, 0xB005 }, -{ 0xB006, 0xB006, 0xB006 }, -{ 0xB007, 0xB007, 0xB007 }, -{ 0xB008, 0xB008, 0xB008 }, -{ 0xB009, 0xB009, 0xB009 }, -{ 0xB00A, 0xB00A, 0xB00A }, -{ 0xB00B, 0xB00B, 0xB00B }, -{ 0xB00C, 0xB00C, 0xB00C }, -{ 0xB00D, 0xB00D, 0xB00D }, -{ 0xB00E, 0xB00E, 0xB00E }, -{ 0xB00F, 0xB00F, 0xB00F }, -{ 0xB010, 0xB010, 0xB010 }, -{ 0xB011, 0xB011, 0xB011 }, -{ 0xB012, 0xB012, 0xB012 }, -{ 0xB013, 0xB013, 0xB013 }, -{ 0xB014, 0xB014, 0xB014 }, -{ 0xB015, 0xB015, 0xB015 }, -{ 0xB016, 0xB016, 0xB016 }, -{ 0xB017, 0xB017, 0xB017 }, -{ 0xB018, 0xB018, 0xB018 }, -{ 0xB019, 0xB019, 0xB019 }, -{ 0xB01A, 0xB01A, 0xB01A }, -{ 0xB01B, 0xB01B, 0xB01B }, -{ 0xB01C, 0xB01C, 0xB01C }, -{ 0xB01D, 0xB01D, 0xB01D }, -{ 0xB01E, 0xB01E, 0xB01E }, -{ 0xB01F, 0xB01F, 0xB01F }, -{ 0xB020, 0xB020, 0xB020 }, -{ 0xB021, 0xB021, 0xB021 }, -{ 0xB022, 0xB022, 0xB022 }, -{ 0xB023, 0xB023, 0xB023 }, -{ 0xB024, 0xB024, 0xB024 }, -{ 0xB025, 0xB025, 0xB025 }, -{ 0xB026, 0xB026, 0xB026 }, -{ 0xB027, 0xB027, 0xB027 }, -{ 0xB028, 0xB028, 0xB028 }, -{ 0xB029, 0xB029, 0xB029 }, -{ 0xB02A, 0xB02A, 0xB02A }, -{ 0xB02B, 0xB02B, 0xB02B }, -{ 0xB02C, 0xB02C, 0xB02C }, -{ 0xB02D, 0xB02D, 0xB02D }, -{ 0xB02E, 0xB02E, 0xB02E }, -{ 0xB02F, 0xB02F, 0xB02F }, -{ 0xB030, 0xB030, 0xB030 }, -{ 0xB031, 0xB031, 0xB031 }, -{ 0xB032, 0xB032, 0xB032 }, -{ 0xB033, 0xB033, 0xB033 }, -{ 0xB034, 0xB034, 0xB034 }, -{ 0xB035, 0xB035, 0xB035 }, -{ 0xB036, 0xB036, 0xB036 }, -{ 0xB037, 0xB037, 0xB037 }, -{ 0xB038, 0xB038, 0xB038 }, -{ 0xB039, 0xB039, 0xB039 }, -{ 0xB03A, 0xB03A, 0xB03A }, -{ 0xB03B, 0xB03B, 0xB03B }, -{ 0xB03C, 0xB03C, 0xB03C }, -{ 0xB03D, 0xB03D, 0xB03D }, -{ 0xB03E, 0xB03E, 0xB03E }, -{ 0xB03F, 0xB03F, 0xB03F }, -{ 0xB040, 0xB040, 0xB040 }, -{ 0xB041, 0xB041, 0xB041 }, -{ 0xB042, 0xB042, 0xB042 }, -{ 0xB043, 0xB043, 0xB043 }, -{ 0xB044, 0xB044, 0xB044 }, -{ 0xB045, 0xB045, 0xB045 }, -{ 0xB046, 0xB046, 0xB046 }, -{ 0xB047, 0xB047, 0xB047 }, -{ 0xB048, 0xB048, 0xB048 }, -{ 0xB049, 0xB049, 0xB049 }, -{ 0xB04A, 0xB04A, 0xB04A }, -{ 0xB04B, 0xB04B, 0xB04B }, -{ 0xB04C, 0xB04C, 0xB04C }, -{ 0xB04D, 0xB04D, 0xB04D }, -{ 0xB04E, 0xB04E, 0xB04E }, -{ 0xB04F, 0xB04F, 0xB04F }, -{ 0xB050, 0xB050, 0xB050 }, -{ 0xB051, 0xB051, 0xB051 }, -{ 0xB052, 0xB052, 0xB052 }, -{ 0xB053, 0xB053, 0xB053 }, -{ 0xB054, 0xB054, 0xB054 }, -{ 0xB055, 0xB055, 0xB055 }, -{ 0xB056, 0xB056, 0xB056 }, -{ 0xB057, 0xB057, 0xB057 }, -{ 0xB058, 0xB058, 0xB058 }, -{ 0xB059, 0xB059, 0xB059 }, -{ 0xB05A, 0xB05A, 0xB05A }, -{ 0xB05B, 0xB05B, 0xB05B }, -{ 0xB05C, 0xB05C, 0xB05C }, -{ 0xB05D, 0xB05D, 0xB05D }, -{ 0xB05E, 0xB05E, 0xB05E }, -{ 0xB05F, 0xB05F, 0xB05F }, -{ 0xB060, 0xB060, 0xB060 }, -{ 0xB061, 0xB061, 0xB061 }, -{ 0xB062, 0xB062, 0xB062 }, -{ 0xB063, 0xB063, 0xB063 }, -{ 0xB064, 0xB064, 0xB064 }, -{ 0xB065, 0xB065, 0xB065 }, -{ 0xB066, 0xB066, 0xB066 }, -{ 0xB067, 0xB067, 0xB067 }, -{ 0xB068, 0xB068, 0xB068 }, -{ 0xB069, 0xB069, 0xB069 }, -{ 0xB06A, 0xB06A, 0xB06A }, -{ 0xB06B, 0xB06B, 0xB06B }, -{ 0xB06C, 0xB06C, 0xB06C }, -{ 0xB06D, 0xB06D, 0xB06D }, -{ 0xB06E, 0xB06E, 0xB06E }, -{ 0xB06F, 0xB06F, 0xB06F }, -{ 0xB070, 0xB070, 0xB070 }, -{ 0xB071, 0xB071, 0xB071 }, -{ 0xB072, 0xB072, 0xB072 }, -{ 0xB073, 0xB073, 0xB073 }, -{ 0xB074, 0xB074, 0xB074 }, -{ 0xB075, 0xB075, 0xB075 }, -{ 0xB076, 0xB076, 0xB076 }, -{ 0xB077, 0xB077, 0xB077 }, -{ 0xB078, 0xB078, 0xB078 }, -{ 0xB079, 0xB079, 0xB079 }, -{ 0xB07A, 0xB07A, 0xB07A }, -{ 0xB07B, 0xB07B, 0xB07B }, -{ 0xB07C, 0xB07C, 0xB07C }, -{ 0xB07D, 0xB07D, 0xB07D }, -{ 0xB07E, 0xB07E, 0xB07E }, -{ 0xB07F, 0xB07F, 0xB07F }, -{ 0xB080, 0xB080, 0xB080 }, -{ 0xB081, 0xB081, 0xB081 }, -{ 0xB082, 0xB082, 0xB082 }, -{ 0xB083, 0xB083, 0xB083 }, -{ 0xB084, 0xB084, 0xB084 }, -{ 0xB085, 0xB085, 0xB085 }, -{ 0xB086, 0xB086, 0xB086 }, -{ 0xB087, 0xB087, 0xB087 }, -{ 0xB088, 0xB088, 0xB088 }, -{ 0xB089, 0xB089, 0xB089 }, -{ 0xB08A, 0xB08A, 0xB08A }, -{ 0xB08B, 0xB08B, 0xB08B }, -{ 0xB08C, 0xB08C, 0xB08C }, -{ 0xB08D, 0xB08D, 0xB08D }, -{ 0xB08E, 0xB08E, 0xB08E }, -{ 0xB08F, 0xB08F, 0xB08F }, -{ 0xB090, 0xB090, 0xB090 }, -{ 0xB091, 0xB091, 0xB091 }, -{ 0xB092, 0xB092, 0xB092 }, -{ 0xB093, 0xB093, 0xB093 }, -{ 0xB094, 0xB094, 0xB094 }, -{ 0xB095, 0xB095, 0xB095 }, -{ 0xB096, 0xB096, 0xB096 }, -{ 0xB097, 0xB097, 0xB097 }, -{ 0xB098, 0xB098, 0xB098 }, -{ 0xB099, 0xB099, 0xB099 }, -{ 0xB09A, 0xB09A, 0xB09A }, -{ 0xB09B, 0xB09B, 0xB09B }, -{ 0xB09C, 0xB09C, 0xB09C }, -{ 0xB09D, 0xB09D, 0xB09D }, -{ 0xB09E, 0xB09E, 0xB09E }, -{ 0xB09F, 0xB09F, 0xB09F }, -{ 0xB0A0, 0xB0A0, 0xB0A0 }, -{ 0xB0A1, 0xB0A1, 0xB0A1 }, -{ 0xB0A2, 0xB0A2, 0xB0A2 }, -{ 0xB0A3, 0xB0A3, 0xB0A3 }, -{ 0xB0A4, 0xB0A4, 0xB0A4 }, -{ 0xB0A5, 0xB0A5, 0xB0A5 }, -{ 0xB0A6, 0xB0A6, 0xB0A6 }, -{ 0xB0A7, 0xB0A7, 0xB0A7 }, -{ 0xB0A8, 0xB0A8, 0xB0A8 }, -{ 0xB0A9, 0xB0A9, 0xB0A9 }, -{ 0xB0AA, 0xB0AA, 0xB0AA }, -{ 0xB0AB, 0xB0AB, 0xB0AB }, -{ 0xB0AC, 0xB0AC, 0xB0AC }, -{ 0xB0AD, 0xB0AD, 0xB0AD }, -{ 0xB0AE, 0xB0AE, 0xB0AE }, -{ 0xB0AF, 0xB0AF, 0xB0AF }, -{ 0xB0B0, 0xB0B0, 0xB0B0 }, -{ 0xB0B1, 0xB0B1, 0xB0B1 }, -{ 0xB0B2, 0xB0B2, 0xB0B2 }, -{ 0xB0B3, 0xB0B3, 0xB0B3 }, -{ 0xB0B4, 0xB0B4, 0xB0B4 }, -{ 0xB0B5, 0xB0B5, 0xB0B5 }, -{ 0xB0B6, 0xB0B6, 0xB0B6 }, -{ 0xB0B7, 0xB0B7, 0xB0B7 }, -{ 0xB0B8, 0xB0B8, 0xB0B8 }, -{ 0xB0B9, 0xB0B9, 0xB0B9 }, -{ 0xB0BA, 0xB0BA, 0xB0BA }, -{ 0xB0BB, 0xB0BB, 0xB0BB }, -{ 0xB0BC, 0xB0BC, 0xB0BC }, -{ 0xB0BD, 0xB0BD, 0xB0BD }, -{ 0xB0BE, 0xB0BE, 0xB0BE }, -{ 0xB0BF, 0xB0BF, 0xB0BF }, -{ 0xB0C0, 0xB0C0, 0xB0C0 }, -{ 0xB0C1, 0xB0C1, 0xB0C1 }, -{ 0xB0C2, 0xB0C2, 0xB0C2 }, -{ 0xB0C3, 0xB0C3, 0xB0C3 }, -{ 0xB0C4, 0xB0C4, 0xB0C4 }, -{ 0xB0C5, 0xB0C5, 0xB0C5 }, -{ 0xB0C6, 0xB0C6, 0xB0C6 }, -{ 0xB0C7, 0xB0C7, 0xB0C7 }, -{ 0xB0C8, 0xB0C8, 0xB0C8 }, -{ 0xB0C9, 0xB0C9, 0xB0C9 }, -{ 0xB0CA, 0xB0CA, 0xB0CA }, -{ 0xB0CB, 0xB0CB, 0xB0CB }, -{ 0xB0CC, 0xB0CC, 0xB0CC }, -{ 0xB0CD, 0xB0CD, 0xB0CD }, -{ 0xB0CE, 0xB0CE, 0xB0CE }, -{ 0xB0CF, 0xB0CF, 0xB0CF }, -{ 0xB0D0, 0xB0D0, 0xB0D0 }, -{ 0xB0D1, 0xB0D1, 0xB0D1 }, -{ 0xB0D2, 0xB0D2, 0xB0D2 }, -{ 0xB0D3, 0xB0D3, 0xB0D3 }, -{ 0xB0D4, 0xB0D4, 0xB0D4 }, -{ 0xB0D5, 0xB0D5, 0xB0D5 }, -{ 0xB0D6, 0xB0D6, 0xB0D6 }, -{ 0xB0D7, 0xB0D7, 0xB0D7 }, -{ 0xB0D8, 0xB0D8, 0xB0D8 }, -{ 0xB0D9, 0xB0D9, 0xB0D9 }, -{ 0xB0DA, 0xB0DA, 0xB0DA }, -{ 0xB0DB, 0xB0DB, 0xB0DB }, -{ 0xB0DC, 0xB0DC, 0xB0DC }, -{ 0xB0DD, 0xB0DD, 0xB0DD }, -{ 0xB0DE, 0xB0DE, 0xB0DE }, -{ 0xB0DF, 0xB0DF, 0xB0DF }, -{ 0xB0E0, 0xB0E0, 0xB0E0 }, -{ 0xB0E1, 0xB0E1, 0xB0E1 }, -{ 0xB0E2, 0xB0E2, 0xB0E2 }, -{ 0xB0E3, 0xB0E3, 0xB0E3 }, -{ 0xB0E4, 0xB0E4, 0xB0E4 }, -{ 0xB0E5, 0xB0E5, 0xB0E5 }, -{ 0xB0E6, 0xB0E6, 0xB0E6 }, -{ 0xB0E7, 0xB0E7, 0xB0E7 }, -{ 0xB0E8, 0xB0E8, 0xB0E8 }, -{ 0xB0E9, 0xB0E9, 0xB0E9 }, -{ 0xB0EA, 0xB0EA, 0xB0EA }, -{ 0xB0EB, 0xB0EB, 0xB0EB }, -{ 0xB0EC, 0xB0EC, 0xB0EC }, -{ 0xB0ED, 0xB0ED, 0xB0ED }, -{ 0xB0EE, 0xB0EE, 0xB0EE }, -{ 0xB0EF, 0xB0EF, 0xB0EF }, -{ 0xB0F0, 0xB0F0, 0xB0F0 }, -{ 0xB0F1, 0xB0F1, 0xB0F1 }, -{ 0xB0F2, 0xB0F2, 0xB0F2 }, -{ 0xB0F3, 0xB0F3, 0xB0F3 }, -{ 0xB0F4, 0xB0F4, 0xB0F4 }, -{ 0xB0F5, 0xB0F5, 0xB0F5 }, -{ 0xB0F6, 0xB0F6, 0xB0F6 }, -{ 0xB0F7, 0xB0F7, 0xB0F7 }, -{ 0xB0F8, 0xB0F8, 0xB0F8 }, -{ 0xB0F9, 0xB0F9, 0xB0F9 }, -{ 0xB0FA, 0xB0FA, 0xB0FA }, -{ 0xB0FB, 0xB0FB, 0xB0FB }, -{ 0xB0FC, 0xB0FC, 0xB0FC }, -{ 0xB0FD, 0xB0FD, 0xB0FD }, -{ 0xB0FE, 0xB0FE, 0xB0FE }, -{ 0xB0FF, 0xB0FF, 0xB0FF }, -{ 0xB100, 0xB100, 0xB100 }, -{ 0xB101, 0xB101, 0xB101 }, -{ 0xB102, 0xB102, 0xB102 }, -{ 0xB103, 0xB103, 0xB103 }, -{ 0xB104, 0xB104, 0xB104 }, -{ 0xB105, 0xB105, 0xB105 }, -{ 0xB106, 0xB106, 0xB106 }, -{ 0xB107, 0xB107, 0xB107 }, -{ 0xB108, 0xB108, 0xB108 }, -{ 0xB109, 0xB109, 0xB109 }, -{ 0xB10A, 0xB10A, 0xB10A }, -{ 0xB10B, 0xB10B, 0xB10B }, -{ 0xB10C, 0xB10C, 0xB10C }, -{ 0xB10D, 0xB10D, 0xB10D }, -{ 0xB10E, 0xB10E, 0xB10E }, -{ 0xB10F, 0xB10F, 0xB10F }, -{ 0xB110, 0xB110, 0xB110 }, -{ 0xB111, 0xB111, 0xB111 }, -{ 0xB112, 0xB112, 0xB112 }, -{ 0xB113, 0xB113, 0xB113 }, -{ 0xB114, 0xB114, 0xB114 }, -{ 0xB115, 0xB115, 0xB115 }, -{ 0xB116, 0xB116, 0xB116 }, -{ 0xB117, 0xB117, 0xB117 }, -{ 0xB118, 0xB118, 0xB118 }, -{ 0xB119, 0xB119, 0xB119 }, -{ 0xB11A, 0xB11A, 0xB11A }, -{ 0xB11B, 0xB11B, 0xB11B }, -{ 0xB11C, 0xB11C, 0xB11C }, -{ 0xB11D, 0xB11D, 0xB11D }, -{ 0xB11E, 0xB11E, 0xB11E }, -{ 0xB11F, 0xB11F, 0xB11F }, -{ 0xB120, 0xB120, 0xB120 }, -{ 0xB121, 0xB121, 0xB121 }, -{ 0xB122, 0xB122, 0xB122 }, -{ 0xB123, 0xB123, 0xB123 }, -{ 0xB124, 0xB124, 0xB124 }, -{ 0xB125, 0xB125, 0xB125 }, -{ 0xB126, 0xB126, 0xB126 }, -{ 0xB127, 0xB127, 0xB127 }, -{ 0xB128, 0xB128, 0xB128 }, -{ 0xB129, 0xB129, 0xB129 }, -{ 0xB12A, 0xB12A, 0xB12A }, -{ 0xB12B, 0xB12B, 0xB12B }, -{ 0xB12C, 0xB12C, 0xB12C }, -{ 0xB12D, 0xB12D, 0xB12D }, -{ 0xB12E, 0xB12E, 0xB12E }, -{ 0xB12F, 0xB12F, 0xB12F }, -{ 0xB130, 0xB130, 0xB130 }, -{ 0xB131, 0xB131, 0xB131 }, -{ 0xB132, 0xB132, 0xB132 }, -{ 0xB133, 0xB133, 0xB133 }, -{ 0xB134, 0xB134, 0xB134 }, -{ 0xB135, 0xB135, 0xB135 }, -{ 0xB136, 0xB136, 0xB136 }, -{ 0xB137, 0xB137, 0xB137 }, -{ 0xB138, 0xB138, 0xB138 }, -{ 0xB139, 0xB139, 0xB139 }, -{ 0xB13A, 0xB13A, 0xB13A }, -{ 0xB13B, 0xB13B, 0xB13B }, -{ 0xB13C, 0xB13C, 0xB13C }, -{ 0xB13D, 0xB13D, 0xB13D }, -{ 0xB13E, 0xB13E, 0xB13E }, -{ 0xB13F, 0xB13F, 0xB13F }, -{ 0xB140, 0xB140, 0xB140 }, -{ 0xB141, 0xB141, 0xB141 }, -{ 0xB142, 0xB142, 0xB142 }, -{ 0xB143, 0xB143, 0xB143 }, -{ 0xB144, 0xB144, 0xB144 }, -{ 0xB145, 0xB145, 0xB145 }, -{ 0xB146, 0xB146, 0xB146 }, -{ 0xB147, 0xB147, 0xB147 }, -{ 0xB148, 0xB148, 0xB148 }, -{ 0xB149, 0xB149, 0xB149 }, -{ 0xB14A, 0xB14A, 0xB14A }, -{ 0xB14B, 0xB14B, 0xB14B }, -{ 0xB14C, 0xB14C, 0xB14C }, -{ 0xB14D, 0xB14D, 0xB14D }, -{ 0xB14E, 0xB14E, 0xB14E }, -{ 0xB14F, 0xB14F, 0xB14F }, -{ 0xB150, 0xB150, 0xB150 }, -{ 0xB151, 0xB151, 0xB151 }, -{ 0xB152, 0xB152, 0xB152 }, -{ 0xB153, 0xB153, 0xB153 }, -{ 0xB154, 0xB154, 0xB154 }, -{ 0xB155, 0xB155, 0xB155 }, -{ 0xB156, 0xB156, 0xB156 }, -{ 0xB157, 0xB157, 0xB157 }, -{ 0xB158, 0xB158, 0xB158 }, -{ 0xB159, 0xB159, 0xB159 }, -{ 0xB15A, 0xB15A, 0xB15A }, -{ 0xB15B, 0xB15B, 0xB15B }, -{ 0xB15C, 0xB15C, 0xB15C }, -{ 0xB15D, 0xB15D, 0xB15D }, -{ 0xB15E, 0xB15E, 0xB15E }, -{ 0xB15F, 0xB15F, 0xB15F }, -{ 0xB160, 0xB160, 0xB160 }, -{ 0xB161, 0xB161, 0xB161 }, -{ 0xB162, 0xB162, 0xB162 }, -{ 0xB163, 0xB163, 0xB163 }, -{ 0xB164, 0xB164, 0xB164 }, -{ 0xB165, 0xB165, 0xB165 }, -{ 0xB166, 0xB166, 0xB166 }, -{ 0xB167, 0xB167, 0xB167 }, -{ 0xB168, 0xB168, 0xB168 }, -{ 0xB169, 0xB169, 0xB169 }, -{ 0xB16A, 0xB16A, 0xB16A }, -{ 0xB16B, 0xB16B, 0xB16B }, -{ 0xB16C, 0xB16C, 0xB16C }, -{ 0xB16D, 0xB16D, 0xB16D }, -{ 0xB16E, 0xB16E, 0xB16E }, -{ 0xB16F, 0xB16F, 0xB16F }, -{ 0xB170, 0xB170, 0xB170 }, -{ 0xB171, 0xB171, 0xB171 }, -{ 0xB172, 0xB172, 0xB172 }, -{ 0xB173, 0xB173, 0xB173 }, -{ 0xB174, 0xB174, 0xB174 }, -{ 0xB175, 0xB175, 0xB175 }, -{ 0xB176, 0xB176, 0xB176 }, -{ 0xB177, 0xB177, 0xB177 }, -{ 0xB178, 0xB178, 0xB178 }, -{ 0xB179, 0xB179, 0xB179 }, -{ 0xB17A, 0xB17A, 0xB17A }, -{ 0xB17B, 0xB17B, 0xB17B }, -{ 0xB17C, 0xB17C, 0xB17C }, -{ 0xB17D, 0xB17D, 0xB17D }, -{ 0xB17E, 0xB17E, 0xB17E }, -{ 0xB17F, 0xB17F, 0xB17F }, -{ 0xB180, 0xB180, 0xB180 }, -{ 0xB181, 0xB181, 0xB181 }, -{ 0xB182, 0xB182, 0xB182 }, -{ 0xB183, 0xB183, 0xB183 }, -{ 0xB184, 0xB184, 0xB184 }, -{ 0xB185, 0xB185, 0xB185 }, -{ 0xB186, 0xB186, 0xB186 }, -{ 0xB187, 0xB187, 0xB187 }, -{ 0xB188, 0xB188, 0xB188 }, -{ 0xB189, 0xB189, 0xB189 }, -{ 0xB18A, 0xB18A, 0xB18A }, -{ 0xB18B, 0xB18B, 0xB18B }, -{ 0xB18C, 0xB18C, 0xB18C }, -{ 0xB18D, 0xB18D, 0xB18D }, -{ 0xB18E, 0xB18E, 0xB18E }, -{ 0xB18F, 0xB18F, 0xB18F }, -{ 0xB190, 0xB190, 0xB190 }, -{ 0xB191, 0xB191, 0xB191 }, -{ 0xB192, 0xB192, 0xB192 }, -{ 0xB193, 0xB193, 0xB193 }, -{ 0xB194, 0xB194, 0xB194 }, -{ 0xB195, 0xB195, 0xB195 }, -{ 0xB196, 0xB196, 0xB196 }, -{ 0xB197, 0xB197, 0xB197 }, -{ 0xB198, 0xB198, 0xB198 }, -{ 0xB199, 0xB199, 0xB199 }, -{ 0xB19A, 0xB19A, 0xB19A }, -{ 0xB19B, 0xB19B, 0xB19B }, -{ 0xB19C, 0xB19C, 0xB19C }, -{ 0xB19D, 0xB19D, 0xB19D }, -{ 0xB19E, 0xB19E, 0xB19E }, -{ 0xB19F, 0xB19F, 0xB19F }, -{ 0xB1A0, 0xB1A0, 0xB1A0 }, -{ 0xB1A1, 0xB1A1, 0xB1A1 }, -{ 0xB1A2, 0xB1A2, 0xB1A2 }, -{ 0xB1A3, 0xB1A3, 0xB1A3 }, -{ 0xB1A4, 0xB1A4, 0xB1A4 }, -{ 0xB1A5, 0xB1A5, 0xB1A5 }, -{ 0xB1A6, 0xB1A6, 0xB1A6 }, -{ 0xB1A7, 0xB1A7, 0xB1A7 }, -{ 0xB1A8, 0xB1A8, 0xB1A8 }, -{ 0xB1A9, 0xB1A9, 0xB1A9 }, -{ 0xB1AA, 0xB1AA, 0xB1AA }, -{ 0xB1AB, 0xB1AB, 0xB1AB }, -{ 0xB1AC, 0xB1AC, 0xB1AC }, -{ 0xB1AD, 0xB1AD, 0xB1AD }, -{ 0xB1AE, 0xB1AE, 0xB1AE }, -{ 0xB1AF, 0xB1AF, 0xB1AF }, -{ 0xB1B0, 0xB1B0, 0xB1B0 }, -{ 0xB1B1, 0xB1B1, 0xB1B1 }, -{ 0xB1B2, 0xB1B2, 0xB1B2 }, -{ 0xB1B3, 0xB1B3, 0xB1B3 }, -{ 0xB1B4, 0xB1B4, 0xB1B4 }, -{ 0xB1B5, 0xB1B5, 0xB1B5 }, -{ 0xB1B6, 0xB1B6, 0xB1B6 }, -{ 0xB1B7, 0xB1B7, 0xB1B7 }, -{ 0xB1B8, 0xB1B8, 0xB1B8 }, -{ 0xB1B9, 0xB1B9, 0xB1B9 }, -{ 0xB1BA, 0xB1BA, 0xB1BA }, -{ 0xB1BB, 0xB1BB, 0xB1BB }, -{ 0xB1BC, 0xB1BC, 0xB1BC }, -{ 0xB1BD, 0xB1BD, 0xB1BD }, -{ 0xB1BE, 0xB1BE, 0xB1BE }, -{ 0xB1BF, 0xB1BF, 0xB1BF }, -{ 0xB1C0, 0xB1C0, 0xB1C0 }, -{ 0xB1C1, 0xB1C1, 0xB1C1 }, -{ 0xB1C2, 0xB1C2, 0xB1C2 }, -{ 0xB1C3, 0xB1C3, 0xB1C3 }, -{ 0xB1C4, 0xB1C4, 0xB1C4 }, -{ 0xB1C5, 0xB1C5, 0xB1C5 }, -{ 0xB1C6, 0xB1C6, 0xB1C6 }, -{ 0xB1C7, 0xB1C7, 0xB1C7 }, -{ 0xB1C8, 0xB1C8, 0xB1C8 }, -{ 0xB1C9, 0xB1C9, 0xB1C9 }, -{ 0xB1CA, 0xB1CA, 0xB1CA }, -{ 0xB1CB, 0xB1CB, 0xB1CB }, -{ 0xB1CC, 0xB1CC, 0xB1CC }, -{ 0xB1CD, 0xB1CD, 0xB1CD }, -{ 0xB1CE, 0xB1CE, 0xB1CE }, -{ 0xB1CF, 0xB1CF, 0xB1CF }, -{ 0xB1D0, 0xB1D0, 0xB1D0 }, -{ 0xB1D1, 0xB1D1, 0xB1D1 }, -{ 0xB1D2, 0xB1D2, 0xB1D2 }, -{ 0xB1D3, 0xB1D3, 0xB1D3 }, -{ 0xB1D4, 0xB1D4, 0xB1D4 }, -{ 0xB1D5, 0xB1D5, 0xB1D5 }, -{ 0xB1D6, 0xB1D6, 0xB1D6 }, -{ 0xB1D7, 0xB1D7, 0xB1D7 }, -{ 0xB1D8, 0xB1D8, 0xB1D8 }, -{ 0xB1D9, 0xB1D9, 0xB1D9 }, -{ 0xB1DA, 0xB1DA, 0xB1DA }, -{ 0xB1DB, 0xB1DB, 0xB1DB }, -{ 0xB1DC, 0xB1DC, 0xB1DC }, -{ 0xB1DD, 0xB1DD, 0xB1DD }, -{ 0xB1DE, 0xB1DE, 0xB1DE }, -{ 0xB1DF, 0xB1DF, 0xB1DF }, -{ 0xB1E0, 0xB1E0, 0xB1E0 }, -{ 0xB1E1, 0xB1E1, 0xB1E1 }, -{ 0xB1E2, 0xB1E2, 0xB1E2 }, -{ 0xB1E3, 0xB1E3, 0xB1E3 }, -{ 0xB1E4, 0xB1E4, 0xB1E4 }, -{ 0xB1E5, 0xB1E5, 0xB1E5 }, -{ 0xB1E6, 0xB1E6, 0xB1E6 }, -{ 0xB1E7, 0xB1E7, 0xB1E7 }, -{ 0xB1E8, 0xB1E8, 0xB1E8 }, -{ 0xB1E9, 0xB1E9, 0xB1E9 }, -{ 0xB1EA, 0xB1EA, 0xB1EA }, -{ 0xB1EB, 0xB1EB, 0xB1EB }, -{ 0xB1EC, 0xB1EC, 0xB1EC }, -{ 0xB1ED, 0xB1ED, 0xB1ED }, -{ 0xB1EE, 0xB1EE, 0xB1EE }, -{ 0xB1EF, 0xB1EF, 0xB1EF }, -{ 0xB1F0, 0xB1F0, 0xB1F0 }, -{ 0xB1F1, 0xB1F1, 0xB1F1 }, -{ 0xB1F2, 0xB1F2, 0xB1F2 }, -{ 0xB1F3, 0xB1F3, 0xB1F3 }, -{ 0xB1F4, 0xB1F4, 0xB1F4 }, -{ 0xB1F5, 0xB1F5, 0xB1F5 }, -{ 0xB1F6, 0xB1F6, 0xB1F6 }, -{ 0xB1F7, 0xB1F7, 0xB1F7 }, -{ 0xB1F8, 0xB1F8, 0xB1F8 }, -{ 0xB1F9, 0xB1F9, 0xB1F9 }, -{ 0xB1FA, 0xB1FA, 0xB1FA }, -{ 0xB1FB, 0xB1FB, 0xB1FB }, -{ 0xB1FC, 0xB1FC, 0xB1FC }, -{ 0xB1FD, 0xB1FD, 0xB1FD }, -{ 0xB1FE, 0xB1FE, 0xB1FE }, -{ 0xB1FF, 0xB1FF, 0xB1FF }, -{ 0xB200, 0xB200, 0xB200 }, -{ 0xB201, 0xB201, 0xB201 }, -{ 0xB202, 0xB202, 0xB202 }, -{ 0xB203, 0xB203, 0xB203 }, -{ 0xB204, 0xB204, 0xB204 }, -{ 0xB205, 0xB205, 0xB205 }, -{ 0xB206, 0xB206, 0xB206 }, -{ 0xB207, 0xB207, 0xB207 }, -{ 0xB208, 0xB208, 0xB208 }, -{ 0xB209, 0xB209, 0xB209 }, -{ 0xB20A, 0xB20A, 0xB20A }, -{ 0xB20B, 0xB20B, 0xB20B }, -{ 0xB20C, 0xB20C, 0xB20C }, -{ 0xB20D, 0xB20D, 0xB20D }, -{ 0xB20E, 0xB20E, 0xB20E }, -{ 0xB20F, 0xB20F, 0xB20F }, -{ 0xB210, 0xB210, 0xB210 }, -{ 0xB211, 0xB211, 0xB211 }, -{ 0xB212, 0xB212, 0xB212 }, -{ 0xB213, 0xB213, 0xB213 }, -{ 0xB214, 0xB214, 0xB214 }, -{ 0xB215, 0xB215, 0xB215 }, -{ 0xB216, 0xB216, 0xB216 }, -{ 0xB217, 0xB217, 0xB217 }, -{ 0xB218, 0xB218, 0xB218 }, -{ 0xB219, 0xB219, 0xB219 }, -{ 0xB21A, 0xB21A, 0xB21A }, -{ 0xB21B, 0xB21B, 0xB21B }, -{ 0xB21C, 0xB21C, 0xB21C }, -{ 0xB21D, 0xB21D, 0xB21D }, -{ 0xB21E, 0xB21E, 0xB21E }, -{ 0xB21F, 0xB21F, 0xB21F }, -{ 0xB220, 0xB220, 0xB220 }, -{ 0xB221, 0xB221, 0xB221 }, -{ 0xB222, 0xB222, 0xB222 }, -{ 0xB223, 0xB223, 0xB223 }, -{ 0xB224, 0xB224, 0xB224 }, -{ 0xB225, 0xB225, 0xB225 }, -{ 0xB226, 0xB226, 0xB226 }, -{ 0xB227, 0xB227, 0xB227 }, -{ 0xB228, 0xB228, 0xB228 }, -{ 0xB229, 0xB229, 0xB229 }, -{ 0xB22A, 0xB22A, 0xB22A }, -{ 0xB22B, 0xB22B, 0xB22B }, -{ 0xB22C, 0xB22C, 0xB22C }, -{ 0xB22D, 0xB22D, 0xB22D }, -{ 0xB22E, 0xB22E, 0xB22E }, -{ 0xB22F, 0xB22F, 0xB22F }, -{ 0xB230, 0xB230, 0xB230 }, -{ 0xB231, 0xB231, 0xB231 }, -{ 0xB232, 0xB232, 0xB232 }, -{ 0xB233, 0xB233, 0xB233 }, -{ 0xB234, 0xB234, 0xB234 }, -{ 0xB235, 0xB235, 0xB235 }, -{ 0xB236, 0xB236, 0xB236 }, -{ 0xB237, 0xB237, 0xB237 }, -{ 0xB238, 0xB238, 0xB238 }, -{ 0xB239, 0xB239, 0xB239 }, -{ 0xB23A, 0xB23A, 0xB23A }, -{ 0xB23B, 0xB23B, 0xB23B }, -{ 0xB23C, 0xB23C, 0xB23C }, -{ 0xB23D, 0xB23D, 0xB23D }, -{ 0xB23E, 0xB23E, 0xB23E }, -{ 0xB23F, 0xB23F, 0xB23F }, -{ 0xB240, 0xB240, 0xB240 }, -{ 0xB241, 0xB241, 0xB241 }, -{ 0xB242, 0xB242, 0xB242 }, -{ 0xB243, 0xB243, 0xB243 }, -{ 0xB244, 0xB244, 0xB244 }, -{ 0xB245, 0xB245, 0xB245 }, -{ 0xB246, 0xB246, 0xB246 }, -{ 0xB247, 0xB247, 0xB247 }, -{ 0xB248, 0xB248, 0xB248 }, -{ 0xB249, 0xB249, 0xB249 }, -{ 0xB24A, 0xB24A, 0xB24A }, -{ 0xB24B, 0xB24B, 0xB24B }, -{ 0xB24C, 0xB24C, 0xB24C }, -{ 0xB24D, 0xB24D, 0xB24D }, -{ 0xB24E, 0xB24E, 0xB24E }, -{ 0xB24F, 0xB24F, 0xB24F }, -{ 0xB250, 0xB250, 0xB250 }, -{ 0xB251, 0xB251, 0xB251 }, -{ 0xB252, 0xB252, 0xB252 }, -{ 0xB253, 0xB253, 0xB253 }, -{ 0xB254, 0xB254, 0xB254 }, -{ 0xB255, 0xB255, 0xB255 }, -{ 0xB256, 0xB256, 0xB256 }, -{ 0xB257, 0xB257, 0xB257 }, -{ 0xB258, 0xB258, 0xB258 }, -{ 0xB259, 0xB259, 0xB259 }, -{ 0xB25A, 0xB25A, 0xB25A }, -{ 0xB25B, 0xB25B, 0xB25B }, -{ 0xB25C, 0xB25C, 0xB25C }, -{ 0xB25D, 0xB25D, 0xB25D }, -{ 0xB25E, 0xB25E, 0xB25E }, -{ 0xB25F, 0xB25F, 0xB25F }, -{ 0xB260, 0xB260, 0xB260 }, -{ 0xB261, 0xB261, 0xB261 }, -{ 0xB262, 0xB262, 0xB262 }, -{ 0xB263, 0xB263, 0xB263 }, -{ 0xB264, 0xB264, 0xB264 }, -{ 0xB265, 0xB265, 0xB265 }, -{ 0xB266, 0xB266, 0xB266 }, -{ 0xB267, 0xB267, 0xB267 }, -{ 0xB268, 0xB268, 0xB268 }, -{ 0xB269, 0xB269, 0xB269 }, -{ 0xB26A, 0xB26A, 0xB26A }, -{ 0xB26B, 0xB26B, 0xB26B }, -{ 0xB26C, 0xB26C, 0xB26C }, -{ 0xB26D, 0xB26D, 0xB26D }, -{ 0xB26E, 0xB26E, 0xB26E }, -{ 0xB26F, 0xB26F, 0xB26F }, -{ 0xB270, 0xB270, 0xB270 }, -{ 0xB271, 0xB271, 0xB271 }, -{ 0xB272, 0xB272, 0xB272 }, -{ 0xB273, 0xB273, 0xB273 }, -{ 0xB274, 0xB274, 0xB274 }, -{ 0xB275, 0xB275, 0xB275 }, -{ 0xB276, 0xB276, 0xB276 }, -{ 0xB277, 0xB277, 0xB277 }, -{ 0xB278, 0xB278, 0xB278 }, -{ 0xB279, 0xB279, 0xB279 }, -{ 0xB27A, 0xB27A, 0xB27A }, -{ 0xB27B, 0xB27B, 0xB27B }, -{ 0xB27C, 0xB27C, 0xB27C }, -{ 0xB27D, 0xB27D, 0xB27D }, -{ 0xB27E, 0xB27E, 0xB27E }, -{ 0xB27F, 0xB27F, 0xB27F }, -{ 0xB280, 0xB280, 0xB280 }, -{ 0xB281, 0xB281, 0xB281 }, -{ 0xB282, 0xB282, 0xB282 }, -{ 0xB283, 0xB283, 0xB283 }, -{ 0xB284, 0xB284, 0xB284 }, -{ 0xB285, 0xB285, 0xB285 }, -{ 0xB286, 0xB286, 0xB286 }, -{ 0xB287, 0xB287, 0xB287 }, -{ 0xB288, 0xB288, 0xB288 }, -{ 0xB289, 0xB289, 0xB289 }, -{ 0xB28A, 0xB28A, 0xB28A }, -{ 0xB28B, 0xB28B, 0xB28B }, -{ 0xB28C, 0xB28C, 0xB28C }, -{ 0xB28D, 0xB28D, 0xB28D }, -{ 0xB28E, 0xB28E, 0xB28E }, -{ 0xB28F, 0xB28F, 0xB28F }, -{ 0xB290, 0xB290, 0xB290 }, -{ 0xB291, 0xB291, 0xB291 }, -{ 0xB292, 0xB292, 0xB292 }, -{ 0xB293, 0xB293, 0xB293 }, -{ 0xB294, 0xB294, 0xB294 }, -{ 0xB295, 0xB295, 0xB295 }, -{ 0xB296, 0xB296, 0xB296 }, -{ 0xB297, 0xB297, 0xB297 }, -{ 0xB298, 0xB298, 0xB298 }, -{ 0xB299, 0xB299, 0xB299 }, -{ 0xB29A, 0xB29A, 0xB29A }, -{ 0xB29B, 0xB29B, 0xB29B }, -{ 0xB29C, 0xB29C, 0xB29C }, -{ 0xB29D, 0xB29D, 0xB29D }, -{ 0xB29E, 0xB29E, 0xB29E }, -{ 0xB29F, 0xB29F, 0xB29F }, -{ 0xB2A0, 0xB2A0, 0xB2A0 }, -{ 0xB2A1, 0xB2A1, 0xB2A1 }, -{ 0xB2A2, 0xB2A2, 0xB2A2 }, -{ 0xB2A3, 0xB2A3, 0xB2A3 }, -{ 0xB2A4, 0xB2A4, 0xB2A4 }, -{ 0xB2A5, 0xB2A5, 0xB2A5 }, -{ 0xB2A6, 0xB2A6, 0xB2A6 }, -{ 0xB2A7, 0xB2A7, 0xB2A7 }, -{ 0xB2A8, 0xB2A8, 0xB2A8 }, -{ 0xB2A9, 0xB2A9, 0xB2A9 }, -{ 0xB2AA, 0xB2AA, 0xB2AA }, -{ 0xB2AB, 0xB2AB, 0xB2AB }, -{ 0xB2AC, 0xB2AC, 0xB2AC }, -{ 0xB2AD, 0xB2AD, 0xB2AD }, -{ 0xB2AE, 0xB2AE, 0xB2AE }, -{ 0xB2AF, 0xB2AF, 0xB2AF }, -{ 0xB2B0, 0xB2B0, 0xB2B0 }, -{ 0xB2B1, 0xB2B1, 0xB2B1 }, -{ 0xB2B2, 0xB2B2, 0xB2B2 }, -{ 0xB2B3, 0xB2B3, 0xB2B3 }, -{ 0xB2B4, 0xB2B4, 0xB2B4 }, -{ 0xB2B5, 0xB2B5, 0xB2B5 }, -{ 0xB2B6, 0xB2B6, 0xB2B6 }, -{ 0xB2B7, 0xB2B7, 0xB2B7 }, -{ 0xB2B8, 0xB2B8, 0xB2B8 }, -{ 0xB2B9, 0xB2B9, 0xB2B9 }, -{ 0xB2BA, 0xB2BA, 0xB2BA }, -{ 0xB2BB, 0xB2BB, 0xB2BB }, -{ 0xB2BC, 0xB2BC, 0xB2BC }, -{ 0xB2BD, 0xB2BD, 0xB2BD }, -{ 0xB2BE, 0xB2BE, 0xB2BE }, -{ 0xB2BF, 0xB2BF, 0xB2BF }, -{ 0xB2C0, 0xB2C0, 0xB2C0 }, -{ 0xB2C1, 0xB2C1, 0xB2C1 }, -{ 0xB2C2, 0xB2C2, 0xB2C2 }, -{ 0xB2C3, 0xB2C3, 0xB2C3 }, -{ 0xB2C4, 0xB2C4, 0xB2C4 }, -{ 0xB2C5, 0xB2C5, 0xB2C5 }, -{ 0xB2C6, 0xB2C6, 0xB2C6 }, -{ 0xB2C7, 0xB2C7, 0xB2C7 }, -{ 0xB2C8, 0xB2C8, 0xB2C8 }, -{ 0xB2C9, 0xB2C9, 0xB2C9 }, -{ 0xB2CA, 0xB2CA, 0xB2CA }, -{ 0xB2CB, 0xB2CB, 0xB2CB }, -{ 0xB2CC, 0xB2CC, 0xB2CC }, -{ 0xB2CD, 0xB2CD, 0xB2CD }, -{ 0xB2CE, 0xB2CE, 0xB2CE }, -{ 0xB2CF, 0xB2CF, 0xB2CF }, -{ 0xB2D0, 0xB2D0, 0xB2D0 }, -{ 0xB2D1, 0xB2D1, 0xB2D1 }, -{ 0xB2D2, 0xB2D2, 0xB2D2 }, -{ 0xB2D3, 0xB2D3, 0xB2D3 }, -{ 0xB2D4, 0xB2D4, 0xB2D4 }, -{ 0xB2D5, 0xB2D5, 0xB2D5 }, -{ 0xB2D6, 0xB2D6, 0xB2D6 }, -{ 0xB2D7, 0xB2D7, 0xB2D7 }, -{ 0xB2D8, 0xB2D8, 0xB2D8 }, -{ 0xB2D9, 0xB2D9, 0xB2D9 }, -{ 0xB2DA, 0xB2DA, 0xB2DA }, -{ 0xB2DB, 0xB2DB, 0xB2DB }, -{ 0xB2DC, 0xB2DC, 0xB2DC }, -{ 0xB2DD, 0xB2DD, 0xB2DD }, -{ 0xB2DE, 0xB2DE, 0xB2DE }, -{ 0xB2DF, 0xB2DF, 0xB2DF }, -{ 0xB2E0, 0xB2E0, 0xB2E0 }, -{ 0xB2E1, 0xB2E1, 0xB2E1 }, -{ 0xB2E2, 0xB2E2, 0xB2E2 }, -{ 0xB2E3, 0xB2E3, 0xB2E3 }, -{ 0xB2E4, 0xB2E4, 0xB2E4 }, -{ 0xB2E5, 0xB2E5, 0xB2E5 }, -{ 0xB2E6, 0xB2E6, 0xB2E6 }, -{ 0xB2E7, 0xB2E7, 0xB2E7 }, -{ 0xB2E8, 0xB2E8, 0xB2E8 }, -{ 0xB2E9, 0xB2E9, 0xB2E9 }, -{ 0xB2EA, 0xB2EA, 0xB2EA }, -{ 0xB2EB, 0xB2EB, 0xB2EB }, -{ 0xB2EC, 0xB2EC, 0xB2EC }, -{ 0xB2ED, 0xB2ED, 0xB2ED }, -{ 0xB2EE, 0xB2EE, 0xB2EE }, -{ 0xB2EF, 0xB2EF, 0xB2EF }, -{ 0xB2F0, 0xB2F0, 0xB2F0 }, -{ 0xB2F1, 0xB2F1, 0xB2F1 }, -{ 0xB2F2, 0xB2F2, 0xB2F2 }, -{ 0xB2F3, 0xB2F3, 0xB2F3 }, -{ 0xB2F4, 0xB2F4, 0xB2F4 }, -{ 0xB2F5, 0xB2F5, 0xB2F5 }, -{ 0xB2F6, 0xB2F6, 0xB2F6 }, -{ 0xB2F7, 0xB2F7, 0xB2F7 }, -{ 0xB2F8, 0xB2F8, 0xB2F8 }, -{ 0xB2F9, 0xB2F9, 0xB2F9 }, -{ 0xB2FA, 0xB2FA, 0xB2FA }, -{ 0xB2FB, 0xB2FB, 0xB2FB }, -{ 0xB2FC, 0xB2FC, 0xB2FC }, -{ 0xB2FD, 0xB2FD, 0xB2FD }, -{ 0xB2FE, 0xB2FE, 0xB2FE }, -{ 0xB2FF, 0xB2FF, 0xB2FF }, -{ 0xB300, 0xB300, 0xB300 }, -{ 0xB301, 0xB301, 0xB301 }, -{ 0xB302, 0xB302, 0xB302 }, -{ 0xB303, 0xB303, 0xB303 }, -{ 0xB304, 0xB304, 0xB304 }, -{ 0xB305, 0xB305, 0xB305 }, -{ 0xB306, 0xB306, 0xB306 }, -{ 0xB307, 0xB307, 0xB307 }, -{ 0xB308, 0xB308, 0xB308 }, -{ 0xB309, 0xB309, 0xB309 }, -{ 0xB30A, 0xB30A, 0xB30A }, -{ 0xB30B, 0xB30B, 0xB30B }, -{ 0xB30C, 0xB30C, 0xB30C }, -{ 0xB30D, 0xB30D, 0xB30D }, -{ 0xB30E, 0xB30E, 0xB30E }, -{ 0xB30F, 0xB30F, 0xB30F }, -{ 0xB310, 0xB310, 0xB310 }, -{ 0xB311, 0xB311, 0xB311 }, -{ 0xB312, 0xB312, 0xB312 }, -{ 0xB313, 0xB313, 0xB313 }, -{ 0xB314, 0xB314, 0xB314 }, -{ 0xB315, 0xB315, 0xB315 }, -{ 0xB316, 0xB316, 0xB316 }, -{ 0xB317, 0xB317, 0xB317 }, -{ 0xB318, 0xB318, 0xB318 }, -{ 0xB319, 0xB319, 0xB319 }, -{ 0xB31A, 0xB31A, 0xB31A }, -{ 0xB31B, 0xB31B, 0xB31B }, -{ 0xB31C, 0xB31C, 0xB31C }, -{ 0xB31D, 0xB31D, 0xB31D }, -{ 0xB31E, 0xB31E, 0xB31E }, -{ 0xB31F, 0xB31F, 0xB31F }, -{ 0xB320, 0xB320, 0xB320 }, -{ 0xB321, 0xB321, 0xB321 }, -{ 0xB322, 0xB322, 0xB322 }, -{ 0xB323, 0xB323, 0xB323 }, -{ 0xB324, 0xB324, 0xB324 }, -{ 0xB325, 0xB325, 0xB325 }, -{ 0xB326, 0xB326, 0xB326 }, -{ 0xB327, 0xB327, 0xB327 }, -{ 0xB328, 0xB328, 0xB328 }, -{ 0xB329, 0xB329, 0xB329 }, -{ 0xB32A, 0xB32A, 0xB32A }, -{ 0xB32B, 0xB32B, 0xB32B }, -{ 0xB32C, 0xB32C, 0xB32C }, -{ 0xB32D, 0xB32D, 0xB32D }, -{ 0xB32E, 0xB32E, 0xB32E }, -{ 0xB32F, 0xB32F, 0xB32F }, -{ 0xB330, 0xB330, 0xB330 }, -{ 0xB331, 0xB331, 0xB331 }, -{ 0xB332, 0xB332, 0xB332 }, -{ 0xB333, 0xB333, 0xB333 }, -{ 0xB334, 0xB334, 0xB334 }, -{ 0xB335, 0xB335, 0xB335 }, -{ 0xB336, 0xB336, 0xB336 }, -{ 0xB337, 0xB337, 0xB337 }, -{ 0xB338, 0xB338, 0xB338 }, -{ 0xB339, 0xB339, 0xB339 }, -{ 0xB33A, 0xB33A, 0xB33A }, -{ 0xB33B, 0xB33B, 0xB33B }, -{ 0xB33C, 0xB33C, 0xB33C }, -{ 0xB33D, 0xB33D, 0xB33D }, -{ 0xB33E, 0xB33E, 0xB33E }, -{ 0xB33F, 0xB33F, 0xB33F }, -{ 0xB340, 0xB340, 0xB340 }, -{ 0xB341, 0xB341, 0xB341 }, -{ 0xB342, 0xB342, 0xB342 }, -{ 0xB343, 0xB343, 0xB343 }, -{ 0xB344, 0xB344, 0xB344 }, -{ 0xB345, 0xB345, 0xB345 }, -{ 0xB346, 0xB346, 0xB346 }, -{ 0xB347, 0xB347, 0xB347 }, -{ 0xB348, 0xB348, 0xB348 }, -{ 0xB349, 0xB349, 0xB349 }, -{ 0xB34A, 0xB34A, 0xB34A }, -{ 0xB34B, 0xB34B, 0xB34B }, -{ 0xB34C, 0xB34C, 0xB34C }, -{ 0xB34D, 0xB34D, 0xB34D }, -{ 0xB34E, 0xB34E, 0xB34E }, -{ 0xB34F, 0xB34F, 0xB34F }, -{ 0xB350, 0xB350, 0xB350 }, -{ 0xB351, 0xB351, 0xB351 }, -{ 0xB352, 0xB352, 0xB352 }, -{ 0xB353, 0xB353, 0xB353 }, -{ 0xB354, 0xB354, 0xB354 }, -{ 0xB355, 0xB355, 0xB355 }, -{ 0xB356, 0xB356, 0xB356 }, -{ 0xB357, 0xB357, 0xB357 }, -{ 0xB358, 0xB358, 0xB358 }, -{ 0xB359, 0xB359, 0xB359 }, -{ 0xB35A, 0xB35A, 0xB35A }, -{ 0xB35B, 0xB35B, 0xB35B }, -{ 0xB35C, 0xB35C, 0xB35C }, -{ 0xB35D, 0xB35D, 0xB35D }, -{ 0xB35E, 0xB35E, 0xB35E }, -{ 0xB35F, 0xB35F, 0xB35F }, -{ 0xB360, 0xB360, 0xB360 }, -{ 0xB361, 0xB361, 0xB361 }, -{ 0xB362, 0xB362, 0xB362 }, -{ 0xB363, 0xB363, 0xB363 }, -{ 0xB364, 0xB364, 0xB364 }, -{ 0xB365, 0xB365, 0xB365 }, -{ 0xB366, 0xB366, 0xB366 }, -{ 0xB367, 0xB367, 0xB367 }, -{ 0xB368, 0xB368, 0xB368 }, -{ 0xB369, 0xB369, 0xB369 }, -{ 0xB36A, 0xB36A, 0xB36A }, -{ 0xB36B, 0xB36B, 0xB36B }, -{ 0xB36C, 0xB36C, 0xB36C }, -{ 0xB36D, 0xB36D, 0xB36D }, -{ 0xB36E, 0xB36E, 0xB36E }, -{ 0xB36F, 0xB36F, 0xB36F }, -{ 0xB370, 0xB370, 0xB370 }, -{ 0xB371, 0xB371, 0xB371 }, -{ 0xB372, 0xB372, 0xB372 }, -{ 0xB373, 0xB373, 0xB373 }, -{ 0xB374, 0xB374, 0xB374 }, -{ 0xB375, 0xB375, 0xB375 }, -{ 0xB376, 0xB376, 0xB376 }, -{ 0xB377, 0xB377, 0xB377 }, -{ 0xB378, 0xB378, 0xB378 }, -{ 0xB379, 0xB379, 0xB379 }, -{ 0xB37A, 0xB37A, 0xB37A }, -{ 0xB37B, 0xB37B, 0xB37B }, -{ 0xB37C, 0xB37C, 0xB37C }, -{ 0xB37D, 0xB37D, 0xB37D }, -{ 0xB37E, 0xB37E, 0xB37E }, -{ 0xB37F, 0xB37F, 0xB37F }, -{ 0xB380, 0xB380, 0xB380 }, -{ 0xB381, 0xB381, 0xB381 }, -{ 0xB382, 0xB382, 0xB382 }, -{ 0xB383, 0xB383, 0xB383 }, -{ 0xB384, 0xB384, 0xB384 }, -{ 0xB385, 0xB385, 0xB385 }, -{ 0xB386, 0xB386, 0xB386 }, -{ 0xB387, 0xB387, 0xB387 }, -{ 0xB388, 0xB388, 0xB388 }, -{ 0xB389, 0xB389, 0xB389 }, -{ 0xB38A, 0xB38A, 0xB38A }, -{ 0xB38B, 0xB38B, 0xB38B }, -{ 0xB38C, 0xB38C, 0xB38C }, -{ 0xB38D, 0xB38D, 0xB38D }, -{ 0xB38E, 0xB38E, 0xB38E }, -{ 0xB38F, 0xB38F, 0xB38F }, -{ 0xB390, 0xB390, 0xB390 }, -{ 0xB391, 0xB391, 0xB391 }, -{ 0xB392, 0xB392, 0xB392 }, -{ 0xB393, 0xB393, 0xB393 }, -{ 0xB394, 0xB394, 0xB394 }, -{ 0xB395, 0xB395, 0xB395 }, -{ 0xB396, 0xB396, 0xB396 }, -{ 0xB397, 0xB397, 0xB397 }, -{ 0xB398, 0xB398, 0xB398 }, -{ 0xB399, 0xB399, 0xB399 }, -{ 0xB39A, 0xB39A, 0xB39A }, -{ 0xB39B, 0xB39B, 0xB39B }, -{ 0xB39C, 0xB39C, 0xB39C }, -{ 0xB39D, 0xB39D, 0xB39D }, -{ 0xB39E, 0xB39E, 0xB39E }, -{ 0xB39F, 0xB39F, 0xB39F }, -{ 0xB3A0, 0xB3A0, 0xB3A0 }, -{ 0xB3A1, 0xB3A1, 0xB3A1 }, -{ 0xB3A2, 0xB3A2, 0xB3A2 }, -{ 0xB3A3, 0xB3A3, 0xB3A3 }, -{ 0xB3A4, 0xB3A4, 0xB3A4 }, -{ 0xB3A5, 0xB3A5, 0xB3A5 }, -{ 0xB3A6, 0xB3A6, 0xB3A6 }, -{ 0xB3A7, 0xB3A7, 0xB3A7 }, -{ 0xB3A8, 0xB3A8, 0xB3A8 }, -{ 0xB3A9, 0xB3A9, 0xB3A9 }, -{ 0xB3AA, 0xB3AA, 0xB3AA }, -{ 0xB3AB, 0xB3AB, 0xB3AB }, -{ 0xB3AC, 0xB3AC, 0xB3AC }, -{ 0xB3AD, 0xB3AD, 0xB3AD }, -{ 0xB3AE, 0xB3AE, 0xB3AE }, -{ 0xB3AF, 0xB3AF, 0xB3AF }, -{ 0xB3B0, 0xB3B0, 0xB3B0 }, -{ 0xB3B1, 0xB3B1, 0xB3B1 }, -{ 0xB3B2, 0xB3B2, 0xB3B2 }, -{ 0xB3B3, 0xB3B3, 0xB3B3 }, -{ 0xB3B4, 0xB3B4, 0xB3B4 }, -{ 0xB3B5, 0xB3B5, 0xB3B5 }, -{ 0xB3B6, 0xB3B6, 0xB3B6 }, -{ 0xB3B7, 0xB3B7, 0xB3B7 }, -{ 0xB3B8, 0xB3B8, 0xB3B8 }, -{ 0xB3B9, 0xB3B9, 0xB3B9 }, -{ 0xB3BA, 0xB3BA, 0xB3BA }, -{ 0xB3BB, 0xB3BB, 0xB3BB }, -{ 0xB3BC, 0xB3BC, 0xB3BC }, -{ 0xB3BD, 0xB3BD, 0xB3BD }, -{ 0xB3BE, 0xB3BE, 0xB3BE }, -{ 0xB3BF, 0xB3BF, 0xB3BF }, -{ 0xB3C0, 0xB3C0, 0xB3C0 }, -{ 0xB3C1, 0xB3C1, 0xB3C1 }, -{ 0xB3C2, 0xB3C2, 0xB3C2 }, -{ 0xB3C3, 0xB3C3, 0xB3C3 }, -{ 0xB3C4, 0xB3C4, 0xB3C4 }, -{ 0xB3C5, 0xB3C5, 0xB3C5 }, -{ 0xB3C6, 0xB3C6, 0xB3C6 }, -{ 0xB3C7, 0xB3C7, 0xB3C7 }, -{ 0xB3C8, 0xB3C8, 0xB3C8 }, -{ 0xB3C9, 0xB3C9, 0xB3C9 }, -{ 0xB3CA, 0xB3CA, 0xB3CA }, -{ 0xB3CB, 0xB3CB, 0xB3CB }, -{ 0xB3CC, 0xB3CC, 0xB3CC }, -{ 0xB3CD, 0xB3CD, 0xB3CD }, -{ 0xB3CE, 0xB3CE, 0xB3CE }, -{ 0xB3CF, 0xB3CF, 0xB3CF }, -{ 0xB3D0, 0xB3D0, 0xB3D0 }, -{ 0xB3D1, 0xB3D1, 0xB3D1 }, -{ 0xB3D2, 0xB3D2, 0xB3D2 }, -{ 0xB3D3, 0xB3D3, 0xB3D3 }, -{ 0xB3D4, 0xB3D4, 0xB3D4 }, -{ 0xB3D5, 0xB3D5, 0xB3D5 }, -{ 0xB3D6, 0xB3D6, 0xB3D6 }, -{ 0xB3D7, 0xB3D7, 0xB3D7 }, -{ 0xB3D8, 0xB3D8, 0xB3D8 }, -{ 0xB3D9, 0xB3D9, 0xB3D9 }, -{ 0xB3DA, 0xB3DA, 0xB3DA }, -{ 0xB3DB, 0xB3DB, 0xB3DB }, -{ 0xB3DC, 0xB3DC, 0xB3DC }, -{ 0xB3DD, 0xB3DD, 0xB3DD }, -{ 0xB3DE, 0xB3DE, 0xB3DE }, -{ 0xB3DF, 0xB3DF, 0xB3DF }, -{ 0xB3E0, 0xB3E0, 0xB3E0 }, -{ 0xB3E1, 0xB3E1, 0xB3E1 }, -{ 0xB3E2, 0xB3E2, 0xB3E2 }, -{ 0xB3E3, 0xB3E3, 0xB3E3 }, -{ 0xB3E4, 0xB3E4, 0xB3E4 }, -{ 0xB3E5, 0xB3E5, 0xB3E5 }, -{ 0xB3E6, 0xB3E6, 0xB3E6 }, -{ 0xB3E7, 0xB3E7, 0xB3E7 }, -{ 0xB3E8, 0xB3E8, 0xB3E8 }, -{ 0xB3E9, 0xB3E9, 0xB3E9 }, -{ 0xB3EA, 0xB3EA, 0xB3EA }, -{ 0xB3EB, 0xB3EB, 0xB3EB }, -{ 0xB3EC, 0xB3EC, 0xB3EC }, -{ 0xB3ED, 0xB3ED, 0xB3ED }, -{ 0xB3EE, 0xB3EE, 0xB3EE }, -{ 0xB3EF, 0xB3EF, 0xB3EF }, -{ 0xB3F0, 0xB3F0, 0xB3F0 }, -{ 0xB3F1, 0xB3F1, 0xB3F1 }, -{ 0xB3F2, 0xB3F2, 0xB3F2 }, -{ 0xB3F3, 0xB3F3, 0xB3F3 }, -{ 0xB3F4, 0xB3F4, 0xB3F4 }, -{ 0xB3F5, 0xB3F5, 0xB3F5 }, -{ 0xB3F6, 0xB3F6, 0xB3F6 }, -{ 0xB3F7, 0xB3F7, 0xB3F7 }, -{ 0xB3F8, 0xB3F8, 0xB3F8 }, -{ 0xB3F9, 0xB3F9, 0xB3F9 }, -{ 0xB3FA, 0xB3FA, 0xB3FA }, -{ 0xB3FB, 0xB3FB, 0xB3FB }, -{ 0xB3FC, 0xB3FC, 0xB3FC }, -{ 0xB3FD, 0xB3FD, 0xB3FD }, -{ 0xB3FE, 0xB3FE, 0xB3FE }, -{ 0xB3FF, 0xB3FF, 0xB3FF }, -{ 0xB400, 0xB400, 0xB400 }, -{ 0xB401, 0xB401, 0xB401 }, -{ 0xB402, 0xB402, 0xB402 }, -{ 0xB403, 0xB403, 0xB403 }, -{ 0xB404, 0xB404, 0xB404 }, -{ 0xB405, 0xB405, 0xB405 }, -{ 0xB406, 0xB406, 0xB406 }, -{ 0xB407, 0xB407, 0xB407 }, -{ 0xB408, 0xB408, 0xB408 }, -{ 0xB409, 0xB409, 0xB409 }, -{ 0xB40A, 0xB40A, 0xB40A }, -{ 0xB40B, 0xB40B, 0xB40B }, -{ 0xB40C, 0xB40C, 0xB40C }, -{ 0xB40D, 0xB40D, 0xB40D }, -{ 0xB40E, 0xB40E, 0xB40E }, -{ 0xB40F, 0xB40F, 0xB40F }, -{ 0xB410, 0xB410, 0xB410 }, -{ 0xB411, 0xB411, 0xB411 }, -{ 0xB412, 0xB412, 0xB412 }, -{ 0xB413, 0xB413, 0xB413 }, -{ 0xB414, 0xB414, 0xB414 }, -{ 0xB415, 0xB415, 0xB415 }, -{ 0xB416, 0xB416, 0xB416 }, -{ 0xB417, 0xB417, 0xB417 }, -{ 0xB418, 0xB418, 0xB418 }, -{ 0xB419, 0xB419, 0xB419 }, -{ 0xB41A, 0xB41A, 0xB41A }, -{ 0xB41B, 0xB41B, 0xB41B }, -{ 0xB41C, 0xB41C, 0xB41C }, -{ 0xB41D, 0xB41D, 0xB41D }, -{ 0xB41E, 0xB41E, 0xB41E }, -{ 0xB41F, 0xB41F, 0xB41F }, -{ 0xB420, 0xB420, 0xB420 }, -{ 0xB421, 0xB421, 0xB421 }, -{ 0xB422, 0xB422, 0xB422 }, -{ 0xB423, 0xB423, 0xB423 }, -{ 0xB424, 0xB424, 0xB424 }, -{ 0xB425, 0xB425, 0xB425 }, -{ 0xB426, 0xB426, 0xB426 }, -{ 0xB427, 0xB427, 0xB427 }, -{ 0xB428, 0xB428, 0xB428 }, -{ 0xB429, 0xB429, 0xB429 }, -{ 0xB42A, 0xB42A, 0xB42A }, -{ 0xB42B, 0xB42B, 0xB42B }, -{ 0xB42C, 0xB42C, 0xB42C }, -{ 0xB42D, 0xB42D, 0xB42D }, -{ 0xB42E, 0xB42E, 0xB42E }, -{ 0xB42F, 0xB42F, 0xB42F }, -{ 0xB430, 0xB430, 0xB430 }, -{ 0xB431, 0xB431, 0xB431 }, -{ 0xB432, 0xB432, 0xB432 }, -{ 0xB433, 0xB433, 0xB433 }, -{ 0xB434, 0xB434, 0xB434 }, -{ 0xB435, 0xB435, 0xB435 }, -{ 0xB436, 0xB436, 0xB436 }, -{ 0xB437, 0xB437, 0xB437 }, -{ 0xB438, 0xB438, 0xB438 }, -{ 0xB439, 0xB439, 0xB439 }, -{ 0xB43A, 0xB43A, 0xB43A }, -{ 0xB43B, 0xB43B, 0xB43B }, -{ 0xB43C, 0xB43C, 0xB43C }, -{ 0xB43D, 0xB43D, 0xB43D }, -{ 0xB43E, 0xB43E, 0xB43E }, -{ 0xB43F, 0xB43F, 0xB43F }, -{ 0xB440, 0xB440, 0xB440 }, -{ 0xB441, 0xB441, 0xB441 }, -{ 0xB442, 0xB442, 0xB442 }, -{ 0xB443, 0xB443, 0xB443 }, -{ 0xB444, 0xB444, 0xB444 }, -{ 0xB445, 0xB445, 0xB445 }, -{ 0xB446, 0xB446, 0xB446 }, -{ 0xB447, 0xB447, 0xB447 }, -{ 0xB448, 0xB448, 0xB448 }, -{ 0xB449, 0xB449, 0xB449 }, -{ 0xB44A, 0xB44A, 0xB44A }, -{ 0xB44B, 0xB44B, 0xB44B }, -{ 0xB44C, 0xB44C, 0xB44C }, -{ 0xB44D, 0xB44D, 0xB44D }, -{ 0xB44E, 0xB44E, 0xB44E }, -{ 0xB44F, 0xB44F, 0xB44F }, -{ 0xB450, 0xB450, 0xB450 }, -{ 0xB451, 0xB451, 0xB451 }, -{ 0xB452, 0xB452, 0xB452 }, -{ 0xB453, 0xB453, 0xB453 }, -{ 0xB454, 0xB454, 0xB454 }, -{ 0xB455, 0xB455, 0xB455 }, -{ 0xB456, 0xB456, 0xB456 }, -{ 0xB457, 0xB457, 0xB457 }, -{ 0xB458, 0xB458, 0xB458 }, -{ 0xB459, 0xB459, 0xB459 }, -{ 0xB45A, 0xB45A, 0xB45A }, -{ 0xB45B, 0xB45B, 0xB45B }, -{ 0xB45C, 0xB45C, 0xB45C }, -{ 0xB45D, 0xB45D, 0xB45D }, -{ 0xB45E, 0xB45E, 0xB45E }, -{ 0xB45F, 0xB45F, 0xB45F }, -{ 0xB460, 0xB460, 0xB460 }, -{ 0xB461, 0xB461, 0xB461 }, -{ 0xB462, 0xB462, 0xB462 }, -{ 0xB463, 0xB463, 0xB463 }, -{ 0xB464, 0xB464, 0xB464 }, -{ 0xB465, 0xB465, 0xB465 }, -{ 0xB466, 0xB466, 0xB466 }, -{ 0xB467, 0xB467, 0xB467 }, -{ 0xB468, 0xB468, 0xB468 }, -{ 0xB469, 0xB469, 0xB469 }, -{ 0xB46A, 0xB46A, 0xB46A }, -{ 0xB46B, 0xB46B, 0xB46B }, -{ 0xB46C, 0xB46C, 0xB46C }, -{ 0xB46D, 0xB46D, 0xB46D }, -{ 0xB46E, 0xB46E, 0xB46E }, -{ 0xB46F, 0xB46F, 0xB46F }, -{ 0xB470, 0xB470, 0xB470 }, -{ 0xB471, 0xB471, 0xB471 }, -{ 0xB472, 0xB472, 0xB472 }, -{ 0xB473, 0xB473, 0xB473 }, -{ 0xB474, 0xB474, 0xB474 }, -{ 0xB475, 0xB475, 0xB475 }, -{ 0xB476, 0xB476, 0xB476 }, -{ 0xB477, 0xB477, 0xB477 }, -{ 0xB478, 0xB478, 0xB478 }, -{ 0xB479, 0xB479, 0xB479 }, -{ 0xB47A, 0xB47A, 0xB47A }, -{ 0xB47B, 0xB47B, 0xB47B }, -{ 0xB47C, 0xB47C, 0xB47C }, -{ 0xB47D, 0xB47D, 0xB47D }, -{ 0xB47E, 0xB47E, 0xB47E }, -{ 0xB47F, 0xB47F, 0xB47F }, -{ 0xB480, 0xB480, 0xB480 }, -{ 0xB481, 0xB481, 0xB481 }, -{ 0xB482, 0xB482, 0xB482 }, -{ 0xB483, 0xB483, 0xB483 }, -{ 0xB484, 0xB484, 0xB484 }, -{ 0xB485, 0xB485, 0xB485 }, -{ 0xB486, 0xB486, 0xB486 }, -{ 0xB487, 0xB487, 0xB487 }, -{ 0xB488, 0xB488, 0xB488 }, -{ 0xB489, 0xB489, 0xB489 }, -{ 0xB48A, 0xB48A, 0xB48A }, -{ 0xB48B, 0xB48B, 0xB48B }, -{ 0xB48C, 0xB48C, 0xB48C }, -{ 0xB48D, 0xB48D, 0xB48D }, -{ 0xB48E, 0xB48E, 0xB48E }, -{ 0xB48F, 0xB48F, 0xB48F }, -{ 0xB490, 0xB490, 0xB490 }, -{ 0xB491, 0xB491, 0xB491 }, -{ 0xB492, 0xB492, 0xB492 }, -{ 0xB493, 0xB493, 0xB493 }, -{ 0xB494, 0xB494, 0xB494 }, -{ 0xB495, 0xB495, 0xB495 }, -{ 0xB496, 0xB496, 0xB496 }, -{ 0xB497, 0xB497, 0xB497 }, -{ 0xB498, 0xB498, 0xB498 }, -{ 0xB499, 0xB499, 0xB499 }, -{ 0xB49A, 0xB49A, 0xB49A }, -{ 0xB49B, 0xB49B, 0xB49B }, -{ 0xB49C, 0xB49C, 0xB49C }, -{ 0xB49D, 0xB49D, 0xB49D }, -{ 0xB49E, 0xB49E, 0xB49E }, -{ 0xB49F, 0xB49F, 0xB49F }, -{ 0xB4A0, 0xB4A0, 0xB4A0 }, -{ 0xB4A1, 0xB4A1, 0xB4A1 }, -{ 0xB4A2, 0xB4A2, 0xB4A2 }, -{ 0xB4A3, 0xB4A3, 0xB4A3 }, -{ 0xB4A4, 0xB4A4, 0xB4A4 }, -{ 0xB4A5, 0xB4A5, 0xB4A5 }, -{ 0xB4A6, 0xB4A6, 0xB4A6 }, -{ 0xB4A7, 0xB4A7, 0xB4A7 }, -{ 0xB4A8, 0xB4A8, 0xB4A8 }, -{ 0xB4A9, 0xB4A9, 0xB4A9 }, -{ 0xB4AA, 0xB4AA, 0xB4AA }, -{ 0xB4AB, 0xB4AB, 0xB4AB }, -{ 0xB4AC, 0xB4AC, 0xB4AC }, -{ 0xB4AD, 0xB4AD, 0xB4AD }, -{ 0xB4AE, 0xB4AE, 0xB4AE }, -{ 0xB4AF, 0xB4AF, 0xB4AF }, -{ 0xB4B0, 0xB4B0, 0xB4B0 }, -{ 0xB4B1, 0xB4B1, 0xB4B1 }, -{ 0xB4B2, 0xB4B2, 0xB4B2 }, -{ 0xB4B3, 0xB4B3, 0xB4B3 }, -{ 0xB4B4, 0xB4B4, 0xB4B4 }, -{ 0xB4B5, 0xB4B5, 0xB4B5 }, -{ 0xB4B6, 0xB4B6, 0xB4B6 }, -{ 0xB4B7, 0xB4B7, 0xB4B7 }, -{ 0xB4B8, 0xB4B8, 0xB4B8 }, -{ 0xB4B9, 0xB4B9, 0xB4B9 }, -{ 0xB4BA, 0xB4BA, 0xB4BA }, -{ 0xB4BB, 0xB4BB, 0xB4BB }, -{ 0xB4BC, 0xB4BC, 0xB4BC }, -{ 0xB4BD, 0xB4BD, 0xB4BD }, -{ 0xB4BE, 0xB4BE, 0xB4BE }, -{ 0xB4BF, 0xB4BF, 0xB4BF }, -{ 0xB4C0, 0xB4C0, 0xB4C0 }, -{ 0xB4C1, 0xB4C1, 0xB4C1 }, -{ 0xB4C2, 0xB4C2, 0xB4C2 }, -{ 0xB4C3, 0xB4C3, 0xB4C3 }, -{ 0xB4C4, 0xB4C4, 0xB4C4 }, -{ 0xB4C5, 0xB4C5, 0xB4C5 }, -{ 0xB4C6, 0xB4C6, 0xB4C6 }, -{ 0xB4C7, 0xB4C7, 0xB4C7 }, -{ 0xB4C8, 0xB4C8, 0xB4C8 }, -{ 0xB4C9, 0xB4C9, 0xB4C9 }, -{ 0xB4CA, 0xB4CA, 0xB4CA }, -{ 0xB4CB, 0xB4CB, 0xB4CB }, -{ 0xB4CC, 0xB4CC, 0xB4CC }, -{ 0xB4CD, 0xB4CD, 0xB4CD }, -{ 0xB4CE, 0xB4CE, 0xB4CE }, -{ 0xB4CF, 0xB4CF, 0xB4CF }, -{ 0xB4D0, 0xB4D0, 0xB4D0 }, -{ 0xB4D1, 0xB4D1, 0xB4D1 }, -{ 0xB4D2, 0xB4D2, 0xB4D2 }, -{ 0xB4D3, 0xB4D3, 0xB4D3 }, -{ 0xB4D4, 0xB4D4, 0xB4D4 }, -{ 0xB4D5, 0xB4D5, 0xB4D5 }, -{ 0xB4D6, 0xB4D6, 0xB4D6 }, -{ 0xB4D7, 0xB4D7, 0xB4D7 }, -{ 0xB4D8, 0xB4D8, 0xB4D8 }, -{ 0xB4D9, 0xB4D9, 0xB4D9 }, -{ 0xB4DA, 0xB4DA, 0xB4DA }, -{ 0xB4DB, 0xB4DB, 0xB4DB }, -{ 0xB4DC, 0xB4DC, 0xB4DC }, -{ 0xB4DD, 0xB4DD, 0xB4DD }, -{ 0xB4DE, 0xB4DE, 0xB4DE }, -{ 0xB4DF, 0xB4DF, 0xB4DF }, -{ 0xB4E0, 0xB4E0, 0xB4E0 }, -{ 0xB4E1, 0xB4E1, 0xB4E1 }, -{ 0xB4E2, 0xB4E2, 0xB4E2 }, -{ 0xB4E3, 0xB4E3, 0xB4E3 }, -{ 0xB4E4, 0xB4E4, 0xB4E4 }, -{ 0xB4E5, 0xB4E5, 0xB4E5 }, -{ 0xB4E6, 0xB4E6, 0xB4E6 }, -{ 0xB4E7, 0xB4E7, 0xB4E7 }, -{ 0xB4E8, 0xB4E8, 0xB4E8 }, -{ 0xB4E9, 0xB4E9, 0xB4E9 }, -{ 0xB4EA, 0xB4EA, 0xB4EA }, -{ 0xB4EB, 0xB4EB, 0xB4EB }, -{ 0xB4EC, 0xB4EC, 0xB4EC }, -{ 0xB4ED, 0xB4ED, 0xB4ED }, -{ 0xB4EE, 0xB4EE, 0xB4EE }, -{ 0xB4EF, 0xB4EF, 0xB4EF }, -{ 0xB4F0, 0xB4F0, 0xB4F0 }, -{ 0xB4F1, 0xB4F1, 0xB4F1 }, -{ 0xB4F2, 0xB4F2, 0xB4F2 }, -{ 0xB4F3, 0xB4F3, 0xB4F3 }, -{ 0xB4F4, 0xB4F4, 0xB4F4 }, -{ 0xB4F5, 0xB4F5, 0xB4F5 }, -{ 0xB4F6, 0xB4F6, 0xB4F6 }, -{ 0xB4F7, 0xB4F7, 0xB4F7 }, -{ 0xB4F8, 0xB4F8, 0xB4F8 }, -{ 0xB4F9, 0xB4F9, 0xB4F9 }, -{ 0xB4FA, 0xB4FA, 0xB4FA }, -{ 0xB4FB, 0xB4FB, 0xB4FB }, -{ 0xB4FC, 0xB4FC, 0xB4FC }, -{ 0xB4FD, 0xB4FD, 0xB4FD }, -{ 0xB4FE, 0xB4FE, 0xB4FE }, -{ 0xB4FF, 0xB4FF, 0xB4FF }, -{ 0xB500, 0xB500, 0xB500 }, -{ 0xB501, 0xB501, 0xB501 }, -{ 0xB502, 0xB502, 0xB502 }, -{ 0xB503, 0xB503, 0xB503 }, -{ 0xB504, 0xB504, 0xB504 }, -{ 0xB505, 0xB505, 0xB505 }, -{ 0xB506, 0xB506, 0xB506 }, -{ 0xB507, 0xB507, 0xB507 }, -{ 0xB508, 0xB508, 0xB508 }, -{ 0xB509, 0xB509, 0xB509 }, -{ 0xB50A, 0xB50A, 0xB50A }, -{ 0xB50B, 0xB50B, 0xB50B }, -{ 0xB50C, 0xB50C, 0xB50C }, -{ 0xB50D, 0xB50D, 0xB50D }, -{ 0xB50E, 0xB50E, 0xB50E }, -{ 0xB50F, 0xB50F, 0xB50F }, -{ 0xB510, 0xB510, 0xB510 }, -{ 0xB511, 0xB511, 0xB511 }, -{ 0xB512, 0xB512, 0xB512 }, -{ 0xB513, 0xB513, 0xB513 }, -{ 0xB514, 0xB514, 0xB514 }, -{ 0xB515, 0xB515, 0xB515 }, -{ 0xB516, 0xB516, 0xB516 }, -{ 0xB517, 0xB517, 0xB517 }, -{ 0xB518, 0xB518, 0xB518 }, -{ 0xB519, 0xB519, 0xB519 }, -{ 0xB51A, 0xB51A, 0xB51A }, -{ 0xB51B, 0xB51B, 0xB51B }, -{ 0xB51C, 0xB51C, 0xB51C }, -{ 0xB51D, 0xB51D, 0xB51D }, -{ 0xB51E, 0xB51E, 0xB51E }, -{ 0xB51F, 0xB51F, 0xB51F }, -{ 0xB520, 0xB520, 0xB520 }, -{ 0xB521, 0xB521, 0xB521 }, -{ 0xB522, 0xB522, 0xB522 }, -{ 0xB523, 0xB523, 0xB523 }, -{ 0xB524, 0xB524, 0xB524 }, -{ 0xB525, 0xB525, 0xB525 }, -{ 0xB526, 0xB526, 0xB526 }, -{ 0xB527, 0xB527, 0xB527 }, -{ 0xB528, 0xB528, 0xB528 }, -{ 0xB529, 0xB529, 0xB529 }, -{ 0xB52A, 0xB52A, 0xB52A }, -{ 0xB52B, 0xB52B, 0xB52B }, -{ 0xB52C, 0xB52C, 0xB52C }, -{ 0xB52D, 0xB52D, 0xB52D }, -{ 0xB52E, 0xB52E, 0xB52E }, -{ 0xB52F, 0xB52F, 0xB52F }, -{ 0xB530, 0xB530, 0xB530 }, -{ 0xB531, 0xB531, 0xB531 }, -{ 0xB532, 0xB532, 0xB532 }, -{ 0xB533, 0xB533, 0xB533 }, -{ 0xB534, 0xB534, 0xB534 }, -{ 0xB535, 0xB535, 0xB535 }, -{ 0xB536, 0xB536, 0xB536 }, -{ 0xB537, 0xB537, 0xB537 }, -{ 0xB538, 0xB538, 0xB538 }, -{ 0xB539, 0xB539, 0xB539 }, -{ 0xB53A, 0xB53A, 0xB53A }, -{ 0xB53B, 0xB53B, 0xB53B }, -{ 0xB53C, 0xB53C, 0xB53C }, -{ 0xB53D, 0xB53D, 0xB53D }, -{ 0xB53E, 0xB53E, 0xB53E }, -{ 0xB53F, 0xB53F, 0xB53F }, -{ 0xB540, 0xB540, 0xB540 }, -{ 0xB541, 0xB541, 0xB541 }, -{ 0xB542, 0xB542, 0xB542 }, -{ 0xB543, 0xB543, 0xB543 }, -{ 0xB544, 0xB544, 0xB544 }, -{ 0xB545, 0xB545, 0xB545 }, -{ 0xB546, 0xB546, 0xB546 }, -{ 0xB547, 0xB547, 0xB547 }, -{ 0xB548, 0xB548, 0xB548 }, -{ 0xB549, 0xB549, 0xB549 }, -{ 0xB54A, 0xB54A, 0xB54A }, -{ 0xB54B, 0xB54B, 0xB54B }, -{ 0xB54C, 0xB54C, 0xB54C }, -{ 0xB54D, 0xB54D, 0xB54D }, -{ 0xB54E, 0xB54E, 0xB54E }, -{ 0xB54F, 0xB54F, 0xB54F }, -{ 0xB550, 0xB550, 0xB550 }, -{ 0xB551, 0xB551, 0xB551 }, -{ 0xB552, 0xB552, 0xB552 }, -{ 0xB553, 0xB553, 0xB553 }, -{ 0xB554, 0xB554, 0xB554 }, -{ 0xB555, 0xB555, 0xB555 }, -{ 0xB556, 0xB556, 0xB556 }, -{ 0xB557, 0xB557, 0xB557 }, -{ 0xB558, 0xB558, 0xB558 }, -{ 0xB559, 0xB559, 0xB559 }, -{ 0xB55A, 0xB55A, 0xB55A }, -{ 0xB55B, 0xB55B, 0xB55B }, -{ 0xB55C, 0xB55C, 0xB55C }, -{ 0xB55D, 0xB55D, 0xB55D }, -{ 0xB55E, 0xB55E, 0xB55E }, -{ 0xB55F, 0xB55F, 0xB55F }, -{ 0xB560, 0xB560, 0xB560 }, -{ 0xB561, 0xB561, 0xB561 }, -{ 0xB562, 0xB562, 0xB562 }, -{ 0xB563, 0xB563, 0xB563 }, -{ 0xB564, 0xB564, 0xB564 }, -{ 0xB565, 0xB565, 0xB565 }, -{ 0xB566, 0xB566, 0xB566 }, -{ 0xB567, 0xB567, 0xB567 }, -{ 0xB568, 0xB568, 0xB568 }, -{ 0xB569, 0xB569, 0xB569 }, -{ 0xB56A, 0xB56A, 0xB56A }, -{ 0xB56B, 0xB56B, 0xB56B }, -{ 0xB56C, 0xB56C, 0xB56C }, -{ 0xB56D, 0xB56D, 0xB56D }, -{ 0xB56E, 0xB56E, 0xB56E }, -{ 0xB56F, 0xB56F, 0xB56F }, -{ 0xB570, 0xB570, 0xB570 }, -{ 0xB571, 0xB571, 0xB571 }, -{ 0xB572, 0xB572, 0xB572 }, -{ 0xB573, 0xB573, 0xB573 }, -{ 0xB574, 0xB574, 0xB574 }, -{ 0xB575, 0xB575, 0xB575 }, -{ 0xB576, 0xB576, 0xB576 }, -{ 0xB577, 0xB577, 0xB577 }, -{ 0xB578, 0xB578, 0xB578 }, -{ 0xB579, 0xB579, 0xB579 }, -{ 0xB57A, 0xB57A, 0xB57A }, -{ 0xB57B, 0xB57B, 0xB57B }, -{ 0xB57C, 0xB57C, 0xB57C }, -{ 0xB57D, 0xB57D, 0xB57D }, -{ 0xB57E, 0xB57E, 0xB57E }, -{ 0xB57F, 0xB57F, 0xB57F }, -{ 0xB580, 0xB580, 0xB580 }, -{ 0xB581, 0xB581, 0xB581 }, -{ 0xB582, 0xB582, 0xB582 }, -{ 0xB583, 0xB583, 0xB583 }, -{ 0xB584, 0xB584, 0xB584 }, -{ 0xB585, 0xB585, 0xB585 }, -{ 0xB586, 0xB586, 0xB586 }, -{ 0xB587, 0xB587, 0xB587 }, -{ 0xB588, 0xB588, 0xB588 }, -{ 0xB589, 0xB589, 0xB589 }, -{ 0xB58A, 0xB58A, 0xB58A }, -{ 0xB58B, 0xB58B, 0xB58B }, -{ 0xB58C, 0xB58C, 0xB58C }, -{ 0xB58D, 0xB58D, 0xB58D }, -{ 0xB58E, 0xB58E, 0xB58E }, -{ 0xB58F, 0xB58F, 0xB58F }, -{ 0xB590, 0xB590, 0xB590 }, -{ 0xB591, 0xB591, 0xB591 }, -{ 0xB592, 0xB592, 0xB592 }, -{ 0xB593, 0xB593, 0xB593 }, -{ 0xB594, 0xB594, 0xB594 }, -{ 0xB595, 0xB595, 0xB595 }, -{ 0xB596, 0xB596, 0xB596 }, -{ 0xB597, 0xB597, 0xB597 }, -{ 0xB598, 0xB598, 0xB598 }, -{ 0xB599, 0xB599, 0xB599 }, -{ 0xB59A, 0xB59A, 0xB59A }, -{ 0xB59B, 0xB59B, 0xB59B }, -{ 0xB59C, 0xB59C, 0xB59C }, -{ 0xB59D, 0xB59D, 0xB59D }, -{ 0xB59E, 0xB59E, 0xB59E }, -{ 0xB59F, 0xB59F, 0xB59F }, -{ 0xB5A0, 0xB5A0, 0xB5A0 }, -{ 0xB5A1, 0xB5A1, 0xB5A1 }, -{ 0xB5A2, 0xB5A2, 0xB5A2 }, -{ 0xB5A3, 0xB5A3, 0xB5A3 }, -{ 0xB5A4, 0xB5A4, 0xB5A4 }, -{ 0xB5A5, 0xB5A5, 0xB5A5 }, -{ 0xB5A6, 0xB5A6, 0xB5A6 }, -{ 0xB5A7, 0xB5A7, 0xB5A7 }, -{ 0xB5A8, 0xB5A8, 0xB5A8 }, -{ 0xB5A9, 0xB5A9, 0xB5A9 }, -{ 0xB5AA, 0xB5AA, 0xB5AA }, -{ 0xB5AB, 0xB5AB, 0xB5AB }, -{ 0xB5AC, 0xB5AC, 0xB5AC }, -{ 0xB5AD, 0xB5AD, 0xB5AD }, -{ 0xB5AE, 0xB5AE, 0xB5AE }, -{ 0xB5AF, 0xB5AF, 0xB5AF }, -{ 0xB5B0, 0xB5B0, 0xB5B0 }, -{ 0xB5B1, 0xB5B1, 0xB5B1 }, -{ 0xB5B2, 0xB5B2, 0xB5B2 }, -{ 0xB5B3, 0xB5B3, 0xB5B3 }, -{ 0xB5B4, 0xB5B4, 0xB5B4 }, -{ 0xB5B5, 0xB5B5, 0xB5B5 }, -{ 0xB5B6, 0xB5B6, 0xB5B6 }, -{ 0xB5B7, 0xB5B7, 0xB5B7 }, -{ 0xB5B8, 0xB5B8, 0xB5B8 }, -{ 0xB5B9, 0xB5B9, 0xB5B9 }, -{ 0xB5BA, 0xB5BA, 0xB5BA }, -{ 0xB5BB, 0xB5BB, 0xB5BB }, -{ 0xB5BC, 0xB5BC, 0xB5BC }, -{ 0xB5BD, 0xB5BD, 0xB5BD }, -{ 0xB5BE, 0xB5BE, 0xB5BE }, -{ 0xB5BF, 0xB5BF, 0xB5BF }, -{ 0xB5C0, 0xB5C0, 0xB5C0 }, -{ 0xB5C1, 0xB5C1, 0xB5C1 }, -{ 0xB5C2, 0xB5C2, 0xB5C2 }, -{ 0xB5C3, 0xB5C3, 0xB5C3 }, -{ 0xB5C4, 0xB5C4, 0xB5C4 }, -{ 0xB5C5, 0xB5C5, 0xB5C5 }, -{ 0xB5C6, 0xB5C6, 0xB5C6 }, -{ 0xB5C7, 0xB5C7, 0xB5C7 }, -{ 0xB5C8, 0xB5C8, 0xB5C8 }, -{ 0xB5C9, 0xB5C9, 0xB5C9 }, -{ 0xB5CA, 0xB5CA, 0xB5CA }, -{ 0xB5CB, 0xB5CB, 0xB5CB }, -{ 0xB5CC, 0xB5CC, 0xB5CC }, -{ 0xB5CD, 0xB5CD, 0xB5CD }, -{ 0xB5CE, 0xB5CE, 0xB5CE }, -{ 0xB5CF, 0xB5CF, 0xB5CF }, -{ 0xB5D0, 0xB5D0, 0xB5D0 }, -{ 0xB5D1, 0xB5D1, 0xB5D1 }, -{ 0xB5D2, 0xB5D2, 0xB5D2 }, -{ 0xB5D3, 0xB5D3, 0xB5D3 }, -{ 0xB5D4, 0xB5D4, 0xB5D4 }, -{ 0xB5D5, 0xB5D5, 0xB5D5 }, -{ 0xB5D6, 0xB5D6, 0xB5D6 }, -{ 0xB5D7, 0xB5D7, 0xB5D7 }, -{ 0xB5D8, 0xB5D8, 0xB5D8 }, -{ 0xB5D9, 0xB5D9, 0xB5D9 }, -{ 0xB5DA, 0xB5DA, 0xB5DA }, -{ 0xB5DB, 0xB5DB, 0xB5DB }, -{ 0xB5DC, 0xB5DC, 0xB5DC }, -{ 0xB5DD, 0xB5DD, 0xB5DD }, -{ 0xB5DE, 0xB5DE, 0xB5DE }, -{ 0xB5DF, 0xB5DF, 0xB5DF }, -{ 0xB5E0, 0xB5E0, 0xB5E0 }, -{ 0xB5E1, 0xB5E1, 0xB5E1 }, -{ 0xB5E2, 0xB5E2, 0xB5E2 }, -{ 0xB5E3, 0xB5E3, 0xB5E3 }, -{ 0xB5E4, 0xB5E4, 0xB5E4 }, -{ 0xB5E5, 0xB5E5, 0xB5E5 }, -{ 0xB5E6, 0xB5E6, 0xB5E6 }, -{ 0xB5E7, 0xB5E7, 0xB5E7 }, -{ 0xB5E8, 0xB5E8, 0xB5E8 }, -{ 0xB5E9, 0xB5E9, 0xB5E9 }, -{ 0xB5EA, 0xB5EA, 0xB5EA }, -{ 0xB5EB, 0xB5EB, 0xB5EB }, -{ 0xB5EC, 0xB5EC, 0xB5EC }, -{ 0xB5ED, 0xB5ED, 0xB5ED }, -{ 0xB5EE, 0xB5EE, 0xB5EE }, -{ 0xB5EF, 0xB5EF, 0xB5EF }, -{ 0xB5F0, 0xB5F0, 0xB5F0 }, -{ 0xB5F1, 0xB5F1, 0xB5F1 }, -{ 0xB5F2, 0xB5F2, 0xB5F2 }, -{ 0xB5F3, 0xB5F3, 0xB5F3 }, -{ 0xB5F4, 0xB5F4, 0xB5F4 }, -{ 0xB5F5, 0xB5F5, 0xB5F5 }, -{ 0xB5F6, 0xB5F6, 0xB5F6 }, -{ 0xB5F7, 0xB5F7, 0xB5F7 }, -{ 0xB5F8, 0xB5F8, 0xB5F8 }, -{ 0xB5F9, 0xB5F9, 0xB5F9 }, -{ 0xB5FA, 0xB5FA, 0xB5FA }, -{ 0xB5FB, 0xB5FB, 0xB5FB }, -{ 0xB5FC, 0xB5FC, 0xB5FC }, -{ 0xB5FD, 0xB5FD, 0xB5FD }, -{ 0xB5FE, 0xB5FE, 0xB5FE }, -{ 0xB5FF, 0xB5FF, 0xB5FF }, -{ 0xB600, 0xB600, 0xB600 }, -{ 0xB601, 0xB601, 0xB601 }, -{ 0xB602, 0xB602, 0xB602 }, -{ 0xB603, 0xB603, 0xB603 }, -{ 0xB604, 0xB604, 0xB604 }, -{ 0xB605, 0xB605, 0xB605 }, -{ 0xB606, 0xB606, 0xB606 }, -{ 0xB607, 0xB607, 0xB607 }, -{ 0xB608, 0xB608, 0xB608 }, -{ 0xB609, 0xB609, 0xB609 }, -{ 0xB60A, 0xB60A, 0xB60A }, -{ 0xB60B, 0xB60B, 0xB60B }, -{ 0xB60C, 0xB60C, 0xB60C }, -{ 0xB60D, 0xB60D, 0xB60D }, -{ 0xB60E, 0xB60E, 0xB60E }, -{ 0xB60F, 0xB60F, 0xB60F }, -{ 0xB610, 0xB610, 0xB610 }, -{ 0xB611, 0xB611, 0xB611 }, -{ 0xB612, 0xB612, 0xB612 }, -{ 0xB613, 0xB613, 0xB613 }, -{ 0xB614, 0xB614, 0xB614 }, -{ 0xB615, 0xB615, 0xB615 }, -{ 0xB616, 0xB616, 0xB616 }, -{ 0xB617, 0xB617, 0xB617 }, -{ 0xB618, 0xB618, 0xB618 }, -{ 0xB619, 0xB619, 0xB619 }, -{ 0xB61A, 0xB61A, 0xB61A }, -{ 0xB61B, 0xB61B, 0xB61B }, -{ 0xB61C, 0xB61C, 0xB61C }, -{ 0xB61D, 0xB61D, 0xB61D }, -{ 0xB61E, 0xB61E, 0xB61E }, -{ 0xB61F, 0xB61F, 0xB61F }, -{ 0xB620, 0xB620, 0xB620 }, -{ 0xB621, 0xB621, 0xB621 }, -{ 0xB622, 0xB622, 0xB622 }, -{ 0xB623, 0xB623, 0xB623 }, -{ 0xB624, 0xB624, 0xB624 }, -{ 0xB625, 0xB625, 0xB625 }, -{ 0xB626, 0xB626, 0xB626 }, -{ 0xB627, 0xB627, 0xB627 }, -{ 0xB628, 0xB628, 0xB628 }, -{ 0xB629, 0xB629, 0xB629 }, -{ 0xB62A, 0xB62A, 0xB62A }, -{ 0xB62B, 0xB62B, 0xB62B }, -{ 0xB62C, 0xB62C, 0xB62C }, -{ 0xB62D, 0xB62D, 0xB62D }, -{ 0xB62E, 0xB62E, 0xB62E }, -{ 0xB62F, 0xB62F, 0xB62F }, -{ 0xB630, 0xB630, 0xB630 }, -{ 0xB631, 0xB631, 0xB631 }, -{ 0xB632, 0xB632, 0xB632 }, -{ 0xB633, 0xB633, 0xB633 }, -{ 0xB634, 0xB634, 0xB634 }, -{ 0xB635, 0xB635, 0xB635 }, -{ 0xB636, 0xB636, 0xB636 }, -{ 0xB637, 0xB637, 0xB637 }, -{ 0xB638, 0xB638, 0xB638 }, -{ 0xB639, 0xB639, 0xB639 }, -{ 0xB63A, 0xB63A, 0xB63A }, -{ 0xB63B, 0xB63B, 0xB63B }, -{ 0xB63C, 0xB63C, 0xB63C }, -{ 0xB63D, 0xB63D, 0xB63D }, -{ 0xB63E, 0xB63E, 0xB63E }, -{ 0xB63F, 0xB63F, 0xB63F }, -{ 0xB640, 0xB640, 0xB640 }, -{ 0xB641, 0xB641, 0xB641 }, -{ 0xB642, 0xB642, 0xB642 }, -{ 0xB643, 0xB643, 0xB643 }, -{ 0xB644, 0xB644, 0xB644 }, -{ 0xB645, 0xB645, 0xB645 }, -{ 0xB646, 0xB646, 0xB646 }, -{ 0xB647, 0xB647, 0xB647 }, -{ 0xB648, 0xB648, 0xB648 }, -{ 0xB649, 0xB649, 0xB649 }, -{ 0xB64A, 0xB64A, 0xB64A }, -{ 0xB64B, 0xB64B, 0xB64B }, -{ 0xB64C, 0xB64C, 0xB64C }, -{ 0xB64D, 0xB64D, 0xB64D }, -{ 0xB64E, 0xB64E, 0xB64E }, -{ 0xB64F, 0xB64F, 0xB64F }, -{ 0xB650, 0xB650, 0xB650 }, -{ 0xB651, 0xB651, 0xB651 }, -{ 0xB652, 0xB652, 0xB652 }, -{ 0xB653, 0xB653, 0xB653 }, -{ 0xB654, 0xB654, 0xB654 }, -{ 0xB655, 0xB655, 0xB655 }, -{ 0xB656, 0xB656, 0xB656 }, -{ 0xB657, 0xB657, 0xB657 }, -{ 0xB658, 0xB658, 0xB658 }, -{ 0xB659, 0xB659, 0xB659 }, -{ 0xB65A, 0xB65A, 0xB65A }, -{ 0xB65B, 0xB65B, 0xB65B }, -{ 0xB65C, 0xB65C, 0xB65C }, -{ 0xB65D, 0xB65D, 0xB65D }, -{ 0xB65E, 0xB65E, 0xB65E }, -{ 0xB65F, 0xB65F, 0xB65F }, -{ 0xB660, 0xB660, 0xB660 }, -{ 0xB661, 0xB661, 0xB661 }, -{ 0xB662, 0xB662, 0xB662 }, -{ 0xB663, 0xB663, 0xB663 }, -{ 0xB664, 0xB664, 0xB664 }, -{ 0xB665, 0xB665, 0xB665 }, -{ 0xB666, 0xB666, 0xB666 }, -{ 0xB667, 0xB667, 0xB667 }, -{ 0xB668, 0xB668, 0xB668 }, -{ 0xB669, 0xB669, 0xB669 }, -{ 0xB66A, 0xB66A, 0xB66A }, -{ 0xB66B, 0xB66B, 0xB66B }, -{ 0xB66C, 0xB66C, 0xB66C }, -{ 0xB66D, 0xB66D, 0xB66D }, -{ 0xB66E, 0xB66E, 0xB66E }, -{ 0xB66F, 0xB66F, 0xB66F }, -{ 0xB670, 0xB670, 0xB670 }, -{ 0xB671, 0xB671, 0xB671 }, -{ 0xB672, 0xB672, 0xB672 }, -{ 0xB673, 0xB673, 0xB673 }, -{ 0xB674, 0xB674, 0xB674 }, -{ 0xB675, 0xB675, 0xB675 }, -{ 0xB676, 0xB676, 0xB676 }, -{ 0xB677, 0xB677, 0xB677 }, -{ 0xB678, 0xB678, 0xB678 }, -{ 0xB679, 0xB679, 0xB679 }, -{ 0xB67A, 0xB67A, 0xB67A }, -{ 0xB67B, 0xB67B, 0xB67B }, -{ 0xB67C, 0xB67C, 0xB67C }, -{ 0xB67D, 0xB67D, 0xB67D }, -{ 0xB67E, 0xB67E, 0xB67E }, -{ 0xB67F, 0xB67F, 0xB67F }, -{ 0xB680, 0xB680, 0xB680 }, -{ 0xB681, 0xB681, 0xB681 }, -{ 0xB682, 0xB682, 0xB682 }, -{ 0xB683, 0xB683, 0xB683 }, -{ 0xB684, 0xB684, 0xB684 }, -{ 0xB685, 0xB685, 0xB685 }, -{ 0xB686, 0xB686, 0xB686 }, -{ 0xB687, 0xB687, 0xB687 }, -{ 0xB688, 0xB688, 0xB688 }, -{ 0xB689, 0xB689, 0xB689 }, -{ 0xB68A, 0xB68A, 0xB68A }, -{ 0xB68B, 0xB68B, 0xB68B }, -{ 0xB68C, 0xB68C, 0xB68C }, -{ 0xB68D, 0xB68D, 0xB68D }, -{ 0xB68E, 0xB68E, 0xB68E }, -{ 0xB68F, 0xB68F, 0xB68F }, -{ 0xB690, 0xB690, 0xB690 }, -{ 0xB691, 0xB691, 0xB691 }, -{ 0xB692, 0xB692, 0xB692 }, -{ 0xB693, 0xB693, 0xB693 }, -{ 0xB694, 0xB694, 0xB694 }, -{ 0xB695, 0xB695, 0xB695 }, -{ 0xB696, 0xB696, 0xB696 }, -{ 0xB697, 0xB697, 0xB697 }, -{ 0xB698, 0xB698, 0xB698 }, -{ 0xB699, 0xB699, 0xB699 }, -{ 0xB69A, 0xB69A, 0xB69A }, -{ 0xB69B, 0xB69B, 0xB69B }, -{ 0xB69C, 0xB69C, 0xB69C }, -{ 0xB69D, 0xB69D, 0xB69D }, -{ 0xB69E, 0xB69E, 0xB69E }, -{ 0xB69F, 0xB69F, 0xB69F }, -{ 0xB6A0, 0xB6A0, 0xB6A0 }, -{ 0xB6A1, 0xB6A1, 0xB6A1 }, -{ 0xB6A2, 0xB6A2, 0xB6A2 }, -{ 0xB6A3, 0xB6A3, 0xB6A3 }, -{ 0xB6A4, 0xB6A4, 0xB6A4 }, -{ 0xB6A5, 0xB6A5, 0xB6A5 }, -{ 0xB6A6, 0xB6A6, 0xB6A6 }, -{ 0xB6A7, 0xB6A7, 0xB6A7 }, -{ 0xB6A8, 0xB6A8, 0xB6A8 }, -{ 0xB6A9, 0xB6A9, 0xB6A9 }, -{ 0xB6AA, 0xB6AA, 0xB6AA }, -{ 0xB6AB, 0xB6AB, 0xB6AB }, -{ 0xB6AC, 0xB6AC, 0xB6AC }, -{ 0xB6AD, 0xB6AD, 0xB6AD }, -{ 0xB6AE, 0xB6AE, 0xB6AE }, -{ 0xB6AF, 0xB6AF, 0xB6AF }, -{ 0xB6B0, 0xB6B0, 0xB6B0 }, -{ 0xB6B1, 0xB6B1, 0xB6B1 }, -{ 0xB6B2, 0xB6B2, 0xB6B2 }, -{ 0xB6B3, 0xB6B3, 0xB6B3 }, -{ 0xB6B4, 0xB6B4, 0xB6B4 }, -{ 0xB6B5, 0xB6B5, 0xB6B5 }, -{ 0xB6B6, 0xB6B6, 0xB6B6 }, -{ 0xB6B7, 0xB6B7, 0xB6B7 }, -{ 0xB6B8, 0xB6B8, 0xB6B8 }, -{ 0xB6B9, 0xB6B9, 0xB6B9 }, -{ 0xB6BA, 0xB6BA, 0xB6BA }, -{ 0xB6BB, 0xB6BB, 0xB6BB }, -{ 0xB6BC, 0xB6BC, 0xB6BC }, -{ 0xB6BD, 0xB6BD, 0xB6BD }, -{ 0xB6BE, 0xB6BE, 0xB6BE }, -{ 0xB6BF, 0xB6BF, 0xB6BF }, -{ 0xB6C0, 0xB6C0, 0xB6C0 }, -{ 0xB6C1, 0xB6C1, 0xB6C1 }, -{ 0xB6C2, 0xB6C2, 0xB6C2 }, -{ 0xB6C3, 0xB6C3, 0xB6C3 }, -{ 0xB6C4, 0xB6C4, 0xB6C4 }, -{ 0xB6C5, 0xB6C5, 0xB6C5 }, -{ 0xB6C6, 0xB6C6, 0xB6C6 }, -{ 0xB6C7, 0xB6C7, 0xB6C7 }, -{ 0xB6C8, 0xB6C8, 0xB6C8 }, -{ 0xB6C9, 0xB6C9, 0xB6C9 }, -{ 0xB6CA, 0xB6CA, 0xB6CA }, -{ 0xB6CB, 0xB6CB, 0xB6CB }, -{ 0xB6CC, 0xB6CC, 0xB6CC }, -{ 0xB6CD, 0xB6CD, 0xB6CD }, -{ 0xB6CE, 0xB6CE, 0xB6CE }, -{ 0xB6CF, 0xB6CF, 0xB6CF }, -{ 0xB6D0, 0xB6D0, 0xB6D0 }, -{ 0xB6D1, 0xB6D1, 0xB6D1 }, -{ 0xB6D2, 0xB6D2, 0xB6D2 }, -{ 0xB6D3, 0xB6D3, 0xB6D3 }, -{ 0xB6D4, 0xB6D4, 0xB6D4 }, -{ 0xB6D5, 0xB6D5, 0xB6D5 }, -{ 0xB6D6, 0xB6D6, 0xB6D6 }, -{ 0xB6D7, 0xB6D7, 0xB6D7 }, -{ 0xB6D8, 0xB6D8, 0xB6D8 }, -{ 0xB6D9, 0xB6D9, 0xB6D9 }, -{ 0xB6DA, 0xB6DA, 0xB6DA }, -{ 0xB6DB, 0xB6DB, 0xB6DB }, -{ 0xB6DC, 0xB6DC, 0xB6DC }, -{ 0xB6DD, 0xB6DD, 0xB6DD }, -{ 0xB6DE, 0xB6DE, 0xB6DE }, -{ 0xB6DF, 0xB6DF, 0xB6DF }, -{ 0xB6E0, 0xB6E0, 0xB6E0 }, -{ 0xB6E1, 0xB6E1, 0xB6E1 }, -{ 0xB6E2, 0xB6E2, 0xB6E2 }, -{ 0xB6E3, 0xB6E3, 0xB6E3 }, -{ 0xB6E4, 0xB6E4, 0xB6E4 }, -{ 0xB6E5, 0xB6E5, 0xB6E5 }, -{ 0xB6E6, 0xB6E6, 0xB6E6 }, -{ 0xB6E7, 0xB6E7, 0xB6E7 }, -{ 0xB6E8, 0xB6E8, 0xB6E8 }, -{ 0xB6E9, 0xB6E9, 0xB6E9 }, -{ 0xB6EA, 0xB6EA, 0xB6EA }, -{ 0xB6EB, 0xB6EB, 0xB6EB }, -{ 0xB6EC, 0xB6EC, 0xB6EC }, -{ 0xB6ED, 0xB6ED, 0xB6ED }, -{ 0xB6EE, 0xB6EE, 0xB6EE }, -{ 0xB6EF, 0xB6EF, 0xB6EF }, -{ 0xB6F0, 0xB6F0, 0xB6F0 }, -{ 0xB6F1, 0xB6F1, 0xB6F1 }, -{ 0xB6F2, 0xB6F2, 0xB6F2 }, -{ 0xB6F3, 0xB6F3, 0xB6F3 }, -{ 0xB6F4, 0xB6F4, 0xB6F4 }, -{ 0xB6F5, 0xB6F5, 0xB6F5 }, -{ 0xB6F6, 0xB6F6, 0xB6F6 }, -{ 0xB6F7, 0xB6F7, 0xB6F7 }, -{ 0xB6F8, 0xB6F8, 0xB6F8 }, -{ 0xB6F9, 0xB6F9, 0xB6F9 }, -{ 0xB6FA, 0xB6FA, 0xB6FA }, -{ 0xB6FB, 0xB6FB, 0xB6FB }, -{ 0xB6FC, 0xB6FC, 0xB6FC }, -{ 0xB6FD, 0xB6FD, 0xB6FD }, -{ 0xB6FE, 0xB6FE, 0xB6FE }, -{ 0xB6FF, 0xB6FF, 0xB6FF }, -{ 0xB700, 0xB700, 0xB700 }, -{ 0xB701, 0xB701, 0xB701 }, -{ 0xB702, 0xB702, 0xB702 }, -{ 0xB703, 0xB703, 0xB703 }, -{ 0xB704, 0xB704, 0xB704 }, -{ 0xB705, 0xB705, 0xB705 }, -{ 0xB706, 0xB706, 0xB706 }, -{ 0xB707, 0xB707, 0xB707 }, -{ 0xB708, 0xB708, 0xB708 }, -{ 0xB709, 0xB709, 0xB709 }, -{ 0xB70A, 0xB70A, 0xB70A }, -{ 0xB70B, 0xB70B, 0xB70B }, -{ 0xB70C, 0xB70C, 0xB70C }, -{ 0xB70D, 0xB70D, 0xB70D }, -{ 0xB70E, 0xB70E, 0xB70E }, -{ 0xB70F, 0xB70F, 0xB70F }, -{ 0xB710, 0xB710, 0xB710 }, -{ 0xB711, 0xB711, 0xB711 }, -{ 0xB712, 0xB712, 0xB712 }, -{ 0xB713, 0xB713, 0xB713 }, -{ 0xB714, 0xB714, 0xB714 }, -{ 0xB715, 0xB715, 0xB715 }, -{ 0xB716, 0xB716, 0xB716 }, -{ 0xB717, 0xB717, 0xB717 }, -{ 0xB718, 0xB718, 0xB718 }, -{ 0xB719, 0xB719, 0xB719 }, -{ 0xB71A, 0xB71A, 0xB71A }, -{ 0xB71B, 0xB71B, 0xB71B }, -{ 0xB71C, 0xB71C, 0xB71C }, -{ 0xB71D, 0xB71D, 0xB71D }, -{ 0xB71E, 0xB71E, 0xB71E }, -{ 0xB71F, 0xB71F, 0xB71F }, -{ 0xB720, 0xB720, 0xB720 }, -{ 0xB721, 0xB721, 0xB721 }, -{ 0xB722, 0xB722, 0xB722 }, -{ 0xB723, 0xB723, 0xB723 }, -{ 0xB724, 0xB724, 0xB724 }, -{ 0xB725, 0xB725, 0xB725 }, -{ 0xB726, 0xB726, 0xB726 }, -{ 0xB727, 0xB727, 0xB727 }, -{ 0xB728, 0xB728, 0xB728 }, -{ 0xB729, 0xB729, 0xB729 }, -{ 0xB72A, 0xB72A, 0xB72A }, -{ 0xB72B, 0xB72B, 0xB72B }, -{ 0xB72C, 0xB72C, 0xB72C }, -{ 0xB72D, 0xB72D, 0xB72D }, -{ 0xB72E, 0xB72E, 0xB72E }, -{ 0xB72F, 0xB72F, 0xB72F }, -{ 0xB730, 0xB730, 0xB730 }, -{ 0xB731, 0xB731, 0xB731 }, -{ 0xB732, 0xB732, 0xB732 }, -{ 0xB733, 0xB733, 0xB733 }, -{ 0xB734, 0xB734, 0xB734 }, -{ 0xB735, 0xB735, 0xB735 }, -{ 0xB736, 0xB736, 0xB736 }, -{ 0xB737, 0xB737, 0xB737 }, -{ 0xB738, 0xB738, 0xB738 }, -{ 0xB739, 0xB739, 0xB739 }, -{ 0xB73A, 0xB73A, 0xB73A }, -{ 0xB73B, 0xB73B, 0xB73B }, -{ 0xB73C, 0xB73C, 0xB73C }, -{ 0xB73D, 0xB73D, 0xB73D }, -{ 0xB73E, 0xB73E, 0xB73E }, -{ 0xB73F, 0xB73F, 0xB73F }, -{ 0xB740, 0xB740, 0xB740 }, -{ 0xB741, 0xB741, 0xB741 }, -{ 0xB742, 0xB742, 0xB742 }, -{ 0xB743, 0xB743, 0xB743 }, -{ 0xB744, 0xB744, 0xB744 }, -{ 0xB745, 0xB745, 0xB745 }, -{ 0xB746, 0xB746, 0xB746 }, -{ 0xB747, 0xB747, 0xB747 }, -{ 0xB748, 0xB748, 0xB748 }, -{ 0xB749, 0xB749, 0xB749 }, -{ 0xB74A, 0xB74A, 0xB74A }, -{ 0xB74B, 0xB74B, 0xB74B }, -{ 0xB74C, 0xB74C, 0xB74C }, -{ 0xB74D, 0xB74D, 0xB74D }, -{ 0xB74E, 0xB74E, 0xB74E }, -{ 0xB74F, 0xB74F, 0xB74F }, -{ 0xB750, 0xB750, 0xB750 }, -{ 0xB751, 0xB751, 0xB751 }, -{ 0xB752, 0xB752, 0xB752 }, -{ 0xB753, 0xB753, 0xB753 }, -{ 0xB754, 0xB754, 0xB754 }, -{ 0xB755, 0xB755, 0xB755 }, -{ 0xB756, 0xB756, 0xB756 }, -{ 0xB757, 0xB757, 0xB757 }, -{ 0xB758, 0xB758, 0xB758 }, -{ 0xB759, 0xB759, 0xB759 }, -{ 0xB75A, 0xB75A, 0xB75A }, -{ 0xB75B, 0xB75B, 0xB75B }, -{ 0xB75C, 0xB75C, 0xB75C }, -{ 0xB75D, 0xB75D, 0xB75D }, -{ 0xB75E, 0xB75E, 0xB75E }, -{ 0xB75F, 0xB75F, 0xB75F }, -{ 0xB760, 0xB760, 0xB760 }, -{ 0xB761, 0xB761, 0xB761 }, -{ 0xB762, 0xB762, 0xB762 }, -{ 0xB763, 0xB763, 0xB763 }, -{ 0xB764, 0xB764, 0xB764 }, -{ 0xB765, 0xB765, 0xB765 }, -{ 0xB766, 0xB766, 0xB766 }, -{ 0xB767, 0xB767, 0xB767 }, -{ 0xB768, 0xB768, 0xB768 }, -{ 0xB769, 0xB769, 0xB769 }, -{ 0xB76A, 0xB76A, 0xB76A }, -{ 0xB76B, 0xB76B, 0xB76B }, -{ 0xB76C, 0xB76C, 0xB76C }, -{ 0xB76D, 0xB76D, 0xB76D }, -{ 0xB76E, 0xB76E, 0xB76E }, -{ 0xB76F, 0xB76F, 0xB76F }, -{ 0xB770, 0xB770, 0xB770 }, -{ 0xB771, 0xB771, 0xB771 }, -{ 0xB772, 0xB772, 0xB772 }, -{ 0xB773, 0xB773, 0xB773 }, -{ 0xB774, 0xB774, 0xB774 }, -{ 0xB775, 0xB775, 0xB775 }, -{ 0xB776, 0xB776, 0xB776 }, -{ 0xB777, 0xB777, 0xB777 }, -{ 0xB778, 0xB778, 0xB778 }, -{ 0xB779, 0xB779, 0xB779 }, -{ 0xB77A, 0xB77A, 0xB77A }, -{ 0xB77B, 0xB77B, 0xB77B }, -{ 0xB77C, 0xB77C, 0xB77C }, -{ 0xB77D, 0xB77D, 0xB77D }, -{ 0xB77E, 0xB77E, 0xB77E }, -{ 0xB77F, 0xB77F, 0xB77F }, -{ 0xB780, 0xB780, 0xB780 }, -{ 0xB781, 0xB781, 0xB781 }, -{ 0xB782, 0xB782, 0xB782 }, -{ 0xB783, 0xB783, 0xB783 }, -{ 0xB784, 0xB784, 0xB784 }, -{ 0xB785, 0xB785, 0xB785 }, -{ 0xB786, 0xB786, 0xB786 }, -{ 0xB787, 0xB787, 0xB787 }, -{ 0xB788, 0xB788, 0xB788 }, -{ 0xB789, 0xB789, 0xB789 }, -{ 0xB78A, 0xB78A, 0xB78A }, -{ 0xB78B, 0xB78B, 0xB78B }, -{ 0xB78C, 0xB78C, 0xB78C }, -{ 0xB78D, 0xB78D, 0xB78D }, -{ 0xB78E, 0xB78E, 0xB78E }, -{ 0xB78F, 0xB78F, 0xB78F }, -{ 0xB790, 0xB790, 0xB790 }, -{ 0xB791, 0xB791, 0xB791 }, -{ 0xB792, 0xB792, 0xB792 }, -{ 0xB793, 0xB793, 0xB793 }, -{ 0xB794, 0xB794, 0xB794 }, -{ 0xB795, 0xB795, 0xB795 }, -{ 0xB796, 0xB796, 0xB796 }, -{ 0xB797, 0xB797, 0xB797 }, -{ 0xB798, 0xB798, 0xB798 }, -{ 0xB799, 0xB799, 0xB799 }, -{ 0xB79A, 0xB79A, 0xB79A }, -{ 0xB79B, 0xB79B, 0xB79B }, -{ 0xB79C, 0xB79C, 0xB79C }, -{ 0xB79D, 0xB79D, 0xB79D }, -{ 0xB79E, 0xB79E, 0xB79E }, -{ 0xB79F, 0xB79F, 0xB79F }, -{ 0xB7A0, 0xB7A0, 0xB7A0 }, -{ 0xB7A1, 0xB7A1, 0xB7A1 }, -{ 0xB7A2, 0xB7A2, 0xB7A2 }, -{ 0xB7A3, 0xB7A3, 0xB7A3 }, -{ 0xB7A4, 0xB7A4, 0xB7A4 }, -{ 0xB7A5, 0xB7A5, 0xB7A5 }, -{ 0xB7A6, 0xB7A6, 0xB7A6 }, -{ 0xB7A7, 0xB7A7, 0xB7A7 }, -{ 0xB7A8, 0xB7A8, 0xB7A8 }, -{ 0xB7A9, 0xB7A9, 0xB7A9 }, -{ 0xB7AA, 0xB7AA, 0xB7AA }, -{ 0xB7AB, 0xB7AB, 0xB7AB }, -{ 0xB7AC, 0xB7AC, 0xB7AC }, -{ 0xB7AD, 0xB7AD, 0xB7AD }, -{ 0xB7AE, 0xB7AE, 0xB7AE }, -{ 0xB7AF, 0xB7AF, 0xB7AF }, -{ 0xB7B0, 0xB7B0, 0xB7B0 }, -{ 0xB7B1, 0xB7B1, 0xB7B1 }, -{ 0xB7B2, 0xB7B2, 0xB7B2 }, -{ 0xB7B3, 0xB7B3, 0xB7B3 }, -{ 0xB7B4, 0xB7B4, 0xB7B4 }, -{ 0xB7B5, 0xB7B5, 0xB7B5 }, -{ 0xB7B6, 0xB7B6, 0xB7B6 }, -{ 0xB7B7, 0xB7B7, 0xB7B7 }, -{ 0xB7B8, 0xB7B8, 0xB7B8 }, -{ 0xB7B9, 0xB7B9, 0xB7B9 }, -{ 0xB7BA, 0xB7BA, 0xB7BA }, -{ 0xB7BB, 0xB7BB, 0xB7BB }, -{ 0xB7BC, 0xB7BC, 0xB7BC }, -{ 0xB7BD, 0xB7BD, 0xB7BD }, -{ 0xB7BE, 0xB7BE, 0xB7BE }, -{ 0xB7BF, 0xB7BF, 0xB7BF }, -{ 0xB7C0, 0xB7C0, 0xB7C0 }, -{ 0xB7C1, 0xB7C1, 0xB7C1 }, -{ 0xB7C2, 0xB7C2, 0xB7C2 }, -{ 0xB7C3, 0xB7C3, 0xB7C3 }, -{ 0xB7C4, 0xB7C4, 0xB7C4 }, -{ 0xB7C5, 0xB7C5, 0xB7C5 }, -{ 0xB7C6, 0xB7C6, 0xB7C6 }, -{ 0xB7C7, 0xB7C7, 0xB7C7 }, -{ 0xB7C8, 0xB7C8, 0xB7C8 }, -{ 0xB7C9, 0xB7C9, 0xB7C9 }, -{ 0xB7CA, 0xB7CA, 0xB7CA }, -{ 0xB7CB, 0xB7CB, 0xB7CB }, -{ 0xB7CC, 0xB7CC, 0xB7CC }, -{ 0xB7CD, 0xB7CD, 0xB7CD }, -{ 0xB7CE, 0xB7CE, 0xB7CE }, -{ 0xB7CF, 0xB7CF, 0xB7CF }, -{ 0xB7D0, 0xB7D0, 0xB7D0 }, -{ 0xB7D1, 0xB7D1, 0xB7D1 }, -{ 0xB7D2, 0xB7D2, 0xB7D2 }, -{ 0xB7D3, 0xB7D3, 0xB7D3 }, -{ 0xB7D4, 0xB7D4, 0xB7D4 }, -{ 0xB7D5, 0xB7D5, 0xB7D5 }, -{ 0xB7D6, 0xB7D6, 0xB7D6 }, -{ 0xB7D7, 0xB7D7, 0xB7D7 }, -{ 0xB7D8, 0xB7D8, 0xB7D8 }, -{ 0xB7D9, 0xB7D9, 0xB7D9 }, -{ 0xB7DA, 0xB7DA, 0xB7DA }, -{ 0xB7DB, 0xB7DB, 0xB7DB }, -{ 0xB7DC, 0xB7DC, 0xB7DC }, -{ 0xB7DD, 0xB7DD, 0xB7DD }, -{ 0xB7DE, 0xB7DE, 0xB7DE }, -{ 0xB7DF, 0xB7DF, 0xB7DF }, -{ 0xB7E0, 0xB7E0, 0xB7E0 }, -{ 0xB7E1, 0xB7E1, 0xB7E1 }, -{ 0xB7E2, 0xB7E2, 0xB7E2 }, -{ 0xB7E3, 0xB7E3, 0xB7E3 }, -{ 0xB7E4, 0xB7E4, 0xB7E4 }, -{ 0xB7E5, 0xB7E5, 0xB7E5 }, -{ 0xB7E6, 0xB7E6, 0xB7E6 }, -{ 0xB7E7, 0xB7E7, 0xB7E7 }, -{ 0xB7E8, 0xB7E8, 0xB7E8 }, -{ 0xB7E9, 0xB7E9, 0xB7E9 }, -{ 0xB7EA, 0xB7EA, 0xB7EA }, -{ 0xB7EB, 0xB7EB, 0xB7EB }, -{ 0xB7EC, 0xB7EC, 0xB7EC }, -{ 0xB7ED, 0xB7ED, 0xB7ED }, -{ 0xB7EE, 0xB7EE, 0xB7EE }, -{ 0xB7EF, 0xB7EF, 0xB7EF }, -{ 0xB7F0, 0xB7F0, 0xB7F0 }, -{ 0xB7F1, 0xB7F1, 0xB7F1 }, -{ 0xB7F2, 0xB7F2, 0xB7F2 }, -{ 0xB7F3, 0xB7F3, 0xB7F3 }, -{ 0xB7F4, 0xB7F4, 0xB7F4 }, -{ 0xB7F5, 0xB7F5, 0xB7F5 }, -{ 0xB7F6, 0xB7F6, 0xB7F6 }, -{ 0xB7F7, 0xB7F7, 0xB7F7 }, -{ 0xB7F8, 0xB7F8, 0xB7F8 }, -{ 0xB7F9, 0xB7F9, 0xB7F9 }, -{ 0xB7FA, 0xB7FA, 0xB7FA }, -{ 0xB7FB, 0xB7FB, 0xB7FB }, -{ 0xB7FC, 0xB7FC, 0xB7FC }, -{ 0xB7FD, 0xB7FD, 0xB7FD }, -{ 0xB7FE, 0xB7FE, 0xB7FE }, -{ 0xB7FF, 0xB7FF, 0xB7FF }, -{ 0xB800, 0xB800, 0xB800 }, -{ 0xB801, 0xB801, 0xB801 }, -{ 0xB802, 0xB802, 0xB802 }, -{ 0xB803, 0xB803, 0xB803 }, -{ 0xB804, 0xB804, 0xB804 }, -{ 0xB805, 0xB805, 0xB805 }, -{ 0xB806, 0xB806, 0xB806 }, -{ 0xB807, 0xB807, 0xB807 }, -{ 0xB808, 0xB808, 0xB808 }, -{ 0xB809, 0xB809, 0xB809 }, -{ 0xB80A, 0xB80A, 0xB80A }, -{ 0xB80B, 0xB80B, 0xB80B }, -{ 0xB80C, 0xB80C, 0xB80C }, -{ 0xB80D, 0xB80D, 0xB80D }, -{ 0xB80E, 0xB80E, 0xB80E }, -{ 0xB80F, 0xB80F, 0xB80F }, -{ 0xB810, 0xB810, 0xB810 }, -{ 0xB811, 0xB811, 0xB811 }, -{ 0xB812, 0xB812, 0xB812 }, -{ 0xB813, 0xB813, 0xB813 }, -{ 0xB814, 0xB814, 0xB814 }, -{ 0xB815, 0xB815, 0xB815 }, -{ 0xB816, 0xB816, 0xB816 }, -{ 0xB817, 0xB817, 0xB817 }, -{ 0xB818, 0xB818, 0xB818 }, -{ 0xB819, 0xB819, 0xB819 }, -{ 0xB81A, 0xB81A, 0xB81A }, -{ 0xB81B, 0xB81B, 0xB81B }, -{ 0xB81C, 0xB81C, 0xB81C }, -{ 0xB81D, 0xB81D, 0xB81D }, -{ 0xB81E, 0xB81E, 0xB81E }, -{ 0xB81F, 0xB81F, 0xB81F }, -{ 0xB820, 0xB820, 0xB820 }, -{ 0xB821, 0xB821, 0xB821 }, -{ 0xB822, 0xB822, 0xB822 }, -{ 0xB823, 0xB823, 0xB823 }, -{ 0xB824, 0xB824, 0xB824 }, -{ 0xB825, 0xB825, 0xB825 }, -{ 0xB826, 0xB826, 0xB826 }, -{ 0xB827, 0xB827, 0xB827 }, -{ 0xB828, 0xB828, 0xB828 }, -{ 0xB829, 0xB829, 0xB829 }, -{ 0xB82A, 0xB82A, 0xB82A }, -{ 0xB82B, 0xB82B, 0xB82B }, -{ 0xB82C, 0xB82C, 0xB82C }, -{ 0xB82D, 0xB82D, 0xB82D }, -{ 0xB82E, 0xB82E, 0xB82E }, -{ 0xB82F, 0xB82F, 0xB82F }, -{ 0xB830, 0xB830, 0xB830 }, -{ 0xB831, 0xB831, 0xB831 }, -{ 0xB832, 0xB832, 0xB832 }, -{ 0xB833, 0xB833, 0xB833 }, -{ 0xB834, 0xB834, 0xB834 }, -{ 0xB835, 0xB835, 0xB835 }, -{ 0xB836, 0xB836, 0xB836 }, -{ 0xB837, 0xB837, 0xB837 }, -{ 0xB838, 0xB838, 0xB838 }, -{ 0xB839, 0xB839, 0xB839 }, -{ 0xB83A, 0xB83A, 0xB83A }, -{ 0xB83B, 0xB83B, 0xB83B }, -{ 0xB83C, 0xB83C, 0xB83C }, -{ 0xB83D, 0xB83D, 0xB83D }, -{ 0xB83E, 0xB83E, 0xB83E }, -{ 0xB83F, 0xB83F, 0xB83F }, -{ 0xB840, 0xB840, 0xB840 }, -{ 0xB841, 0xB841, 0xB841 }, -{ 0xB842, 0xB842, 0xB842 }, -{ 0xB843, 0xB843, 0xB843 }, -{ 0xB844, 0xB844, 0xB844 }, -{ 0xB845, 0xB845, 0xB845 }, -{ 0xB846, 0xB846, 0xB846 }, -{ 0xB847, 0xB847, 0xB847 }, -{ 0xB848, 0xB848, 0xB848 }, -{ 0xB849, 0xB849, 0xB849 }, -{ 0xB84A, 0xB84A, 0xB84A }, -{ 0xB84B, 0xB84B, 0xB84B }, -{ 0xB84C, 0xB84C, 0xB84C }, -{ 0xB84D, 0xB84D, 0xB84D }, -{ 0xB84E, 0xB84E, 0xB84E }, -{ 0xB84F, 0xB84F, 0xB84F }, -{ 0xB850, 0xB850, 0xB850 }, -{ 0xB851, 0xB851, 0xB851 }, -{ 0xB852, 0xB852, 0xB852 }, -{ 0xB853, 0xB853, 0xB853 }, -{ 0xB854, 0xB854, 0xB854 }, -{ 0xB855, 0xB855, 0xB855 }, -{ 0xB856, 0xB856, 0xB856 }, -{ 0xB857, 0xB857, 0xB857 }, -{ 0xB858, 0xB858, 0xB858 }, -{ 0xB859, 0xB859, 0xB859 }, -{ 0xB85A, 0xB85A, 0xB85A }, -{ 0xB85B, 0xB85B, 0xB85B }, -{ 0xB85C, 0xB85C, 0xB85C }, -{ 0xB85D, 0xB85D, 0xB85D }, -{ 0xB85E, 0xB85E, 0xB85E }, -{ 0xB85F, 0xB85F, 0xB85F }, -{ 0xB860, 0xB860, 0xB860 }, -{ 0xB861, 0xB861, 0xB861 }, -{ 0xB862, 0xB862, 0xB862 }, -{ 0xB863, 0xB863, 0xB863 }, -{ 0xB864, 0xB864, 0xB864 }, -{ 0xB865, 0xB865, 0xB865 }, -{ 0xB866, 0xB866, 0xB866 }, -{ 0xB867, 0xB867, 0xB867 }, -{ 0xB868, 0xB868, 0xB868 }, -{ 0xB869, 0xB869, 0xB869 }, -{ 0xB86A, 0xB86A, 0xB86A }, -{ 0xB86B, 0xB86B, 0xB86B }, -{ 0xB86C, 0xB86C, 0xB86C }, -{ 0xB86D, 0xB86D, 0xB86D }, -{ 0xB86E, 0xB86E, 0xB86E }, -{ 0xB86F, 0xB86F, 0xB86F }, -{ 0xB870, 0xB870, 0xB870 }, -{ 0xB871, 0xB871, 0xB871 }, -{ 0xB872, 0xB872, 0xB872 }, -{ 0xB873, 0xB873, 0xB873 }, -{ 0xB874, 0xB874, 0xB874 }, -{ 0xB875, 0xB875, 0xB875 }, -{ 0xB876, 0xB876, 0xB876 }, -{ 0xB877, 0xB877, 0xB877 }, -{ 0xB878, 0xB878, 0xB878 }, -{ 0xB879, 0xB879, 0xB879 }, -{ 0xB87A, 0xB87A, 0xB87A }, -{ 0xB87B, 0xB87B, 0xB87B }, -{ 0xB87C, 0xB87C, 0xB87C }, -{ 0xB87D, 0xB87D, 0xB87D }, -{ 0xB87E, 0xB87E, 0xB87E }, -{ 0xB87F, 0xB87F, 0xB87F }, -{ 0xB880, 0xB880, 0xB880 }, -{ 0xB881, 0xB881, 0xB881 }, -{ 0xB882, 0xB882, 0xB882 }, -{ 0xB883, 0xB883, 0xB883 }, -{ 0xB884, 0xB884, 0xB884 }, -{ 0xB885, 0xB885, 0xB885 }, -{ 0xB886, 0xB886, 0xB886 }, -{ 0xB887, 0xB887, 0xB887 }, -{ 0xB888, 0xB888, 0xB888 }, -{ 0xB889, 0xB889, 0xB889 }, -{ 0xB88A, 0xB88A, 0xB88A }, -{ 0xB88B, 0xB88B, 0xB88B }, -{ 0xB88C, 0xB88C, 0xB88C }, -{ 0xB88D, 0xB88D, 0xB88D }, -{ 0xB88E, 0xB88E, 0xB88E }, -{ 0xB88F, 0xB88F, 0xB88F }, -{ 0xB890, 0xB890, 0xB890 }, -{ 0xB891, 0xB891, 0xB891 }, -{ 0xB892, 0xB892, 0xB892 }, -{ 0xB893, 0xB893, 0xB893 }, -{ 0xB894, 0xB894, 0xB894 }, -{ 0xB895, 0xB895, 0xB895 }, -{ 0xB896, 0xB896, 0xB896 }, -{ 0xB897, 0xB897, 0xB897 }, -{ 0xB898, 0xB898, 0xB898 }, -{ 0xB899, 0xB899, 0xB899 }, -{ 0xB89A, 0xB89A, 0xB89A }, -{ 0xB89B, 0xB89B, 0xB89B }, -{ 0xB89C, 0xB89C, 0xB89C }, -{ 0xB89D, 0xB89D, 0xB89D }, -{ 0xB89E, 0xB89E, 0xB89E }, -{ 0xB89F, 0xB89F, 0xB89F }, -{ 0xB8A0, 0xB8A0, 0xB8A0 }, -{ 0xB8A1, 0xB8A1, 0xB8A1 }, -{ 0xB8A2, 0xB8A2, 0xB8A2 }, -{ 0xB8A3, 0xB8A3, 0xB8A3 }, -{ 0xB8A4, 0xB8A4, 0xB8A4 }, -{ 0xB8A5, 0xB8A5, 0xB8A5 }, -{ 0xB8A6, 0xB8A6, 0xB8A6 }, -{ 0xB8A7, 0xB8A7, 0xB8A7 }, -{ 0xB8A8, 0xB8A8, 0xB8A8 }, -{ 0xB8A9, 0xB8A9, 0xB8A9 }, -{ 0xB8AA, 0xB8AA, 0xB8AA }, -{ 0xB8AB, 0xB8AB, 0xB8AB }, -{ 0xB8AC, 0xB8AC, 0xB8AC }, -{ 0xB8AD, 0xB8AD, 0xB8AD }, -{ 0xB8AE, 0xB8AE, 0xB8AE }, -{ 0xB8AF, 0xB8AF, 0xB8AF }, -{ 0xB8B0, 0xB8B0, 0xB8B0 }, -{ 0xB8B1, 0xB8B1, 0xB8B1 }, -{ 0xB8B2, 0xB8B2, 0xB8B2 }, -{ 0xB8B3, 0xB8B3, 0xB8B3 }, -{ 0xB8B4, 0xB8B4, 0xB8B4 }, -{ 0xB8B5, 0xB8B5, 0xB8B5 }, -{ 0xB8B6, 0xB8B6, 0xB8B6 }, -{ 0xB8B7, 0xB8B7, 0xB8B7 }, -{ 0xB8B8, 0xB8B8, 0xB8B8 }, -{ 0xB8B9, 0xB8B9, 0xB8B9 }, -{ 0xB8BA, 0xB8BA, 0xB8BA }, -{ 0xB8BB, 0xB8BB, 0xB8BB }, -{ 0xB8BC, 0xB8BC, 0xB8BC }, -{ 0xB8BD, 0xB8BD, 0xB8BD }, -{ 0xB8BE, 0xB8BE, 0xB8BE }, -{ 0xB8BF, 0xB8BF, 0xB8BF }, -{ 0xB8C0, 0xB8C0, 0xB8C0 }, -{ 0xB8C1, 0xB8C1, 0xB8C1 }, -{ 0xB8C2, 0xB8C2, 0xB8C2 }, -{ 0xB8C3, 0xB8C3, 0xB8C3 }, -{ 0xB8C4, 0xB8C4, 0xB8C4 }, -{ 0xB8C5, 0xB8C5, 0xB8C5 }, -{ 0xB8C6, 0xB8C6, 0xB8C6 }, -{ 0xB8C7, 0xB8C7, 0xB8C7 }, -{ 0xB8C8, 0xB8C8, 0xB8C8 }, -{ 0xB8C9, 0xB8C9, 0xB8C9 }, -{ 0xB8CA, 0xB8CA, 0xB8CA }, -{ 0xB8CB, 0xB8CB, 0xB8CB }, -{ 0xB8CC, 0xB8CC, 0xB8CC }, -{ 0xB8CD, 0xB8CD, 0xB8CD }, -{ 0xB8CE, 0xB8CE, 0xB8CE }, -{ 0xB8CF, 0xB8CF, 0xB8CF }, -{ 0xB8D0, 0xB8D0, 0xB8D0 }, -{ 0xB8D1, 0xB8D1, 0xB8D1 }, -{ 0xB8D2, 0xB8D2, 0xB8D2 }, -{ 0xB8D3, 0xB8D3, 0xB8D3 }, -{ 0xB8D4, 0xB8D4, 0xB8D4 }, -{ 0xB8D5, 0xB8D5, 0xB8D5 }, -{ 0xB8D6, 0xB8D6, 0xB8D6 }, -{ 0xB8D7, 0xB8D7, 0xB8D7 }, -{ 0xB8D8, 0xB8D8, 0xB8D8 }, -{ 0xB8D9, 0xB8D9, 0xB8D9 }, -{ 0xB8DA, 0xB8DA, 0xB8DA }, -{ 0xB8DB, 0xB8DB, 0xB8DB }, -{ 0xB8DC, 0xB8DC, 0xB8DC }, -{ 0xB8DD, 0xB8DD, 0xB8DD }, -{ 0xB8DE, 0xB8DE, 0xB8DE }, -{ 0xB8DF, 0xB8DF, 0xB8DF }, -{ 0xB8E0, 0xB8E0, 0xB8E0 }, -{ 0xB8E1, 0xB8E1, 0xB8E1 }, -{ 0xB8E2, 0xB8E2, 0xB8E2 }, -{ 0xB8E3, 0xB8E3, 0xB8E3 }, -{ 0xB8E4, 0xB8E4, 0xB8E4 }, -{ 0xB8E5, 0xB8E5, 0xB8E5 }, -{ 0xB8E6, 0xB8E6, 0xB8E6 }, -{ 0xB8E7, 0xB8E7, 0xB8E7 }, -{ 0xB8E8, 0xB8E8, 0xB8E8 }, -{ 0xB8E9, 0xB8E9, 0xB8E9 }, -{ 0xB8EA, 0xB8EA, 0xB8EA }, -{ 0xB8EB, 0xB8EB, 0xB8EB }, -{ 0xB8EC, 0xB8EC, 0xB8EC }, -{ 0xB8ED, 0xB8ED, 0xB8ED }, -{ 0xB8EE, 0xB8EE, 0xB8EE }, -{ 0xB8EF, 0xB8EF, 0xB8EF }, -{ 0xB8F0, 0xB8F0, 0xB8F0 }, -{ 0xB8F1, 0xB8F1, 0xB8F1 }, -{ 0xB8F2, 0xB8F2, 0xB8F2 }, -{ 0xB8F3, 0xB8F3, 0xB8F3 }, -{ 0xB8F4, 0xB8F4, 0xB8F4 }, -{ 0xB8F5, 0xB8F5, 0xB8F5 }, -{ 0xB8F6, 0xB8F6, 0xB8F6 }, -{ 0xB8F7, 0xB8F7, 0xB8F7 }, -{ 0xB8F8, 0xB8F8, 0xB8F8 }, -{ 0xB8F9, 0xB8F9, 0xB8F9 }, -{ 0xB8FA, 0xB8FA, 0xB8FA }, -{ 0xB8FB, 0xB8FB, 0xB8FB }, -{ 0xB8FC, 0xB8FC, 0xB8FC }, -{ 0xB8FD, 0xB8FD, 0xB8FD }, -{ 0xB8FE, 0xB8FE, 0xB8FE }, -{ 0xB8FF, 0xB8FF, 0xB8FF }, -{ 0xB900, 0xB900, 0xB900 }, -{ 0xB901, 0xB901, 0xB901 }, -{ 0xB902, 0xB902, 0xB902 }, -{ 0xB903, 0xB903, 0xB903 }, -{ 0xB904, 0xB904, 0xB904 }, -{ 0xB905, 0xB905, 0xB905 }, -{ 0xB906, 0xB906, 0xB906 }, -{ 0xB907, 0xB907, 0xB907 }, -{ 0xB908, 0xB908, 0xB908 }, -{ 0xB909, 0xB909, 0xB909 }, -{ 0xB90A, 0xB90A, 0xB90A }, -{ 0xB90B, 0xB90B, 0xB90B }, -{ 0xB90C, 0xB90C, 0xB90C }, -{ 0xB90D, 0xB90D, 0xB90D }, -{ 0xB90E, 0xB90E, 0xB90E }, -{ 0xB90F, 0xB90F, 0xB90F }, -{ 0xB910, 0xB910, 0xB910 }, -{ 0xB911, 0xB911, 0xB911 }, -{ 0xB912, 0xB912, 0xB912 }, -{ 0xB913, 0xB913, 0xB913 }, -{ 0xB914, 0xB914, 0xB914 }, -{ 0xB915, 0xB915, 0xB915 }, -{ 0xB916, 0xB916, 0xB916 }, -{ 0xB917, 0xB917, 0xB917 }, -{ 0xB918, 0xB918, 0xB918 }, -{ 0xB919, 0xB919, 0xB919 }, -{ 0xB91A, 0xB91A, 0xB91A }, -{ 0xB91B, 0xB91B, 0xB91B }, -{ 0xB91C, 0xB91C, 0xB91C }, -{ 0xB91D, 0xB91D, 0xB91D }, -{ 0xB91E, 0xB91E, 0xB91E }, -{ 0xB91F, 0xB91F, 0xB91F }, -{ 0xB920, 0xB920, 0xB920 }, -{ 0xB921, 0xB921, 0xB921 }, -{ 0xB922, 0xB922, 0xB922 }, -{ 0xB923, 0xB923, 0xB923 }, -{ 0xB924, 0xB924, 0xB924 }, -{ 0xB925, 0xB925, 0xB925 }, -{ 0xB926, 0xB926, 0xB926 }, -{ 0xB927, 0xB927, 0xB927 }, -{ 0xB928, 0xB928, 0xB928 }, -{ 0xB929, 0xB929, 0xB929 }, -{ 0xB92A, 0xB92A, 0xB92A }, -{ 0xB92B, 0xB92B, 0xB92B }, -{ 0xB92C, 0xB92C, 0xB92C }, -{ 0xB92D, 0xB92D, 0xB92D }, -{ 0xB92E, 0xB92E, 0xB92E }, -{ 0xB92F, 0xB92F, 0xB92F }, -{ 0xB930, 0xB930, 0xB930 }, -{ 0xB931, 0xB931, 0xB931 }, -{ 0xB932, 0xB932, 0xB932 }, -{ 0xB933, 0xB933, 0xB933 }, -{ 0xB934, 0xB934, 0xB934 }, -{ 0xB935, 0xB935, 0xB935 }, -{ 0xB936, 0xB936, 0xB936 }, -{ 0xB937, 0xB937, 0xB937 }, -{ 0xB938, 0xB938, 0xB938 }, -{ 0xB939, 0xB939, 0xB939 }, -{ 0xB93A, 0xB93A, 0xB93A }, -{ 0xB93B, 0xB93B, 0xB93B }, -{ 0xB93C, 0xB93C, 0xB93C }, -{ 0xB93D, 0xB93D, 0xB93D }, -{ 0xB93E, 0xB93E, 0xB93E }, -{ 0xB93F, 0xB93F, 0xB93F }, -{ 0xB940, 0xB940, 0xB940 }, -{ 0xB941, 0xB941, 0xB941 }, -{ 0xB942, 0xB942, 0xB942 }, -{ 0xB943, 0xB943, 0xB943 }, -{ 0xB944, 0xB944, 0xB944 }, -{ 0xB945, 0xB945, 0xB945 }, -{ 0xB946, 0xB946, 0xB946 }, -{ 0xB947, 0xB947, 0xB947 }, -{ 0xB948, 0xB948, 0xB948 }, -{ 0xB949, 0xB949, 0xB949 }, -{ 0xB94A, 0xB94A, 0xB94A }, -{ 0xB94B, 0xB94B, 0xB94B }, -{ 0xB94C, 0xB94C, 0xB94C }, -{ 0xB94D, 0xB94D, 0xB94D }, -{ 0xB94E, 0xB94E, 0xB94E }, -{ 0xB94F, 0xB94F, 0xB94F }, -{ 0xB950, 0xB950, 0xB950 }, -{ 0xB951, 0xB951, 0xB951 }, -{ 0xB952, 0xB952, 0xB952 }, -{ 0xB953, 0xB953, 0xB953 }, -{ 0xB954, 0xB954, 0xB954 }, -{ 0xB955, 0xB955, 0xB955 }, -{ 0xB956, 0xB956, 0xB956 }, -{ 0xB957, 0xB957, 0xB957 }, -{ 0xB958, 0xB958, 0xB958 }, -{ 0xB959, 0xB959, 0xB959 }, -{ 0xB95A, 0xB95A, 0xB95A }, -{ 0xB95B, 0xB95B, 0xB95B }, -{ 0xB95C, 0xB95C, 0xB95C }, -{ 0xB95D, 0xB95D, 0xB95D }, -{ 0xB95E, 0xB95E, 0xB95E }, -{ 0xB95F, 0xB95F, 0xB95F }, -{ 0xB960, 0xB960, 0xB960 }, -{ 0xB961, 0xB961, 0xB961 }, -{ 0xB962, 0xB962, 0xB962 }, -{ 0xB963, 0xB963, 0xB963 }, -{ 0xB964, 0xB964, 0xB964 }, -{ 0xB965, 0xB965, 0xB965 }, -{ 0xB966, 0xB966, 0xB966 }, -{ 0xB967, 0xB967, 0xB967 }, -{ 0xB968, 0xB968, 0xB968 }, -{ 0xB969, 0xB969, 0xB969 }, -{ 0xB96A, 0xB96A, 0xB96A }, -{ 0xB96B, 0xB96B, 0xB96B }, -{ 0xB96C, 0xB96C, 0xB96C }, -{ 0xB96D, 0xB96D, 0xB96D }, -{ 0xB96E, 0xB96E, 0xB96E }, -{ 0xB96F, 0xB96F, 0xB96F }, -{ 0xB970, 0xB970, 0xB970 }, -{ 0xB971, 0xB971, 0xB971 }, -{ 0xB972, 0xB972, 0xB972 }, -{ 0xB973, 0xB973, 0xB973 }, -{ 0xB974, 0xB974, 0xB974 }, -{ 0xB975, 0xB975, 0xB975 }, -{ 0xB976, 0xB976, 0xB976 }, -{ 0xB977, 0xB977, 0xB977 }, -{ 0xB978, 0xB978, 0xB978 }, -{ 0xB979, 0xB979, 0xB979 }, -{ 0xB97A, 0xB97A, 0xB97A }, -{ 0xB97B, 0xB97B, 0xB97B }, -{ 0xB97C, 0xB97C, 0xB97C }, -{ 0xB97D, 0xB97D, 0xB97D }, -{ 0xB97E, 0xB97E, 0xB97E }, -{ 0xB97F, 0xB97F, 0xB97F }, -{ 0xB980, 0xB980, 0xB980 }, -{ 0xB981, 0xB981, 0xB981 }, -{ 0xB982, 0xB982, 0xB982 }, -{ 0xB983, 0xB983, 0xB983 }, -{ 0xB984, 0xB984, 0xB984 }, -{ 0xB985, 0xB985, 0xB985 }, -{ 0xB986, 0xB986, 0xB986 }, -{ 0xB987, 0xB987, 0xB987 }, -{ 0xB988, 0xB988, 0xB988 }, -{ 0xB989, 0xB989, 0xB989 }, -{ 0xB98A, 0xB98A, 0xB98A }, -{ 0xB98B, 0xB98B, 0xB98B }, -{ 0xB98C, 0xB98C, 0xB98C }, -{ 0xB98D, 0xB98D, 0xB98D }, -{ 0xB98E, 0xB98E, 0xB98E }, -{ 0xB98F, 0xB98F, 0xB98F }, -{ 0xB990, 0xB990, 0xB990 }, -{ 0xB991, 0xB991, 0xB991 }, -{ 0xB992, 0xB992, 0xB992 }, -{ 0xB993, 0xB993, 0xB993 }, -{ 0xB994, 0xB994, 0xB994 }, -{ 0xB995, 0xB995, 0xB995 }, -{ 0xB996, 0xB996, 0xB996 }, -{ 0xB997, 0xB997, 0xB997 }, -{ 0xB998, 0xB998, 0xB998 }, -{ 0xB999, 0xB999, 0xB999 }, -{ 0xB99A, 0xB99A, 0xB99A }, -{ 0xB99B, 0xB99B, 0xB99B }, -{ 0xB99C, 0xB99C, 0xB99C }, -{ 0xB99D, 0xB99D, 0xB99D }, -{ 0xB99E, 0xB99E, 0xB99E }, -{ 0xB99F, 0xB99F, 0xB99F }, -{ 0xB9A0, 0xB9A0, 0xB9A0 }, -{ 0xB9A1, 0xB9A1, 0xB9A1 }, -{ 0xB9A2, 0xB9A2, 0xB9A2 }, -{ 0xB9A3, 0xB9A3, 0xB9A3 }, -{ 0xB9A4, 0xB9A4, 0xB9A4 }, -{ 0xB9A5, 0xB9A5, 0xB9A5 }, -{ 0xB9A6, 0xB9A6, 0xB9A6 }, -{ 0xB9A7, 0xB9A7, 0xB9A7 }, -{ 0xB9A8, 0xB9A8, 0xB9A8 }, -{ 0xB9A9, 0xB9A9, 0xB9A9 }, -{ 0xB9AA, 0xB9AA, 0xB9AA }, -{ 0xB9AB, 0xB9AB, 0xB9AB }, -{ 0xB9AC, 0xB9AC, 0xB9AC }, -{ 0xB9AD, 0xB9AD, 0xB9AD }, -{ 0xB9AE, 0xB9AE, 0xB9AE }, -{ 0xB9AF, 0xB9AF, 0xB9AF }, -{ 0xB9B0, 0xB9B0, 0xB9B0 }, -{ 0xB9B1, 0xB9B1, 0xB9B1 }, -{ 0xB9B2, 0xB9B2, 0xB9B2 }, -{ 0xB9B3, 0xB9B3, 0xB9B3 }, -{ 0xB9B4, 0xB9B4, 0xB9B4 }, -{ 0xB9B5, 0xB9B5, 0xB9B5 }, -{ 0xB9B6, 0xB9B6, 0xB9B6 }, -{ 0xB9B7, 0xB9B7, 0xB9B7 }, -{ 0xB9B8, 0xB9B8, 0xB9B8 }, -{ 0xB9B9, 0xB9B9, 0xB9B9 }, -{ 0xB9BA, 0xB9BA, 0xB9BA }, -{ 0xB9BB, 0xB9BB, 0xB9BB }, -{ 0xB9BC, 0xB9BC, 0xB9BC }, -{ 0xB9BD, 0xB9BD, 0xB9BD }, -{ 0xB9BE, 0xB9BE, 0xB9BE }, -{ 0xB9BF, 0xB9BF, 0xB9BF }, -{ 0xB9C0, 0xB9C0, 0xB9C0 }, -{ 0xB9C1, 0xB9C1, 0xB9C1 }, -{ 0xB9C2, 0xB9C2, 0xB9C2 }, -{ 0xB9C3, 0xB9C3, 0xB9C3 }, -{ 0xB9C4, 0xB9C4, 0xB9C4 }, -{ 0xB9C5, 0xB9C5, 0xB9C5 }, -{ 0xB9C6, 0xB9C6, 0xB9C6 }, -{ 0xB9C7, 0xB9C7, 0xB9C7 }, -{ 0xB9C8, 0xB9C8, 0xB9C8 }, -{ 0xB9C9, 0xB9C9, 0xB9C9 }, -{ 0xB9CA, 0xB9CA, 0xB9CA }, -{ 0xB9CB, 0xB9CB, 0xB9CB }, -{ 0xB9CC, 0xB9CC, 0xB9CC }, -{ 0xB9CD, 0xB9CD, 0xB9CD }, -{ 0xB9CE, 0xB9CE, 0xB9CE }, -{ 0xB9CF, 0xB9CF, 0xB9CF }, -{ 0xB9D0, 0xB9D0, 0xB9D0 }, -{ 0xB9D1, 0xB9D1, 0xB9D1 }, -{ 0xB9D2, 0xB9D2, 0xB9D2 }, -{ 0xB9D3, 0xB9D3, 0xB9D3 }, -{ 0xB9D4, 0xB9D4, 0xB9D4 }, -{ 0xB9D5, 0xB9D5, 0xB9D5 }, -{ 0xB9D6, 0xB9D6, 0xB9D6 }, -{ 0xB9D7, 0xB9D7, 0xB9D7 }, -{ 0xB9D8, 0xB9D8, 0xB9D8 }, -{ 0xB9D9, 0xB9D9, 0xB9D9 }, -{ 0xB9DA, 0xB9DA, 0xB9DA }, -{ 0xB9DB, 0xB9DB, 0xB9DB }, -{ 0xB9DC, 0xB9DC, 0xB9DC }, -{ 0xB9DD, 0xB9DD, 0xB9DD }, -{ 0xB9DE, 0xB9DE, 0xB9DE }, -{ 0xB9DF, 0xB9DF, 0xB9DF }, -{ 0xB9E0, 0xB9E0, 0xB9E0 }, -{ 0xB9E1, 0xB9E1, 0xB9E1 }, -{ 0xB9E2, 0xB9E2, 0xB9E2 }, -{ 0xB9E3, 0xB9E3, 0xB9E3 }, -{ 0xB9E4, 0xB9E4, 0xB9E4 }, -{ 0xB9E5, 0xB9E5, 0xB9E5 }, -{ 0xB9E6, 0xB9E6, 0xB9E6 }, -{ 0xB9E7, 0xB9E7, 0xB9E7 }, -{ 0xB9E8, 0xB9E8, 0xB9E8 }, -{ 0xB9E9, 0xB9E9, 0xB9E9 }, -{ 0xB9EA, 0xB9EA, 0xB9EA }, -{ 0xB9EB, 0xB9EB, 0xB9EB }, -{ 0xB9EC, 0xB9EC, 0xB9EC }, -{ 0xB9ED, 0xB9ED, 0xB9ED }, -{ 0xB9EE, 0xB9EE, 0xB9EE }, -{ 0xB9EF, 0xB9EF, 0xB9EF }, -{ 0xB9F0, 0xB9F0, 0xB9F0 }, -{ 0xB9F1, 0xB9F1, 0xB9F1 }, -{ 0xB9F2, 0xB9F2, 0xB9F2 }, -{ 0xB9F3, 0xB9F3, 0xB9F3 }, -{ 0xB9F4, 0xB9F4, 0xB9F4 }, -{ 0xB9F5, 0xB9F5, 0xB9F5 }, -{ 0xB9F6, 0xB9F6, 0xB9F6 }, -{ 0xB9F7, 0xB9F7, 0xB9F7 }, -{ 0xB9F8, 0xB9F8, 0xB9F8 }, -{ 0xB9F9, 0xB9F9, 0xB9F9 }, -{ 0xB9FA, 0xB9FA, 0xB9FA }, -{ 0xB9FB, 0xB9FB, 0xB9FB }, -{ 0xB9FC, 0xB9FC, 0xB9FC }, -{ 0xB9FD, 0xB9FD, 0xB9FD }, -{ 0xB9FE, 0xB9FE, 0xB9FE }, -{ 0xB9FF, 0xB9FF, 0xB9FF }, -{ 0xBA00, 0xBA00, 0xBA00 }, -{ 0xBA01, 0xBA01, 0xBA01 }, -{ 0xBA02, 0xBA02, 0xBA02 }, -{ 0xBA03, 0xBA03, 0xBA03 }, -{ 0xBA04, 0xBA04, 0xBA04 }, -{ 0xBA05, 0xBA05, 0xBA05 }, -{ 0xBA06, 0xBA06, 0xBA06 }, -{ 0xBA07, 0xBA07, 0xBA07 }, -{ 0xBA08, 0xBA08, 0xBA08 }, -{ 0xBA09, 0xBA09, 0xBA09 }, -{ 0xBA0A, 0xBA0A, 0xBA0A }, -{ 0xBA0B, 0xBA0B, 0xBA0B }, -{ 0xBA0C, 0xBA0C, 0xBA0C }, -{ 0xBA0D, 0xBA0D, 0xBA0D }, -{ 0xBA0E, 0xBA0E, 0xBA0E }, -{ 0xBA0F, 0xBA0F, 0xBA0F }, -{ 0xBA10, 0xBA10, 0xBA10 }, -{ 0xBA11, 0xBA11, 0xBA11 }, -{ 0xBA12, 0xBA12, 0xBA12 }, -{ 0xBA13, 0xBA13, 0xBA13 }, -{ 0xBA14, 0xBA14, 0xBA14 }, -{ 0xBA15, 0xBA15, 0xBA15 }, -{ 0xBA16, 0xBA16, 0xBA16 }, -{ 0xBA17, 0xBA17, 0xBA17 }, -{ 0xBA18, 0xBA18, 0xBA18 }, -{ 0xBA19, 0xBA19, 0xBA19 }, -{ 0xBA1A, 0xBA1A, 0xBA1A }, -{ 0xBA1B, 0xBA1B, 0xBA1B }, -{ 0xBA1C, 0xBA1C, 0xBA1C }, -{ 0xBA1D, 0xBA1D, 0xBA1D }, -{ 0xBA1E, 0xBA1E, 0xBA1E }, -{ 0xBA1F, 0xBA1F, 0xBA1F }, -{ 0xBA20, 0xBA20, 0xBA20 }, -{ 0xBA21, 0xBA21, 0xBA21 }, -{ 0xBA22, 0xBA22, 0xBA22 }, -{ 0xBA23, 0xBA23, 0xBA23 }, -{ 0xBA24, 0xBA24, 0xBA24 }, -{ 0xBA25, 0xBA25, 0xBA25 }, -{ 0xBA26, 0xBA26, 0xBA26 }, -{ 0xBA27, 0xBA27, 0xBA27 }, -{ 0xBA28, 0xBA28, 0xBA28 }, -{ 0xBA29, 0xBA29, 0xBA29 }, -{ 0xBA2A, 0xBA2A, 0xBA2A }, -{ 0xBA2B, 0xBA2B, 0xBA2B }, -{ 0xBA2C, 0xBA2C, 0xBA2C }, -{ 0xBA2D, 0xBA2D, 0xBA2D }, -{ 0xBA2E, 0xBA2E, 0xBA2E }, -{ 0xBA2F, 0xBA2F, 0xBA2F }, -{ 0xBA30, 0xBA30, 0xBA30 }, -{ 0xBA31, 0xBA31, 0xBA31 }, -{ 0xBA32, 0xBA32, 0xBA32 }, -{ 0xBA33, 0xBA33, 0xBA33 }, -{ 0xBA34, 0xBA34, 0xBA34 }, -{ 0xBA35, 0xBA35, 0xBA35 }, -{ 0xBA36, 0xBA36, 0xBA36 }, -{ 0xBA37, 0xBA37, 0xBA37 }, -{ 0xBA38, 0xBA38, 0xBA38 }, -{ 0xBA39, 0xBA39, 0xBA39 }, -{ 0xBA3A, 0xBA3A, 0xBA3A }, -{ 0xBA3B, 0xBA3B, 0xBA3B }, -{ 0xBA3C, 0xBA3C, 0xBA3C }, -{ 0xBA3D, 0xBA3D, 0xBA3D }, -{ 0xBA3E, 0xBA3E, 0xBA3E }, -{ 0xBA3F, 0xBA3F, 0xBA3F }, -{ 0xBA40, 0xBA40, 0xBA40 }, -{ 0xBA41, 0xBA41, 0xBA41 }, -{ 0xBA42, 0xBA42, 0xBA42 }, -{ 0xBA43, 0xBA43, 0xBA43 }, -{ 0xBA44, 0xBA44, 0xBA44 }, -{ 0xBA45, 0xBA45, 0xBA45 }, -{ 0xBA46, 0xBA46, 0xBA46 }, -{ 0xBA47, 0xBA47, 0xBA47 }, -{ 0xBA48, 0xBA48, 0xBA48 }, -{ 0xBA49, 0xBA49, 0xBA49 }, -{ 0xBA4A, 0xBA4A, 0xBA4A }, -{ 0xBA4B, 0xBA4B, 0xBA4B }, -{ 0xBA4C, 0xBA4C, 0xBA4C }, -{ 0xBA4D, 0xBA4D, 0xBA4D }, -{ 0xBA4E, 0xBA4E, 0xBA4E }, -{ 0xBA4F, 0xBA4F, 0xBA4F }, -{ 0xBA50, 0xBA50, 0xBA50 }, -{ 0xBA51, 0xBA51, 0xBA51 }, -{ 0xBA52, 0xBA52, 0xBA52 }, -{ 0xBA53, 0xBA53, 0xBA53 }, -{ 0xBA54, 0xBA54, 0xBA54 }, -{ 0xBA55, 0xBA55, 0xBA55 }, -{ 0xBA56, 0xBA56, 0xBA56 }, -{ 0xBA57, 0xBA57, 0xBA57 }, -{ 0xBA58, 0xBA58, 0xBA58 }, -{ 0xBA59, 0xBA59, 0xBA59 }, -{ 0xBA5A, 0xBA5A, 0xBA5A }, -{ 0xBA5B, 0xBA5B, 0xBA5B }, -{ 0xBA5C, 0xBA5C, 0xBA5C }, -{ 0xBA5D, 0xBA5D, 0xBA5D }, -{ 0xBA5E, 0xBA5E, 0xBA5E }, -{ 0xBA5F, 0xBA5F, 0xBA5F }, -{ 0xBA60, 0xBA60, 0xBA60 }, -{ 0xBA61, 0xBA61, 0xBA61 }, -{ 0xBA62, 0xBA62, 0xBA62 }, -{ 0xBA63, 0xBA63, 0xBA63 }, -{ 0xBA64, 0xBA64, 0xBA64 }, -{ 0xBA65, 0xBA65, 0xBA65 }, -{ 0xBA66, 0xBA66, 0xBA66 }, -{ 0xBA67, 0xBA67, 0xBA67 }, -{ 0xBA68, 0xBA68, 0xBA68 }, -{ 0xBA69, 0xBA69, 0xBA69 }, -{ 0xBA6A, 0xBA6A, 0xBA6A }, -{ 0xBA6B, 0xBA6B, 0xBA6B }, -{ 0xBA6C, 0xBA6C, 0xBA6C }, -{ 0xBA6D, 0xBA6D, 0xBA6D }, -{ 0xBA6E, 0xBA6E, 0xBA6E }, -{ 0xBA6F, 0xBA6F, 0xBA6F }, -{ 0xBA70, 0xBA70, 0xBA70 }, -{ 0xBA71, 0xBA71, 0xBA71 }, -{ 0xBA72, 0xBA72, 0xBA72 }, -{ 0xBA73, 0xBA73, 0xBA73 }, -{ 0xBA74, 0xBA74, 0xBA74 }, -{ 0xBA75, 0xBA75, 0xBA75 }, -{ 0xBA76, 0xBA76, 0xBA76 }, -{ 0xBA77, 0xBA77, 0xBA77 }, -{ 0xBA78, 0xBA78, 0xBA78 }, -{ 0xBA79, 0xBA79, 0xBA79 }, -{ 0xBA7A, 0xBA7A, 0xBA7A }, -{ 0xBA7B, 0xBA7B, 0xBA7B }, -{ 0xBA7C, 0xBA7C, 0xBA7C }, -{ 0xBA7D, 0xBA7D, 0xBA7D }, -{ 0xBA7E, 0xBA7E, 0xBA7E }, -{ 0xBA7F, 0xBA7F, 0xBA7F }, -{ 0xBA80, 0xBA80, 0xBA80 }, -{ 0xBA81, 0xBA81, 0xBA81 }, -{ 0xBA82, 0xBA82, 0xBA82 }, -{ 0xBA83, 0xBA83, 0xBA83 }, -{ 0xBA84, 0xBA84, 0xBA84 }, -{ 0xBA85, 0xBA85, 0xBA85 }, -{ 0xBA86, 0xBA86, 0xBA86 }, -{ 0xBA87, 0xBA87, 0xBA87 }, -{ 0xBA88, 0xBA88, 0xBA88 }, -{ 0xBA89, 0xBA89, 0xBA89 }, -{ 0xBA8A, 0xBA8A, 0xBA8A }, -{ 0xBA8B, 0xBA8B, 0xBA8B }, -{ 0xBA8C, 0xBA8C, 0xBA8C }, -{ 0xBA8D, 0xBA8D, 0xBA8D }, -{ 0xBA8E, 0xBA8E, 0xBA8E }, -{ 0xBA8F, 0xBA8F, 0xBA8F }, -{ 0xBA90, 0xBA90, 0xBA90 }, -{ 0xBA91, 0xBA91, 0xBA91 }, -{ 0xBA92, 0xBA92, 0xBA92 }, -{ 0xBA93, 0xBA93, 0xBA93 }, -{ 0xBA94, 0xBA94, 0xBA94 }, -{ 0xBA95, 0xBA95, 0xBA95 }, -{ 0xBA96, 0xBA96, 0xBA96 }, -{ 0xBA97, 0xBA97, 0xBA97 }, -{ 0xBA98, 0xBA98, 0xBA98 }, -{ 0xBA99, 0xBA99, 0xBA99 }, -{ 0xBA9A, 0xBA9A, 0xBA9A }, -{ 0xBA9B, 0xBA9B, 0xBA9B }, -{ 0xBA9C, 0xBA9C, 0xBA9C }, -{ 0xBA9D, 0xBA9D, 0xBA9D }, -{ 0xBA9E, 0xBA9E, 0xBA9E }, -{ 0xBA9F, 0xBA9F, 0xBA9F }, -{ 0xBAA0, 0xBAA0, 0xBAA0 }, -{ 0xBAA1, 0xBAA1, 0xBAA1 }, -{ 0xBAA2, 0xBAA2, 0xBAA2 }, -{ 0xBAA3, 0xBAA3, 0xBAA3 }, -{ 0xBAA4, 0xBAA4, 0xBAA4 }, -{ 0xBAA5, 0xBAA5, 0xBAA5 }, -{ 0xBAA6, 0xBAA6, 0xBAA6 }, -{ 0xBAA7, 0xBAA7, 0xBAA7 }, -{ 0xBAA8, 0xBAA8, 0xBAA8 }, -{ 0xBAA9, 0xBAA9, 0xBAA9 }, -{ 0xBAAA, 0xBAAA, 0xBAAA }, -{ 0xBAAB, 0xBAAB, 0xBAAB }, -{ 0xBAAC, 0xBAAC, 0xBAAC }, -{ 0xBAAD, 0xBAAD, 0xBAAD }, -{ 0xBAAE, 0xBAAE, 0xBAAE }, -{ 0xBAAF, 0xBAAF, 0xBAAF }, -{ 0xBAB0, 0xBAB0, 0xBAB0 }, -{ 0xBAB1, 0xBAB1, 0xBAB1 }, -{ 0xBAB2, 0xBAB2, 0xBAB2 }, -{ 0xBAB3, 0xBAB3, 0xBAB3 }, -{ 0xBAB4, 0xBAB4, 0xBAB4 }, -{ 0xBAB5, 0xBAB5, 0xBAB5 }, -{ 0xBAB6, 0xBAB6, 0xBAB6 }, -{ 0xBAB7, 0xBAB7, 0xBAB7 }, -{ 0xBAB8, 0xBAB8, 0xBAB8 }, -{ 0xBAB9, 0xBAB9, 0xBAB9 }, -{ 0xBABA, 0xBABA, 0xBABA }, -{ 0xBABB, 0xBABB, 0xBABB }, -{ 0xBABC, 0xBABC, 0xBABC }, -{ 0xBABD, 0xBABD, 0xBABD }, -{ 0xBABE, 0xBABE, 0xBABE }, -{ 0xBABF, 0xBABF, 0xBABF }, -{ 0xBAC0, 0xBAC0, 0xBAC0 }, -{ 0xBAC1, 0xBAC1, 0xBAC1 }, -{ 0xBAC2, 0xBAC2, 0xBAC2 }, -{ 0xBAC3, 0xBAC3, 0xBAC3 }, -{ 0xBAC4, 0xBAC4, 0xBAC4 }, -{ 0xBAC5, 0xBAC5, 0xBAC5 }, -{ 0xBAC6, 0xBAC6, 0xBAC6 }, -{ 0xBAC7, 0xBAC7, 0xBAC7 }, -{ 0xBAC8, 0xBAC8, 0xBAC8 }, -{ 0xBAC9, 0xBAC9, 0xBAC9 }, -{ 0xBACA, 0xBACA, 0xBACA }, -{ 0xBACB, 0xBACB, 0xBACB }, -{ 0xBACC, 0xBACC, 0xBACC }, -{ 0xBACD, 0xBACD, 0xBACD }, -{ 0xBACE, 0xBACE, 0xBACE }, -{ 0xBACF, 0xBACF, 0xBACF }, -{ 0xBAD0, 0xBAD0, 0xBAD0 }, -{ 0xBAD1, 0xBAD1, 0xBAD1 }, -{ 0xBAD2, 0xBAD2, 0xBAD2 }, -{ 0xBAD3, 0xBAD3, 0xBAD3 }, -{ 0xBAD4, 0xBAD4, 0xBAD4 }, -{ 0xBAD5, 0xBAD5, 0xBAD5 }, -{ 0xBAD6, 0xBAD6, 0xBAD6 }, -{ 0xBAD7, 0xBAD7, 0xBAD7 }, -{ 0xBAD8, 0xBAD8, 0xBAD8 }, -{ 0xBAD9, 0xBAD9, 0xBAD9 }, -{ 0xBADA, 0xBADA, 0xBADA }, -{ 0xBADB, 0xBADB, 0xBADB }, -{ 0xBADC, 0xBADC, 0xBADC }, -{ 0xBADD, 0xBADD, 0xBADD }, -{ 0xBADE, 0xBADE, 0xBADE }, -{ 0xBADF, 0xBADF, 0xBADF }, -{ 0xBAE0, 0xBAE0, 0xBAE0 }, -{ 0xBAE1, 0xBAE1, 0xBAE1 }, -{ 0xBAE2, 0xBAE2, 0xBAE2 }, -{ 0xBAE3, 0xBAE3, 0xBAE3 }, -{ 0xBAE4, 0xBAE4, 0xBAE4 }, -{ 0xBAE5, 0xBAE5, 0xBAE5 }, -{ 0xBAE6, 0xBAE6, 0xBAE6 }, -{ 0xBAE7, 0xBAE7, 0xBAE7 }, -{ 0xBAE8, 0xBAE8, 0xBAE8 }, -{ 0xBAE9, 0xBAE9, 0xBAE9 }, -{ 0xBAEA, 0xBAEA, 0xBAEA }, -{ 0xBAEB, 0xBAEB, 0xBAEB }, -{ 0xBAEC, 0xBAEC, 0xBAEC }, -{ 0xBAED, 0xBAED, 0xBAED }, -{ 0xBAEE, 0xBAEE, 0xBAEE }, -{ 0xBAEF, 0xBAEF, 0xBAEF }, -{ 0xBAF0, 0xBAF0, 0xBAF0 }, -{ 0xBAF1, 0xBAF1, 0xBAF1 }, -{ 0xBAF2, 0xBAF2, 0xBAF2 }, -{ 0xBAF3, 0xBAF3, 0xBAF3 }, -{ 0xBAF4, 0xBAF4, 0xBAF4 }, -{ 0xBAF5, 0xBAF5, 0xBAF5 }, -{ 0xBAF6, 0xBAF6, 0xBAF6 }, -{ 0xBAF7, 0xBAF7, 0xBAF7 }, -{ 0xBAF8, 0xBAF8, 0xBAF8 }, -{ 0xBAF9, 0xBAF9, 0xBAF9 }, -{ 0xBAFA, 0xBAFA, 0xBAFA }, -{ 0xBAFB, 0xBAFB, 0xBAFB }, -{ 0xBAFC, 0xBAFC, 0xBAFC }, -{ 0xBAFD, 0xBAFD, 0xBAFD }, -{ 0xBAFE, 0xBAFE, 0xBAFE }, -{ 0xBAFF, 0xBAFF, 0xBAFF }, -{ 0xBB00, 0xBB00, 0xBB00 }, -{ 0xBB01, 0xBB01, 0xBB01 }, -{ 0xBB02, 0xBB02, 0xBB02 }, -{ 0xBB03, 0xBB03, 0xBB03 }, -{ 0xBB04, 0xBB04, 0xBB04 }, -{ 0xBB05, 0xBB05, 0xBB05 }, -{ 0xBB06, 0xBB06, 0xBB06 }, -{ 0xBB07, 0xBB07, 0xBB07 }, -{ 0xBB08, 0xBB08, 0xBB08 }, -{ 0xBB09, 0xBB09, 0xBB09 }, -{ 0xBB0A, 0xBB0A, 0xBB0A }, -{ 0xBB0B, 0xBB0B, 0xBB0B }, -{ 0xBB0C, 0xBB0C, 0xBB0C }, -{ 0xBB0D, 0xBB0D, 0xBB0D }, -{ 0xBB0E, 0xBB0E, 0xBB0E }, -{ 0xBB0F, 0xBB0F, 0xBB0F }, -{ 0xBB10, 0xBB10, 0xBB10 }, -{ 0xBB11, 0xBB11, 0xBB11 }, -{ 0xBB12, 0xBB12, 0xBB12 }, -{ 0xBB13, 0xBB13, 0xBB13 }, -{ 0xBB14, 0xBB14, 0xBB14 }, -{ 0xBB15, 0xBB15, 0xBB15 }, -{ 0xBB16, 0xBB16, 0xBB16 }, -{ 0xBB17, 0xBB17, 0xBB17 }, -{ 0xBB18, 0xBB18, 0xBB18 }, -{ 0xBB19, 0xBB19, 0xBB19 }, -{ 0xBB1A, 0xBB1A, 0xBB1A }, -{ 0xBB1B, 0xBB1B, 0xBB1B }, -{ 0xBB1C, 0xBB1C, 0xBB1C }, -{ 0xBB1D, 0xBB1D, 0xBB1D }, -{ 0xBB1E, 0xBB1E, 0xBB1E }, -{ 0xBB1F, 0xBB1F, 0xBB1F }, -{ 0xBB20, 0xBB20, 0xBB20 }, -{ 0xBB21, 0xBB21, 0xBB21 }, -{ 0xBB22, 0xBB22, 0xBB22 }, -{ 0xBB23, 0xBB23, 0xBB23 }, -{ 0xBB24, 0xBB24, 0xBB24 }, -{ 0xBB25, 0xBB25, 0xBB25 }, -{ 0xBB26, 0xBB26, 0xBB26 }, -{ 0xBB27, 0xBB27, 0xBB27 }, -{ 0xBB28, 0xBB28, 0xBB28 }, -{ 0xBB29, 0xBB29, 0xBB29 }, -{ 0xBB2A, 0xBB2A, 0xBB2A }, -{ 0xBB2B, 0xBB2B, 0xBB2B }, -{ 0xBB2C, 0xBB2C, 0xBB2C }, -{ 0xBB2D, 0xBB2D, 0xBB2D }, -{ 0xBB2E, 0xBB2E, 0xBB2E }, -{ 0xBB2F, 0xBB2F, 0xBB2F }, -{ 0xBB30, 0xBB30, 0xBB30 }, -{ 0xBB31, 0xBB31, 0xBB31 }, -{ 0xBB32, 0xBB32, 0xBB32 }, -{ 0xBB33, 0xBB33, 0xBB33 }, -{ 0xBB34, 0xBB34, 0xBB34 }, -{ 0xBB35, 0xBB35, 0xBB35 }, -{ 0xBB36, 0xBB36, 0xBB36 }, -{ 0xBB37, 0xBB37, 0xBB37 }, -{ 0xBB38, 0xBB38, 0xBB38 }, -{ 0xBB39, 0xBB39, 0xBB39 }, -{ 0xBB3A, 0xBB3A, 0xBB3A }, -{ 0xBB3B, 0xBB3B, 0xBB3B }, -{ 0xBB3C, 0xBB3C, 0xBB3C }, -{ 0xBB3D, 0xBB3D, 0xBB3D }, -{ 0xBB3E, 0xBB3E, 0xBB3E }, -{ 0xBB3F, 0xBB3F, 0xBB3F }, -{ 0xBB40, 0xBB40, 0xBB40 }, -{ 0xBB41, 0xBB41, 0xBB41 }, -{ 0xBB42, 0xBB42, 0xBB42 }, -{ 0xBB43, 0xBB43, 0xBB43 }, -{ 0xBB44, 0xBB44, 0xBB44 }, -{ 0xBB45, 0xBB45, 0xBB45 }, -{ 0xBB46, 0xBB46, 0xBB46 }, -{ 0xBB47, 0xBB47, 0xBB47 }, -{ 0xBB48, 0xBB48, 0xBB48 }, -{ 0xBB49, 0xBB49, 0xBB49 }, -{ 0xBB4A, 0xBB4A, 0xBB4A }, -{ 0xBB4B, 0xBB4B, 0xBB4B }, -{ 0xBB4C, 0xBB4C, 0xBB4C }, -{ 0xBB4D, 0xBB4D, 0xBB4D }, -{ 0xBB4E, 0xBB4E, 0xBB4E }, -{ 0xBB4F, 0xBB4F, 0xBB4F }, -{ 0xBB50, 0xBB50, 0xBB50 }, -{ 0xBB51, 0xBB51, 0xBB51 }, -{ 0xBB52, 0xBB52, 0xBB52 }, -{ 0xBB53, 0xBB53, 0xBB53 }, -{ 0xBB54, 0xBB54, 0xBB54 }, -{ 0xBB55, 0xBB55, 0xBB55 }, -{ 0xBB56, 0xBB56, 0xBB56 }, -{ 0xBB57, 0xBB57, 0xBB57 }, -{ 0xBB58, 0xBB58, 0xBB58 }, -{ 0xBB59, 0xBB59, 0xBB59 }, -{ 0xBB5A, 0xBB5A, 0xBB5A }, -{ 0xBB5B, 0xBB5B, 0xBB5B }, -{ 0xBB5C, 0xBB5C, 0xBB5C }, -{ 0xBB5D, 0xBB5D, 0xBB5D }, -{ 0xBB5E, 0xBB5E, 0xBB5E }, -{ 0xBB5F, 0xBB5F, 0xBB5F }, -{ 0xBB60, 0xBB60, 0xBB60 }, -{ 0xBB61, 0xBB61, 0xBB61 }, -{ 0xBB62, 0xBB62, 0xBB62 }, -{ 0xBB63, 0xBB63, 0xBB63 }, -{ 0xBB64, 0xBB64, 0xBB64 }, -{ 0xBB65, 0xBB65, 0xBB65 }, -{ 0xBB66, 0xBB66, 0xBB66 }, -{ 0xBB67, 0xBB67, 0xBB67 }, -{ 0xBB68, 0xBB68, 0xBB68 }, -{ 0xBB69, 0xBB69, 0xBB69 }, -{ 0xBB6A, 0xBB6A, 0xBB6A }, -{ 0xBB6B, 0xBB6B, 0xBB6B }, -{ 0xBB6C, 0xBB6C, 0xBB6C }, -{ 0xBB6D, 0xBB6D, 0xBB6D }, -{ 0xBB6E, 0xBB6E, 0xBB6E }, -{ 0xBB6F, 0xBB6F, 0xBB6F }, -{ 0xBB70, 0xBB70, 0xBB70 }, -{ 0xBB71, 0xBB71, 0xBB71 }, -{ 0xBB72, 0xBB72, 0xBB72 }, -{ 0xBB73, 0xBB73, 0xBB73 }, -{ 0xBB74, 0xBB74, 0xBB74 }, -{ 0xBB75, 0xBB75, 0xBB75 }, -{ 0xBB76, 0xBB76, 0xBB76 }, -{ 0xBB77, 0xBB77, 0xBB77 }, -{ 0xBB78, 0xBB78, 0xBB78 }, -{ 0xBB79, 0xBB79, 0xBB79 }, -{ 0xBB7A, 0xBB7A, 0xBB7A }, -{ 0xBB7B, 0xBB7B, 0xBB7B }, -{ 0xBB7C, 0xBB7C, 0xBB7C }, -{ 0xBB7D, 0xBB7D, 0xBB7D }, -{ 0xBB7E, 0xBB7E, 0xBB7E }, -{ 0xBB7F, 0xBB7F, 0xBB7F }, -{ 0xBB80, 0xBB80, 0xBB80 }, -{ 0xBB81, 0xBB81, 0xBB81 }, -{ 0xBB82, 0xBB82, 0xBB82 }, -{ 0xBB83, 0xBB83, 0xBB83 }, -{ 0xBB84, 0xBB84, 0xBB84 }, -{ 0xBB85, 0xBB85, 0xBB85 }, -{ 0xBB86, 0xBB86, 0xBB86 }, -{ 0xBB87, 0xBB87, 0xBB87 }, -{ 0xBB88, 0xBB88, 0xBB88 }, -{ 0xBB89, 0xBB89, 0xBB89 }, -{ 0xBB8A, 0xBB8A, 0xBB8A }, -{ 0xBB8B, 0xBB8B, 0xBB8B }, -{ 0xBB8C, 0xBB8C, 0xBB8C }, -{ 0xBB8D, 0xBB8D, 0xBB8D }, -{ 0xBB8E, 0xBB8E, 0xBB8E }, -{ 0xBB8F, 0xBB8F, 0xBB8F }, -{ 0xBB90, 0xBB90, 0xBB90 }, -{ 0xBB91, 0xBB91, 0xBB91 }, -{ 0xBB92, 0xBB92, 0xBB92 }, -{ 0xBB93, 0xBB93, 0xBB93 }, -{ 0xBB94, 0xBB94, 0xBB94 }, -{ 0xBB95, 0xBB95, 0xBB95 }, -{ 0xBB96, 0xBB96, 0xBB96 }, -{ 0xBB97, 0xBB97, 0xBB97 }, -{ 0xBB98, 0xBB98, 0xBB98 }, -{ 0xBB99, 0xBB99, 0xBB99 }, -{ 0xBB9A, 0xBB9A, 0xBB9A }, -{ 0xBB9B, 0xBB9B, 0xBB9B }, -{ 0xBB9C, 0xBB9C, 0xBB9C }, -{ 0xBB9D, 0xBB9D, 0xBB9D }, -{ 0xBB9E, 0xBB9E, 0xBB9E }, -{ 0xBB9F, 0xBB9F, 0xBB9F }, -{ 0xBBA0, 0xBBA0, 0xBBA0 }, -{ 0xBBA1, 0xBBA1, 0xBBA1 }, -{ 0xBBA2, 0xBBA2, 0xBBA2 }, -{ 0xBBA3, 0xBBA3, 0xBBA3 }, -{ 0xBBA4, 0xBBA4, 0xBBA4 }, -{ 0xBBA5, 0xBBA5, 0xBBA5 }, -{ 0xBBA6, 0xBBA6, 0xBBA6 }, -{ 0xBBA7, 0xBBA7, 0xBBA7 }, -{ 0xBBA8, 0xBBA8, 0xBBA8 }, -{ 0xBBA9, 0xBBA9, 0xBBA9 }, -{ 0xBBAA, 0xBBAA, 0xBBAA }, -{ 0xBBAB, 0xBBAB, 0xBBAB }, -{ 0xBBAC, 0xBBAC, 0xBBAC }, -{ 0xBBAD, 0xBBAD, 0xBBAD }, -{ 0xBBAE, 0xBBAE, 0xBBAE }, -{ 0xBBAF, 0xBBAF, 0xBBAF }, -{ 0xBBB0, 0xBBB0, 0xBBB0 }, -{ 0xBBB1, 0xBBB1, 0xBBB1 }, -{ 0xBBB2, 0xBBB2, 0xBBB2 }, -{ 0xBBB3, 0xBBB3, 0xBBB3 }, -{ 0xBBB4, 0xBBB4, 0xBBB4 }, -{ 0xBBB5, 0xBBB5, 0xBBB5 }, -{ 0xBBB6, 0xBBB6, 0xBBB6 }, -{ 0xBBB7, 0xBBB7, 0xBBB7 }, -{ 0xBBB8, 0xBBB8, 0xBBB8 }, -{ 0xBBB9, 0xBBB9, 0xBBB9 }, -{ 0xBBBA, 0xBBBA, 0xBBBA }, -{ 0xBBBB, 0xBBBB, 0xBBBB }, -{ 0xBBBC, 0xBBBC, 0xBBBC }, -{ 0xBBBD, 0xBBBD, 0xBBBD }, -{ 0xBBBE, 0xBBBE, 0xBBBE }, -{ 0xBBBF, 0xBBBF, 0xBBBF }, -{ 0xBBC0, 0xBBC0, 0xBBC0 }, -{ 0xBBC1, 0xBBC1, 0xBBC1 }, -{ 0xBBC2, 0xBBC2, 0xBBC2 }, -{ 0xBBC3, 0xBBC3, 0xBBC3 }, -{ 0xBBC4, 0xBBC4, 0xBBC4 }, -{ 0xBBC5, 0xBBC5, 0xBBC5 }, -{ 0xBBC6, 0xBBC6, 0xBBC6 }, -{ 0xBBC7, 0xBBC7, 0xBBC7 }, -{ 0xBBC8, 0xBBC8, 0xBBC8 }, -{ 0xBBC9, 0xBBC9, 0xBBC9 }, -{ 0xBBCA, 0xBBCA, 0xBBCA }, -{ 0xBBCB, 0xBBCB, 0xBBCB }, -{ 0xBBCC, 0xBBCC, 0xBBCC }, -{ 0xBBCD, 0xBBCD, 0xBBCD }, -{ 0xBBCE, 0xBBCE, 0xBBCE }, -{ 0xBBCF, 0xBBCF, 0xBBCF }, -{ 0xBBD0, 0xBBD0, 0xBBD0 }, -{ 0xBBD1, 0xBBD1, 0xBBD1 }, -{ 0xBBD2, 0xBBD2, 0xBBD2 }, -{ 0xBBD3, 0xBBD3, 0xBBD3 }, -{ 0xBBD4, 0xBBD4, 0xBBD4 }, -{ 0xBBD5, 0xBBD5, 0xBBD5 }, -{ 0xBBD6, 0xBBD6, 0xBBD6 }, -{ 0xBBD7, 0xBBD7, 0xBBD7 }, -{ 0xBBD8, 0xBBD8, 0xBBD8 }, -{ 0xBBD9, 0xBBD9, 0xBBD9 }, -{ 0xBBDA, 0xBBDA, 0xBBDA }, -{ 0xBBDB, 0xBBDB, 0xBBDB }, -{ 0xBBDC, 0xBBDC, 0xBBDC }, -{ 0xBBDD, 0xBBDD, 0xBBDD }, -{ 0xBBDE, 0xBBDE, 0xBBDE }, -{ 0xBBDF, 0xBBDF, 0xBBDF }, -{ 0xBBE0, 0xBBE0, 0xBBE0 }, -{ 0xBBE1, 0xBBE1, 0xBBE1 }, -{ 0xBBE2, 0xBBE2, 0xBBE2 }, -{ 0xBBE3, 0xBBE3, 0xBBE3 }, -{ 0xBBE4, 0xBBE4, 0xBBE4 }, -{ 0xBBE5, 0xBBE5, 0xBBE5 }, -{ 0xBBE6, 0xBBE6, 0xBBE6 }, -{ 0xBBE7, 0xBBE7, 0xBBE7 }, -{ 0xBBE8, 0xBBE8, 0xBBE8 }, -{ 0xBBE9, 0xBBE9, 0xBBE9 }, -{ 0xBBEA, 0xBBEA, 0xBBEA }, -{ 0xBBEB, 0xBBEB, 0xBBEB }, -{ 0xBBEC, 0xBBEC, 0xBBEC }, -{ 0xBBED, 0xBBED, 0xBBED }, -{ 0xBBEE, 0xBBEE, 0xBBEE }, -{ 0xBBEF, 0xBBEF, 0xBBEF }, -{ 0xBBF0, 0xBBF0, 0xBBF0 }, -{ 0xBBF1, 0xBBF1, 0xBBF1 }, -{ 0xBBF2, 0xBBF2, 0xBBF2 }, -{ 0xBBF3, 0xBBF3, 0xBBF3 }, -{ 0xBBF4, 0xBBF4, 0xBBF4 }, -{ 0xBBF5, 0xBBF5, 0xBBF5 }, -{ 0xBBF6, 0xBBF6, 0xBBF6 }, -{ 0xBBF7, 0xBBF7, 0xBBF7 }, -{ 0xBBF8, 0xBBF8, 0xBBF8 }, -{ 0xBBF9, 0xBBF9, 0xBBF9 }, -{ 0xBBFA, 0xBBFA, 0xBBFA }, -{ 0xBBFB, 0xBBFB, 0xBBFB }, -{ 0xBBFC, 0xBBFC, 0xBBFC }, -{ 0xBBFD, 0xBBFD, 0xBBFD }, -{ 0xBBFE, 0xBBFE, 0xBBFE }, -{ 0xBBFF, 0xBBFF, 0xBBFF }, -{ 0xBC00, 0xBC00, 0xBC00 }, -{ 0xBC01, 0xBC01, 0xBC01 }, -{ 0xBC02, 0xBC02, 0xBC02 }, -{ 0xBC03, 0xBC03, 0xBC03 }, -{ 0xBC04, 0xBC04, 0xBC04 }, -{ 0xBC05, 0xBC05, 0xBC05 }, -{ 0xBC06, 0xBC06, 0xBC06 }, -{ 0xBC07, 0xBC07, 0xBC07 }, -{ 0xBC08, 0xBC08, 0xBC08 }, -{ 0xBC09, 0xBC09, 0xBC09 }, -{ 0xBC0A, 0xBC0A, 0xBC0A }, -{ 0xBC0B, 0xBC0B, 0xBC0B }, -{ 0xBC0C, 0xBC0C, 0xBC0C }, -{ 0xBC0D, 0xBC0D, 0xBC0D }, -{ 0xBC0E, 0xBC0E, 0xBC0E }, -{ 0xBC0F, 0xBC0F, 0xBC0F }, -{ 0xBC10, 0xBC10, 0xBC10 }, -{ 0xBC11, 0xBC11, 0xBC11 }, -{ 0xBC12, 0xBC12, 0xBC12 }, -{ 0xBC13, 0xBC13, 0xBC13 }, -{ 0xBC14, 0xBC14, 0xBC14 }, -{ 0xBC15, 0xBC15, 0xBC15 }, -{ 0xBC16, 0xBC16, 0xBC16 }, -{ 0xBC17, 0xBC17, 0xBC17 }, -{ 0xBC18, 0xBC18, 0xBC18 }, -{ 0xBC19, 0xBC19, 0xBC19 }, -{ 0xBC1A, 0xBC1A, 0xBC1A }, -{ 0xBC1B, 0xBC1B, 0xBC1B }, -{ 0xBC1C, 0xBC1C, 0xBC1C }, -{ 0xBC1D, 0xBC1D, 0xBC1D }, -{ 0xBC1E, 0xBC1E, 0xBC1E }, -{ 0xBC1F, 0xBC1F, 0xBC1F }, -{ 0xBC20, 0xBC20, 0xBC20 }, -{ 0xBC21, 0xBC21, 0xBC21 }, -{ 0xBC22, 0xBC22, 0xBC22 }, -{ 0xBC23, 0xBC23, 0xBC23 }, -{ 0xBC24, 0xBC24, 0xBC24 }, -{ 0xBC25, 0xBC25, 0xBC25 }, -{ 0xBC26, 0xBC26, 0xBC26 }, -{ 0xBC27, 0xBC27, 0xBC27 }, -{ 0xBC28, 0xBC28, 0xBC28 }, -{ 0xBC29, 0xBC29, 0xBC29 }, -{ 0xBC2A, 0xBC2A, 0xBC2A }, -{ 0xBC2B, 0xBC2B, 0xBC2B }, -{ 0xBC2C, 0xBC2C, 0xBC2C }, -{ 0xBC2D, 0xBC2D, 0xBC2D }, -{ 0xBC2E, 0xBC2E, 0xBC2E }, -{ 0xBC2F, 0xBC2F, 0xBC2F }, -{ 0xBC30, 0xBC30, 0xBC30 }, -{ 0xBC31, 0xBC31, 0xBC31 }, -{ 0xBC32, 0xBC32, 0xBC32 }, -{ 0xBC33, 0xBC33, 0xBC33 }, -{ 0xBC34, 0xBC34, 0xBC34 }, -{ 0xBC35, 0xBC35, 0xBC35 }, -{ 0xBC36, 0xBC36, 0xBC36 }, -{ 0xBC37, 0xBC37, 0xBC37 }, -{ 0xBC38, 0xBC38, 0xBC38 }, -{ 0xBC39, 0xBC39, 0xBC39 }, -{ 0xBC3A, 0xBC3A, 0xBC3A }, -{ 0xBC3B, 0xBC3B, 0xBC3B }, -{ 0xBC3C, 0xBC3C, 0xBC3C }, -{ 0xBC3D, 0xBC3D, 0xBC3D }, -{ 0xBC3E, 0xBC3E, 0xBC3E }, -{ 0xBC3F, 0xBC3F, 0xBC3F }, -{ 0xBC40, 0xBC40, 0xBC40 }, -{ 0xBC41, 0xBC41, 0xBC41 }, -{ 0xBC42, 0xBC42, 0xBC42 }, -{ 0xBC43, 0xBC43, 0xBC43 }, -{ 0xBC44, 0xBC44, 0xBC44 }, -{ 0xBC45, 0xBC45, 0xBC45 }, -{ 0xBC46, 0xBC46, 0xBC46 }, -{ 0xBC47, 0xBC47, 0xBC47 }, -{ 0xBC48, 0xBC48, 0xBC48 }, -{ 0xBC49, 0xBC49, 0xBC49 }, -{ 0xBC4A, 0xBC4A, 0xBC4A }, -{ 0xBC4B, 0xBC4B, 0xBC4B }, -{ 0xBC4C, 0xBC4C, 0xBC4C }, -{ 0xBC4D, 0xBC4D, 0xBC4D }, -{ 0xBC4E, 0xBC4E, 0xBC4E }, -{ 0xBC4F, 0xBC4F, 0xBC4F }, -{ 0xBC50, 0xBC50, 0xBC50 }, -{ 0xBC51, 0xBC51, 0xBC51 }, -{ 0xBC52, 0xBC52, 0xBC52 }, -{ 0xBC53, 0xBC53, 0xBC53 }, -{ 0xBC54, 0xBC54, 0xBC54 }, -{ 0xBC55, 0xBC55, 0xBC55 }, -{ 0xBC56, 0xBC56, 0xBC56 }, -{ 0xBC57, 0xBC57, 0xBC57 }, -{ 0xBC58, 0xBC58, 0xBC58 }, -{ 0xBC59, 0xBC59, 0xBC59 }, -{ 0xBC5A, 0xBC5A, 0xBC5A }, -{ 0xBC5B, 0xBC5B, 0xBC5B }, -{ 0xBC5C, 0xBC5C, 0xBC5C }, -{ 0xBC5D, 0xBC5D, 0xBC5D }, -{ 0xBC5E, 0xBC5E, 0xBC5E }, -{ 0xBC5F, 0xBC5F, 0xBC5F }, -{ 0xBC60, 0xBC60, 0xBC60 }, -{ 0xBC61, 0xBC61, 0xBC61 }, -{ 0xBC62, 0xBC62, 0xBC62 }, -{ 0xBC63, 0xBC63, 0xBC63 }, -{ 0xBC64, 0xBC64, 0xBC64 }, -{ 0xBC65, 0xBC65, 0xBC65 }, -{ 0xBC66, 0xBC66, 0xBC66 }, -{ 0xBC67, 0xBC67, 0xBC67 }, -{ 0xBC68, 0xBC68, 0xBC68 }, -{ 0xBC69, 0xBC69, 0xBC69 }, -{ 0xBC6A, 0xBC6A, 0xBC6A }, -{ 0xBC6B, 0xBC6B, 0xBC6B }, -{ 0xBC6C, 0xBC6C, 0xBC6C }, -{ 0xBC6D, 0xBC6D, 0xBC6D }, -{ 0xBC6E, 0xBC6E, 0xBC6E }, -{ 0xBC6F, 0xBC6F, 0xBC6F }, -{ 0xBC70, 0xBC70, 0xBC70 }, -{ 0xBC71, 0xBC71, 0xBC71 }, -{ 0xBC72, 0xBC72, 0xBC72 }, -{ 0xBC73, 0xBC73, 0xBC73 }, -{ 0xBC74, 0xBC74, 0xBC74 }, -{ 0xBC75, 0xBC75, 0xBC75 }, -{ 0xBC76, 0xBC76, 0xBC76 }, -{ 0xBC77, 0xBC77, 0xBC77 }, -{ 0xBC78, 0xBC78, 0xBC78 }, -{ 0xBC79, 0xBC79, 0xBC79 }, -{ 0xBC7A, 0xBC7A, 0xBC7A }, -{ 0xBC7B, 0xBC7B, 0xBC7B }, -{ 0xBC7C, 0xBC7C, 0xBC7C }, -{ 0xBC7D, 0xBC7D, 0xBC7D }, -{ 0xBC7E, 0xBC7E, 0xBC7E }, -{ 0xBC7F, 0xBC7F, 0xBC7F }, -{ 0xBC80, 0xBC80, 0xBC80 }, -{ 0xBC81, 0xBC81, 0xBC81 }, -{ 0xBC82, 0xBC82, 0xBC82 }, -{ 0xBC83, 0xBC83, 0xBC83 }, -{ 0xBC84, 0xBC84, 0xBC84 }, -{ 0xBC85, 0xBC85, 0xBC85 }, -{ 0xBC86, 0xBC86, 0xBC86 }, -{ 0xBC87, 0xBC87, 0xBC87 }, -{ 0xBC88, 0xBC88, 0xBC88 }, -{ 0xBC89, 0xBC89, 0xBC89 }, -{ 0xBC8A, 0xBC8A, 0xBC8A }, -{ 0xBC8B, 0xBC8B, 0xBC8B }, -{ 0xBC8C, 0xBC8C, 0xBC8C }, -{ 0xBC8D, 0xBC8D, 0xBC8D }, -{ 0xBC8E, 0xBC8E, 0xBC8E }, -{ 0xBC8F, 0xBC8F, 0xBC8F }, -{ 0xBC90, 0xBC90, 0xBC90 }, -{ 0xBC91, 0xBC91, 0xBC91 }, -{ 0xBC92, 0xBC92, 0xBC92 }, -{ 0xBC93, 0xBC93, 0xBC93 }, -{ 0xBC94, 0xBC94, 0xBC94 }, -{ 0xBC95, 0xBC95, 0xBC95 }, -{ 0xBC96, 0xBC96, 0xBC96 }, -{ 0xBC97, 0xBC97, 0xBC97 }, -{ 0xBC98, 0xBC98, 0xBC98 }, -{ 0xBC99, 0xBC99, 0xBC99 }, -{ 0xBC9A, 0xBC9A, 0xBC9A }, -{ 0xBC9B, 0xBC9B, 0xBC9B }, -{ 0xBC9C, 0xBC9C, 0xBC9C }, -{ 0xBC9D, 0xBC9D, 0xBC9D }, -{ 0xBC9E, 0xBC9E, 0xBC9E }, -{ 0xBC9F, 0xBC9F, 0xBC9F }, -{ 0xBCA0, 0xBCA0, 0xBCA0 }, -{ 0xBCA1, 0xBCA1, 0xBCA1 }, -{ 0xBCA2, 0xBCA2, 0xBCA2 }, -{ 0xBCA3, 0xBCA3, 0xBCA3 }, -{ 0xBCA4, 0xBCA4, 0xBCA4 }, -{ 0xBCA5, 0xBCA5, 0xBCA5 }, -{ 0xBCA6, 0xBCA6, 0xBCA6 }, -{ 0xBCA7, 0xBCA7, 0xBCA7 }, -{ 0xBCA8, 0xBCA8, 0xBCA8 }, -{ 0xBCA9, 0xBCA9, 0xBCA9 }, -{ 0xBCAA, 0xBCAA, 0xBCAA }, -{ 0xBCAB, 0xBCAB, 0xBCAB }, -{ 0xBCAC, 0xBCAC, 0xBCAC }, -{ 0xBCAD, 0xBCAD, 0xBCAD }, -{ 0xBCAE, 0xBCAE, 0xBCAE }, -{ 0xBCAF, 0xBCAF, 0xBCAF }, -{ 0xBCB0, 0xBCB0, 0xBCB0 }, -{ 0xBCB1, 0xBCB1, 0xBCB1 }, -{ 0xBCB2, 0xBCB2, 0xBCB2 }, -{ 0xBCB3, 0xBCB3, 0xBCB3 }, -{ 0xBCB4, 0xBCB4, 0xBCB4 }, -{ 0xBCB5, 0xBCB5, 0xBCB5 }, -{ 0xBCB6, 0xBCB6, 0xBCB6 }, -{ 0xBCB7, 0xBCB7, 0xBCB7 }, -{ 0xBCB8, 0xBCB8, 0xBCB8 }, -{ 0xBCB9, 0xBCB9, 0xBCB9 }, -{ 0xBCBA, 0xBCBA, 0xBCBA }, -{ 0xBCBB, 0xBCBB, 0xBCBB }, -{ 0xBCBC, 0xBCBC, 0xBCBC }, -{ 0xBCBD, 0xBCBD, 0xBCBD }, -{ 0xBCBE, 0xBCBE, 0xBCBE }, -{ 0xBCBF, 0xBCBF, 0xBCBF }, -{ 0xBCC0, 0xBCC0, 0xBCC0 }, -{ 0xBCC1, 0xBCC1, 0xBCC1 }, -{ 0xBCC2, 0xBCC2, 0xBCC2 }, -{ 0xBCC3, 0xBCC3, 0xBCC3 }, -{ 0xBCC4, 0xBCC4, 0xBCC4 }, -{ 0xBCC5, 0xBCC5, 0xBCC5 }, -{ 0xBCC6, 0xBCC6, 0xBCC6 }, -{ 0xBCC7, 0xBCC7, 0xBCC7 }, -{ 0xBCC8, 0xBCC8, 0xBCC8 }, -{ 0xBCC9, 0xBCC9, 0xBCC9 }, -{ 0xBCCA, 0xBCCA, 0xBCCA }, -{ 0xBCCB, 0xBCCB, 0xBCCB }, -{ 0xBCCC, 0xBCCC, 0xBCCC }, -{ 0xBCCD, 0xBCCD, 0xBCCD }, -{ 0xBCCE, 0xBCCE, 0xBCCE }, -{ 0xBCCF, 0xBCCF, 0xBCCF }, -{ 0xBCD0, 0xBCD0, 0xBCD0 }, -{ 0xBCD1, 0xBCD1, 0xBCD1 }, -{ 0xBCD2, 0xBCD2, 0xBCD2 }, -{ 0xBCD3, 0xBCD3, 0xBCD3 }, -{ 0xBCD4, 0xBCD4, 0xBCD4 }, -{ 0xBCD5, 0xBCD5, 0xBCD5 }, -{ 0xBCD6, 0xBCD6, 0xBCD6 }, -{ 0xBCD7, 0xBCD7, 0xBCD7 }, -{ 0xBCD8, 0xBCD8, 0xBCD8 }, -{ 0xBCD9, 0xBCD9, 0xBCD9 }, -{ 0xBCDA, 0xBCDA, 0xBCDA }, -{ 0xBCDB, 0xBCDB, 0xBCDB }, -{ 0xBCDC, 0xBCDC, 0xBCDC }, -{ 0xBCDD, 0xBCDD, 0xBCDD }, -{ 0xBCDE, 0xBCDE, 0xBCDE }, -{ 0xBCDF, 0xBCDF, 0xBCDF }, -{ 0xBCE0, 0xBCE0, 0xBCE0 }, -{ 0xBCE1, 0xBCE1, 0xBCE1 }, -{ 0xBCE2, 0xBCE2, 0xBCE2 }, -{ 0xBCE3, 0xBCE3, 0xBCE3 }, -{ 0xBCE4, 0xBCE4, 0xBCE4 }, -{ 0xBCE5, 0xBCE5, 0xBCE5 }, -{ 0xBCE6, 0xBCE6, 0xBCE6 }, -{ 0xBCE7, 0xBCE7, 0xBCE7 }, -{ 0xBCE8, 0xBCE8, 0xBCE8 }, -{ 0xBCE9, 0xBCE9, 0xBCE9 }, -{ 0xBCEA, 0xBCEA, 0xBCEA }, -{ 0xBCEB, 0xBCEB, 0xBCEB }, -{ 0xBCEC, 0xBCEC, 0xBCEC }, -{ 0xBCED, 0xBCED, 0xBCED }, -{ 0xBCEE, 0xBCEE, 0xBCEE }, -{ 0xBCEF, 0xBCEF, 0xBCEF }, -{ 0xBCF0, 0xBCF0, 0xBCF0 }, -{ 0xBCF1, 0xBCF1, 0xBCF1 }, -{ 0xBCF2, 0xBCF2, 0xBCF2 }, -{ 0xBCF3, 0xBCF3, 0xBCF3 }, -{ 0xBCF4, 0xBCF4, 0xBCF4 }, -{ 0xBCF5, 0xBCF5, 0xBCF5 }, -{ 0xBCF6, 0xBCF6, 0xBCF6 }, -{ 0xBCF7, 0xBCF7, 0xBCF7 }, -{ 0xBCF8, 0xBCF8, 0xBCF8 }, -{ 0xBCF9, 0xBCF9, 0xBCF9 }, -{ 0xBCFA, 0xBCFA, 0xBCFA }, -{ 0xBCFB, 0xBCFB, 0xBCFB }, -{ 0xBCFC, 0xBCFC, 0xBCFC }, -{ 0xBCFD, 0xBCFD, 0xBCFD }, -{ 0xBCFE, 0xBCFE, 0xBCFE }, -{ 0xBCFF, 0xBCFF, 0xBCFF }, -{ 0xBD00, 0xBD00, 0xBD00 }, -{ 0xBD01, 0xBD01, 0xBD01 }, -{ 0xBD02, 0xBD02, 0xBD02 }, -{ 0xBD03, 0xBD03, 0xBD03 }, -{ 0xBD04, 0xBD04, 0xBD04 }, -{ 0xBD05, 0xBD05, 0xBD05 }, -{ 0xBD06, 0xBD06, 0xBD06 }, -{ 0xBD07, 0xBD07, 0xBD07 }, -{ 0xBD08, 0xBD08, 0xBD08 }, -{ 0xBD09, 0xBD09, 0xBD09 }, -{ 0xBD0A, 0xBD0A, 0xBD0A }, -{ 0xBD0B, 0xBD0B, 0xBD0B }, -{ 0xBD0C, 0xBD0C, 0xBD0C }, -{ 0xBD0D, 0xBD0D, 0xBD0D }, -{ 0xBD0E, 0xBD0E, 0xBD0E }, -{ 0xBD0F, 0xBD0F, 0xBD0F }, -{ 0xBD10, 0xBD10, 0xBD10 }, -{ 0xBD11, 0xBD11, 0xBD11 }, -{ 0xBD12, 0xBD12, 0xBD12 }, -{ 0xBD13, 0xBD13, 0xBD13 }, -{ 0xBD14, 0xBD14, 0xBD14 }, -{ 0xBD15, 0xBD15, 0xBD15 }, -{ 0xBD16, 0xBD16, 0xBD16 }, -{ 0xBD17, 0xBD17, 0xBD17 }, -{ 0xBD18, 0xBD18, 0xBD18 }, -{ 0xBD19, 0xBD19, 0xBD19 }, -{ 0xBD1A, 0xBD1A, 0xBD1A }, -{ 0xBD1B, 0xBD1B, 0xBD1B }, -{ 0xBD1C, 0xBD1C, 0xBD1C }, -{ 0xBD1D, 0xBD1D, 0xBD1D }, -{ 0xBD1E, 0xBD1E, 0xBD1E }, -{ 0xBD1F, 0xBD1F, 0xBD1F }, -{ 0xBD20, 0xBD20, 0xBD20 }, -{ 0xBD21, 0xBD21, 0xBD21 }, -{ 0xBD22, 0xBD22, 0xBD22 }, -{ 0xBD23, 0xBD23, 0xBD23 }, -{ 0xBD24, 0xBD24, 0xBD24 }, -{ 0xBD25, 0xBD25, 0xBD25 }, -{ 0xBD26, 0xBD26, 0xBD26 }, -{ 0xBD27, 0xBD27, 0xBD27 }, -{ 0xBD28, 0xBD28, 0xBD28 }, -{ 0xBD29, 0xBD29, 0xBD29 }, -{ 0xBD2A, 0xBD2A, 0xBD2A }, -{ 0xBD2B, 0xBD2B, 0xBD2B }, -{ 0xBD2C, 0xBD2C, 0xBD2C }, -{ 0xBD2D, 0xBD2D, 0xBD2D }, -{ 0xBD2E, 0xBD2E, 0xBD2E }, -{ 0xBD2F, 0xBD2F, 0xBD2F }, -{ 0xBD30, 0xBD30, 0xBD30 }, -{ 0xBD31, 0xBD31, 0xBD31 }, -{ 0xBD32, 0xBD32, 0xBD32 }, -{ 0xBD33, 0xBD33, 0xBD33 }, -{ 0xBD34, 0xBD34, 0xBD34 }, -{ 0xBD35, 0xBD35, 0xBD35 }, -{ 0xBD36, 0xBD36, 0xBD36 }, -{ 0xBD37, 0xBD37, 0xBD37 }, -{ 0xBD38, 0xBD38, 0xBD38 }, -{ 0xBD39, 0xBD39, 0xBD39 }, -{ 0xBD3A, 0xBD3A, 0xBD3A }, -{ 0xBD3B, 0xBD3B, 0xBD3B }, -{ 0xBD3C, 0xBD3C, 0xBD3C }, -{ 0xBD3D, 0xBD3D, 0xBD3D }, -{ 0xBD3E, 0xBD3E, 0xBD3E }, -{ 0xBD3F, 0xBD3F, 0xBD3F }, -{ 0xBD40, 0xBD40, 0xBD40 }, -{ 0xBD41, 0xBD41, 0xBD41 }, -{ 0xBD42, 0xBD42, 0xBD42 }, -{ 0xBD43, 0xBD43, 0xBD43 }, -{ 0xBD44, 0xBD44, 0xBD44 }, -{ 0xBD45, 0xBD45, 0xBD45 }, -{ 0xBD46, 0xBD46, 0xBD46 }, -{ 0xBD47, 0xBD47, 0xBD47 }, -{ 0xBD48, 0xBD48, 0xBD48 }, -{ 0xBD49, 0xBD49, 0xBD49 }, -{ 0xBD4A, 0xBD4A, 0xBD4A }, -{ 0xBD4B, 0xBD4B, 0xBD4B }, -{ 0xBD4C, 0xBD4C, 0xBD4C }, -{ 0xBD4D, 0xBD4D, 0xBD4D }, -{ 0xBD4E, 0xBD4E, 0xBD4E }, -{ 0xBD4F, 0xBD4F, 0xBD4F }, -{ 0xBD50, 0xBD50, 0xBD50 }, -{ 0xBD51, 0xBD51, 0xBD51 }, -{ 0xBD52, 0xBD52, 0xBD52 }, -{ 0xBD53, 0xBD53, 0xBD53 }, -{ 0xBD54, 0xBD54, 0xBD54 }, -{ 0xBD55, 0xBD55, 0xBD55 }, -{ 0xBD56, 0xBD56, 0xBD56 }, -{ 0xBD57, 0xBD57, 0xBD57 }, -{ 0xBD58, 0xBD58, 0xBD58 }, -{ 0xBD59, 0xBD59, 0xBD59 }, -{ 0xBD5A, 0xBD5A, 0xBD5A }, -{ 0xBD5B, 0xBD5B, 0xBD5B }, -{ 0xBD5C, 0xBD5C, 0xBD5C }, -{ 0xBD5D, 0xBD5D, 0xBD5D }, -{ 0xBD5E, 0xBD5E, 0xBD5E }, -{ 0xBD5F, 0xBD5F, 0xBD5F }, -{ 0xBD60, 0xBD60, 0xBD60 }, -{ 0xBD61, 0xBD61, 0xBD61 }, -{ 0xBD62, 0xBD62, 0xBD62 }, -{ 0xBD63, 0xBD63, 0xBD63 }, -{ 0xBD64, 0xBD64, 0xBD64 }, -{ 0xBD65, 0xBD65, 0xBD65 }, -{ 0xBD66, 0xBD66, 0xBD66 }, -{ 0xBD67, 0xBD67, 0xBD67 }, -{ 0xBD68, 0xBD68, 0xBD68 }, -{ 0xBD69, 0xBD69, 0xBD69 }, -{ 0xBD6A, 0xBD6A, 0xBD6A }, -{ 0xBD6B, 0xBD6B, 0xBD6B }, -{ 0xBD6C, 0xBD6C, 0xBD6C }, -{ 0xBD6D, 0xBD6D, 0xBD6D }, -{ 0xBD6E, 0xBD6E, 0xBD6E }, -{ 0xBD6F, 0xBD6F, 0xBD6F }, -{ 0xBD70, 0xBD70, 0xBD70 }, -{ 0xBD71, 0xBD71, 0xBD71 }, -{ 0xBD72, 0xBD72, 0xBD72 }, -{ 0xBD73, 0xBD73, 0xBD73 }, -{ 0xBD74, 0xBD74, 0xBD74 }, -{ 0xBD75, 0xBD75, 0xBD75 }, -{ 0xBD76, 0xBD76, 0xBD76 }, -{ 0xBD77, 0xBD77, 0xBD77 }, -{ 0xBD78, 0xBD78, 0xBD78 }, -{ 0xBD79, 0xBD79, 0xBD79 }, -{ 0xBD7A, 0xBD7A, 0xBD7A }, -{ 0xBD7B, 0xBD7B, 0xBD7B }, -{ 0xBD7C, 0xBD7C, 0xBD7C }, -{ 0xBD7D, 0xBD7D, 0xBD7D }, -{ 0xBD7E, 0xBD7E, 0xBD7E }, -{ 0xBD7F, 0xBD7F, 0xBD7F }, -{ 0xBD80, 0xBD80, 0xBD80 }, -{ 0xBD81, 0xBD81, 0xBD81 }, -{ 0xBD82, 0xBD82, 0xBD82 }, -{ 0xBD83, 0xBD83, 0xBD83 }, -{ 0xBD84, 0xBD84, 0xBD84 }, -{ 0xBD85, 0xBD85, 0xBD85 }, -{ 0xBD86, 0xBD86, 0xBD86 }, -{ 0xBD87, 0xBD87, 0xBD87 }, -{ 0xBD88, 0xBD88, 0xBD88 }, -{ 0xBD89, 0xBD89, 0xBD89 }, -{ 0xBD8A, 0xBD8A, 0xBD8A }, -{ 0xBD8B, 0xBD8B, 0xBD8B }, -{ 0xBD8C, 0xBD8C, 0xBD8C }, -{ 0xBD8D, 0xBD8D, 0xBD8D }, -{ 0xBD8E, 0xBD8E, 0xBD8E }, -{ 0xBD8F, 0xBD8F, 0xBD8F }, -{ 0xBD90, 0xBD90, 0xBD90 }, -{ 0xBD91, 0xBD91, 0xBD91 }, -{ 0xBD92, 0xBD92, 0xBD92 }, -{ 0xBD93, 0xBD93, 0xBD93 }, -{ 0xBD94, 0xBD94, 0xBD94 }, -{ 0xBD95, 0xBD95, 0xBD95 }, -{ 0xBD96, 0xBD96, 0xBD96 }, -{ 0xBD97, 0xBD97, 0xBD97 }, -{ 0xBD98, 0xBD98, 0xBD98 }, -{ 0xBD99, 0xBD99, 0xBD99 }, -{ 0xBD9A, 0xBD9A, 0xBD9A }, -{ 0xBD9B, 0xBD9B, 0xBD9B }, -{ 0xBD9C, 0xBD9C, 0xBD9C }, -{ 0xBD9D, 0xBD9D, 0xBD9D }, -{ 0xBD9E, 0xBD9E, 0xBD9E }, -{ 0xBD9F, 0xBD9F, 0xBD9F }, -{ 0xBDA0, 0xBDA0, 0xBDA0 }, -{ 0xBDA1, 0xBDA1, 0xBDA1 }, -{ 0xBDA2, 0xBDA2, 0xBDA2 }, -{ 0xBDA3, 0xBDA3, 0xBDA3 }, -{ 0xBDA4, 0xBDA4, 0xBDA4 }, -{ 0xBDA5, 0xBDA5, 0xBDA5 }, -{ 0xBDA6, 0xBDA6, 0xBDA6 }, -{ 0xBDA7, 0xBDA7, 0xBDA7 }, -{ 0xBDA8, 0xBDA8, 0xBDA8 }, -{ 0xBDA9, 0xBDA9, 0xBDA9 }, -{ 0xBDAA, 0xBDAA, 0xBDAA }, -{ 0xBDAB, 0xBDAB, 0xBDAB }, -{ 0xBDAC, 0xBDAC, 0xBDAC }, -{ 0xBDAD, 0xBDAD, 0xBDAD }, -{ 0xBDAE, 0xBDAE, 0xBDAE }, -{ 0xBDAF, 0xBDAF, 0xBDAF }, -{ 0xBDB0, 0xBDB0, 0xBDB0 }, -{ 0xBDB1, 0xBDB1, 0xBDB1 }, -{ 0xBDB2, 0xBDB2, 0xBDB2 }, -{ 0xBDB3, 0xBDB3, 0xBDB3 }, -{ 0xBDB4, 0xBDB4, 0xBDB4 }, -{ 0xBDB5, 0xBDB5, 0xBDB5 }, -{ 0xBDB6, 0xBDB6, 0xBDB6 }, -{ 0xBDB7, 0xBDB7, 0xBDB7 }, -{ 0xBDB8, 0xBDB8, 0xBDB8 }, -{ 0xBDB9, 0xBDB9, 0xBDB9 }, -{ 0xBDBA, 0xBDBA, 0xBDBA }, -{ 0xBDBB, 0xBDBB, 0xBDBB }, -{ 0xBDBC, 0xBDBC, 0xBDBC }, -{ 0xBDBD, 0xBDBD, 0xBDBD }, -{ 0xBDBE, 0xBDBE, 0xBDBE }, -{ 0xBDBF, 0xBDBF, 0xBDBF }, -{ 0xBDC0, 0xBDC0, 0xBDC0 }, -{ 0xBDC1, 0xBDC1, 0xBDC1 }, -{ 0xBDC2, 0xBDC2, 0xBDC2 }, -{ 0xBDC3, 0xBDC3, 0xBDC3 }, -{ 0xBDC4, 0xBDC4, 0xBDC4 }, -{ 0xBDC5, 0xBDC5, 0xBDC5 }, -{ 0xBDC6, 0xBDC6, 0xBDC6 }, -{ 0xBDC7, 0xBDC7, 0xBDC7 }, -{ 0xBDC8, 0xBDC8, 0xBDC8 }, -{ 0xBDC9, 0xBDC9, 0xBDC9 }, -{ 0xBDCA, 0xBDCA, 0xBDCA }, -{ 0xBDCB, 0xBDCB, 0xBDCB }, -{ 0xBDCC, 0xBDCC, 0xBDCC }, -{ 0xBDCD, 0xBDCD, 0xBDCD }, -{ 0xBDCE, 0xBDCE, 0xBDCE }, -{ 0xBDCF, 0xBDCF, 0xBDCF }, -{ 0xBDD0, 0xBDD0, 0xBDD0 }, -{ 0xBDD1, 0xBDD1, 0xBDD1 }, -{ 0xBDD2, 0xBDD2, 0xBDD2 }, -{ 0xBDD3, 0xBDD3, 0xBDD3 }, -{ 0xBDD4, 0xBDD4, 0xBDD4 }, -{ 0xBDD5, 0xBDD5, 0xBDD5 }, -{ 0xBDD6, 0xBDD6, 0xBDD6 }, -{ 0xBDD7, 0xBDD7, 0xBDD7 }, -{ 0xBDD8, 0xBDD8, 0xBDD8 }, -{ 0xBDD9, 0xBDD9, 0xBDD9 }, -{ 0xBDDA, 0xBDDA, 0xBDDA }, -{ 0xBDDB, 0xBDDB, 0xBDDB }, -{ 0xBDDC, 0xBDDC, 0xBDDC }, -{ 0xBDDD, 0xBDDD, 0xBDDD }, -{ 0xBDDE, 0xBDDE, 0xBDDE }, -{ 0xBDDF, 0xBDDF, 0xBDDF }, -{ 0xBDE0, 0xBDE0, 0xBDE0 }, -{ 0xBDE1, 0xBDE1, 0xBDE1 }, -{ 0xBDE2, 0xBDE2, 0xBDE2 }, -{ 0xBDE3, 0xBDE3, 0xBDE3 }, -{ 0xBDE4, 0xBDE4, 0xBDE4 }, -{ 0xBDE5, 0xBDE5, 0xBDE5 }, -{ 0xBDE6, 0xBDE6, 0xBDE6 }, -{ 0xBDE7, 0xBDE7, 0xBDE7 }, -{ 0xBDE8, 0xBDE8, 0xBDE8 }, -{ 0xBDE9, 0xBDE9, 0xBDE9 }, -{ 0xBDEA, 0xBDEA, 0xBDEA }, -{ 0xBDEB, 0xBDEB, 0xBDEB }, -{ 0xBDEC, 0xBDEC, 0xBDEC }, -{ 0xBDED, 0xBDED, 0xBDED }, -{ 0xBDEE, 0xBDEE, 0xBDEE }, -{ 0xBDEF, 0xBDEF, 0xBDEF }, -{ 0xBDF0, 0xBDF0, 0xBDF0 }, -{ 0xBDF1, 0xBDF1, 0xBDF1 }, -{ 0xBDF2, 0xBDF2, 0xBDF2 }, -{ 0xBDF3, 0xBDF3, 0xBDF3 }, -{ 0xBDF4, 0xBDF4, 0xBDF4 }, -{ 0xBDF5, 0xBDF5, 0xBDF5 }, -{ 0xBDF6, 0xBDF6, 0xBDF6 }, -{ 0xBDF7, 0xBDF7, 0xBDF7 }, -{ 0xBDF8, 0xBDF8, 0xBDF8 }, -{ 0xBDF9, 0xBDF9, 0xBDF9 }, -{ 0xBDFA, 0xBDFA, 0xBDFA }, -{ 0xBDFB, 0xBDFB, 0xBDFB }, -{ 0xBDFC, 0xBDFC, 0xBDFC }, -{ 0xBDFD, 0xBDFD, 0xBDFD }, -{ 0xBDFE, 0xBDFE, 0xBDFE }, -{ 0xBDFF, 0xBDFF, 0xBDFF }, -{ 0xBE00, 0xBE00, 0xBE00 }, -{ 0xBE01, 0xBE01, 0xBE01 }, -{ 0xBE02, 0xBE02, 0xBE02 }, -{ 0xBE03, 0xBE03, 0xBE03 }, -{ 0xBE04, 0xBE04, 0xBE04 }, -{ 0xBE05, 0xBE05, 0xBE05 }, -{ 0xBE06, 0xBE06, 0xBE06 }, -{ 0xBE07, 0xBE07, 0xBE07 }, -{ 0xBE08, 0xBE08, 0xBE08 }, -{ 0xBE09, 0xBE09, 0xBE09 }, -{ 0xBE0A, 0xBE0A, 0xBE0A }, -{ 0xBE0B, 0xBE0B, 0xBE0B }, -{ 0xBE0C, 0xBE0C, 0xBE0C }, -{ 0xBE0D, 0xBE0D, 0xBE0D }, -{ 0xBE0E, 0xBE0E, 0xBE0E }, -{ 0xBE0F, 0xBE0F, 0xBE0F }, -{ 0xBE10, 0xBE10, 0xBE10 }, -{ 0xBE11, 0xBE11, 0xBE11 }, -{ 0xBE12, 0xBE12, 0xBE12 }, -{ 0xBE13, 0xBE13, 0xBE13 }, -{ 0xBE14, 0xBE14, 0xBE14 }, -{ 0xBE15, 0xBE15, 0xBE15 }, -{ 0xBE16, 0xBE16, 0xBE16 }, -{ 0xBE17, 0xBE17, 0xBE17 }, -{ 0xBE18, 0xBE18, 0xBE18 }, -{ 0xBE19, 0xBE19, 0xBE19 }, -{ 0xBE1A, 0xBE1A, 0xBE1A }, -{ 0xBE1B, 0xBE1B, 0xBE1B }, -{ 0xBE1C, 0xBE1C, 0xBE1C }, -{ 0xBE1D, 0xBE1D, 0xBE1D }, -{ 0xBE1E, 0xBE1E, 0xBE1E }, -{ 0xBE1F, 0xBE1F, 0xBE1F }, -{ 0xBE20, 0xBE20, 0xBE20 }, -{ 0xBE21, 0xBE21, 0xBE21 }, -{ 0xBE22, 0xBE22, 0xBE22 }, -{ 0xBE23, 0xBE23, 0xBE23 }, -{ 0xBE24, 0xBE24, 0xBE24 }, -{ 0xBE25, 0xBE25, 0xBE25 }, -{ 0xBE26, 0xBE26, 0xBE26 }, -{ 0xBE27, 0xBE27, 0xBE27 }, -{ 0xBE28, 0xBE28, 0xBE28 }, -{ 0xBE29, 0xBE29, 0xBE29 }, -{ 0xBE2A, 0xBE2A, 0xBE2A }, -{ 0xBE2B, 0xBE2B, 0xBE2B }, -{ 0xBE2C, 0xBE2C, 0xBE2C }, -{ 0xBE2D, 0xBE2D, 0xBE2D }, -{ 0xBE2E, 0xBE2E, 0xBE2E }, -{ 0xBE2F, 0xBE2F, 0xBE2F }, -{ 0xBE30, 0xBE30, 0xBE30 }, -{ 0xBE31, 0xBE31, 0xBE31 }, -{ 0xBE32, 0xBE32, 0xBE32 }, -{ 0xBE33, 0xBE33, 0xBE33 }, -{ 0xBE34, 0xBE34, 0xBE34 }, -{ 0xBE35, 0xBE35, 0xBE35 }, -{ 0xBE36, 0xBE36, 0xBE36 }, -{ 0xBE37, 0xBE37, 0xBE37 }, -{ 0xBE38, 0xBE38, 0xBE38 }, -{ 0xBE39, 0xBE39, 0xBE39 }, -{ 0xBE3A, 0xBE3A, 0xBE3A }, -{ 0xBE3B, 0xBE3B, 0xBE3B }, -{ 0xBE3C, 0xBE3C, 0xBE3C }, -{ 0xBE3D, 0xBE3D, 0xBE3D }, -{ 0xBE3E, 0xBE3E, 0xBE3E }, -{ 0xBE3F, 0xBE3F, 0xBE3F }, -{ 0xBE40, 0xBE40, 0xBE40 }, -{ 0xBE41, 0xBE41, 0xBE41 }, -{ 0xBE42, 0xBE42, 0xBE42 }, -{ 0xBE43, 0xBE43, 0xBE43 }, -{ 0xBE44, 0xBE44, 0xBE44 }, -{ 0xBE45, 0xBE45, 0xBE45 }, -{ 0xBE46, 0xBE46, 0xBE46 }, -{ 0xBE47, 0xBE47, 0xBE47 }, -{ 0xBE48, 0xBE48, 0xBE48 }, -{ 0xBE49, 0xBE49, 0xBE49 }, -{ 0xBE4A, 0xBE4A, 0xBE4A }, -{ 0xBE4B, 0xBE4B, 0xBE4B }, -{ 0xBE4C, 0xBE4C, 0xBE4C }, -{ 0xBE4D, 0xBE4D, 0xBE4D }, -{ 0xBE4E, 0xBE4E, 0xBE4E }, -{ 0xBE4F, 0xBE4F, 0xBE4F }, -{ 0xBE50, 0xBE50, 0xBE50 }, -{ 0xBE51, 0xBE51, 0xBE51 }, -{ 0xBE52, 0xBE52, 0xBE52 }, -{ 0xBE53, 0xBE53, 0xBE53 }, -{ 0xBE54, 0xBE54, 0xBE54 }, -{ 0xBE55, 0xBE55, 0xBE55 }, -{ 0xBE56, 0xBE56, 0xBE56 }, -{ 0xBE57, 0xBE57, 0xBE57 }, -{ 0xBE58, 0xBE58, 0xBE58 }, -{ 0xBE59, 0xBE59, 0xBE59 }, -{ 0xBE5A, 0xBE5A, 0xBE5A }, -{ 0xBE5B, 0xBE5B, 0xBE5B }, -{ 0xBE5C, 0xBE5C, 0xBE5C }, -{ 0xBE5D, 0xBE5D, 0xBE5D }, -{ 0xBE5E, 0xBE5E, 0xBE5E }, -{ 0xBE5F, 0xBE5F, 0xBE5F }, -{ 0xBE60, 0xBE60, 0xBE60 }, -{ 0xBE61, 0xBE61, 0xBE61 }, -{ 0xBE62, 0xBE62, 0xBE62 }, -{ 0xBE63, 0xBE63, 0xBE63 }, -{ 0xBE64, 0xBE64, 0xBE64 }, -{ 0xBE65, 0xBE65, 0xBE65 }, -{ 0xBE66, 0xBE66, 0xBE66 }, -{ 0xBE67, 0xBE67, 0xBE67 }, -{ 0xBE68, 0xBE68, 0xBE68 }, -{ 0xBE69, 0xBE69, 0xBE69 }, -{ 0xBE6A, 0xBE6A, 0xBE6A }, -{ 0xBE6B, 0xBE6B, 0xBE6B }, -{ 0xBE6C, 0xBE6C, 0xBE6C }, -{ 0xBE6D, 0xBE6D, 0xBE6D }, -{ 0xBE6E, 0xBE6E, 0xBE6E }, -{ 0xBE6F, 0xBE6F, 0xBE6F }, -{ 0xBE70, 0xBE70, 0xBE70 }, -{ 0xBE71, 0xBE71, 0xBE71 }, -{ 0xBE72, 0xBE72, 0xBE72 }, -{ 0xBE73, 0xBE73, 0xBE73 }, -{ 0xBE74, 0xBE74, 0xBE74 }, -{ 0xBE75, 0xBE75, 0xBE75 }, -{ 0xBE76, 0xBE76, 0xBE76 }, -{ 0xBE77, 0xBE77, 0xBE77 }, -{ 0xBE78, 0xBE78, 0xBE78 }, -{ 0xBE79, 0xBE79, 0xBE79 }, -{ 0xBE7A, 0xBE7A, 0xBE7A }, -{ 0xBE7B, 0xBE7B, 0xBE7B }, -{ 0xBE7C, 0xBE7C, 0xBE7C }, -{ 0xBE7D, 0xBE7D, 0xBE7D }, -{ 0xBE7E, 0xBE7E, 0xBE7E }, -{ 0xBE7F, 0xBE7F, 0xBE7F }, -{ 0xBE80, 0xBE80, 0xBE80 }, -{ 0xBE81, 0xBE81, 0xBE81 }, -{ 0xBE82, 0xBE82, 0xBE82 }, -{ 0xBE83, 0xBE83, 0xBE83 }, -{ 0xBE84, 0xBE84, 0xBE84 }, -{ 0xBE85, 0xBE85, 0xBE85 }, -{ 0xBE86, 0xBE86, 0xBE86 }, -{ 0xBE87, 0xBE87, 0xBE87 }, -{ 0xBE88, 0xBE88, 0xBE88 }, -{ 0xBE89, 0xBE89, 0xBE89 }, -{ 0xBE8A, 0xBE8A, 0xBE8A }, -{ 0xBE8B, 0xBE8B, 0xBE8B }, -{ 0xBE8C, 0xBE8C, 0xBE8C }, -{ 0xBE8D, 0xBE8D, 0xBE8D }, -{ 0xBE8E, 0xBE8E, 0xBE8E }, -{ 0xBE8F, 0xBE8F, 0xBE8F }, -{ 0xBE90, 0xBE90, 0xBE90 }, -{ 0xBE91, 0xBE91, 0xBE91 }, -{ 0xBE92, 0xBE92, 0xBE92 }, -{ 0xBE93, 0xBE93, 0xBE93 }, -{ 0xBE94, 0xBE94, 0xBE94 }, -{ 0xBE95, 0xBE95, 0xBE95 }, -{ 0xBE96, 0xBE96, 0xBE96 }, -{ 0xBE97, 0xBE97, 0xBE97 }, -{ 0xBE98, 0xBE98, 0xBE98 }, -{ 0xBE99, 0xBE99, 0xBE99 }, -{ 0xBE9A, 0xBE9A, 0xBE9A }, -{ 0xBE9B, 0xBE9B, 0xBE9B }, -{ 0xBE9C, 0xBE9C, 0xBE9C }, -{ 0xBE9D, 0xBE9D, 0xBE9D }, -{ 0xBE9E, 0xBE9E, 0xBE9E }, -{ 0xBE9F, 0xBE9F, 0xBE9F }, -{ 0xBEA0, 0xBEA0, 0xBEA0 }, -{ 0xBEA1, 0xBEA1, 0xBEA1 }, -{ 0xBEA2, 0xBEA2, 0xBEA2 }, -{ 0xBEA3, 0xBEA3, 0xBEA3 }, -{ 0xBEA4, 0xBEA4, 0xBEA4 }, -{ 0xBEA5, 0xBEA5, 0xBEA5 }, -{ 0xBEA6, 0xBEA6, 0xBEA6 }, -{ 0xBEA7, 0xBEA7, 0xBEA7 }, -{ 0xBEA8, 0xBEA8, 0xBEA8 }, -{ 0xBEA9, 0xBEA9, 0xBEA9 }, -{ 0xBEAA, 0xBEAA, 0xBEAA }, -{ 0xBEAB, 0xBEAB, 0xBEAB }, -{ 0xBEAC, 0xBEAC, 0xBEAC }, -{ 0xBEAD, 0xBEAD, 0xBEAD }, -{ 0xBEAE, 0xBEAE, 0xBEAE }, -{ 0xBEAF, 0xBEAF, 0xBEAF }, -{ 0xBEB0, 0xBEB0, 0xBEB0 }, -{ 0xBEB1, 0xBEB1, 0xBEB1 }, -{ 0xBEB2, 0xBEB2, 0xBEB2 }, -{ 0xBEB3, 0xBEB3, 0xBEB3 }, -{ 0xBEB4, 0xBEB4, 0xBEB4 }, -{ 0xBEB5, 0xBEB5, 0xBEB5 }, -{ 0xBEB6, 0xBEB6, 0xBEB6 }, -{ 0xBEB7, 0xBEB7, 0xBEB7 }, -{ 0xBEB8, 0xBEB8, 0xBEB8 }, -{ 0xBEB9, 0xBEB9, 0xBEB9 }, -{ 0xBEBA, 0xBEBA, 0xBEBA }, -{ 0xBEBB, 0xBEBB, 0xBEBB }, -{ 0xBEBC, 0xBEBC, 0xBEBC }, -{ 0xBEBD, 0xBEBD, 0xBEBD }, -{ 0xBEBE, 0xBEBE, 0xBEBE }, -{ 0xBEBF, 0xBEBF, 0xBEBF }, -{ 0xBEC0, 0xBEC0, 0xBEC0 }, -{ 0xBEC1, 0xBEC1, 0xBEC1 }, -{ 0xBEC2, 0xBEC2, 0xBEC2 }, -{ 0xBEC3, 0xBEC3, 0xBEC3 }, -{ 0xBEC4, 0xBEC4, 0xBEC4 }, -{ 0xBEC5, 0xBEC5, 0xBEC5 }, -{ 0xBEC6, 0xBEC6, 0xBEC6 }, -{ 0xBEC7, 0xBEC7, 0xBEC7 }, -{ 0xBEC8, 0xBEC8, 0xBEC8 }, -{ 0xBEC9, 0xBEC9, 0xBEC9 }, -{ 0xBECA, 0xBECA, 0xBECA }, -{ 0xBECB, 0xBECB, 0xBECB }, -{ 0xBECC, 0xBECC, 0xBECC }, -{ 0xBECD, 0xBECD, 0xBECD }, -{ 0xBECE, 0xBECE, 0xBECE }, -{ 0xBECF, 0xBECF, 0xBECF }, -{ 0xBED0, 0xBED0, 0xBED0 }, -{ 0xBED1, 0xBED1, 0xBED1 }, -{ 0xBED2, 0xBED2, 0xBED2 }, -{ 0xBED3, 0xBED3, 0xBED3 }, -{ 0xBED4, 0xBED4, 0xBED4 }, -{ 0xBED5, 0xBED5, 0xBED5 }, -{ 0xBED6, 0xBED6, 0xBED6 }, -{ 0xBED7, 0xBED7, 0xBED7 }, -{ 0xBED8, 0xBED8, 0xBED8 }, -{ 0xBED9, 0xBED9, 0xBED9 }, -{ 0xBEDA, 0xBEDA, 0xBEDA }, -{ 0xBEDB, 0xBEDB, 0xBEDB }, -{ 0xBEDC, 0xBEDC, 0xBEDC }, -{ 0xBEDD, 0xBEDD, 0xBEDD }, -{ 0xBEDE, 0xBEDE, 0xBEDE }, -{ 0xBEDF, 0xBEDF, 0xBEDF }, -{ 0xBEE0, 0xBEE0, 0xBEE0 }, -{ 0xBEE1, 0xBEE1, 0xBEE1 }, -{ 0xBEE2, 0xBEE2, 0xBEE2 }, -{ 0xBEE3, 0xBEE3, 0xBEE3 }, -{ 0xBEE4, 0xBEE4, 0xBEE4 }, -{ 0xBEE5, 0xBEE5, 0xBEE5 }, -{ 0xBEE6, 0xBEE6, 0xBEE6 }, -{ 0xBEE7, 0xBEE7, 0xBEE7 }, -{ 0xBEE8, 0xBEE8, 0xBEE8 }, -{ 0xBEE9, 0xBEE9, 0xBEE9 }, -{ 0xBEEA, 0xBEEA, 0xBEEA }, -{ 0xBEEB, 0xBEEB, 0xBEEB }, -{ 0xBEEC, 0xBEEC, 0xBEEC }, -{ 0xBEED, 0xBEED, 0xBEED }, -{ 0xBEEE, 0xBEEE, 0xBEEE }, -{ 0xBEEF, 0xBEEF, 0xBEEF }, -{ 0xBEF0, 0xBEF0, 0xBEF0 }, -{ 0xBEF1, 0xBEF1, 0xBEF1 }, -{ 0xBEF2, 0xBEF2, 0xBEF2 }, -{ 0xBEF3, 0xBEF3, 0xBEF3 }, -{ 0xBEF4, 0xBEF4, 0xBEF4 }, -{ 0xBEF5, 0xBEF5, 0xBEF5 }, -{ 0xBEF6, 0xBEF6, 0xBEF6 }, -{ 0xBEF7, 0xBEF7, 0xBEF7 }, -{ 0xBEF8, 0xBEF8, 0xBEF8 }, -{ 0xBEF9, 0xBEF9, 0xBEF9 }, -{ 0xBEFA, 0xBEFA, 0xBEFA }, -{ 0xBEFB, 0xBEFB, 0xBEFB }, -{ 0xBEFC, 0xBEFC, 0xBEFC }, -{ 0xBEFD, 0xBEFD, 0xBEFD }, -{ 0xBEFE, 0xBEFE, 0xBEFE }, -{ 0xBEFF, 0xBEFF, 0xBEFF }, -{ 0xBF00, 0xBF00, 0xBF00 }, -{ 0xBF01, 0xBF01, 0xBF01 }, -{ 0xBF02, 0xBF02, 0xBF02 }, -{ 0xBF03, 0xBF03, 0xBF03 }, -{ 0xBF04, 0xBF04, 0xBF04 }, -{ 0xBF05, 0xBF05, 0xBF05 }, -{ 0xBF06, 0xBF06, 0xBF06 }, -{ 0xBF07, 0xBF07, 0xBF07 }, -{ 0xBF08, 0xBF08, 0xBF08 }, -{ 0xBF09, 0xBF09, 0xBF09 }, -{ 0xBF0A, 0xBF0A, 0xBF0A }, -{ 0xBF0B, 0xBF0B, 0xBF0B }, -{ 0xBF0C, 0xBF0C, 0xBF0C }, -{ 0xBF0D, 0xBF0D, 0xBF0D }, -{ 0xBF0E, 0xBF0E, 0xBF0E }, -{ 0xBF0F, 0xBF0F, 0xBF0F }, -{ 0xBF10, 0xBF10, 0xBF10 }, -{ 0xBF11, 0xBF11, 0xBF11 }, -{ 0xBF12, 0xBF12, 0xBF12 }, -{ 0xBF13, 0xBF13, 0xBF13 }, -{ 0xBF14, 0xBF14, 0xBF14 }, -{ 0xBF15, 0xBF15, 0xBF15 }, -{ 0xBF16, 0xBF16, 0xBF16 }, -{ 0xBF17, 0xBF17, 0xBF17 }, -{ 0xBF18, 0xBF18, 0xBF18 }, -{ 0xBF19, 0xBF19, 0xBF19 }, -{ 0xBF1A, 0xBF1A, 0xBF1A }, -{ 0xBF1B, 0xBF1B, 0xBF1B }, -{ 0xBF1C, 0xBF1C, 0xBF1C }, -{ 0xBF1D, 0xBF1D, 0xBF1D }, -{ 0xBF1E, 0xBF1E, 0xBF1E }, -{ 0xBF1F, 0xBF1F, 0xBF1F }, -{ 0xBF20, 0xBF20, 0xBF20 }, -{ 0xBF21, 0xBF21, 0xBF21 }, -{ 0xBF22, 0xBF22, 0xBF22 }, -{ 0xBF23, 0xBF23, 0xBF23 }, -{ 0xBF24, 0xBF24, 0xBF24 }, -{ 0xBF25, 0xBF25, 0xBF25 }, -{ 0xBF26, 0xBF26, 0xBF26 }, -{ 0xBF27, 0xBF27, 0xBF27 }, -{ 0xBF28, 0xBF28, 0xBF28 }, -{ 0xBF29, 0xBF29, 0xBF29 }, -{ 0xBF2A, 0xBF2A, 0xBF2A }, -{ 0xBF2B, 0xBF2B, 0xBF2B }, -{ 0xBF2C, 0xBF2C, 0xBF2C }, -{ 0xBF2D, 0xBF2D, 0xBF2D }, -{ 0xBF2E, 0xBF2E, 0xBF2E }, -{ 0xBF2F, 0xBF2F, 0xBF2F }, -{ 0xBF30, 0xBF30, 0xBF30 }, -{ 0xBF31, 0xBF31, 0xBF31 }, -{ 0xBF32, 0xBF32, 0xBF32 }, -{ 0xBF33, 0xBF33, 0xBF33 }, -{ 0xBF34, 0xBF34, 0xBF34 }, -{ 0xBF35, 0xBF35, 0xBF35 }, -{ 0xBF36, 0xBF36, 0xBF36 }, -{ 0xBF37, 0xBF37, 0xBF37 }, -{ 0xBF38, 0xBF38, 0xBF38 }, -{ 0xBF39, 0xBF39, 0xBF39 }, -{ 0xBF3A, 0xBF3A, 0xBF3A }, -{ 0xBF3B, 0xBF3B, 0xBF3B }, -{ 0xBF3C, 0xBF3C, 0xBF3C }, -{ 0xBF3D, 0xBF3D, 0xBF3D }, -{ 0xBF3E, 0xBF3E, 0xBF3E }, -{ 0xBF3F, 0xBF3F, 0xBF3F }, -{ 0xBF40, 0xBF40, 0xBF40 }, -{ 0xBF41, 0xBF41, 0xBF41 }, -{ 0xBF42, 0xBF42, 0xBF42 }, -{ 0xBF43, 0xBF43, 0xBF43 }, -{ 0xBF44, 0xBF44, 0xBF44 }, -{ 0xBF45, 0xBF45, 0xBF45 }, -{ 0xBF46, 0xBF46, 0xBF46 }, -{ 0xBF47, 0xBF47, 0xBF47 }, -{ 0xBF48, 0xBF48, 0xBF48 }, -{ 0xBF49, 0xBF49, 0xBF49 }, -{ 0xBF4A, 0xBF4A, 0xBF4A }, -{ 0xBF4B, 0xBF4B, 0xBF4B }, -{ 0xBF4C, 0xBF4C, 0xBF4C }, -{ 0xBF4D, 0xBF4D, 0xBF4D }, -{ 0xBF4E, 0xBF4E, 0xBF4E }, -{ 0xBF4F, 0xBF4F, 0xBF4F }, -{ 0xBF50, 0xBF50, 0xBF50 }, -{ 0xBF51, 0xBF51, 0xBF51 }, -{ 0xBF52, 0xBF52, 0xBF52 }, -{ 0xBF53, 0xBF53, 0xBF53 }, -{ 0xBF54, 0xBF54, 0xBF54 }, -{ 0xBF55, 0xBF55, 0xBF55 }, -{ 0xBF56, 0xBF56, 0xBF56 }, -{ 0xBF57, 0xBF57, 0xBF57 }, -{ 0xBF58, 0xBF58, 0xBF58 }, -{ 0xBF59, 0xBF59, 0xBF59 }, -{ 0xBF5A, 0xBF5A, 0xBF5A }, -{ 0xBF5B, 0xBF5B, 0xBF5B }, -{ 0xBF5C, 0xBF5C, 0xBF5C }, -{ 0xBF5D, 0xBF5D, 0xBF5D }, -{ 0xBF5E, 0xBF5E, 0xBF5E }, -{ 0xBF5F, 0xBF5F, 0xBF5F }, -{ 0xBF60, 0xBF60, 0xBF60 }, -{ 0xBF61, 0xBF61, 0xBF61 }, -{ 0xBF62, 0xBF62, 0xBF62 }, -{ 0xBF63, 0xBF63, 0xBF63 }, -{ 0xBF64, 0xBF64, 0xBF64 }, -{ 0xBF65, 0xBF65, 0xBF65 }, -{ 0xBF66, 0xBF66, 0xBF66 }, -{ 0xBF67, 0xBF67, 0xBF67 }, -{ 0xBF68, 0xBF68, 0xBF68 }, -{ 0xBF69, 0xBF69, 0xBF69 }, -{ 0xBF6A, 0xBF6A, 0xBF6A }, -{ 0xBF6B, 0xBF6B, 0xBF6B }, -{ 0xBF6C, 0xBF6C, 0xBF6C }, -{ 0xBF6D, 0xBF6D, 0xBF6D }, -{ 0xBF6E, 0xBF6E, 0xBF6E }, -{ 0xBF6F, 0xBF6F, 0xBF6F }, -{ 0xBF70, 0xBF70, 0xBF70 }, -{ 0xBF71, 0xBF71, 0xBF71 }, -{ 0xBF72, 0xBF72, 0xBF72 }, -{ 0xBF73, 0xBF73, 0xBF73 }, -{ 0xBF74, 0xBF74, 0xBF74 }, -{ 0xBF75, 0xBF75, 0xBF75 }, -{ 0xBF76, 0xBF76, 0xBF76 }, -{ 0xBF77, 0xBF77, 0xBF77 }, -{ 0xBF78, 0xBF78, 0xBF78 }, -{ 0xBF79, 0xBF79, 0xBF79 }, -{ 0xBF7A, 0xBF7A, 0xBF7A }, -{ 0xBF7B, 0xBF7B, 0xBF7B }, -{ 0xBF7C, 0xBF7C, 0xBF7C }, -{ 0xBF7D, 0xBF7D, 0xBF7D }, -{ 0xBF7E, 0xBF7E, 0xBF7E }, -{ 0xBF7F, 0xBF7F, 0xBF7F }, -{ 0xBF80, 0xBF80, 0xBF80 }, -{ 0xBF81, 0xBF81, 0xBF81 }, -{ 0xBF82, 0xBF82, 0xBF82 }, -{ 0xBF83, 0xBF83, 0xBF83 }, -{ 0xBF84, 0xBF84, 0xBF84 }, -{ 0xBF85, 0xBF85, 0xBF85 }, -{ 0xBF86, 0xBF86, 0xBF86 }, -{ 0xBF87, 0xBF87, 0xBF87 }, -{ 0xBF88, 0xBF88, 0xBF88 }, -{ 0xBF89, 0xBF89, 0xBF89 }, -{ 0xBF8A, 0xBF8A, 0xBF8A }, -{ 0xBF8B, 0xBF8B, 0xBF8B }, -{ 0xBF8C, 0xBF8C, 0xBF8C }, -{ 0xBF8D, 0xBF8D, 0xBF8D }, -{ 0xBF8E, 0xBF8E, 0xBF8E }, -{ 0xBF8F, 0xBF8F, 0xBF8F }, -{ 0xBF90, 0xBF90, 0xBF90 }, -{ 0xBF91, 0xBF91, 0xBF91 }, -{ 0xBF92, 0xBF92, 0xBF92 }, -{ 0xBF93, 0xBF93, 0xBF93 }, -{ 0xBF94, 0xBF94, 0xBF94 }, -{ 0xBF95, 0xBF95, 0xBF95 }, -{ 0xBF96, 0xBF96, 0xBF96 }, -{ 0xBF97, 0xBF97, 0xBF97 }, -{ 0xBF98, 0xBF98, 0xBF98 }, -{ 0xBF99, 0xBF99, 0xBF99 }, -{ 0xBF9A, 0xBF9A, 0xBF9A }, -{ 0xBF9B, 0xBF9B, 0xBF9B }, -{ 0xBF9C, 0xBF9C, 0xBF9C }, -{ 0xBF9D, 0xBF9D, 0xBF9D }, -{ 0xBF9E, 0xBF9E, 0xBF9E }, -{ 0xBF9F, 0xBF9F, 0xBF9F }, -{ 0xBFA0, 0xBFA0, 0xBFA0 }, -{ 0xBFA1, 0xBFA1, 0xBFA1 }, -{ 0xBFA2, 0xBFA2, 0xBFA2 }, -{ 0xBFA3, 0xBFA3, 0xBFA3 }, -{ 0xBFA4, 0xBFA4, 0xBFA4 }, -{ 0xBFA5, 0xBFA5, 0xBFA5 }, -{ 0xBFA6, 0xBFA6, 0xBFA6 }, -{ 0xBFA7, 0xBFA7, 0xBFA7 }, -{ 0xBFA8, 0xBFA8, 0xBFA8 }, -{ 0xBFA9, 0xBFA9, 0xBFA9 }, -{ 0xBFAA, 0xBFAA, 0xBFAA }, -{ 0xBFAB, 0xBFAB, 0xBFAB }, -{ 0xBFAC, 0xBFAC, 0xBFAC }, -{ 0xBFAD, 0xBFAD, 0xBFAD }, -{ 0xBFAE, 0xBFAE, 0xBFAE }, -{ 0xBFAF, 0xBFAF, 0xBFAF }, -{ 0xBFB0, 0xBFB0, 0xBFB0 }, -{ 0xBFB1, 0xBFB1, 0xBFB1 }, -{ 0xBFB2, 0xBFB2, 0xBFB2 }, -{ 0xBFB3, 0xBFB3, 0xBFB3 }, -{ 0xBFB4, 0xBFB4, 0xBFB4 }, -{ 0xBFB5, 0xBFB5, 0xBFB5 }, -{ 0xBFB6, 0xBFB6, 0xBFB6 }, -{ 0xBFB7, 0xBFB7, 0xBFB7 }, -{ 0xBFB8, 0xBFB8, 0xBFB8 }, -{ 0xBFB9, 0xBFB9, 0xBFB9 }, -{ 0xBFBA, 0xBFBA, 0xBFBA }, -{ 0xBFBB, 0xBFBB, 0xBFBB }, -{ 0xBFBC, 0xBFBC, 0xBFBC }, -{ 0xBFBD, 0xBFBD, 0xBFBD }, -{ 0xBFBE, 0xBFBE, 0xBFBE }, -{ 0xBFBF, 0xBFBF, 0xBFBF }, -{ 0xBFC0, 0xBFC0, 0xBFC0 }, -{ 0xBFC1, 0xBFC1, 0xBFC1 }, -{ 0xBFC2, 0xBFC2, 0xBFC2 }, -{ 0xBFC3, 0xBFC3, 0xBFC3 }, -{ 0xBFC4, 0xBFC4, 0xBFC4 }, -{ 0xBFC5, 0xBFC5, 0xBFC5 }, -{ 0xBFC6, 0xBFC6, 0xBFC6 }, -{ 0xBFC7, 0xBFC7, 0xBFC7 }, -{ 0xBFC8, 0xBFC8, 0xBFC8 }, -{ 0xBFC9, 0xBFC9, 0xBFC9 }, -{ 0xBFCA, 0xBFCA, 0xBFCA }, -{ 0xBFCB, 0xBFCB, 0xBFCB }, -{ 0xBFCC, 0xBFCC, 0xBFCC }, -{ 0xBFCD, 0xBFCD, 0xBFCD }, -{ 0xBFCE, 0xBFCE, 0xBFCE }, -{ 0xBFCF, 0xBFCF, 0xBFCF }, -{ 0xBFD0, 0xBFD0, 0xBFD0 }, -{ 0xBFD1, 0xBFD1, 0xBFD1 }, -{ 0xBFD2, 0xBFD2, 0xBFD2 }, -{ 0xBFD3, 0xBFD3, 0xBFD3 }, -{ 0xBFD4, 0xBFD4, 0xBFD4 }, -{ 0xBFD5, 0xBFD5, 0xBFD5 }, -{ 0xBFD6, 0xBFD6, 0xBFD6 }, -{ 0xBFD7, 0xBFD7, 0xBFD7 }, -{ 0xBFD8, 0xBFD8, 0xBFD8 }, -{ 0xBFD9, 0xBFD9, 0xBFD9 }, -{ 0xBFDA, 0xBFDA, 0xBFDA }, -{ 0xBFDB, 0xBFDB, 0xBFDB }, -{ 0xBFDC, 0xBFDC, 0xBFDC }, -{ 0xBFDD, 0xBFDD, 0xBFDD }, -{ 0xBFDE, 0xBFDE, 0xBFDE }, -{ 0xBFDF, 0xBFDF, 0xBFDF }, -{ 0xBFE0, 0xBFE0, 0xBFE0 }, -{ 0xBFE1, 0xBFE1, 0xBFE1 }, -{ 0xBFE2, 0xBFE2, 0xBFE2 }, -{ 0xBFE3, 0xBFE3, 0xBFE3 }, -{ 0xBFE4, 0xBFE4, 0xBFE4 }, -{ 0xBFE5, 0xBFE5, 0xBFE5 }, -{ 0xBFE6, 0xBFE6, 0xBFE6 }, -{ 0xBFE7, 0xBFE7, 0xBFE7 }, -{ 0xBFE8, 0xBFE8, 0xBFE8 }, -{ 0xBFE9, 0xBFE9, 0xBFE9 }, -{ 0xBFEA, 0xBFEA, 0xBFEA }, -{ 0xBFEB, 0xBFEB, 0xBFEB }, -{ 0xBFEC, 0xBFEC, 0xBFEC }, -{ 0xBFED, 0xBFED, 0xBFED }, -{ 0xBFEE, 0xBFEE, 0xBFEE }, -{ 0xBFEF, 0xBFEF, 0xBFEF }, -{ 0xBFF0, 0xBFF0, 0xBFF0 }, -{ 0xBFF1, 0xBFF1, 0xBFF1 }, -{ 0xBFF2, 0xBFF2, 0xBFF2 }, -{ 0xBFF3, 0xBFF3, 0xBFF3 }, -{ 0xBFF4, 0xBFF4, 0xBFF4 }, -{ 0xBFF5, 0xBFF5, 0xBFF5 }, -{ 0xBFF6, 0xBFF6, 0xBFF6 }, -{ 0xBFF7, 0xBFF7, 0xBFF7 }, -{ 0xBFF8, 0xBFF8, 0xBFF8 }, -{ 0xBFF9, 0xBFF9, 0xBFF9 }, -{ 0xBFFA, 0xBFFA, 0xBFFA }, -{ 0xBFFB, 0xBFFB, 0xBFFB }, -{ 0xBFFC, 0xBFFC, 0xBFFC }, -{ 0xBFFD, 0xBFFD, 0xBFFD }, -{ 0xBFFE, 0xBFFE, 0xBFFE }, -{ 0xBFFF, 0xBFFF, 0xBFFF }, -{ 0xC000, 0xC000, 0xC000 }, -{ 0xC001, 0xC001, 0xC001 }, -{ 0xC002, 0xC002, 0xC002 }, -{ 0xC003, 0xC003, 0xC003 }, -{ 0xC004, 0xC004, 0xC004 }, -{ 0xC005, 0xC005, 0xC005 }, -{ 0xC006, 0xC006, 0xC006 }, -{ 0xC007, 0xC007, 0xC007 }, -{ 0xC008, 0xC008, 0xC008 }, -{ 0xC009, 0xC009, 0xC009 }, -{ 0xC00A, 0xC00A, 0xC00A }, -{ 0xC00B, 0xC00B, 0xC00B }, -{ 0xC00C, 0xC00C, 0xC00C }, -{ 0xC00D, 0xC00D, 0xC00D }, -{ 0xC00E, 0xC00E, 0xC00E }, -{ 0xC00F, 0xC00F, 0xC00F }, -{ 0xC010, 0xC010, 0xC010 }, -{ 0xC011, 0xC011, 0xC011 }, -{ 0xC012, 0xC012, 0xC012 }, -{ 0xC013, 0xC013, 0xC013 }, -{ 0xC014, 0xC014, 0xC014 }, -{ 0xC015, 0xC015, 0xC015 }, -{ 0xC016, 0xC016, 0xC016 }, -{ 0xC017, 0xC017, 0xC017 }, -{ 0xC018, 0xC018, 0xC018 }, -{ 0xC019, 0xC019, 0xC019 }, -{ 0xC01A, 0xC01A, 0xC01A }, -{ 0xC01B, 0xC01B, 0xC01B }, -{ 0xC01C, 0xC01C, 0xC01C }, -{ 0xC01D, 0xC01D, 0xC01D }, -{ 0xC01E, 0xC01E, 0xC01E }, -{ 0xC01F, 0xC01F, 0xC01F }, -{ 0xC020, 0xC020, 0xC020 }, -{ 0xC021, 0xC021, 0xC021 }, -{ 0xC022, 0xC022, 0xC022 }, -{ 0xC023, 0xC023, 0xC023 }, -{ 0xC024, 0xC024, 0xC024 }, -{ 0xC025, 0xC025, 0xC025 }, -{ 0xC026, 0xC026, 0xC026 }, -{ 0xC027, 0xC027, 0xC027 }, -{ 0xC028, 0xC028, 0xC028 }, -{ 0xC029, 0xC029, 0xC029 }, -{ 0xC02A, 0xC02A, 0xC02A }, -{ 0xC02B, 0xC02B, 0xC02B }, -{ 0xC02C, 0xC02C, 0xC02C }, -{ 0xC02D, 0xC02D, 0xC02D }, -{ 0xC02E, 0xC02E, 0xC02E }, -{ 0xC02F, 0xC02F, 0xC02F }, -{ 0xC030, 0xC030, 0xC030 }, -{ 0xC031, 0xC031, 0xC031 }, -{ 0xC032, 0xC032, 0xC032 }, -{ 0xC033, 0xC033, 0xC033 }, -{ 0xC034, 0xC034, 0xC034 }, -{ 0xC035, 0xC035, 0xC035 }, -{ 0xC036, 0xC036, 0xC036 }, -{ 0xC037, 0xC037, 0xC037 }, -{ 0xC038, 0xC038, 0xC038 }, -{ 0xC039, 0xC039, 0xC039 }, -{ 0xC03A, 0xC03A, 0xC03A }, -{ 0xC03B, 0xC03B, 0xC03B }, -{ 0xC03C, 0xC03C, 0xC03C }, -{ 0xC03D, 0xC03D, 0xC03D }, -{ 0xC03E, 0xC03E, 0xC03E }, -{ 0xC03F, 0xC03F, 0xC03F }, -{ 0xC040, 0xC040, 0xC040 }, -{ 0xC041, 0xC041, 0xC041 }, -{ 0xC042, 0xC042, 0xC042 }, -{ 0xC043, 0xC043, 0xC043 }, -{ 0xC044, 0xC044, 0xC044 }, -{ 0xC045, 0xC045, 0xC045 }, -{ 0xC046, 0xC046, 0xC046 }, -{ 0xC047, 0xC047, 0xC047 }, -{ 0xC048, 0xC048, 0xC048 }, -{ 0xC049, 0xC049, 0xC049 }, -{ 0xC04A, 0xC04A, 0xC04A }, -{ 0xC04B, 0xC04B, 0xC04B }, -{ 0xC04C, 0xC04C, 0xC04C }, -{ 0xC04D, 0xC04D, 0xC04D }, -{ 0xC04E, 0xC04E, 0xC04E }, -{ 0xC04F, 0xC04F, 0xC04F }, -{ 0xC050, 0xC050, 0xC050 }, -{ 0xC051, 0xC051, 0xC051 }, -{ 0xC052, 0xC052, 0xC052 }, -{ 0xC053, 0xC053, 0xC053 }, -{ 0xC054, 0xC054, 0xC054 }, -{ 0xC055, 0xC055, 0xC055 }, -{ 0xC056, 0xC056, 0xC056 }, -{ 0xC057, 0xC057, 0xC057 }, -{ 0xC058, 0xC058, 0xC058 }, -{ 0xC059, 0xC059, 0xC059 }, -{ 0xC05A, 0xC05A, 0xC05A }, -{ 0xC05B, 0xC05B, 0xC05B }, -{ 0xC05C, 0xC05C, 0xC05C }, -{ 0xC05D, 0xC05D, 0xC05D }, -{ 0xC05E, 0xC05E, 0xC05E }, -{ 0xC05F, 0xC05F, 0xC05F }, -{ 0xC060, 0xC060, 0xC060 }, -{ 0xC061, 0xC061, 0xC061 }, -{ 0xC062, 0xC062, 0xC062 }, -{ 0xC063, 0xC063, 0xC063 }, -{ 0xC064, 0xC064, 0xC064 }, -{ 0xC065, 0xC065, 0xC065 }, -{ 0xC066, 0xC066, 0xC066 }, -{ 0xC067, 0xC067, 0xC067 }, -{ 0xC068, 0xC068, 0xC068 }, -{ 0xC069, 0xC069, 0xC069 }, -{ 0xC06A, 0xC06A, 0xC06A }, -{ 0xC06B, 0xC06B, 0xC06B }, -{ 0xC06C, 0xC06C, 0xC06C }, -{ 0xC06D, 0xC06D, 0xC06D }, -{ 0xC06E, 0xC06E, 0xC06E }, -{ 0xC06F, 0xC06F, 0xC06F }, -{ 0xC070, 0xC070, 0xC070 }, -{ 0xC071, 0xC071, 0xC071 }, -{ 0xC072, 0xC072, 0xC072 }, -{ 0xC073, 0xC073, 0xC073 }, -{ 0xC074, 0xC074, 0xC074 }, -{ 0xC075, 0xC075, 0xC075 }, -{ 0xC076, 0xC076, 0xC076 }, -{ 0xC077, 0xC077, 0xC077 }, -{ 0xC078, 0xC078, 0xC078 }, -{ 0xC079, 0xC079, 0xC079 }, -{ 0xC07A, 0xC07A, 0xC07A }, -{ 0xC07B, 0xC07B, 0xC07B }, -{ 0xC07C, 0xC07C, 0xC07C }, -{ 0xC07D, 0xC07D, 0xC07D }, -{ 0xC07E, 0xC07E, 0xC07E }, -{ 0xC07F, 0xC07F, 0xC07F }, -{ 0xC080, 0xC080, 0xC080 }, -{ 0xC081, 0xC081, 0xC081 }, -{ 0xC082, 0xC082, 0xC082 }, -{ 0xC083, 0xC083, 0xC083 }, -{ 0xC084, 0xC084, 0xC084 }, -{ 0xC085, 0xC085, 0xC085 }, -{ 0xC086, 0xC086, 0xC086 }, -{ 0xC087, 0xC087, 0xC087 }, -{ 0xC088, 0xC088, 0xC088 }, -{ 0xC089, 0xC089, 0xC089 }, -{ 0xC08A, 0xC08A, 0xC08A }, -{ 0xC08B, 0xC08B, 0xC08B }, -{ 0xC08C, 0xC08C, 0xC08C }, -{ 0xC08D, 0xC08D, 0xC08D }, -{ 0xC08E, 0xC08E, 0xC08E }, -{ 0xC08F, 0xC08F, 0xC08F }, -{ 0xC090, 0xC090, 0xC090 }, -{ 0xC091, 0xC091, 0xC091 }, -{ 0xC092, 0xC092, 0xC092 }, -{ 0xC093, 0xC093, 0xC093 }, -{ 0xC094, 0xC094, 0xC094 }, -{ 0xC095, 0xC095, 0xC095 }, -{ 0xC096, 0xC096, 0xC096 }, -{ 0xC097, 0xC097, 0xC097 }, -{ 0xC098, 0xC098, 0xC098 }, -{ 0xC099, 0xC099, 0xC099 }, -{ 0xC09A, 0xC09A, 0xC09A }, -{ 0xC09B, 0xC09B, 0xC09B }, -{ 0xC09C, 0xC09C, 0xC09C }, -{ 0xC09D, 0xC09D, 0xC09D }, -{ 0xC09E, 0xC09E, 0xC09E }, -{ 0xC09F, 0xC09F, 0xC09F }, -{ 0xC0A0, 0xC0A0, 0xC0A0 }, -{ 0xC0A1, 0xC0A1, 0xC0A1 }, -{ 0xC0A2, 0xC0A2, 0xC0A2 }, -{ 0xC0A3, 0xC0A3, 0xC0A3 }, -{ 0xC0A4, 0xC0A4, 0xC0A4 }, -{ 0xC0A5, 0xC0A5, 0xC0A5 }, -{ 0xC0A6, 0xC0A6, 0xC0A6 }, -{ 0xC0A7, 0xC0A7, 0xC0A7 }, -{ 0xC0A8, 0xC0A8, 0xC0A8 }, -{ 0xC0A9, 0xC0A9, 0xC0A9 }, -{ 0xC0AA, 0xC0AA, 0xC0AA }, -{ 0xC0AB, 0xC0AB, 0xC0AB }, -{ 0xC0AC, 0xC0AC, 0xC0AC }, -{ 0xC0AD, 0xC0AD, 0xC0AD }, -{ 0xC0AE, 0xC0AE, 0xC0AE }, -{ 0xC0AF, 0xC0AF, 0xC0AF }, -{ 0xC0B0, 0xC0B0, 0xC0B0 }, -{ 0xC0B1, 0xC0B1, 0xC0B1 }, -{ 0xC0B2, 0xC0B2, 0xC0B2 }, -{ 0xC0B3, 0xC0B3, 0xC0B3 }, -{ 0xC0B4, 0xC0B4, 0xC0B4 }, -{ 0xC0B5, 0xC0B5, 0xC0B5 }, -{ 0xC0B6, 0xC0B6, 0xC0B6 }, -{ 0xC0B7, 0xC0B7, 0xC0B7 }, -{ 0xC0B8, 0xC0B8, 0xC0B8 }, -{ 0xC0B9, 0xC0B9, 0xC0B9 }, -{ 0xC0BA, 0xC0BA, 0xC0BA }, -{ 0xC0BB, 0xC0BB, 0xC0BB }, -{ 0xC0BC, 0xC0BC, 0xC0BC }, -{ 0xC0BD, 0xC0BD, 0xC0BD }, -{ 0xC0BE, 0xC0BE, 0xC0BE }, -{ 0xC0BF, 0xC0BF, 0xC0BF }, -{ 0xC0C0, 0xC0C0, 0xC0C0 }, -{ 0xC0C1, 0xC0C1, 0xC0C1 }, -{ 0xC0C2, 0xC0C2, 0xC0C2 }, -{ 0xC0C3, 0xC0C3, 0xC0C3 }, -{ 0xC0C4, 0xC0C4, 0xC0C4 }, -{ 0xC0C5, 0xC0C5, 0xC0C5 }, -{ 0xC0C6, 0xC0C6, 0xC0C6 }, -{ 0xC0C7, 0xC0C7, 0xC0C7 }, -{ 0xC0C8, 0xC0C8, 0xC0C8 }, -{ 0xC0C9, 0xC0C9, 0xC0C9 }, -{ 0xC0CA, 0xC0CA, 0xC0CA }, -{ 0xC0CB, 0xC0CB, 0xC0CB }, -{ 0xC0CC, 0xC0CC, 0xC0CC }, -{ 0xC0CD, 0xC0CD, 0xC0CD }, -{ 0xC0CE, 0xC0CE, 0xC0CE }, -{ 0xC0CF, 0xC0CF, 0xC0CF }, -{ 0xC0D0, 0xC0D0, 0xC0D0 }, -{ 0xC0D1, 0xC0D1, 0xC0D1 }, -{ 0xC0D2, 0xC0D2, 0xC0D2 }, -{ 0xC0D3, 0xC0D3, 0xC0D3 }, -{ 0xC0D4, 0xC0D4, 0xC0D4 }, -{ 0xC0D5, 0xC0D5, 0xC0D5 }, -{ 0xC0D6, 0xC0D6, 0xC0D6 }, -{ 0xC0D7, 0xC0D7, 0xC0D7 }, -{ 0xC0D8, 0xC0D8, 0xC0D8 }, -{ 0xC0D9, 0xC0D9, 0xC0D9 }, -{ 0xC0DA, 0xC0DA, 0xC0DA }, -{ 0xC0DB, 0xC0DB, 0xC0DB }, -{ 0xC0DC, 0xC0DC, 0xC0DC }, -{ 0xC0DD, 0xC0DD, 0xC0DD }, -{ 0xC0DE, 0xC0DE, 0xC0DE }, -{ 0xC0DF, 0xC0DF, 0xC0DF }, -{ 0xC0E0, 0xC0E0, 0xC0E0 }, -{ 0xC0E1, 0xC0E1, 0xC0E1 }, -{ 0xC0E2, 0xC0E2, 0xC0E2 }, -{ 0xC0E3, 0xC0E3, 0xC0E3 }, -{ 0xC0E4, 0xC0E4, 0xC0E4 }, -{ 0xC0E5, 0xC0E5, 0xC0E5 }, -{ 0xC0E6, 0xC0E6, 0xC0E6 }, -{ 0xC0E7, 0xC0E7, 0xC0E7 }, -{ 0xC0E8, 0xC0E8, 0xC0E8 }, -{ 0xC0E9, 0xC0E9, 0xC0E9 }, -{ 0xC0EA, 0xC0EA, 0xC0EA }, -{ 0xC0EB, 0xC0EB, 0xC0EB }, -{ 0xC0EC, 0xC0EC, 0xC0EC }, -{ 0xC0ED, 0xC0ED, 0xC0ED }, -{ 0xC0EE, 0xC0EE, 0xC0EE }, -{ 0xC0EF, 0xC0EF, 0xC0EF }, -{ 0xC0F0, 0xC0F0, 0xC0F0 }, -{ 0xC0F1, 0xC0F1, 0xC0F1 }, -{ 0xC0F2, 0xC0F2, 0xC0F2 }, -{ 0xC0F3, 0xC0F3, 0xC0F3 }, -{ 0xC0F4, 0xC0F4, 0xC0F4 }, -{ 0xC0F5, 0xC0F5, 0xC0F5 }, -{ 0xC0F6, 0xC0F6, 0xC0F6 }, -{ 0xC0F7, 0xC0F7, 0xC0F7 }, -{ 0xC0F8, 0xC0F8, 0xC0F8 }, -{ 0xC0F9, 0xC0F9, 0xC0F9 }, -{ 0xC0FA, 0xC0FA, 0xC0FA }, -{ 0xC0FB, 0xC0FB, 0xC0FB }, -{ 0xC0FC, 0xC0FC, 0xC0FC }, -{ 0xC0FD, 0xC0FD, 0xC0FD }, -{ 0xC0FE, 0xC0FE, 0xC0FE }, -{ 0xC0FF, 0xC0FF, 0xC0FF }, -{ 0xC100, 0xC100, 0xC100 }, -{ 0xC101, 0xC101, 0xC101 }, -{ 0xC102, 0xC102, 0xC102 }, -{ 0xC103, 0xC103, 0xC103 }, -{ 0xC104, 0xC104, 0xC104 }, -{ 0xC105, 0xC105, 0xC105 }, -{ 0xC106, 0xC106, 0xC106 }, -{ 0xC107, 0xC107, 0xC107 }, -{ 0xC108, 0xC108, 0xC108 }, -{ 0xC109, 0xC109, 0xC109 }, -{ 0xC10A, 0xC10A, 0xC10A }, -{ 0xC10B, 0xC10B, 0xC10B }, -{ 0xC10C, 0xC10C, 0xC10C }, -{ 0xC10D, 0xC10D, 0xC10D }, -{ 0xC10E, 0xC10E, 0xC10E }, -{ 0xC10F, 0xC10F, 0xC10F }, -{ 0xC110, 0xC110, 0xC110 }, -{ 0xC111, 0xC111, 0xC111 }, -{ 0xC112, 0xC112, 0xC112 }, -{ 0xC113, 0xC113, 0xC113 }, -{ 0xC114, 0xC114, 0xC114 }, -{ 0xC115, 0xC115, 0xC115 }, -{ 0xC116, 0xC116, 0xC116 }, -{ 0xC117, 0xC117, 0xC117 }, -{ 0xC118, 0xC118, 0xC118 }, -{ 0xC119, 0xC119, 0xC119 }, -{ 0xC11A, 0xC11A, 0xC11A }, -{ 0xC11B, 0xC11B, 0xC11B }, -{ 0xC11C, 0xC11C, 0xC11C }, -{ 0xC11D, 0xC11D, 0xC11D }, -{ 0xC11E, 0xC11E, 0xC11E }, -{ 0xC11F, 0xC11F, 0xC11F }, -{ 0xC120, 0xC120, 0xC120 }, -{ 0xC121, 0xC121, 0xC121 }, -{ 0xC122, 0xC122, 0xC122 }, -{ 0xC123, 0xC123, 0xC123 }, -{ 0xC124, 0xC124, 0xC124 }, -{ 0xC125, 0xC125, 0xC125 }, -{ 0xC126, 0xC126, 0xC126 }, -{ 0xC127, 0xC127, 0xC127 }, -{ 0xC128, 0xC128, 0xC128 }, -{ 0xC129, 0xC129, 0xC129 }, -{ 0xC12A, 0xC12A, 0xC12A }, -{ 0xC12B, 0xC12B, 0xC12B }, -{ 0xC12C, 0xC12C, 0xC12C }, -{ 0xC12D, 0xC12D, 0xC12D }, -{ 0xC12E, 0xC12E, 0xC12E }, -{ 0xC12F, 0xC12F, 0xC12F }, -{ 0xC130, 0xC130, 0xC130 }, -{ 0xC131, 0xC131, 0xC131 }, -{ 0xC132, 0xC132, 0xC132 }, -{ 0xC133, 0xC133, 0xC133 }, -{ 0xC134, 0xC134, 0xC134 }, -{ 0xC135, 0xC135, 0xC135 }, -{ 0xC136, 0xC136, 0xC136 }, -{ 0xC137, 0xC137, 0xC137 }, -{ 0xC138, 0xC138, 0xC138 }, -{ 0xC139, 0xC139, 0xC139 }, -{ 0xC13A, 0xC13A, 0xC13A }, -{ 0xC13B, 0xC13B, 0xC13B }, -{ 0xC13C, 0xC13C, 0xC13C }, -{ 0xC13D, 0xC13D, 0xC13D }, -{ 0xC13E, 0xC13E, 0xC13E }, -{ 0xC13F, 0xC13F, 0xC13F }, -{ 0xC140, 0xC140, 0xC140 }, -{ 0xC141, 0xC141, 0xC141 }, -{ 0xC142, 0xC142, 0xC142 }, -{ 0xC143, 0xC143, 0xC143 }, -{ 0xC144, 0xC144, 0xC144 }, -{ 0xC145, 0xC145, 0xC145 }, -{ 0xC146, 0xC146, 0xC146 }, -{ 0xC147, 0xC147, 0xC147 }, -{ 0xC148, 0xC148, 0xC148 }, -{ 0xC149, 0xC149, 0xC149 }, -{ 0xC14A, 0xC14A, 0xC14A }, -{ 0xC14B, 0xC14B, 0xC14B }, -{ 0xC14C, 0xC14C, 0xC14C }, -{ 0xC14D, 0xC14D, 0xC14D }, -{ 0xC14E, 0xC14E, 0xC14E }, -{ 0xC14F, 0xC14F, 0xC14F }, -{ 0xC150, 0xC150, 0xC150 }, -{ 0xC151, 0xC151, 0xC151 }, -{ 0xC152, 0xC152, 0xC152 }, -{ 0xC153, 0xC153, 0xC153 }, -{ 0xC154, 0xC154, 0xC154 }, -{ 0xC155, 0xC155, 0xC155 }, -{ 0xC156, 0xC156, 0xC156 }, -{ 0xC157, 0xC157, 0xC157 }, -{ 0xC158, 0xC158, 0xC158 }, -{ 0xC159, 0xC159, 0xC159 }, -{ 0xC15A, 0xC15A, 0xC15A }, -{ 0xC15B, 0xC15B, 0xC15B }, -{ 0xC15C, 0xC15C, 0xC15C }, -{ 0xC15D, 0xC15D, 0xC15D }, -{ 0xC15E, 0xC15E, 0xC15E }, -{ 0xC15F, 0xC15F, 0xC15F }, -{ 0xC160, 0xC160, 0xC160 }, -{ 0xC161, 0xC161, 0xC161 }, -{ 0xC162, 0xC162, 0xC162 }, -{ 0xC163, 0xC163, 0xC163 }, -{ 0xC164, 0xC164, 0xC164 }, -{ 0xC165, 0xC165, 0xC165 }, -{ 0xC166, 0xC166, 0xC166 }, -{ 0xC167, 0xC167, 0xC167 }, -{ 0xC168, 0xC168, 0xC168 }, -{ 0xC169, 0xC169, 0xC169 }, -{ 0xC16A, 0xC16A, 0xC16A }, -{ 0xC16B, 0xC16B, 0xC16B }, -{ 0xC16C, 0xC16C, 0xC16C }, -{ 0xC16D, 0xC16D, 0xC16D }, -{ 0xC16E, 0xC16E, 0xC16E }, -{ 0xC16F, 0xC16F, 0xC16F }, -{ 0xC170, 0xC170, 0xC170 }, -{ 0xC171, 0xC171, 0xC171 }, -{ 0xC172, 0xC172, 0xC172 }, -{ 0xC173, 0xC173, 0xC173 }, -{ 0xC174, 0xC174, 0xC174 }, -{ 0xC175, 0xC175, 0xC175 }, -{ 0xC176, 0xC176, 0xC176 }, -{ 0xC177, 0xC177, 0xC177 }, -{ 0xC178, 0xC178, 0xC178 }, -{ 0xC179, 0xC179, 0xC179 }, -{ 0xC17A, 0xC17A, 0xC17A }, -{ 0xC17B, 0xC17B, 0xC17B }, -{ 0xC17C, 0xC17C, 0xC17C }, -{ 0xC17D, 0xC17D, 0xC17D }, -{ 0xC17E, 0xC17E, 0xC17E }, -{ 0xC17F, 0xC17F, 0xC17F }, -{ 0xC180, 0xC180, 0xC180 }, -{ 0xC181, 0xC181, 0xC181 }, -{ 0xC182, 0xC182, 0xC182 }, -{ 0xC183, 0xC183, 0xC183 }, -{ 0xC184, 0xC184, 0xC184 }, -{ 0xC185, 0xC185, 0xC185 }, -{ 0xC186, 0xC186, 0xC186 }, -{ 0xC187, 0xC187, 0xC187 }, -{ 0xC188, 0xC188, 0xC188 }, -{ 0xC189, 0xC189, 0xC189 }, -{ 0xC18A, 0xC18A, 0xC18A }, -{ 0xC18B, 0xC18B, 0xC18B }, -{ 0xC18C, 0xC18C, 0xC18C }, -{ 0xC18D, 0xC18D, 0xC18D }, -{ 0xC18E, 0xC18E, 0xC18E }, -{ 0xC18F, 0xC18F, 0xC18F }, -{ 0xC190, 0xC190, 0xC190 }, -{ 0xC191, 0xC191, 0xC191 }, -{ 0xC192, 0xC192, 0xC192 }, -{ 0xC193, 0xC193, 0xC193 }, -{ 0xC194, 0xC194, 0xC194 }, -{ 0xC195, 0xC195, 0xC195 }, -{ 0xC196, 0xC196, 0xC196 }, -{ 0xC197, 0xC197, 0xC197 }, -{ 0xC198, 0xC198, 0xC198 }, -{ 0xC199, 0xC199, 0xC199 }, -{ 0xC19A, 0xC19A, 0xC19A }, -{ 0xC19B, 0xC19B, 0xC19B }, -{ 0xC19C, 0xC19C, 0xC19C }, -{ 0xC19D, 0xC19D, 0xC19D }, -{ 0xC19E, 0xC19E, 0xC19E }, -{ 0xC19F, 0xC19F, 0xC19F }, -{ 0xC1A0, 0xC1A0, 0xC1A0 }, -{ 0xC1A1, 0xC1A1, 0xC1A1 }, -{ 0xC1A2, 0xC1A2, 0xC1A2 }, -{ 0xC1A3, 0xC1A3, 0xC1A3 }, -{ 0xC1A4, 0xC1A4, 0xC1A4 }, -{ 0xC1A5, 0xC1A5, 0xC1A5 }, -{ 0xC1A6, 0xC1A6, 0xC1A6 }, -{ 0xC1A7, 0xC1A7, 0xC1A7 }, -{ 0xC1A8, 0xC1A8, 0xC1A8 }, -{ 0xC1A9, 0xC1A9, 0xC1A9 }, -{ 0xC1AA, 0xC1AA, 0xC1AA }, -{ 0xC1AB, 0xC1AB, 0xC1AB }, -{ 0xC1AC, 0xC1AC, 0xC1AC }, -{ 0xC1AD, 0xC1AD, 0xC1AD }, -{ 0xC1AE, 0xC1AE, 0xC1AE }, -{ 0xC1AF, 0xC1AF, 0xC1AF }, -{ 0xC1B0, 0xC1B0, 0xC1B0 }, -{ 0xC1B1, 0xC1B1, 0xC1B1 }, -{ 0xC1B2, 0xC1B2, 0xC1B2 }, -{ 0xC1B3, 0xC1B3, 0xC1B3 }, -{ 0xC1B4, 0xC1B4, 0xC1B4 }, -{ 0xC1B5, 0xC1B5, 0xC1B5 }, -{ 0xC1B6, 0xC1B6, 0xC1B6 }, -{ 0xC1B7, 0xC1B7, 0xC1B7 }, -{ 0xC1B8, 0xC1B8, 0xC1B8 }, -{ 0xC1B9, 0xC1B9, 0xC1B9 }, -{ 0xC1BA, 0xC1BA, 0xC1BA }, -{ 0xC1BB, 0xC1BB, 0xC1BB }, -{ 0xC1BC, 0xC1BC, 0xC1BC }, -{ 0xC1BD, 0xC1BD, 0xC1BD }, -{ 0xC1BE, 0xC1BE, 0xC1BE }, -{ 0xC1BF, 0xC1BF, 0xC1BF }, -{ 0xC1C0, 0xC1C0, 0xC1C0 }, -{ 0xC1C1, 0xC1C1, 0xC1C1 }, -{ 0xC1C2, 0xC1C2, 0xC1C2 }, -{ 0xC1C3, 0xC1C3, 0xC1C3 }, -{ 0xC1C4, 0xC1C4, 0xC1C4 }, -{ 0xC1C5, 0xC1C5, 0xC1C5 }, -{ 0xC1C6, 0xC1C6, 0xC1C6 }, -{ 0xC1C7, 0xC1C7, 0xC1C7 }, -{ 0xC1C8, 0xC1C8, 0xC1C8 }, -{ 0xC1C9, 0xC1C9, 0xC1C9 }, -{ 0xC1CA, 0xC1CA, 0xC1CA }, -{ 0xC1CB, 0xC1CB, 0xC1CB }, -{ 0xC1CC, 0xC1CC, 0xC1CC }, -{ 0xC1CD, 0xC1CD, 0xC1CD }, -{ 0xC1CE, 0xC1CE, 0xC1CE }, -{ 0xC1CF, 0xC1CF, 0xC1CF }, -{ 0xC1D0, 0xC1D0, 0xC1D0 }, -{ 0xC1D1, 0xC1D1, 0xC1D1 }, -{ 0xC1D2, 0xC1D2, 0xC1D2 }, -{ 0xC1D3, 0xC1D3, 0xC1D3 }, -{ 0xC1D4, 0xC1D4, 0xC1D4 }, -{ 0xC1D5, 0xC1D5, 0xC1D5 }, -{ 0xC1D6, 0xC1D6, 0xC1D6 }, -{ 0xC1D7, 0xC1D7, 0xC1D7 }, -{ 0xC1D8, 0xC1D8, 0xC1D8 }, -{ 0xC1D9, 0xC1D9, 0xC1D9 }, -{ 0xC1DA, 0xC1DA, 0xC1DA }, -{ 0xC1DB, 0xC1DB, 0xC1DB }, -{ 0xC1DC, 0xC1DC, 0xC1DC }, -{ 0xC1DD, 0xC1DD, 0xC1DD }, -{ 0xC1DE, 0xC1DE, 0xC1DE }, -{ 0xC1DF, 0xC1DF, 0xC1DF }, -{ 0xC1E0, 0xC1E0, 0xC1E0 }, -{ 0xC1E1, 0xC1E1, 0xC1E1 }, -{ 0xC1E2, 0xC1E2, 0xC1E2 }, -{ 0xC1E3, 0xC1E3, 0xC1E3 }, -{ 0xC1E4, 0xC1E4, 0xC1E4 }, -{ 0xC1E5, 0xC1E5, 0xC1E5 }, -{ 0xC1E6, 0xC1E6, 0xC1E6 }, -{ 0xC1E7, 0xC1E7, 0xC1E7 }, -{ 0xC1E8, 0xC1E8, 0xC1E8 }, -{ 0xC1E9, 0xC1E9, 0xC1E9 }, -{ 0xC1EA, 0xC1EA, 0xC1EA }, -{ 0xC1EB, 0xC1EB, 0xC1EB }, -{ 0xC1EC, 0xC1EC, 0xC1EC }, -{ 0xC1ED, 0xC1ED, 0xC1ED }, -{ 0xC1EE, 0xC1EE, 0xC1EE }, -{ 0xC1EF, 0xC1EF, 0xC1EF }, -{ 0xC1F0, 0xC1F0, 0xC1F0 }, -{ 0xC1F1, 0xC1F1, 0xC1F1 }, -{ 0xC1F2, 0xC1F2, 0xC1F2 }, -{ 0xC1F3, 0xC1F3, 0xC1F3 }, -{ 0xC1F4, 0xC1F4, 0xC1F4 }, -{ 0xC1F5, 0xC1F5, 0xC1F5 }, -{ 0xC1F6, 0xC1F6, 0xC1F6 }, -{ 0xC1F7, 0xC1F7, 0xC1F7 }, -{ 0xC1F8, 0xC1F8, 0xC1F8 }, -{ 0xC1F9, 0xC1F9, 0xC1F9 }, -{ 0xC1FA, 0xC1FA, 0xC1FA }, -{ 0xC1FB, 0xC1FB, 0xC1FB }, -{ 0xC1FC, 0xC1FC, 0xC1FC }, -{ 0xC1FD, 0xC1FD, 0xC1FD }, -{ 0xC1FE, 0xC1FE, 0xC1FE }, -{ 0xC1FF, 0xC1FF, 0xC1FF }, -{ 0xC200, 0xC200, 0xC200 }, -{ 0xC201, 0xC201, 0xC201 }, -{ 0xC202, 0xC202, 0xC202 }, -{ 0xC203, 0xC203, 0xC203 }, -{ 0xC204, 0xC204, 0xC204 }, -{ 0xC205, 0xC205, 0xC205 }, -{ 0xC206, 0xC206, 0xC206 }, -{ 0xC207, 0xC207, 0xC207 }, -{ 0xC208, 0xC208, 0xC208 }, -{ 0xC209, 0xC209, 0xC209 }, -{ 0xC20A, 0xC20A, 0xC20A }, -{ 0xC20B, 0xC20B, 0xC20B }, -{ 0xC20C, 0xC20C, 0xC20C }, -{ 0xC20D, 0xC20D, 0xC20D }, -{ 0xC20E, 0xC20E, 0xC20E }, -{ 0xC20F, 0xC20F, 0xC20F }, -{ 0xC210, 0xC210, 0xC210 }, -{ 0xC211, 0xC211, 0xC211 }, -{ 0xC212, 0xC212, 0xC212 }, -{ 0xC213, 0xC213, 0xC213 }, -{ 0xC214, 0xC214, 0xC214 }, -{ 0xC215, 0xC215, 0xC215 }, -{ 0xC216, 0xC216, 0xC216 }, -{ 0xC217, 0xC217, 0xC217 }, -{ 0xC218, 0xC218, 0xC218 }, -{ 0xC219, 0xC219, 0xC219 }, -{ 0xC21A, 0xC21A, 0xC21A }, -{ 0xC21B, 0xC21B, 0xC21B }, -{ 0xC21C, 0xC21C, 0xC21C }, -{ 0xC21D, 0xC21D, 0xC21D }, -{ 0xC21E, 0xC21E, 0xC21E }, -{ 0xC21F, 0xC21F, 0xC21F }, -{ 0xC220, 0xC220, 0xC220 }, -{ 0xC221, 0xC221, 0xC221 }, -{ 0xC222, 0xC222, 0xC222 }, -{ 0xC223, 0xC223, 0xC223 }, -{ 0xC224, 0xC224, 0xC224 }, -{ 0xC225, 0xC225, 0xC225 }, -{ 0xC226, 0xC226, 0xC226 }, -{ 0xC227, 0xC227, 0xC227 }, -{ 0xC228, 0xC228, 0xC228 }, -{ 0xC229, 0xC229, 0xC229 }, -{ 0xC22A, 0xC22A, 0xC22A }, -{ 0xC22B, 0xC22B, 0xC22B }, -{ 0xC22C, 0xC22C, 0xC22C }, -{ 0xC22D, 0xC22D, 0xC22D }, -{ 0xC22E, 0xC22E, 0xC22E }, -{ 0xC22F, 0xC22F, 0xC22F }, -{ 0xC230, 0xC230, 0xC230 }, -{ 0xC231, 0xC231, 0xC231 }, -{ 0xC232, 0xC232, 0xC232 }, -{ 0xC233, 0xC233, 0xC233 }, -{ 0xC234, 0xC234, 0xC234 }, -{ 0xC235, 0xC235, 0xC235 }, -{ 0xC236, 0xC236, 0xC236 }, -{ 0xC237, 0xC237, 0xC237 }, -{ 0xC238, 0xC238, 0xC238 }, -{ 0xC239, 0xC239, 0xC239 }, -{ 0xC23A, 0xC23A, 0xC23A }, -{ 0xC23B, 0xC23B, 0xC23B }, -{ 0xC23C, 0xC23C, 0xC23C }, -{ 0xC23D, 0xC23D, 0xC23D }, -{ 0xC23E, 0xC23E, 0xC23E }, -{ 0xC23F, 0xC23F, 0xC23F }, -{ 0xC240, 0xC240, 0xC240 }, -{ 0xC241, 0xC241, 0xC241 }, -{ 0xC242, 0xC242, 0xC242 }, -{ 0xC243, 0xC243, 0xC243 }, -{ 0xC244, 0xC244, 0xC244 }, -{ 0xC245, 0xC245, 0xC245 }, -{ 0xC246, 0xC246, 0xC246 }, -{ 0xC247, 0xC247, 0xC247 }, -{ 0xC248, 0xC248, 0xC248 }, -{ 0xC249, 0xC249, 0xC249 }, -{ 0xC24A, 0xC24A, 0xC24A }, -{ 0xC24B, 0xC24B, 0xC24B }, -{ 0xC24C, 0xC24C, 0xC24C }, -{ 0xC24D, 0xC24D, 0xC24D }, -{ 0xC24E, 0xC24E, 0xC24E }, -{ 0xC24F, 0xC24F, 0xC24F }, -{ 0xC250, 0xC250, 0xC250 }, -{ 0xC251, 0xC251, 0xC251 }, -{ 0xC252, 0xC252, 0xC252 }, -{ 0xC253, 0xC253, 0xC253 }, -{ 0xC254, 0xC254, 0xC254 }, -{ 0xC255, 0xC255, 0xC255 }, -{ 0xC256, 0xC256, 0xC256 }, -{ 0xC257, 0xC257, 0xC257 }, -{ 0xC258, 0xC258, 0xC258 }, -{ 0xC259, 0xC259, 0xC259 }, -{ 0xC25A, 0xC25A, 0xC25A }, -{ 0xC25B, 0xC25B, 0xC25B }, -{ 0xC25C, 0xC25C, 0xC25C }, -{ 0xC25D, 0xC25D, 0xC25D }, -{ 0xC25E, 0xC25E, 0xC25E }, -{ 0xC25F, 0xC25F, 0xC25F }, -{ 0xC260, 0xC260, 0xC260 }, -{ 0xC261, 0xC261, 0xC261 }, -{ 0xC262, 0xC262, 0xC262 }, -{ 0xC263, 0xC263, 0xC263 }, -{ 0xC264, 0xC264, 0xC264 }, -{ 0xC265, 0xC265, 0xC265 }, -{ 0xC266, 0xC266, 0xC266 }, -{ 0xC267, 0xC267, 0xC267 }, -{ 0xC268, 0xC268, 0xC268 }, -{ 0xC269, 0xC269, 0xC269 }, -{ 0xC26A, 0xC26A, 0xC26A }, -{ 0xC26B, 0xC26B, 0xC26B }, -{ 0xC26C, 0xC26C, 0xC26C }, -{ 0xC26D, 0xC26D, 0xC26D }, -{ 0xC26E, 0xC26E, 0xC26E }, -{ 0xC26F, 0xC26F, 0xC26F }, -{ 0xC270, 0xC270, 0xC270 }, -{ 0xC271, 0xC271, 0xC271 }, -{ 0xC272, 0xC272, 0xC272 }, -{ 0xC273, 0xC273, 0xC273 }, -{ 0xC274, 0xC274, 0xC274 }, -{ 0xC275, 0xC275, 0xC275 }, -{ 0xC276, 0xC276, 0xC276 }, -{ 0xC277, 0xC277, 0xC277 }, -{ 0xC278, 0xC278, 0xC278 }, -{ 0xC279, 0xC279, 0xC279 }, -{ 0xC27A, 0xC27A, 0xC27A }, -{ 0xC27B, 0xC27B, 0xC27B }, -{ 0xC27C, 0xC27C, 0xC27C }, -{ 0xC27D, 0xC27D, 0xC27D }, -{ 0xC27E, 0xC27E, 0xC27E }, -{ 0xC27F, 0xC27F, 0xC27F }, -{ 0xC280, 0xC280, 0xC280 }, -{ 0xC281, 0xC281, 0xC281 }, -{ 0xC282, 0xC282, 0xC282 }, -{ 0xC283, 0xC283, 0xC283 }, -{ 0xC284, 0xC284, 0xC284 }, -{ 0xC285, 0xC285, 0xC285 }, -{ 0xC286, 0xC286, 0xC286 }, -{ 0xC287, 0xC287, 0xC287 }, -{ 0xC288, 0xC288, 0xC288 }, -{ 0xC289, 0xC289, 0xC289 }, -{ 0xC28A, 0xC28A, 0xC28A }, -{ 0xC28B, 0xC28B, 0xC28B }, -{ 0xC28C, 0xC28C, 0xC28C }, -{ 0xC28D, 0xC28D, 0xC28D }, -{ 0xC28E, 0xC28E, 0xC28E }, -{ 0xC28F, 0xC28F, 0xC28F }, -{ 0xC290, 0xC290, 0xC290 }, -{ 0xC291, 0xC291, 0xC291 }, -{ 0xC292, 0xC292, 0xC292 }, -{ 0xC293, 0xC293, 0xC293 }, -{ 0xC294, 0xC294, 0xC294 }, -{ 0xC295, 0xC295, 0xC295 }, -{ 0xC296, 0xC296, 0xC296 }, -{ 0xC297, 0xC297, 0xC297 }, -{ 0xC298, 0xC298, 0xC298 }, -{ 0xC299, 0xC299, 0xC299 }, -{ 0xC29A, 0xC29A, 0xC29A }, -{ 0xC29B, 0xC29B, 0xC29B }, -{ 0xC29C, 0xC29C, 0xC29C }, -{ 0xC29D, 0xC29D, 0xC29D }, -{ 0xC29E, 0xC29E, 0xC29E }, -{ 0xC29F, 0xC29F, 0xC29F }, -{ 0xC2A0, 0xC2A0, 0xC2A0 }, -{ 0xC2A1, 0xC2A1, 0xC2A1 }, -{ 0xC2A2, 0xC2A2, 0xC2A2 }, -{ 0xC2A3, 0xC2A3, 0xC2A3 }, -{ 0xC2A4, 0xC2A4, 0xC2A4 }, -{ 0xC2A5, 0xC2A5, 0xC2A5 }, -{ 0xC2A6, 0xC2A6, 0xC2A6 }, -{ 0xC2A7, 0xC2A7, 0xC2A7 }, -{ 0xC2A8, 0xC2A8, 0xC2A8 }, -{ 0xC2A9, 0xC2A9, 0xC2A9 }, -{ 0xC2AA, 0xC2AA, 0xC2AA }, -{ 0xC2AB, 0xC2AB, 0xC2AB }, -{ 0xC2AC, 0xC2AC, 0xC2AC }, -{ 0xC2AD, 0xC2AD, 0xC2AD }, -{ 0xC2AE, 0xC2AE, 0xC2AE }, -{ 0xC2AF, 0xC2AF, 0xC2AF }, -{ 0xC2B0, 0xC2B0, 0xC2B0 }, -{ 0xC2B1, 0xC2B1, 0xC2B1 }, -{ 0xC2B2, 0xC2B2, 0xC2B2 }, -{ 0xC2B3, 0xC2B3, 0xC2B3 }, -{ 0xC2B4, 0xC2B4, 0xC2B4 }, -{ 0xC2B5, 0xC2B5, 0xC2B5 }, -{ 0xC2B6, 0xC2B6, 0xC2B6 }, -{ 0xC2B7, 0xC2B7, 0xC2B7 }, -{ 0xC2B8, 0xC2B8, 0xC2B8 }, -{ 0xC2B9, 0xC2B9, 0xC2B9 }, -{ 0xC2BA, 0xC2BA, 0xC2BA }, -{ 0xC2BB, 0xC2BB, 0xC2BB }, -{ 0xC2BC, 0xC2BC, 0xC2BC }, -{ 0xC2BD, 0xC2BD, 0xC2BD }, -{ 0xC2BE, 0xC2BE, 0xC2BE }, -{ 0xC2BF, 0xC2BF, 0xC2BF }, -{ 0xC2C0, 0xC2C0, 0xC2C0 }, -{ 0xC2C1, 0xC2C1, 0xC2C1 }, -{ 0xC2C2, 0xC2C2, 0xC2C2 }, -{ 0xC2C3, 0xC2C3, 0xC2C3 }, -{ 0xC2C4, 0xC2C4, 0xC2C4 }, -{ 0xC2C5, 0xC2C5, 0xC2C5 }, -{ 0xC2C6, 0xC2C6, 0xC2C6 }, -{ 0xC2C7, 0xC2C7, 0xC2C7 }, -{ 0xC2C8, 0xC2C8, 0xC2C8 }, -{ 0xC2C9, 0xC2C9, 0xC2C9 }, -{ 0xC2CA, 0xC2CA, 0xC2CA }, -{ 0xC2CB, 0xC2CB, 0xC2CB }, -{ 0xC2CC, 0xC2CC, 0xC2CC }, -{ 0xC2CD, 0xC2CD, 0xC2CD }, -{ 0xC2CE, 0xC2CE, 0xC2CE }, -{ 0xC2CF, 0xC2CF, 0xC2CF }, -{ 0xC2D0, 0xC2D0, 0xC2D0 }, -{ 0xC2D1, 0xC2D1, 0xC2D1 }, -{ 0xC2D2, 0xC2D2, 0xC2D2 }, -{ 0xC2D3, 0xC2D3, 0xC2D3 }, -{ 0xC2D4, 0xC2D4, 0xC2D4 }, -{ 0xC2D5, 0xC2D5, 0xC2D5 }, -{ 0xC2D6, 0xC2D6, 0xC2D6 }, -{ 0xC2D7, 0xC2D7, 0xC2D7 }, -{ 0xC2D8, 0xC2D8, 0xC2D8 }, -{ 0xC2D9, 0xC2D9, 0xC2D9 }, -{ 0xC2DA, 0xC2DA, 0xC2DA }, -{ 0xC2DB, 0xC2DB, 0xC2DB }, -{ 0xC2DC, 0xC2DC, 0xC2DC }, -{ 0xC2DD, 0xC2DD, 0xC2DD }, -{ 0xC2DE, 0xC2DE, 0xC2DE }, -{ 0xC2DF, 0xC2DF, 0xC2DF }, -{ 0xC2E0, 0xC2E0, 0xC2E0 }, -{ 0xC2E1, 0xC2E1, 0xC2E1 }, -{ 0xC2E2, 0xC2E2, 0xC2E2 }, -{ 0xC2E3, 0xC2E3, 0xC2E3 }, -{ 0xC2E4, 0xC2E4, 0xC2E4 }, -{ 0xC2E5, 0xC2E5, 0xC2E5 }, -{ 0xC2E6, 0xC2E6, 0xC2E6 }, -{ 0xC2E7, 0xC2E7, 0xC2E7 }, -{ 0xC2E8, 0xC2E8, 0xC2E8 }, -{ 0xC2E9, 0xC2E9, 0xC2E9 }, -{ 0xC2EA, 0xC2EA, 0xC2EA }, -{ 0xC2EB, 0xC2EB, 0xC2EB }, -{ 0xC2EC, 0xC2EC, 0xC2EC }, -{ 0xC2ED, 0xC2ED, 0xC2ED }, -{ 0xC2EE, 0xC2EE, 0xC2EE }, -{ 0xC2EF, 0xC2EF, 0xC2EF }, -{ 0xC2F0, 0xC2F0, 0xC2F0 }, -{ 0xC2F1, 0xC2F1, 0xC2F1 }, -{ 0xC2F2, 0xC2F2, 0xC2F2 }, -{ 0xC2F3, 0xC2F3, 0xC2F3 }, -{ 0xC2F4, 0xC2F4, 0xC2F4 }, -{ 0xC2F5, 0xC2F5, 0xC2F5 }, -{ 0xC2F6, 0xC2F6, 0xC2F6 }, -{ 0xC2F7, 0xC2F7, 0xC2F7 }, -{ 0xC2F8, 0xC2F8, 0xC2F8 }, -{ 0xC2F9, 0xC2F9, 0xC2F9 }, -{ 0xC2FA, 0xC2FA, 0xC2FA }, -{ 0xC2FB, 0xC2FB, 0xC2FB }, -{ 0xC2FC, 0xC2FC, 0xC2FC }, -{ 0xC2FD, 0xC2FD, 0xC2FD }, -{ 0xC2FE, 0xC2FE, 0xC2FE }, -{ 0xC2FF, 0xC2FF, 0xC2FF }, -{ 0xC300, 0xC300, 0xC300 }, -{ 0xC301, 0xC301, 0xC301 }, -{ 0xC302, 0xC302, 0xC302 }, -{ 0xC303, 0xC303, 0xC303 }, -{ 0xC304, 0xC304, 0xC304 }, -{ 0xC305, 0xC305, 0xC305 }, -{ 0xC306, 0xC306, 0xC306 }, -{ 0xC307, 0xC307, 0xC307 }, -{ 0xC308, 0xC308, 0xC308 }, -{ 0xC309, 0xC309, 0xC309 }, -{ 0xC30A, 0xC30A, 0xC30A }, -{ 0xC30B, 0xC30B, 0xC30B }, -{ 0xC30C, 0xC30C, 0xC30C }, -{ 0xC30D, 0xC30D, 0xC30D }, -{ 0xC30E, 0xC30E, 0xC30E }, -{ 0xC30F, 0xC30F, 0xC30F }, -{ 0xC310, 0xC310, 0xC310 }, -{ 0xC311, 0xC311, 0xC311 }, -{ 0xC312, 0xC312, 0xC312 }, -{ 0xC313, 0xC313, 0xC313 }, -{ 0xC314, 0xC314, 0xC314 }, -{ 0xC315, 0xC315, 0xC315 }, -{ 0xC316, 0xC316, 0xC316 }, -{ 0xC317, 0xC317, 0xC317 }, -{ 0xC318, 0xC318, 0xC318 }, -{ 0xC319, 0xC319, 0xC319 }, -{ 0xC31A, 0xC31A, 0xC31A }, -{ 0xC31B, 0xC31B, 0xC31B }, -{ 0xC31C, 0xC31C, 0xC31C }, -{ 0xC31D, 0xC31D, 0xC31D }, -{ 0xC31E, 0xC31E, 0xC31E }, -{ 0xC31F, 0xC31F, 0xC31F }, -{ 0xC320, 0xC320, 0xC320 }, -{ 0xC321, 0xC321, 0xC321 }, -{ 0xC322, 0xC322, 0xC322 }, -{ 0xC323, 0xC323, 0xC323 }, -{ 0xC324, 0xC324, 0xC324 }, -{ 0xC325, 0xC325, 0xC325 }, -{ 0xC326, 0xC326, 0xC326 }, -{ 0xC327, 0xC327, 0xC327 }, -{ 0xC328, 0xC328, 0xC328 }, -{ 0xC329, 0xC329, 0xC329 }, -{ 0xC32A, 0xC32A, 0xC32A }, -{ 0xC32B, 0xC32B, 0xC32B }, -{ 0xC32C, 0xC32C, 0xC32C }, -{ 0xC32D, 0xC32D, 0xC32D }, -{ 0xC32E, 0xC32E, 0xC32E }, -{ 0xC32F, 0xC32F, 0xC32F }, -{ 0xC330, 0xC330, 0xC330 }, -{ 0xC331, 0xC331, 0xC331 }, -{ 0xC332, 0xC332, 0xC332 }, -{ 0xC333, 0xC333, 0xC333 }, -{ 0xC334, 0xC334, 0xC334 }, -{ 0xC335, 0xC335, 0xC335 }, -{ 0xC336, 0xC336, 0xC336 }, -{ 0xC337, 0xC337, 0xC337 }, -{ 0xC338, 0xC338, 0xC338 }, -{ 0xC339, 0xC339, 0xC339 }, -{ 0xC33A, 0xC33A, 0xC33A }, -{ 0xC33B, 0xC33B, 0xC33B }, -{ 0xC33C, 0xC33C, 0xC33C }, -{ 0xC33D, 0xC33D, 0xC33D }, -{ 0xC33E, 0xC33E, 0xC33E }, -{ 0xC33F, 0xC33F, 0xC33F }, -{ 0xC340, 0xC340, 0xC340 }, -{ 0xC341, 0xC341, 0xC341 }, -{ 0xC342, 0xC342, 0xC342 }, -{ 0xC343, 0xC343, 0xC343 }, -{ 0xC344, 0xC344, 0xC344 }, -{ 0xC345, 0xC345, 0xC345 }, -{ 0xC346, 0xC346, 0xC346 }, -{ 0xC347, 0xC347, 0xC347 }, -{ 0xC348, 0xC348, 0xC348 }, -{ 0xC349, 0xC349, 0xC349 }, -{ 0xC34A, 0xC34A, 0xC34A }, -{ 0xC34B, 0xC34B, 0xC34B }, -{ 0xC34C, 0xC34C, 0xC34C }, -{ 0xC34D, 0xC34D, 0xC34D }, -{ 0xC34E, 0xC34E, 0xC34E }, -{ 0xC34F, 0xC34F, 0xC34F }, -{ 0xC350, 0xC350, 0xC350 }, -{ 0xC351, 0xC351, 0xC351 }, -{ 0xC352, 0xC352, 0xC352 }, -{ 0xC353, 0xC353, 0xC353 }, -{ 0xC354, 0xC354, 0xC354 }, -{ 0xC355, 0xC355, 0xC355 }, -{ 0xC356, 0xC356, 0xC356 }, -{ 0xC357, 0xC357, 0xC357 }, -{ 0xC358, 0xC358, 0xC358 }, -{ 0xC359, 0xC359, 0xC359 }, -{ 0xC35A, 0xC35A, 0xC35A }, -{ 0xC35B, 0xC35B, 0xC35B }, -{ 0xC35C, 0xC35C, 0xC35C }, -{ 0xC35D, 0xC35D, 0xC35D }, -{ 0xC35E, 0xC35E, 0xC35E }, -{ 0xC35F, 0xC35F, 0xC35F }, -{ 0xC360, 0xC360, 0xC360 }, -{ 0xC361, 0xC361, 0xC361 }, -{ 0xC362, 0xC362, 0xC362 }, -{ 0xC363, 0xC363, 0xC363 }, -{ 0xC364, 0xC364, 0xC364 }, -{ 0xC365, 0xC365, 0xC365 }, -{ 0xC366, 0xC366, 0xC366 }, -{ 0xC367, 0xC367, 0xC367 }, -{ 0xC368, 0xC368, 0xC368 }, -{ 0xC369, 0xC369, 0xC369 }, -{ 0xC36A, 0xC36A, 0xC36A }, -{ 0xC36B, 0xC36B, 0xC36B }, -{ 0xC36C, 0xC36C, 0xC36C }, -{ 0xC36D, 0xC36D, 0xC36D }, -{ 0xC36E, 0xC36E, 0xC36E }, -{ 0xC36F, 0xC36F, 0xC36F }, -{ 0xC370, 0xC370, 0xC370 }, -{ 0xC371, 0xC371, 0xC371 }, -{ 0xC372, 0xC372, 0xC372 }, -{ 0xC373, 0xC373, 0xC373 }, -{ 0xC374, 0xC374, 0xC374 }, -{ 0xC375, 0xC375, 0xC375 }, -{ 0xC376, 0xC376, 0xC376 }, -{ 0xC377, 0xC377, 0xC377 }, -{ 0xC378, 0xC378, 0xC378 }, -{ 0xC379, 0xC379, 0xC379 }, -{ 0xC37A, 0xC37A, 0xC37A }, -{ 0xC37B, 0xC37B, 0xC37B }, -{ 0xC37C, 0xC37C, 0xC37C }, -{ 0xC37D, 0xC37D, 0xC37D }, -{ 0xC37E, 0xC37E, 0xC37E }, -{ 0xC37F, 0xC37F, 0xC37F }, -{ 0xC380, 0xC380, 0xC380 }, -{ 0xC381, 0xC381, 0xC381 }, -{ 0xC382, 0xC382, 0xC382 }, -{ 0xC383, 0xC383, 0xC383 }, -{ 0xC384, 0xC384, 0xC384 }, -{ 0xC385, 0xC385, 0xC385 }, -{ 0xC386, 0xC386, 0xC386 }, -{ 0xC387, 0xC387, 0xC387 }, -{ 0xC388, 0xC388, 0xC388 }, -{ 0xC389, 0xC389, 0xC389 }, -{ 0xC38A, 0xC38A, 0xC38A }, -{ 0xC38B, 0xC38B, 0xC38B }, -{ 0xC38C, 0xC38C, 0xC38C }, -{ 0xC38D, 0xC38D, 0xC38D }, -{ 0xC38E, 0xC38E, 0xC38E }, -{ 0xC38F, 0xC38F, 0xC38F }, -{ 0xC390, 0xC390, 0xC390 }, -{ 0xC391, 0xC391, 0xC391 }, -{ 0xC392, 0xC392, 0xC392 }, -{ 0xC393, 0xC393, 0xC393 }, -{ 0xC394, 0xC394, 0xC394 }, -{ 0xC395, 0xC395, 0xC395 }, -{ 0xC396, 0xC396, 0xC396 }, -{ 0xC397, 0xC397, 0xC397 }, -{ 0xC398, 0xC398, 0xC398 }, -{ 0xC399, 0xC399, 0xC399 }, -{ 0xC39A, 0xC39A, 0xC39A }, -{ 0xC39B, 0xC39B, 0xC39B }, -{ 0xC39C, 0xC39C, 0xC39C }, -{ 0xC39D, 0xC39D, 0xC39D }, -{ 0xC39E, 0xC39E, 0xC39E }, -{ 0xC39F, 0xC39F, 0xC39F }, -{ 0xC3A0, 0xC3A0, 0xC3A0 }, -{ 0xC3A1, 0xC3A1, 0xC3A1 }, -{ 0xC3A2, 0xC3A2, 0xC3A2 }, -{ 0xC3A3, 0xC3A3, 0xC3A3 }, -{ 0xC3A4, 0xC3A4, 0xC3A4 }, -{ 0xC3A5, 0xC3A5, 0xC3A5 }, -{ 0xC3A6, 0xC3A6, 0xC3A6 }, -{ 0xC3A7, 0xC3A7, 0xC3A7 }, -{ 0xC3A8, 0xC3A8, 0xC3A8 }, -{ 0xC3A9, 0xC3A9, 0xC3A9 }, -{ 0xC3AA, 0xC3AA, 0xC3AA }, -{ 0xC3AB, 0xC3AB, 0xC3AB }, -{ 0xC3AC, 0xC3AC, 0xC3AC }, -{ 0xC3AD, 0xC3AD, 0xC3AD }, -{ 0xC3AE, 0xC3AE, 0xC3AE }, -{ 0xC3AF, 0xC3AF, 0xC3AF }, -{ 0xC3B0, 0xC3B0, 0xC3B0 }, -{ 0xC3B1, 0xC3B1, 0xC3B1 }, -{ 0xC3B2, 0xC3B2, 0xC3B2 }, -{ 0xC3B3, 0xC3B3, 0xC3B3 }, -{ 0xC3B4, 0xC3B4, 0xC3B4 }, -{ 0xC3B5, 0xC3B5, 0xC3B5 }, -{ 0xC3B6, 0xC3B6, 0xC3B6 }, -{ 0xC3B7, 0xC3B7, 0xC3B7 }, -{ 0xC3B8, 0xC3B8, 0xC3B8 }, -{ 0xC3B9, 0xC3B9, 0xC3B9 }, -{ 0xC3BA, 0xC3BA, 0xC3BA }, -{ 0xC3BB, 0xC3BB, 0xC3BB }, -{ 0xC3BC, 0xC3BC, 0xC3BC }, -{ 0xC3BD, 0xC3BD, 0xC3BD }, -{ 0xC3BE, 0xC3BE, 0xC3BE }, -{ 0xC3BF, 0xC3BF, 0xC3BF }, -{ 0xC3C0, 0xC3C0, 0xC3C0 }, -{ 0xC3C1, 0xC3C1, 0xC3C1 }, -{ 0xC3C2, 0xC3C2, 0xC3C2 }, -{ 0xC3C3, 0xC3C3, 0xC3C3 }, -{ 0xC3C4, 0xC3C4, 0xC3C4 }, -{ 0xC3C5, 0xC3C5, 0xC3C5 }, -{ 0xC3C6, 0xC3C6, 0xC3C6 }, -{ 0xC3C7, 0xC3C7, 0xC3C7 }, -{ 0xC3C8, 0xC3C8, 0xC3C8 }, -{ 0xC3C9, 0xC3C9, 0xC3C9 }, -{ 0xC3CA, 0xC3CA, 0xC3CA }, -{ 0xC3CB, 0xC3CB, 0xC3CB }, -{ 0xC3CC, 0xC3CC, 0xC3CC }, -{ 0xC3CD, 0xC3CD, 0xC3CD }, -{ 0xC3CE, 0xC3CE, 0xC3CE }, -{ 0xC3CF, 0xC3CF, 0xC3CF }, -{ 0xC3D0, 0xC3D0, 0xC3D0 }, -{ 0xC3D1, 0xC3D1, 0xC3D1 }, -{ 0xC3D2, 0xC3D2, 0xC3D2 }, -{ 0xC3D3, 0xC3D3, 0xC3D3 }, -{ 0xC3D4, 0xC3D4, 0xC3D4 }, -{ 0xC3D5, 0xC3D5, 0xC3D5 }, -{ 0xC3D6, 0xC3D6, 0xC3D6 }, -{ 0xC3D7, 0xC3D7, 0xC3D7 }, -{ 0xC3D8, 0xC3D8, 0xC3D8 }, -{ 0xC3D9, 0xC3D9, 0xC3D9 }, -{ 0xC3DA, 0xC3DA, 0xC3DA }, -{ 0xC3DB, 0xC3DB, 0xC3DB }, -{ 0xC3DC, 0xC3DC, 0xC3DC }, -{ 0xC3DD, 0xC3DD, 0xC3DD }, -{ 0xC3DE, 0xC3DE, 0xC3DE }, -{ 0xC3DF, 0xC3DF, 0xC3DF }, -{ 0xC3E0, 0xC3E0, 0xC3E0 }, -{ 0xC3E1, 0xC3E1, 0xC3E1 }, -{ 0xC3E2, 0xC3E2, 0xC3E2 }, -{ 0xC3E3, 0xC3E3, 0xC3E3 }, -{ 0xC3E4, 0xC3E4, 0xC3E4 }, -{ 0xC3E5, 0xC3E5, 0xC3E5 }, -{ 0xC3E6, 0xC3E6, 0xC3E6 }, -{ 0xC3E7, 0xC3E7, 0xC3E7 }, -{ 0xC3E8, 0xC3E8, 0xC3E8 }, -{ 0xC3E9, 0xC3E9, 0xC3E9 }, -{ 0xC3EA, 0xC3EA, 0xC3EA }, -{ 0xC3EB, 0xC3EB, 0xC3EB }, -{ 0xC3EC, 0xC3EC, 0xC3EC }, -{ 0xC3ED, 0xC3ED, 0xC3ED }, -{ 0xC3EE, 0xC3EE, 0xC3EE }, -{ 0xC3EF, 0xC3EF, 0xC3EF }, -{ 0xC3F0, 0xC3F0, 0xC3F0 }, -{ 0xC3F1, 0xC3F1, 0xC3F1 }, -{ 0xC3F2, 0xC3F2, 0xC3F2 }, -{ 0xC3F3, 0xC3F3, 0xC3F3 }, -{ 0xC3F4, 0xC3F4, 0xC3F4 }, -{ 0xC3F5, 0xC3F5, 0xC3F5 }, -{ 0xC3F6, 0xC3F6, 0xC3F6 }, -{ 0xC3F7, 0xC3F7, 0xC3F7 }, -{ 0xC3F8, 0xC3F8, 0xC3F8 }, -{ 0xC3F9, 0xC3F9, 0xC3F9 }, -{ 0xC3FA, 0xC3FA, 0xC3FA }, -{ 0xC3FB, 0xC3FB, 0xC3FB }, -{ 0xC3FC, 0xC3FC, 0xC3FC }, -{ 0xC3FD, 0xC3FD, 0xC3FD }, -{ 0xC3FE, 0xC3FE, 0xC3FE }, -{ 0xC3FF, 0xC3FF, 0xC3FF }, -{ 0xC400, 0xC400, 0xC400 }, -{ 0xC401, 0xC401, 0xC401 }, -{ 0xC402, 0xC402, 0xC402 }, -{ 0xC403, 0xC403, 0xC403 }, -{ 0xC404, 0xC404, 0xC404 }, -{ 0xC405, 0xC405, 0xC405 }, -{ 0xC406, 0xC406, 0xC406 }, -{ 0xC407, 0xC407, 0xC407 }, -{ 0xC408, 0xC408, 0xC408 }, -{ 0xC409, 0xC409, 0xC409 }, -{ 0xC40A, 0xC40A, 0xC40A }, -{ 0xC40B, 0xC40B, 0xC40B }, -{ 0xC40C, 0xC40C, 0xC40C }, -{ 0xC40D, 0xC40D, 0xC40D }, -{ 0xC40E, 0xC40E, 0xC40E }, -{ 0xC40F, 0xC40F, 0xC40F }, -{ 0xC410, 0xC410, 0xC410 }, -{ 0xC411, 0xC411, 0xC411 }, -{ 0xC412, 0xC412, 0xC412 }, -{ 0xC413, 0xC413, 0xC413 }, -{ 0xC414, 0xC414, 0xC414 }, -{ 0xC415, 0xC415, 0xC415 }, -{ 0xC416, 0xC416, 0xC416 }, -{ 0xC417, 0xC417, 0xC417 }, -{ 0xC418, 0xC418, 0xC418 }, -{ 0xC419, 0xC419, 0xC419 }, -{ 0xC41A, 0xC41A, 0xC41A }, -{ 0xC41B, 0xC41B, 0xC41B }, -{ 0xC41C, 0xC41C, 0xC41C }, -{ 0xC41D, 0xC41D, 0xC41D }, -{ 0xC41E, 0xC41E, 0xC41E }, -{ 0xC41F, 0xC41F, 0xC41F }, -{ 0xC420, 0xC420, 0xC420 }, -{ 0xC421, 0xC421, 0xC421 }, -{ 0xC422, 0xC422, 0xC422 }, -{ 0xC423, 0xC423, 0xC423 }, -{ 0xC424, 0xC424, 0xC424 }, -{ 0xC425, 0xC425, 0xC425 }, -{ 0xC426, 0xC426, 0xC426 }, -{ 0xC427, 0xC427, 0xC427 }, -{ 0xC428, 0xC428, 0xC428 }, -{ 0xC429, 0xC429, 0xC429 }, -{ 0xC42A, 0xC42A, 0xC42A }, -{ 0xC42B, 0xC42B, 0xC42B }, -{ 0xC42C, 0xC42C, 0xC42C }, -{ 0xC42D, 0xC42D, 0xC42D }, -{ 0xC42E, 0xC42E, 0xC42E }, -{ 0xC42F, 0xC42F, 0xC42F }, -{ 0xC430, 0xC430, 0xC430 }, -{ 0xC431, 0xC431, 0xC431 }, -{ 0xC432, 0xC432, 0xC432 }, -{ 0xC433, 0xC433, 0xC433 }, -{ 0xC434, 0xC434, 0xC434 }, -{ 0xC435, 0xC435, 0xC435 }, -{ 0xC436, 0xC436, 0xC436 }, -{ 0xC437, 0xC437, 0xC437 }, -{ 0xC438, 0xC438, 0xC438 }, -{ 0xC439, 0xC439, 0xC439 }, -{ 0xC43A, 0xC43A, 0xC43A }, -{ 0xC43B, 0xC43B, 0xC43B }, -{ 0xC43C, 0xC43C, 0xC43C }, -{ 0xC43D, 0xC43D, 0xC43D }, -{ 0xC43E, 0xC43E, 0xC43E }, -{ 0xC43F, 0xC43F, 0xC43F }, -{ 0xC440, 0xC440, 0xC440 }, -{ 0xC441, 0xC441, 0xC441 }, -{ 0xC442, 0xC442, 0xC442 }, -{ 0xC443, 0xC443, 0xC443 }, -{ 0xC444, 0xC444, 0xC444 }, -{ 0xC445, 0xC445, 0xC445 }, -{ 0xC446, 0xC446, 0xC446 }, -{ 0xC447, 0xC447, 0xC447 }, -{ 0xC448, 0xC448, 0xC448 }, -{ 0xC449, 0xC449, 0xC449 }, -{ 0xC44A, 0xC44A, 0xC44A }, -{ 0xC44B, 0xC44B, 0xC44B }, -{ 0xC44C, 0xC44C, 0xC44C }, -{ 0xC44D, 0xC44D, 0xC44D }, -{ 0xC44E, 0xC44E, 0xC44E }, -{ 0xC44F, 0xC44F, 0xC44F }, -{ 0xC450, 0xC450, 0xC450 }, -{ 0xC451, 0xC451, 0xC451 }, -{ 0xC452, 0xC452, 0xC452 }, -{ 0xC453, 0xC453, 0xC453 }, -{ 0xC454, 0xC454, 0xC454 }, -{ 0xC455, 0xC455, 0xC455 }, -{ 0xC456, 0xC456, 0xC456 }, -{ 0xC457, 0xC457, 0xC457 }, -{ 0xC458, 0xC458, 0xC458 }, -{ 0xC459, 0xC459, 0xC459 }, -{ 0xC45A, 0xC45A, 0xC45A }, -{ 0xC45B, 0xC45B, 0xC45B }, -{ 0xC45C, 0xC45C, 0xC45C }, -{ 0xC45D, 0xC45D, 0xC45D }, -{ 0xC45E, 0xC45E, 0xC45E }, -{ 0xC45F, 0xC45F, 0xC45F }, -{ 0xC460, 0xC460, 0xC460 }, -{ 0xC461, 0xC461, 0xC461 }, -{ 0xC462, 0xC462, 0xC462 }, -{ 0xC463, 0xC463, 0xC463 }, -{ 0xC464, 0xC464, 0xC464 }, -{ 0xC465, 0xC465, 0xC465 }, -{ 0xC466, 0xC466, 0xC466 }, -{ 0xC467, 0xC467, 0xC467 }, -{ 0xC468, 0xC468, 0xC468 }, -{ 0xC469, 0xC469, 0xC469 }, -{ 0xC46A, 0xC46A, 0xC46A }, -{ 0xC46B, 0xC46B, 0xC46B }, -{ 0xC46C, 0xC46C, 0xC46C }, -{ 0xC46D, 0xC46D, 0xC46D }, -{ 0xC46E, 0xC46E, 0xC46E }, -{ 0xC46F, 0xC46F, 0xC46F }, -{ 0xC470, 0xC470, 0xC470 }, -{ 0xC471, 0xC471, 0xC471 }, -{ 0xC472, 0xC472, 0xC472 }, -{ 0xC473, 0xC473, 0xC473 }, -{ 0xC474, 0xC474, 0xC474 }, -{ 0xC475, 0xC475, 0xC475 }, -{ 0xC476, 0xC476, 0xC476 }, -{ 0xC477, 0xC477, 0xC477 }, -{ 0xC478, 0xC478, 0xC478 }, -{ 0xC479, 0xC479, 0xC479 }, -{ 0xC47A, 0xC47A, 0xC47A }, -{ 0xC47B, 0xC47B, 0xC47B }, -{ 0xC47C, 0xC47C, 0xC47C }, -{ 0xC47D, 0xC47D, 0xC47D }, -{ 0xC47E, 0xC47E, 0xC47E }, -{ 0xC47F, 0xC47F, 0xC47F }, -{ 0xC480, 0xC480, 0xC480 }, -{ 0xC481, 0xC481, 0xC481 }, -{ 0xC482, 0xC482, 0xC482 }, -{ 0xC483, 0xC483, 0xC483 }, -{ 0xC484, 0xC484, 0xC484 }, -{ 0xC485, 0xC485, 0xC485 }, -{ 0xC486, 0xC486, 0xC486 }, -{ 0xC487, 0xC487, 0xC487 }, -{ 0xC488, 0xC488, 0xC488 }, -{ 0xC489, 0xC489, 0xC489 }, -{ 0xC48A, 0xC48A, 0xC48A }, -{ 0xC48B, 0xC48B, 0xC48B }, -{ 0xC48C, 0xC48C, 0xC48C }, -{ 0xC48D, 0xC48D, 0xC48D }, -{ 0xC48E, 0xC48E, 0xC48E }, -{ 0xC48F, 0xC48F, 0xC48F }, -{ 0xC490, 0xC490, 0xC490 }, -{ 0xC491, 0xC491, 0xC491 }, -{ 0xC492, 0xC492, 0xC492 }, -{ 0xC493, 0xC493, 0xC493 }, -{ 0xC494, 0xC494, 0xC494 }, -{ 0xC495, 0xC495, 0xC495 }, -{ 0xC496, 0xC496, 0xC496 }, -{ 0xC497, 0xC497, 0xC497 }, -{ 0xC498, 0xC498, 0xC498 }, -{ 0xC499, 0xC499, 0xC499 }, -{ 0xC49A, 0xC49A, 0xC49A }, -{ 0xC49B, 0xC49B, 0xC49B }, -{ 0xC49C, 0xC49C, 0xC49C }, -{ 0xC49D, 0xC49D, 0xC49D }, -{ 0xC49E, 0xC49E, 0xC49E }, -{ 0xC49F, 0xC49F, 0xC49F }, -{ 0xC4A0, 0xC4A0, 0xC4A0 }, -{ 0xC4A1, 0xC4A1, 0xC4A1 }, -{ 0xC4A2, 0xC4A2, 0xC4A2 }, -{ 0xC4A3, 0xC4A3, 0xC4A3 }, -{ 0xC4A4, 0xC4A4, 0xC4A4 }, -{ 0xC4A5, 0xC4A5, 0xC4A5 }, -{ 0xC4A6, 0xC4A6, 0xC4A6 }, -{ 0xC4A7, 0xC4A7, 0xC4A7 }, -{ 0xC4A8, 0xC4A8, 0xC4A8 }, -{ 0xC4A9, 0xC4A9, 0xC4A9 }, -{ 0xC4AA, 0xC4AA, 0xC4AA }, -{ 0xC4AB, 0xC4AB, 0xC4AB }, -{ 0xC4AC, 0xC4AC, 0xC4AC }, -{ 0xC4AD, 0xC4AD, 0xC4AD }, -{ 0xC4AE, 0xC4AE, 0xC4AE }, -{ 0xC4AF, 0xC4AF, 0xC4AF }, -{ 0xC4B0, 0xC4B0, 0xC4B0 }, -{ 0xC4B1, 0xC4B1, 0xC4B1 }, -{ 0xC4B2, 0xC4B2, 0xC4B2 }, -{ 0xC4B3, 0xC4B3, 0xC4B3 }, -{ 0xC4B4, 0xC4B4, 0xC4B4 }, -{ 0xC4B5, 0xC4B5, 0xC4B5 }, -{ 0xC4B6, 0xC4B6, 0xC4B6 }, -{ 0xC4B7, 0xC4B7, 0xC4B7 }, -{ 0xC4B8, 0xC4B8, 0xC4B8 }, -{ 0xC4B9, 0xC4B9, 0xC4B9 }, -{ 0xC4BA, 0xC4BA, 0xC4BA }, -{ 0xC4BB, 0xC4BB, 0xC4BB }, -{ 0xC4BC, 0xC4BC, 0xC4BC }, -{ 0xC4BD, 0xC4BD, 0xC4BD }, -{ 0xC4BE, 0xC4BE, 0xC4BE }, -{ 0xC4BF, 0xC4BF, 0xC4BF }, -{ 0xC4C0, 0xC4C0, 0xC4C0 }, -{ 0xC4C1, 0xC4C1, 0xC4C1 }, -{ 0xC4C2, 0xC4C2, 0xC4C2 }, -{ 0xC4C3, 0xC4C3, 0xC4C3 }, -{ 0xC4C4, 0xC4C4, 0xC4C4 }, -{ 0xC4C5, 0xC4C5, 0xC4C5 }, -{ 0xC4C6, 0xC4C6, 0xC4C6 }, -{ 0xC4C7, 0xC4C7, 0xC4C7 }, -{ 0xC4C8, 0xC4C8, 0xC4C8 }, -{ 0xC4C9, 0xC4C9, 0xC4C9 }, -{ 0xC4CA, 0xC4CA, 0xC4CA }, -{ 0xC4CB, 0xC4CB, 0xC4CB }, -{ 0xC4CC, 0xC4CC, 0xC4CC }, -{ 0xC4CD, 0xC4CD, 0xC4CD }, -{ 0xC4CE, 0xC4CE, 0xC4CE }, -{ 0xC4CF, 0xC4CF, 0xC4CF }, -{ 0xC4D0, 0xC4D0, 0xC4D0 }, -{ 0xC4D1, 0xC4D1, 0xC4D1 }, -{ 0xC4D2, 0xC4D2, 0xC4D2 }, -{ 0xC4D3, 0xC4D3, 0xC4D3 }, -{ 0xC4D4, 0xC4D4, 0xC4D4 }, -{ 0xC4D5, 0xC4D5, 0xC4D5 }, -{ 0xC4D6, 0xC4D6, 0xC4D6 }, -{ 0xC4D7, 0xC4D7, 0xC4D7 }, -{ 0xC4D8, 0xC4D8, 0xC4D8 }, -{ 0xC4D9, 0xC4D9, 0xC4D9 }, -{ 0xC4DA, 0xC4DA, 0xC4DA }, -{ 0xC4DB, 0xC4DB, 0xC4DB }, -{ 0xC4DC, 0xC4DC, 0xC4DC }, -{ 0xC4DD, 0xC4DD, 0xC4DD }, -{ 0xC4DE, 0xC4DE, 0xC4DE }, -{ 0xC4DF, 0xC4DF, 0xC4DF }, -{ 0xC4E0, 0xC4E0, 0xC4E0 }, -{ 0xC4E1, 0xC4E1, 0xC4E1 }, -{ 0xC4E2, 0xC4E2, 0xC4E2 }, -{ 0xC4E3, 0xC4E3, 0xC4E3 }, -{ 0xC4E4, 0xC4E4, 0xC4E4 }, -{ 0xC4E5, 0xC4E5, 0xC4E5 }, -{ 0xC4E6, 0xC4E6, 0xC4E6 }, -{ 0xC4E7, 0xC4E7, 0xC4E7 }, -{ 0xC4E8, 0xC4E8, 0xC4E8 }, -{ 0xC4E9, 0xC4E9, 0xC4E9 }, -{ 0xC4EA, 0xC4EA, 0xC4EA }, -{ 0xC4EB, 0xC4EB, 0xC4EB }, -{ 0xC4EC, 0xC4EC, 0xC4EC }, -{ 0xC4ED, 0xC4ED, 0xC4ED }, -{ 0xC4EE, 0xC4EE, 0xC4EE }, -{ 0xC4EF, 0xC4EF, 0xC4EF }, -{ 0xC4F0, 0xC4F0, 0xC4F0 }, -{ 0xC4F1, 0xC4F1, 0xC4F1 }, -{ 0xC4F2, 0xC4F2, 0xC4F2 }, -{ 0xC4F3, 0xC4F3, 0xC4F3 }, -{ 0xC4F4, 0xC4F4, 0xC4F4 }, -{ 0xC4F5, 0xC4F5, 0xC4F5 }, -{ 0xC4F6, 0xC4F6, 0xC4F6 }, -{ 0xC4F7, 0xC4F7, 0xC4F7 }, -{ 0xC4F8, 0xC4F8, 0xC4F8 }, -{ 0xC4F9, 0xC4F9, 0xC4F9 }, -{ 0xC4FA, 0xC4FA, 0xC4FA }, -{ 0xC4FB, 0xC4FB, 0xC4FB }, -{ 0xC4FC, 0xC4FC, 0xC4FC }, -{ 0xC4FD, 0xC4FD, 0xC4FD }, -{ 0xC4FE, 0xC4FE, 0xC4FE }, -{ 0xC4FF, 0xC4FF, 0xC4FF }, -{ 0xC500, 0xC500, 0xC500 }, -{ 0xC501, 0xC501, 0xC501 }, -{ 0xC502, 0xC502, 0xC502 }, -{ 0xC503, 0xC503, 0xC503 }, -{ 0xC504, 0xC504, 0xC504 }, -{ 0xC505, 0xC505, 0xC505 }, -{ 0xC506, 0xC506, 0xC506 }, -{ 0xC507, 0xC507, 0xC507 }, -{ 0xC508, 0xC508, 0xC508 }, -{ 0xC509, 0xC509, 0xC509 }, -{ 0xC50A, 0xC50A, 0xC50A }, -{ 0xC50B, 0xC50B, 0xC50B }, -{ 0xC50C, 0xC50C, 0xC50C }, -{ 0xC50D, 0xC50D, 0xC50D }, -{ 0xC50E, 0xC50E, 0xC50E }, -{ 0xC50F, 0xC50F, 0xC50F }, -{ 0xC510, 0xC510, 0xC510 }, -{ 0xC511, 0xC511, 0xC511 }, -{ 0xC512, 0xC512, 0xC512 }, -{ 0xC513, 0xC513, 0xC513 }, -{ 0xC514, 0xC514, 0xC514 }, -{ 0xC515, 0xC515, 0xC515 }, -{ 0xC516, 0xC516, 0xC516 }, -{ 0xC517, 0xC517, 0xC517 }, -{ 0xC518, 0xC518, 0xC518 }, -{ 0xC519, 0xC519, 0xC519 }, -{ 0xC51A, 0xC51A, 0xC51A }, -{ 0xC51B, 0xC51B, 0xC51B }, -{ 0xC51C, 0xC51C, 0xC51C }, -{ 0xC51D, 0xC51D, 0xC51D }, -{ 0xC51E, 0xC51E, 0xC51E }, -{ 0xC51F, 0xC51F, 0xC51F }, -{ 0xC520, 0xC520, 0xC520 }, -{ 0xC521, 0xC521, 0xC521 }, -{ 0xC522, 0xC522, 0xC522 }, -{ 0xC523, 0xC523, 0xC523 }, -{ 0xC524, 0xC524, 0xC524 }, -{ 0xC525, 0xC525, 0xC525 }, -{ 0xC526, 0xC526, 0xC526 }, -{ 0xC527, 0xC527, 0xC527 }, -{ 0xC528, 0xC528, 0xC528 }, -{ 0xC529, 0xC529, 0xC529 }, -{ 0xC52A, 0xC52A, 0xC52A }, -{ 0xC52B, 0xC52B, 0xC52B }, -{ 0xC52C, 0xC52C, 0xC52C }, -{ 0xC52D, 0xC52D, 0xC52D }, -{ 0xC52E, 0xC52E, 0xC52E }, -{ 0xC52F, 0xC52F, 0xC52F }, -{ 0xC530, 0xC530, 0xC530 }, -{ 0xC531, 0xC531, 0xC531 }, -{ 0xC532, 0xC532, 0xC532 }, -{ 0xC533, 0xC533, 0xC533 }, -{ 0xC534, 0xC534, 0xC534 }, -{ 0xC535, 0xC535, 0xC535 }, -{ 0xC536, 0xC536, 0xC536 }, -{ 0xC537, 0xC537, 0xC537 }, -{ 0xC538, 0xC538, 0xC538 }, -{ 0xC539, 0xC539, 0xC539 }, -{ 0xC53A, 0xC53A, 0xC53A }, -{ 0xC53B, 0xC53B, 0xC53B }, -{ 0xC53C, 0xC53C, 0xC53C }, -{ 0xC53D, 0xC53D, 0xC53D }, -{ 0xC53E, 0xC53E, 0xC53E }, -{ 0xC53F, 0xC53F, 0xC53F }, -{ 0xC540, 0xC540, 0xC540 }, -{ 0xC541, 0xC541, 0xC541 }, -{ 0xC542, 0xC542, 0xC542 }, -{ 0xC543, 0xC543, 0xC543 }, -{ 0xC544, 0xC544, 0xC544 }, -{ 0xC545, 0xC545, 0xC545 }, -{ 0xC546, 0xC546, 0xC546 }, -{ 0xC547, 0xC547, 0xC547 }, -{ 0xC548, 0xC548, 0xC548 }, -{ 0xC549, 0xC549, 0xC549 }, -{ 0xC54A, 0xC54A, 0xC54A }, -{ 0xC54B, 0xC54B, 0xC54B }, -{ 0xC54C, 0xC54C, 0xC54C }, -{ 0xC54D, 0xC54D, 0xC54D }, -{ 0xC54E, 0xC54E, 0xC54E }, -{ 0xC54F, 0xC54F, 0xC54F }, -{ 0xC550, 0xC550, 0xC550 }, -{ 0xC551, 0xC551, 0xC551 }, -{ 0xC552, 0xC552, 0xC552 }, -{ 0xC553, 0xC553, 0xC553 }, -{ 0xC554, 0xC554, 0xC554 }, -{ 0xC555, 0xC555, 0xC555 }, -{ 0xC556, 0xC556, 0xC556 }, -{ 0xC557, 0xC557, 0xC557 }, -{ 0xC558, 0xC558, 0xC558 }, -{ 0xC559, 0xC559, 0xC559 }, -{ 0xC55A, 0xC55A, 0xC55A }, -{ 0xC55B, 0xC55B, 0xC55B }, -{ 0xC55C, 0xC55C, 0xC55C }, -{ 0xC55D, 0xC55D, 0xC55D }, -{ 0xC55E, 0xC55E, 0xC55E }, -{ 0xC55F, 0xC55F, 0xC55F }, -{ 0xC560, 0xC560, 0xC560 }, -{ 0xC561, 0xC561, 0xC561 }, -{ 0xC562, 0xC562, 0xC562 }, -{ 0xC563, 0xC563, 0xC563 }, -{ 0xC564, 0xC564, 0xC564 }, -{ 0xC565, 0xC565, 0xC565 }, -{ 0xC566, 0xC566, 0xC566 }, -{ 0xC567, 0xC567, 0xC567 }, -{ 0xC568, 0xC568, 0xC568 }, -{ 0xC569, 0xC569, 0xC569 }, -{ 0xC56A, 0xC56A, 0xC56A }, -{ 0xC56B, 0xC56B, 0xC56B }, -{ 0xC56C, 0xC56C, 0xC56C }, -{ 0xC56D, 0xC56D, 0xC56D }, -{ 0xC56E, 0xC56E, 0xC56E }, -{ 0xC56F, 0xC56F, 0xC56F }, -{ 0xC570, 0xC570, 0xC570 }, -{ 0xC571, 0xC571, 0xC571 }, -{ 0xC572, 0xC572, 0xC572 }, -{ 0xC573, 0xC573, 0xC573 }, -{ 0xC574, 0xC574, 0xC574 }, -{ 0xC575, 0xC575, 0xC575 }, -{ 0xC576, 0xC576, 0xC576 }, -{ 0xC577, 0xC577, 0xC577 }, -{ 0xC578, 0xC578, 0xC578 }, -{ 0xC579, 0xC579, 0xC579 }, -{ 0xC57A, 0xC57A, 0xC57A }, -{ 0xC57B, 0xC57B, 0xC57B }, -{ 0xC57C, 0xC57C, 0xC57C }, -{ 0xC57D, 0xC57D, 0xC57D }, -{ 0xC57E, 0xC57E, 0xC57E }, -{ 0xC57F, 0xC57F, 0xC57F }, -{ 0xC580, 0xC580, 0xC580 }, -{ 0xC581, 0xC581, 0xC581 }, -{ 0xC582, 0xC582, 0xC582 }, -{ 0xC583, 0xC583, 0xC583 }, -{ 0xC584, 0xC584, 0xC584 }, -{ 0xC585, 0xC585, 0xC585 }, -{ 0xC586, 0xC586, 0xC586 }, -{ 0xC587, 0xC587, 0xC587 }, -{ 0xC588, 0xC588, 0xC588 }, -{ 0xC589, 0xC589, 0xC589 }, -{ 0xC58A, 0xC58A, 0xC58A }, -{ 0xC58B, 0xC58B, 0xC58B }, -{ 0xC58C, 0xC58C, 0xC58C }, -{ 0xC58D, 0xC58D, 0xC58D }, -{ 0xC58E, 0xC58E, 0xC58E }, -{ 0xC58F, 0xC58F, 0xC58F }, -{ 0xC590, 0xC590, 0xC590 }, -{ 0xC591, 0xC591, 0xC591 }, -{ 0xC592, 0xC592, 0xC592 }, -{ 0xC593, 0xC593, 0xC593 }, -{ 0xC594, 0xC594, 0xC594 }, -{ 0xC595, 0xC595, 0xC595 }, -{ 0xC596, 0xC596, 0xC596 }, -{ 0xC597, 0xC597, 0xC597 }, -{ 0xC598, 0xC598, 0xC598 }, -{ 0xC599, 0xC599, 0xC599 }, -{ 0xC59A, 0xC59A, 0xC59A }, -{ 0xC59B, 0xC59B, 0xC59B }, -{ 0xC59C, 0xC59C, 0xC59C }, -{ 0xC59D, 0xC59D, 0xC59D }, -{ 0xC59E, 0xC59E, 0xC59E }, -{ 0xC59F, 0xC59F, 0xC59F }, -{ 0xC5A0, 0xC5A0, 0xC5A0 }, -{ 0xC5A1, 0xC5A1, 0xC5A1 }, -{ 0xC5A2, 0xC5A2, 0xC5A2 }, -{ 0xC5A3, 0xC5A3, 0xC5A3 }, -{ 0xC5A4, 0xC5A4, 0xC5A4 }, -{ 0xC5A5, 0xC5A5, 0xC5A5 }, -{ 0xC5A6, 0xC5A6, 0xC5A6 }, -{ 0xC5A7, 0xC5A7, 0xC5A7 }, -{ 0xC5A8, 0xC5A8, 0xC5A8 }, -{ 0xC5A9, 0xC5A9, 0xC5A9 }, -{ 0xC5AA, 0xC5AA, 0xC5AA }, -{ 0xC5AB, 0xC5AB, 0xC5AB }, -{ 0xC5AC, 0xC5AC, 0xC5AC }, -{ 0xC5AD, 0xC5AD, 0xC5AD }, -{ 0xC5AE, 0xC5AE, 0xC5AE }, -{ 0xC5AF, 0xC5AF, 0xC5AF }, -{ 0xC5B0, 0xC5B0, 0xC5B0 }, -{ 0xC5B1, 0xC5B1, 0xC5B1 }, -{ 0xC5B2, 0xC5B2, 0xC5B2 }, -{ 0xC5B3, 0xC5B3, 0xC5B3 }, -{ 0xC5B4, 0xC5B4, 0xC5B4 }, -{ 0xC5B5, 0xC5B5, 0xC5B5 }, -{ 0xC5B6, 0xC5B6, 0xC5B6 }, -{ 0xC5B7, 0xC5B7, 0xC5B7 }, -{ 0xC5B8, 0xC5B8, 0xC5B8 }, -{ 0xC5B9, 0xC5B9, 0xC5B9 }, -{ 0xC5BA, 0xC5BA, 0xC5BA }, -{ 0xC5BB, 0xC5BB, 0xC5BB }, -{ 0xC5BC, 0xC5BC, 0xC5BC }, -{ 0xC5BD, 0xC5BD, 0xC5BD }, -{ 0xC5BE, 0xC5BE, 0xC5BE }, -{ 0xC5BF, 0xC5BF, 0xC5BF }, -{ 0xC5C0, 0xC5C0, 0xC5C0 }, -{ 0xC5C1, 0xC5C1, 0xC5C1 }, -{ 0xC5C2, 0xC5C2, 0xC5C2 }, -{ 0xC5C3, 0xC5C3, 0xC5C3 }, -{ 0xC5C4, 0xC5C4, 0xC5C4 }, -{ 0xC5C5, 0xC5C5, 0xC5C5 }, -{ 0xC5C6, 0xC5C6, 0xC5C6 }, -{ 0xC5C7, 0xC5C7, 0xC5C7 }, -{ 0xC5C8, 0xC5C8, 0xC5C8 }, -{ 0xC5C9, 0xC5C9, 0xC5C9 }, -{ 0xC5CA, 0xC5CA, 0xC5CA }, -{ 0xC5CB, 0xC5CB, 0xC5CB }, -{ 0xC5CC, 0xC5CC, 0xC5CC }, -{ 0xC5CD, 0xC5CD, 0xC5CD }, -{ 0xC5CE, 0xC5CE, 0xC5CE }, -{ 0xC5CF, 0xC5CF, 0xC5CF }, -{ 0xC5D0, 0xC5D0, 0xC5D0 }, -{ 0xC5D1, 0xC5D1, 0xC5D1 }, -{ 0xC5D2, 0xC5D2, 0xC5D2 }, -{ 0xC5D3, 0xC5D3, 0xC5D3 }, -{ 0xC5D4, 0xC5D4, 0xC5D4 }, -{ 0xC5D5, 0xC5D5, 0xC5D5 }, -{ 0xC5D6, 0xC5D6, 0xC5D6 }, -{ 0xC5D7, 0xC5D7, 0xC5D7 }, -{ 0xC5D8, 0xC5D8, 0xC5D8 }, -{ 0xC5D9, 0xC5D9, 0xC5D9 }, -{ 0xC5DA, 0xC5DA, 0xC5DA }, -{ 0xC5DB, 0xC5DB, 0xC5DB }, -{ 0xC5DC, 0xC5DC, 0xC5DC }, -{ 0xC5DD, 0xC5DD, 0xC5DD }, -{ 0xC5DE, 0xC5DE, 0xC5DE }, -{ 0xC5DF, 0xC5DF, 0xC5DF }, -{ 0xC5E0, 0xC5E0, 0xC5E0 }, -{ 0xC5E1, 0xC5E1, 0xC5E1 }, -{ 0xC5E2, 0xC5E2, 0xC5E2 }, -{ 0xC5E3, 0xC5E3, 0xC5E3 }, -{ 0xC5E4, 0xC5E4, 0xC5E4 }, -{ 0xC5E5, 0xC5E5, 0xC5E5 }, -{ 0xC5E6, 0xC5E6, 0xC5E6 }, -{ 0xC5E7, 0xC5E7, 0xC5E7 }, -{ 0xC5E8, 0xC5E8, 0xC5E8 }, -{ 0xC5E9, 0xC5E9, 0xC5E9 }, -{ 0xC5EA, 0xC5EA, 0xC5EA }, -{ 0xC5EB, 0xC5EB, 0xC5EB }, -{ 0xC5EC, 0xC5EC, 0xC5EC }, -{ 0xC5ED, 0xC5ED, 0xC5ED }, -{ 0xC5EE, 0xC5EE, 0xC5EE }, -{ 0xC5EF, 0xC5EF, 0xC5EF }, -{ 0xC5F0, 0xC5F0, 0xC5F0 }, -{ 0xC5F1, 0xC5F1, 0xC5F1 }, -{ 0xC5F2, 0xC5F2, 0xC5F2 }, -{ 0xC5F3, 0xC5F3, 0xC5F3 }, -{ 0xC5F4, 0xC5F4, 0xC5F4 }, -{ 0xC5F5, 0xC5F5, 0xC5F5 }, -{ 0xC5F6, 0xC5F6, 0xC5F6 }, -{ 0xC5F7, 0xC5F7, 0xC5F7 }, -{ 0xC5F8, 0xC5F8, 0xC5F8 }, -{ 0xC5F9, 0xC5F9, 0xC5F9 }, -{ 0xC5FA, 0xC5FA, 0xC5FA }, -{ 0xC5FB, 0xC5FB, 0xC5FB }, -{ 0xC5FC, 0xC5FC, 0xC5FC }, -{ 0xC5FD, 0xC5FD, 0xC5FD }, -{ 0xC5FE, 0xC5FE, 0xC5FE }, -{ 0xC5FF, 0xC5FF, 0xC5FF }, -{ 0xC600, 0xC600, 0xC600 }, -{ 0xC601, 0xC601, 0xC601 }, -{ 0xC602, 0xC602, 0xC602 }, -{ 0xC603, 0xC603, 0xC603 }, -{ 0xC604, 0xC604, 0xC604 }, -{ 0xC605, 0xC605, 0xC605 }, -{ 0xC606, 0xC606, 0xC606 }, -{ 0xC607, 0xC607, 0xC607 }, -{ 0xC608, 0xC608, 0xC608 }, -{ 0xC609, 0xC609, 0xC609 }, -{ 0xC60A, 0xC60A, 0xC60A }, -{ 0xC60B, 0xC60B, 0xC60B }, -{ 0xC60C, 0xC60C, 0xC60C }, -{ 0xC60D, 0xC60D, 0xC60D }, -{ 0xC60E, 0xC60E, 0xC60E }, -{ 0xC60F, 0xC60F, 0xC60F }, -{ 0xC610, 0xC610, 0xC610 }, -{ 0xC611, 0xC611, 0xC611 }, -{ 0xC612, 0xC612, 0xC612 }, -{ 0xC613, 0xC613, 0xC613 }, -{ 0xC614, 0xC614, 0xC614 }, -{ 0xC615, 0xC615, 0xC615 }, -{ 0xC616, 0xC616, 0xC616 }, -{ 0xC617, 0xC617, 0xC617 }, -{ 0xC618, 0xC618, 0xC618 }, -{ 0xC619, 0xC619, 0xC619 }, -{ 0xC61A, 0xC61A, 0xC61A }, -{ 0xC61B, 0xC61B, 0xC61B }, -{ 0xC61C, 0xC61C, 0xC61C }, -{ 0xC61D, 0xC61D, 0xC61D }, -{ 0xC61E, 0xC61E, 0xC61E }, -{ 0xC61F, 0xC61F, 0xC61F }, -{ 0xC620, 0xC620, 0xC620 }, -{ 0xC621, 0xC621, 0xC621 }, -{ 0xC622, 0xC622, 0xC622 }, -{ 0xC623, 0xC623, 0xC623 }, -{ 0xC624, 0xC624, 0xC624 }, -{ 0xC625, 0xC625, 0xC625 }, -{ 0xC626, 0xC626, 0xC626 }, -{ 0xC627, 0xC627, 0xC627 }, -{ 0xC628, 0xC628, 0xC628 }, -{ 0xC629, 0xC629, 0xC629 }, -{ 0xC62A, 0xC62A, 0xC62A }, -{ 0xC62B, 0xC62B, 0xC62B }, -{ 0xC62C, 0xC62C, 0xC62C }, -{ 0xC62D, 0xC62D, 0xC62D }, -{ 0xC62E, 0xC62E, 0xC62E }, -{ 0xC62F, 0xC62F, 0xC62F }, -{ 0xC630, 0xC630, 0xC630 }, -{ 0xC631, 0xC631, 0xC631 }, -{ 0xC632, 0xC632, 0xC632 }, -{ 0xC633, 0xC633, 0xC633 }, -{ 0xC634, 0xC634, 0xC634 }, -{ 0xC635, 0xC635, 0xC635 }, -{ 0xC636, 0xC636, 0xC636 }, -{ 0xC637, 0xC637, 0xC637 }, -{ 0xC638, 0xC638, 0xC638 }, -{ 0xC639, 0xC639, 0xC639 }, -{ 0xC63A, 0xC63A, 0xC63A }, -{ 0xC63B, 0xC63B, 0xC63B }, -{ 0xC63C, 0xC63C, 0xC63C }, -{ 0xC63D, 0xC63D, 0xC63D }, -{ 0xC63E, 0xC63E, 0xC63E }, -{ 0xC63F, 0xC63F, 0xC63F }, -{ 0xC640, 0xC640, 0xC640 }, -{ 0xC641, 0xC641, 0xC641 }, -{ 0xC642, 0xC642, 0xC642 }, -{ 0xC643, 0xC643, 0xC643 }, -{ 0xC644, 0xC644, 0xC644 }, -{ 0xC645, 0xC645, 0xC645 }, -{ 0xC646, 0xC646, 0xC646 }, -{ 0xC647, 0xC647, 0xC647 }, -{ 0xC648, 0xC648, 0xC648 }, -{ 0xC649, 0xC649, 0xC649 }, -{ 0xC64A, 0xC64A, 0xC64A }, -{ 0xC64B, 0xC64B, 0xC64B }, -{ 0xC64C, 0xC64C, 0xC64C }, -{ 0xC64D, 0xC64D, 0xC64D }, -{ 0xC64E, 0xC64E, 0xC64E }, -{ 0xC64F, 0xC64F, 0xC64F }, -{ 0xC650, 0xC650, 0xC650 }, -{ 0xC651, 0xC651, 0xC651 }, -{ 0xC652, 0xC652, 0xC652 }, -{ 0xC653, 0xC653, 0xC653 }, -{ 0xC654, 0xC654, 0xC654 }, -{ 0xC655, 0xC655, 0xC655 }, -{ 0xC656, 0xC656, 0xC656 }, -{ 0xC657, 0xC657, 0xC657 }, -{ 0xC658, 0xC658, 0xC658 }, -{ 0xC659, 0xC659, 0xC659 }, -{ 0xC65A, 0xC65A, 0xC65A }, -{ 0xC65B, 0xC65B, 0xC65B }, -{ 0xC65C, 0xC65C, 0xC65C }, -{ 0xC65D, 0xC65D, 0xC65D }, -{ 0xC65E, 0xC65E, 0xC65E }, -{ 0xC65F, 0xC65F, 0xC65F }, -{ 0xC660, 0xC660, 0xC660 }, -{ 0xC661, 0xC661, 0xC661 }, -{ 0xC662, 0xC662, 0xC662 }, -{ 0xC663, 0xC663, 0xC663 }, -{ 0xC664, 0xC664, 0xC664 }, -{ 0xC665, 0xC665, 0xC665 }, -{ 0xC666, 0xC666, 0xC666 }, -{ 0xC667, 0xC667, 0xC667 }, -{ 0xC668, 0xC668, 0xC668 }, -{ 0xC669, 0xC669, 0xC669 }, -{ 0xC66A, 0xC66A, 0xC66A }, -{ 0xC66B, 0xC66B, 0xC66B }, -{ 0xC66C, 0xC66C, 0xC66C }, -{ 0xC66D, 0xC66D, 0xC66D }, -{ 0xC66E, 0xC66E, 0xC66E }, -{ 0xC66F, 0xC66F, 0xC66F }, -{ 0xC670, 0xC670, 0xC670 }, -{ 0xC671, 0xC671, 0xC671 }, -{ 0xC672, 0xC672, 0xC672 }, -{ 0xC673, 0xC673, 0xC673 }, -{ 0xC674, 0xC674, 0xC674 }, -{ 0xC675, 0xC675, 0xC675 }, -{ 0xC676, 0xC676, 0xC676 }, -{ 0xC677, 0xC677, 0xC677 }, -{ 0xC678, 0xC678, 0xC678 }, -{ 0xC679, 0xC679, 0xC679 }, -{ 0xC67A, 0xC67A, 0xC67A }, -{ 0xC67B, 0xC67B, 0xC67B }, -{ 0xC67C, 0xC67C, 0xC67C }, -{ 0xC67D, 0xC67D, 0xC67D }, -{ 0xC67E, 0xC67E, 0xC67E }, -{ 0xC67F, 0xC67F, 0xC67F }, -{ 0xC680, 0xC680, 0xC680 }, -{ 0xC681, 0xC681, 0xC681 }, -{ 0xC682, 0xC682, 0xC682 }, -{ 0xC683, 0xC683, 0xC683 }, -{ 0xC684, 0xC684, 0xC684 }, -{ 0xC685, 0xC685, 0xC685 }, -{ 0xC686, 0xC686, 0xC686 }, -{ 0xC687, 0xC687, 0xC687 }, -{ 0xC688, 0xC688, 0xC688 }, -{ 0xC689, 0xC689, 0xC689 }, -{ 0xC68A, 0xC68A, 0xC68A }, -{ 0xC68B, 0xC68B, 0xC68B }, -{ 0xC68C, 0xC68C, 0xC68C }, -{ 0xC68D, 0xC68D, 0xC68D }, -{ 0xC68E, 0xC68E, 0xC68E }, -{ 0xC68F, 0xC68F, 0xC68F }, -{ 0xC690, 0xC690, 0xC690 }, -{ 0xC691, 0xC691, 0xC691 }, -{ 0xC692, 0xC692, 0xC692 }, -{ 0xC693, 0xC693, 0xC693 }, -{ 0xC694, 0xC694, 0xC694 }, -{ 0xC695, 0xC695, 0xC695 }, -{ 0xC696, 0xC696, 0xC696 }, -{ 0xC697, 0xC697, 0xC697 }, -{ 0xC698, 0xC698, 0xC698 }, -{ 0xC699, 0xC699, 0xC699 }, -{ 0xC69A, 0xC69A, 0xC69A }, -{ 0xC69B, 0xC69B, 0xC69B }, -{ 0xC69C, 0xC69C, 0xC69C }, -{ 0xC69D, 0xC69D, 0xC69D }, -{ 0xC69E, 0xC69E, 0xC69E }, -{ 0xC69F, 0xC69F, 0xC69F }, -{ 0xC6A0, 0xC6A0, 0xC6A0 }, -{ 0xC6A1, 0xC6A1, 0xC6A1 }, -{ 0xC6A2, 0xC6A2, 0xC6A2 }, -{ 0xC6A3, 0xC6A3, 0xC6A3 }, -{ 0xC6A4, 0xC6A4, 0xC6A4 }, -{ 0xC6A5, 0xC6A5, 0xC6A5 }, -{ 0xC6A6, 0xC6A6, 0xC6A6 }, -{ 0xC6A7, 0xC6A7, 0xC6A7 }, -{ 0xC6A8, 0xC6A8, 0xC6A8 }, -{ 0xC6A9, 0xC6A9, 0xC6A9 }, -{ 0xC6AA, 0xC6AA, 0xC6AA }, -{ 0xC6AB, 0xC6AB, 0xC6AB }, -{ 0xC6AC, 0xC6AC, 0xC6AC }, -{ 0xC6AD, 0xC6AD, 0xC6AD }, -{ 0xC6AE, 0xC6AE, 0xC6AE }, -{ 0xC6AF, 0xC6AF, 0xC6AF }, -{ 0xC6B0, 0xC6B0, 0xC6B0 }, -{ 0xC6B1, 0xC6B1, 0xC6B1 }, -{ 0xC6B2, 0xC6B2, 0xC6B2 }, -{ 0xC6B3, 0xC6B3, 0xC6B3 }, -{ 0xC6B4, 0xC6B4, 0xC6B4 }, -{ 0xC6B5, 0xC6B5, 0xC6B5 }, -{ 0xC6B6, 0xC6B6, 0xC6B6 }, -{ 0xC6B7, 0xC6B7, 0xC6B7 }, -{ 0xC6B8, 0xC6B8, 0xC6B8 }, -{ 0xC6B9, 0xC6B9, 0xC6B9 }, -{ 0xC6BA, 0xC6BA, 0xC6BA }, -{ 0xC6BB, 0xC6BB, 0xC6BB }, -{ 0xC6BC, 0xC6BC, 0xC6BC }, -{ 0xC6BD, 0xC6BD, 0xC6BD }, -{ 0xC6BE, 0xC6BE, 0xC6BE }, -{ 0xC6BF, 0xC6BF, 0xC6BF }, -{ 0xC6C0, 0xC6C0, 0xC6C0 }, -{ 0xC6C1, 0xC6C1, 0xC6C1 }, -{ 0xC6C2, 0xC6C2, 0xC6C2 }, -{ 0xC6C3, 0xC6C3, 0xC6C3 }, -{ 0xC6C4, 0xC6C4, 0xC6C4 }, -{ 0xC6C5, 0xC6C5, 0xC6C5 }, -{ 0xC6C6, 0xC6C6, 0xC6C6 }, -{ 0xC6C7, 0xC6C7, 0xC6C7 }, -{ 0xC6C8, 0xC6C8, 0xC6C8 }, -{ 0xC6C9, 0xC6C9, 0xC6C9 }, -{ 0xC6CA, 0xC6CA, 0xC6CA }, -{ 0xC6CB, 0xC6CB, 0xC6CB }, -{ 0xC6CC, 0xC6CC, 0xC6CC }, -{ 0xC6CD, 0xC6CD, 0xC6CD }, -{ 0xC6CE, 0xC6CE, 0xC6CE }, -{ 0xC6CF, 0xC6CF, 0xC6CF }, -{ 0xC6D0, 0xC6D0, 0xC6D0 }, -{ 0xC6D1, 0xC6D1, 0xC6D1 }, -{ 0xC6D2, 0xC6D2, 0xC6D2 }, -{ 0xC6D3, 0xC6D3, 0xC6D3 }, -{ 0xC6D4, 0xC6D4, 0xC6D4 }, -{ 0xC6D5, 0xC6D5, 0xC6D5 }, -{ 0xC6D6, 0xC6D6, 0xC6D6 }, -{ 0xC6D7, 0xC6D7, 0xC6D7 }, -{ 0xC6D8, 0xC6D8, 0xC6D8 }, -{ 0xC6D9, 0xC6D9, 0xC6D9 }, -{ 0xC6DA, 0xC6DA, 0xC6DA }, -{ 0xC6DB, 0xC6DB, 0xC6DB }, -{ 0xC6DC, 0xC6DC, 0xC6DC }, -{ 0xC6DD, 0xC6DD, 0xC6DD }, -{ 0xC6DE, 0xC6DE, 0xC6DE }, -{ 0xC6DF, 0xC6DF, 0xC6DF }, -{ 0xC6E0, 0xC6E0, 0xC6E0 }, -{ 0xC6E1, 0xC6E1, 0xC6E1 }, -{ 0xC6E2, 0xC6E2, 0xC6E2 }, -{ 0xC6E3, 0xC6E3, 0xC6E3 }, -{ 0xC6E4, 0xC6E4, 0xC6E4 }, -{ 0xC6E5, 0xC6E5, 0xC6E5 }, -{ 0xC6E6, 0xC6E6, 0xC6E6 }, -{ 0xC6E7, 0xC6E7, 0xC6E7 }, -{ 0xC6E8, 0xC6E8, 0xC6E8 }, -{ 0xC6E9, 0xC6E9, 0xC6E9 }, -{ 0xC6EA, 0xC6EA, 0xC6EA }, -{ 0xC6EB, 0xC6EB, 0xC6EB }, -{ 0xC6EC, 0xC6EC, 0xC6EC }, -{ 0xC6ED, 0xC6ED, 0xC6ED }, -{ 0xC6EE, 0xC6EE, 0xC6EE }, -{ 0xC6EF, 0xC6EF, 0xC6EF }, -{ 0xC6F0, 0xC6F0, 0xC6F0 }, -{ 0xC6F1, 0xC6F1, 0xC6F1 }, -{ 0xC6F2, 0xC6F2, 0xC6F2 }, -{ 0xC6F3, 0xC6F3, 0xC6F3 }, -{ 0xC6F4, 0xC6F4, 0xC6F4 }, -{ 0xC6F5, 0xC6F5, 0xC6F5 }, -{ 0xC6F6, 0xC6F6, 0xC6F6 }, -{ 0xC6F7, 0xC6F7, 0xC6F7 }, -{ 0xC6F8, 0xC6F8, 0xC6F8 }, -{ 0xC6F9, 0xC6F9, 0xC6F9 }, -{ 0xC6FA, 0xC6FA, 0xC6FA }, -{ 0xC6FB, 0xC6FB, 0xC6FB }, -{ 0xC6FC, 0xC6FC, 0xC6FC }, -{ 0xC6FD, 0xC6FD, 0xC6FD }, -{ 0xC6FE, 0xC6FE, 0xC6FE }, -{ 0xC6FF, 0xC6FF, 0xC6FF }, -{ 0xC700, 0xC700, 0xC700 }, -{ 0xC701, 0xC701, 0xC701 }, -{ 0xC702, 0xC702, 0xC702 }, -{ 0xC703, 0xC703, 0xC703 }, -{ 0xC704, 0xC704, 0xC704 }, -{ 0xC705, 0xC705, 0xC705 }, -{ 0xC706, 0xC706, 0xC706 }, -{ 0xC707, 0xC707, 0xC707 }, -{ 0xC708, 0xC708, 0xC708 }, -{ 0xC709, 0xC709, 0xC709 }, -{ 0xC70A, 0xC70A, 0xC70A }, -{ 0xC70B, 0xC70B, 0xC70B }, -{ 0xC70C, 0xC70C, 0xC70C }, -{ 0xC70D, 0xC70D, 0xC70D }, -{ 0xC70E, 0xC70E, 0xC70E }, -{ 0xC70F, 0xC70F, 0xC70F }, -{ 0xC710, 0xC710, 0xC710 }, -{ 0xC711, 0xC711, 0xC711 }, -{ 0xC712, 0xC712, 0xC712 }, -{ 0xC713, 0xC713, 0xC713 }, -{ 0xC714, 0xC714, 0xC714 }, -{ 0xC715, 0xC715, 0xC715 }, -{ 0xC716, 0xC716, 0xC716 }, -{ 0xC717, 0xC717, 0xC717 }, -{ 0xC718, 0xC718, 0xC718 }, -{ 0xC719, 0xC719, 0xC719 }, -{ 0xC71A, 0xC71A, 0xC71A }, -{ 0xC71B, 0xC71B, 0xC71B }, -{ 0xC71C, 0xC71C, 0xC71C }, -{ 0xC71D, 0xC71D, 0xC71D }, -{ 0xC71E, 0xC71E, 0xC71E }, -{ 0xC71F, 0xC71F, 0xC71F }, -{ 0xC720, 0xC720, 0xC720 }, -{ 0xC721, 0xC721, 0xC721 }, -{ 0xC722, 0xC722, 0xC722 }, -{ 0xC723, 0xC723, 0xC723 }, -{ 0xC724, 0xC724, 0xC724 }, -{ 0xC725, 0xC725, 0xC725 }, -{ 0xC726, 0xC726, 0xC726 }, -{ 0xC727, 0xC727, 0xC727 }, -{ 0xC728, 0xC728, 0xC728 }, -{ 0xC729, 0xC729, 0xC729 }, -{ 0xC72A, 0xC72A, 0xC72A }, -{ 0xC72B, 0xC72B, 0xC72B }, -{ 0xC72C, 0xC72C, 0xC72C }, -{ 0xC72D, 0xC72D, 0xC72D }, -{ 0xC72E, 0xC72E, 0xC72E }, -{ 0xC72F, 0xC72F, 0xC72F }, -{ 0xC730, 0xC730, 0xC730 }, -{ 0xC731, 0xC731, 0xC731 }, -{ 0xC732, 0xC732, 0xC732 }, -{ 0xC733, 0xC733, 0xC733 }, -{ 0xC734, 0xC734, 0xC734 }, -{ 0xC735, 0xC735, 0xC735 }, -{ 0xC736, 0xC736, 0xC736 }, -{ 0xC737, 0xC737, 0xC737 }, -{ 0xC738, 0xC738, 0xC738 }, -{ 0xC739, 0xC739, 0xC739 }, -{ 0xC73A, 0xC73A, 0xC73A }, -{ 0xC73B, 0xC73B, 0xC73B }, -{ 0xC73C, 0xC73C, 0xC73C }, -{ 0xC73D, 0xC73D, 0xC73D }, -{ 0xC73E, 0xC73E, 0xC73E }, -{ 0xC73F, 0xC73F, 0xC73F }, -{ 0xC740, 0xC740, 0xC740 }, -{ 0xC741, 0xC741, 0xC741 }, -{ 0xC742, 0xC742, 0xC742 }, -{ 0xC743, 0xC743, 0xC743 }, -{ 0xC744, 0xC744, 0xC744 }, -{ 0xC745, 0xC745, 0xC745 }, -{ 0xC746, 0xC746, 0xC746 }, -{ 0xC747, 0xC747, 0xC747 }, -{ 0xC748, 0xC748, 0xC748 }, -{ 0xC749, 0xC749, 0xC749 }, -{ 0xC74A, 0xC74A, 0xC74A }, -{ 0xC74B, 0xC74B, 0xC74B }, -{ 0xC74C, 0xC74C, 0xC74C }, -{ 0xC74D, 0xC74D, 0xC74D }, -{ 0xC74E, 0xC74E, 0xC74E }, -{ 0xC74F, 0xC74F, 0xC74F }, -{ 0xC750, 0xC750, 0xC750 }, -{ 0xC751, 0xC751, 0xC751 }, -{ 0xC752, 0xC752, 0xC752 }, -{ 0xC753, 0xC753, 0xC753 }, -{ 0xC754, 0xC754, 0xC754 }, -{ 0xC755, 0xC755, 0xC755 }, -{ 0xC756, 0xC756, 0xC756 }, -{ 0xC757, 0xC757, 0xC757 }, -{ 0xC758, 0xC758, 0xC758 }, -{ 0xC759, 0xC759, 0xC759 }, -{ 0xC75A, 0xC75A, 0xC75A }, -{ 0xC75B, 0xC75B, 0xC75B }, -{ 0xC75C, 0xC75C, 0xC75C }, -{ 0xC75D, 0xC75D, 0xC75D }, -{ 0xC75E, 0xC75E, 0xC75E }, -{ 0xC75F, 0xC75F, 0xC75F }, -{ 0xC760, 0xC760, 0xC760 }, -{ 0xC761, 0xC761, 0xC761 }, -{ 0xC762, 0xC762, 0xC762 }, -{ 0xC763, 0xC763, 0xC763 }, -{ 0xC764, 0xC764, 0xC764 }, -{ 0xC765, 0xC765, 0xC765 }, -{ 0xC766, 0xC766, 0xC766 }, -{ 0xC767, 0xC767, 0xC767 }, -{ 0xC768, 0xC768, 0xC768 }, -{ 0xC769, 0xC769, 0xC769 }, -{ 0xC76A, 0xC76A, 0xC76A }, -{ 0xC76B, 0xC76B, 0xC76B }, -{ 0xC76C, 0xC76C, 0xC76C }, -{ 0xC76D, 0xC76D, 0xC76D }, -{ 0xC76E, 0xC76E, 0xC76E }, -{ 0xC76F, 0xC76F, 0xC76F }, -{ 0xC770, 0xC770, 0xC770 }, -{ 0xC771, 0xC771, 0xC771 }, -{ 0xC772, 0xC772, 0xC772 }, -{ 0xC773, 0xC773, 0xC773 }, -{ 0xC774, 0xC774, 0xC774 }, -{ 0xC775, 0xC775, 0xC775 }, -{ 0xC776, 0xC776, 0xC776 }, -{ 0xC777, 0xC777, 0xC777 }, -{ 0xC778, 0xC778, 0xC778 }, -{ 0xC779, 0xC779, 0xC779 }, -{ 0xC77A, 0xC77A, 0xC77A }, -{ 0xC77B, 0xC77B, 0xC77B }, -{ 0xC77C, 0xC77C, 0xC77C }, -{ 0xC77D, 0xC77D, 0xC77D }, -{ 0xC77E, 0xC77E, 0xC77E }, -{ 0xC77F, 0xC77F, 0xC77F }, -{ 0xC780, 0xC780, 0xC780 }, -{ 0xC781, 0xC781, 0xC781 }, -{ 0xC782, 0xC782, 0xC782 }, -{ 0xC783, 0xC783, 0xC783 }, -{ 0xC784, 0xC784, 0xC784 }, -{ 0xC785, 0xC785, 0xC785 }, -{ 0xC786, 0xC786, 0xC786 }, -{ 0xC787, 0xC787, 0xC787 }, -{ 0xC788, 0xC788, 0xC788 }, -{ 0xC789, 0xC789, 0xC789 }, -{ 0xC78A, 0xC78A, 0xC78A }, -{ 0xC78B, 0xC78B, 0xC78B }, -{ 0xC78C, 0xC78C, 0xC78C }, -{ 0xC78D, 0xC78D, 0xC78D }, -{ 0xC78E, 0xC78E, 0xC78E }, -{ 0xC78F, 0xC78F, 0xC78F }, -{ 0xC790, 0xC790, 0xC790 }, -{ 0xC791, 0xC791, 0xC791 }, -{ 0xC792, 0xC792, 0xC792 }, -{ 0xC793, 0xC793, 0xC793 }, -{ 0xC794, 0xC794, 0xC794 }, -{ 0xC795, 0xC795, 0xC795 }, -{ 0xC796, 0xC796, 0xC796 }, -{ 0xC797, 0xC797, 0xC797 }, -{ 0xC798, 0xC798, 0xC798 }, -{ 0xC799, 0xC799, 0xC799 }, -{ 0xC79A, 0xC79A, 0xC79A }, -{ 0xC79B, 0xC79B, 0xC79B }, -{ 0xC79C, 0xC79C, 0xC79C }, -{ 0xC79D, 0xC79D, 0xC79D }, -{ 0xC79E, 0xC79E, 0xC79E }, -{ 0xC79F, 0xC79F, 0xC79F }, -{ 0xC7A0, 0xC7A0, 0xC7A0 }, -{ 0xC7A1, 0xC7A1, 0xC7A1 }, -{ 0xC7A2, 0xC7A2, 0xC7A2 }, -{ 0xC7A3, 0xC7A3, 0xC7A3 }, -{ 0xC7A4, 0xC7A4, 0xC7A4 }, -{ 0xC7A5, 0xC7A5, 0xC7A5 }, -{ 0xC7A6, 0xC7A6, 0xC7A6 }, -{ 0xC7A7, 0xC7A7, 0xC7A7 }, -{ 0xC7A8, 0xC7A8, 0xC7A8 }, -{ 0xC7A9, 0xC7A9, 0xC7A9 }, -{ 0xC7AA, 0xC7AA, 0xC7AA }, -{ 0xC7AB, 0xC7AB, 0xC7AB }, -{ 0xC7AC, 0xC7AC, 0xC7AC }, -{ 0xC7AD, 0xC7AD, 0xC7AD }, -{ 0xC7AE, 0xC7AE, 0xC7AE }, -{ 0xC7AF, 0xC7AF, 0xC7AF }, -{ 0xC7B0, 0xC7B0, 0xC7B0 }, -{ 0xC7B1, 0xC7B1, 0xC7B1 }, -{ 0xC7B2, 0xC7B2, 0xC7B2 }, -{ 0xC7B3, 0xC7B3, 0xC7B3 }, -{ 0xC7B4, 0xC7B4, 0xC7B4 }, -{ 0xC7B5, 0xC7B5, 0xC7B5 }, -{ 0xC7B6, 0xC7B6, 0xC7B6 }, -{ 0xC7B7, 0xC7B7, 0xC7B7 }, -{ 0xC7B8, 0xC7B8, 0xC7B8 }, -{ 0xC7B9, 0xC7B9, 0xC7B9 }, -{ 0xC7BA, 0xC7BA, 0xC7BA }, -{ 0xC7BB, 0xC7BB, 0xC7BB }, -{ 0xC7BC, 0xC7BC, 0xC7BC }, -{ 0xC7BD, 0xC7BD, 0xC7BD }, -{ 0xC7BE, 0xC7BE, 0xC7BE }, -{ 0xC7BF, 0xC7BF, 0xC7BF }, -{ 0xC7C0, 0xC7C0, 0xC7C0 }, -{ 0xC7C1, 0xC7C1, 0xC7C1 }, -{ 0xC7C2, 0xC7C2, 0xC7C2 }, -{ 0xC7C3, 0xC7C3, 0xC7C3 }, -{ 0xC7C4, 0xC7C4, 0xC7C4 }, -{ 0xC7C5, 0xC7C5, 0xC7C5 }, -{ 0xC7C6, 0xC7C6, 0xC7C6 }, -{ 0xC7C7, 0xC7C7, 0xC7C7 }, -{ 0xC7C8, 0xC7C8, 0xC7C8 }, -{ 0xC7C9, 0xC7C9, 0xC7C9 }, -{ 0xC7CA, 0xC7CA, 0xC7CA }, -{ 0xC7CB, 0xC7CB, 0xC7CB }, -{ 0xC7CC, 0xC7CC, 0xC7CC }, -{ 0xC7CD, 0xC7CD, 0xC7CD }, -{ 0xC7CE, 0xC7CE, 0xC7CE }, -{ 0xC7CF, 0xC7CF, 0xC7CF }, -{ 0xC7D0, 0xC7D0, 0xC7D0 }, -{ 0xC7D1, 0xC7D1, 0xC7D1 }, -{ 0xC7D2, 0xC7D2, 0xC7D2 }, -{ 0xC7D3, 0xC7D3, 0xC7D3 }, -{ 0xC7D4, 0xC7D4, 0xC7D4 }, -{ 0xC7D5, 0xC7D5, 0xC7D5 }, -{ 0xC7D6, 0xC7D6, 0xC7D6 }, -{ 0xC7D7, 0xC7D7, 0xC7D7 }, -{ 0xC7D8, 0xC7D8, 0xC7D8 }, -{ 0xC7D9, 0xC7D9, 0xC7D9 }, -{ 0xC7DA, 0xC7DA, 0xC7DA }, -{ 0xC7DB, 0xC7DB, 0xC7DB }, -{ 0xC7DC, 0xC7DC, 0xC7DC }, -{ 0xC7DD, 0xC7DD, 0xC7DD }, -{ 0xC7DE, 0xC7DE, 0xC7DE }, -{ 0xC7DF, 0xC7DF, 0xC7DF }, -{ 0xC7E0, 0xC7E0, 0xC7E0 }, -{ 0xC7E1, 0xC7E1, 0xC7E1 }, -{ 0xC7E2, 0xC7E2, 0xC7E2 }, -{ 0xC7E3, 0xC7E3, 0xC7E3 }, -{ 0xC7E4, 0xC7E4, 0xC7E4 }, -{ 0xC7E5, 0xC7E5, 0xC7E5 }, -{ 0xC7E6, 0xC7E6, 0xC7E6 }, -{ 0xC7E7, 0xC7E7, 0xC7E7 }, -{ 0xC7E8, 0xC7E8, 0xC7E8 }, -{ 0xC7E9, 0xC7E9, 0xC7E9 }, -{ 0xC7EA, 0xC7EA, 0xC7EA }, -{ 0xC7EB, 0xC7EB, 0xC7EB }, -{ 0xC7EC, 0xC7EC, 0xC7EC }, -{ 0xC7ED, 0xC7ED, 0xC7ED }, -{ 0xC7EE, 0xC7EE, 0xC7EE }, -{ 0xC7EF, 0xC7EF, 0xC7EF }, -{ 0xC7F0, 0xC7F0, 0xC7F0 }, -{ 0xC7F1, 0xC7F1, 0xC7F1 }, -{ 0xC7F2, 0xC7F2, 0xC7F2 }, -{ 0xC7F3, 0xC7F3, 0xC7F3 }, -{ 0xC7F4, 0xC7F4, 0xC7F4 }, -{ 0xC7F5, 0xC7F5, 0xC7F5 }, -{ 0xC7F6, 0xC7F6, 0xC7F6 }, -{ 0xC7F7, 0xC7F7, 0xC7F7 }, -{ 0xC7F8, 0xC7F8, 0xC7F8 }, -{ 0xC7F9, 0xC7F9, 0xC7F9 }, -{ 0xC7FA, 0xC7FA, 0xC7FA }, -{ 0xC7FB, 0xC7FB, 0xC7FB }, -{ 0xC7FC, 0xC7FC, 0xC7FC }, -{ 0xC7FD, 0xC7FD, 0xC7FD }, -{ 0xC7FE, 0xC7FE, 0xC7FE }, -{ 0xC7FF, 0xC7FF, 0xC7FF }, -{ 0xC800, 0xC800, 0xC800 }, -{ 0xC801, 0xC801, 0xC801 }, -{ 0xC802, 0xC802, 0xC802 }, -{ 0xC803, 0xC803, 0xC803 }, -{ 0xC804, 0xC804, 0xC804 }, -{ 0xC805, 0xC805, 0xC805 }, -{ 0xC806, 0xC806, 0xC806 }, -{ 0xC807, 0xC807, 0xC807 }, -{ 0xC808, 0xC808, 0xC808 }, -{ 0xC809, 0xC809, 0xC809 }, -{ 0xC80A, 0xC80A, 0xC80A }, -{ 0xC80B, 0xC80B, 0xC80B }, -{ 0xC80C, 0xC80C, 0xC80C }, -{ 0xC80D, 0xC80D, 0xC80D }, -{ 0xC80E, 0xC80E, 0xC80E }, -{ 0xC80F, 0xC80F, 0xC80F }, -{ 0xC810, 0xC810, 0xC810 }, -{ 0xC811, 0xC811, 0xC811 }, -{ 0xC812, 0xC812, 0xC812 }, -{ 0xC813, 0xC813, 0xC813 }, -{ 0xC814, 0xC814, 0xC814 }, -{ 0xC815, 0xC815, 0xC815 }, -{ 0xC816, 0xC816, 0xC816 }, -{ 0xC817, 0xC817, 0xC817 }, -{ 0xC818, 0xC818, 0xC818 }, -{ 0xC819, 0xC819, 0xC819 }, -{ 0xC81A, 0xC81A, 0xC81A }, -{ 0xC81B, 0xC81B, 0xC81B }, -{ 0xC81C, 0xC81C, 0xC81C }, -{ 0xC81D, 0xC81D, 0xC81D }, -{ 0xC81E, 0xC81E, 0xC81E }, -{ 0xC81F, 0xC81F, 0xC81F }, -{ 0xC820, 0xC820, 0xC820 }, -{ 0xC821, 0xC821, 0xC821 }, -{ 0xC822, 0xC822, 0xC822 }, -{ 0xC823, 0xC823, 0xC823 }, -{ 0xC824, 0xC824, 0xC824 }, -{ 0xC825, 0xC825, 0xC825 }, -{ 0xC826, 0xC826, 0xC826 }, -{ 0xC827, 0xC827, 0xC827 }, -{ 0xC828, 0xC828, 0xC828 }, -{ 0xC829, 0xC829, 0xC829 }, -{ 0xC82A, 0xC82A, 0xC82A }, -{ 0xC82B, 0xC82B, 0xC82B }, -{ 0xC82C, 0xC82C, 0xC82C }, -{ 0xC82D, 0xC82D, 0xC82D }, -{ 0xC82E, 0xC82E, 0xC82E }, -{ 0xC82F, 0xC82F, 0xC82F }, -{ 0xC830, 0xC830, 0xC830 }, -{ 0xC831, 0xC831, 0xC831 }, -{ 0xC832, 0xC832, 0xC832 }, -{ 0xC833, 0xC833, 0xC833 }, -{ 0xC834, 0xC834, 0xC834 }, -{ 0xC835, 0xC835, 0xC835 }, -{ 0xC836, 0xC836, 0xC836 }, -{ 0xC837, 0xC837, 0xC837 }, -{ 0xC838, 0xC838, 0xC838 }, -{ 0xC839, 0xC839, 0xC839 }, -{ 0xC83A, 0xC83A, 0xC83A }, -{ 0xC83B, 0xC83B, 0xC83B }, -{ 0xC83C, 0xC83C, 0xC83C }, -{ 0xC83D, 0xC83D, 0xC83D }, -{ 0xC83E, 0xC83E, 0xC83E }, -{ 0xC83F, 0xC83F, 0xC83F }, -{ 0xC840, 0xC840, 0xC840 }, -{ 0xC841, 0xC841, 0xC841 }, -{ 0xC842, 0xC842, 0xC842 }, -{ 0xC843, 0xC843, 0xC843 }, -{ 0xC844, 0xC844, 0xC844 }, -{ 0xC845, 0xC845, 0xC845 }, -{ 0xC846, 0xC846, 0xC846 }, -{ 0xC847, 0xC847, 0xC847 }, -{ 0xC848, 0xC848, 0xC848 }, -{ 0xC849, 0xC849, 0xC849 }, -{ 0xC84A, 0xC84A, 0xC84A }, -{ 0xC84B, 0xC84B, 0xC84B }, -{ 0xC84C, 0xC84C, 0xC84C }, -{ 0xC84D, 0xC84D, 0xC84D }, -{ 0xC84E, 0xC84E, 0xC84E }, -{ 0xC84F, 0xC84F, 0xC84F }, -{ 0xC850, 0xC850, 0xC850 }, -{ 0xC851, 0xC851, 0xC851 }, -{ 0xC852, 0xC852, 0xC852 }, -{ 0xC853, 0xC853, 0xC853 }, -{ 0xC854, 0xC854, 0xC854 }, -{ 0xC855, 0xC855, 0xC855 }, -{ 0xC856, 0xC856, 0xC856 }, -{ 0xC857, 0xC857, 0xC857 }, -{ 0xC858, 0xC858, 0xC858 }, -{ 0xC859, 0xC859, 0xC859 }, -{ 0xC85A, 0xC85A, 0xC85A }, -{ 0xC85B, 0xC85B, 0xC85B }, -{ 0xC85C, 0xC85C, 0xC85C }, -{ 0xC85D, 0xC85D, 0xC85D }, -{ 0xC85E, 0xC85E, 0xC85E }, -{ 0xC85F, 0xC85F, 0xC85F }, -{ 0xC860, 0xC860, 0xC860 }, -{ 0xC861, 0xC861, 0xC861 }, -{ 0xC862, 0xC862, 0xC862 }, -{ 0xC863, 0xC863, 0xC863 }, -{ 0xC864, 0xC864, 0xC864 }, -{ 0xC865, 0xC865, 0xC865 }, -{ 0xC866, 0xC866, 0xC866 }, -{ 0xC867, 0xC867, 0xC867 }, -{ 0xC868, 0xC868, 0xC868 }, -{ 0xC869, 0xC869, 0xC869 }, -{ 0xC86A, 0xC86A, 0xC86A }, -{ 0xC86B, 0xC86B, 0xC86B }, -{ 0xC86C, 0xC86C, 0xC86C }, -{ 0xC86D, 0xC86D, 0xC86D }, -{ 0xC86E, 0xC86E, 0xC86E }, -{ 0xC86F, 0xC86F, 0xC86F }, -{ 0xC870, 0xC870, 0xC870 }, -{ 0xC871, 0xC871, 0xC871 }, -{ 0xC872, 0xC872, 0xC872 }, -{ 0xC873, 0xC873, 0xC873 }, -{ 0xC874, 0xC874, 0xC874 }, -{ 0xC875, 0xC875, 0xC875 }, -{ 0xC876, 0xC876, 0xC876 }, -{ 0xC877, 0xC877, 0xC877 }, -{ 0xC878, 0xC878, 0xC878 }, -{ 0xC879, 0xC879, 0xC879 }, -{ 0xC87A, 0xC87A, 0xC87A }, -{ 0xC87B, 0xC87B, 0xC87B }, -{ 0xC87C, 0xC87C, 0xC87C }, -{ 0xC87D, 0xC87D, 0xC87D }, -{ 0xC87E, 0xC87E, 0xC87E }, -{ 0xC87F, 0xC87F, 0xC87F }, -{ 0xC880, 0xC880, 0xC880 }, -{ 0xC881, 0xC881, 0xC881 }, -{ 0xC882, 0xC882, 0xC882 }, -{ 0xC883, 0xC883, 0xC883 }, -{ 0xC884, 0xC884, 0xC884 }, -{ 0xC885, 0xC885, 0xC885 }, -{ 0xC886, 0xC886, 0xC886 }, -{ 0xC887, 0xC887, 0xC887 }, -{ 0xC888, 0xC888, 0xC888 }, -{ 0xC889, 0xC889, 0xC889 }, -{ 0xC88A, 0xC88A, 0xC88A }, -{ 0xC88B, 0xC88B, 0xC88B }, -{ 0xC88C, 0xC88C, 0xC88C }, -{ 0xC88D, 0xC88D, 0xC88D }, -{ 0xC88E, 0xC88E, 0xC88E }, -{ 0xC88F, 0xC88F, 0xC88F }, -{ 0xC890, 0xC890, 0xC890 }, -{ 0xC891, 0xC891, 0xC891 }, -{ 0xC892, 0xC892, 0xC892 }, -{ 0xC893, 0xC893, 0xC893 }, -{ 0xC894, 0xC894, 0xC894 }, -{ 0xC895, 0xC895, 0xC895 }, -{ 0xC896, 0xC896, 0xC896 }, -{ 0xC897, 0xC897, 0xC897 }, -{ 0xC898, 0xC898, 0xC898 }, -{ 0xC899, 0xC899, 0xC899 }, -{ 0xC89A, 0xC89A, 0xC89A }, -{ 0xC89B, 0xC89B, 0xC89B }, -{ 0xC89C, 0xC89C, 0xC89C }, -{ 0xC89D, 0xC89D, 0xC89D }, -{ 0xC89E, 0xC89E, 0xC89E }, -{ 0xC89F, 0xC89F, 0xC89F }, -{ 0xC8A0, 0xC8A0, 0xC8A0 }, -{ 0xC8A1, 0xC8A1, 0xC8A1 }, -{ 0xC8A2, 0xC8A2, 0xC8A2 }, -{ 0xC8A3, 0xC8A3, 0xC8A3 }, -{ 0xC8A4, 0xC8A4, 0xC8A4 }, -{ 0xC8A5, 0xC8A5, 0xC8A5 }, -{ 0xC8A6, 0xC8A6, 0xC8A6 }, -{ 0xC8A7, 0xC8A7, 0xC8A7 }, -{ 0xC8A8, 0xC8A8, 0xC8A8 }, -{ 0xC8A9, 0xC8A9, 0xC8A9 }, -{ 0xC8AA, 0xC8AA, 0xC8AA }, -{ 0xC8AB, 0xC8AB, 0xC8AB }, -{ 0xC8AC, 0xC8AC, 0xC8AC }, -{ 0xC8AD, 0xC8AD, 0xC8AD }, -{ 0xC8AE, 0xC8AE, 0xC8AE }, -{ 0xC8AF, 0xC8AF, 0xC8AF }, -{ 0xC8B0, 0xC8B0, 0xC8B0 }, -{ 0xC8B1, 0xC8B1, 0xC8B1 }, -{ 0xC8B2, 0xC8B2, 0xC8B2 }, -{ 0xC8B3, 0xC8B3, 0xC8B3 }, -{ 0xC8B4, 0xC8B4, 0xC8B4 }, -{ 0xC8B5, 0xC8B5, 0xC8B5 }, -{ 0xC8B6, 0xC8B6, 0xC8B6 }, -{ 0xC8B7, 0xC8B7, 0xC8B7 }, -{ 0xC8B8, 0xC8B8, 0xC8B8 }, -{ 0xC8B9, 0xC8B9, 0xC8B9 }, -{ 0xC8BA, 0xC8BA, 0xC8BA }, -{ 0xC8BB, 0xC8BB, 0xC8BB }, -{ 0xC8BC, 0xC8BC, 0xC8BC }, -{ 0xC8BD, 0xC8BD, 0xC8BD }, -{ 0xC8BE, 0xC8BE, 0xC8BE }, -{ 0xC8BF, 0xC8BF, 0xC8BF }, -{ 0xC8C0, 0xC8C0, 0xC8C0 }, -{ 0xC8C1, 0xC8C1, 0xC8C1 }, -{ 0xC8C2, 0xC8C2, 0xC8C2 }, -{ 0xC8C3, 0xC8C3, 0xC8C3 }, -{ 0xC8C4, 0xC8C4, 0xC8C4 }, -{ 0xC8C5, 0xC8C5, 0xC8C5 }, -{ 0xC8C6, 0xC8C6, 0xC8C6 }, -{ 0xC8C7, 0xC8C7, 0xC8C7 }, -{ 0xC8C8, 0xC8C8, 0xC8C8 }, -{ 0xC8C9, 0xC8C9, 0xC8C9 }, -{ 0xC8CA, 0xC8CA, 0xC8CA }, -{ 0xC8CB, 0xC8CB, 0xC8CB }, -{ 0xC8CC, 0xC8CC, 0xC8CC }, -{ 0xC8CD, 0xC8CD, 0xC8CD }, -{ 0xC8CE, 0xC8CE, 0xC8CE }, -{ 0xC8CF, 0xC8CF, 0xC8CF }, -{ 0xC8D0, 0xC8D0, 0xC8D0 }, -{ 0xC8D1, 0xC8D1, 0xC8D1 }, -{ 0xC8D2, 0xC8D2, 0xC8D2 }, -{ 0xC8D3, 0xC8D3, 0xC8D3 }, -{ 0xC8D4, 0xC8D4, 0xC8D4 }, -{ 0xC8D5, 0xC8D5, 0xC8D5 }, -{ 0xC8D6, 0xC8D6, 0xC8D6 }, -{ 0xC8D7, 0xC8D7, 0xC8D7 }, -{ 0xC8D8, 0xC8D8, 0xC8D8 }, -{ 0xC8D9, 0xC8D9, 0xC8D9 }, -{ 0xC8DA, 0xC8DA, 0xC8DA }, -{ 0xC8DB, 0xC8DB, 0xC8DB }, -{ 0xC8DC, 0xC8DC, 0xC8DC }, -{ 0xC8DD, 0xC8DD, 0xC8DD }, -{ 0xC8DE, 0xC8DE, 0xC8DE }, -{ 0xC8DF, 0xC8DF, 0xC8DF }, -{ 0xC8E0, 0xC8E0, 0xC8E0 }, -{ 0xC8E1, 0xC8E1, 0xC8E1 }, -{ 0xC8E2, 0xC8E2, 0xC8E2 }, -{ 0xC8E3, 0xC8E3, 0xC8E3 }, -{ 0xC8E4, 0xC8E4, 0xC8E4 }, -{ 0xC8E5, 0xC8E5, 0xC8E5 }, -{ 0xC8E6, 0xC8E6, 0xC8E6 }, -{ 0xC8E7, 0xC8E7, 0xC8E7 }, -{ 0xC8E8, 0xC8E8, 0xC8E8 }, -{ 0xC8E9, 0xC8E9, 0xC8E9 }, -{ 0xC8EA, 0xC8EA, 0xC8EA }, -{ 0xC8EB, 0xC8EB, 0xC8EB }, -{ 0xC8EC, 0xC8EC, 0xC8EC }, -{ 0xC8ED, 0xC8ED, 0xC8ED }, -{ 0xC8EE, 0xC8EE, 0xC8EE }, -{ 0xC8EF, 0xC8EF, 0xC8EF }, -{ 0xC8F0, 0xC8F0, 0xC8F0 }, -{ 0xC8F1, 0xC8F1, 0xC8F1 }, -{ 0xC8F2, 0xC8F2, 0xC8F2 }, -{ 0xC8F3, 0xC8F3, 0xC8F3 }, -{ 0xC8F4, 0xC8F4, 0xC8F4 }, -{ 0xC8F5, 0xC8F5, 0xC8F5 }, -{ 0xC8F6, 0xC8F6, 0xC8F6 }, -{ 0xC8F7, 0xC8F7, 0xC8F7 }, -{ 0xC8F8, 0xC8F8, 0xC8F8 }, -{ 0xC8F9, 0xC8F9, 0xC8F9 }, -{ 0xC8FA, 0xC8FA, 0xC8FA }, -{ 0xC8FB, 0xC8FB, 0xC8FB }, -{ 0xC8FC, 0xC8FC, 0xC8FC }, -{ 0xC8FD, 0xC8FD, 0xC8FD }, -{ 0xC8FE, 0xC8FE, 0xC8FE }, -{ 0xC8FF, 0xC8FF, 0xC8FF }, -{ 0xC900, 0xC900, 0xC900 }, -{ 0xC901, 0xC901, 0xC901 }, -{ 0xC902, 0xC902, 0xC902 }, -{ 0xC903, 0xC903, 0xC903 }, -{ 0xC904, 0xC904, 0xC904 }, -{ 0xC905, 0xC905, 0xC905 }, -{ 0xC906, 0xC906, 0xC906 }, -{ 0xC907, 0xC907, 0xC907 }, -{ 0xC908, 0xC908, 0xC908 }, -{ 0xC909, 0xC909, 0xC909 }, -{ 0xC90A, 0xC90A, 0xC90A }, -{ 0xC90B, 0xC90B, 0xC90B }, -{ 0xC90C, 0xC90C, 0xC90C }, -{ 0xC90D, 0xC90D, 0xC90D }, -{ 0xC90E, 0xC90E, 0xC90E }, -{ 0xC90F, 0xC90F, 0xC90F }, -{ 0xC910, 0xC910, 0xC910 }, -{ 0xC911, 0xC911, 0xC911 }, -{ 0xC912, 0xC912, 0xC912 }, -{ 0xC913, 0xC913, 0xC913 }, -{ 0xC914, 0xC914, 0xC914 }, -{ 0xC915, 0xC915, 0xC915 }, -{ 0xC916, 0xC916, 0xC916 }, -{ 0xC917, 0xC917, 0xC917 }, -{ 0xC918, 0xC918, 0xC918 }, -{ 0xC919, 0xC919, 0xC919 }, -{ 0xC91A, 0xC91A, 0xC91A }, -{ 0xC91B, 0xC91B, 0xC91B }, -{ 0xC91C, 0xC91C, 0xC91C }, -{ 0xC91D, 0xC91D, 0xC91D }, -{ 0xC91E, 0xC91E, 0xC91E }, -{ 0xC91F, 0xC91F, 0xC91F }, -{ 0xC920, 0xC920, 0xC920 }, -{ 0xC921, 0xC921, 0xC921 }, -{ 0xC922, 0xC922, 0xC922 }, -{ 0xC923, 0xC923, 0xC923 }, -{ 0xC924, 0xC924, 0xC924 }, -{ 0xC925, 0xC925, 0xC925 }, -{ 0xC926, 0xC926, 0xC926 }, -{ 0xC927, 0xC927, 0xC927 }, -{ 0xC928, 0xC928, 0xC928 }, -{ 0xC929, 0xC929, 0xC929 }, -{ 0xC92A, 0xC92A, 0xC92A }, -{ 0xC92B, 0xC92B, 0xC92B }, -{ 0xC92C, 0xC92C, 0xC92C }, -{ 0xC92D, 0xC92D, 0xC92D }, -{ 0xC92E, 0xC92E, 0xC92E }, -{ 0xC92F, 0xC92F, 0xC92F }, -{ 0xC930, 0xC930, 0xC930 }, -{ 0xC931, 0xC931, 0xC931 }, -{ 0xC932, 0xC932, 0xC932 }, -{ 0xC933, 0xC933, 0xC933 }, -{ 0xC934, 0xC934, 0xC934 }, -{ 0xC935, 0xC935, 0xC935 }, -{ 0xC936, 0xC936, 0xC936 }, -{ 0xC937, 0xC937, 0xC937 }, -{ 0xC938, 0xC938, 0xC938 }, -{ 0xC939, 0xC939, 0xC939 }, -{ 0xC93A, 0xC93A, 0xC93A }, -{ 0xC93B, 0xC93B, 0xC93B }, -{ 0xC93C, 0xC93C, 0xC93C }, -{ 0xC93D, 0xC93D, 0xC93D }, -{ 0xC93E, 0xC93E, 0xC93E }, -{ 0xC93F, 0xC93F, 0xC93F }, -{ 0xC940, 0xC940, 0xC940 }, -{ 0xC941, 0xC941, 0xC941 }, -{ 0xC942, 0xC942, 0xC942 }, -{ 0xC943, 0xC943, 0xC943 }, -{ 0xC944, 0xC944, 0xC944 }, -{ 0xC945, 0xC945, 0xC945 }, -{ 0xC946, 0xC946, 0xC946 }, -{ 0xC947, 0xC947, 0xC947 }, -{ 0xC948, 0xC948, 0xC948 }, -{ 0xC949, 0xC949, 0xC949 }, -{ 0xC94A, 0xC94A, 0xC94A }, -{ 0xC94B, 0xC94B, 0xC94B }, -{ 0xC94C, 0xC94C, 0xC94C }, -{ 0xC94D, 0xC94D, 0xC94D }, -{ 0xC94E, 0xC94E, 0xC94E }, -{ 0xC94F, 0xC94F, 0xC94F }, -{ 0xC950, 0xC950, 0xC950 }, -{ 0xC951, 0xC951, 0xC951 }, -{ 0xC952, 0xC952, 0xC952 }, -{ 0xC953, 0xC953, 0xC953 }, -{ 0xC954, 0xC954, 0xC954 }, -{ 0xC955, 0xC955, 0xC955 }, -{ 0xC956, 0xC956, 0xC956 }, -{ 0xC957, 0xC957, 0xC957 }, -{ 0xC958, 0xC958, 0xC958 }, -{ 0xC959, 0xC959, 0xC959 }, -{ 0xC95A, 0xC95A, 0xC95A }, -{ 0xC95B, 0xC95B, 0xC95B }, -{ 0xC95C, 0xC95C, 0xC95C }, -{ 0xC95D, 0xC95D, 0xC95D }, -{ 0xC95E, 0xC95E, 0xC95E }, -{ 0xC95F, 0xC95F, 0xC95F }, -{ 0xC960, 0xC960, 0xC960 }, -{ 0xC961, 0xC961, 0xC961 }, -{ 0xC962, 0xC962, 0xC962 }, -{ 0xC963, 0xC963, 0xC963 }, -{ 0xC964, 0xC964, 0xC964 }, -{ 0xC965, 0xC965, 0xC965 }, -{ 0xC966, 0xC966, 0xC966 }, -{ 0xC967, 0xC967, 0xC967 }, -{ 0xC968, 0xC968, 0xC968 }, -{ 0xC969, 0xC969, 0xC969 }, -{ 0xC96A, 0xC96A, 0xC96A }, -{ 0xC96B, 0xC96B, 0xC96B }, -{ 0xC96C, 0xC96C, 0xC96C }, -{ 0xC96D, 0xC96D, 0xC96D }, -{ 0xC96E, 0xC96E, 0xC96E }, -{ 0xC96F, 0xC96F, 0xC96F }, -{ 0xC970, 0xC970, 0xC970 }, -{ 0xC971, 0xC971, 0xC971 }, -{ 0xC972, 0xC972, 0xC972 }, -{ 0xC973, 0xC973, 0xC973 }, -{ 0xC974, 0xC974, 0xC974 }, -{ 0xC975, 0xC975, 0xC975 }, -{ 0xC976, 0xC976, 0xC976 }, -{ 0xC977, 0xC977, 0xC977 }, -{ 0xC978, 0xC978, 0xC978 }, -{ 0xC979, 0xC979, 0xC979 }, -{ 0xC97A, 0xC97A, 0xC97A }, -{ 0xC97B, 0xC97B, 0xC97B }, -{ 0xC97C, 0xC97C, 0xC97C }, -{ 0xC97D, 0xC97D, 0xC97D }, -{ 0xC97E, 0xC97E, 0xC97E }, -{ 0xC97F, 0xC97F, 0xC97F }, -{ 0xC980, 0xC980, 0xC980 }, -{ 0xC981, 0xC981, 0xC981 }, -{ 0xC982, 0xC982, 0xC982 }, -{ 0xC983, 0xC983, 0xC983 }, -{ 0xC984, 0xC984, 0xC984 }, -{ 0xC985, 0xC985, 0xC985 }, -{ 0xC986, 0xC986, 0xC986 }, -{ 0xC987, 0xC987, 0xC987 }, -{ 0xC988, 0xC988, 0xC988 }, -{ 0xC989, 0xC989, 0xC989 }, -{ 0xC98A, 0xC98A, 0xC98A }, -{ 0xC98B, 0xC98B, 0xC98B }, -{ 0xC98C, 0xC98C, 0xC98C }, -{ 0xC98D, 0xC98D, 0xC98D }, -{ 0xC98E, 0xC98E, 0xC98E }, -{ 0xC98F, 0xC98F, 0xC98F }, -{ 0xC990, 0xC990, 0xC990 }, -{ 0xC991, 0xC991, 0xC991 }, -{ 0xC992, 0xC992, 0xC992 }, -{ 0xC993, 0xC993, 0xC993 }, -{ 0xC994, 0xC994, 0xC994 }, -{ 0xC995, 0xC995, 0xC995 }, -{ 0xC996, 0xC996, 0xC996 }, -{ 0xC997, 0xC997, 0xC997 }, -{ 0xC998, 0xC998, 0xC998 }, -{ 0xC999, 0xC999, 0xC999 }, -{ 0xC99A, 0xC99A, 0xC99A }, -{ 0xC99B, 0xC99B, 0xC99B }, -{ 0xC99C, 0xC99C, 0xC99C }, -{ 0xC99D, 0xC99D, 0xC99D }, -{ 0xC99E, 0xC99E, 0xC99E }, -{ 0xC99F, 0xC99F, 0xC99F }, -{ 0xC9A0, 0xC9A0, 0xC9A0 }, -{ 0xC9A1, 0xC9A1, 0xC9A1 }, -{ 0xC9A2, 0xC9A2, 0xC9A2 }, -{ 0xC9A3, 0xC9A3, 0xC9A3 }, -{ 0xC9A4, 0xC9A4, 0xC9A4 }, -{ 0xC9A5, 0xC9A5, 0xC9A5 }, -{ 0xC9A6, 0xC9A6, 0xC9A6 }, -{ 0xC9A7, 0xC9A7, 0xC9A7 }, -{ 0xC9A8, 0xC9A8, 0xC9A8 }, -{ 0xC9A9, 0xC9A9, 0xC9A9 }, -{ 0xC9AA, 0xC9AA, 0xC9AA }, -{ 0xC9AB, 0xC9AB, 0xC9AB }, -{ 0xC9AC, 0xC9AC, 0xC9AC }, -{ 0xC9AD, 0xC9AD, 0xC9AD }, -{ 0xC9AE, 0xC9AE, 0xC9AE }, -{ 0xC9AF, 0xC9AF, 0xC9AF }, -{ 0xC9B0, 0xC9B0, 0xC9B0 }, -{ 0xC9B1, 0xC9B1, 0xC9B1 }, -{ 0xC9B2, 0xC9B2, 0xC9B2 }, -{ 0xC9B3, 0xC9B3, 0xC9B3 }, -{ 0xC9B4, 0xC9B4, 0xC9B4 }, -{ 0xC9B5, 0xC9B5, 0xC9B5 }, -{ 0xC9B6, 0xC9B6, 0xC9B6 }, -{ 0xC9B7, 0xC9B7, 0xC9B7 }, -{ 0xC9B8, 0xC9B8, 0xC9B8 }, -{ 0xC9B9, 0xC9B9, 0xC9B9 }, -{ 0xC9BA, 0xC9BA, 0xC9BA }, -{ 0xC9BB, 0xC9BB, 0xC9BB }, -{ 0xC9BC, 0xC9BC, 0xC9BC }, -{ 0xC9BD, 0xC9BD, 0xC9BD }, -{ 0xC9BE, 0xC9BE, 0xC9BE }, -{ 0xC9BF, 0xC9BF, 0xC9BF }, -{ 0xC9C0, 0xC9C0, 0xC9C0 }, -{ 0xC9C1, 0xC9C1, 0xC9C1 }, -{ 0xC9C2, 0xC9C2, 0xC9C2 }, -{ 0xC9C3, 0xC9C3, 0xC9C3 }, -{ 0xC9C4, 0xC9C4, 0xC9C4 }, -{ 0xC9C5, 0xC9C5, 0xC9C5 }, -{ 0xC9C6, 0xC9C6, 0xC9C6 }, -{ 0xC9C7, 0xC9C7, 0xC9C7 }, -{ 0xC9C8, 0xC9C8, 0xC9C8 }, -{ 0xC9C9, 0xC9C9, 0xC9C9 }, -{ 0xC9CA, 0xC9CA, 0xC9CA }, -{ 0xC9CB, 0xC9CB, 0xC9CB }, -{ 0xC9CC, 0xC9CC, 0xC9CC }, -{ 0xC9CD, 0xC9CD, 0xC9CD }, -{ 0xC9CE, 0xC9CE, 0xC9CE }, -{ 0xC9CF, 0xC9CF, 0xC9CF }, -{ 0xC9D0, 0xC9D0, 0xC9D0 }, -{ 0xC9D1, 0xC9D1, 0xC9D1 }, -{ 0xC9D2, 0xC9D2, 0xC9D2 }, -{ 0xC9D3, 0xC9D3, 0xC9D3 }, -{ 0xC9D4, 0xC9D4, 0xC9D4 }, -{ 0xC9D5, 0xC9D5, 0xC9D5 }, -{ 0xC9D6, 0xC9D6, 0xC9D6 }, -{ 0xC9D7, 0xC9D7, 0xC9D7 }, -{ 0xC9D8, 0xC9D8, 0xC9D8 }, -{ 0xC9D9, 0xC9D9, 0xC9D9 }, -{ 0xC9DA, 0xC9DA, 0xC9DA }, -{ 0xC9DB, 0xC9DB, 0xC9DB }, -{ 0xC9DC, 0xC9DC, 0xC9DC }, -{ 0xC9DD, 0xC9DD, 0xC9DD }, -{ 0xC9DE, 0xC9DE, 0xC9DE }, -{ 0xC9DF, 0xC9DF, 0xC9DF }, -{ 0xC9E0, 0xC9E0, 0xC9E0 }, -{ 0xC9E1, 0xC9E1, 0xC9E1 }, -{ 0xC9E2, 0xC9E2, 0xC9E2 }, -{ 0xC9E3, 0xC9E3, 0xC9E3 }, -{ 0xC9E4, 0xC9E4, 0xC9E4 }, -{ 0xC9E5, 0xC9E5, 0xC9E5 }, -{ 0xC9E6, 0xC9E6, 0xC9E6 }, -{ 0xC9E7, 0xC9E7, 0xC9E7 }, -{ 0xC9E8, 0xC9E8, 0xC9E8 }, -{ 0xC9E9, 0xC9E9, 0xC9E9 }, -{ 0xC9EA, 0xC9EA, 0xC9EA }, -{ 0xC9EB, 0xC9EB, 0xC9EB }, -{ 0xC9EC, 0xC9EC, 0xC9EC }, -{ 0xC9ED, 0xC9ED, 0xC9ED }, -{ 0xC9EE, 0xC9EE, 0xC9EE }, -{ 0xC9EF, 0xC9EF, 0xC9EF }, -{ 0xC9F0, 0xC9F0, 0xC9F0 }, -{ 0xC9F1, 0xC9F1, 0xC9F1 }, -{ 0xC9F2, 0xC9F2, 0xC9F2 }, -{ 0xC9F3, 0xC9F3, 0xC9F3 }, -{ 0xC9F4, 0xC9F4, 0xC9F4 }, -{ 0xC9F5, 0xC9F5, 0xC9F5 }, -{ 0xC9F6, 0xC9F6, 0xC9F6 }, -{ 0xC9F7, 0xC9F7, 0xC9F7 }, -{ 0xC9F8, 0xC9F8, 0xC9F8 }, -{ 0xC9F9, 0xC9F9, 0xC9F9 }, -{ 0xC9FA, 0xC9FA, 0xC9FA }, -{ 0xC9FB, 0xC9FB, 0xC9FB }, -{ 0xC9FC, 0xC9FC, 0xC9FC }, -{ 0xC9FD, 0xC9FD, 0xC9FD }, -{ 0xC9FE, 0xC9FE, 0xC9FE }, -{ 0xC9FF, 0xC9FF, 0xC9FF }, -{ 0xCA00, 0xCA00, 0xCA00 }, -{ 0xCA01, 0xCA01, 0xCA01 }, -{ 0xCA02, 0xCA02, 0xCA02 }, -{ 0xCA03, 0xCA03, 0xCA03 }, -{ 0xCA04, 0xCA04, 0xCA04 }, -{ 0xCA05, 0xCA05, 0xCA05 }, -{ 0xCA06, 0xCA06, 0xCA06 }, -{ 0xCA07, 0xCA07, 0xCA07 }, -{ 0xCA08, 0xCA08, 0xCA08 }, -{ 0xCA09, 0xCA09, 0xCA09 }, -{ 0xCA0A, 0xCA0A, 0xCA0A }, -{ 0xCA0B, 0xCA0B, 0xCA0B }, -{ 0xCA0C, 0xCA0C, 0xCA0C }, -{ 0xCA0D, 0xCA0D, 0xCA0D }, -{ 0xCA0E, 0xCA0E, 0xCA0E }, -{ 0xCA0F, 0xCA0F, 0xCA0F }, -{ 0xCA10, 0xCA10, 0xCA10 }, -{ 0xCA11, 0xCA11, 0xCA11 }, -{ 0xCA12, 0xCA12, 0xCA12 }, -{ 0xCA13, 0xCA13, 0xCA13 }, -{ 0xCA14, 0xCA14, 0xCA14 }, -{ 0xCA15, 0xCA15, 0xCA15 }, -{ 0xCA16, 0xCA16, 0xCA16 }, -{ 0xCA17, 0xCA17, 0xCA17 }, -{ 0xCA18, 0xCA18, 0xCA18 }, -{ 0xCA19, 0xCA19, 0xCA19 }, -{ 0xCA1A, 0xCA1A, 0xCA1A }, -{ 0xCA1B, 0xCA1B, 0xCA1B }, -{ 0xCA1C, 0xCA1C, 0xCA1C }, -{ 0xCA1D, 0xCA1D, 0xCA1D }, -{ 0xCA1E, 0xCA1E, 0xCA1E }, -{ 0xCA1F, 0xCA1F, 0xCA1F }, -{ 0xCA20, 0xCA20, 0xCA20 }, -{ 0xCA21, 0xCA21, 0xCA21 }, -{ 0xCA22, 0xCA22, 0xCA22 }, -{ 0xCA23, 0xCA23, 0xCA23 }, -{ 0xCA24, 0xCA24, 0xCA24 }, -{ 0xCA25, 0xCA25, 0xCA25 }, -{ 0xCA26, 0xCA26, 0xCA26 }, -{ 0xCA27, 0xCA27, 0xCA27 }, -{ 0xCA28, 0xCA28, 0xCA28 }, -{ 0xCA29, 0xCA29, 0xCA29 }, -{ 0xCA2A, 0xCA2A, 0xCA2A }, -{ 0xCA2B, 0xCA2B, 0xCA2B }, -{ 0xCA2C, 0xCA2C, 0xCA2C }, -{ 0xCA2D, 0xCA2D, 0xCA2D }, -{ 0xCA2E, 0xCA2E, 0xCA2E }, -{ 0xCA2F, 0xCA2F, 0xCA2F }, -{ 0xCA30, 0xCA30, 0xCA30 }, -{ 0xCA31, 0xCA31, 0xCA31 }, -{ 0xCA32, 0xCA32, 0xCA32 }, -{ 0xCA33, 0xCA33, 0xCA33 }, -{ 0xCA34, 0xCA34, 0xCA34 }, -{ 0xCA35, 0xCA35, 0xCA35 }, -{ 0xCA36, 0xCA36, 0xCA36 }, -{ 0xCA37, 0xCA37, 0xCA37 }, -{ 0xCA38, 0xCA38, 0xCA38 }, -{ 0xCA39, 0xCA39, 0xCA39 }, -{ 0xCA3A, 0xCA3A, 0xCA3A }, -{ 0xCA3B, 0xCA3B, 0xCA3B }, -{ 0xCA3C, 0xCA3C, 0xCA3C }, -{ 0xCA3D, 0xCA3D, 0xCA3D }, -{ 0xCA3E, 0xCA3E, 0xCA3E }, -{ 0xCA3F, 0xCA3F, 0xCA3F }, -{ 0xCA40, 0xCA40, 0xCA40 }, -{ 0xCA41, 0xCA41, 0xCA41 }, -{ 0xCA42, 0xCA42, 0xCA42 }, -{ 0xCA43, 0xCA43, 0xCA43 }, -{ 0xCA44, 0xCA44, 0xCA44 }, -{ 0xCA45, 0xCA45, 0xCA45 }, -{ 0xCA46, 0xCA46, 0xCA46 }, -{ 0xCA47, 0xCA47, 0xCA47 }, -{ 0xCA48, 0xCA48, 0xCA48 }, -{ 0xCA49, 0xCA49, 0xCA49 }, -{ 0xCA4A, 0xCA4A, 0xCA4A }, -{ 0xCA4B, 0xCA4B, 0xCA4B }, -{ 0xCA4C, 0xCA4C, 0xCA4C }, -{ 0xCA4D, 0xCA4D, 0xCA4D }, -{ 0xCA4E, 0xCA4E, 0xCA4E }, -{ 0xCA4F, 0xCA4F, 0xCA4F }, -{ 0xCA50, 0xCA50, 0xCA50 }, -{ 0xCA51, 0xCA51, 0xCA51 }, -{ 0xCA52, 0xCA52, 0xCA52 }, -{ 0xCA53, 0xCA53, 0xCA53 }, -{ 0xCA54, 0xCA54, 0xCA54 }, -{ 0xCA55, 0xCA55, 0xCA55 }, -{ 0xCA56, 0xCA56, 0xCA56 }, -{ 0xCA57, 0xCA57, 0xCA57 }, -{ 0xCA58, 0xCA58, 0xCA58 }, -{ 0xCA59, 0xCA59, 0xCA59 }, -{ 0xCA5A, 0xCA5A, 0xCA5A }, -{ 0xCA5B, 0xCA5B, 0xCA5B }, -{ 0xCA5C, 0xCA5C, 0xCA5C }, -{ 0xCA5D, 0xCA5D, 0xCA5D }, -{ 0xCA5E, 0xCA5E, 0xCA5E }, -{ 0xCA5F, 0xCA5F, 0xCA5F }, -{ 0xCA60, 0xCA60, 0xCA60 }, -{ 0xCA61, 0xCA61, 0xCA61 }, -{ 0xCA62, 0xCA62, 0xCA62 }, -{ 0xCA63, 0xCA63, 0xCA63 }, -{ 0xCA64, 0xCA64, 0xCA64 }, -{ 0xCA65, 0xCA65, 0xCA65 }, -{ 0xCA66, 0xCA66, 0xCA66 }, -{ 0xCA67, 0xCA67, 0xCA67 }, -{ 0xCA68, 0xCA68, 0xCA68 }, -{ 0xCA69, 0xCA69, 0xCA69 }, -{ 0xCA6A, 0xCA6A, 0xCA6A }, -{ 0xCA6B, 0xCA6B, 0xCA6B }, -{ 0xCA6C, 0xCA6C, 0xCA6C }, -{ 0xCA6D, 0xCA6D, 0xCA6D }, -{ 0xCA6E, 0xCA6E, 0xCA6E }, -{ 0xCA6F, 0xCA6F, 0xCA6F }, -{ 0xCA70, 0xCA70, 0xCA70 }, -{ 0xCA71, 0xCA71, 0xCA71 }, -{ 0xCA72, 0xCA72, 0xCA72 }, -{ 0xCA73, 0xCA73, 0xCA73 }, -{ 0xCA74, 0xCA74, 0xCA74 }, -{ 0xCA75, 0xCA75, 0xCA75 }, -{ 0xCA76, 0xCA76, 0xCA76 }, -{ 0xCA77, 0xCA77, 0xCA77 }, -{ 0xCA78, 0xCA78, 0xCA78 }, -{ 0xCA79, 0xCA79, 0xCA79 }, -{ 0xCA7A, 0xCA7A, 0xCA7A }, -{ 0xCA7B, 0xCA7B, 0xCA7B }, -{ 0xCA7C, 0xCA7C, 0xCA7C }, -{ 0xCA7D, 0xCA7D, 0xCA7D }, -{ 0xCA7E, 0xCA7E, 0xCA7E }, -{ 0xCA7F, 0xCA7F, 0xCA7F }, -{ 0xCA80, 0xCA80, 0xCA80 }, -{ 0xCA81, 0xCA81, 0xCA81 }, -{ 0xCA82, 0xCA82, 0xCA82 }, -{ 0xCA83, 0xCA83, 0xCA83 }, -{ 0xCA84, 0xCA84, 0xCA84 }, -{ 0xCA85, 0xCA85, 0xCA85 }, -{ 0xCA86, 0xCA86, 0xCA86 }, -{ 0xCA87, 0xCA87, 0xCA87 }, -{ 0xCA88, 0xCA88, 0xCA88 }, -{ 0xCA89, 0xCA89, 0xCA89 }, -{ 0xCA8A, 0xCA8A, 0xCA8A }, -{ 0xCA8B, 0xCA8B, 0xCA8B }, -{ 0xCA8C, 0xCA8C, 0xCA8C }, -{ 0xCA8D, 0xCA8D, 0xCA8D }, -{ 0xCA8E, 0xCA8E, 0xCA8E }, -{ 0xCA8F, 0xCA8F, 0xCA8F }, -{ 0xCA90, 0xCA90, 0xCA90 }, -{ 0xCA91, 0xCA91, 0xCA91 }, -{ 0xCA92, 0xCA92, 0xCA92 }, -{ 0xCA93, 0xCA93, 0xCA93 }, -{ 0xCA94, 0xCA94, 0xCA94 }, -{ 0xCA95, 0xCA95, 0xCA95 }, -{ 0xCA96, 0xCA96, 0xCA96 }, -{ 0xCA97, 0xCA97, 0xCA97 }, -{ 0xCA98, 0xCA98, 0xCA98 }, -{ 0xCA99, 0xCA99, 0xCA99 }, -{ 0xCA9A, 0xCA9A, 0xCA9A }, -{ 0xCA9B, 0xCA9B, 0xCA9B }, -{ 0xCA9C, 0xCA9C, 0xCA9C }, -{ 0xCA9D, 0xCA9D, 0xCA9D }, -{ 0xCA9E, 0xCA9E, 0xCA9E }, -{ 0xCA9F, 0xCA9F, 0xCA9F }, -{ 0xCAA0, 0xCAA0, 0xCAA0 }, -{ 0xCAA1, 0xCAA1, 0xCAA1 }, -{ 0xCAA2, 0xCAA2, 0xCAA2 }, -{ 0xCAA3, 0xCAA3, 0xCAA3 }, -{ 0xCAA4, 0xCAA4, 0xCAA4 }, -{ 0xCAA5, 0xCAA5, 0xCAA5 }, -{ 0xCAA6, 0xCAA6, 0xCAA6 }, -{ 0xCAA7, 0xCAA7, 0xCAA7 }, -{ 0xCAA8, 0xCAA8, 0xCAA8 }, -{ 0xCAA9, 0xCAA9, 0xCAA9 }, -{ 0xCAAA, 0xCAAA, 0xCAAA }, -{ 0xCAAB, 0xCAAB, 0xCAAB }, -{ 0xCAAC, 0xCAAC, 0xCAAC }, -{ 0xCAAD, 0xCAAD, 0xCAAD }, -{ 0xCAAE, 0xCAAE, 0xCAAE }, -{ 0xCAAF, 0xCAAF, 0xCAAF }, -{ 0xCAB0, 0xCAB0, 0xCAB0 }, -{ 0xCAB1, 0xCAB1, 0xCAB1 }, -{ 0xCAB2, 0xCAB2, 0xCAB2 }, -{ 0xCAB3, 0xCAB3, 0xCAB3 }, -{ 0xCAB4, 0xCAB4, 0xCAB4 }, -{ 0xCAB5, 0xCAB5, 0xCAB5 }, -{ 0xCAB6, 0xCAB6, 0xCAB6 }, -{ 0xCAB7, 0xCAB7, 0xCAB7 }, -{ 0xCAB8, 0xCAB8, 0xCAB8 }, -{ 0xCAB9, 0xCAB9, 0xCAB9 }, -{ 0xCABA, 0xCABA, 0xCABA }, -{ 0xCABB, 0xCABB, 0xCABB }, -{ 0xCABC, 0xCABC, 0xCABC }, -{ 0xCABD, 0xCABD, 0xCABD }, -{ 0xCABE, 0xCABE, 0xCABE }, -{ 0xCABF, 0xCABF, 0xCABF }, -{ 0xCAC0, 0xCAC0, 0xCAC0 }, -{ 0xCAC1, 0xCAC1, 0xCAC1 }, -{ 0xCAC2, 0xCAC2, 0xCAC2 }, -{ 0xCAC3, 0xCAC3, 0xCAC3 }, -{ 0xCAC4, 0xCAC4, 0xCAC4 }, -{ 0xCAC5, 0xCAC5, 0xCAC5 }, -{ 0xCAC6, 0xCAC6, 0xCAC6 }, -{ 0xCAC7, 0xCAC7, 0xCAC7 }, -{ 0xCAC8, 0xCAC8, 0xCAC8 }, -{ 0xCAC9, 0xCAC9, 0xCAC9 }, -{ 0xCACA, 0xCACA, 0xCACA }, -{ 0xCACB, 0xCACB, 0xCACB }, -{ 0xCACC, 0xCACC, 0xCACC }, -{ 0xCACD, 0xCACD, 0xCACD }, -{ 0xCACE, 0xCACE, 0xCACE }, -{ 0xCACF, 0xCACF, 0xCACF }, -{ 0xCAD0, 0xCAD0, 0xCAD0 }, -{ 0xCAD1, 0xCAD1, 0xCAD1 }, -{ 0xCAD2, 0xCAD2, 0xCAD2 }, -{ 0xCAD3, 0xCAD3, 0xCAD3 }, -{ 0xCAD4, 0xCAD4, 0xCAD4 }, -{ 0xCAD5, 0xCAD5, 0xCAD5 }, -{ 0xCAD6, 0xCAD6, 0xCAD6 }, -{ 0xCAD7, 0xCAD7, 0xCAD7 }, -{ 0xCAD8, 0xCAD8, 0xCAD8 }, -{ 0xCAD9, 0xCAD9, 0xCAD9 }, -{ 0xCADA, 0xCADA, 0xCADA }, -{ 0xCADB, 0xCADB, 0xCADB }, -{ 0xCADC, 0xCADC, 0xCADC }, -{ 0xCADD, 0xCADD, 0xCADD }, -{ 0xCADE, 0xCADE, 0xCADE }, -{ 0xCADF, 0xCADF, 0xCADF }, -{ 0xCAE0, 0xCAE0, 0xCAE0 }, -{ 0xCAE1, 0xCAE1, 0xCAE1 }, -{ 0xCAE2, 0xCAE2, 0xCAE2 }, -{ 0xCAE3, 0xCAE3, 0xCAE3 }, -{ 0xCAE4, 0xCAE4, 0xCAE4 }, -{ 0xCAE5, 0xCAE5, 0xCAE5 }, -{ 0xCAE6, 0xCAE6, 0xCAE6 }, -{ 0xCAE7, 0xCAE7, 0xCAE7 }, -{ 0xCAE8, 0xCAE8, 0xCAE8 }, -{ 0xCAE9, 0xCAE9, 0xCAE9 }, -{ 0xCAEA, 0xCAEA, 0xCAEA }, -{ 0xCAEB, 0xCAEB, 0xCAEB }, -{ 0xCAEC, 0xCAEC, 0xCAEC }, -{ 0xCAED, 0xCAED, 0xCAED }, -{ 0xCAEE, 0xCAEE, 0xCAEE }, -{ 0xCAEF, 0xCAEF, 0xCAEF }, -{ 0xCAF0, 0xCAF0, 0xCAF0 }, -{ 0xCAF1, 0xCAF1, 0xCAF1 }, -{ 0xCAF2, 0xCAF2, 0xCAF2 }, -{ 0xCAF3, 0xCAF3, 0xCAF3 }, -{ 0xCAF4, 0xCAF4, 0xCAF4 }, -{ 0xCAF5, 0xCAF5, 0xCAF5 }, -{ 0xCAF6, 0xCAF6, 0xCAF6 }, -{ 0xCAF7, 0xCAF7, 0xCAF7 }, -{ 0xCAF8, 0xCAF8, 0xCAF8 }, -{ 0xCAF9, 0xCAF9, 0xCAF9 }, -{ 0xCAFA, 0xCAFA, 0xCAFA }, -{ 0xCAFB, 0xCAFB, 0xCAFB }, -{ 0xCAFC, 0xCAFC, 0xCAFC }, -{ 0xCAFD, 0xCAFD, 0xCAFD }, -{ 0xCAFE, 0xCAFE, 0xCAFE }, -{ 0xCAFF, 0xCAFF, 0xCAFF }, -{ 0xCB00, 0xCB00, 0xCB00 }, -{ 0xCB01, 0xCB01, 0xCB01 }, -{ 0xCB02, 0xCB02, 0xCB02 }, -{ 0xCB03, 0xCB03, 0xCB03 }, -{ 0xCB04, 0xCB04, 0xCB04 }, -{ 0xCB05, 0xCB05, 0xCB05 }, -{ 0xCB06, 0xCB06, 0xCB06 }, -{ 0xCB07, 0xCB07, 0xCB07 }, -{ 0xCB08, 0xCB08, 0xCB08 }, -{ 0xCB09, 0xCB09, 0xCB09 }, -{ 0xCB0A, 0xCB0A, 0xCB0A }, -{ 0xCB0B, 0xCB0B, 0xCB0B }, -{ 0xCB0C, 0xCB0C, 0xCB0C }, -{ 0xCB0D, 0xCB0D, 0xCB0D }, -{ 0xCB0E, 0xCB0E, 0xCB0E }, -{ 0xCB0F, 0xCB0F, 0xCB0F }, -{ 0xCB10, 0xCB10, 0xCB10 }, -{ 0xCB11, 0xCB11, 0xCB11 }, -{ 0xCB12, 0xCB12, 0xCB12 }, -{ 0xCB13, 0xCB13, 0xCB13 }, -{ 0xCB14, 0xCB14, 0xCB14 }, -{ 0xCB15, 0xCB15, 0xCB15 }, -{ 0xCB16, 0xCB16, 0xCB16 }, -{ 0xCB17, 0xCB17, 0xCB17 }, -{ 0xCB18, 0xCB18, 0xCB18 }, -{ 0xCB19, 0xCB19, 0xCB19 }, -{ 0xCB1A, 0xCB1A, 0xCB1A }, -{ 0xCB1B, 0xCB1B, 0xCB1B }, -{ 0xCB1C, 0xCB1C, 0xCB1C }, -{ 0xCB1D, 0xCB1D, 0xCB1D }, -{ 0xCB1E, 0xCB1E, 0xCB1E }, -{ 0xCB1F, 0xCB1F, 0xCB1F }, -{ 0xCB20, 0xCB20, 0xCB20 }, -{ 0xCB21, 0xCB21, 0xCB21 }, -{ 0xCB22, 0xCB22, 0xCB22 }, -{ 0xCB23, 0xCB23, 0xCB23 }, -{ 0xCB24, 0xCB24, 0xCB24 }, -{ 0xCB25, 0xCB25, 0xCB25 }, -{ 0xCB26, 0xCB26, 0xCB26 }, -{ 0xCB27, 0xCB27, 0xCB27 }, -{ 0xCB28, 0xCB28, 0xCB28 }, -{ 0xCB29, 0xCB29, 0xCB29 }, -{ 0xCB2A, 0xCB2A, 0xCB2A }, -{ 0xCB2B, 0xCB2B, 0xCB2B }, -{ 0xCB2C, 0xCB2C, 0xCB2C }, -{ 0xCB2D, 0xCB2D, 0xCB2D }, -{ 0xCB2E, 0xCB2E, 0xCB2E }, -{ 0xCB2F, 0xCB2F, 0xCB2F }, -{ 0xCB30, 0xCB30, 0xCB30 }, -{ 0xCB31, 0xCB31, 0xCB31 }, -{ 0xCB32, 0xCB32, 0xCB32 }, -{ 0xCB33, 0xCB33, 0xCB33 }, -{ 0xCB34, 0xCB34, 0xCB34 }, -{ 0xCB35, 0xCB35, 0xCB35 }, -{ 0xCB36, 0xCB36, 0xCB36 }, -{ 0xCB37, 0xCB37, 0xCB37 }, -{ 0xCB38, 0xCB38, 0xCB38 }, -{ 0xCB39, 0xCB39, 0xCB39 }, -{ 0xCB3A, 0xCB3A, 0xCB3A }, -{ 0xCB3B, 0xCB3B, 0xCB3B }, -{ 0xCB3C, 0xCB3C, 0xCB3C }, -{ 0xCB3D, 0xCB3D, 0xCB3D }, -{ 0xCB3E, 0xCB3E, 0xCB3E }, -{ 0xCB3F, 0xCB3F, 0xCB3F }, -{ 0xCB40, 0xCB40, 0xCB40 }, -{ 0xCB41, 0xCB41, 0xCB41 }, -{ 0xCB42, 0xCB42, 0xCB42 }, -{ 0xCB43, 0xCB43, 0xCB43 }, -{ 0xCB44, 0xCB44, 0xCB44 }, -{ 0xCB45, 0xCB45, 0xCB45 }, -{ 0xCB46, 0xCB46, 0xCB46 }, -{ 0xCB47, 0xCB47, 0xCB47 }, -{ 0xCB48, 0xCB48, 0xCB48 }, -{ 0xCB49, 0xCB49, 0xCB49 }, -{ 0xCB4A, 0xCB4A, 0xCB4A }, -{ 0xCB4B, 0xCB4B, 0xCB4B }, -{ 0xCB4C, 0xCB4C, 0xCB4C }, -{ 0xCB4D, 0xCB4D, 0xCB4D }, -{ 0xCB4E, 0xCB4E, 0xCB4E }, -{ 0xCB4F, 0xCB4F, 0xCB4F }, -{ 0xCB50, 0xCB50, 0xCB50 }, -{ 0xCB51, 0xCB51, 0xCB51 }, -{ 0xCB52, 0xCB52, 0xCB52 }, -{ 0xCB53, 0xCB53, 0xCB53 }, -{ 0xCB54, 0xCB54, 0xCB54 }, -{ 0xCB55, 0xCB55, 0xCB55 }, -{ 0xCB56, 0xCB56, 0xCB56 }, -{ 0xCB57, 0xCB57, 0xCB57 }, -{ 0xCB58, 0xCB58, 0xCB58 }, -{ 0xCB59, 0xCB59, 0xCB59 }, -{ 0xCB5A, 0xCB5A, 0xCB5A }, -{ 0xCB5B, 0xCB5B, 0xCB5B }, -{ 0xCB5C, 0xCB5C, 0xCB5C }, -{ 0xCB5D, 0xCB5D, 0xCB5D }, -{ 0xCB5E, 0xCB5E, 0xCB5E }, -{ 0xCB5F, 0xCB5F, 0xCB5F }, -{ 0xCB60, 0xCB60, 0xCB60 }, -{ 0xCB61, 0xCB61, 0xCB61 }, -{ 0xCB62, 0xCB62, 0xCB62 }, -{ 0xCB63, 0xCB63, 0xCB63 }, -{ 0xCB64, 0xCB64, 0xCB64 }, -{ 0xCB65, 0xCB65, 0xCB65 }, -{ 0xCB66, 0xCB66, 0xCB66 }, -{ 0xCB67, 0xCB67, 0xCB67 }, -{ 0xCB68, 0xCB68, 0xCB68 }, -{ 0xCB69, 0xCB69, 0xCB69 }, -{ 0xCB6A, 0xCB6A, 0xCB6A }, -{ 0xCB6B, 0xCB6B, 0xCB6B }, -{ 0xCB6C, 0xCB6C, 0xCB6C }, -{ 0xCB6D, 0xCB6D, 0xCB6D }, -{ 0xCB6E, 0xCB6E, 0xCB6E }, -{ 0xCB6F, 0xCB6F, 0xCB6F }, -{ 0xCB70, 0xCB70, 0xCB70 }, -{ 0xCB71, 0xCB71, 0xCB71 }, -{ 0xCB72, 0xCB72, 0xCB72 }, -{ 0xCB73, 0xCB73, 0xCB73 }, -{ 0xCB74, 0xCB74, 0xCB74 }, -{ 0xCB75, 0xCB75, 0xCB75 }, -{ 0xCB76, 0xCB76, 0xCB76 }, -{ 0xCB77, 0xCB77, 0xCB77 }, -{ 0xCB78, 0xCB78, 0xCB78 }, -{ 0xCB79, 0xCB79, 0xCB79 }, -{ 0xCB7A, 0xCB7A, 0xCB7A }, -{ 0xCB7B, 0xCB7B, 0xCB7B }, -{ 0xCB7C, 0xCB7C, 0xCB7C }, -{ 0xCB7D, 0xCB7D, 0xCB7D }, -{ 0xCB7E, 0xCB7E, 0xCB7E }, -{ 0xCB7F, 0xCB7F, 0xCB7F }, -{ 0xCB80, 0xCB80, 0xCB80 }, -{ 0xCB81, 0xCB81, 0xCB81 }, -{ 0xCB82, 0xCB82, 0xCB82 }, -{ 0xCB83, 0xCB83, 0xCB83 }, -{ 0xCB84, 0xCB84, 0xCB84 }, -{ 0xCB85, 0xCB85, 0xCB85 }, -{ 0xCB86, 0xCB86, 0xCB86 }, -{ 0xCB87, 0xCB87, 0xCB87 }, -{ 0xCB88, 0xCB88, 0xCB88 }, -{ 0xCB89, 0xCB89, 0xCB89 }, -{ 0xCB8A, 0xCB8A, 0xCB8A }, -{ 0xCB8B, 0xCB8B, 0xCB8B }, -{ 0xCB8C, 0xCB8C, 0xCB8C }, -{ 0xCB8D, 0xCB8D, 0xCB8D }, -{ 0xCB8E, 0xCB8E, 0xCB8E }, -{ 0xCB8F, 0xCB8F, 0xCB8F }, -{ 0xCB90, 0xCB90, 0xCB90 }, -{ 0xCB91, 0xCB91, 0xCB91 }, -{ 0xCB92, 0xCB92, 0xCB92 }, -{ 0xCB93, 0xCB93, 0xCB93 }, -{ 0xCB94, 0xCB94, 0xCB94 }, -{ 0xCB95, 0xCB95, 0xCB95 }, -{ 0xCB96, 0xCB96, 0xCB96 }, -{ 0xCB97, 0xCB97, 0xCB97 }, -{ 0xCB98, 0xCB98, 0xCB98 }, -{ 0xCB99, 0xCB99, 0xCB99 }, -{ 0xCB9A, 0xCB9A, 0xCB9A }, -{ 0xCB9B, 0xCB9B, 0xCB9B }, -{ 0xCB9C, 0xCB9C, 0xCB9C }, -{ 0xCB9D, 0xCB9D, 0xCB9D }, -{ 0xCB9E, 0xCB9E, 0xCB9E }, -{ 0xCB9F, 0xCB9F, 0xCB9F }, -{ 0xCBA0, 0xCBA0, 0xCBA0 }, -{ 0xCBA1, 0xCBA1, 0xCBA1 }, -{ 0xCBA2, 0xCBA2, 0xCBA2 }, -{ 0xCBA3, 0xCBA3, 0xCBA3 }, -{ 0xCBA4, 0xCBA4, 0xCBA4 }, -{ 0xCBA5, 0xCBA5, 0xCBA5 }, -{ 0xCBA6, 0xCBA6, 0xCBA6 }, -{ 0xCBA7, 0xCBA7, 0xCBA7 }, -{ 0xCBA8, 0xCBA8, 0xCBA8 }, -{ 0xCBA9, 0xCBA9, 0xCBA9 }, -{ 0xCBAA, 0xCBAA, 0xCBAA }, -{ 0xCBAB, 0xCBAB, 0xCBAB }, -{ 0xCBAC, 0xCBAC, 0xCBAC }, -{ 0xCBAD, 0xCBAD, 0xCBAD }, -{ 0xCBAE, 0xCBAE, 0xCBAE }, -{ 0xCBAF, 0xCBAF, 0xCBAF }, -{ 0xCBB0, 0xCBB0, 0xCBB0 }, -{ 0xCBB1, 0xCBB1, 0xCBB1 }, -{ 0xCBB2, 0xCBB2, 0xCBB2 }, -{ 0xCBB3, 0xCBB3, 0xCBB3 }, -{ 0xCBB4, 0xCBB4, 0xCBB4 }, -{ 0xCBB5, 0xCBB5, 0xCBB5 }, -{ 0xCBB6, 0xCBB6, 0xCBB6 }, -{ 0xCBB7, 0xCBB7, 0xCBB7 }, -{ 0xCBB8, 0xCBB8, 0xCBB8 }, -{ 0xCBB9, 0xCBB9, 0xCBB9 }, -{ 0xCBBA, 0xCBBA, 0xCBBA }, -{ 0xCBBB, 0xCBBB, 0xCBBB }, -{ 0xCBBC, 0xCBBC, 0xCBBC }, -{ 0xCBBD, 0xCBBD, 0xCBBD }, -{ 0xCBBE, 0xCBBE, 0xCBBE }, -{ 0xCBBF, 0xCBBF, 0xCBBF }, -{ 0xCBC0, 0xCBC0, 0xCBC0 }, -{ 0xCBC1, 0xCBC1, 0xCBC1 }, -{ 0xCBC2, 0xCBC2, 0xCBC2 }, -{ 0xCBC3, 0xCBC3, 0xCBC3 }, -{ 0xCBC4, 0xCBC4, 0xCBC4 }, -{ 0xCBC5, 0xCBC5, 0xCBC5 }, -{ 0xCBC6, 0xCBC6, 0xCBC6 }, -{ 0xCBC7, 0xCBC7, 0xCBC7 }, -{ 0xCBC8, 0xCBC8, 0xCBC8 }, -{ 0xCBC9, 0xCBC9, 0xCBC9 }, -{ 0xCBCA, 0xCBCA, 0xCBCA }, -{ 0xCBCB, 0xCBCB, 0xCBCB }, -{ 0xCBCC, 0xCBCC, 0xCBCC }, -{ 0xCBCD, 0xCBCD, 0xCBCD }, -{ 0xCBCE, 0xCBCE, 0xCBCE }, -{ 0xCBCF, 0xCBCF, 0xCBCF }, -{ 0xCBD0, 0xCBD0, 0xCBD0 }, -{ 0xCBD1, 0xCBD1, 0xCBD1 }, -{ 0xCBD2, 0xCBD2, 0xCBD2 }, -{ 0xCBD3, 0xCBD3, 0xCBD3 }, -{ 0xCBD4, 0xCBD4, 0xCBD4 }, -{ 0xCBD5, 0xCBD5, 0xCBD5 }, -{ 0xCBD6, 0xCBD6, 0xCBD6 }, -{ 0xCBD7, 0xCBD7, 0xCBD7 }, -{ 0xCBD8, 0xCBD8, 0xCBD8 }, -{ 0xCBD9, 0xCBD9, 0xCBD9 }, -{ 0xCBDA, 0xCBDA, 0xCBDA }, -{ 0xCBDB, 0xCBDB, 0xCBDB }, -{ 0xCBDC, 0xCBDC, 0xCBDC }, -{ 0xCBDD, 0xCBDD, 0xCBDD }, -{ 0xCBDE, 0xCBDE, 0xCBDE }, -{ 0xCBDF, 0xCBDF, 0xCBDF }, -{ 0xCBE0, 0xCBE0, 0xCBE0 }, -{ 0xCBE1, 0xCBE1, 0xCBE1 }, -{ 0xCBE2, 0xCBE2, 0xCBE2 }, -{ 0xCBE3, 0xCBE3, 0xCBE3 }, -{ 0xCBE4, 0xCBE4, 0xCBE4 }, -{ 0xCBE5, 0xCBE5, 0xCBE5 }, -{ 0xCBE6, 0xCBE6, 0xCBE6 }, -{ 0xCBE7, 0xCBE7, 0xCBE7 }, -{ 0xCBE8, 0xCBE8, 0xCBE8 }, -{ 0xCBE9, 0xCBE9, 0xCBE9 }, -{ 0xCBEA, 0xCBEA, 0xCBEA }, -{ 0xCBEB, 0xCBEB, 0xCBEB }, -{ 0xCBEC, 0xCBEC, 0xCBEC }, -{ 0xCBED, 0xCBED, 0xCBED }, -{ 0xCBEE, 0xCBEE, 0xCBEE }, -{ 0xCBEF, 0xCBEF, 0xCBEF }, -{ 0xCBF0, 0xCBF0, 0xCBF0 }, -{ 0xCBF1, 0xCBF1, 0xCBF1 }, -{ 0xCBF2, 0xCBF2, 0xCBF2 }, -{ 0xCBF3, 0xCBF3, 0xCBF3 }, -{ 0xCBF4, 0xCBF4, 0xCBF4 }, -{ 0xCBF5, 0xCBF5, 0xCBF5 }, -{ 0xCBF6, 0xCBF6, 0xCBF6 }, -{ 0xCBF7, 0xCBF7, 0xCBF7 }, -{ 0xCBF8, 0xCBF8, 0xCBF8 }, -{ 0xCBF9, 0xCBF9, 0xCBF9 }, -{ 0xCBFA, 0xCBFA, 0xCBFA }, -{ 0xCBFB, 0xCBFB, 0xCBFB }, -{ 0xCBFC, 0xCBFC, 0xCBFC }, -{ 0xCBFD, 0xCBFD, 0xCBFD }, -{ 0xCBFE, 0xCBFE, 0xCBFE }, -{ 0xCBFF, 0xCBFF, 0xCBFF }, -{ 0xCC00, 0xCC00, 0xCC00 }, -{ 0xCC01, 0xCC01, 0xCC01 }, -{ 0xCC02, 0xCC02, 0xCC02 }, -{ 0xCC03, 0xCC03, 0xCC03 }, -{ 0xCC04, 0xCC04, 0xCC04 }, -{ 0xCC05, 0xCC05, 0xCC05 }, -{ 0xCC06, 0xCC06, 0xCC06 }, -{ 0xCC07, 0xCC07, 0xCC07 }, -{ 0xCC08, 0xCC08, 0xCC08 }, -{ 0xCC09, 0xCC09, 0xCC09 }, -{ 0xCC0A, 0xCC0A, 0xCC0A }, -{ 0xCC0B, 0xCC0B, 0xCC0B }, -{ 0xCC0C, 0xCC0C, 0xCC0C }, -{ 0xCC0D, 0xCC0D, 0xCC0D }, -{ 0xCC0E, 0xCC0E, 0xCC0E }, -{ 0xCC0F, 0xCC0F, 0xCC0F }, -{ 0xCC10, 0xCC10, 0xCC10 }, -{ 0xCC11, 0xCC11, 0xCC11 }, -{ 0xCC12, 0xCC12, 0xCC12 }, -{ 0xCC13, 0xCC13, 0xCC13 }, -{ 0xCC14, 0xCC14, 0xCC14 }, -{ 0xCC15, 0xCC15, 0xCC15 }, -{ 0xCC16, 0xCC16, 0xCC16 }, -{ 0xCC17, 0xCC17, 0xCC17 }, -{ 0xCC18, 0xCC18, 0xCC18 }, -{ 0xCC19, 0xCC19, 0xCC19 }, -{ 0xCC1A, 0xCC1A, 0xCC1A }, -{ 0xCC1B, 0xCC1B, 0xCC1B }, -{ 0xCC1C, 0xCC1C, 0xCC1C }, -{ 0xCC1D, 0xCC1D, 0xCC1D }, -{ 0xCC1E, 0xCC1E, 0xCC1E }, -{ 0xCC1F, 0xCC1F, 0xCC1F }, -{ 0xCC20, 0xCC20, 0xCC20 }, -{ 0xCC21, 0xCC21, 0xCC21 }, -{ 0xCC22, 0xCC22, 0xCC22 }, -{ 0xCC23, 0xCC23, 0xCC23 }, -{ 0xCC24, 0xCC24, 0xCC24 }, -{ 0xCC25, 0xCC25, 0xCC25 }, -{ 0xCC26, 0xCC26, 0xCC26 }, -{ 0xCC27, 0xCC27, 0xCC27 }, -{ 0xCC28, 0xCC28, 0xCC28 }, -{ 0xCC29, 0xCC29, 0xCC29 }, -{ 0xCC2A, 0xCC2A, 0xCC2A }, -{ 0xCC2B, 0xCC2B, 0xCC2B }, -{ 0xCC2C, 0xCC2C, 0xCC2C }, -{ 0xCC2D, 0xCC2D, 0xCC2D }, -{ 0xCC2E, 0xCC2E, 0xCC2E }, -{ 0xCC2F, 0xCC2F, 0xCC2F }, -{ 0xCC30, 0xCC30, 0xCC30 }, -{ 0xCC31, 0xCC31, 0xCC31 }, -{ 0xCC32, 0xCC32, 0xCC32 }, -{ 0xCC33, 0xCC33, 0xCC33 }, -{ 0xCC34, 0xCC34, 0xCC34 }, -{ 0xCC35, 0xCC35, 0xCC35 }, -{ 0xCC36, 0xCC36, 0xCC36 }, -{ 0xCC37, 0xCC37, 0xCC37 }, -{ 0xCC38, 0xCC38, 0xCC38 }, -{ 0xCC39, 0xCC39, 0xCC39 }, -{ 0xCC3A, 0xCC3A, 0xCC3A }, -{ 0xCC3B, 0xCC3B, 0xCC3B }, -{ 0xCC3C, 0xCC3C, 0xCC3C }, -{ 0xCC3D, 0xCC3D, 0xCC3D }, -{ 0xCC3E, 0xCC3E, 0xCC3E }, -{ 0xCC3F, 0xCC3F, 0xCC3F }, -{ 0xCC40, 0xCC40, 0xCC40 }, -{ 0xCC41, 0xCC41, 0xCC41 }, -{ 0xCC42, 0xCC42, 0xCC42 }, -{ 0xCC43, 0xCC43, 0xCC43 }, -{ 0xCC44, 0xCC44, 0xCC44 }, -{ 0xCC45, 0xCC45, 0xCC45 }, -{ 0xCC46, 0xCC46, 0xCC46 }, -{ 0xCC47, 0xCC47, 0xCC47 }, -{ 0xCC48, 0xCC48, 0xCC48 }, -{ 0xCC49, 0xCC49, 0xCC49 }, -{ 0xCC4A, 0xCC4A, 0xCC4A }, -{ 0xCC4B, 0xCC4B, 0xCC4B }, -{ 0xCC4C, 0xCC4C, 0xCC4C }, -{ 0xCC4D, 0xCC4D, 0xCC4D }, -{ 0xCC4E, 0xCC4E, 0xCC4E }, -{ 0xCC4F, 0xCC4F, 0xCC4F }, -{ 0xCC50, 0xCC50, 0xCC50 }, -{ 0xCC51, 0xCC51, 0xCC51 }, -{ 0xCC52, 0xCC52, 0xCC52 }, -{ 0xCC53, 0xCC53, 0xCC53 }, -{ 0xCC54, 0xCC54, 0xCC54 }, -{ 0xCC55, 0xCC55, 0xCC55 }, -{ 0xCC56, 0xCC56, 0xCC56 }, -{ 0xCC57, 0xCC57, 0xCC57 }, -{ 0xCC58, 0xCC58, 0xCC58 }, -{ 0xCC59, 0xCC59, 0xCC59 }, -{ 0xCC5A, 0xCC5A, 0xCC5A }, -{ 0xCC5B, 0xCC5B, 0xCC5B }, -{ 0xCC5C, 0xCC5C, 0xCC5C }, -{ 0xCC5D, 0xCC5D, 0xCC5D }, -{ 0xCC5E, 0xCC5E, 0xCC5E }, -{ 0xCC5F, 0xCC5F, 0xCC5F }, -{ 0xCC60, 0xCC60, 0xCC60 }, -{ 0xCC61, 0xCC61, 0xCC61 }, -{ 0xCC62, 0xCC62, 0xCC62 }, -{ 0xCC63, 0xCC63, 0xCC63 }, -{ 0xCC64, 0xCC64, 0xCC64 }, -{ 0xCC65, 0xCC65, 0xCC65 }, -{ 0xCC66, 0xCC66, 0xCC66 }, -{ 0xCC67, 0xCC67, 0xCC67 }, -{ 0xCC68, 0xCC68, 0xCC68 }, -{ 0xCC69, 0xCC69, 0xCC69 }, -{ 0xCC6A, 0xCC6A, 0xCC6A }, -{ 0xCC6B, 0xCC6B, 0xCC6B }, -{ 0xCC6C, 0xCC6C, 0xCC6C }, -{ 0xCC6D, 0xCC6D, 0xCC6D }, -{ 0xCC6E, 0xCC6E, 0xCC6E }, -{ 0xCC6F, 0xCC6F, 0xCC6F }, -{ 0xCC70, 0xCC70, 0xCC70 }, -{ 0xCC71, 0xCC71, 0xCC71 }, -{ 0xCC72, 0xCC72, 0xCC72 }, -{ 0xCC73, 0xCC73, 0xCC73 }, -{ 0xCC74, 0xCC74, 0xCC74 }, -{ 0xCC75, 0xCC75, 0xCC75 }, -{ 0xCC76, 0xCC76, 0xCC76 }, -{ 0xCC77, 0xCC77, 0xCC77 }, -{ 0xCC78, 0xCC78, 0xCC78 }, -{ 0xCC79, 0xCC79, 0xCC79 }, -{ 0xCC7A, 0xCC7A, 0xCC7A }, -{ 0xCC7B, 0xCC7B, 0xCC7B }, -{ 0xCC7C, 0xCC7C, 0xCC7C }, -{ 0xCC7D, 0xCC7D, 0xCC7D }, -{ 0xCC7E, 0xCC7E, 0xCC7E }, -{ 0xCC7F, 0xCC7F, 0xCC7F }, -{ 0xCC80, 0xCC80, 0xCC80 }, -{ 0xCC81, 0xCC81, 0xCC81 }, -{ 0xCC82, 0xCC82, 0xCC82 }, -{ 0xCC83, 0xCC83, 0xCC83 }, -{ 0xCC84, 0xCC84, 0xCC84 }, -{ 0xCC85, 0xCC85, 0xCC85 }, -{ 0xCC86, 0xCC86, 0xCC86 }, -{ 0xCC87, 0xCC87, 0xCC87 }, -{ 0xCC88, 0xCC88, 0xCC88 }, -{ 0xCC89, 0xCC89, 0xCC89 }, -{ 0xCC8A, 0xCC8A, 0xCC8A }, -{ 0xCC8B, 0xCC8B, 0xCC8B }, -{ 0xCC8C, 0xCC8C, 0xCC8C }, -{ 0xCC8D, 0xCC8D, 0xCC8D }, -{ 0xCC8E, 0xCC8E, 0xCC8E }, -{ 0xCC8F, 0xCC8F, 0xCC8F }, -{ 0xCC90, 0xCC90, 0xCC90 }, -{ 0xCC91, 0xCC91, 0xCC91 }, -{ 0xCC92, 0xCC92, 0xCC92 }, -{ 0xCC93, 0xCC93, 0xCC93 }, -{ 0xCC94, 0xCC94, 0xCC94 }, -{ 0xCC95, 0xCC95, 0xCC95 }, -{ 0xCC96, 0xCC96, 0xCC96 }, -{ 0xCC97, 0xCC97, 0xCC97 }, -{ 0xCC98, 0xCC98, 0xCC98 }, -{ 0xCC99, 0xCC99, 0xCC99 }, -{ 0xCC9A, 0xCC9A, 0xCC9A }, -{ 0xCC9B, 0xCC9B, 0xCC9B }, -{ 0xCC9C, 0xCC9C, 0xCC9C }, -{ 0xCC9D, 0xCC9D, 0xCC9D }, -{ 0xCC9E, 0xCC9E, 0xCC9E }, -{ 0xCC9F, 0xCC9F, 0xCC9F }, -{ 0xCCA0, 0xCCA0, 0xCCA0 }, -{ 0xCCA1, 0xCCA1, 0xCCA1 }, -{ 0xCCA2, 0xCCA2, 0xCCA2 }, -{ 0xCCA3, 0xCCA3, 0xCCA3 }, -{ 0xCCA4, 0xCCA4, 0xCCA4 }, -{ 0xCCA5, 0xCCA5, 0xCCA5 }, -{ 0xCCA6, 0xCCA6, 0xCCA6 }, -{ 0xCCA7, 0xCCA7, 0xCCA7 }, -{ 0xCCA8, 0xCCA8, 0xCCA8 }, -{ 0xCCA9, 0xCCA9, 0xCCA9 }, -{ 0xCCAA, 0xCCAA, 0xCCAA }, -{ 0xCCAB, 0xCCAB, 0xCCAB }, -{ 0xCCAC, 0xCCAC, 0xCCAC }, -{ 0xCCAD, 0xCCAD, 0xCCAD }, -{ 0xCCAE, 0xCCAE, 0xCCAE }, -{ 0xCCAF, 0xCCAF, 0xCCAF }, -{ 0xCCB0, 0xCCB0, 0xCCB0 }, -{ 0xCCB1, 0xCCB1, 0xCCB1 }, -{ 0xCCB2, 0xCCB2, 0xCCB2 }, -{ 0xCCB3, 0xCCB3, 0xCCB3 }, -{ 0xCCB4, 0xCCB4, 0xCCB4 }, -{ 0xCCB5, 0xCCB5, 0xCCB5 }, -{ 0xCCB6, 0xCCB6, 0xCCB6 }, -{ 0xCCB7, 0xCCB7, 0xCCB7 }, -{ 0xCCB8, 0xCCB8, 0xCCB8 }, -{ 0xCCB9, 0xCCB9, 0xCCB9 }, -{ 0xCCBA, 0xCCBA, 0xCCBA }, -{ 0xCCBB, 0xCCBB, 0xCCBB }, -{ 0xCCBC, 0xCCBC, 0xCCBC }, -{ 0xCCBD, 0xCCBD, 0xCCBD }, -{ 0xCCBE, 0xCCBE, 0xCCBE }, -{ 0xCCBF, 0xCCBF, 0xCCBF }, -{ 0xCCC0, 0xCCC0, 0xCCC0 }, -{ 0xCCC1, 0xCCC1, 0xCCC1 }, -{ 0xCCC2, 0xCCC2, 0xCCC2 }, -{ 0xCCC3, 0xCCC3, 0xCCC3 }, -{ 0xCCC4, 0xCCC4, 0xCCC4 }, -{ 0xCCC5, 0xCCC5, 0xCCC5 }, -{ 0xCCC6, 0xCCC6, 0xCCC6 }, -{ 0xCCC7, 0xCCC7, 0xCCC7 }, -{ 0xCCC8, 0xCCC8, 0xCCC8 }, -{ 0xCCC9, 0xCCC9, 0xCCC9 }, -{ 0xCCCA, 0xCCCA, 0xCCCA }, -{ 0xCCCB, 0xCCCB, 0xCCCB }, -{ 0xCCCC, 0xCCCC, 0xCCCC }, -{ 0xCCCD, 0xCCCD, 0xCCCD }, -{ 0xCCCE, 0xCCCE, 0xCCCE }, -{ 0xCCCF, 0xCCCF, 0xCCCF }, -{ 0xCCD0, 0xCCD0, 0xCCD0 }, -{ 0xCCD1, 0xCCD1, 0xCCD1 }, -{ 0xCCD2, 0xCCD2, 0xCCD2 }, -{ 0xCCD3, 0xCCD3, 0xCCD3 }, -{ 0xCCD4, 0xCCD4, 0xCCD4 }, -{ 0xCCD5, 0xCCD5, 0xCCD5 }, -{ 0xCCD6, 0xCCD6, 0xCCD6 }, -{ 0xCCD7, 0xCCD7, 0xCCD7 }, -{ 0xCCD8, 0xCCD8, 0xCCD8 }, -{ 0xCCD9, 0xCCD9, 0xCCD9 }, -{ 0xCCDA, 0xCCDA, 0xCCDA }, -{ 0xCCDB, 0xCCDB, 0xCCDB }, -{ 0xCCDC, 0xCCDC, 0xCCDC }, -{ 0xCCDD, 0xCCDD, 0xCCDD }, -{ 0xCCDE, 0xCCDE, 0xCCDE }, -{ 0xCCDF, 0xCCDF, 0xCCDF }, -{ 0xCCE0, 0xCCE0, 0xCCE0 }, -{ 0xCCE1, 0xCCE1, 0xCCE1 }, -{ 0xCCE2, 0xCCE2, 0xCCE2 }, -{ 0xCCE3, 0xCCE3, 0xCCE3 }, -{ 0xCCE4, 0xCCE4, 0xCCE4 }, -{ 0xCCE5, 0xCCE5, 0xCCE5 }, -{ 0xCCE6, 0xCCE6, 0xCCE6 }, -{ 0xCCE7, 0xCCE7, 0xCCE7 }, -{ 0xCCE8, 0xCCE8, 0xCCE8 }, -{ 0xCCE9, 0xCCE9, 0xCCE9 }, -{ 0xCCEA, 0xCCEA, 0xCCEA }, -{ 0xCCEB, 0xCCEB, 0xCCEB }, -{ 0xCCEC, 0xCCEC, 0xCCEC }, -{ 0xCCED, 0xCCED, 0xCCED }, -{ 0xCCEE, 0xCCEE, 0xCCEE }, -{ 0xCCEF, 0xCCEF, 0xCCEF }, -{ 0xCCF0, 0xCCF0, 0xCCF0 }, -{ 0xCCF1, 0xCCF1, 0xCCF1 }, -{ 0xCCF2, 0xCCF2, 0xCCF2 }, -{ 0xCCF3, 0xCCF3, 0xCCF3 }, -{ 0xCCF4, 0xCCF4, 0xCCF4 }, -{ 0xCCF5, 0xCCF5, 0xCCF5 }, -{ 0xCCF6, 0xCCF6, 0xCCF6 }, -{ 0xCCF7, 0xCCF7, 0xCCF7 }, -{ 0xCCF8, 0xCCF8, 0xCCF8 }, -{ 0xCCF9, 0xCCF9, 0xCCF9 }, -{ 0xCCFA, 0xCCFA, 0xCCFA }, -{ 0xCCFB, 0xCCFB, 0xCCFB }, -{ 0xCCFC, 0xCCFC, 0xCCFC }, -{ 0xCCFD, 0xCCFD, 0xCCFD }, -{ 0xCCFE, 0xCCFE, 0xCCFE }, -{ 0xCCFF, 0xCCFF, 0xCCFF }, -{ 0xCD00, 0xCD00, 0xCD00 }, -{ 0xCD01, 0xCD01, 0xCD01 }, -{ 0xCD02, 0xCD02, 0xCD02 }, -{ 0xCD03, 0xCD03, 0xCD03 }, -{ 0xCD04, 0xCD04, 0xCD04 }, -{ 0xCD05, 0xCD05, 0xCD05 }, -{ 0xCD06, 0xCD06, 0xCD06 }, -{ 0xCD07, 0xCD07, 0xCD07 }, -{ 0xCD08, 0xCD08, 0xCD08 }, -{ 0xCD09, 0xCD09, 0xCD09 }, -{ 0xCD0A, 0xCD0A, 0xCD0A }, -{ 0xCD0B, 0xCD0B, 0xCD0B }, -{ 0xCD0C, 0xCD0C, 0xCD0C }, -{ 0xCD0D, 0xCD0D, 0xCD0D }, -{ 0xCD0E, 0xCD0E, 0xCD0E }, -{ 0xCD0F, 0xCD0F, 0xCD0F }, -{ 0xCD10, 0xCD10, 0xCD10 }, -{ 0xCD11, 0xCD11, 0xCD11 }, -{ 0xCD12, 0xCD12, 0xCD12 }, -{ 0xCD13, 0xCD13, 0xCD13 }, -{ 0xCD14, 0xCD14, 0xCD14 }, -{ 0xCD15, 0xCD15, 0xCD15 }, -{ 0xCD16, 0xCD16, 0xCD16 }, -{ 0xCD17, 0xCD17, 0xCD17 }, -{ 0xCD18, 0xCD18, 0xCD18 }, -{ 0xCD19, 0xCD19, 0xCD19 }, -{ 0xCD1A, 0xCD1A, 0xCD1A }, -{ 0xCD1B, 0xCD1B, 0xCD1B }, -{ 0xCD1C, 0xCD1C, 0xCD1C }, -{ 0xCD1D, 0xCD1D, 0xCD1D }, -{ 0xCD1E, 0xCD1E, 0xCD1E }, -{ 0xCD1F, 0xCD1F, 0xCD1F }, -{ 0xCD20, 0xCD20, 0xCD20 }, -{ 0xCD21, 0xCD21, 0xCD21 }, -{ 0xCD22, 0xCD22, 0xCD22 }, -{ 0xCD23, 0xCD23, 0xCD23 }, -{ 0xCD24, 0xCD24, 0xCD24 }, -{ 0xCD25, 0xCD25, 0xCD25 }, -{ 0xCD26, 0xCD26, 0xCD26 }, -{ 0xCD27, 0xCD27, 0xCD27 }, -{ 0xCD28, 0xCD28, 0xCD28 }, -{ 0xCD29, 0xCD29, 0xCD29 }, -{ 0xCD2A, 0xCD2A, 0xCD2A }, -{ 0xCD2B, 0xCD2B, 0xCD2B }, -{ 0xCD2C, 0xCD2C, 0xCD2C }, -{ 0xCD2D, 0xCD2D, 0xCD2D }, -{ 0xCD2E, 0xCD2E, 0xCD2E }, -{ 0xCD2F, 0xCD2F, 0xCD2F }, -{ 0xCD30, 0xCD30, 0xCD30 }, -{ 0xCD31, 0xCD31, 0xCD31 }, -{ 0xCD32, 0xCD32, 0xCD32 }, -{ 0xCD33, 0xCD33, 0xCD33 }, -{ 0xCD34, 0xCD34, 0xCD34 }, -{ 0xCD35, 0xCD35, 0xCD35 }, -{ 0xCD36, 0xCD36, 0xCD36 }, -{ 0xCD37, 0xCD37, 0xCD37 }, -{ 0xCD38, 0xCD38, 0xCD38 }, -{ 0xCD39, 0xCD39, 0xCD39 }, -{ 0xCD3A, 0xCD3A, 0xCD3A }, -{ 0xCD3B, 0xCD3B, 0xCD3B }, -{ 0xCD3C, 0xCD3C, 0xCD3C }, -{ 0xCD3D, 0xCD3D, 0xCD3D }, -{ 0xCD3E, 0xCD3E, 0xCD3E }, -{ 0xCD3F, 0xCD3F, 0xCD3F }, -{ 0xCD40, 0xCD40, 0xCD40 }, -{ 0xCD41, 0xCD41, 0xCD41 }, -{ 0xCD42, 0xCD42, 0xCD42 }, -{ 0xCD43, 0xCD43, 0xCD43 }, -{ 0xCD44, 0xCD44, 0xCD44 }, -{ 0xCD45, 0xCD45, 0xCD45 }, -{ 0xCD46, 0xCD46, 0xCD46 }, -{ 0xCD47, 0xCD47, 0xCD47 }, -{ 0xCD48, 0xCD48, 0xCD48 }, -{ 0xCD49, 0xCD49, 0xCD49 }, -{ 0xCD4A, 0xCD4A, 0xCD4A }, -{ 0xCD4B, 0xCD4B, 0xCD4B }, -{ 0xCD4C, 0xCD4C, 0xCD4C }, -{ 0xCD4D, 0xCD4D, 0xCD4D }, -{ 0xCD4E, 0xCD4E, 0xCD4E }, -{ 0xCD4F, 0xCD4F, 0xCD4F }, -{ 0xCD50, 0xCD50, 0xCD50 }, -{ 0xCD51, 0xCD51, 0xCD51 }, -{ 0xCD52, 0xCD52, 0xCD52 }, -{ 0xCD53, 0xCD53, 0xCD53 }, -{ 0xCD54, 0xCD54, 0xCD54 }, -{ 0xCD55, 0xCD55, 0xCD55 }, -{ 0xCD56, 0xCD56, 0xCD56 }, -{ 0xCD57, 0xCD57, 0xCD57 }, -{ 0xCD58, 0xCD58, 0xCD58 }, -{ 0xCD59, 0xCD59, 0xCD59 }, -{ 0xCD5A, 0xCD5A, 0xCD5A }, -{ 0xCD5B, 0xCD5B, 0xCD5B }, -{ 0xCD5C, 0xCD5C, 0xCD5C }, -{ 0xCD5D, 0xCD5D, 0xCD5D }, -{ 0xCD5E, 0xCD5E, 0xCD5E }, -{ 0xCD5F, 0xCD5F, 0xCD5F }, -{ 0xCD60, 0xCD60, 0xCD60 }, -{ 0xCD61, 0xCD61, 0xCD61 }, -{ 0xCD62, 0xCD62, 0xCD62 }, -{ 0xCD63, 0xCD63, 0xCD63 }, -{ 0xCD64, 0xCD64, 0xCD64 }, -{ 0xCD65, 0xCD65, 0xCD65 }, -{ 0xCD66, 0xCD66, 0xCD66 }, -{ 0xCD67, 0xCD67, 0xCD67 }, -{ 0xCD68, 0xCD68, 0xCD68 }, -{ 0xCD69, 0xCD69, 0xCD69 }, -{ 0xCD6A, 0xCD6A, 0xCD6A }, -{ 0xCD6B, 0xCD6B, 0xCD6B }, -{ 0xCD6C, 0xCD6C, 0xCD6C }, -{ 0xCD6D, 0xCD6D, 0xCD6D }, -{ 0xCD6E, 0xCD6E, 0xCD6E }, -{ 0xCD6F, 0xCD6F, 0xCD6F }, -{ 0xCD70, 0xCD70, 0xCD70 }, -{ 0xCD71, 0xCD71, 0xCD71 }, -{ 0xCD72, 0xCD72, 0xCD72 }, -{ 0xCD73, 0xCD73, 0xCD73 }, -{ 0xCD74, 0xCD74, 0xCD74 }, -{ 0xCD75, 0xCD75, 0xCD75 }, -{ 0xCD76, 0xCD76, 0xCD76 }, -{ 0xCD77, 0xCD77, 0xCD77 }, -{ 0xCD78, 0xCD78, 0xCD78 }, -{ 0xCD79, 0xCD79, 0xCD79 }, -{ 0xCD7A, 0xCD7A, 0xCD7A }, -{ 0xCD7B, 0xCD7B, 0xCD7B }, -{ 0xCD7C, 0xCD7C, 0xCD7C }, -{ 0xCD7D, 0xCD7D, 0xCD7D }, -{ 0xCD7E, 0xCD7E, 0xCD7E }, -{ 0xCD7F, 0xCD7F, 0xCD7F }, -{ 0xCD80, 0xCD80, 0xCD80 }, -{ 0xCD81, 0xCD81, 0xCD81 }, -{ 0xCD82, 0xCD82, 0xCD82 }, -{ 0xCD83, 0xCD83, 0xCD83 }, -{ 0xCD84, 0xCD84, 0xCD84 }, -{ 0xCD85, 0xCD85, 0xCD85 }, -{ 0xCD86, 0xCD86, 0xCD86 }, -{ 0xCD87, 0xCD87, 0xCD87 }, -{ 0xCD88, 0xCD88, 0xCD88 }, -{ 0xCD89, 0xCD89, 0xCD89 }, -{ 0xCD8A, 0xCD8A, 0xCD8A }, -{ 0xCD8B, 0xCD8B, 0xCD8B }, -{ 0xCD8C, 0xCD8C, 0xCD8C }, -{ 0xCD8D, 0xCD8D, 0xCD8D }, -{ 0xCD8E, 0xCD8E, 0xCD8E }, -{ 0xCD8F, 0xCD8F, 0xCD8F }, -{ 0xCD90, 0xCD90, 0xCD90 }, -{ 0xCD91, 0xCD91, 0xCD91 }, -{ 0xCD92, 0xCD92, 0xCD92 }, -{ 0xCD93, 0xCD93, 0xCD93 }, -{ 0xCD94, 0xCD94, 0xCD94 }, -{ 0xCD95, 0xCD95, 0xCD95 }, -{ 0xCD96, 0xCD96, 0xCD96 }, -{ 0xCD97, 0xCD97, 0xCD97 }, -{ 0xCD98, 0xCD98, 0xCD98 }, -{ 0xCD99, 0xCD99, 0xCD99 }, -{ 0xCD9A, 0xCD9A, 0xCD9A }, -{ 0xCD9B, 0xCD9B, 0xCD9B }, -{ 0xCD9C, 0xCD9C, 0xCD9C }, -{ 0xCD9D, 0xCD9D, 0xCD9D }, -{ 0xCD9E, 0xCD9E, 0xCD9E }, -{ 0xCD9F, 0xCD9F, 0xCD9F }, -{ 0xCDA0, 0xCDA0, 0xCDA0 }, -{ 0xCDA1, 0xCDA1, 0xCDA1 }, -{ 0xCDA2, 0xCDA2, 0xCDA2 }, -{ 0xCDA3, 0xCDA3, 0xCDA3 }, -{ 0xCDA4, 0xCDA4, 0xCDA4 }, -{ 0xCDA5, 0xCDA5, 0xCDA5 }, -{ 0xCDA6, 0xCDA6, 0xCDA6 }, -{ 0xCDA7, 0xCDA7, 0xCDA7 }, -{ 0xCDA8, 0xCDA8, 0xCDA8 }, -{ 0xCDA9, 0xCDA9, 0xCDA9 }, -{ 0xCDAA, 0xCDAA, 0xCDAA }, -{ 0xCDAB, 0xCDAB, 0xCDAB }, -{ 0xCDAC, 0xCDAC, 0xCDAC }, -{ 0xCDAD, 0xCDAD, 0xCDAD }, -{ 0xCDAE, 0xCDAE, 0xCDAE }, -{ 0xCDAF, 0xCDAF, 0xCDAF }, -{ 0xCDB0, 0xCDB0, 0xCDB0 }, -{ 0xCDB1, 0xCDB1, 0xCDB1 }, -{ 0xCDB2, 0xCDB2, 0xCDB2 }, -{ 0xCDB3, 0xCDB3, 0xCDB3 }, -{ 0xCDB4, 0xCDB4, 0xCDB4 }, -{ 0xCDB5, 0xCDB5, 0xCDB5 }, -{ 0xCDB6, 0xCDB6, 0xCDB6 }, -{ 0xCDB7, 0xCDB7, 0xCDB7 }, -{ 0xCDB8, 0xCDB8, 0xCDB8 }, -{ 0xCDB9, 0xCDB9, 0xCDB9 }, -{ 0xCDBA, 0xCDBA, 0xCDBA }, -{ 0xCDBB, 0xCDBB, 0xCDBB }, -{ 0xCDBC, 0xCDBC, 0xCDBC }, -{ 0xCDBD, 0xCDBD, 0xCDBD }, -{ 0xCDBE, 0xCDBE, 0xCDBE }, -{ 0xCDBF, 0xCDBF, 0xCDBF }, -{ 0xCDC0, 0xCDC0, 0xCDC0 }, -{ 0xCDC1, 0xCDC1, 0xCDC1 }, -{ 0xCDC2, 0xCDC2, 0xCDC2 }, -{ 0xCDC3, 0xCDC3, 0xCDC3 }, -{ 0xCDC4, 0xCDC4, 0xCDC4 }, -{ 0xCDC5, 0xCDC5, 0xCDC5 }, -{ 0xCDC6, 0xCDC6, 0xCDC6 }, -{ 0xCDC7, 0xCDC7, 0xCDC7 }, -{ 0xCDC8, 0xCDC8, 0xCDC8 }, -{ 0xCDC9, 0xCDC9, 0xCDC9 }, -{ 0xCDCA, 0xCDCA, 0xCDCA }, -{ 0xCDCB, 0xCDCB, 0xCDCB }, -{ 0xCDCC, 0xCDCC, 0xCDCC }, -{ 0xCDCD, 0xCDCD, 0xCDCD }, -{ 0xCDCE, 0xCDCE, 0xCDCE }, -{ 0xCDCF, 0xCDCF, 0xCDCF }, -{ 0xCDD0, 0xCDD0, 0xCDD0 }, -{ 0xCDD1, 0xCDD1, 0xCDD1 }, -{ 0xCDD2, 0xCDD2, 0xCDD2 }, -{ 0xCDD3, 0xCDD3, 0xCDD3 }, -{ 0xCDD4, 0xCDD4, 0xCDD4 }, -{ 0xCDD5, 0xCDD5, 0xCDD5 }, -{ 0xCDD6, 0xCDD6, 0xCDD6 }, -{ 0xCDD7, 0xCDD7, 0xCDD7 }, -{ 0xCDD8, 0xCDD8, 0xCDD8 }, -{ 0xCDD9, 0xCDD9, 0xCDD9 }, -{ 0xCDDA, 0xCDDA, 0xCDDA }, -{ 0xCDDB, 0xCDDB, 0xCDDB }, -{ 0xCDDC, 0xCDDC, 0xCDDC }, -{ 0xCDDD, 0xCDDD, 0xCDDD }, -{ 0xCDDE, 0xCDDE, 0xCDDE }, -{ 0xCDDF, 0xCDDF, 0xCDDF }, -{ 0xCDE0, 0xCDE0, 0xCDE0 }, -{ 0xCDE1, 0xCDE1, 0xCDE1 }, -{ 0xCDE2, 0xCDE2, 0xCDE2 }, -{ 0xCDE3, 0xCDE3, 0xCDE3 }, -{ 0xCDE4, 0xCDE4, 0xCDE4 }, -{ 0xCDE5, 0xCDE5, 0xCDE5 }, -{ 0xCDE6, 0xCDE6, 0xCDE6 }, -{ 0xCDE7, 0xCDE7, 0xCDE7 }, -{ 0xCDE8, 0xCDE8, 0xCDE8 }, -{ 0xCDE9, 0xCDE9, 0xCDE9 }, -{ 0xCDEA, 0xCDEA, 0xCDEA }, -{ 0xCDEB, 0xCDEB, 0xCDEB }, -{ 0xCDEC, 0xCDEC, 0xCDEC }, -{ 0xCDED, 0xCDED, 0xCDED }, -{ 0xCDEE, 0xCDEE, 0xCDEE }, -{ 0xCDEF, 0xCDEF, 0xCDEF }, -{ 0xCDF0, 0xCDF0, 0xCDF0 }, -{ 0xCDF1, 0xCDF1, 0xCDF1 }, -{ 0xCDF2, 0xCDF2, 0xCDF2 }, -{ 0xCDF3, 0xCDF3, 0xCDF3 }, -{ 0xCDF4, 0xCDF4, 0xCDF4 }, -{ 0xCDF5, 0xCDF5, 0xCDF5 }, -{ 0xCDF6, 0xCDF6, 0xCDF6 }, -{ 0xCDF7, 0xCDF7, 0xCDF7 }, -{ 0xCDF8, 0xCDF8, 0xCDF8 }, -{ 0xCDF9, 0xCDF9, 0xCDF9 }, -{ 0xCDFA, 0xCDFA, 0xCDFA }, -{ 0xCDFB, 0xCDFB, 0xCDFB }, -{ 0xCDFC, 0xCDFC, 0xCDFC }, -{ 0xCDFD, 0xCDFD, 0xCDFD }, -{ 0xCDFE, 0xCDFE, 0xCDFE }, -{ 0xCDFF, 0xCDFF, 0xCDFF }, -{ 0xCE00, 0xCE00, 0xCE00 }, -{ 0xCE01, 0xCE01, 0xCE01 }, -{ 0xCE02, 0xCE02, 0xCE02 }, -{ 0xCE03, 0xCE03, 0xCE03 }, -{ 0xCE04, 0xCE04, 0xCE04 }, -{ 0xCE05, 0xCE05, 0xCE05 }, -{ 0xCE06, 0xCE06, 0xCE06 }, -{ 0xCE07, 0xCE07, 0xCE07 }, -{ 0xCE08, 0xCE08, 0xCE08 }, -{ 0xCE09, 0xCE09, 0xCE09 }, -{ 0xCE0A, 0xCE0A, 0xCE0A }, -{ 0xCE0B, 0xCE0B, 0xCE0B }, -{ 0xCE0C, 0xCE0C, 0xCE0C }, -{ 0xCE0D, 0xCE0D, 0xCE0D }, -{ 0xCE0E, 0xCE0E, 0xCE0E }, -{ 0xCE0F, 0xCE0F, 0xCE0F }, -{ 0xCE10, 0xCE10, 0xCE10 }, -{ 0xCE11, 0xCE11, 0xCE11 }, -{ 0xCE12, 0xCE12, 0xCE12 }, -{ 0xCE13, 0xCE13, 0xCE13 }, -{ 0xCE14, 0xCE14, 0xCE14 }, -{ 0xCE15, 0xCE15, 0xCE15 }, -{ 0xCE16, 0xCE16, 0xCE16 }, -{ 0xCE17, 0xCE17, 0xCE17 }, -{ 0xCE18, 0xCE18, 0xCE18 }, -{ 0xCE19, 0xCE19, 0xCE19 }, -{ 0xCE1A, 0xCE1A, 0xCE1A }, -{ 0xCE1B, 0xCE1B, 0xCE1B }, -{ 0xCE1C, 0xCE1C, 0xCE1C }, -{ 0xCE1D, 0xCE1D, 0xCE1D }, -{ 0xCE1E, 0xCE1E, 0xCE1E }, -{ 0xCE1F, 0xCE1F, 0xCE1F }, -{ 0xCE20, 0xCE20, 0xCE20 }, -{ 0xCE21, 0xCE21, 0xCE21 }, -{ 0xCE22, 0xCE22, 0xCE22 }, -{ 0xCE23, 0xCE23, 0xCE23 }, -{ 0xCE24, 0xCE24, 0xCE24 }, -{ 0xCE25, 0xCE25, 0xCE25 }, -{ 0xCE26, 0xCE26, 0xCE26 }, -{ 0xCE27, 0xCE27, 0xCE27 }, -{ 0xCE28, 0xCE28, 0xCE28 }, -{ 0xCE29, 0xCE29, 0xCE29 }, -{ 0xCE2A, 0xCE2A, 0xCE2A }, -{ 0xCE2B, 0xCE2B, 0xCE2B }, -{ 0xCE2C, 0xCE2C, 0xCE2C }, -{ 0xCE2D, 0xCE2D, 0xCE2D }, -{ 0xCE2E, 0xCE2E, 0xCE2E }, -{ 0xCE2F, 0xCE2F, 0xCE2F }, -{ 0xCE30, 0xCE30, 0xCE30 }, -{ 0xCE31, 0xCE31, 0xCE31 }, -{ 0xCE32, 0xCE32, 0xCE32 }, -{ 0xCE33, 0xCE33, 0xCE33 }, -{ 0xCE34, 0xCE34, 0xCE34 }, -{ 0xCE35, 0xCE35, 0xCE35 }, -{ 0xCE36, 0xCE36, 0xCE36 }, -{ 0xCE37, 0xCE37, 0xCE37 }, -{ 0xCE38, 0xCE38, 0xCE38 }, -{ 0xCE39, 0xCE39, 0xCE39 }, -{ 0xCE3A, 0xCE3A, 0xCE3A }, -{ 0xCE3B, 0xCE3B, 0xCE3B }, -{ 0xCE3C, 0xCE3C, 0xCE3C }, -{ 0xCE3D, 0xCE3D, 0xCE3D }, -{ 0xCE3E, 0xCE3E, 0xCE3E }, -{ 0xCE3F, 0xCE3F, 0xCE3F }, -{ 0xCE40, 0xCE40, 0xCE40 }, -{ 0xCE41, 0xCE41, 0xCE41 }, -{ 0xCE42, 0xCE42, 0xCE42 }, -{ 0xCE43, 0xCE43, 0xCE43 }, -{ 0xCE44, 0xCE44, 0xCE44 }, -{ 0xCE45, 0xCE45, 0xCE45 }, -{ 0xCE46, 0xCE46, 0xCE46 }, -{ 0xCE47, 0xCE47, 0xCE47 }, -{ 0xCE48, 0xCE48, 0xCE48 }, -{ 0xCE49, 0xCE49, 0xCE49 }, -{ 0xCE4A, 0xCE4A, 0xCE4A }, -{ 0xCE4B, 0xCE4B, 0xCE4B }, -{ 0xCE4C, 0xCE4C, 0xCE4C }, -{ 0xCE4D, 0xCE4D, 0xCE4D }, -{ 0xCE4E, 0xCE4E, 0xCE4E }, -{ 0xCE4F, 0xCE4F, 0xCE4F }, -{ 0xCE50, 0xCE50, 0xCE50 }, -{ 0xCE51, 0xCE51, 0xCE51 }, -{ 0xCE52, 0xCE52, 0xCE52 }, -{ 0xCE53, 0xCE53, 0xCE53 }, -{ 0xCE54, 0xCE54, 0xCE54 }, -{ 0xCE55, 0xCE55, 0xCE55 }, -{ 0xCE56, 0xCE56, 0xCE56 }, -{ 0xCE57, 0xCE57, 0xCE57 }, -{ 0xCE58, 0xCE58, 0xCE58 }, -{ 0xCE59, 0xCE59, 0xCE59 }, -{ 0xCE5A, 0xCE5A, 0xCE5A }, -{ 0xCE5B, 0xCE5B, 0xCE5B }, -{ 0xCE5C, 0xCE5C, 0xCE5C }, -{ 0xCE5D, 0xCE5D, 0xCE5D }, -{ 0xCE5E, 0xCE5E, 0xCE5E }, -{ 0xCE5F, 0xCE5F, 0xCE5F }, -{ 0xCE60, 0xCE60, 0xCE60 }, -{ 0xCE61, 0xCE61, 0xCE61 }, -{ 0xCE62, 0xCE62, 0xCE62 }, -{ 0xCE63, 0xCE63, 0xCE63 }, -{ 0xCE64, 0xCE64, 0xCE64 }, -{ 0xCE65, 0xCE65, 0xCE65 }, -{ 0xCE66, 0xCE66, 0xCE66 }, -{ 0xCE67, 0xCE67, 0xCE67 }, -{ 0xCE68, 0xCE68, 0xCE68 }, -{ 0xCE69, 0xCE69, 0xCE69 }, -{ 0xCE6A, 0xCE6A, 0xCE6A }, -{ 0xCE6B, 0xCE6B, 0xCE6B }, -{ 0xCE6C, 0xCE6C, 0xCE6C }, -{ 0xCE6D, 0xCE6D, 0xCE6D }, -{ 0xCE6E, 0xCE6E, 0xCE6E }, -{ 0xCE6F, 0xCE6F, 0xCE6F }, -{ 0xCE70, 0xCE70, 0xCE70 }, -{ 0xCE71, 0xCE71, 0xCE71 }, -{ 0xCE72, 0xCE72, 0xCE72 }, -{ 0xCE73, 0xCE73, 0xCE73 }, -{ 0xCE74, 0xCE74, 0xCE74 }, -{ 0xCE75, 0xCE75, 0xCE75 }, -{ 0xCE76, 0xCE76, 0xCE76 }, -{ 0xCE77, 0xCE77, 0xCE77 }, -{ 0xCE78, 0xCE78, 0xCE78 }, -{ 0xCE79, 0xCE79, 0xCE79 }, -{ 0xCE7A, 0xCE7A, 0xCE7A }, -{ 0xCE7B, 0xCE7B, 0xCE7B }, -{ 0xCE7C, 0xCE7C, 0xCE7C }, -{ 0xCE7D, 0xCE7D, 0xCE7D }, -{ 0xCE7E, 0xCE7E, 0xCE7E }, -{ 0xCE7F, 0xCE7F, 0xCE7F }, -{ 0xCE80, 0xCE80, 0xCE80 }, -{ 0xCE81, 0xCE81, 0xCE81 }, -{ 0xCE82, 0xCE82, 0xCE82 }, -{ 0xCE83, 0xCE83, 0xCE83 }, -{ 0xCE84, 0xCE84, 0xCE84 }, -{ 0xCE85, 0xCE85, 0xCE85 }, -{ 0xCE86, 0xCE86, 0xCE86 }, -{ 0xCE87, 0xCE87, 0xCE87 }, -{ 0xCE88, 0xCE88, 0xCE88 }, -{ 0xCE89, 0xCE89, 0xCE89 }, -{ 0xCE8A, 0xCE8A, 0xCE8A }, -{ 0xCE8B, 0xCE8B, 0xCE8B }, -{ 0xCE8C, 0xCE8C, 0xCE8C }, -{ 0xCE8D, 0xCE8D, 0xCE8D }, -{ 0xCE8E, 0xCE8E, 0xCE8E }, -{ 0xCE8F, 0xCE8F, 0xCE8F }, -{ 0xCE90, 0xCE90, 0xCE90 }, -{ 0xCE91, 0xCE91, 0xCE91 }, -{ 0xCE92, 0xCE92, 0xCE92 }, -{ 0xCE93, 0xCE93, 0xCE93 }, -{ 0xCE94, 0xCE94, 0xCE94 }, -{ 0xCE95, 0xCE95, 0xCE95 }, -{ 0xCE96, 0xCE96, 0xCE96 }, -{ 0xCE97, 0xCE97, 0xCE97 }, -{ 0xCE98, 0xCE98, 0xCE98 }, -{ 0xCE99, 0xCE99, 0xCE99 }, -{ 0xCE9A, 0xCE9A, 0xCE9A }, -{ 0xCE9B, 0xCE9B, 0xCE9B }, -{ 0xCE9C, 0xCE9C, 0xCE9C }, -{ 0xCE9D, 0xCE9D, 0xCE9D }, -{ 0xCE9E, 0xCE9E, 0xCE9E }, -{ 0xCE9F, 0xCE9F, 0xCE9F }, -{ 0xCEA0, 0xCEA0, 0xCEA0 }, -{ 0xCEA1, 0xCEA1, 0xCEA1 }, -{ 0xCEA2, 0xCEA2, 0xCEA2 }, -{ 0xCEA3, 0xCEA3, 0xCEA3 }, -{ 0xCEA4, 0xCEA4, 0xCEA4 }, -{ 0xCEA5, 0xCEA5, 0xCEA5 }, -{ 0xCEA6, 0xCEA6, 0xCEA6 }, -{ 0xCEA7, 0xCEA7, 0xCEA7 }, -{ 0xCEA8, 0xCEA8, 0xCEA8 }, -{ 0xCEA9, 0xCEA9, 0xCEA9 }, -{ 0xCEAA, 0xCEAA, 0xCEAA }, -{ 0xCEAB, 0xCEAB, 0xCEAB }, -{ 0xCEAC, 0xCEAC, 0xCEAC }, -{ 0xCEAD, 0xCEAD, 0xCEAD }, -{ 0xCEAE, 0xCEAE, 0xCEAE }, -{ 0xCEAF, 0xCEAF, 0xCEAF }, -{ 0xCEB0, 0xCEB0, 0xCEB0 }, -{ 0xCEB1, 0xCEB1, 0xCEB1 }, -{ 0xCEB2, 0xCEB2, 0xCEB2 }, -{ 0xCEB3, 0xCEB3, 0xCEB3 }, -{ 0xCEB4, 0xCEB4, 0xCEB4 }, -{ 0xCEB5, 0xCEB5, 0xCEB5 }, -{ 0xCEB6, 0xCEB6, 0xCEB6 }, -{ 0xCEB7, 0xCEB7, 0xCEB7 }, -{ 0xCEB8, 0xCEB8, 0xCEB8 }, -{ 0xCEB9, 0xCEB9, 0xCEB9 }, -{ 0xCEBA, 0xCEBA, 0xCEBA }, -{ 0xCEBB, 0xCEBB, 0xCEBB }, -{ 0xCEBC, 0xCEBC, 0xCEBC }, -{ 0xCEBD, 0xCEBD, 0xCEBD }, -{ 0xCEBE, 0xCEBE, 0xCEBE }, -{ 0xCEBF, 0xCEBF, 0xCEBF }, -{ 0xCEC0, 0xCEC0, 0xCEC0 }, -{ 0xCEC1, 0xCEC1, 0xCEC1 }, -{ 0xCEC2, 0xCEC2, 0xCEC2 }, -{ 0xCEC3, 0xCEC3, 0xCEC3 }, -{ 0xCEC4, 0xCEC4, 0xCEC4 }, -{ 0xCEC5, 0xCEC5, 0xCEC5 }, -{ 0xCEC6, 0xCEC6, 0xCEC6 }, -{ 0xCEC7, 0xCEC7, 0xCEC7 }, -{ 0xCEC8, 0xCEC8, 0xCEC8 }, -{ 0xCEC9, 0xCEC9, 0xCEC9 }, -{ 0xCECA, 0xCECA, 0xCECA }, -{ 0xCECB, 0xCECB, 0xCECB }, -{ 0xCECC, 0xCECC, 0xCECC }, -{ 0xCECD, 0xCECD, 0xCECD }, -{ 0xCECE, 0xCECE, 0xCECE }, -{ 0xCECF, 0xCECF, 0xCECF }, -{ 0xCED0, 0xCED0, 0xCED0 }, -{ 0xCED1, 0xCED1, 0xCED1 }, -{ 0xCED2, 0xCED2, 0xCED2 }, -{ 0xCED3, 0xCED3, 0xCED3 }, -{ 0xCED4, 0xCED4, 0xCED4 }, -{ 0xCED5, 0xCED5, 0xCED5 }, -{ 0xCED6, 0xCED6, 0xCED6 }, -{ 0xCED7, 0xCED7, 0xCED7 }, -{ 0xCED8, 0xCED8, 0xCED8 }, -{ 0xCED9, 0xCED9, 0xCED9 }, -{ 0xCEDA, 0xCEDA, 0xCEDA }, -{ 0xCEDB, 0xCEDB, 0xCEDB }, -{ 0xCEDC, 0xCEDC, 0xCEDC }, -{ 0xCEDD, 0xCEDD, 0xCEDD }, -{ 0xCEDE, 0xCEDE, 0xCEDE }, -{ 0xCEDF, 0xCEDF, 0xCEDF }, -{ 0xCEE0, 0xCEE0, 0xCEE0 }, -{ 0xCEE1, 0xCEE1, 0xCEE1 }, -{ 0xCEE2, 0xCEE2, 0xCEE2 }, -{ 0xCEE3, 0xCEE3, 0xCEE3 }, -{ 0xCEE4, 0xCEE4, 0xCEE4 }, -{ 0xCEE5, 0xCEE5, 0xCEE5 }, -{ 0xCEE6, 0xCEE6, 0xCEE6 }, -{ 0xCEE7, 0xCEE7, 0xCEE7 }, -{ 0xCEE8, 0xCEE8, 0xCEE8 }, -{ 0xCEE9, 0xCEE9, 0xCEE9 }, -{ 0xCEEA, 0xCEEA, 0xCEEA }, -{ 0xCEEB, 0xCEEB, 0xCEEB }, -{ 0xCEEC, 0xCEEC, 0xCEEC }, -{ 0xCEED, 0xCEED, 0xCEED }, -{ 0xCEEE, 0xCEEE, 0xCEEE }, -{ 0xCEEF, 0xCEEF, 0xCEEF }, -{ 0xCEF0, 0xCEF0, 0xCEF0 }, -{ 0xCEF1, 0xCEF1, 0xCEF1 }, -{ 0xCEF2, 0xCEF2, 0xCEF2 }, -{ 0xCEF3, 0xCEF3, 0xCEF3 }, -{ 0xCEF4, 0xCEF4, 0xCEF4 }, -{ 0xCEF5, 0xCEF5, 0xCEF5 }, -{ 0xCEF6, 0xCEF6, 0xCEF6 }, -{ 0xCEF7, 0xCEF7, 0xCEF7 }, -{ 0xCEF8, 0xCEF8, 0xCEF8 }, -{ 0xCEF9, 0xCEF9, 0xCEF9 }, -{ 0xCEFA, 0xCEFA, 0xCEFA }, -{ 0xCEFB, 0xCEFB, 0xCEFB }, -{ 0xCEFC, 0xCEFC, 0xCEFC }, -{ 0xCEFD, 0xCEFD, 0xCEFD }, -{ 0xCEFE, 0xCEFE, 0xCEFE }, -{ 0xCEFF, 0xCEFF, 0xCEFF }, -{ 0xCF00, 0xCF00, 0xCF00 }, -{ 0xCF01, 0xCF01, 0xCF01 }, -{ 0xCF02, 0xCF02, 0xCF02 }, -{ 0xCF03, 0xCF03, 0xCF03 }, -{ 0xCF04, 0xCF04, 0xCF04 }, -{ 0xCF05, 0xCF05, 0xCF05 }, -{ 0xCF06, 0xCF06, 0xCF06 }, -{ 0xCF07, 0xCF07, 0xCF07 }, -{ 0xCF08, 0xCF08, 0xCF08 }, -{ 0xCF09, 0xCF09, 0xCF09 }, -{ 0xCF0A, 0xCF0A, 0xCF0A }, -{ 0xCF0B, 0xCF0B, 0xCF0B }, -{ 0xCF0C, 0xCF0C, 0xCF0C }, -{ 0xCF0D, 0xCF0D, 0xCF0D }, -{ 0xCF0E, 0xCF0E, 0xCF0E }, -{ 0xCF0F, 0xCF0F, 0xCF0F }, -{ 0xCF10, 0xCF10, 0xCF10 }, -{ 0xCF11, 0xCF11, 0xCF11 }, -{ 0xCF12, 0xCF12, 0xCF12 }, -{ 0xCF13, 0xCF13, 0xCF13 }, -{ 0xCF14, 0xCF14, 0xCF14 }, -{ 0xCF15, 0xCF15, 0xCF15 }, -{ 0xCF16, 0xCF16, 0xCF16 }, -{ 0xCF17, 0xCF17, 0xCF17 }, -{ 0xCF18, 0xCF18, 0xCF18 }, -{ 0xCF19, 0xCF19, 0xCF19 }, -{ 0xCF1A, 0xCF1A, 0xCF1A }, -{ 0xCF1B, 0xCF1B, 0xCF1B }, -{ 0xCF1C, 0xCF1C, 0xCF1C }, -{ 0xCF1D, 0xCF1D, 0xCF1D }, -{ 0xCF1E, 0xCF1E, 0xCF1E }, -{ 0xCF1F, 0xCF1F, 0xCF1F }, -{ 0xCF20, 0xCF20, 0xCF20 }, -{ 0xCF21, 0xCF21, 0xCF21 }, -{ 0xCF22, 0xCF22, 0xCF22 }, -{ 0xCF23, 0xCF23, 0xCF23 }, -{ 0xCF24, 0xCF24, 0xCF24 }, -{ 0xCF25, 0xCF25, 0xCF25 }, -{ 0xCF26, 0xCF26, 0xCF26 }, -{ 0xCF27, 0xCF27, 0xCF27 }, -{ 0xCF28, 0xCF28, 0xCF28 }, -{ 0xCF29, 0xCF29, 0xCF29 }, -{ 0xCF2A, 0xCF2A, 0xCF2A }, -{ 0xCF2B, 0xCF2B, 0xCF2B }, -{ 0xCF2C, 0xCF2C, 0xCF2C }, -{ 0xCF2D, 0xCF2D, 0xCF2D }, -{ 0xCF2E, 0xCF2E, 0xCF2E }, -{ 0xCF2F, 0xCF2F, 0xCF2F }, -{ 0xCF30, 0xCF30, 0xCF30 }, -{ 0xCF31, 0xCF31, 0xCF31 }, -{ 0xCF32, 0xCF32, 0xCF32 }, -{ 0xCF33, 0xCF33, 0xCF33 }, -{ 0xCF34, 0xCF34, 0xCF34 }, -{ 0xCF35, 0xCF35, 0xCF35 }, -{ 0xCF36, 0xCF36, 0xCF36 }, -{ 0xCF37, 0xCF37, 0xCF37 }, -{ 0xCF38, 0xCF38, 0xCF38 }, -{ 0xCF39, 0xCF39, 0xCF39 }, -{ 0xCF3A, 0xCF3A, 0xCF3A }, -{ 0xCF3B, 0xCF3B, 0xCF3B }, -{ 0xCF3C, 0xCF3C, 0xCF3C }, -{ 0xCF3D, 0xCF3D, 0xCF3D }, -{ 0xCF3E, 0xCF3E, 0xCF3E }, -{ 0xCF3F, 0xCF3F, 0xCF3F }, -{ 0xCF40, 0xCF40, 0xCF40 }, -{ 0xCF41, 0xCF41, 0xCF41 }, -{ 0xCF42, 0xCF42, 0xCF42 }, -{ 0xCF43, 0xCF43, 0xCF43 }, -{ 0xCF44, 0xCF44, 0xCF44 }, -{ 0xCF45, 0xCF45, 0xCF45 }, -{ 0xCF46, 0xCF46, 0xCF46 }, -{ 0xCF47, 0xCF47, 0xCF47 }, -{ 0xCF48, 0xCF48, 0xCF48 }, -{ 0xCF49, 0xCF49, 0xCF49 }, -{ 0xCF4A, 0xCF4A, 0xCF4A }, -{ 0xCF4B, 0xCF4B, 0xCF4B }, -{ 0xCF4C, 0xCF4C, 0xCF4C }, -{ 0xCF4D, 0xCF4D, 0xCF4D }, -{ 0xCF4E, 0xCF4E, 0xCF4E }, -{ 0xCF4F, 0xCF4F, 0xCF4F }, -{ 0xCF50, 0xCF50, 0xCF50 }, -{ 0xCF51, 0xCF51, 0xCF51 }, -{ 0xCF52, 0xCF52, 0xCF52 }, -{ 0xCF53, 0xCF53, 0xCF53 }, -{ 0xCF54, 0xCF54, 0xCF54 }, -{ 0xCF55, 0xCF55, 0xCF55 }, -{ 0xCF56, 0xCF56, 0xCF56 }, -{ 0xCF57, 0xCF57, 0xCF57 }, -{ 0xCF58, 0xCF58, 0xCF58 }, -{ 0xCF59, 0xCF59, 0xCF59 }, -{ 0xCF5A, 0xCF5A, 0xCF5A }, -{ 0xCF5B, 0xCF5B, 0xCF5B }, -{ 0xCF5C, 0xCF5C, 0xCF5C }, -{ 0xCF5D, 0xCF5D, 0xCF5D }, -{ 0xCF5E, 0xCF5E, 0xCF5E }, -{ 0xCF5F, 0xCF5F, 0xCF5F }, -{ 0xCF60, 0xCF60, 0xCF60 }, -{ 0xCF61, 0xCF61, 0xCF61 }, -{ 0xCF62, 0xCF62, 0xCF62 }, -{ 0xCF63, 0xCF63, 0xCF63 }, -{ 0xCF64, 0xCF64, 0xCF64 }, -{ 0xCF65, 0xCF65, 0xCF65 }, -{ 0xCF66, 0xCF66, 0xCF66 }, -{ 0xCF67, 0xCF67, 0xCF67 }, -{ 0xCF68, 0xCF68, 0xCF68 }, -{ 0xCF69, 0xCF69, 0xCF69 }, -{ 0xCF6A, 0xCF6A, 0xCF6A }, -{ 0xCF6B, 0xCF6B, 0xCF6B }, -{ 0xCF6C, 0xCF6C, 0xCF6C }, -{ 0xCF6D, 0xCF6D, 0xCF6D }, -{ 0xCF6E, 0xCF6E, 0xCF6E }, -{ 0xCF6F, 0xCF6F, 0xCF6F }, -{ 0xCF70, 0xCF70, 0xCF70 }, -{ 0xCF71, 0xCF71, 0xCF71 }, -{ 0xCF72, 0xCF72, 0xCF72 }, -{ 0xCF73, 0xCF73, 0xCF73 }, -{ 0xCF74, 0xCF74, 0xCF74 }, -{ 0xCF75, 0xCF75, 0xCF75 }, -{ 0xCF76, 0xCF76, 0xCF76 }, -{ 0xCF77, 0xCF77, 0xCF77 }, -{ 0xCF78, 0xCF78, 0xCF78 }, -{ 0xCF79, 0xCF79, 0xCF79 }, -{ 0xCF7A, 0xCF7A, 0xCF7A }, -{ 0xCF7B, 0xCF7B, 0xCF7B }, -{ 0xCF7C, 0xCF7C, 0xCF7C }, -{ 0xCF7D, 0xCF7D, 0xCF7D }, -{ 0xCF7E, 0xCF7E, 0xCF7E }, -{ 0xCF7F, 0xCF7F, 0xCF7F }, -{ 0xCF80, 0xCF80, 0xCF80 }, -{ 0xCF81, 0xCF81, 0xCF81 }, -{ 0xCF82, 0xCF82, 0xCF82 }, -{ 0xCF83, 0xCF83, 0xCF83 }, -{ 0xCF84, 0xCF84, 0xCF84 }, -{ 0xCF85, 0xCF85, 0xCF85 }, -{ 0xCF86, 0xCF86, 0xCF86 }, -{ 0xCF87, 0xCF87, 0xCF87 }, -{ 0xCF88, 0xCF88, 0xCF88 }, -{ 0xCF89, 0xCF89, 0xCF89 }, -{ 0xCF8A, 0xCF8A, 0xCF8A }, -{ 0xCF8B, 0xCF8B, 0xCF8B }, -{ 0xCF8C, 0xCF8C, 0xCF8C }, -{ 0xCF8D, 0xCF8D, 0xCF8D }, -{ 0xCF8E, 0xCF8E, 0xCF8E }, -{ 0xCF8F, 0xCF8F, 0xCF8F }, -{ 0xCF90, 0xCF90, 0xCF90 }, -{ 0xCF91, 0xCF91, 0xCF91 }, -{ 0xCF92, 0xCF92, 0xCF92 }, -{ 0xCF93, 0xCF93, 0xCF93 }, -{ 0xCF94, 0xCF94, 0xCF94 }, -{ 0xCF95, 0xCF95, 0xCF95 }, -{ 0xCF96, 0xCF96, 0xCF96 }, -{ 0xCF97, 0xCF97, 0xCF97 }, -{ 0xCF98, 0xCF98, 0xCF98 }, -{ 0xCF99, 0xCF99, 0xCF99 }, -{ 0xCF9A, 0xCF9A, 0xCF9A }, -{ 0xCF9B, 0xCF9B, 0xCF9B }, -{ 0xCF9C, 0xCF9C, 0xCF9C }, -{ 0xCF9D, 0xCF9D, 0xCF9D }, -{ 0xCF9E, 0xCF9E, 0xCF9E }, -{ 0xCF9F, 0xCF9F, 0xCF9F }, -{ 0xCFA0, 0xCFA0, 0xCFA0 }, -{ 0xCFA1, 0xCFA1, 0xCFA1 }, -{ 0xCFA2, 0xCFA2, 0xCFA2 }, -{ 0xCFA3, 0xCFA3, 0xCFA3 }, -{ 0xCFA4, 0xCFA4, 0xCFA4 }, -{ 0xCFA5, 0xCFA5, 0xCFA5 }, -{ 0xCFA6, 0xCFA6, 0xCFA6 }, -{ 0xCFA7, 0xCFA7, 0xCFA7 }, -{ 0xCFA8, 0xCFA8, 0xCFA8 }, -{ 0xCFA9, 0xCFA9, 0xCFA9 }, -{ 0xCFAA, 0xCFAA, 0xCFAA }, -{ 0xCFAB, 0xCFAB, 0xCFAB }, -{ 0xCFAC, 0xCFAC, 0xCFAC }, -{ 0xCFAD, 0xCFAD, 0xCFAD }, -{ 0xCFAE, 0xCFAE, 0xCFAE }, -{ 0xCFAF, 0xCFAF, 0xCFAF }, -{ 0xCFB0, 0xCFB0, 0xCFB0 }, -{ 0xCFB1, 0xCFB1, 0xCFB1 }, -{ 0xCFB2, 0xCFB2, 0xCFB2 }, -{ 0xCFB3, 0xCFB3, 0xCFB3 }, -{ 0xCFB4, 0xCFB4, 0xCFB4 }, -{ 0xCFB5, 0xCFB5, 0xCFB5 }, -{ 0xCFB6, 0xCFB6, 0xCFB6 }, -{ 0xCFB7, 0xCFB7, 0xCFB7 }, -{ 0xCFB8, 0xCFB8, 0xCFB8 }, -{ 0xCFB9, 0xCFB9, 0xCFB9 }, -{ 0xCFBA, 0xCFBA, 0xCFBA }, -{ 0xCFBB, 0xCFBB, 0xCFBB }, -{ 0xCFBC, 0xCFBC, 0xCFBC }, -{ 0xCFBD, 0xCFBD, 0xCFBD }, -{ 0xCFBE, 0xCFBE, 0xCFBE }, -{ 0xCFBF, 0xCFBF, 0xCFBF }, -{ 0xCFC0, 0xCFC0, 0xCFC0 }, -{ 0xCFC1, 0xCFC1, 0xCFC1 }, -{ 0xCFC2, 0xCFC2, 0xCFC2 }, -{ 0xCFC3, 0xCFC3, 0xCFC3 }, -{ 0xCFC4, 0xCFC4, 0xCFC4 }, -{ 0xCFC5, 0xCFC5, 0xCFC5 }, -{ 0xCFC6, 0xCFC6, 0xCFC6 }, -{ 0xCFC7, 0xCFC7, 0xCFC7 }, -{ 0xCFC8, 0xCFC8, 0xCFC8 }, -{ 0xCFC9, 0xCFC9, 0xCFC9 }, -{ 0xCFCA, 0xCFCA, 0xCFCA }, -{ 0xCFCB, 0xCFCB, 0xCFCB }, -{ 0xCFCC, 0xCFCC, 0xCFCC }, -{ 0xCFCD, 0xCFCD, 0xCFCD }, -{ 0xCFCE, 0xCFCE, 0xCFCE }, -{ 0xCFCF, 0xCFCF, 0xCFCF }, -{ 0xCFD0, 0xCFD0, 0xCFD0 }, -{ 0xCFD1, 0xCFD1, 0xCFD1 }, -{ 0xCFD2, 0xCFD2, 0xCFD2 }, -{ 0xCFD3, 0xCFD3, 0xCFD3 }, -{ 0xCFD4, 0xCFD4, 0xCFD4 }, -{ 0xCFD5, 0xCFD5, 0xCFD5 }, -{ 0xCFD6, 0xCFD6, 0xCFD6 }, -{ 0xCFD7, 0xCFD7, 0xCFD7 }, -{ 0xCFD8, 0xCFD8, 0xCFD8 }, -{ 0xCFD9, 0xCFD9, 0xCFD9 }, -{ 0xCFDA, 0xCFDA, 0xCFDA }, -{ 0xCFDB, 0xCFDB, 0xCFDB }, -{ 0xCFDC, 0xCFDC, 0xCFDC }, -{ 0xCFDD, 0xCFDD, 0xCFDD }, -{ 0xCFDE, 0xCFDE, 0xCFDE }, -{ 0xCFDF, 0xCFDF, 0xCFDF }, -{ 0xCFE0, 0xCFE0, 0xCFE0 }, -{ 0xCFE1, 0xCFE1, 0xCFE1 }, -{ 0xCFE2, 0xCFE2, 0xCFE2 }, -{ 0xCFE3, 0xCFE3, 0xCFE3 }, -{ 0xCFE4, 0xCFE4, 0xCFE4 }, -{ 0xCFE5, 0xCFE5, 0xCFE5 }, -{ 0xCFE6, 0xCFE6, 0xCFE6 }, -{ 0xCFE7, 0xCFE7, 0xCFE7 }, -{ 0xCFE8, 0xCFE8, 0xCFE8 }, -{ 0xCFE9, 0xCFE9, 0xCFE9 }, -{ 0xCFEA, 0xCFEA, 0xCFEA }, -{ 0xCFEB, 0xCFEB, 0xCFEB }, -{ 0xCFEC, 0xCFEC, 0xCFEC }, -{ 0xCFED, 0xCFED, 0xCFED }, -{ 0xCFEE, 0xCFEE, 0xCFEE }, -{ 0xCFEF, 0xCFEF, 0xCFEF }, -{ 0xCFF0, 0xCFF0, 0xCFF0 }, -{ 0xCFF1, 0xCFF1, 0xCFF1 }, -{ 0xCFF2, 0xCFF2, 0xCFF2 }, -{ 0xCFF3, 0xCFF3, 0xCFF3 }, -{ 0xCFF4, 0xCFF4, 0xCFF4 }, -{ 0xCFF5, 0xCFF5, 0xCFF5 }, -{ 0xCFF6, 0xCFF6, 0xCFF6 }, -{ 0xCFF7, 0xCFF7, 0xCFF7 }, -{ 0xCFF8, 0xCFF8, 0xCFF8 }, -{ 0xCFF9, 0xCFF9, 0xCFF9 }, -{ 0xCFFA, 0xCFFA, 0xCFFA }, -{ 0xCFFB, 0xCFFB, 0xCFFB }, -{ 0xCFFC, 0xCFFC, 0xCFFC }, -{ 0xCFFD, 0xCFFD, 0xCFFD }, -{ 0xCFFE, 0xCFFE, 0xCFFE }, -{ 0xCFFF, 0xCFFF, 0xCFFF }, -{ 0xD000, 0xD000, 0xD000 }, -{ 0xD001, 0xD001, 0xD001 }, -{ 0xD002, 0xD002, 0xD002 }, -{ 0xD003, 0xD003, 0xD003 }, -{ 0xD004, 0xD004, 0xD004 }, -{ 0xD005, 0xD005, 0xD005 }, -{ 0xD006, 0xD006, 0xD006 }, -{ 0xD007, 0xD007, 0xD007 }, -{ 0xD008, 0xD008, 0xD008 }, -{ 0xD009, 0xD009, 0xD009 }, -{ 0xD00A, 0xD00A, 0xD00A }, -{ 0xD00B, 0xD00B, 0xD00B }, -{ 0xD00C, 0xD00C, 0xD00C }, -{ 0xD00D, 0xD00D, 0xD00D }, -{ 0xD00E, 0xD00E, 0xD00E }, -{ 0xD00F, 0xD00F, 0xD00F }, -{ 0xD010, 0xD010, 0xD010 }, -{ 0xD011, 0xD011, 0xD011 }, -{ 0xD012, 0xD012, 0xD012 }, -{ 0xD013, 0xD013, 0xD013 }, -{ 0xD014, 0xD014, 0xD014 }, -{ 0xD015, 0xD015, 0xD015 }, -{ 0xD016, 0xD016, 0xD016 }, -{ 0xD017, 0xD017, 0xD017 }, -{ 0xD018, 0xD018, 0xD018 }, -{ 0xD019, 0xD019, 0xD019 }, -{ 0xD01A, 0xD01A, 0xD01A }, -{ 0xD01B, 0xD01B, 0xD01B }, -{ 0xD01C, 0xD01C, 0xD01C }, -{ 0xD01D, 0xD01D, 0xD01D }, -{ 0xD01E, 0xD01E, 0xD01E }, -{ 0xD01F, 0xD01F, 0xD01F }, -{ 0xD020, 0xD020, 0xD020 }, -{ 0xD021, 0xD021, 0xD021 }, -{ 0xD022, 0xD022, 0xD022 }, -{ 0xD023, 0xD023, 0xD023 }, -{ 0xD024, 0xD024, 0xD024 }, -{ 0xD025, 0xD025, 0xD025 }, -{ 0xD026, 0xD026, 0xD026 }, -{ 0xD027, 0xD027, 0xD027 }, -{ 0xD028, 0xD028, 0xD028 }, -{ 0xD029, 0xD029, 0xD029 }, -{ 0xD02A, 0xD02A, 0xD02A }, -{ 0xD02B, 0xD02B, 0xD02B }, -{ 0xD02C, 0xD02C, 0xD02C }, -{ 0xD02D, 0xD02D, 0xD02D }, -{ 0xD02E, 0xD02E, 0xD02E }, -{ 0xD02F, 0xD02F, 0xD02F }, -{ 0xD030, 0xD030, 0xD030 }, -{ 0xD031, 0xD031, 0xD031 }, -{ 0xD032, 0xD032, 0xD032 }, -{ 0xD033, 0xD033, 0xD033 }, -{ 0xD034, 0xD034, 0xD034 }, -{ 0xD035, 0xD035, 0xD035 }, -{ 0xD036, 0xD036, 0xD036 }, -{ 0xD037, 0xD037, 0xD037 }, -{ 0xD038, 0xD038, 0xD038 }, -{ 0xD039, 0xD039, 0xD039 }, -{ 0xD03A, 0xD03A, 0xD03A }, -{ 0xD03B, 0xD03B, 0xD03B }, -{ 0xD03C, 0xD03C, 0xD03C }, -{ 0xD03D, 0xD03D, 0xD03D }, -{ 0xD03E, 0xD03E, 0xD03E }, -{ 0xD03F, 0xD03F, 0xD03F }, -{ 0xD040, 0xD040, 0xD040 }, -{ 0xD041, 0xD041, 0xD041 }, -{ 0xD042, 0xD042, 0xD042 }, -{ 0xD043, 0xD043, 0xD043 }, -{ 0xD044, 0xD044, 0xD044 }, -{ 0xD045, 0xD045, 0xD045 }, -{ 0xD046, 0xD046, 0xD046 }, -{ 0xD047, 0xD047, 0xD047 }, -{ 0xD048, 0xD048, 0xD048 }, -{ 0xD049, 0xD049, 0xD049 }, -{ 0xD04A, 0xD04A, 0xD04A }, -{ 0xD04B, 0xD04B, 0xD04B }, -{ 0xD04C, 0xD04C, 0xD04C }, -{ 0xD04D, 0xD04D, 0xD04D }, -{ 0xD04E, 0xD04E, 0xD04E }, -{ 0xD04F, 0xD04F, 0xD04F }, -{ 0xD050, 0xD050, 0xD050 }, -{ 0xD051, 0xD051, 0xD051 }, -{ 0xD052, 0xD052, 0xD052 }, -{ 0xD053, 0xD053, 0xD053 }, -{ 0xD054, 0xD054, 0xD054 }, -{ 0xD055, 0xD055, 0xD055 }, -{ 0xD056, 0xD056, 0xD056 }, -{ 0xD057, 0xD057, 0xD057 }, -{ 0xD058, 0xD058, 0xD058 }, -{ 0xD059, 0xD059, 0xD059 }, -{ 0xD05A, 0xD05A, 0xD05A }, -{ 0xD05B, 0xD05B, 0xD05B }, -{ 0xD05C, 0xD05C, 0xD05C }, -{ 0xD05D, 0xD05D, 0xD05D }, -{ 0xD05E, 0xD05E, 0xD05E }, -{ 0xD05F, 0xD05F, 0xD05F }, -{ 0xD060, 0xD060, 0xD060 }, -{ 0xD061, 0xD061, 0xD061 }, -{ 0xD062, 0xD062, 0xD062 }, -{ 0xD063, 0xD063, 0xD063 }, -{ 0xD064, 0xD064, 0xD064 }, -{ 0xD065, 0xD065, 0xD065 }, -{ 0xD066, 0xD066, 0xD066 }, -{ 0xD067, 0xD067, 0xD067 }, -{ 0xD068, 0xD068, 0xD068 }, -{ 0xD069, 0xD069, 0xD069 }, -{ 0xD06A, 0xD06A, 0xD06A }, -{ 0xD06B, 0xD06B, 0xD06B }, -{ 0xD06C, 0xD06C, 0xD06C }, -{ 0xD06D, 0xD06D, 0xD06D }, -{ 0xD06E, 0xD06E, 0xD06E }, -{ 0xD06F, 0xD06F, 0xD06F }, -{ 0xD070, 0xD070, 0xD070 }, -{ 0xD071, 0xD071, 0xD071 }, -{ 0xD072, 0xD072, 0xD072 }, -{ 0xD073, 0xD073, 0xD073 }, -{ 0xD074, 0xD074, 0xD074 }, -{ 0xD075, 0xD075, 0xD075 }, -{ 0xD076, 0xD076, 0xD076 }, -{ 0xD077, 0xD077, 0xD077 }, -{ 0xD078, 0xD078, 0xD078 }, -{ 0xD079, 0xD079, 0xD079 }, -{ 0xD07A, 0xD07A, 0xD07A }, -{ 0xD07B, 0xD07B, 0xD07B }, -{ 0xD07C, 0xD07C, 0xD07C }, -{ 0xD07D, 0xD07D, 0xD07D }, -{ 0xD07E, 0xD07E, 0xD07E }, -{ 0xD07F, 0xD07F, 0xD07F }, -{ 0xD080, 0xD080, 0xD080 }, -{ 0xD081, 0xD081, 0xD081 }, -{ 0xD082, 0xD082, 0xD082 }, -{ 0xD083, 0xD083, 0xD083 }, -{ 0xD084, 0xD084, 0xD084 }, -{ 0xD085, 0xD085, 0xD085 }, -{ 0xD086, 0xD086, 0xD086 }, -{ 0xD087, 0xD087, 0xD087 }, -{ 0xD088, 0xD088, 0xD088 }, -{ 0xD089, 0xD089, 0xD089 }, -{ 0xD08A, 0xD08A, 0xD08A }, -{ 0xD08B, 0xD08B, 0xD08B }, -{ 0xD08C, 0xD08C, 0xD08C }, -{ 0xD08D, 0xD08D, 0xD08D }, -{ 0xD08E, 0xD08E, 0xD08E }, -{ 0xD08F, 0xD08F, 0xD08F }, -{ 0xD090, 0xD090, 0xD090 }, -{ 0xD091, 0xD091, 0xD091 }, -{ 0xD092, 0xD092, 0xD092 }, -{ 0xD093, 0xD093, 0xD093 }, -{ 0xD094, 0xD094, 0xD094 }, -{ 0xD095, 0xD095, 0xD095 }, -{ 0xD096, 0xD096, 0xD096 }, -{ 0xD097, 0xD097, 0xD097 }, -{ 0xD098, 0xD098, 0xD098 }, -{ 0xD099, 0xD099, 0xD099 }, -{ 0xD09A, 0xD09A, 0xD09A }, -{ 0xD09B, 0xD09B, 0xD09B }, -{ 0xD09C, 0xD09C, 0xD09C }, -{ 0xD09D, 0xD09D, 0xD09D }, -{ 0xD09E, 0xD09E, 0xD09E }, -{ 0xD09F, 0xD09F, 0xD09F }, -{ 0xD0A0, 0xD0A0, 0xD0A0 }, -{ 0xD0A1, 0xD0A1, 0xD0A1 }, -{ 0xD0A2, 0xD0A2, 0xD0A2 }, -{ 0xD0A3, 0xD0A3, 0xD0A3 }, -{ 0xD0A4, 0xD0A4, 0xD0A4 }, -{ 0xD0A5, 0xD0A5, 0xD0A5 }, -{ 0xD0A6, 0xD0A6, 0xD0A6 }, -{ 0xD0A7, 0xD0A7, 0xD0A7 }, -{ 0xD0A8, 0xD0A8, 0xD0A8 }, -{ 0xD0A9, 0xD0A9, 0xD0A9 }, -{ 0xD0AA, 0xD0AA, 0xD0AA }, -{ 0xD0AB, 0xD0AB, 0xD0AB }, -{ 0xD0AC, 0xD0AC, 0xD0AC }, -{ 0xD0AD, 0xD0AD, 0xD0AD }, -{ 0xD0AE, 0xD0AE, 0xD0AE }, -{ 0xD0AF, 0xD0AF, 0xD0AF }, -{ 0xD0B0, 0xD0B0, 0xD0B0 }, -{ 0xD0B1, 0xD0B1, 0xD0B1 }, -{ 0xD0B2, 0xD0B2, 0xD0B2 }, -{ 0xD0B3, 0xD0B3, 0xD0B3 }, -{ 0xD0B4, 0xD0B4, 0xD0B4 }, -{ 0xD0B5, 0xD0B5, 0xD0B5 }, -{ 0xD0B6, 0xD0B6, 0xD0B6 }, -{ 0xD0B7, 0xD0B7, 0xD0B7 }, -{ 0xD0B8, 0xD0B8, 0xD0B8 }, -{ 0xD0B9, 0xD0B9, 0xD0B9 }, -{ 0xD0BA, 0xD0BA, 0xD0BA }, -{ 0xD0BB, 0xD0BB, 0xD0BB }, -{ 0xD0BC, 0xD0BC, 0xD0BC }, -{ 0xD0BD, 0xD0BD, 0xD0BD }, -{ 0xD0BE, 0xD0BE, 0xD0BE }, -{ 0xD0BF, 0xD0BF, 0xD0BF }, -{ 0xD0C0, 0xD0C0, 0xD0C0 }, -{ 0xD0C1, 0xD0C1, 0xD0C1 }, -{ 0xD0C2, 0xD0C2, 0xD0C2 }, -{ 0xD0C3, 0xD0C3, 0xD0C3 }, -{ 0xD0C4, 0xD0C4, 0xD0C4 }, -{ 0xD0C5, 0xD0C5, 0xD0C5 }, -{ 0xD0C6, 0xD0C6, 0xD0C6 }, -{ 0xD0C7, 0xD0C7, 0xD0C7 }, -{ 0xD0C8, 0xD0C8, 0xD0C8 }, -{ 0xD0C9, 0xD0C9, 0xD0C9 }, -{ 0xD0CA, 0xD0CA, 0xD0CA }, -{ 0xD0CB, 0xD0CB, 0xD0CB }, -{ 0xD0CC, 0xD0CC, 0xD0CC }, -{ 0xD0CD, 0xD0CD, 0xD0CD }, -{ 0xD0CE, 0xD0CE, 0xD0CE }, -{ 0xD0CF, 0xD0CF, 0xD0CF }, -{ 0xD0D0, 0xD0D0, 0xD0D0 }, -{ 0xD0D1, 0xD0D1, 0xD0D1 }, -{ 0xD0D2, 0xD0D2, 0xD0D2 }, -{ 0xD0D3, 0xD0D3, 0xD0D3 }, -{ 0xD0D4, 0xD0D4, 0xD0D4 }, -{ 0xD0D5, 0xD0D5, 0xD0D5 }, -{ 0xD0D6, 0xD0D6, 0xD0D6 }, -{ 0xD0D7, 0xD0D7, 0xD0D7 }, -{ 0xD0D8, 0xD0D8, 0xD0D8 }, -{ 0xD0D9, 0xD0D9, 0xD0D9 }, -{ 0xD0DA, 0xD0DA, 0xD0DA }, -{ 0xD0DB, 0xD0DB, 0xD0DB }, -{ 0xD0DC, 0xD0DC, 0xD0DC }, -{ 0xD0DD, 0xD0DD, 0xD0DD }, -{ 0xD0DE, 0xD0DE, 0xD0DE }, -{ 0xD0DF, 0xD0DF, 0xD0DF }, -{ 0xD0E0, 0xD0E0, 0xD0E0 }, -{ 0xD0E1, 0xD0E1, 0xD0E1 }, -{ 0xD0E2, 0xD0E2, 0xD0E2 }, -{ 0xD0E3, 0xD0E3, 0xD0E3 }, -{ 0xD0E4, 0xD0E4, 0xD0E4 }, -{ 0xD0E5, 0xD0E5, 0xD0E5 }, -{ 0xD0E6, 0xD0E6, 0xD0E6 }, -{ 0xD0E7, 0xD0E7, 0xD0E7 }, -{ 0xD0E8, 0xD0E8, 0xD0E8 }, -{ 0xD0E9, 0xD0E9, 0xD0E9 }, -{ 0xD0EA, 0xD0EA, 0xD0EA }, -{ 0xD0EB, 0xD0EB, 0xD0EB }, -{ 0xD0EC, 0xD0EC, 0xD0EC }, -{ 0xD0ED, 0xD0ED, 0xD0ED }, -{ 0xD0EE, 0xD0EE, 0xD0EE }, -{ 0xD0EF, 0xD0EF, 0xD0EF }, -{ 0xD0F0, 0xD0F0, 0xD0F0 }, -{ 0xD0F1, 0xD0F1, 0xD0F1 }, -{ 0xD0F2, 0xD0F2, 0xD0F2 }, -{ 0xD0F3, 0xD0F3, 0xD0F3 }, -{ 0xD0F4, 0xD0F4, 0xD0F4 }, -{ 0xD0F5, 0xD0F5, 0xD0F5 }, -{ 0xD0F6, 0xD0F6, 0xD0F6 }, -{ 0xD0F7, 0xD0F7, 0xD0F7 }, -{ 0xD0F8, 0xD0F8, 0xD0F8 }, -{ 0xD0F9, 0xD0F9, 0xD0F9 }, -{ 0xD0FA, 0xD0FA, 0xD0FA }, -{ 0xD0FB, 0xD0FB, 0xD0FB }, -{ 0xD0FC, 0xD0FC, 0xD0FC }, -{ 0xD0FD, 0xD0FD, 0xD0FD }, -{ 0xD0FE, 0xD0FE, 0xD0FE }, -{ 0xD0FF, 0xD0FF, 0xD0FF }, -{ 0xD100, 0xD100, 0xD100 }, -{ 0xD101, 0xD101, 0xD101 }, -{ 0xD102, 0xD102, 0xD102 }, -{ 0xD103, 0xD103, 0xD103 }, -{ 0xD104, 0xD104, 0xD104 }, -{ 0xD105, 0xD105, 0xD105 }, -{ 0xD106, 0xD106, 0xD106 }, -{ 0xD107, 0xD107, 0xD107 }, -{ 0xD108, 0xD108, 0xD108 }, -{ 0xD109, 0xD109, 0xD109 }, -{ 0xD10A, 0xD10A, 0xD10A }, -{ 0xD10B, 0xD10B, 0xD10B }, -{ 0xD10C, 0xD10C, 0xD10C }, -{ 0xD10D, 0xD10D, 0xD10D }, -{ 0xD10E, 0xD10E, 0xD10E }, -{ 0xD10F, 0xD10F, 0xD10F }, -{ 0xD110, 0xD110, 0xD110 }, -{ 0xD111, 0xD111, 0xD111 }, -{ 0xD112, 0xD112, 0xD112 }, -{ 0xD113, 0xD113, 0xD113 }, -{ 0xD114, 0xD114, 0xD114 }, -{ 0xD115, 0xD115, 0xD115 }, -{ 0xD116, 0xD116, 0xD116 }, -{ 0xD117, 0xD117, 0xD117 }, -{ 0xD118, 0xD118, 0xD118 }, -{ 0xD119, 0xD119, 0xD119 }, -{ 0xD11A, 0xD11A, 0xD11A }, -{ 0xD11B, 0xD11B, 0xD11B }, -{ 0xD11C, 0xD11C, 0xD11C }, -{ 0xD11D, 0xD11D, 0xD11D }, -{ 0xD11E, 0xD11E, 0xD11E }, -{ 0xD11F, 0xD11F, 0xD11F }, -{ 0xD120, 0xD120, 0xD120 }, -{ 0xD121, 0xD121, 0xD121 }, -{ 0xD122, 0xD122, 0xD122 }, -{ 0xD123, 0xD123, 0xD123 }, -{ 0xD124, 0xD124, 0xD124 }, -{ 0xD125, 0xD125, 0xD125 }, -{ 0xD126, 0xD126, 0xD126 }, -{ 0xD127, 0xD127, 0xD127 }, -{ 0xD128, 0xD128, 0xD128 }, -{ 0xD129, 0xD129, 0xD129 }, -{ 0xD12A, 0xD12A, 0xD12A }, -{ 0xD12B, 0xD12B, 0xD12B }, -{ 0xD12C, 0xD12C, 0xD12C }, -{ 0xD12D, 0xD12D, 0xD12D }, -{ 0xD12E, 0xD12E, 0xD12E }, -{ 0xD12F, 0xD12F, 0xD12F }, -{ 0xD130, 0xD130, 0xD130 }, -{ 0xD131, 0xD131, 0xD131 }, -{ 0xD132, 0xD132, 0xD132 }, -{ 0xD133, 0xD133, 0xD133 }, -{ 0xD134, 0xD134, 0xD134 }, -{ 0xD135, 0xD135, 0xD135 }, -{ 0xD136, 0xD136, 0xD136 }, -{ 0xD137, 0xD137, 0xD137 }, -{ 0xD138, 0xD138, 0xD138 }, -{ 0xD139, 0xD139, 0xD139 }, -{ 0xD13A, 0xD13A, 0xD13A }, -{ 0xD13B, 0xD13B, 0xD13B }, -{ 0xD13C, 0xD13C, 0xD13C }, -{ 0xD13D, 0xD13D, 0xD13D }, -{ 0xD13E, 0xD13E, 0xD13E }, -{ 0xD13F, 0xD13F, 0xD13F }, -{ 0xD140, 0xD140, 0xD140 }, -{ 0xD141, 0xD141, 0xD141 }, -{ 0xD142, 0xD142, 0xD142 }, -{ 0xD143, 0xD143, 0xD143 }, -{ 0xD144, 0xD144, 0xD144 }, -{ 0xD145, 0xD145, 0xD145 }, -{ 0xD146, 0xD146, 0xD146 }, -{ 0xD147, 0xD147, 0xD147 }, -{ 0xD148, 0xD148, 0xD148 }, -{ 0xD149, 0xD149, 0xD149 }, -{ 0xD14A, 0xD14A, 0xD14A }, -{ 0xD14B, 0xD14B, 0xD14B }, -{ 0xD14C, 0xD14C, 0xD14C }, -{ 0xD14D, 0xD14D, 0xD14D }, -{ 0xD14E, 0xD14E, 0xD14E }, -{ 0xD14F, 0xD14F, 0xD14F }, -{ 0xD150, 0xD150, 0xD150 }, -{ 0xD151, 0xD151, 0xD151 }, -{ 0xD152, 0xD152, 0xD152 }, -{ 0xD153, 0xD153, 0xD153 }, -{ 0xD154, 0xD154, 0xD154 }, -{ 0xD155, 0xD155, 0xD155 }, -{ 0xD156, 0xD156, 0xD156 }, -{ 0xD157, 0xD157, 0xD157 }, -{ 0xD158, 0xD158, 0xD158 }, -{ 0xD159, 0xD159, 0xD159 }, -{ 0xD15A, 0xD15A, 0xD15A }, -{ 0xD15B, 0xD15B, 0xD15B }, -{ 0xD15C, 0xD15C, 0xD15C }, -{ 0xD15D, 0xD15D, 0xD15D }, -{ 0xD15E, 0xD15E, 0xD15E }, -{ 0xD15F, 0xD15F, 0xD15F }, -{ 0xD160, 0xD160, 0xD160 }, -{ 0xD161, 0xD161, 0xD161 }, -{ 0xD162, 0xD162, 0xD162 }, -{ 0xD163, 0xD163, 0xD163 }, -{ 0xD164, 0xD164, 0xD164 }, -{ 0xD165, 0xD165, 0xD165 }, -{ 0xD166, 0xD166, 0xD166 }, -{ 0xD167, 0xD167, 0xD167 }, -{ 0xD168, 0xD168, 0xD168 }, -{ 0xD169, 0xD169, 0xD169 }, -{ 0xD16A, 0xD16A, 0xD16A }, -{ 0xD16B, 0xD16B, 0xD16B }, -{ 0xD16C, 0xD16C, 0xD16C }, -{ 0xD16D, 0xD16D, 0xD16D }, -{ 0xD16E, 0xD16E, 0xD16E }, -{ 0xD16F, 0xD16F, 0xD16F }, -{ 0xD170, 0xD170, 0xD170 }, -{ 0xD171, 0xD171, 0xD171 }, -{ 0xD172, 0xD172, 0xD172 }, -{ 0xD173, 0xD173, 0xD173 }, -{ 0xD174, 0xD174, 0xD174 }, -{ 0xD175, 0xD175, 0xD175 }, -{ 0xD176, 0xD176, 0xD176 }, -{ 0xD177, 0xD177, 0xD177 }, -{ 0xD178, 0xD178, 0xD178 }, -{ 0xD179, 0xD179, 0xD179 }, -{ 0xD17A, 0xD17A, 0xD17A }, -{ 0xD17B, 0xD17B, 0xD17B }, -{ 0xD17C, 0xD17C, 0xD17C }, -{ 0xD17D, 0xD17D, 0xD17D }, -{ 0xD17E, 0xD17E, 0xD17E }, -{ 0xD17F, 0xD17F, 0xD17F }, -{ 0xD180, 0xD180, 0xD180 }, -{ 0xD181, 0xD181, 0xD181 }, -{ 0xD182, 0xD182, 0xD182 }, -{ 0xD183, 0xD183, 0xD183 }, -{ 0xD184, 0xD184, 0xD184 }, -{ 0xD185, 0xD185, 0xD185 }, -{ 0xD186, 0xD186, 0xD186 }, -{ 0xD187, 0xD187, 0xD187 }, -{ 0xD188, 0xD188, 0xD188 }, -{ 0xD189, 0xD189, 0xD189 }, -{ 0xD18A, 0xD18A, 0xD18A }, -{ 0xD18B, 0xD18B, 0xD18B }, -{ 0xD18C, 0xD18C, 0xD18C }, -{ 0xD18D, 0xD18D, 0xD18D }, -{ 0xD18E, 0xD18E, 0xD18E }, -{ 0xD18F, 0xD18F, 0xD18F }, -{ 0xD190, 0xD190, 0xD190 }, -{ 0xD191, 0xD191, 0xD191 }, -{ 0xD192, 0xD192, 0xD192 }, -{ 0xD193, 0xD193, 0xD193 }, -{ 0xD194, 0xD194, 0xD194 }, -{ 0xD195, 0xD195, 0xD195 }, -{ 0xD196, 0xD196, 0xD196 }, -{ 0xD197, 0xD197, 0xD197 }, -{ 0xD198, 0xD198, 0xD198 }, -{ 0xD199, 0xD199, 0xD199 }, -{ 0xD19A, 0xD19A, 0xD19A }, -{ 0xD19B, 0xD19B, 0xD19B }, -{ 0xD19C, 0xD19C, 0xD19C }, -{ 0xD19D, 0xD19D, 0xD19D }, -{ 0xD19E, 0xD19E, 0xD19E }, -{ 0xD19F, 0xD19F, 0xD19F }, -{ 0xD1A0, 0xD1A0, 0xD1A0 }, -{ 0xD1A1, 0xD1A1, 0xD1A1 }, -{ 0xD1A2, 0xD1A2, 0xD1A2 }, -{ 0xD1A3, 0xD1A3, 0xD1A3 }, -{ 0xD1A4, 0xD1A4, 0xD1A4 }, -{ 0xD1A5, 0xD1A5, 0xD1A5 }, -{ 0xD1A6, 0xD1A6, 0xD1A6 }, -{ 0xD1A7, 0xD1A7, 0xD1A7 }, -{ 0xD1A8, 0xD1A8, 0xD1A8 }, -{ 0xD1A9, 0xD1A9, 0xD1A9 }, -{ 0xD1AA, 0xD1AA, 0xD1AA }, -{ 0xD1AB, 0xD1AB, 0xD1AB }, -{ 0xD1AC, 0xD1AC, 0xD1AC }, -{ 0xD1AD, 0xD1AD, 0xD1AD }, -{ 0xD1AE, 0xD1AE, 0xD1AE }, -{ 0xD1AF, 0xD1AF, 0xD1AF }, -{ 0xD1B0, 0xD1B0, 0xD1B0 }, -{ 0xD1B1, 0xD1B1, 0xD1B1 }, -{ 0xD1B2, 0xD1B2, 0xD1B2 }, -{ 0xD1B3, 0xD1B3, 0xD1B3 }, -{ 0xD1B4, 0xD1B4, 0xD1B4 }, -{ 0xD1B5, 0xD1B5, 0xD1B5 }, -{ 0xD1B6, 0xD1B6, 0xD1B6 }, -{ 0xD1B7, 0xD1B7, 0xD1B7 }, -{ 0xD1B8, 0xD1B8, 0xD1B8 }, -{ 0xD1B9, 0xD1B9, 0xD1B9 }, -{ 0xD1BA, 0xD1BA, 0xD1BA }, -{ 0xD1BB, 0xD1BB, 0xD1BB }, -{ 0xD1BC, 0xD1BC, 0xD1BC }, -{ 0xD1BD, 0xD1BD, 0xD1BD }, -{ 0xD1BE, 0xD1BE, 0xD1BE }, -{ 0xD1BF, 0xD1BF, 0xD1BF }, -{ 0xD1C0, 0xD1C0, 0xD1C0 }, -{ 0xD1C1, 0xD1C1, 0xD1C1 }, -{ 0xD1C2, 0xD1C2, 0xD1C2 }, -{ 0xD1C3, 0xD1C3, 0xD1C3 }, -{ 0xD1C4, 0xD1C4, 0xD1C4 }, -{ 0xD1C5, 0xD1C5, 0xD1C5 }, -{ 0xD1C6, 0xD1C6, 0xD1C6 }, -{ 0xD1C7, 0xD1C7, 0xD1C7 }, -{ 0xD1C8, 0xD1C8, 0xD1C8 }, -{ 0xD1C9, 0xD1C9, 0xD1C9 }, -{ 0xD1CA, 0xD1CA, 0xD1CA }, -{ 0xD1CB, 0xD1CB, 0xD1CB }, -{ 0xD1CC, 0xD1CC, 0xD1CC }, -{ 0xD1CD, 0xD1CD, 0xD1CD }, -{ 0xD1CE, 0xD1CE, 0xD1CE }, -{ 0xD1CF, 0xD1CF, 0xD1CF }, -{ 0xD1D0, 0xD1D0, 0xD1D0 }, -{ 0xD1D1, 0xD1D1, 0xD1D1 }, -{ 0xD1D2, 0xD1D2, 0xD1D2 }, -{ 0xD1D3, 0xD1D3, 0xD1D3 }, -{ 0xD1D4, 0xD1D4, 0xD1D4 }, -{ 0xD1D5, 0xD1D5, 0xD1D5 }, -{ 0xD1D6, 0xD1D6, 0xD1D6 }, -{ 0xD1D7, 0xD1D7, 0xD1D7 }, -{ 0xD1D8, 0xD1D8, 0xD1D8 }, -{ 0xD1D9, 0xD1D9, 0xD1D9 }, -{ 0xD1DA, 0xD1DA, 0xD1DA }, -{ 0xD1DB, 0xD1DB, 0xD1DB }, -{ 0xD1DC, 0xD1DC, 0xD1DC }, -{ 0xD1DD, 0xD1DD, 0xD1DD }, -{ 0xD1DE, 0xD1DE, 0xD1DE }, -{ 0xD1DF, 0xD1DF, 0xD1DF }, -{ 0xD1E0, 0xD1E0, 0xD1E0 }, -{ 0xD1E1, 0xD1E1, 0xD1E1 }, -{ 0xD1E2, 0xD1E2, 0xD1E2 }, -{ 0xD1E3, 0xD1E3, 0xD1E3 }, -{ 0xD1E4, 0xD1E4, 0xD1E4 }, -{ 0xD1E5, 0xD1E5, 0xD1E5 }, -{ 0xD1E6, 0xD1E6, 0xD1E6 }, -{ 0xD1E7, 0xD1E7, 0xD1E7 }, -{ 0xD1E8, 0xD1E8, 0xD1E8 }, -{ 0xD1E9, 0xD1E9, 0xD1E9 }, -{ 0xD1EA, 0xD1EA, 0xD1EA }, -{ 0xD1EB, 0xD1EB, 0xD1EB }, -{ 0xD1EC, 0xD1EC, 0xD1EC }, -{ 0xD1ED, 0xD1ED, 0xD1ED }, -{ 0xD1EE, 0xD1EE, 0xD1EE }, -{ 0xD1EF, 0xD1EF, 0xD1EF }, -{ 0xD1F0, 0xD1F0, 0xD1F0 }, -{ 0xD1F1, 0xD1F1, 0xD1F1 }, -{ 0xD1F2, 0xD1F2, 0xD1F2 }, -{ 0xD1F3, 0xD1F3, 0xD1F3 }, -{ 0xD1F4, 0xD1F4, 0xD1F4 }, -{ 0xD1F5, 0xD1F5, 0xD1F5 }, -{ 0xD1F6, 0xD1F6, 0xD1F6 }, -{ 0xD1F7, 0xD1F7, 0xD1F7 }, -{ 0xD1F8, 0xD1F8, 0xD1F8 }, -{ 0xD1F9, 0xD1F9, 0xD1F9 }, -{ 0xD1FA, 0xD1FA, 0xD1FA }, -{ 0xD1FB, 0xD1FB, 0xD1FB }, -{ 0xD1FC, 0xD1FC, 0xD1FC }, -{ 0xD1FD, 0xD1FD, 0xD1FD }, -{ 0xD1FE, 0xD1FE, 0xD1FE }, -{ 0xD1FF, 0xD1FF, 0xD1FF }, -{ 0xD200, 0xD200, 0xD200 }, -{ 0xD201, 0xD201, 0xD201 }, -{ 0xD202, 0xD202, 0xD202 }, -{ 0xD203, 0xD203, 0xD203 }, -{ 0xD204, 0xD204, 0xD204 }, -{ 0xD205, 0xD205, 0xD205 }, -{ 0xD206, 0xD206, 0xD206 }, -{ 0xD207, 0xD207, 0xD207 }, -{ 0xD208, 0xD208, 0xD208 }, -{ 0xD209, 0xD209, 0xD209 }, -{ 0xD20A, 0xD20A, 0xD20A }, -{ 0xD20B, 0xD20B, 0xD20B }, -{ 0xD20C, 0xD20C, 0xD20C }, -{ 0xD20D, 0xD20D, 0xD20D }, -{ 0xD20E, 0xD20E, 0xD20E }, -{ 0xD20F, 0xD20F, 0xD20F }, -{ 0xD210, 0xD210, 0xD210 }, -{ 0xD211, 0xD211, 0xD211 }, -{ 0xD212, 0xD212, 0xD212 }, -{ 0xD213, 0xD213, 0xD213 }, -{ 0xD214, 0xD214, 0xD214 }, -{ 0xD215, 0xD215, 0xD215 }, -{ 0xD216, 0xD216, 0xD216 }, -{ 0xD217, 0xD217, 0xD217 }, -{ 0xD218, 0xD218, 0xD218 }, -{ 0xD219, 0xD219, 0xD219 }, -{ 0xD21A, 0xD21A, 0xD21A }, -{ 0xD21B, 0xD21B, 0xD21B }, -{ 0xD21C, 0xD21C, 0xD21C }, -{ 0xD21D, 0xD21D, 0xD21D }, -{ 0xD21E, 0xD21E, 0xD21E }, -{ 0xD21F, 0xD21F, 0xD21F }, -{ 0xD220, 0xD220, 0xD220 }, -{ 0xD221, 0xD221, 0xD221 }, -{ 0xD222, 0xD222, 0xD222 }, -{ 0xD223, 0xD223, 0xD223 }, -{ 0xD224, 0xD224, 0xD224 }, -{ 0xD225, 0xD225, 0xD225 }, -{ 0xD226, 0xD226, 0xD226 }, -{ 0xD227, 0xD227, 0xD227 }, -{ 0xD228, 0xD228, 0xD228 }, -{ 0xD229, 0xD229, 0xD229 }, -{ 0xD22A, 0xD22A, 0xD22A }, -{ 0xD22B, 0xD22B, 0xD22B }, -{ 0xD22C, 0xD22C, 0xD22C }, -{ 0xD22D, 0xD22D, 0xD22D }, -{ 0xD22E, 0xD22E, 0xD22E }, -{ 0xD22F, 0xD22F, 0xD22F }, -{ 0xD230, 0xD230, 0xD230 }, -{ 0xD231, 0xD231, 0xD231 }, -{ 0xD232, 0xD232, 0xD232 }, -{ 0xD233, 0xD233, 0xD233 }, -{ 0xD234, 0xD234, 0xD234 }, -{ 0xD235, 0xD235, 0xD235 }, -{ 0xD236, 0xD236, 0xD236 }, -{ 0xD237, 0xD237, 0xD237 }, -{ 0xD238, 0xD238, 0xD238 }, -{ 0xD239, 0xD239, 0xD239 }, -{ 0xD23A, 0xD23A, 0xD23A }, -{ 0xD23B, 0xD23B, 0xD23B }, -{ 0xD23C, 0xD23C, 0xD23C }, -{ 0xD23D, 0xD23D, 0xD23D }, -{ 0xD23E, 0xD23E, 0xD23E }, -{ 0xD23F, 0xD23F, 0xD23F }, -{ 0xD240, 0xD240, 0xD240 }, -{ 0xD241, 0xD241, 0xD241 }, -{ 0xD242, 0xD242, 0xD242 }, -{ 0xD243, 0xD243, 0xD243 }, -{ 0xD244, 0xD244, 0xD244 }, -{ 0xD245, 0xD245, 0xD245 }, -{ 0xD246, 0xD246, 0xD246 }, -{ 0xD247, 0xD247, 0xD247 }, -{ 0xD248, 0xD248, 0xD248 }, -{ 0xD249, 0xD249, 0xD249 }, -{ 0xD24A, 0xD24A, 0xD24A }, -{ 0xD24B, 0xD24B, 0xD24B }, -{ 0xD24C, 0xD24C, 0xD24C }, -{ 0xD24D, 0xD24D, 0xD24D }, -{ 0xD24E, 0xD24E, 0xD24E }, -{ 0xD24F, 0xD24F, 0xD24F }, -{ 0xD250, 0xD250, 0xD250 }, -{ 0xD251, 0xD251, 0xD251 }, -{ 0xD252, 0xD252, 0xD252 }, -{ 0xD253, 0xD253, 0xD253 }, -{ 0xD254, 0xD254, 0xD254 }, -{ 0xD255, 0xD255, 0xD255 }, -{ 0xD256, 0xD256, 0xD256 }, -{ 0xD257, 0xD257, 0xD257 }, -{ 0xD258, 0xD258, 0xD258 }, -{ 0xD259, 0xD259, 0xD259 }, -{ 0xD25A, 0xD25A, 0xD25A }, -{ 0xD25B, 0xD25B, 0xD25B }, -{ 0xD25C, 0xD25C, 0xD25C }, -{ 0xD25D, 0xD25D, 0xD25D }, -{ 0xD25E, 0xD25E, 0xD25E }, -{ 0xD25F, 0xD25F, 0xD25F }, -{ 0xD260, 0xD260, 0xD260 }, -{ 0xD261, 0xD261, 0xD261 }, -{ 0xD262, 0xD262, 0xD262 }, -{ 0xD263, 0xD263, 0xD263 }, -{ 0xD264, 0xD264, 0xD264 }, -{ 0xD265, 0xD265, 0xD265 }, -{ 0xD266, 0xD266, 0xD266 }, -{ 0xD267, 0xD267, 0xD267 }, -{ 0xD268, 0xD268, 0xD268 }, -{ 0xD269, 0xD269, 0xD269 }, -{ 0xD26A, 0xD26A, 0xD26A }, -{ 0xD26B, 0xD26B, 0xD26B }, -{ 0xD26C, 0xD26C, 0xD26C }, -{ 0xD26D, 0xD26D, 0xD26D }, -{ 0xD26E, 0xD26E, 0xD26E }, -{ 0xD26F, 0xD26F, 0xD26F }, -{ 0xD270, 0xD270, 0xD270 }, -{ 0xD271, 0xD271, 0xD271 }, -{ 0xD272, 0xD272, 0xD272 }, -{ 0xD273, 0xD273, 0xD273 }, -{ 0xD274, 0xD274, 0xD274 }, -{ 0xD275, 0xD275, 0xD275 }, -{ 0xD276, 0xD276, 0xD276 }, -{ 0xD277, 0xD277, 0xD277 }, -{ 0xD278, 0xD278, 0xD278 }, -{ 0xD279, 0xD279, 0xD279 }, -{ 0xD27A, 0xD27A, 0xD27A }, -{ 0xD27B, 0xD27B, 0xD27B }, -{ 0xD27C, 0xD27C, 0xD27C }, -{ 0xD27D, 0xD27D, 0xD27D }, -{ 0xD27E, 0xD27E, 0xD27E }, -{ 0xD27F, 0xD27F, 0xD27F }, -{ 0xD280, 0xD280, 0xD280 }, -{ 0xD281, 0xD281, 0xD281 }, -{ 0xD282, 0xD282, 0xD282 }, -{ 0xD283, 0xD283, 0xD283 }, -{ 0xD284, 0xD284, 0xD284 }, -{ 0xD285, 0xD285, 0xD285 }, -{ 0xD286, 0xD286, 0xD286 }, -{ 0xD287, 0xD287, 0xD287 }, -{ 0xD288, 0xD288, 0xD288 }, -{ 0xD289, 0xD289, 0xD289 }, -{ 0xD28A, 0xD28A, 0xD28A }, -{ 0xD28B, 0xD28B, 0xD28B }, -{ 0xD28C, 0xD28C, 0xD28C }, -{ 0xD28D, 0xD28D, 0xD28D }, -{ 0xD28E, 0xD28E, 0xD28E }, -{ 0xD28F, 0xD28F, 0xD28F }, -{ 0xD290, 0xD290, 0xD290 }, -{ 0xD291, 0xD291, 0xD291 }, -{ 0xD292, 0xD292, 0xD292 }, -{ 0xD293, 0xD293, 0xD293 }, -{ 0xD294, 0xD294, 0xD294 }, -{ 0xD295, 0xD295, 0xD295 }, -{ 0xD296, 0xD296, 0xD296 }, -{ 0xD297, 0xD297, 0xD297 }, -{ 0xD298, 0xD298, 0xD298 }, -{ 0xD299, 0xD299, 0xD299 }, -{ 0xD29A, 0xD29A, 0xD29A }, -{ 0xD29B, 0xD29B, 0xD29B }, -{ 0xD29C, 0xD29C, 0xD29C }, -{ 0xD29D, 0xD29D, 0xD29D }, -{ 0xD29E, 0xD29E, 0xD29E }, -{ 0xD29F, 0xD29F, 0xD29F }, -{ 0xD2A0, 0xD2A0, 0xD2A0 }, -{ 0xD2A1, 0xD2A1, 0xD2A1 }, -{ 0xD2A2, 0xD2A2, 0xD2A2 }, -{ 0xD2A3, 0xD2A3, 0xD2A3 }, -{ 0xD2A4, 0xD2A4, 0xD2A4 }, -{ 0xD2A5, 0xD2A5, 0xD2A5 }, -{ 0xD2A6, 0xD2A6, 0xD2A6 }, -{ 0xD2A7, 0xD2A7, 0xD2A7 }, -{ 0xD2A8, 0xD2A8, 0xD2A8 }, -{ 0xD2A9, 0xD2A9, 0xD2A9 }, -{ 0xD2AA, 0xD2AA, 0xD2AA }, -{ 0xD2AB, 0xD2AB, 0xD2AB }, -{ 0xD2AC, 0xD2AC, 0xD2AC }, -{ 0xD2AD, 0xD2AD, 0xD2AD }, -{ 0xD2AE, 0xD2AE, 0xD2AE }, -{ 0xD2AF, 0xD2AF, 0xD2AF }, -{ 0xD2B0, 0xD2B0, 0xD2B0 }, -{ 0xD2B1, 0xD2B1, 0xD2B1 }, -{ 0xD2B2, 0xD2B2, 0xD2B2 }, -{ 0xD2B3, 0xD2B3, 0xD2B3 }, -{ 0xD2B4, 0xD2B4, 0xD2B4 }, -{ 0xD2B5, 0xD2B5, 0xD2B5 }, -{ 0xD2B6, 0xD2B6, 0xD2B6 }, -{ 0xD2B7, 0xD2B7, 0xD2B7 }, -{ 0xD2B8, 0xD2B8, 0xD2B8 }, -{ 0xD2B9, 0xD2B9, 0xD2B9 }, -{ 0xD2BA, 0xD2BA, 0xD2BA }, -{ 0xD2BB, 0xD2BB, 0xD2BB }, -{ 0xD2BC, 0xD2BC, 0xD2BC }, -{ 0xD2BD, 0xD2BD, 0xD2BD }, -{ 0xD2BE, 0xD2BE, 0xD2BE }, -{ 0xD2BF, 0xD2BF, 0xD2BF }, -{ 0xD2C0, 0xD2C0, 0xD2C0 }, -{ 0xD2C1, 0xD2C1, 0xD2C1 }, -{ 0xD2C2, 0xD2C2, 0xD2C2 }, -{ 0xD2C3, 0xD2C3, 0xD2C3 }, -{ 0xD2C4, 0xD2C4, 0xD2C4 }, -{ 0xD2C5, 0xD2C5, 0xD2C5 }, -{ 0xD2C6, 0xD2C6, 0xD2C6 }, -{ 0xD2C7, 0xD2C7, 0xD2C7 }, -{ 0xD2C8, 0xD2C8, 0xD2C8 }, -{ 0xD2C9, 0xD2C9, 0xD2C9 }, -{ 0xD2CA, 0xD2CA, 0xD2CA }, -{ 0xD2CB, 0xD2CB, 0xD2CB }, -{ 0xD2CC, 0xD2CC, 0xD2CC }, -{ 0xD2CD, 0xD2CD, 0xD2CD }, -{ 0xD2CE, 0xD2CE, 0xD2CE }, -{ 0xD2CF, 0xD2CF, 0xD2CF }, -{ 0xD2D0, 0xD2D0, 0xD2D0 }, -{ 0xD2D1, 0xD2D1, 0xD2D1 }, -{ 0xD2D2, 0xD2D2, 0xD2D2 }, -{ 0xD2D3, 0xD2D3, 0xD2D3 }, -{ 0xD2D4, 0xD2D4, 0xD2D4 }, -{ 0xD2D5, 0xD2D5, 0xD2D5 }, -{ 0xD2D6, 0xD2D6, 0xD2D6 }, -{ 0xD2D7, 0xD2D7, 0xD2D7 }, -{ 0xD2D8, 0xD2D8, 0xD2D8 }, -{ 0xD2D9, 0xD2D9, 0xD2D9 }, -{ 0xD2DA, 0xD2DA, 0xD2DA }, -{ 0xD2DB, 0xD2DB, 0xD2DB }, -{ 0xD2DC, 0xD2DC, 0xD2DC }, -{ 0xD2DD, 0xD2DD, 0xD2DD }, -{ 0xD2DE, 0xD2DE, 0xD2DE }, -{ 0xD2DF, 0xD2DF, 0xD2DF }, -{ 0xD2E0, 0xD2E0, 0xD2E0 }, -{ 0xD2E1, 0xD2E1, 0xD2E1 }, -{ 0xD2E2, 0xD2E2, 0xD2E2 }, -{ 0xD2E3, 0xD2E3, 0xD2E3 }, -{ 0xD2E4, 0xD2E4, 0xD2E4 }, -{ 0xD2E5, 0xD2E5, 0xD2E5 }, -{ 0xD2E6, 0xD2E6, 0xD2E6 }, -{ 0xD2E7, 0xD2E7, 0xD2E7 }, -{ 0xD2E8, 0xD2E8, 0xD2E8 }, -{ 0xD2E9, 0xD2E9, 0xD2E9 }, -{ 0xD2EA, 0xD2EA, 0xD2EA }, -{ 0xD2EB, 0xD2EB, 0xD2EB }, -{ 0xD2EC, 0xD2EC, 0xD2EC }, -{ 0xD2ED, 0xD2ED, 0xD2ED }, -{ 0xD2EE, 0xD2EE, 0xD2EE }, -{ 0xD2EF, 0xD2EF, 0xD2EF }, -{ 0xD2F0, 0xD2F0, 0xD2F0 }, -{ 0xD2F1, 0xD2F1, 0xD2F1 }, -{ 0xD2F2, 0xD2F2, 0xD2F2 }, -{ 0xD2F3, 0xD2F3, 0xD2F3 }, -{ 0xD2F4, 0xD2F4, 0xD2F4 }, -{ 0xD2F5, 0xD2F5, 0xD2F5 }, -{ 0xD2F6, 0xD2F6, 0xD2F6 }, -{ 0xD2F7, 0xD2F7, 0xD2F7 }, -{ 0xD2F8, 0xD2F8, 0xD2F8 }, -{ 0xD2F9, 0xD2F9, 0xD2F9 }, -{ 0xD2FA, 0xD2FA, 0xD2FA }, -{ 0xD2FB, 0xD2FB, 0xD2FB }, -{ 0xD2FC, 0xD2FC, 0xD2FC }, -{ 0xD2FD, 0xD2FD, 0xD2FD }, -{ 0xD2FE, 0xD2FE, 0xD2FE }, -{ 0xD2FF, 0xD2FF, 0xD2FF }, -{ 0xD300, 0xD300, 0xD300 }, -{ 0xD301, 0xD301, 0xD301 }, -{ 0xD302, 0xD302, 0xD302 }, -{ 0xD303, 0xD303, 0xD303 }, -{ 0xD304, 0xD304, 0xD304 }, -{ 0xD305, 0xD305, 0xD305 }, -{ 0xD306, 0xD306, 0xD306 }, -{ 0xD307, 0xD307, 0xD307 }, -{ 0xD308, 0xD308, 0xD308 }, -{ 0xD309, 0xD309, 0xD309 }, -{ 0xD30A, 0xD30A, 0xD30A }, -{ 0xD30B, 0xD30B, 0xD30B }, -{ 0xD30C, 0xD30C, 0xD30C }, -{ 0xD30D, 0xD30D, 0xD30D }, -{ 0xD30E, 0xD30E, 0xD30E }, -{ 0xD30F, 0xD30F, 0xD30F }, -{ 0xD310, 0xD310, 0xD310 }, -{ 0xD311, 0xD311, 0xD311 }, -{ 0xD312, 0xD312, 0xD312 }, -{ 0xD313, 0xD313, 0xD313 }, -{ 0xD314, 0xD314, 0xD314 }, -{ 0xD315, 0xD315, 0xD315 }, -{ 0xD316, 0xD316, 0xD316 }, -{ 0xD317, 0xD317, 0xD317 }, -{ 0xD318, 0xD318, 0xD318 }, -{ 0xD319, 0xD319, 0xD319 }, -{ 0xD31A, 0xD31A, 0xD31A }, -{ 0xD31B, 0xD31B, 0xD31B }, -{ 0xD31C, 0xD31C, 0xD31C }, -{ 0xD31D, 0xD31D, 0xD31D }, -{ 0xD31E, 0xD31E, 0xD31E }, -{ 0xD31F, 0xD31F, 0xD31F }, -{ 0xD320, 0xD320, 0xD320 }, -{ 0xD321, 0xD321, 0xD321 }, -{ 0xD322, 0xD322, 0xD322 }, -{ 0xD323, 0xD323, 0xD323 }, -{ 0xD324, 0xD324, 0xD324 }, -{ 0xD325, 0xD325, 0xD325 }, -{ 0xD326, 0xD326, 0xD326 }, -{ 0xD327, 0xD327, 0xD327 }, -{ 0xD328, 0xD328, 0xD328 }, -{ 0xD329, 0xD329, 0xD329 }, -{ 0xD32A, 0xD32A, 0xD32A }, -{ 0xD32B, 0xD32B, 0xD32B }, -{ 0xD32C, 0xD32C, 0xD32C }, -{ 0xD32D, 0xD32D, 0xD32D }, -{ 0xD32E, 0xD32E, 0xD32E }, -{ 0xD32F, 0xD32F, 0xD32F }, -{ 0xD330, 0xD330, 0xD330 }, -{ 0xD331, 0xD331, 0xD331 }, -{ 0xD332, 0xD332, 0xD332 }, -{ 0xD333, 0xD333, 0xD333 }, -{ 0xD334, 0xD334, 0xD334 }, -{ 0xD335, 0xD335, 0xD335 }, -{ 0xD336, 0xD336, 0xD336 }, -{ 0xD337, 0xD337, 0xD337 }, -{ 0xD338, 0xD338, 0xD338 }, -{ 0xD339, 0xD339, 0xD339 }, -{ 0xD33A, 0xD33A, 0xD33A }, -{ 0xD33B, 0xD33B, 0xD33B }, -{ 0xD33C, 0xD33C, 0xD33C }, -{ 0xD33D, 0xD33D, 0xD33D }, -{ 0xD33E, 0xD33E, 0xD33E }, -{ 0xD33F, 0xD33F, 0xD33F }, -{ 0xD340, 0xD340, 0xD340 }, -{ 0xD341, 0xD341, 0xD341 }, -{ 0xD342, 0xD342, 0xD342 }, -{ 0xD343, 0xD343, 0xD343 }, -{ 0xD344, 0xD344, 0xD344 }, -{ 0xD345, 0xD345, 0xD345 }, -{ 0xD346, 0xD346, 0xD346 }, -{ 0xD347, 0xD347, 0xD347 }, -{ 0xD348, 0xD348, 0xD348 }, -{ 0xD349, 0xD349, 0xD349 }, -{ 0xD34A, 0xD34A, 0xD34A }, -{ 0xD34B, 0xD34B, 0xD34B }, -{ 0xD34C, 0xD34C, 0xD34C }, -{ 0xD34D, 0xD34D, 0xD34D }, -{ 0xD34E, 0xD34E, 0xD34E }, -{ 0xD34F, 0xD34F, 0xD34F }, -{ 0xD350, 0xD350, 0xD350 }, -{ 0xD351, 0xD351, 0xD351 }, -{ 0xD352, 0xD352, 0xD352 }, -{ 0xD353, 0xD353, 0xD353 }, -{ 0xD354, 0xD354, 0xD354 }, -{ 0xD355, 0xD355, 0xD355 }, -{ 0xD356, 0xD356, 0xD356 }, -{ 0xD357, 0xD357, 0xD357 }, -{ 0xD358, 0xD358, 0xD358 }, -{ 0xD359, 0xD359, 0xD359 }, -{ 0xD35A, 0xD35A, 0xD35A }, -{ 0xD35B, 0xD35B, 0xD35B }, -{ 0xD35C, 0xD35C, 0xD35C }, -{ 0xD35D, 0xD35D, 0xD35D }, -{ 0xD35E, 0xD35E, 0xD35E }, -{ 0xD35F, 0xD35F, 0xD35F }, -{ 0xD360, 0xD360, 0xD360 }, -{ 0xD361, 0xD361, 0xD361 }, -{ 0xD362, 0xD362, 0xD362 }, -{ 0xD363, 0xD363, 0xD363 }, -{ 0xD364, 0xD364, 0xD364 }, -{ 0xD365, 0xD365, 0xD365 }, -{ 0xD366, 0xD366, 0xD366 }, -{ 0xD367, 0xD367, 0xD367 }, -{ 0xD368, 0xD368, 0xD368 }, -{ 0xD369, 0xD369, 0xD369 }, -{ 0xD36A, 0xD36A, 0xD36A }, -{ 0xD36B, 0xD36B, 0xD36B }, -{ 0xD36C, 0xD36C, 0xD36C }, -{ 0xD36D, 0xD36D, 0xD36D }, -{ 0xD36E, 0xD36E, 0xD36E }, -{ 0xD36F, 0xD36F, 0xD36F }, -{ 0xD370, 0xD370, 0xD370 }, -{ 0xD371, 0xD371, 0xD371 }, -{ 0xD372, 0xD372, 0xD372 }, -{ 0xD373, 0xD373, 0xD373 }, -{ 0xD374, 0xD374, 0xD374 }, -{ 0xD375, 0xD375, 0xD375 }, -{ 0xD376, 0xD376, 0xD376 }, -{ 0xD377, 0xD377, 0xD377 }, -{ 0xD378, 0xD378, 0xD378 }, -{ 0xD379, 0xD379, 0xD379 }, -{ 0xD37A, 0xD37A, 0xD37A }, -{ 0xD37B, 0xD37B, 0xD37B }, -{ 0xD37C, 0xD37C, 0xD37C }, -{ 0xD37D, 0xD37D, 0xD37D }, -{ 0xD37E, 0xD37E, 0xD37E }, -{ 0xD37F, 0xD37F, 0xD37F }, -{ 0xD380, 0xD380, 0xD380 }, -{ 0xD381, 0xD381, 0xD381 }, -{ 0xD382, 0xD382, 0xD382 }, -{ 0xD383, 0xD383, 0xD383 }, -{ 0xD384, 0xD384, 0xD384 }, -{ 0xD385, 0xD385, 0xD385 }, -{ 0xD386, 0xD386, 0xD386 }, -{ 0xD387, 0xD387, 0xD387 }, -{ 0xD388, 0xD388, 0xD388 }, -{ 0xD389, 0xD389, 0xD389 }, -{ 0xD38A, 0xD38A, 0xD38A }, -{ 0xD38B, 0xD38B, 0xD38B }, -{ 0xD38C, 0xD38C, 0xD38C }, -{ 0xD38D, 0xD38D, 0xD38D }, -{ 0xD38E, 0xD38E, 0xD38E }, -{ 0xD38F, 0xD38F, 0xD38F }, -{ 0xD390, 0xD390, 0xD390 }, -{ 0xD391, 0xD391, 0xD391 }, -{ 0xD392, 0xD392, 0xD392 }, -{ 0xD393, 0xD393, 0xD393 }, -{ 0xD394, 0xD394, 0xD394 }, -{ 0xD395, 0xD395, 0xD395 }, -{ 0xD396, 0xD396, 0xD396 }, -{ 0xD397, 0xD397, 0xD397 }, -{ 0xD398, 0xD398, 0xD398 }, -{ 0xD399, 0xD399, 0xD399 }, -{ 0xD39A, 0xD39A, 0xD39A }, -{ 0xD39B, 0xD39B, 0xD39B }, -{ 0xD39C, 0xD39C, 0xD39C }, -{ 0xD39D, 0xD39D, 0xD39D }, -{ 0xD39E, 0xD39E, 0xD39E }, -{ 0xD39F, 0xD39F, 0xD39F }, -{ 0xD3A0, 0xD3A0, 0xD3A0 }, -{ 0xD3A1, 0xD3A1, 0xD3A1 }, -{ 0xD3A2, 0xD3A2, 0xD3A2 }, -{ 0xD3A3, 0xD3A3, 0xD3A3 }, -{ 0xD3A4, 0xD3A4, 0xD3A4 }, -{ 0xD3A5, 0xD3A5, 0xD3A5 }, -{ 0xD3A6, 0xD3A6, 0xD3A6 }, -{ 0xD3A7, 0xD3A7, 0xD3A7 }, -{ 0xD3A8, 0xD3A8, 0xD3A8 }, -{ 0xD3A9, 0xD3A9, 0xD3A9 }, -{ 0xD3AA, 0xD3AA, 0xD3AA }, -{ 0xD3AB, 0xD3AB, 0xD3AB }, -{ 0xD3AC, 0xD3AC, 0xD3AC }, -{ 0xD3AD, 0xD3AD, 0xD3AD }, -{ 0xD3AE, 0xD3AE, 0xD3AE }, -{ 0xD3AF, 0xD3AF, 0xD3AF }, -{ 0xD3B0, 0xD3B0, 0xD3B0 }, -{ 0xD3B1, 0xD3B1, 0xD3B1 }, -{ 0xD3B2, 0xD3B2, 0xD3B2 }, -{ 0xD3B3, 0xD3B3, 0xD3B3 }, -{ 0xD3B4, 0xD3B4, 0xD3B4 }, -{ 0xD3B5, 0xD3B5, 0xD3B5 }, -{ 0xD3B6, 0xD3B6, 0xD3B6 }, -{ 0xD3B7, 0xD3B7, 0xD3B7 }, -{ 0xD3B8, 0xD3B8, 0xD3B8 }, -{ 0xD3B9, 0xD3B9, 0xD3B9 }, -{ 0xD3BA, 0xD3BA, 0xD3BA }, -{ 0xD3BB, 0xD3BB, 0xD3BB }, -{ 0xD3BC, 0xD3BC, 0xD3BC }, -{ 0xD3BD, 0xD3BD, 0xD3BD }, -{ 0xD3BE, 0xD3BE, 0xD3BE }, -{ 0xD3BF, 0xD3BF, 0xD3BF }, -{ 0xD3C0, 0xD3C0, 0xD3C0 }, -{ 0xD3C1, 0xD3C1, 0xD3C1 }, -{ 0xD3C2, 0xD3C2, 0xD3C2 }, -{ 0xD3C3, 0xD3C3, 0xD3C3 }, -{ 0xD3C4, 0xD3C4, 0xD3C4 }, -{ 0xD3C5, 0xD3C5, 0xD3C5 }, -{ 0xD3C6, 0xD3C6, 0xD3C6 }, -{ 0xD3C7, 0xD3C7, 0xD3C7 }, -{ 0xD3C8, 0xD3C8, 0xD3C8 }, -{ 0xD3C9, 0xD3C9, 0xD3C9 }, -{ 0xD3CA, 0xD3CA, 0xD3CA }, -{ 0xD3CB, 0xD3CB, 0xD3CB }, -{ 0xD3CC, 0xD3CC, 0xD3CC }, -{ 0xD3CD, 0xD3CD, 0xD3CD }, -{ 0xD3CE, 0xD3CE, 0xD3CE }, -{ 0xD3CF, 0xD3CF, 0xD3CF }, -{ 0xD3D0, 0xD3D0, 0xD3D0 }, -{ 0xD3D1, 0xD3D1, 0xD3D1 }, -{ 0xD3D2, 0xD3D2, 0xD3D2 }, -{ 0xD3D3, 0xD3D3, 0xD3D3 }, -{ 0xD3D4, 0xD3D4, 0xD3D4 }, -{ 0xD3D5, 0xD3D5, 0xD3D5 }, -{ 0xD3D6, 0xD3D6, 0xD3D6 }, -{ 0xD3D7, 0xD3D7, 0xD3D7 }, -{ 0xD3D8, 0xD3D8, 0xD3D8 }, -{ 0xD3D9, 0xD3D9, 0xD3D9 }, -{ 0xD3DA, 0xD3DA, 0xD3DA }, -{ 0xD3DB, 0xD3DB, 0xD3DB }, -{ 0xD3DC, 0xD3DC, 0xD3DC }, -{ 0xD3DD, 0xD3DD, 0xD3DD }, -{ 0xD3DE, 0xD3DE, 0xD3DE }, -{ 0xD3DF, 0xD3DF, 0xD3DF }, -{ 0xD3E0, 0xD3E0, 0xD3E0 }, -{ 0xD3E1, 0xD3E1, 0xD3E1 }, -{ 0xD3E2, 0xD3E2, 0xD3E2 }, -{ 0xD3E3, 0xD3E3, 0xD3E3 }, -{ 0xD3E4, 0xD3E4, 0xD3E4 }, -{ 0xD3E5, 0xD3E5, 0xD3E5 }, -{ 0xD3E6, 0xD3E6, 0xD3E6 }, -{ 0xD3E7, 0xD3E7, 0xD3E7 }, -{ 0xD3E8, 0xD3E8, 0xD3E8 }, -{ 0xD3E9, 0xD3E9, 0xD3E9 }, -{ 0xD3EA, 0xD3EA, 0xD3EA }, -{ 0xD3EB, 0xD3EB, 0xD3EB }, -{ 0xD3EC, 0xD3EC, 0xD3EC }, -{ 0xD3ED, 0xD3ED, 0xD3ED }, -{ 0xD3EE, 0xD3EE, 0xD3EE }, -{ 0xD3EF, 0xD3EF, 0xD3EF }, -{ 0xD3F0, 0xD3F0, 0xD3F0 }, -{ 0xD3F1, 0xD3F1, 0xD3F1 }, -{ 0xD3F2, 0xD3F2, 0xD3F2 }, -{ 0xD3F3, 0xD3F3, 0xD3F3 }, -{ 0xD3F4, 0xD3F4, 0xD3F4 }, -{ 0xD3F5, 0xD3F5, 0xD3F5 }, -{ 0xD3F6, 0xD3F6, 0xD3F6 }, -{ 0xD3F7, 0xD3F7, 0xD3F7 }, -{ 0xD3F8, 0xD3F8, 0xD3F8 }, -{ 0xD3F9, 0xD3F9, 0xD3F9 }, -{ 0xD3FA, 0xD3FA, 0xD3FA }, -{ 0xD3FB, 0xD3FB, 0xD3FB }, -{ 0xD3FC, 0xD3FC, 0xD3FC }, -{ 0xD3FD, 0xD3FD, 0xD3FD }, -{ 0xD3FE, 0xD3FE, 0xD3FE }, -{ 0xD3FF, 0xD3FF, 0xD3FF }, -{ 0xD400, 0xD400, 0xD400 }, -{ 0xD401, 0xD401, 0xD401 }, -{ 0xD402, 0xD402, 0xD402 }, -{ 0xD403, 0xD403, 0xD403 }, -{ 0xD404, 0xD404, 0xD404 }, -{ 0xD405, 0xD405, 0xD405 }, -{ 0xD406, 0xD406, 0xD406 }, -{ 0xD407, 0xD407, 0xD407 }, -{ 0xD408, 0xD408, 0xD408 }, -{ 0xD409, 0xD409, 0xD409 }, -{ 0xD40A, 0xD40A, 0xD40A }, -{ 0xD40B, 0xD40B, 0xD40B }, -{ 0xD40C, 0xD40C, 0xD40C }, -{ 0xD40D, 0xD40D, 0xD40D }, -{ 0xD40E, 0xD40E, 0xD40E }, -{ 0xD40F, 0xD40F, 0xD40F }, -{ 0xD410, 0xD410, 0xD410 }, -{ 0xD411, 0xD411, 0xD411 }, -{ 0xD412, 0xD412, 0xD412 }, -{ 0xD413, 0xD413, 0xD413 }, -{ 0xD414, 0xD414, 0xD414 }, -{ 0xD415, 0xD415, 0xD415 }, -{ 0xD416, 0xD416, 0xD416 }, -{ 0xD417, 0xD417, 0xD417 }, -{ 0xD418, 0xD418, 0xD418 }, -{ 0xD419, 0xD419, 0xD419 }, -{ 0xD41A, 0xD41A, 0xD41A }, -{ 0xD41B, 0xD41B, 0xD41B }, -{ 0xD41C, 0xD41C, 0xD41C }, -{ 0xD41D, 0xD41D, 0xD41D }, -{ 0xD41E, 0xD41E, 0xD41E }, -{ 0xD41F, 0xD41F, 0xD41F }, -{ 0xD420, 0xD420, 0xD420 }, -{ 0xD421, 0xD421, 0xD421 }, -{ 0xD422, 0xD422, 0xD422 }, -{ 0xD423, 0xD423, 0xD423 }, -{ 0xD424, 0xD424, 0xD424 }, -{ 0xD425, 0xD425, 0xD425 }, -{ 0xD426, 0xD426, 0xD426 }, -{ 0xD427, 0xD427, 0xD427 }, -{ 0xD428, 0xD428, 0xD428 }, -{ 0xD429, 0xD429, 0xD429 }, -{ 0xD42A, 0xD42A, 0xD42A }, -{ 0xD42B, 0xD42B, 0xD42B }, -{ 0xD42C, 0xD42C, 0xD42C }, -{ 0xD42D, 0xD42D, 0xD42D }, -{ 0xD42E, 0xD42E, 0xD42E }, -{ 0xD42F, 0xD42F, 0xD42F }, -{ 0xD430, 0xD430, 0xD430 }, -{ 0xD431, 0xD431, 0xD431 }, -{ 0xD432, 0xD432, 0xD432 }, -{ 0xD433, 0xD433, 0xD433 }, -{ 0xD434, 0xD434, 0xD434 }, -{ 0xD435, 0xD435, 0xD435 }, -{ 0xD436, 0xD436, 0xD436 }, -{ 0xD437, 0xD437, 0xD437 }, -{ 0xD438, 0xD438, 0xD438 }, -{ 0xD439, 0xD439, 0xD439 }, -{ 0xD43A, 0xD43A, 0xD43A }, -{ 0xD43B, 0xD43B, 0xD43B }, -{ 0xD43C, 0xD43C, 0xD43C }, -{ 0xD43D, 0xD43D, 0xD43D }, -{ 0xD43E, 0xD43E, 0xD43E }, -{ 0xD43F, 0xD43F, 0xD43F }, -{ 0xD440, 0xD440, 0xD440 }, -{ 0xD441, 0xD441, 0xD441 }, -{ 0xD442, 0xD442, 0xD442 }, -{ 0xD443, 0xD443, 0xD443 }, -{ 0xD444, 0xD444, 0xD444 }, -{ 0xD445, 0xD445, 0xD445 }, -{ 0xD446, 0xD446, 0xD446 }, -{ 0xD447, 0xD447, 0xD447 }, -{ 0xD448, 0xD448, 0xD448 }, -{ 0xD449, 0xD449, 0xD449 }, -{ 0xD44A, 0xD44A, 0xD44A }, -{ 0xD44B, 0xD44B, 0xD44B }, -{ 0xD44C, 0xD44C, 0xD44C }, -{ 0xD44D, 0xD44D, 0xD44D }, -{ 0xD44E, 0xD44E, 0xD44E }, -{ 0xD44F, 0xD44F, 0xD44F }, -{ 0xD450, 0xD450, 0xD450 }, -{ 0xD451, 0xD451, 0xD451 }, -{ 0xD452, 0xD452, 0xD452 }, -{ 0xD453, 0xD453, 0xD453 }, -{ 0xD454, 0xD454, 0xD454 }, -{ 0xD455, 0xD455, 0xD455 }, -{ 0xD456, 0xD456, 0xD456 }, -{ 0xD457, 0xD457, 0xD457 }, -{ 0xD458, 0xD458, 0xD458 }, -{ 0xD459, 0xD459, 0xD459 }, -{ 0xD45A, 0xD45A, 0xD45A }, -{ 0xD45B, 0xD45B, 0xD45B }, -{ 0xD45C, 0xD45C, 0xD45C }, -{ 0xD45D, 0xD45D, 0xD45D }, -{ 0xD45E, 0xD45E, 0xD45E }, -{ 0xD45F, 0xD45F, 0xD45F }, -{ 0xD460, 0xD460, 0xD460 }, -{ 0xD461, 0xD461, 0xD461 }, -{ 0xD462, 0xD462, 0xD462 }, -{ 0xD463, 0xD463, 0xD463 }, -{ 0xD464, 0xD464, 0xD464 }, -{ 0xD465, 0xD465, 0xD465 }, -{ 0xD466, 0xD466, 0xD466 }, -{ 0xD467, 0xD467, 0xD467 }, -{ 0xD468, 0xD468, 0xD468 }, -{ 0xD469, 0xD469, 0xD469 }, -{ 0xD46A, 0xD46A, 0xD46A }, -{ 0xD46B, 0xD46B, 0xD46B }, -{ 0xD46C, 0xD46C, 0xD46C }, -{ 0xD46D, 0xD46D, 0xD46D }, -{ 0xD46E, 0xD46E, 0xD46E }, -{ 0xD46F, 0xD46F, 0xD46F }, -{ 0xD470, 0xD470, 0xD470 }, -{ 0xD471, 0xD471, 0xD471 }, -{ 0xD472, 0xD472, 0xD472 }, -{ 0xD473, 0xD473, 0xD473 }, -{ 0xD474, 0xD474, 0xD474 }, -{ 0xD475, 0xD475, 0xD475 }, -{ 0xD476, 0xD476, 0xD476 }, -{ 0xD477, 0xD477, 0xD477 }, -{ 0xD478, 0xD478, 0xD478 }, -{ 0xD479, 0xD479, 0xD479 }, -{ 0xD47A, 0xD47A, 0xD47A }, -{ 0xD47B, 0xD47B, 0xD47B }, -{ 0xD47C, 0xD47C, 0xD47C }, -{ 0xD47D, 0xD47D, 0xD47D }, -{ 0xD47E, 0xD47E, 0xD47E }, -{ 0xD47F, 0xD47F, 0xD47F }, -{ 0xD480, 0xD480, 0xD480 }, -{ 0xD481, 0xD481, 0xD481 }, -{ 0xD482, 0xD482, 0xD482 }, -{ 0xD483, 0xD483, 0xD483 }, -{ 0xD484, 0xD484, 0xD484 }, -{ 0xD485, 0xD485, 0xD485 }, -{ 0xD486, 0xD486, 0xD486 }, -{ 0xD487, 0xD487, 0xD487 }, -{ 0xD488, 0xD488, 0xD488 }, -{ 0xD489, 0xD489, 0xD489 }, -{ 0xD48A, 0xD48A, 0xD48A }, -{ 0xD48B, 0xD48B, 0xD48B }, -{ 0xD48C, 0xD48C, 0xD48C }, -{ 0xD48D, 0xD48D, 0xD48D }, -{ 0xD48E, 0xD48E, 0xD48E }, -{ 0xD48F, 0xD48F, 0xD48F }, -{ 0xD490, 0xD490, 0xD490 }, -{ 0xD491, 0xD491, 0xD491 }, -{ 0xD492, 0xD492, 0xD492 }, -{ 0xD493, 0xD493, 0xD493 }, -{ 0xD494, 0xD494, 0xD494 }, -{ 0xD495, 0xD495, 0xD495 }, -{ 0xD496, 0xD496, 0xD496 }, -{ 0xD497, 0xD497, 0xD497 }, -{ 0xD498, 0xD498, 0xD498 }, -{ 0xD499, 0xD499, 0xD499 }, -{ 0xD49A, 0xD49A, 0xD49A }, -{ 0xD49B, 0xD49B, 0xD49B }, -{ 0xD49C, 0xD49C, 0xD49C }, -{ 0xD49D, 0xD49D, 0xD49D }, -{ 0xD49E, 0xD49E, 0xD49E }, -{ 0xD49F, 0xD49F, 0xD49F }, -{ 0xD4A0, 0xD4A0, 0xD4A0 }, -{ 0xD4A1, 0xD4A1, 0xD4A1 }, -{ 0xD4A2, 0xD4A2, 0xD4A2 }, -{ 0xD4A3, 0xD4A3, 0xD4A3 }, -{ 0xD4A4, 0xD4A4, 0xD4A4 }, -{ 0xD4A5, 0xD4A5, 0xD4A5 }, -{ 0xD4A6, 0xD4A6, 0xD4A6 }, -{ 0xD4A7, 0xD4A7, 0xD4A7 }, -{ 0xD4A8, 0xD4A8, 0xD4A8 }, -{ 0xD4A9, 0xD4A9, 0xD4A9 }, -{ 0xD4AA, 0xD4AA, 0xD4AA }, -{ 0xD4AB, 0xD4AB, 0xD4AB }, -{ 0xD4AC, 0xD4AC, 0xD4AC }, -{ 0xD4AD, 0xD4AD, 0xD4AD }, -{ 0xD4AE, 0xD4AE, 0xD4AE }, -{ 0xD4AF, 0xD4AF, 0xD4AF }, -{ 0xD4B0, 0xD4B0, 0xD4B0 }, -{ 0xD4B1, 0xD4B1, 0xD4B1 }, -{ 0xD4B2, 0xD4B2, 0xD4B2 }, -{ 0xD4B3, 0xD4B3, 0xD4B3 }, -{ 0xD4B4, 0xD4B4, 0xD4B4 }, -{ 0xD4B5, 0xD4B5, 0xD4B5 }, -{ 0xD4B6, 0xD4B6, 0xD4B6 }, -{ 0xD4B7, 0xD4B7, 0xD4B7 }, -{ 0xD4B8, 0xD4B8, 0xD4B8 }, -{ 0xD4B9, 0xD4B9, 0xD4B9 }, -{ 0xD4BA, 0xD4BA, 0xD4BA }, -{ 0xD4BB, 0xD4BB, 0xD4BB }, -{ 0xD4BC, 0xD4BC, 0xD4BC }, -{ 0xD4BD, 0xD4BD, 0xD4BD }, -{ 0xD4BE, 0xD4BE, 0xD4BE }, -{ 0xD4BF, 0xD4BF, 0xD4BF }, -{ 0xD4C0, 0xD4C0, 0xD4C0 }, -{ 0xD4C1, 0xD4C1, 0xD4C1 }, -{ 0xD4C2, 0xD4C2, 0xD4C2 }, -{ 0xD4C3, 0xD4C3, 0xD4C3 }, -{ 0xD4C4, 0xD4C4, 0xD4C4 }, -{ 0xD4C5, 0xD4C5, 0xD4C5 }, -{ 0xD4C6, 0xD4C6, 0xD4C6 }, -{ 0xD4C7, 0xD4C7, 0xD4C7 }, -{ 0xD4C8, 0xD4C8, 0xD4C8 }, -{ 0xD4C9, 0xD4C9, 0xD4C9 }, -{ 0xD4CA, 0xD4CA, 0xD4CA }, -{ 0xD4CB, 0xD4CB, 0xD4CB }, -{ 0xD4CC, 0xD4CC, 0xD4CC }, -{ 0xD4CD, 0xD4CD, 0xD4CD }, -{ 0xD4CE, 0xD4CE, 0xD4CE }, -{ 0xD4CF, 0xD4CF, 0xD4CF }, -{ 0xD4D0, 0xD4D0, 0xD4D0 }, -{ 0xD4D1, 0xD4D1, 0xD4D1 }, -{ 0xD4D2, 0xD4D2, 0xD4D2 }, -{ 0xD4D3, 0xD4D3, 0xD4D3 }, -{ 0xD4D4, 0xD4D4, 0xD4D4 }, -{ 0xD4D5, 0xD4D5, 0xD4D5 }, -{ 0xD4D6, 0xD4D6, 0xD4D6 }, -{ 0xD4D7, 0xD4D7, 0xD4D7 }, -{ 0xD4D8, 0xD4D8, 0xD4D8 }, -{ 0xD4D9, 0xD4D9, 0xD4D9 }, -{ 0xD4DA, 0xD4DA, 0xD4DA }, -{ 0xD4DB, 0xD4DB, 0xD4DB }, -{ 0xD4DC, 0xD4DC, 0xD4DC }, -{ 0xD4DD, 0xD4DD, 0xD4DD }, -{ 0xD4DE, 0xD4DE, 0xD4DE }, -{ 0xD4DF, 0xD4DF, 0xD4DF }, -{ 0xD4E0, 0xD4E0, 0xD4E0 }, -{ 0xD4E1, 0xD4E1, 0xD4E1 }, -{ 0xD4E2, 0xD4E2, 0xD4E2 }, -{ 0xD4E3, 0xD4E3, 0xD4E3 }, -{ 0xD4E4, 0xD4E4, 0xD4E4 }, -{ 0xD4E5, 0xD4E5, 0xD4E5 }, -{ 0xD4E6, 0xD4E6, 0xD4E6 }, -{ 0xD4E7, 0xD4E7, 0xD4E7 }, -{ 0xD4E8, 0xD4E8, 0xD4E8 }, -{ 0xD4E9, 0xD4E9, 0xD4E9 }, -{ 0xD4EA, 0xD4EA, 0xD4EA }, -{ 0xD4EB, 0xD4EB, 0xD4EB }, -{ 0xD4EC, 0xD4EC, 0xD4EC }, -{ 0xD4ED, 0xD4ED, 0xD4ED }, -{ 0xD4EE, 0xD4EE, 0xD4EE }, -{ 0xD4EF, 0xD4EF, 0xD4EF }, -{ 0xD4F0, 0xD4F0, 0xD4F0 }, -{ 0xD4F1, 0xD4F1, 0xD4F1 }, -{ 0xD4F2, 0xD4F2, 0xD4F2 }, -{ 0xD4F3, 0xD4F3, 0xD4F3 }, -{ 0xD4F4, 0xD4F4, 0xD4F4 }, -{ 0xD4F5, 0xD4F5, 0xD4F5 }, -{ 0xD4F6, 0xD4F6, 0xD4F6 }, -{ 0xD4F7, 0xD4F7, 0xD4F7 }, -{ 0xD4F8, 0xD4F8, 0xD4F8 }, -{ 0xD4F9, 0xD4F9, 0xD4F9 }, -{ 0xD4FA, 0xD4FA, 0xD4FA }, -{ 0xD4FB, 0xD4FB, 0xD4FB }, -{ 0xD4FC, 0xD4FC, 0xD4FC }, -{ 0xD4FD, 0xD4FD, 0xD4FD }, -{ 0xD4FE, 0xD4FE, 0xD4FE }, -{ 0xD4FF, 0xD4FF, 0xD4FF }, -{ 0xD500, 0xD500, 0xD500 }, -{ 0xD501, 0xD501, 0xD501 }, -{ 0xD502, 0xD502, 0xD502 }, -{ 0xD503, 0xD503, 0xD503 }, -{ 0xD504, 0xD504, 0xD504 }, -{ 0xD505, 0xD505, 0xD505 }, -{ 0xD506, 0xD506, 0xD506 }, -{ 0xD507, 0xD507, 0xD507 }, -{ 0xD508, 0xD508, 0xD508 }, -{ 0xD509, 0xD509, 0xD509 }, -{ 0xD50A, 0xD50A, 0xD50A }, -{ 0xD50B, 0xD50B, 0xD50B }, -{ 0xD50C, 0xD50C, 0xD50C }, -{ 0xD50D, 0xD50D, 0xD50D }, -{ 0xD50E, 0xD50E, 0xD50E }, -{ 0xD50F, 0xD50F, 0xD50F }, -{ 0xD510, 0xD510, 0xD510 }, -{ 0xD511, 0xD511, 0xD511 }, -{ 0xD512, 0xD512, 0xD512 }, -{ 0xD513, 0xD513, 0xD513 }, -{ 0xD514, 0xD514, 0xD514 }, -{ 0xD515, 0xD515, 0xD515 }, -{ 0xD516, 0xD516, 0xD516 }, -{ 0xD517, 0xD517, 0xD517 }, -{ 0xD518, 0xD518, 0xD518 }, -{ 0xD519, 0xD519, 0xD519 }, -{ 0xD51A, 0xD51A, 0xD51A }, -{ 0xD51B, 0xD51B, 0xD51B }, -{ 0xD51C, 0xD51C, 0xD51C }, -{ 0xD51D, 0xD51D, 0xD51D }, -{ 0xD51E, 0xD51E, 0xD51E }, -{ 0xD51F, 0xD51F, 0xD51F }, -{ 0xD520, 0xD520, 0xD520 }, -{ 0xD521, 0xD521, 0xD521 }, -{ 0xD522, 0xD522, 0xD522 }, -{ 0xD523, 0xD523, 0xD523 }, -{ 0xD524, 0xD524, 0xD524 }, -{ 0xD525, 0xD525, 0xD525 }, -{ 0xD526, 0xD526, 0xD526 }, -{ 0xD527, 0xD527, 0xD527 }, -{ 0xD528, 0xD528, 0xD528 }, -{ 0xD529, 0xD529, 0xD529 }, -{ 0xD52A, 0xD52A, 0xD52A }, -{ 0xD52B, 0xD52B, 0xD52B }, -{ 0xD52C, 0xD52C, 0xD52C }, -{ 0xD52D, 0xD52D, 0xD52D }, -{ 0xD52E, 0xD52E, 0xD52E }, -{ 0xD52F, 0xD52F, 0xD52F }, -{ 0xD530, 0xD530, 0xD530 }, -{ 0xD531, 0xD531, 0xD531 }, -{ 0xD532, 0xD532, 0xD532 }, -{ 0xD533, 0xD533, 0xD533 }, -{ 0xD534, 0xD534, 0xD534 }, -{ 0xD535, 0xD535, 0xD535 }, -{ 0xD536, 0xD536, 0xD536 }, -{ 0xD537, 0xD537, 0xD537 }, -{ 0xD538, 0xD538, 0xD538 }, -{ 0xD539, 0xD539, 0xD539 }, -{ 0xD53A, 0xD53A, 0xD53A }, -{ 0xD53B, 0xD53B, 0xD53B }, -{ 0xD53C, 0xD53C, 0xD53C }, -{ 0xD53D, 0xD53D, 0xD53D }, -{ 0xD53E, 0xD53E, 0xD53E }, -{ 0xD53F, 0xD53F, 0xD53F }, -{ 0xD540, 0xD540, 0xD540 }, -{ 0xD541, 0xD541, 0xD541 }, -{ 0xD542, 0xD542, 0xD542 }, -{ 0xD543, 0xD543, 0xD543 }, -{ 0xD544, 0xD544, 0xD544 }, -{ 0xD545, 0xD545, 0xD545 }, -{ 0xD546, 0xD546, 0xD546 }, -{ 0xD547, 0xD547, 0xD547 }, -{ 0xD548, 0xD548, 0xD548 }, -{ 0xD549, 0xD549, 0xD549 }, -{ 0xD54A, 0xD54A, 0xD54A }, -{ 0xD54B, 0xD54B, 0xD54B }, -{ 0xD54C, 0xD54C, 0xD54C }, -{ 0xD54D, 0xD54D, 0xD54D }, -{ 0xD54E, 0xD54E, 0xD54E }, -{ 0xD54F, 0xD54F, 0xD54F }, -{ 0xD550, 0xD550, 0xD550 }, -{ 0xD551, 0xD551, 0xD551 }, -{ 0xD552, 0xD552, 0xD552 }, -{ 0xD553, 0xD553, 0xD553 }, -{ 0xD554, 0xD554, 0xD554 }, -{ 0xD555, 0xD555, 0xD555 }, -{ 0xD556, 0xD556, 0xD556 }, -{ 0xD557, 0xD557, 0xD557 }, -{ 0xD558, 0xD558, 0xD558 }, -{ 0xD559, 0xD559, 0xD559 }, -{ 0xD55A, 0xD55A, 0xD55A }, -{ 0xD55B, 0xD55B, 0xD55B }, -{ 0xD55C, 0xD55C, 0xD55C }, -{ 0xD55D, 0xD55D, 0xD55D }, -{ 0xD55E, 0xD55E, 0xD55E }, -{ 0xD55F, 0xD55F, 0xD55F }, -{ 0xD560, 0xD560, 0xD560 }, -{ 0xD561, 0xD561, 0xD561 }, -{ 0xD562, 0xD562, 0xD562 }, -{ 0xD563, 0xD563, 0xD563 }, -{ 0xD564, 0xD564, 0xD564 }, -{ 0xD565, 0xD565, 0xD565 }, -{ 0xD566, 0xD566, 0xD566 }, -{ 0xD567, 0xD567, 0xD567 }, -{ 0xD568, 0xD568, 0xD568 }, -{ 0xD569, 0xD569, 0xD569 }, -{ 0xD56A, 0xD56A, 0xD56A }, -{ 0xD56B, 0xD56B, 0xD56B }, -{ 0xD56C, 0xD56C, 0xD56C }, -{ 0xD56D, 0xD56D, 0xD56D }, -{ 0xD56E, 0xD56E, 0xD56E }, -{ 0xD56F, 0xD56F, 0xD56F }, -{ 0xD570, 0xD570, 0xD570 }, -{ 0xD571, 0xD571, 0xD571 }, -{ 0xD572, 0xD572, 0xD572 }, -{ 0xD573, 0xD573, 0xD573 }, -{ 0xD574, 0xD574, 0xD574 }, -{ 0xD575, 0xD575, 0xD575 }, -{ 0xD576, 0xD576, 0xD576 }, -{ 0xD577, 0xD577, 0xD577 }, -{ 0xD578, 0xD578, 0xD578 }, -{ 0xD579, 0xD579, 0xD579 }, -{ 0xD57A, 0xD57A, 0xD57A }, -{ 0xD57B, 0xD57B, 0xD57B }, -{ 0xD57C, 0xD57C, 0xD57C }, -{ 0xD57D, 0xD57D, 0xD57D }, -{ 0xD57E, 0xD57E, 0xD57E }, -{ 0xD57F, 0xD57F, 0xD57F }, -{ 0xD580, 0xD580, 0xD580 }, -{ 0xD581, 0xD581, 0xD581 }, -{ 0xD582, 0xD582, 0xD582 }, -{ 0xD583, 0xD583, 0xD583 }, -{ 0xD584, 0xD584, 0xD584 }, -{ 0xD585, 0xD585, 0xD585 }, -{ 0xD586, 0xD586, 0xD586 }, -{ 0xD587, 0xD587, 0xD587 }, -{ 0xD588, 0xD588, 0xD588 }, -{ 0xD589, 0xD589, 0xD589 }, -{ 0xD58A, 0xD58A, 0xD58A }, -{ 0xD58B, 0xD58B, 0xD58B }, -{ 0xD58C, 0xD58C, 0xD58C }, -{ 0xD58D, 0xD58D, 0xD58D }, -{ 0xD58E, 0xD58E, 0xD58E }, -{ 0xD58F, 0xD58F, 0xD58F }, -{ 0xD590, 0xD590, 0xD590 }, -{ 0xD591, 0xD591, 0xD591 }, -{ 0xD592, 0xD592, 0xD592 }, -{ 0xD593, 0xD593, 0xD593 }, -{ 0xD594, 0xD594, 0xD594 }, -{ 0xD595, 0xD595, 0xD595 }, -{ 0xD596, 0xD596, 0xD596 }, -{ 0xD597, 0xD597, 0xD597 }, -{ 0xD598, 0xD598, 0xD598 }, -{ 0xD599, 0xD599, 0xD599 }, -{ 0xD59A, 0xD59A, 0xD59A }, -{ 0xD59B, 0xD59B, 0xD59B }, -{ 0xD59C, 0xD59C, 0xD59C }, -{ 0xD59D, 0xD59D, 0xD59D }, -{ 0xD59E, 0xD59E, 0xD59E }, -{ 0xD59F, 0xD59F, 0xD59F }, -{ 0xD5A0, 0xD5A0, 0xD5A0 }, -{ 0xD5A1, 0xD5A1, 0xD5A1 }, -{ 0xD5A2, 0xD5A2, 0xD5A2 }, -{ 0xD5A3, 0xD5A3, 0xD5A3 }, -{ 0xD5A4, 0xD5A4, 0xD5A4 }, -{ 0xD5A5, 0xD5A5, 0xD5A5 }, -{ 0xD5A6, 0xD5A6, 0xD5A6 }, -{ 0xD5A7, 0xD5A7, 0xD5A7 }, -{ 0xD5A8, 0xD5A8, 0xD5A8 }, -{ 0xD5A9, 0xD5A9, 0xD5A9 }, -{ 0xD5AA, 0xD5AA, 0xD5AA }, -{ 0xD5AB, 0xD5AB, 0xD5AB }, -{ 0xD5AC, 0xD5AC, 0xD5AC }, -{ 0xD5AD, 0xD5AD, 0xD5AD }, -{ 0xD5AE, 0xD5AE, 0xD5AE }, -{ 0xD5AF, 0xD5AF, 0xD5AF }, -{ 0xD5B0, 0xD5B0, 0xD5B0 }, -{ 0xD5B1, 0xD5B1, 0xD5B1 }, -{ 0xD5B2, 0xD5B2, 0xD5B2 }, -{ 0xD5B3, 0xD5B3, 0xD5B3 }, -{ 0xD5B4, 0xD5B4, 0xD5B4 }, -{ 0xD5B5, 0xD5B5, 0xD5B5 }, -{ 0xD5B6, 0xD5B6, 0xD5B6 }, -{ 0xD5B7, 0xD5B7, 0xD5B7 }, -{ 0xD5B8, 0xD5B8, 0xD5B8 }, -{ 0xD5B9, 0xD5B9, 0xD5B9 }, -{ 0xD5BA, 0xD5BA, 0xD5BA }, -{ 0xD5BB, 0xD5BB, 0xD5BB }, -{ 0xD5BC, 0xD5BC, 0xD5BC }, -{ 0xD5BD, 0xD5BD, 0xD5BD }, -{ 0xD5BE, 0xD5BE, 0xD5BE }, -{ 0xD5BF, 0xD5BF, 0xD5BF }, -{ 0xD5C0, 0xD5C0, 0xD5C0 }, -{ 0xD5C1, 0xD5C1, 0xD5C1 }, -{ 0xD5C2, 0xD5C2, 0xD5C2 }, -{ 0xD5C3, 0xD5C3, 0xD5C3 }, -{ 0xD5C4, 0xD5C4, 0xD5C4 }, -{ 0xD5C5, 0xD5C5, 0xD5C5 }, -{ 0xD5C6, 0xD5C6, 0xD5C6 }, -{ 0xD5C7, 0xD5C7, 0xD5C7 }, -{ 0xD5C8, 0xD5C8, 0xD5C8 }, -{ 0xD5C9, 0xD5C9, 0xD5C9 }, -{ 0xD5CA, 0xD5CA, 0xD5CA }, -{ 0xD5CB, 0xD5CB, 0xD5CB }, -{ 0xD5CC, 0xD5CC, 0xD5CC }, -{ 0xD5CD, 0xD5CD, 0xD5CD }, -{ 0xD5CE, 0xD5CE, 0xD5CE }, -{ 0xD5CF, 0xD5CF, 0xD5CF }, -{ 0xD5D0, 0xD5D0, 0xD5D0 }, -{ 0xD5D1, 0xD5D1, 0xD5D1 }, -{ 0xD5D2, 0xD5D2, 0xD5D2 }, -{ 0xD5D3, 0xD5D3, 0xD5D3 }, -{ 0xD5D4, 0xD5D4, 0xD5D4 }, -{ 0xD5D5, 0xD5D5, 0xD5D5 }, -{ 0xD5D6, 0xD5D6, 0xD5D6 }, -{ 0xD5D7, 0xD5D7, 0xD5D7 }, -{ 0xD5D8, 0xD5D8, 0xD5D8 }, -{ 0xD5D9, 0xD5D9, 0xD5D9 }, -{ 0xD5DA, 0xD5DA, 0xD5DA }, -{ 0xD5DB, 0xD5DB, 0xD5DB }, -{ 0xD5DC, 0xD5DC, 0xD5DC }, -{ 0xD5DD, 0xD5DD, 0xD5DD }, -{ 0xD5DE, 0xD5DE, 0xD5DE }, -{ 0xD5DF, 0xD5DF, 0xD5DF }, -{ 0xD5E0, 0xD5E0, 0xD5E0 }, -{ 0xD5E1, 0xD5E1, 0xD5E1 }, -{ 0xD5E2, 0xD5E2, 0xD5E2 }, -{ 0xD5E3, 0xD5E3, 0xD5E3 }, -{ 0xD5E4, 0xD5E4, 0xD5E4 }, -{ 0xD5E5, 0xD5E5, 0xD5E5 }, -{ 0xD5E6, 0xD5E6, 0xD5E6 }, -{ 0xD5E7, 0xD5E7, 0xD5E7 }, -{ 0xD5E8, 0xD5E8, 0xD5E8 }, -{ 0xD5E9, 0xD5E9, 0xD5E9 }, -{ 0xD5EA, 0xD5EA, 0xD5EA }, -{ 0xD5EB, 0xD5EB, 0xD5EB }, -{ 0xD5EC, 0xD5EC, 0xD5EC }, -{ 0xD5ED, 0xD5ED, 0xD5ED }, -{ 0xD5EE, 0xD5EE, 0xD5EE }, -{ 0xD5EF, 0xD5EF, 0xD5EF }, -{ 0xD5F0, 0xD5F0, 0xD5F0 }, -{ 0xD5F1, 0xD5F1, 0xD5F1 }, -{ 0xD5F2, 0xD5F2, 0xD5F2 }, -{ 0xD5F3, 0xD5F3, 0xD5F3 }, -{ 0xD5F4, 0xD5F4, 0xD5F4 }, -{ 0xD5F5, 0xD5F5, 0xD5F5 }, -{ 0xD5F6, 0xD5F6, 0xD5F6 }, -{ 0xD5F7, 0xD5F7, 0xD5F7 }, -{ 0xD5F8, 0xD5F8, 0xD5F8 }, -{ 0xD5F9, 0xD5F9, 0xD5F9 }, -{ 0xD5FA, 0xD5FA, 0xD5FA }, -{ 0xD5FB, 0xD5FB, 0xD5FB }, -{ 0xD5FC, 0xD5FC, 0xD5FC }, -{ 0xD5FD, 0xD5FD, 0xD5FD }, -{ 0xD5FE, 0xD5FE, 0xD5FE }, -{ 0xD5FF, 0xD5FF, 0xD5FF }, -{ 0xD600, 0xD600, 0xD600 }, -{ 0xD601, 0xD601, 0xD601 }, -{ 0xD602, 0xD602, 0xD602 }, -{ 0xD603, 0xD603, 0xD603 }, -{ 0xD604, 0xD604, 0xD604 }, -{ 0xD605, 0xD605, 0xD605 }, -{ 0xD606, 0xD606, 0xD606 }, -{ 0xD607, 0xD607, 0xD607 }, -{ 0xD608, 0xD608, 0xD608 }, -{ 0xD609, 0xD609, 0xD609 }, -{ 0xD60A, 0xD60A, 0xD60A }, -{ 0xD60B, 0xD60B, 0xD60B }, -{ 0xD60C, 0xD60C, 0xD60C }, -{ 0xD60D, 0xD60D, 0xD60D }, -{ 0xD60E, 0xD60E, 0xD60E }, -{ 0xD60F, 0xD60F, 0xD60F }, -{ 0xD610, 0xD610, 0xD610 }, -{ 0xD611, 0xD611, 0xD611 }, -{ 0xD612, 0xD612, 0xD612 }, -{ 0xD613, 0xD613, 0xD613 }, -{ 0xD614, 0xD614, 0xD614 }, -{ 0xD615, 0xD615, 0xD615 }, -{ 0xD616, 0xD616, 0xD616 }, -{ 0xD617, 0xD617, 0xD617 }, -{ 0xD618, 0xD618, 0xD618 }, -{ 0xD619, 0xD619, 0xD619 }, -{ 0xD61A, 0xD61A, 0xD61A }, -{ 0xD61B, 0xD61B, 0xD61B }, -{ 0xD61C, 0xD61C, 0xD61C }, -{ 0xD61D, 0xD61D, 0xD61D }, -{ 0xD61E, 0xD61E, 0xD61E }, -{ 0xD61F, 0xD61F, 0xD61F }, -{ 0xD620, 0xD620, 0xD620 }, -{ 0xD621, 0xD621, 0xD621 }, -{ 0xD622, 0xD622, 0xD622 }, -{ 0xD623, 0xD623, 0xD623 }, -{ 0xD624, 0xD624, 0xD624 }, -{ 0xD625, 0xD625, 0xD625 }, -{ 0xD626, 0xD626, 0xD626 }, -{ 0xD627, 0xD627, 0xD627 }, -{ 0xD628, 0xD628, 0xD628 }, -{ 0xD629, 0xD629, 0xD629 }, -{ 0xD62A, 0xD62A, 0xD62A }, -{ 0xD62B, 0xD62B, 0xD62B }, -{ 0xD62C, 0xD62C, 0xD62C }, -{ 0xD62D, 0xD62D, 0xD62D }, -{ 0xD62E, 0xD62E, 0xD62E }, -{ 0xD62F, 0xD62F, 0xD62F }, -{ 0xD630, 0xD630, 0xD630 }, -{ 0xD631, 0xD631, 0xD631 }, -{ 0xD632, 0xD632, 0xD632 }, -{ 0xD633, 0xD633, 0xD633 }, -{ 0xD634, 0xD634, 0xD634 }, -{ 0xD635, 0xD635, 0xD635 }, -{ 0xD636, 0xD636, 0xD636 }, -{ 0xD637, 0xD637, 0xD637 }, -{ 0xD638, 0xD638, 0xD638 }, -{ 0xD639, 0xD639, 0xD639 }, -{ 0xD63A, 0xD63A, 0xD63A }, -{ 0xD63B, 0xD63B, 0xD63B }, -{ 0xD63C, 0xD63C, 0xD63C }, -{ 0xD63D, 0xD63D, 0xD63D }, -{ 0xD63E, 0xD63E, 0xD63E }, -{ 0xD63F, 0xD63F, 0xD63F }, -{ 0xD640, 0xD640, 0xD640 }, -{ 0xD641, 0xD641, 0xD641 }, -{ 0xD642, 0xD642, 0xD642 }, -{ 0xD643, 0xD643, 0xD643 }, -{ 0xD644, 0xD644, 0xD644 }, -{ 0xD645, 0xD645, 0xD645 }, -{ 0xD646, 0xD646, 0xD646 }, -{ 0xD647, 0xD647, 0xD647 }, -{ 0xD648, 0xD648, 0xD648 }, -{ 0xD649, 0xD649, 0xD649 }, -{ 0xD64A, 0xD64A, 0xD64A }, -{ 0xD64B, 0xD64B, 0xD64B }, -{ 0xD64C, 0xD64C, 0xD64C }, -{ 0xD64D, 0xD64D, 0xD64D }, -{ 0xD64E, 0xD64E, 0xD64E }, -{ 0xD64F, 0xD64F, 0xD64F }, -{ 0xD650, 0xD650, 0xD650 }, -{ 0xD651, 0xD651, 0xD651 }, -{ 0xD652, 0xD652, 0xD652 }, -{ 0xD653, 0xD653, 0xD653 }, -{ 0xD654, 0xD654, 0xD654 }, -{ 0xD655, 0xD655, 0xD655 }, -{ 0xD656, 0xD656, 0xD656 }, -{ 0xD657, 0xD657, 0xD657 }, -{ 0xD658, 0xD658, 0xD658 }, -{ 0xD659, 0xD659, 0xD659 }, -{ 0xD65A, 0xD65A, 0xD65A }, -{ 0xD65B, 0xD65B, 0xD65B }, -{ 0xD65C, 0xD65C, 0xD65C }, -{ 0xD65D, 0xD65D, 0xD65D }, -{ 0xD65E, 0xD65E, 0xD65E }, -{ 0xD65F, 0xD65F, 0xD65F }, -{ 0xD660, 0xD660, 0xD660 }, -{ 0xD661, 0xD661, 0xD661 }, -{ 0xD662, 0xD662, 0xD662 }, -{ 0xD663, 0xD663, 0xD663 }, -{ 0xD664, 0xD664, 0xD664 }, -{ 0xD665, 0xD665, 0xD665 }, -{ 0xD666, 0xD666, 0xD666 }, -{ 0xD667, 0xD667, 0xD667 }, -{ 0xD668, 0xD668, 0xD668 }, -{ 0xD669, 0xD669, 0xD669 }, -{ 0xD66A, 0xD66A, 0xD66A }, -{ 0xD66B, 0xD66B, 0xD66B }, -{ 0xD66C, 0xD66C, 0xD66C }, -{ 0xD66D, 0xD66D, 0xD66D }, -{ 0xD66E, 0xD66E, 0xD66E }, -{ 0xD66F, 0xD66F, 0xD66F }, -{ 0xD670, 0xD670, 0xD670 }, -{ 0xD671, 0xD671, 0xD671 }, -{ 0xD672, 0xD672, 0xD672 }, -{ 0xD673, 0xD673, 0xD673 }, -{ 0xD674, 0xD674, 0xD674 }, -{ 0xD675, 0xD675, 0xD675 }, -{ 0xD676, 0xD676, 0xD676 }, -{ 0xD677, 0xD677, 0xD677 }, -{ 0xD678, 0xD678, 0xD678 }, -{ 0xD679, 0xD679, 0xD679 }, -{ 0xD67A, 0xD67A, 0xD67A }, -{ 0xD67B, 0xD67B, 0xD67B }, -{ 0xD67C, 0xD67C, 0xD67C }, -{ 0xD67D, 0xD67D, 0xD67D }, -{ 0xD67E, 0xD67E, 0xD67E }, -{ 0xD67F, 0xD67F, 0xD67F }, -{ 0xD680, 0xD680, 0xD680 }, -{ 0xD681, 0xD681, 0xD681 }, -{ 0xD682, 0xD682, 0xD682 }, -{ 0xD683, 0xD683, 0xD683 }, -{ 0xD684, 0xD684, 0xD684 }, -{ 0xD685, 0xD685, 0xD685 }, -{ 0xD686, 0xD686, 0xD686 }, -{ 0xD687, 0xD687, 0xD687 }, -{ 0xD688, 0xD688, 0xD688 }, -{ 0xD689, 0xD689, 0xD689 }, -{ 0xD68A, 0xD68A, 0xD68A }, -{ 0xD68B, 0xD68B, 0xD68B }, -{ 0xD68C, 0xD68C, 0xD68C }, -{ 0xD68D, 0xD68D, 0xD68D }, -{ 0xD68E, 0xD68E, 0xD68E }, -{ 0xD68F, 0xD68F, 0xD68F }, -{ 0xD690, 0xD690, 0xD690 }, -{ 0xD691, 0xD691, 0xD691 }, -{ 0xD692, 0xD692, 0xD692 }, -{ 0xD693, 0xD693, 0xD693 }, -{ 0xD694, 0xD694, 0xD694 }, -{ 0xD695, 0xD695, 0xD695 }, -{ 0xD696, 0xD696, 0xD696 }, -{ 0xD697, 0xD697, 0xD697 }, -{ 0xD698, 0xD698, 0xD698 }, -{ 0xD699, 0xD699, 0xD699 }, -{ 0xD69A, 0xD69A, 0xD69A }, -{ 0xD69B, 0xD69B, 0xD69B }, -{ 0xD69C, 0xD69C, 0xD69C }, -{ 0xD69D, 0xD69D, 0xD69D }, -{ 0xD69E, 0xD69E, 0xD69E }, -{ 0xD69F, 0xD69F, 0xD69F }, -{ 0xD6A0, 0xD6A0, 0xD6A0 }, -{ 0xD6A1, 0xD6A1, 0xD6A1 }, -{ 0xD6A2, 0xD6A2, 0xD6A2 }, -{ 0xD6A3, 0xD6A3, 0xD6A3 }, -{ 0xD6A4, 0xD6A4, 0xD6A4 }, -{ 0xD6A5, 0xD6A5, 0xD6A5 }, -{ 0xD6A6, 0xD6A6, 0xD6A6 }, -{ 0xD6A7, 0xD6A7, 0xD6A7 }, -{ 0xD6A8, 0xD6A8, 0xD6A8 }, -{ 0xD6A9, 0xD6A9, 0xD6A9 }, -{ 0xD6AA, 0xD6AA, 0xD6AA }, -{ 0xD6AB, 0xD6AB, 0xD6AB }, -{ 0xD6AC, 0xD6AC, 0xD6AC }, -{ 0xD6AD, 0xD6AD, 0xD6AD }, -{ 0xD6AE, 0xD6AE, 0xD6AE }, -{ 0xD6AF, 0xD6AF, 0xD6AF }, -{ 0xD6B0, 0xD6B0, 0xD6B0 }, -{ 0xD6B1, 0xD6B1, 0xD6B1 }, -{ 0xD6B2, 0xD6B2, 0xD6B2 }, -{ 0xD6B3, 0xD6B3, 0xD6B3 }, -{ 0xD6B4, 0xD6B4, 0xD6B4 }, -{ 0xD6B5, 0xD6B5, 0xD6B5 }, -{ 0xD6B6, 0xD6B6, 0xD6B6 }, -{ 0xD6B7, 0xD6B7, 0xD6B7 }, -{ 0xD6B8, 0xD6B8, 0xD6B8 }, -{ 0xD6B9, 0xD6B9, 0xD6B9 }, -{ 0xD6BA, 0xD6BA, 0xD6BA }, -{ 0xD6BB, 0xD6BB, 0xD6BB }, -{ 0xD6BC, 0xD6BC, 0xD6BC }, -{ 0xD6BD, 0xD6BD, 0xD6BD }, -{ 0xD6BE, 0xD6BE, 0xD6BE }, -{ 0xD6BF, 0xD6BF, 0xD6BF }, -{ 0xD6C0, 0xD6C0, 0xD6C0 }, -{ 0xD6C1, 0xD6C1, 0xD6C1 }, -{ 0xD6C2, 0xD6C2, 0xD6C2 }, -{ 0xD6C3, 0xD6C3, 0xD6C3 }, -{ 0xD6C4, 0xD6C4, 0xD6C4 }, -{ 0xD6C5, 0xD6C5, 0xD6C5 }, -{ 0xD6C6, 0xD6C6, 0xD6C6 }, -{ 0xD6C7, 0xD6C7, 0xD6C7 }, -{ 0xD6C8, 0xD6C8, 0xD6C8 }, -{ 0xD6C9, 0xD6C9, 0xD6C9 }, -{ 0xD6CA, 0xD6CA, 0xD6CA }, -{ 0xD6CB, 0xD6CB, 0xD6CB }, -{ 0xD6CC, 0xD6CC, 0xD6CC }, -{ 0xD6CD, 0xD6CD, 0xD6CD }, -{ 0xD6CE, 0xD6CE, 0xD6CE }, -{ 0xD6CF, 0xD6CF, 0xD6CF }, -{ 0xD6D0, 0xD6D0, 0xD6D0 }, -{ 0xD6D1, 0xD6D1, 0xD6D1 }, -{ 0xD6D2, 0xD6D2, 0xD6D2 }, -{ 0xD6D3, 0xD6D3, 0xD6D3 }, -{ 0xD6D4, 0xD6D4, 0xD6D4 }, -{ 0xD6D5, 0xD6D5, 0xD6D5 }, -{ 0xD6D6, 0xD6D6, 0xD6D6 }, -{ 0xD6D7, 0xD6D7, 0xD6D7 }, -{ 0xD6D8, 0xD6D8, 0xD6D8 }, -{ 0xD6D9, 0xD6D9, 0xD6D9 }, -{ 0xD6DA, 0xD6DA, 0xD6DA }, -{ 0xD6DB, 0xD6DB, 0xD6DB }, -{ 0xD6DC, 0xD6DC, 0xD6DC }, -{ 0xD6DD, 0xD6DD, 0xD6DD }, -{ 0xD6DE, 0xD6DE, 0xD6DE }, -{ 0xD6DF, 0xD6DF, 0xD6DF }, -{ 0xD6E0, 0xD6E0, 0xD6E0 }, -{ 0xD6E1, 0xD6E1, 0xD6E1 }, -{ 0xD6E2, 0xD6E2, 0xD6E2 }, -{ 0xD6E3, 0xD6E3, 0xD6E3 }, -{ 0xD6E4, 0xD6E4, 0xD6E4 }, -{ 0xD6E5, 0xD6E5, 0xD6E5 }, -{ 0xD6E6, 0xD6E6, 0xD6E6 }, -{ 0xD6E7, 0xD6E7, 0xD6E7 }, -{ 0xD6E8, 0xD6E8, 0xD6E8 }, -{ 0xD6E9, 0xD6E9, 0xD6E9 }, -{ 0xD6EA, 0xD6EA, 0xD6EA }, -{ 0xD6EB, 0xD6EB, 0xD6EB }, -{ 0xD6EC, 0xD6EC, 0xD6EC }, -{ 0xD6ED, 0xD6ED, 0xD6ED }, -{ 0xD6EE, 0xD6EE, 0xD6EE }, -{ 0xD6EF, 0xD6EF, 0xD6EF }, -{ 0xD6F0, 0xD6F0, 0xD6F0 }, -{ 0xD6F1, 0xD6F1, 0xD6F1 }, -{ 0xD6F2, 0xD6F2, 0xD6F2 }, -{ 0xD6F3, 0xD6F3, 0xD6F3 }, -{ 0xD6F4, 0xD6F4, 0xD6F4 }, -{ 0xD6F5, 0xD6F5, 0xD6F5 }, -{ 0xD6F6, 0xD6F6, 0xD6F6 }, -{ 0xD6F7, 0xD6F7, 0xD6F7 }, -{ 0xD6F8, 0xD6F8, 0xD6F8 }, -{ 0xD6F9, 0xD6F9, 0xD6F9 }, -{ 0xD6FA, 0xD6FA, 0xD6FA }, -{ 0xD6FB, 0xD6FB, 0xD6FB }, -{ 0xD6FC, 0xD6FC, 0xD6FC }, -{ 0xD6FD, 0xD6FD, 0xD6FD }, -{ 0xD6FE, 0xD6FE, 0xD6FE }, -{ 0xD6FF, 0xD6FF, 0xD6FF }, -{ 0xD700, 0xD700, 0xD700 }, -{ 0xD701, 0xD701, 0xD701 }, -{ 0xD702, 0xD702, 0xD702 }, -{ 0xD703, 0xD703, 0xD703 }, -{ 0xD704, 0xD704, 0xD704 }, -{ 0xD705, 0xD705, 0xD705 }, -{ 0xD706, 0xD706, 0xD706 }, -{ 0xD707, 0xD707, 0xD707 }, -{ 0xD708, 0xD708, 0xD708 }, -{ 0xD709, 0xD709, 0xD709 }, -{ 0xD70A, 0xD70A, 0xD70A }, -{ 0xD70B, 0xD70B, 0xD70B }, -{ 0xD70C, 0xD70C, 0xD70C }, -{ 0xD70D, 0xD70D, 0xD70D }, -{ 0xD70E, 0xD70E, 0xD70E }, -{ 0xD70F, 0xD70F, 0xD70F }, -{ 0xD710, 0xD710, 0xD710 }, -{ 0xD711, 0xD711, 0xD711 }, -{ 0xD712, 0xD712, 0xD712 }, -{ 0xD713, 0xD713, 0xD713 }, -{ 0xD714, 0xD714, 0xD714 }, -{ 0xD715, 0xD715, 0xD715 }, -{ 0xD716, 0xD716, 0xD716 }, -{ 0xD717, 0xD717, 0xD717 }, -{ 0xD718, 0xD718, 0xD718 }, -{ 0xD719, 0xD719, 0xD719 }, -{ 0xD71A, 0xD71A, 0xD71A }, -{ 0xD71B, 0xD71B, 0xD71B }, -{ 0xD71C, 0xD71C, 0xD71C }, -{ 0xD71D, 0xD71D, 0xD71D }, -{ 0xD71E, 0xD71E, 0xD71E }, -{ 0xD71F, 0xD71F, 0xD71F }, -{ 0xD720, 0xD720, 0xD720 }, -{ 0xD721, 0xD721, 0xD721 }, -{ 0xD722, 0xD722, 0xD722 }, -{ 0xD723, 0xD723, 0xD723 }, -{ 0xD724, 0xD724, 0xD724 }, -{ 0xD725, 0xD725, 0xD725 }, -{ 0xD726, 0xD726, 0xD726 }, -{ 0xD727, 0xD727, 0xD727 }, -{ 0xD728, 0xD728, 0xD728 }, -{ 0xD729, 0xD729, 0xD729 }, -{ 0xD72A, 0xD72A, 0xD72A }, -{ 0xD72B, 0xD72B, 0xD72B }, -{ 0xD72C, 0xD72C, 0xD72C }, -{ 0xD72D, 0xD72D, 0xD72D }, -{ 0xD72E, 0xD72E, 0xD72E }, -{ 0xD72F, 0xD72F, 0xD72F }, -{ 0xD730, 0xD730, 0xD730 }, -{ 0xD731, 0xD731, 0xD731 }, -{ 0xD732, 0xD732, 0xD732 }, -{ 0xD733, 0xD733, 0xD733 }, -{ 0xD734, 0xD734, 0xD734 }, -{ 0xD735, 0xD735, 0xD735 }, -{ 0xD736, 0xD736, 0xD736 }, -{ 0xD737, 0xD737, 0xD737 }, -{ 0xD738, 0xD738, 0xD738 }, -{ 0xD739, 0xD739, 0xD739 }, -{ 0xD73A, 0xD73A, 0xD73A }, -{ 0xD73B, 0xD73B, 0xD73B }, -{ 0xD73C, 0xD73C, 0xD73C }, -{ 0xD73D, 0xD73D, 0xD73D }, -{ 0xD73E, 0xD73E, 0xD73E }, -{ 0xD73F, 0xD73F, 0xD73F }, -{ 0xD740, 0xD740, 0xD740 }, -{ 0xD741, 0xD741, 0xD741 }, -{ 0xD742, 0xD742, 0xD742 }, -{ 0xD743, 0xD743, 0xD743 }, -{ 0xD744, 0xD744, 0xD744 }, -{ 0xD745, 0xD745, 0xD745 }, -{ 0xD746, 0xD746, 0xD746 }, -{ 0xD747, 0xD747, 0xD747 }, -{ 0xD748, 0xD748, 0xD748 }, -{ 0xD749, 0xD749, 0xD749 }, -{ 0xD74A, 0xD74A, 0xD74A }, -{ 0xD74B, 0xD74B, 0xD74B }, -{ 0xD74C, 0xD74C, 0xD74C }, -{ 0xD74D, 0xD74D, 0xD74D }, -{ 0xD74E, 0xD74E, 0xD74E }, -{ 0xD74F, 0xD74F, 0xD74F }, -{ 0xD750, 0xD750, 0xD750 }, -{ 0xD751, 0xD751, 0xD751 }, -{ 0xD752, 0xD752, 0xD752 }, -{ 0xD753, 0xD753, 0xD753 }, -{ 0xD754, 0xD754, 0xD754 }, -{ 0xD755, 0xD755, 0xD755 }, -{ 0xD756, 0xD756, 0xD756 }, -{ 0xD757, 0xD757, 0xD757 }, -{ 0xD758, 0xD758, 0xD758 }, -{ 0xD759, 0xD759, 0xD759 }, -{ 0xD75A, 0xD75A, 0xD75A }, -{ 0xD75B, 0xD75B, 0xD75B }, -{ 0xD75C, 0xD75C, 0xD75C }, -{ 0xD75D, 0xD75D, 0xD75D }, -{ 0xD75E, 0xD75E, 0xD75E }, -{ 0xD75F, 0xD75F, 0xD75F }, -{ 0xD760, 0xD760, 0xD760 }, -{ 0xD761, 0xD761, 0xD761 }, -{ 0xD762, 0xD762, 0xD762 }, -{ 0xD763, 0xD763, 0xD763 }, -{ 0xD764, 0xD764, 0xD764 }, -{ 0xD765, 0xD765, 0xD765 }, -{ 0xD766, 0xD766, 0xD766 }, -{ 0xD767, 0xD767, 0xD767 }, -{ 0xD768, 0xD768, 0xD768 }, -{ 0xD769, 0xD769, 0xD769 }, -{ 0xD76A, 0xD76A, 0xD76A }, -{ 0xD76B, 0xD76B, 0xD76B }, -{ 0xD76C, 0xD76C, 0xD76C }, -{ 0xD76D, 0xD76D, 0xD76D }, -{ 0xD76E, 0xD76E, 0xD76E }, -{ 0xD76F, 0xD76F, 0xD76F }, -{ 0xD770, 0xD770, 0xD770 }, -{ 0xD771, 0xD771, 0xD771 }, -{ 0xD772, 0xD772, 0xD772 }, -{ 0xD773, 0xD773, 0xD773 }, -{ 0xD774, 0xD774, 0xD774 }, -{ 0xD775, 0xD775, 0xD775 }, -{ 0xD776, 0xD776, 0xD776 }, -{ 0xD777, 0xD777, 0xD777 }, -{ 0xD778, 0xD778, 0xD778 }, -{ 0xD779, 0xD779, 0xD779 }, -{ 0xD77A, 0xD77A, 0xD77A }, -{ 0xD77B, 0xD77B, 0xD77B }, -{ 0xD77C, 0xD77C, 0xD77C }, -{ 0xD77D, 0xD77D, 0xD77D }, -{ 0xD77E, 0xD77E, 0xD77E }, -{ 0xD77F, 0xD77F, 0xD77F }, -{ 0xD780, 0xD780, 0xD780 }, -{ 0xD781, 0xD781, 0xD781 }, -{ 0xD782, 0xD782, 0xD782 }, -{ 0xD783, 0xD783, 0xD783 }, -{ 0xD784, 0xD784, 0xD784 }, -{ 0xD785, 0xD785, 0xD785 }, -{ 0xD786, 0xD786, 0xD786 }, -{ 0xD787, 0xD787, 0xD787 }, -{ 0xD788, 0xD788, 0xD788 }, -{ 0xD789, 0xD789, 0xD789 }, -{ 0xD78A, 0xD78A, 0xD78A }, -{ 0xD78B, 0xD78B, 0xD78B }, -{ 0xD78C, 0xD78C, 0xD78C }, -{ 0xD78D, 0xD78D, 0xD78D }, -{ 0xD78E, 0xD78E, 0xD78E }, -{ 0xD78F, 0xD78F, 0xD78F }, -{ 0xD790, 0xD790, 0xD790 }, -{ 0xD791, 0xD791, 0xD791 }, -{ 0xD792, 0xD792, 0xD792 }, -{ 0xD793, 0xD793, 0xD793 }, -{ 0xD794, 0xD794, 0xD794 }, -{ 0xD795, 0xD795, 0xD795 }, -{ 0xD796, 0xD796, 0xD796 }, -{ 0xD797, 0xD797, 0xD797 }, -{ 0xD798, 0xD798, 0xD798 }, -{ 0xD799, 0xD799, 0xD799 }, -{ 0xD79A, 0xD79A, 0xD79A }, -{ 0xD79B, 0xD79B, 0xD79B }, -{ 0xD79C, 0xD79C, 0xD79C }, -{ 0xD79D, 0xD79D, 0xD79D }, -{ 0xD79E, 0xD79E, 0xD79E }, -{ 0xD79F, 0xD79F, 0xD79F }, -{ 0xD7A0, 0xD7A0, 0xD7A0 }, -{ 0xD7A1, 0xD7A1, 0xD7A1 }, -{ 0xD7A2, 0xD7A2, 0xD7A2 }, -{ 0xD7A3, 0xD7A3, 0xD7A3 }, -{ 0xF900, 0xF900, 0xF900 }, -{ 0xF901, 0xF901, 0xF901 }, -{ 0xF902, 0xF902, 0xF902 }, -{ 0xF903, 0xF903, 0xF903 }, -{ 0xF904, 0xF904, 0xF904 }, -{ 0xF905, 0xF905, 0xF905 }, -{ 0xF906, 0xF906, 0xF906 }, -{ 0xF907, 0xF907, 0xF907 }, -{ 0xF908, 0xF908, 0xF908 }, -{ 0xF909, 0xF909, 0xF909 }, -{ 0xF90A, 0xF90A, 0xF90A }, -{ 0xF90B, 0xF90B, 0xF90B }, -{ 0xF90C, 0xF90C, 0xF90C }, -{ 0xF90D, 0xF90D, 0xF90D }, -{ 0xF90E, 0xF90E, 0xF90E }, -{ 0xF90F, 0xF90F, 0xF90F }, -{ 0xF910, 0xF910, 0xF910 }, -{ 0xF911, 0xF911, 0xF911 }, -{ 0xF912, 0xF912, 0xF912 }, -{ 0xF913, 0xF913, 0xF913 }, -{ 0xF914, 0xF914, 0xF914 }, -{ 0xF915, 0xF915, 0xF915 }, -{ 0xF916, 0xF916, 0xF916 }, -{ 0xF917, 0xF917, 0xF917 }, -{ 0xF918, 0xF918, 0xF918 }, -{ 0xF919, 0xF919, 0xF919 }, -{ 0xF91A, 0xF91A, 0xF91A }, -{ 0xF91B, 0xF91B, 0xF91B }, -{ 0xF91C, 0xF91C, 0xF91C }, -{ 0xF91D, 0xF91D, 0xF91D }, -{ 0xF91E, 0xF91E, 0xF91E }, -{ 0xF91F, 0xF91F, 0xF91F }, -{ 0xF920, 0xF920, 0xF920 }, -{ 0xF921, 0xF921, 0xF921 }, -{ 0xF922, 0xF922, 0xF922 }, -{ 0xF923, 0xF923, 0xF923 }, -{ 0xF924, 0xF924, 0xF924 }, -{ 0xF925, 0xF925, 0xF925 }, -{ 0xF926, 0xF926, 0xF926 }, -{ 0xF927, 0xF927, 0xF927 }, -{ 0xF928, 0xF928, 0xF928 }, -{ 0xF929, 0xF929, 0xF929 }, -{ 0xF92A, 0xF92A, 0xF92A }, -{ 0xF92B, 0xF92B, 0xF92B }, -{ 0xF92C, 0xF92C, 0xF92C }, -{ 0xF92D, 0xF92D, 0xF92D }, -{ 0xF92E, 0xF92E, 0xF92E }, -{ 0xF92F, 0xF92F, 0xF92F }, -{ 0xF930, 0xF930, 0xF930 }, -{ 0xF931, 0xF931, 0xF931 }, -{ 0xF932, 0xF932, 0xF932 }, -{ 0xF933, 0xF933, 0xF933 }, -{ 0xF934, 0xF934, 0xF934 }, -{ 0xF935, 0xF935, 0xF935 }, -{ 0xF936, 0xF936, 0xF936 }, -{ 0xF937, 0xF937, 0xF937 }, -{ 0xF938, 0xF938, 0xF938 }, -{ 0xF939, 0xF939, 0xF939 }, -{ 0xF93A, 0xF93A, 0xF93A }, -{ 0xF93B, 0xF93B, 0xF93B }, -{ 0xF93C, 0xF93C, 0xF93C }, -{ 0xF93D, 0xF93D, 0xF93D }, -{ 0xF93E, 0xF93E, 0xF93E }, -{ 0xF93F, 0xF93F, 0xF93F }, -{ 0xF940, 0xF940, 0xF940 }, -{ 0xF941, 0xF941, 0xF941 }, -{ 0xF942, 0xF942, 0xF942 }, -{ 0xF943, 0xF943, 0xF943 }, -{ 0xF944, 0xF944, 0xF944 }, -{ 0xF945, 0xF945, 0xF945 }, -{ 0xF946, 0xF946, 0xF946 }, -{ 0xF947, 0xF947, 0xF947 }, -{ 0xF948, 0xF948, 0xF948 }, -{ 0xF949, 0xF949, 0xF949 }, -{ 0xF94A, 0xF94A, 0xF94A }, -{ 0xF94B, 0xF94B, 0xF94B }, -{ 0xF94C, 0xF94C, 0xF94C }, -{ 0xF94D, 0xF94D, 0xF94D }, -{ 0xF94E, 0xF94E, 0xF94E }, -{ 0xF94F, 0xF94F, 0xF94F }, -{ 0xF950, 0xF950, 0xF950 }, -{ 0xF951, 0xF951, 0xF951 }, -{ 0xF952, 0xF952, 0xF952 }, -{ 0xF953, 0xF953, 0xF953 }, -{ 0xF954, 0xF954, 0xF954 }, -{ 0xF955, 0xF955, 0xF955 }, -{ 0xF956, 0xF956, 0xF956 }, -{ 0xF957, 0xF957, 0xF957 }, -{ 0xF958, 0xF958, 0xF958 }, -{ 0xF959, 0xF959, 0xF959 }, -{ 0xF95A, 0xF95A, 0xF95A }, -{ 0xF95B, 0xF95B, 0xF95B }, -{ 0xF95C, 0xF95C, 0xF95C }, -{ 0xF95D, 0xF95D, 0xF95D }, -{ 0xF95E, 0xF95E, 0xF95E }, -{ 0xF95F, 0xF95F, 0xF95F }, -{ 0xF960, 0xF960, 0xF960 }, -{ 0xF961, 0xF961, 0xF961 }, -{ 0xF962, 0xF962, 0xF962 }, -{ 0xF963, 0xF963, 0xF963 }, -{ 0xF964, 0xF964, 0xF964 }, -{ 0xF965, 0xF965, 0xF965 }, -{ 0xF966, 0xF966, 0xF966 }, -{ 0xF967, 0xF967, 0xF967 }, -{ 0xF968, 0xF968, 0xF968 }, -{ 0xF969, 0xF969, 0xF969 }, -{ 0xF96A, 0xF96A, 0xF96A }, -{ 0xF96B, 0xF96B, 0xF96B }, -{ 0xF96C, 0xF96C, 0xF96C }, -{ 0xF96D, 0xF96D, 0xF96D }, -{ 0xF96E, 0xF96E, 0xF96E }, -{ 0xF96F, 0xF96F, 0xF96F }, -{ 0xF970, 0xF970, 0xF970 }, -{ 0xF971, 0xF971, 0xF971 }, -{ 0xF972, 0xF972, 0xF972 }, -{ 0xF973, 0xF973, 0xF973 }, -{ 0xF974, 0xF974, 0xF974 }, -{ 0xF975, 0xF975, 0xF975 }, -{ 0xF976, 0xF976, 0xF976 }, -{ 0xF977, 0xF977, 0xF977 }, -{ 0xF978, 0xF978, 0xF978 }, -{ 0xF979, 0xF979, 0xF979 }, -{ 0xF97A, 0xF97A, 0xF97A }, -{ 0xF97B, 0xF97B, 0xF97B }, -{ 0xF97C, 0xF97C, 0xF97C }, -{ 0xF97D, 0xF97D, 0xF97D }, -{ 0xF97E, 0xF97E, 0xF97E }, -{ 0xF97F, 0xF97F, 0xF97F }, -{ 0xF980, 0xF980, 0xF980 }, -{ 0xF981, 0xF981, 0xF981 }, -{ 0xF982, 0xF982, 0xF982 }, -{ 0xF983, 0xF983, 0xF983 }, -{ 0xF984, 0xF984, 0xF984 }, -{ 0xF985, 0xF985, 0xF985 }, -{ 0xF986, 0xF986, 0xF986 }, -{ 0xF987, 0xF987, 0xF987 }, -{ 0xF988, 0xF988, 0xF988 }, -{ 0xF989, 0xF989, 0xF989 }, -{ 0xF98A, 0xF98A, 0xF98A }, -{ 0xF98B, 0xF98B, 0xF98B }, -{ 0xF98C, 0xF98C, 0xF98C }, -{ 0xF98D, 0xF98D, 0xF98D }, -{ 0xF98E, 0xF98E, 0xF98E }, -{ 0xF98F, 0xF98F, 0xF98F }, -{ 0xF990, 0xF990, 0xF990 }, -{ 0xF991, 0xF991, 0xF991 }, -{ 0xF992, 0xF992, 0xF992 }, -{ 0xF993, 0xF993, 0xF993 }, -{ 0xF994, 0xF994, 0xF994 }, -{ 0xF995, 0xF995, 0xF995 }, -{ 0xF996, 0xF996, 0xF996 }, -{ 0xF997, 0xF997, 0xF997 }, -{ 0xF998, 0xF998, 0xF998 }, -{ 0xF999, 0xF999, 0xF999 }, -{ 0xF99A, 0xF99A, 0xF99A }, -{ 0xF99B, 0xF99B, 0xF99B }, -{ 0xF99C, 0xF99C, 0xF99C }, -{ 0xF99D, 0xF99D, 0xF99D }, -{ 0xF99E, 0xF99E, 0xF99E }, -{ 0xF99F, 0xF99F, 0xF99F }, -{ 0xF9A0, 0xF9A0, 0xF9A0 }, -{ 0xF9A1, 0xF9A1, 0xF9A1 }, -{ 0xF9A2, 0xF9A2, 0xF9A2 }, -{ 0xF9A3, 0xF9A3, 0xF9A3 }, -{ 0xF9A4, 0xF9A4, 0xF9A4 }, -{ 0xF9A5, 0xF9A5, 0xF9A5 }, -{ 0xF9A6, 0xF9A6, 0xF9A6 }, -{ 0xF9A7, 0xF9A7, 0xF9A7 }, -{ 0xF9A8, 0xF9A8, 0xF9A8 }, -{ 0xF9A9, 0xF9A9, 0xF9A9 }, -{ 0xF9AA, 0xF9AA, 0xF9AA }, -{ 0xF9AB, 0xF9AB, 0xF9AB }, -{ 0xF9AC, 0xF9AC, 0xF9AC }, -{ 0xF9AD, 0xF9AD, 0xF9AD }, -{ 0xF9AE, 0xF9AE, 0xF9AE }, -{ 0xF9AF, 0xF9AF, 0xF9AF }, -{ 0xF9B0, 0xF9B0, 0xF9B0 }, -{ 0xF9B1, 0xF9B1, 0xF9B1 }, -{ 0xF9B2, 0xF9B2, 0xF9B2 }, -{ 0xF9B3, 0xF9B3, 0xF9B3 }, -{ 0xF9B4, 0xF9B4, 0xF9B4 }, -{ 0xF9B5, 0xF9B5, 0xF9B5 }, -{ 0xF9B6, 0xF9B6, 0xF9B6 }, -{ 0xF9B7, 0xF9B7, 0xF9B7 }, -{ 0xF9B8, 0xF9B8, 0xF9B8 }, -{ 0xF9B9, 0xF9B9, 0xF9B9 }, -{ 0xF9BA, 0xF9BA, 0xF9BA }, -{ 0xF9BB, 0xF9BB, 0xF9BB }, -{ 0xF9BC, 0xF9BC, 0xF9BC }, -{ 0xF9BD, 0xF9BD, 0xF9BD }, -{ 0xF9BE, 0xF9BE, 0xF9BE }, -{ 0xF9BF, 0xF9BF, 0xF9BF }, -{ 0xF9C0, 0xF9C0, 0xF9C0 }, -{ 0xF9C1, 0xF9C1, 0xF9C1 }, -{ 0xF9C2, 0xF9C2, 0xF9C2 }, -{ 0xF9C3, 0xF9C3, 0xF9C3 }, -{ 0xF9C4, 0xF9C4, 0xF9C4 }, -{ 0xF9C5, 0xF9C5, 0xF9C5 }, -{ 0xF9C6, 0xF9C6, 0xF9C6 }, -{ 0xF9C7, 0xF9C7, 0xF9C7 }, -{ 0xF9C8, 0xF9C8, 0xF9C8 }, -{ 0xF9C9, 0xF9C9, 0xF9C9 }, -{ 0xF9CA, 0xF9CA, 0xF9CA }, -{ 0xF9CB, 0xF9CB, 0xF9CB }, -{ 0xF9CC, 0xF9CC, 0xF9CC }, -{ 0xF9CD, 0xF9CD, 0xF9CD }, -{ 0xF9CE, 0xF9CE, 0xF9CE }, -{ 0xF9CF, 0xF9CF, 0xF9CF }, -{ 0xF9D0, 0xF9D0, 0xF9D0 }, -{ 0xF9D1, 0xF9D1, 0xF9D1 }, -{ 0xF9D2, 0xF9D2, 0xF9D2 }, -{ 0xF9D3, 0xF9D3, 0xF9D3 }, -{ 0xF9D4, 0xF9D4, 0xF9D4 }, -{ 0xF9D5, 0xF9D5, 0xF9D5 }, -{ 0xF9D6, 0xF9D6, 0xF9D6 }, -{ 0xF9D7, 0xF9D7, 0xF9D7 }, -{ 0xF9D8, 0xF9D8, 0xF9D8 }, -{ 0xF9D9, 0xF9D9, 0xF9D9 }, -{ 0xF9DA, 0xF9DA, 0xF9DA }, -{ 0xF9DB, 0xF9DB, 0xF9DB }, -{ 0xF9DC, 0xF9DC, 0xF9DC }, -{ 0xF9DD, 0xF9DD, 0xF9DD }, -{ 0xF9DE, 0xF9DE, 0xF9DE }, -{ 0xF9DF, 0xF9DF, 0xF9DF }, -{ 0xF9E0, 0xF9E0, 0xF9E0 }, -{ 0xF9E1, 0xF9E1, 0xF9E1 }, -{ 0xF9E2, 0xF9E2, 0xF9E2 }, -{ 0xF9E3, 0xF9E3, 0xF9E3 }, -{ 0xF9E4, 0xF9E4, 0xF9E4 }, -{ 0xF9E5, 0xF9E5, 0xF9E5 }, -{ 0xF9E6, 0xF9E6, 0xF9E6 }, -{ 0xF9E7, 0xF9E7, 0xF9E7 }, -{ 0xF9E8, 0xF9E8, 0xF9E8 }, -{ 0xF9E9, 0xF9E9, 0xF9E9 }, -{ 0xF9EA, 0xF9EA, 0xF9EA }, -{ 0xF9EB, 0xF9EB, 0xF9EB }, -{ 0xF9EC, 0xF9EC, 0xF9EC }, -{ 0xF9ED, 0xF9ED, 0xF9ED }, -{ 0xF9EE, 0xF9EE, 0xF9EE }, -{ 0xF9EF, 0xF9EF, 0xF9EF }, -{ 0xF9F0, 0xF9F0, 0xF9F0 }, -{ 0xF9F1, 0xF9F1, 0xF9F1 }, -{ 0xF9F2, 0xF9F2, 0xF9F2 }, -{ 0xF9F3, 0xF9F3, 0xF9F3 }, -{ 0xF9F4, 0xF9F4, 0xF9F4 }, -{ 0xF9F5, 0xF9F5, 0xF9F5 }, -{ 0xF9F6, 0xF9F6, 0xF9F6 }, -{ 0xF9F7, 0xF9F7, 0xF9F7 }, -{ 0xF9F8, 0xF9F8, 0xF9F8 }, -{ 0xF9F9, 0xF9F9, 0xF9F9 }, -{ 0xF9FA, 0xF9FA, 0xF9FA }, -{ 0xF9FB, 0xF9FB, 0xF9FB }, -{ 0xF9FC, 0xF9FC, 0xF9FC }, -{ 0xF9FD, 0xF9FD, 0xF9FD }, -{ 0xF9FE, 0xF9FE, 0xF9FE }, -{ 0xF9FF, 0xF9FF, 0xF9FF }, -{ 0xFA00, 0xFA00, 0xFA00 }, -{ 0xFA01, 0xFA01, 0xFA01 }, -{ 0xFA02, 0xFA02, 0xFA02 }, -{ 0xFA03, 0xFA03, 0xFA03 }, -{ 0xFA04, 0xFA04, 0xFA04 }, -{ 0xFA05, 0xFA05, 0xFA05 }, -{ 0xFA06, 0xFA06, 0xFA06 }, -{ 0xFA07, 0xFA07, 0xFA07 }, -{ 0xFA08, 0xFA08, 0xFA08 }, -{ 0xFA09, 0xFA09, 0xFA09 }, -{ 0xFA0A, 0xFA0A, 0xFA0A }, -{ 0xFA0B, 0xFA0B, 0xFA0B }, -{ 0xFA0C, 0xFA0C, 0xFA0C }, -{ 0xFA0D, 0xFA0D, 0xFA0D }, -{ 0xFA0E, 0xFA0E, 0xFA0E }, -{ 0xFA0F, 0xFA0F, 0xFA0F }, -{ 0xFA10, 0xFA10, 0xFA10 }, -{ 0xFA11, 0xFA11, 0xFA11 }, -{ 0xFA12, 0xFA12, 0xFA12 }, -{ 0xFA13, 0xFA13, 0xFA13 }, -{ 0xFA14, 0xFA14, 0xFA14 }, -{ 0xFA15, 0xFA15, 0xFA15 }, -{ 0xFA16, 0xFA16, 0xFA16 }, -{ 0xFA17, 0xFA17, 0xFA17 }, -{ 0xFA18, 0xFA18, 0xFA18 }, -{ 0xFA19, 0xFA19, 0xFA19 }, -{ 0xFA1A, 0xFA1A, 0xFA1A }, -{ 0xFA1B, 0xFA1B, 0xFA1B }, -{ 0xFA1C, 0xFA1C, 0xFA1C }, -{ 0xFA1D, 0xFA1D, 0xFA1D }, -{ 0xFA1E, 0xFA1E, 0xFA1E }, -{ 0xFA1F, 0xFA1F, 0xFA1F }, -{ 0xFA20, 0xFA20, 0xFA20 }, -{ 0xFA21, 0xFA21, 0xFA21 }, -{ 0xFA22, 0xFA22, 0xFA22 }, -{ 0xFA23, 0xFA23, 0xFA23 }, -{ 0xFA24, 0xFA24, 0xFA24 }, -{ 0xFA25, 0xFA25, 0xFA25 }, -{ 0xFA26, 0xFA26, 0xFA26 }, -{ 0xFA27, 0xFA27, 0xFA27 }, -{ 0xFA28, 0xFA28, 0xFA28 }, -{ 0xFA29, 0xFA29, 0xFA29 }, -{ 0xFA2A, 0xFA2A, 0xFA2A }, -{ 0xFA2B, 0xFA2B, 0xFA2B }, -{ 0xFA2C, 0xFA2C, 0xFA2C }, -{ 0xFA2D, 0xFA2D, 0xFA2D }, -{ 0xFA30, 0xFA30, 0xFA30 }, -{ 0xFA31, 0xFA31, 0xFA31 }, -{ 0xFA32, 0xFA32, 0xFA32 }, -{ 0xFA33, 0xFA33, 0xFA33 }, -{ 0xFA34, 0xFA34, 0xFA34 }, -{ 0xFA35, 0xFA35, 0xFA35 }, -{ 0xFA36, 0xFA36, 0xFA36 }, -{ 0xFA37, 0xFA37, 0xFA37 }, -{ 0xFA38, 0xFA38, 0xFA38 }, -{ 0xFA39, 0xFA39, 0xFA39 }, -{ 0xFA3A, 0xFA3A, 0xFA3A }, -{ 0xFA3B, 0xFA3B, 0xFA3B }, -{ 0xFA3C, 0xFA3C, 0xFA3C }, -{ 0xFA3D, 0xFA3D, 0xFA3D }, -{ 0xFA3E, 0xFA3E, 0xFA3E }, -{ 0xFA3F, 0xFA3F, 0xFA3F }, -{ 0xFA40, 0xFA40, 0xFA40 }, -{ 0xFA41, 0xFA41, 0xFA41 }, -{ 0xFA42, 0xFA42, 0xFA42 }, -{ 0xFA43, 0xFA43, 0xFA43 }, -{ 0xFA44, 0xFA44, 0xFA44 }, -{ 0xFA45, 0xFA45, 0xFA45 }, -{ 0xFA46, 0xFA46, 0xFA46 }, -{ 0xFA47, 0xFA47, 0xFA47 }, -{ 0xFA48, 0xFA48, 0xFA48 }, -{ 0xFA49, 0xFA49, 0xFA49 }, -{ 0xFA4A, 0xFA4A, 0xFA4A }, -{ 0xFA4B, 0xFA4B, 0xFA4B }, -{ 0xFA4C, 0xFA4C, 0xFA4C }, -{ 0xFA4D, 0xFA4D, 0xFA4D }, -{ 0xFA4E, 0xFA4E, 0xFA4E }, -{ 0xFA4F, 0xFA4F, 0xFA4F }, -{ 0xFA50, 0xFA50, 0xFA50 }, -{ 0xFA51, 0xFA51, 0xFA51 }, -{ 0xFA52, 0xFA52, 0xFA52 }, -{ 0xFA53, 0xFA53, 0xFA53 }, -{ 0xFA54, 0xFA54, 0xFA54 }, -{ 0xFA55, 0xFA55, 0xFA55 }, -{ 0xFA56, 0xFA56, 0xFA56 }, -{ 0xFA57, 0xFA57, 0xFA57 }, -{ 0xFA58, 0xFA58, 0xFA58 }, -{ 0xFA59, 0xFA59, 0xFA59 }, -{ 0xFA5A, 0xFA5A, 0xFA5A }, -{ 0xFA5B, 0xFA5B, 0xFA5B }, -{ 0xFA5C, 0xFA5C, 0xFA5C }, -{ 0xFA5D, 0xFA5D, 0xFA5D }, -{ 0xFA5E, 0xFA5E, 0xFA5E }, -{ 0xFA5F, 0xFA5F, 0xFA5F }, -{ 0xFA60, 0xFA60, 0xFA60 }, -{ 0xFA61, 0xFA61, 0xFA61 }, -{ 0xFA62, 0xFA62, 0xFA62 }, -{ 0xFA63, 0xFA63, 0xFA63 }, -{ 0xFA64, 0xFA64, 0xFA64 }, -{ 0xFA65, 0xFA65, 0xFA65 }, -{ 0xFA66, 0xFA66, 0xFA66 }, -{ 0xFA67, 0xFA67, 0xFA67 }, -{ 0xFA68, 0xFA68, 0xFA68 }, -{ 0xFA69, 0xFA69, 0xFA69 }, -{ 0xFA6A, 0xFA6A, 0xFA6A }, -{ 0xFA70, 0xFA70, 0xFA70 }, -{ 0xFA71, 0xFA71, 0xFA71 }, -{ 0xFA72, 0xFA72, 0xFA72 }, -{ 0xFA73, 0xFA73, 0xFA73 }, -{ 0xFA74, 0xFA74, 0xFA74 }, -{ 0xFA75, 0xFA75, 0xFA75 }, -{ 0xFA76, 0xFA76, 0xFA76 }, -{ 0xFA77, 0xFA77, 0xFA77 }, -{ 0xFA78, 0xFA78, 0xFA78 }, -{ 0xFA79, 0xFA79, 0xFA79 }, -{ 0xFA7A, 0xFA7A, 0xFA7A }, -{ 0xFA7B, 0xFA7B, 0xFA7B }, -{ 0xFA7C, 0xFA7C, 0xFA7C }, -{ 0xFA7D, 0xFA7D, 0xFA7D }, -{ 0xFA7E, 0xFA7E, 0xFA7E }, -{ 0xFA7F, 0xFA7F, 0xFA7F }, -{ 0xFA80, 0xFA80, 0xFA80 }, -{ 0xFA81, 0xFA81, 0xFA81 }, -{ 0xFA82, 0xFA82, 0xFA82 }, -{ 0xFA83, 0xFA83, 0xFA83 }, -{ 0xFA84, 0xFA84, 0xFA84 }, -{ 0xFA85, 0xFA85, 0xFA85 }, -{ 0xFA86, 0xFA86, 0xFA86 }, -{ 0xFA87, 0xFA87, 0xFA87 }, -{ 0xFA88, 0xFA88, 0xFA88 }, -{ 0xFA89, 0xFA89, 0xFA89 }, -{ 0xFA8A, 0xFA8A, 0xFA8A }, -{ 0xFA8B, 0xFA8B, 0xFA8B }, -{ 0xFA8C, 0xFA8C, 0xFA8C }, -{ 0xFA8D, 0xFA8D, 0xFA8D }, -{ 0xFA8E, 0xFA8E, 0xFA8E }, -{ 0xFA8F, 0xFA8F, 0xFA8F }, -{ 0xFA90, 0xFA90, 0xFA90 }, -{ 0xFA91, 0xFA91, 0xFA91 }, -{ 0xFA92, 0xFA92, 0xFA92 }, -{ 0xFA93, 0xFA93, 0xFA93 }, -{ 0xFA94, 0xFA94, 0xFA94 }, -{ 0xFA95, 0xFA95, 0xFA95 }, -{ 0xFA96, 0xFA96, 0xFA96 }, -{ 0xFA97, 0xFA97, 0xFA97 }, -{ 0xFA98, 0xFA98, 0xFA98 }, -{ 0xFA99, 0xFA99, 0xFA99 }, -{ 0xFA9A, 0xFA9A, 0xFA9A }, -{ 0xFA9B, 0xFA9B, 0xFA9B }, -{ 0xFA9C, 0xFA9C, 0xFA9C }, -{ 0xFA9D, 0xFA9D, 0xFA9D }, -{ 0xFA9E, 0xFA9E, 0xFA9E }, -{ 0xFA9F, 0xFA9F, 0xFA9F }, -{ 0xFAA0, 0xFAA0, 0xFAA0 }, -{ 0xFAA1, 0xFAA1, 0xFAA1 }, -{ 0xFAA2, 0xFAA2, 0xFAA2 }, -{ 0xFAA3, 0xFAA3, 0xFAA3 }, -{ 0xFAA4, 0xFAA4, 0xFAA4 }, -{ 0xFAA5, 0xFAA5, 0xFAA5 }, -{ 0xFAA6, 0xFAA6, 0xFAA6 }, -{ 0xFAA7, 0xFAA7, 0xFAA7 }, -{ 0xFAA8, 0xFAA8, 0xFAA8 }, -{ 0xFAA9, 0xFAA9, 0xFAA9 }, -{ 0xFAAA, 0xFAAA, 0xFAAA }, -{ 0xFAAB, 0xFAAB, 0xFAAB }, -{ 0xFAAC, 0xFAAC, 0xFAAC }, -{ 0xFAAD, 0xFAAD, 0xFAAD }, -{ 0xFAAE, 0xFAAE, 0xFAAE }, -{ 0xFAAF, 0xFAAF, 0xFAAF }, -{ 0xFAB0, 0xFAB0, 0xFAB0 }, -{ 0xFAB1, 0xFAB1, 0xFAB1 }, -{ 0xFAB2, 0xFAB2, 0xFAB2 }, -{ 0xFAB3, 0xFAB3, 0xFAB3 }, -{ 0xFAB4, 0xFAB4, 0xFAB4 }, -{ 0xFAB5, 0xFAB5, 0xFAB5 }, -{ 0xFAB6, 0xFAB6, 0xFAB6 }, -{ 0xFAB7, 0xFAB7, 0xFAB7 }, -{ 0xFAB8, 0xFAB8, 0xFAB8 }, -{ 0xFAB9, 0xFAB9, 0xFAB9 }, -{ 0xFABA, 0xFABA, 0xFABA }, -{ 0xFABB, 0xFABB, 0xFABB }, -{ 0xFABC, 0xFABC, 0xFABC }, -{ 0xFABD, 0xFABD, 0xFABD }, -{ 0xFABE, 0xFABE, 0xFABE }, -{ 0xFABF, 0xFABF, 0xFABF }, -{ 0xFAC0, 0xFAC0, 0xFAC0 }, -{ 0xFAC1, 0xFAC1, 0xFAC1 }, -{ 0xFAC2, 0xFAC2, 0xFAC2 }, -{ 0xFAC3, 0xFAC3, 0xFAC3 }, -{ 0xFAC4, 0xFAC4, 0xFAC4 }, -{ 0xFAC5, 0xFAC5, 0xFAC5 }, -{ 0xFAC6, 0xFAC6, 0xFAC6 }, -{ 0xFAC7, 0xFAC7, 0xFAC7 }, -{ 0xFAC8, 0xFAC8, 0xFAC8 }, -{ 0xFAC9, 0xFAC9, 0xFAC9 }, -{ 0xFACA, 0xFACA, 0xFACA }, -{ 0xFACB, 0xFACB, 0xFACB }, -{ 0xFACC, 0xFACC, 0xFACC }, -{ 0xFACD, 0xFACD, 0xFACD }, -{ 0xFACE, 0xFACE, 0xFACE }, -{ 0xFACF, 0xFACF, 0xFACF }, -{ 0xFAD0, 0xFAD0, 0xFAD0 }, -{ 0xFAD1, 0xFAD1, 0xFAD1 }, -{ 0xFAD2, 0xFAD2, 0xFAD2 }, -{ 0xFAD3, 0xFAD3, 0xFAD3 }, -{ 0xFAD4, 0xFAD4, 0xFAD4 }, -{ 0xFAD5, 0xFAD5, 0xFAD5 }, -{ 0xFAD6, 0xFAD6, 0xFAD6 }, -{ 0xFAD7, 0xFAD7, 0xFAD7 }, -{ 0xFAD8, 0xFAD8, 0xFAD8 }, -{ 0xFAD9, 0xFAD9, 0xFAD9 }, -{ 0xFB00, 0xFB00, 0xFB00 }, -{ 0xFB01, 0xFB01, 0xFB01 }, -{ 0xFB02, 0xFB02, 0xFB02 }, -{ 0xFB03, 0xFB03, 0xFB03 }, -{ 0xFB04, 0xFB04, 0xFB04 }, -{ 0xFB05, 0xFB05, 0xFB05 }, -{ 0xFB06, 0xFB06, 0xFB06 }, -{ 0xFB13, 0xFB13, 0xFB13 }, -{ 0xFB14, 0xFB14, 0xFB14 }, -{ 0xFB15, 0xFB15, 0xFB15 }, -{ 0xFB16, 0xFB16, 0xFB16 }, -{ 0xFB17, 0xFB17, 0xFB17 }, -{ 0xFB1D, 0xFB1D, 0xFB1D }, -{ 0xFB1E, 0xFB1E, 0xFB1E }, -{ 0xFB1F, 0xFB1F, 0xFB1F }, -{ 0xFB20, 0xFB20, 0xFB20 }, -{ 0xFB21, 0xFB21, 0xFB21 }, -{ 0xFB22, 0xFB22, 0xFB22 }, -{ 0xFB23, 0xFB23, 0xFB23 }, -{ 0xFB24, 0xFB24, 0xFB24 }, -{ 0xFB25, 0xFB25, 0xFB25 }, -{ 0xFB26, 0xFB26, 0xFB26 }, -{ 0xFB27, 0xFB27, 0xFB27 }, -{ 0xFB28, 0xFB28, 0xFB28 }, -{ 0xFB2A, 0xFB2A, 0xFB2A }, -{ 0xFB2B, 0xFB2B, 0xFB2B }, -{ 0xFB2C, 0xFB2C, 0xFB2C }, -{ 0xFB2D, 0xFB2D, 0xFB2D }, -{ 0xFB2E, 0xFB2E, 0xFB2E }, -{ 0xFB2F, 0xFB2F, 0xFB2F }, -{ 0xFB30, 0xFB30, 0xFB30 }, -{ 0xFB31, 0xFB31, 0xFB31 }, -{ 0xFB32, 0xFB32, 0xFB32 }, -{ 0xFB33, 0xFB33, 0xFB33 }, -{ 0xFB34, 0xFB34, 0xFB34 }, -{ 0xFB35, 0xFB35, 0xFB35 }, -{ 0xFB36, 0xFB36, 0xFB36 }, -{ 0xFB38, 0xFB38, 0xFB38 }, -{ 0xFB39, 0xFB39, 0xFB39 }, -{ 0xFB3A, 0xFB3A, 0xFB3A }, -{ 0xFB3B, 0xFB3B, 0xFB3B }, -{ 0xFB3C, 0xFB3C, 0xFB3C }, -{ 0xFB3E, 0xFB3E, 0xFB3E }, -{ 0xFB40, 0xFB40, 0xFB40 }, -{ 0xFB41, 0xFB41, 0xFB41 }, -{ 0xFB43, 0xFB43, 0xFB43 }, -{ 0xFB44, 0xFB44, 0xFB44 }, -{ 0xFB46, 0xFB46, 0xFB46 }, -{ 0xFB47, 0xFB47, 0xFB47 }, -{ 0xFB48, 0xFB48, 0xFB48 }, -{ 0xFB49, 0xFB49, 0xFB49 }, -{ 0xFB4A, 0xFB4A, 0xFB4A }, -{ 0xFB4B, 0xFB4B, 0xFB4B }, -{ 0xFB4C, 0xFB4C, 0xFB4C }, -{ 0xFB4D, 0xFB4D, 0xFB4D }, -{ 0xFB4E, 0xFB4E, 0xFB4E }, -{ 0xFB4F, 0xFB4F, 0xFB4F }, -{ 0xFB50, 0xFB50, 0xFB50 }, -{ 0xFB51, 0xFB51, 0xFB51 }, -{ 0xFB52, 0xFB52, 0xFB52 }, -{ 0xFB53, 0xFB53, 0xFB53 }, -{ 0xFB54, 0xFB54, 0xFB54 }, -{ 0xFB55, 0xFB55, 0xFB55 }, -{ 0xFB56, 0xFB56, 0xFB56 }, -{ 0xFB57, 0xFB57, 0xFB57 }, -{ 0xFB58, 0xFB58, 0xFB58 }, -{ 0xFB59, 0xFB59, 0xFB59 }, -{ 0xFB5A, 0xFB5A, 0xFB5A }, -{ 0xFB5B, 0xFB5B, 0xFB5B }, -{ 0xFB5C, 0xFB5C, 0xFB5C }, -{ 0xFB5D, 0xFB5D, 0xFB5D }, -{ 0xFB5E, 0xFB5E, 0xFB5E }, -{ 0xFB5F, 0xFB5F, 0xFB5F }, -{ 0xFB60, 0xFB60, 0xFB60 }, -{ 0xFB61, 0xFB61, 0xFB61 }, -{ 0xFB62, 0xFB62, 0xFB62 }, -{ 0xFB63, 0xFB63, 0xFB63 }, -{ 0xFB64, 0xFB64, 0xFB64 }, -{ 0xFB65, 0xFB65, 0xFB65 }, -{ 0xFB66, 0xFB66, 0xFB66 }, -{ 0xFB67, 0xFB67, 0xFB67 }, -{ 0xFB68, 0xFB68, 0xFB68 }, -{ 0xFB69, 0xFB69, 0xFB69 }, -{ 0xFB6A, 0xFB6A, 0xFB6A }, -{ 0xFB6B, 0xFB6B, 0xFB6B }, -{ 0xFB6C, 0xFB6C, 0xFB6C }, -{ 0xFB6D, 0xFB6D, 0xFB6D }, -{ 0xFB6E, 0xFB6E, 0xFB6E }, -{ 0xFB6F, 0xFB6F, 0xFB6F }, -{ 0xFB70, 0xFB70, 0xFB70 }, -{ 0xFB71, 0xFB71, 0xFB71 }, -{ 0xFB72, 0xFB72, 0xFB72 }, -{ 0xFB73, 0xFB73, 0xFB73 }, -{ 0xFB74, 0xFB74, 0xFB74 }, -{ 0xFB75, 0xFB75, 0xFB75 }, -{ 0xFB76, 0xFB76, 0xFB76 }, -{ 0xFB77, 0xFB77, 0xFB77 }, -{ 0xFB78, 0xFB78, 0xFB78 }, -{ 0xFB79, 0xFB79, 0xFB79 }, -{ 0xFB7A, 0xFB7A, 0xFB7A }, -{ 0xFB7B, 0xFB7B, 0xFB7B }, -{ 0xFB7C, 0xFB7C, 0xFB7C }, -{ 0xFB7D, 0xFB7D, 0xFB7D }, -{ 0xFB7E, 0xFB7E, 0xFB7E }, -{ 0xFB7F, 0xFB7F, 0xFB7F }, -{ 0xFB80, 0xFB80, 0xFB80 }, -{ 0xFB81, 0xFB81, 0xFB81 }, -{ 0xFB82, 0xFB82, 0xFB82 }, -{ 0xFB83, 0xFB83, 0xFB83 }, -{ 0xFB84, 0xFB84, 0xFB84 }, -{ 0xFB85, 0xFB85, 0xFB85 }, -{ 0xFB86, 0xFB86, 0xFB86 }, -{ 0xFB87, 0xFB87, 0xFB87 }, -{ 0xFB88, 0xFB88, 0xFB88 }, -{ 0xFB89, 0xFB89, 0xFB89 }, -{ 0xFB8A, 0xFB8A, 0xFB8A }, -{ 0xFB8B, 0xFB8B, 0xFB8B }, -{ 0xFB8C, 0xFB8C, 0xFB8C }, -{ 0xFB8D, 0xFB8D, 0xFB8D }, -{ 0xFB8E, 0xFB8E, 0xFB8E }, -{ 0xFB8F, 0xFB8F, 0xFB8F }, -{ 0xFB90, 0xFB90, 0xFB90 }, -{ 0xFB91, 0xFB91, 0xFB91 }, -{ 0xFB92, 0xFB92, 0xFB92 }, -{ 0xFB93, 0xFB93, 0xFB93 }, -{ 0xFB94, 0xFB94, 0xFB94 }, -{ 0xFB95, 0xFB95, 0xFB95 }, -{ 0xFB96, 0xFB96, 0xFB96 }, -{ 0xFB97, 0xFB97, 0xFB97 }, -{ 0xFB98, 0xFB98, 0xFB98 }, -{ 0xFB99, 0xFB99, 0xFB99 }, -{ 0xFB9A, 0xFB9A, 0xFB9A }, -{ 0xFB9B, 0xFB9B, 0xFB9B }, -{ 0xFB9C, 0xFB9C, 0xFB9C }, -{ 0xFB9D, 0xFB9D, 0xFB9D }, -{ 0xFB9E, 0xFB9E, 0xFB9E }, -{ 0xFB9F, 0xFB9F, 0xFB9F }, -{ 0xFBA0, 0xFBA0, 0xFBA0 }, -{ 0xFBA1, 0xFBA1, 0xFBA1 }, -{ 0xFBA2, 0xFBA2, 0xFBA2 }, -{ 0xFBA3, 0xFBA3, 0xFBA3 }, -{ 0xFBA4, 0xFBA4, 0xFBA4 }, -{ 0xFBA5, 0xFBA5, 0xFBA5 }, -{ 0xFBA6, 0xFBA6, 0xFBA6 }, -{ 0xFBA7, 0xFBA7, 0xFBA7 }, -{ 0xFBA8, 0xFBA8, 0xFBA8 }, -{ 0xFBA9, 0xFBA9, 0xFBA9 }, -{ 0xFBAA, 0xFBAA, 0xFBAA }, -{ 0xFBAB, 0xFBAB, 0xFBAB }, -{ 0xFBAC, 0xFBAC, 0xFBAC }, -{ 0xFBAD, 0xFBAD, 0xFBAD }, -{ 0xFBAE, 0xFBAE, 0xFBAE }, -{ 0xFBAF, 0xFBAF, 0xFBAF }, -{ 0xFBB0, 0xFBB0, 0xFBB0 }, -{ 0xFBB1, 0xFBB1, 0xFBB1 }, -{ 0xFBD3, 0xFBD3, 0xFBD3 }, -{ 0xFBD4, 0xFBD4, 0xFBD4 }, -{ 0xFBD5, 0xFBD5, 0xFBD5 }, -{ 0xFBD6, 0xFBD6, 0xFBD6 }, -{ 0xFBD7, 0xFBD7, 0xFBD7 }, -{ 0xFBD8, 0xFBD8, 0xFBD8 }, -{ 0xFBD9, 0xFBD9, 0xFBD9 }, -{ 0xFBDA, 0xFBDA, 0xFBDA }, -{ 0xFBDB, 0xFBDB, 0xFBDB }, -{ 0xFBDC, 0xFBDC, 0xFBDC }, -{ 0xFBDD, 0xFBDD, 0xFBDD }, -{ 0xFBDE, 0xFBDE, 0xFBDE }, -{ 0xFBDF, 0xFBDF, 0xFBDF }, -{ 0xFBE0, 0xFBE0, 0xFBE0 }, -{ 0xFBE1, 0xFBE1, 0xFBE1 }, -{ 0xFBE2, 0xFBE2, 0xFBE2 }, -{ 0xFBE3, 0xFBE3, 0xFBE3 }, -{ 0xFBE4, 0xFBE4, 0xFBE4 }, -{ 0xFBE5, 0xFBE5, 0xFBE5 }, -{ 0xFBE6, 0xFBE6, 0xFBE6 }, -{ 0xFBE7, 0xFBE7, 0xFBE7 }, -{ 0xFBE8, 0xFBE8, 0xFBE8 }, -{ 0xFBE9, 0xFBE9, 0xFBE9 }, -{ 0xFBEA, 0xFBEA, 0xFBEA }, -{ 0xFBEB, 0xFBEB, 0xFBEB }, -{ 0xFBEC, 0xFBEC, 0xFBEC }, -{ 0xFBED, 0xFBED, 0xFBED }, -{ 0xFBEE, 0xFBEE, 0xFBEE }, -{ 0xFBEF, 0xFBEF, 0xFBEF }, -{ 0xFBF0, 0xFBF0, 0xFBF0 }, -{ 0xFBF1, 0xFBF1, 0xFBF1 }, -{ 0xFBF2, 0xFBF2, 0xFBF2 }, -{ 0xFBF3, 0xFBF3, 0xFBF3 }, -{ 0xFBF4, 0xFBF4, 0xFBF4 }, -{ 0xFBF5, 0xFBF5, 0xFBF5 }, -{ 0xFBF6, 0xFBF6, 0xFBF6 }, -{ 0xFBF7, 0xFBF7, 0xFBF7 }, -{ 0xFBF8, 0xFBF8, 0xFBF8 }, -{ 0xFBF9, 0xFBF9, 0xFBF9 }, -{ 0xFBFA, 0xFBFA, 0xFBFA }, -{ 0xFBFB, 0xFBFB, 0xFBFB }, -{ 0xFBFC, 0xFBFC, 0xFBFC }, -{ 0xFBFD, 0xFBFD, 0xFBFD }, -{ 0xFBFE, 0xFBFE, 0xFBFE }, -{ 0xFBFF, 0xFBFF, 0xFBFF }, -{ 0xFC00, 0xFC00, 0xFC00 }, -{ 0xFC01, 0xFC01, 0xFC01 }, -{ 0xFC02, 0xFC02, 0xFC02 }, -{ 0xFC03, 0xFC03, 0xFC03 }, -{ 0xFC04, 0xFC04, 0xFC04 }, -{ 0xFC05, 0xFC05, 0xFC05 }, -{ 0xFC06, 0xFC06, 0xFC06 }, -{ 0xFC07, 0xFC07, 0xFC07 }, -{ 0xFC08, 0xFC08, 0xFC08 }, -{ 0xFC09, 0xFC09, 0xFC09 }, -{ 0xFC0A, 0xFC0A, 0xFC0A }, -{ 0xFC0B, 0xFC0B, 0xFC0B }, -{ 0xFC0C, 0xFC0C, 0xFC0C }, -{ 0xFC0D, 0xFC0D, 0xFC0D }, -{ 0xFC0E, 0xFC0E, 0xFC0E }, -{ 0xFC0F, 0xFC0F, 0xFC0F }, -{ 0xFC10, 0xFC10, 0xFC10 }, -{ 0xFC11, 0xFC11, 0xFC11 }, -{ 0xFC12, 0xFC12, 0xFC12 }, -{ 0xFC13, 0xFC13, 0xFC13 }, -{ 0xFC14, 0xFC14, 0xFC14 }, -{ 0xFC15, 0xFC15, 0xFC15 }, -{ 0xFC16, 0xFC16, 0xFC16 }, -{ 0xFC17, 0xFC17, 0xFC17 }, -{ 0xFC18, 0xFC18, 0xFC18 }, -{ 0xFC19, 0xFC19, 0xFC19 }, -{ 0xFC1A, 0xFC1A, 0xFC1A }, -{ 0xFC1B, 0xFC1B, 0xFC1B }, -{ 0xFC1C, 0xFC1C, 0xFC1C }, -{ 0xFC1D, 0xFC1D, 0xFC1D }, -{ 0xFC1E, 0xFC1E, 0xFC1E }, -{ 0xFC1F, 0xFC1F, 0xFC1F }, -{ 0xFC20, 0xFC20, 0xFC20 }, -{ 0xFC21, 0xFC21, 0xFC21 }, -{ 0xFC22, 0xFC22, 0xFC22 }, -{ 0xFC23, 0xFC23, 0xFC23 }, -{ 0xFC24, 0xFC24, 0xFC24 }, -{ 0xFC25, 0xFC25, 0xFC25 }, -{ 0xFC26, 0xFC26, 0xFC26 }, -{ 0xFC27, 0xFC27, 0xFC27 }, -{ 0xFC28, 0xFC28, 0xFC28 }, -{ 0xFC29, 0xFC29, 0xFC29 }, -{ 0xFC2A, 0xFC2A, 0xFC2A }, -{ 0xFC2B, 0xFC2B, 0xFC2B }, -{ 0xFC2C, 0xFC2C, 0xFC2C }, -{ 0xFC2D, 0xFC2D, 0xFC2D }, -{ 0xFC2E, 0xFC2E, 0xFC2E }, -{ 0xFC2F, 0xFC2F, 0xFC2F }, -{ 0xFC30, 0xFC30, 0xFC30 }, -{ 0xFC31, 0xFC31, 0xFC31 }, -{ 0xFC32, 0xFC32, 0xFC32 }, -{ 0xFC33, 0xFC33, 0xFC33 }, -{ 0xFC34, 0xFC34, 0xFC34 }, -{ 0xFC35, 0xFC35, 0xFC35 }, -{ 0xFC36, 0xFC36, 0xFC36 }, -{ 0xFC37, 0xFC37, 0xFC37 }, -{ 0xFC38, 0xFC38, 0xFC38 }, -{ 0xFC39, 0xFC39, 0xFC39 }, -{ 0xFC3A, 0xFC3A, 0xFC3A }, -{ 0xFC3B, 0xFC3B, 0xFC3B }, -{ 0xFC3C, 0xFC3C, 0xFC3C }, -{ 0xFC3D, 0xFC3D, 0xFC3D }, -{ 0xFC3E, 0xFC3E, 0xFC3E }, -{ 0xFC3F, 0xFC3F, 0xFC3F }, -{ 0xFC40, 0xFC40, 0xFC40 }, -{ 0xFC41, 0xFC41, 0xFC41 }, -{ 0xFC42, 0xFC42, 0xFC42 }, -{ 0xFC43, 0xFC43, 0xFC43 }, -{ 0xFC44, 0xFC44, 0xFC44 }, -{ 0xFC45, 0xFC45, 0xFC45 }, -{ 0xFC46, 0xFC46, 0xFC46 }, -{ 0xFC47, 0xFC47, 0xFC47 }, -{ 0xFC48, 0xFC48, 0xFC48 }, -{ 0xFC49, 0xFC49, 0xFC49 }, -{ 0xFC4A, 0xFC4A, 0xFC4A }, -{ 0xFC4B, 0xFC4B, 0xFC4B }, -{ 0xFC4C, 0xFC4C, 0xFC4C }, -{ 0xFC4D, 0xFC4D, 0xFC4D }, -{ 0xFC4E, 0xFC4E, 0xFC4E }, -{ 0xFC4F, 0xFC4F, 0xFC4F }, -{ 0xFC50, 0xFC50, 0xFC50 }, -{ 0xFC51, 0xFC51, 0xFC51 }, -{ 0xFC52, 0xFC52, 0xFC52 }, -{ 0xFC53, 0xFC53, 0xFC53 }, -{ 0xFC54, 0xFC54, 0xFC54 }, -{ 0xFC55, 0xFC55, 0xFC55 }, -{ 0xFC56, 0xFC56, 0xFC56 }, -{ 0xFC57, 0xFC57, 0xFC57 }, -{ 0xFC58, 0xFC58, 0xFC58 }, -{ 0xFC59, 0xFC59, 0xFC59 }, -{ 0xFC5A, 0xFC5A, 0xFC5A }, -{ 0xFC5B, 0xFC5B, 0xFC5B }, -{ 0xFC5C, 0xFC5C, 0xFC5C }, -{ 0xFC5D, 0xFC5D, 0xFC5D }, -{ 0xFC5E, 0xFC5E, 0xFC5E }, -{ 0xFC5F, 0xFC5F, 0xFC5F }, -{ 0xFC60, 0xFC60, 0xFC60 }, -{ 0xFC61, 0xFC61, 0xFC61 }, -{ 0xFC62, 0xFC62, 0xFC62 }, -{ 0xFC63, 0xFC63, 0xFC63 }, -{ 0xFC64, 0xFC64, 0xFC64 }, -{ 0xFC65, 0xFC65, 0xFC65 }, -{ 0xFC66, 0xFC66, 0xFC66 }, -{ 0xFC67, 0xFC67, 0xFC67 }, -{ 0xFC68, 0xFC68, 0xFC68 }, -{ 0xFC69, 0xFC69, 0xFC69 }, -{ 0xFC6A, 0xFC6A, 0xFC6A }, -{ 0xFC6B, 0xFC6B, 0xFC6B }, -{ 0xFC6C, 0xFC6C, 0xFC6C }, -{ 0xFC6D, 0xFC6D, 0xFC6D }, -{ 0xFC6E, 0xFC6E, 0xFC6E }, -{ 0xFC6F, 0xFC6F, 0xFC6F }, -{ 0xFC70, 0xFC70, 0xFC70 }, -{ 0xFC71, 0xFC71, 0xFC71 }, -{ 0xFC72, 0xFC72, 0xFC72 }, -{ 0xFC73, 0xFC73, 0xFC73 }, -{ 0xFC74, 0xFC74, 0xFC74 }, -{ 0xFC75, 0xFC75, 0xFC75 }, -{ 0xFC76, 0xFC76, 0xFC76 }, -{ 0xFC77, 0xFC77, 0xFC77 }, -{ 0xFC78, 0xFC78, 0xFC78 }, -{ 0xFC79, 0xFC79, 0xFC79 }, -{ 0xFC7A, 0xFC7A, 0xFC7A }, -{ 0xFC7B, 0xFC7B, 0xFC7B }, -{ 0xFC7C, 0xFC7C, 0xFC7C }, -{ 0xFC7D, 0xFC7D, 0xFC7D }, -{ 0xFC7E, 0xFC7E, 0xFC7E }, -{ 0xFC7F, 0xFC7F, 0xFC7F }, -{ 0xFC80, 0xFC80, 0xFC80 }, -{ 0xFC81, 0xFC81, 0xFC81 }, -{ 0xFC82, 0xFC82, 0xFC82 }, -{ 0xFC83, 0xFC83, 0xFC83 }, -{ 0xFC84, 0xFC84, 0xFC84 }, -{ 0xFC85, 0xFC85, 0xFC85 }, -{ 0xFC86, 0xFC86, 0xFC86 }, -{ 0xFC87, 0xFC87, 0xFC87 }, -{ 0xFC88, 0xFC88, 0xFC88 }, -{ 0xFC89, 0xFC89, 0xFC89 }, -{ 0xFC8A, 0xFC8A, 0xFC8A }, -{ 0xFC8B, 0xFC8B, 0xFC8B }, -{ 0xFC8C, 0xFC8C, 0xFC8C }, -{ 0xFC8D, 0xFC8D, 0xFC8D }, -{ 0xFC8E, 0xFC8E, 0xFC8E }, -{ 0xFC8F, 0xFC8F, 0xFC8F }, -{ 0xFC90, 0xFC90, 0xFC90 }, -{ 0xFC91, 0xFC91, 0xFC91 }, -{ 0xFC92, 0xFC92, 0xFC92 }, -{ 0xFC93, 0xFC93, 0xFC93 }, -{ 0xFC94, 0xFC94, 0xFC94 }, -{ 0xFC95, 0xFC95, 0xFC95 }, -{ 0xFC96, 0xFC96, 0xFC96 }, -{ 0xFC97, 0xFC97, 0xFC97 }, -{ 0xFC98, 0xFC98, 0xFC98 }, -{ 0xFC99, 0xFC99, 0xFC99 }, -{ 0xFC9A, 0xFC9A, 0xFC9A }, -{ 0xFC9B, 0xFC9B, 0xFC9B }, -{ 0xFC9C, 0xFC9C, 0xFC9C }, -{ 0xFC9D, 0xFC9D, 0xFC9D }, -{ 0xFC9E, 0xFC9E, 0xFC9E }, -{ 0xFC9F, 0xFC9F, 0xFC9F }, -{ 0xFCA0, 0xFCA0, 0xFCA0 }, -{ 0xFCA1, 0xFCA1, 0xFCA1 }, -{ 0xFCA2, 0xFCA2, 0xFCA2 }, -{ 0xFCA3, 0xFCA3, 0xFCA3 }, -{ 0xFCA4, 0xFCA4, 0xFCA4 }, -{ 0xFCA5, 0xFCA5, 0xFCA5 }, -{ 0xFCA6, 0xFCA6, 0xFCA6 }, -{ 0xFCA7, 0xFCA7, 0xFCA7 }, -{ 0xFCA8, 0xFCA8, 0xFCA8 }, -{ 0xFCA9, 0xFCA9, 0xFCA9 }, -{ 0xFCAA, 0xFCAA, 0xFCAA }, -{ 0xFCAB, 0xFCAB, 0xFCAB }, -{ 0xFCAC, 0xFCAC, 0xFCAC }, -{ 0xFCAD, 0xFCAD, 0xFCAD }, -{ 0xFCAE, 0xFCAE, 0xFCAE }, -{ 0xFCAF, 0xFCAF, 0xFCAF }, -{ 0xFCB0, 0xFCB0, 0xFCB0 }, -{ 0xFCB1, 0xFCB1, 0xFCB1 }, -{ 0xFCB2, 0xFCB2, 0xFCB2 }, -{ 0xFCB3, 0xFCB3, 0xFCB3 }, -{ 0xFCB4, 0xFCB4, 0xFCB4 }, -{ 0xFCB5, 0xFCB5, 0xFCB5 }, -{ 0xFCB6, 0xFCB6, 0xFCB6 }, -{ 0xFCB7, 0xFCB7, 0xFCB7 }, -{ 0xFCB8, 0xFCB8, 0xFCB8 }, -{ 0xFCB9, 0xFCB9, 0xFCB9 }, -{ 0xFCBA, 0xFCBA, 0xFCBA }, -{ 0xFCBB, 0xFCBB, 0xFCBB }, -{ 0xFCBC, 0xFCBC, 0xFCBC }, -{ 0xFCBD, 0xFCBD, 0xFCBD }, -{ 0xFCBE, 0xFCBE, 0xFCBE }, -{ 0xFCBF, 0xFCBF, 0xFCBF }, -{ 0xFCC0, 0xFCC0, 0xFCC0 }, -{ 0xFCC1, 0xFCC1, 0xFCC1 }, -{ 0xFCC2, 0xFCC2, 0xFCC2 }, -{ 0xFCC3, 0xFCC3, 0xFCC3 }, -{ 0xFCC4, 0xFCC4, 0xFCC4 }, -{ 0xFCC5, 0xFCC5, 0xFCC5 }, -{ 0xFCC6, 0xFCC6, 0xFCC6 }, -{ 0xFCC7, 0xFCC7, 0xFCC7 }, -{ 0xFCC8, 0xFCC8, 0xFCC8 }, -{ 0xFCC9, 0xFCC9, 0xFCC9 }, -{ 0xFCCA, 0xFCCA, 0xFCCA }, -{ 0xFCCB, 0xFCCB, 0xFCCB }, -{ 0xFCCC, 0xFCCC, 0xFCCC }, -{ 0xFCCD, 0xFCCD, 0xFCCD }, -{ 0xFCCE, 0xFCCE, 0xFCCE }, -{ 0xFCCF, 0xFCCF, 0xFCCF }, -{ 0xFCD0, 0xFCD0, 0xFCD0 }, -{ 0xFCD1, 0xFCD1, 0xFCD1 }, -{ 0xFCD2, 0xFCD2, 0xFCD2 }, -{ 0xFCD3, 0xFCD3, 0xFCD3 }, -{ 0xFCD4, 0xFCD4, 0xFCD4 }, -{ 0xFCD5, 0xFCD5, 0xFCD5 }, -{ 0xFCD6, 0xFCD6, 0xFCD6 }, -{ 0xFCD7, 0xFCD7, 0xFCD7 }, -{ 0xFCD8, 0xFCD8, 0xFCD8 }, -{ 0xFCD9, 0xFCD9, 0xFCD9 }, -{ 0xFCDA, 0xFCDA, 0xFCDA }, -{ 0xFCDB, 0xFCDB, 0xFCDB }, -{ 0xFCDC, 0xFCDC, 0xFCDC }, -{ 0xFCDD, 0xFCDD, 0xFCDD }, -{ 0xFCDE, 0xFCDE, 0xFCDE }, -{ 0xFCDF, 0xFCDF, 0xFCDF }, -{ 0xFCE0, 0xFCE0, 0xFCE0 }, -{ 0xFCE1, 0xFCE1, 0xFCE1 }, -{ 0xFCE2, 0xFCE2, 0xFCE2 }, -{ 0xFCE3, 0xFCE3, 0xFCE3 }, -{ 0xFCE4, 0xFCE4, 0xFCE4 }, -{ 0xFCE5, 0xFCE5, 0xFCE5 }, -{ 0xFCE6, 0xFCE6, 0xFCE6 }, -{ 0xFCE7, 0xFCE7, 0xFCE7 }, -{ 0xFCE8, 0xFCE8, 0xFCE8 }, -{ 0xFCE9, 0xFCE9, 0xFCE9 }, -{ 0xFCEA, 0xFCEA, 0xFCEA }, -{ 0xFCEB, 0xFCEB, 0xFCEB }, -{ 0xFCEC, 0xFCEC, 0xFCEC }, -{ 0xFCED, 0xFCED, 0xFCED }, -{ 0xFCEE, 0xFCEE, 0xFCEE }, -{ 0xFCEF, 0xFCEF, 0xFCEF }, -{ 0xFCF0, 0xFCF0, 0xFCF0 }, -{ 0xFCF1, 0xFCF1, 0xFCF1 }, -{ 0xFCF2, 0xFCF2, 0xFCF2 }, -{ 0xFCF3, 0xFCF3, 0xFCF3 }, -{ 0xFCF4, 0xFCF4, 0xFCF4 }, -{ 0xFCF5, 0xFCF5, 0xFCF5 }, -{ 0xFCF6, 0xFCF6, 0xFCF6 }, -{ 0xFCF7, 0xFCF7, 0xFCF7 }, -{ 0xFCF8, 0xFCF8, 0xFCF8 }, -{ 0xFCF9, 0xFCF9, 0xFCF9 }, -{ 0xFCFA, 0xFCFA, 0xFCFA }, -{ 0xFCFB, 0xFCFB, 0xFCFB }, -{ 0xFCFC, 0xFCFC, 0xFCFC }, -{ 0xFCFD, 0xFCFD, 0xFCFD }, -{ 0xFCFE, 0xFCFE, 0xFCFE }, -{ 0xFCFF, 0xFCFF, 0xFCFF }, -{ 0xFD00, 0xFD00, 0xFD00 }, -{ 0xFD01, 0xFD01, 0xFD01 }, -{ 0xFD02, 0xFD02, 0xFD02 }, -{ 0xFD03, 0xFD03, 0xFD03 }, -{ 0xFD04, 0xFD04, 0xFD04 }, -{ 0xFD05, 0xFD05, 0xFD05 }, -{ 0xFD06, 0xFD06, 0xFD06 }, -{ 0xFD07, 0xFD07, 0xFD07 }, -{ 0xFD08, 0xFD08, 0xFD08 }, -{ 0xFD09, 0xFD09, 0xFD09 }, -{ 0xFD0A, 0xFD0A, 0xFD0A }, -{ 0xFD0B, 0xFD0B, 0xFD0B }, -{ 0xFD0C, 0xFD0C, 0xFD0C }, -{ 0xFD0D, 0xFD0D, 0xFD0D }, -{ 0xFD0E, 0xFD0E, 0xFD0E }, -{ 0xFD0F, 0xFD0F, 0xFD0F }, -{ 0xFD10, 0xFD10, 0xFD10 }, -{ 0xFD11, 0xFD11, 0xFD11 }, -{ 0xFD12, 0xFD12, 0xFD12 }, -{ 0xFD13, 0xFD13, 0xFD13 }, -{ 0xFD14, 0xFD14, 0xFD14 }, -{ 0xFD15, 0xFD15, 0xFD15 }, -{ 0xFD16, 0xFD16, 0xFD16 }, -{ 0xFD17, 0xFD17, 0xFD17 }, -{ 0xFD18, 0xFD18, 0xFD18 }, -{ 0xFD19, 0xFD19, 0xFD19 }, -{ 0xFD1A, 0xFD1A, 0xFD1A }, -{ 0xFD1B, 0xFD1B, 0xFD1B }, -{ 0xFD1C, 0xFD1C, 0xFD1C }, -{ 0xFD1D, 0xFD1D, 0xFD1D }, -{ 0xFD1E, 0xFD1E, 0xFD1E }, -{ 0xFD1F, 0xFD1F, 0xFD1F }, -{ 0xFD20, 0xFD20, 0xFD20 }, -{ 0xFD21, 0xFD21, 0xFD21 }, -{ 0xFD22, 0xFD22, 0xFD22 }, -{ 0xFD23, 0xFD23, 0xFD23 }, -{ 0xFD24, 0xFD24, 0xFD24 }, -{ 0xFD25, 0xFD25, 0xFD25 }, -{ 0xFD26, 0xFD26, 0xFD26 }, -{ 0xFD27, 0xFD27, 0xFD27 }, -{ 0xFD28, 0xFD28, 0xFD28 }, -{ 0xFD29, 0xFD29, 0xFD29 }, -{ 0xFD2A, 0xFD2A, 0xFD2A }, -{ 0xFD2B, 0xFD2B, 0xFD2B }, -{ 0xFD2C, 0xFD2C, 0xFD2C }, -{ 0xFD2D, 0xFD2D, 0xFD2D }, -{ 0xFD2E, 0xFD2E, 0xFD2E }, -{ 0xFD2F, 0xFD2F, 0xFD2F }, -{ 0xFD30, 0xFD30, 0xFD30 }, -{ 0xFD31, 0xFD31, 0xFD31 }, -{ 0xFD32, 0xFD32, 0xFD32 }, -{ 0xFD33, 0xFD33, 0xFD33 }, -{ 0xFD34, 0xFD34, 0xFD34 }, -{ 0xFD35, 0xFD35, 0xFD35 }, -{ 0xFD36, 0xFD36, 0xFD36 }, -{ 0xFD37, 0xFD37, 0xFD37 }, -{ 0xFD38, 0xFD38, 0xFD38 }, -{ 0xFD39, 0xFD39, 0xFD39 }, -{ 0xFD3A, 0xFD3A, 0xFD3A }, -{ 0xFD3B, 0xFD3B, 0xFD3B }, -{ 0xFD3C, 0xFD3C, 0xFD3C }, -{ 0xFD3D, 0xFD3D, 0xFD3D }, -{ 0xFD50, 0xFD50, 0xFD50 }, -{ 0xFD51, 0xFD51, 0xFD51 }, -{ 0xFD52, 0xFD52, 0xFD52 }, -{ 0xFD53, 0xFD53, 0xFD53 }, -{ 0xFD54, 0xFD54, 0xFD54 }, -{ 0xFD55, 0xFD55, 0xFD55 }, -{ 0xFD56, 0xFD56, 0xFD56 }, -{ 0xFD57, 0xFD57, 0xFD57 }, -{ 0xFD58, 0xFD58, 0xFD58 }, -{ 0xFD59, 0xFD59, 0xFD59 }, -{ 0xFD5A, 0xFD5A, 0xFD5A }, -{ 0xFD5B, 0xFD5B, 0xFD5B }, -{ 0xFD5C, 0xFD5C, 0xFD5C }, -{ 0xFD5D, 0xFD5D, 0xFD5D }, -{ 0xFD5E, 0xFD5E, 0xFD5E }, -{ 0xFD5F, 0xFD5F, 0xFD5F }, -{ 0xFD60, 0xFD60, 0xFD60 }, -{ 0xFD61, 0xFD61, 0xFD61 }, -{ 0xFD62, 0xFD62, 0xFD62 }, -{ 0xFD63, 0xFD63, 0xFD63 }, -{ 0xFD64, 0xFD64, 0xFD64 }, -{ 0xFD65, 0xFD65, 0xFD65 }, -{ 0xFD66, 0xFD66, 0xFD66 }, -{ 0xFD67, 0xFD67, 0xFD67 }, -{ 0xFD68, 0xFD68, 0xFD68 }, -{ 0xFD69, 0xFD69, 0xFD69 }, -{ 0xFD6A, 0xFD6A, 0xFD6A }, -{ 0xFD6B, 0xFD6B, 0xFD6B }, -{ 0xFD6C, 0xFD6C, 0xFD6C }, -{ 0xFD6D, 0xFD6D, 0xFD6D }, -{ 0xFD6E, 0xFD6E, 0xFD6E }, -{ 0xFD6F, 0xFD6F, 0xFD6F }, -{ 0xFD70, 0xFD70, 0xFD70 }, -{ 0xFD71, 0xFD71, 0xFD71 }, -{ 0xFD72, 0xFD72, 0xFD72 }, -{ 0xFD73, 0xFD73, 0xFD73 }, -{ 0xFD74, 0xFD74, 0xFD74 }, -{ 0xFD75, 0xFD75, 0xFD75 }, -{ 0xFD76, 0xFD76, 0xFD76 }, -{ 0xFD77, 0xFD77, 0xFD77 }, -{ 0xFD78, 0xFD78, 0xFD78 }, -{ 0xFD79, 0xFD79, 0xFD79 }, -{ 0xFD7A, 0xFD7A, 0xFD7A }, -{ 0xFD7B, 0xFD7B, 0xFD7B }, -{ 0xFD7C, 0xFD7C, 0xFD7C }, -{ 0xFD7D, 0xFD7D, 0xFD7D }, -{ 0xFD7E, 0xFD7E, 0xFD7E }, -{ 0xFD7F, 0xFD7F, 0xFD7F }, -{ 0xFD80, 0xFD80, 0xFD80 }, -{ 0xFD81, 0xFD81, 0xFD81 }, -{ 0xFD82, 0xFD82, 0xFD82 }, -{ 0xFD83, 0xFD83, 0xFD83 }, -{ 0xFD84, 0xFD84, 0xFD84 }, -{ 0xFD85, 0xFD85, 0xFD85 }, -{ 0xFD86, 0xFD86, 0xFD86 }, -{ 0xFD87, 0xFD87, 0xFD87 }, -{ 0xFD88, 0xFD88, 0xFD88 }, -{ 0xFD89, 0xFD89, 0xFD89 }, -{ 0xFD8A, 0xFD8A, 0xFD8A }, -{ 0xFD8B, 0xFD8B, 0xFD8B }, -{ 0xFD8C, 0xFD8C, 0xFD8C }, -{ 0xFD8D, 0xFD8D, 0xFD8D }, -{ 0xFD8E, 0xFD8E, 0xFD8E }, -{ 0xFD8F, 0xFD8F, 0xFD8F }, -{ 0xFD92, 0xFD92, 0xFD92 }, -{ 0xFD93, 0xFD93, 0xFD93 }, -{ 0xFD94, 0xFD94, 0xFD94 }, -{ 0xFD95, 0xFD95, 0xFD95 }, -{ 0xFD96, 0xFD96, 0xFD96 }, -{ 0xFD97, 0xFD97, 0xFD97 }, -{ 0xFD98, 0xFD98, 0xFD98 }, -{ 0xFD99, 0xFD99, 0xFD99 }, -{ 0xFD9A, 0xFD9A, 0xFD9A }, -{ 0xFD9B, 0xFD9B, 0xFD9B }, -{ 0xFD9C, 0xFD9C, 0xFD9C }, -{ 0xFD9D, 0xFD9D, 0xFD9D }, -{ 0xFD9E, 0xFD9E, 0xFD9E }, -{ 0xFD9F, 0xFD9F, 0xFD9F }, -{ 0xFDA0, 0xFDA0, 0xFDA0 }, -{ 0xFDA1, 0xFDA1, 0xFDA1 }, -{ 0xFDA2, 0xFDA2, 0xFDA2 }, -{ 0xFDA3, 0xFDA3, 0xFDA3 }, -{ 0xFDA4, 0xFDA4, 0xFDA4 }, -{ 0xFDA5, 0xFDA5, 0xFDA5 }, -{ 0xFDA6, 0xFDA6, 0xFDA6 }, -{ 0xFDA7, 0xFDA7, 0xFDA7 }, -{ 0xFDA8, 0xFDA8, 0xFDA8 }, -{ 0xFDA9, 0xFDA9, 0xFDA9 }, -{ 0xFDAA, 0xFDAA, 0xFDAA }, -{ 0xFDAB, 0xFDAB, 0xFDAB }, -{ 0xFDAC, 0xFDAC, 0xFDAC }, -{ 0xFDAD, 0xFDAD, 0xFDAD }, -{ 0xFDAE, 0xFDAE, 0xFDAE }, -{ 0xFDAF, 0xFDAF, 0xFDAF }, -{ 0xFDB0, 0xFDB0, 0xFDB0 }, -{ 0xFDB1, 0xFDB1, 0xFDB1 }, -{ 0xFDB2, 0xFDB2, 0xFDB2 }, -{ 0xFDB3, 0xFDB3, 0xFDB3 }, -{ 0xFDB4, 0xFDB4, 0xFDB4 }, -{ 0xFDB5, 0xFDB5, 0xFDB5 }, -{ 0xFDB6, 0xFDB6, 0xFDB6 }, -{ 0xFDB7, 0xFDB7, 0xFDB7 }, -{ 0xFDB8, 0xFDB8, 0xFDB8 }, -{ 0xFDB9, 0xFDB9, 0xFDB9 }, -{ 0xFDBA, 0xFDBA, 0xFDBA }, -{ 0xFDBB, 0xFDBB, 0xFDBB }, -{ 0xFDBC, 0xFDBC, 0xFDBC }, -{ 0xFDBD, 0xFDBD, 0xFDBD }, -{ 0xFDBE, 0xFDBE, 0xFDBE }, -{ 0xFDBF, 0xFDBF, 0xFDBF }, -{ 0xFDC0, 0xFDC0, 0xFDC0 }, -{ 0xFDC1, 0xFDC1, 0xFDC1 }, -{ 0xFDC2, 0xFDC2, 0xFDC2 }, -{ 0xFDC3, 0xFDC3, 0xFDC3 }, -{ 0xFDC4, 0xFDC4, 0xFDC4 }, -{ 0xFDC5, 0xFDC5, 0xFDC5 }, -{ 0xFDC6, 0xFDC6, 0xFDC6 }, -{ 0xFDC7, 0xFDC7, 0xFDC7 }, -{ 0xFDF0, 0xFDF0, 0xFDF0 }, -{ 0xFDF1, 0xFDF1, 0xFDF1 }, -{ 0xFDF2, 0xFDF2, 0xFDF2 }, -{ 0xFDF3, 0xFDF3, 0xFDF3 }, -{ 0xFDF4, 0xFDF4, 0xFDF4 }, -{ 0xFDF5, 0xFDF5, 0xFDF5 }, -{ 0xFDF6, 0xFDF6, 0xFDF6 }, -{ 0xFDF7, 0xFDF7, 0xFDF7 }, -{ 0xFDF8, 0xFDF8, 0xFDF8 }, -{ 0xFDF9, 0xFDF9, 0xFDF9 }, -{ 0xFDFA, 0xFDFA, 0xFDFA }, -{ 0xFDFB, 0xFDFB, 0xFDFB }, -{ 0xFE00, 0xFE00, 0xFE00 }, -{ 0xFE01, 0xFE01, 0xFE01 }, -{ 0xFE02, 0xFE02, 0xFE02 }, -{ 0xFE03, 0xFE03, 0xFE03 }, -{ 0xFE04, 0xFE04, 0xFE04 }, -{ 0xFE05, 0xFE05, 0xFE05 }, -{ 0xFE06, 0xFE06, 0xFE06 }, -{ 0xFE07, 0xFE07, 0xFE07 }, -{ 0xFE08, 0xFE08, 0xFE08 }, -{ 0xFE09, 0xFE09, 0xFE09 }, -{ 0xFE0A, 0xFE0A, 0xFE0A }, -{ 0xFE0B, 0xFE0B, 0xFE0B }, -{ 0xFE0C, 0xFE0C, 0xFE0C }, -{ 0xFE0D, 0xFE0D, 0xFE0D }, -{ 0xFE0E, 0xFE0E, 0xFE0E }, -{ 0xFE0F, 0xFE0F, 0xFE0F }, -{ 0xFE20, 0xFE20, 0xFE20 }, -{ 0xFE21, 0xFE21, 0xFE21 }, -{ 0xFE22, 0xFE22, 0xFE22 }, -{ 0xFE23, 0xFE23, 0xFE23 }, -{ 0xFE70, 0xFE70, 0xFE70 }, -{ 0xFE71, 0xFE71, 0xFE71 }, -{ 0xFE72, 0xFE72, 0xFE72 }, -{ 0xFE73, 0xFE73, 0xFE73 }, -{ 0xFE74, 0xFE74, 0xFE74 }, -{ 0xFE76, 0xFE76, 0xFE76 }, -{ 0xFE77, 0xFE77, 0xFE77 }, -{ 0xFE78, 0xFE78, 0xFE78 }, -{ 0xFE79, 0xFE79, 0xFE79 }, -{ 0xFE7A, 0xFE7A, 0xFE7A }, -{ 0xFE7B, 0xFE7B, 0xFE7B }, -{ 0xFE7C, 0xFE7C, 0xFE7C }, -{ 0xFE7D, 0xFE7D, 0xFE7D }, -{ 0xFE7E, 0xFE7E, 0xFE7E }, -{ 0xFE7F, 0xFE7F, 0xFE7F }, -{ 0xFE80, 0xFE80, 0xFE80 }, -{ 0xFE81, 0xFE81, 0xFE81 }, -{ 0xFE82, 0xFE82, 0xFE82 }, -{ 0xFE83, 0xFE83, 0xFE83 }, -{ 0xFE84, 0xFE84, 0xFE84 }, -{ 0xFE85, 0xFE85, 0xFE85 }, -{ 0xFE86, 0xFE86, 0xFE86 }, -{ 0xFE87, 0xFE87, 0xFE87 }, -{ 0xFE88, 0xFE88, 0xFE88 }, -{ 0xFE89, 0xFE89, 0xFE89 }, -{ 0xFE8A, 0xFE8A, 0xFE8A }, -{ 0xFE8B, 0xFE8B, 0xFE8B }, -{ 0xFE8C, 0xFE8C, 0xFE8C }, -{ 0xFE8D, 0xFE8D, 0xFE8D }, -{ 0xFE8E, 0xFE8E, 0xFE8E }, -{ 0xFE8F, 0xFE8F, 0xFE8F }, -{ 0xFE90, 0xFE90, 0xFE90 }, -{ 0xFE91, 0xFE91, 0xFE91 }, -{ 0xFE92, 0xFE92, 0xFE92 }, -{ 0xFE93, 0xFE93, 0xFE93 }, -{ 0xFE94, 0xFE94, 0xFE94 }, -{ 0xFE95, 0xFE95, 0xFE95 }, -{ 0xFE96, 0xFE96, 0xFE96 }, -{ 0xFE97, 0xFE97, 0xFE97 }, -{ 0xFE98, 0xFE98, 0xFE98 }, -{ 0xFE99, 0xFE99, 0xFE99 }, -{ 0xFE9A, 0xFE9A, 0xFE9A }, -{ 0xFE9B, 0xFE9B, 0xFE9B }, -{ 0xFE9C, 0xFE9C, 0xFE9C }, -{ 0xFE9D, 0xFE9D, 0xFE9D }, -{ 0xFE9E, 0xFE9E, 0xFE9E }, -{ 0xFE9F, 0xFE9F, 0xFE9F }, -{ 0xFEA0, 0xFEA0, 0xFEA0 }, -{ 0xFEA1, 0xFEA1, 0xFEA1 }, -{ 0xFEA2, 0xFEA2, 0xFEA2 }, -{ 0xFEA3, 0xFEA3, 0xFEA3 }, -{ 0xFEA4, 0xFEA4, 0xFEA4 }, -{ 0xFEA5, 0xFEA5, 0xFEA5 }, -{ 0xFEA6, 0xFEA6, 0xFEA6 }, -{ 0xFEA7, 0xFEA7, 0xFEA7 }, -{ 0xFEA8, 0xFEA8, 0xFEA8 }, -{ 0xFEA9, 0xFEA9, 0xFEA9 }, -{ 0xFEAA, 0xFEAA, 0xFEAA }, -{ 0xFEAB, 0xFEAB, 0xFEAB }, -{ 0xFEAC, 0xFEAC, 0xFEAC }, -{ 0xFEAD, 0xFEAD, 0xFEAD }, -{ 0xFEAE, 0xFEAE, 0xFEAE }, -{ 0xFEAF, 0xFEAF, 0xFEAF }, -{ 0xFEB0, 0xFEB0, 0xFEB0 }, -{ 0xFEB1, 0xFEB1, 0xFEB1 }, -{ 0xFEB2, 0xFEB2, 0xFEB2 }, -{ 0xFEB3, 0xFEB3, 0xFEB3 }, -{ 0xFEB4, 0xFEB4, 0xFEB4 }, -{ 0xFEB5, 0xFEB5, 0xFEB5 }, -{ 0xFEB6, 0xFEB6, 0xFEB6 }, -{ 0xFEB7, 0xFEB7, 0xFEB7 }, -{ 0xFEB8, 0xFEB8, 0xFEB8 }, -{ 0xFEB9, 0xFEB9, 0xFEB9 }, -{ 0xFEBA, 0xFEBA, 0xFEBA }, -{ 0xFEBB, 0xFEBB, 0xFEBB }, -{ 0xFEBC, 0xFEBC, 0xFEBC }, -{ 0xFEBD, 0xFEBD, 0xFEBD }, -{ 0xFEBE, 0xFEBE, 0xFEBE }, -{ 0xFEBF, 0xFEBF, 0xFEBF }, -{ 0xFEC0, 0xFEC0, 0xFEC0 }, -{ 0xFEC1, 0xFEC1, 0xFEC1 }, -{ 0xFEC2, 0xFEC2, 0xFEC2 }, -{ 0xFEC3, 0xFEC3, 0xFEC3 }, -{ 0xFEC4, 0xFEC4, 0xFEC4 }, -{ 0xFEC5, 0xFEC5, 0xFEC5 }, -{ 0xFEC6, 0xFEC6, 0xFEC6 }, -{ 0xFEC7, 0xFEC7, 0xFEC7 }, -{ 0xFEC8, 0xFEC8, 0xFEC8 }, -{ 0xFEC9, 0xFEC9, 0xFEC9 }, -{ 0xFECA, 0xFECA, 0xFECA }, -{ 0xFECB, 0xFECB, 0xFECB }, -{ 0xFECC, 0xFECC, 0xFECC }, -{ 0xFECD, 0xFECD, 0xFECD }, -{ 0xFECE, 0xFECE, 0xFECE }, -{ 0xFECF, 0xFECF, 0xFECF }, -{ 0xFED0, 0xFED0, 0xFED0 }, -{ 0xFED1, 0xFED1, 0xFED1 }, -{ 0xFED2, 0xFED2, 0xFED2 }, -{ 0xFED3, 0xFED3, 0xFED3 }, -{ 0xFED4, 0xFED4, 0xFED4 }, -{ 0xFED5, 0xFED5, 0xFED5 }, -{ 0xFED6, 0xFED6, 0xFED6 }, -{ 0xFED7, 0xFED7, 0xFED7 }, -{ 0xFED8, 0xFED8, 0xFED8 }, -{ 0xFED9, 0xFED9, 0xFED9 }, -{ 0xFEDA, 0xFEDA, 0xFEDA }, -{ 0xFEDB, 0xFEDB, 0xFEDB }, -{ 0xFEDC, 0xFEDC, 0xFEDC }, -{ 0xFEDD, 0xFEDD, 0xFEDD }, -{ 0xFEDE, 0xFEDE, 0xFEDE }, -{ 0xFEDF, 0xFEDF, 0xFEDF }, -{ 0xFEE0, 0xFEE0, 0xFEE0 }, -{ 0xFEE1, 0xFEE1, 0xFEE1 }, -{ 0xFEE2, 0xFEE2, 0xFEE2 }, -{ 0xFEE3, 0xFEE3, 0xFEE3 }, -{ 0xFEE4, 0xFEE4, 0xFEE4 }, -{ 0xFEE5, 0xFEE5, 0xFEE5 }, -{ 0xFEE6, 0xFEE6, 0xFEE6 }, -{ 0xFEE7, 0xFEE7, 0xFEE7 }, -{ 0xFEE8, 0xFEE8, 0xFEE8 }, -{ 0xFEE9, 0xFEE9, 0xFEE9 }, -{ 0xFEEA, 0xFEEA, 0xFEEA }, -{ 0xFEEB, 0xFEEB, 0xFEEB }, -{ 0xFEEC, 0xFEEC, 0xFEEC }, -{ 0xFEED, 0xFEED, 0xFEED }, -{ 0xFEEE, 0xFEEE, 0xFEEE }, -{ 0xFEEF, 0xFEEF, 0xFEEF }, -{ 0xFEF0, 0xFEF0, 0xFEF0 }, -{ 0xFEF1, 0xFEF1, 0xFEF1 }, -{ 0xFEF2, 0xFEF2, 0xFEF2 }, -{ 0xFEF3, 0xFEF3, 0xFEF3 }, -{ 0xFEF4, 0xFEF4, 0xFEF4 }, -{ 0xFEF5, 0xFEF5, 0xFEF5 }, -{ 0xFEF6, 0xFEF6, 0xFEF6 }, -{ 0xFEF7, 0xFEF7, 0xFEF7 }, -{ 0xFEF8, 0xFEF8, 0xFEF8 }, -{ 0xFEF9, 0xFEF9, 0xFEF9 }, -{ 0xFEFA, 0xFEFA, 0xFEFA }, -{ 0xFEFB, 0xFEFB, 0xFEFB }, -{ 0xFEFC, 0xFEFC, 0xFEFC }, -{ 0xFF21, 0xFF21, 0xFF41 }, -{ 0xFF22, 0xFF22, 0xFF42 }, -{ 0xFF23, 0xFF23, 0xFF43 }, -{ 0xFF24, 0xFF24, 0xFF44 }, -{ 0xFF25, 0xFF25, 0xFF45 }, -{ 0xFF26, 0xFF26, 0xFF46 }, -{ 0xFF27, 0xFF27, 0xFF47 }, -{ 0xFF28, 0xFF28, 0xFF48 }, -{ 0xFF29, 0xFF29, 0xFF49 }, -{ 0xFF2A, 0xFF2A, 0xFF4A }, -{ 0xFF2B, 0xFF2B, 0xFF4B }, -{ 0xFF2C, 0xFF2C, 0xFF4C }, -{ 0xFF2D, 0xFF2D, 0xFF4D }, -{ 0xFF2E, 0xFF2E, 0xFF4E }, -{ 0xFF2F, 0xFF2F, 0xFF4F }, -{ 0xFF30, 0xFF30, 0xFF50 }, -{ 0xFF31, 0xFF31, 0xFF51 }, -{ 0xFF32, 0xFF32, 0xFF52 }, -{ 0xFF33, 0xFF33, 0xFF53 }, -{ 0xFF34, 0xFF34, 0xFF54 }, -{ 0xFF35, 0xFF35, 0xFF55 }, -{ 0xFF36, 0xFF36, 0xFF56 }, -{ 0xFF37, 0xFF37, 0xFF57 }, -{ 0xFF38, 0xFF38, 0xFF58 }, -{ 0xFF39, 0xFF39, 0xFF59 }, -{ 0xFF3A, 0xFF3A, 0xFF5A }, -{ 0xFF41, 0xFF21, 0xFF41 }, -{ 0xFF42, 0xFF22, 0xFF42 }, -{ 0xFF43, 0xFF23, 0xFF43 }, -{ 0xFF44, 0xFF24, 0xFF44 }, -{ 0xFF45, 0xFF25, 0xFF45 }, -{ 0xFF46, 0xFF26, 0xFF46 }, -{ 0xFF47, 0xFF27, 0xFF47 }, -{ 0xFF48, 0xFF28, 0xFF48 }, -{ 0xFF49, 0xFF29, 0xFF49 }, -{ 0xFF4A, 0xFF2A, 0xFF4A }, -{ 0xFF4B, 0xFF2B, 0xFF4B }, -{ 0xFF4C, 0xFF2C, 0xFF4C }, -{ 0xFF4D, 0xFF2D, 0xFF4D }, -{ 0xFF4E, 0xFF2E, 0xFF4E }, -{ 0xFF4F, 0xFF2F, 0xFF4F }, -{ 0xFF50, 0xFF30, 0xFF50 }, -{ 0xFF51, 0xFF31, 0xFF51 }, -{ 0xFF52, 0xFF32, 0xFF52 }, -{ 0xFF53, 0xFF33, 0xFF53 }, -{ 0xFF54, 0xFF34, 0xFF54 }, -{ 0xFF55, 0xFF35, 0xFF55 }, -{ 0xFF56, 0xFF36, 0xFF56 }, -{ 0xFF57, 0xFF37, 0xFF57 }, -{ 0xFF58, 0xFF38, 0xFF58 }, -{ 0xFF59, 0xFF39, 0xFF59 }, -{ 0xFF5A, 0xFF3A, 0xFF5A }, -{ 0xFF66, 0xFF66, 0xFF66 }, -{ 0xFF67, 0xFF67, 0xFF67 }, -{ 0xFF68, 0xFF68, 0xFF68 }, -{ 0xFF69, 0xFF69, 0xFF69 }, -{ 0xFF6A, 0xFF6A, 0xFF6A }, -{ 0xFF6B, 0xFF6B, 0xFF6B }, -{ 0xFF6C, 0xFF6C, 0xFF6C }, -{ 0xFF6D, 0xFF6D, 0xFF6D }, -{ 0xFF6E, 0xFF6E, 0xFF6E }, -{ 0xFF6F, 0xFF6F, 0xFF6F }, -{ 0xFF70, 0xFF70, 0xFF70 }, -{ 0xFF71, 0xFF71, 0xFF71 }, -{ 0xFF72, 0xFF72, 0xFF72 }, -{ 0xFF73, 0xFF73, 0xFF73 }, -{ 0xFF74, 0xFF74, 0xFF74 }, -{ 0xFF75, 0xFF75, 0xFF75 }, -{ 0xFF76, 0xFF76, 0xFF76 }, -{ 0xFF77, 0xFF77, 0xFF77 }, -{ 0xFF78, 0xFF78, 0xFF78 }, -{ 0xFF79, 0xFF79, 0xFF79 }, -{ 0xFF7A, 0xFF7A, 0xFF7A }, -{ 0xFF7B, 0xFF7B, 0xFF7B }, -{ 0xFF7C, 0xFF7C, 0xFF7C }, -{ 0xFF7D, 0xFF7D, 0xFF7D }, -{ 0xFF7E, 0xFF7E, 0xFF7E }, -{ 0xFF7F, 0xFF7F, 0xFF7F }, -{ 0xFF80, 0xFF80, 0xFF80 }, -{ 0xFF81, 0xFF81, 0xFF81 }, -{ 0xFF82, 0xFF82, 0xFF82 }, -{ 0xFF83, 0xFF83, 0xFF83 }, -{ 0xFF84, 0xFF84, 0xFF84 }, -{ 0xFF85, 0xFF85, 0xFF85 }, -{ 0xFF86, 0xFF86, 0xFF86 }, -{ 0xFF87, 0xFF87, 0xFF87 }, -{ 0xFF88, 0xFF88, 0xFF88 }, -{ 0xFF89, 0xFF89, 0xFF89 }, -{ 0xFF8A, 0xFF8A, 0xFF8A }, -{ 0xFF8B, 0xFF8B, 0xFF8B }, -{ 0xFF8C, 0xFF8C, 0xFF8C }, -{ 0xFF8D, 0xFF8D, 0xFF8D }, -{ 0xFF8E, 0xFF8E, 0xFF8E }, -{ 0xFF8F, 0xFF8F, 0xFF8F }, -{ 0xFF90, 0xFF90, 0xFF90 }, -{ 0xFF91, 0xFF91, 0xFF91 }, -{ 0xFF92, 0xFF92, 0xFF92 }, -{ 0xFF93, 0xFF93, 0xFF93 }, -{ 0xFF94, 0xFF94, 0xFF94 }, -{ 0xFF95, 0xFF95, 0xFF95 }, -{ 0xFF96, 0xFF96, 0xFF96 }, -{ 0xFF97, 0xFF97, 0xFF97 }, -{ 0xFF98, 0xFF98, 0xFF98 }, -{ 0xFF99, 0xFF99, 0xFF99 }, -{ 0xFF9A, 0xFF9A, 0xFF9A }, -{ 0xFF9B, 0xFF9B, 0xFF9B }, -{ 0xFF9C, 0xFF9C, 0xFF9C }, -{ 0xFF9D, 0xFF9D, 0xFF9D }, -{ 0xFF9E, 0xFF9E, 0xFF9E }, -{ 0xFF9F, 0xFF9F, 0xFF9F }, -{ 0xFFA0, 0xFFA0, 0xFFA0 }, -{ 0xFFA1, 0xFFA1, 0xFFA1 }, -{ 0xFFA2, 0xFFA2, 0xFFA2 }, -{ 0xFFA3, 0xFFA3, 0xFFA3 }, -{ 0xFFA4, 0xFFA4, 0xFFA4 }, -{ 0xFFA5, 0xFFA5, 0xFFA5 }, -{ 0xFFA6, 0xFFA6, 0xFFA6 }, -{ 0xFFA7, 0xFFA7, 0xFFA7 }, -{ 0xFFA8, 0xFFA8, 0xFFA8 }, -{ 0xFFA9, 0xFFA9, 0xFFA9 }, -{ 0xFFAA, 0xFFAA, 0xFFAA }, -{ 0xFFAB, 0xFFAB, 0xFFAB }, -{ 0xFFAC, 0xFFAC, 0xFFAC }, -{ 0xFFAD, 0xFFAD, 0xFFAD }, -{ 0xFFAE, 0xFFAE, 0xFFAE }, -{ 0xFFAF, 0xFFAF, 0xFFAF }, -{ 0xFFB0, 0xFFB0, 0xFFB0 }, -{ 0xFFB1, 0xFFB1, 0xFFB1 }, -{ 0xFFB2, 0xFFB2, 0xFFB2 }, -{ 0xFFB3, 0xFFB3, 0xFFB3 }, -{ 0xFFB4, 0xFFB4, 0xFFB4 }, -{ 0xFFB5, 0xFFB5, 0xFFB5 }, -{ 0xFFB6, 0xFFB6, 0xFFB6 }, -{ 0xFFB7, 0xFFB7, 0xFFB7 }, -{ 0xFFB8, 0xFFB8, 0xFFB8 }, -{ 0xFFB9, 0xFFB9, 0xFFB9 }, -{ 0xFFBA, 0xFFBA, 0xFFBA }, -{ 0xFFBB, 0xFFBB, 0xFFBB }, -{ 0xFFBC, 0xFFBC, 0xFFBC }, -{ 0xFFBD, 0xFFBD, 0xFFBD }, -{ 0xFFBE, 0xFFBE, 0xFFBE }, -{ 0xFFC2, 0xFFC2, 0xFFC2 }, -{ 0xFFC3, 0xFFC3, 0xFFC3 }, -{ 0xFFC4, 0xFFC4, 0xFFC4 }, -{ 0xFFC5, 0xFFC5, 0xFFC5 }, -{ 0xFFC6, 0xFFC6, 0xFFC6 }, -{ 0xFFC7, 0xFFC7, 0xFFC7 }, -{ 0xFFCA, 0xFFCA, 0xFFCA }, -{ 0xFFCB, 0xFFCB, 0xFFCB }, -{ 0xFFCC, 0xFFCC, 0xFFCC }, -{ 0xFFCD, 0xFFCD, 0xFFCD }, -{ 0xFFCE, 0xFFCE, 0xFFCE }, -{ 0xFFCF, 0xFFCF, 0xFFCF }, -{ 0xFFD2, 0xFFD2, 0xFFD2 }, -{ 0xFFD3, 0xFFD3, 0xFFD3 }, -{ 0xFFD4, 0xFFD4, 0xFFD4 }, -{ 0xFFD5, 0xFFD5, 0xFFD5 }, -{ 0xFFD6, 0xFFD6, 0xFFD6 }, -{ 0xFFD7, 0xFFD7, 0xFFD7 }, -{ 0xFFDA, 0xFFDA, 0xFFDA }, -{ 0xFFDB, 0xFFDB, 0xFFDB }, -{ 0xFFDC, 0xFFDC, 0xFFDC } -}; diff --git a/subprojects/hunspell/src/hunspell/w_char.hxx b/subprojects/hunspell/src/hunspell/w_char.hxx deleted file mode 100644 index 3719dd3b7..000000000 --- a/subprojects/hunspell/src/hunspell/w_char.hxx +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef __WCHARHXX__ -#define __WCHARHXX__ - -#ifndef GCC -typedef struct { -#else -typedef struct __attribute__ ((packed)) { -#endif - unsigned char l; - unsigned char h; -} w_char; - -// two character arrays -struct replentry { - char * pattern; - char * pattern2; - bool start; - bool end; -}; - -#endif diff --git a/subprojects/hunspell/src/win_api/config.h b/subprojects/hunspell/src/win_api/config.h deleted file mode 100644 index 9a00faee8..000000000 --- a/subprojects/hunspell/src/win_api/config.h +++ /dev/null @@ -1,208 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#define CRAY_STACKSEG_END 1 - -/* Define to 1 if using `alloca.c'. */ -#define C_ALLOCA 1 - -/* Define to 1 if translation of program messages to the user's native - language is requested. */ -#undef ENABLE_NLS - -/* Define to 1 if you have `alloca', as a function or macro. */ -#define HAVE_ALLOCA 1 - -/* Define to 1 if you have and it should be used (not on Ultrix). - */ -#define HAVE_ALLOCA_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ARGZ_H 1 - -/* "Define if you have the header" */ -#undef HAVE_CURSES_H - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -#define HAVE_DCGETTEXT 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ERROR_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have the `feof_unlocked' function. */ -#define HAVE_FEOF_UNLOCKED 1 - -/* Define to 1 if you have the `fgets_unlocked' function. */ -#define HAVE_FGETS_UNLOCKED 1 - -/* Define to 1 if you have the `getcwd' function. */ -#define HAVE_GETCWD 1 - -/* Define to 1 if you have the `getc_unlocked' function. */ -#define HAVE_GETC_UNLOCKED 1 - -/* Define to 1 if you have the `getegid' function. */ -#define HAVE_GETEGID 1 - -/* Define to 1 if you have the `geteuid' function. */ -#define HAVE_GETEUID 1 - -/* Define to 1 if you have the `getgid' function. */ -#define HAVE_GETGID 1 - -/* Define to 1 if you have the `getpagesize' function. */ -#define HAVE_GETPAGESIZE 1 - -/* Define if the GNU gettext() function is already present or preinstalled. */ -#define HAVE_GETTEXT 1 - -/* Define to 1 if you have the `getuid' function. */ -#define HAVE_GETUID 1 - -/* Define if you have the iconv() function. */ -#undef HAVE_ICONV - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define if you have and nl_langinfo(CODESET). */ -#define HAVE_LANGINFO_CODESET 1 - -/* Define if your file defines LC_MESSAGES. */ -#define HAVE_LC_MESSAGES 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LIBINTL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LOCALE_H 1 - -/* Define to 1 if you have the `memchr' function. */ -#define HAVE_MEMCHR 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `mempcpy' function. */ -#define HAVE_MEMPCPY 1 - -/* Define to 1 if you have a working `mmap' system call. */ -#define HAVE_MMAP 1 - -/* Define to 1 if you have the `munmap' function. */ -#define HAVE_MUNMAP 1 - -/* "Define if you have the header" */ -#define HAVE_NCURSESW_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NL_TYPES_H 1 - -/* Define to 1 if you have the `putenv' function. */ -#define HAVE_PUTENV 1 - -/* "Define if you have fancy command input editing with Readline" */ -#undef HAVE_READLINE - -/* Define to 1 if you have the `setenv' function. */ -#define HAVE_SETENV 1 - -/* Define to 1 if you have the `setlocale' function. */ -#define HAVE_SETLOCALE 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `stpcpy' function. */ -#define HAVE_STPCPY 1 - -/* Define to 1 if you have the `strcasecmp' function. */ -#define HAVE_STRCASECMP 1 - -/* Define to 1 if you have the `strchr' function. */ -#define HAVE_STRCHR 1 - -/* Define to 1 if you have the `strdup' function. */ -#define HAVE_STRDUP 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strstr' function. */ -#define HAVE_STRSTR 1 - -/* Define to 1 if you have the `strtoul' function. */ -#define HAVE_STRTOUL 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_PARAM_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the `tsearch' function. */ -#define HAVE_TSEARCH 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the `__argz_count' function. */ -#define HAVE___ARGZ_COUNT 1 - -/* Define to 1 if you have the `__argz_next' function. */ -#define HAVE___ARGZ_NEXT 1 - -/* Define to 1 if you have the `__argz_stringify' function. */ -#define HAVE___ARGZ_STRINGIFY 1 - -/* "Define if you use exterimental functions" */ -#undef HUNSPELL_EXPERIMENTAL - -/* "Define if you need warning messages" */ -#define HUNSPELL_WARNING_ON - -/* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST 1 - -/* Name of package */ -#define PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#define PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "1.3.3" -#define VERSION "1.3.3" diff --git a/subprojects/packagefiles/hunspell/meson.build b/subprojects/packagefiles/hunspell/meson.build new file mode 100644 index 000000000..e0ad04e9f --- /dev/null +++ b/subprojects/packagefiles/hunspell/meson.build @@ -0,0 +1,9 @@ +project('Hunspell', 'cpp', version: '1.7.0', meson_version: '>=0.57.0') + +subdir('src/hunspell') + +inc = include_directories('src') + +hunspell_dep = declare_dependency(link_with: hunspell, + include_directories: inc, + compile_args: compile_args) diff --git a/subprojects/packagefiles/hunspell/src/hunspell/meson.build b/subprojects/packagefiles/hunspell/src/hunspell/meson.build new file mode 100644 index 000000000..d15f0c2d9 --- /dev/null +++ b/subprojects/packagefiles/hunspell/src/hunspell/meson.build @@ -0,0 +1,23 @@ +hunspell_sources = files([ + 'affentry.cxx', + 'affixmgr.cxx', + 'csutil.cxx', + 'filemgr.cxx', + 'hashmgr.cxx', + 'hunspell.cxx', + 'hunzip.cxx', + 'phonet.cxx', + 'replist.cxx', + 'suggestmgr.cxx', +]) + +if get_option('default_library') == 'static' + cpp_args = [] + compile_args = ['-DHUNSPELL_STATIC'] +else + cpp_args = ['-DBUILDING_LIBHUNSPELL'] + compile_args = [] +endif + +hunspell = library('hunspell', hunspell_sources, + cpp_args: cpp_args + compile_args) From 84ac7169728ea6c1f92547563057f28b895ef230 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Wed, 7 Apr 2021 12:32:33 +0100 Subject: [PATCH 256/271] meson: add uchardet port Meson port instead of using CMake as I ran into issues with the src directory (where uchardet.h is located) not being appended to the include path, and on Windows I ran into a Meson issue where a -D macro definition was being interpreted as a filename. In the end a Meson port seemed simpler than working out the CMake issues, as the CMakeLists.txt files were straightforward and easy to port. Note that because of the directory structure of the uchardet source I had to change the include directive from uchardet/uchardet.h to just uchardet.h. This is actually more in line with the uchardet pkg-config file, which appends /usr/include/uchardet to the include path. --- libaegisub/common/charset.cpp | 2 +- meson.build | 2 +- subprojects/packagefiles/uchardet/meson.build | 16 ++++++ .../packagefiles/uchardet/src/meson.build | 54 +++++++++++++++++++ subprojects/uchardet.wrap | 9 ++++ 5 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 subprojects/packagefiles/uchardet/meson.build create mode 100644 subprojects/packagefiles/uchardet/src/meson.build create mode 100644 subprojects/uchardet.wrap diff --git a/libaegisub/common/charset.cpp b/libaegisub/common/charset.cpp index 81008538b..fa25eea83 100644 --- a/libaegisub/common/charset.cpp +++ b/libaegisub/common/charset.cpp @@ -22,7 +22,7 @@ #include "libaegisub/scoped_ptr.h" #ifdef WITH_UCHARDET -#include +#include #endif namespace agi { namespace charset { diff --git a/meson.build b/meson.build index 54675d5c0..a8480e927 100644 --- a/meson.build +++ b/meson.build @@ -184,7 +184,7 @@ foreach dep: [ # other ['fftw3', '', 'FFTW3', []], ['hunspell', '', 'Hunspell', ['hunspell', 'hunspell_dep']], - ['uchardet', '', 'uchardet', []], # needs a proper port + ['uchardet', '', 'uchardet', ['uchardet', 'uchardet_dep']], ] dep_version = dep[1] != '' ? dep[1] : '>=0' # [provide] section is ignored if required is false; diff --git a/subprojects/packagefiles/uchardet/meson.build b/subprojects/packagefiles/uchardet/meson.build new file mode 100644 index 000000000..85732e17f --- /dev/null +++ b/subprojects/packagefiles/uchardet/meson.build @@ -0,0 +1,16 @@ +project('uchardet', 'cpp', version: '0.0.7', meson_version: '>=0.57.0') + +inc = include_directories('src') + +cpp = meson.get_compiler('cpp') + +if cpp.has_argument('-msse2') and cpp.has_argument('-mfpmath=sse') + add_project_arguments('-msse2', '-mfpmath=sse', language: 'cpp') +elif cpp.has_argument('-ffloat-store') + add_project_arguments('-ffloat-store', language: 'cpp') +endif + +subdir('src') + +uchardet_dep = declare_dependency(link_with: uchardet, + include_directories: inc) diff --git a/subprojects/packagefiles/uchardet/src/meson.build b/subprojects/packagefiles/uchardet/src/meson.build new file mode 100644 index 000000000..cf5dd2a38 --- /dev/null +++ b/subprojects/packagefiles/uchardet/src/meson.build @@ -0,0 +1,54 @@ + +uchardet_sources = files([ + 'CharDistribution.cpp', + 'JpCntx.cpp', + 'LangModels/LangArabicModel.cpp', + 'LangModels/LangBulgarianModel.cpp', + 'LangModels/LangCroatianModel.cpp', + 'LangModels/LangCzechModel.cpp', + 'LangModels/LangEsperantoModel.cpp', + 'LangModels/LangEstonianModel.cpp', + 'LangModels/LangFinnishModel.cpp', + 'LangModels/LangFrenchModel.cpp', + 'LangModels/LangDanishModel.cpp', + 'LangModels/LangGermanModel.cpp', + 'LangModels/LangGreekModel.cpp', + 'LangModels/LangHungarianModel.cpp', + 'LangModels/LangHebrewModel.cpp', + 'LangModels/LangIrishModel.cpp', + 'LangModels/LangItalianModel.cpp', + 'LangModels/LangLithuanianModel.cpp', + 'LangModels/LangLatvianModel.cpp', + 'LangModels/LangMalteseModel.cpp', + 'LangModels/LangPolishModel.cpp', + 'LangModels/LangPortugueseModel.cpp', + 'LangModels/LangRomanianModel.cpp', + 'LangModels/LangRussianModel.cpp', + 'LangModels/LangSlovakModel.cpp', + 'LangModels/LangSloveneModel.cpp', + 'LangModels/LangSwedishModel.cpp', + 'LangModels/LangSpanishModel.cpp', + 'LangModels/LangThaiModel.cpp', + 'LangModels/LangTurkishModel.cpp', + 'LangModels/LangVietnameseModel.cpp', + 'nsHebrewProber.cpp', + 'nsCharSetProber.cpp', + 'nsBig5Prober.cpp', + 'nsEUCJPProber.cpp', + 'nsEUCKRProber.cpp', + 'nsEUCTWProber.cpp', + 'nsEscCharsetProber.cpp', + 'nsEscSM.cpp', + 'nsGB2312Prober.cpp', + 'nsMBCSGroupProber.cpp', + 'nsMBCSSM.cpp', + 'nsSBCSGroupProber.cpp', + 'nsSBCharSetProber.cpp', + 'nsSJISProber.cpp', + 'nsUTF8Prober.cpp', + 'nsLatin1Prober.cpp', + 'nsUniversalDetector.cpp', + 'uchardet.cpp', +]) + +uchardet = library('uchardet', uchardet_sources) diff --git a/subprojects/uchardet.wrap b/subprojects/uchardet.wrap new file mode 100644 index 000000000..052c757c3 --- /dev/null +++ b/subprojects/uchardet.wrap @@ -0,0 +1,9 @@ +[wrap-file] +directory = uchardet-0.0.7 +source_url = https://www.freedesktop.org/software/uchardet/releases/uchardet-0.0.7.tar.xz +source_filename = uchardet-0.0.7.tar.gz +source_hash = 3fc79408ae1d84b406922fa9319ce005631c95ca0f34b205fad867e8b30e45b1 +patch_directory = uchardet + +[provides] +uchardet = uchardet_dep From a85603007824c32beddaece92e259c4dd7071728 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Fri, 21 May 2021 21:24:28 -0400 Subject: [PATCH 257/271] Switch to new boost tarball hosting --- subprojects/boost.wrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/boost.wrap b/subprojects/boost.wrap index e66c7ff5b..1b2019981 100644 --- a/subprojects/boost.wrap +++ b/subprojects/boost.wrap @@ -1,6 +1,6 @@ [wrap-file] directory = boost_1_74_0 -source_url = https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.gz +source_url = https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.gz source_filename = boost_1_74_0.tar.gz source_hash = afff36d392885120bcac079148c177d1f6f7730ec3d47233aa51b0afa4db94a5 patch_directory = boost From aeba7a390e2816e3fcd041e17c4cd6bb616578f2 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Fri, 21 May 2021 22:02:21 -0400 Subject: [PATCH 258/271] Re-enable MacOS CI --- .github/workflows/ci.yml | 24 ++++++++++++------------ meson.build | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49c155393..25563535d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,18 +38,18 @@ jobs: buildtype: release, args: '' } - #- { - # name: macOS Debug, - # os: macos-latest, - # buildtype: debugoptimized, - # args: -Ddefault_library=static - #} - #- { - # name: macOS Release, - # os: macos-latest, - # buildtype: release, - # args: -Ddefault_library=static - #} + - { + name: macOS Debug, + os: macos-latest, + buildtype: debugoptimized, + args: -Ddefault_library=static + } + - { + name: macOS Release, + os: macos-latest, + buildtype: release, + args: -Ddefault_library=static + } steps: - uses: actions/checkout@v2 diff --git a/meson.build b/meson.build index a8480e927..cd03a4f27 100644 --- a/meson.build +++ b/meson.build @@ -230,7 +230,7 @@ if host_machine.system() == 'windows' and not get_option('directsound').disabled endif if host_machine.system() == 'darwin' - frameworks_dep = dependency('appleframeworks', modules : ['CoreText', 'CoreFoundation', 'AppKit', 'Carbon']) + frameworks_dep = dependency('appleframeworks', modules : ['CoreText', 'CoreFoundation', 'AppKit', 'Carbon', 'IOKit']) deps += frameworks_dep endif @@ -326,7 +326,7 @@ aegisub_c_pch = ['src/include/agi_pre_c.h'] aegisub = executable('aegisub', aegisub_src, version_h, acconf, link_with: [libresrc, libluabins, libaegisub], - include_directories: [libaegisub_inc, libresrc_inc, version_inc, deps_inc], + include_directories: [libaegisub_inc, libresrc_inc, version_inc, deps_inc, include_directories('src')], cpp_pch: aegisub_cpp_pch, c_pch: aegisub_c_pch, install: true, From 62c3acb66613da265f2731c64249ad48aad30cf0 Mon Sep 17 00:00:00 2001 From: woclass <5158738+inkydragon@users.noreply.github.com> Date: Sun, 23 May 2021 14:06:10 +0800 Subject: [PATCH 259/271] Fix localization file generation on Windows (#119) * [git] ignore IDE setting, Meson subprojects * [win_installer] rename *.mo -> *.gmo * [win_installer] only add aeg translations * [win_installer] split aeg/wx translations * [win_installer] gen & pack translations * [git] ignore hunspell source dir * [git] ignore uchardet source dir * [git] remove IDE dir * [git] remove unused subprojects --- .gitignore | 2 + packages/win_installer/aegisub_depctrl.iss | 3 +- .../win_installer/fragment_translations.iss | 70 ++++++++++--------- tools/win-installer-setup.ps1 | 4 +- 4 files changed, 45 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index 7fcada57b..e07ce77b9 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,5 @@ subprojects/proxy-libintl* subprojects/wxWidgets subprojects/zlib-* subprojects/dirent-* +subprojects/hunspell-* +subprojects/uchardet-* diff --git a/packages/win_installer/aegisub_depctrl.iss b/packages/win_installer/aegisub_depctrl.iss index 0cc857265..2222415e8 100644 --- a/packages/win_installer/aegisub_depctrl.iss +++ b/packages/win_installer/aegisub_depctrl.iss @@ -1,5 +1,6 @@ #define DEPCTRL ;#define UNOFFICIAL_LANGUAGES -;#define ENABLE_TRANSLATIONS +#define ENABLE_AEG_TRANSLATIONS +; #define ENABLE_WX_TRANSLATIONS #include "aegisub3.iss" diff --git a/packages/win_installer/fragment_translations.iss b/packages/win_installer/fragment_translations.iss index 2e6098711..c54ef3010 100644 --- a/packages/win_installer/fragment_translations.iss +++ b/packages/win_installer/fragment_translations.iss @@ -1,64 +1,70 @@ ; This file declares everything related to installable translations of Aegisub [Files] -; localization (commented out ones are out of date; some don't have wxstd.mo) -#ifdef ENABLE_TRANSLATIONS -Source: {#BUILD_ROOT}\po\ar.mo; DestDir: {app}\locale\ar; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +; Aegisub localization +#ifdef ENABLE_AEG_TRANSLATIONS +Source: {#BUILD_ROOT}\po\ar.gmo; DestDir: {app}\locale\ar; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\bg.gmo; DestDir: {app}\locale\bg; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\ca.gmo; DestDir: {app}\locale\ca; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\cs.gmo; DestDir: {app}\locale\cs; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\da.gmo; DestDir: {app}\locale\da; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\de.gmo; DestDir: {app}\locale\de; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\el.gmo; DestDir: {app}\locale\el; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\es.gmo; DestDir: {app}\locale\es; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\eu.gmo; DestDir: {app}\locale\eu; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\fa.gmo; DestDir: {app}\locale\fa; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\fr_FR.gmo; DestDir: {app}\locale\fr_FR; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\gl.gmo; DestDir: {app}\locale\gl; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\hu.gmo; DestDir: {app}\locale\hu; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\id.gmo; DestDir: {app}\locale\id; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\it.gmo; DestDir: {app}\locale\it; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\ja.gmo; DestDir: {app}\locale\ja; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\ko.gmo; DestDir: {app}\locale\ko; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\nl.gmo; DestDir: {app}\locale\nl; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\pl.gmo; DestDir: {app}\locale\pl; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\pt_BR.gmo; DestDir: {app}\locale\pt_BR; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\pt_PT.gmo; DestDir: {app}\locale\pt_PT; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\ru.gmo; DestDir: {app}\locale\ru; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\sr_RS.gmo; DestDir: {app}\locale\sr_RS; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\sr_RS@latin.gmo; DestDir: {app}\locale\sr_RS@latin; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\uk_UA.gmo; DestDir: {app}\locale\uk_UA; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\vi.gmo; DestDir: {app}\locale\vi; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\zh_CN.gmo; DestDir: {app}\locale\zh_CN; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +Source: {#BUILD_ROOT}\po\zh_TW.gmo; DestDir: {app}\locale\zh_TW; DestName: aegisub.mo; Flags: ignoreversion; Components: translations +#endif +; END ENABLE_TRANSLATIONS + + +#ifdef ENABLE_WX_TRANSLATIONS +; wxWidgets localization (commented out ones are out of date; some don't have wxstd.mo) Source: src\mo\wxstd-ar.mo; DestDir: {app}\locale\ar; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\bg.mo; DestDir: {app}\locale\bg; DestName: aegisub.mo; Flags: ignoreversion; Components: translations ; Missing wxstd for Bulgarian -Source: {#BUILD_ROOT}\po\ca.mo; DestDir: {app}\locale\ca; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-ca.mo; DestDir: {app}\locale\ca; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\cs.mo; DestDir: {app}\locale\cs; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-cs.mo; DestDir: {app}\locale\cs; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\da.mo; DestDir: {app}\locale\da; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-da.mo; DestDir: {app}\locale\da; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\de.mo; DestDir: {app}\locale\de; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-de.mo; DestDir: {app}\locale\de; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\el.mo; DestDir: {app}\locale\el; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-el.mo; DestDir: {app}\locale\el; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\es.mo; DestDir: {app}\locale\es; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-es.mo; DestDir: {app}\locale\es; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\eu.mo; DestDir: {app}\locale\eu; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-eu.mo; DestDir: {app}\locale\eu; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\fa.mo; DestDir: {app}\locale\fa; DestName: aegisub.mo; Flags: ignoreversion; Components: translations ; Farsi wxstd missing ;Source: src\mo\wxstd-fa.mo; DestDir: {app}\locale\fa; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\fi.mo; DestDir: {app}\locale\fi; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-fi.mo; DestDir: {app}\locale\fi; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\fr_FR.mo; DestDir: {app}\locale\fr_FR; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-fr.mo; DestDir: {app}\locale\fr_FR; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\gl.mo; DestDir: {app}\locale\gl; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-gl_ES.mo; DestDir: {app}\locale\gl; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\hu.mo; DestDir: {app}\locale\hu; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-hu.mo; DestDir: {app}\locale\hu; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\id.mo; DestDir: {app}\locale\id; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-id.mo; DestDir: {app}\locale\id; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\it.mo; DestDir: {app}\locale\it; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-it.mo; DestDir: {app}\locale\it; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\ja.mo; DestDir: {app}\locale\ja; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-ja.mo; DestDir: {app}\locale\ja; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\ko.mo; DestDir: {app}\locale\ko; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-ko_KR.mo; DestDir: {app}\locale\ko; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\nl.mo; DestDir: {app}\locale\nl; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-nl.mo; DestDir: {app}\locale\nl; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\pl.mo; DestDir: {app}\locale\pl; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-pl.mo; DestDir: {app}\locale\pl; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\pt_BR.mo; DestDir: {app}\locale\pt_BR; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-pt_BR.mo; DestDir: {app}\locale\pt_BR; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\pt_PT.mo; DestDir: {app}\locale\pt_PT; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-pt.mo; DestDir: {app}\locale\pt_PT; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\ru.mo; DestDir: {app}\locale\ru; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-ru.mo; DestDir: {app}\locale\ru; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\sr_RS.mo; DestDir: {app}\locale\sr_RS; DestName: aegisub.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\sr_RS@latin.mo; DestDir: {app}\locale\sr_RS@latin; DestName: aegisub.mo; Flags: ignoreversion; Components: translations ; Missing wxstd for Serbian -Source: {#BUILD_ROOT}\po\uk_UA.mo; DestDir: {app}\locale\uk_UA; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-uk_UA.mo; DestDir: {app}\locale\uk_UA; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\vi.mo; DestDir: {app}\locale\vi; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-vi.mo; DestDir: {app}\locale\vi; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\zh_CN.mo; DestDir: {app}\locale\zh_CN; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-zh_CN.mo; DestDir: {app}\locale\zh_CN; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -Source: {#BUILD_ROOT}\po\zh_TW.mo; DestDir: {app}\locale\zh_TW; DestName: aegisub.mo; Flags: ignoreversion; Components: translations Source: src\mo\wxstd-zh_TW.mo; DestDir: {app}\locale\zh_TW; DestName: wxstd.mo; Flags: ignoreversion; Components: translations -#endif +#endif +; END ENABLE_WX_TRANSLATIONS diff --git a/tools/win-installer-setup.ps1 b/tools/win-installer-setup.ps1 index 61fc5bbc9..312bf292c 100644 --- a/tools/win-installer-setup.ps1 +++ b/tools/win-installer-setup.ps1 @@ -76,7 +76,9 @@ if (!(Test-Path VC_redist)) { # TODO dictionaries -# TODO localization +# localization +Set-Location $BuildRoot +meson compile aegisub-gmo # Invoke InnoSetup $IssUrl = Join-Path $InstallerDir "aegisub_depctrl.iss" From 761194025ffafcfba5d1b11d7adf9a6194355075 Mon Sep 17 00:00:00 2001 From: Yi-Jyun Pan Date: Sun, 23 May 2021 13:11:30 +0800 Subject: [PATCH 260/271] meson: luajit: allow to build in ARM64 Meson thought that a ARM64 cpu is aarch64, while luajit only provided a file for "arm64". Since there is no difference but the name between aarch64 and arm64, I choose to bind aarch64 -> arm64. Signed-off-by: Yi-Jyun Pan --- subprojects/packagefiles/luajit/src/host/meson.build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subprojects/packagefiles/luajit/src/host/meson.build b/subprojects/packagefiles/luajit/src/host/meson.build index ff74a3c7a..c7b825bb8 100644 --- a/subprojects/packagefiles/luajit/src/host/meson.build +++ b/subprojects/packagefiles/luajit/src/host/meson.build @@ -2,10 +2,13 @@ minilua = executable('minilua', 'minilua.c', dependencies: system_deps, native: true) -if host_machine.cpu_family() == 'x86_64' +cpu_family = host_machine.cpu_family() +if cpu_family == 'x86_64' dynasm_arch = 'x64' +elif cpu_family == 'aarch64' + dynasm_arch = 'arm64' else - dynasm_arch = host_machine.cpu_family() + dynasm_arch = cpu_family endif dynasm_dasc = files('../vm_@0@.dasc'.format(dynasm_arch)) From 52c8fef28cf67d52bb7b38c771771f9be88e4576 Mon Sep 17 00:00:00 2001 From: woclass <5158738+inkydragon@users.noreply.github.com> Date: Sun, 23 May 2021 16:37:54 +0800 Subject: [PATCH 261/271] Generate Win portable.zip (#124) * [git] ignore IDE setting, Meson subprojects * [win_installer] rename *.mo -> *.gmo * [win_installer] only add aeg translations * [win_installer] split aeg/wx translations * [win_installer] gen & pack translations * [git] ignore hunspell source dir * [git] ignore uchardet source dir * [win_installer\portable] add new target `meson win-portable` + meson install copy `include/unicode-monkeypatch.lua` * [win_installer\portable] make aegisub-portable-64.zip + remove WinRAR deps * [win_installer\portable] using powershell * [git] upload portable.zip * [win_installer\portable] rm freetype * [repo] remove Optional dependencies: WinRAR * [repo] Update README.md, add cmd to gen zip file * [repo] use recommended build command * [git] remove IDE dir * [ci] add Windows portable installer build step --- .github/workflows/ci.yml | 15 +++- README.md | 9 +- automation/meson.build | 1 + packages/meson.build | 4 +- packages/win_installer/portable/config.json | 2 +- .../portable/create-portable.bat | 22 ----- .../portable/create-portable.ps1 | 86 +++++++++++++++++++ 7 files changed, 109 insertions(+), 30 deletions(-) delete mode 100644 packages/win_installer/portable/create-portable.bat create mode 100644 packages/win_installer/portable/create-portable.ps1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25563535d..3661ee3a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,9 +103,20 @@ jobs: if: matrix.config.os == 'windows-latest' run: meson compile win-installer -C build - - name: Upload artifacts + - name: Generate Windows portable installer + if: matrix.config.os == 'windows-latest' + run: cd build && ninja win-portable + + - name: Upload artifacts - win_installer uses: actions/upload-artifact@v2 if: matrix.config.os == 'windows-latest' with: - name: ${{ matrix.config.name }} + name: ${{ matrix.config.name }} - installer path: build/Aegisub-*.exe + + - name: Upload artifacts - portable.zip + uses: actions/upload-artifact@v2 + if: matrix.config.os == 'windows-latest' + with: + name: ${{ matrix.config.name }} - portable + path: build/aegisub-portable-64.zip diff --git a/README.md b/README.md index e1a83567a..bab339076 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,9 @@ Prerequisites: There are a few optional dependencies that must be installed and on your PATH: 1. msgfmt, to build the translations -2. WinRAR, to build the portable installer -3. InnoSetup, to build the regular installer -4. 7zip, to build the regular installer -5. Moonscript, to build the regular installer +2. InnoSetup, to build the regular installer +3. 7zip, to build the regular installer +4. Moonscript, to build the regular installer All other dependencies are either stored in the repository or are included as submodules. @@ -41,6 +40,8 @@ Installer: You can generate the installer with `ninja win-installer` after a successful build. This assumes a working internet connection and installation of the optional dependencies. +You can generate the portable zip with `ninja win-portable` after a successful build. + ### OS X A vaguely recent version of Xcode and the corresponding command-line tools are required. diff --git a/automation/meson.build b/automation/meson.build index e32a0cd9d..cfa428d57 100644 --- a/automation/meson.build +++ b/automation/meson.build @@ -27,6 +27,7 @@ install_data( 'include/moonscript.lua', 'include/re.lua', 'include/unicode.lua', + 'include/unicode-monkeypatch.lua', 'include/utils-auto4.lua', 'include/utils.lua', install_dir: automation_dir / 'include') diff --git a/packages/meson.build b/packages/meson.build index 41a0ab5cf..39be5aae7 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -1,9 +1,11 @@ conf_pkg = configuration_data() if host_machine.system() == 'windows' - installer_setup = find_program(meson.project_source_root() / 'tools/win-installer-setup.ps1', ) + installer_setup = find_program(meson.project_source_root() / 'tools/win-installer-setup.ps1') run_target('win-installer', command: [installer_setup, meson.project_build_root(), meson.project_source_root()]) + portable_setup = find_program(meson.project_source_root() / 'packages/win_installer/portable/create-portable.ps1') + run_target('win-portable', command: [portable_setup, meson.project_build_root(), meson.project_source_root()]) elif host_machine.system() == 'darwin' fontconfig_conf = run_command('pkg-config', '--variable=confdir', 'fontconfig').stdout().strip() run_target('osx-bundle', diff --git a/packages/win_installer/portable/config.json b/packages/win_installer/portable/config.json index dfc6ea631..52192d8b6 100644 --- a/packages/win_installer/portable/config.json +++ b/packages/win_installer/portable/config.json @@ -1,5 +1,5 @@ { "App" : { - "Local Config" : true, + "Local Config" : true } } diff --git a/packages/win_installer/portable/create-portable.bat b/packages/win_installer/portable/create-portable.bat deleted file mode 100644 index 4d42b6c51..000000000 --- a/packages/win_installer/portable/create-portable.bat +++ /dev/null @@ -1,22 +0,0 @@ -@echo off - -echo Gathering files -xcopy ..\..\..\automation\autoload\*.lua aegisub-portable\automation\autoload\ > NUL -xcopy ..\..\..\automation\demos\*.lua aegisub-portable\automation\demos\ > NUL -xcopy ..\..\..\automation\include\*.lua aegisub-portable\automation\include\ > NUL -xcopy ..\..\..\bin\aegisub64.exe aegisub-portable\ > NUL -xcopy ..\..\..\bin\ffms2_64.dll aegisub-portable\ > NUL -xcopy ..\src\ASSDraw3.chm aegisub-portable\ > NUL -xcopy ..\src\ASSDraw3.exe aegisub-portable\ > NUL -xcopy ..\src\dictionaries\en_US.aff aegisub-portable\dictionaries\ > NUL -xcopy ..\src\dictionaries\en_US.dic aegisub-portable\dictionaries\ > NUL -xcopy ..\src\vsfilter-aegisub64.dll aegisub-portable\csri\ > NUL -xcopy ..\src\x64\Microsoft.VC90.CRT\* aegisub-portable\Microsoft.VC90.CRT\ > NUL -xcopy config.json aegisub-portable\ > NUL - -echo Creating SFX -del ..\output\aegisub-3.1.0-portable-64.exe -WinRAR a -sfx -s -m5 -ep1 -r -zportable-comment.txt -iimgside-logo.bmp -iiconicon.ico ..\output\aegisub-3.1.0-portable-64.exe aegisub-portable\ - -echo Removing temp dir -rmdir /S /Q aegisub-portable > NUL diff --git a/packages/win_installer/portable/create-portable.ps1 b/packages/win_installer/portable/create-portable.ps1 new file mode 100644 index 000000000..0b121254f --- /dev/null +++ b/packages/win_installer/portable/create-portable.ps1 @@ -0,0 +1,86 @@ +#!/usr/bin/env powershell + +param ( + [Parameter(Position = 0)] + [string]$BuildRoot, + [Parameter(Position = 1)] + [string]$SourceRoot +) + +function Copy-New-Item { + $SourceFilePath = $args[0] + $DestinationFilePath = $args[1] + + If (-not (Test-Path $DestinationFilePath)) { + New-Item -ItemType Directory -Path $DestinationFilePath -Force + } + Copy-Item -Path $SourceFilePath -Destination $DestinationFilePath +} + +function Copy-New-Items { + $SourceFilePath = $args[0] + $DestinationFilePath = $args[1] + + If (-not (Test-Path $DestinationFilePath)) { + New-Item -ItemType Directory -Path $DestinationFilePath -Force + } + Copy-Item -Path $SourceFilePath -Destination $DestinationFilePath -Recurse +} + + +Write-Output BUILD_ROOT=$BuildRoot +Write-Output SOURCE_ROOT=$SourceRoot +$InstallerDir = Join-Path $BuildRoot "install" +$InstallerDepsDir = Join-Path $BuildRoot "installer-deps" +$PortableOutputDir = Join-Path $BuildRoot "aegisub-portable" + + +Write-Output Goto building dir +Set-Location $BuildRoot + + +Write-Output 'Removing old temp dir' +Remove-Item -LiteralPath "$PortableOutputDir" -Force -Recurse +Remove-Item -LiteralPath "install" -Force -Recurse + + +Write-Output 'Make install' +meson install --no-rebuild --destdir $InstallerDir +Write-Output 'Gathering files' +Copy-New-Item $InstallerDir\bin\aegisub.exe $PortableOutputDir + +Write-Output 'Copying - translations' +Copy-New-Items "$InstallerDir\share\locale\*" "$PortableOutputDir\locale" -Recurse +Write-Output 'Copying - codecs' +Write-Output 'Copying - codecs\Avisynth' +Copy-New-Item $InstallerDepsDir\AvisynthPlus64\x86-64\DevIL.dll $PortableOutputDir +Copy-New-Item $InstallerDepsDir\AvisynthPlus64\x86-64\AviSynth.dll $PortableOutputDir +Copy-New-Item $InstallerDepsDir\AvisynthPlus64\x86-64\plugins\DirectShowSource.dll $PortableOutputDir +Write-Output 'Copying - codecs\VSFilter' +Copy-New-Item $InstallerDepsDir\VSFilter\x64\VSFilter.dll $PortableOutputDir\csri +Write-Output 'Copying - runtimes\MS-CRT' +Copy-New-Item $InstallerDepsDir\VC_redist\VC_redist.x64.exe $PortableOutputDir\Microsoft.CRT + +Write-Output 'Copying - automation' +Copy-New-Items "$InstallerDir\share\aegisub\automation\*" "$PortableOutputDir\automation\" -Recurse +Write-Output 'Copying - automation\DEPCTRL' +Copy-New-Items "$InstallerDepsDir\DependencyControl\modules\*" "$PortableOutputDir\automation\include\l0\" -Recurse +Copy-New-Items "$InstallerDepsDir\DependencyControl\macros\*" "$PortableOutputDir\automation\autoload\" -Recurse +Copy-New-Item $InstallerDepsDir\Yutils\src\Yutils.lua $PortableOutputDir\automation\include +Copy-New-Items "$InstallerDepsDir\luajson\lua\*" "$PortableOutputDir\automation\include\" -Recurse + +Copy-New-Item $InstallerDepsDir\ffi-experiments\build\requireffi\requireffi.lua $PortableOutputDir\automation\include\requireffi +Copy-New-Item $InstallerDepsDir\ffi-experiments\build\bad-mutex\BadMutex.dll $PortableOutputDir\automation\include\BM\BadMutex +Copy-New-Item $InstallerDepsDir\ffi-experiments\build\bad-mutex\BadMutex.lua $PortableOutputDir\automation\include\BM +Copy-New-Item $InstallerDepsDir\ffi-experiments\build\precise-timer\PreciseTimer.dll $PortableOutputDir\automation\include\PT\PreciseTimer +Copy-New-Item $InstallerDepsDir\ffi-experiments\build\precise-timer\PreciseTimer.lua $PortableOutputDir\automation\include\PT +Copy-New-Item $InstallerDepsDir\ffi-experiments\build\download-manager\DownloadManager.dll $PortableOutputDir\automation\include\DM\DownloadManager +Copy-New-Item $InstallerDepsDir\ffi-experiments\build\download-manager\DownloadManager.lua $PortableOutputDir\automation\include\DM + +Write-Output 'Copying - portable-config' +Copy-New-Item $SourceRoot\packages\win_installer\portable\config.json $PortableOutputDir + + +Write-Output 'Creating portable zip' +Remove-Item aegisub-portable-64.zip +7z a aegisub-portable-64.zip aegisub-portable\ From 3c17671ad071dcea73c5ffb0f1159ebaf7bf16e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vard=C3=AB?= Date: Sun, 23 May 2021 10:54:46 +0200 Subject: [PATCH 262/271] Updates French translation (#121) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Updates French translation * Missing spelling mistake * Additional adjustments * Improvements (#1) Co-authored-by: Vardë Co-authored-by: anne-o-pixel <81879599+anne-o-pixel@users.noreply.github.com> --- po/fr_FR.po | 2941 ++++++++++++--------------------------------------- 1 file changed, 697 insertions(+), 2244 deletions(-) diff --git a/po/fr_FR.po b/po/fr_FR.po index 2634544f4..6ad75d8fa 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -4,7 +4,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-08-24 16:41+0200\n" "PO-Revision-Date: \n" -"Last-Translator: Cirrus Wazza \n" +"Last-Translator: Ichunjo\n" "Language-Team: Céréales Killer \n" "Language: fr_FR\n" "MIME-Version: 1.0\n" @@ -12,7 +12,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-Bookmarks: -1,596,-1,-1,-1,-1,-1,-1,-1,-1\n" -"X-Generator: Poedit 1.8.4\n" +"X-Generator: Poedit 2.4.3\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../src/dialog_shift_times.cpp:92 @@ -55,7 +55,7 @@ msgstr "depuis %d vers" #: ../src/dialog_shift_times.cpp:115 msgid "sel " -msgstr "sél." +msgstr "sél. " #: ../src/dialog_shift_times.cpp:133 ../src/command/time.cpp:153 msgid "Shift Times" @@ -63,7 +63,7 @@ msgstr "Décalage temps" #: ../src/dialog_shift_times.cpp:142 msgid "&Time: " -msgstr "&Temps :" +msgstr "&Temps : " #: ../src/dialog_shift_times.cpp:143 msgid "Shift by time" @@ -71,7 +71,7 @@ msgstr "Décalage temporel" #: ../src/dialog_shift_times.cpp:146 msgid "&Frames: " -msgstr "&Images :" +msgstr "&Images : " #: ../src/dialog_shift_times.cpp:147 msgid "Shift by frames" @@ -90,24 +90,19 @@ msgid "For&ward" msgstr "En a&vant" #: ../src/dialog_shift_times.cpp:157 -msgid "" -"Shifts subs forward, making them appear later. Use if they are appearing too " -"soon." +msgid "Shifts subs forward, making them appear later. Use if they are appearing too soon." msgstr "" -"Sous-titres décalés vers l'avant, apparition plus tardive. À utiliser s'ils " -"arrivent trop tôt." +"Sous-titres décalés vers l'avant, apparition plus tardive. À utiliser s'ils arrivent trop " +"tôt." #: ../src/dialog_shift_times.cpp:159 msgid "&Backward" msgstr "En a&rrière" #: ../src/dialog_shift_times.cpp:160 -msgid "" -"Shifts subs backward, making them appear earlier. Use if they are appearing " -"too late." +msgid "Shifts subs backward, making them appear earlier. Use if they are appearing too late." msgstr "" -"Sous-titres décalés vers l'arrière, appartion plus tôt. À utiliser s'ils " -"arrivent trop tard." +"Sous-titres décalés vers l'arrière, appartion plus tôt. À utiliser s'ils arrivent trop tard." #: ../src/dialog_shift_times.cpp:162 msgid "&All rows" @@ -162,12 +157,8 @@ msgid "Fix Styles" msgstr "Réparation de styles" #: ../src/export_fixstyle.cpp:46 -msgid "" -"Fixes styles by replacing any style that isn't available on file with " -"Default." -msgstr "" -"Répare les styles en remplaçant tout style absent dans le fichier par " -"Default." +msgid "Fixes styles by replacing any style that isn't available on file with Default." +msgstr "Répare les styles en remplaçant tout style absent dans le fichier par Default." #: ../src/audio_karaoke.cpp:72 msgid "Discard all uncommitted splits" @@ -220,21 +211,19 @@ msgstr "" msgid "The file was not recognised as an Automation script: %s" msgstr "Le fichier n'a pas été reconnu comme un script d'automatisme : %s" -#: ../src/auto4_base.cpp:496 ../src/command/timecode.cpp:74 -#: ../src/command/timecode.cpp:94 ../src/command/video.cpp:568 -#: ../src/command/audio.cpp:84 ../src/command/keyframe.cpp:74 +#: ../src/auto4_base.cpp:496 ../src/command/timecode.cpp:74 ../src/command/timecode.cpp:94 +#: ../src/command/video.cpp:568 ../src/command/audio.cpp:84 ../src/command/keyframe.cpp:74 msgid "All Files" -msgstr "Tous fichiers" +msgstr "Tous les fichiers" -#: ../src/auto4_base.cpp:502 ../src/command/timecode.cpp:74 -#: ../src/command/timecode.cpp:94 ../src/command/keyframe.cpp:74 -#: ../src/subtitle_format.cpp:312 +#: ../src/auto4_base.cpp:502 ../src/command/timecode.cpp:74 ../src/command/timecode.cpp:94 +#: ../src/command/keyframe.cpp:74 ../src/subtitle_format.cpp:312 msgid "All Supported Formats" -msgstr "Tout format supporté" +msgstr "Tous les formats supportés" #: ../src/auto4_base.cpp:508 msgid "File was not recognized as a script" -msgstr "Le fichier n'a pas été reconnu comme un script" +msgstr "Le fichier n'a pas été reconnu en tant que script" #: ../src/search_replace_engine.cpp:247 ../src/search_replace_engine.cpp:331 msgid "replace" @@ -244,8 +233,8 @@ msgstr "remplacer" #, c-format msgid "One match was replaced." msgid_plural "%d matches were replaced." -msgstr[0] "Une correspondance a été remplacé." -msgstr[1] "%d correspondances ont été remplacés" +msgstr[0] "Une correspondance a été remplacée." +msgstr[1] "%d correspondances ont été remplacées." #: ../src/search_replace_engine.cpp:335 msgid "No matches found." @@ -282,11 +271,11 @@ msgstr "FPS :" #: ../src/dialog_video_details.cpp:60 msgid "Resolution:" -msgstr "Résolution :" +msgstr "Définition vidéo :" #: ../src/dialog_video_details.cpp:61 msgid "Length:" -msgstr "Longueur :" +msgstr "Durée :" #: ../src/dialog_video_details.cpp:61 #, c-format @@ -299,8 +288,7 @@ msgstr[1] "%d images (%s)" msgid "Decoder:" msgstr "Décodeur :" -#: ../src/dialog_video_details.cpp:65 ../src/preferences.cpp:165 -#: ../src/preferences.cpp:417 +#: ../src/dialog_video_details.cpp:65 ../src/preferences.cpp:165 ../src/preferences.cpp:417 msgid "Video" msgstr "Vidéo" @@ -314,8 +302,7 @@ msgstr "Appliquer aux styles" #: ../src/dialog_timing_processor.cpp:159 msgid "Select styles to process. Unchecked ones will be ignored." -msgstr "" -"Choix des style à appliquer. Ceux qui ne sont pas cochés seront ignorés." +msgstr "Choix des styles à appliquer. Ceux non-cochés seront ignorés." #: ../src/dialog_timing_processor.cpp:161 ../src/dialog_paste_over.cpp:88 msgid "&All" @@ -331,11 +318,10 @@ msgstr "Aucu&n" #: ../src/dialog_timing_processor.cpp:165 msgid "Deselect all styles" -msgstr "Écarter tous les styles." +msgstr "Désélectionner tous les styles" #: ../src/dialog_timing_processor.cpp:168 ../src/command/app.cpp:207 -#: ../src/dialog_properties.cpp:138 ../src/preferences.cpp:127 -#: ../src/preferences.cpp:167 +#: ../src/dialog_properties.cpp:138 ../src/preferences.cpp:127 ../src/preferences.cpp:167 msgid "Options" msgstr "Options" @@ -381,23 +367,20 @@ msgstr "Activ&er" #: ../src/dialog_timing_processor.cpp:192 msgid "" -"Enable snapping of subtitles together if they are within a certain distance " -"of each other" -msgstr "" -"Activer l'assemblage des sous-titres s'ils sont à moins d'une certaine " -"distance" +"Enable snapping of subtitles together if they are within a certain distance of each other" +msgstr "Activer le collage des sous-titres s'ils sont à moins d'une certaine distance" #: ../src/dialog_timing_processor.cpp:195 msgid "Max gap:" -msgstr "Escapement maxi :" +msgstr "Écart maxi :" #: ../src/dialog_timing_processor.cpp:196 msgid "" -"Maximum difference between start and end time for two subtitles to be made " -"continuous, in milliseconds" +"Maximum difference between start and end time for two subtitles to be made continuous, in " +"milliseconds" msgstr "" -"Différence maximale entre le début et la fin pour rendre deux sous-titres " -"continus, en millisecondes" +"Différence maximale entre le début et la fin pour rendre deux sous-titres continus, en " +"millisecondes" #: ../src/dialog_timing_processor.cpp:197 msgid "Max overlap:" @@ -405,25 +388,25 @@ msgstr "Recouvrement maxi :" #: ../src/dialog_timing_processor.cpp:198 msgid "" -"Maximum overlap between the end and start time for two subtitles to be made " -"continuous, in milliseconds" +"Maximum overlap between the end and start time for two subtitles to be made continuous, in " +"milliseconds" msgstr "" -"Recouvrement maximal entre le début et la fin pour rendre deux sous-titres " -"continus, en millisecondes" +"Recouvrement maximal entre le début et la fin pour rendre deux sous-titres continus, en " +"millisecondes" #: ../src/dialog_timing_processor.cpp:201 msgid "" -"Sets how to set the adjoining of lines. If set totally to left, it will " -"extend or shrink start time of the second line; if totally to right, it will " -"extend or shrink the end time of the first line." +"Sets how to set the adjoining of lines. If set totally to left, it will extend or shrink " +"start time of the second line; if totally to right, it will extend or shrink the end time of " +"the first line." msgstr "" -"Règle la façon de joindre des lignes. Si on règle tout à gauche, cela " -"étendra ou réduira le temps de départ de la deuxième ligne ; tout à droite, " -"cela étendra ou réduira le temps de fin de la première ligne." +"Gère la façon de joindre des lignes. Si réglé tout à gauche, cela étendra ou réduira le " +"temps de départ de la deuxième ligne ; tout à droite, cela étendra ou réduira le temps de " +"fin de la première ligne." #: ../src/dialog_timing_processor.cpp:204 msgid "Bias: Start <- " -msgstr "Biais : Début <-" +msgstr "Biais : Début <- " #: ../src/dialog_timing_processor.cpp:206 msgid " -> End" @@ -438,12 +421,10 @@ msgid "E&nable" msgstr "Activer" #: ../src/dialog_timing_processor.cpp:218 -msgid "" -"Enable snapping of subtitles to nearest keyframe, if distance is within " -"threshold" +msgid "Enable snapping of subtitles to nearest keyframe, if distance is within threshold" msgstr "" -"Permet le collage des sous-titres sur l'image clé la plus proche, si le " -"seuil n'est pas dépassé" +"Permet le collage des sous-titres sur l'image clé la plus proche, si le seuil n'est pas " +"dépassé" #: ../src/dialog_timing_processor.cpp:229 msgid "Starts before thres.:" @@ -451,11 +432,11 @@ msgstr "Démarre avant seuil :" #: ../src/dialog_timing_processor.cpp:230 msgid "" -"Threshold for 'before start' distance, that is, how many milliseconds a " -"subtitle must start before a keyframe to snap to it" +"Threshold for 'before start' distance, that is, how many milliseconds a subtitle must start " +"before a keyframe to snap to it" msgstr "" -"Seuil de distance « avant début » définissant combien de millisecondes un " -"sous-titre doit démarrer avant l'image clé pour s'y coller" +"Seuil de distance « avant début » définissant combien de millisecondes un sous-titre doit " +"démarrer avant l'image clé pour s'y coller" #: ../src/dialog_timing_processor.cpp:232 msgid "Starts after thres.:" @@ -463,11 +444,11 @@ msgstr "Démarre après seuil :" #: ../src/dialog_timing_processor.cpp:233 msgid "" -"Threshold for 'after start' distance, that is, how many milliseconds a " -"subtitle must start after a keyframe to snap to it" +"Threshold for 'after start' distance, that is, how many milliseconds a subtitle must start " +"after a keyframe to snap to it" msgstr "" -"Seuil de distance « après début » définissant combien de millisecondes un " -"sous-titre doit démarrer après l'image clé pour s'y coller" +"Seuil de distance « après début » définissant combien de millisecondes un sous-titre doit " +"démarrer après l'image clé pour s'y coller" #: ../src/dialog_timing_processor.cpp:237 msgid "Ends before thres.:" @@ -475,11 +456,11 @@ msgstr "Finit avant seuil :" #: ../src/dialog_timing_processor.cpp:238 msgid "" -"Threshold for 'before end' distance, that is, how many milliseconds a " -"subtitle must end before a keyframe to snap to it" +"Threshold for 'before end' distance, that is, how many milliseconds a subtitle must end " +"before a keyframe to snap to it" msgstr "" -"Seuil de distance « avant fin » définissant combien de millisecondes un sous-" -"titre doit finir avant l'image clé pour s'y coller" +"Seuil de distance « avant fin » définissant combien de millisecondes un sous-titre doit " +"finir avant l'image clé pour s'y coller" #: ../src/dialog_timing_processor.cpp:240 msgid "Ends after thres.:" @@ -487,11 +468,11 @@ msgstr "Finit après seuil :" #: ../src/dialog_timing_processor.cpp:241 msgid "" -"Threshold for 'after end' distance, that is, how many milliseconds a " -"subtitle must end after a keyframe to snap to it" +"Threshold for 'after end' distance, that is, how many milliseconds a subtitle must end after " +"a keyframe to snap to it" msgstr "" -"Seuil de distance « après fin » définissant combien de millisecondes un sous-" -"titre doit finir après l'image clé pour s'y coller" +"Seuil de distance « après fin » définissant combien de millisecondes un sous-titre doit " +"finir après l'image clé pour s'y coller" #: ../src/dialog_timing_processor.cpp:349 #, c-format @@ -526,8 +507,7 @@ msgstr "Lecture des sous-titres d'un fichier Matroska." msgid "Styling Assistant" msgstr "Assistant de styles" -#: ../src/dialog_styling_assistant.cpp:65 -#: ../src/dialog_styling_assistant.cpp:66 +#: ../src/dialog_styling_assistant.cpp:65 ../src/dialog_styling_assistant.cpp:66 msgid "Current line" msgstr "Ligne active" @@ -537,7 +517,7 @@ msgstr "Styles disponibles" #: ../src/dialog_styling_assistant.cpp:80 msgid "Set style" -msgstr "Régler le style" +msgstr "Régler le style" #: ../src/dialog_styling_assistant.cpp:87 ../src/dialog_translation.cpp:108 msgid "Keys" @@ -546,7 +526,7 @@ msgstr "Touches" #: ../src/dialog_styling_assistant.cpp:90 ../src/command/tool.cpp:142 #: ../src/command/tool.cpp:226 ../src/dialog_translation.cpp:111 msgid "Accept changes" -msgstr "Valide les modifications" +msgstr "Valider les modifications" #: ../src/dialog_styling_assistant.cpp:91 ../src/command/tool.cpp:153 #: ../src/command/tool.cpp:237 ../src/dialog_translation.cpp:112 @@ -607,11 +587,11 @@ msgstr "Aller à" #: ../src/dialog_jumpto.cpp:72 msgid "Frame: " -msgstr "Image :" +msgstr "Image : " #: ../src/dialog_jumpto.cpp:73 msgid "Time: " -msgstr "Temps :" +msgstr "Temps : " #: ../src/dialog_style_manager.cpp:188 msgid "Move style up" @@ -623,11 +603,11 @@ msgstr "Descendre le style" #: ../src/dialog_style_manager.cpp:190 msgid "Move style to top" -msgstr "Mettre le style en tête" +msgstr "Mettre le style en haut" #: ../src/dialog_style_manager.cpp:191 msgid "Move style to bottom" -msgstr "Mettre le style en pied" +msgstr "Mettre le style en bas" #: ../src/dialog_style_manager.cpp:192 msgid "Sort styles alphabetically" @@ -639,7 +619,7 @@ msgstr "&Nouveau" #: ../src/dialog_style_manager.cpp:203 ../src/preferences.cpp:579 msgid "&Edit" -msgstr "&Édition" +msgstr "&Modifier" #: ../src/dialog_style_manager.cpp:205 ../src/preferences.cpp:580 #: ../src/dialog_attachments.cpp:79 @@ -673,7 +653,7 @@ msgstr "Gestionnaire de styles" #: ../src/dialog_style_manager.cpp:273 msgid "Catalog of available storages" -msgstr "Catalogue des stocks disponibles" +msgstr "Catalogue des stockages disponibles" #: ../src/dialog_style_manager.cpp:275 msgid "New" @@ -697,7 +677,7 @@ msgstr "&Importer depuis un script..." #: ../src/dialog_style_manager.cpp:296 msgid "<- Copy to &storage" -msgstr "<- Copier dan&s la banque" +msgstr "<- Copier dan&s le stockage" #: ../src/dialog_style_manager.cpp:307 msgid "Current script" @@ -709,30 +689,31 @@ msgstr "Fermer" #: ../src/dialog_style_manager.cpp:454 msgid "New storage name:" -msgstr "Nouveau nom de stock :" +msgstr "Nouveau nom de stockage :" #: ../src/dialog_style_manager.cpp:454 msgid "New catalog entry" -msgstr "Nouvelle entrée catalogue" +msgstr "Nouvelle entrée de stockage" #: ../src/dialog_style_manager.cpp:469 msgid "A catalog with that name already exists." -msgstr "Un catalogue avec ce nom existe déjà." +msgstr "Un stockage avec ce nom existe déjà." #: ../src/dialog_style_manager.cpp:469 msgid "Catalog name conflict" -msgstr "Conflit de nom de catalogue" +msgstr "Conflit de nom de stockage" #: ../src/dialog_style_manager.cpp:476 #, c-format msgid "" -"The specified catalog name contains one or more illegal characters. They " -"have been replaced with underscores instead.\n" +"The specified catalog name contains one or more illegal characters. They have been replaced " +"with underscores instead.\n" "The catalog has been renamed to \"%s\"." msgstr "" -"Le nom de catalogue spécifié contient au moins un caractère interdit. Ils " -"ont été remplacés par des soulignés.\n" -"Le catalogue a été renommé en « %s »." + +"Le nom de stockage spécifié contient au moins un caractère interdit. Ils ont été remplacés " +"par des tirets bas.\n" +"Le stockage a été renommé en « %s »." #: ../src/dialog_style_manager.cpp:477 msgid "Invalid characters" @@ -741,19 +722,16 @@ msgstr "Caractères interdits" #: ../src/dialog_style_manager.cpp:490 #, c-format msgid "Are you sure you want to delete the storage \"%s\" from the catalog?" -msgstr "Êtes-vous sûr de vouloir supprimer le stock « %s » du catalogue ?" +msgstr "Êtes-vous sûr de vouloir supprimer le stockage « %s » du catalogue ?" #: ../src/dialog_style_manager.cpp:491 msgid "Confirm delete" -msgstr "Suppression confirmée" +msgstr "Confirmer la suppression" #: ../src/dialog_style_manager.cpp:509 #, c-format -msgid "" -"There is already a style with the name \"%s\" in the current storage. " -"Overwrite?" -msgstr "" -"Il existe déjà un style nommé « %s » dans la banque courante. Le remplacer ?" +msgid "There is already a style with the name \"%s\" in the current storage. Overwrite?" +msgstr "Il existe déjà un style « %s » dans le stockage courant. Le remplacer ?" #: ../src/dialog_style_manager.cpp:509 ../src/dialog_style_manager.cpp:536 #: ../src/dialog_style_manager.cpp:714 @@ -762,11 +740,8 @@ msgstr "Conflit de nom de style" #: ../src/dialog_style_manager.cpp:536 ../src/dialog_style_manager.cpp:713 #, c-format -msgid "" -"There is already a style with the name \"%s\" in the current script. " -"Overwrite?" -msgstr "" -"Il existe déjà un style nommé « %s » dans le script actif. Le remplacer ?" +msgid "There is already a style with the name \"%s\" in the current script. Overwrite?" +msgstr "Il existe déjà un style « %s » dans le script actif. Le remplacer ?" #: ../src/dialog_style_manager.cpp:547 msgid "style copy" @@ -778,11 +753,11 @@ msgstr "collage de style" #: ../src/dialog_style_manager.cpp:620 msgid "Confirm delete from storage" -msgstr "Suppression du stock confirmée" +msgstr "Confirmer suppression du stockage" #: ../src/dialog_style_manager.cpp:659 msgid "Confirm delete from current" -msgstr "Suppression de l'actif confirmée" +msgstr "Confirmer suppression de l'actif" #: ../src/dialog_style_manager.cpp:663 msgid "style delete" @@ -795,7 +770,7 @@ msgstr "Ouvrir un fichier sous-titres" #: ../src/dialog_style_manager.cpp:698 msgid "The selected file has no available styles." -msgstr "Le fichier choisi n'a pas de style valide." +msgstr "Le fichier sélectionné n'a pas de style valide." #: ../src/dialog_style_manager.cpp:698 msgid "Error Importing Styles" @@ -815,7 +790,7 @@ msgstr "importation de styles" #: ../src/dialog_style_manager.cpp:839 msgid "Are you sure? This cannot be undone!" -msgstr "Êtes-vous sur ? Cet action ne peut être annulée !" +msgstr "Êtes-vous sûr ? Cette action ne peut être annulée !" #: ../src/dialog_style_manager.cpp:839 msgid "Sort styles" @@ -864,15 +839,15 @@ msgstr "« %s » n'est pas un nom de commande valide" #: ../src/command/video.cpp:84 msgid "&Cinematic (2.35)" -msgstr "&Cinématique (2.35)" +msgstr "&cinématographique (2.35)" #: ../src/command/video.cpp:85 msgid "Cinematic (2.35)" -msgstr "Cinématique (2.35)" +msgstr "Cinématographique (2.35)" #: ../src/command/video.cpp:86 msgid "Force video to 2.35 aspect ratio" -msgstr "Forcer la vidéo aux proportions 2.35" +msgstr "Forcer la vidéo au rapport de forme 2.35" #: ../src/command/video.cpp:102 msgid "C&ustom..." @@ -884,7 +859,7 @@ msgstr "Personnalisation" #: ../src/command/video.cpp:104 msgid "Force video to a custom aspect ratio" -msgstr "Forcer la vidéo à un format d'image personnalisé" +msgstr "Forcer la vidéo à un rapport de forme personnalisé" #: ../src/command/video.cpp:115 msgid "" @@ -893,22 +868,22 @@ msgid "" " fractional (e.g. 16:9)\n" " specific resolution (e.g. 853x480)" msgstr "" -"Saisir les proportions soit :\n" +"Saisir le rapport de forme soit :\n" " en décimale (ex. 2.35)\n" " en fraction (ex. 16:9)\n" -" en résolution spécifique (ex. 853x480)" +" en définition d'image spécifique (ex. 853x480)" #: ../src/command/video.cpp:116 msgid "Enter aspect ratio" -msgstr "Saisir les proportions" +msgstr "Saisir le rapport de forme" #: ../src/command/video.cpp:135 msgid "Invalid value! Aspect ratio must be between 0.5 and 5.0." -msgstr "Valeur incorrecte ! Les proportions doivent être entre 0.5 et 5.0." +msgstr "Valeur incorrecte ! Le rapport de forme doit être compris entre 0.5 et 5.0." #: ../src/command/video.cpp:135 msgid "Invalid Aspect Ratio" -msgstr "Proportions invalides" +msgstr "Rapport de forme invalide" #: ../src/command/video.cpp:145 msgid "&Default" @@ -920,7 +895,7 @@ msgstr "Défaut" #: ../src/command/video.cpp:147 msgid "Use video's original aspect ratio" -msgstr "Utiliser le format d'origine de la vidéo" +msgstr "Utiliser le rapport de forme d'origine de la vidéo" #: ../src/command/video.cpp:163 msgid "&Fullscreen (4:3)" @@ -932,7 +907,7 @@ msgstr "Plein écran (4:3)" #: ../src/command/video.cpp:165 msgid "Force video to 4:3 aspect ratio" -msgstr "Forcer la vidéo au format 4:3" +msgstr "Forcer la vidéo au rapport de forme 4:3" #: ../src/command/video.cpp:181 msgid "&Widescreen (16:9)" @@ -944,7 +919,7 @@ msgstr "Écran large (16:9)" #: ../src/command/video.cpp:183 msgid "Force video to 16:9 aspect ratio" -msgstr "Forcer la vidéo au format 16:9" +msgstr "Forcer la vidéo au rapport de forme 16:9" #: ../src/command/video.cpp:200 msgid "&Close Video" @@ -963,24 +938,21 @@ msgid "Copy coordinates to Clipboard" msgstr "Copie les coordonnées dans le presse-papier" #: ../src/command/video.cpp:213 -msgid "" -"Copy the current coordinates of the mouse over the video to the clipboard" -msgstr "" -"Copier les coordonnées actuelles de la souris sur la vidéo dans le presse-" -"papier" +msgid "Copy the current coordinates of the mouse over the video to the clipboard" +msgstr "Copier les coordonnées actuelles de la souris sur la vidéo dans le presse-papier" #: ../src/command/video.cpp:222 ../src/command/video.cpp:223 msgid "Cycle active subtitles provider" -msgstr "Cycle de fournisseur de sous-titres actif" +msgstr "Faire défiler les fournisseurs de sous-titres" #: ../src/command/video.cpp:224 msgid "Cycle through the available subtitles providers" -msgstr "À travers les sous-titres Cycle fournisseurs disponibles" +msgstr "Faire défiler les fournisseurs de sous-titres disponibles" #: ../src/command/video.cpp:235 #, c-format msgid "Subtitles provider set to %s" -msgstr "Fournisseur de sous-titres défini à %s" +msgstr "Fournisseur de sous-titres configuré sur %s" #: ../src/command/video.cpp:242 msgid "&Detach Video" @@ -991,12 +963,9 @@ msgid "Detach Video" msgstr "Détacher la vidéo" #: ../src/command/video.cpp:244 -msgid "" -"Detach the video display from the main window, displaying it in a separate " -"Window" +msgid "Detach the video display from the main window, displaying it in a separate Window" msgstr "" -"Détachez l'affichage vidéo à partir de la fenêtre principale, l'afficher " -"dans une fenêtre séparée" +"Détacher l'affichage vidéo de la fenêtre principale et l'afficher dans une fenêtre séparée" #: ../src/command/video.cpp:262 msgid "Show &Video Details" @@ -1012,30 +981,27 @@ msgstr "Afficher les détails vidéo" #: ../src/command/video.cpp:274 ../src/command/video.cpp:275 msgid "Toggle video slider focus" -msgstr "Bascule focus curseur vidéo" +msgstr "Changer cible de saisie curseur vidéo" #: ../src/command/video.cpp:276 -msgid "" -"Toggle focus between the video slider and the previous thing to have focus" +msgid "Toggle focus between the video slider and the previous thing to have focus" msgstr "" -"Basculer le focus entre le curseur de la vidéo et l'élément précédent à " -"avoir le focus" +"Changer la cible de saisie entre le curseur de la vidéo et l'élément précédemment ciblé" #: ../src/command/video.cpp:297 ../src/command/video.cpp:298 msgid "Copy image to Clipboard" -msgstr "Copie l'image dans le presse-papier" +msgstr "Copier l'image dans le presse-papier" #: ../src/command/video.cpp:299 msgid "Copy the currently displayed frame to the clipboard" -msgstr "Copie l'image affichée dans le presse-papier" +msgstr "Copier l'image affichée dans le presse-papier" #: ../src/command/video.cpp:308 ../src/command/video.cpp:309 msgid "Copy image to Clipboard (no subtitles)" -msgstr "Copie l'image dans le presse-papier (sans sous-titres)" +msgstr "Copier l'image dans le presse-papier (sans sous-titres)" #: ../src/command/video.cpp:310 -msgid "" -"Copy the currently displayed frame to the clipboard, without the subtitles" +msgid "Copy the currently displayed frame to the clipboard, without the subtitles" msgstr "Copier l'image affichée dans le presse-papier sans les sous-titres" #: ../src/command/video.cpp:319 ../src/command/video.cpp:320 @@ -1044,15 +1010,15 @@ msgstr "Image suivante" #: ../src/command/video.cpp:321 msgid "Seek to the next frame" -msgstr "Chercher l'image suivante" +msgstr "Aller à l'image suivante" #: ../src/command/video.cpp:330 ../src/command/video.cpp:331 msgid "Next Boundary" -msgstr "Limite suivante" +msgstr "Délimitation suivante" #: ../src/command/video.cpp:332 msgid "Seek to the next beginning or end of a subtitle" -msgstr "Saute au début ou la fin du sous-titre suivant" +msgstr "Aller au début ou la fin du sous-titre suivant" #: ../src/command/video.cpp:359 ../src/command/video.cpp:360 msgid "Next Keyframe" @@ -1060,12 +1026,11 @@ msgstr "Image clé suivante" #: ../src/command/video.cpp:361 msgid "Seek to the next keyframe" -msgstr "Chercher l'image clé suivante" +msgstr "Aller à l'image clé suivante" -#: ../src/command/video.cpp:373 ../src/command/video.cpp:374 -#: ../src/command/video.cpp:375 +#: ../src/command/video.cpp:373 ../src/command/video.cpp:374 ../src/command/video.cpp:375 msgid "Fast jump forward" -msgstr "Saut rapide avant" +msgstr "Saut rapide vers l'avant" #: ../src/command/video.cpp:386 ../src/command/video.cpp:387 msgid "Previous Frame" @@ -1073,15 +1038,15 @@ msgstr "Image précédente" #: ../src/command/video.cpp:388 msgid "Seek to the previous frame" -msgstr "Chercher l'image précédente" +msgstr "Aller à l'image précédente" #: ../src/command/video.cpp:397 ../src/command/video.cpp:398 msgid "Previous Boundary" -msgstr "Limite précédente" +msgstr "Délimitation précédente" #: ../src/command/video.cpp:399 msgid "Seek to the previous beginning or end of a subtitle" -msgstr "Saute au début ou la fin du sous-titre précédent" +msgstr "Aller au début ou la fin du sous-titre précédent" #: ../src/command/video.cpp:426 ../src/command/video.cpp:427 msgid "Previous Keyframe" @@ -1089,34 +1054,31 @@ msgstr "Image clé précédente" #: ../src/command/video.cpp:428 msgid "Seek to the previous keyframe" -msgstr "Chercher l'image clé précédente" +msgstr "Aller à l'image clé précédente" -#: ../src/command/video.cpp:448 ../src/command/video.cpp:449 -#: ../src/command/video.cpp:450 +#: ../src/command/video.cpp:448 ../src/command/video.cpp:449 ../src/command/video.cpp:450 msgid "Fast jump backwards" -msgstr "Saut rapide arrière" +msgstr "Saut rapide en arrière" #: ../src/command/video.cpp:499 ../src/command/video.cpp:500 msgid "Save PNG snapshot" -msgstr "Enregistre une copie d'écran PNG" +msgstr "Enregistrer une capture d'écran PNG" #: ../src/command/video.cpp:501 -msgid "" -"Save the currently displayed frame to a PNG file in the video's directory" -msgstr "" -"Enregistrer l'image affichée en fichier PNG dans le répertoire de la vidéo" +msgid "Save the currently displayed frame to a PNG file in the video's directory" +msgstr "Enregistrer l'image affichée en fichier PNG dans le répertoire de la vidéo" #: ../src/command/video.cpp:510 ../src/command/video.cpp:511 msgid "Save PNG snapshot (no subtitles)" -msgstr "Enregistre une copie d'écran PNG (sans sous-titres)" +msgstr "Enregistrer une capture d'écran PNG (sans sous-titres)" #: ../src/command/video.cpp:512 msgid "" -"Save the currently displayed frame without the subtitles to a PNG file in " -"the video's directory" +"Save the currently displayed frame without the subtitles to a PNG file in the video's " +"directory" msgstr "" -"Enregistrer l'image affichée sans les sous-titres en fichier PNG dans le " -"répertoire de la vidéo" +"Enregistrer l'image affichée sans les sous-titres en fichier PNG dans le répertoire de la " +"vidéo" #: ../src/command/video.cpp:522 msgid "&Jump to..." @@ -1124,7 +1086,7 @@ msgstr "&Aller à..." #: ../src/command/video.cpp:524 msgid "Jump to frame or time" -msgstr "Va à l'image ou au temps" +msgstr "Aller à l'image ou au temps" #: ../src/command/video.cpp:536 msgid "Jump Video to &End" @@ -1184,13 +1146,13 @@ msgstr "Ouvrir un clip vidéo de l'espace réservé avec une couleur unie" #: ../src/command/video.cpp:592 ../src/command/video.cpp:593 msgid "Toggle autoscroll of video" -msgstr "Bascule le mode de défilement de la vidéo" +msgstr "Alterner le mode de défilement de la vidéo" #: ../src/command/video.cpp:594 msgid "Toggle automatically seeking video to the start time of selected lines" msgstr "" -"Bascule automatiquement le signal vidéo de recherche du temps de début de " -"lignes sélectionnées" +"Alterner automatiquement le signal vidéo de recherche du temps de début des lignes " +"sélectionnées" #: ../src/command/video.cpp:609 ../src/command/video.cpp:610 msgid "Play" @@ -1202,10 +1164,9 @@ msgstr "Lire la vidéo depuis cette position" #: ../src/command/video.cpp:621 ../src/command/video.cpp:622 msgid "Play line" -msgstr "Lecture ligne" +msgstr "Lire la ligne" -#: ../src/command/video.cpp:623 ../src/command/audio.cpp:260 -#: ../src/command/audio.cpp:261 +#: ../src/command/video.cpp:623 ../src/command/audio.cpp:260 ../src/command/audio.cpp:261 msgid "Play current line" msgstr "Lire la ligne active" @@ -1219,11 +1180,11 @@ msgstr "Afficher le masque d'overscan" #: ../src/command/video.cpp:634 msgid "" -"Show a mask over the video, indicating areas that might get cropped off by " -"overscan on televisions" +"Show a mask over the video, indicating areas that might get cropped off by overscan on " +"televisions" msgstr "" -"Affiche un masque sur la vidéo indiquant les zones qui seront réduites par " -"l'overscan sur les téléviseurs" +"Afficher un masque sur la vidéo indiquant les zones qui seront coupées par l'overscan sur " +"les téléviseurs" #: ../src/command/video.cpp:650 msgid "&100%" @@ -1235,11 +1196,11 @@ msgstr "100 %" #: ../src/command/video.cpp:652 msgid "Set zoom to 100%" -msgstr "Mettre le zoom à 100 %" +msgstr "Régler le zoom à 100 %" #: ../src/command/video.cpp:669 ../src/command/video.cpp:670 msgid "Stop video" -msgstr "Arrêt vidéo" +msgstr "Arrêter la vidéo" #: ../src/command/video.cpp:671 msgid "Stop video playback" @@ -1255,7 +1216,7 @@ msgstr "200 %" #: ../src/command/video.cpp:683 msgid "Set zoom to 200%" -msgstr "Mettre le zoom à 200 %" +msgstr "Régler le zoom à 200 %" #: ../src/command/video.cpp:699 msgid "&50%" @@ -1267,31 +1228,31 @@ msgstr "50 %" #: ../src/command/video.cpp:701 msgid "Set zoom to 50%" -msgstr "Mettre le zoom à 50 %" +msgstr "Régler le zoom à 50 %" #: ../src/command/video.cpp:717 ../src/command/video.cpp:718 msgid "Zoom In" -msgstr "Zoom avant" +msgstr "Agrandir" #: ../src/command/video.cpp:719 msgid "Zoom video in" -msgstr "Zoom avant vidéo" +msgstr "Agrandir la vidéo" #: ../src/command/video.cpp:729 ../src/command/video.cpp:730 msgid "Zoom Out" -msgstr "Zoom arrière" +msgstr "Rétrécir" #: ../src/command/video.cpp:731 msgid "Zoom video out" -msgstr "Zoom arrière vidéo" +msgstr "Rétrécir la vidéo" #: ../src/command/edit.cpp:131 ../src/command/edit.cpp:831 msgid "paste" -msgstr "colle" +msgstr "coller" #: ../src/command/edit.cpp:369 msgid "set color" -msgstr "réglage couleur" +msgstr "régler couleur" #: ../src/command/edit.cpp:383 msgid "Primary Color..." @@ -1303,8 +1264,7 @@ msgstr "Couleur principale" #: ../src/command/edit.cpp:385 msgid "Set the primary fill color (\\c) at the cursor position" -msgstr "" -"Régler la couleur principale de remplissage (\\c) à la position du curseur" +msgstr "Définir la couleur principale de remplissage (\\c) à la position du curseur" #: ../src/command/edit.cpp:395 msgid "Secondary Color..." @@ -1316,9 +1276,7 @@ msgstr "Couleur secondaire" #: ../src/command/edit.cpp:397 msgid "Set the secondary (karaoke) fill color (\\2c) at the cursor position" -msgstr "" -"Régler la couleur secondaire (karaoké) de remplissage (\\2c) à la position " -"du curseur" +msgstr "Définir la couleur secondaire de remplissage (karaoké) (\\2c) à la position du curseur" #: ../src/command/edit.cpp:407 msgid "Outline Color..." @@ -1330,82 +1288,70 @@ msgstr "Couleur du contour" #: ../src/command/edit.cpp:409 msgid "Set the outline color (\\3c) at the cursor position" -msgstr "Régler la couleur du contour (\\3c) à la position du curseur" +msgstr "Définir la couleur du contour (\\3c) à la position du curseur" #: ../src/command/edit.cpp:419 msgid "Shadow Color..." -msgstr "Couleur de l’ombre..." +msgstr "Couleur de l'ombre..." #: ../src/command/edit.cpp:420 msgid "Shadow Color" -msgstr "Couleur de l’ombre" +msgstr "Couleur de l'ombre" #: ../src/command/edit.cpp:421 msgid "Set the shadow color (\\4c) at the cursor position" -msgstr "Régler la couleur de l'ombre (\\4c) à la position du curseur" +msgstr "Définir la couleur de l'ombre (\\4c) à la position du curseur" #: ../src/command/edit.cpp:431 ../src/command/edit.cpp:432 msgid "Toggle Bold" -msgstr "Passer en Gras" +msgstr "Alterner le gras" #: ../src/command/edit.cpp:433 -msgid "" -"Toggle bold (\\b) for the current selection or at the current cursor position" -msgstr "" -"Passer en gras (\\b) pour la sélection en cours ou à la position actuelle du " -"curseur" +msgid "Toggle bold (\\b) for the current selection or at the current cursor position" +msgstr "Alterner le gras (\\b) pour la sélection en cours ou à la position actuelle du curseur" #: ../src/command/edit.cpp:436 msgid "toggle bold" -msgstr "Passer en gras" +msgstr "alterner le gras" #: ../src/command/edit.cpp:443 ../src/command/edit.cpp:444 msgid "Toggle Italics" -msgstr "Passer en Italique" +msgstr "Alterner l'italique" #: ../src/command/edit.cpp:445 -msgid "" -"Toggle italics (\\i) for the current selection or at the current cursor " -"position" +msgid "Toggle italics (\\i) for the current selection or at the current cursor position" msgstr "" -"Passer en italique (\\i) pour la sélection en cours ou à la position " -"actuelle du curseur" +"Alterner l'italique (\\i) pour la sélection en cours ou à la position actuelle du curseur" #: ../src/command/edit.cpp:448 msgid "toggle italic" -msgstr "Passer en italique" +msgstr "alterner l'italique" #: ../src/command/edit.cpp:455 ../src/command/edit.cpp:456 msgid "Toggle Underline" -msgstr "Passer en Souligné" +msgstr "Alterner le soulignage" #: ../src/command/edit.cpp:457 -msgid "" -"Toggle underline (\\u) for the current selection or at the current cursor " -"position" +msgid "Toggle underline (\\u) for the current selection or at the current cursor position" msgstr "" -"Passer en souligné (\\u) pour la sélection en cours ou à la position " -"actuelle du curseur" +"Alterner le soulignage (\\u) pour la sélection en cours ou à la position actuelle du curseur" #: ../src/command/edit.cpp:460 msgid "toggle underline" -msgstr "Passer en Souligné" +msgstr "alterner le soulignage" #: ../src/command/edit.cpp:467 ../src/command/edit.cpp:468 msgid "Toggle Strikeout" -msgstr "Passer en Barré" +msgstr "Alterner la biffure" #: ../src/command/edit.cpp:469 -msgid "" -"Toggle strikeout (\\s) for the current selection or at the current cursor " -"position" +msgid "Toggle strikeout (\\s) for the current selection or at the current cursor position" msgstr "" -"Passer en barré (\\s) pour la sélection en cours ou à la position actuelle " -"du curseur" +"Alterner la biffure (\\s) pour la sélection en cours ou à la position actuelle du curseur" #: ../src/command/edit.cpp:472 msgid "toggle strikeout" -msgstr "Passer en Barré" +msgstr "alterner la biffure" #: ../src/command/edit.cpp:479 msgid "Font Face..." @@ -1413,15 +1359,15 @@ msgstr "Police personnalisée..." #: ../src/command/edit.cpp:480 ../src/preferences_base.cpp:251 msgid "Font Face" -msgstr "Police personnalisée" +msgstr "Police d'écriture" #: ../src/command/edit.cpp:481 msgid "Select a font face and size" -msgstr "Sélectionnez une police et la taille" +msgstr "Sélectionner police d'écriture et taille" #: ../src/command/edit.cpp:508 msgid "set font" -msgstr "régler la police" +msgstr "définir police d'écriture" #: ../src/command/edit.cpp:535 msgid "Find and R&eplace..." @@ -1433,7 +1379,7 @@ msgstr "Chercher et remplacer" #: ../src/command/edit.cpp:537 msgid "Find and replace words in subtitles" -msgstr "Cherche et remplace des mots dans les sous-titres" +msgstr "Chercher et remplacer des mots dans les sous-titres" #: ../src/command/edit.cpp:598 msgid "&Copy Lines" @@ -1445,71 +1391,71 @@ msgstr "Copier des lignes" #: ../src/command/edit.cpp:600 msgid "Copy subtitles to the clipboard" -msgstr "Copiez les sous-titres dans le presse-papiers" +msgstr "Copier les sous-titres dans le presse-papiers" #: ../src/command/edit.cpp:621 msgid "Cu&t Lines" -msgstr "Co&uper des lignes" +msgstr "Co&uper les lignes" #: ../src/command/edit.cpp:622 msgid "Cut Lines" -msgstr "Couper des lignes" +msgstr "Couper les lignes" #: ../src/command/edit.cpp:623 msgid "Cut subtitles" -msgstr "Couper des sous-titres" +msgstr "Couper les sous-titres" #: ../src/command/edit.cpp:630 msgid "cut lines" -msgstr "Couper des lignes" +msgstr "couper les lignes" #: ../src/command/edit.cpp:638 msgid "De&lete Lines" -msgstr "Supprimer des &lignes" +msgstr "Supprimer les &lignes" #: ../src/command/edit.cpp:639 msgid "Delete Lines" -msgstr "Suppression de lignes" +msgstr "Supprimer les lignes" #: ../src/command/edit.cpp:640 msgid "Delete currently selected lines" -msgstr "Supprime les lignes sélectionnées" +msgstr "Supprimer les lignes sélectionnées" #: ../src/command/edit.cpp:643 msgid "delete lines" -msgstr "Suppression de lignes" +msgstr "supprimer les lignes" #: ../src/command/edit.cpp:708 ../src/command/edit.cpp:1093 msgid "split" -msgstr "divise" +msgstr "diviser" #: ../src/command/edit.cpp:708 msgid "duplicate lines" -msgstr "dupliquer des lignes" +msgstr "dupliquer les lignes" #: ../src/command/edit.cpp:715 msgid "&Duplicate Lines" -msgstr "&Dupliquer des lignes" +msgstr "&Dupliquer les lignes" #: ../src/command/edit.cpp:716 msgid "Duplicate Lines" -msgstr "Dupliquer des lignes" +msgstr "Dupliquer les lignes" #: ../src/command/edit.cpp:717 msgid "Duplicate the selected lines" -msgstr "Duplique les lignes sélectionnées" +msgstr "Dupliquer les lignes sélectionnées" #: ../src/command/edit.cpp:726 ../src/command/edit.cpp:727 msgid "Split lines after current frame" -msgstr "Scinder les lignes après l'image actuelle" +msgstr "Scinder les lignes après l'image en cours" #: ../src/command/edit.cpp:728 msgid "" -"Split the current line into a line which ends on the current frame and a " -"line which starts on the next frame" +"Split the current line into a line which ends on the current frame and a line which starts " +"on the next frame" msgstr "" -"Scinder la ligne en cours en une ligne qui se termine sur l'image actuelle " -"et une ligne qui démarre sur l'image suivante" +"Scinder la ligne en cours en une ligne qui se termine à l'image actuelle et une ligne qui " +"démarre à l'image suivante" #: ../src/command/edit.cpp:738 ../src/command/edit.cpp:739 msgid "Split lines before current frame" @@ -1517,11 +1463,11 @@ msgstr "Scinder les lignes avant l'image actuelle" #: ../src/command/edit.cpp:740 msgid "" -"Split the current line into a line which ends on the previous frame and a " -"line which starts on the current frame" +"Split the current line into a line which ends on the previous frame and a line which starts " +"on the current frame" msgstr "" -"Scinder la ligne en cours en une ligne qui se termine sur l'image précédente " -"et une ligne qui démarre sur l'image actuelle" +"Scinder la ligne en cours en une ligne qui se termine à l'image précédente et une ligne qui " +"démarre à l'image actuelle" #: ../src/command/edit.cpp:775 msgid "As &Karaoke" @@ -1533,29 +1479,27 @@ msgstr "En karaoké" #: ../src/command/edit.cpp:777 msgid "Join selected lines in a single one, as karaoke" -msgstr "Fusionner lignes sélectionnées en une seule, comme le karaoké" +msgstr "Fusionner les lignes sélectionnées en une seule, comme un karaoké" #: ../src/command/edit.cpp:780 msgid "join as karaoke" -msgstr "Joindre en karaoké" +msgstr "joindre en karaoké" #: ../src/command/edit.cpp:786 msgid "&Concatenate" -msgstr "&Chaînage" +msgstr "&Concaténer" #: ../src/command/edit.cpp:787 msgid "Concatenate" -msgstr "Enchaîner" +msgstr "Concaténer" #: ../src/command/edit.cpp:788 msgid "Join selected lines in a single one, concatenating text together" -msgstr "" -"Fusionner les lignes sélectionnées en une seule, concaténation du texte " -"ensemble" +msgstr "Fusionner les lignes sélectionnées en une seule, tout en concaténant le texte" #: ../src/command/edit.cpp:791 ../src/command/edit.cpp:802 msgid "join lines" -msgstr "jonction de lignes" +msgstr "fusionner lignes" #: ../src/command/edit.cpp:797 msgid "Keep &First" @@ -1566,48 +1510,45 @@ msgid "Keep First" msgstr "Garder la première" #: ../src/command/edit.cpp:799 -msgid "" -"Join selected lines in a single one, keeping text of first and discarding " -"remaining" +msgid "Join selected lines in a single one, keeping text of first and discarding remaining" msgstr "" -"Fusionner les lignes sélectionnées en une seule, garder le texte du premier " -"et rejeter le restant" +"Fusionner les lignes sélectionnées en une seule, et ne garder que le texte de la première" #: ../src/command/edit.cpp:840 msgid "&Paste Lines" -msgstr "Coller des lignes" +msgstr "Coller les lignes" #: ../src/command/edit.cpp:841 msgid "Paste Lines" -msgstr "Coller des lignes" +msgstr "Coller les lignes" #: ../src/command/edit.cpp:842 msgid "Paste subtitles" -msgstr "Coller des sous-titres" +msgstr "Coller les sous-titres" #: ../src/command/edit.cpp:871 msgid "Paste Lines &Over..." -msgstr "C&oller des lignes sur..." +msgstr "C&oller les lignes sur..." #: ../src/command/edit.cpp:872 msgid "Paste Lines Over" -msgstr "Coller des lignes sur" +msgstr "Coller les lignes sur" #: ../src/command/edit.cpp:873 msgid "Paste subtitles over others" -msgstr "Coller les sous-titres sur les autres" +msgstr "Coller les sous-titres sur d'autres" #: ../src/command/edit.cpp:956 msgid "Recom&bine Lines" -msgstr "Recom&biner des lignes" +msgstr "Recom&biner les lignes" #: ../src/command/edit.cpp:957 msgid "Recombine Lines" -msgstr "Recombiner des lignes" +msgstr "Recombiner les lignes" #: ../src/command/edit.cpp:958 msgid "Recombine subtitles which have been split and merged" -msgstr "Recombiner les sous-titres qui ont été coupés et fusionnés" +msgstr "Recombiner des sous-titres qui ont été coupés et fusionnés" #: ../src/command/edit.cpp:1028 msgid "combining" @@ -1619,72 +1560,66 @@ msgstr "Couper des lignes (en karaoké)" #: ../src/command/edit.cpp:1036 msgid "Use karaoke timing to split line into multiple smaller lines" -msgstr "" -"Utiliser tempo du karaoke pour couper la ligne en plusieurs petites lignes" +msgstr "Utiliser les temps karaoké pour couper la ligne en plusieurs petites lignes" #: ../src/command/edit.cpp:1070 msgid "splitting" msgstr "division" -#: ../src/command/edit.cpp:1098 ../src/command/edit.cpp:1099 -#: ../src/subs_edit_ctrl.cpp:375 +#: ../src/command/edit.cpp:1098 ../src/command/edit.cpp:1099 ../src/subs_edit_ctrl.cpp:375 msgid "Split at cursor (estimate times)" msgstr "Couper au curseur (durée estimée)" #: ../src/command/edit.cpp:1100 msgid "" -"Split the current line at the cursor, dividing the original line's duration " -"between the new ones" +"Split the current line at the cursor, dividing the original line's duration between the new " +"ones" msgstr "" -"Couper la ligne en cours au niveau du curseur, en divisant la durée de la " -"ligne d'origine entre les nouveaux" +"Couper la ligne en cours au niveau du curseur, en divisant la durée de la ligne d'origine " +"entre les nouveaux" -#: ../src/command/edit.cpp:1114 ../src/command/edit.cpp:1115 -#: ../src/subs_edit_ctrl.cpp:374 +#: ../src/command/edit.cpp:1114 ../src/command/edit.cpp:1115 ../src/subs_edit_ctrl.cpp:374 msgid "Split at cursor (preserve times)" msgstr "Couper au curseur (durée préservée)" #: ../src/command/edit.cpp:1116 -msgid "" -"Split the current line at the cursor, setting both lines to the original " -"line's times" +msgid "Split the current line at the cursor, setting both lines to the original line's times" msgstr "" -"Couper la ligne en cours au niveau du curseur, en plaçant les deux lignes " -"aux temps de la ligne originale" +"Couper la ligne en cours au niveau du curseur, en plaçant les deux lignes aux temps de la " +"ligne originale" #: ../src/command/edit.cpp:1125 ../src/command/edit.cpp:1126 msgid "Split at cursor (at video frame)" -msgstr "Couper au Curseur (à l'image de la vidéo)" +msgstr "Couper au curseur (à l'image de la vidéo)" #: ../src/command/edit.cpp:1127 msgid "" -"Split the current line at the cursor, dividing the line's duration at the " -"current video frame" +"Split the current line at the cursor, dividing the line's duration at the current video frame" msgstr "" -"Couper la ligne en cours au niveau du curseur, en divisant la durée de la " -"ligne à l'image actuelle de la vidéo" +"Couper la ligne en cours au niveau du curseur, en divisant la durée de la ligne à l'image " +"actuelle de la vidéo" #: ../src/command/edit.cpp:1143 msgid "Redo last undone action" -msgstr "Rétablir la dernière action annulée" +msgstr "Restaurer la dernière action annulée" #: ../src/command/edit.cpp:1148 msgid "Nothing to &redo" -msgstr "Rien à &refaire" +msgstr "Rien à &restaurer" #: ../src/command/edit.cpp:1149 #, c-format msgid "&Redo %s" -msgstr "&Rétablir %s" +msgstr "&Restaurer %s" #: ../src/command/edit.cpp:1153 msgid "Nothing to redo" -msgstr "Rien à refaire" +msgstr "Rien à restaurer" #: ../src/command/edit.cpp:1154 #, c-format msgid "Redo %s" -msgstr "Rétablir %s" +msgstr "Restaurer %s" #: ../src/command/edit.cpp:1169 msgid "Undo last action" @@ -1692,7 +1627,7 @@ msgstr "Annuler la dernière action" #: ../src/command/edit.cpp:1174 msgid "Nothing to &undo" -msgstr "Rien à &défaire" +msgstr "Rien à &annuler" #: ../src/command/edit.cpp:1175 #, c-format @@ -1701,7 +1636,7 @@ msgstr "Ann&uler %s" #: ../src/command/edit.cpp:1179 msgid "Nothing to undo" -msgstr "Rien à défaire" +msgstr "Rien à annuler" #: ../src/command/edit.cpp:1180 #, c-format @@ -1714,16 +1649,13 @@ msgstr "Rétablir" #: ../src/command/edit.cpp:1196 msgid "Revert the active line to its initial state (shown in the upper editor)" -msgstr "" -"Rétablir la ligne active à son état initial (montrée dans l'éditeur " -"supérieure)" +msgstr "Restaurer la ligne active à son état initial" #: ../src/command/edit.cpp:1201 msgid "revert line" msgstr "rétablir la ligne" -#: ../src/command/edit.cpp:1207 ../src/command/edit.cpp:1208 -#: ../src/preferences.cpp:389 +#: ../src/command/edit.cpp:1207 ../src/command/edit.cpp:1208 ../src/preferences.cpp:389 msgid "Clear" msgstr "Effacer" @@ -1733,7 +1665,7 @@ msgstr "Effacer le texte de la ligne courante" #: ../src/command/edit.cpp:1214 ../src/command/edit.cpp:1233 msgid "clear line" -msgstr "Effacer la ligne" +msgstr "effacer la ligne" #: ../src/command/edit.cpp:1221 ../src/command/edit.cpp:1222 msgid "Clear Text" @@ -1741,37 +1673,31 @@ msgstr "Effacer le texte" #: ../src/command/edit.cpp:1223 msgid "Clear the current line's text, leaving override tags" -msgstr "" -"Effacez le texte de la ligne courante, en laissant les balises de " -"remplacement" +msgstr "Effacer le texte de la ligne courante, en laissant les balises de remplacement" -#: ../src/command/edit.cpp:1239 ../src/command/edit.cpp:1240 -#: ../src/command/tool.cpp:271 +#: ../src/command/edit.cpp:1239 ../src/command/edit.cpp:1240 ../src/command/tool.cpp:271 msgid "Insert Original" msgstr "Insérer l'original" #: ../src/command/edit.cpp:1241 msgid "Insert the original line text at the cursor" -msgstr "Insérez la ligne de texte original sur le curseur" +msgstr "Insérer la ligne de texte original sur le curseur" #: ../src/command/edit.cpp:1249 msgid "insert original" -msgstr "Insérer l'original" +msgstr "insérer l'original" -#: ../src/command/recent.cpp:43 ../src/command/recent.cpp:44 -#: ../src/command/recent.cpp:45 ../src/command/recent.cpp:46 -#: ../src/command/recent.cpp:47 ../src/command/recent.cpp:51 -#: ../src/command/recent.cpp:52 ../src/command/recent.cpp:62 -#: ../src/command/recent.cpp:63 ../src/command/recent.cpp:73 -#: ../src/command/recent.cpp:74 ../src/command/recent.cpp:85 -#: ../src/command/recent.cpp:86 ../src/command/recent.cpp:96 -#: ../src/command/recent.cpp:97 +#: ../src/command/recent.cpp:43 ../src/command/recent.cpp:44 ../src/command/recent.cpp:45 +#: ../src/command/recent.cpp:46 ../src/command/recent.cpp:47 ../src/command/recent.cpp:51 +#: ../src/command/recent.cpp:52 ../src/command/recent.cpp:62 ../src/command/recent.cpp:63 +#: ../src/command/recent.cpp:73 ../src/command/recent.cpp:74 ../src/command/recent.cpp:85 +#: ../src/command/recent.cpp:86 ../src/command/recent.cpp:96 ../src/command/recent.cpp:97 msgid "Recent" msgstr "Fichiers récents" #: ../src/command/recent.cpp:43 ../src/command/recent.cpp:53 msgid "Open recent audio" -msgstr "Ouvre un fichier audio récent" +msgstr "Ouvrir un fichier audio récent" #: ../src/command/recent.cpp:44 ../src/command/recent.cpp:64 msgid "Open recent keyframes" @@ -1795,15 +1721,15 @@ msgstr "Ouvrir des vidéos récentes" #: ../src/command/subtitle.cpp:78 msgid "A&ttachments..." -msgstr "A&ttachements..." +msgstr "P&ièces jointes..." #: ../src/command/subtitle.cpp:79 msgid "Attachments" -msgstr "Accessoires" +msgstr "Pièces jointes" #: ../src/command/subtitle.cpp:80 msgid "Open the attachment manager dialog" -msgstr "Ouvrir la boîte de dialogue du gestionnaire de fichier" +msgstr "Ouvrir la boîte de dialogue du gestionnaire de pièce jointe" #: ../src/command/subtitle.cpp:91 msgid "&Find..." @@ -1844,7 +1770,7 @@ msgstr "Après ligne active" #: ../src/command/subtitle.cpp:135 msgid "Insert a new line after the current one" -msgstr "Insérez une nouvelle ligne après l'actuelle" +msgstr "Insérer une nouvelle ligne après celle active" #: ../src/command/subtitle.cpp:167 ../src/command/subtitle.cpp:168 msgid "After Current, at Video Time" @@ -1852,7 +1778,7 @@ msgstr "Après l'active, au point de synchronisation" #: ../src/command/subtitle.cpp:169 msgid "Insert a new line after the current one, starting at video time" -msgstr "Insérez une nouvelle ligne après l'actuelle, au début de la vidéo" +msgstr "Insérer une nouvelle ligne après celle active, au début de la vidéo" #: ../src/command/subtitle.cpp:178 msgid "&Before Current" @@ -1864,7 +1790,7 @@ msgstr "Avant ligne active" #: ../src/command/subtitle.cpp:180 msgid "Insert a new line before the current one" -msgstr "Insérez une nouvelle ligne avant la ligne actuelle" +msgstr "Insérer une nouvelle ligne avant la ligne active" #: ../src/command/subtitle.cpp:209 ../src/command/subtitle.cpp:210 msgid "Before Current, at Video Time" @@ -1872,8 +1798,7 @@ msgstr "Avant l'active, au point de synchronisation" #: ../src/command/subtitle.cpp:211 msgid "Insert a new line before the current one, starting at video time" -msgstr "" -"Insérez une nouvelle ligne avant la ligne actuelle, au début de la vidéo" +msgstr "Insérez une nouvelle ligne avant la ligne active, au début de la vidéo" #: ../src/command/subtitle.cpp:221 msgid "&New Subtitles" @@ -1910,8 +1835,7 @@ msgstr "Ouvrir un fichier de sous-titres auto-sauvegardé" #: ../src/command/subtitle.cpp:250 msgid "Open a previous version of a file which was autosaved by Aegisub" msgstr "" -"Ouvrez une version précédente d'un fichier qui a été sauvegardée " -"automatiquement par Aegisub" +"Ouvrir une version précédente d'un fichier qui a été sauvegardée automatiquement par Aegisub" #: ../src/command/subtitle.cpp:263 msgid "Open Subtitles with &Charset..." @@ -1923,8 +1847,7 @@ msgstr "Ouvrir sous-titres avec jeu de caractères" #: ../src/command/subtitle.cpp:265 msgid "Open a subtitles file with a specific file encoding" -msgstr "" -"Ouvrir un fichier de sous-titres avec un encodage de fichier spécifique" +msgstr "Ouvrir un fichier de sous-titres avec un encodage de fichier spécifique" #: ../src/command/subtitle.cpp:273 msgid "Choose charset code:" @@ -1984,7 +1907,7 @@ msgstr "Enregistrer les sous-titres sous" #: ../src/command/subtitle.cpp:352 msgid "Save subtitles with another name" -msgstr "Enregistrer sous-titres avec un autre nom" +msgstr "Enregistrer les sous-titres avec un autre nom" #: ../src/command/subtitle.cpp:361 ../src/dialog_selected_choices.cpp:26 #: ../src/subs_edit_ctrl.cpp:369 ../src/dialog_export.cpp:125 @@ -1997,7 +1920,7 @@ msgstr "Tout sélectionner" #: ../src/command/subtitle.cpp:363 msgid "Select all dialogue lines" -msgstr "Sélectionnez toutes les lignes de dialogue" +msgstr "Sélectionner toutes les lignes de dialogue" #: ../src/command/subtitle.cpp:375 ../src/command/subtitle.cpp:376 msgid "Select Visible" @@ -2005,9 +1928,7 @@ msgstr "Sélection visible" #: ../src/command/subtitle.cpp:377 msgid "Select all dialogue lines that are visible on the current video frame" -msgstr "" -"Sélectionnez toutes les lignes de dialogue qui sont visibles sur l'image " -"vidéo en cours" +msgstr "Sélectionner toutes les lignes de dialogue visibles sur l'image en cours" #: ../src/command/subtitle.cpp:407 msgid "Spell &Checker..." @@ -2015,11 +1936,11 @@ msgstr "&Correcteur orthographique..." #: ../src/command/subtitle.cpp:408 ../src/dialog_spellchecker.cpp:103 msgid "Spell Checker" -msgstr "Vérificateur d'orthographe" +msgstr "Correcteur orthographique" #: ../src/command/subtitle.cpp:409 msgid "Open spell checker" -msgstr "Ouvre le correcteur orthographique" +msgstr "Ouvrir le correcteur orthographique" #: ../src/command/tool.cpp:58 msgid "ASSDraw3..." @@ -2031,7 +1952,7 @@ msgstr "ASSDraw3" #: ../src/command/tool.cpp:60 msgid "Launch the ASSDraw3 tool for vector drawing" -msgstr "Lancez l'outil ASSDraw3 pour le dessin vectoriel" +msgstr "Lancer ASSDraw3 pour le dessin vectoriel" #: ../src/command/tool.cpp:70 msgid "&Export Subtitles..." @@ -2042,24 +1963,22 @@ msgid "Export Subtitles" msgstr "Exporter les sous-titres" #: ../src/command/tool.cpp:72 -msgid "" -"Save a copy of subtitles in a different format or with processing applied to " -"it" +msgid "Save a copy of subtitles in a different format or with processing applied to it" msgstr "" -"Enregistrer une copie de sous-titres dans un format différent ou avec le " -"traitement qui lui est appliqué" +"Enregistrer une copie de sous-titres dans un format différent ou avec un traitement à lui " +"appliquer" #: ../src/command/tool.cpp:83 msgid "&Fonts Collector..." -msgstr "Collecte des &polices..." +msgstr "Collecte des &polices d'écriture..." #: ../src/command/tool.cpp:84 ../src/dialog_fonts_collector.cpp:218 msgid "Fonts Collector" -msgstr "Collecte des polices" +msgstr "Collecte des polices d'écriture" #: ../src/command/tool.cpp:85 msgid "Open fonts collector" -msgstr "Ouvrir le collecteur de polices" +msgstr "Ouvrir le collecteur de polices d'écriture" #: ../src/command/tool.cpp:95 msgid "S&elect Lines..." @@ -2071,7 +1990,7 @@ msgstr "Choix de lignes" #: ../src/command/tool.cpp:97 msgid "Select lines based on defined criteria" -msgstr "Sélectionnez les lignes en fonction de critères définis" +msgstr "Sélectionner des lignes à partir de critères définis" #: ../src/command/tool.cpp:107 msgid "&Resample Resolution..." @@ -2083,11 +2002,10 @@ msgstr "Rééchantillonnage de la résolution" #: ../src/command/tool.cpp:109 msgid "" -"Resample subtitles to maintain their current appearance at a different " -"script resolution" +"Resample subtitles to maintain their current appearance at a different script resolution" msgstr "" -"Rééchantillonner sous-titres pour maintenir leur aspect actuel à une " -"résolution de script différente" +"Rééchantillonner les sous-titres pour maintenir leur aspect actuel à une résolution de " +"script différente" #: ../src/command/tool.cpp:122 msgid "St&yling Assistant..." @@ -2099,11 +2017,11 @@ msgstr "Ouvre l'assistant de style" #: ../src/command/tool.cpp:141 ../src/command/tool.cpp:225 msgid "&Accept changes" -msgstr "V&alide les modifications" +msgstr "V&alider les modifications" #: ../src/command/tool.cpp:143 ../src/command/tool.cpp:227 msgid "Commit changes and move to the next line" -msgstr "Accepter les modifications et passer à la ligne suivante" +msgstr "Valider les modifications et passer à la ligne suivante" #: ../src/command/tool.cpp:152 ../src/command/tool.cpp:236 msgid "&Preview changes" @@ -2111,7 +2029,7 @@ msgstr "A&perçu des modifications" #: ../src/command/tool.cpp:154 ../src/command/tool.cpp:238 msgid "Commit changes and stay on the current line" -msgstr "Accepter les modifications et rester sur la ligne actuelle" +msgstr "Valider les modifications et rester sur la ligne actuelle" #: ../src/command/tool.cpp:164 msgid "&Styles Manager..." @@ -2119,31 +2037,31 @@ msgstr "Gestionnaire de &styles..." #: ../src/command/tool.cpp:166 msgid "Open the styles manager" -msgstr "Ouvrez le gestionnaire de styles" +msgstr "Ouvrir le gestionnaire de styles" #: ../src/command/tool.cpp:176 msgid "&Kanji Timer..." -msgstr "Chrono &kanji..." +msgstr "Minutage &kanji..." #: ../src/command/tool.cpp:177 msgid "Kanji Timer" -msgstr "Chrono kanji" +msgstr "Minutage kanji" #: ../src/command/tool.cpp:178 msgid "Open the Kanji timer copier" -msgstr "Ouvrir le copieur de chrono Kanji" +msgstr "Ouvrir le copieur de minutage Kanji" #: ../src/command/tool.cpp:188 msgid "&Timing Post-Processor..." -msgstr "Postprocesseur &temporel..." +msgstr "Postprocesseur &de synchronisation..." #: ../src/command/tool.cpp:190 msgid "" -"Post-process the subtitle timing to add lead-ins and lead-outs, snap timing " -"to scene changes, etc." +"Post-process the subtitle timing to add lead-ins and lead-outs, snap timing to scene " +"changes, etc." msgstr "" -"Post-traitement de la synchronisation des sous-titres pour ajouter des blanc " -"de fin, de début, synchronisation instantanée aux changements de scène, etc." +"Post-traitement de la synchronisation des sous-titres pour ajouter des blancs de fin, de " +"début, synchronisation instantanée aux changements de scène, etc." #: ../src/command/tool.cpp:200 msgid "&Translation Assistant..." @@ -2155,40 +2073,38 @@ msgstr "Assistant à la traduction" #: ../src/command/tool.cpp:202 msgid "Open translation assistant" -msgstr "Ouvre l'assistant à la traduction" +msgstr "Ouvrir l'assistant à la traduction" #: ../src/command/tool.cpp:210 msgid "There is nothing to translate in the file." -msgstr "Il n'y a rien à traduire dans le fichier" +msgstr "Il n'y a rien à traduire dans le fichier." #: ../src/command/tool.cpp:247 msgid "&Next Line" msgstr "Lig&ne suivante" -#: ../src/command/tool.cpp:248 ../src/command/grid.cpp:51 -#: ../src/command/grid.cpp:52 ../src/command/grid.cpp:63 -#: ../src/command/grid.cpp:64 ../src/command/time.cpp:354 +#: ../src/command/tool.cpp:248 ../src/command/grid.cpp:51 ../src/command/grid.cpp:52 +#: ../src/command/grid.cpp:63 ../src/command/grid.cpp:64 ../src/command/time.cpp:354 #: ../src/command/time.cpp:355 msgid "Next Line" msgstr "Ligne suivante" #: ../src/command/tool.cpp:249 msgid "Move to the next line without committing changes" -msgstr "Aller à la ligne suivante à valider" +msgstr "Aller à la ligne suivante sans valider les changements" #: ../src/command/tool.cpp:258 msgid "&Previous Line" msgstr "Ligne &précédente" -#: ../src/command/tool.cpp:259 ../src/command/grid.cpp:90 -#: ../src/command/grid.cpp:91 ../src/command/time.cpp:366 -#: ../src/command/time.cpp:367 +#: ../src/command/tool.cpp:259 ../src/command/grid.cpp:90 ../src/command/grid.cpp:91 +#: ../src/command/time.cpp:366 ../src/command/time.cpp:367 msgid "Previous Line" msgstr "Ligne &précédente" #: ../src/command/tool.cpp:260 msgid "Move to the previous line without committing changes" -msgstr "Aller à la ligne précédente sans accepter les modifications" +msgstr "Aller à la ligne précédente sans valider les modifications" #: ../src/command/tool.cpp:270 msgid "&Insert Original" @@ -2312,24 +2228,23 @@ msgstr "&Options..." #: ../src/command/app.cpp:208 msgid "Configure Aegisub" -msgstr "Paramétrer Aegisub" +msgstr "Configurer Aegisub" #: ../src/command/app.cpp:222 ../src/command/app.cpp:223 msgid "Toggle global hotkey overrides" -msgstr "Basculer entre les touches de raccourcis globales et modifiées" +msgstr "Alterner entre les touches de raccourcis globales et modifiées" #: ../src/command/app.cpp:224 msgid "Toggle global hotkey overrides (Medusa Mode)" -msgstr "" -"Basculer entre les touches de raccourcis globales et modifiées (Mode Medusa)" +msgstr "Alterner entre les touches de raccourcis globales et modifiées (Mode Medusa)" #: ../src/command/app.cpp:239 msgid "Toggle the main toolbar" -msgstr "Basculer sur la barre d'outils principale" +msgstr "Alterner la barre d'outils principale" #: ../src/command/app.cpp:244 msgid "Hide Toolbar" -msgstr "Masque la barre d'outils" +msgstr "Masquer la barre d'outils" #: ../src/command/app.cpp:245 msgid "Show Toolbar" @@ -2345,7 +2260,7 @@ msgstr "Vérifier les mises à jour" #: ../src/command/app.cpp:262 msgid "Check to see if there is a new version of Aegisub available" -msgstr "Vérifie s'il existe une nouvelle version disponible d'Aegisub" +msgstr "Vérifier s'il existe une nouvelle version disponible d'Aegisub" #: ../src/command/grid.cpp:53 msgid "Move to the next subtitle line" @@ -2371,12 +2286,10 @@ msgstr "Nom de l'acteur" msgid "Sort all subtitles by their actor names" msgstr "Trier tous les sous-titres par leur nom d'acteur" -#: ../src/command/grid.cpp:107 ../src/command/grid.cpp:127 -#: ../src/command/grid.cpp:139 ../src/command/grid.cpp:151 -#: ../src/command/grid.cpp:163 ../src/command/grid.cpp:175 -#: ../src/command/grid.cpp:187 ../src/command/grid.cpp:199 -#: ../src/command/grid.cpp:211 ../src/command/grid.cpp:223 -#: ../src/command/grid.cpp:235 ../src/command/grid.cpp:247 +#: ../src/command/grid.cpp:107 ../src/command/grid.cpp:127 ../src/command/grid.cpp:139 +#: ../src/command/grid.cpp:151 ../src/command/grid.cpp:163 ../src/command/grid.cpp:175 +#: ../src/command/grid.cpp:187 ../src/command/grid.cpp:199 ../src/command/grid.cpp:211 +#: ../src/command/grid.cpp:223 ../src/command/grid.cpp:235 ../src/command/grid.cpp:247 msgid "sort" msgstr "tri" @@ -2384,31 +2297,29 @@ msgstr "tri" msgid "Sort selected subtitles by their actor names" msgstr "Trier les sous-titres sélectionnés par leur nom d'acteur" -#: ../src/command/grid.cpp:133 ../src/command/grid.cpp:145 -#: ../src/dialog_search_replace.cpp:87 +#: ../src/command/grid.cpp:133 ../src/command/grid.cpp:145 ../src/dialog_search_replace.cpp:87 msgid "&Effect" msgstr "&Effet" -#: ../src/command/grid.cpp:134 ../src/command/grid.cpp:146 -#: ../src/dialog_paste_over.cpp:72 ../src/subs_edit_box.cpp:145 -#: ../src/grid_column.cpp:191 ../src/grid_column.cpp:192 +#: ../src/command/grid.cpp:134 ../src/command/grid.cpp:146 ../src/dialog_paste_over.cpp:72 +#: ../src/subs_edit_box.cpp:145 ../src/grid_column.cpp:191 ../src/grid_column.cpp:192 msgid "Effect" msgstr "Effet" #: ../src/command/grid.cpp:135 msgid "Sort all subtitles by their effects" -msgstr "Trier tous les sous-titres par leurs effets" +msgstr "Trier tous les sous-titres par leur effet" #: ../src/command/grid.cpp:147 msgid "Sort selected subtitles by their effects" -msgstr "Trier les sous-titres sélectionnés par leurs effets" +msgstr "Trier les sous-titres sélectionnés par leur effet" #: ../src/command/grid.cpp:157 ../src/command/grid.cpp:169 msgid "&End Time" msgstr "T&emps de fin" -#: ../src/command/grid.cpp:158 ../src/command/grid.cpp:170 -#: ../src/dialog_paste_over.cpp:66 ../src/grid_column.cpp:147 +#: ../src/command/grid.cpp:158 ../src/command/grid.cpp:170 ../src/dialog_paste_over.cpp:66 +#: ../src/grid_column.cpp:147 msgid "End Time" msgstr "Temps fin" @@ -2424,8 +2335,8 @@ msgstr "Trier les sous-titres sélectionnés par leur temps de fin" msgid "&Layer" msgstr "Ca&lque" -#: ../src/command/grid.cpp:182 ../src/command/grid.cpp:194 -#: ../src/dialog_paste_over.cpp:64 ../src/grid_column.cpp:107 +#: ../src/command/grid.cpp:182 ../src/command/grid.cpp:194 ../src/dialog_paste_over.cpp:64 +#: ../src/grid_column.cpp:107 msgid "Layer" msgstr "Calque" @@ -2441,10 +2352,10 @@ msgstr "Trier les sous-titres sélectionnés par leur numéro de calque" msgid "&Start Time" msgstr "Temp&s début" -#: ../src/command/grid.cpp:206 ../src/command/grid.cpp:218 -#: ../src/dialog_paste_over.cpp:65 ../src/grid_column.cpp:129 +#: ../src/command/grid.cpp:206 ../src/command/grid.cpp:218 ../src/dialog_paste_over.cpp:65 +#: ../src/grid_column.cpp:129 msgid "Start Time" -msgstr "Temps départ" +msgstr "Temps début" #: ../src/command/grid.cpp:207 msgid "Sort all subtitles by their start times" @@ -2458,8 +2369,7 @@ msgstr "Trier tous les sous-titres par leur temps de début" msgid "St&yle Name" msgstr "Nom du st&yle" -#: ../src/command/grid.cpp:230 ../src/command/grid.cpp:242 -#: ../src/dialog_style_editor.cpp:177 +#: ../src/command/grid.cpp:230 ../src/command/grid.cpp:242 ../src/dialog_style_editor.cpp:177 msgid "Style Name" msgstr "Nom du style" @@ -2473,11 +2383,11 @@ msgstr "Trier les sous-titres sélectionnés par leur nom de style" #: ../src/command/grid.cpp:254 ../src/command/grid.cpp:255 msgid "Cycle Tag Hiding Mode" -msgstr "Mode balises de cycle cachées" +msgstr "Défiler modes d'affichage balises" #: ../src/command/grid.cpp:256 msgid "Cycle through tag hiding modes" -msgstr "Bascule entre les modes d'affichage des balises" +msgstr "Défiler les modes d'affichage des balises" #: ../src/command/grid.cpp:266 msgid "ASS Override Tag mode set to show full tags." @@ -2505,7 +2415,7 @@ msgstr "Masquer les balises prioritaires dans la grille des sous-titres" #: ../src/command/grid.cpp:294 msgid "Sh&ow Tags" -msgstr "V&oir les étiquettes" +msgstr "A&fficher les balises" #: ../src/command/grid.cpp:295 msgid "Show Tags" @@ -2513,23 +2423,20 @@ msgstr "Afficher les balises" #: ../src/command/grid.cpp:296 msgid "Show full override tags in the subtitle grid" -msgstr "" -"Affichage complet des balises prioritaires sur la grille des sous-titres" +msgstr "Afficher complètement les balises prioritaires sur la grille des sous-titres" #: ../src/command/grid.cpp:310 msgid "S&implify Tags" -msgstr "S&implification des balises" +msgstr "S&implifier les balises" #: ../src/command/grid.cpp:311 msgid "Simplify Tags" -msgstr "Simplification des balises" +msgstr "Simplifier les balises" #: ../src/command/grid.cpp:312 -msgid "" -"Replace override tags in the subtitle grid with a simplified placeholder" +msgid "Replace override tags in the subtitle grid with a simplified placeholder" msgstr "" -"Remplacer les balises prioritaires dans la grille des sous-titres par un " -"repère simplifié" +"Remplacer les balises prioritaires dans la grille des sous-titres par un repère simplifié" #: ../src/command/grid.cpp:348 ../src/command/grid.cpp:349 msgid "Move line up" @@ -2537,11 +2444,11 @@ msgstr "Monter la ligne" #: ../src/command/grid.cpp:350 msgid "Move the selected lines up one row" -msgstr "Monte les lignes sélectionnées d'une rangée" +msgstr "Monter les lignes sélectionnées d'une rangée" #: ../src/command/grid.cpp:359 ../src/command/grid.cpp:376 msgid "move lines" -msgstr "déplace des lignes" +msgstr "déplacer des lignes" #: ../src/command/grid.cpp:365 ../src/command/grid.cpp:366 msgid "Move line down" @@ -2549,7 +2456,7 @@ msgstr "Descendre la ligne" #: ../src/command/grid.cpp:367 msgid "Move the selected lines down one row" -msgstr "Descend les lignes sélectionnées d'une rangée" +msgstr "Descendre les lignes sélectionnées d'une rangée" #: ../src/command/grid.cpp:383 ../src/command/grid.cpp:384 msgid "Swap Lines" @@ -2561,7 +2468,7 @@ msgstr "Permuter les deux lignes sélectionnées" #: ../src/command/grid.cpp:396 msgid "swap lines" -msgstr "inversion de lignes" +msgstr "inverser les lignes" #: ../src/command/automation.cpp:48 msgid "&Reload Automation scripts" @@ -2573,51 +2480,47 @@ msgstr "Recharger les scripts d'automatisme" #: ../src/command/automation.cpp:50 msgid "Reload all Automation scripts and rescan the autoload folder" -msgstr "" -"Recharger tous les scripts d'automatisme et rescruter le dossier de " -"chargement automatique" +msgstr "Recharger tous les scripts d'automatisme et rescanner le dossier autoload" #: ../src/command/automation.cpp:55 msgid "Reloaded all Automation scripts" -msgstr "Recharger tous les scripts d'automatisme" +msgstr "Recharge de tous les scripts d'automatisme" #: ../src/command/automation.cpp:61 msgid "R&eload autoload Automation scripts" -msgstr "R&echarger les scripts d'automatisme autochargés" +msgstr "R&echarger les scripts d'automatisme « autoload »" #: ../src/command/automation.cpp:62 msgid "Reload autoload Automation scripts" -msgstr "Recharger les scripts d'automatisme autochargés" +msgstr "Recharger les scripts d'automatisme « autoload »" #: ../src/command/automation.cpp:63 msgid "Rescan the Automation autoload folder" -msgstr "Rescruter le dossier de chargement des automatismes" +msgstr "Rescanner le dossier des automatismes « autoload »" #: ../src/command/automation.cpp:67 msgid "Reloaded autoload Automation scripts" -msgstr "Recharger les scripts d'automatisme autochargés" +msgstr "Recharge des scripts d'automatisme « autoload »" #: ../src/command/automation.cpp:74 ../src/command/automation.cpp:86 msgid "&Automation..." msgstr "&Automatisme..." -#: ../src/command/automation.cpp:75 ../src/command/automation.cpp:87 -#: ../src/preferences.cpp:314 +#: ../src/command/automation.cpp:75 ../src/command/automation.cpp:87 ../src/preferences.cpp:314 msgid "Automation" msgstr "Automatisme" #: ../src/command/automation.cpp:76 msgid "Open automation manager" -msgstr "Ouvre le gestionnaire d'automatismes" +msgstr "Ouvre le gestionnaire des automatismes" #: ../src/command/automation.cpp:88 msgid "" -"Open automation manager. Ctrl: Rescan autoload folder. Ctrl+Shift: Rescan " -"autoload folder and reload all automation scripts" +"Open automation manager. Ctrl: Rescan autoload folder. Ctrl+Shift: Rescan autoload folder " +"and reload all automation scripts" msgstr "" -"Ouvrir le gestionnaire d'automatisation. Ctrl: Rescanne le dossier auto-" -"chargement. Ctrl+Maj: Rescanne le dossier auto-chargement et recharger tous " -"les scripts d'automatisation" +"Ouvrir le gestionnaire des automatismes. Ctrl: Rescanne le dossier « autoload »chargement. " +"Ctrl+Maj: Rescanner le dossier « autoload » et recharger tous les scripts d'automatisme" #: ../src/command/time.cpp:99 msgid "adjoin" @@ -2625,29 +2528,27 @@ msgstr "joint" #: ../src/command/time.cpp:104 msgid "Change &End" -msgstr "Changer la &fin" +msgstr "Modifier la &fin" #: ../src/command/time.cpp:105 msgid "Change End" -msgstr "Changer la fin" +msgstr "Modifier la fin" #: ../src/command/time.cpp:106 msgid "Change end times of lines to the next line's start time" -msgstr "" -"Modifier les temps de fin de ligne au temps de début de la ligne suivante" +msgstr "Modifier les temps de fin des lignes au temps de début de la ligne suivante" #: ../src/command/time.cpp:115 msgid "Change &Start" -msgstr "Changer le &début" +msgstr "Modifier le &début" #: ../src/command/time.cpp:116 msgid "Change Start" -msgstr "Changer le début" +msgstr "Modifier le début" #: ../src/command/time.cpp:117 msgid "Change start times of lines to the previous line's end time" -msgstr "" -"Modifier les temps de début de ligne au temps de finde la ligne précédente" +msgstr "Modifier les temps de début des lignes au temps de fin de la ligne précédente" #: ../src/command/time.cpp:127 msgid "Shift to &Current Frame" @@ -2659,9 +2560,7 @@ msgstr "Décaler vers l'image active" #: ../src/command/time.cpp:129 msgid "Shift selection so that the active line starts at current frame" -msgstr "" -"Décaler la sélection pour que la première ligne active démarre sur l'image " -"courante" +msgstr "Décaler la sélection pour que la première ligne active démarre sur l'image active" #: ../src/command/time.cpp:145 msgid "shift to frame" @@ -2673,7 +2572,7 @@ msgstr "&Décalage temporel..." #: ../src/command/time.cpp:154 msgid "Shift subtitles by time or frames" -msgstr "Décale des sous-titres en temps ou images" +msgstr "Décaler des sous-titres en temps ou images" #: ../src/command/time.cpp:175 ../src/audio_timing_dialogue.cpp:512 #: ../src/audio_timing_dialogue.cpp:518 @@ -2690,7 +2589,7 @@ msgstr "Coller la fin à la vidéo" #: ../src/command/time.cpp:183 msgid "Set end of selected subtitles to current video frame" -msgstr "Applique la fin des sous-titres sélectionnés à l'image vidéo active" +msgstr "Appliquer la fin des sous-titres sélectionnés à l'image vidéo active" #: ../src/command/time.cpp:193 msgid "Snap to S&cene" @@ -2701,11 +2600,9 @@ msgid "Snap to Scene" msgstr "Coller à la scène" #: ../src/command/time.cpp:195 -msgid "" -"Set start and end of subtitles to the keyframes around current video frame" +msgid "Set start and end of subtitles to the keyframes around current video frame" msgstr "" -"Met le début et la fin des sous-titre sur les clés d'image autour de l'image " -"vidéo active" +"Définir le début et la fin des sous-titre sur les images-clés proche de l'image vidéo active" #: ../src/command/time.cpp:232 msgid "snap to scene" @@ -2713,46 +2610,43 @@ msgstr "coller à la scène" #: ../src/command/time.cpp:238 ../src/command/time.cpp:239 msgid "Add lead in and out" -msgstr "Ajout blancs de début et de fin" +msgstr "Ajouter blancs de début et de fin" #: ../src/command/time.cpp:240 msgid "Add both lead in and out to the selected lines" -msgstr "Ajouter à la fois les entrée et sortie pour les lignes sélectionnées" +msgstr "Ajouter blanc de début et de fin pour les lignes sélectionnées" #: ../src/command/time.cpp:252 ../src/command/time.cpp:253 msgid "Add lead in" -msgstr "Ajout de blanc de début" +msgstr "Ajouter blanc de début" #: ../src/command/time.cpp:254 msgid "Add the lead in time to the selected lines" -msgstr "Ajout de blanc de début pour les lignes sélectionnées" +msgstr "Ajouter blanc de début pour les lignes sélectionnées" #: ../src/command/time.cpp:264 ../src/command/time.cpp:265 msgid "Add lead out" -msgstr "Ajout de blanc de fin" +msgstr "Ajouter blanc de fin" #: ../src/command/time.cpp:266 msgid "Add the lead out time to the selected lines" -msgstr "Ajout de blanc de fin pour les lignes sélectionnées" +msgstr "Ajouter un blanc de fin pour les lignes sélectionnées" #: ../src/command/time.cpp:275 ../src/command/time.cpp:276 msgid "Increase length" -msgstr "Augmenter la longueur" +msgstr "Agrandir la durée" #: ../src/command/time.cpp:277 msgid "Increase the length of the current timing unit" -msgstr "Augmenter la longueur de l'unité de temps actuelle" +msgstr "Agrandir la longueur de l'unité de temps actuelle" #: ../src/command/time.cpp:286 ../src/command/time.cpp:287 msgid "Increase length and shift" -msgstr "Augmenter la longueur et décaler" +msgstr "Agrandir la longueur et décaler" #: ../src/command/time.cpp:288 -msgid "" -"Increase the length of the current timing unit and shift the following items" -msgstr "" -"Allonger la longueur de l'unité de temps courante et décaler les éléments " -"suivants" +msgid "Increase the length of the current timing unit and shift the following items" +msgstr "Agrandir la longueur de l'unité de temps actuelle et décaler les éléments suivants" #: ../src/command/time.cpp:297 ../src/command/time.cpp:298 msgid "Decrease length" @@ -2760,34 +2654,31 @@ msgstr "Réduire la longueur" #: ../src/command/time.cpp:299 msgid "Decrease the length of the current timing unit" -msgstr "Réduire la longueur de l'actuelle unité de temps" +msgstr "Réduire la longueur de l'unité de temps actuelle" #: ../src/command/time.cpp:308 ../src/command/time.cpp:309 msgid "Decrease length and shift" msgstr "Réduire la longueur et décaler" #: ../src/command/time.cpp:310 -msgid "" -"Decrease the length of the current timing unit and shift the following items" -msgstr "" -"Réduire la longueur de l'unité de temps courante et décaler les éléments " -"suivants" +msgid "Decrease the length of the current timing unit and shift the following items" +msgstr "Réduire la longueur de l'unité de temps actuelle et décaler les éléments suivants" #: ../src/command/time.cpp:319 ../src/command/time.cpp:320 msgid "Shift start time forward" -msgstr "Décale les temps de début vers l'avant" +msgstr "Décaler les temps de début vers l'avant" #: ../src/command/time.cpp:321 msgid "Shift the start time of the current timing unit forward" -msgstr "Avancer le temps de départ de l'unité de temps courante" +msgstr "Décaler le temps de début de l'unité de temps actuelle" #: ../src/command/time.cpp:330 ../src/command/time.cpp:331 msgid "Shift start time backward" -msgstr "Reculer le temps de départ" +msgstr "Décaler le temps de départ en arrière" #: ../src/command/time.cpp:332 msgid "Shift the start time of the current timing unit backward" -msgstr "Reculer le temps de départ de l'unité de temps courante" +msgstr "Décaler le temps de départ de l'unité de temps actuelle en arrière" #: ../src/command/time.cpp:342 msgid "Snap &Start to Video" @@ -2799,7 +2690,7 @@ msgstr "Coller le début à la vidéo" #: ../src/command/time.cpp:344 msgid "Set start of selected subtitles to current video frame" -msgstr "Applique le début du sous-titre sélectionné à l'image vidéo active." +msgstr "Appliquer le début du sous-titre sélectionné à l'image vidéo active" #: ../src/command/time.cpp:356 msgid "Next line or syllable" @@ -2815,7 +2706,7 @@ msgstr "Standard" #: ../src/command/vis_tool.cpp:58 msgid "Standard mode, double click sets position" -msgstr "Mode standard, double-clic règle la position." +msgstr "Mode standard, le double-clic définit la position" #: ../src/command/vis_tool.cpp:64 ../src/command/vis_tool.cpp:65 #: ../src/visual_tool_vector_clip.cpp:57 @@ -2832,7 +2723,7 @@ msgstr "Rotation Z" #: ../src/command/vis_tool.cpp:74 msgid "Rotate subtitles on their Z axis" -msgstr "Tourne les sous-titres selon leur axe Z" +msgstr "Pivoter les sous-titres sur l'axe Z" #: ../src/command/vis_tool.cpp:80 ../src/command/vis_tool.cpp:81 msgid "Rotate XY" @@ -2840,31 +2731,31 @@ msgstr "Rotation XY" #: ../src/command/vis_tool.cpp:82 msgid "Rotate subtitles on their X and Y axes" -msgstr "Tourne les sous-titres selon leurs axes X et Y" +msgstr "Pivoter les sous-titres selon les axes X et Y" #: ../src/command/vis_tool.cpp:88 ../src/command/vis_tool.cpp:89 msgid "Scale" -msgstr "Anamorphose" +msgstr "Ajuster taille" #: ../src/command/vis_tool.cpp:90 msgid "Scale subtitles on X and Y axes" -msgstr "Anamorphose les sous-titres selon les axes X et Y" +msgstr "Ajuster la taille les sous-titres selon les axes X et Y" #: ../src/command/vis_tool.cpp:96 ../src/command/vis_tool.cpp:97 msgid "Clip" -msgstr "Clip" +msgstr "Contraindre" #: ../src/command/vis_tool.cpp:98 msgid "Clip subtitles to a rectangle" -msgstr "Contraint les sous-titres dans un rectangle" +msgstr "Contraindre les sous-titres dans un rectangle" #: ../src/command/vis_tool.cpp:104 ../src/command/vis_tool.cpp:105 msgid "Vector Clip" -msgstr "Clip vectoriel" +msgstr "Zone vectorielle" #: ../src/command/vis_tool.cpp:106 msgid "Clip subtitles to a vectorial area" -msgstr "Contraint les sous-titres dans une zone vectorielle" +msgstr "Contraindre les sous-titres dans une zone vectorielle" #: ../src/command/audio.cpp:65 msgid "&Close Audio" @@ -2876,7 +2767,7 @@ msgstr "Fermer l'audio" #: ../src/command/audio.cpp:67 msgid "Close the currently open audio file" -msgstr "Fermez le fichier audio actuellement ouvert" +msgstr "Fermer le fichier audio actuellement ouvert" #: ../src/command/audio.cpp:77 msgid "&Open Audio File..." @@ -2896,11 +2787,11 @@ msgstr "Formats audio" #: ../src/command/audio.cpp:93 ../src/command/audio.cpp:94 msgid "Open 2h30 Blank Audio" -msgstr "Ouvre un fichier audio vierge de 2 h 30" +msgstr "Ouvrir un audio vierge de 2 h 30" #: ../src/command/audio.cpp:95 msgid "Open a 150 minutes blank audio clip, for debugging" -msgstr "Ouvrir un clip audio vierge de 150 minutes pour débogage" +msgstr "Ouvrir 150 minutes d'audio vierge, pour débogage" #: ../src/command/audio.cpp:104 ../src/command/audio.cpp:105 msgid "Open 2h30 Noise Audio" @@ -2908,7 +2799,7 @@ msgstr "Ouvrir 2 h 30 de bruit audio" #: ../src/command/audio.cpp:106 msgid "Open a 150 minutes noise-filled audio clip, for debugging" -msgstr "Ouvrir un clip audio de 150 minutes de bruit, pour débogage" +msgstr "Ouvrir 150 minutes de bruit audio, pour débogage" #: ../src/command/audio.cpp:116 msgid "Open Audio from &Video" @@ -2920,7 +2811,7 @@ msgstr "Ouvrir l'audio de la vidéo" #: ../src/command/audio.cpp:118 msgid "Open the audio from the current video file" -msgstr "Ouvrez l'audio du fichier vidéo en cours" +msgstr "Ouvrir l'audio du fichier vidéo en cours" #: ../src/command/audio.cpp:132 msgid "&Spectrum Display" @@ -2960,17 +2851,15 @@ msgstr "Enregistrer le clip audio" #: ../src/command/audio.cpp:247 ../src/command/audio.cpp:248 msgid "Play current audio selection" -msgstr "Lire la sélection audio courante" +msgstr "Lire la sélection audio" #: ../src/command/audio.cpp:249 msgid "Play the current audio selection, ignoring changes made while playing" -msgstr "" -"Lire la sélection audio en ignorant les modifications apportées pendant la " -"lecture" +msgstr "Lire la sélection audio en ignorant les modifications apportées pendant la lecture" #: ../src/command/audio.cpp:262 msgid "Play the audio for the current line" -msgstr "Lire l'audio pour la ligne actuelle" +msgstr "Lire l'audio de la ligne actuelle" #: ../src/command/audio.cpp:275 ../src/command/audio.cpp:276 msgid "Play audio selection" @@ -2986,7 +2875,7 @@ msgstr "Lire la sélection audio ou arrêter" #: ../src/command/audio.cpp:289 msgid "Play selection, or stop playback if it's already playing" -msgstr "lire la sélection, ou arrêter la lecture si elle est déjà en cours" +msgstr "Lire la sélection, ou arrêter la lecture si elle est déjà en cours" #: ../src/command/audio.cpp:304 ../src/command/audio.cpp:305 msgid "Stop playing" @@ -2996,60 +2885,51 @@ msgstr "Arrêter la lecture" msgid "Stop audio and video playback" msgstr "Arrêtez la lecture audio et vidéo" -#: ../src/command/audio.cpp:322 ../src/command/audio.cpp:323 -#: ../src/command/audio.cpp:324 +#: ../src/command/audio.cpp:322 ../src/command/audio.cpp:323 ../src/command/audio.cpp:324 msgid "Play 500 ms before selection" msgstr "Lire 500 ms avant la sélection" -#: ../src/command/audio.cpp:336 ../src/command/audio.cpp:337 -#: ../src/command/audio.cpp:338 +#: ../src/command/audio.cpp:336 ../src/command/audio.cpp:337 ../src/command/audio.cpp:338 msgid "Play 500 ms after selection" msgstr "Lire 500 ms après la sélection" -#: ../src/command/audio.cpp:350 ../src/command/audio.cpp:351 -#: ../src/command/audio.cpp:352 +#: ../src/command/audio.cpp:350 ../src/command/audio.cpp:351 ../src/command/audio.cpp:352 msgid "Play last 500 ms of selection" msgstr "Lire les dernières 500 ms de la sélection" -#: ../src/command/audio.cpp:364 ../src/command/audio.cpp:365 -#: ../src/command/audio.cpp:366 +#: ../src/command/audio.cpp:364 ../src/command/audio.cpp:365 ../src/command/audio.cpp:366 msgid "Play first 500 ms of selection" msgstr "Lire les premières 500 ms de la sélection" -#: ../src/command/audio.cpp:380 ../src/command/audio.cpp:381 -#: ../src/command/audio.cpp:382 +#: ../src/command/audio.cpp:380 ../src/command/audio.cpp:381 ../src/command/audio.cpp:382 msgid "Play from selection start to end of file" -msgstr "Lit du début de la sélection à la fin du fichier" +msgstr "Lire du début de la sélection à la fin du fichier" #: ../src/command/audio.cpp:393 ../src/command/audio.cpp:394 msgid "Commit" -msgstr "Accepter" +msgstr "Valider" #: ../src/command/audio.cpp:395 msgid "Commit any pending audio timing changes" -msgstr "Accepter tous les changements de temps audio en instance" +msgstr "Valider tous les changements de temps audio en attente" #: ../src/command/audio.cpp:409 ../src/command/audio.cpp:410 msgid "Commit and use default timing for next line" -msgstr "Accepter et utiliser le temps par défaut pour la ligne suivante" +msgstr "Valider et utiliser le temps par défaut pour la ligne suivante" #: ../src/command/audio.cpp:411 -msgid "" -"Commit any pending audio timing changes and reset the next line's times to " -"the default" +msgid "Commit any pending audio timing changes and reset the next line's times to the default" msgstr "" -"Accepter les modifications de temps audio en instance et appliquer le temps " -"par défaut à la ligne suivante" +"Valider les modifications de temps audio en attente et appliquer le temps par défaut à la " +"ligne suivante" #: ../src/command/audio.cpp:424 ../src/command/audio.cpp:425 msgid "Commit and move to next line" -msgstr "Accepter et aller à la ligne suivante" +msgstr "Valider et aller à la ligne suivante" #: ../src/command/audio.cpp:426 msgid "Commit any pending audio timing changes and move to the next line" -msgstr "" -"Accepter toute modification de temps audio en instance et aller à la ligne " -"suivante" +msgstr "Valider les modifications de temps audio en attente et aller à la ligne suivante" #: ../src/command/audio.cpp:439 ../src/command/audio.cpp:440 msgid "Commit and stay on current line" @@ -3057,9 +2937,7 @@ msgstr "Valider et rester sur la ligne courante" #: ../src/command/audio.cpp:441 msgid "Commit any pending audio timing changes and stay on the current line" -msgstr "" -"Accepter toute modification de temps audio en instance et rester sur la " -"ligne courante" +msgstr "Valider les modifications de temps audio en attente et rester sur la ligne active" #: ../src/command/audio.cpp:452 ../src/command/audio.cpp:453 msgid "Go to selection" @@ -3067,8 +2945,7 @@ msgstr "Aller à la sélection" #: ../src/command/audio.cpp:454 msgid "Scroll the audio display to center on the current audio selection" -msgstr "" -"Faites défiler l'affichage audio pour centrer sur la sélection audio actuelle" +msgstr "Faire défiler l'affichage audio pour le centrer sur la sélection audio actuelle" #: ../src/command/audio.cpp:463 ../src/command/audio.cpp:464 msgid "Scroll left" @@ -3086,38 +2963,33 @@ msgstr "Défiler à droite" msgid "Scroll the audio display right" msgstr "Défiler l'affichage audio à droite" -#: ../src/command/audio.cpp:490 ../src/command/audio.cpp:491 -#: ../src/command/audio.cpp:492 +#: ../src/command/audio.cpp:490 ../src/command/audio.cpp:491 ../src/command/audio.cpp:492 msgid "Auto scroll audio display to selected line" -msgstr "Auto-défilement de l'affichage audio de la ligne sélectionnée" +msgstr "Auto-défilement de l'affichage audio vers la ligne sélectionnée" -#: ../src/command/audio.cpp:507 ../src/command/audio.cpp:508 -#: ../src/command/audio.cpp:509 +#: ../src/command/audio.cpp:507 ../src/command/audio.cpp:508 ../src/command/audio.cpp:509 msgid "Automatically commit all changes" -msgstr "Valider automatiquement toute modification" +msgstr "Valider automatiquement les modifications" #: ../src/command/audio.cpp:524 ../src/command/audio.cpp:525 msgid "Auto go to next line on commit" -msgstr "Aller automatiquement à la ligne suivante après validation" +msgstr "Passer automatiquement à la ligne suivante après validation" #: ../src/command/audio.cpp:526 msgid "Automatically go to next line on commit" -msgstr "Aller automatiquement à la ligne suivante après validation" +msgstr "Passer automatiquement à la ligne suivante après validation" -#: ../src/command/audio.cpp:541 ../src/command/audio.cpp:542 -#: ../src/command/audio.cpp:543 +#: ../src/command/audio.cpp:541 ../src/command/audio.cpp:542 ../src/command/audio.cpp:543 msgid "Spectrum analyzer mode" msgstr "Mode analyse de spectre" -#: ../src/command/audio.cpp:558 ../src/command/audio.cpp:559 -#: ../src/command/audio.cpp:560 +#: ../src/command/audio.cpp:558 ../src/command/audio.cpp:559 ../src/command/audio.cpp:560 msgid "Link vertical zoom and volume sliders" msgstr "Lier les curseurs de zoom vertical et de volume" -#: ../src/command/audio.cpp:575 ../src/command/audio.cpp:576 -#: ../src/command/audio.cpp:577 +#: ../src/command/audio.cpp:575 ../src/command/audio.cpp:576 ../src/command/audio.cpp:577 msgid "Toggle karaoke mode" -msgstr "Basculer en mode karaoké" +msgstr "Alterner mode karaoké" #: ../src/command/help.cpp:48 msgid "&Bug Tracker..." @@ -3130,8 +3002,8 @@ msgstr "Traqueur de bogues" #: ../src/command/help.cpp:50 msgid "Visit Aegisub's bug tracker to report bugs and request new features" msgstr "" -"Visitez le traqueur de bogues d'Aegisub pour rendre compte de bogues et " -"demander de nouvelles fonctions" +"Visitez le traqueur de bogues d'Aegisub pour signaler des bogues et proposer des " +"nouvelles fonctions" #: ../src/command/help.cpp:69 msgid "&Contents" @@ -3171,15 +3043,15 @@ msgstr "Visitez le canal IRC officiel d'Aegisub" #: ../src/command/help.cpp:105 msgid "&Visual Typesetting" -msgstr "Typographie &visuelle" +msgstr "Éditions vidéos" #: ../src/command/help.cpp:106 msgid "Visual Typesetting" -msgstr "Typographie visuelle" +msgstr "Éditions vidéos" #: ../src/command/help.cpp:107 msgid "Open the manual page for Visual Typesetting" -msgstr "Ouvrir la page du manuel pour la typographie visuelle" +msgstr "Ouvrir la page du manuel des éditions vidéos" #: ../src/command/help.cpp:117 msgid "&Website" @@ -3198,11 +3070,8 @@ msgid "Close Keyframes" msgstr "Fermer les images clés" #: ../src/command/keyframe.cpp:51 -msgid "" -"Discard the currently loaded keyframes and use those from the video, if any" -msgstr "" -"Ignorer les images clés actuellement chargés et utiliser ceux de la vidéo, " -"le cas échéant" +msgid "Discard the currently loaded keyframes and use those from the video, if any" +msgstr "Ignorer les images clés chargées et utiliser celles de la vidéo, le cas échéant" #: ../src/command/keyframe.cpp:66 msgid "Open Keyframes..." @@ -3218,7 +3087,7 @@ msgstr "Ouvrir un fichier de liste d'images clés" #: ../src/command/keyframe.cpp:72 msgid "Open keyframes file" -msgstr "Ouvrir un fichier des images clés" +msgstr "Ouvrir un fichier d'images clés" #: ../src/command/keyframe.cpp:85 msgid "Save Keyframes..." @@ -3302,7 +3171,7 @@ msgstr "Aegisub n'a trouvé aucune erreur orthographique dans ce script." #: ../src/dialog_spellchecker.cpp:329 ../src/dialog_spellchecker.cpp:343 msgid "spell check replace" -msgstr "Remplacement proposé" +msgstr "remplacement proposé" #: ../src/preferences_base.cpp:63 msgid "Please choose the folder:" @@ -3318,7 +3187,7 @@ msgstr "Choisir..." #: ../src/preferences_base.cpp:252 msgid "Font Size" -msgstr "Taille du caractère" +msgstr "Taille de la police d'écriture" #: ../src/dialog_properties.cpp:89 msgid "Script Properties" @@ -3342,15 +3211,15 @@ msgstr "Traduction :" #: ../src/dialog_properties.cpp:101 msgid "Editing:" -msgstr "Édition :" +msgstr "Adaptation :" #: ../src/dialog_properties.cpp:102 msgid "Timing:" -msgstr "Minutage :" +msgstr "Synchronisation :" #: ../src/dialog_properties.cpp:103 msgid "Synch point:" -msgstr "Synchronisation :" +msgstr "Point de synchronisation :" #: ../src/dialog_properties.cpp:104 msgid "Updated by:" @@ -3367,7 +3236,7 @@ msgstr "De la &vidéo" #: ../src/dialog_properties.cpp:133 msgid "Resolution" -msgstr "Résolution" +msgstr "Définition vidéo" #: ../src/dialog_properties.cpp:141 msgid "0: Smart wrapping, top line is wider" @@ -3383,24 +3252,23 @@ msgstr "2 : pas de répartition, césures sur \\n et \\N" #: ../src/dialog_properties.cpp:144 msgid "3: Smart wrapping, bottom line is wider" -msgstr "3 : répartition intelligente, ligne infériieure plus grande" +msgstr "3 : répartition intelligente, ligne inférieure plus grande" #: ../src/dialog_properties.cpp:148 msgid "Wrap Style: " -msgstr "Style de répartition :" +msgstr "Style de répartition : " #: ../src/dialog_properties.cpp:151 msgid "Scale Border and Shadow" -msgstr "Échelle bord et ombre" +msgstr "Adapter taille bord et ombre" #: ../src/dialog_properties.cpp:152 msgid "" -"Scale border and shadow together with script/render resolution. If this is " -"unchecked, relative border and shadow size will depend on renderer." +"Scale border and shadow together with script/render resolution. If this is unchecked, " +"relative border and shadow size will depend on renderer." msgstr "" -"Adapter le bord et l'ombre ensemble selon la résolution du script. Si " -"l'option n'est pas cochée, la taille relative du bord et de l'ombre " -"dépendront du rendu." +"Adapter le bord et l'ombre selon la définition vidéo du script. Si l'option n'est pas " +"cochée, la taille relative du bord et de l'ombre dépendront du rendu." #: ../src/dialog_properties.cpp:193 msgid "property changes" @@ -3408,15 +3276,15 @@ msgstr "modifications des propriétés" #: ../src/dialog_fonts_collector.cpp:107 msgid "Symlinking fonts to folder...\n" -msgstr "Liaision des polices vers le dossier...\n" +msgstr "Liaison symbolique des polices d'écriture vers le dossier...\n" #: ../src/dialog_fonts_collector.cpp:111 msgid "Copying fonts to folder...\n" -msgstr "Copie des polices vers le dossier...\n" +msgstr "Copie des polices d'écriture vers le dossier...\n" #: ../src/dialog_fonts_collector.cpp:114 msgid "Copying fonts to archive...\n" -msgstr "Copie des polices dans l'archive...\n" +msgstr "Copie des polices d'écriture dans l'archive...\n" #: ../src/dialog_fonts_collector.cpp:126 #, c-format @@ -3450,42 +3318,41 @@ msgstr "* Échec copie %s.\n" #: ../src/dialog_fonts_collector.cpp:204 msgid "Done. All fonts copied." -msgstr "Terminé. Toutes les polices ont été copiées." +msgstr "Terminé. Toutes les polices d'écriture ont été copiées." #: ../src/dialog_fonts_collector.cpp:206 msgid "Done. Some fonts could not be copied." -msgstr "Terminé. Certaines polices n'ont pas été copiées." +msgstr "Terminé. Certaines polices d'écriture n'ont pas été copiées." #: ../src/dialog_fonts_collector.cpp:209 msgid "" "\n" -"Over 32 MB of fonts were copied. Some of the fonts may not be loaded by the " -"player if they are all attached to a Matroska file." +"Over 32 MB of fonts were copied. Some of the fonts may not be loaded by the player if they " +"are all attached to a Matroska file." msgstr "" "\n" -"Plus de 32 Mo de polices ont été copiés. Certaines polices ne seront pas " -"chargées par le lecteur si elles ont toutes été attachées au fichier " -"Matroska." +"Plus de 32 Mo de polices d'écriture ont été copiés. Certaines polices ne seront pas chargées " +"par le lecteur si elles ont toutes été attachées au fichier Matroska." #: ../src/dialog_fonts_collector.cpp:224 msgid "Check fonts for availability" -msgstr "Tester la disponibilité des polices" +msgstr "Tester la disponibilité des polices d'écriture" #: ../src/dialog_fonts_collector.cpp:225 msgid "Copy fonts to folder" -msgstr "Copier les polices dans le dossier" +msgstr "Copier les polices d'écriture dans le dossier" #: ../src/dialog_fonts_collector.cpp:226 msgid "Copy fonts to subtitle file's folder" -msgstr "Copier les polices dans le dossier des sous-titres" +msgstr "Copier les polices d'écriture dans le dossier des sous-titres" #: ../src/dialog_fonts_collector.cpp:227 msgid "Copy fonts to zipped archive" -msgstr "Copier les polices dans une archive compressée" +msgstr "Copier les polices d'écriture dans une archive compressée" #: ../src/dialog_fonts_collector.cpp:229 msgid "Symlink fonts to folder" -msgstr "Liaison des polices dans le dossier" +msgstr "Liaison des polices d'écriture dans le dossier" #: ../src/dialog_fonts_collector.cpp:232 ../src/dialog_selection.cpp:150 msgid "Action" @@ -3513,8 +3380,7 @@ msgstr "Destination invalide." #: ../src/dialog_fonts_collector.cpp:301 ../src/dialog_fonts_collector.cpp:306 #: ../src/dialog_fonts_collector.cpp:311 ../src/preferences.cpp:257 -#: ../src/dialog_kara_timing_copy.cpp:574 -#: ../src/dialog_kara_timing_copy.cpp:576 +#: ../src/dialog_kara_timing_copy.cpp:574 ../src/dialog_kara_timing_copy.cpp:576 #: ../src/dialog_kara_timing_copy.cpp:626 msgid "Error" msgstr "Erreur" @@ -3529,11 +3395,11 @@ msgstr "Chemin du fichier .zip invalide." #: ../src/dialog_fonts_collector.cpp:335 msgid "Select archive file name" -msgstr "Choix du nom de l'archive" +msgstr "Choisir le nom de l'archive" #: ../src/dialog_fonts_collector.cpp:342 msgid "Select folder to save fonts on" -msgstr "Choix du dossier pour les polices" +msgstr "Choisir le dossier pour les polices" #: ../src/dialog_fonts_collector.cpp:356 msgid "N/A" @@ -3541,18 +3407,18 @@ msgstr "N/D" #: ../src/dialog_fonts_collector.cpp:364 msgid "" -"Choose the folder where the fonts will be collected to. It will be created " -"if it doesn't exist." +"Choose the folder where the fonts will be collected to. It will be created if it doesn't " +"exist." msgstr "" -"Dossier de destination des polices collectées. S'il est absent, il sera créé." +"Dossier de destination des polices d'écriture collectées. S'il est absent, il sera créé." #: ../src/dialog_fonts_collector.cpp:371 msgid "" -"Enter the name of the destination zip file to collect the fonts to. If a " -"folder is entered, a default name will be used." +"Enter the name of the destination zip file to collect the fonts to. If a folder is entered, " +"a default name will be used." msgstr "" -"Nom du fichier zip devant recevoir les polices. Si un dossier est choisi, un " -"nom par défaut sera utilisé." +"Nom du fichier zip qui doit recevoir les polices. Si un dossier est choisi, un nom par " +"défaut sera utilisé." #: ../src/audio_renderer_waveform.cpp:154 msgid "Maximum" @@ -3572,7 +3438,7 @@ msgstr "Échi&quier" #: ../src/dialog_dummy_video.cpp:118 msgid "Video resolution:" -msgstr "Résolution vidéo :" +msgstr "Définition vidéo :" #: ../src/dialog_dummy_video.cpp:120 msgid "Color:" @@ -3580,7 +3446,7 @@ msgstr "Couleur :" #: ../src/dialog_dummy_video.cpp:121 msgid "Frame rate (fps):" -msgstr "Défilement (FPS) :" +msgstr "Fréquence d'image (IPS) :" #: ../src/dialog_dummy_video.cpp:122 msgid "Duration (frames):" @@ -3591,8 +3457,8 @@ msgstr "Durée (images) :" msgid "Resulting duration: %s" msgstr "Durée : %s" -#: ../src/preferences.cpp:61 ../src/preferences.cpp:63 -#: ../src/preferences.cpp:316 ../src/preferences.cpp:341 +#: ../src/preferences.cpp:61 ../src/preferences.cpp:63 ../src/preferences.cpp:316 +#: ../src/preferences.cpp:341 msgid "General" msgstr "Général" @@ -3606,9 +3472,7 @@ msgstr "Afficher la barre d'outils principale" #: ../src/preferences.cpp:66 msgid "Save UI state in subtitles files" -msgstr "" -"Enregistrer l'état de l'interface utilisateur dans les fichiers de sous-" -"titres" +msgstr "Enregistrer l'état de l'interface utilisateur dans les fichiers de sous-titres" #: ../src/preferences.cpp:69 msgid "Toolbar Icon Size" @@ -3656,15 +3520,15 @@ msgstr "Catalogues de style par défaut" #: ../src/preferences.cpp:89 msgid "" -"The chosen style catalogs will be loaded when you start a new file or import " -"files in the various formats.\n" +"The chosen style catalogs will be loaded when you start a new file or import files in the " +"various formats.\n" "\n" "You can set up style catalogs in the Style Manager." msgstr "" -"Les catalogues de style choisis seront chargés lorsque vous démarrez un " -"nouveau fichier ou importez des fichiers dans différents formats.\n" +"Les catalogues de style choisis seront chargés en démarrant un nouveau fichier ou en " +"important des fichiers dans différents formats.\n" "\n" -"Vous pouvez configurer des catalogues styles dans le gestionnaire des styles." +"Configuration possible des catalogues styles dans le gestionnaire des styles." #: ../src/preferences.cpp:114 msgid "New files" @@ -3700,7 +3564,7 @@ msgstr "Verrouiller le défilement sur le curseur" #: ../src/preferences.cpp:130 msgid "Snap markers by default" -msgstr "Coller aux marquers par défaut" +msgstr "Coller aux marqueurs par défaut" #: ../src/preferences.cpp:131 msgid "Auto-focus on mouse over" @@ -3712,31 +3576,31 @@ msgstr "Jouer l'audio lors de pas vidéo" #: ../src/preferences.cpp:133 msgid "Left-click-drag moves end marker" -msgstr "Clic gauche-glissé déplace le marqueur de fin" +msgstr "Le clic gauche glissé déplace le marqueur de fin" #: ../src/preferences.cpp:134 msgid "Default timing length (ms)" -msgstr "Longueur de temps par défaut (ms)" +msgstr "Durée par défaut (en ms)" #: ../src/preferences.cpp:135 msgid "Default lead-in length (ms)" -msgstr "Longueur du blanc de début par défaut (ms)" +msgstr "Durée du blanc de début par défaut (en ms)" #: ../src/preferences.cpp:136 msgid "Default lead-out length (ms)" -msgstr "Longueur du blanc de fin par défaut (ms)" +msgstr "Durée du blanc de fin par défaut (en ms)" #: ../src/preferences.cpp:138 msgid "Marker drag-start sensitivity (px)" -msgstr "Sensibilité du départ du glissé du marqueur (px)" +msgstr "Sensibilité du départ du glissé du marqueur (en px)" #: ../src/preferences.cpp:139 msgid "Line boundary thickness (px)" -msgstr "Épaisseur de la ligne de limite (px)" +msgstr "Épaisseur de la ligne de limite (en px)" #: ../src/preferences.cpp:140 msgid "Maximum snap distance (px)" -msgstr "Distance maximale de contrainte (px)" +msgstr "Distance maximale de collage (en px)" #: ../src/preferences.cpp:142 msgid "Don't show" @@ -3744,11 +3608,11 @@ msgstr "Ne pas afficher" #: ../src/preferences.cpp:142 msgid "Show previous" -msgstr "Afficher précédent" +msgstr "Afficher précédente" #: ../src/preferences.cpp:142 msgid "Show previous and next" -msgstr "Afficher précédent et suivant" +msgstr "Afficher précédente et suivante" #: ../src/preferences.cpp:142 msgid "Show all" @@ -3788,7 +3652,7 @@ msgstr "Limites secondes" #: ../src/preferences.cpp:155 msgid "Waveform Style" -msgstr "Forme d'onde" +msgstr "Style forme d'onde" #: ../src/preferences.cpp:157 msgid "Audio labels" @@ -3796,16 +3660,15 @@ msgstr "Étiquettes audio" #: ../src/preferences.cpp:168 msgid "Show keyframes in slider" -msgstr "Affichier les clés d'image dans la glissière" +msgstr "Afficher les images clés dans le champ" #: ../src/preferences.cpp:170 msgid "Only show visual tools when mouse is over video" -msgstr "N'afficher que les outils vidéo lorsque la souris est sur la vidéo" +msgstr "N'afficher les outils vidéo que lorsque la souris est sur la vidéo" #: ../src/preferences.cpp:172 msgid "Seek video to line start on selection change" -msgstr "" -"Chercher dans la vidéo la ligne de départ sur modification de sélection" +msgstr "Sauter au début de ligne quand changement de sélection" #: ../src/preferences.cpp:174 msgid "Automatically open audio when opening video" @@ -3817,19 +3680,19 @@ msgstr "Zoom par défaut" #: ../src/preferences.cpp:181 msgid "Fast jump step in frames" -msgstr "Pas du saut rapide dans les images" +msgstr "Pas du saut rapide en images" #: ../src/preferences.cpp:185 msgid "Screenshot save path" -msgstr "Chemin d'enregistrement des copies d'écran" +msgstr "Chemin d'enregistrement des captures d'écran" #: ../src/preferences.cpp:187 msgid "Script Resolution" -msgstr "Résolution du script" +msgstr "Définition vidéo du script" #: ../src/preferences.cpp:188 msgid "Use resolution of first video opened" -msgstr "Utiliser la résolution de la première vidéo ouverte" +msgstr "Utiliser la définition vidéo de la première vidéo ouverte" #: ../src/preferences.cpp:191 msgid "Default width" @@ -3849,7 +3712,7 @@ msgstr "Toujours ré-échantillonner" #: ../src/preferences.cpp:197 msgid "Match video resolution on open" -msgstr "Coller à la résolution vidéo à l'ouverture" +msgstr "Faire correspondre à la définition vidéo à l'ouverture" #: ../src/preferences.cpp:204 msgid "Interface" @@ -3861,15 +3724,15 @@ msgstr "Boîte d'édition" #: ../src/preferences.cpp:207 msgid "Enable call tips" -msgstr "Appel astuces disponible" +msgstr "Activer les actuces" #: ../src/preferences.cpp:208 msgid "Overwrite in time boxes" -msgstr "Écrasement dans cases temps" +msgstr "Remplacement dans cases temps" #: ../src/preferences.cpp:210 msgid "Enable syntax highlighting" -msgstr "Mise en valeur syntaxique disponible" +msgstr "Activer la surbrillance syntaxique" #: ../src/preferences.cpp:211 msgid "Dictionaries path" @@ -3885,15 +3748,15 @@ msgstr "Nombre maximum de caractères par ligne" #: ../src/preferences.cpp:216 msgid "Characters Per Second Warning Threshold" -msgstr "Caractères par seconde seuil d'avertissement" +msgstr "Seuil d'avertissement des caractères par seconde" #: ../src/preferences.cpp:217 msgid "Characters Per Second Error Threshold" -msgstr "Caractères par seconde seuil d'erreur" +msgstr "Seuil d'erreur des caractères par seconde" #: ../src/preferences.cpp:218 msgid "Ignore whitespace" -msgstr "Ignorer l'espace blanc" +msgstr "Ignorer les espaces" #: ../src/preferences.cpp:219 msgid "Ignore punctuation" @@ -3905,15 +3768,15 @@ msgstr "Grille" #: ../src/preferences.cpp:222 msgid "Focus grid on click" -msgstr "Grille de focus sur clic" +msgstr "La grille devient la cible de saisie par un clic" #: ../src/preferences.cpp:223 msgid "Highlight visible subtitles" -msgstr "Surligner les sous-titres visibles" +msgstr "Surbriller les sous-titres visibles" #: ../src/preferences.cpp:224 msgid "Hide overrides symbol" -msgstr "Masquer les symboles de recouvrement" +msgstr "Caractère de masquage des balises" #: ../src/preferences.cpp:232 ../src/dialog_style_editor.cpp:179 msgid "Colors" @@ -3925,7 +3788,7 @@ msgstr "Affichage audio" #: ../src/preferences.cpp:241 msgid "Play cursor" -msgstr "Curseur lecteur" +msgstr "Curseur du lecteur" #: ../src/preferences.cpp:242 msgid "Line boundary start" @@ -3945,7 +3808,7 @@ msgstr "Limite des syllabes" #: ../src/preferences.cpp:248 msgid "Syntax Highlighting" -msgstr "Surlignage syntaxique" +msgstr "Surbrillance syntaxique" #: ../src/preferences.cpp:249 msgid "Background" @@ -4001,7 +3864,7 @@ msgstr "Couleurs d'affichage audio" #: ../src/preferences.cpp:269 ../src/preferences.cpp:370 msgid "Spectrum" -msgstr "Spectre" +msgstr "Spectrogramme" #: ../src/preferences.cpp:270 msgid "Waveform" @@ -4009,7 +3872,7 @@ msgstr "Forme d'onde" #: ../src/preferences.cpp:272 msgid "Subtitle Grid" -msgstr "Grille sous-titres" +msgstr "Grille des sous-titres" #: ../src/preferences.cpp:273 msgid "Standard foreground" @@ -4061,7 +3924,35 @@ msgstr "Lignes" #: ../src/preferences.cpp:285 msgid "CPS Error" -msgstr "Erreur de caractères/seconde" +msgstr "Erreur de CPS" + +#: ../src/preferences.cpp:291 +msgid "Visual Typesetting Tools" +msgstr "Outils des éditions vidéo" + +#: ../src/preferences.cpp:292 +msgid "Primary Lines" +msgstr "Lignes principales" + +#: ../src/preferences.cpp:293 +msgid "Secondary Lines" +msgstr "Lignes secondaires" + +#: ../src/preferences.cpp:294 +msgid "Primary Highlight" +msgstr "Surbrillance principale" + +#: ../src/preferences.cpp:295 +msgid "Secondary Highlight" +msgstr "Surbrillance secondaire" + +#: ../src/preferences.cpp:298 +msgid "Visual Typesetting Tools Alpha" +msgstr "Transparence des outils des éditions vidéo" + +#: ../src/preferences.cpp:299 +msgid "Shaded Area" +msgstr "Zone grisée" #: ../src/preferences.cpp:294 msgid "Backup" @@ -4079,14 +3970,13 @@ msgstr "Disponible" msgid "Interval in seconds" msgstr "Intervale en secondes" -#: ../src/preferences.cpp:301 ../src/preferences.cpp:307 -#: ../src/preferences.cpp:368 +#: ../src/preferences.cpp:301 ../src/preferences.cpp:307 ../src/preferences.cpp:368 msgid "Path" msgstr "Chemin" #: ../src/preferences.cpp:302 msgid "Autosave after every change" -msgstr "Enregistrement automatique après chaque modification" +msgstr "Enregistrement automatique après une modification" #: ../src/preferences.cpp:304 msgid "Automatic Backup" @@ -4094,15 +3984,15 @@ msgstr "Sauvegarde automatique" #: ../src/preferences.cpp:318 msgid "Base path" -msgstr "Chemin de base" +msgstr "Chemin" #: ../src/preferences.cpp:319 msgid "Include path" -msgstr "Chemin d'inclusions" +msgstr "Chemin « include »" #: ../src/preferences.cpp:320 msgid "Auto-load path" -msgstr "Chemin de chargement auto" +msgstr "Chemin « auto-load »" #: ../src/preferences.cpp:322 msgid "0: Fatal" @@ -4170,11 +4060,11 @@ msgstr "Avancé" #: ../src/preferences.cpp:343 msgid "" -"Changing these settings might result in bugs and/or crashes. Do not touch " -"these unless you know what you're doing." +"Changing these settings might result in bugs and/or crashes. Do not touch these unless you " +"know what you're doing." msgstr "" -"Modifier ces réglages peut générer des bogues ou des plantages. Ne modifier " -"que si vous savez ce que vous faites." +"Modifier ces réglages peut générer des bogues ou des plantages. Ne modifier que si vous " +"savez ce que vous faites." #: ../src/preferences.cpp:356 ../src/preferences.cpp:419 msgid "Expert" @@ -4194,7 +4084,7 @@ msgstr "Cache" #: ../src/preferences.cpp:365 msgid "None (NOT RECOMMENDED)" -msgstr "Aucune (DÉCONSEILLÉ)" +msgstr "Aucun (DÉCONSEILLÉ)" #: ../src/preferences.cpp:365 msgid "RAM" @@ -4314,11 +4204,9 @@ msgstr "Raccourcis clavier" #: ../src/preferences.cpp:672 msgid "" -"Are you sure that you want to restore the defaults? All your settings will " -"be overridden." +"Are you sure that you want to restore the defaults? All your settings will be overridden." msgstr "" -"Êtes-vous sûr de vouloir rétablir les réglages par défaut ? Tous vos " -"réglages seront perdus." +"Êtes-vous sûr de vouloir rétablir les réglages par défaut ? Tous vos réglages seront perdus." #: ../src/preferences.cpp:672 msgid "Restore defaults?" @@ -4394,7 +4282,7 @@ msgstr "Aucune macro d'automatisme chargée" #: ../src/dialog_about.cpp:46 msgid "Translated into LANGUAGE by PERSON\n" -msgstr "Traduit en français par Céréales Killer\n" +msgstr "Traduction originelle en français par Céréales Killer, corrigée par Vardë\n" #: ../src/dialog_about.cpp:122 msgid "" @@ -4411,15 +4299,15 @@ msgstr "Compilé par %s le %s." #: ../src/dialog_kara_timing_copy.cpp:57 msgid "Source: " -msgstr "Source :" +msgstr "Source : " #: ../src/dialog_kara_timing_copy.cpp:58 msgid "Dest: " -msgstr "Cible :" +msgstr "Cible : " #: ../src/dialog_kara_timing_copy.cpp:470 msgid "Kanji timing" -msgstr "Minutage kanji" +msgstr "Synchronisation kanji" #: ../src/dialog_kara_timing_copy.cpp:475 ../src/dialog_paste_over.cpp:73 #: ../src/grid_column.cpp:334 ../src/grid_column.cpp:335 @@ -4453,8 +4341,7 @@ msgid "" "Enter: Link, accept line when done\n" "Backspace: Unlink last" msgstr "" -"Lorsque le focus est sur la boîte texte cible, utiliser les touches " -"suivantes :\n" +"Lorsque la cible de saisie est la boîte texte cible, utiliser les touches suivantes :\n" "\n" "Flèche droite : agrandit la longueur de sélection cible\n" "Flèche gauche : réduit la longueur de sélection cible\n" @@ -4498,7 +4385,7 @@ msgstr "&Fermer" #: ../src/dialog_kara_timing_copy.cpp:566 msgid "kanji timing" -msgstr "minutage kanji" +msgstr "synchronisation kanji" #: ../src/dialog_kara_timing_copy.cpp:574 msgid "Select source and destination styles first." @@ -4532,13 +4419,12 @@ msgstr "Choisir les champs que vous voulez recouvrir :" msgid "Comment" msgstr "Commentaire" -#: ../src/dialog_paste_over.cpp:67 ../src/grid_column.cpp:177 -#: ../src/grid_column.cpp:178 +#: ../src/dialog_paste_over.cpp:67 ../src/grid_column.cpp:177 ../src/grid_column.cpp:178 msgid "Style" msgstr "Style" -#: ../src/dialog_paste_over.cpp:68 ../src/subs_edit_box.cpp:140 -#: ../src/grid_column.cpp:205 ../src/grid_column.cpp:206 +#: ../src/dialog_paste_over.cpp:68 ../src/subs_edit_box.cpp:140 ../src/grid_column.cpp:205 +#: ../src/grid_column.cpp:206 msgid "Actor" msgstr "Acteur" @@ -4583,11 +4469,11 @@ msgstr "" #: ../src/main.cpp:302 msgid "" -"Do you want Aegisub to check for updates whenever it starts? You can still " -"do it manually via the Help menu." +"Do you want Aegisub to check for updates whenever it starts? You can still do it manually " +"via the Help menu." msgstr "" -"Voulez-vous qu'Aegisub recherche les mises à jour au démarrage ? Vous " -"pourrez toujours le faire manuellement par le menu Aide." +"Voulez-vous qu'Aegisub recherche les mises à jour au démarrage ? Vous pourrez toujours le " +"faire manuellement par le menu « aide »." #: ../src/main.cpp:302 msgid "Check for updates?" @@ -4600,13 +4486,12 @@ msgstr "Erreur de programme" #: ../src/main.cpp:406 #, c-format msgid "" -"An unexpected error has occurred. Please save your work and restart " -"Aegisub.\n" +"An unexpected error has occurred. Please save your work and restart Aegisub.\n" "\n" "Error Message: %s" msgstr "" -"Une erreur inattendue s'est produite. S'il vous plaît, enregistrez votre " -"travail et redémarrez Aegisub.\n" +"Une erreur inattendue s'est produite. Veuillez enregistrer votre travail et redémarrez " +"Aegisub.\n" "\n" "Message d'erreur : %s" @@ -4616,9 +4501,7 @@ msgstr "&Commentaire" #: ../src/subs_edit_box.cpp:120 msgid "Comment this line out. Commented lines don't show up on screen." -msgstr "" -"Commente cette ligne en dehors. Les lignes de commentaires ne sont pas " -"affichées à l'écran." +msgstr "Commenter cette ligne. Les lignes de commentaires ne sont pas affichées à l'écran." #: ../src/subs_edit_box.cpp:127 msgid "Style for this line" @@ -4629,21 +4512,16 @@ msgid "Edit" msgstr "Éditer" #: ../src/subs_edit_box.cpp:140 -msgid "" -"Actor name for this speech. This is only for reference, and is mainly " -"useless." -msgstr "" -"Nom de l'acteur pour ce dialogue. Cela ne sert que de référence, donc " -"inutile." +msgid "Actor name for this speech. This is only for reference, and is mainly useless." +msgstr "Nom de l'acteur pour ce dialogue. Cela ne sert que de référence, donc inutile." #: ../src/subs_edit_box.cpp:145 msgid "" -"Effect for this line. This can be used to store extra information for " -"karaoke scripts, or for the effects supported by the renderer." +"Effect for this line. This can be used to store extra information for karaoke scripts, or " +"for the effects supported by the renderer." msgstr "" -"Effet pour cette ligne. Peut être utilisé pour stocker des informations " -"supplémentaires pour des scripts karaoké our pour des effets supportés par " -"le codeur." +"Effet pour cette ligne. Peut être utilisé pour stocker des informations supplémentaires pour " +"des scripts karaoké ou pour des effets supportés par le moteur de rendu." #: ../src/subs_edit_box.cpp:151 msgid "Number of characters in the longest line of this subtitle." @@ -4711,14 +4589,12 @@ msgstr "Afficher l'original" #: ../src/subs_edit_box.cpp:194 msgid "" -"Show the contents of the subtitle line when it was first selected above the " -"edit box. This is sometimes useful when editing subtitles or translating " -"subtitles into another language." +"Show the contents of the subtitle line when it was first selected above the edit box. This " +"is sometimes useful when editing subtitles or translating subtitles into another language." msgstr "" -"Afficher le contenu de la ligne de sous-titre quand il a été sélectionné en " -"premier au-dessus de la zone d'édition. Cela peut être utile lors de " -"l'édition de sous-titres ou de traduction des sous-titres dans une autre " -"langue." +"Afficher le contenu de la ligne de sous-titre lorsqu'elle a été sélectionné pour la première " +"fois au-dessus de la zone d'édition. Cela peut être utile lors de la modification de sous-" +"titres ou de traduction des sous-titres dans une autre langue." #: ../src/subs_edit_box.cpp:441 msgid "modify text" @@ -4841,7 +4717,7 @@ msgstr[1] "La sélection a été fixée à %u lignes" #: ../src/dialog_selection.cpp:212 msgid "Selection was set to no lines" -msgstr "La sélection a été fixée à aucun ligne" +msgstr "La sélection n'a été fixée à aucune ligne" #: ../src/dialog_selection.cpp:218 #, c-format @@ -4872,7 +4748,7 @@ msgstr "Sélection" #: ../src/font_file_lister.cpp:72 #, c-format msgid "Style '%s' does not exist\n" -msgstr "Style '%s' n'existe pas\n" +msgstr "Le style '%s' n'existe pas\n" #: ../src/font_file_lister.cpp:138 #, c-format @@ -4892,7 +4768,7 @@ msgstr "'%s' n'a pas une variante gras.\n" #: ../src/font_file_lister.cpp:151 #, c-format msgid "'%s' does not have an italic variant.\n" -msgstr "'%s' n'a pas une variante italique.\n" +msgstr "'%s' ne possède pas de variante italique.\n" #: ../src/font_file_lister.cpp:155 #, c-format @@ -4918,7 +4794,7 @@ msgstr "Analyse du fichier\n" #: ../src/font_file_lister.cpp:200 msgid "Searching for font files\n" -msgstr "Recherche des polices\n" +msgstr "Recherche de polices d'écriture\n" #: ../src/font_file_lister.cpp:202 msgid "" @@ -4942,36 +4818,30 @@ msgstr[1] "%d polices sont introuvables\n" #: ../src/font_file_lister.cpp:214 #, c-format msgid "One font was found, but was missing glyphs used in the script.\n" -msgid_plural "" -"%d fonts were found, but were missing glyphs used in the script.\n" -msgstr[0] "" -"Une police a été trouvée, mais était absente des glyphs utilisés dans le " -"script.\n" +msgid_plural "%d fonts were found, but were missing glyphs used in the script.\n" +msgstr[0] "Une police a été trouvée, mais était absente des glyphes utilisés dans le script.\n" msgstr[1] "" -"%d polices ont été trouvées, mais étaient absentes des glyphs utilisés dans " -"le script.\n" +"%d polices ont été trouvées, mais étaient absentes des glyphes utilisés dans le script.\n" #: ../src/export_framerate.cpp:52 msgid "Transform Framerate" -msgstr "Transformation défilement" +msgstr "Modifier fréquence d'image" #: ../src/export_framerate.cpp:53 msgid "" -"Transform subtitle times, including those in override tags, from an input " -"framerate to an output framerate.\n" +"Transform subtitle times, including those in override tags, from an input framerate to an " +"output framerate.\n" "\n" -"This is useful for converting regular time subtitles to VFRaC time subtitles " -"for hardsubbing.\n" -"It can also be used to convert subtitles to a different speed video, such as " -"NTSC to PAL speedup." +"This is useful for converting regular time subtitles to VFRaC time subtitles for " +"hardsubbing.\n" +"It can also be used to convert subtitles to a different speed video, such as NTSC to PAL " +"speedup." msgstr "" -"Transforme les données temporelles, même celles qui sont dans les balises " -"prioritaires, depuis un taux d'entrée vers un taux de sortie.\n" +"Transforme les données temporelles, même celles qui sont dans les balises prioritaires, " +"depuis une fréquence d'image vers une nouvelle fréquence d'image.\n" "\n" -"Très pratique pour convertir les temps réguliers en VFRaC pour " -"l'incrustation.\n" -"Peut également être utile pour convertir la vitesse des sous-titres, comme " -"de NTSC vers PAL." +"Très pratique pour convertir les temps réguliers en VFRaC pour l'incrustation.\n" +"Peut également être utile pour convertir la vitesse des sous-titres, comme de NTSC vers PAL." #: ../src/export_framerate.cpp:92 msgid "V&ariable" @@ -4979,7 +4849,7 @@ msgstr "V&ariable" #: ../src/export_framerate.cpp:96 msgid "&Constant: " -msgstr "&Constante :" +msgstr "&Constante : " #: ../src/export_framerate.cpp:108 msgid "&Reverse transformation" @@ -4987,11 +4857,11 @@ msgstr "Transformation inve&rse" #: ../src/export_framerate.cpp:116 msgid "Input framerate: " -msgstr "Défilement d'entrée :" +msgstr "Fréquence d'image d'entrée : " #: ../src/export_framerate.cpp:118 msgid "Output: " -msgstr "Sortie :" +msgstr "Sortie : " #: ../src/audio_display.cpp:677 #, c-format @@ -5020,11 +4890,11 @@ msgstr "Ajoute une ligne" #: ../src/visual_tool_vector_clip.cpp:59 msgid "Bicubic" -msgstr "Bicubique" +msgstr "Cubique" #: ../src/visual_tool_vector_clip.cpp:59 msgid "Appends a bezier bicubic curve" -msgstr "Ajoute une courbe de Bézier bicubique" +msgstr "Ajoute une courbe de Bézier cubique" #: ../src/visual_tool_vector_clip.cpp:61 msgid "Convert" @@ -5032,7 +4902,7 @@ msgstr "Convertir" #: ../src/visual_tool_vector_clip.cpp:61 msgid "Converts a segment between line and bicubic" -msgstr "Convertit un segment ligne en bicubique" +msgstr "Convertit un segment ligne et cubique" #: ../src/visual_tool_vector_clip.cpp:62 msgid "Insert" @@ -5068,11 +4938,11 @@ msgstr "Dessine une forme libre adoucie" #: ../src/visual_tool_vector_clip.cpp:265 msgid "delete control point" -msgstr "supprime un point de contrôle." +msgstr "supprime un point de contrôle" #: ../src/dialog_automation.cpp:106 msgid "Automation Manager" -msgstr "Gestion d'automatisme" +msgstr "Gestionnaire d'automatismes" #: ../src/dialog_automation.cpp:117 msgid "&Add" @@ -5324,11 +5194,11 @@ msgstr "Marge Vertical" #: ../src/grid_column.cpp:266 msgid "CPS" -msgstr "caractères/seconde" +msgstr "CPS" #: ../src/grid_column.cpp:267 msgid "Characters Per Second" -msgstr "caractères/seconde" +msgstr "Caractères Par Seconde" #: ../src/dialog_text_import.cpp:47 msgid "Text import options" @@ -5356,8 +5226,7 @@ msgstr "Temps et numéro de l'image courante" #: ../src/video_box.cpp:65 msgid "Time of this frame relative to start and end of current subs" -msgstr "" -"Temps de cette image relatif au début et à la fin du sous-titre courant" +msgstr "Temps de cette image relatif au début et à la fin du sous-titre courant" #: ../src/ass_style.cpp:193 msgid "ANSI" @@ -5437,19 +5306,19 @@ msgstr "Choix couleur" #: ../src/dialog_colorpicker.cpp:556 msgid "Color spectrum" -msgstr "Couleur du spectre" +msgstr "Couleur du spectrogramme" #: ../src/dialog_colorpicker.cpp:560 msgid "RGB/R" -msgstr "RVB/R" +msgstr "RGB/R" #: ../src/dialog_colorpicker.cpp:560 msgid "RGB/G" -msgstr "RVB/V" +msgstr "RGB/G" #: ../src/dialog_colorpicker.cpp:560 msgid "RGB/B" -msgstr "RVB/B" +msgstr "RGB/B" #: ../src/dialog_colorpicker.cpp:560 msgid "HSL/L" @@ -5461,7 +5330,7 @@ msgstr "HSV/H" #: ../src/dialog_colorpicker.cpp:567 msgid "RGB color" -msgstr "Couleur RVB" +msgstr "Couleur RGB" #: ../src/dialog_colorpicker.cpp:568 msgid "HSL color" @@ -5583,7 +5452,7 @@ msgstr "120,000 IPS" #: ../src/subtitle_format.cpp:124 msgid "Please choose the appropriate FPS for the subtitles:" -msgstr "Choisir le taux d'image par seconde (IPS) approprié aux sous-titres :" +msgstr "Choisir la fréquence d'image (IPS) approprié aux sous-titres :" #: ../src/subtitle_format.cpp:124 msgid "FPS" @@ -5668,31 +5537,30 @@ msgstr "(Dé)charger les fichiers ?" #: ../src/project.cpp:255 msgid "The audio file was not found: " -msgstr "Le fichier audio n'a pas été trouvé :" +msgstr "Le fichier audio n'a pas été trouvé : " #: ../src/project.cpp:263 msgid "" -"None of the available audio providers recognised the selected file as " -"containing audio data.\n" +"None of the available audio providers recognised the selected file as containing audio " +"data.\n" "\n" "The following providers were tried:\n" msgstr "" -"Aucune source audio valide n'a identifié le fichier sélectionné pouvant " +"Aucun des fournisseurs audios disponibles n'a identifié le fichier sélectionné pouvant " "contenir des données audio.\n" "\n" -"Les sources suivantes ont été essayés :\n" +"Les fournisseurs audios suivants ont été essayés :\n" #: ../src/project.cpp:266 msgid "" -"None of the available audio providers have a codec available to handle the " -"selected file.\n" +"None of the available audio providers have a codec available to handle the selected file.\n" "\n" "The following providers were tried:\n" msgstr "" -"Aucun des sources audio disponibles ont un codec disponible pour gérer le " -"fichier sélectionné.\n" +"Aucun des fournisseurs audios disponibles n'a un codec disponible pour gérer le fichier " +"sélectionné.\n" "\n" -"Les sources suivantes ont été essayés :\n" +"Les fournisseurs audios suivants ont été essayés :\n" "\n" #: ../src/dialog_style_editor.cpp:127 @@ -5701,7 +5569,7 @@ msgstr "Éditeur de style" #: ../src/dialog_style_editor.cpp:178 msgid "Font" -msgstr "Police" +msgstr "Police d'écriture" #: ../src/dialog_style_editor.cpp:180 msgid "Margins" @@ -5785,11 +5653,11 @@ msgstr "Distance des bords haut et bas, en pixels" #: ../src/dialog_style_editor.cpp:225 msgid "" -"When selected, display an opaque box behind the subtitles instead of an " -"outline around the text" +"When selected, display an opaque box behind the subtitles instead of an outline around the " +"text" msgstr "" -"Lorsque sélectionné, affiche une boîte opaque derrière les sous-titres au " -"lieu du contour du texte" +"Lorsque sélectionné, affiche une boîte opaque derrière les sous-titres à la place du contour " +"du texte" #: ../src/dialog_style_editor.cpp:226 msgid "Outline width, in pixels" @@ -5812,11 +5680,8 @@ msgid "Angle to rotate in Z axis, in degrees" msgstr "Angle de rotation de l'axe Z, en degrés" #: ../src/dialog_style_editor.cpp:231 -msgid "" -"Encoding, only useful in unicode if the font doesn't have the proper unicode " -"mapping" -msgstr "" -"Encodage, utile en Unicode si la police n'a pas son propre codage Unicode." +msgid "Encoding, only useful in unicode if the font doesn't have the proper unicode mapping" +msgstr "Encodage, utile en Unicode si la police n'a pas son propre codage Unicode" #: ../src/dialog_style_editor.cpp:232 msgid "Character spacing, in pixels" @@ -5824,7 +5689,7 @@ msgstr "Espacement des caractères, en pixels" #: ../src/dialog_style_editor.cpp:233 msgid "Alignment in screen, in numpad style" -msgstr "Alignement à l'écran, en style clavier numérique" +msgstr "Alignement à l'écran, comme sur un pavé numérique" #: ../src/dialog_style_editor.cpp:277 msgid "Primary" @@ -5880,19 +5745,15 @@ msgstr "Couleur de l'arrière-plan de l'aperçu" #: ../src/dialog_style_editor.cpp:413 msgid "There is already a style with this name. Please choose another name." -msgstr "" -"Il y a déjà un style portant ce nom. S'il vous plaît choisissez un autre nom." +msgstr "Il y a déjà un style portant ce nom. Veuillez choisir un autre nom." #: ../src/dialog_style_editor.cpp:413 msgid "Style name conflict" msgstr "Conflit de nom de style" #: ../src/dialog_style_editor.cpp:425 -msgid "" -"Do you want to change all instances of this style in the script to this new " -"name?" -msgstr "" -"Voulez-vous remplacer toutes les occurrences de ce style par ce nouveau nom ?" +msgid "Do you want to change all instances of this style in the script to this new name?" +msgstr "Voulez-vous remplacer toutes les occurrences de ce style par ce nouveau nom ?" #: ../src/dialog_style_editor.cpp:426 msgid "Update script?" @@ -5900,11 +5761,11 @@ msgstr "Mettre à jour le script ?" #: ../src/dialog_export_ebu3264.cpp:84 msgid "" -"Time code offset in incorrect format. Ensure it is entered as four groups of " -"two digits separated by colons." +"Time code offset in incorrect format. Ensure it is entered as four groups of two digits " +"separated by colons." msgstr "" -"Format de décalage codes temps incorrect. Saisissez-les en quatre groupes de " -"deux chiffres séparés par des virgules." +"Format de décalage codes temps incorrect. Saisissez-les en quatre groupes de deux chiffres " +"séparés par des virgules." #: ../src/dialog_export_ebu3264.cpp:84 msgid "EBU STL export" @@ -5916,27 +5777,27 @@ msgstr "Exporter au format EBU STL" #: ../src/dialog_export_ebu3264.cpp:103 msgid "23.976 fps (non-standard, STL24.01)" -msgstr "23,976 i/s (non standard, STL24.01)" +msgstr "23,976 IPS (non standard, STL24.01)" #: ../src/dialog_export_ebu3264.cpp:104 msgid "24 fps (non-standard, STL24.01)" -msgstr "24 i/s (non standard, STL24.01)" +msgstr "24 IPS (non standard, STL24.01)" #: ../src/dialog_export_ebu3264.cpp:105 msgid "25 fps (STL25.01)" -msgstr "25 i/s (STL25.01)" +msgstr "25 IPS (STL25.01)" #: ../src/dialog_export_ebu3264.cpp:106 msgid "29.97 fps (non-dropframe, STL30.01)" -msgstr "29,97 i/s (sans dépôt d'image, STL30.01)" +msgstr "29,97 IPS (sans dépôt d'image, STL30.01)" #: ../src/dialog_export_ebu3264.cpp:107 msgid "29.97 fps (dropframe, STL30.01)" -msgstr "29,97 i/s (dépôt d'image, STL30.01)" +msgstr "29,97 IPS (dépôt d'image, STL30.01)" #: ../src/dialog_export_ebu3264.cpp:108 msgid "30 fps (STL30.01)" -msgstr "30 i/s (STL30.01)" +msgstr "30 IPS (STL30.01)" #: ../src/dialog_export_ebu3264.cpp:110 msgid "TV standard" @@ -5976,11 +5837,11 @@ msgstr "Encodage texte" #: ../src/dialog_export_ebu3264.cpp:126 msgid "Automatically wrap long lines (ASS)" -msgstr "Retour automatique des lignes longues (ASS)" +msgstr "Césure automatique des longues lignes (ASS)" #: ../src/dialog_export_ebu3264.cpp:127 msgid "Automatically wrap long lines (Balanced)" -msgstr "Césure automatique des lignes longues (équilibré)" +msgstr "Césure automatique des longues lignes (équilibré)" #: ../src/dialog_export_ebu3264.cpp:128 msgid "Abort if any lines are too long" @@ -6055,25 +5916,24 @@ msgstr "Résolution incompatible" #: ../src/dialog_video_properties.cpp:46 #, c-format msgid "" -"The resolution of the loaded video and the resolution specified for the " -"subtitles don't match.\n" +"The resolution of the loaded video and the resolution specified for the subtitles don't " +"match.\n" "\n" "Video resolution:\t%d x %d\n" "Script resolution:\t%d x %d\n" "\n" "Change subtitles resolution to match video?" msgstr "" -"Les résolutions de la vidéo chargée et des sous-titres ne correspondent " -"pas.\n" +"La définition de la vidéo chargée et des sous-titres ne correspondent pas.\n" "\n" -"Résolution vidéo : \t%d x %d\n" -"Résolution script : \t%d x %d\n" +"Définition vidéo : \t%d x %d\n" +"Définition script : \t%d x %d\n" "\n" -"Changer la résolution des sous-titres pour correspondre à la vidéo ?" +"Changer la définition des sous-titres pour correspondre à la vidéo ?" #: ../src/dialog_video_properties.cpp:54 ../src/dialog_video_properties.cpp:63 msgid "Set to video resolution" -msgstr "Définir la résolution vidéo" +msgstr "Définir la définition vidéo" #: ../src/dialog_video_properties.cpp:55 msgid "Resample script (stretch to new aspect ratio)" @@ -6093,19 +5953,19 @@ msgstr "Rééchantillonner le script" #: ../src/dialog_video_properties.cpp:163 msgid "change script resolution" -msgstr "changer la résolution du script" +msgstr "changer la définition vidéo du script" #: ../src/dialog_attachments.cpp:68 msgid "Attachment List" -msgstr "Liste des affectations" +msgstr "Liste des pièces jointes" #: ../src/dialog_attachments.cpp:76 msgid "Attach &Font" -msgstr "&Polices liées" +msgstr "&Ajouter une police" #: ../src/dialog_attachments.cpp:77 msgid "Attach &Graphics" -msgstr "&Images liées" +msgstr "&Ajouter une image" #: ../src/dialog_attachments.cpp:78 msgid "E&xtract" @@ -6113,7 +5973,7 @@ msgstr "E&xtraire" #: ../src/dialog_attachments.cpp:110 msgid "Attachment name" -msgstr "Nom de l'affectation" +msgstr "Nom de la pièce jointe" #: ../src/dialog_attachments.cpp:111 msgid "Size" @@ -6129,11 +5989,11 @@ msgstr "Choix du fichier à joindre" #: ../src/dialog_attachments.cpp:142 msgid "attach font file" -msgstr "Ajout des polices" +msgstr "ajout de police d'écriture" #: ../src/dialog_attachments.cpp:152 msgid "attach graphics file" -msgstr "Ajout des images" +msgstr "ajout d'image" #: ../src/dialog_attachments.cpp:164 msgid "Select the path to save the files to:" @@ -6145,7 +6005,7 @@ msgstr "Choix du chemin d'enregistrement du fichier :" #: ../src/dialog_attachments.cpp:189 msgid "remove attachment" -msgstr "Enlever les ajouts" +msgstr "enlever fichier joint" #: ../src/dialog_translation.cpp:77 msgid "Original" @@ -6157,7 +6017,7 @@ msgstr "Traduction" #: ../src/dialog_translation.cpp:115 msgid "Insert original" -msgstr "Insère original" +msgstr "Insérer original" #: ../src/dialog_translation.cpp:118 msgid "Delete line" @@ -6174,7 +6034,7 @@ msgstr "Plus de ligne à traduire." #: ../src/dialog_translation.cpp:186 ../src/dialog_translation.cpp:236 #, c-format msgid "Current line: %d/%d" -msgstr "Ligne courante : %d/%d" +msgstr "Ligne active : %d/%d" #: ../src/dialog_translation.cpp:273 msgid "translation assistant" @@ -6182,7 +6042,7 @@ msgstr "assistant à la traduction" #: ../src/visual_tool.cpp:122 msgid "visual typesetting" -msgstr "typographie visuelle" +msgstr "édition vidéo" #: ../src/dialog_resample.cpp:119 msgid "&Symmetrical" @@ -6210,7 +6070,7 @@ msgstr "Manuel" #: ../src/dialog_resample.cpp:147 msgid "Aspect Ratio Handling" -msgstr "Changer la résolution vidéo" +msgstr "Gestion du rapport de forme" #: ../src/dialog_resample.cpp:162 msgid "Margin offset" @@ -6222,15 +6082,15 @@ msgstr "x" #: ../src/dialog_resample.cpp:172 ../src/dialog_resample.cpp:186 msgid "YCbCr Matrix:" -msgstr "YCbCr Matrix :" +msgstr "Matrice YCbCr :" #: ../src/dialog_resample.cpp:175 msgid "Source Resolution" -msgstr "Résolution de la source" +msgstr "Définition vidéo source" #: ../src/dialog_resample.cpp:189 msgid "Destination Resolution" -msgstr "Résolution de la destination" +msgstr "Définition vidéo destination" #: ../src/dialog_version_check.cpp:94 msgid "Version Checker" @@ -6275,21 +6135,18 @@ msgid "" "There was an error checking for updates to Aegisub:\n" "%s\n" "\n" -"If other applications can access the Internet fine, this is probably a " -"temporary server problem on our end." +"If other applications can access the Internet fine, this is probably a temporary server " +"problem on our end." msgstr "" -"Une erreur s'est produite lors de la vérification des mises à jour " -"d'Aegisub :\n" +"Une erreur s'est produite lors de la vérification des mises à jour d'Aegisub :\n" "%s\n" "\n" -"Si d'autres applications accèdent à internet sans problème, c'est " -"probablement dû à un problème ponctuel de notre serveur." +"Si d'autres applications accèdent à internet sans problème, c'est probablement dû à un " +"problème ponctuel de notre serveur." #: ../src/dialog_version_check.cpp:379 msgid "An unknown error occurred while checking for updates to Aegisub." -msgstr "" -"Une erreur inconnue s'est produite lors de la vérification des mises à jour " -"d'Aegisub." +msgstr "Une erreur inconnue s'est produite lors de la vérification des mises à jour d'Aegisub." #: default_menu.json:0 msgid "&Insert (before)" @@ -6385,7 +6242,7 @@ msgstr "Réglage du &zoom" #: default_menu.json:0 msgid "Override &AR" -msgstr "Outrep&asser les proportions" +msgstr "Outrep&asser le rapport de forme" #: default_menu.json:0 msgid "&Export As..." @@ -6401,9 +6258,7 @@ msgstr "Ajouter flou de contour" #: ../automation/autoload/macro-1-edgeblur.lua:7 msgid "A demo macro showing how to do simple line modification in Automation 4" -msgstr "" -"Macro de démo montrant comment faire une modification simple de ligne en " -"Automation 4" +msgstr "Macro de démo montrant comment faire une modification simple de ligne en Automation 4" #: ../automation/autoload/macro-1-edgeblur.lua:21 msgid "Adds \\be1 tags to all selected lines" @@ -6416,31 +6271,26 @@ msgstr "Introduction karaoké automatique" #: ../automation/autoload/karaoke-auto-leadin.lua:33 msgid "Join up the ends of selected lines and add \\k tags to shift karaoke" msgstr "" -"Joindre la fin des lignes sélectionnées et ajouter des balises \\k pour " -"décalage en karaoké" +"Joindre la fin des lignes sélectionnées et ajouter des balises \\k pour décalage en karaoké" #: ../automation/autoload/cleantags-autoload.lua:31 msgid "Clean Tags" msgstr "Nettoyage des balises" #: ../automation/autoload/cleantags-autoload.lua:32 -msgid "" -"Clean subtitle lines by re-arranging ASS tags and override blocks within the " -"lines" +msgid "Clean subtitle lines by re-arranging ASS tags and override blocks within the lines" msgstr "" -"Nettoyage des lignes de sous-titres en réarrangeant les balises ASS et en " -"écrasant les blocs dans les lignes" +"Nettoyage des lignes de sous-titres en réarrangeant les balises ASS et en écrasant les blocs " +"dans les lignes" #: ../automation/autoload/kara-templater.lua:36 msgid "Karaoke Templater" msgstr "Création modèle karaoké" #: ../automation/autoload/kara-templater.lua:37 -msgid "" -"Macro and export filter to apply karaoke effects using the template language" +msgid "Macro and export filter to apply karaoke effects using the template language" msgstr "" -"Macro et filtres d'export pour appliquer les effets karaoké en utilisant le " -"modèle de langue" +"Macro et filtres d'export pour appliquer les effets karaoké en utilisant le modèle de langue" #: ../automation/autoload/kara-templater.lua:858 msgid "Apply karaoke template" @@ -6474,11 +6324,11 @@ msgstr "Enlève toutes les balises de recouvrement des lignes sélectionnées" #: ../automation/autoload/strip-tags.lua:28 msgid "strip tags" -msgstr "bande de balises" +msgstr "Retirer balises" #: ../automation/autoload/macro-2-mkfullwitdh.lua:77 msgid "Make fullwidth" -msgstr "Remplacer par de larges lettres" +msgstr "Remplacer par du pleine chasse" #: ../automation/autoload/macro-2-mkfullwitdh.lua:80 msgid "Convert Latin letters to SJIS fullwidth letters" @@ -6494,11 +6344,11 @@ msgstr "Éditeur de sous-titres" #: aegisub.desktop:6 msgid "Create and edit subtitles for film and videos." -msgstr "Crée et édite des sous-titres pour films et vidéos." +msgstr "Crée et modifie des sous-titres pour contenu vidéo." #: packages/win_installer/fragment_strings.iss:1 msgid "Installing runtime libraries..." -msgstr "Installation de bibliothèques d'exécution..." +msgstr "Installation des bibliothèques d'exécution..." #: packages/win_installer/fragment_strings.iss:1 msgid "Create a start menu icon" @@ -6514,1409 +6364,12 @@ msgstr "Contrôle de la mise à jour :" #: packages/win_installer/fragment_strings.iss:1 msgid "" -"This will install Aegisub {#BUILD_GIT_VERSION_STRING} on your computer.%n" -"%nAegisub is covered by the GNU General Public License version 2. This means " -"you may use the application for any purpose without charge, but that no " -"warranties of any kind are given either.%n%nSee the Aegisub website for " -"information on obtaining the source code." +"This will install Aegisub {#BUILD_GIT_VERSION_STRING} on your computer.%n%nAegisub is " +"covered by the GNU General Public License version 2. This means you may use the application " +"for any purpose without charge, but that no warranties of any kind are given either.%n%nSee " +"the Aegisub website for information on obtaining the source code." msgstr "" -"Ceci installera Aegisub {#BUILD_GIT_VERSION_STRING} sur votre computer.%n" -"%nAegisub est couvert par la GNU General Public License version 2. Cela " -"signifie que vous pouvez utiliser l'application pour n'importe quel but, " -"sans frais, mais qu'aucune garantie d'aucune sorte ne soit donnée.%n%nAller " -"le site de Aegisub pour savoir comment obtenir le code source." - -#~ msgid "" -#~ "An Automation script failed to load. File name: '%s', error reported: %s" -#~ msgstr "" -#~ "Échec du chargement d'un script d'automatisme. Fichier : « %s », erreur " -#~ "retournée : %s" - -#~ msgid "%d frames (%s)" -#~ msgstr "%d images (%s)" - -#~ msgid "Are you sure you want to delete these %d styles?" -#~ msgstr "Êtes-vous sûr de vouloir supprimer ces %d styles ?" - -#~ msgid "Style name collision." -#~ msgstr "Conflit de nom de style." - -#~ msgid "Closes the currently open timecodes file" -#~ msgstr "Ferme le fichier de codes temporels actif" - -#~ msgid "Opens a VFR timecodes v1 or v2 file" -#~ msgstr "Ouvre un fichier de codages temporels VFR v1 ou v2" - -#~ msgid "Saves a VFR timecodes v2 file" -#~ msgstr "Enregistre un fichier de codes temporels VFR v2" - -#~ msgid "Forces video to 2.35 aspect ratio" -#~ msgstr "Forcer la vidéo aux proportions 2.35" - -#~ msgid "Forces video to a custom aspect ratio" -#~ msgstr "Forcer la vidéo aux proportions personnalisées" - -#~ msgid "Leave video on original aspect ratio" -#~ msgstr "Laisser la vidéo à ses proportions d'origine" - -#~ msgid "Forces video to 4:3 aspect ratio" -#~ msgstr "Forcer la vidéo aux proportions 4:3" - -#~ msgid "Forces video to 16:9 aspect ratio" -#~ msgstr "Forcer la vidéo aux proportions 16:9" - -#~ msgid "Closes the currently open video file" -#~ msgstr "Ferme le fichier vidéo actuellement ouvert" - -#~ msgid "Detach video, displaying it in a separate Window" -#~ msgstr "Détache la vidéo pour l'afficher dans une fenêtre séparée" - -#~ msgid "Shows video details" -#~ msgstr "Affiche les détails de la vidéo" - -#~ msgid "Toggle focus between the video slider and other things" -#~ msgstr "Basculer le focus entre le curseur vidéo et les autres éléments" - -#~ msgid "Seek to the next subtitle boundary" -#~ msgstr "Chercher la limite de sous-titre suivante" - -#~ msgid "Seek to the previous subtitle boundary" -#~ msgstr "Chercher la limite de sous-titre précédente" - -#~ msgid "Jumps the video to the end frame of current subtitle" -#~ msgstr "Met la vidéo à l'image de fin du sous-titre actif" - -#~ msgid "Jumps the video to the start frame of current subtitle" -#~ msgstr "Met la vidéo à l'image de début du sous-titre actif" - -#~ msgid "Opens a video file" -#~ msgstr "Ouvre un fichier vidéo" - -#~ msgid "Opens a video clip with solid color" -#~ msgstr "Ouvre un clip vidéo formé d'une couleur pleine" - -#~ msgid "Copy subtitles" -#~ msgstr "Copier des sous-titres" - -#~ msgid "D&uplicate and Shift by 1 Frame" -#~ msgstr "D&upliquer et décaler d'une image" - -#~ msgid "Duplicate and Shift by 1 Frame" -#~ msgstr "Dupliquer et décaler d'une image" - -#~ msgid "Duplicate lines and shift by one frame" -#~ msgstr "Duplique les lignes et les décale d'une image" - -#~ msgid "Joins selected lines in a single one, as karaoke" -#~ msgstr "Joint les lignes sélectionnées en une seul, en karaoké" - -#~ msgid "Joins selected lines in a single one, concatenating text together" -#~ msgstr "" -#~ "Joint les lignes sélectionnées en une seule, chaînant le texte ensemble" - -#~ msgid "" -#~ "Joins selected lines in a single one, keeping text of first and " -#~ "discarding remaining" -#~ msgstr "" -#~ "Joint les lignes sélectionnées en une seule, ne gardant que le texte de " -#~ "la première" - -#~ msgid "Recombine subtitles when they have been split and merged" -#~ msgstr "Recombine des sous-titres lorsqu'ils ont été divisés et fusionnés" - -#~ msgid "Uses karaoke timing to split line into multiple smaller lines" -#~ msgstr "" -#~ "Utilise le minutage karaoké pour diviser la ligne en plusieurs petites " -#~ "lignes" - -#~ msgid "Redoes last action" -#~ msgstr "Rétablit la dernière action" - -#~ msgid "Undoes last action" -#~ msgstr "Annule la dernière action" - -#~ msgid "Open the attachment list" -#~ msgstr "Ouvrir la liste des affectations" - -#~ msgid "Find words in subtitles" -#~ msgstr "Chercher des mots dans les sous-titres" - -#~ msgid "Find next match of last word" -#~ msgstr "Cherche l'occurrence suivant du dernier mot" - -#~ msgid "Inserts a line after current" -#~ msgstr "Insère une ligne après l'active" - -#~ msgid "Inserts a line after current, starting at video time" -#~ msgstr "" -#~ "Insère une ligne après celle active démarrant au point de synchronisation" - -#~ msgid "Inserts a line before current" -#~ msgstr "Insère une ligne avant celle active" - -#~ msgid "Inserts a line before current, starting at video time" -#~ msgstr "" -#~ "Insère une ligne avant celle active démarrant au point de synchronisation" - -#~ msgid "Opens a subtitles file" -#~ msgstr "Ouvre un fichier de sous-titres" - -#~ msgid "Opens a subtitles file with a specific charset" -#~ msgstr "" -#~ "Ouvre un fichier de sous-titres avec un jeu de caractères spécifique" - -#~ msgid "Opens the subtitles from the current video file" -#~ msgstr "Ouvre les sous-titres du fichier vidéo courant" - -#~ msgid "Saves subtitles" -#~ msgstr "Enregistre les sous-titres" - -#~ msgid "Saves subtitles with another name" -#~ msgstr "Enregistre les sous-titres sous un autre nom" - -#~ msgid "Selects all dialogue lines" -#~ msgstr "Sélectionne toutes les lignes de dialogue" - -#~ msgid "Selects all lines that are currently visible on video frame" -#~ msgstr "" -#~ "Sélectione toutes les lignes qui sont visibiles dans l'image vidéo active" - -#~ msgid "Launch ASSDraw3 tool for vector drawing" -#~ msgstr "Lance l'outil « ASSDraw3 » pour le dessin vectoriel" - -#~ msgid "Saves a copy of subtitles with processing applied to it" -#~ msgstr "" -#~ "Enregistre une copie des sous-titres après leur avoir appliqué une action" - -#~ msgid "Selects lines based on defined criteria" -#~ msgstr "Sélectionne des lignes sur des critères définis" - -#~ msgid "Changes resolution and modifies subtitles to conform to change" -#~ msgstr "Change la résolution et modifie les sous-titres pour les adapter" - -#~ msgid "Open styles manager" -#~ msgstr "Ouvre le gestionnaire de styles" - -#~ msgid "Open Kanji timer" -#~ msgstr "Ouvre le chrono kanji" - -#~ msgid "" -#~ "Runs a post-processor for timing to deal with lead-ins, lead-outs, scene " -#~ "timing and etc" -#~ msgstr "" -#~ "Lance un postprocesseur pour ajuster les blancs de début et de fin, la " -#~ "synchro, etc." - -#~ msgid "Display audio and subtitles only" -#~ msgstr "N'affiche que l'audio et les sous-titres" - -#~ msgid "Display audio, video and subtitles" -#~ msgstr "Affiche l'audio, la vidéo et les sous-titres" - -#~ msgid "Display subtitles only" -#~ msgstr "N'affiche que les sous-titres" - -#~ msgid "Display video and subtitles only" -#~ msgstr "N'affiche que la vidéo et les sous-titres" - -#~ msgid "Swaps the two selected lines" -#~ msgstr "Intervertit les deux lignes sélectionnées" - -#~ msgid "Changes times of subs so end times begin on next's start time" -#~ msgstr "" -#~ "Change les temps du sous-titre pour qu'il finisse sur le temps de début " -#~ "suivant" - -#~ msgid "Changes times of subs so start times begin on previous's end time" -#~ msgstr "" -#~ "Change les temps du sous-titre pour qu'il commence sur le temps de fin " -#~ "précédent" - -#~ msgid "Closes the currently open audio file" -#~ msgstr "Ferme le fichier audio actif" - -#~ msgid "Opens an audio file" -#~ msgstr "Ouvre un fichier audio" - -#~ msgid "Opens the audio from the current video file" -#~ msgstr "Ouvre la bande son du fichier vidéo actif" - -#~ msgid "Create an audio clip of the selected line" -#~ msgstr "Crée un clip audio de la ligne sélectionnée" - -#~ msgid "Play selection or stop playback if it's already playing" -#~ msgstr "" -#~ "Jouer la sélection ou arrêter la reproduction si elle est déjà en cours" - -#~ msgid "Auto scrolls audio display to selected line" -#~ msgstr "Affichage auto de l'audio de la ligne sélectionnée" - -#~ msgid "Auto goes to next line on commit" -#~ msgstr "Aller à la ligne suivante à la validation" - -#~ msgid "All Fil&es" -#~ msgstr "Tous fichi&ers" - -#~ msgid "Resource files" -#~ msgstr "Fichiers de ressource" - -#~ msgid "Closes the currently open keyframes list" -#~ msgstr "Ferme la liste des images clés actuelle" - -#~ msgid "Opens a keyframe list file" -#~ msgstr "Ouvre un fichier de liste de clés d'image" - -#~ msgid "Saves the current keyframe list" -#~ msgstr "Enregistre la liste de images clés active" - -#~ msgid "Reverse" -#~ msgstr "Inverser" - -#~ msgid "Collision: " -#~ msgstr "Collision :" - -#~ msgid "Aegisub was built without any font file listers enabled" -#~ msgstr "Aegisub a été compilé sans aucun listeur de polices activé" - -#~ msgid "Resulting duration: %d:%02d:%02d.%03d" -#~ msgstr "Durée résultante : %d:%02d:%02d.%03d" - -#~ msgid "Invalid fps or length value" -#~ msgstr "Valeur FPS ou longueur invalides" - -#~ msgid "Allow grid to take focus" -#~ msgstr "Permettre la grille de prendre focus" - -#~ msgid "File name" -#~ msgstr "Nom du fichier" - -#~ msgid "Left Margin (0 = default)" -#~ msgstr "Marge de gauche (0 = par défaut)" - -#~ msgid "Right Margin (0 = default)" -#~ msgstr "Marge de droite (0 = par défaut)" - -#~ msgid "Vertical Margin (0 = default)" -#~ msgstr "Marge verticale (0 = par défaut)" - -#~ msgid "Bold" -#~ msgstr "Gras" - -#~ msgid "Italics" -#~ msgstr "Italique" - -#~ msgid "Underline" -#~ msgstr "Souligné" - -#~ msgid "Strikeout" -#~ msgstr "Barré" - -#~ msgid "Primary color" -#~ msgstr "Couleur primaire" - -#~ msgid "Secondary color" -#~ msgstr "Couleur secondaire" - -#~ msgid "Outline color" -#~ msgstr "Couleur du contour" - -#~ msgid "Shadow color" -#~ msgstr "Couleur de l'ombre" - -#~ msgid "Commits the text (Enter)" -#~ msgstr "Accepte le texte (Entrée)" - -#~ msgid "MarginL change" -#~ msgstr "modification margeG" - -#~ msgid "MarginR change" -#~ msgstr "modification margeD" - -#~ msgid "MarginV change" -#~ msgstr "modification margeV" - -#~ msgid "Selection was set to %u lines" -#~ msgstr "La sélection a été fixée à %u lignes" - -#~ msgid "%u lines were added to selection" -#~ msgstr "%u lignes ont été ajoutées à la sélection" - -#~ msgid "%u lines were removed from selection" -#~ msgstr "%u lignes ont été retirées de la sélection" - -#~ msgid "%d fonts could not be found.\n" -#~ msgstr "%d polices sont absentes.\n" - -#~ msgid "%d fonts were found, but were missing glyphs used in the script.\n" -#~ msgstr "" -#~ "%d polices trouvées mais des glyphes utilisés dans le script sont " -#~ "absents.\n" - -#~ msgid "" -#~ "Collecting font data from system. This might take a while, depending on " -#~ "the number of fonts installed. Results are cached and subsequent " -#~ "executions will be faster...\n" -#~ msgstr "" -#~ "Collecte des données de polices du système. Cela peut durer un moment " -#~ "selon le nombre de polices installées. Les résultats seront mis en cache " -#~ "et les prochaines exécutions seront plus rapides...\n" - -#~ msgid "Done collecting font data.\n" -#~ msgstr "Collecte des données de polices achevée.\n" - -#~ msgid " Subtitle format handler: %s" -#~ msgstr " Format sous-titre : %s" - -#~ msgid "Update &Video" -#~ msgstr "Mise à jour &vidéo" - -#~ msgid "All rows" -#~ msgstr "Toutes les colonnes" - -#~ msgid "Selected rows" -#~ msgstr "Colonnes sélectionnées" - -#~ msgid "%i matches were replaced." -#~ msgstr "%i correspondances remplacées." - -#~ msgid "delete" -#~ msgstr "supprime" - -#~ msgid "Associate file types" -#~ msgstr "Types de fichiers associés" - -#~ msgid "" -#~ "Aegisub can take over the following file types.\n" -#~ "\n" -#~ "If you want Aegisub to no longer be associated with a file type, you must " -#~ "tell another program to take over the file type." -#~ msgstr "" -#~ "Aegisub peut gérer les types de fichiers suivants.\n" -#~ "\n" -#~ "Si vous ne désirez plus associer un type de fichier à Aegisub, vous devez " -#~ "demander à un autre logiciel de gérer le type de fichier." - -#~ msgid "" -#~ "Aegisub is already associated with all supported file types.\n" -#~ "\n" -#~ "If you want Aegisub to no longer be associated with a file type, you must " -#~ "tell another program to take over the file type." -#~ msgstr "" -#~ "Aegisub est déjà associé à tous les types de fichiers supportés.\n" -#~ "\n" -#~ "Si vous ne désirez plus associer un type de fichier à Aegisub, vous devez " -#~ "demander à un autre logiciel de gérer le type de fichier." - -#~ msgid "Make Aegisub default editor for subtitles?" -#~ msgstr "Faire d'Aegisub votre éditeur de sous-titres par défaut ?" - -#~ msgid "" -#~ "Aegisub is not your default editor for subtitle files. Do you want to " -#~ "make Aegisub your default editor for subtitle files?" -#~ msgstr "" -#~ "Aegisub n'est pas votre éditeur de sous-titres par défaut. Voulez-vous " -#~ "faire d'Aegisub votre éditeur de sous-titres par défaut ?" - -#~ msgid "Always perform this check when Aegisub starts" -#~ msgstr "Toujours faire cette vérification au démarrage d'Aegisub" - -#~ msgid "&Yes" -#~ msgstr "&Oui" - -#~ msgid "&No" -#~ msgstr "&Non" - -#~ msgid "" -#~ "You already have timecodes loaded. Would you like to replace them with " -#~ "timecodes from the video file?" -#~ msgstr "" -#~ "Vous avez déjà chargé des codes temps. Les remplacer par les codes temps " -#~ "du fichier ?" - -#~ msgid "Replace timecodes?" -#~ msgstr "Remplacer les codes de temps ?" - -#~ msgid "Set opacity, from 0 (opaque) to 255 (transparent)" -#~ msgstr "Réglage d'opacité, de 0 (opaque) à 255 (transparent)" - -#~ msgid "No subtitle providers available. Cannot preview subs." -#~ msgstr "Aucune source de sous-titres. Aperçu impossible." - -#~ msgid "Load audio" -#~ msgstr "Charger audio" - -#~ msgid "Reading into RAM" -#~ msgstr "Lecture en RAM" - -#~ msgid "Reading to Hard Disk cache" -#~ msgstr "Lecture en cache du disque dur" - -#~ msgid "&Change aspect ratio" -#~ msgstr "&Changer les proportions" - -#~ msgid "Select overlaps" -#~ msgstr "Sélectionner les recouvrements" - -#~ msgid "Select lines which begin while another non-comment line is active" -#~ msgstr "" -#~ "Sélection des lignes qui commencent alors qu'une autre ligne non " -#~ "commentée est active" - -#~ msgid "Clean Script Info" -#~ msgstr "Nettoyer les infos script" - -#~ msgid "" -#~ "Removes all but the absolutely required fields from the Script Info " -#~ "section. You might want to run this on files that you plan to distribute " -#~ "in original form." -#~ msgstr "" -#~ "Enlève tout sauf les champs indispensables de la section Info du script. " -#~ "Vous devriez effectuer ce nettoyage sur les fichiers que vous voulez " -#~ "distribuer en tant qu'originaux." - -#~ msgid "Seek bar" -#~ msgstr "Barre de recherche" - -#~ msgid "Play selection (%KEY%/%KEY%)" -#~ msgstr "Lire la sélection (%KEY%/%KEY%)" - -#~ msgid "Play current line (%KEY%)" -#~ msgstr "Lire la ligne courante (%KEY%)" - -#~ msgid "Stop (%KEY%)" -#~ msgstr "Arrêter (%KEY%)" - -#~ msgid "Add lead in (%KEY%)" -#~ msgstr "Ajoute un blanc de début (%KEY%)" - -#~ msgid "Add lead out (%KEY%)" -#~ msgstr "Ajoute un blanc de fin (%KEY%)" - -#~ msgid "Commit changes (%KEY%/%KEY%)" -#~ msgstr "Valide les modifications (%KEY%/%KEY%)" - -#~ msgid "Enable Medusa-Style Timing Shortcuts" -#~ msgstr "Activer les raccourcis temporels style Medusa" - -#~ msgid "Karaoke" -#~ msgstr "Karaoké" - -#~ msgid "Accept Split" -#~ msgstr "Accepter la division" - -#~ msgid "Commit splits and leave split-mode" -#~ msgstr "Valider les divisions et sortir du mode division" - -#~ msgid "Join" -#~ msgstr "Joindre" - -#~ msgid "Join selected syllables" -#~ msgstr "Joindre les syllabes sélectionnées" - -#~ msgid "Split" -#~ msgstr "Diviser" - -#~ msgid "Enter split-mode" -#~ msgstr "Entrer en mode division" - -#~ msgid "" -#~ "Do you want to commit your changes? If you choose No, they will be " -#~ "discarded." -#~ msgstr "" -#~ "Voulez-vous valider vos modifications ? Si vous refusez, elles seront " -#~ "rejetées." - -#~ msgid "Commit?" -#~ msgstr "Valider ?" - -#~ msgid "Script completed" -#~ msgstr "Script achevé" - -#~ msgid "Not enough parameters for Aegisub::text_extents()" -#~ msgstr "Pas assez de paramètres pour Aegisub:text_extents()" - -#~ msgid "" -#~ "Tried to register PerlConsole, but support for it was disabled in this " -#~ "version." -#~ msgstr "" -#~ "Tentative d'enregistrer PerlConsole, mais le support en a été désactivé " -#~ "dans cette version." - -#~ msgid "Fatal error: " -#~ msgstr "Erreur critique :" - -#~ msgid "Error: " -#~ msgstr "Erreur :" - -#~ msgid "Warning: " -#~ msgstr "Avertissement :" - -#~ msgid "Hint: " -#~ msgstr "Conseil :" - -#~ msgid "Debug: " -#~ msgstr "Débogage :" - -#~ msgid "Trace: " -#~ msgstr "Trace :" - -#~ msgid "Executing " -#~ msgstr "Exécution" - -#~ msgid "Perl script" -#~ msgstr "Script Perl" - -#~ msgid "" -#~ "Unable to add the automation include path(s) to @INC: the script's code " -#~ "may not compile or execute properly." -#~ msgstr "" -#~ "Impossible d'ajouter l'automatisme ni le(s) chemin(s) à @INC : le code du " -#~ "script ne peut se compiler ou s'exécuter correctement." - -#~ msgid "Reloading %s because the file on disk (%s) changed." -#~ msgstr "Rechargement de %s car le fichier sur le disque (%s) a été modifié." - -#~ msgid "Saving changes" -#~ msgstr "Enregistrement des modifications" - -#~ msgid "Colour Picker" -#~ msgstr "Pipette :" - -#~ msgid "Select all" -#~ msgstr "Sélectionner tout" - -#~ msgid "Attach fonts to current subtitles" -#~ msgstr "Joindre les polices aux sous-titres actuels" - -#~ msgid "DEBUG: Verify all fonts in system" -#~ msgstr "Débug : vérifier les polices du système" - -#~ msgid "Zip Archives (*.zip)|*.zip" -#~ msgstr "Archives Zip (*.zip)|*.zip" - -#~ msgid "Invalid destination directory." -#~ msgstr "Répertoire de destination invalide." - -#~ msgid "Scanning file for fonts..." -#~ msgstr "Recherche des polices du fichier... " - -#~ msgid "Checking fonts...\n" -#~ msgstr "Analyse des polices...\n" - -#~ msgid "" -#~ "\n" -#~ "Finished writing to %s.\n" -#~ msgstr "" -#~ "\n" -#~ "Fin d'écriture vers %s.\n" - -#~ msgid "font attachment" -#~ msgstr "affectation des polices" - -#~ msgid "Not found.\n" -#~ msgstr "Introuvable.\n" - -#~ msgid "Found.\n" -#~ msgstr "Trouvé.\n" - -#~ msgid "\"%s\" found on style \"%s\".\n" -#~ msgstr "« %s » trouvée dans la feuille de style « %s ».\n" - -#~ msgid "\"%s\" found on dialogue line \"%d\".\n" -#~ msgstr "« %s » trouvée sur ligne dialogue « %d ».\n" - -#~ msgid "\"%s\" found.\n" -#~ msgstr "« %s » trouvée.\n" - -#~ msgid "Source Style" -#~ msgstr "Style source" - -#~ msgid "Dest Style" -#~ msgstr "Style cible" - -#~ msgid "Startup" -#~ msgstr "Démarrage" - -#~ msgid "Check File Associations on Start" -#~ msgstr "Vérifier l'association des fichiers au démarrage" - -#~ msgid "Limits for levels and recent files" -#~ msgstr "Limite des niveaux et des fichiers récents" - -#~ msgid "Maximum recent timecode files" -#~ msgstr "Maximum des fichiers chrono récents" - -#~ msgid "Maximum recent keyframe files" -#~ msgstr "Maximum de fichiers images clés récents" - -#~ msgid "Maximum recent subtitle files" -#~ msgstr "Maximum de fichiers sous-titres récents" - -#~ msgid "Maximum recent video files" -#~ msgstr "Maximum de fichiers vidéo récents" - -#~ msgid "Maximum recent audio files" -#~ msgstr "Maximum de fichiers audio récents" - -#~ msgid "Maximum recent find strings" -#~ msgstr "Maximum de chaînes trouvées récentes" - -#~ msgid "Maximum recent replace strings" -#~ msgstr "Maximum de chaînes remplacées récentes" - -#~ msgid "Auto-save" -#~ msgstr "Enregistrement automatique" - -#~ msgid "File paths" -#~ msgstr "Chemins d'accès aux fichiers" - -#~ msgid "Miscellanea" -#~ msgstr "Divers" - -#~ msgid "seconds." -#~ msgstr "secondes." - -#~ msgid "Auto-save path:" -#~ msgstr "Chemin d'accès enregistrement auto :" - -#~ msgid "Auto-backup path:" -#~ msgstr "Chemin d'accès sauvegarde auto :" - -#~ msgid "Crash recovery path:" -#~ msgstr "Chemin d'accès restauration crash :" - -#~ msgid "Link commiting of times" -#~ msgstr "Lier validation des temps" - -#~ msgid "Path to dictionary files:" -#~ msgstr "Chemin des fichiers dictionnaires :" - -#~ msgid "Modified Background" -#~ msgstr "Arrière-plan modifié" - -#~ msgid "Syntax highlighter - " -#~ msgstr "Mise en valeur syntaxique -" - -#~ msgid "Font: " -#~ msgstr "Police :" - -#~ msgid "Highlight subtitles that are currently visible in video" -#~ msgstr "Mise en valeur des sous-titres visibles dans la vidéo" - -#~ msgid "Header" -#~ msgstr "Têtière" - -#~ msgid "Replace override tags with: " -#~ msgstr "Remplacer les balises superposées par :" - -#~ msgid "Advanced - EXPERT USERS ONLY" -#~ msgstr "Avancé - RÉSERVÉ AUX EXPERTS" - -#~ msgid "Grab times from line upon selection" -#~ msgstr "Coller les temps de la ligne au-dessus de la sélection" - -#~ msgid "Snap to adjacent lines" -#~ msgstr "Coller aux lignes adjacentes" - -#~ msgid "Draw secondary lines" -#~ msgstr "Dessiner les lignes secondaires" - -#~ msgid "Draw selection background" -#~ msgstr "Dessiner l'arrière-plan de sélection" - -#~ msgid "Draw timeline" -#~ msgstr "Dessiner la ligne de temps" - -#~ msgid "Draw keyframes" -#~ msgstr "Dessiner les images clés" - -#~ msgid "Selection background - modified" -#~ msgstr "Arrière-plan sélection - modifié" - -#~ msgid "Waveform - selection" -#~ msgstr "Forme d'onde - sélection" - -#~ msgid "Waveform - modified" -#~ msgstr "Forme d'onde - modifiée" - -#~ msgid "Waveform - inactive" -#~ msgstr "Forme d'onde - inactive" - -#~ msgid "Syllable text" -#~ msgstr "Texte syllabe" - -#~ msgid "HD cache name" -#~ msgstr "Nom cache DD" - -#~ msgid "Spectrum cutoff" -#~ msgstr "Limite spectrale" - -#~ msgid "Function" -#~ msgstr "Fonction" - -#~ msgid "Key" -#~ msgstr "Touche" - -#~ msgid "Set Hotkey..." -#~ msgstr "Régler les raccourcis clavier..." - -#~ msgid "Clear Hotkey" -#~ msgstr "Supprimer les raccourcis clavier" - -#~ msgid "Default All" -#~ msgstr "Tout par défaut" - -#~ msgid "File save/load" -#~ msgstr "Enregistrement/chargement fichier" - -#~ msgid "Aegisub must restart for the changes to take effect. Restart now?" -#~ msgstr "" -#~ "Aegisub doit être relancé pour appliquer les modifications. Redémarrage ?" - -#~ msgid "Restart Aegisub" -#~ msgstr "Redémarrage d'Aegisub" - -#~ msgid "Press Key" -#~ msgstr "Presser une touche" - -#~ msgid "Press key to bind to \"%s\" or Esc to cancel." -#~ msgstr "Presser une touche pour lier à « %s » ou Echap. pour annuler." - -#~ msgid "" -#~ "The hotkey %s is already mapped to %s. If you proceed, that hotkey will " -#~ "be cleared. Proceed?" -#~ msgstr "" -#~ "Le raccourci %s est déjà lié à %s. Si vous continuez, ce raccourci sera " -#~ "supprimé. Continuer ?" - -#~ msgid "Hotkey conflict" -#~ msgstr "Conflit de raccourcis" - -#~ msgid "Margin Top" -#~ msgstr "Marge de tête" - -#~ msgid "Margin Bottom" -#~ msgstr "Marge de pied" - -#~ msgid "All" -#~ msgstr "Tout" - -#~ msgid "" -#~ "Invalid resolution: destination resolution cannot be 0 on either " -#~ "dimension." -#~ msgstr "" -#~ "Résolution invalide : la résolution sible ne peut être 0 dans aucun sens." - -#~ msgid "History" -#~ msgstr "Historique" - -#~ msgid "s, " -#~ msgstr "s," - -#~ msgid "e, " -#~ msgstr "e," - -#~ msgid "original" -#~ msgstr "original" - -#~ msgid "replace with" -#~ msgstr "remplacer par" - -#~ msgid "Replace All" -#~ msgstr "Tout remplacer" - -#~ msgid "" -#~ "You have chosen to use the \"Comic Sans\" font. As the programmer and a " -#~ "typesetter,\n" -#~ "I must urge you to reconsider. Comic Sans is the most abused font in the " -#~ "history\n" -#~ "of computing, so please avoid using it unless it's REALLY suitable. " -#~ "Thanks." -#~ msgstr "" -#~ "Vous avez choisi d'utiliser la police « Comic Sans ». En tant que " -#~ "programmeur et typographe,\n" -#~ "je vous conseille de reconsidérer votre choix, Comic Sans étant la police " -#~ "la plus abusée\n" -#~ "de l'histoire informatique, donc à proscrire sauf si elle est VRAIMENT " -#~ "adaptée. Merci." - -#~ msgid "Warning" -#~ msgstr "Avertissement" - -#~ msgid "Copy of " -#~ msgstr "Copie de " - -#~ msgid "Are you sure you want to delete these " -#~ msgstr "Êtes-vous sûr de vouloir supprimer ces " - -#~ msgid " styles?" -#~ msgstr " styles ?" - -#~ msgid "Styling assistant" -#~ msgstr "Assistant des styles" - -#~ msgid "Enable preview (slow)" -#~ msgstr "Afficher l'aperçu (lent)" - -#~ msgid "style changes" -#~ msgstr "modifications du style" - -#~ msgid "Threshold:" -#~ msgstr "Seuil :" - -#~ msgid "" -#~ "Aegisub can export subtitles to many different formats, character " -#~ "encodings, and even compensate Variable Frame Rate so you can hardsub " -#~ "them - it's all in the Export option in File menu." -#~ msgstr "" -#~ "Aegisub peut exporter les sous-titres dans de nombreux formats, encodages " -#~ "de caractères et même compenser le Variable Frame Rate (taux de " -#~ "défilement variable) afin de pouvoir les encoder. Tout est dans Options " -#~ "d'exportation dans le menu Fichier." - -#~ msgid "" -#~ "You can easily translate subtitle files using the translation assistant." -#~ msgstr "" -#~ "Vous pouvez facilement traduire des fichiers de sous-titres en utilisant " -#~ "l'assistant de traduction." - -#~ msgid "" -#~ "Styles can be stored in different storages, so that you can keep your " -#~ "projects organized." -#~ msgstr "" -#~ "Les styles peuvent être stockés dans différents stocks, vous pouvez ainsi " -#~ "garder vos projets organisés." - -#~ msgid "" -#~ "Use keyboard shortcuts! They make your life easier, for example, Ctrl" -#~ "+Enter updates changes on current line without going to next. Check the " -#~ "manual for a complete list." -#~ msgstr "" -#~ "Utilisez les raccourcis clavier ! Ils vous faciliteront la vie, par " -#~ "exemple, Ctrl+Entrée met à jour les modifications de la ligne active sans " -#~ "passer à la suivante. Consultez le manuel pour ue liste complète." - -#~ msgid "" -#~ "There is no reason to use the SSA format (as opposed to ASS). ASS is very " -#~ "similar, but adds some important functionality. Most importantly, " -#~ "however, is that only ASS supports certain override tags (such as \\pos " -#~ "and \\t). Those only work on SSA files because VSFilter/Textsub is " -#~ "merciful." -#~ msgstr "" -#~ "ll n'y a pas de raison d'utiliser le format SSA (opposé au ASS). ASS est " -#~ "très similaire, mais il ajoute quelques fonctions importantes. Le plus " -#~ "important, cependant, est que seul ASS supporte certaines balises de " -#~ "placement (comme \\pos et \\t). Elles ne fonctionnent qu'avec des " -#~ "fichiers SSA car VSFilter/Textsub est clément." - -#~ msgid "DON'T PANIC!" -#~ msgstr "NE PANIQUEZ PAS !" - -#~ msgid "" -#~ "Aegisub has several features to make sure you will never lose your work. " -#~ "It will periodically save your subtitles to autosave folder, and will " -#~ "create a copy of subs whenever you open them, to autoback folder. Also, " -#~ "if it crashes, it will attempt to save a restore file." -#~ msgstr "" -#~ "Aegisub a plusieurs fonctions pour vous assurer de ne jamais perdre votre " -#~ "travail. Il enregistrera périodiquement vos sous-titres dans son dossier " -#~ "d'enregistrement automatique et créera une copie des sous-titres si vous " -#~ "deviez les ouvrir, dans son dossier de sauvegarde. De même, s'il plante, " -#~ "il essaiera d'enregistrer un fichier de restauration." - -#~ msgid "" -#~ "The styling assistant is a practical way to set styles to each line, when " -#~ "each actor has a different style assigned to it." -#~ msgstr "" -#~ "L'assistant de styles est une façon pratique d'appliquer des styles à " -#~ "chaque ligne, lorsque chaque acteur a un style différent." - -#~ msgid "" -#~ "The fonts collector is one of the most useful features, which resumes the " -#~ "boring task of hunting down fonts into a matter of a few clicks." -#~ msgstr "" -#~ "Le collecteur de polices est l'une des fonctions les plus utiles " -#~ "puisqu'elle réduit la fastidieuse tâche de la collecte des polices à " -#~ "quelques clics." - -#~ msgid "" -#~ "When you are done with your subtitles and ready to distribute them, " -#~ "remember: say no to MP4, OGM or AVI. Matroska is your friend." -#~ msgstr "" -#~ "Lorsque vos sous-titres sont terminés et prêts à être diffusés, rappelez-" -#~ "vous : dites non à MP4, OGM ou AVI. Mastroska est votre ami." - -#~ msgid "" -#~ "Much like anything loaded via DirectShow, certain files may have a " -#~ "strange structure (such as h.264 into AVI or XviD will null frames) which " -#~ "may cause unreliable seeking (that is, video frames might be off by one " -#~ "frame). This is not an Aegisub bug - you may consider reencoding those " -#~ "videos before working with them." -#~ msgstr "" -#~ "Comme tout ce qui est chargé par DirectShow, certains fichiers peuvent " -#~ "avoir une structure bizarre (comme du h.264 en AVI ou du XviD avec null " -#~ "frames) causant un affichage inexploitable (tel les images vidéo décalées " -#~ "d'une image). Ce n'est pas un bogue d'Aegisub - il vous faudra réencoder " -#~ "ces fichiers avant de travailler avec." - -#~ msgid "" -#~ "Try the spectrum mode for the audio display, it can make it much easier " -#~ "to spot where the important points in the audio are." -#~ msgstr "" -#~ "Essayez le mode spectral pour l'affichage audio, il peut vous aider à " -#~ "visualiser plus facilement les points importants de la bande son." - -#~ msgid "" -#~ "If you decode your audio to a PCM WAV file before loading it in Aegisub, " -#~ "you don't have to wait for it to be decoded before you can use it." -#~ msgstr "" -#~ "Si vous décodez votre bande son en un fichier PCM WA avant de le charger " -#~ "dans Aegisub, vous n'aurez pas à attendre après son décodage pour " -#~ "l'utiliser." - -#~ msgid "" -#~ "Having video open is often more a nuisance than a help when timing " -#~ "subtitles. Timing with only audio open is often much easier. You can " -#~ "always adjust the subtitles to match the video later on." -#~ msgstr "" -#~ "Avoir la vidéo ouverte est plus une source d'ennuis qu'une aide à la " -#~ "synchronisation des sous-titres. La synchro avec la seule bande son est " -#~ "plus facile. Vous pourrez toujours ajuster les sous-titres à la vidéo " -#~ "plus tard." - -#~ msgid "" -#~ "If the audio doesn't seem to work properly during video playback, try " -#~ "loading audio separately. Just select Audio->Load from video, that " -#~ "usually makes the audio much more reliable." -#~ msgstr "" -#~ "Si la bande son ne semble pas fonctionner correctement durant la lecture " -#~ "vidéo, essayez de charger le son séparément. Allez sur Audio -> Charger " -#~ "depuis la vidéo, ce qui rendra la bande son plus fiable." - -#~ msgid "If anything goes wrong, blame movax." -#~ msgstr "Si quelque chose va mal, blâmez-en movax." - -#~ msgid "Current line: ?" -#~ msgstr "Ligne active : ?" - -#~ msgid "From Video" -#~ msgstr "Depuis la vidéo" - -#~ msgid "video" -#~ msgstr "vidéo" - -#~ msgid "audio" -#~ msgstr "audio" - -#~ msgid "Save" -#~ msgstr "Enregistrer" - -#~ msgid "Save subtitles" -#~ msgstr "Enregistrer les sous-titres" - -#~ msgid "Jump To..." -#~ msgstr "Aller à..." - -#~ msgid "Jump video to time/frame" -#~ msgstr "Avancer au temps/image de la vidéo" - -#~ msgid "Jump video to end" -#~ msgstr "Aller à la fin de la vidéo" - -#~ msgid "Snap start to video" -#~ msgstr "Coller au départ de la vidéo" - -#~ msgid "Snap subtitles to scene" -#~ msgstr "Coller les sous-titres à la scène" - -#~ msgid "Snap selected subtitles so they match current scene start/end" -#~ msgstr "" -#~ "Colle les sous-titres sélectionnés aux début et fin de la scène active" - -#~ msgid "Shift subtitles to frame" -#~ msgstr "Décalage de sous-titres à l'image" - -#~ msgid "Shift selected subtitles so first selected starts at this frame" -#~ msgstr "" -#~ "Décale les sous-titres sélectionnés au premier départ sélectionné de " -#~ "l'image" - -#~ msgid "Open Styles Manager" -#~ msgstr "Ouvrir le gestionnaire de styles" - -#~ msgid "Open Attachment List" -#~ msgstr "Ouvrir la liste des accessoires" - -#~ msgid "Open Fonts Collector" -#~ msgstr "Ouvrir le collecteur de polices" - -#~ msgid "Open Shift Times Dialogue" -#~ msgstr "Ouvrir le dialogue de décalage temporel" - -#~ msgid "Open Styling Assistant" -#~ msgstr "Ouvrir l'assistant de styles" - -#~ msgid "Open Translation Assistant" -#~ msgstr "Ouvrir l'assistant à la traduction" - -#~ msgid "Resample" -#~ msgstr "Rééchantillonnage" - -#~ msgid "Open Timing Post-processor dialog" -#~ msgstr "Ouvrir le dialogue du postprocesseur temporel" - -#~ msgid "Open Kanji Timer dialog" -#~ msgstr "Ouvrir le dialogue du chrono kanji" - -#~ msgid "Open Spell checker" -#~ msgstr "Ouvrir le correcteur orthographique" - -#~ msgid "Sort by Time" -#~ msgstr "Tri par temps" - -#~ msgid "&Automation" -#~ msgstr "&Automatisme" - -#~ msgid "&Associations..." -#~ msgstr "&Associations..." - -#~ msgid "Associate file types with Aegisub" -#~ msgstr "Associe les types de fichiers à Aegisub" - -#~ msgid "Open log window" -#~ msgstr "Ouvre la fenêtre d'historique" - -#~ msgid "Resource files distributed with Aegisub" -#~ msgstr "Fichiers de ressources distribués avec Aegisub" - -#~ msgid "Save before continuing?" -#~ msgstr "Enregistrer avant de continuer ?" - -#~ msgid "You have timecodes loaded currently. Would you like to unload them?" -#~ msgstr "" -#~ "Vous avez des codes temporels actuellement chargés. Voulez-vous les " -#~ "décharger ?" - -#~ msgid "Unload timecodes?" -#~ msgstr "Décharger les codes temps ?" - -#~ msgid "All files" -#~ msgstr "Tous fichiers" - -#~ msgid "Open audio file" -#~ msgstr "Ouvrir un fichier audio" - -#~ msgid "All Supported Types" -#~ msgstr "Tout type supporté" - -#~ msgid "Save timecodes file" -#~ msgstr "Enregistrer le fichier de codes temps" - -#~ msgid "show full tags." -#~ msgstr "affichage complet des balises." - -#~ msgid "Help" -#~ msgstr "Aide" - -#~ msgid "Cut" -#~ msgstr "Couper" - -#~ msgid "Paste" -#~ msgstr "Coller" - -#~ msgid "Paste Over" -#~ msgstr "Coller sur" - -#~ msgid "Video Jump" -#~ msgstr "Saut vidéo" - -#~ msgid "Set Start to Video" -#~ msgstr "Régler sur début de la vidéo" - -#~ msgid "Set End to Video" -#~ msgstr "Régler sur fin de la vidéo" - -#~ msgid "Shift by Current Time" -#~ msgstr "Décaler du temps actif" - -#~ msgid "Zoom 50%" -#~ msgstr "Zoom 50 %" - -#~ msgid "Video global prev frame" -#~ msgstr "Image précédente vidéo globale" - -#~ msgid "Video global focus seek" -#~ msgstr "Recherche point sur vidéo globale" - -#~ msgid "Video global play" -#~ msgstr "Lecture vidéo globale" - -#~ msgid "Grid global prev line" -#~ msgstr "Ligne précédente sur grille globale" - -#~ msgid "Grid global next line" -#~ msgstr "Ligne suivante sur grille globale" - -#~ msgid "Save Subtitles Alt" -#~ msgstr "Enregistrement alteratif des sous-titres" - -#~ msgid "Video global zoom in" -#~ msgstr "Zoom avant vidéo globale" - -#~ msgid "Video global zoom out" -#~ msgstr "Zoom arrière vidéo globale" - -#~ msgid "Grid move row down" -#~ msgstr "Grille déplacer rangée vers le bas" - -#~ msgid "Grid move row up" -#~ msgstr "Grille déplacer rangée vers le haut" - -#~ msgid "Grid delete rows" -#~ msgstr "Grille suppression rangées" - -#~ msgid "Grid duplicate rows" -#~ msgstr "Grille duplication rangées" - -#~ msgid "Grid duplicate and shift one frame" -#~ msgstr "Grille dupliquer et décaler une image" - -#~ msgid "Audio Commit Alt" -#~ msgstr "Audio Validation alt." - -#~ msgid "Audio Commit" -#~ msgstr "Audio validation" - -#~ msgid "Audio Commit (Stay)" -#~ msgstr "Audio validation (rester)" - -#~ msgid "Audio Prev Line" -#~ msgstr "Audio ligne précédente" - -#~ msgid "Audio Prev Line Alt" -#~ msgstr "Audio Ligne précédente alt." - -#~ msgid "Audio Next Line" -#~ msgstr "Audio Ligne suivante" - -#~ msgid "Audio Next Line Alt" -#~ msgstr "Audio Ligne suivante alt." - -#~ msgid "Audio Play" -#~ msgstr "Audio Lecture" - -#~ msgid "Audio Play Alt" -#~ msgstr "Audio Lecture alt." - -#~ msgid "Audio Play or Stop" -#~ msgstr "Audio Lecture ou arrêt" - -#~ msgid "Audio Stop" -#~ msgstr "Audio Arrêt" - -#~ msgid "Audio Karaoke Increase Len" -#~ msgstr "Audio Augmenter longueur karaoké" - -#~ msgid "Audio Karaoke Decrease Len" -#~ msgstr "Audio Réduire longueur karaoké" - -#~ msgid "Audio Karaoke Increase Len Shift" -#~ msgstr "Audio Augmenter décalage longeur karaoké" - -#~ msgid "Audio Karaoke Decrease Len Shift" -#~ msgstr "Audio Réduire décalage longueur karaoké" - -#~ msgid "Audio Play First 500ms" -#~ msgstr "Audio Lire premiers 500 ms" - -#~ msgid "Audio Play Last 500ms" -#~ msgstr "Audio Lire derniers 500 ms" - -#~ msgid "Audio Play 500ms Before" -#~ msgstr "Audio Lire 500 ms avant" - -#~ msgid "Audio Play 500ms After" -#~ msgstr "Audio Lire 500 ms après" - -#~ msgid "Audio Play To End" -#~ msgstr "Audio Lire jusqu'à la fin" - -#~ msgid "Audio Play Original Line" -#~ msgstr "Audio Lire ligne d'origine" - -#~ msgid "Audio Add Lead In" -#~ msgstr "Audio Ajout blanc de début" - -#~ msgid "Audio Add Lead Out" -#~ msgstr "Audio Ajout blanc de fin" - -#~ msgid "Audio Medusa Toggle" -#~ msgstr "Audio Medusa Bascule" - -#~ msgid "Audio Medusa Play" -#~ msgstr "Audio Medusa Lecture" - -#~ msgid "Audio Medusa Stop" -#~ msgstr "Audio Medusa Arrêt" - -#~ msgid "Audio Medusa Shift Start Back" -#~ msgstr "Audio Medusa Décale le début en arrière" - -#~ msgid "Audio Medusa Shift Start Forward" -#~ msgstr "Audio Medusa Décale le début en avant" - -#~ msgid "Audio Medusa Shift End Back" -#~ msgstr "Audio Medusa Décale la fin en arrière" - -#~ msgid "Audio Medusa Shift End Forward" -#~ msgstr "Audio Medusa Décale la fin en avant" - -#~ msgid "Audio Medusa Play Before" -#~ msgstr "Audio Medusa Lecture avant" - -#~ msgid "Audio Medusa Play After" -#~ msgstr "Audio Medusa Lecture après" - -#~ msgid "Audio Medusa Next" -#~ msgstr "Audio Medusa Suivant" - -#~ msgid "Audio Medusa Previous" -#~ msgstr "Audio Medusa Précédet" - -#~ msgid "Audio Medusa Enter" -#~ msgstr "Audio Medusa Entrée" - -#~ msgid "Translation Assistant Play Audio" -#~ msgstr "Assistant de traduction Lecture audio" - -#~ msgid "Translation Assistant Play Video" -#~ msgstr "Assistant de traduction Lecture vidéo" - -#~ msgid "Translation Assistant Next" -#~ msgstr "Assistant de traduction Suivant" - -#~ msgid "Translation Assistant Prev" -#~ msgstr "Assistant de traduction Précédent" - -#~ msgid "Translation Assistant Accept" -#~ msgstr "Assistant de traduction Accepter" - -#~ msgid "Translation Assistant Preview" -#~ msgstr "Assistant de traduction Aperçu" - -#~ msgid "Translation Assistant Insert Original" -#~ msgstr "Assistant de traduction Original" - -#~ msgid "Styling Assistant Play Audio" -#~ msgstr "Assistant de styles Lecture audio" - -#~ msgid "Styling Assistant Play Video" -#~ msgstr "Assistant de styles Lecture vidéo" - -#~ msgid "Styling Assistant Next" -#~ msgstr "Assistant de styles Suivant" - -#~ msgid "Styling Assistant Prev" -#~ msgstr "Assistant de styles Précédent" - -#~ msgid "Styling Assistant Accept" -#~ msgstr "Assistant de styles Accepter" - -#~ msgid "Styling Assistant Preview" -#~ msgstr "Assistant de styles Aperçu" - -#~ msgid "Load keyframes" -#~ msgstr "Charger des codes temps" - -#~ msgid "Reading keyframes from video" -#~ msgstr "Lecture des codes temps de la vidéo" - -#~ msgid "Reading keyframe and timecode data from Matroska file." -#~ msgstr "" -#~ "Lecture des données d'images clés et de codes temps d'u fichier Matroska." - -#~ msgid "" -#~ "Configuration file is either invalid or corrupt. The current file will be " -#~ "backed up and replaced with a default file." -#~ msgstr "" -#~ "Le fichier de configuration est invalide ou corrompu. Le fichier actif " -#~ "sera sauvegardé et remplacé par un fichier de base." - -#~ msgid "Font Face Name" -#~ msgstr "Nom de la police" - -#~ msgid "Commits the text (Enter). Hold Ctrl to stay in line (%KEY%)." -#~ msgstr "" -#~ "Accepte le texte (Entrée). Maintenez Control pour rester sur la ligne " -#~ "(%KEY%)." - -#~ msgid "Time" -#~ msgstr "Temps" - -#~ msgid "editing" -#~ msgstr "édition" - -#~ msgid "&Duplicate" -#~ msgstr "&Dupliquer" - -#~ msgid "&Duplicate and shift by 1 frame" -#~ msgstr "&Dupliquer et décaler d'une image" - -#~ msgid "Split (by karaoke)" -#~ msgstr "Diviser (en karaoké)" - -#~ msgid "&Swap" -#~ msgstr "Inver&ser" - -#~ msgid "" -#~ "Joins selected lines in a single one, making each line into a karaoke " -#~ "syllable" -#~ msgstr "" -#~ "Joint les lignes sélectionnées en une seule, découpant chaque ligne en " -#~ "syllabes karaoké" - -#~ msgid "C&ut" -#~ msgstr "Co&uper" - -#~ msgid "Cuts selected lines to clipboard" -#~ msgstr "Coupe les lignes sélectionnées et les mets dans le presse-papier" - -#~ msgid "Paste lines from clipboard" -#~ msgstr "Colle les lignes depuis le presse-papier" - -#~ msgid "The starting point is beyond the length of the audio loaded." -#~ msgstr "Le point de départ est au-delà de la longueur de l'audio chargée." - -#~ msgid "There is no audio to save." -#~ msgstr "Aucune audio à enregistrer." - -#~ msgid "Couldn't allocate memory." -#~ msgstr "Impossible d'allouer la mémoire." - -#~ msgid "load" -#~ msgstr "charge" - -#~ msgid "Please wait, caching fonts..." -#~ msgstr "Patientez, mise des polices en cache..." - -#~ msgid "Exporting PRS" -#~ msgstr "Exportation PRS" - -#~ msgid "No timecodes to average" -#~ msgstr "Aucun code temps pour faire la moyenne " - -#~ msgid "Realtime" -#~ msgstr "Temps réel" - -#~ msgid "Toggle realtime display of changes." -#~ msgstr "Basculer l'affichage des modifications en temps réel." - -#~ msgid "Unknown" -#~ msgstr "Inconnu" - -#~ msgid "" -#~ "You already have timecodes loaded. Replace them with the timecodes from " -#~ "the Matroska file?" -#~ msgstr "" -#~ "Vous avez déjà chargé des codes temps. Les remplacer par les codes temps " -#~ "du fichier Matroska ?" +"Ceci installera Aegisub {#BUILD_GIT_VERSION_STRING} sur votre ordinateur.%n%nAegisub est " +"couvert par la GNU General Public License version 2. Cela signifie que vous pouvez utiliser " +"l'application pour n'importe quel but, sans frais, mais qu'aucune garantie n'est donnée.%n" +"%Veuillez visiter le site d'Aegisub pour l'obtention du code source." From 28e3e75c44d39f54693b3418728a7289d3265e86 Mon Sep 17 00:00:00 2001 From: clr134 <84683174+clr134@users.noreply.github.com> Date: Sun, 23 May 2021 23:33:04 +0200 Subject: [PATCH 263/271] Polish translation corrections (#130) --- po/pl.po | 743 ++++++++++++++++++++----------------------------------- 1 file changed, 264 insertions(+), 479 deletions(-) diff --git a/po/pl.po b/po/pl.po index c3829aafb..61d1b74fb 100644 --- a/po/pl.po +++ b/po/pl.po @@ -3,22 +3,20 @@ msgstr "" "Project-Id-Version: Aegisub\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-06-04 01:20+0200\n" -"PO-Revision-Date: 2011-06-18 19:24+0100\n" -"Last-Translator: Invi \n" +"PO-Revision-Date: 2021-05-23 22:24+0200\n" +"Last-Translator: clr134\n" "Language-Team: Invi \n" -"Language: \n" +"Language: pl_PL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Poedit-Language: Polish\n" -"X-Poedit-Country: POLAND\n" +"X-Generator: Poedit 2.4.3\n" #: ass_style.cpp:575 msgid "ANSI" msgstr "ANSI" -#: ass_style.cpp:576 -#: dialog_options.cpp:602 +#: ass_style.cpp:576 dialog_options.cpp:602 msgid "Default" msgstr "Domyślny" @@ -226,13 +224,11 @@ msgstr "Podziel" msgid "Enter split-mode" msgstr "Włącza tryb dzielenia" -#: audio_display.cpp:2294 -#: audio_display.cpp:2349 +#: audio_display.cpp:2294 audio_display.cpp:2349 msgid "Do you want to commit your changes? If you choose No, they will be discarded." msgstr "Czy chcesz zatwierdzić zmiany? Jeśli wybierzesz Nie, zostaną on utracone." -#: audio_display.cpp:2294 -#: audio_display.cpp:2349 +#: audio_display.cpp:2294 audio_display.cpp:2349 msgid "Commit?" msgstr "Zatwierdzić?" @@ -260,8 +256,7 @@ msgstr "Załaduj audio" msgid "Reading into RAM" msgstr "Wczytywanie do pamięci" -#: auto4_base.cpp:401 -#: dialog_kanji_timer.cpp:737 +#: auto4_base.cpp:401 dialog_kanji_timer.cpp:737 msgid "Close" msgstr "Zamknij" @@ -272,7 +267,7 @@ msgstr "Skrypt wykonany" #: auto4_base.cpp:755 #, c-format msgid "An Automation script failed to load. File name: '%s', error reported:" -msgstr "Plik automatyzacji się nie załadował. Plik: '%s', zgłoszony błąd:" +msgstr "Plik automatyzacji się nie załadował. Plik: '%s', zgłoszony błąd:" #: auto4_base.cpp:768 #, c-format @@ -293,19 +288,19 @@ msgstr "Próbowano zarejestrować PerlConsole*, ale wsparcie dla niej zostało w #: auto4_perl.cpp:383 msgid "Fatal error: " -msgstr "Błąd krytyczny:" +msgstr "Błąd krytyczny: " #: auto4_perl.cpp:385 msgid "Error: " -msgstr "Błąd:" +msgstr "Błąd: " #: auto4_perl.cpp:387 msgid "Warning: " -msgstr "Ostrzeżenie:" +msgstr "Ostrzeżenie: " #: auto4_perl.cpp:389 msgid "Hint: " -msgstr "Wskazówka:" +msgstr "Wskazówka: " #: auto4_perl.cpp:391 msgid "Debug: " @@ -313,11 +308,11 @@ msgstr "Debug: " #: auto4_perl.cpp:393 msgid "Trace: " -msgstr "Ślad*:" +msgstr "Ślad: " #: auto4_perl_dialogs.cpp:60 msgid "Executing " -msgstr "Wykonywanie" +msgstr "Wykonywanie " #: auto4_perl_script.cpp:99 msgid "Perl script" @@ -344,68 +339,44 @@ msgstr "#" msgid "L" msgstr "W" -#: base_grid.cpp:436 -#: subs_grid.cpp:120 +#: base_grid.cpp:436 subs_grid.cpp:120 msgid "Start" msgstr "Start" -#: base_grid.cpp:437 -#: subs_grid.cpp:121 +#: base_grid.cpp:437 subs_grid.cpp:121 msgid "End" msgstr "Koniec" -#: base_grid.cpp:438 -#: dialog_options.cpp:213 -#: dialog_options.cpp:284 -#: dialog_options.cpp:470 -#: dialog_paste_over.cpp:68 -#: dialog_search_replace.cpp:96 -#: dialog_selection.cpp:78 -#: subs_grid.cpp:122 +#: base_grid.cpp:438 dialog_options.cpp:213 dialog_options.cpp:284 +#: dialog_options.cpp:470 dialog_paste_over.cpp:68 dialog_search_replace.cpp:96 +#: dialog_selection.cpp:78 subs_grid.cpp:122 msgid "Style" msgstr "Styl" -#: base_grid.cpp:439 -#: dialog_paste_over.cpp:69 -#: dialog_search_replace.cpp:97 -#: dialog_selection.cpp:79 -#: subs_edit_box.cpp:90 -#: subs_grid.cpp:123 +#: base_grid.cpp:439 dialog_paste_over.cpp:69 dialog_search_replace.cpp:97 +#: dialog_selection.cpp:79 subs_edit_box.cpp:90 subs_grid.cpp:123 msgid "Actor" msgstr "Aktor" -#: base_grid.cpp:440 -#: dialog_paste_over.cpp:79 -#: dialog_search_replace.cpp:98 -#: dialog_selection.cpp:80 -#: subs_edit_box.cpp:93 -#: subs_grid.cpp:124 +#: base_grid.cpp:440 dialog_paste_over.cpp:79 dialog_search_replace.cpp:98 +#: dialog_selection.cpp:80 subs_edit_box.cpp:93 subs_grid.cpp:124 msgid "Effect" msgstr "Efekt" -#: base_grid.cpp:441 -#: dialog_style_editor.cpp:248 -#: subs_grid.cpp:125 +#: base_grid.cpp:441 dialog_style_editor.cpp:248 subs_grid.cpp:125 msgid "Left" msgstr "Lewy" -#: base_grid.cpp:442 -#: dialog_style_editor.cpp:248 -#: subs_grid.cpp:126 +#: base_grid.cpp:442 dialog_style_editor.cpp:248 subs_grid.cpp:126 msgid "Right" msgstr "Prawy" -#: base_grid.cpp:443 -#: dialog_style_editor.cpp:248 -#: subs_grid.cpp:127 +#: base_grid.cpp:443 dialog_style_editor.cpp:248 subs_grid.cpp:127 msgid "Vert" msgstr "Pion" -#: base_grid.cpp:444 -#: dialog_kanji_timer.cpp:707 -#: dialog_paste_over.cpp:80 -#: dialog_paste_over.cpp:92 -#: dialog_search_replace.cpp:95 +#: base_grid.cpp:444 dialog_kanji_timer.cpp:707 dialog_paste_over.cpp:80 +#: dialog_paste_over.cpp:92 dialog_search_replace.cpp:95 #: dialog_selection.cpp:77 msgid "Text" msgstr "Tekst" @@ -430,8 +401,7 @@ msgstr "" msgid "Choose character set" msgstr "Wybierz kodowanie znaków" -#: dialog_about.cpp:53 -#: frame_main.cpp:527 +#: dialog_about.cpp:53 frame_main.cpp:527 msgid "About Aegisub" msgstr "O Aegisub" @@ -520,8 +490,7 @@ msgstr "Załącz &czcionkę" msgid "Attach &Graphics" msgstr "Załącz &grafikę" -#: dialog_attachments.cpp:80 -#: dialog_automation.cpp:69 +#: dialog_attachments.cpp:80 dialog_automation.cpp:69 #: dialog_version_check.cpp:502 msgid "&Close" msgstr "&Zamknij" @@ -538,8 +507,7 @@ msgstr "Rozmiar" msgid "Group" msgstr "Rodzaj" -#: dialog_attachments.cpp:194 -#: dialog_attachments.cpp:229 +#: dialog_attachments.cpp:194 dialog_attachments.cpp:229 msgid "Choose file to be attached" msgstr "Wybierz pliki do załączenia" @@ -565,7 +533,7 @@ msgstr "usuń załącznik" #: dialog_automation.cpp:54 msgid "Automation Manager" -msgstr "Menedżer Automatyzacji" +msgstr "Menedżer automatyzacji" #: dialog_automation.cpp:64 msgid "&Add" @@ -635,7 +603,7 @@ msgid "" "Features provided by script:\n" msgstr "" "\n" -"Informacje o skrypcie:\n" +"Informacje o pliku:\n" "Nazwa: %s\n" "Opis: %s\n" "Autor: %s\n" @@ -643,7 +611,7 @@ msgstr "" "Pełna ścieżka: %s\n" "Stan: %s\n" "\n" -"Dodatkowe elementy dostarczone przez skrypt:\n" +"Dodatkowe elementy:\n" #: dialog_automation.cpp:299 msgid "Correctly loaded" @@ -711,7 +679,7 @@ msgstr "Kolory HSV" #: dialog_colorpicker.cpp:583 msgid "Spectrum mode:" -msgstr "Tryb widma" +msgstr "Tryb widma:" #: dialog_colorpicker.cpp:595 msgid "Red:" @@ -725,13 +693,11 @@ msgstr "Zielony:" msgid "Blue:" msgstr "Niebieski:" -#: dialog_colorpicker.cpp:614 -#: dialog_colorpicker.cpp:624 +#: dialog_colorpicker.cpp:614 dialog_colorpicker.cpp:624 msgid "Hue:" msgstr "Barwa:" -#: dialog_colorpicker.cpp:616 -#: dialog_colorpicker.cpp:626 +#: dialog_colorpicker.cpp:616 dialog_colorpicker.cpp:626 msgid "Sat.:" msgstr "Nasyc.:" @@ -821,17 +787,15 @@ msgstr "Eksport..." msgid "Export subtitles file" msgstr "Eksportuje pliku napisów" -#: dialog_fonts_collector.cpp:80 -#: frame_main.cpp:255 +#: dialog_fonts_collector.cpp:80 frame_main.cpp:255 msgid "Fonts Collector" msgstr "Kolekcjoner czcionek" #: dialog_fonts_collector.cpp:96 msgid "&Browse..." -msgstr "&Przeglądaj" +msgstr "&Przeglądaj..." -#: dialog_fonts_collector.cpp:98 -#: dialog_fonts_collector.cpp:309 +#: dialog_fonts_collector.cpp:98 dialog_fonts_collector.cpp:309 msgid "" "Choose the folder where the fonts will be collected to.\n" "It will be created if it doesn't exist." @@ -875,19 +839,11 @@ msgstr "&Strat!" msgid "Invalid destination." msgstr "Błędne miejsce docelowe." -#: dialog_fonts_collector.cpp:195 -#: dialog_fonts_collector.cpp:204 -#: dialog_fonts_collector.cpp:213 -#: dialog_kanji_timer.cpp:820 -#: dialog_kanji_timer.cpp:822 -#: dialog_kanji_timer.cpp:865 -#: dialog_options.cpp:238 -#: dialog_resample.cpp:217 -#: dialog_resample.cpp:221 -#: options.cpp:467 -#: subs_grid.cpp:686 -#: subs_grid.cpp:690 -#: subs_grid.cpp:736 +#: dialog_fonts_collector.cpp:195 dialog_fonts_collector.cpp:204 +#: dialog_fonts_collector.cpp:213 dialog_kanji_timer.cpp:820 +#: dialog_kanji_timer.cpp:822 dialog_kanji_timer.cpp:865 dialog_options.cpp:238 +#: dialog_resample.cpp:217 dialog_resample.cpp:221 options.cpp:467 +#: subs_grid.cpp:686 subs_grid.cpp:690 subs_grid.cpp:736 msgid "Error" msgstr "Błąd" @@ -917,7 +873,7 @@ msgid "" "If a folder is entered, a default name will be used." msgstr "" "Wprowadź nazwę pliku zip, do którego zostaną zebrane czcionki.\n" -" Jeśli wprowadzony zostanie folder, zostanie użyta domyślna nazwa." +"Jeśli wprowadzony zostanie folder, zostanie użyta domyślna nazwa." #: dialog_fonts_collector.cpp:393 msgid "Invalid destination directory." @@ -933,7 +889,7 @@ msgstr "Ukończono zbieranie informacji o czcionkach." #: dialog_fonts_collector.cpp:409 msgid "Scanning file for fonts..." -msgstr "Szukanie czcionek w pliku" +msgstr "Szukanie czcionek w pliku..." #: dialog_fonts_collector.cpp:442 msgid "Done." @@ -982,7 +938,7 @@ msgstr "Skończone. Nie znaleziono pewnych czcionek." #: dialog_fonts_collector.cpp:485 msgid "Done. Some fonts could not be copied." -msgstr "Skończone. Nie skopiowano pewnych czcionek. " +msgstr "Zakończono. Kopiowanie niektórych czcionek nie powiodło się." #: dialog_fonts_collector.cpp:505 msgid "Not found.\n" @@ -1028,24 +984,23 @@ msgstr "Skocz do" #: dialog_jumpto.cpp:75 msgid "Frame: " -msgstr "Klatka:" +msgstr "Klatka: " -#: dialog_jumpto.cpp:76 -#: dialog_shift_times.cpp:78 +#: dialog_jumpto.cpp:76 dialog_shift_times.cpp:78 msgid "Time: " -msgstr "Czas:" +msgstr "Czas: " #: dialog_kanji_timer.cpp:59 msgid "Source: " -msgstr "Źródło:" +msgstr "Źródło: " #: dialog_kanji_timer.cpp:60 msgid "Dest: " -msgstr "Cel:" +msgstr "Cel: " #: dialog_kanji_timer.cpp:695 msgid "Kanji timing" -msgstr "Timing Kanji " +msgstr "Timing Kanji" #: dialog_kanji_timer.cpp:708 msgid "Styles" @@ -1135,17 +1090,10 @@ msgstr "Styl źródłowy i docelowy muszą być różne." msgid "Group all of the source text." msgstr "Zgrupuj cały tekst źródłowy." -#: dialog_options.cpp:86 -#: dialog_options.cpp:210 -#: dialog_options.cpp:283 -#: dialog_options.cpp:351 -#: dialog_options.cpp:428 -#: dialog_options.cpp:469 -#: dialog_options.cpp:555 -#: dialog_properties.cpp:119 -#: dialog_timing_processor.cpp:83 -#: frame_main.cpp:279 -#: hotkeys.cpp:333 +#: dialog_options.cpp:86 dialog_options.cpp:210 dialog_options.cpp:283 +#: dialog_options.cpp:351 dialog_options.cpp:428 dialog_options.cpp:469 +#: dialog_options.cpp:555 dialog_properties.cpp:119 +#: dialog_timing_processor.cpp:83 frame_main.cpp:279 hotkeys.cpp:333 #: hotkeys.cpp:337 msgid "Options" msgstr "Opcje" @@ -1154,8 +1102,7 @@ msgstr "Opcje" msgid "Startup" msgstr "Uruchamianie" -#: dialog_options.cpp:114 -#: dialog_version_check.cpp:495 +#: dialog_options.cpp:114 dialog_version_check.cpp:495 msgid "Auto Check for Updates" msgstr "Automatycznie sprawdzaj aktualizacje" @@ -1239,18 +1186,15 @@ msgstr "Ścieżka odzyskiwania:" msgid "Automatically load linked files:" msgstr "Automatycznie ładuj dołączone pliki:" -#: dialog_options.cpp:189 -#: dialog_options.cpp:359 +#: dialog_options.cpp:189 dialog_options.cpp:359 msgid "Never" msgstr "Nigdy" -#: dialog_options.cpp:189 -#: dialog_options.cpp:359 +#: dialog_options.cpp:189 dialog_options.cpp:359 msgid "Always" msgstr "Zawsze" -#: dialog_options.cpp:189 -#: dialog_options.cpp:359 +#: dialog_options.cpp:189 dialog_options.cpp:359 msgid "Ask" msgstr "Pytaj" @@ -1272,11 +1216,9 @@ msgstr "Nadpisuj zawartość pól czasu" #: dialog_options.cpp:227 msgid "Path to dictionary files:" -msgstr "Ścieżka do plików słownika" +msgstr "Ścieżka do plików słownika:" -#: dialog_options.cpp:237 -#: dialog_options.cpp:563 -#: dialog_properties.cpp:133 +#: dialog_options.cpp:237 dialog_options.cpp:563 dialog_properties.cpp:133 msgid "Normal" msgstr "Normalny" @@ -1314,12 +1256,11 @@ msgstr "Tło zmodyfikowane" #: dialog_options.cpp:245 msgid "Syntax highlighter - " -msgstr "Podświetlenie składni -" +msgstr "Podświetlenie składni - " -#: dialog_options.cpp:256 -#: dialog_options.cpp:319 +#: dialog_options.cpp:256 dialog_options.cpp:319 msgid "Font: " -msgstr "Czcionka:" +msgstr "Czcionka: " #: dialog_options.cpp:290 msgid "Allow grid to take focus" @@ -1341,8 +1282,7 @@ msgstr "Standard, tło" msgid "Selection foreground" msgstr "Zaznaczenie, pierwszy plan" -#: dialog_options.cpp:301 -#: dialog_options.cpp:487 +#: dialog_options.cpp:301 dialog_options.cpp:487 msgid "Selection background" msgstr "Zaznaczenie, tło" @@ -1380,12 +1320,11 @@ msgstr "Linie" #: dialog_options.cpp:332 msgid "Replace override tags with: " -msgstr "Zamień tagi ASS na:" +msgstr "Zamień tagi ASS na: " -#: dialog_options.cpp:352 -#: dialog_options.cpp:520 +#: dialog_options.cpp:352 dialog_options.cpp:520 msgid "Advanced - EXPERT USERS ONLY" -msgstr "Zaawansowane - TYLKO DLA EKSPERTÓW" +msgstr "Zaawansowane - TYLKO DLA EKSPERTÓW" #: dialog_options.cpp:358 msgid "Match video resolution on open" @@ -1393,7 +1332,7 @@ msgstr "Dopasuj rozdzielczość wideo przy otwarciu" #: dialog_options.cpp:363 msgid "Default Zoom" -msgstr "Domyślny Zoom" +msgstr "Domyślny zoom" #: dialog_options.cpp:374 msgid "Fast jump step in frames" @@ -1421,10 +1360,9 @@ msgstr "Limit pamięci dla Avisyntha" #: dialog_options.cpp:408 msgid "Allow pre-2.56a Avisynth" -msgstr "Dopuść Avisynth starszy niż 2.56a" +msgstr "Włącz Avisynth starszy niż 2.56a" -#: dialog_options.cpp:416 -#: dialog_options.cpp:544 +#: dialog_options.cpp:416 dialog_options.cpp:544 msgid "" "WARNING: Changing these settings might result in bugs,\n" "crashes, glitches and/or movax.\n" @@ -1676,15 +1614,15 @@ msgstr "nic" #: dialog_options.cpp:564 msgid "Subtitle-local scripts" -msgstr "lokalne skrypty napisów" +msgstr "Lokalne skrypty napisów" #: dialog_options.cpp:564 msgid "Global autoload scripts" -msgstr "globalnie automatycznie ładowane skrypty" +msgstr "Globalne automatycznie ładowane skrypty" #: dialog_options.cpp:564 msgid "All scripts" -msgstr "wszystkie skrypty" +msgstr "Wszystkie skrypty" #: dialog_options.cpp:565 msgid "Trace level" @@ -1698,13 +1636,11 @@ msgstr "Priorytet procesu" msgid "Autoreload on Export" msgstr "Przeładuj przy eksporcie" -#: dialog_options.cpp:585 -#: dialog_options.cpp:1081 +#: dialog_options.cpp:585 dialog_options.cpp:1081 msgid "Function" msgstr "Funkcja" -#: dialog_options.cpp:586 -#: dialog_options.cpp:1082 +#: dialog_options.cpp:586 dialog_options.cpp:1082 msgid "Key" msgstr "Klawisz" @@ -1736,8 +1672,7 @@ msgstr "Okno edycji napisów" msgid "Subtitles grid" msgstr "Siatka napisów" -#: dialog_options.cpp:617 -#: dialog_video_details.cpp:57 +#: dialog_options.cpp:617 dialog_video_details.cpp:57 msgid "Video" msgstr "Wideo" @@ -1753,8 +1688,7 @@ msgstr "Wyświetlanie" msgid "Advanced" msgstr "Zaawansowane" -#: dialog_options.cpp:621 -#: frame_main.cpp:260 +#: dialog_options.cpp:621 frame_main.cpp:260 msgid "Automation" msgstr "Automatyzacja" @@ -1766,17 +1700,13 @@ msgstr "Skróty klawiszowe" msgid "Restore Defaults" msgstr "Przywróć domyślne" -#: dialog_options.cpp:727 -#: dialog_options.cpp:761 -#: dialog_options.cpp:901 +#: dialog_options.cpp:727 dialog_options.cpp:761 dialog_options.cpp:901 msgid "Aegisub must restart for the changes to take effect. Restart now?" -msgstr "Aegisub musi zostać uruchomiony ponownie aby zmiany zaczęły działać. Uruchomić ponownie teraz?" +msgstr "Aby zmiany weszły w życie, Aegisub wymaga ponownego uruchomienia. Uruchomić ponownie teraz?" -#: dialog_options.cpp:727 -#: dialog_options.cpp:761 -#: dialog_options.cpp:901 +#: dialog_options.cpp:727 dialog_options.cpp:761 dialog_options.cpp:901 msgid "Restart Aegisub" -msgstr "Uruchom ponownie Aegisub'a" +msgstr "Uruchom ponownie Aegisub" #: dialog_options.cpp:777 msgid "Are you sure that you want to restore the defaults? All your settings will be overridden." @@ -1814,10 +1744,9 @@ msgstr "Pola" #: dialog_paste_over.cpp:60 msgid "Please select the fields that you want to paste over:" -msgstr "Wybierz pola do których chcesz wklejać :" +msgstr "Wybierz pola do których chcesz wklejać:" -#: dialog_paste_over.cpp:65 -#: subs_grid.cpp:119 +#: dialog_paste_over.cpp:65 subs_grid.cpp:119 msgid "Layer" msgstr "Warstwa" @@ -1849,28 +1778,25 @@ msgstr "Górny margines" msgid "Margin Bottom" msgstr "Dolny margines" -#: dialog_paste_over.cpp:89 -#: dialog_timing_processor.cpp:77 +#: dialog_paste_over.cpp:89 dialog_timing_processor.cpp:77 msgid "All" msgstr "Wszystkie" -#: dialog_paste_over.cpp:90 -#: dialog_timing_processor.cpp:79 +#: dialog_paste_over.cpp:90 dialog_timing_processor.cpp:79 msgid "None" msgstr "Żaden" -#: dialog_paste_over.cpp:91 -#: dialog_shift_times.cpp:113 +#: dialog_paste_over.cpp:91 dialog_shift_times.cpp:113 msgid "Times" msgstr "Czasy" #: dialog_properties.cpp:58 msgid "Script Properties" -msgstr "Właściwości skryptu" +msgstr "Właściwości pliku" #: dialog_properties.cpp:67 msgid "Script" -msgstr "Skrypt" +msgstr "Plik" #: dialog_properties.cpp:68 msgid "Title:" @@ -1902,15 +1828,13 @@ msgstr "Zaktualizowany przez:" #: dialog_properties.cpp:82 msgid "Update details:" -msgstr "Informacje o zmianach" +msgstr "Informacje o zmianach:" -#: dialog_properties.cpp:105 -#: dialog_resample.cpp:90 +#: dialog_properties.cpp:105 dialog_resample.cpp:90 msgid "Resolution" msgstr "Rozdzielczość" -#: dialog_properties.cpp:111 -#: dialog_resample.cpp:99 +#: dialog_properties.cpp:111 dialog_resample.cpp:99 msgid "From video" msgstr "Z wideo" @@ -1923,9 +1847,7 @@ msgid "1: End-of-line word wrapping, only \\N breaks" msgstr "1: Linie będą dzielone tylko w miejscu gdzie jest \\N" #: dialog_properties.cpp:124 -msgid "" -"2: No word wrapping, both \\n" -" and \\N break" +msgid "2: No word wrapping, both \\n and \\N break" msgstr "2: Linie będą dzielone tylko tam gdzie jest \\N lub \\n" #: dialog_properties.cpp:125 @@ -1950,7 +1872,7 @@ msgstr "Skaluj obramowanie i cień" #: dialog_properties.cpp:142 msgid "Scale border and shadow together with script/render resolution. If this is unchecked, relative border and shadow size will depend on renderer." -msgstr "Skaluje obramowanie i cień razem z rozdzielczością skryptu/rendera. Jeśli to jest odznaczone, względna wielkość obramowania i cienia będzie zależała od rendera. " +msgstr "Skaluje obramowanie i cień razem z rozdzielczością pliku/renderu. Jeśli to jest odznaczone, względna wielkość obramowania i cienia będzie zależała od renderera." #: dialog_properties.cpp:204 msgid "property changes" @@ -1988,13 +1910,11 @@ msgstr "przeliczanie rozdzielczość" msgid "Find what:" msgstr "Znajdź:" -#: dialog_search_replace.cpp:74 -#: dialog_spellchecker.cpp:113 +#: dialog_search_replace.cpp:74 dialog_spellchecker.cpp:113 msgid "Replace with:" msgstr "Zamień na:" -#: dialog_search_replace.cpp:81 -#: dialog_selection.cpp:70 +#: dialog_search_replace.cpp:81 dialog_selection.cpp:70 msgid "Match case" msgstr "Uwzględnij wielkość liter" @@ -2006,18 +1926,15 @@ msgstr "Użyj wyrażeń regularnych" msgid "Update Video (slow)" msgstr "Aktualizuj wideo (wolne)" -#: dialog_search_replace.cpp:100 -#: dialog_shift_times.cpp:108 +#: dialog_search_replace.cpp:100 dialog_shift_times.cpp:108 msgid "All rows" msgstr "Wszystkie wiersze" -#: dialog_search_replace.cpp:101 -#: dialog_shift_times.cpp:108 +#: dialog_search_replace.cpp:101 dialog_shift_times.cpp:108 msgid "Selected rows" msgstr "Zaznaczone wiersze" -#: dialog_search_replace.cpp:102 -#: dialog_selection.cpp:81 +#: dialog_search_replace.cpp:102 dialog_selection.cpp:81 msgid "In Field" msgstr "W polu" @@ -2037,8 +1954,7 @@ msgstr "Zamień następne" msgid "Replace all" msgstr "Zamień wszystkie" -#: dialog_search_replace.cpp:411 -#: dialog_search_replace.cpp:523 +#: dialog_search_replace.cpp:411 dialog_search_replace.cpp:523 msgid "replace" msgstr "zamień" @@ -2051,15 +1967,12 @@ msgstr "%i wyników zostało zamienionych." msgid "No matches found." msgstr "Nie znaleziono wyników." -#: dialog_search_replace.cpp:566 -#: dialog_spellchecker.cpp:122 -#: hotkeys.cpp:351 +#: dialog_search_replace.cpp:566 dialog_spellchecker.cpp:122 hotkeys.cpp:351 #: hotkeys.cpp:354 msgid "Replace" msgstr "Zamień" -#: dialog_search_replace.cpp:566 -#: hotkeys.cpp:348 +#: dialog_search_replace.cpp:566 hotkeys.cpp:348 msgid "Find" msgstr "Znajdź" @@ -2128,9 +2041,7 @@ msgstr "Akcja" msgid "Selection was set to %u lines" msgstr "Zaznaczonych zostało %u linii" -#: dialog_selection.cpp:276 -#: dialog_selection.cpp:277 -#: dialog_selection.cpp:278 +#: dialog_selection.cpp:276 dialog_selection.cpp:277 dialog_selection.cpp:278 msgid "Selection" msgstr "Zaznaczenie" @@ -2144,9 +2055,7 @@ msgstr "%u linii zostało dodanych do zaznaczenia" msgid "%u lines were removed from selection" msgstr "%u linii zostało usuniętych z zaznaczenia" -#: dialog_shift_times.cpp:63 -#: frame_main.cpp:269 -#: hotkeys.cpp:347 +#: dialog_shift_times.cpp:63 frame_main.cpp:269 hotkeys.cpp:347 msgid "Shift Times" msgstr "Przesuń czasy" @@ -2220,7 +2129,7 @@ msgstr "Wyczyść" #: dialog_shift_times.cpp:251 msgid "unsaved" -msgstr "Niezapisane" +msgstr "niezapisane" #: dialog_shift_times.cpp:256 msgid " frames " @@ -2263,8 +2172,7 @@ msgstr "zaznaczone " msgid "shifting" msgstr "przesuwanie" -#: dialog_spellchecker.cpp:69 -#: frame_main.cpp:275 +#: dialog_spellchecker.cpp:69 frame_main.cpp:275 msgid "Spell Checker" msgstr "Sprawdzanie pisowni" @@ -2298,10 +2206,9 @@ msgstr "Dodaj do słownika" #: dialog_spellchecker.cpp:327 msgid "Aegisub has finished checking spelling of this script." -msgstr "Aegisub skończył sprawdzanie pisowni w tym skrypcie." +msgstr "Aegisub zakończył sprawdzanie pisowni w tych napisach." -#: dialog_spellchecker.cpp:327 -#: dialog_spellchecker.cpp:394 +#: dialog_spellchecker.cpp:327 dialog_spellchecker.cpp:394 msgid "Spell checking complete." msgstr "Sprawdzanie pisowni ukończone." @@ -2311,7 +2218,7 @@ msgstr "Sprawdzanie pisowni " #: dialog_spellchecker.cpp:394 msgid "Aegisub has found no spelling mistakes in this script." -msgstr "Aegisub nie znalazł błędów w tym skrypcie" +msgstr "Aegisub nie znalazł żadnych błędów w tych napisach." #: dialog_style_editor.cpp:99 msgid "Style Editor" @@ -2333,8 +2240,7 @@ msgstr "Kolory" msgid "Margins" msgstr "Marginesy" -#: dialog_style_editor.cpp:137 -#: dialog_style_editor.cpp:236 +#: dialog_style_editor.cpp:137 dialog_style_editor.cpp:236 msgid "Outline" msgstr "Obramowanie" @@ -2346,8 +2252,7 @@ msgstr "Różne" msgid "Preview" msgstr "Podgląd" -#: dialog_style_editor.cpp:145 -#: subs_edit_box.cpp:120 +#: dialog_style_editor.cpp:145 subs_edit_box.cpp:120 msgid "Bold" msgstr "Pogrubienie" @@ -2355,13 +2260,11 @@ msgstr "Pogrubienie" msgid "Italic" msgstr "Kursywa" -#: dialog_style_editor.cpp:147 -#: subs_edit_box.cpp:124 +#: dialog_style_editor.cpp:147 subs_edit_box.cpp:124 msgid "Underline" msgstr "Podkreślenie" -#: dialog_style_editor.cpp:148 -#: subs_edit_box.cpp:126 +#: dialog_style_editor.cpp:148 subs_edit_box.cpp:126 msgid "Strikeout" msgstr "Przekreślenie" @@ -2511,14 +2414,13 @@ msgstr "Brak providera napisów. Nie można podejrzeć napisów." #: dialog_style_editor.cpp:452 msgid "Do you want to change all instances of this style in the script to this new name?" -msgstr "Czy chcesz zamienić wszystkie wystąpienia tego stylu na podaną nową nazwę?" +msgstr "Czy chcesz zmienić nazwę stylu na nową we wszystkich liniach z tym stylem?" #: dialog_style_editor.cpp:452 msgid "Update script?" msgstr "Zaktualizować skrypt?" -#: dialog_style_editor.cpp:486 -#: subs_edit_box.cpp:595 +#: dialog_style_editor.cpp:486 subs_edit_box.cpp:595 msgid "style change" msgstr "zmiana stylu" @@ -2528,16 +2430,15 @@ msgid "" "I must urge you to reconsider. Comic Sans is the most abused font in the history\n" "of computing, so please avoid using it unless it's REALLY suitable. Thanks." msgstr "" -"Postanowiłeś użyć czcionki \"Comic Sans\". Jako programista i typesetter, muszę nalegać żebyś rozważył to ponownie.\n" -"Comic Sans jest najbardziej nadużywaną czcionką w historii informatyki, więc proszę\n" +"Postanowiłeś użyć czcionki \"Comic Sans\". Jako programista i typesetter, muszę nalegać żebyś rozważył to ponownie.\n" +"Comic Sans jest najbardziej nadużywaną czcionką w historii informatyki, więc proszę\n" "unikaj używania jej chyba, że jest NAPRAWDĘ stosowna." #: dialog_style_editor.cpp:583 msgid "Warning" msgstr "Ostrzeżenie" -#: dialog_style_manager.cpp:60 -#: frame_main.cpp:252 +#: dialog_style_manager.cpp:60 frame_main.cpp:252 msgid "Styles Manager" msgstr "Menedżer stylów" @@ -2545,17 +2446,13 @@ msgstr "Menedżer stylów" msgid "Catalog of available storages" msgstr "Katalog dostępnych magazynów" -#: dialog_style_manager.cpp:71 -#: dialog_style_manager.cpp:84 -#: dialog_style_manager.cpp:129 -#: frame_main.cpp:221 +#: dialog_style_manager.cpp:71 dialog_style_manager.cpp:84 +#: dialog_style_manager.cpp:129 frame_main.cpp:221 msgid "New" msgstr "Nowy" -#: dialog_style_manager.cpp:72 -#: dialog_style_manager.cpp:87 -#: dialog_style_manager.cpp:132 -#: subs_grid.cpp:204 +#: dialog_style_manager.cpp:72 dialog_style_manager.cpp:87 +#: dialog_style_manager.cpp:132 subs_grid.cpp:204 msgid "Delete" msgstr "Usuń" @@ -2565,47 +2462,39 @@ msgstr "Magazyn" #: dialog_style_manager.cpp:83 msgid "Copy to current script ->" -msgstr "Kopiuj do bieżącego skryptu ->" +msgstr "Kopiuj do bieżących napisów ->" -#: dialog_style_manager.cpp:85 -#: dialog_style_manager.cpp:130 +#: dialog_style_manager.cpp:85 dialog_style_manager.cpp:130 msgid "Edit" msgstr "Edytuj" -#: dialog_style_manager.cpp:86 -#: dialog_style_manager.cpp:131 -#: hotkeys.cpp:357 +#: dialog_style_manager.cpp:86 dialog_style_manager.cpp:131 hotkeys.cpp:357 msgid "Copy" msgstr "Kopiuj" -#: dialog_style_manager.cpp:97 -#: dialog_style_manager.cpp:142 +#: dialog_style_manager.cpp:97 dialog_style_manager.cpp:142 msgid "Move style up" msgstr "Przesuń w górę" -#: dialog_style_manager.cpp:98 -#: dialog_style_manager.cpp:143 +#: dialog_style_manager.cpp:98 dialog_style_manager.cpp:143 msgid "Move style down" msgstr "Przesuń w dół" -#: dialog_style_manager.cpp:99 -#: dialog_style_manager.cpp:144 +#: dialog_style_manager.cpp:99 dialog_style_manager.cpp:144 msgid "Move style to top" msgstr "Przenieś styl na górę" -#: dialog_style_manager.cpp:100 -#: dialog_style_manager.cpp:145 +#: dialog_style_manager.cpp:100 dialog_style_manager.cpp:145 msgid "Move style to bottom" msgstr "Przenieś styl na dół" -#: dialog_style_manager.cpp:101 -#: dialog_style_manager.cpp:146 +#: dialog_style_manager.cpp:101 dialog_style_manager.cpp:146 msgid "Sort styles alphabetically" msgstr "Sortuj style alfabetycznie" #: dialog_style_manager.cpp:121 msgid "Current script" -msgstr "Bieżący skrypt" +msgstr "Bieżące napisy" #: dialog_style_manager.cpp:126 msgid "<- Copy to storage" @@ -2613,7 +2502,7 @@ msgstr "<- Kopiuj do magazynu" #: dialog_style_manager.cpp:128 msgid "Import from script..." -msgstr "Importuj ze skryptu..." +msgstr "Importuj z pliku..." #: dialog_style_manager.cpp:393 msgid "New storage name:" @@ -2653,13 +2542,11 @@ msgstr "Czy na pewno chcesz usunąć magazyn \"%s\" z katalogu?" msgid "Confirm delete" msgstr "Potwierdź usunięcie" -#: dialog_style_manager.cpp:575 -#: dialog_style_manager.cpp:624 +#: dialog_style_manager.cpp:575 dialog_style_manager.cpp:624 msgid "style copy" msgstr "kopiuj styl" -#: dialog_style_manager.cpp:588 -#: dialog_style_manager.cpp:611 +#: dialog_style_manager.cpp:588 dialog_style_manager.cpp:611 msgid "Copy of " msgstr "Kopia " @@ -2667,25 +2554,20 @@ msgstr "Kopia " msgid "style paste" msgstr "wklej styl" -#: dialog_style_manager.cpp:681 -#: dialog_style_manager.cpp:685 -#: dialog_style_manager.cpp:721 -#: dialog_style_manager.cpp:725 +#: dialog_style_manager.cpp:681 dialog_style_manager.cpp:685 +#: dialog_style_manager.cpp:721 dialog_style_manager.cpp:725 msgid "Could not parse style" msgstr "Styl nie mógł zostać przetworzony" -#: dialog_style_manager.cpp:766 -#: dialog_style_manager.cpp:799 +#: dialog_style_manager.cpp:766 dialog_style_manager.cpp:799 msgid "Are you sure you want to delete these " msgstr "Czy na pewno chcesz usunąć te " -#: dialog_style_manager.cpp:768 -#: dialog_style_manager.cpp:801 +#: dialog_style_manager.cpp:768 dialog_style_manager.cpp:801 msgid " styles?" msgstr " style?" -#: dialog_style_manager.cpp:770 -#: dialog_style_manager.cpp:803 +#: dialog_style_manager.cpp:770 dialog_style_manager.cpp:803 msgid "Are you sure you want to delete this style?" msgstr "Czy na pewno chcesz usunąć ten styl?" @@ -2695,14 +2577,13 @@ msgstr "Potwierdź usunięcie z magazynu" #: dialog_style_manager.cpp:804 msgid "Confirm delete from current" -msgstr "Potwierdź usunięcie z bieżącego skryptu" +msgstr "Potwierdź usunięcie z bieżącego pliku" #: dialog_style_manager.cpp:821 msgid "style delete" msgstr "usuń styl" -#: dialog_style_manager.cpp:831 -#: frame_main_events.cpp:722 +#: dialog_style_manager.cpp:831 frame_main_events.cpp:722 #: frame_main_events.cpp:740 msgid "Open subtitles file" msgstr "Otwórz plik napisów" @@ -2715,13 +2596,11 @@ msgstr "Wybrany plik nie ma żadnych stylów." msgid "Error Importing Styles" msgstr "Błąd podczas importowania stylów" -#: dialog_style_manager.cpp:854 -#: dialog_style_manager.cpp:856 +#: dialog_style_manager.cpp:854 dialog_style_manager.cpp:856 msgid "Choose styles to import:" msgstr "Wybierz style do zaimportowania:" -#: dialog_style_manager.cpp:854 -#: dialog_style_manager.cpp:856 +#: dialog_style_manager.cpp:854 dialog_style_manager.cpp:856 msgid "Import Styles" msgstr "Importuj style" @@ -2745,8 +2624,7 @@ msgstr "przenoszenie stylu" msgid "Styling assistant" msgstr "Pomocnik stylizowania" -#: dialog_styling_assistant.cpp:75 -#: dialog_styling_assistant.cpp:76 +#: dialog_styling_assistant.cpp:75 dialog_styling_assistant.cpp:76 msgid "Current line" msgstr "Bieżąca linia" @@ -2758,47 +2636,37 @@ msgstr "Dostępne style" msgid "Set style" msgstr "Ustaw styl" -#: dialog_styling_assistant.cpp:87 -#: dialog_translation.cpp:101 +#: dialog_styling_assistant.cpp:87 dialog_translation.cpp:101 msgid "Keys" msgstr "Klawisze" -#: dialog_styling_assistant.cpp:88 -#: dialog_translation.cpp:124 +#: dialog_styling_assistant.cpp:88 dialog_translation.cpp:124 msgid "Actions" msgstr "Akcje" -#: dialog_styling_assistant.cpp:96 -#: dialog_translation.cpp:104 +#: dialog_styling_assistant.cpp:96 dialog_translation.cpp:104 msgid "Accept changes" msgstr "Zatwierdź zmiany" -#: dialog_styling_assistant.cpp:98 -#: dialog_translation.cpp:106 +#: dialog_styling_assistant.cpp:98 dialog_translation.cpp:106 msgid "Preview changes" msgstr "Podejrzyj zmiany" -#: dialog_styling_assistant.cpp:100 -#: dialog_translation.cpp:108 +#: dialog_styling_assistant.cpp:100 dialog_translation.cpp:108 msgid "Previous line" msgstr "Poprzednia linia" -#: dialog_styling_assistant.cpp:102 -#: dialog_translation.cpp:110 +#: dialog_styling_assistant.cpp:102 dialog_translation.cpp:110 msgid "Next line" msgstr "Następna linia" -#: dialog_styling_assistant.cpp:104 -#: dialog_styling_assistant.cpp:118 -#: dialog_translation.cpp:114 -#: dialog_translation.cpp:125 +#: dialog_styling_assistant.cpp:104 dialog_styling_assistant.cpp:118 +#: dialog_translation.cpp:114 dialog_translation.cpp:125 msgid "Play Video" msgstr "Odtwarzaj wideo" -#: dialog_styling_assistant.cpp:106 -#: dialog_styling_assistant.cpp:119 -#: dialog_translation.cpp:116 -#: dialog_translation.cpp:126 +#: dialog_styling_assistant.cpp:106 dialog_styling_assistant.cpp:119 +#: dialog_translation.cpp:116 dialog_translation.cpp:126 msgid "Play Audio" msgstr "Odtwarzaj audio" @@ -2818,8 +2686,7 @@ msgstr "Włącz podgląd (wolne)" msgid "style changes" msgstr "zmiany stylu" -#: dialog_styling_assistant.cpp:223 -#: dialog_styling_assistant.cpp:252 +#: dialog_styling_assistant.cpp:223 dialog_styling_assistant.cpp:252 msgid "styling assistant" msgstr "pomocnik stylizowania" @@ -2835,8 +2702,7 @@ msgstr "Separator aktora:" msgid "Comment starter:" msgstr "Początek komentarza:" -#: dialog_timing_processor.cpp:57 -#: frame_main.cpp:273 +#: dialog_timing_processor.cpp:57 frame_main.cpp:273 msgid "Timing Post-Processor" msgstr "Timing Post-Processor" @@ -2892,8 +2758,7 @@ msgstr "Zakres za do dodania, w milisekundach" msgid "Make adjacent subtitles continuous" msgstr "Ustaw sąsiednie napisy ciągłymi." -#: dialog_timing_processor.cpp:108 -#: dialog_timing_processor.cpp:126 +#: dialog_timing_processor.cpp:108 dialog_timing_processor.cpp:126 msgid "Enable" msgstr "Włącz" @@ -2915,7 +2780,7 @@ msgstr "Ustawia jak ustawić sąsiednie linie. Jeśli ustawione po lewej, zostan #: dialog_timing_processor.cpp:119 msgid "Bias: Start <- " -msgstr "Odchylenie : Początek <-" +msgstr "Odchylenie: Początek <-" #: dialog_timing_processor.cpp:121 msgid " -> End" @@ -3016,7 +2881,7 @@ msgstr "Kiedy skończysz ze swoimi napisami i będziesz gotowy do ich dystrybucj #: dialog_tip.cpp:62 msgid "Much like anything loaded via DirectShow, certain files may have a strange structure (such as h.264 into AVI or XviD will null frames) which may cause unreliable seeking (that is, video frames might be off by one frame). This is not an Aegisub bug - you may consider reencoding those videos before working with them." -msgstr "Przy ładowaniu czegokolwiek przez DirectShow, pewne pliki mogą mieć dziwną strukturę (takie jak h.264 w avi albo XviD z pustymi klatkami) co może powodować niepewne przeglądanie (to jest, może być różnica jednej klatki w wideo). To nie jest bug Aegisub'a - mógłbyś przemyśleć przekodowanie tych plików przed praca z nimi. " +msgstr "Niektóre pliki załadowane przez DirectShow, np. H.264 w AVI, bądź XviD z pustymi klatkami, mogą mieć problemy z przewijaniem i być przesunięte o jedną klatkę. To nie jest wina Aegisuba, zalecane jest abyś przed pracą nad tymi plikami przekodował je do innego formatu." #: dialog_tip.cpp:63 msgid "Try the spectrum mode for the audio display, it can make it much easier to spot where the important points in the audio are." @@ -3028,7 +2893,7 @@ msgstr "Jeśli zdekodujesz swoje audio do PCM WAV przed załadowaniem go do Aegi #: dialog_tip.cpp:65 msgid "Having video open is often more a nuisance than a help when timing subtitles. Timing with only audio open is often much easier. You can always adjust the subtitles to match the video later on." -msgstr "Otwarte wideo częściej przeszkadza niż pomaga przy timingowaniu napisów. Timing z otwartym samym audio jest dużo łatwiejszy. Zawsze możesz później dopasować napisy do wideo. " +msgstr "Otwarte wideo częściej przeszkadza niż pomaga przy timingowaniu napisów. Timing z samym audio jest dla wielu łatwiejszy. Zawsze możesz dopasować napisy do wideo później. " #: dialog_tip.cpp:66 msgid "If the audio doesn't seem to work properly during video playback, try loading audio separately. Just select Audio->Load from video, that usually makes the audio much more reliable." @@ -3036,10 +2901,9 @@ msgstr "Jeśli audio nie działa poprawnie podczas odtwarzania wideo, spróbuj z #: dialog_tip.cpp:67 msgid "If anything goes wrong, blame movax." -msgstr "Jeśli coś idzie nie tak, obwiniajcie movax'a(Czytaj Faq'u na stronie aegisuba)" +msgstr "Jeśli coś idzie nie tak, wińcie movaxa (Czytaj FAQ na stronie)" -#: dialog_translation.cpp:61 -#: frame_main.cpp:271 +#: dialog_translation.cpp:61 frame_main.cpp:271 msgid "Translation Assistant" msgstr "Pomocnik tłumaczenia" @@ -3084,14 +2948,14 @@ msgid "" "\n" "If other applications can access the Internet fine, this is probably a temporary server problem on our end." msgstr "" -"Wystąpił błąd podczas sprawdzania aktualizacji Aegisub'a:\n" +"Wystąpił błąd podczas sprawdzania aktualizacji:\n" "%s\n" "\n" -"Jeśli inne aplikacje mogą łączyć się bez problemu z internetem, to pewnie jest to chwilowy problem z serwerem po naszej stronie." +"Jeżeli masz aktywne połączenie z siecią, jest to najprawdopodobniej tymczasowy problem z naszym serwerem." #: dialog_version_check.cpp:182 msgid "An unknown error occurred while checking for updates to Aegisub." -msgstr "Wystąpił nieznany błąd podczas sprawdzania aktualizacji Aegisub'a." +msgstr "Wystąpił nieznany błąd podczas sprawdzania aktualizacji." #: dialog_version_check.cpp:346 msgid "Could not connect to updates server." @@ -3099,7 +2963,7 @@ msgstr "Nie udało się połączyć z serwerem aktualizacji." #: dialog_version_check.cpp:350 msgid "Could not download from updates server." -msgstr "Nie można pobierać z serwera aktualizacji." +msgstr "Wystąpił problem podczas pobierania aktualizacji z serwera." #: dialog_version_check.cpp:353 #, c-format @@ -3108,15 +2972,15 @@ msgstr "Żądanie HTTP nie powiodło się, otrzymana odpowiedź HTTP %d" #: dialog_version_check.cpp:426 msgid "An update to Aegisub was found." -msgstr "Znaleziono aktualizację dla Aegisub'a." +msgstr "Znaleziono aktualizację." #: dialog_version_check.cpp:430 msgid "Several possible updates to Aegisub were found." -msgstr "Znaleziono klika możliwych aktualizacji dla Aegisub'a." +msgstr "Znaleziono klika możliwych aktualizacji." #: dialog_version_check.cpp:434 msgid "There are no updates to Aegisub." -msgstr "Nie ma aktualizacji dla Aegisub'a" +msgstr "Brak dostępnych aktualizacji." #: dialog_version_check.cpp:468 msgid "Version Checker" @@ -3152,11 +3016,11 @@ msgstr "Dekoder:" #: export_clean_info.cpp:60 msgid "Clean Script Info" -msgstr "Wyczyść informacje o skrypcie" +msgstr "Wyczyść właściwości pliku" #: export_clean_info.cpp:61 msgid "Removes all but the absolutely required fields from the Script Info section. You might want to run this on files that you plan to distribute in original form." -msgstr "Usuwa wszystko za wyjątkiem absolutnie potrzebnych pól z sekcji informacji o skrypcie. Możesz chcieć to uruchomić na plikach, których planujesz dystrybucję w oryginalnej formie." +msgstr "Usuwa wszystkie opcjonalne wartości z właściwości pliku. Przydatne jeśli planujesz dystrybucję plikow w oryginalnej formie." #: export_fixstyle.cpp:60 msgid "Fix Styles" @@ -3200,7 +3064,7 @@ msgstr "Transformacja odwrotna" #: export_framerate.cpp:129 msgid "Input framerate: " -msgstr "Wejściowe FPS: " +msgstr "Wejściowe FPS: " #: export_framerate.cpp:131 msgid "Output: " @@ -3245,9 +3109,7 @@ msgstr "Chcesz żeby Aegisub przy każdym uruchomieniu sprawdzał czy są dostę msgid "Check for updates?" msgstr "Sprawdzić czy są dostępne aktualizacje?" -#: frame_main.cpp:221 -#: frame_main.cpp:320 -#: hotkeys.cpp:327 +#: frame_main.cpp:221 frame_main.cpp:320 hotkeys.cpp:327 msgid "New subtitles" msgstr "Nowe napisy" @@ -3255,8 +3117,7 @@ msgstr "Nowe napisy" msgid "Open" msgstr "Otwórz" -#: frame_main.cpp:222 -#: hotkeys.cpp:328 +#: frame_main.cpp:222 hotkeys.cpp:328 msgid "Open subtitles" msgstr "Otwórz napisy" @@ -3264,8 +3125,7 @@ msgstr "Otwórz napisy" msgid "Save" msgstr "Zapisz" -#: frame_main.cpp:223 -#: hotkeys.cpp:329 +#: frame_main.cpp:223 hotkeys.cpp:329 msgid "Save subtitles" msgstr "Zapisz napisy" @@ -3297,8 +3157,7 @@ msgstr "Pomniejsza wideo" msgid "Jump video to start" msgstr "Przewiń wideo do początku linii" -#: frame_main.cpp:242 -#: frame_main.cpp:468 +#: frame_main.cpp:242 frame_main.cpp:468 msgid "Jumps the video to the start frame of current subtitle" msgstr "Przewija wideo do początkowej klatki bieżącej linii napisów" @@ -3306,8 +3165,7 @@ msgstr "Przewija wideo do początkowej klatki bieżącej linii napisów" msgid "Jump video to end" msgstr "Przewiń wideo do końca linii" -#: frame_main.cpp:243 -#: frame_main.cpp:469 +#: frame_main.cpp:243 frame_main.cpp:469 msgid "Jumps the video to the end frame of current subtitle" msgstr "Przewija wideo do końcowej klatki bieżącej linii napisów" @@ -3315,19 +3173,17 @@ msgstr "Przewija wideo do końcowej klatki bieżącej linii napisów" msgid "Snap start to video" msgstr "Wyrównaj początek do wideo" -#: frame_main.cpp:244 -#: frame_main.cpp:408 +#: frame_main.cpp:244 frame_main.cpp:408 msgid "Set start of selected subtitles to current video frame" -msgstr "Ustawia początek wybranej linii napisów na bieżącą klatkę wideo." +msgstr "Ustawia początek wybranych linii napisów na bieżącą klatkę wideo" #: frame_main.cpp:245 msgid "Snap end to video" msgstr "Wyrównaj koniec do wideo" -#: frame_main.cpp:245 -#: frame_main.cpp:409 +#: frame_main.cpp:245 frame_main.cpp:409 msgid "Set end of selected subtitles to current video frame" -msgstr "Ustawia koniec wybranej linii napisów na bieżącą klatkę wideo." +msgstr "Ustawia koniec wybranych linii napisów na bieżącą klatkę wideo." #: frame_main.cpp:246 msgid "Select visible" @@ -3381,8 +3237,7 @@ msgstr "Otwórz kolekcjonera czcionek" msgid "Open Automation manager" msgstr "Otwórz menedżera automatyzacji" -#: frame_main.cpp:266 -#: frame_main.cpp:373 +#: frame_main.cpp:266 frame_main.cpp:373 msgid "Launches ai-chan's \"ASSDraw3\" tool for vector drawing." msgstr "Uruchamia narzędzie \"ASSDraw3\" do rysowania wektorowego autorstwa ai-chan." @@ -3408,7 +3263,7 @@ msgstr "Przelicz" #: frame_main.cpp:272 msgid "Resample Script Resolution" -msgstr "Przelicz rozdzielczość skryptu" +msgstr "Przelicz rozdzielczość pliku" #: frame_main.cpp:273 msgid "Open Timing Post-processor dialog" @@ -3426,10 +3281,9 @@ msgstr "Otwórz okno kanji timer'a" msgid "Open Spell checker" msgstr "Otwórz sprawdzanie pisowni" -#: frame_main.cpp:279 -#: frame_main.cpp:497 +#: frame_main.cpp:279 frame_main.cpp:497 msgid "Configure Aegisub" -msgstr "Konfiguruj Aegisub'a" +msgstr "Konfiguruj Aegisuba" #: frame_main.cpp:280 msgid "Cycle Tag Hiding Mode" @@ -3439,8 +3293,7 @@ msgstr "Przełączaj tryby ukrywania tagów" msgid "Cycle through tag hiding modes" msgstr "Przełącza tryby ukrywania tagów" -#: frame_main.cpp:305 -#: frame_main.cpp:528 +#: frame_main.cpp:305 frame_main.cpp:528 msgid "&Help" msgstr "P&omoc" @@ -3488,10 +3341,7 @@ msgstr "Eksportuj napisy" msgid "Saves a copy of subtitles with processing applied to it" msgstr "Zapisuje kopię napisów z zastosowaną obróbką" -#: frame_main.cpp:326 -#: frame_main.cpp:427 -#: frame_main.cpp:435 -#: frame_main.cpp:441 +#: frame_main.cpp:326 frame_main.cpp:427 frame_main.cpp:435 frame_main.cpp:441 #: frame_main.cpp:477 msgid "Recent" msgstr "Ostatnie" @@ -3502,7 +3352,7 @@ msgstr "&Właściwości..." #: frame_main.cpp:332 msgid "Open script properties window" -msgstr "Otwiera okno właściwości skryptu" +msgstr "Otwiera okno właściwości pliku" #: frame_main.cpp:333 msgid "&Attachments..." @@ -3540,9 +3390,7 @@ msgstr "Zamyka program" msgid "&File" msgstr "&Plik" -#: frame_main.cpp:346 -#: frame_main_events.cpp:429 -#: subs_edit_ctrl.cpp:951 +#: frame_main.cpp:346 frame_main_events.cpp:429 subs_edit_ctrl.cpp:951 msgid "&Undo" msgstr "&Cofnij" @@ -3550,8 +3398,7 @@ msgstr "&Cofnij" msgid "Undoes last action" msgstr "Cofa ostatnią akcję" -#: frame_main.cpp:347 -#: frame_main_events.cpp:435 +#: frame_main.cpp:347 frame_main_events.cpp:435 msgid "&Redo" msgstr "&Powtórz" @@ -3599,9 +3446,7 @@ msgstr "&Znajdź..." msgid "Find words in subtitles" msgstr "Wyszukuje słowa w napisach" -#: frame_main.cpp:355 -#: hotkeys.cpp:350 -#: hotkeys.cpp:353 +#: frame_main.cpp:355 hotkeys.cpp:350 hotkeys.cpp:353 msgid "Find Next" msgstr "Znajdź następne" @@ -3701,8 +3546,7 @@ msgstr "Wstawia linię po bieżącej, rozpoczyna się od czasu wideo" msgid "&Duplicate Lines" msgstr "P&owiel linie" -#: frame_main.cpp:381 -#: subs_grid.cpp:167 +#: frame_main.cpp:381 subs_grid.cpp:167 msgid "Duplicate the selected lines" msgstr "Powiela wybrane linie" @@ -3710,8 +3554,7 @@ msgstr "Powiela wybrane linie" msgid "&Duplicate and Shift by 1 Frame" msgstr "Po&wiel i przesuń o jedna klatkę" -#: frame_main.cpp:382 -#: subs_grid.cpp:168 +#: frame_main.cpp:382 subs_grid.cpp:168 msgid "Duplicate lines and shift by one frame" msgstr "Powiela i przesuwa o jedna klatkę" @@ -3719,8 +3562,7 @@ msgstr "Powiela i przesuwa o jedna klatkę" msgid "Delete Lines" msgstr "Usuń linie" -#: frame_main.cpp:383 -#: subs_grid.cpp:204 +#: frame_main.cpp:383 subs_grid.cpp:204 msgid "Delete currently selected lines" msgstr "Usuwa zaznaczone linie" @@ -3732,8 +3574,7 @@ msgstr "Połącz linie" msgid "&Concatenate" msgstr "&Złącz" -#: frame_main.cpp:390 -#: subs_grid.cpp:177 +#: frame_main.cpp:390 subs_grid.cpp:177 msgid "Joins selected lines in a single one, concatenating text together" msgstr "Łączy zaznaczone linie w jedną, łącząc razem teksty." @@ -3741,8 +3582,7 @@ msgstr "Łączy zaznaczone linie w jedną, łącząc razem teksty." msgid "Keep &First" msgstr "Zatrzymaj &pierwszą." -#: frame_main.cpp:391 -#: subs_grid.cpp:178 +#: frame_main.cpp:391 subs_grid.cpp:178 msgid "Joins selected lines in a single one, keeping text of first and discarding remaining" msgstr "Łączy zaznaczone linie w jedną zachowując tekst pierwszej i odrzucając resztę" @@ -3754,13 +3594,11 @@ msgstr "Jako &karaoke" msgid "Joins selected lines in a single one, as karaoke" msgstr "Łączy zaznaczone linie w jedną, jako karaoke" -#: frame_main.cpp:394 -#: subs_grid.cpp:188 +#: frame_main.cpp:394 subs_grid.cpp:188 msgid "Recombine Lines" msgstr "Rozplącz linie" -#: frame_main.cpp:394 -#: subs_grid.cpp:188 +#: frame_main.cpp:394 subs_grid.cpp:188 msgid "Recombine subtitles when they have been split and merged" msgstr "Rozplątuje linie gdy zostały podzielone i połączone" @@ -3768,8 +3606,7 @@ msgstr "Rozplątuje linie gdy zostały podzielone i połączone" msgid "Split Lines (by karaoke)" msgstr "Podziel linie (po karaoke)" -#: frame_main.cpp:395 -#: subs_grid.cpp:169 +#: frame_main.cpp:395 subs_grid.cpp:169 msgid "Uses karaoke timing to split line into multiple smaller lines" msgstr "Używa bloków karaoke do rozbicia linii na kilka mniejszych linii" @@ -3777,8 +3614,7 @@ msgstr "Używa bloków karaoke do rozbicia linii na kilka mniejszych linii" msgid "Swap Lines" msgstr "Zamień linie" -#: frame_main.cpp:397 -#: subs_grid.cpp:173 +#: frame_main.cpp:397 subs_grid.cpp:173 msgid "Swaps the two selected lines" msgstr "Zamienia dwie zaznaczone linie" @@ -3834,8 +3670,7 @@ msgstr "Wyrównaj początek do wideo" msgid "Snap End to Video" msgstr "Wyrównaj koniec do wideo" -#: frame_main.cpp:410 -#: hotkeys.cpp:371 +#: frame_main.cpp:410 hotkeys.cpp:371 msgid "Snap to Scene" msgstr "Wyrównaj do sceny" @@ -3859,8 +3694,7 @@ msgstr "Ustaw czasy ciągłymi" msgid "Change &Start" msgstr "Zmień &początek" -#: frame_main.cpp:418 -#: subs_grid.cpp:183 +#: frame_main.cpp:418 subs_grid.cpp:183 msgid "Changes times of subs so start times begin on previous's end time" msgstr "Zmienia czasy napisów tak, że początek ustawiony jest na końcu poprzedniej linii" @@ -3868,8 +3702,7 @@ msgstr "Zmienia czasy napisów tak, że początek ustawiony jest na końcu poprz msgid "Change &End" msgstr "Zmień &koniec" -#: frame_main.cpp:419 -#: subs_grid.cpp:184 +#: frame_main.cpp:419 subs_grid.cpp:184 msgid "Changes times of subs so end times begin on next's start time" msgstr "Zmienia czasy napisów tak, że koniec ustawiony jest na początku następnej linii" @@ -3999,7 +3832,7 @@ msgstr "&Fullscreen (4:3)" #: frame_main.cpp:460 msgid "Forces video to 4:3 aspect ratio" -msgstr "Wymusza na wideo proporcje obrazu 4:3" +msgstr "Wymusza na wideo proporcje obrazu 4:3" #: frame_main.cpp:461 msgid "&Widescreen (16:9)" @@ -4007,7 +3840,7 @@ msgstr "&Widescreen (16:9)" #: frame_main.cpp:461 msgid "Forces video to 16:9 aspect ratio" -msgstr "Wymusza na wideo proporcje obrazu 16:9" +msgstr "Wymusza na wideo proporcje obrazu 16:9" #: frame_main.cpp:462 msgid "&Cinematic (2.35)" @@ -4015,7 +3848,7 @@ msgstr "&Cinematic (2.35)" #: frame_main.cpp:462 msgid "Forces video to 2.35 aspect ratio" -msgstr "Wymusza na wideo proporcje obrazu 2.35" +msgstr "Wymusza na wideo proporcje obrazu 2.35" #: frame_main.cpp:463 msgid "Custom" @@ -4041,13 +3874,11 @@ msgstr "&Skocz do..." msgid "Jump to frame or time" msgstr "Skocz do klatki lub czasu" -#: frame_main.cpp:468 -#: hotkeys.cpp:367 +#: frame_main.cpp:468 hotkeys.cpp:367 msgid "Jump Video to Start" msgstr "Przewiń wideo do początku" -#: frame_main.cpp:469 -#: hotkeys.cpp:368 +#: frame_main.cpp:469 hotkeys.cpp:368 msgid "Jump Video to End" msgstr "Przewiń wideo do końca" @@ -4097,7 +3928,7 @@ msgstr "A&utomatyzacja" #: frame_main.cpp:496 msgid "Select Aegisub interface language" -msgstr "Wybierz język interfejsu Aegisub'a" +msgstr "Wybierz język interfejsu Aegisuba" #: frame_main.cpp:497 msgid "&Options..." @@ -4177,7 +4008,7 @@ msgstr "Strona &www" #: frame_main.cpp:519 msgid "Visit Aegisub's official website" -msgstr "Odwiedź oficjalną stronę Aegisub'a" +msgstr "Odwiedź oficjalną stronę Aegisuba" #: frame_main.cpp:520 msgid "&Forums" @@ -4185,7 +4016,7 @@ msgstr "&Forum" #: frame_main.cpp:520 msgid "Visit Aegisub's forums" -msgstr "Odwiedź forum Aegisub'a" +msgstr "Odwiedź forum Aegisuba" #: frame_main.cpp:521 msgid "&Bug Tracker..." @@ -4193,7 +4024,7 @@ msgstr "&Bug tracker..." #: frame_main.cpp:521 msgid "Visit Aegisub's bug tracker to report bugs and request new features" -msgstr "Odwiedź bug tracker Aegisub'a by zgłaszać bugi i proponować nowe funkcje" +msgstr "Odwiedź bug tracker Aegisuba by zgłaszać bugi i proponować nowe funkcje" #: frame_main.cpp:522 msgid "&IRC Channel" @@ -4201,7 +4032,7 @@ msgstr "Kanał &IRC" #: frame_main.cpp:522 msgid "Visit Aegisub's official IRC channel" -msgstr "Odwiedź oficjalny kanał IRC Aegisub'a" +msgstr "Odwiedź oficjalny kanał IRC Aegisuba" #: frame_main.cpp:526 msgid "&Check for Updates..." @@ -4209,7 +4040,7 @@ msgstr "&Sprawdź dostępność aktualizacji..." #: frame_main.cpp:526 msgid "Check to see if there is a new version of Aegisub available" -msgstr "Sprawdza czy jest dostępna nowa wersja Aegisub'a" +msgstr "Sprawdza czy jest dostępna nowa wersja Aegisuba" #: frame_main.cpp:527 msgid "&About" @@ -4219,8 +4050,7 @@ msgstr "&O programie" msgid "Save subtitles file" msgstr "Zapisz plik napisów" -#: frame_main.cpp:759 -#: frame_main_events.cpp:742 +#: frame_main.cpp:759 frame_main_events.cpp:742 msgid "Choose charset code:" msgstr "Wybierz kod kodowania znaków" @@ -4266,20 +4096,20 @@ msgid "" "\n" "Change subtitles resolution to match video?" msgstr "" -"Rozdzielczość wczytanego wideo oraz rozdzielczość opisana w skrypcie nie pasują\n" +"Wczytane wideo ma inną rozdzielczość niż ta podana we właściwościach pliku.\n" "\n" "Rozdzielczość wideo:\t%d x %d\n" "Rozdzielczość skryptu:\t%d x %d\n" "\n" -"Dopasować rozdzielczość do wideo?" +"Czy chcesz zmienić rozdzielczość we właściwościach na tą z wideo?" #: frame_main.cpp:1117 msgid "Resolution mismatch" -msgstr "Niezgodność rozdzielczość" +msgstr "Niezgodność rozdzielczości" #: frame_main.cpp:1124 msgid "Change script resolution" -msgstr "Przelicz rozdzielczość skryptu" +msgstr "Przelicz rozdzielczość pliku" #: frame_main_events.cpp:274 msgid "Empty" @@ -4289,13 +4119,11 @@ msgstr "Puste" msgid "No Automation macros loaded" msgstr "Brak załadowanych makr automatyzacji" -#: frame_main_events.cpp:665 -#: frame_main_events.cpp:688 +#: frame_main_events.cpp:665 frame_main_events.cpp:688 msgid "Video Formats" msgstr "Formaty wideo" -#: frame_main_events.cpp:666 -#: frame_main_events.cpp:816 +#: frame_main_events.cpp:666 frame_main_events.cpp:816 #: frame_main_events.cpp:831 msgid "All Files" msgstr "Wszystkie pliki" @@ -4320,8 +4148,7 @@ msgstr "Otwórz plik audio" msgid "Charset" msgstr "Kodowanie znaków" -#: frame_main_events.cpp:815 -#: frame_main_events.cpp:830 +#: frame_main_events.cpp:815 frame_main_events.cpp:830 msgid "All Supported Types" msgstr "Wszystkie wspierane typy" @@ -4389,14 +4216,11 @@ msgstr "uprość tagi." msgid "hide tags." msgstr "ukryj tagi." -#: hotkeys.cpp:331 -#: hotkeys.cpp:335 +#: hotkeys.cpp:331 hotkeys.cpp:335 msgid "Exit" msgstr "Wyjście" -#: hotkeys.cpp:332 -#: hotkeys.cpp:336 -#: video_box.cpp:124 +#: hotkeys.cpp:332 hotkeys.cpp:336 video_box.cpp:124 msgid "Help" msgstr "Pomoc" @@ -4408,8 +4232,7 @@ msgstr "Pole edycji Zatwierdź" msgid "Undo" msgstr "Cofnij" -#: hotkeys.cpp:343 -#: hotkeys.cpp:345 +#: hotkeys.cpp:343 hotkeys.cpp:345 msgid "Redo" msgstr "Ponów" @@ -4429,8 +4252,7 @@ msgstr "Wklej" msgid "Paste Over" msgstr "Wklej na" -#: hotkeys.cpp:363 -#: hotkeys.cpp:365 +#: hotkeys.cpp:363 hotkeys.cpp:365 msgid "Video Jump" msgstr "Wideo Skocz do" @@ -4502,8 +4324,7 @@ msgstr "Siatka, przenieś wiersz w dół" msgid "Grid move row up" msgstr "Siatka, przenieś wiersz w górę" -#: hotkeys.cpp:390 -#: hotkeys.cpp:392 +#: hotkeys.cpp:390 hotkeys.cpp:392 msgid "Grid delete rows" msgstr "Siatka, usuń wiersze" @@ -4723,8 +4544,7 @@ msgstr "Ładowanie klatek kluczowych" msgid "Reading keyframes from video" msgstr "Odczytywanie klatek kluczowych z wideo" -#: mkv_wrap.cpp:170 -#: mkv_wrap.cpp:398 +#: mkv_wrap.cpp:170 mkv_wrap.cpp:398 msgid "Parsing Matroska" msgstr "Przetwarzanie Matroski" @@ -4840,8 +4660,7 @@ msgstr "Czas w klatkach" msgid "actor change" msgstr "zmiana aktora" -#: subs_edit_box.cpp:653 -#: subs_edit_box.cpp:679 +#: subs_edit_box.cpp:653 subs_edit_box.cpp:679 msgid "layer change" msgstr "zmiana warstwy" @@ -4880,7 +4699,7 @@ msgstr "Brak propozycji poprawek." #: subs_edit_ctrl.cpp:812 #, c-format msgid "Add \"%s\" to dictionary" -msgstr "Dodaj \"%s\" do słownika" +msgstr "Dodaj \"%s\" do słownika" #: subs_edit_ctrl.cpp:820 msgid "No spell checker suggestions" @@ -4891,8 +4710,7 @@ msgstr "Brak sugestii" msgid "Spell checker suggestions for \"%s\"" msgstr "Sprawdzania pisowni, sugestie dla \"%s\"" -#: subs_edit_ctrl.cpp:847 -#: subs_edit_ctrl.cpp:933 +#: subs_edit_ctrl.cpp:847 subs_edit_ctrl.cpp:933 msgid "Disable" msgstr "Wyłącz" @@ -4903,11 +4721,11 @@ msgstr "Język sprawdzania pisowni" #: subs_edit_ctrl.cpp:911 #, c-format msgid "Thesaurus suggestions for \"%s\"" -msgstr "Tezaurus, sugestie dla \"%s\"" +msgstr "Tezaurus, sugestie dla \"%s\"" #: subs_edit_ctrl.cpp:918 msgid "No thesaurus suggestions" -msgstr "Tezaurus, brak propozycji." +msgstr "Tezaurus: brak propozycji." #: subs_edit_ctrl.cpp:946 msgid "Thesaurus language" @@ -4917,15 +4735,11 @@ msgstr "Język tezaurusa" msgid "Cu&t" msgstr "W&ytnij" -#: subs_edit_ctrl.cpp:954 -#: subs_grid.cpp:198 -#: timeedit_ctrl.cpp:307 +#: subs_edit_ctrl.cpp:954 subs_grid.cpp:198 timeedit_ctrl.cpp:307 msgid "&Copy" msgstr "&Kopiuj" -#: subs_edit_ctrl.cpp:955 -#: subs_grid.cpp:200 -#: timeedit_ctrl.cpp:308 +#: subs_edit_ctrl.cpp:955 subs_grid.cpp:200 timeedit_ctrl.cpp:308 msgid "&Paste" msgstr "&Wklej" @@ -5049,8 +4863,7 @@ msgstr "Zapisz klip audio" msgid "Couldn't allocate memory." msgstr "Nie można przydzielić pamięci." -#: subs_grid.cpp:813 -#: subs_grid.cpp:814 +#: subs_grid.cpp:813 subs_grid.cpp:814 msgid "load" msgstr "ładuj" @@ -5194,8 +5007,7 @@ msgstr "Standard" msgid "Standard mode, double click sets position" msgstr "Tryb standardowy, dwuklik ustawia pozycje" -#: video_box.cpp:115 -#: visual_tool_vector_clip.cpp:70 +#: video_box.cpp:115 visual_tool_vector_clip.cpp:70 msgid "Drag" msgstr "Przeciągnij" @@ -5279,25 +5091,20 @@ msgstr "Kopiuj współrzędne do schowka" msgid "Unknown" msgstr "Nieznany" -#: video_provider_avs.cpp:289 -#: video_provider_dshow.cpp:311 +#: video_provider_avs.cpp:289 video_provider_dshow.cpp:311 msgid "You already have timecodes loaded. Replace them with the timecodes from the Matroska file?" msgstr "Masz już załadowane timekody. Zamienić je z timekodami z pliku Matroski?" -#: video_provider_avs.cpp:289 -#: video_provider_dshow.cpp:311 -#: video_provider_ffmpegsource.cpp:269 -#: video_provider_lavc.cpp:149 +#: video_provider_avs.cpp:289 video_provider_dshow.cpp:311 +#: video_provider_ffmpegsource.cpp:269 video_provider_lavc.cpp:149 msgid "Replace timecodes?" msgstr "Zamienić timekody?" -#: video_provider_ffmpegsource.cpp:269 -#: video_provider_lavc.cpp:149 +#: video_provider_ffmpegsource.cpp:269 video_provider_lavc.cpp:149 msgid "You already have timecodes loaded. Would you like to replace them with timecodes from the video file?" msgstr "Masz już załadowane timekody. Zamienić je z timekodami z pliku wideo?" -#: visual_tool.cpp:285 -#: visual_tool_drag.cpp:117 +#: visual_tool.cpp:285 visual_tool_drag.cpp:117 msgid "visual typesetting" msgstr "visual typesetting" @@ -5339,7 +5146,7 @@ msgstr "Wstaw" #: visual_tool_vector_clip.cpp:75 msgid "Inserts a control point" -msgstr "Wstawia punk kontrolny" +msgstr "Wstawia punkt kontrolny" #: visual_tool_vector_clip.cpp:76 msgid "Remove" @@ -5421,7 +5228,7 @@ msgstr "Rysuje wygładzoną odręczną figurę" #~ msgstr "Narzędzia wizualne Wycinek wektorowy" #~ msgid "This build of Aegisub uses the following C/C++ libraries:\n" -#~ msgstr "Ten build Aegisub'a używa następujących bibliotek C/C++ :\n" +#~ msgstr "Ten build Aegisuba używa następujących bibliotek C/C++:\n" #~ msgid "Manual by:" #~ msgstr "Manual:" @@ -5511,14 +5318,8 @@ msgstr "Rysuje wygładzoną odręczną figurę" #~ msgid "Video Screenshot Path" #~ msgstr "Ścieżka screenshotów video" -#~ msgid "" -#~ "Warning! The file is being opened using Avisynth's DirectShowSource, " -#~ "which has unreliable seeking. Frame numbers might not match the real " -#~ "number. PROCEED AT YOUR OWN RISK!" -#~ msgstr "" -#~ "Uwaga! Plik jest otwierany przy użyciu DirectShowSource z Avisynth, " -#~ "który ma zawodne wyszukiwanie. Ilość klatek może się nie zgadzać z " -#~ "rzeczywistością. " +#~ msgid "Warning! The file is being opened using Avisynth's DirectShowSource, which has unreliable seeking. Frame numbers might not match the real number. PROCEED AT YOUR OWN RISK!" +#~ msgstr "Uwaga! Plik jest otwierany przy użyciu DirectShowSource z Avisynth, który ma zawodne wyszukiwanie. Ilość klatek może się nie zgadzać z rzeczywistością. " #~ msgid "DirectShow" #~ msgstr "DirectShow" @@ -5526,28 +5327,17 @@ msgstr "Rysuje wygładzoną odręczną figurę" #~ msgid "Dummy Video Provider" #~ msgstr "Provider atrapy wideo" -#~ msgid "" -#~ "Automation module is Copyright (c) 2005-2006 Niels Martin Hansen (aka " -#~ "jfs).\n" -#~ msgstr "" -#~ "Moduł Automatyzacji - Copyright (c) 2005-2006 Niels Martin Hansen (aka " -#~ "jfs).\n" +#~ msgid "Automation module is Copyright (c) 2005-2006 Niels Martin Hansen (aka jfs).\n" +#~ msgstr "Moduł Automatyzacji - Copyright (c) 2005-2006 Niels Martin Hansen (aka jfs).\n" -#~ msgid "" -#~ "Motion tracker module is Copyright (c) 2006 Hajo Krabbenhoeft (aka " -#~ "Tentacle).\n" -#~ msgstr "" -#~ "Moduł Motion tracker - Copyright (c) 2006 Hajo Krabbenhoeft (aka " -#~ "Tentacle).\n" +#~ msgid "Motion tracker module is Copyright (c) 2006 Hajo Krabbenhoeft (aka Tentacle).\n" +#~ msgstr "Moduł Motion tracker - Copyright (c) 2006 Hajo Krabbenhoeft (aka Tentacle).\n" -#~ msgid "" -#~ "Coding by ArchMageZeratuL, jfs, Myrsloik, equinox, Tentacle and nmap.\n" -#~ msgstr "" -#~ "Kodowanie: ArchMageZeratuL, jfs, Myrsloik, equinox, Tentacle and nmap.\n" +#~ msgid "Coding by ArchMageZeratuL, jfs, Myrsloik, equinox, Tentacle and nmap.\n" +#~ msgstr "Kodowanie: ArchMageZeratuL, jfs, Myrsloik, equinox, Tentacle and nmap.\n" #~ msgid "Manual by ArchMage ZeratuL, jfs, movax, Kobi, TheFluff and Jcubed.\n" -#~ msgstr "" -#~ "Instrukcja: ArchMage ZeratuL, jfs, movax, Kobi, TheFluff and Jcubed.\n" +#~ msgstr "Instrukcja: ArchMage ZeratuL, jfs, movax, Kobi, TheFluff and Jcubed.\n" #~ msgid "SVN hosting by BerliOS and Mentar.\n" #~ msgstr "Hosting SVN: BerliOS and Mentar.\n" @@ -5555,9 +5345,8 @@ msgstr "Rysuje wygładzoną odręczną figurę" #~ msgid "Stop" #~ msgstr "Stop" -#~ msgid "" -#~ "Substation Alpha Mode - Left click sets start and right click sets end" -#~ msgstr "Tryb Substation Alpha - LPM ustawia początek a PPM koniec" +#~ msgid "Substation Alpha Mode - Left click sets start and right click sets end" +#~ msgstr "Tryb Substation Alpha - LPM ustawia początek a PPM koniec" #~ msgid "&Create..." #~ msgstr "U&twórz" @@ -5577,7 +5366,7 @@ msgstr "Rysuje wygładzoną odręczną figurę" #~ msgid "Number of points to track:" #~ msgstr "Liczba punktów do wyśledzenia" -#~ msgid "Minimal (squared) distance between two points: " +#~ msgid "Minimal (squared) distance between two points: " #~ msgstr "Minimalna (spotęgowana) odległość pomiędzy dwoma punktami:" #~ msgid "Maximum feature movement:" @@ -5607,12 +5396,8 @@ msgstr "Rysuje wygładzoną odręczną figurę" #~ msgid "Go!" #~ msgstr "Start!" -#~ msgid "" -#~ "List of all hotkeys (shortcuts) available in Aegisub. Double click on any " -#~ "item to reassign it." -#~ msgstr "" -#~ "Lista wszystkich skrótów klawiszowych dostępnych w Aegisub. Kliknij " -#~ "dwukrotnie na któryś z nich aby go zmodyfikować." +#~ msgid "List of all hotkeys (shortcuts) available in Aegisub. Double click on any item to reassign it." +#~ msgstr "Lista wszystkich skrótów klawiszowych dostępnych w Aegisub. Kliknij dwukrotnie na któryś z nich aby go zmodyfikować." #~ msgid "Choose" #~ msgstr "Wybierz" @@ -5705,7 +5490,7 @@ msgstr "Rysuje wygładzoną odręczną figurę" #~ msgstr "Wymusza na wideo proporcje obrazu (4:3)" #~ msgid "Forces video to widescreen aspect ratio" -#~ msgstr "Wymusza na wideo proporcje obrazu (16:9)" +#~ msgstr "Wymusza na wideo proporcje obrazu (16:9)" #~ msgid "&2.35 Aspect Ratio" #~ msgstr "Proporcje obrazu 2.35" @@ -5717,7 +5502,7 @@ msgstr "Rysuje wygładzoną odręczną figurę" #~ msgstr "&Narzędzia" #~ msgid "Visit Aegisub's bug tracker" -#~ msgstr "Odwiedź bug tracker Aegisub'a" +#~ msgstr "Odwiedź bug tracker Aegisuba" #~ msgid "Save file" #~ msgstr "Zapisz plik" From 2c927bac320233817fc6290ee1f5e2eaf598c486 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Sun, 23 May 2021 22:33:27 +0100 Subject: [PATCH 264/271] meson: make --force-fallback-for=luajit work This option makes the dependency() call resolve to the subproject which breaks the Lua 5.2 compatibility check. This change just ignores the result of the dependency() call if it resolves to the subproject and then re-fetches it with a subproject() call later. Alternatively we could explicitly handle the case where dependency() resolves to the subproject, but that's just extra code for no observable difference in behaviour. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index cd03a4f27..8f4bac08e 100644 --- a/meson.build +++ b/meson.build @@ -251,7 +251,7 @@ conf_platform = configuration_data() conf_platform.set('DEFAULT_PLAYER_AUDIO', def_audio) luajit = dependency('luajit', version: '>=2.0.0', required: get_option('system_luajit')) -if luajit.found() +if luajit.found() and luajit.type_name() != 'internal' luajit_test = cc.run('''#include int main(void) { From dfb0a1ca9948d014d24c200166839a6aeefc3485 Mon Sep 17 00:00:00 2001 From: Myaamori Date: Sun, 23 May 2021 22:41:44 +0100 Subject: [PATCH 265/271] meson: don't use deprecated get_pkgconfig_variable --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 8f4bac08e..f96178726 100644 --- a/meson.build +++ b/meson.build @@ -280,7 +280,7 @@ if not deps.contains(luajit) luajit_inc = luajit_sp.get_variable('src_inc') deps += luajit_sp.get_variable('luajit_dep') else - luajit_inc = include_directories(luajit.get_pkgconfig_variable('includedir')) + luajit_inc = include_directories(luajit.get_variable('includedir')) endif subdir('subprojects/luabins/src') From 7e9c7d7aa04f9b7a4009b4ee8dc9c1a1ee21776a Mon Sep 17 00:00:00 2001 From: woclass <5158738+inkydragon@users.noreply.github.com> Date: Mon, 24 May 2021 11:33:33 +0800 Subject: [PATCH 266/271] Run tests (#125) * [git] ignore IDE setting, Meson subprojects * [win_installer] rename *.mo -> *.gmo * [win_installer] only add aeg translations * [win_installer] split aeg/wx translations * [win_installer] gen & pack translations * [git] ignore hunspell source dir * [git] ignore uchardet source dir * [test] Generate the test executable run with `meson test` * [test] add tools to remove test data files `unset.bat FULL_PATH` * [test] set to correct Error type * [test] Set Source character sets to UTF-8 for MSVC * [test] move test data files to build_root * [git] remove IDE dir * [git] ignore gtest subprojects * [ci] run test in ci * [meson/test] use more meaningful name * [test] Add more comments and help msg --- .github/workflows/ci.yml | 3 ++ .gitignore | 1 + meson.build | 1 + tests/meson.build | 88 ++++++++++++++++++++++++++++++++++++++++ tests/tests/keyframe.cpp | 5 ++- tests/unset.bat | 23 +++++++++++ 6 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 tests/meson.build create mode 100644 tests/unset.bat diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3661ee3a2..70f1abd6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,9 @@ jobs: - name: Build run: meson compile -C build + + - name: Run test + run: meson test -C build --verbose - name: Generate Windows installer if: matrix.config.os == 'windows-latest' diff --git a/.gitignore b/.gitignore index e07ce77b9..6d5927351 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ subprojects/fontconfig* subprojects/freetype2 subprojects/fribidi subprojects/glib* +subprojects/googletest-* subprojects/harfbuzz subprojects/icu subprojects/libass diff --git a/meson.build b/meson.build index f96178726..3edcd25d2 100644 --- a/meson.build +++ b/meson.build @@ -320,6 +320,7 @@ subdir('libaegisub') subdir('packages') subdir('po') subdir('src') +subdir('tests') aegisub_cpp_pch = ['src/include/agi_pre.h'] aegisub_c_pch = ['src/include/agi_pre_c.h'] diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 000000000..32eaa677b --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,88 @@ +all_test_deps = [] +all_test_dep_libs = [] +all_test_sources = [] + + +gtest_proj = subproject('gtest') +gtest_dep = gtest_proj.get_variable('gtest_dep') +gmock_dep = gtest_proj.get_variable('gmock_dep') + + +all_test_deps += [ + gtest_dep, + gmock_dep, + iconv_dep, + boost_dep +] +all_test_dep_libs += [ + libaegisub +] +all_test_sources += [ + 'support/main.cpp', + 'support/util.cpp', + + 'tests/access.cpp', + 'tests/audio.cpp', + 'tests/cajun.cpp', + 'tests/calltip_provider.cpp', + 'tests/character_count.cpp', + 'tests/color.cpp', + 'tests/dialogue_lexer.cpp', + 'tests/format.cpp', + 'tests/fs.cpp', + 'tests/hotkey.cpp', + 'tests/iconv.cpp', + 'tests/ifind.cpp', + 'tests/karaoke_matcher.cpp', + 'tests/keyframe.cpp', + 'tests/line_iterator.cpp', + 'tests/line_wrap.cpp', + 'tests/mru.cpp', + 'tests/option.cpp', + 'tests/path.cpp', + 'tests/signals.cpp', + 'tests/split.cpp', + 'tests/syntax_highlight.cpp', + 'tests/thesaurus.cpp', + 'tests/time.cpp', + 'tests/type_name.cpp', + 'tests/util.cpp', + 'tests/uuencode.cpp', + 'tests/vfr.cpp', + 'tests/word_split.cpp' +] + +test_inc = include_directories('support') + +# force UTF8 for MSVC +if host_machine.system() == 'windows' + extra_args = ['/utf-8'] +else + extra_args = [] +endif + +runner = executable( + 'gtest-main', + all_test_sources, + include_directories : [test_inc, libaegisub_inc, deps_inc], + dependencies : all_test_deps, + cpp_args : extra_args, + link_with : all_test_dep_libs, +) +test('gtest main', runner) + + +# setup test env +if host_machine.system() == 'windows' + setup_sh = find_program('setup.bat') +else + setup_sh = find_program('setup.sh') +endif + +test_data_des = meson.project_build_root() +custom_target('setup-test-data', + input: runner, + output: 'applied_test_setup', + command: [setup_sh, test_data_des], + build_by_default: true +) diff --git a/tests/tests/keyframe.cpp b/tests/tests/keyframe.cpp index e664b54b7..5b4e49788 100644 --- a/tests/tests/keyframe.cpp +++ b/tests/tests/keyframe.cpp @@ -41,8 +41,9 @@ TEST(lagi_keyframe, save) { TEST(lagi_keyframe, bad_files) { EXPECT_THROW(Load(""), agi::fs::FileSystemError); - EXPECT_THROW(Load("data/keyframe/empty.txt"), Error); - EXPECT_THROW(Load("data/keyframe/garbage.txt"), Error); + // TODO: use more clearly error type + EXPECT_THROW(Load("data/keyframe/empty.txt"), agi::InvalidInputException); + EXPECT_THROW(Load("data/keyframe/garbage.txt"), agi::InvalidInputException); } TEST(lagi_keyframe, xvid) { diff --git a/tests/unset.bat b/tests/unset.bat new file mode 100644 index 000000000..28241512b --- /dev/null +++ b/tests/unset.bat @@ -0,0 +1,23 @@ +@echo off + +IF [%1]==[] GOTO :help + + +:main +@REM Switch to the build directory +cd %1 + +@REM Restores all permissions to the four read-only and access denied files +icacls data\file_access_denied /grant %USERNAME%:F +icacls data\file_read_only /grant %USERNAME%:W +icacls data\dir_access_denied /grant %USERNAME%:F +icacls data\dir_read_only /grant %USERNAME%:W + +@REM Delete the entire test data folder +rmdir /s/q data + + +:help +@REM Show help information +ECHO Restore access and delete the test data folder. +ECHO Usage: unset PATH_TO_BUILD_DIR From 0dffcec461fb0a3eb04419980cde2bf1c644682b Mon Sep 17 00:00:00 2001 From: woclass <5158738+inkydragon@users.noreply.github.com> Date: Mon, 24 May 2021 21:47:34 +0800 Subject: [PATCH 267/271] Fix meson warning (#126) * [git] ignore IDE setting, Meson subprojects * [win_installer] rename *.mo -> *.gmo * [win_installer] only add aeg translations * [win_installer] split aeg/wx translations * [win_installer] gen & pack translations * [git] ignore hunspell source dir * [git] ignore uchardet source dir * [test] Generate the test executable run with `meson test` * [test] add tools to remove test data files `unset.bat FULL_PATH` * [test] set to correct Error type * [test] Set Source character sets to UTF-8 for MSVC * [test] move test data files to build_root * [meson/wxWidgets] fix warning: deprecated feature `cmake_options` * [meson] fix warning: msvc does not support C++11 * [meson/fribidi] add original meson.build file * [meson/fribidi] merge pr-151 https://github.com/fribidi/fribidi/pull/151 "meson: add fribidi_static_cargs to extra_cflags" * [meson/fribidi] fix DEPRECATION "Library fribidi was passed to the "libraries" keyword argument of a previous call to generate() method instead of first positional argument." * [git] rm IDE dir * [meson] remove old flags * [meson] fixed in upstream --- meson.build | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 3edcd25d2..54ad3ee61 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('Aegisub', ['c', 'cpp'], license: 'BSD-3-Clause', meson_version: '>=0.56.1', - default_options: ['cpp_std=c++11', 'buildtype=debugoptimized'], + default_options: ['cpp_std=c++14', 'buildtype=debugoptimized'], version: '3.2.2') cmake = import('cmake') @@ -122,22 +122,29 @@ wx_dep = dependency('wxWidgets', version: wx_minver, if wx_dep.found() deps += wx_dep else - build_shared = 'ON' + build_shared = true if get_option('default_library') == 'static' - build_shared = 'OFF' + build_shared = false endif build_type = 'Release' if get_option('buildtype') == 'debug' build_type = 'Debug' endif - wx = cmake.subproject('wxWidgets', cmake_options: ['-DwxBUILD_INSTALL=OFF', - '-DwxBUILD_PRECOMP=OFF', # otherwise breaks project generation w/ meson - '-DwxBUILD_SHARED=@0@'.format(build_shared), - '-DwxUSE_WEBVIEW=OFF', # breaks build on linux - '-DCMAKE_BUILD_TYPE=@0@'.format(build_type), - '-DwxUSE_IMAGE=ON', - '-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson + opt_var = cmake.subproject_options() + opt_var.add_cmake_defines({ + 'wxBUILD_INSTALL': false, + 'wxBUILD_PRECOMP': false, # otherwise breaks project generation w/ meson + 'wxBUILD_SHARED': build_shared, + + 'wxUSE_WEBVIEW': false, # breaks build on linux + 'CMAKE_BUILD_TYPE': build_type, + 'wxUSE_IMAGE': true, + 'wxBUILD_MONOLITHIC': true # otherwise breaks project generation w/ meson + }) + + wx = cmake.subproject('wxWidgets', options: opt_var) + deps += [ wx.dependency('wxmono'), wx.dependency('wxregex'), From e58e4a9149dd961a9555a01cc2f9db8ca04dc221 Mon Sep 17 00:00:00 2001 From: woclass Date: Tue, 12 Oct 2021 15:37:49 +0800 Subject: [PATCH 268/271] Fix Mac dmg build (#138) * [mac/build] update build steps * [macos] bundle app * [macos] build dmg * [ci] setup macOS CI * [i18n] TODO: rm WX locale files * [deps] set main branch to main * Fix osx-fix-libs.py Create symbolic links, to make libicu happy Rewrite the script in python3, as python2 is deprecated * Add write permission before install_name_tool when doing osx-bundle Fix wangqr/Aegisub#39 * Handle @loader_path in libboost on macOS See wangqr/Aegisub#39 * [tools/mac] use python3 * [ci/mac] install & using system deps * [ci/win] don't build fribidi:docs * [ci/mac] trying openal-soft * [ci/mac] use pulseaudio in CI * [ci/win] only run aeg's test * [ci/win] fix CI * [ci/win] fix CI: not use dict `{}` * [ci] run ci * [ci/win] don't build docs * [ci/win] remove args tail newline * [ci/win] false->disabled * Use md title format Co-authored-by: Ryan Lucia * Recover file permissions. * [ci/win] disable fontconfig Co-Authored-By: Ryan Lucia * [ci/win] disable libass:fontconfig Co-authored-by: wangqr Co-authored-by: Ryan Lucia --- .github/workflows/ci.yml | 50 +++-- README.md | 21 ++- packages/meson.build | 6 +- .../win_installer/fragment_translations.iss | 3 +- src/subtitles_provider.cpp | 2 +- subprojects/harfbuzz.wrap | 2 +- tools/osx-bundle.sh | 38 ++-- tools/osx-dmg.sh | 58 +++--- tools/osx-fix-libs.py | 175 ++++++++++-------- 9 files changed, 218 insertions(+), 137 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70f1abd6e..f53bbf84b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,13 +14,23 @@ jobs: strategy: matrix: config: - - { - name: Windows MSVC Release, - os: windows-latest, - msvc: true, - buildtype: release, - args: '-Ddefault_library=static --force-fallback-for=zlib,harfbuzz,freetype2,fribidi,libpng -Dfreetype2:harfbuzz=disabled -Dharfbuzz:freetype=disabled -Dharfbuzz:cairo=disabled -Dharfbuzz:glib=disabled -Dharfbuzz:gobject=disabled' - } + - name: Windows MSVC Release + os: windows-latest + msvc: true + buildtype: release + args: >- + -Ddefault_library=static + --force-fallback-for=zlib,harfbuzz,freetype2,fribidi,libpng + -Dfreetype2:harfbuzz=disabled + -Dharfbuzz:freetype=disabled + -Dharfbuzz:cairo=disabled + -Dharfbuzz:glib=disabled + -Dharfbuzz:gobject=disabled + -Dharfbuzz:tests=disabled + -Dharfbuzz:docs=disabled + -Dfribidi:tests=false + -Dfribidi:docs=false + -Dlibass:fontconfig=disabled #- { # name: Windows MinGW, # os: windows-latest, @@ -42,13 +52,13 @@ jobs: name: macOS Debug, os: macos-latest, buildtype: debugoptimized, - args: -Ddefault_library=static + args: -Ddefault_library=static -Dbuild_osx_bundle=true -Dlocal_boost=true } - { name: macOS Release, os: macos-latest, buildtype: release, - args: -Ddefault_library=static + args: -Ddefault_library=static -Dbuild_osx_bundle=true -Dlocal_boost=true } steps: @@ -83,9 +93,12 @@ jobs: - name: Install dependencies (MacOS) if: matrix.config.os == 'macos-latest' run: | - brew install luarocks nasm ninja + brew update + brew install luarocks ninja luarocks install luafilesystem 1.8.0 luarocks install moonscript --dev + brew install libass zlib ffms2 fftw hunspell + brew install pulseaudio # NO OpenAL in github CI - name: Install dependencies (Linux) if: matrix.config.os == 'ubuntu-latest' @@ -100,8 +113,9 @@ jobs: run: meson compile -C build - name: Run test - run: meson test -C build --verbose + run: meson test -C build --verbose "gtest main" + # Windows artifacts - name: Generate Windows installer if: matrix.config.os == 'windows-latest' run: meson compile win-installer -C build @@ -123,3 +137,17 @@ jobs: with: name: ${{ matrix.config.name }} - portable path: build/aegisub-portable-64.zip + + # macOS artifacts + - name: Generate macOS installer + if: matrix.config.os == 'macos-latest' + run: | + meson compile osx-bundle -C build + meson compile osx-build-dmg -C build + + - name: Upload artifacts - macOS dmg + uses: actions/upload-artifact@v2 + if: matrix.config.os == 'macos-latest' + with: + name: ${{ matrix.config.name }} - installer + path: build/Aegisub-*.dmg diff --git a/README.md b/README.md index bab339076..892782993 100644 --- a/README.md +++ b/README.md @@ -48,15 +48,24 @@ A vaguely recent version of Xcode and the corresponding command-line tools are r For personal usage, you can use pip and homebrew to install almost all of Aegisub's dependencies: - brew install libass nasm ninja boost zlib icu4c pkg-config ffms2 fftw hunspell gettext cmake - brew link --force gettext - export LDFLAGS="-L/usr/local/opt/icu4c/lib" - export CPPFLAGS="-I/usr/local/opt/icu4c/include" - export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig" - pip install meson + pip3 install meson + brew install cmake ninja pkg-config libass boost zlib ffms2 fftw hunspell + export LDFLAGS="-L/usr/local/opt/icu4c/lib" + export CPPFLAGS="-I/usr/local/opt/icu4c/include" + export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig" Once the dependencies are installed, build Aegisub with `meson build && meson compile -C build`. +#### Build dmg + +```bash +meson build_static -Ddefault_library=static -Dbuildtype=debugoptimized -Dbuild_osx_bundle=true -Dlocal_boost=true +meson compile -C build_static +meson test -C build_static --verbose +meson compile osx-bundle -C build_static +meson compile osx-build-dmg -C build_static +``` + ## Updating Moonscript From within the Moonscript repository, run `bin/moon bin/splat.moon -l moonscript moonscript/ > bin/moonscript.lua`. diff --git a/packages/meson.build b/packages/meson.build index 39be5aae7..1e13be54a 100644 --- a/packages/meson.build +++ b/packages/meson.build @@ -8,9 +8,13 @@ if host_machine.system() == 'windows' run_target('win-portable', command: [portable_setup, meson.project_build_root(), meson.project_source_root()]) elif host_machine.system() == 'darwin' fontconfig_conf = run_command('pkg-config', '--variable=confdir', 'fontconfig').stdout().strip() + bundle_app_sh = find_program(meson.project_source_root() / 'tools/osx-bundle.sh') run_target('osx-bundle', - command: ['../tools/osx-bundle.sh', meson.project_source_root(), meson.project_build_root(), 'wx-config', fontconfig_conf, '', + command: [bundle_app_sh, meson.project_source_root(), meson.project_build_root(), 'wx-config', fontconfig_conf, '', get_option('build_osx_bundle') ? 'TRUE' : 'FALSE']) + build_dmg_sh = find_program(meson.project_source_root() / 'tools/osx-dmg.sh') + run_target('osx-build-dmg', + command: [build_dmg_sh, meson.project_source_root(), meson.project_build_root(), meson.project_version()]) else conf_pkg.set('AEGISUB_COMMAND', 'aegisub') diff --git a/packages/win_installer/fragment_translations.iss b/packages/win_installer/fragment_translations.iss index c54ef3010..5817470e1 100644 --- a/packages/win_installer/fragment_translations.iss +++ b/packages/win_installer/fragment_translations.iss @@ -34,7 +34,8 @@ Source: {#BUILD_ROOT}\po\zh_TW.gmo; DestDir: {app}\locale\zh_TW; DestName: #endif ; END ENABLE_TRANSLATIONS - +;; TODO: rm those lines +;; xref: [Update and review translations · Issue #132 · TypesettingTools/Aegisub](https://github.com/TypesettingTools/Aegisub/issues/132) #ifdef ENABLE_WX_TRANSLATIONS ; wxWidgets localization (commented out ones are out of date; some don't have wxstd.mo) Source: src\mo\wxstd-ar.mo; DestDir: {app}\locale\ar; DestName: wxstd.mo; Flags: ignoreversion; Components: translations diff --git a/src/subtitles_provider.cpp b/src/subtitles_provider.cpp index 057bbbdbd..6d4801324 100644 --- a/src/subtitles_provider.cpp +++ b/src/subtitles_provider.cpp @@ -88,7 +88,7 @@ void SubtitlesProvider::LoadSubtitles(AssFile *subs, int time) { push_line(line.GetEntryData()); if (!subs->Attachments.empty()) { - // TODO: some scripts may have a lot of attachments, + // TODO: some scripts may have a lot of attachments, // so ideally we'd want to write only those actually used on the requested video frame, // but this would require some pre-parsing of the attached font files with FreeType, // which isn't probably trivial. diff --git a/subprojects/harfbuzz.wrap b/subprojects/harfbuzz.wrap index 08bfb0850..10caa4b4a 100644 --- a/subprojects/harfbuzz.wrap +++ b/subprojects/harfbuzz.wrap @@ -1,7 +1,7 @@ [wrap-git] directory = harfbuzz url = https://github.com/harfbuzz/harfbuzz -revision = master +revision = main [provide] harfbuzz = libharfbuzz_dep diff --git a/tools/osx-bundle.sh b/tools/osx-bundle.sh index dbec657d8..f8d4a682e 100755 --- a/tools/osx-bundle.sh +++ b/tools/osx-bundle.sh @@ -4,7 +4,7 @@ set -e SRC_DIR="${1}" BUILD_DIR="${2}" -WX_PREFIX=`${3} --prefix` +WX_PREFIX="" FONTCONFIG_CONF_DIR="${4}" DICT_DIR="${5}" MESON_BUILD_OSX_BUNDLE="${6}" @@ -75,26 +75,28 @@ mkdir -vp "${PKG_DIR}/Contents/Resources/en.lproj" #mv "${PKG_DIR}/Contents/Resources/sr_RS.lproj" "${PKG_DIR}/Contents/Resources/sr_YU.lproj" #mv "${PKG_DIR}/Contents/Resources/sr_RS@latin.lproj" "${PKG_DIR}/Contents/Resources/sr_YU@latin.lproj" -echo -echo "---- Copying WX locale files ----" - -for i in `ls -1 ${SRC_DIR}/po/*.mo|sed "s|po/\(.*\).mo|\1|"`; do - WX_MO="${WX_PREFIX}/share/locale/${i}/LC_MESSAGES/wxstd.mo" - - if ! test -f "${WX_MO}"; then - WX_MO="${HOME_DIR}/wxstd/${i}.mo" - fi - - if test -f "${WX_MO}"; then - cp -v "${WX_MO}" "${PKG_DIR}/Contents/Resources/${i}.lproj/" - else - echo "WARNING: \"$i\" locale in aegisub but no WX catalog found!" - fi -done +## TODO: rm those lines +## xref: [Update and review translations · Issue #132 · TypesettingTools/Aegisub](https://github.com/TypesettingTools/Aegisub/issues/132) +# echo +# echo "---- Copying WX locale files ----" +# +# for i in `ls -1 ${SRC_DIR}/po/*.mo|sed "s|po/\(.*\).mo|\1|"`; do +# WX_MO="${WX_PREFIX}/share/locale/${i}/LC_MESSAGES/wxstd.mo" +# +# if ! test -f "${WX_MO}"; then +# WX_MO="${HOME_DIR}/wxstd/${i}.mo" +# fi +# +# if test -f "${WX_MO}"; then +# cp -v "${WX_MO}" "${PKG_DIR}/Contents/Resources/${i}.lproj/" +# else +# echo "WARNING: \"$i\" locale in aegisub but no WX catalog found!" +# fi +# done echo echo "---- Fixing libraries ----" -sudo python "${SRC_DIR}/tools/osx-fix-libs.py" "${PKG_DIR}/Contents/MacOS/aegisub" || exit $? +sudo python3 "${SRC_DIR}/tools/osx-fix-libs.py" "${PKG_DIR}/Contents/MacOS/aegisub" || exit $? echo echo "Done creating \"${PKG_DIR}\"" diff --git a/tools/osx-dmg.sh b/tools/osx-dmg.sh index 0f7b916b6..24a9ec64b 100755 --- a/tools/osx-dmg.sh +++ b/tools/osx-dmg.sh @@ -15,37 +15,46 @@ set -e -TMP_DMG="temp_dmg" -PKG_DIR="Aegisub.app" -PKG_NAME="Aegisub-${1}" -PKG_NAME_RW="Aegisub-${1}_rw.dmg" -PKG_NAME_VOLUME="Aegisub-${1}" +SRC_DIR="${1}" +BUILD_DIR="${2}" +AEGI_VER="${3}" + +PKG_NAME="Aegisub-${AEGI_VER}" +PKG_NAME_VOLUME="${PKG_NAME}" + +PKG_DIR="${BUILD_DIR}/Aegisub.app" +DMG_TMP_DIR="${BUILD_DIR}/temp_dmg" +DMG_PATH="${BUILD_DIR}/${PKG_NAME}.dmg" +DMG_RW_PATH="${BUILD_DIR}/${PKG_NAME}_rw.dmg" + if ! test -d "${PKG_DIR}"; then echo "\"${PKG_DIR}\" does not exist, please run 'make osx-bundle'" exit 1; fi -rm -rf "${TMP_DMG}" "${PKG_NAME}.dmg" -mkdir -v "${TMP_DMG}" echo -echo "---- Copying ${1} into ${TMP_DMG}/ ----" -cp -R "${PKG_DIR}" "${TMP_DMG}" +echo "---- Removing old \"${DMG_TMP_DIR}\", \"${DMG_PATH}\", \"${DMG_RW_PATH}\" ----" +rm -rf "${DMG_TMP_DIR}" "${DMG_PATH}" "${DMG_RW_PATH}" +mkdir -v "${DMG_TMP_DIR}" +echo +echo "---- Copying ${AEGI_VER} into ${DMG_TMP_DIR}/ ----" +cp -R "${PKG_DIR}" "${DMG_TMP_DIR}" echo echo "---- Setting up ----" -ln -vsf /Applications "${TMP_DMG}" -mkdir -v "${TMP_DMG}/.background" -cp -v packages/osx_dmg/dmg_background.png "${TMP_DMG}/.background/background.png" -cp -v packages/osx_bundle/Contents/Resources/Aegisub.icns "${TMP_DMG}/.VolumeIcon.icns" +ln -vsf /Applications "${DMG_TMP_DIR}" +mkdir -v "${DMG_TMP_DIR}/.background" +cp -v "${SRC_DIR}/packages/osx_dmg/dmg_background.png" "${DMG_TMP_DIR}/.background/background.png" +cp -v "${SRC_DIR}/packages/osx_bundle/Contents/Resources/Aegisub.icns" "${DMG_TMP_DIR}/.VolumeIcon.icns" echo echo "---- Creating image ----" -/usr/bin/hdiutil create -srcfolder "${TMP_DMG}" -volname "${PKG_NAME}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW "${PKG_NAME_RW}" +/usr/bin/hdiutil create -srcfolder "${DMG_TMP_DIR}" -volname "${PKG_NAME}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW "${DMG_RW_PATH}" echo echo "---- Mounting image ----" -DEV_NAME=`/usr/bin/hdiutil attach -readwrite -noverify -noautoopen "${PKG_NAME_RW}" |awk '/GUID_partition_scheme/ {print $1}'` +DEV_NAME=`/usr/bin/hdiutil attach -readwrite -noverify -noautoopen "${DMG_RW_PATH}" |awk '/GUID_partition_scheme/ {print $1}'` echo "Device name: ${DEV_NAME}" echo @@ -61,7 +70,7 @@ if test -n "${SET_STYLE}"; then echo "---- Running AppleScript to set style ----" SCRIPT_TMP=`mktemp /tmp/aegisub_dmg_as.XXX` - sed -f scripts/osx-bundle.sed packages/osx_dmg/dmg_set_style.applescript > ${SCRIPT_TMP} + sed -f "${SRC_DIR}/scripts/osx-bundle.sed" "${SRC_DIR}/packages/osx_dmg/dmg_set_style.applescript" > ${SCRIPT_TMP} /usr/bin/osacompile -o ${SCRIPT_TMP}.scpt ${SCRIPT_TMP} @@ -79,18 +88,18 @@ if test -n "${SET_STYLE}"; then hdiutil detach "${DEV_NAME}" - DEV_NAME=`/usr/bin/hdiutil attach -readwrite -noverify -noautoopen "${PKG_NAME_RW}" |awk '/GUID_partition_scheme/ {print $1}'` + DEV_NAME=`/usr/bin/hdiutil attach -readwrite -noverify -noautoopen "${DMG_RW_PATH}" |awk '/GUID_partition_scheme/ {print $1}'` echo "Device name: ${DEV_NAME}" - cp -v "/Volumes/${PKG_NAME_VOLUME}/.DS_Store" packages/osx_dmg/DS_Store - SetFile -a v packages/osx_dmg/DS_Store + cp -v "/Volumes/${PKG_NAME_VOLUME}/.DS_Store" "${SRC_DIR}/packages/osx_dmg/DS_Store" + SetFile -a v "${SRC_DIR}/packages/osx_dmg/DS_Store" hdiutil detach "${DEV_NAME}" - rm -rf "${TMP_DMG}" "${PKG_NAME_RW}" ${SCRIPT_TMP}.scpt ${SCRIPT_TMP} + rm -rf "${DMG_TMP_DIR}" "${DMG_RW_PATH}" ${SCRIPT_TMP}.scpt ${SCRIPT_TMP} exit 0 else echo "---- Installing DS_Store ----" - cp -v packages/osx_dmg/DS_Store "/Volumes/${PKG_NAME_VOLUME}/.DS_Store" + cp -v "${SRC_DIR}/packages/osx_dmg/DS_Store" "/Volumes/${PKG_NAME_VOLUME}/.DS_Store" fi echo @@ -100,11 +109,10 @@ echo /usr/bin/hdiutil detach "${DEV_NAME}" -force echo echo "---- Compressing ----" -/usr/bin/hdiutil convert "${PKG_NAME_RW}" -format UDBZ -imagekey bzip2-level=9 -o "${PKG_NAME}.dmg" +/usr/bin/hdiutil convert "${DMG_RW_PATH}" -format UDBZ -imagekey bzip2-level=9 -o "${DMG_PATH}" -echo -echo "---- Removing \"${TMP_DMG}\", \"${PKG_NAME_RW}\" ----" -rm -rf "${TMP_DMG}" "${PKG_NAME_RW}" +echo "---- Removing temp dmg \"${DMG_RW_PATH}\" ----" +rm -rf "${DMG_RW_PATH}" echo echo "Done!" diff --git a/tools/osx-fix-libs.py b/tools/osx-fix-libs.py index 845a56b97..e29c8180f 100755 --- a/tools/osx-fix-libs.py +++ b/tools/osx-fix-libs.py @@ -5,99 +5,128 @@ import sys import os import shutil import stat +import subprocess is_bad_lib = re.compile(r'(/usr/local|/opt)').match is_sys_lib = re.compile(r'(/usr|/System)').match -otool_libname_extract = re.compile(r'\s+(/.*?)[\(\s:]').search +otool_libname_extract = re.compile(r'\s+(/.*?)[(\s:]').search +otool_loader_path_extract = re.compile(r'\s+@loader_path/(.*?)[(\s:]').search goodlist = [] badlist = [] link_map = {} + def otool(cmdline): - pipe = os.popen("otool " + cmdline, 'r') - output = pipe.readlines() - pipe.close() - return output + with subprocess.Popen(['otool'] + cmdline, stdout=subprocess.PIPE, + encoding='utf-8') as p: + return p.stdout.readlines() + def collectlibs(lib, masterlist, targetdir): - global goodlist, link_map - liblist = otool("-L '" + lib + "'") - locallist = [] + global goodlist, link_map + liblist = otool(['-L', lib]) + locallist = [] - for l in liblist: - lr = otool_libname_extract(l) - if not lr: continue - l = lr.group(1) - if is_bad_lib(l) and not l in badlist: - badlist.append(l) - if ((not is_sys_lib(l)) or is_bad_lib(l)) and not l in masterlist: - locallist.append(l) - print("found %s:" % l) + for l in liblist: + lr = otool_libname_extract(l) + if lr: + l = lr.group(1) + else: + lr = otool_loader_path_extract(l) + if lr: + l = os.path.join(os.path.dirname(lib), lr.group(1)) + else: + continue + if is_bad_lib(l) and l not in badlist: + badlist.append(l) + if ((not is_sys_lib(l)) or is_bad_lib(l)) and l not in masterlist: + locallist.append(l) + print("found %s:" % l) - check = l - link_list = [] - while check: - if os.path.isfile(check) and not os.path.islink(check): - os.system("cp '%s' '%s'" % (check, targetdir)) - print(" FILE %s ... copied to target" % check) - if link_list: - for link in link_list: - link_map[link] = os.path.basename(check) - break - - if os.path.islink(check): - print(" LINK %s" % check) - link_list.append(os.path.basename(check)) - check = os.path.dirname(check) + "/" + os.readlink(check) + check = l + link_list = [] + while check: + basename = os.path.basename(check) + target = os.path.join(targetdir, basename) - elif not l in goodlist and not l in masterlist: - goodlist.append(l) - masterlist.extend(locallist) + if os.path.isfile(check) and not os.path.islink(check): + try: + shutil.copy(check, target) + except PermissionError: + print(" FILE %s ... skipped" % check) + break + print(" FILE %s ... copied to target" % check) + if link_list: + for link in link_list: + link_map[link] = basename + break - for l in locallist: - collectlibs(l, masterlist, targetdir) + if os.path.islink(check): + link_dst = os.readlink(check) + try: + os.symlink(link_dst, target) + except FileExistsError: + print(" LINK %s ... existed" % check) + break + print(" LINK %s ... copied to target" % check) + link_list.append(basename) + check = os.path.join(os.path.dirname(check), link_dst) -exit; -binname = sys.argv[1] -targetdir = os.path.dirname(binname) -print("Searching for libraries in ", binname, "...") -libs = [binname] -collectlibs(sys.argv[1], libs, targetdir) + elif l not in goodlist and l not in masterlist: + goodlist.append(l) + masterlist.extend(locallist) + + for l in locallist: + collectlibs(l, masterlist, targetdir) -print() -print("System libraries used...") -goodlist.sort() -for l in goodlist: - print(l) +if __name__ == '__main__': + binname = sys.argv[1] + targetdir = os.path.dirname(binname) + print("Searching for libraries in", binname, "...") + libs = [binname] + collectlibs(binname, libs, targetdir) + print() + print("System libraries used...") + goodlist.sort() + for l in goodlist: + print(l) -print() -print("Fixing library install names...") -in_tool_cmdline = "install_name_tool " -for lib in libs: - libbase = os.path.basename(lib) - if libbase in link_map: - libbase = link_map[libbase] - in_tool_cmdline = in_tool_cmdline + ("-change '%s' '@executable_path/%s' " % (lib, libbase)) -for lib in libs: - libbase = os.path.basename(lib) + print() + print("Fixing library install names...") + in_tool_cmdline = ['install_name_tool'] + for lib in libs: + libbase = os.path.basename(lib) + if libbase in link_map: + libbase = link_map[libbase] + in_tool_cmdline = in_tool_cmdline + ['-change', lib, + '@executable_path/' + libbase] + for lib in libs: + libbase = os.path.basename(lib) - if libbase in link_map: - libbase = link_map[libbase] - print("%s -> @executable_path/%s (REMAPPED)" % (lib, libbase)) - else: - print("%s -> @executable_path/%s" % (lib, libbase)) + if libbase in link_map: + libbase = link_map[libbase] + print("%s -> @executable_path/%s (REMAPPED)" % (lib, libbase)) + else: + print("%s -> @executable_path/%s" % (lib, libbase)) - os.system("%s -id '@executable_path/%s' '%s/%s'" % (in_tool_cmdline, libbase, targetdir, libbase)) - sys.stdout.flush() + targetlib = targetdir + '/' + libbase + orig_permission = os.stat(targetlib).st_mode + if not(orig_permission & stat.S_IWUSR): + os.chmod(targetlib, orig_permission | stat.S_IWUSR) + subprocess.run(in_tool_cmdline + ['-id', '@executable_path/' + libbase, + targetlib]) + if not(orig_permission & stat.S_IWUSR): + os.chmod(targetlib, orig_permission) -if badlist: - print() - print("WARNING: The following libraries have blacklisted paths:") - for lib in sorted(badlist): - print(lib) - print("These paths normally have files from a package manager, which means that end result may not work if copied to another machine.") + if badlist: + print() + print("WARNING: The following libraries have blacklisted paths:") + for lib in sorted(badlist): + print(lib) + print( + "These paths normally have files from a package manager, which means that end result may not work if copied to another machine.") -print() -print("All done!") + print() + print("All done!") From 18503946d58fb05da2d8a47e0a1651deb02ec3a3 Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Thu, 11 Nov 2021 01:39:44 +0200 Subject: [PATCH 269/271] meson: don't check disabled dependencies at all Don't search for the dependency and set up fallback only to throw it away if the option is disabled. This is a waste, and this gives the user the illusion that the request to disable the feature was ignored. --- meson.build | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/meson.build b/meson.build index 54ad3ee61..eeade16a0 100644 --- a/meson.build +++ b/meson.build @@ -193,25 +193,27 @@ foreach dep: [ ['hunspell', '', 'Hunspell', ['hunspell', 'hunspell_dep']], ['uchardet', '', 'uchardet', ['uchardet', 'uchardet_dep']], ] - dep_version = dep[1] != '' ? dep[1] : '>=0' - # [provide] section is ignored if required is false; - # must provided define fallback explicitly - # (with meson 0.56 you can do allow_fallback: true): - #d = dependency(dep[0], version: dep_version, - # required: false, allow_fallback: true) - if dep[3].length() > 0 - d = dependency(dep[0], version: dep_version, fallback: dep[3]) - else - d = dependency(dep[0], version: dep_version, required: false) - endif - optname = dep[0].split('-')[0] - if d.found() and not get_option(optname).disabled() - deps += d - conf.set('WITH_@0@'.format(dep[0].split('-')[0].to_upper()), 1) - dep_avail += dep[2] - elif get_option(optname).enabled() - error('@0@ enabled but not found'.format(dep[2])) + if not get_option(optname).disabled() + dep_version = dep[1] != '' ? dep[1] : '>=0' + # [provide] section is ignored if required is false; + # must provided define fallback explicitly + # (with meson 0.56 you can do allow_fallback: true): + #d = dependency(dep[0], version: dep_version, + # required: false, allow_fallback: true) + if dep[3].length() > 0 + d = dependency(dep[0], version: dep_version, fallback: dep[3]) + else + d = dependency(dep[0], version: dep_version, required: false) + endif + + if d.found() + deps += d + conf.set('WITH_@0@'.format(dep[0].split('-')[0].to_upper()), 1) + dep_avail += dep[2] + elif get_option(optname).enabled() + error('@0@ enabled but not found'.format(dep[2])) + endif endif endforeach From 1d01f8adc8367a0cad4b539968078dd3afe2e2eb Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Thu, 11 Nov 2021 02:02:35 +0200 Subject: [PATCH 270/271] meson: allow unconstrained dependency version to be "unknown" And allow for compound version constraints in the future. --- meson.build | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index eeade16a0..dc04cc556 100644 --- a/meson.build +++ b/meson.build @@ -182,29 +182,28 @@ deps += dependency('icu-i18n', version: '>=4.8.1.1') dep_avail = [] foreach dep: [ # audio, in order of precedence - ['libpulse', '', 'PulseAudio', []], - ['alsa', '', 'ALSA', []], - ['portaudio-2.0', '', 'PortAudio', []], + ['libpulse', [], 'PulseAudio', []], + ['alsa', [], 'ALSA', []], + ['portaudio-2.0', [], 'PortAudio', []], ['openal', '>=0.0.8', 'OpenAL', []], # video ['ffms2', '>=2.22', 'FFMS2', ['ffms2', 'ffms2_dep']], # other - ['fftw3', '', 'FFTW3', []], - ['hunspell', '', 'Hunspell', ['hunspell', 'hunspell_dep']], - ['uchardet', '', 'uchardet', ['uchardet', 'uchardet_dep']], + ['fftw3', [], 'FFTW3', []], + ['hunspell', [], 'Hunspell', ['hunspell', 'hunspell_dep']], + ['uchardet', [], 'uchardet', ['uchardet', 'uchardet_dep']], ] optname = dep[0].split('-')[0] if not get_option(optname).disabled() - dep_version = dep[1] != '' ? dep[1] : '>=0' # [provide] section is ignored if required is false; # must provided define fallback explicitly # (with meson 0.56 you can do allow_fallback: true): - #d = dependency(dep[0], version: dep_version, + #d = dependency(dep[0], version: dep[1], # required: false, allow_fallback: true) if dep[3].length() > 0 - d = dependency(dep[0], version: dep_version, fallback: dep[3]) + d = dependency(dep[0], version: dep[1], fallback: dep[3]) else - d = dependency(dep[0], version: dep_version, required: false) + d = dependency(dep[0], version: dep[1], required: false) endif if d.found() From f21d8a36073acecad56b2621219ba82fedc04e37 Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Thu, 11 Nov 2021 02:18:24 +0200 Subject: [PATCH 271/271] meson: use OpenAL.framework on macOS It is not picked up by the existing dependency() check because its version is unknown to Meson, which fails the version constraint. Besides, dependency('openal') seems to try "openal.framework", which may or may not work on case-sensitive file systems. --- meson.build | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index dc04cc556..433ca01ee 100644 --- a/meson.build +++ b/meson.build @@ -182,16 +182,16 @@ deps += dependency('icu-i18n', version: '>=4.8.1.1') dep_avail = [] foreach dep: [ # audio, in order of precedence - ['libpulse', [], 'PulseAudio', []], - ['alsa', [], 'ALSA', []], - ['portaudio-2.0', [], 'PortAudio', []], - ['openal', '>=0.0.8', 'OpenAL', []], + ['libpulse', [], 'PulseAudio', [], []], + ['alsa', [], 'ALSA', [], []], + ['portaudio-2.0', [], 'PortAudio', [], []], + ['openal', '>=0.0.8', 'OpenAL', [], ['OpenAL']], # video - ['ffms2', '>=2.22', 'FFMS2', ['ffms2', 'ffms2_dep']], + ['ffms2', '>=2.22', 'FFMS2', ['ffms2', 'ffms2_dep'], []], # other - ['fftw3', [], 'FFTW3', []], - ['hunspell', [], 'Hunspell', ['hunspell', 'hunspell_dep']], - ['uchardet', [], 'uchardet', ['uchardet', 'uchardet_dep']], + ['fftw3', [], 'FFTW3', [], []], + ['hunspell', [], 'Hunspell', ['hunspell', 'hunspell_dep'], []], + ['uchardet', [], 'uchardet', ['uchardet', 'uchardet_dep'], []], ] optname = dep[0].split('-')[0] if not get_option(optname).disabled() @@ -206,6 +206,10 @@ foreach dep: [ d = dependency(dep[0], version: dep[1], required: false) endif + if not d.found() and dep[4].length() > 0 and host_machine.system() == 'darwin' + d = dependency('appleframeworks', modules: dep[4], required: false) + endif + if d.found() deps += d conf.set('WITH_@0@'.format(dep[0].split('-')[0].to_upper()), 1)